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 68e8046
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
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 68e8046

Please sign in to comment.