@cloudbase/utilities
Advanced tools
Comparing version 2.6.6-beta.0 to 2.7.3-beta.0
@@ -1,2 +0,2 @@ | ||
import { SDKAdapterInterface, AbstractSDKRequest, IRequestOptions, ResponseObject, IUploadRequestOptions, IRequestConfig } from '@cloudbase/adapter-interface'; | ||
import { SDKAdapterInterface, AbstractSDKRequest, IRequestOptions, ResponseObject, IUploadRequestOptions, IRequestConfig, IFetchOptions } from '@cloudbase/adapter-interface'; | ||
declare class WebRequest extends AbstractSDKRequest { | ||
@@ -12,2 +12,3 @@ private readonly timeout; | ||
download(options: IRequestOptions): Promise<any>; | ||
fetch(options: IFetchOptions): Promise<ResponseObject>; | ||
protected request(options: IRequestOptions, enableAbort?: boolean): Promise<ResponseObject>; | ||
@@ -14,0 +15,0 @@ } |
@@ -136,6 +136,42 @@ "use strict"; | ||
}; | ||
WebRequest.prototype.fetch = function (options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var url, _a, enableAbort, _b, stream, abortController, timer, res; | ||
var _this = this; | ||
return __generator(this, function (_c) { | ||
switch (_c.label) { | ||
case 0: | ||
url = options.url, _a = options.enableAbort, enableAbort = _a === void 0 ? false : _a, _b = options.stream, stream = _b === void 0 ? false : _b; | ||
abortController = new AbortController(); | ||
timer = null; | ||
if (enableAbort && this.timeout) { | ||
timer = setTimeout(function () { | ||
console.warn(_this.timeoutMsg); | ||
abortController.abort(_this.timeoutMsg); | ||
}, this.timeout); | ||
} | ||
return [4, fetch(url, __assign(__assign({}, options), { signal: abortController.signal })) | ||
.then(function (x) { | ||
clearTimeout(timer); | ||
return x; | ||
}) | ||
.catch(function (x) { | ||
clearTimeout(timer); | ||
return Promise.reject(x); | ||
})]; | ||
case 1: | ||
res = _c.sent(); | ||
return [2, { | ||
data: stream ? res.body : res.json(), | ||
statusCode: res.status, | ||
header: res.headers, | ||
}]; | ||
} | ||
}); | ||
}); | ||
}; | ||
WebRequest.prototype.request = function (options, enableAbort) { | ||
var _this = this; | ||
if (enableAbort === void 0) { enableAbort = false; } | ||
var method = (String(options.method)).toLowerCase() || 'get'; | ||
var method = String(options.method).toLowerCase() || 'get'; | ||
return new Promise(function (resolve) { | ||
@@ -216,2 +252,2 @@ var url = options.url, _a = options.headers, headers = _a === void 0 ? {} : _a, data = options.data, responseType = options.responseType, withCredentials = options.withCredentials, body = options.body, onUploadProgress = options.onUploadProgress; | ||
exports.genAdapter = genAdapter; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2ViLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2FkYXB0ZXJzL3BsYXRmb3Jtcy93ZWIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSxrRUFRcUM7QUFDckMsd0NBQXNFO0FBQ3RFLGlEQUFvRDtBQUtwRDtJQUF5Qiw4QkFBa0I7SUFPekMsb0JBQVksTUFBc0I7UUFBbEMsWUFDRSxpQkFBTyxTQUtSO1FBSlMsSUFBQSxPQUFPLEdBQW9DLE1BQU0sUUFBMUMsRUFBRSxVQUFVLEdBQXdCLE1BQU0sV0FBOUIsRUFBRSxpQkFBaUIsR0FBSyxNQUFNLGtCQUFYLENBQVc7UUFDekQsS0FBSSxDQUFDLE9BQU8sR0FBRyxPQUFPLElBQUksQ0FBQyxDQUFBO1FBQzNCLEtBQUksQ0FBQyxVQUFVLEdBQUcsVUFBVSxJQUFJLE1BQU0sQ0FBQTtRQUN0QyxLQUFJLENBQUMsaUJBQWlCLEdBQUcsaUJBQWlCLElBQUksQ0FBQyxLQUFLLEVBQUUsTUFBTSxFQUFFLFFBQVEsRUFBRSxVQUFVLENBQUMsQ0FBQTs7SUFDckYsQ0FBQztJQUNNLHdCQUFHLEdBQVYsVUF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GFydHMgPSBsaW5lLnNwbGl0KCc6ICcpXG4gICAgICAgICAgICBjb25zdCBoZWFkZXIgPSBwYXJ0cy5zaGlmdCgpLnRvTG93ZXJDYXNlKClcbiAgICAgICAgICAgIGNvbnN0IHZhbHVlID0gcGFydHMuam9pbignOiAnKVxuICAgICAgICAgICAgaGVhZGVyTWFwW2hlYWRlcl0gPSB2YWx1ZVxuICAgICAgICAgIH0pXG4gICAgICAgICAgcmVzdWx0LmhlYWRlciA9IGhlYWRlck1hcFxuICAgICAgICAgIHJlc3VsdC5zdGF0dXNDb2RlID0gYWpheC5zdGF0dXNcbiAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgLy8g5LiK5LygcG9zdOivt+axgui/lOWbnuaVsOaNruagvOW8j+S4unhtbO+8jOatpOWkhOWuuemUmVxuICAgICAgICAgICAgcmVzdWx0LmRhdGEgPSByZXNwb25zZVR5cGUgPT09ICdibG9iJyA/IGFqYXgucmVzcG9uc2UgOiBKU09OLnBhcnNlKGFqYXgucmVzcG9uc2VUZXh0KVxuICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgIHJlc3VsdC5kYXRhID0gcmVzcG9uc2VUeXBlID09PSAnYmxvYicgPyBhamF4LnJlc3BvbnNlIDogYWpheC5yZXNwb25zZVRleHRcbiAgICAgICAgICB9XG4gICAgICAgICAgY2xlYXJUaW1lb3V0KHRpbWVyKVxuICAgICAgICAgIHJlc29sdmUocmVzdWx0KVxuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpZiAoZW5hYmxlQWJvcnQgJiYgdGhpcy50aW1lb3V0KSB7XG4gICAgICAgIHRpbWVyID0gc2V0VGltZW91dCgoKSA9PiB7XG4gICAgICAgICAgY29uc29sZS53YXJuKHRoaXMudGltZW91dE1zZylcbiAgICAgICAgICBhamF4LmFib3J0KClcbiAgICAgICAgfSwgdGhpcy50aW1lb3V0KVxuICAgICAgfVxuICAgICAgLy8g5aSE55CGIHBheWxvYWRcbiAgICAgIGxldCBwYXlsb2FkXG4gICAgICBpZiAoaXNGb3JtRGF0YShkYXRhKSkge1xuICAgICAgICAvLyBGb3JtRGF0Ye+8jOS4jeWkhOeQhlxuICAgICAgICBwYXlsb2FkID0gZGF0YVxuICAgICAgfSBlbHNlIGlmIChoZWFkZXJzWydjb250ZW50LXR5cGUnXSA9PT0gJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcpIHtcbiAgICAgICAgcGF5bG9hZCA9IHRvUXVlcnlTdHJpbmcoZGF0YSlcbiAgICAgIH0gZWxzZSBpZiAoYm9keSkge1xuICAgICAgICBwYXlsb2FkID0gYm9keVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgLy8g5YW25a6D5oOF5Ya1XG4gICAgICAgIHBheWxvYWQgPSBkYXRhID8gSlNPTi5zdHJpbmdpZnkoZGF0YSkgOiB1bmRlZmluZWRcbiAgICAgIH1cblxuICAgICAgaWYgKHdpdGhDcmVkZW50aWFscykge1xuICAgICAgICBhamF4LndpdGhDcmVkZW50aWFscyA9IHRydWVcbiAgICAgIH1cbiAgICAgIGFqYXguc2VuZChwYXlsb2FkKVxuICAgIH0pXG4gIH1cbn1cblxuZnVuY3Rpb24gZ2VuQWRhcHRlcigpIHtcbiAgY29uc3QgYWRhcHRlcjogU0RLQWRhcHRlckludGVyZmFjZSA9IHtcbiAgICByb290OiB3aW5kb3csXG4gICAgcmVxQ2xhc3M6IFdlYlJlcXVlc3QsXG4gICAgd3NDbGFzczogV2ViU29ja2V0LFxuICAgIGxvY2FsU3RvcmFnZSxcbiAgfVxuICByZXR1cm4gYWRhcHRlclxufVxuXG5leHBvcnQgeyBnZW5BZGFwdGVyLCBXZWJSZXF1ZXN0IH1cbiJdfQ== | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2ViLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2FkYXB0ZX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BsaXQoJzogJylcbiAgICAgICAgICAgIGNvbnN0IGhlYWRlciA9IHBhcnRzLnNoaWZ0KCkudG9Mb3dlckNhc2UoKVxuICAgICAgICAgICAgY29uc3QgdmFsdWUgPSBwYXJ0cy5qb2luKCc6ICcpXG4gICAgICAgICAgICBoZWFkZXJNYXBbaGVhZGVyXSA9IHZhbHVlXG4gICAgICAgICAgfSlcbiAgICAgICAgICByZXN1bHQuaGVhZGVyID0gaGVhZGVyTWFwXG4gICAgICAgICAgcmVzdWx0LnN0YXR1c0NvZGUgPSBhamF4LnN0YXR1c1xuICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAvLyDkuIrkvKBwb3N06K+35rGC6L+U5Zue5pWw5o2u5qC85byP5Li6eG1s77yM5q2k5aSE5a656ZSZXG4gICAgICAgICAgICByZXN1bHQuZGF0YSA9IHJlc3BvbnNlVHlwZSA9PT0gJ2Jsb2InID8gYWpheC5yZXNwb25zZSA6IEpTT04ucGFyc2UoYWpheC5yZXNwb25zZVRleHQpXG4gICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgcmVzdWx0LmRhdGEgPSByZXNwb25zZVR5cGUgPT09ICdibG9iJyA/IGFqYXgucmVzcG9uc2UgOiBhamF4LnJlc3BvbnNlVGV4dFxuICAgICAgICAgIH1cbiAgICAgICAgICBjbGVhclRpbWVvdXQodGltZXIpXG4gICAgICAgICAgcmVzb2x2ZShyZXN1bHQpXG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGlmIChlbmFibGVBYm9ydCAmJiB0aGlzLnRpbWVvdXQpIHtcbiAgICAgICAgdGltZXIgPSBzZXRUaW1lb3V0KCgpID0+IHtcbiAgICAgICAgICBjb25zb2xlLndhcm4odGhpcy50aW1lb3V0TXNnKVxuICAgICAgICAgIGFqYXguYWJvcnQoKVxuICAgICAgICB9LCB0aGlzLnRpbWVvdXQpXG4gICAgICB9XG4gICAgICAvLyDlpITnkIYgcGF5bG9hZFxuICAgICAgbGV0IHBheWxvYWRcbiAgICAgIGlmIChpc0Zvcm1EYXRhKGRhdGEpKSB7XG4gICAgICAgIC8vIEZvcm1EYXRh77yM5LiN5aSE55CGXG4gICAgICAgIHBheWxvYWQgPSBkYXRhXG4gICAgICB9IGVsc2UgaWYgKGhlYWRlcnNbJ2NvbnRlbnQtdHlwZSddID09PSAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJykge1xuICAgICAgICBwYXlsb2FkID0gdG9RdWVyeVN0cmluZyhkYXRhKVxuICAgICAgfSBlbHNlIGlmIChib2R5KSB7XG4gICAgICAgIHBheWxvYWQgPSBib2R5XG4gICAgICB9IGVsc2Uge1xuICAgICAgICAvLyDlhbblroPmg4XlhrVcbiAgICAgICAgcGF5bG9hZCA9IGRhdGEgPyBKU09OLnN0cmluZ2lmeShkYXRhKSA6IHVuZGVmaW5lZFxuICAgICAgfVxuXG4gICAgICBpZiAod2l0aENyZWRlbnRpYWxzKSB7XG4gICAgICAgIGFqYXgud2l0aENyZWRlbnRpYWxzID0gdHJ1ZVxuICAgICAgfVxuICAgICAgYWpheC5zZW5kKHBheWxvYWQpXG4gICAgfSlcbiAgfVxufVxuXG5mdW5jdGlvbiBnZW5BZGFwdGVyKCkge1xuICBjb25zdCBhZGFwdGVyOiBTREtBZGFwdGVySW50ZXJmYWNlID0ge1xuICAgIHJvb3Q6IHdpbmRvdyxcbiAgICByZXFDbGFzczogV2ViUmVxdWVzdCxcbiAgICB3c0NsYXNzOiBXZWJTb2NrZXQsXG4gICAgbG9jYWxTdG9yYWdlLFxuICB9XG4gIHJldHVybiBhZGFwdGVyXG59XG5cbmV4cG9ydCB7IGdlbkFkYXB0ZXIsIFdlYlJlcXVlc3QgfVxuIl19 |
@@ -10,2 +10,3 @@ import { KV } from '@cloudbase/types'; | ||
export declare function genSeqId(): string; | ||
export declare function generateRequestId(): string; | ||
export declare function formatUrl(PROTOCOL: string, url: string, query?: KV<any>): string; | ||
@@ -12,0 +13,0 @@ export declare function toQueryString(query?: KV<any>): string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.transformPhone = exports.sleep = exports.printGroupLog = exports.throwError = exports.printInfo = exports.printError = exports.printWarn = exports.execCallback = exports.createPromiseCallback = exports.removeParam = exports.getHash = exports.getQuery = exports.toQueryString = exports.formatUrl = exports.genSeqId = exports.isFormData = exports.isInstanceOf = exports.isNull = exports.isPalinObject = exports.isUndefined = exports.isString = exports.isArray = void 0; | ||
exports.transformPhone = exports.sleep = exports.printGroupLog = exports.throwError = exports.printInfo = exports.printError = exports.printWarn = exports.execCallback = exports.createPromiseCallback = exports.removeParam = exports.getHash = exports.getQuery = exports.toQueryString = exports.formatUrl = exports.generateRequestId = exports.genSeqId = exports.isFormData = exports.isInstanceOf = exports.isNull = exports.isPalinObject = exports.isUndefined = exports.isString = exports.isArray = void 0; | ||
var constants_1 = require("../constants"); | ||
@@ -38,2 +38,19 @@ function isArray(val) { | ||
exports.genSeqId = genSeqId; | ||
function generateRequestId() { | ||
var d = new Date().getTime(); | ||
var d2 = ((performance === null || performance === void 0 ? void 0 : performance.now) && (performance.now() * 1000)) || 0; | ||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { | ||
var r = Math.random() * 16; | ||
if (d > 0) { | ||
r = (d + r) % 16 | 0; | ||
d = Math.floor(d / 16); | ||
} | ||
else { | ||
r = (d2 + r) % 16 | 0; | ||
d2 = Math.floor(d2 / 16); | ||
} | ||
return (c === 'x' ? r : ((r & 0x7) | 0x8)).toString(16); | ||
}); | ||
} | ||
exports.generateRequestId = generateRequestId; | ||
function formatUrl(PROTOCOL, url, query) { | ||
@@ -199,2 +216,2 @@ if (query === void 0) { query = {}; } | ||
exports.transformPhone = transformPhone; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL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XRsZSwgc3VidGl0bGUgPSAnJywgY29udGVudCA9IFtdLCBwcmludFRyYWNlID0gZmFsc2UsIGNvbGxhcHNlZCA9IGZhbHNlIH0gPSBvcHRpb25zXG4gIGlmIChjb2xsYXBzZWQpIHtcbiAgICBjb25zb2xlLmdyb3VwQ29sbGFwc2VkKHRpdGxlLCBzdWJ0aXRsZSlcbiAgfSBlbHNlIHtcbiAgICBjb25zb2xlLmdyb3VwKHRpdGxlLCBzdWJ0aXRsZSlcbiAgfVxuICBmb3IgKGNvbnN0IHRpcCBvZiBjb250ZW50KSB7XG4gICAgY29uc3QgeyB0eXBlLCBib2R5IH0gPSB0aXBcbiAgICBzd2l0Y2ggKHR5cGUpIHtcbiAgICAgIGNhc2UgJ2luZm8nOlxuICAgICAgICBjb25zb2xlLmxvZyhib2R5KVxuICAgICAgICBicmVha1xuICAgICAgY2FzZSAnd2Fybic6XG4gICAgICAgIGNvbnNvbGUud2Fybihib2R5KVxuICAgICAgICBicmVha1xuICAgICAgY2FzZSAnZXJyb3InOlxuICAgICAgICBjb25zb2xlLmVycm9yKGJvZHkpXG4gICAgICAgIGJyZWFrXG4gICAgfVxuICB9XG4gIGlmIChwcmludFRyYWNlKSB7XG4gICAgY29uc29sZS50cmFjZSgnc3RhY2sgdHJhY2U6JylcbiAgfVxuICBjb25zb2xlLmdyb3VwRW5kKClcbn1cblxuZXhwb3J0IGNvbnN0IHNsZWVwID0gKG1zID0gMCkgPT4gbmV3IFByb21pc2UociA9PiBzZXRUaW1lb3V0KHIsIG1zKSlcblxuZXhwb3J0IGZ1bmN0aW9uIHRyYW5zZm9ybVBob25lKHBob25lTnVtYmVyOiBzdHJpbmcpIHtcbiAgcmV0dXJuIGArODYke3Bob25lTnVtYmVyfWBcbn1cblxuIl19 |
@@ -1,2 +0,2 @@ | ||
import { SDKAdapterInterface, AbstractSDKRequest, IRequestOptions, ResponseObject, IUploadRequestOptions, IRequestConfig } from '@cloudbase/adapter-interface'; | ||
import { SDKAdapterInterface, AbstractSDKRequest, IRequestOptions, ResponseObject, IUploadRequestOptions, IRequestConfig, IFetchOptions } from '@cloudbase/adapter-interface'; | ||
declare class WebRequest extends AbstractSDKRequest { | ||
@@ -12,2 +12,3 @@ private readonly timeout; | ||
download(options: IRequestOptions): Promise<any>; | ||
fetch(options: IFetchOptions): Promise<ResponseObject>; | ||
protected request(options: IRequestOptions, enableAbort?: boolean): Promise<ResponseObject>; | ||
@@ -14,0 +15,0 @@ } |
@@ -133,6 +133,42 @@ var __extends = (this && this.__extends) || (function () { | ||
}; | ||
WebRequest.prototype.fetch = function (options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var url, _a, enableAbort, _b, stream, abortController, timer, res; | ||
var _this = this; | ||
return __generator(this, function (_c) { | ||
switch (_c.label) { | ||
case 0: | ||
url = options.url, _a = options.enableAbort, enableAbort = _a === void 0 ? false : _a, _b = options.stream, stream = _b === void 0 ? false : _b; | ||
abortController = new AbortController(); | ||
timer = null; | ||
if (enableAbort && this.timeout) { | ||
timer = setTimeout(function () { | ||
console.warn(_this.timeoutMsg); | ||
abortController.abort(_this.timeoutMsg); | ||
}, this.timeout); | ||
} | ||
return [4, fetch(url, __assign(__assign({}, options), { signal: abortController.signal })) | ||
.then(function (x) { | ||
clearTimeout(timer); | ||
return x; | ||
}) | ||
.catch(function (x) { | ||
clearTimeout(timer); | ||
return Promise.reject(x); | ||
})]; | ||
case 1: | ||
res = _c.sent(); | ||
return [2, { | ||
data: stream ? res.body : res.json(), | ||
statusCode: res.status, | ||
header: res.headers, | ||
}]; | ||
} | ||
}); | ||
}); | ||
}; | ||
WebRequest.prototype.request = function (options, enableAbort) { | ||
var _this = this; | ||
if (enableAbort === void 0) { enableAbort = false; } | ||
var method = (String(options.method)).toLowerCase() || 'get'; | ||
var method = String(options.method).toLowerCase() || 'get'; | ||
return new Promise(function (resolve) { | ||
@@ -212,2 +248,2 @@ var url = options.url, _a = options.headers, headers = _a === void 0 ? {} : _a, data = options.data, responseType = options.responseType, withCredentials = options.withCredentials, body = options.body, onUploadProgress = options.onUploadProgress; | ||
export { genAdapter, WebRequest }; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2ViLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2FkYXB0ZXJzL3BsYXRmb3Jtcy93ZWIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSxPQUFPLEVBRUwsa0JBQWtCLEdBTW5CLE1BQU0sOEJBQThCLENBQUE7QUFDckMsT0FBTyxFQUFFLFVBQVUsRUFBRSxTQUFTLEVBQUUsYUFBYSxFQUFFLE1BQU0saUJBQWlCLENBQUE7QUFDdEUsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLHdCQUF3QixDQUFBO0FBS3BEO0lBQXlCLDhCQUFrQjtJQU96QyxvQkFBWSxNQUFzQjtRQUFsQyxZQUNFLGlCQUFPLFNBS1I7UUFKUyxJQUFBLE9BQU8sR0FBb0MsTUFBTSxRQUExQyxFQUFFLFVBQVUsR0FBd0IsTUFBTSxXQUE5QixFQUFFLGlCQUFpQixHQUFLLE1BQU0sa0JBQVgsQ0FBVztRQUN6RCxLQUFJLENBQUMsT0FBTyxHQUFHLE9BQU8sSUFBSSxDQUFDLENBQUE7UUFDM0IsS0FBSSxDQUFDLFVBQVUsR0FBRyxVQUFVLElBQUksTUFBTSxDQUFBO1FBQ3RDLEtBQUksQ0FBQyxpQkFBaUIsR0FBRyxpQkFBaUIsSUFBSSxDQUFDLEtBQUssRUFBRSxNQUFNLEVBQUUsUUFBUSxFQUFFLFVBQVUsQ0FBQyxDQUFBOztJQUNyRixDQUFDO0lBQ00sd0JBQUcsR0FBVixVQUFXLE9BQXdCO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gICAgICBjb25zdCBoZWFkZXIgPSBwYXJ0cy5zaGlmdCgpLnRvTG93ZXJDYXNlKClcbiAgICAgICAgICAgIGNvbnN0IHZhbHVlID0gcGFydHMuam9pbignOiAnKVxuICAgICAgICAgICAgaGVhZGVyTWFwW2hlYWRlcl0gPSB2YWx1ZVxuICAgICAgICAgIH0pXG4gICAgICAgICAgcmVzdWx0LmhlYWRlciA9IGhlYWRlck1hcFxuICAgICAgICAgIHJlc3VsdC5zdGF0dXNDb2RlID0gYWpheC5zdGF0dXNcbiAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgLy8g5LiK5LygcG9zdOivt+axgui/lOWbnuaVsOaNruagvOW8j+S4unhtbO+8jOatpOWkhOWuuemUmVxuICAgICAgICAgICAgcmVzdWx0LmRhdGEgPSByZXNwb25zZVR5cGUgPT09ICdibG9iJyA/IGFqYXgucmVzcG9uc2UgOiBKU09OLnBhcnNlKGFqYXgucmVzcG9uc2VUZXh0KVxuICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgIHJlc3VsdC5kYXRhID0gcmVzcG9uc2VUeXBlID09PSAnYmxvYicgPyBhamF4LnJlc3BvbnNlIDogYWpheC5yZXNwb25zZVRleHRcbiAgICAgICAgICB9XG4gICAgICAgICAgY2xlYXJUaW1lb3V0KHRpbWVyKVxuICAgICAgICAgIHJlc29sdmUocmVzdWx0KVxuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpZiAoZW5hYmxlQWJvcnQgJiYgdGhpcy50aW1lb3V0KSB7XG4gICAgICAgIHRpbWVyID0gc2V0VGltZW91dCgoKSA9PiB7XG4gICAgICAgICAgY29uc29sZS53YXJuKHRoaXMudGltZW91dE1zZylcbiAgICAgICAgICBhamF4LmFib3J0KClcbiAgICAgICAgfSwgdGhpcy50aW1lb3V0KVxuICAgICAgfVxuICAgICAgLy8g5aSE55CGIHBheWxvYWRcbiAgICAgIGxldCBwYXlsb2FkXG4gICAgICBpZiAoaXNGb3JtRGF0YShkYXRhKSkge1xuICAgICAgICAvLyBGb3JtRGF0Ye+8jOS4jeWkhOeQhlxuICAgICAgICBwYXlsb2FkID0gZGF0YVxuICAgICAgfSBlbHNlIGlmIChoZWFkZXJzWydjb250ZW50LXR5cGUnXSA9PT0gJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcpIHtcbiAgICAgICAgcGF5bG9hZCA9IHRvUXVlcnlTdHJpbmcoZGF0YSlcbiAgICAgIH0gZWxzZSBpZiAoYm9keSkge1xuICAgICAgICBwYXlsb2FkID0gYm9keVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgLy8g5YW25a6D5oOF5Ya1XG4gICAgICAgIHBheWxvYWQgPSBkYXRhID8gSlNPTi5zdHJpbmdpZnkoZGF0YSkgOiB1bmRlZmluZWRcbiAgICAgIH1cblxuICAgICAgaWYgKHdpdGhDcmVkZW50aWFscykge1xuICAgICAgICBhamF4LndpdGhDcmVkZW50aWFscyA9IHRydWVcbiAgICAgIH1cbiAgICAgIGFqYXguc2VuZChwYXlsb2FkKVxuICAgIH0pXG4gIH1cbn1cblxuZnVuY3Rpb24gZ2VuQWRhcHRlcigpIHtcbiAgY29uc3QgYWRhcHRlcjogU0RLQWRhcHRlckludGVyZmFjZSA9IHtcbiAgICByb290OiB3aW5kb3csXG4gICAgcmVxQ2xhc3M6IFdlYlJlcXVlc3QsXG4gICAgd3NDbGFzczogV2ViU29ja2V0LFxuICAgIGxvY2FsU3RvcmFnZSxcbiAgfVxuICByZXR1cm4gYWRhcHRlclxufVxuXG5leHBvcnQgeyBnZW5BZGFwdGVyLCBXZWJSZXF1ZXN0IH1cbiJdfQ== | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2ViLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2FkYXB0ZXJzL3BsYXRmb3Jtcy93ZWIudHMiXSwibmFtZXMiOlt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gICBjb25zdCBoZWFkZXJNYXAgPSB7fVxuICAgICAgICAgIGFyci5mb3JFYWNoKChsaW5lKSA9PiB7XG4gICAgICAgICAgICBjb25zdCBwYXJ0cyA9IGxpbmUuc3BsaXQoJzogJylcbiAgICAgICAgICAgIGNvbnN0IGhlYWRlciA9IHBhcnRzLnNoaWZ0KCkudG9Mb3dlckNhc2UoKVxuICAgICAgICAgICAgY29uc3QgdmFsdWUgPSBwYXJ0cy5qb2luKCc6ICcpXG4gICAgICAgICAgICBoZWFkZXJNYXBbaGVhZGVyXSA9IHZhbHVlXG4gICAgICAgICAgfSlcbiAgICAgICAgICByZXN1bHQuaGVhZGVyID0gaGVhZGVyTWFwXG4gICAgICAgICAgcmVzdWx0LnN0YXR1c0NvZGUgPSBhamF4LnN0YXR1c1xuICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAvLyDkuIrkvKBwb3N06K+35rGC6L+U5Zue5pWw5o2u5qC85byP5Li6eG1s77yM5q2k5aSE5a656ZSZXG4gICAgICAgICAgICByZXN1bHQuZGF0YSA9IHJlc3BvbnNlVHlwZSA9PT0gJ2Jsb2InID8gYWpheC5yZXNwb25zZSA6IEpTT04ucGFyc2UoYWpheC5yZXNwb25zZVRleHQpXG4gICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgcmVzdWx0LmRhdGEgPSByZXNwb25zZVR5cGUgPT09ICdibG9iJyA/IGFqYXgucmVzcG9uc2UgOiBhamF4LnJlc3BvbnNlVGV4dFxuICAgICAgICAgIH1cbiAgICAgICAgICBjbGVhclRpbWVvdXQodGltZXIpXG4gICAgICAgICAgcmVzb2x2ZShyZXN1bHQpXG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGlmIChlbmFibGVBYm9ydCAmJiB0aGlzLnRpbWVvdXQpIHtcbiAgICAgICAgdGltZXIgPSBzZXRUaW1lb3V0KCgpID0+IHtcbiAgICAgICAgICBjb25zb2xlLndhcm4odGhpcy50aW1lb3V0TXNnKVxu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} from '@cloudbase/types'; | ||
export declare function genSeqId(): string; | ||
export declare function generateRequestId(): string; | ||
export declare function formatUrl(PROTOCOL: string, url: string, query?: KV<any>): string; | ||
@@ -12,0 +13,0 @@ export declare function toQueryString(query?: KV<any>): string; |
@@ -27,2 +27,18 @@ import { getSdkName } from '../constants'; | ||
} | ||
export function generateRequestId() { | ||
var d = new Date().getTime(); | ||
var d2 = ((performance === null || performance === void 0 ? void 0 : performance.now) && (performance.now() * 1000)) || 0; | ||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { | ||
var r = Math.random() * 16; | ||
if (d > 0) { | ||
r = (d + r) % 16 | 0; | ||
d = Math.floor(d / 16); | ||
} | ||
else { | ||
r = (d2 + r) % 16 | 0; | ||
d2 = Math.floor(d2 / 16); | ||
} | ||
return (c === 'x' ? r : ((r & 0x7) | 0x8)).toString(16); | ||
}); | ||
} | ||
export function formatUrl(PROTOCOL, url, query) { | ||
@@ -174,2 +190,2 @@ if (query === void 0) { query = {}; } | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9saWJzL3V0aWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGNBQWMsQ0FBQTtBQUV6QyxNQUFNLFVBQVUsT0FBTyxDQUFDLEdBQVE7SUFDOUIsT0FBTyxNQUFNLENBQUMsU0FBUyxDQUFDLFFBQVEsQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLEtBQUssZ0JBQWdCLENBQUE7QUFDakUsQ0FBQztBQUNELE1BQU0sVUFBVSxRQUFRLENBQUMsR0FBUTtJQUMvQixPQUFPLE9BQU8sR0FBRyxLQUFLLFFBQVEsQ0FBQTtBQUNoQyxDQUFDO0FB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GlvbnM6IElQcmludEdyb3VwTG9nT3B0aW9ucykge1xuICBjb25zdCB7IHRpdGxlLCBzdWJ0aXRsZSA9ICcnLCBjb250ZW50ID0gW10sIHByaW50VHJhY2UgPSBmYWxzZSwgY29sbGFwc2VkID0gZmFsc2UgfSA9IG9wdGlvbnNcbiAgaWYgKGNvbGxhcHNlZCkge1xuICAgIGNvbnNvbGUuZ3JvdXBDb2xsYXBzZWQodGl0bGUsIHN1YnRpdGxlKVxuICB9IGVsc2Uge1xuICAgIGNvbnNvbGUuZ3JvdXAodGl0bGUsIHN1YnRpdGxlKVxuICB9XG4gIGZvciAoY29uc3QgdGlwIG9mIGNvbnRlbnQpIHtcbiAgICBjb25zdCB7IHR5cGUsIGJvZHkgfSA9IHRpcFxuICAgIHN3aXRjaCAodHlwZSkge1xuICAgICAgY2FzZSAnaW5mbyc6XG4gICAgICAgIGNvbnNvbGUubG9nKGJvZHkpXG4gICAgICAgIGJyZWFrXG4gICAgICBjYXNlICd3YXJuJzpcbiAgICAgICAgY29uc29sZS53YXJuKGJvZHkpXG4gICAgICAgIGJyZWFrXG4gICAgICBjYXNlICdlcnJvcic6XG4gICAgICAgIGNvbnNvbGUuZXJyb3IoYm9keSlcbiAgICAgICAgYnJlYWtcbiAgICB9XG4gIH1cbiAgaWYgKHByaW50VHJhY2UpIHtcbiAgICBjb25zb2xlLnRyYWNlKCdzdGFjayB0cmFjZTonKVxuICB9XG4gIGNvbnNvbGUuZ3JvdXBFbmQoKVxufVxuXG5leHBvcnQgY29uc3Qgc2xlZXAgPSAobXMgPSAwKSA9PiBuZXcgUHJvbWlzZShyID0+IHNldFRpbWVvdXQociwgbXMpKVxuXG5leHBvcnQgZnVuY3Rpb24gdHJhbnNmb3JtUGhvbmUocGhvbmVOdW1iZXI6IHN0cmluZykge1xuICByZXR1cm4gYCs4NiR7cGhvbmVOdW1iZXJ9YFxufVxuXG4iXX0= | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJma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TnVtYmVyfWBcbn1cblxuIl19 |
{ | ||
"name": "@cloudbase/utilities", | ||
"version": "2.6.6-beta.0", | ||
"version": "2.7.3-beta.0", | ||
"description": "cloudbase javascript sdk utilities", | ||
@@ -26,7 +26,7 @@ "main": "dist/cjs/index.js", | ||
"dependencies": { | ||
"@cloudbase/adapter-interface": "^0.4.1", | ||
"@cloudbase/types": "^2.6.6-beta.0", | ||
"@cloudbase/adapter-interface": "^0.5", | ||
"@cloudbase/types": "^2.7.3-beta.0", | ||
"jwt-decode": "^3.1.2" | ||
}, | ||
"gitHead": "daac09e8b974059b88131765bd12c9fa3f314b2f" | ||
"gitHead": "ba281f964f720e4f87e79e9f87c7cda352fd4eb2" | ||
} |
@@ -9,2 +9,3 @@ import { | ||
IRequestMethod, | ||
IFetchOptions, | ||
} from '@cloudbase/adapter-interface' | ||
@@ -32,12 +33,18 @@ import { isFormData, formatUrl, toQueryString } from '../../libs/util' | ||
public get(options: IRequestOptions): Promise<ResponseObject> { | ||
return this.request({ | ||
...options, | ||
method: 'get', | ||
}, this.restrictedMethods.includes('get')) | ||
return this.request( | ||
{ | ||
...options, | ||
method: 'get', | ||
}, | ||
this.restrictedMethods.includes('get'), | ||
) | ||
} | ||
public post(options: IRequestOptions): Promise<ResponseObject> { | ||
return this.request({ | ||
...options, | ||
method: 'post', | ||
}, this.restrictedMethods.includes('post')) | ||
return this.request( | ||
{ | ||
...options, | ||
method: 'post', | ||
}, | ||
this.restrictedMethods.includes('post'), | ||
) | ||
} | ||
@@ -61,14 +68,20 @@ public put(options: IRequestOptions): Promise<ResponseObject> { | ||
formData.append('file', file) | ||
return this.request({ | ||
return this.request( | ||
{ | ||
...options, | ||
data: formData, | ||
method: reqMethod, | ||
}, | ||
this.restrictedMethods.includes('upload'), | ||
) | ||
} | ||
return this.request( | ||
{ | ||
...options, | ||
data: formData, | ||
method: reqMethod, | ||
}, this.restrictedMethods.includes('upload')) | ||
} | ||
return this.request({ | ||
...options, | ||
method: 'put', | ||
headers, | ||
body: file, | ||
}, this.restrictedMethods.includes('upload')) | ||
method: 'put', | ||
headers, | ||
body: file, | ||
}, | ||
this.restrictedMethods.includes('upload'), | ||
) | ||
} | ||
@@ -95,3 +108,3 @@ public async download(options: IRequestOptions): Promise<any> { | ||
document.body.removeChild(link) | ||
} catch (e) { } | ||
} catch (e) {} | ||
return new Promise((resolve) => { | ||
@@ -104,2 +117,34 @@ resolve({ | ||
} | ||
async fetch(options: IFetchOptions): Promise<ResponseObject> { | ||
const { url, enableAbort = false, stream = false } = options | ||
const abortController = new AbortController() | ||
let timer = null | ||
if (enableAbort && this.timeout) { | ||
timer = setTimeout(() => { | ||
console.warn(this.timeoutMsg) | ||
abortController.abort(this.timeoutMsg) | ||
}, this.timeout) | ||
} | ||
const res = await fetch(url, { | ||
...options, | ||
signal: abortController.signal, | ||
}) | ||
.then((x) => { | ||
clearTimeout(timer) | ||
return x | ||
}) | ||
.catch((x) => { | ||
clearTimeout(timer) | ||
return Promise.reject(x) | ||
}) | ||
return { | ||
data: stream ? res.body : res.json(), | ||
statusCode: res.status, | ||
header: res.headers, | ||
} | ||
} | ||
/** | ||
@@ -110,3 +155,3 @@ * @param {IRequestOptions} options | ||
protected request(options: IRequestOptions, enableAbort = false): Promise<ResponseObject> { | ||
const method = (String(options.method)).toLowerCase() || 'get' | ||
const method = String(options.method).toLowerCase() || 'get' | ||
return new Promise((resolve) => { | ||
@@ -113,0 +158,0 @@ const { url, headers = {}, data, responseType, withCredentials, body, onUploadProgress } = options |
@@ -29,2 +29,17 @@ import { KV } from '@cloudbase/types' | ||
} | ||
export function generateRequestId() { | ||
let d = new Date().getTime() | ||
let d2 = (performance?.now && (performance.now() * 1000)) || 0 | ||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => { | ||
let r = Math.random() * 16 | ||
if (d > 0) { | ||
r = (d + r) % 16 | 0 | ||
d = Math.floor(d / 16) | ||
} else { | ||
r = (d2 + r) % 16 | 0 | ||
d2 = Math.floor(d2 / 16) | ||
} | ||
return (c === 'x' ? r : ((r & 0x7) | 0x8)).toString(16) | ||
}) | ||
} | ||
export function formatUrl(PROTOCOL: string, url: string, query: KV<any> = {}): string { | ||
@@ -31,0 +46,0 @@ const urlHasQuery = /\?/.test(url) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
325266
3686
2
+ Added@cloudbase/adapter-interface@0.5.0(transitive)
+ Added@cloudbase/types@2.7.3-beta.0(transitive)
- Removed@cloudbase/adapter-interface@0.4.1(transitive)
- Removed@cloudbase/types@2.6.6-beta.0(transitive)