@nmshd/connector-tui 0.2.6 → 1.1.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.
@@ -2,7 +2,7 @@ import { ConnectorClient } from "@nmshd/connector-sdk";
2
2
  import chalk from "chalk";
3
3
  import { readFile } from "fs/promises";
4
4
  import prompts from "prompts";
5
- import { ConnectorTUIBaseWithMixins } from "./mixins";
5
+ import { ConnectorTUIBaseWithMixins } from "./mixins/index.js";
6
6
  export class ConnectorTUI extends ConnectorTUIBaseWithMixins {
7
7
  static async create(baseUrl, apiKey) {
8
8
  const client = ConnectorClient.create({ baseUrl, apiKey });
package/dist/index.js CHANGED
@@ -1,9 +1,10 @@
1
+ #!/usr/bin/env node
1
2
  import chalk from "chalk";
2
3
  import dotenv from "dotenv";
3
4
  import path from "path";
4
5
  import yargs from "yargs";
5
6
  import { hideBin } from "yargs/helpers";
6
- import { ConnectorTUI } from "./ConnectorTUI";
7
+ import { ConnectorTUI } from "./ConnectorTUI.js";
7
8
  const argv = await yargs(hideBin(process.argv))
8
9
  .option("env", {
9
10
  alias: "e",
@@ -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
+ }
@@ -1,17 +1,8 @@
1
- import { ConnectorTUIBase } from "../ConnectorTUIBase";
2
- import { AddAcceptPendingRelationships } from "./AddAcceptPendingRelationships";
3
- import { AddAcceptPendingRequests } from "./AddAcceptPendingRequests";
4
- import { AddExit } from "./AddExit";
5
- import { AddGetAttributesOfRelationship } from "./AddGetAttributesOfRelationship";
6
- import { AddSendMail } from "./AddSendMail";
7
- import { AddSendRequestByMessage } from "./AddSendRequestByMessage";
8
- import { AddShareRequestByTemplate } from "./AddShareRequestByTemplate";
9
- import { AddCreateAndShowTemplate } from "./AddShowTemplate";
10
- import { AddSync } from "./AddSync";
11
- import { AddUploadFile } from "./AddUploadFile";
1
+ import { ConnectorTUIBase } from "../ConnectorTUIBase.js";
2
+ import { AddAcceptPendingRelationships, AddAcceptPendingRequests, AddConnectorInfo, AddCreateAndShowTemplate, AddExit, AddGetAttributesOfRelationship, AddSendMail, AddSendRequestByMessage, AddShareRequestByTemplate, AddSync, AddUploadFile, } from "./index.js";
12
3
  export class ConnectorTUIBaseWithMixins
13
4
  //
14
- extends AddExit(AddCreateAndShowTemplate(AddAcceptPendingRelationships(AddAcceptPendingRequests(AddGetAttributesOfRelationship(AddSendMail(AddSendRequestByMessage(AddShareRequestByTemplate(AddSync(AddUploadFile(
5
+ extends AddExit(AddConnectorInfo(AddCreateAndShowTemplate(AddAcceptPendingRelationships(AddAcceptPendingRequests(AddGetAttributesOfRelationship(AddSendMail(AddSendRequestByMessage(AddShareRequestByTemplate(AddSync(AddUploadFile(
15
6
  //
16
- ConnectorTUIBase)))))))))) {
7
+ ConnectorTUIBase))))))))))) {
17
8
  }
@@ -1,10 +1,12 @@
1
- export * from "./AddAcceptPendingRelationships";
2
- export * from "./AddAcceptPendingRequests";
3
- export * from "./AddExit";
4
- export * from "./AddGetAttributesOfRelationship";
5
- export * from "./AddSendMail";
6
- export * from "./AddSendRequestByMessage";
7
- export * from "./AddShareRequestByTemplate";
8
- export * from "./AddSync";
9
- export * from "./AddUploadFile";
10
- export * from "./ConnectorTUIBaseWithMixins";
1
+ export * from "./AddAcceptPendingRelationships.js";
2
+ export * from "./AddAcceptPendingRequests.js";
3
+ export * from "./AddConnectorInfo.js";
4
+ export * from "./AddCreateAndShowTemplate.js";
5
+ export * from "./AddExit.js";
6
+ export * from "./AddGetAttributesOfRelationship.js";
7
+ export * from "./AddSendMail.js";
8
+ export * from "./AddSendRequestByMessage.js";
9
+ export * from "./AddShareRequestByTemplate.js";
10
+ export * from "./AddSync.js";
11
+ export * from "./AddUploadFile.js";
12
+ export * from "./ConnectorTUIBaseWithMixins.js";
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@nmshd/connector-tui",
3
- "version": "0.2.6",
3
+ "version": "1.1.0",
4
4
  "repository": "github:nmshd/connector-tui",
5
5
  "license": "MIT",
6
6
  "author": "j&s-soft GmbH",
7
7
  "type": "module",
8
8
  "main": "index.js",
9
9
  "bin": {
10
- "connector_tui": "index.js"
10
+ "connector_tui": "dist/index.js"
11
11
  },
12
12
  "files": [
13
13
  "index.js",
@@ -20,11 +20,12 @@
20
20
  "lint": "npm run lint:prettier && npm run lint:eslint",
21
21
  "lint:eslint": "eslint --ext .ts ./src",
22
22
  "lint:prettier": "prettier --check ./src",
23
- "start": "ts-node --esm --experimental-specifier-resolution node ./src/index.ts",
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.3",
28
+ "@nmshd/connector-sdk": "^2.2.4",
28
29
  "chalk": "^5.3.0",
29
30
  "dotenv": "^16.3.1",
30
31
  "luxon": "^3.4.4",
@@ -33,20 +34,23 @@
33
34
  "yargs": "^17.7.2"
34
35
  },
35
36
  "devDependencies": {
36
- "@js-soft/eslint-config-ts": "^1.6.4",
37
- "@js-soft/license-check": "^1.0.6",
38
- "@types/luxon": "^3.3.4",
39
- "@types/node": "^20.9.1",
40
- "@types/prompts": "^2.4.8",
37
+ "@js-soft/eslint-config-ts": "^1.6.5",
38
+ "@js-soft/license-check": "^1.0.8",
39
+ "@types/luxon": "^3.3.6",
40
+ "@types/node": "^20.10.1",
41
+ "@types/prompts": "^2.4.9",
41
42
  "@types/qrcode-terminal": "^0.12.2",
42
- "@types/yargs": "^17.0.31",
43
- "eslint": "^8.53.0",
43
+ "@types/yargs": "^17.0.32",
44
+ "eslint": "^8.54.0",
44
45
  "prettier": "^3.1.0",
45
46
  "ts-node": "^10.9.1",
46
- "typescript": "^5.2.2"
47
+ "typescript": "^5.3.2"
47
48
  },
48
49
  "publishConfig": {
49
50
  "access": "public",
50
51
  "provenance": true
52
+ },
53
+ "engines": {
54
+ "node": ">=19.0.0"
51
55
  }
52
56
  }
package/index.js DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env -S node --experimental-specifier-resolution node
2
-
3
- await import("./dist/index.js")