@nmshd/app-runtime 2.3.2 → 2.3.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nmshd/app-runtime",
3
- "version": "2.3.2",
3
+ "version": "2.3.4",
4
4
  "description": "The App Runtime",
5
5
  "homepage": "https://enmeshed.eu",
6
6
  "repository": "github:nmshd/cns-app-runtime",
@@ -32,7 +32,7 @@
32
32
  "test": "npm run test:node && npm run test:web",
33
33
  "test:node": "mocha -r ts-node/register -r tsconfig-paths/register ./test/index.ts --project ./test/tsconfig.json --exit",
34
34
  "test:web": "browsertest-runner",
35
- "test:web:debug": "browsertest-runner-debug"
35
+ "test:web:debug": "browsertest-runner --debug"
36
36
  },
37
37
  "dependencies": {
38
38
  "@js-soft/docdb-access-loki": "^1.0.3",
@@ -51,19 +51,19 @@
51
51
  "@types/lokijs": "^1.5.7",
52
52
  "@types/luxon": "^3.2.0",
53
53
  "@types/mocha": "^10.0.1",
54
- "@types/node": "^18.13.0",
55
- "bt-runner": "^3.1.0",
54
+ "@types/node": "^18.15.0",
55
+ "bt-runner": "^4.0.1",
56
56
  "chai": "^4.3.7",
57
57
  "copy-webpack-plugin": "^11.0.0",
58
- "eslint": "^8.34.0",
58
+ "eslint": "^8.35.0",
59
59
  "madge": "^6.0.0",
60
60
  "mocha": "^10.2.0",
61
61
  "prettier": "^2.8.4",
62
- "terser-webpack-plugin": "5.3.6",
62
+ "terser-webpack-plugin": "5.3.7",
63
63
  "ts-node": "^10.9.1",
64
64
  "tsconfig-paths": "^4.1.2",
65
65
  "typescript": "^4.9.5",
66
- "webpack": "^5.75.0",
66
+ "webpack": "^5.76.0",
67
67
  "webpack-cli": "^5.0.1"
68
68
  },
69
69
  "publishConfig": {
package/ui5.yaml CHANGED
@@ -4,6 +4,6 @@ type: module
4
4
  resources:
5
5
  configuration:
6
6
  paths:
7
- /resources/nmshd.app-runtime: ./lib-web/
7
+ /resources/nmshd.app-runtime/: ./lib-web/
8
8
  metadata:
9
9
  name: nmshd.app-runtime
@@ -1,15 +0,0 @@
1
- import { DeviceOnboardingInfoDTO } from "@nmshd/runtime";
2
- import { UserfriendlyResult } from "../UserfriendlyResult";
3
- import { LocalAccountDTO } from "./data/LocalAccountDTO";
4
- import { MultiAccountController } from "./MultiAccountController";
5
- export declare class MultiAccountFacade {
6
- protected readonly multiAccountController: MultiAccountController;
7
- constructor(multiAccountController: MultiAccountController);
8
- createAccount(realm: string, name: string): Promise<UserfriendlyResult<LocalAccountDTO>>;
9
- onboardAccount(onboardingInfo: DeviceOnboardingInfoDTO): Promise<UserfriendlyResult<LocalAccountDTO>>;
10
- getAccount(id: string): Promise<UserfriendlyResult<LocalAccountDTO>>;
11
- getAccountByAddress(address: string): Promise<UserfriendlyResult<LocalAccountDTO>>;
12
- getAccounts(): Promise<UserfriendlyResult<LocalAccountDTO[]>>;
13
- clearAccounts(): Promise<UserfriendlyResult<void>>;
14
- renameAccount(localAccountId: string, newAccountName: string): Promise<UserfriendlyResult<void>>;
15
- }
@@ -1,46 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MultiAccountFacade = void 0;
4
- const runtime_1 = require("@nmshd/runtime");
5
- const transport_1 = require("@nmshd/transport");
6
- const AppRuntimeErrors_1 = require("../AppRuntimeErrors");
7
- const UserfriendlyResult_1 = require("../UserfriendlyResult");
8
- const LocalAccountMapper_1 = require("./data/LocalAccountMapper");
9
- class MultiAccountFacade {
10
- constructor(multiAccountController) {
11
- this.multiAccountController = multiAccountController;
12
- }
13
- async createAccount(realm, name) {
14
- if (realm !== transport_1.Realm.Dev && realm !== transport_1.Realm.Prod && realm !== transport_1.Realm.Stage) {
15
- throw AppRuntimeErrors_1.AppRuntimeErrors.multiAccount.wrongRealm();
16
- }
17
- const [localAccount] = await this.multiAccountController.createAccount(realm, name);
18
- return UserfriendlyResult_1.UserfriendlyResult.ok(LocalAccountMapper_1.LocalAccountMapper.toLocalAccountDTO(localAccount));
19
- }
20
- async onboardAccount(onboardingInfo) {
21
- const sharedSecret = runtime_1.DeviceMapper.toDeviceSharedSecret(onboardingInfo);
22
- const [localAccount] = await this.multiAccountController.onboardDevice(sharedSecret);
23
- const localAccountDTO = LocalAccountMapper_1.LocalAccountMapper.toLocalAccountDTO(localAccount);
24
- return UserfriendlyResult_1.UserfriendlyResult.ok(localAccountDTO);
25
- }
26
- async getAccount(id) {
27
- const localAccount = await this.multiAccountController.getAccount(transport_1.CoreId.from(id));
28
- return UserfriendlyResult_1.UserfriendlyResult.ok(LocalAccountMapper_1.LocalAccountMapper.toLocalAccountDTO(localAccount));
29
- }
30
- async getAccountByAddress(address) {
31
- const localAccount = await this.multiAccountController.getAccountByAddress(address);
32
- return UserfriendlyResult_1.UserfriendlyResult.ok(LocalAccountMapper_1.LocalAccountMapper.toLocalAccountDTO(localAccount));
33
- }
34
- async getAccounts() {
35
- const localAccounts = await this.multiAccountController.getAccounts();
36
- return UserfriendlyResult_1.UserfriendlyResult.ok(localAccounts.map((account) => LocalAccountMapper_1.LocalAccountMapper.toLocalAccountDTO(account)));
37
- }
38
- async clearAccounts() {
39
- return UserfriendlyResult_1.UserfriendlyResult.ok(await this.multiAccountController.clearAccounts());
40
- }
41
- async renameAccount(localAccountId, newAccountName) {
42
- return UserfriendlyResult_1.UserfriendlyResult.ok(await this.multiAccountController.renameLocalAccount(transport_1.CoreId.from(localAccountId), newAccountName));
43
- }
44
- }
45
- exports.MultiAccountFacade = MultiAccountFacade;
46
- //# sourceMappingURL=MultiAccountFacade.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MultiAccountFacade.js","sourceRoot":"","sources":["../../src/multiAccount/MultiAccountFacade.ts"],"names":[],"mappings":";;;AAAA,4CAAsE;AACtE,gDAAgD;AAChD,0DAAsD;AACtD,8DAA0D;AAE1D,kEAA8D;AAG9D,MAAa,kBAAkB;IAC3B,YAAsC,sBAA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