Skip to content

Commit

Permalink
feat(qseow): Add publish and replace options to field scramble command
Browse files Browse the repository at this point in the history
Implements #522
  • Loading branch information
mountaindude committed Nov 26, 2024
1 parent 2d34e73 commit 8cbfe64
Show file tree
Hide file tree
Showing 5 changed files with 332 additions and 154 deletions.
32 changes: 15 additions & 17 deletions src/lib/cli/qseow-scramble-field.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export function setupQseowScrambleFieldCommand(qseow) {
.option('--engine-port <port>', 'Qlik Sense server engine port (usually 4747 for cert auth, 443 for jwt auth)', '4747')
.option('--qrs-port <port>', 'Qlik Sense server QRS port (usually 4242 for cert auth, 443 for jwt auth)', '4242')
.option('--schema-version <string>', 'Qlik Sense engine schema version', '12.612.0')
.requiredOption('--app-id <id>', 'Qlik Sense app ID')
.requiredOption('--virtual-proxy <prefix>', 'Qlik Sense virtual proxy prefix', '')
.requiredOption(
'--secure <true|false>',
Expand All @@ -37,31 +36,30 @@ export function setupQseowScrambleFieldCommand(qseow) {
.option('--auth-root-cert-file <file>', 'Qlik Sense root certificate file (exported from QMC)', './cert/root.pem')
.option('--auth-jwt <jwt>', 'JSON Web Token (JWT) to use for authentication with Qlik Sense server')

.requiredOption('--app-id <id>', 'Qlik Sense app ID to be scrambled')
.requiredOption('--field-name <names...>', 'name of field(s) to be scrambled')
.requiredOption('--new-app-name <name>', 'name of new app that will contain scrambled data')
.requiredOption('--new-app-name <name>', 'name of new app that will contain scrambled data. Not used if --new-app-cmd=replace')

.addOption(new Option('--new-app-publish', 'publish scrambled app to a stream'))
.addOption(new Option('--new-app-publish-stream-id <id>', 'stream ID to publish scrambled app to').default(''))
.addOption(new Option('--new-app-publish-stream-name <name>', 'stream name to publish scrambled app to').default(''))

.addOption(new Option('--new-app-publish-replace', 'publish-replace an existing, published app'))
.addOption(
new Option(
'--new-app-publish-replace-app-id <id>',
'ID of published app that should be replaced by the new scrambled app'
).default('')
'--new-app-cmd <command>',
'what to do with the new app. If nothing is specified in this option the new app will be placed in My Work. WHen specifying "replace": If the replaced app is published, only the sheets that were originally published with the app are replaced. If the replaced app is not published, the entire app is replaced.'
)
.choices(['publish', 'replace'])
.default('')
)

.addOption(
new Option(
'--new-app-publish-replace-app-name <name>',
'Name of published app that should be replaced by the new scrambled app'
).default('')
new Option('--new-app-cmd-id <id>', 'stream/app ID that --new-app-cmd acts on. Cannot be used with --new-app-cmd-name').default(
''
)
)

.addOption(
new Option('--new-app-delete-existing-unpublished', 'delete any already existing apps with same name as new scrambled app')
new Option(
'--new-app-cmd-name <name>',
'stream/app name that --new-app-cmd acts on. Cannot be used with --new-app-cmd-id'
).default('')
)
.addOption(new Option('--new-app-delete', 'delete the new scrambled app after all other operations are done'))

.addOption(new Option('--force', 'force delete and replace operations to proceed without asking for confirmation'));
}
Loading

0 comments on commit 8cbfe64

Please sign in to comment.