@autentikar/step 2.1.0-alpha.8 → 2.2.0-alpha.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/context.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { S as StorageItem, a as Step } from './index-CbAkULr8.js';
1
+ import { S as StorageItem, a as Step } from './index-cKmCZIqw.js';
2
2
  import 'file-type/core';
3
3
  import 'zod';
4
4
 
@@ -23,7 +23,26 @@ interface Preference {
23
23
 
24
24
  interface System {
25
25
  get<TValue = unknown>(name: string): Promise<TValue | undefined>;
26
+ /**
27
+ * Get the current stage of the step system.
28
+ * This method returns a string representing the current stage of the step system.
29
+ */
26
30
  stage(): string;
31
+ /**
32
+ * Get the current organization environment.
33
+ */
34
+ environment(): "PRODUCTION" | "SANDBOX" | "PREVIEW";
35
+ /**
36
+ * Dispatch a method to the step system.
37
+ * This method is used to trigger actions or events within the step system.
38
+ * It is typically used to execute a specific action or to notify the system of an event
39
+ */
40
+ dispatchStepMethod(method: string): Promise<void>;
41
+ /**
42
+ * Put an object in the step system. public access to the step system.
43
+ */
44
+ putObject<TValue = unknown>(name: string, value: TValue): Promise<void>;
45
+ getObject<TValue = unknown>(name: string): Promise<TValue | undefined>;
27
46
  }
28
47
 
29
48
  declare let step: Step;
@@ -8,7 +8,9 @@ interface Step {
8
8
  /** @deprecated Use addStepData*/
9
9
  identity(organization_id: string, instance_id: string, link_session: string | undefined, identity: IdentityDto, data: StepIdentityData): Promise<any>;
10
10
  addStepData(link_session: string | undefined, identity: IdentityDto, data: StepIdentityData): Promise<any>;
11
- getStepData(type: StepIdentityData["type"], link_session: string | undefined): Promise<StepIdentityData | undefined>;
11
+ getStepData<T extends StepIdentityData["type"]>(type: T, link_session: string | undefined): Promise<Extract<StepIdentityData, {
12
+ type: T;
13
+ }> | undefined>;
12
14
  addVendorStat(params: {
13
15
  vendor: string;
14
16
  service: string;
@@ -20,7 +22,6 @@ interface Step {
20
22
 
21
23
  interface AutentikarRequestInit extends RequestInit {
22
24
  host: string;
23
- staging: Staging;
24
25
  organization?: {
25
26
  id: string;
26
27
  alias: string;
@@ -38,11 +39,14 @@ interface AutentikarRequestInit extends RequestInit {
38
39
  output?: Record<string, string>;
39
40
  link_session: string | undefined;
40
41
  params?: unknown;
42
+ /** @deprecated */
43
+ staging: Staging;
41
44
  }
42
45
  declare class AutentikarRequest extends Request {
43
46
  readonly organization?: AutentikarRequestInit["organization"];
44
47
  readonly step?: AutentikarRequestInit["step"];
45
48
  readonly instance?: AutentikarRequestInit["instance"];
49
+ /** @deprecated use system.stage();. */
46
50
  readonly staging?: Staging;
47
51
  readonly link_session: string | undefined;
48
52
  readonly params?: unknown;
@@ -76,6 +80,16 @@ declare class AutentikarResponse extends Response {
76
80
  }
77
81
 
78
82
  type StepIdentityData = {
83
+ type: "SOURCE_FACE_2D";
84
+ face: string;
85
+ } | {
86
+ type: "DOCUMENT";
87
+ doc_type: IdentityDto["doc_type"];
88
+ images: {
89
+ front: string;
90
+ back?: string;
91
+ };
92
+ } | {
79
93
  type: "CARD";
80
94
  doc_type: IdentityDto["doc_type"];
81
95
  images: {
@@ -100,12 +114,15 @@ type StepIdentityData = {
100
114
  type: "CONSENT";
101
115
  value: "OWN" | "AUTENTIKAR" | "NONE";
102
116
  text?: string;
117
+ consent_id: string;
103
118
  };
104
119
  declare class StepRequest implements Step {
105
120
  private step;
106
121
  constructor(params: Step);
107
122
  addStepData(link_session: string | undefined, identity: IdentityDto, data: StepIdentityData): Promise<any>;
108
- getStepData(type: StepIdentityData["type"], link_session: string | undefined): Promise<StepIdentityData | undefined>;
123
+ getStepData<T extends StepIdentityData["type"]>(type: T, link_session: string | undefined): Promise<Extract<StepIdentityData, {
124
+ type: T;
125
+ }> | undefined>;
109
126
  addVendorStat(params: {
110
127
  vendor: string;
111
128
  service: string;
@@ -170,6 +187,7 @@ declare class StorageItem {
170
187
  }
171
188
  type Method = (req: AutentikarRequest) => Promise<AutentikarResponse>;
172
189
  type Resource = (req: AutentikarRequest) => Promise<AutentikarResponse>;
190
+ type StepEvent = (req: AutentikarRequest) => Promise<AutentikarResponse>;
173
191
  type AppEnvVariables = {
174
192
  instance: {
175
193
  id: string;
@@ -228,4 +246,4 @@ declare class StepContext {
228
246
  isExpired(): boolean | 0 | undefined;
229
247
  }
230
248
 
231
- export { AutentikarRequest as A, FlowContext as F, IdentitySchemaDto as I, type MethodContextOrganization as M, type PersistentType as P, type Resource as R, StorageItem as S, type Step as a, AutentikarResponse as b, type StepIdentityData as c, StepRequest as d, type IdentityDto as e, type AppEnvironments as f, type Staging as g, type MethodContextFlow as h, type MethodContextInstance as i, type MethodContextStep as j, type Method as k, type AppEnvVariables as l, type AppEnv as m, StepDefinition as n, StepInstance as o, StepContext as p };
249
+ export { AutentikarRequest as A, FlowContext as F, IdentitySchemaDto as I, type MethodContextOrganization as M, type PersistentType as P, type Resource as R, StorageItem as S, type Step as a, AutentikarResponse as b, type StepIdentityData as c, StepRequest as d, type IdentityDto as e, type AppEnvironments as f, type Staging as g, type MethodContextFlow as h, type MethodContextInstance as i, type MethodContextStep as j, type Method as k, type StepEvent as l, type AppEnvVariables as m, type AppEnv as n, StepDefinition as o, StepInstance as p, StepContext as q };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import 'file-type/core';
2
2
  import 'zod';
3
- export { m as AppEnv, l as AppEnvVariables, f as AppEnvironments, A as AutentikarRequest, b as AutentikarResponse, F as FlowContext, e as IdentityDto, I as IdentitySchemaDto, k as Method, h as MethodContextFlow, i as MethodContextInstance, M as MethodContextOrganization, j as MethodContextStep, P as PersistentType, R as Resource, g as Staging, p as StepContext, n as StepDefinition, c as StepIdentityData, o as StepInstance, d as StepRequest, S as StorageItem } from './index-CbAkULr8.js';
3
+ export { n as AppEnv, m as AppEnvVariables, f as AppEnvironments, A as AutentikarRequest, b as AutentikarResponse, F as FlowContext, e as IdentityDto, I as IdentitySchemaDto, k as Method, h as MethodContextFlow, i as MethodContextInstance, M as MethodContextOrganization, j as MethodContextStep, P as PersistentType, R as Resource, g as Staging, q as StepContext, o as StepDefinition, l as StepEvent, c as StepIdentityData, p as StepInstance, d as StepRequest, S as StorageItem } from './index-cKmCZIqw.js';
package/dist/index.js CHANGED
@@ -49,6 +49,7 @@ var AutentikarRequest = class extends Request {
49
49
  organization;
50
50
  step;
51
51
  instance;
52
+ /** @deprecated use system.stage();. */
52
53
  staging;
53
54
  link_session;
54
55
  params;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autentikar/step",
3
- "version": "2.1.0-alpha.8",
3
+ "version": "2.2.0-alpha.0",
4
4
  "description": "",
5
5
  "files": [
6
6
  "dist"