@frankieone/one-sdk 0.5.1-alpha → 0.5.2-rc.6
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/README.md +481 -1
- package/dist/commit.txt +1 -1
- package/dist/esm/modules/biometrics/index.js +1 -1
- package/dist/esm/modules/biometrics/parseConfiguration.d.ts +1 -1
- package/dist/esm/modules/biometrics/types/module.d.ts +1 -1
- package/dist/esm/modules/biometrics/types/wrapper.d.ts +2 -2
- package/dist/esm/modules/biometrics/wrappers/OcrLabs/index.d.ts +1 -1
- package/dist/esm/modules/biometrics/wrappers/OcrLabs/index.js +1 -1
- package/dist/esm/modules/biometrics/wrappers/OcrLabs/index.js.map +1 -1
- package/dist/esm/modules/biometrics/wrappers/OcrLabs/nolint_liveness-v3.1.0.min.umd.js +28345 -0
- package/dist/esm/modules/biometrics/wrappers/OcrLabs/nolint_liveness-v3.1.0.min.umd.js.map +1 -0
- package/dist/esm/modules/common/constants.d.ts +2 -2
- package/dist/esm/modules/common/constants.js +3 -3
- package/dist/esm/modules/common/modules/LocalStorage.d.ts +6 -0
- package/dist/esm/modules/common/modules/LocalStorage.js +21 -0
- package/dist/esm/modules/common/modules/LocalStorage.js.map +1 -0
- package/dist/esm/modules/common/modules/ReactiveStore.d.ts +1 -1
- package/dist/esm/modules/common/modules/error.d.ts +1 -1
- package/dist/esm/modules/common/modules/eventHub.d.ts +1 -1
- package/dist/esm/modules/common/modules/runIfWhen.d.ts +1 -1
- package/dist/esm/modules/common/modules/vendorLoading.d.ts +1 -1
- package/dist/esm/modules/common/shared/models/UBOData.d.ts +1 -1
- package/dist/esm/modules/common/types/Accessors.d.ts +1 -1
- package/dist/esm/modules/common/types/Configuration.d.ts +2 -2
- package/dist/esm/modules/device/index.js +1 -1
- package/dist/esm/modules/device/parseConfiguration.d.ts +1 -1
- package/dist/esm/modules/device/parseConfiguration.js +1 -1
- package/dist/esm/modules/device/types/events.d.ts +1 -1
- package/dist/esm/modules/device/types/module.d.ts +1 -1
- package/dist/esm/modules/device/types/wrapper.d.ts +2 -2
- package/dist/esm/modules/device/vendors/Sardine.js +1 -1
- package/dist/esm/modules/frankie-client/ClientsDictionary.d.ts +1 -1
- package/dist/esm/modules/frankie-client/DummyFrankieApiClient.d.ts +27 -22
- package/dist/esm/modules/frankie-client/DummyFrankieApiClient.js +40 -40
- package/dist/esm/modules/frankie-client/DummyFrankieApiClient.js.map +1 -1
- package/dist/esm/modules/frankie-client/FrankieApiClient.d.ts +6 -9
- package/dist/esm/modules/frankie-client/FrankieApiClient.js +9 -26
- package/dist/esm/modules/frankie-client/FrankieApiClient.js.map +1 -1
- package/dist/esm/modules/frankie-client/clients/ApplicantClient.d.ts +3 -3
- package/dist/esm/modules/frankie-client/clients/ApplicantClient.js +10 -14
- package/dist/esm/modules/frankie-client/clients/ApplicantClient.js.map +1 -1
- package/dist/esm/modules/frankie-client/clients/BaseClient.d.ts +1 -3
- package/dist/esm/modules/frankie-client/clients/BaseClient.js +4 -3
- package/dist/esm/modules/frankie-client/clients/BaseClient.js.map +1 -1
- package/dist/esm/modules/frankie-client/clients/OCRClient.d.ts +1 -1
- package/dist/esm/modules/frankie-client/clients/OCRClient.js +1 -1
- package/dist/esm/modules/frankie-client/clients/TelemetryEventsClient.d.ts +1 -1
- package/dist/esm/modules/frankie-client/index.d.ts +7 -3
- package/dist/esm/modules/frankie-client/index.js +4 -5
- package/dist/esm/modules/frankie-client/index.js.map +1 -1
- package/dist/esm/modules/frankie-client/mocks/individual/loadIndividual.d.ts +4 -4
- package/dist/esm/modules/frankie-client/mocks/individual/loadIndividual.js +5 -5
- package/dist/esm/modules/frankie-client/mocks/individual/loadIndividual.js.map +1 -1
- package/dist/esm/modules/frankie-client/mocks/ocr/ocrSubmission.d.ts +2 -2
- package/dist/esm/modules/frankie-client/mocks/ocr/ocrSubmission.js +1 -1
- package/dist/esm/modules/frankie-client/mocks/simplifier.d.ts +3 -3
- package/dist/esm/modules/index.d.ts +8 -8
- package/dist/esm/modules/index.js +5 -5
- package/dist/esm/modules/individual/actions/consents.d.ts +1 -1
- package/dist/esm/modules/individual/actions/documents.d.ts +2 -2
- package/dist/esm/modules/individual/actions/emitEvents.d.ts +1 -1
- package/dist/esm/modules/individual/actions/search.d.ts +4 -4
- package/dist/esm/modules/individual/actions/search.js +6 -7
- package/dist/esm/modules/individual/actions/search.js.map +1 -1
- package/dist/esm/modules/individual/actions/submit.d.ts +6 -6
- package/dist/esm/modules/individual/index.js +2 -2
- package/dist/esm/modules/individual/types/events.d.ts +1 -1
- package/dist/esm/modules/individual/types/module.d.ts +5 -5
- package/dist/esm/modules/meta.json +1 -1
- package/dist/esm/modules/ocr/actions/start.d.ts +5 -5
- package/dist/esm/modules/ocr/actions/start.js +2 -2
- package/dist/esm/modules/ocr/index.d.ts +8 -8
- package/dist/esm/modules/ocr/index.js +2 -2
- package/dist/esm/modules/ocr/types/events.d.ts +2 -2
- package/dist/esm/modules/ocr/types/module.d.ts +2 -2
- package/dist/esm/modules/sdk/index.js +4 -2
- package/dist/esm/modules/sdk/index.js.map +1 -1
- package/dist/esm/modules/sdk/initialisation/componentLoader.js +1 -1
- package/dist/esm/modules/sdk/initialisation/configurationParser.js +5 -8
- package/dist/esm/modules/sdk/initialisation/configurationParser.js.map +1 -1
- package/dist/esm/modules/sdk/initialisation/sharedDependencies.d.ts +4 -3
- package/dist/esm/modules/sdk/initialisation/sharedDependencies.js +9 -9
- package/dist/esm/modules/sdk/initialisation/sharedDependencies.js.map +1 -1
- package/dist/esm/modules/sdk/types/components.d.ts +2 -2
- package/dist/esm/modules/sdk/types/configuration.d.ts +6 -17
- package/dist/esm/modules/sdk/types/configuration.js.map +1 -1
- package/dist/esm/modules/sdk/types/events.d.ts +1 -1
- package/dist/esm/modules/sdk/types/module.d.ts +2 -2
- package/dist/esm/modules/session/SessionContext.d.ts +51 -0
- package/dist/esm/modules/session/SessionContext.js +83 -0
- package/dist/esm/modules/session/SessionContext.js.map +1 -0
- package/dist/esm/modules/session/constants.d.ts +3 -0
- package/dist/esm/modules/session/constants.js +4 -0
- package/dist/esm/modules/session/constants.js.map +1 -0
- package/dist/esm/modules/session/index.d.ts +6 -0
- package/dist/esm/modules/session/index.js +50 -0
- package/dist/esm/modules/session/index.js.map +1 -0
- package/dist/esm/modules/session/types/module.d.ts +5 -0
- package/dist/esm/modules/session/types/module.js +2 -0
- package/dist/esm/modules/session/types/module.js.map +1 -0
- package/dist/release.txt +1 -1
- package/dist/umd/biometrics-ocrlabs.js +1 -2
- package/dist/umd/biometrics-ocrlabs.js.map +1 -1
- package/dist/umd/oneSdk.umd.js +1 -1
- package/dist/umd/oneSdk.umd.js.map +1 -1
- package/package.json +2 -1
- package/dist/esm/modules/common/types/Session.d.ts +0 -16
- package/dist/esm/modules/common/types/Session.js +0 -2
- package/dist/esm/modules/common/types/Session.js.map +0 -1
- package/dist/umd/biometrics-ocrlabs.js.LICENSE.txt +0 -8
|
@@ -7,10 +7,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { Applicant } from "
|
|
11
|
-
import { CheckSummary } from "
|
|
12
|
-
import { Document } from "
|
|
13
|
-
import { hasEntityId } from "../../common/types/Session";
|
|
10
|
+
import { Applicant } from "@module/common/shared/models/Applicant";
|
|
11
|
+
import { CheckSummary } from "@module/common/shared/models/CheckSummary";
|
|
12
|
+
import { Document } from "@module/common/shared/models/Document";
|
|
14
13
|
import { BaseClient } from "./BaseClient";
|
|
15
14
|
/**
|
|
16
15
|
* Applicant client handles BFF Applicant and Document Operations
|
|
@@ -23,7 +22,7 @@ export class ApplicantClient extends BaseClient {
|
|
|
23
22
|
* A search made using entityId HAS to be successful, since the entity id already exists. If not found, throw exception
|
|
24
23
|
* A search made using reference doesn't need to return results, as it might be a
|
|
25
24
|
*/
|
|
26
|
-
const { reference, entityId } = this
|
|
25
|
+
const { reference, entityId } = this;
|
|
27
26
|
const data = yield this.frankie
|
|
28
27
|
.get("/data/v2/applicant/", {
|
|
29
28
|
params: {
|
|
@@ -59,11 +58,10 @@ export class ApplicantClient extends BaseClient {
|
|
|
59
58
|
updateApplicant(payload) {
|
|
60
59
|
return __awaiter(this, void 0, void 0, function* () {
|
|
61
60
|
const { applicant, documents } = payload;
|
|
62
|
-
if (!
|
|
61
|
+
if (!this.entityId)
|
|
63
62
|
throw new Error("Entity id not found in local state. Has entity been created yet?");
|
|
64
|
-
const { entityId } = this.entityIdentifier;
|
|
65
63
|
return this.frankie
|
|
66
|
-
.put(`/data/v2/applicants/${entityId}`, {
|
|
64
|
+
.put(`/data/v2/applicants/${this.entityId}`, {
|
|
67
65
|
applicant,
|
|
68
66
|
documents,
|
|
69
67
|
kycMethod: "electronic",
|
|
@@ -73,10 +71,9 @@ export class ApplicantClient extends BaseClient {
|
|
|
73
71
|
}
|
|
74
72
|
getLatestCheckResults() {
|
|
75
73
|
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
-
if (!
|
|
74
|
+
if (!this.entityId)
|
|
77
75
|
throw new Error("Entity id not found in local state. Has entity been created yet?");
|
|
78
|
-
|
|
79
|
-
return yield this.frankie.get(`/data/v2/applicants/${entityId}`).then((r) => {
|
|
76
|
+
return yield this.frankie.get(`/data/v2/applicants/${this.entityId}`).then((r) => {
|
|
80
77
|
const { checkSummary } = r.data;
|
|
81
78
|
return CheckSummary.fromJSON(checkSummary);
|
|
82
79
|
});
|
|
@@ -84,10 +81,9 @@ export class ApplicantClient extends BaseClient {
|
|
|
84
81
|
}
|
|
85
82
|
triggerChecks() {
|
|
86
83
|
return __awaiter(this, void 0, void 0, function* () {
|
|
87
|
-
if (!
|
|
84
|
+
if (!this.entityId)
|
|
88
85
|
throw new Error("Entity id not found in local state. Has entity been created yet?");
|
|
89
|
-
|
|
90
|
-
yield this.frankie.post(`/data/v1/applicants/${entityId}/checks`);
|
|
86
|
+
yield this.frankie.post(`/data/v1/applicants/${this.entityId}/checks`);
|
|
91
87
|
return this.getLatestCheckResults();
|
|
92
88
|
});
|
|
93
89
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicantClient.js","sourceRoot":"","sources":["../../../../../modules/frankie-client/clients/ApplicantClient.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,SAAS,EAAqB,MAAM,wCAAwC,CAAC;AACtF,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAoB,MAAM,uCAAuC,CAAC;AACnF,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ApplicantClient.js","sourceRoot":"","sources":["../../../../../modules/frankie-client/clients/ApplicantClient.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,SAAS,EAAqB,MAAM,wCAAwC,CAAC;AACtF,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAoB,MAAM,uCAAuC,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;;GAGG;AACH,MAAM,OAAO,eAAgB,SAAQ,UAAU;IACvC,IAAI;;YACR;;;eAGG;YACH,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;YACrC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO;iBAC5B,GAAG,CAAgB,qBAAqB,EAAE;gBACzC,MAAM,EAAE;oBACN,SAAS;oBACT,QAAQ;iBACT;aACF,CAAC;iBACD,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;gBACjB,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;gBAC3B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;gBACxC,OAAO,IAAI,CAAC;YACd,CAAC,CAAC;iBACD,IAAI,CAAC,CAAC,IAAI,EA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I,CAAC;gBAChC,OAAO,YAAY,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;YAC7C,CAAC,CAAC,CAAC;QACL,CAAC;KAAA;IACK,aAAa;;YACjB,IAAI,CAAC,IAAI,CAAC,QAAQ;gBAAE,MAAM,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAC;YACxG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,uBAAuB,IAAI,CAAC,QAAQ,SAAS,CAAC,CAAC;YACvE,OAAO,IAAI,CAAC,qBAAqB,EAAE,CAAC;QACtC,CAAC;KAAA;CACF;AACD,SAAS,4BAA4B,CAAC,IAAmB;;IACvD,OAAO;QACL,SAAS,EAAE,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;QAC7C,SAAS,EAAE,MAAA,MAAA,IAAI,CAAC,SAAS,0CAAE,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,mCAAI,EAAE;KACxD,CAAC;AACJ,CAAC"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { ApplicantId } from "../../common/types/Session";
|
|
2
|
-
import { ReadonlyDeep } from "type-fest";
|
|
3
1
|
import { FrankieApiClient } from "../FrankieApiClient";
|
|
4
2
|
export declare class BaseClient {
|
|
5
3
|
protected frankie: FrankieApiClient;
|
|
6
4
|
constructor(frankie: FrankieApiClient);
|
|
7
|
-
get
|
|
5
|
+
get reference(): string | null;
|
|
8
6
|
get entityId(): string | null;
|
|
9
7
|
set entityId(v: string | null);
|
|
10
8
|
}
|
|
@@ -2,12 +2,13 @@ export class BaseClient {
|
|
|
2
2
|
constructor(frankie) {
|
|
3
3
|
this.frankie = frankie;
|
|
4
4
|
}
|
|
5
|
-
get
|
|
6
|
-
|
|
5
|
+
get reference() {
|
|
6
|
+
var _a;
|
|
7
|
+
return (_a = this.frankie.session.reference) !== null && _a !== void 0 ? _a : null;
|
|
7
8
|
}
|
|
8
9
|
get entityId() {
|
|
9
10
|
var _a;
|
|
10
|
-
return (_a = this.
|
|
11
|
+
return (_a = this.frankie.session.entityId) !== null && _a !== void 0 ? _a : null;
|
|
11
12
|
}
|
|
12
13
|
set entityId(v) {
|
|
13
14
|
this.frankie.entityId = v;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseClient.js","sourceRoot":"","sources":["../../../../../modules/frankie-client/clients/BaseClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BaseClient.js","sourceRoot":"","sources":["../../../../../modules/frankie-client/clients/BaseClient.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,UAAU;IACrB,YAAsB,OAAyB;QAAzB,YAAO,GAAP,OAAO,CAAkB;IAAG,CAAC;IAEnD,IAAI,SAAS;;QACX,OAAO,MAAA,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,mCAAI,IAAI,CAAC;IAChD,CAAC;IACD,IAAI,QAAQ;;QACV,OAAO,MAAA,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,mCAAI,IAAI,CAAC;IAC/C,CAAC;IACD,IAAI,QAAQ,CAAC,CAAgB;QAC3B,IAAI,CAAC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IAC5B,CAAC;CACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Document } from "
|
|
1
|
+
import { Document } from "@module/common/shared/models/Document";
|
|
2
2
|
import type { FrankieApiClient } from "../FrankieApiClient";
|
|
3
3
|
import { BaseClient } from "./BaseClient";
|
|
4
4
|
export declare class OCRClient extends BaseClient {
|
|
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { Document } from "
|
|
10
|
+
import { Document } from "@module/common/shared/models/Document";
|
|
11
11
|
import { BaseClient } from "./BaseClient";
|
|
12
12
|
export class OCRClient extends BaseClient {
|
|
13
13
|
constructor(frankie) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TelemetryEvent } from "
|
|
1
|
+
import { TelemetryEvent } from "@module/common/shared/models/TelemetryEvent";
|
|
2
2
|
import { BaseClient } from "./BaseClient";
|
|
3
3
|
export declare class TelemetryEventsClient extends BaseClient {
|
|
4
4
|
dispatch(payload: TelemetryEvent): Promise<import("axios").AxiosResponse<void, any>>;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { EventHub } from "
|
|
2
|
-
import { GlobalEvents, OneSdkRootParameters } from "
|
|
1
|
+
import { EventHub } from "@module/common";
|
|
2
|
+
import { GlobalEvents, OneSdkRootParameters } from "@module/sdk/types";
|
|
3
|
+
import { SessionContext } from "../session/SessionContext";
|
|
3
4
|
import { DummyFrankieApiClient } from "./DummyFrankieApiClient";
|
|
4
5
|
import { FrankieApiClient } from "./FrankieApiClient";
|
|
5
|
-
declare type
|
|
6
|
+
declare type Mode = OneSdkRootParameters["mode"];
|
|
7
|
+
declare type Options = {
|
|
6
8
|
globalEventHub: EventHub<GlobalEvents>;
|
|
9
|
+
mode: Mode;
|
|
10
|
+
session: SessionContext;
|
|
7
11
|
};
|
|
8
12
|
export declare function mkFrankieClient(options: Options): Promise<FrankieApiClient>;
|
|
9
13
|
export { FrankieApiClient, DummyFrankieApiClient };
|
|
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { SdkModes } from "
|
|
10
|
+
import { SdkModes } from "@module/sdk/types";
|
|
11
11
|
import { Status } from "./clients/OCRClient";
|
|
12
12
|
import { DummyFrankieApiClient } from "./DummyFrankieApiClient";
|
|
13
13
|
import { FrankieApiClient } from "./FrankieApiClient";
|
|
@@ -24,13 +24,11 @@ const defaultMockOptions = {
|
|
|
24
24
|
};
|
|
25
25
|
const isDummy = (mode) => (typeof mode === "string" ? mode : mode.modeName);
|
|
26
26
|
export function mkFrankieClient(options) {
|
|
27
|
-
var _a;
|
|
28
27
|
return __awaiter(this, void 0, void 0, function* () {
|
|
29
28
|
if (isDummy(options.mode) === SdkModes.DUMMY) {
|
|
30
29
|
// initialise dummy client with optional token
|
|
31
30
|
const dummyClient = new DummyFrankieApiClient(Object.assign(Object.assign({}, options), { defaultDelay: 200 }));
|
|
32
|
-
|
|
33
|
-
dummyClient.setToken(options.session.token);
|
|
31
|
+
dummyClient.session = options.session;
|
|
34
32
|
// resolve mock options either from mode: { options } or if mode: "dummy", then use default mock options
|
|
35
33
|
const simplifiedMockOptions = typeof options.mode === "string" ? defaultMockOptions : options.mode.mocks;
|
|
36
34
|
const mockOptions = resolveSimplifiedMockOptions(simplifiedMockOptions);
|
|
@@ -43,7 +41,8 @@ export function mkFrankieClient(options) {
|
|
|
43
41
|
}
|
|
44
42
|
// if not in dummy mode, simply initialise the regular api client with the provided token
|
|
45
43
|
const client = new FrankieApiClient();
|
|
46
|
-
|
|
44
|
+
client.session = options.session;
|
|
45
|
+
yield client.validateSession();
|
|
47
46
|
return client;
|
|
48
47
|
});
|
|
49
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../modules/frankie-client/index.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAsC,QAAQ,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../modules/frankie-client/index.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAsC,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAEjF,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,QAAQ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F,MAAM,MAAM,GAAG,IAAI,gBAAgB,EAAE,CAAC;QACtC,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QACjC,MAAM,MAAM,CAAC,eAAe,EAAE,CAAC;QAC/B,OAAO,MAAM,CAAC;IAChB,CAAC;CAAA;AACD,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Applicant } from "
|
|
2
|
-
import { Document } from "
|
|
3
|
-
import { DummyFrankieApiClient } from "
|
|
1
|
+
import { Applicant } from "@module/common/shared/models/Applicant";
|
|
2
|
+
import { Document } from "@module/common/shared/models/Document";
|
|
3
|
+
import { DummyFrankieApiClient } from "@module/frankie-client";
|
|
4
4
|
import { MockOptions as MockOptionsPartial } from "..";
|
|
5
5
|
import { DeepPartial } from "../../../common/shared/models/general";
|
|
6
6
|
export declare type Options = {
|
|
@@ -10,7 +10,7 @@ export declare type Options = {
|
|
|
10
10
|
declare type MockOptions = MockOptionsPartial & {
|
|
11
11
|
preloadedIndividual: Options;
|
|
12
12
|
};
|
|
13
|
-
export declare function
|
|
13
|
+
export declare function resolveIndividualData(options: Options): {
|
|
14
14
|
individual: Applicant & {
|
|
15
15
|
name: {
|
|
16
16
|
givenName: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Applicant } from "
|
|
2
|
-
import { CheckSummary } from "
|
|
3
|
-
import { Document } from "
|
|
1
|
+
import { Applicant } from "@module/common/shared/models/Applicant";
|
|
2
|
+
import { CheckSummary } from "@module/common/shared/models/CheckSummary";
|
|
3
|
+
import { Document } from "@module/common/shared/models/Document";
|
|
4
4
|
import merge from "lodash.merge";
|
|
5
5
|
import { v4 as uuid } from "uuid";
|
|
6
6
|
import { URL_PARAM } from "../../DummyFrankieApiClient";
|
|
7
|
-
export function
|
|
7
|
+
export function resolveIndividualData(options) {
|
|
8
8
|
var _a, _b;
|
|
9
9
|
return {
|
|
10
10
|
individual: merge(new Applicant(), {
|
|
@@ -22,7 +22,7 @@ export function resolveIndividualDdata(options) {
|
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
export function loadExistingApplicant(client, options) {
|
|
25
|
-
const { individual, documents } =
|
|
25
|
+
const { individual, documents } = resolveIndividualData(options.preloadedIndividual);
|
|
26
26
|
client.stubResponse({ url: "/data/v2/applicant", method: "get" }, (config) => {
|
|
27
27
|
if (config.params.entityId)
|
|
28
28
|
individual.entityId = config.params.entityId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadIndividual.js","sourceRoot":"","sources":["../../../../../../modules/frankie-client/mocks/individual/loadIndividual.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AAEjE,OAAO,KAAK,MAAM,cAAc,CAAC;AACjC,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAAC;AAGlC,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAOxD,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"loadIndividual.js","sourceRoot":"","sources":["../../../../../../modules/frankie-client/mocks/individual/loadIndividual.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AAEjE,OAAO,KAAK,MAAM,cAAc,CAAC;AACjC,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAAC;AAGlC,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAOxD,MAAM,UAAU,qBAAqB,CAAC,OAAgB;;IACpD,OAAO;QACL,UAAU,EAAE,K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AAU,CAAC,MAAM,EAAE;gBAC9B,SAAS,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;aAC5C;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AACD,MAAM,UAAU,iBAAiB,CAAC,MAA6B;IAC7D,MAAM,CAAC,YAAY,CACjB,EAAE,GAAG,EAAE,oBAAoB,EAAE,MAAM,EAAE,KAAK,EAAE,EAC5C;QACE,KAAK,EAAE,sBAAsB;QAC7B,MAAM,EAAE,GAAG;KACZ,CACF,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC;AACD,MAAM,UAAU,0BAA0B,CAAC,MAA6B;IACtE,MAAM,YAAY,GAAG,YAAY,CAAC,OAAO,EAAE,CAAC;IAC5C,YAAY,CAAC,MAAM,CAAC,IAAI,GAAG,QAAQ,CAAC;IACpC,YAAY,CAAC,MAAM,CAAC,KAAK,GAAG,QAAQ,CAAC;IACrC,YAAY,CAAC,MAAM,CAAC,GAAG,GAAG,QAAQ,CAAC;IACnC,YAAY,CAAC,SAAS,GAAG,EAAE,CAAC;IAE5B,MAAM,CAAC,YAAY,CACjB,EAAE,GAAG,EAAE,IAAI,MAAM,CAAC,uBAAuB,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EACtE;QACE,KAAK,EAAE,oBAAoB;QAC3B,IAAI,EAAE;YACJ,YAAY,EAAE,YAAY,CAAC,MAAM,EAAE;SACpC;KACF,CACF,CAAC;IACF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Document, Scan } from "
|
|
2
|
-
import { DeepPartial } from "
|
|
1
|
+
import { Document, Scan } from "@module/common/shared/models/Document";
|
|
2
|
+
import { DeepPartial } from "@module/common/shared/models/general";
|
|
3
3
|
import { PartialDeep } from "type-fest";
|
|
4
4
|
import { MockOptions as MockOptionsPartial } from "..";
|
|
5
5
|
import { OCRDocumentType, Status } from "../../clients/OCRClient";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Exposes functions that offer a simplified conversion of MockOptions for external usage
|
|
3
3
|
*/
|
|
4
|
-
import { Applicant } from "
|
|
5
|
-
import { Document, Scan, TScan } from "
|
|
6
|
-
import { DeepPartial } from "
|
|
4
|
+
import { Applicant } from "@module/common/shared/models/Applicant";
|
|
5
|
+
import { Document, Scan, TScan } from "@module/common/shared/models/Document";
|
|
6
|
+
import { DeepPartial } from "@module/common/shared/models/general";
|
|
7
7
|
import { MockOptions } from ".";
|
|
8
8
|
import { OCRDocumentType, Status } from "../clients/OCRClient";
|
|
9
9
|
export declare function resolveSimplifiedMockOptions(simplifiedOptions: SimplifiedMockOptions): MockOptions;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import * as utils from "
|
|
2
|
-
import { FrankieApiClient } from "
|
|
1
|
+
import * as utils from "@module/common";
|
|
2
|
+
import { FrankieApiClient } from "@module/frankie-client";
|
|
3
3
|
import { SdkModes } from "./sdk/types";
|
|
4
4
|
/**
|
|
5
5
|
* Explicitly Export types (with type-only exports) and enums (without "type") at the root when importing into a typescript project via npm
|
|
6
6
|
* https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export
|
|
7
7
|
*/
|
|
8
|
-
export { ENVIRONMENTS } from "
|
|
9
|
-
export type { Accessors, mkEventHub, ReadonlyAccessors } from "
|
|
10
|
-
export type { CheckSummary } from "
|
|
11
|
-
export type { DeviceModule, DeviceModuleContext as DeviceModuleContext, Events as DeviceModuleEvents, } from "
|
|
12
|
-
export type { FrankieApiClient } from "
|
|
13
|
-
export { Status as OCRStatus } from "
|
|
8
|
+
export { ENVIRONMENTS } from "@module/common";
|
|
9
|
+
export type { Accessors, mkEventHub, ReadonlyAccessors } from "@module/common";
|
|
10
|
+
export type { CheckSummary } from "@module/common/shared/models/CheckSummary";
|
|
11
|
+
export type { DeviceModule, DeviceModuleContext as DeviceModuleContext, Events as DeviceModuleEvents, } from "@module/device";
|
|
12
|
+
export type { FrankieApiClient } from "@module/frankie-client";
|
|
13
|
+
export { Status as OCRStatus } from "@module/ocr";
|
|
14
14
|
export type { OneSdkContext, OneSdkRootParameters as OneSdkConfiguration } from "./sdk";
|
|
15
15
|
export { SdkModes as SdkMode };
|
|
16
16
|
declare const OneSDK: ((p: import("./sdk").OneSdkRootParameters) => Promise<import("./sdk").OneSdkContext>) & {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import * as utils from "
|
|
2
|
-
import { FrankieApiClient } from "
|
|
3
|
-
import packageMeta from "
|
|
1
|
+
import * as utils from "@module/common";
|
|
2
|
+
import { FrankieApiClient } from "@module/frankie-client";
|
|
3
|
+
import packageMeta from "@package-meta";
|
|
4
4
|
import { oneSdk } from "./sdk";
|
|
5
5
|
import { SdkModes } from "./sdk/types";
|
|
6
6
|
/**
|
|
7
7
|
* Explicitly Export types (with type-only exports) and enums (without "type") at the root when importing into a typescript project via npm
|
|
8
8
|
* https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export
|
|
9
9
|
*/
|
|
10
|
-
export { ENVIRONMENTS } from "
|
|
11
|
-
export { Status as OCRStatus } from "
|
|
10
|
+
export { ENVIRONMENTS } from "@module/common";
|
|
11
|
+
export { Status as OCRStatus } from "@module/ocr";
|
|
12
12
|
export { SdkModes as SdkMode };
|
|
13
13
|
// Exported OneSdk object
|
|
14
14
|
// Via CDN, it will be available globally as [window.]OneSdk
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Accessors } from "
|
|
2
|
-
import { Document } from "
|
|
1
|
+
import { Accessors } from "@module/common";
|
|
2
|
+
import { Document } from "@module/common/shared/models/Document";
|
|
3
3
|
import { IndividualModuleContext } from "../types";
|
|
4
4
|
declare type MkAddDocumentOptions = {
|
|
5
5
|
documents$: Accessors<Document[]>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { EventHub, ReactiveStore } from "
|
|
2
|
-
import { Applicant } from "
|
|
3
|
-
import { Document } from "
|
|
4
|
-
import { ApplicantClient } from "
|
|
1
|
+
import { EventHub, ReactiveStore } from "@module/common";
|
|
2
|
+
import { Applicant } from "@module/common/shared/models/Applicant";
|
|
3
|
+
import { Document } from "@module/common/shared/models/Document";
|
|
4
|
+
import { ApplicantClient } from "@module/frankie-client/clients/ApplicantClient";
|
|
5
5
|
import { Events } from "../types/events";
|
|
6
6
|
export declare const mkSearchMethod: (deps: {
|
|
7
7
|
client: ApplicantClient;
|
|
@@ -7,9 +7,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { OneSDKError } from "
|
|
11
|
-
import { Applicant } from "
|
|
12
|
-
import { hasEntityId } from "../../common/types/Session";
|
|
10
|
+
import { OneSDKError } from "@module/common";
|
|
11
|
+
import { Applicant } from "@module/common/shared/models/Applicant";
|
|
13
12
|
import { Profile } from "../../common/shared/models/Profile";
|
|
14
13
|
export const mkSearchMethod = (deps) => () => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
14
|
const { client, eventHub, state$, recipeName } = deps;
|
|
@@ -23,8 +22,8 @@ export const mkSearchMethod = (deps) => () => __awaiter(void 0, void 0, void 0,
|
|
|
23
22
|
hasLoaded = true;
|
|
24
23
|
}
|
|
25
24
|
catch (e) {
|
|
26
|
-
if (
|
|
27
|
-
const errorMessage = `Critical error! There was an issue loading the individual's details. Is the entityId (${client.
|
|
25
|
+
if (client.entityId) {
|
|
26
|
+
const errorMessage = `Critical error! There was an issue loading the individual's details. Is the entityId (${client.entityId}) used to create this session valid?`;
|
|
28
27
|
eventHub.emit("error", new OneSDKError(errorMessage, e));
|
|
29
28
|
hasLoaded = false;
|
|
30
29
|
throw new Error(errorMessage);
|
|
@@ -35,7 +34,7 @@ export const mkSearchMethod = (deps) => () => __awaiter(void 0, void 0, void 0,
|
|
|
35
34
|
documents = [];
|
|
36
35
|
const profile = new Profile(recipeName, "electronic");
|
|
37
36
|
applicant.profile = profile;
|
|
38
|
-
applicant.customerReference = client.
|
|
37
|
+
applicant.customerReference = client.reference;
|
|
39
38
|
}
|
|
40
39
|
}
|
|
41
40
|
const isPreloaded = Boolean(applicant === null || applicant === void 0 ? void 0 : applicant.entityId);
|
|
@@ -46,6 +45,6 @@ export const mkSearchMethod = (deps) => () => __awaiter(void 0, void 0, void 0,
|
|
|
46
45
|
isPreloaded,
|
|
47
46
|
});
|
|
48
47
|
if (hasLoaded)
|
|
49
|
-
eventHub.emit("data_loaded",
|
|
48
|
+
eventHub.emit("data_loaded", { entityId: client.entityId, reference: client.reference, isPreloaded });
|
|
50
49
|
});
|
|
51
50
|
//# sourceMappingURL=search.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../../../modules/individual/actions/search.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAY,WAAW,EAAiB,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../../../modules/individual/actions/search.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAY,WAAW,EAAiB,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AAGnE,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAG7D,MAAM,CAAC,MAAM,cAAc,GACzB,CAAC,IAA+G,EAAE,EAAE,CACpH,GAAS,EAAE;IACT,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;IACtD,IAAI,SAAS,GAAc,IAAI,CAAC;IAChC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C"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Accessors, EventHub } from "
|
|
2
|
-
import { Applicant } from "
|
|
3
|
-
import { CheckSummary } from "
|
|
4
|
-
import { Document } from "
|
|
5
|
-
import { ApplicantClient } from "
|
|
6
|
-
import { GlobalEvents } from "
|
|
1
|
+
import { Accessors, EventHub } from "@module/common";
|
|
2
|
+
import { Applicant } from "@module/common/shared/models/Applicant";
|
|
3
|
+
import { CheckSummary } from "@module/common/shared/models/CheckSummary";
|
|
4
|
+
import { Document } from "@module/common/shared/models/Document";
|
|
5
|
+
import { ApplicantClient } from "@module/frankie-client/clients/ApplicantClient";
|
|
6
|
+
import { GlobalEvents } from "@module/sdk/types";
|
|
7
7
|
import { PublicAccessors } from "../types";
|
|
8
8
|
import { Events } from "../types/events";
|
|
9
9
|
export declare const mkSubmitMethod: (deps: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { mkEventHub, mkEventListener, ReactiveStore } from "
|
|
2
|
-
import { ApplicantClient } from "
|
|
1
|
+
import { mkEventHub, mkEventListener, ReactiveStore } from "@module/common";
|
|
2
|
+
import { ApplicantClient } from "@module/frankie-client/clients/ApplicantClient";
|
|
3
3
|
import { mkAddConsents } from "./actions/consents";
|
|
4
4
|
import { mkAddDocument, mkUpdateDocument } from "./actions/documents";
|
|
5
5
|
import { subscribeAndEmitEvents } from "./actions/emitEvents";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Address } from "
|
|
2
|
-
import { Applicant } from "
|
|
3
|
-
import type { CheckSummary } from "
|
|
4
|
-
import type { Document } from "
|
|
5
|
-
import type { BaseModuleOptions, ModuleContext } from "
|
|
1
|
+
import type { Address } from "@module/common/shared/models/Address";
|
|
2
|
+
import { Applicant } from "@module/common/shared/models/Applicant";
|
|
3
|
+
import type { CheckSummary } from "@module/common/shared/models/CheckSummary";
|
|
4
|
+
import type { Document } from "@module/common/shared/models/Document";
|
|
5
|
+
import type { BaseModuleOptions, ModuleContext } from "@module/sdk/types";
|
|
6
6
|
import { AccessFunction, AccessorsDictionary } from "../../common/types/Accessors";
|
|
7
7
|
import { Events } from "./events";
|
|
8
8
|
export interface IndividualModule {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "version": "0.5.
|
|
1
|
+
{ "version": "0.5.2-rc.6" }
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Accessors, EventHub, ReadonlyAccessors } from "
|
|
2
|
-
import { Document } from "
|
|
3
|
-
import { CompleteStatus, FailedStatus, InputRequiredStatus, OCRClient, OCRResults, Status } from "
|
|
4
|
-
import { IndividualModuleContext } from "
|
|
5
|
-
import { GlobalEvents } from "
|
|
1
|
+
import { Accessors, EventHub, ReadonlyAccessors } from "@module/common";
|
|
2
|
+
import { Document } from "@module/common/shared/models/Document";
|
|
3
|
+
import { CompleteStatus, FailedStatus, InputRequiredStatus, OCRClient, OCRResults, Status } from "@module/frankie-client/clients/OCRClient";
|
|
4
|
+
import { IndividualModuleContext } from "@module/individual/types";
|
|
5
|
+
import { GlobalEvents } from "@module/sdk/types";
|
|
6
6
|
import { Events } from "../types";
|
|
7
7
|
declare type Dependencies = {
|
|
8
8
|
_expectedSide$: ReadonlyAccessors<"front" | "back">;
|
|
@@ -7,8 +7,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { Document } from "
|
|
11
|
-
import { isCompleteStatus, isFailedStatus, isInputRequiredStatus, Status, } from "
|
|
10
|
+
import { Document } from "@module/common/shared/models/Document";
|
|
11
|
+
import { isCompleteStatus, isFailedStatus, isInputRequiredStatus, Status, } from "@module/frankie-client/clients/OCRClient";
|
|
12
12
|
import { filter, Subject, takeUntil, takeWhile } from "rxjs";
|
|
13
13
|
import { OneSDKError } from "../../common/errors/OneSDKError";
|
|
14
14
|
/**
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ReactiveStore } from "
|
|
2
|
-
import { Status } from "
|
|
1
|
+
import { ReactiveStore } from "@module/common";
|
|
2
|
+
import { Status } from "@module/frankie-client/clients/OCRClient";
|
|
3
3
|
import { OcrModule, State } from "./types";
|
|
4
4
|
export { Status };
|
|
5
5
|
export declare const ocrModule: OcrModule;
|
|
6
6
|
export declare function initialiseLocalState(state$: ReactiveStore<State>): {
|
|
7
|
-
status$: import("
|
|
8
|
-
failedStatus$: import("
|
|
9
|
-
document$: import("
|
|
10
|
-
files$: import("
|
|
11
|
-
isPreloaded$: import("
|
|
12
|
-
_expectedSide$: import("
|
|
7
|
+
status$: import("@module/common").Accessors<Status.COMPLETE | import("@module/frankie-client/clients/OCRClient").InputRequiredStatus, Status.COMPLETE | import("@module/frankie-client/clients/OCRClient").InputRequiredStatus>;
|
|
8
|
+
failedStatus$: import("@module/common").Accessors<import("@module/frankie-client/clients/OCRClient").FailedStatus, import("@module/frankie-client/clients/OCRClient").FailedStatus>;
|
|
9
|
+
document$: import("@module/common").Accessors<import("../common/shared/models/Document").Document, import("../common/shared/models/Document").Document>;
|
|
10
|
+
files$: import("@module/common").Accessors<File[], File[]>;
|
|
11
|
+
isPreloaded$: import("@module/common").Accessors<boolean, boolean>;
|
|
12
|
+
_expectedSide$: import("@module/common").ReadonlyAccessors<"front" | "back">;
|
|
13
13
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { mkEventHub, mkEventListener, ReactiveStore } from "
|
|
2
|
-
import { isInputRequiredStatus, OCRClient, Status } from "
|
|
1
|
+
import { mkEventHub, mkEventListener, ReactiveStore } from "@module/common";
|
|
2
|
+
import { isInputRequiredStatus, OCRClient, Status } from "@module/frankie-client/clients/OCRClient";
|
|
3
3
|
import { mkStartMethod } from "./actions/start";
|
|
4
4
|
export { Status };
|
|
5
5
|
export const ocrModule = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Document } from "
|
|
2
|
-
import { Status } from "
|
|
1
|
+
import { Document } from "@module/common/shared/models/Document";
|
|
2
|
+
import { Status } from "@module/frankie-client/clients/OCRClient";
|
|
3
3
|
export declare type Events = {
|
|
4
4
|
input_required: [Info, Status, ProvideFile];
|
|
5
5
|
results: [{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FailedStatus, InputRequiredStatus, Status } from "
|
|
2
|
-
import { BaseModuleOptions, ModuleContext } from "
|
|
1
|
+
import { FailedStatus, InputRequiredStatus, Status } from "@module/frankie-client/clients/OCRClient";
|
|
2
|
+
import { BaseModuleOptions, ModuleContext } from "@module/sdk/types";
|
|
3
3
|
import { Document } from "../../common/shared/models/Document";
|
|
4
4
|
import { AccessFunction, AccessorsDictionary } from "../../common/types/Accessors";
|
|
5
5
|
import { Events } from "./events";
|
|
@@ -7,15 +7,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { individualModule } from "
|
|
10
|
+
import { individualModule } from "@module/individual";
|
|
11
11
|
import { mkEventListener } from "../common";
|
|
12
|
+
import { sessionModule } from "../session";
|
|
12
13
|
import { mkComponentLoader } from "./initialisation/componentLoader";
|
|
13
14
|
import { parseConfiguration } from "./initialisation/configurationParser";
|
|
14
15
|
import { mkSharedDependencies } from "./initialisation/sharedDependencies";
|
|
15
16
|
export const oneSdk = {
|
|
16
17
|
initialise: function (oneSdkOptions) {
|
|
17
18
|
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
-
const
|
|
19
|
+
const sessionMeta = sessionModule.initialise(oneSdkOptions);
|
|
20
|
+
const sharedDependencies = yield mkSharedDependencies(oneSdkOptions, sessionMeta);
|
|
19
21
|
const { globalEventHub } = sharedDependencies;
|
|
20
22
|
try {
|
|
21
23
|
const { sharedState, warnings } = yield parseConfiguration(oneSdkOptions, sharedDependencies);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../modules/sdk/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAI3E,MAAM,CAAC,MAAM,MAAM,GAAiB;IAClC,UAAU,EAAE,UAAgB,aAAa;;YACvC,MAAM,kBAAkB,GAAG,MAAM,oBAAoB,CAAC,aAAa,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../modules/sdk/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAI3E,MAAM,CAAC,MAAM,MAAM,GAAiB;IAClC,UAAU,EAAE,UAAgB,aAAa;;YACvC,MAAM,WAAW,GAAG,aAAa,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;YAC5D,MAAM,kBAAkB,GAAG,MAAM,oBAAoB,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;YAClF,MAAM,EAAE,cAAc,EAAE,GAAG,kBAAkB,CAAC;YAC9C,IAAI;gBACF,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,MAAM,kBAAkB,CAAC,aAAa,EAA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