@nmshd/connector-tui 1.0.0 → 1.2.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.
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
export function AddConnectorInfo(Base) {
|
|
3
|
+
return class ConnectorInfo extends Base {
|
|
4
|
+
constructor(...args) {
|
|
5
|
+
super(...args);
|
|
6
|
+
this.choices.push({ title: "Connector Info", value: this.connectorInfo });
|
|
7
|
+
}
|
|
8
|
+
async connectorInfo() {
|
|
9
|
+
const connectorInfo = await this.connectorClient.monitoring.getSupport();
|
|
10
|
+
const transportLibrary = connectorInfo.configuration["transportLibrary"];
|
|
11
|
+
const moduleConfig = connectorInfo.configuration.modules;
|
|
12
|
+
const enabledModules = Object.values(moduleConfig)
|
|
13
|
+
.filter((module) => module.enabled)
|
|
14
|
+
.map((module) => module.displayName)
|
|
15
|
+
.sort()
|
|
16
|
+
.join(", ");
|
|
17
|
+
console.log(`Health: ${connectorInfo.health.isHealthy ? chalk.green("Healthy") : chalk.red("Unhealthy")}
|
|
18
|
+
Backbone
|
|
19
|
+
BaseUrl: ${chalk.yellow(transportLibrary.baseUrl)}
|
|
20
|
+
ClientId: ${chalk.yellow(transportLibrary.platformClientId)}
|
|
21
|
+
Identity Info
|
|
22
|
+
Address: ${chalk.yellow(connectorInfo.identityInfo.address)}
|
|
23
|
+
Public Key: ${chalk.yellow(connectorInfo.identityInfo.publicKey)}
|
|
24
|
+
Enabled Modules: ${chalk.yellow(enabledModules)}
|
|
25
|
+
`);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
@@ -50,6 +50,10 @@ export function AddSendRequestByMessage(Base) {
|
|
|
50
50
|
title: "ConsentRequestItem",
|
|
51
51
|
value: this.createConsentRequestItem.bind(this),
|
|
52
52
|
},
|
|
53
|
+
{
|
|
54
|
+
title: "RegisterAttributeListenerRequestItem",
|
|
55
|
+
value: this.createRegisterAttributeListenerRequestItem.bind(this),
|
|
56
|
+
},
|
|
53
57
|
{
|
|
54
58
|
title: "AuthenticationRequestItem",
|
|
55
59
|
value: this.createAuthenticationRequestItem.bind(this),
|
|
@@ -467,6 +471,24 @@ export function AddSendRequestByMessage(Base) {
|
|
|
467
471
|
};
|
|
468
472
|
return requestItem;
|
|
469
473
|
}
|
|
474
|
+
async createRegisterAttributeListenerRequestItem() {
|
|
475
|
+
const result = await prompts([
|
|
476
|
+
{
|
|
477
|
+
message: "What's the attribute type you would like to query?",
|
|
478
|
+
type: "text",
|
|
479
|
+
name: "attributeType",
|
|
480
|
+
},
|
|
481
|
+
]);
|
|
482
|
+
const requestItem = {
|
|
483
|
+
"@type": "RegisterAttributeListenerRequestItem",
|
|
484
|
+
mustBeAccepted: true,
|
|
485
|
+
query: {
|
|
486
|
+
"@type": "IdentityAttributeQuery",
|
|
487
|
+
valueType: result.attributeType,
|
|
488
|
+
},
|
|
489
|
+
};
|
|
490
|
+
return requestItem;
|
|
491
|
+
}
|
|
470
492
|
async createAuthenticationRequestItem() {
|
|
471
493
|
const result = await prompts([
|
|
472
494
|
{
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ConnectorTUIBase } from "../ConnectorTUIBase.js";
|
|
2
|
-
import { AddAcceptPendingRelationships, AddAcceptPendingRequests, AddCreateAndShowTemplate, AddExit, AddGetAttributesOfRelationship, AddSendMail, AddSendRequestByMessage, AddShareRequestByTemplate, AddSync, AddUploadFile, } from "./index.js";
|
|
2
|
+
import { AddAcceptPendingRelationships, AddAcceptPendingRequests, AddConnectorInfo, AddCreateAndShowTemplate, AddExit, AddGetAttributesOfRelationship, AddSendMail, AddSendRequestByMessage, AddShareRequestByTemplate, AddSync, AddUploadFile, } from "./index.js";
|
|
3
3
|
export class ConnectorTUIBaseWithMixins
|
|
4
4
|
//
|
|
5
|
-
extends AddExit(AddCreateAndShowTemplate(AddAcceptPendingRelationships(AddAcceptPendingRequests(AddGetAttributesOfRelationship(AddSendMail(AddSendRequestByMessage(AddShareRequestByTemplate(AddSync(AddUploadFile(
|
|
5
|
+
extends AddExit(AddConnectorInfo(AddCreateAndShowTemplate(AddAcceptPendingRelationships(AddAcceptPendingRequests(AddGetAttributesOfRelationship(AddSendMail(AddSendRequestByMessage(AddShareRequestByTemplate(AddSync(AddUploadFile(
|
|
6
6
|
//
|
|
7
|
-
ConnectorTUIBase)))))))))) {
|
|
7
|
+
ConnectorTUIBase))))))))))) {
|
|
8
8
|
}
|
package/dist/mixins/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "./AddAcceptPendingRelationships.js";
|
|
2
2
|
export * from "./AddAcceptPendingRequests.js";
|
|
3
|
+
export * from "./AddConnectorInfo.js";
|
|
3
4
|
export * from "./AddCreateAndShowTemplate.js";
|
|
4
5
|
export * from "./AddExit.js";
|
|
5
6
|
export * from "./AddGetAttributesOfRelationship.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nmshd/connector-tui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"repository": "github:nmshd/connector-tui",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "j&s-soft GmbH",
|
|
@@ -21,10 +21,11 @@
|
|
|
21
21
|
"lint:eslint": "eslint --ext .ts ./src",
|
|
22
22
|
"lint:prettier": "prettier --check ./src",
|
|
23
23
|
"start": "node --loader ts-node/esm src/index.ts",
|
|
24
|
+
"watch": "node --watch --loader ts-node/esm src/index.ts",
|
|
24
25
|
"test": "echo 'no test specified'"
|
|
25
26
|
},
|
|
26
27
|
"dependencies": {
|
|
27
|
-
"@nmshd/connector-sdk": "^2.2.
|
|
28
|
+
"@nmshd/connector-sdk": "^2.2.5",
|
|
28
29
|
"chalk": "^5.3.0",
|
|
29
30
|
"dotenv": "^16.3.1",
|
|
30
31
|
"luxon": "^3.4.4",
|