@raytio/types 6.0.2 → 7.1.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/raytio.d.ts CHANGED
@@ -1,31 +1,33 @@
1
1
  import { Encrypted } from "./crypto";
2
2
  import { Colors, CustomFonts } from "./theme";
3
3
  /** @internal see Microsoft/TypeScript#202 */
4
- export declare type StringWithIdentity<T> = string & {
4
+ export type StringWithIdentity<T> = string & {
5
5
  $$typeof$$: T;
6
6
  };
7
7
  /** @internal */
8
- declare type Json = Record<string, any>;
9
- /** A `p_id` is the ID of a @see Relationship */
10
- export declare type PId = StringWithIdentity<"PId">;
11
- /** An `i_id` is the ID of an @see Instance */
12
- export declare type IId = StringWithIdentity<"IId">;
13
- /** An `n_id` is the ID of a @see ProfileObject */
14
- export declare type NId = StringWithIdentity<"NId">;
8
+ type Json = Record<string, any>;
9
+ /** A `p_id` is the ID of a {@link Relationship} */
10
+ export type PId = StringWithIdentity<"PId">;
11
+ /** An `i_id` is the ID of an {@link Instance} */
12
+ export type IId = StringWithIdentity<"IId">;
13
+ /** An `n_id` is the ID of a {@link ProfileObject} */
14
+ export type NId = StringWithIdentity<"NId">;
15
15
  /** A `g_id` is the ID of a group */
16
- export declare type GId = StringWithIdentity<"GId">;
16
+ export type GId = StringWithIdentity<"GId">;
17
17
  /** A `u_id` is the ID of a user */
18
- export declare type UId = StringWithIdentity<"UId">;
19
- /** An `a_id` is the ID of an @see AA */
20
- export declare type AId = StringWithIdentity<"AId">;
21
- /** An `o_id` is the ID of an @see Organization */
22
- export declare type OId = StringWithIdentity<"OId">;
23
- /** A `wi_id` is the ID of a @see Webhook */
24
- export declare type WId = StringWithIdentity<"WId">;
25
- export declare type DataTypes = "string" | "number" | "boolean" | "object" | "integer" | "array" | "null";
26
- export declare type SubmissionStatus = "Submitted" | "Processing" | "Rejected" | "Expired" | "Completed" | "DataChanged" | "Received" | "Accepted";
18
+ export type UId = StringWithIdentity<"UId">;
19
+ /** An `a_id` is the ID of an {@link AA} */
20
+ export type AId = StringWithIdentity<"AId">;
21
+ /** An `o_id` is the ID of an {@link Organization} */
22
+ export type OId = StringWithIdentity<"OId">;
23
+ /** A `wi_id` is the ID of a {@link Webhook} */
24
+ export type WId = StringWithIdentity<"WId">;
25
+ /** An `l_id` is the ID of any data stored in the KV-Store */ export type LId = StringWithIdentity<"LId">;
26
+ export type AnyId = PId | IId | NId | GId | UId | AId | OId | WId;
27
+ export type DataTypes = "string" | "number" | "boolean" | "object" | "integer" | "array" | "null";
28
+ export type SubmissionStatus = "Submitted" | "Processing" | "Rejected" | "Expired" | "Completed" | "DataChanged" | "Received" | "Accepted";
27
29
  /** You can supply an option type argument if you know exactly what the properties will be */
28
- export declare type ProfileObject<Properties = Json> = {
30
+ export type ProfileObject<Properties = Json> = {
29
31
  n_id: NId;
30
32
  properties: Properties;
31
33
  labels: string[];
@@ -38,7 +40,7 @@ export declare type ProfileObject<Properties = Json> = {
38
40
  isFromSubmission?: [aId: AId, iId: IId];
39
41
  };
40
42
  /** @internal This is what we send the API */
41
- export declare type ProfileObjectForUpload<Properties = Json> = {
43
+ export type ProfileObjectForUpload<Properties = Json> = {
42
44
  properties: Properties;
43
45
  document?: {
44
46
  content?: string | Encrypted;
@@ -50,18 +52,18 @@ export declare type ProfileObjectForUpload<Properties = Json> = {
50
52
  };
51
53
  /**
52
54
  * arbitrary key-values pairs stored on a Profile Object.
53
- * May contain nested JSON and @see Encrypted properties.
55
+ * May contain nested JSON and {@link Encrypted} properties.
54
56
  *
55
57
  * There are some limits to field names: they cannot be called
56
58
  * `__signature` nor can they include the character sequence `<=>`.
59
+ *
60
+ * @deprecated - use {@link Json}
57
61
  */
58
- export declare type Properties = {
59
- [fieldName: string]: any;
60
- };
61
- export declare type UrnNodeType = "user" | "profile_object" | "instance" | "temp_object" | "document";
62
+ export type Properties = Json;
63
+ export type UrnNodeType = "user" | "profile_object" | "instance" | "schema" | "temp_object" | "document";
62
64
  /** e.g. "urn:user:..." */
63
- export declare type Urn = `urn:${UrnNodeType}:${string}`;
64
- export declare type Relationship = {
65
+ export type Urn = `urn:${UrnNodeType}:${AnyId}`;
66
+ export type Relationship = {
65
67
  start: Urn;
66
68
  end: Urn;
67
69
  p_id: PId;
@@ -72,7 +74,7 @@ export declare type Relationship = {
72
74
  [fieldName: string]: unknown;
73
75
  };
74
76
  };
75
- export declare type Lookup = {
77
+ export type Lookup = {
76
78
  key: string | number;
77
79
  value: string | number;
78
80
  /** Used in Antd Cascader */
@@ -82,7 +84,8 @@ export declare type Lookup = {
82
84
  /** used in AkahuDynamicSection only */
83
85
  requires_2FA?: boolean;
84
86
  };
85
- export declare type AA = {
87
+ export type AATag = "type:client_only" | "type:share_with_new_user" | `related_service_provider:n_id:${NId}` | "ServiceProvider";
88
+ export type AA = {
86
89
  a_id: AId;
87
90
  name: string;
88
91
  description?: string;
@@ -92,7 +95,7 @@ export declare type AA = {
92
95
  /** Easy to use AA logo url for pasting inot emails */
93
96
  picture_url?: string;
94
97
  scopes?: string[];
95
- tags?: string[];
98
+ tags?: AATag[];
96
99
  callback_uri?: string[];
97
100
  /** markdown or string help information including [phoneNumber || email] */
98
101
  aa_help?: string;
@@ -102,16 +105,16 @@ export declare type AA = {
102
105
  };
103
106
  /** the n_id of the associated service provider */
104
107
  service_provider_n_id?: NId;
105
- /** the id of the associated organisation */
108
+ /** the id of the associated organization */
106
109
  org_id: OId;
107
110
  /** configuration for the submission rules */
108
111
  ruleset?: unknown;
109
112
  /** if true, only specific email addresses can submit the form */
110
113
  auth_list_enabled?: boolean;
111
114
  /** @internal */
112
- _transitions?: unknown[];
115
+ transitions?: unknown[];
113
116
  };
114
- export declare type Instance = {
117
+ export type Instance = {
115
118
  /** Access application instance ID */
116
119
  i_id: IId;
117
120
  /** ID of the access application this submission was made to */
@@ -131,7 +134,7 @@ export declare type Instance = {
131
134
  start_date: string;
132
135
  /** The status of a submission */
133
136
  state: SubmissionStatus;
134
- /** @depreacted The status of a submission */
137
+ /** @deprecated The status of a submission */
135
138
  _state?: SubmissionStatus;
136
139
  /** Previous status of the shared information */
137
140
  previous_state: SubmissionStatus;
@@ -142,7 +145,7 @@ export declare type Instance = {
142
145
  /** data associated is access application's instance */
143
146
  profile_objects: ProfileObject[];
144
147
  keys: {
145
- [nId: string]: {
148
+ [nId: NId]: {
146
149
  [fieldName: string]: {
147
150
  data: string;
148
151
  n_id: NId;
@@ -157,7 +160,7 @@ export declare type Instance = {
157
160
  * An organization.
158
161
  * NOTE: this is different to how the schema defines an Organization. **The schema is wrong (see #468)**
159
162
  */
160
- export declare type Organization = {
163
+ export type Organization = {
161
164
  id: OId;
162
165
  name: string;
163
166
  email: string;
@@ -171,8 +174,19 @@ export declare type Organization = {
171
174
  };
172
175
  customer: Record<string, unknown>;
173
176
  };
177
+ /** @internal some APIs now return extra info */
178
+ export type FullOrg = {
179
+ id: OId;
180
+ organization: Omit<Organization, "id">;
181
+ /** 🧙‍♂️ */
182
+ gandalf: unknown;
183
+ stripe: {
184
+ customer: unknown;
185
+ };
186
+ centrix_credentials: unknown;
187
+ };
174
188
  /** validation data returned by preVerify (part of the extract&map API) */
175
- export declare type Validation = {
189
+ export type Validation = {
176
190
  score: number;
177
191
  warning?: string[];
178
192
  breakdown: {
@@ -187,11 +201,14 @@ export declare type Validation = {
187
201
  };
188
202
  };
189
203
  };
190
- export declare type Webhook = {
204
+ export type WebhookStatus = "subscribed" | "pending" | "unsubscribe_failed";
205
+ export type Webhook = {
191
206
  wi_id: WId;
192
207
  /** n_id of "the webhook provider which can be set up against a service provider" */
193
208
  provider_webhook_id: NId;
194
- status: unknown;
209
+ /** not sure what this is */
210
+ provider_webhook_subscription_id: NId;
211
+ status: WebhookStatus;
195
212
  /** ISO Date */
196
213
  date_created: string;
197
214
  /** ISO Date */
@@ -204,10 +221,18 @@ export declare type Webhook = {
204
221
  webhook_action: {
205
222
  webhook_action_type: string;
206
223
  }[];
207
- provider_subscription_credentials: unknown;
208
224
  webhook_filter_source: string;
209
225
  webhook_field_mapping_schema: {
210
226
  [key: string]: string;
211
227
  };
228
+ webhook_processing_rules: unknown;
229
+ provider_subscription_credentials: unknown;
230
+ provider_signature_check_enabled: boolean;
231
+ provider_signature_credentials: unknown;
232
+ subscribe_log?: {
233
+ date: string;
234
+ response_status_code: number;
235
+ response_payload: Json;
236
+ }[];
212
237
  };
213
238
  export {};
package/dist/raytio.js CHANGED
@@ -1,2 +1,2 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/dist/schema.d.ts CHANGED
@@ -1,15 +1,15 @@
1
- import { AA, DataTypes, NId, Organization, Urn } from "./raytio";
1
+ import { AA, DataTypes, Organization, Urn } from "./raytio";
2
2
  import { WizardConfig } from "./wizard";
3
3
  /** should be renamed since this applies to ConditionallyVerifiable */
4
- export declare type ConditionallyRequired = {
4
+ export type ConditionallyRequired = {
5
5
  field: string;
6
6
  if: {
7
- [fieldName: string]: string[];
7
+ [fieldName: string]: (string | number | boolean)[];
8
8
  };
9
9
  };
10
- export declare type SchemaFieldTag = "password" | `group:${string}` | `upload-group:${string}` | "display:stars" | "display:no_autofill" | "display:currency" | "display:cascade" | "display:survey" | "display:quoting" | "display:customModal" | "display:terms_conditions" | "display:showOnWizard" | `display:main_media:${string}` | "date_component:day" | "date_component:month" | "date_component:year" | "action:client_upload" | "verify:show_if_pending" | "special:hide_select_behind_button" | "type:capture_geolocation" | "type:extract_required";
11
- export declare type SchemaTag = "action:experimental_pass_object_store_id" | "action:verify" | "default_camera:rear" | "default_camera:front" | `oauth2_component:name:${string}` | `oauth2_component:redirect_url:${string}` | `link_to:${string}:${string}` | "type:service_provider" | "type:service_offer" | "type:marketplace" | "type:client_only" | "type:globally_unique_field";
12
- export declare type SchemaField = {
10
+ export type SchemaFieldTag = "password" | `group:${string}` | `upload-group:${string}` | "display:stars" | "display:no_autofill" | "display:currency" | "display:cascade" | "display:survey" | "display:quoting" | "display:customModal" | `display:replace:'${string}':'${string}'` | "display:terms_conditions" | `display:main_media:${string}` | "date_component:day" | "date_component:month" | "date_component:year" | "action:client_upload" | "verify:show_if_pending" | "special:hide_select_behind_button" | "type:capture_geolocation" | "type:extract_required";
11
+ export type SchemaTag = "action:experimental_pass_object_store_id" | "action:verify" | "default_camera:rear" | "default_camera:front" | `oauth2_component:name:${string}` | `oauth2_component:redirect_url:${string}` | `time:${string}:${number}` | `link_to:${string}:${string}` | "type:service_provider" | "type:service_offer" | "type:marketplace" | "type:client_only" | "type:globally_unique_field";
12
+ export type SchemaField = {
13
13
  /** @deprecated don't use, it's inconsistent */
14
14
  $id?: string;
15
15
  title?: string;
@@ -20,9 +20,15 @@ export declare type SchemaField = {
20
20
  examples?: unknown[];
21
21
  tags?: SchemaFieldTag[];
22
22
  type?: DataTypes;
23
- enum?: string[];
23
+ enum?: (string | number | boolean)[];
24
+ /** for number inputs, the maximum allowed value */
24
25
  maximum?: number;
26
+ /** for number inputs, the minimum allowed value */
25
27
  minimum?: number;
28
+ /** for number inputs, the step size used in the input or slider */
29
+ step?: number;
30
+ /** if true, the user must have encryption enabled to save this data, see #1324 */
31
+ encrypt_require?: boolean;
26
32
  /** @deprecated raytio's usage not documented */
27
33
  maxLength?: number;
28
34
  /** @deprecated raytio's usage not documented */
@@ -59,7 +65,7 @@ export declare type SchemaField = {
59
65
  };
60
66
  allOf?: [{
61
67
  $ref: string;
62
- }, SchemaField];
68
+ }, ServerSchemaField];
63
69
  /** only checkbox uses this prop */
64
70
  content?: string;
65
71
  /** URL to a JSON file in the `Lookup` format */
@@ -98,15 +104,11 @@ export declare type SchemaField = {
98
104
  */
99
105
  image_silhouette?: string;
100
106
  };
101
- /**
102
- * Raytio's variant of JSON Schema. All props marked as optional except
103
- * `name`. This type can be used for both the schema and for individual fields.
104
- */
105
- export declare type Schema = {
106
- /** @deprecated don't use this */
107
- $id?: string;
108
- $schema?: string;
109
- n_id?: NId;
107
+ /** the only difference between the client & server's definition is that the client adds `$prop` */
108
+ export type ServerSchemaField = Omit<SchemaField, "$prop">;
109
+ /** not exported. Attributes that are identical in both client schema & server schema */
110
+ export type CommonSchemaAttributes = {
111
+ type?: DataTypes;
110
112
  /** these fields will always exist on schema */
111
113
  name: string;
112
114
  title: string;
@@ -118,37 +120,14 @@ export declare type Schema = {
118
120
  * forms that accept different types of similar documents.
119
121
  */
120
122
  schema_group?: string;
121
- /** the localized title of the `schema_group`. added by the client */
122
- group_title?: string;
123
- /** @deprecated not sure why a schema would have this, only fields should */
124
- $ref?: string;
125
- version?: string;
126
- /** whether the `version` is the latest version */
127
- version_current?: boolean;
128
123
  tags?: SchemaTag[];
129
- /** originally `string[]`, the client modifies this */
130
- verified_fields?: (string | ConditionallyRequired)[];
131
- wasExpandedByClient?: boolean;
132
- /** added by client */
133
- required?: (string | ConditionallyRequired)[];
134
- type?: DataTypes;
135
- definitions?: Record<string, {
136
- $ref: Urn;
137
- }>;
138
- allOf?: {
139
- $ref?: string;
140
- if?: Schema;
141
- then?: Schema;
142
- }[];
143
- /** If this tag exists, the schema is deprecated. ISO Date. */
144
- end_date?: string;
145
- /** 🚨 Note that there are cases where properties are undefined, e.g. if the schema is a sub-object */
146
- properties: {
147
- [fieldName: string]: SchemaField;
148
- };
149
124
  i18n?: {
150
125
  [locale: string]: {
151
- $schema: Schema;
126
+ $schema: {
127
+ title: string;
128
+ title_plural?: string;
129
+ description?: string;
130
+ };
152
131
  $loading_extract: {
153
132
  title: string;
154
133
  };
@@ -179,21 +158,11 @@ export declare type Schema = {
179
158
  $loading_pending_ver_resubmit: {
180
159
  title: string;
181
160
  };
182
- [fieldNameOrGroupName: string]: Omit<SchemaField, "$prop"> & {
161
+ [fieldNameOrGroupName: string]: ServerSchemaField & {
183
162
  title_plural?: string;
184
163
  };
185
164
  };
186
165
  };
187
- /** @internal the client adds this after processing the i18n property */
188
- groupNames?: Record<string, string>;
189
- /** @internal added by the client to inform downstream components which locale from schema.i18n was used */
190
- clientLocale?: string;
191
- /**
192
- * @internal
193
- * the estimated loading times in seconds for various API calls. The client adds
194
- * this field after processing the schema tags.
195
- */
196
- timing?: Record<"extract" | "live_person" | "verify_pending_delay", number>;
197
166
  relationships?: {
198
167
  relationship_name: string;
199
168
  direction: "from";
@@ -239,10 +208,6 @@ export declare type Schema = {
239
208
  label: string;
240
209
  }[];
241
210
  };
242
- /** @internal @deprecated do not use */
243
- unexpanded_allOf?: never;
244
- /** @internal @deprecated do not use */
245
- unexpanded_properties?: never;
246
211
  /** only the schema used for the onboarding wizard have this property */
247
212
  onboard_properties?: {
248
213
  /** Profile Objects that should be created */
@@ -278,15 +243,74 @@ export declare type Schema = {
278
243
  return_to?: string;
279
244
  };
280
245
  };
281
- /** Only certain properties from the schema */
282
- export declare type SchemaMetadata = Pick<Schema, "name" | "title" | "description" | "schema_group" | "end_date" | "i18n" | "display" | "tags" | "clientLocale" | "groupNames" | "title_plural" | "group_title"> & {
246
+ /**
247
+ * Raytio's variant of JSON Schema, as used by the client. It is a modified version
248
+ * of what the API returns.
249
+ */
250
+ export type Schema = CommonSchemaAttributes & {
251
+ /** the localized title of the `schema_group`. added by the client */
252
+ group_title?: string;
253
+ /** originally `string[]`, the client modifies this */
254
+ verified_fields?: (string | ConditionallyRequired)[];
255
+ /** originally `string[]`, the client modifies this */
256
+ required?: (string | ConditionallyRequired)[];
257
+ /** added by client */
258
+ wasExpandedByClient?: boolean;
259
+ /** ISO Date. Copied from {@link WrappedSchema} */
260
+ start_date?: string;
261
+ /** ISO Date. Copied from {@link WrappedSchema} If this tag exists, the schema is deprecated */
262
+ end_date?: string;
263
+ /** 🚨 Note that there are cases where properties are undefined, e.g. if the schema is a sub-object */
264
+ properties: {
265
+ [fieldName: string]: SchemaField;
266
+ };
267
+ /** the client adds this after processing the i18n property */
268
+ groupNames?: Record<string, string>;
269
+ /** added by the client to inform downstream components which locale from schema.i18n was used */
270
+ clientLocale?: string;
271
+ /** added by the client, copied from {@link WrappedSchema} */
272
+ version: string;
283
273
  /**
284
- * @deprecated this prop exists so that SchemaMetadata does not extend Schema.
285
- * use `getSchema(schemaName)` to fetch the full schema
274
+ * the estimated loading times in seconds for various API calls. The client adds
275
+ * this field after processing the schema tags.
286
276
  */
287
- __typeof__: "You cannot supply SchemaMetadata to a function that expects Schema";
288
- isProfileSchema: boolean;
289
- isSpSchema: boolean;
277
+ timing?: Record<"extract" | "live_person" | "verify_pending_delay", number>;
278
+ /** added by the client. If true, this should be shown to the client */
279
+ isProfileSchema?: boolean;
280
+ /** added by the client. If true, this schema somehow relates to legacy service providers */
281
+ isSpSchema?: boolean;
282
+ };
283
+ /** This is what's returned by the API */
284
+ export type WrappedSchema = {
285
+ active: true;
286
+ /** ISO Date */
287
+ start_date: string;
288
+ /** ISO Date. If this tag exists, the schema is deprecated. */
289
+ end_date: string;
290
+ name: string;
291
+ type: "ss" | "ps" | "us";
292
+ version: string;
293
+ /** whether the \`version\` is the latest version */
294
+ version_current: boolean;
295
+ schema: CommonSchemaAttributes & {
296
+ /** @deprecated don't use this */
297
+ $id?: string;
298
+ /** @deprecated don't use this */
299
+ $schema?: string;
300
+ definitions?: Record<string, {
301
+ $ref: Urn;
302
+ }>;
303
+ allOf?: {
304
+ $ref?: string;
305
+ if?: Partial<WrappedSchema["schema"]>;
306
+ then?: Partial<WrappedSchema["schema"]>;
307
+ }[];
308
+ properties: {
309
+ [fieldName: string]: ServerSchemaField;
310
+ };
311
+ required?: string[];
312
+ verified_fields?: string[];
313
+ };
290
314
  };
291
315
  /** @ignore */
292
- export declare type RelationDefinition = NonNullable<Schema["relationships"]>[number];
316
+ export type RelationDefinition = NonNullable<Schema["relationships"]>[number];
package/dist/schema.js CHANGED
@@ -1,2 +1,2 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/dist/theme.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare type Colors = {
1
+ export type Colors = {
2
2
  sirPinklyText: string;
3
3
  sirPinklyUi: string;
4
4
  violaPerpetuoText: string;
@@ -10,7 +10,7 @@ export declare type Colors = {
10
10
  raytioOrangeText: string;
11
11
  raytioOrangeUi: string;
12
12
  raytioOrangeHover: string;
13
- /** only used by the fancy layout on the login screen */
13
+ /** */
14
14
  raytioOrangeShade: string;
15
15
  successGreen: string;
16
16
  loadingYellow: string;
@@ -23,7 +23,7 @@ export declare type Colors = {
23
23
  silverShell: string;
24
24
  blank: string;
25
25
  };
26
- export declare type CustomFonts = {
26
+ export type CustomFonts = {
27
27
  header?: string;
28
28
  body?: string;
29
29
  };
package/dist/theme.js CHANGED
@@ -1,2 +1,2 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +1,5 @@
1
1
  import { NId, ProfileObject } from "./raytio";
2
- export declare type VerificationPayload<WithValue extends boolean> = {
2
+ export type VerificationPayload<WithValue extends boolean> = {
3
3
  field: string;
4
4
  schema?: string;
5
5
  metadata?: Record<string, unknown>;
@@ -18,8 +18,6 @@ export declare type VerificationPayload<WithValue extends boolean> = {
18
18
  verifier_source_id?: NId;
19
19
  verifier_service_id?: NId;
20
20
  verifier_div: string;
21
- /** ISO Date */
22
- valid_until?: string;
23
21
  } & (WithValue extends true ? {
24
22
  value: string | number;
25
23
  } : {});
@@ -28,7 +26,7 @@ export declare type VerificationPayload<WithValue extends boolean> = {
28
26
  * use `Verification<true>`, otherwise just `Verification`. Verifications from
29
27
  * the DataContext don't have the value.
30
28
  */
31
- export declare type Verification<WithValue extends boolean = false> = ProfileObject<{
29
+ export type Verification<WithValue extends boolean = false> = ProfileObject<{
32
30
  field: string;
33
31
  n_id: NId;
34
32
  /**
@@ -64,15 +62,15 @@ export declare enum POVerification {
64
62
  Loading = 70007
65
63
  }
66
64
  /** These `n_id`s point to service provider profile objects */
67
- export declare type VerificationProvider = {
65
+ export type VerificationProvider = {
68
66
  verifierNId?: NId;
69
67
  dataSourceNId?: NId;
70
68
  serviceProviderNId?: NId;
71
69
  /** the date which the verification was verified on, or last re-verified on */
72
70
  date?: Date;
73
71
  };
74
- /** This is what @raytio/core exposes, which is more useable than @see Verification */
75
- export declare type RealVer = {
72
+ /** This is what @raytio/core exposes, which is more useable than {@link Verification} */
73
+ export type RealVer = {
76
74
  fieldName: string;
77
75
  value: unknown;
78
76
  provider: VerificationProvider;
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.POVerification = exports.FieldVerification = void 0;
4
4
  /**
5
5
  * "Not Verified" means show no badge, cf. "Verified False" means the
package/dist/wizard.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { AId } from "./raytio";
2
- /** configuration data for a single wizard page (@see WizardConfig) */
3
- export declare type WizardPage = {
2
+ export type WizardPageTag = "action:require_chip";
3
+ /** configuration data for a single wizard page ({@link WizardConfig}) */
4
+ export type WizardPage = {
4
5
  /** if undefined, the schema title will be used */
5
6
  name?: string | symbol;
6
7
  filter: "oneOf" | "anyOf";
@@ -20,7 +21,7 @@ export declare type WizardPage = {
20
21
  service_provider_link?: boolean;
21
22
  /** custom text to display on the Create New button */
22
23
  create_new_text?: string;
23
- /** a URL to a preset for configuing NestedSchemaSelect. @see DeepConfig */
24
+ /** a URL to a preset for configuing NestedSchemaSelect. {@link DeepConfig} */
24
25
  selection_hierarchy_json?: string;
25
26
  /** whether the schema description should be shown */
26
27
  display_schema_description?: boolean;
@@ -43,7 +44,12 @@ export declare type WizardPage = {
43
44
  extract_threshold_fail_action?: "capture" | "capture_review" | "recapture_or_next_step" | "review" | "next_step";
44
45
  /** for ImageDynamicSection, the action to take if the API returns no `validation: {}` object */
45
46
  extract_threshold_null_action?: WizardPage["extract_threshold_fail_action"];
46
- /** if `false`, ProfileObjects created while completing the form will not be verified. `undefined` implies `true` */
47
+ /**
48
+ * if `false`, ProfileObjects created while completing the form will not be verified.
49
+ * if `true`, you can only select ProfileObjects that are partially or fully verified.
50
+ * `undefined` implies `true`.
51
+ * @default true
52
+ */
47
53
  verify_data?: boolean;
48
54
  /** a list of fields that should not be required, even if the schema says they're required */
49
55
  optional_fields?: string[];
@@ -51,13 +57,19 @@ export declare type WizardPage = {
51
57
  share?: "profile" | "verification" | "both";
52
58
  /** can you force the colour theme to change for just one page (#1066, #1074). At the moment this on pages that use WebcamImageCapture */
53
59
  display_mode?: "light" | "dark" | "default";
60
+ tags?: WizardPageTag[];
61
+ /**
62
+ * If specified, this is is a "Conditional Wizard Page", which is only shown
63
+ * if the rule passed. This field contains the ID (not name) of the rule.
64
+ */
65
+ branching_rule_name?: string;
54
66
  };
55
67
  /**
56
68
  * when a form link is generated, this is what gets saved on the API.
57
- * Each value can be overriden in the query parameters. If specified
69
+ * Each value can be overridden in the query parameters. If specified
58
70
  * in the query parameters, it needs to be base64 and/or url encoded.
59
71
  */
60
- export declare type WizardConfig = {
72
+ export type WizardConfig = {
61
73
  a_id: AId;
62
74
  pages: WizardPage[];
63
75
  /** whether the user can change the reference, if there is one in the QP */
package/dist/wizard.js CHANGED
@@ -1,2 +1,2 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raytio/types",
3
- "version": "6.0.2",
3
+ "version": "7.1.0",
4
4
  "license": "MIT",
5
5
  "main": "index",
6
6
  "types": "index",
@@ -12,7 +12,7 @@
12
12
  ],
13
13
  "scripts": {
14
14
  "docs": "sh ../../scripts/generate-docs.sh",
15
- "test": "npm run build",
16
- "build": "tsc && rm -rf dist/__tests__"
15
+ "test": "npm run build && yarn docs",
16
+ "build": "tsc && rimraf dist/__tests__"
17
17
  }
18
18
  }
@@ -1,5 +1,5 @@
1
- /* eslint-disable fp/no-let, @typescript-eslint/no-unused-vars */
2
- import { Schema, SchemaField, SchemaMetadata } from "..";
1
+ /* eslint-disable @typescript-eslint/no-unused-vars */
2
+ import { Schema, SchemaField, WrappedSchema } from "..";
3
3
 
4
4
  /**
5
5
  * this file is not run, it is just compiled by tsc
@@ -8,7 +8,7 @@ import { Schema, SchemaField, SchemaMetadata } from "..";
8
8
 
9
9
  let schema: Schema;
10
10
  let schemaField: SchemaField;
11
- let schemaMetadata: SchemaMetadata;
11
+ let wrappedSchema: WrappedSchema;
12
12
 
13
13
  function f() {
14
14
  // @ts-expect-error SchemaField should not extend Schema
@@ -16,8 +16,8 @@ function f() {
16
16
  // @ts-expect-error Schema should not extend SchemaField
17
17
  const test2: Schema = schemaField;
18
18
 
19
- // @ts-expect-error SchemaMetadata should not extend Schema
20
- const test3: SchemaMetadata = schema;
21
- // @ts-expect-error Schema should not extend SchemaMetadata
22
- const test4: Schema = schemaMetadata;
19
+ // @ts-expect-error WrappedSchema should not extend Schema
20
+ const test3: WrappedSchema = schema;
21
+ // @ts-expect-error Schema should not extend WrappedSchema
22
+ const test4: Schema = wrappedSchema;
23
23
  }