contensis-cli 1.0.0-beta.9 → 1.0.0-beta.90

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.
Files changed (125) hide show
  1. package/README.md +1146 -78
  2. package/cli.js +3 -0
  3. package/dist/commands/connect.js +3 -3
  4. package/dist/commands/connect.js.map +2 -2
  5. package/dist/commands/create.js +45 -10
  6. package/dist/commands/create.js.map +2 -2
  7. package/dist/commands/dev.js +75 -0
  8. package/dist/commands/dev.js.map +7 -0
  9. package/dist/commands/diff.js +57 -0
  10. package/dist/commands/diff.js.map +7 -0
  11. package/dist/commands/execute.js +103 -0
  12. package/dist/commands/execute.js.map +7 -0
  13. package/dist/commands/get.js +169 -32
  14. package/dist/commands/get.js.map +3 -3
  15. package/dist/commands/globalOptions.js +37 -12
  16. package/dist/commands/globalOptions.js.map +2 -2
  17. package/dist/commands/import.js +47 -12
  18. package/dist/commands/import.js.map +2 -2
  19. package/dist/commands/index.js +22 -2
  20. package/dist/commands/index.js.map +2 -2
  21. package/dist/commands/list.js +53 -10
  22. package/dist/commands/list.js.map +2 -2
  23. package/dist/commands/login.js +2 -2
  24. package/dist/commands/login.js.map +2 -2
  25. package/dist/commands/push.js +17 -13
  26. package/dist/commands/push.js.map +2 -2
  27. package/dist/commands/remove.js +51 -8
  28. package/dist/commands/remove.js.map +2 -2
  29. package/dist/commands/set.js +139 -12
  30. package/dist/commands/set.js.map +2 -2
  31. package/dist/index.js +1 -1
  32. package/dist/index.js.map +2 -2
  33. package/dist/localisation/en-GB.js +259 -49
  34. package/dist/localisation/en-GB.js.map +2 -2
  35. package/dist/mappers/ContensisCliService-to-RequestHanderSiteConfigYaml.js +56 -0
  36. package/dist/mappers/ContensisCliService-to-RequestHanderSiteConfigYaml.js.map +7 -0
  37. package/dist/mappers/DevInit-to-CIWorkflow.js +127 -0
  38. package/dist/mappers/DevInit-to-CIWorkflow.js.map +7 -0
  39. package/dist/mappers/DevInit-to-RolePermissions.js +54 -0
  40. package/dist/mappers/DevInit-to-RolePermissions.js.map +7 -0
  41. package/dist/mappers/DevRequests-to-RequestHanderSiteConfigYaml.js +56 -0
  42. package/dist/mappers/DevRequests-to-RequestHanderSiteConfigYaml.js.map +7 -0
  43. package/dist/models/CliService.d.js +17 -0
  44. package/dist/models/CliService.d.js.map +7 -0
  45. package/dist/models/DevService.d.js +17 -0
  46. package/dist/models/DevService.d.js.map +7 -0
  47. package/dist/providers/CredentialProvider.js +46 -14
  48. package/dist/providers/CredentialProvider.js.map +3 -3
  49. package/dist/providers/SessionCacheProvider.js +21 -1
  50. package/dist/providers/SessionCacheProvider.js.map +2 -2
  51. package/dist/providers/file-provider.js +12 -6
  52. package/dist/providers/file-provider.js.map +3 -3
  53. package/dist/services/ContensisCliService.js +1148 -421
  54. package/dist/services/ContensisCliService.js.map +3 -3
  55. package/dist/services/ContensisDevService.js +309 -0
  56. package/dist/services/ContensisDevService.js.map +7 -0
  57. package/dist/services/ContensisRoleService.js +87 -0
  58. package/dist/services/ContensisRoleService.js.map +7 -0
  59. package/dist/shell.js +58 -18
  60. package/dist/shell.js.map +3 -3
  61. package/dist/util/console.printer.js +171 -55
  62. package/dist/util/console.printer.js.map +2 -2
  63. package/dist/util/diff.js +102 -0
  64. package/dist/util/diff.js.map +7 -0
  65. package/dist/util/dotenv.js +57 -0
  66. package/dist/util/dotenv.js.map +7 -0
  67. package/dist/util/find.js +31 -0
  68. package/dist/util/find.js.map +7 -0
  69. package/dist/util/git.js +126 -0
  70. package/dist/util/git.js.map +7 -0
  71. package/dist/util/index.js +8 -2
  72. package/dist/util/index.js.map +3 -3
  73. package/dist/util/logger.js +90 -29
  74. package/dist/util/logger.js.map +3 -3
  75. package/dist/util/os.js +39 -0
  76. package/dist/util/os.js.map +7 -0
  77. package/dist/util/timers.js +49 -0
  78. package/dist/util/timers.js.map +7 -0
  79. package/dist/util/yaml.js +45 -0
  80. package/dist/util/yaml.js.map +7 -0
  81. package/dist/version.js +1 -1
  82. package/dist/version.js.map +1 -1
  83. package/esbuild.config.js +3 -1
  84. package/package.json +12 -3
  85. package/src/commands/connect.ts +3 -2
  86. package/src/commands/create.ts +61 -8
  87. package/src/commands/dev.ts +69 -0
  88. package/src/commands/diff.ts +41 -0
  89. package/src/commands/execute.ts +117 -0
  90. package/src/commands/get.ts +242 -28
  91. package/src/commands/globalOptions.ts +42 -12
  92. package/src/commands/import.ts +58 -8
  93. package/src/commands/index.ts +22 -1
  94. package/src/commands/list.ts +85 -11
  95. package/src/commands/login.ts +2 -1
  96. package/src/commands/push.ts +18 -11
  97. package/src/commands/remove.ts +66 -4
  98. package/src/commands/set.ts +189 -9
  99. package/src/index.ts +1 -4
  100. package/src/localisation/en-GB.ts +374 -66
  101. package/src/mappers/ContensisCliService-to-RequestHanderSiteConfigYaml.ts +44 -0
  102. package/src/mappers/DevInit-to-CIWorkflow.ts +150 -0
  103. package/src/mappers/DevInit-to-RolePermissions.ts +33 -0
  104. package/src/mappers/DevRequests-to-RequestHanderSiteConfigYaml.ts +44 -0
  105. package/src/models/CliService.d.ts +36 -0
  106. package/src/models/DevService.d.ts +5 -0
  107. package/src/models/JsModules.d.ts +1 -0
  108. package/src/providers/CredentialProvider.ts +51 -18
  109. package/src/providers/SessionCacheProvider.ts +29 -2
  110. package/src/providers/file-provider.ts +17 -6
  111. package/src/services/ContensisCliService.ts +1458 -518
  112. package/src/services/ContensisDevService.ts +365 -0
  113. package/src/services/ContensisRoleService.ts +76 -0
  114. package/src/shell.ts +68 -18
  115. package/src/util/console.printer.ts +240 -78
  116. package/src/util/diff.ts +113 -0
  117. package/src/util/dotenv.ts +37 -0
  118. package/src/util/find.ts +8 -0
  119. package/src/util/git.ts +130 -0
  120. package/src/util/index.ts +16 -7
  121. package/src/util/logger.ts +145 -31
  122. package/src/util/os.ts +7 -0
  123. package/src/util/timers.ts +24 -0
  124. package/src/util/yaml.ts +13 -0
  125. package/src/version.ts +1 -1
