dataverse-utils 2.6.8 → 2.6.9

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.
@@ -46,7 +46,7 @@ async function createApi(api, apiConfig, solution) {
46
46
  options.customHeaders = { 'MSCRM.SolutionUniqueName': solution };
47
47
  }
48
48
  const result = await (0, node_1.createWithReturnData)(apiConfig, 'customapis', api, '$select=customapiid', options);
49
- if (result.error) {
49
+ if (result?.error) {
50
50
  throw new Error(result.error.message);
51
51
  }
52
52
  return result.customapiid;
@@ -66,7 +66,7 @@ async function updateApi(id, api, apiConfig) {
66
66
  record['PluginTypeId@odata.bind'] = null;
67
67
  }
68
68
  const result = (0, node_1.update)(apiConfig, 'customapis', id, api);
69
- if (result.error) {
69
+ if (result?.error) {
70
70
  throw new Error(result.error.message);
71
71
  }
72
72
  }
@@ -77,7 +77,7 @@ async function createAssembly(config, content, apiConfig, solution) {
77
77
  options.customHeaders = { 'MSCRM.SolutionUniqueName': solution };
78
78
  }
79
79
  const result = await (0, node_1.createWithReturnData)(apiConfig, 'pluginassemblies', assembly, '$select=pluginassemblyid', options);
80
- if (result.error) {
80
+ if (result?.error) {
81
81
  throw new Error(result.error.message);
82
82
  }
83
83
  return result.pluginassemblyid;
@@ -89,7 +89,7 @@ async function updateAssembly(id, config, content, apiConfig) {
89
89
  version: config.version
90
90
  };
91
91
  const result = await (0, node_1.update)(apiConfig, 'pluginassemblies', id, assembly);
92
- if (result.error) {
92
+ if (result?.error) {
93
93
  throw new Error(result.error.message);
94
94
  }
95
95
  }
@@ -50,7 +50,7 @@ async function retrieveImage(stepId, image, apiConfig) {
50
50
  async function createImage(image, stepName, apiConfig) {
51
51
  logger_1.logger.info(`create plugin image ${image.name} for step ${stepName}`);
52
52
  const result = await (0, node_1.createWithReturnData)(apiConfig, 'sdkmessageprocessingstepimages', image, '$select=sdkmessageprocessingstepimageid');
53
- if (result.error) {
53
+ if (result?.error) {
54
54
  throw new Error(result.error.message);
55
55
  }
56
56
  return result.sdkmessageprocessingstepimageid;
@@ -58,7 +58,7 @@ async function createImage(image, stepName, apiConfig) {
58
58
  async function updateImage(id, image, stepName, apiConfig) {
59
59
  logger_1.logger.info(`update plugin image ${image.name} for step ${stepName}`);
60
60
  const result = await (0, node_1.update)(apiConfig, 'sdkmessageprocessingstepimages', id, image);
61
- if (result.error) {
61
+ if (result?.error) {
62
62
  throw new Error(result.error.message);
63
63
  }
64
64
  }
@@ -71,7 +71,7 @@ async function createPackage(config, content, apiConfig, solution) {
71
71
  options.customHeaders = { 'MSCRM.SolutionUniqueName': solution };
72
72
  }
73
73
  const result = await (0, node_1.createWithReturnData)(apiConfig, 'pluginpackages', pluginPackage, '$select=pluginpackageid', options);
74
- if (result.error) {
74
+ if (result?.error) {
75
75
  throw new Error(result.error.message);
76
76
  }
77
77
  return result.pluginpackageid;
@@ -83,7 +83,7 @@ async function updatePackage(id, config, content, apiConfig) {
83
83
  version: config.version
84
84
  };
85
85
  const result = await (0, node_1.update)(apiConfig, 'pluginpackages', id, updated);
86
- if (result.error) {
86
+ if (result?.error) {
87
87
  throw new Error(result.error.message);
88
88
  }
89
89
  }
@@ -81,7 +81,7 @@ async function createStep(step, apiConfig, solution) {
81
81
  options.customHeaders = { 'MSCRM.SolutionUniqueName': solution };
82
82
  }
83
83
  const result = await (0, node_1.createWithReturnData)(apiConfig, 'sdkmessageprocessingsteps', step, '$select=sdkmessageprocessingstepid', options);
84
- if (result.error) {
84
+ if (result?.error) {
85
85
  throw new Error(result.error.message);
86
86
  }
87
87
  return result.sdkmessageprocessingstepid;
@@ -89,7 +89,7 @@ async function createStep(step, apiConfig, solution) {
89
89
  async function updateStep(id, step, apiConfig) {
90
90
  logger_1.logger.info(`update plugin step ${step.name}`);
91
91
  const result = await (0, node_1.update)(apiConfig, 'sdkmessageprocessingsteps', id, step);
92
- if (result.error) {
92
+ if (result?.error) {
93
93
  throw new Error(result.error.message);
94
94
  }
95
95
  }
@@ -53,7 +53,7 @@ exports.retrieveType = retrieveType;
53
53
  async function createType(type, apiConfig) {
54
54
  logger_1.logger.info(`create assembly type ${type.name}`);
55
55
  const result = await (0, node_1.createWithReturnData)(apiConfig, 'plugintypes', type, '$select=plugintypeid');
56
- if (result.error) {
56
+ if (result?.error) {
57
57
  throw new Error(result.error.message);
58
58
  }
59
59
  return result.plugintypeid;
@@ -61,7 +61,7 @@ async function createType(type, apiConfig) {
61
61
  async function updateType(id, type, apiConfig) {
62
62
  logger_1.logger.info(`update assembly type ${type.name}`);
63
63
  const result = await (0, node_1.update)(apiConfig, 'plugintypes', id, type);
64
- if (result.error) {
64
+ if (result?.error) {
65
65
  throw new Error(result.error.message);
66
66
  }
67
67
  }
@@ -112,7 +112,7 @@ async function createResource(resource, content, apiConfig, solution) {
112
112
  options.customHeaders = { 'MSCRM.SolutionUniqueName': solution };
113
113
  }
114
114
  const result = await (0, node_1.createWithReturnData)(apiConfig, 'webresourceset', webResource, '$select=webresourceid', options);
115
- if (result.error) {
115
+ if (result?.error) {
116
116
  throw new Error(result.error.message);
117
117
  }
118
118
  return result.webresourceid;
@@ -123,7 +123,7 @@ async function updateResource(id, resource, content, apiConfig) {
123
123
  content: content
124
124
  };
125
125
  const result = await (0, node_1.update)(apiConfig, 'webresourceset', id, webResource);
126
- if (result.error) {
126
+ if (result?.error) {
127
127
  throw new Error(result.error.message);
128
128
  }
129
129
  return `<webresource>{${id}}</webresource>`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dataverse-utils",
3
- "version": "2.6.8",
3
+ "version": "2.6.9",
4
4
  "license": "MIT",
5
5
  "description": "Utilities for interacting with Dataverse environments",
6
6
  "main": "lib/index.js",
@@ -20,21 +20,21 @@
20
20
  "clean": "rimraf lib"
21
21
  },
22
22
  "dependencies": {
23
- "@azure/msal-node": "^1.14.5",
23
+ "@azure/msal-node": "^1.17.3",
24
24
  "commander": "^8.3.0",
25
- "cryptr": "^6.0.3",
26
- "dataverse-webapi": "^2.4.1",
27
- "envinfo": "^7.8.1",
25
+ "cryptr": "^6.2.0",
26
+ "dataverse-webapi": "^2.4.2",
27
+ "envinfo": "^7.10.0",
28
28
  "figures": "^3.2.0",
29
- "glob": "^7.2.0",
29
+ "glob": "^7.2.3",
30
30
  "kleur": "^4.1.5",
31
31
  "prompts": "^2.4.2"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/cryptr": "^4.0.1",
35
35
  "@types/glob": "^7.2.0",
36
- "@types/node": "^16.9.1",
37
- "@types/prompts": "^2.0.14"
36
+ "@types/node": "^16.18.37",
37
+ "@types/prompts": "^2.4.4"
38
38
  },
39
39
  "volta": {
40
40
  "extends": "../../package.json"