@catladder/cli 0.0.0-main-84dc1fbc → 0.0.0-main-a717e2de
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/bin/catci +3 -0
- package/bin/catci-dev +3 -0
- package/dist/apps/catci/catci.d.ts +1 -0
- package/dist/apps/catci/catci.js +71 -0
- package/dist/apps/catci/catci.js.map +1 -0
- package/dist/apps/catci/commands/security/auditDocument.d.ts +19 -0
- package/dist/apps/catci/commands/security/auditDocument.js +90 -0
- package/dist/apps/catci/commands/security/auditDocument.js.map +1 -0
- package/dist/apps/catci/commands/security/commands.d.ts +2 -0
- package/dist/apps/catci/commands/security/commands.js +175 -0
- package/dist/apps/catci/commands/security/commands.js.map +1 -0
- package/dist/apps/catci/commands/security/createSecurityAuditMergeRequest.d.ts +9 -0
- package/dist/apps/catci/commands/security/createSecurityAuditMergeRequest.js +112 -0
- package/dist/apps/catci/commands/security/createSecurityAuditMergeRequest.js.map +1 -0
- package/dist/apps/catci/commands/security/evaluateSecurityAudit.d.ts +5 -0
- package/dist/apps/catci/commands/security/evaluateSecurityAudit.js +76 -0
- package/dist/apps/catci/commands/security/evaluateSecurityAudit.js.map +1 -0
- package/dist/apps/catci/commands/security/topics.json +112 -0
- package/dist/apps/cli/commands/project/commandSecurityEvaluate.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandSecurityEvaluate.js +70 -0
- package/dist/apps/cli/commands/project/commandSecurityEvaluate.js.map +1 -0
- package/dist/apps/cli/commands/project/index.js +2 -0
- package/dist/apps/cli/commands/project/index.js.map +1 -1
- package/dist/bundles/catci/index.js +71365 -0
- package/dist/bundles/catenv/index.js +3 -2
- package/dist/bundles/cli/index.js +1904 -790
- package/dist/catci.d.ts +1 -0
- package/dist/catci.js +5 -0
- package/dist/catci.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -5
- package/scripts/bundle +2 -0
- package/src/apps/catci/catci.ts +20 -0
- package/src/apps/catci/commands/security/auditDocument.ts +150 -0
- package/src/apps/catci/commands/security/commands.ts +146 -0
- package/src/apps/catci/commands/security/createSecurityAuditMergeRequest.ts +98 -0
- package/src/apps/catci/commands/security/evaluateSecurityAudit.ts +30 -0
- package/src/apps/catci/commands/security/topics.json +120 -0
- package/src/apps/cli/commands/project/commandSecurityEvaluate.ts +26 -0
- package/src/apps/cli/commands/project/index.ts +2 -0
- package/src/catci.ts +3 -0
|
@@ -1,6 +1,305 @@
|
|
|
1
1
|
/******/ (() => { // webpackBootstrap
|
|
2
2
|
/******/ var __webpack_modules__ = ({
|
|
3
3
|
|
|
4
|
+
/***/ 5756:
|
|
5
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
6
|
+
|
|
7
|
+
"use strict";
|
|
8
|
+
|
|
9
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
+
};
|
|
12
|
+
exports.__esModule = true;
|
|
13
|
+
exports.evaluateDocument = exports.makeTemplate = void 0;
|
|
14
|
+
var topics_json_1 = __importDefault(__nccwpck_require__(80478));
|
|
15
|
+
var allTopics = topics_json_1["default"];
|
|
16
|
+
var checkYes = "✅";
|
|
17
|
+
var checkNo = "❌";
|
|
18
|
+
var checkPlaceholder = "".concat(checkYes, "/").concat(checkNo);
|
|
19
|
+
var responsiblePlaceholder = "@...";
|
|
20
|
+
var rows = [
|
|
21
|
+
["Responsible", checkPlaceholder, "Description", "Note", "More Information"],
|
|
22
|
+
].concat(allTopics.map(function (t) { return [
|
|
23
|
+
Array(t.responsibles).fill(responsiblePlaceholder).join(", "),
|
|
24
|
+
checkPlaceholder,
|
|
25
|
+
t.description,
|
|
26
|
+
"",
|
|
27
|
+
t.more,
|
|
28
|
+
]; }));
|
|
29
|
+
function makeTable(rows) {
|
|
30
|
+
var colWidths = calculateColumnWidths(rows);
|
|
31
|
+
return "\n".concat(makeRow(rows[0], colWidths, " "), "\n").concat(makeRow(rows[0].map(function () { return ""; }), colWidths, "-"), "\n").concat(rows
|
|
32
|
+
.slice(1)
|
|
33
|
+
.map(function (row) { return makeRow(row, colWidths, " "); })
|
|
34
|
+
.join("\n"), "\n");
|
|
35
|
+
}
|
|
36
|
+
function calculateColumnWidths(rows) {
|
|
37
|
+
var columnCount = rows[0].length;
|
|
38
|
+
return Array.from({ length: columnCount }, function (_, i) { return i; }).map(function (columnIndex) {
|
|
39
|
+
return Math.max.apply(Math, rows.map(function (row) { return row[columnIndex].length; }));
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
function makeRow(row, colWidths, fillString) {
|
|
43
|
+
return "| ".concat(row
|
|
44
|
+
.map(function (cell, i) { return cell.padEnd(colWidths[i], fillString); })
|
|
45
|
+
.join(" | "), " |");
|
|
46
|
+
}
|
|
47
|
+
function makeTemplate() {
|
|
48
|
+
return "\n# Security Audit Report\n\nA security audit report document is a comprehensive assessment of an application's security posture, containing security topics that auditors can mark to indicate the state of various security aspects.\n\nIt serves as a structured guide for security team to evaluate different security factors such as authentication, authorization, data encryption, input validation, and more.\n\n## General Information\n\n- Project Owner is @...\n- Dev team:\n - @...\n - @...\n - @...\n\n## Project Security\n\n".concat(makeTable(rows), "\n\n");
|
|
49
|
+
}
|
|
50
|
+
exports.makeTemplate = makeTemplate;
|
|
51
|
+
function evaluateDocument(document) {
|
|
52
|
+
var _a, _b;
|
|
53
|
+
var rawRows = (_b = (_a = document.match(/^\s*\|.*?\|\s*$/gm)) === null || _a === void 0 ? void 0 : _a.map(function (row) { return row.trim(); })) !== null && _b !== void 0 ? _b : [];
|
|
54
|
+
var matchedRows = rawRows
|
|
55
|
+
.map(function (row) { return row.split("|").map(function (col) { return col.trim(); }); })
|
|
56
|
+
.slice(2);
|
|
57
|
+
var knownTopics = new Set(allTopics.map(function (t) { return t.description; }));
|
|
58
|
+
var topics = matchedRows.map(function (col) {
|
|
59
|
+
var responsibles = col[1].split(", ");
|
|
60
|
+
var answer = col[2];
|
|
61
|
+
var description = col[3];
|
|
62
|
+
var note = col[4];
|
|
63
|
+
var isUnknown = !knownTopics.has(description);
|
|
64
|
+
var isAnswered = !isUnknown &&
|
|
65
|
+
!answer.includes(checkPlaceholder) &&
|
|
66
|
+
!responsibles.some(function (responsible) {
|
|
67
|
+
return responsible.includes(responsiblePlaceholder);
|
|
68
|
+
});
|
|
69
|
+
var isSecured = !isUnknown && isAnswered && answer.includes(checkYes);
|
|
70
|
+
return {
|
|
71
|
+
responsibles: responsibles,
|
|
72
|
+
answer: answer,
|
|
73
|
+
description: description,
|
|
74
|
+
note: note,
|
|
75
|
+
isUnknown: isUnknown,
|
|
76
|
+
isAnswered: isAnswered,
|
|
77
|
+
isSecured: isSecured
|
|
78
|
+
};
|
|
79
|
+
});
|
|
80
|
+
var totalTopics = allTopics.length;
|
|
81
|
+
var answeredTopics = topics.filter(function (t) { return t.isAnswered; }).length;
|
|
82
|
+
var securedTopics = topics.filter(function (t) { return t.isSecured; }).length;
|
|
83
|
+
var unknownTopics = topics.filter(function (t) { return t.isUnknown; }).length;
|
|
84
|
+
var rating = Math.round((securedTopics / totalTopics) * 100);
|
|
85
|
+
return {
|
|
86
|
+
topics: topics,
|
|
87
|
+
score: {
|
|
88
|
+
rating: rating,
|
|
89
|
+
totalTopics: totalTopics,
|
|
90
|
+
answeredTopics: answeredTopics,
|
|
91
|
+
securedTopics: securedTopics,
|
|
92
|
+
unknownTopics: unknownTopics
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
exports.evaluateDocument = evaluateDocument;
|
|
97
|
+
//# sourceMappingURL=auditDocument.js.map
|
|
98
|
+
|
|
99
|
+
/***/ }),
|
|
100
|
+
|
|
101
|
+
/***/ 16828:
|
|
102
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
103
|
+
|
|
104
|
+
"use strict";
|
|
105
|
+
|
|
106
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
107
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
108
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
109
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
110
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
111
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
112
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
113
|
+
});
|
|
114
|
+
};
|
|
115
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
116
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
117
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
118
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
119
|
+
function step(op) {
|
|
120
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
121
|
+
while (_) try {
|
|
122
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
123
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
124
|
+
switch (op[0]) {
|
|
125
|
+
case 0: case 1: t = op; break;
|
|
126
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
127
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
128
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
129
|
+
default:
|
|
130
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
131
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
132
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
133
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
134
|
+
if (t[2]) _.ops.pop();
|
|
135
|
+
_.trys.pop(); continue;
|
|
136
|
+
}
|
|
137
|
+
op = body.call(thisArg, _);
|
|
138
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
139
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
exports.__esModule = true;
|
|
143
|
+
exports.createSecurityAuditMergeRequest = exports.SECURITY_AUDIT_FILE_NAME = void 0;
|
|
144
|
+
var ts_results_es_1 = __nccwpck_require__(72807);
|
|
145
|
+
var auditDocument_1 = __nccwpck_require__(5756);
|
|
146
|
+
function makeDatedBranchName(branchName) {
|
|
147
|
+
var date = new Date().toISOString().slice(0, -5).replaceAll(/[:.T]/g, "-");
|
|
148
|
+
return "".concat(branchName, "-").concat(date);
|
|
149
|
+
}
|
|
150
|
+
var MR_TITLE = "Draft: chore(security): add security audit document";
|
|
151
|
+
exports.SECURITY_AUDIT_FILE_NAME = "SECURITY.md";
|
|
152
|
+
function createSecurityAuditMergeRequest(_a) {
|
|
153
|
+
var projectId = _a.projectId, mainBranch = _a.mainBranch, userId = _a.userId, api = _a.api;
|
|
154
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
155
|
+
var mrs, existingMr, auditTemplate, branch, commit, mr;
|
|
156
|
+
return __generator(this, function (_b) {
|
|
157
|
+
switch (_b.label) {
|
|
158
|
+
case 0: return [4 /*yield*/, ts_results_es_1.Result.wrapAsync(function () {
|
|
159
|
+
return api.MergeRequests.all({
|
|
160
|
+
state: "opened",
|
|
161
|
+
wip: "yes",
|
|
162
|
+
labels: "security-audit"
|
|
163
|
+
});
|
|
164
|
+
})];
|
|
165
|
+
case 1:
|
|
166
|
+
mrs = (_b.sent()).mapErr(function () { return "could not search for existing merge requests"; });
|
|
167
|
+
if (mrs.isErr())
|
|
168
|
+
return [2 /*return*/, mrs];
|
|
169
|
+
existingMr = mrs.value[0];
|
|
170
|
+
if (existingMr)
|
|
171
|
+
return [2 /*return*/, (0, ts_results_es_1.Err)("open merge request with security audit already exists: ".concat(existingMr.web_url))];
|
|
172
|
+
auditTemplate = ts_results_es_1.Result.wrap(function () { return (0, auditDocument_1.makeTemplate)(); }).mapErr(function () { return "could not make security audit template document"; });
|
|
173
|
+
if (auditTemplate.isErr())
|
|
174
|
+
return [2 /*return*/, auditTemplate];
|
|
175
|
+
return [4 /*yield*/, ts_results_es_1.Result.wrapAsync(function () {
|
|
176
|
+
return api.Branches.create(projectId, makeDatedBranchName("chore/security-audit"), mainBranch);
|
|
177
|
+
})];
|
|
178
|
+
case 2:
|
|
179
|
+
branch = (_b.sent()).mapErr(function (e) {
|
|
180
|
+
console.log(e);
|
|
181
|
+
return "could not create branch";
|
|
182
|
+
});
|
|
183
|
+
if (branch.isErr())
|
|
184
|
+
return [2 /*return*/, branch];
|
|
185
|
+
return [4 /*yield*/, ts_results_es_1.Result.wrapAsync(function () {
|
|
186
|
+
return api.Commits.create(projectId, branch.value.name, "chore(security): add empty security audit document template", [
|
|
187
|
+
{
|
|
188
|
+
action: "create",
|
|
189
|
+
filePath: exports.SECURITY_AUDIT_FILE_NAME,
|
|
190
|
+
content: auditTemplate.value,
|
|
191
|
+
encoding: "text"
|
|
192
|
+
},
|
|
193
|
+
]);
|
|
194
|
+
})];
|
|
195
|
+
case 3:
|
|
196
|
+
commit = (_b.sent()).mapErr(function () { return "could not create commit"; });
|
|
197
|
+
if (commit.isErr())
|
|
198
|
+
return [2 /*return*/, commit];
|
|
199
|
+
return [4 /*yield*/, ts_results_es_1.Result.wrapAsync(function () {
|
|
200
|
+
return api.MergeRequests.create(projectId, branch.value.name, mainBranch, MR_TITLE, {
|
|
201
|
+
description: "Please follow and update security audit document in `".concat(exports.SECURITY_AUDIT_FILE_NAME, "`."),
|
|
202
|
+
assigneeId: userId,
|
|
203
|
+
squash: true,
|
|
204
|
+
labels: "security-audit",
|
|
205
|
+
removeSourceBranch: true
|
|
206
|
+
});
|
|
207
|
+
})];
|
|
208
|
+
case 4:
|
|
209
|
+
mr = (_b.sent()).mapErr(function () { return "could not create merge request"; });
|
|
210
|
+
return [2 /*return*/, mr];
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
exports.createSecurityAuditMergeRequest = createSecurityAuditMergeRequest;
|
|
216
|
+
//# sourceMappingURL=createSecurityAuditMergeRequest.js.map
|
|
217
|
+
|
|
218
|
+
/***/ }),
|
|
219
|
+
|
|
220
|
+
/***/ 35849:
|
|
221
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
222
|
+
|
|
223
|
+
"use strict";
|
|
224
|
+
|
|
225
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
226
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
227
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
228
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
229
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
230
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
231
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
232
|
+
});
|
|
233
|
+
};
|
|
234
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
235
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
236
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
237
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
238
|
+
function step(op) {
|
|
239
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
240
|
+
while (_) try {
|
|
241
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
242
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
243
|
+
switch (op[0]) {
|
|
244
|
+
case 0: case 1: t = op; break;
|
|
245
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
246
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
247
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
248
|
+
default:
|
|
249
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
250
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
251
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
252
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
253
|
+
if (t[2]) _.ops.pop();
|
|
254
|
+
_.trys.pop(); continue;
|
|
255
|
+
}
|
|
256
|
+
op = body.call(thisArg, _);
|
|
257
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
258
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
exports.__esModule = true;
|
|
262
|
+
exports.makeSecurityAuditOverview = exports.evaluateSecurityAudit = void 0;
|
|
263
|
+
var ts_results_es_1 = __nccwpck_require__(72807);
|
|
264
|
+
var path_1 = __nccwpck_require__(71017);
|
|
265
|
+
var promises_1 = __nccwpck_require__(73292);
|
|
266
|
+
var createSecurityAuditMergeRequest_1 = __nccwpck_require__(16828);
|
|
267
|
+
var auditDocument_1 = __nccwpck_require__(5756);
|
|
268
|
+
function evaluateSecurityAudit(_a) {
|
|
269
|
+
var path = _a.path;
|
|
270
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
271
|
+
var _this = this;
|
|
272
|
+
return __generator(this, function (_b) {
|
|
273
|
+
switch (_b.label) {
|
|
274
|
+
case 0: return [4 /*yield*/, ts_results_es_1.Result.wrapAsync(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
275
|
+
var filePath, docData, doc;
|
|
276
|
+
return __generator(this, function (_a) {
|
|
277
|
+
switch (_a.label) {
|
|
278
|
+
case 0:
|
|
279
|
+
filePath = (0, path_1.join)(path, createSecurityAuditMergeRequest_1.SECURITY_AUDIT_FILE_NAME);
|
|
280
|
+
return [4 /*yield*/, (0, promises_1.readFile)(filePath)];
|
|
281
|
+
case 1:
|
|
282
|
+
docData = _a.sent();
|
|
283
|
+
doc = docData.toString("utf-8");
|
|
284
|
+
return [2 /*return*/, (0, auditDocument_1.evaluateDocument)(doc)];
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
}); })];
|
|
288
|
+
case 1: return [2 /*return*/, (_b.sent()).mapErr(function (e) { return "could not evaluate ".concat(createSecurityAuditMergeRequest_1.SECURITY_AUDIT_FILE_NAME, ": ").concat(e); })];
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
exports.evaluateSecurityAudit = evaluateSecurityAudit;
|
|
294
|
+
function makeSecurityAuditOverview(evaluation) {
|
|
295
|
+
var ratingToEmo = function (r) { return (r < 33 ? "🟥" : r < 66 ? "🟨" : "🟩"); };
|
|
296
|
+
return "Project security posture overview:\n \uD83E\uDDD0 Total topics: ".concat(evaluation.score.totalTopics, "\n \uD83D\uDD12 Secured topics: ").concat(evaluation.score.securedTopics, "\n \uD83D\uDCE2 Answered topics: ").concat(evaluation.score.answeredTopics, "\n \u2754 Unknown topics: ").concat(evaluation.score.unknownTopics, "\n \uD83D\uDCCA Rating: ").concat(ratingToEmo(evaluation.score.rating), " ").concat(evaluation.score.rating, "/100");
|
|
297
|
+
}
|
|
298
|
+
exports.makeSecurityAuditOverview = makeSecurityAuditOverview;
|
|
299
|
+
//# sourceMappingURL=evaluateSecurityAudit.js.map
|
|
300
|
+
|
|
301
|
+
/***/ }),
|
|
302
|
+
|
|
4
303
|
/***/ 93340:
|
|
5
304
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
6
305
|
|
|
@@ -4055,7 +4354,7 @@ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void
|
|
|
4055
4354
|
|
|
4056
4355
|
/***/ }),
|
|
4057
4356
|
|
|
4058
|
-
/***/
|
|
4357
|
+
/***/ 19041:
|
|
4059
4358
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
4060
4359
|
|
|
4061
4360
|
"use strict";
|
|
@@ -4097,30 +4396,42 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
4097
4396
|
}
|
|
4098
4397
|
};
|
|
4099
4398
|
exports.__esModule = true;
|
|
4100
|
-
var
|
|
4399
|
+
var evaluateSecurityAudit_1 = __nccwpck_require__(35849);
|
|
4400
|
+
var projects_1 = __nccwpck_require__(41619);
|
|
4101
4401
|
exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void 0, function () {
|
|
4102
4402
|
return __generator(this, function (_a) {
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4403
|
+
vorpal
|
|
4404
|
+
.command("project-security-evaluate", "evaluate project's security audit document")
|
|
4405
|
+
.action(function () {
|
|
4406
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4407
|
+
var gitRoot, result;
|
|
4408
|
+
return __generator(this, function (_a) {
|
|
4409
|
+
switch (_a.label) {
|
|
4410
|
+
case 0: return [4 /*yield*/, (0, projects_1.getGitRoot)()];
|
|
4411
|
+
case 1:
|
|
4412
|
+
gitRoot = _a.sent();
|
|
4413
|
+
return [4 /*yield*/, (0, evaluateSecurityAudit_1.evaluateSecurityAudit)({ path: gitRoot })];
|
|
4414
|
+
case 2:
|
|
4415
|
+
result = _a.sent();
|
|
4416
|
+
if (result.isErr()) {
|
|
4417
|
+
console.error("Could not evaluate security audit document:", result.error);
|
|
4418
|
+
}
|
|
4419
|
+
else {
|
|
4420
|
+
console.log((0, evaluateSecurityAudit_1.makeSecurityAuditOverview)(result.value));
|
|
4421
|
+
}
|
|
4422
|
+
return [2 /*return*/];
|
|
4423
|
+
}
|
|
4115
4424
|
});
|
|
4116
|
-
})
|
|
4425
|
+
});
|
|
4426
|
+
});
|
|
4427
|
+
return [2 /*return*/];
|
|
4117
4428
|
});
|
|
4118
4429
|
}); });
|
|
4119
|
-
//# sourceMappingURL=
|
|
4430
|
+
//# sourceMappingURL=commandSecurityEvaluate.js.map
|
|
4120
4431
|
|
|
4121
4432
|
/***/ }),
|
|
4122
4433
|
|
|
4123
|
-
/***/
|
|
4434
|
+
/***/ 54108:
|
|
4124
4435
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
4125
4436
|
|
|
4126
4437
|
"use strict";
|
|
@@ -4161,117 +4472,182 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
4161
4472
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
4162
4473
|
}
|
|
4163
4474
|
};
|
|
4164
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4165
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4166
|
-
};
|
|
4167
4475
|
exports.__esModule = true;
|
|
4168
|
-
var
|
|
4169
|
-
var k8sApi_1 = __nccwpck_require__(54756);
|
|
4170
|
-
var log_1 = __nccwpck_require__(37851);
|
|
4171
|
-
var namespaceAutoCompletion_1 = __nccwpck_require__(79176);
|
|
4172
|
-
var projects_1 = __nccwpck_require__(41619);
|
|
4173
|
-
var autocompletions_1 = __nccwpck_require__(41373);
|
|
4174
|
-
var ensureCluster_1 = __importDefault(__nccwpck_require__(8722));
|
|
4175
|
-
function triggerCronjob(namespace) {
|
|
4176
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
4177
|
-
var jobs, jobNames, jobName, cronjob, jobSpec, job, metadata, result, e_1;
|
|
4178
|
-
return __generator(this, function (_a) {
|
|
4179
|
-
switch (_a.label) {
|
|
4180
|
-
case 0: return [4 /*yield*/, (0, k8sApi_1.getk8sApiBatchBeta)().listNamespacedCronJob(namespace)];
|
|
4181
|
-
case 1:
|
|
4182
|
-
jobs = (_a.sent()).body.items;
|
|
4183
|
-
jobNames = jobs.map(function (j) { return j.metadata.name; });
|
|
4184
|
-
return [4 /*yield*/, this.prompt({
|
|
4185
|
-
type: "list",
|
|
4186
|
-
name: "jobName",
|
|
4187
|
-
choices: jobNames,
|
|
4188
|
-
message: "Which cronjob? 🤔"
|
|
4189
|
-
})];
|
|
4190
|
-
case 2:
|
|
4191
|
-
jobName = (_a.sent()).jobName;
|
|
4192
|
-
cronjob = jobs.find(function (j) { return j.metadata.name === jobName; });
|
|
4193
|
-
jobSpec = cronjob.spec.jobTemplate.spec;
|
|
4194
|
-
job = new client_node_1.V1Job();
|
|
4195
|
-
metadata = {
|
|
4196
|
-
name: "manual-".concat(Math.round(Date.now() / 1000), "-").concat(cronjob.metadata.name)
|
|
4197
|
-
};
|
|
4198
|
-
job.metadata = metadata;
|
|
4199
|
-
job.spec = jobSpec;
|
|
4200
|
-
_a.label = 3;
|
|
4201
|
-
case 3:
|
|
4202
|
-
_a.trys.push([3, 5, , 6]);
|
|
4203
|
-
return [4 /*yield*/, (0, k8sApi_1.getk8sApiBatch)().createNamespacedJob(namespace, job)];
|
|
4204
|
-
case 4:
|
|
4205
|
-
result = _a.sent();
|
|
4206
|
-
this.log("");
|
|
4207
|
-
this.log("yeah, you got a job, man. \uD83D\uDE3A ".concat(result.body.metadata.name));
|
|
4208
|
-
this.log("");
|
|
4209
|
-
return [3 /*break*/, 6];
|
|
4210
|
-
case 5:
|
|
4211
|
-
e_1 = _a.sent();
|
|
4212
|
-
(0, log_1.logError)(this, "command failed", e_1.body);
|
|
4213
|
-
return [3 /*break*/, 6];
|
|
4214
|
-
case 6: return [2 /*return*/];
|
|
4215
|
-
}
|
|
4216
|
-
});
|
|
4217
|
-
});
|
|
4218
|
-
}
|
|
4476
|
+
var setup_1 = __nccwpck_require__(20767);
|
|
4219
4477
|
exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void 0, function () {
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
case 0: return [4 /*yield*/, triggerCronjob.call(this, namespace)];
|
|
4233
|
-
case 1:
|
|
4234
|
-
_b.sent();
|
|
4235
|
-
return [2 /*return*/];
|
|
4236
|
-
}
|
|
4237
|
-
});
|
|
4238
|
-
});
|
|
4239
|
-
});
|
|
4240
|
-
_b = (_a = vorpal
|
|
4241
|
-
.command("project-trigger-cronjob <envComponent>", "trigger cronjob"))
|
|
4242
|
-
.autocomplete;
|
|
4243
|
-
return [4 /*yield*/, (0, autocompletions_1.envAndComponents)()];
|
|
4244
|
-
case 1:
|
|
4245
|
-
_b.apply(_a, [_c.sent()])
|
|
4246
|
-
.action(function (_a) {
|
|
4247
|
-
var envComponent = _a.envComponent;
|
|
4248
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
4249
|
-
var namespace;
|
|
4250
|
-
return __generator(this, function (_b) {
|
|
4251
|
-
switch (_b.label) {
|
|
4252
|
-
case 0: return [4 /*yield*/, ensureCluster_1["default"].call(this, envComponent)];
|
|
4253
|
-
case 1:
|
|
4254
|
-
_b.sent();
|
|
4255
|
-
return [4 /*yield*/, (0, projects_1.getProjectNamespace)(envComponent)];
|
|
4256
|
-
case 2:
|
|
4257
|
-
namespace = _b.sent();
|
|
4258
|
-
return [4 /*yield*/, triggerCronjob.call(this, namespace)];
|
|
4259
|
-
case 3:
|
|
4260
|
-
_b.sent();
|
|
4261
|
-
return [2 /*return*/];
|
|
4262
|
-
}
|
|
4263
|
-
});
|
|
4478
|
+
return __generator(this, function (_a) {
|
|
4479
|
+
return [2 /*return*/, vorpal
|
|
4480
|
+
.command("project-setup", "Initializes all environments and creates requires resources, service accounts, etc.")
|
|
4481
|
+
.action(function () {
|
|
4482
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4483
|
+
return __generator(this, function (_a) {
|
|
4484
|
+
switch (_a.label) {
|
|
4485
|
+
case 0: return [4 /*yield*/, (0, setup_1.setupProject)(this)];
|
|
4486
|
+
case 1:
|
|
4487
|
+
_a.sent();
|
|
4488
|
+
return [2 /*return*/];
|
|
4489
|
+
}
|
|
4264
4490
|
});
|
|
4265
4491
|
});
|
|
4266
|
-
|
|
4267
|
-
}
|
|
4492
|
+
})];
|
|
4268
4493
|
});
|
|
4269
4494
|
}); });
|
|
4270
|
-
//# sourceMappingURL=
|
|
4495
|
+
//# sourceMappingURL=commandSetup.js.map
|
|
4271
4496
|
|
|
4272
4497
|
/***/ }),
|
|
4273
4498
|
|
|
4274
|
-
/***/
|
|
4499
|
+
/***/ 51827:
|
|
4500
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
4501
|
+
|
|
4502
|
+
"use strict";
|
|
4503
|
+
|
|
4504
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4505
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4506
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4507
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
4508
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
4509
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
4510
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
4511
|
+
});
|
|
4512
|
+
};
|
|
4513
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
4514
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
4515
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
4516
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
4517
|
+
function step(op) {
|
|
4518
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
4519
|
+
while (_) try {
|
|
4520
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
4521
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
4522
|
+
switch (op[0]) {
|
|
4523
|
+
case 0: case 1: t = op; break;
|
|
4524
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
4525
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
4526
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
4527
|
+
default:
|
|
4528
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
4529
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
4530
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
4531
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
4532
|
+
if (t[2]) _.ops.pop();
|
|
4533
|
+
_.trys.pop(); continue;
|
|
4534
|
+
}
|
|
4535
|
+
op = body.call(thisArg, _);
|
|
4536
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
4537
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
4538
|
+
}
|
|
4539
|
+
};
|
|
4540
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4541
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4542
|
+
};
|
|
4543
|
+
exports.__esModule = true;
|
|
4544
|
+
var client_node_1 = __nccwpck_require__(15124);
|
|
4545
|
+
var k8sApi_1 = __nccwpck_require__(54756);
|
|
4546
|
+
var log_1 = __nccwpck_require__(37851);
|
|
4547
|
+
var namespaceAutoCompletion_1 = __nccwpck_require__(79176);
|
|
4548
|
+
var projects_1 = __nccwpck_require__(41619);
|
|
4549
|
+
var autocompletions_1 = __nccwpck_require__(41373);
|
|
4550
|
+
var ensureCluster_1 = __importDefault(__nccwpck_require__(8722));
|
|
4551
|
+
function triggerCronjob(namespace) {
|
|
4552
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4553
|
+
var jobs, jobNames, jobName, cronjob, jobSpec, job, metadata, result, e_1;
|
|
4554
|
+
return __generator(this, function (_a) {
|
|
4555
|
+
switch (_a.label) {
|
|
4556
|
+
case 0: return [4 /*yield*/, (0, k8sApi_1.getk8sApiBatchBeta)().listNamespacedCronJob(namespace)];
|
|
4557
|
+
case 1:
|
|
4558
|
+
jobs = (_a.sent()).body.items;
|
|
4559
|
+
jobNames = jobs.map(function (j) { return j.metadata.name; });
|
|
4560
|
+
return [4 /*yield*/, this.prompt({
|
|
4561
|
+
type: "list",
|
|
4562
|
+
name: "jobName",
|
|
4563
|
+
choices: jobNames,
|
|
4564
|
+
message: "Which cronjob? 🤔"
|
|
4565
|
+
})];
|
|
4566
|
+
case 2:
|
|
4567
|
+
jobName = (_a.sent()).jobName;
|
|
4568
|
+
cronjob = jobs.find(function (j) { return j.metadata.name === jobName; });
|
|
4569
|
+
jobSpec = cronjob.spec.jobTemplate.spec;
|
|
4570
|
+
job = new client_node_1.V1Job();
|
|
4571
|
+
metadata = {
|
|
4572
|
+
name: "manual-".concat(Math.round(Date.now() / 1000), "-").concat(cronjob.metadata.name)
|
|
4573
|
+
};
|
|
4574
|
+
job.metadata = metadata;
|
|
4575
|
+
job.spec = jobSpec;
|
|
4576
|
+
_a.label = 3;
|
|
4577
|
+
case 3:
|
|
4578
|
+
_a.trys.push([3, 5, , 6]);
|
|
4579
|
+
return [4 /*yield*/, (0, k8sApi_1.getk8sApiBatch)().createNamespacedJob(namespace, job)];
|
|
4580
|
+
case 4:
|
|
4581
|
+
result = _a.sent();
|
|
4582
|
+
this.log("");
|
|
4583
|
+
this.log("yeah, you got a job, man. \uD83D\uDE3A ".concat(result.body.metadata.name));
|
|
4584
|
+
this.log("");
|
|
4585
|
+
return [3 /*break*/, 6];
|
|
4586
|
+
case 5:
|
|
4587
|
+
e_1 = _a.sent();
|
|
4588
|
+
(0, log_1.logError)(this, "command failed", e_1.body);
|
|
4589
|
+
return [3 /*break*/, 6];
|
|
4590
|
+
case 6: return [2 /*return*/];
|
|
4591
|
+
}
|
|
4592
|
+
});
|
|
4593
|
+
});
|
|
4594
|
+
}
|
|
4595
|
+
exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void 0, function () {
|
|
4596
|
+
var _a, _b;
|
|
4597
|
+
return __generator(this, function (_c) {
|
|
4598
|
+
switch (_c.label) {
|
|
4599
|
+
case 0:
|
|
4600
|
+
vorpal
|
|
4601
|
+
.command("trigger-cronjob <namespace>", "trigger cronjob")
|
|
4602
|
+
.autocomplete(namespaceAutoCompletion_1.namespaceAutoCompletion)
|
|
4603
|
+
.action(function (_a) {
|
|
4604
|
+
var namespace = _a.namespace;
|
|
4605
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4606
|
+
return __generator(this, function (_b) {
|
|
4607
|
+
switch (_b.label) {
|
|
4608
|
+
case 0: return [4 /*yield*/, triggerCronjob.call(this, namespace)];
|
|
4609
|
+
case 1:
|
|
4610
|
+
_b.sent();
|
|
4611
|
+
return [2 /*return*/];
|
|
4612
|
+
}
|
|
4613
|
+
});
|
|
4614
|
+
});
|
|
4615
|
+
});
|
|
4616
|
+
_b = (_a = vorpal
|
|
4617
|
+
.command("project-trigger-cronjob <envComponent>", "trigger cronjob"))
|
|
4618
|
+
.autocomplete;
|
|
4619
|
+
return [4 /*yield*/, (0, autocompletions_1.envAndComponents)()];
|
|
4620
|
+
case 1:
|
|
4621
|
+
_b.apply(_a, [_c.sent()])
|
|
4622
|
+
.action(function (_a) {
|
|
4623
|
+
var envComponent = _a.envComponent;
|
|
4624
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4625
|
+
var namespace;
|
|
4626
|
+
return __generator(this, function (_b) {
|
|
4627
|
+
switch (_b.label) {
|
|
4628
|
+
case 0: return [4 /*yield*/, ensureCluster_1["default"].call(this, envComponent)];
|
|
4629
|
+
case 1:
|
|
4630
|
+
_b.sent();
|
|
4631
|
+
return [4 /*yield*/, (0, projects_1.getProjectNamespace)(envComponent)];
|
|
4632
|
+
case 2:
|
|
4633
|
+
namespace = _b.sent();
|
|
4634
|
+
return [4 /*yield*/, triggerCronjob.call(this, namespace)];
|
|
4635
|
+
case 3:
|
|
4636
|
+
_b.sent();
|
|
4637
|
+
return [2 /*return*/];
|
|
4638
|
+
}
|
|
4639
|
+
});
|
|
4640
|
+
});
|
|
4641
|
+
});
|
|
4642
|
+
return [2 /*return*/];
|
|
4643
|
+
}
|
|
4644
|
+
});
|
|
4645
|
+
}); });
|
|
4646
|
+
//# sourceMappingURL=commandTriggerCronjob.js.map
|
|
4647
|
+
|
|
4648
|
+
/***/ }),
|
|
4649
|
+
|
|
4650
|
+
/***/ 44143:
|
|
4275
4651
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
4276
4652
|
|
|
4277
4653
|
"use strict";
|
|
@@ -4341,6 +4717,7 @@ var commandTriggerCronjob_1 = __importDefault(__nccwpck_require__(51827));
|
|
|
4341
4717
|
var commandOpenGrafanaPod_1 = __importDefault(__nccwpck_require__(55848));
|
|
4342
4718
|
var commandSecretsClearBackups_1 = __importDefault(__nccwpck_require__(41863));
|
|
4343
4719
|
var commandProjectRestoreDb_1 = __importDefault(__nccwpck_require__(38831));
|
|
4720
|
+
var commandSecurityEvaluate_1 = __importDefault(__nccwpck_require__(19041));
|
|
4344
4721
|
exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void 0, function () {
|
|
4345
4722
|
return __generator(this, function (_a) {
|
|
4346
4723
|
(0, commandSetup_1["default"])(vorpal);
|
|
@@ -4367,6 +4744,7 @@ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void
|
|
|
4367
4744
|
(0, commandGitlabCi_1["default"])(vorpal);
|
|
4368
4745
|
(0, commandGetMyTotalWorktime_1["default"])(vorpal);
|
|
4369
4746
|
(0, commandMigrateHelm3_1["default"])(vorpal);
|
|
4747
|
+
(0, commandSecurityEvaluate_1["default"])(vorpal);
|
|
4370
4748
|
return [2 /*return*/];
|
|
4371
4749
|
});
|
|
4372
4750
|
}); });
|
|
@@ -301990,672 +302368,6 @@ var pump = function () {
|
|
|
301990
302368
|
module.exports = pump
|
|
301991
302369
|
|
|
301992
302370
|
|
|
301993
|
-
/***/ }),
|
|
301994
|
-
|
|
301995
|
-
/***/ 68815:
|
|
301996
|
-
/***/ ((module) => {
|
|
301997
|
-
|
|
301998
|
-
"use strict";
|
|
301999
|
-
|
|
302000
|
-
|
|
302001
|
-
var replace = String.prototype.replace;
|
|
302002
|
-
var percentTwenties = /%20/g;
|
|
302003
|
-
|
|
302004
|
-
module.exports = {
|
|
302005
|
-
'default': 'RFC3986',
|
|
302006
|
-
formatters: {
|
|
302007
|
-
RFC1738: function (value) {
|
|
302008
|
-
return replace.call(value, percentTwenties, '+');
|
|
302009
|
-
},
|
|
302010
|
-
RFC3986: function (value) {
|
|
302011
|
-
return value;
|
|
302012
|
-
}
|
|
302013
|
-
},
|
|
302014
|
-
RFC1738: 'RFC1738',
|
|
302015
|
-
RFC3986: 'RFC3986'
|
|
302016
|
-
};
|
|
302017
|
-
|
|
302018
|
-
|
|
302019
|
-
/***/ }),
|
|
302020
|
-
|
|
302021
|
-
/***/ 69241:
|
|
302022
|
-
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
302023
|
-
|
|
302024
|
-
"use strict";
|
|
302025
|
-
|
|
302026
|
-
|
|
302027
|
-
var stringify = __nccwpck_require__(51883);
|
|
302028
|
-
var parse = __nccwpck_require__(87513);
|
|
302029
|
-
var formats = __nccwpck_require__(68815);
|
|
302030
|
-
|
|
302031
|
-
module.exports = {
|
|
302032
|
-
formats: formats,
|
|
302033
|
-
parse: parse,
|
|
302034
|
-
stringify: stringify
|
|
302035
|
-
};
|
|
302036
|
-
|
|
302037
|
-
|
|
302038
|
-
/***/ }),
|
|
302039
|
-
|
|
302040
|
-
/***/ 87513:
|
|
302041
|
-
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
302042
|
-
|
|
302043
|
-
"use strict";
|
|
302044
|
-
|
|
302045
|
-
|
|
302046
|
-
var utils = __nccwpck_require__(99240);
|
|
302047
|
-
|
|
302048
|
-
var has = Object.prototype.hasOwnProperty;
|
|
302049
|
-
|
|
302050
|
-
var defaults = {
|
|
302051
|
-
allowDots: false,
|
|
302052
|
-
allowPrototypes: false,
|
|
302053
|
-
arrayLimit: 20,
|
|
302054
|
-
decoder: utils.decode,
|
|
302055
|
-
delimiter: '&',
|
|
302056
|
-
depth: 5,
|
|
302057
|
-
parameterLimit: 1000,
|
|
302058
|
-
plainObjects: false,
|
|
302059
|
-
strictNullHandling: false
|
|
302060
|
-
};
|
|
302061
|
-
|
|
302062
|
-
var parseValues = function parseQueryStringValues(str, options) {
|
|
302063
|
-
var obj = {};
|
|
302064
|
-
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
|
|
302065
|
-
var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
|
|
302066
|
-
var parts = cleanStr.split(options.delimiter, limit);
|
|
302067
|
-
|
|
302068
|
-
for (var i = 0; i < parts.length; ++i) {
|
|
302069
|
-
var part = parts[i];
|
|
302070
|
-
|
|
302071
|
-
var bracketEqualsPos = part.indexOf(']=');
|
|
302072
|
-
var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
|
|
302073
|
-
|
|
302074
|
-
var key, val;
|
|
302075
|
-
if (pos === -1) {
|
|
302076
|
-
key = options.decoder(part, defaults.decoder);
|
|
302077
|
-
val = options.strictNullHandling ? null : '';
|
|
302078
|
-
} else {
|
|
302079
|
-
key = options.decoder(part.slice(0, pos), defaults.decoder);
|
|
302080
|
-
val = options.decoder(part.slice(pos + 1), defaults.decoder);
|
|
302081
|
-
}
|
|
302082
|
-
if (has.call(obj, key)) {
|
|
302083
|
-
obj[key] = [].concat(obj[key]).concat(val);
|
|
302084
|
-
} else {
|
|
302085
|
-
obj[key] = val;
|
|
302086
|
-
}
|
|
302087
|
-
}
|
|
302088
|
-
|
|
302089
|
-
return obj;
|
|
302090
|
-
};
|
|
302091
|
-
|
|
302092
|
-
var parseObject = function (chain, val, options) {
|
|
302093
|
-
var leaf = val;
|
|
302094
|
-
|
|
302095
|
-
for (var i = chain.length - 1; i >= 0; --i) {
|
|
302096
|
-
var obj;
|
|
302097
|
-
var root = chain[i];
|
|
302098
|
-
|
|
302099
|
-
if (root === '[]') {
|
|
302100
|
-
obj = [];
|
|
302101
|
-
obj = obj.concat(leaf);
|
|
302102
|
-
} else {
|
|
302103
|
-
obj = options.plainObjects ? Object.create(null) : {};
|
|
302104
|
-
var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
|
|
302105
|
-
var index = parseInt(cleanRoot, 10);
|
|
302106
|
-
if (
|
|
302107
|
-
!isNaN(index)
|
|
302108
|
-
&& root !== cleanRoot
|
|
302109
|
-
&& String(index) === cleanRoot
|
|
302110
|
-
&& index >= 0
|
|
302111
|
-
&& (options.parseArrays && index <= options.arrayLimit)
|
|
302112
|
-
) {
|
|
302113
|
-
obj = [];
|
|
302114
|
-
obj[index] = leaf;
|
|
302115
|
-
} else {
|
|
302116
|
-
obj[cleanRoot] = leaf;
|
|
302117
|
-
}
|
|
302118
|
-
}
|
|
302119
|
-
|
|
302120
|
-
leaf = obj;
|
|
302121
|
-
}
|
|
302122
|
-
|
|
302123
|
-
return leaf;
|
|
302124
|
-
};
|
|
302125
|
-
|
|
302126
|
-
var parseKeys = function parseQueryStringKeys(givenKey, val, options) {
|
|
302127
|
-
if (!givenKey) {
|
|
302128
|
-
return;
|
|
302129
|
-
}
|
|
302130
|
-
|
|
302131
|
-
// Transform dot notation to bracket notation
|
|
302132
|
-
var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
|
|
302133
|
-
|
|
302134
|
-
// The regex chunks
|
|
302135
|
-
|
|
302136
|
-
var brackets = /(\[[^[\]]*])/;
|
|
302137
|
-
var child = /(\[[^[\]]*])/g;
|
|
302138
|
-
|
|
302139
|
-
// Get the parent
|
|
302140
|
-
|
|
302141
|
-
var segment = brackets.exec(key);
|
|
302142
|
-
var parent = segment ? key.slice(0, segment.index) : key;
|
|
302143
|
-
|
|
302144
|
-
// Stash the parent if it exists
|
|
302145
|
-
|
|
302146
|
-
var keys = [];
|
|
302147
|
-
if (parent) {
|
|
302148
|
-
// If we aren't using plain objects, optionally prefix keys
|
|
302149
|
-
// that would overwrite object prototype properties
|
|
302150
|
-
if (!options.plainObjects && has.call(Object.prototype, parent)) {
|
|
302151
|
-
if (!options.allowPrototypes) {
|
|
302152
|
-
return;
|
|
302153
|
-
}
|
|
302154
|
-
}
|
|
302155
|
-
|
|
302156
|
-
keys.push(parent);
|
|
302157
|
-
}
|
|
302158
|
-
|
|
302159
|
-
// Loop through children appending to the array until we hit depth
|
|
302160
|
-
|
|
302161
|
-
var i = 0;
|
|
302162
|
-
while ((segment = child.exec(key)) !== null && i < options.depth) {
|
|
302163
|
-
i += 1;
|
|
302164
|
-
if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
|
|
302165
|
-
if (!options.allowPrototypes) {
|
|
302166
|
-
return;
|
|
302167
|
-
}
|
|
302168
|
-
}
|
|
302169
|
-
keys.push(segment[1]);
|
|
302170
|
-
}
|
|
302171
|
-
|
|
302172
|
-
// If there's a remainder, just add whatever is left
|
|
302173
|
-
|
|
302174
|
-
if (segment) {
|
|
302175
|
-
keys.push('[' + key.slice(segment.index) + ']');
|
|
302176
|
-
}
|
|
302177
|
-
|
|
302178
|
-
return parseObject(keys, val, options);
|
|
302179
|
-
};
|
|
302180
|
-
|
|
302181
|
-
module.exports = function (str, opts) {
|
|
302182
|
-
var options = opts ? utils.assign({}, opts) : {};
|
|
302183
|
-
|
|
302184
|
-
if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') {
|
|
302185
|
-
throw new TypeError('Decoder has to be a function.');
|
|
302186
|
-
}
|
|
302187
|
-
|
|
302188
|
-
options.ignoreQueryPrefix = options.ignoreQueryPrefix === true;
|
|
302189
|
-
options.delimiter = typeof options.delimiter === 'string' || utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter;
|
|
302190
|
-
options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth;
|
|
302191
|
-
options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit;
|
|
302192
|
-
options.parseArrays = options.parseArrays !== false;
|
|
302193
|
-
options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults.decoder;
|
|
302194
|
-
options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults.allowDots;
|
|
302195
|
-
options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults.plainObjects;
|
|
302196
|
-
options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes;
|
|
302197
|
-
options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit;
|
|
302198
|
-
options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;
|
|
302199
|
-
|
|
302200
|
-
if (str === '' || str === null || typeof str === 'undefined') {
|
|
302201
|
-
return options.plainObjects ? Object.create(null) : {};
|
|
302202
|
-
}
|
|
302203
|
-
|
|
302204
|
-
var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
|
|
302205
|
-
var obj = options.plainObjects ? Object.create(null) : {};
|
|
302206
|
-
|
|
302207
|
-
// Iterate over the keys and setup the new object
|
|
302208
|
-
|
|
302209
|
-
var keys = Object.keys(tempObj);
|
|
302210
|
-
for (var i = 0; i < keys.length; ++i) {
|
|
302211
|
-
var key = keys[i];
|
|
302212
|
-
var newObj = parseKeys(key, tempObj[key], options);
|
|
302213
|
-
obj = utils.merge(obj, newObj, options);
|
|
302214
|
-
}
|
|
302215
|
-
|
|
302216
|
-
return utils.compact(obj);
|
|
302217
|
-
};
|
|
302218
|
-
|
|
302219
|
-
|
|
302220
|
-
/***/ }),
|
|
302221
|
-
|
|
302222
|
-
/***/ 51883:
|
|
302223
|
-
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
302224
|
-
|
|
302225
|
-
"use strict";
|
|
302226
|
-
|
|
302227
|
-
|
|
302228
|
-
var utils = __nccwpck_require__(99240);
|
|
302229
|
-
var formats = __nccwpck_require__(68815);
|
|
302230
|
-
|
|
302231
|
-
var arrayPrefixGenerators = {
|
|
302232
|
-
brackets: function brackets(prefix) { // eslint-disable-line func-name-matching
|
|
302233
|
-
return prefix + '[]';
|
|
302234
|
-
},
|
|
302235
|
-
indices: function indices(prefix, key) { // eslint-disable-line func-name-matching
|
|
302236
|
-
return prefix + '[' + key + ']';
|
|
302237
|
-
},
|
|
302238
|
-
repeat: function repeat(prefix) { // eslint-disable-line func-name-matching
|
|
302239
|
-
return prefix;
|
|
302240
|
-
}
|
|
302241
|
-
};
|
|
302242
|
-
|
|
302243
|
-
var toISO = Date.prototype.toISOString;
|
|
302244
|
-
|
|
302245
|
-
var defaults = {
|
|
302246
|
-
delimiter: '&',
|
|
302247
|
-
encode: true,
|
|
302248
|
-
encoder: utils.encode,
|
|
302249
|
-
encodeValuesOnly: false,
|
|
302250
|
-
serializeDate: function serializeDate(date) { // eslint-disable-line func-name-matching
|
|
302251
|
-
return toISO.call(date);
|
|
302252
|
-
},
|
|
302253
|
-
skipNulls: false,
|
|
302254
|
-
strictNullHandling: false
|
|
302255
|
-
};
|
|
302256
|
-
|
|
302257
|
-
var stringify = function stringify( // eslint-disable-line func-name-matching
|
|
302258
|
-
object,
|
|
302259
|
-
prefix,
|
|
302260
|
-
generateArrayPrefix,
|
|
302261
|
-
strictNullHandling,
|
|
302262
|
-
skipNulls,
|
|
302263
|
-
encoder,
|
|
302264
|
-
filter,
|
|
302265
|
-
sort,
|
|
302266
|
-
allowDots,
|
|
302267
|
-
serializeDate,
|
|
302268
|
-
formatter,
|
|
302269
|
-
encodeValuesOnly
|
|
302270
|
-
) {
|
|
302271
|
-
var obj = object;
|
|
302272
|
-
if (typeof filter === 'function') {
|
|
302273
|
-
obj = filter(prefix, obj);
|
|
302274
|
-
} else if (obj instanceof Date) {
|
|
302275
|
-
obj = serializeDate(obj);
|
|
302276
|
-
} else if (obj === null) {
|
|
302277
|
-
if (strictNullHandling) {
|
|
302278
|
-
return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder) : prefix;
|
|
302279
|
-
}
|
|
302280
|
-
|
|
302281
|
-
obj = '';
|
|
302282
|
-
}
|
|
302283
|
-
|
|
302284
|
-
if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) {
|
|
302285
|
-
if (encoder) {
|
|
302286
|
-
var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder);
|
|
302287
|
-
return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder))];
|
|
302288
|
-
}
|
|
302289
|
-
return [formatter(prefix) + '=' + formatter(String(obj))];
|
|
302290
|
-
}
|
|
302291
|
-
|
|
302292
|
-
var values = [];
|
|
302293
|
-
|
|
302294
|
-
if (typeof obj === 'undefined') {
|
|
302295
|
-
return values;
|
|
302296
|
-
}
|
|
302297
|
-
|
|
302298
|
-
var objKeys;
|
|
302299
|
-
if (Array.isArray(filter)) {
|
|
302300
|
-
objKeys = filter;
|
|
302301
|
-
} else {
|
|
302302
|
-
var keys = Object.keys(obj);
|
|
302303
|
-
objKeys = sort ? keys.sort(sort) : keys;
|
|
302304
|
-
}
|
|
302305
|
-
|
|
302306
|
-
for (var i = 0; i < objKeys.length; ++i) {
|
|
302307
|
-
var key = objKeys[i];
|
|
302308
|
-
|
|
302309
|
-
if (skipNulls && obj[key] === null) {
|
|
302310
|
-
continue;
|
|
302311
|
-
}
|
|
302312
|
-
|
|
302313
|
-
if (Array.isArray(obj)) {
|
|
302314
|
-
values = values.concat(stringify(
|
|
302315
|
-
obj[key],
|
|
302316
|
-
generateArrayPrefix(prefix, key),
|
|
302317
|
-
generateArrayPrefix,
|
|
302318
|
-
strictNullHandling,
|
|
302319
|
-
skipNulls,
|
|
302320
|
-
encoder,
|
|
302321
|
-
filter,
|
|
302322
|
-
sort,
|
|
302323
|
-
allowDots,
|
|
302324
|
-
serializeDate,
|
|
302325
|
-
formatter,
|
|
302326
|
-
encodeValuesOnly
|
|
302327
|
-
));
|
|
302328
|
-
} else {
|
|
302329
|
-
values = values.concat(stringify(
|
|
302330
|
-
obj[key],
|
|
302331
|
-
prefix + (allowDots ? '.' + key : '[' + key + ']'),
|
|
302332
|
-
generateArrayPrefix,
|
|
302333
|
-
strictNullHandling,
|
|
302334
|
-
skipNulls,
|
|
302335
|
-
encoder,
|
|
302336
|
-
filter,
|
|
302337
|
-
sort,
|
|
302338
|
-
allowDots,
|
|
302339
|
-
serializeDate,
|
|
302340
|
-
formatter,
|
|
302341
|
-
encodeValuesOnly
|
|
302342
|
-
));
|
|
302343
|
-
}
|
|
302344
|
-
}
|
|
302345
|
-
|
|
302346
|
-
return values;
|
|
302347
|
-
};
|
|
302348
|
-
|
|
302349
|
-
module.exports = function (object, opts) {
|
|
302350
|
-
var obj = object;
|
|
302351
|
-
var options = opts ? utils.assign({}, opts) : {};
|
|
302352
|
-
|
|
302353
|
-
if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') {
|
|
302354
|
-
throw new TypeError('Encoder has to be a function.');
|
|
302355
|
-
}
|
|
302356
|
-
|
|
302357
|
-
var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter;
|
|
302358
|
-
var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;
|
|
302359
|
-
var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls;
|
|
302360
|
-
var encode = typeof options.encode === 'boolean' ? options.encode : defaults.encode;
|
|
302361
|
-
var encoder = typeof options.encoder === 'function' ? options.encoder : defaults.encoder;
|
|
302362
|
-
var sort = typeof options.sort === 'function' ? options.sort : null;
|
|
302363
|
-
var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots;
|
|
302364
|
-
var serializeDate = typeof options.serializeDate === 'function' ? options.serializeDate : defaults.serializeDate;
|
|
302365
|
-
var encodeValuesOnly = typeof options.encodeValuesOnly === 'boolean' ? options.encodeValuesOnly : defaults.encodeValuesOnly;
|
|
302366
|
-
if (typeof options.format === 'undefined') {
|
|
302367
|
-
options.format = formats['default'];
|
|
302368
|
-
} else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options.format)) {
|
|
302369
|
-
throw new TypeError('Unknown format option provided.');
|
|
302370
|
-
}
|
|
302371
|
-
var formatter = formats.formatters[options.format];
|
|
302372
|
-
var objKeys;
|
|
302373
|
-
var filter;
|
|
302374
|
-
|
|
302375
|
-
if (typeof options.filter === 'function') {
|
|
302376
|
-
filter = options.filter;
|
|
302377
|
-
obj = filter('', obj);
|
|
302378
|
-
} else if (Array.isArray(options.filter)) {
|
|
302379
|
-
filter = options.filter;
|
|
302380
|
-
objKeys = filter;
|
|
302381
|
-
}
|
|
302382
|
-
|
|
302383
|
-
var keys = [];
|
|
302384
|
-
|
|
302385
|
-
if (typeof obj !== 'object' || obj === null) {
|
|
302386
|
-
return '';
|
|
302387
|
-
}
|
|
302388
|
-
|
|
302389
|
-
var arrayFormat;
|
|
302390
|
-
if (options.arrayFormat in arrayPrefixGenerators) {
|
|
302391
|
-
arrayFormat = options.arrayFormat;
|
|
302392
|
-
} else if ('indices' in options) {
|
|
302393
|
-
arrayFormat = options.indices ? 'indices' : 'repeat';
|
|
302394
|
-
} else {
|
|
302395
|
-
arrayFormat = 'indices';
|
|
302396
|
-
}
|
|
302397
|
-
|
|
302398
|
-
var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
|
|
302399
|
-
|
|
302400
|
-
if (!objKeys) {
|
|
302401
|
-
objKeys = Object.keys(obj);
|
|
302402
|
-
}
|
|
302403
|
-
|
|
302404
|
-
if (sort) {
|
|
302405
|
-
objKeys.sort(sort);
|
|
302406
|
-
}
|
|
302407
|
-
|
|
302408
|
-
for (var i = 0; i < objKeys.length; ++i) {
|
|
302409
|
-
var key = objKeys[i];
|
|
302410
|
-
|
|
302411
|
-
if (skipNulls && obj[key] === null) {
|
|
302412
|
-
continue;
|
|
302413
|
-
}
|
|
302414
|
-
|
|
302415
|
-
keys = keys.concat(stringify(
|
|
302416
|
-
obj[key],
|
|
302417
|
-
key,
|
|
302418
|
-
generateArrayPrefix,
|
|
302419
|
-
strictNullHandling,
|
|
302420
|
-
skipNulls,
|
|
302421
|
-
encode ? encoder : null,
|
|
302422
|
-
filter,
|
|
302423
|
-
sort,
|
|
302424
|
-
allowDots,
|
|
302425
|
-
serializeDate,
|
|
302426
|
-
formatter,
|
|
302427
|
-
encodeValuesOnly
|
|
302428
|
-
));
|
|
302429
|
-
}
|
|
302430
|
-
|
|
302431
|
-
var joined = keys.join(delimiter);
|
|
302432
|
-
var prefix = options.addQueryPrefix === true ? '?' : '';
|
|
302433
|
-
|
|
302434
|
-
return joined.length > 0 ? prefix + joined : '';
|
|
302435
|
-
};
|
|
302436
|
-
|
|
302437
|
-
|
|
302438
|
-
/***/ }),
|
|
302439
|
-
|
|
302440
|
-
/***/ 99240:
|
|
302441
|
-
/***/ ((module) => {
|
|
302442
|
-
|
|
302443
|
-
"use strict";
|
|
302444
|
-
|
|
302445
|
-
|
|
302446
|
-
var has = Object.prototype.hasOwnProperty;
|
|
302447
|
-
|
|
302448
|
-
var hexTable = (function () {
|
|
302449
|
-
var array = [];
|
|
302450
|
-
for (var i = 0; i < 256; ++i) {
|
|
302451
|
-
array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
|
|
302452
|
-
}
|
|
302453
|
-
|
|
302454
|
-
return array;
|
|
302455
|
-
}());
|
|
302456
|
-
|
|
302457
|
-
var compactQueue = function compactQueue(queue) {
|
|
302458
|
-
var obj;
|
|
302459
|
-
|
|
302460
|
-
while (queue.length) {
|
|
302461
|
-
var item = queue.pop();
|
|
302462
|
-
obj = item.obj[item.prop];
|
|
302463
|
-
|
|
302464
|
-
if (Array.isArray(obj)) {
|
|
302465
|
-
var compacted = [];
|
|
302466
|
-
|
|
302467
|
-
for (var j = 0; j < obj.length; ++j) {
|
|
302468
|
-
if (typeof obj[j] !== 'undefined') {
|
|
302469
|
-
compacted.push(obj[j]);
|
|
302470
|
-
}
|
|
302471
|
-
}
|
|
302472
|
-
|
|
302473
|
-
item.obj[item.prop] = compacted;
|
|
302474
|
-
}
|
|
302475
|
-
}
|
|
302476
|
-
|
|
302477
|
-
return obj;
|
|
302478
|
-
};
|
|
302479
|
-
|
|
302480
|
-
var arrayToObject = function arrayToObject(source, options) {
|
|
302481
|
-
var obj = options && options.plainObjects ? Object.create(null) : {};
|
|
302482
|
-
for (var i = 0; i < source.length; ++i) {
|
|
302483
|
-
if (typeof source[i] !== 'undefined') {
|
|
302484
|
-
obj[i] = source[i];
|
|
302485
|
-
}
|
|
302486
|
-
}
|
|
302487
|
-
|
|
302488
|
-
return obj;
|
|
302489
|
-
};
|
|
302490
|
-
|
|
302491
|
-
var merge = function merge(target, source, options) {
|
|
302492
|
-
if (!source) {
|
|
302493
|
-
return target;
|
|
302494
|
-
}
|
|
302495
|
-
|
|
302496
|
-
if (typeof source !== 'object') {
|
|
302497
|
-
if (Array.isArray(target)) {
|
|
302498
|
-
target.push(source);
|
|
302499
|
-
} else if (typeof target === 'object') {
|
|
302500
|
-
if (options.plainObjects || options.allowPrototypes || !has.call(Object.prototype, source)) {
|
|
302501
|
-
target[source] = true;
|
|
302502
|
-
}
|
|
302503
|
-
} else {
|
|
302504
|
-
return [target, source];
|
|
302505
|
-
}
|
|
302506
|
-
|
|
302507
|
-
return target;
|
|
302508
|
-
}
|
|
302509
|
-
|
|
302510
|
-
if (typeof target !== 'object') {
|
|
302511
|
-
return [target].concat(source);
|
|
302512
|
-
}
|
|
302513
|
-
|
|
302514
|
-
var mergeTarget = target;
|
|
302515
|
-
if (Array.isArray(target) && !Array.isArray(source)) {
|
|
302516
|
-
mergeTarget = arrayToObject(target, options);
|
|
302517
|
-
}
|
|
302518
|
-
|
|
302519
|
-
if (Array.isArray(target) && Array.isArray(source)) {
|
|
302520
|
-
source.forEach(function (item, i) {
|
|
302521
|
-
if (has.call(target, i)) {
|
|
302522
|
-
if (target[i] && typeof target[i] === 'object') {
|
|
302523
|
-
target[i] = merge(target[i], item, options);
|
|
302524
|
-
} else {
|
|
302525
|
-
target.push(item);
|
|
302526
|
-
}
|
|
302527
|
-
} else {
|
|
302528
|
-
target[i] = item;
|
|
302529
|
-
}
|
|
302530
|
-
});
|
|
302531
|
-
return target;
|
|
302532
|
-
}
|
|
302533
|
-
|
|
302534
|
-
return Object.keys(source).reduce(function (acc, key) {
|
|
302535
|
-
var value = source[key];
|
|
302536
|
-
|
|
302537
|
-
if (has.call(acc, key)) {
|
|
302538
|
-
acc[key] = merge(acc[key], value, options);
|
|
302539
|
-
} else {
|
|
302540
|
-
acc[key] = value;
|
|
302541
|
-
}
|
|
302542
|
-
return acc;
|
|
302543
|
-
}, mergeTarget);
|
|
302544
|
-
};
|
|
302545
|
-
|
|
302546
|
-
var assign = function assignSingleSource(target, source) {
|
|
302547
|
-
return Object.keys(source).reduce(function (acc, key) {
|
|
302548
|
-
acc[key] = source[key];
|
|
302549
|
-
return acc;
|
|
302550
|
-
}, target);
|
|
302551
|
-
};
|
|
302552
|
-
|
|
302553
|
-
var decode = function (str) {
|
|
302554
|
-
try {
|
|
302555
|
-
return decodeURIComponent(str.replace(/\+/g, ' '));
|
|
302556
|
-
} catch (e) {
|
|
302557
|
-
return str;
|
|
302558
|
-
}
|
|
302559
|
-
};
|
|
302560
|
-
|
|
302561
|
-
var encode = function encode(str) {
|
|
302562
|
-
// This code was originally written by Brian White (mscdex) for the io.js core querystring library.
|
|
302563
|
-
// It has been adapted here for stricter adherence to RFC 3986
|
|
302564
|
-
if (str.length === 0) {
|
|
302565
|
-
return str;
|
|
302566
|
-
}
|
|
302567
|
-
|
|
302568
|
-
var string = typeof str === 'string' ? str : String(str);
|
|
302569
|
-
|
|
302570
|
-
var out = '';
|
|
302571
|
-
for (var i = 0; i < string.length; ++i) {
|
|
302572
|
-
var c = string.charCodeAt(i);
|
|
302573
|
-
|
|
302574
|
-
if (
|
|
302575
|
-
c === 0x2D // -
|
|
302576
|
-
|| c === 0x2E // .
|
|
302577
|
-
|| c === 0x5F // _
|
|
302578
|
-
|| c === 0x7E // ~
|
|
302579
|
-
|| (c >= 0x30 && c <= 0x39) // 0-9
|
|
302580
|
-
|| (c >= 0x41 && c <= 0x5A) // a-z
|
|
302581
|
-
|| (c >= 0x61 && c <= 0x7A) // A-Z
|
|
302582
|
-
) {
|
|
302583
|
-
out += string.charAt(i);
|
|
302584
|
-
continue;
|
|
302585
|
-
}
|
|
302586
|
-
|
|
302587
|
-
if (c < 0x80) {
|
|
302588
|
-
out = out + hexTable[c];
|
|
302589
|
-
continue;
|
|
302590
|
-
}
|
|
302591
|
-
|
|
302592
|
-
if (c < 0x800) {
|
|
302593
|
-
out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
|
|
302594
|
-
continue;
|
|
302595
|
-
}
|
|
302596
|
-
|
|
302597
|
-
if (c < 0xD800 || c >= 0xE000) {
|
|
302598
|
-
out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
|
|
302599
|
-
continue;
|
|
302600
|
-
}
|
|
302601
|
-
|
|
302602
|
-
i += 1;
|
|
302603
|
-
c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
|
|
302604
|
-
out += hexTable[0xF0 | (c >> 18)]
|
|
302605
|
-
+ hexTable[0x80 | ((c >> 12) & 0x3F)]
|
|
302606
|
-
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
|
|
302607
|
-
+ hexTable[0x80 | (c & 0x3F)];
|
|
302608
|
-
}
|
|
302609
|
-
|
|
302610
|
-
return out;
|
|
302611
|
-
};
|
|
302612
|
-
|
|
302613
|
-
var compact = function compact(value) {
|
|
302614
|
-
var queue = [{ obj: { o: value }, prop: 'o' }];
|
|
302615
|
-
var refs = [];
|
|
302616
|
-
|
|
302617
|
-
for (var i = 0; i < queue.length; ++i) {
|
|
302618
|
-
var item = queue[i];
|
|
302619
|
-
var obj = item.obj[item.prop];
|
|
302620
|
-
|
|
302621
|
-
var keys = Object.keys(obj);
|
|
302622
|
-
for (var j = 0; j < keys.length; ++j) {
|
|
302623
|
-
var key = keys[j];
|
|
302624
|
-
var val = obj[key];
|
|
302625
|
-
if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
|
|
302626
|
-
queue.push({ obj: obj, prop: key });
|
|
302627
|
-
refs.push(val);
|
|
302628
|
-
}
|
|
302629
|
-
}
|
|
302630
|
-
}
|
|
302631
|
-
|
|
302632
|
-
return compactQueue(queue);
|
|
302633
|
-
};
|
|
302634
|
-
|
|
302635
|
-
var isRegExp = function isRegExp(obj) {
|
|
302636
|
-
return Object.prototype.toString.call(obj) === '[object RegExp]';
|
|
302637
|
-
};
|
|
302638
|
-
|
|
302639
|
-
var isBuffer = function isBuffer(obj) {
|
|
302640
|
-
if (obj === null || typeof obj === 'undefined') {
|
|
302641
|
-
return false;
|
|
302642
|
-
}
|
|
302643
|
-
|
|
302644
|
-
return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
|
|
302645
|
-
};
|
|
302646
|
-
|
|
302647
|
-
module.exports = {
|
|
302648
|
-
arrayToObject: arrayToObject,
|
|
302649
|
-
assign: assign,
|
|
302650
|
-
compact: compact,
|
|
302651
|
-
decode: decode,
|
|
302652
|
-
encode: encode,
|
|
302653
|
-
isBuffer: isBuffer,
|
|
302654
|
-
isRegExp: isRegExp,
|
|
302655
|
-
merge: merge
|
|
302656
|
-
};
|
|
302657
|
-
|
|
302658
|
-
|
|
302659
302371
|
/***/ }),
|
|
302660
302372
|
|
|
302661
302373
|
/***/ 5074:
|
|
@@ -303959,7 +303671,7 @@ exports.$ = Multipart
|
|
|
303959
303671
|
|
|
303960
303672
|
|
|
303961
303673
|
var url = __nccwpck_require__(57310)
|
|
303962
|
-
var qs = __nccwpck_require__(
|
|
303674
|
+
var qs = __nccwpck_require__(41746)
|
|
303963
303675
|
var caseless = __nccwpck_require__(30071)
|
|
303964
303676
|
var uuid = __nccwpck_require__(79180)
|
|
303965
303677
|
var oauth = __nccwpck_require__(91579)
|
|
@@ -304114,7 +303826,7 @@ exports.f = OAuth
|
|
|
304114
303826
|
"use strict";
|
|
304115
303827
|
|
|
304116
303828
|
|
|
304117
|
-
var qs = __nccwpck_require__(
|
|
303829
|
+
var qs = __nccwpck_require__(41746)
|
|
304118
303830
|
var querystring = __nccwpck_require__(63477)
|
|
304119
303831
|
|
|
304120
303832
|
function Querystring (request) {
|
|
@@ -304990,6 +304702,672 @@ module.exports = function(dst, src) {
|
|
|
304990
304702
|
};
|
|
304991
304703
|
|
|
304992
304704
|
|
|
304705
|
+
/***/ }),
|
|
304706
|
+
|
|
304707
|
+
/***/ 98876:
|
|
304708
|
+
/***/ ((module) => {
|
|
304709
|
+
|
|
304710
|
+
"use strict";
|
|
304711
|
+
|
|
304712
|
+
|
|
304713
|
+
var replace = String.prototype.replace;
|
|
304714
|
+
var percentTwenties = /%20/g;
|
|
304715
|
+
|
|
304716
|
+
module.exports = {
|
|
304717
|
+
'default': 'RFC3986',
|
|
304718
|
+
formatters: {
|
|
304719
|
+
RFC1738: function (value) {
|
|
304720
|
+
return replace.call(value, percentTwenties, '+');
|
|
304721
|
+
},
|
|
304722
|
+
RFC3986: function (value) {
|
|
304723
|
+
return value;
|
|
304724
|
+
}
|
|
304725
|
+
},
|
|
304726
|
+
RFC1738: 'RFC1738',
|
|
304727
|
+
RFC3986: 'RFC3986'
|
|
304728
|
+
};
|
|
304729
|
+
|
|
304730
|
+
|
|
304731
|
+
/***/ }),
|
|
304732
|
+
|
|
304733
|
+
/***/ 41746:
|
|
304734
|
+
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
304735
|
+
|
|
304736
|
+
"use strict";
|
|
304737
|
+
|
|
304738
|
+
|
|
304739
|
+
var stringify = __nccwpck_require__(44901);
|
|
304740
|
+
var parse = __nccwpck_require__(78832);
|
|
304741
|
+
var formats = __nccwpck_require__(98876);
|
|
304742
|
+
|
|
304743
|
+
module.exports = {
|
|
304744
|
+
formats: formats,
|
|
304745
|
+
parse: parse,
|
|
304746
|
+
stringify: stringify
|
|
304747
|
+
};
|
|
304748
|
+
|
|
304749
|
+
|
|
304750
|
+
/***/ }),
|
|
304751
|
+
|
|
304752
|
+
/***/ 78832:
|
|
304753
|
+
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
304754
|
+
|
|
304755
|
+
"use strict";
|
|
304756
|
+
|
|
304757
|
+
|
|
304758
|
+
var utils = __nccwpck_require__(8980);
|
|
304759
|
+
|
|
304760
|
+
var has = Object.prototype.hasOwnProperty;
|
|
304761
|
+
|
|
304762
|
+
var defaults = {
|
|
304763
|
+
allowDots: false,
|
|
304764
|
+
allowPrototypes: false,
|
|
304765
|
+
arrayLimit: 20,
|
|
304766
|
+
decoder: utils.decode,
|
|
304767
|
+
delimiter: '&',
|
|
304768
|
+
depth: 5,
|
|
304769
|
+
parameterLimit: 1000,
|
|
304770
|
+
plainObjects: false,
|
|
304771
|
+
strictNullHandling: false
|
|
304772
|
+
};
|
|
304773
|
+
|
|
304774
|
+
var parseValues = function parseQueryStringValues(str, options) {
|
|
304775
|
+
var obj = {};
|
|
304776
|
+
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
|
|
304777
|
+
var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
|
|
304778
|
+
var parts = cleanStr.split(options.delimiter, limit);
|
|
304779
|
+
|
|
304780
|
+
for (var i = 0; i < parts.length; ++i) {
|
|
304781
|
+
var part = parts[i];
|
|
304782
|
+
|
|
304783
|
+
var bracketEqualsPos = part.indexOf(']=');
|
|
304784
|
+
var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
|
|
304785
|
+
|
|
304786
|
+
var key, val;
|
|
304787
|
+
if (pos === -1) {
|
|
304788
|
+
key = options.decoder(part, defaults.decoder);
|
|
304789
|
+
val = options.strictNullHandling ? null : '';
|
|
304790
|
+
} else {
|
|
304791
|
+
key = options.decoder(part.slice(0, pos), defaults.decoder);
|
|
304792
|
+
val = options.decoder(part.slice(pos + 1), defaults.decoder);
|
|
304793
|
+
}
|
|
304794
|
+
if (has.call(obj, key)) {
|
|
304795
|
+
obj[key] = [].concat(obj[key]).concat(val);
|
|
304796
|
+
} else {
|
|
304797
|
+
obj[key] = val;
|
|
304798
|
+
}
|
|
304799
|
+
}
|
|
304800
|
+
|
|
304801
|
+
return obj;
|
|
304802
|
+
};
|
|
304803
|
+
|
|
304804
|
+
var parseObject = function (chain, val, options) {
|
|
304805
|
+
var leaf = val;
|
|
304806
|
+
|
|
304807
|
+
for (var i = chain.length - 1; i >= 0; --i) {
|
|
304808
|
+
var obj;
|
|
304809
|
+
var root = chain[i];
|
|
304810
|
+
|
|
304811
|
+
if (root === '[]') {
|
|
304812
|
+
obj = [];
|
|
304813
|
+
obj = obj.concat(leaf);
|
|
304814
|
+
} else {
|
|
304815
|
+
obj = options.plainObjects ? Object.create(null) : {};
|
|
304816
|
+
var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
|
|
304817
|
+
var index = parseInt(cleanRoot, 10);
|
|
304818
|
+
if (
|
|
304819
|
+
!isNaN(index)
|
|
304820
|
+
&& root !== cleanRoot
|
|
304821
|
+
&& String(index) === cleanRoot
|
|
304822
|
+
&& index >= 0
|
|
304823
|
+
&& (options.parseArrays && index <= options.arrayLimit)
|
|
304824
|
+
) {
|
|
304825
|
+
obj = [];
|
|
304826
|
+
obj[index] = leaf;
|
|
304827
|
+
} else {
|
|
304828
|
+
obj[cleanRoot] = leaf;
|
|
304829
|
+
}
|
|
304830
|
+
}
|
|
304831
|
+
|
|
304832
|
+
leaf = obj;
|
|
304833
|
+
}
|
|
304834
|
+
|
|
304835
|
+
return leaf;
|
|
304836
|
+
};
|
|
304837
|
+
|
|
304838
|
+
var parseKeys = function parseQueryStringKeys(givenKey, val, options) {
|
|
304839
|
+
if (!givenKey) {
|
|
304840
|
+
return;
|
|
304841
|
+
}
|
|
304842
|
+
|
|
304843
|
+
// Transform dot notation to bracket notation
|
|
304844
|
+
var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
|
|
304845
|
+
|
|
304846
|
+
// The regex chunks
|
|
304847
|
+
|
|
304848
|
+
var brackets = /(\[[^[\]]*])/;
|
|
304849
|
+
var child = /(\[[^[\]]*])/g;
|
|
304850
|
+
|
|
304851
|
+
// Get the parent
|
|
304852
|
+
|
|
304853
|
+
var segment = brackets.exec(key);
|
|
304854
|
+
var parent = segment ? key.slice(0, segment.index) : key;
|
|
304855
|
+
|
|
304856
|
+
// Stash the parent if it exists
|
|
304857
|
+
|
|
304858
|
+
var keys = [];
|
|
304859
|
+
if (parent) {
|
|
304860
|
+
// If we aren't using plain objects, optionally prefix keys
|
|
304861
|
+
// that would overwrite object prototype properties
|
|
304862
|
+
if (!options.plainObjects && has.call(Object.prototype, parent)) {
|
|
304863
|
+
if (!options.allowPrototypes) {
|
|
304864
|
+
return;
|
|
304865
|
+
}
|
|
304866
|
+
}
|
|
304867
|
+
|
|
304868
|
+
keys.push(parent);
|
|
304869
|
+
}
|
|
304870
|
+
|
|
304871
|
+
// Loop through children appending to the array until we hit depth
|
|
304872
|
+
|
|
304873
|
+
var i = 0;
|
|
304874
|
+
while ((segment = child.exec(key)) !== null && i < options.depth) {
|
|
304875
|
+
i += 1;
|
|
304876
|
+
if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
|
|
304877
|
+
if (!options.allowPrototypes) {
|
|
304878
|
+
return;
|
|
304879
|
+
}
|
|
304880
|
+
}
|
|
304881
|
+
keys.push(segment[1]);
|
|
304882
|
+
}
|
|
304883
|
+
|
|
304884
|
+
// If there's a remainder, just add whatever is left
|
|
304885
|
+
|
|
304886
|
+
if (segment) {
|
|
304887
|
+
keys.push('[' + key.slice(segment.index) + ']');
|
|
304888
|
+
}
|
|
304889
|
+
|
|
304890
|
+
return parseObject(keys, val, options);
|
|
304891
|
+
};
|
|
304892
|
+
|
|
304893
|
+
module.exports = function (str, opts) {
|
|
304894
|
+
var options = opts ? utils.assign({}, opts) : {};
|
|
304895
|
+
|
|
304896
|
+
if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') {
|
|
304897
|
+
throw new TypeError('Decoder has to be a function.');
|
|
304898
|
+
}
|
|
304899
|
+
|
|
304900
|
+
options.ignoreQueryPrefix = options.ignoreQueryPrefix === true;
|
|
304901
|
+
options.delimiter = typeof options.delimiter === 'string' || utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter;
|
|
304902
|
+
options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth;
|
|
304903
|
+
options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit;
|
|
304904
|
+
options.parseArrays = options.parseArrays !== false;
|
|
304905
|
+
options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults.decoder;
|
|
304906
|
+
options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults.allowDots;
|
|
304907
|
+
options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults.plainObjects;
|
|
304908
|
+
options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes;
|
|
304909
|
+
options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit;
|
|
304910
|
+
options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;
|
|
304911
|
+
|
|
304912
|
+
if (str === '' || str === null || typeof str === 'undefined') {
|
|
304913
|
+
return options.plainObjects ? Object.create(null) : {};
|
|
304914
|
+
}
|
|
304915
|
+
|
|
304916
|
+
var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
|
|
304917
|
+
var obj = options.plainObjects ? Object.create(null) : {};
|
|
304918
|
+
|
|
304919
|
+
// Iterate over the keys and setup the new object
|
|
304920
|
+
|
|
304921
|
+
var keys = Object.keys(tempObj);
|
|
304922
|
+
for (var i = 0; i < keys.length; ++i) {
|
|
304923
|
+
var key = keys[i];
|
|
304924
|
+
var newObj = parseKeys(key, tempObj[key], options);
|
|
304925
|
+
obj = utils.merge(obj, newObj, options);
|
|
304926
|
+
}
|
|
304927
|
+
|
|
304928
|
+
return utils.compact(obj);
|
|
304929
|
+
};
|
|
304930
|
+
|
|
304931
|
+
|
|
304932
|
+
/***/ }),
|
|
304933
|
+
|
|
304934
|
+
/***/ 44901:
|
|
304935
|
+
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
304936
|
+
|
|
304937
|
+
"use strict";
|
|
304938
|
+
|
|
304939
|
+
|
|
304940
|
+
var utils = __nccwpck_require__(8980);
|
|
304941
|
+
var formats = __nccwpck_require__(98876);
|
|
304942
|
+
|
|
304943
|
+
var arrayPrefixGenerators = {
|
|
304944
|
+
brackets: function brackets(prefix) { // eslint-disable-line func-name-matching
|
|
304945
|
+
return prefix + '[]';
|
|
304946
|
+
},
|
|
304947
|
+
indices: function indices(prefix, key) { // eslint-disable-line func-name-matching
|
|
304948
|
+
return prefix + '[' + key + ']';
|
|
304949
|
+
},
|
|
304950
|
+
repeat: function repeat(prefix) { // eslint-disable-line func-name-matching
|
|
304951
|
+
return prefix;
|
|
304952
|
+
}
|
|
304953
|
+
};
|
|
304954
|
+
|
|
304955
|
+
var toISO = Date.prototype.toISOString;
|
|
304956
|
+
|
|
304957
|
+
var defaults = {
|
|
304958
|
+
delimiter: '&',
|
|
304959
|
+
encode: true,
|
|
304960
|
+
encoder: utils.encode,
|
|
304961
|
+
encodeValuesOnly: false,
|
|
304962
|
+
serializeDate: function serializeDate(date) { // eslint-disable-line func-name-matching
|
|
304963
|
+
return toISO.call(date);
|
|
304964
|
+
},
|
|
304965
|
+
skipNulls: false,
|
|
304966
|
+
strictNullHandling: false
|
|
304967
|
+
};
|
|
304968
|
+
|
|
304969
|
+
var stringify = function stringify( // eslint-disable-line func-name-matching
|
|
304970
|
+
object,
|
|
304971
|
+
prefix,
|
|
304972
|
+
generateArrayPrefix,
|
|
304973
|
+
strictNullHandling,
|
|
304974
|
+
skipNulls,
|
|
304975
|
+
encoder,
|
|
304976
|
+
filter,
|
|
304977
|
+
sort,
|
|
304978
|
+
allowDots,
|
|
304979
|
+
serializeDate,
|
|
304980
|
+
formatter,
|
|
304981
|
+
encodeValuesOnly
|
|
304982
|
+
) {
|
|
304983
|
+
var obj = object;
|
|
304984
|
+
if (typeof filter === 'function') {
|
|
304985
|
+
obj = filter(prefix, obj);
|
|
304986
|
+
} else if (obj instanceof Date) {
|
|
304987
|
+
obj = serializeDate(obj);
|
|
304988
|
+
} else if (obj === null) {
|
|
304989
|
+
if (strictNullHandling) {
|
|
304990
|
+
return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder) : prefix;
|
|
304991
|
+
}
|
|
304992
|
+
|
|
304993
|
+
obj = '';
|
|
304994
|
+
}
|
|
304995
|
+
|
|
304996
|
+
if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) {
|
|
304997
|
+
if (encoder) {
|
|
304998
|
+
var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder);
|
|
304999
|
+
return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder))];
|
|
305000
|
+
}
|
|
305001
|
+
return [formatter(prefix) + '=' + formatter(String(obj))];
|
|
305002
|
+
}
|
|
305003
|
+
|
|
305004
|
+
var values = [];
|
|
305005
|
+
|
|
305006
|
+
if (typeof obj === 'undefined') {
|
|
305007
|
+
return values;
|
|
305008
|
+
}
|
|
305009
|
+
|
|
305010
|
+
var objKeys;
|
|
305011
|
+
if (Array.isArray(filter)) {
|
|
305012
|
+
objKeys = filter;
|
|
305013
|
+
} else {
|
|
305014
|
+
var keys = Object.keys(obj);
|
|
305015
|
+
objKeys = sort ? keys.sort(sort) : keys;
|
|
305016
|
+
}
|
|
305017
|
+
|
|
305018
|
+
for (var i = 0; i < objKeys.length; ++i) {
|
|
305019
|
+
var key = objKeys[i];
|
|
305020
|
+
|
|
305021
|
+
if (skipNulls && obj[key] === null) {
|
|
305022
|
+
continue;
|
|
305023
|
+
}
|
|
305024
|
+
|
|
305025
|
+
if (Array.isArray(obj)) {
|
|
305026
|
+
values = values.concat(stringify(
|
|
305027
|
+
obj[key],
|
|
305028
|
+
generateArrayPrefix(prefix, key),
|
|
305029
|
+
generateArrayPrefix,
|
|
305030
|
+
strictNullHandling,
|
|
305031
|
+
skipNulls,
|
|
305032
|
+
encoder,
|
|
305033
|
+
filter,
|
|
305034
|
+
sort,
|
|
305035
|
+
allowDots,
|
|
305036
|
+
serializeDate,
|
|
305037
|
+
formatter,
|
|
305038
|
+
encodeValuesOnly
|
|
305039
|
+
));
|
|
305040
|
+
} else {
|
|
305041
|
+
values = values.concat(stringify(
|
|
305042
|
+
obj[key],
|
|
305043
|
+
prefix + (allowDots ? '.' + key : '[' + key + ']'),
|
|
305044
|
+
generateArrayPrefix,
|
|
305045
|
+
strictNullHandling,
|
|
305046
|
+
skipNulls,
|
|
305047
|
+
encoder,
|
|
305048
|
+
filter,
|
|
305049
|
+
sort,
|
|
305050
|
+
allowDots,
|
|
305051
|
+
serializeDate,
|
|
305052
|
+
formatter,
|
|
305053
|
+
encodeValuesOnly
|
|
305054
|
+
));
|
|
305055
|
+
}
|
|
305056
|
+
}
|
|
305057
|
+
|
|
305058
|
+
return values;
|
|
305059
|
+
};
|
|
305060
|
+
|
|
305061
|
+
module.exports = function (object, opts) {
|
|
305062
|
+
var obj = object;
|
|
305063
|
+
var options = opts ? utils.assign({}, opts) : {};
|
|
305064
|
+
|
|
305065
|
+
if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') {
|
|
305066
|
+
throw new TypeError('Encoder has to be a function.');
|
|
305067
|
+
}
|
|
305068
|
+
|
|
305069
|
+
var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter;
|
|
305070
|
+
var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;
|
|
305071
|
+
var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls;
|
|
305072
|
+
var encode = typeof options.encode === 'boolean' ? options.encode : defaults.encode;
|
|
305073
|
+
var encoder = typeof options.encoder === 'function' ? options.encoder : defaults.encoder;
|
|
305074
|
+
var sort = typeof options.sort === 'function' ? options.sort : null;
|
|
305075
|
+
var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots;
|
|
305076
|
+
var serializeDate = typeof options.serializeDate === 'function' ? options.serializeDate : defaults.serializeDate;
|
|
305077
|
+
var encodeValuesOnly = typeof options.encodeValuesOnly === 'boolean' ? options.encodeValuesOnly : defaults.encodeValuesOnly;
|
|
305078
|
+
if (typeof options.format === 'undefined') {
|
|
305079
|
+
options.format = formats['default'];
|
|
305080
|
+
} else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options.format)) {
|
|
305081
|
+
throw new TypeError('Unknown format option provided.');
|
|
305082
|
+
}
|
|
305083
|
+
var formatter = formats.formatters[options.format];
|
|
305084
|
+
var objKeys;
|
|
305085
|
+
var filter;
|
|
305086
|
+
|
|
305087
|
+
if (typeof options.filter === 'function') {
|
|
305088
|
+
filter = options.filter;
|
|
305089
|
+
obj = filter('', obj);
|
|
305090
|
+
} else if (Array.isArray(options.filter)) {
|
|
305091
|
+
filter = options.filter;
|
|
305092
|
+
objKeys = filter;
|
|
305093
|
+
}
|
|
305094
|
+
|
|
305095
|
+
var keys = [];
|
|
305096
|
+
|
|
305097
|
+
if (typeof obj !== 'object' || obj === null) {
|
|
305098
|
+
return '';
|
|
305099
|
+
}
|
|
305100
|
+
|
|
305101
|
+
var arrayFormat;
|
|
305102
|
+
if (options.arrayFormat in arrayPrefixGenerators) {
|
|
305103
|
+
arrayFormat = options.arrayFormat;
|
|
305104
|
+
} else if ('indices' in options) {
|
|
305105
|
+
arrayFormat = options.indices ? 'indices' : 'repeat';
|
|
305106
|
+
} else {
|
|
305107
|
+
arrayFormat = 'indices';
|
|
305108
|
+
}
|
|
305109
|
+
|
|
305110
|
+
var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
|
|
305111
|
+
|
|
305112
|
+
if (!objKeys) {
|
|
305113
|
+
objKeys = Object.keys(obj);
|
|
305114
|
+
}
|
|
305115
|
+
|
|
305116
|
+
if (sort) {
|
|
305117
|
+
objKeys.sort(sort);
|
|
305118
|
+
}
|
|
305119
|
+
|
|
305120
|
+
for (var i = 0; i < objKeys.length; ++i) {
|
|
305121
|
+
var key = objKeys[i];
|
|
305122
|
+
|
|
305123
|
+
if (skipNulls && obj[key] === null) {
|
|
305124
|
+
continue;
|
|
305125
|
+
}
|
|
305126
|
+
|
|
305127
|
+
keys = keys.concat(stringify(
|
|
305128
|
+
obj[key],
|
|
305129
|
+
key,
|
|
305130
|
+
generateArrayPrefix,
|
|
305131
|
+
strictNullHandling,
|
|
305132
|
+
skipNulls,
|
|
305133
|
+
encode ? encoder : null,
|
|
305134
|
+
filter,
|
|
305135
|
+
sort,
|
|
305136
|
+
allowDots,
|
|
305137
|
+
serializeDate,
|
|
305138
|
+
formatter,
|
|
305139
|
+
encodeValuesOnly
|
|
305140
|
+
));
|
|
305141
|
+
}
|
|
305142
|
+
|
|
305143
|
+
var joined = keys.join(delimiter);
|
|
305144
|
+
var prefix = options.addQueryPrefix === true ? '?' : '';
|
|
305145
|
+
|
|
305146
|
+
return joined.length > 0 ? prefix + joined : '';
|
|
305147
|
+
};
|
|
305148
|
+
|
|
305149
|
+
|
|
305150
|
+
/***/ }),
|
|
305151
|
+
|
|
305152
|
+
/***/ 8980:
|
|
305153
|
+
/***/ ((module) => {
|
|
305154
|
+
|
|
305155
|
+
"use strict";
|
|
305156
|
+
|
|
305157
|
+
|
|
305158
|
+
var has = Object.prototype.hasOwnProperty;
|
|
305159
|
+
|
|
305160
|
+
var hexTable = (function () {
|
|
305161
|
+
var array = [];
|
|
305162
|
+
for (var i = 0; i < 256; ++i) {
|
|
305163
|
+
array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
|
|
305164
|
+
}
|
|
305165
|
+
|
|
305166
|
+
return array;
|
|
305167
|
+
}());
|
|
305168
|
+
|
|
305169
|
+
var compactQueue = function compactQueue(queue) {
|
|
305170
|
+
var obj;
|
|
305171
|
+
|
|
305172
|
+
while (queue.length) {
|
|
305173
|
+
var item = queue.pop();
|
|
305174
|
+
obj = item.obj[item.prop];
|
|
305175
|
+
|
|
305176
|
+
if (Array.isArray(obj)) {
|
|
305177
|
+
var compacted = [];
|
|
305178
|
+
|
|
305179
|
+
for (var j = 0; j < obj.length; ++j) {
|
|
305180
|
+
if (typeof obj[j] !== 'undefined') {
|
|
305181
|
+
compacted.push(obj[j]);
|
|
305182
|
+
}
|
|
305183
|
+
}
|
|
305184
|
+
|
|
305185
|
+
item.obj[item.prop] = compacted;
|
|
305186
|
+
}
|
|
305187
|
+
}
|
|
305188
|
+
|
|
305189
|
+
return obj;
|
|
305190
|
+
};
|
|
305191
|
+
|
|
305192
|
+
var arrayToObject = function arrayToObject(source, options) {
|
|
305193
|
+
var obj = options && options.plainObjects ? Object.create(null) : {};
|
|
305194
|
+
for (var i = 0; i < source.length; ++i) {
|
|
305195
|
+
if (typeof source[i] !== 'undefined') {
|
|
305196
|
+
obj[i] = source[i];
|
|
305197
|
+
}
|
|
305198
|
+
}
|
|
305199
|
+
|
|
305200
|
+
return obj;
|
|
305201
|
+
};
|
|
305202
|
+
|
|
305203
|
+
var merge = function merge(target, source, options) {
|
|
305204
|
+
if (!source) {
|
|
305205
|
+
return target;
|
|
305206
|
+
}
|
|
305207
|
+
|
|
305208
|
+
if (typeof source !== 'object') {
|
|
305209
|
+
if (Array.isArray(target)) {
|
|
305210
|
+
target.push(source);
|
|
305211
|
+
} else if (typeof target === 'object') {
|
|
305212
|
+
if (options.plainObjects || options.allowPrototypes || !has.call(Object.prototype, source)) {
|
|
305213
|
+
target[source] = true;
|
|
305214
|
+
}
|
|
305215
|
+
} else {
|
|
305216
|
+
return [target, source];
|
|
305217
|
+
}
|
|
305218
|
+
|
|
305219
|
+
return target;
|
|
305220
|
+
}
|
|
305221
|
+
|
|
305222
|
+
if (typeof target !== 'object') {
|
|
305223
|
+
return [target].concat(source);
|
|
305224
|
+
}
|
|
305225
|
+
|
|
305226
|
+
var mergeTarget = target;
|
|
305227
|
+
if (Array.isArray(target) && !Array.isArray(source)) {
|
|
305228
|
+
mergeTarget = arrayToObject(target, options);
|
|
305229
|
+
}
|
|
305230
|
+
|
|
305231
|
+
if (Array.isArray(target) && Array.isArray(source)) {
|
|
305232
|
+
source.forEach(function (item, i) {
|
|
305233
|
+
if (has.call(target, i)) {
|
|
305234
|
+
if (target[i] && typeof target[i] === 'object') {
|
|
305235
|
+
target[i] = merge(target[i], item, options);
|
|
305236
|
+
} else {
|
|
305237
|
+
target.push(item);
|
|
305238
|
+
}
|
|
305239
|
+
} else {
|
|
305240
|
+
target[i] = item;
|
|
305241
|
+
}
|
|
305242
|
+
});
|
|
305243
|
+
return target;
|
|
305244
|
+
}
|
|
305245
|
+
|
|
305246
|
+
return Object.keys(source).reduce(function (acc, key) {
|
|
305247
|
+
var value = source[key];
|
|
305248
|
+
|
|
305249
|
+
if (has.call(acc, key)) {
|
|
305250
|
+
acc[key] = merge(acc[key], value, options);
|
|
305251
|
+
} else {
|
|
305252
|
+
acc[key] = value;
|
|
305253
|
+
}
|
|
305254
|
+
return acc;
|
|
305255
|
+
}, mergeTarget);
|
|
305256
|
+
};
|
|
305257
|
+
|
|
305258
|
+
var assign = function assignSingleSource(target, source) {
|
|
305259
|
+
return Object.keys(source).reduce(function (acc, key) {
|
|
305260
|
+
acc[key] = source[key];
|
|
305261
|
+
return acc;
|
|
305262
|
+
}, target);
|
|
305263
|
+
};
|
|
305264
|
+
|
|
305265
|
+
var decode = function (str) {
|
|
305266
|
+
try {
|
|
305267
|
+
return decodeURIComponent(str.replace(/\+/g, ' '));
|
|
305268
|
+
} catch (e) {
|
|
305269
|
+
return str;
|
|
305270
|
+
}
|
|
305271
|
+
};
|
|
305272
|
+
|
|
305273
|
+
var encode = function encode(str) {
|
|
305274
|
+
// This code was originally written by Brian White (mscdex) for the io.js core querystring library.
|
|
305275
|
+
// It has been adapted here for stricter adherence to RFC 3986
|
|
305276
|
+
if (str.length === 0) {
|
|
305277
|
+
return str;
|
|
305278
|
+
}
|
|
305279
|
+
|
|
305280
|
+
var string = typeof str === 'string' ? str : String(str);
|
|
305281
|
+
|
|
305282
|
+
var out = '';
|
|
305283
|
+
for (var i = 0; i < string.length; ++i) {
|
|
305284
|
+
var c = string.charCodeAt(i);
|
|
305285
|
+
|
|
305286
|
+
if (
|
|
305287
|
+
c === 0x2D // -
|
|
305288
|
+
|| c === 0x2E // .
|
|
305289
|
+
|| c === 0x5F // _
|
|
305290
|
+
|| c === 0x7E // ~
|
|
305291
|
+
|| (c >= 0x30 && c <= 0x39) // 0-9
|
|
305292
|
+
|| (c >= 0x41 && c <= 0x5A) // a-z
|
|
305293
|
+
|| (c >= 0x61 && c <= 0x7A) // A-Z
|
|
305294
|
+
) {
|
|
305295
|
+
out += string.charAt(i);
|
|
305296
|
+
continue;
|
|
305297
|
+
}
|
|
305298
|
+
|
|
305299
|
+
if (c < 0x80) {
|
|
305300
|
+
out = out + hexTable[c];
|
|
305301
|
+
continue;
|
|
305302
|
+
}
|
|
305303
|
+
|
|
305304
|
+
if (c < 0x800) {
|
|
305305
|
+
out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
|
|
305306
|
+
continue;
|
|
305307
|
+
}
|
|
305308
|
+
|
|
305309
|
+
if (c < 0xD800 || c >= 0xE000) {
|
|
305310
|
+
out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
|
|
305311
|
+
continue;
|
|
305312
|
+
}
|
|
305313
|
+
|
|
305314
|
+
i += 1;
|
|
305315
|
+
c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
|
|
305316
|
+
out += hexTable[0xF0 | (c >> 18)]
|
|
305317
|
+
+ hexTable[0x80 | ((c >> 12) & 0x3F)]
|
|
305318
|
+
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
|
|
305319
|
+
+ hexTable[0x80 | (c & 0x3F)];
|
|
305320
|
+
}
|
|
305321
|
+
|
|
305322
|
+
return out;
|
|
305323
|
+
};
|
|
305324
|
+
|
|
305325
|
+
var compact = function compact(value) {
|
|
305326
|
+
var queue = [{ obj: { o: value }, prop: 'o' }];
|
|
305327
|
+
var refs = [];
|
|
305328
|
+
|
|
305329
|
+
for (var i = 0; i < queue.length; ++i) {
|
|
305330
|
+
var item = queue[i];
|
|
305331
|
+
var obj = item.obj[item.prop];
|
|
305332
|
+
|
|
305333
|
+
var keys = Object.keys(obj);
|
|
305334
|
+
for (var j = 0; j < keys.length; ++j) {
|
|
305335
|
+
var key = keys[j];
|
|
305336
|
+
var val = obj[key];
|
|
305337
|
+
if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
|
|
305338
|
+
queue.push({ obj: obj, prop: key });
|
|
305339
|
+
refs.push(val);
|
|
305340
|
+
}
|
|
305341
|
+
}
|
|
305342
|
+
}
|
|
305343
|
+
|
|
305344
|
+
return compactQueue(queue);
|
|
305345
|
+
};
|
|
305346
|
+
|
|
305347
|
+
var isRegExp = function isRegExp(obj) {
|
|
305348
|
+
return Object.prototype.toString.call(obj) === '[object RegExp]';
|
|
305349
|
+
};
|
|
305350
|
+
|
|
305351
|
+
var isBuffer = function isBuffer(obj) {
|
|
305352
|
+
if (obj === null || typeof obj === 'undefined') {
|
|
305353
|
+
return false;
|
|
305354
|
+
}
|
|
305355
|
+
|
|
305356
|
+
return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
|
|
305357
|
+
};
|
|
305358
|
+
|
|
305359
|
+
module.exports = {
|
|
305360
|
+
arrayToObject: arrayToObject,
|
|
305361
|
+
assign: assign,
|
|
305362
|
+
compact: compact,
|
|
305363
|
+
decode: decode,
|
|
305364
|
+
encode: encode,
|
|
305365
|
+
isBuffer: isBuffer,
|
|
305366
|
+
isRegExp: isRegExp,
|
|
305367
|
+
merge: merge
|
|
305368
|
+
};
|
|
305369
|
+
|
|
305370
|
+
|
|
304993
305371
|
/***/ }),
|
|
304994
305372
|
|
|
304995
305373
|
/***/ 97336:
|
|
@@ -355470,7 +355848,7 @@ exports.readConfigSync = readConfigSync;
|
|
|
355470
355848
|
|
|
355471
355849
|
exports.__esModule = true;
|
|
355472
355850
|
exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
|
|
355473
|
-
exports.PIPELINE_IMAGE_TAG = "main-
|
|
355851
|
+
exports.PIPELINE_IMAGE_TAG = "main-a717e2de" || 0;
|
|
355474
355852
|
exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
|
|
355475
355853
|
|
|
355476
355854
|
/***/ }),
|
|
@@ -357486,7 +357864,8 @@ var getServiceDeployScript = function (context, service, nameSuffix) {
|
|
|
357486
357864
|
memory: customConfig === null || customConfig === void 0 ? void 0 : customConfig.memory,
|
|
357487
357865
|
"allow-unauthenticated": (_d = customConfig === null || customConfig === void 0 ? void 0 : customConfig.allowUnauthenticated) !== null && _d !== void 0 ? _d : true,
|
|
357488
357866
|
ingress: (_e = customConfig === null || customConfig === void 0 ? void 0 : customConfig.ingress) !== null && _e !== void 0 ? _e : "all",
|
|
357489
|
-
"cpu-boost": true
|
|
357867
|
+
"cpu-boost": true,
|
|
357868
|
+
"execution-environment": customConfig === null || customConfig === void 0 ? void 0 : customConfig.executionEnvironment
|
|
357490
357869
|
}));
|
|
357491
357870
|
return "".concat((0, common_1.gcloudRunCmd)(), " deploy ").concat(fullServiceName, " ").concat(argsString);
|
|
357492
357871
|
};
|
|
@@ -361260,6 +361639,14 @@ module.exports = require("fs");
|
|
|
361260
361639
|
|
|
361261
361640
|
/***/ }),
|
|
361262
361641
|
|
|
361642
|
+
/***/ 73292:
|
|
361643
|
+
/***/ ((module) => {
|
|
361644
|
+
|
|
361645
|
+
"use strict";
|
|
361646
|
+
module.exports = require("fs/promises");
|
|
361647
|
+
|
|
361648
|
+
/***/ }),
|
|
361649
|
+
|
|
361263
361650
|
/***/ 13685:
|
|
361264
361651
|
/***/ ((module) => {
|
|
361265
361652
|
|
|
@@ -361420,6 +361807,725 @@ module.exports = require("zlib");
|
|
|
361420
361807
|
|
|
361421
361808
|
/***/ }),
|
|
361422
361809
|
|
|
361810
|
+
/***/ 6861:
|
|
361811
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
361812
|
+
|
|
361813
|
+
"use strict";
|
|
361814
|
+
|
|
361815
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
361816
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
361817
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
361818
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
361819
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
361820
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
361821
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
361822
|
+
});
|
|
361823
|
+
};
|
|
361824
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
361825
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
361826
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
361827
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
361828
|
+
function step(op) {
|
|
361829
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
361830
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
361831
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
361832
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
361833
|
+
switch (op[0]) {
|
|
361834
|
+
case 0: case 1: t = op; break;
|
|
361835
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
361836
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
361837
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
361838
|
+
default:
|
|
361839
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
361840
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
361841
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
361842
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
361843
|
+
if (t[2]) _.ops.pop();
|
|
361844
|
+
_.trys.pop(); continue;
|
|
361845
|
+
}
|
|
361846
|
+
op = body.call(thisArg, _);
|
|
361847
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
361848
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
361849
|
+
}
|
|
361850
|
+
};
|
|
361851
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
361852
|
+
exports.AsyncResult = void 0;
|
|
361853
|
+
var result_js_1 = __nccwpck_require__(39293);
|
|
361854
|
+
/**
|
|
361855
|
+
* An async-aware `Result` counterpart.
|
|
361856
|
+
*
|
|
361857
|
+
* Can be combined with asynchronous code without having to ``await`` anything right until
|
|
361858
|
+
* the moment when you're ready to extract the final ``Result`` out of it.
|
|
361859
|
+
*
|
|
361860
|
+
* Can also be combined with synchronous code for convenience.
|
|
361861
|
+
*/
|
|
361862
|
+
var AsyncResult = /** @class */ (function () {
|
|
361863
|
+
/**
|
|
361864
|
+
* Constructs an `AsyncResult` from a `Result` or a `Promise` of a `Result`.
|
|
361865
|
+
*
|
|
361866
|
+
* @example
|
|
361867
|
+
* ```typescript
|
|
361868
|
+
* const ar = new AsyncResult(Promise.resolve('value'))
|
|
361869
|
+
* ```
|
|
361870
|
+
*/
|
|
361871
|
+
function AsyncResult(start) {
|
|
361872
|
+
this.promise = Promise.resolve(start);
|
|
361873
|
+
}
|
|
361874
|
+
/**
|
|
361875
|
+
* Calls `mapper` if the result is `Ok`, otherwise keeps the `Err` value intact.
|
|
361876
|
+
* This function can be used for control flow based on `Result` values.
|
|
361877
|
+
*
|
|
361878
|
+
* @example
|
|
361879
|
+
* ```typescript
|
|
361880
|
+
* let goodResult = Ok(1).toAsyncResult()
|
|
361881
|
+
* let badResult = Err('boo').toAsyncResult()
|
|
361882
|
+
*
|
|
361883
|
+
* await goodResult.andThen(async (value) => Ok(value * 2)).promise // Ok(2)
|
|
361884
|
+
* await goodResult.andThen(async (value) => Err(`${value} is bad`)).promise // Err('1 is bad')
|
|
361885
|
+
* await badResult.andThen(async (value) => Ok(value * 2)).promise // Err('boo')
|
|
361886
|
+
* ```
|
|
361887
|
+
*/
|
|
361888
|
+
AsyncResult.prototype.andThen = function (mapper) {
|
|
361889
|
+
var _this = this;
|
|
361890
|
+
return this.thenInternal(function (result) { return __awaiter(_this, void 0, void 0, function () {
|
|
361891
|
+
var mapped;
|
|
361892
|
+
return __generator(this, function (_a) {
|
|
361893
|
+
if (result.isErr()) {
|
|
361894
|
+
// SAFETY: What we're returning here is Err<E>. That doesn't sit well with
|
|
361895
|
+
// TypeScript for some reason, let's explicitly expand the type to what this
|
|
361896
|
+
// function is supposed to return.
|
|
361897
|
+
return [2 /*return*/, result];
|
|
361898
|
+
}
|
|
361899
|
+
mapped = mapper(result.value);
|
|
361900
|
+
return [2 /*return*/, mapped instanceof AsyncResult ? mapped.promise : mapped];
|
|
361901
|
+
});
|
|
361902
|
+
}); });
|
|
361903
|
+
};
|
|
361904
|
+
/**
|
|
361905
|
+
* Maps an `AsyncResult<T, E>` to `AsyncResult<U, E>` by applying a function to a contained
|
|
361906
|
+
* `Ok` value, leaving an `Err` value untouched.
|
|
361907
|
+
*
|
|
361908
|
+
* This function can be used to compose the results of two functions.
|
|
361909
|
+
*
|
|
361910
|
+
* @example
|
|
361911
|
+
* ```typescript
|
|
361912
|
+
* let goodResult = Ok(1).toAsyncResult()
|
|
361913
|
+
* let badResult = Err('boo').toAsyncResult()
|
|
361914
|
+
*
|
|
361915
|
+
* await goodResult.map(async (value) => value * 2).promise // Ok(2)
|
|
361916
|
+
* await badResult.andThen(async (value) => value * 2).promise // Err('boo')
|
|
361917
|
+
* ```
|
|
361918
|
+
*/
|
|
361919
|
+
AsyncResult.prototype.map = function (mapper) {
|
|
361920
|
+
var _this = this;
|
|
361921
|
+
return this.thenInternal(function (result) { return __awaiter(_this, void 0, void 0, function () {
|
|
361922
|
+
var _a;
|
|
361923
|
+
return __generator(this, function (_b) {
|
|
361924
|
+
switch (_b.label) {
|
|
361925
|
+
case 0:
|
|
361926
|
+
if (result.isErr()) {
|
|
361927
|
+
return [2 /*return*/, result];
|
|
361928
|
+
}
|
|
361929
|
+
_a = result_js_1.Ok;
|
|
361930
|
+
return [4 /*yield*/, mapper(result.value)];
|
|
361931
|
+
case 1: return [2 /*return*/, _a.apply(void 0, [_b.sent()])];
|
|
361932
|
+
}
|
|
361933
|
+
});
|
|
361934
|
+
}); });
|
|
361935
|
+
};
|
|
361936
|
+
// TODO:
|
|
361937
|
+
// mapErr()
|
|
361938
|
+
// mapOr()
|
|
361939
|
+
// mapOrElse()
|
|
361940
|
+
// or()
|
|
361941
|
+
// orElse()
|
|
361942
|
+
// mapErr<F>(mapper: (val: E) => F | Promise<F>): AsyncResult<T, F> {
|
|
361943
|
+
// return this.thenInternal(async (result) => {
|
|
361944
|
+
// if (result.isOk()) {
|
|
361945
|
+
// return result
|
|
361946
|
+
// }
|
|
361947
|
+
// return Err(await mapper(result.error))
|
|
361948
|
+
// })
|
|
361949
|
+
// }
|
|
361950
|
+
// async mapOr<U>(default_: U, mapper: (val: T) => U | Promise<U>): Promise<U> {
|
|
361951
|
+
// return this.mapOrElse(() => default_, mapper)
|
|
361952
|
+
// }
|
|
361953
|
+
// async mapOrElse<U>(default_: (error: E) => U | Promise<U>, mapper: (val: T) => U | Promise<U>): Promise<U> {
|
|
361954
|
+
// const result = await this.promise
|
|
361955
|
+
// if (result.isErr()) {
|
|
361956
|
+
// return default_(result.error)
|
|
361957
|
+
// }
|
|
361958
|
+
// return mapper(result.value)
|
|
361959
|
+
// }
|
|
361960
|
+
// or<E2>(other: Result<T, E2> | AsyncResult<T, E2> | Promise<Result<T, E2>>): AsyncResult<T, E2> {
|
|
361961
|
+
// return this.orElse(() => other)
|
|
361962
|
+
// }
|
|
361963
|
+
// orElse<E2>(other: (error: E) => Result<T, E2> | AsyncResult<T, E2> | Promise<Result<T, E2>>): AsyncResult<T, E2> {
|
|
361964
|
+
// return this.thenInternal(async (result) => {
|
|
361965
|
+
// if (result.isOk()) {
|
|
361966
|
+
// return result
|
|
361967
|
+
// }
|
|
361968
|
+
// const otherValue = other(result.error)
|
|
361969
|
+
// return otherValue instanceof AsyncResult ? otherValue.promise : otherValue
|
|
361970
|
+
// })
|
|
361971
|
+
// }
|
|
361972
|
+
AsyncResult.prototype.thenInternal = function (mapper) {
|
|
361973
|
+
return new AsyncResult(this.promise.then(mapper));
|
|
361974
|
+
};
|
|
361975
|
+
return AsyncResult;
|
|
361976
|
+
}());
|
|
361977
|
+
exports.AsyncResult = AsyncResult;
|
|
361978
|
+
//# sourceMappingURL=asyncresult.js.map
|
|
361979
|
+
|
|
361980
|
+
/***/ }),
|
|
361981
|
+
|
|
361982
|
+
/***/ 72807:
|
|
361983
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
361984
|
+
|
|
361985
|
+
"use strict";
|
|
361986
|
+
|
|
361987
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
361988
|
+
if (k2 === undefined) k2 = k;
|
|
361989
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
361990
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
361991
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
361992
|
+
}
|
|
361993
|
+
Object.defineProperty(o, k2, desc);
|
|
361994
|
+
}) : (function(o, m, k, k2) {
|
|
361995
|
+
if (k2 === undefined) k2 = k;
|
|
361996
|
+
o[k2] = m[k];
|
|
361997
|
+
}));
|
|
361998
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
361999
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
362000
|
+
};
|
|
362001
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
362002
|
+
__exportStar(__nccwpck_require__(6861), exports);
|
|
362003
|
+
__exportStar(__nccwpck_require__(39293), exports);
|
|
362004
|
+
__exportStar(__nccwpck_require__(56456), exports);
|
|
362005
|
+
//# sourceMappingURL=index.js.map
|
|
362006
|
+
|
|
362007
|
+
/***/ }),
|
|
362008
|
+
|
|
362009
|
+
/***/ 56456:
|
|
362010
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
362011
|
+
|
|
362012
|
+
"use strict";
|
|
362013
|
+
|
|
362014
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
362015
|
+
exports.Option = exports.Some = exports.None = void 0;
|
|
362016
|
+
var utils_js_1 = __nccwpck_require__(91414);
|
|
362017
|
+
var result_js_1 = __nccwpck_require__(39293);
|
|
362018
|
+
/**
|
|
362019
|
+
* Contains the None value
|
|
362020
|
+
*/
|
|
362021
|
+
var NoneImpl = /** @class */ (function () {
|
|
362022
|
+
function NoneImpl() {
|
|
362023
|
+
}
|
|
362024
|
+
NoneImpl.prototype.isSome = function () {
|
|
362025
|
+
return false;
|
|
362026
|
+
};
|
|
362027
|
+
NoneImpl.prototype.isNone = function () {
|
|
362028
|
+
return true;
|
|
362029
|
+
};
|
|
362030
|
+
NoneImpl.prototype[Symbol.iterator] = function () {
|
|
362031
|
+
return {
|
|
362032
|
+
next: function () {
|
|
362033
|
+
return { done: true, value: undefined };
|
|
362034
|
+
},
|
|
362035
|
+
};
|
|
362036
|
+
};
|
|
362037
|
+
NoneImpl.prototype.unwrapOr = function (val) {
|
|
362038
|
+
return val;
|
|
362039
|
+
};
|
|
362040
|
+
NoneImpl.prototype.expect = function (msg) {
|
|
362041
|
+
throw new Error("".concat(msg));
|
|
362042
|
+
};
|
|
362043
|
+
NoneImpl.prototype.unwrap = function () {
|
|
362044
|
+
throw new Error("Tried to unwrap None");
|
|
362045
|
+
};
|
|
362046
|
+
NoneImpl.prototype.map = function (_mapper) {
|
|
362047
|
+
return this;
|
|
362048
|
+
};
|
|
362049
|
+
NoneImpl.prototype.mapOr = function (default_, _mapper) {
|
|
362050
|
+
return default_;
|
|
362051
|
+
};
|
|
362052
|
+
NoneImpl.prototype.mapOrElse = function (default_, _mapper) {
|
|
362053
|
+
return default_();
|
|
362054
|
+
};
|
|
362055
|
+
NoneImpl.prototype.or = function (other) {
|
|
362056
|
+
return other;
|
|
362057
|
+
};
|
|
362058
|
+
NoneImpl.prototype.orElse = function (other) {
|
|
362059
|
+
return other();
|
|
362060
|
+
};
|
|
362061
|
+
NoneImpl.prototype.andThen = function (op) {
|
|
362062
|
+
return this;
|
|
362063
|
+
};
|
|
362064
|
+
NoneImpl.prototype.toResult = function (error) {
|
|
362065
|
+
return (0, result_js_1.Err)(error);
|
|
362066
|
+
};
|
|
362067
|
+
NoneImpl.prototype.toString = function () {
|
|
362068
|
+
return 'None';
|
|
362069
|
+
};
|
|
362070
|
+
return NoneImpl;
|
|
362071
|
+
}());
|
|
362072
|
+
// Export None as a singleton, then freeze it so it can't be modified
|
|
362073
|
+
exports.None = new NoneImpl();
|
|
362074
|
+
Object.freeze(exports.None);
|
|
362075
|
+
/**
|
|
362076
|
+
* Contains the success value
|
|
362077
|
+
*/
|
|
362078
|
+
var SomeImpl = /** @class */ (function () {
|
|
362079
|
+
function SomeImpl(val) {
|
|
362080
|
+
if (!(this instanceof SomeImpl)) {
|
|
362081
|
+
return new SomeImpl(val);
|
|
362082
|
+
}
|
|
362083
|
+
this.value = val;
|
|
362084
|
+
}
|
|
362085
|
+
SomeImpl.prototype.isSome = function () {
|
|
362086
|
+
return true;
|
|
362087
|
+
};
|
|
362088
|
+
SomeImpl.prototype.isNone = function () {
|
|
362089
|
+
return false;
|
|
362090
|
+
};
|
|
362091
|
+
/**
|
|
362092
|
+
* Helper function if you know you have an Some<T> and T is iterable
|
|
362093
|
+
*/
|
|
362094
|
+
SomeImpl.prototype[Symbol.iterator] = function () {
|
|
362095
|
+
var obj = Object(this.value);
|
|
362096
|
+
return Symbol.iterator in obj
|
|
362097
|
+
? obj[Symbol.iterator]()
|
|
362098
|
+
: {
|
|
362099
|
+
next: function () {
|
|
362100
|
+
return { done: true, value: undefined };
|
|
362101
|
+
},
|
|
362102
|
+
};
|
|
362103
|
+
};
|
|
362104
|
+
SomeImpl.prototype.unwrapOr = function (_val) {
|
|
362105
|
+
return this.value;
|
|
362106
|
+
};
|
|
362107
|
+
SomeImpl.prototype.expect = function (_msg) {
|
|
362108
|
+
return this.value;
|
|
362109
|
+
};
|
|
362110
|
+
SomeImpl.prototype.unwrap = function () {
|
|
362111
|
+
return this.value;
|
|
362112
|
+
};
|
|
362113
|
+
SomeImpl.prototype.map = function (mapper) {
|
|
362114
|
+
return (0, exports.Some)(mapper(this.value));
|
|
362115
|
+
};
|
|
362116
|
+
SomeImpl.prototype.mapOr = function (_default_, mapper) {
|
|
362117
|
+
return mapper(this.value);
|
|
362118
|
+
};
|
|
362119
|
+
SomeImpl.prototype.mapOrElse = function (_default_, mapper) {
|
|
362120
|
+
return mapper(this.value);
|
|
362121
|
+
};
|
|
362122
|
+
SomeImpl.prototype.or = function (_other) {
|
|
362123
|
+
return this;
|
|
362124
|
+
};
|
|
362125
|
+
SomeImpl.prototype.orElse = function (_other) {
|
|
362126
|
+
return this;
|
|
362127
|
+
};
|
|
362128
|
+
SomeImpl.prototype.andThen = function (mapper) {
|
|
362129
|
+
return mapper(this.value);
|
|
362130
|
+
};
|
|
362131
|
+
SomeImpl.prototype.toResult = function (error) {
|
|
362132
|
+
return (0, result_js_1.Ok)(this.value);
|
|
362133
|
+
};
|
|
362134
|
+
/**
|
|
362135
|
+
* Returns the contained `Some` value, but never throws.
|
|
362136
|
+
* Unlike `unwrap()`, this method doesn't throw and is only callable on an Some<T>
|
|
362137
|
+
*
|
|
362138
|
+
* Therefore, it can be used instead of `unwrap()` as a maintainability safeguard
|
|
362139
|
+
* that will fail to compile if the type of the Option is later changed to a None that can actually occur.
|
|
362140
|
+
*
|
|
362141
|
+
* (this is the `into_Some()` in rust)
|
|
362142
|
+
*/
|
|
362143
|
+
SomeImpl.prototype.safeUnwrap = function () {
|
|
362144
|
+
return this.value;
|
|
362145
|
+
};
|
|
362146
|
+
SomeImpl.prototype.toString = function () {
|
|
362147
|
+
return "Some(".concat((0, utils_js_1.toString)(this.value), ")");
|
|
362148
|
+
};
|
|
362149
|
+
SomeImpl.EMPTY = new SomeImpl(undefined);
|
|
362150
|
+
return SomeImpl;
|
|
362151
|
+
}());
|
|
362152
|
+
// This allows Some to be callable - possible because of the es5 compilation target
|
|
362153
|
+
exports.Some = SomeImpl;
|
|
362154
|
+
var Option;
|
|
362155
|
+
(function (Option) {
|
|
362156
|
+
/**
|
|
362157
|
+
* Parse a set of `Option`s, returning an array of all `Some` values.
|
|
362158
|
+
* Short circuits with the first `None` found, if any
|
|
362159
|
+
*/
|
|
362160
|
+
function all() {
|
|
362161
|
+
var options = [];
|
|
362162
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
362163
|
+
options[_i] = arguments[_i];
|
|
362164
|
+
}
|
|
362165
|
+
var someOption = [];
|
|
362166
|
+
for (var _a = 0, options_1 = options; _a < options_1.length; _a++) {
|
|
362167
|
+
var option = options_1[_a];
|
|
362168
|
+
if (option.isSome()) {
|
|
362169
|
+
someOption.push(option.value);
|
|
362170
|
+
}
|
|
362171
|
+
else {
|
|
362172
|
+
return option;
|
|
362173
|
+
}
|
|
362174
|
+
}
|
|
362175
|
+
return (0, exports.Some)(someOption);
|
|
362176
|
+
}
|
|
362177
|
+
Option.all = all;
|
|
362178
|
+
/**
|
|
362179
|
+
* Parse a set of `Option`s, short-circuits when an input value is `Some`.
|
|
362180
|
+
* If no `Some` is found, returns `None`.
|
|
362181
|
+
*/
|
|
362182
|
+
function any() {
|
|
362183
|
+
var options = [];
|
|
362184
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
362185
|
+
options[_i] = arguments[_i];
|
|
362186
|
+
}
|
|
362187
|
+
// short-circuits
|
|
362188
|
+
for (var _a = 0, options_2 = options; _a < options_2.length; _a++) {
|
|
362189
|
+
var option = options_2[_a];
|
|
362190
|
+
if (option.isSome()) {
|
|
362191
|
+
return option;
|
|
362192
|
+
}
|
|
362193
|
+
else {
|
|
362194
|
+
return option;
|
|
362195
|
+
}
|
|
362196
|
+
}
|
|
362197
|
+
// it must be None
|
|
362198
|
+
return exports.None;
|
|
362199
|
+
}
|
|
362200
|
+
Option.any = any;
|
|
362201
|
+
function isOption(value) {
|
|
362202
|
+
return value instanceof exports.Some || value === exports.None;
|
|
362203
|
+
}
|
|
362204
|
+
Option.isOption = isOption;
|
|
362205
|
+
})(Option || (exports.Option = Option = {}));
|
|
362206
|
+
//# sourceMappingURL=option.js.map
|
|
362207
|
+
|
|
362208
|
+
/***/ }),
|
|
362209
|
+
|
|
362210
|
+
/***/ 39293:
|
|
362211
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
362212
|
+
|
|
362213
|
+
"use strict";
|
|
362214
|
+
|
|
362215
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
362216
|
+
exports.Result = exports.Ok = exports.OkImpl = exports.Err = exports.ErrImpl = void 0;
|
|
362217
|
+
var utils_js_1 = __nccwpck_require__(91414);
|
|
362218
|
+
var option_js_1 = __nccwpck_require__(56456);
|
|
362219
|
+
var asyncresult_js_1 = __nccwpck_require__(6861);
|
|
362220
|
+
/**
|
|
362221
|
+
* Contains the error value
|
|
362222
|
+
*/
|
|
362223
|
+
var ErrImpl = /** @class */ (function () {
|
|
362224
|
+
function ErrImpl(val) {
|
|
362225
|
+
if (!(this instanceof ErrImpl)) {
|
|
362226
|
+
return new ErrImpl(val);
|
|
362227
|
+
}
|
|
362228
|
+
this.error = val;
|
|
362229
|
+
var stackLines = new Error().stack.split('\n').slice(2);
|
|
362230
|
+
if (stackLines && stackLines.length > 0 && stackLines[0].includes('ErrImpl')) {
|
|
362231
|
+
stackLines.shift();
|
|
362232
|
+
}
|
|
362233
|
+
this._stack = stackLines.join('\n');
|
|
362234
|
+
}
|
|
362235
|
+
ErrImpl.prototype.isOk = function () {
|
|
362236
|
+
return false;
|
|
362237
|
+
};
|
|
362238
|
+
ErrImpl.prototype.isErr = function () {
|
|
362239
|
+
return true;
|
|
362240
|
+
};
|
|
362241
|
+
ErrImpl.prototype[Symbol.iterator] = function () {
|
|
362242
|
+
return {
|
|
362243
|
+
next: function () {
|
|
362244
|
+
return { done: true, value: undefined };
|
|
362245
|
+
},
|
|
362246
|
+
};
|
|
362247
|
+
};
|
|
362248
|
+
/**
|
|
362249
|
+
* @deprecated in favor of unwrapOr
|
|
362250
|
+
* @see unwrapOr
|
|
362251
|
+
*/
|
|
362252
|
+
ErrImpl.prototype.else = function (val) {
|
|
362253
|
+
return val;
|
|
362254
|
+
};
|
|
362255
|
+
ErrImpl.prototype.unwrapOr = function (val) {
|
|
362256
|
+
return val;
|
|
362257
|
+
};
|
|
362258
|
+
ErrImpl.prototype.expect = function (msg) {
|
|
362259
|
+
// The cause casting required because of the current TS definition being overly restrictive
|
|
362260
|
+
// (the definition says it has to be an Error while it can be anything).
|
|
362261
|
+
// See https://github.com/microsoft/TypeScript/issues/45167
|
|
362262
|
+
throw new Error("".concat(msg, " - Error: ").concat((0, utils_js_1.toString)(this.error), "\n").concat(this._stack), { cause: this.error });
|
|
362263
|
+
};
|
|
362264
|
+
ErrImpl.prototype.expectErr = function (_msg) {
|
|
362265
|
+
return this.error;
|
|
362266
|
+
};
|
|
362267
|
+
ErrImpl.prototype.unwrap = function () {
|
|
362268
|
+
// The cause casting required because of the current TS definition being overly restrictive
|
|
362269
|
+
// (the definition says it has to be an Error while it can be anything).
|
|
362270
|
+
// See https://github.com/microsoft/TypeScript/issues/45167
|
|
362271
|
+
throw new Error("Tried to unwrap Error: ".concat((0, utils_js_1.toString)(this.error), "\n").concat(this._stack), { cause: this.error });
|
|
362272
|
+
};
|
|
362273
|
+
ErrImpl.prototype.unwrapErr = function () {
|
|
362274
|
+
return this.error;
|
|
362275
|
+
};
|
|
362276
|
+
ErrImpl.prototype.map = function (_mapper) {
|
|
362277
|
+
return this;
|
|
362278
|
+
};
|
|
362279
|
+
ErrImpl.prototype.andThen = function (op) {
|
|
362280
|
+
return this;
|
|
362281
|
+
};
|
|
362282
|
+
ErrImpl.prototype.mapErr = function (mapper) {
|
|
362283
|
+
return new exports.Err(mapper(this.error));
|
|
362284
|
+
};
|
|
362285
|
+
ErrImpl.prototype.mapOr = function (default_, _mapper) {
|
|
362286
|
+
return default_;
|
|
362287
|
+
};
|
|
362288
|
+
ErrImpl.prototype.mapOrElse = function (default_, _mapper) {
|
|
362289
|
+
return default_(this.error);
|
|
362290
|
+
};
|
|
362291
|
+
ErrImpl.prototype.or = function (other) {
|
|
362292
|
+
return other;
|
|
362293
|
+
};
|
|
362294
|
+
ErrImpl.prototype.orElse = function (other) {
|
|
362295
|
+
return other(this.error);
|
|
362296
|
+
};
|
|
362297
|
+
ErrImpl.prototype.toOption = function () {
|
|
362298
|
+
return option_js_1.None;
|
|
362299
|
+
};
|
|
362300
|
+
ErrImpl.prototype.toString = function () {
|
|
362301
|
+
return "Err(".concat((0, utils_js_1.toString)(this.error), ")");
|
|
362302
|
+
};
|
|
362303
|
+
Object.defineProperty(ErrImpl.prototype, "stack", {
|
|
362304
|
+
get: function () {
|
|
362305
|
+
return "".concat(this, "\n").concat(this._stack);
|
|
362306
|
+
},
|
|
362307
|
+
enumerable: false,
|
|
362308
|
+
configurable: true
|
|
362309
|
+
});
|
|
362310
|
+
ErrImpl.prototype.toAsyncResult = function () {
|
|
362311
|
+
return new asyncresult_js_1.AsyncResult(this);
|
|
362312
|
+
};
|
|
362313
|
+
/** An empty Err */
|
|
362314
|
+
ErrImpl.EMPTY = new ErrImpl(undefined);
|
|
362315
|
+
return ErrImpl;
|
|
362316
|
+
}());
|
|
362317
|
+
exports.ErrImpl = ErrImpl;
|
|
362318
|
+
// This allows Err to be callable - possible because of the es5 compilation target
|
|
362319
|
+
exports.Err = ErrImpl;
|
|
362320
|
+
/**
|
|
362321
|
+
* Contains the success value
|
|
362322
|
+
*/
|
|
362323
|
+
var OkImpl = /** @class */ (function () {
|
|
362324
|
+
function OkImpl(val) {
|
|
362325
|
+
if (!(this instanceof OkImpl)) {
|
|
362326
|
+
return new OkImpl(val);
|
|
362327
|
+
}
|
|
362328
|
+
this.value = val;
|
|
362329
|
+
}
|
|
362330
|
+
OkImpl.prototype.isOk = function () {
|
|
362331
|
+
return true;
|
|
362332
|
+
};
|
|
362333
|
+
OkImpl.prototype.isErr = function () {
|
|
362334
|
+
return false;
|
|
362335
|
+
};
|
|
362336
|
+
/**
|
|
362337
|
+
* Helper function if you know you have an Ok<T> and T is iterable
|
|
362338
|
+
*/
|
|
362339
|
+
OkImpl.prototype[Symbol.iterator] = function () {
|
|
362340
|
+
var obj = Object(this.value);
|
|
362341
|
+
return Symbol.iterator in obj
|
|
362342
|
+
? obj[Symbol.iterator]()
|
|
362343
|
+
: {
|
|
362344
|
+
next: function () {
|
|
362345
|
+
return { done: true, value: undefined };
|
|
362346
|
+
},
|
|
362347
|
+
};
|
|
362348
|
+
};
|
|
362349
|
+
/**
|
|
362350
|
+
* @see unwrapOr
|
|
362351
|
+
* @deprecated in favor of unwrapOr
|
|
362352
|
+
*/
|
|
362353
|
+
OkImpl.prototype.else = function (_val) {
|
|
362354
|
+
return this.value;
|
|
362355
|
+
};
|
|
362356
|
+
OkImpl.prototype.unwrapOr = function (_val) {
|
|
362357
|
+
return this.value;
|
|
362358
|
+
};
|
|
362359
|
+
OkImpl.prototype.expect = function (_msg) {
|
|
362360
|
+
return this.value;
|
|
362361
|
+
};
|
|
362362
|
+
OkImpl.prototype.expectErr = function (msg) {
|
|
362363
|
+
throw new Error(msg);
|
|
362364
|
+
};
|
|
362365
|
+
OkImpl.prototype.unwrap = function () {
|
|
362366
|
+
return this.value;
|
|
362367
|
+
};
|
|
362368
|
+
OkImpl.prototype.unwrapErr = function () {
|
|
362369
|
+
// The cause casting required because of the current TS definition being overly restrictive
|
|
362370
|
+
// (the definition says it has to be an Error while it can be anything).
|
|
362371
|
+
// See https://github.com/microsoft/TypeScript/issues/45167
|
|
362372
|
+
throw new Error("Tried to unwrap Ok: ".concat((0, utils_js_1.toString)(this.value)), { cause: this.value });
|
|
362373
|
+
};
|
|
362374
|
+
OkImpl.prototype.map = function (mapper) {
|
|
362375
|
+
return new exports.Ok(mapper(this.value));
|
|
362376
|
+
};
|
|
362377
|
+
OkImpl.prototype.andThen = function (mapper) {
|
|
362378
|
+
return mapper(this.value);
|
|
362379
|
+
};
|
|
362380
|
+
OkImpl.prototype.mapErr = function (_mapper) {
|
|
362381
|
+
return this;
|
|
362382
|
+
};
|
|
362383
|
+
OkImpl.prototype.mapOr = function (_default_, mapper) {
|
|
362384
|
+
return mapper(this.value);
|
|
362385
|
+
};
|
|
362386
|
+
OkImpl.prototype.mapOrElse = function (_default_, mapper) {
|
|
362387
|
+
return mapper(this.value);
|
|
362388
|
+
};
|
|
362389
|
+
OkImpl.prototype.or = function (_other) {
|
|
362390
|
+
return this;
|
|
362391
|
+
};
|
|
362392
|
+
OkImpl.prototype.orElse = function (_other) {
|
|
362393
|
+
return this;
|
|
362394
|
+
};
|
|
362395
|
+
OkImpl.prototype.toOption = function () {
|
|
362396
|
+
return (0, option_js_1.Some)(this.value);
|
|
362397
|
+
};
|
|
362398
|
+
/**
|
|
362399
|
+
* Returns the contained `Ok` value, but never throws.
|
|
362400
|
+
* Unlike `unwrap()`, this method doesn't throw and is only callable on an Ok<T>
|
|
362401
|
+
*
|
|
362402
|
+
* Therefore, it can be used instead of `unwrap()` as a maintainability safeguard
|
|
362403
|
+
* that will fail to compile if the error type of the Result is later changed to an error that can actually occur.
|
|
362404
|
+
*
|
|
362405
|
+
* (this is the `into_ok()` in rust)
|
|
362406
|
+
*/
|
|
362407
|
+
OkImpl.prototype.safeUnwrap = function () {
|
|
362408
|
+
return this.value;
|
|
362409
|
+
};
|
|
362410
|
+
OkImpl.prototype.toString = function () {
|
|
362411
|
+
return "Ok(".concat((0, utils_js_1.toString)(this.value), ")");
|
|
362412
|
+
};
|
|
362413
|
+
OkImpl.prototype.toAsyncResult = function () {
|
|
362414
|
+
return new asyncresult_js_1.AsyncResult(this);
|
|
362415
|
+
};
|
|
362416
|
+
OkImpl.EMPTY = new OkImpl(undefined);
|
|
362417
|
+
return OkImpl;
|
|
362418
|
+
}());
|
|
362419
|
+
exports.OkImpl = OkImpl;
|
|
362420
|
+
// This allows Ok to be callable - possible because of the es5 compilation target
|
|
362421
|
+
exports.Ok = OkImpl;
|
|
362422
|
+
var Result;
|
|
362423
|
+
(function (Result) {
|
|
362424
|
+
/**
|
|
362425
|
+
* Parse a set of `Result`s, returning an array of all `Ok` values.
|
|
362426
|
+
* Short circuits with the first `Err` found, if any
|
|
362427
|
+
*/
|
|
362428
|
+
function all() {
|
|
362429
|
+
var results = [];
|
|
362430
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
362431
|
+
results[_i] = arguments[_i];
|
|
362432
|
+
}
|
|
362433
|
+
var okResult = [];
|
|
362434
|
+
for (var _a = 0, results_1 = results; _a < results_1.length; _a++) {
|
|
362435
|
+
var result = results_1[_a];
|
|
362436
|
+
if (result.isOk()) {
|
|
362437
|
+
okResult.push(result.value);
|
|
362438
|
+
}
|
|
362439
|
+
else {
|
|
362440
|
+
return result;
|
|
362441
|
+
}
|
|
362442
|
+
}
|
|
362443
|
+
return new exports.Ok(okResult);
|
|
362444
|
+
}
|
|
362445
|
+
Result.all = all;
|
|
362446
|
+
/**
|
|
362447
|
+
* Parse a set of `Result`s, short-circuits when an input value is `Ok`.
|
|
362448
|
+
* If no `Ok` is found, returns an `Err` containing the collected error values
|
|
362449
|
+
*/
|
|
362450
|
+
function any() {
|
|
362451
|
+
var results = [];
|
|
362452
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
362453
|
+
results[_i] = arguments[_i];
|
|
362454
|
+
}
|
|
362455
|
+
var errResult = [];
|
|
362456
|
+
// short-circuits
|
|
362457
|
+
for (var _a = 0, results_2 = results; _a < results_2.length; _a++) {
|
|
362458
|
+
var result = results_2[_a];
|
|
362459
|
+
if (result.isOk()) {
|
|
362460
|
+
return result;
|
|
362461
|
+
}
|
|
362462
|
+
else {
|
|
362463
|
+
errResult.push(result.error);
|
|
362464
|
+
}
|
|
362465
|
+
}
|
|
362466
|
+
// it must be a Err
|
|
362467
|
+
return new exports.Err(errResult);
|
|
362468
|
+
}
|
|
362469
|
+
Result.any = any;
|
|
362470
|
+
/**
|
|
362471
|
+
* Wrap an operation that may throw an Error (`try-catch` style) into checked exception style
|
|
362472
|
+
* @param op The operation function
|
|
362473
|
+
*/
|
|
362474
|
+
function wrap(op) {
|
|
362475
|
+
try {
|
|
362476
|
+
return new exports.Ok(op());
|
|
362477
|
+
}
|
|
362478
|
+
catch (e) {
|
|
362479
|
+
return new exports.Err(e);
|
|
362480
|
+
}
|
|
362481
|
+
}
|
|
362482
|
+
Result.wrap = wrap;
|
|
362483
|
+
/**
|
|
362484
|
+
* Wrap an async operation that may throw an Error (`try-catch` style) into checked exception style
|
|
362485
|
+
* @param op The operation function
|
|
362486
|
+
*/
|
|
362487
|
+
function wrapAsync(op) {
|
|
362488
|
+
try {
|
|
362489
|
+
return op()
|
|
362490
|
+
.then(function (val) { return new exports.Ok(val); })
|
|
362491
|
+
.catch(function (e) { return new exports.Err(e); });
|
|
362492
|
+
}
|
|
362493
|
+
catch (e) {
|
|
362494
|
+
return Promise.resolve(new exports.Err(e));
|
|
362495
|
+
}
|
|
362496
|
+
}
|
|
362497
|
+
Result.wrapAsync = wrapAsync;
|
|
362498
|
+
function isResult(val) {
|
|
362499
|
+
return val instanceof exports.Err || val instanceof exports.Ok;
|
|
362500
|
+
}
|
|
362501
|
+
Result.isResult = isResult;
|
|
362502
|
+
})(Result || (exports.Result = Result = {}));
|
|
362503
|
+
//# sourceMappingURL=result.js.map
|
|
362504
|
+
|
|
362505
|
+
/***/ }),
|
|
362506
|
+
|
|
362507
|
+
/***/ 91414:
|
|
362508
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
362509
|
+
|
|
362510
|
+
"use strict";
|
|
362511
|
+
|
|
362512
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
362513
|
+
exports.toString = void 0;
|
|
362514
|
+
function toString(val) {
|
|
362515
|
+
var value = String(val);
|
|
362516
|
+
if (value === '[object Object]') {
|
|
362517
|
+
try {
|
|
362518
|
+
value = JSON.stringify(val);
|
|
362519
|
+
}
|
|
362520
|
+
catch (_a) { }
|
|
362521
|
+
}
|
|
362522
|
+
return value;
|
|
362523
|
+
}
|
|
362524
|
+
exports.toString = toString;
|
|
362525
|
+
//# sourceMappingURL=utils.js.map
|
|
362526
|
+
|
|
362527
|
+
/***/ }),
|
|
362528
|
+
|
|
361423
362529
|
/***/ 23619:
|
|
361424
362530
|
/***/ ((__unused_webpack_module, exports) => {
|
|
361425
362531
|
|
|
@@ -363601,13 +364707,21 @@ module.exports = underscoreNodeF._;
|
|
|
363601
364707
|
//# sourceMappingURL=underscore-node.cjs.map
|
|
363602
364708
|
|
|
363603
364709
|
|
|
364710
|
+
/***/ }),
|
|
364711
|
+
|
|
364712
|
+
/***/ 80478:
|
|
364713
|
+
/***/ ((module) => {
|
|
364714
|
+
|
|
364715
|
+
"use strict";
|
|
364716
|
+
module.exports = JSON.parse('[{"description":"No API keys or secrets are stored in repository","responsibles":1,"more":""},{"description":"The app does not provide password login","responsibles":1,"more":""},{"description":"Passwords are not stored","responsibles":1,"more":""},{"description":"Passwords are stored hashed with salt and salt is not stored in the repository","responsibles":1,"more":"[guide](https://git.panter.ch/panter/security-guide/-/blob/main/docs/audit/hash.md)"},{"description":"Input that ends up in DOM is properly sanitized","responsibles":1,"more":"[guide](https://git.panter.ch/panter/security-guide/-/blob/main/docs/audit/xss.md)"},{"description":"All user inputs have reasonable validations","responsibles":1,"more":"[guide](https://git.panter.ch/panter/security-guide/-/blob/main/docs/audit/validation.md)"},{"description":"The app is not using cookies","responsibles":1,"more":"[guide](https://git.panter.ch/panter/security-guide/-/blob/main/docs/audit/cookies.md)"},{"description":"The app is using cookies and cookies are properly configured","responsibles":1,"more":"[guide](https://git.panter.ch/panter/security-guide/-/blob/main/docs/audit/cookies.md)"},{"description":"The app uses JWT with a secret and the secret is not stored in the repository","responsibles":1,"more":"[guide](https://git.panter.ch/panter/security-guide/-/blob/main/docs/audit/cookies.md)"},{"description":"Authorization and user roles (RBAC) were reviewed thoroughly","responsibles":2,"more":"[guide](https://git.panter.ch/panter/security-guide/-/blob/main/docs/audit/authorization.md)"},{"description":"CORS headers do not use `*`","responsibles":1,"more":"[guide](https://git.panter.ch/panter/security-guide/-/blob/main/docs/audit/cors.md)"},{"description":"CSP headers are properly configured (no `unsafe-inline` or `unsafe-eval`)","responsibles":1,"more":"[guide](https://git.panter.ch/panter/security-guide/-/blob/main/docs/audit/csp.md)"},{"description":"DoS defense mechanism is implemented","responsibles":1,"more":"[guide](https://git.panter.ch/panter/security-guide/-/blob/main/docs/audit/dos.md)"},{"description":"YAML/XML parsing is not used or used YAML/XML parsers have disabled DTD","responsibles":1,"more":"[guide](https://git.panter.ch/panter/security-guide/-/blob/main/docs/audit/dos.md)"},{"description":"The app implements CSRF prevention","responsibles":1,"more":"[guide](https://git.panter.ch/panter/security-guide/-/blob/main/docs/audit/csrf.md)"},{"description":"The app has a rate limitter","responsibles":1,"more":""},{"description":"The app has disabled GraphQL introspection and schema registry","responsibles":1,"more":"[guide](https://git.panter.ch/panter/security-guide/-/blob/main/docs/audit/graphql.md)"},{"description":"The app has set GraphQL complexity query limits","responsibles":1,"more":"[guide](https://git.panter.ch/panter/security-guide/-/blob/main/docs/audit/graphql.md)"},{"description":"`sitemap.xml` does not leak any routes with sensitive data","responsibles":1,"more":""},{"description":"Cloud storage is (private) configured to not leak any sensitive data publicly","responsibles":1,"more":""},{"description":"Security Dashboard checks weekly vulnerable dependencies https://dep.panter.swiss/","responsibles":1,"more":""},{"description":"The app has `.well-known/security.txt` https://securitytxt.org/","responsibles":1,"more":""}]');
|
|
364717
|
+
|
|
363604
364718
|
/***/ }),
|
|
363605
364719
|
|
|
363606
364720
|
/***/ 4147:
|
|
363607
364721
|
/***/ ((module) => {
|
|
363608
364722
|
|
|
363609
364723
|
"use strict";
|
|
363610
|
-
module.exports = JSON.parse('{"name":"@catladder/cli","description":"Panter cli tool for Kubernetes","author":"Marco Wettstein <maw@panter.ch>","homepage":"https://git.panter.ch/catladder/catladder/#readme","bugs":"https://git.panter.ch/catladder/catladder/issues","repository":{"type":"git","url":"git+https://git.panter.ch/catladder/catladder.git","directory":"cli"},"keywords":["GitLab","cloud","cli","gitlab-ci","ci/cd","pipeline","deployment","devops","automation","typescript"],"contributors":[{"name":"Marco Wettstein","email":"maw@panter.ch"},{"name":"Michael Leu","email":"leu@panter.ch"},{"name":"Luboš Matejčík","email":"lma@panter.ch"},{"name":"Kaspar Vollenweider","email":"vok@panter.ch"},{"name":"Silvan Adrian","email":"sia@panter.ch"},{"name":"Stefan Bakocs","email":"stb@panter.ch"},{"name":"Lukas Brezina","email":"brl@panter.ch"}],"license":"MIT","version":"0.0.0","scripts":{"lint":"eslint \\"src/**/*.ts\\"","lint:fix":"eslint \\"src/**/*.ts\\" --fix","test":"yarn run lint","build":"yarn build:compile && yarn build:bundle","build:bundle":"./scripts/bundle","build:compile":"yarn tsc","build:watch":"yarn tsc -w"},"bin":{"
|
|
364724
|
+
module.exports = JSON.parse('{"name":"@catladder/cli","description":"Panter cli tool for Kubernetes","author":"Marco Wettstein <maw@panter.ch>","homepage":"https://git.panter.ch/catladder/catladder/#readme","bugs":"https://git.panter.ch/catladder/catladder/issues","repository":{"type":"git","url":"git+https://git.panter.ch/catladder/catladder.git","directory":"cli"},"keywords":["GitLab","cloud","cli","gitlab-ci","ci/cd","pipeline","deployment","devops","automation","typescript"],"contributors":[{"name":"Marco Wettstein","email":"maw@panter.ch"},{"name":"Michael Leu","email":"leu@panter.ch"},{"name":"Luboš Matejčík","email":"lma@panter.ch"},{"name":"Kaspar Vollenweider","email":"vok@panter.ch"},{"name":"Silvan Adrian","email":"sia@panter.ch"},{"name":"Stefan Bakocs","email":"stb@panter.ch"},{"name":"Lukas Brezina","email":"brl@panter.ch"}],"license":"MIT","version":"0.0.0","scripts":{"lint":"eslint \\"src/**/*.ts\\"","lint:fix":"eslint \\"src/**/*.ts\\" --fix","test":"yarn run lint","build":"yarn build:compile && yarn build:bundle","build:bundle":"./scripts/bundle","build:compile":"yarn tsc","build:watch":"yarn tsc -w"},"bin":{"catci":"./bin/catci","catenv":"./bin/catenv","catladder":"./bin/catladder"},"engines":{"node":">=12.0.0"},"devDependencies":{"@catladder/pipeline":"0.0.0","@gitbeaker/rest":"^39.28.0","@kubernetes/client-node":"^0.16.2","@tsconfig/node14":"^1.0.1","@types/common-tags":"^1.8.0","@types/fs-extra":"^5.0.4","@types/js-yaml":"^4.0.5","@types/lodash":"^4.14.185","@types/memoizee":"^0.4.2","@types/node-fetch":"^2.1.4","@types/request":"^2.48.1","@types/tmp":"^0.2.3","@types/update-notifier":"^2.5.0","@types/vorpal":"^1.12.0","@types/websocket":"^0.0.40","@types/yargs":"^13.0.0","child-process-promise":"^2.2.1","clipboardy":"^2.0.0","command-exists-promise":"^2.0.2","common-tags":"^1.8.0","connection-string-parser":"^1.0.4","dayjs":"^1.10.4","eslint":"^8.7.0","fs-extra":"^7.0.1","gitlab":"^4.4.1","js-yaml":"^4.1.0","lodash":"^4.17.21","memoizee":"^0.4.14","node-fetch":"^2.3.0","open":"^8.4.0","prettier":"^2.5.1","tmp-promise":"^2.0.2","ts-node":"^10.9.1","ts-results-es":"^4.1.0-alpha.1","typescript":"^4.5.4","vorpal":"^1.12.0"}}');
|
|
363611
364725
|
|
|
363612
364726
|
/***/ }),
|
|
363613
364727
|
|