contensis-cli 1.0.0-beta.65 → 1.0.0-beta.66
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 +269 -5
- package/dist/providers/CredentialProvider.js +1 -1
- package/dist/providers/CredentialProvider.js.map +1 -1
- package/dist/shell.js +1 -0
- package/dist/shell.js.map +2 -2
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/esbuild.config.js +3 -1
- package/package.json +1 -1
- package/src/shell.ts +1 -0
- package/src/version.ts +1 -1
package/README.md
CHANGED
|
@@ -8,7 +8,13 @@ Install the package via `npm` as a global module (requires NodeJS)
|
|
|
8
8
|
npm i contensis-cli@preprelease --global
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
If you use `nvm` and are frequently switching your local `Node JS` version, use one of the pre-built binaries.
|
|
12
|
+
|
|
13
|
+
- Windows users: `choco install contensis-cli --pre`
|
|
14
|
+
- Mac users: `brew tap contensis/cli` then `brew install contensis-cli`
|
|
15
|
+
- Linux users: `brew tap contensis/cli` then `brew install contensis-cli-linux`
|
|
16
|
+
|
|
17
|
+
Alternatively, download the executable for your operating system from the [Releases page](https://github.com/contensis/node-cli/releases) and add it to a folder in your local `PATH`
|
|
12
18
|
|
|
13
19
|
## Skip to section
|
|
14
20
|
|
|
@@ -38,6 +44,8 @@ contensis help
|
|
|
38
44
|
|
|
39
45
|
The CLI uses exactly the same commands as the shell. It is recommended you use and familiarise yourself with the cli by using the shell and then use the same cli commands when you need to in script-based context such as continuous integration environments.
|
|
40
46
|
|
|
47
|
+
Launch the [shell](#contensis-shell) by running just the command `contensis`
|
|
48
|
+
|
|
41
49
|
### Pass connection details anywhere
|
|
42
50
|
|
|
43
51
|
If you need to, you can supply all the necessary options to connect to a Contensis project and perform an operation in a single command
|
|
@@ -207,12 +215,19 @@ contensis >
|
|
|
207
215
|
- [List keys](#list-keys)
|
|
208
216
|
- [Create key](#create-key)
|
|
209
217
|
- [Remove key](#remove-key)
|
|
218
|
+
- [Manage roles](#manage-roles)
|
|
219
|
+
- [List roles](#list-roles)
|
|
220
|
+
- [Create role](#create-role)
|
|
221
|
+
- [Set role details](#set-role-details)
|
|
222
|
+
- [Disable role](#disable-role)
|
|
223
|
+
- [Remove role](#remove-role)
|
|
210
224
|
- [Manage content Blocks](#manage-content-blocks)
|
|
211
225
|
- [List blocks](#list-blocks)
|
|
212
226
|
- [Get block](#get-block)
|
|
213
227
|
- [Get block logs](#get-block-logs)
|
|
214
228
|
- [Push a block](#push-a-block)
|
|
215
229
|
- [Release a block version](#release-a-block-version)
|
|
230
|
+
- [View webhook subscriptions](#view-webhook-subscriptions)
|
|
216
231
|
- [Import content models](#import-content-models)
|
|
217
232
|
- [Import from another Contensis environment](#import-from-another-contensis-environment)
|
|
218
233
|
- [From a file](#from-a-file)
|
|
@@ -777,9 +792,12 @@ website t.durden@example-dev>
|
|
|
777
792
|
```shell
|
|
778
793
|
website t.durden@example-dev> create key "Test key" "Key to demonstrate cli"
|
|
779
794
|
[cli] ✅ [example-dev] Created API key "Test key"
|
|
780
|
-
- Test key
|
|
781
|
-
|
|
782
|
-
|
|
795
|
+
- Test key [2022-12-13 t.durden]
|
|
796
|
+
Key to demonstrate cli
|
|
797
|
+
id: 05a0922f-53e7-4a19-a92c-c9567dbe3246
|
|
798
|
+
sharedSecret: 63d2828363f74fc1958f0d60c2306aae-02e8bc50271c479f82dba92a08d3ad16-64b93a3bb8eb4f428a1dddaecc9a84d3
|
|
799
|
+
|
|
800
|
+
[cli] ⏩ Assign your new key to a role with "set role assignments", or create a new role with "create role"
|
|
783
801
|
|
|
784
802
|
website t.durden@example-dev>
|
|
785
803
|
```
|
|
@@ -797,6 +815,252 @@ website t.durden@example-dev>
|
|
|
797
815
|
|
|
798
816
|
Run `list keys` again and you will see your new API key has been removed from the list of keys
|
|
799
817
|
|
|
818
|
+
## Manage roles
|
|
819
|
+
|
|
820
|
+
You can use the cli or shell to manage roles that are used to provide access to resources in your Contensis project
|
|
821
|
+
|
|
822
|
+
### List roles
|
|
823
|
+
|
|
824
|
+
```shell
|
|
825
|
+
website t.durden@example-dev> list roles
|
|
826
|
+
[cli] ✅ [example-dev] Retrieved roles
|
|
827
|
+
- Webinar administrators 058ad55d-bf54-4eb2-b74d-2e8ebd93a400
|
|
828
|
+
groups: System Administrators, Zengenti Marketing Team
|
|
829
|
+
users: t.turner, j.smith, s.harris
|
|
830
|
+
keys: Webinar integration
|
|
831
|
+
entries:
|
|
832
|
+
webinar: *
|
|
833
|
+
formWebinarSignUp: *
|
|
834
|
+
person: *
|
|
835
|
+
accessibleVideo: *
|
|
836
|
+
- Entry Administrators 88babee8-9d65-4bd2-93f7-735e2c016911
|
|
837
|
+
Users assigned to this role can perform all actions on all entries.
|
|
838
|
+
groups: System Administrators
|
|
839
|
+
keys: companySync, Docs import, Development, Content administrator
|
|
840
|
+
entries:
|
|
841
|
+
*: *
|
|
842
|
+
- System content syncing 0eca0043-9b91-462a-3007-c5a5b6e6d15d
|
|
843
|
+
allows background processes to sync content
|
|
844
|
+
groups: User Administrators
|
|
845
|
+
keys: Docs import, companySync, User management
|
|
846
|
+
entries:
|
|
847
|
+
*: contensisEntryBasic.*
|
|
848
|
+
- Media service 16d8947c-7571-4c31-b906-d628de8963a8
|
|
849
|
+
Create and publish media asset entries
|
|
850
|
+
keys: block-contensis-media-service
|
|
851
|
+
entries:
|
|
852
|
+
mediaAsset: *
|
|
853
|
+
|
|
854
|
+
website t.durden@example-dev>
|
|
855
|
+
```
|
|
856
|
+
|
|
857
|
+
### Create role
|
|
858
|
+
|
|
859
|
+
```shell
|
|
860
|
+
website t.durden@example-dev> create role "Test role" "Role to demonstrate cli"
|
|
861
|
+
[cli] ✅ [example-dev] Created role "Test role"
|
|
862
|
+
|
|
863
|
+
id: 1329b3cc-0267-480e-a115-b0beaae8fe5b
|
|
864
|
+
projectId: website
|
|
865
|
+
name: Test role
|
|
866
|
+
description: Role to demonstrate cli
|
|
867
|
+
enabled: true
|
|
868
|
+
permissions:
|
|
869
|
+
webhookSubscriptions:
|
|
870
|
+
proxies:
|
|
871
|
+
eventStreams:
|
|
872
|
+
blocks:
|
|
873
|
+
renderers:
|
|
874
|
+
views:
|
|
875
|
+
assignments:
|
|
876
|
+
|
|
877
|
+
[cli] ⏩ Give access to your role with "set role assignments", allow your role to do things with "set role permissions"
|
|
878
|
+
|
|
879
|
+
website t.durden@example-dev>
|
|
880
|
+
```
|
|
881
|
+
|
|
882
|
+
Run `list roles` again and you will see your new role added to the returned list
|
|
883
|
+
|
|
884
|
+
### Set role details
|
|
885
|
+
|
|
886
|
+
#### Assignments
|
|
887
|
+
|
|
888
|
+
Assign users, groups or keys to your role. We will make assignments using their name or user id for users.
|
|
889
|
+
|
|
890
|
+
```shell
|
|
891
|
+
website t.durden@example-dev> set role assignments "Test role" --assign-keys "Test key"
|
|
892
|
+
[cli] ✅ [example-dev] Retrieved roles
|
|
893
|
+
[cli] ℹ Updating role with details
|
|
894
|
+
|
|
895
|
+
assignments:
|
|
896
|
+
- apiKeys:
|
|
897
|
+
Test key
|
|
898
|
+
|
|
899
|
+
[cli] ✅ Succesfully updated role
|
|
900
|
+
|
|
901
|
+
id: 1329b3cc-0267-480e-a115-b0beaae8fe5b
|
|
902
|
+
projectId: website
|
|
903
|
+
name: Test role
|
|
904
|
+
description: Role to demonstrate cli
|
|
905
|
+
enabled: true
|
|
906
|
+
permissions:
|
|
907
|
+
webhookSubscriptions:
|
|
908
|
+
proxies:
|
|
909
|
+
eventStreams:
|
|
910
|
+
blocks:
|
|
911
|
+
renderers:
|
|
912
|
+
views:
|
|
913
|
+
assignments:
|
|
914
|
+
apiKeys:
|
|
915
|
+
Test key
|
|
916
|
+
|
|
917
|
+
website t.durden@example-dev>
|
|
918
|
+
```
|
|
919
|
+
|
|
920
|
+
#### Permissions
|
|
921
|
+
|
|
922
|
+
Set permissions to give the assignees of your role access to your project resources.
|
|
923
|
+
|
|
924
|
+
We can set permissions for entries.
|
|
925
|
+
|
|
926
|
+
```shell
|
|
927
|
+
website t.durden@example-dev> set role permissions "Test role" --content-type-ids simpleContent linkedContent
|
|
928
|
+
[cli] ✅ [example-dev] Retrieved roles
|
|
929
|
+
[cli] ℹ Updating role with details
|
|
930
|
+
|
|
931
|
+
permissions:
|
|
932
|
+
- entries:
|
|
933
|
+
id: simpleContent
|
|
934
|
+
id: linkedContent
|
|
935
|
+
|
|
936
|
+
[cli] ✅ Succesfully updated role
|
|
937
|
+
|
|
938
|
+
id: 1329b3cc-0267-480e-a115-b0beaae8fe5b
|
|
939
|
+
projectId: website
|
|
940
|
+
name: Test role
|
|
941
|
+
description: Role to demonstrate cli
|
|
942
|
+
enabled: true
|
|
943
|
+
permissions:
|
|
944
|
+
entries:
|
|
945
|
+
- languages:
|
|
946
|
+
*
|
|
947
|
+
id: simpleContent
|
|
948
|
+
actions:
|
|
949
|
+
*
|
|
950
|
+
- languages:
|
|
951
|
+
*
|
|
952
|
+
id: linkedContent
|
|
953
|
+
actions:
|
|
954
|
+
*
|
|
955
|
+
webhookSubscriptions:
|
|
956
|
+
proxies:
|
|
957
|
+
eventStreams:
|
|
958
|
+
blocks:
|
|
959
|
+
renderers:
|
|
960
|
+
views:
|
|
961
|
+
assignments:
|
|
962
|
+
apiKeys:
|
|
963
|
+
Test key
|
|
964
|
+
|
|
965
|
+
website t.durden@example-dev>
|
|
966
|
+
```
|
|
967
|
+
|
|
968
|
+
### Disable role
|
|
969
|
+
|
|
970
|
+
Disable a role by using the command `set role enabled` with the `--disabled` flag
|
|
971
|
+
|
|
972
|
+
```shell
|
|
973
|
+
website t.durden@example-dev> set role enabled "Test role" --disabled
|
|
974
|
+
[cli] ✅ [example-dev] Retrieved roles
|
|
975
|
+
[cli] ℹ Updating role with details
|
|
976
|
+
|
|
977
|
+
enabled: false
|
|
978
|
+
|
|
979
|
+
[cli] ✅ Succesfully updated role
|
|
980
|
+
|
|
981
|
+
id: 1329b3cc-0267-480e-a115-b0beaae8fe5b
|
|
982
|
+
projectId: website
|
|
983
|
+
name: Test role
|
|
984
|
+
description: Role to demonstrate cli
|
|
985
|
+
enabled: false
|
|
986
|
+
|
|
987
|
+
website t.durden@example-dev>
|
|
988
|
+
```
|
|
989
|
+
|
|
990
|
+
Enable the role again by calling the same command without the `--disabled` flag
|
|
991
|
+
|
|
992
|
+
```shell
|
|
993
|
+
website t.durden@example-dev> set role enabled "Test role"
|
|
994
|
+
[cli] ✅ [example-dev] Retrieved roles
|
|
995
|
+
[cli] ℹ Updating role with details
|
|
996
|
+
|
|
997
|
+
enabled: true
|
|
998
|
+
|
|
999
|
+
[cli] ✅ Succesfully updated role
|
|
1000
|
+
|
|
1001
|
+
id: 1329b3cc-0267-480e-a115-b0beaae8fe5b
|
|
1002
|
+
projectId: migratortron
|
|
1003
|
+
name: Test role
|
|
1004
|
+
description: Role to demonstrate cli
|
|
1005
|
+
enabled: true
|
|
1006
|
+
|
|
1007
|
+
website t.durden@example-dev>
|
|
1008
|
+
```
|
|
1009
|
+
|
|
1010
|
+
### Remove role
|
|
1011
|
+
|
|
1012
|
+
```shell
|
|
1013
|
+
website t.durden@example-dev> remove role "Test role"
|
|
1014
|
+
[cli] ✅ [example-dev] Retrieved roles
|
|
1015
|
+
[cli] ✅ [example-dev] Deleted role Test role
|
|
1016
|
+
|
|
1017
|
+
website t.durden@example-dev>
|
|
1018
|
+
```
|
|
1019
|
+
|
|
1020
|
+
Run `list roles` again and you will see your new role has been removed from the list of role
|
|
1021
|
+
|
|
1022
|
+
## View webhook subscriptions
|
|
1023
|
+
|
|
1024
|
+
```shell
|
|
1025
|
+
website t.durden@example-dev> list webhooks
|
|
1026
|
+
[cli] ✅ [example-dev] Webhook subscriptions:
|
|
1027
|
+
- Test webhook 43969978-f9c1-4ee6-a515-11e0ceaddfeb [2022-12-13 t.durden]
|
|
1028
|
+
[POST] https://webhook.site/dede53b3-f044-4640-8634-5f0061ade5c7
|
|
1029
|
+
headers:
|
|
1030
|
+
test: true
|
|
1031
|
+
credential: 🤐
|
|
1032
|
+
topics: resourceType:entry event:[created updated]
|
|
1033
|
+
- More Testing 52e6bac1-1d81-462e-b483-d22034173cb4 [2022-07-15 b.feaver]
|
|
1034
|
+
[POST] https://webhook.site/cd0e99b5-d658-423c-acf5-47af7dfcaa06
|
|
1035
|
+
topics: resourceType:entry event:[published] contentTypeId:[blogPost]
|
|
1036
|
+
|
|
1037
|
+
website t.durden@example-dev>
|
|
1038
|
+
```
|
|
1039
|
+
|
|
1040
|
+
```shell
|
|
1041
|
+
website t.durden@example-dev> get webhook "Slack"
|
|
1042
|
+
[cli] ✅ [example-dev] Webhook subscriptions:
|
|
1043
|
+
- Slack 5a8dfee1-238f-44fe-b8aa-4b932099500c [2021-07-28 g.moore]
|
|
1044
|
+
Send a notification to a channel
|
|
1045
|
+
[POST] https://webhook.site/5ac0d1c4-8e2e-42c2-a055-66dc7e04843a
|
|
1046
|
+
topics:
|
|
1047
|
+
- resourceType: entry
|
|
1048
|
+
event:
|
|
1049
|
+
published
|
|
1050
|
+
unpublished
|
|
1051
|
+
contentTypeId:
|
|
1052
|
+
article
|
|
1053
|
+
- resourceType: entry
|
|
1054
|
+
event:
|
|
1055
|
+
workflowStateChanged
|
|
1056
|
+
workflowState:
|
|
1057
|
+
contensisEntryApproval.awaitingApproval
|
|
1058
|
+
contensisEntryApproval.declined
|
|
1059
|
+
templates: entry
|
|
1060
|
+
|
|
1061
|
+
website t.durden@example-dev>
|
|
1062
|
+
```
|
|
1063
|
+
|
|
800
1064
|
## Manage content Blocks
|
|
801
1065
|
|
|
802
1066
|
You can manage blocks for any Contensis project using the following commands
|
|
@@ -939,7 +1203,7 @@ website t.durden@example-dev>
|
|
|
939
1203
|
|
|
940
1204
|
## Import content models
|
|
941
1205
|
|
|
942
|
-
Connect to your "source" environment first, ensure you can fetch the models and these models contain the dependencies you plan on importing from here with the `get
|
|
1206
|
+
Connect to your "source" environment first, ensure you can fetch the models and these models contain the dependencies you plan on importing from here with the `get model` command. Add the `--dependents` option to fetch all of the entries that will eventually be imported.
|
|
943
1207
|
|
|
944
1208
|
When you are happy your models contain the right dependencies for your import, connect to the "target" environment (and project) then use the same arguments as before except with the `import entries` command
|
|
945
1209
|
|
|
@@ -44,7 +44,7 @@ class CredentialProvider {
|
|
|
44
44
|
}
|
|
45
45
|
Import = async () => {
|
|
46
46
|
try {
|
|
47
|
-
this.keytar = (await
|
|
47
|
+
this.keytar = (await Promise.resolve().then(() => __toESM(require("keytar")))).default;
|
|
48
48
|
} catch (ex) {
|
|
49
49
|
this.keytar = {
|
|
50
50
|
findCredentials: async () => {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/providers/CredentialProvider.ts"],
|
|
4
4
|
"sourcesContent": ["import keytar from 'keytar';\nimport to from 'await-to-js';\nimport { Logger } from '~/util/logger';\n\nconst SERVICE_NAME = 'contensis-cli';\n\ninterface Remarks {\n secure: boolean;\n}\n\nclass CredentialProvider {\n private serviceId: string;\n private keytar!: typeof keytar;\n private userId: string = '';\n private passwordFallback?: string;\n\n current: {\n account: string;\n password: string;\n } | null = null;\n remarks: Remarks = { secure: false };\n\n constructor(\n { userId, alias }: { userId: string; alias?: string },\n passwordFallback?: string\n ) {\n this.serviceId =\n typeof alias !== 'undefined' ? `${SERVICE_NAME}_${alias}` : SERVICE_NAME;\n this.userId = userId;\n this.passwordFallback = passwordFallback;\n }\n\n Import = async () => {\n try {\n this.keytar = (await import('keytar')).default;\n } catch (ex) {\n this.keytar = {\n findCredentials: async () => {\n throw ex;\n },\n getPassword: async () => {\n throw ex;\n },\n findPassword: async () => {\n throw ex;\n },\n setPassword: async () => {\n throw ex;\n },\n deletePassword: async () => {\n throw ex;\n },\n };\n }\n };\n\n Init = async (): Promise<[Error, CredentialProvider]> => {\n await this.Import();\n const [err, stored] = (await to(\n this.keytar.findCredentials(this.serviceId)\n )) as [\n Error,\n {\n account: string;\n password: string;\n }[]\n ];\n if (err && this.passwordFallback) {\n this.current = {\n account: this.userId,\n password: this.passwordFallback,\n };\n }\n if (!err) {\n this.remarks = { secure: true };\n this.current =\n stored?.find(\n u => u?.account?.toLowerCase() === this.userId.toLowerCase()\n ) || null;\n\n if (!this.current && this.passwordFallback) {\n await this.Save(this.passwordFallback);\n return await this.Init();\n }\n }\n return [err, this];\n };\n\n Save = async (password: string) => {\n const [err] = await to(\n this.keytar.setPassword(this.serviceId, this.userId, password)\n );\n\n // if (!err) Logger.info(`${this.serviceId} - credentials saved`);\n return err && !this.passwordFallback ? err : true;\n };\n\n Delete = async () => {\n if (this.passwordFallback) {\n this.passwordFallback = undefined;\n return true;\n } else {\n const [err] = await to(\n this.keytar.deletePassword(this.serviceId, this.userId)\n );\n\n Logger.warning(`${this.serviceId} - invalid credentials removed`);\n return err || true;\n }\n };\n\n // GetPassword = async () => {\n // const [err, password] = await to(\n // keytar.getPassword(this.serviceId, this.userId)\n // );\n\n // return err || password;\n // };\n}\n\nexport default CredentialProvider;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,yBAAe;AACf,oBAAuB;AAEvB,MAAM,eAAe;AAMrB,MAAM,mBAAmB;AAAA,EACf;AAAA,EACA;AAAA,EACA,SAAiB;AAAA,EACjB;AAAA,EAER,UAGW;AAAA,EACX,UAAmB,EAAE,QAAQ,MAAM;AAAA,EAEnC,YACE,EAAE,QAAQ,MAAM,GAChB,kBACA;AACA,SAAK,YACH,OAAO,UAAU,cAAc,GAAG,gBAAgB,UAAU;AAC9D,SAAK,SAAS;AACd,SAAK,mBAAmB;AAAA,EAC1B;AAAA,EAEA,SAAS,YAAY;AACnB,QAAI;AACF,WAAK,UAAU,MAAM,
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,yBAAe;AACf,oBAAuB;AAEvB,MAAM,eAAe;AAMrB,MAAM,mBAAmB;AAAA,EACf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A,IACF;AACA,WAAO,CAAC,KAAK,IAAI;AAAA,EACnB;AAAA,EAEA,OAAO,OAAO,aAAqB;AACjC,UAAM,CAAC,GAAG,IAAI,UAAM,mBAAAA;AAAA,MAClB,KAAK,OAAO,YAAY,KAAK,WAAW,KAAK,QAAQ,QAAQ;AAAA,IAC/D;AAGA,WAAO,OAAO,CAAC,KAAK,mBAAmB,MAAM;AAAA,EAC/C;AAAA,EAEA,SAAS,YAAY;AACnB,QAAI,KAAK,kBAAkB;AACzB,WAAK,mBAAmB;AACxB,aAAO;AAAA,IACT,OAAO;AACL,YAAM,CAAC,GAAG,IAAI,UAAM,mBAAAA;AAAA,QAClB,KAAK,OAAO,eAAe,KAAK,WAAW,KAAK,MAAM;AAAA,MACxD;AAEA,2BAAO,QAAQ,GAAG,KAAK,yCAAyC;AAChE,aAAO,OAAO;AAAA,IAChB;AAAA,EACF;AASF;AAEA,IAAO,6BAAQ;",
|
|
6
6
|
"names": ["to"]
|
|
7
7
|
}
|
package/dist/shell.js
CHANGED
package/dist/shell.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/shell.ts"],
|
|
4
|
-
"sourcesContent": ["import figlet from 'figlet';\nimport inquirer from 'inquirer';\nimport inquirerPrompt from 'inquirer-command-prompt';\nimport commands from './commands';\nimport { LogMessages } from './localisation/en-GB';\nimport CredentialProvider from './providers/CredentialProvider';\nimport { appRootDir } from './providers/file-provider';\nimport ContensisCli, { cliCommand } from './services/ContensisCliService';\nimport { Logging } from './util';\nimport { logError, Logger } from './util/logger';\nimport { LIB_VERSION } from './version';\n\nclass ContensisShell {\n private currentEnvironment!: string;\n private emptyInputCounter: number = 0;\n private env!: EnvironmentCache;\n private firstStart = true;\n private userId: string = '';\n private log = Logger;\n private messages = LogMessages;\n\n private refreshEnvironment = () => {\n // Reload any persisted changes from the disk cache\n const {\n cache: { currentEnvironment = '', environments = {} },\n } = new ContensisCli([]);\n // console.log(`refreshing env w/${currentEnvironment}`);\n this.currentEnvironment = currentEnvironment;\n this.env = environments[currentEnvironment];\n\n // Reload logging here to support changing language\n Logging('en-GB').then(({ messages, Log }) => {\n this.log = Log;\n this.messages = messages;\n });\n };\n\n constructor() {\n this.refreshEnvironment();\n inquirerPrompt.setConfig({\n history: {\n save: true,\n folder: appRootDir,\n limit: 100,\n blacklist: ['quit'],\n },\n });\n\n const { log, messages } = this;\n\n figlet.text(\n messages.app.contensis(),\n {\n font: 'Block',\n horizontalLayout: 'default',\n verticalLayout: 'default',\n width: process.stdout.columns,\n whitespaceBreak: true,\n },\n (err, data) => {\n if (err) {\n log.error(messages.app.unknownError());\n console.dir(err);\n return;\n }\n console.log(log.successText(data));\n console.log(log.infoText(messages.app.startup(LIB_VERSION)));\n console.log(log.helpText(messages.app.help()));\n\n this.start().catch(ex => log.error(ex));\n }\n );\n }\n\n restart = async () => {\n this.firstStart = false;\n this.log.line(); // add a line so we can see where the shell has been restarted\n await this.start();\n };\n\n start = async () => {\n this.refreshEnvironment();\n this.userId = '';\n const { currentEnvironment, env, log, messages } = this;\n\n if (env?.lastUserId) {\n const [credsErr, credentials] = await new CredentialProvider(\n {\n userId: env.lastUserId,\n alias: currentEnvironment,\n },\n env.passwordFallback\n ).Init();\n if (credsErr && !credentials.current) {\n log.error(credsErr.message);\n }\n if (credentials.current) {\n if (this.firstStart) {\n const token = await cliCommand(['login', env.lastUserId]).Login(\n env.lastUserId,\n {\n promptPassword: false,\n silent: true,\n }\n );\n if (token) {\n this.userId = env.lastUserId;\n if (!env.currentProject) log.warning(messages.projects.tip());\n }\n this.firstStart = false;\n this.refreshEnvironment();\n } else {\n this.userId = env.lastUserId;\n }\n }\n }\n await this.contensisPrompt();\n };\n\n contensisPrompt = async (): Promise<any> => {\n const { currentEnvironment, env, log, messages, userId } = this;\n\n const availableCommands = [\n {\n filter: (str: string) => {\n return str.replace(/ \\[.*$/, '');\n },\n },\n 'connect',\n 'list envs',\n 'quit',\n ];\n\n if (currentEnvironment)\n availableCommands.push('login', 'list projects', 'set project');\n if (userId)\n availableCommands.push(\n 'create key',\n 'create project',\n 'create role',\n 'diff models',\n 'get block',\n 'get block logs',\n 'get contenttype',\n 'get component',\n 'get entries',\n 'get model',\n 'get project',\n 'get role',\n 'get version',\n 'import contenttypes',\n 'import components',\n 'import entries',\n 'import models',\n 'list blocks',\n 'list contenttypes',\n 'list components',\n 'list keys',\n 'list models',\n 'list roles',\n 'list webhooks',\n 'push block',\n 'release block',\n 'remove components',\n 'remove contenttypes',\n 'remove key',\n 'remove entries',\n 'remove role',\n 'set project name',\n 'set project description',\n 'set role name',\n 'set role description',\n 'set role assignments',\n 'set role enabled',\n 'set role permissions'\n );\n\n const prompt = inquirer.createPromptModule();\n prompt.registerPrompt('command', inquirerPrompt);\n return prompt([\n {\n type: 'command',\n name: 'cmd',\n autoCompletion: availableCommands,\n autocompletePrompt: log.infoText(messages.app.autocomplete()),\n message: `${userId ? `${userId}@` : ''}${currentEnvironment || ''}>`,\n context: 0,\n validate: (val: string) => {\n if (!val) this.emptyInputCounter++;\n if (this.emptyInputCounter > 1)\n console.log(this.log.infoText(this.messages.app.suggestions()));\n if (val) {\n this.emptyInputCounter = 0;\n return true;\n }\n },\n prefix: `${env?.currentProject || log.infoText('contensis')}`,\n short: true,\n },\n ])\n .then(async (answers: { cmd: string }) => {\n if (answers.cmd === 'quit') {\n this.quit();\n } else {\n try {\n if (answers.cmd) {\n const program = commands();\n await program.parseAsync(\n answers.cmd\n .match(/\"[^\"]+\"|[^\\s]+/g)\n ?.map(e => e.replace(/\"(.+)\"/, '$1')),\n {\n from: 'user',\n }\n );\n }\n } catch (ex: any) {\n const str = ex.toString();\n if (!str.includes('CommanderError'))\n logError(ex, `Shell ${ex.toString()}`);\n } finally {\n return this.contensisPrompt();\n }\n }\n })\n .catch((err: Error) => {\n log.error(err.message);\n this.quit();\n });\n };\n\n quit = (error?: Error) => {\n const { log, messages } = this;\n process.removeAllListeners('exit');\n\n if (error) {\n log.error(error.message);\n process.exit(1);\n } else {\n log.success(messages.app.quit());\n process.exitCode = 0;\n process.exit(0);\n }\n };\n}\n\nlet globalShell: ContensisShell;\n\nexport const shell = () => {\n // Return a benign function for shell().restart() when used in cli context\n // as some commands need to restart the shell to show an updated prompt\n // after successful connect / login / set project\n if (typeof process.argv?.[2] !== 'undefined') return { restart() {} } as any;\n if (!globalShell) globalShell = new ContensisShell();\n return globalShell;\n};\n\nprocess.on('uncaughtException', function (err) {\n // Handle the error safely\n console.log(err);\n});\n\nprocess.on('SIGINT', () => {\n console.log('catching SIGINT');\n shell().quit();\n});\n\nprocess.on('SIGTERM', () => {\n console.log('catching SIGTERM');\n shell().quit();\n});\n\nprocess.stdin.on('data', key => {\n if ((key as any) == '\\u0003') {\n console.log('');\n Logger.info(`[CTRL]+[C] detected, exiting shell...`);\n shell().quit();\n }\n});\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAmB;AACnB,sBAAqB;AACrB,qCAA2B;AAC3B,sBAAqB;AACrB,mBAA4B;AAC5B,gCAA+B;AAC/B,2BAA2B;AAC3B,iCAAyC;AACzC,kBAAwB;AACxB,oBAAiC;AACjC,qBAA4B;AAE5B,MAAM,eAAe;AAAA,EACX;AAAA,EACA,oBAA4B;AAAA,EAC5B;AAAA,EACA,aAAa;AAAA,EACb,SAAiB;AAAA,EACjB,MAAM;AAAA,EACN,WAAW;AAAA,EAEX,qBAAqB,MAAM;AAEjC,UAAM;AAAA,MACJ,OAAO,EAAE,qBAAqB,IAAI,eAAe,CAAC,EAAE;AAAA,IACtD,IAAI,IAAI,2BAAAA,QAAa,CAAC,CAAC;AAEvB,SAAK,qBAAqB;AAC1B,SAAK,MAAM,aAAa;AAGxB,6BAAQ,OAAO,EAAE,KAAK,CAAC,EAAE,UAAU,IAAI,MAAM;AAC3C,WAAK,MAAM;AACX,WAAK,WAAW;AAAA,I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A;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAEF,UAAM,SAAS,gBAAAC,QAAS,mBAAmB;AAC3C,WAAO,eAAe,WAAW,+BAAAH,OAAc;AAC/C,WAAO,OAAO;AAAA,MACZ;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,QACN,gBAAgB;AAAA,QAChB,oBAAoB,IAAI,SAAS,SAAS,IAAI,aAAa,CAAC;AAAA,QAC5D,SAAS,GAAG,SAAS,GAAG,YAAY,KAAK,sBAAsB;AAAA,QAC/D,SAAS;AAAA,QACT,UAAU,CAAC,QAAgB;AACzB,cAAI,CAAC;AAAK,iBAAK;AACf,cAAI,KAAK,oBAAoB;AAC3B,oBAAQ,IAAI,KAAK,IAAI,SAAS,KAAK,SAAS,IAAI,YAAY,CAAC,CAAC;AAChE,cAAI,KAAK;AACP,iBAAK,oBAAoB;AACzB,mBAAO;AAAA,UACT;AAAA,QACF;AAAA,QACA,QAAQ,IAAG,2BAAK,mBAAkB,IAAI,SAAS,WAAW;AAAA,QAC1D,OAAO;AAAA,MACT;AAAA,IACF,CAAC,EACE,KAAK,OAAO,YAA6B;
|
|
4
|
+
"sourcesContent": ["import figlet from 'figlet';\nimport inquirer from 'inquirer';\nimport inquirerPrompt from 'inquirer-command-prompt';\nimport commands from './commands';\nimport { LogMessages } from './localisation/en-GB';\nimport CredentialProvider from './providers/CredentialProvider';\nimport { appRootDir } from './providers/file-provider';\nimport ContensisCli, { cliCommand } from './services/ContensisCliService';\nimport { Logging } from './util';\nimport { logError, Logger } from './util/logger';\nimport { LIB_VERSION } from './version';\n\nclass ContensisShell {\n private currentEnvironment!: string;\n private emptyInputCounter: number = 0;\n private env!: EnvironmentCache;\n private firstStart = true;\n private userId: string = '';\n private log = Logger;\n private messages = LogMessages;\n\n private refreshEnvironment = () => {\n // Reload any persisted changes from the disk cache\n const {\n cache: { currentEnvironment = '', environments = {} },\n } = new ContensisCli([]);\n // console.log(`refreshing env w/${currentEnvironment}`);\n this.currentEnvironment = currentEnvironment;\n this.env = environments[currentEnvironment];\n\n // Reload logging here to support changing language\n Logging('en-GB').then(({ messages, Log }) => {\n this.log = Log;\n this.messages = messages;\n });\n };\n\n constructor() {\n this.refreshEnvironment();\n inquirerPrompt.setConfig({\n history: {\n save: true,\n folder: appRootDir,\n limit: 100,\n blacklist: ['quit'],\n },\n });\n\n const { log, messages } = this;\n\n figlet.text(\n messages.app.contensis(),\n {\n font: 'Block',\n horizontalLayout: 'default',\n verticalLayout: 'default',\n width: process.stdout.columns,\n whitespaceBreak: true,\n },\n (err, data) => {\n if (err) {\n log.error(messages.app.unknownError());\n console.dir(err);\n return;\n }\n console.log(log.successText(data));\n console.log(log.infoText(messages.app.startup(LIB_VERSION)));\n console.log(log.helpText(messages.app.help()));\n\n this.start().catch(ex => log.error(ex));\n }\n );\n }\n\n restart = async () => {\n this.firstStart = false;\n this.log.line(); // add a line so we can see where the shell has been restarted\n await this.start();\n };\n\n start = async () => {\n this.refreshEnvironment();\n this.userId = '';\n const { currentEnvironment, env, log, messages } = this;\n\n if (env?.lastUserId) {\n const [credsErr, credentials] = await new CredentialProvider(\n {\n userId: env.lastUserId,\n alias: currentEnvironment,\n },\n env.passwordFallback\n ).Init();\n if (credsErr && !credentials.current) {\n log.error(credsErr.message);\n }\n if (credentials.current) {\n if (this.firstStart) {\n const token = await cliCommand(['login', env.lastUserId]).Login(\n env.lastUserId,\n {\n promptPassword: false,\n silent: true,\n }\n );\n if (token) {\n this.userId = env.lastUserId;\n if (!env.currentProject) log.warning(messages.projects.tip());\n }\n this.firstStart = false;\n this.refreshEnvironment();\n } else {\n this.userId = env.lastUserId;\n }\n }\n }\n await this.contensisPrompt();\n };\n\n contensisPrompt = async (): Promise<any> => {\n const { currentEnvironment, env, log, messages, userId } = this;\n\n const availableCommands = [\n {\n filter: (str: string) => {\n return str.replace(/ \\[.*$/, '');\n },\n },\n 'connect',\n 'list envs',\n 'quit',\n ];\n\n if (currentEnvironment)\n availableCommands.push('login', 'list projects', 'set project');\n if (userId)\n availableCommands.push(\n 'create key',\n 'create project',\n 'create role',\n 'diff models',\n 'get block',\n 'get block logs',\n 'get contenttype',\n 'get component',\n 'get entries',\n 'get model',\n 'get project',\n 'get role',\n 'get version',\n 'get webhook',\n 'import contenttypes',\n 'import components',\n 'import entries',\n 'import models',\n 'list blocks',\n 'list contenttypes',\n 'list components',\n 'list keys',\n 'list models',\n 'list roles',\n 'list webhooks',\n 'push block',\n 'release block',\n 'remove components',\n 'remove contenttypes',\n 'remove key',\n 'remove entries',\n 'remove role',\n 'set project name',\n 'set project description',\n 'set role name',\n 'set role description',\n 'set role assignments',\n 'set role enabled',\n 'set role permissions'\n );\n\n const prompt = inquirer.createPromptModule();\n prompt.registerPrompt('command', inquirerPrompt);\n return prompt([\n {\n type: 'command',\n name: 'cmd',\n autoCompletion: availableCommands,\n autocompletePrompt: log.infoText(messages.app.autocomplete()),\n message: `${userId ? `${userId}@` : ''}${currentEnvironment || ''}>`,\n context: 0,\n validate: (val: string) => {\n if (!val) this.emptyInputCounter++;\n if (this.emptyInputCounter > 1)\n console.log(this.log.infoText(this.messages.app.suggestions()));\n if (val) {\n this.emptyInputCounter = 0;\n return true;\n }\n },\n prefix: `${env?.currentProject || log.infoText('contensis')}`,\n short: true,\n },\n ])\n .then(async (answers: { cmd: string }) => {\n if (answers.cmd === 'quit') {\n this.quit();\n } else {\n try {\n if (answers.cmd) {\n const program = commands();\n await program.parseAsync(\n answers.cmd\n .match(/\"[^\"]+\"|[^\\s]+/g)\n ?.map(e => e.replace(/\"(.+)\"/, '$1')),\n {\n from: 'user',\n }\n );\n }\n } catch (ex: any) {\n const str = ex.toString();\n if (!str.includes('CommanderError'))\n logError(ex, `Shell ${ex.toString()}`);\n } finally {\n return this.contensisPrompt();\n }\n }\n })\n .catch((err: Error) => {\n log.error(err.message);\n this.quit();\n });\n };\n\n quit = (error?: Error) => {\n const { log, messages } = this;\n process.removeAllListeners('exit');\n\n if (error) {\n log.error(error.message);\n process.exit(1);\n } else {\n log.success(messages.app.quit());\n process.exitCode = 0;\n process.exit(0);\n }\n };\n}\n\nlet globalShell: ContensisShell;\n\nexport const shell = () => {\n // Return a benign function for shell().restart() when used in cli context\n // as some commands need to restart the shell to show an updated prompt\n // after successful connect / login / set project\n if (typeof process.argv?.[2] !== 'undefined') return { restart() {} } as any;\n if (!globalShell) globalShell = new ContensisShell();\n return globalShell;\n};\n\nprocess.on('uncaughtException', function (err) {\n // Handle the error safely\n console.log(err);\n});\n\nprocess.on('SIGINT', () => {\n console.log('catching SIGINT');\n shell().quit();\n});\n\nprocess.on('SIGTERM', () => {\n console.log('catching SIGTERM');\n shell().quit();\n});\n\nprocess.stdin.on('data', key => {\n if ((key as any) == '\\u0003') {\n console.log('');\n Logger.info(`[CTRL]+[C] detected, exiting shell...`);\n shell().quit();\n }\n});\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAmB;AACnB,sBAAqB;AACrB,qCAA2B;AAC3B,sBAAqB;AACrB,mBAA4B;AAC5B,gCAA+B;AAC/B,2BAA2B;AAC3B,iCAAyC;AACzC,kBAAwB;AACxB,oBAAiC;AACjC,qBAA4B;AAE5B,MAAM,eAAe;AAAA,EACX;AAAA,EACA,oBAA4B;AAAA,EAC5B;AAAA,EACA,aAAa;AAAA,EACb,SAAiB;AAAA,EACjB,MAAM;AAAA,EACN,WAAW;AAAA,EAEX,qBAAqB,MAAM;AAEjC,UAAM;AAAA,MACJ,OAAO,EAAE,qBAAqB,IAAI,eAAe,CAAC,EAAE;AAAA,IACtD,IAAI,IAAI,2BAAAA,QAAa,CAAC,CAAC;AAEvB,SAAK,qBAAqB;AAC1B,SAAK,MAAM,aAAa;AAGxB,6BAAQ,OAAO,EAAE,KAAK,CAAC,EAAE,UAAU,IAAI,MAAM;AAC3C,WAAK,MAAM;AACX,WAA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 +21,7 @@ __export(version_exports, {
|
|
|
21
21
|
LIB_VERSION: () => LIB_VERSION
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(version_exports);
|
|
24
|
-
const LIB_VERSION = "1.0.0-beta.
|
|
24
|
+
const LIB_VERSION = "1.0.0-beta.66";
|
|
25
25
|
// Annotate the CommonJS export names for ESM import in node:
|
|
26
26
|
0 && (module.exports = {
|
|
27
27
|
LIB_VERSION
|
package/dist/version.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/version.ts"],
|
|
4
|
-
"sourcesContent": ["export const LIB_VERSION = \"1.0.0-beta.
|
|
4
|
+
"sourcesContent": ["export const LIB_VERSION = \"1.0.0-beta.66\";\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/esbuild.config.js
CHANGED
|
@@ -23,7 +23,9 @@ rimraf('./dist', () => {
|
|
|
23
23
|
platform: 'node',
|
|
24
24
|
format: 'cjs',
|
|
25
25
|
sourcemap: true,
|
|
26
|
-
|
|
26
|
+
// needs to be node12 to transform dynamic imports into requires
|
|
27
|
+
// so the bundles are compatible with the pkg exe builds
|
|
28
|
+
target: 'node12',
|
|
27
29
|
plugins: [globPlugin(), nodeExternalsPlugin()],
|
|
28
30
|
watch: watch && {
|
|
29
31
|
onRebuild(error) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "contensis-cli",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.66",
|
|
4
4
|
"description": "A fully featured Contensis command line interface with a shell UI provides simple and intuitive ways to manage or profile your content in any NodeJS terminal.",
|
|
5
5
|
"repository": "https://github.com/contensis/node-cli",
|
|
6
6
|
"homepage": "https://github.com/contensis/node-cli/tree/main/packages/contensis-cli#readme",
|
package/src/shell.ts
CHANGED
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const LIB_VERSION = "1.0.0-beta.
|
|
1
|
+
export const LIB_VERSION = "1.0.0-beta.66";
|