contensis-cli 1.3.1-beta.0 → 1.3.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/README.md +78 -6
- package/dist/commands/copy.js +2 -2
- package/dist/commands/copy.js.map +2 -2
- package/dist/commands/create.js +1 -2
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/globalOptions.js +16 -4
- package/dist/commands/globalOptions.js.map +2 -2
- package/dist/commands/import.js +1 -1
- package/dist/commands/import.js.map +2 -2
- package/dist/commands/index.js +4 -2
- package/dist/commands/index.js.map +2 -2
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/login.js +1 -2
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/push.js +102 -10
- package/dist/commands/push.js.map +3 -3
- package/dist/commands/remove.js +15 -4
- package/dist/commands/remove.js.map +2 -2
- package/dist/commands/set.js +2 -4
- package/dist/commands/set.js.map +1 -1
- package/dist/commands/update.js +70 -0
- package/dist/commands/update.js.map +7 -0
- package/dist/factories/RequestHandlerFactory.js +12 -5
- package/dist/factories/RequestHandlerFactory.js.map +2 -2
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/localisation/en-GB.js +19 -2
- package/dist/localisation/en-GB.js.map +2 -2
- package/dist/mappers/ContensisCliService-to-RequestHanderSiteConfigYaml.js.map +1 -1
- package/dist/mappers/DevInit-to-CIWorkflow.js +11 -6
- package/dist/mappers/DevInit-to-CIWorkflow.js.map +1 -1
- package/dist/mappers/DevRequests-to-RequestHanderCliArgs.js +4 -2
- package/dist/mappers/DevRequests-to-RequestHanderCliArgs.js.map +1 -1
- package/dist/models/CliService.d.js.map +1 -1
- package/dist/providers/CredentialProvider.js +11 -4
- package/dist/providers/CredentialProvider.js.map +2 -2
- package/dist/providers/GitHubCliModuleProvider.js +8 -10
- package/dist/providers/GitHubCliModuleProvider.js.map +1 -1
- package/dist/providers/HttpProvider.js +5 -4
- package/dist/providers/HttpProvider.js.map +1 -1
- package/dist/providers/ManifestProvider.js +1 -4
- package/dist/providers/ManifestProvider.js.map +1 -1
- package/dist/providers/SessionCacheProvider.js +26 -8
- package/dist/providers/SessionCacheProvider.js.map +2 -2
- package/dist/providers/file-provider.js +13 -11
- package/dist/providers/file-provider.js.map +1 -1
- package/dist/services/ContensisAuthService.js +1 -2
- package/dist/services/ContensisAuthService.js.map +1 -1
- package/dist/services/ContensisCliService.js +194 -127
- package/dist/services/ContensisCliService.js.map +3 -3
- package/dist/services/ContensisDevService.js +15 -18
- package/dist/services/ContensisDevService.js.map +2 -2
- package/dist/services/ContensisRoleService.js +8 -10
- package/dist/services/ContensisRoleService.js.map +1 -1
- package/dist/shell.js +31 -15
- package/dist/shell.js.map +2 -2
- package/dist/util/api-ids.js.map +1 -1
- package/dist/util/console.printer.js +15 -17
- package/dist/util/console.printer.js.map +2 -2
- package/dist/util/csv.formatter.js +8 -15
- package/dist/util/csv.formatter.js.map +2 -2
- package/dist/util/diff.js +6 -4
- package/dist/util/diff.js.map +1 -1
- package/dist/util/dotenv.js +1 -2
- package/dist/util/dotenv.js.map +1 -1
- package/dist/util/error.js.map +1 -1
- package/dist/util/fetch.js +4 -0
- package/dist/util/fetch.js.map +1 -1
- package/dist/util/git.js +8 -8
- package/dist/util/git.js.map +1 -1
- package/dist/util/gitignore.js +4 -0
- package/dist/util/gitignore.js.map +1 -1
- package/dist/util/html.formatter.js +70 -0
- package/dist/util/html.formatter.js.map +7 -0
- package/dist/util/index.js +5 -1
- package/dist/util/index.js.map +2 -2
- package/dist/util/json.formatter.js +6 -4
- package/dist/util/json.formatter.js.map +1 -1
- package/dist/util/logger.js +47 -53
- package/dist/util/logger.js.map +2 -2
- package/dist/util/os.js +4 -0
- package/dist/util/os.js.map +1 -1
- package/dist/util/xml.formatter.js +4 -0
- package/dist/util/xml.formatter.js.map +1 -1
- package/dist/util/yaml.js +1 -2
- package/dist/util/yaml.js.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/esbuild.config.js +12 -16
- package/package.json +31 -32
- package/src/commands/copy.ts +3 -1
- package/src/commands/globalOptions.ts +10 -3
- package/src/commands/import.ts +2 -0
- package/src/commands/index.ts +4 -0
- package/src/commands/push.ts +125 -1
- package/src/commands/remove.ts +20 -0
- package/src/commands/update.ts +84 -0
- package/src/factories/RequestHandlerFactory.ts +1 -1
- package/src/localisation/en-GB.ts +16 -1
- package/src/models/CliService.d.ts +1 -1
- package/src/providers/CredentialProvider.ts +2 -2
- package/src/providers/SessionCacheProvider.ts +26 -2
- package/src/services/ContensisCliService.ts +187 -49
- package/src/services/ContensisDevService.ts +2 -2
- package/src/shell.ts +20 -9
- package/src/util/console.printer.ts +23 -19
- package/src/util/csv.formatter.ts +1 -1
- package/src/util/html.formatter.ts +52 -0
- package/src/util/index.ts +1 -1
- package/src/util/logger.ts +17 -16
- package/src/version.ts +1 -1
- package/tsconfig.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Contensis CLI
|
|
1
|
+
# [](https://www.contensis.com) Contensis CLI
|
|
2
2
|
|
|
3
3
|
Use Contensis from your favourite terminal
|
|
4
4
|
|
|
@@ -225,6 +225,7 @@ contensis >
|
|
|
225
225
|
- [Get started](#get-started)
|
|
226
226
|
- [Connect to a Contensis Cloud environment](#connect-to-a-contensis-cloud-environment)
|
|
227
227
|
- [Login to a connected Contensis environment](#login-to-a-connected-contensis-environment)
|
|
228
|
+
- [Manage connected environments](#manage-connected-environments)
|
|
228
229
|
- [Manage Projects](#manage-projects)
|
|
229
230
|
- [List projects](#list-projects)
|
|
230
231
|
- [Set current project](#set-current-project)
|
|
@@ -278,16 +279,20 @@ contensis >
|
|
|
278
279
|
- [Import from a file](#import-from-a-file-1)
|
|
279
280
|
- [Import entries further reading](#import-entries-further-reading)
|
|
280
281
|
- [Remove entries](#remove-entries)
|
|
282
|
+
- [Push asset](#push-asset)
|
|
281
283
|
- [Copy an entry field](#copy-an-entry-field)
|
|
282
284
|
- [Copy a simple entry field](#copy-a-simple-entry-field)
|
|
283
285
|
- [Limit entries when copying field content](#limit-entries-when-copying-field-content)
|
|
284
286
|
- [Copy a composer into a canvas field](#copy-a-composer-into-a-canvas-field)
|
|
285
287
|
- [Copy a field using a template](#copy-a-field-using-a-template)
|
|
286
288
|
- [Copy a field and save the entries as output](#copy-a-field-and-save-the-entries-as-output)
|
|
289
|
+
- [Update an entry field](#update-an-entry-field)
|
|
287
290
|
|
|
288
291
|
## Get started
|
|
289
292
|
|
|
290
|
-
Press `[tab]` key at any time to show suggested commands or to attempt to auto-complete the command you are
|
|
293
|
+
Press `[tab]` key at any time to show suggested commands or to attempt to auto-complete the command you are typing
|
|
294
|
+
|
|
295
|
+
You can use tab to auto-complete a `connect <alias>` or `set project <project-id>` command for the environment(s) you are connected to
|
|
291
296
|
|
|
292
297
|
```shell
|
|
293
298
|
>> Available commands:
|
|
@@ -354,6 +359,31 @@ If you are logging in via a script or service you will likely be using an API ke
|
|
|
354
359
|
|
|
355
360
|
If you need to skip this step for any reason you could [pass connection details anywhere](#pass-connection-details-anywhere)
|
|
356
361
|
|
|
362
|
+
## Manage connected environments
|
|
363
|
+
|
|
364
|
+
See a list of all previously connected environments with the `list envs` command
|
|
365
|
+
|
|
366
|
+
Use the `remove env` command followed by the cloud alias if you wish to remove any of these environments from your CLI cache
|
|
367
|
+
|
|
368
|
+
```shell
|
|
369
|
+
contensis t.durden@example-dev> list envs
|
|
370
|
+
[cli] ✅ Environments store found containing 7 environments
|
|
371
|
+
- demoSite
|
|
372
|
+
- * example-dev
|
|
373
|
+
- forms
|
|
374
|
+
- insytful
|
|
375
|
+
- leif
|
|
376
|
+
- trial-00
|
|
377
|
+
- webinar
|
|
378
|
+
|
|
379
|
+
contensis t.durden@example-dev> remove env trial-00
|
|
380
|
+
[cli] ✅ Environments store found containing 7 environments
|
|
381
|
+
[cli] ✅ Removed environment trial-00 from session cache
|
|
382
|
+
-------------------------------------
|
|
383
|
+
|
|
384
|
+
contensis t.durden@example-dev>
|
|
385
|
+
```
|
|
386
|
+
|
|
357
387
|
## Manage Projects
|
|
358
388
|
|
|
359
389
|
### List projects
|
|
@@ -624,7 +654,9 @@ contensis t.durden@example-dev>
|
|
|
624
654
|
|
|
625
655
|
### Get entries
|
|
626
656
|
|
|
627
|
-
Use the `get entries` command
|
|
657
|
+
Use the `get entries` command to search for entries using the Management API
|
|
658
|
+
|
|
659
|
+
Many options are available that can be used to return the right list of entries: run `get entries --help`
|
|
628
660
|
|
|
629
661
|
The simplest usage is `get entries {keyword}` or `get entries "{search phrase}"`
|
|
630
662
|
|
|
@@ -818,7 +850,7 @@ website t.durden@example-dev>
|
|
|
818
850
|
|
|
819
851
|
Override the output format with the `--format` or `-f` option.
|
|
820
852
|
|
|
821
|
-
Available options are: `json`, `xml` or `
|
|
853
|
+
Available options are: `json`, `csv`, `xml` or `html`
|
|
822
854
|
|
|
823
855
|
The `--format` and `--output` options are available with most commands (check command `--help`)
|
|
824
856
|
|
|
@@ -1521,7 +1553,7 @@ The output will be the same as the `import models` examples above
|
|
|
1521
1553
|
|
|
1522
1554
|
### Import from another Contensis environment
|
|
1523
1555
|
|
|
1524
|
-
Connect to your "source" environment first, ensure you can fetch the entries you plan on importing from here and your query / filters are working to fetch exactly the data you are expecting with the `get entries` command. Add the `--dependents` option to fetch all of the entries that will eventually be imported.
|
|
1556
|
+
Connect to your "source" environment first, ensure you can fetch the entries you plan on importing from here and your query / filters are working to fetch exactly the data you are expecting with the `get entries` command. Add the `--dependents` option to your `get entries` test commands to fetch all of the entries that will eventually be imported.
|
|
1525
1557
|
|
|
1526
1558
|
When you are happy you can fetch only the data you intend to import, connect to the "target" environment (and project) then use the same query as before except with the `import entries` command
|
|
1527
1559
|
|
|
@@ -1715,6 +1747,22 @@ website t.durden@example-dev>
|
|
|
1715
1747
|
|
|
1716
1748
|
<sup><sub>Add the `--commit` option to make the changes, be very careful using this! There is no going back</sub></sup>
|
|
1717
1749
|
|
|
1750
|
+
## Push asset
|
|
1751
|
+
|
|
1752
|
+
The `push asset` command allows you to push a single file into your Contensis instance
|
|
1753
|
+
|
|
1754
|
+
The file can be local
|
|
1755
|
+
|
|
1756
|
+
```shell
|
|
1757
|
+
push asset image "Bicycle" "A child's bicycle" --from-file "C:\Users\t.durden\Pictures\bicycle.png" --target-file-path /image-library/samples/
|
|
1758
|
+
```
|
|
1759
|
+
|
|
1760
|
+
Or the file can be downloaded from a http location
|
|
1761
|
+
|
|
1762
|
+
```shell
|
|
1763
|
+
push asset image "Bicycle" "A child's bicycle" --from-url "https://thumbs.example.com/modern-child-bicycle.jpg" --target-file-path /image-library/samples/
|
|
1764
|
+
```
|
|
1765
|
+
|
|
1718
1766
|
## Copy an entry field
|
|
1719
1767
|
|
|
1720
1768
|
This command allows us to copy the contents of one entry field to another, this is useful if, for example - when a field is named incorrectly, or was specified originally as one field type but we would like to curate and present this content differently in future.
|
|
@@ -1859,7 +1907,7 @@ copy field courseInstance modules modules --zenql "sys.contentTypeId=courseInsta
|
|
|
1859
1907
|
|
|
1860
1908
|
This example will populate a repeating entry link field called `modules` within the `courseInstance` content type with the template we've supplied
|
|
1861
1909
|
|
|
1862
|
-
Using the `copy field` command with a `--zenql` statement to narrow down the entries to update, we can supply a template that is a hard-coded JSON string (with escaped quotes) with an `"id"` that is a valid entry id to link to this field.
|
|
1910
|
+
Using the `copy field` command with a `--zenql` statement to narrow down the entries to update, we can supply a template that is a hard-coded JSON string (with escaped quotes) with an `"id"` that is a valid entry id to link to this field.
|
|
1863
1911
|
|
|
1864
1912
|
Adding `--output-detail changes` will output a diff for each changed entry to the console. For larger jobs use the `--output file.json` option to review the changes that will be made.
|
|
1865
1913
|
|
|
@@ -1876,3 +1924,27 @@ Add the `--save-entries` option to the `copy field` command, remember to also in
|
|
|
1876
1924
|
```shell
|
|
1877
1925
|
copy field contentPage composer canvas --save-entries --output canvas-entries.json
|
|
1878
1926
|
```
|
|
1927
|
+
|
|
1928
|
+
## Update an entry field
|
|
1929
|
+
|
|
1930
|
+
The `update field` command can be thought of as a "find and replace" feature, where we can look for a particular value (or RegExp) in a list of entries and replace any found values with a supplied replacement value.
|
|
1931
|
+
|
|
1932
|
+
```shell
|
|
1933
|
+
update field content "find me" "replacement value"
|
|
1934
|
+
```
|
|
1935
|
+
|
|
1936
|
+
A number of ways exist to limit the entries we check and make changes with
|
|
1937
|
+
|
|
1938
|
+
```shell
|
|
1939
|
+
update field content "Em.*?mith" "Emma Davies" --zenql "searchContent~'Emma Smith'"
|
|
1940
|
+
```
|
|
1941
|
+
|
|
1942
|
+
```shell
|
|
1943
|
+
update field content "Em.*?mith" "Emma Davies" --search "Emma Smith"
|
|
1944
|
+
```
|
|
1945
|
+
|
|
1946
|
+
Update one or more entries by their id
|
|
1947
|
+
|
|
1948
|
+
```shell
|
|
1949
|
+
update field content "Em.*?mith" "Emma Davies" --id defb707b-fcfa-4c7e-baf8-6472edb5ec25 c92390dd-7bb1-5f5d-8fbd-0d7f41232ac3
|
|
1950
|
+
```
|
package/dist/commands/copy.js
CHANGED
|
@@ -36,7 +36,7 @@ const makeCopyCommand = () => {
|
|
|
36
36
|
).option(
|
|
37
37
|
"--root-uri <rootUri>",
|
|
38
38
|
"prefix your public uri to relative links in canvas content"
|
|
39
|
-
).addOption(import_globalOptions.commit).addOption(import_globalOptions.concurrency).addOption(import_globalOptions.ignoreErrors).addOption(import_globalOptions.outputDetail).addOption(import_globalOptions.noCache).option(
|
|
39
|
+
).addOption(import_globalOptions.commit).addOption(import_globalOptions.concurrency).addOption(import_globalOptions.ignoreErrors).addOption(import_globalOptions.outputDetail).addOption(import_globalOptions.noCache).addOption(import_globalOptions.noPublish).option(
|
|
40
40
|
"--search <phrase>",
|
|
41
41
|
"get entries with the search phrase, use quotes for multiple words"
|
|
42
42
|
).addOption(import_globalOptions.entryId).addOption(import_globalOptions.zenql).addOption(import_globalOptions.latest).addOption(import_globalOptions.versionStatus).addOption(import_globalOptions.saveEntries).usage("<contentTypeId> <fieldId> <destinationId> (all arguments required)").addHelpText(
|
|
@@ -54,7 +54,7 @@ Example call:
|
|
|
54
54
|
contentTypeId,
|
|
55
55
|
fieldId,
|
|
56
56
|
destinationId,
|
|
57
|
-
template
|
|
57
|
+
template,
|
|
58
58
|
rootUri: opts.rootUri
|
|
59
59
|
};
|
|
60
60
|
return await (0, import_ContensisCliService.cliCommand)(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/commands/copy.ts"],
|
|
4
|
-
"sourcesContent": ["import { Command } from 'commander';\nimport { CopyField } from 'migratortron';\nimport { cliCommand } from '~/services/ContensisCliService';\nimport {\n commit,\n concurrency,\n entryId,\n ignoreErrors,\n latest,\n mapContensisOpts,\n noCache,\n outputDetail,\n saveEntries,\n versionStatus,\n zenql,\n} from './globalOptions';\n\nexport const makeCopyCommand = () => {\n const copy = new Command()\n .command('copy')\n .description('copy command')\n .addHelpText('after', `\\n`)\n .showHelpAfterError(true)\n .exitOverride();\n\n copy\n .command('field')\n .description('copy the contents of one content type field to another')\n .argument(\n '<contentTypeId>',\n 'the api id of the content type containing the fields to copy'\n )\n .argument('<fieldId>', 'the id of the field to copy from')\n .argument('<destinationId>', 'the id of the field to copy to')\n .option(\n '-t --template <template>',\n 'apply a liquidjs template (surrounded by double quotes) to modify the copied field content'\n )\n .option(\n '--root-uri <rootUri>',\n 'prefix your public uri to relative links in canvas content'\n )\n .addOption(commit)\n .addOption(concurrency)\n .addOption(ignoreErrors)\n .addOption(outputDetail)\n .addOption(noCache)\n .option(\n '--search <phrase>',\n 'get entries with the search phrase, use quotes for multiple words'\n )\n .addOption(entryId)\n .addOption(zenql)\n .addOption(latest)\n .addOption(versionStatus)\n .addOption(saveEntries)\n .usage('<contentTypeId> <fieldId> <destinationId> (all arguments required)')\n .addHelpText(\n 'after',\n `\nExample call:\n > copy field blog authorName contributors\\n\n > copy field blog description kicker --template \"<h2>{{ source_value }}</h2>\"\\n`\n )\n .action(\n async (\n contentTypeId: string,\n fieldId: string,\n destinationId: string,\n opts: any\n ) => {\n const { template, ...restOpts } = opts;\n const copyField: CopyField = {\n contentTypeId,\n fieldId,\n destinationId,\n template
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAwB;AAExB,iCAA2B;AAC3B,
|
|
4
|
+
"sourcesContent": ["import { Command } from 'commander';\nimport { CopyField } from 'migratortron';\nimport { cliCommand } from '~/services/ContensisCliService';\nimport {\n commit,\n concurrency,\n entryId,\n ignoreErrors,\n latest,\n mapContensisOpts,\n noCache,\n noPublish,\n outputDetail,\n saveEntries,\n versionStatus,\n zenql,\n} from './globalOptions';\n\nexport const makeCopyCommand = () => {\n const copy = new Command()\n .command('copy')\n .description('copy command')\n .addHelpText('after', `\\n`)\n .showHelpAfterError(true)\n .exitOverride();\n\n copy\n .command('field')\n .description('copy the contents of one content type field to another')\n .argument(\n '<contentTypeId>',\n 'the api id of the content type containing the fields to copy'\n )\n .argument('<fieldId>', 'the id of the field to copy from')\n .argument('<destinationId>', 'the id of the field to copy to')\n .option(\n '-t --template <template>',\n 'apply a liquidjs template (surrounded by double quotes) to modify the copied field content'\n )\n .option(\n '--root-uri <rootUri>',\n 'prefix your public uri to relative links in canvas content'\n )\n .addOption(commit)\n .addOption(concurrency)\n .addOption(ignoreErrors)\n .addOption(outputDetail)\n .addOption(noCache)\n .addOption(noPublish)\n .option(\n '--search <phrase>',\n 'get entries with the search phrase, use quotes for multiple words'\n )\n .addOption(entryId)\n .addOption(zenql)\n .addOption(latest)\n .addOption(versionStatus)\n .addOption(saveEntries)\n .usage('<contentTypeId> <fieldId> <destinationId> (all arguments required)')\n .addHelpText(\n 'after',\n `\nExample call:\n > copy field blog authorName contributors\\n\n > copy field blog description kicker --template \"<h2>{{ source_value }}</h2>\"\\n`\n )\n .action(\n async (\n contentTypeId: string,\n fieldId: string,\n destinationId: string,\n opts: any\n ) => {\n const { template, ...restOpts } = opts;\n const copyField: CopyField = {\n contentTypeId,\n fieldId,\n destinationId,\n template,\n rootUri: opts.rootUri,\n };\n\n return await cliCommand(\n ['copy', 'project', contentTypeId, fieldId, destinationId],\n opts,\n mapContensisOpts({ copyField, ...restOpts })\n ).CopyEntryField({\n commit: opts.commit,\n fromFile: opts.fromFile,\n logOutput: opts.outputDetail,\n saveEntries: opts.saveEntries,\n });\n }\n );\n\n return copy;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAwB;AAExB,iCAA2B;AAC3B,2BAaO;AAEA,MAAM,kBAAkB,MAAM;AACnC,QAAM,OAAO,IAAI,yBAAQ,EACtB,QAAQ,MAAM,EACd,YAAY,cAAc,EAC1B,YAAY,SAAS;AAAA,CAAI,EACzB,mBAAmB,IAAI,EACvB,aAAa;AAEhB,OACG,QAAQ,OAAO,EACf,YAAY,wDAAwD,EACpE;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC,SAAS,aAAa,kCAAkC,EACxD,SAAS,mBAAmB,gCAAgC,EAC5D;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC,UAAU,2BAAM,EAChB,UAAU,gCAAW,EACrB,UAAU,iCAAY,EACtB,UAAU,iCAAY,EACtB,UAAU,4BAAO,EACjB,UAAU,8BAAS,EACnB;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC,UAAU,4BAAO,EACjB,UAAU,0BAAK,EACf,UAAU,2BAAM,EAChB,UAAU,kCAAa,EACvB,UAAU,gCAAW,EACrB,MAAM,oEAAoE,EAC1E;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAIF,EACC;AAAA,IACC,OACE,eACA,SACA,eACA,SACG;AACH,YAAM,EAAE,UAAU,GAAG,SAAS,IAAI;AAClC,YAAM,YAAuB;AAAA,QAC3B;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,SAAS,KAAK;AAAA,MAChB;AAEA,aAAO,UAAM;AAAA,QACX,CAAC,QAAQ,WAAW,eAAe,SAAS,aAAa;AAAA,QACzD;AAAA,YACA,uCAAiB,EAAE,WAAW,GAAG,SAAS,CAAC;AAAA,MAC7C,EAAE,eAAe;AAAA,QACf,QAAQ,KAAK;AAAA,QACb,UAAU,KAAK;AAAA,QACf,WAAW,KAAK;AAAA,QAChB,aAAa,KAAK;AAAA,MACpB,CAAC;AAAA,IACH;AAAA,EACF;AAEF,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/commands/create.js
CHANGED
|
@@ -50,8 +50,7 @@ const makeCreateCommand = () => {
|
|
|
50
50
|
["create", "project", projectId],
|
|
51
51
|
opts
|
|
52
52
|
).CreateProject(createProject);
|
|
53
|
-
if (project)
|
|
54
|
-
await (0, import_shell.shell)().restart();
|
|
53
|
+
if (project) await (0, import_shell.shell)().restart();
|
|
55
54
|
}
|
|
56
55
|
);
|
|
57
56
|
create.command("key").description("create a new api key").argument('<"key name">', "the name of the key to create").argument('["description"]', "provide a description for the key (optional)").usage('<"key name"> ["description"] (both args in "double quotes")').addHelpText(
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/commands/create.ts"],
|
|
4
4
|
"sourcesContent": ["import { Command } from 'commander';\nimport { Project } from 'contensis-core-api';\nimport { cliCommand } from '~/services/ContensisCliService';\nimport { shell } from '~/shell';\n\nexport const makeCreateCommand = () => {\n const create = new Command()\n .command('create')\n .description('create command')\n .addHelpText('after', `\\n`)\n .showHelpAfterError(true)\n .exitOverride();\n\n create\n .command('project')\n .description('create a new project')\n .argument('<projectId>', 'the id of the project to create')\n .argument('<name>', 'the name of the project to create')\n .argument('[description]', 'optional description of the project')\n .option(\n '-l --language <language>',\n 'the default language of the project to create',\n 'en-GB'\n )\n .option(\n '-langs --supported-languages <langs...>',\n 'space separated list of other supported languages'\n )\n .usage(\n 'projectId \"Project name\" [\"Description of project\"] --language en-GB --supported-languages es-ES de-DE nl-NL'\n )\n .addHelpText('after', `\\n`)\n .action(\n async (projectId: string, name: string, description = '', opts: any) => {\n const createProject: Project = {\n id: projectId,\n name,\n description,\n primaryLanguage: opts.language,\n supportedLanguages: opts.supportedLanguages || [],\n };\n\n const project = await cliCommand(\n ['create', 'project', projectId],\n opts\n ).CreateProject(createProject);\n if (project) await shell().restart();\n }\n );\n\n create\n .command('key')\n .description('create a new api key')\n .argument('<\"key name\">', 'the name of the key to create')\n .argument('[\"description\"]', 'provide a description for the key (optional)')\n .usage('<\"key name\"> [\"description\"] (both args in \"double quotes\")')\n .addHelpText(\n 'after',\n `\nExample call:\n > create key \"my new key\" \"Created key for demonstration\"\\n`\n )\n .action(async (name: string, description: string, opts: any) => {\n await cliCommand(['create', 'key', name], opts).CreateApiKey(\n name,\n description\n );\n });\n\n create\n .command('role')\n .description('create a new role')\n .argument('<\"Role name\">', 'the name of the role to create')\n .argument('[\"Role description\">', 'the description of the role')\n .option('--disabled', 'do not enable the created role', false)\n .addHelpText(\n 'after',\n `\nExample call:\n > create role \"My role\" \"This role is for testing\" --disabled \\n`\n )\n .action(async (roleName: string, description: string, opts) => {\n await cliCommand(['create', 'role', roleName], opts).CreateRole({\n name: roleName,\n description,\n enabled: !opts.disabled,\n assignments: { apiKeys: [], groups: [], users: [] },\n permissions: { contentTypes: [], entries: [] },\n });\n });\n\n return create;\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAwB;AAExB,iCAA2B;AAC3B,mBAAsB;AAEf,MAAM,oBAAoB,MAAM;AACrC,QAAM,SAAS,IAAI,yBAAQ,EACxB,QAAQ,QAAQ,EAChB,YAAY,gBAAgB,EAC5B,YAAY,SAAS;AAAA,CAAI,EACzB,mBAAmB,IAAI,EACvB,aAAa;AAEhB,SACG,QAAQ,SAAS,EACjB,YAAY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isOpts: () => mapContensisOpts,
|
|
38
38
|
noCache: () => noCache,
|
|
39
|
+
noPublish: () => noPublish,
|
|
39
40
|
outputDetail: () => outputDetail,
|
|
40
41
|
project: () => project,
|
|
41
42
|
requiredBy: () => requiredBy,
|
|
@@ -54,6 +55,8 @@ const mapContensisOpts = (opts = {}) => ({
|
|
|
54
55
|
} : void 0,
|
|
55
56
|
models: opts.modelIds,
|
|
56
57
|
copyField: opts.copyField,
|
|
58
|
+
updateField: opts.updateField,
|
|
59
|
+
// convert various cli options into MigrateRequest.query format
|
|
57
60
|
query: opts.id || opts.entryIds || opts.search || opts.fields || opts.orderBy || opts.paths || opts.assetType || opts.contentType || opts.dataFormat || opts.deliveryApi || opts.latest || opts.versionStatus ? {
|
|
58
61
|
assetTypes: opts.assetType,
|
|
59
62
|
contentTypeIds: opts.contentType,
|
|
@@ -70,8 +73,12 @@ const mapContensisOpts = (opts = {}) => ({
|
|
|
70
73
|
transformGuids: !opts.preserveGuids,
|
|
71
74
|
ignoreErrors: opts.ignoreErrors,
|
|
72
75
|
noCache: !opts.cache,
|
|
76
|
+
// arg is inverted automatically from `--no-cache` to `cache: false`
|
|
73
77
|
includeDefaults: opts.defaults,
|
|
74
|
-
|
|
78
|
+
// arg is inverted automatically from `--no-defaults` to `defaults: false`
|
|
79
|
+
concurrency: opts.concurrency ? Number(opts.concurrency) : void 0,
|
|
80
|
+
noPublish: !opts.publish
|
|
81
|
+
// arg is inverted automatically from `--no-publish` to `publish: false`
|
|
75
82
|
});
|
|
76
83
|
const output = new import_commander.Option(
|
|
77
84
|
"-o --output <output>",
|
|
@@ -79,8 +86,8 @@ const output = new import_commander.Option(
|
|
|
79
86
|
);
|
|
80
87
|
const format = new import_commander.Option(
|
|
81
88
|
"-f --format <format>",
|
|
82
|
-
"format output as csv, json, xml or
|
|
83
|
-
).choices(["csv", "json", "xml", "table"]);
|
|
89
|
+
"format output as csv, json, html, xml or default"
|
|
90
|
+
).choices(["csv", "json", "html", "xml", "table"]);
|
|
84
91
|
const alias = new import_commander.Option(
|
|
85
92
|
"-a --alias <alias>",
|
|
86
93
|
"the cloud CMS alias to connect your request with"
|
|
@@ -173,7 +180,11 @@ const concurrency = new import_commander.Option(
|
|
|
173
180
|
).default(2);
|
|
174
181
|
const noCache = new import_commander.Option(
|
|
175
182
|
"--no-cache",
|
|
176
|
-
"
|
|
183
|
+
"ignore internal cache and rebuild all resources from scratch"
|
|
184
|
+
);
|
|
185
|
+
const noPublish = new import_commander.Option(
|
|
186
|
+
"--no-publish",
|
|
187
|
+
"don't publish created or updated entries"
|
|
177
188
|
);
|
|
178
189
|
const addConnectOptions = (program) => program.addOption(alias.hideHelp()).addOption(project.hideHelp());
|
|
179
190
|
const addAuthenticationOptions = (program) => program.addOption(user.hideHelp()).addOption(password.hideHelp()).addOption(clientId.hideHelp()).addOption(sharedSecret.hideHelp());
|
|
@@ -212,6 +223,7 @@ const addGlobalOptions = (program) => {
|
|
|
212
223
|
latest,
|
|
213
224
|
mapContensisOpts,
|
|
214
225
|
noCache,
|
|
226
|
+
noPublish,
|
|
215
227
|
outputDetail,
|
|
216
228
|
project,
|
|
217
229
|
requiredBy,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/commands/globalOptions.ts"],
|
|
4
|
-
"sourcesContent": ["import { Command, Option } from 'commander';\nimport { MigrateRequest } from 'migratortron';\nimport { url } from '~/util';\n\n// Map various input options into a request to be processed\n// by Migratortron / Contensis import library\nexport const mapContensisOpts = (opts: any = {}): MigrateRequest => ({\n source:\n opts.sourceAlias || opts.sourceProjectId\n ? {\n url: opts.sourceAlias\n ? url(opts.sourceAlias, 'website').cms\n : (undefined as any),\n project: opts.sourceProjectId || (undefined as any),\n }\n : undefined,\n models: opts.modelIds,\n copyField: opts.copyField,\n // convert various cli options into MigrateRequest.query format\n query:\n opts.id ||\n opts.entryIds ||\n opts.search ||\n opts.fields ||\n opts.orderBy ||\n opts.paths ||\n opts.assetType ||\n opts.contentType ||\n opts.dataFormat ||\n opts.deliveryApi ||\n opts.latest ||\n opts.versionStatus\n ? {\n assetTypes: opts.assetType,\n contentTypeIds: opts.contentType,\n dataFormats: opts.dataFormat ? [opts.dataFormat] : undefined,\n fields: opts.fields,\n includeIds: opts.id || opts.entryIds,\n includePaths: opts.paths,\n orderBy: opts.orderBy,\n searchTerm: opts.search,\n useDelivery: opts.deliveryApi,\n versionStatus: opts.latest ? 'latest' : opts.versionStatus,\n }\n : undefined,\n zenQL: opts.zenql,\n transformGuids: !opts.preserveGuids,\n ignoreErrors: opts.ignoreErrors,\n noCache: !opts.cache, // arg is inverted automatically from `--no-cache` to `cache: false`\n includeDefaults: opts.defaults, // arg is inverted automatically from `--no-defaults` to `defaults: false`\n concurrency: opts.concurrency ? Number(opts.concurrency) : undefined,\n});\n\n/* Output options */\nconst output = new Option(\n '-o --output <output>',\n 'save output to a file e.g. --output ./output.txt'\n);\n\nconst format = new Option(\n '-f --format <format>',\n 'format output as csv, json, xml or
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAgC;AAEhC,kBAAoB;AAIb,MAAM,mBAAmB,CAAC,OAAY,CAAC,OAAuB;AAAA,EACnE,QACE,KAAK,eAAe,KAAK,kBACrB;AAAA,IACE,KAAK,KAAK,kBACN,iBAAI,KAAK,aAAa,SAAS,EAAE,MAChC;AAAA,IACL,SAAS,KAAK,mBAAoB;AAAA,EACpC,IACA;AAAA,EACN,QAAQ,KAAK;AAAA,EACb,WAAW,KAAK;AAAA,
|
|
4
|
+
"sourcesContent": ["import { Command, Option } from 'commander';\nimport { MigrateRequest } from 'migratortron';\nimport { url } from '~/util';\n\n// Map various input options into a request to be processed\n// by Migratortron / Contensis import library\nexport const mapContensisOpts = (opts: any = {}): MigrateRequest => ({\n source:\n opts.sourceAlias || opts.sourceProjectId\n ? {\n url: opts.sourceAlias\n ? url(opts.sourceAlias, 'website').cms\n : (undefined as any),\n project: opts.sourceProjectId || (undefined as any),\n }\n : undefined,\n models: opts.modelIds,\n copyField: opts.copyField,\n updateField: opts.updateField,\n // convert various cli options into MigrateRequest.query format\n query:\n opts.id ||\n opts.entryIds ||\n opts.search ||\n opts.fields ||\n opts.orderBy ||\n opts.paths ||\n opts.assetType ||\n opts.contentType ||\n opts.dataFormat ||\n opts.deliveryApi ||\n opts.latest ||\n opts.versionStatus\n ? {\n assetTypes: opts.assetType,\n contentTypeIds: opts.contentType,\n dataFormats: opts.dataFormat ? [opts.dataFormat] : undefined,\n fields: opts.fields,\n includeIds: opts.id || opts.entryIds,\n includePaths: opts.paths,\n orderBy: opts.orderBy,\n searchTerm: opts.search,\n useDelivery: opts.deliveryApi,\n versionStatus: opts.latest ? 'latest' : opts.versionStatus,\n }\n : undefined,\n zenQL: opts.zenql,\n transformGuids: !opts.preserveGuids,\n ignoreErrors: opts.ignoreErrors,\n noCache: !opts.cache, // arg is inverted automatically from `--no-cache` to `cache: false`\n includeDefaults: opts.defaults, // arg is inverted automatically from `--no-defaults` to `defaults: false`\n concurrency: opts.concurrency ? Number(opts.concurrency) : undefined,\n noPublish: !opts.publish, // arg is inverted automatically from `--no-publish` to `publish: false`\n});\n\n/* Output options */\nconst output = new Option(\n '-o --output <output>',\n 'save output to a file e.g. --output ./output.txt'\n);\n\nconst format = new Option(\n '-f --format <format>',\n 'format output as csv, json, html, xml or default'\n).choices(['csv', 'json', 'html', 'xml', 'table']);\n\n/* Connect options */\nconst alias = new Option(\n '-a --alias <alias>',\n 'the cloud CMS alias to connect your request with'\n);\n\nexport const project = new Option(\n '-p --project-id <projectId>',\n 'the projectId to make your request with'\n);\n\n/* Authentication options */\nconst user = new Option(\n '-u --user <user>',\n 'the username to authenticate your request with'\n);\nconst password = new Option(\n '-pw --password <password>',\n 'the password to use to login with (optional/insecure)'\n);\nconst clientId = new Option(\n '-id --client-id <clientId>',\n 'the clientId to authenticate your request with'\n);\nconst sharedSecret = new Option(\n '-s --shared-secret <sharedSecret>',\n 'the shared secret to use when logging in with a client id'\n);\n\n/* Model get options */\nexport const requiredBy = new Option(\n '--required-by',\n 'shows the id(s) that created each dependency'\n);\nexport const exportOption = new Option(\n '--export',\n 'export the raw resources that make up the content model(s) (used with --output)'\n);\n\n/* Entry get options */\nexport const delivery = new Option(\n '-delivery --delivery-api',\n 'use delivery api to get the entries'\n);\nexport const search = new Option(\n '--search <phrase>',\n 'get entries with the search phrase, use quotes for multiple words'\n);\nexport const zenql = new Option(\n '-q --zenql <zenql>',\n 'get entries with a supplied ZenQL statement'\n);\n\nexport const entryId = new Option('-i --id <id...>', 'the entry id(s) to get');\nexport const contentTypes = new Option(\n '-c --content-type <contentType...>',\n 'get entries of these content type(s)'\n);\nexport const assetTypes = new Option(\n '-at --asset-type <assetType...>',\n 'get assets of given content type(s) e.g. image word pdf'\n);\nexport const versionStatus = new Option(\n '-vs --version-status <versionStatus>',\n 'the entry versions to get'\n)\n .choices(['latest', 'published'])\n .default('published');\n\nexport const latest = new Option('--latest', 'get the latest entry versions');\n\n/* Import options */\nexport const fromFile = new Option(\n '-file --from-file <fromFile>',\n 'file path to import asset(s) from'\n);\n\nexport const fromCms = new Option(\n '-source --source-alias <fromCms>',\n 'the cloud CMS alias to import asset(s) from'\n);\nexport const fromProject = new Option(\n '-sp --source-project-id <fromProject>',\n 'the id of the Contensis project to import asset(s) from (Default: [last connected project])'\n);\n\nexport const commit = new Option(\n '--commit',\n 'add this flag only after you have run a preview of the import and agree with the analysis'\n).default(false);\n\nexport const ignoreErrors = new Option(\n '-ignore --ignore-errors',\n 'commit the import ignoring any reported errors'\n).default(false);\n\nexport const outputDetail = 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\nexport const saveEntries = new Option(\n '-save --save-entries',\n \"save the entries we're migrating instead of the migration preview (used with --output)\"\n);\n\nexport const concurrency = new Option(\n '-conc --concurrency <concurrency>',\n 'the number of entries to load in parallel'\n).default(2);\n\nexport const noCache = new Option(\n '--no-cache',\n 'ignore internal cache and rebuild all resources from scratch'\n);\n\nexport const noPublish = new Option(\n '--no-publish',\n \"don't publish created or updated entries\"\n);\n\nexport const addConnectOptions = (program: Command) =>\n program.addOption(alias.hideHelp()).addOption(project.hideHelp());\n\nexport const addAuthenticationOptions = (program: Command) =>\n program\n .addOption(user.hideHelp())\n .addOption(password.hideHelp())\n .addOption(clientId.hideHelp())\n .addOption(sharedSecret.hideHelp());\n\nconst addOutputAndFormatOptions = (program: Command) =>\n program.addOption(output).addOption(format);\n\nexport const addImportOptions = (program: Command) => {\n for (const command of program.commands) {\n command.addOption(fromCms).addOption(fromProject).addOption(fromFile);\n }\n return program;\n};\n\nexport const addGlobalOptions = (program: Command) => {\n for (const command of program.commands) {\n addOutputAndFormatOptions(command);\n addConnectOptions(command);\n addAuthenticationOptions(command);\n }\n return program;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAgC;AAEhC,kBAAoB;AAIb,MAAM,mBAAmB,CAAC,OAAY,CAAC,OAAuB;AAAA,EACnE,QACE,KAAK,eAAe,KAAK,kBACrB;AAAA,IACE,KAAK,KAAK,kBACN,iBAAI,KAAK,aAAa,SAAS,EAAE,MAChC;AAAA,IACL,SAAS,KAAK,mBAAoB;AAAA,EACpC,IACA;AAAA,EACN,QAAQ,KAAK;AAAA,EACb,WAAW,KAAK;AAAA,EA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MAAM,SAAS,CAAC,EAAE,UAAU,QAAQ,SAAS,CAAC;AAE3D,MAAM,2BAA2B,CAAC,YACvC,QACG,UAAU,KAAK,SAAS,CAAC,EACzB,UAAU,SAAS,SAAS,CAAC,EAC7B,UAAU,SAAS,SAAS,CAAC,EAC7B,UAAU,aAAa,SAAS,CAAC;AAEtC,MAAM,4BAA4B,CAAC,YACjC,QAAQ,UAAU,MAAM,EAAE,UAAU,MAAM;AAErC,MAAM,mBAAmB,CAAC,YAAqB;AACpD,aAAW,WAAW,QAAQ,UAAU;AACtC,YAAQ,UAAU,OAAO,EAAE,UAAU,WAAW,EAAE,UAAU,QAAQ;AAAA,EACtE;AACA,SAAO;AACT;AAEO,MAAM,mBAAmB,CAAC,YAAqB;AACpD,aAAW,WAAW,QAAQ,UAAU;AACtC,8BAA0B,OAAO;AACjC,sBAAkB,OAAO;AACzB,6BAAyB,OAAO;AAAA,EAClC;AACA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/commands/import.js
CHANGED
|
@@ -103,7 +103,7 @@ Example call:
|
|
|
103
103
|
).addOption(import_globalOptions.entryId).addOption(import_globalOptions.zenql).addOption(import_globalOptions.contentTypes).addOption(import_globalOptions.assetTypes).addOption(import_globalOptions.latest).addOption(import_globalOptions.versionStatus).addOption(import_globalOptions.commit).option(
|
|
104
104
|
"-preserve --preserve-guids",
|
|
105
105
|
"include this flag when you are importing entries that you have previously exported and wish to update"
|
|
106
|
-
).addOption(import_globalOptions.concurrency).addOption(import_globalOptions.outputDetail).addOption(import_globalOptions.ignoreErrors).addOption(import_globalOptions.noCache).addOption(import_globalOptions.saveEntries).addHelpText(
|
|
106
|
+
).addOption(import_globalOptions.concurrency).addOption(import_globalOptions.outputDetail).addOption(import_globalOptions.ignoreErrors).addOption(import_globalOptions.noCache).addOption(import_globalOptions.noPublish).addOption(import_globalOptions.saveEntries).addHelpText(
|
|
107
107
|
"after",
|
|
108
108
|
`
|
|
109
109
|
Example call:
|
|
@@ -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 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(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,
|
|
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,SAA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K;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/index.js
CHANGED
|
@@ -38,6 +38,7 @@ var import_login = require("./login");
|
|
|
38
38
|
var import_push = require("./push");
|
|
39
39
|
var import_remove = require("./remove");
|
|
40
40
|
var import_set = require("./set");
|
|
41
|
+
var import_update = require("./update");
|
|
41
42
|
const commands = () => {
|
|
42
43
|
const program = new import_commander.Command().name("contensis").version(import_version.LIB_VERSION).configureOutput({
|
|
43
44
|
writeErr: (str) => {
|
|
@@ -97,9 +98,10 @@ const commands = () => {
|
|
|
97
98
|
program.addCommand(
|
|
98
99
|
(0, import_globalOptions.addConnectOptions)((0, import_set.makeSetCommand)()).copyInheritedSettings(program)
|
|
99
100
|
);
|
|
101
|
+
program.addCommand(
|
|
102
|
+
(0, import_globalOptions.addGlobalOptions)((0, import_update.makeUpdateCommand)()).copyInheritedSettings(program)
|
|
103
|
+
);
|
|
100
104
|
return program;
|
|
101
105
|
};
|
|
102
106
|
var commands_default = commands;
|
|
103
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
104
|
-
0 && (module.exports = {});
|
|
105
107
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/commands/index.ts"],
|
|
4
|
-
"sourcesContent": ["import { Command } from 'commander';\nimport { Logger } from '~/util/logger';\nimport { LIB_VERSION } from '~/version';\nimport { makeConnectCommand } from './connect';\nimport { makeCopyCommand } from './copy';\nimport { makeCreateCommand } from './create';\nimport { makeDevCommand } from './dev';\nimport { makeDiffCommand } from './diff';\nimport { makeExecuteCommand } from './execute';\nimport { makeGetCommand } from './get';\nimport {\n addAuthenticationOptions,\n addConnectOptions,\n addGlobalOptions,\n addImportOptions,\n} from './globalOptions';\nimport { makeImportCommand } from './import';\nimport { makeListCommand } from './list';\nimport { makeLoginCommand } from './login';\nimport { makePushCommand } from './push';\nimport { makeRemoveCommand } from './remove';\nimport { makeSetCommand } from './set';\n\nconst commands = () => {\n const program = new Command()\n .name('contensis')\n .version(LIB_VERSION)\n .configureOutput({\n writeErr: str => {\n return str.toLowerCase().includes('error')\n ? Logger.error(`Command ${str}`)\n : str.trim() && Logger.help(str);\n },\n })\n .addHelpText(\n 'after',\n Logger.helpText`\n>> Each command has its own help - for example:\n > login --help\\n > get --help\n`\n )\n .exitOverride()\n .showHelpAfterError(true);\n\n program.addCommand(\n addAuthenticationOptions(makeConnectCommand()).copyInheritedSettings(\n program\n )\n );\n program.addCommand(\n addGlobalOptions(makeCreateCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addGlobalOptions(makeCopyCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addConnectOptions(\n addAuthenticationOptions(makeDevCommand())\n ).copyInheritedSettings(program)\n );\n program.addCommand(\n addGlobalOptions(addImportOptions(makeDiffCommand())).copyInheritedSettings(\n program\n )\n );\n program.addCommand(\n addGlobalOptions(makeExecuteCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addGlobalOptions(makeGetCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addGlobalOptions(\n addImportOptions(makeImportCommand())\n ).copyInheritedSettings(program)\n );\n program.addCommand(\n addGlobalOptions(makeListCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addConnectOptions(makeLoginCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addGlobalOptions(makePushCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addGlobalOptions(makeRemoveCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addConnectOptions(makeSetCommand()).copyInheritedSettings(program)\n );\n\n return program;\n};\n\nexport default commands;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAwB;AACxB,oBAAuB;AACvB,qBAA4B;AAC5B,qBAAmC;AACnC,kBAAgC;AAChC,oBAAkC;AAClC,iBAA+B;AAC/B,kBAAgC;AAChC,qBAAmC;AACnC,iBAA+B;AAC/B,2BAKO;AACP,oBAAkC;AAClC,kBAAgC;AAChC,mBAAiC;AACjC,kBAAgC;AAChC,oBAAkC;AAClC,iBAA+B;
|
|
4
|
+
"sourcesContent": ["import { Command } from 'commander';\nimport { Logger } from '~/util/logger';\nimport { LIB_VERSION } from '~/version';\nimport { makeConnectCommand } from './connect';\nimport { makeCopyCommand } from './copy';\nimport { makeCreateCommand } from './create';\nimport { makeDevCommand } from './dev';\nimport { makeDiffCommand } from './diff';\nimport { makeExecuteCommand } from './execute';\nimport { makeGetCommand } from './get';\nimport {\n addAuthenticationOptions,\n addConnectOptions,\n addGlobalOptions,\n addImportOptions,\n} from './globalOptions';\nimport { makeImportCommand } from './import';\nimport { makeListCommand } from './list';\nimport { makeLoginCommand } from './login';\nimport { makePushCommand } from './push';\nimport { makeRemoveCommand } from './remove';\nimport { makeSetCommand } from './set';\nimport { makeUpdateCommand } from './update';\n\nconst commands = () => {\n const program = new Command()\n .name('contensis')\n .version(LIB_VERSION)\n .configureOutput({\n writeErr: str => {\n return str.toLowerCase().includes('error')\n ? Logger.error(`Command ${str}`)\n : str.trim() && Logger.help(str);\n },\n })\n .addHelpText(\n 'after',\n Logger.helpText`\n>> Each command has its own help - for example:\n > login --help\\n > get --help\n`\n )\n .exitOverride()\n .showHelpAfterError(true);\n\n program.addCommand(\n addAuthenticationOptions(makeConnectCommand()).copyInheritedSettings(\n program\n )\n );\n program.addCommand(\n addGlobalOptions(makeCreateCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addGlobalOptions(makeCopyCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addConnectOptions(\n addAuthenticationOptions(makeDevCommand())\n ).copyInheritedSettings(program)\n );\n program.addCommand(\n addGlobalOptions(addImportOptions(makeDiffCommand())).copyInheritedSettings(\n program\n )\n );\n program.addCommand(\n addGlobalOptions(makeExecuteCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addGlobalOptions(makeGetCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addGlobalOptions(\n addImportOptions(makeImportCommand())\n ).copyInheritedSettings(program)\n );\n program.addCommand(\n addGlobalOptions(makeListCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addConnectOptions(makeLoginCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addGlobalOptions(makePushCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addGlobalOptions(makeRemoveCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addConnectOptions(makeSetCommand()).copyInheritedSettings(program)\n );\n program.addCommand(\n addGlobalOptions(makeUpdateCommand()).copyInheritedSettings(program)\n );\n\n return program;\n};\n\nexport default commands;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAwB;AACxB,oBAAuB;AACvB,qBAA4B;AAC5B,qBAAmC;AACnC,kBAAgC;AAChC,oBAAkC;AAClC,iBAA+B;AAC/B,kBAAgC;AAChC,qBAAmC;AACnC,iBAA+B;AAC/B,2BAKO;AACP,oBAAkC;AAClC,kBAAgC;AAChC,mBAAiC;AACjC,kBAAgC;AAChC,oBAAkC;AAClC,iBAA+B;AAC/B,oBAAkC;AAElC,MAAM,WAAW,MAAM;AACrB,QAAM,UAAU,IAAI,yBAAQ,EACzB,KAAK,WAAW,EAChB,QAAQ,0BAAW,EACnB,gBAAgB;AAAA,IACf,UAAU,SAAO;AACf,aAAO,IAAI,YAAY,EAAE,SAAS,OAAO,IACrC,qBAAO,MAAM,WAAW,GAAG,EAAE,IAC7B,IAAI,KAAK,KAAK,qBAAO,KAAK,GAAG;AAAA,IACnC;AAAA,EACF,CAAC,EACA;AAAA,IACC;AAAA,IACA,qBAAO;AAAA;AAAA;AAAA;AAAA,EAIT,E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AQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/commands/list.ts"],
|
|
4
4
|
"sourcesContent": ["import { Command } from 'commander';\nimport { cliCommand } from '~/services/ContensisCliService';\nimport { exportOption, mapContensisOpts, noCache } 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 .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 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;AAC3B,2BAAwD;AAEjD,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,G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,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
|
}
|
package/dist/commands/login.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/commands/login.ts"],
|
|
4
4
|
"sourcesContent": ["import { Command } from 'commander';\nimport { cliCommand } from '~/services/ContensisCliService';\nimport { shell } from '~/shell';\n\nexport const makeLoginCommand = () => {\n const login = new Command()\n .command('login')\n .description('login to a connected Contensis instance')\n .argument('<user/clientId>', 'the username to login with')\n .argument(\n '[password]',\n 'the password to use to login with (optional/insecure)'\n )\n .option(\n '-s --shared-secret <sharedSecret>',\n 'the shared secret to use when logging in with a client id'\n )\n .usage('<user/clientId> [password] [-s <sharedSecret>]')\n .addHelpText(\n 'after',\n `\nExample call:\n > login myuserid\\n -- or --\\n > login {clientId} -s {sharedSecret}\n`\n )\n .action(async (user, password, opts) => {\n const token = await cliCommand(['login', user]).Login(user, {\n password,\n sharedSecret: opts.sharedSecret,\n });\n if (token) await shell().restart();\n });\n return login;\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAwB;AACxB,iCAA2B;AAC3B,mBAAsB;AAEf,MAAM,mBAAmB,MAAM;AACpC,QAAM,QAAQ,IAAI,yBAAQ,EACvB,QAAQ,OAAO,EACf,YAAY,yCAAyC,EACrD,SAAS,mBAAmB,4BAA4B,EACxD;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC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