@nmshd/app-runtime 6.48.1 → 6.49.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/AppRuntime.d.ts +4 -12
- package/dist/AppRuntime.d.ts.map +1 -1
- package/dist/AppRuntime.js +5 -21
- package/dist/AppRuntime.js.map +1 -1
- package/dist/AppRuntimeErrors.d.ts +20 -20
- package/dist/AppRuntimeErrors.d.ts.map +1 -1
- package/dist/AppRuntimeErrors.js +20 -20
- package/dist/AppRuntimeErrors.js.map +1 -1
- package/dist/AppStringProcessor.d.ts +6 -10
- package/dist/AppStringProcessor.d.ts.map +1 -1
- package/dist/AppStringProcessor.js +30 -32
- package/dist/AppStringProcessor.js.map +1 -1
- package/dist/buildInformation.js +4 -4
- package/dist/extensibility/index.d.ts +0 -1
- package/dist/extensibility/index.d.ts.map +1 -1
- package/dist/extensibility/index.js +0 -1
- package/dist/extensibility/index.js.map +1 -1
- package/dist/extensibility/ui/IUIBridge.d.ts +2 -3
- package/dist/extensibility/ui/IUIBridge.d.ts.map +1 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -4
- package/dist/index.js.map +1 -1
- package/dist/modules/PushNotificationModule.d.ts +0 -2
- package/dist/modules/PushNotificationModule.d.ts.map +1 -1
- package/dist/modules/PushNotificationModule.js +7 -11
- package/dist/modules/PushNotificationModule.js.map +1 -1
- package/dist/modules/appEvents/MailReceivedModule.d.ts +0 -3
- package/dist/modules/appEvents/MailReceivedModule.d.ts.map +1 -1
- package/dist/modules/appEvents/MailReceivedModule.js +1 -5
- package/dist/modules/appEvents/MailReceivedModule.js.map +1 -1
- package/dist/modules/appEvents/OnboardingChangeReceivedModule.d.ts +0 -3
- package/dist/modules/appEvents/OnboardingChangeReceivedModule.d.ts.map +1 -1
- package/dist/modules/appEvents/OnboardingChangeReceivedModule.js +1 -5
- package/dist/modules/appEvents/OnboardingChangeReceivedModule.js.map +1 -1
- package/dist/modules/appEvents/RelationshipTemplateProcessedModule.d.ts.map +1 -1
- package/dist/modules/appEvents/RelationshipTemplateProcessedModule.js +4 -4
- package/dist/modules/appEvents/RelationshipTemplateProcessedModule.js.map +1 -1
- package/dist/modules/runtimeEvents/IdentityDeletionProcessStatusChangedModule.d.ts +0 -3
- package/dist/modules/runtimeEvents/IdentityDeletionProcessStatusChangedModule.d.ts.map +1 -1
- package/dist/modules/runtimeEvents/IdentityDeletionProcessStatusChangedModule.js +1 -5
- package/dist/modules/runtimeEvents/IdentityDeletionProcessStatusChangedModule.js.map +1 -1
- package/dist/modules/runtimeEvents/MessageReceivedModule.d.ts +0 -3
- package/dist/modules/runtimeEvents/MessageReceivedModule.d.ts.map +1 -1
- package/dist/modules/runtimeEvents/MessageReceivedModule.js +1 -5
- package/dist/modules/runtimeEvents/MessageReceivedModule.js.map +1 -1
- package/dist/modules/runtimeEvents/RelationshipChangedModule.d.ts +0 -3
- package/dist/modules/runtimeEvents/RelationshipChangedModule.d.ts.map +1 -1
- package/dist/modules/runtimeEvents/RelationshipChangedModule.js +1 -5
- package/dist/modules/runtimeEvents/RelationshipChangedModule.js.map +1 -1
- package/dist/multiAccount/data/LocalAccountSession.d.ts +0 -2
- package/dist/multiAccount/data/LocalAccountSession.d.ts.map +1 -1
- package/dist/natives/INativeEnvironment.d.ts +0 -2
- package/dist/natives/INativeEnvironment.d.ts.map +1 -1
- package/dist/natives/INativeNotificationAccess.d.ts +1 -0
- package/dist/natives/INativeNotificationAccess.d.ts.map +1 -1
- package/dist/natives/index.d.ts +0 -2
- package/dist/natives/index.d.ts.map +1 -1
- package/dist/natives/index.js +0 -2
- package/dist/natives/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/AppRuntimeError.d.ts +0 -6
- package/dist/AppRuntimeError.d.ts.map +0 -1
- package/dist/AppRuntimeError.js +0 -12
- package/dist/AppRuntimeError.js.map +0 -1
- package/dist/AppRuntimeServices.d.ts +0 -6
- package/dist/AppRuntimeServices.d.ts.map +0 -1
- package/dist/AppRuntimeServices.js +0 -3
- package/dist/AppRuntimeServices.js.map +0 -1
- package/dist/UserfriendlyApplicationError.d.ts +0 -8
- package/dist/UserfriendlyApplicationError.d.ts.map +0 -1
- package/dist/UserfriendlyApplicationError.js +0 -18
- package/dist/UserfriendlyApplicationError.js.map +0 -1
- package/dist/UserfriendlyResult.d.ts +0 -5
- package/dist/UserfriendlyResult.d.ts.map +0 -1
- package/dist/UserfriendlyResult.js +0 -8
- package/dist/UserfriendlyResult.js.map +0 -1
- package/dist/extensibility/AppServices.d.ts +0 -8
- package/dist/extensibility/AppServices.d.ts.map +0 -1
- package/dist/extensibility/AppServices.js +0 -11
- package/dist/extensibility/AppServices.js.map +0 -1
- package/dist/extensibility/DVOs/RelationshipItemsDVO.d.ts +0 -4
- package/dist/extensibility/DVOs/RelationshipItemsDVO.d.ts.map +0 -1
- package/dist/extensibility/DVOs/RelationshipItemsDVO.js +0 -3
- package/dist/extensibility/DVOs/RelationshipItemsDVO.js.map +0 -1
- package/dist/extensibility/facades/AppRelationshipFacade.d.ts +0 -18
- package/dist/extensibility/facades/AppRelationshipFacade.d.ts.map +0 -1
- package/dist/extensibility/facades/AppRelationshipFacade.js +0 -60
- package/dist/extensibility/facades/AppRelationshipFacade.js.map +0 -1
- package/dist/extensibility/facades/AppRuntimeFacade.d.ts +0 -14
- package/dist/extensibility/facades/AppRuntimeFacade.d.ts.map +0 -1
- package/dist/extensibility/facades/AppRuntimeFacade.js +0 -29
- package/dist/extensibility/facades/AppRuntimeFacade.js.map +0 -1
- package/dist/extensibility/facades/index.d.ts +0 -2
- package/dist/extensibility/facades/index.d.ts.map +0 -1
- package/dist/extensibility/facades/index.js +0 -18
- package/dist/extensibility/facades/index.js.map +0 -1
- package/dist/natives/INativeConfigAccess.d.ts +0 -8
- package/dist/natives/INativeConfigAccess.d.ts.map +0 -1
- package/dist/natives/INativeConfigAccess.js +0 -3
- package/dist/natives/INativeConfigAccess.js.map +0 -1
- package/dist/natives/INativeTranslationProvider.d.ts +0 -7
- package/dist/natives/INativeTranslationProvider.d.ts.map +0 -1
- package/dist/natives/INativeTranslationProvider.js +0 -3
- package/dist/natives/INativeTranslationProvider.js.map +0 -1
package/dist/AppRuntime.d.ts
CHANGED
@@ -1,18 +1,14 @@
|
|
1
1
|
import { IDatabaseConnection } from "@js-soft/docdb-access-abstractions";
|
2
2
|
import { LokiJsConnection } from "@js-soft/docdb-access-loki";
|
3
3
|
import { EventBus, Result } from "@js-soft/ts-utils";
|
4
|
-
import { ConsumptionController } from "@nmshd/consumption";
|
5
4
|
import { ICoreAddress } from "@nmshd/core-types";
|
6
|
-
import { ModuleConfiguration, Runtime, RuntimeHealth } from "@nmshd/runtime";
|
7
|
-
import { AccountController } from "@nmshd/transport";
|
5
|
+
import { ModuleConfiguration, Runtime, RuntimeHealth, RuntimeServices } from "@nmshd/runtime";
|
8
6
|
import { AppConfig, AppConfigOverwrite } from "./AppConfig";
|
9
|
-
import { AppRuntimeServices } from "./AppRuntimeServices";
|
10
7
|
import { AppStringProcessor } from "./AppStringProcessor";
|
11
8
|
import { IUIBridge } from "./extensibility";
|
12
9
|
import { IAppRuntimeModuleConstructor } from "./modules";
|
13
10
|
import { AccountServices, LocalAccountSession, MultiAccountController } from "./multiAccount";
|
14
|
-
import { INativeBootstrapper, INativeEnvironment
|
15
|
-
import { UserfriendlyResult } from "./UserfriendlyResult";
|
11
|
+
import { INativeBootstrapper, INativeEnvironment } from "./natives";
|
16
12
|
export declare class AppRuntime extends Runtime<AppConfig> {
|
17
13
|
private readonly _nativeEnvironment;
|
18
14
|
constructor(_nativeEnvironment: INativeEnvironment, appConfig: AppConfig, eventBus?: EventBus);
|
@@ -20,7 +16,7 @@ export declare class AppRuntime extends Runtime<AppConfig> {
|
|
20
16
|
private _uiBridge;
|
21
17
|
private _uiBridgeResolver?;
|
22
18
|
uiBridge(): Promise<IUIBridge> | IUIBridge;
|
23
|
-
registerUIBridge(uiBridge: IUIBridge):
|
19
|
+
registerUIBridge(uiBridge: IUIBridge): Result<void>;
|
24
20
|
protected readonly databaseConnection: LokiJsConnection;
|
25
21
|
private _multiAccountController;
|
26
22
|
get multiAccountController(): MultiAccountController;
|
@@ -31,8 +27,7 @@ export declare class AppRuntime extends Runtime<AppConfig> {
|
|
31
27
|
getSessions(): LocalAccountSession[];
|
32
28
|
private readonly _stringProcessor;
|
33
29
|
get stringProcessor(): AppStringProcessor;
|
34
|
-
|
35
|
-
getServices(accountReference: string | ICoreAddress): Promise<AppRuntimeServices>;
|
30
|
+
getServices(accountReference: string | ICoreAddress): Promise<RuntimeServices>;
|
36
31
|
selectAccount(accountReference: string): Promise<LocalAccountSession>;
|
37
32
|
getOrCreateSession(accountReference: string): Promise<LocalAccountSession>;
|
38
33
|
private currentSessionPromise;
|
@@ -49,8 +44,5 @@ export declare class AppRuntime extends Runtime<AppConfig> {
|
|
49
44
|
start(): Promise<void>;
|
50
45
|
stop(): Promise<void>;
|
51
46
|
private startAccounts;
|
52
|
-
private translationProvider;
|
53
|
-
registerTranslationProvider(provider: INativeTranslationProvider): void;
|
54
|
-
translate(key: string, ...values: any[]): Promise<Result<string>>;
|
55
47
|
}
|
56
48
|
//# sourceMappingURL=AppRuntime.d.ts.map
|
package/dist/AppRuntime.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AppRuntime.d.ts","sourceRoot":"","sources":["../src/AppRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;
|
1
|
+
{"version":3,"file":"AppRuntime.d.ts","sourceRoot":"","sources":["../src/AppRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,gBAAgB,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ppConfig_1 = require("./AppConfig");
|
|
10
10
|
const AppRuntimeErrors_1 = require("./AppRuntimeErrors");
|
11
11
|
const AppStringProcessor_1 = require("./AppStringProcessor");
|
12
12
|
const events_1 = require("./events");
|
13
|
-
const extensibility_1 = require("./extensibility");
|
14
13
|
const modules_1 = require("./modules");
|
15
14
|
const multiAccount_1 = require("./multiAccount");
|
16
15
|
const SessionStorage_1 = require("./SessionStorage");
|
17
|
-
const UserfriendlyResult_1 = require("./UserfriendlyResult");
|
18
16
|
class AppRuntime extends runtime_1.Runtime {
|
19
17
|
constructor(_nativeEnvironment, appConfig, eventBus) {
|
20
18
|
super(appConfig, _nativeEnvironment.loggerFactory, eventBus);
|
21
19
|
this._nativeEnvironment = _nativeEnvironment;
|
22
20
|
this.sessionStorage = new SessionStorage_1.SessionStorage();
|
23
|
-
this.translationProvider = {
|
24
|
-
translate: (key) => Promise.resolve(ts_utils_1.Result.ok(key))
|
25
|
-
};
|
26
21
|
this._stringProcessor = new AppStringProcessor_1.AppStringProcessor(this, this.loggerFactory);
|
27
22
|
}
|
28
23
|
get config() {
|
@@ -45,10 +40,10 @@ class AppRuntime extends runtime_1.Runtime {
|
|
45
40
|
}
|
46
41
|
registerUIBridge(uiBridge) {
|
47
42
|
if (this._uiBridge)
|
48
|
-
return
|
43
|
+
return ts_utils_1.Result.fail(AppRuntimeErrors_1.AppRuntimeErrors.startup.uiBridgeAlreadyRegistered());
|
49
44
|
this._uiBridge = uiBridge;
|
50
45
|
this._uiBridgeResolver?.resolve(uiBridge);
|
51
|
-
return
|
46
|
+
return ts_utils_1.Result.ok(undefined);
|
52
47
|
}
|
53
48
|
get multiAccountController() {
|
54
49
|
return this._multiAccountController;
|
@@ -65,17 +60,11 @@ class AppRuntime extends runtime_1.Runtime {
|
|
65
60
|
get stringProcessor() {
|
66
61
|
return this._stringProcessor;
|
67
62
|
}
|
68
|
-
async login(accountController, consumptionController) {
|
69
|
-
const services = await super.login(accountController, consumptionController);
|
70
|
-
const appServices = new extensibility_1.AppServices(this, services.transportServices, services.consumptionServices, services.dataViewExpander);
|
71
|
-
return { ...services, appServices };
|
72
|
-
}
|
73
63
|
async getServices(accountReference) {
|
74
64
|
const session = await this.getOrCreateSession(accountReference.toString());
|
75
65
|
return {
|
76
66
|
transportServices: session.transportServices,
|
77
67
|
consumptionServices: session.consumptionServices,
|
78
|
-
appServices: session.appServices,
|
79
68
|
dataViewExpander: session.expander
|
80
69
|
};
|
81
70
|
}
|
@@ -115,7 +104,9 @@ class AppRuntime extends runtime_1.Runtime {
|
|
115
104
|
async _createSession(accountId) {
|
116
105
|
const [localAccount, accountController] = await this._multiAccountController.selectAccount(core_types_1.CoreId.from(accountId));
|
117
106
|
if (!localAccount.address) {
|
118
|
-
|
107
|
+
const error = AppRuntimeErrors_1.AppRuntimeErrors.general.addressUnavailable();
|
108
|
+
this.logger.error(error);
|
109
|
+
throw error;
|
119
110
|
}
|
120
111
|
const consumptionController = await new consumption_1.ConsumptionController(this.transport, accountController, { setDefaultRepositoryAttributes: true }).init();
|
121
112
|
const services = await this.login(accountController, consumptionController);
|
@@ -126,7 +117,6 @@ class AppRuntime extends runtime_1.Runtime {
|
|
126
117
|
consumptionServices: services.consumptionServices,
|
127
118
|
transportServices: services.transportServices,
|
128
119
|
expander: services.dataViewExpander,
|
129
|
-
appServices: services.appServices,
|
130
120
|
accountController,
|
131
121
|
consumptionController
|
132
122
|
};
|
@@ -238,12 +228,6 @@ class AppRuntime extends runtime_1.Runtime {
|
|
238
228
|
this.logger.error(syncResult.error);
|
239
229
|
}
|
240
230
|
}
|
241
|
-
registerTranslationProvider(provider) {
|
242
|
-
this.translationProvider = provider;
|
243
|
-
}
|
244
|
-
async translate(key, ...values) {
|
245
|
-
return await this.translationProvider.translate(key, ...values);
|
246
|
-
}
|
247
231
|
}
|
248
232
|
exports.AppRuntime = AppRuntime;
|
249
233
|
//# sourceMappingURL=AppRuntime.js.map
|
package/dist/AppRuntime.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AppRuntime.js","sourceRoot":"","sources":["../src/AppRuntime.ts"],"names":[],"mappings":";;;AACA,kEAA8D;AAC9D,gDAAqD;AACrD,oDAA2D;AAC3D,kDAAyD;AACzD,
|
1
|
+
{"version":3,"file":"AppRuntime.js","sourceRoot":"","sources":["../src/AppRuntime.ts"],"names":[],"mappings":";;;AACA,kEAA8D;AAC9D,gDAAqD;AACrD,oDAA2D;AAC3D,kDAAyD;AACzD,4CAA8F;AAC9F,2CAA6E;AAC7E,yDAAsD;AACtD,6DAA0D;AAC1D,qCAAgD;AAEhD,uCAYmB;AACnB,iDAAkH;AAElH,qDAAkD;AAElD,MAAa,UAAW,SAAQ,iBAAkB;IAC9C,YACqB,kBAAsC,EACvD,SAAoB,EACpB,QAAmB;QAEnB,KAAK,CAAC,SAAS,EAAE,kBAAkB,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;QAJ5C,uBAAkB,GAAlB,kBAAkB,CAAoB;QAwD1C,mBAAc,GAAG,IAAI,+BAAc,EAAE,CAAC;QAlDnD,IAAI,CAAC,gBAAgB,GAAG,IAAI,uCAAkB,CAAC,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;IAC7E,CAAC;IAED,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAKM,QAAQ;QACX,IAAI,IAAI,CAAC,SAAS;YAAE,OAAO,IAAI,CAAC,SAAS,CAAC;QAE1C,IAAI,IAAI,CAAC,iBAAiB;YAAE,OAAO,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC;QAElE,IAAI,OAAO,GAAkC,GAAG,EAAE,CAAC,EAAE,CAAC;QACtD,MAAM,OAAO,GAAG,IAAI,OAAO,CAAY,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC;QAC7D,IAAI,CAAC,iBAAiB,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;QAE9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,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAChE,CAAC;IACL,CAAC;;AA7RL,gCA8RC"}
|
@@ -1,30 +1,30 @@
|
|
1
|
-
import {
|
1
|
+
import { ApplicationError } from "@js-soft/ts-utils";
|
2
2
|
declare class AppStringProcessor {
|
3
|
-
wrongURL():
|
4
|
-
wrongCode():
|
5
|
-
invalidReference():
|
6
|
-
notSupportedTokenContent():
|
7
|
-
deviceOnboardingNotAllowed():
|
8
|
-
passwordNotProvided():
|
9
|
-
passwordRetryLimitReached():
|
10
|
-
noDeviceOnboardingCode():
|
3
|
+
wrongURL(): ApplicationError;
|
4
|
+
wrongCode(): ApplicationError;
|
5
|
+
invalidReference(): ApplicationError;
|
6
|
+
notSupportedTokenContent(): ApplicationError;
|
7
|
+
deviceOnboardingNotAllowed(): ApplicationError;
|
8
|
+
passwordNotProvided(): ApplicationError;
|
9
|
+
passwordRetryLimitReached(): ApplicationError;
|
10
|
+
noDeviceOnboardingCode(): ApplicationError;
|
11
11
|
}
|
12
12
|
declare class General {
|
13
|
-
currentSessionUnavailable():
|
14
|
-
addressUnavailable():
|
15
|
-
appServicesUnavailable():
|
16
|
-
noAccountAvailable(error?: Error):
|
17
|
-
noAccountAvailableForIdentityTruncated():
|
13
|
+
currentSessionUnavailable(): ApplicationError;
|
14
|
+
addressUnavailable(): ApplicationError;
|
15
|
+
appServicesUnavailable(): ApplicationError;
|
16
|
+
noAccountAvailable(error?: Error): ApplicationError;
|
17
|
+
noAccountAvailableForIdentityTruncated(): ApplicationError;
|
18
18
|
}
|
19
19
|
declare class Startup {
|
20
|
-
bootstrapError(bootstrapError?: Error):
|
21
|
-
bootstrapperNotInitialized():
|
22
|
-
uiBridgeAlreadyRegistered():
|
20
|
+
bootstrapError(bootstrapError?: Error): ApplicationError;
|
21
|
+
bootstrapperNotInitialized(): ApplicationError;
|
22
|
+
uiBridgeAlreadyRegistered(): ApplicationError;
|
23
23
|
}
|
24
24
|
declare class PushNotificationModule {
|
25
|
-
subscriptionNotPossible(details: string, rootError?: Error):
|
26
|
-
unsubscriptionNotPossible(details: string, rootError?: Error):
|
27
|
-
tokenRegistrationNotPossible(details: string, rootError?: Error):
|
25
|
+
subscriptionNotPossible(details: string, rootError?: Error): ApplicationError;
|
26
|
+
unsubscriptionNotPossible(details: string, rootError?: Error): ApplicationError;
|
27
|
+
tokenRegistrationNotPossible(details: string, rootError?: Error): ApplicationError;
|
28
28
|
}
|
29
29
|
declare class Modules {
|
30
30
|
readonly pushNotificationModule: PushNotificationModule;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AppRuntimeErrors.d.ts","sourceRoot":"","sources":["../src/AppRuntimeErrors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"AppRuntimeErrors.d.ts","sourceRoot":"","sources":["../src/AppRuntimeErrors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,cAAM,kBAAkB;IACb,QAAQ,IAAI,gBAAgB;IAI5B,SAAS,IAAI,gBAAgB;IAI7B,gBAAgB,IAAI,gBAAgB;IAIpC,wBAAwB,IAAI,gBAAgB;IAI5C,0BAA0B,IAAI,gBAAgB;IAO9C,mBAAmB,IAAI,gBAAgB;IAIvC,yBAAyB,IAAI,gBAAgB;IAI7C,sBAAsB,IAAI,gBAAgB;CAMpD;AAED,cAAM,OAAO;IACF,yBAAyB,IAAI,gBAAgB;IAI7C,kBAAkB,IAAI,gBAAgB;IAOtC,sBAAsB,IAAI,gBAAgB;IAI1C,kBAAkB,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,gBAAgB;IAInD,sCAAsC,IAAI,gBAAgB;CAOpE;AAED,cAAM,OAAO;IACF,cAAc,CAAC,cAAc,CAAC,EAAE,KAAK,GAAG,gBAAgB;IAIxD,0BAA0B,IAAI,gBAAgB;IAI9C,yBAAyB,IAAI,gBAAgB;CAGvD;AAED,cAAM,sBAAsB;IACjB,uBAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,KAAK,GAAG,gBAAgB;IAQ7E,yBAAyB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,KAAK,GAAG,gBAAgB;IAQ/E,4BAA4B,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,KAAK,GAAG,gBAAgB;CAO5F;AAED,cAAM,OAAO;IACT,SAAgB,sBAAsB,yBAAgC;CACzE;AAED,qBAAa,gBAAgB;IACzB,gBAAuB,kBAAkB,qBAA4B;IACrE,gBAAuB,OAAO,UAAiB;IAC/C,gBAAuB,OAAO,UAAiB;IAC/C,gBAAuB,OAAO,UAAiB;CAClD"}
|
package/dist/AppRuntimeErrors.js
CHANGED
@@ -1,70 +1,70 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.AppRuntimeErrors = void 0;
|
4
|
-
const
|
4
|
+
const ts_utils_1 = require("@js-soft/ts-utils");
|
5
5
|
class AppStringProcessor {
|
6
6
|
wrongURL() {
|
7
|
-
return new
|
7
|
+
return new ts_utils_1.ApplicationError("error.appruntime.appStringProcessor.wrongURL", "The given URL is in a wrong format.");
|
8
8
|
}
|
9
9
|
wrongCode() {
|
10
|
-
return new
|
10
|
+
return new ts_utils_1.ApplicationError("error.appruntime.appStringProcessor.wrongCode", "The given code is in a wrong format.");
|
11
11
|
}
|
12
12
|
invalidReference() {
|
13
|
-
return new
|
13
|
+
return new ts_utils_1.ApplicationError("error.appruntime.appStringProcessor.invalidReference", "The given code does not contain a valid truncated reference.");
|
14
14
|
}
|
15
15
|
notSupportedTokenContent() {
|
16
|
-
return new
|
16
|
+
return new ts_utils_1.ApplicationError("error.appruntime.appStringProcessor.notSupportedTokenContent", "The scanned code is not supported in this context.");
|
17
17
|
}
|
18
18
|
deviceOnboardingNotAllowed() {
|
19
|
-
return new
|
19
|
+
return new ts_utils_1.ApplicationError("error.appruntime.appStringProcessor.deviceOnboardingNotAllowed", "The Token contains a device onboarding info, but this is not allowed in this context.");
|
20
20
|
}
|
21
21
|
passwordNotProvided() {
|
22
|
-
return new
|
22
|
+
return new ts_utils_1.ApplicationError("error.appruntime.appStringProcessor.passwordNotProvided", "No password was provided.");
|
23
23
|
}
|
24
24
|
passwordRetryLimitReached() {
|
25
|
-
return new
|
25
|
+
return new ts_utils_1.ApplicationError("error.appruntime.appStringProcessor.passwordRetryLimitReached", "The maximum number of attempts to enter the password was reached.");
|
26
26
|
}
|
27
27
|
noDeviceOnboardingCode() {
|
28
|
-
return new
|
28
|
+
return new ts_utils_1.ApplicationError("error.appruntime.appStringProcessor.noDeviceOnboardingCode", "The scanned code does not contain a device onboarding info, but this scanner is only able to process device onboarding codes.");
|
29
29
|
}
|
30
30
|
}
|
31
31
|
class General {
|
32
32
|
currentSessionUnavailable() {
|
33
|
-
return new
|
33
|
+
return new ts_utils_1.ApplicationError("error.appruntime.general.currentSessionUnavailable", "The currentSession is not available. Try to execute login before this operation.");
|
34
34
|
}
|
35
35
|
addressUnavailable() {
|
36
|
-
return new
|
36
|
+
return new ts_utils_1.ApplicationError("error.appruntime.general.addressUnavailable", "The address of the account is not available. This might be a permanent problem caused by a failed login.");
|
37
37
|
}
|
38
38
|
appServicesUnavailable() {
|
39
|
-
return new
|
39
|
+
return new ts_utils_1.ApplicationError("error.appruntime.general.appServicesUnavailable", "The app services are not available. Try to execute login before this operation.");
|
40
40
|
}
|
41
41
|
noAccountAvailable(error) {
|
42
|
-
return new
|
42
|
+
return new ts_utils_1.ApplicationError("error.appruntime.general.noAccountAvailable", "There is no account available for this action.", error);
|
43
43
|
}
|
44
44
|
noAccountAvailableForIdentityTruncated() {
|
45
|
-
return new
|
45
|
+
return new ts_utils_1.ApplicationError("error.appruntime.general.noAccountAvailableForIdentityTruncated", "There is no account matching the given 'forIdentityTruncated'.", "It seems no eligible account is available for this action, because the scanned code is intended for a specific Identity that is not available on this device.");
|
46
46
|
}
|
47
47
|
}
|
48
48
|
class Startup {
|
49
49
|
bootstrapError(bootstrapError) {
|
50
|
-
return new
|
50
|
+
return new ts_utils_1.ApplicationError("error.runtime.startup.BootstrapError", "There was an error while bootstrapping.", bootstrapError);
|
51
51
|
}
|
52
52
|
bootstrapperNotInitialized() {
|
53
|
-
return new
|
53
|
+
return new ts_utils_1.ApplicationError("error.runtime.startup.BootstrapNotInitialized", "The given bootstrapper is not initialized.");
|
54
54
|
}
|
55
55
|
uiBridgeAlreadyRegistered() {
|
56
|
-
return new
|
56
|
+
return new ts_utils_1.ApplicationError("error.appruntime.startup.uiBridgeAlreadyRegistered", "The UI bridge was already registered for this Runtime instance.");
|
57
57
|
}
|
58
58
|
}
|
59
59
|
class PushNotificationModule {
|
60
60
|
subscriptionNotPossible(details, rootError) {
|
61
|
-
return new
|
61
|
+
return new ts_utils_1.ApplicationError("error.runtime.module.PushNotificationModule.SubscriptionNotPossible", `Subscribing to the NativeEventBus was not possible. Root cause: '${details}'`, rootError);
|
62
62
|
}
|
63
63
|
unsubscriptionNotPossible(details, rootError) {
|
64
|
-
return new
|
64
|
+
return new ts_utils_1.ApplicationError("error.runtime.module.PushNotificationModule.UnsubscriptionNotPossible", `Unsubscribing from the NativeEventBus was not possible. Root cause: '${details}'`, rootError);
|
65
65
|
}
|
66
66
|
tokenRegistrationNotPossible(details, rootError) {
|
67
|
-
return new
|
67
|
+
return new ts_utils_1.ApplicationError("error.runtime.module.PushNotificationModule.TokenRegistrationNotPossible", `Registering the Push Notification Token for the account was not possible. Root cause: '${details}'`, rootError);
|
68
68
|
}
|
69
69
|
}
|
70
70
|
class Modules {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AppRuntimeErrors.js","sourceRoot":"","sources":["../src/AppRuntimeErrors.ts"],"names":[],"mappings":";;;AAAA,
|
1
|
+
{"version":3,"file":"AppRuntimeErrors.js","sourceRoot":"","sources":["../src/AppRuntimeErrors.ts"],"names":[],"mappings":";;;AAAA,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abstractions";
|
2
2
|
import { EventBus, Result } from "@js-soft/ts-utils";
|
3
3
|
import { ICoreAddress } from "@nmshd/core-types";
|
4
|
-
import { AnonymousServices } from "@nmshd/runtime";
|
5
|
-
import { AppRuntimeServices } from "./AppRuntimeServices";
|
4
|
+
import { AnonymousServices, RuntimeServices } from "@nmshd/runtime";
|
6
5
|
import { IUIBridge } from "./extensibility";
|
7
6
|
import { AccountServices, LocalAccountDTO, LocalAccountSession } from "./multiAccount";
|
8
|
-
import { UserfriendlyResult } from "./UserfriendlyResult";
|
9
7
|
export declare class AppStringProcessor {
|
10
8
|
protected readonly runtime: {
|
11
9
|
get anonymousServices(): AnonymousServices;
|
12
10
|
get accountServices(): AccountServices;
|
13
11
|
uiBridge(): Promise<IUIBridge> | IUIBridge;
|
14
|
-
getServices(accountReference: string | ICoreAddress): Promise<
|
15
|
-
translate(key: string, ...values: any[]): Promise<Result<string>>;
|
12
|
+
getServices(accountReference: string | ICoreAddress): Promise<RuntimeServices>;
|
16
13
|
get eventBus(): EventBus;
|
17
14
|
selectAccount(accountReference: string): Promise<LocalAccountSession>;
|
18
15
|
};
|
@@ -21,16 +18,15 @@ export declare class AppStringProcessor {
|
|
21
18
|
get anonymousServices(): AnonymousServices;
|
22
19
|
get accountServices(): AccountServices;
|
23
20
|
uiBridge(): Promise<IUIBridge> | IUIBridge;
|
24
|
-
getServices(accountReference: string | ICoreAddress): Promise<
|
25
|
-
translate(key: string, ...values: any[]): Promise<Result<string>>;
|
21
|
+
getServices(accountReference: string | ICoreAddress): Promise<RuntimeServices>;
|
26
22
|
get eventBus(): EventBus;
|
27
23
|
selectAccount(accountReference: string): Promise<LocalAccountSession>;
|
28
24
|
}, loggerFactory: ILoggerFactory);
|
29
|
-
processURL(url: string, account?: LocalAccountDTO): Promise<
|
30
|
-
processReference(referenceString: string, account?: LocalAccountDTO): Promise<
|
25
|
+
processURL(url: string, account?: LocalAccountDTO): Promise<Result<void>>;
|
26
|
+
processReference(referenceString: string, account?: LocalAccountDTO): Promise<Result<void>>;
|
31
27
|
private _processReference;
|
32
28
|
private _handleReference;
|
33
|
-
processDeviceOnboardingReference(url: string): Promise<
|
29
|
+
processDeviceOnboardingReference(url: string): Promise<Result<void>>;
|
34
30
|
private parseTokenContent;
|
35
31
|
private _fetchPasswordProtectedItemWithRetry;
|
36
32
|
private selectAccount;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AppStringProcessor.d.ts","sourceRoot":"","sources":["../src/AppStringProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAExE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAuC,MAAM,mBAAmB,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAgB,
|
1
|
+
{"version":3,"file":"AppStringProcessor.d.ts","sourceRoot":"","sources":["../src/AppStringProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAExE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAuC,MAAM,mBAAmB,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAgB,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGlF,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAEvF,qBAAa,kBAAkB;IAIvB,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE;QACxB,IAAI,iBAAiB,IAAI,iBAAiB,CAAC;QAC3C,IAAI,eAAe,IAAI,eAAe,CAAC;QACvC,QAAQ,IAAI,OAAO,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;QAC3C,WAAW,CAAC,gBAAgB,EAAE,MAAM,GAAG,YAAY,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;QAC/E,IAAI,QAAQ,IAAI,QAAQ,CAAC;QACzB,aAAa,CAAC,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;KACzE;IAVL,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAU;gBAGV,OAAO,EAAE;QACxB,IAAI,iBAAiB,IAAI,iBAAiB,CAAC;QAC3C,IAAI,eAAe,IAAI,eAAe,CAAC;QACvC,QAAQ,IAAI,OAAO,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;QAC3C,WAAW,CAAC,gBAAgB,EAAE,MAAM,GAAG,YAAY,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;QAC/E,IAAI,QAAQ,IAAI,QAAQ,CAAC;QACzB,aAAa,CAAC,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;KACzE,EACD,aAAa,EAAE,cAAc;IAKpB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAUzE,gBAAgB,CAAC,eAAe,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAS1F,iBAAiB;YA4DjB,gBAAgB;IAsCjB,gCAAgC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAqCjF,OAAO,CAAC,iBAAiB;YASX,oCAAoC;YAmCpC,aAAa;YAgBb,6BAA6B;CAU9C"}
|
@@ -2,12 +2,11 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.AppStringProcessor = void 0;
|
4
4
|
const ts_serval_1 = require("@js-soft/ts-serval");
|
5
|
+
const ts_utils_1 = require("@js-soft/ts-utils");
|
5
6
|
const core_types_1 = require("@nmshd/core-types");
|
6
7
|
const runtime_1 = require("@nmshd/runtime");
|
7
8
|
const transport_1 = require("@nmshd/transport");
|
8
9
|
const AppRuntimeErrors_1 = require("./AppRuntimeErrors");
|
9
|
-
const UserfriendlyApplicationError_1 = require("./UserfriendlyApplicationError");
|
10
|
-
const UserfriendlyResult_1 = require("./UserfriendlyResult");
|
11
10
|
class AppStringProcessor {
|
12
11
|
constructor(runtime, loggerFactory) {
|
13
12
|
this.runtime = runtime;
|
@@ -18,7 +17,7 @@ class AppStringProcessor {
|
|
18
17
|
const parsed = new URL(url);
|
19
18
|
const allowedProtocols = ["http:", "https:", "nmshd:"];
|
20
19
|
if (!allowedProtocols.includes(parsed.protocol))
|
21
|
-
return
|
20
|
+
return ts_utils_1.Result.fail(AppRuntimeErrors_1.AppRuntimeErrors.appStringProcessor.wrongURL());
|
22
21
|
return await this.processReference(url, account);
|
23
22
|
}
|
24
23
|
async processReference(referenceString, account) {
|
@@ -27,7 +26,7 @@ class AppStringProcessor {
|
|
27
26
|
return await this._processReference(reference, account);
|
28
27
|
}
|
29
28
|
catch (_) {
|
30
|
-
return
|
29
|
+
return ts_utils_1.Result.fail(AppRuntimeErrors_1.AppRuntimeErrors.appStringProcessor.invalidReference());
|
31
30
|
}
|
32
31
|
}
|
33
32
|
async _processReference(reference, account) {
|
@@ -38,43 +37,42 @@ class AppStringProcessor {
|
|
38
37
|
const result = await this.selectAccount(reference.forIdentityTruncated);
|
39
38
|
if (result.isError) {
|
40
39
|
this.logger.info("Could not query account", result.error);
|
41
|
-
return
|
40
|
+
return ts_utils_1.Result.fail(result.error);
|
42
41
|
}
|
43
42
|
if (!result.value) {
|
44
43
|
this.logger.info("User cancelled account selection");
|
45
|
-
return
|
44
|
+
return ts_utils_1.Result.ok(undefined);
|
46
45
|
}
|
47
46
|
return await this._handleReference(reference, result.value);
|
48
47
|
}
|
49
48
|
if (!reference.id.toString().startsWith("TOK")) {
|
50
49
|
const error = AppRuntimeErrors_1.AppRuntimeErrors.appStringProcessor.wrongCode();
|
51
|
-
return
|
50
|
+
return ts_utils_1.Result.fail(error);
|
52
51
|
}
|
53
52
|
const tokenResultHolder = reference.passwordProtection
|
54
53
|
? await this._fetchPasswordProtectedItemWithRetry(async (password) => await this.runtime.anonymousServices.tokens.loadPeerToken({ reference: reference.truncate(), password }), reference.passwordProtection)
|
55
54
|
: { result: await this.runtime.anonymousServices.tokens.loadPeerToken({ reference: reference.truncate() }) };
|
56
55
|
if (tokenResultHolder.result.isError && tokenResultHolder.result.error.equals(AppRuntimeErrors_1.AppRuntimeErrors.appStringProcessor.passwordNotProvided())) {
|
57
|
-
return
|
58
|
-
}
|
59
|
-
if (tokenResultHolder.result.isError) {
|
60
|
-
return UserfriendlyResult_1.UserfriendlyResult.fail(UserfriendlyApplicationError_1.UserfriendlyApplicationError.fromError(tokenResultHolder.result.error));
|
56
|
+
return ts_utils_1.Result.ok(undefined);
|
61
57
|
}
|
58
|
+
if (tokenResultHolder.result.isError)
|
59
|
+
return ts_utils_1.Result.fail(tokenResultHolder.result.error);
|
62
60
|
const tokenDTO = tokenResultHolder.result.value;
|
63
61
|
const tokenContent = this.parseTokenContent(tokenDTO.content);
|
64
62
|
if (!tokenContent) {
|
65
63
|
const error = AppRuntimeErrors_1.AppRuntimeErrors.appStringProcessor.wrongCode();
|
66
|
-
return
|
64
|
+
return ts_utils_1.Result.fail(error);
|
67
65
|
}
|
68
66
|
if (tokenContent instanceof transport_1.TokenContentDeviceSharedSecret)
|
69
|
-
return
|
67
|
+
return ts_utils_1.Result.fail(AppRuntimeErrors_1.AppRuntimeErrors.appStringProcessor.deviceOnboardingNotAllowed());
|
70
68
|
const accountSelectionResult = await this.selectAccount(reference.forIdentityTruncated);
|
71
69
|
if (accountSelectionResult.isError) {
|
72
|
-
return
|
70
|
+
return ts_utils_1.Result.fail(accountSelectionResult.error);
|
73
71
|
}
|
74
72
|
const selectedAccount = accountSelectionResult.value;
|
75
73
|
if (!selectedAccount) {
|
76
74
|
this.logger.info("User cancelled account selection");
|
77
|
-
return
|
75
|
+
return ts_utils_1.Result.ok(undefined);
|
78
76
|
}
|
79
77
|
return await this._handleReference(reference, selectedAccount, tokenResultHolder.password);
|
80
78
|
}
|
@@ -85,10 +83,10 @@ class AppStringProcessor {
|
|
85
83
|
? (await this._fetchPasswordProtectedItemWithRetry(async (password) => await services.transportServices.account.loadItemFromReference({ reference: reference.truncate(), password }), reference.passwordProtection)).result
|
86
84
|
: await services.transportServices.account.loadItemFromReference({ reference: reference.truncate(), password: existingPassword });
|
87
85
|
if (result.isError && result.error.equals(AppRuntimeErrors_1.AppRuntimeErrors.appStringProcessor.passwordNotProvided())) {
|
88
|
-
return
|
86
|
+
return ts_utils_1.Result.ok(undefined);
|
89
87
|
}
|
90
88
|
if (result.isError) {
|
91
|
-
return
|
89
|
+
return ts_utils_1.Result.fail(result.error);
|
92
90
|
}
|
93
91
|
switch (result.value.type) {
|
94
92
|
case "File":
|
@@ -99,11 +97,11 @@ class AppStringProcessor {
|
|
99
97
|
// RelationshipTemplates are processed by the RequestModule
|
100
98
|
break;
|
101
99
|
case "Token":
|
102
|
-
return
|
100
|
+
return ts_utils_1.Result.fail(AppRuntimeErrors_1.AppRuntimeErrors.appStringProcessor.notSupportedTokenContent());
|
103
101
|
case "DeviceOnboardingInfo":
|
104
|
-
return
|
102
|
+
return ts_utils_1.Result.fail(AppRuntimeErrors_1.AppRuntimeErrors.appStringProcessor.deviceOnboardingNotAllowed());
|
105
103
|
}
|
106
|
-
return
|
104
|
+
return ts_utils_1.Result.ok(undefined);
|
107
105
|
}
|
108
106
|
async processDeviceOnboardingReference(url) {
|
109
107
|
url = url.trim();
|
@@ -112,26 +110,26 @@ class AppStringProcessor {
|
|
112
110
|
reference = core_types_1.Reference.from(url);
|
113
111
|
}
|
114
112
|
catch (_) {
|
115
|
-
return
|
113
|
+
return ts_utils_1.Result.fail(AppRuntimeErrors_1.AppRuntimeErrors.appStringProcessor.invalidReference());
|
116
114
|
}
|
117
115
|
if (!reference.id.toString().startsWith("TOK"))
|
118
|
-
return
|
116
|
+
return ts_utils_1.Result.fail(AppRuntimeErrors_1.AppRuntimeErrors.appStringProcessor.noDeviceOnboardingCode());
|
119
117
|
const tokenResultHolder = reference.passwordProtection
|
120
118
|
? await this._fetchPasswordProtectedItemWithRetry(async (password) => await this.runtime.anonymousServices.tokens.loadPeerToken({ reference: reference.truncate(), password }), reference.passwordProtection)
|
121
119
|
: { result: await this.runtime.anonymousServices.tokens.loadPeerToken({ reference: reference.truncate() }) };
|
122
120
|
if (tokenResultHolder.result.isError && tokenResultHolder.result.error.equals(AppRuntimeErrors_1.AppRuntimeErrors.appStringProcessor.passwordNotProvided())) {
|
123
|
-
return
|
121
|
+
return ts_utils_1.Result.ok(undefined);
|
124
122
|
}
|
125
123
|
if (tokenResultHolder.result.isError) {
|
126
|
-
return
|
124
|
+
return ts_utils_1.Result.fail(tokenResultHolder.result.error);
|
127
125
|
}
|
128
126
|
const tokenDTO = tokenResultHolder.result.value;
|
129
127
|
const tokenContent = this.parseTokenContent(tokenDTO.content);
|
130
128
|
if (!(tokenContent instanceof transport_1.TokenContentDeviceSharedSecret))
|
131
|
-
return
|
129
|
+
return ts_utils_1.Result.fail(AppRuntimeErrors_1.AppRuntimeErrors.appStringProcessor.noDeviceOnboardingCode());
|
132
130
|
const uiBridge = await this.runtime.uiBridge();
|
133
131
|
await uiBridge.showDeviceOnboarding(runtime_1.DeviceMapper.toDeviceOnboardingInfoDTO(tokenContent.sharedSecret));
|
134
|
-
return
|
132
|
+
return ts_utils_1.Result.ok(undefined);
|
135
133
|
}
|
136
134
|
parseTokenContent(content) {
|
137
135
|
try {
|
@@ -149,7 +147,7 @@ class AppStringProcessor {
|
|
149
147
|
while (attempt <= maxRetries) {
|
150
148
|
const passwordResult = await uiBridge.enterPassword(passwordProtection.passwordType === "pw" ? "pw" : "pin", passwordProtection.passwordType.startsWith("pin") ? parseInt(passwordProtection.passwordType.substring(3)) : undefined, attempt, passwordProtection.passwordLocationIndicator);
|
151
149
|
if (passwordResult.isError) {
|
152
|
-
return { result:
|
150
|
+
return { result: ts_utils_1.Result.fail(AppRuntimeErrors_1.AppRuntimeErrors.appStringProcessor.passwordNotProvided()) };
|
153
151
|
}
|
154
152
|
const password = passwordResult.value;
|
155
153
|
const result = await fetchFunction(password);
|
@@ -161,7 +159,7 @@ class AppStringProcessor {
|
|
161
159
|
return { result };
|
162
160
|
}
|
163
161
|
return {
|
164
|
-
result:
|
162
|
+
result: ts_utils_1.Result.fail(AppRuntimeErrors_1.AppRuntimeErrors.appStringProcessor.passwordRetryLimitReached())
|
165
163
|
};
|
166
164
|
}
|
167
165
|
async selectAccount(forIdentityTruncated) {
|
@@ -172,9 +170,9 @@ class AppStringProcessor {
|
|
172
170
|
return await this.requestManualAccountSelection(accounts, title, description);
|
173
171
|
const accountsWithPostfix = accounts.filter((account) => account.address?.endsWith(forIdentityTruncated));
|
174
172
|
if (accountsWithPostfix.length === 0)
|
175
|
-
return
|
173
|
+
return ts_utils_1.Result.fail(AppRuntimeErrors_1.AppRuntimeErrors.general.noAccountAvailableForIdentityTruncated());
|
176
174
|
if (accountsWithPostfix.length === 1)
|
177
|
-
return
|
175
|
+
return ts_utils_1.Result.ok(accountsWithPostfix[0]);
|
178
176
|
// This catches the extremely rare case where two accounts are available that have the same last 4 characters in their address. In that case
|
179
177
|
// the user will have to decide which account to use, which could not work because it is not the exactly same address specified when personalizing the object.
|
180
178
|
return await this.requestManualAccountSelection(accountsWithPostfix, title, description);
|
@@ -183,11 +181,11 @@ class AppStringProcessor {
|
|
183
181
|
const uiBridge = await this.runtime.uiBridge();
|
184
182
|
const accountSelectionResult = await uiBridge.requestAccountSelection(accounts, title, description);
|
185
183
|
if (accountSelectionResult.isError) {
|
186
|
-
return
|
184
|
+
return ts_utils_1.Result.fail(AppRuntimeErrors_1.AppRuntimeErrors.general.noAccountAvailable(accountSelectionResult.error));
|
187
185
|
}
|
188
186
|
if (accountSelectionResult.value)
|
189
187
|
await this.runtime.selectAccount(accountSelectionResult.value.id);
|
190
|
-
return
|
188
|
+
return ts_utils_1.Result.ok(accountSelectionResult.value);
|
191
189
|
}
|
192
190
|
}
|
193
191
|
exports.AppStringProcessor = AppStringProcessor;
|