@catladder/cli 0.0.0-refactor-cloud-run-825d7e86 → 0.0.0-refactore-catenv-command-validates-argument-78d05852
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 +86 -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 +185 -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/catenv/catenv.d.ts +1 -2
- package/dist/apps/catenv/catenv.js +4 -2
- package/dist/apps/catenv/catenv.js.map +1 -1
- 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 +71390 -0
- package/dist/bundles/catenv/index.js +114 -47
- package/dist/bundles/cli/index.js +2195 -1063
- package/dist/catci.d.ts +1 -0
- package/dist/catci.js +5 -0
- package/dist/catci.js.map +1 -0
- package/dist/catenv.js +1 -3
- package/dist/catenv.js.map +1 -1
- package/dist/config/getProjectConfig.js +6 -9
- package/dist/config/getProjectConfig.js.map +1 -1
- package/dist/config/parseChoiceArgument.d.ts +13 -0
- package/dist/config/parseChoiceArgument.js +43 -0
- package/dist/config/parseChoiceArgument.js.map +1 -0
- package/dist/gcloud/serviceAccounts.js +3 -1
- package/dist/gcloud/serviceAccounts.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -5
- package/scripts/bundle +2 -0
- package/src/apps/catci/catci.ts +26 -0
- package/src/apps/catci/commands/security/auditDocument.ts +150 -0
- package/src/apps/catci/commands/security/commands.ts +161 -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/catenv/catenv.ts +8 -6
- 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
- package/src/catenv.ts +2 -6
- package/src/config/getProjectConfig.ts +9 -11
- package/src/config/parseChoiceArgument.ts +50 -0
- package/src/gcloud/serviceAccounts.ts +2 -1
|
@@ -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
|
}); });
|
|
@@ -6575,15 +6953,12 @@ var resolveSecrets = function (vorpal, varSets) { return __awaiter(void 0, void
|
|
|
6575
6953
|
.map(function (_a) {
|
|
6576
6954
|
var key = _a[0], value = _a[1];
|
|
6577
6955
|
var secretKey = set.secretEnvVarKeys.find(function (k) { return k.key === key; });
|
|
6578
|
-
if (secretKey) {
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
value = value.replace(new RegExp("\\$" + variable.key, "g"), variable.value);
|
|
6585
|
-
}
|
|
6586
|
-
return [key, value];
|
|
6956
|
+
if ((secretKey === null || secretKey === void 0 ? void 0 : secretKey.hidden) || value === undefined) {
|
|
6957
|
+
return null;
|
|
6958
|
+
}
|
|
6959
|
+
for (var _i = 0, allVariablesInGitlab_1 = allVariablesInGitlab; _i < allVariablesInGitlab_1.length; _i++) {
|
|
6960
|
+
var variable = allVariablesInGitlab_1[_i];
|
|
6961
|
+
value = value.replace(new RegExp("\\$" + variable.key, "g"), variable.value);
|
|
6587
6962
|
}
|
|
6588
6963
|
return [key, value];
|
|
6589
6964
|
})
|
|
@@ -7335,7 +7710,9 @@ var upsertGcloudServiceAccount = function (context, account) { return __awaiter(
|
|
|
7335
7710
|
case 11:
|
|
7336
7711
|
_a++;
|
|
7337
7712
|
return [3 /*break*/, 9];
|
|
7338
|
-
case 12: return [4 /*yield*/, (0, child_process_promise_1.exec)(
|
|
7713
|
+
case 12: return [4 /*yield*/, (0, child_process_promise_1.exec)(
|
|
7714
|
+
// on some platforms /dev/stdout is not available without the pipe
|
|
7715
|
+
"gcloud iam service-accounts keys create /dev/stdout --iam-account=".concat(fullIdentifier, " | cat")).then(function (o) { return o.stdout; })];
|
|
7339
7716
|
case 13: return [2 /*return*/, _b.sent()];
|
|
7340
7717
|
}
|
|
7341
7718
|
});
|
|
@@ -301990,672 +302367,6 @@ var pump = function () {
|
|
|
301990
302367
|
module.exports = pump
|
|
301991
302368
|
|
|
301992
302369
|
|
|
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
302370
|
/***/ }),
|
|
302660
302371
|
|
|
302661
302372
|
/***/ 5074:
|
|
@@ -303959,7 +303670,7 @@ exports.$ = Multipart
|
|
|
303959
303670
|
|
|
303960
303671
|
|
|
303961
303672
|
var url = __nccwpck_require__(57310)
|
|
303962
|
-
var qs = __nccwpck_require__(
|
|
303673
|
+
var qs = __nccwpck_require__(41746)
|
|
303963
303674
|
var caseless = __nccwpck_require__(30071)
|
|
303964
303675
|
var uuid = __nccwpck_require__(79180)
|
|
303965
303676
|
var oauth = __nccwpck_require__(91579)
|
|
@@ -304114,7 +303825,7 @@ exports.f = OAuth
|
|
|
304114
303825
|
"use strict";
|
|
304115
303826
|
|
|
304116
303827
|
|
|
304117
|
-
var qs = __nccwpck_require__(
|
|
303828
|
+
var qs = __nccwpck_require__(41746)
|
|
304118
303829
|
var querystring = __nccwpck_require__(63477)
|
|
304119
303830
|
|
|
304120
303831
|
function Querystring (request) {
|
|
@@ -304990,6 +304701,672 @@ module.exports = function(dst, src) {
|
|
|
304990
304701
|
};
|
|
304991
304702
|
|
|
304992
304703
|
|
|
304704
|
+
/***/ }),
|
|
304705
|
+
|
|
304706
|
+
/***/ 98876:
|
|
304707
|
+
/***/ ((module) => {
|
|
304708
|
+
|
|
304709
|
+
"use strict";
|
|
304710
|
+
|
|
304711
|
+
|
|
304712
|
+
var replace = String.prototype.replace;
|
|
304713
|
+
var percentTwenties = /%20/g;
|
|
304714
|
+
|
|
304715
|
+
module.exports = {
|
|
304716
|
+
'default': 'RFC3986',
|
|
304717
|
+
formatters: {
|
|
304718
|
+
RFC1738: function (value) {
|
|
304719
|
+
return replace.call(value, percentTwenties, '+');
|
|
304720
|
+
},
|
|
304721
|
+
RFC3986: function (value) {
|
|
304722
|
+
return value;
|
|
304723
|
+
}
|
|
304724
|
+
},
|
|
304725
|
+
RFC1738: 'RFC1738',
|
|
304726
|
+
RFC3986: 'RFC3986'
|
|
304727
|
+
};
|
|
304728
|
+
|
|
304729
|
+
|
|
304730
|
+
/***/ }),
|
|
304731
|
+
|
|
304732
|
+
/***/ 41746:
|
|
304733
|
+
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
304734
|
+
|
|
304735
|
+
"use strict";
|
|
304736
|
+
|
|
304737
|
+
|
|
304738
|
+
var stringify = __nccwpck_require__(44901);
|
|
304739
|
+
var parse = __nccwpck_require__(78832);
|
|
304740
|
+
var formats = __nccwpck_require__(98876);
|
|
304741
|
+
|
|
304742
|
+
module.exports = {
|
|
304743
|
+
formats: formats,
|
|
304744
|
+
parse: parse,
|
|
304745
|
+
stringify: stringify
|
|
304746
|
+
};
|
|
304747
|
+
|
|
304748
|
+
|
|
304749
|
+
/***/ }),
|
|
304750
|
+
|
|
304751
|
+
/***/ 78832:
|
|
304752
|
+
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
304753
|
+
|
|
304754
|
+
"use strict";
|
|
304755
|
+
|
|
304756
|
+
|
|
304757
|
+
var utils = __nccwpck_require__(8980);
|
|
304758
|
+
|
|
304759
|
+
var has = Object.prototype.hasOwnProperty;
|
|
304760
|
+
|
|
304761
|
+
var defaults = {
|
|
304762
|
+
allowDots: false,
|
|
304763
|
+
allowPrototypes: false,
|
|
304764
|
+
arrayLimit: 20,
|
|
304765
|
+
decoder: utils.decode,
|
|
304766
|
+
delimiter: '&',
|
|
304767
|
+
depth: 5,
|
|
304768
|
+
parameterLimit: 1000,
|
|
304769
|
+
plainObjects: false,
|
|
304770
|
+
strictNullHandling: false
|
|
304771
|
+
};
|
|
304772
|
+
|
|
304773
|
+
var parseValues = function parseQueryStringValues(str, options) {
|
|
304774
|
+
var obj = {};
|
|
304775
|
+
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
|
|
304776
|
+
var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
|
|
304777
|
+
var parts = cleanStr.split(options.delimiter, limit);
|
|
304778
|
+
|
|
304779
|
+
for (var i = 0; i < parts.length; ++i) {
|
|
304780
|
+
var part = parts[i];
|
|
304781
|
+
|
|
304782
|
+
var bracketEqualsPos = part.indexOf(']=');
|
|
304783
|
+
var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
|
|
304784
|
+
|
|
304785
|
+
var key, val;
|
|
304786
|
+
if (pos === -1) {
|
|
304787
|
+
key = options.decoder(part, defaults.decoder);
|
|
304788
|
+
val = options.strictNullHandling ? null : '';
|
|
304789
|
+
} else {
|
|
304790
|
+
key = options.decoder(part.slice(0, pos), defaults.decoder);
|
|
304791
|
+
val = options.decoder(part.slice(pos + 1), defaults.decoder);
|
|
304792
|
+
}
|
|
304793
|
+
if (has.call(obj, key)) {
|
|
304794
|
+
obj[key] = [].concat(obj[key]).concat(val);
|
|
304795
|
+
} else {
|
|
304796
|
+
obj[key] = val;
|
|
304797
|
+
}
|
|
304798
|
+
}
|
|
304799
|
+
|
|
304800
|
+
return obj;
|
|
304801
|
+
};
|
|
304802
|
+
|
|
304803
|
+
var parseObject = function (chain, val, options) {
|
|
304804
|
+
var leaf = val;
|
|
304805
|
+
|
|
304806
|
+
for (var i = chain.length - 1; i >= 0; --i) {
|
|
304807
|
+
var obj;
|
|
304808
|
+
var root = chain[i];
|
|
304809
|
+
|
|
304810
|
+
if (root === '[]') {
|
|
304811
|
+
obj = [];
|
|
304812
|
+
obj = obj.concat(leaf);
|
|
304813
|
+
} else {
|
|
304814
|
+
obj = options.plainObjects ? Object.create(null) : {};
|
|
304815
|
+
var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
|
|
304816
|
+
var index = parseInt(cleanRoot, 10);
|
|
304817
|
+
if (
|
|
304818
|
+
!isNaN(index)
|
|
304819
|
+
&& root !== cleanRoot
|
|
304820
|
+
&& String(index) === cleanRoot
|
|
304821
|
+
&& index >= 0
|
|
304822
|
+
&& (options.parseArrays && index <= options.arrayLimit)
|
|
304823
|
+
) {
|
|
304824
|
+
obj = [];
|
|
304825
|
+
obj[index] = leaf;
|
|
304826
|
+
} else {
|
|
304827
|
+
obj[cleanRoot] = leaf;
|
|
304828
|
+
}
|
|
304829
|
+
}
|
|
304830
|
+
|
|
304831
|
+
leaf = obj;
|
|
304832
|
+
}
|
|
304833
|
+
|
|
304834
|
+
return leaf;
|
|
304835
|
+
};
|
|
304836
|
+
|
|
304837
|
+
var parseKeys = function parseQueryStringKeys(givenKey, val, options) {
|
|
304838
|
+
if (!givenKey) {
|
|
304839
|
+
return;
|
|
304840
|
+
}
|
|
304841
|
+
|
|
304842
|
+
// Transform dot notation to bracket notation
|
|
304843
|
+
var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
|
|
304844
|
+
|
|
304845
|
+
// The regex chunks
|
|
304846
|
+
|
|
304847
|
+
var brackets = /(\[[^[\]]*])/;
|
|
304848
|
+
var child = /(\[[^[\]]*])/g;
|
|
304849
|
+
|
|
304850
|
+
// Get the parent
|
|
304851
|
+
|
|
304852
|
+
var segment = brackets.exec(key);
|
|
304853
|
+
var parent = segment ? key.slice(0, segment.index) : key;
|
|
304854
|
+
|
|
304855
|
+
// Stash the parent if it exists
|
|
304856
|
+
|
|
304857
|
+
var keys = [];
|
|
304858
|
+
if (parent) {
|
|
304859
|
+
// If we aren't using plain objects, optionally prefix keys
|
|
304860
|
+
// that would overwrite object prototype properties
|
|
304861
|
+
if (!options.plainObjects && has.call(Object.prototype, parent)) {
|
|
304862
|
+
if (!options.allowPrototypes) {
|
|
304863
|
+
return;
|
|
304864
|
+
}
|
|
304865
|
+
}
|
|
304866
|
+
|
|
304867
|
+
keys.push(parent);
|
|
304868
|
+
}
|
|
304869
|
+
|
|
304870
|
+
// Loop through children appending to the array until we hit depth
|
|
304871
|
+
|
|
304872
|
+
var i = 0;
|
|
304873
|
+
while ((segment = child.exec(key)) !== null && i < options.depth) {
|
|
304874
|
+
i += 1;
|
|
304875
|
+
if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
|
|
304876
|
+
if (!options.allowPrototypes) {
|
|
304877
|
+
return;
|
|
304878
|
+
}
|
|
304879
|
+
}
|
|
304880
|
+
keys.push(segment[1]);
|
|
304881
|
+
}
|
|
304882
|
+
|
|
304883
|
+
// If there's a remainder, just add whatever is left
|
|
304884
|
+
|
|
304885
|
+
if (segment) {
|
|
304886
|
+
keys.push('[' + key.slice(segment.index) + ']');
|
|
304887
|
+
}
|
|
304888
|
+
|
|
304889
|
+
return parseObject(keys, val, options);
|
|
304890
|
+
};
|
|
304891
|
+
|
|
304892
|
+
module.exports = function (str, opts) {
|
|
304893
|
+
var options = opts ? utils.assign({}, opts) : {};
|
|
304894
|
+
|
|
304895
|
+
if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') {
|
|
304896
|
+
throw new TypeError('Decoder has to be a function.');
|
|
304897
|
+
}
|
|
304898
|
+
|
|
304899
|
+
options.ignoreQueryPrefix = options.ignoreQueryPrefix === true;
|
|
304900
|
+
options.delimiter = typeof options.delimiter === 'string' || utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter;
|
|
304901
|
+
options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth;
|
|
304902
|
+
options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit;
|
|
304903
|
+
options.parseArrays = options.parseArrays !== false;
|
|
304904
|
+
options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults.decoder;
|
|
304905
|
+
options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults.allowDots;
|
|
304906
|
+
options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults.plainObjects;
|
|
304907
|
+
options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes;
|
|
304908
|
+
options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit;
|
|
304909
|
+
options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;
|
|
304910
|
+
|
|
304911
|
+
if (str === '' || str === null || typeof str === 'undefined') {
|
|
304912
|
+
return options.plainObjects ? Object.create(null) : {};
|
|
304913
|
+
}
|
|
304914
|
+
|
|
304915
|
+
var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
|
|
304916
|
+
var obj = options.plainObjects ? Object.create(null) : {};
|
|
304917
|
+
|
|
304918
|
+
// Iterate over the keys and setup the new object
|
|
304919
|
+
|
|
304920
|
+
var keys = Object.keys(tempObj);
|
|
304921
|
+
for (var i = 0; i < keys.length; ++i) {
|
|
304922
|
+
var key = keys[i];
|
|
304923
|
+
var newObj = parseKeys(key, tempObj[key], options);
|
|
304924
|
+
obj = utils.merge(obj, newObj, options);
|
|
304925
|
+
}
|
|
304926
|
+
|
|
304927
|
+
return utils.compact(obj);
|
|
304928
|
+
};
|
|
304929
|
+
|
|
304930
|
+
|
|
304931
|
+
/***/ }),
|
|
304932
|
+
|
|
304933
|
+
/***/ 44901:
|
|
304934
|
+
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
304935
|
+
|
|
304936
|
+
"use strict";
|
|
304937
|
+
|
|
304938
|
+
|
|
304939
|
+
var utils = __nccwpck_require__(8980);
|
|
304940
|
+
var formats = __nccwpck_require__(98876);
|
|
304941
|
+
|
|
304942
|
+
var arrayPrefixGenerators = {
|
|
304943
|
+
brackets: function brackets(prefix) { // eslint-disable-line func-name-matching
|
|
304944
|
+
return prefix + '[]';
|
|
304945
|
+
},
|
|
304946
|
+
indices: function indices(prefix, key) { // eslint-disable-line func-name-matching
|
|
304947
|
+
return prefix + '[' + key + ']';
|
|
304948
|
+
},
|
|
304949
|
+
repeat: function repeat(prefix) { // eslint-disable-line func-name-matching
|
|
304950
|
+
return prefix;
|
|
304951
|
+
}
|
|
304952
|
+
};
|
|
304953
|
+
|
|
304954
|
+
var toISO = Date.prototype.toISOString;
|
|
304955
|
+
|
|
304956
|
+
var defaults = {
|
|
304957
|
+
delimiter: '&',
|
|
304958
|
+
encode: true,
|
|
304959
|
+
encoder: utils.encode,
|
|
304960
|
+
encodeValuesOnly: false,
|
|
304961
|
+
serializeDate: function serializeDate(date) { // eslint-disable-line func-name-matching
|
|
304962
|
+
return toISO.call(date);
|
|
304963
|
+
},
|
|
304964
|
+
skipNulls: false,
|
|
304965
|
+
strictNullHandling: false
|
|
304966
|
+
};
|
|
304967
|
+
|
|
304968
|
+
var stringify = function stringify( // eslint-disable-line func-name-matching
|
|
304969
|
+
object,
|
|
304970
|
+
prefix,
|
|
304971
|
+
generateArrayPrefix,
|
|
304972
|
+
strictNullHandling,
|
|
304973
|
+
skipNulls,
|
|
304974
|
+
encoder,
|
|
304975
|
+
filter,
|
|
304976
|
+
sort,
|
|
304977
|
+
allowDots,
|
|
304978
|
+
serializeDate,
|
|
304979
|
+
formatter,
|
|
304980
|
+
encodeValuesOnly
|
|
304981
|
+
) {
|
|
304982
|
+
var obj = object;
|
|
304983
|
+
if (typeof filter === 'function') {
|
|
304984
|
+
obj = filter(prefix, obj);
|
|
304985
|
+
} else if (obj instanceof Date) {
|
|
304986
|
+
obj = serializeDate(obj);
|
|
304987
|
+
} else if (obj === null) {
|
|
304988
|
+
if (strictNullHandling) {
|
|
304989
|
+
return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder) : prefix;
|
|
304990
|
+
}
|
|
304991
|
+
|
|
304992
|
+
obj = '';
|
|
304993
|
+
}
|
|
304994
|
+
|
|
304995
|
+
if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) {
|
|
304996
|
+
if (encoder) {
|
|
304997
|
+
var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder);
|
|
304998
|
+
return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder))];
|
|
304999
|
+
}
|
|
305000
|
+
return [formatter(prefix) + '=' + formatter(String(obj))];
|
|
305001
|
+
}
|
|
305002
|
+
|
|
305003
|
+
var values = [];
|
|
305004
|
+
|
|
305005
|
+
if (typeof obj === 'undefined') {
|
|
305006
|
+
return values;
|
|
305007
|
+
}
|
|
305008
|
+
|
|
305009
|
+
var objKeys;
|
|
305010
|
+
if (Array.isArray(filter)) {
|
|
305011
|
+
objKeys = filter;
|
|
305012
|
+
} else {
|
|
305013
|
+
var keys = Object.keys(obj);
|
|
305014
|
+
objKeys = sort ? keys.sort(sort) : keys;
|
|
305015
|
+
}
|
|
305016
|
+
|
|
305017
|
+
for (var i = 0; i < objKeys.length; ++i) {
|
|
305018
|
+
var key = objKeys[i];
|
|
305019
|
+
|
|
305020
|
+
if (skipNulls && obj[key] === null) {
|
|
305021
|
+
continue;
|
|
305022
|
+
}
|
|
305023
|
+
|
|
305024
|
+
if (Array.isArray(obj)) {
|
|
305025
|
+
values = values.concat(stringify(
|
|
305026
|
+
obj[key],
|
|
305027
|
+
generateArrayPrefix(prefix, key),
|
|
305028
|
+
generateArrayPrefix,
|
|
305029
|
+
strictNullHandling,
|
|
305030
|
+
skipNulls,
|
|
305031
|
+
encoder,
|
|
305032
|
+
filter,
|
|
305033
|
+
sort,
|
|
305034
|
+
allowDots,
|
|
305035
|
+
serializeDate,
|
|
305036
|
+
formatter,
|
|
305037
|
+
encodeValuesOnly
|
|
305038
|
+
));
|
|
305039
|
+
} else {
|
|
305040
|
+
values = values.concat(stringify(
|
|
305041
|
+
obj[key],
|
|
305042
|
+
prefix + (allowDots ? '.' + key : '[' + key + ']'),
|
|
305043
|
+
generateArrayPrefix,
|
|
305044
|
+
strictNullHandling,
|
|
305045
|
+
skipNulls,
|
|
305046
|
+
encoder,
|
|
305047
|
+
filter,
|
|
305048
|
+
sort,
|
|
305049
|
+
allowDots,
|
|
305050
|
+
serializeDate,
|
|
305051
|
+
formatter,
|
|
305052
|
+
encodeValuesOnly
|
|
305053
|
+
));
|
|
305054
|
+
}
|
|
305055
|
+
}
|
|
305056
|
+
|
|
305057
|
+
return values;
|
|
305058
|
+
};
|
|
305059
|
+
|
|
305060
|
+
module.exports = function (object, opts) {
|
|
305061
|
+
var obj = object;
|
|
305062
|
+
var options = opts ? utils.assign({}, opts) : {};
|
|
305063
|
+
|
|
305064
|
+
if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') {
|
|
305065
|
+
throw new TypeError('Encoder has to be a function.');
|
|
305066
|
+
}
|
|
305067
|
+
|
|
305068
|
+
var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter;
|
|
305069
|
+
var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;
|
|
305070
|
+
var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls;
|
|
305071
|
+
var encode = typeof options.encode === 'boolean' ? options.encode : defaults.encode;
|
|
305072
|
+
var encoder = typeof options.encoder === 'function' ? options.encoder : defaults.encoder;
|
|
305073
|
+
var sort = typeof options.sort === 'function' ? options.sort : null;
|
|
305074
|
+
var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots;
|
|
305075
|
+
var serializeDate = typeof options.serializeDate === 'function' ? options.serializeDate : defaults.serializeDate;
|
|
305076
|
+
var encodeValuesOnly = typeof options.encodeValuesOnly === 'boolean' ? options.encodeValuesOnly : defaults.encodeValuesOnly;
|
|
305077
|
+
if (typeof options.format === 'undefined') {
|
|
305078
|
+
options.format = formats['default'];
|
|
305079
|
+
} else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options.format)) {
|
|
305080
|
+
throw new TypeError('Unknown format option provided.');
|
|
305081
|
+
}
|
|
305082
|
+
var formatter = formats.formatters[options.format];
|
|
305083
|
+
var objKeys;
|
|
305084
|
+
var filter;
|
|
305085
|
+
|
|
305086
|
+
if (typeof options.filter === 'function') {
|
|
305087
|
+
filter = options.filter;
|
|
305088
|
+
obj = filter('', obj);
|
|
305089
|
+
} else if (Array.isArray(options.filter)) {
|
|
305090
|
+
filter = options.filter;
|
|
305091
|
+
objKeys = filter;
|
|
305092
|
+
}
|
|
305093
|
+
|
|
305094
|
+
var keys = [];
|
|
305095
|
+
|
|
305096
|
+
if (typeof obj !== 'object' || obj === null) {
|
|
305097
|
+
return '';
|
|
305098
|
+
}
|
|
305099
|
+
|
|
305100
|
+
var arrayFormat;
|
|
305101
|
+
if (options.arrayFormat in arrayPrefixGenerators) {
|
|
305102
|
+
arrayFormat = options.arrayFormat;
|
|
305103
|
+
} else if ('indices' in options) {
|
|
305104
|
+
arrayFormat = options.indices ? 'indices' : 'repeat';
|
|
305105
|
+
} else {
|
|
305106
|
+
arrayFormat = 'indices';
|
|
305107
|
+
}
|
|
305108
|
+
|
|
305109
|
+
var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
|
|
305110
|
+
|
|
305111
|
+
if (!objKeys) {
|
|
305112
|
+
objKeys = Object.keys(obj);
|
|
305113
|
+
}
|
|
305114
|
+
|
|
305115
|
+
if (sort) {
|
|
305116
|
+
objKeys.sort(sort);
|
|
305117
|
+
}
|
|
305118
|
+
|
|
305119
|
+
for (var i = 0; i < objKeys.length; ++i) {
|
|
305120
|
+
var key = objKeys[i];
|
|
305121
|
+
|
|
305122
|
+
if (skipNulls && obj[key] === null) {
|
|
305123
|
+
continue;
|
|
305124
|
+
}
|
|
305125
|
+
|
|
305126
|
+
keys = keys.concat(stringify(
|
|
305127
|
+
obj[key],
|
|
305128
|
+
key,
|
|
305129
|
+
generateArrayPrefix,
|
|
305130
|
+
strictNullHandling,
|
|
305131
|
+
skipNulls,
|
|
305132
|
+
encode ? encoder : null,
|
|
305133
|
+
filter,
|
|
305134
|
+
sort,
|
|
305135
|
+
allowDots,
|
|
305136
|
+
serializeDate,
|
|
305137
|
+
formatter,
|
|
305138
|
+
encodeValuesOnly
|
|
305139
|
+
));
|
|
305140
|
+
}
|
|
305141
|
+
|
|
305142
|
+
var joined = keys.join(delimiter);
|
|
305143
|
+
var prefix = options.addQueryPrefix === true ? '?' : '';
|
|
305144
|
+
|
|
305145
|
+
return joined.length > 0 ? prefix + joined : '';
|
|
305146
|
+
};
|
|
305147
|
+
|
|
305148
|
+
|
|
305149
|
+
/***/ }),
|
|
305150
|
+
|
|
305151
|
+
/***/ 8980:
|
|
305152
|
+
/***/ ((module) => {
|
|
305153
|
+
|
|
305154
|
+
"use strict";
|
|
305155
|
+
|
|
305156
|
+
|
|
305157
|
+
var has = Object.prototype.hasOwnProperty;
|
|
305158
|
+
|
|
305159
|
+
var hexTable = (function () {
|
|
305160
|
+
var array = [];
|
|
305161
|
+
for (var i = 0; i < 256; ++i) {
|
|
305162
|
+
array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
|
|
305163
|
+
}
|
|
305164
|
+
|
|
305165
|
+
return array;
|
|
305166
|
+
}());
|
|
305167
|
+
|
|
305168
|
+
var compactQueue = function compactQueue(queue) {
|
|
305169
|
+
var obj;
|
|
305170
|
+
|
|
305171
|
+
while (queue.length) {
|
|
305172
|
+
var item = queue.pop();
|
|
305173
|
+
obj = item.obj[item.prop];
|
|
305174
|
+
|
|
305175
|
+
if (Array.isArray(obj)) {
|
|
305176
|
+
var compacted = [];
|
|
305177
|
+
|
|
305178
|
+
for (var j = 0; j < obj.length; ++j) {
|
|
305179
|
+
if (typeof obj[j] !== 'undefined') {
|
|
305180
|
+
compacted.push(obj[j]);
|
|
305181
|
+
}
|
|
305182
|
+
}
|
|
305183
|
+
|
|
305184
|
+
item.obj[item.prop] = compacted;
|
|
305185
|
+
}
|
|
305186
|
+
}
|
|
305187
|
+
|
|
305188
|
+
return obj;
|
|
305189
|
+
};
|
|
305190
|
+
|
|
305191
|
+
var arrayToObject = function arrayToObject(source, options) {
|
|
305192
|
+
var obj = options && options.plainObjects ? Object.create(null) : {};
|
|
305193
|
+
for (var i = 0; i < source.length; ++i) {
|
|
305194
|
+
if (typeof source[i] !== 'undefined') {
|
|
305195
|
+
obj[i] = source[i];
|
|
305196
|
+
}
|
|
305197
|
+
}
|
|
305198
|
+
|
|
305199
|
+
return obj;
|
|
305200
|
+
};
|
|
305201
|
+
|
|
305202
|
+
var merge = function merge(target, source, options) {
|
|
305203
|
+
if (!source) {
|
|
305204
|
+
return target;
|
|
305205
|
+
}
|
|
305206
|
+
|
|
305207
|
+
if (typeof source !== 'object') {
|
|
305208
|
+
if (Array.isArray(target)) {
|
|
305209
|
+
target.push(source);
|
|
305210
|
+
} else if (typeof target === 'object') {
|
|
305211
|
+
if (options.plainObjects || options.allowPrototypes || !has.call(Object.prototype, source)) {
|
|
305212
|
+
target[source] = true;
|
|
305213
|
+
}
|
|
305214
|
+
} else {
|
|
305215
|
+
return [target, source];
|
|
305216
|
+
}
|
|
305217
|
+
|
|
305218
|
+
return target;
|
|
305219
|
+
}
|
|
305220
|
+
|
|
305221
|
+
if (typeof target !== 'object') {
|
|
305222
|
+
return [target].concat(source);
|
|
305223
|
+
}
|
|
305224
|
+
|
|
305225
|
+
var mergeTarget = target;
|
|
305226
|
+
if (Array.isArray(target) && !Array.isArray(source)) {
|
|
305227
|
+
mergeTarget = arrayToObject(target, options);
|
|
305228
|
+
}
|
|
305229
|
+
|
|
305230
|
+
if (Array.isArray(target) && Array.isArray(source)) {
|
|
305231
|
+
source.forEach(function (item, i) {
|
|
305232
|
+
if (has.call(target, i)) {
|
|
305233
|
+
if (target[i] && typeof target[i] === 'object') {
|
|
305234
|
+
target[i] = merge(target[i], item, options);
|
|
305235
|
+
} else {
|
|
305236
|
+
target.push(item);
|
|
305237
|
+
}
|
|
305238
|
+
} else {
|
|
305239
|
+
target[i] = item;
|
|
305240
|
+
}
|
|
305241
|
+
});
|
|
305242
|
+
return target;
|
|
305243
|
+
}
|
|
305244
|
+
|
|
305245
|
+
return Object.keys(source).reduce(function (acc, key) {
|
|
305246
|
+
var value = source[key];
|
|
305247
|
+
|
|
305248
|
+
if (has.call(acc, key)) {
|
|
305249
|
+
acc[key] = merge(acc[key], value, options);
|
|
305250
|
+
} else {
|
|
305251
|
+
acc[key] = value;
|
|
305252
|
+
}
|
|
305253
|
+
return acc;
|
|
305254
|
+
}, mergeTarget);
|
|
305255
|
+
};
|
|
305256
|
+
|
|
305257
|
+
var assign = function assignSingleSource(target, source) {
|
|
305258
|
+
return Object.keys(source).reduce(function (acc, key) {
|
|
305259
|
+
acc[key] = source[key];
|
|
305260
|
+
return acc;
|
|
305261
|
+
}, target);
|
|
305262
|
+
};
|
|
305263
|
+
|
|
305264
|
+
var decode = function (str) {
|
|
305265
|
+
try {
|
|
305266
|
+
return decodeURIComponent(str.replace(/\+/g, ' '));
|
|
305267
|
+
} catch (e) {
|
|
305268
|
+
return str;
|
|
305269
|
+
}
|
|
305270
|
+
};
|
|
305271
|
+
|
|
305272
|
+
var encode = function encode(str) {
|
|
305273
|
+
// This code was originally written by Brian White (mscdex) for the io.js core querystring library.
|
|
305274
|
+
// It has been adapted here for stricter adherence to RFC 3986
|
|
305275
|
+
if (str.length === 0) {
|
|
305276
|
+
return str;
|
|
305277
|
+
}
|
|
305278
|
+
|
|
305279
|
+
var string = typeof str === 'string' ? str : String(str);
|
|
305280
|
+
|
|
305281
|
+
var out = '';
|
|
305282
|
+
for (var i = 0; i < string.length; ++i) {
|
|
305283
|
+
var c = string.charCodeAt(i);
|
|
305284
|
+
|
|
305285
|
+
if (
|
|
305286
|
+
c === 0x2D // -
|
|
305287
|
+
|| c === 0x2E // .
|
|
305288
|
+
|| c === 0x5F // _
|
|
305289
|
+
|| c === 0x7E // ~
|
|
305290
|
+
|| (c >= 0x30 && c <= 0x39) // 0-9
|
|
305291
|
+
|| (c >= 0x41 && c <= 0x5A) // a-z
|
|
305292
|
+
|| (c >= 0x61 && c <= 0x7A) // A-Z
|
|
305293
|
+
) {
|
|
305294
|
+
out += string.charAt(i);
|
|
305295
|
+
continue;
|
|
305296
|
+
}
|
|
305297
|
+
|
|
305298
|
+
if (c < 0x80) {
|
|
305299
|
+
out = out + hexTable[c];
|
|
305300
|
+
continue;
|
|
305301
|
+
}
|
|
305302
|
+
|
|
305303
|
+
if (c < 0x800) {
|
|
305304
|
+
out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
|
|
305305
|
+
continue;
|
|
305306
|
+
}
|
|
305307
|
+
|
|
305308
|
+
if (c < 0xD800 || c >= 0xE000) {
|
|
305309
|
+
out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
|
|
305310
|
+
continue;
|
|
305311
|
+
}
|
|
305312
|
+
|
|
305313
|
+
i += 1;
|
|
305314
|
+
c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
|
|
305315
|
+
out += hexTable[0xF0 | (c >> 18)]
|
|
305316
|
+
+ hexTable[0x80 | ((c >> 12) & 0x3F)]
|
|
305317
|
+
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
|
|
305318
|
+
+ hexTable[0x80 | (c & 0x3F)];
|
|
305319
|
+
}
|
|
305320
|
+
|
|
305321
|
+
return out;
|
|
305322
|
+
};
|
|
305323
|
+
|
|
305324
|
+
var compact = function compact(value) {
|
|
305325
|
+
var queue = [{ obj: { o: value }, prop: 'o' }];
|
|
305326
|
+
var refs = [];
|
|
305327
|
+
|
|
305328
|
+
for (var i = 0; i < queue.length; ++i) {
|
|
305329
|
+
var item = queue[i];
|
|
305330
|
+
var obj = item.obj[item.prop];
|
|
305331
|
+
|
|
305332
|
+
var keys = Object.keys(obj);
|
|
305333
|
+
for (var j = 0; j < keys.length; ++j) {
|
|
305334
|
+
var key = keys[j];
|
|
305335
|
+
var val = obj[key];
|
|
305336
|
+
if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
|
|
305337
|
+
queue.push({ obj: obj, prop: key });
|
|
305338
|
+
refs.push(val);
|
|
305339
|
+
}
|
|
305340
|
+
}
|
|
305341
|
+
}
|
|
305342
|
+
|
|
305343
|
+
return compactQueue(queue);
|
|
305344
|
+
};
|
|
305345
|
+
|
|
305346
|
+
var isRegExp = function isRegExp(obj) {
|
|
305347
|
+
return Object.prototype.toString.call(obj) === '[object RegExp]';
|
|
305348
|
+
};
|
|
305349
|
+
|
|
305350
|
+
var isBuffer = function isBuffer(obj) {
|
|
305351
|
+
if (obj === null || typeof obj === 'undefined') {
|
|
305352
|
+
return false;
|
|
305353
|
+
}
|
|
305354
|
+
|
|
305355
|
+
return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
|
|
305356
|
+
};
|
|
305357
|
+
|
|
305358
|
+
module.exports = {
|
|
305359
|
+
arrayToObject: arrayToObject,
|
|
305360
|
+
assign: assign,
|
|
305361
|
+
compact: compact,
|
|
305362
|
+
decode: decode,
|
|
305363
|
+
encode: encode,
|
|
305364
|
+
isBuffer: isBuffer,
|
|
305365
|
+
isRegExp: isRegExp,
|
|
305366
|
+
merge: merge
|
|
305367
|
+
};
|
|
305368
|
+
|
|
305369
|
+
|
|
304993
305370
|
/***/ }),
|
|
304994
305371
|
|
|
304995
305372
|
/***/ 97336:
|
|
@@ -355085,7 +355462,7 @@ var createRailsBuildJobs = function (context) {
|
|
|
355085
355462
|
dockerBuild: {
|
|
355086
355463
|
variables: __assign(__assign({}, context.environment.jobOnlyVars.build.envVars), context.componentConfig.build.extraVars),
|
|
355087
355464
|
// custom script
|
|
355088
|
-
script: __spreadArray(__spreadArray([], __read((0, docker_1.gitlabDockerLogin)(context)), false), ["docker pull $DOCKER_CACHE_IMAGE || true", "wget --output-document=- https://github.com/buildpacks/pack/releases/download/v".concat(cnbConf === null || cnbConf === void 0 ? void 0 : cnbConf.packVersion, "/pack-v").concat(cnbConf === null || cnbConf === void 0 ? void 0 : cnbConf.packVersion, "-linux.tgz | tar -zx --directory /usr/local/bin pack"), "chmod +x /usr/local/bin/pack",
|
|
355465
|
+
script: __spreadArray(__spreadArray([], __read((0, docker_1.gitlabDockerLogin)(context)), false), ["cd ".concat(context.componentConfig.dir), "docker pull $DOCKER_CACHE_IMAGE || true", "wget --output-document=- https://github.com/buildpacks/pack/releases/download/v".concat(cnbConf === null || cnbConf === void 0 ? void 0 : cnbConf.packVersion, "/pack-v").concat(cnbConf === null || cnbConf === void 0 ? void 0 : cnbConf.packVersion, "-linux.tgz | tar -zx --directory /usr/local/bin pack"), "chmod +x /usr/local/bin/pack",
|
|
355089
355466
|
// replace private git ssh gem sources with https to make bundler with credentials via env var work
|
|
355090
355467
|
"sed --in-place 's|git@\\([^:]*\\):|https://\\1/|g' Gemfile Gemfile.lock", "pack build \"$DOCKER_IMAGE:$DOCKER_IMAGE_TAG\" --builder '".concat(cnbConf === null || cnbConf === void 0 ? void 0 : cnbConf.image, "' --publish --cache-image \"$DOCKER_CACHE_IMAGE\" ").concat(packEnvArgs, " ").concat((_c = (_b = cnbConf === null || cnbConf === void 0 ? void 0 : cnbConf.packExtraArgs) === null || _b === void 0 ? void 0 : _b.join(" ")) !== null && _c !== void 0 ? _c : "")], false)
|
|
355091
355468
|
}
|
|
@@ -355470,7 +355847,7 @@ exports.readConfigSync = readConfigSync;
|
|
|
355470
355847
|
|
|
355471
355848
|
exports.__esModule = true;
|
|
355472
355849
|
exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
|
|
355473
|
-
exports.PIPELINE_IMAGE_TAG = "
|
|
355850
|
+
exports.PIPELINE_IMAGE_TAG = "refactore-catenv-command-validates-argument-78d05852" || 0;
|
|
355474
355851
|
exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
|
|
355475
355852
|
|
|
355476
355853
|
/***/ }),
|
|
@@ -356380,7 +356757,7 @@ exports.__esModule = true;
|
|
|
356380
356757
|
exports.translateLegacyFromComponents = exports.resolveReferences = void 0;
|
|
356381
356758
|
var lodash_1 = __nccwpck_require__(23255);
|
|
356382
356759
|
var string_replace_async_1 = __importDefault(__nccwpck_require__(44439));
|
|
356383
|
-
var REGEX = /\$\{(([^:]+):)?([^}]+)}/gm;
|
|
356760
|
+
var REGEX = /\$\{(([^:}]+):)?([^}]+)}/gm;
|
|
356384
356761
|
var resolveReferences = function (vars, getOtherVariables, alreadyVisitedBase) {
|
|
356385
356762
|
if (alreadyVisitedBase === void 0) {
|
|
356386
356763
|
alreadyVisitedBase = {};
|
|
@@ -357295,257 +357672,271 @@ var __read = this && this.__read || function (o, n) {
|
|
|
357295
357672
|
}
|
|
357296
357673
|
return ar;
|
|
357297
357674
|
};
|
|
357298
|
-
var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
357299
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
357300
|
-
if (ar || !(i in from)) {
|
|
357301
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
357302
|
-
ar[i] = from[i];
|
|
357303
|
-
}
|
|
357304
|
-
}
|
|
357305
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
357306
|
-
};
|
|
357675
|
+
var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
357676
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
357677
|
+
if (ar || !(i in from)) {
|
|
357678
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
357679
|
+
ar[i] = from[i];
|
|
357680
|
+
}
|
|
357681
|
+
}
|
|
357682
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
357683
|
+
};
|
|
357684
|
+
exports.__esModule = true;
|
|
357685
|
+
exports.getCreateScheduleScripts = exports.getJobCreateScripts = exports.getJobRunScripts = exports.getDeleteJobsScripts = exports.getDeleteSchedulesScripts = void 0;
|
|
357686
|
+
var gitlab_1 = __nccwpck_require__(84997);
|
|
357687
|
+
var createArgsString_1 = __nccwpck_require__(8686);
|
|
357688
|
+
var jobName_1 = __nccwpck_require__(77311);
|
|
357689
|
+
var common_1 = __nccwpck_require__(75655);
|
|
357690
|
+
var getLabels_1 = __nccwpck_require__(30486);
|
|
357691
|
+
var getJobRunScriptForJob = function (context, jobName, wait) {
|
|
357692
|
+
var commonArgs = (0, common_1.getCommonCloudRunArgs)(context);
|
|
357693
|
+
var commonArgsString = (0, createArgsString_1.createArgsString)(commonArgs);
|
|
357694
|
+
return "".concat((0, common_1.gcloudRunCmd)(), " jobs execute ").concat(jobName, " ").concat(commonArgsString).concat(wait ? " --wait" : "");
|
|
357695
|
+
};
|
|
357696
|
+
var getDeleteSchedulesScripts = function (context) {
|
|
357697
|
+
var deployConfig = (0, common_1.getCloudRunDeployConfig)(context);
|
|
357698
|
+
var jobsWithSchedule = getCloudRunJobsWithSchedule(context);
|
|
357699
|
+
var argsString = (0, createArgsString_1.createArgsString)({
|
|
357700
|
+
project: deployConfig.projectId,
|
|
357701
|
+
location: deployConfig.region
|
|
357702
|
+
});
|
|
357703
|
+
return jobsWithSchedule.map(function (_a) {
|
|
357704
|
+
var schedulerName = _a.schedulerName;
|
|
357705
|
+
return ["".concat((0, common_1.gcloudSchedulerCmd)(), " jobs delete ").concat(schedulerName, " ").concat(argsString)];
|
|
357706
|
+
}).flat();
|
|
357707
|
+
};
|
|
357708
|
+
exports.getDeleteSchedulesScripts = getDeleteSchedulesScripts;
|
|
357709
|
+
var getDeleteJobsScripts = function (context) {
|
|
357710
|
+
var commonArgs = (0, common_1.getCommonCloudRunArgs)(context);
|
|
357711
|
+
var commonArgsString = (0, createArgsString_1.createArgsString)(commonArgs);
|
|
357712
|
+
var jobsWithNames = getCloudRunJobsWithNames(context);
|
|
357713
|
+
return jobsWithNames.flatMap(function (_a) {
|
|
357714
|
+
var jobName = _a.jobName;
|
|
357715
|
+
return [
|
|
357716
|
+
// first delete all job executions. Otherwise delete might fail if one of those is still running
|
|
357717
|
+
"".concat((0, common_1.gcloudRunCmd)(), " jobs executions list ").concat(commonArgsString, " --job ").concat(jobName, " --format=\"value(name)\" | xargs -I {} ").concat((0, common_1.gcloudRunCmd)(), " jobs executions delete {} --quiet ").concat(commonArgsString), "".concat((0, common_1.gcloudRunCmd)(), " jobs delete ").concat(jobName, " ").concat(commonArgsString)];
|
|
357718
|
+
});
|
|
357719
|
+
};
|
|
357720
|
+
exports.getDeleteJobsScripts = getDeleteJobsScripts;
|
|
357721
|
+
var getJobRunScripts = function (context, when) {
|
|
357722
|
+
var jobsWithNames = getCloudRunJobsWithNames(context);
|
|
357723
|
+
return jobsWithNames.filter(function (_a) {
|
|
357724
|
+
var job = _a.job;
|
|
357725
|
+
return job.when === when;
|
|
357726
|
+
}).map(function (_a) {
|
|
357727
|
+
var jobName = _a.jobName;
|
|
357728
|
+
return getJobRunScriptForJob(context, jobName,
|
|
357729
|
+
// wait for completin on stop jobs, since stop will delete the jobs afterwards, so they will fail
|
|
357730
|
+
["preStop", "postStop"].includes(when));
|
|
357731
|
+
});
|
|
357732
|
+
};
|
|
357733
|
+
exports.getJobRunScripts = getJobRunScripts;
|
|
357734
|
+
var getJobCreateScripts = function (context) {
|
|
357735
|
+
var jobsWithNames = getCloudRunJobsWithNames(context);
|
|
357736
|
+
return jobsWithNames.map(function (_a) {
|
|
357737
|
+
var job = _a.job,
|
|
357738
|
+
jobName = _a.jobName;
|
|
357739
|
+
return getJobCreateScriptsForJob(context, jobName, job);
|
|
357740
|
+
}).flat();
|
|
357741
|
+
};
|
|
357742
|
+
exports.getJobCreateScripts = getJobCreateScripts;
|
|
357743
|
+
var getJobCreateScriptsForJob = function (context, jobName, job) {
|
|
357744
|
+
var commonDeployArgs = (0, common_1.getCommonDeployArgs)(context);
|
|
357745
|
+
// we cannot upsert a job, so we have to create it and catch the error and then update
|
|
357746
|
+
var commandArray = Array.isArray(job.command) ? job.command : job.command.split(" ");
|
|
357747
|
+
var commonDeployArgsString = (0, createArgsString_1.createArgsString)(__assign(__assign({
|
|
357748
|
+
command: '"' + commandArray.join(",") + '"'
|
|
357749
|
+
}, commonDeployArgs), {
|
|
357750
|
+
labels: (0, common_1.makeLabelString)(__assign(__assign({}, (0, getLabels_1.getLabels)(context)), {
|
|
357751
|
+
"cloud-run-job-name": jobName
|
|
357752
|
+
})),
|
|
357753
|
+
image: job.image || commonDeployArgs.image,
|
|
357754
|
+
memory: job.memory || "512Mi",
|
|
357755
|
+
"task-timeout": job.timeout || "10m",
|
|
357756
|
+
parallelism: job.parallelism || 1,
|
|
357757
|
+
"env-vars-file": "____envvars.yaml",
|
|
357758
|
+
"max-retries": 0
|
|
357759
|
+
}));
|
|
357760
|
+
var argsString = "".concat(jobName, " ").concat(commonDeployArgsString);
|
|
357761
|
+
return __spreadArray(__spreadArray([], __read((0, gitlab_1.allowFailureInScripts)(["".concat((0, common_1.gcloudRunCmd)(), " jobs create ").concat(argsString)])), false), ["".concat((0, common_1.gcloudRunCmd)(), " jobs update ").concat(argsString)], false);
|
|
357762
|
+
};
|
|
357763
|
+
var getCreateScheduleScripts = function (context) {
|
|
357764
|
+
var jobsWithSchedule = getCloudRunJobsWithSchedule(context);
|
|
357765
|
+
var deployConfig = (0, common_1.getCloudRunDeployConfig)(context);
|
|
357766
|
+
return jobsWithSchedule.map(function (_a) {
|
|
357767
|
+
var _b;
|
|
357768
|
+
var job = _a.job,
|
|
357769
|
+
jobName = _a.jobName,
|
|
357770
|
+
schedulerName = _a.schedulerName;
|
|
357771
|
+
var argsString = (0, createArgsString_1.createArgsString)({
|
|
357772
|
+
project: deployConfig.projectId,
|
|
357773
|
+
location: deployConfig.region,
|
|
357774
|
+
schedule: "\"".concat(job.schedule, "\""),
|
|
357775
|
+
"max-retry-attempts": (_b = job.maxRetryAttempts) !== null && _b !== void 0 ? _b : 0,
|
|
357776
|
+
uri: "\"https://".concat(deployConfig.region, "-run.googleapis.com/apis/run.googleapis.com/v1/namespaces/").concat(deployConfig.projectId, "/jobs/").concat(jobName, ":run\""),
|
|
357777
|
+
"http-method": "POST",
|
|
357778
|
+
"oauth-service-account-email": "$GCLOUD_PROJECT_NUMBER-compute@developer.gserviceaccount.com"
|
|
357779
|
+
});
|
|
357780
|
+
var commonArgs = "http ".concat(schedulerName, " ").concat(argsString);
|
|
357781
|
+
return __spreadArray(__spreadArray([], __read((0, gitlab_1.allowFailureInScripts)(["".concat((0, common_1.gcloudSchedulerCmd)(), " jobs create ").concat(commonArgs)])), false), ["".concat((0, common_1.gcloudSchedulerCmd)(), " jobs update ").concat(commonArgs)], false);
|
|
357782
|
+
}).flat();
|
|
357783
|
+
};
|
|
357784
|
+
exports.getCreateScheduleScripts = getCreateScheduleScripts;
|
|
357785
|
+
var getCloudRunJobsWithSchedule = function (context) {
|
|
357786
|
+
var jobsWithNames = getCloudRunJobsWithNames(context);
|
|
357787
|
+
return jobsWithNames.filter(function (entry) {
|
|
357788
|
+
return entry.job.when === "schedule";
|
|
357789
|
+
}).map(function (_a) {
|
|
357790
|
+
var job = _a.job,
|
|
357791
|
+
jobName = _a.jobName;
|
|
357792
|
+
return {
|
|
357793
|
+
job: job,
|
|
357794
|
+
jobName: jobName,
|
|
357795
|
+
schedulerName: jobName + "-scheduler"
|
|
357796
|
+
};
|
|
357797
|
+
});
|
|
357798
|
+
};
|
|
357799
|
+
var getCloudRunJobsWithNames = function (context) {
|
|
357800
|
+
var _a;
|
|
357801
|
+
var deployConfig = (0, common_1.getCloudRunDeployConfig)(context);
|
|
357802
|
+
var getFullJobName = function (name) {
|
|
357803
|
+
return (0, jobName_1.getCloudRunJobName)(context.environment.fullName, name);
|
|
357804
|
+
};
|
|
357805
|
+
var jobsWithNames = Object.entries((_a = deployConfig.jobs) !== null && _a !== void 0 ? _a : {})
|
|
357806
|
+
// filter out disabled jobs
|
|
357807
|
+
.filter(function (entry) {
|
|
357808
|
+
return Boolean(entry[1]);
|
|
357809
|
+
}).map(function (_a) {
|
|
357810
|
+
var _b = __read(_a, 2),
|
|
357811
|
+
name = _b[0],
|
|
357812
|
+
job = _b[1];
|
|
357813
|
+
return {
|
|
357814
|
+
jobName: getFullJobName(name),
|
|
357815
|
+
job: job
|
|
357816
|
+
};
|
|
357817
|
+
});
|
|
357818
|
+
return jobsWithNames;
|
|
357819
|
+
};
|
|
357820
|
+
|
|
357821
|
+
/***/ }),
|
|
357822
|
+
|
|
357823
|
+
/***/ 77210:
|
|
357824
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
357825
|
+
|
|
357826
|
+
"use strict";
|
|
357827
|
+
|
|
357828
|
+
|
|
357829
|
+
var __assign = this && this.__assign || function () {
|
|
357830
|
+
__assign = Object.assign || function (t) {
|
|
357831
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
357832
|
+
s = arguments[i];
|
|
357833
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
357834
|
+
}
|
|
357835
|
+
return t;
|
|
357836
|
+
};
|
|
357837
|
+
return __assign.apply(this, arguments);
|
|
357838
|
+
};
|
|
357839
|
+
exports.__esModule = true;
|
|
357840
|
+
exports.getServiceDeleteScript = exports.getServiceDeployScript = void 0;
|
|
357841
|
+
var getLabels_1 = __nccwpck_require__(30486);
|
|
357842
|
+
var createArgsString_1 = __nccwpck_require__(8686);
|
|
357843
|
+
var getServiceName_1 = __nccwpck_require__(89391);
|
|
357844
|
+
var common_1 = __nccwpck_require__(75655);
|
|
357845
|
+
var getServiceDeployScript = function (context, service, nameSuffix) {
|
|
357846
|
+
var _a, _b, _c, _d, _e;
|
|
357847
|
+
var commonDeployArgs = (0, common_1.getCommonDeployArgs)(context);
|
|
357848
|
+
var serviceName = (0, getServiceName_1.getServiceName)(context);
|
|
357849
|
+
var customConfig = service !== true ? service : undefined;
|
|
357850
|
+
var command = service !== true ? (_a = service === null || service === void 0 ? void 0 : service.command) !== null && _a !== void 0 ? _a : context.componentConfig.build.startCommand : undefined;
|
|
357851
|
+
var commandArray = command ? Array.isArray(command) ? command : command.split(" ") : undefined;
|
|
357852
|
+
var fullServiceName = "".concat(serviceName).concat(nameSuffix !== null && nameSuffix !== void 0 ? nameSuffix : "");
|
|
357853
|
+
var argsString = (0, createArgsString_1.createArgsString)(__assign(__assign({
|
|
357854
|
+
// command as empty string resets it to default (uses the image's entrypoint)
|
|
357855
|
+
command: commandArray ? '"' + commandArray.join(",") + '"' : '""'
|
|
357856
|
+
}, commonDeployArgs), {
|
|
357857
|
+
labels: (0, common_1.makeLabelString)(__assign(__assign({}, (0, getLabels_1.getLabels)(context)), {
|
|
357858
|
+
"cloud-run-service-name": fullServiceName
|
|
357859
|
+
})),
|
|
357860
|
+
"env-vars-file": "____envvars.yaml",
|
|
357861
|
+
"min-instances": (_b = customConfig === null || customConfig === void 0 ? void 0 : customConfig.minInstances) !== null && _b !== void 0 ? _b : 0,
|
|
357862
|
+
"max-instances": (_c = customConfig === null || customConfig === void 0 ? void 0 : customConfig.maxInstances) !== null && _c !== void 0 ? _c : 100,
|
|
357863
|
+
"cpu-throttling": (customConfig === null || customConfig === void 0 ? void 0 : customConfig.noCpuThrottling) !== true,
|
|
357864
|
+
memory: customConfig === null || customConfig === void 0 ? void 0 : customConfig.memory,
|
|
357865
|
+
"allow-unauthenticated": (_d = customConfig === null || customConfig === void 0 ? void 0 : customConfig.allowUnauthenticated) !== null && _d !== void 0 ? _d : true,
|
|
357866
|
+
ingress: (_e = customConfig === null || customConfig === void 0 ? void 0 : customConfig.ingress) !== null && _e !== void 0 ? _e : "all",
|
|
357867
|
+
"cpu-boost": true,
|
|
357868
|
+
"execution-environment": customConfig === null || customConfig === void 0 ? void 0 : customConfig.executionEnvironment
|
|
357869
|
+
}));
|
|
357870
|
+
return "".concat((0, common_1.gcloudRunCmd)(), " deploy ").concat(fullServiceName, " ").concat(argsString);
|
|
357871
|
+
};
|
|
357872
|
+
exports.getServiceDeployScript = getServiceDeployScript;
|
|
357873
|
+
var getServiceDeleteScript = function (context, serviceSuffix) {
|
|
357874
|
+
var commonArgs = (0, common_1.getCommonCloudRunArgs)(context);
|
|
357875
|
+
var commonArgsString = (0, createArgsString_1.createArgsString)(commonArgs);
|
|
357876
|
+
var serviceName = (0, getServiceName_1.getServiceName)(context);
|
|
357877
|
+
var fullServiceName = serviceSuffix ? "".concat(serviceName, "-").concat(serviceSuffix) : serviceName;
|
|
357878
|
+
return ["".concat((0, common_1.gcloudRunCmd)(), " services delete ").concat(fullServiceName, " ").concat(commonArgsString)];
|
|
357879
|
+
};
|
|
357880
|
+
exports.getServiceDeleteScript = getServiceDeleteScript;
|
|
357881
|
+
|
|
357882
|
+
/***/ }),
|
|
357883
|
+
|
|
357884
|
+
/***/ 75655:
|
|
357885
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
357886
|
+
|
|
357887
|
+
"use strict";
|
|
357888
|
+
|
|
357889
|
+
|
|
357890
|
+
var __assign = this && this.__assign || function () {
|
|
357891
|
+
__assign = Object.assign || function (t) {
|
|
357892
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
357893
|
+
s = arguments[i];
|
|
357894
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
357895
|
+
}
|
|
357896
|
+
return t;
|
|
357897
|
+
};
|
|
357898
|
+
return __assign.apply(this, arguments);
|
|
357899
|
+
};
|
|
357900
|
+
var __read = this && this.__read || function (o, n) {
|
|
357901
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
357902
|
+
if (!m) return o;
|
|
357903
|
+
var i = m.call(o),
|
|
357904
|
+
r,
|
|
357905
|
+
ar = [],
|
|
357906
|
+
e;
|
|
357907
|
+
try {
|
|
357908
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
357909
|
+
} catch (error) {
|
|
357910
|
+
e = {
|
|
357911
|
+
error: error
|
|
357912
|
+
};
|
|
357913
|
+
} finally {
|
|
357914
|
+
try {
|
|
357915
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
357916
|
+
} finally {
|
|
357917
|
+
if (e) throw e.error;
|
|
357918
|
+
}
|
|
357919
|
+
}
|
|
357920
|
+
return ar;
|
|
357921
|
+
};
|
|
357307
357922
|
exports.__esModule = true;
|
|
357308
|
-
exports.
|
|
357309
|
-
var
|
|
357310
|
-
var
|
|
357311
|
-
var
|
|
357312
|
-
|
|
357313
|
-
var getLabels_1 = __nccwpck_require__(30486);
|
|
357314
|
-
var getJobRunScriptForJob = function (context, jobName, wait) {
|
|
357315
|
-
var commonArgs = (0, common_1.getCommonCloudRunArgs)(context);
|
|
357316
|
-
var commonArgsString = (0, createArgsString_1.createArgsString)(commonArgs);
|
|
357317
|
-
return "gcloud beta run jobs execute ".concat(jobName, " ").concat(commonArgsString).concat(wait ? " --wait" : "");
|
|
357318
|
-
};
|
|
357319
|
-
var getDeleteSchedulesScripts = function (context) {
|
|
357320
|
-
var deployConfig = (0, common_1.getCloudRunDeployConfig)(context);
|
|
357321
|
-
var jobsWithSchedule = getCloudRunJobsWithSchedule(context);
|
|
357322
|
-
var argsString = (0, createArgsString_1.createArgsString)({
|
|
357323
|
-
project: deployConfig.projectId,
|
|
357324
|
-
location: deployConfig.region
|
|
357325
|
-
});
|
|
357326
|
-
return jobsWithSchedule.map(function (_a) {
|
|
357327
|
-
var schedulerName = _a.schedulerName;
|
|
357328
|
-
return ["gcloud scheduler jobs delete ".concat(schedulerName, " ").concat(argsString)];
|
|
357329
|
-
}).flat();
|
|
357330
|
-
};
|
|
357331
|
-
exports.getDeleteSchedulesScripts = getDeleteSchedulesScripts;
|
|
357332
|
-
var getDeleteJobsScripts = function (context) {
|
|
357333
|
-
var commonArgs = (0, common_1.getCommonCloudRunArgs)(context);
|
|
357334
|
-
var commonArgsString = (0, createArgsString_1.createArgsString)(commonArgs);
|
|
357335
|
-
var jobsWithNames = getCloudRunJobsWithNames(context);
|
|
357336
|
-
return jobsWithNames.flatMap(function (_a) {
|
|
357337
|
-
var jobName = _a.jobName;
|
|
357338
|
-
return [
|
|
357339
|
-
// first delete all job executions. Otherwise delete might fail if one of those is still running
|
|
357340
|
-
"gcloud beta run jobs executions list ".concat(commonArgsString, " --job ").concat(jobName, " --format=\"value(name)\" | xargs -I {} gcloud beta run jobs executions delete {} --quiet ").concat(commonArgsString), "gcloud beta run jobs delete ".concat(jobName, " ").concat(commonArgsString)];
|
|
357341
|
-
});
|
|
357342
|
-
};
|
|
357343
|
-
exports.getDeleteJobsScripts = getDeleteJobsScripts;
|
|
357344
|
-
var getJobRunScripts = function (context, when) {
|
|
357345
|
-
var jobsWithNames = getCloudRunJobsWithNames(context);
|
|
357346
|
-
return jobsWithNames.filter(function (_a) {
|
|
357347
|
-
var job = _a.job;
|
|
357348
|
-
return job.when === when;
|
|
357349
|
-
}).map(function (_a) {
|
|
357350
|
-
var jobName = _a.jobName;
|
|
357351
|
-
return getJobRunScriptForJob(context, jobName,
|
|
357352
|
-
// wait for completin on stop jobs, since stop will delete the jobs afterwards, so they will fail
|
|
357353
|
-
["preStop", "postStop"].includes(when));
|
|
357354
|
-
});
|
|
357355
|
-
};
|
|
357356
|
-
exports.getJobRunScripts = getJobRunScripts;
|
|
357357
|
-
var getJobCreateScripts = function (context) {
|
|
357358
|
-
var jobsWithNames = getCloudRunJobsWithNames(context);
|
|
357359
|
-
return jobsWithNames.map(function (_a) {
|
|
357360
|
-
var job = _a.job,
|
|
357361
|
-
jobName = _a.jobName;
|
|
357362
|
-
return getJobCreateScriptsForJob(context, jobName, job);
|
|
357363
|
-
}).flat();
|
|
357364
|
-
};
|
|
357365
|
-
exports.getJobCreateScripts = getJobCreateScripts;
|
|
357366
|
-
var getJobCreateScriptsForJob = function (context, jobName, job) {
|
|
357367
|
-
var commonDeployArgs = (0, common_1.getCommonDeployArgs)(context);
|
|
357368
|
-
// due to some oversight from google, jobs create does not accept `--env-vars-file` 🤦
|
|
357369
|
-
// lucky, update on the other hand accepts it... so let's just imediatly update it
|
|
357370
|
-
// also we cannot upsert a job, so we have to create it and catch the error and then update
|
|
357371
|
-
var commandArray = Array.isArray(job.command) ? job.command : job.command.split(" ");
|
|
357372
|
-
var commonDeployArgsString = (0, createArgsString_1.createArgsString)(__assign(__assign({
|
|
357373
|
-
command: '"' + commandArray.join(",") + '"'
|
|
357374
|
-
}, commonDeployArgs), {
|
|
357375
|
-
labels: (0, common_1.makeLabelString)(__assign(__assign({}, (0, getLabels_1.getLabels)(context)), {
|
|
357376
|
-
"cloud-run-job-name": jobName
|
|
357377
|
-
})),
|
|
357378
|
-
image: job.image || commonDeployArgs.image,
|
|
357379
|
-
memory: job.memory || "512Mi",
|
|
357380
|
-
"task-timeout": job.timeout || "10m"
|
|
357381
|
-
}));
|
|
357382
|
-
var argsString = "".concat(jobName, " ").concat(commonDeployArgsString);
|
|
357383
|
-
return __spreadArray(__spreadArray([], __read((0, gitlab_1.allowFailureInScripts)(["gcloud beta run jobs create ".concat(argsString)])), false), ["gcloud beta run jobs update ".concat(argsString, " --env-vars-file=____envvars.yaml")], false);
|
|
357384
|
-
};
|
|
357385
|
-
var getCreateScheduleScripts = function (context) {
|
|
357386
|
-
var jobsWithSchedule = getCloudRunJobsWithSchedule(context);
|
|
357387
|
-
var deployConfig = (0, common_1.getCloudRunDeployConfig)(context);
|
|
357388
|
-
return jobsWithSchedule.map(function (_a) {
|
|
357389
|
-
var _b;
|
|
357390
|
-
var job = _a.job,
|
|
357391
|
-
jobName = _a.jobName,
|
|
357392
|
-
schedulerName = _a.schedulerName;
|
|
357393
|
-
var argsString = (0, createArgsString_1.createArgsString)({
|
|
357394
|
-
project: deployConfig.projectId,
|
|
357395
|
-
location: deployConfig.region,
|
|
357396
|
-
schedule: "\"".concat(job.schedule, "\""),
|
|
357397
|
-
"max-retry-attempts": (_b = job.maxRetryAttempts) !== null && _b !== void 0 ? _b : 0,
|
|
357398
|
-
uri: "\"https://".concat(deployConfig.region, "-run.googleapis.com/apis/run.googleapis.com/v1/namespaces/").concat(deployConfig.projectId, "/jobs/").concat(jobName, ":run\""),
|
|
357399
|
-
"http-method": "POST",
|
|
357400
|
-
"oauth-service-account-email": "$GCLOUD_PROJECT_NUMBER-compute@developer.gserviceaccount.com"
|
|
357401
|
-
});
|
|
357402
|
-
var commonArgs = "http ".concat(schedulerName, " ").concat(argsString);
|
|
357403
|
-
return __spreadArray(__spreadArray([], __read((0, gitlab_1.allowFailureInScripts)(["gcloud scheduler jobs create ".concat(commonArgs)])), false), ["gcloud scheduler jobs update ".concat(commonArgs)], false);
|
|
357404
|
-
}).flat();
|
|
357405
|
-
};
|
|
357406
|
-
exports.getCreateScheduleScripts = getCreateScheduleScripts;
|
|
357407
|
-
var getCloudRunJobsWithSchedule = function (context) {
|
|
357408
|
-
var jobsWithNames = getCloudRunJobsWithNames(context);
|
|
357409
|
-
return jobsWithNames.filter(function (entry) {
|
|
357410
|
-
return entry.job.when === "schedule";
|
|
357411
|
-
}).map(function (_a) {
|
|
357412
|
-
var job = _a.job,
|
|
357413
|
-
jobName = _a.jobName;
|
|
357414
|
-
return {
|
|
357415
|
-
job: job,
|
|
357416
|
-
jobName: jobName,
|
|
357417
|
-
schedulerName: jobName + "-scheduler"
|
|
357418
|
-
};
|
|
357419
|
-
});
|
|
357420
|
-
};
|
|
357421
|
-
var getCloudRunJobsWithNames = function (context) {
|
|
357422
|
-
var _a;
|
|
357423
|
-
var deployConfig = (0, common_1.getCloudRunDeployConfig)(context);
|
|
357424
|
-
var getFullJobName = function (name) {
|
|
357425
|
-
return (0, jobName_1.getCloudRunJobName)(context.environment.fullName, name);
|
|
357426
|
-
};
|
|
357427
|
-
var jobsWithNames = Object.entries((_a = deployConfig.jobs) !== null && _a !== void 0 ? _a : {})
|
|
357428
|
-
// filter out disabled jobs
|
|
357429
|
-
.filter(function (entry) {
|
|
357430
|
-
return Boolean(entry[1]);
|
|
357431
|
-
}).map(function (_a) {
|
|
357432
|
-
var _b = __read(_a, 2),
|
|
357433
|
-
name = _b[0],
|
|
357434
|
-
job = _b[1];
|
|
357435
|
-
return {
|
|
357436
|
-
jobName: getFullJobName(name),
|
|
357437
|
-
job: job
|
|
357438
|
-
};
|
|
357439
|
-
});
|
|
357440
|
-
return jobsWithNames;
|
|
357441
|
-
};
|
|
357442
|
-
|
|
357443
|
-
/***/ }),
|
|
357444
|
-
|
|
357445
|
-
/***/ 77210:
|
|
357446
|
-
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
357447
|
-
|
|
357448
|
-
"use strict";
|
|
357449
|
-
|
|
357450
|
-
|
|
357451
|
-
var __assign = this && this.__assign || function () {
|
|
357452
|
-
__assign = Object.assign || function (t) {
|
|
357453
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
357454
|
-
s = arguments[i];
|
|
357455
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
357456
|
-
}
|
|
357457
|
-
return t;
|
|
357458
|
-
};
|
|
357459
|
-
return __assign.apply(this, arguments);
|
|
357460
|
-
};
|
|
357461
|
-
exports.__esModule = true;
|
|
357462
|
-
exports.getServiceDeleteScript = exports.getServiceDeployScript = void 0;
|
|
357463
|
-
var getLabels_1 = __nccwpck_require__(30486);
|
|
357464
|
-
var createArgsString_1 = __nccwpck_require__(8686);
|
|
357465
|
-
var getServiceName_1 = __nccwpck_require__(89391);
|
|
357466
|
-
var common_1 = __nccwpck_require__(75655);
|
|
357467
|
-
var getServiceDeployScript = function (context, service, nameSuffix) {
|
|
357468
|
-
var _a, _b, _c, _d, _e;
|
|
357469
|
-
var commonDeployArgs = (0, common_1.getCommonDeployArgs)(context);
|
|
357470
|
-
var serviceName = (0, getServiceName_1.getServiceName)(context);
|
|
357471
|
-
var customConfig = service !== true ? service : undefined;
|
|
357472
|
-
var command = service !== true ? (_a = service === null || service === void 0 ? void 0 : service.command) !== null && _a !== void 0 ? _a : context.componentConfig.build.startCommand : undefined;
|
|
357473
|
-
var commandArray = command ? Array.isArray(command) ? command : command.split(" ") : undefined;
|
|
357474
|
-
var fullServiceName = "".concat(serviceName).concat(nameSuffix !== null && nameSuffix !== void 0 ? nameSuffix : "");
|
|
357475
|
-
var argsString = (0, createArgsString_1.createArgsString)(__assign(__assign({
|
|
357476
|
-
// command as empty string resets it to default (uses the image's entrypoint)
|
|
357477
|
-
command: commandArray ? '"' + commandArray.join(",") + '"' : '""'
|
|
357478
|
-
}, commonDeployArgs), {
|
|
357479
|
-
labels: (0, common_1.makeLabelString)(__assign(__assign({}, (0, getLabels_1.getLabels)(context)), {
|
|
357480
|
-
"cloud-run-service-name": fullServiceName
|
|
357481
|
-
})),
|
|
357482
|
-
"env-vars-file": "____envvars.yaml",
|
|
357483
|
-
"min-instances": (_b = customConfig === null || customConfig === void 0 ? void 0 : customConfig.minInstances) !== null && _b !== void 0 ? _b : 0,
|
|
357484
|
-
"max-instances": (_c = customConfig === null || customConfig === void 0 ? void 0 : customConfig.maxInstances) !== null && _c !== void 0 ? _c : 100,
|
|
357485
|
-
"cpu-throttling": (customConfig === null || customConfig === void 0 ? void 0 : customConfig.noCpuThrottling) !== true,
|
|
357486
|
-
memory: customConfig === null || customConfig === void 0 ? void 0 : customConfig.memory,
|
|
357487
|
-
"allow-unauthenticated": (_d = customConfig === null || customConfig === void 0 ? void 0 : customConfig.allowUnauthenticated) !== null && _d !== void 0 ? _d : true,
|
|
357488
|
-
ingress: (_e = customConfig === null || customConfig === void 0 ? void 0 : customConfig.ingress) !== null && _e !== void 0 ? _e : "all",
|
|
357489
|
-
"cpu-boost": true
|
|
357490
|
-
}));
|
|
357491
|
-
return "gcloud run deploy ".concat(fullServiceName, " ").concat(argsString);
|
|
357492
|
-
};
|
|
357493
|
-
exports.getServiceDeployScript = getServiceDeployScript;
|
|
357494
|
-
var getServiceDeleteScript = function (context, serviceSuffix) {
|
|
357495
|
-
var commonArgs = (0, common_1.getCommonCloudRunArgs)(context);
|
|
357496
|
-
var commonArgsString = (0, createArgsString_1.createArgsString)(commonArgs);
|
|
357497
|
-
var serviceName = (0, getServiceName_1.getServiceName)(context);
|
|
357498
|
-
var fullServiceName = serviceSuffix ? "".concat(serviceName, "-").concat(serviceSuffix) : serviceName;
|
|
357499
|
-
return ["gcloud run services delete ".concat(fullServiceName, " ").concat(commonArgsString)];
|
|
357923
|
+
exports.getCommonDeployArgs = exports.getCommonCloudRunArgs = exports.getCloudRunDeployConfig = exports.makeLabelString = exports.setGoogleProjectNumberScript = exports.gcloudSchedulerCmd = exports.gcloudRunCmd = exports.gcloudCmd = void 0;
|
|
357924
|
+
var types_1 = __nccwpck_require__(63109);
|
|
357925
|
+
var artifactsRegistry_1 = __nccwpck_require__(28159);
|
|
357926
|
+
var gcloudCmd = function (version) {
|
|
357927
|
+
return version ? "gcloud ".concat(version) : "gcloud";
|
|
357500
357928
|
};
|
|
357501
|
-
exports.
|
|
357502
|
-
|
|
357503
|
-
|
|
357504
|
-
|
|
357505
|
-
/***/ 75655:
|
|
357506
|
-
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
357507
|
-
|
|
357508
|
-
"use strict";
|
|
357509
|
-
|
|
357510
|
-
|
|
357511
|
-
var __assign = this && this.__assign || function () {
|
|
357512
|
-
__assign = Object.assign || function (t) {
|
|
357513
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
357514
|
-
s = arguments[i];
|
|
357515
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
357516
|
-
}
|
|
357517
|
-
return t;
|
|
357518
|
-
};
|
|
357519
|
-
return __assign.apply(this, arguments);
|
|
357929
|
+
exports.gcloudCmd = gcloudCmd;
|
|
357930
|
+
var gcloudRunCmd = function (version) {
|
|
357931
|
+
return "".concat((0, exports.gcloudCmd)(version), " run");
|
|
357520
357932
|
};
|
|
357521
|
-
|
|
357522
|
-
|
|
357523
|
-
|
|
357524
|
-
var i = m.call(o),
|
|
357525
|
-
r,
|
|
357526
|
-
ar = [],
|
|
357527
|
-
e;
|
|
357528
|
-
try {
|
|
357529
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
357530
|
-
} catch (error) {
|
|
357531
|
-
e = {
|
|
357532
|
-
error: error
|
|
357533
|
-
};
|
|
357534
|
-
} finally {
|
|
357535
|
-
try {
|
|
357536
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
357537
|
-
} finally {
|
|
357538
|
-
if (e) throw e.error;
|
|
357539
|
-
}
|
|
357540
|
-
}
|
|
357541
|
-
return ar;
|
|
357933
|
+
exports.gcloudRunCmd = gcloudRunCmd;
|
|
357934
|
+
var gcloudSchedulerCmd = function (version) {
|
|
357935
|
+
return "".concat((0, exports.gcloudCmd)(version), " scheduler");
|
|
357542
357936
|
};
|
|
357543
|
-
exports.
|
|
357544
|
-
exports.getCommonDeployArgs = exports.getCommonCloudRunArgs = exports.getCloudRunDeployConfig = exports.makeLabelString = exports.setGoogleProjectNumberScript = void 0;
|
|
357545
|
-
var types_1 = __nccwpck_require__(63109);
|
|
357546
|
-
var artifactsRegistry_1 = __nccwpck_require__(28159);
|
|
357937
|
+
exports.gcloudSchedulerCmd = gcloudSchedulerCmd;
|
|
357547
357938
|
var setGoogleProjectNumberScript = function (deployConfig) {
|
|
357548
|
-
return ["export GCLOUD_PROJECT_NUMBER=$(
|
|
357939
|
+
return ["export GCLOUD_PROJECT_NUMBER=$(".concat((0, exports.gcloudCmd)(), " projects describe ").concat(deployConfig.projectId, " --format=\"value(projectNumber)\")"), "echo \"GCLOUD_PROJECT_NUMBER: $GCLOUD_PROJECT_NUMBER\""];
|
|
357549
357940
|
};
|
|
357550
357941
|
exports.setGoogleProjectNumberScript = setGoogleProjectNumberScript;
|
|
357551
357942
|
var makeLabelString = function (obj) {
|
|
@@ -357955,22 +358346,28 @@ var lodash_1 = __nccwpck_require__(23255);
|
|
|
357955
358346
|
* @param args args record
|
|
357956
358347
|
* @returns
|
|
357957
358348
|
*/
|
|
357958
|
-
var createArgsString = function (
|
|
357959
|
-
|
|
357960
|
-
|
|
357961
|
-
|
|
357962
|
-
|
|
357963
|
-
|
|
357964
|
-
|
|
357965
|
-
|
|
357966
|
-
|
|
357967
|
-
|
|
357968
|
-
|
|
357969
|
-
|
|
357970
|
-
|
|
357971
|
-
|
|
357972
|
-
|
|
357973
|
-
|
|
358349
|
+
var createArgsString = function () {
|
|
358350
|
+
var args = [];
|
|
358351
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
358352
|
+
args[_i] = arguments[_i];
|
|
358353
|
+
}
|
|
358354
|
+
return args.map(function (argObj) {
|
|
358355
|
+
return Object.entries(argObj).filter(function (_a) {
|
|
358356
|
+
var _b = __read(_a, 2),
|
|
358357
|
+
value = _b[1];
|
|
358358
|
+
return !(0, lodash_1.isNil)(value);
|
|
358359
|
+
}).map(function (_a) {
|
|
358360
|
+
var _b = __read(_a, 2),
|
|
358361
|
+
key = _b[0],
|
|
358362
|
+
value = _b[1];
|
|
358363
|
+
if (value === true) {
|
|
358364
|
+
return "--".concat(key);
|
|
358365
|
+
} else if (value === false) {
|
|
358366
|
+
return "--no-".concat(key);
|
|
358367
|
+
}
|
|
358368
|
+
return "--".concat(key, "=").concat(value);
|
|
358369
|
+
});
|
|
358370
|
+
}).flat().join(" ");
|
|
357974
358371
|
};
|
|
357975
358372
|
exports.createArgsString = createArgsString;
|
|
357976
358373
|
|
|
@@ -361248,6 +361645,14 @@ module.exports = require("fs");
|
|
|
361248
361645
|
|
|
361249
361646
|
/***/ }),
|
|
361250
361647
|
|
|
361648
|
+
/***/ 73292:
|
|
361649
|
+
/***/ ((module) => {
|
|
361650
|
+
|
|
361651
|
+
"use strict";
|
|
361652
|
+
module.exports = require("fs/promises");
|
|
361653
|
+
|
|
361654
|
+
/***/ }),
|
|
361655
|
+
|
|
361251
361656
|
/***/ 13685:
|
|
361252
361657
|
/***/ ((module) => {
|
|
361253
361658
|
|
|
@@ -361408,6 +361813,725 @@ module.exports = require("zlib");
|
|
|
361408
361813
|
|
|
361409
361814
|
/***/ }),
|
|
361410
361815
|
|
|
361816
|
+
/***/ 6861:
|
|
361817
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
361818
|
+
|
|
361819
|
+
"use strict";
|
|
361820
|
+
|
|
361821
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
361822
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
361823
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
361824
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
361825
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
361826
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
361827
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
361828
|
+
});
|
|
361829
|
+
};
|
|
361830
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
361831
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
361832
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
361833
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
361834
|
+
function step(op) {
|
|
361835
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
361836
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
361837
|
+
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;
|
|
361838
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
361839
|
+
switch (op[0]) {
|
|
361840
|
+
case 0: case 1: t = op; break;
|
|
361841
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
361842
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
361843
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
361844
|
+
default:
|
|
361845
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
361846
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
361847
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
361848
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
361849
|
+
if (t[2]) _.ops.pop();
|
|
361850
|
+
_.trys.pop(); continue;
|
|
361851
|
+
}
|
|
361852
|
+
op = body.call(thisArg, _);
|
|
361853
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
361854
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
361855
|
+
}
|
|
361856
|
+
};
|
|
361857
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
361858
|
+
exports.AsyncResult = void 0;
|
|
361859
|
+
var result_js_1 = __nccwpck_require__(39293);
|
|
361860
|
+
/**
|
|
361861
|
+
* An async-aware `Result` counterpart.
|
|
361862
|
+
*
|
|
361863
|
+
* Can be combined with asynchronous code without having to ``await`` anything right until
|
|
361864
|
+
* the moment when you're ready to extract the final ``Result`` out of it.
|
|
361865
|
+
*
|
|
361866
|
+
* Can also be combined with synchronous code for convenience.
|
|
361867
|
+
*/
|
|
361868
|
+
var AsyncResult = /** @class */ (function () {
|
|
361869
|
+
/**
|
|
361870
|
+
* Constructs an `AsyncResult` from a `Result` or a `Promise` of a `Result`.
|
|
361871
|
+
*
|
|
361872
|
+
* @example
|
|
361873
|
+
* ```typescript
|
|
361874
|
+
* const ar = new AsyncResult(Promise.resolve('value'))
|
|
361875
|
+
* ```
|
|
361876
|
+
*/
|
|
361877
|
+
function AsyncResult(start) {
|
|
361878
|
+
this.promise = Promise.resolve(start);
|
|
361879
|
+
}
|
|
361880
|
+
/**
|
|
361881
|
+
* Calls `mapper` if the result is `Ok`, otherwise keeps the `Err` value intact.
|
|
361882
|
+
* This function can be used for control flow based on `Result` values.
|
|
361883
|
+
*
|
|
361884
|
+
* @example
|
|
361885
|
+
* ```typescript
|
|
361886
|
+
* let goodResult = Ok(1).toAsyncResult()
|
|
361887
|
+
* let badResult = Err('boo').toAsyncResult()
|
|
361888
|
+
*
|
|
361889
|
+
* await goodResult.andThen(async (value) => Ok(value * 2)).promise // Ok(2)
|
|
361890
|
+
* await goodResult.andThen(async (value) => Err(`${value} is bad`)).promise // Err('1 is bad')
|
|
361891
|
+
* await badResult.andThen(async (value) => Ok(value * 2)).promise // Err('boo')
|
|
361892
|
+
* ```
|
|
361893
|
+
*/
|
|
361894
|
+
AsyncResult.prototype.andThen = function (mapper) {
|
|
361895
|
+
var _this = this;
|
|
361896
|
+
return this.thenInternal(function (result) { return __awaiter(_this, void 0, void 0, function () {
|
|
361897
|
+
var mapped;
|
|
361898
|
+
return __generator(this, function (_a) {
|
|
361899
|
+
if (result.isErr()) {
|
|
361900
|
+
// SAFETY: What we're returning here is Err<E>. That doesn't sit well with
|
|
361901
|
+
// TypeScript for some reason, let's explicitly expand the type to what this
|
|
361902
|
+
// function is supposed to return.
|
|
361903
|
+
return [2 /*return*/, result];
|
|
361904
|
+
}
|
|
361905
|
+
mapped = mapper(result.value);
|
|
361906
|
+
return [2 /*return*/, mapped instanceof AsyncResult ? mapped.promise : mapped];
|
|
361907
|
+
});
|
|
361908
|
+
}); });
|
|
361909
|
+
};
|
|
361910
|
+
/**
|
|
361911
|
+
* Maps an `AsyncResult<T, E>` to `AsyncResult<U, E>` by applying a function to a contained
|
|
361912
|
+
* `Ok` value, leaving an `Err` value untouched.
|
|
361913
|
+
*
|
|
361914
|
+
* This function can be used to compose the results of two functions.
|
|
361915
|
+
*
|
|
361916
|
+
* @example
|
|
361917
|
+
* ```typescript
|
|
361918
|
+
* let goodResult = Ok(1).toAsyncResult()
|
|
361919
|
+
* let badResult = Err('boo').toAsyncResult()
|
|
361920
|
+
*
|
|
361921
|
+
* await goodResult.map(async (value) => value * 2).promise // Ok(2)
|
|
361922
|
+
* await badResult.andThen(async (value) => value * 2).promise // Err('boo')
|
|
361923
|
+
* ```
|
|
361924
|
+
*/
|
|
361925
|
+
AsyncResult.prototype.map = function (mapper) {
|
|
361926
|
+
var _this = this;
|
|
361927
|
+
return this.thenInternal(function (result) { return __awaiter(_this, void 0, void 0, function () {
|
|
361928
|
+
var _a;
|
|
361929
|
+
return __generator(this, function (_b) {
|
|
361930
|
+
switch (_b.label) {
|
|
361931
|
+
case 0:
|
|
361932
|
+
if (result.isErr()) {
|
|
361933
|
+
return [2 /*return*/, result];
|
|
361934
|
+
}
|
|
361935
|
+
_a = result_js_1.Ok;
|
|
361936
|
+
return [4 /*yield*/, mapper(result.value)];
|
|
361937
|
+
case 1: return [2 /*return*/, _a.apply(void 0, [_b.sent()])];
|
|
361938
|
+
}
|
|
361939
|
+
});
|
|
361940
|
+
}); });
|
|
361941
|
+
};
|
|
361942
|
+
// TODO:
|
|
361943
|
+
// mapErr()
|
|
361944
|
+
// mapOr()
|
|
361945
|
+
// mapOrElse()
|
|
361946
|
+
// or()
|
|
361947
|
+
// orElse()
|
|
361948
|
+
// mapErr<F>(mapper: (val: E) => F | Promise<F>): AsyncResult<T, F> {
|
|
361949
|
+
// return this.thenInternal(async (result) => {
|
|
361950
|
+
// if (result.isOk()) {
|
|
361951
|
+
// return result
|
|
361952
|
+
// }
|
|
361953
|
+
// return Err(await mapper(result.error))
|
|
361954
|
+
// })
|
|
361955
|
+
// }
|
|
361956
|
+
// async mapOr<U>(default_: U, mapper: (val: T) => U | Promise<U>): Promise<U> {
|
|
361957
|
+
// return this.mapOrElse(() => default_, mapper)
|
|
361958
|
+
// }
|
|
361959
|
+
// async mapOrElse<U>(default_: (error: E) => U | Promise<U>, mapper: (val: T) => U | Promise<U>): Promise<U> {
|
|
361960
|
+
// const result = await this.promise
|
|
361961
|
+
// if (result.isErr()) {
|
|
361962
|
+
// return default_(result.error)
|
|
361963
|
+
// }
|
|
361964
|
+
// return mapper(result.value)
|
|
361965
|
+
// }
|
|
361966
|
+
// or<E2>(other: Result<T, E2> | AsyncResult<T, E2> | Promise<Result<T, E2>>): AsyncResult<T, E2> {
|
|
361967
|
+
// return this.orElse(() => other)
|
|
361968
|
+
// }
|
|
361969
|
+
// orElse<E2>(other: (error: E) => Result<T, E2> | AsyncResult<T, E2> | Promise<Result<T, E2>>): AsyncResult<T, E2> {
|
|
361970
|
+
// return this.thenInternal(async (result) => {
|
|
361971
|
+
// if (result.isOk()) {
|
|
361972
|
+
// return result
|
|
361973
|
+
// }
|
|
361974
|
+
// const otherValue = other(result.error)
|
|
361975
|
+
// return otherValue instanceof AsyncResult ? otherValue.promise : otherValue
|
|
361976
|
+
// })
|
|
361977
|
+
// }
|
|
361978
|
+
AsyncResult.prototype.thenInternal = function (mapper) {
|
|
361979
|
+
return new AsyncResult(this.promise.then(mapper));
|
|
361980
|
+
};
|
|
361981
|
+
return AsyncResult;
|
|
361982
|
+
}());
|
|
361983
|
+
exports.AsyncResult = AsyncResult;
|
|
361984
|
+
//# sourceMappingURL=asyncresult.js.map
|
|
361985
|
+
|
|
361986
|
+
/***/ }),
|
|
361987
|
+
|
|
361988
|
+
/***/ 72807:
|
|
361989
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
361990
|
+
|
|
361991
|
+
"use strict";
|
|
361992
|
+
|
|
361993
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
361994
|
+
if (k2 === undefined) k2 = k;
|
|
361995
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
361996
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
361997
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
361998
|
+
}
|
|
361999
|
+
Object.defineProperty(o, k2, desc);
|
|
362000
|
+
}) : (function(o, m, k, k2) {
|
|
362001
|
+
if (k2 === undefined) k2 = k;
|
|
362002
|
+
o[k2] = m[k];
|
|
362003
|
+
}));
|
|
362004
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
362005
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
362006
|
+
};
|
|
362007
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
362008
|
+
__exportStar(__nccwpck_require__(6861), exports);
|
|
362009
|
+
__exportStar(__nccwpck_require__(39293), exports);
|
|
362010
|
+
__exportStar(__nccwpck_require__(56456), exports);
|
|
362011
|
+
//# sourceMappingURL=index.js.map
|
|
362012
|
+
|
|
362013
|
+
/***/ }),
|
|
362014
|
+
|
|
362015
|
+
/***/ 56456:
|
|
362016
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
362017
|
+
|
|
362018
|
+
"use strict";
|
|
362019
|
+
|
|
362020
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
362021
|
+
exports.Option = exports.Some = exports.None = void 0;
|
|
362022
|
+
var utils_js_1 = __nccwpck_require__(91414);
|
|
362023
|
+
var result_js_1 = __nccwpck_require__(39293);
|
|
362024
|
+
/**
|
|
362025
|
+
* Contains the None value
|
|
362026
|
+
*/
|
|
362027
|
+
var NoneImpl = /** @class */ (function () {
|
|
362028
|
+
function NoneImpl() {
|
|
362029
|
+
}
|
|
362030
|
+
NoneImpl.prototype.isSome = function () {
|
|
362031
|
+
return false;
|
|
362032
|
+
};
|
|
362033
|
+
NoneImpl.prototype.isNone = function () {
|
|
362034
|
+
return true;
|
|
362035
|
+
};
|
|
362036
|
+
NoneImpl.prototype[Symbol.iterator] = function () {
|
|
362037
|
+
return {
|
|
362038
|
+
next: function () {
|
|
362039
|
+
return { done: true, value: undefined };
|
|
362040
|
+
},
|
|
362041
|
+
};
|
|
362042
|
+
};
|
|
362043
|
+
NoneImpl.prototype.unwrapOr = function (val) {
|
|
362044
|
+
return val;
|
|
362045
|
+
};
|
|
362046
|
+
NoneImpl.prototype.expect = function (msg) {
|
|
362047
|
+
throw new Error("".concat(msg));
|
|
362048
|
+
};
|
|
362049
|
+
NoneImpl.prototype.unwrap = function () {
|
|
362050
|
+
throw new Error("Tried to unwrap None");
|
|
362051
|
+
};
|
|
362052
|
+
NoneImpl.prototype.map = function (_mapper) {
|
|
362053
|
+
return this;
|
|
362054
|
+
};
|
|
362055
|
+
NoneImpl.prototype.mapOr = function (default_, _mapper) {
|
|
362056
|
+
return default_;
|
|
362057
|
+
};
|
|
362058
|
+
NoneImpl.prototype.mapOrElse = function (default_, _mapper) {
|
|
362059
|
+
return default_();
|
|
362060
|
+
};
|
|
362061
|
+
NoneImpl.prototype.or = function (other) {
|
|
362062
|
+
return other;
|
|
362063
|
+
};
|
|
362064
|
+
NoneImpl.prototype.orElse = function (other) {
|
|
362065
|
+
return other();
|
|
362066
|
+
};
|
|
362067
|
+
NoneImpl.prototype.andThen = function (op) {
|
|
362068
|
+
return this;
|
|
362069
|
+
};
|
|
362070
|
+
NoneImpl.prototype.toResult = function (error) {
|
|
362071
|
+
return (0, result_js_1.Err)(error);
|
|
362072
|
+
};
|
|
362073
|
+
NoneImpl.prototype.toString = function () {
|
|
362074
|
+
return 'None';
|
|
362075
|
+
};
|
|
362076
|
+
return NoneImpl;
|
|
362077
|
+
}());
|
|
362078
|
+
// Export None as a singleton, then freeze it so it can't be modified
|
|
362079
|
+
exports.None = new NoneImpl();
|
|
362080
|
+
Object.freeze(exports.None);
|
|
362081
|
+
/**
|
|
362082
|
+
* Contains the success value
|
|
362083
|
+
*/
|
|
362084
|
+
var SomeImpl = /** @class */ (function () {
|
|
362085
|
+
function SomeImpl(val) {
|
|
362086
|
+
if (!(this instanceof SomeImpl)) {
|
|
362087
|
+
return new SomeImpl(val);
|
|
362088
|
+
}
|
|
362089
|
+
this.value = val;
|
|
362090
|
+
}
|
|
362091
|
+
SomeImpl.prototype.isSome = function () {
|
|
362092
|
+
return true;
|
|
362093
|
+
};
|
|
362094
|
+
SomeImpl.prototype.isNone = function () {
|
|
362095
|
+
return false;
|
|
362096
|
+
};
|
|
362097
|
+
/**
|
|
362098
|
+
* Helper function if you know you have an Some<T> and T is iterable
|
|
362099
|
+
*/
|
|
362100
|
+
SomeImpl.prototype[Symbol.iterator] = function () {
|
|
362101
|
+
var obj = Object(this.value);
|
|
362102
|
+
return Symbol.iterator in obj
|
|
362103
|
+
? obj[Symbol.iterator]()
|
|
362104
|
+
: {
|
|
362105
|
+
next: function () {
|
|
362106
|
+
return { done: true, value: undefined };
|
|
362107
|
+
},
|
|
362108
|
+
};
|
|
362109
|
+
};
|
|
362110
|
+
SomeImpl.prototype.unwrapOr = function (_val) {
|
|
362111
|
+
return this.value;
|
|
362112
|
+
};
|
|
362113
|
+
SomeImpl.prototype.expect = function (_msg) {
|
|
362114
|
+
return this.value;
|
|
362115
|
+
};
|
|
362116
|
+
SomeImpl.prototype.unwrap = function () {
|
|
362117
|
+
return this.value;
|
|
362118
|
+
};
|
|
362119
|
+
SomeImpl.prototype.map = function (mapper) {
|
|
362120
|
+
return (0, exports.Some)(mapper(this.value));
|
|
362121
|
+
};
|
|
362122
|
+
SomeImpl.prototype.mapOr = function (_default_, mapper) {
|
|
362123
|
+
return mapper(this.value);
|
|
362124
|
+
};
|
|
362125
|
+
SomeImpl.prototype.mapOrElse = function (_default_, mapper) {
|
|
362126
|
+
return mapper(this.value);
|
|
362127
|
+
};
|
|
362128
|
+
SomeImpl.prototype.or = function (_other) {
|
|
362129
|
+
return this;
|
|
362130
|
+
};
|
|
362131
|
+
SomeImpl.prototype.orElse = function (_other) {
|
|
362132
|
+
return this;
|
|
362133
|
+
};
|
|
362134
|
+
SomeImpl.prototype.andThen = function (mapper) {
|
|
362135
|
+
return mapper(this.value);
|
|
362136
|
+
};
|
|
362137
|
+
SomeImpl.prototype.toResult = function (error) {
|
|
362138
|
+
return (0, result_js_1.Ok)(this.value);
|
|
362139
|
+
};
|
|
362140
|
+
/**
|
|
362141
|
+
* Returns the contained `Some` value, but never throws.
|
|
362142
|
+
* Unlike `unwrap()`, this method doesn't throw and is only callable on an Some<T>
|
|
362143
|
+
*
|
|
362144
|
+
* Therefore, it can be used instead of `unwrap()` as a maintainability safeguard
|
|
362145
|
+
* that will fail to compile if the type of the Option is later changed to a None that can actually occur.
|
|
362146
|
+
*
|
|
362147
|
+
* (this is the `into_Some()` in rust)
|
|
362148
|
+
*/
|
|
362149
|
+
SomeImpl.prototype.safeUnwrap = function () {
|
|
362150
|
+
return this.value;
|
|
362151
|
+
};
|
|
362152
|
+
SomeImpl.prototype.toString = function () {
|
|
362153
|
+
return "Some(".concat((0, utils_js_1.toString)(this.value), ")");
|
|
362154
|
+
};
|
|
362155
|
+
SomeImpl.EMPTY = new SomeImpl(undefined);
|
|
362156
|
+
return SomeImpl;
|
|
362157
|
+
}());
|
|
362158
|
+
// This allows Some to be callable - possible because of the es5 compilation target
|
|
362159
|
+
exports.Some = SomeImpl;
|
|
362160
|
+
var Option;
|
|
362161
|
+
(function (Option) {
|
|
362162
|
+
/**
|
|
362163
|
+
* Parse a set of `Option`s, returning an array of all `Some` values.
|
|
362164
|
+
* Short circuits with the first `None` found, if any
|
|
362165
|
+
*/
|
|
362166
|
+
function all() {
|
|
362167
|
+
var options = [];
|
|
362168
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
362169
|
+
options[_i] = arguments[_i];
|
|
362170
|
+
}
|
|
362171
|
+
var someOption = [];
|
|
362172
|
+
for (var _a = 0, options_1 = options; _a < options_1.length; _a++) {
|
|
362173
|
+
var option = options_1[_a];
|
|
362174
|
+
if (option.isSome()) {
|
|
362175
|
+
someOption.push(option.value);
|
|
362176
|
+
}
|
|
362177
|
+
else {
|
|
362178
|
+
return option;
|
|
362179
|
+
}
|
|
362180
|
+
}
|
|
362181
|
+
return (0, exports.Some)(someOption);
|
|
362182
|
+
}
|
|
362183
|
+
Option.all = all;
|
|
362184
|
+
/**
|
|
362185
|
+
* Parse a set of `Option`s, short-circuits when an input value is `Some`.
|
|
362186
|
+
* If no `Some` is found, returns `None`.
|
|
362187
|
+
*/
|
|
362188
|
+
function any() {
|
|
362189
|
+
var options = [];
|
|
362190
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
362191
|
+
options[_i] = arguments[_i];
|
|
362192
|
+
}
|
|
362193
|
+
// short-circuits
|
|
362194
|
+
for (var _a = 0, options_2 = options; _a < options_2.length; _a++) {
|
|
362195
|
+
var option = options_2[_a];
|
|
362196
|
+
if (option.isSome()) {
|
|
362197
|
+
return option;
|
|
362198
|
+
}
|
|
362199
|
+
else {
|
|
362200
|
+
return option;
|
|
362201
|
+
}
|
|
362202
|
+
}
|
|
362203
|
+
// it must be None
|
|
362204
|
+
return exports.None;
|
|
362205
|
+
}
|
|
362206
|
+
Option.any = any;
|
|
362207
|
+
function isOption(value) {
|
|
362208
|
+
return value instanceof exports.Some || value === exports.None;
|
|
362209
|
+
}
|
|
362210
|
+
Option.isOption = isOption;
|
|
362211
|
+
})(Option || (exports.Option = Option = {}));
|
|
362212
|
+
//# sourceMappingURL=option.js.map
|
|
362213
|
+
|
|
362214
|
+
/***/ }),
|
|
362215
|
+
|
|
362216
|
+
/***/ 39293:
|
|
362217
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
362218
|
+
|
|
362219
|
+
"use strict";
|
|
362220
|
+
|
|
362221
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
362222
|
+
exports.Result = exports.Ok = exports.OkImpl = exports.Err = exports.ErrImpl = void 0;
|
|
362223
|
+
var utils_js_1 = __nccwpck_require__(91414);
|
|
362224
|
+
var option_js_1 = __nccwpck_require__(56456);
|
|
362225
|
+
var asyncresult_js_1 = __nccwpck_require__(6861);
|
|
362226
|
+
/**
|
|
362227
|
+
* Contains the error value
|
|
362228
|
+
*/
|
|
362229
|
+
var ErrImpl = /** @class */ (function () {
|
|
362230
|
+
function ErrImpl(val) {
|
|
362231
|
+
if (!(this instanceof ErrImpl)) {
|
|
362232
|
+
return new ErrImpl(val);
|
|
362233
|
+
}
|
|
362234
|
+
this.error = val;
|
|
362235
|
+
var stackLines = new Error().stack.split('\n').slice(2);
|
|
362236
|
+
if (stackLines && stackLines.length > 0 && stackLines[0].includes('ErrImpl')) {
|
|
362237
|
+
stackLines.shift();
|
|
362238
|
+
}
|
|
362239
|
+
this._stack = stackLines.join('\n');
|
|
362240
|
+
}
|
|
362241
|
+
ErrImpl.prototype.isOk = function () {
|
|
362242
|
+
return false;
|
|
362243
|
+
};
|
|
362244
|
+
ErrImpl.prototype.isErr = function () {
|
|
362245
|
+
return true;
|
|
362246
|
+
};
|
|
362247
|
+
ErrImpl.prototype[Symbol.iterator] = function () {
|
|
362248
|
+
return {
|
|
362249
|
+
next: function () {
|
|
362250
|
+
return { done: true, value: undefined };
|
|
362251
|
+
},
|
|
362252
|
+
};
|
|
362253
|
+
};
|
|
362254
|
+
/**
|
|
362255
|
+
* @deprecated in favor of unwrapOr
|
|
362256
|
+
* @see unwrapOr
|
|
362257
|
+
*/
|
|
362258
|
+
ErrImpl.prototype.else = function (val) {
|
|
362259
|
+
return val;
|
|
362260
|
+
};
|
|
362261
|
+
ErrImpl.prototype.unwrapOr = function (val) {
|
|
362262
|
+
return val;
|
|
362263
|
+
};
|
|
362264
|
+
ErrImpl.prototype.expect = function (msg) {
|
|
362265
|
+
// The cause casting required because of the current TS definition being overly restrictive
|
|
362266
|
+
// (the definition says it has to be an Error while it can be anything).
|
|
362267
|
+
// See https://github.com/microsoft/TypeScript/issues/45167
|
|
362268
|
+
throw new Error("".concat(msg, " - Error: ").concat((0, utils_js_1.toString)(this.error), "\n").concat(this._stack), { cause: this.error });
|
|
362269
|
+
};
|
|
362270
|
+
ErrImpl.prototype.expectErr = function (_msg) {
|
|
362271
|
+
return this.error;
|
|
362272
|
+
};
|
|
362273
|
+
ErrImpl.prototype.unwrap = function () {
|
|
362274
|
+
// The cause casting required because of the current TS definition being overly restrictive
|
|
362275
|
+
// (the definition says it has to be an Error while it can be anything).
|
|
362276
|
+
// See https://github.com/microsoft/TypeScript/issues/45167
|
|
362277
|
+
throw new Error("Tried to unwrap Error: ".concat((0, utils_js_1.toString)(this.error), "\n").concat(this._stack), { cause: this.error });
|
|
362278
|
+
};
|
|
362279
|
+
ErrImpl.prototype.unwrapErr = function () {
|
|
362280
|
+
return this.error;
|
|
362281
|
+
};
|
|
362282
|
+
ErrImpl.prototype.map = function (_mapper) {
|
|
362283
|
+
return this;
|
|
362284
|
+
};
|
|
362285
|
+
ErrImpl.prototype.andThen = function (op) {
|
|
362286
|
+
return this;
|
|
362287
|
+
};
|
|
362288
|
+
ErrImpl.prototype.mapErr = function (mapper) {
|
|
362289
|
+
return new exports.Err(mapper(this.error));
|
|
362290
|
+
};
|
|
362291
|
+
ErrImpl.prototype.mapOr = function (default_, _mapper) {
|
|
362292
|
+
return default_;
|
|
362293
|
+
};
|
|
362294
|
+
ErrImpl.prototype.mapOrElse = function (default_, _mapper) {
|
|
362295
|
+
return default_(this.error);
|
|
362296
|
+
};
|
|
362297
|
+
ErrImpl.prototype.or = function (other) {
|
|
362298
|
+
return other;
|
|
362299
|
+
};
|
|
362300
|
+
ErrImpl.prototype.orElse = function (other) {
|
|
362301
|
+
return other(this.error);
|
|
362302
|
+
};
|
|
362303
|
+
ErrImpl.prototype.toOption = function () {
|
|
362304
|
+
return option_js_1.None;
|
|
362305
|
+
};
|
|
362306
|
+
ErrImpl.prototype.toString = function () {
|
|
362307
|
+
return "Err(".concat((0, utils_js_1.toString)(this.error), ")");
|
|
362308
|
+
};
|
|
362309
|
+
Object.defineProperty(ErrImpl.prototype, "stack", {
|
|
362310
|
+
get: function () {
|
|
362311
|
+
return "".concat(this, "\n").concat(this._stack);
|
|
362312
|
+
},
|
|
362313
|
+
enumerable: false,
|
|
362314
|
+
configurable: true
|
|
362315
|
+
});
|
|
362316
|
+
ErrImpl.prototype.toAsyncResult = function () {
|
|
362317
|
+
return new asyncresult_js_1.AsyncResult(this);
|
|
362318
|
+
};
|
|
362319
|
+
/** An empty Err */
|
|
362320
|
+
ErrImpl.EMPTY = new ErrImpl(undefined);
|
|
362321
|
+
return ErrImpl;
|
|
362322
|
+
}());
|
|
362323
|
+
exports.ErrImpl = ErrImpl;
|
|
362324
|
+
// This allows Err to be callable - possible because of the es5 compilation target
|
|
362325
|
+
exports.Err = ErrImpl;
|
|
362326
|
+
/**
|
|
362327
|
+
* Contains the success value
|
|
362328
|
+
*/
|
|
362329
|
+
var OkImpl = /** @class */ (function () {
|
|
362330
|
+
function OkImpl(val) {
|
|
362331
|
+
if (!(this instanceof OkImpl)) {
|
|
362332
|
+
return new OkImpl(val);
|
|
362333
|
+
}
|
|
362334
|
+
this.value = val;
|
|
362335
|
+
}
|
|
362336
|
+
OkImpl.prototype.isOk = function () {
|
|
362337
|
+
return true;
|
|
362338
|
+
};
|
|
362339
|
+
OkImpl.prototype.isErr = function () {
|
|
362340
|
+
return false;
|
|
362341
|
+
};
|
|
362342
|
+
/**
|
|
362343
|
+
* Helper function if you know you have an Ok<T> and T is iterable
|
|
362344
|
+
*/
|
|
362345
|
+
OkImpl.prototype[Symbol.iterator] = function () {
|
|
362346
|
+
var obj = Object(this.value);
|
|
362347
|
+
return Symbol.iterator in obj
|
|
362348
|
+
? obj[Symbol.iterator]()
|
|
362349
|
+
: {
|
|
362350
|
+
next: function () {
|
|
362351
|
+
return { done: true, value: undefined };
|
|
362352
|
+
},
|
|
362353
|
+
};
|
|
362354
|
+
};
|
|
362355
|
+
/**
|
|
362356
|
+
* @see unwrapOr
|
|
362357
|
+
* @deprecated in favor of unwrapOr
|
|
362358
|
+
*/
|
|
362359
|
+
OkImpl.prototype.else = function (_val) {
|
|
362360
|
+
return this.value;
|
|
362361
|
+
};
|
|
362362
|
+
OkImpl.prototype.unwrapOr = function (_val) {
|
|
362363
|
+
return this.value;
|
|
362364
|
+
};
|
|
362365
|
+
OkImpl.prototype.expect = function (_msg) {
|
|
362366
|
+
return this.value;
|
|
362367
|
+
};
|
|
362368
|
+
OkImpl.prototype.expectErr = function (msg) {
|
|
362369
|
+
throw new Error(msg);
|
|
362370
|
+
};
|
|
362371
|
+
OkImpl.prototype.unwrap = function () {
|
|
362372
|
+
return this.value;
|
|
362373
|
+
};
|
|
362374
|
+
OkImpl.prototype.unwrapErr = function () {
|
|
362375
|
+
// The cause casting required because of the current TS definition being overly restrictive
|
|
362376
|
+
// (the definition says it has to be an Error while it can be anything).
|
|
362377
|
+
// See https://github.com/microsoft/TypeScript/issues/45167
|
|
362378
|
+
throw new Error("Tried to unwrap Ok: ".concat((0, utils_js_1.toString)(this.value)), { cause: this.value });
|
|
362379
|
+
};
|
|
362380
|
+
OkImpl.prototype.map = function (mapper) {
|
|
362381
|
+
return new exports.Ok(mapper(this.value));
|
|
362382
|
+
};
|
|
362383
|
+
OkImpl.prototype.andThen = function (mapper) {
|
|
362384
|
+
return mapper(this.value);
|
|
362385
|
+
};
|
|
362386
|
+
OkImpl.prototype.mapErr = function (_mapper) {
|
|
362387
|
+
return this;
|
|
362388
|
+
};
|
|
362389
|
+
OkImpl.prototype.mapOr = function (_default_, mapper) {
|
|
362390
|
+
return mapper(this.value);
|
|
362391
|
+
};
|
|
362392
|
+
OkImpl.prototype.mapOrElse = function (_default_, mapper) {
|
|
362393
|
+
return mapper(this.value);
|
|
362394
|
+
};
|
|
362395
|
+
OkImpl.prototype.or = function (_other) {
|
|
362396
|
+
return this;
|
|
362397
|
+
};
|
|
362398
|
+
OkImpl.prototype.orElse = function (_other) {
|
|
362399
|
+
return this;
|
|
362400
|
+
};
|
|
362401
|
+
OkImpl.prototype.toOption = function () {
|
|
362402
|
+
return (0, option_js_1.Some)(this.value);
|
|
362403
|
+
};
|
|
362404
|
+
/**
|
|
362405
|
+
* Returns the contained `Ok` value, but never throws.
|
|
362406
|
+
* Unlike `unwrap()`, this method doesn't throw and is only callable on an Ok<T>
|
|
362407
|
+
*
|
|
362408
|
+
* Therefore, it can be used instead of `unwrap()` as a maintainability safeguard
|
|
362409
|
+
* that will fail to compile if the error type of the Result is later changed to an error that can actually occur.
|
|
362410
|
+
*
|
|
362411
|
+
* (this is the `into_ok()` in rust)
|
|
362412
|
+
*/
|
|
362413
|
+
OkImpl.prototype.safeUnwrap = function () {
|
|
362414
|
+
return this.value;
|
|
362415
|
+
};
|
|
362416
|
+
OkImpl.prototype.toString = function () {
|
|
362417
|
+
return "Ok(".concat((0, utils_js_1.toString)(this.value), ")");
|
|
362418
|
+
};
|
|
362419
|
+
OkImpl.prototype.toAsyncResult = function () {
|
|
362420
|
+
return new asyncresult_js_1.AsyncResult(this);
|
|
362421
|
+
};
|
|
362422
|
+
OkImpl.EMPTY = new OkImpl(undefined);
|
|
362423
|
+
return OkImpl;
|
|
362424
|
+
}());
|
|
362425
|
+
exports.OkImpl = OkImpl;
|
|
362426
|
+
// This allows Ok to be callable - possible because of the es5 compilation target
|
|
362427
|
+
exports.Ok = OkImpl;
|
|
362428
|
+
var Result;
|
|
362429
|
+
(function (Result) {
|
|
362430
|
+
/**
|
|
362431
|
+
* Parse a set of `Result`s, returning an array of all `Ok` values.
|
|
362432
|
+
* Short circuits with the first `Err` found, if any
|
|
362433
|
+
*/
|
|
362434
|
+
function all() {
|
|
362435
|
+
var results = [];
|
|
362436
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
362437
|
+
results[_i] = arguments[_i];
|
|
362438
|
+
}
|
|
362439
|
+
var okResult = [];
|
|
362440
|
+
for (var _a = 0, results_1 = results; _a < results_1.length; _a++) {
|
|
362441
|
+
var result = results_1[_a];
|
|
362442
|
+
if (result.isOk()) {
|
|
362443
|
+
okResult.push(result.value);
|
|
362444
|
+
}
|
|
362445
|
+
else {
|
|
362446
|
+
return result;
|
|
362447
|
+
}
|
|
362448
|
+
}
|
|
362449
|
+
return new exports.Ok(okResult);
|
|
362450
|
+
}
|
|
362451
|
+
Result.all = all;
|
|
362452
|
+
/**
|
|
362453
|
+
* Parse a set of `Result`s, short-circuits when an input value is `Ok`.
|
|
362454
|
+
* If no `Ok` is found, returns an `Err` containing the collected error values
|
|
362455
|
+
*/
|
|
362456
|
+
function any() {
|
|
362457
|
+
var results = [];
|
|
362458
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
362459
|
+
results[_i] = arguments[_i];
|
|
362460
|
+
}
|
|
362461
|
+
var errResult = [];
|
|
362462
|
+
// short-circuits
|
|
362463
|
+
for (var _a = 0, results_2 = results; _a < results_2.length; _a++) {
|
|
362464
|
+
var result = results_2[_a];
|
|
362465
|
+
if (result.isOk()) {
|
|
362466
|
+
return result;
|
|
362467
|
+
}
|
|
362468
|
+
else {
|
|
362469
|
+
errResult.push(result.error);
|
|
362470
|
+
}
|
|
362471
|
+
}
|
|
362472
|
+
// it must be a Err
|
|
362473
|
+
return new exports.Err(errResult);
|
|
362474
|
+
}
|
|
362475
|
+
Result.any = any;
|
|
362476
|
+
/**
|
|
362477
|
+
* Wrap an operation that may throw an Error (`try-catch` style) into checked exception style
|
|
362478
|
+
* @param op The operation function
|
|
362479
|
+
*/
|
|
362480
|
+
function wrap(op) {
|
|
362481
|
+
try {
|
|
362482
|
+
return new exports.Ok(op());
|
|
362483
|
+
}
|
|
362484
|
+
catch (e) {
|
|
362485
|
+
return new exports.Err(e);
|
|
362486
|
+
}
|
|
362487
|
+
}
|
|
362488
|
+
Result.wrap = wrap;
|
|
362489
|
+
/**
|
|
362490
|
+
* Wrap an async operation that may throw an Error (`try-catch` style) into checked exception style
|
|
362491
|
+
* @param op The operation function
|
|
362492
|
+
*/
|
|
362493
|
+
function wrapAsync(op) {
|
|
362494
|
+
try {
|
|
362495
|
+
return op()
|
|
362496
|
+
.then(function (val) { return new exports.Ok(val); })
|
|
362497
|
+
.catch(function (e) { return new exports.Err(e); });
|
|
362498
|
+
}
|
|
362499
|
+
catch (e) {
|
|
362500
|
+
return Promise.resolve(new exports.Err(e));
|
|
362501
|
+
}
|
|
362502
|
+
}
|
|
362503
|
+
Result.wrapAsync = wrapAsync;
|
|
362504
|
+
function isResult(val) {
|
|
362505
|
+
return val instanceof exports.Err || val instanceof exports.Ok;
|
|
362506
|
+
}
|
|
362507
|
+
Result.isResult = isResult;
|
|
362508
|
+
})(Result || (exports.Result = Result = {}));
|
|
362509
|
+
//# sourceMappingURL=result.js.map
|
|
362510
|
+
|
|
362511
|
+
/***/ }),
|
|
362512
|
+
|
|
362513
|
+
/***/ 91414:
|
|
362514
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
362515
|
+
|
|
362516
|
+
"use strict";
|
|
362517
|
+
|
|
362518
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
362519
|
+
exports.toString = void 0;
|
|
362520
|
+
function toString(val) {
|
|
362521
|
+
var value = String(val);
|
|
362522
|
+
if (value === '[object Object]') {
|
|
362523
|
+
try {
|
|
362524
|
+
value = JSON.stringify(val);
|
|
362525
|
+
}
|
|
362526
|
+
catch (_a) { }
|
|
362527
|
+
}
|
|
362528
|
+
return value;
|
|
362529
|
+
}
|
|
362530
|
+
exports.toString = toString;
|
|
362531
|
+
//# sourceMappingURL=utils.js.map
|
|
362532
|
+
|
|
362533
|
+
/***/ }),
|
|
362534
|
+
|
|
361411
362535
|
/***/ 23619:
|
|
361412
362536
|
/***/ ((__unused_webpack_module, exports) => {
|
|
361413
362537
|
|
|
@@ -363589,13 +364713,21 @@ module.exports = underscoreNodeF._;
|
|
|
363589
364713
|
//# sourceMappingURL=underscore-node.cjs.map
|
|
363590
364714
|
|
|
363591
364715
|
|
|
364716
|
+
/***/ }),
|
|
364717
|
+
|
|
364718
|
+
/***/ 80478:
|
|
364719
|
+
/***/ ((module) => {
|
|
364720
|
+
|
|
364721
|
+
"use strict";
|
|
364722
|
+
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":""}]');
|
|
364723
|
+
|
|
363592
364724
|
/***/ }),
|
|
363593
364725
|
|
|
363594
364726
|
/***/ 4147:
|
|
363595
364727
|
/***/ ((module) => {
|
|
363596
364728
|
|
|
363597
364729
|
"use strict";
|
|
363598
|
-
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":{"catenv":"./bin/catenv","catladder":"./bin/catladder"},"
|
|
364730
|
+
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"},"dependencies":{"ts-node":"^10.9.1"},"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","prettier-plugin-sh":"^0.14.0","tmp-promise":"^2.0.2","ts-results-es":"^4.1.0-alpha.1","typescript":"^4.5.4","vorpal":"^1.12.0"}}');
|
|
363599
364731
|
|
|
363600
364732
|
/***/ }),
|
|
363601
364733
|
|