@affinidi/cli 2.0.0-beta.9 → 2.0.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 +138 -54
- package/dist/commands/generate/app.d.ts +5 -0
- package/dist/commands/generate/app.js +54 -59
- package/dist/commands/generate/app.js.map +1 -1
- package/dist/commands/iam/add-principal.js +8 -9
- package/dist/commands/iam/add-principal.js.map +1 -1
- package/dist/commands/iam/get-policies.js +8 -9
- package/dist/commands/iam/get-policies.js.map +1 -1
- package/dist/commands/iam/list-principals.js +1 -2
- package/dist/commands/iam/list-principals.js.map +1 -1
- package/dist/commands/iam/remove-principal.js +8 -9
- package/dist/commands/iam/remove-principal.js.map +1 -1
- package/dist/commands/iam/update-policies.js +18 -17
- package/dist/commands/iam/update-policies.js.map +1 -1
- package/dist/commands/login/add-user-to-group.d.ts +1 -1
- package/dist/commands/login/add-user-to-group.js +9 -10
- package/dist/commands/login/add-user-to-group.js.map +1 -1
- package/dist/commands/login/create-config.js +13 -14
- package/dist/commands/login/create-config.js.map +1 -1
- package/dist/commands/login/create-group.js +3 -4
- package/dist/commands/login/create-group.js.map +1 -1
- package/dist/commands/login/delete-config.js +5 -6
- package/dist/commands/login/delete-config.js.map +1 -1
- package/dist/commands/login/delete-group.js +5 -6
- package/dist/commands/login/delete-group.js.map +1 -1
- package/dist/commands/login/export-configs.d.ts +10 -0
- package/dist/commands/login/export-configs.js +67 -0
- package/dist/commands/login/export-configs.js.map +1 -0
- package/dist/commands/login/export-groups.d.ts +10 -0
- package/dist/commands/login/export-groups.js +64 -0
- package/dist/commands/login/export-groups.js.map +1 -0
- package/dist/commands/login/get-config.js +5 -6
- package/dist/commands/login/get-config.js.map +1 -1
- package/dist/commands/login/get-group.js +5 -6
- package/dist/commands/login/get-group.js.map +1 -1
- package/dist/commands/login/import-configs.d.ts +12 -0
- package/dist/commands/login/import-configs.js +70 -0
- package/dist/commands/login/import-configs.js.map +1 -0
- package/dist/commands/login/import-groups.d.ts +12 -0
- package/dist/commands/login/import-groups.js +51 -0
- package/dist/commands/login/import-groups.js.map +1 -0
- package/dist/commands/login/list-configs.js +1 -2
- package/dist/commands/login/list-configs.js.map +1 -1
- package/dist/commands/login/list-groups.js +1 -2
- package/dist/commands/login/list-groups.js.map +1 -1
- package/dist/commands/login/list-users-in-group.js +5 -6
- package/dist/commands/login/list-users-in-group.js.map +1 -1
- package/dist/commands/login/remove-user-from-group.d.ts +2 -2
- package/dist/commands/login/remove-user-from-group.js +10 -11
- package/dist/commands/login/remove-user-from-group.js.map +1 -1
- package/dist/commands/login/update-config.js +11 -12
- package/dist/commands/login/update-config.js.map +1 -1
- package/dist/commands/project/create-project.js +8 -9
- package/dist/commands/project/create-project.js.map +1 -1
- package/dist/commands/project/get-active-project.js +5 -6
- package/dist/commands/project/get-active-project.js.map +1 -1
- package/dist/commands/project/list-projects.js +2 -3
- package/dist/commands/project/list-projects.js.map +1 -1
- package/dist/commands/project/select-project.js +13 -20
- package/dist/commands/project/select-project.js.map +1 -1
- package/dist/commands/start.d.ts +0 -3
- package/dist/commands/start.js +17 -22
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/stop.js +5 -4
- package/dist/commands/stop.js.map +1 -1
- package/dist/commands/token/create-token.d.ts +2 -2
- package/dist/commands/token/create-token.js +8 -9
- package/dist/commands/token/create-token.js.map +1 -1
- package/dist/commands/token/delete-token.js +5 -6
- package/dist/commands/token/delete-token.js.map +1 -1
- package/dist/commands/token/get-token.d.ts +2 -2
- package/dist/commands/token/get-token.js +5 -6
- package/dist/commands/token/get-token.js.map +1 -1
- package/dist/commands/token/list-tokens.d.ts +2 -2
- package/dist/commands/token/list-tokens.js +3 -4
- package/dist/commands/token/list-tokens.js.map +1 -1
- package/dist/commands/token/update-token.d.ts +2 -2
- package/dist/commands/token/update-token.js +8 -9
- package/dist/commands/token/update-token.js.map +1 -1
- package/dist/commands/whoami.d.ts +1 -4
- package/dist/commands/whoami.js +5 -22
- package/dist/commands/whoami.js.map +1 -1
- package/dist/common/constants.d.ts +5 -11
- package/dist/common/constants.js +7 -15
- package/dist/common/constants.js.map +1 -1
- package/dist/{helpers/generate-error-message.js → common/error-messages.js} +1 -1
- package/dist/common/error-messages.js.map +1 -0
- package/dist/{helpers/prompt-required-flags.js → common/prompts.js} +5 -5
- package/dist/common/prompts.js.map +1 -0
- package/dist/{helpers/input-length-validation.d.ts → common/validators.d.ts} +1 -1
- package/dist/{helpers/input-length-validation.js → common/validators.js} +4 -4
- package/dist/common/validators.js.map +1 -0
- package/dist/helpers/app.d.ts +11 -1
- package/dist/helpers/app.js +84 -10
- package/dist/helpers/app.js.map +1 -1
- package/dist/services/affinidi/auth/auth-result-page.d.ts +1 -0
- package/dist/services/affinidi/auth/{providers/error-login-page.js → auth-result-page.js} +6 -7
- package/dist/services/affinidi/auth/auth-result-page.js.map +1 -0
- package/dist/services/affinidi/auth/bff-auth-provider.d.ts +26 -0
- package/dist/services/affinidi/auth/bff-auth-provider.js +133 -0
- package/dist/services/affinidi/auth/bff-auth-provider.js.map +1 -0
- package/dist/services/affinidi/auth/{providers/types.d.ts → types.d.ts} +1 -4
- package/dist/services/affinidi/auth/types.js.map +1 -0
- package/dist/services/affinidi/bff-service.d.ts +27 -0
- package/dist/services/affinidi/bff-service.js +141 -0
- package/dist/services/affinidi/bff-service.js.map +1 -0
- package/dist/services/affinidi/bff-service.types.d.ts +38 -0
- package/dist/services/affinidi/{config.js → bff-service.types.js} +1 -1
- package/dist/services/affinidi/bff-service.types.js.map +1 -0
- package/dist/services/affinidi/{errors/index.js → errors.js} +6 -3
- package/dist/services/affinidi/errors.js.map +1 -0
- package/dist/services/affinidi/iam/iam.api.d.ts +120 -105
- package/dist/services/affinidi/iam/iam.api.js +39 -118
- package/dist/services/affinidi/iam/iam.api.js.map +1 -1
- package/dist/services/affinidi/iam/index.d.ts +15 -15
- package/dist/services/affinidi/iam/index.js +34 -118
- package/dist/services/affinidi/iam/index.js.map +1 -1
- package/dist/services/affinidi/logger/console-logger-adapter.js.map +1 -0
- package/dist/services/affinidi/logger/index.js.map +1 -0
- package/dist/services/affinidi/logger/logger-adapter.js.map +1 -0
- package/dist/services/affinidi/vp-adapter/index.d.ts +12 -12
- package/dist/services/affinidi/vp-adapter/index.js +37 -70
- package/dist/services/affinidi/vp-adapter/index.js.map +1 -1
- package/dist/services/affinidi/vp-adapter/vp-adapter.api.d.ts +314 -54
- package/dist/services/affinidi/vp-adapter/vp-adapter.api.js +81 -15
- package/dist/services/affinidi/vp-adapter/vp-adapter.api.js.map +1 -1
- package/dist/services/credentials-vault.d.ts +19 -0
- package/dist/services/credentials-vault.js +33 -0
- package/dist/services/credentials-vault.js.map +1 -0
- package/dist/services/env-config.d.ts +35 -0
- package/dist/services/env-config.js +39 -0
- package/dist/services/env-config.js.map +1 -0
- package/package.json +6 -15
- package/dist/helpers/generate-error-message.js.map +0 -1
- package/dist/helpers/index.d.ts +0 -3
- package/dist/helpers/index.js +0 -11
- package/dist/helpers/index.js.map +0 -1
- package/dist/helpers/input-length-validation.js.map +0 -1
- package/dist/helpers/prompt-required-flags.js.map +0 -1
- package/dist/hooks/check/check-version.d.ts +0 -17
- package/dist/hooks/check/check-version.js +0 -24
- package/dist/hooks/check/check-version.js.map +0 -1
- package/dist/services/affinidi/adapters/index.d.ts +0 -1
- package/dist/services/affinidi/adapters/index.js +0 -5
- package/dist/services/affinidi/adapters/index.js.map +0 -1
- package/dist/services/affinidi/adapters/logger/console-logger-adapter.js.map +0 -1
- package/dist/services/affinidi/adapters/logger/index.js.map +0 -1
- package/dist/services/affinidi/adapters/logger/logger-adapter.js.map +0 -1
- package/dist/services/affinidi/auth/index.d.ts +0 -62
- package/dist/services/affinidi/auth/index.js +0 -131
- package/dist/services/affinidi/auth/index.js.map +0 -1
- package/dist/services/affinidi/auth/providers/config.d.ts +0 -15
- package/dist/services/affinidi/auth/providers/config.js +0 -33
- package/dist/services/affinidi/auth/providers/config.js.map +0 -1
- package/dist/services/affinidi/auth/providers/error-login-page.d.ts +0 -1
- package/dist/services/affinidi/auth/providers/error-login-page.js.map +0 -1
- package/dist/services/affinidi/auth/providers/index.d.ts +0 -3
- package/dist/services/affinidi/auth/providers/index.js +0 -8
- package/dist/services/affinidi/auth/providers/index.js.map +0 -1
- package/dist/services/affinidi/auth/providers/ory-pkce.d.ts +0 -47
- package/dist/services/affinidi/auth/providers/ory-pkce.js +0 -216
- package/dist/services/affinidi/auth/providers/ory-pkce.js.map +0 -1
- package/dist/services/affinidi/auth/providers/ory.d.ts +0 -22
- package/dist/services/affinidi/auth/providers/ory.js +0 -154
- package/dist/services/affinidi/auth/providers/ory.js.map +0 -1
- package/dist/services/affinidi/auth/providers/successful-login-page.d.ts +0 -1
- package/dist/services/affinidi/auth/providers/successful-login-page.js +0 -110
- package/dist/services/affinidi/auth/providers/successful-login-page.js.map +0 -1
- package/dist/services/affinidi/auth/providers/types.js.map +0 -1
- package/dist/services/affinidi/auth/token.d.ts +0 -54
- package/dist/services/affinidi/auth/token.js +0 -121
- package/dist/services/affinidi/auth/token.js.map +0 -1
- package/dist/services/affinidi/config.d.ts +0 -12
- package/dist/services/affinidi/config.js.map +0 -1
- package/dist/services/affinidi/errors/index.js.map +0 -1
- package/dist/services/affinidi/index.d.ts +0 -24
- package/dist/services/affinidi/index.js +0 -52
- package/dist/services/affinidi/index.js.map +0 -1
- package/dist/services/config/index.d.ts +0 -36
- package/dist/services/config/index.js +0 -160
- package/dist/services/config/index.js.map +0 -1
- package/dist/services/index.d.ts +0 -1
- package/dist/services/index.js +0 -6
- package/dist/services/index.js.map +0 -1
- package/dist/services/urls.d.ts +0 -2
- package/dist/services/urls.js +0 -12
- package/dist/services/urls.js.map +0 -1
- /package/dist/{helpers/generate-error-message.d.ts → common/error-messages.d.ts} +0 -0
- /package/dist/{helpers/prompt-required-flags.d.ts → common/prompts.d.ts} +0 -0
- /package/dist/services/affinidi/auth/{providers/types.js → types.js} +0 -0
- /package/dist/services/affinidi/{errors/index.d.ts → errors.d.ts} +0 -0
- /package/dist/services/affinidi/{adapters/logger → logger}/console-logger-adapter.d.ts +0 -0
- /package/dist/services/affinidi/{adapters/logger → logger}/console-logger-adapter.js +0 -0
- /package/dist/services/affinidi/{adapters/logger → logger}/index.d.ts +0 -0
- /package/dist/services/affinidi/{adapters/logger → logger}/index.js +0 -0
- /package/dist/services/affinidi/{adapters/logger → logger}/logger-adapter.d.ts +0 -0
- /package/dist/services/affinidi/{adapters/logger → logger}/logger-adapter.js +0 -0
package/README.md
CHANGED
|
@@ -11,10 +11,10 @@ Affinidi CLI is a developer tool to easily manage your projects and integration
|
|
|
11
11
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
14
|
-
Install the latest
|
|
14
|
+
Install the latest version of Affinidi CLI
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
npm install -g @affinidi/cli
|
|
17
|
+
npm install -g @affinidi/cli
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
Uninstall the Affinidi CLI
|
|
@@ -23,9 +23,15 @@ Uninstall the Affinidi CLI
|
|
|
23
23
|
npm uninstall -g @affinidi/cli
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
+
Update the Affinidi CLI
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm update -g @affinidi/cli
|
|
30
|
+
```
|
|
31
|
+
|
|
26
32
|
## What can I do with Affinidi CLI?
|
|
27
33
|
|
|
28
|
-
Affinidi CLI is all you need to interact and consume Affinidi services. Optionally you can also use [Affinidi Portal](https://portal.affinidi.com
|
|
34
|
+
Affinidi CLI is all you need to interact and consume Affinidi services. Optionally you can also use [Affinidi Portal](https://portal.affinidi.com) or call Affinidi APIs directly.
|
|
29
35
|
|
|
30
36
|
### Set up Affinidi Login for your applications
|
|
31
37
|
|
|
@@ -248,13 +254,12 @@ When you authenticate to Affinidi, the first project is set as your active one b
|
|
|
248
254
|
|
|
249
255
|
### Session and configuration files
|
|
250
256
|
|
|
251
|
-
When you authenticate to Affinidi with
|
|
257
|
+
When you authenticate to Affinidi with affinidi start the CLI will create a folder with a credentials file in your home directory.
|
|
252
258
|
|
|
253
|
-
`~/.affinidi/
|
|
259
|
+
`~/.affinidi/credentials-v2.json` - Stores your current session credentials. Keep it secret as this allows you to call Affinidi services.
|
|
254
260
|
|
|
255
|
-
|
|
261
|
+
When you run affinidi stop your session information is deleted.
|
|
256
262
|
|
|
257
|
-
When you run `affinidi stop` your session information is deleted.
|
|
258
263
|
|
|
259
264
|
## Support & Feedback
|
|
260
265
|
|
|
@@ -264,10 +269,6 @@ If you have a technical issue with the CLI's codebase, you can also [create an i
|
|
|
264
269
|
|
|
265
270
|
## FAQ
|
|
266
271
|
|
|
267
|
-
### A note from Affinidi
|
|
268
|
-
|
|
269
|
-
Affinidi CLI is currently in the open beta phase and we are refining our product every day. The Affinidi CLI may be incomplete and may contain errors – they may be unstable and may cause a loss of functionality and data. Use of the Affinidi CLI will be at your own risk. As our engineers seek to improve our platform, we would not have the resources to provide any maintenance or tech support at this time. Please bear with us as we continue to improve the platform.
|
|
270
|
-
|
|
271
272
|
### What can I develop?
|
|
272
273
|
|
|
273
274
|
You are only limited by your imagination! Affinidi CLI is a toolbox with which you can build software applications for personal or commercial use.
|
|
@@ -288,7 +289,7 @@ Some of our components would also require you to incorporate our end-user notice
|
|
|
288
289
|
|
|
289
290
|
### Is Affinidi CLI free for use?
|
|
290
291
|
|
|
291
|
-
Affinidi CLI is free
|
|
292
|
+
Affinidi CLI itself is free, so come onboard and experiment with our tools and see what you can build! We may bill for certain components in the future, but we will inform you beforehand.
|
|
292
293
|
|
|
293
294
|
### Is there any limit or cap to my usage of the Affinidi CLI?
|
|
294
295
|
|
|
@@ -326,8 +327,12 @@ Please note that this FAQ is provided for informational purposes only and is not
|
|
|
326
327
|
* [`affinidi login create-group`](#affinidi-login-create-group)
|
|
327
328
|
* [`affinidi login delete-config`](#affinidi-login-delete-config)
|
|
328
329
|
* [`affinidi login delete-group`](#affinidi-login-delete-group)
|
|
330
|
+
* [`affinidi login export-configs`](#affinidi-login-export-configs)
|
|
331
|
+
* [`affinidi login export-groups`](#affinidi-login-export-groups)
|
|
329
332
|
* [`affinidi login get-config`](#affinidi-login-get-config)
|
|
330
333
|
* [`affinidi login get-group`](#affinidi-login-get-group)
|
|
334
|
+
* [`affinidi login import-configs`](#affinidi-login-import-configs)
|
|
335
|
+
* [`affinidi login import-groups`](#affinidi-login-import-groups)
|
|
331
336
|
* [`affinidi login list-configs`](#affinidi-login-list-configs)
|
|
332
337
|
* [`affinidi login list-groups`](#affinidi-login-list-groups)
|
|
333
338
|
* [`affinidi login list-users-in-group`](#affinidi-login-list-users-in-group)
|
|
@@ -412,20 +417,17 @@ _See code: [@oclif/plugin-commands](https://github.com/oclif/plugin-commands/blo
|
|
|
412
417
|
|
|
413
418
|
## `affinidi generate app`
|
|
414
419
|
|
|
415
|
-
Generates a
|
|
420
|
+
Generates a reference application that integrates Affinidi Login. Requires git
|
|
416
421
|
|
|
417
422
|
```
|
|
418
423
|
USAGE
|
|
419
|
-
$ affinidi generate app [--json] [--no-color] [--no-input] [-f
|
|
420
|
-
[--force]
|
|
424
|
+
$ affinidi generate app [--json] [--no-color] [--no-input] [-f <value>] [-a <value>] [-p <value>] [--force]
|
|
421
425
|
|
|
422
426
|
FLAGS
|
|
423
|
-
-a, --provider=<
|
|
424
|
-
|
|
425
|
-
-
|
|
426
|
-
|
|
427
|
-
-p, --path=<value> Relative or absolute path where reference application should be cloned into
|
|
428
|
-
--force Override destination directory if exists
|
|
427
|
+
-a, --provider=<value> Authentication provider for the reference app
|
|
428
|
+
-f, --framework=<value> Framework for the reference app
|
|
429
|
+
-p, --path=<value> Relative or absolute path where reference application should be cloned into
|
|
430
|
+
--force Override destination directory if exists
|
|
429
431
|
|
|
430
432
|
GLOBAL FLAGS
|
|
431
433
|
--json Format output as json.
|
|
@@ -466,12 +468,12 @@ Adds a principal (user or token) to the active project
|
|
|
466
468
|
|
|
467
469
|
```
|
|
468
470
|
USAGE
|
|
469
|
-
$ affinidi iam add-principal [--json] [--no-color] [--no-input] [-i <value>] [-t
|
|
471
|
+
$ affinidi iam add-principal [--json] [--no-color] [--no-input] [-i <value>] [-t token|user]
|
|
470
472
|
|
|
471
473
|
FLAGS
|
|
472
474
|
-i, --principal-id=<value> ID of the principal
|
|
473
475
|
-t, --principal-type=<option> Type of the principal
|
|
474
|
-
<options:
|
|
476
|
+
<options: token|user>
|
|
475
477
|
|
|
476
478
|
GLOBAL FLAGS
|
|
477
479
|
--json Format output as json.
|
|
@@ -486,7 +488,7 @@ DESCRIPTION
|
|
|
486
488
|
EXAMPLES
|
|
487
489
|
$ affinidi iam add-principal -i <uuid>
|
|
488
490
|
|
|
489
|
-
$ affinidi iam add-principal --principal-id <uuid> --principal-type
|
|
491
|
+
$ affinidi iam add-principal --principal-id <uuid> --principal-type token
|
|
490
492
|
|
|
491
493
|
FLAG DESCRIPTIONS
|
|
492
494
|
-i, --principal-id=<value> ID of the principal
|
|
@@ -500,12 +502,12 @@ Gets the policies of a principal (user or token)
|
|
|
500
502
|
|
|
501
503
|
```
|
|
502
504
|
USAGE
|
|
503
|
-
$ affinidi iam get-policies [--json] [--no-color] [--no-input] [-i <value>] [-t
|
|
505
|
+
$ affinidi iam get-policies [--json] [--no-color] [--no-input] [-i <value>] [-t token|user]
|
|
504
506
|
|
|
505
507
|
FLAGS
|
|
506
508
|
-i, --principal-id=<value> ID of the principal
|
|
507
509
|
-t, --principal-type=<option> Type of the principal
|
|
508
|
-
<options:
|
|
510
|
+
<options: token|user>
|
|
509
511
|
|
|
510
512
|
GLOBAL FLAGS
|
|
511
513
|
--json Format output as json.
|
|
@@ -521,7 +523,7 @@ DESCRIPTION
|
|
|
521
523
|
EXAMPLES
|
|
522
524
|
$ affinidi iam get-policies -i <uuid>
|
|
523
525
|
|
|
524
|
-
$ affinidi iam get-policies --principal-id <uuid> --principal-type
|
|
526
|
+
$ affinidi iam get-policies --principal-id <uuid> --principal-type token
|
|
525
527
|
|
|
526
528
|
FLAG DESCRIPTIONS
|
|
527
529
|
-i, --principal-id=<value> ID of the principal
|
|
@@ -557,12 +559,12 @@ Removes a principal (user or token) from the active project
|
|
|
557
559
|
|
|
558
560
|
```
|
|
559
561
|
USAGE
|
|
560
|
-
$ affinidi iam remove-principal [--json] [--no-color] [--no-input] [-i <value>] [-t
|
|
562
|
+
$ affinidi iam remove-principal [--json] [--no-color] [--no-input] [-i <value>] [-t token|user]
|
|
561
563
|
|
|
562
564
|
FLAGS
|
|
563
565
|
-i, --principal-id=<value> ID of the principal
|
|
564
566
|
-t, --principal-type=<option> Type of the principal
|
|
565
|
-
<options:
|
|
567
|
+
<options: token|user>
|
|
566
568
|
|
|
567
569
|
GLOBAL FLAGS
|
|
568
570
|
--json Format output as json.
|
|
@@ -577,7 +579,7 @@ DESCRIPTION
|
|
|
577
579
|
EXAMPLES
|
|
578
580
|
$ affinidi iam remove-principal -i <uuid>
|
|
579
581
|
|
|
580
|
-
$ affinidi iam remove-principal --principal-id <uuid> --principal-type
|
|
582
|
+
$ affinidi iam remove-principal --principal-id <uuid> --principal-type token
|
|
581
583
|
|
|
582
584
|
FLAG DESCRIPTIONS
|
|
583
585
|
-i, --principal-id=<value> ID of the principal
|
|
@@ -591,13 +593,13 @@ Updates the policies of a principal (user or token) in the active project
|
|
|
591
593
|
|
|
592
594
|
```
|
|
593
595
|
USAGE
|
|
594
|
-
$ affinidi iam update-policies [--json] [--no-color] [--no-input] [-i <value>] [-t
|
|
596
|
+
$ affinidi iam update-policies [--json] [--no-color] [--no-input] [-i <value>] [-t token|user] [-f <value>]
|
|
595
597
|
|
|
596
598
|
FLAGS
|
|
597
599
|
-f, --file=<value> Location of a json file containing principal policies
|
|
598
600
|
-i, --principal-id=<value> ID of the principal
|
|
599
601
|
-t, --principal-type=<option> Type of the principal
|
|
600
|
-
<options:
|
|
602
|
+
<options: token|user>
|
|
601
603
|
|
|
602
604
|
GLOBAL FLAGS
|
|
603
605
|
--json Format output as json.
|
|
@@ -613,7 +615,7 @@ DESCRIPTION
|
|
|
613
615
|
EXAMPLES
|
|
614
616
|
$ affinidi iam update-policies -i <uuid>
|
|
615
617
|
|
|
616
|
-
$ affinidi iam update-policies --principal-id <uuid> --principal-type
|
|
618
|
+
$ affinidi iam update-policies --principal-id <uuid> --principal-type token --file policies.json
|
|
617
619
|
|
|
618
620
|
FLAG DESCRIPTIONS
|
|
619
621
|
-i, --principal-id=<value> ID of the principal
|
|
@@ -627,11 +629,11 @@ Adds a user to a user group
|
|
|
627
629
|
|
|
628
630
|
```
|
|
629
631
|
USAGE
|
|
630
|
-
$ affinidi login add-user-to-group [--json] [--no-color] [--no-input] [--group-name <value>] [--user-
|
|
632
|
+
$ affinidi login add-user-to-group [--json] [--no-color] [--no-input] [--group-name <value>] [--user-id <value>]
|
|
631
633
|
|
|
632
634
|
FLAGS
|
|
633
635
|
--group-name=<value> Name of the user group
|
|
634
|
-
--user-
|
|
636
|
+
--user-id=<value> Id of the user. Currently the user's DID is supported.
|
|
635
637
|
|
|
636
638
|
GLOBAL FLAGS
|
|
637
639
|
--json Format output as json.
|
|
@@ -639,7 +641,7 @@ GLOBAL FLAGS
|
|
|
639
641
|
--no-input Disables all the interactive prompts
|
|
640
642
|
|
|
641
643
|
EXAMPLES
|
|
642
|
-
$ affinidi login add-user-to-group --group-name my_group --user-
|
|
644
|
+
$ affinidi login add-user-to-group --group-name my_group --user-id did:key:12345
|
|
643
645
|
```
|
|
644
646
|
|
|
645
647
|
## `affinidi login create-config`
|
|
@@ -757,6 +759,52 @@ EXAMPLES
|
|
|
757
759
|
$ affinidi login delete-group --name my_group
|
|
758
760
|
```
|
|
759
761
|
|
|
762
|
+
## `affinidi login export-configs`
|
|
763
|
+
|
|
764
|
+
Export selected login configurations of your active project
|
|
765
|
+
|
|
766
|
+
```
|
|
767
|
+
USAGE
|
|
768
|
+
$ affinidi login export-configs [--json] [--no-color] [--no-input] [-i <value>] [-p <value>]
|
|
769
|
+
|
|
770
|
+
FLAGS
|
|
771
|
+
-i, --ids=<value> IDs of the login configurations to export, separated by space
|
|
772
|
+
-p, --path=<value> Relative or absolute path where configurations should be exported
|
|
773
|
+
|
|
774
|
+
GLOBAL FLAGS
|
|
775
|
+
--json Format output as json.
|
|
776
|
+
--no-color Disables color in the output. If you have trouble distinguishing colors, consider using this flag.
|
|
777
|
+
--no-input Disables all the interactive prompts
|
|
778
|
+
|
|
779
|
+
EXAMPLES
|
|
780
|
+
$ affinidi login export-configs
|
|
781
|
+
|
|
782
|
+
$ affinidi login export-configs --ids "configurationId1 configurationId2" --path "../my-configs.json"
|
|
783
|
+
```
|
|
784
|
+
|
|
785
|
+
## `affinidi login export-groups`
|
|
786
|
+
|
|
787
|
+
Export selected user groups with its users
|
|
788
|
+
|
|
789
|
+
```
|
|
790
|
+
USAGE
|
|
791
|
+
$ affinidi login export-groups [--json] [--no-color] [--no-input] [-n <value>] [-p <value>]
|
|
792
|
+
|
|
793
|
+
FLAGS
|
|
794
|
+
-n, --names=<value> Group names to export, separated by space
|
|
795
|
+
-p, --path=<value> Relative or absolute path where user groups should be exported
|
|
796
|
+
|
|
797
|
+
GLOBAL FLAGS
|
|
798
|
+
--json Format output as json.
|
|
799
|
+
--no-color Disables color in the output. If you have trouble distinguishing colors, consider using this flag.
|
|
800
|
+
--no-input Disables all the interactive prompts
|
|
801
|
+
|
|
802
|
+
EXAMPLES
|
|
803
|
+
$ affinidi login export-groups
|
|
804
|
+
|
|
805
|
+
$ affinidi login export-groups --names "groupName1 groupName2" --path "../my-user-groups.json"
|
|
806
|
+
```
|
|
807
|
+
|
|
760
808
|
## `affinidi login get-config`
|
|
761
809
|
|
|
762
810
|
Gets the details of a login configuration in your active project
|
|
@@ -801,6 +849,50 @@ EXAMPLES
|
|
|
801
849
|
$ affinidi login get-group --name my_group
|
|
802
850
|
```
|
|
803
851
|
|
|
852
|
+
## `affinidi login import-configs`
|
|
853
|
+
|
|
854
|
+
Import login configurations in your active project
|
|
855
|
+
|
|
856
|
+
```
|
|
857
|
+
USAGE
|
|
858
|
+
$ affinidi login import-configs [--json] [--no-color] [--no-input] [-p <value>]
|
|
859
|
+
|
|
860
|
+
FLAGS
|
|
861
|
+
-p, --path=<value> Path to file with configurations that should be imported
|
|
862
|
+
|
|
863
|
+
GLOBAL FLAGS
|
|
864
|
+
--json Format output as json.
|
|
865
|
+
--no-color Disables color in the output. If you have trouble distinguishing colors, consider using this flag.
|
|
866
|
+
--no-input Disables all the interactive prompts
|
|
867
|
+
|
|
868
|
+
EXAMPLES
|
|
869
|
+
$ affinidi login import-configs
|
|
870
|
+
|
|
871
|
+
$ affinidi login import-configs --path "../my-configs.json"
|
|
872
|
+
```
|
|
873
|
+
|
|
874
|
+
## `affinidi login import-groups`
|
|
875
|
+
|
|
876
|
+
Import groups with its users
|
|
877
|
+
|
|
878
|
+
```
|
|
879
|
+
USAGE
|
|
880
|
+
$ affinidi login import-groups [--json] [--no-color] [--no-input] [-p <value>]
|
|
881
|
+
|
|
882
|
+
FLAGS
|
|
883
|
+
-p, --path=<value> Path to file with groups that should be imported
|
|
884
|
+
|
|
885
|
+
GLOBAL FLAGS
|
|
886
|
+
--json Format output as json.
|
|
887
|
+
--no-color Disables color in the output. If you have trouble distinguishing colors, consider using this flag.
|
|
888
|
+
--no-input Disables all the interactive prompts
|
|
889
|
+
|
|
890
|
+
EXAMPLES
|
|
891
|
+
$ affinidi login import-groups
|
|
892
|
+
|
|
893
|
+
$ affinidi login import-groups --path "../my-groups.json"
|
|
894
|
+
```
|
|
895
|
+
|
|
804
896
|
## `affinidi login list-configs`
|
|
805
897
|
|
|
806
898
|
Lists login configurations in your active project
|
|
@@ -861,12 +953,11 @@ Removes a user from a user group
|
|
|
861
953
|
|
|
862
954
|
```
|
|
863
955
|
USAGE
|
|
864
|
-
$ affinidi login remove-user-from-group [--json] [--no-color] [--no-input] [--group-name <value>] [--user-
|
|
865
|
-
<value>]
|
|
956
|
+
$ affinidi login remove-user-from-group [--json] [--no-color] [--no-input] [--group-name <value>] [--user-id <value>]
|
|
866
957
|
|
|
867
958
|
FLAGS
|
|
868
|
-
--group-name=<value>
|
|
869
|
-
--user-
|
|
959
|
+
--group-name=<value> Name of the user group
|
|
960
|
+
--user-id=<value> ID of the user
|
|
870
961
|
|
|
871
962
|
GLOBAL FLAGS
|
|
872
963
|
--json Format output as json.
|
|
@@ -874,7 +965,7 @@ GLOBAL FLAGS
|
|
|
874
965
|
--no-input Disables all the interactive prompts
|
|
875
966
|
|
|
876
967
|
EXAMPLES
|
|
877
|
-
$ affinidi login remove-user-from-group --group-name my_group --user-
|
|
968
|
+
$ affinidi login remove-user-from-group --group-name my_group --user-id did:key:12345
|
|
878
969
|
```
|
|
879
970
|
|
|
880
971
|
## `affinidi login update-config`
|
|
@@ -925,7 +1016,7 @@ FLAG DESCRIPTIONS
|
|
|
925
1016
|
|
|
926
1017
|
## `affinidi project create-project`
|
|
927
1018
|
|
|
928
|
-
Creates a project
|
|
1019
|
+
Creates a project and sets it as the active project
|
|
929
1020
|
|
|
930
1021
|
```
|
|
931
1022
|
USAGE
|
|
@@ -1026,10 +1117,7 @@ Log in to Affinidi
|
|
|
1026
1117
|
|
|
1027
1118
|
```
|
|
1028
1119
|
USAGE
|
|
1029
|
-
$ affinidi start [--json] [--no-color] [--no-input]
|
|
1030
|
-
|
|
1031
|
-
FLAGS
|
|
1032
|
-
-i, --project-id=<value> ID of the project to set as active
|
|
1120
|
+
$ affinidi start [--json] [--no-color] [--no-input]
|
|
1033
1121
|
|
|
1034
1122
|
GLOBAL FLAGS
|
|
1035
1123
|
--json Format output as json.
|
|
@@ -1038,13 +1126,9 @@ GLOBAL FLAGS
|
|
|
1038
1126
|
|
|
1039
1127
|
EXAMPLES
|
|
1040
1128
|
$ affinidi start
|
|
1041
|
-
|
|
1042
|
-
$ affinidi start -i <project-id>
|
|
1043
|
-
|
|
1044
|
-
$ affinidi start --project-id <project-id>
|
|
1045
1129
|
```
|
|
1046
1130
|
|
|
1047
|
-
_See code: [dist/commands/start.ts](https://github.com/affinidi/affinidi-cli/blob/v2.0.0-beta.
|
|
1131
|
+
_See code: [dist/commands/start.ts](https://github.com/affinidi/affinidi-cli/blob/v2.0.0-beta.12/dist/commands/start.ts)_
|
|
1048
1132
|
|
|
1049
1133
|
## `affinidi stop`
|
|
1050
1134
|
|
|
@@ -1063,7 +1147,7 @@ EXAMPLES
|
|
|
1063
1147
|
$ affinidi stop
|
|
1064
1148
|
```
|
|
1065
1149
|
|
|
1066
|
-
_See code: [dist/commands/stop.ts](https://github.com/affinidi/affinidi-cli/blob/v2.0.0-beta.
|
|
1150
|
+
_See code: [dist/commands/stop.ts](https://github.com/affinidi/affinidi-cli/blob/v2.0.0-beta.12/dist/commands/stop.ts)_
|
|
1067
1151
|
|
|
1068
1152
|
## `affinidi token create-token`
|
|
1069
1153
|
|
|
@@ -1183,7 +1267,7 @@ EXAMPLES
|
|
|
1183
1267
|
|
|
1184
1268
|
## `affinidi whoami`
|
|
1185
1269
|
|
|
1186
|
-
Returns user's subject and
|
|
1270
|
+
Returns user's subject, projects, and token details from the current session.
|
|
1187
1271
|
|
|
1188
1272
|
```
|
|
1189
1273
|
USAGE
|
|
@@ -1198,5 +1282,5 @@ EXAMPLES
|
|
|
1198
1282
|
$ affinidi whoami
|
|
1199
1283
|
```
|
|
1200
1284
|
|
|
1201
|
-
_See code: [dist/commands/whoami.ts](https://github.com/affinidi/affinidi-cli/blob/v2.0.0-beta.
|
|
1285
|
+
_See code: [dist/commands/whoami.ts](https://github.com/affinidi/affinidi-cli/blob/v2.0.0-beta.12/dist/commands/whoami.ts)_
|
|
1202
1286
|
<!-- commandsstop -->
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { BaseCommand } from '../../common';
|
|
2
2
|
export default class GenerateApp extends BaseCommand<typeof GenerateApp> {
|
|
3
|
+
static apps: any;
|
|
4
|
+
static providers: string[];
|
|
5
|
+
static frameworks: string[];
|
|
6
|
+
static libraries: Map<string, string[]>;
|
|
3
7
|
static summary: string;
|
|
4
8
|
static examples: string[];
|
|
5
9
|
static flags: {
|
|
@@ -8,5 +12,6 @@ export default class GenerateApp extends BaseCommand<typeof GenerateApp> {
|
|
|
8
12
|
path: import("@oclif/core/lib/interfaces/parser").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
13
|
force: import("@oclif/core/lib/interfaces/parser").BooleanFlag<boolean>;
|
|
10
14
|
};
|
|
15
|
+
init(): Promise<void>;
|
|
11
16
|
run(): Promise<void>;
|
|
12
17
|
}
|
|
@@ -7,29 +7,46 @@ const core_1 = require("@oclif/core");
|
|
|
7
7
|
const errors_1 = require("@oclif/core/lib/errors");
|
|
8
8
|
const zod_1 = tslib_1.__importDefault(require("zod"));
|
|
9
9
|
const common_1 = require("../../common");
|
|
10
|
-
const
|
|
10
|
+
const error_messages_1 = require("../../common/error-messages");
|
|
11
|
+
const prompts_2 = require("../../common/prompts");
|
|
12
|
+
const validators_1 = require("../../common/validators");
|
|
11
13
|
const app_1 = require("../../helpers/app");
|
|
12
14
|
const degit_1 = require("../../helpers/degit");
|
|
13
|
-
const generate_error_message_1 = require("../../helpers/generate-error-message");
|
|
14
|
-
const input_length_validation_1 = require("../../helpers/input-length-validation");
|
|
15
|
-
const affinidi_1 = require("../../services/affinidi");
|
|
16
15
|
const vp_adapter_1 = require("../../services/affinidi/vp-adapter");
|
|
17
16
|
const auth0_1 = require("../../services/generator/auth0");
|
|
18
17
|
const env_configurer_1 = require("../../services/generator/env-configurer");
|
|
18
|
+
const APPS_INFORMATION_GITHUB_LOCATION = 'samples/apps.json';
|
|
19
19
|
const APPS_GITHUB_LOCATION = 'affinidi/reference-app-affinidi-vault/samples';
|
|
20
20
|
class GenerateApp extends common_1.BaseCommand {
|
|
21
|
+
async init() {
|
|
22
|
+
GenerateApp.apps = await (0, app_1.getApps)(APPS_INFORMATION_GITHUB_LOCATION);
|
|
23
|
+
const { providers, frameworks, libraries } = (0, app_1.getSupportedAppsInformation)(GenerateApp.apps);
|
|
24
|
+
GenerateApp.providers = providers;
|
|
25
|
+
GenerateApp.frameworks = frameworks;
|
|
26
|
+
GenerateApp.libraries = libraries;
|
|
27
|
+
GenerateApp.flags.framework = core_1.Flags.string({
|
|
28
|
+
char: 'f',
|
|
29
|
+
summary: 'Framework for the reference app',
|
|
30
|
+
options: frameworks,
|
|
31
|
+
});
|
|
32
|
+
GenerateApp.flags.provider = core_1.Flags.string({
|
|
33
|
+
char: 'a',
|
|
34
|
+
summary: 'Authentication provider for the reference app',
|
|
35
|
+
options: providers,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
21
38
|
async run() {
|
|
22
39
|
const { flags } = await this.parse(GenerateApp);
|
|
23
40
|
if (flags['no-input']) {
|
|
24
41
|
if (!flags.provider)
|
|
25
|
-
throw new errors_1.CLIError((0,
|
|
42
|
+
throw new errors_1.CLIError((0, error_messages_1.giveFlagInputErrorMessage)('provider'));
|
|
26
43
|
if (!flags.framework)
|
|
27
|
-
throw new errors_1.CLIError((0,
|
|
44
|
+
throw new errors_1.CLIError((0, error_messages_1.giveFlagInputErrorMessage)('framework'));
|
|
28
45
|
}
|
|
29
46
|
const provider = flags.provider ??
|
|
30
47
|
(await (0, prompts_1.select)({
|
|
31
48
|
message: 'Select the provider for the reference app.',
|
|
32
|
-
choices:
|
|
49
|
+
choices: GenerateApp.providers.map((value) => ({
|
|
33
50
|
name: value,
|
|
34
51
|
value,
|
|
35
52
|
})),
|
|
@@ -37,21 +54,21 @@ class GenerateApp extends common_1.BaseCommand {
|
|
|
37
54
|
const framework = flags.framework ??
|
|
38
55
|
(await (0, prompts_1.select)({
|
|
39
56
|
message: 'Select the framework for the reference app.',
|
|
40
|
-
choices:
|
|
57
|
+
choices: GenerateApp.frameworks.map((value) => ({
|
|
41
58
|
name: value,
|
|
42
59
|
value,
|
|
43
60
|
})),
|
|
44
61
|
}));
|
|
45
|
-
const promptFlags = await (0,
|
|
62
|
+
const promptFlags = await (0, prompts_2.promptRequiredParameters)(['path'], flags);
|
|
46
63
|
promptFlags.framework = framework;
|
|
47
64
|
promptFlags.provider = provider;
|
|
48
65
|
const schema = zod_1.default.object({
|
|
49
|
-
path: zod_1.default.string().max(
|
|
50
|
-
framework: zod_1.default.string().max(
|
|
51
|
-
provider: zod_1.default.string().max(
|
|
66
|
+
path: zod_1.default.string().max(validators_1.INPUT_LIMIT),
|
|
67
|
+
framework: zod_1.default.string().max(validators_1.INPUT_LIMIT),
|
|
68
|
+
provider: zod_1.default.string().max(validators_1.INPUT_LIMIT),
|
|
52
69
|
});
|
|
53
70
|
const validatedFlags = schema.parse(promptFlags);
|
|
54
|
-
const appName = (0, app_1.getAppName)(framework, provider);
|
|
71
|
+
const appName = (0, app_1.getAppName)(framework, provider, GenerateApp.libraries);
|
|
55
72
|
core_1.ux.action.start('Generating reference application');
|
|
56
73
|
await (0, degit_1.cloneWithDegit)(`${APPS_GITHUB_LOCATION}/${appName}`, validatedFlags.path, flags.force);
|
|
57
74
|
core_1.ux.action.stop('Generated successfully!');
|
|
@@ -61,62 +78,40 @@ class GenerateApp extends common_1.BaseCommand {
|
|
|
61
78
|
});
|
|
62
79
|
if (configure) {
|
|
63
80
|
core_1.ux.action.start('Fetching available login configurations');
|
|
64
|
-
const configs = await vp_adapter_1.vpAdapterService.listLoginConfigurations(
|
|
81
|
+
const configs = await vp_adapter_1.vpAdapterService.listLoginConfigurations();
|
|
65
82
|
core_1.ux.action.stop('Fetched successfully!');
|
|
66
83
|
const choices = configs.configurations.map((config) => ({
|
|
67
84
|
value: {
|
|
68
|
-
id: config.
|
|
85
|
+
id: config.configurationId,
|
|
69
86
|
auth: config.auth,
|
|
70
87
|
},
|
|
71
|
-
name: `${config.name} [id: ${config.
|
|
88
|
+
name: `${config.name} [id: ${config.configurationId}]`,
|
|
72
89
|
}));
|
|
73
90
|
const selectedConfig = await (0, prompts_1.select)({
|
|
74
91
|
message: 'Select a login configuration to use in your reference application',
|
|
75
92
|
choices,
|
|
76
93
|
});
|
|
77
|
-
const clientSecret = (0,
|
|
94
|
+
const clientSecret = (0, validators_1.validateInputLength)(await (0, password_1.default)({
|
|
78
95
|
message: "What is the login configuration's client secret?",
|
|
79
96
|
mask: true,
|
|
80
|
-
}),
|
|
81
|
-
if (
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
core_1.ux.action.stop('Configured successfully!');
|
|
86
|
-
}
|
|
87
|
-
else if (provider === common_1.RefAppProvider.AUTH0) {
|
|
88
|
-
const domain = (0, input_length_validation_1.validateInputLength)(await (0, prompts_1.input)({ message: 'What is your Auth0 tenant URL?' }), input_length_validation_1.INPUT_LIMIT);
|
|
89
|
-
const accessToken = (0, input_length_validation_1.validateInputLength)(await (0, password_1.default)({ message: 'What is your Auth0 access token?' }), input_length_validation_1.TOKEN_LIMIT);
|
|
90
|
-
core_1.ux.action.start('Creating Auth0 resources and configuring reference application');
|
|
91
|
-
const socialConnectionName = `Affinidi-${common_1.RefAppFramework.NEXTJS}`;
|
|
92
|
-
const { auth0ClientId, auth0ClientSecret, connectionName } = await (0, auth0_1.createAuth0Resources)(accessToken, domain, selectedConfig.auth.clientId, clientSecret, selectedConfig.auth.issuer, socialConnectionName, {
|
|
93
|
-
callbackUrl: 'http://localhost:3000/api/auth/callback/auth0',
|
|
94
|
-
logOutUrl: 'http://localhost:3000',
|
|
95
|
-
webOriginUrl: 'http://localhost:3000',
|
|
96
|
-
});
|
|
97
|
-
await (0, env_configurer_1.configureAppEnvironment)(validatedFlags.path, auth0ClientId, auth0ClientSecret, domain, connectionName);
|
|
98
|
-
core_1.ux.action.stop('Configured successfully!');
|
|
99
|
-
}
|
|
97
|
+
}), validators_1.INPUT_LIMIT);
|
|
98
|
+
if (provider === common_1.RefAppProvider.AFFINIDI) {
|
|
99
|
+
core_1.ux.action.start('Configuring reference application');
|
|
100
|
+
await (0, env_configurer_1.configureAppEnvironment)(validatedFlags.path, selectedConfig.auth.clientId, clientSecret, selectedConfig.auth.issuer);
|
|
101
|
+
core_1.ux.action.stop('Configured successfully!');
|
|
100
102
|
}
|
|
101
|
-
else if (
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
callbackUrl: 'http://localhost:8000/callback',
|
|
114
|
-
logOutUrl: 'http://localhost:8000',
|
|
115
|
-
webOriginUrl: 'http://localhost:8000',
|
|
116
|
-
});
|
|
117
|
-
await (0, env_configurer_1.configureAppEnvironment)(validatedFlags.path, auth0ClientId, auth0ClientSecret, domain);
|
|
118
|
-
core_1.ux.action.stop('Configured successfully!');
|
|
119
|
-
}
|
|
103
|
+
else if (provider === common_1.RefAppProvider.AUTH0) {
|
|
104
|
+
const domain = (0, validators_1.validateInputLength)(await (0, prompts_1.input)({ message: 'What is your Auth0 tenant URL?' }), validators_1.INPUT_LIMIT);
|
|
105
|
+
const accessToken = (0, validators_1.validateInputLength)(await (0, password_1.default)({ message: 'What is your Auth0 access token?' }), validators_1.TOKEN_LIMIT);
|
|
106
|
+
core_1.ux.action.start('Creating Auth0 resources and configuring reference application');
|
|
107
|
+
const socialConnectionName = `Affinidi-${framework}`;
|
|
108
|
+
const { auth0ClientId, auth0ClientSecret, connectionName } = await (0, auth0_1.createAuth0Resources)(accessToken, domain, selectedConfig.auth.clientId, clientSecret, selectedConfig.auth.issuer, socialConnectionName, {
|
|
109
|
+
callbackUrl: GenerateApp.apps.appName.redirectUris.callbackUrl,
|
|
110
|
+
logOutUrl: GenerateApp.apps.appName.redirectUris.logOutUrl,
|
|
111
|
+
webOriginUrl: GenerateApp.apps.appName.redirectUris.webOriginUrl,
|
|
112
|
+
});
|
|
113
|
+
await (0, env_configurer_1.configureAppEnvironment)(validatedFlags.path, auth0ClientId, auth0ClientSecret, domain, connectionName);
|
|
114
|
+
core_1.ux.action.stop('Configured successfully!');
|
|
120
115
|
}
|
|
121
116
|
}
|
|
122
117
|
}
|
|
@@ -124,7 +119,9 @@ class GenerateApp extends common_1.BaseCommand {
|
|
|
124
119
|
}
|
|
125
120
|
}
|
|
126
121
|
exports.default = GenerateApp;
|
|
127
|
-
GenerateApp.
|
|
122
|
+
GenerateApp.providers = [];
|
|
123
|
+
GenerateApp.frameworks = [];
|
|
124
|
+
GenerateApp.summary = 'Generates a reference application that integrates Affinidi Login. Requires git';
|
|
128
125
|
GenerateApp.examples = [
|
|
129
126
|
'<%= config.bin %> <%= command.id %>',
|
|
130
127
|
'<%= config.bin %> <%= command.id %> -p "../my-app" -f django -a affinidi',
|
|
@@ -134,12 +131,10 @@ GenerateApp.flags = {
|
|
|
134
131
|
framework: core_1.Flags.string({
|
|
135
132
|
char: 'f',
|
|
136
133
|
summary: 'Framework for the reference app',
|
|
137
|
-
options: Object.values(common_1.RefAppFramework),
|
|
138
134
|
}),
|
|
139
135
|
provider: core_1.Flags.string({
|
|
140
136
|
char: 'a',
|
|
141
137
|
summary: 'Authentication provider for the reference app',
|
|
142
|
-
options: Object.values(common_1.RefAppProvider),
|
|
143
138
|
}),
|
|
144
139
|
path: core_1.Flags.string({
|
|
145
140
|
char: 'p',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../../src/commands/generate/app.ts"],"names":[],"mappings":";;;AAAA,0EAAyC;AACzC,+CAA0D;AAC1D,sCAAuC;AACvC,mDAAiD;AACjD,sDAAmB;AACnB,
|
|
1
|
+
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../../src/commands/generate/app.ts"],"names":[],"mappings":";;;AAAA,0EAAyC;AACzC,+CAA0D;AAC1D,sCAAuC;AACvC,mDAAiD;AACjD,sDAAmB;AACnB,yCAA0D;AAC1D,gEAAuE;AACvE,kDAA+D;AAC/D,wDAAuF;AACvF,2CAAoF;AACpF,+CAAoD;AACpD,mEAAqE;AACrE,0DAAqE;AACrE,4EAAiF;AAEjF,MAAM,gCAAgC,GAAG,mBAAmB,CAAA;AAC5D,MAAM,oBAAoB,G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