@parsable/plugin-author-cli 1.1.1 → 1.1.3
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 +8 -8
- package/oclif.manifest.json +1 -1
- package/package.json +10 -5
- package/src/commands/base.js +1 -1
- package/src/commands/jobs/create.js +1 -1
- package/src/services/client/field-data.js +1 -1
- package/src/services/jobs/create-fn.js +8 -2
- package/src/services/template_copy/helpers/config-to-payload.map.js +1 -1
- package/src/services/template_copy/helpers/prompt-to-config.map.js +11 -11
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ $ npm install -g @parsable/plugin-author-cli
|
|
|
19
19
|
$ parsable-cli COMMAND
|
|
20
20
|
running command...
|
|
21
21
|
$ parsable-cli (-v|--version|version)
|
|
22
|
-
@parsable/plugin-author-cli/1.1.
|
|
22
|
+
@parsable/plugin-author-cli/1.1.3 linux-x64 node-v22.23.2
|
|
23
23
|
$ parsable-cli --help [COMMAND]
|
|
24
24
|
USAGE
|
|
25
25
|
$ parsable-cli COMMAND
|
|
@@ -101,7 +101,7 @@ EXAMPLES
|
|
|
101
101
|
parsable-cli exec-data:delete -c /absolute/path/to/my/file.csv -A --force
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
-
_See code: [src/commands/exec-data/delete.js](https://github.com/parsable/author-cli/blob/v1.1.
|
|
104
|
+
_See code: [src/commands/exec-data/delete.js](https://github.com/parsable/author-cli/blob/v1.1.3/src/commands/exec-data/delete.js)_
|
|
105
105
|
|
|
106
106
|
## `parsable-cli help [COMMAND]`
|
|
107
107
|
|
|
@@ -140,8 +140,8 @@ OPTIONS
|
|
|
140
140
|
--sort=sort property to sort by (prepend '-' for descending)
|
|
141
141
|
--team-id=team-id (required) Id of the team who will own the jobs
|
|
142
142
|
|
|
143
|
-
--template-ids=template-ids
|
|
144
|
-
|
|
143
|
+
--template-ids=template-ids template id(s) to be assigned for the created jobs and should match to the number of
|
|
144
|
+
jobs (comma-separated)
|
|
145
145
|
|
|
146
146
|
--title=title (required) title of the job(s) and should match to the number of jobs
|
|
147
147
|
(comma-separated)
|
|
@@ -157,7 +157,7 @@ EXAMPLES
|
|
|
157
157
|
--template-ids=<template_id>,<template_id>
|
|
158
158
|
```
|
|
159
159
|
|
|
160
|
-
_See code: [src/commands/jobs/create.js](https://github.com/parsable/author-cli/blob/v1.1.
|
|
160
|
+
_See code: [src/commands/jobs/create.js](https://github.com/parsable/author-cli/blob/v1.1.3/src/commands/jobs/create.js)_
|
|
161
161
|
|
|
162
162
|
## `parsable-cli jobs:delete`
|
|
163
163
|
|
|
@@ -213,7 +213,7 @@ EXAMPLES
|
|
|
213
213
|
parsable-cli jobs:delete -t abc123 -i path/to/the/file.csv --force
|
|
214
214
|
```
|
|
215
215
|
|
|
216
|
-
_See code: [src/commands/jobs/delete.js](https://github.com/parsable/author-cli/blob/v1.1.
|
|
216
|
+
_See code: [src/commands/jobs/delete.js](https://github.com/parsable/author-cli/blob/v1.1.3/src/commands/jobs/delete.js)_
|
|
217
217
|
|
|
218
218
|
## `parsable-cli template:copy`
|
|
219
219
|
|
|
@@ -352,7 +352,7 @@ EXAMPLES
|
|
|
352
352
|
parsable-cli template:copy --template-ids <template_id>,<template_id>
|
|
353
353
|
```
|
|
354
354
|
|
|
355
|
-
_See code: [src/commands/template/copy.js](https://github.com/parsable/author-cli/blob/v1.1.
|
|
355
|
+
_See code: [src/commands/template/copy.js](https://github.com/parsable/author-cli/blob/v1.1.3/src/commands/template/copy.js)_
|
|
356
356
|
|
|
357
357
|
## `parsable-cli template:copy:status`
|
|
358
358
|
|
|
@@ -401,5 +401,5 @@ EXAMPLES
|
|
|
401
401
|
parsable-cli template:copy:status --filter status=FAILED
|
|
402
402
|
```
|
|
403
403
|
|
|
404
|
-
_See code: [src/commands/template/copy/status.js](https://github.com/parsable/author-cli/blob/v1.1.
|
|
404
|
+
_See code: [src/commands/template/copy/status.js](https://github.com/parsable/author-cli/blob/v1.1.3/src/commands/template/copy/status.js)_
|
|
405
405
|
<!-- commandsstop -->
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"1.1.1","commands":{"base":{"id":"base","pluginName":"@parsable/plugin-author-cli","pluginType":"core","hidden":true,"aliases":[],"flags":{},"args":[]},"exec-data:delete":{"id":"exec-data:delete","description":"Delete execution data corresponding to a specific Input Field on a Job.\n\nFields are uniquely identified by locators, which are combinations of:\n 1. the 'id' of the Field itself, plus\n 2. the 'jobBaseStepId' of the Field's parent Step\n\nA single locator can be specified inline, using the arguments --field-id and --job-base-step-id.\nAlternatively, a list of locators can be provided in the form of a CSV file via the --fields-csv argument.\n(More details provided below in the context of the --fields-csv argument.)\n\nA time range must be set using the flags:\n 1. 'from-time'\n 2. 'until-time'\n 3. both of the preceding, or\n 4. 'all'\nIf no range is set the delete command will not run.\nIf 'all' is combined with 'from-time' or 'until-time' the command will not run.\n","pluginName":"@parsable/plugin-author-cli","pluginType":"core","hidden":false,"aliases":[],"examples":["parsable-cli exec-data:delete --field-id=abc123 --job-base-step-id=def456 --all","parsable-cli exec-data:delete -f abc123 -j def456 -A","parsable-cli exec-data:delete --field-id=abc123 --job-base-step-id=def456 --from-time=123456789","parsable-cli exec-data:delete --field-id=abc123 --job-base-step-id=def456 --until-time=123456789","parsable-cli exec-data:delete --field-id=abc123 --job-base-step-id=def456 --from-time=123456789 --until-time=123456790","parsable-cli exec-data:delete --fields-csv=/absolute/path/to/my/file.csv --all","parsable-cli exec-data:delete -c /absolute/path/to/my/file.csv -A","parsable-cli exec-data:delete -c /absolute/path/to/my/file.csv -A --force"],"flags":{"field-id":{"name":"field-id","type":"option","char":"f","description":"The id of the Field to delete execution data from."},"job-base-step-id":{"name":"job-base-step-id","type":"option","char":"j","description":"The jobBaseStepId of the Field's parent Step."},"fields-csv":{"name":"fields-csv","type":"option","char":"c","description":"The absolute path to a CSV file containing rows of field-id/job-base-step-id pairs.\nThe CSV file must not start with a header row (the first line must be the first field locator you wish to delete data for).\nEach row should have as its first element the field id, and as its second element the job-base-step id.\nExample:\n field_id,job_base_step_id\n abc123,def456\n ghi789,jkl012\n"},"from-time":{"name":"from-time","type":"option","description":"Any execution data sent to the server before this timestamp will not be deleted (format: UNIX, seconds since epoch)."},"until-time":{"name":"until-time","type":"option","description":"Any execution data sent to the server on or after this timestamp will not be deleted (format: UNIX, seconds since epoch)."},"all":{"name":"all","type":"boolean","char":"A","description":"When set, deletes all execution data regardless of when it was sent to the server.","allowNo":false},"force":{"name":"force","type":"boolean","description":"When set, skips the \"Are you sure\" prompt.","allowNo":false}},"args":[]},"jobs:create":{"id":"jobs:create","description":"Create jobs.\n\nSend a request to create a job(s) and assigned templates.\nCurrently it only supports on-demand job type.\n","pluginName":"@parsable/plugin-author-cli","pluginType":"core","hidden":false,"aliases":[],"examples":["parsable-cli jobs:create --team-id=abc123 --title='Job Sample 1'","parsable-cli jobs:create --team-id=abc123 --number-of-jobs=2 --title='Job Sample 1,Job Sample 2'","parsable-cli jobs:create --team-id=abc123 --number-of-jobs=2 --title='Job Sample 1,Job Sample 2' --template-ids=<template_id>,<template_id>"],"flags":{"team-id":{"name":"team-id","type":"option","description":"Id of the team who will own the jobs","required":true},"number-of-jobs":{"name":"number-of-jobs","type":"option","description":"number of job(s) to be created, will default to 1 if left out"},"title":{"name":"title","type":"option","description":"title of the job(s) and should match to the number of jobs (comma-separated)","required":true},"template-ids":{"name":"template-ids","type":"option","description":"template id(s) to be assigned for the created jobs and should match to the number of jobs (comma-separated)","required":true},"columns":{"name":"columns","type":"option","description":"only show provided columns (comma-separated)"},"sort":{"name":"sort","type":"option","description":"property to sort by (prepend '-' for descending)"},"filter":{"name":"filter","type":"option","description":"filter property by partial string matching, ex: name=foo"},"csv":{"name":"csv","type":"boolean","description":"output is csv format [alias: --output=csv]","allowNo":false},"output":{"name":"output","type":"option","description":"output in a more machine friendly format","options":["csv","json","yaml"]},"extended":{"name":"extended","type":"boolean","char":"x","description":"show extra columns","allowNo":false},"no-truncate":{"name":"no-truncate","type":"boolean","description":"do not truncate output to fit screen","allowNo":false},"no-header":{"name":"no-header","type":"boolean","description":"hide table header from output","allowNo":false}},"args":[]},"jobs:delete":{"id":"jobs:delete","description":"Delete jobs and issues listed in CSV files of lookup/database ids.\n\nIf a job/issue cannot be deleted because it is referenced (depended upon) by another job/issue, then a list of those\ndependents will be output to the files descendant-issues.csv and descendant-jobs.csv accordingly.\nThese lists can be fed back into the command on subsequent attempts, issues first and then jobs.\nAfter the dependents are deleted, you can attempt to delete the original dependency job/issue that failed initially.","pluginName":"@parsable/plugin-author-cli","pluginType":"core","hidden":false,"aliases":[],"examples":["parsable-cli jobs:delete --team-id=abc123 --jobs-csv=path/to/the/file.csv","parsable-cli jobs:delete --team-id=abc123 --issues-csv=path/to/another/file.csv","parsable-cli jobs:delete -t abc123 -j path/to/the/file.csv -i path/to/another/file.csv","parsable-cli jobs:delete -t abc123 -i path/to/the/file.csv --force"],"flags":{"team-id":{"name":"team-id","type":"option","char":"t","description":"Id of the team owning the jobs","required":true},"jobs-csv":{"name":"jobs-csv","type":"option","char":"j","description":"Path to a CSV holding the job lookup ids to be deleted.\nThere should be no header row in the CSV.\nEach row is a single item: the lookup id (integer or 'job-123' format key) or database id (UUID) of the job to be deleted.\nMaximum file length is 5K rows/jobs. Beyond that, the CLI may fail to process.\n\nExample CSV contents:\n1234\n6c807fd4-6594-11eb-ae93-0242ac130002\n5678\n75196fd4-6594-11eb-ae93-0242ac130002\n"},"issues-csv":{"name":"issues-csv","type":"option","char":"i","description":"Path to a CSV holding the issue lookup ids to be deleted.\nThere should be no header row in the CSV.\nEach row is a single item: the lookup id (integer or 'issue-123' format key) or database id (UUID) of the issue to be deleted.\nMaximum file length is 5K rows/issues. Beyond that, the CLI may fail to process.\n\nExample CSV contents:\n1234\n6c807fd4-6594-11eb-ae93-0242ac130002\n5678\n75196fd4-6594-11eb-ae93-0242ac130002\n"},"force":{"name":"force","type":"boolean","description":"When set, skips the \"Are you sure?\" prompt","allowNo":false}},"args":[]},"template:copy":{"id":"template:copy","description":"Send request to copy templates.\nTemplates arrive at the destination team in Editing (draft) status.\nWe do not support copying archived templates.\nStatus report id will be returned unless the request takes over 30 seconds.\nRequests that take over 30 seconds will cause the command to timeout.\nThis does not mean the request failed.\nYou can still check the statuses by template id: `parsable-cli template:copy:request --template-id <template_id>`\nPlease use 'parsable-cli login' to specify which environment (staging vs production) to run this command against.\nReference sheets are automatically copied over if they are associated with the template. Please make sure to include the reference sheet id in the referenceSheetIds config so that templates with reference sheets are copied over correctly.\n\nAdditional Notes:\n* If you try to copy an object and it has attribute values, then the attribute values only copy over if the destination\n team has custom policies on. Otherwise, for destination teams with custom policies off, we do not copy attribute values\n* Metadata = parameters at the Template level. We do not copy anything Job related (job parameters).\n We copy template metadata values if includeMetadata option is added and if the destination team has the exact\n metadata value matches available.\n","pluginName":"@parsable/plugin-author-cli","pluginType":"core","hidden":false,"aliases":[],"examples":["parsable-cli template:copy","parsable-cli template:copy --config ./config.json","parsable-cli template:copy --should-publish-templates","parsable-cli template:copy --template-ids <template_id>,<template_id>"],"flags":{"config":{"name":"config","type":"option","description":"Path to config json file.\nConfig json file should be in the following format:\n{\n \"templateIds\": [<string>],\n \"referenceSheetSetIds\": [<string>],\n \"source\": {\n \"teamId\": <string>,\n \"email\": <string>,\n \"password\": <string>,\n \"apiBase\": <string>\n },\n \"destination\": {\n \"teamId\": <string>,\n \"email\": <string>,\n \"password\": <string>,\n \"apiBase\": <string>\n },\n \"options\": {\n \"includeApplets\": <boolean>,\n \"includeMetadata\": <boolean>,\n \"includeProcedureTypes\": <boolean>,\n \"includeInputTriggers\": <boolean>,\n \"includeRefSheets\": <boolean>\n }\n \"shouldPublishTemplates\": <boolean>\n}\n"},"template-ids":{"name":"template-ids","type":"option","description":"template id(s) from source team to copy to destination team (comma-separated)"},"reference-sheet-set-ids":{"name":"reference-sheet-set-ids","type":"option","description":"reference sheet set id(s) from source team to copy to destination team (comma-separated)"},"src-team-id":{"name":"src-team-id","type":"option","description":"source team id of template(s) to copy from"},"src-email":{"name":"src-email","type":"option","description":"email of admin user in the source team"},"src-password":{"name":"src-password","type":"option","description":"password of admin user in the source team"},"src-api-base":{"name":"src-api-base","type":"option","description":"hostname of the source team environment"},"dest-team-id":{"name":"dest-team-id","type":"option","description":"destination team id for template(s) to copy into"},"dest-email":{"name":"dest-email","type":"option","description":"email of admin user in the destination team"},"dest-password":{"name":"dest-password","type":"option","description":"password of admin user in the destination team"},"dest-api-base":{"name":"dest-api-base","type":"option","description":"hostname of the destination team environment"},"include-applets":{"name":"include-applets","type":"boolean","description":"copy applets over","allowNo":false},"include-metadata":{"name":"include-metadata","type":"boolean","description":"copy metadata over","allowNo":false},"include-procedure-types":{"name":"include-procedure-types","type":"boolean","description":"copy procedure types over","allowNo":false},"include-input-triggers":{"name":"include-input-triggers","type":"boolean","description":"copy input triggers over","allowNo":false},"include-refsheets":{"name":"include-refsheets","type":"boolean","description":"copy reference sheets over","allowNo":false},"should-publish-templates":{"name":"should-publish-templates","type":"boolean","description":"copied templates should be published","allowNo":false},"columns":{"name":"columns","type":"option","description":"only show provided columns (comma-separated)"},"sort":{"name":"sort","type":"option","description":"property to sort by (prepend '-' for descending)"},"filter":{"name":"filter","type":"option","description":"filter property by partial string matching, ex: name=foo"},"csv":{"name":"csv","type":"boolean","description":"output is csv format [alias: --output=csv]","allowNo":false},"output":{"name":"output","type":"option","description":"output in a more machine friendly format","options":["csv","json","yaml"]},"extended":{"name":"extended","type":"boolean","char":"x","description":"show extra columns","allowNo":false},"no-truncate":{"name":"no-truncate","type":"boolean","description":"do not truncate output to fit screen","allowNo":false},"no-header":{"name":"no-header","type":"boolean","description":"hide table header from output","allowNo":false}},"args":[]},"template:copy:status":{"id":"template:copy:status","description":"Get the statuses for template copy requests.\nThere is one status per template copied.\nStatus fields returned include:\ntemplate_id, status (FAILED, SUCCESS, IN_PROGRESS, SCHEDULED), result, start_timestamp, end_timestamp, src_team_id, dest_team_id\nPlease use 'parsable-cli login' to specify which environment (staging vs production) to run this command against.\n","pluginName":"@parsable/plugin-author-cli","pluginType":"core","hidden":false,"aliases":[],"examples":["parsable-cli template:copy:status","parsable-cli template:copy:status --status-report-id <status_report_id>","parsable-cli template:copy:status -s <status_report_id>","parsable-cli template:copy:status --template-id <template_id>","parsable-cli template:copy:status -t <template_id>","parsable-cli template:copy:status --output json","parsable-cli template:copy:status --filter status=FAILED"],"flags":{"status-report-id":{"name":"status-report-id","type":"option","char":"s","description":"get statuses for this status report id (id found in output of `parsable-cli template:copy`)"},"template-id":{"name":"template-id","type":"option","char":"t","description":"get statuses for this template id"},"columns":{"name":"columns","type":"option","description":"only show provided columns (comma-separated)"},"sort":{"name":"sort","type":"option","description":"property to sort by (prepend '-' for descending)"},"filter":{"name":"filter","type":"option","description":"filter property by partial string matching, ex: name=foo"},"csv":{"name":"csv","type":"boolean","description":"output is csv format [alias: --output=csv]","allowNo":false},"output":{"name":"output","type":"option","description":"output in a more machine friendly format","options":["csv","json","yaml"]},"extended":{"name":"extended","type":"boolean","char":"x","description":"show extra columns","allowNo":false},"no-truncate":{"name":"no-truncate","type":"boolean","description":"do not truncate output to fit screen","allowNo":false},"no-header":{"name":"no-header","type":"boolean","description":"hide table header from output","allowNo":false}},"args":[]}}}
|
|
1
|
+
{"version":"1.1.3","commands":{"base":{"id":"base","pluginName":"@parsable/plugin-author-cli","pluginType":"core","hidden":true,"aliases":[],"flags":{},"args":[]},"exec-data:delete":{"id":"exec-data:delete","description":"Delete execution data corresponding to a specific Input Field on a Job.\n\nFields are uniquely identified by locators, which are combinations of:\n 1. the 'id' of the Field itself, plus\n 2. the 'jobBaseStepId' of the Field's parent Step\n\nA single locator can be specified inline, using the arguments --field-id and --job-base-step-id.\nAlternatively, a list of locators can be provided in the form of a CSV file via the --fields-csv argument.\n(More details provided below in the context of the --fields-csv argument.)\n\nA time range must be set using the flags:\n 1. 'from-time'\n 2. 'until-time'\n 3. both of the preceding, or\n 4. 'all'\nIf no range is set the delete command will not run.\nIf 'all' is combined with 'from-time' or 'until-time' the command will not run.\n","pluginName":"@parsable/plugin-author-cli","pluginType":"core","hidden":false,"aliases":[],"examples":["parsable-cli exec-data:delete --field-id=abc123 --job-base-step-id=def456 --all","parsable-cli exec-data:delete -f abc123 -j def456 -A","parsable-cli exec-data:delete --field-id=abc123 --job-base-step-id=def456 --from-time=123456789","parsable-cli exec-data:delete --field-id=abc123 --job-base-step-id=def456 --until-time=123456789","parsable-cli exec-data:delete --field-id=abc123 --job-base-step-id=def456 --from-time=123456789 --until-time=123456790","parsable-cli exec-data:delete --fields-csv=/absolute/path/to/my/file.csv --all","parsable-cli exec-data:delete -c /absolute/path/to/my/file.csv -A","parsable-cli exec-data:delete -c /absolute/path/to/my/file.csv -A --force"],"flags":{"field-id":{"name":"field-id","type":"option","char":"f","description":"The id of the Field to delete execution data from."},"job-base-step-id":{"name":"job-base-step-id","type":"option","char":"j","description":"The jobBaseStepId of the Field's parent Step."},"fields-csv":{"name":"fields-csv","type":"option","char":"c","description":"The absolute path to a CSV file containing rows of field-id/job-base-step-id pairs.\nThe CSV file must not start with a header row (the first line must be the first field locator you wish to delete data for).\nEach row should have as its first element the field id, and as its second element the job-base-step id.\nExample:\n field_id,job_base_step_id\n abc123,def456\n ghi789,jkl012\n"},"from-time":{"name":"from-time","type":"option","description":"Any execution data sent to the server before this timestamp will not be deleted (format: UNIX, seconds since epoch)."},"until-time":{"name":"until-time","type":"option","description":"Any execution data sent to the server on or after this timestamp will not be deleted (format: UNIX, seconds since epoch)."},"all":{"name":"all","type":"boolean","char":"A","description":"When set, deletes all execution data regardless of when it was sent to the server.","allowNo":false},"force":{"name":"force","type":"boolean","description":"When set, skips the \"Are you sure\" prompt.","allowNo":false}},"args":[]},"jobs:create":{"id":"jobs:create","description":"Create jobs.\n\nSend a request to create a job(s) and assigned templates.\nCurrently it only supports on-demand job type.\n","pluginName":"@parsable/plugin-author-cli","pluginType":"core","hidden":false,"aliases":[],"examples":["parsable-cli jobs:create --team-id=abc123 --title='Job Sample 1'","parsable-cli jobs:create --team-id=abc123 --number-of-jobs=2 --title='Job Sample 1,Job Sample 2'","parsable-cli jobs:create --team-id=abc123 --number-of-jobs=2 --title='Job Sample 1,Job Sample 2' --template-ids=<template_id>,<template_id>"],"flags":{"team-id":{"name":"team-id","type":"option","description":"Id of the team who will own the jobs","required":true},"number-of-jobs":{"name":"number-of-jobs","type":"option","description":"number of job(s) to be created, will default to 1 if left out"},"title":{"name":"title","type":"option","description":"title of the job(s) and should match to the number of jobs (comma-separated)","required":true},"template-ids":{"name":"template-ids","type":"option","description":"template id(s) to be assigned for the created jobs and should match to the number of jobs (comma-separated)","required":false},"columns":{"name":"columns","type":"option","description":"only show provided columns (comma-separated)"},"sort":{"name":"sort","type":"option","description":"property to sort by (prepend '-' for descending)"},"filter":{"name":"filter","type":"option","description":"filter property by partial string matching, ex: name=foo"},"csv":{"name":"csv","type":"boolean","description":"output is csv format [alias: --output=csv]","allowNo":false},"output":{"name":"output","type":"option","description":"output in a more machine friendly format","options":["csv","json","yaml"]},"extended":{"name":"extended","type":"boolean","char":"x","description":"show extra columns","allowNo":false},"no-truncate":{"name":"no-truncate","type":"boolean","description":"do not truncate output to fit screen","allowNo":false},"no-header":{"name":"no-header","type":"boolean","description":"hide table header from output","allowNo":false}},"args":[]},"jobs:delete":{"id":"jobs:delete","description":"Delete jobs and issues listed in CSV files of lookup/database ids.\n\nIf a job/issue cannot be deleted because it is referenced (depended upon) by another job/issue, then a list of those\ndependents will be output to the files descendant-issues.csv and descendant-jobs.csv accordingly.\nThese lists can be fed back into the command on subsequent attempts, issues first and then jobs.\nAfter the dependents are deleted, you can attempt to delete the original dependency job/issue that failed initially.","pluginName":"@parsable/plugin-author-cli","pluginType":"core","hidden":false,"aliases":[],"examples":["parsable-cli jobs:delete --team-id=abc123 --jobs-csv=path/to/the/file.csv","parsable-cli jobs:delete --team-id=abc123 --issues-csv=path/to/another/file.csv","parsable-cli jobs:delete -t abc123 -j path/to/the/file.csv -i path/to/another/file.csv","parsable-cli jobs:delete -t abc123 -i path/to/the/file.csv --force"],"flags":{"team-id":{"name":"team-id","type":"option","char":"t","description":"Id of the team owning the jobs","required":true},"jobs-csv":{"name":"jobs-csv","type":"option","char":"j","description":"Path to a CSV holding the job lookup ids to be deleted.\nThere should be no header row in the CSV.\nEach row is a single item: the lookup id (integer or 'job-123' format key) or database id (UUID) of the job to be deleted.\nMaximum file length is 5K rows/jobs. Beyond that, the CLI may fail to process.\n\nExample CSV contents:\n1234\n6c807fd4-6594-11eb-ae93-0242ac130002\n5678\n75196fd4-6594-11eb-ae93-0242ac130002\n"},"issues-csv":{"name":"issues-csv","type":"option","char":"i","description":"Path to a CSV holding the issue lookup ids to be deleted.\nThere should be no header row in the CSV.\nEach row is a single item: the lookup id (integer or 'issue-123' format key) or database id (UUID) of the issue to be deleted.\nMaximum file length is 5K rows/issues. Beyond that, the CLI may fail to process.\n\nExample CSV contents:\n1234\n6c807fd4-6594-11eb-ae93-0242ac130002\n5678\n75196fd4-6594-11eb-ae93-0242ac130002\n"},"force":{"name":"force","type":"boolean","description":"When set, skips the \"Are you sure?\" prompt","allowNo":false}},"args":[]},"template:copy":{"id":"template:copy","description":"Send request to copy templates.\nTemplates arrive at the destination team in Editing (draft) status.\nWe do not support copying archived templates.\nStatus report id will be returned unless the request takes over 30 seconds.\nRequests that take over 30 seconds will cause the command to timeout.\nThis does not mean the request failed.\nYou can still check the statuses by template id: `parsable-cli template:copy:request --template-id <template_id>`\nPlease use 'parsable-cli login' to specify which environment (staging vs production) to run this command against.\nReference sheets are automatically copied over if they are associated with the template. Please make sure to include the reference sheet id in the referenceSheetIds config so that templates with reference sheets are copied over correctly.\n\nAdditional Notes:\n* If you try to copy an object and it has attribute values, then the attribute values only copy over if the destination\n team has custom policies on. Otherwise, for destination teams with custom policies off, we do not copy attribute values\n* Metadata = parameters at the Template level. We do not copy anything Job related (job parameters).\n We copy template metadata values if includeMetadata option is added and if the destination team has the exact\n metadata value matches available.\n","pluginName":"@parsable/plugin-author-cli","pluginType":"core","hidden":false,"aliases":[],"examples":["parsable-cli template:copy","parsable-cli template:copy --config ./config.json","parsable-cli template:copy --should-publish-templates","parsable-cli template:copy --template-ids <template_id>,<template_id>"],"flags":{"config":{"name":"config","type":"option","description":"Path to config json file.\nConfig json file should be in the following format:\n{\n \"templateIds\": [<string>],\n \"referenceSheetSetIds\": [<string>],\n \"source\": {\n \"teamId\": <string>,\n \"email\": <string>,\n \"password\": <string>,\n \"apiBase\": <string>\n },\n \"destination\": {\n \"teamId\": <string>,\n \"email\": <string>,\n \"password\": <string>,\n \"apiBase\": <string>\n },\n \"options\": {\n \"includeApplets\": <boolean>,\n \"includeMetadata\": <boolean>,\n \"includeProcedureTypes\": <boolean>,\n \"includeInputTriggers\": <boolean>,\n \"includeRefSheets\": <boolean>\n }\n \"shouldPublishTemplates\": <boolean>\n}\n"},"template-ids":{"name":"template-ids","type":"option","description":"template id(s) from source team to copy to destination team (comma-separated)"},"reference-sheet-set-ids":{"name":"reference-sheet-set-ids","type":"option","description":"reference sheet set id(s) from source team to copy to destination team (comma-separated)"},"src-team-id":{"name":"src-team-id","type":"option","description":"source team id of template(s) to copy from"},"src-email":{"name":"src-email","type":"option","description":"email of admin user in the source team"},"src-password":{"name":"src-password","type":"option","description":"password of admin user in the source team"},"src-api-base":{"name":"src-api-base","type":"option","description":"hostname of the source team environment"},"dest-team-id":{"name":"dest-team-id","type":"option","description":"destination team id for template(s) to copy into"},"dest-email":{"name":"dest-email","type":"option","description":"email of admin user in the destination team"},"dest-password":{"name":"dest-password","type":"option","description":"password of admin user in the destination team"},"dest-api-base":{"name":"dest-api-base","type":"option","description":"hostname of the destination team environment"},"include-applets":{"name":"include-applets","type":"boolean","description":"copy applets over","allowNo":false},"include-metadata":{"name":"include-metadata","type":"boolean","description":"copy metadata over","allowNo":false},"include-procedure-types":{"name":"include-procedure-types","type":"boolean","description":"copy procedure types over","allowNo":false},"include-input-triggers":{"name":"include-input-triggers","type":"boolean","description":"copy input triggers over","allowNo":false},"include-refsheets":{"name":"include-refsheets","type":"boolean","description":"copy reference sheets over","allowNo":false},"should-publish-templates":{"name":"should-publish-templates","type":"boolean","description":"copied templates should be published","allowNo":false},"columns":{"name":"columns","type":"option","description":"only show provided columns (comma-separated)"},"sort":{"name":"sort","type":"option","description":"property to sort by (prepend '-' for descending)"},"filter":{"name":"filter","type":"option","description":"filter property by partial string matching, ex: name=foo"},"csv":{"name":"csv","type":"boolean","description":"output is csv format [alias: --output=csv]","allowNo":false},"output":{"name":"output","type":"option","description":"output in a more machine friendly format","options":["csv","json","yaml"]},"extended":{"name":"extended","type":"boolean","char":"x","description":"show extra columns","allowNo":false},"no-truncate":{"name":"no-truncate","type":"boolean","description":"do not truncate output to fit screen","allowNo":false},"no-header":{"name":"no-header","type":"boolean","description":"hide table header from output","allowNo":false}},"args":[]},"template:copy:status":{"id":"template:copy:status","description":"Get the statuses for template copy requests.\nThere is one status per template copied.\nStatus fields returned include:\ntemplate_id, status (FAILED, SUCCESS, IN_PROGRESS, SCHEDULED), result, start_timestamp, end_timestamp, src_team_id, dest_team_id\nPlease use 'parsable-cli login' to specify which environment (staging vs production) to run this command against.\n","pluginName":"@parsable/plugin-author-cli","pluginType":"core","hidden":false,"aliases":[],"examples":["parsable-cli template:copy:status","parsable-cli template:copy:status --status-report-id <status_report_id>","parsable-cli template:copy:status -s <status_report_id>","parsable-cli template:copy:status --template-id <template_id>","parsable-cli template:copy:status -t <template_id>","parsable-cli template:copy:status --output json","parsable-cli template:copy:status --filter status=FAILED"],"flags":{"status-report-id":{"name":"status-report-id","type":"option","char":"s","description":"get statuses for this status report id (id found in output of `parsable-cli template:copy`)"},"template-id":{"name":"template-id","type":"option","char":"t","description":"get statuses for this template id"},"columns":{"name":"columns","type":"option","description":"only show provided columns (comma-separated)"},"sort":{"name":"sort","type":"option","description":"property to sort by (prepend '-' for descending)"},"filter":{"name":"filter","type":"option","description":"filter property by partial string matching, ex: name=foo"},"csv":{"name":"csv","type":"boolean","description":"output is csv format [alias: --output=csv]","allowNo":false},"output":{"name":"output","type":"option","description":"output in a more machine friendly format","options":["csv","json","yaml"]},"extended":{"name":"extended","type":"boolean","char":"x","description":"show extra columns","allowNo":false},"no-truncate":{"name":"no-truncate","type":"boolean","description":"do not truncate output to fit screen","allowNo":false},"no-header":{"name":"no-header","type":"boolean","description":"hide table header from output","allowNo":false}},"args":[]}}}
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parsable/plugin-author-cli",
|
|
3
3
|
"description": "Parsable CLI plugin for authoring functionality",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.3",
|
|
5
5
|
"author": "Shealen Clare @sheac",
|
|
6
6
|
"bugs": "https://github.com/parsable/author-cli/issues",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@oclif/command": "^1.7.0",
|
|
9
9
|
"@oclif/config": "^1.16.0",
|
|
10
10
|
"@oclif/plugin-help": "^3.1.0",
|
|
11
|
-
"@
|
|
11
|
+
"@parsable/plugin-common-cli": "^0.2.4",
|
|
12
12
|
"ajv": "^6.12.4",
|
|
13
13
|
"cli-ux": "^5.5.0",
|
|
14
14
|
"csv-parser": "^2.3.3",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"sinon": "^9.0.2"
|
|
35
35
|
},
|
|
36
36
|
"engines": {
|
|
37
|
-
"node": ">=
|
|
37
|
+
"node": ">=18"
|
|
38
38
|
},
|
|
39
39
|
"files": [
|
|
40
40
|
"/bin",
|
|
@@ -55,10 +55,15 @@
|
|
|
55
55
|
"@oclif/plugin-help"
|
|
56
56
|
]
|
|
57
57
|
},
|
|
58
|
-
"repository":
|
|
58
|
+
"repository": {
|
|
59
|
+
"type": "git",
|
|
60
|
+
"url": "git+https://github.com/parsable/author-cli.git"
|
|
61
|
+
},
|
|
62
|
+
"publishConfig": {
|
|
63
|
+
"access": "public"
|
|
64
|
+
},
|
|
59
65
|
"scripts": {
|
|
60
66
|
"postpack": "rm -f oclif.manifest.json",
|
|
61
|
-
"posttest": "eslint .",
|
|
62
67
|
"prepack": "oclif-dev manifest && oclif-dev readme",
|
|
63
68
|
"test": "nyc -x '**/test/**' --report-dir=./reports/coverage --reporter=cobertura --reporter=text --reporter=lcov mocha --forbid-only 'test/**/*.test.js'",
|
|
64
69
|
"lint": "eslint . -o reports/eslint-report.json -f json",
|
package/src/commands/base.js
CHANGED
|
@@ -81,7 +81,7 @@ CreateCommand.flags = {
|
|
|
81
81
|
}),
|
|
82
82
|
'template-ids': flags.string({
|
|
83
83
|
description: 'template id(s) to be assigned for the created jobs and should match to the number of jobs (comma-separated)',
|
|
84
|
-
required:
|
|
84
|
+
required: false,
|
|
85
85
|
}),
|
|
86
86
|
...cli.table.flags(),
|
|
87
87
|
}
|
|
@@ -29,7 +29,7 @@ module.exports = function ({mothershipClient, currentEnv}) {
|
|
|
29
29
|
|
|
30
30
|
debug(`getJobRolesPayload=${JSON.stringify(getJobRolesPayload)}`)
|
|
31
31
|
|
|
32
|
-
const
|
|
32
|
+
const jobRolesResult = _get(getJobRolesResponse, ['body', 'result', 'success'], {})
|
|
33
33
|
|
|
34
34
|
const getJobRolesError = _get(getJobRolesResponse, ['body', 'result', 'err'])
|
|
35
35
|
|
|
@@ -37,7 +37,13 @@ module.exports = function ({mothershipClient, currentEnv}) {
|
|
|
37
37
|
throw new Error(`Failed to create job due to error: ${JSON.stringify(getJobRolesError)}`)
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
// Handle both array format and idRoles object format
|
|
41
|
+
const jobRolesArray = Array.isArray(jobRolesResult) ?
|
|
42
|
+
jobRolesResult :
|
|
43
|
+
Object.values(_get(jobRolesResult, 'idRoles', {}))
|
|
44
|
+
|
|
45
|
+
const jobRole = jobRolesArray.find(item => item.name === 'Job Planner')
|
|
46
|
+
const jobRoleId = jobRole ? jobRole.id : ''
|
|
41
47
|
|
|
42
48
|
const createJobPayload = {
|
|
43
49
|
method: 'createBlank',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const _reduce = require('lodash/reduce')
|
|
1
|
+
const _reduce = require('lodash/reduce')
|
|
2
2
|
|
|
3
|
-
const convertKebabToCamel = require('../../helpers/convert-kebab-case-to-camel-case.js')
|
|
3
|
+
const convertKebabToCamel = require('../../helpers/convert-kebab-case-to-camel-case.js')
|
|
4
4
|
|
|
5
5
|
// Mapping from flag names to option property names
|
|
6
6
|
// This ensures prompts produce the same property names as flags
|
|
@@ -10,7 +10,7 @@ const optionFlagToPropertyMap = {
|
|
|
10
10
|
'include-applets': 'includeApplets',
|
|
11
11
|
'include-metadata': 'includeMetadata',
|
|
12
12
|
'include-refsheets': 'includeRefSheets',
|
|
13
|
-
}
|
|
13
|
+
}
|
|
14
14
|
|
|
15
15
|
// This needs to work with prompt and flags...
|
|
16
16
|
// NOTE: flags are kebab case while config keys are camel case
|
|
@@ -18,13 +18,13 @@ module.exports = {
|
|
|
18
18
|
'template-ids': {
|
|
19
19
|
key: 'templateIds',
|
|
20
20
|
transform(templateIds) {
|
|
21
|
-
return templateIds.split(',')
|
|
21
|
+
return templateIds.split(',')
|
|
22
22
|
},
|
|
23
23
|
},
|
|
24
24
|
'reference-sheet-set-ids': {
|
|
25
25
|
key: 'referenceSheetSetIds',
|
|
26
26
|
transform(referenceSheetSetIds) {
|
|
27
|
-
return referenceSheetSetIds.split(',')
|
|
27
|
+
return referenceSheetSetIds.split(',')
|
|
28
28
|
},
|
|
29
29
|
},
|
|
30
30
|
'src-team-id': 'source.teamId',
|
|
@@ -47,18 +47,18 @@ module.exports = {
|
|
|
47
47
|
transform(sourceVal, sourceObj, destinationObj) {
|
|
48
48
|
// if options already set by flags, don't overwrite it
|
|
49
49
|
if (destinationObj.options) {
|
|
50
|
-
return destinationObj.options
|
|
50
|
+
return destinationObj.options
|
|
51
51
|
}
|
|
52
52
|
return _reduce(
|
|
53
53
|
sourceVal,
|
|
54
54
|
(mem, option) => {
|
|
55
55
|
// Use explicit mapping to ensure property names match what flags produce
|
|
56
|
-
const propertyName = optionFlagToPropertyMap[option] || convertKebabToCamel(option)
|
|
57
|
-
mem[propertyName] = true
|
|
58
|
-
return mem
|
|
56
|
+
const propertyName = optionFlagToPropertyMap[option] || convertKebabToCamel(option)
|
|
57
|
+
mem[propertyName] = true
|
|
58
|
+
return mem
|
|
59
59
|
},
|
|
60
60
|
{},
|
|
61
|
-
)
|
|
61
|
+
)
|
|
62
62
|
},
|
|
63
63
|
},
|
|
64
|
-
}
|
|
64
|
+
}
|