@ontos-ai/knowhere-claw 0.1.0-beta.0
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/README.md +163 -0
- package/dist/_virtual/_rolldown/runtime.js +37 -0
- package/dist/client.d.ts +33 -0
- package/dist/client.js +395 -0
- package/dist/config.d.ts +6 -0
- package/dist/config.js +132 -0
- package/dist/error-message.d.ts +1 -0
- package/dist/error-message.js +48 -0
- package/dist/hooks.d.ts +8 -0
- package/dist/hooks.js +415 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +43 -0
- package/dist/node_modules/.pnpm/@knowhere-ai_sdk@0.1.1/node_modules/@knowhere-ai/sdk/dist/index.js +717 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/adapters/adapters.js +83 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/adapters/fetch.js +170 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/adapters/xhr.js +106 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/axios.js +57 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/cancel/CancelToken.js +90 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/cancel/CanceledError.js +20 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/cancel/isCancel.js +6 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/core/Axios.js +174 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/core/AxiosError.js +70 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/core/AxiosHeaders.js +204 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/core/InterceptorManager.js +60 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/core/buildFullPath.js +20 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/core/dispatchRequest.js +52 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/core/mergeConfig.js +81 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/core/settle.js +18 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/core/transformData.js +25 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/defaults/index.js +107 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/defaults/transitional.js +9 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/env/data.js +4 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +50 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/HttpStatusCode.js +77 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/bind.js +15 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/buildURL.js +40 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/combineURLs.js +14 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/composeSignals.js +39 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/cookies.js +31 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/formDataToJSON.js +67 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/isAbsoluteURL.js +14 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/isAxiosError.js +14 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/isURLSameOrigin.js +8 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/parseHeaders.js +53 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/parseProtocol.js +7 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/progressEventReducer.js +38 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/resolveConfig.js +36 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/speedometer.js +36 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/spread.js +29 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/throttle.js +38 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/toFormData.js +151 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/toURLEncodedForm.js +18 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/trackStream.js +69 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/validator.js +76 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/platform/browser/classes/Blob.js +4 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/platform/browser/classes/FormData.js +4 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +5 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/platform/browser/index.js +22 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/platform/common/utils.js +46 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/platform/index.js +9 -0
- package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/utils.js +698 -0
- package/dist/node_modules/.pnpm/fflate@0.8.2/node_modules/fflate/esm/browser.js +426 -0
- package/dist/node_modules/.pnpm/jszip@3.10.1/node_modules/jszip/dist/jszip.min.js +3110 -0
- package/dist/parser.d.ts +16 -0
- package/dist/parser.js +323 -0
- package/dist/session.d.ts +11 -0
- package/dist/session.js +78 -0
- package/dist/store.d.ts +62 -0
- package/dist/store.js +482 -0
- package/dist/text.d.ts +10 -0
- package/dist/text.js +34 -0
- package/dist/tools.d.ts +9 -0
- package/dist/tools.js +1177 -0
- package/dist/tracker-progress.d.ts +8 -0
- package/dist/tracker-progress.js +197 -0
- package/dist/types.d.ts +247 -0
- package/dist/types.js +9 -0
- package/openclaw.plugin.json +107 -0
- package/package.json +61 -0
- package/skills/knowhere/SKILL.md +243 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import utils_default from "../utils.js";
|
|
2
|
+
import defaults from "../defaults/index.js";
|
|
3
|
+
import AxiosHeaders from "./AxiosHeaders.js";
|
|
4
|
+
//#region node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/core/transformData.js
|
|
5
|
+
/**
|
|
6
|
+
* Transform the data for a request or a response
|
|
7
|
+
*
|
|
8
|
+
* @param {Array|Function} fns A single function or Array of functions
|
|
9
|
+
* @param {?Object} response The response object
|
|
10
|
+
*
|
|
11
|
+
* @returns {*} The resulting transformed data
|
|
12
|
+
*/
|
|
13
|
+
function transformData(fns, response) {
|
|
14
|
+
const config = this || defaults;
|
|
15
|
+
const context = response || config;
|
|
16
|
+
const headers = AxiosHeaders.from(context.headers);
|
|
17
|
+
let data = context.data;
|
|
18
|
+
utils_default.forEach(fns, function transform(fn) {
|
|
19
|
+
data = fn.call(config, data, headers.normalize(), response ? response.status : void 0);
|
|
20
|
+
});
|
|
21
|
+
headers.normalize();
|
|
22
|
+
return data;
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { transformData as default };
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import utils_default from "../utils.js";
|
|
2
|
+
import AxiosError from "../core/AxiosError.js";
|
|
3
|
+
import toFormData from "../helpers/toFormData.js";
|
|
4
|
+
import transitional_default from "./transitional.js";
|
|
5
|
+
import platform_default from "../platform/index.js";
|
|
6
|
+
import toURLEncodedForm from "../helpers/toURLEncodedForm.js";
|
|
7
|
+
import formDataToJSON from "../helpers/formDataToJSON.js";
|
|
8
|
+
//#region node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/defaults/index.js
|
|
9
|
+
/**
|
|
10
|
+
* It takes a string, tries to parse it, and if it fails, it returns the stringified version
|
|
11
|
+
* of the input
|
|
12
|
+
*
|
|
13
|
+
* @param {any} rawValue - The value to be stringified.
|
|
14
|
+
* @param {Function} parser - A function that parses a string into a JavaScript object.
|
|
15
|
+
* @param {Function} encoder - A function that takes a value and returns a string.
|
|
16
|
+
*
|
|
17
|
+
* @returns {string} A stringified version of the rawValue.
|
|
18
|
+
*/
|
|
19
|
+
function stringifySafely(rawValue, parser, encoder) {
|
|
20
|
+
if (utils_default.isString(rawValue)) try {
|
|
21
|
+
(parser || JSON.parse)(rawValue);
|
|
22
|
+
return utils_default.trim(rawValue);
|
|
23
|
+
} catch (e) {
|
|
24
|
+
if (e.name !== "SyntaxError") throw e;
|
|
25
|
+
}
|
|
26
|
+
return (encoder || JSON.stringify)(rawValue);
|
|
27
|
+
}
|
|
28
|
+
const defaults = {
|
|
29
|
+
transitional: transitional_default,
|
|
30
|
+
adapter: [
|
|
31
|
+
"xhr",
|
|
32
|
+
"http",
|
|
33
|
+
"fetch"
|
|
34
|
+
],
|
|
35
|
+
transformRequest: [function transformRequest(data, headers) {
|
|
36
|
+
const contentType = headers.getContentType() || "";
|
|
37
|
+
const hasJSONContentType = contentType.indexOf("application/json") > -1;
|
|
38
|
+
const isObjectPayload = utils_default.isObject(data);
|
|
39
|
+
if (isObjectPayload && utils_default.isHTMLForm(data)) data = new FormData(data);
|
|
40
|
+
if (utils_default.isFormData(data)) return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
|
|
41
|
+
if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data) || utils_default.isReadableStream(data)) return data;
|
|
42
|
+
if (utils_default.isArrayBufferView(data)) return data.buffer;
|
|
43
|
+
if (utils_default.isURLSearchParams(data)) {
|
|
44
|
+
headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
|
|
45
|
+
return data.toString();
|
|
46
|
+
}
|
|
47
|
+
let isFileList;
|
|
48
|
+
if (isObjectPayload) {
|
|
49
|
+
if (contentType.indexOf("application/x-www-form-urlencoded") > -1) return toURLEncodedForm(data, this.formSerializer).toString();
|
|
50
|
+
if ((isFileList = utils_default.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
|
|
51
|
+
const _FormData = this.env && this.env.FormData;
|
|
52
|
+
return toFormData(isFileList ? { "files[]": data } : data, _FormData && new _FormData(), this.formSerializer);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (isObjectPayload || hasJSONContentType) {
|
|
56
|
+
headers.setContentType("application/json", false);
|
|
57
|
+
return stringifySafely(data);
|
|
58
|
+
}
|
|
59
|
+
return data;
|
|
60
|
+
}],
|
|
61
|
+
transformResponse: [function transformResponse(data) {
|
|
62
|
+
const transitional = this.transitional || defaults.transitional;
|
|
63
|
+
const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
64
|
+
const JSONRequested = this.responseType === "json";
|
|
65
|
+
if (utils_default.isResponse(data) || utils_default.isReadableStream(data)) return data;
|
|
66
|
+
if (data && utils_default.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
|
|
67
|
+
const strictJSONParsing = !(transitional && transitional.silentJSONParsing) && JSONRequested;
|
|
68
|
+
try {
|
|
69
|
+
return JSON.parse(data, this.parseReviver);
|
|
70
|
+
} catch (e) {
|
|
71
|
+
if (strictJSONParsing) {
|
|
72
|
+
if (e.name === "SyntaxError") throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
|
|
73
|
+
throw e;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return data;
|
|
78
|
+
}],
|
|
79
|
+
timeout: 0,
|
|
80
|
+
xsrfCookieName: "XSRF-TOKEN",
|
|
81
|
+
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
82
|
+
maxContentLength: -1,
|
|
83
|
+
maxBodyLength: -1,
|
|
84
|
+
env: {
|
|
85
|
+
FormData: platform_default.classes.FormData,
|
|
86
|
+
Blob: platform_default.classes.Blob
|
|
87
|
+
},
|
|
88
|
+
validateStatus: function validateStatus(status) {
|
|
89
|
+
return status >= 200 && status < 300;
|
|
90
|
+
},
|
|
91
|
+
headers: { common: {
|
|
92
|
+
Accept: "application/json, text/plain, */*",
|
|
93
|
+
"Content-Type": void 0
|
|
94
|
+
} }
|
|
95
|
+
};
|
|
96
|
+
utils_default.forEach([
|
|
97
|
+
"delete",
|
|
98
|
+
"get",
|
|
99
|
+
"head",
|
|
100
|
+
"post",
|
|
101
|
+
"put",
|
|
102
|
+
"patch"
|
|
103
|
+
], (method) => {
|
|
104
|
+
defaults.headers[method] = {};
|
|
105
|
+
});
|
|
106
|
+
//#endregion
|
|
107
|
+
export { defaults as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/defaults/transitional.js
|
|
2
|
+
var transitional_default = {
|
|
3
|
+
silentJSONParsing: true,
|
|
4
|
+
forcedJSONParsing: true,
|
|
5
|
+
clarifyTimeoutError: false,
|
|
6
|
+
legacyInterceptorReqResOrdering: true
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { transitional_default as default };
|
package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/AxiosURLSearchParams.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import toFormData from "./toFormData.js";
|
|
2
|
+
//#region node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/AxiosURLSearchParams.js
|
|
3
|
+
/**
|
|
4
|
+
* It encodes a string by replacing all characters that are not in the unreserved set with
|
|
5
|
+
* their percent-encoded equivalents
|
|
6
|
+
*
|
|
7
|
+
* @param {string} str - The string to encode.
|
|
8
|
+
*
|
|
9
|
+
* @returns {string} The encoded string.
|
|
10
|
+
*/
|
|
11
|
+
function encode(str) {
|
|
12
|
+
const charMap = {
|
|
13
|
+
"!": "%21",
|
|
14
|
+
"'": "%27",
|
|
15
|
+
"(": "%28",
|
|
16
|
+
")": "%29",
|
|
17
|
+
"~": "%7E",
|
|
18
|
+
"%20": "+",
|
|
19
|
+
"%00": "\0"
|
|
20
|
+
};
|
|
21
|
+
return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
|
|
22
|
+
return charMap[match];
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* It takes a params object and converts it to a FormData object
|
|
27
|
+
*
|
|
28
|
+
* @param {Object<string, any>} params - The parameters to be converted to a FormData object.
|
|
29
|
+
* @param {Object<string, any>} options - The options object passed to the Axios constructor.
|
|
30
|
+
*
|
|
31
|
+
* @returns {void}
|
|
32
|
+
*/
|
|
33
|
+
function AxiosURLSearchParams(params, options) {
|
|
34
|
+
this._pairs = [];
|
|
35
|
+
params && toFormData(params, this, options);
|
|
36
|
+
}
|
|
37
|
+
const prototype = AxiosURLSearchParams.prototype;
|
|
38
|
+
prototype.append = function append(name, value) {
|
|
39
|
+
this._pairs.push([name, value]);
|
|
40
|
+
};
|
|
41
|
+
prototype.toString = function toString(encoder) {
|
|
42
|
+
const _encode = encoder ? function(value) {
|
|
43
|
+
return encoder.call(this, value, encode);
|
|
44
|
+
} : encode;
|
|
45
|
+
return this._pairs.map(function each(pair) {
|
|
46
|
+
return _encode(pair[0]) + "=" + _encode(pair[1]);
|
|
47
|
+
}, "").join("&");
|
|
48
|
+
};
|
|
49
|
+
//#endregion
|
|
50
|
+
export { AxiosURLSearchParams as default };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
//#region node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/HttpStatusCode.js
|
|
2
|
+
const HttpStatusCode = {
|
|
3
|
+
Continue: 100,
|
|
4
|
+
SwitchingProtocols: 101,
|
|
5
|
+
Processing: 102,
|
|
6
|
+
EarlyHints: 103,
|
|
7
|
+
Ok: 200,
|
|
8
|
+
Created: 201,
|
|
9
|
+
Accepted: 202,
|
|
10
|
+
NonAuthoritativeInformation: 203,
|
|
11
|
+
NoContent: 204,
|
|
12
|
+
ResetContent: 205,
|
|
13
|
+
PartialContent: 206,
|
|
14
|
+
MultiStatus: 207,
|
|
15
|
+
AlreadyReported: 208,
|
|
16
|
+
ImUsed: 226,
|
|
17
|
+
MultipleChoices: 300,
|
|
18
|
+
MovedPermanently: 301,
|
|
19
|
+
Found: 302,
|
|
20
|
+
SeeOther: 303,
|
|
21
|
+
NotModified: 304,
|
|
22
|
+
UseProxy: 305,
|
|
23
|
+
Unused: 306,
|
|
24
|
+
TemporaryRedirect: 307,
|
|
25
|
+
PermanentRedirect: 308,
|
|
26
|
+
BadRequest: 400,
|
|
27
|
+
Unauthorized: 401,
|
|
28
|
+
PaymentRequired: 402,
|
|
29
|
+
Forbidden: 403,
|
|
30
|
+
NotFound: 404,
|
|
31
|
+
MethodNotAllowed: 405,
|
|
32
|
+
NotAcceptable: 406,
|
|
33
|
+
ProxyAuthenticationRequired: 407,
|
|
34
|
+
RequestTimeout: 408,
|
|
35
|
+
Conflict: 409,
|
|
36
|
+
Gone: 410,
|
|
37
|
+
LengthRequired: 411,
|
|
38
|
+
PreconditionFailed: 412,
|
|
39
|
+
PayloadTooLarge: 413,
|
|
40
|
+
UriTooLong: 414,
|
|
41
|
+
UnsupportedMediaType: 415,
|
|
42
|
+
RangeNotSatisfiable: 416,
|
|
43
|
+
ExpectationFailed: 417,
|
|
44
|
+
ImATeapot: 418,
|
|
45
|
+
MisdirectedRequest: 421,
|
|
46
|
+
UnprocessableEntity: 422,
|
|
47
|
+
Locked: 423,
|
|
48
|
+
FailedDependency: 424,
|
|
49
|
+
TooEarly: 425,
|
|
50
|
+
UpgradeRequired: 426,
|
|
51
|
+
PreconditionRequired: 428,
|
|
52
|
+
TooManyRequests: 429,
|
|
53
|
+
RequestHeaderFieldsTooLarge: 431,
|
|
54
|
+
UnavailableForLegalReasons: 451,
|
|
55
|
+
InternalServerError: 500,
|
|
56
|
+
NotImplemented: 501,
|
|
57
|
+
BadGateway: 502,
|
|
58
|
+
ServiceUnavailable: 503,
|
|
59
|
+
GatewayTimeout: 504,
|
|
60
|
+
HttpVersionNotSupported: 505,
|
|
61
|
+
VariantAlsoNegotiates: 506,
|
|
62
|
+
InsufficientStorage: 507,
|
|
63
|
+
LoopDetected: 508,
|
|
64
|
+
NotExtended: 510,
|
|
65
|
+
NetworkAuthenticationRequired: 511,
|
|
66
|
+
WebServerIsDown: 521,
|
|
67
|
+
ConnectionTimedOut: 522,
|
|
68
|
+
OriginIsUnreachable: 523,
|
|
69
|
+
TimeoutOccurred: 524,
|
|
70
|
+
SslHandshakeFailed: 525,
|
|
71
|
+
InvalidSslCertificate: 526
|
|
72
|
+
};
|
|
73
|
+
Object.entries(HttpStatusCode).forEach(([key, value]) => {
|
|
74
|
+
HttpStatusCode[value] = key;
|
|
75
|
+
});
|
|
76
|
+
//#endregion
|
|
77
|
+
export { HttpStatusCode as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/bind.js
|
|
2
|
+
/**
|
|
3
|
+
* Create a bound version of a function with a specified `this` context
|
|
4
|
+
*
|
|
5
|
+
* @param {Function} fn - The function to bind
|
|
6
|
+
* @param {*} thisArg - The value to be passed as the `this` parameter
|
|
7
|
+
* @returns {Function} A new function that will call the original function with the specified `this` context
|
|
8
|
+
*/
|
|
9
|
+
function bind(fn, thisArg) {
|
|
10
|
+
return function wrap() {
|
|
11
|
+
return fn.apply(thisArg, arguments);
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { bind as default };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import utils_default from "../utils.js";
|
|
2
|
+
import AxiosURLSearchParams from "./AxiosURLSearchParams.js";
|
|
3
|
+
//#region node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/buildURL.js
|
|
4
|
+
/**
|
|
5
|
+
* It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their
|
|
6
|
+
* URI encoded counterparts
|
|
7
|
+
*
|
|
8
|
+
* @param {string} val The value to be encoded.
|
|
9
|
+
*
|
|
10
|
+
* @returns {string} The encoded value.
|
|
11
|
+
*/
|
|
12
|
+
function encode(val) {
|
|
13
|
+
return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Build a URL by appending params to the end
|
|
17
|
+
*
|
|
18
|
+
* @param {string} url The base of the url (e.g., http://www.google.com)
|
|
19
|
+
* @param {object} [params] The params to be appended
|
|
20
|
+
* @param {?(object|Function)} options
|
|
21
|
+
*
|
|
22
|
+
* @returns {string} The formatted url
|
|
23
|
+
*/
|
|
24
|
+
function buildURL(url, params, options) {
|
|
25
|
+
if (!params) return url;
|
|
26
|
+
const _encode = options && options.encode || encode;
|
|
27
|
+
const _options = utils_default.isFunction(options) ? { serialize: options } : options;
|
|
28
|
+
const serializeFn = _options && _options.serialize;
|
|
29
|
+
let serializedParams;
|
|
30
|
+
if (serializeFn) serializedParams = serializeFn(params, _options);
|
|
31
|
+
else serializedParams = utils_default.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, _options).toString(_encode);
|
|
32
|
+
if (serializedParams) {
|
|
33
|
+
const hashmarkIndex = url.indexOf("#");
|
|
34
|
+
if (hashmarkIndex !== -1) url = url.slice(0, hashmarkIndex);
|
|
35
|
+
url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
|
|
36
|
+
}
|
|
37
|
+
return url;
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
export { buildURL as default };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/combineURLs.js
|
|
2
|
+
/**
|
|
3
|
+
* Creates a new URL by combining the specified URLs
|
|
4
|
+
*
|
|
5
|
+
* @param {string} baseURL The base URL
|
|
6
|
+
* @param {string} relativeURL The relative URL
|
|
7
|
+
*
|
|
8
|
+
* @returns {string} The combined URL
|
|
9
|
+
*/
|
|
10
|
+
function combineURLs(baseURL, relativeURL) {
|
|
11
|
+
return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { combineURLs as default };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import utils_default from "../utils.js";
|
|
2
|
+
import AxiosError from "../core/AxiosError.js";
|
|
3
|
+
import CanceledError from "../cancel/CanceledError.js";
|
|
4
|
+
//#region node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/composeSignals.js
|
|
5
|
+
const composeSignals = (signals, timeout) => {
|
|
6
|
+
const { length } = signals = signals ? signals.filter(Boolean) : [];
|
|
7
|
+
if (timeout || length) {
|
|
8
|
+
let controller = new AbortController();
|
|
9
|
+
let aborted;
|
|
10
|
+
const onabort = function(reason) {
|
|
11
|
+
if (!aborted) {
|
|
12
|
+
aborted = true;
|
|
13
|
+
unsubscribe();
|
|
14
|
+
const err = reason instanceof Error ? reason : this.reason;
|
|
15
|
+
controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
let timer = timeout && setTimeout(() => {
|
|
19
|
+
timer = null;
|
|
20
|
+
onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT));
|
|
21
|
+
}, timeout);
|
|
22
|
+
const unsubscribe = () => {
|
|
23
|
+
if (signals) {
|
|
24
|
+
timer && clearTimeout(timer);
|
|
25
|
+
timer = null;
|
|
26
|
+
signals.forEach((signal) => {
|
|
27
|
+
signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener("abort", onabort);
|
|
28
|
+
});
|
|
29
|
+
signals = null;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
signals.forEach((signal) => signal.addEventListener("abort", onabort));
|
|
33
|
+
const { signal } = controller;
|
|
34
|
+
signal.unsubscribe = () => utils_default.asap(unsubscribe);
|
|
35
|
+
return signal;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
//#endregion
|
|
39
|
+
export { composeSignals as default };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import utils_default from "../utils.js";
|
|
2
|
+
import platform_default from "../platform/index.js";
|
|
3
|
+
//#region node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/cookies.js
|
|
4
|
+
var cookies_default = platform_default.hasStandardBrowserEnv ? {
|
|
5
|
+
write(name, value, expires, path, domain, secure, sameSite) {
|
|
6
|
+
if (typeof document === "undefined") return;
|
|
7
|
+
const cookie = [`${name}=${encodeURIComponent(value)}`];
|
|
8
|
+
if (utils_default.isNumber(expires)) cookie.push(`expires=${new Date(expires).toUTCString()}`);
|
|
9
|
+
if (utils_default.isString(path)) cookie.push(`path=${path}`);
|
|
10
|
+
if (utils_default.isString(domain)) cookie.push(`domain=${domain}`);
|
|
11
|
+
if (secure === true) cookie.push("secure");
|
|
12
|
+
if (utils_default.isString(sameSite)) cookie.push(`SameSite=${sameSite}`);
|
|
13
|
+
document.cookie = cookie.join("; ");
|
|
14
|
+
},
|
|
15
|
+
read(name) {
|
|
16
|
+
if (typeof document === "undefined") return null;
|
|
17
|
+
const match = document.cookie.match(new RegExp("(?:^|; )" + name + "=([^;]*)"));
|
|
18
|
+
return match ? decodeURIComponent(match[1]) : null;
|
|
19
|
+
},
|
|
20
|
+
remove(name) {
|
|
21
|
+
this.write(name, "", Date.now() - 864e5, "/");
|
|
22
|
+
}
|
|
23
|
+
} : {
|
|
24
|
+
write() {},
|
|
25
|
+
read() {
|
|
26
|
+
return null;
|
|
27
|
+
},
|
|
28
|
+
remove() {}
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { cookies_default as default };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import utils_default from "../utils.js";
|
|
2
|
+
//#region node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/formDataToJSON.js
|
|
3
|
+
/**
|
|
4
|
+
* It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
|
|
5
|
+
*
|
|
6
|
+
* @param {string} name - The name of the property to get.
|
|
7
|
+
*
|
|
8
|
+
* @returns An array of strings.
|
|
9
|
+
*/
|
|
10
|
+
function parsePropPath(name) {
|
|
11
|
+
return utils_default.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
|
|
12
|
+
return match[0] === "[]" ? "" : match[1] || match[0];
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Convert an array to an object.
|
|
17
|
+
*
|
|
18
|
+
* @param {Array<any>} arr - The array to convert to an object.
|
|
19
|
+
*
|
|
20
|
+
* @returns An object with the same keys and values as the array.
|
|
21
|
+
*/
|
|
22
|
+
function arrayToObject(arr) {
|
|
23
|
+
const obj = {};
|
|
24
|
+
const keys = Object.keys(arr);
|
|
25
|
+
let i;
|
|
26
|
+
const len = keys.length;
|
|
27
|
+
let key;
|
|
28
|
+
for (i = 0; i < len; i++) {
|
|
29
|
+
key = keys[i];
|
|
30
|
+
obj[key] = arr[key];
|
|
31
|
+
}
|
|
32
|
+
return obj;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* It takes a FormData object and returns a JavaScript object
|
|
36
|
+
*
|
|
37
|
+
* @param {string} formData The FormData object to convert to JSON.
|
|
38
|
+
*
|
|
39
|
+
* @returns {Object<string, any> | null} The converted object.
|
|
40
|
+
*/
|
|
41
|
+
function formDataToJSON(formData) {
|
|
42
|
+
function buildPath(path, value, target, index) {
|
|
43
|
+
let name = path[index++];
|
|
44
|
+
if (name === "__proto__") return true;
|
|
45
|
+
const isNumericKey = Number.isFinite(+name);
|
|
46
|
+
const isLast = index >= path.length;
|
|
47
|
+
name = !name && utils_default.isArray(target) ? target.length : name;
|
|
48
|
+
if (isLast) {
|
|
49
|
+
if (utils_default.hasOwnProp(target, name)) target[name] = [target[name], value];
|
|
50
|
+
else target[name] = value;
|
|
51
|
+
return !isNumericKey;
|
|
52
|
+
}
|
|
53
|
+
if (!target[name] || !utils_default.isObject(target[name])) target[name] = [];
|
|
54
|
+
if (buildPath(path, value, target[name], index) && utils_default.isArray(target[name])) target[name] = arrayToObject(target[name]);
|
|
55
|
+
return !isNumericKey;
|
|
56
|
+
}
|
|
57
|
+
if (utils_default.isFormData(formData) && utils_default.isFunction(formData.entries)) {
|
|
58
|
+
const obj = {};
|
|
59
|
+
utils_default.forEachEntry(formData, (name, value) => {
|
|
60
|
+
buildPath(parsePropPath(name), value, obj, 0);
|
|
61
|
+
});
|
|
62
|
+
return obj;
|
|
63
|
+
}
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
//#endregion
|
|
67
|
+
export { formDataToJSON as default };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/isAbsoluteURL.js
|
|
2
|
+
/**
|
|
3
|
+
* Determines whether the specified URL is absolute
|
|
4
|
+
*
|
|
5
|
+
* @param {string} url The URL to test
|
|
6
|
+
*
|
|
7
|
+
* @returns {boolean} True if the specified URL is absolute, otherwise false
|
|
8
|
+
*/
|
|
9
|
+
function isAbsoluteURL(url) {
|
|
10
|
+
if (typeof url !== "string") return false;
|
|
11
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { isAbsoluteURL as default };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import utils_default from "../utils.js";
|
|
2
|
+
//#region node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/isAxiosError.js
|
|
3
|
+
/**
|
|
4
|
+
* Determines whether the payload is an error thrown by Axios
|
|
5
|
+
*
|
|
6
|
+
* @param {*} payload The value to test
|
|
7
|
+
*
|
|
8
|
+
* @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
|
|
9
|
+
*/
|
|
10
|
+
function isAxiosError(payload) {
|
|
11
|
+
return utils_default.isObject(payload) && payload.isAxiosError === true;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { isAxiosError as default };
|
package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/isURLSameOrigin.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import platform_default from "../platform/index.js";
|
|
2
|
+
//#region node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/isURLSameOrigin.js
|
|
3
|
+
var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {
|
|
4
|
+
url = new URL(url, platform_default.origin);
|
|
5
|
+
return origin.protocol === url.protocol && origin.host === url.host && (isMSIE || origin.port === url.port);
|
|
6
|
+
})(new URL(platform_default.origin), platform_default.navigator && /(msie|trident)/i.test(platform_default.navigator.userAgent)) : () => true;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { isURLSameOrigin_default as default };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import utils_default from "../utils.js";
|
|
2
|
+
//#region node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/parseHeaders.js
|
|
3
|
+
const ignoreDuplicateOf = utils_default.toObjectSet([
|
|
4
|
+
"age",
|
|
5
|
+
"authorization",
|
|
6
|
+
"content-length",
|
|
7
|
+
"content-type",
|
|
8
|
+
"etag",
|
|
9
|
+
"expires",
|
|
10
|
+
"from",
|
|
11
|
+
"host",
|
|
12
|
+
"if-modified-since",
|
|
13
|
+
"if-unmodified-since",
|
|
14
|
+
"last-modified",
|
|
15
|
+
"location",
|
|
16
|
+
"max-forwards",
|
|
17
|
+
"proxy-authorization",
|
|
18
|
+
"referer",
|
|
19
|
+
"retry-after",
|
|
20
|
+
"user-agent"
|
|
21
|
+
]);
|
|
22
|
+
/**
|
|
23
|
+
* Parse headers into an object
|
|
24
|
+
*
|
|
25
|
+
* ```
|
|
26
|
+
* Date: Wed, 27 Aug 2014 08:58:49 GMT
|
|
27
|
+
* Content-Type: application/json
|
|
28
|
+
* Connection: keep-alive
|
|
29
|
+
* Transfer-Encoding: chunked
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @param {String} rawHeaders Headers needing to be parsed
|
|
33
|
+
*
|
|
34
|
+
* @returns {Object} Headers parsed into an object
|
|
35
|
+
*/
|
|
36
|
+
var parseHeaders_default = (rawHeaders) => {
|
|
37
|
+
const parsed = {};
|
|
38
|
+
let key;
|
|
39
|
+
let val;
|
|
40
|
+
let i;
|
|
41
|
+
rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
|
|
42
|
+
i = line.indexOf(":");
|
|
43
|
+
key = line.substring(0, i).trim().toLowerCase();
|
|
44
|
+
val = line.substring(i + 1).trim();
|
|
45
|
+
if (!key || parsed[key] && ignoreDuplicateOf[key]) return;
|
|
46
|
+
if (key === "set-cookie") if (parsed[key]) parsed[key].push(val);
|
|
47
|
+
else parsed[key] = [val];
|
|
48
|
+
else parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
|
|
49
|
+
});
|
|
50
|
+
return parsed;
|
|
51
|
+
};
|
|
52
|
+
//#endregion
|
|
53
|
+
export { parseHeaders_default as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/parseProtocol.js
|
|
2
|
+
function parseProtocol(url) {
|
|
3
|
+
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
|
4
|
+
return match && match[1] || "";
|
|
5
|
+
}
|
|
6
|
+
//#endregion
|
|
7
|
+
export { parseProtocol as default };
|
package/dist/node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/progressEventReducer.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import utils_default from "../utils.js";
|
|
2
|
+
import speedometer from "./speedometer.js";
|
|
3
|
+
import throttle from "./throttle.js";
|
|
4
|
+
//#region node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/progressEventReducer.js
|
|
5
|
+
const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
6
|
+
let bytesNotified = 0;
|
|
7
|
+
const _speedometer = speedometer(50, 250);
|
|
8
|
+
return throttle((e) => {
|
|
9
|
+
const loaded = e.loaded;
|
|
10
|
+
const total = e.lengthComputable ? e.total : void 0;
|
|
11
|
+
const progressBytes = loaded - bytesNotified;
|
|
12
|
+
const rate = _speedometer(progressBytes);
|
|
13
|
+
const inRange = loaded <= total;
|
|
14
|
+
bytesNotified = loaded;
|
|
15
|
+
listener({
|
|
16
|
+
loaded,
|
|
17
|
+
total,
|
|
18
|
+
progress: total ? loaded / total : void 0,
|
|
19
|
+
bytes: progressBytes,
|
|
20
|
+
rate: rate ? rate : void 0,
|
|
21
|
+
estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
|
|
22
|
+
event: e,
|
|
23
|
+
lengthComputable: total != null,
|
|
24
|
+
[isDownloadStream ? "download" : "upload"]: true
|
|
25
|
+
});
|
|
26
|
+
}, freq);
|
|
27
|
+
};
|
|
28
|
+
const progressEventDecorator = (total, throttled) => {
|
|
29
|
+
const lengthComputable = total != null;
|
|
30
|
+
return [(loaded) => throttled[0]({
|
|
31
|
+
lengthComputable,
|
|
32
|
+
total,
|
|
33
|
+
loaded
|
|
34
|
+
}), throttled[1]];
|
|
35
|
+
};
|
|
36
|
+
const asyncDecorator = (fn) => (...args) => utils_default.asap(() => fn(...args));
|
|
37
|
+
//#endregion
|
|
38
|
+
export { asyncDecorator, progressEventDecorator, progressEventReducer };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import utils_default from "../utils.js";
|
|
2
|
+
import buildURL from "./buildURL.js";
|
|
3
|
+
import platform_default from "../platform/index.js";
|
|
4
|
+
import AxiosHeaders from "../core/AxiosHeaders.js";
|
|
5
|
+
import isURLSameOrigin_default from "./isURLSameOrigin.js";
|
|
6
|
+
import cookies_default from "./cookies.js";
|
|
7
|
+
import buildFullPath from "../core/buildFullPath.js";
|
|
8
|
+
import mergeConfig from "../core/mergeConfig.js";
|
|
9
|
+
//#region node_modules/.pnpm/axios@1.13.6/node_modules/axios/lib/helpers/resolveConfig.js
|
|
10
|
+
var resolveConfig_default = (config) => {
|
|
11
|
+
const newConfig = mergeConfig({}, config);
|
|
12
|
+
let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
|
|
13
|
+
newConfig.headers = headers = AxiosHeaders.from(headers);
|
|
14
|
+
newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
|
|
15
|
+
if (auth) headers.set("Authorization", "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : "")));
|
|
16
|
+
if (utils_default.isFormData(data)) {
|
|
17
|
+
if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv) headers.setContentType(void 0);
|
|
18
|
+
else if (utils_default.isFunction(data.getHeaders)) {
|
|
19
|
+
const formHeaders = data.getHeaders();
|
|
20
|
+
const allowedHeaders = ["content-type", "content-length"];
|
|
21
|
+
Object.entries(formHeaders).forEach(([key, val]) => {
|
|
22
|
+
if (allowedHeaders.includes(key.toLowerCase())) headers.set(key, val);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (platform_default.hasStandardBrowserEnv) {
|
|
27
|
+
withXSRFToken && utils_default.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
|
|
28
|
+
if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin_default(newConfig.url)) {
|
|
29
|
+
const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies_default.read(xsrfCookieName);
|
|
30
|
+
if (xsrfValue) headers.set(xsrfHeaderName, xsrfValue);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return newConfig;
|
|
34
|
+
};
|
|
35
|
+
//#endregion
|
|
36
|
+
export { resolveConfig_default as default };
|