@nmshd/connector-tui 0.1.4 → 0.2.1

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.
@@ -25,12 +25,19 @@ export function AddAcceptPendingRequests(Base) {
25
25
  for (const item of request.content.items) {
26
26
  if (item["@type"] === "RequestItemGroup") {
27
27
  const acceptItems = [];
28
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
29
28
  for (const _itemOfGroup of item.items) {
30
- acceptItems.push({ accept: true });
29
+ if (_itemOfGroup["@type"] === "FreeTextRequestItem") {
30
+ acceptItems.push({ accept: true, freeText: "freeText" });
31
+ }
32
+ else {
33
+ acceptItems.push({ accept: true });
34
+ }
31
35
  }
32
36
  items.push({ items: acceptItems });
33
37
  }
38
+ else if (item["@type"] === "FreeTextRequestItem") {
39
+ items.push({ accept: true, freeText: "freeText" });
40
+ }
34
41
  else {
35
42
  items.push({ accept: true });
36
43
  }
@@ -30,6 +30,10 @@ export function AddSendRequestByMessage(Base) {
30
30
  title: "CreateRelationshipAttributeRequestItem",
31
31
  value: this.createCreateRelationshipAttributeRequestItem.bind(this),
32
32
  },
33
+ {
34
+ title: "CreateRelationshipAttributeRequestItem with Boolean value",
35
+ value: this.createCreateRelationshipAttributeRequestItemWithBooleanValue.bind(this),
36
+ },
33
37
  {
34
38
  title: "CreateIdentityAttributeRequestItem",
35
39
  value: this.createCreateIdentityAttributeRequestItem.bind(this),
@@ -290,6 +294,44 @@ export function AddSendRequestByMessage(Base) {
290
294
  };
291
295
  return requestItem;
292
296
  }
297
+ async createCreateRelationshipAttributeRequestItemWithBooleanValue() {
298
+ const result = await prompts([
299
+ {
300
+ message: "What's the title of the RelationshipAttribute you would like to create?",
301
+ type: "text",
302
+ name: "title",
303
+ initial: "Title of RelationshipAttribute",
304
+ },
305
+ {
306
+ message: "What's the key of the RelationshipAttribute you would like to create?",
307
+ type: "text",
308
+ name: "key",
309
+ initial: "Key of RelationshipAttribute",
310
+ },
311
+ {
312
+ message: "What's the value of your Boolean Attribute?",
313
+ type: "toggle",
314
+ name: "value",
315
+ },
316
+ ]);
317
+ const requestItem = {
318
+ "@type": "CreateAttributeRequestItem",
319
+ mustBeAccepted: true,
320
+ attribute: {
321
+ "@type": "RelationshipAttribute",
322
+ owner: "",
323
+ key: result.key,
324
+ confidentiality: "public",
325
+ isTechnical: true,
326
+ value: {
327
+ "@type": "ProprietaryBoolean",
328
+ value: result.value,
329
+ title: result.title,
330
+ },
331
+ },
332
+ };
333
+ return requestItem;
334
+ }
293
335
  async createCreateIdentityAttributeRequestItem(peer) {
294
336
  const result = await prompts([
295
337
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nmshd/connector-tui",
3
- "version": "0.1.4",
3
+ "version": "0.2.1",
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.1.5",
28
- "chalk": "^5.2.0",
29
- "dotenv": "^16.0.3",
30
- "luxon": "^3.2.1",
27
+ "@nmshd/connector-sdk": "^2.2.2",
28
+ "chalk": "^5.3.0",
29
+ "dotenv": "^16.3.1",
30
+ "luxon": "^3.4.0",
31
31
  "prompts": "^2.4.2",
32
32
  "qrcode-terminal": "^0.12.0",
33
- "yargs": "^17.7.1"
33
+ "yargs": "^17.7.2"
34
34
  },
35
35
  "devDependencies": {
36
- "@js-soft/eslint-config-ts": "^1.6.2",
36
+ "@js-soft/eslint-config-ts": "^1.6.3",
37
37
  "@js-soft/license-check": "^1.0.6",
38
- "@types/luxon": "^3.2.0",
39
- "@types/node": "^18.14.1",
40
- "@types/prompts": "^2.4.2",
38
+ "@types/luxon": "^3.3.1",
39
+ "@types/node": "^20.5.0",
40
+ "@types/prompts": "^2.4.4",
41
41
  "@types/qrcode-terminal": "^0.12.0",
42
- "@types/yargs": "^17.0.22",
43
- "eslint": "^8.34.0",
44
- "prettier": "^2.8.4",
42
+ "@types/yargs": "^17.0.24",
43
+ "eslint": "^8.47.0",
44
+ "prettier": "^3.0.2",
45
45
  "ts-node": "^10.9.1",
46
- "typescript": "^4.9.5"
46
+ "typescript": "^5.1.6"
47
47
  },
48
48
  "publishConfig": {
49
49
  "access": "public"