@nmshd/connector-tui 3.0.0-alpha.1 → 3.0.0-alpha.2

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.
@@ -159,17 +159,23 @@ export function AddSendRequestByMessage(Base) {
159
159
  type: "text",
160
160
  name: "attributeType",
161
161
  },
162
+ {
163
+ message: "What's the description of the RequestItem?",
164
+ type: "text",
165
+ name: "requestItemDescription",
166
+ format: (value) => (value === "" ? undefined : value),
167
+ },
162
168
  {
163
169
  message: "What's the title of the RelationshipAttribute?",
164
170
  type: "text",
165
171
  name: "attributeTitle",
166
- initial: "Attribute Title",
172
+ format: (value) => (value === "" ? undefined : value),
167
173
  },
168
174
  {
169
175
  message: "What's the description of the RelationshipAttribute?",
170
176
  type: "text",
171
177
  name: "attributeDescription",
172
- initial: "Attribute Title",
178
+ format: (value) => (value === "" ? undefined : value),
173
179
  },
174
180
  {
175
181
  message: "What's the key of the attribute you would like to query?",
@@ -182,16 +188,18 @@ export function AddSendRequestByMessage(Base) {
182
188
  type: "select",
183
189
  name: "owner",
184
190
  choices: [
185
- { title: "The other side or a third party", value: "" },
186
- { title: "The other side", value: "recipient" },
187
- { title: "A third party", value: "thirdParty" },
191
+ { title: "Yourself", value: "yourself" },
192
+ { title: "The recipient", value: "" },
188
193
  ],
189
194
  },
190
195
  ]);
191
196
  const title = result.attributeTitle ?? `A ${result.attributeType} attribute`;
197
+ if (result.owner === "yourself")
198
+ result.owner = this.connectorAddress;
192
199
  const requestItem = {
193
200
  "@type": "ReadAttributeRequestItem",
194
201
  mustBeAccepted: true,
202
+ description: result.requestItemDescription,
195
203
  query: {
196
204
  "@type": "RelationshipAttributeQuery",
197
205
  owner: result.owner ?? "",
@@ -221,8 +229,13 @@ export function AddSendRequestByMessage(Base) {
221
229
  },
222
230
  {
223
231
  message: "Who is the owner of the RelationshipAttribute?",
224
- type: "text",
232
+ type: "select",
225
233
  name: "owner",
234
+ choices: [
235
+ { title: "The recipient or the third party", value: "" },
236
+ { title: "The recipient", value: "recipient" },
237
+ { title: "The third party", value: "thirdParty" },
238
+ ],
226
239
  },
227
240
  {
228
241
  message: "What are the third party addresses? (comma-separated)",
@@ -90,8 +90,9 @@ export function AddShareRequestByTemplate(Base) {
90
90
  }
91
91
  async getOrCreateConnectorDisplayName(displayName) {
92
92
  const response = await this.connectorClient.attributes.getOwnRepositoryAttributes({ "content.value.@type": "DisplayName" });
93
- if (response.result.length > 0)
94
- return response.result[0];
93
+ const displayNameWithValue = response.result.find((attr) => attr.content.value["@type"] === "DisplayName" && attr.content.value.value === displayName);
94
+ if (displayNameWithValue)
95
+ return displayNameWithValue;
95
96
  const createAttributeResponse = await this.connectorClient.attributes.createRepositoryAttribute({ content: { value: { "@type": "DisplayName", value: displayName } } });
96
97
  return createAttributeResponse.result;
97
98
  }
package/package.json CHANGED
@@ -28,9 +28,9 @@
28
28
  "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"
29
29
  },
30
30
  "dependencies": {
31
- "@nmshd/connector-sdk": "^7.0.0-alpha.20",
31
+ "@nmshd/connector-sdk": "^7.0.0-alpha.24",
32
32
  "axios": "^1.11.0",
33
- "chalk": "^5.4.1",
33
+ "chalk": "^5.6.0",
34
34
  "dotenv": "^17.2.1",
35
35
  "luxon": "^3.7.1",
36
36
  "prompts": "^2.4.2",
@@ -38,24 +38,24 @@
38
38
  "yargs": "^18.0.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@js-soft/eslint-config-ts": "^2.0.1",
41
+ "@js-soft/eslint-config-ts": "^2.0.3",
42
42
  "@js-soft/license-check": "^1.0.9",
43
- "@types/luxon": "^3.6.2",
44
- "@types/node": "^22.16.5",
43
+ "@types/luxon": "^3.7.1",
44
+ "@types/node": "^24.3.0",
45
45
  "@types/prompts": "^2.4.9",
46
46
  "@types/qrcode-terminal": "^0.12.2",
47
47
  "@types/yargs": "^17.0.33",
48
- "eslint": "^9.31.0",
48
+ "eslint": "^9.34.0",
49
49
  "prettier": "^3.6.2",
50
50
  "ts-node": "^10.9.2",
51
- "typescript": "^5.8.3"
51
+ "typescript": "^5.9.2"
52
52
  },
53
53
  "engines": {
54
- "node": ">=22.17.1"
54
+ "node": ">=22.18.0"
55
55
  },
56
56
  "publishConfig": {
57
57
  "access": "public",
58
58
  "provenance": true
59
59
  },
60
- "version": "3.0.0-alpha.1"
60
+ "version": "3.0.0-alpha.2"
61
61
  }