contensis-cli 1.0.0-beta.5

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 (95) hide show
  1. package/.vscode/launch.json +15 -0
  2. package/README.md +631 -0
  3. package/cli.js +7 -0
  4. package/dist/commands/connect.js +44 -0
  5. package/dist/commands/connect.js.map +7 -0
  6. package/dist/commands/create.js +55 -0
  7. package/dist/commands/create.js.map +7 -0
  8. package/dist/commands/get.js +121 -0
  9. package/dist/commands/get.js.map +7 -0
  10. package/dist/commands/globalOptions.js +139 -0
  11. package/dist/commands/globalOptions.js.map +7 -0
  12. package/dist/commands/import.js +95 -0
  13. package/dist/commands/import.js.map +7 -0
  14. package/dist/commands/index.js +81 -0
  15. package/dist/commands/index.js.map +7 -0
  16. package/dist/commands/list.js +88 -0
  17. package/dist/commands/list.js.map +7 -0
  18. package/dist/commands/login.js +56 -0
  19. package/dist/commands/login.js.map +7 -0
  20. package/dist/commands/push.js +133 -0
  21. package/dist/commands/push.js.map +7 -0
  22. package/dist/commands/remove.js +77 -0
  23. package/dist/commands/remove.js.map +7 -0
  24. package/dist/commands/set.js +55 -0
  25. package/dist/commands/set.js.map +7 -0
  26. package/dist/index.js +32 -0
  27. package/dist/index.js.map +7 -0
  28. package/dist/localisation/en-GB.js +203 -0
  29. package/dist/localisation/en-GB.js.map +7 -0
  30. package/dist/models/AppError.d.js +2 -0
  31. package/dist/models/AppError.d.js.map +7 -0
  32. package/dist/models/Cache.d.js +2 -0
  33. package/dist/models/Cache.d.js.map +7 -0
  34. package/dist/models/JsModules.d.js +2 -0
  35. package/dist/models/JsModules.d.js.map +7 -0
  36. package/dist/providers/CredentialProvider.js +87 -0
  37. package/dist/providers/CredentialProvider.js.map +7 -0
  38. package/dist/providers/SessionCacheProvider.js +91 -0
  39. package/dist/providers/SessionCacheProvider.js.map +7 -0
  40. package/dist/providers/file-provider.js +113 -0
  41. package/dist/providers/file-provider.js.map +7 -0
  42. package/dist/services/ContensisAuthService.js +75 -0
  43. package/dist/services/ContensisAuthService.js.map +7 -0
  44. package/dist/services/ContensisCliService.js +1110 -0
  45. package/dist/services/ContensisCliService.js.map +7 -0
  46. package/dist/shell.js +261 -0
  47. package/dist/shell.js.map +7 -0
  48. package/dist/util/console.printer.js +194 -0
  49. package/dist/util/console.printer.js.map +7 -0
  50. package/dist/util/csv.formatter.js +50 -0
  51. package/dist/util/csv.formatter.js.map +7 -0
  52. package/dist/util/index.js +94 -0
  53. package/dist/util/index.js.map +7 -0
  54. package/dist/util/json.formatter.js +29 -0
  55. package/dist/util/json.formatter.js.map +7 -0
  56. package/dist/util/logger.js +184 -0
  57. package/dist/util/logger.js.map +7 -0
  58. package/dist/util/xml.formatter.js +51 -0
  59. package/dist/util/xml.formatter.js.map +7 -0
  60. package/dist/version.js +29 -0
  61. package/dist/version.js.map +7 -0
  62. package/esbuild.config.js +49 -0
  63. package/headless-setup.sh +7 -0
  64. package/package.json +59 -0
  65. package/patches/inquirer-command-prompt+0.1.0.patch +27 -0
  66. package/src/commands/connect.ts +23 -0
  67. package/src/commands/create.ts +41 -0
  68. package/src/commands/get.ts +139 -0
  69. package/src/commands/globalOptions.ts +126 -0
  70. package/src/commands/import.ts +89 -0
  71. package/src/commands/index.ts +72 -0
  72. package/src/commands/list.ts +90 -0
  73. package/src/commands/login.ts +33 -0
  74. package/src/commands/push.ts +120 -0
  75. package/src/commands/remove.ts +77 -0
  76. package/src/commands/set.ts +40 -0
  77. package/src/index.ts +19 -0
  78. package/src/localisation/en-GB.ts +211 -0
  79. package/src/models/AppError.d.ts +40 -0
  80. package/src/models/Cache.d.ts +25 -0
  81. package/src/models/JsModules.d.ts +1 -0
  82. package/src/providers/CredentialProvider.ts +88 -0
  83. package/src/providers/SessionCacheProvider.ts +74 -0
  84. package/src/providers/file-provider.ts +72 -0
  85. package/src/services/ContensisAuthService.ts +70 -0
  86. package/src/services/ContensisCliService.ts +1390 -0
  87. package/src/shell.ts +250 -0
  88. package/src/util/console.printer.ts +203 -0
  89. package/src/util/csv.formatter.ts +21 -0
  90. package/src/util/index.ts +67 -0
  91. package/src/util/json.formatter.ts +1 -0
  92. package/src/util/logger.ts +165 -0
  93. package/src/util/xml.formatter.ts +20 -0
  94. package/src/version.ts +1 -0
  95. package/tsconfig.json +22 -0
