dataverse-utils 2.4.1 → 2.5.0

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.
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getTableMetadata = exports.publish = exports.addToSolution = exports.ComponentType = void 0;
4
4
  const node_1 = require("dataverse-webapi/lib/node");
5
+ const logger_1 = require("./logger");
5
6
  var ComponentType;
6
7
  (function (ComponentType) {
7
8
  ComponentType[ComponentType["WebResource"] = 61] = "WebResource";
@@ -19,6 +20,7 @@ async function addToSolution(id, solution, type, apiConfig) {
19
20
  AddRequiredComponents: false,
20
21
  IncludedComponentSettingsValues: null
21
22
  };
23
+ logger_1.logger.info(`add component ${id} to solution ${solution}`);
22
24
  await (0, node_1.unboundAction)(apiConfig, 'AddSolutionComponent', data);
23
25
  }
24
26
  exports.addToSolution = addToSolution;
package/lib/deploy.js CHANGED
@@ -12,15 +12,16 @@ const webResourceDeploy_1 = require("./webResourceDeploy");
12
12
  const node_1 = require("dataverse-webapi/lib/node");
13
13
  const auth_1 = require("./auth");
14
14
  async function deploy(type, files) {
15
- if (!type || (type !== 'webresource' && type !== 'assembly')) {
16
- const invalid = type !== undefined && type !== 'webresource' && type !== 'assembly';
17
- const invalidMessage = invalid ? `${type} is not a valid project type.` : '';
15
+ if (!type || (type !== 'webresource' && type !== 'assembly' && type !== 'pcf')) {
16
+ const invalid = type !== undefined && type !== 'webresource' && type !== 'assembly' && type !== 'pcf';
17
+ const invalidMessage = invalid ? `${type} is not a valid project type. ` : '';
18
18
  const { typePrompt } = await (0, prompts_1.default)({
19
19
  type: 'select',
20
20
  name: 'typePrompt',
21
- message: `${invalidMessage} select project type to deploy`,
21
+ message: `${invalidMessage}select project type to deploy`,
22
22
  choices: [
23
23
  { title: 'web resource', value: 'webresource' },
24
+ { title: 'pcf', value: 'webresource' },
24
25
  { title: 'plugin or workflow activity', value: 'assembly' }
25
26
  ]
26
27
  });
@@ -53,6 +54,9 @@ async function deploy(type, files) {
53
54
  case 'assembly':
54
55
  await (0, assemblyDeploy_1.assemblyDeploy)(creds, apiConfig);
55
56
  break;
57
+ case 'pcf':
58
+ logger_1.logger.error('PCF deploy coming soon');
59
+ break;
56
60
  default:
57
61
  break;
58
62
  }
package/lib/index.js CHANGED
@@ -15,7 +15,7 @@ commander_1.program
15
15
  // Deploy command
16
16
  commander_1.program
17
17
  .command('deploy')
18
- .description('Deploy file(s) to dataverse (webresource, plugin, workflow)')
18
+ .description('Deploy file(s) to dataverse (webresource, assembly, pcf)')
19
19
  .argument('[type]', 'Type of project to deploy')
20
20
  .argument('[files]', 'Comma separate list of files to deploy')
21
21
  .action((type, files) => {
@@ -67,7 +67,7 @@ async function retrievePackage(prefix, name, apiConfig) {
67
67
  return result.value.length > 0 ? result.value[0].pluginassemblyid : '';
68
68
  }
69
69
  async function createPackage(config, content, apiConfig) {
70
- logger_1.logger.info(`create assembly ${config.name}`);
70
+ logger_1.logger.info(`create package ${config.name}`);
71
71
  const pluginPackage = {
72
72
  name: `${config.prefix}_${config.name}`,
73
73
  version: config.version,
@@ -80,7 +80,7 @@ async function createPackage(config, content, apiConfig) {
80
80
  return result.pluginpackageid;
81
81
  }
82
82
  async function updatePackage(id, config, content, apiConfig) {
83
- logger_1.logger.info(`update assembly ${config.name}`);
83
+ logger_1.logger.info(`update package ${config.name}`);
84
84
  const assembly = {
85
85
  content: content,
86
86
  version: config.version
package/license CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2021 Derek Finlinson
3
+ Copyright (c) 2022 Derek Finlinson
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dataverse-utils",
3
- "version": "2.4.1",
3
+ "version": "2.5.0",
4
4
  "license": "MIT",
5
5
  "description": "Utilities for interacting with Dataverse environments",
6
6
  "main": "lib/index.js",
@@ -23,7 +23,7 @@
23
23
  "@azure/msal-node": "^1.12.0",
24
24
  "commander": "^8.3.0",
25
25
  "cryptr": "^6.0.3",
26
- "dataverse-webapi": "^2.1.0",
26
+ "dataverse-webapi": "^2.2.0",
27
27
  "envinfo": "^7.8.1",
28
28
  "figures": "^3.2.0",
29
29
  "glob": "^7.2.0",