@nmshd/connector-tui 2.6.0 → 2.7.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.
@@ -523,32 +523,55 @@ export function AddSendRequestByMessage(Base) {
523
523
  message: "What's the consent the peer should agree to?",
524
524
  type: "text",
525
525
  name: "consent",
526
+ format: (value) => value.replaceAll("\\n", "\n"),
527
+ validate: (value) => (value.length < 1 ? "Consent must not be empty" : true),
528
+ },
529
+ {
530
+ message: "[Optional] Enter a description for the consent",
531
+ type: "text",
532
+ name: "description",
533
+ format: (value) => (value.length > 0 ? value.replaceAll("\\n", "\n") : undefined),
534
+ },
535
+ {
536
+ message: "Does the consent have to be accepted?",
537
+ type: "confirm",
538
+ name: "mustBeAccepted",
539
+ initial: true,
540
+ },
541
+ {
542
+ message: "Do you want to require a manual decision?",
543
+ type: "confirm",
544
+ name: "requireManualDecision",
545
+ initial: false,
526
546
  },
527
547
  {
528
548
  message: "[Optional] Enter the URL to to the consent details?",
529
549
  type: "text",
530
550
  name: "link",
551
+ format: (value) => (value.length > 0 ? value : undefined),
531
552
  },
532
553
  {
533
554
  message: "[Optional] Enter a link display text",
534
555
  type: "text",
535
556
  name: "linkDisplayText",
557
+ format: (value) => (value.length > 0 ? value : undefined),
536
558
  },
537
559
  {
538
560
  message: "[Optional] Enter a consentKey to know which consent the user agreed to",
539
561
  type: "text",
540
- name: "consentKey",
562
+ name: "responseMetadata",
563
+ format: (value) => (value.length > 0 ? { consentKey: value } : undefined),
541
564
  },
542
565
  ]);
543
- const responseMetadata = result.consentKey ? { consentKey: result.consentKey } : undefined;
544
- const link = result.link ?? undefined;
545
566
  const requestItem = {
546
567
  "@type": "ConsentRequestItem",
547
- mustBeAccepted: true,
568
+ mustBeAccepted: result.mustBeAccepted,
569
+ requireManualDecision: result.requireManualDecision,
548
570
  consent: result.consent,
549
- link,
550
- linkDisplayText: link ? result.linkDisplayText : undefined,
551
- metadata: responseMetadata,
571
+ description: result.description,
572
+ link: result.link,
573
+ linkDisplayText: result.link ? result.linkDisplayText : undefined,
574
+ metadata: result.responseMetadata,
552
575
  };
553
576
  return requestItem;
554
577
  }
@@ -580,15 +603,15 @@ export function AddSendRequestByMessage(Base) {
580
603
  {
581
604
  message: "[Optional] Enter an unique authenticationToken to know which authentication did the user grant",
582
605
  type: "text",
583
- name: "authenticationToken",
606
+ name: "responseMetadata",
607
+ format: (value) => (value.length > 0 ? { authenticationToken: value } : undefined),
584
608
  },
585
609
  ]);
586
- const responseMetadata = result.authenticationToken ? { authenticationToken: result.authenticationToken } : undefined;
587
610
  const requestItem = {
588
611
  "@type": "AuthenticationRequestItem",
589
612
  mustBeAccepted: true,
590
613
  title: result.title,
591
- metadata: responseMetadata,
614
+ metadata: result.responseMetadata,
592
615
  };
593
616
  return requestItem;
594
617
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nmshd/connector-tui",
3
- "version": "2.6.0",
3
+ "version": "2.7.0",
4
4
  "repository": "github:nmshd/connector-tui",
5
5
  "license": "MIT",
6
6
  "author": "j&s-soft AG",
@@ -29,10 +29,10 @@
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.21.0",
32
+ "@nmshd/connector-sdk": "^6.23.0",
33
33
  "axios": "^1.8.4",
34
34
  "chalk": "^5.4.1",
35
- "dotenv": "^16.4.7",
35
+ "dotenv": "^16.5.0",
36
36
  "luxon": "^3.6.1",
37
37
  "prompts": "^2.4.2",
38
38
  "qrcode-terminal": "^0.12.0",
@@ -42,7 +42,7 @@
42
42
  "@js-soft/eslint-config-ts": "^1.6.14",
43
43
  "@js-soft/license-check": "^1.0.9",
44
44
  "@types/luxon": "^3.6.2",
45
- "@types/node": "^22.14.0",
45
+ "@types/node": "^22.14.1",
46
46
  "@types/prompts": "^2.4.9",
47
47
  "@types/qrcode-terminal": "^0.12.2",
48
48
  "@types/yargs": "^17.0.33",