@nmshd/connector-tui 0.2.3 → 0.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/ConnectorTUIBase.js
CHANGED
|
@@ -51,7 +51,7 @@ export class ConnectorTUIBase {
|
|
|
51
51
|
}
|
|
52
52
|
const surname = relationshipAttributes.find((a) => a.content.value["@type"] === "Surname");
|
|
53
53
|
const givenName = relationshipAttributes.find((a) => a.content.value["@type"] === "GivenName");
|
|
54
|
-
if (surname || givenName) {
|
|
54
|
+
if (!!surname || givenName) {
|
|
55
55
|
const name = `${surname?.content.value.value || ""} ${givenName?.content.value.value || ""}`.trim();
|
|
56
56
|
return {
|
|
57
57
|
title: `${relationship.peer} (${name})`,
|
|
@@ -22,10 +22,18 @@ export function AddSendRequestByMessage(Base) {
|
|
|
22
22
|
title: "ReadAttributeRequestItem",
|
|
23
23
|
value: this.createReadAttributeRequestItem.bind(this),
|
|
24
24
|
},
|
|
25
|
+
{
|
|
26
|
+
title: "IQLReadAttributeRequestItem",
|
|
27
|
+
value: this.createIQLReadAttributeRequestItem.bind(this),
|
|
28
|
+
},
|
|
25
29
|
{
|
|
26
30
|
title: "ProposeAttributeRequestItem",
|
|
27
31
|
value: this.createProposeAttributeRequestItem.bind(this),
|
|
28
32
|
},
|
|
33
|
+
{
|
|
34
|
+
title: "IQLProposeAttributeRequestItem",
|
|
35
|
+
value: this.createIQLProposeAttributeRequestItem.bind(this),
|
|
36
|
+
},
|
|
29
37
|
{
|
|
30
38
|
title: "CreateRelationshipAttributeRequestItem",
|
|
31
39
|
value: this.createCreateRelationshipAttributeRequestItem.bind(this),
|
|
@@ -208,6 +216,32 @@ export function AddSendRequestByMessage(Base) {
|
|
|
208
216
|
};
|
|
209
217
|
return requestItem;
|
|
210
218
|
}
|
|
219
|
+
async createIQLReadAttributeRequestItem() {
|
|
220
|
+
const result = await prompts([
|
|
221
|
+
{
|
|
222
|
+
message: "Type in the IQL query string",
|
|
223
|
+
type: "text",
|
|
224
|
+
name: "queryString",
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
message: "Type in the IQL query valueType fallback",
|
|
228
|
+
type: "text",
|
|
229
|
+
name: "valueType",
|
|
230
|
+
},
|
|
231
|
+
]);
|
|
232
|
+
const requestItem = {
|
|
233
|
+
"@type": "ReadAttributeRequestItem",
|
|
234
|
+
mustBeAccepted: true,
|
|
235
|
+
query: {
|
|
236
|
+
"@type": "IQLQuery",
|
|
237
|
+
queryString: result.queryString,
|
|
238
|
+
attributeCreationHints: {
|
|
239
|
+
valueType: result.valueType,
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
|
+
};
|
|
243
|
+
return requestItem;
|
|
244
|
+
}
|
|
211
245
|
async createReadIdentityAttributeRequestItem() {
|
|
212
246
|
const result = await prompts([
|
|
213
247
|
{
|
|
@@ -257,6 +291,42 @@ export function AddSendRequestByMessage(Base) {
|
|
|
257
291
|
};
|
|
258
292
|
return requestItem;
|
|
259
293
|
}
|
|
294
|
+
async createIQLProposeAttributeRequestItem() {
|
|
295
|
+
const result = await prompts([
|
|
296
|
+
{
|
|
297
|
+
message: "Type in the IQL query string",
|
|
298
|
+
type: "text",
|
|
299
|
+
name: "queryString",
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
message: "What's the attribute type you would like to create?",
|
|
303
|
+
type: "text",
|
|
304
|
+
name: "attributeType",
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
message: "What's the value of your Attribute?",
|
|
308
|
+
type: "text",
|
|
309
|
+
name: "value",
|
|
310
|
+
},
|
|
311
|
+
]);
|
|
312
|
+
const requestItem = {
|
|
313
|
+
"@type": "ProposeAttributeRequestItem",
|
|
314
|
+
mustBeAccepted: true,
|
|
315
|
+
query: {
|
|
316
|
+
"@type": "IQLQuery",
|
|
317
|
+
queryString: result.queryString,
|
|
318
|
+
},
|
|
319
|
+
attribute: {
|
|
320
|
+
"@type": "IdentityAttribute",
|
|
321
|
+
owner: "",
|
|
322
|
+
value: {
|
|
323
|
+
"@type": result.attributeType,
|
|
324
|
+
value: result.value,
|
|
325
|
+
},
|
|
326
|
+
},
|
|
327
|
+
};
|
|
328
|
+
return requestItem;
|
|
329
|
+
}
|
|
260
330
|
async createCreateRelationshipAttributeRequestItem() {
|
|
261
331
|
const result = await prompts([
|
|
262
332
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nmshd/connector-tui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"repository": "github:nmshd/connector-tui",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "j&s-soft GmbH",
|
|
@@ -24,26 +24,26 @@
|
|
|
24
24
|
"test": "echo 'no test specified'"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@nmshd/connector-sdk": "^2.2.
|
|
27
|
+
"@nmshd/connector-sdk": "^2.2.3",
|
|
28
28
|
"chalk": "^5.3.0",
|
|
29
29
|
"dotenv": "^16.3.1",
|
|
30
|
-
"luxon": "^3.4.
|
|
30
|
+
"luxon": "^3.4.3",
|
|
31
31
|
"prompts": "^2.4.2",
|
|
32
32
|
"qrcode-terminal": "^0.12.0",
|
|
33
33
|
"yargs": "^17.7.2"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@js-soft/eslint-config-ts": "^1.6.
|
|
36
|
+
"@js-soft/eslint-config-ts": "^1.6.4",
|
|
37
37
|
"@js-soft/license-check": "^1.0.6",
|
|
38
|
-
"@types/luxon": "^3.3.
|
|
39
|
-
"@types/node": "^20.
|
|
40
|
-
"@types/prompts": "^2.4.
|
|
41
|
-
"@types/qrcode-terminal": "^0.12.
|
|
42
|
-
"@types/yargs": "^17.0.
|
|
43
|
-
"eslint": "^8.
|
|
44
|
-
"prettier": "^3.0.
|
|
38
|
+
"@types/luxon": "^3.3.3",
|
|
39
|
+
"@types/node": "^20.8.7",
|
|
40
|
+
"@types/prompts": "^2.4.7",
|
|
41
|
+
"@types/qrcode-terminal": "^0.12.1",
|
|
42
|
+
"@types/yargs": "^17.0.29",
|
|
43
|
+
"eslint": "^8.51.0",
|
|
44
|
+
"prettier": "^3.0.3",
|
|
45
45
|
"ts-node": "^10.9.1",
|
|
46
|
-
"typescript": "^5.
|
|
46
|
+
"typescript": "^5.2.2"
|
|
47
47
|
},
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|