contensis-cli 1.4.1-beta.1 → 1.4.2-beta.0
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/CHANGELOG.md +8 -0
- package/README.md +360 -1
- package/dist/commands/create.js +83 -2
- package/dist/commands/create.js.map +2 -2
- package/dist/commands/get.js +33 -1
- package/dist/commands/get.js.map +2 -2
- package/dist/commands/import.js +62 -0
- package/dist/commands/import.js.map +2 -2
- package/dist/commands/list.js +48 -1
- package/dist/commands/list.js.map +2 -2
- package/dist/commands/remove.js +50 -1
- package/dist/commands/remove.js.map +2 -2
- package/dist/localisation/en-GB.js +38 -8
- package/dist/localisation/en-GB.js.map +2 -2
- package/dist/providers/HttpProvider.js +4 -4
- package/dist/providers/HttpProvider.js.map +2 -2
- package/dist/providers/ManifestProvider.js +2 -2
- package/dist/providers/ManifestProvider.js.map +2 -2
- package/dist/providers/SessionCacheProvider.js +6 -3
- package/dist/providers/SessionCacheProvider.js.map +2 -2
- package/dist/providers/file-provider.js +2 -2
- package/dist/providers/file-provider.js.map +2 -2
- package/dist/services/ContensisCliService.js +370 -22
- package/dist/services/ContensisCliService.js.map +3 -3
- package/dist/shell.js +14 -1
- package/dist/shell.js.map +2 -2
- package/dist/util/assert.js +62 -0
- package/dist/util/assert.js.map +7 -0
- package/dist/util/index.js +11 -36
- package/dist/util/index.js.map +2 -2
- package/dist/util/logger.js +17 -6
- 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/create.ts +118 -0
- package/src/commands/get.ts +48 -1
- package/src/commands/import.ts +86 -0
- package/src/commands/list.ts +80 -1
- package/src/commands/remove.ts +91 -1
- package/src/localisation/en-GB.ts +62 -9
- package/src/models/Cache.d.ts +2 -1
- package/src/providers/HttpProvider.ts +1 -1
- package/src/providers/ManifestProvider.ts +1 -1
- package/src/providers/SessionCacheProvider.ts +6 -1
- package/src/providers/file-provider.ts +1 -1
- package/src/services/ContensisCliService.ts +480 -24
- package/src/shell.ts +14 -1
- package/src/util/assert.ts +35 -0
- package/src/util/index.ts +15 -36
- package/src/util/logger.ts +18 -6
- package/src/version.ts +1 -1
package/dist/commands/get.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/commands/get.ts"],
|
|
4
|
-
"sourcesContent": ["import { Argument, Command, Option } from 'commander';\nimport { merge } from 'lodash';\nimport { cliCommand } from '~/services/ContensisCliService';\nimport {\n addGlobalOptions,\n assetTypes,\n contentTypes,\n delivery,\n entryId,\n exportOption,\n latest,\n mapContensisOpts,\n noCache,\n requiredBy,\n versionStatus,\n zenql,\n} from './globalOptions';\n\nexport const makeGetCommand = () => {\n const program = new Command()\n .command('get')\n .description('get command')\n .addHelpText('after', `\\n`)\n .showHelpAfterError(true)\n .exitOverride();\n\n program\n .command('version')\n .description('get current Contensis version')\n .addHelpText(\n 'after',\n `\nExample call:\n > version\n`\n )\n .action(async opts => {\n await cliCommand(['get', 'version'], opts).PrintContensisVersion();\n });\n\n program\n .command('token')\n .description('show a bearer token for the currently logged in user')\n .addHelpText(\n 'after',\n `\nExample call:\n > get token\n`\n )\n .action(async opts => {\n await cliCommand(['get', 'token'], opts).PrintBearerToken();\n });\n\n program\n .command('project')\n .description('get a project')\n .argument('[projectId]', 'id of the project to get (default: current)')\n .addHelpText(\n 'after',\n `\nExample call:\n > get project website\n`\n )\n .action(async (projectId: string, opts) => {\n await cliCommand(['get', 'project', projectId], opts).PrintProject(\n projectId\n );\n });\n\n program\n .command('proxy')\n .description('get a proxy')\n .argument('<proxyId>', 'id of the proxy to get')\n .addHelpText(\n 'after',\n `\n Example call:\n > get proxy b8b6958f-6ae2-41d5-876a-abc86755fd7b\n `\n )\n .action(async (proxyId: string, opts) => {\n await cliCommand(['get', 'proxy', proxyId], opts).PrintProxies(proxyId);\n });\n\n program\n .command('renderer')\n .description('get a renderer')\n .argument('<rendererId>', 'id of the renderer to get')\n .addHelpText(\n 'after',\n `\nExample call:\n > get renderer contensis-website\n`\n )\n .action(async (rendererId: string, opts) => {\n await cliCommand(['get', 'renderer', rendererId], opts).PrintRenderers(\n rendererId\n );\n });\n\n program\n .command('role')\n .description('get a role')\n .argument('<roleNameOrId>', 'id or name of the role to get')\n .addHelpText(\n 'after',\n `\nExample call:\n > get role \"entry admin\"\n`\n )\n .action(async (roleNameOrId: string, opts) => {\n await cliCommand(['get', 'role', roleNameOrId], opts).PrintRole(\n roleNameOrId\n );\n });\n\n program\n .command('webhook')\n .description('get a webhook')\n .argument('<webhookNameOrId...>', 'id or name of the webhook(s) to get')\n .addHelpText(\n 'after',\n `\nExample call:\n > get webhook \"Slack notification\"\n`\n )\n .action(async (webhookNameOrId: string[], opts) => {\n await cliCommand(\n ['get', 'webhook', webhookNameOrId.join(' ')],\n opts\n ).PrintWebhookSubscriptions(webhookNameOrId);\n });\n\n program\n .command('workflow')\n .description('get a workflow')\n .argument('<workflowNameOrId>', 'id or name of the workflow to get')\n .addHelpText(\n 'after',\n `\nExample call:\n > get workflow \"Approval workflow\"\n`\n )\n .action(async (workflowNameOrId: string, opts) => {\n await cliCommand(\n ['get', 'workflow', workflowNameOrId],\n opts\n ).PrintWorkflow(workflowNameOrId);\n });\n\n program\n .command('model')\n .description('get a content model')\n .argument('<contentTypeId...>', 'ids of the content models to get')\n .addOption(requiredBy)\n .addOption(exportOption)\n .addOption(noCache)\n .addHelpText(\n 'after',\n `\nExample call:\n > get model podcast podcastLinks\n`\n )\n .action(async (modelIds: string[], opts) => {\n await cliCommand(\n ['get', 'model', modelIds.join(' ')],\n opts,\n mapContensisOpts(opts)\n ).PrintContentModels(modelIds, opts);\n });\n\n program\n .command('contenttype')\n .description('get a content type')\n .argument('<contentTypeId>', 'the API id of the content type to get')\n .addHelpText(\n 'after',\n `\nExample call:\n > get contenttype {contentTypeId} -o content-type-backup.json\n`\n )\n .action(async (contentTypeId: string, opts) => {\n await cliCommand(\n ['get', 'contenttype', contentTypeId],\n opts\n ).PrintContentType(contentTypeId);\n });\n\n program\n .command('component')\n .description('get a component')\n .argument('<componentId>', 'the API id of the component to get')\n .addHelpText(\n 'after',\n `\nExample call:\n > get component {componentId} -o component-backup.json\n`\n )\n .action(async (componentId: string, opts) => {\n await cliCommand(['get', 'component', componentId], opts).PrintComponent(\n componentId\n );\n });\n\n const sharedGetEntryOptions = (command: Command) =>\n command\n .addOption(entryId)\n .addOption(zenql)\n .addOption(\n new Option(\n '-fi --fields <fields...>',\n 'limit the output fields on returned entries'\n )\n )\n .addOption(\n new Option(\n '-ob --order-by <orderBy...>',\n 'field name(s) to order the results by (prefix \"-\" for descending)'\n )\n )\n .addOption(latest)\n .addOption(versionStatus)\n .addOption(delivery);\n\n sharedGetEntryOptions(\n program\n .command('assets')\n .description('get asset entries')\n .argument(\n '[search phrase]',\n 'get assets with the search phrase, use quotes for multiple words'\n )\n .addOption(assetTypes)\n )\n .option('-l --paths <paths...>', 'get assets under the given path(s)')\n .addHelpText(\n 'after',\n `\nExample call:\n > get assets --zenql \"sys.contentTypeId = blog\" --fields sys.id sys.properties.filePath sys.properties.filename\n`\n )\n .action(async (search: string, opts) => {\n // Maintaining a separate command for assets vs entries\n // allows us to offer up more options when dealing with just assets\n await cliCommand(\n ['get', 'assets'],\n opts,\n mapContensisOpts({ dataFormat: 'asset', search, ...opts })\n ).GetEntries();\n });\n\n sharedGetEntryOptions(\n program\n .command('entries')\n .description('get entries')\n .argument(\n '[search phrase]',\n 'get entries with the search phrase, use quotes for multiple words'\n )\n .addOption(contentTypes)\n .option(\n '-d --dependents',\n 'find and return any dependencies of all found entries'\n )\n )\n .addOption(\n new Option(\n '--data-format <dataFormat>',\n 'find and return entries of a specific data format'\n )\n .choices(['entry', 'asset', 'webpage'])\n .default('entry')\n )\n .addHelpText(\n 'after',\n `\nExample call:\n > get entries --zenql \"sys.contentTypeId = blog\" --fields entryTitle entryDescription sys.id --output ./blog-posts.csv --format csv\n > get entries --content-type blog --fields entryTitle sys.version.modified --order-by -sys.version.modified\n`\n )\n .action(async (search: string, opts, cmd) => {\n await cliCommand(\n ['get', 'entries'],\n opts,\n mapContensisOpts({ search, ...opts })\n ).GetEntries({\n withDependents: opts.dependents,\n });\n });\n\n program\n .command('nodes')\n .description('get nodes')\n .argument('[root]', 'get node(s) from the specified path e.g. /blog', '/')\n .option(\n '-d --depth <depth>',\n 'get nodes with children to a specified depth',\n '1'\n )\n .addHelpText(\n 'after',\n `\nExample call:\n > get nodes /blog --depth 1\n`\n )\n .action(async (root: string, opts) => {\n await cliCommand(['get', 'nodes'], opts, mapContensisOpts(opts)).GetNodes(\n root,\n opts.depth\n );\n });\n\n const block = program\n .command('block')\n .description('get a block or block version')\n .argument('[blockId]', 'the block to get version details for')\n .argument(\n '[branch]',\n 'the branch of the block to get version details for',\n 'default'\n )\n .argument(\n '[version]',\n 'get a specific version of the block pushed to the specified branch'\n )\n .addHelpText(\n 'after',\n `\nExample call:\n > get block contensis-website\n > get block contensis-website develop latest\n > get block contensis-website feature-branch 3\n`\n )\n .action(async (blockId: string, branch: string, version: string, opts) => {\n await cliCommand(['get', 'block', blockId], opts).PrintBlockVersions(\n blockId,\n branch,\n version\n );\n });\n\n block\n .command('logs')\n .description('get logs for a block')\n .argument('[blockId]', 'the block to get version logs for')\n .argument(\n '[branch]',\n 'the branch of the block to get version details for',\n 'default'\n )\n .argument(\n '[version]',\n 'the version of the block pushed to the branch to get logs for',\n 'latest'\n )\n .addArgument(\n new Argument(\n '[dataCenter]',\n 'the datacentre of the block to get logs for'\n )\n .choices(['hq', 'london', 'manchester', 'all'])\n .default('all')\n )\n .option('-t --follow', 'follow block logs in near realtime', false)\n .usage('get block logs [blockId] [branch] [version] [dataCenter]')\n .addHelpText(\n 'after',\n `\nExample call:\n > get block logs contensis-website default\n > get block logs contensis-website master latest london --follow\n`\n )\n .action(\n async (\n blockId: string,\n branch: string,\n version: string,\n dataCenter: 'hq' | 'manchester' | 'london' | 'all',\n opts\n ) => {\n const parentOpts = block.opts() || {};\n await cliCommand(\n ['get', 'block', 'logs'],\n merge(opts, parentOpts)\n ).PrintBlockLogs(\n blockId,\n branch,\n version,\n dataCenter === 'all' ? undefined : dataCenter,\n opts.follow as boolean\n );\n }\n );\n\n // Add global opts for inner sub-commands\n addGlobalOptions(block);\n\n return program;\n};\n\nexport const get = makeGetCommand();\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAA0C;AAC1C,oBAAsB;AACtB,iCAA2B;AAC3B,
|
|
4
|
+
"sourcesContent": ["import { Argument, Command, Option } from 'commander';\nimport { merge } from 'lodash';\nimport {\n addGlobalOptions,\n assetTypes,\n contentTypes,\n delivery,\n entryId,\n exportOption,\n latest,\n mapContensisOpts,\n noCache,\n requiredBy,\n versionStatus,\n zenql,\n} from './globalOptions';\nimport { cliCommand } from '~/services/ContensisCliService';\nimport { isUuid } from '~/util/assert';\n\nexport const makeGetCommand = () => {\n const program = new Command()\n .command('get')\n .description('get command')\n .addHelpText('after', `\\n`)\n .showHelpAfterError(true)\n .exitOverride();\n\n program\n .command('version')\n .description('get current Contensis version')\n .addHelpText(\n 'after',\n `\nExample call:\n > version\n`\n )\n .action(async opts => {\n await cliCommand(['get', 'version'], opts).PrintContensisVersion();\n });\n\n program\n .command('token')\n .description('show a bearer token for the currently logged in user')\n .addHelpText(\n 'after',\n `\nExample call:\n > get token\n`\n )\n .action(async opts => {\n await cliCommand(['get', 'token'], opts).PrintBearerToken();\n });\n\n program\n .command('project')\n .description('get a project')\n .argument('[projectId]', 'id of the project to get (default: current)')\n .addHelpText(\n 'after',\n `\nExample call:\n > get project website\n`\n )\n .action(async (projectId: string, opts) => {\n await cliCommand(['get', 'project', projectId], opts).PrintProject(\n projectId\n );\n });\n\n program\n .command('proxy')\n .description('get a proxy')\n .argument('<proxyId>', 'id of the proxy to get')\n .addHelpText(\n 'after',\n `\n Example call:\n > get proxy b8b6958f-6ae2-41d5-876a-abc86755fd7b\n `\n )\n .action(async (proxyId: string, opts) => {\n await cliCommand(['get', 'proxy', proxyId], opts).PrintProxies(proxyId);\n });\n\n program\n .command('renderer')\n .description('get a renderer')\n .argument('<rendererId>', 'id of the renderer to get')\n .addHelpText(\n 'after',\n `\nExample call:\n > get renderer contensis-website\n`\n )\n .action(async (rendererId: string, opts) => {\n await cliCommand(['get', 'renderer', rendererId], opts).PrintRenderers(\n rendererId\n );\n });\n\n program\n .command('role')\n .description('get a role')\n .argument('<roleNameOrId>', 'id or name of the role to get')\n .addHelpText(\n 'after',\n `\nExample call:\n > get role \"entry admin\"\n`\n )\n .action(async (roleNameOrId: string, opts) => {\n await cliCommand(['get', 'role', roleNameOrId], opts).PrintRole(\n roleNameOrId\n );\n });\n\n program\n .command('tag')\n .description('get a tag')\n .argument('[idOrLabel]', 'find a tag with this id or label')\n .option('-in --group <groupId>', 'id of the tag group containing tags')\n .option('-l --language <language>', 'find tags in the supplied language')\n .option('-d --dependents', 'find and return tag groups for all found tags')\n .addHelpText(\n 'after',\n `\n Example call:\n > get tag \"Places\" --group topics\n > get tag \"Places\" -in topics\n > get tag \"Lieux\" --language fr-FR -in topics\n > get tag d4267b35-0d25-41ae-bce9-eeb490c793f4\n `\n )\n .action(async (idOrlabel: string, opts) => {\n await cliCommand(['get', 'tag', idOrlabel], opts).PrintTag(\n {\n id: isUuid(idOrlabel) ? idOrlabel : undefined,\n groupId: opts.group,\n label: isUuid(idOrlabel) ? undefined : idOrlabel,\n language: opts.language,\n },\n opts.dependents\n );\n });\n\n program\n .command('taggroup')\n .description('get a tag group')\n .argument('<groupId>', 'id of the tag group to get')\n .addHelpText(\n 'after',\n `\n Example call:\n > get taggroup topics\n `\n )\n .action(async (groupId: string, opts) => {\n await cliCommand(['get', 'taggroup', groupId], opts).PrintTagGroup(\n groupId\n );\n });\n\n program\n .command('webhook')\n .description('get a webhook')\n .argument('<webhookNameOrId...>', 'id or name of the webhook(s) to get')\n .addHelpText(\n 'after',\n `\nExample call:\n > get webhook \"Slack notification\"\n`\n )\n .action(async (webhookNameOrId: string[], opts) => {\n await cliCommand(\n ['get', 'webhook', webhookNameOrId.join(' ')],\n opts\n ).PrintWebhookSubscriptions(webhookNameOrId);\n });\n\n program\n .command('workflow')\n .description('get a workflow')\n .argument('<workflowNameOrId>', 'id or name of the workflow to get')\n .addHelpText(\n 'after',\n `\nExample call:\n > get workflow \"Approval workflow\"\n`\n )\n .action(async (workflowNameOrId: string, opts) => {\n await cliCommand(\n ['get', 'workflow', workflowNameOrId],\n opts\n ).PrintWorkflow(workflowNameOrId);\n });\n\n program\n .command('model')\n .description('get a content model')\n .argument('<contentTypeId...>', 'ids of the content models to get')\n .addOption(requiredBy)\n .addOption(exportOption)\n .addOption(noCache)\n .addHelpText(\n 'after',\n `\nExample call:\n > get model podcast podcastLinks\n`\n )\n .action(async (modelIds: string[], opts) => {\n await cliCommand(\n ['get', 'model', modelIds.join(' ')],\n opts,\n mapContensisOpts(opts)\n ).PrintContentModels(modelIds, opts);\n });\n\n program\n .command('contenttype')\n .description('get a content type')\n .argument('<contentTypeId>', 'the API id of the content type to get')\n .addHelpText(\n 'after',\n `\nExample call:\n > get contenttype {contentTypeId} -o content-type-backup.json\n`\n )\n .action(async (contentTypeId: string, opts) => {\n await cliCommand(\n ['get', 'contenttype', contentTypeId],\n opts\n ).PrintContentType(contentTypeId);\n });\n\n program\n .command('component')\n .description('get a component')\n .argument('<componentId>', 'the API id of the component to get')\n .addHelpText(\n 'after',\n `\nExample call:\n > get component {componentId} -o component-backup.json\n`\n )\n .action(async (componentId: string, opts) => {\n await cliCommand(['get', 'component', componentId], opts).PrintComponent(\n componentId\n );\n });\n\n const sharedGetEntryOptions = (command: Command) =>\n command\n .addOption(entryId)\n .addOption(zenql)\n .addOption(\n new Option(\n '-fi --fields <fields...>',\n 'limit the output fields on returned entries'\n )\n )\n .addOption(\n new Option(\n '-ob --order-by <orderBy...>',\n 'field name(s) to order the results by (prefix \"-\" for descending)'\n )\n )\n .addOption(latest)\n .addOption(versionStatus)\n .addOption(delivery);\n\n sharedGetEntryOptions(\n program\n .command('assets')\n .description('get asset entries')\n .argument(\n '[search phrase]',\n 'get assets with the search phrase, use quotes for multiple words'\n )\n .addOption(assetTypes)\n )\n .option('-l --paths <paths...>', 'get assets under the given path(s)')\n .addHelpText(\n 'after',\n `\nExample call:\n > get assets --zenql \"sys.contentTypeId = blog\" --fields sys.id sys.properties.filePath sys.properties.filename\n`\n )\n .action(async (search: string, opts) => {\n // Maintaining a separate command for assets vs entries\n // allows us to offer up more options when dealing with just assets\n await cliCommand(\n ['get', 'assets'],\n opts,\n mapContensisOpts({ dataFormat: 'asset', search, ...opts })\n ).GetEntries();\n });\n\n sharedGetEntryOptions(\n program\n .command('entries')\n .description('get entries')\n .argument(\n '[search phrase]',\n 'get entries with the search phrase, use quotes for multiple words'\n )\n .addOption(contentTypes)\n .option(\n '-d --dependents',\n 'find and return any dependencies of all found entries'\n )\n )\n .addOption(\n new Option(\n '--data-format <dataFormat>',\n 'find and return entries of a specific data format'\n )\n .choices(['entry', 'asset', 'webpage'])\n .default('entry')\n )\n .addHelpText(\n 'after',\n `\nExample call:\n > get entries --zenql \"sys.contentTypeId = blog\" --fields entryTitle entryDescription sys.id --output ./blog-posts.csv --format csv\n > get entries --content-type blog --fields entryTitle sys.version.modified --order-by -sys.version.modified\n`\n )\n .action(async (search: string, opts, cmd) => {\n await cliCommand(\n ['get', 'entries'],\n opts,\n mapContensisOpts({ search, ...opts })\n ).GetEntries({\n withDependents: opts.dependents,\n });\n });\n\n program\n .command('nodes')\n .description('get nodes')\n .argument('[root]', 'get node(s) from the specified path e.g. /blog', '/')\n .option(\n '-d --depth <depth>',\n 'get nodes with children to a specified depth',\n '1'\n )\n .addHelpText(\n 'after',\n `\nExample call:\n > get nodes /blog --depth 1\n`\n )\n .action(async (root: string, opts) => {\n await cliCommand(['get', 'nodes'], opts, mapContensisOpts(opts)).GetNodes(\n root,\n opts.depth\n );\n });\n\n const block = program\n .command('block')\n .description('get a block or block version')\n .argument('[blockId]', 'the block to get version details for')\n .argument(\n '[branch]',\n 'the branch of the block to get version details for',\n 'default'\n )\n .argument(\n '[version]',\n 'get a specific version of the block pushed to the specified branch'\n )\n .addHelpText(\n 'after',\n `\nExample call:\n > get block contensis-website\n > get block contensis-website develop latest\n > get block contensis-website feature-branch 3\n`\n )\n .action(async (blockId: string, branch: string, version: string, opts) => {\n await cliCommand(['get', 'block', blockId], opts).PrintBlockVersions(\n blockId,\n branch,\n version\n );\n });\n\n block\n .command('logs')\n .description('get logs for a block')\n .argument('[blockId]', 'the block to get version logs for')\n .argument(\n '[branch]',\n 'the branch of the block to get version details for',\n 'default'\n )\n .argument(\n '[version]',\n 'the version of the block pushed to the branch to get logs for',\n 'latest'\n )\n .addArgument(\n new Argument(\n '[dataCenter]',\n 'the datacentre of the block to get logs for'\n )\n .choices(['hq', 'london', 'manchester', 'all'])\n .default('all')\n )\n .option('-t --follow', 'follow block logs in near realtime', false)\n .usage('get block logs [blockId] [branch] [version] [dataCenter]')\n .addHelpText(\n 'after',\n `\nExample call:\n > get block logs contensis-website default\n > get block logs contensis-website master latest london --follow\n`\n )\n .action(\n async (\n blockId: string,\n branch: string,\n version: string,\n dataCenter: 'hq' | 'manchester' | 'london' | 'all',\n opts\n ) => {\n const parentOpts = block.opts() || {};\n await cliCommand(\n ['get', 'block', 'logs'],\n merge(opts, parentOpts)\n ).PrintBlockLogs(\n blockId,\n branch,\n version,\n dataCenter === 'all' ? undefined : dataCenter,\n opts.follow as boolean\n );\n }\n );\n\n // Add global opts for inner sub-commands\n addGlobalOptions(block);\n\n return program;\n};\n\nexport const get = makeGetCommand();\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAA0C;AAC1C,oBAAsB;AACtB,2BAaO;AACP,iCAA2B;AAC3B,oBAAuB;A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AAAA,EAClB,EACC,OAAO,eAAe,sCAAsC,KAAK,EACjE,MAAM,0DAA0D,EAChE;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKF,EACC;AAAA,IACC,OACE,SACA,QACA,SACA,YACA,SACG;AACH,YAAM,aAAa,MAAM,KAAK,KAAK,CAAC;AACpC,gBAAM;AAAA,QACJ,CAAC,OAAO,SAAS,MAAM;AAAA,YACvB,qBAAM,MAAM,UAAU;AAAA,MACxB,EAAE;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,eAAe,QAAQ,SAAY;AAAA,QACnC,KAAK;AAAA,MACP;AAAA,IACF;AAAA,EACF;AAGF,6CAAiB,KAAK;AAEtB,SAAO;AACT;AAEO,MAAM,MAAM,eAAe;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/commands/import.js
CHANGED
|
@@ -153,6 +153,68 @@ Example call:
|
|
|
153
153
|
logLimit: Number(opts.outputLimit)
|
|
154
154
|
});
|
|
155
155
|
});
|
|
156
|
+
program.command("taggroups").description("import taggroups").argument("[query]", "apply a filter").option("-i --id <ids...>", "limit to the supplied tag group id(s)").addOption(import_globalOptions.commit).option(
|
|
157
|
+
"-preserve --preserve-guids",
|
|
158
|
+
"include this flag when you are importing tags that you have previously exported and wish to update"
|
|
159
|
+
).addOption(import_globalOptions.concurrency).addOption(import_globalOptions.ignoreErrors).option(
|
|
160
|
+
"--save",
|
|
161
|
+
"save the tag groups we're migrating instead of the migration preview (used with --output)"
|
|
162
|
+
).addHelpText(
|
|
163
|
+
"after",
|
|
164
|
+
`
|
|
165
|
+
Example call:
|
|
166
|
+
> import taggroups --source-cms example-dev --source-project-id microsite --zenql "sys.contentTypeId = blog"
|
|
167
|
+
> import taggroups --from-file myImportData.json --preserve-guids
|
|
168
|
+
`
|
|
169
|
+
).action(async (query, opts) => {
|
|
170
|
+
var _a, _b;
|
|
171
|
+
await (0, import_ContensisCliService.cliCommand)(
|
|
172
|
+
["import", "taggroups"],
|
|
173
|
+
opts,
|
|
174
|
+
(0, import_globalOptions.mapContensisOpts)(opts)
|
|
175
|
+
).ImportTagGroups({
|
|
176
|
+
commit: opts.commit,
|
|
177
|
+
fromFile: opts.fromFile,
|
|
178
|
+
getBy: {
|
|
179
|
+
id: ((_a = opts.id) == null ? void 0 : _a.length) === 1 ? opts.id[0] : void 0,
|
|
180
|
+
ids: ((_b = opts.id) == null ? void 0 : _b.length) > 1 ? opts.id : void 0,
|
|
181
|
+
q: query
|
|
182
|
+
},
|
|
183
|
+
save: opts.save
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
program.command("tags").description("import tags").option("-in --group <groupId>", "id of the tag group containing tags").option("--label <label>", "filter by tags that match this label").option("-l --language <language>", "find tags in the supplied language").option("-i --id <ids...>", "limit to the supplied tag group id(s)").addOption(import_globalOptions.commit).option(
|
|
187
|
+
"-preserve --preserve-guids",
|
|
188
|
+
"include this flag when you are importing tags that you have previously exported and wish to update"
|
|
189
|
+
).addOption(import_globalOptions.concurrency).addOption(import_globalOptions.ignoreErrors).option(
|
|
190
|
+
"--save",
|
|
191
|
+
"save the tags we're migrating instead of the migration preview (used with --output)"
|
|
192
|
+
).addHelpText(
|
|
193
|
+
"after",
|
|
194
|
+
`
|
|
195
|
+
Example call:
|
|
196
|
+
> import tags --source-cms example-dev --source-project-id microsite --group example
|
|
197
|
+
> import tags --from-file myImportData.json --preserve-guids
|
|
198
|
+
`
|
|
199
|
+
).action(async (opts) => {
|
|
200
|
+
var _a, _b;
|
|
201
|
+
await (0, import_ContensisCliService.cliCommand)(
|
|
202
|
+
["import", "tags"],
|
|
203
|
+
opts,
|
|
204
|
+
(0, import_globalOptions.mapContensisOpts)(opts)
|
|
205
|
+
).ImportTags({
|
|
206
|
+
commit: opts.commit,
|
|
207
|
+
fromFile: opts.fromFile,
|
|
208
|
+
getBy: {
|
|
209
|
+
groupId: opts.group,
|
|
210
|
+
id: ((_a = opts.id) == null ? void 0 : _a.length) === 1 ? opts.id[0] : void 0,
|
|
211
|
+
ids: ((_b = opts.id) == null ? void 0 : _b.length) > 1 ? opts.id : void 0,
|
|
212
|
+
label: opts.label,
|
|
213
|
+
language: opts.language
|
|
214
|
+
},
|
|
215
|
+
save: opts.save
|
|
216
|
+
});
|
|
217
|
+
});
|
|
156
218
|
return program;
|
|
157
219
|
};
|
|
158
220
|
const get = makeImportCommand();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/commands/import.ts"],
|
|
4
|
-
"sourcesContent": ["import { Command, Option } from 'commander';\nimport { cliCommand } from '~/services/ContensisCliService';\nimport {\n assetTypes,\n commit,\n concurrency,\n contentTypes,\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 makeImportCommand = () => {\n const program = new Command()\n .command('import')\n .description('import command')\n .addHelpText('after', `\\n`)\n .showHelpAfterError(true)\n .exitOverride();\n\n program\n .command('models')\n .description('import complete content models')\n .argument('[modelIds...]', 'ids of the content models to import (optional)')\n .addOption(noCache)\n .addOption(commit)\n .option(\n '-nod --no-defaults',\n 'ignore any default entries or nodes attached to content types or fields'\n )\n .option(\n '-preserve --preserve-guids',\n 'import any default entries or nodes using the same id as the source'\n )\n .addHelpText(\n 'after',\n `\nExample call:\n > import models blogPost --from-file contentmodels-backup.json\n > import models --source-alias example-dev\n`\n )\n .action(async (modelIds: string[], opts) => {\n await cliCommand(\n ['import', 'models', modelIds.join(' ')],\n opts,\n mapContensisOpts({ modelIds, ...opts })\n ).ImportContentModels({\n fromFile: opts.fromFile,\n commit: opts.commit,\n });\n });\n\n program\n .command('contenttypes')\n .description('import content types')\n .argument(\n '[contentTypeIds...]',\n 'Optional list of API id(s) of the content type(s) to import'\n )\n .addOption(commit)\n .addHelpText(\n 'after',\n `\nExample call:\n > import contenttypes {contentTypeIds} --from-file contenttypes-backup.json\n > import contenttypes {contentTypeIds} --source-alias example-dev\n`\n )\n .action(async (contentTypeIds: string[], opts) => {\n await cliCommand(\n ['import', 'contenttypes'],\n opts,\n mapContensisOpts({ contentTypeIds, ...opts })\n ).ImportContentTypes(\n {\n fromFile: opts.fromFile,\n commit: opts.commit,\n },\n contentTypeIds\n );\n });\n\n program\n .command('components')\n .description('import components')\n .argument(\n '[componentIds...]',\n 'Optional list of API id(s) of the component(s) to import'\n )\n .addOption(commit)\n .addHelpText(\n 'after',\n `\nExample call:\n > import components {componentIds} --from-file component-backup.json\n > import components {componentIds} --source-alias example-dev\n`\n )\n .action(async (componentIds: string[], opts) => {\n await cliCommand(\n ['import', 'component'],\n opts,\n mapContensisOpts({ componentIds, ...opts })\n ).ImportComponents(\n {\n fromFile: opts.fromFile,\n commit: opts.commit,\n },\n componentIds\n );\n });\n\n program\n .command('entries')\n .description('import entries')\n .argument(\n '[search phrase]',\n 'get entries with the search phrase, use quotes for multiple words'\n )\n .addOption(entryId)\n .addOption(zenql)\n .addOption(contentTypes)\n .addOption(assetTypes)\n .addOption(latest)\n .addOption(versionStatus)\n .addOption(commit)\n .option(\n '-preserve --preserve-guids',\n 'include this flag when you are importing entries that you have previously exported and wish to update'\n )\n .addOption(concurrency)\n .addOption(outputDetail)\n .addOption(ignoreErrors)\n .addOption(noCache)\n .addOption(noPublish)\n .addOption(saveEntries)\n .addHelpText(\n 'after',\n `\nExample call:\n > import entries --source-cms example-dev --source-project-id microsite --zenql \"sys.contentTypeId = blog\"\n > import entries --from-file myImportData.json --preserve-guids\n`\n )\n .action(async (search: string, opts, cmd) => {\n await cliCommand(\n ['import', 'entries'],\n opts,\n mapContensisOpts({ search, ...opts })\n ).ImportEntries({\n commit: opts.commit,\n fromFile: opts.fromFile,\n logOutput: opts.outputDetail,\n saveEntries: opts.saveEntries,\n });\n });\n\n // TODO: add options to import one an array of nodes? nodeIds: string[]\n program\n .command('nodes')\n .description('import nodes')\n .argument('[root]', 'import nodes from the specified path e.g. /blog', '/')\n .option(\n '-preserve --preserve-guids',\n 'include this flag when you are importing nodes that you have previously exported and wish to update'\n )\n .addOption(ignoreErrors)\n .addOption(commit)\n .addOption(\n new Option(\n '-od --output-detail <outputDetail>',\n 'how much detail to output from the import'\n )\n .choices(['errors', 'changes', 'all'])\n .default('errors')\n )\n .option(\n '-ol --output-limit <outputLimit>',\n 'expand or limit the number of records output to the console',\n '200'\n )\n .addHelpText(\n 'after',\n `\nExample call:\n > import nodes /blog --source-alias example-alias --source-project-id example-project\n > import nodes --from-file site-backup.json --preserve-guids\n`\n )\n .action(async (root: string, opts) => {\n await cliCommand(\n ['import', 'nodes'],\n opts,\n mapContensisOpts({ paths: root.split(' '), ...opts })\n ).ImportNodes({\n commit: opts.commit,\n fromFile: opts.fromFile,\n logOutput: opts.outputDetail,\n logLimit: Number(opts.outputLimit),\n });\n });\n\n return program;\n};\n\nexport const get = makeImportCommand();\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAgC;AAChC,iCAA2B;AAC3B,2BAeO;AAEA,MAAM,oBAAoB,MAAM;AACrC,QAAM,UAAU,IAAI,yBAAQ,EACzB,QAAQ,QAAQ,EAChB,YAAY,gBAAgB,EAC5B,YAAY,SAAS;AAAA,CAAI,EACzB,mBAAmB,IAAI,EACvB,aAAa;AAEhB,UACG,QAAQ,QAAQ,EAChB,YAAY,gCAAgC,EAC5C,SAAS,iBAAiB,gDAAgD,EAC1E,UAAU,4BAAO,EACjB,UAAU,2BAAM,EAChB;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKF,EACC,OAAO,OAAO,UAAoB,SAAS;AAC1C,cAAM;AAAA,MACJ,CAAC,UAAU,UAAU,SAAS,KAAK,GAAG,CAAC;AAAA,MACvC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AAO;AACT;AAEO,MAAM,MAAM,kBAAkB;",
|
|
4
|
+
"sourcesContent": ["import { Command, Option } from 'commander';\nimport { cliCommand } from '~/services/ContensisCliService';\nimport {\n assetTypes,\n commit,\n concurrency,\n contentTypes,\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 makeImportCommand = () => {\n const program = new Command()\n .command('import')\n .description('import command')\n .addHelpText('after', `\\n`)\n .showHelpAfterError(true)\n .exitOverride();\n\n program\n .command('models')\n .description('import complete content models')\n .argument('[modelIds...]', 'ids of the content models to import (optional)')\n .addOption(noCache)\n .addOption(commit)\n .option(\n '-nod --no-defaults',\n 'ignore any default entries or nodes attached to content types or fields'\n )\n .option(\n '-preserve --preserve-guids',\n 'import any default entries or nodes using the same id as the source'\n )\n .addHelpText(\n 'after',\n `\nExample call:\n > import models blogPost --from-file contentmodels-backup.json\n > import models --source-alias example-dev\n`\n )\n .action(async (modelIds: string[], opts) => {\n await cliCommand(\n ['import', 'models', modelIds.join(' ')],\n opts,\n mapContensisOpts({ modelIds, ...opts })\n ).ImportContentModels({\n fromFile: opts.fromFile,\n commit: opts.commit,\n });\n });\n\n program\n .command('contenttypes')\n .description('import content types')\n .argument(\n '[contentTypeIds...]',\n 'Optional list of API id(s) of the content type(s) to import'\n )\n .addOption(commit)\n .addHelpText(\n 'after',\n `\nExample call:\n > import contenttypes {contentTypeIds} --from-file contenttypes-backup.json\n > import contenttypes {contentTypeIds} --source-alias example-dev\n`\n )\n .action(async (contentTypeIds: string[], opts) => {\n await cliCommand(\n ['import', 'contenttypes'],\n opts,\n mapContensisOpts({ contentTypeIds, ...opts })\n ).ImportContentTypes(\n {\n fromFile: opts.fromFile,\n commit: opts.commit,\n },\n contentTypeIds\n );\n });\n\n program\n .command('components')\n .description('import components')\n .argument(\n '[componentIds...]',\n 'Optional list of API id(s) of the component(s) to import'\n )\n .addOption(commit)\n .addHelpText(\n 'after',\n `\nExample call:\n > import components {componentIds} --from-file component-backup.json\n > import components {componentIds} --source-alias example-dev\n`\n )\n .action(async (componentIds: string[], opts) => {\n await cliCommand(\n ['import', 'component'],\n opts,\n mapContensisOpts({ componentIds, ...opts })\n ).ImportComponents(\n {\n fromFile: opts.fromFile,\n commit: opts.commit,\n },\n componentIds\n );\n });\n\n program\n .command('entries')\n .description('import entries')\n .argument(\n '[search phrase]',\n 'get entries with the search phrase, use quotes for multiple words'\n )\n .addOption(entryId)\n .addOption(zenql)\n .addOption(contentTypes)\n .addOption(assetTypes)\n .addOption(latest)\n .addOption(versionStatus)\n .addOption(commit)\n .option(\n '-preserve --preserve-guids',\n 'include this flag when you are importing entries that you have previously exported and wish to update'\n )\n .addOption(concurrency)\n .addOption(outputDetail)\n .addOption(ignoreErrors)\n .addOption(noCache)\n .addOption(noPublish)\n .addOption(saveEntries)\n .addHelpText(\n 'after',\n `\nExample call:\n > import entries --source-cms example-dev --source-project-id microsite --zenql \"sys.contentTypeId = blog\"\n > import entries --from-file myImportData.json --preserve-guids\n`\n )\n .action(async (search: string, opts, cmd) => {\n await cliCommand(\n ['import', 'entries'],\n opts,\n mapContensisOpts({ search, ...opts })\n ).ImportEntries({\n commit: opts.commit,\n fromFile: opts.fromFile,\n logOutput: opts.outputDetail,\n saveEntries: opts.saveEntries,\n });\n });\n\n // TODO: add options to import one an array of nodes? nodeIds: string[]\n program\n .command('nodes')\n .description('import nodes')\n .argument('[root]', 'import nodes from the specified path e.g. /blog', '/')\n .option(\n '-preserve --preserve-guids',\n 'include this flag when you are importing nodes that you have previously exported and wish to update'\n )\n .addOption(ignoreErrors)\n .addOption(commit)\n .addOption(\n new Option(\n '-od --output-detail <outputDetail>',\n 'how much detail to output from the import'\n )\n .choices(['errors', 'changes', 'all'])\n .default('errors')\n )\n .option(\n '-ol --output-limit <outputLimit>',\n 'expand or limit the number of records output to the console',\n '200'\n )\n .addHelpText(\n 'after',\n `\nExample call:\n > import nodes /blog --source-alias example-alias --source-project-id example-project\n > import nodes --from-file site-backup.json --preserve-guids\n`\n )\n .action(async (root: string, opts) => {\n await cliCommand(\n ['import', 'nodes'],\n opts,\n mapContensisOpts({ paths: root.split(' '), ...opts })\n ).ImportNodes({\n commit: opts.commit,\n fromFile: opts.fromFile,\n logOutput: opts.outputDetail,\n logLimit: Number(opts.outputLimit),\n });\n });\n\n program\n .command('taggroups')\n .description('import taggroups')\n .argument('[query]', 'apply a filter')\n .option('-i --id <ids...>', 'limit to the supplied tag group id(s)')\n .addOption(commit)\n .option(\n '-preserve --preserve-guids',\n 'include this flag when you are importing tags that you have previously exported and wish to update'\n )\n .addOption(concurrency)\n .addOption(ignoreErrors)\n .option(\n '--save',\n \"save the tag groups we're migrating instead of the migration preview (used with --output)\"\n )\n .addHelpText(\n 'after',\n `\n Example call:\n > import taggroups --source-cms example-dev --source-project-id microsite --zenql \"sys.contentTypeId = blog\"\n > import taggroups --from-file myImportData.json --preserve-guids\n `\n )\n .action(async (query: string, opts) => {\n await cliCommand(\n ['import', 'taggroups'],\n opts,\n mapContensisOpts(opts)\n ).ImportTagGroups({\n commit: opts.commit,\n fromFile: opts.fromFile,\n getBy: {\n id: opts.id?.length === 1 ? opts.id[0] : undefined,\n ids: opts.id?.length > 1 ? opts.id : undefined,\n q: query,\n },\n save: opts.save,\n });\n });\n\n program\n .command('tags')\n .description('import tags')\n .option('-in --group <groupId>', 'id of the tag group containing tags')\n .option('--label <label>', 'filter by tags that match this label')\n .option('-l --language <language>', 'find tags in the supplied language')\n .option('-i --id <ids...>', 'limit to the supplied tag group id(s)')\n .addOption(commit)\n .option(\n '-preserve --preserve-guids',\n 'include this flag when you are importing tags that you have previously exported and wish to update'\n )\n .addOption(concurrency)\n .addOption(ignoreErrors)\n .option(\n '--save',\n \"save the tags we're migrating instead of the migration preview (used with --output)\"\n )\n .addHelpText(\n 'after',\n `\n Example call:\n > import tags --source-cms example-dev --source-project-id microsite --group example\n > import tags --from-file myImportData.json --preserve-guids\n `\n )\n .action(async (opts) => {\n await cliCommand(\n ['import', 'tags'],\n opts,\n mapContensisOpts(opts)\n ).ImportTags({\n commit: opts.commit,\n fromFile: opts.fromFile,\n getBy: {\n groupId: opts.group,\n id: opts.id?.length === 1 ? opts.id[0] : undefined,\n ids: opts.id?.length > 1 ? opts.id : undefined,\n label: opts.label,\n language: opts.language,\n },\n save: opts.save,\n });\n });\n\n return program;\n};\n\nexport const get = makeImportCommand();\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAgC;AAChC,iCAA2B;AAC3B,2BAeO;AAEA,MAAM,oBAAoB,MAAM;AACrC,QAAM,UAAU,IAAI,yBAAQ,EACzB,QAAQ,QAAQ,EAChB,YAAY,gBAAgB,EAC5B,YAAY,SAAS;AAAA,CAAI,EACzB,mBAAmB,IAAI,EACvB,aAAa;AAEhB,UACG,QAAQ,QAAQ,EAChB,YAAY,gCAAgC,EAC5C,SAAS,iBAAiB,gDAAgD,EAC1E,UAAU,4BAAO,EACjB,UAAU,2BAAM,EAChB;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKF,EACC,OAAO,OAAO,UAAoB,SAAS;AAC1C,cAAM;AAAA,MACJ,CAAC,UAAU,UAAU,SAAS,KAAK,GAAG,CAAC;AAAA,MACvC;AAAA,UACA,uCAAiB,EAAE,UAAU,GAAG,KAAK,CAAC;AAAA,IACxC,EAAE,oBAAoB;AAAA,MACpB,UAAU,KAAK;AAAA,MACf,QAAQ,KAAK;AAAA,IACf,CAAC;AAAA,EACH,CAAC;AAEH,UACG,QAAQ,cAAc,EACtB,YAAY,sBAAsB,EAClC;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC,UAAU,2BAAM,EAChB;AAAA,IACC;AAAA,IACA;AAAA;AA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AA,EACH,CAAC;AAEH,SAAO;AACT;AAEO,MAAM,MAAM,kBAAkB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/commands/list.js
CHANGED
|
@@ -26,7 +26,7 @@ var import_ContensisCliService = require("../services/ContensisCliService");
|
|
|
26
26
|
var import_globalOptions = require("./globalOptions");
|
|
27
27
|
const makeListCommand = () => {
|
|
28
28
|
const list = new import_commander.Command().command("list").description("list command").addHelpText("after", `
|
|
29
|
-
`).showHelpAfterError(true).exitOverride();
|
|
29
|
+
`).showHelpAfterError(true).enablePositionalOptions().exitOverride();
|
|
30
30
|
list.command("envs").description("List all previously connected environments").addHelpText(
|
|
31
31
|
"after",
|
|
32
32
|
`
|
|
@@ -121,6 +121,52 @@ Example call:
|
|
|
121
121
|
).action(async (opts) => {
|
|
122
122
|
await (0, import_ContensisCliService.cliCommand)(["list", "roles"], opts).PrintRoles();
|
|
123
123
|
});
|
|
124
|
+
const tags = list.command("tags").description("print list of tags").argument("[label]", "filter by tags that match this label").passThroughOptions().option("-in --group <groupId>", "id of the tag group containing tags").option("-i --id <ids...>", "limit output to the supplied tag id(s)").option("-l --language <language>", "find tags in the supplied language").option("-d --dependents", "find and return tag groups for all found tags").addHelpText(
|
|
125
|
+
"after",
|
|
126
|
+
`
|
|
127
|
+
Example call:
|
|
128
|
+
> list tags
|
|
129
|
+
`
|
|
130
|
+
).action(async (label, opts) => {
|
|
131
|
+
var _a, _b;
|
|
132
|
+
await (0, import_ContensisCliService.cliCommand)(["list", "tags"], { ...opts, label }).PrintTags(
|
|
133
|
+
{
|
|
134
|
+
id: ((_a = opts.id) == null ? void 0 : _a.length) === 1 ? opts.id[0] : void 0,
|
|
135
|
+
ids: ((_b = opts.id) == null ? void 0 : _b.length) > 1 ? opts.id : void 0,
|
|
136
|
+
groupId: opts.group,
|
|
137
|
+
label,
|
|
138
|
+
language: opts.language
|
|
139
|
+
},
|
|
140
|
+
opts.dependents
|
|
141
|
+
);
|
|
142
|
+
});
|
|
143
|
+
tags.command("in").description("print list of tags in a group").argument("<groupId>", "id of the tag group containing tags").option("--label <label>", "filter by tags that match this label").option(
|
|
144
|
+
"-l --language <language>",
|
|
145
|
+
"find tags by a label in a specific language"
|
|
146
|
+
).addHelpText(
|
|
147
|
+
"after",
|
|
148
|
+
`
|
|
149
|
+
Example call:
|
|
150
|
+
> list tags in example
|
|
151
|
+
`
|
|
152
|
+
).action(async (groupId, opts) => {
|
|
153
|
+
await (0, import_ContensisCliService.cliCommand)(["list", "tags", "in"], {
|
|
154
|
+
...opts,
|
|
155
|
+
groupId
|
|
156
|
+
}).PrintTags({
|
|
157
|
+
...opts,
|
|
158
|
+
groupId
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
list.command("taggroups").description("print list of tag groups").argument("[query]", "filter tag groups").addHelpText(
|
|
162
|
+
"after",
|
|
163
|
+
`
|
|
164
|
+
Example call:
|
|
165
|
+
> list taggroups
|
|
166
|
+
`
|
|
167
|
+
).action(async (query, opts) => {
|
|
168
|
+
await (0, import_ContensisCliService.cliCommand)(["list", "taggroups"], opts).PrintTagGroups(query);
|
|
169
|
+
});
|
|
124
170
|
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", `
|
|
125
171
|
`).action(async (name, { id, ...opts } = {}) => {
|
|
126
172
|
await (0, import_ContensisCliService.cliCommand)(["list", "webhooks"], opts).PrintWebhookSubscriptions(
|
|
@@ -136,6 +182,7 @@ Example call:
|
|
|
136
182
|
).action(async (opts) => {
|
|
137
183
|
await (0, import_ContensisCliService.cliCommand)(["list", "workflows"], opts).PrintWorkflows();
|
|
138
184
|
});
|
|
185
|
+
(0, import_globalOptions.addGlobalOptions)(tags);
|
|
139
186
|
return list;
|
|
140
187
|
};
|
|
141
188
|
// 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/list.ts"],
|
|
4
|
-
"sourcesContent": ["import { Command } from 'commander';\nimport { cliCommand } from '~/services/ContensisCliService';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAwB;AACxB,iCAA2B;AAC3B,
|
|
4
|
+
"sourcesContent": ["import { Command } from 'commander';\nimport { cliCommand } from '~/services/ContensisCliService';\nimport {\n addGlobalOptions,\n exportOption,\n mapContensisOpts,\n noCache,\n} from './globalOptions';\n\nexport const makeListCommand = () => {\n const list = new Command()\n .command('list')\n .description('list command')\n .addHelpText('after', `\\n`)\n .showHelpAfterError(true)\n .enablePositionalOptions()\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(async opts => {\n await cliCommand(['list', 'envs'], opts).PrintEnvironments();\n });\n\n list\n .command('projects')\n .description('print list of projects')\n .addHelpText(\n 'after',\n `\nExample call:\n > list projects\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'projects'], opts).PrintProjects();\n });\n\n list\n .command('models')\n .description('print list of content models')\n .addOption(exportOption)\n .addOption(noCache)\n .addHelpText(\n 'after',\n `\nExample call:\n > list models\n`\n )\n .action(async opts => {\n await cliCommand(\n ['list', 'models'],\n opts,\n mapContensisOpts(opts)\n ).PrintContentModels([], opts);\n });\n\n list\n .command('contenttypes')\n .description('print list of content types')\n .addHelpText(\n 'after',\n `\nExample call:\n > list contenttypes -o ./output.json -f json\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'contenttypes'], opts).PrintContentTypes();\n });\n\n list\n .command('components')\n .description('print list of components')\n .addHelpText(\n 'after',\n `\nExample call:\n > list components -o ./output.json -f json\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'components'], opts).PrintComponents();\n });\n\n list\n .command('blocks')\n .description('print list of content blocks')\n .addHelpText(\n 'after',\n `\nExample call:\n > list blocks\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'blocks'], opts).PrintBlocks();\n });\n\n list\n .command('keys')\n .description('print list of API keys')\n .addHelpText(\n 'after',\n `\nExample call:\n > list keys\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'keys'], opts).PrintApiKeys();\n });\n\n list\n .command('proxies')\n .description('print list of proxies')\n .addHelpText(\n 'after',\n `\nExample call:\n > list proxies\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'proxies'], opts).PrintProxies();\n });\n\n list\n .command('renderers')\n .description('print list of renderers')\n .addHelpText(\n 'after',\n `\nExample call:\n > list renderers\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'renderers'], opts).PrintRenderers();\n });\n\n list\n .command('roles')\n .description('print list of roles')\n .addHelpText(\n 'after',\n `\nExample call:\n > list roles\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'roles'], opts).PrintRoles();\n });\n\n const tags = list\n .command('tags')\n .description('print list of tags')\n .argument('[label]', 'filter by tags that match this label')\n .passThroughOptions()\n .option('-in --group <groupId>', 'id of the tag group containing tags')\n .option('-i --id <ids...>', 'limit output to the supplied tag id(s)')\n .option('-l --language <language>', 'find tags in the supplied language')\n .option('-d --dependents', 'find and return tag groups for all found tags')\n .addHelpText(\n 'after',\n `\n Example call:\n > list tags\n `\n )\n .action(async (label, opts) => {\n await cliCommand(['list', 'tags'], { ...opts, label }).PrintTags(\n {\n id: opts.id?.length === 1 ? opts.id[0] : undefined,\n ids: opts.id?.length > 1 ? opts.id : undefined,\n groupId: opts.group,\n label,\n language: opts.language,\n },\n opts.dependents\n );\n });\n\n tags\n .command('in')\n .description('print list of tags in a group')\n .argument('<groupId>', 'id of the tag group containing tags')\n .option('--label <label>', 'filter by tags that match this label')\n .option(\n '-l --language <language>',\n 'find tags by a label in a specific language'\n )\n .addHelpText(\n 'after',\n `\n Example call:\n > list tags in example\n `\n )\n .action(async (groupId: string, opts) => {\n await cliCommand(['list', 'tags', 'in'], {\n ...opts,\n groupId,\n }).PrintTags({\n ...opts,\n groupId,\n });\n });\n\n list\n .command('taggroups')\n .description('print list of tag groups')\n .argument('[query]', 'filter tag groups')\n .addHelpText(\n 'after',\n `\n Example call:\n > list taggroups\n `\n )\n .action(async (query, opts) => {\n await cliCommand(['list', 'taggroups'], opts).PrintTagGroups(query);\n });\n\n list\n .command('webhooks')\n .description('print list of webhooks')\n .argument('[name]', 'find webhooks matching the supplied name')\n .option('-i --id <id...>', 'the subscription id(s) to get')\n .addHelpText('after', `\\n`)\n .action(async (name?: string, { id, ...opts }: any = {}) => {\n await cliCommand(['list', 'webhooks'], opts).PrintWebhookSubscriptions(\n name ? [name] : id\n );\n });\n\n list\n .command('workflows')\n .description('print list of workflow definitions')\n .addHelpText(\n 'after',\n `\nExample call:\n > list workflows\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'workflows'], opts).PrintWorkflows();\n });\n\n // Add global opts for inner sub-commands\n addGlobalOptions(tags);\n\n return list;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAwB;AACxB,iCAA2B;AAC3B,2BAKO;AAEA,MAAM,kBAAkB,MAAM;AACnC,QAAM,OAAO,IAAI,yBAAQ,EACtB,QAAQ,MAAM,EACd,YAAY,cAAc,EAC1B,YAAY,SAAS;AAAA,CAAI,EACzB,mBAAmB,IAAI,EACvB,wBAAwB,EACxB,aAAa;AAEhB,OACG,QAAQ,MAAM,EACd,YAAY,4CAA4C,EACxD;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,EAIF,EACC,OAAO,OAAM,SAAQ;AACpB,cAAM,uCAAW,CAAC,QAAQ,MAAM,GAAG,IAAI,EAAE,kBAAkB;AAAA,EAC7D,CAAC;AAEH,OACG,QAAQ,UAAU,EAClB,YAAY,wBAAwB,EACpC;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,EAIF,EACC,OAAO,OAAM,SAAQ;AACpB,cAAM,uCAAW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
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/commands/remove.js
CHANGED
|
@@ -28,7 +28,7 @@ var import_logger = require("../util/logger");
|
|
|
28
28
|
var import_globalOptions = require("./globalOptions");
|
|
29
29
|
const makeRemoveCommand = () => {
|
|
30
30
|
const remove = new import_commander.Command().command("remove").description("remove command").addHelpText("after", `
|
|
31
|
-
`).showHelpAfterError(true).exitOverride();
|
|
31
|
+
`).showHelpAfterError(true).enablePositionalOptions().exitOverride();
|
|
32
32
|
remove.command("env").description("Remove a previously connected environment from the CLI").argument("<alias>", "the Contensis Cloud alias to remove").usage("<alias>").addHelpText(
|
|
33
33
|
"after",
|
|
34
34
|
`
|
|
@@ -135,6 +135,55 @@ Example call:
|
|
|
135
135
|
(0, import_globalOptions.mapContensisOpts)({ paths: root.split(" "), ...opts })
|
|
136
136
|
).RemoveNodes(opts.commit);
|
|
137
137
|
});
|
|
138
|
+
remove.command("taggroup").description("delete an unused tag group").argument("<groupId>", "id of the tag group to remove").addOption(import_globalOptions.commit).addHelpText(
|
|
139
|
+
"after",
|
|
140
|
+
`
|
|
141
|
+
Example call:
|
|
142
|
+
> remove taggroup example
|
|
143
|
+
`
|
|
144
|
+
).action(async (groupId, opts) => {
|
|
145
|
+
await (0, import_ContensisCliService.cliCommand)(["remove", "taggroup", groupId], opts).RemoveTagGroup(
|
|
146
|
+
groupId,
|
|
147
|
+
opts.commit
|
|
148
|
+
);
|
|
149
|
+
});
|
|
150
|
+
const tags = remove.command("tags").description("delete unused tags").passThroughOptions().argument("[ids...]", "id(s) of the tag(s) to remove").option("--all", "delete all tags").addOption(import_globalOptions.commit).addHelpText(
|
|
151
|
+
"after",
|
|
152
|
+
`
|
|
153
|
+
Example call:
|
|
154
|
+
> remove tags d4267b35-0d25-41ae-bce9-eeb490c793f4 90a11d09-3727-45c2-a0df-86f1865828ab
|
|
155
|
+
> remove tags --all
|
|
156
|
+
|
|
157
|
+
`
|
|
158
|
+
).action(async (ids, opts, cmd) => {
|
|
159
|
+
if ((!ids || !ids.length) && !opts.all)
|
|
160
|
+
cmd.error("Missing one of the required options");
|
|
161
|
+
await (0, import_ContensisCliService.cliCommand)(["remove", "tags", ...ids], opts).RemoveTags(
|
|
162
|
+
{ ids: ids.length ? ids : void 0 },
|
|
163
|
+
opts.commit
|
|
164
|
+
);
|
|
165
|
+
});
|
|
166
|
+
tags.command("in").description("delete unused tags in a specific tag group").showHelpAfterError(true).argument("<groupId>", "id of the tag group containing tags").option("--all", "delete all tags in this group").option("--label <label>", "delete tags that match this label").option(
|
|
167
|
+
"-l --language <language>",
|
|
168
|
+
"delete tags by a label in a specific language"
|
|
169
|
+
).addOption(import_globalOptions.commit).addHelpText(
|
|
170
|
+
"after",
|
|
171
|
+
`
|
|
172
|
+
Example call:
|
|
173
|
+
> remove tags in example --label Test
|
|
174
|
+
> remove tags in example --all
|
|
175
|
+
|
|
176
|
+
`
|
|
177
|
+
).action(async (groupId, opts, cmd) => {
|
|
178
|
+
const parentOptions = cmd.optsWithGlobals();
|
|
179
|
+
if (!parentOptions.all && !opts.label)
|
|
180
|
+
cmd.error("Missing one of the required options");
|
|
181
|
+
await (0, import_ContensisCliService.cliCommand)(["remove", "tags", "in", groupId], opts).RemoveTags(
|
|
182
|
+
{ groupId, ...opts, ...parentOptions },
|
|
183
|
+
parentOptions.commit
|
|
184
|
+
);
|
|
185
|
+
});
|
|
186
|
+
(0, import_globalOptions.addGlobalOptions)(tags);
|
|
138
187
|
return remove;
|
|
139
188
|
};
|
|
140
189
|
// 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 { Logger } from '~/util/logger';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAwB;AACxB,iCAA2B;AAC3B,mBAAsB;AACtB,oBAAuB;AACvB,
|
|
4
|
+
"sourcesContent": ["import { Command } from 'commander';\nimport { cliCommand } from '~/services/ContensisCliService';\nimport { shell } from '~/shell';\nimport { Logger } from '~/util/logger';\nimport {\n addGlobalOptions,\n commit,\n mapContensisOpts,\n zenql,\n} 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 .enablePositionalOptions()\n .exitOverride();\n\n remove\n .command('env')\n .description('Remove a previously connected environment from the CLI')\n .argument('<alias>', 'the Contensis Cloud alias to remove')\n .usage('<alias>')\n .addHelpText(\n 'after',\n `\nExample call:\n > remove env ludlow-uni-dev\n`\n )\n .action(async (alias: string, opts) => {\n const currentEnvironment = await cliCommand(\n ['remove', 'env', alias],\n opts\n ).RemoveEnvironment(alias);\n if (!currentEnvironment) await shell().restart();\n });\n\n remove\n .command('project')\n .description('remove an entire project')\n .argument('<projectId>', 'the project id to delete')\n .usage('<projectId>')\n .addHelpText('after', `\\n`)\n .action(async (projectId, opts) => {\n const project = await cliCommand(\n ['remove', 'project', projectId],\n opts\n ).SetProject(projectId);\n if (project) await shell().restart();\n });\n\n remove\n .command('key')\n .description('remove api key')\n .argument('<id>', 'the id of the API key to delete')\n .usage('<id>')\n .addHelpText(\n 'after',\n `\nExample call:\n > remove key 4ceb9575-28d3-4d5b-a77b-5e5221e603dd\n`\n )\n .action(async (id, opts) => {\n await cliCommand(['remove', 'key', id], opts).RemoveApiKey(id);\n });\n\n remove\n .command('role')\n .description('remove a role')\n .argument('<\"Role name\" or id>', 'the existing role name or id to delete')\n .addHelpText(\n 'after',\n `\nExample call:\n > remove role \"My role\"\\n`\n )\n .action(async (roleNameOrId: string, opts) => {\n await cliCommand(['remove', 'role', roleNameOrId], opts).RemoveRole(\n roleNameOrId\n );\n });\n\n remove\n .command('components')\n .description('delete components')\n .argument('<id...>', 'the id(s) of the components to delete')\n .addOption(commit)\n .usage('<id> [--commit]')\n .addHelpText(\n 'after',\n `\nExample call:\n > remove components addressComponent\n`\n )\n .action(async (id: string[], opts) => {\n await cliCommand(\n ['remove', 'components', id.join(' ')],\n opts\n ).RemoveComponents(id, opts.commit);\n });\n\n remove\n .command('contenttypes')\n .description('delete content types')\n .argument('<id...>', 'the id(s) of the content types to delete')\n .addOption(commit)\n .usage('<id> [--commit]')\n .addHelpText(\n 'after',\n `\nExample call:\n > remove contenttypes blogPost\n`\n )\n .action(async (id: string[], opts) => {\n await cliCommand(\n ['remove', 'contenttypes', id.join(' ')],\n opts\n ).RemoveContentTypes(id, opts.commit);\n });\n\n const removeEntries = remove\n .command('entries')\n .description('delete entries')\n .argument(\n '[ids...]',\n 'the entry id(s) to delete ...or add *** if you wish to delete all entries in all content types'\n )\n .addOption(zenql)\n .addOption(commit)\n .addHelpText(\n 'after',\n `\nExample call:\n > remove entries a1c25591-8c9b-50e2-96d8-f6c774fcf023 8df914cc-1da1-59d6-86e0-8ea4ebd99aaa\n > remove entries --zenql \"sys.contentTypeId = test\"\n`\n )\n .action(async (entryIds: string[], opts) => {\n const removeAll = entryIds?.[0] === '***';\n\n // Remove all asterisks from args\n if (entryIds?.[0] && !entryIds[0].replace(/\\*/g, '')) entryIds.pop();\n\n const hasArgs = !!(entryIds?.length || opts.zenql || removeAll);\n if (!hasArgs) {\n Logger.help(\n `Not enough arguments supplied\\n\\n${removeEntries.helpInformation()}`\n );\n } else {\n await cliCommand(\n ['remove', 'entries', entryIds.join(' ')],\n opts,\n mapContensisOpts({ entryIds, ...opts })\n ).RemoveEntries(opts.commit);\n }\n });\n\n remove\n .command('nodes')\n .description('delete nodes from the site view tree')\n .argument('<root>', 'remove nodes from the specified path e.g. /blog or /')\n .addOption(commit)\n .addHelpText(\n 'after',\n `\nExample call:\n > remove nodes /blog\n`\n )\n .action(async (root: string, opts) => {\n await cliCommand(\n ['remove', 'nodes', root],\n opts,\n mapContensisOpts({ paths: root.split(' '), ...opts })\n ).RemoveNodes(opts.commit);\n });\n\n remove\n .command('taggroup')\n .description('delete an unused tag group')\n .argument('<groupId>', 'id of the tag group to remove')\n .addOption(commit)\n .addHelpText(\n 'after',\n `\n Example call:\n > remove taggroup example\n `\n )\n .action(async (groupId: string, opts) => {\n await cliCommand(['remove', 'taggroup', groupId], opts).RemoveTagGroup(\n groupId,\n opts.commit\n );\n });\n\n const tags = remove\n .command('tags')\n .description('delete unused tags')\n .passThroughOptions()\n .argument('[ids...]', 'id(s) of the tag(s) to remove')\n .option('--all', 'delete all tags')\n .addOption(commit)\n .addHelpText(\n 'after',\n `\n Example call:\n > remove tags d4267b35-0d25-41ae-bce9-eeb490c793f4 90a11d09-3727-45c2-a0df-86f1865828ab\n > remove tags --all\n\n `\n )\n .action(async (ids: string[], opts, cmd: Command) => {\n if ((!ids || !ids.length) && !opts.all)\n cmd.error('Missing one of the required options');\n\n await cliCommand(['remove', 'tags', ...ids], opts).RemoveTags(\n { ids: ids.length ? ids : undefined },\n opts.commit\n );\n });\n\n tags\n .command('in')\n .description('delete unused tags in a specific tag group')\n .showHelpAfterError(true)\n .argument('<groupId>', 'id of the tag group containing tags')\n .option('--all', 'delete all tags in this group')\n .option('--label <label>', 'delete tags that match this label')\n .option(\n '-l --language <language>',\n 'delete tags by a label in a specific language'\n )\n .addOption(commit)\n .addHelpText(\n 'after',\n `\n Example call:\n > remove tags in example --label Test\n > remove tags in example --all\n\n `\n )\n .action(async (groupId: string, opts, cmd: Command) => {\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 if (!parentOptions.all && !opts.label)\n cmd.error('Missing one of the required options');\n\n await cliCommand(['remove', 'tags', 'in', groupId], opts).RemoveTags(\n { groupId, ...opts, ...parentOptions },\n parentOptions.commit\n );\n });\n\n // Add global opts for inner sub-commands\n addG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,+BAA+B,EACpD,OAAO,SAAS,iBAAiB,EACjC,UAAU,2BAAM,EAChB;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMF,EACC,OAAO,OAAO,KAAe,MAAM,QAAiB;AACnD,SAAK,CAAC,OAAO,CAAC,IAAI,WAAW,CAAC,KAAK;AACjC,UAAI,MAAM,qCAAqC;AAEjD,cAAM,uCAAW,CAAC,UAAU,QAAQ,GAAG,GAAG,GAAG,IAAI,EAAE;AAAA,MACjD,EAAE,KAAK,IAAI,SAAS,MAAM,OAAU;AAAA,MACpC,KAAK;AAAA,IACP;AAAA,EACF,CAAC;AAEH,OACG,QAAQ,IAAI,EACZ,YAAY,4CAA4C,EACxD,mBAAmB,IAAI,EACvB,SAAS,aAAa,qCAAqC,EAC3D,OAAO,SAAS,+BAA+B,EAC/C,OAAO,mBAAmB,mCAAmC,EAC7D;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC,UAAU,2BAAM,EAChB;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMF,EACC,OAAO,OAAO,SAAiB,MAAM,QAAiB;AAIrD,UAAM,gBAAgB,IAAI,gBAAgB;AAE1C,QAAI,CAAC,cAAc,OAAO,CAAC,KAAK;AAC9B,UAAI,MAAM,qCAAqC;AAEjD,cAAM,uCAAW,CAAC,UAAU,QAAQ,MAAM,OAAO,GAAG,IAAI,EAAE;AAAA,MACxD,EAAE,SAAS,GAAG,MAAM,GAAG,cAAc;AAAA,MACrC,cAAc;AAAA,IAChB;AAAA,EACF,CAAC;AAGH,6CAAiB,IAAI;AAErB,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -128,8 +128,10 @@ ${import_logger.Logger.errorText(">>")} Available commands:`,
|
|
|
128
128
|
failedUpdate: (env, id) => `[${env}] Unable to update project ${import_logger.Logger.highlightText(id)}`
|
|
129
129
|
},
|
|
130
130
|
migrate: {
|
|
131
|
+
commitTip: () => `Add --commit flag to commit the previewed changes`,
|
|
131
132
|
preview: (verb = "IMPORT") => `\u{1F50D} ${verb} PREVIEW \u{1F52D}`,
|
|
132
133
|
commit: (verb = "IMPORT") => `COMMITTING ${verb} \u2728\u2604\uFE0F `,
|
|
134
|
+
imported: (env, commit, entities) => `${commit ? `Imported` : `Will import`} ${Object.entries(entities).map(([noun, count]) => (0, import_pluralize.default)(noun, count, true)).join(" and ")} into ${env} environment`,
|
|
133
135
|
models: {
|
|
134
136
|
result: (status) => {
|
|
135
137
|
switch (status) {
|
|
@@ -167,11 +169,7 @@ ${import_logger.Logger.errorText(">>")} Available commands:`,
|
|
|
167
169
|
failedGet: (projectId, id) => `[${projectId}] Unable to get content models ${import_logger.Logger.highlightText(id)}`
|
|
168
170
|
},
|
|
169
171
|
nodes: {
|
|
170
|
-
imported: (env, commit, count) =>
|
|
171
|
-
"node",
|
|
172
|
-
count,
|
|
173
|
-
true
|
|
174
|
-
)}`,
|
|
172
|
+
imported: (env, commit, count) => LogMessages.migrate.imported(env, commit, { node: count }),
|
|
175
173
|
failedImport: (env) => `[${env}] Unable to import nodes`,
|
|
176
174
|
removed: (env, commit, root) => `[${env}] ${commit ? `Deleted` : `Will delete`} nodes at ${root}`,
|
|
177
175
|
failedRemove: (env) => `[${env}] Unable to delete nodes`,
|
|
@@ -204,7 +202,10 @@ ${import_logger.Logger.errorText(">>")} Available commands:`,
|
|
|
204
202
|
noEnv: () => `No Contensis environment set, connect to your Contensis cloud instance using "contensis connect {cms alias}"`
|
|
205
203
|
},
|
|
206
204
|
entries: {
|
|
207
|
-
imported: (env, commit, entries, nodes = 0) =>
|
|
205
|
+
imported: (env, commit, entries, nodes = 0) => LogMessages.migrate.imported(env, commit, {
|
|
206
|
+
entry: entries,
|
|
207
|
+
node: nodes
|
|
208
|
+
}),
|
|
208
209
|
failedImport: (env) => `[${env}] Unable to import entries`,
|
|
209
210
|
update: {
|
|
210
211
|
preview: () => LogMessages.migrate.preview("UPDATE FIELD"),
|
|
@@ -214,8 +215,7 @@ ${import_logger.Logger.errorText(">>")} Available commands:`,
|
|
|
214
215
|
},
|
|
215
216
|
removed: (env, commit) => `[${env}] ${commit ? `Deleted` : `Will delete`} entries`,
|
|
216
217
|
failedRemove: (env) => `[${env}] Unable to delete entries`,
|
|
217
|
-
notFound: (env) => `[${env}] Entries were not found
|
|
218
|
-
commitTip: () => `Add --commit flag to commit the previewed changes`
|
|
218
|
+
notFound: (env) => `[${env}] Entries were not found`
|
|
219
219
|
},
|
|
220
220
|
keys: {
|
|
221
221
|
list: (env) => `[${env}] API keys:`,
|
|
@@ -303,6 +303,36 @@ ${import_logger.Logger.errorText(">>")} Available commands:`,
|
|
|
303
303
|
`,
|
|
304
304
|
failedRemove: (env, id) => `[${env}] Unable to delete role ${import_logger.Logger.highlightText(id)}`
|
|
305
305
|
},
|
|
306
|
+
taggroups: {
|
|
307
|
+
list: (env, length) => `[${env}] Retrieved ${(0, import_pluralize.default)("tag group", length, true)}`,
|
|
308
|
+
noList: (env) => `[${env}] Cannot retrieve tag groups`,
|
|
309
|
+
noneExist: () => `Create a tag group with "create taggroup <name>"`,
|
|
310
|
+
imported: (env, commit, groups, tags) => LogMessages.migrate.imported(env, commit, {
|
|
311
|
+
"tag group": groups,
|
|
312
|
+
tag: tags
|
|
313
|
+
}),
|
|
314
|
+
failedGet: (env, name) => `[${env}] Unable to find a tag group ${import_logger.Logger.highlightText(name)}`,
|
|
315
|
+
created: (env, name) => `[${env}] Created tag group ${import_logger.Logger.highlightText(name)}
|
|
316
|
+
`,
|
|
317
|
+
tip: () => `Give access to your role with "set role assignments", allow your role to do things with "set role permissions"`,
|
|
318
|
+
failedCreate: (env, name) => `[${env}] Unable to create ${name ? `tag group ${import_logger.Logger.highlightText(name)}` : "tag groups"}`,
|
|
319
|
+
removed: (env, id, commit) => `[${env}] ${commit ? `Deleted` : `Will delete`} tag group ${import_logger.Logger.highlightText(id)}
|
|
320
|
+
`,
|
|
321
|
+
failedRemove: (env, id) => `[${env}] Unable to delete tag group ${import_logger.Logger.highlightText(id)}`
|
|
322
|
+
},
|
|
323
|
+
tags: {
|
|
324
|
+
list: (env, length) => `[${env}] Retrieved ${(0, import_pluralize.default)("tag", length, true)}`,
|
|
325
|
+
noList: (env) => `[${env}] Cannot retrieve tags`,
|
|
326
|
+
noneExist: () => `Create a tag with "create tag in <groupId> <tag label(s)...>"`,
|
|
327
|
+
imported: (env, commit, tags) => LogMessages.migrate.imported(env, commit, { tag: tags }),
|
|
328
|
+
failedGet: (env) => `[${env}] Unable to find tags`,
|
|
329
|
+
created: (env, name) => `[${env}] Created tag ${import_logger.Logger.highlightText(name)}
|
|
330
|
+
`,
|
|
331
|
+
failedCreate: (env, name) => `[${env}] Unable to create ${name ? `tag ${import_logger.Logger.highlightText(name)}` : "tags"}`,
|
|
332
|
+
removed: (env, length, commit) => `[${env}] ${!length ? "No tags to delete" : `${commit ? `Deleted` : `Will delete`} ${(0, import_pluralize.default)("tag", length, true)}
|
|
333
|
+
`}`,
|
|
334
|
+
failedRemove: (env, length) => `[${env}] Unable to delete tags with ${(0, import_pluralize.default)("error", length)}`
|
|
335
|
+
},
|
|
306
336
|
blocks: {
|
|
307
337
|
runningStatus: (status) => {
|
|
308
338
|
switch (status) {
|