@adobe/aio-cli-plugin-app 14.4.2 → 14.5.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.
- package/README.md +30 -30
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
- package/src/lib/defaults.js +1 -0
- package/src/lib/import-helper.js +23 -0
- package/src/lib/import.js +20 -4
package/README.md
CHANGED
|
@@ -75,7 +75,7 @@ DESCRIPTION
|
|
|
75
75
|
Create, run, test, and deploy Adobe I/O Apps
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
-
_See code: [src/commands/app/index.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
78
|
+
_See code: [src/commands/app/index.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.5.1/src/commands/app/index.js)_
|
|
79
79
|
|
|
80
80
|
## `aio app add`
|
|
81
81
|
|
|
@@ -94,7 +94,7 @@ DESCRIPTION
|
|
|
94
94
|
Add a new component to an existing Adobe I/O App
|
|
95
95
|
```
|
|
96
96
|
|
|
97
|
-
_See code: [src/commands/app/add/index.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
97
|
+
_See code: [src/commands/app/add/index.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.5.1/src/commands/app/add/index.js)_
|
|
98
98
|
|
|
99
99
|
## `aio app add action`
|
|
100
100
|
|
|
@@ -120,7 +120,7 @@ ALIASES
|
|
|
120
120
|
$ aio app add actions
|
|
121
121
|
```
|
|
122
122
|
|
|
123
|
-
_See code: [src/commands/app/add/action.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
123
|
+
_See code: [src/commands/app/add/action.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.5.1/src/commands/app/add/action.js)_
|
|
124
124
|
|
|
125
125
|
## `aio app add ci`
|
|
126
126
|
|
|
@@ -139,7 +139,7 @@ DESCRIPTION
|
|
|
139
139
|
Add CI files
|
|
140
140
|
```
|
|
141
141
|
|
|
142
|
-
_See code: [src/commands/app/add/ci.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
142
|
+
_See code: [src/commands/app/add/ci.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.5.1/src/commands/app/add/ci.js)_
|
|
143
143
|
|
|
144
144
|
## `aio app add event`
|
|
145
145
|
|
|
@@ -165,7 +165,7 @@ ALIASES
|
|
|
165
165
|
$ aio app add events
|
|
166
166
|
```
|
|
167
167
|
|
|
168
|
-
_See code: [src/commands/app/add/event.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
168
|
+
_See code: [src/commands/app/add/event.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.5.1/src/commands/app/add/event.js)_
|
|
169
169
|
|
|
170
170
|
## `aio app add extension`
|
|
171
171
|
|
|
@@ -192,7 +192,7 @@ ALIASES
|
|
|
192
192
|
$ aio app add extensions
|
|
193
193
|
```
|
|
194
194
|
|
|
195
|
-
_See code: [src/commands/app/add/extension.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
195
|
+
_See code: [src/commands/app/add/extension.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.5.1/src/commands/app/add/extension.js)_
|
|
196
196
|
|
|
197
197
|
## `aio app add service`
|
|
198
198
|
|
|
@@ -217,7 +217,7 @@ ALIASES
|
|
|
217
217
|
$ aio app add services
|
|
218
218
|
```
|
|
219
219
|
|
|
220
|
-
_See code: [src/commands/app/add/service.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
220
|
+
_See code: [src/commands/app/add/service.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.5.1/src/commands/app/add/service.js)_
|
|
221
221
|
|
|
222
222
|
## `aio app add web-assets`
|
|
223
223
|
|
|
@@ -239,7 +239,7 @@ DESCRIPTION
|
|
|
239
239
|
Add web assets support
|
|
240
240
|
```
|
|
241
241
|
|
|
242
|
-
_See code: [src/commands/app/add/web-assets.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
242
|
+
_See code: [src/commands/app/add/web-assets.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.5.1/src/commands/app/add/web-assets.js)_
|
|
243
243
|
|
|
244
244
|
## `aio app build`
|
|
245
245
|
|
|
@@ -270,7 +270,7 @@ DESCRIPTION
|
|
|
270
270
|
Use the --force-build flag to force a build even if one already exists.
|
|
271
271
|
```
|
|
272
272
|
|
|
273
|
-
_See code: [src/commands/app/build.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
273
|
+
_See code: [src/commands/app/build.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.5.1/src/commands/app/build.js)_
|
|
274
274
|
|
|
275
275
|
## `aio app clean`
|
|
276
276
|
|
|
@@ -296,7 +296,7 @@ DESCRIPTION
|
|
|
296
296
|
Note that this will require a full rebuild on your next build command.
|
|
297
297
|
```
|
|
298
298
|
|
|
299
|
-
_See code: [src/commands/app/clean.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
299
|
+
_See code: [src/commands/app/clean.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.5.1/src/commands/app/clean.js)_
|
|
300
300
|
|
|
301
301
|
## `aio app create [PATH]`
|
|
302
302
|
|
|
@@ -319,7 +319,7 @@ DESCRIPTION
|
|
|
319
319
|
Create a new Adobe I/O App with default parameters
|
|
320
320
|
```
|
|
321
321
|
|
|
322
|
-
_See code: [src/commands/app/create.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
322
|
+
_See code: [src/commands/app/create.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.5.1/src/commands/app/create.js)_
|
|
323
323
|
|
|
324
324
|
## `aio app delete`
|
|
325
325
|
|
|
@@ -338,7 +338,7 @@ DESCRIPTION
|
|
|
338
338
|
Delete a component from an existing Adobe I/O App
|
|
339
339
|
```
|
|
340
340
|
|
|
341
|
-
_See code: [src/commands/app/delete/index.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
341
|
+
_See code: [src/commands/app/delete/index.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.5.1/src/commands/app/delete/index.js)_
|
|
342
342
|
|
|
343
343
|
## `aio app delete action [ACTION-NAME]`
|
|
344
344
|
|
|
@@ -365,7 +365,7 @@ ALIASES
|
|
|
365
365
|
$ aio app delete actions
|
|
366
366
|
```
|
|
367
367
|
|
|
368
|
-
_See code: [src/commands/app/delete/action.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
368
|
+
_See code: [src/commands/app/delete/action.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.5.1/src/commands/app/delete/action.js)_
|
|
369
369
|
|
|
370
370
|
## `aio app delete ci`
|
|
371
371
|
|
|
@@ -385,7 +385,7 @@ DESCRIPTION
|
|
|
385
385
|
Delete existing CI files
|
|
386
386
|
```
|
|
387
387
|
|
|
388
|
-
_See code: [src/commands/app/delete/ci.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
388
|
+
_See code: [src/commands/app/delete/ci.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.5.1/src/commands/app/delete/ci.js)_
|
|
389
389
|
|
|
390
390
|
## `aio app delete extension`
|
|
391
391
|
|
|
@@ -412,7 +412,7 @@ ALIASES
|
|
|
412
412
|
$ aio app delete extensions
|
|
413
413
|
```
|
|
414
414
|
|
|
415
|
-
_See code: [src/commands/app/delete/extension.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
415
|
+
_See code: [src/commands/app/delete/extension.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.5.1/src/commands/app/delete/extension.js)_
|
|
416
416
|
|
|
417
417
|
## `aio app delete service`
|
|
418
418
|
|
|
@@ -437,7 +437,7 @@ ALIASES
|
|
|
437
437
|
$ aio app delete services
|
|
438
438
|
```
|
|
439
439
|
|
|
440
|
-
_See code: [src/commands/app/delete/service.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
440
|
+
_See code: [src/commands/app/delete/service.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.5.1/src/commands/app/delete/service.js)_
|
|
441
441
|
|
|
442
442
|
## `aio app delete web-assets`
|
|
443
443
|
|
|
@@ -457,7 +457,7 @@ DESCRIPTION
|
|
|
457
457
|
Delete existing web assets
|
|
458
458
|
```
|
|
459
459
|
|
|
460
|
-
_See code: [src/commands/app/delete/web-assets.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
460
|
+
_See code: [src/commands/app/delete/web-assets.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.5.1/src/commands/app/delete/web-assets.js)_
|
|
461
461
|
|
|
462
462
|
## `aio app deploy`
|
|
463
463
|
|
|
@@ -504,7 +504,7 @@ DESCRIPTION
|
|
|
504
504
|
Use the --force-deploy flag to force deploy changes, regardless of production Workspace being published in Exchange.
|
|
505
505
|
```
|
|
506
506
|
|
|
507
|
-
_See code: [src/commands/app/deploy.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
507
|
+
_See code: [src/commands/app/deploy.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.5.1/src/commands/app/deploy.js)_
|
|
508
508
|
|
|
509
509
|
## `aio app get-url [ACTION]`
|
|
510
510
|
|
|
@@ -527,7 +527,7 @@ DESCRIPTION
|
|
|
527
527
|
Get action URLs
|
|
528
528
|
```
|
|
529
529
|
|
|
530
|
-
_See code: [src/commands/app/get-url.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
530
|
+
_See code: [src/commands/app/get-url.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.5.1/src/commands/app/get-url.js)_
|
|
531
531
|
|
|
532
532
|
## `aio app info`
|
|
533
533
|
|
|
@@ -550,7 +550,7 @@ DESCRIPTION
|
|
|
550
550
|
Display settings/configuration in use by an Adobe I/O App
|
|
551
551
|
```
|
|
552
552
|
|
|
553
|
-
_See code: [src/commands/app/info.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
553
|
+
_See code: [src/commands/app/info.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.5.1/src/commands/app/info.js)_
|
|
554
554
|
|
|
555
555
|
## `aio app init [PATH]`
|
|
556
556
|
|
|
@@ -594,7 +594,7 @@ DESCRIPTION
|
|
|
594
594
|
Create a new Adobe I/O App
|
|
595
595
|
```
|
|
596
596
|
|
|
597
|
-
_See code: [src/commands/app/init.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
597
|
+
_See code: [src/commands/app/init.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.5.1/src/commands/app/init.js)_
|
|
598
598
|
|
|
599
599
|
## `aio app install PATH`
|
|
600
600
|
|
|
@@ -619,7 +619,7 @@ DESCRIPTION
|
|
|
619
619
|
This command will support installing apps packaged by 'aio app pack'.
|
|
620
620
|
```
|
|
621
621
|
|
|
622
|
-
_See code: [src/commands/app/install.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
622
|
+
_See code: [src/commands/app/install.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.5.1/src/commands/app/install.js)_
|
|
623
623
|
|
|
624
624
|
## `aio app list`
|
|
625
625
|
|
|
@@ -638,7 +638,7 @@ DESCRIPTION
|
|
|
638
638
|
List components for Adobe I/O App
|
|
639
639
|
```
|
|
640
640
|
|
|
641
|
-
_See code: [src/commands/app/list/index.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
641
|
+
_See code: [src/commands/app/list/index.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.5.1/src/commands/app/list/index.js)_
|
|
642
642
|
|
|
643
643
|
## `aio app list extension`
|
|
644
644
|
|
|
@@ -664,7 +664,7 @@ ALIASES
|
|
|
664
664
|
$ aio app list extensions
|
|
665
665
|
```
|
|
666
666
|
|
|
667
|
-
_See code: [src/commands/app/list/extension.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
667
|
+
_See code: [src/commands/app/list/extension.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.5.1/src/commands/app/list/extension.js)_
|
|
668
668
|
|
|
669
669
|
## `aio app logs`
|
|
670
670
|
|
|
@@ -689,7 +689,7 @@ DESCRIPTION
|
|
|
689
689
|
Fetch logs for an Adobe I/O App
|
|
690
690
|
```
|
|
691
691
|
|
|
692
|
-
_See code: [src/commands/app/logs.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
692
|
+
_See code: [src/commands/app/logs.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.5.1/src/commands/app/logs.js)_
|
|
693
693
|
|
|
694
694
|
## `aio app pack [PATH]`
|
|
695
695
|
|
|
@@ -714,7 +714,7 @@ DESCRIPTION
|
|
|
714
714
|
This command will support packaging apps for redistribution.
|
|
715
715
|
```
|
|
716
716
|
|
|
717
|
-
_See code: [src/commands/app/pack.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
717
|
+
_See code: [src/commands/app/pack.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.5.1/src/commands/app/pack.js)_
|
|
718
718
|
|
|
719
719
|
## `aio app run`
|
|
720
720
|
|
|
@@ -738,7 +738,7 @@ DESCRIPTION
|
|
|
738
738
|
Run an Adobe I/O App
|
|
739
739
|
```
|
|
740
740
|
|
|
741
|
-
_See code: [src/commands/app/run.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
741
|
+
_See code: [src/commands/app/run.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.5.1/src/commands/app/run.js)_
|
|
742
742
|
|
|
743
743
|
## `aio app test`
|
|
744
744
|
|
|
@@ -768,7 +768,7 @@ DESCRIPTION
|
|
|
768
768
|
If the extension has a hook called 'test' in its 'ext.config.yaml', the script specified will be run instead.
|
|
769
769
|
```
|
|
770
770
|
|
|
771
|
-
_See code: [src/commands/app/test.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
771
|
+
_See code: [src/commands/app/test.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.5.1/src/commands/app/test.js)_
|
|
772
772
|
|
|
773
773
|
## `aio app undeploy`
|
|
774
774
|
|
|
@@ -794,7 +794,7 @@ DESCRIPTION
|
|
|
794
794
|
Undeploys an Adobe I/O App
|
|
795
795
|
```
|
|
796
796
|
|
|
797
|
-
_See code: [src/commands/app/undeploy.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
797
|
+
_See code: [src/commands/app/undeploy.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.5.1/src/commands/app/undeploy.js)_
|
|
798
798
|
|
|
799
799
|
## `aio app use [CONFIG_FILE_PATH]`
|
|
800
800
|
|
|
@@ -842,5 +842,5 @@ DESCRIPTION
|
|
|
842
842
|
page in https://developer.adobe.com/console/
|
|
843
843
|
```
|
|
844
844
|
|
|
845
|
-
_See code: [src/commands/app/use.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.
|
|
845
|
+
_See code: [src/commands/app/use.js](https://github.com/adobe/aio-cli-plugin-app/blob/14.5.1/src/commands/app/use.js)_
|
|
846
846
|
<!-- commandsstop -->
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
package/src/lib/defaults.js
CHANGED
|
@@ -22,6 +22,7 @@ module.exports = {
|
|
|
22
22
|
defaultImageCacheDuration: '604800',
|
|
23
23
|
AIO_CONFIG_IMS_ORG_ID: 'project.org.ims_org_id',
|
|
24
24
|
SERVICE_API_KEY_ENV: 'SERVICE_API_KEY',
|
|
25
|
+
IMS_OAUTH_S2S_ENV: 'IMS_OAUTH_S2S',
|
|
25
26
|
ENTP_INT_CERTS_FOLDER: 'entp-int-certs',
|
|
26
27
|
CONSOLE_API_KEYS: {
|
|
27
28
|
prod: 'aio-cli-console-auth',
|
package/src/lib/import-helper.js
CHANGED
|
@@ -734,8 +734,31 @@ const getProjectCredentialType = (projectConfig, flags) => {
|
|
|
734
734
|
return LibConsoleCLI.OAUTH_SERVER_TO_SERVER_CREDENTIAL
|
|
735
735
|
}
|
|
736
736
|
|
|
737
|
+
/**
|
|
738
|
+
* Get the OAuth server_to_server credential in IMS API format, from the console config.
|
|
739
|
+
*
|
|
740
|
+
* @param {object} config Console config object
|
|
741
|
+
* @returns {{ client_id, client_secret, org_id, scopes } | undefined} OAuthS2S credential or undefined
|
|
742
|
+
*/
|
|
743
|
+
const getOAuthS2SCredential = (config) => {
|
|
744
|
+
const credential = config?.project?.workspace?.details?.credentials
|
|
745
|
+
?.find(c => c.integration_type === 'oauth_server_to_server')
|
|
746
|
+
?.oauth_server_to_server
|
|
747
|
+
const imsOrgId = config?.project?.org?.ims_org_id
|
|
748
|
+
|
|
749
|
+
if (credential) {
|
|
750
|
+
return {
|
|
751
|
+
client_id: credential.client_id,
|
|
752
|
+
client_secret: credential.client_secrets[0], // take the first secret
|
|
753
|
+
org_id: imsOrgId,
|
|
754
|
+
scopes: credential.scopes
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
|
|
737
759
|
module.exports = {
|
|
738
760
|
getServiceApiKey,
|
|
761
|
+
getOAuthS2SCredential,
|
|
739
762
|
writeFile,
|
|
740
763
|
loadConfigFile,
|
|
741
764
|
loadAndValidateConfigFile,
|
package/src/lib/import.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const { loadAndValidateConfigFile, importConfigJson, loadConfigFile, getServiceApiKey } = require('./import-helper')
|
|
2
|
-
const { SERVICE_API_KEY_ENV } = require('./defaults')
|
|
1
|
+
const { loadAndValidateConfigFile, importConfigJson, loadConfigFile, getServiceApiKey, getOAuthS2SCredential } = require('./import-helper')
|
|
2
|
+
const { SERVICE_API_KEY_ENV, IMS_OAUTH_S2S_ENV } = require('./defaults')
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Imports the project's console config to the local environment.
|
|
@@ -22,8 +22,24 @@ async function importConsoleConfig (consoleConfigFileOrBuffer, flags) {
|
|
|
22
22
|
const loadFunc = skipValidation ? loadConfigFile : loadAndValidateConfigFile
|
|
23
23
|
const config = loadFunc(consoleConfigFileOrBuffer).values
|
|
24
24
|
|
|
25
|
-
const serviceClientId = getServiceApiKey(config, useJwt)
|
|
26
|
-
const
|
|
25
|
+
const serviceClientId = getServiceApiKey(config, useJwt) // = client_id, legacy
|
|
26
|
+
const oauthS2SCredential = getOAuthS2SCredential(config)
|
|
27
|
+
|
|
28
|
+
let extraEnvVars
|
|
29
|
+
if (typeof oauthS2SCredential === 'object') {
|
|
30
|
+
// unpack oauthS2S json into IMS_OAUTH_S2S_* env vars
|
|
31
|
+
const oauthS2SEnv = Object.entries(oauthS2SCredential).reduce((acc, [key, value]) => {
|
|
32
|
+
if (Array.isArray(value)) {
|
|
33
|
+
value = JSON.stringify(value) // stringify arrays e.g. scopes to be consistent with AIO_* vars behavior
|
|
34
|
+
}
|
|
35
|
+
acc[`${IMS_OAUTH_S2S_ENV}_${key.toUpperCase()}`] = value
|
|
36
|
+
return acc
|
|
37
|
+
}, {})
|
|
38
|
+
|
|
39
|
+
extraEnvVars = { [SERVICE_API_KEY_ENV]: serviceClientId, ...oauthS2SEnv }
|
|
40
|
+
} else {
|
|
41
|
+
extraEnvVars = { [SERVICE_API_KEY_ENV]: serviceClientId }
|
|
42
|
+
}
|
|
27
43
|
|
|
28
44
|
await importConfigJson(consoleConfigFileOrBuffer, process.cwd(), { interactive, overwrite, merge, useJwt }, extraEnvVars)
|
|
29
45
|
return config
|