Skip to content

Commit

Permalink
Remove all default exports
Browse files Browse the repository at this point in the history
  • Loading branch information
mountaindude committed Nov 17, 2024
1 parent ff90297 commit beec900
Show file tree
Hide file tree
Showing 57 changed files with 82 additions and 134 deletions.
2 changes: 1 addition & 1 deletion src/__tests__/app_export_cert.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { jest, test, expect, describe } from '@jest/globals';

import fs from 'node:fs';
import path from 'node:path';
import exportAppToFile from '../lib/cmd/qseow/exportapp.js';
import { exportAppToFile } from '../lib/cmd/qseow/exportapp.js';

const options = {
logLevel: process.env.CTRL_Q_LOG_LEVEL || 'info',
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/app_export_jwt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { jest, test, expect, describe } from '@jest/globals';

import fs from 'node:fs';
import path from 'node:path';
import exportAppToFile from '../lib/cmd/qseow/exportapp.js';
import { exportAppToFile } from '../lib/cmd/qseow/exportapp.js';

const options = {
logLevel: process.env.CTRL_Q_LOG_LEVEL || 'info',
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/app_import_cert.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-console */
import { jest, test, expect, describe } from '@jest/globals';

import importAppFromFile from '../lib/cmd/qseow/importapp.js';
import { importAppFromFile } from '../lib/cmd/qseow/importapp.js';
import { appExistById, deleteAppById } from '../lib/util/qseow/app.js';

const options = {
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/app_import_jwt.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-console */
import { jest, test, expect, describe } from '@jest/globals';

import importAppFromFile from '../lib/cmd/qseow/importapp.js';
import { importAppFromFile } from '../lib/cmd/qseow/importapp.js';
import { appExistById, deleteAppById } from '../lib/util/qseow/app.js';

const options = {
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/app_jwt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { jest, test, expect, describe } from '@jest/globals';

import { getApps, getAppById, appExistById, deleteAppById } from '../lib/util/qseow/app.js';
import importAppFromFile from '../lib/cmd/qseow/importapp.js';
import { importAppFromFile } from '../lib/cmd/qseow/importapp.js';
import { sleep } from '../globals.js';

const options = {
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/bookmark_get_cert.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-console */
import { jest, test, expect, describe } from '@jest/globals';

import getBookmark from '../lib/cmd/qseow/getbookmark.js';
import { getBookmark } from '../lib/cmd/qseow/getbookmark.js';

const options = {
logLevel: process.env.CTRL_Q_LOG_LEVEL || 'info',
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/bookmark_get_jwt.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { jest, test, expect, describe } from '@jest/globals';

import getBookmark from '../lib/cmd/qseow/getbookmark.js';
import { getBookmark } from '../lib/cmd/qseow/getbookmark.js';

const options = {
logLevel: process.env.CTRL_Q_LOG_LEVEL || 'info',
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/connection_test_cert.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { jest, test, expect, describe } from '@jest/globals';

import testConnection from '../lib/cmd/qseow/testconnection.js';
import { testConnection } from '../lib/cmd/qseow/testconnection.js';

const options = {
logLevel: process.env.CTRL_Q_LOG_LEVEL || 'info',
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/connection_test_jwt.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { jest, test, expect, describe } from '@jest/globals';

import testConnection from '../lib/cmd/qseow/testconnection.js';
import { testConnection } from '../lib/cmd/qseow/testconnection.js';

const options = {
logLevel: process.env.CTRL_Q_LOG_LEVEL || 'info',
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/script_get_cert.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { jest, test, expect, describe } from '@jest/globals';

import getScript from '../lib/cmd/qseow/getscript.js';
import { getScript } from '../lib/cmd/qseow/getscript.js';

const options = {
logLevel: process.env.CTRL_Q_LOG_LEVEL || 'info',
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/script_get_jwt.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { jest, test, expect, describe } from '@jest/globals';

import getScript from '../lib/cmd/qseow/getscript.js';
import { getScript } from '../lib/cmd/qseow/getscript.js';

const options = {
logLevel: process.env.CTRL_Q_LOG_LEVEL || 'info',
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/task_custom_property_set_cert.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { jest, test, expect, describe } from '@jest/globals';

import setTaskCustomProperty from '../lib/cmd/qseow/settaskcp.js';
import { setTaskCustomProperty } from '../lib/cmd/qseow/settaskcp.js';
import { getTaskById } from '../lib/util/qseow/task.js';

const options = {
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/task_custom_property_set_jwt.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { jest, test, expect, describe } from '@jest/globals';

import setTaskCustomProperty from '../lib/cmd/qseow/settaskcp.js';
import { setTaskCustomProperty } from '../lib/cmd/qseow/settaskcp.js';
import { getTaskById } from '../lib/util/qseow/task.js';

const options = {
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/task_get_cert.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { jest, test, expect, describe } from '@jest/globals';

import fs from 'node:fs';
import path from 'node:path';
import getTask from '../lib/cmd/qseow/gettask.js';
import { getTask } from '../lib/cmd/qseow/gettask.js';

const options = {
logLevel: process.env.CTRL_Q_LOG_LEVEL || 'info',
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/task_get_jwt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { jest, test, expect, describe } from '@jest/globals';

import fs from 'node:fs';
import path from 'node:path';
import getTask from '../lib/cmd/qseow/gettask.js';
import { getTask } from '../lib/cmd/qseow/gettask.js';

const options = {
logLevel: process.env.CTRL_Q_LOG_LEVEL || 'info',
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/task_import_cert.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { jest, test, expect, describe } from '@jest/globals';

import importTaskFromFile from '../lib/cmd/qseow/importtask.js';
import { importTaskFromFile } from '../lib/cmd/qseow/importtask.js';
import { getTaskById, deleteExternalProgramTaskById, deleteReloadTaskById } from '../lib/util/qseow/task.js';
import { mapTaskType } from '../lib/util/qseow/lookups.js';

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/task_import_jwt.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { jest, test, expect, describe } from '@jest/globals';

import importTaskFromFile from '../lib/cmd/qseow/importtask.js';
import { importTaskFromFile } from '../lib/cmd/qseow/importtask.js';
import { getTaskById, deleteExternalProgramTaskById, deleteReloadTaskById } from '../lib/util/qseow/task.js';
import { mapTaskType } from '../lib/util/qseow/lookups.js';

Expand Down
2 changes: 1 addition & 1 deletion src/lib/cli/qseow-delete-master-measure.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Option } from 'commander';

import { catchLog } from '../util/log.js';
import { qseowSharedParamAssertOptions, masterItemMeasureDeleteAssertOptions } from '../util/qseow/assert-options.js';
import deleteMasterMeasure from '../cmd/qseow/deletemeasure.js';
import { deleteMasterMeasure } from '../cmd/qseow/deletemeasure.js';

export function setupQseowDeleteMasterMeasureCommand(qseow) {
qseow
Expand Down
2 changes: 1 addition & 1 deletion src/lib/cli/qseow-delete-proxy-session.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Option } from 'commander';

import { catchLog } from '../util/log.js';
import { qseowSharedParamAssertOptions, deleteSessionsAssertOptions } from '../util/qseow/assert-options.js';
import deleteSessions from '../cmd/qseow/deletesessions.js';
import { deleteSessions } from '../cmd/qseow/deletesessions.js';

export function setupQseowDeleteProxySessionsCommand(qseow) {
qseow
Expand Down
2 changes: 1 addition & 1 deletion src/lib/cli/qseow-delete-variable.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Option } from 'commander';

import { catchLog } from '../util/log.js';
import { qseowSharedParamAssertOptions, variableDeleteAssertOptions } from '../util/qseow/assert-options.js';
import deleteVariable from '../cmd/qseow/deletevariable.js';
import { deleteVariable } from '../cmd/qseow/deletevariable.js';

export function setupQseowDeleteVariableCommand(qseow) {
qseow
Expand Down
2 changes: 1 addition & 1 deletion src/lib/cli/qseow-get-bookmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Option } from 'commander';

import { catchLog } from '../util/log.js';
import { qseowSharedParamAssertOptions, getBookmarkAssertOptions } from '../util/qseow/assert-options.js';
import getBookmark from '../cmd/qseow/getbookmark.js';
import { getBookmark } from '../cmd/qseow/getbookmark.js';

export function setupQseowGetBookmarkCommand(qseow) {
qseow
Expand Down
2 changes: 1 addition & 1 deletion src/lib/cli/qseow-get-master-measure.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Option } from 'commander';

import { catchLog } from '../util/log.js';
import { qseowSharedParamAssertOptions, masterItemGetAssertOptions } from '../util/qseow/assert-options.js';
import getMasterMeasure from '../cmd/qseow/getmeasure.js';
import { getMasterMeasure } from '../cmd/qseow/getmeasure.js';

export function setupQseowGetMasterMeasureCommand(qseow) {
qseow
Expand Down
2 changes: 1 addition & 1 deletion src/lib/cli/qseow-get-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Option } from 'commander';

import { catchLog } from '../util/log.js';
import { qseowSharedParamAssertOptions, getScriptAssertOptions } from '../util/qseow/assert-options.js';
import getScript from '../cmd/qseow/getscript.js';
import { getScript } from '../cmd/qseow/getscript.js';

export function setupGetScriptCommand(qseow) {
qseow
Expand Down
2 changes: 1 addition & 1 deletion src/lib/cli/qseow-get-task.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Option } from 'commander';

import { catchLog } from '../util/log.js';
import { qseowSharedParamAssertOptions, getTaskAssertOptions } from '../util/qseow/assert-options.js';
import getTask from '../cmd/qseow/gettask.js';
import { getTask } from '../cmd/qseow/gettask.js';

export function setupGetTaskCommand(qseow) {
qseow
Expand Down
2 changes: 1 addition & 1 deletion src/lib/cli/qseow-get-variable.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Option } from 'commander';

import { catchLog } from '../util/log.js';
import { qseowSharedParamAssertOptions, variableGetAssertOptions } from '../util/qseow/assert-options.js';
import getVariable from '../cmd/qseow/getvariable.js';
import { getVariable } from '../cmd/qseow/getvariable.js';

export function setpQseowGetVariableCommand(qseow) {
qseow
Expand Down
2 changes: 1 addition & 1 deletion src/lib/cli/qseow-import-app-from-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Option } from 'commander';

import { catchLog } from '../util/log.js';
import { qseowSharedParamAssertOptions, appImportAssertOptions } from '../util/qseow/assert-options.js';
import importAppFromFile from '../cmd/qseow/importapp.js';
import { importAppFromFile } from '../cmd/qseow/importapp.js';

export function setupQseowImportAppFromFileCommand(qseow) {
qseow
Expand Down
2 changes: 1 addition & 1 deletion src/lib/cli/qseow-import-task-from-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Option } from 'commander';

import { catchLog } from '../util/log.js';
import { qseowSharedParamAssertOptions, taskImportAssertOptions } from '../util/qseow/assert-options.js';
import importTaskFromFile from '../cmd/qseow/importtask.js';
import { importTaskFromFile } from '../cmd/qseow/importtask.js';

export function setupQseowImportTaskFromFileCommand(qseow) {
qseow
Expand Down
2 changes: 1 addition & 1 deletion src/lib/cli/qseow-master-item-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Option } from 'commander';

import { catchLog } from '../util/log.js';
import { qseowSharedParamAssertOptions, masterItemImportAssertOptions } from '../util/qseow/assert-options.js';
import importMasterItemFromFile from '../cmd/qseow/import-masteritem-excel.js';
import { importMasterItemFromFile } from '../cmd/qseow/import-masteritem-excel.js';

export function setupQseowMasterItemImportCommand(qseow) {
qseow
Expand Down
2 changes: 1 addition & 1 deletion src/lib/cli/qseow-scramble-field.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Option } from 'commander';

import { catchLog } from '../util/log.js';
import { qseowSharedParamAssertOptions } from '../util/qseow/assert-options.js';
import scrambleField from '../cmd/qseow/scramblefield.js';
import { scrambleField } from '../cmd/qseow/scramblefield.js';

export function setupQseowScrambleFieldCommand(qseow) {
qseow
Expand Down
2 changes: 1 addition & 1 deletion src/lib/cli/qseow-set-task-cp.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Option } from 'commander';

import { catchLog } from '../util/log.js';
import { qseowSharedParamAssertOptions, setTaskCustomPropertyAssertOptions } from '../util/qseow/assert-options.js';
import setTaskCustomProperty from '../cmd/qseow/settaskcp.js';
import { setTaskCustomProperty } from '../cmd/qseow/settaskcp.js';

export function setupQseowSetTaskCustomPropertyCommand(qseow) {
qseow
Expand Down
2 changes: 1 addition & 1 deletion src/lib/cli/qseow-test-connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Option } from 'commander';

import { catchLog } from '../util/log.js';
import { qseowSharedParamAssertOptions } from '../util/qseow/assert-options.js';
import testConnection from '../cmd/qseow/testconnection.js';
import { testConnection } from '../cmd/qseow/testconnection.js';

export function setupQseowTestConnectionCommand(qseow) {
qseow
Expand Down
2 changes: 1 addition & 1 deletion src/lib/cli/qseow-visualise-task.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Option } from 'commander';

import { catchLog } from '../util/log.js';
import { qseowSharedParamAssertOptions } from '../util/qseow/assert-options.js';
import visTask from '../cmd/qseow/vistask.js';
import { visTask } from '../cmd/qseow/vistask.js';

export function setupQseowVisualiseTaskCommand(qseow) {
qseow
Expand Down
6 changes: 2 additions & 4 deletions src/lib/cmd/qseow/createdim.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { catchLog } from '../../util/log.js';
*
* @param {*} options
*/
const createMasterDimension = async (options) => {
export async function createMasterDimension(options) {
try {
// Set log level
setLoggingLevel(options.logLevel);
Expand Down Expand Up @@ -254,6 +254,4 @@ const createMasterDimension = async (options) => {
} catch (err) {
catchLog('Error creating master dimension', err);
}
};

export default createMasterDimension;
}
9 changes: 2 additions & 7 deletions src/lib/cmd/qseow/deletemeasure.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ let deleteCount = 0;
*
* @param {*} options
*/
const deleteMasterMeasure = async (options) => {
export async function deleteMasterMeasure(options) {
try {
// Set log level
setLoggingLevel(options.logLevel);
Expand Down Expand Up @@ -85,7 +85,6 @@ const deleteMasterMeasure = async (options) => {
deleteMasterItems = deleteMasterItems.concat(measureObj.qMeasureList.qItems);
} else {
// Loop over all master items (identified by name or ID) we should get data for
// eslint-disable-next-line no-restricted-syntax
for (const masterItem of options.masterItem) {
// Can we find this master item in the list retrieved from the app?
if (options.idType === 'name') {
Expand Down Expand Up @@ -115,10 +114,8 @@ const deleteMasterMeasure = async (options) => {
if (deleteMasterItems.length === 0) {
logger.warn(`No matching master item measures found`);
} else {
// eslint-disable-next-line no-restricted-syntax
for (const item of deleteMasterItems) {
if (options.dryRun === undefined || options.dryRun === false) {
// eslint-disable-next-line no-await-in-loop
const res = await app.destroyMeasure(item.qInfo.qId);
if (res !== true) {
logger.error(`Failed deleting measure "${item.qMeta.title}", id=${item.qInfo.qId} in app "${item.qInfo.qId}"`);
Expand Down Expand Up @@ -148,6 +145,4 @@ const deleteMasterMeasure = async (options) => {
} catch (err) {
catchLog('Error in deleteMasterMeasure', err);
}
};

export default deleteMasterMeasure;
}
6 changes: 2 additions & 4 deletions src/lib/cmd/qseow/deletesessions.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { catchLog } from '../../util/log.js';
* Delete Qlik Sense proxy sessions
* @param {object} options - Options object
*/
const deleteSessions = async (options) => {
export async function deleteSessions(options) {
try {
// Set log level
setLoggingLevel(options.logLevel);
Expand All @@ -31,6 +31,4 @@ const deleteSessions = async (options) => {

return false;
}
};

export default deleteSessions;
}
4 changes: 1 addition & 3 deletions src/lib/cmd/qseow/deletevariable.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { catchLog } from '../../util/log.js';
*
* @param {*} options
*/
const deleteVariable = async (options) => {
export async function deleteVariable(options) {
try {
// Set log level
setLoggingLevel(options.logLevel);
Expand Down Expand Up @@ -183,5 +183,3 @@ const deleteVariable = async (options) => {
catchLog('Error in deleteVariable', err);
}
};

export default deleteVariable;
6 changes: 2 additions & 4 deletions src/lib/cmd/qseow/getbookmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const consoleTableConfig = {
*
* @param {*} options
*/
const getBookmark = async (options) => {
export async function getBookmark(options) {
let session;

try {
Expand Down Expand Up @@ -217,6 +217,4 @@ const getBookmark = async (options) => {
}
return false;
}
};

export default getBookmark;
}
6 changes: 2 additions & 4 deletions src/lib/cmd/qseow/getmeasure.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const consoleTableConfig = {
*
* @param {*} options
*/
const getMasterMeasure = async (options) => {
export async function getMasterMeasure(options) {
try {
// Set log level
setLoggingLevel(options.logLevel);
Expand Down Expand Up @@ -242,6 +242,4 @@ const getMasterMeasure = async (options) => {
} catch (err) {
catchLog('Error in getMasterMeasure', err);
}
};

export default getMasterMeasure;
}
Loading

0 comments on commit beec900

Please sign in to comment.