@nmshd/connector-tui 1.2.2 → 1.2.4
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/dist/ConnectorTUI.js
CHANGED
|
@@ -37,7 +37,7 @@ export class ConnectorTUI extends ConnectorTUIBaseWithMixins {
|
|
|
37
37
|
// allow connector in debugging mode to be used
|
|
38
38
|
if (connectorVersionInfo.version === "{{version}}")
|
|
39
39
|
return connectorVersionInfo;
|
|
40
|
-
if (!connectorVersionInfo.version.startsWith("3.")) {
|
|
40
|
+
if (!(connectorVersionInfo.version.startsWith("3.") || connectorVersionInfo.version.startsWith("4."))) {
|
|
41
41
|
console.log(`This TUI is made for Enmeshed V2 connectors (starting with version 3.0.0 of the connector). Current version: ${connectorVersionInfo.version}`);
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ConnectorRequestStatus } from "@nmshd/connector-sdk";
|
|
2
|
+
import { DateTime } from "luxon";
|
|
2
3
|
import prompts from "prompts";
|
|
3
4
|
export function AddAcceptPendingRequests(Base) {
|
|
4
5
|
return class Sync extends Base {
|
|
@@ -29,6 +30,9 @@ export function AddAcceptPendingRequests(Base) {
|
|
|
29
30
|
if (_itemOfGroup["@type"] === "FreeTextRequestItem") {
|
|
30
31
|
acceptItems.push({ accept: true, freeText: "freeText" });
|
|
31
32
|
}
|
|
33
|
+
else if (_itemOfGroup["@type"] === "DeleteAttributeRequestItem") {
|
|
34
|
+
acceptItems.push({ accept: true, deletionDate: DateTime.utc().plus({ seconds: 5 }).toISO() });
|
|
35
|
+
}
|
|
32
36
|
else {
|
|
33
37
|
acceptItems.push({ accept: true });
|
|
34
38
|
}
|
|
@@ -38,6 +42,9 @@ export function AddAcceptPendingRequests(Base) {
|
|
|
38
42
|
else if (item["@type"] === "FreeTextRequestItem") {
|
|
39
43
|
items.push({ accept: true, freeText: "freeText" });
|
|
40
44
|
}
|
|
45
|
+
else if (item["@type"] === "DeleteAttributeRequestItem") {
|
|
46
|
+
items.push({ accept: true, deletionDate: DateTime.utc().plus({ seconds: 5 }).toISO() });
|
|
47
|
+
}
|
|
41
48
|
else {
|
|
42
49
|
items.push({ accept: true });
|
|
43
50
|
}
|
|
@@ -47,6 +54,11 @@ export function AddAcceptPendingRequests(Base) {
|
|
|
47
54
|
console.log(canAcceptResult.error);
|
|
48
55
|
return;
|
|
49
56
|
}
|
|
57
|
+
if (!canAcceptResult.result.isSuccess) {
|
|
58
|
+
console.log("Cannot accept request");
|
|
59
|
+
console.log(canAcceptResult.result);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
50
62
|
const acceptResult = await this.connectorClient.incomingRequests.accept(request.id, { items: items });
|
|
51
63
|
if (acceptResult.isError) {
|
|
52
64
|
console.log(acceptResult.error);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nmshd/connector-tui",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.4",
|
|
4
4
|
"repository": "github:nmshd/connector-tui",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "j&s-soft GmbH",
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
],
|
|
20
20
|
"scripts": {
|
|
21
21
|
"build": "tsc",
|
|
22
|
-
"lint": "npm run lint:prettier && npm run lint:eslint",
|
|
22
|
+
"lint": "npm run lint:tsc && npm run lint:prettier && npm run lint:eslint",
|
|
23
|
+
"lint:tsc": "tsc --noEmit",
|
|
23
24
|
"lint:eslint": "eslint --ext .ts ./src",
|
|
24
25
|
"lint:prettier": "prettier --check ./src",
|
|
25
26
|
"start": "node --loader ts-node/esm src/index.ts",
|
|
@@ -27,7 +28,7 @@
|
|
|
27
28
|
"watch": "node --watch --loader ts-node/esm src/index.ts"
|
|
28
29
|
},
|
|
29
30
|
"dependencies": {
|
|
30
|
-
"@nmshd/connector-sdk": "^4.1
|
|
31
|
+
"@nmshd/connector-sdk": "^4.6.1",
|
|
31
32
|
"chalk": "^5.3.0",
|
|
32
33
|
"dotenv": "^16.4.5",
|
|
33
34
|
"luxon": "^3.4.4",
|
|
@@ -36,17 +37,17 @@
|
|
|
36
37
|
"yargs": "^17.7.2"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
39
|
-
"@js-soft/eslint-config-ts": "^1.6.
|
|
40
|
+
"@js-soft/eslint-config-ts": "^1.6.9",
|
|
40
41
|
"@js-soft/license-check": "^1.0.9",
|
|
41
42
|
"@types/luxon": "^3.4.2",
|
|
42
|
-
"@types/node": "^20.11
|
|
43
|
+
"@types/node": "^20.14.11",
|
|
43
44
|
"@types/prompts": "^2.4.9",
|
|
44
45
|
"@types/qrcode-terminal": "^0.12.2",
|
|
45
46
|
"@types/yargs": "^17.0.32",
|
|
46
47
|
"eslint": "^8.57.0",
|
|
47
|
-
"prettier": "^3.
|
|
48
|
+
"prettier": "^3.3.3",
|
|
48
49
|
"ts-node": "^10.9.2",
|
|
49
|
-
"typescript": "^5.
|
|
50
|
+
"typescript": "^5.5.3"
|
|
50
51
|
},
|
|
51
52
|
"engines": {
|
|
52
53
|
"node": ">=19.0.0"
|