@northflank/cli 0.8.3-beta.0 → 0.8.3-beta.1

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.
@@ -1,273 +1 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
18
- 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;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
39
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
40
- if (ar || !(i in from)) {
41
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
42
- ar[i] = from[i];
43
- }
44
- }
45
- return to.concat(ar || Array.prototype.slice.call(from));
46
- };
47
- Object.defineProperty(exports, "__esModule", { value: true });
48
- exports.fetchResourceList = void 0;
49
- var utils_1 = require("./utils");
50
- var defaultPaginationPageSize = 50;
51
- var getProjects = function (apiClient) { return function (opt) { return __awaiter(void 0, void 0, void 0, function () {
52
- var projects;
53
- var _a;
54
- return __generator(this, function (_b) {
55
- switch (_b.label) {
56
- case 0: return [4 /*yield*/, apiClient.list.projects({
57
- options: { per_page: defaultPaginationPageSize, cursor: opt === null || opt === void 0 ? void 0 : opt.nextPageCursor },
58
- })];
59
- case 1:
60
- projects = _b.sent();
61
- return [2 /*return*/, {
62
- elements: projects.data.projects.map(function (project) { return project.id; }),
63
- nextPageCursor: (_a = projects.pagination) === null || _a === void 0 ? void 0 : _a.cursor,
64
- }];
65
- }
66
- });
67
- }); }; };
68
- var getServices = function (apiClient, projectId) { return function (opt) { return __awaiter(void 0, void 0, void 0, function () {
69
- var services;
70
- var _a;
71
- return __generator(this, function (_b) {
72
- switch (_b.label) {
73
- case 0: return [4 /*yield*/, apiClient.list.services({
74
- parameters: { projectId: projectId },
75
- options: { per_page: defaultPaginationPageSize, cursor: opt === null || opt === void 0 ? void 0 : opt.nextPageCursor },
76
- })];
77
- case 1:
78
- services = _b.sent();
79
- return [2 /*return*/, {
80
- elements: services.data.services.map(function (service) { return service.id; }),
81
- nextPageCursor: (_a = services.pagination) === null || _a === void 0 ? void 0 : _a.cursor,
82
- }];
83
- }
84
- });
85
- }); }; };
86
- var getAddons = function (apiClient, projectId) { return function (opt) { return __awaiter(void 0, void 0, void 0, function () {
87
- var addons;
88
- var _a;
89
- return __generator(this, function (_b) {
90
- switch (_b.label) {
91
- case 0: return [4 /*yield*/, apiClient.list.addons({
92
- parameters: { projectId: projectId },
93
- options: { per_page: defaultPaginationPageSize, cursor: opt === null || opt === void 0 ? void 0 : opt.nextPageCursor },
94
- })];
95
- case 1:
96
- addons = _b.sent();
97
- return [2 /*return*/, {
98
- elements: addons.data.addons.map(function (addon) { return addon.id; }),
99
- nextPageCursor: (_a = addons.pagination) === null || _a === void 0 ? void 0 : _a.cursor,
100
- }];
101
- }
102
- });
103
- }); }; };
104
- var getAddonBackups = function (apiClient, projectId, addonId) {
105
- return function (opt) { return __awaiter(void 0, void 0, void 0, function () {
106
- var backups;
107
- var _a;
108
- return __generator(this, function (_b) {
109
- switch (_b.label) {
110
- case 0: return [4 /*yield*/, apiClient.get.addon.backups({
111
- parameters: { projectId: projectId, addonId: addonId },
112
- options: { per_page: defaultPaginationPageSize, cursor: opt === null || opt === void 0 ? void 0 : opt.nextPageCursor },
113
- })];
114
- case 1:
115
- backups = _b.sent();
116
- return [2 /*return*/, {
117
- elements: backups.data.backups.map(function (addon) { return addon.id; }),
118
- nextPageCursor: (_a = backups.pagination) === null || _a === void 0 ? void 0 : _a.cursor,
119
- }];
120
- }
121
- });
122
- }); };
123
- };
124
- function fetchResourceList(propertyName, apiClient, cmdPath, currentProp, pathVars, propPath) {
125
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
126
- return __awaiter(this, void 0, void 0, function () {
127
- var defaultValue, plans, choices, regions, choices, loadMore, _o, choices, nextPageCursor, regions, choices, projectId, serviceResourceRequested, loadMore, _p, choices, nextPageCursor, addonSubject, getAddonType, addonTypes, choices, choices, storage, replicas, loadMore, _q, choices, nextPageCursor, loadMore, _r, choices, nextPageCursor, addonId, upgradeTo, creds, e_1;
128
- var _this = this;
129
- return __generator(this, function (_s) {
130
- switch (_s.label) {
131
- case 0:
132
- defaultValue = undefined;
133
- _s.label = 1;
134
- case 1:
135
- _s.trys.push([1, 32, , 33]);
136
- if (!(propertyName === 'deploymentPlan')) return [3 /*break*/, 3];
137
- return [4 /*yield*/, apiClient.list.plans({})];
138
- case 2:
139
- plans = _s.sent();
140
- choices = plans.data.plans.map(function (pln) { var _a; return (_a = pln === null || pln === void 0 ? void 0 : pln.internalId) !== null && _a !== void 0 ? _a : pln === null || pln === void 0 ? void 0 : pln.id; });
141
- return [2 /*return*/, { choices: choices, defaultValue: defaultValue }];
142
- case 3:
143
- if (!(propertyName === 'region')) return [3 /*break*/, 5];
144
- return [4 /*yield*/, apiClient.list.regions({})];
145
- case 4:
146
- regions = _s.sent();
147
- choices = regions.data.regions.map(function (region) { var _a; return (_a = region === null || region === void 0 ? void 0 : region.internalId) !== null && _a !== void 0 ? _a : region === null || region === void 0 ? void 0 : region.id; });
148
- return [2 /*return*/, { choices: choices, defaultValue: defaultValue }];
149
- case 5:
150
- if (!(propertyName === 'projectId')) return [3 /*break*/, 8];
151
- return [4 /*yield*/, getProjects(apiClient)];
152
- case 6:
153
- loadMore = _s.sent();
154
- return [4 /*yield*/, loadMore()];
155
- case 7:
156
- _o = _s.sent(), choices = _o.elements, nextPageCursor = _o.nextPageCursor;
157
- return [2 /*return*/, { choices: choices, defaultValue: defaultValue, pagination: { nextPageCursor: nextPageCursor, loadMore: loadMore } }];
158
- case 8:
159
- if (!(propertyName === 'credentials')) return [3 /*break*/, 10];
160
- return [4 /*yield*/, apiClient.list.registryCredentials({})];
161
- case 9:
162
- regions = _s.sent();
163
- choices = regions.data.credentials.map(function (cred) { return cred.id; });
164
- return [2 /*return*/, { choices: choices, defaultValue: defaultValue }];
165
- case 10:
166
- projectId = pathVars === null || pathVars === void 0 ? void 0 : pathVars.projectId;
167
- serviceResourceRequested = propertyName === 'serviceId' || (propertyName === 'id' && (propPath === null || propPath === void 0 ? void 0 : propPath.includes('owningObject')));
168
- if (!(projectId !== undefined && serviceResourceRequested)) return [3 /*break*/, 13];
169
- return [4 /*yield*/, getServices(apiClient, projectId)];
170
- case 11:
171
- loadMore = _s.sent();
172
- return [4 /*yield*/, loadMore()];
173
- case 12:
174
- _p = _s.sent(), choices = _p.elements, nextPageCursor = _p.nextPageCursor;
175
- return [2 /*return*/, { choices: choices, defaultValue: defaultValue, pagination: { nextPageCursor: nextPageCursor, loadMore: loadMore } }];
176
- case 13:
177
- addonSubject = cmdPath === null || cmdPath === void 0 ? void 0 : cmdPath.includes('addon');
178
- if (!addonSubject) return [3 /*break*/, 21];
179
- getAddonType = function (type) { return __awaiter(_this, void 0, void 0, function () {
180
- var addonTypes;
181
- var _a;
182
- return __generator(this, function (_b) {
183
- switch (_b.label) {
184
- case 0: return [4 /*yield*/, apiClient.get.addon.types({})];
185
- case 1:
186
- addonTypes = _b.sent();
187
- return [2 /*return*/, (_a = addonTypes.data.addonTypes) === null || _a === void 0 ? void 0 : _a.find(function (t) { return t.type === type; })];
188
- }
189
- });
190
- }); };
191
- if (!(propertyName === 'type')) return [3 /*break*/, 15];
192
- return [4 /*yield*/, apiClient.get.addon.types({})];
193
- case 14:
194
- addonTypes = _s.sent();
195
- choices = (_a = addonTypes.data.addonTypes) === null || _a === void 0 ? void 0 : _a.map(function (type) { return type.type; });
196
- return [2 /*return*/, { choices: choices, defaultValue: defaultValue }];
197
- case 15:
198
- if (!(propertyName === 'version' && (currentProp === null || currentProp === void 0 ? void 0 : currentProp.type) !== undefined)) return [3 /*break*/, 17];
199
- return [4 /*yield*/, getAddonType(currentProp.type)];
200
- case 16:
201
- choices = (_b = (_s.sent())) === null || _b === void 0 ? void 0 : _b.versions;
202
- return [2 /*return*/, { choices: choices, defaultValue: defaultValue }];
203
- case 17:
204
- if (!(propertyName === 'storage' && (currentProp === null || currentProp === void 0 ? void 0 : currentProp.type) !== undefined)) return [3 /*break*/, 19];
205
- return [4 /*yield*/, getAddonType(currentProp.type)];
206
- case 18:
207
- storage = (_d = (_c = (_s.sent())) === null || _c === void 0 ? void 0 : _c.resources) === null || _d === void 0 ? void 0 : _d.storage;
208
- return [2 /*return*/, { choices: storage === null || storage === void 0 ? void 0 : storage.options, defaultValue: storage === null || storage === void 0 ? void 0 : storage.default }];
209
- case 19:
210
- if (!(propertyName === 'replicas' && (currentProp === null || currentProp === void 0 ? void 0 : currentProp.type) !== undefined)) return [3 /*break*/, 21];
211
- return [4 /*yield*/, getAddonType(currentProp.type)];
212
- case 20:
213
- replicas = (_f = (_e = (_s.sent())) === null || _e === void 0 ? void 0 : _e.resources) === null || _f === void 0 ? void 0 : _f.replicas;
214
- return [2 /*return*/, { choices: replicas === null || replicas === void 0 ? void 0 : replicas.options, defaultValue: replicas === null || replicas === void 0 ? void 0 : replicas.default }];
215
- case 21:
216
- if (!(propertyName === 'addonId' && (pathVars === null || pathVars === void 0 ? void 0 : pathVars.projectId) !== undefined)) return [3 /*break*/, 24];
217
- return [4 /*yield*/, getAddons(apiClient, pathVars === null || pathVars === void 0 ? void 0 : pathVars.projectId)];
218
- case 22:
219
- loadMore = _s.sent();
220
- return [4 /*yield*/, loadMore()];
221
- case 23:
222
- _q = _s.sent(), choices = _q.elements, nextPageCursor = _q.nextPageCursor;
223
- return [2 /*return*/, { choices: choices, defaultValue: defaultValue, pagination: { nextPageCursor: nextPageCursor, loadMore: loadMore } }];
224
- case 24:
225
- if (!(propertyName === 'backupId' &&
226
- (pathVars === null || pathVars === void 0 ? void 0 : pathVars.projectId) !== undefined &&
227
- ((_g = currentProp === null || currentProp === void 0 ? void 0 : currentProp.source) === null || _g === void 0 ? void 0 : _g.addonId) !== undefined)) return [3 /*break*/, 27];
228
- return [4 /*yield*/, getAddonBackups(apiClient, pathVars === null || pathVars === void 0 ? void 0 : pathVars.projectId, (_h = currentProp === null || currentProp === void 0 ? void 0 : currentProp.source) === null || _h === void 0 ? void 0 : _h.addonId)];
229
- case 25:
230
- loadMore = _s.sent();
231
- return [4 /*yield*/, loadMore()];
232
- case 26:
233
- _r = _s.sent(), choices = _r.elements, nextPageCursor = _r.nextPageCursor;
234
- return [2 /*return*/, { choices: choices, defaultValue: defaultValue, pagination: { nextPageCursor: nextPageCursor, loadMore: loadMore } }];
235
- case 27:
236
- addonId = (_j = pathVars === null || pathVars === void 0 ? void 0 : pathVars.addonId) !== null && _j !== void 0 ? _j : (_k = currentProp === null || currentProp === void 0 ? void 0 : currentProp.addonDependencies) === null || _k === void 0 ? void 0 : _k.addonId;
237
- if (!((cmdPath === null || cmdPath === void 0 ? void 0 : cmdPath.join('')) === 'updateaddonversion' &&
238
- propertyName === 'version' &&
239
- (pathVars === null || pathVars === void 0 ? void 0 : pathVars.projectId) !== undefined &&
240
- addonId !== undefined)) return [3 /*break*/, 29];
241
- return [4 /*yield*/, apiClient.get.addon.version({
242
- parameters: { addonId: addonId, projectId: pathVars === null || pathVars === void 0 ? void 0 : pathVars.projectId },
243
- })];
244
- case 28:
245
- upgradeTo = (_s.sent()).data.upgradeTo;
246
- if (upgradeTo === undefined || upgradeTo.length <= 0) {
247
- (0, utils_1.warning)('No available versions to upgrade to.');
248
- throw new Error();
249
- }
250
- return [2 /*return*/, { choices: upgradeTo.map(function (u) { return u.version; }), defaultValue: defaultValue }];
251
- case 29:
252
- if (!(((cmdPath === null || cmdPath === void 0 ? void 0 : cmdPath.includes('secretLink')) || (cmdPath === null || cmdPath === void 0 ? void 0 : cmdPath.includes('secret'))) &&
253
- propertyName === 'keyName' &&
254
- addonId !== undefined &&
255
- (pathVars === null || pathVars === void 0 ? void 0 : pathVars.projectId) !== undefined)) return [3 /*break*/, 31];
256
- return [4 /*yield*/, apiClient.get.addon.credentials({
257
- parameters: { addonId: addonId, projectId: pathVars === null || pathVars === void 0 ? void 0 : pathVars.projectId },
258
- })];
259
- case 30:
260
- creds = (_s.sent()).data;
261
- return [2 /*return*/, {
262
- choices: __spreadArray(__spreadArray([], ((_l = Object.keys(creds === null || creds === void 0 ? void 0 : creds.envs)) !== null && _l !== void 0 ? _l : []), true), ((_m = Object.keys(creds === null || creds === void 0 ? void 0 : creds.secrets)) !== null && _m !== void 0 ? _m : []), true),
263
- }];
264
- case 31: return [3 /*break*/, 33];
265
- case 32:
266
- e_1 = _s.sent();
267
- return [3 /*break*/, 33];
268
- case 33: return [2 /*return*/, { choices: undefined, defaultValue: defaultValue }];
269
- }
270
- });
271
- });
272
- }
273
- exports.fetchResourceList = fetchResourceList;
1
+ 'use strict';var a0u=a0N;(function(y,N){var S=a0N,U=y();while(!![]){try{var q=-parseInt(S(0xfa))/0x1*(parseInt(S(0xf8))/0x2)+parseInt(S(0x11b))/0x3*(-parseInt(S(0x12b))/0x4)+parseInt(S(0x115))/0x5+parseInt(S(0x11e))/0x6+-parseInt(S(0x121))/0x7+-parseInt(S(0x12d))/0x8+parseInt(S(0x128))/0x9;if(q===N)break;else U['push'](U['shift']());}catch(G){U['push'](U['shift']());}}}(a0y,0xbdb2e));function a0y(){var yq=['nextPageCursor','return','backupId','get','region','serviceId','push','__spreadArray','4365960ZLOwXf','regions','projectId','value','done','secret','270267CqfRip','concat','ops','6653310gfUWbK','elements','addon','7596162ipbKlK','length','secretLink','includes','__generator','addonDependencies','resources','12730509JptXAT','then','updateaddonversion','20UZGmRn','label','4039872QEKbiG','warning','type','trys','options','throw','cursor','list','replicas','version','services','versions','slice','backups','internalId','envs','credentials','pop','prototype','function','find','iterator','storage','default','Generator\x20is\x20already\x20executing.','registries','next','14mKjytg','types','82711cGAFIx','join','keyName','projects','owningObject','deploymentPlan','__awaiter','pagination','data','keys','plans','addonId','fetchResourceList','call','addonTypes','sent','No\x20available\x20versions\x20to\x20upgrade\x20to.','secrets','map'];a0y=function(){return yq;};return a0y();}var __awaiter=this&&this[a0u(0x100)]||function(y,N,U,q){function G(v){return v instanceof U?v:new U(function(i){i(v);});}return new(U||(U=Promise))(function(v,i){var K=a0N;function n(M){var Z=a0N;try{r(q[Z(0xf7)](M));}catch(J){i(J);}}function e(M){var d=a0N;try{r(q[d(0x132)](M));}catch(J){i(J);}}function r(M){var s=a0N;M[s(0x119)]?v(M[s(0x118)]):G(M[s(0x118)])[s(0x129)](n,e);}r((q=q['apply'](y,N||[]))[K(0xf7)]());});},__generator=this&&this[a0u(0x125)]||function(N,U){var y0=a0u,q={'label':0x0,'sent':function(){if(i[0x0]&0x1)throw i[0x1];return i[0x1];},'trys':[],'ops':[]},G,v,i,n;return n={'next':e(0x0),'throw':e(0x1),'return':e(0x2)},typeof Symbol===y0(0xf0)&&(n[Symbol[y0(0xf2)]]=function(){return this;}),n;function e(P){return function(M){return r([P,M]);};}function r(P){var y1=y0;if(G)throw new TypeError(y1(0xf5));while(q)try{if(G=0x1,v&&(i=P[0x0]&0x2?v[y1(0x10e)]:P[0x0]?v[y1(0x132)]||((i=v[y1(0x10e)])&&i[y1(0x107)](v),0x0):v[y1(0xf7)])&&!(i=i[y1(0x107)](v,P[0x1]))['done'])return i;if(v=0x0,i)P=[P[0x0]&0x2,i[y1(0x118)]];switch(P[0x0]){case 0x0:case 0x1:i=P;break;case 0x4:q[y1(0x12c)]++;return{'value':P[0x1],'done':![]};case 0x5:q[y1(0x12c)]++,v=P[0x1],P=[0x0];continue;case 0x7:P=q['ops'][y1(0xee)](),q[y1(0x130)]['pop']();continue;default:if(!(i=q[y1(0x130)],i=i['length']>0x0&&i[i[y1(0x122)]-0x1])&&(P[0x0]===0x6||P[0x0]===0x2)){q=0x0;continue;}if(P[0x0]===0x3&&(!i||P[0x1]>i[0x0]&&P[0x1]<i[0x3])){q[y1(0x12c)]=P[0x1];break;}if(P[0x0]===0x6&&q[y1(0x12c)]<i[0x1]){q['label']=i[0x1],i=P;break;}if(i&&q[y1(0x12c)]<i[0x2]){q[y1(0x12c)]=i[0x2],q[y1(0x11d)][y1(0x113)](P);break;}if(i[0x2])q['ops']['pop']();q[y1(0x130)]['pop']();continue;}P=U['call'](N,q);}catch(M){P=[0x6,M],v=0x0;}finally{G=i=0x0;}if(P[0x0]&0x5)throw P[0x1];return{'value':P[0x0]?P[0x1]:void 0x0,'done':!![]};}},__spreadArray=this&&this[a0u(0x114)]||function(y,N,U){var y2=a0u;if(U||arguments[y2(0x122)]===0x2)for(var q=0x0,G=N[y2(0x122)],v;q<G;q++){if(v||!(q in N)){if(!v)v=Array[y2(0xef)][y2(0xe9)]['call'](N,0x0,q);v[q]=N[q];}}return y[y2(0x11c)](v||Array[y2(0xef)][y2(0xe9)][y2(0x107)](N));};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[a0u(0x106)]=void 0x0;var utils_1=require('./utils'),defaultPaginationPageSize=0x32,getProjects=function(y){return function(N){return __awaiter(void 0x0,void 0x0,void 0x0,function(){var U,q;return __generator(this,function(G){var y3=a0N;switch(G['label']){case 0x0:return[0x4,y[y3(0x134)][y3(0xfd)]({'options':{'per_page':defaultPaginationPageSize,'cursor':N===null||N===void 0x0?void 0x0:N['nextPageCursor']}})];case 0x1:U=G[y3(0x109)]();return[0x2,{'elements':U[y3(0x102)][y3(0xfd)][y3(0x10c)](function(v){return v['id'];}),'nextPageCursor':(q=U[y3(0x101)])===null||q===void 0x0?void 0x0:q[y3(0x133)]}];}});});};},getServices=function(y,N){return function(U){return __awaiter(void 0x0,void 0x0,void 0x0,function(){var q,G;return __generator(this,function(v){var y4=a0N;switch(v[y4(0x12c)]){case 0x0:return[0x4,y[y4(0x134)][y4(0x137)]({'parameters':{'projectId':N},'options':{'per_page':defaultPaginationPageSize,'cursor':U===null||U===void 0x0?void 0x0:U[y4(0x10d)]}})];case 0x1:q=v[y4(0x109)]();return[0x2,{'elements':q[y4(0x102)][y4(0x137)][y4(0x10c)](function(i){return i['id'];}),'nextPageCursor':(G=q['pagination'])===null||G===void 0x0?void 0x0:G[y4(0x133)]}];}});});};},getAddons=function(y,N){return function(U){return __awaiter(void 0x0,void 0x0,void 0x0,function(){var q,G;return __generator(this,function(v){var y5=a0N;switch(v[y5(0x12c)]){case 0x0:return[0x4,y[y5(0x134)]['addons']({'parameters':{'projectId':N},'options':{'per_page':defaultPaginationPageSize,'cursor':U===null||U===void 0x0?void 0x0:U[y5(0x10d)]}})];case 0x1:q=v[y5(0x109)]();return[0x2,{'elements':q['data']['addons']['map'](function(i){return i['id'];}),'nextPageCursor':(G=q[y5(0x101)])===null||G===void 0x0?void 0x0:G[y5(0x133)]}];}});});};},getAddonBackups=function(y,N,U){return function(q){return __awaiter(void 0x0,void 0x0,void 0x0,function(){var G,v;return __generator(this,function(i){var y6=a0N;switch(i[y6(0x12c)]){case 0x0:return[0x4,y[y6(0x110)][y6(0x120)]['backups']({'parameters':{'projectId':N,'addonId':U},'options':{'per_page':defaultPaginationPageSize,'cursor':q===null||q===void 0x0?void 0x0:q[y6(0x10d)]}})];case 0x1:G=i['sent']();return[0x2,{'elements':G[y6(0x102)][y6(0xea)][y6(0x10c)](function(n){return n['id'];}),'nextPageCursor':(v=G[y6(0x101)])===null||v===void 0x0?void 0x0:v[y6(0x133)]}];}});});};};function a0N(y,N){var U=a0y();return a0N=function(q,G){q=q-0xe8;var v=U[q];return v;},a0N(y,N);}function fetchResourceList(y,N,U,q,G,v){var i,n,e,r,P,M,J,b,V,t,f,w;return __awaiter(this,void 0x0,void 0x0,function(){var g,k,x,X,x,C,p,x,Q,X,x,z,L,C,h,x,Q,I,a,A,x,x,o,l,C,B,x,Q,C,Y,x,Q,T,F,j,W,R=this;return __generator(this,function(D){var y7=a0N;switch(D[y7(0x12c)]){case 0x0:g=undefined,D['label']=0x1;case 0x1:D['trys'][y7(0x113)]([0x1,0x20,,0x21]);if(!(y===y7(0xff)))return[0x3,0x3];return[0x4,N[y7(0x134)][y7(0x104)]({})];case 0x2:k=D[y7(0x109)](),x=k['data'][y7(0x104)][y7(0x10c)](function(c){var y8=y7,O;return(O=c===null||c===void 0x0?void 0x0:c[y8(0xeb)])!==null&&O!==void 0x0?O:c===null||c===void 0x0?void 0x0:c['id'];});return[0x2,{'choices':x,'defaultValue':g}];case 0x3:if(!(y===y7(0x111)))return[0x3,0x5];return[0x4,N[y7(0x134)]['regions']({})];case 0x4:X=D[y7(0x109)](),x=X[y7(0x102)][y7(0x116)][y7(0x10c)](function(c){var O;return(O=c===null||c===void 0x0?void 0x0:c['internalId'])!==null&&O!==void 0x0?O:c===null||c===void 0x0?void 0x0:c['id'];});return[0x2,{'choices':x,'defaultValue':g}];case 0x5:if(!(y===y7(0x117)))return[0x3,0x8];return[0x4,getProjects(N)];case 0x6:C=D[y7(0x109)]();return[0x4,C()];case 0x7:p=D[y7(0x109)](),x=p[y7(0x11f)],Q=p[y7(0x10d)];return[0x2,{'choices':x,'defaultValue':g,'pagination':{'nextPageCursor':Q,'loadMore':C}}];case 0x8:if(!(y==='credentials'))return[0x3,0xa];return[0x4,N[y7(0x134)][y7(0xf6)]({})];case 0x9:X=D[y7(0x109)](),x=X['data'][y7(0xed)]['map'](function(c){return c['id'];});return[0x2,{'choices':x,'defaultValue':g}];case 0xa:z=G===null||G===void 0x0?void 0x0:G[y7(0x117)],L=y===y7(0x112)||y==='id'&&(v===null||v===void 0x0?void 0x0:v[y7(0x124)](y7(0xfe)));if(!(z!==undefined&&L))return[0x3,0xd];return[0x4,getServices(N,z)];case 0xb:C=D[y7(0x109)]();return[0x4,C()];case 0xc:h=D[y7(0x109)](),x=h[y7(0x11f)],Q=h[y7(0x10d)];return[0x2,{'choices':x,'defaultValue':g,'pagination':{'nextPageCursor':Q,'loadMore':C}}];case 0xd:I=U===null||U===void 0x0?void 0x0:U[y7(0x124)](y7(0x120));if(!I)return[0x3,0x15];a=function(c){return __awaiter(R,void 0x0,void 0x0,function(){var O,m;return __generator(this,function(E){var y9=a0N;switch(E['label']){case 0x0:return[0x4,N[y9(0x110)][y9(0x120)][y9(0xf9)]({})];case 0x1:O=E[y9(0x109)]();return[0x2,(m=O[y9(0x102)][y9(0x108)])===null||m===void 0x0?void 0x0:m[y9(0xf1)](function(H){var yy=y9;return H[yy(0x12f)]===c;})];}});});};if(!(y===y7(0x12f)))return[0x3,0xf];return[0x4,N[y7(0x110)][y7(0x120)][y7(0xf9)]({})];case 0xe:A=D[y7(0x109)](),x=(i=A['data'][y7(0x108)])===null||i===void 0x0?void 0x0:i[y7(0x10c)](function(c){var yN=y7;return c[yN(0x12f)];});return[0x2,{'choices':x,'defaultValue':g}];case 0xf:if(!(y===y7(0x136)&&(q===null||q===void 0x0?void 0x0:q[y7(0x12f)])!==undefined))return[0x3,0x11];return[0x4,a(q[y7(0x12f)])];case 0x10:x=(n=D[y7(0x109)]())===null||n===void 0x0?void 0x0:n[y7(0xe8)];return[0x2,{'choices':x,'defaultValue':g}];case 0x11:if(!(y===y7(0xf3)&&(q===null||q===void 0x0?void 0x0:q[y7(0x12f)])!==undefined))return[0x3,0x13];return[0x4,a(q[y7(0x12f)])];case 0x12:o=(r=(e=D[y7(0x109)]())===null||e===void 0x0?void 0x0:e[y7(0x127)])===null||r===void 0x0?void 0x0:r['storage'];return[0x2,{'choices':o===null||o===void 0x0?void 0x0:o[y7(0x131)],'defaultValue':o===null||o===void 0x0?void 0x0:o[y7(0xf4)]}];case 0x13:if(!(y===y7(0x135)&&(q===null||q===void 0x0?void 0x0:q[y7(0x12f)])!==undefined))return[0x3,0x15];return[0x4,a(q['type'])];case 0x14:l=(M=(P=D[y7(0x109)]())===null||P===void 0x0?void 0x0:P[y7(0x127)])===null||M===void 0x0?void 0x0:M[y7(0x135)];return[0x2,{'choices':l===null||l===void 0x0?void 0x0:l[y7(0x131)],'defaultValue':l===null||l===void 0x0?void 0x0:l[y7(0xf4)]}];case 0x15:if(!(y===y7(0x105)&&(G===null||G===void 0x0?void 0x0:G[y7(0x117)])!==undefined))return[0x3,0x18];return[0x4,getAddons(N,G===null||G===void 0x0?void 0x0:G[y7(0x117)])];case 0x16:C=D['sent']();return[0x4,C()];case 0x17:B=D[y7(0x109)](),x=B[y7(0x11f)],Q=B[y7(0x10d)];return[0x2,{'choices':x,'defaultValue':g,'pagination':{'nextPageCursor':Q,'loadMore':C}}];case 0x18:if(!(y===y7(0x10f)&&(G===null||G===void 0x0?void 0x0:G[y7(0x117)])!==undefined&&((J=q===null||q===void 0x0?void 0x0:q['source'])===null||J===void 0x0?void 0x0:J[y7(0x105)])!==undefined))return[0x3,0x1b];return[0x4,getAddonBackups(N,G===null||G===void 0x0?void 0x0:G['projectId'],(b=q===null||q===void 0x0?void 0x0:q['source'])===null||b===void 0x0?void 0x0:b[y7(0x105)])];case 0x19:C=D['sent']();return[0x4,C()];case 0x1a:Y=D['sent'](),x=Y['elements'],Q=Y[y7(0x10d)];return[0x2,{'choices':x,'defaultValue':g,'pagination':{'nextPageCursor':Q,'loadMore':C}}];case 0x1b:T=(V=G===null||G===void 0x0?void 0x0:G['addonId'])!==null&&V!==void 0x0?V:(t=q===null||q===void 0x0?void 0x0:q[y7(0x126)])===null||t===void 0x0?void 0x0:t['addonId'];if(!((U===null||U===void 0x0?void 0x0:U[y7(0xfb)](''))===y7(0x12a)&&y==='version'&&(G===null||G===void 0x0?void 0x0:G['projectId'])!==undefined&&T!==undefined))return[0x3,0x1d];return[0x4,N[y7(0x110)][y7(0x120)][y7(0x136)]({'parameters':{'addonId':T,'projectId':G===null||G===void 0x0?void 0x0:G[y7(0x117)]}})];case 0x1c:F=D[y7(0x109)]()[y7(0x102)]['upgradeTo'];if(F===undefined||F['length']<=0x0){(0x0,utils_1[y7(0x12e)])(y7(0x10a));throw new Error();}return[0x2,{'choices':F[y7(0x10c)](function(c){var yU=y7;return c[yU(0x136)];}),'defaultValue':g}];case 0x1d:if(!(((U===null||U===void 0x0?void 0x0:U[y7(0x124)](y7(0x123)))||(U===null||U===void 0x0?void 0x0:U['includes'](y7(0x11a))))&&y===y7(0xfc)&&T!==undefined&&(G===null||G===void 0x0?void 0x0:G[y7(0x117)])!==undefined))return[0x3,0x1f];return[0x4,N[y7(0x110)][y7(0x120)][y7(0xed)]({'parameters':{'addonId':T,'projectId':G===null||G===void 0x0?void 0x0:G[y7(0x117)]}})];case 0x1e:j=D[y7(0x109)]()[y7(0x102)];return[0x2,{'choices':__spreadArray(__spreadArray([],(f=Object[y7(0x103)](j===null||j===void 0x0?void 0x0:j[y7(0xec)]))!==null&&f!==void 0x0?f:[],!![]),(w=Object[y7(0x103)](j===null||j===void 0x0?void 0x0:j[y7(0x10b)]))!==null&&w!==void 0x0?w:[],!![])}];case 0x1f:return[0x3,0x21];case 0x20:W=D[y7(0x109)]();return[0x3,0x21];case 0x21:return[0x2,{'choices':undefined,'defaultValue':g}];}});});}exports[a0u(0x106)]=fetchResourceList;