@rebuy/rebuy 1.3.0 → 1.3.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.
- package/api.js +5 -5
- package/package.json +1 -1
package/api.js
CHANGED
|
@@ -7,10 +7,10 @@ const config = {
|
|
|
7
7
|
eventDomain: 'https://rebuyengine.com',
|
|
8
8
|
};
|
|
9
9
|
|
|
10
|
-
const makeCall = async (method, path, data, origin, options) => {
|
|
10
|
+
const makeCall = async (method, path, data, origin, options = {}) => {
|
|
11
11
|
const url = `${origin}${path}`;
|
|
12
12
|
const requestUrl = new URL(url);
|
|
13
|
-
const fetchOptions = options
|
|
13
|
+
const fetchOptions = options?.fetch ?? {};
|
|
14
14
|
|
|
15
15
|
const requestData = {
|
|
16
16
|
key: config.key,
|
|
@@ -54,15 +54,15 @@ export class Api {
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
async callEvent(method, path, data, options) {
|
|
57
|
+
async callEvent(method, path, data, options = {}) {
|
|
58
58
|
return await makeCall(method, path, data, config.eventDomain, options);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
async callCdn(method, path, data, options) {
|
|
61
|
+
async callCdn(method, path, data, options = {}) {
|
|
62
62
|
return await makeCall(method, path, data, config.cdnDomain, options);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
async callApi(method, path, data, options) {
|
|
65
|
+
async callApi(method, path, data, options = {}) {
|
|
66
66
|
return await makeCall(method, path, data, config.domain, options);
|
|
67
67
|
}
|
|
68
68
|
}
|