Skip to content

Commit

Permalink
Make HttpRequestOptions accept 'headers' parameter when Axios request.
Browse files Browse the repository at this point in the history
  • Loading branch information
sjiang-cb committed Nov 11, 2024
1 parent a55c551 commit c701d5c
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 17 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
pre-process:
name: Pre process
runs-on: ubuntu-latest
outputs:
outputs:
were-only-docs-updated: ${{ steps.were-only-docs-updated-action.outputs.were-only-docs-updated }}
steps:
- name: Checkout code
Expand All @@ -38,7 +38,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 2.
fetch-depth: 2.
- name: Get commit range
id: get-commit-range-action
uses: ./.github/actions/get-commit-range-action
Expand Down Expand Up @@ -86,50 +86,50 @@ jobs:
security-events: write
strategy:
matrix:
node-version: [10.x]
node-version: [10.x]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Create cache folder
run: |
mkdir -p /home/runner/.npm
continue-on-error: true
continue-on-error: true
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache: 'npm'
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: javascript
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2

codacy-analysis-cli:
name: Codacy Analysis CLI
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@main
- name: Run Codacy Analysis CLI
uses: codacy/codacy-analysis-cli-action@master
uses: codacy/codacy-analysis-cli-action@master

Check warning

Code scanning / Semgrep (reported by Codacy)

An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Warning

An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release.
with:
output: results.sarif
format: sarif
# Adjust severity of non-security issues
gh-code-scanning-compat: true
# Force 0 exit code to allow SARIF file generation
# This will handover control about PR rejection to the GitHub side
max-allowed-issues: 2147483647
# Upload the SARIF file generated in the previous step
max-allowed-issues: 2147483647
# Upload the SARIF file generated in the previous step
- name: Upload SARIF results file
uses: github/codeql-action/upload-sarif@main
with:
sarif_file: results.sarif

smoke-test:
name: Smoke Test
runs-on: ubuntu-latest
Expand All @@ -153,7 +153,7 @@ jobs:
cache: 'npm'
- name: Smoke Test
run: |
TZ='Asia/Shanghai'; export TZ
TZ='Asia/Shanghai'; export TZ
mkdir -p g11n-js-client
shopt -s extglob
mv !(g11n-js-client) g11n-js-client/
Expand Down
11 changes: 10 additions & 1 deletion package.client.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@singleton-i18n/js-core-sdk",
"version": "0.5.7",
"version": "0.5.8",
"publishConfig": {
"registry": ""
},
Expand Down Expand Up @@ -54,6 +54,15 @@
"webpack-cli": "^3.3.0"
},
"changelogHistory": [
{
"date": "11/11/24",
"version": "0.5.8",
"notes": [
{
"description": "Make HttpRequestOptions accept 'headers' parameter when Axios request."
}
]
},
{
"date": "06/05/23",
"version": "0.5.7",
Expand Down
11 changes: 10 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@singleton-i18n/js-core-sdk-server",
"version": "0.5.7",
"version": "0.5.8",

Check notice

Code scanning / Tslint (reported by Codacy)

" should be ' Note

" should be '
"publishConfig": {
"registry": ""
},
Expand Down Expand Up @@ -54,6 +54,15 @@
"webpack-cli": "^3.3.0"
},
"changelogHistory": [
{
"date": "11/11/24",

Check notice

Code scanning / Tslint (reported by Codacy)

" should be ' Note

" should be '
"version": "0.5.8",

Check notice

Code scanning / Tslint (reported by Codacy)

" should be ' Note

" should be '
"notes": [

Check notice

Code scanning / Tslint (reported by Codacy)

" should be ' Note

" should be '
{
"description": "Make HttpRequestOptions accept 'headers' parameter when Axios request."

Check notice

Code scanning / Tslint (reported by Codacy)

" should be ' Note

" should be '
}
]
},
{
"date": "06/05/23",
"version": "0.5.7",
Expand Down
5 changes: 4 additions & 1 deletion src/loader.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019-2021 VMware, Inc.
* Copyright 2019-2024 VMware, Inc.
* SPDX-License-Identifier: EPL-2.0
*/
import axios from 'axios';
Expand All @@ -8,8 +8,11 @@ import { basedLogger, Logger } from './logger';
export interface HttpRequestOptions {
timeout?: number;
withCredentials?: boolean;
headers?: HttpHeaders;
}

export type HttpHeaders = { [key: string]: string }

export abstract class Loader {
abstract getI18nResource(url: string, options: HttpRequestOptions): Promise<{ [key: string]: any }>;
}
Expand Down

0 comments on commit c701d5c

Please sign in to comment.