@sap-ux/deploy-tooling 0.10.2 → 0.11.0

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.
@@ -0,0 +1,12 @@
1
+ /// <reference types="node" />
2
+ /**
3
+ * Check whether a given zip files contains an adaptation project and if yes returns the contained manisfest.appdesc_variant.
4
+ *
5
+ * @param archive buffer representing a zip file
6
+ * @returns the descriptor as object if the archive contains an adaptation project otherwise undefined
7
+ */
8
+ export declare function getAppDescriptorVariant(archive: Buffer): {
9
+ namespace: string;
10
+ layer: 'CUSTOMER_BASE' | 'VENDOR';
11
+ } | undefined;
12
+ //# sourceMappingURL=archive.d.ts.map
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getAppDescriptorVariant = void 0;
7
+ const adm_zip_1 = __importDefault(require("adm-zip"));
8
+ /**
9
+ * Check whether a given zip files contains an adaptation project and if yes returns the contained manisfest.appdesc_variant.
10
+ *
11
+ * @param archive buffer representing a zip file
12
+ * @returns the descriptor as object if the archive contains an adaptation project otherwise undefined
13
+ */
14
+ function getAppDescriptorVariant(archive) {
15
+ try {
16
+ const zip = new adm_zip_1.default(archive);
17
+ const file = zip.getEntry('manifest.appdescr_variant');
18
+ if (file) {
19
+ return JSON.parse(file.getData().toString());
20
+ }
21
+ else {
22
+ return undefined;
23
+ }
24
+ }
25
+ catch (error) {
26
+ return undefined;
27
+ }
28
+ }
29
+ exports.getAppDescriptorVariant = getAppDescriptorVariant;
30
+ //# sourceMappingURL=archive.js.map
@@ -1,4 +1,5 @@
1
1
  import type { AbapDeployConfig } from '../types';
2
+ import type { BspConfig } from '@sap-ux/axios-extension';
2
3
  /**
3
4
  * Clones the given config and removes secrets so that it can be printed to a log file.
4
5
  *
@@ -14,6 +15,19 @@ export declare function getConfigForLogging(config: AbapDeployConfig): AbapDeplo
14
15
  * @param obj - any object structure
15
16
  */
16
17
  export declare function replaceEnvVariables(obj: object): void;
