dataverse-utils 2.1.4 → 2.2.3
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.
- package/CHANGELOG.json +67 -1
- package/CHANGELOG.md +37 -4
- package/lib/assemblyDeploy.js +1 -1
- package/lib/generate.js +1 -1
- package/lib/logger.js +22 -8
- package/lib/models/pluginAssembly.js +1 -1
- package/lib/models/pluginStep.js +2 -2
- package/lib/models/webResource.js +1 -1
- package/lib/webResourceDeploy.js +1 -1
- package/package.json +6 -5
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,73 @@
|
|
|
2
2
|
"name": "dataverse-utils",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Wed, 09 Feb 2022 16:18:47 GMT",
|
|
6
|
+
"tag": "dataverse-utils_v2.2.3",
|
|
7
|
+
"version": "2.2.3",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "derek.finlinson@journeyteam.com",
|
|
12
|
+
"package": "dataverse-utils",
|
|
13
|
+
"commit": "cdab4698564ece9f40c5a45327a38270a6d1c16d",
|
|
14
|
+
"comment": "Catch errors on commands"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Tue, 08 Feb 2022 18:47:13 GMT",
|
|
21
|
+
"tag": "dataverse-utils_v2.2.2",
|
|
22
|
+
"version": "2.2.2",
|
|
23
|
+
"comments": {
|
|
24
|
+
"patch": [
|
|
25
|
+
{
|
|
26
|
+
"author": "derek.finlinson@journeyteam.com",
|
|
27
|
+
"package": "dataverse-utils",
|
|
28
|
+
"commit": "70380beb0078b8c1ab669bf5f3e4eacbbcd99ba7",
|
|
29
|
+
"comment": "Update symbols"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"date": "Tue, 08 Feb 2022 18:13:52 GMT",
|
|
36
|
+
"tag": "dataverse-utils_v2.2.1",
|
|
37
|
+
"version": "2.2.1",
|
|
38
|
+
"comments": {
|
|
39
|
+
"patch": [
|
|
40
|
+
{
|
|
41
|
+
"author": "derek.finlinson@journeyteam.com",
|
|
42
|
+
"package": "dataverse-utils",
|
|
43
|
+
"commit": "cfa9121f50ea731b9ef639154153b01dc81fff85",
|
|
44
|
+
"comment": "Fix logger and file paths"
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"date": "Mon, 07 Feb 2022 22:02:33 GMT",
|
|
51
|
+
"tag": "dataverse-utils_v2.2.0",
|
|
52
|
+
"version": "2.2.0",
|
|
53
|
+
"comments": {
|
|
54
|
+
"minor": [
|
|
55
|
+
{
|
|
56
|
+
"author": "derek.finlinson@journeyteam.com",
|
|
57
|
+
"package": "dataverse-utils",
|
|
58
|
+
"commit": "55d633b2c3064bbdce48c5d314d8e7572a015882",
|
|
59
|
+
"comment": "Switch to combined logger"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"author": "beachball",
|
|
63
|
+
"package": "dataverse-utils",
|
|
64
|
+
"comment": "Bump dataverse-webapi to v2.0.4",
|
|
65
|
+
"commit": "83b50fd1a35a0645f279e60b8ca0eb2ace5c0ad3"
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"date": "Fri, 28 Jan 2022 23:11:16 GMT",
|
|
6
72
|
"tag": "dataverse-utils_v2.1.4",
|
|
7
73
|
"version": "2.1.4",
|
|
8
74
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,17 +1,50 @@
|
|
|
1
1
|
# Change Log - dataverse-utils
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Wed, 09 Feb 2022 16:18:47 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## 2.
|
|
7
|
+
## 2.2.3
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Wed, 09 Feb 2022 16:18:47 GMT
|
|
10
10
|
|
|
11
11
|
### Patches
|
|
12
12
|
|
|
13
|
-
-
|
|
13
|
+
- Catch errors on commands (derek.finlinson@journeyteam.com)
|
|
14
14
|
|
|
15
|
+
## 2.2.2
|
|
16
|
+
|
|
17
|
+
Tue, 08 Feb 2022 18:47:13 GMT
|
|
18
|
+
|
|
19
|
+
### Patches
|
|
20
|
+
|
|
21
|
+
- Update symbols (derek.finlinson@journeyteam.com)
|
|
22
|
+
|
|
23
|
+
## 2.2.1
|
|
24
|
+
|
|
25
|
+
Tue, 08 Feb 2022 18:13:52 GMT
|
|
26
|
+
|
|
27
|
+
### Patches
|
|
28
|
+
|
|
29
|
+
- Fix logger and file paths (derek.finlinson@journeyteam.com)
|
|
30
|
+
|
|
31
|
+
## 2.2.0
|
|
32
|
+
|
|
33
|
+
Mon, 07 Feb 2022 22:02:33 GMT
|
|
34
|
+
|
|
35
|
+
### Minor changes
|
|
36
|
+
|
|
37
|
+
- Switch to combined logger (derek.finlinson@journeyteam.com)
|
|
38
|
+
- Bump dataverse-webapi to v2.0.4
|
|
39
|
+
|
|
40
|
+
## 2.1.4
|
|
41
|
+
|
|
42
|
+
Fri, 28 Jan 2022 23:11:16 GMT
|
|
43
|
+
|
|
44
|
+
### Patches
|
|
45
|
+
|
|
46
|
+
- Prompt to delete cache on error (derek.finlinson@journeyteam.com)
|
|
47
|
+
|
|
15
48
|
## 2.1.3
|
|
16
49
|
|
|
17
50
|
Sun, 16 Jan 2022 23:22:22 GMT
|
package/lib/assemblyDeploy.js
CHANGED
|
@@ -24,6 +24,6 @@ async function deployAssembly(creds, apiConfig) {
|
|
|
24
24
|
logger_1.logger.error(error.message);
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
|
-
logger_1.logger.
|
|
27
|
+
logger_1.logger.done(`deployed assembly ${config.name}\r\n`);
|
|
28
28
|
}
|
|
29
29
|
exports.deployAssembly = deployAssembly;
|
package/lib/generate.js
CHANGED
|
@@ -94,6 +94,6 @@ async function generate(table) {
|
|
|
94
94
|
fs_1.default.mkdirSync(path_1.default.resolve(currentPath, 'src', 'scripts', 'models'));
|
|
95
95
|
}
|
|
96
96
|
fs_1.default.writeFileSync(path_1.default.resolve(currentPath, 'src', 'scripts', 'models', `${metadata.schemaName}.ts`), codeFile);
|
|
97
|
-
logger_1.logger.
|
|
97
|
+
logger_1.logger.done(`Table metadata output to models/${metadata.schemaName}.ts`);
|
|
98
98
|
}
|
|
99
99
|
exports.default = generate;
|
package/lib/logger.js
CHANGED
|
@@ -3,20 +3,34 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.logger = void 0;
|
|
6
|
+
exports.logger = exports.icons = void 0;
|
|
7
7
|
const kleur_1 = __importDefault(require("kleur"));
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const isTest = process.env.JEST_WORKER_ID !== undefined;
|
|
9
|
+
exports.icons = {
|
|
10
|
+
done: kleur_1.default.green('◉'),
|
|
11
|
+
info: kleur_1.default.cyan('◎'),
|
|
12
|
+
error: kleur_1.default.red('⨂'),
|
|
13
|
+
warn: kleur_1.default.yellow('⨁')
|
|
11
14
|
};
|
|
12
15
|
exports.logger = {
|
|
13
16
|
info(...args) {
|
|
14
|
-
|
|
17
|
+
if (!isTest) {
|
|
18
|
+
console.info(exports.icons.info, ...args);
|
|
19
|
+
}
|
|
15
20
|
},
|
|
16
21
|
warn(...args) {
|
|
17
|
-
|
|
22
|
+
if (!isTest) {
|
|
23
|
+
console.warn(exports.icons.warn, ...args);
|
|
24
|
+
}
|
|
18
25
|
},
|
|
19
26
|
error(...args) {
|
|
20
|
-
|
|
21
|
-
|
|
27
|
+
if (!isTest) {
|
|
28
|
+
console.error(exports.icons.error, ...args);
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
done(...args) {
|
|
32
|
+
if (!isTest) {
|
|
33
|
+
console.info(exports.icons.done, ...args);
|
|
34
|
+
}
|
|
35
|
+
},
|
|
22
36
|
};
|
|
@@ -13,7 +13,7 @@ const logger_1 = require("../logger");
|
|
|
13
13
|
async function deploy(config, apiConfig, solution) {
|
|
14
14
|
const files = glob_1.default.sync(`**/${config.name}.dll`);
|
|
15
15
|
if (files.length === 0) {
|
|
16
|
-
logger_1.logger.
|
|
16
|
+
logger_1.logger.warn(`assembly ${config.name}.dll not found`);
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
19
|
const content = fs_1.default.readFileSync(files[0]).toString('base64');
|
package/lib/models/pluginStep.js
CHANGED
|
@@ -9,12 +9,12 @@ async function deployStep(step, typeId, apiConfig, solution) {
|
|
|
9
9
|
let stepId = await retrieveStep(step.name, typeId, apiConfig);
|
|
10
10
|
const messageId = await getSdkMessageId(step.message ?? '', apiConfig);
|
|
11
11
|
if (messageId == '') {
|
|
12
|
-
logger_1.logger.
|
|
12
|
+
logger_1.logger.warn(`sdk message ${step.message} not found`);
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
15
|
const filterId = await getSdkMessageFilterId(messageId, step.entity ?? '', apiConfig);
|
|
16
16
|
if (filterId == '') {
|
|
17
|
-
logger_1.logger.
|
|
17
|
+
logger_1.logger.warn(`sdk message ${step.message} for entity ${step.entity} not found`);
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
20
|
step['sdkmessagefilterid@odata.bind'] = `/sdkmessagefilters(${filterId})`;
|
|
@@ -47,7 +47,7 @@ async function deploy(webResources, apiConfig, solution, files) {
|
|
|
47
47
|
for (const file of files.split(',')) {
|
|
48
48
|
const resource = webResources.filter(r => r.path?.endsWith(file));
|
|
49
49
|
if (resource.length === 0) {
|
|
50
|
-
logger_1.logger.
|
|
50
|
+
logger_1.logger.warn(`web resource ${file} not found in dataverse.config.json`);
|
|
51
51
|
continue;
|
|
52
52
|
}
|
|
53
53
|
resources.push(resource[0]);
|
package/lib/webResourceDeploy.js
CHANGED
|
@@ -24,6 +24,6 @@ async function deployWebResource(creds, apiConfig, files) {
|
|
|
24
24
|
logger_1.logger.error(error.message);
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
|
-
logger_1.logger.
|
|
27
|
+
logger_1.logger.done('deployed web resources');
|
|
28
28
|
}
|
|
29
29
|
exports.deployWebResource = deployWebResource;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dataverse-utils",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Utilities for interacting with Dataverse environments",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -17,21 +17,22 @@
|
|
|
17
17
|
"scripts": {
|
|
18
18
|
"build": "tsc -p .",
|
|
19
19
|
"lint": "eslint",
|
|
20
|
-
"
|
|
20
|
+
"clean": "rimraf lib"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@azure/msal-node": "^1.3.1",
|
|
24
24
|
"commander": "^8.3.0",
|
|
25
|
-
"glob": "^7.2.0",
|
|
26
25
|
"cryptr": "^6.0.2",
|
|
27
|
-
"dataverse-webapi": "^2.0.
|
|
26
|
+
"dataverse-webapi": "^2.0.4",
|
|
28
27
|
"envinfo": "^7.8.1",
|
|
28
|
+
"glob": "^7.2.0",
|
|
29
29
|
"kleur": "^4.1.4",
|
|
30
30
|
"prompts": "^2.4.2"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@types/
|
|
33
|
+
"@types/cryptr": "^4.0.1",
|
|
34
34
|
"@types/glob": "^7.2.0",
|
|
35
|
+
"@types/node": "^16.9.1",
|
|
35
36
|
"@types/prompts": "^2.0.14"
|
|
36
37
|
}
|
|
37
38
|
}
|