dataverse-utils 2.0.6 → 2.0.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.
@@ -1,29 +1,22 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.deployAssembly = void 0;
7
- const fs_1 = __importDefault(require("fs"));
8
- const path_1 = __importDefault(require("path"));
9
- const pluginAssembly_1 = require("./models/pluginAssembly");
10
- const just_scripts_utils_1 = require("just-scripts-utils");
11
- async function deployAssembly(creds, apiConfig) {
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ import { deploy } from './models/pluginAssembly';
4
+ import { logger } from 'just-scripts-utils';
5
+ export async function deployAssembly(creds, apiConfig) {
12
6
  const currentPath = '.';
13
- const configFile = fs_1.default.readFileSync(path_1.default.resolve(currentPath, 'dataverse.config.json'), 'utf8');
7
+ const configFile = fs.readFileSync(path.resolve(currentPath, 'dataverse.config.json'), 'utf8');
14
8
  if (configFile == null) {
15
- just_scripts_utils_1.logger.warn('unable to find dataverse.config.json file');
9
+ logger.warn('unable to find dataverse.config.json file');
16
10
  return;
17
11
  }
18
12
  const config = JSON.parse(configFile);
19
- just_scripts_utils_1.logger.info('deploy assembly');
13
+ logger.info('deploy assembly');
20
14
  try {
21
- await (0, pluginAssembly_1.deploy)(config, apiConfig, creds.solution);
15
+ await deploy(config, apiConfig, creds.solution);
22
16
  }
23
17
  catch (error) {
24
- just_scripts_utils_1.logger.error(error.message);
18
+ logger.error(error.message);
25
19
  return;
26
20
  }
27
- just_scripts_utils_1.logger.info(`deployed assembly ${config.name}\r\n`);
21
+ logger.info(`deployed assembly ${config.name}\r\n`);
28
22
  }
29
- exports.deployAssembly = deployAssembly;
package/lib/auth.js CHANGED
@@ -1,25 +1,22 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getAccessToken = void 0;
4
- const cachePlugin_1 = require("./cachePlugin");
5
- const msal_node_1 = require("@azure/msal-node");
6
- const just_scripts_utils_1 = require("just-scripts-utils");
1
+ import { cachePlugin } from './cachePlugin';
2
+ import { PublicClientApplication } from '@azure/msal-node';
3
+ import { logger } from 'just-scripts-utils';
7
4
  const clientId = '51f81489-12ee-4a9e-aaae-a2591f45987d';
8
- const getAccessToken = async (tenant, url) => {
5
+ export const getAccessToken = async (tenant, url) => {
9
6
  const config = {
10
7
  auth: {
11
8
  clientId: clientId,
12
9
  authority: `https://login.microsoftonline.com/${tenant}/`
13
10
  },
14
11
  cache: {
15
- cachePlugin: (0, cachePlugin_1.cachePlugin)(url.replace('https://', '').split('.')[0])
12
+ cachePlugin: cachePlugin(url.replace('https://', '').split('.')[0])
16
13
  }
17
14
  };
18
- const pca = new msal_node_1.PublicClientApplication(config);
15
+ const pca = new PublicClientApplication(config);
19
16
  const cache = pca.getTokenCache();
20
- const accounts = await (cache === null || cache === void 0 ? void 0 : cache.getAllAccounts().catch(ex => {
17
+ const accounts = await cache?.getAllAccounts().catch(ex => {
21
18
  throw new Error(ex.message);
22
- }));
19
+ });
23
20
  // Try to get token silently
24
21
  if (accounts.length > 0) {
25
22
  const silentToken = await pca.acquireTokenSilent({
@@ -35,10 +32,9 @@ const getAccessToken = async (tenant, url) => {
35
32
  // Acquire token by device code
36
33
  const token = await pca.acquireTokenByDeviceCode({
37
34
  scopes: [`${url}/.default`],
38
- deviceCodeCallback: (response) => just_scripts_utils_1.logger.info(response.message)
35
+ deviceCodeCallback: (response) => logger.info(response.message)
39
36
  }).catch(ex => {
40
37
  throw new Error(ex.message);
41
38
  });
42
39
  return token;
43
40
  };
44
- exports.getAccessToken = getAccessToken;
@@ -1,37 +1,31 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.cachePlugin = void 0;
7
- const os_1 = __importDefault(require("os"));
8
- const path_1 = __importDefault(require("path"));
9
- const fs_1 = __importDefault(require("fs"));
10
- const cryptr_1 = __importDefault(require("cryptr"));
1
+ import os from 'os';
2
+ import path from 'path';
3
+ import fs from 'fs';
4
+ import Cryptr from 'cryptr';
11
5
  const encrypt = (text) => {
12
- const user = os_1.default.userInfo().username;
13
- const cryptr = new cryptr_1.default(user);
6
+ const user = os.userInfo().username;
7
+ const cryptr = new Cryptr(user);
14
8
  const encrypted = cryptr.encrypt(text);
15
9
  return encrypted;
16
10
  };
17
11
  const decrypt = (text) => {
18
- const user = os_1.default.userInfo().username;
19
- const cryptr = new cryptr_1.default(user);
12
+ const user = os.userInfo().username;
13
+ const cryptr = new Cryptr(user);
20
14
  const decrypted = cryptr.decrypt(text);
21
15
  return decrypted;
22
16
  };
23
- function cachePlugin(org) {
17
+ export function cachePlugin(org) {
24
18
  const getCachePath = () => {
25
- if (!fs_1.default.existsSync(path_1.default.join(os_1.default.homedir(), './.dataverse-utils/'))) {
26
- fs_1.default.mkdirSync(path_1.default.join(os_1.default.homedir(), './.dataverse-utils/'));
19
+ if (!fs.existsSync(path.join(os.homedir(), './.dataverse-utils/'))) {
20
+ fs.mkdirSync(path.join(os.homedir(), './.dataverse-utils/'));
27
21
  }
28
- return path_1.default.join(os_1.default.homedir(), `./.dataverse-utils/${org}.json`);
22
+ return path.join(os.homedir(), `./.dataverse-utils/${org}.json`);
29
23
  };
30
24
  const cacheLocation = getCachePath();
31
25
  const beforeCacheAccess = (tokenCacheContext) => {
32
26
  return new Promise((resolve, reject) => {
33
- if (fs_1.default.existsSync(cacheLocation)) {
34
- fs_1.default.readFile(cacheLocation, 'utf-8', (err, data) => {
27
+ if (fs.existsSync(cacheLocation)) {
28
+ fs.readFile(cacheLocation, 'utf-8', (err, data) => {
35
29
  if (err) {
36
30
  reject();
37
31
  }
@@ -44,7 +38,7 @@ function cachePlugin(org) {
44
38
  }
45
39
  else {
46
40
  const encrypted = encrypt(tokenCacheContext.tokenCache.serialize());
47
- fs_1.default.writeFile(cacheLocation, encrypted, (err) => {
41
+ fs.writeFile(cacheLocation, encrypted, (err) => {
48
42
  if (err) {
49
43
  reject();
50
44
  }
@@ -59,7 +53,7 @@ function cachePlugin(org) {
59
53
  return new Promise((resolve, reject) => {
60
54
  if (tokenCacheContext.cacheHasChanged) {
61
55
  const encrypted = encrypt(tokenCacheContext.tokenCache.serialize());
62
- fs_1.default.writeFile(cacheLocation, encrypted, (err) => {
56
+ fs.writeFile(cacheLocation, encrypted, (err) => {
63
57
  if (err) {
64
58
  reject(err);
65
59
  }
@@ -76,4 +70,3 @@ function cachePlugin(org) {
76
70
  afterCacheAccess
77
71
  };
78
72
  }
79
- exports.cachePlugin = cachePlugin;
@@ -1,43 +1,38 @@
1
1
  #!/usr/bin/env node
2
- "use strict";
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- const commander_1 = require("commander");
8
- const deploy_1 = __importDefault(require("./deploy"));
9
- const generate_1 = __importDefault(require("./generate"));
10
- commander_1.program
2
+ import { program } from 'commander';
3
+ import deploy from './deploy';
4
+ import generate from './generate';
5
+ program
11
6
  // eslint-disable-next-line @typescript-eslint/no-var-requires
12
7
  .version(require('../package').version)
13
8
  .usage('<command> [options]');
14
9
  // Deploy command
15
- commander_1.program
10
+ program
16
11
  .command('deploy')
17
12
  .description('Deploy file(s) to dataverse (webresource, plugin, workflow)')
18
13
  .argument('[type]', 'Type of project to deploy')
19
14
  .argument('[files]', 'Comma separate list of files to deploy')
20
15
  .action((type, files) => {
21
- (0, deploy_1.default)(type, files);
16
+ deploy(type, files);
22
17
  });
23
18
  // Generate command
24
- commander_1.program
19
+ program
25
20
  .command('generate')
26
21
  .description('Generate early-bound TypeScript file for specified table')
27
22
  .argument('[table]', 'Table to generate')
28
23
  .action((table) => {
29
- (0, generate_1.default)(table);
24
+ generate(table);
30
25
  });
31
26
  // Show help on unknown command
32
- commander_1.program
27
+ program
33
28
  .arguments('<command>')
34
29
  .action((cmd) => {
35
- commander_1.program.outputHelp();
30
+ program.outputHelp();
36
31
  console.log();
37
32
  console.log(`Unknown command ${cmd}.`);
38
33
  console.log();
39
34
  });
40
- commander_1.program.parse(process.argv);
35
+ program.parse(process.argv);
41
36
  if (!process.argv.slice(2).length) {
42
- commander_1.program.outputHelp();
37
+ program.outputHelp();
43
38
  }
@@ -1,16 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getTableMetadata = exports.publish = exports.addToSolution = exports.ComponentType = void 0;
4
- const node_1 = require("dataverse-webapi/lib/node");
5
- var ComponentType;
1
+ import { retrieveMultiple, unboundAction } from 'dataverse-webapi/lib/node';
2
+ export var ComponentType;
6
3
  (function (ComponentType) {
7
4
  ComponentType[ComponentType["WebResource"] = 61] = "WebResource";
8
5
  ComponentType[ComponentType["PluginType"] = 90] = "PluginType";
9
6
  ComponentType[ComponentType["PluginAssembly"] = 91] = "PluginAssembly";
10
7
  ComponentType[ComponentType["SDKMessageProcessingStep"] = 92] = "SDKMessageProcessingStep";
11
8
  ComponentType[ComponentType["SDKMessageProcessingStepImage"] = 93] = "SDKMessageProcessingStepImage";
12
- })(ComponentType = exports.ComponentType || (exports.ComponentType = {}));
13
- async function addToSolution(id, solution, type, apiConfig) {
9
+ })(ComponentType || (ComponentType = {}));
10
+ export async function addToSolution(id, solution, type, apiConfig) {
14
11
  const data = {
15
12
  ComponentId: id,
16
13
  ComponentType: type,
@@ -18,22 +15,20 @@ async function addToSolution(id, solution, type, apiConfig) {
18
15
  AddRequiredComponents: false,
19
16
  IncludedComponentSettingsValues: null
20
17
  };
21
- await (0, node_1.unboundAction)(apiConfig, 'AddSolutionComponent', data);
18
+ await unboundAction(apiConfig, 'AddSolutionComponent', data);
22
19
  }
23
- exports.addToSolution = addToSolution;
24
- async function publish(publishXml, apiConfig) {
20
+ export async function publish(publishXml, apiConfig) {
25
21
  const data = {
26
22
  ParameterXml: `<importexportxml><webresources>${publishXml}</webresources></importexportxml>`
27
23
  };
28
- await (0, node_1.unboundAction)(apiConfig, 'PublishXml', data);
24
+ await unboundAction(apiConfig, 'PublishXml', data);
29
25
  }
30
- exports.publish = publish;
31
- async function getTableMetadata(table, apiConfig) {
26
+ export async function getTableMetadata(table, apiConfig) {
32
27
  const options = [
33
28
  '?$select=DisplayName,LogicalName,EntitySetName,SchemaName',
34
29
  '&$expand=Attributes($select=LogicalName,SchemaName)'
35
30
  ].join('');
36
- const metadata = await (0, node_1.retrieveMultiple)(apiConfig, `EntityDefinitions(LogicalName='${table}')`, options);
31
+ const metadata = await retrieveMultiple(apiConfig, `EntityDefinitions(LogicalName='${table}')`, options);
37
32
  if (metadata == null) {
38
33
  throw Error(`Table ${table} not found in metadata cache`);
39
34
  }
@@ -41,7 +36,7 @@ async function getTableMetadata(table, apiConfig) {
41
36
  '?$select=attributevalue,value,attributename',
42
37
  `&$filter=objecttypecode eq '${table}'`
43
38
  ].join('');
44
- const choiceMetadata = await (0, node_1.retrieveMultiple)(apiConfig, 'stringmaps', choiceOptions);
39
+ const choiceMetadata = await retrieveMultiple(apiConfig, 'stringmaps', choiceOptions);
45
40
  const tableMetadata = {
46
41
  logicalName: metadata.LogicalName,
47
42
  schemaName: metadata.SchemaName,
@@ -65,4 +60,3 @@ async function getTableMetadata(table, apiConfig) {
65
60
  });
66
61
  return tableMetadata;
67
62
  }
68
- exports.getTableMetadata = getTableMetadata;
package/lib/deploy.js CHANGED
@@ -1,21 +1,16 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const prompts_1 = __importDefault(require("prompts"));
7
- const fs_1 = __importDefault(require("fs"));
8
- const path_1 = __importDefault(require("path"));
9
- const just_scripts_utils_1 = require("just-scripts-utils");
10
- const assemblyDeploy_1 = require("./assemblyDeploy");
11
- const webResourceDeploy_1 = require("./webResourceDeploy");
12
- const node_1 = require("dataverse-webapi/lib/node");
13
- const auth_1 = require("./auth");
14
- async function deploy(type, files) {
1
+ import prompts from 'prompts';
2
+ import fs from 'fs';
3
+ import path from 'path';
4
+ import { logger } from 'just-scripts-utils';
5
+ import { deployAssembly } from './assemblyDeploy';
6
+ import { deployWebResource } from './webResourceDeploy';
7
+ import { WebApiConfig } from 'dataverse-webapi/lib/node';
8
+ import { getAccessToken } from './auth';
9
+ export default async function deploy(type, files) {
15
10
  if (!type || (type !== 'webresource' && type !== 'assembly')) {
16
11
  const invalid = type !== undefined && type !== 'webresource' && type !== 'assembly';
17
12
  const invalidMessage = invalid ? `${type} is not a valid project type.` : '';
18
- const { typePrompt } = await (0, prompts_1.default)({
13
+ const { typePrompt } = await prompts({
19
14
  type: 'select',
20
15
  name: 'typePrompt',
21
16
  message: `${invalidMessage} select project type to deploy`,
@@ -27,34 +22,33 @@ async function deploy(type, files) {
27
22
  type = typePrompt;
28
23
  }
29
24
  const currentPath = '.';
30
- const credsFile = fs_1.default.readFileSync(path_1.default.resolve(currentPath, 'dataverse.config.json'), 'utf8');
25
+ const credsFile = fs.readFileSync(path.resolve(currentPath, 'dataverse.config.json'), 'utf8');
31
26
  if (credsFile == null) {
32
- just_scripts_utils_1.logger.warn('unable to find dataverse.config.json file');
27
+ logger.warn('unable to find dataverse.config.json file');
33
28
  return;
34
29
  }
35
30
  const creds = JSON.parse(credsFile).connection;
36
31
  let token = null;
37
32
  try {
38
- token = await (0, auth_1.getAccessToken)(creds.tenant, creds.server);
33
+ token = await getAccessToken(creds.tenant, creds.server);
39
34
  }
40
35
  catch (error) {
41
- just_scripts_utils_1.logger.error(`failed to acquire access token: ${error.message}`);
36
+ logger.error(`failed to acquire access token: ${error.message}`);
42
37
  return;
43
38
  }
44
39
  if (token == null || token.accessToken == null) {
45
- just_scripts_utils_1.logger.error('failed to acquire access token');
40
+ logger.error('failed to acquire access token');
46
41
  return;
47
42
  }
48
- const apiConfig = new node_1.WebApiConfig('8.2', token.accessToken, creds.server);
43
+ const apiConfig = new WebApiConfig('8.2', token.accessToken, creds.server);
49
44
  switch (type) {
50
45
  case 'webresource':
51
- await (0, webResourceDeploy_1.deployWebResource)(creds, apiConfig, files);
46
+ await deployWebResource(creds, apiConfig, files);
52
47
  break;
53
48
  case 'assembly':
54
- await (0, assemblyDeploy_1.deployAssembly)(creds, apiConfig);
49
+ await deployAssembly(creds, apiConfig);
55
50
  break;
56
51
  default:
57
52
  break;
58
53
  }
59
54
  }
60
- exports.default = deploy;
package/lib/generate.js CHANGED
@@ -1,18 +1,13 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const prompts_1 = __importDefault(require("prompts"));
7
- const fs_1 = __importDefault(require("fs"));
8
- const path_1 = __importDefault(require("path"));
9
- const just_scripts_utils_1 = require("just-scripts-utils");
10
- const dataverse_service_1 = require("./dataverse.service");
11
- const node_1 = require("dataverse-webapi/lib/node");
12
- const auth_1 = require("./auth");
13
- async function generate(table) {
1
+ import prompts from 'prompts';
2
+ import fs from 'fs';
3
+ import path from 'path';
4
+ import { logger } from 'just-scripts-utils';
5
+ import { getTableMetadata } from './dataverse.service';
6
+ import { WebApiConfig } from 'dataverse-webapi/lib/node';
7
+ import { getAccessToken } from './auth';
8
+ export default async function generate(table) {
14
9
  while (!table) {
15
- const { tablePrompt } = await (0, prompts_1.default)({
10
+ const { tablePrompt } = await prompts({
16
11
  type: 'text',
17
12
  name: 'tablePrompt',
18
13
  message: `enter table to generate`
@@ -20,32 +15,32 @@ async function generate(table) {
20
15
  table = tablePrompt;
21
16
  }
22
17
  const currentPath = '.';
23
- const credsFile = fs_1.default.readFileSync(path_1.default.resolve(currentPath, 'dataverse.config.json'), 'utf8');
18
+ const credsFile = fs.readFileSync(path.resolve(currentPath, 'dataverse.config.json'), 'utf8');
24
19
  if (credsFile == null) {
25
- just_scripts_utils_1.logger.warn('unable to find dataverse.config.json file');
20
+ logger.warn('unable to find dataverse.config.json file');
26
21
  return;
27
22
  }
28
23
  const creds = JSON.parse(credsFile).connection;
29
24
  let token = null;
30
25
  try {
31
- token = await (0, auth_1.getAccessToken)(creds.tenant, creds.server);
26
+ token = await getAccessToken(creds.tenant, creds.server);
32
27
  }
33
28
  catch (error) {
34
- just_scripts_utils_1.logger.error(`failed to acquire access token: ${error.message}`);
29
+ logger.error(`failed to acquire access token: ${error.message}`);
35
30
  return;
36
31
  }
37
32
  if (token == null || token.accessToken == null) {
38
- just_scripts_utils_1.logger.error('failed to acquire access token');
33
+ logger.error('failed to acquire access token');
39
34
  return;
40
35
  }
41
- const apiConfig = new node_1.WebApiConfig('8.2', token.accessToken, creds.server);
36
+ const apiConfig = new WebApiConfig('8.2', token.accessToken, creds.server);
42
37
  let metadata = {};
43
- just_scripts_utils_1.logger.info('Retrieve table metadata');
38
+ logger.info('Retrieve table metadata');
44
39
  try {
45
- metadata = await (0, dataverse_service_1.getTableMetadata)(table, apiConfig);
40
+ metadata = await getTableMetadata(table, apiConfig);
46
41
  }
47
42
  catch (error) {
48
- just_scripts_utils_1.logger.error(error.message);
43
+ logger.error(error.message);
49
44
  return;
50
45
  }
51
46
  // Build code file from metadata
@@ -69,19 +64,17 @@ async function generate(table) {
69
64
  '\r\n',
70
65
  '\r\n',
71
66
  metadata.choices.map(c => {
72
- var _a, _b;
73
67
  const field = metadata.fields.find(f => f.logicalName === c.column);
74
- return ` ${(_a = field === null || field === void 0 ? void 0 : field.schemaName) !== null && _a !== void 0 ? _a : c.column} = ${metadata.schemaName}_${(_b = field === null || field === void 0 ? void 0 : field.schemaName) !== null && _b !== void 0 ? _b : c.column};`;
68
+ return ` ${field?.schemaName ?? c.column} = ${metadata.schemaName}_${field?.schemaName ?? c.column};`;
75
69
  }).join('\r\n'),
76
70
  '\r\n',
77
71
  '}',
78
72
  '\r\n',
79
73
  '\r\n',
80
74
  metadata.choices.map(c => {
81
- var _a;
82
75
  const field = metadata.fields.find(f => f.logicalName === c.column);
83
76
  return [
84
- `export enum ${metadata.schemaName}_${(_a = field === null || field === void 0 ? void 0 : field.schemaName) !== null && _a !== void 0 ? _a : c.column} {`,
77
+ `export enum ${metadata.schemaName}_${field?.schemaName ?? c.column} {`,
85
78
  '\r\n',
86
79
  c.options.map(x => ` '${x.text.replace(`'`, `\\'`)}' = ${x.value}`).join(',\r\n'),
87
80
  '\r\n',
@@ -92,10 +85,9 @@ async function generate(table) {
92
85
  '\r\n',
93
86
  `export default new ${metadata.schemaName}();`
94
87
  ].join('');
95
- if (!fs_1.default.existsSync(path_1.default.resolve(currentPath, 'src', 'scripts', 'models'))) {
96
- fs_1.default.mkdirSync(path_1.default.resolve(currentPath, 'src', 'scripts', 'models'));
88
+ if (!fs.existsSync(path.resolve(currentPath, 'src', 'scripts', 'models'))) {
89
+ fs.mkdirSync(path.resolve(currentPath, 'src', 'scripts', 'models'));
97
90
  }
98
- fs_1.default.writeFileSync(path_1.default.resolve(currentPath, 'src', 'scripts', 'models', `${metadata.schemaName}.ts`), codeFile);
99
- just_scripts_utils_1.logger.info(`Table metadata output to models/${metadata.schemaName}.ts`);
91
+ fs.writeFileSync(path.resolve(currentPath, 'src', 'scripts', 'models', `${metadata.schemaName}.ts`), codeFile);
92
+ logger.info(`Table metadata output to models/${metadata.schemaName}.ts`);
100
93
  }
101
- exports.default = generate;
@@ -1,28 +1,22 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.deploy = void 0;
7
- const fs_1 = __importDefault(require("fs"));
8
- const glob_1 = __importDefault(require("glob"));
9
- const node_1 = require("dataverse-webapi/lib/node");
10
- const pluginType_1 = require("./pluginType");
11
- const dataverse_service_1 = require("../dataverse.service");
12
- const just_scripts_utils_1 = require("just-scripts-utils");
13
- async function deploy(config, apiConfig, solution) {
14
- const files = glob_1.default.sync(`**/${config.name}.dll`);
1
+ import fs from 'fs';
2
+ import glob from 'glob';
3
+ import { retrieveMultiple, createWithReturnData, update } from 'dataverse-webapi/lib/node';
4
+ import { deployType } from './pluginType';
5
+ import { addToSolution, ComponentType } from '../dataverse.service';
6
+ import { logger } from 'just-scripts-utils';
7
+ export async function deploy(config, apiConfig, solution) {
8
+ const files = glob.sync(`**/${config.name}.dll`);
15
9
  if (files.length === 0) {
16
- just_scripts_utils_1.logger.error(`assembly ${config.name}.dll not found`);
10
+ logger.error(`assembly ${config.name}.dll not found`);
17
11
  return;
18
12
  }
19
- const content = fs_1.default.readFileSync(files[0]).toString('base64');
13
+ const content = fs.readFileSync(files[0]).toString('base64');
20
14
  let assemblyId = '';
21
15
  try {
22
16
  assemblyId = await retrieveAssembly(config.name, apiConfig);
23
17
  }
24
18
  catch (error) {
25
- just_scripts_utils_1.logger.error(`failed to retrieve assembly ${config.name}: ${error.message}`);
19
+ logger.error(`failed to retrieve assembly ${config.name}: ${error.message}`);
26
20
  return;
27
21
  }
28
22
  if (assemblyId != '') {
@@ -42,10 +36,10 @@ async function deploy(config, apiConfig, solution) {
42
36
  }
43
37
  if (solution != undefined) {
44
38
  try {
45
- await (0, dataverse_service_1.addToSolution)(assemblyId, solution, dataverse_service_1.ComponentType.PluginAssembly, apiConfig);
39
+ await addToSolution(assemblyId, solution, ComponentType.PluginAssembly, apiConfig);
46
40
  }
47
41
  catch (error) {
48
- just_scripts_utils_1.logger.error(`failed to add to solution: ${error.message}`);
42
+ logger.error(`failed to add to solution: ${error.message}`);
49
43
  }
50
44
  }
51
45
  }
@@ -53,24 +47,23 @@ async function deploy(config, apiConfig, solution) {
53
47
  try {
54
48
  const promises = config.types.map(async (type) => {
55
49
  type['pluginassemblyid@odata.bind'] = `/pluginassemblies(${assemblyId})`;
56
- await (0, pluginType_1.deployType)(type, apiConfig, solution);
50
+ await deployType(type, apiConfig, solution);
57
51
  });
58
52
  await Promise.all(promises);
59
53
  }
60
54
  catch (error) {
61
- just_scripts_utils_1.logger.error(error.message);
55
+ logger.error(error.message);
62
56
  return;
63
57
  }
64
58
  }
65
59
  }
66
- exports.deploy = deploy;
67
60
  async function retrieveAssembly(name, apiConfig) {
68
61
  const options = `$select=pluginassemblyid&$filter=name eq '${name}'`;
69
- const result = await (0, node_1.retrieveMultiple)(apiConfig, 'pluginassemblies', options);
62
+ const result = await retrieveMultiple(apiConfig, 'pluginassemblies', options);
70
63
  return result.value.length > 0 ? result.value[0].pluginassemblyid : '';
71
64
  }
72
65
  async function createAssembly(config, content, apiConfig) {
73
- just_scripts_utils_1.logger.info(`create assembly ${config.name}`);
66
+ logger.info(`create assembly ${config.name}`);
74
67
  const assembly = {
75
68
  name: config.name,
76
69
  content: content,
@@ -80,20 +73,17 @@ async function createAssembly(config, content, apiConfig) {
80
73
  sourcetype: 0,
81
74
  culture: ''
82
75
  };
83
- let result;
84
- try {
85
- result = await (0, node_1.createWithReturnData)(apiConfig, 'pluginassemblies', assembly, '$select=pluginassemblyid');
86
- }
87
- catch (error) {
88
- throw new Error(error.message);
76
+ const result = await createWithReturnData(apiConfig, 'pluginassemblies', assembly, '$select=pluginassemblyid');
77
+ if (result.error) {
78
+ throw new Error(result.error.message);
89
79
  }
90
80
  return result.pluginassemblyid;
91
81
  }
92
82
  async function updateAssembly(id, config, content, apiConfig) {
93
- just_scripts_utils_1.logger.info(`update assembly ${config.name}`);
83
+ logger.info(`update assembly ${config.name}`);
94
84
  const assembly = {
95
85
  content: content,
96
86
  version: config.version
97
87
  };
98
- return (0, node_1.update)(apiConfig, 'pluginassemblies', id, assembly);
88
+ return update(apiConfig, 'pluginassemblies', id, assembly);
99
89
  }
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deployImage = void 0;
4
- const just_scripts_utils_1 = require("just-scripts-utils");
5
- const node_1 = require("dataverse-webapi/lib/node");
6
- async function deployImage(stepId, image, message, apiConfig) {
1
+ import { logger } from 'just-scripts-utils';
2
+ import { retrieveMultiple, createWithReturnData, update } from 'dataverse-webapi/lib/node';
3
+ export async function deployImage(stepId, image, message, apiConfig) {
7
4
  image['sdkmessageprocessingstepid@odata.bind'] = `/sdkmessageprocessingsteps(${stepId})`;
8
5
  switch (message) {
9
6
  case 'Create':
@@ -41,24 +38,20 @@ async function deployImage(stepId, image, message, apiConfig) {
41
38
  }
42
39
  return imageId;
43
40
  }
44
- exports.deployImage = deployImage;
45
41
  async function retrieveImage(stepId, image, apiConfig) {
46
42
  const options = `$select=sdkmessageprocessingstepimageid&$filter=name eq '${image.name}' and _sdkmessageprocessingstepid_value eq ${stepId}`;
47
- const result = await (0, node_1.retrieveMultiple)(apiConfig, 'sdkmessageprocessingstepimages', options);
43
+ const result = await retrieveMultiple(apiConfig, 'sdkmessageprocessingstepimages', options);
48
44
  return result.value.length > 0 ? result.value[0].sdkmessageprocessingstepimageid : '';
49
45
  }
50
46
  async function createImage(image, apiConfig) {
51
- just_scripts_utils_1.logger.info(`create plugin image ${image.name}`);
52
- let result;
53
- try {
54
- result = await (0, node_1.createWithReturnData)(apiConfig, 'sdkmessageprocessingstepimages', image, '$select=sdkmessageprocessingstepimageid');
55
- }
56
- catch (error) {
57
- throw new Error(error.message);
47
+ logger.info(`create plugin image ${image.name}`);
48
+ const result = await createWithReturnData(apiConfig, 'sdkmessageprocessingstepimages', image, '$select=sdkmessageprocessingstepimageid');
49
+ if (result.error) {
50
+ throw new Error(result.error.message);
58
51
  }
59
52
  return result.sdkmessageprocessingstepimageid;
60
53
  }
61
54
  async function updateImage(id, image, apiConfig) {
62
- just_scripts_utils_1.logger.info(`update plugin image ${image.name}`);
63
- return (0, node_1.update)(apiConfig, 'sdkmessageprocessingstepimages', id, image);
55
+ logger.info(`update plugin image ${image.name}`);
56
+ return update(apiConfig, 'sdkmessageprocessingstepimages', id, image);
64
57
  }
@@ -1,21 +1,17 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deployStep = void 0;
4
- const node_1 = require("dataverse-webapi/lib/node");
5
- const dataverse_service_1 = require("../dataverse.service");
6
- const just_scripts_utils_1 = require("just-scripts-utils");
7
- const pluginImage_1 = require("./pluginImage");
8
- async function deployStep(step, apiConfig, solution) {
9
- var _a, _b;
1
+ import { retrieveMultiple, createWithReturnData, update } from 'dataverse-webapi/lib/node';
2
+ import { addToSolution, ComponentType } from '../dataverse.service';
3
+ import { logger } from 'just-scripts-utils';
4
+ import { deployImage } from './pluginImage';
5
+ export async function deployStep(step, apiConfig, solution) {
10
6
  let stepId = await retrieveStep(step.name, apiConfig);
11
- const messageId = await getSdkMessageId((_a = step.message) !== null && _a !== void 0 ? _a : '', apiConfig);
7
+ const messageId = await getSdkMessageId(step.message ?? '', apiConfig);
12
8
  if (messageId == '') {
13
- just_scripts_utils_1.logger.error(`sdk message ${step.message} not found`);
9
+ logger.error(`sdk message ${step.message} not found`);
14
10
  return;
15
11
  }
16
- const filterId = await getSdkMessageFilterId(messageId, (_b = step.entity) !== null && _b !== void 0 ? _b : '', apiConfig);
12
+ const filterId = await getSdkMessageFilterId(messageId, step.entity ?? '', apiConfig);
17
13
  if (filterId == '') {
18
- just_scripts_utils_1.logger.error(`sdk message ${step.message} for entity ${step.entity} not found`);
14
+ logger.error(`sdk message ${step.message} for entity ${step.entity} not found`);
19
15
  return;
20
16
  }
21
17
  step['sdkmessagefilterid@odata.bind'] = `/sdkmessagefilters(${filterId})`;
@@ -45,7 +41,7 @@ async function deployStep(step, apiConfig, solution) {
45
41
  }
46
42
  if (solution != undefined) {
47
43
  try {
48
- await (0, dataverse_service_1.addToSolution)(stepId, solution, dataverse_service_1.ComponentType.SDKMessageProcessingStep, apiConfig);
44
+ await addToSolution(stepId, solution, ComponentType.SDKMessageProcessingStep, apiConfig);
49
45
  }
50
46
  catch (error) {
51
47
  throw new Error(`failed to add to solution: ${error.message}`);
@@ -54,7 +50,7 @@ async function deployStep(step, apiConfig, solution) {
54
50
  }
55
51
  if (images && images.length > 0) {
56
52
  try {
57
- const promises = images.map(image => (0, pluginImage_1.deployImage)(stepId, image, message, apiConfig));
53
+ const promises = images.map(image => deployImage(stepId, image, message, apiConfig));
58
54
  await Promise.all(promises);
59
55
  }
60
56
  catch (error) {
@@ -63,10 +59,9 @@ async function deployStep(step, apiConfig, solution) {
63
59
  }
64
60
  return stepId;
65
61
  }
66
- exports.deployStep = deployStep;
67
62
  async function retrieveStep(name, apiConfig) {
68
63
  const options = `$select=sdkmessageprocessingstepid&$filter=name eq '${name}'`;
69
- const result = await (0, node_1.retrieveMultiple)(apiConfig, 'sdkmessageprocessingsteps', options);
64
+ const result = await retrieveMultiple(apiConfig, 'sdkmessageprocessingsteps', options);
70
65
  return result.value.length > 0 ? result.value[0].sdkmessageprocessingstepid : '';
71
66
  }
72
67
  async function getSdkMessageFilterId(messageId, entityName, apiConfig) {
@@ -74,7 +69,7 @@ async function getSdkMessageFilterId(messageId, entityName, apiConfig) {
74
69
  `?$filter=primaryobjecttypecode eq '${entityName}' and _sdkmessageid_value eq ${messageId}`,
75
70
  '&$select=sdkmessagefilterid'
76
71
  ].join('');
77
- const message = await (0, node_1.retrieveMultiple)(apiConfig, 'sdkmessagefilters', options);
72
+ const message = await retrieveMultiple(apiConfig, 'sdkmessagefilters', options);
78
73
  return message.value.length > 0 ? message.value[0].sdkmessagefilterid : '';
79
74
  }
80
75
  async function getSdkMessageId(name, apiConfig) {
@@ -82,21 +77,18 @@ async function getSdkMessageId(name, apiConfig) {
82
77
  `?$filter=name eq '${name}'`,
83
78
  '&$select=sdkmessageid'
84
79
  ].join('');
85
- const message = await (0, node_1.retrieveMultiple)(apiConfig, 'sdkmessages', options);
80
+ const message = await retrieveMultiple(apiConfig, 'sdkmessages', options);
86
81
  return message.value.length > 0 ? message.value[0].sdkmessageid : '';
87
82
  }
88
83
  async function createStep(step, apiConfig) {
89
- just_scripts_utils_1.logger.info(`create plugin step ${step.name}`);
90
- let result;
91
- try {
92
- result = await (0, node_1.createWithReturnData)(apiConfig, 'sdkmessageprocessingsteps', step, '$select=sdkmessageprocessingstepid');
93
- }
94
- catch (error) {
95
- throw new Error(error.message);
84
+ logger.info(`create plugin step ${step.name}`);
85
+ const result = await createWithReturnData(apiConfig, 'sdkmessageprocessingsteps', step, '$select=sdkmessageprocessingstepid');
86
+ if (result.error) {
87
+ throw new Error(result.error.message);
96
88
  }
97
89
  return result.sdkmessageprocessingstepid;
98
90
  }
99
91
  async function updateStep(id, step, apiConfig) {
100
- just_scripts_utils_1.logger.info(`update plugin step ${step.name}`);
101
- return (0, node_1.update)(apiConfig, 'sdkmessageprocessingsteps', id, step);
92
+ logger.info(`update plugin step ${step.name}`);
93
+ return update(apiConfig, 'sdkmessageprocessingsteps', id, step);
102
94
  }
@@ -1,10 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deployType = void 0;
4
- const node_1 = require("dataverse-webapi/lib/node");
5
- const pluginStep_1 = require("./pluginStep");
6
- const just_scripts_utils_1 = require("just-scripts-utils");
7
- async function deployType(type, apiConfig, solution) {
1
+ import { retrieveMultiple, createWithReturnData, update } from 'dataverse-webapi/lib/node';
2
+ import { deployStep } from './pluginStep';
3
+ import { logger } from 'just-scripts-utils';
4
+ export async function deployType(type, apiConfig, solution) {
8
5
  let typeId = await retrieveType(type.typename, apiConfig);
9
6
  const record = {
10
7
  name: type.name,
@@ -33,7 +30,7 @@ async function deployType(type, apiConfig, solution) {
33
30
  if (type.steps) {
34
31
  const promises = type.steps.map(async (step) => {
35
32
  step['plugintypeid@odata.bind'] = `/plugintypes(${typeId})`;
36
- await (0, pluginStep_1.deployStep)(step, apiConfig, solution);
33
+ await deployStep(step, apiConfig, solution);
37
34
  });
38
35
  await Promise.all(promises);
39
36
  }
@@ -43,24 +40,20 @@ async function deployType(type, apiConfig, solution) {
43
40
  }
44
41
  return typeId;
45
42
  }
46
- exports.deployType = deployType;
47
43
  async function retrieveType(name, apiConfig) {
48
44
  const options = `$select=plugintypeid&$filter=typename eq '${name}'`;
49
- const result = await (0, node_1.retrieveMultiple)(apiConfig, 'plugintypes', options);
45
+ const result = await retrieveMultiple(apiConfig, 'plugintypes', options);
50
46
  return result.value.length > 0 ? result.value[0].plugintypeid : '';
51
47
  }
52
48
  async function createType(type, apiConfig) {
53
- just_scripts_utils_1.logger.info(`create assembly type ${type.name}`);
54
- let result;
55
- try {
56
- result = await (0, node_1.createWithReturnData)(apiConfig, 'plugintypes', type, '$select=plugintypeid');
57
- }
58
- catch (error) {
59
- throw new Error(error.message);
49
+ logger.info(`create assembly type ${type.name}`);
50
+ const result = await createWithReturnData(apiConfig, 'plugintypes', type, '$select=plugintypeid');
51
+ if (result.error) {
52
+ throw new Error(result.error.message);
60
53
  }
61
54
  return result.plugintypeid;
62
55
  }
63
56
  async function updateType(id, type, apiConfig) {
64
- just_scripts_utils_1.logger.info(`update assembly type ${type.name}`);
65
- return (0, node_1.update)(apiConfig, 'plugintypes', id, type);
57
+ logger.info(`update assembly type ${type.name}`);
58
+ return update(apiConfig, 'plugintypes', id, type);
66
59
  }
@@ -1,13 +1,7 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.deploy = void 0;
7
- const dataverse_service_1 = require("../dataverse.service");
8
- const node_1 = require("dataverse-webapi/lib/node");
9
- const just_scripts_utils_1 = require("just-scripts-utils");
10
- const fs_1 = __importDefault(require("fs"));
1
+ import { addToSolution, ComponentType, publish } from '../dataverse.service';
2
+ import { retrieveMultiple, createWithReturnData, update } from 'dataverse-webapi/lib/node';
3
+ import { logger } from 'just-scripts-utils';
4
+ import fs from 'fs';
11
5
  function getWebResourceType(type) {
12
6
  switch (type) {
13
7
  case 'HTML':
@@ -38,16 +32,16 @@ function getWebResourceType(type) {
38
32
  return 0;
39
33
  }
40
34
  }
41
- async function deploy(webResources, apiConfig, solution, files) {
35
+ export async function deploy(webResources, apiConfig, solution, files) {
42
36
  const publishXml = [];
43
37
  let resources = webResources;
44
38
  // Use list of files if provided
45
39
  if (files) {
46
40
  resources = [];
47
41
  for (const file of files.split(',')) {
48
- const resource = webResources.filter(r => { var _a; return (_a = r.path) === null || _a === void 0 ? void 0 : _a.endsWith(file); });
42
+ const resource = webResources.filter(r => r.path?.endsWith(file));
49
43
  if (resource.length === 0) {
50
- just_scripts_utils_1.logger.error(`web resource ${file} not found in dataverse.config.json`);
44
+ logger.error(`web resource ${file} not found in dataverse.config.json`);
51
45
  continue;
52
46
  }
53
47
  resources.push(resource[0]);
@@ -59,10 +53,10 @@ async function deploy(webResources, apiConfig, solution, files) {
59
53
  resourceId = await retrieveResource(resource.name, apiConfig);
60
54
  }
61
55
  catch (error) {
62
- just_scripts_utils_1.logger.error(`failed to retrieve resource ${resource.name}: ${error.message}`);
56
+ logger.error(`failed to retrieve resource ${resource.name}: ${error.message}`);
63
57
  return;
64
58
  }
65
- const fileContent = fs_1.default.readFileSync(resource.path, 'utf8');
59
+ const fileContent = fs.readFileSync(resource.path, 'utf8');
66
60
  const content = Buffer.from(fileContent).toString('base64');
67
61
  if (resourceId != '') {
68
62
  try {
@@ -70,7 +64,7 @@ async function deploy(webResources, apiConfig, solution, files) {
70
64
  publishXml.push(updated);
71
65
  }
72
66
  catch (error) {
73
- just_scripts_utils_1.logger.error(`failed to update resource: ${error.message}`);
67
+ logger.error(`failed to update resource: ${error.message}`);
74
68
  }
75
69
  }
76
70
  else {
@@ -78,14 +72,14 @@ async function deploy(webResources, apiConfig, solution, files) {
78
72
  resourceId = await createResource(resource, content, apiConfig);
79
73
  }
80
74
  catch (error) {
81
- just_scripts_utils_1.logger.error(`failed to create resource: ${error.message}`);
75
+ logger.error(`failed to create resource: ${error.message}`);
82
76
  }
83
77
  if (solution != undefined) {
84
78
  try {
85
- await (0, dataverse_service_1.addToSolution)(resourceId, solution, dataverse_service_1.ComponentType.WebResource, apiConfig);
79
+ await addToSolution(resourceId, solution, ComponentType.WebResource, apiConfig);
86
80
  }
87
81
  catch (error) {
88
- just_scripts_utils_1.logger.error(`failed to add to solution: ${error.message}`);
82
+ logger.error(`failed to add to solution: ${error.message}`);
89
83
  }
90
84
  }
91
85
  }
@@ -94,41 +88,37 @@ async function deploy(webResources, apiConfig, solution, files) {
94
88
  // publish resources
95
89
  if (publishXml.length > 0) {
96
90
  try {
97
- await (0, dataverse_service_1.publish)(publishXml.join(''), apiConfig);
91
+ await publish(publishXml.join(''), apiConfig);
98
92
  }
99
93
  catch (error) {
100
- just_scripts_utils_1.logger.error(error.message);
94
+ logger.error(error.message);
101
95
  }
102
96
  }
103
97
  }
104
- exports.deploy = deploy;
105
98
  async function retrieveResource(name, apiConfig) {
106
99
  const options = `$select=webresourceid&$filter=name eq '${name}'`;
107
- const result = await (0, node_1.retrieveMultiple)(apiConfig, 'webresourceset', options);
100
+ const result = await retrieveMultiple(apiConfig, 'webresourceset', options);
108
101
  return result.value.length > 0 ? result.value[0].webresourceid : '';
109
102
  }
110
103
  async function createResource(resource, content, apiConfig) {
111
- just_scripts_utils_1.logger.info(`create web resource ${resource.name}`);
104
+ logger.info(`create web resource ${resource.name}`);
112
105
  const webResource = {
113
106
  webresourcetype: getWebResourceType(resource.type),
114
107
  name: resource.name,
115
108
  displayname: resource.displayname || resource.name,
116
109
  content: content
117
110
  };
118
- let result;
119
- try {
120
- result = await (0, node_1.createWithReturnData)(apiConfig, 'webresourceset', webResource, '$select=webresourceid');
121
- }
122
- catch (error) {
123
- throw new Error(error.message);
111
+ const result = await createWithReturnData(apiConfig, 'webresourceset', webResource, '$select=webresourceid');
112
+ if (result.error) {
113
+ throw new Error(result.error.message);
124
114
  }
125
115
  return result.webresourceid;
126
116
  }
127
117
  async function updateResource(id, resource, content, apiConfig) {
128
- just_scripts_utils_1.logger.info(`update web resource ${resource.name}`);
118
+ logger.info(`update web resource ${resource.name}`);
129
119
  const webResource = {
130
120
  content: content
131
121
  };
132
- await (0, node_1.update)(apiConfig, 'webresourceset', id, webResource);
122
+ await update(apiConfig, 'webresourceset', id, webResource);
133
123
  return `<webresource>{${id}}</webresource>`;
134
124
  }
@@ -1,29 +1,22 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.deployWebResource = void 0;
7
- const path_1 = __importDefault(require("path"));
8
- const fs_1 = __importDefault(require("fs"));
9
- const just_scripts_utils_1 = require("just-scripts-utils");
10
- const webResource_1 = require("./models/webResource");
11
- async function deployWebResource(creds, apiConfig, files) {
1
+ import path from 'path';
2
+ import fs from 'fs';
3
+ import { logger } from 'just-scripts-utils';
4
+ import { deploy } from './models/webResource';
5
+ export async function deployWebResource(creds, apiConfig, files) {
12
6
  const currentPath = '.';
13
- const configFile = fs_1.default.readFileSync(path_1.default.resolve(currentPath, 'dataverse.config.json'), 'utf8');
7
+ const configFile = fs.readFileSync(path.resolve(currentPath, 'dataverse.config.json'), 'utf8');
14
8
  if (configFile == null) {
15
- just_scripts_utils_1.logger.warn('unable to find dataverse.config.json file');
9
+ logger.warn('unable to find dataverse.config.json file');
16
10
  return;
17
11
  }
18
12
  const config = JSON.parse(configFile).webResources;
19
- just_scripts_utils_1.logger.info('deploy web resources');
13
+ logger.info('deploy web resources');
20
14
  try {
21
- await (0, webResource_1.deploy)(config, apiConfig, creds.solution, files);
15
+ await deploy(config, apiConfig, creds.solution, files);
22
16
  }
23
17
  catch (error) {
24
- just_scripts_utils_1.logger.error(error.message);
18
+ logger.error(error.message);
25
19
  return;
26
20
  }
27
- just_scripts_utils_1.logger.info('deployed web resources');
21
+ logger.info('deployed web resources');
28
22
  }
29
- exports.deployWebResource = deployWebResource;
package/license ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Derek Finlinson
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "dataverse-utils",
3
- "version": "2.0.6",
3
+ "version": "2.0.10",
4
4
  "license": "MIT",
5
+ "description": "Utilities for interacting with Dataverse environments",
5
6
  "main": "lib/index.js",
6
7
  "bin": {
7
8
  "dataverse-utils": "lib/dataverse-utils.js"
@@ -21,14 +22,16 @@
21
22
  "dependencies": {
22
23
  "@azure/msal-node": "^1.3.1",
23
24
  "commander": "^8.2.0",
25
+ "glob": "^7.2.0",
24
26
  "cryptr": "^6.0.2",
25
- "dataverse-webapi": "^2.0.1",
27
+ "dataverse-webapi": "^2.0.2",
26
28
  "envinfo": "^7.8.1",
27
29
  "just-scripts-utils": "^1.1.4",
28
30
  "prompts": "^2.4.1"
29
31
  },
30
32
  "devDependencies": {
31
33
  "@types/node": "^16.9.1",
34
+ "@types/glob": "^7.2.0",
32
35
  "@types/prompts": "^2.0.14"
33
36
  }
34
37
  }