@nmshd/connector-tui 2.4.0 → 2.5.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.
@@ -85,7 +85,7 @@ export class ConnectorTUIBase {
85
85
  return result.files;
86
86
  }
87
87
  async getFileChoices() {
88
- const files = (await this.connectorClient.files.getFiles()).result;
88
+ const files = (await this.connectorClient.files.getOwnFiles()).result;
89
89
  if (files.length === 0) {
90
90
  console.log("No files found");
91
91
  return;
@@ -67,6 +67,10 @@ export function AddSendRequestByMessage(Base) {
67
67
  title: "FreeTextRequestItem",
68
68
  value: this.createFreeTextRequestItem.bind(this),
69
69
  },
70
+ {
71
+ title: "TransferFileOwnershipRequestItem",
72
+ value: this.createTransferFileOwnershipRequestItem.bind(this),
73
+ },
70
74
  {
71
75
  title: "No more items please",
72
76
  value: "no-more",
@@ -79,7 +83,8 @@ export function AddSendRequestByMessage(Base) {
79
83
  break;
80
84
  }
81
85
  const requestItemJSON = await whatRequest.requestMethod(peer);
82
- requestItems.push(requestItemJSON);
86
+ if (requestItemJSON)
87
+ requestItems.push(requestItemJSON);
83
88
  }
84
89
  if (requestItems.length === 0) {
85
90
  console.error("You have to add at least one item.");
@@ -88,6 +93,8 @@ export function AddSendRequestByMessage(Base) {
88
93
  const response = await this.connectorClient.outgoingRequests.createRequest({
89
94
  peer,
90
95
  content: {
96
+ title: "The title of the Request",
97
+ description: "The description of the Request",
91
98
  items: requestItems,
92
99
  },
93
100
  });
@@ -508,6 +515,11 @@ export function AddSendRequestByMessage(Base) {
508
515
  type: "text",
509
516
  name: "link",
510
517
  },
518
+ {
519
+ message: "[Optional] Enter a link display text",
520
+ type: "text",
521
+ name: "linkDisplayText",
522
+ },
511
523
  {
512
524
  message: "[Optional] Enter a consentKey to know which consent the user agreed to",
513
525
  type: "text",
@@ -521,6 +533,7 @@ export function AddSendRequestByMessage(Base) {
521
533
  mustBeAccepted: true,
522
534
  consent: result.consent,
523
535
  link,
536
+ linkDisplayText: link ? result.linkDisplayText : undefined,
524
537
  metadata: responseMetadata,
525
538
  };
526
539
  return requestItem;
@@ -580,5 +593,16 @@ export function AddSendRequestByMessage(Base) {
580
593
  };
581
594
  return requestItem;
582
595
  }
596
+ async createTransferFileOwnershipRequestItem() {
597
+ const result = await this.selectFile("The ownership of which File do you want to transfer?");
598
+ if (!result)
599
+ return;
600
+ const requestItem = {
601
+ "@type": "TransferFileOwnershipRequestItem",
602
+ mustBeAccepted: true,
603
+ fileReference: result.truncatedReference,
604
+ };
605
+ return requestItem;
606
+ }
583
607
  };
584
608
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nmshd/connector-tui",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "repository": "github:nmshd/connector-tui",
5
5
  "license": "MIT",
6
6
  "author": "j&s-soft AG",
@@ -29,11 +29,11 @@
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.16.3",
33
- "axios": "^1.8.3",
32
+ "@nmshd/connector-sdk": "^6.21.0",
33
+ "axios": "^1.8.4",
34
34
  "chalk": "^5.4.1",
35
35
  "dotenv": "^16.4.7",
36
- "luxon": "^3.5.0",
36
+ "luxon": "^3.6.1",
37
37
  "prompts": "^2.4.2",
38
38
  "qrcode-terminal": "^0.12.0",
39
39
  "yargs": "^17.7.2"
@@ -41,15 +41,15 @@
41
41
  "devDependencies": {
42
42
  "@js-soft/eslint-config-ts": "^1.6.14",
43
43
  "@js-soft/license-check": "^1.0.9",
44
- "@types/luxon": "^3.4.2",
45
- "@types/node": "^22.13.10",
44
+ "@types/luxon": "^3.6.2",
45
+ "@types/node": "^22.14.0",
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
50
  "prettier": "^3.5.3",
51
51
  "ts-node": "^10.9.2",
52
- "typescript": "^5.8.2"
52
+ "typescript": "^5.8.3"
53
53
  },
54
54
  "engines": {
55
55
  "node": ">=19.0.0"