Skip to content

Commit

Permalink
Merge pull request #469 from mountaindude/468
Browse files Browse the repository at this point in the history
468
  • Loading branch information
mountaindude committed Apr 29, 2024
2 parents bd6daa9 + 591196b commit 62060d4
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 76 deletions.
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{".":"3.17.0"}
{ ".": "3.17.0" }
142 changes: 73 additions & 69 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,66 +181,70 @@
// ------------------------------------
// Export apps to QVF files
// ------------------------------------
// "args": [
// "app-export",
// "--host",
// "192.168.100.109",
"args": [
"app-export",
"--host",
"pro2-win1.lab.ptarmiganlabs.net",
// "192.168.100.109",

// "--port",
// // "4747",
// "443",
"--port",
"4242",
// "443",

// "--virtual-proxy",
// "jwt",
// "--auth-type",
// "jwt",
// "--auth-jwt",
// "<jwt>",
// "--virtual-proxy",
// "jwt",
// "--auth-type",
// "jwt",
// "--auth-jwt",
// "<jwt>",

// // "--auth-cert-file",
// // "./cert/client.pem",
// // "--auth-cert-key-file",
// // "./cert/client_key.pem",
"--auth-cert-file",
"./cert/client.pem",
"--auth-cert-key-file",
"./cert/client_key.pem",

// "--auth-user-dir",
// "LAB",
// "--auth-user-id",
// "goran",
"--auth-user-dir",
"LAB",
"--auth-user-id",
"goran",

// "--app-tag",
// "apiCreated",
// "Ctrl-Q import",
"--app-tag",
"apiCreated",
"Ctrl-Q import",

// "--app-id",
// "eb3ab049-d007-43d3-93da-5962f9208c65",
// "2933711d-6638-41d4-a2d2-6dd2d965208b",
"--app-id",
"eb3ab049-d007-43d3-93da-5962f9208c65",
"2933711d-6638-41d4-a2d2-6dd2d965208b",

// "--exclude-app-data",
// "false",
"--app-published",

// "--qvf-name-format",
// // "export-time",
// "app-name",
// "export-date",
"--exclude-app-data",
// "false",
"true",

// "--qvf-name-separator",
// "__",
"--qvf-name-format",
// "export-time",
"app-name",
"export-date",

// "--output-dir",
// "qvfs",
"--qvf-name-separator",
"__",

// // "--limit-export-count",
// // "2",
"--output-dir",
"qvfs",

// "--sleep-app-export",
// "500",
// "--limit-export-count",
// "2",

// "--qvf-overwrite",
"--sleep-app-export",
"500",

// // "--dry-run"
"--qvf-overwrite",

// "--metadata-file-create"
// ]
// "--dry-run"

"--metadata-file-create"
]

// ------------------------------------
// Import apps from Excel file
Expand Down Expand Up @@ -1053,36 +1057,36 @@
// ------------------------------------
// Get script
// ------------------------------------
"args": [
"script-get",
"--host",
"192.168.100.109",
// "pro2-win1.lab.ptarmiganlabs.net",
// "args": [
// "script-get",
// "--host",
// "192.168.100.109",
// // "pro2-win1.lab.ptarmiganlabs.net",

// "--port",
// "4747",
// "443",
// // "--port",
// // "4747",
// // "443",

// "--virtual-proxy",
// "jwt",
// // "--virtual-proxy",
// // "jwt",

// "--auth-type",
// "jwt",
// "cert",
// "--auth-jwt",
// "<jwt>",
// // "--auth-type",
// // "jwt",
// // "cert",
// // "--auth-jwt",
// // "<jwt>",

"--app-id",
"deba4bcf-47e4-472e-97b2-4fe8d6498e11",
// "--app-id",
// "deba4bcf-47e4-472e-97b2-4fe8d6498e11",

"--auth-user-dir",
"LAB",
"--auth-user-id",
"goran",
// "--auth-user-dir",
// "LAB",
// "--auth-user-id",
// "goran",

"--log-level",
"info"
]
// "--log-level",
// "info"
// ]

// ------------------------------------
// Connection test
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"uuid": "^9.0.1",
"winston": "^3.13.0",
"winston-daily-rotate-file": "^5.0.0",
"ws": "^8.16.0",
"ws": "^8.17.0",
"yesno": "^0.4.0"
},
"devDependencies": {
Expand Down
1 change: 1 addition & 0 deletions src/ctrl-q.js
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,7 @@ program.configureHelp({

.option('--app-id <ids...>', 'use app IDs to select which apps to export')
.option('--app-tag <tags...>', 'use app tags to select which apps to export')
.requiredOption('--app-published', 'export all published apps ', false)

.requiredOption('--output-dir <directory>', 'relative or absolut path in which QVF files should be stored.', 'qvf-export')
.addOption(
Expand Down
14 changes: 13 additions & 1 deletion src/lib/app/class_allapps.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class QlikSenseApps {
this.appList.push(newApp);
}

// Get array of apps matching app id, tags etc filters
// Get array of apps matching app id, tags, published and other filters
async getAppsFromQseow() {
try {
logger.debug('GET APPS: Starting get apps from QSEoW');
Expand Down Expand Up @@ -106,6 +106,18 @@ class QlikSenseApps {
}
logger.debug(`GET APPS FROM QSEOW: QRS query filter (incl ids, tags): ${filter}`);

// Add app publish status to query string
if (this.options.appPublished === true) {
// Add published apps flag
if (filter.length >= 1) {
// We've previously added some app IDs and/or tags and/or other filters
filter += encodeURIComponent(' or (published eq true)');
} else {
// No app IDs or tags or other filters added yet
filter += encodeURIComponent('published eq true');
}
}

// Should cerrificates be used for authentication?
let axiosConfig;
if (this.options.authType === 'cert') {
Expand Down

0 comments on commit 62060d4

Please sign in to comment.