@vasrefil/api-toolkit 1.11.0 → 1.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8,7 +8,7 @@ export interface ApiRequestPayloadI {
|
|
|
8
8
|
headers?: any;
|
|
9
9
|
apiKey?: string;
|
|
10
10
|
}
|
|
11
|
-
export declare const ApiRequest: (request: ApiRequestPayloadI, option
|
|
11
|
+
export declare const ApiRequest: (request: ApiRequestPayloadI, option?: {
|
|
12
12
|
BASEURL: string;
|
|
13
13
|
API_KEY: string;
|
|
14
14
|
}) => Promise<any>;
|
|
@@ -9,8 +9,8 @@ const env_1 = __importDefault(require("../env"));
|
|
|
9
9
|
const helpers_1 = require("../helpers");
|
|
10
10
|
const ApiRequest = async (request, option) => {
|
|
11
11
|
try {
|
|
12
|
-
const baseurl = request.baseurl || option
|
|
13
|
-
const apiKey = request.apiKey || option
|
|
12
|
+
const baseurl = request.baseurl || option?.BASEURL;
|
|
13
|
+
const apiKey = request.apiKey || option?.API_KEY;
|
|
14
14
|
const headers = { 'api-key': apiKey };
|
|
15
15
|
const { data } = await axios_1.default.request({
|
|
16
16
|
method: request.method,
|