@nmshd/app-runtime 2.2.3 → 2.3.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/AppConfig.js +6 -0
- package/dist/AppConfig.js.map +1 -1
- package/dist/AppRuntime.d.ts +9 -8
- package/dist/AppRuntime.js +20 -24
- package/dist/AppRuntime.js.map +1 -1
- package/dist/AppRuntimeServices.d.ts +5 -0
- package/dist/AppRuntimeServices.js +3 -0
- package/dist/AppRuntimeServices.js.map +1 -0
- package/dist/AppStringProcessor.d.ts +32 -0
- package/dist/AppStringProcessor.js +121 -0
- package/dist/AppStringProcessor.js.map +1 -0
- package/dist/UserfriendlyApplicationError.d.ts +1 -1
- package/dist/UserfriendlyApplicationError.js.map +1 -1
- package/dist/buildInformation.js +5 -5
- package/dist/extensibility/AppServices.d.ts +1 -2
- package/dist/extensibility/AppServices.js +0 -1
- package/dist/extensibility/AppServices.js.map +1 -1
- package/dist/extensibility/facades/index.d.ts +0 -1
- package/dist/extensibility/facades/index.js +0 -1
- package/dist/extensibility/facades/index.js.map +1 -1
- package/dist/extensibility/ui/IUIBridge.d.ts +6 -6
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/modules/appEvents/AppLaunchModule.js +1 -1
- package/dist/modules/appEvents/AppLaunchModule.js.map +1 -1
- package/dist/modules/appEvents/OnboardingChangeReceivedModule.js +2 -1
- package/dist/modules/appEvents/OnboardingChangeReceivedModule.js.map +1 -1
- package/dist/modules/appEvents/RelationshipTemplateProcessedModule.d.ts +9 -0
- package/dist/modules/appEvents/RelationshipTemplateProcessedModule.js +58 -0
- package/dist/modules/appEvents/RelationshipTemplateProcessedModule.js.map +1 -0
- package/dist/modules/appEvents/index.d.ts +1 -0
- package/dist/modules/appEvents/index.js +1 -0
- package/dist/modules/appEvents/index.js.map +1 -1
- package/dist/multiAccount/AccountServices.d.ts +2 -0
- package/dist/multiAccount/AccountServices.js +8 -0
- package/dist/multiAccount/AccountServices.js.map +1 -1
- package/lib-web/nmshd.app-runtime.js +256 -116
- package/lib-web/nmshd.app-runtime.min.js +1 -1
- package/package.json +5 -5
- package/dist/extensibility/facades/AppStringProcessorFacade.d.ts +0 -9
- package/dist/extensibility/facades/AppStringProcessorFacade.js +0 -73
- package/dist/extensibility/facades/AppStringProcessorFacade.js.map +0 -1
package/dist/AppConfig.js
CHANGED
|
@@ -47,6 +47,12 @@ function createAppConfig(...configs) {
|
|
|
47
47
|
location: "relationshipChanged",
|
|
48
48
|
enabled: true
|
|
49
49
|
},
|
|
50
|
+
relationshipTemplateProcessed: {
|
|
51
|
+
name: "relationshipTemplateProcessed",
|
|
52
|
+
displayName: "Relationship Template Processed",
|
|
53
|
+
location: "relationshipTemplateProcessed",
|
|
54
|
+
enabled: true
|
|
55
|
+
},
|
|
50
56
|
decider: {
|
|
51
57
|
displayName: "Decider Module",
|
|
52
58
|
name: "DeciderModule",
|
package/dist/AppConfig.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppConfig.js","sourceRoot":"","sources":["../src/AppConfig.ts"],"names":[],"mappings":";;;AACA,gDAA0D;AAC1D,mCAAqC;AAarC,SAAgB,eAAe,CAAC,GAAG,OAA6B;IAC5D,MAAM,SAAS,GAAG;QACd,cAAc,EAAE,UAAU;QAC1B,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,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,IAAI,EAAE,eAAe;gBACrB,QAAQ,EAAE,8BAA8B;gBACxC,OAAO,EAAE,IAAI;aAChB;YACD,iBAAiB,EAAE;gBACf,OAAO,EAAE,IAAI;gBACb,IAAI,EAAE,yBAAyB;gBAC/B,WAAW,EAAE,oBAAoB;gBACjC,QAAQ,EAAE,wCAAwC;aACrD;SACJ;KACJ,CAAA;IAED,MAAM,YAAY,GAAG,IAAA,qBAAY,EAAC,EAAE,EAAE,GAAG,OAAO,EAAE,SAAS,CAAC,CAAA;IAE5D,OAAO,YAAY,CAAA;AACvB,CAAC;AA1ED,0CA0EC"}
|
package/dist/AppRuntime.d.ts
CHANGED
|
@@ -2,16 +2,15 @@ import { IDatabaseConnection } from "@js-soft/docdb-access-abstractions";
|
|
|
2
2
|
import { INativeBootstrapper, INativeEnvironment, INativeTranslationProvider } from "@js-soft/native-abstractions";
|
|
3
3
|
import { Result } from "@js-soft/ts-utils";
|
|
4
4
|
import { ConsumptionController } from "@nmshd/consumption";
|
|
5
|
-
import { ModuleConfiguration, Runtime, RuntimeHealth
|
|
5
|
+
import { ModuleConfiguration, Runtime, RuntimeHealth } from "@nmshd/runtime";
|
|
6
6
|
import { AccountController, ICoreAddress } from "@nmshd/transport";
|
|
7
7
|
import { AppConfig, AppConfigOverwrite } from "./AppConfig";
|
|
8
|
-
import {
|
|
8
|
+
import { AppRuntimeServices } from "./AppRuntimeServices";
|
|
9
|
+
import { AppStringProcessor } from "./AppStringProcessor";
|
|
10
|
+
import { IUIBridge } from "./extensibility";
|
|
9
11
|
import { IAppRuntimeModuleConstructor } from "./modules";
|
|
10
12
|
import { AccountServices, LocalAccountDTO, LocalAccountSession, MultiAccountController } from "./multiAccount";
|
|
11
13
|
import { UserfriendlyResult } from "./UserfriendlyResult";
|
|
12
|
-
export interface AppRuntimeServices extends RuntimeServices {
|
|
13
|
-
appServices: AppServices;
|
|
14
|
-
}
|
|
15
14
|
export declare class AppRuntime extends Runtime<AppConfig> {
|
|
16
15
|
private readonly _nativeEnvironment;
|
|
17
16
|
constructor(_nativeEnvironment: INativeEnvironment, appConfig: AppConfig);
|
|
@@ -29,14 +28,16 @@ export declare class AppRuntime extends Runtime<AppConfig> {
|
|
|
29
28
|
get currentAccount(): LocalAccountDTO;
|
|
30
29
|
get currentSession(): LocalAccountSession;
|
|
31
30
|
getSessions(): LocalAccountSession[];
|
|
31
|
+
private readonly _stringProcessor;
|
|
32
|
+
get stringProcessor(): AppStringProcessor;
|
|
32
33
|
protected login(accountController: AccountController, consumptionController: ConsumptionController): Promise<AppRuntimeServices>;
|
|
33
|
-
getServices(
|
|
34
|
-
selectAccount(
|
|
34
|
+
getServices(accountReference: string | ICoreAddress): Promise<AppRuntimeServices>;
|
|
35
|
+
selectAccount(accountReference: string, _password: string): Promise<LocalAccountSession>;
|
|
35
36
|
getOrCreateSession(accountReference: string): Promise<LocalAccountSession>;
|
|
36
37
|
private currentSessionPromise;
|
|
37
38
|
private createSession;
|
|
38
39
|
private _createSession;
|
|
39
|
-
|
|
40
|
+
requestAccountSelection(title?: string, description?: string): Promise<UserfriendlyResult<LocalAccountDTO | undefined>>;
|
|
40
41
|
selectRelationship(id?: string): Promise<void>;
|
|
41
42
|
getHealth(): Promise<RuntimeHealth>;
|
|
42
43
|
protected initAccount(): Promise<void>;
|
package/dist/AppRuntime.js
CHANGED
|
@@ -8,6 +8,7 @@ const runtime_1 = require("@nmshd/runtime");
|
|
|
8
8
|
const transport_1 = require("@nmshd/transport");
|
|
9
9
|
const AppConfig_1 = require("./AppConfig");
|
|
10
10
|
const AppRuntimeErrors_1 = require("./AppRuntimeErrors");
|
|
11
|
+
const AppStringProcessor_1 = require("./AppStringProcessor");
|
|
11
12
|
const events_1 = require("./events");
|
|
12
13
|
const extensibility_1 = require("./extensibility");
|
|
13
14
|
const modules_1 = require("./modules");
|
|
@@ -22,6 +23,7 @@ class AppRuntime extends runtime_1.Runtime {
|
|
|
22
23
|
this.translationProvider = {
|
|
23
24
|
translate: (key) => Promise.resolve(ts_utils_1.Result.ok(key))
|
|
24
25
|
};
|
|
26
|
+
this._stringProcessor = new AppStringProcessor_1.AppStringProcessor(this, this.loggerFactory);
|
|
25
27
|
}
|
|
26
28
|
async uiBridge() {
|
|
27
29
|
if (this._uiBridge)
|
|
@@ -64,14 +66,16 @@ class AppRuntime extends runtime_1.Runtime {
|
|
|
64
66
|
getSessions() {
|
|
65
67
|
return this.sessionStorage.getSessions();
|
|
66
68
|
}
|
|
69
|
+
get stringProcessor() {
|
|
70
|
+
return this._stringProcessor;
|
|
71
|
+
}
|
|
67
72
|
async login(accountController, consumptionController) {
|
|
68
73
|
const services = await super.login(accountController, consumptionController);
|
|
69
74
|
const appServices = new extensibility_1.AppServices(this, services.transportServices, services.consumptionServices, services.dataViewExpander);
|
|
70
75
|
return { ...services, appServices };
|
|
71
76
|
}
|
|
72
|
-
async getServices(
|
|
73
|
-
const
|
|
74
|
-
const session = await this.getOrCreateSession(addressString);
|
|
77
|
+
async getServices(accountReference) {
|
|
78
|
+
const session = await this.getOrCreateSession(accountReference.toString());
|
|
75
79
|
return {
|
|
76
80
|
transportServices: session.transportServices,
|
|
77
81
|
consumptionServices: session.consumptionServices,
|
|
@@ -79,8 +83,8 @@ class AppRuntime extends runtime_1.Runtime {
|
|
|
79
83
|
dataViewExpander: session.expander
|
|
80
84
|
};
|
|
81
85
|
}
|
|
82
|
-
async selectAccount(
|
|
83
|
-
const session = await this.getOrCreateSession(
|
|
86
|
+
async selectAccount(accountReference, _password) {
|
|
87
|
+
const session = await this.getOrCreateSession(accountReference);
|
|
84
88
|
this.sessionStorage.currentSession = session;
|
|
85
89
|
this.eventBus.publish(new events_1.AccountSelectedEvent(session.address, session.account.id));
|
|
86
90
|
return session;
|
|
@@ -135,24 +139,16 @@ class AppRuntime extends runtime_1.Runtime {
|
|
|
135
139
|
this.sessionStorage.addSession(session);
|
|
136
140
|
return session;
|
|
137
141
|
}
|
|
138
|
-
async
|
|
139
|
-
let selectedAccount;
|
|
142
|
+
async requestAccountSelection(title = "i18n://uibridge.accountSelection.title", description = "i18n://uibridge.accountSelection.description") {
|
|
140
143
|
const accounts = await this.accountServices.getAccounts();
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
return UserfriendlyResult_1.UserfriendlyResult.fail(AppRuntimeErrors_1.AppRuntimeErrors.general.noAccountAvailable(accountSelectionResult.error));
|
|
146
|
-
}
|
|
147
|
-
selectedAccount = accountSelectionResult.value;
|
|
148
|
-
}
|
|
149
|
-
else if (accounts.length === 1) {
|
|
150
|
-
selectedAccount = accounts[0];
|
|
151
|
-
}
|
|
152
|
-
else {
|
|
153
|
-
return UserfriendlyResult_1.UserfriendlyResult.fail(AppRuntimeErrors_1.AppRuntimeErrors.general.noAccountAvailable());
|
|
144
|
+
const bridge = await this.uiBridge();
|
|
145
|
+
const accountSelectionResult = await bridge.requestAccountSelection(accounts, title, description);
|
|
146
|
+
if (accountSelectionResult.isError) {
|
|
147
|
+
return UserfriendlyResult_1.UserfriendlyResult.fail(AppRuntimeErrors_1.AppRuntimeErrors.general.noAccountAvailable(accountSelectionResult.error));
|
|
154
148
|
}
|
|
155
|
-
|
|
149
|
+
if (accountSelectionResult.value)
|
|
150
|
+
await this.selectAccount(accountSelectionResult.value.id, "");
|
|
151
|
+
return UserfriendlyResult_1.UserfriendlyResult.ok(accountSelectionResult.value);
|
|
156
152
|
}
|
|
157
153
|
async selectRelationship(id) {
|
|
158
154
|
if (!id) {
|
|
@@ -215,8 +211,7 @@ class AppRuntime extends runtime_1.Runtime {
|
|
|
215
211
|
this.moduleRegistry[moduleName] = ctor;
|
|
216
212
|
}
|
|
217
213
|
loadModule(moduleConfiguration) {
|
|
218
|
-
const moduleConstructor = AppRuntime.moduleRegistry[moduleConfiguration.
|
|
219
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
214
|
+
const moduleConstructor = AppRuntime.moduleRegistry[moduleConfiguration.location];
|
|
220
215
|
if (!moduleConstructor) {
|
|
221
216
|
const error = new Error(`Module '${this.getModuleName(moduleConfiguration)}' could not be loaded, because it was not registered. Please register all modules before running init.`);
|
|
222
217
|
this.logger.error(error);
|
|
@@ -248,6 +243,7 @@ AppRuntime.moduleRegistry = {
|
|
|
248
243
|
mailReceived: modules_1.MailReceivedModule,
|
|
249
244
|
onboardingChangeReceived: modules_1.OnboardingChangeReceivedModule,
|
|
250
245
|
messageReceived: modules_1.MessageReceivedModule,
|
|
251
|
-
relationshipChanged: modules_1.RelationshipChangedModule
|
|
246
|
+
relationshipChanged: modules_1.RelationshipChangedModule,
|
|
247
|
+
relationshipTemplateProcessed: modules_1.RelationshipTemplateProcessedModule
|
|
252
248
|
};
|
|
253
249
|
//# 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,kEAA6D;AAE7D,gDAA0C;AAC1C,oDAA0D;AAC1D,
|
|
1
|
+
{"version":3,"file":"AppRuntime.js","sourceRoot":"","sources":["../src/AppRuntime.ts"],"names":[],"mappings":";;;AACA,kEAA6D;AAE7D,gDAA0C;AAC1C,oDAA0D;AAC1D,4CAA4E;AAC5E,gDAA0E;AAC1E,2CAA4E;AAC5E,yDAAqD;AAErD,6DAAyD;AACzD,qCAA0E;AAC1E,mDAAwD;AACxD,uCAWkB;AAClB,iDAMuB;AACvB,qDAAiD;AACjD,6DAAyD;AAEzD,MAAa,UAAW,SAAQ,iBAAkB;IAC9C,YAAoC,kBAAsC,EAAE,SAAoB;QAC5F,KAAK,CAAC,SAAS,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAA;QADlB,uBAAkB,GAAlB,kBAAkB,CAAoB;QAgDzD,mBAAc,GAAG,IAAI,+BAAc,EAAE,CAAA;QAqQ9C,wBAAmB,GAA+B;YACtD,SAAS,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC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Root":"","sources":["../src/AppRuntimeServices.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ILoggerFactory } from "@js-soft/logging-abstractions";
|
|
2
|
+
import { EventBus, Result } from "@js-soft/ts-utils";
|
|
3
|
+
import { AnonymousServices } from "@nmshd/runtime";
|
|
4
|
+
import { ICoreAddress } from "@nmshd/transport";
|
|
5
|
+
import { AppRuntimeServices } from "./AppRuntimeServices";
|
|
6
|
+
import { IUIBridge } from "./extensibility";
|
|
7
|
+
import { LocalAccountDTO } from "./multiAccount/data/LocalAccountDTO";
|
|
8
|
+
import { UserfriendlyResult } from "./UserfriendlyResult";
|
|
9
|
+
export declare class AppStringProcessor {
|
|
10
|
+
protected readonly runtime: {
|
|
11
|
+
get anonymousServices(): AnonymousServices;
|
|
12
|
+
requestAccountSelection(title?: string, description?: string): Promise<UserfriendlyResult<LocalAccountDTO | undefined>>;
|
|
13
|
+
uiBridge(): Promise<IUIBridge>;
|
|
14
|
+
getServices(accountReference: string | ICoreAddress): Promise<AppRuntimeServices>;
|
|
15
|
+
translate(key: string, ...values: any[]): Promise<Result<string>>;
|
|
16
|
+
get eventBus(): EventBus;
|
|
17
|
+
};
|
|
18
|
+
private readonly logger;
|
|
19
|
+
constructor(runtime: {
|
|
20
|
+
get anonymousServices(): AnonymousServices;
|
|
21
|
+
requestAccountSelection(title?: string, description?: string): Promise<UserfriendlyResult<LocalAccountDTO | undefined>>;
|
|
22
|
+
uiBridge(): Promise<IUIBridge>;
|
|
23
|
+
getServices(accountReference: string | ICoreAddress): Promise<AppRuntimeServices>;
|
|
24
|
+
translate(key: string, ...values: any[]): Promise<Result<string>>;
|
|
25
|
+
get eventBus(): EventBus;
|
|
26
|
+
}, loggerFactory: ILoggerFactory);
|
|
27
|
+
processURL(url: string, account?: LocalAccountDTO): Promise<UserfriendlyResult<void>>;
|
|
28
|
+
processTruncatedReference(truncatedReference: string, account?: LocalAccountDTO): Promise<UserfriendlyResult<void>>;
|
|
29
|
+
private _handleTruncatedReference;
|
|
30
|
+
private parseTokenContent;
|
|
31
|
+
private error;
|
|
32
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AppStringProcessor = void 0;
|
|
4
|
+
const ts_serval_1 = require("@js-soft/ts-serval");
|
|
5
|
+
const runtime_1 = require("@nmshd/runtime");
|
|
6
|
+
const transport_1 = require("@nmshd/transport");
|
|
7
|
+
const AppRuntimeErrors_1 = require("./AppRuntimeErrors");
|
|
8
|
+
const UserfriendlyApplicationError_1 = require("./UserfriendlyApplicationError");
|
|
9
|
+
const UserfriendlyResult_1 = require("./UserfriendlyResult");
|
|
10
|
+
class AppStringProcessor {
|
|
11
|
+
constructor(runtime, loggerFactory) {
|
|
12
|
+
this.runtime = runtime;
|
|
13
|
+
this.logger = loggerFactory.getLogger(this.constructor);
|
|
14
|
+
}
|
|
15
|
+
async processURL(url, account) {
|
|
16
|
+
url = url.trim();
|
|
17
|
+
const prefix = url.substring(0, 11);
|
|
18
|
+
if (prefix.startsWith("nmshd://qr#") || prefix === "nmshd://tr#") {
|
|
19
|
+
return await this.processTruncatedReference(url.substring(11), account);
|
|
20
|
+
}
|
|
21
|
+
return UserfriendlyResult_1.UserfriendlyResult.fail(AppRuntimeErrors_1.AppRuntimeErrors.startup.wrongURL());
|
|
22
|
+
}
|
|
23
|
+
async processTruncatedReference(truncatedReference, account) {
|
|
24
|
+
if (account) {
|
|
25
|
+
await this._handleTruncatedReference(truncatedReference, account);
|
|
26
|
+
return UserfriendlyResult_1.UserfriendlyResult.ok(undefined);
|
|
27
|
+
}
|
|
28
|
+
// process Files and RelationshipTemplates and ask for an account
|
|
29
|
+
if (truncatedReference.startsWith(runtime_1.Base64ForIdPrefix.File) ||
|
|
30
|
+
truncatedReference.startsWith(runtime_1.Base64ForIdPrefix.RelationshipTemplate)) {
|
|
31
|
+
const result = await this.runtime.requestAccountSelection();
|
|
32
|
+
if (result.isError) {
|
|
33
|
+
this.logger.error("Could not query account", result.error);
|
|
34
|
+
return UserfriendlyResult_1.UserfriendlyResult.fail(result.error);
|
|
35
|
+
}
|
|
36
|
+
if (!result.value) {
|
|
37
|
+
this.logger.info("User cancelled account selection");
|
|
38
|
+
return UserfriendlyResult_1.UserfriendlyResult.ok(undefined);
|
|
39
|
+
}
|
|
40
|
+
await this._handleTruncatedReference(truncatedReference, result.value);
|
|
41
|
+
return UserfriendlyResult_1.UserfriendlyResult.ok(undefined);
|
|
42
|
+
}
|
|
43
|
+
const uiBridge = await this.runtime.uiBridge();
|
|
44
|
+
if (!truncatedReference.startsWith(runtime_1.Base64ForIdPrefix.Token)) {
|
|
45
|
+
const error = AppRuntimeErrors_1.AppRuntimeErrors.startup.wrongCode();
|
|
46
|
+
await this.error(error);
|
|
47
|
+
return UserfriendlyResult_1.UserfriendlyResult.fail(error);
|
|
48
|
+
}
|
|
49
|
+
const tokenResult = await this.runtime.anonymousServices.tokens.loadPeerTokenByTruncatedReference({
|
|
50
|
+
reference: truncatedReference
|
|
51
|
+
});
|
|
52
|
+
if (tokenResult.isError) {
|
|
53
|
+
return UserfriendlyResult_1.UserfriendlyResult.fail(UserfriendlyApplicationError_1.UserfriendlyApplicationError.fromError(tokenResult.error));
|
|
54
|
+
}
|
|
55
|
+
const tokenDTO = tokenResult.value;
|
|
56
|
+
const tokenContent = this.parseTokenContent(tokenDTO.content);
|
|
57
|
+
if (!tokenContent) {
|
|
58
|
+
const error = AppRuntimeErrors_1.AppRuntimeErrors.startup.wrongCode();
|
|
59
|
+
await this.error(error);
|
|
60
|
+
return UserfriendlyResult_1.UserfriendlyResult.fail(error);
|
|
61
|
+
}
|
|
62
|
+
if (tokenContent instanceof transport_1.TokenContentDeviceSharedSecret) {
|
|
63
|
+
await uiBridge.showDeviceOnboarding(tokenContent.sharedSecret);
|
|
64
|
+
return UserfriendlyResult_1.UserfriendlyResult.ok(undefined);
|
|
65
|
+
}
|
|
66
|
+
const accountSelectionResult = await this.runtime.requestAccountSelection();
|
|
67
|
+
if (accountSelectionResult.isError) {
|
|
68
|
+
return UserfriendlyResult_1.UserfriendlyResult.fail(accountSelectionResult.error);
|
|
69
|
+
}
|
|
70
|
+
const selectedAccount = accountSelectionResult.value;
|
|
71
|
+
if (!selectedAccount) {
|
|
72
|
+
this.logger.info("User cancelled account selection");
|
|
73
|
+
return UserfriendlyResult_1.UserfriendlyResult.ok(undefined);
|
|
74
|
+
}
|
|
75
|
+
await this._handleTruncatedReference(truncatedReference, selectedAccount);
|
|
76
|
+
return UserfriendlyResult_1.UserfriendlyResult.ok(undefined);
|
|
77
|
+
}
|
|
78
|
+
async _handleTruncatedReference(truncatedReference, account) {
|
|
79
|
+
const services = await this.runtime.getServices(account.id);
|
|
80
|
+
const uiBridge = await this.runtime.uiBridge();
|
|
81
|
+
const result = await services.transportServices.account.loadItemFromTruncatedReference({
|
|
82
|
+
reference: truncatedReference
|
|
83
|
+
});
|
|
84
|
+
if (result.isError)
|
|
85
|
+
return await this.error(result.error);
|
|
86
|
+
switch (result.value.type) {
|
|
87
|
+
case "File":
|
|
88
|
+
const file = await services.dataViewExpander.expandFileDTO(result.value.value);
|
|
89
|
+
await uiBridge.showFile(account, file);
|
|
90
|
+
break;
|
|
91
|
+
case "RelationshipTemplate":
|
|
92
|
+
// RelationshipTemplates are processed by the RequestModule
|
|
93
|
+
break;
|
|
94
|
+
case "Token":
|
|
95
|
+
await this.error(new UserfriendlyApplicationError_1.UserfriendlyApplicationError("error.appStringProcessor.notSupportedTokenContent", "The scanned code is not supported in this context"));
|
|
96
|
+
break;
|
|
97
|
+
case "DeviceOnboardingInfo":
|
|
98
|
+
await this.error(new UserfriendlyApplicationError_1.UserfriendlyApplicationError("error.appStringProcessor.deviceOnboardingNotAllowed", "The token contained a device onboarding info, but this is not allowed in this context."));
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
parseTokenContent(content) {
|
|
103
|
+
try {
|
|
104
|
+
return ts_serval_1.Serializable.fromUnknown(content);
|
|
105
|
+
}
|
|
106
|
+
catch (e) {
|
|
107
|
+
this.logger.info("Could not parse token content", e);
|
|
108
|
+
return undefined;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
async error(error) {
|
|
112
|
+
const parsedError = error instanceof UserfriendlyApplicationError_1.UserfriendlyApplicationError //
|
|
113
|
+
? error
|
|
114
|
+
: UserfriendlyApplicationError_1.UserfriendlyApplicationError.fromError(error);
|
|
115
|
+
this.logger.error(parsedError);
|
|
116
|
+
const uiBridge = await this.runtime.uiBridge();
|
|
117
|
+
await uiBridge.showError(parsedError);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
exports.AppStringProcessor = AppStringProcessor;
|
|
121
|
+
//# sourceMappingURL=AppStringProcessor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppStringProcessor.js","sourceRoot":"","sources":["../src/AppStringProcessor.ts"],"names":[],"mappings":";;;AACA,kDAAiD;AAEjD,4CAAqE;AACrE,gDAA+E;AAC/E,yDAAqD;AAIrD,iFAA6E;AAC7E,6DAAyD;AAEzD,MAAa,kBAAkB;IAG3B,YACuB,OAUlB,EACD,aAA6B;QAXV,YAAO,GAAP,OAAO,CAUzB;QAGD,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;IAC3D,CAAC;IAEM,KAAK,CAAC,UAAU,CAAC,GAAW,EAAE,OAAyB;QAC1D,GAAG,GAAG,GAAG,CAAC,IAAI,EAAE,CAAA;QAEhB,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;QACnC,IAAI,MAAM,CAAC,UAAU,CAAC,aAAa,CAAC,IAAI,MAAM,KAAK,aAAa,EAAE;YAC9D,OAAO,MAAM,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,SAA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;gBACvB,MAAM,IAAI,CAAC,KAAK,CACZ,IAAI,2DAA4B,CAC5B,qDAAqD,EACrD,wFAAwF,CAC3F,CACJ,CAAA;gBACD,MAAK;SACZ;IACL,CAAC;IAEO,iBAAiB,CAAC,OAAY;QAClC,IAAI;YACA,OAAO,wBAAY,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;SAC3C;QAAC,OAAO,CAAC,EAAE;YACR,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,+BAA+B,EAAE,CAAC,CAAC,CAAA;YACpD,OAAO,SAAS,CAAA;SACnB;IACL,CAAC;IAEO,KAAK,CAAC,KAAK,CAAC,KAAsD;QACtE,MAAM,WAAW,GACb,KAAK,YAAY,2DAA4B,CAAC,EAAE;YAC5C,CAAC,CAAC,KAAK;YACP,CAAC,CAAC,2DAA4B,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;QAEvD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;QAE9B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAA;QAC9C,MAAM,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,CAAA;IACzC,CAAC;CACJ;AA9JD,gDA8JC"}
|
|
@@ -3,5 +3,5 @@ import { AppRuntimeError } from "./AppRuntimeError";
|
|
|
3
3
|
export declare class UserfriendlyApplicationError extends AppRuntimeError {
|
|
4
4
|
readonly userfriendlyMessage?: string | undefined;
|
|
5
5
|
constructor(code: string, message: string, userfriendlyMessage?: string | undefined, data?: any);
|
|
6
|
-
static fromError(error: ApplicationError, userfriendlyMessage
|
|
6
|
+
static fromError(error: ApplicationError, userfriendlyMessage?: string): UserfriendlyApplicationError;
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserfriendlyApplicationError.js","sourceRoot":"","sources":["../src/UserfriendlyApplicationError.ts"],"names":[],"mappings":";;;AACA,uDAAmD;AAEnD,MAAa,4BAA6B,SAAQ,iCAAe;IAC7D,YAAmB,IAAY,EAAE,OAAe,EAAkB,mBAA4B,EAAE,IAAU;QACtG,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,CAAA;QADoC,wBAAmB,GAAnB,mBAAmB,CAAS;QAE1F,IAAI,CAAC,mBAAmB,EAAE;YACtB,IAAI,CAAC,mBAAmB,GAAG,UAAU,IAAI,EAAE,CAAA;SAC9C;IACL,CAAC;IAEM,MAAM,CAAC,SAAS,CAAC,KAAuB,EAAE,
|
|
1
|
+
{"version":3,"file":"UserfriendlyApplicationError.js","sourceRoot":"","sources":["../src/UserfriendlyApplicationError.ts"],"names":[],"mappings":";;;AACA,uDAAmD;AAEnD,MAAa,4BAA6B,SAAQ,iCAAe;IAC7D,YAAmB,IAAY,EAAE,OAAe,EAAkB,mBAA4B,EAAE,IAAU;QACtG,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,CAAA;QADoC,wBAAmB,GAAnB,mBAAmB,CAAS;QAE1F,IAAI,CAAC,mBAAmB,EAAE;YACtB,IAAI,CAAC,mBAAmB,GAAG,UAAU,IAAI,EAAE,CAAA;SAC9C;IACL,CAAC;IAEM,MAAM,CAAC,SAAS,CAAC,KAAuB,EAAE,mBAA4B;QACzE,OAAO,IAAI,4BAA4B,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,EAAE,mBAAmB,EAAE,KAAK,CAAC,IAAI,CAAC,CAAA;IACvG,CAAC;CACJ;AAXD,oEAWC"}
|
package/dist/buildInformation.js
CHANGED
|
@@ -8,11 +8,11 @@ const crypto_1 = require("@nmshd/crypto");
|
|
|
8
8
|
const runtime_1 = require("@nmshd/runtime");
|
|
9
9
|
const transport_1 = require("@nmshd/transport");
|
|
10
10
|
exports.buildInformation = {
|
|
11
|
-
version: "2.
|
|
12
|
-
build: "
|
|
13
|
-
date: "2023-02-
|
|
14
|
-
commit: "
|
|
15
|
-
dependencies: {"@js-soft/docdb-access-loki":"^1.0.3","@js-soft/native-abstractions":"^1.2.1","@nmshd/runtime":"2.
|
|
11
|
+
version: "2.3.0",
|
|
12
|
+
build: "43",
|
|
13
|
+
date: "2023-02-17T19:06:23+00:00",
|
|
14
|
+
commit: "5bb90a2e7a4d68c976eee7e6b039e453c1043d7c",
|
|
15
|
+
dependencies: {"@js-soft/docdb-access-loki":"^1.0.3","@js-soft/native-abstractions":"^1.2.1","@nmshd/runtime":"2.4.1","lodash":"^4.17.21"},
|
|
16
16
|
libraries: {
|
|
17
17
|
serval: ts_serval_1.buildInformation,
|
|
18
18
|
crypto: crypto_1.buildInformation,
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { ConsumptionServices, DataViewExpander, TransportServices } from "@nmshd/runtime";
|
|
2
2
|
import { AppRuntime } from "../AppRuntime";
|
|
3
|
-
import { AppRelationshipFacade
|
|
3
|
+
import { AppRelationshipFacade } from "./facades";
|
|
4
4
|
export declare class AppServices {
|
|
5
5
|
readonly relationships: AppRelationshipFacade;
|
|
6
|
-
readonly stringProcessor: AppStringProcessorFacade;
|
|
7
6
|
constructor(appRuntime: AppRuntime, transportServices: TransportServices, consumptionServices: ConsumptionServices, expander: DataViewExpander);
|
|
8
7
|
}
|
|
@@ -5,7 +5,6 @@ const facades_1 = require("./facades");
|
|
|
5
5
|
class AppServices {
|
|
6
6
|
constructor(appRuntime, transportServices, consumptionServices, expander) {
|
|
7
7
|
this.relationships = new facades_1.AppRelationshipFacade(appRuntime, transportServices, consumptionServices, expander);
|
|
8
|
-
this.stringProcessor = new facades_1.AppStringProcessorFacade(appRuntime, transportServices, consumptionServices, expander);
|
|
9
8
|
}
|
|
10
9
|
}
|
|
11
10
|
exports.AppServices = AppServices;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppServices.js","sourceRoot":"","sources":["../../src/extensibility/AppServices.ts"],"names":[],"mappings":";;;AAEA,
|
|
1
|
+
{"version":3,"file":"AppServices.js","sourceRoot":"","sources":["../../src/extensibility/AppServices.ts"],"names":[],"mappings":";;;AAEA,uCAAiD;AAEjD,MAAa,WAAW;IAGpB,YACI,UAAsB,EACtB,iBAAoC,EACpC,mBAAwC,EACxC,QAA0B;QAE1B,IAAI,CAAC,aAAa,GAAG,IAAI,+BAAqB,CAAC,UAAU,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,QAAQ,CAAC,CAAA;IAChH,CAAC;CACJ;AAXD,kCAWC"}
|
|
@@ -15,5 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./AppRelationshipFacade"), exports);
|
|
18
|
-
__exportStar(require("./AppStringProcessorFacade"), exports);
|
|
19
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/extensibility/facades/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAuC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/extensibility/facades/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAuC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Result } from "@js-soft/ts-utils";
|
|
2
|
-
import {
|
|
2
|
+
import { FileDVO, IdentityDVO, LocalRequestDVO, MailDVO, MessageDVO, RequestMessageDVO } from "@nmshd/runtime";
|
|
3
|
+
import { DeviceSharedSecret } from "@nmshd/transport";
|
|
3
4
|
import { LocalAccountDTO } from "../../multiAccount";
|
|
4
5
|
import { UserfriendlyApplicationError } from "../../UserfriendlyApplicationError";
|
|
5
6
|
export interface IUIBridge {
|
|
6
7
|
showMessage(account: LocalAccountDTO, relationship: IdentityDVO, message: MessageDVO | MailDVO | RequestMessageDVO): Promise<Result<void>>;
|
|
7
8
|
showRelationship(account: LocalAccountDTO, relationship: IdentityDVO): Promise<Result<void>>;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
showRecovery(token: TokenDTO): Promise<Result<void>>;
|
|
9
|
+
showFile(account: LocalAccountDTO, file: FileDVO): Promise<Result<void>>;
|
|
10
|
+
showDeviceOnboarding(sharedSecret: DeviceSharedSecret): Promise<Result<void>>;
|
|
11
|
+
showRequest(account: LocalAccountDTO, request: LocalRequestDVO): Promise<Result<void>>;
|
|
12
12
|
showError(error: UserfriendlyApplicationError, account?: LocalAccountDTO): Promise<Result<void>>;
|
|
13
|
-
requestAccountSelection(possibleAccounts: LocalAccountDTO[], title?: string, description?: string): Promise<Result<LocalAccountDTO>>;
|
|
13
|
+
requestAccountSelection(possibleAccounts: LocalAccountDTO[], title?: string, description?: string): Promise<Result<LocalAccountDTO | undefined>>;
|
|
14
14
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from "./AppConfig";
|
|
|
2
2
|
export * from "./AppRuntime";
|
|
3
3
|
export * from "./AppRuntimeError";
|
|
4
4
|
export * from "./AppRuntimeErrors";
|
|
5
|
+
export * from "./AppRuntimeServices";
|
|
5
6
|
export * from "./buildInformation";
|
|
6
7
|
export * from "./events";
|
|
7
8
|
export * from "./extensibility";
|
package/dist/index.js
CHANGED
|
@@ -18,6 +18,7 @@ __exportStar(require("./AppConfig"), exports);
|
|
|
18
18
|
__exportStar(require("./AppRuntime"), exports);
|
|
19
19
|
__exportStar(require("./AppRuntimeError"), exports);
|
|
20
20
|
__exportStar(require("./AppRuntimeErrors"), exports);
|
|
21
|
+
__exportStar(require("./AppRuntimeServices"), exports);
|
|
21
22
|
__exportStar(require("./buildInformation"), exports);
|
|
22
23
|
__exportStar(require("./events"), exports);
|
|
23
24
|
__exportStar(require("./extensibility"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,+CAA4B;AAC5B,oDAAiC;AACjC,qDAAkC;AAClC,qDAAkC;AAClC,2CAAwB;AACxB,kDAA+B;AAC/B,4CAAyB;AACzB,iDAA8B;AAC9B,iEAA8C;AAC9C,uDAAoC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,+CAA4B;AAC5B,oDAAiC;AACjC,qDAAkC;AAClC,uDAAoC;AACpC,qDAAkC;AAClC,2CAAwB;AACxB,kDAA+B;AAC/B,4CAAyB;AACzB,iDAA8B;AAC9B,iEAA8C;AAC9C,uDAAoC"}
|
|
@@ -15,7 +15,7 @@ class AppLaunchModule extends AppRuntimeModule_1.AppRuntimeModule {
|
|
|
15
15
|
this.subscribeToNativeEvent(native_abstractions_1.UrlOpenEvent, this.handleUrlOpen.bind(this));
|
|
16
16
|
}
|
|
17
17
|
async handleUrlOpen(event) {
|
|
18
|
-
await this.runtime.
|
|
18
|
+
await this.runtime.stringProcessor.processURL(event.url);
|
|
19
19
|
}
|
|
20
20
|
stop() {
|
|
21
21
|
this.unsubscribeFromAllEvents();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppLaunchModule.js","sourceRoot":"","sources":["../../../src/modules/appEvents/AppLaunchModule.ts"],"names":[],"mappings":";;;AAAA,sEAA2D;AAC3D,2DAAuD;AACvD,0DAAqF;AAIrF,MAAa,oBAAqB,SAAQ,iCAAe;CAAG;AAA5D,oDAA4D;AAE5D,MAAa,eAAgB,SAAQ,mCAAuC;IACjE,KAAK,CAAC,IAAI;QACb,qBAAqB;IACzB,CAAC;IAEM,KAAK;QACR,IAAI,CAAC,sBAAsB,CAAC,kCAAY,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;IAC5E,CAAC;IAEO,KAAK,CAAC,aAAa,CAAC,KAAmB;QAC3C,MAAM,IAAI,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"AppLaunchModule.js","sourceRoot":"","sources":["../../../src/modules/appEvents/AppLaunchModule.ts"],"names":[],"mappings":";;;AAAA,sEAA2D;AAC3D,2DAAuD;AACvD,0DAAqF;AAIrF,MAAa,oBAAqB,SAAQ,iCAAe;CAAG;AAA5D,oDAA4D;AAE5D,MAAa,eAAgB,SAAQ,mCAAuC;IACjE,KAAK,CAAC,IAAI;QACb,qBAAqB;IACzB,CAAC;IAEM,KAAK;QACR,IAAI,CAAC,sBAAsB,CAAC,kCAAY,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;IAC5E,CAAC;IAEO,KAAK,CAAC,aAAa,CAAC,KAAmB;QAC3C,MAAM,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAC5D,CAAC;IAEM,IAAI;QACP,IAAI,CAAC,wBAAwB,EAAE,CAAA;IACnC,CAAC;CACJ;AAhBD,0CAgBC"}
|
|
@@ -41,7 +41,8 @@ class OnboardingChangeReceivedModule extends AppRuntimeModule_1.AppRuntimeModule
|
|
|
41
41
|
}
|
|
42
42
|
await this.runtime.nativeEnvironment.notificationAccess.schedule(title, text, {
|
|
43
43
|
callback: async () => {
|
|
44
|
-
|
|
44
|
+
const uiBridge = await this.runtime.uiBridge();
|
|
45
|
+
await uiBridge.showRelationship(session.account, identity);
|
|
45
46
|
}
|
|
46
47
|
});
|
|
47
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OnboardingChangeReceivedModule.js","sourceRoot":"","sources":["../../../src/modules/appEvents/OnboardingChangeReceivedModule.ts"],"names":[],"mappings":";;;AAAA,4CAAyD;AACzD,2DAAuD;AACvD,yCAA4D;AAC5D,0DAAqF;AAIrF,MAAa,mCAAoC,SAAQ,iCAAe;CAAG;AAA3E,kFAA2E;AAE3E,MAAa,8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AAI,EAAE;YAC1E,QAAQ,EAAE,KAAK,IAAI,EAAE;gBACjB,MAAM,
|
|
1
|
+
{"version":3,"file":"OnboardingChangeReceivedModule.js","sourceRoot":"","sources":["../../../src/modules/appEvents/OnboardingChangeReceivedModule.ts"],"names":[],"mappings":";;;AAAA,4CAAyD;AACzD,2DAAuD;AACvD,yCAA4D;AAC5D,0DAAqF;AAIrF,MAAa,mCAAoC,SAAQ,iCAAe;CAAG;AAA3E,kFAA2E;AAE3E,MAAa,8BAA+B,SAAQ,mCAAsD;IAC/F,KAAK,CAAC,IAAI;QACb,qBAAqB;IACzB,CAAC;IAEM,KAAK;QACR,IAAI,CAAC,gBAAgB,CAAC,sCAA6B,EAAE,IAAI,CAAC,8BAA8B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;IACxG,CAAC;IAEO,KAAK,CAAC,8BAA8B,CAAC,KAAoC;QAC7E,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAA;QAChC,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAA;QACpC,IAAI,KAAK,GAAG,EAAE,CAAA;QACd,IAAI,IAAI,GAAG,EAAE,CAAA;QACb,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAA;QAE/E,QAAQ,MAAM,CAAC,MAAM,EAAE;YACnB,KAAK,kCAAwB,CAAC,QAAQ;gBAClC,KAAK,GAAG,0BAA0B,CAAA;gBAClC,IAAI,GAAG,qBAAqB,QAAQ,CAAC,IAAI,gBAAgB,CAAA;gBACzD,MAAK;YAET,KAAK,kCAAwB,CAAC,OAAO;gBACjC,KAAK,GAAG,yBAAyB,CAAA;gBACjC,IAAI,GAAG,mCAAmC,QAAQ,CAAC,IAAI,WAAW,CAAA;gBAClE,MAAK;YAET,KAAK,kCAAwB,CAAC,QAAQ;gBAClC,KAAK,GAAG,0BAA0B,CAAA;gBAClC,IAAI,GAAG,GAAG,QAAQ,CAAC,IAAI,oCAAoC,CAAA;gBAC3D,MAAK;YAET,KAAK,kCAAwB,CAAC,OAAO;gBACjC,KAAK,GAAG,8BAA8B,CAAA;gBACtC,IAAI,GAAG,GAAG,QAAQ,CAAC,IAAI,uCAAuC,CAAA;gBAC9D,MAAK;SACZ;QACD,MAAM,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE;YAC1E,QAAQ,EAAE,KAAK,IAAI,EAAE;gBACjB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAA;gBAC9C,MAAM,QAAQ,CAAC,gBAAgB,CAAC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;YAC9D,CAAC;SACJ,CAAC,CAAA;IACN,CAAC;IAEM,IAAI;QACP,IAAI,CAAC,wBAAwB,EAAE,CAAA;IACnC,CAAC;CACJ;AAhDD,wEAgDC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AppRuntimeModule, AppRuntimeModuleConfiguration } from "../AppRuntimeModule";
|
|
2
|
+
export interface RelationshipTemplateProcessedModuleConfig extends AppRuntimeModuleConfiguration {
|
|
3
|
+
}
|
|
4
|
+
export declare class RelationshipTemplateProcessedModule extends AppRuntimeModule<RelationshipTemplateProcessedModuleConfig> {
|
|
5
|
+
init(): Promise<void>;
|
|
6
|
+
start(): void;
|
|
7
|
+
private handleUrlOpen;
|
|
8
|
+
stop(): void;
|
|
9
|
+
}
|