contensis-cli 1.0.0-beta.56 → 1.0.0-beta.58
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 +159 -69
- package/dist/commands/import.js +10 -1
- package/dist/commands/import.js.map +2 -2
- package/dist/commands/remove.js +30 -0
- package/dist/commands/remove.js.map +2 -2
- package/dist/localisation/en-GB.js +3 -1
- package/dist/localisation/en-GB.js.map +2 -2
- package/dist/services/ContensisCliService.js +40 -13
- package/dist/services/ContensisCliService.js.map +2 -2
- package/dist/util/console.printer.js +34 -41
- package/dist/util/console.printer.js.map +2 -2
- package/dist/util/logger.js +2 -3
- package/dist/util/logger.js.map +2 -2
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +1 -1
- package/src/commands/import.ts +14 -3
- package/src/commands/remove.ts +38 -0
- package/src/localisation/en-GB.ts +4 -1
- package/src/services/ContensisCliService.ts +48 -11
- package/src/util/console.printer.ts +72 -78
- package/src/util/logger.ts +3 -3
- package/src/version.ts +1 -1
package/README.md
CHANGED
|
@@ -219,6 +219,7 @@ contensis >
|
|
|
219
219
|
- [Import entries](#import-entries)
|
|
220
220
|
- [Import from another Contensis environment](#import-from-another-contensis-environment-1)
|
|
221
221
|
- [Import from a file](#import-from-a-file)
|
|
222
|
+
- [Remove entries](#remove-entries)
|
|
222
223
|
|
|
223
224
|
## Get started
|
|
224
225
|
|
|
@@ -1135,82 +1136,115 @@ When you are happy you can fetch only the data you intend to import, connect to
|
|
|
1135
1136
|
website t.durden@example-dev> import entries --preserve-guids --zenql "sys.contentTypeId = plant" --source-alias example-dev --source-project-id leif
|
|
1136
1137
|
-------------------------------------
|
|
1137
1138
|
-- IMPORT PREVIEW --
|
|
1138
|
-
[
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1139
|
+
[26/11 02:16:29] [INFO] Fetching initial entries in project 'leif'
|
|
1140
|
+
Fetch [leif] >> 100% 21 0.0s/0.0s 100000p/s
|
|
1141
|
+
Fetch [leif] >> 100% 79 0.0s/0.0s Infinityp/s
|
|
1142
|
+
Fetch [leif] >> 100% 13 0.0s/0.0s Infinityp/s
|
|
1143
|
+
|
|
1144
|
+
Found 113 entries in leif
|
|
1142
1145
|
--------------------------------------------
|
|
1143
1146
|
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
plant
|
|
1163
|
-
|
|
1164
|
-
plant
|
|
1165
|
-
|
|
1166
|
-
plant
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1147
|
+
id contentTypeId entryTitle entryDescrip
|
|
1148
|
+
------------------------------------------------------------------------------------------------------
|
|
1149
|
+
7cf921a0-ee4f-4bd6-a3f2-0fb0fe1a2ac8 plant Aloe vera Every kitche
|
|
1150
|
+
0d94dbf2-89f8-45fb-96d5-175ae1f382ce plant Areca palm An easy-to-c
|
|
1151
|
+
43a60005-ea92-4b32-9af3-79560e48ecec plant Boston fern Brighten up
|
|
1152
|
+
f0cac96c-39a1-4b85-b14b-e8d7d3d08767 plant Calathea orbifolia This beautif
|
|
1153
|
+
d647012b-897e-4b6b-bfb5-b9844ef3d648 plant Canary Island Date Palm An easy-to-c
|
|
1154
|
+
b7129080-692c-4550-9e2b-28f8ec978651 plant Chinese evergreen Easy to care
|
|
1155
|
+
a3339124-4340-4f31-a209-5a6413a89f15 plant Chinese money plant The Chinese
|
|
1156
|
+
8c284599-b615-40a7-9d26-0ddd586fff51 plant Dracaena fragrans A great opti
|
|
1157
|
+
329e3104-332f-48a4-b43a-de852df796b3 plant Elephant ear Elephant ear
|
|
1158
|
+
504f7b7f-af03-4711-94ca-07edb90fbe00 plant Heartleaf philodendron Native to Ce
|
|
1159
|
+
a9a537e8-5508-4166-878c-d5fcd0d9a723 plant Maidenhair fern Easily ident
|
|
1160
|
+
9a3cc767-8fc1-4ee5-83e1-63c14a508c69 plant Parlour palm Add a bit of
|
|
1161
|
+
ee488c3b-a3a3-4b9c-a3ad-c5a5bdc7e317 plant Peace lily A classic ch
|
|
1162
|
+
6a71a864-6f61-471a-8cdd-f80237408666 plant Pink moth orchid Why buy cut
|
|
1163
|
+
50868245-3e53-4d9f-86ed-403593da67f6 plant Ponytail palm Despite its
|
|
1164
|
+
4f05979f-d8cf-4568-9045-05731a33f243 plant Spider plant Breate easy
|
|
1165
|
+
76a16c87-5e6d-465b-a343-3f14cf2fea0a plant String of nickels A hanging pl
|
|
1166
|
+
61a2af3a-332c-453c-b9f6-1851d9b7d936 plant Swiss cheese plant Bring laid-b
|
|
1167
|
+
8174fb53-b955-4e36-8f87-646bf286e396 plant Variegated snake plant Snake plants
|
|
1168
|
+
b8aa31da-f993-4d81-a361-94ecd5e42547 plant White moth orchid Why buy cut
|
|
1169
|
+
0d707ffe-f42d-44a6-b839-46156ee7f4f3 plant Yellow moth orchid Why buy cut
|
|
1170
|
+
51390024-f193-436f-8552-646cf77ccfdb image aloe-vera-closeup null
|
|
1171
|
+
c0d4ec16-6de2-4394-aaf4-03a56d343bff image aloe-vera-gold-pot null
|
|
1172
|
+
3b830d97-e976-467c-a833-1b4abcab65d0 image areca-palm-in-room null
|
|
1173
|
+
ed0300b0-e841-4c0f-bd1d-9ecd6bc2a354 image areca-palm-leaf null
|
|
1174
|
+
00119ef1-c3c4-4a49-9076-27eee5605515 image areca-palm-plant-collection null
|
|
1175
|
+
248e2817-6241-4de7-ac5d-75411be4339d image boston-fern-close-up null
|
|
1176
|
+
|
|
1177
|
+
- and 87 more...
|
|
1178
|
+
|
|
1179
|
+
[26/11 02:16:29] [INFO] Finding 113 entries in project 'website'
|
|
1180
|
+
Fetch [website] >> 100% 113 0.2s/0.0s 897p/s
|
|
1181
|
+
Fetch [website] >> 100% 4 0.0s/0.0s Infinityp/s
|
|
1182
|
+
[26/11 02:16:30] [INFO] Building 66 asset entries
|
|
1183
|
+
[26/11 02:16:30] [INFO] Building 47 content entries
|
|
1184
|
+
|
|
1185
|
+
37/113 entries to migrate into [website]
|
|
1186
|
+
|
|
1187
|
+
contentTypeId status total
|
|
1188
|
+
----------------------------------------------
|
|
1189
|
+
plantGenus error 4
|
|
1190
|
+
growingConditions update 4
|
|
1191
|
+
plant update 21
|
|
1192
|
+
pot update 12
|
|
1193
|
+
image no change 66
|
|
1194
|
+
plantType no change 5
|
|
1195
|
+
tag no change 1
|
|
1196
|
+
----------------------------------------------
|
|
1197
|
+
|
|
1198
|
+
id contentTypeId status updates entryTitle
|
|
1199
|
+
------------------------------------------------------------------------------------------------------
|
|
1200
|
+
98347340-a11c-4ee5-b4e7-1ae3b75496a2 plantGenus error Aglaonema
|
|
1201
|
+
fa464489-6476-4694-b3d4-e77d0c00a185 plantGenus error Alocasia
|
|
1202
|
+
309d5fd7-a21f-45a8-8abb-f01f820b8f16 plantGenus error Aloe
|
|
1203
|
+
4ebdcc63-929f-4b06-8848-fe046468a63d plantGenus error Beaucarnea
|
|
1204
|
+
636b925b-a386-4c56-9f33-96cd99cc391c growingConditions update -1,+0 Likes high humidity
|
|
1205
|
+
2d80e638-eb0d-4bc5-bc96-42b7b8f20678 growingConditions update -1,+0 Needs plenty of light
|
|
1206
|
+
711251f9-f9c6-473b-8b62-0ec8a0d4978c growingConditions update -1,+0 Partial shade
|
|
1207
|
+
d815819d-61c6-4037-95d3-c503acf52153 growingConditions update -1,+0 Prefers dry conditions
|
|
1208
|
+
7cf921a0-ee4f-4bd6-a3f2-0fb0fe1a2ac8 plant update -1,+0 Aloe vera
|
|
1209
|
+
0d94dbf2-89f8-45fb-96d5-175ae1f382ce plant update -1,+0 Areca palm
|
|
1210
|
+
43a60005-ea92-4b32-9af3-79560e48ecec plant update -1,+0 Boston fern
|
|
1211
|
+
f0cac96c-39a1-4b85-b14b-e8d7d3d08767 plant update -1,+0 Calathea orbifolia
|
|
1212
|
+
d647012b-897e-4b6b-bfb5-b9844ef3d648 plant update -1,+0 Canary Island Date Pal
|
|
1213
|
+
b7129080-692c-4550-9e2b-28f8ec978651 plant update -1,+0 Chinese evergreen
|
|
1214
|
+
a3339124-4340-4f31-a209-5a6413a89f15 plant update -1,+0 Chinese money plant
|
|
1215
|
+
8c284599-b615-40a7-9d26-0ddd586fff51 plant update -1,+0 Dracaena fragrans
|
|
1216
|
+
329e3104-332f-48a4-b43a-de852df796b3 plant update -1,+0 Elephant ear
|
|
1217
|
+
504f7b7f-af03-4711-94ca-07edb90fbe00 plant update -1,+0 Heartleaf philodendron
|
|
1218
|
+
a9a537e8-5508-4166-878c-d5fcd0d9a723 plant update -1,+0 Maidenhair fern
|
|
1219
|
+
9a3cc767-8fc1-4ee5-83e1-63c14a508c69 plant update -1,+0 Parlour palm
|
|
1220
|
+
ee488c3b-a3a3-4b9c-a3ad-c5a5bdc7e317 plant update -1,+0 Peace lily
|
|
1221
|
+
6a71a864-6f61-471a-8cdd-f80237408666 plant update -1,+0 Pink moth orchid
|
|
1222
|
+
50868245-3e53-4d9f-86ed-403593da67f6 plant update -1,+0 Ponytail palm
|
|
1223
|
+
4f05979f-d8cf-4568-9045-05731a33f243 plant update -1,+0 Spider plant
|
|
1224
|
+
76a16c87-5e6d-465b-a343-3f14cf2fea0a plant update -1,+0 String of nickels
|
|
1225
|
+
61a2af3a-332c-453c-b9f6-1851d9b7d936 plant update -1,+0 Swiss cheese plant
|
|
1226
|
+
8174fb53-b955-4e36-8f87-646bf286e396 plant update -1,+0 Variegated snake plant
|
|
1227
|
+
|
|
1228
|
+
- and 15 more...
|
|
1176
1229
|
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
[cli] ❌ Content type 'plantGenus' does not exist in project 'website'
|
|
1230
|
+
--------------------------------------------
|
|
1231
|
+
[26/11 02:16:30] [OK] Done migrating entries
|
|
1180
1232
|
|
|
1181
|
-
|
|
1182
|
-
309d5fd7-a21f-45a8-8abb-f01f820b8f16 error
|
|
1183
|
-
[cli] ❌ Content type 'plantGenus' does not exist in project 'website'
|
|
1233
|
+
[cli] ⏩ import from project leif to website
|
|
1184
1234
|
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1235
|
+
- growingConditions: 4 [existing: 100%] [needs update: 100%]
|
|
1236
|
+
- image: 66 up to date
|
|
1237
|
+
- plant: 21 [existing: 100%] [needs update: 100%]
|
|
1238
|
+
- plantGenus: 4 [existing: 0%]
|
|
1239
|
+
- plantType: 5 up to date
|
|
1240
|
+
- pot: 12 [existing: 100%] [needs update: 100%]
|
|
1241
|
+
- tag: 1 up to date
|
|
1242
|
+
- totalCount: 37
|
|
1243
|
+
- errors: 1
|
|
1188
1244
|
|
|
1245
|
+
[cli] ❌ Content type 'plantGenus' does not exist in project 'website'
|
|
1189
1246
|
|
|
1190
|
-
|
|
1191
|
-
90e128f5-582c-4430-a232-72022271ec8b no change
|
|
1192
|
-
plantType Foliage
|
|
1193
|
-
25f5a78b-9274-4cc9-9a58-03d8dcd4cd17 no change
|
|
1194
|
-
plantType Orchids
|
|
1195
|
-
44abca5b-a49b-48a1-8823-811ab31983c0 no change
|
|
1196
|
-
plantType Palm
|
|
1197
|
-
d66447c5-2198-4b19-bad3-c921e9ef0db0 no change
|
|
1198
|
-
plantType Succulents
|
|
1199
|
-
70149568-9725-4c39-8ff5-ef69221a0899 no change
|
|
1200
|
-
|
|
1201
|
-
pot Barro decorated terracotta pot
|
|
1202
|
-
fa67e1c6-0637-4548-bd4f-c207ec62af0e no change
|
|
1203
|
-
pot Bianco white pot
|
|
1204
|
-
e3b7907c-f524-45e4-ba5f-e62d1557b477 no change
|
|
1205
|
-
pot Canasta mid-sized pot
|
|
1206
|
-
058b20ba-99f7-49ec-9017-a0df35b00dcc no change
|
|
1207
|
-
pot Geo mid-sized pot
|
|
1208
|
-
dafc4810-a62e-43e5-a056-ab1248181eaf no change
|
|
1209
|
-
pot Grå small grey pot
|
|
1210
|
-
f2022069-7a92-491d-b197-a3564ab9a8ca no change
|
|
1211
|
-
|
|
1212
|
-
tag Promoted
|
|
1213
|
-
3659a333-8d10-4325-9ea6-2f49ae47e7fe no change
|
|
1247
|
+
[cli] ❌ [example-dev] Unable to import entries
|
|
1214
1248
|
|
|
1215
1249
|
website t.durden@example-dev>
|
|
1216
1250
|
```
|
|
@@ -1224,3 +1258,59 @@ website t.durden@example-dev> import entries --preserve-guids --from-file ./cont
|
|
|
1224
1258
|
The output will be the same as the previous command
|
|
1225
1259
|
|
|
1226
1260
|
<sup><sub>Add the `--commit` option to make the changes, be very careful using this! There is no going back</sub></sup>
|
|
1261
|
+
|
|
1262
|
+
## Remove entries
|
|
1263
|
+
|
|
1264
|
+
Delete entries by id
|
|
1265
|
+
|
|
1266
|
+
```shell
|
|
1267
|
+
website t.durden@example-dev> remove entries a1c25591-8c9b-50e2-96d8-f6c774fcf023 8df914cc-1da1-59d6-86e0-
|
|
1268
|
+
8ea4ebd99aaa
|
|
1269
|
+
-- PREVIEW --
|
|
1270
|
+
[26/11 02:19:53] [INFO] Fetching initial entries in project 'website'
|
|
1271
|
+
Fetch [website] >> 100% 2 0.0s/0.0s Infinityp/s
|
|
1272
|
+
[26/11 02:19:53] [INFO] Done deleting entries
|
|
1273
|
+
|
|
1274
|
+
a1c25591-8c9b-50e2-96d8-f6c774fcf023 delete homepage Find the perfect plant
|
|
1275
|
+
8df914cc-1da1-59d6-86e0-8ea4ebd99aaa delete pot Milano dipped pot
|
|
1276
|
+
|
|
1277
|
+
[cli] ⏩ delete from project website
|
|
1278
|
+
|
|
1279
|
+
- totalCount: 2 [to delete: 2]
|
|
1280
|
+
|
|
1281
|
+
[cli] ✅ [example-dev] Will delete entries
|
|
1282
|
+
|
|
1283
|
+
[cli] ⏩ Add --commit flag to commit the previewed changes
|
|
1284
|
+
|
|
1285
|
+
website t.durden@example-dev>
|
|
1286
|
+
```
|
|
1287
|
+
|
|
1288
|
+
Delete entries with a supplied zenql statement
|
|
1289
|
+
|
|
1290
|
+
```shell
|
|
1291
|
+
website t.durden@example-dev> remove entries --zenql "sys.version.created > 2022-11-25 14:00"
|
|
1292
|
+
-- PREVIEW --
|
|
1293
|
+
[26/11 02:20:52] [INFO] Fetching initial entries in project 'website'
|
|
1294
|
+
Fetch [website] >> 100% 7 0.0s/0.0s 100000p/s
|
|
1295
|
+
[26/11 02:20:53] [INFO] Done deleting entries
|
|
1296
|
+
|
|
1297
|
+
a1c25591-8c9b-50e2-96d8-f6c774fcf023 delete homepage Find the perfect plant
|
|
1298
|
+
bb850178-c88c-50a6-8bac-844273cb19b8 delete image parlour-palm-white-room
|
|
1299
|
+
1553d1c8-7a99-5dcd-b1cb-9a90d4cf1985 delete landingPage New subscription service
|
|
1300
|
+
f0b0ef1b-fdd1-52d6-99fc-4439e0c186e6 delete plantGenus Aglaonema
|
|
1301
|
+
f8f6ee36-9cc4-5d1e-be62-01ac73590947 delete plantGenus Aloe
|
|
1302
|
+
8df914cc-1da1-59d6-86e0-8ea4ebd99aaa delete pot Milano dipped pot
|
|
1303
|
+
4efeb0e4-dc19-5f87-ab89-47892b9c4169 delete pot Terra large terracotta pot
|
|
1304
|
+
|
|
1305
|
+
[cli] ⏩ delete from project website
|
|
1306
|
+
|
|
1307
|
+
- totalCount: 7 [to delete: 7]
|
|
1308
|
+
|
|
1309
|
+
[cli] ✅ [example-dev] Will delete entries
|
|
1310
|
+
|
|
1311
|
+
[cli] ⏩ Add --commit flag to commit the previewed changes
|
|
1312
|
+
|
|
1313
|
+
website t.durden@example-dev>
|
|
1314
|
+
```
|
|
1315
|
+
|
|
1316
|
+
<sup><sub>Add the `--commit` option to make the changes, be very careful using this! There is no going back</sub></sup>
|
package/dist/commands/import.js
CHANGED
|
@@ -97,6 +97,11 @@ Example call:
|
|
|
97
97
|
).addOption(import_globalOptions.commit).option(
|
|
98
98
|
"-preserve, --preserve-guids",
|
|
99
99
|
"include this flag when you are importing entries that you have previously exported and wish to update"
|
|
100
|
+
).addOption(
|
|
101
|
+
new import_commander.Option(
|
|
102
|
+
"-oe, --output-entries <outputEntries>",
|
|
103
|
+
"which details of the entries included in the import to output"
|
|
104
|
+
).choices(["errors", "changes", "all"]).default("errors")
|
|
100
105
|
).addHelpText(
|
|
101
106
|
"after",
|
|
102
107
|
`
|
|
@@ -108,7 +113,11 @@ Example call:
|
|
|
108
113
|
["import", "entries"],
|
|
109
114
|
opts,
|
|
110
115
|
(0, import_globalOptions.mapContensisOpts)({ phrase, ...opts })
|
|
111
|
-
).ImportEntries({
|
|
116
|
+
).ImportEntries({
|
|
117
|
+
commit: opts.commit,
|
|
118
|
+
fromFile: opts.fromFile,
|
|
119
|
+
logOutput: opts.outputEntries
|
|
120
|
+
});
|
|
112
121
|
});
|
|
113
122
|
return program;
|
|
114
123
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/commands/import.ts"],
|
|
4
|
-
"sourcesContent": ["import {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,
|
|
4
|
+
"sourcesContent": ["import { Command, Option } from 'commander';\nimport { cliCommand } from '~/services/ContensisCliService';\nimport { commit, mapContensisOpts } from './globalOptions';\n\nexport const makeImportCommand = () => {\n const program = new Command()\n .command('import')\n .description('import command')\n .addHelpText('after', `\\n`)\n .showHelpAfterError(true)\n .exitOverride();\n\n program\n .command('models')\n .description('import complete content models')\n .argument('[modelIds...]', 'ids of the content models to import (optional)')\n .addOption(commit)\n .addHelpText(\n 'after',\n `\nExample call:\n > import models blogPost --from-file contentmodels-backup.json\n > import models --source-alias example-dev\n`\n )\n .action(async (modelIds: string[], opts) => {\n await cliCommand(\n ['import', 'models', modelIds.join(' ')],\n opts,\n mapContensisOpts({ modelIds, ...opts })\n ).ImportContentModels({\n fromFile: opts.fromFile,\n commit: opts.commit,\n });\n });\n\n program\n .command('contenttypes')\n .description('import content types')\n .argument(\n '[contentTypeIds...]',\n 'Optional list of API id(s) of the content type(s) to import'\n )\n .addOption(commit)\n .addHelpText(\n 'after',\n `\nExample call:\n > import contenttypes {contentTypeIds} --from-file contenttypes-backup.json\n > import contenttypes {contentTypeIds} --source-alias example-dev\n`\n )\n .action(async (contentTypeIds: string[], opts) => {\n await cliCommand(\n ['import', 'contenttypes'],\n opts,\n mapContensisOpts({ contentTypeIds, ...opts })\n ).ImportContentTypes(\n {\n fromFile: opts.fromFile,\n commit: opts.commit,\n },\n contentTypeIds\n );\n });\n\n program\n .command('components')\n .description('import components')\n .argument(\n '[componentIds...]',\n 'Optional list of API id(s) of the component(s) to import'\n )\n .addOption(commit)\n .addHelpText(\n 'after',\n `\nExample call:\n > import components {componentIds} --from-file component-backup.json\n > import components {componentIds} --source-alias example-dev\n`\n )\n .action(async (componentIds: string[], opts) => {\n await cliCommand(\n ['import', 'component'],\n opts,\n mapContensisOpts({ componentIds, ...opts })\n ).ImportComponents(\n {\n fromFile: opts.fromFile,\n commit: opts.commit,\n },\n componentIds\n );\n });\n\n program\n .command('entries')\n .description('import entries')\n .argument(\n '[search phrase]',\n 'get entries with the search phrase, use quotes for multiple words'\n )\n .addOption(commit)\n .option(\n '-preserve, --preserve-guids',\n 'include this flag when you are importing entries that you have previously exported and wish to update'\n )\n .addOption(\n new Option(\n '-oe, --output-entries <outputEntries>',\n 'which details of the entries included in the import to output'\n )\n .choices(['errors', 'changes', 'all'])\n .default('errors')\n )\n .addHelpText(\n 'after',\n `\nExample call:\n > import entries --source-cms example-dev --source-project-id microsite --zenql \"sys.contentTypeId = blog\"\n`\n )\n .action(async (phrase: string, opts, cmd) => {\n await cliCommand(\n ['import', 'entries'],\n opts,\n mapContensisOpts({ phrase, ...opts })\n ).ImportEntries({\n commit: opts.commit,\n fromFile: opts.fromFile,\n logOutput: opts.outputEntries,\n });\n });\n\n return program;\n};\n\nexport const get = makeImportCommand();\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAgC;AAChC,iCAA2B;AAC3B,2BAAyC;AAElC,MAAM,oBAAoB,MAAM;AACrC,QAAM,UAAU,IAAI,yBAAQ,EACzB,QAAQ,QAAQ,EAChB,YAAY,gBAAgB,EAC5B,YAAY,SAAS;AAAA,CAAI,EACzB,mBAAmB,IAAI,EACvB,aAAa;AAEhB,UACG,QAAQ,QAAQ,EAChB,YAAY,gCAAgC,EAC5C,SAAS,iBAAiB,gDAAgD,EAC1E,UAAU,2BAAM,EAChB;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKF,EACC,OAAO,OAAO,UAAoB,SAAS;AAC1C,cAAM;AAAA,MACJ,CAAC,UAAU,UAAU,SAAS,KAAK,GAAG,CAAC;AAAA,MACvC;AAAA,UACA,uCAAiB,EAAE,UAAU,GAAG,KAAK,CAAC;AAAA,IACxC,EAAE,oBAAoB;AAAA,MACpB,UAAU,KAAK;AAAA,MACf,QAAQ,KAAK;AAAA,IACf,CAAC;AAAA,EACH,CAAC;AAEH,UACG,QAAQ,cAAc,EACtB,YAAY,sBAAsB,EAClC;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC,UAAU,2BAAM,EAChB;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKF,EACC,OAAO,OAAO,gBAA0B,SAAS;AAChD,cAAM;AAAA,MACJ,CAAC,UAAU,cAAc;AAAA,MACzB;AAAA,UACA,uCAAiB,EAAE,gBAAgB,GAAG,KAAK,CAAC;AAAA,IAC9C,EAAE;AAAA,MACA;AAAA,QACE,UAAU,KAAK;AAAA,QACf,QAAQ,KAAK;AAAA,MACf;AAAA,MACA;AAAA,IACF;AAAA,EACF,CAAC;AAEH,UACG,QAAQ,YAAY,EACpB,YAAY,mBAAmB,EAC/B;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC,UAAU,2BAAM,EAChB;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKF,EACC,OAAO,OAAO,cAAwB,SAAS;AAC9C,cAAM;AAAA,MACJ,CAAC,UAAU,WAAW;AAAA,MACtB;AAAA,UACA,uCAAiB,EAAE,cAAc,GAAG,KAAK,CAAC;AAAA,IAC5C,EAAE;AAAA,MACA;AAAA,QACE,UAAU,KAAK;AAAA,QACf,QAAQ,KAAK;AAAA,MACf;AAAA,MACA;AAAA,IACF;AAAA,EACF,CAAC;AAEH,UACG,QAAQ,SAAS,EACjB,YAAY,gBAAgB,EAC5B;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC,UAAU,2BAAM,EAChB;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC,IAAI;AAAA,MACF;AAAA,MACA;AAAA,IACF,EACG,QAAQ,CAAC,UAAU,WAAW,KAAK,CAAC,EACpC,QAAQ,QAAQ;AAAA,EACrB,EACC;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,EAIF,EACC,OAAO,OAAO,QAAgB,MAAM,QAAQ;AAC3C,cAAM;AAAA,MACJ,CAAC,UAAU,SAAS;AAAA,MACpB;AAAA,UACA,uCAAiB,EAAE,QAAQ,GAAG,KAAK,CAAC;AAAA,IACtC,EAAE,cAAc;AAAA,MACd,QAAQ,KAAK;AAAA,MACb,UAAU,KAAK;AAAA,MACf,WAAW,KAAK;AAAA,IAClB,CAAC;AAAA,EACH,CAAC;AAEH,SAAO;AACT;AAEO,MAAM,MAAM,kBAAkB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/commands/remove.js
CHANGED
|
@@ -24,6 +24,7 @@ module.exports = __toCommonJS(remove_exports);
|
|
|
24
24
|
var import_commander = require("commander");
|
|
25
25
|
var import_ContensisCliService = require("../services/ContensisCliService");
|
|
26
26
|
var import_shell = require("../shell");
|
|
27
|
+
var import_logger = require("../util/logger");
|
|
27
28
|
var import_globalOptions = require("./globalOptions");
|
|
28
29
|
const makeRemoveCommand = () => {
|
|
29
30
|
const remove = new import_commander.Command().command("remove").description("remove command").addHelpText("after", `
|
|
@@ -70,6 +71,35 @@ Example call:
|
|
|
70
71
|
opts
|
|
71
72
|
).RemoveContentTypes(id, opts.commit);
|
|
72
73
|
});
|
|
74
|
+
const removeEntries = remove.command("entries").description("delete entries").argument(
|
|
75
|
+
"[ids...]",
|
|
76
|
+
"the entry id(s) to delete ...or add *** if you wish to delete all entries in all content types"
|
|
77
|
+
).addOption(import_globalOptions.zenql).addOption(import_globalOptions.commit).addHelpText(
|
|
78
|
+
"after",
|
|
79
|
+
`
|
|
80
|
+
Example call:
|
|
81
|
+
> remove entries a1c25591-8c9b-50e2-96d8-f6c774fcf023 8df914cc-1da1-59d6-86e0-8ea4ebd99aaa
|
|
82
|
+
> remove entries --zenql "sys.contentTypeId = test"
|
|
83
|
+
`
|
|
84
|
+
).action(async (entryIds, opts) => {
|
|
85
|
+
const removeAll = (entryIds == null ? void 0 : entryIds[0]) === "***";
|
|
86
|
+
if ((entryIds == null ? void 0 : entryIds[0]) && !entryIds[0].replace(/\*/g, ""))
|
|
87
|
+
entryIds.pop();
|
|
88
|
+
const hasArgs = !!((entryIds == null ? void 0 : entryIds.length) || opts.zenql || removeAll);
|
|
89
|
+
if (!hasArgs) {
|
|
90
|
+
import_logger.Logger.help(
|
|
91
|
+
`Not enough arguments supplied
|
|
92
|
+
|
|
93
|
+
${removeEntries.helpInformation()}`
|
|
94
|
+
);
|
|
95
|
+
} else {
|
|
96
|
+
await (0, import_ContensisCliService.cliCommand)(
|
|
97
|
+
["remove", "entries", entryIds.join(" ")],
|
|
98
|
+
opts,
|
|
99
|
+
(0, import_globalOptions.mapContensisOpts)({ entryIds, ...opts })
|
|
100
|
+
).RemoveEntries(opts.commit);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
73
103
|
return remove;
|
|
74
104
|
};
|
|
75
105
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/commands/remove.ts"],
|
|
4
|
-
"sourcesContent": ["import { Command } from 'commander';\nimport { cliCommand } from '~/services/ContensisCliService';\nimport { shell } from '~/shell';\nimport { commit, mapContensisOpts, zenql } from './globalOptions';\n\nexport const makeRemoveCommand = () => {\n const remove = new Command()\n .command('remove')\n .description('remove command')\n .addHelpText('after', `\\n`)\n .showHelpAfterError(true)\n .exitOverride();\n\n remove\n .command('project')\n .description('remove an entire project')\n .argument('<projectId>', 'the project id to delete')\n .usage('<projectId>')\n .addHelpText('after', `\\n`)\n .action(async (projectId, opts) => {\n const project = await cliCommand(\n ['remove', 'project', projectId],\n opts\n ).SetProject(projectId);\n if (project) await shell().restart();\n });\n\n remove\n .command('key')\n .description('remove api key')\n .argument('<id>', 'the id of the API key to delete')\n .usage('<id>')\n .addHelpText(\n 'after',\n `\nExample call:\n > remove key 4ceb9575-28d3-4d5b-a77b-5e5221e603dd\n`\n )\n .action(async (id, opts) => {\n await cliCommand(['remove', 'key', id], opts).RemoveApiKey(id);\n });\n\n remove\n .command('components')\n .description('delete components')\n .argument('<id...>', 'the id(s) of the components to delete')\n .addOption(commit)\n .usage('<id> [--commit]')\n .addHelpText(\n 'after',\n `\nExample call:\n > remove components addressComponent\n`\n )\n .action(async (id: string[], opts) => {\n await cliCommand(\n ['remove', 'components', id.join(' ')],\n opts\n ).RemoveComponents(id, opts.commit);\n });\n\n remove\n .command('contenttypes')\n .description('delete content types')\n .argument('<id...>', 'the id(s) of the content types to delete')\n .addOption(commit)\n .usage('<id> [--commit]')\n .addHelpText(\n 'after',\n `\nExample call:\n > remove contenttypes blogPost\n`\n )\n .action(async (id: string[], opts) => {\n await cliCommand(\n ['remove', 'contenttypes', id.join('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E,iBAAiB,IAAI,KAAK,MAAM;AAAA,EACpC,CAAC;AAEH,SACG,QAAQ,cAAc,EACtB,YAAY,sBAAsB,EAClC,SAAS,WAAW,0CAA0C,EAC9D,UAAU,2BAAM,EAChB,MAAM,iBAAiB,EACvB;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,EAIF,EACC,OAAO,OAAO,IAAc,SAAS;AACpC,cAAM;AAAA,MACJ,CAAC,UAAU,gBAAgB,GAAG,KAAK,GAAG,CAAC;AAAA,MACvC;AAAA,IACF,EAAE,mBAAmB,IAAI,KAAK,MAAM;AAAA,EACtC,CAAC;AAEH,SAAO;AACT;",
|
|
4
|
+
"sourcesContent": ["import { Command } from 'commander';\nimport { cliCommand } from '~/services/ContensisCliService';\nimport { shell } from '~/shell';\nimport { Logger } from '~/util/logger';\nimport { commit, mapContensisOpts, zenql } from './globalOptions';\n\nexport const makeRemoveCommand = () => {\n const remove = new Command()\n .command('remove')\n .description('remove command')\n .addHelpText('after', `\\n`)\n .showHelpAfterError(true)\n .exitOverride();\n\n remove\n .command('project')\n .description('remove an entire project')\n .argument('<projectId>', 'the project id to delete')\n .usage('<projectId>')\n .addHelpText('after', `\\n`)\n .action(async (projectId, opts) => {\n const project = await cliCommand(\n ['remove', 'project', projectId],\n opts\n ).SetProject(projectId);\n if (project) await shell().restart();\n });\n\n remove\n .command('key')\n .description('remove api key')\n .argument('<id>', 'the id of the API key to delete')\n .usage('<id>')\n .addHelpText(\n 'after',\n `\nExample call:\n > remove key 4ceb9575-28d3-4d5b-a77b-5e5221e603dd\n`\n )\n .action(async (id, opts) => {\n await cliCommand(['remove', 'key', id], opts).RemoveApiKey(id);\n });\n\n remove\n .command('components')\n .description('delete components')\n .argument('<id...>', 'the id(s) of the components to delete')\n .addOption(commit)\n .usage('<id> [--commit]')\n .addHelpText(\n 'after',\n `\nExample call:\n > remove components addressComponent\n`\n )\n .action(async (id: string[], opts) => {\n await cliCommand(\n ['remove', 'components', id.join(' ')],\n opts\n ).RemoveComponents(id, opts.commit);\n });\n\n remove\n .command('contenttypes')\n .description('delete content types')\n .argument('<id...>', 'the id(s) of the content types to delete')\n .addOption(commit)\n .usage('<id> [--commit]')\n .addHelpText(\n 'after',\n `\nExample call:\n > remove contenttypes blogPost\n`\n )\n .action(async (id: string[], opts) => {\n await cliCommand(\n ['remove', 'contenttypes', id.join(' ')],\n opts\n ).RemoveContentTypes(id, opts.commit);\n });\n\n const removeEntries = remove\n .command('entries')\n .description('delete entries')\n .argument(\n '[ids...]',\n 'the entry id(s) to delete ...or add *** if you wish to delete all entries in all content types'\n )\n .addOption(zenql)\n .addOption(commit)\n .addHelpText(\n 'after',\n `\nExample call:\n > remove entries a1c25591-8c9b-50e2-96d8-f6c774fcf023 8df914cc-1da1-59d6-86e0-8ea4ebd99aaa\n > remove entries --zenql \"sys.contentTypeId = test\"\n`\n )\n .action(async (entryIds: string[], opts) => {\n const removeAll = entryIds?.[0] === '***';\n\n // Remove all asterisks from args\n if (entryIds?.[0] && !entryIds[0].replace(/\\*/g, '')) entryIds.pop();\n\n const hasArgs = !!(entryIds?.length || opts.zenql || removeAll);\n if (!hasArgs) {\n Logger.help(\n `Not enough arguments supplied\\n\\n${removeEntries.helpInformation()}`\n );\n } else {\n await cliCommand(\n ['remove', 'entries', entryIds.join(' ')],\n opts,\n mapContensisOpts({ entryIds, ...opts })\n ).RemoveEntries(opts.commit);\n }\n });\n\n return remove;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAwB;AACxB,iCAA2B;AAC3B,mBAAsB;AACtB,oBAAuB;AACvB,2BAAgD;AAEzC,MAAM,oBAAoB,MAAM;AACrC,QAAM,SAAS,IAAI,yBAAQ,EACxB,QAAQ,QAAQ,EAChB,YAAY,gBAAgB,EAC5B,YAAY,SAAS;AAAA,CAAI,EACzB,mBAAmB,IAAI,EACvB,aAAa;AAEhB,SACG,QAAQ,SAAS,EAC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,CAAC;AAEH,QAAM,gBAAgB,OACnB,QAAQ,SAAS,EACjB,YAAY,gBAAgB,EAC5B;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC,UAAU,0BAAK,EACf,UAAU,2BAAM,EAChB;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKF,EACC,OAAO,OAAO,UAAoB,SAAS;AAC1C,UAAM,aAAY,qCAAW,QAAO;AAGpC,SAAI,qCAAW,OAAM,CAAC,SAAS,GAAG,QAAQ,OAAO,EAAE;AAAG,eAAS,IAAI;AAEnE,UAAM,UAAU,CAAC,GAAE,qCAAU,WAAU,KAAK,SAAS;AACrD,QAAI,CAAC,SAAS;AACZ,2BAAO;AAAA,QACL;AAAA;AAAA,EAAoC,cAAc,gBAAgB;AAAA,MACpE;AAAA,IACF,OAAO;AACL,gBAAM;AAAA,QACJ,CAAC,UAAU,WAAW,SAAS,KAAK,GAAG,CAAC;AAAA,QACxC;AAAA,YACA,uCAAiB,EAAE,UAAU,GAAG,KAAK,CAAC;AAAA,MACxC,EAAE,cAAc,KAAK,MAAM;AAAA,IAC7B;AAAA,EACF,CAAC;AAEH,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -172,10 +172,12 @@ ${import_logger.Logger.errorText(">>")} Available commands:`,
|
|
|
172
172
|
noEnv: () => `No Contensis environment set, connect to your Contensis cloud instance using "contensis connect {cms alias}"`
|
|
173
173
|
},
|
|
174
174
|
entries: {
|
|
175
|
+
imported: (env, commit, count) => `[${env}] ${commit ? `Imported` : `Will import`} ${count} entries`,
|
|
176
|
+
failedImport: (env) => `[${env}] Unable to import entries`,
|
|
175
177
|
removed: (env, commit) => `[${env}] ${commit ? `Deleted` : `Will delete`} entries`,
|
|
176
178
|
failedRemove: (env) => `[${env}] Unable to delete entries`,
|
|
177
179
|
notFound: (env) => `[${env}] Entries were not found`,
|
|
178
|
-
commitTip: () => `
|
|
180
|
+
commitTip: () => `Add --commit flag to commit the previewed changes`
|
|
179
181
|
},
|
|
180
182
|
keys: {
|
|
181
183
|
list: (env) => `[${env}] API keys:`,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/localisation/en-GB.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n BlockRunningStatus,\n MigrateModelsResult,\n MigrateStatus,\n} from 'migratortron';\nimport { Logger } from '~/util/logger';\n\nexport const LogMessages = {\n app: {\n contensis: () => 'Contensis',\n quit: () => `Goodbye \uD83D\uDC4B\\n`,\n startup: (version: string) =>\n `v${version} \u00A9 2001-${new Date().getFullYear()} Zengenti \uD83C\uDDEC\uD83C\uDDE7. \\n - Creators of Contensis and purveyors of other fine software\\n\\n\uD83D\uDC4B Welcome to the contensis-cli\\n`,\n help: () =>\n 'Press [CTRL]+[C] or type \"quit\" to return to your system shell\\nPress [TAB] for suggestions\\n',\n suggestions: () =>\n `\\n${Logger.errorText('>>')} Press [TAB] for suggestions\\n`,\n autocomplete: () => `\\n${Logger.errorText('>>')} Available commands:`,\n unknownError: () => `Something went wrong...`,\n fileOutput: (format = 'json', path?: string) =>\n `Output ${format} file: ${Logger.infoText(path)}\\n`,\n noFileOutput: () => `No output written\\n`,\n },\n command: {\n notKnown: (command: string) => `${command} is not known`,\n },\n envs: {\n found: (num: number) =>\n `environments store found containing ${num} environment${\n num === 1 ? '' : 's'\n }`,\n tip: () =>\n `Connect to a Contensis cloud instance using \"contensis connect {cms alias}\"`,\n },\n connect: {\n command: {\n name: () => 'connect',\n example: () => `Example call:\\n > connect example-dev`,\n },\n args: {\n alias: {\n name: () => '<alias>',\n description: () => 'the Contensis Cloud alias to connect with',\n },\n },\n noEnv: () => `Cannot connect - no environment alias specified`,\n unreachable: (url: string, status: number) =>\n `Cannot reach ${url}${status ? ` - status ${status}` : ''}`,\n connected: (env: string) => `Current environment set to \"${env}\"`,\n help: () =>\n `Connect to a Contensis cloud instance using \"contensis connect {cms alias}\"`,\n projects: () => `Available projects:`,\n noProjects: () => `Cannot retrieve projects list`,\n tip: () =>\n `Introduce yourself with \"login {username}\" or \"login {clientId} -s {secret}\" or by passing credentials as options with your command`,\n },\n login: {\n command: {\n name: () => 'login',\n usage: () => `<user/clientId> [password] [-s <sharedSecret>]`,\n example: () =>\n `Example call:\\n > login myuserid\\n -- or --\\n > login {clientId} -s {sharedSecret}`,\n },\n args: {\n user: {\n name: () => '<user/clientId>',\n description: () => 'the username to login with',\n },\n password: {\n name: () => '[password]',\n description: () =>\n 'the password to use to login with (optional/insecure)',\n },\n secret: {\n name: () => '-s --sharedSecret <sharedSecret>',\n description: () =>\n 'the shared secret to use when logging in with a client id',\n },\n },\n passwordPrompt: (env?: string, userId?: string) =>\n userId\n ? `Enter password for ${userId}@${env}:`\n : `Please enter a password`,\n failed: (env: string, userId: string) =>\n `Unable to login to ${env} as ${userId}`,\n success: (env: string, userId: string) =>\n `User ${userId} connected to ${env} successfully\\n`,\n insecurePassword: () =>\n `Could not connect to local keystore - your password could be stored unencrypted!`,\n noEnv: () => `No environment set, use \"contensis connect {alias}\" first`,\n noUserId: () => `No user id specified`,\n },\n projects: {\n list: () => `Available projects:`,\n noList: () => `Cannot retrieve projects list`,\n set: (projectId: string) =>\n `Current project is set to ${Logger.highlightText(projectId)}`,\n failedSet: (projectId: string) =>\n `Project ${Logger.highlightText(projectId)} not found`,\n tip: () =>\n `You need to set your current working project with \"set project {projectId}\"`,\n created: (env: string, id: string) =>\n `[${env}] Created project ${Logger.highlightText(id)}`,\n failedCreate: (env: string, id: string) =>\n `[${env}] Unable to create project ${Logger.highlightText(id)}`,\n updated: (env: string, id: string) =>\n `[${env}] Updated project ${Logger.highlightText(id)}`,\n failedUpdate: (env: string, id: string) =>\n `[${env}] Unable to update project ${Logger.highlightText(id)}`,\n },\n migrate: {\n models: {\n result: (\n status: keyof MigrateModelsResult['project']['contentTypes']\n ) => {\n switch (status) {\n case 'created':\n case 'updated':\n return Logger.successText;\n case 'errors':\n return Logger.errorText;\n default:\n return Logger.infoText;\n }\n },\n },\n status: (status: MigrateStatus) => {\n switch (status) {\n case 'no change':\n return Logger.successText;\n case 'create':\n case 'two-pass':\n case 'update':\n case 'delete':\n return Logger.warningText;\n case 'error':\n case 'not found':\n return Logger.errorText;\n default:\n return Logger.infoText;\n }\n },\n },\n models: {\n list: (projectId: string) =>\n `Content models in ${Logger.highlightText(projectId)}:`,\n noList: (projectId: string) =>\n `[${projectId}] Cannot retrieve content models`,\n get: (projectId: string, id: string) =>\n `[${projectId}] Content models ${Logger.infoText(`[ ${id} ]`)}`,\n failedGet: (projectId: string, id: string) =>\n `[${projectId}] Unable to get content models ${Logger.highlightText(id)}`,\n },\n contenttypes: {\n list: (projectId: string) =>\n `Content types in ${Logger.highlightText(projectId)}:`,\n get: (projectId: string, id: string) =>\n `[${projectId}] Content type ${Logger.highlightText(id)}`,\n failedGet: (projectId: string, id: string) =>\n `[${projectId}] Unable to get content type ${Logger.highlightText(id)}`,\n created: (projectId: string, id: string, status?: string) =>\n `[${projectId}] Content type ${status}d ${Logger.highlightText(id)}`,\n removed: (env: string, id: string, commit: boolean) =>\n `[${env}] ${\n commit ? `Deleted` : `Will delete`\n } content type ${Logger.highlightText(id)}`,\n failedRemove: (env: string, id: string) =>\n `[${env}] Unable to delete content type ${Logger.highlightText(id)}`,\n },\n components: {\n list: (projectId: string) =>\n `Components in ${Logger.highlightText(projectId)}:`,\n get: (projectId: string, id: string) =>\n `[${projectId}] Component ${Logger.highlightText(id)}`,\n failedGet: (projectId: string, id: string) =>\n `[${projectId}] Unable to get component ${Logger.highlightText(id)}`,\n created: (projectId: string, id: string, status?: string) =>\n `[${projectId}] Component ${status}d ${Logger.highlightText(id)}`,\n removed: (env: string, id: string, commit: boolean) =>\n `[${env}] ${\n commit ? `Deleted` : `Will delete`\n } component ${Logger.highlightText(id)}`,\n failedRemove: (env: string, id: string) =>\n `[${env}] Unable to delete component ${Logger.highlightText(id)}`,\n },\n version: {\n set: (env: string, versionStatus: string) =>\n `[${env}] Content version status set to \"${versionStatus}\"`,\n invalid: (versionStatus: string) =>\n `Content version status \"${versionStatus}\" is not valid, allowed values are \"published\" or \"latest\".`,\n noEnv: () =>\n `No Contensis environment set, connect to your Contensis cloud instance using \"contensis connect {cms alias}\"`,\n },\n entries: {\n removed: (env: string, commit: boolean) =>\n `[${env}] ${commit ? `Deleted` : `Will delete`} entries`,\n failedRemove: (env: string) => `[${env}] Unable to delete entries`,\n notFound: (env: string) => `[${env}] Entries were not found`,\n commitTip: () => ` Add --commit flag to commit the previewed changes`,\n },\n keys: {\n list: (env: string) => `[${env}] API keys:`,\n noList: (env: string) => `[${env}] Cannot retrieve API`,\n created: (env: string, name: string) =>\n `[${env}] Created API key ${Logger.highlightText(name)}`,\n failedCreate: (env: string, name: string) =>\n `[${env}] Unable to create API key ${Logger.highlightText(name)}`,\n removed: (env: string, id: string) =>\n `[${env}] Deleted API key ${Logger.highlightText(id)}`,\n failedRemove: (env: string, id: string) =>\n `[${env}] Unable to delete API key ${Logger.highlightText(id)}`,\n },\n blocks: {\n runningStatus: (status: BlockRunningStatus | 'broken') => {\n switch (status) {\n case 'available':\n return Logger.successText(status);\n case 'pending':\n case 'starting':\n case 'stopped':\n return Logger.warningText(status);\n case 'degraded':\n case 'faulted':\n case 'broken':\n return Logger.errorText(status);\n default:\n return Logger.infoText(status);\n }\n },\n get: (id: string, env: string, projectId?: string) =>\n `[${env}] Block ${id} in project ${projectId}:`,\n list: (env: string, projectId?: string) =>\n `[${env}] Blocks in project ${projectId}:`,\n noList: (env: string, projectId?: string) =>\n `[${env}] Cannot retrieve blocks in project ${projectId}`,\n getLogs: (id: string, branch: string, env: string, projectId?: string) =>\n `[${env}] Requesting logs from block ${Logger.highlightText(\n id\n )} in branch ${branch} in project ${projectId}`,\n failedGetLogs: (id: string, env: string, projectId?: string) =>\n `[${env}] Unable to fetch block logs for ${Logger.highlightText(\n id\n )} in project ${projectId}`,\n tryPush: (id: string, branch: string, env: string, projectId?: string) =>\n `[${env}] Request to push block ${Logger.highlightText(\n id\n )} in branch ${branch} in project ${projectId}`,\n pushed: (id: string, branch: string, env: string, projectId?: string) =>\n `[${env}] Pushed block ${Logger.highlightText(\n id\n )} in branch ${branch} in project ${projectId}`,\n failedPush: (id: string, env: string, projectId?: string) =>\n `[${env}] Unable to push block ${Logger.highlightText(\n id\n )} in project ${projectId}`,\n released: (id: string, env: string, projectId?: string) =>\n `[${env}] Released block ${Logger.highlightText(\n id\n )} in project ${projectId}`,\n failedRelease: (id: string, env: string, projectId?: string) =>\n `[${env}] Unable to release block ${Logger.highlightText(\n id\n )} in project ${projectId}`,\n deleted: (id: string, env: string, projectId?: string) =>\n `[${env}] Deleted block ${Logger.highlightText(\n id\n )} in project ${projectId}`,\n failedDelete: (id: string, env: string, projectId?: string) =>\n `[${env}] Unable to delete block ${Logger.highlightText(\n id\n )} in project ${projectId}`,\n },\n webhooks: {\n list: (env: string) => `[${env}] Webhook subscriptions:`,\n noList: (env: string) => `[${env}] Cannot retrieve webhook subscriptions`,\n created: (env: string, name: string) =>\n `[${env}] Created Webhook subscription ${Logger.highlightText(name)}`,\n failedCreate: (env: string, name: string) =>\n `[${env}] Unable to create Webhook subscription ${Logger.highlightText(\n name\n )}`,\n deleted: (env: string, id: string) =>\n `[${env}] Deleted Webhook subscription ${Logger.highlightText(id)}`,\n failedDelete: (env: string, id: string) =>\n `[${env}] Unable to delete Webhook subscription ${Logger.highlightText(\n id\n )}`,\n },\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,oBAAuB;AAEhB,MAAM,cAAc;AAAA,EACzB,KAAK;AAAA,IACH,WAAW,MAAM;AAAA,IACjB,MAAM,MAAM;AAAA;AAAA,IACZ,SAAS,CAAC,YACR,IAAI,qBAAkB,IAAI,KAAK,EAAE,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA,IAC/C,MAAM,MACJ;AAAA,IACF,aA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AA,EACJ;AACF;",
|
|
4
|
+
"sourcesContent": ["import {\n BlockRunningStatus,\n MigrateModelsResult,\n MigrateStatus,\n} from 'migratortron';\nimport { Logger } from '~/util/logger';\n\nexport const LogMessages = {\n app: {\n contensis: () => 'Contensis',\n quit: () => `Goodbye \uD83D\uDC4B\\n`,\n startup: (version: string) =>\n `v${version} \u00A9 2001-${new Date().getFullYear()} Zengenti \uD83C\uDDEC\uD83C\uDDE7. \\n - Creators of Contensis and purveyors of other fine software\\n\\n\uD83D\uDC4B Welcome to the contensis-cli\\n`,\n help: () =>\n 'Press [CTRL]+[C] or type \"quit\" to return to your system shell\\nPress [TAB] for suggestions\\n',\n suggestions: () =>\n `\\n${Logger.errorText('>>')} Press [TAB] for suggestions\\n`,\n autocomplete: () => `\\n${Logger.errorText('>>')} Available commands:`,\n unknownError: () => `Something went wrong...`,\n fileOutput: (format = 'json', path?: string) =>\n `Output ${format} file: ${Logger.infoText(path)}\\n`,\n noFileOutput: () => `No output written\\n`,\n },\n command: {\n notKnown: (command: string) => `${command} is not known`,\n },\n envs: {\n found: (num: number) =>\n `environments store found containing ${num} environment${\n num === 1 ? '' : 's'\n }`,\n tip: () =>\n `Connect to a Contensis cloud instance using \"contensis connect {cms alias}\"`,\n },\n connect: {\n command: {\n name: () => 'connect',\n example: () => `Example call:\\n > connect example-dev`,\n },\n args: {\n alias: {\n name: () => '<alias>',\n description: () => 'the Contensis Cloud alias to connect with',\n },\n },\n noEnv: () => `Cannot connect - no environment alias specified`,\n unreachable: (url: string, status: number) =>\n `Cannot reach ${url}${status ? ` - status ${status}` : ''}`,\n connected: (env: string) => `Current environment set to \"${env}\"`,\n help: () =>\n `Connect to a Contensis cloud instance using \"contensis connect {cms alias}\"`,\n projects: () => `Available projects:`,\n noProjects: () => `Cannot retrieve projects list`,\n tip: () =>\n `Introduce yourself with \"login {username}\" or \"login {clientId} -s {secret}\" or by passing credentials as options with your command`,\n },\n login: {\n command: {\n name: () => 'login',\n usage: () => `<user/clientId> [password] [-s <sharedSecret>]`,\n example: () =>\n `Example call:\\n > login myuserid\\n -- or --\\n > login {clientId} -s {sharedSecret}`,\n },\n args: {\n user: {\n name: () => '<user/clientId>',\n description: () => 'the username to login with',\n },\n password: {\n name: () => '[password]',\n description: () =>\n 'the password to use to login with (optional/insecure)',\n },\n secret: {\n name: () => '-s --sharedSecret <sharedSecret>',\n description: () =>\n 'the shared secret to use when logging in with a client id',\n },\n },\n passwordPrompt: (env?: string, userId?: string) =>\n userId\n ? `Enter password for ${userId}@${env}:`\n : `Please enter a password`,\n failed: (env: string, userId: string) =>\n `Unable to login to ${env} as ${userId}`,\n success: (env: string, userId: string) =>\n `User ${userId} connected to ${env} successfully\\n`,\n insecurePassword: () =>\n `Could not connect to local keystore - your password could be stored unencrypted!`,\n noEnv: () => `No environment set, use \"contensis connect {alias}\" first`,\n noUserId: () => `No user id specified`,\n },\n projects: {\n list: () => `Available projects:`,\n noList: () => `Cannot retrieve projects list`,\n set: (projectId: string) =>\n `Current project is set to ${Logger.highlightText(projectId)}`,\n failedSet: (projectId: string) =>\n `Project ${Logger.highlightText(projectId)} not found`,\n tip: () =>\n `You need to set your current working project with \"set project {projectId}\"`,\n created: (env: string, id: string) =>\n `[${env}] Created project ${Logger.highlightText(id)}`,\n failedCreate: (env: string, id: string) =>\n `[${env}] Unable to create project ${Logger.highlightText(id)}`,\n updated: (env: string, id: string) =>\n `[${env}] Updated project ${Logger.highlightText(id)}`,\n failedUpdate: (env: string, id: string) =>\n `[${env}] Unable to update project ${Logger.highlightText(id)}`,\n },\n migrate: {\n models: {\n result: (\n status: keyof MigrateModelsResult['project']['contentTypes']\n ) => {\n switch (status) {\n case 'created':\n case 'updated':\n return Logger.successText;\n case 'errors':\n return Logger.errorText;\n default:\n return Logger.infoText;\n }\n },\n },\n status: (status: MigrateStatus) => {\n switch (status) {\n case 'no change':\n return Logger.successText;\n case 'create':\n case 'two-pass':\n case 'update':\n case 'delete':\n return Logger.warningText;\n case 'error':\n case 'not found':\n return Logger.errorText;\n default:\n return Logger.infoText;\n }\n },\n },\n models: {\n list: (projectId: string) =>\n `Content models in ${Logger.highlightText(projectId)}:`,\n noList: (projectId: string) =>\n `[${projectId}] Cannot retrieve content models`,\n get: (projectId: string, id: string) =>\n `[${projectId}] Content models ${Logger.infoText(`[ ${id} ]`)}`,\n failedGet: (projectId: string, id: string) =>\n `[${projectId}] Unable to get content models ${Logger.highlightText(id)}`,\n },\n contenttypes: {\n list: (projectId: string) =>\n `Content types in ${Logger.highlightText(projectId)}:`,\n get: (projectId: string, id: string) =>\n `[${projectId}] Content type ${Logger.highlightText(id)}`,\n failedGet: (projectId: string, id: string) =>\n `[${projectId}] Unable to get content type ${Logger.highlightText(id)}`,\n created: (projectId: string, id: string, status?: string) =>\n `[${projectId}] Content type ${status}d ${Logger.highlightText(id)}`,\n removed: (env: string, id: string, commit: boolean) =>\n `[${env}] ${\n commit ? `Deleted` : `Will delete`\n } content type ${Logger.highlightText(id)}`,\n failedRemove: (env: string, id: string) =>\n `[${env}] Unable to delete content type ${Logger.highlightText(id)}`,\n },\n components: {\n list: (projectId: string) =>\n `Components in ${Logger.highlightText(projectId)}:`,\n get: (projectId: string, id: string) =>\n `[${projectId}] Component ${Logger.highlightText(id)}`,\n failedGet: (projectId: string, id: string) =>\n `[${projectId}] Unable to get component ${Logger.highlightText(id)}`,\n created: (projectId: string, id: string, status?: string) =>\n `[${projectId}] Component ${status}d ${Logger.highlightText(id)}`,\n removed: (env: string, id: string, commit: boolean) =>\n `[${env}] ${\n commit ? `Deleted` : `Will delete`\n } component ${Logger.highlightText(id)}`,\n failedRemove: (env: string, id: string) =>\n `[${env}] Unable to delete component ${Logger.highlightText(id)}`,\n },\n version: {\n set: (env: string, versionStatus: string) =>\n `[${env}] Content version status set to \"${versionStatus}\"`,\n invalid: (versionStatus: string) =>\n `Content version status \"${versionStatus}\" is not valid, allowed values are \"published\" or \"latest\".`,\n noEnv: () =>\n `No Contensis environment set, connect to your Contensis cloud instance using \"contensis connect {cms alias}\"`,\n },\n entries: {\n imported: (env: string, commit: boolean, count: number) =>\n `[${env}] ${commit ? `Imported` : `Will import`} ${count} entries`,\n failedImport: (env: string) => `[${env}] Unable to import entries`,\n removed: (env: string, commit: boolean) =>\n `[${env}] ${commit ? `Deleted` : `Will delete`} entries`,\n failedRemove: (env: string) => `[${env}] Unable to delete entries`,\n notFound: (env: string) => `[${env}] Entries were not found`,\n commitTip: () => `Add --commit flag to commit the previewed changes`,\n },\n keys: {\n list: (env: string) => `[${env}] API keys:`,\n noList: (env: string) => `[${env}] Cannot retrieve API`,\n created: (env: string, name: string) =>\n `[${env}] Created API key ${Logger.highlightText(name)}`,\n failedCreate: (env: string, name: string) =>\n `[${env}] Unable to create API key ${Logger.highlightText(name)}`,\n removed: (env: string, id: string) =>\n `[${env}] Deleted API key ${Logger.highlightText(id)}`,\n failedRemove: (env: string, id: string) =>\n `[${env}] Unable to delete API key ${Logger.highlightText(id)}`,\n },\n blocks: {\n runningStatus: (status: BlockRunningStatus | 'broken') => {\n switch (status) {\n case 'available':\n return Logger.successText(status);\n case 'pending':\n case 'starting':\n case 'stopped':\n return Logger.warningText(status);\n case 'degraded':\n case 'faulted':\n case 'broken':\n return Logger.errorText(status);\n default:\n return Logger.infoText(status);\n }\n },\n get: (id: string, env: string, projectId?: string) =>\n `[${env}] Block ${id} in project ${projectId}:`,\n list: (env: string, projectId?: string) =>\n `[${env}] Blocks in project ${projectId}:`,\n noList: (env: string, projectId?: string) =>\n `[${env}] Cannot retrieve blocks in project ${projectId}`,\n getLogs: (id: string, branch: string, env: string, projectId?: string) =>\n `[${env}] Requesting logs from block ${Logger.highlightText(\n id\n )} in branch ${branch} in project ${projectId}`,\n failedGetLogs: (id: string, env: string, projectId?: string) =>\n `[${env}] Unable to fetch block logs for ${Logger.highlightText(\n id\n )} in project ${projectId}`,\n tryPush: (id: string, branch: string, env: string, projectId?: string) =>\n `[${env}] Request to push block ${Logger.highlightText(\n id\n )} in branch ${branch} in project ${projectId}`,\n pushed: (id: string, branch: string, env: string, projectId?: string) =>\n `[${env}] Pushed block ${Logger.highlightText(\n id\n )} in branch ${branch} in project ${projectId}`,\n failedPush: (id: string, env: string, projectId?: string) =>\n `[${env}] Unable to push block ${Logger.highlightText(\n id\n )} in project ${projectId}`,\n released: (id: string, env: string, projectId?: string) =>\n `[${env}] Released block ${Logger.highlightText(\n id\n )} in project ${projectId}`,\n failedRelease: (id: string, env: string, projectId?: string) =>\n `[${env}] Unable to release block ${Logger.highlightText(\n id\n )} in project ${projectId}`,\n deleted: (id: string, env: string, projectId?: string) =>\n `[${env}] Deleted block ${Logger.highlightText(\n id\n )} in project ${projectId}`,\n failedDelete: (id: string, env: string, projectId?: string) =>\n `[${env}] Unable to delete block ${Logger.highlightText(\n id\n )} in project ${projectId}`,\n },\n webhooks: {\n list: (env: string) => `[${env}] Webhook subscriptions:`,\n noList: (env: string) => `[${env}] Cannot retrieve webhook subscriptions`,\n created: (env: string, name: string) =>\n `[${env}] Created Webhook subscription ${Logger.highlightText(name)}`,\n failedCreate: (env: string, name: string) =>\n `[${env}] Unable to create Webhook subscription ${Logger.highlightText(\n name\n )}`,\n deleted: (env: string, id: string) =>\n `[${env}] Deleted Webhook subscription ${Logger.highlightText(id)}`,\n failedDelete: (env: string, id: string) =>\n `[${env}] Unable to delete Webhook subscription ${Logger.highlightText(\n id\n )}`,\n },\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,oBAAuB;AAEhB,MAAM,cAAc;AAAA,EACzB,KAAK;AAAA,IACH,WAAW,MAAM;AAAA,IACjB,MAAM,MAAM;AAAA;AAAA,IACZ,SAAS,CAAC,YACR,IAAI,qBAAkB,IAAI,KAAK,EAAE,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA,IAC/C,MAAM,MACJ;AAAA,IACF,aAAa,MACX;AAAA,EAAK,qBAAO,UAAU,IAAI;AAAA;AAAA,IAC5B,cAA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C1B,IAAI,8CAA8C,qBAAO;AAAA,MACvD;AAAA,IACF;AAAA,EACJ;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1055,8 +1055,8 @@ Components:`));
|
|
|
1055
1055
|
}
|
|
1056
1056
|
};
|
|
1057
1057
|
RemoveEntries = async (commit = false) => {
|
|
1058
|
-
var _a
|
|
1059
|
-
const { currentEnv, log, messages } = this;
|
|
1058
|
+
var _a;
|
|
1059
|
+
const { currentEnv, currentProject, log, messages } = this;
|
|
1060
1060
|
const contensis = await this.ConnectContensisImport({
|
|
1061
1061
|
commit,
|
|
1062
1062
|
importDataType: "user-input"
|
|
@@ -1070,15 +1070,20 @@ Components:`));
|
|
|
1070
1070
|
const [err, result] = await contensis.DeleteEntries();
|
|
1071
1071
|
if (result)
|
|
1072
1072
|
this.HandleFormattingAndOutput(result, () => {
|
|
1073
|
-
(0, import_console.printMigrateResult)(this, result, {
|
|
1073
|
+
(0, import_console.printMigrateResult)(this, result, {
|
|
1074
|
+
action: "delete",
|
|
1075
|
+
showAllEntries: true
|
|
1076
|
+
});
|
|
1074
1077
|
});
|
|
1075
|
-
if (!err && (!commit &&
|
|
1078
|
+
if (!err && (!commit && result.entriesToMigrate[currentProject].totalCount || commit && ((_a = result.migrateResult) == null ? void 0 : _a.deleted))) {
|
|
1076
1079
|
log.success(messages.entries.removed(currentEnv, commit));
|
|
1077
|
-
if (!commit)
|
|
1080
|
+
if (!commit) {
|
|
1081
|
+
log.raw(``);
|
|
1078
1082
|
log.help(messages.entries.commitTip());
|
|
1083
|
+
}
|
|
1079
1084
|
} else {
|
|
1080
1085
|
log.error(messages.entries.failedRemove(currentEnv), err);
|
|
1081
|
-
if (!
|
|
1086
|
+
if (!result.entriesToMigrate[currentProject].totalCount)
|
|
1082
1087
|
log.help(messages.entries.notFound(currentEnv));
|
|
1083
1088
|
}
|
|
1084
1089
|
}
|
|
@@ -1109,9 +1114,11 @@ Components:`));
|
|
|
1109
1114
|
};
|
|
1110
1115
|
ImportEntries = async ({
|
|
1111
1116
|
commit,
|
|
1112
|
-
fromFile
|
|
1117
|
+
fromFile,
|
|
1118
|
+
logOutput
|
|
1113
1119
|
}) => {
|
|
1114
|
-
|
|
1120
|
+
var _a, _b, _c, _d, _e;
|
|
1121
|
+
const { currentEnv, currentProject, log, messages } = this;
|
|
1115
1122
|
const contensis = await this.ConnectContensisImport({
|
|
1116
1123
|
commit,
|
|
1117
1124
|
fromFile,
|
|
@@ -1124,13 +1131,33 @@ Components:`));
|
|
|
1124
1131
|
} else {
|
|
1125
1132
|
console.log(log.warningText(` *** COMMITTING IMPORT *** `));
|
|
1126
1133
|
}
|
|
1127
|
-
const [
|
|
1128
|
-
if (
|
|
1129
|
-
(0, import_logger.logError)(
|
|
1134
|
+
const [err, result] = await contensis.MigrateEntries();
|
|
1135
|
+
if (err)
|
|
1136
|
+
(0, import_logger.logError)(err);
|
|
1130
1137
|
else
|
|
1131
|
-
this.HandleFormattingAndOutput(
|
|
1132
|
-
(0, import_console.printMigrateResult)(this,
|
|
1138
|
+
this.HandleFormattingAndOutput(result, () => {
|
|
1139
|
+
(0, import_console.printMigrateResult)(this, result, {
|
|
1140
|
+
showAllEntries: logOutput === "all",
|
|
1141
|
+
showChangedEntries: logOutput === "changes"
|
|
1142
|
+
});
|
|
1133
1143
|
});
|
|
1144
|
+
if (!err && !((_a = result.errors) == null ? void 0 : _a.length) && (!commit && result.entriesToMigrate[currentProject].totalCount || commit && (((_b = result.migrateResult) == null ? void 0 : _b.created) || ((_c = result.migrateResult) == null ? void 0 : _c.updated)))) {
|
|
1145
|
+
log.success(
|
|
1146
|
+
messages.entries.imported(
|
|
1147
|
+
currentEnv,
|
|
1148
|
+
commit,
|
|
1149
|
+
commit ? (((_d = result.migrateResult) == null ? void 0 : _d.created) || 0) + (((_e = result.migrateResult) == null ? void 0 : _e.updated) || 0) : result.entriesToMigrate[currentProject].totalCount
|
|
1150
|
+
)
|
|
1151
|
+
);
|
|
1152
|
+
if (!commit) {
|
|
1153
|
+
log.raw(``);
|
|
1154
|
+
log.help(messages.entries.commitTip());
|
|
1155
|
+
}
|
|
1156
|
+
} else {
|
|
1157
|
+
log.error(messages.entries.failedImport(currentEnv), err);
|
|
1158
|
+
if (!result.entriesToMigrate[currentProject].totalCount)
|
|
1159
|
+
log.help(messages.entries.notFound(currentEnv));
|
|
1160
|
+
}
|
|
1134
1161
|
} else {
|
|
1135
1162
|
log.warning(messages.models.noList(currentProject));
|
|
1136
1163
|
log.help(messages.connect.tip());
|