18
+ /**
19
+ * Helper function for throwing a missing property error.
20
+ *
21
+ * @param property Invalid missing property
22
+ */
23
+ export declare function throwConfigMissingError(property: string): void;
24
+ /**
25
+ * Type checking the config object.
26
+ *
27
+ * @param config - config to be checked
28
+ * @returns true if it is of type BSP config
29
+ */
30
+ export declare function isBspConfig(config: Partial<BspConfig>): config is BspConfig;
17
31
  /**
18
32
  * Validate the given config. If anything mandatory is missing throw an error.
19
33
  *
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateConfig = exports.replaceEnvVariables = exports.getConfigForLogging = void 0;
3
+ exports.validateConfig = exports.isBspConfig = exports.throwConfigMissingError = exports.replaceEnvVariables = exports.getConfigForLogging = void 0;
4
4
  const btp_utils_1 = require("@sap-ux/btp-utils");
5
5
  const system_access_1 = require("@sap-ux/system-access");
6
6
  /**
@@ -45,6 +45,7 @@ exports.replaceEnvVariables = replaceEnvVariables;
45
45
  function throwConfigMissingError(property) {
46
46
  throw new Error(`Invalid deployment configuration. Property ${property} is missing.`);
47
47
  }
48
+ exports.throwConfigMissingError = throwConfigMissingError;
48
49
  /**
49
50
  * Validate the given target config. If anything mandatory is missing throw an error.
50
51
  *
@@ -62,6 +63,16 @@ function validateTarget(target) {
62
63
  }
63
64
  return target;
64
65
  }
66
+ /**
67
+ * Type checking the config object.
68
+ *
69
+ * @param config - config to be checked
70
+ * @returns true if it is of type BSP config
71
+ */
72
+ function isBspConfig(config) {
73
+ return config.name !== undefined;
74
+ }
75
+ exports.isBspConfig = isBspConfig;
65
76
  /**
66
77
  * Validate the given config. If anything mandatory is missing throw an error.
67
78
  *
@@ -78,12 +89,7 @@ function validateConfig(config) {
78
89
  else {
79
90
  throwConfigMissingError('target');
80
91
  }
81
- if (config.app) {
82
- if (!config.app.name) {
83
- throwConfigMissingError('app-name');
84
- }
85
- }
86
- else {
92
+ if (!config.app) {
87
93
  throwConfigMissingError('app');
88
94
  }
89
95
  return config;
@@ -15,8 +15,8 @@ const fs_1 = require("fs");
15
15
  const config_1 = require("./config");
16
16
  const prompt_1 = require("./prompt");
17
17
  const system_access_1 = require("@sap-ux/system-access");
18
+ const archive_1 = require("./archive");
18
19
  const validate_1 = require("./validate");
19
- const deploymentCommands = { tryUndeploy, tryDeploy };
20
20
  /**
21
21
  * Handle exceptions thrown, in some cases we to retry them.
22
22
  *
@@ -36,7 +36,7 @@ function handleError(command, error, provider, config, logger, archive) {
36
36
  return;
37
37
  }
38
38
  }
39
- logger.error(`${command === "tryDeploy" /* TryCommands.Deploy */ ? 'Deployment' : 'Undeployment'} has failed.`);
39
+ logger.error(`${command === tryDeploy ? 'Deployment' : 'Undeployment'} has failed.`);
40
40
  logger.debug((0, config_1.getConfigForLogging)(config));
41
41
  if (!config.verbose) {
42
42
  logger.error('Change logging level to debug your issue\n\t(see examples https://github.com/SAP/open-ux-tools/tree/main/packages/deploy-tooling#configuration-with-logging-enabled)');
@@ -58,7 +58,7 @@ function handle412Error(command, provider, config, logger, archive) {
58
58
  return __awaiter(this, void 0, void 0, function* () {
59
59
  logger.warn('An app in the same repository with different sap app id found.');
60
60
  if (config.yes || (yield (0, prompt_1.promptConfirmation)('Do you want to overwrite (Y/n)?'))) {
61
- yield deploymentCommands[command](provider, Object.assign(Object.assign({}, config), { safe: false, retry: false }), logger, archive);
61
+ yield command(provider, Object.assign(Object.assign({}, config), { safe: false, retry: false }), logger, archive);
62
62
  return true;
63
63
  }
64
64
  else {
@@ -77,13 +77,12 @@ function handle412Error(command, provider, config, logger, archive) {
77
77
  * @returns true if the error was handled otherwise false is returned
78
78
  */
79
79
  function handle401Error(command, provider, config, logger, archive) {
80
- var _a;
80
+ var _a, _b;
81
81
  return __awaiter(this, void 0, void 0, function* () {
82
- logger.warn(`${command === "tryDeploy" /* TryCommands.Deploy */ ? 'Deployment' : 'Undeployment'} failed with authentication error.`);
82
+ logger.warn(`${command === tryDeploy ? 'Deployment' : 'Undeployment'} failed with authentication error.`);
83
83
  logger.info('Please maintain correct credentials to avoid seeing this error\n\t(see help: https://www.npmjs.com/package/@sap/ux-ui5-tooling#setting-environment-variables-in-a-env-file)');
84
84
  logger.info('Please enter your credentials.');
85
- const service = getUi5AbapRepositoryService(provider, config, logger);
86
- const credentials = yield (0, system_access_1.getCredentialsWithPrompts)((_a = service.defaults.auth) === null || _a === void 0 ? void 0 : _a.username);
85
+ const credentials = yield (0, system_access_1.getCredentialsWithPrompts)((_b = (_a = provider.defaults) === null || _a === void 0 ? void 0 : _a.auth) === null || _b === void 0 ? void 0 : _b.username);
87
86
  if (Object.keys(credentials).length) {
88
87
  if (config.target.serviceKey) {
89
88
  config.target.serviceKey.uaa.username = credentials.username;
@@ -92,7 +91,7 @@ function handle401Error(command, provider, config, logger, archive) {
92
91
  else {
93
92
  config.credentials = credentials;
94
93
  }
95
- yield runCommand(command, config, logger, archive);
94
+ yield command(provider, config, logger, archive);
96
95
  return true;
97
96
  }
98
97
  else {
@@ -124,16 +123,16 @@ function axiosErrorRetryHandler(command, response, provider, config, logger, arc
124
123
  });
125
124
  }
126
125
  /**
127
- * Generate a Ui5AbapRepositoryService instance from the supplied deployment config.
126
+ * Generate a service instance for deployment from the supplied deployment config.
128
127
  *
129
- * @param provider - instance of the axios-extension abap service provider
128
+ * @param factoryFn - function to create a service
130
129
  * @param config - deployment configuration
131
130
  * @param logger - reference to the logger instance
132
131
  * @returns service returns the UI5 ABAP Repository service
133
132
  */
134
- function getUi5AbapRepositoryService(provider, config, logger) {
133
+ function getDeployService(factoryFn, config, logger) {
135
134
  var _a;
136
- const service = provider.getUi5AbapRepository((_a = config.target) === null || _a === void 0 ? void 0 : _a.service);
135
+ const service = factoryFn((_a = config.target) === null || _a === void 0 ? void 0 : _a.service);
137
136
  service.log = logger;
138
137
  if (!config.strictSsl) {
139
138
  logger.warn('You chose not to validate SSL certificate. Please verify the server certificate is trustful before proceeding. See documentation for recommended configuration (https://help.sap.com/viewer/17d50220bcd848aa854c9c182d65b699/Latest/en-US/4b318bede7eb4021a8be385c46c74045.html).');
@@ -153,41 +152,68 @@ function createTransportRequest(config, logger, provider) {
153
152
  var _a;
154
153
  return __awaiter(this, void 0, void 0, function* () {
155
154
  if (!provider) {
156
- provider = yield (0, system_access_1.createAbapServiceProvider)(config.target, {
157
- auth: config.credentials,
158
- ignoreCertErrors: !config.strictSsl
159
- }, !!config.target.scp, logger);
155
+ provider = yield createProvider(config, logger);
160
156
  }
161
157
  const adtService = yield provider.getAdtService(axios_extension_1.TransportRequestService);
158
+ const ui5AppName = (0, config_1.isBspConfig)(config.app) ? config.app.name : '';
162
159
  const transportRequest = yield (adtService === null || adtService === void 0 ? void 0 : adtService.createTransportRequest({
163
160
  packageName: (_a = config.app.package) !== null && _a !== void 0 ? _a : '',
164
- ui5AppName: config.app.name,
161
+ ui5AppName,
165
162
  description: 'Created by @sap-ux/deploy-tooling'
166
163
  }));
167
164
  if (transportRequest) {
168
- logger.info(`Transport request ${transportRequest} created for application ${config.app.name}.`);
165
+ logger.info(`Transport request ${transportRequest} created for application ${ui5AppName}.`);
169
166
  return transportRequest;
170
167
  }
171
- throw new Error(`Transport request could not be created for application ${config.app.name}.`);
168
+ throw new Error(`Transport request could not be created for application ${ui5AppName}.`);
172
169
  });
173
170
  }
174
171
  exports.createTransportRequest = createTransportRequest;
175
172
  /**
176
- * Generic method to run the deployment request i.e. deploy | undeploy.
173
+ * Create a service provider based on the given config.
177
174
  *
178
- * @param command - the request type deploy | undeploy to be executed
179
175
  * @param config - deployment configuration
180
176
  * @param logger - reference to the logger instance
181
- * @param archive - archive file that is to be deployed
177
+ * @returns an instance of an ABAP service provider
182
178
  */
183
- function runCommand(command, config, logger, archive = Buffer.from('')) {
179
+ function createProvider(config, logger) {
184
180
  return __awaiter(this, void 0, void 0, function* () {
185
- const provider = yield (0, system_access_1.createAbapServiceProvider)(config.target, {
181
+ return yield (0, system_access_1.createAbapServiceProvider)(config.target, {
186
182
  auth: config.credentials,
187
183
  ignoreCertErrors: !config.strictSsl
188
184
  }, !!config.target.scp, logger);
189
- logger.info(`Starting to ${command === "tryDeploy" /* TryCommands.Deploy */ ? 'deploy' : 'undeploy'}${config.test === true ? ' in test mode' : ''}.`);
190
- yield deploymentCommands[command](provider, config, logger, archive);
185
+ });
186
+ }
187
+ /**
188
+ * Check if the archive is an adapation project and if yes, try to deploy it to the layered repository.
189
+ *
190
+ * @param provider - instance of the axios-extension abap service provider
191
+ * @param config - deployment configuration
192
+ * @param logger - reference to the logger instance
193
+ * @param archive - archive file that is to be deployed
194
+ */
195
+ function tryDeployToLrep(provider, config, logger, archive) {
196
+ return __awaiter(this, void 0, void 0, function* () {
197
+ logger.debug('No BSP name provided, checking if it is an adaptation project');
198
+ const descriptor = (0, archive_1.getAppDescriptorVariant)(archive);
199
+ if (descriptor) {
200
+ if (config.test) {
201
+ throw new Error('Deployment in test mode not supported for deployments to the layered repository.');
202
+ }
203
+ else {
204
+ logger.debug('Deploying an adaptation project to LREP');
205
+ const service = getDeployService(provider.getLayeredRepository.bind(provider), config, logger);
206
+ yield service.deploy(archive, {
207
+ namespace: descriptor.namespace,
208
+ layer: descriptor.layer,
209
+ package: config.app.package,
210
+ transport: config.app.transport
211
+ });
212
+ }
213
+ }
214
+ else {
215
+ (0, config_1.throwConfigMissingError)('app-name');
216
+ }
191
217
  });
192
218
  }
193
219
  /**
@@ -199,30 +225,27 @@ function runCommand(command, config, logger, archive = Buffer.from('')) {
199
225
  * @param archive - archive file that is to be deployed
200
226
  */
201
227
  function tryDeploy(provider, config, logger, archive) {
202
- var _a, _b, _c, _d, _e;
203
228
  return __awaiter(this, void 0, void 0, function* () {
204
229
  try {
205
230
  if (config.createTransport) {
206
231
  config.app.transport = yield createTransportRequest(config, logger, provider);
207
- // Reset as we dont want other flows kicking it off again!
232
+ // Reset as we don't want other flows kicking it off again!
208
233
  config.createTransport = false;
209
234
  }
210
- let validateOutput;
211
- if (config.test === true) {
212
- validateOutput = yield (0, validate_1.validateBeforeDeploy)({
213
- appName: config.app.name,
214
- description: (_a = config.app.description) !== null && _a !== void 0 ? _a : '',
215
- package: (_b = config.app.package) !== null && _b !== void 0 ? _b : '',
216
- transport: (_c = config.app.transport) !== null && _c !== void 0 ? _c : '',
217
- client: (_d = config.target.client) !== null && _d !== void 0 ? _d : '',
218
- url: (_e = config.target.url) !== null && _e !== void 0 ? _e : ''
219
- }, provider, logger);
220
- if (!validateOutput.result) {
221
- logger.info(`Results of validating the deployment configuration settings:${(0, validate_1.formatSummary)(validateOutput.summary)}`);
235
+ // check if deployment of BSP is requested
236
+ if ((0, config_1.isBspConfig)(config.app)) {
237
+ if (config.test === true) {
238
+ const validateOutput = yield (0, validate_1.validateBeforeDeploy)(config, provider, logger);
239
+ if (!validateOutput.result) {
240
+ logger.info(`Results of validating the deployment configuration settings:${(0, validate_1.formatSummary)(validateOutput.summary)}`);
241
+ }
222
242
  }
243
+ const service = getDeployService(provider.getUi5AbapRepository.bind(provider), config, logger);
244
+ yield service.deploy({ archive, bsp: config.app, testMode: config.test, safeMode: config.safe });
245
+ }
246
+ else {
247
+ yield tryDeployToLrep(provider, config, logger, archive);
223
248
  }
224
- const service = getUi5AbapRepositoryService(provider, config, logger);
225
- yield service.deploy({ archive, bsp: config.app, testMode: config.test, safeMode: config.safe });
226
249
  if (config.test === true) {
227
250
  logger.info('Deployment in TestMode completed. A successful TestMode execution does not necessarily mean that your upload will be successful.');
228
251
  }
@@ -231,7 +254,7 @@ function tryDeploy(provider, config, logger, archive) {
231
254
  }
232
255
  }
233
256
  catch (error) {
234
- yield handleError("tryDeploy" /* TryCommands.Deploy */, error, provider, config, logger, archive);
257
+ yield handleError(tryDeploy, error, provider, config, logger, archive);
235
258
  }
236
259
  });
237
260
  }
@@ -247,7 +270,9 @@ function deploy(archive, config, logger) {
247
270
  if (config.keep) {
248
271
  (0, fs_1.writeFileSync)(`archive.zip`, archive);
249
272
  }
250
- yield runCommand("tryDeploy" /* TryCommands.Deploy */, config, logger, archive);
273
+ const provider = yield createProvider(config, logger);
274
+ logger.info(`Starting to deploy${config.test === true ? ' in test mode' : ''}.`);
275
+ yield tryDeploy(provider, config, logger, archive);
251
276
  });
252
277
  }
253
278
  exports.deploy = deploy;
@@ -265,8 +290,20 @@ function tryUndeploy(provider, config, logger) {
265
290
  config.app.transport = yield createTransportRequest(config, logger, provider);
266
291
  config.createTransport = false;
267
292
  }
268
- const service = getUi5AbapRepositoryService(provider, config, logger);
269
- yield service.undeploy({ bsp: config.app, testMode: config.test });
293
+ if (config.lrep) {
294
+ const service = getDeployService(provider.getLayeredRepository.bind(provider), config, logger);
295
+ yield service.undeploy({
296
+ namespace: config.lrep,
297
+ transport: config.app.transport
298
+ });
299
+ }
300
+ else if ((0, config_1.isBspConfig)(config.app)) {
301
+ const service = getDeployService(provider.getUi5AbapRepository.bind(provider), config, logger);
302
+ yield service.undeploy({ bsp: config.app, testMode: config.test });
303
+ }
304
+ else {
305
+ (0, config_1.throwConfigMissingError)('app-name');
306
+ }
270
307
  if (config.test === true) {
271
308
  logger.info('Undeployment in TestMode completed. A successful TestMode execution does not necessarily mean that your undeploy will be successful.');
272
309
  }
@@ -275,7 +312,7 @@ function tryUndeploy(provider, config, logger) {
275
312
  }
276
313
  }
277
314
  catch (error) {
278
- yield handleError("tryUndeploy" /* TryCommands.UnDeploy */, error, provider, config, logger, Buffer.from(''));
315
+ yield handleError(tryUndeploy, error, provider, config, logger, Buffer.from(''));
279
316
  }
280
317
  });
281
318
  }
@@ -287,7 +324,9 @@ function tryUndeploy(provider, config, logger) {
287
324
  */
288
325
  function undeploy(config, logger) {
289
326
  return __awaiter(this, void 0, void 0, function* () {
290
- yield runCommand("tryUndeploy" /* TryCommands.UnDeploy */, config, logger);
327
+ const provider = yield createProvider(config, logger);
328
+ logger.info(`Starting to undeploy ${config.test === true ? ' in test mode' : ''}.`);
329
+ yield tryUndeploy(provider, config, logger);
291
330
  });
292
331
  }
293
332
  exports.undeploy = undeploy;
@@ -1,5 +1,6 @@
1
1
  import type { AbapServiceProvider } from '@sap-ux/axios-extension';
2
2
  import type { Logger } from '@sap-ux/logger';
3
+ import type { AbapDeployConfig } from '../types';
3
4
  export type ValidationInputs = {
4
5
  appName: string;
5
6
  description: string;
@@ -36,12 +37,12 @@ export declare const summaryMessage: {
36
37
  /**
37
38
  * Validation of deploy configuration before running deploy-test.
38
39
  *
39
- * @param input Deploy configuration that needs to be validated
40
+ * @param config Deploy configuration that needs to be validated
40
41
  * @param provider AbapServiceProvider
41
42
  * @param logger Logger used by deploy tooling
42
43
  * @returns Validation result and a summary report of identified issues.
43
44
  */
44
- export declare function validateBeforeDeploy(input: ValidationInputs, provider: AbapServiceProvider, logger: Logger): Promise<ValidationOutput>;
45
+ export declare function validateBeforeDeploy(config: AbapDeployConfig, provider: AbapServiceProvider, logger: Logger): Promise<ValidationOutput>;
45
46
  /**
46
47
  * Format a list of summary records that is ready to be printed on the console.
47
48
  *
@@ -35,17 +35,26 @@ exports.summaryMessage = {
35
35
  /**
36
36
  * Validation of deploy configuration before running deploy-test.
37
37
  *
38
- * @param input Deploy configuration that needs to be validated
38
+ * @param config Deploy configuration that needs to be validated
39
39
  * @param provider AbapServiceProvider
40
40
  * @param logger Logger used by deploy tooling
41
41
  * @returns Validation result and a summary report of identified issues.
42
42
  */
43
- function validateBeforeDeploy(input, provider, logger) {
43
+ function validateBeforeDeploy(config, provider, logger) {
44
+ var _a, _b, _c, _d, _e, _f;
44
45
  return __awaiter(this, void 0, void 0, function* () {
45
46
  const output = {
46
47
  summary: [],
47
48
  result: true
48
49
  };
50
+ const input = {
51
+ appName: (_a = config.app.name) !== null && _a !== void 0 ? _a : '',
52
+ description: (_b = config.app.description) !== null && _b !== void 0 ? _b : '',
53
+ package: (_c = config.app.package) !== null && _c !== void 0 ? _c : '',
54
+ transport: (_d = config.app.transport) !== null && _d !== void 0 ? _d : '',
55
+ client: (_e = config.target.client) !== null && _e !== void 0 ? _e : '',
56
+ url: (_f = config.target.url) !== null && _f !== void 0 ? _f : ''
57
+ };
49
58
  // output is passed by reference and status updated during the internal pipeline below.
50
59
  yield validateInputTextFormat(input, output, provider, logger);
51
60
  yield validatePackageWithAdt(input, output, provider, logger);
@@ -185,6 +185,7 @@ function mergeConfig(taskConfig, options) {
185
185
  config.yes = mergeFlag(options.yes, taskConfig.yes);
186
186
  config.createTransport = mergeFlag(options.createTransport, taskConfig.createTransport);
187
187
  config.retry = process.env.NO_RETRY ? !process.env.NO_RETRY : mergeFlag(options.retry, taskConfig.retry);
188
+ config.lrep = options.lrep;
188
189
  if (!options.archiveUrl && !options.archivePath && !options.archiveFolder) {
189
190
  options.archiveFolder = 'dist';
190
191
  }
@@ -7,11 +7,11 @@ import { Command } from 'commander';
7
7
  */
8
8
  export declare function createCommand(name: 'deploy' | 'undeploy'): Command;
9
9
  /**
10
- * Function that is to be execute when the exposed deploy command is executed.
10
+ * Function that is to be executed when the exposed deploy command is executed.
11
11
  */
12
12
  export declare function runDeploy(): Promise<void>;
13
13
  /**
14
- * Function that is to be execute when the exposed undeploy command is executed.
14
+ * Function that is to be executed when the exposed undeploy command is executed.
15
15
  */
16
16
  export declare function runUndeploy(): Promise<void>;
17
17
  //# sourceMappingURL=index.d.ts.map
package/dist/cli/index.js CHANGED
@@ -35,7 +35,7 @@ function createCommand(name) {
35
35
  .addOption(new commander_1.Option('--url <target-url>', 'URL of target ABAP system').conflicts('destination'))
36
36
  .addOption(new commander_1.Option('--client <sap-client>', 'Client number of target ABAP system').conflicts('destination'))
37
37
  .addOption(new commander_1.Option('--cloud', 'Target is an ABAP Cloud system').conflicts('destination'))
38
- .addOption(new commander_1.Option('--service <service-path>', 'Target SAPUI5 Repository OData Service'))
38
+ .addOption(new commander_1.Option('--service <service-path>', 'Target alias for deployment service'))
39
39
  .addOption(new commander_1.Option('--cloud-service-key <file-location>', 'JSON file location with the ABAP cloud service key.').conflicts('destination'))
40
40
  .addOption(new commander_1.Option('--cloud-service-env', 'Read ABAP cloud service properties from environment variables or .env file').conflicts(['cloudServiceKey', 'destination']))
41
41
  .option('--package <abap-package>', 'Package name for deploy target ABAP system')
@@ -72,6 +72,9 @@ function createCommand(name) {
72
72
  'archivePath'
73
73
  ]));
74
74
  }
75
+ else if (name === 'undeploy') {
76
+ command.addOption(new commander_1.Option('--lrep <namespace>', 'Undeploy the given namespace from the layered repository (for adaptation projects)').conflicts(['test', 'name']));
77
+ }
75
78
  return command.version((0, config_1.getVersion)(), '-v, --version', 'version of the deploy tooling');
76
79
  }
77
80
  exports.createCommand = createCommand;
@@ -106,7 +109,7 @@ function prepareRun(cmd) {
106
109
  });
107
110
  }
108
111
  /**
109
- * Function that is to be execute when the exposed deploy command is executed.
112
+ * Function that is to be executed when the exposed deploy command is executed.
110
113
  */
111
114
  function runDeploy() {
112
115
  return __awaiter(this, void 0, void 0, function* () {
@@ -123,7 +126,7 @@ function runDeploy() {
123
126
  }
124
127
  exports.runDeploy = runDeploy;
125
128
  /**
126
- * Function that is to be execute when the exposed undeploy command is executed.
129
+ * Function that is to be executed when the exposed undeploy command is executed.
127
130
  */
128
131
  function runUndeploy() {
129
132
  return __awaiter(this, void 0, void 0, function* () {
@@ -43,6 +43,10 @@ export interface CommonOptions {
43
43
  * If set to true, a transport request will be created during deployment
44
44
  */
45
45
  createTransport?: boolean;
46
+ /**
47
+ * Optional layered repository namespace.
48
+ */
49
+ lrep?: string;
46
50
  }
47
51
  /**
48
52
  * Enhancing the target with an optional service property allowing to use an alias for the deployment service.
@@ -52,7 +56,7 @@ export type AbapTarget = BaseAbapTarget & {
52
56
  };
53
57
  export interface AbapDeployConfig extends CommonOptions {
54
58
  target: AbapTarget;
55
- app: BspConfig;
59
+ app: Partial<BspConfig>;
56
60
  credentials?: AxiosRequestConfig['auth'];
57
61
  exclude?: string[];
58
62
  }
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "bugs": {
10
10
  "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Adeploy-tooling"
11
11
  },
12
- "version": "0.10.2",
12
+ "version": "0.11.0",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",