contensis-cli 1.6.1-beta.2 → 1.6.1-beta.20
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/dist/index.js +58301 -11
- package/dist/index.js.map +4 -4
- package/dist/shell.js +58040 -52
- package/dist/shell.js.map +4 -4
- package/esbuild.config.js +8 -13
- package/package.json +3 -2
- package/src/commands/create.ts +48 -0
- package/src/commands/dev.ts +12 -2
- package/src/commands/globalOptions.ts +5 -3
- package/src/commands/import.ts +46 -5
- package/src/commands/push.ts +8 -1
- package/src/commands/set.ts +69 -1
- package/src/factories/RequestHandlerFactory.ts +19 -8
- package/src/localisation/en-GB.ts +22 -4
- package/src/mappers/DevRequests-to-RequestHanderCliArgs.ts +25 -17
- package/src/models/CliService.d.ts +5 -1
- package/src/providers/GitHubCliModuleProvider.ts +8 -8
- package/src/providers/HttpProvider.ts +2 -2
- package/src/providers/file-provider.ts +3 -0
- package/src/services/ContensisCliService.ts +265 -23
- package/src/services/ContensisDevService.ts +99 -35
- package/src/shell.ts +7 -1
- package/src/util/console.printer.ts +52 -0
- package/src/util/logger.ts +3 -4
- package/src/util/os.ts +5 -3
- package/src/version.ts +1 -1
- package/dist/commands/connect.js +0 -44
- package/dist/commands/connect.js.map +0 -7
- package/dist/commands/copy.js +0 -78
- package/dist/commands/copy.js.map +0 -7
- package/dist/commands/create.js +0 -170
- package/dist/commands/create.js.map +0 -7
- package/dist/commands/dev.js +0 -78
- package/dist/commands/dev.js.map +0 -7
- package/dist/commands/diff.js +0 -57
- package/dist/commands/diff.js.map +0 -7
- package/dist/commands/execute.js +0 -103
- package/dist/commands/execute.js.map +0 -7
- package/dist/commands/get.js +0 -330
- package/dist/commands/get.js.map +0 -7
- package/dist/commands/globalOptions.js +0 -252
- package/dist/commands/globalOptions.js.map +0 -7
- package/dist/commands/import.js +0 -229
- package/dist/commands/import.js.map +0 -7
- package/dist/commands/index.js +0 -107
- package/dist/commands/index.js.map +0 -7
- package/dist/commands/list.js +0 -195
- package/dist/commands/list.js.map +0 -7
- package/dist/commands/login.js +0 -55
- package/dist/commands/login.js.map +0 -7
- package/dist/commands/push.js +0 -229
- package/dist/commands/push.js.map +0 -7
- package/dist/commands/remove.js +0 -193
- package/dist/commands/remove.js.map +0 -7
- package/dist/commands/set.js +0 -180
- package/dist/commands/set.js.map +0 -7
- package/dist/commands/update.js +0 -70
- package/dist/commands/update.js.map +0 -7
- package/dist/factories/RequestHandlerFactory.js +0 -221
- package/dist/factories/RequestHandlerFactory.js.map +0 -7
- package/dist/localisation/en-GB.js +0 -552
- package/dist/localisation/en-GB.js.map +0 -7
- package/dist/mappers/ContensisCliService-to-RequestHanderSiteConfigYaml.js +0 -56
- package/dist/mappers/ContensisCliService-to-RequestHanderSiteConfigYaml.js.map +0 -7
- package/dist/mappers/DevInit-to-CIWorkflow.js +0 -409
- package/dist/mappers/DevInit-to-CIWorkflow.js.map +0 -7
- package/dist/mappers/DevInit-to-RolePermissions.js +0 -56
- package/dist/mappers/DevInit-to-RolePermissions.js.map +0 -7
- package/dist/mappers/DevRequests-to-RequestHanderCliArgs.js +0 -161
- package/dist/mappers/DevRequests-to-RequestHanderCliArgs.js.map +0 -7
- package/dist/mappers/MixedFileData.js +0 -83
- package/dist/mappers/MixedFileData.js.map +0 -7
- package/dist/models/AppError.d.js +0 -2
- package/dist/models/AppError.d.js.map +0 -7
- package/dist/models/Cache.d.js +0 -2
- package/dist/models/Cache.d.js.map +0 -7
- package/dist/models/CliService.d.js +0 -17
- package/dist/models/CliService.d.js.map +0 -7
- package/dist/models/DevService.d.js +0 -17
- package/dist/models/DevService.d.js.map +0 -7
- package/dist/models/JsModules.d.js +0 -2
- package/dist/models/JsModules.d.js.map +0 -7
- package/dist/providers/CredentialProvider.js +0 -126
- package/dist/providers/CredentialProvider.js.map +0 -7
- package/dist/providers/GitHubCliModuleProvider.js +0 -115
- package/dist/providers/GitHubCliModuleProvider.js.map +0 -7
- package/dist/providers/HttpProvider.js +0 -73
- package/dist/providers/HttpProvider.js.map +0 -7
- package/dist/providers/ManifestProvider.js +0 -50
- package/dist/providers/ManifestProvider.js.map +0 -7
- package/dist/providers/SessionCacheProvider.js +0 -132
- package/dist/providers/SessionCacheProvider.js.map +0 -7
- package/dist/providers/file-provider.js +0 -174
- package/dist/providers/file-provider.js.map +0 -7
- package/dist/services/ContensisAuthService.js +0 -88
- package/dist/services/ContensisAuthService.js.map +0 -7
- package/dist/services/ContensisCliService.js +0 -2598
- package/dist/services/ContensisCliService.js.map +0 -7
- package/dist/services/ContensisDevService.js +0 -387
- package/dist/services/ContensisDevService.js.map +0 -7
- package/dist/services/ContensisRoleService.js +0 -112
- package/dist/services/ContensisRoleService.js.map +0 -7
- package/dist/util/api-ids.js +0 -110
- package/dist/util/api-ids.js.map +0 -7
- package/dist/util/assert.js +0 -62
- package/dist/util/assert.js.map +0 -7
- package/dist/util/console.printer.js +0 -425
- package/dist/util/console.printer.js.map +0 -7
- package/dist/util/csv.formatter.js +0 -118
- package/dist/util/csv.formatter.js.map +0 -7
- package/dist/util/debug.js +0 -29
- package/dist/util/debug.js.map +0 -7
- package/dist/util/diff.js +0 -118
- package/dist/util/diff.js.map +0 -7
- package/dist/util/dotenv.js +0 -56
- package/dist/util/dotenv.js.map +0 -7
- package/dist/util/error.js +0 -36
- package/dist/util/error.js.map +0 -7
- package/dist/util/fetch.js +0 -69
- package/dist/util/fetch.js.map +0 -7
- package/dist/util/find.js +0 -39
- package/dist/util/find.js.map +0 -7
- package/dist/util/git.js +0 -145
- package/dist/util/git.js.map +0 -7
- package/dist/util/gitignore.js +0 -61
- package/dist/util/gitignore.js.map +0 -7
- package/dist/util/html.formatter.js +0 -70
- package/dist/util/html.formatter.js.map +0 -7
- package/dist/util/index.js +0 -68
- package/dist/util/index.js.map +0 -7
- package/dist/util/json.formatter.js +0 -66
- package/dist/util/json.formatter.js.map +0 -7
- package/dist/util/logger.js +0 -304
- package/dist/util/logger.js.map +0 -7
- package/dist/util/os.js +0 -46
- package/dist/util/os.js.map +0 -7
- package/dist/util/timers.js +0 -49
- package/dist/util/timers.js.map +0 -7
- package/dist/util/xml.formatter.js +0 -62
- package/dist/util/xml.formatter.js.map +0 -7
- package/dist/util/yaml.js +0 -44
- package/dist/util/yaml.js.map +0 -7
- package/dist/version.js +0 -29
- package/dist/version.js.map +0 -7
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
MigrateStatus,
|
|
13
13
|
NodesResult,
|
|
14
14
|
ProjectNodesToMigrate,
|
|
15
|
+
WebhooksResult,
|
|
15
16
|
} from 'migratortron';
|
|
16
17
|
import ContensisCli from '~/services/ContensisCliService';
|
|
17
18
|
|
|
@@ -374,6 +375,57 @@ export const printNodesMigrateResult = (
|
|
|
374
375
|
}
|
|
375
376
|
};
|
|
376
377
|
|
|
378
|
+
export const printWebhooksMigrateResult = (
|
|
379
|
+
service: ContensisCli,
|
|
380
|
+
migrateResult: WebhooksResult,
|
|
381
|
+
{
|
|
382
|
+
showDiff = false,
|
|
383
|
+
showAll = false,
|
|
384
|
+
showChanged = false,
|
|
385
|
+
}: {
|
|
386
|
+
showDiff?: boolean;
|
|
387
|
+
showAll?: boolean;
|
|
388
|
+
showChanged?: boolean;
|
|
389
|
+
} = {}
|
|
390
|
+
) => {
|
|
391
|
+
console.log(``);
|
|
392
|
+
const { log, messages } = service;
|
|
393
|
+
|
|
394
|
+
for (const [originalId, webhookStatus] of Object.entries(
|
|
395
|
+
migrateResult.webhooksToMigrate.webhookIds
|
|
396
|
+
)) {
|
|
397
|
+
if (
|
|
398
|
+
showAll ||
|
|
399
|
+
(showChanged &&
|
|
400
|
+
webhookStatus.status !== 'no change' &&
|
|
401
|
+
webhookStatus.status !== 'ignore')
|
|
402
|
+
) {
|
|
403
|
+
console.log(
|
|
404
|
+
log.infoText(
|
|
405
|
+
`${messages.migrate.status(webhookStatus.status)(`${webhookStatus.status}`)} ${originalId}${
|
|
406
|
+
webhookStatus.id !== originalId
|
|
407
|
+
? ` -> ${webhookStatus.id}\n `
|
|
408
|
+
: ' '
|
|
409
|
+
}`
|
|
410
|
+
) + `${webhookStatus.name}`
|
|
411
|
+
);
|
|
412
|
+
|
|
413
|
+
if (webhookStatus.error) log.error(webhookStatus.error);
|
|
414
|
+
if (webhookStatus.diff && showDiff) {
|
|
415
|
+
console.log(
|
|
416
|
+
` ${log.infoText(`diff: ${highlightDiffText(webhookStatus.diff)}`)}\n`
|
|
417
|
+
);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
if (migrateResult.errors?.length) {
|
|
423
|
+
console.log(
|
|
424
|
+
` - ${log.errorText(`errors: ${migrateResult.errors.length}`)}\n`
|
|
425
|
+
);
|
|
426
|
+
}
|
|
427
|
+
};
|
|
428
|
+
|
|
377
429
|
const highlightDiffText = (str: string) => {
|
|
378
430
|
const addedRegex = new RegExp(/<<\+>>(.*?)<<\/\+>>/, 'g');
|
|
379
431
|
const removedRegex = new RegExp(/<<->>(.*?)<<\/->>/, 'g');
|
package/src/util/logger.ts
CHANGED
|
@@ -322,11 +322,10 @@ export const logError: LogErrorFunc = (
|
|
|
322
322
|
export const addNewLines = (
|
|
323
323
|
message = '',
|
|
324
324
|
newLineSeparater = '\n',
|
|
325
|
-
atPosition = process.stdout.columns
|
|
325
|
+
atPosition = process.stdout.columns || 0
|
|
326
326
|
) => {
|
|
327
|
-
if (message === ''
|
|
328
|
-
|
|
329
|
-
}
|
|
327
|
+
if (message === '') return '';
|
|
328
|
+
if (atPosition === 0) return message;
|
|
330
329
|
|
|
331
330
|
let result = '';
|
|
332
331
|
let lengthCounter = 0;
|
package/src/util/os.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import os from 'os';
|
|
2
2
|
|
|
3
|
+
export const isWindows = () => os.platform() === 'win32';
|
|
4
|
+
|
|
3
5
|
export const winSlash = (str: string) =>
|
|
4
|
-
|
|
6
|
+
isWindows() ? str.replaceAll('/', '\\') : str;
|
|
5
7
|
|
|
6
8
|
export const linuxSlash = (str: string) =>
|
|
7
|
-
|
|
9
|
+
!isWindows() ? str.replaceAll('\\', '/') : str;
|
|
8
10
|
|
|
9
11
|
export const normaliseLineEndings = (
|
|
10
12
|
str: string,
|
|
11
|
-
lineEnd =
|
|
13
|
+
lineEnd = isWindows() ? '\r\n' : '\n'
|
|
12
14
|
) => str.replace(/\r?\n/g, lineEnd);
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const LIB_VERSION = "1.6.1-beta.
|
|
1
|
+
export const LIB_VERSION = "1.6.1-beta.20";
|
package/dist/commands/connect.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
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 connect_exports = {};
|
|
20
|
-
__export(connect_exports, {
|
|
21
|
-
makeConnectCommand: () => makeConnectCommand
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(connect_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 makeConnectCommand = () => {
|
|
29
|
-
const connect = new import_commander.Command().command("connect").description("connect to a Contensis instance").argument("<alias>", "the Contensis Cloud alias to connect with").addOption(import_globalOptions.project).usage("<alias>").addHelpText(
|
|
30
|
-
"after",
|
|
31
|
-
`
|
|
32
|
-
Example call:
|
|
33
|
-
> connect example-dev`
|
|
34
|
-
).action(async (alias, opts) => {
|
|
35
|
-
await (0, import_ContensisCliService.cliCommand)(["connect", alias], { ...opts, alias }).Connect(alias);
|
|
36
|
-
await (0, import_shell.shell)().restart();
|
|
37
|
-
});
|
|
38
|
-
return connect;
|
|
39
|
-
};
|
|
40
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
41
|
-
0 && (module.exports = {
|
|
42
|
-
makeConnectCommand
|
|
43
|
-
});
|
|
44
|
-
//# sourceMappingURL=connect.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/commands/connect.ts"],
|
|
4
|
-
"sourcesContent": ["import { Command } from 'commander';\nimport { cliCommand } from '~/services/ContensisCliService';\nimport { shell } from '~/shell';\nimport { project } from './globalOptions';\n\nexport const makeConnectCommand = () => {\n const connect = new Command()\n .command('connect')\n .description('connect to a Contensis instance')\n .argument('<alias>', 'the Contensis Cloud alias to connect with')\n .addOption(project)\n .usage('<alias>')\n .addHelpText(\n 'after',\n `\nExample call:\n > connect example-dev`\n )\n .action(async (alias, opts) => {\n await cliCommand(['connect', alias], { ...opts, alias }).Connect(alias);\n await shell().restart();\n });\n return connect;\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAwB;AACxB,iCAA2B;AAC3B,mBAAsB;AACtB,2BAAwB;AAEjB,MAAM,qBAAqB,MAAM;AACtC,QAAM,UAAU,IAAI,yBAAQ,EACzB,QAAQ,SAAS,EACjB,YAAY,iCAAiC,EAC7C,SAAS,WAAW,2CAA2C,EAC/D,UAAU,4BAAO,EACjB,MAAM,SAAS,EACf;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA,EAGF,EACC,OAAO,OAAO,OAAO,SAAS;AAC7B,cAAM,uCAAW,CAAC,WAAW,KAAK,GAAG,EAAE,GAAG,MAAM,MAAM,CAAC,EAAE,QAAQ,KAAK;AACtE,cAAM,oBAAM,EAAE,QAAQ;AAAA,EACxB,CAAC;AACH,SAAO;AACT;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/commands/copy.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
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 copy_exports = {};
|
|
20
|
-
__export(copy_exports, {
|
|
21
|
-
makeCopyCommand: () => makeCopyCommand
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(copy_exports);
|
|
24
|
-
var import_commander = require("commander");
|
|
25
|
-
var import_ContensisCliService = require("../services/ContensisCliService");
|
|
26
|
-
var import_globalOptions = require("./globalOptions");
|
|
27
|
-
const makeCopyCommand = () => {
|
|
28
|
-
const copy = new import_commander.Command().command("copy").description("copy command").addHelpText("after", `
|
|
29
|
-
`).showHelpAfterError(true).exitOverride();
|
|
30
|
-
copy.command("field").description("copy the contents of one content type field to another").argument(
|
|
31
|
-
"<contentTypeId>",
|
|
32
|
-
"the api id of the content type containing the fields to copy"
|
|
33
|
-
).argument("<fieldId>", "the id of the field to copy from").argument("<destinationId>", "the id of the field to copy to").option(
|
|
34
|
-
"-t --template <template>",
|
|
35
|
-
"apply a liquidjs template (surrounded by double quotes) to modify the copied field content"
|
|
36
|
-
).option(
|
|
37
|
-
"--root-uri <rootUri>",
|
|
38
|
-
"prefix your public uri to relative links in canvas content"
|
|
39
|
-
).addOption(import_globalOptions.commit).addOption(import_globalOptions.concurrency).addOption(import_globalOptions.ignoreErrors).addOption(import_globalOptions.outputDetail).addOption(import_globalOptions.noCache).addOption(import_globalOptions.noPublish).option(
|
|
40
|
-
"--search <phrase>",
|
|
41
|
-
"get entries with the search phrase, use quotes for multiple words"
|
|
42
|
-
).addOption(import_globalOptions.entryId).addOption(import_globalOptions.zenql).addOption(import_globalOptions.latest).addOption(import_globalOptions.versionStatus).addOption(import_globalOptions.saveEntries).usage("<contentTypeId> <fieldId> <destinationId> (all arguments required)").addHelpText(
|
|
43
|
-
"after",
|
|
44
|
-
`
|
|
45
|
-
Example call:
|
|
46
|
-
> copy field blog authorName contributors
|
|
47
|
-
|
|
48
|
-
> copy field blog description kicker --template "<h2>{{ source_value }}</h2>"
|
|
49
|
-
`
|
|
50
|
-
).action(
|
|
51
|
-
async (contentTypeId, fieldId, destinationId, opts) => {
|
|
52
|
-
const { template, ...restOpts } = opts;
|
|
53
|
-
const copyField = {
|
|
54
|
-
contentTypeId,
|
|
55
|
-
fieldId,
|
|
56
|
-
destinationId,
|
|
57
|
-
template,
|
|
58
|
-
rootUri: opts.rootUri
|
|
59
|
-
};
|
|
60
|
-
return await (0, import_ContensisCliService.cliCommand)(
|
|
61
|
-
["copy", "project", contentTypeId, fieldId, destinationId],
|
|
62
|
-
opts,
|
|
63
|
-
(0, import_globalOptions.mapContensisOpts)({ copyField, ...restOpts })
|
|
64
|
-
).CopyEntryField({
|
|
65
|
-
commit: opts.commit,
|
|
66
|
-
fromFile: opts.fromFile,
|
|
67
|
-
logOutput: opts.outputDetail,
|
|
68
|
-
saveEntries: opts.saveEntries
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
);
|
|
72
|
-
return copy;
|
|
73
|
-
};
|
|
74
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
75
|
-
0 && (module.exports = {
|
|
76
|
-
makeCopyCommand
|
|
77
|
-
});
|
|
78
|
-
//# sourceMappingURL=copy.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/commands/copy.ts"],
|
|
4
|
-
"sourcesContent": ["import { Command } from 'commander';\nimport { CopyField } from 'migratortron';\nimport { cliCommand } from '~/services/ContensisCliService';\nimport {\n commit,\n concurrency,\n entryId,\n ignoreErrors,\n latest,\n mapContensisOpts,\n noCache,\n noPublish,\n outputDetail,\n saveEntries,\n versionStatus,\n zenql,\n} from './globalOptions';\n\nexport const makeCopyCommand = () => {\n const copy = new Command()\n .command('copy')\n .description('copy command')\n .addHelpText('after', `\\n`)\n .showHelpAfterError(true)\n .exitOverride();\n\n copy\n .command('field')\n .description('copy the contents of one content type field to another')\n .argument(\n '<contentTypeId>',\n 'the api id of the content type containing the fields to copy'\n )\n .argument('<fieldId>', 'the id of the field to copy from')\n .argument('<destinationId>', 'the id of the field to copy to')\n .option(\n '-t --template <template>',\n 'apply a liquidjs template (surrounded by double quotes) to modify the copied field content'\n )\n .option(\n '--root-uri <rootUri>',\n 'prefix your public uri to relative links in canvas content'\n )\n .addOption(commit)\n .addOption(concurrency)\n .addOption(ignoreErrors)\n .addOption(outputDetail)\n .addOption(noCache)\n .addOption(noPublish)\n .option(\n '--search <phrase>',\n 'get entries with the search phrase, use quotes for multiple words'\n )\n .addOption(entryId)\n .addOption(zenql)\n .addOption(latest)\n .addOption(versionStatus)\n .addOption(saveEntries)\n .usage('<contentTypeId> <fieldId> <destinationId> (all arguments required)')\n .addHelpText(\n 'after',\n `\nExample call:\n > copy field blog authorName contributors\\n\n > copy field blog description kicker --template \"<h2>{{ source_value }}</h2>\"\\n`\n )\n .action(\n async (\n contentTypeId: string,\n fieldId: string,\n destinationId: string,\n opts: any\n ) => {\n const { template, ...restOpts } = opts;\n const copyField: CopyField = {\n contentTypeId,\n fieldId,\n destinationId,\n template,\n rootUri: opts.rootUri,\n };\n\n return await cliCommand(\n ['copy', 'project', contentTypeId, fieldId, destinationId],\n opts,\n mapContensisOpts({ copyField, ...restOpts })\n ).CopyEntryField({\n commit: opts.commit,\n fromFile: opts.fromFile,\n logOutput: opts.outputDetail,\n saveEntries: opts.saveEntries,\n });\n }\n );\n\n return copy;\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAwB;AAExB,iCAA2B;AAC3B,2BAaO;AAEA,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,wDAAwD,EACpE;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC,SAAS,aAAa,kCAAkC,EACxD,SAAS,mBAAmB,gCAAgC,EAC5D;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC,UAAU,2BAAM,EAChB,UAAU,gCAAW,EACrB,UAAU,iCAAY,EACtB,UAAU,iCAAY,EACtB,UAAU,4BAAO,EACjB,UAAU,8BAAS,EACnB;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC,UAAU,4BAAO,EACjB,UAAU,0BAAK,EACf,UAAU,2BAAM,EAChB,UAAU,kCAAa,EACvB,UAAU,gCAAW,EACrB,MAAM,oEAAoE,EAC1E;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAIF,EACC;AAAA,IACC,OACE,eACA,SACA,eACA,SACG;AACH,YAAM,EAAE,UAAU,GAAG,SAAS,IAAI;AAClC,YAAM,YAAuB;AAAA,QAC3B;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,SAAS,KAAK;AAAA,MAChB;AAEA,aAAO,UAAM;AAAA,QACX,CAAC,QAAQ,WAAW,eAAe,SAAS,aAAa;AAAA,QACzD;AAAA,YACA,uCAAiB,EAAE,WAAW,GAAG,SAAS,CAAC;AAAA,MAC7C,EAAE,eAAe;AAAA,QACf,QAAQ,KAAK;AAAA,QACb,UAAU,KAAK;AAAA,QACf,WAAW,KAAK;AAAA,QAChB,aAAa,KAAK;AAAA,MACpB,CAAC;AAAA,IACH;AAAA,EACF;AAEF,SAAO;AACT;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/commands/create.js
DELETED
|
@@ -1,170 +0,0 @@
|
|
|
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 create_exports = {};
|
|
20
|
-
__export(create_exports, {
|
|
21
|
-
makeCreateCommand: () => makeCreateCommand
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(create_exports);
|
|
24
|
-
var import_commander = require("commander");
|
|
25
|
-
var import_globalOptions = require("./globalOptions");
|
|
26
|
-
var import_ContensisCliService = require("../services/ContensisCliService");
|
|
27
|
-
var import_shell = require("../shell");
|
|
28
|
-
var import_api_ids = require("../util/api-ids");
|
|
29
|
-
const makeCreateCommand = () => {
|
|
30
|
-
const create = new import_commander.Command().command("create").description("create command").addHelpText("after", `
|
|
31
|
-
`).showHelpAfterError(true).enablePositionalOptions().exitOverride();
|
|
32
|
-
create.command("project").description("create a new project").argument("<projectId>", "the id of the project to create").argument("<name>", "the name of the project to create").argument("[description]", "optional description of the project").option(
|
|
33
|
-
"-l --language <language>",
|
|
34
|
-
"the default language of the project to create",
|
|
35
|
-
"en-GB"
|
|
36
|
-
).option(
|
|
37
|
-
"-langs --supported-languages <langs...>",
|
|
38
|
-
"space separated list of other supported languages"
|
|
39
|
-
).usage(
|
|
40
|
-
'projectId "Project name" ["Description of project"] --language en-GB --supported-languages es-ES de-DE nl-NL'
|
|
41
|
-
).addHelpText("after", `
|
|
42
|
-
`).action(
|
|
43
|
-
async (projectId, name, description = "", opts) => {
|
|
44
|
-
const createProject = {
|
|
45
|
-
id: projectId,
|
|
46
|
-
name,
|
|
47
|
-
description,
|
|
48
|
-
primaryLanguage: opts.language,
|
|
49
|
-
supportedLanguages: opts.supportedLanguages || [],
|
|
50
|
-
deliverySysExclusions: []
|
|
51
|
-
};
|
|
52
|
-
const project = await (0, import_ContensisCliService.cliCommand)(
|
|
53
|
-
["create", "project", projectId],
|
|
54
|
-
opts
|
|
55
|
-
).CreateProject(createProject);
|
|
56
|
-
if (project) await (0, import_shell.shell)().restart();
|
|
57
|
-
}
|
|
58
|
-
);
|
|
59
|
-
create.command("key").description("create a new api key").argument('<"key name">', "the name of the key to create").argument('["description"]', "provide a description for the key (optional)").usage('<"key name"> ["description"] (both args in "double quotes")').addHelpText(
|
|
60
|
-
"after",
|
|
61
|
-
`
|
|
62
|
-
Example call:
|
|
63
|
-
> create key "my new key" "Created key for demonstration"
|
|
64
|
-
`
|
|
65
|
-
).action(async (name, description, opts) => {
|
|
66
|
-
await (0, import_ContensisCliService.cliCommand)(["create", "key", name], opts).CreateApiKey(
|
|
67
|
-
name,
|
|
68
|
-
description
|
|
69
|
-
);
|
|
70
|
-
});
|
|
71
|
-
create.command("role").description("create a new role").argument('<"Role name">', "the name of the role to create").argument('["Role description">', "the description of the role").option("--disabled", "do not enable the created role", false).addHelpText(
|
|
72
|
-
"after",
|
|
73
|
-
`
|
|
74
|
-
Example call:
|
|
75
|
-
> create role "My role" "This role is for testing" --disabled
|
|
76
|
-
`
|
|
77
|
-
).action(async (roleName, description, opts) => {
|
|
78
|
-
await (0, import_ContensisCliService.cliCommand)(["create", "role", roleName], opts).CreateRole({
|
|
79
|
-
name: roleName,
|
|
80
|
-
description,
|
|
81
|
-
enabled: !opts.disabled,
|
|
82
|
-
assignments: { apiKeys: [], groups: [], users: [] },
|
|
83
|
-
permissions: { contentTypes: [], entries: [] }
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
create.command("taggroup").description("create a new tag group").argument("<groupId>", "the API id of the tag group to create").argument('<"Name">', "the name of the tag group to create").argument('["Description"]', "a description for the tag group").option(
|
|
87
|
-
"--tags <tagNames...>",
|
|
88
|
-
"a list of tag names to create under the new tag group"
|
|
89
|
-
).addOption(import_globalOptions.commit).addHelpText(
|
|
90
|
-
"after",
|
|
91
|
-
`
|
|
92
|
-
Example call:
|
|
93
|
-
> create taggroup example "Example tags" "This group is a test"
|
|
94
|
-
> create taggroup topics "Topics" --tags Books Faces History Places Spelling
|
|
95
|
-
`
|
|
96
|
-
).action(
|
|
97
|
-
async (groupId, name, description, opts) => {
|
|
98
|
-
var _a;
|
|
99
|
-
const tagGroup = {
|
|
100
|
-
id: groupId,
|
|
101
|
-
name,
|
|
102
|
-
description
|
|
103
|
-
};
|
|
104
|
-
await (0, import_ContensisCliService.cliCommand)(
|
|
105
|
-
["create", "taggroup", groupId, name],
|
|
106
|
-
opts
|
|
107
|
-
).ImportTagGroups({
|
|
108
|
-
commit: opts.commit,
|
|
109
|
-
data: [tagGroup],
|
|
110
|
-
tags: (_a = opts.tags) == null ? void 0 : _a.map((label) => ({
|
|
111
|
-
groupId,
|
|
112
|
-
label: { "en-GB": label },
|
|
113
|
-
value: (0, import_api_ids.toApiId)(label, "camelCase", true)
|
|
114
|
-
}))
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
);
|
|
118
|
-
const tags = create.command("tags").description("create new tags in a tag group").argument('<"Label"...>', "create tag(s) with label(s)").passThroughOptions().option("-in --group <groupId>", "create tags in this tag group").addOption(import_globalOptions.commit).addHelpText(
|
|
119
|
-
"after",
|
|
120
|
-
`
|
|
121
|
-
Example call:
|
|
122
|
-
> create tags "Test tag" --group example
|
|
123
|
-
> create tags Books Faces History Places Spelling -in topics
|
|
124
|
-
`
|
|
125
|
-
).action(async (tagLabels, opts) => {
|
|
126
|
-
var _a;
|
|
127
|
-
const groupId = opts.group;
|
|
128
|
-
const cli = (0, import_ContensisCliService.cliCommand)(["create", "tags", ...tagLabels], opts);
|
|
129
|
-
const language = ((_a = cli.env.projects.find((p) => p.id === cli.env.currentProject)) == null ? void 0 : _a.primaryLanguage) || "en-GB";
|
|
130
|
-
await cli.ImportTags({
|
|
131
|
-
commit: opts.commit,
|
|
132
|
-
data: tagLabels.map((label) => ({
|
|
133
|
-
groupId,
|
|
134
|
-
label: { [language]: label },
|
|
135
|
-
value: (0, import_api_ids.toApiId)(label, "camelCase", true)
|
|
136
|
-
}))
|
|
137
|
-
});
|
|
138
|
-
});
|
|
139
|
-
tags.command("in").description("create new tags in a tag group").argument("<groupId>", "create tag(s) in this tag group").argument('<"Label"...>', "create tag(s) with label(s)").addOption(import_globalOptions.commit).addHelpText(
|
|
140
|
-
"after",
|
|
141
|
-
`
|
|
142
|
-
Example call:
|
|
143
|
-
> create tags in example "Tag 1" "Second Tag" Third
|
|
144
|
-
> create tags ih topics Books Faces History Places Spelling
|
|
145
|
-
`
|
|
146
|
-
).action(async (groupId, tagLabels, opts, cmd) => {
|
|
147
|
-
var _a;
|
|
148
|
-
const parentOptions = cmd.optsWithGlobals();
|
|
149
|
-
const cli = (0, import_ContensisCliService.cliCommand)(["create", "tags", "in", groupId, ...tagLabels], {
|
|
150
|
-
...opts,
|
|
151
|
-
...parentOptions
|
|
152
|
-
});
|
|
153
|
-
const language = ((_a = cli.env.projects.find((p) => p.id === cli.env.currentProject)) == null ? void 0 : _a.primaryLanguage) || "en-GB";
|
|
154
|
-
await cli.ImportTags({
|
|
155
|
-
commit: parentOptions.commit,
|
|
156
|
-
data: tagLabels.map((label) => ({
|
|
157
|
-
groupId,
|
|
158
|
-
label: { [language]: label },
|
|
159
|
-
value: (0, import_api_ids.toApiId)(label, "camelCase", true)
|
|
160
|
-
}))
|
|
161
|
-
});
|
|
162
|
-
});
|
|
163
|
-
(0, import_globalOptions.addGlobalOptions)(tags);
|
|
164
|
-
return create;
|
|
165
|
-
};
|
|
166
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
167
|
-
0 && (module.exports = {
|
|
168
|
-
makeCreateCommand
|
|
169
|
-
});
|
|
170
|
-
//# sourceMappingURL=create.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/commands/create.ts"],
|
|
4
|
-
"sourcesContent": ["import { Command } from 'commander';\nimport { Project } from 'contensis-core-api';\nimport { addGlobalOptions, commit } from './globalOptions';\nimport { cliCommand } from '~/services/ContensisCliService';\nimport { shell } from '~/shell';\nimport { toApiId } from '~/util/api-ids';\n\nexport const makeCreateCommand = () => {\n const create = new Command()\n .command('create')\n .description('create command')\n .addHelpText('after', `\\n`)\n .showHelpAfterError(true)\n .enablePositionalOptions()\n .exitOverride();\n\n create\n .command('project')\n .description('create a new project')\n .argument('<projectId>', 'the id of the project to create')\n .argument('<name>', 'the name of the project to create')\n .argument('[description]', 'optional description of the project')\n .option(\n '-l --language <language>',\n 'the default language of the project to create',\n 'en-GB'\n )\n .option(\n '-langs --supported-languages <langs...>',\n 'space separated list of other supported languages'\n )\n .usage(\n 'projectId \"Project name\" [\"Description of project\"] --language en-GB --supported-languages es-ES de-DE nl-NL'\n )\n .addHelpText('after', `\\n`)\n .action(\n async (projectId: string, name: string, description = '', opts: any) => {\n const createProject: Project = {\n id: projectId,\n name,\n description,\n primaryLanguage: opts.language,\n supportedLanguages: opts.supportedLanguages || [],\n deliverySysExclusions: [],\n };\n\n const project = await cliCommand(\n ['create', 'project', projectId],\n opts\n ).CreateProject(createProject);\n if (project) await shell().restart();\n }\n );\n\n create\n .command('key')\n .description('create a new api key')\n .argument('<\"key name\">', 'the name of the key to create')\n .argument('[\"description\"]', 'provide a description for the key (optional)')\n .usage('<\"key name\"> [\"description\"] (both args in \"double quotes\")')\n .addHelpText(\n 'after',\n `\nExample call:\n > create key \"my new key\" \"Created key for demonstration\"\\n`\n )\n .action(async (name: string, description: string, opts: any) => {\n await cliCommand(['create', 'key', name], opts).CreateApiKey(\n name,\n description\n );\n });\n\n create\n .command('role')\n .description('create a new role')\n .argument('<\"Role name\">', 'the name of the role to create')\n .argument('[\"Role description\">', 'the description of the role')\n .option('--disabled', 'do not enable the created role', false)\n .addHelpText(\n 'after',\n `\nExample call:\n > create role \"My role\" \"This role is for testing\" --disabled \\n`\n )\n .action(async (roleName: string, description: string, opts) => {\n await cliCommand(['create', 'role', roleName], opts).CreateRole({\n name: roleName,\n description,\n enabled: !opts.disabled,\n assignments: { apiKeys: [], groups: [], users: [] },\n permissions: { contentTypes: [], entries: [] },\n });\n });\n\n create\n .command('taggroup')\n .description('create a new tag group')\n .argument('<groupId>', 'the API id of the tag group to create')\n .argument('<\"Name\">', 'the name of the tag group to create')\n .argument('[\"Description\"]', 'a description for the tag group')\n .option(\n '--tags <tagNames...>',\n 'a list of tag names to create under the new tag group'\n )\n .addOption(commit)\n .addHelpText(\n 'after',\n `\n Example call:\n > create taggroup example \"Example tags\" \"This group is a test\" \n > create taggroup topics \"Topics\" --tags Books Faces History Places Spelling \\n`\n )\n .action(\n async (groupId: string, name: string, description: string, opts) => {\n const tagGroup = {\n id: groupId,\n name,\n description,\n };\n\n await cliCommand(\n ['create', 'taggroup', groupId, name],\n opts\n ).ImportTagGroups({\n commit: opts.commit,\n data: [tagGroup],\n tags: opts.tags?.map((label: string) => ({\n groupId,\n label: { 'en-GB': label },\n value: toApiId(label, 'camelCase', true),\n })),\n });\n }\n );\n\n const tags = create\n .command('tags')\n .description('create new tags in a tag group')\n .argument('<\"Label\"...>', 'create tag(s) with label(s)')\n .passThroughOptions()\n .option('-in --group <groupId>', 'create tags in this tag group')\n .addOption(commit)\n .addHelpText(\n 'after',\n `\n Example call:\n > create tags \"Test tag\" --group example\n > create tags Books Faces History Places Spelling -in topics \\n`\n )\n .action(async (tagLabels: string[], opts) => {\n const groupId = opts.group;\n const cli = cliCommand(['create', 'tags', ...tagLabels], opts);\n\n const language =\n cli.env.projects.find(p => p.id === cli.env.currentProject)\n ?.primaryLanguage || 'en-GB';\n\n await cli.ImportTags({\n commit: opts.commit,\n data: tagLabels.map(label => ({\n groupId,\n label: { [language]: label },\n value: toApiId(label, 'camelCase', true),\n })),\n });\n });\n\n tags\n .command('in')\n .description('create new tags in a tag group')\n .argument('<groupId>', 'create tag(s) in this tag group')\n .argument('<\"Label\"...>', 'create tag(s) with label(s)')\n .addOption(commit)\n .addHelpText(\n 'after',\n `\n Example call:\n > create tags in example \"Tag 1\" \"Second Tag\" Third\n > create tags ih topics Books Faces History Places Spelling \\n`\n )\n .action(async (groupId: string, tagLabels: string[], opts, cmd) => {\n // workaround for opts.commit being always false\n // read the (shared) options that were parsed by the parent cmd\n // https://github.com/tj/commander.js/issues/476#issuecomment-1675757628\n const parentOptions = cmd.optsWithGlobals();\n\n const cli = cliCommand(['create', 'tags', 'in', groupId, ...tagLabels], {\n ...opts,\n ...parentOptions,\n });\n\n const language =\n cli.env.projects.find(p => p.id === cli.env.currentProject)\n ?.primaryLanguage || 'en-GB';\n\n await cli.ImportTags({\n commit: parentOptions.commit,\n data: tagLabels.map(label => ({\n groupId,\n label: { [language]: label },\n value: toApiId(label, 'camelCase', true),\n })),\n });\n });\n\n // Add global opts for inner sub-commands\n addGlobalOptions(tags);\n\n return create;\n};\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/commands/dev.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
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 dev_exports = {};
|
|
20
|
-
__export(dev_exports, {
|
|
21
|
-
makeDevCommand: () => makeDevCommand
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(dev_exports);
|
|
24
|
-
var import_commander = require("commander");
|
|
25
|
-
var import_ContensisDevService = require("../services/ContensisDevService");
|
|
26
|
-
const makeDevCommand = () => {
|
|
27
|
-
const dev = new import_commander.Command().command("dev").description("dev command").addHelpText("after", `
|
|
28
|
-
`).showHelpAfterError(true).exitOverride();
|
|
29
|
-
dev.command("init").description(
|
|
30
|
-
"initialise a git clone directory to connect and deploy to Contensis"
|
|
31
|
-
).argument(
|
|
32
|
-
"[projectHome]",
|
|
33
|
-
"the path of the folder to initialise",
|
|
34
|
-
process.cwd()
|
|
35
|
-
).option(
|
|
36
|
-
"--url <url>",
|
|
37
|
-
"override the git url or add one to initialise a non-git folder"
|
|
38
|
-
).option(
|
|
39
|
-
"-d --dry-run",
|
|
40
|
-
"perform a dry run of the project initialisation where no changes are made"
|
|
41
|
-
).addHelpText(
|
|
42
|
-
"after",
|
|
43
|
-
`
|
|
44
|
-
Example call:
|
|
45
|
-
> dev init
|
|
46
|
-
`
|
|
47
|
-
).action(async (projectHome, opts) => {
|
|
48
|
-
await (0, import_ContensisDevService.devCommand)(["dev", "init", projectHome], opts).DevelopmentInit(
|
|
49
|
-
projectHome,
|
|
50
|
-
{ ...opts, dryRun: opts.dryRun }
|
|
51
|
-
);
|
|
52
|
-
});
|
|
53
|
-
dev.command("requests").description("launch request handler for local development").argument(
|
|
54
|
-
"[block-id...]",
|
|
55
|
-
"id of block to develop locally and the local uri to pass requests for this block onto"
|
|
56
|
-
).option("--args <args...>", "override or add additional args").option(
|
|
57
|
-
"--release <release>",
|
|
58
|
-
"launch a specific release version of the request handler"
|
|
59
|
-
).usage("[block-id] [local-uri]").addHelpText(
|
|
60
|
-
"after",
|
|
61
|
-
`
|
|
62
|
-
Example call:
|
|
63
|
-
> dev requests test-block-one
|
|
64
|
-
> dev requests my-website http://localhost:8080
|
|
65
|
-
`
|
|
66
|
-
).action(async (blockId = [], opts) => {
|
|
67
|
-
await (0, import_ContensisDevService.devCommand)(
|
|
68
|
-
["dev", "requests", blockId.join(" ")],
|
|
69
|
-
opts
|
|
70
|
-
).ExecRequestHandler(blockId, opts == null ? void 0 : opts.args, opts.release);
|
|
71
|
-
});
|
|
72
|
-
return dev;
|
|
73
|
-
};
|
|
74
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
75
|
-
0 && (module.exports = {
|
|
76
|
-
makeDevCommand
|
|
77
|
-
});
|
|
78
|
-
//# sourceMappingURL=dev.js.map
|
package/dist/commands/dev.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/commands/dev.ts"],
|
|
4
|
-
"sourcesContent": ["import { Command } from 'commander';\nimport { devCommand } from '~/services/ContensisDevService';\n\nexport const makeDevCommand = () => {\n const dev = new Command()\n .command('dev')\n .description('dev command')\n .addHelpText('after', `\\n`)\n .showHelpAfterError(true)\n .exitOverride();\n\n dev\n .command('init')\n .description(\n 'initialise a git clone directory to connect and deploy to Contensis'\n )\n .argument(\n '[projectHome]',\n 'the path of the folder to initialise',\n process.cwd()\n )\n .option(\n '--url <url>',\n 'override the git url or add one to initialise a non-git folder'\n )\n .option(\n '-d --dry-run',\n 'perform a dry run of the project initialisation where no changes are made'\n )\n // .option(\n // '--commit',\n // 'commit change (will eventually be deprecated in favour of --dry-run)',\n // true\n // )\n .addHelpText(\n 'after',\n `\nExample call:\n > dev init\\n`\n )\n .action(async (projectHome: string, opts) => {\n // TODO: add opts for overriding project name and git url\n await devCommand(['dev', 'init', projectHome], opts).DevelopmentInit(\n projectHome,\n { ...opts, dryRun: opts.dryRun }\n );\n });\n\n dev\n .command('requests')\n .description('launch request handler for local development')\n .argument(\n '[block-id...]',\n 'id of block to develop locally and the local uri to pass requests for this block onto'\n )\n .option('--args <args...>', 'override or add additional args')\n .option(\n '--release <release>',\n 'launch a specific release version of the request handler'\n )\n .usage('[block-id] [local-uri]')\n .addHelpText(\n 'after',\n `\nExample call:\n > dev requests test-block-one\n > dev requests my-website http://localhost:8080\\n`\n )\n .action(async (blockId: string[] = [], opts) => {\n await devCommand(\n ['dev', 'requests', blockId.join(' ')],\n opts\n ).ExecRequestHandler(blockId, opts?.args, opts.release);\n });\n\n return dev;\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAwB;AACxB,iCAA2B;AAEpB,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,MACG,QAAQ,MAAM,EACd;AAAA,IACC;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,IACA,QAAQ,IAAI;AAAA,EACd,EACC;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,EACF,EAMC;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,EAGF,EACC,OAAO,OAAO,aAAqB,SAAS;AAE3C,cAAM,uCAAW,CAAC,OAAO,QAAQ,WAAW,GAAG,IAAI,EAAE;AAAA,MACnD;AAAA,MACA,EAAE,GAAG,MAAM,QAAQ,KAAK,OAAO;AAAA,IACjC;AAAA,EACF,CAAC;AAEH,MACG,QAAQ,UAAU,EAClB,YAAY,8CAA8C,EAC1D;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC,OAAO,oBAAoB,iCAAiC,EAC5D;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC,MAAM,wBAAwB,EAC9B;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,EAIF,EACC,OAAO,OAAO,UAAoB,CAAC,GAAG,SAAS;AAC9C,cAAM;AAAA,MACJ,CAAC,OAAO,YAAY,QAAQ,KAAK,GAAG,CAAC;AAAA,MACrC;AAAA,IACF,EAAE,mBAAmB,SAAS,6BAAM,MAAM,KAAK,OAAO;AAAA,EACxD,CAAC;AAEH,SAAO;AACT;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/commands/diff.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
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 diff_exports = {};
|
|
20
|
-
__export(diff_exports, {
|
|
21
|
-
makeDiffCommand: () => makeDiffCommand
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(diff_exports);
|
|
24
|
-
var import_commander = require("commander");
|
|
25
|
-
var import_ContensisCliService = require("../services/ContensisCliService");
|
|
26
|
-
var import_globalOptions = require("./globalOptions");
|
|
27
|
-
const makeDiffCommand = () => {
|
|
28
|
-
const diff = new import_commander.Command().command("diff").description("diff command").addHelpText("after", `
|
|
29
|
-
`).showHelpAfterError(true).exitOverride();
|
|
30
|
-
diff.command("models").description("differences with content models").argument(
|
|
31
|
-
"[model-ids...]",
|
|
32
|
-
"ids of any content types or components to diff (optional)"
|
|
33
|
-
).addOption(import_globalOptions.noCache).usage("[model-ids...]").addHelpText(
|
|
34
|
-
"after",
|
|
35
|
-
`
|
|
36
|
-
Example call:
|
|
37
|
-
> diff models blogPost
|
|
38
|
-
`
|
|
39
|
-
).action(async (modelIds = [], opts) => {
|
|
40
|
-
await (0, import_ContensisCliService.cliCommand)(
|
|
41
|
-
["diff", "models", modelIds.join(" ")],
|
|
42
|
-
opts,
|
|
43
|
-
(0, import_globalOptions.mapContensisOpts)({ modelIds, ...opts })
|
|
44
|
-
).DiffModels(
|
|
45
|
-
{
|
|
46
|
-
...opts
|
|
47
|
-
},
|
|
48
|
-
modelIds
|
|
49
|
-
);
|
|
50
|
-
});
|
|
51
|
-
return diff;
|
|
52
|
-
};
|
|
53
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
54
|
-
0 && (module.exports = {
|
|
55
|
-
makeDiffCommand
|
|
56
|
-
});
|
|
57
|
-
//# sourceMappingURL=diff.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/commands/diff.ts"],
|
|
4
|
-
"sourcesContent": ["import { Command } from 'commander';\nimport { cliCommand } from '~/services/ContensisCliService';\nimport { mapContensisOpts, noCache } from './globalOptions';\n\nexport const makeDiffCommand = () => {\n const diff = new Command()\n .command('diff')\n .description('diff command')\n .addHelpText('after', `\\n`)\n .showHelpAfterError(true)\n .exitOverride();\n\n diff\n .command('models')\n .description('differences with content models')\n .argument(\n '[model-ids...]',\n 'ids of any content types or components to diff (optional)'\n )\n .addOption(noCache)\n .usage('[model-ids...]')\n .addHelpText(\n 'after',\n `\nExample call:\n > diff models blogPost\\n`\n )\n .action(async (modelIds: string[] = [], opts) => {\n await cliCommand(\n ['diff', 'models', modelIds.join(' ')],\n opts,\n mapContensisOpts({ modelIds, ...opts })\n ).DiffModels(\n {\n ...opts,\n },\n modelIds\n );\n });\n\n return diff;\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAwB;AACxB,iCAA2B;AAC3B,2BAA0C;AAEnC,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,QAAQ,EAChB,YAAY,iCAAiC,EAC7C;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC,UAAU,4BAAO,EACjB,MAAM,gBAAgB,EACtB;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,EAGF,EACC,OAAO,OAAO,WAAqB,CAAC,GAAG,SAAS;AAC/C,cAAM;AAAA,MACJ,CAAC,QAAQ,UAAU,SAAS,KAAK,GAAG,CAAC;AAAA,MACrC;AAAA,UACA,uCAAiB,EAAE,UAAU,GAAG,KAAK,CAAC;AAAA,IACxC,EAAE;AAAA,MACA;AAAA,QACE,GAAG;AAAA,MACL;AAAA,MACA;AAAA,IACF;AAAA,EACF,CAAC;AAEH,SAAO;AACT;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|