@translated/lara
Advanced tools
Comparing version 1.2.2 to 1.3.0
@@ -18,3 +18,5 @@ type HttpMethod = "GET" | "POST" | "PUT" | "DELETE"; | ||
private readonly accessKeySecret; | ||
private readonly extraHeaders; | ||
protected constructor(accessKeyId: string, accessKeySecret: string); | ||
setExtraHeader(name: string, value: string): void; | ||
get<T>(path: string, params?: Record<string, any>): Promise<T>; | ||
@@ -21,0 +23,0 @@ delete<T>(path: string, params?: Record<string, any>): Promise<T>; |
@@ -36,5 +36,9 @@ "use strict"; | ||
this.crypto = (0, crypto_1.default)(); | ||
this.extraHeaders = {}; | ||
this.accessKeyId = accessKeyId; | ||
this.accessKeySecret = accessKeySecret; | ||
} | ||
setExtraHeader(name, value) { | ||
this.extraHeaders[name] = value; | ||
} | ||
get(path, params) { | ||
@@ -59,3 +63,4 @@ return this.request("GET", path, params); | ||
"X-Lara-SDK-Name": "lara-node", | ||
'X-Lara-SDK-Version': sdk_version_1.version | ||
'X-Lara-SDK-Version': sdk_version_1.version, | ||
...this.extraHeaders | ||
}; | ||
@@ -62,0 +67,0 @@ if (body) { |
@@ -1,1 +0,1 @@ | ||
export declare const version = "1.2.2"; | ||
export declare const version = "1.3.0"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.version = void 0; | ||
exports.version = "1.2.2"; | ||
exports.version = "1.3.0"; |
{ | ||
"name": "@translated/lara", | ||
"version": "1.2.2", | ||
"version": "1.3.0", | ||
"main": "lib/index.js", | ||
@@ -5,0 +5,0 @@ "types": "lib/index.d.ts", |
29349
674