contensis-cli 1.0.0-beta.66 → 1.0.0-beta.68

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 CHANGED
@@ -2,21 +2,54 @@
2
2
 
3
3
  Use Contensis from your favourite terminal
4
4
 
5
- Install the package via `npm` as a global module (requires NodeJS)
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
- If you use `nvm` and are frequently switching your local `Node JS` version, use one of the pre-built binaries.
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
- - Windows users: `choco install contensis-cli --pre`
14
- - Mac users: `brew tap contensis/cli` then `brew install contensis-cli`
15
- - Linux users: `brew tap contensis/cli` then `brew install contensis-cli-linux`
48
+ ## Install from source
16
49
 
17
- Alternatively, download the executable for your operating system from the [Releases page](https://github.com/contensis/node-cli/releases) and add it to a folder in your local `PATH`
50
+ Clone the [repository](https://github.com/contensis/node-cli) and follow the instructions in the [`README`](https://github.com/contensis/node-cli#readme)
18
51
 
19
- ## Skip to section
52
+ # Skip to section
20
53
 
21
54
  - [Contensis Shell](#contensis-shell)
22
55
  - [Use in Terminal](#cli-usage)
@@ -226,14 +259,19 @@ contensis >
226
259
  - [Get block](#get-block)
227
260
  - [Get block logs](#get-block-logs)
228
261
  - [Push a block](#push-a-block)
229
- - [Release a block version](#release-a-block-version)
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)
230
267
  - [View webhook subscriptions](#view-webhook-subscriptions)
231
268
  - [Import content models](#import-content-models)
232
269
  - [Import from another Contensis environment](#import-from-another-contensis-environment)
233
270
  - [From a file](#from-a-file)
234
271
  - [Import entries](#import-entries)
235
272
  - [Import from another Contensis environment](#import-from-another-contensis-environment-1)
236
- - [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)
237
275
  - [Remove entries](#remove-entries)
238
276
 
239
277
  ## Get started
@@ -1108,6 +1146,9 @@ website t.durden@example-dev> get block simple-block master
1108
1146
  website t.durden@example-dev>
1109
1147
  ```
1110
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
+
1111
1152
  ### Get block logs
1112
1153
 
1113
1154
  ```shell
@@ -1138,9 +1179,11 @@ website t.durden@example-dev> push block cli-test-block ghcr.io/contensis/conten
1138
1179
  website t.durden@example-dev>
1139
1180
  ```
1140
1181
 
1141
- ### Release a block version
1182
+ ### Execute block actions
1142
1183
 
1143
- First get the latest block version number
1184
+ We can perform certain actions on a specific version of a block with the `execute block action {type}` command
1185
+
1186
+ To execute an action on a specific block version, first you can find the the latest block version number with `get block {block-id} {branch} latest` or leave out the `latest` argument to see a short list of recent versions.
1144
1187
 
1145
1188
  ```shell
1146
1189
  website t.durden@example-dev>get block contensis-website master latest
@@ -1170,12 +1213,16 @@ website t.durden@example-dev>get block contensis-website master latest
1170
1213
  website t.durden@example-dev>
1171
1214
  ```
1172
1215
 
1173
- Add the block version number to the `release block` command
1216
+ Add the block version number to the `execute block action {type} {block-id} {version}` command - further examples are below
1217
+
1218
+ #### Release a block version
1219
+
1220
+ To mark a block version as "released"
1174
1221
 
1175
1222
  ```shell
1176
1223
 
1177
- website t.durden@example-dev> release block contensis-website 78
1178
- [cli] ✅ [example-dev] Released block contensis-website in project website
1224
+ website t.durden@example-dev> execute block action release contensis-website 78
1225
+ [cli] ✅ [example-dev] Action release on contensis-website in project website requested successfully
1179
1226
  v78 contensis-website
1180
1227
  state: available
1181
1228
  released: [23/11/2022 01:42] n.flatley
@@ -1201,15 +1248,44 @@ website t.durden@example-dev> release block contensis-website 78
1201
1248
  website t.durden@example-dev>
1202
1249
  ```
1203
1250
 
1204
- ## Import content models
1251
+ > **Note**
1252
+ > you can leave out the `version` argument to release the last pushed version of the block
1253
+
1254
+ #### Make a block version live
1255
+
1256
+ Follow the examples for [releasing a block version](#release-a-block-version) except target your command to this action
1205
1257
 
1206
- Connect to your "source" environment first, ensure you can fetch the models and these models contain the dependencies you plan on importing from here with the `get model` command. Add the `--dependents` option to fetch all of the entries that will eventually be imported.
1258
+ ```shell
1259
+ execute block action makelive {block-id} {version}
1260
+ ```
1261
+
1262
+ #### Mark a block version as broken
1263
+
1264
+ Follow the examples for [releasing a block version](#release-a-block-version) except target your command to this action
1265
+
1266
+ ```shell
1267
+ execute block action markasbroken {block-id} {version}
1268
+ ```
1207
1269
 
1208
- When you are happy your models contain the right dependencies for your import, connect to the "target" environment (and project) then use the same arguments as before except with the `import entries` command
1270
+ #### Rollback a live block version
1271
+
1272
+ Follow the examples for [releasing a block version](#release-a-block-version) except target your command to this action
1273
+
1274
+ ```shell
1275
+ execute block action rollback {block-id} {version}
1276
+ ```
1277
+
1278
+ ## Import content models
1209
1279
 
1210
1280
  ### Import from another Contensis environment
1211
1281
 
1212
- Specify a list of models to import
1282
+ 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.
1283
+
1284
+ Check that the right assets will eventually be imported with the `list models` or `get model {modelIds...}` command
1285
+
1286
+ 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.
1287
+
1288
+ #### Specify a list of models to import
1213
1289
 
1214
1290
  ```shell
1215
1291
  website t.durden@example-dev> import models plant --source-alias example-dev --source-project-id leif
@@ -1248,7 +1324,7 @@ Components:
1248
1324
  website t.durden@example-dev>
1249
1325
  ```
1250
1326
 
1251
- Or import every model from the source
1327
+ #### Import all models from the source project
1252
1328
 
1253
1329
  ```shell
1254
1330
  website t.durden@example-dev> import models --source-alias example-dev --source-project-id leif
@@ -1379,17 +1455,12 @@ website t.durden@example-dev>
1379
1455
  website t.durden@example-dev> import models --from-file ./content-models.json
1380
1456
  ```
1381
1457
 
1382
- The output will be the same as the previous command
1458
+ The output will be the same as the `import models` examples above
1383
1459
 
1384
1460
  <sup><sub>Add the `--commit` option to make the changes, be very careful using this! There is no going back</sub></sup>
1385
1461
 
1386
1462
  ## Import entries
1387
1463
 
1388
- The import commands are made possible by using the `migratortron` library. There is further documentation here:
1389
-
1390
- - [`migratortron` on npmjs](https://www.npmjs.com/package/migratortron)
1391
- - [`contensis-importer` on npmjs](https://www.npmjs.com/package/contensis-importer)
1392
-
1393
1464
  ### Import from another Contensis environment
1394
1465
 
1395
1466
  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.
@@ -1523,6 +1594,13 @@ The output will be the same as the previous command
1523
1594
 
1524
1595
  <sup><sub>Add the `--commit` option to make the changes, be very careful using this! There is no going back</sub></sup>
1525
1596
 
1597
+ ### Import entries further reading
1598
+
1599
+ The import commands are made possible by using the `migratortron` library. There is further documentation here:
1600
+
1601
+ - [`migratortron` on npmjs](https://www.npmjs.com/package/migratortron)
1602
+ - [`contensis-importer` on npmjs](https://www.npmjs.com/package/contensis-importer)
1603
+
1526
1604
  ## Remove entries
1527
1605
 
1528
1606
  Delete entries by id
@@ -0,0 +1,101 @@
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).argument("[version]", blockVersionArg.description, "latest").usage("[block-id> <version]").addHelpText(
40
+ "after",
41
+ `
42
+ Example call:
43
+ > execute block action release contensis-app
44
+
45
+ Note: block actions are executed on blocks deployed from a "main" or "master" branch
46
+ `
47
+ ).action(async (blockId, version, opts) => {
48
+ await (0, import_ContensisCliService.cliCommand)(
49
+ ["execute", "block", "action", "release", blockId],
50
+ opts
51
+ ).ExecuteBlockAction("release", blockId, version);
52
+ });
53
+ action.command("makelive").description("make a block version live").addArgument(blockIdArg).addArgument(blockVersionArg).usage("<block-id> <version>").addHelpText(
54
+ "after",
55
+ `
56
+ Example call:
57
+ > execute block action makelive contensis-app 3
58
+
59
+ Note: block actions are executed on blocks deployed from a "main" or "master" branch
60
+ `
61
+ ).action(async (blockId, version, opts) => {
62
+ await (0, import_ContensisCliService.cliCommand)(
63
+ ["execute", "block", "action", "makelive", blockId],
64
+ opts
65
+ ).ExecuteBlockAction("makeLive", blockId, version);
66
+ });
67
+ action.command("rollback").description("rollback a live block version to last live version").addArgument(blockIdArg).addArgument(blockVersionArg).usage("<block-id> <version>").addHelpText(
68
+ "after",
69
+ `
70
+ Example call:
71
+ > execute block action rollback contensis-app 3
72
+
73
+ Note: block actions are executed on blocks deployed from a "main" or "master" branch
74
+ `
75
+ ).action(async (blockId, version, opts) => {
76
+ await (0, import_ContensisCliService.cliCommand)(
77
+ ["execute", "block", "action", "rollback", blockId],
78
+ opts
79
+ ).ExecuteBlockAction("rollback", blockId, version);
80
+ });
81
+ action.command("markasbroken").description("mark a block version as broken").addArgument(blockIdArg).addArgument(blockVersionArg).usage("<block-id> <version>").addHelpText(
82
+ "after",
83
+ `
84
+ Example call:
85
+ > execute block action markasbroken contensis-app 3
86
+
87
+ Note: block actions are executed on blocks deployed from a "main" or "master" branch
88
+ `
89
+ ).action(async (blockId, version, opts) => {
90
+ await (0, import_ContensisCliService.cliCommand)(
91
+ ["execute", "block", "action", "markasbroken", blockId],
92
+ opts
93
+ ).ExecuteBlockAction("markAsBroken", blockId, version);
94
+ });
95
+ return execute;
96
+ };
97
+ // Annotate the CommonJS export names for ESM import in node:
98
+ 0 && (module.exports = {
99
+ makeExecuteCommand
100
+ });
101
+ //# 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 .argument('[version]', blockVersionArg.description, 'latest')\n .usage('[block-id> <version]')\n .addHelpText(\n 'after',\n `\nExample call:\n > execute block action release contensis-app\n\nNote: block actions are executed on blocks deployed from a \"main\" or \"master\" branch\\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\nNote: block actions are executed on blocks deployed from a \"main\" or \"master\" branch\\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\nNote: block actions are executed on blocks deployed from a \"main\" or \"master\" branch\\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\nNote: block actions are executed on blocks deployed from a \"main\" or \"master\" branch\\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,QAAQ,OAAO,EACf,YAAY,+CAA+C;AAE9D,QAAM,SAAS,MACZ,QAAQ,QAAQ,EAChB,YAAY,sDAAsD;AAErE,QAAM,aAAa,IAAI;AAAA,IACrB;AAAA,IACA;AAAA,EACF;AACA,QAAM,kBAAkB,IAAI;AAAA,IAC1B;AAAA,IACA;AAAA,EACF;AAEA,SACG,QAAQ,SAAS,EACjB,YAAY,yBA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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
+ }
@@ -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",
@@ -147,7 +147,7 @@ Example call:
147
147
  > get block contensis-website master latest
148
148
  `
149
149
  ).action(async (blockId, branch, version, opts) => {
150
- await (0, import_ContensisCliService.cliCommand)(["get", "block"], opts).PrintBlockVersions(
150
+ await (0, import_ContensisCliService.cliCommand)(["get", "block", blockId], opts).PrintBlockVersions(
151
151
  blockId,
152
152
  branch,
153
153
  version
@@ -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": ";;;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AAAA,UACA,uCAAiB,EAAE,QAAQ,GAAG,KAAK,CAAC;AAAA,IACtC,EAAE,WAAW;AAAA,MACX,gBAAgB,KAAK;AAAA,IACvB,CAAC;AAAA,EACH,CAAC;AAEH,QAAM,QAAQ,QACX,QAAQ,OAAO,EACf,YAAY,8BAA8B,EAC1C,SAAS,aAAa,sCAAsC,EAC5D;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,EAIF,EACC,OAAO,OAAO,SAAiB,QAAgB,SAAiB,SAAS;AACxE,cAAM,uCAAW,CAAC,OAAO,OAAO,GAAG,IAAI,EAAE;AAAA,MACvC;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF,CAAC;AAEH,QAAM,aAAa,IAAI;AAAA,IACrB;AAAA,IACA;AAAA,EACF,EACG,QAAQ,CAAC,MAAM,UAAU,YAAY,CAAC,EACtC,QAAQ,IAAI;AAEf,QACG,QAAQ,MAAM,EACd,YAAY,sBAAsB,EAClC,SAAS,aAAa,mCAAmC,EACzD;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,EACF,EACC,YAAY,UAAU,EACtB,MAAM,0DAA0D,EAChE;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKF,EACC;AAAA,IACC,OACE,SACA,QACA,SACAA,aACA,SACG;AACH,gBAAM,uCAAW,CAAC,OAAO,SAAS,MAAM,GAAG,IAAI,EAAE;AAAA,QAC/C;AAAA,QACA;AAAA,QACA;AAAA,QACAA;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEF,SAAO;AACT;AAEO,MAAM,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', blockId], 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;AAAA,IACF;AAAA,EACF,CAAC;AAEH,UACG,QAAQ,MAAM,EACd,YAAY,YAAY,EACxB,SAAS,kBAAkB,+BAA+B,EAC1D;AAAA,IACC;AAA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,IACA;AAAA,EACF,EACC,YAAY,UAAU,EACtB,MAAM,0DAA0D,EAChE;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKF,EACC;AAAA,IACC,OACE,SACA,QACA,SACAA,aACA,SACG;AACH,gBAAM,uCAAW,CAAC,OAAO,SAAS,MAAM,GAAG,IAAI,EAAE;AAAA,QAC/C;AAAA,QACA;AAAA,QACA;AAAA,QACAA;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEF,SAAO;AACT;AAEO,MAAM,MAAM,eAAe;",
6
6
  "names": ["dataCenter"]
7
7
  }
@@ -27,13 +27,13 @@ var import_version = require("../version");
27
27
  var import_connect = require("./connect");
28
28
  var import_create = require("./create");
29
29
  var import_diff = require("./diff");
30
+ var import_execute = require("./execute");
30
31
  var import_get = require("./get");
31
32
  var import_globalOptions = require("./globalOptions");
32
33
  var import_import = require("./import");
33
34
  var import_list = require("./list");
34
35
  var import_login = require("./login");
35
36
  var import_push = require("./push");
36
- var import_release = require("./release");
37
37
  var import_remove = require("./remove");
38
38
  var import_set = require("./set");
39
39
  const commands = () => {
@@ -41,7 +41,13 @@ const commands = () => {
41
41
  writeErr: (str) => {
42
42
  return str.toLowerCase().includes("error") ? import_logger.Logger.error(`Command ${str}`) : str.trim() && import_logger.Logger.help(str);
43
43
  }
44
- }).exitOverride().showHelpAfterError(true);
44
+ }).addHelpText(
45
+ "after",
46
+ import_logger.Logger.helpText`
47
+ >> Each command has its own help - for example:
48
+ > login --help\n > get --help
49
+ `
50
+ ).exitOverride().showHelpAfterError(true);
45
51
  program.addCommand(
46
52
  (0, import_globalOptions.addAuthenticationOptions)((0, import_connect.makeConnectCommand)()).copyInheritedSettings(
47
53
  program
@@ -50,6 +56,9 @@ const commands = () => {
50
56
  program.addCommand(
51
57
  (0, import_globalOptions.addGlobalOptions)((0, import_create.makeCreateCommand)()).copyInheritedSettings(program)
52
58
  );
59
+ program.addCommand(
60
+ (0, import_globalOptions.addGlobalOptions)((0, import_execute.makeExecuteCommand)()).copyInheritedSettings(program)
61
+ );
53
62
  program.addCommand(
54
63
  (0, import_globalOptions.addGlobalOptions)(
55
64
  (0, import_globalOptions.addGetEntryOptions)((0, import_globalOptions.addImportOptions)((0, import_diff.makeDiffCommand)()))
@@ -72,9 +81,6 @@ const commands = () => {
72
81
  program.addCommand(
73
82
  (0, import_globalOptions.addGlobalOptions)((0, import_push.makePushCommand)()).copyInheritedSettings(program)
74
83
  );
75
- program.addCommand(
76
- (0, import_globalOptions.addGlobalOptions)((0, import_release.makeReleaseCommand)()).copyInheritedSettings(program)
77
- );
78
84
  program.addCommand(
79
85
  (0, import_globalOptions.addGlobalOptions)((0, import_remove.makeRemoveCommand)()).copyInheritedSettings(program)
80
86
  );
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/commands/index.ts"],
4
- "sourcesContent": ["import { Command } from 'commander';\nimport { Logger } from '~/util/logger';\nimport { LIB_VERSION } from '~/version';\nimport { makeConnectCommand } from './connect';\nimport { makeCreateCommand } from './create';\nimport { makeDiffCommand } from './diff';\nimport { makeGetCommand } from './get';\nimport {\n addAuthenticationOptions,\n addConnectOptions,\n addGetEntryOptions,\n addGlobalOptions,\n addImportOptions,\n} from './globalOptions';\nimport { makeImportCommand } from './import';\nimport { makeListCommand } from './list';\nimport { makeLoginCommand } from './login';\nimport { makePushCommand } from './push';\nimport { makeReleaseCommand } from './release';\nimport { makeRemoveCommand } from './remove';\nimport { makeSetCommand } from './set';\n\nconst commands = () => {\n const program = new Command()\n .name('contensis')\n .version(LIB_VERSION)\n .configureOutput({\n writeErr: str => {\n return str.toLowerCase().includes('error')\n ? Logger.error(`Command ${str}`)\n : str.trim() && Logger.help(str);\n },\n })\n .exitOverride()\n .showHelpAfterError(true);\n\n program.addCommand(\n addAuthenticationOptions(makeConnectCommand()).copyInheritedSettings(\n program\n )\n );\n program.addCommand(\n addGlobalOptions(makeCreateCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addGlobalOptions(\n addGetEntryOptions(addImportOptions(makeDiffCommand()))\n ).copyInheritedSettings(program)\n );\n program.addCommand(\n addGlobalOptions(makeGetCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addGlobalOptions(\n addGetEntryOptions(addImportOptions(makeImportCommand()))\n ).copyInheritedSettings(program)\n );\n program.addCommand(\n addGlobalOptions(makeListCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addConnectOptions(makeLoginCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addGlobalOptions(makePushCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addGlobalOptions(makeReleaseCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addGlobalOptions(makeRemoveCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addConnectOptions(makeSetCommand()).copyInheritedSettings(program)\n );\n\n return program;\n};\n\nexport default commands;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAwB;AACxB,oBAAuB;AACvB,qBAA4B;AAC5B,qBAAmC;AACnC,oBAAkC;AAClC,kBAAgC;AAChC,iBAA+B;AAC/B,2BAMO;AACP,oBAAkC;AAClC,kBAAgC;AAChC,mBAAiC;AACjC,kBAAgC;AAChC,qBAAmC;AACnC,oBAAkC;AAClC,iBAA+B;AAE/B,MAAM,WAAW,MAAM;AACrB,QAAM,UAAU,IAAI,yBAAQ,EACzB,KAAK,WAAW,EAChB,QAAQ,0BAAW,EACnB,gBAAgB;AAAA,IACf,UAAU,SAAO;AACf,aAAO,IAAI,YAAY,EAAE,SAAS,OAAO,IACrC,qBAAO,MAAM,WAAW,KAAK,IAC7B,IAAI,KAAK,KAAK,qBAAO,KAAK,GAAG;AAAA,IACnC;AAAA,EACF,CAAC,EACA,aAAa,EACb,mBAAmB,IAAI;AAE1B,UAAQ;AAAA,QACN,mDAAyB,mCAAmB,CAAC,EAAE;AAAA,MAC7C;AAAA,IACF;AAAA,EACF;AACA,UAAQ;AAAA,QACN,2CAAiB,iCAAkB,CAAC,EAAE,sBAAsB,OAAO;AAAA,EACrE;AACA,UAAQ;AAAA,QACN;AAAA,UACE,6CAAmB,2CAAiB,6BAAgB,CAAC,CAAC;AAAA,IACxD,EAAE,sBAAsB,OAAO;AAAA,EACjC;AACA,UAAQ;AAAA,QACN,2CAAiB,2BAAe,CAAC,EAAE,sBAAsB,OAAO;AAAA,EAClE;AACA,UAAQ;AAAA,QACN;AAAA,UACE,6CAAmB,2CAAiB,iCAAkB,CAAC,CAAC;AAAA,IAC1D,EAAE,sBAAsB,OAAO;AAAA,EACjC;AACA,UAAQ;AAAA,QACN,2CAAiB,6BAAgB,CAAC,EAAE,sBAAsB,OAAO;AAAA,EACnE;AACA,UAAQ;AAAA,QACN,4CAAkB,+BAAiB,CAAC,EAAE,sBAAsB,OAAO;AAAA,EACrE;AACA,UAAQ;AAAA,QACN,2CAAiB,6BAAgB,CAAC,EAAE,sBAAsB,OAAO;AAAA,EACnE;AACA,UAAQ;AAAA,QACN,2CAAiB,mCAAmB,CAAC,EAAE,sBAAsB,OAAO;AAAA,EACtE;AACA,UAAQ;AAAA,QACN,2CAAiB,iCAAkB,CAAC,EAAE,sBAAsB,OAAO;AAAA,EACrE;AACA,UAAQ;AAAA,QACN,4CAAkB,2BAAe,CAAC,EAAE,sBAAsB,OAAO;AAAA,EACnE;AAEA,SAAO;AACT;AAEA,IAAO,mBAAQ;",
4
+ "sourcesContent": ["import { Command } from 'commander';\nimport { Logger } from '~/util/logger';\nimport { LIB_VERSION } from '~/version';\nimport { makeConnectCommand } from './connect';\nimport { makeCreateCommand } from './create';\nimport { makeDiffCommand } from './diff';\nimport { makeExecuteCommand } from './execute';\nimport { makeGetCommand } from './get';\nimport {\n addAuthenticationOptions,\n addConnectOptions,\n addGetEntryOptions,\n addGlobalOptions,\n addImportOptions,\n} from './globalOptions';\nimport { makeImportCommand } from './import';\nimport { makeListCommand } from './list';\nimport { makeLoginCommand } from './login';\nimport { makePushCommand } from './push';\nimport { makeRemoveCommand } from './remove';\nimport { makeSetCommand } from './set';\n\nconst commands = () => {\n const program = new Command()\n .name('contensis')\n .version(LIB_VERSION)\n .configureOutput({\n writeErr: str => {\n return str.toLowerCase().includes('error')\n ? Logger.error(`Command ${str}`)\n : str.trim() && Logger.help(str);\n },\n })\n .addHelpText(\n 'after',\n Logger.helpText`\n>> Each command has its own help - for example:\n > login --help\\n > get --help\n`\n )\n .exitOverride()\n .showHelpAfterError(true);\n\n program.addCommand(\n addAuthenticationOptions(makeConnectCommand()).copyInheritedSettings(\n program\n )\n );\n program.addCommand(\n addGlobalOptions(makeCreateCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addGlobalOptions(makeExecuteCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addGlobalOptions(\n addGetEntryOptions(addImportOptions(makeDiffCommand()))\n ).copyInheritedSettings(program)\n );\n program.addCommand(\n addGlobalOptions(makeGetCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addGlobalOptions(\n addGetEntryOptions(addImportOptions(makeImportCommand()))\n ).copyInheritedSettings(program)\n );\n program.addCommand(\n addGlobalOptions(makeListCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addConnectOptions(makeLoginCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addGlobalOptions(makePushCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addGlobalOptions(makeRemoveCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addConnectOptions(makeSetCommand()).copyInheritedSettings(program)\n );\n\n return program;\n};\n\nexport default commands;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAwB;AACxB,oBAAuB;AACvB,qBAA4B;AAC5B,qBAAmC;AACnC,oBAAkC;AAClC,kBAAgC;AAChC,qBAAmC;AACnC,iBAA+B;AAC/B,2BAMO;AACP,oBAAkC;AAClC,kBAAgC;AAChC,mBAAiC;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AiB,iCAAkB,CAAC,EAAE,sBAAsB,OAAO;AAAA,EACrE;AACA,UAAQ;AAAA,QACN,4CAAkB,2BAAe,CAAC,EAAE,sBAAsB,OAAO;AAAA,EACnE;AAEA,SAAO;AACT;AAEA,IAAO,mBAAQ;",
6
6
  "names": []
7
7
  }
@@ -77,7 +77,7 @@ Example call:
77
77
  ...process.env
78
78
  };
79
79
  const blockRequest = (0, import_jsonpath_mapper.default)(mapSourceVars, {
80
- autoRelease: { $path: "release", $default: () => false },
80
+ release: { $path: "release", $default: () => false },
81
81
  id: ["blockId"],
82
82
  image: () => {
83
83
  const lastIndexOfColon = imageUri.lastIndexOf(":");
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/commands/push.ts"],
4
- "sourcesContent": ["import { Command } from 'commander';\nimport mapJson from 'jsonpath-mapper';\nimport { PushBlockParams } from 'migratortron';\nimport { cliCommand } from '~/services/ContensisCliService';\n\nexport const makePushCommand = () => {\n const push = new Command()\n .command('push')\n .description('push command')\n .addHelpText('after', `\\n`)\n .showHelpAfterError(true)\n .exitOverride();\n\n push\n .command('block')\n .description('push a block')\n .argument('<block-id>', 'the name of the block to push to')\n .argument(\n '<image uri:tag>',\n 'the uri and tag of the container image to push as a block (tag default: latest)'\n )\n .argument('[branch]', 'the branch we are pushing to')\n .option(\n '-r, --release',\n 'whether to release the pushed block version',\n false\n )\n .option(\n '-cid, --commit-id <commitId>',\n 'the id of the source git commit for the supplied image uri'\n )\n .option(\n '-cmsg, --commit-message <commitMessage>',\n 'the git commit message for the supplied commit id'\n )\n .option(\n '-cdt, --commit-datetime <commitDateTime>',\n 'the timestamp of the source git commit for the supplied image uri'\n )\n .option(\n '-author, --author-email <authorEmail>',\n 'the git email address of the author of the source git commit'\n )\n .option(\n '-committer, --committer-email <committerEmail>',\n 'the git email address of the commiter of the source git commit'\n )\n .option(\n '-repo, --repository-url <repositoryUrl>',\n 'the url of the source repository for the supplied image uri'\n )\n .option(\n '-pr, --provider <sourceProvider>',\n 'the url of the source repository for the supplied image uri'\n )\n .usage('<block-id> <image uri> [branch] [options]')\n .addHelpText(\n 'after',\n `\nExample call:\n > push block contensis-app ghcr.io/contensis/contensis-app/app:build-4359 master --release\\n`\n )\n .action(async (blockId: string, imageUri: string, branch: string, opts) => {\n const cli = cliCommand(['push', 'block', blockId], opts);\n const mapSourceVars = {\n blockId,\n imageUri,\n branch,\n ...opts,\n ...process.env,\n };\n\n const blockRequest = mapJson(mapSourceVars, {\n autoRelease: { $path: 'release', $default: () => false },\n id: ['blockId'],\n image: () => {\n const lastIndexOfColon = imageUri.lastIndexOf(':');\n return {\n uri: imageUri.slice(0, lastIndexOfColon),\n tag: imageUri.slice(lastIndexOfColon + 1) || 'latest',\n };\n },\n projectId: () => cli.env.currentProject || '',\n source: {\n provider: {\n $path: ['provider'],\n $return: (provider: string, { GITHUB_ACTIONS, GITLAB_CI }) => {\n if (provider) return provider;\n if (GITHUB_ACTIONS) return 'Github';\n else if (GITLAB_CI) return 'GitlabSelfHosted';\n },\n },\n repositoryUrl: {\n $path: ['repositoryUrl', 'CI_PROJECT_URL', 'GITHUB_REPOSITORY'],\n $formatting: (url: string, { GITHUB_ACTIONS }) => {\n if (GITHUB_ACTIONS) url = `https://github.com/${url}`;\n\n if (url && !url.endsWith('.git')) return `${url}.git`;\n return url;\n },\n },\n branch: ['branch', 'CI_COMMIT_REF_NAME', 'GITHUB_REF_NAME'],\n commit: {\n id: ['commitId', 'CI_COMMIT_SHORT_SHA', 'GITHUB_SHA'],\n message: {\n $path: ['commitMessage', 'CI_COMMIT_MESSAGE'], // ${{ github.event.head_commit.message }}\n $formatting: (msg?: string) =>\n msg?.replace(/\\\\n/g, ' ').replace(/\\\\n/g, ' ').trim(),\n },\n dateTime: ['commitDatetime', 'CI_COMMIT_TIMESTAMP'], // ${{ github.event.head_commit.timestamp }}\n authorEmail: ['authorEmail', 'GITLAB_USER_EMAIL', 'GITHUB_ACTOR'], // ${{ github.event.head_commit.author.email }}\n committerEmail: [\n 'committerEmail',\n 'GITLAB_USER_EMAIL',\n 'GITHUB_TRIGGERING_ACTOR',\n ], // ${{ github.event.head_commit.committer.email }}\n },\n },\n }) as PushBlockParams;\n\n await cli.PushBlock(blockRequest);\n\n // console.log(process.env);\n });\n\n return push;\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAwB;AACxB,6BAAoB;AAEpB,iCAA2B;AAEpB,MAAM,kBAAkB,MAAM;AACnC,QAAM,OAAO,IAAI,yBAAQ,EACtB,QAAQ,MAAM,EACd,YAAY,cAAc,EAC1B,YAAY,SAAS;AAAA,CAAI,EACzB,mBAAmB,IAAI,EACvB,aAAa;AAEhB,OACG,QAAQ,OAAO,EACf,YAAY,cAAc,EAC1B,SAAS,cAAc,kCAAkC,EACzD;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC,SAAS,YAAY,8BAA8B,EACnD;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC,MAAM,2CAA2C,EACjD;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,EAGF,EACC,OAAO,OAAO,SAAiB,UAAkB,QAAgB,SAAS;AACzE,UAAM,UAAM,uCAAW,CAAC,QAAQ,SAAS,OAAO,GAAG,IAAI;AACvD,UAAM,gBAAgB;AAAA,MACpB;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,MACH,GAAG,QAAQ;AAAA,IACb;AAEA,UAAM,mBAAe,uBAAAA,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AAA,MACF;AAAA,IACF,CAAC;AAED,UAAM,IAAI,UAAU,YAAY;AAAA,EAGlC,CAAC;AAEH,SAAO;AACT;",
4
+ "sourcesContent": ["import { Command } from 'commander';\nimport mapJson from 'jsonpath-mapper';\nimport { PushBlockParams } from 'migratortron';\nimport { cliCommand } from '~/services/ContensisCliService';\n\nexport const makePushCommand = () => {\n const push = new Command()\n .command('push')\n .description('push command')\n .addHelpText('after', `\\n`)\n .showHelpAfterError(true)\n .exitOverride();\n\n push\n .command('block')\n .description('push a block')\n .argument('<block-id>', 'the name of the block to push to')\n .argument(\n '<image uri:tag>',\n 'the uri and tag of the container image to push as a block (tag default: latest)'\n )\n .argument('[branch]', 'the branch we are pushing to')\n .option(\n '-r, --release',\n 'whether to release the pushed block version',\n false\n )\n .option(\n '-cid, --commit-id <commitId>',\n 'the id of the source git commit for the supplied image uri'\n )\n .option(\n '-cmsg, --commit-message <commitMessage>',\n 'the git commit message for the supplied commit id'\n )\n .option(\n '-cdt, --commit-datetime <commitDateTime>',\n 'the timestamp of the source git commit for the supplied image uri'\n )\n .option(\n '-author, --author-email <authorEmail>',\n 'the git email address of the author of the source git commit'\n )\n .option(\n '-committer, --committer-email <committerEmail>',\n 'the git email address of the commiter of the source git commit'\n )\n .option(\n '-repo, --repository-url <repositoryUrl>',\n 'the url of the source repository for the supplied image uri'\n )\n .option(\n '-pr, --provider <sourceProvider>',\n 'the url of the source repository for the supplied image uri'\n )\n .usage('<block-id> <image uri> [branch] [options]')\n .addHelpText(\n 'after',\n `\nExample call:\n > push block contensis-app ghcr.io/contensis/contensis-app/app:build-4359 master --release\\n`\n )\n .action(async (blockId: string, imageUri: string, branch: string, opts) => {\n const cli = cliCommand(['push', 'block', blockId], opts);\n const mapSourceVars = {\n blockId,\n imageUri,\n branch,\n ...opts,\n ...process.env,\n };\n\n const blockRequest = mapJson(mapSourceVars, {\n release: { $path: 'release', $default: () => false },\n id: ['blockId'],\n image: () => {\n const lastIndexOfColon = imageUri.lastIndexOf(':');\n return {\n uri: imageUri.slice(0, lastIndexOfColon),\n tag: imageUri.slice(lastIndexOfColon + 1) || 'latest',\n };\n },\n projectId: () => cli.env.currentProject || '',\n source: {\n provider: {\n $path: ['provider'],\n $return: (provider: string, { GITHUB_ACTIONS, GITLAB_CI }) => {\n if (provider) return provider;\n if (GITHUB_ACTIONS) return 'Github';\n else if (GITLAB_CI) return 'GitlabSelfHosted';\n },\n },\n repositoryUrl: {\n $path: ['repositoryUrl', 'CI_PROJECT_URL', 'GITHUB_REPOSITORY'],\n $formatting: (url: string, { GITHUB_ACTIONS }) => {\n if (GITHUB_ACTIONS) url = `https://github.com/${url}`;\n\n if (url && !url.endsWith('.git')) return `${url}.git`;\n return url;\n },\n },\n branch: ['branch', 'CI_COMMIT_REF_NAME', 'GITHUB_REF_NAME'],\n commit: {\n id: ['commitId', 'CI_COMMIT_SHORT_SHA', 'GITHUB_SHA'],\n message: {\n $path: ['commitMessage', 'CI_COMMIT_MESSAGE'], // ${{ github.event.head_commit.message }}\n $formatting: (msg?: string) =>\n msg?.replace(/\\\\n/g, ' ').replace(/\\\\n/g, ' ').trim(),\n },\n dateTime: ['commitDatetime', 'CI_COMMIT_TIMESTAMP'], // ${{ github.event.head_commit.timestamp }}\n authorEmail: ['authorEmail', 'GITLAB_USER_EMAIL', 'GITHUB_ACTOR'], // ${{ github.event.head_commit.author.email }}\n committerEmail: [\n 'committerEmail',\n 'GITLAB_USER_EMAIL',\n 'GITHUB_TRIGGERING_ACTOR',\n ], // ${{ github.event.head_commit.committer.email }}\n },\n },\n }) as PushBlockParams;\n\n await cli.PushBlock(blockRequest);\n\n // console.log(process.env);\n });\n\n return push;\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAwB;AACxB,6BAAoB;AAEpB,iCAA2B;AAEpB,MAAM,kBAAkB,MAAM;AACnC,QAAM,OAAO,IAAI,yBAAQ,EACtB,QAAQ,MAAM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AC,UAAU;AAAA,UAClB,SAAS,CAAC,UAAkB,EAAE,gBAAgB,UAAU,MAAM;AAC5D,gBAAI;AAAU,qBAAO;AACrB,gBAAI;AAAgB,qBAAO;AAAA,qBAClB;AAAW,qBAAO;AAAA,UAC7B;AAAA,QACF;AAAA,QACA,eAAe;AAAA,UACb,OAAO,CAAC,iBAAiB,kBAAkB,mBAAmB;AAAA,UAC9D,aAAa,CAAC,KAAa,EAAE,eAAe,MAAM;AAChD,gBAAI;AAAgB,oBAAM,sBAAsB;AAEhD,gBAAI,OAAO,CAAC,IAAI,SAAS,MAAM;AAAG,qBAAO,GAAG;AAC5C,mBAAO;AAAA,UACT;AAAA,QACF;AAAA,QACA,QAAQ,CAAC,UAAU,sBAAsB,iBAAiB;AAAA,QAC1D,QAAQ;AAAA,UACN,IAAI,CAAC,YAAY,uBAAuB,YAAY;AAAA,UACpD,SAAS;AAAA,YACP,OAAO,CAAC,iBAAiB,mBAAmB;AAAA,YAC5C,aAAa,CAAC,QACZ,2BAAK,QAAQ,QAAQ,KAAK,QAAQ,QAAQ,KAAK;AAAA,UACnD;AAAA,UACA,UAAU,CAAC,kBAAkB,qBAAqB;AAAA,UAClD,aAAa,CAAC,eAAe,qBAAqB,cAAc;AAAA,UAChE,gBAAgB;AAAA,YACd;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF,CAAC;AAED,UAAM,IAAI,UAAU,YAAY;AAAA,EAGlC,CAAC;AAEH,SAAO;AACT;",
6
6
  "names": ["mapJson"]
7
7
  }
@@ -241,10 +241,16 @@ ${import_logger.Logger.errorText(">>")} Available commands:`,
241
241
  failedPush: (id, env, projectId) => `[${env}] Unable to push block ${import_logger.Logger.highlightText(
242
242
  id
243
243
  )} in project ${projectId}`,
244
- released: (id, env, projectId) => `[${env}] Released block ${import_logger.Logger.highlightText(
244
+ latestVersion: (version, id, env, projectId) => `[${env}] Found latest block version ${import_logger.Logger.highlightText(
245
245
  id
246
- )} in project ${projectId}`,
247
- failedRelease: (id, env, projectId) => `[${env}] Unable to release block ${import_logger.Logger.highlightText(
246
+ )} in project ${projectId} ${import_logger.Logger.highlightText(version)}`,
247
+ failedParsingVersion: () => `Could not parse ".[0].version.versionNo" from response`,
248
+ actionComplete: (action, id, env, projectId) => `[${env}] Action ${import_logger.Logger.highlightText(
249
+ action
250
+ )} on ${import_logger.Logger.highlightText(
251
+ id
252
+ )} in project ${projectId} requested successfully`,
253
+ actionFailed: (action, id, env, projectId) => `[${env}] Problem executing ${action} on block ${import_logger.Logger.highlightText(
248
254
  id
249
255
  )} in project ${projectId}`,
250
256
  deleted: (id, env, projectId) => `[${env}] Deleted block ${import_logger.Logger.highlightText(