@catladder/cli 0.0.0-refactor-gcloud-auth-no-file-7a9a76ea → 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 +529 -202
- package/dist/bundles/cli/index.js +2538 -1138
- 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/dist/utils/getEditor.js +16 -8
- package/dist/utils/getEditor.js.map +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
- package/src/utils/getEditor.ts +4 -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
|
});
|
|
@@ -7985,15 +8362,23 @@ var child_process_promise_1 = __nccwpck_require__(75763);
|
|
|
7985
8362
|
var command_exists_promise_1 = __importDefault(__nccwpck_require__(80133));
|
|
7986
8363
|
var cmd;
|
|
7987
8364
|
exports["default"] = (function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
7988
|
-
|
|
7989
|
-
|
|
8365
|
+
var _a;
|
|
8366
|
+
var _b, _c;
|
|
8367
|
+
return __generator(this, function (_d) {
|
|
8368
|
+
switch (_d.label) {
|
|
7990
8369
|
case 0:
|
|
7991
|
-
if (!!cmd) return [3 /*break*/,
|
|
7992
|
-
|
|
7993
|
-
|
|
7994
|
-
|
|
7995
|
-
|
|
7996
|
-
case 2:
|
|
8370
|
+
if (!!cmd) return [3 /*break*/, 4];
|
|
8371
|
+
if (!((_c = (_b = process.env.VISUAL) !== null && _b !== void 0 ? _b : process.env.EDITOR) !== null && _c !== void 0)) return [3 /*break*/, 1];
|
|
8372
|
+
_a = _c;
|
|
8373
|
+
return [3 /*break*/, 3];
|
|
8374
|
+
case 1: return [4 /*yield*/, (0, command_exists_promise_1["default"])("code")];
|
|
8375
|
+
case 2:
|
|
8376
|
+
_a = ((_d.sent()) ? "code --wait" : "vim");
|
|
8377
|
+
_d.label = 3;
|
|
8378
|
+
case 3:
|
|
8379
|
+
cmd = _a;
|
|
8380
|
+
_d.label = 4;
|
|
8381
|
+
case 4: return [2 /*return*/, {
|
|
7997
8382
|
open: function (path) { return __awaiter(void 0, void 0, void 0, function () {
|
|
7998
8383
|
return __generator(this, function (_a) {
|
|
7999
8384
|
switch (_a.label) {
|
|
@@ -301982,672 +302367,6 @@ var pump = function () {
|
|
|
301982
302367
|
module.exports = pump
|
|
301983
302368
|
|
|
301984
302369
|
|
|
301985
|
-
/***/ }),
|
|
301986
|
-
|
|
301987
|
-
/***/ 68815:
|
|
301988
|
-
/***/ ((module) => {
|
|
301989
|
-
|
|
301990
|
-
"use strict";
|
|
301991
|
-
|
|
301992
|
-
|
|
301993
|
-
var replace = String.prototype.replace;
|
|
301994
|
-
var percentTwenties = /%20/g;
|
|
301995
|
-
|
|
301996
|
-
module.exports = {
|
|
301997
|
-
'default': 'RFC3986',
|
|
301998
|
-
formatters: {
|
|
301999
|
-
RFC1738: function (value) {
|
|
302000
|
-
return replace.call(value, percentTwenties, '+');
|
|
302001
|
-
},
|
|
302002
|
-
RFC3986: function (value) {
|
|
302003
|
-
return value;
|
|
302004
|
-
}
|
|
302005
|
-
},
|
|
302006
|
-
RFC1738: 'RFC1738',
|
|
302007
|
-
RFC3986: 'RFC3986'
|
|
302008
|
-
};
|
|
302009
|
-
|
|
302010
|
-
|
|
302011
|
-
/***/ }),
|
|
302012
|
-
|
|
302013
|
-
/***/ 69241:
|
|
302014
|
-
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
302015
|
-
|
|
302016
|
-
"use strict";
|
|
302017
|
-
|
|
302018
|
-
|
|
302019
|
-
var stringify = __nccwpck_require__(51883);
|
|
302020
|
-
var parse = __nccwpck_require__(87513);
|
|
302021
|
-
var formats = __nccwpck_require__(68815);
|
|
302022
|
-
|
|
302023
|
-
module.exports = {
|
|
302024
|
-
formats: formats,
|
|
302025
|
-
parse: parse,
|
|
302026
|
-
stringify: stringify
|
|
302027
|
-
};
|
|
302028
|
-
|
|
302029
|
-
|
|
302030
|
-
/***/ }),
|
|
302031
|
-
|
|
302032
|
-
/***/ 87513:
|
|
302033
|
-
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
302034
|
-
|
|
302035
|
-
"use strict";
|
|
302036
|
-
|
|
302037
|
-
|
|
302038
|
-
var utils = __nccwpck_require__(99240);
|
|
302039
|
-
|
|
302040
|
-
var has = Object.prototype.hasOwnProperty;
|
|
302041
|
-
|
|
302042
|
-
var defaults = {
|
|
302043
|
-
allowDots: false,
|
|
302044
|
-
allowPrototypes: false,
|
|
302045
|
-
arrayLimit: 20,
|
|
302046
|
-
decoder: utils.decode,
|
|
302047
|
-
delimiter: '&',
|
|
302048
|
-
depth: 5,
|
|
302049
|
-
parameterLimit: 1000,
|
|
302050
|
-
plainObjects: false,
|
|
302051
|
-
strictNullHandling: false
|
|
302052
|
-
};
|
|
302053
|
-
|
|
302054
|
-
var parseValues = function parseQueryStringValues(str, options) {
|
|
302055
|
-
var obj = {};
|
|
302056
|
-
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
|
|
302057
|
-
var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
|
|
302058
|
-
var parts = cleanStr.split(options.delimiter, limit);
|
|
302059
|
-
|
|
302060
|
-
for (var i = 0; i < parts.length; ++i) {
|
|
302061
|
-
var part = parts[i];
|
|
302062
|
-
|
|
302063
|
-
var bracketEqualsPos = part.indexOf(']=');
|
|
302064
|
-
var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
|
|
302065
|
-
|
|
302066
|
-
var key, val;
|
|
302067
|
-
if (pos === -1) {
|
|
302068
|
-
key = options.decoder(part, defaults.decoder);
|
|
302069
|
-
val = options.strictNullHandling ? null : '';
|
|
302070
|
-
} else {
|
|
302071
|
-
key = options.decoder(part.slice(0, pos), defaults.decoder);
|
|
302072
|
-
val = options.decoder(part.slice(pos + 1), defaults.decoder);
|
|
302073
|
-
}
|
|
302074
|
-
if (has.call(obj, key)) {
|
|
302075
|
-
obj[key] = [].concat(obj[key]).concat(val);
|
|
302076
|
-
} else {
|
|
302077
|
-
obj[key] = val;
|
|
302078
|
-
}
|
|
302079
|
-
}
|
|
302080
|
-
|
|
302081
|
-
return obj;
|
|
302082
|
-
};
|
|
302083
|
-
|
|
302084
|
-
var parseObject = function (chain, val, options) {
|
|
302085
|
-
var leaf = val;
|
|
302086
|
-
|
|
302087
|
-
for (var i = chain.length - 1; i >= 0; --i) {
|
|
302088
|
-
var obj;
|
|
302089
|
-
var root = chain[i];
|
|
302090
|
-
|
|
302091
|
-
if (root === '[]') {
|
|
302092
|
-
obj = [];
|
|
302093
|
-
obj = obj.concat(leaf);
|
|
302094
|
-
} else {
|
|
302095
|
-
obj = options.plainObjects ? Object.create(null) : {};
|
|
302096
|
-
var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
|
|
302097
|
-
var index = parseInt(cleanRoot, 10);
|
|
302098
|
-
if (
|
|
302099
|
-
!isNaN(index)
|
|
302100
|
-
&& root !== cleanRoot
|
|
302101
|
-
&& String(index) === cleanRoot
|
|
302102
|
-
&& index >= 0
|
|
302103
|
-
&& (options.parseArrays && index <= options.arrayLimit)
|
|
302104
|
-
) {
|
|
302105
|
-
obj = [];
|
|
302106
|
-
obj[index] = leaf;
|
|
302107
|
-
} else {
|
|
302108
|
-
obj[cleanRoot] = leaf;
|
|
302109
|
-
}
|
|
302110
|
-
}
|
|
302111
|
-
|
|
302112
|
-
leaf = obj;
|
|
302113
|
-
}
|
|
302114
|
-
|
|
302115
|
-
return leaf;
|
|
302116
|
-
};
|
|
302117
|
-
|
|
302118
|
-
var parseKeys = function parseQueryStringKeys(givenKey, val, options) {
|
|
302119
|
-
if (!givenKey) {
|
|
302120
|
-
return;
|
|
302121
|
-
}
|
|
302122
|
-
|
|
302123
|
-
// Transform dot notation to bracket notation
|
|
302124
|
-
var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
|
|
302125
|
-
|
|
302126
|
-
// The regex chunks
|
|
302127
|
-
|
|
302128
|
-
var brackets = /(\[[^[\]]*])/;
|
|
302129
|
-
var child = /(\[[^[\]]*])/g;
|
|
302130
|
-
|
|
302131
|
-
// Get the parent
|
|
302132
|
-
|
|
302133
|
-
var segment = brackets.exec(key);
|
|
302134
|
-
var parent = segment ? key.slice(0, segment.index) : key;
|
|
302135
|
-
|
|
302136
|
-
// Stash the parent if it exists
|
|
302137
|
-
|
|
302138
|
-
var keys = [];
|
|
302139
|
-
if (parent) {
|
|
302140
|
-
// If we aren't using plain objects, optionally prefix keys
|
|
302141
|
-
// that would overwrite object prototype properties
|
|
302142
|
-
if (!options.plainObjects && has.call(Object.prototype, parent)) {
|
|
302143
|
-
if (!options.allowPrototypes) {
|
|
302144
|
-
return;
|
|
302145
|
-
}
|
|
302146
|
-
}
|
|
302147
|
-
|
|
302148
|
-
keys.push(parent);
|
|
302149
|
-
}
|
|
302150
|
-
|
|
302151
|
-
// Loop through children appending to the array until we hit depth
|
|
302152
|
-
|
|
302153
|
-
var i = 0;
|
|
302154
|
-
while ((segment = child.exec(key)) !== null && i < options.depth) {
|
|
302155
|
-
i += 1;
|
|
302156
|
-
if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
|
|
302157
|
-
if (!options.allowPrototypes) {
|
|
302158
|
-
return;
|
|
302159
|
-
}
|
|
302160
|
-
}
|
|
302161
|
-
keys.push(segment[1]);
|
|
302162
|
-
}
|
|
302163
|
-
|
|
302164
|
-
// If there's a remainder, just add whatever is left
|
|
302165
|
-
|
|
302166
|
-
if (segment) {
|
|
302167
|
-
keys.push('[' + key.slice(segment.index) + ']');
|
|
302168
|
-
}
|
|
302169
|
-
|
|
302170
|
-
return parseObject(keys, val, options);
|
|
302171
|
-
};
|
|
302172
|
-
|
|
302173
|
-
module.exports = function (str, opts) {
|
|
302174
|
-
var options = opts ? utils.assign({}, opts) : {};
|
|
302175
|
-
|
|
302176
|
-
if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') {
|
|
302177
|
-
throw new TypeError('Decoder has to be a function.');
|
|
302178
|
-
}
|
|
302179
|
-
|
|
302180
|
-
options.ignoreQueryPrefix = options.ignoreQueryPrefix === true;
|
|
302181
|
-
options.delimiter = typeof options.delimiter === 'string' || utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter;
|
|
302182
|
-
options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth;
|
|
302183
|
-
options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit;
|
|
302184
|
-
options.parseArrays = options.parseArrays !== false;
|
|
302185
|
-
options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults.decoder;
|
|
302186
|
-
options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults.allowDots;
|
|
302187
|
-
options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults.plainObjects;
|
|
302188
|
-
options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes;
|
|
302189
|
-
options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit;
|
|
302190
|
-
options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;
|
|
302191
|
-
|
|
302192
|
-
if (str === '' || str === null || typeof str === 'undefined') {
|
|
302193
|
-
return options.plainObjects ? Object.create(null) : {};
|
|
302194
|
-
}
|
|
302195
|
-
|
|
302196
|
-
var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
|
|
302197
|
-
var obj = options.plainObjects ? Object.create(null) : {};
|
|
302198
|
-
|
|
302199
|
-
// Iterate over the keys and setup the new object
|
|
302200
|
-
|
|
302201
|
-
var keys = Object.keys(tempObj);
|
|
302202
|
-
for (var i = 0; i < keys.length; ++i) {
|
|
302203
|
-
var key = keys[i];
|
|
302204
|
-
var newObj = parseKeys(key, tempObj[key], options);
|
|
302205
|
-
obj = utils.merge(obj, newObj, options);
|
|
302206
|
-
}
|
|
302207
|
-
|
|
302208
|
-
return utils.compact(obj);
|
|
302209
|
-
};
|
|
302210
|
-
|
|
302211
|
-
|
|
302212
|
-
/***/ }),
|
|
302213
|
-
|
|
302214
|
-
/***/ 51883:
|
|
302215
|
-
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
302216
|
-
|
|
302217
|
-
"use strict";
|
|
302218
|
-
|
|
302219
|
-
|
|
302220
|
-
var utils = __nccwpck_require__(99240);
|
|
302221
|
-
var formats = __nccwpck_require__(68815);
|
|
302222
|
-
|
|
302223
|
-
var arrayPrefixGenerators = {
|
|
302224
|
-
brackets: function brackets(prefix) { // eslint-disable-line func-name-matching
|
|
302225
|
-
return prefix + '[]';
|
|
302226
|
-
},
|
|
302227
|
-
indices: function indices(prefix, key) { // eslint-disable-line func-name-matching
|
|
302228
|
-
return prefix + '[' + key + ']';
|
|
302229
|
-
},
|
|
302230
|
-
repeat: function repeat(prefix) { // eslint-disable-line func-name-matching
|
|
302231
|
-
return prefix;
|
|
302232
|
-
}
|
|
302233
|
-
};
|
|
302234
|
-
|
|
302235
|
-
var toISO = Date.prototype.toISOString;
|
|
302236
|
-
|
|
302237
|
-
var defaults = {
|
|
302238
|
-
delimiter: '&',
|
|
302239
|
-
encode: true,
|
|
302240
|
-
encoder: utils.encode,
|
|
302241
|
-
encodeValuesOnly: false,
|
|
302242
|
-
serializeDate: function serializeDate(date) { // eslint-disable-line func-name-matching
|
|
302243
|
-
return toISO.call(date);
|
|
302244
|
-
},
|
|
302245
|
-
skipNulls: false,
|
|
302246
|
-
strictNullHandling: false
|
|
302247
|
-
};
|
|
302248
|
-
|
|
302249
|
-
var stringify = function stringify( // eslint-disable-line func-name-matching
|
|
302250
|
-
object,
|
|
302251
|
-
prefix,
|
|
302252
|
-
generateArrayPrefix,
|
|
302253
|
-
strictNullHandling,
|
|
302254
|
-
skipNulls,
|
|
302255
|
-
encoder,
|
|
302256
|
-
filter,
|
|
302257
|
-
sort,
|
|
302258
|
-
allowDots,
|
|
302259
|
-
serializeDate,
|
|
302260
|
-
formatter,
|
|
302261
|
-
encodeValuesOnly
|
|
302262
|
-
) {
|
|
302263
|
-
var obj = object;
|
|
302264
|
-
if (typeof filter === 'function') {
|
|
302265
|
-
obj = filter(prefix, obj);
|
|
302266
|
-
} else if (obj instanceof Date) {
|
|
302267
|
-
obj = serializeDate(obj);
|
|
302268
|
-
} else if (obj === null) {
|
|
302269
|
-
if (strictNullHandling) {
|
|
302270
|
-
return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder) : prefix;
|
|
302271
|
-
}
|
|
302272
|
-
|
|
302273
|
-
obj = '';
|
|
302274
|
-
}
|
|
302275
|
-
|
|
302276
|
-
if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) {
|
|
302277
|
-
if (encoder) {
|
|
302278
|
-
var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder);
|
|
302279
|
-
return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder))];
|
|
302280
|
-
}
|
|
302281
|
-
return [formatter(prefix) + '=' + formatter(String(obj))];
|
|
302282
|
-
}
|
|
302283
|
-
|
|
302284
|
-
var values = [];
|
|
302285
|
-
|
|
302286
|
-
if (typeof obj === 'undefined') {
|
|
302287
|
-
return values;
|
|
302288
|
-
}
|
|
302289
|
-
|
|
302290
|
-
var objKeys;
|
|
302291
|
-
if (Array.isArray(filter)) {
|
|
302292
|
-
objKeys = filter;
|
|
302293
|
-
} else {
|
|
302294
|
-
var keys = Object.keys(obj);
|
|
302295
|
-
objKeys = sort ? keys.sort(sort) : keys;
|
|
302296
|
-
}
|
|
302297
|
-
|
|
302298
|
-
for (var i = 0; i < objKeys.length; ++i) {
|
|
302299
|
-
var key = objKeys[i];
|
|
302300
|
-
|
|
302301
|
-
if (skipNulls && obj[key] === null) {
|
|
302302
|
-
continue;
|
|
302303
|
-
}
|
|
302304
|
-
|
|
302305
|
-
if (Array.isArray(obj)) {
|
|
302306
|
-
values = values.concat(stringify(
|
|
302307
|
-
obj[key],
|
|
302308
|
-
generateArrayPrefix(prefix, key),
|
|
302309
|
-
generateArrayPrefix,
|
|
302310
|
-
strictNullHandling,
|
|
302311
|
-
skipNulls,
|
|
302312
|
-
encoder,
|
|
302313
|
-
filter,
|
|
302314
|
-
sort,
|
|
302315
|
-
allowDots,
|
|
302316
|
-
serializeDate,
|
|
302317
|
-
formatter,
|
|
302318
|
-
encodeValuesOnly
|
|
302319
|
-
));
|
|
302320
|
-
} else {
|
|
302321
|
-
values = values.concat(stringify(
|
|
302322
|
-
obj[key],
|
|
302323
|
-
prefix + (allowDots ? '.' + key : '[' + key + ']'),
|
|
302324
|
-
generateArrayPrefix,
|
|
302325
|
-
strictNullHandling,
|
|
302326
|
-
skipNulls,
|
|
302327
|
-
encoder,
|
|
302328
|
-
filter,
|
|
302329
|
-
sort,
|
|
302330
|
-
allowDots,
|
|
302331
|
-
serializeDate,
|
|
302332
|
-
formatter,
|
|
302333
|
-
encodeValuesOnly
|
|
302334
|
-
));
|
|
302335
|
-
}
|
|
302336
|
-
}
|
|
302337
|
-
|
|
302338
|
-
return values;
|
|
302339
|
-
};
|
|
302340
|
-
|
|
302341
|
-
module.exports = function (object, opts) {
|
|
302342
|
-
var obj = object;
|
|
302343
|
-
var options = opts ? utils.assign({}, opts) : {};
|
|
302344
|
-
|
|
302345
|
-
if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') {
|
|
302346
|
-
throw new TypeError('Encoder has to be a function.');
|
|
302347
|
-
}
|
|
302348
|
-
|
|
302349
|
-
var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter;
|
|
302350
|
-
var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;
|
|
302351
|
-
var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls;
|
|
302352
|
-
var encode = typeof options.encode === 'boolean' ? options.encode : defaults.encode;
|
|
302353
|
-
var encoder = typeof options.encoder === 'function' ? options.encoder : defaults.encoder;
|
|
302354
|
-
var sort = typeof options.sort === 'function' ? options.sort : null;
|
|
302355
|
-
var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots;
|
|
302356
|
-
var serializeDate = typeof options.serializeDate === 'function' ? options.serializeDate : defaults.serializeDate;
|
|
302357
|
-
var encodeValuesOnly = typeof options.encodeValuesOnly === 'boolean' ? options.encodeValuesOnly : defaults.encodeValuesOnly;
|
|
302358
|
-
if (typeof options.format === 'undefined') {
|
|
302359
|
-
options.format = formats['default'];
|
|
302360
|
-
} else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options.format)) {
|
|
302361
|
-
throw new TypeError('Unknown format option provided.');
|
|
302362
|
-
}
|
|
302363
|
-
var formatter = formats.formatters[options.format];
|
|
302364
|
-
var objKeys;
|
|
302365
|
-
var filter;
|
|
302366
|
-
|
|
302367
|
-
if (typeof options.filter === 'function') {
|
|
302368
|
-
filter = options.filter;
|
|
302369
|
-
obj = filter('', obj);
|
|
302370
|
-
} else if (Array.isArray(options.filter)) {
|
|
302371
|
-
filter = options.filter;
|
|
302372
|
-
objKeys = filter;
|
|
302373
|
-
}
|
|
302374
|
-
|
|
302375
|
-
var keys = [];
|
|
302376
|
-
|
|
302377
|
-
if (typeof obj !== 'object' || obj === null) {
|
|
302378
|
-
return '';
|
|
302379
|
-
}
|
|
302380
|
-
|
|
302381
|
-
var arrayFormat;
|
|
302382
|
-
if (options.arrayFormat in arrayPrefixGenerators) {
|
|
302383
|
-
arrayFormat = options.arrayFormat;
|
|
302384
|
-
} else if ('indices' in options) {
|
|
302385
|
-
arrayFormat = options.indices ? 'indices' : 'repeat';
|
|
302386
|
-
} else {
|
|
302387
|
-
arrayFormat = 'indices';
|
|
302388
|
-
}
|
|
302389
|
-
|
|
302390
|
-
var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
|
|
302391
|
-
|
|
302392
|
-
if (!objKeys) {
|
|
302393
|
-
objKeys = Object.keys(obj);
|
|
302394
|
-
}
|
|
302395
|
-
|
|
302396
|
-
if (sort) {
|
|
302397
|
-
objKeys.sort(sort);
|
|
302398
|
-
}
|
|
302399
|
-
|
|
302400
|
-
for (var i = 0; i < objKeys.length; ++i) {
|
|
302401
|
-
var key = objKeys[i];
|
|
302402
|
-
|
|
302403
|
-
if (skipNulls && obj[key] === null) {
|
|
302404
|
-
continue;
|
|
302405
|
-
}
|
|
302406
|
-
|
|
302407
|
-
keys = keys.concat(stringify(
|
|
302408
|
-
obj[key],
|
|
302409
|
-
key,
|
|
302410
|
-
generateArrayPrefix,
|
|
302411
|
-
strictNullHandling,
|
|
302412
|
-
skipNulls,
|
|
302413
|
-
encode ? encoder : null,
|
|
302414
|
-
filter,
|
|
302415
|
-
sort,
|
|
302416
|
-
allowDots,
|
|
302417
|
-
serializeDate,
|
|
302418
|
-
formatter,
|
|
302419
|
-
encodeValuesOnly
|
|
302420
|
-
));
|
|
302421
|
-
}
|
|
302422
|
-
|
|
302423
|
-
var joined = keys.join(delimiter);
|
|
302424
|
-
var prefix = options.addQueryPrefix === true ? '?' : '';
|
|
302425
|
-
|
|
302426
|
-
return joined.length > 0 ? prefix + joined : '';
|
|
302427
|
-
};
|
|
302428
|
-
|
|
302429
|
-
|
|
302430
|
-
/***/ }),
|
|
302431
|
-
|
|
302432
|
-
/***/ 99240:
|
|
302433
|
-
/***/ ((module) => {
|
|
302434
|
-
|
|
302435
|
-
"use strict";
|
|
302436
|
-
|
|
302437
|
-
|
|
302438
|
-
var has = Object.prototype.hasOwnProperty;
|
|
302439
|
-
|
|
302440
|
-
var hexTable = (function () {
|
|
302441
|
-
var array = [];
|
|
302442
|
-
for (var i = 0; i < 256; ++i) {
|
|
302443
|
-
array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
|
|
302444
|
-
}
|
|
302445
|
-
|
|
302446
|
-
return array;
|
|
302447
|
-
}());
|
|
302448
|
-
|
|
302449
|
-
var compactQueue = function compactQueue(queue) {
|
|
302450
|
-
var obj;
|
|
302451
|
-
|
|
302452
|
-
while (queue.length) {
|
|
302453
|
-
var item = queue.pop();
|
|
302454
|
-
obj = item.obj[item.prop];
|
|
302455
|
-
|
|
302456
|
-
if (Array.isArray(obj)) {
|
|
302457
|
-
var compacted = [];
|
|
302458
|
-
|
|
302459
|
-
for (var j = 0; j < obj.length; ++j) {
|
|
302460
|
-
if (typeof obj[j] !== 'undefined') {
|
|
302461
|
-
compacted.push(obj[j]);
|
|
302462
|
-
}
|
|
302463
|
-
}
|
|
302464
|
-
|
|
302465
|
-
item.obj[item.prop] = compacted;
|
|
302466
|
-
}
|
|
302467
|
-
}
|
|
302468
|
-
|
|
302469
|
-
return obj;
|
|
302470
|
-
};
|
|
302471
|
-
|
|
302472
|
-
var arrayToObject = function arrayToObject(source, options) {
|
|
302473
|
-
var obj = options && options.plainObjects ? Object.create(null) : {};
|
|
302474
|
-
for (var i = 0; i < source.length; ++i) {
|
|
302475
|
-
if (typeof source[i] !== 'undefined') {
|
|
302476
|
-
obj[i] = source[i];
|
|
302477
|
-
}
|
|
302478
|
-
}
|
|
302479
|
-
|
|
302480
|
-
return obj;
|
|
302481
|
-
};
|
|
302482
|
-
|
|
302483
|
-
var merge = function merge(target, source, options) {
|
|
302484
|
-
if (!source) {
|
|
302485
|
-
return target;
|
|
302486
|
-
}
|
|
302487
|
-
|
|
302488
|
-
if (typeof source !== 'object') {
|
|
302489
|
-
if (Array.isArray(target)) {
|
|
302490
|
-
target.push(source);
|
|
302491
|
-
} else if (typeof target === 'object') {
|
|
302492
|
-
if (options.plainObjects || options.allowPrototypes || !has.call(Object.prototype, source)) {
|
|
302493
|
-
target[source] = true;
|
|
302494
|
-
}
|
|
302495
|
-
} else {
|
|
302496
|
-
return [target, source];
|
|
302497
|
-
}
|
|
302498
|
-
|
|
302499
|
-
return target;
|
|
302500
|
-
}
|
|
302501
|
-
|
|
302502
|
-
if (typeof target !== 'object') {
|
|
302503
|
-
return [target].concat(source);
|
|
302504
|
-
}
|
|
302505
|
-
|
|
302506
|
-
var mergeTarget = target;
|
|
302507
|
-
if (Array.isArray(target) && !Array.isArray(source)) {
|
|
302508
|
-
mergeTarget = arrayToObject(target, options);
|
|
302509
|
-
}
|
|
302510
|
-
|
|
302511
|
-
if (Array.isArray(target) && Array.isArray(source)) {
|
|
302512
|
-
source.forEach(function (item, i) {
|
|
302513
|
-
if (has.call(target, i)) {
|
|
302514
|
-
if (target[i] && typeof target[i] === 'object') {
|
|
302515
|
-
target[i] = merge(target[i], item, options);
|
|
302516
|
-
} else {
|
|
302517
|
-
target.push(item);
|
|
302518
|
-
}
|
|
302519
|
-
} else {
|
|
302520
|
-
target[i] = item;
|
|
302521
|
-
}
|
|
302522
|
-
});
|
|
302523
|
-
return target;
|
|
302524
|
-
}
|
|
302525
|
-
|
|
302526
|
-
return Object.keys(source).reduce(function (acc, key) {
|
|
302527
|
-
var value = source[key];
|
|
302528
|
-
|
|
302529
|
-
if (has.call(acc, key)) {
|
|
302530
|
-
acc[key] = merge(acc[key], value, options);
|
|
302531
|
-
} else {
|
|
302532
|
-
acc[key] = value;
|
|
302533
|
-
}
|
|
302534
|
-
return acc;
|
|
302535
|
-
}, mergeTarget);
|
|
302536
|
-
};
|
|
302537
|
-
|
|
302538
|
-
var assign = function assignSingleSource(target, source) {
|
|
302539
|
-
return Object.keys(source).reduce(function (acc, key) {
|
|
302540
|
-
acc[key] = source[key];
|
|
302541
|
-
return acc;
|
|
302542
|
-
}, target);
|
|
302543
|
-
};
|
|
302544
|
-
|
|
302545
|
-
var decode = function (str) {
|
|
302546
|
-
try {
|
|
302547
|
-
return decodeURIComponent(str.replace(/\+/g, ' '));
|
|
302548
|
-
} catch (e) {
|
|
302549
|
-
return str;
|
|
302550
|
-
}
|
|
302551
|
-
};
|
|
302552
|
-
|
|
302553
|
-
var encode = function encode(str) {
|
|
302554
|
-
// This code was originally written by Brian White (mscdex) for the io.js core querystring library.
|
|
302555
|
-
// It has been adapted here for stricter adherence to RFC 3986
|
|
302556
|
-
if (str.length === 0) {
|
|
302557
|
-
return str;
|
|
302558
|
-
}
|
|
302559
|
-
|
|
302560
|
-
var string = typeof str === 'string' ? str : String(str);
|
|
302561
|
-
|
|
302562
|
-
var out = '';
|
|
302563
|
-
for (var i = 0; i < string.length; ++i) {
|
|
302564
|
-
var c = string.charCodeAt(i);
|
|
302565
|
-
|
|
302566
|
-
if (
|
|
302567
|
-
c === 0x2D // -
|
|
302568
|
-
|| c === 0x2E // .
|
|
302569
|
-
|| c === 0x5F // _
|
|
302570
|
-
|| c === 0x7E // ~
|
|
302571
|
-
|| (c >= 0x30 && c <= 0x39) // 0-9
|
|
302572
|
-
|| (c >= 0x41 && c <= 0x5A) // a-z
|
|
302573
|
-
|| (c >= 0x61 && c <= 0x7A) // A-Z
|
|
302574
|
-
) {
|
|
302575
|
-
out += string.charAt(i);
|
|
302576
|
-
continue;
|
|
302577
|
-
}
|
|
302578
|
-
|
|
302579
|
-
if (c < 0x80) {
|
|
302580
|
-
out = out + hexTable[c];
|
|
302581
|
-
continue;
|
|
302582
|
-
}
|
|
302583
|
-
|
|
302584
|
-
if (c < 0x800) {
|
|
302585
|
-
out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
|
|
302586
|
-
continue;
|
|
302587
|
-
}
|
|
302588
|
-
|
|
302589
|
-
if (c < 0xD800 || c >= 0xE000) {
|
|
302590
|
-
out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
|
|
302591
|
-
continue;
|
|
302592
|
-
}
|
|
302593
|
-
|
|
302594
|
-
i += 1;
|
|
302595
|
-
c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
|
|
302596
|
-
out += hexTable[0xF0 | (c >> 18)]
|
|
302597
|
-
+ hexTable[0x80 | ((c >> 12) & 0x3F)]
|
|
302598
|
-
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
|
|
302599
|
-
+ hexTable[0x80 | (c & 0x3F)];
|
|
302600
|
-
}
|
|
302601
|
-
|
|
302602
|
-
return out;
|
|
302603
|
-
};
|
|
302604
|
-
|
|
302605
|
-
var compact = function compact(value) {
|
|
302606
|
-
var queue = [{ obj: { o: value }, prop: 'o' }];
|
|
302607
|
-
var refs = [];
|
|
302608
|
-
|
|
302609
|
-
for (var i = 0; i < queue.length; ++i) {
|
|
302610
|
-
var item = queue[i];
|
|
302611
|
-
var obj = item.obj[item.prop];
|
|
302612
|
-
|
|
302613
|
-
var keys = Object.keys(obj);
|
|
302614
|
-
for (var j = 0; j < keys.length; ++j) {
|
|
302615
|
-
var key = keys[j];
|
|
302616
|
-
var val = obj[key];
|
|
302617
|
-
if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
|
|
302618
|
-
queue.push({ obj: obj, prop: key });
|
|
302619
|
-
refs.push(val);
|
|
302620
|
-
}
|
|
302621
|
-
}
|
|
302622
|
-
}
|
|
302623
|
-
|
|
302624
|
-
return compactQueue(queue);
|
|
302625
|
-
};
|
|
302626
|
-
|
|
302627
|
-
var isRegExp = function isRegExp(obj) {
|
|
302628
|
-
return Object.prototype.toString.call(obj) === '[object RegExp]';
|
|
302629
|
-
};
|
|
302630
|
-
|
|
302631
|
-
var isBuffer = function isBuffer(obj) {
|
|
302632
|
-
if (obj === null || typeof obj === 'undefined') {
|
|
302633
|
-
return false;
|
|
302634
|
-
}
|
|
302635
|
-
|
|
302636
|
-
return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
|
|
302637
|
-
};
|
|
302638
|
-
|
|
302639
|
-
module.exports = {
|
|
302640
|
-
arrayToObject: arrayToObject,
|
|
302641
|
-
assign: assign,
|
|
302642
|
-
compact: compact,
|
|
302643
|
-
decode: decode,
|
|
302644
|
-
encode: encode,
|
|
302645
|
-
isBuffer: isBuffer,
|
|
302646
|
-
isRegExp: isRegExp,
|
|
302647
|
-
merge: merge
|
|
302648
|
-
};
|
|
302649
|
-
|
|
302650
|
-
|
|
302651
302370
|
/***/ }),
|
|
302652
302371
|
|
|
302653
302372
|
/***/ 5074:
|
|
@@ -303951,7 +303670,7 @@ exports.$ = Multipart
|
|
|
303951
303670
|
|
|
303952
303671
|
|
|
303953
303672
|
var url = __nccwpck_require__(57310)
|
|
303954
|
-
var qs = __nccwpck_require__(
|
|
303673
|
+
var qs = __nccwpck_require__(41746)
|
|
303955
303674
|
var caseless = __nccwpck_require__(30071)
|
|
303956
303675
|
var uuid = __nccwpck_require__(79180)
|
|
303957
303676
|
var oauth = __nccwpck_require__(91579)
|
|
@@ -304106,7 +303825,7 @@ exports.f = OAuth
|
|
|
304106
303825
|
"use strict";
|
|
304107
303826
|
|
|
304108
303827
|
|
|
304109
|
-
var qs = __nccwpck_require__(
|
|
303828
|
+
var qs = __nccwpck_require__(41746)
|
|
304110
303829
|
var querystring = __nccwpck_require__(63477)
|
|
304111
303830
|
|
|
304112
303831
|
function Querystring (request) {
|
|
@@ -304982,6 +304701,672 @@ module.exports = function(dst, src) {
|
|
|
304982
304701
|
};
|
|
304983
304702
|
|
|
304984
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
|
+
|
|
304985
305370
|
/***/ }),
|
|
304986
305371
|
|
|
304987
305372
|
/***/ 97336:
|
|
@@ -355077,7 +355462,7 @@ var createRailsBuildJobs = function (context) {
|
|
|
355077
355462
|
dockerBuild: {
|
|
355078
355463
|
variables: __assign(__assign({}, context.environment.jobOnlyVars.build.envVars), context.componentConfig.build.extraVars),
|
|
355079
355464
|
// custom script
|
|
355080
|
-
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",
|
|
355081
355466
|
// replace private git ssh gem sources with https to make bundler with credentials via env var work
|
|
355082
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)
|
|
355083
355468
|
}
|
|
@@ -355462,7 +355847,7 @@ exports.readConfigSync = readConfigSync;
|
|
|
355462
355847
|
|
|
355463
355848
|
exports.__esModule = true;
|
|
355464
355849
|
exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
|
|
355465
|
-
exports.PIPELINE_IMAGE_TAG = "
|
|
355850
|
+
exports.PIPELINE_IMAGE_TAG = "refactore-catenv-command-validates-argument-78d05852" || 0;
|
|
355466
355851
|
exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
|
|
355467
355852
|
|
|
355468
355853
|
/***/ }),
|
|
@@ -356372,7 +356757,7 @@ exports.__esModule = true;
|
|
|
356372
356757
|
exports.translateLegacyFromComponents = exports.resolveReferences = void 0;
|
|
356373
356758
|
var lodash_1 = __nccwpck_require__(23255);
|
|
356374
356759
|
var string_replace_async_1 = __importDefault(__nccwpck_require__(44439));
|
|
356375
|
-
var REGEX = /\$\{(([^:]+):)?([^}]+)}/gm;
|
|
356760
|
+
var REGEX = /\$\{(([^:}]+):)?([^}]+)}/gm;
|
|
356376
356761
|
var resolveReferences = function (vars, getOtherVariables, alreadyVisitedBase) {
|
|
356377
356762
|
if (alreadyVisitedBase === void 0) {
|
|
356378
356763
|
alreadyVisitedBase = {};
|
|
@@ -357161,173 +357546,578 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
|
357161
357546
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
357162
357547
|
};
|
|
357163
357548
|
exports.__esModule = true;
|
|
357164
|
-
exports.getRemoveOldRevisionsAndImagesCommand = void 0;
|
|
357165
|
-
var artifactsRegistry_1 = __nccwpck_require__(28159);
|
|
357166
|
-
var cloudRunRevisions_1 = __nccwpck_require__(31101);
|
|
357167
|
-
var getRemoveOldRevisionsAndImagesCommand = function (context, when) {
|
|
357168
|
-
if (when === "onStop") {
|
|
357169
|
-
// service is already deleted, so we don't need to delete old revisions, just delete all images
|
|
357170
|
-
return (0, artifactsRegistry_1.getDeleteUnusedImagesCommands)(context);
|
|
357171
|
-
}
|
|
357172
|
-
// this number only targets inactive revisions
|
|
357173
|
-
var revisionsToKeep = context.environment.envType === "prod" ? 5 : 0;
|
|
357174
|
-
// this number needs to be higher than inactive after deploy, so we add one
|
|
357175
|
-
var imagesToKeep = revisionsToKeep + 1;
|
|
357176
|
-
var deleteOldRevisionsCommands = (0, cloudRunRevisions_1.getDeleteUnusedRevisionsCommands)(context, revisionsToKeep);
|
|
357177
|
-
var deleteOldImagesCommands = (0, artifactsRegistry_1.getDeleteUnusedImagesCommands)(context, imagesToKeep);
|
|
357178
|
-
return __spreadArray(__spreadArray([], __read(deleteOldRevisionsCommands), false), __read(deleteOldImagesCommands), false);
|
|
357179
|
-
};
|
|
357180
|
-
exports.getRemoveOldRevisionsAndImagesCommand = getRemoveOldRevisionsAndImagesCommand;
|
|
357549
|
+
exports.getRemoveOldRevisionsAndImagesCommand = void 0;
|
|
357550
|
+
var artifactsRegistry_1 = __nccwpck_require__(28159);
|
|
357551
|
+
var cloudRunRevisions_1 = __nccwpck_require__(31101);
|
|
357552
|
+
var getRemoveOldRevisionsAndImagesCommand = function (context, when) {
|
|
357553
|
+
if (when === "onStop") {
|
|
357554
|
+
// service is already deleted, so we don't need to delete old revisions, just delete all images
|
|
357555
|
+
return (0, artifactsRegistry_1.getDeleteUnusedImagesCommands)(context);
|
|
357556
|
+
}
|
|
357557
|
+
// this number only targets inactive revisions
|
|
357558
|
+
var revisionsToKeep = context.environment.envType === "prod" ? 5 : 0;
|
|
357559
|
+
// this number needs to be higher than inactive after deploy, so we add one
|
|
357560
|
+
var imagesToKeep = revisionsToKeep + 1;
|
|
357561
|
+
var deleteOldRevisionsCommands = (0, cloudRunRevisions_1.getDeleteUnusedRevisionsCommands)(context, revisionsToKeep);
|
|
357562
|
+
var deleteOldImagesCommands = (0, artifactsRegistry_1.getDeleteUnusedImagesCommands)(context, imagesToKeep);
|
|
357563
|
+
return __spreadArray(__spreadArray([], __read(deleteOldRevisionsCommands), false), __read(deleteOldImagesCommands), false);
|
|
357564
|
+
};
|
|
357565
|
+
exports.getRemoveOldRevisionsAndImagesCommand = getRemoveOldRevisionsAndImagesCommand;
|
|
357566
|
+
|
|
357567
|
+
/***/ }),
|
|
357568
|
+
|
|
357569
|
+
/***/ 31101:
|
|
357570
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
357571
|
+
|
|
357572
|
+
"use strict";
|
|
357573
|
+
|
|
357574
|
+
|
|
357575
|
+
var __assign = this && this.__assign || function () {
|
|
357576
|
+
__assign = Object.assign || function (t) {
|
|
357577
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
357578
|
+
s = arguments[i];
|
|
357579
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
357580
|
+
}
|
|
357581
|
+
return t;
|
|
357582
|
+
};
|
|
357583
|
+
return __assign.apply(this, arguments);
|
|
357584
|
+
};
|
|
357585
|
+
exports.__esModule = true;
|
|
357586
|
+
exports.getDeleteUnusedRevisionsCommands = void 0;
|
|
357587
|
+
var types_1 = __nccwpck_require__(63109);
|
|
357588
|
+
var createArgsString_1 = __nccwpck_require__(8686);
|
|
357589
|
+
var getServiceName_1 = __nccwpck_require__(89391);
|
|
357590
|
+
var removeFirstLinesFromCommandOutput_1 = __nccwpck_require__(77547);
|
|
357591
|
+
var getListRevisionsCommand = function (context, args) {
|
|
357592
|
+
var serviceName = (0, getServiceName_1.getServiceName)(context);
|
|
357593
|
+
var deployConfig = context.componentConfig.deploy;
|
|
357594
|
+
if (!deployConfig || !(0, types_1.isOfDeployType)(deployConfig, "google-cloudrun")) {
|
|
357595
|
+
// should not happen
|
|
357596
|
+
throw new Error("deploy config is wrong");
|
|
357597
|
+
}
|
|
357598
|
+
var filterRevisionArgs = __assign({
|
|
357599
|
+
project: deployConfig.projectId,
|
|
357600
|
+
region: deployConfig.region,
|
|
357601
|
+
// only show inactive revisions
|
|
357602
|
+
service: serviceName,
|
|
357603
|
+
limit: "unlimited",
|
|
357604
|
+
"sort-by": "metadata.creationTimestamp"
|
|
357605
|
+
}, args);
|
|
357606
|
+
// this prints out all inactive images of the given app
|
|
357607
|
+
return "gcloud run revisions list ".concat((0, createArgsString_1.createArgsString)(filterRevisionArgs));
|
|
357608
|
+
};
|
|
357609
|
+
var getDeleteUnusedRevisionsCommands = function (context, keep) {
|
|
357610
|
+
var deployConfig = context.componentConfig.deploy;
|
|
357611
|
+
if (deployConfig === false) {
|
|
357612
|
+
return [];
|
|
357613
|
+
}
|
|
357614
|
+
if (!(0, types_1.isOfDeployType)(deployConfig, "google-cloudrun")) {
|
|
357615
|
+
// should not happen
|
|
357616
|
+
throw new Error("deploy config is wrong");
|
|
357617
|
+
}
|
|
357618
|
+
// this prints out all inactive images of the given app
|
|
357619
|
+
var listAllInactiveRevisionsCmd = getListRevisionsCommand(context, {
|
|
357620
|
+
format: "\"value(name)\"",
|
|
357621
|
+
filter: "'(status.conditions.status=False OR status.conditions.status=Unknown)'"
|
|
357622
|
+
});
|
|
357623
|
+
// this removes the newest `revisionsToKeep` images
|
|
357624
|
+
var listRevisionsToDeleteCmd = (0, removeFirstLinesFromCommandOutput_1.removeFirstLinesFromCommandOutput)(listAllInactiveRevisionsCmd, keep);
|
|
357625
|
+
var deleteRevisionCmd = "gcloud run revisions delete ".concat((0, createArgsString_1.createArgsString)({
|
|
357626
|
+
project: deployConfig.projectId,
|
|
357627
|
+
region: deployConfig.region,
|
|
357628
|
+
quiet: true
|
|
357629
|
+
}), " $revisionname ");
|
|
357630
|
+
var deleteRevisionsCmd = "".concat(listRevisionsToDeleteCmd, " | while read -r revisionname; do ").concat(deleteRevisionCmd, "; done");
|
|
357631
|
+
return [deleteRevisionsCmd];
|
|
357632
|
+
};
|
|
357633
|
+
exports.getDeleteUnusedRevisionsCommands = getDeleteUnusedRevisionsCommands;
|
|
357634
|
+
|
|
357635
|
+
/***/ }),
|
|
357636
|
+
|
|
357637
|
+
/***/ 66321:
|
|
357638
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
357639
|
+
|
|
357640
|
+
"use strict";
|
|
357641
|
+
|
|
357642
|
+
|
|
357643
|
+
var __assign = this && this.__assign || function () {
|
|
357644
|
+
__assign = Object.assign || function (t) {
|
|
357645
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
357646
|
+
s = arguments[i];
|
|
357647
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
357648
|
+
}
|
|
357649
|
+
return t;
|
|
357650
|
+
};
|
|
357651
|
+
return __assign.apply(this, arguments);
|
|
357652
|
+
};
|
|
357653
|
+
var __read = this && this.__read || function (o, n) {
|
|
357654
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
357655
|
+
if (!m) return o;
|
|
357656
|
+
var i = m.call(o),
|
|
357657
|
+
r,
|
|
357658
|
+
ar = [],
|
|
357659
|
+
e;
|
|
357660
|
+
try {
|
|
357661
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
357662
|
+
} catch (error) {
|
|
357663
|
+
e = {
|
|
357664
|
+
error: error
|
|
357665
|
+
};
|
|
357666
|
+
} finally {
|
|
357667
|
+
try {
|
|
357668
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
357669
|
+
} finally {
|
|
357670
|
+
if (e) throw e.error;
|
|
357671
|
+
}
|
|
357672
|
+
}
|
|
357673
|
+
return ar;
|
|
357674
|
+
};
|
|
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
|
+
};
|
|
357922
|
+
exports.__esModule = true;
|
|
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";
|
|
357928
|
+
};
|
|
357929
|
+
exports.gcloudCmd = gcloudCmd;
|
|
357930
|
+
var gcloudRunCmd = function (version) {
|
|
357931
|
+
return "".concat((0, exports.gcloudCmd)(version), " run");
|
|
357932
|
+
};
|
|
357933
|
+
exports.gcloudRunCmd = gcloudRunCmd;
|
|
357934
|
+
var gcloudSchedulerCmd = function (version) {
|
|
357935
|
+
return "".concat((0, exports.gcloudCmd)(version), " scheduler");
|
|
357936
|
+
};
|
|
357937
|
+
exports.gcloudSchedulerCmd = gcloudSchedulerCmd;
|
|
357938
|
+
var setGoogleProjectNumberScript = function (deployConfig) {
|
|
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\""];
|
|
357940
|
+
};
|
|
357941
|
+
exports.setGoogleProjectNumberScript = setGoogleProjectNumberScript;
|
|
357942
|
+
var makeLabelString = function (obj) {
|
|
357943
|
+
return Object.entries(obj).map(function (_a) {
|
|
357944
|
+
var _b = __read(_a, 2),
|
|
357945
|
+
key = _b[0],
|
|
357946
|
+
value = _b[1];
|
|
357947
|
+
return "".concat(key, "=").concat(value);
|
|
357948
|
+
}).join(",");
|
|
357949
|
+
};
|
|
357950
|
+
exports.makeLabelString = makeLabelString;
|
|
357951
|
+
var getCloudRunDeployConfig = function (context) {
|
|
357952
|
+
var deployConfig = context.componentConfig.deploy;
|
|
357953
|
+
if (!(0, types_1.isOfDeployType)(deployConfig, "google-cloudrun")) {
|
|
357954
|
+
// should not happen
|
|
357955
|
+
throw new Error("deploy config is wrong");
|
|
357956
|
+
}
|
|
357957
|
+
return deployConfig;
|
|
357958
|
+
};
|
|
357959
|
+
exports.getCloudRunDeployConfig = getCloudRunDeployConfig;
|
|
357960
|
+
function getCommonCloudRunArgs(context) {
|
|
357961
|
+
var deployConfig = (0, exports.getCloudRunDeployConfig)(context);
|
|
357962
|
+
return {
|
|
357963
|
+
project: deployConfig.projectId,
|
|
357964
|
+
region: deployConfig.region
|
|
357965
|
+
};
|
|
357966
|
+
}
|
|
357967
|
+
exports.getCommonCloudRunArgs = getCommonCloudRunArgs;
|
|
357968
|
+
function getCommonDeployArgs(context) {
|
|
357969
|
+
var commonArgs = getCommonCloudRunArgs(context);
|
|
357970
|
+
var deployConfig = (0, exports.getCloudRunDeployConfig)(context);
|
|
357971
|
+
return __assign(__assign({
|
|
357972
|
+
image: (0, artifactsRegistry_1.getArtifactsRegistryImage)(context)
|
|
357973
|
+
}, commonArgs), {
|
|
357974
|
+
"set-cloudsql-instances": deployConfig.cloudSql ? deployConfig.cloudSql.instanceConnectionName : undefined
|
|
357975
|
+
});
|
|
357976
|
+
}
|
|
357977
|
+
exports.getCommonDeployArgs = getCommonDeployArgs;
|
|
357978
|
+
|
|
357979
|
+
/***/ }),
|
|
357980
|
+
|
|
357981
|
+
/***/ 21944:
|
|
357982
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
357983
|
+
|
|
357984
|
+
"use strict";
|
|
357985
|
+
|
|
357986
|
+
|
|
357987
|
+
var __read = this && this.__read || function (o, n) {
|
|
357988
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
357989
|
+
if (!m) return o;
|
|
357990
|
+
var i = m.call(o),
|
|
357991
|
+
r,
|
|
357992
|
+
ar = [],
|
|
357993
|
+
e;
|
|
357994
|
+
try {
|
|
357995
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
357996
|
+
} catch (error) {
|
|
357997
|
+
e = {
|
|
357998
|
+
error: error
|
|
357999
|
+
};
|
|
358000
|
+
} finally {
|
|
358001
|
+
try {
|
|
358002
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
358003
|
+
} finally {
|
|
358004
|
+
if (e) throw e.error;
|
|
358005
|
+
}
|
|
358006
|
+
}
|
|
358007
|
+
return ar;
|
|
358008
|
+
};
|
|
358009
|
+
var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
358010
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
358011
|
+
if (ar || !(i in from)) {
|
|
358012
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
358013
|
+
ar[i] = from[i];
|
|
358014
|
+
}
|
|
358015
|
+
}
|
|
358016
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
358017
|
+
};
|
|
358018
|
+
exports.__esModule = true;
|
|
358019
|
+
exports.getCloudRunDeployScripts = void 0;
|
|
358020
|
+
var gitlab_1 = __nccwpck_require__(84997);
|
|
358021
|
+
var sbom_1 = __nccwpck_require__(65928);
|
|
358022
|
+
var cleanup_1 = __nccwpck_require__(10964);
|
|
358023
|
+
var database_1 = __nccwpck_require__(41384);
|
|
358024
|
+
var gcloudServiceAccountLoginCommands_1 = __nccwpck_require__(22607);
|
|
358025
|
+
var cloudRunJobs_1 = __nccwpck_require__(66321);
|
|
358026
|
+
var cloudRunServices_1 = __nccwpck_require__(77210);
|
|
358027
|
+
var common_1 = __nccwpck_require__(75655);
|
|
358028
|
+
function getCloudRunDeployScripts(context) {
|
|
358029
|
+
var _a;
|
|
358030
|
+
var deployConfig = (0, common_1.getCloudRunDeployConfig)(context);
|
|
358031
|
+
return __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, gitlab_1.collapseableSection)("prepare", "Prepare...")(__spreadArray(__spreadArray([], __read((0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context)), false), __read((0, common_1.setGoogleProjectNumberScript)(deployConfig)), false))), false), __read((0, gitlab_1.collapseableSection)("deploy", "Deploy to cloud run")(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(["echo \"$ENV_VARS\" > ____envvars.yaml"], __read(deployConfig.cloudSql ? (0, database_1.getDatabaseCreateScript)(context, deployConfig) // we create the db, so that we can also delete it afterwards
|
|
358032
|
+
: []), false), __read((0, cloudRunJobs_1.getCreateScheduleScripts)(context)), false), __read((0, cloudRunJobs_1.getJobCreateScripts)(context)), false), __read((0, cloudRunJobs_1.getJobRunScripts)(context, "preDeploy")), false), __read(deployConfig.service !== false ? [(0, cloudRunServices_1.getServiceDeployScript)(context, deployConfig.service)] : []), false), __read(Object.entries((_a = deployConfig.additionalServices) !== null && _a !== void 0 ? _a : {}).map(function (_a) {
|
|
358033
|
+
var _b = __read(_a, 2),
|
|
358034
|
+
name = _b[0],
|
|
358035
|
+
service = _b[1];
|
|
358036
|
+
return (0, cloudRunServices_1.getServiceDeployScript)(context, service, "-" + name);
|
|
358037
|
+
})), false), __read((0, cloudRunJobs_1.getJobRunScripts)(context, "postDeploy")), false))), false), __read((0, gitlab_1.collapseableSection)("cleanup", "Cleanup")((0, cleanup_1.getRemoveOldRevisionsAndImagesCommand)(context, "postDeploy") // we cleanup inactive images both on deploy and stop
|
|
358038
|
+
)), false), __read((0, sbom_1.getDependencyTrackUploadScript)(context)), false);
|
|
358039
|
+
}
|
|
358040
|
+
exports.getCloudRunDeployScripts = getCloudRunDeployScripts;
|
|
358041
|
+
|
|
358042
|
+
/***/ }),
|
|
358043
|
+
|
|
358044
|
+
/***/ 40910:
|
|
358045
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
358046
|
+
|
|
358047
|
+
"use strict";
|
|
358048
|
+
|
|
358049
|
+
|
|
358050
|
+
var __read = this && this.__read || function (o, n) {
|
|
358051
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
358052
|
+
if (!m) return o;
|
|
358053
|
+
var i = m.call(o),
|
|
358054
|
+
r,
|
|
358055
|
+
ar = [],
|
|
358056
|
+
e;
|
|
358057
|
+
try {
|
|
358058
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
358059
|
+
} catch (error) {
|
|
358060
|
+
e = {
|
|
358061
|
+
error: error
|
|
358062
|
+
};
|
|
358063
|
+
} finally {
|
|
358064
|
+
try {
|
|
358065
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
358066
|
+
} finally {
|
|
358067
|
+
if (e) throw e.error;
|
|
358068
|
+
}
|
|
358069
|
+
}
|
|
358070
|
+
return ar;
|
|
358071
|
+
};
|
|
358072
|
+
var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
358073
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
358074
|
+
if (ar || !(i in from)) {
|
|
358075
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
358076
|
+
ar[i] = from[i];
|
|
358077
|
+
}
|
|
358078
|
+
}
|
|
358079
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
358080
|
+
};
|
|
358081
|
+
exports.__esModule = true;
|
|
358082
|
+
exports.getCloudRunStopScripts = void 0;
|
|
358083
|
+
var sbom_1 = __nccwpck_require__(65928);
|
|
358084
|
+
var cleanup_1 = __nccwpck_require__(10964);
|
|
358085
|
+
var database_1 = __nccwpck_require__(41384);
|
|
358086
|
+
var gcloudServiceAccountLoginCommands_1 = __nccwpck_require__(22607);
|
|
358087
|
+
var cloudRunJobs_1 = __nccwpck_require__(66321);
|
|
358088
|
+
var cloudRunServices_1 = __nccwpck_require__(77210);
|
|
358089
|
+
var common_1 = __nccwpck_require__(75655);
|
|
358090
|
+
function getCloudRunStopScripts(context) {
|
|
358091
|
+
var _a;
|
|
358092
|
+
var deployConfig = (0, common_1.getCloudRunDeployConfig)(context);
|
|
358093
|
+
return __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context)), false), __read((0, cloudRunJobs_1.getJobRunScripts)(context, "preStop")), false), __read(deployConfig.service !== false ? (0, cloudRunServices_1.getServiceDeleteScript)(context) : []), false), __read(Object.entries((_a = deployConfig.additionalServices) !== null && _a !== void 0 ? _a : {}).flatMap(function (_a) {
|
|
358094
|
+
var _b = __read(_a, 1),
|
|
358095
|
+
name = _b[0];
|
|
358096
|
+
return (0, cloudRunServices_1.getServiceDeleteScript)(context, name);
|
|
358097
|
+
})), false), __read((0, cloudRunJobs_1.getJobRunScripts)(context, "postStop")), false), __read((0, cloudRunJobs_1.getDeleteSchedulesScripts)(context)), false), __read((0, cloudRunJobs_1.getDeleteJobsScripts)(context)), false), __read(deployConfig.cloudSql && deployConfig.cloudSql.deleteDatabaseOnStop ? (0, database_1.getDatabaseDeleteScript)(context, deployConfig) : []), false), __read((0, cleanup_1.getRemoveOldRevisionsAndImagesCommand)(context, "onStop")), false), __read((0, sbom_1.getDependencyTrackDeleteScript)(context)), false);
|
|
358098
|
+
}
|
|
358099
|
+
exports.getCloudRunStopScripts = getCloudRunStopScripts;
|
|
357181
358100
|
|
|
357182
358101
|
/***/ }),
|
|
357183
358102
|
|
|
357184
|
-
/***/
|
|
357185
|
-
/***/ (
|
|
358103
|
+
/***/ 26474:
|
|
358104
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
357186
358105
|
|
|
357187
358106
|
"use strict";
|
|
357188
358107
|
|
|
357189
358108
|
|
|
357190
|
-
var __assign = this && this.__assign || function () {
|
|
357191
|
-
__assign = Object.assign || function (t) {
|
|
357192
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
357193
|
-
s = arguments[i];
|
|
357194
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
357195
|
-
}
|
|
357196
|
-
return t;
|
|
357197
|
-
};
|
|
357198
|
-
return __assign.apply(this, arguments);
|
|
357199
|
-
};
|
|
357200
|
-
exports.__esModule = true;
|
|
357201
|
-
exports.getDeleteUnusedRevisionsCommands = void 0;
|
|
357202
|
-
var types_1 = __nccwpck_require__(63109);
|
|
357203
|
-
var createArgsString_1 = __nccwpck_require__(8686);
|
|
357204
|
-
var getServiceName_1 = __nccwpck_require__(89391);
|
|
357205
|
-
var removeFirstLinesFromCommandOutput_1 = __nccwpck_require__(77547);
|
|
357206
|
-
var getListRevisionsCommand = function (context, args) {
|
|
357207
|
-
var serviceName = (0, getServiceName_1.getServiceName)(context);
|
|
357208
|
-
var deployConfig = context.componentConfig.deploy;
|
|
357209
|
-
if (!deployConfig || !(0, types_1.isOfDeployType)(deployConfig, "google-cloudrun")) {
|
|
357210
|
-
// should not happen
|
|
357211
|
-
throw new Error("deploy config is wrong");
|
|
357212
|
-
}
|
|
357213
|
-
var filterRevisionArgs = __assign({
|
|
357214
|
-
project: deployConfig.projectId,
|
|
357215
|
-
region: deployConfig.region,
|
|
357216
|
-
// only show inactive revisions
|
|
357217
|
-
service: serviceName,
|
|
357218
|
-
limit: "unlimited",
|
|
357219
|
-
"sort-by": "metadata.creationTimestamp"
|
|
357220
|
-
}, args);
|
|
357221
|
-
// this prints out all inactive images of the given app
|
|
357222
|
-
return "gcloud run revisions list ".concat((0, createArgsString_1.createArgsString)(filterRevisionArgs));
|
|
357223
|
-
};
|
|
357224
|
-
var getDeleteUnusedRevisionsCommands = function (context, keep) {
|
|
357225
|
-
var deployConfig = context.componentConfig.deploy;
|
|
357226
|
-
if (deployConfig === false) {
|
|
357227
|
-
return [];
|
|
357228
|
-
}
|
|
357229
|
-
if (!(0, types_1.isOfDeployType)(deployConfig, "google-cloudrun")) {
|
|
357230
|
-
// should not happen
|
|
357231
|
-
throw new Error("deploy config is wrong");
|
|
357232
|
-
}
|
|
357233
|
-
// this prints out all inactive images of the given app
|
|
357234
|
-
var listAllInactiveRevisionsCmd = getListRevisionsCommand(context, {
|
|
357235
|
-
format: "\"value(name)\"",
|
|
357236
|
-
filter: "'(status.conditions.status=False OR status.conditions.status=Unknown)'"
|
|
357237
|
-
});
|
|
357238
|
-
// this removes the newest `revisionsToKeep` images
|
|
357239
|
-
var listRevisionsToDeleteCmd = (0, removeFirstLinesFromCommandOutput_1.removeFirstLinesFromCommandOutput)(listAllInactiveRevisionsCmd, keep);
|
|
357240
|
-
var deleteRevisionCmd = "gcloud run revisions delete ".concat((0, createArgsString_1.createArgsString)({
|
|
357241
|
-
project: deployConfig.projectId,
|
|
357242
|
-
region: deployConfig.region,
|
|
357243
|
-
quiet: true
|
|
357244
|
-
}), " $revisionname ");
|
|
357245
|
-
var deleteRevisionsCmd = "".concat(listRevisionsToDeleteCmd, " | while read -r revisionname; do ").concat(deleteRevisionCmd, "; done");
|
|
357246
|
-
return [deleteRevisionsCmd];
|
|
357247
|
-
};
|
|
357248
|
-
exports.getDeleteUnusedRevisionsCommands = getDeleteUnusedRevisionsCommands;
|
|
357249
|
-
|
|
357250
|
-
/***/ }),
|
|
357251
|
-
|
|
357252
|
-
/***/ 82256:
|
|
357253
|
-
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
357254
|
-
|
|
357255
|
-
"use strict";
|
|
357256
|
-
|
|
357257
|
-
|
|
357258
|
-
var __assign = this && this.__assign || function () {
|
|
357259
|
-
__assign = Object.assign || function (t) {
|
|
357260
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
357261
|
-
s = arguments[i];
|
|
357262
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
357263
|
-
}
|
|
357264
|
-
return t;
|
|
357265
|
-
};
|
|
357266
|
-
return __assign.apply(this, arguments);
|
|
357267
|
-
};
|
|
357268
|
-
var __read = this && this.__read || function (o, n) {
|
|
357269
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
357270
|
-
if (!m) return o;
|
|
357271
|
-
var i = m.call(o),
|
|
357272
|
-
r,
|
|
357273
|
-
ar = [],
|
|
357274
|
-
e;
|
|
357275
|
-
try {
|
|
357276
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
357277
|
-
} catch (error) {
|
|
357278
|
-
e = {
|
|
357279
|
-
error: error
|
|
357280
|
-
};
|
|
357281
|
-
} finally {
|
|
357282
|
-
try {
|
|
357283
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
357284
|
-
} finally {
|
|
357285
|
-
if (e) throw e.error;
|
|
357286
|
-
}
|
|
357287
|
-
}
|
|
357288
|
-
return ar;
|
|
357289
|
-
};
|
|
357290
|
-
var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
357291
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
357292
|
-
if (ar || !(i in from)) {
|
|
357293
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
357294
|
-
ar[i] = from[i];
|
|
357295
|
-
}
|
|
357296
|
-
}
|
|
357297
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
357298
|
-
};
|
|
357299
358109
|
exports.__esModule = true;
|
|
357300
358110
|
exports.createGoogleCloudRunDeployJobs = void 0;
|
|
357301
|
-
var js_yaml_1 = __nccwpck_require__(3618);
|
|
357302
358111
|
var lodash_1 = __nccwpck_require__(23255);
|
|
357303
|
-
var _1 = __nccwpck_require__(81344);
|
|
357304
358112
|
var docker_1 = __nccwpck_require__(33219);
|
|
357305
|
-
var getLabels_1 = __nccwpck_require__(30486);
|
|
357306
358113
|
var runner_1 = __nccwpck_require__(55071);
|
|
357307
358114
|
var gitlab_1 = __nccwpck_require__(84997);
|
|
357308
358115
|
var base_1 = __nccwpck_require__(82866);
|
|
357309
|
-
var sbom_1 = __nccwpck_require__(65928);
|
|
357310
358116
|
var types_1 = __nccwpck_require__(63109);
|
|
357311
|
-
var
|
|
357312
|
-
var
|
|
357313
|
-
var
|
|
357314
|
-
var jobName_1 = __nccwpck_require__(77311);
|
|
357315
|
-
var artifactsRegistry_1 = __nccwpck_require__(28159);
|
|
357316
|
-
var getServiceName_1 = __nccwpck_require__(89391);
|
|
357317
|
-
var cleanup_1 = __nccwpck_require__(10964);
|
|
357318
|
-
var setGoogleProjectNumberScript = function (deployConfig) {
|
|
357319
|
-
return ["export GCLOUD_PROJECT_NUMBER=$(gcloud projects describe ".concat(deployConfig.projectId, " --format=\"value(projectNumber)\")"), "echo \"GCLOUD_PROJECT_NUMBER: $GCLOUD_PROJECT_NUMBER\""];
|
|
357320
|
-
};
|
|
357321
|
-
var makeLabelString = function (obj) {
|
|
357322
|
-
return Object.entries(obj).map(function (_a) {
|
|
357323
|
-
var _b = __read(_a, 2),
|
|
357324
|
-
key = _b[0],
|
|
357325
|
-
value = _b[1];
|
|
357326
|
-
return "".concat(key, "=").concat(value);
|
|
357327
|
-
}).join(",");
|
|
357328
|
-
};
|
|
358117
|
+
var variables_1 = __nccwpck_require__(20408);
|
|
358118
|
+
var getCloudRunDeployScripts_1 = __nccwpck_require__(21944);
|
|
358119
|
+
var getCloudRunStopScripts_1 = __nccwpck_require__(40910);
|
|
357329
358120
|
var createGoogleCloudRunDeployJobs = function (context) {
|
|
357330
|
-
var _a, _b, _c;
|
|
357331
358121
|
var deployConfig = context.componentConfig.deploy;
|
|
357332
358122
|
if (deployConfig === false) {
|
|
357333
358123
|
return [];
|
|
@@ -357336,171 +358126,14 @@ var createGoogleCloudRunDeployJobs = function (context) {
|
|
|
357336
358126
|
// should not happen
|
|
357337
358127
|
throw new Error("deploy config is wrong");
|
|
357338
358128
|
}
|
|
357339
|
-
var
|
|
357340
|
-
var
|
|
357341
|
-
project: deployConfig.projectId,
|
|
357342
|
-
region: deployConfig.region
|
|
357343
|
-
};
|
|
357344
|
-
var commonDeployArgs = __assign(__assign({
|
|
357345
|
-
image: (0, artifactsRegistry_1.getArtifactsRegistryImage)(context)
|
|
357346
|
-
}, commonArgs), {
|
|
357347
|
-
"set-cloudsql-instances": deployConfig.cloudSql ? deployConfig.cloudSql.instanceConnectionName : undefined
|
|
357348
|
-
});
|
|
357349
|
-
var serviceName = (0, getServiceName_1.getServiceName)(context);
|
|
357350
|
-
var getFullJobName = function (name) {
|
|
357351
|
-
return (0, jobName_1.getCloudRunJobName)(context.environment.fullName, name);
|
|
357352
|
-
};
|
|
357353
|
-
var jobsWithNames = Object.entries((_a = deployConfig.jobs) !== null && _a !== void 0 ? _a : {})
|
|
357354
|
-
// filter out disabled jobs
|
|
357355
|
-
.filter(function (entry) {
|
|
357356
|
-
return Boolean(entry[1]);
|
|
357357
|
-
}).map(function (_a) {
|
|
357358
|
-
var _b = __read(_a, 2),
|
|
357359
|
-
name = _b[0],
|
|
357360
|
-
job = _b[1];
|
|
357361
|
-
return {
|
|
357362
|
-
jobName: getFullJobName(name),
|
|
357363
|
-
job: job
|
|
357364
|
-
};
|
|
357365
|
-
});
|
|
357366
|
-
var jobsWithSchedule = jobsWithNames.filter(function (entry) {
|
|
357367
|
-
return entry.job.when === "schedule";
|
|
357368
|
-
}).map(function (_a) {
|
|
357369
|
-
var job = _a.job,
|
|
357370
|
-
jobName = _a.jobName;
|
|
357371
|
-
return {
|
|
357372
|
-
job: job,
|
|
357373
|
-
jobName: jobName,
|
|
357374
|
-
schedulerName: jobName + "-scheduler"
|
|
357375
|
-
};
|
|
357376
|
-
});
|
|
357377
|
-
var getServiceDeployScript = function (service, nameSuffix) {
|
|
357378
|
-
var _a, _b, _c, _d, _e;
|
|
357379
|
-
var customConfig = service !== true ? service : undefined;
|
|
357380
|
-
var command = service !== true ? (_a = service === null || service === void 0 ? void 0 : service.command) !== null && _a !== void 0 ? _a : context.componentConfig.build.startCommand : undefined;
|
|
357381
|
-
var commandArray = command ? Array.isArray(command) ? command : command.split(" ") : undefined;
|
|
357382
|
-
var fullServiceName = "".concat(serviceName).concat(nameSuffix !== null && nameSuffix !== void 0 ? nameSuffix : "");
|
|
357383
|
-
var argsString = (0, createArgsString_1.createArgsString)(__assign(__assign({
|
|
357384
|
-
// command as empty string resets it to default (uses the image's entrypoint)
|
|
357385
|
-
command: commandArray ? '"' + commandArray.join(",") + '"' : '""'
|
|
357386
|
-
}, commonDeployArgs), {
|
|
357387
|
-
labels: makeLabelString(__assign(__assign({}, (0, getLabels_1.getLabels)(context)), {
|
|
357388
|
-
"cloud-run-service-name": fullServiceName
|
|
357389
|
-
})),
|
|
357390
|
-
"env-vars-file": "____envvars.yaml",
|
|
357391
|
-
"min-instances": (_b = customConfig === null || customConfig === void 0 ? void 0 : customConfig.minInstances) !== null && _b !== void 0 ? _b : 0,
|
|
357392
|
-
"max-instances": (_c = customConfig === null || customConfig === void 0 ? void 0 : customConfig.maxInstances) !== null && _c !== void 0 ? _c : 100,
|
|
357393
|
-
"cpu-throttling": (customConfig === null || customConfig === void 0 ? void 0 : customConfig.noCpuThrottling) !== true,
|
|
357394
|
-
memory: customConfig === null || customConfig === void 0 ? void 0 : customConfig.memory,
|
|
357395
|
-
"allow-unauthenticated": (_d = customConfig === null || customConfig === void 0 ? void 0 : customConfig.allowUnauthenticated) !== null && _d !== void 0 ? _d : true,
|
|
357396
|
-
ingress: (_e = customConfig === null || customConfig === void 0 ? void 0 : customConfig.ingress) !== null && _e !== void 0 ? _e : "all",
|
|
357397
|
-
"cpu-boost": true
|
|
357398
|
-
}));
|
|
357399
|
-
return "gcloud run deploy ".concat(fullServiceName, " ").concat(argsString);
|
|
357400
|
-
};
|
|
357401
|
-
var getJobCreateScriptsForJob = function (jobName, job) {
|
|
357402
|
-
// due to some oversight from google, jobs create does not accept `--env-vars-file` 🤦
|
|
357403
|
-
// lucky, update on the other hand accepts it... so let's just imediatly update it
|
|
357404
|
-
// also we cannot upsert a job, so we have to create it and catch the error and then update
|
|
357405
|
-
var commandArray = Array.isArray(job.command) ? job.command : job.command.split(" ");
|
|
357406
|
-
var commonDeployArgsString = (0, createArgsString_1.createArgsString)(__assign(__assign({
|
|
357407
|
-
command: '"' + commandArray.join(",") + '"'
|
|
357408
|
-
}, commonDeployArgs), {
|
|
357409
|
-
labels: makeLabelString(__assign(__assign({}, (0, getLabels_1.getLabels)(context)), {
|
|
357410
|
-
"cloud-run-job-name": jobName
|
|
357411
|
-
})),
|
|
357412
|
-
image: job.image || commonDeployArgs.image,
|
|
357413
|
-
memory: job.memory || "512Mi",
|
|
357414
|
-
"task-timeout": job.timeout || "10m"
|
|
357415
|
-
}));
|
|
357416
|
-
var argsString = "".concat(jobName, " ").concat(commonDeployArgsString);
|
|
357417
|
-
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);
|
|
357418
|
-
};
|
|
357419
|
-
var commonArgsString = (0, createArgsString_1.createArgsString)(commonArgs);
|
|
357420
|
-
var getJobCreateScripts = function () {
|
|
357421
|
-
return jobsWithNames.map(function (_a) {
|
|
357422
|
-
var job = _a.job,
|
|
357423
|
-
jobName = _a.jobName;
|
|
357424
|
-
return getJobCreateScriptsForJob(jobName, job);
|
|
357425
|
-
}).flat();
|
|
357426
|
-
};
|
|
357427
|
-
var getJobRunScriptForJob = function (jobName, wait) {
|
|
357428
|
-
return "gcloud beta run jobs execute ".concat(jobName, " ").concat(commonArgsString).concat(wait ? " --wait" : "");
|
|
357429
|
-
};
|
|
357430
|
-
var getJobRunScripts = function (when) {
|
|
357431
|
-
return jobsWithNames.filter(function (_a) {
|
|
357432
|
-
var job = _a.job;
|
|
357433
|
-
return job.when === when;
|
|
357434
|
-
}).map(function (_a) {
|
|
357435
|
-
var jobName = _a.jobName;
|
|
357436
|
-
return getJobRunScriptForJob(jobName,
|
|
357437
|
-
// wait for completin on stop jobs, since stop will delete the jobs afterwards, so they will fail
|
|
357438
|
-
["preStop", "postStop"].includes(when));
|
|
357439
|
-
});
|
|
357440
|
-
};
|
|
357441
|
-
var getCreateScheduleScripts = function () {
|
|
357442
|
-
return jobsWithSchedule.map(function (_a) {
|
|
357443
|
-
var _b;
|
|
357444
|
-
var job = _a.job,
|
|
357445
|
-
jobName = _a.jobName,
|
|
357446
|
-
schedulerName = _a.schedulerName;
|
|
357447
|
-
var argsString = (0, createArgsString_1.createArgsString)({
|
|
357448
|
-
project: deployConfig.projectId,
|
|
357449
|
-
location: deployConfig.region,
|
|
357450
|
-
schedule: "\"".concat(job.schedule, "\""),
|
|
357451
|
-
"max-retry-attempts": (_b = job.maxRetryAttempts) !== null && _b !== void 0 ? _b : 0,
|
|
357452
|
-
uri: "\"https://".concat(deployConfig.region, "-run.googleapis.com/apis/run.googleapis.com/v1/namespaces/").concat(deployConfig.projectId, "/jobs/").concat(jobName, ":run\""),
|
|
357453
|
-
"http-method": "POST",
|
|
357454
|
-
"oauth-service-account-email": "$GCLOUD_PROJECT_NUMBER-compute@developer.gserviceaccount.com"
|
|
357455
|
-
});
|
|
357456
|
-
var commonArgs = "http ".concat(schedulerName, " ").concat(argsString);
|
|
357457
|
-
return __spreadArray(__spreadArray([], __read((0, gitlab_1.allowFailureInScripts)(["gcloud scheduler jobs create ".concat(commonArgs)])), false), ["gcloud scheduler jobs update ".concat(commonArgs)], false);
|
|
357458
|
-
}).flat();
|
|
357459
|
-
};
|
|
357460
|
-
var getDeleteSchedulesScripts = function () {
|
|
357461
|
-
var argsString = (0, createArgsString_1.createArgsString)({
|
|
357462
|
-
project: deployConfig.projectId,
|
|
357463
|
-
location: deployConfig.region
|
|
357464
|
-
});
|
|
357465
|
-
return jobsWithSchedule.map(function (_a) {
|
|
357466
|
-
var schedulerName = _a.schedulerName;
|
|
357467
|
-
return ["gcloud scheduler jobs delete ".concat(schedulerName, " ").concat(argsString)];
|
|
357468
|
-
}).flat();
|
|
357469
|
-
};
|
|
357470
|
-
var getDeleteJobsScripts = function () {
|
|
357471
|
-
return jobsWithNames.flatMap(function (_a) {
|
|
357472
|
-
var jobName = _a.jobName;
|
|
357473
|
-
return [
|
|
357474
|
-
// first delete all job executions. Otherwise delete might fail if one of those is still running
|
|
357475
|
-
"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)];
|
|
357476
|
-
});
|
|
357477
|
-
};
|
|
357478
|
-
var deployScripts = __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, gitlab_1.collapseableSection)("prepare", "Prepare...")(__spreadArray(__spreadArray([], __read((0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context)), false), __read(setGoogleProjectNumberScript(deployConfig)), false))), false), __read((0, gitlab_1.collapseableSection)("deploy", "Deploy to cloud run")(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(["echo \"$ENV_VARS\" > ____envvars.yaml"], __read(deployConfig.cloudSql ? (0, database_1.getDatabaseCreateScript)(context, deployConfig) // we create the db, so that we can also delete it afterwards
|
|
357479
|
-
: []), false), __read(getCreateScheduleScripts()), false), __read(getJobCreateScripts()), false), __read(getJobRunScripts("preDeploy")), false), __read(deployConfig.service !== false ? [getServiceDeployScript(deployConfig.service)] : []), false), __read(Object.entries((_b = deployConfig.additionalServices) !== null && _b !== void 0 ? _b : {}).map(function (_a) {
|
|
357480
|
-
var _b = __read(_a, 2),
|
|
357481
|
-
name = _b[0],
|
|
357482
|
-
service = _b[1];
|
|
357483
|
-
return getServiceDeployScript(service, "-" + name);
|
|
357484
|
-
})), false), __read(getJobRunScripts("postDeploy")), false))), false), __read((0, gitlab_1.collapseableSection)("cleanup", "Cleanup")((0, cleanup_1.getRemoveOldRevisionsAndImagesCommand)(context, "postDeploy") // we cleanup inactive images both on deploy and stop
|
|
357485
|
-
)), false), __read((0, sbom_1.getDependencyTrackUploadScript)(context)), false);
|
|
357486
|
-
var stopScripts = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context)), false), __read(getJobRunScripts("preStop")), false), __read(deployConfig.service !== false ? ["gcloud run services delete ".concat(serviceName, " ").concat(commonArgsString)] : []), false), __read(Object.entries((_c = deployConfig.additionalServices) !== null && _c !== void 0 ? _c : {}).map(function (_a) {
|
|
357487
|
-
var _b = __read(_a, 1),
|
|
357488
|
-
name = _b[0];
|
|
357489
|
-
return "gcloud run services delete ".concat(serviceName, "-").concat(name, " ").concat(commonArgsString);
|
|
357490
|
-
})), false), __read(getJobRunScripts("postStop")), false), __read(getDeleteSchedulesScripts()), false), __read(getDeleteJobsScripts()), false), __read(deployConfig.cloudSql && deployConfig.cloudSql.deleteDatabaseOnStop ? (0, database_1.getDatabaseDeleteScript)(context, deployConfig) : []), false), __read((0, cleanup_1.getRemoveOldRevisionsAndImagesCommand)(context, "onStop")), false), __read((0, sbom_1.getDependencyTrackDeleteScript)(context)), false);
|
|
358129
|
+
var deployScripts = (0, getCloudRunDeployScripts_1.getCloudRunDeployScripts)(context);
|
|
358130
|
+
var stopScripts = (0, getCloudRunStopScripts_1.getCloudRunStopScripts)(context);
|
|
357491
358131
|
return (0, base_1.createDeployementJobs)(context, {
|
|
357492
358132
|
deploy: (0, lodash_1.merge)((0, docker_1.getDockerJobBaseProps)(context), {
|
|
357493
358133
|
artifacts: {
|
|
357494
358134
|
paths: ["____envvars.yaml"]
|
|
357495
358135
|
},
|
|
357496
|
-
variables:
|
|
357497
|
-
CLOUDSDK_CORE_DISABLE_PROMPTS: "1",
|
|
357498
|
-
ENV_VARS: (0, js_yaml_1.dump)(allEnvVars, {
|
|
357499
|
-
lineWidth: -1,
|
|
357500
|
-
quotingType: "'",
|
|
357501
|
-
forceQuotes: true
|
|
357502
|
-
})
|
|
357503
|
-
},
|
|
358136
|
+
variables: (0, variables_1.getDeployJobVariables)(context),
|
|
357504
358137
|
image: (0, runner_1.getRunnerImage)("gcloud"),
|
|
357505
358138
|
script: deployScripts
|
|
357506
358139
|
}),
|
|
@@ -357517,6 +358150,32 @@ exports.createGoogleCloudRunDeployJobs = createGoogleCloudRunDeployJobs;
|
|
|
357517
358150
|
|
|
357518
358151
|
/***/ }),
|
|
357519
358152
|
|
|
358153
|
+
/***/ 20408:
|
|
358154
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
358155
|
+
|
|
358156
|
+
"use strict";
|
|
358157
|
+
|
|
358158
|
+
|
|
358159
|
+
exports.__esModule = true;
|
|
358160
|
+
exports.getDeployJobVariables = void 0;
|
|
358161
|
+
var js_yaml_1 = __nccwpck_require__(3618);
|
|
358162
|
+
var lodash_1 = __nccwpck_require__(23255);
|
|
358163
|
+
var __1 = __nccwpck_require__(25355);
|
|
358164
|
+
function getDeployJobVariables(context) {
|
|
358165
|
+
var allEnvVars = (0, lodash_1.omit)(context.environment.envVars, __1.GCLOUD_DEPLOY_CREDENTIALS_KEY);
|
|
358166
|
+
return {
|
|
358167
|
+
CLOUDSDK_CORE_DISABLE_PROMPTS: "1",
|
|
358168
|
+
ENV_VARS: (0, js_yaml_1.dump)(allEnvVars, {
|
|
358169
|
+
lineWidth: -1,
|
|
358170
|
+
quotingType: "'",
|
|
358171
|
+
forceQuotes: true
|
|
358172
|
+
})
|
|
358173
|
+
};
|
|
358174
|
+
}
|
|
358175
|
+
exports.getDeployJobVariables = getDeployJobVariables;
|
|
358176
|
+
|
|
358177
|
+
/***/ }),
|
|
358178
|
+
|
|
357520
358179
|
/***/ 81344:
|
|
357521
358180
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
357522
358181
|
|
|
@@ -357569,7 +358228,7 @@ exports.GCLOUD_RUN_DEPLOY_TYPE = exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX = expo
|
|
|
357569
358228
|
var context_1 = __nccwpck_require__(22041);
|
|
357570
358229
|
var gitlab_1 = __nccwpck_require__(84997);
|
|
357571
358230
|
var utils_1 = __nccwpck_require__(70463);
|
|
357572
|
-
var
|
|
358231
|
+
var createJobs_1 = __nccwpck_require__(26474);
|
|
357573
358232
|
var jobName_1 = __nccwpck_require__(77311);
|
|
357574
358233
|
exports.GCLOUD_DEPLOY_CREDENTIALS_KEY = "GCLOUD_DEPLOY_credentialsKey";
|
|
357575
358234
|
// FIXME: rename to internalHostSuffix, but this means that project-setup needs to be rerun, so its kindof a breaking change
|
|
@@ -357601,7 +358260,7 @@ var getCloudSqlVariables = function (_a) {
|
|
|
357601
358260
|
return {};
|
|
357602
358261
|
};
|
|
357603
358262
|
exports.GCLOUD_RUN_DEPLOY_TYPE = {
|
|
357604
|
-
jobs:
|
|
358263
|
+
jobs: createJobs_1.createGoogleCloudRunDeployJobs,
|
|
357605
358264
|
defaults: function (_a) {
|
|
357606
358265
|
var deployConfigRaw = _a.deployConfigRaw,
|
|
357607
358266
|
envType = _a.envType;
|
|
@@ -357687,22 +358346,28 @@ var lodash_1 = __nccwpck_require__(23255);
|
|
|
357687
358346
|
* @param args args record
|
|
357688
358347
|
* @returns
|
|
357689
358348
|
*/
|
|
357690
|
-
var createArgsString = function (
|
|
357691
|
-
|
|
357692
|
-
|
|
357693
|
-
|
|
357694
|
-
|
|
357695
|
-
|
|
357696
|
-
|
|
357697
|
-
|
|
357698
|
-
|
|
357699
|
-
|
|
357700
|
-
|
|
357701
|
-
|
|
357702
|
-
|
|
357703
|
-
|
|
357704
|
-
|
|
357705
|
-
|
|
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(" ");
|
|
357706
358371
|
};
|
|
357707
358372
|
exports.createArgsString = createArgsString;
|
|
357708
358373
|
|
|
@@ -360980,6 +361645,14 @@ module.exports = require("fs");
|
|
|
360980
361645
|
|
|
360981
361646
|
/***/ }),
|
|
360982
361647
|
|
|
361648
|
+
/***/ 73292:
|
|
361649
|
+
/***/ ((module) => {
|
|
361650
|
+
|
|
361651
|
+
"use strict";
|
|
361652
|
+
module.exports = require("fs/promises");
|
|
361653
|
+
|
|
361654
|
+
/***/ }),
|
|
361655
|
+
|
|
360983
361656
|
/***/ 13685:
|
|
360984
361657
|
/***/ ((module) => {
|
|
360985
361658
|
|
|
@@ -361140,6 +361813,725 @@ module.exports = require("zlib");
|
|
|
361140
361813
|
|
|
361141
361814
|
/***/ }),
|
|
361142
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
|
+
|
|
361143
362535
|
/***/ 23619:
|
|
361144
362536
|
/***/ ((__unused_webpack_module, exports) => {
|
|
361145
362537
|
|
|
@@ -363321,13 +364713,21 @@ module.exports = underscoreNodeF._;
|
|
|
363321
364713
|
//# sourceMappingURL=underscore-node.cjs.map
|
|
363322
364714
|
|
|
363323
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
|
+
|
|
363324
364724
|
/***/ }),
|
|
363325
364725
|
|
|
363326
364726
|
/***/ 4147:
|
|
363327
364727
|
/***/ ((module) => {
|
|
363328
364728
|
|
|
363329
364729
|
"use strict";
|
|
363330
|
-
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"}}');
|
|
363331
364731
|
|
|
363332
364732
|
/***/ }),
|
|
363333
364733
|
|