@nmshd/connector-tui 2.9.1 → 2.11.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.
- package/dist/mixins/AddSendRequestByMessage.js +1 -1
- package/dist/mixins/AddShareRequestByTemplate.js +37 -3
- package/dist/mixins/AddUploadFile.js +1 -1
- package/dist/mixins/ConnectorTUIBaseWithMixins.js +3 -3
- package/dist/mixins/index.js +0 -1
- package/package.json +4 -4
- package/dist/mixins/AddCreateAndShowTemplate.js +0 -19
|
@@ -916,7 +916,7 @@ export function AddSendRequestByMessage(Base) {
|
|
|
916
916
|
"@type": "TransferFileOwnershipRequestItem",
|
|
917
917
|
mustBeAccepted: true,
|
|
918
918
|
requireManualDecision: result.requireManualDecision,
|
|
919
|
-
fileReference: file.
|
|
919
|
+
fileReference: file.reference.truncated,
|
|
920
920
|
};
|
|
921
921
|
return requestItem;
|
|
922
922
|
}
|
|
@@ -136,7 +136,8 @@ export function AddShareRequestByTemplate(Base) {
|
|
|
136
136
|
},
|
|
137
137
|
name: "password",
|
|
138
138
|
});
|
|
139
|
-
|
|
139
|
+
const passwordLocationIndicator = await this.selectPasswordLocationIndicator();
|
|
140
|
+
return { password: password.password, passwordLocationIndicator };
|
|
140
141
|
}
|
|
141
142
|
const password = await prompts({
|
|
142
143
|
message: "Enter the PIN",
|
|
@@ -152,7 +153,40 @@ export function AddShareRequestByTemplate(Base) {
|
|
|
152
153
|
},
|
|
153
154
|
name: "password",
|
|
154
155
|
});
|
|
155
|
-
|
|
156
|
+
const passwordLocationIndicator = await this.selectPasswordLocationIndicator();
|
|
157
|
+
return { password: password.password, passwordIsPin: true, passwordLocationIndicator };
|
|
158
|
+
}
|
|
159
|
+
async selectPasswordLocationIndicator() {
|
|
160
|
+
const result = await prompts({
|
|
161
|
+
message: "Where can the user find the password?",
|
|
162
|
+
type: "select",
|
|
163
|
+
name: "passwordLocationIndicator",
|
|
164
|
+
choices: [
|
|
165
|
+
{ title: "None", value: "None", selected: true },
|
|
166
|
+
{ title: "Custom (Number between 50 and 99)", value: "Custom" },
|
|
167
|
+
{ title: "Self", value: "Self" },
|
|
168
|
+
{ title: "Letter", value: "Letter" },
|
|
169
|
+
{ title: "RegistrationLetter", value: "RegistrationLetter" },
|
|
170
|
+
{ title: "Email", value: "Email" },
|
|
171
|
+
{ title: "SMS", value: "SMS" },
|
|
172
|
+
{ title: "Website", value: "Website" },
|
|
173
|
+
],
|
|
174
|
+
});
|
|
175
|
+
if (result.passwordLocationIndicator === "None")
|
|
176
|
+
return;
|
|
177
|
+
if (result.passwordLocationIndicator !== "Custom")
|
|
178
|
+
return result.passwordLocationIndicator;
|
|
179
|
+
const customLocation = await prompts({
|
|
180
|
+
message: "Enter a number between 50 and 99",
|
|
181
|
+
type: "number",
|
|
182
|
+
validate: (value) => {
|
|
183
|
+
if (value < 50 || value > 99)
|
|
184
|
+
return "Number must be between 50 and 99";
|
|
185
|
+
return true;
|
|
186
|
+
},
|
|
187
|
+
name: "passwordLocationIndicator",
|
|
188
|
+
});
|
|
189
|
+
return customLocation.passwordLocationIndicator;
|
|
156
190
|
}
|
|
157
191
|
async createQRCodeForRelationshipTemplate(onNewRelationship, onExistingRelationship, name, passwordProtection) {
|
|
158
192
|
const content = {
|
|
@@ -169,7 +203,7 @@ export function AddShareRequestByTemplate(Base) {
|
|
|
169
203
|
expiresAt: DateTime.now().plus({ days: 2 }).toISO(),
|
|
170
204
|
passwordProtection,
|
|
171
205
|
});
|
|
172
|
-
const url =
|
|
206
|
+
const url = template.result.reference.url;
|
|
173
207
|
console.log(url);
|
|
174
208
|
qrcode.generate(url, { small: true });
|
|
175
209
|
}
|
|
@@ -48,7 +48,7 @@ export function AddUploadFile(Base) {
|
|
|
48
48
|
initial: true,
|
|
49
49
|
});
|
|
50
50
|
if (render.yesno) {
|
|
51
|
-
const url =
|
|
51
|
+
const url = uploadedFile.result.reference.url;
|
|
52
52
|
console.log(url);
|
|
53
53
|
qrcode.generate(url, { small: true });
|
|
54
54
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ConnectorTUIBase } from "../ConnectorTUIBase.js";
|
|
2
|
-
import { AddAcceptPendingRelationships, AddAcceptPendingRequests, AddConnectorInfo,
|
|
2
|
+
import { AddAcceptPendingRelationships, AddAcceptPendingRequests, AddConnectorInfo, AddDecomposeRelationship, AddExit, AddGetAttributesOfRelationship, AddIdentityDeletionProcess, AddSendMail, AddSendRequestByMessage, AddShareRequestByTemplate, AddSync, AddTerminateRelationship, AddUploadFile, } from "./index.js";
|
|
3
3
|
export class ConnectorTUIBaseWithMixins
|
|
4
4
|
//
|
|
5
|
-
extends AddExit(AddConnectorInfo(AddDecomposeRelationship(AddTerminateRelationship(
|
|
5
|
+
extends AddExit(AddConnectorInfo(AddDecomposeRelationship(AddTerminateRelationship(AddAcceptPendingRelationships(AddAcceptPendingRequests(AddGetAttributesOfRelationship(AddSendMail(AddSendRequestByMessage(AddShareRequestByTemplate(AddSync(AddUploadFile(AddIdentityDeletionProcess(
|
|
6
6
|
//
|
|
7
|
-
ConnectorTUIBase)))))))))))))
|
|
7
|
+
ConnectorTUIBase))))))))))))) {
|
|
8
8
|
}
|
package/dist/mixins/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export * from "./AddAcceptPendingRelationships.js";
|
|
2
2
|
export * from "./AddAcceptPendingRequests.js";
|
|
3
3
|
export * from "./AddConnectorInfo.js";
|
|
4
|
-
export * from "./AddCreateAndShowTemplate.js";
|
|
5
4
|
export * from "./AddDecomposeRelationship.js";
|
|
6
5
|
export * from "./AddExit.js";
|
|
7
6
|
export * from "./AddGetAttributesOfRelationship.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nmshd/connector-tui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.0",
|
|
4
4
|
"repository": "github:nmshd/connector-tui",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "j&s-soft AG",
|
|
@@ -29,8 +29,8 @@
|
|
|
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.
|
|
33
|
-
"axios": "^1.
|
|
32
|
+
"@nmshd/connector-sdk": "^6.26.2",
|
|
33
|
+
"axios": "^1.9.0",
|
|
34
34
|
"chalk": "^5.4.1",
|
|
35
35
|
"dotenv": "^16.5.0",
|
|
36
36
|
"luxon": "^3.6.1",
|
|
@@ -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.
|
|
45
|
+
"@types/node": "^22.15.18",
|
|
46
46
|
"@types/prompts": "^2.4.9",
|
|
47
47
|
"@types/qrcode-terminal": "^0.12.2",
|
|
48
48
|
"@types/yargs": "^17.0.33",
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { DateTime } from "luxon";
|
|
2
|
-
import qrcode from "qrcode-terminal";
|
|
3
|
-
export function AddCreateAndShowTemplate(Base) {
|
|
4
|
-
return class CreateAndShowTemplate extends Base {
|
|
5
|
-
constructor(...args) {
|
|
6
|
-
super(...args);
|
|
7
|
-
this.choices.push({ title: "Create And Show Template", value: this.createAndShowTemplate });
|
|
8
|
-
}
|
|
9
|
-
async createAndShowTemplate() {
|
|
10
|
-
const template = await this.connectorClient.relationshipTemplates.createOwnRelationshipTemplate({
|
|
11
|
-
content: { "@type": "ArbitraryRelationshipTemplateContent", value: {} },
|
|
12
|
-
expiresAt: DateTime.now().plus({ days: 2 }).toISO(),
|
|
13
|
-
});
|
|
14
|
-
const url = `nmshd://tr#${template.result.truncatedReference}`;
|
|
15
|
-
console.log(url);
|
|
16
|
-
qrcode.generate(url, { small: true });
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
}
|