From 68e804629142b5ba53d67879c34b1e6e0be97008 Mon Sep 17 00:00:00 2001 From: songjiang Date: Mon, 11 Nov 2024 16:56:10 +0800 Subject: [PATCH] Make HttpRequestOptions accept 'headers' parameter when Axios request. --- package.client.json | 11 ++++++++++- package.json | 11 ++++++++++- src/loader.ts | 5 ++++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/package.client.json b/package.client.json index ad67720bd..ae2c9fc4e 100644 --- a/package.client.json +++ b/package.client.json @@ -1,6 +1,6 @@ { "name": "@singleton-i18n/js-core-sdk", - "version": "0.5.7", + "version": "0.5.8", "publishConfig": { "registry": "" }, @@ -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", diff --git a/package.json b/package.json index 5d2e14917..6b635d450 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@singleton-i18n/js-core-sdk-server", - "version": "0.5.7", + "version": "0.5.8", "publishConfig": { "registry": "" }, @@ -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", diff --git a/src/loader.ts b/src/loader.ts index acc868262..5c9958227 100644 --- a/src/loader.ts +++ b/src/loader.ts @@ -1,5 +1,5 @@ /* - * Copyright 2019-2021 VMware, Inc. + * Copyright 2019-2024 VMware, Inc. * SPDX-License-Identifier: EPL-2.0 */ import axios from 'axios'; @@ -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 }>; }