contensis-cli 1.0.0-beta.65 → 1.0.0-beta.67
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 +360 -23
- package/dist/commands/execute.js +93 -0
- package/dist/commands/execute.js.map +7 -0
- package/dist/commands/get.js +1 -1
- package/dist/commands/get.js.map +2 -2
- package/dist/commands/index.js +11 -5
- package/dist/commands/index.js.map +2 -2
- package/dist/localisation/en-GB.js +7 -5
- package/dist/localisation/en-GB.js.map +2 -2
- package/dist/providers/CredentialProvider.js +1 -1
- package/dist/providers/CredentialProvider.js.map +1 -1
- package/dist/services/ContensisCliService.js +14 -4
- package/dist/services/ContensisCliService.js.map +2 -2
- package/dist/shell.js +6 -2
- 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/commands/execute.ts +106 -0
- package/src/commands/get.ts +1 -0
- package/src/commands/index.ts +11 -4
- package/src/localisation/en-GB.ts +20 -7
- package/src/services/ContensisCliService.ts +20 -5
- package/src/shell.ts +6 -2
- package/src/version.ts +1 -1
- package/dist/commands/release.js +0 -47
- package/dist/commands/release.js.map +0 -7
- package/src/commands/release.ts +0 -32
package/README.md
CHANGED
|
@@ -2,15 +2,54 @@
|
|
|
2
2
|
|
|
3
3
|
Use Contensis from your favourite terminal
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
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`
|
|
6
|
+
|
|
7
|
+
or use your preferred installation method below
|
|
8
|
+
|
|
9
|
+
## Install with package manager
|
|
10
|
+
|
|
11
|
+
### Windows ([Chocolatey](https://chocolatey.org/install))
|
|
12
|
+
|
|
13
|
+
```shell
|
|
14
|
+
choco install contensis-cli --pre
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
- [Choco package docs and source](https://github.com/contensis/node-cli/tree/main/installers/chocolatey)
|
|
18
|
+
- [Contensis CLI on the Chocolatey Community Repository](https://community.chocolatey.org/packages/contensis-cli)
|
|
19
|
+
|
|
20
|
+
### Mac ([Homebrew](https://docs.brew.sh/Installation))
|
|
21
|
+
|
|
22
|
+
```shell
|
|
23
|
+
brew tap contensis/cli
|
|
24
|
+
brew install contensis-cli
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
- [Homebrew tap on GitHub](https://github.com/contensis/homebrew-cli)
|
|
28
|
+
|
|
29
|
+
### Linux ([Homebrew](https://docs.brew.sh/Homebrew-on-Linux))
|
|
30
|
+
|
|
31
|
+
```shell
|
|
32
|
+
brew tap contensis/cli
|
|
33
|
+
brew install contensis-cli-linux
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
- [Homebrew tap on GitHub](https://github.com/contensis/homebrew-cli)
|
|
37
|
+
|
|
38
|
+
## Install as Node.js global module
|
|
39
|
+
|
|
40
|
+
Install the package via [`npm`](https://www.npmjs.com/package/contensis-cli) as a global module (requires [Node.js](https://nodejs.org/en/download/))
|
|
6
41
|
|
|
7
42
|
```shell
|
|
8
43
|
npm i contensis-cli@preprelease --global
|
|
9
44
|
```
|
|
10
45
|
|
|
11
|
-
|
|
46
|
+
If you use `nvm` and are frequently switching your local `node` version it will also switch your global `node_modules` each time, it is recommended use one of the binary installations instead.
|
|
12
47
|
|
|
13
|
-
##
|
|
48
|
+
## Install from source
|
|
49
|
+
|
|
50
|
+
Clone the [repository](https://github.com/contensis/node-cli) and follow the instructions in the [`README`](https://github.com/contensis/node-cli#readme)
|
|
51
|
+
|
|
52
|
+
# Skip to section
|
|
14
53
|
|
|
15
54
|
- [Contensis Shell](#contensis-shell)
|
|
16
55
|
- [Use in Terminal](#cli-usage)
|
|
@@ -38,6 +77,8 @@ contensis help
|
|
|
38
77
|
|
|
39
78
|
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
79
|
|
|
80
|
+
Launch the [shell](#contensis-shell) by running just the command `contensis`
|
|
81
|
+
|
|
41
82
|
### Pass connection details anywhere
|
|
42
83
|
|
|
43
84
|
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,18 +248,30 @@ contensis >
|
|
|
207
248
|
- [List keys](#list-keys)
|
|
208
249
|
- [Create key](#create-key)
|
|
209
250
|
- [Remove key](#remove-key)
|
|
251
|
+
- [Manage roles](#manage-roles)
|
|
252
|
+
- [List roles](#list-roles)
|
|
253
|
+
- [Create role](#create-role)
|
|
254
|
+
- [Set role details](#set-role-details)
|
|
255
|
+
- [Disable role](#disable-role)
|
|
256
|
+
- [Remove role](#remove-role)
|
|
210
257
|
- [Manage content Blocks](#manage-content-blocks)
|
|
211
258
|
- [List blocks](#list-blocks)
|
|
212
259
|
- [Get block](#get-block)
|
|
213
260
|
- [Get block logs](#get-block-logs)
|
|
214
261
|
- [Push a block](#push-a-block)
|
|
215
|
-
- [
|
|
262
|
+
- [Execute block actions](#execute-block-actions)
|
|
263
|
+
- [Release a block version](#release-a-block-version)
|
|
264
|
+
- [Make a block version live](#make-a-block-version-live)
|
|
265
|
+
- [Mark a block version as broken](#mark-a-block-version-as-broken)
|
|
266
|
+
- [Rollback a live block version](#rollback-a-live-block-version)
|
|
267
|
+
- [View webhook subscriptions](#view-webhook-subscriptions)
|
|
216
268
|
- [Import content models](#import-content-models)
|
|
217
269
|
- [Import from another Contensis environment](#import-from-another-contensis-environment)
|
|
218
270
|
- [From a file](#from-a-file)
|
|
219
271
|
- [Import entries](#import-entries)
|
|
220
272
|
- [Import from another Contensis environment](#import-from-another-contensis-environment-1)
|
|
221
|
-
- [Import from a file](#import-from-a-file)
|
|
273
|
+
- [Import from a file](#import-from-a-file-1)
|
|
274
|
+
- [Import entries further reading](#import-entries-further-reading)
|
|
222
275
|
- [Remove entries](#remove-entries)
|
|
223
276
|
|
|
224
277
|
## Get started
|
|
@@ -777,9 +830,12 @@ website t.durden@example-dev>
|
|
|
777
830
|
```shell
|
|
778
831
|
website t.durden@example-dev> create key "Test key" "Key to demonstrate cli"
|
|
779
832
|
[cli] ✅ [example-dev] Created API key "Test key"
|
|
780
|
-
- Test key
|
|
781
|
-
|
|
782
|
-
|
|
833
|
+
- Test key [2022-12-13 t.durden]
|
|
834
|
+
Key to demonstrate cli
|
|
835
|
+
id: 05a0922f-53e7-4a19-a92c-c9567dbe3246
|
|
836
|
+
sharedSecret: 63d2828363f74fc1958f0d60c2306aae-02e8bc50271c479f82dba92a08d3ad16-64b93a3bb8eb4f428a1dddaecc9a84d3
|
|
837
|
+
|
|
838
|
+
[cli] ⏩ Assign your new key to a role with "set role assignments", or create a new role with "create role"
|
|
783
839
|
|
|
784
840
|
website t.durden@example-dev>
|
|
785
841
|
```
|
|
@@ -797,6 +853,252 @@ website t.durden@example-dev>
|
|
|
797
853
|
|
|
798
854
|
Run `list keys` again and you will see your new API key has been removed from the list of keys
|
|
799
855
|
|
|
856
|
+
## Manage roles
|
|
857
|
+
|
|
858
|
+
You can use the cli or shell to manage roles that are used to provide access to resources in your Contensis project
|
|
859
|
+
|
|
860
|
+
### List roles
|
|
861
|
+
|
|
862
|
+
```shell
|
|
863
|
+
website t.durden@example-dev> list roles
|
|
864
|
+
[cli] ✅ [example-dev] Retrieved roles
|
|
865
|
+
- Webinar administrators 058ad55d-bf54-4eb2-b74d-2e8ebd93a400
|
|
866
|
+
groups: System Administrators, Zengenti Marketing Team
|
|
867
|
+
users: t.turner, j.smith, s.harris
|
|
868
|
+
keys: Webinar integration
|
|
869
|
+
entries:
|
|
870
|
+
webinar: *
|
|
871
|
+
formWebinarSignUp: *
|
|
872
|
+
person: *
|
|
873
|
+
accessibleVideo: *
|
|
874
|
+
- Entry Administrators 88babee8-9d65-4bd2-93f7-735e2c016911
|
|
875
|
+
Users assigned to this role can perform all actions on all entries.
|
|
876
|
+
groups: System Administrators
|
|
877
|
+
keys: companySync, Docs import, Development, Content administrator
|
|
878
|
+
entries:
|
|
879
|
+
*: *
|
|
880
|
+
- System content syncing 0eca0043-9b91-462a-3007-c5a5b6e6d15d
|
|
881
|
+
allows background processes to sync content
|
|
882
|
+
groups: User Administrators
|
|
883
|
+
keys: Docs import, companySync, User management
|
|
884
|
+
entries:
|
|
885
|
+
*: contensisEntryBasic.*
|
|
886
|
+
- Media service 16d8947c-7571-4c31-b906-d628de8963a8
|
|
887
|
+
Create and publish media asset entries
|
|
888
|
+
keys: block-contensis-media-service
|
|
889
|
+
entries:
|
|
890
|
+
mediaAsset: *
|
|
891
|
+
|
|
892
|
+
website t.durden@example-dev>
|
|
893
|
+
```
|
|
894
|
+
|
|
895
|
+
### Create role
|
|
896
|
+
|
|
897
|
+
```shell
|
|
898
|
+
website t.durden@example-dev> create role "Test role" "Role to demonstrate cli"
|
|
899
|
+
[cli] ✅ [example-dev] Created role "Test 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
|
+
|
|
915
|
+
[cli] ⏩ Give access to your role with "set role assignments", allow your role to do things with "set role permissions"
|
|
916
|
+
|
|
917
|
+
website t.durden@example-dev>
|
|
918
|
+
```
|
|
919
|
+
|
|
920
|
+
Run `list roles` again and you will see your new role added to the returned list
|
|
921
|
+
|
|
922
|
+
### Set role details
|
|
923
|
+
|
|
924
|
+
#### Assignments
|
|
925
|
+
|
|
926
|
+
Assign users, groups or keys to your role. We will make assignments using their name or user id for users.
|
|
927
|
+
|
|
928
|
+
```shell
|
|
929
|
+
website t.durden@example-dev> set role assignments "Test role" --assign-keys "Test key"
|
|
930
|
+
[cli] ✅ [example-dev] Retrieved roles
|
|
931
|
+
[cli] ℹ Updating role with details
|
|
932
|
+
|
|
933
|
+
assignments:
|
|
934
|
+
- apiKeys:
|
|
935
|
+
Test key
|
|
936
|
+
|
|
937
|
+
[cli] ✅ Succesfully updated role
|
|
938
|
+
|
|
939
|
+
id: 1329b3cc-0267-480e-a115-b0beaae8fe5b
|
|
940
|
+
projectId: website
|
|
941
|
+
name: Test role
|
|
942
|
+
description: Role to demonstrate cli
|
|
943
|
+
enabled: true
|
|
944
|
+
permissions:
|
|
945
|
+
webhookSubscriptions:
|
|
946
|
+
proxies:
|
|
947
|
+
eventStreams:
|
|
948
|
+
blocks:
|
|
949
|
+
renderers:
|
|
950
|
+
views:
|
|
951
|
+
assignments:
|
|
952
|
+
apiKeys:
|
|
953
|
+
Test key
|
|
954
|
+
|
|
955
|
+
website t.durden@example-dev>
|
|
956
|
+
```
|
|
957
|
+
|
|
958
|
+
#### Permissions
|
|
959
|
+
|
|
960
|
+
Set permissions to give the assignees of your role access to your project resources.
|
|
961
|
+
|
|
962
|
+
We can set permissions for entries.
|
|
963
|
+
|
|
964
|
+
```shell
|
|
965
|
+
website t.durden@example-dev> set role permissions "Test role" --content-type-ids simpleContent linkedContent
|
|
966
|
+
[cli] ✅ [example-dev] Retrieved roles
|
|
967
|
+
[cli] ℹ Updating role with details
|
|
968
|
+
|
|
969
|
+
permissions:
|
|
970
|
+
- entries:
|
|
971
|
+
id: simpleContent
|
|
972
|
+
id: linkedContent
|
|
973
|
+
|
|
974
|
+
[cli] ✅ Succesfully updated role
|
|
975
|
+
|
|
976
|
+
id: 1329b3cc-0267-480e-a115-b0beaae8fe5b
|
|
977
|
+
projectId: website
|
|
978
|
+
name: Test role
|
|
979
|
+
description: Role to demonstrate cli
|
|
980
|
+
enabled: true
|
|
981
|
+
permissions:
|
|
982
|
+
entries:
|
|
983
|
+
- languages:
|
|
984
|
+
*
|
|
985
|
+
id: simpleContent
|
|
986
|
+
actions:
|
|
987
|
+
*
|
|
988
|
+
- languages:
|
|
989
|
+
*
|
|
990
|
+
id: linkedContent
|
|
991
|
+
actions:
|
|
992
|
+
*
|
|
993
|
+
webhookSubscriptions:
|
|
994
|
+
proxies:
|
|
995
|
+
eventStreams:
|
|
996
|
+
blocks:
|
|
997
|
+
renderers:
|
|
998
|
+
views:
|
|
999
|
+
assignments:
|
|
1000
|
+
apiKeys:
|
|
1001
|
+
Test key
|
|
1002
|
+
|
|
1003
|
+
website t.durden@example-dev>
|
|
1004
|
+
```
|
|
1005
|
+
|
|
1006
|
+
### Disable role
|
|
1007
|
+
|
|
1008
|
+
Disable a role by using the command `set role enabled` with the `--disabled` flag
|
|
1009
|
+
|
|
1010
|
+
```shell
|
|
1011
|
+
website t.durden@example-dev> set role enabled "Test role" --disabled
|
|
1012
|
+
[cli] ✅ [example-dev] Retrieved roles
|
|
1013
|
+
[cli] ℹ Updating role with details
|
|
1014
|
+
|
|
1015
|
+
enabled: false
|
|
1016
|
+
|
|
1017
|
+
[cli] ✅ Succesfully updated role
|
|
1018
|
+
|
|
1019
|
+
id: 1329b3cc-0267-480e-a115-b0beaae8fe5b
|
|
1020
|
+
projectId: website
|
|
1021
|
+
name: Test role
|
|
1022
|
+
description: Role to demonstrate cli
|
|
1023
|
+
enabled: false
|
|
1024
|
+
|
|
1025
|
+
website t.durden@example-dev>
|
|
1026
|
+
```
|
|
1027
|
+
|
|
1028
|
+
Enable the role again by calling the same command without the `--disabled` flag
|
|
1029
|
+
|
|
1030
|
+
```shell
|
|
1031
|
+
website t.durden@example-dev> set role enabled "Test role"
|
|
1032
|
+
[cli] ✅ [example-dev] Retrieved roles
|
|
1033
|
+
[cli] ℹ Updating role with details
|
|
1034
|
+
|
|
1035
|
+
enabled: true
|
|
1036
|
+
|
|
1037
|
+
[cli] ✅ Succesfully updated role
|
|
1038
|
+
|
|
1039
|
+
id: 1329b3cc-0267-480e-a115-b0beaae8fe5b
|
|
1040
|
+
projectId: migratortron
|
|
1041
|
+
name: Test role
|
|
1042
|
+
description: Role to demonstrate cli
|
|
1043
|
+
enabled: true
|
|
1044
|
+
|
|
1045
|
+
website t.durden@example-dev>
|
|
1046
|
+
```
|
|
1047
|
+
|
|
1048
|
+
### Remove role
|
|
1049
|
+
|
|
1050
|
+
```shell
|
|
1051
|
+
website t.durden@example-dev> remove role "Test role"
|
|
1052
|
+
[cli] ✅ [example-dev] Retrieved roles
|
|
1053
|
+
[cli] ✅ [example-dev] Deleted role Test role
|
|
1054
|
+
|
|
1055
|
+
website t.durden@example-dev>
|
|
1056
|
+
```
|
|
1057
|
+
|
|
1058
|
+
Run `list roles` again and you will see your new role has been removed from the list of role
|
|
1059
|
+
|
|
1060
|
+
## View webhook subscriptions
|
|
1061
|
+
|
|
1062
|
+
```shell
|
|
1063
|
+
website t.durden@example-dev> list webhooks
|
|
1064
|
+
[cli] ✅ [example-dev] Webhook subscriptions:
|
|
1065
|
+
- Test webhook 43969978-f9c1-4ee6-a515-11e0ceaddfeb [2022-12-13 t.durden]
|
|
1066
|
+
[POST] https://webhook.site/dede53b3-f044-4640-8634-5f0061ade5c7
|
|
1067
|
+
headers:
|
|
1068
|
+
test: true
|
|
1069
|
+
credential: 🤐
|
|
1070
|
+
topics: resourceType:entry event:[created updated]
|
|
1071
|
+
- More Testing 52e6bac1-1d81-462e-b483-d22034173cb4 [2022-07-15 b.feaver]
|
|
1072
|
+
[POST] https://webhook.site/cd0e99b5-d658-423c-acf5-47af7dfcaa06
|
|
1073
|
+
topics: resourceType:entry event:[published] contentTypeId:[blogPost]
|
|
1074
|
+
|
|
1075
|
+
website t.durden@example-dev>
|
|
1076
|
+
```
|
|
1077
|
+
|
|
1078
|
+
```shell
|
|
1079
|
+
website t.durden@example-dev> get webhook "Slack"
|
|
1080
|
+
[cli] ✅ [example-dev] Webhook subscriptions:
|
|
1081
|
+
- Slack 5a8dfee1-238f-44fe-b8aa-4b932099500c [2021-07-28 g.moore]
|
|
1082
|
+
Send a notification to a channel
|
|
1083
|
+
[POST] https://webhook.site/5ac0d1c4-8e2e-42c2-a055-66dc7e04843a
|
|
1084
|
+
topics:
|
|
1085
|
+
- resourceType: entry
|
|
1086
|
+
event:
|
|
1087
|
+
published
|
|
1088
|
+
unpublished
|
|
1089
|
+
contentTypeId:
|
|
1090
|
+
article
|
|
1091
|
+
- resourceType: entry
|
|
1092
|
+
event:
|
|
1093
|
+
workflowStateChanged
|
|
1094
|
+
workflowState:
|
|
1095
|
+
contensisEntryApproval.awaitingApproval
|
|
1096
|
+
contensisEntryApproval.declined
|
|
1097
|
+
templates: entry
|
|
1098
|
+
|
|
1099
|
+
website t.durden@example-dev>
|
|
1100
|
+
```
|
|
1101
|
+
|
|
800
1102
|
## Manage content Blocks
|
|
801
1103
|
|
|
802
1104
|
You can manage blocks for any Contensis project using the following commands
|
|
@@ -844,6 +1146,9 @@ website t.durden@example-dev> get block simple-block master
|
|
|
844
1146
|
website t.durden@example-dev>
|
|
845
1147
|
```
|
|
846
1148
|
|
|
1149
|
+
> **Tip**
|
|
1150
|
+
> Add a version number or `latest` to the end of your `get block {block-id} {branch} {version}` command to output a complete set of details for that block version
|
|
1151
|
+
|
|
847
1152
|
### Get block logs
|
|
848
1153
|
|
|
849
1154
|
```shell
|
|
@@ -874,9 +1179,13 @@ website t.durden@example-dev> push block cli-test-block ghcr.io/contensis/conten
|
|
|
874
1179
|
website t.durden@example-dev>
|
|
875
1180
|
```
|
|
876
1181
|
|
|
877
|
-
###
|
|
1182
|
+
### Execute block actions
|
|
1183
|
+
|
|
1184
|
+
We can perform certain actions on a specific version of a block with the `execute block action` command
|
|
878
1185
|
|
|
879
|
-
|
|
1186
|
+
#### Release a block version
|
|
1187
|
+
|
|
1188
|
+
To mark a block version as "released", first get the latest block version number
|
|
880
1189
|
|
|
881
1190
|
```shell
|
|
882
1191
|
website t.durden@example-dev>get block contensis-website master latest
|
|
@@ -906,11 +1215,11 @@ website t.durden@example-dev>get block contensis-website master latest
|
|
|
906
1215
|
website t.durden@example-dev>
|
|
907
1216
|
```
|
|
908
1217
|
|
|
909
|
-
Add the block version number to the `release block` command
|
|
1218
|
+
Add the block version number to the `execute block action release {block-id} {version}` command
|
|
910
1219
|
|
|
911
1220
|
```shell
|
|
912
1221
|
|
|
913
|
-
website t.durden@example-dev>
|
|
1222
|
+
website t.durden@example-dev> execute block action release contensis-website 78
|
|
914
1223
|
[cli] ✅ [example-dev] Released block contensis-website in project website
|
|
915
1224
|
v78 contensis-website
|
|
916
1225
|
state: available
|
|
@@ -937,15 +1246,41 @@ website t.durden@example-dev> release block contensis-website 78
|
|
|
937
1246
|
website t.durden@example-dev>
|
|
938
1247
|
```
|
|
939
1248
|
|
|
940
|
-
|
|
1249
|
+
#### Make a block version live
|
|
1250
|
+
|
|
1251
|
+
Follow the examples for [releasing a block version](#release-a-block-version) except target your command to this action
|
|
1252
|
+
|
|
1253
|
+
```shell
|
|
1254
|
+
execute block action makelive {block-id} {version}
|
|
1255
|
+
```
|
|
941
1256
|
|
|
942
|
-
|
|
1257
|
+
#### Mark a block version as broken
|
|
1258
|
+
|
|
1259
|
+
Follow the examples for [releasing a block version](#release-a-block-version) except target your command to this action
|
|
1260
|
+
|
|
1261
|
+
```shell
|
|
1262
|
+
execute block action markasbroken {block-id} {version}
|
|
1263
|
+
```
|
|
1264
|
+
|
|
1265
|
+
#### Rollback a live block version
|
|
1266
|
+
|
|
1267
|
+
Follow the examples for [releasing a block version](#release-a-block-version) except target your command to this action
|
|
1268
|
+
|
|
1269
|
+
```shell
|
|
1270
|
+
execute block action rollback {block-id} {version}
|
|
1271
|
+
```
|
|
943
1272
|
|
|
944
|
-
|
|
1273
|
+
## Import content models
|
|
945
1274
|
|
|
946
1275
|
### Import from another Contensis environment
|
|
947
1276
|
|
|
948
|
-
|
|
1277
|
+
Connect to your "source" environment, ensure you can fetch the models from this environment first and that these models contain the dependencies you plan on importing to your "target" environment.
|
|
1278
|
+
|
|
1279
|
+
Check that the right assets will eventually be imported with the `list models` or `get model {modelIds...}` command
|
|
1280
|
+
|
|
1281
|
+
When you are happy the expected models are being returned for your import, you should then `connect` to your "target" environment (and `set project`) and when we are successfully connected to our target project, call the `import models` command, ensuring you add any arguments you used with your `get model` check earlier.
|
|
1282
|
+
|
|
1283
|
+
#### Specify a list of models to import
|
|
949
1284
|
|
|
950
1285
|
```shell
|
|
951
1286
|
website t.durden@example-dev> import models plant --source-alias example-dev --source-project-id leif
|
|
@@ -984,7 +1319,7 @@ Components:
|
|
|
984
1319
|
website t.durden@example-dev>
|
|
985
1320
|
```
|
|
986
1321
|
|
|
987
|
-
|
|
1322
|
+
#### Import all models from the source project
|
|
988
1323
|
|
|
989
1324
|
```shell
|
|
990
1325
|
website t.durden@example-dev> import models --source-alias example-dev --source-project-id leif
|
|
@@ -1115,17 +1450,12 @@ website t.durden@example-dev>
|
|
|
1115
1450
|
website t.durden@example-dev> import models --from-file ./content-models.json
|
|
1116
1451
|
```
|
|
1117
1452
|
|
|
1118
|
-
The output will be the same as the
|
|
1453
|
+
The output will be the same as the `import models` examples above
|
|
1119
1454
|
|
|
1120
1455
|
<sup><sub>Add the `--commit` option to make the changes, be very careful using this! There is no going back</sub></sup>
|
|
1121
1456
|
|
|
1122
1457
|
## Import entries
|
|
1123
1458
|
|
|
1124
|
-
The import commands are made possible by using the `migratortron` library. There is further documentation here:
|
|
1125
|
-
|
|
1126
|
-
- [`migratortron` on npmjs](https://www.npmjs.com/package/migratortron)
|
|
1127
|
-
- [`contensis-importer` on npmjs](https://www.npmjs.com/package/contensis-importer)
|
|
1128
|
-
|
|
1129
1459
|
### Import from another Contensis environment
|
|
1130
1460
|
|
|
1131
1461
|
Connect to your "source" environment first, ensure you can fetch the entries you plan on importing from here and your query / filters are working to fetch exactly the data you are expecting with the `get entries` command. Add the `--dependents` option to fetch all of the entries that will eventually be imported.
|
|
@@ -1259,6 +1589,13 @@ The output will be the same as the previous command
|
|
|
1259
1589
|
|
|
1260
1590
|
<sup><sub>Add the `--commit` option to make the changes, be very careful using this! There is no going back</sub></sup>
|
|
1261
1591
|
|
|
1592
|
+
### Import entries further reading
|
|
1593
|
+
|
|
1594
|
+
The import commands are made possible by using the `migratortron` library. There is further documentation here:
|
|
1595
|
+
|
|
1596
|
+
- [`migratortron` on npmjs](https://www.npmjs.com/package/migratortron)
|
|
1597
|
+
- [`contensis-importer` on npmjs](https://www.npmjs.com/package/contensis-importer)
|
|
1598
|
+
|
|
1262
1599
|
## Remove entries
|
|
1263
1600
|
|
|
1264
1601
|
Delete entries by id
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var execute_exports = {};
|
|
20
|
+
__export(execute_exports, {
|
|
21
|
+
makeExecuteCommand: () => makeExecuteCommand
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(execute_exports);
|
|
24
|
+
var import_commander = require("commander");
|
|
25
|
+
var import_ContensisCliService = require("../services/ContensisCliService");
|
|
26
|
+
const makeExecuteCommand = () => {
|
|
27
|
+
const execute = new import_commander.Command().command("execute").description("execute block actions").addHelpText("after", `
|
|
28
|
+
`).showHelpAfterError(true).exitOverride();
|
|
29
|
+
const block = execute.command("block").description("execute block command to invoke block actions");
|
|
30
|
+
const action = block.command("action").description("execute block action command to invoke block actions");
|
|
31
|
+
const blockIdArg = new import_commander.Argument(
|
|
32
|
+
"<block-id>",
|
|
33
|
+
"the name of the block to perform action with"
|
|
34
|
+
);
|
|
35
|
+
const blockVersionArg = new import_commander.Argument(
|
|
36
|
+
"<version>",
|
|
37
|
+
"the block version to perform action with"
|
|
38
|
+
);
|
|
39
|
+
action.command("release").description("release a block version").addArgument(blockIdArg).addArgument(blockVersionArg).usage("<block-id> <version>").addHelpText(
|
|
40
|
+
"after",
|
|
41
|
+
`
|
|
42
|
+
Example call:
|
|
43
|
+
> execute block action release contensis-app 3
|
|
44
|
+
`
|
|
45
|
+
).action(async (blockId, version, opts) => {
|
|
46
|
+
await (0, import_ContensisCliService.cliCommand)(
|
|
47
|
+
["execute", "block", "action", "release", blockId],
|
|
48
|
+
opts
|
|
49
|
+
).ExecuteBlockAction("release", blockId, version);
|
|
50
|
+
});
|
|
51
|
+
action.command("makelive").description("make a block version live").addArgument(blockIdArg).addArgument(blockVersionArg).usage("<block-id> <version>").addHelpText(
|
|
52
|
+
"after",
|
|
53
|
+
`
|
|
54
|
+
Example call:
|
|
55
|
+
> execute block action makelive contensis-app 3
|
|
56
|
+
`
|
|
57
|
+
).action(async (blockId, version, opts) => {
|
|
58
|
+
await (0, import_ContensisCliService.cliCommand)(
|
|
59
|
+
["execute", "block", "action", "makelive", blockId],
|
|
60
|
+
opts
|
|
61
|
+
).ExecuteBlockAction("makeLive", blockId, version);
|
|
62
|
+
});
|
|
63
|
+
action.command("rollback").description("rollback a live block version to last live version").addArgument(blockIdArg).addArgument(blockVersionArg).usage("<block-id> <version>").addHelpText(
|
|
64
|
+
"after",
|
|
65
|
+
`
|
|
66
|
+
Example call:
|
|
67
|
+
> execute block action rollback contensis-app 3
|
|
68
|
+
`
|
|
69
|
+
).action(async (blockId, version, opts) => {
|
|
70
|
+
await (0, import_ContensisCliService.cliCommand)(
|
|
71
|
+
["execute", "block", "action", "rollback", blockId],
|
|
72
|
+
opts
|
|
73
|
+
).ExecuteBlockAction("rollback", blockId, version);
|
|
74
|
+
});
|
|
75
|
+
action.command("markasbroken").description("mark a block version as broken").addArgument(blockIdArg).addArgument(blockVersionArg).usage("<block-id> <version>").addHelpText(
|
|
76
|
+
"after",
|
|
77
|
+
`
|
|
78
|
+
Example call:
|
|
79
|
+
> execute block action markasbroken contensis-app 3
|
|
80
|
+
`
|
|
81
|
+
).action(async (blockId, version, opts) => {
|
|
82
|
+
await (0, import_ContensisCliService.cliCommand)(
|
|
83
|
+
["execute", "block", "action", "markasbroken", blockId],
|
|
84
|
+
opts
|
|
85
|
+
).ExecuteBlockAction("markAsBroken", blockId, version);
|
|
86
|
+
});
|
|
87
|
+
return execute;
|
|
88
|
+
};
|
|
89
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
90
|
+
0 && (module.exports = {
|
|
91
|
+
makeExecuteCommand
|
|
92
|
+
});
|
|
93
|
+
//# sourceMappingURL=execute.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/commands/execute.ts"],
|
|
4
|
+
"sourcesContent": ["import { Argument, Command } from 'commander';\nimport { cliCommand } from '~/services/ContensisCliService';\n\nexport const makeExecuteCommand = () => {\n const execute = new Command()\n .command('execute')\n .description('execute block actions')\n .addHelpText('after', `\\n`)\n .showHelpAfterError(true)\n .exitOverride();\n\n const block = execute\n .command('block')\n .description('execute block command to invoke block actions');\n\n const action = block\n .command('action')\n .description('execute block action command to invoke block actions');\n\n const blockIdArg = new Argument(\n '<block-id>',\n 'the name of the block to perform action with'\n );\n const blockVersionArg = new Argument(\n '<version>',\n 'the block version to perform action with'\n );\n\n action\n .command('release')\n .description('release a block version')\n .addArgument(blockIdArg)\n .addArgument(blockVersionArg)\n .usage('<block-id> <version>')\n .addHelpText(\n 'after',\n `\nExample call:\n > execute block action release contensis-app 3\\n`\n )\n .action(async (blockId: string, version: string, opts) => {\n await cliCommand(\n ['execute', 'block', 'action', 'release', blockId],\n opts\n ).ExecuteBlockAction('release', blockId, version);\n });\n\n action\n .command('makelive')\n .description('make a block version live')\n .addArgument(blockIdArg)\n .addArgument(blockVersionArg)\n .usage('<block-id> <version>')\n .addHelpText(\n 'after',\n `\nExample call:\n > execute block action makelive contensis-app 3\\n`\n )\n .action(async (blockId: string, version: string, opts) => {\n await cliCommand(\n ['execute', 'block', 'action', 'makelive', blockId],\n opts\n ).ExecuteBlockAction('makeLive', blockId, version);\n });\n\n action\n .command('rollback')\n .description('rollback a live block version to last live version')\n .addArgument(blockIdArg)\n .addArgument(blockVersionArg)\n .usage('<block-id> <version>')\n .addHelpText(\n 'after',\n `\nExample call:\n > execute block action rollback contensis-app 3\\n`\n )\n .action(async (blockId: string, version: string, opts) => {\n await cliCommand(\n ['execute', 'block', 'action', 'rollback', blockId],\n opts\n ).ExecuteBlockAction('rollback', blockId, version);\n });\n\n action\n .command('markasbroken')\n .description('mark a block version as broken')\n .addArgument(blockIdArg)\n .addArgument(blockVersionArg)\n .usage('<block-id> <version>')\n .addHelpText(\n 'after',\n `\nExample call:\n > execute block action markasbroken contensis-app 3\\n`\n )\n .action(async (blockId: string, version: string, opts) => {\n await cliCommand(\n ['execute', 'block', 'action', 'markasbroken', blockId],\n opts\n ).ExecuteBlockAction('markAsBroken', blockId, version);\n });\n\n return execute;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAkC;AAClC,iCAA2B;AAEpB,MAAM,qBAAqB,MAAM;AACtC,QAAM,UAAU,IAAI,yBAAQ,EACzB,QAAQ,SAAS,EACjB,YAAY,uBAAuB,EACnC,YAAY,SAAS;AAAA,CAAI,EACzB,mBAAmB,IAAI,EACvB,aAAa;AAEhB,QAAM,QAAQ,QACX,QAA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,YAAY,gCAAgC,EAC5C,YAAY,UAAU,EACtB,YAAY,eAAe,EAC3B,MAAM,sBAAsB,EAC5B;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,EAGF,EACC,OAAO,OAAO,SAAiB,SAAiB,SAAS;AACxD,cAAM;AAAA,MACJ,CAAC,WAAW,SAAS,UAAU,gBAAgB,OAAO;AAAA,MACtD;AAAA,IACF,EAAE,mBAAmB,gBAAgB,SAAS,OAAO;AAAA,EACvD,CAAC;AAEH,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/commands/get.js
CHANGED
|
@@ -26,7 +26,7 @@ var import_commander = require("commander");
|
|
|
26
26
|
var import_ContensisCliService = require("../services/ContensisCliService");
|
|
27
27
|
var import_globalOptions = require("./globalOptions");
|
|
28
28
|
const makeGetCommand = () => {
|
|
29
|
-
const program = new import_commander.Command().command("get").addHelpText("after", `
|
|
29
|
+
const program = new import_commander.Command().command("get").description("get command").addHelpText("after", `
|
|
30
30
|
`).showHelpAfterError(true).exitOverride();
|
|
31
31
|
program.command("version").description("get current Contensis version").addHelpText(
|
|
32
32
|
"after",
|
package/dist/commands/get.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/commands/get.ts"],
|
|
4
|
-
"sourcesContent": ["import { Argument, Command } from 'commander';\nimport { cliCommand } from '~/services/ContensisCliService';\nimport { mapContensisOpts } from './globalOptions';\n\nexport const makeGetCommand = () => {\n const program = new Command()\n .command('get')\n .addHelpText('after', `\\n`)\n .showHelpAfterError(true)\n .exitOverride();\n\n program\n .command('version')\n .description('get current Contensis version')\n .addHelpText(\n 'after',\n `\nExample call:\n > version\n`\n )\n .action(async opts => {\n await cliCommand(['get', 'version'], opts).PrintContensisVersion();\n });\n\n program\n .command('project')\n .description('get a project')\n .argument('[projectId]', 'id of the project to get (default: current)')\n .addHelpText(\n 'after',\n `\nExample call:\n > get project website\n`\n )\n .action(async (projectId: string, opts) => {\n await cliCommand(['get', 'project', projectId], opts).PrintProject(\n projectId\n );\n });\n\n program\n .command('role')\n .description('get a role')\n .argument('<roleNameOrId>', 'id or name of the role to get')\n .addHelpText(\n 'after',\n `\nExample call:\n > get role \"entry admin\"\n`\n )\n .action(async (roleNameOrId: string, opts) => {\n await cliCommand(['get', 'role', roleNameOrId], opts).PrintRole(\n roleNameOrId\n );\n });\n\n program\n .command('webhook')\n .description('get a webhook')\n .argument('<webhookNameOrId...>', 'id or name of the webhook(s) to get')\n .addHelpText(\n 'after',\n `\nExample call:\n > get webhook \"Slack notification\"\n`\n )\n .action(async (webhookNameOrId: string[], opts) => {\n await cliCommand(\n ['get', 'webhook', webhookNameOrId.join(' ')],\n opts\n ).PrintWebhookSubscriptions(webhookNameOrId);\n });\n\n program\n .command('model')\n .description('get a content model')\n .argument('<contentTypeId...>', 'ids of the content models to get')\n .addHelpText(\n 'after',\n `\nExample call:\n > get model podcast podcastLinks\n`\n )\n .action(async (modelIds: string[], opts) => {\n await cliCommand(\n ['get', 'model', modelIds.join(' ')],\n opts\n ).PrintContentModels(modelIds);\n });\n\n program\n .command('contenttype')\n .description('get a content type')\n .argument('<contentTypeId>', 'the API id of the content type to get')\n .addHelpText(\n 'after',\n `\nExample call:\n > get contenttype {contentTypeId} -o content-type-backup.json\n`\n )\n .action(async (contentTypeId: string, opts) => {\n await cliCommand(\n ['get', 'contenttype', contentTypeId],\n opts\n ).PrintContentType(contentTypeId);\n });\n\n program\n .command('component')\n .description('get a component')\n .argument('<componentId>', 'the API id of the component to get')\n .addHelpText(\n 'after',\n `\nExample call:\n > get component {componentId} -o component-backup.json\n`\n )\n .action(async (componentId: string, opts) => {\n await cliCommand(['get', 'component', componentId], opts).PrintComponent(\n componentId\n );\n });\n\n program\n .command('entries')\n .description('get entries')\n .argument(\n '[search phrase]',\n 'get entries with the search phrase, use quotes for multiple words'\n )\n .option('-i --id <id...>', 'the entry id(s) to get')\n .option(\n '-d, --dependents',\n 'find and return any dependencies of all found entries'\n )\n .option(\n '-fi, --fields <fields...>',\n 'limit the output fields on returned entries'\n )\n .option(\n '-q, --zenql <zenql>',\n 'get entries with a supplied ZenQL statement'\n )\n .addHelpText(\n 'after',\n `\nExample call:\n > get entries --zenql \"sys.contentTypeId = blog\" --fields entryTitle entryDescription sys.id --output ./blog-posts.csv --format csv\n`\n )\n .action(async (phrase: string, opts, cmd) => {\n // console.log('phrase: ', phrase, '\\nopts:', JSON.stringify(opts, null, 2));\n // console.log('opts:', JSON.stringify(opts, null, 2));\n await cliCommand(\n ['get', 'entries'],\n opts,\n mapContensisOpts({ phrase, ...opts })\n ).GetEntries({\n withDependents: opts.dependents,\n });\n });\n\n const block = program\n .command('block')\n .description('get a block or block version')\n .argument('[blockId]', 'the block to get version details for')\n .argument(\n '[branch]',\n 'the branch of the block to get version details for',\n 'main'\n )\n .argument(\n '[version]',\n 'get a specific version of the block pushed to the specified branch'\n )\n .addHelpText(\n 'after',\n `\nExample call:\n > get block contensis-website master latest\n`\n )\n .action(async (blockId: string, branch: string, version: string, opts) => {\n await cliCommand(['get', 'block'], opts).PrintBlockVersions(\n blockId,\n branch,\n version\n );\n });\n\n const dataCenter = new Argument(\n '[dataCenter]',\n 'the datacentre of the block to get logs for'\n )\n .choices(['hq', 'london', 'manchester'])\n .default('hq');\n\n block\n .command('logs')\n .description('get logs for a block')\n .argument('[blockId]', 'the block to get version logs for')\n .argument(\n '[branch]',\n 'the branch of the block to get version details for',\n 'main'\n )\n .argument(\n '[version]',\n 'the version of the block pushed to the branch to get logs for',\n 'latest'\n )\n .addArgument(dataCenter)\n .usage('get block logs [blockId] [branch] [version] [dataCenter]')\n .addHelpText(\n 'after',\n `\nExample call:\n > get block logs contensis-website master\n > get block logs contensis-website master latest london\n`\n )\n .action(\n async (\n blockId: string,\n branch: string,\n version: string,\n dataCenter: 'hq' | 'manchester' | 'london',\n opts\n ) => {\n await cliCommand(['get', 'block', 'logs'], opts).PrintBlockLogs(\n blockId,\n branch,\n version,\n dataCenter\n );\n }\n );\n\n return program;\n};\n\nexport const get = makeGetCommand();\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAkC;AAClC,iCAA2B;AAC3B,2BAAiC;AAE1B,MAAM,iBAAiB,MAAM;AAClC,QAAM,UAAU,IAAI,yBAAQ,EACzB,QAAQ,KAAK,EACb,YAAY,SAAS;AAAA,CAAI,EACzB,mBAAmB,IAAI,EACvB,aAAa;AAEhB,UACG,QAAQ,SAAS,EACjB,YAAY,+BAA+B,EAC3C;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,EAIF,EACC,OAAO,OAAM,SAAQ;AACpB,cAAM,uCAAW,CAAC,OAAO,SAAS,GAAG,IAAI,EAAE,sBAAsB;AAAA,EACnE,CAAC;AAEH,UACG,QAAQ,SAAS,EACjB,YAAY,eAAe,EAC3B,SAAS,eAAe,6CAA6C,EACrE;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,EAIF,EACC,OAAO,OAAO,WAAmB,SAAS;AACzC,cAAM,uCAAW,CAAC,OAAO,WAAW,SAAS,GAAG,IAAI,EAAE;AAAA,MACpD;AAAA,IACF;AAAA,EACF,CAAC;AAEH,UACG,QAAQ,MAAM,EACd,YAAY,YAAY,EACxB,SAAS,kBAAkB,+BAA+B,EAC1D;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,EAIF,EACC,OAAO,OAAO,cAAsB,SAAS;AAC5C,cAAM,uCAAW,CAAC,OAAO,QAAQ,YAAY,GAAG,IAAI,EAAE;AAAA,MACpD;AAAA,IACF;AAAA,EACF,CAAC;AAEH,UACG,QAAQ,SAAS,EACjB,YAAY,eAAe,EAC3B,SAAS,wBAAwB,qCAAqC,EACtE;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,EAIF,EACC,OAAO,OAAO,iBAA2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AM,MAAM,eAAe;",
|
|
4
|
+
"sourcesContent": ["import { Argument, Command } from 'commander';\nimport { cliCommand } from '~/services/ContensisCliService';\nimport { mapContensisOpts } from './globalOptions';\n\nexport const makeGetCommand = () => {\n const program = new Command()\n .command('get')\n .description('get command')\n .addHelpText('after', `\\n`)\n .showHelpAfterError(true)\n .exitOverride();\n\n program\n .command('version')\n .description('get current Contensis version')\n .addHelpText(\n 'after',\n `\nExample call:\n > version\n`\n )\n .action(async opts => {\n await cliCommand(['get', 'version'], opts).PrintContensisVersion();\n });\n\n program\n .command('project')\n .description('get a project')\n .argument('[projectId]', 'id of the project to get (default: current)')\n .addHelpText(\n 'after',\n `\nExample call:\n > get project website\n`\n )\n .action(async (projectId: string, opts) => {\n await cliCommand(['get', 'project', projectId], opts).PrintProject(\n projectId\n );\n });\n\n program\n .command('role')\n .description('get a role')\n .argument('<roleNameOrId>', 'id or name of the role to get')\n .addHelpText(\n 'after',\n `\nExample call:\n > get role \"entry admin\"\n`\n )\n .action(async (roleNameOrId: string, opts) => {\n await cliCommand(['get', 'role', roleNameOrId], opts).PrintRole(\n roleNameOrId\n );\n });\n\n program\n .command('webhook')\n .description('get a webhook')\n .argument('<webhookNameOrId...>', 'id or name of the webhook(s) to get')\n .addHelpText(\n 'after',\n `\nExample call:\n > get webhook \"Slack notification\"\n`\n )\n .action(async (webhookNameOrId: string[], opts) => {\n await cliCommand(\n ['get', 'webhook', webhookNameOrId.join(' ')],\n opts\n ).PrintWebhookSubscriptions(webhookNameOrId);\n });\n\n program\n .command('model')\n .description('get a content model')\n .argument('<contentTypeId...>', 'ids of the content models to get')\n .addHelpText(\n 'after',\n `\nExample call:\n > get model podcast podcastLinks\n`\n )\n .action(async (modelIds: string[], opts) => {\n await cliCommand(\n ['get', 'model', modelIds.join(' ')],\n opts\n ).PrintContentModels(modelIds);\n });\n\n program\n .command('contenttype')\n .description('get a content type')\n .argument('<contentTypeId>', 'the API id of the content type to get')\n .addHelpText(\n 'after',\n `\nExample call:\n > get contenttype {contentTypeId} -o content-type-backup.json\n`\n )\n .action(async (contentTypeId: string, opts) => {\n await cliCommand(\n ['get', 'contenttype', contentTypeId],\n opts\n ).PrintContentType(contentTypeId);\n });\n\n program\n .command('component')\n .description('get a component')\n .argument('<componentId>', 'the API id of the component to get')\n .addHelpText(\n 'after',\n `\nExample call:\n > get component {componentId} -o component-backup.json\n`\n )\n .action(async (componentId: string, opts) => {\n await cliCommand(['get', 'component', componentId], opts).PrintComponent(\n componentId\n );\n });\n\n program\n .command('entries')\n .description('get entries')\n .argument(\n '[search phrase]',\n 'get entries with the search phrase, use quotes for multiple words'\n )\n .option('-i --id <id...>', 'the entry id(s) to get')\n .option(\n '-d, --dependents',\n 'find and return any dependencies of all found entries'\n )\n .option(\n '-fi, --fields <fields...>',\n 'limit the output fields on returned entries'\n )\n .option(\n '-q, --zenql <zenql>',\n 'get entries with a supplied ZenQL statement'\n )\n .addHelpText(\n 'after',\n `\nExample call:\n > get entries --zenql \"sys.contentTypeId = blog\" --fields entryTitle entryDescription sys.id --output ./blog-posts.csv --format csv\n`\n )\n .action(async (phrase: string, opts, cmd) => {\n // console.log('phrase: ', phrase, '\\nopts:', JSON.stringify(opts, null, 2));\n // console.log('opts:', JSON.stringify(opts, null, 2));\n await cliCommand(\n ['get', 'entries'],\n opts,\n mapContensisOpts({ phrase, ...opts })\n ).GetEntries({\n withDependents: opts.dependents,\n });\n });\n\n const block = program\n .command('block')\n .description('get a block or block version')\n .argument('[blockId]', 'the block to get version details for')\n .argument(\n '[branch]',\n 'the branch of the block to get version details for',\n 'main'\n )\n .argument(\n '[version]',\n 'get a specific version of the block pushed to the specified branch'\n )\n .addHelpText(\n 'after',\n `\nExample call:\n > get block contensis-website master latest\n`\n )\n .action(async (blockId: string, branch: string, version: string, opts) => {\n await cliCommand(['get', 'block'], opts).PrintBlockVersions(\n blockId,\n branch,\n version\n );\n });\n\n const dataCenter = new Argument(\n '[dataCenter]',\n 'the datacentre of the block to get logs for'\n )\n .choices(['hq', 'london', 'manchester'])\n .default('hq');\n\n block\n .command('logs')\n .description('get logs for a block')\n .argument('[blockId]', 'the block to get version logs for')\n .argument(\n '[branch]',\n 'the branch of the block to get version details for',\n 'main'\n )\n .argument(\n '[version]',\n 'the version of the block pushed to the branch to get logs for',\n 'latest'\n )\n .addArgument(dataCenter)\n .usage('get block logs [blockId] [branch] [version] [dataCenter]')\n .addHelpText(\n 'after',\n `\nExample call:\n > get block logs contensis-website master\n > get block logs contensis-website master latest london\n`\n )\n .action(\n async (\n blockId: string,\n branch: string,\n version: string,\n dataCenter: 'hq' | 'manchester' | 'london',\n opts\n ) => {\n await cliCommand(['get', 'block', 'logs'], opts).PrintBlockLogs(\n blockId,\n branch,\n version,\n dataCenter\n );\n }\n );\n\n return program;\n};\n\nexport const get = makeGetCommand();\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAkC;AAClC,iCAA2B;AAC3B,2BAAiC;AAE1B,MAAM,iBAAiB,MAAM;AAClC,QAAM,UAAU,IAAI,yBAAQ,EACzB,QAAQ,KAAK,EACb,YAAY,aAAa,EACzB,YAAY,SAAS;AAAA,CAAI,EACzB,mBAAmB,IAAI,EACvB,aAAa;AAEhB,UACG,QAAQ,SAAS,EACjB,YAAY,+BAA+B,EAC3C;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,EAIF,EACC,OAAO,OAAM,SAAQ;AACpB,cAAM,uCAAW,CAAC,OAAO,SAAS,GAAG,IAAI,EAAE,sBAAsB;AAAA,EACnE,CAAC;AAEH,UACG,QAAQ,SAAS,EACjB,YAAY,eAAe,EAC3B,SAAS,eAAe,6CAA6C,EACrE;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,EAIF,EACC,OAAO,OAAO,WAAmB,SAAS;AACzC,cAAM,uCAAW,CAAC,OAAO,WAAW,SAAS,GAAG,IAAI,EAAE;AAAA,MACpD;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