contensis-cli 1.0.0-beta.6 → 1.0.0-beta.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +760 -75
- package/dist/commands/connect.js +3 -3
- package/dist/commands/connect.js.map +2 -2
- package/dist/commands/create.js +30 -10
- package/dist/commands/create.js.map +2 -2
- package/dist/commands/diff.js +57 -0
- package/dist/commands/diff.js.map +7 -0
- package/dist/commands/get.js +61 -12
- package/dist/commands/get.js.map +2 -2
- package/dist/commands/globalOptions.js +22 -17
- package/dist/commands/globalOptions.js.map +2 -2
- package/dist/commands/import.js +46 -11
- package/dist/commands/import.js.map +2 -2
- package/dist/commands/index.js +9 -1
- package/dist/commands/index.js.map +2 -2
- package/dist/commands/list.js +19 -8
- package/dist/commands/list.js.map +2 -2
- package/dist/commands/login.js +3 -3
- package/dist/commands/login.js.map +2 -2
- package/dist/commands/push.js +8 -4
- package/dist/commands/push.js.map +2 -2
- package/dist/commands/release.js +47 -0
- package/dist/commands/release.js.map +7 -0
- package/dist/commands/remove.js +40 -8
- package/dist/commands/remove.js.map +2 -2
- package/dist/commands/set.js +53 -12
- package/dist/commands/set.js.map +2 -2
- package/dist/localisation/en-GB.js +100 -48
- package/dist/localisation/en-GB.js.map +2 -2
- package/dist/providers/CredentialProvider.js +36 -7
- package/dist/providers/CredentialProvider.js.map +3 -3
- package/dist/providers/SessionCacheProvider.js +21 -1
- package/dist/providers/SessionCacheProvider.js.map +2 -2
- package/dist/providers/file-provider.js +8 -4
- package/dist/providers/file-provider.js.map +3 -3
- package/dist/services/ContensisCliService.js +640 -375
- package/dist/services/ContensisCliService.js.map +3 -3
- package/dist/shell.js +27 -10
- package/dist/shell.js.map +3 -3
- package/dist/util/console.printer.js +171 -55
- package/dist/util/console.printer.js.map +2 -2
- package/dist/util/index.js +5 -2
- package/dist/util/index.js.map +3 -3
- package/dist/util/logger.js +47 -16
- package/dist/util/logger.js.map +2 -2
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +2 -2
- package/src/commands/connect.ts +3 -2
- package/src/commands/create.ts +37 -8
- package/src/commands/diff.ts +41 -0
- package/src/commands/get.ts +80 -5
- package/src/commands/globalOptions.ts +18 -17
- package/src/commands/import.ts +57 -7
- package/src/commands/index.ts +9 -1
- package/src/commands/list.ts +35 -9
- package/src/commands/login.ts +3 -2
- package/src/commands/push.ts +9 -2
- package/src/commands/release.ts +32 -0
- package/src/commands/remove.ts +50 -4
- package/src/commands/set.ts +65 -9
- package/src/localisation/en-GB.ts +146 -65
- package/src/providers/CredentialProvider.ts +39 -6
- package/src/providers/SessionCacheProvider.ts +29 -2
- package/src/providers/file-provider.ts +12 -4
- package/src/services/ContensisCliService.ts +789 -426
- package/src/shell.ts +31 -11
- package/src/util/console.printer.ts +240 -78
- package/src/util/index.ts +12 -6
- package/src/util/logger.ts +87 -18
- package/src/version.ts +1 -1
package/dist/commands/index.js
CHANGED
|
@@ -26,12 +26,14 @@ 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_diff = require("./diff");
|
|
29
30
|
var import_get = require("./get");
|
|
30
31
|
var import_globalOptions = require("./globalOptions");
|
|
31
32
|
var import_import = require("./import");
|
|
32
33
|
var import_list = require("./list");
|
|
33
34
|
var import_login = require("./login");
|
|
34
35
|
var import_push = require("./push");
|
|
36
|
+
var import_release = require("./release");
|
|
35
37
|
var import_remove = require("./remove");
|
|
36
38
|
var import_set = require("./set");
|
|
37
39
|
const commands = () => {
|
|
@@ -45,9 +47,12 @@ const commands = () => {
|
|
|
45
47
|
program
|
|
46
48
|
)
|
|
47
49
|
);
|
|
50
|
+
program.addCommand(
|
|
51
|
+
(0, import_globalOptions.addGlobalOptions)((0, import_create.makeCreateCommand)()).copyInheritedSettings(program)
|
|
52
|
+
);
|
|
48
53
|
program.addCommand(
|
|
49
54
|
(0, import_globalOptions.addGlobalOptions)(
|
|
50
|
-
(0, import_globalOptions.addImportOptions)((0,
|
|
55
|
+
(0, import_globalOptions.addGetEntryOptions)((0, import_globalOptions.addImportOptions)((0, import_diff.makeDiffCommand)()))
|
|
51
56
|
).copyInheritedSettings(program)
|
|
52
57
|
);
|
|
53
58
|
program.addCommand(
|
|
@@ -67,6 +72,9 @@ const commands = () => {
|
|
|
67
72
|
program.addCommand(
|
|
68
73
|
(0, import_globalOptions.addGlobalOptions)((0, import_push.makePushCommand)()).copyInheritedSettings(program)
|
|
69
74
|
);
|
|
75
|
+
program.addCommand(
|
|
76
|
+
(0, import_globalOptions.addGlobalOptions)((0, import_release.makeReleaseCommand)()).copyInheritedSettings(program)
|
|
77
|
+
);
|
|
70
78
|
program.addCommand(
|
|
71
79
|
(0, import_globalOptions.addGlobalOptions)((0, import_remove.makeRemoveCommand)()).copyInheritedSettings(program)
|
|
72
80
|
);
|
|
@@ -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(
|
|
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,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,EACb,mBAAmB,IAAI;AAE1B,UAAQ;AAAA,QACN,mDAAyB,mCAAmB,CAAC,EAAE;AAAA,MAC7C;AAAA,IACF;AAAA,EACF;AACA,UAAQ;AAAA,QACN;AAAA,UACE,2CAAiB,
|
|
4
|
+
"sourcesContent": ["import { Command } from 'commander';\nimport { Logger } from '~/util/logger';\nimport { LIB_VERSION } from '~/version';\nimport { makeConnectCommand } from './connect';\nimport { makeCreateCommand } from './create';\nimport { makeDiffCommand } from './diff';\nimport { makeGetCommand } from './get';\nimport {\n addAuthenticationOptions,\n addConnectOptions,\n addGetEntryOptions,\n addGlobalOptions,\n addImportOptions,\n} from './globalOptions';\nimport { makeImportCommand } from './import';\nimport { makeListCommand } from './list';\nimport { makeLoginCommand } from './login';\nimport { makePushCommand } from './push';\nimport { makeReleaseCommand } from './release';\nimport { makeRemoveCommand } from './remove';\nimport { makeSetCommand } from './set';\n\nconst commands = () => {\n const program = new Command()\n .name('contensis')\n .version(LIB_VERSION)\n .configureOutput({\n writeErr: str => {\n return str.toLowerCase().includes('error')\n ? Logger.error(`Command ${str}`)\n : str.trim() && Logger.help(str);\n },\n })\n .exitOverride()\n .showHelpAfterError(true);\n\n program.addCommand(\n addAuthenticationOptions(makeConnectCommand()).copyInheritedSettings(\n program\n )\n );\n program.addCommand(\n addGlobalOptions(makeCreateCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addGlobalOptions(\n addGetEntryOptions(addImportOptions(makeDiffCommand()))\n ).copyInheritedSettings(program)\n );\n program.addCommand(\n addGlobalOptions(makeGetCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addGlobalOptions(\n addGetEntryOptions(addImportOptions(makeImportCommand()))\n ).copyInheritedSettings(program)\n );\n program.addCommand(\n addGlobalOptions(makeListCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addConnectOptions(makeLoginCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addGlobalOptions(makePushCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addGlobalOptions(makeReleaseCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addGlobalOptions(makeRemoveCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addConnectOptions(makeSetCommand()).copyInheritedSettings(program)\n );\n\n return program;\n};\n\nexport default commands;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAwB;AACxB,oBAAuB;AACvB,qBAA4B;AAC5B,qBAAmC;AACnC,oBAAkC;AAClC,kBAAgC;AAChC,iBAA+B;AAC/B,2BAMO;AACP,oBAAkC;AAClC,kBAAgC;AAChC,mBAAiC;AACjC,kBAAgC;AAChC,qBAAmC;AACnC,oBAAkC;AAClC,iBAA+B;AAE/B,MAAM,WAAW,MAAM;AACrB,QAAM,UAAU,IAAI,yBAAQ,EACzB,KAAK,WAAW,EAChB,QAAQ,0BAAW,EACnB,gBAAgB;AAAA,IACf,UAAU,SAAO;AACf,aAAO,I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__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").
|
|
28
|
-
|
|
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,19 @@ 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").action(async (opts) => {
|
|
38
39
|
await (0, import_ContensisCliService.cliCommand)(["list", "projects"], opts).PrintProjects();
|
|
39
40
|
});
|
|
40
|
-
list.command("
|
|
41
|
+
list.command("models").description("print list of content models").addHelpText(
|
|
42
|
+
"after",
|
|
43
|
+
`
|
|
44
|
+
Example call:
|
|
45
|
+
> list models
|
|
46
|
+
`
|
|
47
|
+
).action(async (opts) => {
|
|
48
|
+
await (0, import_ContensisCliService.cliCommand)(["list", "models"], opts).PrintContentModels();
|
|
49
|
+
});
|
|
50
|
+
list.command("contenttypes").description("print list of content types").addHelpText(
|
|
41
51
|
"after",
|
|
42
52
|
`
|
|
43
53
|
Example call:
|
|
@@ -46,7 +56,7 @@ Example call:
|
|
|
46
56
|
).action(async (opts) => {
|
|
47
57
|
await (0, import_ContensisCliService.cliCommand)(["list", "contenttypes"], opts).PrintContentTypes();
|
|
48
58
|
});
|
|
49
|
-
list.command("components").addHelpText(
|
|
59
|
+
list.command("components").description("print list of components").addHelpText(
|
|
50
60
|
"after",
|
|
51
61
|
`
|
|
52
62
|
Example call:
|
|
@@ -55,7 +65,7 @@ Example call:
|
|
|
55
65
|
).action(async (opts) => {
|
|
56
66
|
await (0, import_ContensisCliService.cliCommand)(["list", "components"], opts).PrintComponents();
|
|
57
67
|
});
|
|
58
|
-
list.command("blocks").addHelpText(
|
|
68
|
+
list.command("blocks").description("print list of content blocks").addHelpText(
|
|
59
69
|
"after",
|
|
60
70
|
`
|
|
61
71
|
Example call:
|
|
@@ -64,7 +74,7 @@ Example call:
|
|
|
64
74
|
).action(async (opts) => {
|
|
65
75
|
await (0, import_ContensisCliService.cliCommand)(["list", "blocks"], opts).PrintBlocks();
|
|
66
76
|
});
|
|
67
|
-
list.command("keys").addHelpText(
|
|
77
|
+
list.command("keys").description("print list of API keys").addHelpText(
|
|
68
78
|
"after",
|
|
69
79
|
`
|
|
70
80
|
Example call:
|
|
@@ -73,7 +83,8 @@ Example call:
|
|
|
73
83
|
).action(async (opts) => {
|
|
74
84
|
await (0, import_ContensisCliService.cliCommand)(["list", "keys"], opts).PrintApiKeys();
|
|
75
85
|
});
|
|
76
|
-
list.command("webhooks").argument("[name]", "find webhooks matching the supplied name").option("-i --id <id...>", "the subscription id(s) to get").
|
|
86
|
+
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", `
|
|
87
|
+
`).action(async (name, { id, ...opts } = {}) => {
|
|
77
88
|
await (0, import_ContensisCliService.cliCommand)(["list", "webhooks"], opts).PrintWebhookSubscriptions(
|
|
78
89
|
id,
|
|
79
90
|
name
|
|
@@ -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\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAwB;AACxB,iCAA2B;
|
|
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 .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('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 id,\n name\n );\n });\n return list;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;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,EAChB,YAAY,8BAA8B,EAC1C;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;AAEH,OACG,QAAQ,MAAM,EACd,YAAY,wBAAwB,EACpC;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;AAEH,OACG,QAAQ,UAAU,EAClB,YAAY,wBAAwB,EACpC,SAAS,UAAU,0CAA0C,EAC7D,OAAO,mBAAmB,+BAA+B,EACzD,YAAY,SAAS;AAAA,CAAI,EACzB,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
6
|
"names": []
|
|
7
7
|
}
|
package/dist/commands/login.js
CHANGED
|
@@ -25,11 +25,11 @@ 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(
|
|
32
|
-
"-s --shared-secret <sharedSecret>",
|
|
32
|
+
"-s, --shared-secret <sharedSecret>",
|
|
33
33
|
"the shared secret to use when logging in with a client id"
|
|
34
34
|
).usage("<user/clientId> [password] [-s <sharedSecret>]").addHelpText(
|
|
35
35
|
"after",
|
|
@@ -45,7 +45,7 @@ Example call:
|
|
|
45
45
|
sharedSecret: opts.sharedSecret
|
|
46
46
|
});
|
|
47
47
|
if (token)
|
|
48
|
-
await (0, import_shell.shell)().
|
|
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().
|
|
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,
|
|
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
|
}
|
package/dist/commands/push.js
CHANGED
|
@@ -31,8 +31,9 @@ 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").
|
|
35
|
-
|
|
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(
|
|
@@ -64,7 +65,7 @@ const makePushCommand = () => {
|
|
|
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);
|
|
@@ -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:
|
|
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,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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,
|
|
4
|
+
"sourcesContent": ["import { Command } from 'commander';\nimport mapJson from 'jsonpath-mapper';\nimport { PushBlockParams } from 'migratortron';\nimport { cliCommand } from '~/services/ContensisCliService';\n\nexport const makePushCommand = () => {\n const push = new Command()\n .command('push')\n .description('push command')\n .addHelpText('after', `\\n`)\n .showHelpAfterError(true)\n .exitOverride();\n\n push\n .command('block')\n .description('push a block')\n .argument('<block-id>', 'the name of the block to push to')\n .argument(\n '<image uri:tag>',\n 'the uri and tag of the container image to push as a block (tag default: latest)'\n )\n .argument('[branch]', 'the branch we are pushing to')\n .option(\n '-r, --release',\n 'whether to release the pushed block version',\n false\n )\n .option(\n '-cid, --commit-id <commitId>',\n 'the id of the source git commit for the supplied image uri'\n )\n .option(\n '-cmsg, --commit-message <commitMessage>',\n 'the git commit message for the supplied commit id'\n )\n .option(\n '-cdt, --commit-datetime <commitDateTime>',\n 'the timestamp of the source git commit for the supplied image uri'\n )\n .option(\n '-author, --author-email <authorEmail>',\n 'the git email address of the author of the source git commit'\n )\n .option(\n '-committer, --committer-email <committerEmail>',\n 'the git email address of the commiter of the source git commit'\n )\n .option(\n '-repo, --repository-url <repositoryUrl>',\n 'the url of the source repository for the supplied image uri'\n )\n .option(\n '-pr, --provider <sourceProvider>',\n 'the url of the source repository for the supplied image uri'\n )\n .usage('<block-id> <image uri> [branch] [options]')\n .addHelpText(\n 'after',\n `\nExample call:\n > push block contensis-app ghcr.io/contensis/contensis-app/app:build-4359 master --release\\n`\n )\n .action(async (blockId: string, imageUri: string, branch: string, opts) => {\n const cli = cliCommand(['push', 'block', blockId], opts);\n const mapSourceVars = {\n blockId,\n imageUri,\n branch,\n ...opts,\n ...process.env,\n };\n\n const blockRequest = mapJson(mapSourceVars, {\n autoRelease: { $path: 'release', $default: () => false },\n id: ['blockId'],\n image: () => {\n const lastIndexOfColon = imageUri.lastIndexOf(':');\n return {\n uri: imageUri.slice(0, lastIndexOfColon),\n tag: imageUri.slice(lastIndexOfColon + 1) || 'latest',\n };\n },\n projectId: () => cli.env.currentProject || '',\n source: {\n provider: {\n $path: ['provider'],\n $return: (provider: string, { GITHUB_ACTIONS, GITLAB_CI }) => {\n if (provider) return provider;\n if (GITHUB_ACTIONS) return 'Github';\n else if (GITLAB_CI) return 'GitlabSelfHosted';\n },\n },\n repositoryUrl: {\n $path: ['repositoryUrl', 'CI_PROJECT_URL', 'GITHUB_REPOSITORY'],\n $formatting: (url: string, { GITHUB_ACTIONS }) => {\n if (GITHUB_ACTIONS) url = `https://github.com/${url}`;\n\n if (url && !url.endsWith('.git')) return `${url}.git`;\n return url;\n },\n },\n branch: ['branch', 'CI_COMMIT_REF_NAME', 'GITHUB_REF_NAME'],\n commit: {\n id: ['commitId', 'CI_COMMIT_SHORT_SHA', 'GITHUB_SHA'],\n message: {\n $path: ['commitMessage', 'CI_COMMIT_MESSAGE'], // ${{ github.event.head_commit.message }}\n $formatting: (msg?: string) =>\n msg?.replace(/\\\\n/g, ' ').replace(/\\\\n/g, ' ').trim(),\n },\n dateTime: ['commitDatetime', 'CI_COMMIT_TIMESTAMP'], // ${{ github.event.head_commit.timestamp }}\n authorEmail: ['authorEmail', 'GITLAB_USER_EMAIL', 'GITHUB_ACTOR'], // ${{ github.event.head_commit.author.email }}\n committerEmail: [\n 'committerEmail',\n 'GITLAB_USER_EMAIL',\n 'GITHUB_TRIGGERING_ACTOR',\n ], // ${{ github.event.head_commit.committer.email }}\n },\n },\n }) as PushBlockParams;\n\n await cli.PushBlock(blockRequest);\n\n // console.log(process.env);\n });\n\n return push;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAwB;AACxB,6BAAoB;AAEpB,iCAA2B;AAEpB,MAAM,kBAAkB,MAAM;AACnC,QAAM,OAAO,IAAI,yBAAQ,EACtB,QAAQ,MAAM,EACd,YAAY,cAAc,EAC1B,YAAY,SAAS;AAAA,CAAI,EACzB,mBAAmB,IAAI,EACvB,aAAa;AAEhB,OACG,QAAQ,OAAO,EACf,YAAY,cAAc,EAC1B,SAAS,cAAc,kCAAkC,EACzD;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC,SAAS,YAAY,8BAA8B,EACnD;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC,MAAM,2CAA2C,EACjD;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,EAGF,EACC,OAAO,OAAO,SAAiB,UAAkB,QAAgB,SAAS;AACzE,UAAM,UAAM,uCAAW,CAAC,QAAQ,SAAS,OAAO,GAAG,IAAI;AACvD,UAAM,gBAAg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,UAClD,aAAa,CAAC,eAAe,qBAAqB,cAAc;AAAA,UAChE,gBAAgB;AAAA,YACd;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF,CAAC;AAED,UAAM,IAAI,UAAU,YAAY;AAAA,EAGlC,CAAC;AAEH,SAAO;AACT;",
|
|
6
6
|
"names": ["mapJson"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
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 release_exports = {};
|
|
20
|
+
__export(release_exports, {
|
|
21
|
+
makeReleaseCommand: () => makeReleaseCommand
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(release_exports);
|
|
24
|
+
var import_commander = require("commander");
|
|
25
|
+
var import_ContensisCliService = require("../services/ContensisCliService");
|
|
26
|
+
const makeReleaseCommand = () => {
|
|
27
|
+
const release = new import_commander.Command().command("release").description("release command").addHelpText("after", `
|
|
28
|
+
`).showHelpAfterError(true).exitOverride();
|
|
29
|
+
release.command("block").description("release a block version").argument("<block-id>", "the name of the block to release").argument("<version>", "the block version to release").usage("<block-id> <version>").addHelpText(
|
|
30
|
+
"after",
|
|
31
|
+
`
|
|
32
|
+
Example call:
|
|
33
|
+
> release block contensis-app 3
|
|
34
|
+
`
|
|
35
|
+
).action(async (blockId, version, opts) => {
|
|
36
|
+
await (0, import_ContensisCliService.cliCommand)(["release", "block", blockId], opts).ReleaseBlock(
|
|
37
|
+
blockId,
|
|
38
|
+
version
|
|
39
|
+
);
|
|
40
|
+
});
|
|
41
|
+
return release;
|
|
42
|
+
};
|
|
43
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
+
0 && (module.exports = {
|
|
45
|
+
makeReleaseCommand
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=release.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/commands/release.ts"],
|
|
4
|
+
"sourcesContent": ["import { Command } from 'commander';\nimport { cliCommand } from '~/services/ContensisCliService';\n\nexport const makeReleaseCommand = () => {\n const release = new Command()\n .command('release')\n .description('release command')\n .addHelpText('after', `\\n`)\n .showHelpAfterError(true)\n .exitOverride();\n\n release\n .command('block')\n .description('release a block version')\n .argument('<block-id>', 'the name of the block to release')\n .argument('<version>', 'the block version to release')\n .usage('<block-id> <version>')\n .addHelpText(\n 'after',\n `\nExample call:\n > release block contensis-app 3\\n`\n )\n .action(async (blockId: string, version: string, opts) => {\n await cliCommand(['release', 'block', blockId], opts).ReleaseBlock(\n blockId,\n version\n );\n });\n\n return release;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAwB;AACxB,iCAA2B;AAEpB,MAAM,qBAAqB,MAAM;AACtC,QAAM,UAAU,IAAI,yBAAQ,EACzB,QAAQ,SAAS,EACjB,YAAY,iBAAiB,EAC7B,YAAY,SAAS;AAAA,CAAI,EACzB,mBAAmB,IAAI,EACvB,aAAa;AAEhB,UACG,QAAQ,OAAO,EACf,YAAY,yBAAyB,EACrC,SAAS,cAAc,kCAAkC,EACzD,SAAS,aAAa,8BAA8B,EACpD,MAAM,sBAAsB,EAC5B;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,EAGF,EACC,OAAO,OAAO,SAAiB,SAAiB,SAAS;AACxD,cAAM,uCAAW,CAAC,WAAW,SAAS,OAAO,GAAG,IAAI,EAAE;AAAA,MACpD;AAAA,MACA;AAAA,IACF;AAAA,EACF,CAAC;AAEH,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/commands/remove.js
CHANGED
|
@@ -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").
|
|
30
|
-
|
|
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)().
|
|
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,7 @@ 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("components").description("delete components").argument("<id...>", "the id(s) of the components to delete").addOption(import_globalOptions.commit).usage("<id> [--commit]").addHelpText(
|
|
48
51
|
"after",
|
|
49
52
|
`
|
|
50
53
|
Example call:
|
|
@@ -52,11 +55,11 @@ Example call:
|
|
|
52
55
|
`
|
|
53
56
|
).action(async (id, opts) => {
|
|
54
57
|
await (0, import_ContensisCliService.cliCommand)(
|
|
55
|
-
["remove", "components", id.join("
|
|
58
|
+
["remove", "components", id.join(" ")],
|
|
56
59
|
opts
|
|
57
60
|
).RemoveComponents(id, opts.commit);
|
|
58
61
|
});
|
|
59
|
-
remove.command("contenttypes").argument("<id...>", "the id(s) of the content types to delete").addOption(import_globalOptions.commit).usage("<id> [--commit]").addHelpText(
|
|
62
|
+
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
63
|
"after",
|
|
61
64
|
`
|
|
62
65
|
Example call:
|
|
@@ -64,10 +67,39 @@ Example call:
|
|
|
64
67
|
`
|
|
65
68
|
).action(async (id, opts) => {
|
|
66
69
|
await (0, import_ContensisCliService.cliCommand)(
|
|
67
|
-
["remove", "contenttypes", id.join("
|
|
70
|
+
["remove", "contenttypes", id.join(" ")],
|
|
68
71
|
opts
|
|
69
72
|
).RemoveContentTypes(id, opts.commit);
|
|
70
73
|
});
|
|
74
|
+
const removeEntries = remove.command("entries").description("delete entries").argument(
|
|
75
|
+
"[ids...]",
|
|
76
|
+
"the entry id(s) to delete ...or add *** if you wish to delete all entries in all content types"
|
|
77
|
+
).addOption(import_globalOptions.zenql).addOption(import_globalOptions.commit).addHelpText(
|
|
78
|
+
"after",
|
|
79
|
+
`
|
|
80
|
+
Example call:
|
|
81
|
+
> remove entries a1c25591-8c9b-50e2-96d8-f6c774fcf023 8df914cc-1da1-59d6-86e0-8ea4ebd99aaa
|
|
82
|
+
> remove entries --zenql "sys.contentTypeId = test"
|
|
83
|
+
`
|
|
84
|
+
).action(async (entryIds, opts) => {
|
|
85
|
+
const removeAll = (entryIds == null ? void 0 : entryIds[0]) === "***";
|
|
86
|
+
if ((entryIds == null ? void 0 : entryIds[0]) && !entryIds[0].replace(/\*/g, ""))
|
|
87
|
+
entryIds.pop();
|
|
88
|
+
const hasArgs = !!((entryIds == null ? void 0 : entryIds.length) || opts.zenql || removeAll);
|
|
89
|
+
if (!hasArgs) {
|
|
90
|
+
import_logger.Logger.help(
|
|
91
|
+
`Not enough arguments supplied
|
|
92
|
+
|
|
93
|
+
${removeEntries.helpInformation()}`
|
|
94
|
+
);
|
|
95
|
+
} else {
|
|
96
|
+
await (0, import_ContensisCliService.cliCommand)(
|
|
97
|
+
["remove", "entries", entryIds.join(" ")],
|
|
98
|
+
opts,
|
|
99
|
+
(0, import_globalOptions.mapContensisOpts)({ entryIds, ...opts })
|
|
100
|
+
).RemoveEntries(opts.commit);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
71
103
|
return remove;
|
|
72
104
|
};
|
|
73
105
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/commands/remove.ts"],
|
|
4
|
-
"sourcesContent": ["import { Command } from 'commander';\nimport { cliCommand } from '~/services/ContensisCliService';\nimport { shell } from '~/shell';\nimport { commit, mapContensisOpts } 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().
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAwB;AACxB,iCAA2B;AAC3B,mBAAsB;AACtB,
|
|
4
|
+
"sourcesContent": ["import { Command } from 'commander';\nimport { cliCommand } from '~/services/ContensisCliService';\nimport { shell } from '~/shell';\nimport { Logger } from '~/util/logger';\nimport { commit, mapContensisOpts, zenql } from './globalOptions';\n\nexport const makeRemoveCommand = () => {\n const remove = new Command()\n .command('remove')\n .description('remove command')\n .addHelpText('after', `\\n`)\n .showHelpAfterError(true)\n .exitOverride();\n\n remove\n .command('project')\n .description('remove an entire project')\n .argument('<projectId>', 'the project id to delete')\n .usage('<projectId>')\n .addHelpText('after', `\\n`)\n .action(async (projectId, opts) => {\n const project = await cliCommand(\n ['remove', 'project', projectId],\n opts\n ).SetProject(projectId);\n if (project) await shell().restart();\n });\n\n remove\n .command('key')\n .description('remove api key')\n .argument('<id>', 'the id of the API key to delete')\n .usage('<id>')\n .addHelpText(\n 'after',\n `\nExample call:\n > remove key 4ceb9575-28d3-4d5b-a77b-5e5221e603dd\n`\n )\n .action(async (id, opts) => {\n await cliCommand(['remove', 'key', id], opts).RemoveApiKey(id);\n });\n\n remove\n .command('components')\n .description('delete components')\n .argument('<id...>', 'the id(s) of the components to delete')\n .addOption(commit)\n .usage('<id> [--commit]')\n .addHelpText(\n 'after',\n `\nExample call:\n > remove components addressComponent\n`\n )\n .action(async (id: string[], opts) => {\n await cliCommand(\n ['remove', 'components', id.join(' ')],\n opts\n ).RemoveComponents(id, opts.commit);\n });\n\n remove\n .command('contenttypes')\n .description('delete content types')\n .argument('<id...>', 'the id(s) of the content types to delete')\n .addOption(commit)\n .usage('<id> [--commit]')\n .addHelpText(\n 'after',\n `\nExample call:\n > remove contenttypes blogPost\n`\n )\n .action(async (id: string[], opts) => {\n await cliCommand(\n ['remove', 'contenttypes', id.join(' ')],\n opts\n ).RemoveContentTypes(id, opts.commit);\n });\n\n const removeEntries = remove\n .command('entries')\n .description('delete entries')\n .argument(\n '[ids...]',\n 'the entry id(s) to delete ...or add *** if you wish to delete all entries in all content types'\n )\n .addOption(zenql)\n .addOption(commit)\n .addHelpText(\n 'after',\n `\nExample call:\n > remove entries a1c25591-8c9b-50e2-96d8-f6c774fcf023 8df914cc-1da1-59d6-86e0-8ea4ebd99aaa\n > remove entries --zenql \"sys.contentTypeId = test\"\n`\n )\n .action(async (entryIds: string[], opts) => {\n const removeAll = entryIds?.[0] === '***';\n\n // Remove all asterisks from args\n if (entryIds?.[0] && !entryIds[0].replace(/\\*/g, '')) entryIds.pop();\n\n const hasArgs = !!(entryIds?.length || opts.zenql || removeAll);\n if (!hasArgs) {\n Logger.help(\n `Not enough arguments supplied\\n\\n${removeEntries.helpInformation()}`\n );\n } else {\n await cliCommand(\n ['remove', 'entries', entryIds.join(' ')],\n opts,\n mapContensisOpts({ entryIds, ...opts })\n ).RemoveEntries(opts.commit);\n }\n });\n\n return remove;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAwB;AACxB,iCAA2B;AAC3B,mBAAsB;AACtB,oBAAuB;AACvB,2BAAgD;AAEzC,MAAM,oBAAoB,MAAM;AACrC,QAAM,SAAS,IAAI,yBAAQ,EACxB,QAAQ,QAAQ,EAChB,YAAY,gBAAgB,EAC5B,YAAY,SAAS;AAAA,CAAI,EACzB,mBAAmB,IAAI,EACvB,aAAa;AAEhB,SACG,QAAQ,SAAS,EACjB,YAAY,0BAA0B,EACtC,SAAS,eAAe,0BAA0B,EAClD,MAAM,aAAa,EACnB,YAAY,SAAS;AAAA,CAAI,EACzB,OAAO,OAAO,WAAW,SAAS;A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,EACf,UAAU,2BAAM,EAChB;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKF,EACC,OAAO,OAAO,UAAoB,SAAS;AAC1C,UAAM,aAAY,qCAAW,QAAO;AAGpC,SAAI,qCAAW,OAAM,CAAC,SAAS,GAAG,QAAQ,OAAO,EAAE;AAAG,eAAS,IAAI;AAEnE,UAAM,UAAU,CAAC,GAAE,qCAAU,WAAU,KAAK,SAAS;AACrD,QAAI,CAAC,SAAS;AACZ,2BAAO;AAAA,QACL;AAAA;AAAA,EAAoC,cAAc,gBAAgB;AAAA,MACpE;AAAA,IACF,OAAO;AACL,gBAAM;AAAA,QACJ,CAAC,UAAU,WAAW,SAAS,KAAK,GAAG,CAAC;AAAA,QACxC;AAAA,YACA,uCAAiB,EAAE,UAAU,GAAG,KAAK,CAAC;AAAA,MACxC,EAAE,cAAc,KAAK,MAAM;AAAA,IAC7B;AAAA,EACF,CAAC;AAEH,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/commands/set.js
CHANGED
|
@@ -25,26 +25,67 @@ var import_commander = require("commander");
|
|
|
25
25
|
var import_ContensisCliService = require("../services/ContensisCliService");
|
|
26
26
|
var import_shell = require("../shell");
|
|
27
27
|
const makeSetCommand = () => {
|
|
28
|
-
const set = new import_commander.Command().command("set").
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
const set = new import_commander.Command().command("set").description("set command").addHelpText("after", `
|
|
29
|
+
`).showHelpAfterError(true).exitOverride();
|
|
30
|
+
const project = set.command("project").description("set current working project").argument("<projectId>", "the project id to work with").usage("<projectId>").addHelpText(
|
|
31
|
+
"after",
|
|
32
|
+
`
|
|
33
|
+
Example call:
|
|
34
|
+
> set project website
|
|
35
|
+
`
|
|
36
|
+
).action(async (projectId) => {
|
|
37
|
+
const nextProjectId = (0, import_ContensisCliService.cliCommand)([
|
|
31
38
|
"set",
|
|
32
39
|
"project",
|
|
33
40
|
projectId
|
|
34
41
|
]).SetProject(projectId);
|
|
35
|
-
if (
|
|
36
|
-
await (0, import_shell.shell)().
|
|
42
|
+
if (nextProjectId)
|
|
43
|
+
await (0, import_shell.shell)().restart();
|
|
37
44
|
});
|
|
38
|
-
|
|
45
|
+
project.command("name").description("update project name").argument('<"Project name">', "update the current project name").usage('<"Project name">').addHelpText(
|
|
46
|
+
"after",
|
|
47
|
+
`
|
|
48
|
+
Example call:
|
|
49
|
+
> set project name "Project name"
|
|
50
|
+
`
|
|
51
|
+
).action(async (name, opts) => {
|
|
52
|
+
const success = await (0, import_ContensisCliService.cliCommand)(
|
|
53
|
+
["set", "project", "name"],
|
|
54
|
+
opts
|
|
55
|
+
).UpdateProject({
|
|
56
|
+
name
|
|
57
|
+
});
|
|
58
|
+
if (success)
|
|
59
|
+
await (0, import_shell.shell)().restart();
|
|
60
|
+
});
|
|
61
|
+
project.command("description").description("update project description").argument(
|
|
62
|
+
'<"Project description">',
|
|
63
|
+
"update the current project description"
|
|
64
|
+
).usage('<"Project description">').addHelpText(
|
|
65
|
+
"after",
|
|
66
|
+
`
|
|
67
|
+
Example call:
|
|
68
|
+
> set project description "Description of project"
|
|
69
|
+
`
|
|
70
|
+
).action(async (description, opts) => {
|
|
71
|
+
const success = await (0, import_ContensisCliService.cliCommand)(
|
|
72
|
+
["set", "project", "description"],
|
|
73
|
+
opts
|
|
74
|
+
).UpdateProject({
|
|
75
|
+
description
|
|
76
|
+
});
|
|
77
|
+
if (success)
|
|
78
|
+
await (0, import_shell.shell)().restart();
|
|
79
|
+
});
|
|
80
|
+
set.command("version").description("set content version").addArgument(
|
|
39
81
|
new import_commander.Argument("<versionStatus>", "content version status").choices(["latest", "published"]).default("latest")
|
|
40
|
-
).usage("<latest/published>").
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"version",
|
|
82
|
+
).usage("<latest/published>").addHelpText("after", `
|
|
83
|
+
`).action(async (versionStatus) => {
|
|
84
|
+
const success = (0, import_ContensisCliService.cliCommand)(["set", "version", versionStatus]).SetVersion(
|
|
44
85
|
versionStatus
|
|
45
|
-
|
|
86
|
+
);
|
|
46
87
|
if (success)
|
|
47
|
-
await (0, import_shell.shell)().
|
|
88
|
+
await (0, import_shell.shell)().restart();
|
|
48
89
|
});
|
|
49
90
|
return set;
|
|
50
91
|
};
|
package/dist/commands/set.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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
|
|
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;
|
|
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 .description('set command')\n .addHelpText('after', `\\n`)\n .showHelpAfterError(true)\n .exitOverride();\n\n const project = set\n .command('project')\n .description('set current working project')\n .argument('<projectId>', 'the project id to work with')\n .usage('<projectId>')\n .addHelpText(\n 'after',\n `\nExample call:\n > set project website\\n`\n )\n .action(async projectId => {\n const nextProjectId = cliCommand([\n 'set',\n 'project',\n projectId,\n ]).SetProject(projectId);\n if (nextProjectId) await shell().restart();\n });\n\n project\n .command('name')\n .description('update project name')\n .argument('<\"Project name\">', 'update the current project name')\n .usage('<\"Project name\">')\n .addHelpText(\n 'after',\n `\nExample call:\n > set project name \"Project name\"\\n`\n )\n .action(async (name: string, opts) => {\n const success = await cliCommand(\n ['set', 'project', 'name'],\n opts\n ).UpdateProject({\n name,\n });\n if (success) await shell().restart();\n });\n\n project\n .command('description')\n .description('update project description')\n .argument(\n '<\"Project description\">',\n 'update the current project description'\n )\n .usage('<\"Project description\">')\n .addHelpText(\n 'after',\n `\nExample call:\n > set project description \"Description of project\"\\n`\n )\n .action(async (description: string, opts) => {\n const success = await cliCommand(\n ['set', 'project', 'description'],\n opts\n ).UpdateProject({\n description,\n });\n if (success) await shell().restart();\n });\n\n set\n .command('version')\n .description('set content version')\n .addArgument(\n new Argument('<versionStatus>', 'content version status')\n .choices(['latest', 'published'])\n .default('latest')\n )\n .usage('<latest/published>')\n .addHelpText('after', `\\n`)\n .action(async versionStatus => {\n const success = cliCommand(['set', 'version', versionStatus]).SetVersion(\n versionStatus\n );\n if (success) await shell().restart();\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,YAAY,aAAa,EACzB,YAAY,SAAS;AAAA,CAAI,EACzB,mBAAmB,IAAI,EACvB,aAAa;AAEhB,QAAM,UAAU,IACb,QAAQ,SAAS,EACjB,YAAY,6BAA6B,EACzC,SAAS,eAAe,6BAA6B,EACrD,MAAM,aAAa,EACnB;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,EAGF,EACC,OAAO,OAAM,cAAa;AACzB,UAAM,oBAAgB,uCAAW;AAAA,MAC/B;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC,EAAE,WAAW,SAAS;AACvB,QAAI;AAAe,gBAAM,oBAAM,EAAE,QAAQ;AAAA,EAC3C,CAAC;AAEH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