contensis-cli 1.1.1-beta.0 → 1.1.1-beta.10
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 +1 -1
- package/dist/commands/import.js +1 -0
- package/dist/commands/import.js.map +2 -2
- package/dist/commands/list.js +2 -2
- package/dist/commands/list.js.map +2 -2
- package/dist/providers/file-provider.js +52 -17
- package/dist/providers/file-provider.js.map +2 -2
- package/dist/services/ContensisCliService.js +49 -49
- package/dist/services/ContensisCliService.js.map +2 -2
- package/dist/shell.js.map +1 -1
- package/dist/util/csv.formatter.js +69 -6
- package/dist/util/csv.formatter.js.map +2 -2
- package/dist/util/json.formatter.js +5 -2
- package/dist/util/json.formatter.js.map +2 -2
- package/dist/util/xml.formatter.js +10 -3
- package/dist/util/xml.formatter.js.map +2 -2
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +1 -2
- package/src/commands/import.ts +1 -0
- package/src/commands/list.ts +2 -2
- package/src/providers/file-provider.ts +60 -12
- package/src/services/ContensisCliService.ts +58 -53
- package/src/shell.ts +1 -1
- package/src/util/csv.formatter.ts +75 -6
- package/src/util/json.formatter.ts +4 -0
- package/src/util/xml.formatter.ts +7 -1
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
package/dist/commands/import.js
CHANGED
|
@@ -109,6 +109,7 @@ Example call:
|
|
|
109
109
|
`
|
|
110
110
|
Example call:
|
|
111
111
|
> import entries --source-cms example-dev --source-project-id microsite --zenql "sys.contentTypeId = blog"
|
|
112
|
+
> import entries --from-file myImportData.json --preserve-guids
|
|
112
113
|
`
|
|
113
114
|
).action(async (phrase, opts, cmd) => {
|
|
114
115
|
await (0, import_ContensisCliService.cliCommand)(
|
|
@@ -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 commit,\n getEntryOptions,\n ignoreErrors,\n mapContensisOpts,\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(commit)\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 getEntryOptions(\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 )\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(\n new Option(\n '-oe --output-entries <outputEntries>',\n 'which details of the entries included in the import to output'\n )\n .choices(['errors', 'changes', 'all'])\n .default('errors')\n )\n .addOption(ignoreErrors)\n .addHelpText(\n 'after',\n `\nExample call:\n > import entries --source-cms example-dev --source-project-id microsite --zenql \"sys.contentTypeId = blog\"\n`\n )\n .action(async (phrase: string, opts, cmd) => {\n await cliCommand(\n ['import', 'entries'],\n opts,\n mapContensisOpts({ phrase, ...opts })\n ).ImportEntries({\n commit: opts.commit,\n fromFile: opts.fromFile,\n logOutput: opts.outputEntries,\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;AACh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wB,SAAS;AAC9C,cAAM;AAAA,MACJ,CAAC,UAAU,WAAW;AAAA,MACtB;AAAA,UACA,uCAAiB,EAAE,cAAc,GAAG,KAAK,CAAC;AAAA,IAC5C,EAAE;AAAA,MACA;AAAA,QACE,UAAU,KAAK;AAAA,QACf,QAAQ,KAAK;AAAA,MACf;AAAA,MACA;AAAA,IACF;AAAA,EACF,CAAC;AAEH;AAAA,IACE,QACG,QAAQ,SAAS,EACjB,YAAY,gBAAgB,EAC5B;AAAA,MACC;AAAA,MACA;AAAA,IACF;AAAA,EACJ,EACG,UAAU,2BAAM,EAChB;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC,IAAI;AAAA,MACF;AAAA,MACA;AAAA,IACF,EACG,QAAQ,CAAC,UAAU,WAAW,KAAK,CAAC,EACpC,QAAQ,QAAQ;AAAA,EACrB,EACC,UAAU,iCAAY,EACtB;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,
|
|
4
|
+
"sourcesContent": ["import { Command, Option } from 'commander';\nimport { cliCommand } from '~/services/ContensisCliService';\nimport {\n commit,\n getEntryOptions,\n ignoreErrors,\n mapContensisOpts,\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(commit)\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 getEntryOptions(\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 )\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(\n new Option(\n '-oe --output-entries <outputEntries>',\n 'which details of the entries included in the import to output'\n )\n .choices(['errors', 'changes', 'all'])\n .default('errors')\n )\n .addOption(ignoreErrors)\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 (phrase: string, opts, cmd) => {\n await cliCommand(\n ['import', 'entries'],\n opts,\n mapContensisOpts({ phrase, ...opts })\n ).ImportEntries({\n commit: opts.commit,\n fromFile: opts.fromFile,\n logOutput: opts.outputEntries,\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,2BAKO;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,2BAAM,EAChB;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,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tB;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKF,EACC,OAAO,OAAO,QAAgB,MAAM,QAAQ;AAC3C,cAAM;AAAA,MACJ,CAAC,UAAU,SAAS;AAAA,MACpB;AAAA,UACA,uCAAiB,EAAE,QAAQ,GAAG,KAAK,CAAC;AAAA,IACtC,EAAE,cAAc;AAAA,MACd,QAAQ,KAAK;AAAA,MACb,UAAU,KAAK;AAAA,MACf,WAAW,KAAK;AAAA,IAClB,CAAC;AAAA,EACH,CAAC;AAGH,UACG,QAAQ,OAAO,EACf,YAAY,cAAc,EAC1B,SAAS,UAAU,mDAAmD,GAAG,EACzE;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC,UAAU,iCAAY,EACtB,UAAU,2BAAM,EAChB;AAAA,IACC,IAAI;AAAA,MACF;AAAA,MACA;AAAA,IACF,EACG,QAAQ,CAAC,UAAU,WAAW,KAAK,CAAC,EACpC,QAAQ,QAAQ;AAAA,EACrB,EACC;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKF,EACC,OAAO,OAAO,MAAc,SAAS;AACpC,cAAM;AAAA,MACJ,CAAC,UAAU,OAAO;AAAA,MAClB;AAAA,UACA,uCAAiB,EAAE,OAAO,KAAK,MAAM,GAAG,GAAG,GAAG,KAAK,CAAC;AAAA,IACtD,EAAE,YAAY;AAAA,MACZ,QAAQ,KAAK;AAAA,MACb,UAAU,KAAK;AAAA,MACf,WAAW,KAAK;AAAA,MAChB,UAAU,OAAO,KAAK,WAAW;AAAA,IACnC,CAAC;AAAA,EACH,CAAC;AAEH,SAAO;AACT;AAEO,MAAM,MAAM,kBAAkB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/commands/list.js
CHANGED
|
@@ -32,8 +32,8 @@ const makeListCommand = () => {
|
|
|
32
32
|
Example call:
|
|
33
33
|
> list envs
|
|
34
34
|
`
|
|
35
|
-
).action((opts) => {
|
|
36
|
-
(0, import_ContensisCliService.cliCommand)(["list", "envs"], opts).PrintEnvironments();
|
|
35
|
+
).action(async (opts) => {
|
|
36
|
+
await (0, import_ContensisCliService.cliCommand)(["list", "envs"], opts).PrintEnvironments();
|
|
37
37
|
});
|
|
38
38
|
list.command("projects").description("print list of projects").addHelpText(
|
|
39
39
|
"after",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/commands/list.ts"],
|
|
4
|
-
"sourcesContent": ["import { Command } from 'commander';\nimport { cliCommand } from '~/services/ContensisCliService';\n\nexport const makeListCommand = () => {\n const list = new Command()\n .command('list')\n .description('list command')\n .addHelpText('after', `\\n`)\n .showHelpAfterError(true)\n .exitOverride();\n\n list\n .command('envs')\n .description('List all previously connected environments')\n .addHelpText(\n 'after',\n `\nExample call:\n > list envs\n`\n )\n .action(opts => {\n cliCommand(['list', 'envs'], opts).PrintEnvironments();\n });\n\n list\n .command('projects')\n .description('print list of projects')\n .addHelpText(\n 'after',\n `\nExample call:\n > list projects\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'projects'], opts).PrintProjects();\n });\n\n list\n .command('models')\n .description('print list of content models')\n .addHelpText(\n 'after',\n `\nExample call:\n > list models\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'models'], opts).PrintContentModels();\n });\n\n list\n .command('contenttypes')\n .description('print list of content types')\n .addHelpText(\n 'after',\n `\nExample call:\n > list contenttypes -o ./output.json -f json\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'contenttypes'], opts).PrintContentTypes();\n });\n\n list\n .command('components')\n .description('print list of components')\n .addHelpText(\n 'after',\n `\nExample call:\n > list components -o ./output.json -f json\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'components'], opts).PrintComponents();\n });\n\n list\n .command('blocks')\n .description('print list of content blocks')\n .addHelpText(\n 'after',\n `\nExample call:\n > list blocks\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'blocks'], opts).PrintBlocks();\n });\n\n list\n .command('keys')\n .description('print list of API keys')\n .addHelpText(\n 'after',\n `\nExample call:\n > list keys\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'keys'], opts).PrintApiKeys();\n });\n\n list\n .command('proxies')\n .description('print list of proxies')\n .addHelpText(\n 'after',\n `\nExample call:\n > list proxies\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'proxies'], opts).PrintProxies();\n });\n\n list\n .command('renderers')\n .description('print list of renderers')\n .addHelpText(\n 'after',\n `\nExample call:\n > list renderers\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'renderers'], opts).PrintRenderers();\n });\n\n list\n .command('roles')\n .description('print list of roles')\n .addHelpText(\n 'after',\n `\nExample call:\n > list roles\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'roles'], opts).PrintRoles();\n });\n\n list\n .command('webhooks')\n .description('print list of webhooks')\n .argument('[name]', 'find webhooks matching the supplied name')\n .option('-i --id <id...>', 'the subscription id(s) to get')\n .addHelpText('after', `\\n`)\n .action(async (name?: string, { id, ...opts }: any = {}) => {\n await cliCommand(['list', 'webhooks'], opts).PrintWebhookSubscriptions(\n name ? [name] : id\n );\n });\n\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 return list;\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAwB;AACxB,iCAA2B;AAEpB,MAAM,kBAAkB,MAAM;AACnC,QAAM,OAAO,IAAI,yBAAQ,EACtB,QAAQ,MAAM,EACd,YAAY,cAAc,EAC1B,YAAY,SAAS;AAAA,CAAI,EACzB,mBAAmB,IAAI,EACvB,aAAa;AAEhB,OACG,QAAQ,MAAM,EACd,YAAY,4CAA4C,EACxD;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,EAIF,EACC,OAAO,
|
|
4
|
+
"sourcesContent": ["import { Command } from 'commander';\nimport { cliCommand } from '~/services/ContensisCliService';\n\nexport const makeListCommand = () => {\n const list = new Command()\n .command('list')\n .description('list command')\n .addHelpText('after', `\\n`)\n .showHelpAfterError(true)\n .exitOverride();\n\n list\n .command('envs')\n .description('List all previously connected environments')\n .addHelpText(\n 'after',\n `\nExample call:\n > list envs\n`\n )\n .action(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 .addHelpText(\n 'after',\n `\nExample call:\n > list models\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'models'], opts).PrintContentModels();\n });\n\n list\n .command('contenttypes')\n .description('print list of content types')\n .addHelpText(\n 'after',\n `\nExample call:\n > list contenttypes -o ./output.json -f json\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'contenttypes'], opts).PrintContentTypes();\n });\n\n list\n .command('components')\n .description('print list of components')\n .addHelpText(\n 'after',\n `\nExample call:\n > list components -o ./output.json -f json\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'components'], opts).PrintComponents();\n });\n\n list\n .command('blocks')\n .description('print list of content blocks')\n .addHelpText(\n 'after',\n `\nExample call:\n > list blocks\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'blocks'], opts).PrintBlocks();\n });\n\n list\n .command('keys')\n .description('print list of API keys')\n .addHelpText(\n 'after',\n `\nExample call:\n > list keys\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'keys'], opts).PrintApiKeys();\n });\n\n list\n .command('proxies')\n .description('print list of proxies')\n .addHelpText(\n 'after',\n `\nExample call:\n > list proxies\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'proxies'], opts).PrintProxies();\n });\n\n list\n .command('renderers')\n .description('print list of renderers')\n .addHelpText(\n 'after',\n `\nExample call:\n > list renderers\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'renderers'], opts).PrintRenderers();\n });\n\n list\n .command('roles')\n .description('print list of roles')\n .addHelpText(\n 'after',\n `\nExample call:\n > list roles\n`\n )\n .action(async opts => {\n await cliCommand(['list', 'roles'], opts).PrintRoles();\n });\n\n list\n .command('webhooks')\n .description('print list of webhooks')\n .argument('[name]', 'find webhooks matching the supplied name')\n .option('-i --id <id...>', 'the subscription id(s) to get')\n .addHelpText('after', `\\n`)\n .action(async (name?: string, { id, ...opts }: any = {}) => {\n await cliCommand(['list', 'webhooks'], opts).PrintWebhookSubscriptions(\n name ? [name] : id\n );\n });\n\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 return list;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAwB;AACxB,iCAA2B;AAEpB,MAAM,kBAAkB,MAAM;AACnC,QAAM,OAAO,IAAI,yBAAQ,EACtB,QAAQ,MAAM,EACd,YAAY,cAAc,EAC1B,YAAY,SAAS;AAAA,CAAI,EACzB,mBAAmB,IAAI,EACvB,aAAa;AAEhB,OACG,QAAQ,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,cAA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,OAAM,SAAQ;AACpB,cAAM,uCAAW,CAAC,QAAQ,SAAS,GAAG,IAAI,EAAE,aAAa;AAAA,EAC3D,CAAC;AAEH,OACG,QAAQ,WAAW,EACnB,YAAY,yBAAyB,EACrC;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,EAIF,EACC,OAAO,OAAM,SAAQ;AACpB,cAAM,uCAAW,CAAC,QAAQ,WAAW,GAAG,IAAI,EAAE,eAAe;AAAA,EAC/D,CAAC;AAEH,OACG,QAAQ,OAAO,EACf,YAAY,qBAAqB,EACjC;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,EAIF,EACC,OAAO,OAAM,SAAQ;AACpB,cAAM,uCAAW,CAAC,QAAQ,OAAO,GAAG,IAAI,EAAE,WAAW;AAAA,EACvD,CAAC;AAEH,OACG,QAAQ,UAAU,EAClB,YAAY,wBAAwB,EACpC,SAAS,UAAU,0CAA0C,EAC7D,OAAO,mBAAmB,+BAA+B,EACzD,YAAY,SAAS;AAAA,CAAI,EACzB,OAAO,OAAO,MAAe,EAAE,OAAO,KAAK,IAAS,CAAC,MAAM;AAC1D,cAAM,uCAAW,CAAC,QAAQ,UAAU,GAAG,IAAI,EAAE;AAAA,MAC3C,OAAO,CAAC,IAAI,IAAI;AAAA,IAClB;AAAA,EACF,CAAC;AAEH,OACG,QAAQ,WAAW,EACnB,YAAY,oCAAoC,EAChD;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,EAIF,EACC,OAAO,OAAM,SAAQ;AACpB,cAAM,uCAAW,CAAC,QAAQ,WAAW,GAAG,IAAI,EAAE,eAAe;AAAA,EAC/D,CAAC;AAEH,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -24,14 +24,14 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
25
|
var file_provider_exports = {};
|
|
26
26
|
__export(file_provider_exports, {
|
|
27
|
+
appPath: () => appPath,
|
|
27
28
|
appRootDir: () => appRootDir,
|
|
28
29
|
checkDir: () => checkDir,
|
|
29
30
|
cwdPath: () => cwdPath,
|
|
30
|
-
localPath: () => localPath,
|
|
31
31
|
moveFile: () => moveFile,
|
|
32
32
|
readFile: () => readFile,
|
|
33
|
+
readFileAsJSON: () => readFileAsJSON,
|
|
33
34
|
readFiles: () => readFiles,
|
|
34
|
-
readJsonFile: () => readJsonFile,
|
|
35
35
|
removeFile: () => removeFile,
|
|
36
36
|
writeFile: () => writeFile
|
|
37
37
|
});
|
|
@@ -40,17 +40,14 @@ var import_fs = __toESM(require("fs"));
|
|
|
40
40
|
var import_os = require("os");
|
|
41
41
|
var import_path = __toESM(require("path"));
|
|
42
42
|
var import_util = require("../util");
|
|
43
|
+
var import_csv = require("../util/csv.formatter");
|
|
44
|
+
var import_json = require("../util/json.formatter");
|
|
45
|
+
var import_logger = require("../util/logger");
|
|
46
|
+
var import_xml = require("../util/xml.formatter");
|
|
43
47
|
const userHomeDir = (0, import_os.homedir)();
|
|
44
48
|
const appRootDir = process.env.CONTAINER_CONTEXT === "true" ? process.cwd() : import_path.default.join(userHomeDir, ".contensis/");
|
|
45
|
-
const readJsonFile = (filePath) => {
|
|
46
|
-
const directoryPath = cwdPath(filePath);
|
|
47
|
-
const file = readFile(directoryPath);
|
|
48
|
-
if (file)
|
|
49
|
-
return (0, import_util.tryParse)(file);
|
|
50
|
-
return void 0;
|
|
51
|
-
};
|
|
52
49
|
const readFile = (filePath) => {
|
|
53
|
-
const directoryPath =
|
|
50
|
+
const directoryPath = appPath(filePath);
|
|
54
51
|
if (import_fs.default.existsSync(directoryPath)) {
|
|
55
52
|
const file = import_fs.default.readFileSync(directoryPath, "utf8");
|
|
56
53
|
return file;
|
|
@@ -59,7 +56,7 @@ const readFile = (filePath) => {
|
|
|
59
56
|
}
|
|
60
57
|
};
|
|
61
58
|
const readFiles = (directory, createDirectory = true) => {
|
|
62
|
-
const directoryPath =
|
|
59
|
+
const directoryPath = appPath(directory);
|
|
63
60
|
if (import_fs.default.existsSync(directoryPath)) {
|
|
64
61
|
const files = import_fs.default.readdirSync(directoryPath);
|
|
65
62
|
return files;
|
|
@@ -71,11 +68,11 @@ const readFiles = (directory, createDirectory = true) => {
|
|
|
71
68
|
}
|
|
72
69
|
};
|
|
73
70
|
const writeFile = (filePath, content) => {
|
|
74
|
-
const directoryPath =
|
|
71
|
+
const directoryPath = appPath(filePath);
|
|
75
72
|
import_fs.default.writeFileSync(directoryPath, content, { encoding: "utf-8" });
|
|
76
73
|
};
|
|
77
74
|
const removeFile = (filePath) => {
|
|
78
|
-
const directoryPath =
|
|
75
|
+
const directoryPath = appPath(filePath);
|
|
79
76
|
if (import_fs.default.existsSync(directoryPath)) {
|
|
80
77
|
import_fs.default.rmSync(directoryPath);
|
|
81
78
|
}
|
|
@@ -101,22 +98,60 @@ File does not exist!`
|
|
|
101
98
|
}
|
|
102
99
|
};
|
|
103
100
|
const checkDir = (filePath) => {
|
|
104
|
-
const directoryPath = import_path.default.dirname(
|
|
101
|
+
const directoryPath = import_path.default.dirname(appPath(filePath));
|
|
105
102
|
if (!import_fs.default.existsSync(directoryPath))
|
|
106
103
|
import_fs.default.mkdirSync(directoryPath, { recursive: true });
|
|
107
104
|
};
|
|
108
|
-
const
|
|
105
|
+
const appPath = (filePath) => import_path.default.isAbsolute(filePath) ? filePath : import_path.default.join(appRootDir, filePath);
|
|
109
106
|
const cwdPath = (filePath) => import_path.default.isAbsolute(filePath) ? filePath : import_path.default.join(process.cwd(), filePath);
|
|
107
|
+
const detectFileType = (fromFile) => {
|
|
108
|
+
try {
|
|
109
|
+
const fileData = readFile(fromFile);
|
|
110
|
+
if (fileData) {
|
|
111
|
+
if (fileData.startsWith("<"))
|
|
112
|
+
return { contents: fileData, type: "xml" };
|
|
113
|
+
const jsonData = (0, import_util.tryParse)(fileData);
|
|
114
|
+
if (jsonData)
|
|
115
|
+
return { contents: jsonData, type: "json" };
|
|
116
|
+
const csv = (0, import_csv.detectCsv)(fileData);
|
|
117
|
+
if (csv)
|
|
118
|
+
return { contents: fileData, type: "csv" };
|
|
119
|
+
}
|
|
120
|
+
} catch (ex) {
|
|
121
|
+
import_logger.Logger.error(`Problem detecting file type ${fromFile}`, ex);
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
const readFileAsJSON = async (fromFile) => {
|
|
125
|
+
const detectedFile = detectFileType(cwdPath(fromFile));
|
|
126
|
+
if (!detectedFile)
|
|
127
|
+
return void 0;
|
|
128
|
+
try {
|
|
129
|
+
switch (detectedFile.type) {
|
|
130
|
+
case "csv": {
|
|
131
|
+
const flatJson = await (0, import_csv.csvToJson)(detectedFile.contents);
|
|
132
|
+
const unflattenedJson = flatJson.map((record) => (0, import_json.unflattenObject)(record));
|
|
133
|
+
return unflattenedJson;
|
|
134
|
+
}
|
|
135
|
+
case "xml":
|
|
136
|
+
return await (0, import_xml.xmlToJson)(detectedFile.contents);
|
|
137
|
+
case "json":
|
|
138
|
+
default:
|
|
139
|
+
return detectedFile.contents;
|
|
140
|
+
}
|
|
141
|
+
} catch (ex) {
|
|
142
|
+
import_logger.Logger.error(`Problem converting file from ${detectedFile.type}`, ex);
|
|
143
|
+
}
|
|
144
|
+
};
|
|
110
145
|
// Annotate the CommonJS export names for ESM import in node:
|
|
111
146
|
0 && (module.exports = {
|
|
147
|
+
appPath,
|
|
112
148
|
appRootDir,
|
|
113
149
|
checkDir,
|
|
114
150
|
cwdPath,
|
|
115
|
-
localPath,
|
|
116
151
|
moveFile,
|
|
117
152
|
readFile,
|
|
153
|
+
readFileAsJSON,
|
|
118
154
|
readFiles,
|
|
119
|
-
readJsonFile,
|
|
120
155
|
removeFile,
|
|
121
156
|
writeFile
|
|
122
157
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/providers/file-provider.ts"],
|
|
4
|
-
"sourcesContent": ["import fs from 'fs';\nimport { homedir } from 'os';\nimport path from 'path';\nimport { tryParse } from '~/util';\n\nconst userHomeDir = homedir();\n\nexport const appRootDir =\n process.env.CONTAINER_CONTEXT === 'true'\n ? process.cwd()\n : path.join(userHomeDir, '.contensis/');\n\nexport const
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAAe;AACf,gBAAwB;AACxB,kBAAiB;AACjB,kBAAyB;
|
|
4
|
+
"sourcesContent": ["import fs from 'fs';\nimport { homedir } from 'os';\nimport path from 'path';\nimport { tryParse } from '~/util';\nimport { csvToJson, detectCsv } from '~/util/csv.formatter';\nimport { unflattenObject } from '~/util/json.formatter';\nimport { Logger } from '~/util/logger';\nimport { xmlToJson } from '~/util/xml.formatter';\n\nconst userHomeDir = homedir();\n\nexport const appRootDir =\n process.env.CONTAINER_CONTEXT === 'true'\n ? process.cwd()\n : path.join(userHomeDir, '.contensis/');\n\nexport const readFile = (filePath: string) => {\n const directoryPath = appPath(filePath);\n if (fs.existsSync(directoryPath)) {\n const file = fs.readFileSync(directoryPath, 'utf8');\n return file;\n } else {\n return undefined;\n }\n};\n\nexport const readFiles = (directory: string, createDirectory = true) => {\n const directoryPath = appPath(directory);\n if (fs.existsSync(directoryPath)) {\n const files = fs.readdirSync(directoryPath);\n return files;\n } else if (createDirectory) {\n fs.mkdirSync(directoryPath, { recursive: true });\n return [];\n } else {\n throw new Error(`ENOENT: Directory does not exist ${directoryPath}`);\n // return undefined;\n }\n};\n\nexport const writeFile = (filePath: string, content: string) => {\n const directoryPath = appPath(filePath);\n fs.writeFileSync(directoryPath, content, { encoding: 'utf-8' });\n};\n\nexport const removeFile = (filePath: string) => {\n const directoryPath = appPath(filePath);\n if (fs.existsSync(directoryPath)) {\n fs.rmSync(directoryPath);\n }\n};\n\nexport const moveFile = (file: string, fromPath: string, toPath: string) => {\n const from = path.join(appRootDir, `${fromPath}${file}`);\n const to = path.join(appRootDir, `${toPath}${file}`);\n if (fs.existsSync(from)) {\n checkDir(toPath);\n // if (!fs.existsSync(toPath)) fs.mkdirSync(toPath, { recursive: true });\n\n fs.rename(from, to, err => {\n if (err)\n console.error(\n `Could not rename file \"${file}\" from: ${fromPath} to: ${toPath}`,\n err\n );\n console.info(`Renamed file \"${file}\" from: ${fromPath} to: ${toPath}`);\n });\n } else {\n console.error(\n `Could not rename file \"${file}\" from: ${fromPath} to: ${toPath}\\nFile does not exist!`\n );\n }\n};\n\nexport const checkDir = (filePath: string) => {\n const directoryPath = path.dirname(appPath(filePath));\n if (!fs.existsSync(directoryPath))\n fs.mkdirSync(directoryPath, { recursive: true });\n};\n\nexport const appPath = (filePath: string) =>\n path.isAbsolute(filePath) ? filePath : path.join(appRootDir, filePath);\n\nexport const cwdPath = (filePath: string) =>\n path.isAbsolute(filePath) ? filePath : path.join(process.cwd(), filePath);\n\ntype DetectedFileType =\n | { type: 'json'; contents: any }\n | { type: 'xml' | 'csv'; contents: string };\n\nconst detectFileType = (\n fromFile: string\n): DetectedFileType | undefined => {\n try {\n const fileData = readFile(fromFile);\n if (fileData) {\n // if XML\n if (fileData.startsWith('<')) return { contents: fileData, type: 'xml' };\n\n // if JSON\n const jsonData = tryParse(fileData);\n if (jsonData) return { contents: jsonData, type: 'json' };\n\n // if CSV\n const csv = detectCsv(fileData);\n if (csv) return { contents: fileData, type: 'csv' };\n }\n } catch (ex) {\n Logger.error(`Problem detecting file type ${fromFile}`, ex);\n }\n};\n\nexport const readFileAsJSON = async <T = any>(\n fromFile: string\n): Promise<T | undefined> => {\n const detectedFile = detectFileType(cwdPath(fromFile));\n if (!detectedFile) return undefined;\n try {\n switch (detectedFile.type) {\n case 'csv': {\n const flatJson = await csvToJson(detectedFile.contents);\n const unflattenedJson = flatJson.map(record => unflattenObject(record));\n return unflattenedJson as T;\n }\n case 'xml':\n return (await xmlToJson(detectedFile.contents)) as T;\n\n case 'json':\n default:\n return detectedFile.contents;\n }\n } catch (ex) {\n Logger.error(`Problem converting file from ${detectedFile.type}`, ex);\n }\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAAe;AACf,gBAAwB;AACxB,kBAAiB;AACjB,kBAAyB;AACzB,iBAAqC;AACrC,kBAAgC;AAChC,oBAAuB;AACvB,iBAA0B;AAE1B,MAAM,kBAAc,mBAAQ;AAErB,MAAM,aACX,QAAQ,IAAI,sBAAsB,SAC9B,QAAQ,IAAI,IACZ,YAAAA,QAAK,KAAK,aAAa,aAAa;AAEnC,MAAM,WAAW,CAAC,aAAqB;AAC5C,QAAM,gBAAgB,QAAQ,QAAQ;AACtC,MAAI,UAAAC,QAAG,WAAW,aAAa,GAAG;AAChC,UAAM,OAAO,UAAAA,QAAG,aAAa,eAAe,MAAM;AAClD,WAAO;AAAA,EACT,OAAO;AACL,WAAO;AAAA,EACT;AACF;AAEO,MAAM,YAAY,CAAC,WAAmB,kBAAkB,SAAS;AACtE,QAAM,gBAAgB,QAAQ,SAAS;AACvC,MAAI,UAAAA,QAAG,WAAW,aAAa,GAAG;AAChC,UAAM,QAAQ,UAAAA,QAAG,YAAY,aAAa;AAC1C,WAAO;AAAA,EACT,WAAW,iBAAiB;AAC1B,cAAAA,QAAG,UAAU,eAAe,EAAE,WAAW,KAAK,CAAC;AAC/C,WAAO,CAAC;AAAA,EACV,OAAO;AACL,UAAM,IAAI,MAAM,oCAAoC,eAAe;AAAA,EAErE;AACF;AAEO,MAAM,YAAY,CAAC,UAAkB,YAAoB;AAC9D,QAAM,gBAAgB,QAAQ,QAAQ;AACtC,YAAAA,QAAG,cAAc,eAAe,SAAS,EAAE,UAAU,QAAQ,CAAC;AAChE;AAEO,MAAM,aAAa,CAA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