@nmshd/connector-tui 2.10.0 → 2.12.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 +29 -1
- 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
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { exec } from "child_process";
|
|
1
2
|
import { DateTime } from "luxon";
|
|
2
3
|
import prompts from "prompts";
|
|
3
4
|
import qrcode from "qrcode-terminal";
|
|
@@ -203,9 +204,36 @@ export function AddShareRequestByTemplate(Base) {
|
|
|
203
204
|
expiresAt: DateTime.now().plus({ days: 2 }).toISO(),
|
|
204
205
|
passwordProtection,
|
|
205
206
|
});
|
|
206
|
-
const url =
|
|
207
|
+
const url = template.result.reference.url;
|
|
207
208
|
console.log(url);
|
|
208
209
|
qrcode.generate(url, { small: true });
|
|
210
|
+
const result = await prompts({
|
|
211
|
+
message: "Do you want to open the link on a connected device?",
|
|
212
|
+
type: "confirm",
|
|
213
|
+
name: "open",
|
|
214
|
+
initial: false,
|
|
215
|
+
});
|
|
216
|
+
if (!result.open)
|
|
217
|
+
return;
|
|
218
|
+
const androidOrIOS = await prompts({
|
|
219
|
+
message: "Is the connected device Android or iOS?",
|
|
220
|
+
type: "select",
|
|
221
|
+
name: "deviceType",
|
|
222
|
+
choices: [
|
|
223
|
+
{ title: "Android", value: "Android" },
|
|
224
|
+
{ title: "iOS", value: "iOS" },
|
|
225
|
+
],
|
|
226
|
+
});
|
|
227
|
+
if (!androidOrIOS.deviceType)
|
|
228
|
+
return;
|
|
229
|
+
const command = androidOrIOS.deviceType === "Android" ? `adb shell am start -a android.intent.action.VIEW -d "${url}"` : `xcrun simctl openurl booted "${url}"`;
|
|
230
|
+
await new Promise((resolve) => {
|
|
231
|
+
exec(command, (err, _, __) => {
|
|
232
|
+
if (err)
|
|
233
|
+
return console.error(`Error executing command: ${err.message}`);
|
|
234
|
+
resolve();
|
|
235
|
+
});
|
|
236
|
+
});
|
|
209
237
|
}
|
|
210
238
|
};
|
|
211
239
|
}
|
|
@@ -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,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nmshd/connector-tui",
|
|
3
|
-
"version": "2.10.0",
|
|
4
3
|
"repository": "github:nmshd/connector-tui",
|
|
5
4
|
"license": "MIT",
|
|
6
5
|
"author": "j&s-soft AG",
|
|
@@ -29,7 +28,7 @@
|
|
|
29
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"
|
|
30
29
|
},
|
|
31
30
|
"dependencies": {
|
|
32
|
-
"@nmshd/connector-sdk": "^6.
|
|
31
|
+
"@nmshd/connector-sdk": "^6.26.2",
|
|
33
32
|
"axios": "^1.9.0",
|
|
34
33
|
"chalk": "^5.4.1",
|
|
35
34
|
"dotenv": "^16.5.0",
|
|
@@ -42,7 +41,7 @@
|
|
|
42
41
|
"@js-soft/eslint-config-ts": "^1.6.14",
|
|
43
42
|
"@js-soft/license-check": "^1.0.9",
|
|
44
43
|
"@types/luxon": "^3.6.2",
|
|
45
|
-
"@types/node": "^22.15.
|
|
44
|
+
"@types/node": "^22.15.18",
|
|
46
45
|
"@types/prompts": "^2.4.9",
|
|
47
46
|
"@types/qrcode-terminal": "^0.12.2",
|
|
48
47
|
"@types/yargs": "^17.0.33",
|
|
@@ -57,5 +56,6 @@
|
|
|
57
56
|
"publishConfig": {
|
|
58
57
|
"access": "public",
|
|
59
58
|
"provenance": true
|
|
60
|
-
}
|
|
59
|
+
},
|
|
60
|
+
"version": "2.12.0"
|
|
61
61
|
}
|
|
@@ -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
|
-
}
|