@blocklet/js-sdk 1.16.26-beta-63f52a83 → 1.16.26
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/dist/index.cjs +19 -11
- package/dist/index.mjs +19 -11
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -138,13 +138,17 @@ async function sleepForLoading(config, lazyTime = 300) {
|
|
|
138
138
|
delete config.metaData;
|
|
139
139
|
}
|
|
140
140
|
const createAxios$1 = (options, requestParams) => {
|
|
141
|
+
const headers = {
|
|
142
|
+
...options?.headers,
|
|
143
|
+
"x-blocklet-js-sdk-version": version
|
|
144
|
+
};
|
|
145
|
+
const visitorId = getVisitorId();
|
|
146
|
+
if (![void 0, null].includes(visitorId)) {
|
|
147
|
+
headers["x-blocklet-visitor-id"] = visitorId;
|
|
148
|
+
}
|
|
141
149
|
const instance = axios__default.create({
|
|
142
150
|
...options,
|
|
143
|
-
headers
|
|
144
|
-
...options?.headers,
|
|
145
|
-
"x-blocklet-js-sdk-version": version,
|
|
146
|
-
"x-blocklet-visitor-id": getVisitorId()
|
|
147
|
-
}
|
|
151
|
+
headers
|
|
148
152
|
});
|
|
149
153
|
if (requestParams?.lazy) {
|
|
150
154
|
instance.interceptors.request.use(
|
|
@@ -252,15 +256,19 @@ function createRequest$1({
|
|
|
252
256
|
function createFetch$1(globalOptions = {}, requestParams) {
|
|
253
257
|
return async (input, options) => {
|
|
254
258
|
const startAt = Date.now();
|
|
259
|
+
const headers = {
|
|
260
|
+
...globalOptions?.headers,
|
|
261
|
+
...options?.headers,
|
|
262
|
+
"x-blocklet-js-sdk-version": version
|
|
263
|
+
};
|
|
264
|
+
const visitorId = getVisitorId();
|
|
265
|
+
if (![void 0, null].includes(visitorId)) {
|
|
266
|
+
headers["x-blocklet-visitor-id"] = visitorId;
|
|
267
|
+
}
|
|
255
268
|
const request = fetch(input, {
|
|
256
269
|
...globalOptions,
|
|
257
270
|
...options,
|
|
258
|
-
headers
|
|
259
|
-
...globalOptions?.headers,
|
|
260
|
-
...options?.headers,
|
|
261
|
-
"x-blocklet-js-sdk-version": version,
|
|
262
|
-
"x-blocklet-visitor-id": getVisitorId()
|
|
263
|
-
}
|
|
271
|
+
headers
|
|
264
272
|
});
|
|
265
273
|
try {
|
|
266
274
|
return request;
|
package/dist/index.mjs
CHANGED
|
@@ -131,13 +131,17 @@ async function sleepForLoading(config, lazyTime = 300) {
|
|
|
131
131
|
delete config.metaData;
|
|
132
132
|
}
|
|
133
133
|
const createAxios$1 = (options, requestParams) => {
|
|
134
|
+
const headers = {
|
|
135
|
+
...options?.headers,
|
|
136
|
+
"x-blocklet-js-sdk-version": version
|
|
137
|
+
};
|
|
138
|
+
const visitorId = getVisitorId();
|
|
139
|
+
if (![void 0, null].includes(visitorId)) {
|
|
140
|
+
headers["x-blocklet-visitor-id"] = visitorId;
|
|
141
|
+
}
|
|
134
142
|
const instance = axios.create({
|
|
135
143
|
...options,
|
|
136
|
-
headers
|
|
137
|
-
...options?.headers,
|
|
138
|
-
"x-blocklet-js-sdk-version": version,
|
|
139
|
-
"x-blocklet-visitor-id": getVisitorId()
|
|
140
|
-
}
|
|
144
|
+
headers
|
|
141
145
|
});
|
|
142
146
|
if (requestParams?.lazy) {
|
|
143
147
|
instance.interceptors.request.use(
|
|
@@ -245,15 +249,19 @@ function createRequest$1({
|
|
|
245
249
|
function createFetch$1(globalOptions = {}, requestParams) {
|
|
246
250
|
return async (input, options) => {
|
|
247
251
|
const startAt = Date.now();
|
|
252
|
+
const headers = {
|
|
253
|
+
...globalOptions?.headers,
|
|
254
|
+
...options?.headers,
|
|
255
|
+
"x-blocklet-js-sdk-version": version
|
|
256
|
+
};
|
|
257
|
+
const visitorId = getVisitorId();
|
|
258
|
+
if (![void 0, null].includes(visitorId)) {
|
|
259
|
+
headers["x-blocklet-visitor-id"] = visitorId;
|
|
260
|
+
}
|
|
248
261
|
const request = fetch(input, {
|
|
249
262
|
...globalOptions,
|
|
250
263
|
...options,
|
|
251
|
-
headers
|
|
252
|
-
...globalOptions?.headers,
|
|
253
|
-
...options?.headers,
|
|
254
|
-
"x-blocklet-js-sdk-version": version,
|
|
255
|
-
"x-blocklet-visitor-id": getVisitorId()
|
|
256
|
-
}
|
|
264
|
+
headers
|
|
257
265
|
});
|
|
258
266
|
try {
|
|
259
267
|
return request;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/js-sdk",
|
|
3
|
-
"version": "1.16.26
|
|
3
|
+
"version": "1.16.26",
|
|
4
4
|
"main": "dist/index.cjs",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"build": "unbuild"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@abtnode/constant": "1.16.26
|
|
34
|
+
"@abtnode/constant": "1.16.26",
|
|
35
35
|
"axios": "^0.27.2",
|
|
36
36
|
"js-cookie": "^3.0.5",
|
|
37
37
|
"ufo": "^1.3.2"
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"unbuild": "^2.0.0"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "8abf4051293ad67271e96ffcaad70ecb90356f3f"
|
|
43
43
|
}
|