@@ -26,6 +26,9 @@ var import_logger = require("../util/logger");
26
26
  var import_version = require("../version");
27
27
  var import_connect = require("./connect");
28
28
  var import_create = require("./create");
29
+ var import_dev = require("./dev");
30
+ var import_diff = require("./diff");
31
+ var import_execute = require("./execute");
29
32
  var import_get = require("./get");
30
33
  var import_globalOptions = require("./globalOptions");
31
34
  var import_import = require("./import");
@@ -39,15 +42,32 @@ const commands = () => {
39
42
  writeErr: (str) => {
40
43
  return str.toLowerCase().includes("error") ? import_logger.Logger.error(`Command ${str}`) : str.trim() && import_logger.Logger.help(str);
41
44
  }
42
- }).exitOverride().showHelpAfterError(true);
45
+ }).addHelpText(
46
+ "after",
47
+ import_logger.Logger.helpText`
48
+ >> Each command has its own help - for example:
49
+ > login --help\n > get --help
50
+ `
51
+ ).exitOverride().showHelpAfterError(true);
43
52
  program.addCommand(
44
53
  (0, import_globalOptions.addAuthenticationOptions)((0, import_connect.makeConnectCommand)()).copyInheritedSettings(
45
54
  program
46
55
  )
47
56
  );
57
+ program.addCommand(
58
+ (0, import_globalOptions.addGlobalOptions)((0, import_create.makeCreateCommand)()).copyInheritedSettings(program)
59
+ );
60
+ program.addCommand(
61
+ (0, import_globalOptions.addConnectOptions)(
62
+ (0, import_globalOptions.addAuthenticationOptions)((0, import_dev.makeDevCommand)())
63
+ ).copyInheritedSettings(program)
64
+ );
65
+ program.addCommand(
66
+ (0, import_globalOptions.addGlobalOptions)((0, import_execute.makeExecuteCommand)()).copyInheritedSettings(program)
67
+ );
48
68
  program.addCommand(
49
69
  (0, import_globalOptions.addGlobalOptions)(
50
- (0, import_globalOptions.addImportOptions)((0, import_create.makeCreateCommand)())
70
+ (0, import_globalOptions.addGetEntryOptions)((0, import_globalOptions.addImportOptions)((0, import_diff.makeDiffCommand)()))
51
71
  ).copyInheritedSettings(program)
52
72
  );
