@sap-ux/deploy-tooling 0.4.4 → 0.5.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.
package/README.md CHANGED
@@ -62,6 +62,8 @@ Options:
62
62
  --cloud target is an ABAP Cloud system
63
63
  --cloud-service-key <file-location> JSON file location with the ABAP cloud service key.
64
64
  --cloud-service-env Load ABAP cloud service properties from either a .env file or your environment variables. Secrets in your .env should not be committed to source control.
65
+ --username ABAP Service username
66
+ --password ABAP Service password
65
67
  --transport <transport-request> Transport number to record the change in the ABAP system
66
68
  --name <bsp-name> Project name of the app
67
69
  --strict-ssl Perform certificate validation (use --no-strict-ssl to deactivate it)
@@ -95,6 +97,8 @@ Options:
95
97
  --cloud target is an ABAP Cloud system
96
98
  --cloud-service-key <file-location> JSON file location with the ABAP cloud service key.
97
99
  --cloud-service-env Load ABAP cloud service properties from either a .env file or your environment variables
100
+ --username ABAP Service username
101
+ --password ABAP Service password
98
102
  --transport <transport-request> Transport number to record the change in the ABAP system
99
103
  --name <bsp-name> Project name of the app
100
104
  --strict-ssl Perform certificate validation (use --no-strict-ssl to deactivate it)
@@ -13,7 +13,7 @@ export declare function promptConfirmation(message: string): Promise<boolean>;
13
13
  * @param username - optional username that is to be offered as default
14
14
  * @returns credentials object with username/password
15
15
  */
16
- export declare function promptCredentials(username?: string): Promise<prompts.Answers<"password" | "username">>;
16
+ export declare function promptCredentials(username?: string): Promise<prompts.Answers<"username" | "password">>;
17
17
  /**
18
18
  * Prompt for the location of the service keys.
19
19
  *
@@ -145,6 +145,22 @@ function mergeTarget(baseTarget, options) {
145
145
  service: (_d = options.service) !== null && _d !== void 0 ? _d : baseTarget === null || baseTarget === void 0 ? void 0 : baseTarget.service
146
146
  };
147
147
  }
148
+ /**
149
+ * Merge CLI and environment credentials.
150
+ *
151
+ * @param taskConfig - base configuration from the file
152
+ * @param options - CLI options
153
+ * @returns merged credentials
154
+ */
155
+ function mergeCredentials(taskConfig, options) {
156
+ var _a, _b, _c, _d;
157
+ let credentials = taskConfig.credentials;
158
+ // Support CLI params and|or dotenv file
159
+ if (options.username || process.env.SERVICE_USERNAME) {
160
+ credentials = Object.assign(Object.assign({}, (credentials !== null && credentials !== void 0 ? credentials : {})), { username: (_b = (_a = options.username) !== null && _a !== void 0 ? _a : process.env.SERVICE_USERNAME) !== null && _b !== void 0 ? _b : '', password: (_d = (_c = options.password) !== null && _c !== void 0 ? _c : process.env.SERVICE_PASSWORD) !== null && _d !== void 0 ? _d : '' });
161
+ }
162
+ return credentials;
163
+ }
148
164
  /**
149
165
  * Merge the configuration from the ui5*.yaml with CLI options.
150
166
  *
@@ -162,7 +178,7 @@ function mergeConfig(taskConfig, options) {
162
178
  transport: (_g = options.transport) !== null && _g !== void 0 ? _g : (_h = taskConfig.app) === null || _h === void 0 ? void 0 : _h.transport
163
179
  };
164
180
  const target = mergeTarget(taskConfig.target, options);
165
- const config = { app, target, credentials: taskConfig.credentials };
181
+ const config = { app, target, credentials: mergeCredentials(taskConfig, options) };
166
182
  config.test = mergeFlag(options.test, taskConfig.test);
167
183
  config.safe = mergeFlag(options.safe, taskConfig.safe);
168
184
  config.keep = mergeFlag(options.keep, taskConfig.keep);
package/dist/cli/index.js CHANGED
@@ -39,6 +39,16 @@ function createCommand(name) {
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('--transport <transport-request>', 'Transport number to record the change in the ABAP system')
42
+ .addOption(new commander_1.Option('--username <username>', 'ABAP System username').conflicts([
43
+ 'cloudServiceKey',
44
+ 'cloudServiceEnv',
45
+ 'destination'
46
+ ]))
47
+ .addOption(new commander_1.Option('--password <password>', 'ABAP System password').conflicts([
48
+ 'cloudServiceKey',
49
+ 'cloudServiceEnv',
50
+ 'destination'
51
+ ]))
42
52
  .option('--name <bsp-name>', 'Project name of the app')
43
53
  .option('--strict-ssl', 'Perform certificate validation (use --no-strict-ssl to deactivate it)')
44
54
  .option('--query-params <param1=value&param2=value>', 'Additional parameters that are to be added to calls to the target.')
@@ -64,5 +64,7 @@ export interface CliOptions extends Partial<BspConfig>, Partial<DestinationAbapT
64
64
  cloudServiceKey?: string;
65
65
  queryParams?: string;
66
66
  cloudServiceEnv?: boolean;
67
+ username?: string;
68
+ password?: string;
67
69
  }
68
70
  //# sourceMappingURL=index.d.ts.map
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.4.4",
12
+ "version": "0.5.0",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",
@@ -31,7 +31,7 @@
31
31
  "dotenv": "16.0.0",
32
32
  "prompts": "2.4.2",
33
33
  "yazl": "2.5.1",
34
- "@sap-ux/axios-extension": "1.3.6",
34
+ "@sap-ux/axios-extension": "1.4.0",
35
35
  "@sap-ux/btp-utils": "0.11.7",
36
36
  "@sap-ux/logger": "0.3.7",
37
37
  "@sap-ux/store": "0.3.12",