@nmshd/app-runtime 1.0.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/LICENSE +7 -0
- package/README.md +24 -0
- package/dist/AppConfig.d.ts +10 -0
- package/dist/AppConfig.js +55 -0
- package/dist/AppConfig.js.map +1 -0
- package/dist/AppRuntime.d.ts +61 -0
- package/dist/AppRuntime.js +306 -0
- package/dist/AppRuntime.js.map +1 -0
- package/dist/AppRuntimeError.d.ts +5 -0
- package/dist/AppRuntimeError.js +12 -0
- package/dist/AppRuntimeError.js.map +1 -0
- package/dist/AppRuntimeErrors.d.ts +33 -0
- package/dist/AppRuntimeErrors.js +67 -0
- package/dist/AppRuntimeErrors.js.map +1 -0
- package/dist/UserfriendlyApplicationError.d.ts +7 -0
- package/dist/UserfriendlyApplicationError.js +18 -0
- package/dist/UserfriendlyApplicationError.js.map +1 -0
- package/dist/UserfriendlyResult.d.ts +4 -0
- package/dist/UserfriendlyResult.js +8 -0
- package/dist/UserfriendlyResult.js.map +1 -0
- package/dist/buildInformation.d.ts +512 -0
- package/dist/buildInformation.js +25 -0
- package/dist/buildInformation.js.map +1 -0
- package/dist/events/AccountSelectedEvent.d.ts +12 -0
- package/dist/events/AccountSelectedEvent.js +16 -0
- package/dist/events/AccountSelectedEvent.js.map +1 -0
- package/dist/events/DatawalletSynchronizedEvent.d.ts +5 -0
- package/dist/events/DatawalletSynchronizedEvent.js +12 -0
- package/dist/events/DatawalletSynchronizedEvent.js.map +1 -0
- package/dist/events/ExternalEventReceivedEvent.d.ts +8 -0
- package/dist/events/ExternalEventReceivedEvent.js +15 -0
- package/dist/events/ExternalEventReceivedEvent.js.map +1 -0
- package/dist/events/MailReceivedEvent.d.ts +5 -0
- package/dist/events/MailReceivedEvent.js +12 -0
- package/dist/events/MailReceivedEvent.js.map +1 -0
- package/dist/events/OnboardingChangeReceivedEvent.d.ts +9 -0
- package/dist/events/OnboardingChangeReceivedEvent.js +16 -0
- package/dist/events/OnboardingChangeReceivedEvent.js.map +1 -0
- package/dist/events/RelationshipSelectedEvent.d.ts +5 -0
- package/dist/events/RelationshipSelectedEvent.js +12 -0
- package/dist/events/RelationshipSelectedEvent.js.map +1 -0
- package/dist/events/RequestReceivedEvent.d.ts +8 -0
- package/dist/events/RequestReceivedEvent.js +15 -0
- package/dist/events/RequestReceivedEvent.js.map +1 -0
- package/dist/events/index.d.ts +7 -0
- package/dist/events/index.js +20 -0
- package/dist/events/index.js.map +1 -0
- package/dist/extensibility/AppServices.d.ts +7 -0
- package/dist/extensibility/AppServices.js +12 -0
- package/dist/extensibility/AppServices.js.map +1 -0
- package/dist/extensibility/DVOs/RelationshipItemsDVO.d.ts +3 -0
- package/dist/extensibility/DVOs/RelationshipItemsDVO.js +3 -0
- package/dist/extensibility/DVOs/RelationshipItemsDVO.js.map +1 -0
- package/dist/extensibility/facades/AppRelationshipFacade.d.ts +21 -0
- package/dist/extensibility/facades/AppRelationshipFacade.js +88 -0
- package/dist/extensibility/facades/AppRelationshipFacade.js.map +1 -0
- package/dist/extensibility/facades/AppRuntimeFacade.d.ts +13 -0
- package/dist/extensibility/facades/AppRuntimeFacade.js +29 -0
- package/dist/extensibility/facades/AppRuntimeFacade.js.map +1 -0
- package/dist/extensibility/facades/AppStringProcessorFacade.d.ts +9 -0
- package/dist/extensibility/facades/AppStringProcessorFacade.js +73 -0
- package/dist/extensibility/facades/AppStringProcessorFacade.js.map +1 -0
- package/dist/extensibility/facades/index.d.ts +2 -0
- package/dist/extensibility/facades/index.js +15 -0
- package/dist/extensibility/facades/index.js.map +1 -0
- package/dist/extensibility/index.d.ts +2 -0
- package/dist/extensibility/index.js +15 -0
- package/dist/extensibility/index.js.map +1 -0
- package/dist/extensibility/ui/IUIBridge.d.ts +14 -0
- package/dist/extensibility/ui/IUIBridge.js +3 -0
- package/dist/extensibility/ui/IUIBridge.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -0
- package/dist/modules/AppRuntimeModule.d.ts +9 -0
- package/dist/modules/AppRuntimeModule.js +8 -0
- package/dist/modules/AppRuntimeModule.js.map +1 -0
- package/dist/modules/appEvents/AppLaunchModule.d.ts +13 -0
- package/dist/modules/appEvents/AppLaunchModule.js +33 -0
- package/dist/modules/appEvents/AppLaunchModule.js.map +1 -0
- package/dist/modules/appEvents/MailReceivedModule.d.ts +13 -0
- package/dist/modules/appEvents/MailReceivedModule.js +41 -0
- package/dist/modules/appEvents/MailReceivedModule.js.map +1 -0
- package/dist/modules/appEvents/OnboardingChangeReceivedModule.d.ts +13 -0
- package/dist/modules/appEvents/OnboardingChangeReceivedModule.js +62 -0
- package/dist/modules/appEvents/OnboardingChangeReceivedModule.js.map +1 -0
- package/dist/modules/appEvents/index.d.ts +3 -0
- package/dist/modules/appEvents/index.js +16 -0
- package/dist/modules/appEvents/index.js.map +1 -0
- package/dist/modules/appSync/AppSyncModule.d.ts +13 -0
- package/dist/modules/appSync/AppSyncModule.js +37 -0
- package/dist/modules/appSync/AppSyncModule.js.map +1 -0
- package/dist/modules/appSync/index.d.ts +1 -0
- package/dist/modules/appSync/index.js +14 -0
- package/dist/modules/appSync/index.js.map +1 -0
- package/dist/modules/index.d.ts +5 -0
- package/dist/modules/index.js +18 -0
- package/dist/modules/index.js.map +1 -0
- package/dist/modules/pushNotifications/IBackboneEventContent.d.ts +10 -0
- package/dist/modules/pushNotifications/IBackboneEventContent.js +9 -0
- package/dist/modules/pushNotifications/IBackboneEventContent.js.map +1 -0
- package/dist/modules/pushNotifications/PushNotificationModule.d.ts +17 -0
- package/dist/modules/pushNotifications/PushNotificationModule.js +168 -0
- package/dist/modules/pushNotifications/PushNotificationModule.js.map +1 -0
- package/dist/modules/pushNotifications/index.d.ts +2 -0
- package/dist/modules/pushNotifications/index.js +15 -0
- package/dist/modules/pushNotifications/index.js.map +1 -0
- package/dist/modules/runtimeEvents/MessageReceivedModule.d.ts +13 -0
- package/dist/modules/runtimeEvents/MessageReceivedModule.js +52 -0
- package/dist/modules/runtimeEvents/MessageReceivedModule.js.map +1 -0
- package/dist/modules/runtimeEvents/RelationshipChangedModule.d.ts +13 -0
- package/dist/modules/runtimeEvents/RelationshipChangedModule.js +46 -0
- package/dist/modules/runtimeEvents/RelationshipChangedModule.js.map +1 -0
- package/dist/modules/runtimeEvents/index.d.ts +2 -0
- package/dist/modules/runtimeEvents/index.js +15 -0
- package/dist/modules/runtimeEvents/index.js.map +1 -0
- package/dist/multiAccount/AccountServices.d.ts +13 -0
- package/dist/multiAccount/AccountServices.js +37 -0
- package/dist/multiAccount/AccountServices.js.map +1 -0
- package/dist/multiAccount/MultiAccountController.d.ts +28 -0
- package/dist/multiAccount/MultiAccountController.js +155 -0
- package/dist/multiAccount/MultiAccountController.js.map +1 -0
- package/dist/multiAccount/MultiAccountFacade.d.ts +15 -0
- package/dist/multiAccount/MultiAccountFacade.js +46 -0
- package/dist/multiAccount/MultiAccountFacade.js.map +1 -0
- package/dist/multiAccount/data/LocalAccount.d.ts +18 -0
- package/dist/multiAccount/data/LocalAccount.js +55 -0
- package/dist/multiAccount/data/LocalAccount.js.map +1 -0
- package/dist/multiAccount/data/LocalAccountDTO.d.ts +8 -0
- package/dist/multiAccount/data/LocalAccountDTO.js +3 -0
- package/dist/multiAccount/data/LocalAccountDTO.js.map +1 -0
- package/dist/multiAccount/data/LocalAccountMapper.d.ts +5 -0
- package/dist/multiAccount/data/LocalAccountMapper.js +18 -0
- package/dist/multiAccount/data/LocalAccountMapper.js.map +1 -0
- package/dist/multiAccount/data/LocalAccountSession.d.ts +17 -0
- package/dist/multiAccount/data/LocalAccountSession.js +3 -0
- package/dist/multiAccount/data/LocalAccountSession.js.map +1 -0
- package/dist/multiAccount/index.d.ts +6 -0
- package/dist/multiAccount/index.js +19 -0
- package/dist/multiAccount/index.js.map +1 -0
- package/lib-web/nmshd.app-runtime.js +23621 -0
- package/lib-web/nmshd.app-runtime.min.js +3 -0
- package/package.json +71 -0
- package/ui5.yaml +9 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2022 j&s-soft GmbH
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# App Runtime
|
|
2
|
+
|
|
3
|
+
[](https://github.com/nmshd/cns-app-runtime/actions?query=workflow%3Apublish)
|
|
4
|
+
[](https://www.npmjs.com/package/@nmshd%2fapp-runtime)
|
|
5
|
+
|
|
6
|
+
The App-Runtime extends the Runtime with App-specific functionality.
|
|
7
|
+
|
|
8
|
+
## Documentation
|
|
9
|
+
|
|
10
|
+
The documentation for this project is currently under construction.
|
|
11
|
+
|
|
12
|
+
## Feedback
|
|
13
|
+
|
|
14
|
+
Please file any bugs or feature requests by creating an [issue](https://github.com/nmshd/feedback/issues).
|
|
15
|
+
|
|
16
|
+
Share your feedback with the Enmeshed team by contributing to the [discussions](https://github.com/nmshd/feedback/discussions).
|
|
17
|
+
|
|
18
|
+
## Contribute
|
|
19
|
+
|
|
20
|
+
Currently contribution to this project is not possible. This will change soon.
|
|
21
|
+
|
|
22
|
+
## License
|
|
23
|
+
|
|
24
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RuntimeConfig } from "@nmshd/runtime";
|
|
2
|
+
import { IConfigOverwrite } from "@nmshd/transport";
|
|
3
|
+
export interface AppConfig extends RuntimeConfig {
|
|
4
|
+
logging: any;
|
|
5
|
+
}
|
|
6
|
+
export interface AppConfigOverwrite {
|
|
7
|
+
transportLibrary?: IConfigOverwrite;
|
|
8
|
+
logging?: any;
|
|
9
|
+
}
|
|
10
|
+
export declare function createAppConfig(...configs: AppConfigOverwrite[]): AppConfig;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createAppConfig = void 0;
|
|
4
|
+
const transport_1 = require("@nmshd/transport");
|
|
5
|
+
const lodash_1 = require("lodash");
|
|
6
|
+
function createAppConfig(...configs) {
|
|
7
|
+
const appConfig = {
|
|
8
|
+
transportLibrary: {
|
|
9
|
+
realm: transport_1.Realm.Prod,
|
|
10
|
+
datawalletEnabled: true
|
|
11
|
+
},
|
|
12
|
+
modules: {
|
|
13
|
+
appLaunch: {
|
|
14
|
+
name: "appLaunch",
|
|
15
|
+
displayName: "App Launch Module",
|
|
16
|
+
location: "appLaunch",
|
|
17
|
+
enabled: true
|
|
18
|
+
},
|
|
19
|
+
pushNotification: {
|
|
20
|
+
name: "pushNotification",
|
|
21
|
+
displayName: "Push Notification Module",
|
|
22
|
+
location: "pushNotification",
|
|
23
|
+
enabled: true
|
|
24
|
+
},
|
|
25
|
+
mailReceived: {
|
|
26
|
+
name: "mailReceived",
|
|
27
|
+
displayName: "Mail Received Module",
|
|
28
|
+
location: "mailReceived",
|
|
29
|
+
enabled: true
|
|
30
|
+
},
|
|
31
|
+
onboardingChangeReceived: {
|
|
32
|
+
name: "onboardingChangeReceived",
|
|
33
|
+
displayName: "Onboarding Change Received Module",
|
|
34
|
+
location: "onboardingChangeReceived",
|
|
35
|
+
enabled: true
|
|
36
|
+
},
|
|
37
|
+
messageReceived: {
|
|
38
|
+
name: "messageReceived",
|
|
39
|
+
displayName: "Message Received Module",
|
|
40
|
+
location: "messageReceived",
|
|
41
|
+
enabled: true
|
|
42
|
+
},
|
|
43
|
+
relationshipChanged: {
|
|
44
|
+
name: "relationshipChanged",
|
|
45
|
+
displayName: "Relationship Changed Module",
|
|
46
|
+
location: "relationshipChanged",
|
|
47
|
+
enabled: true
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const mergedConfig = (0, lodash_1.defaultsDeep)({}, ...configs, appConfig);
|
|
52
|
+
return mergedConfig;
|
|
53
|
+
}
|
|
54
|
+
exports.createAppConfig = createAppConfig;
|
|
55
|
+
//# sourceMappingURL=AppConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppConfig.js","sourceRoot":"","sources":["../src/AppConfig.ts"],"names":[],"mappings":";;;AACA,gDAA0D;AAC1D,mCAAqC;AAWrC,SAAgB,eAAe,CAAC,GAAG,OAA6B;IAC5D,MAAM,SAAS,GAAG;QACd,gBAAgB,EAAE;YACd,KAAK,EAAE,iBAAK,CAAC,IAAI;YACjB,iBAAiB,EAAE,IAAI;SAC1B;QACD,OAAO,EAAE;YACL,SAAS,EAAE;gBACP,IAAI,EAAE,WAAW;gBACjB,WAAW,EAAE,mBAAmB;gBAChC,QAAQ,EAAE,WAAW;gBACrB,OAAO,EAAE,IAAI;aAChB;YACD,gBAAgB,EAAE;gBACd,IAAI,EAAE,kBAAkB;gBACxB,WAAW,EAAE,0BAA0B;gBACvC,QAAQ,EAAE,kBAAkB;gBAC5B,OAAO,EAAE,IAAI;aAChB;YACD,YAAY,EAAE;gBACV,IAAI,EAAE,cAAc;gBACpB,WAAW,EAAE,sBAAsB;gBACnC,QAAQ,EAAE,cAAc;gBACxB,OAAO,EAAE,IAAI;aAChB;YACD,wBAAwB,EAAE;gBACtB,IAAI,EAAE,0BAA0B;gBAChC,WAAW,EAAE,mCAAmC;gBAChD,QAAQ,EAAE,0BAA0B;gBACpC,OAAO,EAAE,IAAI;aAChB;YACD,eAAe,EAAE;gBACb,IAAI,EAAE,iBAAiB;gBACvB,WAAW,EAAE,yBAAyB;gBACtC,QAAQ,EAAE,iBAAiB;gBAC3B,OAAO,EAAE,IAAI;aAChB;YACD,mBAAmB,EAAE;gBACjB,IAAI,EAAE,qBAAqB;gBAC3B,WAAW,EAAE,6BAA6B;gBAC1C,QAAQ,EAAE,qBAAqB;gBAC/B,OAAO,EAAE,IAAI;aAChB;SACJ;KACJ,CAAA;IAED,MAAM,YAAY,GAAG,IAAA,qBAAY,EAAC,EAAE,EAAE,GAAG,OAAO,EAAE,SAAS,CAAC,CAAA;IAE5D,OAAO,YAAY,CAAA;AACvB,CAAC;AAjDD,0CAiDC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { IDatabaseConnection } from "@js-soft/docdb-access-abstractions";
|
|
2
|
+
import { ILoggerFactory } from "@js-soft/logging-abstractions";
|
|
3
|
+
import { INativeBootstrapper, INativeEnvironment, INativeTranslationProvider } from "@js-soft/native-abstractions";
|
|
4
|
+
import { Result } from "@js-soft/ts-utils";
|
|
5
|
+
import { ConsumptionController } from "@nmshd/consumption";
|
|
6
|
+
import { DataViewExpander, ModuleConfiguration, Runtime, RuntimeHealth } from "@nmshd/runtime";
|
|
7
|
+
import { AccountController } from "@nmshd/transport";
|
|
8
|
+
import { AppConfig, AppConfigOverwrite } from "./AppConfig";
|
|
9
|
+
import { AppServices, IUIBridge } from "./extensibility";
|
|
10
|
+
import { IAppRuntimeModuleConstructor } from "./modules";
|
|
11
|
+
import { AccountServices, LocalAccountDTO, MultiAccountController } from "./multiAccount";
|
|
12
|
+
import { LocalAccountSession } from "./multiAccount/data/LocalAccountSession";
|
|
13
|
+
import { UserfriendlyResult } from "./UserfriendlyResult";
|
|
14
|
+
export declare class AppRuntime extends Runtime<AppConfig> {
|
|
15
|
+
readonly nativeBootstrapper: INativeBootstrapper;
|
|
16
|
+
constructor(nativeBootstrapper: INativeBootstrapper, appConfig: AppConfig);
|
|
17
|
+
private _uiBridge;
|
|
18
|
+
private _uiBridgePromise;
|
|
19
|
+
private _uiBridgeResolveFunction;
|
|
20
|
+
uiBridge(): Promise<IUIBridge>;
|
|
21
|
+
registerUIBridge(uiBridge: IUIBridge): UserfriendlyResult<void>;
|
|
22
|
+
private lokiConnection;
|
|
23
|
+
private _multiAccountController;
|
|
24
|
+
get multiAccountController(): MultiAccountController;
|
|
25
|
+
get expander(): DataViewExpander;
|
|
26
|
+
private _accountServices;
|
|
27
|
+
get accountServices(): AccountServices;
|
|
28
|
+
private _appServices?;
|
|
29
|
+
get appServices(): AppServices;
|
|
30
|
+
private readonly _nativeEnvironment;
|
|
31
|
+
get nativeEnvironment(): INativeEnvironment;
|
|
32
|
+
get currentAccount(): LocalAccountDTO;
|
|
33
|
+
protected login(accountController: AccountController, consumptionController: ConsumptionController): this;
|
|
34
|
+
private _currentSession?;
|
|
35
|
+
get currentSession(): LocalAccountSession;
|
|
36
|
+
private readonly _availableSessions;
|
|
37
|
+
getSessions(): LocalAccountDTO[];
|
|
38
|
+
private _accountIdToPromise?;
|
|
39
|
+
private _selectAccountPromise?;
|
|
40
|
+
getSession(accountId: string): LocalAccountDTO | undefined;
|
|
41
|
+
findSession(accountId: string): LocalAccountSession | undefined;
|
|
42
|
+
findSessionByAddress(address: string): LocalAccountSession | undefined;
|
|
43
|
+
selectAccountByAddress(address: string, password: string): Promise<LocalAccountDTO>;
|
|
44
|
+
selectAccount(accountId: string, password: string): Promise<LocalAccountDTO>;
|
|
45
|
+
private _selectAccount;
|
|
46
|
+
queryAccount(title?: string, description?: string): Promise<UserfriendlyResult<LocalAccountDTO>>;
|
|
47
|
+
selectRelationship(id?: string): Promise<void>;
|
|
48
|
+
getHealth(): Promise<RuntimeHealth>;
|
|
49
|
+
protected initAccount(): Promise<void>;
|
|
50
|
+
static create(nativeBootstrapper: INativeBootstrapper, appConfig?: AppConfigOverwrite): Promise<AppRuntime>;
|
|
51
|
+
static createAndStart(nativeBootstrapper: INativeBootstrapper, appConfig?: AppConfigOverwrite): Promise<AppRuntime>;
|
|
52
|
+
protected createLoggerFactory(): ILoggerFactory;
|
|
53
|
+
protected createDatabaseConnection(): Promise<IDatabaseConnection>;
|
|
54
|
+
private static moduleRegistry;
|
|
55
|
+
static registerModule(moduleName: string, ctor: IAppRuntimeModuleConstructor): void;
|
|
56
|
+
protected loadModule(moduleConfiguration: ModuleConfiguration): Promise<void>;
|
|
57
|
+
stop(): Promise<void>;
|
|
58
|
+
private translationProvider;
|
|
59
|
+
registerTranslationProvider(provider: INativeTranslationProvider): void;
|
|
60
|
+
translate(key: string, ...values: any[]): Promise<Result<string>>;
|
|
61
|
+
}
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AppRuntime = void 0;
|
|
4
|
+
const docdb_access_loki_1 = require("@js-soft/docdb-access-loki");
|
|
5
|
+
const ts_utils_1 = require("@js-soft/ts-utils");
|
|
6
|
+
const consumption_1 = require("@nmshd/consumption");
|
|
7
|
+
const runtime_1 = require("@nmshd/runtime");
|
|
8
|
+
const transport_1 = require("@nmshd/transport");
|
|
9
|
+
const AppConfig_1 = require("./AppConfig");
|
|
10
|
+
const AppRuntimeErrors_1 = require("./AppRuntimeErrors");
|
|
11
|
+
const events_1 = require("./events");
|
|
12
|
+
const extensibility_1 = require("./extensibility");
|
|
13
|
+
const modules_1 = require("./modules");
|
|
14
|
+
const multiAccount_1 = require("./multiAccount");
|
|
15
|
+
const UserfriendlyResult_1 = require("./UserfriendlyResult");
|
|
16
|
+
class AppRuntime extends runtime_1.Runtime {
|
|
17
|
+
constructor(nativeBootstrapper, appConfig) {
|
|
18
|
+
super(appConfig);
|
|
19
|
+
this.nativeBootstrapper = nativeBootstrapper;
|
|
20
|
+
this._availableSessions = [];
|
|
21
|
+
this.translationProvider = {
|
|
22
|
+
translate: (key) => Promise.resolve(ts_utils_1.Result.ok(key))
|
|
23
|
+
};
|
|
24
|
+
if (!nativeBootstrapper.isInitialized) {
|
|
25
|
+
throw AppRuntimeErrors_1.AppRuntimeErrors.startup.bootstrapperNotInitialized();
|
|
26
|
+
}
|
|
27
|
+
this._nativeEnvironment = nativeBootstrapper.nativeEnvironment;
|
|
28
|
+
}
|
|
29
|
+
uiBridge() {
|
|
30
|
+
if (this._uiBridge)
|
|
31
|
+
return Promise.resolve(this._uiBridge);
|
|
32
|
+
if (this._uiBridgePromise)
|
|
33
|
+
return this._uiBridgePromise;
|
|
34
|
+
this._uiBridgePromise = new Promise((resolve) => {
|
|
35
|
+
this._uiBridgeResolveFunction = resolve;
|
|
36
|
+
});
|
|
37
|
+
this._uiBridgePromise
|
|
38
|
+
.then(() => {
|
|
39
|
+
this._uiBridgePromise = undefined;
|
|
40
|
+
this._uiBridgeResolveFunction = undefined;
|
|
41
|
+
})
|
|
42
|
+
.catch((e) => {
|
|
43
|
+
this._uiBridgePromise = undefined;
|
|
44
|
+
this._uiBridgeResolveFunction = undefined;
|
|
45
|
+
this.logger.error(e);
|
|
46
|
+
});
|
|
47
|
+
return this._uiBridgePromise;
|
|
48
|
+
}
|
|
49
|
+
registerUIBridge(uiBridge) {
|
|
50
|
+
if (this._uiBridge) {
|
|
51
|
+
return UserfriendlyResult_1.UserfriendlyResult.fail(AppRuntimeErrors_1.AppRuntimeErrors.startup.uiBridgeAlreadyRegistered());
|
|
52
|
+
}
|
|
53
|
+
this._uiBridge = uiBridge;
|
|
54
|
+
if (this._uiBridgePromise && this._uiBridgeResolveFunction) {
|
|
55
|
+
this._uiBridgeResolveFunction();
|
|
56
|
+
}
|
|
57
|
+
return UserfriendlyResult_1.UserfriendlyResult.ok(undefined);
|
|
58
|
+
}
|
|
59
|
+
get multiAccountController() {
|
|
60
|
+
return this._multiAccountController;
|
|
61
|
+
}
|
|
62
|
+
get expander() {
|
|
63
|
+
return this.getDataViewExpander();
|
|
64
|
+
}
|
|
65
|
+
get accountServices() {
|
|
66
|
+
return this._accountServices;
|
|
67
|
+
}
|
|
68
|
+
get appServices() {
|
|
69
|
+
if (!this._appServices) {
|
|
70
|
+
throw AppRuntimeErrors_1.AppRuntimeErrors.general.appServicesUnavailable().logWith(this.logger);
|
|
71
|
+
}
|
|
72
|
+
return this._appServices;
|
|
73
|
+
}
|
|
74
|
+
get nativeEnvironment() {
|
|
75
|
+
return this._nativeEnvironment;
|
|
76
|
+
}
|
|
77
|
+
get currentAccount() {
|
|
78
|
+
if (!this._currentSession) {
|
|
79
|
+
throw AppRuntimeErrors_1.AppRuntimeErrors.general.currentSessionUnavailable();
|
|
80
|
+
}
|
|
81
|
+
return this._currentSession.account;
|
|
82
|
+
}
|
|
83
|
+
login(accountController, consumptionController) {
|
|
84
|
+
super.login(accountController, consumptionController);
|
|
85
|
+
this._appServices = new extensibility_1.AppServices(this);
|
|
86
|
+
return this;
|
|
87
|
+
}
|
|
88
|
+
get currentSession() {
|
|
89
|
+
if (!this._currentSession) {
|
|
90
|
+
throw AppRuntimeErrors_1.AppRuntimeErrors.general.currentSessionUnavailable();
|
|
91
|
+
}
|
|
92
|
+
return this._currentSession;
|
|
93
|
+
}
|
|
94
|
+
getSessions() {
|
|
95
|
+
return this._availableSessions.map((session) => session.account);
|
|
96
|
+
}
|
|
97
|
+
getSession(accountId) {
|
|
98
|
+
const session = this.findSession(accountId);
|
|
99
|
+
if (session)
|
|
100
|
+
return session.account;
|
|
101
|
+
return undefined;
|
|
102
|
+
}
|
|
103
|
+
findSession(accountId) {
|
|
104
|
+
return this._availableSessions.find((item) => item.account.id === accountId);
|
|
105
|
+
}
|
|
106
|
+
findSessionByAddress(address) {
|
|
107
|
+
return this._availableSessions.find((item) => item.address === address);
|
|
108
|
+
}
|
|
109
|
+
async selectAccountByAddress(address, password) {
|
|
110
|
+
if (this._currentSession && this._currentSession.address === address) {
|
|
111
|
+
return this._currentSession.account;
|
|
112
|
+
}
|
|
113
|
+
const availableSession = this.findSessionByAddress(address);
|
|
114
|
+
let accountId = availableSession === null || availableSession === void 0 ? void 0 : availableSession.account.id;
|
|
115
|
+
if (!accountId) {
|
|
116
|
+
accountId = (await this.multiAccountController.getAccountByAddress(address)).id.toString();
|
|
117
|
+
}
|
|
118
|
+
return await this.selectAccount(accountId, password);
|
|
119
|
+
}
|
|
120
|
+
async selectAccount(accountId, password) {
|
|
121
|
+
if (this._currentSession && this._currentSession.account.id === accountId) {
|
|
122
|
+
return this._currentSession.account;
|
|
123
|
+
}
|
|
124
|
+
const availableSession = this.findSession(accountId);
|
|
125
|
+
// If there is any select promise, we have to await it, even before returning an available session
|
|
126
|
+
if (this._accountIdToPromise && this._accountIdToPromise !== accountId) {
|
|
127
|
+
if (!availableSession) {
|
|
128
|
+
// Another account is currently logging in and we also need to log in -> error
|
|
129
|
+
throw AppRuntimeErrors_1.AppRuntimeErrors.multiAccount.concurrentLoginOfDifferentAccounts();
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
// Another account is currently logging in and we already have an open session -> await login of the other account but do not return
|
|
133
|
+
await this._selectAccountPromise;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
else if (this._selectAccountPromise) {
|
|
137
|
+
// Same account is currently logging in -> await login and return
|
|
138
|
+
return await this._selectAccountPromise;
|
|
139
|
+
}
|
|
140
|
+
if (availableSession) {
|
|
141
|
+
this.login(availableSession.accountController, availableSession.consumptionController);
|
|
142
|
+
this._currentSession = availableSession;
|
|
143
|
+
this.eventBus.publish(new events_1.AccountSelectedEvent(availableSession.address, availableSession.account.id));
|
|
144
|
+
return availableSession.account;
|
|
145
|
+
}
|
|
146
|
+
this._selectAccountPromise = this._selectAccount(accountId, password);
|
|
147
|
+
try {
|
|
148
|
+
return await this._selectAccountPromise;
|
|
149
|
+
}
|
|
150
|
+
finally {
|
|
151
|
+
this._selectAccountPromise = undefined;
|
|
152
|
+
this._accountIdToPromise = undefined;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
async _selectAccount(accountId, password) {
|
|
156
|
+
this._accountIdToPromise = accountId;
|
|
157
|
+
const [localAccount, accountController] = await this._multiAccountController.selectAccount(transport_1.CoreId.from(accountId), password);
|
|
158
|
+
if (!localAccount.address) {
|
|
159
|
+
throw AppRuntimeErrors_1.AppRuntimeErrors.general.addressUnavailable().logWith(this.logger);
|
|
160
|
+
}
|
|
161
|
+
const consumptionController = await new consumption_1.ConsumptionController(this.transport, accountController).init();
|
|
162
|
+
this.login(accountController, consumptionController);
|
|
163
|
+
this.logger.debug(`Finished login to ${accountId}.`);
|
|
164
|
+
const session = {
|
|
165
|
+
address: localAccount.address.toString(),
|
|
166
|
+
account: multiAccount_1.LocalAccountMapper.toLocalAccountDTO(localAccount),
|
|
167
|
+
consumptionServices: this.consumptionServices,
|
|
168
|
+
transportServices: this.transportServices,
|
|
169
|
+
expander: this.getDataViewExpander(),
|
|
170
|
+
appServices: this.appServices,
|
|
171
|
+
accountController: accountController,
|
|
172
|
+
consumptionController: consumptionController
|
|
173
|
+
};
|
|
174
|
+
this._availableSessions.push(session);
|
|
175
|
+
this._currentSession = session;
|
|
176
|
+
this.eventBus.publish(new events_1.AccountSelectedEvent(session.address, session.account.id));
|
|
177
|
+
return session.account;
|
|
178
|
+
}
|
|
179
|
+
async queryAccount(title = "i18n://uibridge.accountSelection.title", description = "i18n://uibridge.accountSelection.description") {
|
|
180
|
+
let selectedAccount;
|
|
181
|
+
const accounts = await this.accountServices.getAccounts();
|
|
182
|
+
if (accounts.length > 1) {
|
|
183
|
+
const bridge = await this.uiBridge();
|
|
184
|
+
const accountSelectionResult = await bridge.requestAccountSelection(accounts, title, description);
|
|
185
|
+
if (accountSelectionResult.isError) {
|
|
186
|
+
return UserfriendlyResult_1.UserfriendlyResult.fail(AppRuntimeErrors_1.AppRuntimeErrors.general.noAccountAvailable(accountSelectionResult.error));
|
|
187
|
+
}
|
|
188
|
+
selectedAccount = accountSelectionResult.value;
|
|
189
|
+
}
|
|
190
|
+
else if (accounts.length === 1) {
|
|
191
|
+
selectedAccount = accounts[0];
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
return UserfriendlyResult_1.UserfriendlyResult.fail(AppRuntimeErrors_1.AppRuntimeErrors.general.noAccountAvailable());
|
|
195
|
+
}
|
|
196
|
+
return UserfriendlyResult_1.UserfriendlyResult.ok(selectedAccount);
|
|
197
|
+
}
|
|
198
|
+
async selectRelationship(id) {
|
|
199
|
+
if (!this._currentSession) {
|
|
200
|
+
throw AppRuntimeErrors_1.AppRuntimeErrors.general.currentSessionUnavailable().logWith(this.logger);
|
|
201
|
+
}
|
|
202
|
+
if (!id) {
|
|
203
|
+
this._currentSession.selectedRelationship = undefined;
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
const result = await this.appServices.relationships.renderRelationship(id);
|
|
207
|
+
if (result.isError) {
|
|
208
|
+
throw result.error;
|
|
209
|
+
}
|
|
210
|
+
const relationship = result.value;
|
|
211
|
+
this._currentSession.selectedRelationship = relationship;
|
|
212
|
+
this.eventBus.publish(new events_1.RelationshipSelectedEvent(this._currentSession.address, relationship));
|
|
213
|
+
}
|
|
214
|
+
getHealth() {
|
|
215
|
+
const health = {
|
|
216
|
+
isHealthy: true,
|
|
217
|
+
services: {}
|
|
218
|
+
};
|
|
219
|
+
return Promise.resolve(health);
|
|
220
|
+
}
|
|
221
|
+
async initAccount() {
|
|
222
|
+
this._multiAccountController = new multiAccount_1.MultiAccountController(this.transport);
|
|
223
|
+
await this._multiAccountController.init();
|
|
224
|
+
this._accountServices = new multiAccount_1.AccountServices(this._multiAccountController);
|
|
225
|
+
}
|
|
226
|
+
static async create(nativeBootstrapper, appConfig) {
|
|
227
|
+
// TODO: JSSNMSHDD-2524 (validate app config)
|
|
228
|
+
if (!nativeBootstrapper.isInitialized) {
|
|
229
|
+
const result = await nativeBootstrapper.init();
|
|
230
|
+
if (!result.isSuccess) {
|
|
231
|
+
throw AppRuntimeErrors_1.AppRuntimeErrors.startup.bootstrapError(result.error);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
const transportConfig = nativeBootstrapper.nativeEnvironment.configAccess.get("transport").value;
|
|
235
|
+
const mergedConfig = appConfig
|
|
236
|
+
? (0, AppConfig_1.createAppConfig)({
|
|
237
|
+
transportLibrary: transportConfig
|
|
238
|
+
}, appConfig)
|
|
239
|
+
: (0, AppConfig_1.createAppConfig)({
|
|
240
|
+
transportLibrary: transportConfig
|
|
241
|
+
});
|
|
242
|
+
const runtime = new AppRuntime(nativeBootstrapper, mergedConfig);
|
|
243
|
+
await runtime.init();
|
|
244
|
+
runtime.logger.trace("Runtime initialized");
|
|
245
|
+
return runtime;
|
|
246
|
+
}
|
|
247
|
+
static async createAndStart(nativeBootstrapper, appConfig) {
|
|
248
|
+
const runtime = await this.create(nativeBootstrapper, appConfig);
|
|
249
|
+
await runtime.start();
|
|
250
|
+
runtime.logger.trace("Runtime started");
|
|
251
|
+
return runtime;
|
|
252
|
+
}
|
|
253
|
+
createLoggerFactory() {
|
|
254
|
+
const loggerFactory = this.nativeEnvironment.loggerFactory;
|
|
255
|
+
this.logger = loggerFactory.getLogger(runtime_1.Runtime);
|
|
256
|
+
return loggerFactory;
|
|
257
|
+
}
|
|
258
|
+
createDatabaseConnection() {
|
|
259
|
+
this.logger.trace("Creating DatabaseConnection to LokiJS");
|
|
260
|
+
this.lokiConnection = new docdb_access_loki_1.LokiJsConnection("./data", this.nativeEnvironment.databaseFactory);
|
|
261
|
+
this.logger.trace("Finished initialization of LokiJS connection.");
|
|
262
|
+
return Promise.resolve(this.lokiConnection);
|
|
263
|
+
}
|
|
264
|
+
static registerModule(moduleName, ctor) {
|
|
265
|
+
this.moduleRegistry[moduleName] = ctor;
|
|
266
|
+
}
|
|
267
|
+
loadModule(moduleConfiguration) {
|
|
268
|
+
const moduleConstructor = AppRuntime.moduleRegistry[moduleConfiguration.name];
|
|
269
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
270
|
+
if (!moduleConstructor) {
|
|
271
|
+
const error = new Error(`Module '${this.getModuleName(moduleConfiguration)}' could not be loaded, because it was not registered. Please register all modules before running init.`);
|
|
272
|
+
this.logger.error(error);
|
|
273
|
+
return Promise.reject(error);
|
|
274
|
+
}
|
|
275
|
+
const connectorModuleConfiguration = moduleConfiguration;
|
|
276
|
+
const module = new moduleConstructor();
|
|
277
|
+
module.runtime = this;
|
|
278
|
+
module.configuration = connectorModuleConfiguration;
|
|
279
|
+
module.logger = this.loggerFactory.getLogger(moduleConstructor);
|
|
280
|
+
this.modules.add(module);
|
|
281
|
+
this.logger.info(`Module '${this.getModuleName(moduleConfiguration)}' was loaded successfully.`);
|
|
282
|
+
return Promise.resolve();
|
|
283
|
+
}
|
|
284
|
+
async stop() {
|
|
285
|
+
const logError = (e) => this.logger.error(e);
|
|
286
|
+
await super.stop().catch(logError);
|
|
287
|
+
await this.lokiConnection.close().catch(logError);
|
|
288
|
+
}
|
|
289
|
+
registerTranslationProvider(provider) {
|
|
290
|
+
this.translationProvider = provider;
|
|
291
|
+
}
|
|
292
|
+
async translate(key, ...values) {
|
|
293
|
+
return await this.translationProvider.translate(key, ...values);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
exports.AppRuntime = AppRuntime;
|
|
297
|
+
AppRuntime.moduleRegistry = {
|
|
298
|
+
appLaunch: modules_1.AppLaunchModule,
|
|
299
|
+
appSync: modules_1.AppSyncModule,
|
|
300
|
+
pushNotification: modules_1.PushNotificationModule,
|
|
301
|
+
mailReceived: modules_1.MailReceivedModule,
|
|
302
|
+
onboardingChangeReceived: modules_1.OnboardingChangeReceivedModule,
|
|
303
|
+
messageReceived: modules_1.MessageReceivedModule,
|
|
304
|
+
relationshipChanged: modules_1.RelationshipChangedModule
|
|
305
|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,mBAAmB,EAAE,mCAAyB;CACjD,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AppRuntimeError = void 0;
|
|
4
|
+
const ts_utils_1 = require("@js-soft/ts-utils");
|
|
5
|
+
class AppRuntimeError extends ts_utils_1.ApplicationError {
|
|
6
|
+
logWith(logger) {
|
|
7
|
+
logger.error(logger);
|
|
8
|
+
return this;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.AppRuntimeError = AppRuntimeError;
|
|
12
|
+
//# sourceMappingURL=AppRuntimeError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppRuntimeError.js","sourceRoot":"","sources":["../src/AppRuntimeError.ts"],"names":[],"mappings":";;;AACA,gDAAoD;AAEpD,MAAa,eAAgB,SAAQ,2BAAgB;IAC1C,OAAO,CAAC,MAAe;QAC1B,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;QACpB,OAAO,IAAI,CAAA;IACf,CAAC;CACJ;AALD,0CAKC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { UserfriendlyApplicationError } from "./UserfriendlyApplicationError";
|
|
2
|
+
declare class General {
|
|
3
|
+
currentSessionUnavailable(): UserfriendlyApplicationError;
|
|
4
|
+
addressUnavailable(): UserfriendlyApplicationError;
|
|
5
|
+
appServicesUnavailable(): UserfriendlyApplicationError;
|
|
6
|
+
noAccountAvailable(error?: Error): UserfriendlyApplicationError;
|
|
7
|
+
}
|
|
8
|
+
declare class Startup {
|
|
9
|
+
bootstrapError(bootstrapError?: Error): UserfriendlyApplicationError;
|
|
10
|
+
bootstrapperNotInitialized(): UserfriendlyApplicationError;
|
|
11
|
+
uiBridgeAlreadyRegistered(): UserfriendlyApplicationError;
|
|
12
|
+
wrongURL(): UserfriendlyApplicationError;
|
|
13
|
+
wrongCode(): UserfriendlyApplicationError;
|
|
14
|
+
}
|
|
15
|
+
declare class PushNotificationModule {
|
|
16
|
+
subscriptionNotPossible(details: string, rootError?: Error): UserfriendlyApplicationError;
|
|
17
|
+
unsubscriptionNotPossible(details: string, rootError?: Error): UserfriendlyApplicationError;
|
|
18
|
+
tokenRegistrationNotPossible(details: string, rootError?: Error): UserfriendlyApplicationError;
|
|
19
|
+
}
|
|
20
|
+
declare class MultiAccount {
|
|
21
|
+
wrongRealm(): UserfriendlyApplicationError;
|
|
22
|
+
concurrentLoginOfDifferentAccounts(): UserfriendlyApplicationError;
|
|
23
|
+
}
|
|
24
|
+
declare class Modules {
|
|
25
|
+
readonly pushNotificationModule: PushNotificationModule;
|
|
26
|
+
}
|
|
27
|
+
export declare class AppRuntimeErrors {
|
|
28
|
+
static readonly general: General;
|
|
29
|
+
static readonly startup: Startup;
|
|
30
|
+
static readonly modules: Modules;
|
|
31
|
+
static readonly multiAccount: MultiAccount;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AppRuntimeErrors = void 0;
|
|
4
|
+
const UserfriendlyApplicationError_1 = require("./UserfriendlyApplicationError");
|
|
5
|
+
class General {
|
|
6
|
+
currentSessionUnavailable() {
|
|
7
|
+
return new UserfriendlyApplicationError_1.UserfriendlyApplicationError("error.appruntime.general.currentSessionUnavailable", "The currentSession is not available. Try to execute login before this operation.");
|
|
8
|
+
}
|
|
9
|
+
addressUnavailable() {
|
|
10
|
+
return new UserfriendlyApplicationError_1.UserfriendlyApplicationError("error.appruntime.general.addressUnavailable", "The address of the account is not available. This might be a permanent problem caused by a failed login.");
|
|
11
|
+
}
|
|
12
|
+
appServicesUnavailable() {
|
|
13
|
+
return new UserfriendlyApplicationError_1.UserfriendlyApplicationError("error.appruntime.general.appServicesUnavailable", "The app services are not available. Try to execute login before this operation.");
|
|
14
|
+
}
|
|
15
|
+
noAccountAvailable(error) {
|
|
16
|
+
return new UserfriendlyApplicationError_1.UserfriendlyApplicationError("error.appruntime.general.noAccountAvailable", "There is no account available for this action.", "It seems no eligible account is available for this action.", error);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
class Startup {
|
|
20
|
+
bootstrapError(bootstrapError) {
|
|
21
|
+
return new UserfriendlyApplicationError_1.UserfriendlyApplicationError("error.runtime.startup.BootstrapError", "There was an error while bootstrapping.", undefined, bootstrapError);
|
|
22
|
+
}
|
|
23
|
+
bootstrapperNotInitialized() {
|
|
24
|
+
return new UserfriendlyApplicationError_1.UserfriendlyApplicationError("error.runtime.startup.BootstrapNotInitialized", "The given bootstrapper is not initialized.");
|
|
25
|
+
}
|
|
26
|
+
uiBridgeAlreadyRegistered() {
|
|
27
|
+
return new UserfriendlyApplicationError_1.UserfriendlyApplicationError("error.appruntime.startup.uiBridgeAlreadyRegistered", "The ui bridge was already registered for this runtime instance.");
|
|
28
|
+
}
|
|
29
|
+
wrongURL() {
|
|
30
|
+
return new UserfriendlyApplicationError_1.UserfriendlyApplicationError("error.appruntime.startup.WrongURL", "The given URL to start the App is in a wrong format.");
|
|
31
|
+
}
|
|
32
|
+
wrongCode() {
|
|
33
|
+
return new UserfriendlyApplicationError_1.UserfriendlyApplicationError("error.appruntime.startup.WrongCode", "The given code is in a wrong format.");
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
class PushNotificationModule {
|
|
37
|
+
subscriptionNotPossible(details, rootError) {
|
|
38
|
+
return new UserfriendlyApplicationError_1.UserfriendlyApplicationError("error.runtime.module.PushNotificationModule.SubscriptionNotPossible", `Subscribing to the NativeEventBus was not possible. Root cause: '${details}'`, "The backbone has no push connection with this app. You might have to refresh the app manually.", rootError);
|
|
39
|
+
}
|
|
40
|
+
unsubscriptionNotPossible(details, rootError) {
|
|
41
|
+
return new UserfriendlyApplicationError_1.UserfriendlyApplicationError("error.runtime.module.PushNotificationModule.UnsubscriptionNotPossible", `Unsubscribing from the NativeEventBus was not possible. Root cause: '${details}'`, "The backbone still might have a push connection with this app. You might receive some unwanted notifications.", rootError);
|
|
42
|
+
}
|
|
43
|
+
tokenRegistrationNotPossible(details, rootError) {
|
|
44
|
+
return new UserfriendlyApplicationError_1.UserfriendlyApplicationError("error.runtime.module.PushNotificationModule.TokenRegistrationNotPossible", `Registering the Push Notification Token for the account was not possible. Root cause: '${details}'`, "The backbone has no push connection with this app. You might have to refresh the app manually.", rootError);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
class MultiAccount {
|
|
48
|
+
wrongRealm() {
|
|
49
|
+
return new UserfriendlyApplicationError_1.UserfriendlyApplicationError("error.runtime.MultiAccount.WrongRealm", "The given realm is invalid.");
|
|
50
|
+
}
|
|
51
|
+
concurrentLoginOfDifferentAccounts() {
|
|
52
|
+
return new UserfriendlyApplicationError_1.UserfriendlyApplicationError("error.runtime.MultiAccount.ParallelLoginOfDifferentAccounts", "You cannot login different accounts concurrently. Please wait until the login is completed.");
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
class Modules {
|
|
56
|
+
constructor() {
|
|
57
|
+
this.pushNotificationModule = new PushNotificationModule();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
class AppRuntimeErrors {
|
|
61
|
+
}
|
|
62
|
+
exports.AppRuntimeErrors = AppRuntimeErrors;
|
|
63
|
+
AppRuntimeErrors.general = new General();
|
|
64
|
+
AppRuntimeErrors.startup = new Startup();
|
|
65
|
+
AppRuntimeErrors.modules = new Modules();
|
|
66
|
+
AppRuntimeErrors.multiAccount = new MultiAccount();
|
|
67
|
+
//# sourceMappingURL=AppRuntimeErrors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppRuntimeErrors.js","sourceRoot":"","sources":["../src/AppRuntimeErrors.ts"],"names":[],"mappings":";;;AAAA,iFAA6E;AAE7E,MAAM,OAAO;IACF,yBAAyB;QAC5B,OAAO,IAAI,2DAA4B,CACnC,oD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BAA4B,CAAC,OAAe,EAAE,SAAiB;QAClE,OAAO,IAAI,2DAA4B,CACnC,0EAA0E,EAC1E,0FAA0F,OAAO,GAAG,EACpG,gGAAgG,EAChG,SAAS,CACZ,CAAA;IACL,CAAC;CACJ;AAED,MAAM,YAAY;IACP,UAAU;QACb,OAAO,IAAI,2DAA4B,CAAC,uCAAuC,EAAE,6BAA6B,CAAC,CAAA;IACnH,CAAC;IAEM,kCAAkC;QACrC,OAAO,IAAI,2DAA4B,CACnC,6DAA6D,EAC7D,6FAA6F,CAChG,CAAA;IACL,CAAC;CACJ;AAED,MAAM,OAAO;IAAb;QACoB,2BAAsB,GAAG,IAAI,sBAAsB,EAAE,CAAA;IACzE,CAAC;CAAA;AAED,MAAa,gBAAgB;;AAA7B,4CAKC;AAJ0B,wBAAO,GAAG,IAAI,OAAO,EAAE,CAAA;AACvB,wBAAO,GAAG,IAAI,OAAO,EAAE,CAAA;AACvB,wBAAO,GAAG,IAAI,OAAO,EAAE,CAAA;AACvB,6BAAY,GAAG,IAAI,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ApplicationError } from "@js-soft/ts-utils";
|
|
2
|
+
import { AppRuntimeError } from "./AppRuntimeError";
|
|
3
|
+
export declare class UserfriendlyApplicationError extends AppRuntimeError {
|
|
4
|
+
readonly userfriendlyMessage?: string | undefined;
|
|
5
|
+
constructor(code: string, message: string, userfriendlyMessage?: string | undefined, data?: any);
|
|
6
|
+
static fromError(error: ApplicationError, userfriendlyMessage: string): UserfriendlyApplicationError;
|
|
7
|
+
}
|