53
73
  program.addCommand(
@@ -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 { 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 .exitOverride()\n .showHelpAfterError(true);\n\n program.addCommand(\n addAuthenticationOptions(makeConnectCommand()).copyInheritedSettings(\n program\n )\n );\n program.addCommand(\n addGlobalOptions(\n addImportOptions(makeCreateCommand())\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,iBAA+B;AAC/B,2BAMO;AACP,oBAAkC;AAClC,kBAAgC;AAChC,mBAA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VERSION } from '~/version';\nimport { makeConnectCommand } from './connect';\nimport { makeCreateCommand } from './create';\nimport { makeDevCommand } from './dev';\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 addConnectOptions(\n addAuthenticationOptions(makeDevCommand())\n ).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,iBAA+B;AAC/B,kBAAgC;AAChC,qBAAmC;AACnC,iBAA+B;AAC/B,2BAMO;AACP,oBAAkC;AAClC,kBAAgC;AAChC,mBAAiC;AACjC,kBAAgC;AAChC,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,IACC;AAAA,IACA,qBAAO;AAAA;AAAA;AAAA;AAAA,EAIT,EACC,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,mDAAyB,2BAAe,CAAC;AAAA,IAC3C,EAAE,sBAAsB,OAAO;AAAA,EACjC;AACA,UAAQ;AAAA,QACN,2CAAiB,mCAAmB,CAAC,EAAE,sBAAsB,OAAO;AAAA,EACtE;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,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
  }
@@ -24,8 +24,9 @@ module.exports = __toCommonJS(list_exports);
24
24
  var import_commander = require("commander");
25
25
  var import_ContensisCliService = require("../services/ContensisCliService");
26
26
  const makeListCommand = () => {
27
- const list = new import_commander.Command().command("list").showHelpAfterError(true).exitOverride();
28
- list.command("envs").addHelpText(
27
+ const list = new import_commander.Command().command("list").description("list command").addHelpText("after", `
28
+ `).showHelpAfterError(true).exitOverride();
29
+ list.command("envs").description("List all previously connected environments").addHelpText(
29
30
  "after",
30
31
  `
31
32
  Example call:
@@ -34,10 +35,25 @@ Example call:
34
35
  ).action((opts) => {
35
36
  (0, import_ContensisCliService.cliCommand)(["list", "envs"], opts).PrintEnvironments();
36
37
  });
37
- list.command("projects").action(async (opts) => {
38
+ list.command("projects").description("print list of projects").addHelpText(
39
+ "after",
40
+ `
41
+ Example call:
42
+ > list projects
43
+ `
44
+ ).action(async (opts) => {
38
45
  await (0, import_ContensisCliService.cliCommand)(["list", "projects"], opts).PrintProjects();
39
46
  });
40
- list.command("contenttypes").addHelpText(
47
+ list.command("models").description("print list of content models").addHelpText(
48
+ "after",
49
+ `
50
+ Example call:
51
+ > list models
52
+ `
53
+ ).action(async (opts) => {
54
+ await (0, import_ContensisCliService.cliCommand)(["list", "models"], opts).PrintContentModels();
55
+ });
56
+ list.command("contenttypes").description("print list of content types").addHelpText(
41
57
  "after",
42
58
  `
43
59
  Example call:
@@ -46,7 +62,7 @@ Example call:
46
62
  ).action(async (opts) => {
47
63
  await (0, import_ContensisCliService.cliCommand)(["list", "contenttypes"], opts).PrintContentTypes();
48
64
  });
49
- list.command("components").addHelpText(
65
+ list.command("components").description("print list of components").addHelpText(
50
66
  "after",
51
67
  `
52
68
  Example call:
@@ -55,7 +71,7 @@ Example call:
55
71
  ).action(async (opts) => {
56
72
  await (0, import_ContensisCliService.cliCommand)(["list", "components"], opts).PrintComponents();
57
73
  });
58
- list.command("blocks").addHelpText(
74
+ list.command("blocks").description("print list of content blocks").addHelpText(
59
75
  "after",
60
76
  `
61
77
  Example call:
@@ -64,7 +80,7 @@ Example call:
64
80
  ).action(async (opts) => {
65
81
  await (0, import_ContensisCliService.cliCommand)(["list", "blocks"], opts).PrintBlocks();
66
82
  });
67
- list.command("keys").addHelpText(
83
+ list.command("keys").description("print list of API keys").addHelpText(
68
84
  "after",
69
85
  `
70
86
  Example call:
@@ -73,10 +89,37 @@ Example call:
73
89
  ).action(async (opts) => {
74
90
  await (0, import_ContensisCliService.cliCommand)(["list", "keys"], opts).PrintApiKeys();
75
91
  });
76
- list.command("webhooks").argument("[name]", "find webhooks matching the supplied name").option("-i --id <id...>", "the subscription id(s) to get").action(async (name, { id, ...opts } = {}) => {
92
+ list.command("proxies").description("print list of proxies").addHelpText(
93
+ "after",
94
+ `
95
+ Example call:
96
+ > list proxies
97
+ `
98
+ ).action(async (opts) => {
99
+ await (0, import_ContensisCliService.cliCommand)(["list", "proxies"], opts).PrintProxies();
100
+ });
101
+ list.command("renderers").description("print list of renderers").addHelpText(
102
+ "after",
103
+ `
104
+ Example call:
105
+ > list renderers
106
+ `
107
+ ).action(async (opts) => {
108
+ await (0, import_ContensisCliService.cliCommand)(["list", "renderers"], opts).PrintRenderers();
109
+ });
110
+ list.command("roles").description("print list of roles").addHelpText(
111
+ "after",
112
+ `
113
+ Example call:
114
+ > list roles
115
+ `
116
+ ).action(async (opts) => {
117
+ await (0, import_ContensisCliService.cliCommand)(["list", "roles"], opts).PrintRoles();
118
+ });
119
+ list.command("webhooks").description("print list of webhooks").argument("[name]", "find webhooks matching the supplied name").option("-i --id <id...>", "the subscription id(s) to get").addHelpText("after", `
120
+ `).action(async (name, { id, ...opts } = {}) => {
77
121
  await (0, import_ContensisCliService.cliCommand)(["list", "webhooks"], opts).PrintWebhookSubscriptions(
78
- id,
79
- name
122
+ name ? [name] : id
80
123
  );
81
124
  });
82
125
  return list;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/commands/list.ts"],
4
- "sourcesContent": ["import { Command } from 'commander';\nimport { cliCommand } from '~/services/ContensisCliService';\n\n// projects\n// content types\n// components\n// api keys\n// roles\n// webhooks\nexport const makeListCommand = () => {\n const list = new Command()\n .command('list')\n .showHelpAfterError(true)\n .exitOverride();\n\n list\n .command('envs')\n .addHelpText(\n 'after',\n `\nExample call:\n > list envs\n`\n )\n .action(opts => {\n cliCommand(['list', 'envs'], opts).PrintEnvironments();\n });\n list.command('projects').action(async opts => {\n await cliCommand(['list', 'projects'], opts).PrintProjects();\n });\n list\n .command('contenttypes')\n .addHelpText(\n 'after',\n `\nExample call:\n > list contenttypes -o ./output.json -f json\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'contenttypes'], opts).PrintContentTypes();\n });\n list\n .command('components')\n .addHelpText(\n 'after',\n `\nExample call:\n > list components -o ./output.json -f json\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'components'], opts).PrintComponents();\n });\n list\n .command('blocks')\n .addHelpText(\n 'after',\n `\nExample call:\n > list blocks\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'blocks'], opts).PrintBlocks();\n });\n list\n .command('keys')\n .addHelpText(\n 'after',\n `\nExample call:\n > list keys\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'keys'], opts).PrintApiKeys();\n });\n list\n .command('webhooks')\n .argument('[name]', 'find webhooks matching the supplied name')\n .option('-i --id <id...>', 'the subscription id(s) to get')\n .action(async (name?: string, { id, ...opts }: any = {}) => {\n await cliCommand(['list', 'webhooks'], opts).PrintWebhookSubscriptions(\n id,\n name\n );\n });\n return list;\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAwB;AACxB,iCAA2B;AAQpB,MAAM,kBAAkB,MAAM;AACnC,QAAM,OAAO,IAAI,yBAAQ,EACtB,QAAQ,MAAM,EACd,mBAAmB,IAAI,EACvB,aAAa;AAEhB,OACG,QAAQ,MAAM,EACd;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,EAIF,EACC,OAAO,UAAQ;AACd,+CAAW,CAAC,QAAQ,MAAM,GAAG,IAAI,EAAE,kBAAkB;AAAA,EACvD,CAAC;AACH,OAAK,QAAQ,UAAU,EAAE,OAAO,OAAM,SAAQ;AAC5C,cAAM,uCAAW,CAAC,QAAQ,UAAU,GAAG,IAAI,EAAE,cAAc;AAAA,EAC7D,CAAC;AACD,OACG,QAAQ,cAAc,EACtB;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,EAIF,EACC,OAAO,OAAM,SAAQ;AACpB,cAAM,uCAAW,CAAC,QAAQ,cAAc,GAAG,IAAI,EAAE,kBAAkB;AAAA,EACrE,CAAC;AACH,OACG,QAAQ,YAAY,EACpB;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,EAIF,EACC,OAAO,OAAM,SAAQ;AACpB,cAAM,uCAAW,CAAC,QAAQ,YAAY,GAAG,IAAI,EAAE,gBAAgB;AAAA,EACjE,CAAC;AACH,OACG,QAAQ,QAAQ,EAChB;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,EAIF,EACC,OAAO,OAAM,SAAQ;AACpB,cAAM,uCAAW,CAAC,QAAQ,QAAQ,GAAG,IAAI,EAAE,YAAY;AAAA,EACzD,CAAC;AACH,OACG,QAAQ,MAAM,EACd;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,EAIF,EACC,OAAO,OAAM,SAAQ;AACpB,cAAM,uCAAW,CAAC,QAAQ,MAAM,GAAG,IAAI,EAAE,aAAa;AAAA,EACxD,CAAC;AACH,OACG,QAAQ,UAAU,EAClB,SAAS,UAAU,0CAA0C,EAC7D,OAAO,mBAAmB,+BAA+B,EACzD,OAAO,OAAO,MAAe,EAAE,OAAO,KAAK,IAAS,CAAC,MAAM;AAC1D,cAAM,uCAAW,CAAC,QAAQ,UAAU,GAAG,IAAI,EAAE;AAAA,MAC3C;AAAA,MACA;AAAA,IACF;AAAA,EACF,CAAC;AACH,SAAO;AACT;",
4
+ "sourcesContent": ["import { Command } from 'commander';\nimport { cliCommand } from '~/services/ContensisCliService';\n\nexport const makeListCommand = () => {\n const list = new Command()\n .command('list')\n .description('list command')\n .addHelpText('after', `\\n`)\n .showHelpAfterError(true)\n .exitOverride();\n\n list\n .command('envs')\n .description('List all previously connected environments')\n .addHelpText(\n 'after',\n `\nExample call:\n > list envs\n`\n )\n .action(opts => {\n cliCommand(['list', 'envs'], opts).PrintEnvironments();\n });\n\n list\n .command('projects')\n .description('print list of projects')\n .addHelpText(\n 'after',\n `\nExample call:\n > list projects\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'projects'], opts).PrintProjects();\n });\n\n list\n .command('models')\n .description('print list of content models')\n .addHelpText(\n 'after',\n `\nExample call:\n > list models\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'models'], opts).PrintContentModels();\n });\n\n list\n .command('contenttypes')\n .description('print list of content types')\n .addHelpText(\n 'after',\n `\nExample call:\n > list contenttypes -o ./output.json -f json\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'contenttypes'], opts).PrintContentTypes();\n });\n\n list\n .command('components')\n .description('print list of components')\n .addHelpText(\n 'after',\n `\nExample call:\n > list components -o ./output.json -f json\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'components'], opts).PrintComponents();\n });\n\n list\n .command('blocks')\n .description('print list of content blocks')\n .addHelpText(\n 'after',\n `\nExample call:\n > list blocks\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'blocks'], opts).PrintBlocks();\n });\n\n list\n .command('keys')\n .description('print list of API keys')\n .addHelpText(\n 'after',\n `\nExample call:\n > list keys\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'keys'], opts).PrintApiKeys();\n });\n\n list\n .command('proxies')\n .description('print list of proxies')\n .addHelpText(\n 'after',\n `\nExample call:\n > list proxies\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'proxies'], opts).PrintProxies();\n });\n\n list\n .command('renderers')\n .description('print list of renderers')\n .addHelpText(\n 'after',\n `\nExample call:\n > list renderers\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'renderers'], opts).PrintRenderers();\n });\n\n list\n .command('roles')\n .description('print list of roles')\n .addHelpText(\n 'after',\n `\nExample call:\n > list roles\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'roles'], opts).PrintRoles();\n });\n\n list\n .command('webhooks')\n .description('print list of webhooks')\n .argument('[name]', 'find webhooks matching the supplied name')\n .option('-i --id <id...>', 'the subscription id(s) to get')\n .addHelpText('after', `\\n`)\n .action(async (name?: string, { id, ...opts }: any = {}) => {\n await cliCommand(['list', 'webhooks'], opts).PrintWebhookSubscriptions(\n name ? [name] : id\n );\n });\n return list;\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAwB;AACxB,iCAA2B;AAEpB,MAAM,kBAAkB,MAAM;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C3C,OAAO,CAAC,IAAI,IAAI;AAAA,IAClB;AAAA,EACF,CAAC;AACH,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -25,7 +25,7 @@ var import_commander = require("commander");
25
25
  var import_ContensisCliService = require("../services/ContensisCliService");