@@ -0,0 +1,88 @@
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 list_exports = {};
20
+ __export(list_exports, {
21
+ makeListCommand: () => makeListCommand
22
+ });
23
+ module.exports = __toCommonJS(list_exports);
24
+ var import_commander = require("commander");
25
+ var import_ContensisCliService = require("../services/ContensisCliService");
26
+ const makeListCommand = () => {
27
+ const list = new import_commander.Command().command("list").showHelpAfterError(true).exitOverride();
28
+ list.command("envs").addHelpText(
29
+ "after",
30
+ `
31
+ Example call:
32
+ > list envs
33
+ `
34
+ ).action((opts) => {
35
+ (0, import_ContensisCliService.cliCommand)(["list", "envs"], opts).PrintEnvironments();
36
+ });
37
+ list.command("projects").action(async (opts) => {
38
+ await (0, import_ContensisCliService.cliCommand)(["list", "projects"], opts).PrintProjects();
39
+ });
40
+ list.command("contenttypes").addHelpText(
41
+ "after",
42
+ `
43
+ Example call:
44
+ > list contenttypes -o ./output.json -f json
45
+ `
46
+ ).action(async (opts) => {
47
+ await (0, import_ContensisCliService.cliCommand)(["list", "contenttypes"], opts).PrintContentTypes();
48
+ });
49
+ list.command("components").addHelpText(
50
+ "after",
51
+ `
52
+ Example call:
53
+ > list components -o ./output.json -f json
54
+ `
55
+ ).action(async (opts) => {
56
+ await (0, import_ContensisCliService.cliCommand)(["list", "components"], opts).PrintComponents();
57
+ });
58
+ list.command("blocks").addHelpText(
59
+ "after",
60
+ `
61
+ Example call:
62
+ > list blocks
63
+ `
64
+ ).action(async (opts) => {
65
+ await (0, import_ContensisCliService.cliCommand)(["list", "blocks"], opts).PrintBlocks();
66
+ });
67
+ list.command("keys").addHelpText(
68
+ "after",
69
+ `
70
+ Example call:
71
+ > list keys
72
+ `
73
+ ).action(async (opts) => {
74
+ await (0, import_ContensisCliService.cliCommand)(["list", "keys"], opts).PrintApiKeys();
75
+ });
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 } = {}) => {
77
+ await (0, import_ContensisCliService.cliCommand)(["list", "webhooks"], opts).PrintWebhookSubscriptions(
78
+ id,
79
+ name
80
+ );
81
+ });
82
+ return list;
83
+ };
84
+ // Annotate the CommonJS export names for ESM import in node:
85
+ 0 && (module.exports = {
86
+ makeListCommand
87
+ });
88
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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;",
6
+ "names": []
7
+ }
@@ -0,0 +1,56 @@
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 login_exports = {};
20
+ __export(login_exports, {
21
+ makeLoginCommand: () => makeLoginCommand
22
+ });
23
+ module.exports = __toCommonJS(login_exports);
24
+ var import_commander = require("commander");
25
+ var import_ContensisCliService = require("../services/ContensisCliService");
26
+ var import_shell = require("../shell");
27
+ const makeLoginCommand = () => {
28
+ const login = new import_commander.Command().command("login").argument("<user/clientId>", "the username to login with").argument(
29
+ "[password]",
30
+ "the password to use to login with (optional/insecure)"
31
+ ).option(
32
+ "-s --shared-secret <sharedSecret>",
33
+ "the shared secret to use when logging in with a client id"
34
+ ).usage("<user/clientId> [password] [-s <sharedSecret>]").addHelpText(
35
+ "after",
36
+ `
37
+ Example call:
38
+ > login myuserid
39
+ -- or --
40
+ > login {clientId} -s {sharedSecret}
41
+ `
42
+ ).action(async (user, password, opts) => {
43
+ const token = await (0, import_ContensisCliService.cliCommand)(["login", user]).Login(user, {
44
+ password,
45
+ sharedSecret: opts.sharedSecret
46
+ });
47
+ if (token)
48
+ await (0, import_shell.shell)().start();
49
+ });
50
+ return login;
51
+ };
52
+ // Annotate the CommonJS export names for ESM import in node:
53
+ 0 && (module.exports = {
54
+ makeLoginCommand
55
+ });
56
+ //# sourceMappingURL=login.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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;",
6
+ "names": []
7
+ }
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
24
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
+ var push_exports = {};
26
+ __export(push_exports, {
27
+ makePushCommand: () => makePushCommand
28
+ });
29
+ module.exports = __toCommonJS(push_exports);
30
+ var import_commander = require("commander");
31
+ var import_jsonpath_mapper = __toESM(require("jsonpath-mapper"));
32
+ var import_ContensisCliService = require("../services/ContensisCliService");
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(
36
+ "<image uri:tag>",
37
+ "the uri and tag of the container image to push as a block (tag default: latest)"
38
+ ).argument("[branch]", "the branch we are pushing to").option(
39
+ "-r, --release",
40
+ "whether to release the pushed block version",
41
+ false
42
+ ).option(
43
+ "-cid, --commit-id <commitId>",
44
+ "the id of the source git commit for the supplied image uri"
45
+ ).option(
46
+ "-cmsg, --commit-message <commitMessage>",
47
+ "the git commit message for the supplied commit id"
48
+ ).option(
49
+ "-cdt, --commit-datetime <commitDateTime>",
50
+ "the timestamp of the source git commit for the supplied image uri"
51
+ ).option(
52
+ "-author, --author-email <authorEmail>",
53
+ "the git email address of the author of the source git commit"
54
+ ).option(
55
+ "-committer, --committer-email <committerEmail>",
56
+ "the git email address of the commiter of the source git commit"
57
+ ).option(
58
+ "-repo, --repository-url <repositoryUrl>",
59
+ "the url of the source repository for the supplied image uri"
60
+ ).option(
61
+ "-pr, --provider <sourceProvider>",
62
+ "the url of the source repository for the supplied image uri"
63
+ ).usage("<block-id> <image uri> [branch] [options]").addHelpText(
64
+ "after",
65
+ `
66
+ Example call:
67
+ > push block contensis-app ghcr.io/contensis/contensis-app/build-4359 master --release
68
+ `
69
+ ).action(async (blockId, imageUri, branch, opts) => {
70
+ const cli = (0, import_ContensisCliService.cliCommand)(["push", "block", blockId], opts);
71
+ const mapSourceVars = {
72
+ blockId,
73
+ imageUri,
74
+ branch,
75
+ ...opts,
76
+ ...process.env
77
+ };
78
+ const blockRequest = (0, import_jsonpath_mapper.default)(mapSourceVars, {
79
+ autoRelease: { $path: "release", $default: () => false },
80
+ id: ["blockId"],
81
+ image: () => {
82
+ const lastIndexOfColon = imageUri.lastIndexOf(":");
83
+ return {
84
+ uri: imageUri.slice(0, lastIndexOfColon),
85
+ tag: imageUri.slice(lastIndexOfColon + 1) || "latest"
86
+ };
87
+ },
88
+ projectId: () => cli.env.currentProject || "",
89
+ source: {
90
+ provider: {
91
+ $path: ["provider"],
92
+ $return: (provider, { GITHUB_ACTIONS, GITLAB_CI }) => {
93
+ if (provider)
94
+ return provider;
95
+ if (GITHUB_ACTIONS)
96
+ return "Github";
97
+ else if (GITLAB_CI)
98
+ return "GitlabSelfHosted";
99
+ }
100
+ },
101
+ repositoryUrl: {
102
+ $path: ["repositoryUrl", "CI_PROJECT_URL", "GITHUB_REPOSITORY"],
103
+ $formatting: (url, { GITHUB_ACTIONS }) => {
104
+ if (GITHUB_ACTIONS)
105
+ url = `https://github.com/${url}`;
106
+ if (url && !url.endsWith(".git"))
107
+ return `${url}.git`;
108
+ return url;
109
+ }
110
+ },
111
+ branch: ["branch", "CI_COMMIT_REF_NAME", "GITHUB_REF_NAME"],
112
+ commit: {
113
+ id: ["commitId", "CI_COMMIT_SHORT_SHA", "GITHUB_SHA"],
114
+ message: ["commitMessage", "CI_COMMIT_MESSAGE"],
115
+ dateTime: ["commitDatetime", "CI_COMMIT_TIMESTAMP"],
116
+ authorEmail: ["authorEmail", "GITLAB_USER_EMAIL", "GITHUB_ACTOR"],
117
+ committerEmail: [
118
+ "committerEmail",
119
+ "GITLAB_USER_EMAIL",
120
+ "GITHUB_TRIGGERING_ACTOR"
121
+ ]
122
+ }
123
+ }
124
+ });
125
+ await cli.PushBlock(blockRequest);
126
+ });
127
+ return push;
128
+ };
129
+ // Annotate the CommonJS export names for ESM import in node:
130
+ 0 && (module.exports = {
131
+ makePushCommand
132
+ });
133
+ //# sourceMappingURL=push.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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,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,SAAQ,eAAe;AAAA,MAC1C,aAAa,EAAE,OAAO,WAAW,UAAU,MAAM,MAAM;AAAA,MACvD,IAAI,CAAC,SAAS;AAAA,MACd,OAAO,MAAM;AACX,cAAM,mBAAmB,SAAS,YAAY,GAAG;AACjD,eAAO;AAAA,UACL,KAAK,SAAS,MAAM,GAAG,gBAAgB;AAAA,UACvC,KAAK,SAAS,MAAM,mBAAmB,CAAC,KAAK;AAAA,QAC/C;AAAA,MACF;AAAA,MACA,WAAW,MAAM,IAAI,IAAI,kBAAkB;AAAA,MAC3C,QAAQ;AAAA,QACN,UAAU;AAAA,UACR,OAAO,CAAC,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,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;",
6
+ "names": ["mapJson"]
7
+ }
@@ -0,0 +1,77 @@
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 remove_exports = {};
20
+ __export(remove_exports, {
21
+ makeRemoveCommand: () => makeRemoveCommand
22
+ });
23
+ module.exports = __toCommonJS(remove_exports);
24
+ var import_commander = require("commander");
25
+ var import_ContensisCliService = require("../services/ContensisCliService");
26
+ var import_shell = require("../shell");
27
+ var import_globalOptions = require("./globalOptions");
28
+ 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) => {
31
+ const project = await (0, import_ContensisCliService.cliCommand)(
32
+ ["remove", "project", projectId],
33
+ opts
34
+ ).SetProject(projectId);
35
+ if (project)
36
+ await (0, import_shell.shell)().start();
37
+ });
38
+ remove.command("key").argument("<id>", "the id of the API key to delete").usage("<id>").addHelpText(
39
+ "after",
40
+ `
41
+ Example call:
42
+ > remove key 4ceb9575-28d3-4d5b-a77b-5e5221e603dd
43
+ `
44
+ ).action(async (id, opts) => {
45
+ await (0, import_ContensisCliService.cliCommand)(["remove", "key", id], opts).RemoveApiKey(id);
46
+ });
47
+ remove.command("components").argument("<id...>", "the id(s) of the components to delete").addOption(import_globalOptions.commit).usage("<id> [--commit]").addHelpText(
48
+ "after",
49
+ `
50
+ Example call:
51
+ > remove components addressComponent
52
+ `
53
+ ).action(async (id, opts) => {
54
+ await (0, import_ContensisCliService.cliCommand)(
55
+ ["remove", "components", id.join(", ")],
56
+ opts
57
+ ).RemoveComponents(id, opts.commit);
58
+ });
59
+ remove.command("contenttypes").argument("<id...>", "the id(s) of the content types to delete").addOption(import_globalOptions.commit).usage("<id> [--commit]").addHelpText(
60
+ "after",
61
+ `
62
+ Example call:
63
+ > remove contenttypes blogPost
64
+ `
65
+ ).action(async (id, opts) => {
66
+ await (0, import_ContensisCliService.cliCommand)(
67
+ ["remove", "contenttypes", id.join(", ")],
68
+ opts
69
+ ).RemoveContentTypes(id, opts.commit);
70
+ });
71
+ return remove;
72
+ };
73
+ // Annotate the CommonJS export names for ESM import in node:
74
+ 0 && (module.exports = {
75
+ makeRemoveCommand
76
+ });
77
+ //# sourceMappingURL=remove.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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;",
6
+ "names": []
7
+ }
@@ -0,0 +1,55 @@
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 set_exports = {};
20
+ __export(set_exports, {
21
+ makeSetCommand: () => makeSetCommand
22
+ });
23
+ module.exports = __toCommonJS(set_exports);
24
+ var import_commander = require("commander");
25
+ var import_ContensisCliService = require("../services/ContensisCliService");
26
+ var import_shell = require("../shell");
27
+ const makeSetCommand = () => {
28
+ const set = new import_commander.Command().command("set").showHelpAfterError(true).exitOverride();
29
+ set.command("project").argument("<projectId>", "the project id to work with").usage("<projectId>").action(async (projectId) => {
30
+ const project = await (0, import_ContensisCliService.cliCommand)([
31
+ "set",
32
+ "project",
33
+ projectId
34
+ ]).SetProject(projectId);
35
+ if (project)
36
+ await (0, import_shell.shell)().start();
37
+ });
38
+ set.command("version").addArgument(
39
+ new import_commander.Argument("<versionStatus>", "content version status").choices(["latest", "published"]).default("latest")
40
+ ).usage("<latest/published>").action(async (versionStatus) => {
41
+ const success = await (0, import_ContensisCliService.cliCommand)([
42
+ "set",
43
+ "version",
44
+ versionStatus
45
+ ]).SetVersion(versionStatus);
46
+ if (success)
47
+ await (0, import_shell.shell)().start();
48
+ });
49
+ return set;
50
+ };
51
+ // Annotate the CommonJS export names for ESM import in node:
52
+ 0 && (module.exports = {
53
+ makeSetCommand
54
+ });
55
+ //# sourceMappingURL=set.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/commands/set.ts"],
4
+ "sourcesContent": ["import { Argument, Command } from 'commander';\nimport { cliCommand } from '~/services/ContensisCliService';\nimport { shell } from '~/shell';\n\nexport const makeSetCommand = () => {\n const set = new Command()\n .command('set')\n .showHelpAfterError(true)\n .exitOverride();\n set\n .command('project')\n .argument('<projectId>', 'the project id to work with')\n .usage('<projectId>')\n .action(async projectId => {\n const project = await cliCommand([\n 'set',\n 'project',\n projectId,\n ]).SetProject(projectId);\n if (project) await shell().start();\n });\n set\n .command('version')\n .addArgument(\n new Argument('<versionStatus>', 'content version status')\n .choices(['latest', 'published'])\n .default('latest')\n )\n .usage('<latest/published>')\n .action(async versionStatus => {\n const success = await cliCommand([\n 'set',\n 'version',\n versionStatus,\n ]).SetVersion(versionStatus);\n if (success) await shell().start();\n });\n\n return set;\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAkC;AAClC,iCAA2B;AAC3B,mBAAsB;AAEf,MAAM,iBAAiB,MAAM;AAClC,QAAM,MAAM,IAAI,yBAAQ,EACrB,QAAQ,KAAK,EACb,mBAAmB,IAAI,EACvB,aAAa;AAChB,MACG,QAAQ,SAAS,EACjB,SAAS,eAAe,6BAA6B,EACrD,MAAM,aAAa,EACnB,OAAO,OAAM,cAAa;AACzB,UAAM,UAAU,UAAM,uCAAW;AAAA,MAC/B;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC,EAAE,WAAW,SAAS;AACvB,QAAI;AAAS,gBAAM,oBAAM,EAAE,MAAM;AAAA,EACnC,CAAC;AACH,MACG,QAAQ,SAAS,EACjB;AAAA,IACC,IAAI,0BAAS,mBAAmB,wBAAwB,EACrD,QAAQ,CAAC,UAAU,WAAW,CAAC,EAC/B,QAAQ,QAAQ;AAAA,EACrB,EACC,MAAM,oBAAoB,EAC1B,OAAO,OAAM,kBAAiB;AAC7B,UAAM,UAAU,UAAM,uCAAW;AAAA,MAC/B;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC,EAAE,WAAW,aAAa;AAC3B,QAAI;AAAS,gBAAM,oBAAM,EAAE,MAAM;AAAA,EACnC,CAAC;AAEH,SAAO;AACT;",
6
+ "names": []
7
+ }
package/dist/index.js ADDED
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from))
11
+ if (!__hasOwnProp.call(to, key) && key !== except)
12
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ }
14
+ return to;
15
+ };
16
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
18
+ mod
19
+ ));
20
+ var import_commands = __toESM(require("./commands"));
21
+ var import_logger = require("./util/logger");
22
+ var import_ContensisCliService = __toESM(require("./services/ContensisCliService"));
23
+ const program = (0, import_commands.default)();
24
+ program.parseAsync(process.argv).then(() => {
25
+ import_ContensisCliService.default.quit();
26
+ }).catch((err) => {
27
+ var _a;
28
+ if (!((_a = err.name) == null ? void 0 : _a.includes("CommanderError")))
29
+ (0, import_logger.logError)(err, `CLI ${err.toString()}`);
30
+ import_ContensisCliService.default.quit(err);
31
+ });
32
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/index.ts"],
4
+ "sourcesContent": ["import commands from './commands';\nimport { logError } from './util/logger';\nimport ContensisCli from './services/ContensisCliService';\nimport { jsonFormatter } from './util/json.formatter';\n// new ContensisCli(process.argv).DoCommandTasksAsync();\n\n// This is the CLI part of the app\nconst program = commands();\nprogram\n .parseAsync(process.argv)\n .then(() => {\n ContensisCli.quit();\n })\n .catch((err: any) => {\n if (!err.name?.includes('CommanderError'))\n logError(err, `CLI ${err.toString()}`);\n ContensisCli.quit(err);\n });\n//.exitOverride(() => console.log('exit override!!!'));\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA,sBAAqB;AACrB,oBAAyB;AACzB,iCAAyB;AAKzB,MAAM,cAAU,gBAAAA,SAAS;AACzB,QACG,WAAW,QAAQ,IAAI,EACvB,KAAK,MAAM;AACV,6BAAAC,QAAa,KAAK;AACpB,CAAC,EACA,MAAM,CAAC,QAAa;AAbvB;AAcI,MAAI,GAAC,SAAI,SAAJ,mBAAU,SAAS;AACtB,gCAAS,KAAK,OAAO,IAAI,SAAS,GAAG;AACvC,6BAAAA,QAAa,KAAK,GAAG;AACvB,CAAC;",
6
+ "names": ["commands", "ContensisCli"]
7
+ }