backlog-js 0.16.0 → 0.17.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 +18 -2
- package/dist/backlog.iife.js +3278 -0
- package/dist/backlog.iife.min.js +4 -0
- package/dist/backlog.js +3243 -3867
- package/dist/backlog.min.js +4 -1
- package/dist/chunk-CfYAbeIz.mjs +13 -0
- package/dist/index.cjs +1286 -0
- package/dist/index.d.cts +2047 -0
- package/dist/index.d.mts +2047 -0
- package/dist/index.mjs +1229 -0
- package/package.json +36 -31
- package/CHANGELOG.md +0 -142
- package/dist/types/backlog.d.ts +0 -606
- package/dist/types/entity.d.ts +0 -544
- package/dist/types/error.d.ts +0 -37
- package/dist/types/index.d.ts +0 -7
- package/dist/types/oauth2.d.ts +0 -21
- package/dist/types/option.d.ts +0 -437
- package/dist/types/request.d.ts +0 -27
- package/dist/types/types.d.ts +0 -59
|
@@ -0,0 +1,3278 @@
|
|
|
1
|
+
var Backlog = (function(exports) {
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
//#region \0rolldown/runtime.js
|
|
5
|
+
var __create = Object.create;
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
9
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
10
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
12
|
+
var __exportAll = (all, no_symbols) => {
|
|
13
|
+
let target = {};
|
|
14
|
+
for (var name in all) {
|
|
15
|
+
__defProp(target, name, {
|
|
16
|
+
get: all[name],
|
|
17
|
+
enumerable: true
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
if (!no_symbols) {
|
|
21
|
+
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
22
|
+
}
|
|
23
|
+
return target;
|
|
24
|
+
};
|
|
25
|
+
var __copyProps = (to, from, except, desc) => {
|
|
26
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
27
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
28
|
+
key = keys[i];
|
|
29
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
30
|
+
__defProp(to, key, {
|
|
31
|
+
get: ((k) => from[k]).bind(null, key),
|
|
32
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return to;
|
|
38
|
+
};
|
|
39
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
40
|
+
value: mod,
|
|
41
|
+
enumerable: true
|
|
42
|
+
}) : target, mod));
|
|
43
|
+
|
|
44
|
+
//#endregion
|
|
45
|
+
|
|
46
|
+
//#region src/error.ts
|
|
47
|
+
var error_exports = /* @__PURE__ */ __exportAll({
|
|
48
|
+
BacklogApiError: () => BacklogApiError,
|
|
49
|
+
BacklogAuthError: () => BacklogAuthError,
|
|
50
|
+
BacklogError: () => BacklogError,
|
|
51
|
+
UnexpectedError: () => UnexpectedError
|
|
52
|
+
});
|
|
53
|
+
var BacklogError = class extends Error {
|
|
54
|
+
_name;
|
|
55
|
+
_url;
|
|
56
|
+
_status;
|
|
57
|
+
_body;
|
|
58
|
+
_response;
|
|
59
|
+
constructor(name, response, body) {
|
|
60
|
+
super(response.statusText);
|
|
61
|
+
this._name = name;
|
|
62
|
+
this._url = response.url;
|
|
63
|
+
this._status = response.status;
|
|
64
|
+
this._body = body;
|
|
65
|
+
this._response = response;
|
|
66
|
+
}
|
|
67
|
+
get name() {
|
|
68
|
+
return this._name;
|
|
69
|
+
}
|
|
70
|
+
get url() {
|
|
71
|
+
return this._url;
|
|
72
|
+
}
|
|
73
|
+
get status() {
|
|
74
|
+
return this._status;
|
|
75
|
+
}
|
|
76
|
+
get body() {
|
|
77
|
+
return this._body;
|
|
78
|
+
}
|
|
79
|
+
get response() {
|
|
80
|
+
return this._response;
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
var BacklogApiError = class extends BacklogError {
|
|
84
|
+
constructor(response, body) {
|
|
85
|
+
super("BacklogApiError", response, body);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
var BacklogAuthError = class extends BacklogError {
|
|
89
|
+
constructor(response, body) {
|
|
90
|
+
super("BacklogAuthError", response, body);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
var UnexpectedError = class extends BacklogError {
|
|
94
|
+
constructor(response) {
|
|
95
|
+
super("UnexpectedError", response);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
//#endregion
|
|
100
|
+
//#region node_modules/es-errors/type.js
|
|
101
|
+
var require_type = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
102
|
+
/** @type {import('./type')} */
|
|
103
|
+
module.exports = TypeError;
|
|
104
|
+
}));
|
|
105
|
+
|
|
106
|
+
//#endregion
|
|
107
|
+
//#region (ignored) node_modules/object-inspect/util.inspect.js
|
|
108
|
+
var require_util_inspect = /* @__PURE__ */ __commonJSMin((() => {}));
|
|
109
|
+
|
|
110
|
+
//#endregion
|
|
111
|
+
//#region node_modules/object-inspect/index.js
|
|
112
|
+
var require_object_inspect = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
113
|
+
var hasMap = typeof Map === "function" && Map.prototype;
|
|
114
|
+
var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null;
|
|
115
|
+
var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === "function" ? mapSizeDescriptor.get : null;
|
|
116
|
+
var mapForEach = hasMap && Map.prototype.forEach;
|
|
117
|
+
var hasSet = typeof Set === "function" && Set.prototype;
|
|
118
|
+
var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null;
|
|
119
|
+
var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === "function" ? setSizeDescriptor.get : null;
|
|
120
|
+
var setForEach = hasSet && Set.prototype.forEach;
|
|
121
|
+
var weakMapHas = typeof WeakMap === "function" && WeakMap.prototype ? WeakMap.prototype.has : null;
|
|
122
|
+
var weakSetHas = typeof WeakSet === "function" && WeakSet.prototype ? WeakSet.prototype.has : null;
|
|
123
|
+
var weakRefDeref = typeof WeakRef === "function" && WeakRef.prototype ? WeakRef.prototype.deref : null;
|
|
124
|
+
var booleanValueOf = Boolean.prototype.valueOf;
|
|
125
|
+
var objectToString = Object.prototype.toString;
|
|
126
|
+
var functionToString = Function.prototype.toString;
|
|
127
|
+
var $match = String.prototype.match;
|
|
128
|
+
var $slice = String.prototype.slice;
|
|
129
|
+
var $replace = String.prototype.replace;
|
|
130
|
+
var $toUpperCase = String.prototype.toUpperCase;
|
|
131
|
+
var $toLowerCase = String.prototype.toLowerCase;
|
|
132
|
+
var $test = RegExp.prototype.test;
|
|
133
|
+
var $concat = Array.prototype.concat;
|
|
134
|
+
var $join = Array.prototype.join;
|
|
135
|
+
var $arrSlice = Array.prototype.slice;
|
|
136
|
+
var $floor = Math.floor;
|
|
137
|
+
var bigIntValueOf = typeof BigInt === "function" ? BigInt.prototype.valueOf : null;
|
|
138
|
+
var gOPS = Object.getOwnPropertySymbols;
|
|
139
|
+
var symToString = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? Symbol.prototype.toString : null;
|
|
140
|
+
var hasShammedSymbols = typeof Symbol === "function" && typeof Symbol.iterator === "object";
|
|
141
|
+
var toStringTag = typeof Symbol === "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? "object" : "symbol") ? Symbol.toStringTag : null;
|
|
142
|
+
var isEnumerable = Object.prototype.propertyIsEnumerable;
|
|
143
|
+
var gPO = (typeof Reflect === "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(O) {
|
|
144
|
+
return O.__proto__;
|
|
145
|
+
} : null);
|
|
146
|
+
function addNumericSeparator(num, str) {
|
|
147
|
+
if (num === Infinity || num === -Infinity || num !== num || num && num > -1e3 && num < 1e3 || $test.call(/e/, str)) return str;
|
|
148
|
+
var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
|
|
149
|
+
if (typeof num === "number") {
|
|
150
|
+
var int = num < 0 ? -$floor(-num) : $floor(num);
|
|
151
|
+
if (int !== num) {
|
|
152
|
+
var intStr = String(int);
|
|
153
|
+
var dec = $slice.call(str, intStr.length + 1);
|
|
154
|
+
return $replace.call(intStr, sepRegex, "$&_") + "." + $replace.call($replace.call(dec, /([0-9]{3})/g, "$&_"), /_$/, "");
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return $replace.call(str, sepRegex, "$&_");
|
|
158
|
+
}
|
|
159
|
+
var utilInspect = require_util_inspect();
|
|
160
|
+
var inspectCustom = utilInspect.custom;
|
|
161
|
+
var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
|
|
162
|
+
var quotes = {
|
|
163
|
+
__proto__: null,
|
|
164
|
+
"double": "\"",
|
|
165
|
+
single: "'"
|
|
166
|
+
};
|
|
167
|
+
var quoteREs = {
|
|
168
|
+
__proto__: null,
|
|
169
|
+
"double": /(["\\])/g,
|
|
170
|
+
single: /(['\\])/g
|
|
171
|
+
};
|
|
172
|
+
module.exports = function inspect_(obj, options, depth, seen) {
|
|
173
|
+
var opts = options || {};
|
|
174
|
+
if (has(opts, "quoteStyle") && !has(quotes, opts.quoteStyle)) throw new TypeError("option \"quoteStyle\" must be \"single\" or \"double\"");
|
|
175
|
+
if (has(opts, "maxStringLength") && (typeof opts.maxStringLength === "number" ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity : opts.maxStringLength !== null)) throw new TypeError("option \"maxStringLength\", if provided, must be a positive integer, Infinity, or `null`");
|
|
176
|
+
var customInspect = has(opts, "customInspect") ? opts.customInspect : true;
|
|
177
|
+
if (typeof customInspect !== "boolean" && customInspect !== "symbol") throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");
|
|
178
|
+
if (has(opts, "indent") && opts.indent !== null && opts.indent !== " " && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)) throw new TypeError("option \"indent\" must be \"\\t\", an integer > 0, or `null`");
|
|
179
|
+
if (has(opts, "numericSeparator") && typeof opts.numericSeparator !== "boolean") throw new TypeError("option \"numericSeparator\", if provided, must be `true` or `false`");
|
|
180
|
+
var numericSeparator = opts.numericSeparator;
|
|
181
|
+
if (typeof obj === "undefined") return "undefined";
|
|
182
|
+
if (obj === null) return "null";
|
|
183
|
+
if (typeof obj === "boolean") return obj ? "true" : "false";
|
|
184
|
+
if (typeof obj === "string") return inspectString(obj, opts);
|
|
185
|
+
if (typeof obj === "number") {
|
|
186
|
+
if (obj === 0) return Infinity / obj > 0 ? "0" : "-0";
|
|
187
|
+
var str = String(obj);
|
|
188
|
+
return numericSeparator ? addNumericSeparator(obj, str) : str;
|
|
189
|
+
}
|
|
190
|
+
if (typeof obj === "bigint") {
|
|
191
|
+
var bigIntStr = String(obj) + "n";
|
|
192
|
+
return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
|
|
193
|
+
}
|
|
194
|
+
var maxDepth = typeof opts.depth === "undefined" ? 5 : opts.depth;
|
|
195
|
+
if (typeof depth === "undefined") depth = 0;
|
|
196
|
+
if (depth >= maxDepth && maxDepth > 0 && typeof obj === "object") return isArray(obj) ? "[Array]" : "[Object]";
|
|
197
|
+
var indent = getIndent(opts, depth);
|
|
198
|
+
if (typeof seen === "undefined") seen = [];
|
|
199
|
+
else if (indexOf(seen, obj) >= 0) return "[Circular]";
|
|
200
|
+
function inspect(value, from, noIndent) {
|
|
201
|
+
if (from) {
|
|
202
|
+
seen = $arrSlice.call(seen);
|
|
203
|
+
seen.push(from);
|
|
204
|
+
}
|
|
205
|
+
if (noIndent) {
|
|
206
|
+
var newOpts = { depth: opts.depth };
|
|
207
|
+
if (has(opts, "quoteStyle")) newOpts.quoteStyle = opts.quoteStyle;
|
|
208
|
+
return inspect_(value, newOpts, depth + 1, seen);
|
|
209
|
+
}
|
|
210
|
+
return inspect_(value, opts, depth + 1, seen);
|
|
211
|
+
}
|
|
212
|
+
if (typeof obj === "function" && !isRegExp(obj)) {
|
|
213
|
+
var name = nameOf(obj);
|
|
214
|
+
var keys = arrObjKeys(obj, inspect);
|
|
215
|
+
return "[Function" + (name ? ": " + name : " (anonymous)") + "]" + (keys.length > 0 ? " { " + $join.call(keys, ", ") + " }" : "");
|
|
216
|
+
}
|
|
217
|
+
if (isSymbol(obj)) {
|
|
218
|
+
var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, "$1") : symToString.call(obj);
|
|
219
|
+
return typeof obj === "object" && !hasShammedSymbols ? markBoxed(symString) : symString;
|
|
220
|
+
}
|
|
221
|
+
if (isElement(obj)) {
|
|
222
|
+
var s = "<" + $toLowerCase.call(String(obj.nodeName));
|
|
223
|
+
var attrs = obj.attributes || [];
|
|
224
|
+
for (var i = 0; i < attrs.length; i++) s += " " + attrs[i].name + "=" + wrapQuotes(quote(attrs[i].value), "double", opts);
|
|
225
|
+
s += ">";
|
|
226
|
+
if (obj.childNodes && obj.childNodes.length) s += "...";
|
|
227
|
+
s += "</" + $toLowerCase.call(String(obj.nodeName)) + ">";
|
|
228
|
+
return s;
|
|
229
|
+
}
|
|
230
|
+
if (isArray(obj)) {
|
|
231
|
+
if (obj.length === 0) return "[]";
|
|
232
|
+
var xs = arrObjKeys(obj, inspect);
|
|
233
|
+
if (indent && !singleLineValues(xs)) return "[" + indentedJoin(xs, indent) + "]";
|
|
234
|
+
return "[ " + $join.call(xs, ", ") + " ]";
|
|
235
|
+
}
|
|
236
|
+
if (isError(obj)) {
|
|
237
|
+
var parts = arrObjKeys(obj, inspect);
|
|
238
|
+
if (!("cause" in Error.prototype) && "cause" in obj && !isEnumerable.call(obj, "cause")) return "{ [" + String(obj) + "] " + $join.call($concat.call("[cause]: " + inspect(obj.cause), parts), ", ") + " }";
|
|
239
|
+
if (parts.length === 0) return "[" + String(obj) + "]";
|
|
240
|
+
return "{ [" + String(obj) + "] " + $join.call(parts, ", ") + " }";
|
|
241
|
+
}
|
|
242
|
+
if (typeof obj === "object" && customInspect) {
|
|
243
|
+
if (inspectSymbol && typeof obj[inspectSymbol] === "function" && utilInspect) return utilInspect(obj, { depth: maxDepth - depth });
|
|
244
|
+
else if (customInspect !== "symbol" && typeof obj.inspect === "function") return obj.inspect();
|
|
245
|
+
}
|
|
246
|
+
if (isMap(obj)) {
|
|
247
|
+
var mapParts = [];
|
|
248
|
+
if (mapForEach) mapForEach.call(obj, function(value, key) {
|
|
249
|
+
mapParts.push(inspect(key, obj, true) + " => " + inspect(value, obj));
|
|
250
|
+
});
|
|
251
|
+
return collectionOf("Map", mapSize.call(obj), mapParts, indent);
|
|
252
|
+
}
|
|
253
|
+
if (isSet(obj)) {
|
|
254
|
+
var setParts = [];
|
|
255
|
+
if (setForEach) setForEach.call(obj, function(value) {
|
|
256
|
+
setParts.push(inspect(value, obj));
|
|
257
|
+
});
|
|
258
|
+
return collectionOf("Set", setSize.call(obj), setParts, indent);
|
|
259
|
+
}
|
|
260
|
+
if (isWeakMap(obj)) return weakCollectionOf("WeakMap");
|
|
261
|
+
if (isWeakSet(obj)) return weakCollectionOf("WeakSet");
|
|
262
|
+
if (isWeakRef(obj)) return weakCollectionOf("WeakRef");
|
|
263
|
+
if (isNumber(obj)) return markBoxed(inspect(Number(obj)));
|
|
264
|
+
if (isBigInt(obj)) return markBoxed(inspect(bigIntValueOf.call(obj)));
|
|
265
|
+
if (isBoolean(obj)) return markBoxed(booleanValueOf.call(obj));
|
|
266
|
+
if (isString(obj)) return markBoxed(inspect(String(obj)));
|
|
267
|
+
if (typeof window !== "undefined" && obj === window) return "{ [object Window] }";
|
|
268
|
+
if (typeof globalThis !== "undefined" && obj === globalThis || typeof global !== "undefined" && obj === global) return "{ [object globalThis] }";
|
|
269
|
+
if (!isDate(obj) && !isRegExp(obj)) {
|
|
270
|
+
var ys = arrObjKeys(obj, inspect);
|
|
271
|
+
var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
|
|
272
|
+
var protoTag = obj instanceof Object ? "" : "null prototype";
|
|
273
|
+
var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : "";
|
|
274
|
+
var tag = (isPlainObject || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : "") + (stringTag || protoTag ? "[" + $join.call($concat.call([], stringTag || [], protoTag || []), ": ") + "] " : "");
|
|
275
|
+
if (ys.length === 0) return tag + "{}";
|
|
276
|
+
if (indent) return tag + "{" + indentedJoin(ys, indent) + "}";
|
|
277
|
+
return tag + "{ " + $join.call(ys, ", ") + " }";
|
|
278
|
+
}
|
|
279
|
+
return String(obj);
|
|
280
|
+
};
|
|
281
|
+
function wrapQuotes(s, defaultStyle, opts) {
|
|
282
|
+
var quoteChar = quotes[opts.quoteStyle || defaultStyle];
|
|
283
|
+
return quoteChar + s + quoteChar;
|
|
284
|
+
}
|
|
285
|
+
function quote(s) {
|
|
286
|
+
return $replace.call(String(s), /"/g, """);
|
|
287
|
+
}
|
|
288
|
+
function canTrustToString(obj) {
|
|
289
|
+
return !toStringTag || !(typeof obj === "object" && (toStringTag in obj || typeof obj[toStringTag] !== "undefined"));
|
|
290
|
+
}
|
|
291
|
+
function isArray(obj) {
|
|
292
|
+
return toStr(obj) === "[object Array]" && canTrustToString(obj);
|
|
293
|
+
}
|
|
294
|
+
function isDate(obj) {
|
|
295
|
+
return toStr(obj) === "[object Date]" && canTrustToString(obj);
|
|
296
|
+
}
|
|
297
|
+
function isRegExp(obj) {
|
|
298
|
+
return toStr(obj) === "[object RegExp]" && canTrustToString(obj);
|
|
299
|
+
}
|
|
300
|
+
function isError(obj) {
|
|
301
|
+
return toStr(obj) === "[object Error]" && canTrustToString(obj);
|
|
302
|
+
}
|
|
303
|
+
function isString(obj) {
|
|
304
|
+
return toStr(obj) === "[object String]" && canTrustToString(obj);
|
|
305
|
+
}
|
|
306
|
+
function isNumber(obj) {
|
|
307
|
+
return toStr(obj) === "[object Number]" && canTrustToString(obj);
|
|
308
|
+
}
|
|
309
|
+
function isBoolean(obj) {
|
|
310
|
+
return toStr(obj) === "[object Boolean]" && canTrustToString(obj);
|
|
311
|
+
}
|
|
312
|
+
function isSymbol(obj) {
|
|
313
|
+
if (hasShammedSymbols) return obj && typeof obj === "object" && obj instanceof Symbol;
|
|
314
|
+
if (typeof obj === "symbol") return true;
|
|
315
|
+
if (!obj || typeof obj !== "object" || !symToString) return false;
|
|
316
|
+
try {
|
|
317
|
+
symToString.call(obj);
|
|
318
|
+
return true;
|
|
319
|
+
} catch (e) {}
|
|
320
|
+
return false;
|
|
321
|
+
}
|
|
322
|
+
function isBigInt(obj) {
|
|
323
|
+
if (!obj || typeof obj !== "object" || !bigIntValueOf) return false;
|
|
324
|
+
try {
|
|
325
|
+
bigIntValueOf.call(obj);
|
|
326
|
+
return true;
|
|
327
|
+
} catch (e) {}
|
|
328
|
+
return false;
|
|
329
|
+
}
|
|
330
|
+
var hasOwn = Object.prototype.hasOwnProperty || function(key) {
|
|
331
|
+
return key in this;
|
|
332
|
+
};
|
|
333
|
+
function has(obj, key) {
|
|
334
|
+
return hasOwn.call(obj, key);
|
|
335
|
+
}
|
|
336
|
+
function toStr(obj) {
|
|
337
|
+
return objectToString.call(obj);
|
|
338
|
+
}
|
|
339
|
+
function nameOf(f) {
|
|
340
|
+
if (f.name) return f.name;
|
|
341
|
+
var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
|
|
342
|
+
if (m) return m[1];
|
|
343
|
+
return null;
|
|
344
|
+
}
|
|
345
|
+
function indexOf(xs, x) {
|
|
346
|
+
if (xs.indexOf) return xs.indexOf(x);
|
|
347
|
+
for (var i = 0, l = xs.length; i < l; i++) if (xs[i] === x) return i;
|
|
348
|
+
return -1;
|
|
349
|
+
}
|
|
350
|
+
function isMap(x) {
|
|
351
|
+
if (!mapSize || !x || typeof x !== "object") return false;
|
|
352
|
+
try {
|
|
353
|
+
mapSize.call(x);
|
|
354
|
+
try {
|
|
355
|
+
setSize.call(x);
|
|
356
|
+
} catch (s) {
|
|
357
|
+
return true;
|
|
358
|
+
}
|
|
359
|
+
return x instanceof Map;
|
|
360
|
+
} catch (e) {}
|
|
361
|
+
return false;
|
|
362
|
+
}
|
|
363
|
+
function isWeakMap(x) {
|
|
364
|
+
if (!weakMapHas || !x || typeof x !== "object") return false;
|
|
365
|
+
try {
|
|
366
|
+
weakMapHas.call(x, weakMapHas);
|
|
367
|
+
try {
|
|
368
|
+
weakSetHas.call(x, weakSetHas);
|
|
369
|
+
} catch (s) {
|
|
370
|
+
return true;
|
|
371
|
+
}
|
|
372
|
+
return x instanceof WeakMap;
|
|
373
|
+
} catch (e) {}
|
|
374
|
+
return false;
|
|
375
|
+
}
|
|
376
|
+
function isWeakRef(x) {
|
|
377
|
+
if (!weakRefDeref || !x || typeof x !== "object") return false;
|
|
378
|
+
try {
|
|
379
|
+
weakRefDeref.call(x);
|
|
380
|
+
return true;
|
|
381
|
+
} catch (e) {}
|
|
382
|
+
return false;
|
|
383
|
+
}
|
|
384
|
+
function isSet(x) {
|
|
385
|
+
if (!setSize || !x || typeof x !== "object") return false;
|
|
386
|
+
try {
|
|
387
|
+
setSize.call(x);
|
|
388
|
+
try {
|
|
389
|
+
mapSize.call(x);
|
|
390
|
+
} catch (m) {
|
|
391
|
+
return true;
|
|
392
|
+
}
|
|
393
|
+
return x instanceof Set;
|
|
394
|
+
} catch (e) {}
|
|
395
|
+
return false;
|
|
396
|
+
}
|
|
397
|
+
function isWeakSet(x) {
|
|
398
|
+
if (!weakSetHas || !x || typeof x !== "object") return false;
|
|
399
|
+
try {
|
|
400
|
+
weakSetHas.call(x, weakSetHas);
|
|
401
|
+
try {
|
|
402
|
+
weakMapHas.call(x, weakMapHas);
|
|
403
|
+
} catch (s) {
|
|
404
|
+
return true;
|
|
405
|
+
}
|
|
406
|
+
return x instanceof WeakSet;
|
|
407
|
+
} catch (e) {}
|
|
408
|
+
return false;
|
|
409
|
+
}
|
|
410
|
+
function isElement(x) {
|
|
411
|
+
if (!x || typeof x !== "object") return false;
|
|
412
|
+
if (typeof HTMLElement !== "undefined" && x instanceof HTMLElement) return true;
|
|
413
|
+
return typeof x.nodeName === "string" && typeof x.getAttribute === "function";
|
|
414
|
+
}
|
|
415
|
+
function inspectString(str, opts) {
|
|
416
|
+
if (str.length > opts.maxStringLength) {
|
|
417
|
+
var remaining = str.length - opts.maxStringLength;
|
|
418
|
+
var trailer = "... " + remaining + " more character" + (remaining > 1 ? "s" : "");
|
|
419
|
+
return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
|
|
420
|
+
}
|
|
421
|
+
var quoteRE = quoteREs[opts.quoteStyle || "single"];
|
|
422
|
+
quoteRE.lastIndex = 0;
|
|
423
|
+
return wrapQuotes($replace.call($replace.call(str, quoteRE, "\\$1"), /[\x00-\x1f]/g, lowbyte), "single", opts);
|
|
424
|
+
}
|
|
425
|
+
function lowbyte(c) {
|
|
426
|
+
var n = c.charCodeAt(0);
|
|
427
|
+
var x = {
|
|
428
|
+
8: "b",
|
|
429
|
+
9: "t",
|
|
430
|
+
10: "n",
|
|
431
|
+
12: "f",
|
|
432
|
+
13: "r"
|
|
433
|
+
}[n];
|
|
434
|
+
if (x) return "\\" + x;
|
|
435
|
+
return "\\x" + (n < 16 ? "0" : "") + $toUpperCase.call(n.toString(16));
|
|
436
|
+
}
|
|
437
|
+
function markBoxed(str) {
|
|
438
|
+
return "Object(" + str + ")";
|
|
439
|
+
}
|
|
440
|
+
function weakCollectionOf(type) {
|
|
441
|
+
return type + " { ? }";
|
|
442
|
+
}
|
|
443
|
+
function collectionOf(type, size, entries, indent) {
|
|
444
|
+
var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ", ");
|
|
445
|
+
return type + " (" + size + ") {" + joinedEntries + "}";
|
|
446
|
+
}
|
|
447
|
+
function singleLineValues(xs) {
|
|
448
|
+
for (var i = 0; i < xs.length; i++) if (indexOf(xs[i], "\n") >= 0) return false;
|
|
449
|
+
return true;
|
|
450
|
+
}
|
|
451
|
+
function getIndent(opts, depth) {
|
|
452
|
+
var baseIndent;
|
|
453
|
+
if (opts.indent === " ") baseIndent = " ";
|
|
454
|
+
else if (typeof opts.indent === "number" && opts.indent > 0) baseIndent = $join.call(Array(opts.indent + 1), " ");
|
|
455
|
+
else return null;
|
|
456
|
+
return {
|
|
457
|
+
base: baseIndent,
|
|
458
|
+
prev: $join.call(Array(depth + 1), baseIndent)
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
function indentedJoin(xs, indent) {
|
|
462
|
+
if (xs.length === 0) return "";
|
|
463
|
+
var lineJoiner = "\n" + indent.prev + indent.base;
|
|
464
|
+
return lineJoiner + $join.call(xs, "," + lineJoiner) + "\n" + indent.prev;
|
|
465
|
+
}
|
|
466
|
+
function arrObjKeys(obj, inspect) {
|
|
467
|
+
var isArr = isArray(obj);
|
|
468
|
+
var xs = [];
|
|
469
|
+
if (isArr) {
|
|
470
|
+
xs.length = obj.length;
|
|
471
|
+
for (var i = 0; i < obj.length; i++) xs[i] = has(obj, i) ? inspect(obj[i], obj) : "";
|
|
472
|
+
}
|
|
473
|
+
var syms = typeof gOPS === "function" ? gOPS(obj) : [];
|
|
474
|
+
var symMap;
|
|
475
|
+
if (hasShammedSymbols) {
|
|
476
|
+
symMap = {};
|
|
477
|
+
for (var k = 0; k < syms.length; k++) symMap["$" + syms[k]] = syms[k];
|
|
478
|
+
}
|
|
479
|
+
for (var key in obj) {
|
|
480
|
+
if (!has(obj, key)) continue;
|
|
481
|
+
if (isArr && String(Number(key)) === key && key < obj.length) continue;
|
|
482
|
+
if (hasShammedSymbols && symMap["$" + key] instanceof Symbol) continue;
|
|
483
|
+
else if ($test.call(/[^\w$]/, key)) xs.push(inspect(key, obj) + ": " + inspect(obj[key], obj));
|
|
484
|
+
else xs.push(key + ": " + inspect(obj[key], obj));
|
|
485
|
+
}
|
|
486
|
+
if (typeof gOPS === "function") {
|
|
487
|
+
for (var j = 0; j < syms.length; j++) if (isEnumerable.call(obj, syms[j])) xs.push("[" + inspect(syms[j]) + "]: " + inspect(obj[syms[j]], obj));
|
|
488
|
+
}
|
|
489
|
+
return xs;
|
|
490
|
+
}
|
|
491
|
+
}));
|
|
492
|
+
|
|
493
|
+
//#endregion
|
|
494
|
+
//#region node_modules/side-channel-list/index.js
|
|
495
|
+
var require_side_channel_list = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
496
|
+
var inspect = require_object_inspect();
|
|
497
|
+
var $TypeError = require_type();
|
|
498
|
+
/** @type {import('./list.d.ts').listGetNode} */
|
|
499
|
+
var listGetNode = function(list, key, isDelete) {
|
|
500
|
+
/** @type {typeof list | NonNullable<(typeof list)['next']>} */
|
|
501
|
+
var prev = list;
|
|
502
|
+
/** @type {(typeof list)['next']} */
|
|
503
|
+
var curr;
|
|
504
|
+
for (; (curr = prev.next) != null; prev = curr) if (curr.key === key) {
|
|
505
|
+
prev.next = curr.next;
|
|
506
|
+
if (!isDelete) {
|
|
507
|
+
curr.next = list.next;
|
|
508
|
+
list.next = curr;
|
|
509
|
+
}
|
|
510
|
+
return curr;
|
|
511
|
+
}
|
|
512
|
+
};
|
|
513
|
+
/** @type {import('./list.d.ts').listGet} */
|
|
514
|
+
var listGet = function(objects, key) {
|
|
515
|
+
if (!objects) return;
|
|
516
|
+
var node = listGetNode(objects, key);
|
|
517
|
+
return node && node.value;
|
|
518
|
+
};
|
|
519
|
+
/** @type {import('./list.d.ts').listSet} */
|
|
520
|
+
var listSet = function(objects, key, value) {
|
|
521
|
+
var node = listGetNode(objects, key);
|
|
522
|
+
if (node) node.value = value;
|
|
523
|
+
else objects.next = {
|
|
524
|
+
key,
|
|
525
|
+
next: objects.next,
|
|
526
|
+
value
|
|
527
|
+
};
|
|
528
|
+
};
|
|
529
|
+
/** @type {import('./list.d.ts').listHas} */
|
|
530
|
+
var listHas = function(objects, key) {
|
|
531
|
+
if (!objects) return false;
|
|
532
|
+
return !!listGetNode(objects, key);
|
|
533
|
+
};
|
|
534
|
+
/** @type {import('./list.d.ts').listDelete} */
|
|
535
|
+
var listDelete = function(objects, key) {
|
|
536
|
+
if (objects) return listGetNode(objects, key, true);
|
|
537
|
+
};
|
|
538
|
+
/** @type {import('.')} */
|
|
539
|
+
module.exports = function getSideChannelList() {
|
|
540
|
+
/** @typedef {ReturnType<typeof getSideChannelList>} Channel */
|
|
541
|
+
/** @typedef {Parameters<Channel['get']>[0]} K */
|
|
542
|
+
/** @typedef {Parameters<Channel['set']>[1]} V */
|
|
543
|
+
/** @type {import('./list.d.ts').RootNode<V, K> | undefined} */ var $o;
|
|
544
|
+
/** @type {Channel} */
|
|
545
|
+
var channel = {
|
|
546
|
+
assert: function(key) {
|
|
547
|
+
if (!channel.has(key)) throw new $TypeError("Side channel does not contain " + inspect(key));
|
|
548
|
+
},
|
|
549
|
+
"delete": function(key) {
|
|
550
|
+
var root = $o && $o.next;
|
|
551
|
+
var deletedNode = listDelete($o, key);
|
|
552
|
+
if (deletedNode && root && root === deletedNode) $o = void 0;
|
|
553
|
+
return !!deletedNode;
|
|
554
|
+
},
|
|
555
|
+
get: function(key) {
|
|
556
|
+
return listGet($o, key);
|
|
557
|
+
},
|
|
558
|
+
has: function(key) {
|
|
559
|
+
return listHas($o, key);
|
|
560
|
+
},
|
|
561
|
+
set: function(key, value) {
|
|
562
|
+
if (!$o) $o = { next: void 0 };
|
|
563
|
+
listSet($o, key, value);
|
|
564
|
+
}
|
|
565
|
+
};
|
|
566
|
+
return channel;
|
|
567
|
+
};
|
|
568
|
+
}));
|
|
569
|
+
|
|
570
|
+
//#endregion
|
|
571
|
+
//#region node_modules/es-object-atoms/index.js
|
|
572
|
+
var require_es_object_atoms = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
573
|
+
/** @type {import('.')} */
|
|
574
|
+
module.exports = Object;
|
|
575
|
+
}));
|
|
576
|
+
|
|
577
|
+
//#endregion
|
|
578
|
+
//#region node_modules/es-errors/index.js
|
|
579
|
+
var require_es_errors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
580
|
+
/** @type {import('.')} */
|
|
581
|
+
module.exports = Error;
|
|
582
|
+
}));
|
|
583
|
+
|
|
584
|
+
//#endregion
|
|
585
|
+
//#region node_modules/es-errors/eval.js
|
|
586
|
+
var require_eval = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
587
|
+
/** @type {import('./eval')} */
|
|
588
|
+
module.exports = EvalError;
|
|
589
|
+
}));
|
|
590
|
+
|
|
591
|
+
//#endregion
|
|
592
|
+
//#region node_modules/es-errors/range.js
|
|
593
|
+
var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
594
|
+
/** @type {import('./range')} */
|
|
595
|
+
module.exports = RangeError;
|
|
596
|
+
}));
|
|
597
|
+
|
|
598
|
+
//#endregion
|
|
599
|
+
//#region node_modules/es-errors/ref.js
|
|
600
|
+
var require_ref = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
601
|
+
/** @type {import('./ref')} */
|
|
602
|
+
module.exports = ReferenceError;
|
|
603
|
+
}));
|
|
604
|
+
|
|
605
|
+
//#endregion
|
|
606
|
+
//#region node_modules/es-errors/syntax.js
|
|
607
|
+
var require_syntax = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
608
|
+
/** @type {import('./syntax')} */
|
|
609
|
+
module.exports = SyntaxError;
|
|
610
|
+
}));
|
|
611
|
+
|
|
612
|
+
//#endregion
|
|
613
|
+
//#region node_modules/es-errors/uri.js
|
|
614
|
+
var require_uri = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
615
|
+
/** @type {import('./uri')} */
|
|
616
|
+
module.exports = URIError;
|
|
617
|
+
}));
|
|
618
|
+
|
|
619
|
+
//#endregion
|
|
620
|
+
//#region node_modules/math-intrinsics/abs.js
|
|
621
|
+
var require_abs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
622
|
+
/** @type {import('./abs')} */
|
|
623
|
+
module.exports = Math.abs;
|
|
624
|
+
}));
|
|
625
|
+
|
|
626
|
+
//#endregion
|
|
627
|
+
//#region node_modules/math-intrinsics/floor.js
|
|
628
|
+
var require_floor = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
629
|
+
/** @type {import('./floor')} */
|
|
630
|
+
module.exports = Math.floor;
|
|
631
|
+
}));
|
|
632
|
+
|
|
633
|
+
//#endregion
|
|
634
|
+
//#region node_modules/math-intrinsics/max.js
|
|
635
|
+
var require_max = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
636
|
+
/** @type {import('./max')} */
|
|
637
|
+
module.exports = Math.max;
|
|
638
|
+
}));
|
|
639
|
+
|
|
640
|
+
//#endregion
|
|
641
|
+
//#region node_modules/math-intrinsics/min.js
|
|
642
|
+
var require_min = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
643
|
+
/** @type {import('./min')} */
|
|
644
|
+
module.exports = Math.min;
|
|
645
|
+
}));
|
|
646
|
+
|
|
647
|
+
//#endregion
|
|
648
|
+
//#region node_modules/math-intrinsics/pow.js
|
|
649
|
+
var require_pow = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
650
|
+
/** @type {import('./pow')} */
|
|
651
|
+
module.exports = Math.pow;
|
|
652
|
+
}));
|
|
653
|
+
|
|
654
|
+
//#endregion
|
|
655
|
+
//#region node_modules/math-intrinsics/round.js
|
|
656
|
+
var require_round = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
657
|
+
/** @type {import('./round')} */
|
|
658
|
+
module.exports = Math.round;
|
|
659
|
+
}));
|
|
660
|
+
|
|
661
|
+
//#endregion
|
|
662
|
+
//#region node_modules/math-intrinsics/isNaN.js
|
|
663
|
+
var require_isNaN = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
664
|
+
/** @type {import('./isNaN')} */
|
|
665
|
+
module.exports = Number.isNaN || function isNaN(a) {
|
|
666
|
+
return a !== a;
|
|
667
|
+
};
|
|
668
|
+
}));
|
|
669
|
+
|
|
670
|
+
//#endregion
|
|
671
|
+
//#region node_modules/math-intrinsics/sign.js
|
|
672
|
+
var require_sign = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
673
|
+
var $isNaN = require_isNaN();
|
|
674
|
+
/** @type {import('./sign')} */
|
|
675
|
+
module.exports = function sign(number) {
|
|
676
|
+
if ($isNaN(number) || number === 0) return number;
|
|
677
|
+
return number < 0 ? -1 : 1;
|
|
678
|
+
};
|
|
679
|
+
}));
|
|
680
|
+
|
|
681
|
+
//#endregion
|
|
682
|
+
//#region node_modules/gopd/gOPD.js
|
|
683
|
+
var require_gOPD = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
684
|
+
/** @type {import('./gOPD')} */
|
|
685
|
+
module.exports = Object.getOwnPropertyDescriptor;
|
|
686
|
+
}));
|
|
687
|
+
|
|
688
|
+
//#endregion
|
|
689
|
+
//#region node_modules/gopd/index.js
|
|
690
|
+
var require_gopd = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
691
|
+
/** @type {import('.')} */
|
|
692
|
+
var $gOPD = require_gOPD();
|
|
693
|
+
if ($gOPD) try {
|
|
694
|
+
$gOPD([], "length");
|
|
695
|
+
} catch (e) {
|
|
696
|
+
$gOPD = null;
|
|
697
|
+
}
|
|
698
|
+
module.exports = $gOPD;
|
|
699
|
+
}));
|
|
700
|
+
|
|
701
|
+
//#endregion
|
|
702
|
+
//#region node_modules/es-define-property/index.js
|
|
703
|
+
var require_es_define_property = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
704
|
+
/** @type {import('.')} */
|
|
705
|
+
var $defineProperty = Object.defineProperty || false;
|
|
706
|
+
if ($defineProperty) try {
|
|
707
|
+
$defineProperty({}, "a", { value: 1 });
|
|
708
|
+
} catch (e) {
|
|
709
|
+
$defineProperty = false;
|
|
710
|
+
}
|
|
711
|
+
module.exports = $defineProperty;
|
|
712
|
+
}));
|
|
713
|
+
|
|
714
|
+
//#endregion
|
|
715
|
+
//#region node_modules/has-symbols/shams.js
|
|
716
|
+
var require_shams = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
717
|
+
/** @type {import('./shams')} */
|
|
718
|
+
module.exports = function hasSymbols() {
|
|
719
|
+
if (typeof Symbol !== "function" || typeof Object.getOwnPropertySymbols !== "function") return false;
|
|
720
|
+
if (typeof Symbol.iterator === "symbol") return true;
|
|
721
|
+
/** @type {{ [k in symbol]?: unknown }} */
|
|
722
|
+
var obj = {};
|
|
723
|
+
var sym = Symbol("test");
|
|
724
|
+
var symObj = Object(sym);
|
|
725
|
+
if (typeof sym === "string") return false;
|
|
726
|
+
if (Object.prototype.toString.call(sym) !== "[object Symbol]") return false;
|
|
727
|
+
if (Object.prototype.toString.call(symObj) !== "[object Symbol]") return false;
|
|
728
|
+
var symVal = 42;
|
|
729
|
+
obj[sym] = symVal;
|
|
730
|
+
for (var _ in obj) return false;
|
|
731
|
+
if (typeof Object.keys === "function" && Object.keys(obj).length !== 0) return false;
|
|
732
|
+
if (typeof Object.getOwnPropertyNames === "function" && Object.getOwnPropertyNames(obj).length !== 0) return false;
|
|
733
|
+
var syms = Object.getOwnPropertySymbols(obj);
|
|
734
|
+
if (syms.length !== 1 || syms[0] !== sym) return false;
|
|
735
|
+
if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) return false;
|
|
736
|
+
if (typeof Object.getOwnPropertyDescriptor === "function") {
|
|
737
|
+
var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
|
|
738
|
+
if (descriptor.value !== symVal || descriptor.enumerable !== true) return false;
|
|
739
|
+
}
|
|
740
|
+
return true;
|
|
741
|
+
};
|
|
742
|
+
}));
|
|
743
|
+
|
|
744
|
+
//#endregion
|
|
745
|
+
//#region node_modules/has-symbols/index.js
|
|
746
|
+
var require_has_symbols = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
747
|
+
var origSymbol = typeof Symbol !== "undefined" && Symbol;
|
|
748
|
+
var hasSymbolSham = require_shams();
|
|
749
|
+
/** @type {import('.')} */
|
|
750
|
+
module.exports = function hasNativeSymbols() {
|
|
751
|
+
if (typeof origSymbol !== "function") return false;
|
|
752
|
+
if (typeof Symbol !== "function") return false;
|
|
753
|
+
if (typeof origSymbol("foo") !== "symbol") return false;
|
|
754
|
+
if (typeof Symbol("bar") !== "symbol") return false;
|
|
755
|
+
return hasSymbolSham();
|
|
756
|
+
};
|
|
757
|
+
}));
|
|
758
|
+
|
|
759
|
+
//#endregion
|
|
760
|
+
//#region node_modules/get-proto/Reflect.getPrototypeOf.js
|
|
761
|
+
var require_Reflect_getPrototypeOf = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
762
|
+
/** @type {import('./Reflect.getPrototypeOf')} */
|
|
763
|
+
module.exports = typeof Reflect !== "undefined" && Reflect.getPrototypeOf || null;
|
|
764
|
+
}));
|
|
765
|
+
|
|
766
|
+
//#endregion
|
|
767
|
+
//#region node_modules/get-proto/Object.getPrototypeOf.js
|
|
768
|
+
var require_Object_getPrototypeOf = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
769
|
+
var $Object = require_es_object_atoms();
|
|
770
|
+
/** @type {import('./Object.getPrototypeOf')} */
|
|
771
|
+
module.exports = $Object.getPrototypeOf || null;
|
|
772
|
+
}));
|
|
773
|
+
|
|
774
|
+
//#endregion
|
|
775
|
+
//#region node_modules/function-bind/implementation.js
|
|
776
|
+
var require_implementation = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
777
|
+
var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
|
|
778
|
+
var toStr = Object.prototype.toString;
|
|
779
|
+
var max = Math.max;
|
|
780
|
+
var funcType = "[object Function]";
|
|
781
|
+
var concatty = function concatty(a, b) {
|
|
782
|
+
var arr = [];
|
|
783
|
+
for (var i = 0; i < a.length; i += 1) arr[i] = a[i];
|
|
784
|
+
for (var j = 0; j < b.length; j += 1) arr[j + a.length] = b[j];
|
|
785
|
+
return arr;
|
|
786
|
+
};
|
|
787
|
+
var slicy = function slicy(arrLike, offset) {
|
|
788
|
+
var arr = [];
|
|
789
|
+
for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) arr[j] = arrLike[i];
|
|
790
|
+
return arr;
|
|
791
|
+
};
|
|
792
|
+
var joiny = function(arr, joiner) {
|
|
793
|
+
var str = "";
|
|
794
|
+
for (var i = 0; i < arr.length; i += 1) {
|
|
795
|
+
str += arr[i];
|
|
796
|
+
if (i + 1 < arr.length) str += joiner;
|
|
797
|
+
}
|
|
798
|
+
return str;
|
|
799
|
+
};
|
|
800
|
+
module.exports = function bind(that) {
|
|
801
|
+
var target = this;
|
|
802
|
+
if (typeof target !== "function" || toStr.apply(target) !== funcType) throw new TypeError(ERROR_MESSAGE + target);
|
|
803
|
+
var args = slicy(arguments, 1);
|
|
804
|
+
var bound;
|
|
805
|
+
var binder = function() {
|
|
806
|
+
if (this instanceof bound) {
|
|
807
|
+
var result = target.apply(this, concatty(args, arguments));
|
|
808
|
+
if (Object(result) === result) return result;
|
|
809
|
+
return this;
|
|
810
|
+
}
|
|
811
|
+
return target.apply(that, concatty(args, arguments));
|
|
812
|
+
};
|
|
813
|
+
var boundLength = max(0, target.length - args.length);
|
|
814
|
+
var boundArgs = [];
|
|
815
|
+
for (var i = 0; i < boundLength; i++) boundArgs[i] = "$" + i;
|
|
816
|
+
bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
|
|
817
|
+
if (target.prototype) {
|
|
818
|
+
var Empty = function Empty() {};
|
|
819
|
+
Empty.prototype = target.prototype;
|
|
820
|
+
bound.prototype = new Empty();
|
|
821
|
+
Empty.prototype = null;
|
|
822
|
+
}
|
|
823
|
+
return bound;
|
|
824
|
+
};
|
|
825
|
+
}));
|
|
826
|
+
|
|
827
|
+
//#endregion
|
|
828
|
+
//#region node_modules/function-bind/index.js
|
|
829
|
+
var require_function_bind = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
830
|
+
var implementation = require_implementation();
|
|
831
|
+
module.exports = Function.prototype.bind || implementation;
|
|
832
|
+
}));
|
|
833
|
+
|
|
834
|
+
//#endregion
|
|
835
|
+
//#region node_modules/call-bind-apply-helpers/functionCall.js
|
|
836
|
+
var require_functionCall = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
837
|
+
/** @type {import('./functionCall')} */
|
|
838
|
+
module.exports = Function.prototype.call;
|
|
839
|
+
}));
|
|
840
|
+
|
|
841
|
+
//#endregion
|
|
842
|
+
//#region node_modules/call-bind-apply-helpers/functionApply.js
|
|
843
|
+
var require_functionApply = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
844
|
+
/** @type {import('./functionApply')} */
|
|
845
|
+
module.exports = Function.prototype.apply;
|
|
846
|
+
}));
|
|
847
|
+
|
|
848
|
+
//#endregion
|
|
849
|
+
//#region node_modules/call-bind-apply-helpers/reflectApply.js
|
|
850
|
+
var require_reflectApply = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
851
|
+
/** @type {import('./reflectApply')} */
|
|
852
|
+
module.exports = typeof Reflect !== "undefined" && Reflect && Reflect.apply;
|
|
853
|
+
}));
|
|
854
|
+
|
|
855
|
+
//#endregion
|
|
856
|
+
//#region node_modules/call-bind-apply-helpers/actualApply.js
|
|
857
|
+
var require_actualApply = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
858
|
+
var bind = require_function_bind();
|
|
859
|
+
var $apply = require_functionApply();
|
|
860
|
+
var $call = require_functionCall();
|
|
861
|
+
var $reflectApply = require_reflectApply();
|
|
862
|
+
/** @type {import('./actualApply')} */
|
|
863
|
+
module.exports = $reflectApply || bind.call($call, $apply);
|
|
864
|
+
}));
|
|
865
|
+
|
|
866
|
+
//#endregion
|
|
867
|
+
//#region node_modules/call-bind-apply-helpers/index.js
|
|
868
|
+
var require_call_bind_apply_helpers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
869
|
+
var bind = require_function_bind();
|
|
870
|
+
var $TypeError = require_type();
|
|
871
|
+
var $call = require_functionCall();
|
|
872
|
+
var $actualApply = require_actualApply();
|
|
873
|
+
/** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */
|
|
874
|
+
module.exports = function callBindBasic(args) {
|
|
875
|
+
if (args.length < 1 || typeof args[0] !== "function") throw new $TypeError("a function is required");
|
|
876
|
+
return $actualApply(bind, $call, args);
|
|
877
|
+
};
|
|
878
|
+
}));
|
|
879
|
+
|
|
880
|
+
//#endregion
|
|
881
|
+
//#region node_modules/dunder-proto/get.js
|
|
882
|
+
var require_get = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
883
|
+
var callBind = require_call_bind_apply_helpers();
|
|
884
|
+
var gOPD = require_gopd();
|
|
885
|
+
var hasProtoAccessor;
|
|
886
|
+
try {
|
|
887
|
+
hasProtoAccessor = [].__proto__ === Array.prototype;
|
|
888
|
+
} catch (e) {
|
|
889
|
+
if (!e || typeof e !== "object" || !("code" in e) || e.code !== "ERR_PROTO_ACCESS") throw e;
|
|
890
|
+
}
|
|
891
|
+
var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, "__proto__");
|
|
892
|
+
var $Object = Object;
|
|
893
|
+
var $getPrototypeOf = $Object.getPrototypeOf;
|
|
894
|
+
/** @type {import('./get')} */
|
|
895
|
+
module.exports = desc && typeof desc.get === "function" ? callBind([desc.get]) : typeof $getPrototypeOf === "function" ? function getDunder(value) {
|
|
896
|
+
return $getPrototypeOf(value == null ? value : $Object(value));
|
|
897
|
+
} : false;
|
|
898
|
+
}));
|
|
899
|
+
|
|
900
|
+
//#endregion
|
|
901
|
+
//#region node_modules/get-proto/index.js
|
|
902
|
+
var require_get_proto = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
903
|
+
var reflectGetProto = require_Reflect_getPrototypeOf();
|
|
904
|
+
var originalGetProto = require_Object_getPrototypeOf();
|
|
905
|
+
var getDunderProto = require_get();
|
|
906
|
+
/** @type {import('.')} */
|
|
907
|
+
module.exports = reflectGetProto ? function getProto(O) {
|
|
908
|
+
return reflectGetProto(O);
|
|
909
|
+
} : originalGetProto ? function getProto(O) {
|
|
910
|
+
if (!O || typeof O !== "object" && typeof O !== "function") throw new TypeError("getProto: not an object");
|
|
911
|
+
return originalGetProto(O);
|
|
912
|
+
} : getDunderProto ? function getProto(O) {
|
|
913
|
+
return getDunderProto(O);
|
|
914
|
+
} : null;
|
|
915
|
+
}));
|
|
916
|
+
|
|
917
|
+
//#endregion
|
|
918
|
+
//#region node_modules/hasown/index.js
|
|
919
|
+
var require_hasown = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
920
|
+
var call = Function.prototype.call;
|
|
921
|
+
var $hasOwn = Object.prototype.hasOwnProperty;
|
|
922
|
+
var bind = require_function_bind();
|
|
923
|
+
/** @type {import('.')} */
|
|
924
|
+
module.exports = bind.call(call, $hasOwn);
|
|
925
|
+
}));
|
|
926
|
+
|
|
927
|
+
//#endregion
|
|
928
|
+
//#region node_modules/get-intrinsic/index.js
|
|
929
|
+
var require_get_intrinsic = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
930
|
+
var undefined;
|
|
931
|
+
var $Object = require_es_object_atoms();
|
|
932
|
+
var $Error = require_es_errors();
|
|
933
|
+
var $EvalError = require_eval();
|
|
934
|
+
var $RangeError = require_range();
|
|
935
|
+
var $ReferenceError = require_ref();
|
|
936
|
+
var $SyntaxError = require_syntax();
|
|
937
|
+
var $TypeError = require_type();
|
|
938
|
+
var $URIError = require_uri();
|
|
939
|
+
var abs = require_abs();
|
|
940
|
+
var floor = require_floor();
|
|
941
|
+
var max = require_max();
|
|
942
|
+
var min = require_min();
|
|
943
|
+
var pow = require_pow();
|
|
944
|
+
var round = require_round();
|
|
945
|
+
var sign = require_sign();
|
|
946
|
+
var $Function = Function;
|
|
947
|
+
var getEvalledConstructor = function(expressionSyntax) {
|
|
948
|
+
try {
|
|
949
|
+
return $Function("\"use strict\"; return (" + expressionSyntax + ").constructor;")();
|
|
950
|
+
} catch (e) {}
|
|
951
|
+
};
|
|
952
|
+
var $gOPD = require_gopd();
|
|
953
|
+
var $defineProperty = require_es_define_property();
|
|
954
|
+
var throwTypeError = function() {
|
|
955
|
+
throw new $TypeError();
|
|
956
|
+
};
|
|
957
|
+
var ThrowTypeError = $gOPD ? function() {
|
|
958
|
+
try {
|
|
959
|
+
arguments.callee;
|
|
960
|
+
return throwTypeError;
|
|
961
|
+
} catch (calleeThrows) {
|
|
962
|
+
try {
|
|
963
|
+
return $gOPD(arguments, "callee").get;
|
|
964
|
+
} catch (gOPDthrows) {
|
|
965
|
+
return throwTypeError;
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
}() : throwTypeError;
|
|
969
|
+
var hasSymbols = require_has_symbols()();
|
|
970
|
+
var getProto = require_get_proto();
|
|
971
|
+
var $ObjectGPO = require_Object_getPrototypeOf();
|
|
972
|
+
var $ReflectGPO = require_Reflect_getPrototypeOf();
|
|
973
|
+
var $apply = require_functionApply();
|
|
974
|
+
var $call = require_functionCall();
|
|
975
|
+
var needsEval = {};
|
|
976
|
+
var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined : getProto(Uint8Array);
|
|
977
|
+
var INTRINSICS = {
|
|
978
|
+
__proto__: null,
|
|
979
|
+
"%AggregateError%": typeof AggregateError === "undefined" ? undefined : AggregateError,
|
|
980
|
+
"%Array%": Array,
|
|
981
|
+
"%ArrayBuffer%": typeof ArrayBuffer === "undefined" ? undefined : ArrayBuffer,
|
|
982
|
+
"%ArrayIteratorPrototype%": hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,
|
|
983
|
+
"%AsyncFromSyncIteratorPrototype%": undefined,
|
|
984
|
+
"%AsyncFunction%": needsEval,
|
|
985
|
+
"%AsyncGenerator%": needsEval,
|
|
986
|
+
"%AsyncGeneratorFunction%": needsEval,
|
|
987
|
+
"%AsyncIteratorPrototype%": needsEval,
|
|
988
|
+
"%Atomics%": typeof Atomics === "undefined" ? undefined : Atomics,
|
|
989
|
+
"%BigInt%": typeof BigInt === "undefined" ? undefined : BigInt,
|
|
990
|
+
"%BigInt64Array%": typeof BigInt64Array === "undefined" ? undefined : BigInt64Array,
|
|
991
|
+
"%BigUint64Array%": typeof BigUint64Array === "undefined" ? undefined : BigUint64Array,
|
|
992
|
+
"%Boolean%": Boolean,
|
|
993
|
+
"%DataView%": typeof DataView === "undefined" ? undefined : DataView,
|
|
994
|
+
"%Date%": Date,
|
|
995
|
+
"%decodeURI%": decodeURI,
|
|
996
|
+
"%decodeURIComponent%": decodeURIComponent,
|
|
997
|
+
"%encodeURI%": encodeURI,
|
|
998
|
+
"%encodeURIComponent%": encodeURIComponent,
|
|
999
|
+
"%Error%": $Error,
|
|
1000
|
+
"%eval%": eval,
|
|
1001
|
+
"%EvalError%": $EvalError,
|
|
1002
|
+
"%Float16Array%": typeof Float16Array === "undefined" ? undefined : Float16Array,
|
|
1003
|
+
"%Float32Array%": typeof Float32Array === "undefined" ? undefined : Float32Array,
|
|
1004
|
+
"%Float64Array%": typeof Float64Array === "undefined" ? undefined : Float64Array,
|
|
1005
|
+
"%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined : FinalizationRegistry,
|
|
1006
|
+
"%Function%": $Function,
|
|
1007
|
+
"%GeneratorFunction%": needsEval,
|
|
1008
|
+
"%Int8Array%": typeof Int8Array === "undefined" ? undefined : Int8Array,
|
|
1009
|
+
"%Int16Array%": typeof Int16Array === "undefined" ? undefined : Int16Array,
|
|
1010
|
+
"%Int32Array%": typeof Int32Array === "undefined" ? undefined : Int32Array,
|
|
1011
|
+
"%isFinite%": isFinite,
|
|
1012
|
+
"%isNaN%": isNaN,
|
|
1013
|
+
"%IteratorPrototype%": hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,
|
|
1014
|
+
"%JSON%": typeof JSON === "object" ? JSON : undefined,
|
|
1015
|
+
"%Map%": typeof Map === "undefined" ? undefined : Map,
|
|
1016
|
+
"%MapIteratorPrototype%": typeof Map === "undefined" || !hasSymbols || !getProto ? undefined : getProto((/* @__PURE__ */ new Map())[Symbol.iterator]()),
|
|
1017
|
+
"%Math%": Math,
|
|
1018
|
+
"%Number%": Number,
|
|
1019
|
+
"%Object%": $Object,
|
|
1020
|
+
"%Object.getOwnPropertyDescriptor%": $gOPD,
|
|
1021
|
+
"%parseFloat%": parseFloat,
|
|
1022
|
+
"%parseInt%": parseInt,
|
|
1023
|
+
"%Promise%": typeof Promise === "undefined" ? undefined : Promise,
|
|
1024
|
+
"%Proxy%": typeof Proxy === "undefined" ? undefined : Proxy,
|
|
1025
|
+
"%RangeError%": $RangeError,
|
|
1026
|
+
"%ReferenceError%": $ReferenceError,
|
|
1027
|
+
"%Reflect%": typeof Reflect === "undefined" ? undefined : Reflect,
|
|
1028
|
+
"%RegExp%": RegExp,
|
|
1029
|
+
"%Set%": typeof Set === "undefined" ? undefined : Set,
|
|
1030
|
+
"%SetIteratorPrototype%": typeof Set === "undefined" || !hasSymbols || !getProto ? undefined : getProto((/* @__PURE__ */ new Set())[Symbol.iterator]()),
|
|
1031
|
+
"%SharedArrayBuffer%": typeof SharedArrayBuffer === "undefined" ? undefined : SharedArrayBuffer,
|
|
1032
|
+
"%String%": String,
|
|
1033
|
+
"%StringIteratorPrototype%": hasSymbols && getProto ? getProto(""[Symbol.iterator]()) : undefined,
|
|
1034
|
+
"%Symbol%": hasSymbols ? Symbol : undefined,
|
|
1035
|
+
"%SyntaxError%": $SyntaxError,
|
|
1036
|
+
"%ThrowTypeError%": ThrowTypeError,
|
|
1037
|
+
"%TypedArray%": TypedArray,
|
|
1038
|
+
"%TypeError%": $TypeError,
|
|
1039
|
+
"%Uint8Array%": typeof Uint8Array === "undefined" ? undefined : Uint8Array,
|
|
1040
|
+
"%Uint8ClampedArray%": typeof Uint8ClampedArray === "undefined" ? undefined : Uint8ClampedArray,
|
|
1041
|
+
"%Uint16Array%": typeof Uint16Array === "undefined" ? undefined : Uint16Array,
|
|
1042
|
+
"%Uint32Array%": typeof Uint32Array === "undefined" ? undefined : Uint32Array,
|
|
1043
|
+
"%URIError%": $URIError,
|
|
1044
|
+
"%WeakMap%": typeof WeakMap === "undefined" ? undefined : WeakMap,
|
|
1045
|
+
"%WeakRef%": typeof WeakRef === "undefined" ? undefined : WeakRef,
|
|
1046
|
+
"%WeakSet%": typeof WeakSet === "undefined" ? undefined : WeakSet,
|
|
1047
|
+
"%Function.prototype.call%": $call,
|
|
1048
|
+
"%Function.prototype.apply%": $apply,
|
|
1049
|
+
"%Object.defineProperty%": $defineProperty,
|
|
1050
|
+
"%Object.getPrototypeOf%": $ObjectGPO,
|
|
1051
|
+
"%Math.abs%": abs,
|
|
1052
|
+
"%Math.floor%": floor,
|
|
1053
|
+
"%Math.max%": max,
|
|
1054
|
+
"%Math.min%": min,
|
|
1055
|
+
"%Math.pow%": pow,
|
|
1056
|
+
"%Math.round%": round,
|
|
1057
|
+
"%Math.sign%": sign,
|
|
1058
|
+
"%Reflect.getPrototypeOf%": $ReflectGPO
|
|
1059
|
+
};
|
|
1060
|
+
if (getProto) try {
|
|
1061
|
+
null.error;
|
|
1062
|
+
} catch (e) {
|
|
1063
|
+
INTRINSICS["%Error.prototype%"] = getProto(getProto(e));
|
|
1064
|
+
}
|
|
1065
|
+
var doEval = function doEval(name) {
|
|
1066
|
+
var value;
|
|
1067
|
+
if (name === "%AsyncFunction%") value = getEvalledConstructor("async function () {}");
|
|
1068
|
+
else if (name === "%GeneratorFunction%") value = getEvalledConstructor("function* () {}");
|
|
1069
|
+
else if (name === "%AsyncGeneratorFunction%") value = getEvalledConstructor("async function* () {}");
|
|
1070
|
+
else if (name === "%AsyncGenerator%") {
|
|
1071
|
+
var fn = doEval("%AsyncGeneratorFunction%");
|
|
1072
|
+
if (fn) value = fn.prototype;
|
|
1073
|
+
} else if (name === "%AsyncIteratorPrototype%") {
|
|
1074
|
+
var gen = doEval("%AsyncGenerator%");
|
|
1075
|
+
if (gen && getProto) value = getProto(gen.prototype);
|
|
1076
|
+
}
|
|
1077
|
+
INTRINSICS[name] = value;
|
|
1078
|
+
return value;
|
|
1079
|
+
};
|
|
1080
|
+
var LEGACY_ALIASES = {
|
|
1081
|
+
__proto__: null,
|
|
1082
|
+
"%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
|
|
1083
|
+
"%ArrayPrototype%": ["Array", "prototype"],
|
|
1084
|
+
"%ArrayProto_entries%": [
|
|
1085
|
+
"Array",
|
|
1086
|
+
"prototype",
|
|
1087
|
+
"entries"
|
|
1088
|
+
],
|
|
1089
|
+
"%ArrayProto_forEach%": [
|
|
1090
|
+
"Array",
|
|
1091
|
+
"prototype",
|
|
1092
|
+
"forEach"
|
|
1093
|
+
],
|
|
1094
|
+
"%ArrayProto_keys%": [
|
|
1095
|
+
"Array",
|
|
1096
|
+
"prototype",
|
|
1097
|
+
"keys"
|
|
1098
|
+
],
|
|
1099
|
+
"%ArrayProto_values%": [
|
|
1100
|
+
"Array",
|
|
1101
|
+
"prototype",
|
|
1102
|
+
"values"
|
|
1103
|
+
],
|
|
1104
|
+
"%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
|
|
1105
|
+
"%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
|
|
1106
|
+
"%AsyncGeneratorPrototype%": [
|
|
1107
|
+
"AsyncGeneratorFunction",
|
|
1108
|
+
"prototype",
|
|
1109
|
+
"prototype"
|
|
1110
|
+
],
|
|
1111
|
+
"%BooleanPrototype%": ["Boolean", "prototype"],
|
|
1112
|
+
"%DataViewPrototype%": ["DataView", "prototype"],
|
|
1113
|
+
"%DatePrototype%": ["Date", "prototype"],
|
|
1114
|
+
"%ErrorPrototype%": ["Error", "prototype"],
|
|
1115
|
+
"%EvalErrorPrototype%": ["EvalError", "prototype"],
|
|
1116
|
+
"%Float32ArrayPrototype%": ["Float32Array", "prototype"],
|
|
1117
|
+
"%Float64ArrayPrototype%": ["Float64Array", "prototype"],
|
|
1118
|
+
"%FunctionPrototype%": ["Function", "prototype"],
|
|
1119
|
+
"%Generator%": ["GeneratorFunction", "prototype"],
|
|
1120
|
+
"%GeneratorPrototype%": [
|
|
1121
|
+
"GeneratorFunction",
|
|
1122
|
+
"prototype",
|
|
1123
|
+
"prototype"
|
|
1124
|
+
],
|
|
1125
|
+
"%Int8ArrayPrototype%": ["Int8Array", "prototype"],
|
|
1126
|
+
"%Int16ArrayPrototype%": ["Int16Array", "prototype"],
|
|
1127
|
+
"%Int32ArrayPrototype%": ["Int32Array", "prototype"],
|
|
1128
|
+
"%JSONParse%": ["JSON", "parse"],
|
|
1129
|
+
"%JSONStringify%": ["JSON", "stringify"],
|
|
1130
|
+
"%MapPrototype%": ["Map", "prototype"],
|
|
1131
|
+
"%NumberPrototype%": ["Number", "prototype"],
|
|
1132
|
+
"%ObjectPrototype%": ["Object", "prototype"],
|
|
1133
|
+
"%ObjProto_toString%": [
|
|
1134
|
+
"Object",
|
|
1135
|
+
"prototype",
|
|
1136
|
+
"toString"
|
|
1137
|
+
],
|
|
1138
|
+
"%ObjProto_valueOf%": [
|
|
1139
|
+
"Object",
|
|
1140
|
+
"prototype",
|
|
1141
|
+
"valueOf"
|
|
1142
|
+
],
|
|
1143
|
+
"%PromisePrototype%": ["Promise", "prototype"],
|
|
1144
|
+
"%PromiseProto_then%": [
|
|
1145
|
+
"Promise",
|
|
1146
|
+
"prototype",
|
|
1147
|
+
"then"
|
|
1148
|
+
],
|
|
1149
|
+
"%Promise_all%": ["Promise", "all"],
|
|
1150
|
+
"%Promise_reject%": ["Promise", "reject"],
|
|
1151
|
+
"%Promise_resolve%": ["Promise", "resolve"],
|
|
1152
|
+
"%RangeErrorPrototype%": ["RangeError", "prototype"],
|
|
1153
|
+
"%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
|
|
1154
|
+
"%RegExpPrototype%": ["RegExp", "prototype"],
|
|
1155
|
+
"%SetPrototype%": ["Set", "prototype"],
|
|
1156
|
+
"%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
|
|
1157
|
+
"%StringPrototype%": ["String", "prototype"],
|
|
1158
|
+
"%SymbolPrototype%": ["Symbol", "prototype"],
|
|
1159
|
+
"%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
|
|
1160
|
+
"%TypedArrayPrototype%": ["TypedArray", "prototype"],
|
|
1161
|
+
"%TypeErrorPrototype%": ["TypeError", "prototype"],
|
|
1162
|
+
"%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
|
|
1163
|
+
"%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
|
|
1164
|
+
"%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
|
|
1165
|
+
"%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
|
|
1166
|
+
"%URIErrorPrototype%": ["URIError", "prototype"],
|
|
1167
|
+
"%WeakMapPrototype%": ["WeakMap", "prototype"],
|
|
1168
|
+
"%WeakSetPrototype%": ["WeakSet", "prototype"]
|
|
1169
|
+
};
|
|
1170
|
+
var bind = require_function_bind();
|
|
1171
|
+
var hasOwn = require_hasown();
|
|
1172
|
+
var $concat = bind.call($call, Array.prototype.concat);
|
|
1173
|
+
var $spliceApply = bind.call($apply, Array.prototype.splice);
|
|
1174
|
+
var $replace = bind.call($call, String.prototype.replace);
|
|
1175
|
+
var $strSlice = bind.call($call, String.prototype.slice);
|
|
1176
|
+
var $exec = bind.call($call, RegExp.prototype.exec);
|
|
1177
|
+
var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
|
|
1178
|
+
var reEscapeChar = /\\(\\)?/g;
|
|
1179
|
+
var stringToPath = function stringToPath(string) {
|
|
1180
|
+
var first = $strSlice(string, 0, 1);
|
|
1181
|
+
var last = $strSlice(string, -1);
|
|
1182
|
+
if (first === "%" && last !== "%") throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`");
|
|
1183
|
+
else if (last === "%" && first !== "%") throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");
|
|
1184
|
+
var result = [];
|
|
1185
|
+
$replace(string, rePropName, function(match, number, quote, subString) {
|
|
1186
|
+
result[result.length] = quote ? $replace(subString, reEscapeChar, "$1") : number || match;
|
|
1187
|
+
});
|
|
1188
|
+
return result;
|
|
1189
|
+
};
|
|
1190
|
+
var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
|
|
1191
|
+
var intrinsicName = name;
|
|
1192
|
+
var alias;
|
|
1193
|
+
if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
|
|
1194
|
+
alias = LEGACY_ALIASES[intrinsicName];
|
|
1195
|
+
intrinsicName = "%" + alias[0] + "%";
|
|
1196
|
+
}
|
|
1197
|
+
if (hasOwn(INTRINSICS, intrinsicName)) {
|
|
1198
|
+
var value = INTRINSICS[intrinsicName];
|
|
1199
|
+
if (value === needsEval) value = doEval(intrinsicName);
|
|
1200
|
+
if (typeof value === "undefined" && !allowMissing) throw new $TypeError("intrinsic " + name + " exists, but is not available. Please file an issue!");
|
|
1201
|
+
return {
|
|
1202
|
+
alias,
|
|
1203
|
+
name: intrinsicName,
|
|
1204
|
+
value
|
|
1205
|
+
};
|
|
1206
|
+
}
|
|
1207
|
+
throw new $SyntaxError("intrinsic " + name + " does not exist!");
|
|
1208
|
+
};
|
|
1209
|
+
module.exports = function GetIntrinsic(name, allowMissing) {
|
|
1210
|
+
if (typeof name !== "string" || name.length === 0) throw new $TypeError("intrinsic name must be a non-empty string");
|
|
1211
|
+
if (arguments.length > 1 && typeof allowMissing !== "boolean") throw new $TypeError("\"allowMissing\" argument must be a boolean");
|
|
1212
|
+
if ($exec(/^%?[^%]*%?$/, name) === null) throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
|
|
1213
|
+
var parts = stringToPath(name);
|
|
1214
|
+
var intrinsicBaseName = parts.length > 0 ? parts[0] : "";
|
|
1215
|
+
var intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing);
|
|
1216
|
+
var intrinsicRealName = intrinsic.name;
|
|
1217
|
+
var value = intrinsic.value;
|
|
1218
|
+
var skipFurtherCaching = false;
|
|
1219
|
+
var alias = intrinsic.alias;
|
|
1220
|
+
if (alias) {
|
|
1221
|
+
intrinsicBaseName = alias[0];
|
|
1222
|
+
$spliceApply(parts, $concat([0, 1], alias));
|
|
1223
|
+
}
|
|
1224
|
+
for (var i = 1, isOwn = true; i < parts.length; i += 1) {
|
|
1225
|
+
var part = parts[i];
|
|
1226
|
+
var first = $strSlice(part, 0, 1);
|
|
1227
|
+
var last = $strSlice(part, -1);
|
|
1228
|
+
if ((first === "\"" || first === "'" || first === "`" || last === "\"" || last === "'" || last === "`") && first !== last) throw new $SyntaxError("property names with quotes must have matching quotes");
|
|
1229
|
+
if (part === "constructor" || !isOwn) skipFurtherCaching = true;
|
|
1230
|
+
intrinsicBaseName += "." + part;
|
|
1231
|
+
intrinsicRealName = "%" + intrinsicBaseName + "%";
|
|
1232
|
+
if (hasOwn(INTRINSICS, intrinsicRealName)) value = INTRINSICS[intrinsicRealName];
|
|
1233
|
+
else if (value != null) {
|
|
1234
|
+
if (!(part in value)) {
|
|
1235
|
+
if (!allowMissing) throw new $TypeError("base intrinsic for " + name + " exists, but the property is not available.");
|
|
1236
|
+
return;
|
|
1237
|
+
}
|
|
1238
|
+
if ($gOPD && i + 1 >= parts.length) {
|
|
1239
|
+
var desc = $gOPD(value, part);
|
|
1240
|
+
isOwn = !!desc;
|
|
1241
|
+
if (isOwn && "get" in desc && !("originalValue" in desc.get)) value = desc.get;
|
|
1242
|
+
else value = value[part];
|
|
1243
|
+
} else {
|
|
1244
|
+
isOwn = hasOwn(value, part);
|
|
1245
|
+
value = value[part];
|
|
1246
|
+
}
|
|
1247
|
+
if (isOwn && !skipFurtherCaching) INTRINSICS[intrinsicRealName] = value;
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1250
|
+
return value;
|
|
1251
|
+
};
|
|
1252
|
+
}));
|
|
1253
|
+
|
|
1254
|
+
//#endregion
|
|
1255
|
+
//#region node_modules/call-bound/index.js
|
|
1256
|
+
var require_call_bound = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1257
|
+
var GetIntrinsic = require_get_intrinsic();
|
|
1258
|
+
var callBindBasic = require_call_bind_apply_helpers();
|
|
1259
|
+
/** @type {(thisArg: string, searchString: string, position?: number) => number} */
|
|
1260
|
+
var $indexOf = callBindBasic([GetIntrinsic("%String.prototype.indexOf%")]);
|
|
1261
|
+
/** @type {import('.')} */
|
|
1262
|
+
module.exports = function callBoundIntrinsic(name, allowMissing) {
|
|
1263
|
+
var intrinsic = GetIntrinsic(name, !!allowMissing);
|
|
1264
|
+
if (typeof intrinsic === "function" && $indexOf(name, ".prototype.") > -1) return callBindBasic([intrinsic]);
|
|
1265
|
+
return intrinsic;
|
|
1266
|
+
};
|
|
1267
|
+
}));
|
|
1268
|
+
|
|
1269
|
+
//#endregion
|
|
1270
|
+
//#region node_modules/side-channel-map/index.js
|
|
1271
|
+
var require_side_channel_map = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1272
|
+
var GetIntrinsic = require_get_intrinsic();
|
|
1273
|
+
var callBound = require_call_bound();
|
|
1274
|
+
var inspect = require_object_inspect();
|
|
1275
|
+
var $TypeError = require_type();
|
|
1276
|
+
var $Map = GetIntrinsic("%Map%", true);
|
|
1277
|
+
/** @type {<K, V>(thisArg: Map<K, V>, key: K) => V} */
|
|
1278
|
+
var $mapGet = callBound("Map.prototype.get", true);
|
|
1279
|
+
/** @type {<K, V>(thisArg: Map<K, V>, key: K, value: V) => void} */
|
|
1280
|
+
var $mapSet = callBound("Map.prototype.set", true);
|
|
1281
|
+
/** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */
|
|
1282
|
+
var $mapHas = callBound("Map.prototype.has", true);
|
|
1283
|
+
/** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */
|
|
1284
|
+
var $mapDelete = callBound("Map.prototype.delete", true);
|
|
1285
|
+
/** @type {<K, V>(thisArg: Map<K, V>) => number} */
|
|
1286
|
+
var $mapSize = callBound("Map.prototype.size", true);
|
|
1287
|
+
/** @type {import('.')} */
|
|
1288
|
+
module.exports = !!$Map && function getSideChannelMap() {
|
|
1289
|
+
/** @typedef {ReturnType<typeof getSideChannelMap>} Channel */
|
|
1290
|
+
/** @typedef {Parameters<Channel['get']>[0]} K */
|
|
1291
|
+
/** @typedef {Parameters<Channel['set']>[1]} V */
|
|
1292
|
+
/** @type {Map<K, V> | undefined} */ var $m;
|
|
1293
|
+
/** @type {Channel} */
|
|
1294
|
+
var channel = {
|
|
1295
|
+
assert: function(key) {
|
|
1296
|
+
if (!channel.has(key)) throw new $TypeError("Side channel does not contain " + inspect(key));
|
|
1297
|
+
},
|
|
1298
|
+
"delete": function(key) {
|
|
1299
|
+
if ($m) {
|
|
1300
|
+
var result = $mapDelete($m, key);
|
|
1301
|
+
if ($mapSize($m) === 0) $m = void 0;
|
|
1302
|
+
return result;
|
|
1303
|
+
}
|
|
1304
|
+
return false;
|
|
1305
|
+
},
|
|
1306
|
+
get: function(key) {
|
|
1307
|
+
if ($m) return $mapGet($m, key);
|
|
1308
|
+
},
|
|
1309
|
+
has: function(key) {
|
|
1310
|
+
if ($m) return $mapHas($m, key);
|
|
1311
|
+
return false;
|
|
1312
|
+
},
|
|
1313
|
+
set: function(key, value) {
|
|
1314
|
+
if (!$m) $m = new $Map();
|
|
1315
|
+
$mapSet($m, key, value);
|
|
1316
|
+
}
|
|
1317
|
+
};
|
|
1318
|
+
return channel;
|
|
1319
|
+
};
|
|
1320
|
+
}));
|
|
1321
|
+
|
|
1322
|
+
//#endregion
|
|
1323
|
+
//#region node_modules/side-channel-weakmap/index.js
|
|
1324
|
+
var require_side_channel_weakmap = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1325
|
+
var GetIntrinsic = require_get_intrinsic();
|
|
1326
|
+
var callBound = require_call_bound();
|
|
1327
|
+
var inspect = require_object_inspect();
|
|
1328
|
+
var getSideChannelMap = require_side_channel_map();
|
|
1329
|
+
var $TypeError = require_type();
|
|
1330
|
+
var $WeakMap = GetIntrinsic("%WeakMap%", true);
|
|
1331
|
+
/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => V} */
|
|
1332
|
+
var $weakMapGet = callBound("WeakMap.prototype.get", true);
|
|
1333
|
+
/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K, value: V) => void} */
|
|
1334
|
+
var $weakMapSet = callBound("WeakMap.prototype.set", true);
|
|
1335
|
+
/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */
|
|
1336
|
+
var $weakMapHas = callBound("WeakMap.prototype.has", true);
|
|
1337
|
+
/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */
|
|
1338
|
+
var $weakMapDelete = callBound("WeakMap.prototype.delete", true);
|
|
1339
|
+
/** @type {import('.')} */
|
|
1340
|
+
module.exports = $WeakMap ? function getSideChannelWeakMap() {
|
|
1341
|
+
/** @typedef {ReturnType<typeof getSideChannelWeakMap>} Channel */
|
|
1342
|
+
/** @typedef {Parameters<Channel['get']>[0]} K */
|
|
1343
|
+
/** @typedef {Parameters<Channel['set']>[1]} V */
|
|
1344
|
+
/** @type {WeakMap<K & object, V> | undefined} */ var $wm;
|
|
1345
|
+
/** @type {Channel | undefined} */ var $m;
|
|
1346
|
+
/** @type {Channel} */
|
|
1347
|
+
var channel = {
|
|
1348
|
+
assert: function(key) {
|
|
1349
|
+
if (!channel.has(key)) throw new $TypeError("Side channel does not contain " + inspect(key));
|
|
1350
|
+
},
|
|
1351
|
+
"delete": function(key) {
|
|
1352
|
+
if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) {
|
|
1353
|
+
if ($wm) return $weakMapDelete($wm, key);
|
|
1354
|
+
} else if (getSideChannelMap) {
|
|
1355
|
+
if ($m) return $m["delete"](key);
|
|
1356
|
+
}
|
|
1357
|
+
return false;
|
|
1358
|
+
},
|
|
1359
|
+
get: function(key) {
|
|
1360
|
+
if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) {
|
|
1361
|
+
if ($wm) return $weakMapGet($wm, key);
|
|
1362
|
+
}
|
|
1363
|
+
return $m && $m.get(key);
|
|
1364
|
+
},
|
|
1365
|
+
has: function(key) {
|
|
1366
|
+
if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) {
|
|
1367
|
+
if ($wm) return $weakMapHas($wm, key);
|
|
1368
|
+
}
|
|
1369
|
+
return !!$m && $m.has(key);
|
|
1370
|
+
},
|
|
1371
|
+
set: function(key, value) {
|
|
1372
|
+
if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) {
|
|
1373
|
+
if (!$wm) $wm = new $WeakMap();
|
|
1374
|
+
$weakMapSet($wm, key, value);
|
|
1375
|
+
} else if (getSideChannelMap) {
|
|
1376
|
+
if (!$m) $m = getSideChannelMap();
|
|
1377
|
+
/** @type {NonNullable<typeof $m>} */ $m.set(key, value);
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
};
|
|
1381
|
+
return channel;
|
|
1382
|
+
} : getSideChannelMap;
|
|
1383
|
+
}));
|
|
1384
|
+
|
|
1385
|
+
//#endregion
|
|
1386
|
+
//#region node_modules/side-channel/index.js
|
|
1387
|
+
var require_side_channel = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1388
|
+
var $TypeError = require_type();
|
|
1389
|
+
var inspect = require_object_inspect();
|
|
1390
|
+
var getSideChannelList = require_side_channel_list();
|
|
1391
|
+
var getSideChannelMap = require_side_channel_map();
|
|
1392
|
+
var makeChannel = require_side_channel_weakmap() || getSideChannelMap || getSideChannelList;
|
|
1393
|
+
/** @type {import('.')} */
|
|
1394
|
+
module.exports = function getSideChannel() {
|
|
1395
|
+
/** @typedef {ReturnType<typeof getSideChannel>} Channel */
|
|
1396
|
+
/** @type {Channel | undefined} */ var $channelData;
|
|
1397
|
+
/** @type {Channel} */
|
|
1398
|
+
var channel = {
|
|
1399
|
+
assert: function(key) {
|
|
1400
|
+
if (!channel.has(key)) throw new $TypeError("Side channel does not contain " + inspect(key));
|
|
1401
|
+
},
|
|
1402
|
+
"delete": function(key) {
|
|
1403
|
+
return !!$channelData && $channelData["delete"](key);
|
|
1404
|
+
},
|
|
1405
|
+
get: function(key) {
|
|
1406
|
+
return $channelData && $channelData.get(key);
|
|
1407
|
+
},
|
|
1408
|
+
has: function(key) {
|
|
1409
|
+
return !!$channelData && $channelData.has(key);
|
|
1410
|
+
},
|
|
1411
|
+
set: function(key, value) {
|
|
1412
|
+
if (!$channelData) $channelData = makeChannel();
|
|
1413
|
+
$channelData.set(key, value);
|
|
1414
|
+
}
|
|
1415
|
+
};
|
|
1416
|
+
return channel;
|
|
1417
|
+
};
|
|
1418
|
+
}));
|
|
1419
|
+
|
|
1420
|
+
//#endregion
|
|
1421
|
+
//#region node_modules/qs/lib/formats.js
|
|
1422
|
+
var require_formats = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1423
|
+
var replace = String.prototype.replace;
|
|
1424
|
+
var percentTwenties = /%20/g;
|
|
1425
|
+
var Format = {
|
|
1426
|
+
RFC1738: "RFC1738",
|
|
1427
|
+
RFC3986: "RFC3986"
|
|
1428
|
+
};
|
|
1429
|
+
module.exports = {
|
|
1430
|
+
"default": Format.RFC3986,
|
|
1431
|
+
formatters: {
|
|
1432
|
+
RFC1738: function(value) {
|
|
1433
|
+
return replace.call(value, percentTwenties, "+");
|
|
1434
|
+
},
|
|
1435
|
+
RFC3986: function(value) {
|
|
1436
|
+
return String(value);
|
|
1437
|
+
}
|
|
1438
|
+
},
|
|
1439
|
+
RFC1738: Format.RFC1738,
|
|
1440
|
+
RFC3986: Format.RFC3986
|
|
1441
|
+
};
|
|
1442
|
+
}));
|
|
1443
|
+
|
|
1444
|
+
//#endregion
|
|
1445
|
+
//#region node_modules/qs/lib/utils.js
|
|
1446
|
+
var require_utils = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1447
|
+
var formats = require_formats();
|
|
1448
|
+
var getSideChannel = require_side_channel();
|
|
1449
|
+
var has = Object.prototype.hasOwnProperty;
|
|
1450
|
+
var isArray = Array.isArray;
|
|
1451
|
+
var overflowChannel = getSideChannel();
|
|
1452
|
+
var markOverflow = function markOverflow(obj, maxIndex) {
|
|
1453
|
+
overflowChannel.set(obj, maxIndex);
|
|
1454
|
+
return obj;
|
|
1455
|
+
};
|
|
1456
|
+
var isOverflow = function isOverflow(obj) {
|
|
1457
|
+
return overflowChannel.has(obj);
|
|
1458
|
+
};
|
|
1459
|
+
var getMaxIndex = function getMaxIndex(obj) {
|
|
1460
|
+
return overflowChannel.get(obj);
|
|
1461
|
+
};
|
|
1462
|
+
var setMaxIndex = function setMaxIndex(obj, maxIndex) {
|
|
1463
|
+
overflowChannel.set(obj, maxIndex);
|
|
1464
|
+
};
|
|
1465
|
+
var hexTable = function() {
|
|
1466
|
+
var array = [];
|
|
1467
|
+
for (var i = 0; i < 256; ++i) array[array.length] = "%" + ((i < 16 ? "0" : "") + i.toString(16)).toUpperCase();
|
|
1468
|
+
return array;
|
|
1469
|
+
}();
|
|
1470
|
+
var compactQueue = function compactQueue(queue) {
|
|
1471
|
+
while (queue.length > 1) {
|
|
1472
|
+
var item = queue.pop();
|
|
1473
|
+
var obj = item.obj[item.prop];
|
|
1474
|
+
if (isArray(obj)) {
|
|
1475
|
+
var compacted = [];
|
|
1476
|
+
for (var j = 0; j < obj.length; ++j) if (typeof obj[j] !== "undefined") compacted[compacted.length] = obj[j];
|
|
1477
|
+
item.obj[item.prop] = compacted;
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1480
|
+
};
|
|
1481
|
+
var arrayToObject = function arrayToObject(source, options) {
|
|
1482
|
+
var obj = options && options.plainObjects ? { __proto__: null } : {};
|
|
1483
|
+
for (var i = 0; i < source.length; ++i) if (typeof source[i] !== "undefined") obj[i] = source[i];
|
|
1484
|
+
return obj;
|
|
1485
|
+
};
|
|
1486
|
+
var merge = function merge(target, source, options) {
|
|
1487
|
+
if (!source) return target;
|
|
1488
|
+
if (typeof source !== "object" && typeof source !== "function") {
|
|
1489
|
+
if (isArray(target)) {
|
|
1490
|
+
var nextIndex = target.length;
|
|
1491
|
+
if (options && typeof options.arrayLimit === "number" && nextIndex > options.arrayLimit) return markOverflow(arrayToObject(target.concat(source), options), nextIndex);
|
|
1492
|
+
target[nextIndex] = source;
|
|
1493
|
+
} else if (target && typeof target === "object") {
|
|
1494
|
+
if (isOverflow(target)) {
|
|
1495
|
+
var newIndex = getMaxIndex(target) + 1;
|
|
1496
|
+
target[newIndex] = source;
|
|
1497
|
+
setMaxIndex(target, newIndex);
|
|
1498
|
+
} else if (options && (options.plainObjects || options.allowPrototypes) || !has.call(Object.prototype, source)) target[source] = true;
|
|
1499
|
+
} else return [target, source];
|
|
1500
|
+
return target;
|
|
1501
|
+
}
|
|
1502
|
+
if (!target || typeof target !== "object") {
|
|
1503
|
+
if (isOverflow(source)) {
|
|
1504
|
+
var sourceKeys = Object.keys(source);
|
|
1505
|
+
var result = options && options.plainObjects ? {
|
|
1506
|
+
__proto__: null,
|
|
1507
|
+
0: target
|
|
1508
|
+
} : { 0: target };
|
|
1509
|
+
for (var m = 0; m < sourceKeys.length; m++) {
|
|
1510
|
+
var oldKey = parseInt(sourceKeys[m], 10);
|
|
1511
|
+
result[oldKey + 1] = source[sourceKeys[m]];
|
|
1512
|
+
}
|
|
1513
|
+
return markOverflow(result, getMaxIndex(source) + 1);
|
|
1514
|
+
}
|
|
1515
|
+
var combined = [target].concat(source);
|
|
1516
|
+
if (options && typeof options.arrayLimit === "number" && combined.length > options.arrayLimit) return markOverflow(arrayToObject(combined, options), combined.length - 1);
|
|
1517
|
+
return combined;
|
|
1518
|
+
}
|
|
1519
|
+
var mergeTarget = target;
|
|
1520
|
+
if (isArray(target) && !isArray(source)) mergeTarget = arrayToObject(target, options);
|
|
1521
|
+
if (isArray(target) && isArray(source)) {
|
|
1522
|
+
source.forEach(function(item, i) {
|
|
1523
|
+
if (has.call(target, i)) {
|
|
1524
|
+
var targetItem = target[i];
|
|
1525
|
+
if (targetItem && typeof targetItem === "object" && item && typeof item === "object") target[i] = merge(targetItem, item, options);
|
|
1526
|
+
else target[target.length] = item;
|
|
1527
|
+
} else target[i] = item;
|
|
1528
|
+
});
|
|
1529
|
+
return target;
|
|
1530
|
+
}
|
|
1531
|
+
return Object.keys(source).reduce(function(acc, key) {
|
|
1532
|
+
var value = source[key];
|
|
1533
|
+
if (has.call(acc, key)) acc[key] = merge(acc[key], value, options);
|
|
1534
|
+
else acc[key] = value;
|
|
1535
|
+
if (isOverflow(source) && !isOverflow(acc)) markOverflow(acc, getMaxIndex(source));
|
|
1536
|
+
if (isOverflow(acc)) {
|
|
1537
|
+
var keyNum = parseInt(key, 10);
|
|
1538
|
+
if (String(keyNum) === key && keyNum >= 0 && keyNum > getMaxIndex(acc)) setMaxIndex(acc, keyNum);
|
|
1539
|
+
}
|
|
1540
|
+
return acc;
|
|
1541
|
+
}, mergeTarget);
|
|
1542
|
+
};
|
|
1543
|
+
var assign = function assignSingleSource(target, source) {
|
|
1544
|
+
return Object.keys(source).reduce(function(acc, key) {
|
|
1545
|
+
acc[key] = source[key];
|
|
1546
|
+
return acc;
|
|
1547
|
+
}, target);
|
|
1548
|
+
};
|
|
1549
|
+
var decode = function(str, defaultDecoder, charset) {
|
|
1550
|
+
var strWithoutPlus = str.replace(/\+/g, " ");
|
|
1551
|
+
if (charset === "iso-8859-1") return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
|
|
1552
|
+
try {
|
|
1553
|
+
return decodeURIComponent(strWithoutPlus);
|
|
1554
|
+
} catch (e) {
|
|
1555
|
+
return strWithoutPlus;
|
|
1556
|
+
}
|
|
1557
|
+
};
|
|
1558
|
+
var limit = 1024;
|
|
1559
|
+
var encode = function encode(str, defaultEncoder, charset, kind, format) {
|
|
1560
|
+
if (str.length === 0) return str;
|
|
1561
|
+
var string = str;
|
|
1562
|
+
if (typeof str === "symbol") string = Symbol.prototype.toString.call(str);
|
|
1563
|
+
else if (typeof str !== "string") string = String(str);
|
|
1564
|
+
if (charset === "iso-8859-1") return escape(string).replace(/%u[0-9a-f]{4}/gi, function($0) {
|
|
1565
|
+
return "%26%23" + parseInt($0.slice(2), 16) + "%3B";
|
|
1566
|
+
});
|
|
1567
|
+
var out = "";
|
|
1568
|
+
for (var j = 0; j < string.length; j += limit) {
|
|
1569
|
+
var segment = string.length >= limit ? string.slice(j, j + limit) : string;
|
|
1570
|
+
var arr = [];
|
|
1571
|
+
for (var i = 0; i < segment.length; ++i) {
|
|
1572
|
+
var c = segment.charCodeAt(i);
|
|
1573
|
+
if (c === 45 || c === 46 || c === 95 || c === 126 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c >= 97 && c <= 122 || format === formats.RFC1738 && (c === 40 || c === 41)) {
|
|
1574
|
+
arr[arr.length] = segment.charAt(i);
|
|
1575
|
+
continue;
|
|
1576
|
+
}
|
|
1577
|
+
if (c < 128) {
|
|
1578
|
+
arr[arr.length] = hexTable[c];
|
|
1579
|
+
continue;
|
|
1580
|
+
}
|
|
1581
|
+
if (c < 2048) {
|
|
1582
|
+
arr[arr.length] = hexTable[192 | c >> 6] + hexTable[128 | c & 63];
|
|
1583
|
+
continue;
|
|
1584
|
+
}
|
|
1585
|
+
if (c < 55296 || c >= 57344) {
|
|
1586
|
+
arr[arr.length] = hexTable[224 | c >> 12] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];
|
|
1587
|
+
continue;
|
|
1588
|
+
}
|
|
1589
|
+
i += 1;
|
|
1590
|
+
c = 65536 + ((c & 1023) << 10 | segment.charCodeAt(i) & 1023);
|
|
1591
|
+
arr[arr.length] = hexTable[240 | c >> 18] + hexTable[128 | c >> 12 & 63] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];
|
|
1592
|
+
}
|
|
1593
|
+
out += arr.join("");
|
|
1594
|
+
}
|
|
1595
|
+
return out;
|
|
1596
|
+
};
|
|
1597
|
+
var compact = function compact(value) {
|
|
1598
|
+
var queue = [{
|
|
1599
|
+
obj: { o: value },
|
|
1600
|
+
prop: "o"
|
|
1601
|
+
}];
|
|
1602
|
+
var refs = [];
|
|
1603
|
+
for (var i = 0; i < queue.length; ++i) {
|
|
1604
|
+
var item = queue[i];
|
|
1605
|
+
var obj = item.obj[item.prop];
|
|
1606
|
+
var keys = Object.keys(obj);
|
|
1607
|
+
for (var j = 0; j < keys.length; ++j) {
|
|
1608
|
+
var key = keys[j];
|
|
1609
|
+
var val = obj[key];
|
|
1610
|
+
if (typeof val === "object" && val !== null && refs.indexOf(val) === -1) {
|
|
1611
|
+
queue[queue.length] = {
|
|
1612
|
+
obj,
|
|
1613
|
+
prop: key
|
|
1614
|
+
};
|
|
1615
|
+
refs[refs.length] = val;
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
}
|
|
1619
|
+
compactQueue(queue);
|
|
1620
|
+
return value;
|
|
1621
|
+
};
|
|
1622
|
+
var isRegExp = function isRegExp(obj) {
|
|
1623
|
+
return Object.prototype.toString.call(obj) === "[object RegExp]";
|
|
1624
|
+
};
|
|
1625
|
+
var isBuffer = function isBuffer(obj) {
|
|
1626
|
+
if (!obj || typeof obj !== "object") return false;
|
|
1627
|
+
return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
|
|
1628
|
+
};
|
|
1629
|
+
var combine = function combine(a, b, arrayLimit, plainObjects) {
|
|
1630
|
+
if (isOverflow(a)) {
|
|
1631
|
+
var newIndex = getMaxIndex(a) + 1;
|
|
1632
|
+
a[newIndex] = b;
|
|
1633
|
+
setMaxIndex(a, newIndex);
|
|
1634
|
+
return a;
|
|
1635
|
+
}
|
|
1636
|
+
var result = [].concat(a, b);
|
|
1637
|
+
if (result.length > arrayLimit) return markOverflow(arrayToObject(result, { plainObjects }), result.length - 1);
|
|
1638
|
+
return result;
|
|
1639
|
+
};
|
|
1640
|
+
var maybeMap = function maybeMap(val, fn) {
|
|
1641
|
+
if (isArray(val)) {
|
|
1642
|
+
var mapped = [];
|
|
1643
|
+
for (var i = 0; i < val.length; i += 1) mapped[mapped.length] = fn(val[i]);
|
|
1644
|
+
return mapped;
|
|
1645
|
+
}
|
|
1646
|
+
return fn(val);
|
|
1647
|
+
};
|
|
1648
|
+
module.exports = {
|
|
1649
|
+
arrayToObject,
|
|
1650
|
+
assign,
|
|
1651
|
+
combine,
|
|
1652
|
+
compact,
|
|
1653
|
+
decode,
|
|
1654
|
+
encode,
|
|
1655
|
+
isBuffer,
|
|
1656
|
+
isOverflow,
|
|
1657
|
+
isRegExp,
|
|
1658
|
+
markOverflow,
|
|
1659
|
+
maybeMap,
|
|
1660
|
+
merge
|
|
1661
|
+
};
|
|
1662
|
+
}));
|
|
1663
|
+
|
|
1664
|
+
//#endregion
|
|
1665
|
+
//#region node_modules/qs/lib/stringify.js
|
|
1666
|
+
var require_stringify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1667
|
+
var getSideChannel = require_side_channel();
|
|
1668
|
+
var utils = require_utils();
|
|
1669
|
+
var formats = require_formats();
|
|
1670
|
+
var has = Object.prototype.hasOwnProperty;
|
|
1671
|
+
var arrayPrefixGenerators = {
|
|
1672
|
+
brackets: function brackets(prefix) {
|
|
1673
|
+
return prefix + "[]";
|
|
1674
|
+
},
|
|
1675
|
+
comma: "comma",
|
|
1676
|
+
indices: function indices(prefix, key) {
|
|
1677
|
+
return prefix + "[" + key + "]";
|
|
1678
|
+
},
|
|
1679
|
+
repeat: function repeat(prefix) {
|
|
1680
|
+
return prefix;
|
|
1681
|
+
}
|
|
1682
|
+
};
|
|
1683
|
+
var isArray = Array.isArray;
|
|
1684
|
+
var push = Array.prototype.push;
|
|
1685
|
+
var pushToArray = function(arr, valueOrArray) {
|
|
1686
|
+
push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
|
|
1687
|
+
};
|
|
1688
|
+
var toISO = Date.prototype.toISOString;
|
|
1689
|
+
var defaultFormat = formats["default"];
|
|
1690
|
+
var defaults = {
|
|
1691
|
+
addQueryPrefix: false,
|
|
1692
|
+
allowDots: false,
|
|
1693
|
+
allowEmptyArrays: false,
|
|
1694
|
+
arrayFormat: "indices",
|
|
1695
|
+
charset: "utf-8",
|
|
1696
|
+
charsetSentinel: false,
|
|
1697
|
+
commaRoundTrip: false,
|
|
1698
|
+
delimiter: "&",
|
|
1699
|
+
encode: true,
|
|
1700
|
+
encodeDotInKeys: false,
|
|
1701
|
+
encoder: utils.encode,
|
|
1702
|
+
encodeValuesOnly: false,
|
|
1703
|
+
filter: void 0,
|
|
1704
|
+
format: defaultFormat,
|
|
1705
|
+
formatter: formats.formatters[defaultFormat],
|
|
1706
|
+
indices: false,
|
|
1707
|
+
serializeDate: function serializeDate(date) {
|
|
1708
|
+
return toISO.call(date);
|
|
1709
|
+
},
|
|
1710
|
+
skipNulls: false,
|
|
1711
|
+
strictNullHandling: false
|
|
1712
|
+
};
|
|
1713
|
+
var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
|
|
1714
|
+
return typeof v === "string" || typeof v === "number" || typeof v === "boolean" || typeof v === "symbol" || typeof v === "bigint";
|
|
1715
|
+
};
|
|
1716
|
+
var sentinel = {};
|
|
1717
|
+
var stringify = function stringify(object, prefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, encoder, filter, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, sideChannel) {
|
|
1718
|
+
var obj = object;
|
|
1719
|
+
var tmpSc = sideChannel;
|
|
1720
|
+
var step = 0;
|
|
1721
|
+
var findFlag = false;
|
|
1722
|
+
while ((tmpSc = tmpSc.get(sentinel)) !== void 0 && !findFlag) {
|
|
1723
|
+
var pos = tmpSc.get(object);
|
|
1724
|
+
step += 1;
|
|
1725
|
+
if (typeof pos !== "undefined") if (pos === step) throw new RangeError("Cyclic object value");
|
|
1726
|
+
else findFlag = true;
|
|
1727
|
+
if (typeof tmpSc.get(sentinel) === "undefined") step = 0;
|
|
1728
|
+
}
|
|
1729
|
+
if (typeof filter === "function") obj = filter(prefix, obj);
|
|
1730
|
+
else if (obj instanceof Date) obj = serializeDate(obj);
|
|
1731
|
+
else if (generateArrayPrefix === "comma" && isArray(obj)) obj = utils.maybeMap(obj, function(value) {
|
|
1732
|
+
if (value instanceof Date) return serializeDate(value);
|
|
1733
|
+
return value;
|
|
1734
|
+
});
|
|
1735
|
+
if (obj === null) {
|
|
1736
|
+
if (strictNullHandling) return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, "key", format) : prefix;
|
|
1737
|
+
obj = "";
|
|
1738
|
+
}
|
|
1739
|
+
if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
|
|
1740
|
+
if (encoder) return [formatter(encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, "key", format)) + "=" + formatter(encoder(obj, defaults.encoder, charset, "value", format))];
|
|
1741
|
+
return [formatter(prefix) + "=" + formatter(String(obj))];
|
|
1742
|
+
}
|
|
1743
|
+
var values = [];
|
|
1744
|
+
if (typeof obj === "undefined") return values;
|
|
1745
|
+
var objKeys;
|
|
1746
|
+
if (generateArrayPrefix === "comma" && isArray(obj)) {
|
|
1747
|
+
if (encodeValuesOnly && encoder) obj = utils.maybeMap(obj, encoder);
|
|
1748
|
+
objKeys = [{ value: obj.length > 0 ? obj.join(",") || null : void 0 }];
|
|
1749
|
+
} else if (isArray(filter)) objKeys = filter;
|
|
1750
|
+
else {
|
|
1751
|
+
var keys = Object.keys(obj);
|
|
1752
|
+
objKeys = sort ? keys.sort(sort) : keys;
|
|
1753
|
+
}
|
|
1754
|
+
var encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\./g, "%2E") : String(prefix);
|
|
1755
|
+
var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + "[]" : encodedPrefix;
|
|
1756
|
+
if (allowEmptyArrays && isArray(obj) && obj.length === 0) return adjustedPrefix + "[]";
|
|
1757
|
+
for (var j = 0; j < objKeys.length; ++j) {
|
|
1758
|
+
var key = objKeys[j];
|
|
1759
|
+
var value = typeof key === "object" && key && typeof key.value !== "undefined" ? key.value : obj[key];
|
|
1760
|
+
if (skipNulls && value === null) continue;
|
|
1761
|
+
var encodedKey = allowDots && encodeDotInKeys ? String(key).replace(/\./g, "%2E") : String(key);
|
|
1762
|
+
var keyPrefix = isArray(obj) ? typeof generateArrayPrefix === "function" ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix : adjustedPrefix + (allowDots ? "." + encodedKey : "[" + encodedKey + "]");
|
|
1763
|
+
sideChannel.set(object, step);
|
|
1764
|
+
var valueSideChannel = getSideChannel();
|
|
1765
|
+
valueSideChannel.set(sentinel, sideChannel);
|
|
1766
|
+
pushToArray(values, stringify(value, keyPrefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, generateArrayPrefix === "comma" && encodeValuesOnly && isArray(obj) ? null : encoder, filter, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, valueSideChannel));
|
|
1767
|
+
}
|
|
1768
|
+
return values;
|
|
1769
|
+
};
|
|
1770
|
+
var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
|
|
1771
|
+
if (!opts) return defaults;
|
|
1772
|
+
if (typeof opts.allowEmptyArrays !== "undefined" && typeof opts.allowEmptyArrays !== "boolean") throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
|
|
1773
|
+
if (typeof opts.encodeDotInKeys !== "undefined" && typeof opts.encodeDotInKeys !== "boolean") throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");
|
|
1774
|
+
if (opts.encoder !== null && typeof opts.encoder !== "undefined" && typeof opts.encoder !== "function") throw new TypeError("Encoder has to be a function.");
|
|
1775
|
+
var charset = opts.charset || defaults.charset;
|
|
1776
|
+
if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
|
|
1777
|
+
var format = formats["default"];
|
|
1778
|
+
if (typeof opts.format !== "undefined") {
|
|
1779
|
+
if (!has.call(formats.formatters, opts.format)) throw new TypeError("Unknown format option provided.");
|
|
1780
|
+
format = opts.format;
|
|
1781
|
+
}
|
|
1782
|
+
var formatter = formats.formatters[format];
|
|
1783
|
+
var filter = defaults.filter;
|
|
1784
|
+
if (typeof opts.filter === "function" || isArray(opts.filter)) filter = opts.filter;
|
|
1785
|
+
var arrayFormat;
|
|
1786
|
+
if (opts.arrayFormat in arrayPrefixGenerators) arrayFormat = opts.arrayFormat;
|
|
1787
|
+
else if ("indices" in opts) arrayFormat = opts.indices ? "indices" : "repeat";
|
|
1788
|
+
else arrayFormat = defaults.arrayFormat;
|
|
1789
|
+
if ("commaRoundTrip" in opts && typeof opts.commaRoundTrip !== "boolean") throw new TypeError("`commaRoundTrip` must be a boolean, or absent");
|
|
1790
|
+
var allowDots = typeof opts.allowDots === "undefined" ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
|
|
1791
|
+
return {
|
|
1792
|
+
addQueryPrefix: typeof opts.addQueryPrefix === "boolean" ? opts.addQueryPrefix : defaults.addQueryPrefix,
|
|
1793
|
+
allowDots,
|
|
1794
|
+
allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
|
|
1795
|
+
arrayFormat,
|
|
1796
|
+
charset,
|
|
1797
|
+
charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults.charsetSentinel,
|
|
1798
|
+
commaRoundTrip: !!opts.commaRoundTrip,
|
|
1799
|
+
delimiter: typeof opts.delimiter === "undefined" ? defaults.delimiter : opts.delimiter,
|
|
1800
|
+
encode: typeof opts.encode === "boolean" ? opts.encode : defaults.encode,
|
|
1801
|
+
encodeDotInKeys: typeof opts.encodeDotInKeys === "boolean" ? opts.encodeDotInKeys : defaults.encodeDotInKeys,
|
|
1802
|
+
encoder: typeof opts.encoder === "function" ? opts.encoder : defaults.encoder,
|
|
1803
|
+
encodeValuesOnly: typeof opts.encodeValuesOnly === "boolean" ? opts.encodeValuesOnly : defaults.encodeValuesOnly,
|
|
1804
|
+
filter,
|
|
1805
|
+
format,
|
|
1806
|
+
formatter,
|
|
1807
|
+
serializeDate: typeof opts.serializeDate === "function" ? opts.serializeDate : defaults.serializeDate,
|
|
1808
|
+
skipNulls: typeof opts.skipNulls === "boolean" ? opts.skipNulls : defaults.skipNulls,
|
|
1809
|
+
sort: typeof opts.sort === "function" ? opts.sort : null,
|
|
1810
|
+
strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults.strictNullHandling
|
|
1811
|
+
};
|
|
1812
|
+
};
|
|
1813
|
+
module.exports = function(object, opts) {
|
|
1814
|
+
var obj = object;
|
|
1815
|
+
var options = normalizeStringifyOptions(opts);
|
|
1816
|
+
var objKeys;
|
|
1817
|
+
var filter;
|
|
1818
|
+
if (typeof options.filter === "function") {
|
|
1819
|
+
filter = options.filter;
|
|
1820
|
+
obj = filter("", obj);
|
|
1821
|
+
} else if (isArray(options.filter)) {
|
|
1822
|
+
filter = options.filter;
|
|
1823
|
+
objKeys = filter;
|
|
1824
|
+
}
|
|
1825
|
+
var keys = [];
|
|
1826
|
+
if (typeof obj !== "object" || obj === null) return "";
|
|
1827
|
+
var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat];
|
|
1828
|
+
var commaRoundTrip = generateArrayPrefix === "comma" && options.commaRoundTrip;
|
|
1829
|
+
if (!objKeys) objKeys = Object.keys(obj);
|
|
1830
|
+
if (options.sort) objKeys.sort(options.sort);
|
|
1831
|
+
var sideChannel = getSideChannel();
|
|
1832
|
+
for (var i = 0; i < objKeys.length; ++i) {
|
|
1833
|
+
var key = objKeys[i];
|
|
1834
|
+
var value = obj[key];
|
|
1835
|
+
if (options.skipNulls && value === null) continue;
|
|
1836
|
+
pushToArray(keys, stringify(value, key, generateArrayPrefix, commaRoundTrip, options.allowEmptyArrays, options.strictNullHandling, options.skipNulls, options.encodeDotInKeys, options.encode ? options.encoder : null, options.filter, options.sort, options.allowDots, options.serializeDate, options.format, options.formatter, options.encodeValuesOnly, options.charset, sideChannel));
|
|
1837
|
+
}
|
|
1838
|
+
var joined = keys.join(options.delimiter);
|
|
1839
|
+
var prefix = options.addQueryPrefix === true ? "?" : "";
|
|
1840
|
+
if (options.charsetSentinel) if (options.charset === "iso-8859-1") prefix += "utf8=%26%2310003%3B&";
|
|
1841
|
+
else prefix += "utf8=%E2%9C%93&";
|
|
1842
|
+
return joined.length > 0 ? prefix + joined : "";
|
|
1843
|
+
};
|
|
1844
|
+
}));
|
|
1845
|
+
|
|
1846
|
+
//#endregion
|
|
1847
|
+
//#region node_modules/qs/lib/parse.js
|
|
1848
|
+
var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1849
|
+
var utils = require_utils();
|
|
1850
|
+
var has = Object.prototype.hasOwnProperty;
|
|
1851
|
+
var isArray = Array.isArray;
|
|
1852
|
+
var defaults = {
|
|
1853
|
+
allowDots: false,
|
|
1854
|
+
allowEmptyArrays: false,
|
|
1855
|
+
allowPrototypes: false,
|
|
1856
|
+
allowSparse: false,
|
|
1857
|
+
arrayLimit: 20,
|
|
1858
|
+
charset: "utf-8",
|
|
1859
|
+
charsetSentinel: false,
|
|
1860
|
+
comma: false,
|
|
1861
|
+
decodeDotInKeys: false,
|
|
1862
|
+
decoder: utils.decode,
|
|
1863
|
+
delimiter: "&",
|
|
1864
|
+
depth: 5,
|
|
1865
|
+
duplicates: "combine",
|
|
1866
|
+
ignoreQueryPrefix: false,
|
|
1867
|
+
interpretNumericEntities: false,
|
|
1868
|
+
parameterLimit: 1e3,
|
|
1869
|
+
parseArrays: true,
|
|
1870
|
+
plainObjects: false,
|
|
1871
|
+
strictDepth: false,
|
|
1872
|
+
strictNullHandling: false,
|
|
1873
|
+
throwOnLimitExceeded: false
|
|
1874
|
+
};
|
|
1875
|
+
var interpretNumericEntities = function(str) {
|
|
1876
|
+
return str.replace(/&#(\d+);/g, function($0, numberStr) {
|
|
1877
|
+
return String.fromCharCode(parseInt(numberStr, 10));
|
|
1878
|
+
});
|
|
1879
|
+
};
|
|
1880
|
+
var parseArrayValue = function(val, options, currentArrayLength) {
|
|
1881
|
+
if (val && typeof val === "string" && options.comma && val.indexOf(",") > -1) return val.split(",");
|
|
1882
|
+
if (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) throw new RangeError("Array limit exceeded. Only " + options.arrayLimit + " element" + (options.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
|
|
1883
|
+
return val;
|
|
1884
|
+
};
|
|
1885
|
+
var isoSentinel = "utf8=%26%2310003%3B";
|
|
1886
|
+
var charsetSentinel = "utf8=%E2%9C%93";
|
|
1887
|
+
var parseValues = function parseQueryStringValues(str, options) {
|
|
1888
|
+
var obj = { __proto__: null };
|
|
1889
|
+
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, "") : str;
|
|
1890
|
+
cleanStr = cleanStr.replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
1891
|
+
var limit = options.parameterLimit === Infinity ? void 0 : options.parameterLimit;
|
|
1892
|
+
var parts = cleanStr.split(options.delimiter, options.throwOnLimitExceeded ? limit + 1 : limit);
|
|
1893
|
+
if (options.throwOnLimitExceeded && parts.length > limit) throw new RangeError("Parameter limit exceeded. Only " + limit + " parameter" + (limit === 1 ? "" : "s") + " allowed.");
|
|
1894
|
+
var skipIndex = -1;
|
|
1895
|
+
var i;
|
|
1896
|
+
var charset = options.charset;
|
|
1897
|
+
if (options.charsetSentinel) {
|
|
1898
|
+
for (i = 0; i < parts.length; ++i) if (parts[i].indexOf("utf8=") === 0) {
|
|
1899
|
+
if (parts[i] === charsetSentinel) charset = "utf-8";
|
|
1900
|
+
else if (parts[i] === isoSentinel) charset = "iso-8859-1";
|
|
1901
|
+
skipIndex = i;
|
|
1902
|
+
i = parts.length;
|
|
1903
|
+
}
|
|
1904
|
+
}
|
|
1905
|
+
for (i = 0; i < parts.length; ++i) {
|
|
1906
|
+
if (i === skipIndex) continue;
|
|
1907
|
+
var part = parts[i];
|
|
1908
|
+
var bracketEqualsPos = part.indexOf("]=");
|
|
1909
|
+
var pos = bracketEqualsPos === -1 ? part.indexOf("=") : bracketEqualsPos + 1;
|
|
1910
|
+
var key;
|
|
1911
|
+
var val;
|
|
1912
|
+
if (pos === -1) {
|
|
1913
|
+
key = options.decoder(part, defaults.decoder, charset, "key");
|
|
1914
|
+
val = options.strictNullHandling ? null : "";
|
|
1915
|
+
} else {
|
|
1916
|
+
key = options.decoder(part.slice(0, pos), defaults.decoder, charset, "key");
|
|
1917
|
+
if (key !== null) val = utils.maybeMap(parseArrayValue(part.slice(pos + 1), options, isArray(obj[key]) ? obj[key].length : 0), function(encodedVal) {
|
|
1918
|
+
return options.decoder(encodedVal, defaults.decoder, charset, "value");
|
|
1919
|
+
});
|
|
1920
|
+
}
|
|
1921
|
+
if (val && options.interpretNumericEntities && charset === "iso-8859-1") val = interpretNumericEntities(String(val));
|
|
1922
|
+
if (part.indexOf("[]=") > -1) val = isArray(val) ? [val] : val;
|
|
1923
|
+
if (options.comma && isArray(val) && val.length > options.arrayLimit) {
|
|
1924
|
+
if (options.throwOnLimitExceeded) throw new RangeError("Array limit exceeded. Only " + options.arrayLimit + " element" + (options.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
|
|
1925
|
+
val = utils.combine([], val, options.arrayLimit, options.plainObjects);
|
|
1926
|
+
}
|
|
1927
|
+
if (key !== null) {
|
|
1928
|
+
var existing = has.call(obj, key);
|
|
1929
|
+
if (existing && options.duplicates === "combine") obj[key] = utils.combine(obj[key], val, options.arrayLimit, options.plainObjects);
|
|
1930
|
+
else if (!existing || options.duplicates === "last") obj[key] = val;
|
|
1931
|
+
}
|
|
1932
|
+
}
|
|
1933
|
+
return obj;
|
|
1934
|
+
};
|
|
1935
|
+
var parseObject = function(chain, val, options, valuesParsed) {
|
|
1936
|
+
var currentArrayLength = 0;
|
|
1937
|
+
if (chain.length > 0 && chain[chain.length - 1] === "[]") {
|
|
1938
|
+
var parentKey = chain.slice(0, -1).join("");
|
|
1939
|
+
currentArrayLength = Array.isArray(val) && val[parentKey] ? val[parentKey].length : 0;
|
|
1940
|
+
}
|
|
1941
|
+
var leaf = valuesParsed ? val : parseArrayValue(val, options, currentArrayLength);
|
|
1942
|
+
for (var i = chain.length - 1; i >= 0; --i) {
|
|
1943
|
+
var obj;
|
|
1944
|
+
var root = chain[i];
|
|
1945
|
+
if (root === "[]" && options.parseArrays) if (utils.isOverflow(leaf)) obj = leaf;
|
|
1946
|
+
else obj = options.allowEmptyArrays && (leaf === "" || options.strictNullHandling && leaf === null) ? [] : utils.combine([], leaf, options.arrayLimit, options.plainObjects);
|
|
1947
|
+
else {
|
|
1948
|
+
obj = options.plainObjects ? { __proto__: null } : {};
|
|
1949
|
+
var cleanRoot = root.charAt(0) === "[" && root.charAt(root.length - 1) === "]" ? root.slice(1, -1) : root;
|
|
1950
|
+
var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, ".") : cleanRoot;
|
|
1951
|
+
var index = parseInt(decodedRoot, 10);
|
|
1952
|
+
var isValidArrayIndex = !isNaN(index) && root !== decodedRoot && String(index) === decodedRoot && index >= 0 && options.parseArrays;
|
|
1953
|
+
if (!options.parseArrays && decodedRoot === "") obj = { 0: leaf };
|
|
1954
|
+
else if (isValidArrayIndex && index < options.arrayLimit) {
|
|
1955
|
+
obj = [];
|
|
1956
|
+
obj[index] = leaf;
|
|
1957
|
+
} else if (isValidArrayIndex && options.throwOnLimitExceeded) throw new RangeError("Array limit exceeded. Only " + options.arrayLimit + " element" + (options.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
|
|
1958
|
+
else if (isValidArrayIndex) {
|
|
1959
|
+
obj[index] = leaf;
|
|
1960
|
+
utils.markOverflow(obj, index);
|
|
1961
|
+
} else if (decodedRoot !== "__proto__") obj[decodedRoot] = leaf;
|
|
1962
|
+
}
|
|
1963
|
+
leaf = obj;
|
|
1964
|
+
}
|
|
1965
|
+
return leaf;
|
|
1966
|
+
};
|
|
1967
|
+
var splitKeyIntoSegments = function splitKeyIntoSegments(givenKey, options) {
|
|
1968
|
+
var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, "[$1]") : givenKey;
|
|
1969
|
+
if (options.depth <= 0) {
|
|
1970
|
+
if (!options.plainObjects && has.call(Object.prototype, key)) {
|
|
1971
|
+
if (!options.allowPrototypes) return;
|
|
1972
|
+
}
|
|
1973
|
+
return [key];
|
|
1974
|
+
}
|
|
1975
|
+
var brackets = /(\[[^[\]]*])/;
|
|
1976
|
+
var child = /(\[[^[\]]*])/g;
|
|
1977
|
+
var segment = brackets.exec(key);
|
|
1978
|
+
var parent = segment ? key.slice(0, segment.index) : key;
|
|
1979
|
+
var keys = [];
|
|
1980
|
+
if (parent) {
|
|
1981
|
+
if (!options.plainObjects && has.call(Object.prototype, parent)) {
|
|
1982
|
+
if (!options.allowPrototypes) return;
|
|
1983
|
+
}
|
|
1984
|
+
keys[keys.length] = parent;
|
|
1985
|
+
}
|
|
1986
|
+
var i = 0;
|
|
1987
|
+
while ((segment = child.exec(key)) !== null && i < options.depth) {
|
|
1988
|
+
i += 1;
|
|
1989
|
+
var segmentContent = segment[1].slice(1, -1);
|
|
1990
|
+
if (!options.plainObjects && has.call(Object.prototype, segmentContent)) {
|
|
1991
|
+
if (!options.allowPrototypes) return;
|
|
1992
|
+
}
|
|
1993
|
+
keys[keys.length] = segment[1];
|
|
1994
|
+
}
|
|
1995
|
+
if (segment) {
|
|
1996
|
+
if (options.strictDepth === true) throw new RangeError("Input depth exceeded depth option of " + options.depth + " and strictDepth is true");
|
|
1997
|
+
keys[keys.length] = "[" + key.slice(segment.index) + "]";
|
|
1998
|
+
}
|
|
1999
|
+
return keys;
|
|
2000
|
+
};
|
|
2001
|
+
var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
|
|
2002
|
+
if (!givenKey) return;
|
|
2003
|
+
var keys = splitKeyIntoSegments(givenKey, options);
|
|
2004
|
+
if (!keys) return;
|
|
2005
|
+
return parseObject(keys, val, options, valuesParsed);
|
|
2006
|
+
};
|
|
2007
|
+
var normalizeParseOptions = function normalizeParseOptions(opts) {
|
|
2008
|
+
if (!opts) return defaults;
|
|
2009
|
+
if (typeof opts.allowEmptyArrays !== "undefined" && typeof opts.allowEmptyArrays !== "boolean") throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
|
|
2010
|
+
if (typeof opts.decodeDotInKeys !== "undefined" && typeof opts.decodeDotInKeys !== "boolean") throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");
|
|
2011
|
+
if (opts.decoder !== null && typeof opts.decoder !== "undefined" && typeof opts.decoder !== "function") throw new TypeError("Decoder has to be a function.");
|
|
2012
|
+
if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
|
|
2013
|
+
if (typeof opts.throwOnLimitExceeded !== "undefined" && typeof opts.throwOnLimitExceeded !== "boolean") throw new TypeError("`throwOnLimitExceeded` option must be a boolean");
|
|
2014
|
+
var charset = typeof opts.charset === "undefined" ? defaults.charset : opts.charset;
|
|
2015
|
+
var duplicates = typeof opts.duplicates === "undefined" ? defaults.duplicates : opts.duplicates;
|
|
2016
|
+
if (duplicates !== "combine" && duplicates !== "first" && duplicates !== "last") throw new TypeError("The duplicates option must be either combine, first, or last");
|
|
2017
|
+
return {
|
|
2018
|
+
allowDots: typeof opts.allowDots === "undefined" ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots,
|
|
2019
|
+
allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
|
|
2020
|
+
allowPrototypes: typeof opts.allowPrototypes === "boolean" ? opts.allowPrototypes : defaults.allowPrototypes,
|
|
2021
|
+
allowSparse: typeof opts.allowSparse === "boolean" ? opts.allowSparse : defaults.allowSparse,
|
|
2022
|
+
arrayLimit: typeof opts.arrayLimit === "number" ? opts.arrayLimit : defaults.arrayLimit,
|
|
2023
|
+
charset,
|
|
2024
|
+
charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults.charsetSentinel,
|
|
2025
|
+
comma: typeof opts.comma === "boolean" ? opts.comma : defaults.comma,
|
|
2026
|
+
decodeDotInKeys: typeof opts.decodeDotInKeys === "boolean" ? opts.decodeDotInKeys : defaults.decodeDotInKeys,
|
|
2027
|
+
decoder: typeof opts.decoder === "function" ? opts.decoder : defaults.decoder,
|
|
2028
|
+
delimiter: typeof opts.delimiter === "string" || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
|
|
2029
|
+
depth: typeof opts.depth === "number" || opts.depth === false ? +opts.depth : defaults.depth,
|
|
2030
|
+
duplicates,
|
|
2031
|
+
ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
|
|
2032
|
+
interpretNumericEntities: typeof opts.interpretNumericEntities === "boolean" ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
|
|
2033
|
+
parameterLimit: typeof opts.parameterLimit === "number" ? opts.parameterLimit : defaults.parameterLimit,
|
|
2034
|
+
parseArrays: opts.parseArrays !== false,
|
|
2035
|
+
plainObjects: typeof opts.plainObjects === "boolean" ? opts.plainObjects : defaults.plainObjects,
|
|
2036
|
+
strictDepth: typeof opts.strictDepth === "boolean" ? !!opts.strictDepth : defaults.strictDepth,
|
|
2037
|
+
strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults.strictNullHandling,
|
|
2038
|
+
throwOnLimitExceeded: typeof opts.throwOnLimitExceeded === "boolean" ? opts.throwOnLimitExceeded : false
|
|
2039
|
+
};
|
|
2040
|
+
};
|
|
2041
|
+
module.exports = function(str, opts) {
|
|
2042
|
+
var options = normalizeParseOptions(opts);
|
|
2043
|
+
if (str === "" || str === null || typeof str === "undefined") return options.plainObjects ? { __proto__: null } : {};
|
|
2044
|
+
var tempObj = typeof str === "string" ? parseValues(str, options) : str;
|
|
2045
|
+
var obj = options.plainObjects ? { __proto__: null } : {};
|
|
2046
|
+
var keys = Object.keys(tempObj);
|
|
2047
|
+
for (var i = 0; i < keys.length; ++i) {
|
|
2048
|
+
var key = keys[i];
|
|
2049
|
+
var newObj = parseKeys(key, tempObj[key], options, typeof str === "string");
|
|
2050
|
+
obj = utils.merge(obj, newObj, options);
|
|
2051
|
+
}
|
|
2052
|
+
if (options.allowSparse === true) return obj;
|
|
2053
|
+
return utils.compact(obj);
|
|
2054
|
+
};
|
|
2055
|
+
}));
|
|
2056
|
+
|
|
2057
|
+
//#endregion
|
|
2058
|
+
//#region node_modules/qs/lib/index.js
|
|
2059
|
+
var require_lib = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2060
|
+
var stringify = require_stringify();
|
|
2061
|
+
var parse = require_parse();
|
|
2062
|
+
var formats = require_formats();
|
|
2063
|
+
module.exports = {
|
|
2064
|
+
formats,
|
|
2065
|
+
parse,
|
|
2066
|
+
stringify
|
|
2067
|
+
};
|
|
2068
|
+
}));
|
|
2069
|
+
|
|
2070
|
+
//#endregion
|
|
2071
|
+
//#region src/request.ts
|
|
2072
|
+
var import_lib = /* @__PURE__ */ __toESM(require_lib());
|
|
2073
|
+
var Request = class {
|
|
2074
|
+
fetch;
|
|
2075
|
+
constructor(configure) {
|
|
2076
|
+
this.configure = configure;
|
|
2077
|
+
this.fetch = configure.fetch ?? globalThis.fetch;
|
|
2078
|
+
}
|
|
2079
|
+
get(path, params) {
|
|
2080
|
+
return this.request({
|
|
2081
|
+
method: "GET",
|
|
2082
|
+
path,
|
|
2083
|
+
params
|
|
2084
|
+
}).then(this.parseJSON);
|
|
2085
|
+
}
|
|
2086
|
+
post(path, params) {
|
|
2087
|
+
return this.request({
|
|
2088
|
+
method: "POST",
|
|
2089
|
+
path,
|
|
2090
|
+
params
|
|
2091
|
+
}).then(this.parseJSON);
|
|
2092
|
+
}
|
|
2093
|
+
put(path, params) {
|
|
2094
|
+
return this.request({
|
|
2095
|
+
method: "PUT",
|
|
2096
|
+
path,
|
|
2097
|
+
params
|
|
2098
|
+
}).then(this.parseJSON);
|
|
2099
|
+
}
|
|
2100
|
+
patch(path, params) {
|
|
2101
|
+
return this.request({
|
|
2102
|
+
method: "PATCH",
|
|
2103
|
+
path,
|
|
2104
|
+
params
|
|
2105
|
+
}).then(this.parseJSON);
|
|
2106
|
+
}
|
|
2107
|
+
delete(path, params) {
|
|
2108
|
+
return this.request({
|
|
2109
|
+
method: "DELETE",
|
|
2110
|
+
path,
|
|
2111
|
+
params
|
|
2112
|
+
}).then(this.parseJSON);
|
|
2113
|
+
}
|
|
2114
|
+
request(options) {
|
|
2115
|
+
const { method, path, params = {} } = options;
|
|
2116
|
+
const { apiKey, accessToken, timeout, userAgent } = this.configure;
|
|
2117
|
+
const query = apiKey ? { apiKey } : {};
|
|
2118
|
+
const headers = {};
|
|
2119
|
+
const init = {
|
|
2120
|
+
method,
|
|
2121
|
+
headers
|
|
2122
|
+
};
|
|
2123
|
+
if (timeout) init["timeout"] = timeout;
|
|
2124
|
+
if (!apiKey && accessToken) headers["Authorization"] = "Bearer " + accessToken;
|
|
2125
|
+
if (userAgent) headers["User-Agent"] = userAgent;
|
|
2126
|
+
if (typeof window !== "undefined") init.mode = "cors";
|
|
2127
|
+
if (method !== "GET") if (params instanceof FormData) init.body = params;
|
|
2128
|
+
else {
|
|
2129
|
+
headers["Content-type"] = "application/x-www-form-urlencoded";
|
|
2130
|
+
init.body = this.toQueryString(params);
|
|
2131
|
+
}
|
|
2132
|
+
else Object.keys(params).forEach((key) => query[key] = params[key]);
|
|
2133
|
+
const queryStr = this.toQueryString(query);
|
|
2134
|
+
const url = `${this.restBaseURL}/${path}` + (queryStr.length > 0 ? `?${queryStr}` : "");
|
|
2135
|
+
return this.fetch(url, init).then(this.checkStatus);
|
|
2136
|
+
}
|
|
2137
|
+
checkStatus(response) {
|
|
2138
|
+
return new Promise((resolve, reject) => {
|
|
2139
|
+
if (200 <= response.status && response.status < 300) resolve(response);
|
|
2140
|
+
else response.json().then((data) => {
|
|
2141
|
+
if (response.status === 401) reject(new BacklogAuthError(response, data));
|
|
2142
|
+
else reject(new BacklogApiError(response, data));
|
|
2143
|
+
}).catch(() => reject(new UnexpectedError(response)));
|
|
2144
|
+
});
|
|
2145
|
+
}
|
|
2146
|
+
parseJSON(response) {
|
|
2147
|
+
if (response.status === 204 || response.headers.get("Content-Length") === "0") return Promise.resolve(void 0);
|
|
2148
|
+
return response.json();
|
|
2149
|
+
}
|
|
2150
|
+
toQueryString(params) {
|
|
2151
|
+
const formatted = {};
|
|
2152
|
+
Object.keys(params).forEach((key) => {
|
|
2153
|
+
const value = params[key];
|
|
2154
|
+
if (key.startsWith("customField_") && Array.isArray(value)) value.forEach((v, i) => {
|
|
2155
|
+
formatted[`${key}[${i}]`] = v;
|
|
2156
|
+
});
|
|
2157
|
+
else formatted[key] = value;
|
|
2158
|
+
});
|
|
2159
|
+
return import_lib.stringify(formatted, { arrayFormat: "brackets" });
|
|
2160
|
+
}
|
|
2161
|
+
get webAppBaseURL() {
|
|
2162
|
+
return `https://${this.configure.host}`;
|
|
2163
|
+
}
|
|
2164
|
+
get restBaseURL() {
|
|
2165
|
+
return `${this.webAppBaseURL}/api/v2`;
|
|
2166
|
+
}
|
|
2167
|
+
};
|
|
2168
|
+
|
|
2169
|
+
//#endregion
|
|
2170
|
+
//#region src/backlog.ts
|
|
2171
|
+
var Backlog = class extends Request {
|
|
2172
|
+
constructor(configure) {
|
|
2173
|
+
super(configure);
|
|
2174
|
+
}
|
|
2175
|
+
/**
|
|
2176
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-space/
|
|
2177
|
+
*/
|
|
2178
|
+
getSpace() {
|
|
2179
|
+
return this.get("space");
|
|
2180
|
+
}
|
|
2181
|
+
/**
|
|
2182
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-recent-updates/
|
|
2183
|
+
*/
|
|
2184
|
+
getSpaceActivities(params) {
|
|
2185
|
+
return this.get("space/activities", params);
|
|
2186
|
+
}
|
|
2187
|
+
/**
|
|
2188
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-space-logo/
|
|
2189
|
+
*/
|
|
2190
|
+
getSpaceIcon() {
|
|
2191
|
+
return this.download("space/image");
|
|
2192
|
+
}
|
|
2193
|
+
/**
|
|
2194
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-space-notification/
|
|
2195
|
+
*/
|
|
2196
|
+
getSpaceNotification() {
|
|
2197
|
+
return this.get("space/notification");
|
|
2198
|
+
}
|
|
2199
|
+
/**
|
|
2200
|
+
* https://developer.nulab.com/docs/backlog/api/2/update-space-notification/
|
|
2201
|
+
*/
|
|
2202
|
+
putSpaceNotification(params) {
|
|
2203
|
+
return this.put("space/notification", params);
|
|
2204
|
+
}
|
|
2205
|
+
/**
|
|
2206
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-space-disk-usage/
|
|
2207
|
+
*/
|
|
2208
|
+
getSpaceDiskUsage() {
|
|
2209
|
+
return this.get("space/diskUsage");
|
|
2210
|
+
}
|
|
2211
|
+
/**
|
|
2212
|
+
* https://developer.nulab.com/docs/backlog/api/2/post-attachment-file/
|
|
2213
|
+
*/
|
|
2214
|
+
postSpaceAttachment(form) {
|
|
2215
|
+
return this.upload("space/attachment", form);
|
|
2216
|
+
}
|
|
2217
|
+
/**
|
|
2218
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-user-list/
|
|
2219
|
+
*/
|
|
2220
|
+
getUsers() {
|
|
2221
|
+
return this.get(`users`);
|
|
2222
|
+
}
|
|
2223
|
+
/**
|
|
2224
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-user/
|
|
2225
|
+
*/
|
|
2226
|
+
getUser(userId) {
|
|
2227
|
+
return this.get(`users/${userId}`);
|
|
2228
|
+
}
|
|
2229
|
+
/**
|
|
2230
|
+
* https://developer.nulab.com/docs/backlog/api/2/add-user/
|
|
2231
|
+
*/
|
|
2232
|
+
postUser(params) {
|
|
2233
|
+
return this.post(`users`, params);
|
|
2234
|
+
}
|
|
2235
|
+
/**
|
|
2236
|
+
* https://developer.nulab.com/docs/backlog/api/2/update-user/
|
|
2237
|
+
*/
|
|
2238
|
+
patchUser(userId, params) {
|
|
2239
|
+
return this.patch(`users/${userId}`, params);
|
|
2240
|
+
}
|
|
2241
|
+
/**
|
|
2242
|
+
* https://developer.nulab.com/docs/backlog/api/2/delete-user/
|
|
2243
|
+
*/
|
|
2244
|
+
deleteUser(userId) {
|
|
2245
|
+
return this.delete(`users/${userId}`);
|
|
2246
|
+
}
|
|
2247
|
+
/**
|
|
2248
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-own-user/
|
|
2249
|
+
*/
|
|
2250
|
+
getMyself() {
|
|
2251
|
+
return this.get("users/myself");
|
|
2252
|
+
}
|
|
2253
|
+
/**
|
|
2254
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-user-icon/
|
|
2255
|
+
*/
|
|
2256
|
+
getUserIcon(userId) {
|
|
2257
|
+
return this.download(`users/${userId}/icon`);
|
|
2258
|
+
}
|
|
2259
|
+
/**
|
|
2260
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-user-recent-updates/
|
|
2261
|
+
*/
|
|
2262
|
+
getUserActivities(userId, params) {
|
|
2263
|
+
return this.get(`users/${userId}/activities`, params);
|
|
2264
|
+
}
|
|
2265
|
+
/**
|
|
2266
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-received-star-list/
|
|
2267
|
+
*/
|
|
2268
|
+
getUserStars(userId, params) {
|
|
2269
|
+
return this.get(`users/${userId}/stars`, params);
|
|
2270
|
+
}
|
|
2271
|
+
/**
|
|
2272
|
+
* https://developer.nulab.com/docs/backlog/api/2/count-user-received-stars/
|
|
2273
|
+
*/
|
|
2274
|
+
getUserStarsCount(userId, params) {
|
|
2275
|
+
return this.get(`users/${userId}/stars/count`, params);
|
|
2276
|
+
}
|
|
2277
|
+
/**
|
|
2278
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-list-of-recently-viewed-issues/
|
|
2279
|
+
*/
|
|
2280
|
+
getRecentlyViewedIssues(params) {
|
|
2281
|
+
return this.get("users/myself/recentlyViewedIssues", params);
|
|
2282
|
+
}
|
|
2283
|
+
/**
|
|
2284
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-list-of-recently-viewed-projects/
|
|
2285
|
+
*/
|
|
2286
|
+
getRecentlyViewedProjects(params) {
|
|
2287
|
+
return this.get("users/myself/recentlyViewedProjects", params);
|
|
2288
|
+
}
|
|
2289
|
+
/**
|
|
2290
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-list-of-recently-viewed-wikis/
|
|
2291
|
+
*/
|
|
2292
|
+
getRecentlyViewedWikis(params) {
|
|
2293
|
+
return this.get("users/myself/recentlyViewedWikis", params);
|
|
2294
|
+
}
|
|
2295
|
+
/**
|
|
2296
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-status-list-of-project/
|
|
2297
|
+
*/
|
|
2298
|
+
getProjectStatuses(projectIdOrKey) {
|
|
2299
|
+
return this.get(`projects/${projectIdOrKey}/statuses`);
|
|
2300
|
+
}
|
|
2301
|
+
/**
|
|
2302
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-resolution-list/
|
|
2303
|
+
*/
|
|
2304
|
+
getResolutions() {
|
|
2305
|
+
return this.get("resolutions");
|
|
2306
|
+
}
|
|
2307
|
+
/**
|
|
2308
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-priority-list/
|
|
2309
|
+
*/
|
|
2310
|
+
getPriorities() {
|
|
2311
|
+
return this.get("priorities");
|
|
2312
|
+
}
|
|
2313
|
+
/**
|
|
2314
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-project-list/
|
|
2315
|
+
*/
|
|
2316
|
+
getProjects(params) {
|
|
2317
|
+
return this.get("projects", params);
|
|
2318
|
+
}
|
|
2319
|
+
/**
|
|
2320
|
+
* https://developer.nulab.com/docs/backlog/api/2/add-project/
|
|
2321
|
+
*/
|
|
2322
|
+
postProject(params) {
|
|
2323
|
+
return this.post("projects", params);
|
|
2324
|
+
}
|
|
2325
|
+
/**
|
|
2326
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-project/
|
|
2327
|
+
*/
|
|
2328
|
+
getProject(projectIdOrKey) {
|
|
2329
|
+
return this.get(`projects/${projectIdOrKey}`);
|
|
2330
|
+
}
|
|
2331
|
+
/**
|
|
2332
|
+
* https://developer.nulab.com/docs/backlog/api/2/update-project/
|
|
2333
|
+
*/
|
|
2334
|
+
patchProject(projectIdOrKey, params) {
|
|
2335
|
+
return this.patch(`projects/${projectIdOrKey}`, params);
|
|
2336
|
+
}
|
|
2337
|
+
/**
|
|
2338
|
+
* https://developer.nulab.com/docs/backlog/api/2/delete-project/
|
|
2339
|
+
*/
|
|
2340
|
+
deleteProject(projectIdOrKey) {
|
|
2341
|
+
return this.delete(`projects/${projectIdOrKey}`);
|
|
2342
|
+
}
|
|
2343
|
+
/**
|
|
2344
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-project-icon/
|
|
2345
|
+
*/
|
|
2346
|
+
getProjectIcon(projectIdOrKey) {
|
|
2347
|
+
return this.download(`projects/${projectIdOrKey}/image`);
|
|
2348
|
+
}
|
|
2349
|
+
/**
|
|
2350
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-project-recent-updates/
|
|
2351
|
+
*/
|
|
2352
|
+
getProjectActivities(projectIdOrKey, params) {
|
|
2353
|
+
return this.get(`projects/${projectIdOrKey}/activities`, params);
|
|
2354
|
+
}
|
|
2355
|
+
/**
|
|
2356
|
+
* https://developer.nulab.com/docs/backlog/api/2/add-project-user/
|
|
2357
|
+
*/
|
|
2358
|
+
postProjectUser(projectIdOrKey, userId) {
|
|
2359
|
+
return this.post(`projects/${projectIdOrKey}/users`, { userId });
|
|
2360
|
+
}
|
|
2361
|
+
/**
|
|
2362
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-project-user-list/
|
|
2363
|
+
*/
|
|
2364
|
+
getProjectUsers(projectIdOrKey) {
|
|
2365
|
+
return this.get(`projects/${projectIdOrKey}/users`);
|
|
2366
|
+
}
|
|
2367
|
+
/**
|
|
2368
|
+
* https://developer.nulab.com/docs/backlog/api/2/delete-project-user/
|
|
2369
|
+
*/
|
|
2370
|
+
deleteProjectUsers(projectIdOrKey, params) {
|
|
2371
|
+
return this.delete(`projects/${projectIdOrKey}/users`, params);
|
|
2372
|
+
}
|
|
2373
|
+
/**
|
|
2374
|
+
* https://developer.nulab.com/docs/backlog/api/2/add-project-administrator/
|
|
2375
|
+
*/
|
|
2376
|
+
postProjectAdministrators(projectIdOrKey, params) {
|
|
2377
|
+
return this.post(`projects/${projectIdOrKey}/administrators`, params);
|
|
2378
|
+
}
|
|
2379
|
+
/**
|
|
2380
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-list-of-project-administrators/
|
|
2381
|
+
*/
|
|
2382
|
+
getProjectAdministrators(projectIdOrKey) {
|
|
2383
|
+
return this.get(`projects/${projectIdOrKey}/administrators`);
|
|
2384
|
+
}
|
|
2385
|
+
/**
|
|
2386
|
+
* https://developer.nulab.com/docs/backlog/api/2/delete-project-administrator/
|
|
2387
|
+
*/
|
|
2388
|
+
deleteProjectAdministrators(projectIdOrKey, params) {
|
|
2389
|
+
return this.delete(`projects/${projectIdOrKey}/administrators`, params);
|
|
2390
|
+
}
|
|
2391
|
+
/**
|
|
2392
|
+
* https://developer.nulab.com/docs/backlog/api/2/add-status/
|
|
2393
|
+
*/
|
|
2394
|
+
postProjectStatus(projectIdOrKey, params) {
|
|
2395
|
+
return this.post(`projects/${projectIdOrKey}/statuses`, params);
|
|
2396
|
+
}
|
|
2397
|
+
/**
|
|
2398
|
+
* https://developer.nulab.com/docs/backlog/api/2/update-status/
|
|
2399
|
+
*/
|
|
2400
|
+
patchProjectStatus(projectIdOrKey, id, params) {
|
|
2401
|
+
return this.patch(`projects/${projectIdOrKey}/statuses/${id}`, params);
|
|
2402
|
+
}
|
|
2403
|
+
/**
|
|
2404
|
+
* https://developer.nulab.com/docs/backlog/api/2/delete-status/
|
|
2405
|
+
*/
|
|
2406
|
+
deleteProjectStatus(projectIdOrKey, id, substituteStatusId) {
|
|
2407
|
+
return this.delete(`projects/${projectIdOrKey}/statuses/${id}`, { substituteStatusId });
|
|
2408
|
+
}
|
|
2409
|
+
/**
|
|
2410
|
+
* https://developer.nulab.com/docs/backlog/api/2/update-order-of-status/
|
|
2411
|
+
*/
|
|
2412
|
+
patchProjectStatusOrder(projectIdOrKey, statusId) {
|
|
2413
|
+
return this.patch(`projects/${projectIdOrKey}/statuses/updateDisplayOrder`, { statusId });
|
|
2414
|
+
}
|
|
2415
|
+
/**
|
|
2416
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-issue-type-list/
|
|
2417
|
+
*/
|
|
2418
|
+
getIssueTypes(projectIdOrKey) {
|
|
2419
|
+
return this.get(`projects/${projectIdOrKey}/issueTypes`);
|
|
2420
|
+
}
|
|
2421
|
+
/**
|
|
2422
|
+
* https://developer.nulab.com/docs/backlog/api/2/add-issue-type/
|
|
2423
|
+
*/
|
|
2424
|
+
postIssueType(projectIdOrKey, params) {
|
|
2425
|
+
return this.post(`projects/${projectIdOrKey}/issueTypes`, params);
|
|
2426
|
+
}
|
|
2427
|
+
/**
|
|
2428
|
+
* https://developer.nulab.com/docs/backlog/api/2/update-issue-type/
|
|
2429
|
+
*/
|
|
2430
|
+
patchIssueType(projectIdOrKey, id, params) {
|
|
2431
|
+
return this.patch(`projects/${projectIdOrKey}/issueTypes/${id}`, params);
|
|
2432
|
+
}
|
|
2433
|
+
/**
|
|
2434
|
+
* https://developer.nulab.com/docs/backlog/api/2/delete-issue-type/
|
|
2435
|
+
*/
|
|
2436
|
+
deleteIssueType(projectIdOrKey, id, params) {
|
|
2437
|
+
return this.delete(`projects/${projectIdOrKey}/issueTypes/${id}`, params);
|
|
2438
|
+
}
|
|
2439
|
+
/**
|
|
2440
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-category-list/
|
|
2441
|
+
*/
|
|
2442
|
+
getCategories(projectIdOrKey) {
|
|
2443
|
+
return this.get(`projects/${projectIdOrKey}/categories`);
|
|
2444
|
+
}
|
|
2445
|
+
/**
|
|
2446
|
+
* https://developer.nulab.com/docs/backlog/api/2/add-category/
|
|
2447
|
+
*/
|
|
2448
|
+
postCategories(projectIdOrKey, params) {
|
|
2449
|
+
return this.post(`projects/${projectIdOrKey}/categories`, params);
|
|
2450
|
+
}
|
|
2451
|
+
/**
|
|
2452
|
+
* https://developer.nulab.com/docs/backlog/api/2/update-category/
|
|
2453
|
+
*/
|
|
2454
|
+
patchCategories(projectIdOrKey, id, params) {
|
|
2455
|
+
return this.patch(`projects/${projectIdOrKey}/categories/${id}`, params);
|
|
2456
|
+
}
|
|
2457
|
+
/**
|
|
2458
|
+
* https://developer.nulab.com/docs/backlog/api/2/delete-category/
|
|
2459
|
+
*/
|
|
2460
|
+
deleteCategories(projectIdOrKey, id) {
|
|
2461
|
+
return this.delete(`projects/${projectIdOrKey}/categories/${id}`);
|
|
2462
|
+
}
|
|
2463
|
+
/**
|
|
2464
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-version-milestone-list/
|
|
2465
|
+
*/
|
|
2466
|
+
getVersions(projectIdOrKey) {
|
|
2467
|
+
return this.get(`projects/${projectIdOrKey}/versions`);
|
|
2468
|
+
}
|
|
2469
|
+
/**
|
|
2470
|
+
* https://developer.nulab.com/docs/backlog/api/2/add-version-milestone/
|
|
2471
|
+
*/
|
|
2472
|
+
postVersions(projectIdOrKey, params) {
|
|
2473
|
+
return this.post(`projects/${projectIdOrKey}/versions`, params);
|
|
2474
|
+
}
|
|
2475
|
+
/**
|
|
2476
|
+
* https://developer.nulab.com/docs/backlog/api/2/update-version-milestone/
|
|
2477
|
+
*/
|
|
2478
|
+
patchVersions(projectIdOrKey, id, params) {
|
|
2479
|
+
return this.patch(`projects/${projectIdOrKey}/versions/${id}`, params);
|
|
2480
|
+
}
|
|
2481
|
+
/**
|
|
2482
|
+
* https://developer.nulab.com/docs/backlog/api/2/delete-version/
|
|
2483
|
+
*/
|
|
2484
|
+
deleteVersions(projectIdOrKey, id) {
|
|
2485
|
+
return this.delete(`projects/${projectIdOrKey}/versions/${id}`);
|
|
2486
|
+
}
|
|
2487
|
+
/**
|
|
2488
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-custom-field-list/
|
|
2489
|
+
*/
|
|
2490
|
+
getCustomFields(projectIdOrKey) {
|
|
2491
|
+
return this.get(`projects/${projectIdOrKey}/customFields`);
|
|
2492
|
+
}
|
|
2493
|
+
/**
|
|
2494
|
+
* https://developer.nulab.com/docs/backlog/api/2/add-custom-field/
|
|
2495
|
+
*/
|
|
2496
|
+
postCustomField(projectIdOrKey, params) {
|
|
2497
|
+
return this.post(`projects/${projectIdOrKey}/customFields`, params);
|
|
2498
|
+
}
|
|
2499
|
+
/**
|
|
2500
|
+
* https://developer.nulab.com/docs/backlog/api/2/update-custom-field/
|
|
2501
|
+
*/
|
|
2502
|
+
patchCustomField(projectIdOrKey, id, params) {
|
|
2503
|
+
return this.patch(`projects/${projectIdOrKey}/customFields/${id}`, params);
|
|
2504
|
+
}
|
|
2505
|
+
/**
|
|
2506
|
+
* https://developer.nulab.com/docs/backlog/api/2/delete-custom-field/
|
|
2507
|
+
*/
|
|
2508
|
+
deleteCustomField(projectIdOrKey, id) {
|
|
2509
|
+
return this.delete(`projects/${projectIdOrKey}/customFields/${id}`);
|
|
2510
|
+
}
|
|
2511
|
+
/**
|
|
2512
|
+
* https://developer.nulab.com/docs/backlog/api/2/add-list-item-for-list-type-custom-field/
|
|
2513
|
+
*/
|
|
2514
|
+
postCustomFieldItem(projectIdOrKey, id, params) {
|
|
2515
|
+
return this.post(`projects/${projectIdOrKey}/customFields/${id}/items`, params);
|
|
2516
|
+
}
|
|
2517
|
+
/**
|
|
2518
|
+
* https://developer.nulab.com/docs/backlog/api/2/update-list-item-for-list-type-custom-field/
|
|
2519
|
+
*/
|
|
2520
|
+
patchCustomFieldItem(projectIdOrKey, id, itemId, params) {
|
|
2521
|
+
return this.patch(`projects/${projectIdOrKey}/customFields/${id}/items/${itemId}`, params);
|
|
2522
|
+
}
|
|
2523
|
+
/**
|
|
2524
|
+
* https://developer.nulab.com/docs/backlog/api/2/delete-list-item-for-list-type-custom-field/
|
|
2525
|
+
*/
|
|
2526
|
+
deleteCustomFieldItem(projectIdOrKey, id, itemId) {
|
|
2527
|
+
return this.delete(`projects/${projectIdOrKey}/customFields/${id}/items/${itemId}`);
|
|
2528
|
+
}
|
|
2529
|
+
/**
|
|
2530
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-list-of-shared-files/
|
|
2531
|
+
*/
|
|
2532
|
+
getSharedFiles(projectIdOrKey, path, params) {
|
|
2533
|
+
return this.get(`projects/${projectIdOrKey}/files/metadata/${path}`, params);
|
|
2534
|
+
}
|
|
2535
|
+
/**
|
|
2536
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-file/
|
|
2537
|
+
*/
|
|
2538
|
+
getSharedFile(projectIdOrKey, sharedFileId) {
|
|
2539
|
+
return this.download(`projects/${projectIdOrKey}/files/${sharedFileId}`);
|
|
2540
|
+
}
|
|
2541
|
+
/**
|
|
2542
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-project-disk-usage/
|
|
2543
|
+
*/
|
|
2544
|
+
getProjectsDiskUsage(projectIdOrKey) {
|
|
2545
|
+
return this.get(`projects/${projectIdOrKey}/diskUsage`);
|
|
2546
|
+
}
|
|
2547
|
+
/**
|
|
2548
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-list-of-webhooks/
|
|
2549
|
+
*/
|
|
2550
|
+
getWebhooks(projectIdOrKey) {
|
|
2551
|
+
return this.get(`projects/${projectIdOrKey}/webhooks`);
|
|
2552
|
+
}
|
|
2553
|
+
/**
|
|
2554
|
+
* https://developer.nulab.com/docs/backlog/api/2/add-webhook/
|
|
2555
|
+
*/
|
|
2556
|
+
postWebhook(projectIdOrKey, params) {
|
|
2557
|
+
return this.post(`projects/${projectIdOrKey}/webhooks`, params);
|
|
2558
|
+
}
|
|
2559
|
+
/**
|
|
2560
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-webhook/
|
|
2561
|
+
*/
|
|
2562
|
+
getWebhook(projectIdOrKey, webhookId) {
|
|
2563
|
+
return this.get(`projects/${projectIdOrKey}/webhooks/${webhookId}`);
|
|
2564
|
+
}
|
|
2565
|
+
/**
|
|
2566
|
+
* https://developer.nulab.com/docs/backlog/api/2/update-webhook/
|
|
2567
|
+
*/
|
|
2568
|
+
patchWebhook(projectIdOrKey, webhookId, params) {
|
|
2569
|
+
return this.patch(`projects/${projectIdOrKey}/webhooks/${webhookId}`, params);
|
|
2570
|
+
}
|
|
2571
|
+
/**
|
|
2572
|
+
* https://developer.nulab.com/docs/backlog/api/2/delete-webhook/
|
|
2573
|
+
*/
|
|
2574
|
+
deleteWebhook(projectIdOrKey, webhookId) {
|
|
2575
|
+
return this.delete(`projects/${projectIdOrKey}/webhooks/${webhookId}`);
|
|
2576
|
+
}
|
|
2577
|
+
/**
|
|
2578
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-issue-list/
|
|
2579
|
+
*/
|
|
2580
|
+
getIssues(params) {
|
|
2581
|
+
return this.get("issues", params);
|
|
2582
|
+
}
|
|
2583
|
+
/**
|
|
2584
|
+
* https://developer.nulab.com/docs/backlog/api/2/count-issue/
|
|
2585
|
+
*/
|
|
2586
|
+
getIssuesCount(params) {
|
|
2587
|
+
return this.get("issues/count", params);
|
|
2588
|
+
}
|
|
2589
|
+
/**
|
|
2590
|
+
* https://developer.nulab.com/docs/backlog/api/2/add-issue/
|
|
2591
|
+
*/
|
|
2592
|
+
postIssue(params) {
|
|
2593
|
+
return this.post("issues", params);
|
|
2594
|
+
}
|
|
2595
|
+
/**
|
|
2596
|
+
* https://developer.nulab.com/docs/backlog/api/2/update-issue/
|
|
2597
|
+
*/
|
|
2598
|
+
patchIssue(issueIdOrKey, params) {
|
|
2599
|
+
return this.patch(`issues/${issueIdOrKey}`, params);
|
|
2600
|
+
}
|
|
2601
|
+
/**
|
|
2602
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-issue/
|
|
2603
|
+
*/
|
|
2604
|
+
getIssue(issueIdOrKey, params) {
|
|
2605
|
+
return this.get(`issues/${issueIdOrKey}`, params);
|
|
2606
|
+
}
|
|
2607
|
+
/**
|
|
2608
|
+
* https://developer.nulab.com/docs/backlog/api/2/delete-issue/
|
|
2609
|
+
*/
|
|
2610
|
+
deleteIssue(issueIdOrKey) {
|
|
2611
|
+
return this.delete(`issues/${issueIdOrKey}`);
|
|
2612
|
+
}
|
|
2613
|
+
/**
|
|
2614
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-comment-list/
|
|
2615
|
+
*/
|
|
2616
|
+
getIssueComments(issueIdOrKey, params) {
|
|
2617
|
+
return this.get(`issues/${issueIdOrKey}/comments`, params);
|
|
2618
|
+
}
|
|
2619
|
+
/**
|
|
2620
|
+
* https://developer.nulab.com/docs/backlog/api/2/add-comment/
|
|
2621
|
+
*/
|
|
2622
|
+
postIssueComments(issueIdOrKey, params) {
|
|
2623
|
+
return this.post(`issues/${issueIdOrKey}/comments`, params);
|
|
2624
|
+
}
|
|
2625
|
+
/**
|
|
2626
|
+
* https://developer.nulab.com/docs/backlog/api/2/count-comment/
|
|
2627
|
+
*/
|
|
2628
|
+
getIssueCommentsCount(issueIdOrKey) {
|
|
2629
|
+
return this.get(`issues/${issueIdOrKey}/comments/count`);
|
|
2630
|
+
}
|
|
2631
|
+
/**
|
|
2632
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-comment/
|
|
2633
|
+
*/
|
|
2634
|
+
getIssueComment(issueIdOrKey, commentId) {
|
|
2635
|
+
return this.get(`issues/${issueIdOrKey}/comments/${commentId}`);
|
|
2636
|
+
}
|
|
2637
|
+
/**
|
|
2638
|
+
* https://developer.nulab.com/docs/backlog/api/2/delete-comment/
|
|
2639
|
+
*/
|
|
2640
|
+
deleteIssueComment(issueIdOrKey, commentId) {
|
|
2641
|
+
return this.delete(`issues/${issueIdOrKey}/comments/${commentId}`);
|
|
2642
|
+
}
|
|
2643
|
+
/**
|
|
2644
|
+
* https://developer.nulab.com/docs/backlog/api/2/update-comment/
|
|
2645
|
+
*/
|
|
2646
|
+
patchIssueComment(issueIdOrKey, commentId, params) {
|
|
2647
|
+
return this.patch(`issues/${issueIdOrKey}/comments/${commentId}`, params);
|
|
2648
|
+
}
|
|
2649
|
+
/**
|
|
2650
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-list-of-comment-notifications/
|
|
2651
|
+
*/
|
|
2652
|
+
getIssueCommentNotifications(issueIdOrKey, commentId) {
|
|
2653
|
+
return this.get(`issues/${issueIdOrKey}/comments/${commentId}/notifications`);
|
|
2654
|
+
}
|
|
2655
|
+
/**
|
|
2656
|
+
* https://developer.nulab.com/docs/backlog/api/2/add-comment-notification/
|
|
2657
|
+
*/
|
|
2658
|
+
postIssueCommentNotifications(issueIdOrKey, commentId, prams) {
|
|
2659
|
+
return this.post(`issues/${issueIdOrKey}/comments/${commentId}/notifications`, prams);
|
|
2660
|
+
}
|
|
2661
|
+
/**
|
|
2662
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-list-of-issue-attachments/
|
|
2663
|
+
*/
|
|
2664
|
+
getIssueAttachments(issueIdOrKey) {
|
|
2665
|
+
return this.get(`issues/${issueIdOrKey}/attachments`);
|
|
2666
|
+
}
|
|
2667
|
+
/**
|
|
2668
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-issue-attachment/
|
|
2669
|
+
*/
|
|
2670
|
+
getIssueAttachment(issueIdOrKey, attachmentId) {
|
|
2671
|
+
return this.download(`issues/${issueIdOrKey}/attachments/${attachmentId}`);
|
|
2672
|
+
}
|
|
2673
|
+
/**
|
|
2674
|
+
* https://developer.nulab.com/docs/backlog/api/2/delete-issue-attachment/
|
|
2675
|
+
*/
|
|
2676
|
+
deleteIssueAttachment(issueIdOrKey, attachmentId) {
|
|
2677
|
+
return this.delete(`issues/${issueIdOrKey}/attachments/${attachmentId}`);
|
|
2678
|
+
}
|
|
2679
|
+
/**
|
|
2680
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-issue-participant-list/
|
|
2681
|
+
*/
|
|
2682
|
+
getIssueParticipants(issueIdOrKey) {
|
|
2683
|
+
return this.get(`issues/${issueIdOrKey}/participants`);
|
|
2684
|
+
}
|
|
2685
|
+
/**
|
|
2686
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-list-of-linked-shared-files/
|
|
2687
|
+
*/
|
|
2688
|
+
getIssueSharedFiles(issueIdOrKey) {
|
|
2689
|
+
return this.get(`issues/${issueIdOrKey}/sharedFiles`);
|
|
2690
|
+
}
|
|
2691
|
+
/**
|
|
2692
|
+
* https://developer.nulab.com/docs/backlog/api/2/link-shared-files-to-issue/
|
|
2693
|
+
*/
|
|
2694
|
+
linkIssueSharedFiles(issueIdOrKey, params) {
|
|
2695
|
+
return this.post(`issues/${issueIdOrKey}/sharedFiles`, params);
|
|
2696
|
+
}
|
|
2697
|
+
/**
|
|
2698
|
+
* https://developer.nulab.com/docs/backlog/api/2/remove-link-to-shared-file-from-issue/
|
|
2699
|
+
*/
|
|
2700
|
+
unlinkIssueSharedFile(issueIdOrKey, id) {
|
|
2701
|
+
return this.delete(`issues/${issueIdOrKey}/sharedFiles/${id}`);
|
|
2702
|
+
}
|
|
2703
|
+
/**
|
|
2704
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-wiki-page-list/
|
|
2705
|
+
*/
|
|
2706
|
+
getWikis(params) {
|
|
2707
|
+
return this.get(`wikis`, params);
|
|
2708
|
+
}
|
|
2709
|
+
/**
|
|
2710
|
+
* https://developer.nulab.com/docs/backlog/api/2/count-wiki-page/
|
|
2711
|
+
*/
|
|
2712
|
+
getWikisCount(projectIdOrKey) {
|
|
2713
|
+
return this.get(`wikis/count`, { projectIdOrKey });
|
|
2714
|
+
}
|
|
2715
|
+
/**
|
|
2716
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-wiki-page-tag-list/
|
|
2717
|
+
*/
|
|
2718
|
+
getWikisTags(projectIdOrKey) {
|
|
2719
|
+
return this.get(`wikis/tags`, { projectIdOrKey });
|
|
2720
|
+
}
|
|
2721
|
+
/**
|
|
2722
|
+
* https://developer.nulab.com/docs/backlog/api/2/add-wiki-page/
|
|
2723
|
+
*/
|
|
2724
|
+
postWiki(params) {
|
|
2725
|
+
return this.post(`wikis`, params);
|
|
2726
|
+
}
|
|
2727
|
+
/**
|
|
2728
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-wiki-page/
|
|
2729
|
+
*/
|
|
2730
|
+
getWiki(wikiId) {
|
|
2731
|
+
return this.get(`wikis/${wikiId}`);
|
|
2732
|
+
}
|
|
2733
|
+
/**
|
|
2734
|
+
* https://developer.nulab.com/docs/backlog/api/2/update-wiki-page/
|
|
2735
|
+
*/
|
|
2736
|
+
patchWiki(wikiId, params) {
|
|
2737
|
+
return this.patch(`wikis/${wikiId}`, params);
|
|
2738
|
+
}
|
|
2739
|
+
/**
|
|
2740
|
+
* https://developer.nulab.com/docs/backlog/api/2/delete-wiki-page/
|
|
2741
|
+
*/
|
|
2742
|
+
deleteWiki(wikiId, mailNotify) {
|
|
2743
|
+
return this.delete(`wikis/${wikiId}`, { mailNotify });
|
|
2744
|
+
}
|
|
2745
|
+
/**
|
|
2746
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-list-of-wiki-attachments/
|
|
2747
|
+
*/
|
|
2748
|
+
getWikisAttachments(wikiId) {
|
|
2749
|
+
return this.get(`wikis/${wikiId}/attachments`);
|
|
2750
|
+
}
|
|
2751
|
+
/**
|
|
2752
|
+
* https://developer.nulab.com/docs/backlog/api/2/attach-file-to-wiki/
|
|
2753
|
+
*/
|
|
2754
|
+
postWikisAttachments(wikiId, attachmentId) {
|
|
2755
|
+
return this.post(`wikis/${wikiId}/attachments`, { attachmentId });
|
|
2756
|
+
}
|
|
2757
|
+
/**
|
|
2758
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-wiki-page-attachment/
|
|
2759
|
+
*/
|
|
2760
|
+
getWikiAttachment(wikiId, attachmentId) {
|
|
2761
|
+
return this.download(`wikis/${wikiId}/attachments/${attachmentId}`);
|
|
2762
|
+
}
|
|
2763
|
+
/**
|
|
2764
|
+
* https://developer.nulab.com/docs/backlog/api/2/remove-wiki-attachment/
|
|
2765
|
+
*/
|
|
2766
|
+
deleteWikisAttachments(wikiId, attachmentId) {
|
|
2767
|
+
return this.delete(`wikis/${wikiId}/attachments/${attachmentId}`);
|
|
2768
|
+
}
|
|
2769
|
+
/**
|
|
2770
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-list-of-shared-files-on-wiki/
|
|
2771
|
+
*/
|
|
2772
|
+
getWikisSharedFiles(wikiId) {
|
|
2773
|
+
return this.get(`wikis/${wikiId}/sharedFiles`);
|
|
2774
|
+
}
|
|
2775
|
+
/**
|
|
2776
|
+
* https://developer.nulab.com/docs/backlog/api/2/link-shared-files-to-wiki/
|
|
2777
|
+
*/
|
|
2778
|
+
linkWikisSharedFiles(wikiId, fileId) {
|
|
2779
|
+
return this.post(`wikis/${wikiId}/sharedFiles`, { fileId });
|
|
2780
|
+
}
|
|
2781
|
+
/**
|
|
2782
|
+
* https://developer.nulab.com/docs/backlog/api/2/remove-link-to-shared-file-from-wiki/
|
|
2783
|
+
*/
|
|
2784
|
+
unlinkWikisSharedFiles(wikiId, id) {
|
|
2785
|
+
return this.delete(`wikis/${wikiId}/sharedFiles/${id}`);
|
|
2786
|
+
}
|
|
2787
|
+
/**
|
|
2788
|
+
* https://developer.nulab.com/docs/backlog/api/get-document-list/
|
|
2789
|
+
*/
|
|
2790
|
+
getDocuments(params) {
|
|
2791
|
+
return this.get("documents", params);
|
|
2792
|
+
}
|
|
2793
|
+
/**
|
|
2794
|
+
* https://developer.nulab.com/docs/backlog/api/get-document-tree/
|
|
2795
|
+
*/
|
|
2796
|
+
getDocumentTree(projectIdOrKey) {
|
|
2797
|
+
return this.get(`documents/tree`, { projectIdOrKey });
|
|
2798
|
+
}
|
|
2799
|
+
/**
|
|
2800
|
+
* https://developer.nulab.com/docs/backlog/api/get-document/
|
|
2801
|
+
*/
|
|
2802
|
+
getDocument(documentId) {
|
|
2803
|
+
return this.get(`documents/${documentId}`);
|
|
2804
|
+
}
|
|
2805
|
+
/**
|
|
2806
|
+
* https://developer.nulab.com/docs/backlog/api/get-document-attachments/
|
|
2807
|
+
*/
|
|
2808
|
+
downloadDocumentAttachment(documentId, attachmentId) {
|
|
2809
|
+
return this.download(`documents/${documentId}/attachments/${attachmentId}`);
|
|
2810
|
+
}
|
|
2811
|
+
/**
|
|
2812
|
+
* https://developer.nulab.com/docs/backlog/api/2/add-document/
|
|
2813
|
+
*/
|
|
2814
|
+
addDocument(params) {
|
|
2815
|
+
return this.post("documents", params);
|
|
2816
|
+
}
|
|
2817
|
+
/**
|
|
2818
|
+
* https://developer.nulab.com/docs/backlog/api/2/delete-document/
|
|
2819
|
+
*/
|
|
2820
|
+
deleteDocument(documentId) {
|
|
2821
|
+
return this.delete(`documents/${documentId}`);
|
|
2822
|
+
}
|
|
2823
|
+
/**
|
|
2824
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-wiki-page-history/
|
|
2825
|
+
*/
|
|
2826
|
+
getWikisHistory(wikiId, params) {
|
|
2827
|
+
return this.get(`wikis/${wikiId}/history`, params);
|
|
2828
|
+
}
|
|
2829
|
+
/**
|
|
2830
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-wiki-page-star/
|
|
2831
|
+
*/
|
|
2832
|
+
getWikisStars(wikiId) {
|
|
2833
|
+
return this.get(`wikis/${wikiId}/stars`);
|
|
2834
|
+
}
|
|
2835
|
+
/**
|
|
2836
|
+
* https://developer.nulab.com/docs/backlog/api/2/add-star/
|
|
2837
|
+
*/
|
|
2838
|
+
postStar(params) {
|
|
2839
|
+
return this.post("stars", params);
|
|
2840
|
+
}
|
|
2841
|
+
/**
|
|
2842
|
+
* https://developer.nulab.com/docs/backlog/api/2/remove-star/
|
|
2843
|
+
*/
|
|
2844
|
+
removeStar(starId) {
|
|
2845
|
+
const endpoint = `stars/${starId}`;
|
|
2846
|
+
return this.delete(endpoint);
|
|
2847
|
+
}
|
|
2848
|
+
/**
|
|
2849
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-notification/
|
|
2850
|
+
*/
|
|
2851
|
+
getNotifications(params) {
|
|
2852
|
+
return this.get("notifications", params);
|
|
2853
|
+
}
|
|
2854
|
+
/**
|
|
2855
|
+
* https://developer.nulab.com/docs/backlog/api/2/count-notification/
|
|
2856
|
+
*/
|
|
2857
|
+
getNotificationsCount(params) {
|
|
2858
|
+
return this.get("notifications/count", params);
|
|
2859
|
+
}
|
|
2860
|
+
/**
|
|
2861
|
+
* https://developer.nulab.com/docs/backlog/api/2/reset-unread-notification-count/
|
|
2862
|
+
*/
|
|
2863
|
+
resetNotificationsMarkAsRead() {
|
|
2864
|
+
return this.post("notifications/markAsRead");
|
|
2865
|
+
}
|
|
2866
|
+
/**
|
|
2867
|
+
* https://developer.nulab.com/docs/backlog/api/2/read-notification/
|
|
2868
|
+
*/
|
|
2869
|
+
markAsReadNotification(id) {
|
|
2870
|
+
return this.post(`notifications/${id}/markAsRead`);
|
|
2871
|
+
}
|
|
2872
|
+
/**
|
|
2873
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-list-of-git-repositories/
|
|
2874
|
+
*/
|
|
2875
|
+
getGitRepositories(projectIdOrKey) {
|
|
2876
|
+
return this.get(`projects/${projectIdOrKey}/git/repositories`);
|
|
2877
|
+
}
|
|
2878
|
+
/**
|
|
2879
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-git-repository/
|
|
2880
|
+
*/
|
|
2881
|
+
getGitRepository(projectIdOrKey, repoIdOrName) {
|
|
2882
|
+
return this.get(`projects/${projectIdOrKey}/git/repositories/${repoIdOrName}`);
|
|
2883
|
+
}
|
|
2884
|
+
/**
|
|
2885
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-pull-request-list/
|
|
2886
|
+
*/
|
|
2887
|
+
getPullRequests(projectIdOrKey, repoIdOrName, params) {
|
|
2888
|
+
return this.get(`projects/${projectIdOrKey}/git/repositories/${repoIdOrName}/pullRequests`, params);
|
|
2889
|
+
}
|
|
2890
|
+
/**
|
|
2891
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-number-of-pull-requests/
|
|
2892
|
+
*/
|
|
2893
|
+
getPullRequestsCount(projectIdOrKey, repoIdOrName, params) {
|
|
2894
|
+
return this.get(`projects/${projectIdOrKey}/git/repositories/${repoIdOrName}/pullRequests/count`, params);
|
|
2895
|
+
}
|
|
2896
|
+
/**
|
|
2897
|
+
* https://developer.nulab.com/docs/backlog/api/2/add-pull-request/
|
|
2898
|
+
*/
|
|
2899
|
+
postPullRequest(projectIdOrKey, repoIdOrName, params) {
|
|
2900
|
+
return this.post(`projects/${projectIdOrKey}/git/repositories/${repoIdOrName}/pullRequests`, params);
|
|
2901
|
+
}
|
|
2902
|
+
/**
|
|
2903
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-pull-request/
|
|
2904
|
+
*/
|
|
2905
|
+
getPullRequest(projectIdOrKey, repoIdOrName, number) {
|
|
2906
|
+
return this.get(`projects/${projectIdOrKey}/git/repositories/${repoIdOrName}/pullRequests/${number}`);
|
|
2907
|
+
}
|
|
2908
|
+
/**
|
|
2909
|
+
* https://developer.nulab.com/docs/backlog/api/2/update-pull-request/
|
|
2910
|
+
*/
|
|
2911
|
+
patchPullRequest(projectIdOrKey, repoIdOrName, number, params) {
|
|
2912
|
+
return this.patch(`projects/${projectIdOrKey}/git/repositories/${repoIdOrName}/pullRequests/${number}`, params);
|
|
2913
|
+
}
|
|
2914
|
+
/**
|
|
2915
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-pull-request-comment/
|
|
2916
|
+
*/
|
|
2917
|
+
getPullRequestComments(projectIdOrKey, repoIdOrName, number, params) {
|
|
2918
|
+
return this.get(`projects/${projectIdOrKey}/git/repositories/${repoIdOrName}/pullRequests/${number}/comments`, params);
|
|
2919
|
+
}
|
|
2920
|
+
/**
|
|
2921
|
+
* https://developer.nulab.com/docs/backlog/api/2/add-pull-request-comment/
|
|
2922
|
+
*/
|
|
2923
|
+
postPullRequestComments(projectIdOrKey, repoIdOrName, number, params) {
|
|
2924
|
+
return this.post(`projects/${projectIdOrKey}/git/repositories/${repoIdOrName}/pullRequests/${number}/comments`, params);
|
|
2925
|
+
}
|
|
2926
|
+
/**
|
|
2927
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-number-of-pull-request-comments/
|
|
2928
|
+
*/
|
|
2929
|
+
getPullRequestCommentsCount(projectIdOrKey, repoIdOrName, number) {
|
|
2930
|
+
return this.get(`projects/${projectIdOrKey}/git/repositories/${repoIdOrName}/pullRequests/${number}/comments/count`);
|
|
2931
|
+
}
|
|
2932
|
+
/**
|
|
2933
|
+
* https://developer.nulab.com/docs/backlog/api/2/update-pull-request-comment-information/
|
|
2934
|
+
*/
|
|
2935
|
+
patchPullRequestComments(projectIdOrKey, repoIdOrName, number, commentId, params) {
|
|
2936
|
+
return this.patch(`projects/${projectIdOrKey}/git/repositories/${repoIdOrName}/pullRequests/${number}/comments/${commentId}`, params);
|
|
2937
|
+
}
|
|
2938
|
+
/**
|
|
2939
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-list-of-pull-request-attachment/
|
|
2940
|
+
*/
|
|
2941
|
+
getPullRequestAttachments(projectIdOrKey, repoIdOrName, number) {
|
|
2942
|
+
return this.get(`projects/${projectIdOrKey}/git/repositories/${repoIdOrName}/pullRequests/${number}/attachments`);
|
|
2943
|
+
}
|
|
2944
|
+
/**
|
|
2945
|
+
* https://developer.nulab.com/docs/backlog/api/2/download-pull-request-attachment/
|
|
2946
|
+
*/
|
|
2947
|
+
getPullRequestAttachment(projectIdOrKey, repoIdOrName, number, attachmentId) {
|
|
2948
|
+
return this.download(`projects/${projectIdOrKey}/git/repositories/${repoIdOrName}/pullRequests/${number}/attachments/${attachmentId}`);
|
|
2949
|
+
}
|
|
2950
|
+
/**
|
|
2951
|
+
* https://developer.nulab.com/docs/backlog/api/2/delete-pull-request-attachments/
|
|
2952
|
+
*/
|
|
2953
|
+
deletePullRequestAttachment(projectIdOrKey, repoIdOrName, number, attachmentId) {
|
|
2954
|
+
return this.get(`projects/${projectIdOrKey}/git/repositories/${repoIdOrName}/pullRequests/${number}/attachments/${attachmentId}`);
|
|
2955
|
+
}
|
|
2956
|
+
/**
|
|
2957
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-watching-list
|
|
2958
|
+
*/
|
|
2959
|
+
getWatchingListItems(userId, params) {
|
|
2960
|
+
return this.get(`users/${userId}/watchings`, params);
|
|
2961
|
+
}
|
|
2962
|
+
/**
|
|
2963
|
+
* https://developer.nulab.com/docs/backlog/api/2/count-watching
|
|
2964
|
+
*/
|
|
2965
|
+
getWatchingListCount(userId, params) {
|
|
2966
|
+
return this.get(`users/${userId}/watchings/count`, params);
|
|
2967
|
+
}
|
|
2968
|
+
/**
|
|
2969
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-watching
|
|
2970
|
+
*/
|
|
2971
|
+
getWatchingListItem(watchId) {
|
|
2972
|
+
return this.get(`watchings/${watchId}`);
|
|
2973
|
+
}
|
|
2974
|
+
/**
|
|
2975
|
+
* https://developer.nulab.com/docs/backlog/api/2/add-watching
|
|
2976
|
+
*/
|
|
2977
|
+
postWatchingListItem(params) {
|
|
2978
|
+
return this.post(`watchings`, params);
|
|
2979
|
+
}
|
|
2980
|
+
/**
|
|
2981
|
+
* https://developer.nulab.com/docs/backlog/api/2/update-watching
|
|
2982
|
+
*/
|
|
2983
|
+
patchWatchingListItem(watchId, note) {
|
|
2984
|
+
return this.patch(`watchings/${watchId}`, { note });
|
|
2985
|
+
}
|
|
2986
|
+
/**
|
|
2987
|
+
* https://developer.nulab.com/docs/backlog/api/2/delete-watching
|
|
2988
|
+
*/
|
|
2989
|
+
deletehWatchingListItem(watchId) {
|
|
2990
|
+
return this.delete(`watchings/${watchId}`);
|
|
2991
|
+
}
|
|
2992
|
+
/**
|
|
2993
|
+
* https://developer.nulab.com/docs/backlog/api/2/mark-watching-as-read
|
|
2994
|
+
*/
|
|
2995
|
+
resetWatchingListItemAsRead(watchId) {
|
|
2996
|
+
return this.post(`watchings/${watchId}/markAsRead`);
|
|
2997
|
+
}
|
|
2998
|
+
/**
|
|
2999
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-licence
|
|
3000
|
+
*/
|
|
3001
|
+
getLicence() {
|
|
3002
|
+
return this.get(`space/licence`);
|
|
3003
|
+
}
|
|
3004
|
+
/**
|
|
3005
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-list-of-teams/
|
|
3006
|
+
*/
|
|
3007
|
+
getTeams(params) {
|
|
3008
|
+
return this.get(`teams`, params);
|
|
3009
|
+
}
|
|
3010
|
+
/**
|
|
3011
|
+
* https://developer.nulab.com/docs/backlog/api/2/add-team/
|
|
3012
|
+
*/
|
|
3013
|
+
postTeam(params) {
|
|
3014
|
+
return this.post(`teams`, params);
|
|
3015
|
+
}
|
|
3016
|
+
/**
|
|
3017
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-team/
|
|
3018
|
+
*/
|
|
3019
|
+
getTeam(teamId) {
|
|
3020
|
+
return this.get(`teams/${teamId}`);
|
|
3021
|
+
}
|
|
3022
|
+
/**
|
|
3023
|
+
* https://developer.nulab.com/docs/backlog/api/2/update-team/
|
|
3024
|
+
*/
|
|
3025
|
+
patchTeam(teamId, params) {
|
|
3026
|
+
return this.patch(`teams/${teamId}`, params);
|
|
3027
|
+
}
|
|
3028
|
+
/**
|
|
3029
|
+
* https://developer.nulab.com/docs/backlog/api/2/delete-team/
|
|
3030
|
+
*/
|
|
3031
|
+
deleteTeam(teamId) {
|
|
3032
|
+
return this.delete(`teams/${teamId}`);
|
|
3033
|
+
}
|
|
3034
|
+
/**
|
|
3035
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-team-icon/
|
|
3036
|
+
*/
|
|
3037
|
+
getTeamIcon(teamId) {
|
|
3038
|
+
return this.download(`teams/${teamId}/icon`);
|
|
3039
|
+
}
|
|
3040
|
+
/**
|
|
3041
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-project-team-list/
|
|
3042
|
+
*/
|
|
3043
|
+
getProjectTeams(projectIdOrKey) {
|
|
3044
|
+
return this.get(`projects/${projectIdOrKey}/teams`);
|
|
3045
|
+
}
|
|
3046
|
+
/**
|
|
3047
|
+
* https://developer.nulab.com/docs/backlog/api/2/add-project-team/
|
|
3048
|
+
*/
|
|
3049
|
+
postProjectTeam(projectIdOrKey, teamId) {
|
|
3050
|
+
return this.post(`projects/${projectIdOrKey}/teams`, { teamId });
|
|
3051
|
+
}
|
|
3052
|
+
/**
|
|
3053
|
+
* https://developer.nulab.com/docs/backlog/api/2/delete-project-team/
|
|
3054
|
+
*/
|
|
3055
|
+
deleteProjectTeam(projectIdOrKey, teamId) {
|
|
3056
|
+
return this.delete(`projects/${projectIdOrKey}/teams`, { teamId });
|
|
3057
|
+
}
|
|
3058
|
+
/**
|
|
3059
|
+
* https://developer.nulab.com/docs/backlog/api/2/get-rate-limit/
|
|
3060
|
+
*/
|
|
3061
|
+
getRateLimit() {
|
|
3062
|
+
return this.get("rateLimit");
|
|
3063
|
+
}
|
|
3064
|
+
download(path) {
|
|
3065
|
+
return this.request({
|
|
3066
|
+
method: "GET",
|
|
3067
|
+
path
|
|
3068
|
+
}).then(this.parseFileData);
|
|
3069
|
+
}
|
|
3070
|
+
upload(path, params) {
|
|
3071
|
+
return this.request({
|
|
3072
|
+
method: "POST",
|
|
3073
|
+
path,
|
|
3074
|
+
params
|
|
3075
|
+
}).then(this.parseJSON);
|
|
3076
|
+
}
|
|
3077
|
+
parseFileData(response) {
|
|
3078
|
+
return new Promise((resolve) => {
|
|
3079
|
+
if (typeof window !== "undefined") resolve({
|
|
3080
|
+
body: response.body,
|
|
3081
|
+
url: response.url,
|
|
3082
|
+
blob: () => response.blob()
|
|
3083
|
+
});
|
|
3084
|
+
else {
|
|
3085
|
+
const disposition = response.headers.get("Content-Disposition");
|
|
3086
|
+
const filename = disposition ? disposition.substring(disposition.indexOf("''") + 2) : "";
|
|
3087
|
+
resolve({
|
|
3088
|
+
body: response.body,
|
|
3089
|
+
url: response.url,
|
|
3090
|
+
filename
|
|
3091
|
+
});
|
|
3092
|
+
}
|
|
3093
|
+
});
|
|
3094
|
+
}
|
|
3095
|
+
};
|
|
3096
|
+
|
|
3097
|
+
//#endregion
|
|
3098
|
+
//#region src/oauth2.ts
|
|
3099
|
+
var OAuth2 = class {
|
|
3100
|
+
constructor(credentials, timeout, fetch) {
|
|
3101
|
+
this.credentials = credentials;
|
|
3102
|
+
this.timeout = timeout;
|
|
3103
|
+
this.fetch = fetch;
|
|
3104
|
+
}
|
|
3105
|
+
getAuthorizationURL(options) {
|
|
3106
|
+
const params = {
|
|
3107
|
+
client_id: this.credentials.clientId,
|
|
3108
|
+
response_type: "code",
|
|
3109
|
+
redirect_uri: options.redirectUri,
|
|
3110
|
+
state: options.state
|
|
3111
|
+
};
|
|
3112
|
+
return `https://${options.host}/OAuth2AccessRequest.action?` + Object.keys(params).map((key) => params[key] ? `${key}=${params[key]}` : "").filter((x) => x.length > 0).join("&");
|
|
3113
|
+
}
|
|
3114
|
+
getAccessToken(options) {
|
|
3115
|
+
return new Request({
|
|
3116
|
+
host: options.host,
|
|
3117
|
+
timeout: this.timeout,
|
|
3118
|
+
fetch: this.fetch
|
|
3119
|
+
}).post("oauth2/token", {
|
|
3120
|
+
grant_type: "authorization_code",
|
|
3121
|
+
code: options.code,
|
|
3122
|
+
client_id: this.credentials.clientId,
|
|
3123
|
+
client_secret: this.credentials.clientSecret,
|
|
3124
|
+
redirect_uri: options.redirectUri
|
|
3125
|
+
});
|
|
3126
|
+
}
|
|
3127
|
+
refreshAccessToken(options) {
|
|
3128
|
+
return new Request({
|
|
3129
|
+
host: options.host,
|
|
3130
|
+
timeout: this.timeout,
|
|
3131
|
+
fetch: this.fetch
|
|
3132
|
+
}).post("oauth2/token", {
|
|
3133
|
+
grant_type: "refresh_token",
|
|
3134
|
+
client_id: this.credentials.clientId,
|
|
3135
|
+
client_secret: this.credentials.clientSecret,
|
|
3136
|
+
refresh_token: options.refreshToken
|
|
3137
|
+
});
|
|
3138
|
+
}
|
|
3139
|
+
};
|
|
3140
|
+
|
|
3141
|
+
//#endregion
|
|
3142
|
+
//#region src/option.ts
|
|
3143
|
+
var option_exports = /* @__PURE__ */ __exportAll({ Issue: () => Issue });
|
|
3144
|
+
let Issue;
|
|
3145
|
+
(function(_Issue) {
|
|
3146
|
+
_Issue.ParentChildType = /* @__PURE__ */ function(ParentChildType) {
|
|
3147
|
+
ParentChildType[ParentChildType["All"] = 0] = "All";
|
|
3148
|
+
ParentChildType[ParentChildType["NotChild"] = 1] = "NotChild";
|
|
3149
|
+
/** @deprecated Use {@link ChildOrGrandchild}. */
|
|
3150
|
+
ParentChildType[ParentChildType["Child"] = 2] = "Child";
|
|
3151
|
+
ParentChildType[ParentChildType["ChildOrGrandchild"] = 2] = "ChildOrGrandchild";
|
|
3152
|
+
ParentChildType[ParentChildType["NotChildNotParent"] = 3] = "NotChildNotParent";
|
|
3153
|
+
/** @deprecated Use {@link HasChildren}. */
|
|
3154
|
+
ParentChildType[ParentChildType["Parent"] = 4] = "Parent";
|
|
3155
|
+
ParentChildType[ParentChildType["HasChildren"] = 4] = "HasChildren";
|
|
3156
|
+
ParentChildType[ParentChildType["GrandchildOnly"] = 5] = "GrandchildOnly";
|
|
3157
|
+
ParentChildType[ParentChildType["ChildOnly"] = 6] = "ChildOnly";
|
|
3158
|
+
ParentChildType[ParentChildType["TopLevelOnly"] = 7] = "TopLevelOnly";
|
|
3159
|
+
ParentChildType[ParentChildType["ExcludeGrandchild"] = 8] = "ExcludeGrandchild";
|
|
3160
|
+
ParentChildType[ParentChildType["ExcludeTopLevel"] = 9] = "ExcludeTopLevel";
|
|
3161
|
+
ParentChildType[ParentChildType["LeafOnly"] = 10] = "LeafOnly";
|
|
3162
|
+
return ParentChildType;
|
|
3163
|
+
}({});
|
|
3164
|
+
})(Issue || (Issue = {}));
|
|
3165
|
+
|
|
3166
|
+
//#endregion
|
|
3167
|
+
//#region src/entity.ts
|
|
3168
|
+
var entity_exports = /* @__PURE__ */ __exportAll({});
|
|
3169
|
+
|
|
3170
|
+
//#endregion
|
|
3171
|
+
//#region src/types.ts
|
|
3172
|
+
var types_exports = /* @__PURE__ */ __exportAll({
|
|
3173
|
+
ActivityType: () => ActivityType,
|
|
3174
|
+
ClassicRoleType: () => ClassicRoleType,
|
|
3175
|
+
CustomFieldType: () => CustomFieldType,
|
|
3176
|
+
NormalRoleType: () => NormalRoleType
|
|
3177
|
+
});
|
|
3178
|
+
let ClassicRoleType = /* @__PURE__ */ function(ClassicRoleType) {
|
|
3179
|
+
ClassicRoleType[ClassicRoleType["Admin"] = 1] = "Admin";
|
|
3180
|
+
ClassicRoleType[ClassicRoleType["User"] = 2] = "User";
|
|
3181
|
+
ClassicRoleType[ClassicRoleType["Reporter"] = 3] = "Reporter";
|
|
3182
|
+
ClassicRoleType[ClassicRoleType["Viewer"] = 4] = "Viewer";
|
|
3183
|
+
ClassicRoleType[ClassicRoleType["GuestReporter"] = 5] = "GuestReporter";
|
|
3184
|
+
ClassicRoleType[ClassicRoleType["GuestViewer"] = 6] = "GuestViewer";
|
|
3185
|
+
return ClassicRoleType;
|
|
3186
|
+
}({});
|
|
3187
|
+
let NormalRoleType = /* @__PURE__ */ function(NormalRoleType) {
|
|
3188
|
+
NormalRoleType[NormalRoleType["Admin"] = 1] = "Admin";
|
|
3189
|
+
NormalRoleType[NormalRoleType["MemberOrGuest"] = 2] = "MemberOrGuest";
|
|
3190
|
+
NormalRoleType[NormalRoleType["MemberOrGuestForAddIssues"] = 3] = "MemberOrGuestForAddIssues";
|
|
3191
|
+
NormalRoleType[NormalRoleType["MemberOrGuestForViewIssues"] = 4] = "MemberOrGuestForViewIssues";
|
|
3192
|
+
return NormalRoleType;
|
|
3193
|
+
}({});
|
|
3194
|
+
let ActivityType = /* @__PURE__ */ function(ActivityType) {
|
|
3195
|
+
ActivityType[ActivityType["Undefined"] = -1] = "Undefined";
|
|
3196
|
+
ActivityType[ActivityType["IssueCreated"] = 1] = "IssueCreated";
|
|
3197
|
+
ActivityType[ActivityType["IssueUpdated"] = 2] = "IssueUpdated";
|
|
3198
|
+
ActivityType[ActivityType["IssueCommented"] = 3] = "IssueCommented";
|
|
3199
|
+
ActivityType[ActivityType["IssueDeleted"] = 4] = "IssueDeleted";
|
|
3200
|
+
ActivityType[ActivityType["WikiCreated"] = 5] = "WikiCreated";
|
|
3201
|
+
ActivityType[ActivityType["WikiUpdated"] = 6] = "WikiUpdated";
|
|
3202
|
+
ActivityType[ActivityType["WikiDeleted"] = 7] = "WikiDeleted";
|
|
3203
|
+
ActivityType[ActivityType["FileAdded"] = 8] = "FileAdded";
|
|
3204
|
+
ActivityType[ActivityType["FileUpdated"] = 9] = "FileUpdated";
|
|
3205
|
+
ActivityType[ActivityType["FileDeleted"] = 10] = "FileDeleted";
|
|
3206
|
+
ActivityType[ActivityType["SvnCommitted"] = 11] = "SvnCommitted";
|
|
3207
|
+
ActivityType[ActivityType["GitPushed"] = 12] = "GitPushed";
|
|
3208
|
+
ActivityType[ActivityType["GitRepositoryCreated"] = 13] = "GitRepositoryCreated";
|
|
3209
|
+
ActivityType[ActivityType["IssueMultiUpdated"] = 14] = "IssueMultiUpdated";
|
|
3210
|
+
ActivityType[ActivityType["ProjectUserAdded"] = 15] = "ProjectUserAdded";
|
|
3211
|
+
ActivityType[ActivityType["ProjectUserRemoved"] = 16] = "ProjectUserRemoved";
|
|
3212
|
+
ActivityType[ActivityType["NotifyAdded"] = 17] = "NotifyAdded";
|
|
3213
|
+
ActivityType[ActivityType["PullRequestAdded"] = 18] = "PullRequestAdded";
|
|
3214
|
+
ActivityType[ActivityType["PullRequestUpdated"] = 19] = "PullRequestUpdated";
|
|
3215
|
+
ActivityType[ActivityType["PullRequestCommented"] = 20] = "PullRequestCommented";
|
|
3216
|
+
ActivityType[ActivityType["PullRequestMerged"] = 21] = "PullRequestMerged";
|
|
3217
|
+
ActivityType[ActivityType["MilestoneCreated"] = 22] = "MilestoneCreated";
|
|
3218
|
+
ActivityType[ActivityType["MilestoneUpdated"] = 23] = "MilestoneUpdated";
|
|
3219
|
+
ActivityType[ActivityType["MilestoneDeleted"] = 24] = "MilestoneDeleted";
|
|
3220
|
+
ActivityType[ActivityType["ProjectGroupAdded"] = 25] = "ProjectGroupAdded";
|
|
3221
|
+
ActivityType[ActivityType["ProjectGroupDeleted"] = 26] = "ProjectGroupDeleted";
|
|
3222
|
+
ActivityType[ActivityType["IssuesDatesUpdated"] = 35] = "IssuesDatesUpdated";
|
|
3223
|
+
ActivityType[ActivityType["StatusDeleted"] = 34] = "StatusDeleted";
|
|
3224
|
+
ActivityType[ActivityType["DocumentCreated"] = 36] = "DocumentCreated";
|
|
3225
|
+
ActivityType[ActivityType["DocumentDeleted"] = 37] = "DocumentDeleted";
|
|
3226
|
+
ActivityType[ActivityType["DocumentTitleUpdated"] = 38] = "DocumentTitleUpdated";
|
|
3227
|
+
ActivityType[ActivityType["DocumentCommentCreated"] = 40] = "DocumentCommentCreated";
|
|
3228
|
+
ActivityType[ActivityType["DocumentCommentUpdated"] = 41] = "DocumentCommentUpdated";
|
|
3229
|
+
ActivityType[ActivityType["DocumentCommentDeleted"] = 42] = "DocumentCommentDeleted";
|
|
3230
|
+
ActivityType[ActivityType["DocumentCommentReplyCreated"] = 43] = "DocumentCommentReplyCreated";
|
|
3231
|
+
ActivityType[ActivityType["DocumentCommentReplyUpdated"] = 44] = "DocumentCommentReplyUpdated";
|
|
3232
|
+
ActivityType[ActivityType["DocumentCommentReplyDeleted"] = 45] = "DocumentCommentReplyDeleted";
|
|
3233
|
+
ActivityType[ActivityType["DocumentAttachmentCreated"] = 46] = "DocumentAttachmentCreated";
|
|
3234
|
+
ActivityType[ActivityType["IssueMultiCreated"] = 47] = "IssueMultiCreated";
|
|
3235
|
+
ActivityType[ActivityType["DocumentMultiCreated"] = 48] = "DocumentMultiCreated";
|
|
3236
|
+
return ActivityType;
|
|
3237
|
+
}({});
|
|
3238
|
+
let CustomFieldType = /* @__PURE__ */ function(CustomFieldType) {
|
|
3239
|
+
CustomFieldType[CustomFieldType["Text"] = 1] = "Text";
|
|
3240
|
+
CustomFieldType[CustomFieldType["TextArea"] = 2] = "TextArea";
|
|
3241
|
+
CustomFieldType[CustomFieldType["Numeric"] = 3] = "Numeric";
|
|
3242
|
+
CustomFieldType[CustomFieldType["Date"] = 4] = "Date";
|
|
3243
|
+
CustomFieldType[CustomFieldType["SingleList"] = 5] = "SingleList";
|
|
3244
|
+
CustomFieldType[CustomFieldType["MultipleList"] = 6] = "MultipleList";
|
|
3245
|
+
CustomFieldType[CustomFieldType["CheckBox"] = 7] = "CheckBox";
|
|
3246
|
+
CustomFieldType[CustomFieldType["Radio"] = 8] = "Radio";
|
|
3247
|
+
return CustomFieldType;
|
|
3248
|
+
}({});
|
|
3249
|
+
|
|
3250
|
+
//#endregion
|
|
3251
|
+
exports.Backlog = Backlog;
|
|
3252
|
+
Object.defineProperty(exports, 'Entity', {
|
|
3253
|
+
enumerable: true,
|
|
3254
|
+
get: function () {
|
|
3255
|
+
return entity_exports;
|
|
3256
|
+
}
|
|
3257
|
+
});
|
|
3258
|
+
Object.defineProperty(exports, 'Error', {
|
|
3259
|
+
enumerable: true,
|
|
3260
|
+
get: function () {
|
|
3261
|
+
return error_exports;
|
|
3262
|
+
}
|
|
3263
|
+
});
|
|
3264
|
+
exports.OAuth2 = OAuth2;
|
|
3265
|
+
Object.defineProperty(exports, 'Option', {
|
|
3266
|
+
enumerable: true,
|
|
3267
|
+
get: function () {
|
|
3268
|
+
return option_exports;
|
|
3269
|
+
}
|
|
3270
|
+
});
|
|
3271
|
+
Object.defineProperty(exports, 'Types', {
|
|
3272
|
+
enumerable: true,
|
|
3273
|
+
get: function () {
|
|
3274
|
+
return types_exports;
|
|
3275
|
+
}
|
|
3276
|
+
});
|
|
3277
|
+
return exports;
|
|
3278
|
+
})({});
|