26
26
  var import_shell = require("../shell");
27
27
  const makeLoginCommand = () => {
28
- const login = new import_commander.Command().command("login").argument("<user/clientId>", "the username to login with").argument(
28
+ const login = new import_commander.Command().command("login").description("login to a connected Contensis instance").argument("<user/clientId>", "the username to login with").argument(
29
29
  "[password]",
30
30
  "the password to use to login with (optional/insecure)"
31
31
  ).option(
@@ -45,7 +45,7 @@ Example call:
45
45
  sharedSecret: opts.sharedSecret
46
46
  });
47
47
  if (token)
48
- await (0, import_shell.shell)().start();
48
+ await (0, import_shell.shell)().restart();
49
49
  });
50
50
  return login;
51
51
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/commands/login.ts"],
4
- "sourcesContent": ["import { Command } from 'commander';\nimport { cliCommand } from '~/services/ContensisCliService';\nimport { shell } from '~/shell';\n\nexport const makeLoginCommand = () => {\n const login = new Command()\n .command('login')\n .argument('<user/clientId>', 'the username to login with')\n .argument(\n '[password]',\n 'the password to use to login with (optional/insecure)'\n )\n .option(\n '-s --shared-secret <sharedSecret>',\n 'the shared secret to use when logging in with a client id'\n )\n .usage('<user/clientId> [password] [-s <sharedSecret>]')\n .addHelpText(\n 'after',\n `\nExample call:\n > login myuserid\\n -- or --\\n > login {clientId} -s {sharedSecret}\n`\n )\n .action(async (user, password, opts) => {\n const token = await cliCommand(['login', user]).Login(user, {\n password,\n sharedSecret: opts.sharedSecret,\n });\n if (token) await shell().start();\n });\n return login;\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAwB;AACxB,iCAA2B;AAC3B,mBAAsB;AAEf,MAAM,mBAAmB,MAAM;AACpC,QAAM,QAAQ,IAAI,yBAAQ,EACvB,QAAQ,OAAO,EACf,SAAS,mBAAmB,4BAA4B,EACxD;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC,MAAM,gDAAgD,EACtD;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAIF,EACC,OAAO,OAAO,MAAM,UAAU,SAAS;AACtC,UAAM,QAAQ,UAAM,uCAAW,CAAC,SAAS,IAAI,CAAC,EAAE,MAAM,MAAM;AAAA,MAC1D;AAAA,MACA,cAAc,KAAK;AAAA,IACrB,CAAC;AACD,QAAI;AAAO,gBAAM,oBAAM,EAAE,MAAM;AAAA,EACjC,CAAC;AACH,SAAO;AACT;",
4
+ "sourcesContent": ["import { Command } from 'commander';\nimport { cliCommand } from '~/services/ContensisCliService';\nimport { shell } from '~/shell';\n\nexport const makeLoginCommand = () => {\n const login = new Command()\n .command('login')\n .description('login to a connected Contensis instance')\n .argument('<user/clientId>', 'the username to login with')\n .argument(\n '[password]',\n 'the password to use to login with (optional/insecure)'\n )\n .option(\n '-s --shared-secret <sharedSecret>',\n 'the shared secret to use when logging in with a client id'\n )\n .usage('<user/clientId> [password] [-s <sharedSecret>]')\n .addHelpText(\n 'after',\n `\nExample call:\n > login myuserid\\n -- or --\\n > login {clientId} -s {sharedSecret}\n`\n )\n .action(async (user, password, opts) => {\n const token = await cliCommand(['login', user]).Login(user, {\n password,\n sharedSecret: opts.sharedSecret,\n });\n if (token) await shell().restart();\n });\n return login;\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAwB;AACxB,iCAA2B;AAC3B,mBAAsB;AAEf,MAAM,mBAAmB,MAAM;AACpC,QAAM,QAAQ,IAAI,yBAAQ,EACvB,QAAQ,OAAO,EACf,YAAY,yCAAyC,EACrD,SAAS,mBAAmB,4BAA4B,EACxD;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC,MAAM,gDAAgD,EACtD;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAIF,EACC,OAAO,OAAO,MAAM,UAAU,SAAS;AACtC,UAAM,QAAQ,UAAM,uCAAW,CAAC,SAAS,IAAI,CAAC,EAAE,MAAM,MAAM;AAAA,MAC1D;AAAA,MACA,cAAc,KAAK;AAAA,IACrB,CAAC;AACD,QAAI;AAAO,gBAAM,oBAAM,EAAE,QAAQ;AAAA,EACnC,CAAC;AACH,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -31,40 +31,41 @@ var import_commander = require("commander");
31
31
  var import_jsonpath_mapper = __toESM(require("jsonpath-mapper"));
32
32
  var import_ContensisCliService = require("../services/ContensisCliService");
33
33
  const makePushCommand = () => {
34
- const push = new import_commander.Command().command("push").showHelpAfterError(true).exitOverride();
35
- push.command("block").argument("<block-id>", "the name of the block to push to").argument(
34
+ const push = new import_commander.Command().command("push").description("push command").addHelpText("after", `
35
+ `).showHelpAfterError(true).exitOverride();
36
+ push.command("block").description("push a block").argument("<block-id>", "the name of the block to push to").argument(
36
37
  "<image uri:tag>",
37
38
  "the uri and tag of the container image to push as a block (tag default: latest)"
38
39
  ).argument("[branch]", "the branch we are pushing to").option(
39
- "-r, --release",
40
+ "-r --release",
40
41
  "whether to release the pushed block version",
41
42
  false
42
43
  ).option(
43
- "-cid, --commit-id <commitId>",
44
+ "-cid --commit-id <commitId>",
44
45
  "the id of the source git commit for the supplied image uri"
45
46
  ).option(
46
- "-cmsg, --commit-message <commitMessage>",
47
+ "-cmsg --commit-message <commitMessage>",
47
48
  "the git commit message for the supplied commit id"
48
49
  ).option(
49
- "-cdt, --commit-datetime <commitDateTime>",
50
+ "-cdt --commit-datetime <commitDateTime>",
50
51
  "the timestamp of the source git commit for the supplied image uri"
51
52
  ).option(
52
- "-author, --author-email <authorEmail>",
53
+ "-author --author-email <authorEmail>",
53
54
  "the git email address of the author of the source git commit"
54
55
  ).option(
55
- "-committer, --committer-email <committerEmail>",
56
+ "-committer --committer-email <committerEmail>",
56
57
  "the git email address of the commiter of the source git commit"
57
58
  ).option(
58
- "-repo, --repository-url <repositoryUrl>",
59
+ "-repo --repository-url <repositoryUrl>",
59
60
  "the url of the source repository for the supplied image uri"
60
61
  ).option(
61
- "-pr, --provider <sourceProvider>",
62
+ "-pr --provider <sourceProvider>",
62
63
  "the url of the source repository for the supplied image uri"
63
64
  ).usage("<block-id> <image uri> [branch] [options]").addHelpText(
64
65
  "after",
65
66
  `
66
67
  Example call:
67
- > push block contensis-app ghcr.io/contensis/contensis-app/build-4359 master --release
68
+ > push block contensis-app ghcr.io/contensis/contensis-app/app:build-4359 master --release
68
69
  `
69
70
  ).action(async (blockId, imageUri, branch, opts) => {
70
71
  const cli = (0, import_ContensisCliService.cliCommand)(["push", "block", blockId], opts);
@@ -76,7 +77,7 @@ Example call:
76
77
  ...process.env
77
78
  };
78
79
  const blockRequest = (0, import_jsonpath_mapper.default)(mapSourceVars, {
79
- autoRelease: { $path: "release", $default: () => false },
80
+ release: { $path: "release", $default: () => false },
80
81
  id: ["blockId"],
81
82
  image: () => {
82
83
  const lastIndexOfColon = imageUri.lastIndexOf(":");
@@ -111,7 +112,10 @@ Example call:
111
112
  branch: ["branch", "CI_COMMIT_REF_NAME", "GITHUB_REF_NAME"],
112
113
  commit: {
113
114
  id: ["commitId", "CI_COMMIT_SHORT_SHA", "GITHUB_SHA"],
114
- message: ["commitMessage", "CI_COMMIT_MESSAGE"],
115
+ message: {
116
+ $path: ["commitMessage", "CI_COMMIT_MESSAGE"],
117
+ $formatting: (msg) => msg == null ? void 0 : msg.replace(/\\n/g, " ").replace(/\\n/g, " ").trim()
118
+ },
115
119
  dateTime: ["commitDatetime", "CI_COMMIT_TIMESTAMP"],
116
120
  authorEmail: ["authorEmail", "GITLAB_USER_EMAIL", "GITHUB_ACTOR"],
117
121
  committerEmail: [
@@ -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 .showHelpAfterError(true)\n .exitOverride();\n\n push\n .command('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/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: ['commitMessage', 'CI_COMMIT_MESSAGE'], // ${{ github.event.head_commit.message }}\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,mBAAmB,IAAI,EACvB,aAAa;AAEhB,OACG,QAAQ,OAAO,EACf,SAAS,cAAc,kCAAkC,EACzD;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC,SAAS,YAAY,8BAA8B,EACnD;AAAA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kB,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,CAAC,iBAAiB,mBAAmB;AAAA,UAC9C,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;",
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,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;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AClD,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
  }
@@ -24,18 +24,21 @@ 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
- const remove = new import_commander.Command().command("remove").showHelpAfterError(true).exitOverride();
30
- remove.command("project").argument("<projectId>", "the project id to delete").usage("<projectId>").action(async (projectId, opts) => {
30
+ const remove = new import_commander.Command().command("remove").description("remove command").addHelpText("after", `
31
+ `).showHelpAfterError(true).exitOverride();
32
+ remove.command("project").description("remove an entire project").argument("<projectId>", "the project id to delete").usage("<projectId>").addHelpText("after", `
33
+ `).action(async (projectId, opts) => {
31
34
  const project = await (0, import_ContensisCliService.cliCommand)(
32
35
  ["remove", "project", projectId],
33
36
  opts
34
37
  ).SetProject(projectId);
35
38
  if (project)
36
- await (0, import_shell.shell)().start();
39
+ await (0, import_shell.shell)().restart();
37
40
  });
38
- remove.command("key").argument("<id>", "the id of the API key to delete").usage("<id>").addHelpText(
41
+ remove.command("key").description("remove api key").argument("<id>", "the id of the API key to delete").usage("<id>").addHelpText(
39
42
  "after",
40
43
  `
41
44
  Example call:
@@ -44,7 +47,18 @@ Example call:
44
47
  ).action(async (id, opts) => {
45
48
  await (0, import_ContensisCliService.cliCommand)(["remove", "key", id], opts).RemoveApiKey(id);
46
49
  });
47
- remove.command("components").argument("<id...>", "the id(s) of the components to delete").addOption(import_globalOptions.commit).usage("<id> [--commit]").addHelpText(
50
+ remove.command("role").description("remove a role").argument('<"Role name" or id>', "the existing role name or id to delete").addHelpText(
51
+ "after",
52
+ `
53
+ Example call:
54
+ > remove role "My role"
55
+ `
56
+ ).action(async (roleNameOrId, opts) => {
57
+ await (0, import_ContensisCliService.cliCommand)(["remove", "role", roleNameOrId], opts).RemoveRole(
58
+ roleNameOrId
59
+ );
60
+ });
61
+ remove.command("components").description("delete components").argument("<id...>", "the id(s) of the components to delete").addOption(import_globalOptions.commit).usage("<id> [--commit]").addHelpText(
48
62
  "after",
49
63
  `
50
64
  Example call:
@@ -52,11 +66,11 @@ Example call:
52
66
  `
53
67
  ).action(async (id, opts) => {
54
68
  await (0, import_ContensisCliService.cliCommand)(
55
- ["remove", "components", id.join(", ")],
69
+ ["remove", "components", id.join(" ")],
56
70
  opts
57
71
  ).RemoveComponents(id, opts.commit);
58
72
  });
59
- remove.command("contenttypes").argument("<id...>", "the id(s) of the content types to delete").addOption(import_globalOptions.commit).usage("<id> [--commit]").addHelpText(
73
+ remove.command("contenttypes").description("delete content types").argument("<id...>", "the id(s) of the content types to delete").addOption(import_globalOptions.commit).usage("<id> [--commit]").addHelpText(
60
74
  "after",
61
75
  `
62
76
  Example call:
@@ -64,10 +78,39 @@ Example call:
64
78
  `
65
79
  ).action(async (id, opts) => {
66
80
  await (0, import_ContensisCliService.cliCommand)(
67
- ["remove", "contenttypes", id.join(", ")],
81
+ ["remove", "contenttypes", id.join(" ")],
68
82
  opts
69
83
  ).RemoveContentTypes(id, opts.commit);
70
84
  });
85
+ const removeEntries = remove.command("entries").description("delete entries").argument(
86
+ "[ids...]",
87
+ "the entry id(s) to delete ...or add *** if you wish to delete all entries in all content types"
88
+ ).addOption(import_globalOptions.zenql).addOption(import_globalOptions.commit).addHelpText(
89
+ "after",
90
+ `
91
+ Example call:
92
+ > remove entries a1c25591-8c9b-50e2-96d8-f6c774fcf023 8df914cc-1da1-59d6-86e0-8ea4ebd99aaa
93
+ > remove entries --zenql "sys.contentTypeId = test"
94
+ `
95
+ ).action(async (entryIds, opts) => {
96
+ const removeAll = (entryIds == null ? void 0 : entryIds[0]) === "***";
97
+ if ((entryIds == null ? void 0 : entryIds[0]) && !entryIds[0].replace(/\*/g, ""))
98
+ entryIds.pop();
99
+ const hasArgs = !!((entryIds == null ? void 0 : entryIds.length) || opts.zenql || removeAll);
100
+ if (!hasArgs) {
101
+ import_logger.Logger.help(
102
+ `Not enough arguments supplied
103
+
104
+ ${removeEntries.helpInformation()}`
105
+ );
106
+ } else {
107
+ await (0, import_ContensisCliService.cliCommand)(
108
+ ["remove", "entries", entryIds.join(" ")],
109
+ opts,
110
+ (0, import_globalOptions.mapContensisOpts)({ entryIds, ...opts })
111
+ ).RemoveEntries(opts.commit);
112
+ }
113
+ });
71
114
  return remove;
72
115
  };
73
116
  // 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 } from './globalOptions';\n\nexport const makeRemoveCommand = () => {\n const remove = new Command()\n .command('remove')\n .showHelpAfterError(true)\n .exitOverride();\n\n remove\n .command('project')\n .argument('<projectId>', 'the project id to delete')\n .usage('<projectId>')\n .action(async (projectId, opts) => {\n const project = await cliCommand(\n ['remove', 'project', projectId],\n opts\n ).SetProject(projectId);\n if (project) await shell().start();\n });\n remove\n .command('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 .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 .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 return remove;\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAwB;AACxB,iCAA2B;AAC3B,mBAAsB;AACtB,2BAAyC;AAElC,MAAM,oBAAoB,MAAM;AACrC,QAAM,SAAS,IAAI,yBAAQ,EACxB,QAAQ,QAAQ,EAChB,mBAAmB,IAAI,EACvB,aAAa;AAEhB,SACG,QAAQ,SAAS,EACjB,SAAS,eAAe,0BAA0B,EAClD,MAAM,aAAa,EACnB,OAAO,OAAO,WAAW,SAAS;AACjC,UAAM,UAAU,UAAM;AAAA,MACpB,CAAC,UAAU,WAAW,SAAS;AAAA,MAC/B;AAAA,IACF,EAAE,WAAW,SAAS;AACtB,QAAI;AAAS,gBAAM,oBAAM,EAAE,MAAM;AAAA,EACnC,CAAC;AACH,SACG,QAAQ,KAAK,EACb,SAAS,QAAQ,iCAAiC,EAClD,MAAM,MAAM,EACZ;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,EAIF,EACC,OAAO,OAAO,IAAI,SAAS;AAC1B,cAAM,uCAAW,CAAC,UAAU,OAAO,EAAE,GAAG,IAAI,EAAE,aAAa,EAAE;AAAA,EAC/D,CAAC;AAEH,SACG,QAAQ,YAAY,EACpB,SAAS,WAAW,uCAAuC,EAC3D,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,cAAc,GAAG,KAAK,IAAI,CAAC;AAAA,MACtC;AAAA,IACF,EAAE,iBAAiB,IAAI,KAAK,MAAM;AAAA,EACpC,CAAC;AAEH,SACG,QAAQ,cAAc,EACtB,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,IAAI,CAAC;AAAA,MACxC;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('role')\n .description('remove a role')\n .argument('<\"Role name\" or id>', 'the existing role name or id to delete')\n .addHelpText(\n 'after',\n `\nExample call:\n > remove role \"My role\"\\n`\n )\n .action(async (roleNameOrId: string, opts) => {\n await cliCommand(['remove', 'role', roleNameOrId], opts).RemoveRole(\n roleNameOrId\n );\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,uBA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