@sap-ux/deploy-tooling 0.14.47 → 0.15.2
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/dist/base/config.js +5 -3
- package/dist/base/deploy.js +162 -196
- package/dist/base/prompt.js +13 -24
- package/dist/base/validate.js +165 -191
- package/dist/cli/archive.js +23 -37
- package/dist/cli/config.js +47 -60
- package/dist/cli/index.js +39 -54
- package/dist/ui5/archive.js +14 -25
- package/dist/ui5/index.js +14 -26
- package/package.json +8 -8
package/dist/base/validate.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.checkForCredentials = exports.showAdditionalInfoForOnPrem = exports.formatSummary = exports.validateBeforeDeploy = exports.summaryMessage = exports.SummaryStatus = void 0;
|
|
13
4
|
const axios_extension_1 = require("@sap-ux/axios-extension");
|
|
@@ -42,29 +33,26 @@ let cachedDestinationsList = {};
|
|
|
42
33
|
* @param logger Logger used by deploy tooling
|
|
43
34
|
* @returns Validation result and a summary report of identified issues.
|
|
44
35
|
*/
|
|
45
|
-
function validateBeforeDeploy(config, provider, logger) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
yield validateTransportRequestWithAdt(input, output, provider, logger);
|
|
66
|
-
return output;
|
|
67
|
-
});
|
|
36
|
+
async function validateBeforeDeploy(config, provider, logger) {
|
|
37
|
+
const output = {
|
|
38
|
+
summary: [],
|
|
39
|
+
result: true
|
|
40
|
+
};
|
|
41
|
+
const input = {
|
|
42
|
+
appName: config.app.name ?? '',
|
|
43
|
+
description: config.app.description ?? '',
|
|
44
|
+
package: config.app.package ?? '',
|
|
45
|
+
transport: config.app.transport ?? '',
|
|
46
|
+
client: config.target.client ?? '',
|
|
47
|
+
url: config.target.url ?? '',
|
|
48
|
+
destination: config.target.destination ?? ''
|
|
49
|
+
};
|
|
50
|
+
// output is passed by reference and status updated during the internal pipeline below.
|
|
51
|
+
await validateInputTextFormat(input, output, provider, logger);
|
|
52
|
+
convertInputsForAdtValidations(input, output);
|
|
53
|
+
await validatePackageWithAdt(input, output, provider, logger);
|
|
54
|
+
await validateTransportRequestWithAdt(input, output, provider, logger);
|
|
55
|
+
return output;
|
|
68
56
|
}
|
|
69
57
|
exports.validateBeforeDeploy = validateBeforeDeploy;
|
|
70
58
|
/**
|
|
@@ -130,33 +118,31 @@ function convertInputsForAdtValidations(input, output) {
|
|
|
130
118
|
* @param provider AbapServiceProvider
|
|
131
119
|
* @param logger Logger from the calling context
|
|
132
120
|
*/
|
|
133
|
-
function validateInputTextFormat(input, output, provider, logger) {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
159
|
-
});
|
|
121
|
+
async function validateInputTextFormat(input, output, provider, logger) {
|
|
122
|
+
// Prepare backend info for validation
|
|
123
|
+
const prefix = await getSystemPrefix(output, provider, logger);
|
|
124
|
+
// A sequence of client-side validations. No early termination of detecting invalid inputs.
|
|
125
|
+
// Setting output.result to false if any of the checks is invalid.
|
|
126
|
+
// Add individual error messages into output.summary array if validation failed.
|
|
127
|
+
let result = (0, project_input_validator_1.validateAppName)(input.appName, prefix);
|
|
128
|
+
processInputValidationResult(result, output);
|
|
129
|
+
result = (0, project_input_validator_1.validateAppDescription)(input.description);
|
|
130
|
+
processInputValidationResult(result, output);
|
|
131
|
+
result = (0, project_input_validator_1.validateTransportRequestNumber)(input.transport, input.package);
|
|
132
|
+
processInputValidationResult(result, output);
|
|
133
|
+
result = (0, project_input_validator_1.validatePackage)(input.package);
|
|
134
|
+
processInputValidationResult(result, output);
|
|
135
|
+
result = (0, project_input_validator_1.validateClient)(input.client);
|
|
136
|
+
processInputValidationResult(result, output);
|
|
137
|
+
result = validateUrlForOnPremTargetOnly(input.destination, input.url);
|
|
138
|
+
processInputValidationResult(result, output);
|
|
139
|
+
// If all the text validation passed, only show the following success message.
|
|
140
|
+
if (output.result) {
|
|
141
|
+
output.summary.push({
|
|
142
|
+
message: exports.summaryMessage.allClientCheckPass,
|
|
143
|
+
status: SummaryStatus.Valid
|
|
144
|
+
});
|
|
145
|
+
}
|
|
160
146
|
}
|
|
161
147
|
/**
|
|
162
148
|
* A wrapper of validateUrl(). It uses same logic in system-access module's createAbapServiceProvider()
|
|
@@ -187,32 +173,30 @@ function validateUrlForOnPremTargetOnly(destination, url) {
|
|
|
187
173
|
* @param logger Logger from the calling context
|
|
188
174
|
* @returns System specific development prefix constraint for Fiori app name
|
|
189
175
|
*/
|
|
190
|
-
function getSystemPrefix(output, provider, logger) {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
if (!adtService) {
|
|
195
|
-
output.summary.push({
|
|
196
|
-
message: `${exports.summaryMessage.adtServiceUndefined} for AtoService`,
|
|
197
|
-
status: SummaryStatus.Unknown
|
|
198
|
-
});
|
|
199
|
-
output.result = false;
|
|
200
|
-
return undefined;
|
|
201
|
-
}
|
|
202
|
-
const atoSettings = yield adtService.getAtoInfo();
|
|
203
|
-
return atoSettings === null || atoSettings === void 0 ? void 0 : atoSettings.developmentPrefix;
|
|
204
|
-
}
|
|
205
|
-
catch (e) {
|
|
206
|
-
logger.error(e.message);
|
|
207
|
-
logger.debug(e);
|
|
176
|
+
async function getSystemPrefix(output, provider, logger) {
|
|
177
|
+
try {
|
|
178
|
+
const adtService = await provider.getAdtService(axios_extension_1.AtoService);
|
|
179
|
+
if (!adtService) {
|
|
208
180
|
output.summary.push({
|
|
209
|
-
message: exports.summaryMessage.
|
|
181
|
+
message: `${exports.summaryMessage.adtServiceUndefined} for AtoService`,
|
|
210
182
|
status: SummaryStatus.Unknown
|
|
211
183
|
});
|
|
212
184
|
output.result = false;
|
|
213
185
|
return undefined;
|
|
214
186
|
}
|
|
215
|
-
|
|
187
|
+
const atoSettings = await adtService.getAtoInfo();
|
|
188
|
+
return atoSettings?.developmentPrefix;
|
|
189
|
+
}
|
|
190
|
+
catch (e) {
|
|
191
|
+
logger.error(e.message);
|
|
192
|
+
logger.debug(e);
|
|
193
|
+
output.summary.push({
|
|
194
|
+
message: exports.summaryMessage.atoAdtAccessError,
|
|
195
|
+
status: SummaryStatus.Unknown
|
|
196
|
+
});
|
|
197
|
+
output.result = false;
|
|
198
|
+
return undefined;
|
|
199
|
+
}
|
|
216
200
|
}
|
|
217
201
|
/**
|
|
218
202
|
* Helper function to proces input validation result. Avoids sonarqube warning about
|
|
@@ -242,49 +226,47 @@ function processInputValidationResult(validationResult, output) {
|
|
|
242
226
|
* @param provider AbapServiceProvider
|
|
243
227
|
* @param logger Logger from the calling context
|
|
244
228
|
*/
|
|
245
|
-
function validatePackageWithAdt(input, output, provider, logger) {
|
|
246
|
-
|
|
247
|
-
|
|
229
|
+
async function validatePackageWithAdt(input, output, provider, logger) {
|
|
230
|
+
if (output.result === false) {
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
// ADT expects input package
|
|
234
|
+
const inputPackage = input.package;
|
|
235
|
+
try {
|
|
236
|
+
const adtService = await provider.getAdtService(axios_extension_1.ListPackageService);
|
|
237
|
+
if (!adtService) {
|
|
238
|
+
output.summary.push({
|
|
239
|
+
message: `${exports.summaryMessage.adtServiceUndefined} for ListPackageService`,
|
|
240
|
+
status: SummaryStatus.Unknown
|
|
241
|
+
});
|
|
242
|
+
output.result = false;
|
|
248
243
|
return;
|
|
249
244
|
}
|
|
250
|
-
|
|
251
|
-
const
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
status: SummaryStatus.Unknown
|
|
258
|
-
});
|
|
259
|
-
output.result = false;
|
|
260
|
-
return;
|
|
261
|
-
}
|
|
262
|
-
const packages = yield adtService.listPackages({ phrase: inputPackage });
|
|
263
|
-
const isValidPackage = packages.findIndex((packageName) => packageName === inputPackage) >= 0;
|
|
264
|
-
if (isValidPackage) {
|
|
265
|
-
output.summary.push({
|
|
266
|
-
message: exports.summaryMessage.packageCheckPass,
|
|
267
|
-
status: SummaryStatus.Valid
|
|
268
|
-
});
|
|
269
|
-
}
|
|
270
|
-
else {
|
|
271
|
-
output.summary.push({
|
|
272
|
-
message: exports.summaryMessage.packageNotFound,
|
|
273
|
-
status: SummaryStatus.Invalid
|
|
274
|
-
});
|
|
275
|
-
output.result = false;
|
|
276
|
-
}
|
|
245
|
+
const packages = await adtService.listPackages({ phrase: inputPackage });
|
|
246
|
+
const isValidPackage = packages.findIndex((packageName) => packageName === inputPackage) >= 0;
|
|
247
|
+
if (isValidPackage) {
|
|
248
|
+
output.summary.push({
|
|
249
|
+
message: exports.summaryMessage.packageCheckPass,
|
|
250
|
+
status: SummaryStatus.Valid
|
|
251
|
+
});
|
|
277
252
|
}
|
|
278
|
-
|
|
279
|
-
logger.error(e.message);
|
|
280
|
-
logger.debug(e);
|
|
253
|
+
else {
|
|
281
254
|
output.summary.push({
|
|
282
|
-
message: exports.summaryMessage.
|
|
283
|
-
status: SummaryStatus.
|
|
255
|
+
message: exports.summaryMessage.packageNotFound,
|
|
256
|
+
status: SummaryStatus.Invalid
|
|
284
257
|
});
|
|
285
258
|
output.result = false;
|
|
286
259
|
}
|
|
287
|
-
}
|
|
260
|
+
}
|
|
261
|
+
catch (e) {
|
|
262
|
+
logger.error(e.message);
|
|
263
|
+
logger.debug(e);
|
|
264
|
+
output.summary.push({
|
|
265
|
+
message: exports.summaryMessage.pacakgeAdtAccessError,
|
|
266
|
+
status: SummaryStatus.Unknown
|
|
267
|
+
});
|
|
268
|
+
output.result = false;
|
|
269
|
+
}
|
|
288
270
|
}
|
|
289
271
|
/**
|
|
290
272
|
* Query ADT backend service to verify input transport request.
|
|
@@ -294,59 +276,57 @@ function validatePackageWithAdt(input, output, provider, logger) {
|
|
|
294
276
|
* @param provider AbapServiceProvider
|
|
295
277
|
* @param logger Logger from the calling context
|
|
296
278
|
*/
|
|
297
|
-
function validateTransportRequestWithAdt(input, output, provider, logger) {
|
|
298
|
-
|
|
299
|
-
|
|
279
|
+
async function validateTransportRequestWithAdt(input, output, provider, logger) {
|
|
280
|
+
if (output.result === false) {
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
try {
|
|
284
|
+
const adtService = await provider.getAdtService(axios_extension_1.TransportChecksService);
|
|
285
|
+
if (!adtService) {
|
|
286
|
+
output.summary.push({
|
|
287
|
+
message: `${exports.summaryMessage.adtServiceUndefined} for TransportChecksService`,
|
|
288
|
+
status: SummaryStatus.Unknown
|
|
289
|
+
});
|
|
290
|
+
output.result = false;
|
|
300
291
|
return;
|
|
301
292
|
}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
293
|
+
const trList = await adtService.getTransportRequests(input.package, input.appName);
|
|
294
|
+
const isValidTrList = trList.findIndex((tr) => tr.transportNumber === input.transport) >= 0;
|
|
295
|
+
if (isValidTrList) {
|
|
296
|
+
output.summary.push({
|
|
297
|
+
message: exports.summaryMessage.transportCheckPass,
|
|
298
|
+
status: SummaryStatus.Valid
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
else {
|
|
302
|
+
output.summary.push({
|
|
303
|
+
message: exports.summaryMessage.transportNotFound,
|
|
304
|
+
status: SummaryStatus.Invalid
|
|
305
|
+
});
|
|
306
|
+
output.result = false;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
catch (e) {
|
|
310
|
+
// TransportChecksService.getTransportRequests() API is used to provide valid
|
|
311
|
+
// transport request list. If input packge is local package, no transport request
|
|
312
|
+
// is returned and LocalPackageError is thrown as exception.
|
|
313
|
+
// LocalPackageError is acceptable for validation purpose here.
|
|
314
|
+
if (e.message === axios_extension_1.TransportChecksService.LocalPackageError) {
|
|
315
|
+
output.summary.push({
|
|
316
|
+
message: exports.summaryMessage.transportNotRequired,
|
|
317
|
+
status: SummaryStatus.Valid
|
|
318
|
+
});
|
|
327
319
|
}
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
status: SummaryStatus.Valid
|
|
337
|
-
});
|
|
338
|
-
}
|
|
339
|
-
else {
|
|
340
|
-
logger.error(e.message);
|
|
341
|
-
logger.debug(e);
|
|
342
|
-
output.summary.push({
|
|
343
|
-
message: exports.summaryMessage.transportAdtAccessError,
|
|
344
|
-
status: SummaryStatus.Unknown
|
|
345
|
-
});
|
|
346
|
-
output.result = false;
|
|
347
|
-
}
|
|
320
|
+
else {
|
|
321
|
+
logger.error(e.message);
|
|
322
|
+
logger.debug(e);
|
|
323
|
+
output.summary.push({
|
|
324
|
+
message: exports.summaryMessage.transportAdtAccessError,
|
|
325
|
+
status: SummaryStatus.Unknown
|
|
326
|
+
});
|
|
327
|
+
output.result = false;
|
|
348
328
|
}
|
|
349
|
-
}
|
|
329
|
+
}
|
|
350
330
|
}
|
|
351
331
|
/**
|
|
352
332
|
* Returns true if specified destination is on-premise and if environment is App Studio
|
|
@@ -355,15 +335,13 @@ function validateTransportRequestWithAdt(input, output, provider, logger) {
|
|
|
355
335
|
* @param destination Identifier for destination to be checked.
|
|
356
336
|
* @returns Promise boolean.
|
|
357
337
|
*/
|
|
358
|
-
function showAdditionalInfoForOnPrem(destination) {
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
return showInfo;
|
|
366
|
-
});
|
|
338
|
+
async function showAdditionalInfoForOnPrem(destination) {
|
|
339
|
+
let showInfo = false;
|
|
340
|
+
if ((0, btp_utils_1.isAppStudio)() && destination) {
|
|
341
|
+
const destinations = await (0, btp_utils_1.listDestinations)();
|
|
342
|
+
showInfo = (0, btp_utils_1.isOnPremiseDestination)(destinations[destination]);
|
|
343
|
+
}
|
|
344
|
+
return showInfo;
|
|
367
345
|
}
|
|
368
346
|
exports.showAdditionalInfoForOnPrem = showAdditionalInfoForOnPrem;
|
|
369
347
|
/**
|
|
@@ -373,18 +351,16 @@ exports.showAdditionalInfoForOnPrem = showAdditionalInfoForOnPrem;
|
|
|
373
351
|
* @param logger Logger from the calling context.
|
|
374
352
|
* @returns Promise boolean.
|
|
375
353
|
*/
|
|
376
|
-
function checkForCredentials(destination, logger) {
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
check = false;
|
|
384
|
-
}
|
|
354
|
+
async function checkForCredentials(destination, logger) {
|
|
355
|
+
let check = true;
|
|
356
|
+
if (destination && (0, btp_utils_1.isAppStudio)()) {
|
|
357
|
+
const destinations = await getDestinations();
|
|
358
|
+
if (destinations[destination].Authentication === btp_utils_1.Authentication.SAML_ASSERTION) {
|
|
359
|
+
logger.warn(`The SAP BTP destination is misconfigured, please check you have the appropriate trusts and permissions enabled.`);
|
|
360
|
+
check = false;
|
|
385
361
|
}
|
|
386
|
-
|
|
387
|
-
|
|
362
|
+
}
|
|
363
|
+
return check;
|
|
388
364
|
}
|
|
389
365
|
exports.checkForCredentials = checkForCredentials;
|
|
390
366
|
/**
|
|
@@ -392,12 +368,10 @@ exports.checkForCredentials = checkForCredentials;
|
|
|
392
368
|
*
|
|
393
369
|
* @returns Array of Destination objects
|
|
394
370
|
*/
|
|
395
|
-
function getDestinations() {
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
return cachedDestinationsList;
|
|
401
|
-
});
|
|
371
|
+
async function getDestinations() {
|
|
372
|
+
if (Object.keys(cachedDestinationsList).length === 0) {
|
|
373
|
+
cachedDestinationsList = await (0, btp_utils_1.listDestinations)();
|
|
374
|
+
}
|
|
375
|
+
return cachedDestinationsList;
|
|
402
376
|
}
|
|
403
377
|
//# sourceMappingURL=validate.js.map
|
package/dist/cli/archive.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
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
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -46,21 +37,19 @@ function getArchiveFromPath(logger, path) {
|
|
|
46
37
|
* @param rejectUnauthorized - strict SSL handling or not
|
|
47
38
|
* @returns Buffer containing the zip file
|
|
48
39
|
*/
|
|
49
|
-
function fetchArchiveFromUrl(logger, url, rejectUnauthorized) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
});
|
|
40
|
+
async function fetchArchiveFromUrl(logger, url, rejectUnauthorized) {
|
|
41
|
+
try {
|
|
42
|
+
logger.info(`Fetching archive from ${url}.`);
|
|
43
|
+
const response = await axios_1.default.get(url, {
|
|
44
|
+
httpsAgent: new https_1.Agent({ rejectUnauthorized }),
|
|
45
|
+
responseType: 'arraybuffer'
|
|
46
|
+
});
|
|
47
|
+
logger.info(`Archive fetched from ${url}.`);
|
|
48
|
+
return response.data;
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
throw new Error(`The archive url you provided could not be reached. Please ensure the URL is accessible and does not require authentication. ${error}`);
|
|
52
|
+
}
|
|
64
53
|
}
|
|
65
54
|
/**
|
|
66
55
|
* Create a zipped file containing all files in the given folder.
|
|
@@ -91,19 +80,16 @@ function createArchiveFromFolder(logger, path) {
|
|
|
91
80
|
* @param options - options provided via CLI
|
|
92
81
|
* @returns Buffer containing the zip file
|
|
93
82
|
*/
|
|
94
|
-
function getArchive(logger, options) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
return createArchiveFromFolder(logger, (_a = options.archiveFolder) !== null && _a !== void 0 ? _a : process.cwd());
|
|
105
|
-
}
|
|
106
|
-
});
|
|
83
|
+
async function getArchive(logger, options) {
|
|
84
|
+
if (options.archivePath) {
|
|
85
|
+
return getArchiveFromPath(logger, options.archivePath);
|
|
86
|
+
}
|
|
87
|
+
else if (options.archiveUrl) {
|
|
88
|
+
return fetchArchiveFromUrl(logger, options.archiveUrl, options.strictSsl);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
return createArchiveFromFolder(logger, options.archiveFolder ?? process.cwd());
|
|
92
|
+
}
|
|
107
93
|
}
|
|
108
94
|
exports.getArchive = getArchive;
|
|
109
95
|
//# sourceMappingURL=archive.js.map
|