@autentikar/step 2.0.0-alpha.25 → 2.0.0-alpha.27
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/context.d.ts
CHANGED
|
@@ -5,14 +5,38 @@ interface Step {
|
|
|
5
5
|
params<TValue = unknown>(): Promise<TValue | undefined>;
|
|
6
6
|
milestone(type: string, status: string, success: boolean): Promise<void>;
|
|
7
7
|
future(type: string, id: string, ttl: number): Promise<void>;
|
|
8
|
+
identity(organization_id: string, instance_id: string, link_session: string | undefined, identity: IdentityDto, data: StepIdentityData): Promise<any>;
|
|
8
9
|
}
|
|
9
10
|
|
|
11
|
+
type StepIdentityData = {
|
|
12
|
+
type: "CARD";
|
|
13
|
+
doc_type: IdentityDto["doc_type"];
|
|
14
|
+
images: {
|
|
15
|
+
face: string;
|
|
16
|
+
front: string;
|
|
17
|
+
back?: string;
|
|
18
|
+
};
|
|
19
|
+
} | {
|
|
20
|
+
type: "FACE";
|
|
21
|
+
provider: "FACETEC" | "IDENTY";
|
|
22
|
+
audit_low: string;
|
|
23
|
+
audit: string;
|
|
24
|
+
map: string;
|
|
25
|
+
} | {
|
|
26
|
+
type: "EMAIL";
|
|
27
|
+
email: string;
|
|
28
|
+
} | {
|
|
29
|
+
type: "CELLPHONE";
|
|
30
|
+
cellphone: string;
|
|
31
|
+
country?: string;
|
|
32
|
+
};
|
|
10
33
|
declare class StepRequest implements Step {
|
|
11
34
|
private step;
|
|
12
35
|
constructor(params: Step);
|
|
13
36
|
future(type: string, id: string, ttl: number): Promise<void>;
|
|
14
37
|
milestone(type: string, status: string, success: boolean): Promise<void>;
|
|
15
38
|
params<TValue = unknown>(): Promise<TValue | undefined>;
|
|
39
|
+
identity(organization_id: string, instance_id: string, link_session: string | undefined, identity: IdentityDto, data: StepIdentityData): Promise<any>;
|
|
16
40
|
}
|
|
17
41
|
declare const AppEnvironmentsSchema: z.ZodObject<{
|
|
18
42
|
STAGING: z.ZodEnum<["LOCAL", "QA", "PROD"]>;
|
|
@@ -24,6 +48,20 @@ declare const AppEnvironmentsSchema: z.ZodObject<{
|
|
|
24
48
|
STAGING: "LOCAL" | "QA" | "PROD";
|
|
25
49
|
STEP_TYPE: string;
|
|
26
50
|
}>;
|
|
51
|
+
declare const IdentitySchemaDto: z.ZodObject<{
|
|
52
|
+
country: z.ZodString;
|
|
53
|
+
doc_type: z.ZodString;
|
|
54
|
+
id_num: z.ZodString;
|
|
55
|
+
}, "strip", z.ZodTypeAny, {
|
|
56
|
+
country: string;
|
|
57
|
+
doc_type: string;
|
|
58
|
+
id_num: string;
|
|
59
|
+
}, {
|
|
60
|
+
country: string;
|
|
61
|
+
doc_type: string;
|
|
62
|
+
id_num: string;
|
|
63
|
+
}>;
|
|
64
|
+
type IdentityDto = z.infer<typeof IdentitySchemaDto>;
|
|
27
65
|
type AppEnvironments = z.infer<typeof AppEnvironmentsSchema>;
|
|
28
66
|
type Staging = AppEnvironments["STAGING"];
|
|
29
67
|
type MethodContextOrganization = {
|
|
@@ -60,13 +98,18 @@ type MethodContext = {
|
|
|
60
98
|
flow: MethodContextFlow;
|
|
61
99
|
instance: MethodContextInstance;
|
|
62
100
|
step: MethodContextStep;
|
|
101
|
+
link_session: string | undefined;
|
|
63
102
|
};
|
|
64
103
|
type Method = (req: Request, output: Record<string, string>, context: MethodContext) => Promise<unknown>;
|
|
104
|
+
type AppEnvVariables = {
|
|
105
|
+
instance: {
|
|
106
|
+
id: string;
|
|
107
|
+
session: string | undefined;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
65
110
|
type AppEnv = {
|
|
66
111
|
Bindings: AppEnvironments;
|
|
67
|
-
Variables:
|
|
68
|
-
instance: string;
|
|
69
|
-
};
|
|
112
|
+
Variables: AppEnvVariables;
|
|
70
113
|
};
|
|
71
114
|
declare class StepDefinition {
|
|
72
115
|
readonly id: string;
|
|
@@ -116,4 +159,4 @@ declare class StepContext {
|
|
|
116
159
|
isExpired(): boolean | 0 | undefined;
|
|
117
160
|
}
|
|
118
161
|
|
|
119
|
-
export { type AppEnvironments as A, FlowContext as F, type MethodContextOrganization as M, type PersistentType as P, StorageItem as S, type Step as a,
|
|
162
|
+
export { type AppEnvironments as A, FlowContext as F, IdentitySchemaDto as I, type MethodContextOrganization as M, type PersistentType as P, StorageItem as S, type Step as a, type StepIdentityData as b, StepRequest as c, type IdentityDto as d, type Staging as e, type MethodContextFlow as f, type MethodContextInstance as g, type MethodContextStep as h, type MethodContext as i, type Method as j, type AppEnvVariables as k, type AppEnv as l, StepDefinition as m, StepInstance as n, StepContext as o };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import 'file-type/core';
|
|
2
2
|
import 'zod';
|
|
3
|
-
export {
|
|
3
|
+
export { l as AppEnv, k as AppEnvVariables, A as AppEnvironments, F as FlowContext, d as IdentityDto, I as IdentitySchemaDto, j as Method, i as MethodContext, f as MethodContextFlow, g as MethodContextInstance, M as MethodContextOrganization, h as MethodContextStep, P as PersistentType, e as Staging, o as StepContext, m as StepDefinition, b as StepIdentityData, n as StepInstance, c as StepRequest, S as StorageItem } from './index-HrQWGcou.js';
|
package/dist/index.js
CHANGED
|
@@ -31,6 +31,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var src_exports = {};
|
|
32
32
|
__export(src_exports, {
|
|
33
33
|
FlowContext: () => FlowContext,
|
|
34
|
+
IdentitySchemaDto: () => IdentitySchemaDto,
|
|
34
35
|
StepContext: () => StepContext,
|
|
35
36
|
StepDefinition: () => StepDefinition,
|
|
36
37
|
StepInstance: () => StepInstance,
|
|
@@ -54,11 +55,25 @@ var StepRequest = class {
|
|
|
54
55
|
params() {
|
|
55
56
|
return this.step.params();
|
|
56
57
|
}
|
|
58
|
+
identity(organization_id, instance_id, link_session, identity, data) {
|
|
59
|
+
return this.step.identity(
|
|
60
|
+
organization_id,
|
|
61
|
+
instance_id,
|
|
62
|
+
link_session,
|
|
63
|
+
identity,
|
|
64
|
+
data
|
|
65
|
+
);
|
|
66
|
+
}
|
|
57
67
|
};
|
|
58
68
|
var AppEnvironmentsSchema = import_zod.z.object({
|
|
59
69
|
STAGING: import_zod.z.enum(["LOCAL", "QA", "PROD"]),
|
|
60
70
|
STEP_TYPE: import_zod.z.string()
|
|
61
71
|
});
|
|
72
|
+
var IdentitySchemaDto = import_zod.z.object({
|
|
73
|
+
country: import_zod.z.string(),
|
|
74
|
+
doc_type: import_zod.z.string(),
|
|
75
|
+
id_num: import_zod.z.string()
|
|
76
|
+
});
|
|
62
77
|
async function getContentTypeFromBuffer(buffer) {
|
|
63
78
|
const type = await import_file_type.default.fromBuffer(buffer);
|
|
64
79
|
if (type) {
|
|
@@ -129,6 +144,7 @@ var StepContext = class {
|
|
|
129
144
|
// Annotate the CommonJS export names for ESM import in node:
|
|
130
145
|
0 && (module.exports = {
|
|
131
146
|
FlowContext,
|
|
147
|
+
IdentitySchemaDto,
|
|
132
148
|
StepContext,
|
|
133
149
|
StepDefinition,
|
|
134
150
|
StepInstance,
|