@nmshd/connector-tui 2.3.0 → 2.4.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.
|
@@ -176,13 +176,13 @@ export function AddSendRequestByMessage(Base) {
|
|
|
176
176
|
name: "thirdParties",
|
|
177
177
|
},
|
|
178
178
|
]);
|
|
179
|
-
const title = result.attributeTitle
|
|
179
|
+
const title = result.attributeTitle ?? `A ${result.attributeType} attribute`;
|
|
180
180
|
const requestItem = {
|
|
181
181
|
"@type": "ReadAttributeRequestItem",
|
|
182
182
|
mustBeAccepted: true,
|
|
183
183
|
query: {
|
|
184
184
|
"@type": "RelationshipAttributeQuery",
|
|
185
|
-
owner: result.owner
|
|
185
|
+
owner: result.owner ?? "",
|
|
186
186
|
attributeCreationHints: {
|
|
187
187
|
title: title,
|
|
188
188
|
description: result.attributeDescription,
|
|
@@ -227,7 +227,7 @@ export function AddSendRequestByMessage(Base) {
|
|
|
227
227
|
mustBeAccepted: true,
|
|
228
228
|
query: {
|
|
229
229
|
"@type": "ThirdPartyRelationshipAttributeQuery",
|
|
230
|
-
owner: result.owner
|
|
230
|
+
owner: result.owner ?? "",
|
|
231
231
|
key: result.key,
|
|
232
232
|
thirdParty: thirdParties,
|
|
233
233
|
},
|
|
@@ -515,7 +515,7 @@ export function AddSendRequestByMessage(Base) {
|
|
|
515
515
|
},
|
|
516
516
|
]);
|
|
517
517
|
const responseMetadata = result.consentKey ? { consentKey: result.consentKey } : undefined;
|
|
518
|
-
const link = result.link
|
|
518
|
+
const link = result.link ?? undefined;
|
|
519
519
|
const requestItem = {
|
|
520
520
|
"@type": "ConsentRequestItem",
|
|
521
521
|
mustBeAccepted: true,
|
|
@@ -31,7 +31,7 @@ export function AddShareRequestByTemplate(Base) {
|
|
|
31
31
|
mustBeAccepted: true,
|
|
32
32
|
query: {
|
|
33
33
|
"@type": "IdentityAttributeQuery",
|
|
34
|
-
valueType: "
|
|
34
|
+
valueType: "GivenName",
|
|
35
35
|
},
|
|
36
36
|
},
|
|
37
37
|
{
|
|
@@ -39,7 +39,7 @@ export function AddShareRequestByTemplate(Base) {
|
|
|
39
39
|
mustBeAccepted: true,
|
|
40
40
|
query: {
|
|
41
41
|
"@type": "IdentityAttributeQuery",
|
|
42
|
-
valueType: "
|
|
42
|
+
valueType: "Surname",
|
|
43
43
|
},
|
|
44
44
|
},
|
|
45
45
|
{
|
|
@@ -52,7 +52,7 @@ export function AddShareRequestByTemplate(Base) {
|
|
|
52
52
|
},
|
|
53
53
|
],
|
|
54
54
|
};
|
|
55
|
-
const
|
|
55
|
+
const onNewRelationship = { "@type": "Request", items: [] };
|
|
56
56
|
const result = await prompts({
|
|
57
57
|
message: "Do you want to send your connector's name?",
|
|
58
58
|
type: "confirm",
|
|
@@ -60,10 +60,32 @@ export function AddShareRequestByTemplate(Base) {
|
|
|
60
60
|
initial: true,
|
|
61
61
|
});
|
|
62
62
|
if (result.includeName)
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
onNewRelationship.items.push(sharedAttributes);
|
|
64
|
+
onNewRelationship.items.push(requestedAttributes);
|
|
65
|
+
const onExistingRelationship = {
|
|
66
|
+
"@type": "Request",
|
|
67
|
+
title: "Existing Relationship",
|
|
68
|
+
description: "Please accept the following request, because you already have a relationship with the requestor.",
|
|
69
|
+
items: [
|
|
70
|
+
{
|
|
71
|
+
"@type": "RequestItemGroup",
|
|
72
|
+
title: "A Title",
|
|
73
|
+
description: "A Description that is long enough to show what a long description looks like in the app when rendered inside the expandable area",
|
|
74
|
+
items: [
|
|
75
|
+
{
|
|
76
|
+
"@type": "ReadAttributeRequestItem",
|
|
77
|
+
mustBeAccepted: true,
|
|
78
|
+
query: {
|
|
79
|
+
"@type": "IdentityAttributeQuery",
|
|
80
|
+
valueType: "GivenName",
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
};
|
|
65
87
|
const passwordProtection = await this.createPasswordProtection();
|
|
66
|
-
await this.createQRCodeForRelationshipTemplate(
|
|
88
|
+
await this.createQRCodeForRelationshipTemplate(onNewRelationship, onExistingRelationship, name, passwordProtection);
|
|
67
89
|
}
|
|
68
90
|
async getOrCreateConnectorDisplayName(displayName) {
|
|
69
91
|
const response = await this.connectorClient.attributes.getValidAttributes({
|
|
@@ -132,14 +154,15 @@ export function AddShareRequestByTemplate(Base) {
|
|
|
132
154
|
});
|
|
133
155
|
return { password: password.password, passwordIsPin: true };
|
|
134
156
|
}
|
|
135
|
-
async createQRCodeForRelationshipTemplate(
|
|
157
|
+
async createQRCodeForRelationshipTemplate(onNewRelationship, onExistingRelationship, name, passwordProtection) {
|
|
136
158
|
const content = {
|
|
137
159
|
"@type": "RelationshipTemplateContent",
|
|
138
160
|
title: `Kontaktanfrage mit ${name}`,
|
|
139
161
|
metadata: {
|
|
140
162
|
webSessionId: "12345",
|
|
141
163
|
},
|
|
142
|
-
onNewRelationship
|
|
164
|
+
onNewRelationship,
|
|
165
|
+
onExistingRelationship,
|
|
143
166
|
};
|
|
144
167
|
const template = await this.connectorClient.relationshipTemplates.createOwnRelationshipTemplate({
|
|
145
168
|
content,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nmshd/connector-tui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"repository": "github:nmshd/connector-tui",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "j&s-soft AG",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"watch": "node --watch --import 'data:text/javascript,import { register } from \"node:module\"; import { pathToFileURL } from \"node:url\"; register(\"ts-node/esm\", pathToFileURL(\"./\"));' src/run.ts"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@nmshd/connector-sdk": "^6.
|
|
33
|
-
"axios": "^1.
|
|
32
|
+
"@nmshd/connector-sdk": "^6.16.3",
|
|
33
|
+
"axios": "^1.8.3",
|
|
34
34
|
"chalk": "^5.4.1",
|
|
35
35
|
"dotenv": "^16.4.7",
|
|
36
36
|
"luxon": "^3.5.0",
|
|
@@ -39,17 +39,17 @@
|
|
|
39
39
|
"yargs": "^17.7.2"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@js-soft/eslint-config-ts": "^1.6.
|
|
42
|
+
"@js-soft/eslint-config-ts": "^1.6.14",
|
|
43
43
|
"@js-soft/license-check": "^1.0.9",
|
|
44
44
|
"@types/luxon": "^3.4.2",
|
|
45
|
-
"@types/node": "^22.13.
|
|
45
|
+
"@types/node": "^22.13.10",
|
|
46
46
|
"@types/prompts": "^2.4.9",
|
|
47
47
|
"@types/qrcode-terminal": "^0.12.2",
|
|
48
48
|
"@types/yargs": "^17.0.33",
|
|
49
49
|
"eslint": "^8.57.0",
|
|
50
|
-
"prettier": "^3.5.
|
|
50
|
+
"prettier": "^3.5.3",
|
|
51
51
|
"ts-node": "^10.9.2",
|
|
52
|
-
"typescript": "^5.
|
|
52
|
+
"typescript": "^5.8.2"
|
|
53
53
|
},
|
|
54
54
|
"engines": {
|
|
55
55
|
"node": ">=19.0.0"
|