@raytio/types 5.2.1 → 6.0.2
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 +103 -19
- package/dist/crypto.d.ts +2 -2
- package/dist/index.js +5 -1
- package/dist/raytio.d.ts +44 -7
- package/dist/schema.d.ts +25 -10
- package/dist/theme.d.ts +4 -1
- package/dist/verification.d.ts +27 -20
- package/dist/verification.js +4 -0
- package/dist/wizard.d.ts +8 -2
- package/package.json +1 -1
- package/src/crypto.ts +3 -2
- package/src/raytio.ts +51 -7
- package/src/schema.ts +42 -7
- package/src/theme.ts +2 -1
- package/src/verification.ts +36 -23
- package/src/wizard.ts +10 -2
package/README.md
CHANGED
|
@@ -33,6 +33,7 @@ Hovering over the type in VSCode will display documentation and available proper
|
|
|
33
33
|
- [AId](#aid)
|
|
34
34
|
- [Colors](#colors)
|
|
35
35
|
- [ConditionallyRequired](#conditionallyrequired)
|
|
36
|
+
- [CustomFonts](#customfonts)
|
|
36
37
|
- [DataTypes](#datatypes)
|
|
37
38
|
- [Encrypted](#encrypted)
|
|
38
39
|
- [GId](#gid)
|
|
@@ -40,6 +41,7 @@ Hovering over the type in VSCode will display documentation and available proper
|
|
|
40
41
|
- [Instance](#instance)
|
|
41
42
|
- [Lookup](#lookup)
|
|
42
43
|
- [NId](#nid)
|
|
44
|
+
- [OId](#oid)
|
|
43
45
|
- [Organization](#organization)
|
|
44
46
|
- [PId](#pid)
|
|
45
47
|
- [ProfileObject](#profileobject)
|
|
@@ -57,7 +59,10 @@ Hovering over the type in VSCode will display documentation and available proper
|
|
|
57
59
|
- [UrnNodeType](#urnnodetype)
|
|
58
60
|
- [Validation](#validation)
|
|
59
61
|
- [Verification](#verification)
|
|
62
|
+
- [VerificationPayload](#verificationpayload)
|
|
60
63
|
- [VerificationProvider](#verificationprovider)
|
|
64
|
+
- [WId](#wid)
|
|
65
|
+
- [Webhook](#webhook)
|
|
61
66
|
- [WizardConfig](#wizardconfig)
|
|
62
67
|
- [WizardPage](#wizardpage)
|
|
63
68
|
|
|
@@ -74,17 +79,20 @@ Hovering over the type in VSCode will display documentation and available proper
|
|
|
74
79
|
| `a_id` | [`AId`](#aid) | - |
|
|
75
80
|
| `aa_help?` | `string` | markdown or string help information including [phoneNumber || email] |
|
|
76
81
|
| `aa_introduction?` | `string` | If a user signs up while completing this form, this message will be sent in the sign up email. |
|
|
82
|
+
| `auth_list_enabled?` | `boolean` | if true, only specific email addresses can submit the form |
|
|
77
83
|
| `callback_uri?` | `string`[] | - |
|
|
78
84
|
| `description?` | `string` | - |
|
|
79
85
|
| `name` | `string` | - |
|
|
80
|
-
| `org_id` | `
|
|
86
|
+
| `org_id` | [`OId`](#oid) | the id of the associated organisation |
|
|
81
87
|
| `picture?` | [`Urn`](#urn) | - |
|
|
82
88
|
| `picture_url?` | `string` | Easy to use AA logo url for pasting inot emails |
|
|
89
|
+
| `ruleset?` | `unknown` | configuration for the submission rules |
|
|
83
90
|
| `scopes?` | `string`[] | - |
|
|
84
91
|
| `service_provider_n_id?` | [`NId`](#nid) | the n_id of the associated service provider |
|
|
85
92
|
| `tags?` | `string`[] | - |
|
|
86
93
|
| `theme?` | `Object` | - |
|
|
87
|
-
| `theme.colors
|
|
94
|
+
| `theme.colors?` | [`Colors`](#colors) | - |
|
|
95
|
+
| `theme.font?` | [`CustomFonts`](#customfonts) | - |
|
|
88
96
|
|
|
89
97
|
___
|
|
90
98
|
|
|
@@ -105,7 +113,6 @@ ___
|
|
|
105
113
|
| Name | Type | Description |
|
|
106
114
|
| :------ | :------ | :------ |
|
|
107
115
|
| `blank` | `string` | - |
|
|
108
|
-
| `blankBackground` | `string` | - |
|
|
109
116
|
| `climaterolText` | `string` | - |
|
|
110
117
|
| `climaterolUi` | `string` | - |
|
|
111
118
|
| `errorRed` | `string` | - |
|
|
@@ -145,6 +152,19 @@ should be renamed since this applies to ConditionallyVerifiable
|
|
|
145
152
|
|
|
146
153
|
___
|
|
147
154
|
|
|
155
|
+
### CustomFonts
|
|
156
|
+
|
|
157
|
+
Ƭ **CustomFonts**: `Object`
|
|
158
|
+
|
|
159
|
+
#### Type declaration
|
|
160
|
+
|
|
161
|
+
| Name | Type |
|
|
162
|
+
| :------ | :------ |
|
|
163
|
+
| `body?` | `string` |
|
|
164
|
+
| `header?` | `string` |
|
|
165
|
+
|
|
166
|
+
___
|
|
167
|
+
|
|
148
168
|
### DataTypes
|
|
149
169
|
|
|
150
170
|
Ƭ **DataTypes**: ``"string"`` \| ``"number"`` \| ``"boolean"`` \| ``"object"`` \| ``"integer"`` \| ``"array"`` \| ``"null"``
|
|
@@ -153,13 +173,13 @@ ___
|
|
|
153
173
|
|
|
154
174
|
### Encrypted
|
|
155
175
|
|
|
156
|
-
Ƭ **Encrypted**<`
|
|
176
|
+
Ƭ **Encrypted**<`_Data`\>: `Object`
|
|
157
177
|
|
|
158
178
|
#### Type parameters
|
|
159
179
|
|
|
160
180
|
| Name | Type |
|
|
161
181
|
| :------ | :------ |
|
|
162
|
-
| `
|
|
182
|
+
| `_Data` | `string` |
|
|
163
183
|
|
|
164
184
|
#### Type declaration
|
|
165
185
|
|
|
@@ -167,7 +187,7 @@ ___
|
|
|
167
187
|
| :------ | :------ |
|
|
168
188
|
| `encrypted_data` | `Object` |
|
|
169
189
|
| `encrypted_data.algorithm` | `AesKeyAlgorithm` |
|
|
170
|
-
| `encrypted_data.data` | `
|
|
190
|
+
| `encrypted_data.data` | `string` |
|
|
171
191
|
| `encrypted_data.iv` | `string` |
|
|
172
192
|
| `encrypted_key` | `Object` |
|
|
173
193
|
| `encrypted_key.encrypted_key` | `string` |
|
|
@@ -210,6 +230,7 @@ ___
|
|
|
210
230
|
| `profile_objects` | [`ProfileObject`](#profileobject)[] | data associated is access application's instance |
|
|
211
231
|
| `reference` | `string` | reference provided by the user who shared the data |
|
|
212
232
|
| `relationships?` | [`Relationship`](#relationship)[] | - |
|
|
233
|
+
| `score?` | `unknown` | added by the client once it calculates the score |
|
|
213
234
|
| `service_provider_n_id?` | [`NId`](#nid) | Service provider ID |
|
|
214
235
|
| `start_date` | `string` | Earliest date on which the shared information was available |
|
|
215
236
|
| `state` | [`SubmissionStatus`](#submissionstatus) | The status of a submission |
|
|
@@ -243,6 +264,14 @@ An `n_id` is the ID of a @see ProfileObject
|
|
|
243
264
|
|
|
244
265
|
___
|
|
245
266
|
|
|
267
|
+
### OId
|
|
268
|
+
|
|
269
|
+
Ƭ **OId**: `StringWithIdentity`<``"OId"``\>
|
|
270
|
+
|
|
271
|
+
An `o_id` is the ID of an @see Organization
|
|
272
|
+
|
|
273
|
+
___
|
|
274
|
+
|
|
246
275
|
### Organization
|
|
247
276
|
|
|
248
277
|
Ƭ **Organization**: `Object`
|
|
@@ -263,7 +292,7 @@ NOTE: this is different to how the schema defines an Organization. **The schema
|
|
|
263
292
|
| `address.street2` | `string` |
|
|
264
293
|
| `customer` | `Record`<`string`, `unknown`\> |
|
|
265
294
|
| `email` | `string` |
|
|
266
|
-
| `id` | `
|
|
295
|
+
| `id` | [`OId`](#oid) |
|
|
267
296
|
| `name` | `string` |
|
|
268
297
|
|
|
269
298
|
___
|
|
@@ -286,7 +315,7 @@ You can supply an option type argument if you know exactly what the properties w
|
|
|
286
315
|
|
|
287
316
|
| Name | Type |
|
|
288
317
|
| :------ | :------ |
|
|
289
|
-
| `Properties` | `
|
|
318
|
+
| `Properties` | `Json` |
|
|
290
319
|
|
|
291
320
|
#### Type declaration
|
|
292
321
|
|
|
@@ -331,7 +360,7 @@ This is what @raytio/core exposes, which is more useable than @see Verification
|
|
|
331
360
|
| `nID` | [`NId`](#nid) | nId of the verification |
|
|
332
361
|
| `provider` | [`VerificationProvider`](#verificationprovider) | - |
|
|
333
362
|
| `signature` | `string` | - |
|
|
334
|
-
| `value` | `
|
|
363
|
+
| `value` | `unknown` | - |
|
|
335
364
|
| `verified` | `boolean` | whether the `fieldName`/`value` pair is verified, as confirmed by the API. This should be the single source of truth. |
|
|
336
365
|
| `xId` | `string` | this will be a unique id to group verifications from the same PO. Doesn't work yet |
|
|
337
366
|
|
|
@@ -380,6 +409,7 @@ Raytio's variant of JSON Schema. All props marked as optional except
|
|
|
380
409
|
| `display.head_sub?` | `Object` | list of fields to be considered the subheader of the PO fields joined with a space unless `format` format string is supplied |
|
|
381
410
|
| `display.head_sub.fields` | `string`[] | - |
|
|
382
411
|
| `display.head_sub.format?` | `string` | - |
|
|
412
|
+
| `end_date?` | `string` | If this tag exists, the schema is deprecated. ISO Date. |
|
|
383
413
|
| `group_title?` | `string` | the localized title of the `schema_group`. added by the client |
|
|
384
414
|
| `i18n?` | `Object` | - |
|
|
385
415
|
| `n_id?` | [`NId`](#nid) | - |
|
|
@@ -395,8 +425,11 @@ Raytio's variant of JSON Schema. All props marked as optional except
|
|
|
395
425
|
| `schema_group?` | `string` | the group that a schema belongs to, such as "passports". This is useful for forms that accept different types of similar documents. |
|
|
396
426
|
| `tags?` | [`SchemaTag`](#schematag)[] | - |
|
|
397
427
|
| `title` | `string` | - |
|
|
428
|
+
| `title_plural?` | `string` | plural version of the title |
|
|
398
429
|
| `type?` | [`DataTypes`](#datatypes) | - |
|
|
399
430
|
| `verified_fields?` | (`string` \| [`ConditionallyRequired`](#conditionallyrequired))[] | originally `string[]`, the client modifies this |
|
|
431
|
+
| `version?` | `string` | - |
|
|
432
|
+
| `version_current?` | `boolean` | whether the `version` is the latest version |
|
|
400
433
|
| `wasExpandedByClient?` | `boolean` | - |
|
|
401
434
|
|
|
402
435
|
___
|
|
@@ -416,16 +449,16 @@ ___
|
|
|
416
449
|
| `content?` | `string` | only checkbox uses this prop |
|
|
417
450
|
| `contentEncoding?` | ``"base64"`` | - |
|
|
418
451
|
| `contentMediaType?` | `string` | - |
|
|
419
|
-
| `default?` | `unknown` |
|
|
452
|
+
| `default?` | `unknown` | the default value |
|
|
420
453
|
| `default_signature_name?` | `string` | used on fields that are a signature file picker, see !849 also used to determine if the MediaPicker should be shown inline |
|
|
421
454
|
| `description?` | `string` | - |
|
|
422
455
|
| `description_decorator?` | ``"md"`` | specifies that the description is formatted in markdown |
|
|
423
456
|
| `encrypt?` | `boolean` | whether the field should be encrypted |
|
|
424
457
|
| `enum?` | `string`[] | - |
|
|
425
458
|
| `examples?` | `unknown`[] | - |
|
|
426
|
-
| `format?` | ``"date"`` \| ``"date-time"`` | - |
|
|
459
|
+
| `format?` | ``"date"`` \| ``"date-time"`` \| ``"uri"`` | - |
|
|
427
460
|
| `image_silhouette?` | `string` | If this schema requires a photo of a document, you can specify a URL to a silhouette image which will be overlaid on top of the camera. For best results, the image should have a transparent background + minimal white foreground |
|
|
428
|
-
| `items?` | `Object` | for nested
|
|
461
|
+
| `items?` | `Object` | `items` is used for nested arrays, (while `properties` is used for nested objects) |
|
|
429
462
|
| `items.properties` | `Object` | - |
|
|
430
463
|
| `items.type` | [`DataTypes`](#datatypes) | - |
|
|
431
464
|
| `lookup?` | `string` | URL to a JSON file in the `Lookup` format |
|
|
@@ -439,22 +472,25 @@ ___
|
|
|
439
472
|
| `pattern?` | `string` | - |
|
|
440
473
|
| `patternMessage?` | `string` | if a `pattern` is specified, this is the error message |
|
|
441
474
|
| `priority?` | `number` | - |
|
|
475
|
+
| `properties?` | `Object` | `properties` is used for nested objects, (while `items` is used for nested arrays) |
|
|
442
476
|
| `readOnly?` | `boolean` | readOnly means the Wizard won't show this field |
|
|
477
|
+
| `table_empty_message?` | `string` | if this field is a table input, this determines the text to show if the table is empty |
|
|
443
478
|
| `tags?` | [`SchemaFieldTag`](#schemafieldtag)[] | - |
|
|
444
479
|
| `title?` | `string` | - |
|
|
480
|
+
| `title_plural?` | `string` | - |
|
|
445
481
|
| `type?` | [`DataTypes`](#datatypes) | - |
|
|
446
482
|
|
|
447
483
|
___
|
|
448
484
|
|
|
449
485
|
### SchemaFieldTag
|
|
450
486
|
|
|
451
|
-
Ƭ **SchemaFieldTag**: ``"password"`` \| \`group:${string}\` \| \`upload-group:${string}\` \| ``"display:stars"`` \| ``"display:no_autofill"`` \| ``"display:currency"`` \| ``"display:cascade"`` \| ``"display:survey"`` \| ``"display:quoting"`` \| ``"display:customModal"`` \| ``"display:showOnWizard"`` \| \`display:main\_media:${string}\` \| ``"action:client_upload"`` \| ``"verify:show_if_pending"`` \| ``"special:hide_select_behind_button"`` \| ``"type:extract_required"``
|
|
487
|
+
Ƭ **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"``
|
|
452
488
|
|
|
453
489
|
___
|
|
454
490
|
|
|
455
491
|
### SchemaMetadata
|
|
456
492
|
|
|
457
|
-
Ƭ **SchemaMetadata**: `Pick`<[`Schema`](#schema), ``"name"`` \| ``"title"`` \| ``"description"`` \| ``"schema_group"`` \| ``"i18n"`` \| ``"display"`` \| ``"clientLocale"`` \| ``"groupNames"`` \| ``"group_title"``\> & { `__typeof__`: ``"You cannot supply SchemaMetadata to a function that expects Schema"`` ; `isProfileSchema`: `boolean` ; `isSpSchema`: `boolean` }
|
|
493
|
+
Ƭ **SchemaMetadata**: `Pick`<[`Schema`](#schema), ``"name"`` \| ``"title"`` \| ``"description"`` \| ``"schema_group"`` \| ``"end_date"`` \| ``"i18n"`` \| ``"display"`` \| ``"tags"`` \| ``"clientLocale"`` \| ``"groupNames"`` \| ``"title_plural"`` \| ``"group_title"``\> & { `__typeof__`: ``"You cannot supply SchemaMetadata to a function that expects Schema"`` ; `isProfileSchema`: `boolean` ; `isSpSchema`: `boolean` }
|
|
458
494
|
|
|
459
495
|
Only certain properties from the schema
|
|
460
496
|
|
|
@@ -462,7 +498,7 @@ ___
|
|
|
462
498
|
|
|
463
499
|
### SchemaTag
|
|
464
500
|
|
|
465
|
-
Ƭ **SchemaTag**: ``"action:experimental_pass_object_store_id"`` \| ``"action:verify"`` \| ``"default_camera:rear"`` \| ``"default_camera:front"`` \| ``"type:service_provider"`` \| ``"type:service_offer"`` \| ``"type:marketplace"`` \| ``"type:client_only"`` \| ``"type:globally_unique_field"``
|
|
501
|
+
Ƭ **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"``
|
|
466
502
|
|
|
467
503
|
___
|
|
468
504
|
|
|
@@ -526,6 +562,18 @@ the DataContext don't have the value.
|
|
|
526
562
|
|
|
527
563
|
___
|
|
528
564
|
|
|
565
|
+
### VerificationPayload
|
|
566
|
+
|
|
567
|
+
Ƭ **VerificationPayload**<`WithValue`\>: { `field`: `string` ; `metadata?`: `Record`<`string`, `unknown`\> ; `passed`: `boolean` ; `request_div`: `string` ; `schema?`: `string` ; `source`: `string` ; `source_hashed_n_id?`: [`NId`](#nid) ; `source_n_id?`: [`NId`](modules.md#nid) ; `type?`: ``null`` ; `v_id`: `string` ; `valid_until?`: `string` ; `verification_date`: `string` ; `verifier_div`: `string` ; `verifier_id?`: [`NId`](modules.md#nid) ; `verifier_service_id?`: [`NId`](modules.md#nid) ; `verifier_source_id?`: [`NId`](modules.md#nid) } & `WithValue` extends ``true`` ? { `value`: `string` \| `number` } : {}
|
|
568
|
+
|
|
569
|
+
#### Type parameters
|
|
570
|
+
|
|
571
|
+
| Name | Type |
|
|
572
|
+
| :------ | :------ |
|
|
573
|
+
| `WithValue` | extends `boolean` |
|
|
574
|
+
|
|
575
|
+
___
|
|
576
|
+
|
|
529
577
|
### VerificationProvider
|
|
530
578
|
|
|
531
579
|
Ƭ **VerificationProvider**: `Object`
|
|
@@ -537,12 +585,44 @@ These `n_id`s point to service provider profile objects
|
|
|
537
585
|
| Name | Type | Description |
|
|
538
586
|
| :------ | :------ | :------ |
|
|
539
587
|
| `dataSourceNId?` | [`NId`](#nid) | - |
|
|
540
|
-
| `date
|
|
588
|
+
| `date?` | `Date` | the date which the verification was verified on, or last re-verified on |
|
|
541
589
|
| `serviceProviderNId?` | [`NId`](#nid) | - |
|
|
542
590
|
| `verifierNId?` | [`NId`](#nid) | - |
|
|
543
591
|
|
|
544
592
|
___
|
|
545
593
|
|
|
594
|
+
### WId
|
|
595
|
+
|
|
596
|
+
Ƭ **WId**: `StringWithIdentity`<``"WId"``\>
|
|
597
|
+
|
|
598
|
+
A `wi_id` is the ID of a @see Webhook
|
|
599
|
+
|
|
600
|
+
___
|
|
601
|
+
|
|
602
|
+
### Webhook
|
|
603
|
+
|
|
604
|
+
Ƭ **Webhook**: `Object`
|
|
605
|
+
|
|
606
|
+
#### Type declaration
|
|
607
|
+
|
|
608
|
+
| Name | Type | Description |
|
|
609
|
+
| :------ | :------ | :------ |
|
|
610
|
+
| `date_created` | `string` | ISO Date |
|
|
611
|
+
| `date_updated` | `string` | ISO Date |
|
|
612
|
+
| `provider_subscription_credentials` | `unknown` | - |
|
|
613
|
+
| `provider_webhook_id` | [`NId`](#nid) | n_id of "the webhook provider which can be set up against a service provider" |
|
|
614
|
+
| `status` | `unknown` | - |
|
|
615
|
+
| `webhook_action` | { `webhook_action_type`: `string` }[] | - |
|
|
616
|
+
| `webhook_field_mapping_schema` | `Object` | - |
|
|
617
|
+
| `webhook_filter_schema` | `Object` | - |
|
|
618
|
+
| `webhook_filter_schema.field_name` | `string` | - |
|
|
619
|
+
| `webhook_filter_schema.field_value` | `string` | - |
|
|
620
|
+
| `webhook_filter_schema.operator` | `string` | - |
|
|
621
|
+
| `webhook_filter_source` | `string` | - |
|
|
622
|
+
| `wi_id` | [`WId`](#wid) | - |
|
|
623
|
+
|
|
624
|
+
___
|
|
625
|
+
|
|
546
626
|
### WizardConfig
|
|
547
627
|
|
|
548
628
|
Ƭ **WizardConfig**: `Object`
|
|
@@ -559,7 +639,7 @@ in the query parameters, it needs to be base64 and/or url encoded.
|
|
|
559
639
|
| `emails?` | `string`[] | if specified, the email addresses that a submission should be sent to |
|
|
560
640
|
| `expiry_date?` | `number` | number of days in the future |
|
|
561
641
|
| `pages` | [`WizardPage`](#wizardpage)[] | - |
|
|
562
|
-
| `quick_onboard?` | `boolean` | whether the
|
|
642
|
+
| `quick_onboard?` | `boolean` | whether the passwordless-signup process should be used if the user visits this form, and they are not logged in. If false, the standard sign-up process will be used |
|
|
563
643
|
| `reference?` | `string` | - |
|
|
564
644
|
| `relationships?` | { `from`: `string` ; `properties?`: `Record`<`string`, `any`\> ; `to`: `string` ; `type`: `string` }[] | a list of relationships that should be created after the wizard completes (see #987) |
|
|
565
645
|
| `return_to?` | `string` | the callback url to redirect to once complete. Must be in the AA's list of authorized callback urls |
|
|
@@ -585,9 +665,13 @@ configuration data for a single wizard page (@see WizardConfig)
|
|
|
585
665
|
| :------ | :------ | :------ |
|
|
586
666
|
| `allow_upload?` | `boolean` | do not allow uploading in ImageDynamicSection if this is explictly false |
|
|
587
667
|
| `create_new_text?` | `string` | custom text to display on the Create New button |
|
|
588
|
-
| `description?` | `string` |
|
|
668
|
+
| `description?` | `string` | the fallback description, if there isn't one for the specific situation |
|
|
669
|
+
| `description_create?` | `string` | - |
|
|
670
|
+
| `description_select?` | `string` | - |
|
|
671
|
+
| `description_update?` | `string` | - |
|
|
589
672
|
| `display_field_description?` | `boolean` | whether the field descriptions should be shown |
|
|
590
673
|
| `display_field_title?` | `boolean` | whether the field titles should be shown |
|
|
674
|
+
| `display_mode?` | ``"light"`` \| ``"dark"`` \| ``"default"`` | can you force the colour theme to change for just one page (#1066, #1074). At the moment this on pages that use WebcamImageCapture |
|
|
591
675
|
| `display_schema_description?` | `boolean` | whether the schema description should be shown |
|
|
592
676
|
| `extract_threshold?` | `number` | for ImageDynamicSection, the minimum score to be treated as a pass |
|
|
593
677
|
| `extract_threshold_fail_action?` | ``"capture"`` \| ``"capture_review"`` \| ``"recapture_or_next_step"`` \| ``"review"`` \| ``"next_step"`` | for ImageDynamicSection, the action to take if pre-verify fails |
|
|
@@ -605,5 +689,5 @@ configuration data for a single wizard page (@see WizardConfig)
|
|
|
605
689
|
| `schemas` | `string`[] | - |
|
|
606
690
|
| `selection_hierarchy_json?` | `string` | a URL to a preset for configuing NestedSchemaSelect. @see DeepConfig |
|
|
607
691
|
| `service_provider_link?` | `boolean` | see #463 |
|
|
608
|
-
| `share?` | ``"profile"`` \| ``"verification"`` \| ``"both"`` | the
|
|
692
|
+
| `share?` | ``"profile"`` \| ``"verification"`` \| ``"both"`` | the information to share. undefined implies both. |
|
|
609
693
|
| `verify_data?` | `boolean` | if `false`, ProfileObjects created while completing the form will not be verified. `undefined` implies `true` |
|
package/dist/crypto.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/dist/raytio.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Encrypted } from "./crypto";
|
|
2
|
-
import { Colors } from "./theme";
|
|
2
|
+
import { Colors, CustomFonts } from "./theme";
|
|
3
3
|
/** @internal see Microsoft/TypeScript#202 */
|
|
4
4
|
export declare type StringWithIdentity<T> = string & {
|
|
5
5
|
$$typeof$$: T;
|
|
6
6
|
};
|
|
7
|
+
/** @internal */
|
|
8
|
+
declare type Json = Record<string, any>;
|
|
7
9
|
/** A `p_id` is the ID of a @see Relationship */
|
|
8
10
|
export declare type PId = StringWithIdentity<"PId">;
|
|
9
11
|
/** An `i_id` is the ID of an @see Instance */
|
|
@@ -16,10 +18,14 @@ export declare type GId = StringWithIdentity<"GId">;
|
|
|
16
18
|
export declare type UId = StringWithIdentity<"UId">;
|
|
17
19
|
/** An `a_id` is the ID of an @see AA */
|
|
18
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">;
|
|
19
25
|
export declare type DataTypes = "string" | "number" | "boolean" | "object" | "integer" | "array" | "null";
|
|
20
26
|
export declare type SubmissionStatus = "Submitted" | "Processing" | "Rejected" | "Expired" | "Completed" | "DataChanged" | "Received" | "Accepted";
|
|
21
27
|
/** You can supply an option type argument if you know exactly what the properties will be */
|
|
22
|
-
export declare type ProfileObject<Properties =
|
|
28
|
+
export declare type ProfileObject<Properties = Json> = {
|
|
23
29
|
n_id: NId;
|
|
24
30
|
properties: Properties;
|
|
25
31
|
labels: string[];
|
|
@@ -29,10 +35,10 @@ export declare type ProfileObject<Properties = any> = {
|
|
|
29
35
|
* @internal the client adds this, if this PO doesn't actually belong to the current user,
|
|
30
36
|
* i.e. it's actually from a submission. If truthy, it's the `[aId, iId]` of the submission.
|
|
31
37
|
*/
|
|
32
|
-
isFromSubmission?: [aId:
|
|
38
|
+
isFromSubmission?: [aId: AId, iId: IId];
|
|
33
39
|
};
|
|
34
40
|
/** @internal This is what we send the API */
|
|
35
|
-
export declare type ProfileObjectForUpload<Properties =
|
|
41
|
+
export declare type ProfileObjectForUpload<Properties = Json> = {
|
|
36
42
|
properties: Properties;
|
|
37
43
|
document?: {
|
|
38
44
|
content?: string | Encrypted;
|
|
@@ -91,12 +97,17 @@ export declare type AA = {
|
|
|
91
97
|
/** markdown or string help information including [phoneNumber || email] */
|
|
92
98
|
aa_help?: string;
|
|
93
99
|
theme?: {
|
|
94
|
-
|
|
100
|
+
font?: CustomFonts;
|
|
101
|
+
colors?: Colors;
|
|
95
102
|
};
|
|
96
103
|
/** the n_id of the associated service provider */
|
|
97
104
|
service_provider_n_id?: NId;
|
|
98
105
|
/** the id of the associated organisation */
|
|
99
|
-
org_id:
|
|
106
|
+
org_id: OId;
|
|
107
|
+
/** configuration for the submission rules */
|
|
108
|
+
ruleset?: unknown;
|
|
109
|
+
/** if true, only specific email addresses can submit the form */
|
|
110
|
+
auth_list_enabled?: boolean;
|
|
100
111
|
/** @internal */
|
|
101
112
|
_transitions?: unknown[];
|
|
102
113
|
};
|
|
@@ -139,13 +150,15 @@ export declare type Instance = {
|
|
|
139
150
|
};
|
|
140
151
|
};
|
|
141
152
|
relationships?: Relationship[];
|
|
153
|
+
/** added by the client once it calculates the score */
|
|
154
|
+
score?: unknown;
|
|
142
155
|
};
|
|
143
156
|
/**
|
|
144
157
|
* An organization.
|
|
145
158
|
* NOTE: this is different to how the schema defines an Organization. **The schema is wrong (see #468)**
|
|
146
159
|
*/
|
|
147
160
|
export declare type Organization = {
|
|
148
|
-
id:
|
|
161
|
+
id: OId;
|
|
149
162
|
name: string;
|
|
150
163
|
email: string;
|
|
151
164
|
address: {
|
|
@@ -174,3 +187,27 @@ export declare type Validation = {
|
|
|
174
187
|
};
|
|
175
188
|
};
|
|
176
189
|
};
|
|
190
|
+
export declare type Webhook = {
|
|
191
|
+
wi_id: WId;
|
|
192
|
+
/** n_id of "the webhook provider which can be set up against a service provider" */
|
|
193
|
+
provider_webhook_id: NId;
|
|
194
|
+
status: unknown;
|
|
195
|
+
/** ISO Date */
|
|
196
|
+
date_created: string;
|
|
197
|
+
/** ISO Date */
|
|
198
|
+
date_updated: string;
|
|
199
|
+
webhook_filter_schema: {
|
|
200
|
+
operator: string;
|
|
201
|
+
field_value: string;
|
|
202
|
+
field_name: string;
|
|
203
|
+
};
|
|
204
|
+
webhook_action: {
|
|
205
|
+
webhook_action_type: string;
|
|
206
|
+
}[];
|
|
207
|
+
provider_subscription_credentials: unknown;
|
|
208
|
+
webhook_filter_source: string;
|
|
209
|
+
webhook_field_mapping_schema: {
|
|
210
|
+
[key: string]: string;
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
export {};
|
package/dist/schema.d.ts
CHANGED
|
@@ -7,12 +7,13 @@ export declare type ConditionallyRequired = {
|
|
|
7
7
|
[fieldName: string]: string[];
|
|
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:showOnWizard" | `display:main_media:${string}` | "action:client_upload" | "verify:show_if_pending" | "special:hide_select_behind_button" | "type:extract_required";
|
|
11
|
-
export declare type SchemaTag = "action:experimental_pass_object_store_id" | "action:verify" | "default_camera:rear" | "default_camera:front" | "type:service_provider" | "type:service_offer" | "type:marketplace" | "type:client_only" | "type:globally_unique_field";
|
|
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
12
|
export declare type SchemaField = {
|
|
13
13
|
/** @deprecated don't use, it's inconsistent */
|
|
14
14
|
$id?: string;
|
|
15
15
|
title?: string;
|
|
16
|
+
title_plural?: string;
|
|
16
17
|
description?: string;
|
|
17
18
|
/** readOnly means the Wizard won't show this field */
|
|
18
19
|
readOnly?: boolean;
|
|
@@ -26,22 +27,25 @@ export declare type SchemaField = {
|
|
|
26
27
|
maxLength?: number;
|
|
27
28
|
/** @deprecated raytio's usage not documented */
|
|
28
29
|
minLength?: number;
|
|
29
|
-
/**
|
|
30
|
-
defaultValue?: unknown;
|
|
30
|
+
/** the default value */
|
|
31
31
|
default?: unknown;
|
|
32
32
|
pattern?: string;
|
|
33
33
|
/** whether the field should be encrypted */
|
|
34
34
|
encrypt?: boolean;
|
|
35
|
-
format?: "date" | "date-time";
|
|
35
|
+
format?: "date" | "date-time" | "uri";
|
|
36
36
|
contentMediaType?: string;
|
|
37
37
|
contentEncoding?: "base64";
|
|
38
|
-
/** for nested
|
|
38
|
+
/** `items` is used for nested arrays, (while `properties` is used for nested objects) */
|
|
39
39
|
items?: {
|
|
40
40
|
type: DataTypes;
|
|
41
41
|
properties: {
|
|
42
42
|
[subFieldName: string]: SchemaField;
|
|
43
43
|
};
|
|
44
44
|
};
|
|
45
|
+
/** `properties` is used for nested objects, (while `items` is used for nested arrays) */
|
|
46
|
+
properties?: {
|
|
47
|
+
[subFieldName: string]: SchemaField;
|
|
48
|
+
};
|
|
45
49
|
/** If this field refers to a sub-object */
|
|
46
50
|
$ref?: string;
|
|
47
51
|
/**
|
|
@@ -61,10 +65,10 @@ export declare type SchemaField = {
|
|
|
61
65
|
/** URL to a JSON file in the `Lookup` format */
|
|
62
66
|
lookup?: string;
|
|
63
67
|
/** @internal the client adds this - it's the fieldName. */
|
|
64
|
-
$prop
|
|
68
|
+
$prop: string;
|
|
65
69
|
priority?: number;
|
|
66
70
|
/** @internal if supplied, it's the existing field values. Added by the client */
|
|
67
|
-
subObjectRef?:
|
|
71
|
+
subObjectRef?: unknown[];
|
|
68
72
|
/** specifies that the description is formatted in markdown */
|
|
69
73
|
description_decorator?: "md";
|
|
70
74
|
/** if a `pattern` is specified, this is the error message */
|
|
@@ -80,6 +84,8 @@ export declare type SchemaField = {
|
|
|
80
84
|
};
|
|
81
85
|
/** if this field is a table input, this determines the text to show on the "Add Row" btn */
|
|
82
86
|
add_row_btn_label?: string;
|
|
87
|
+
/** if this field is a table input, this determines the text to show if the table is empty */
|
|
88
|
+
table_empty_message?: string;
|
|
83
89
|
/**
|
|
84
90
|
* used on fields that are a signature file picker, see !849
|
|
85
91
|
* also used to determine if the MediaPicker should be shown inline
|
|
@@ -105,6 +111,8 @@ export declare type Schema = {
|
|
|
105
111
|
name: string;
|
|
106
112
|
title: string;
|
|
107
113
|
description: string;
|
|
114
|
+
/** plural version of the title */
|
|
115
|
+
title_plural?: string;
|
|
108
116
|
/**
|
|
109
117
|
* the group that a schema belongs to, such as "passports". This is useful for
|
|
110
118
|
* forms that accept different types of similar documents.
|
|
@@ -114,6 +122,9 @@ export declare type Schema = {
|
|
|
114
122
|
group_title?: string;
|
|
115
123
|
/** @deprecated not sure why a schema would have this, only fields should */
|
|
116
124
|
$ref?: string;
|
|
125
|
+
version?: string;
|
|
126
|
+
/** whether the `version` is the latest version */
|
|
127
|
+
version_current?: boolean;
|
|
117
128
|
tags?: SchemaTag[];
|
|
118
129
|
/** originally `string[]`, the client modifies this */
|
|
119
130
|
verified_fields?: (string | ConditionallyRequired)[];
|
|
@@ -129,6 +140,8 @@ export declare type Schema = {
|
|
|
129
140
|
if?: Schema;
|
|
130
141
|
then?: Schema;
|
|
131
142
|
}[];
|
|
143
|
+
/** If this tag exists, the schema is deprecated. ISO Date. */
|
|
144
|
+
end_date?: string;
|
|
132
145
|
/** 🚨 Note that there are cases where properties are undefined, e.g. if the schema is a sub-object */
|
|
133
146
|
properties: {
|
|
134
147
|
[fieldName: string]: SchemaField;
|
|
@@ -166,7 +179,7 @@ export declare type Schema = {
|
|
|
166
179
|
$loading_pending_ver_resubmit: {
|
|
167
180
|
title: string;
|
|
168
181
|
};
|
|
169
|
-
[fieldNameOrGroupName: string]: SchemaField & {
|
|
182
|
+
[fieldNameOrGroupName: string]: Omit<SchemaField, "$prop"> & {
|
|
170
183
|
title_plural?: string;
|
|
171
184
|
};
|
|
172
185
|
};
|
|
@@ -266,7 +279,7 @@ export declare type Schema = {
|
|
|
266
279
|
};
|
|
267
280
|
};
|
|
268
281
|
/** Only certain properties from the schema */
|
|
269
|
-
export declare type SchemaMetadata = Pick<Schema, "name" | "title" | "description" | "schema_group" | "i18n" | "display" | "clientLocale" | "groupNames" | "group_title"> & {
|
|
282
|
+
export declare type SchemaMetadata = Pick<Schema, "name" | "title" | "description" | "schema_group" | "end_date" | "i18n" | "display" | "tags" | "clientLocale" | "groupNames" | "title_plural" | "group_title"> & {
|
|
270
283
|
/**
|
|
271
284
|
* @deprecated this prop exists so that SchemaMetadata does not extend Schema.
|
|
272
285
|
* use `getSchema(schemaName)` to fetch the full schema
|
|
@@ -275,3 +288,5 @@ export declare type SchemaMetadata = Pick<Schema, "name" | "title" | "descriptio
|
|
|
275
288
|
isProfileSchema: boolean;
|
|
276
289
|
isSpSchema: boolean;
|
|
277
290
|
};
|
|
291
|
+
/** @ignore */
|
|
292
|
+
export declare type RelationDefinition = NonNullable<Schema["relationships"]>[number];
|
package/dist/theme.d.ts
CHANGED
package/dist/verification.d.ts
CHANGED
|
@@ -1,4 +1,28 @@
|
|
|
1
1
|
import { NId, ProfileObject } from "./raytio";
|
|
2
|
+
export declare type VerificationPayload<WithValue extends boolean> = {
|
|
3
|
+
field: string;
|
|
4
|
+
schema?: string;
|
|
5
|
+
metadata?: Record<string, unknown>;
|
|
6
|
+
passed: boolean;
|
|
7
|
+
request_div: string;
|
|
8
|
+
/** @deprecated don't use this, it looks like the schema name but it's not */
|
|
9
|
+
source: string;
|
|
10
|
+
/** the n_id of the parent profile object that this ver belongs (NOT the n_id of the field) */
|
|
11
|
+
source_n_id?: NId;
|
|
12
|
+
/** like `source_n_id` */
|
|
13
|
+
source_hashed_n_id?: NId;
|
|
14
|
+
type?: null;
|
|
15
|
+
v_id: string;
|
|
16
|
+
verification_date: string;
|
|
17
|
+
verifier_id?: NId;
|
|
18
|
+
verifier_source_id?: NId;
|
|
19
|
+
verifier_service_id?: NId;
|
|
20
|
+
verifier_div: string;
|
|
21
|
+
/** ISO Date */
|
|
22
|
+
valid_until?: string;
|
|
23
|
+
} & (WithValue extends true ? {
|
|
24
|
+
value: string | number;
|
|
25
|
+
} : {});
|
|
2
26
|
/**
|
|
3
27
|
* Different APIs inconsistently include the `value` prop. If you know it exists,
|
|
4
28
|
* use `Verification<true>`, otherwise just `Verification`. Verifications from
|
|
@@ -16,24 +40,7 @@ export declare type Verification<WithValue extends boolean = false> = ProfileObj
|
|
|
16
40
|
verifications: [
|
|
17
41
|
{
|
|
18
42
|
signature: string;
|
|
19
|
-
data:
|
|
20
|
-
field: string;
|
|
21
|
-
metadata?: Record<string, unknown>;
|
|
22
|
-
passed: boolean;
|
|
23
|
-
request_div: string;
|
|
24
|
-
/** @deprecated don't use this, it looks like the schema name but it's not */
|
|
25
|
-
source: string;
|
|
26
|
-
/** the n_id of the parent profile object that this ver belongs (NOT the n_id of the field) */
|
|
27
|
-
source_n_id: NId;
|
|
28
|
-
v_id: string;
|
|
29
|
-
verification_date: string;
|
|
30
|
-
verifier_id?: NId;
|
|
31
|
-
verifier_source_id?: NId;
|
|
32
|
-
verifier_service_id?: NId;
|
|
33
|
-
verifier_div: string;
|
|
34
|
-
} & (WithValue extends true ? {
|
|
35
|
-
value: string | number;
|
|
36
|
-
} : {});
|
|
43
|
+
data: VerificationPayload<WithValue>;
|
|
37
44
|
}
|
|
38
45
|
];
|
|
39
46
|
}>;
|
|
@@ -62,12 +69,12 @@ export declare type VerificationProvider = {
|
|
|
62
69
|
dataSourceNId?: NId;
|
|
63
70
|
serviceProviderNId?: NId;
|
|
64
71
|
/** the date which the verification was verified on, or last re-verified on */
|
|
65
|
-
date
|
|
72
|
+
date?: Date;
|
|
66
73
|
};
|
|
67
74
|
/** This is what @raytio/core exposes, which is more useable than @see Verification */
|
|
68
75
|
export declare type RealVer = {
|
|
69
76
|
fieldName: string;
|
|
70
|
-
value:
|
|
77
|
+
value: unknown;
|
|
71
78
|
provider: VerificationProvider;
|
|
72
79
|
signature: string;
|
|
73
80
|
/**
|
package/dist/verification.js
CHANGED
|
@@ -5,6 +5,8 @@ exports.POVerification = exports.FieldVerification = void 0;
|
|
|
5
5
|
* "Not Verified" means show no badge, cf. "Verified False" means the
|
|
6
6
|
* verifier revealed that the data was wrong. So show a ❌
|
|
7
7
|
*/
|
|
8
|
+
// We cannot change the enum values, since ScoreRules have been generated
|
|
9
|
+
// with the enum values hardcoded. The enum value are also used to find the "best" or "worst" verification (lower=better)
|
|
8
10
|
var FieldVerification;
|
|
9
11
|
(function (FieldVerification) {
|
|
10
12
|
FieldVerification[FieldVerification["Verified"] = 60001] = "Verified";
|
|
@@ -12,6 +14,8 @@ var FieldVerification;
|
|
|
12
14
|
FieldVerification[FieldVerification["VerifiedFalse"] = 60003] = "VerifiedFalse";
|
|
13
15
|
FieldVerification[FieldVerification["Expired"] = 60004] = "Expired";
|
|
14
16
|
})(FieldVerification = exports.FieldVerification || (exports.FieldVerification = {}));
|
|
17
|
+
// We cannot change the enum values, since ScoreRules have been generated
|
|
18
|
+
// with the enum values hardcoded.
|
|
15
19
|
var POVerification;
|
|
16
20
|
(function (POVerification) {
|
|
17
21
|
POVerification[POVerification["FullyVerified"] = 70001] = "FullyVerified";
|
package/dist/wizard.d.ts
CHANGED
|
@@ -5,7 +5,11 @@ export declare type WizardPage = {
|
|
|
5
5
|
name?: string | symbol;
|
|
6
6
|
filter: "oneOf" | "anyOf";
|
|
7
7
|
schemas: string[];
|
|
8
|
+
/** the fallback description, if there isn't one for the specific situation */
|
|
8
9
|
description?: string;
|
|
10
|
+
description_select?: string;
|
|
11
|
+
description_create?: string;
|
|
12
|
+
description_update?: string;
|
|
9
13
|
/** if explictly == false, then it's an AO (not a PO), in which case there can only be one schema */
|
|
10
14
|
profile?: boolean;
|
|
11
15
|
/** if true this page can be skipped. The PageResult wil be undefined */
|
|
@@ -43,8 +47,10 @@ export declare type WizardPage = {
|
|
|
43
47
|
verify_data?: boolean;
|
|
44
48
|
/** a list of fields that should not be required, even if the schema says they're required */
|
|
45
49
|
optional_fields?: string[];
|
|
46
|
-
/** the
|
|
50
|
+
/** the information to share. undefined implies both. */
|
|
47
51
|
share?: "profile" | "verification" | "both";
|
|
52
|
+
/** can you force the colour theme to change for just one page (#1066, #1074). At the moment this on pages that use WebcamImageCapture */
|
|
53
|
+
display_mode?: "light" | "dark" | "default";
|
|
48
54
|
};
|
|
49
55
|
/**
|
|
50
56
|
* when a form link is generated, this is what gets saved on the API.
|
|
@@ -77,7 +83,7 @@ export declare type WizardConfig = {
|
|
|
77
83
|
/** if specified, the email addresses that a submission should be sent to */
|
|
78
84
|
emails?: string[];
|
|
79
85
|
/**
|
|
80
|
-
* whether the
|
|
86
|
+
* whether the passwordless-signup process should be used if the user visits
|
|
81
87
|
* this form, and they are not logged in. If false, the standard sign-up
|
|
82
88
|
* process will be used
|
|
83
89
|
*/
|
package/package.json
CHANGED
package/src/crypto.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
export type Encrypted<_Data = string> = {
|
|
2
3
|
encrypted_key: {
|
|
3
4
|
encrypted_key: string;
|
|
4
5
|
};
|
|
5
6
|
encrypted_data: {
|
|
6
7
|
iv: string;
|
|
7
|
-
data:
|
|
8
|
+
data: string;
|
|
8
9
|
algorithm: AesKeyAlgorithm;
|
|
9
10
|
};
|
|
10
11
|
};
|
package/src/raytio.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { Encrypted } from "./crypto";
|
|
2
|
-
import { Colors } from "./theme";
|
|
2
|
+
import { Colors, CustomFonts } from "./theme";
|
|
3
3
|
|
|
4
4
|
/** @internal see Microsoft/TypeScript#202 */
|
|
5
5
|
export type StringWithIdentity<T> = string & { $$typeof$$: T };
|
|
6
6
|
|
|
7
|
+
/** @internal */
|
|
8
|
+
type Json = Record<string, any>; // TODO: (semver breaking) unknown
|
|
9
|
+
|
|
7
10
|
/** A `p_id` is the ID of a @see Relationship */
|
|
8
11
|
export type PId = StringWithIdentity<"PId">;
|
|
9
12
|
/** An `i_id` is the ID of an @see Instance */
|
|
@@ -16,6 +19,10 @@ export type GId = StringWithIdentity<"GId">;
|
|
|
16
19
|
export type UId = StringWithIdentity<"UId">;
|
|
17
20
|
/** An `a_id` is the ID of an @see AA */
|
|
18
21
|
export type AId = StringWithIdentity<"AId">;
|
|
22
|
+
/** An `o_id` is the ID of an @see Organization */
|
|
23
|
+
export type OId = StringWithIdentity<"OId">;
|
|
24
|
+
/** A `wi_id` is the ID of a @see Webhook */
|
|
25
|
+
export type WId = StringWithIdentity<"WId">;
|
|
19
26
|
|
|
20
27
|
export type DataTypes =
|
|
21
28
|
| "string"
|
|
@@ -37,7 +44,7 @@ export type SubmissionStatus =
|
|
|
37
44
|
| "Accepted";
|
|
38
45
|
|
|
39
46
|
/** You can supply an option type argument if you know exactly what the properties will be */
|
|
40
|
-
export type ProfileObject<Properties =
|
|
47
|
+
export type ProfileObject<Properties = Json> = {
|
|
41
48
|
n_id: NId;
|
|
42
49
|
properties: Properties;
|
|
43
50
|
labels: string[];
|
|
@@ -47,11 +54,11 @@ export type ProfileObject<Properties = any> = {
|
|
|
47
54
|
* @internal the client adds this, if this PO doesn't actually belong to the current user,
|
|
48
55
|
* i.e. it's actually from a submission. If truthy, it's the `[aId, iId]` of the submission.
|
|
49
56
|
*/
|
|
50
|
-
isFromSubmission?: [aId:
|
|
57
|
+
isFromSubmission?: [aId: AId, iId: IId];
|
|
51
58
|
};
|
|
52
59
|
|
|
53
60
|
/** @internal This is what we send the API */
|
|
54
|
-
export type ProfileObjectForUpload<Properties =
|
|
61
|
+
export type ProfileObjectForUpload<Properties = Json> = {
|
|
55
62
|
properties: Properties;
|
|
56
63
|
document?: {
|
|
57
64
|
content?: string | Encrypted;
|
|
@@ -125,12 +132,21 @@ export type AA = {
|
|
|
125
132
|
/** markdown or string help information including [phoneNumber || email] */
|
|
126
133
|
aa_help?: string;
|
|
127
134
|
theme?: {
|
|
128
|
-
|
|
135
|
+
font?: CustomFonts;
|
|
136
|
+
colors?: Colors;
|
|
129
137
|
};
|
|
130
138
|
/** the n_id of the associated service provider */
|
|
131
139
|
service_provider_n_id?: NId;
|
|
132
140
|
/** the id of the associated organisation */
|
|
133
|
-
org_id:
|
|
141
|
+
org_id: OId;
|
|
142
|
+
|
|
143
|
+
/** configuration for the submission rules */
|
|
144
|
+
// we know the type should be `ScoreConfig`, but we can't rely that it's valid, or the right version
|
|
145
|
+
ruleset?: unknown;
|
|
146
|
+
|
|
147
|
+
/** if true, only specific email addresses can submit the form */
|
|
148
|
+
auth_list_enabled?: boolean;
|
|
149
|
+
|
|
134
150
|
/** @internal */
|
|
135
151
|
_transitions?: unknown[];
|
|
136
152
|
};
|
|
@@ -176,6 +192,11 @@ export type Instance = {
|
|
|
176
192
|
};
|
|
177
193
|
};
|
|
178
194
|
relationships?: Relationship[];
|
|
195
|
+
|
|
196
|
+
/** added by the client once it calculates the score */
|
|
197
|
+
// Defined as `unknown` instead of `ScoreResult` because it could be nonsense,
|
|
198
|
+
// or a deprected version of `ScoreResult`.
|
|
199
|
+
score?: unknown;
|
|
179
200
|
};
|
|
180
201
|
|
|
181
202
|
/**
|
|
@@ -183,7 +204,7 @@ export type Instance = {
|
|
|
183
204
|
* NOTE: this is different to how the schema defines an Organization. **The schema is wrong (see #468)**
|
|
184
205
|
*/
|
|
185
206
|
export type Organization = {
|
|
186
|
-
id:
|
|
207
|
+
id: OId;
|
|
187
208
|
name: string;
|
|
188
209
|
email: string;
|
|
189
210
|
address: {
|
|
@@ -213,3 +234,26 @@ export type Validation = {
|
|
|
213
234
|
};
|
|
214
235
|
};
|
|
215
236
|
};
|
|
237
|
+
|
|
238
|
+
export type Webhook = {
|
|
239
|
+
wi_id: WId;
|
|
240
|
+
/** n_id of "the webhook provider which can be set up against a service provider" */
|
|
241
|
+
provider_webhook_id: NId;
|
|
242
|
+
status: unknown;
|
|
243
|
+
/** ISO Date */
|
|
244
|
+
date_created: string;
|
|
245
|
+
/** ISO Date */
|
|
246
|
+
date_updated: string;
|
|
247
|
+
|
|
248
|
+
webhook_filter_schema: {
|
|
249
|
+
operator: string;
|
|
250
|
+
field_value: string;
|
|
251
|
+
field_name: string;
|
|
252
|
+
};
|
|
253
|
+
webhook_action: { webhook_action_type: string }[];
|
|
254
|
+
provider_subscription_credentials: unknown;
|
|
255
|
+
webhook_filter_source: string;
|
|
256
|
+
webhook_field_mapping_schema: {
|
|
257
|
+
[key: string]: string;
|
|
258
|
+
};
|
|
259
|
+
};
|
package/src/schema.ts
CHANGED
|
@@ -23,12 +23,18 @@ export type SchemaFieldTag =
|
|
|
23
23
|
| "display:survey"
|
|
24
24
|
| "display:quoting"
|
|
25
25
|
| "display:customModal"
|
|
26
|
+
| "display:terms_conditions"
|
|
26
27
|
| "display:showOnWizard" // added by #837, TODO: document
|
|
27
28
|
| `display:main_media:${string}` // property name to determine what image to display
|
|
29
|
+
// date picker components
|
|
30
|
+
| "date_component:day"
|
|
31
|
+
| "date_component:month"
|
|
32
|
+
| "date_component:year"
|
|
28
33
|
// other
|
|
29
34
|
| "action:client_upload"
|
|
30
35
|
| "verify:show_if_pending"
|
|
31
36
|
| "special:hide_select_behind_button"
|
|
37
|
+
| "type:capture_geolocation" // triggers the wizard's GeoLocationInput field
|
|
32
38
|
| "type:extract_required";
|
|
33
39
|
|
|
34
40
|
export type SchemaTag =
|
|
@@ -38,6 +44,11 @@ export type SchemaTag =
|
|
|
38
44
|
// camera
|
|
39
45
|
| "default_camera:rear"
|
|
40
46
|
| "default_camera:front"
|
|
47
|
+
// oauth group rule
|
|
48
|
+
| `oauth2_component:name:${string}`
|
|
49
|
+
| `oauth2_component:redirect_url:${string}`
|
|
50
|
+
// misc
|
|
51
|
+
| `link_to:${/* schemaName */ string}:${/* relationshipType */ string}`
|
|
41
52
|
// type
|
|
42
53
|
| "type:service_provider"
|
|
43
54
|
| "type:service_offer"
|
|
@@ -49,6 +60,7 @@ export type SchemaField = {
|
|
|
49
60
|
/** @deprecated don't use, it's inconsistent */
|
|
50
61
|
$id?: string;
|
|
51
62
|
title?: string;
|
|
63
|
+
title_plural?: string;
|
|
52
64
|
description?: string;
|
|
53
65
|
/** readOnly means the Wizard won't show this field */
|
|
54
66
|
readOnly?: boolean;
|
|
@@ -62,22 +74,25 @@ export type SchemaField = {
|
|
|
62
74
|
maxLength?: number;
|
|
63
75
|
/** @deprecated raytio's usage not documented */
|
|
64
76
|
minLength?: number;
|
|
65
|
-
/**
|
|
66
|
-
defaultValue?: unknown;
|
|
77
|
+
/** the default value */
|
|
67
78
|
default?: unknown;
|
|
68
79
|
pattern?: string;
|
|
69
80
|
/** whether the field should be encrypted */
|
|
70
81
|
encrypt?: boolean;
|
|
71
|
-
format?: "date" | "date-time";
|
|
82
|
+
format?: "date" | "date-time" | "uri";
|
|
72
83
|
contentMediaType?: string;
|
|
73
84
|
contentEncoding?: "base64";
|
|
74
|
-
/** for nested
|
|
85
|
+
/** `items` is used for nested arrays, (while `properties` is used for nested objects) */
|
|
75
86
|
items?: {
|
|
76
87
|
type: DataTypes;
|
|
77
88
|
properties: {
|
|
78
89
|
[subFieldName: string]: SchemaField;
|
|
79
90
|
};
|
|
80
91
|
};
|
|
92
|
+
/** `properties` is used for nested objects, (while `items` is used for nested arrays) */
|
|
93
|
+
properties?: {
|
|
94
|
+
[subFieldName: string]: SchemaField;
|
|
95
|
+
};
|
|
81
96
|
|
|
82
97
|
/** If this field refers to a sub-object */
|
|
83
98
|
$ref?: string;
|
|
@@ -99,10 +114,10 @@ export type SchemaField = {
|
|
|
99
114
|
/** URL to a JSON file in the `Lookup` format */
|
|
100
115
|
lookup?: string;
|
|
101
116
|
/** @internal the client adds this - it's the fieldName. */
|
|
102
|
-
$prop
|
|
117
|
+
$prop: string;
|
|
103
118
|
priority?: number;
|
|
104
119
|
/** @internal if supplied, it's the existing field values. Added by the client */
|
|
105
|
-
subObjectRef?:
|
|
120
|
+
subObjectRef?: unknown[];
|
|
106
121
|
/** specifies that the description is formatted in markdown */
|
|
107
122
|
description_decorator?: "md";
|
|
108
123
|
/** if a `pattern` is specified, this is the error message */
|
|
@@ -119,6 +134,8 @@ export type SchemaField = {
|
|
|
119
134
|
};
|
|
120
135
|
/** if this field is a table input, this determines the text to show on the "Add Row" btn */
|
|
121
136
|
add_row_btn_label?: string;
|
|
137
|
+
/** if this field is a table input, this determines the text to show if the table is empty */
|
|
138
|
+
table_empty_message?: string;
|
|
122
139
|
|
|
123
140
|
/**
|
|
124
141
|
* used on fields that are a signature file picker, see !849
|
|
@@ -149,6 +166,8 @@ export type Schema = {
|
|
|
149
166
|
title: string;
|
|
150
167
|
description: string;
|
|
151
168
|
|
|
169
|
+
/** plural version of the title */
|
|
170
|
+
title_plural?: string;
|
|
152
171
|
/**
|
|
153
172
|
* the group that a schema belongs to, such as "passports". This is useful for
|
|
154
173
|
* forms that accept different types of similar documents.
|
|
@@ -160,6 +179,10 @@ export type Schema = {
|
|
|
160
179
|
/** @deprecated not sure why a schema would have this, only fields should */
|
|
161
180
|
$ref?: string;
|
|
162
181
|
|
|
182
|
+
version?: string;
|
|
183
|
+
/** whether the `version` is the latest version */
|
|
184
|
+
version_current?: boolean;
|
|
185
|
+
|
|
163
186
|
tags?: SchemaTag[];
|
|
164
187
|
/** originally `string[]`, the client modifies this */
|
|
165
188
|
verified_fields?: (string | ConditionallyRequired)[];
|
|
@@ -177,6 +200,9 @@ export type Schema = {
|
|
|
177
200
|
then?: Schema;
|
|
178
201
|
}[];
|
|
179
202
|
|
|
203
|
+
/** If this tag exists, the schema is deprecated. ISO Date. */
|
|
204
|
+
end_date?: string;
|
|
205
|
+
|
|
180
206
|
/** 🚨 Note that there are cases where properties are undefined, e.g. if the schema is a sub-object */
|
|
181
207
|
properties: {
|
|
182
208
|
[fieldName: string]: SchemaField;
|
|
@@ -188,6 +214,7 @@ export type Schema = {
|
|
|
188
214
|
// @ts-expect-error I don't understand what's wrong
|
|
189
215
|
$schema: Schema;
|
|
190
216
|
// not that for entries that start in "group:" or $loading_, only the title field will be used.
|
|
217
|
+
// ^ the exception is `group:{GROUP_NAME}:{SUB_GROUP}.field` which is used for the combined field title/desc
|
|
191
218
|
// normal fields can specify any field attributes to override.
|
|
192
219
|
|
|
193
220
|
// see !1796 for where these are used
|
|
@@ -202,7 +229,9 @@ export type Schema = {
|
|
|
202
229
|
$loading_delete_pending_ver: { title: string };
|
|
203
230
|
$loading_pending_ver_resubmit: { title: string };
|
|
204
231
|
|
|
205
|
-
[fieldNameOrGroupName: string]: SchemaField & {
|
|
232
|
+
[fieldNameOrGroupName: string]: Omit<SchemaField, "$prop"> & {
|
|
233
|
+
title_plural?: string;
|
|
234
|
+
};
|
|
206
235
|
};
|
|
207
236
|
};
|
|
208
237
|
/** @internal the client adds this after processing the i18n property */
|
|
@@ -311,11 +340,14 @@ export type SchemaMetadata = Pick<
|
|
|
311
340
|
| "title"
|
|
312
341
|
| "description"
|
|
313
342
|
| "schema_group"
|
|
343
|
+
| "end_date"
|
|
314
344
|
| "i18n"
|
|
315
345
|
| "display"
|
|
346
|
+
| "tags"
|
|
316
347
|
// added by the client
|
|
317
348
|
| "clientLocale"
|
|
318
349
|
| "groupNames"
|
|
350
|
+
| "title_plural"
|
|
319
351
|
| "group_title"
|
|
320
352
|
> & {
|
|
321
353
|
/**
|
|
@@ -327,3 +359,6 @@ export type SchemaMetadata = Pick<
|
|
|
327
359
|
isProfileSchema: boolean;
|
|
328
360
|
isSpSchema: boolean;
|
|
329
361
|
};
|
|
362
|
+
|
|
363
|
+
/** @ignore */
|
|
364
|
+
export type RelationDefinition = NonNullable<Schema["relationships"]>[number];
|
package/src/theme.ts
CHANGED
package/src/verification.ts
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
import { NId, ProfileObject } from "./raytio";
|
|
2
2
|
|
|
3
|
+
export type VerificationPayload<WithValue extends boolean> = {
|
|
4
|
+
// we deliberately haven't defined 'sub'
|
|
5
|
+
field: string;
|
|
6
|
+
schema?: string;
|
|
7
|
+
metadata?: Record<string, unknown>;
|
|
8
|
+
passed: boolean;
|
|
9
|
+
request_div: string;
|
|
10
|
+
/** @deprecated don't use this, it looks like the schema name but it's not */
|
|
11
|
+
source: string;
|
|
12
|
+
/** the n_id of the parent profile object that this ver belongs (NOT the n_id of the field) */
|
|
13
|
+
source_n_id?: NId;
|
|
14
|
+
/** like `source_n_id` */
|
|
15
|
+
source_hashed_n_id?: NId;
|
|
16
|
+
type?: null;
|
|
17
|
+
v_id: string;
|
|
18
|
+
verification_date: string;
|
|
19
|
+
verifier_id?: NId;
|
|
20
|
+
verifier_source_id?: NId;
|
|
21
|
+
verifier_service_id?: NId;
|
|
22
|
+
verifier_div: string;
|
|
23
|
+
/** ISO Date */
|
|
24
|
+
valid_until?: string;
|
|
25
|
+
// we are disabling the eslint rule beacuse even tho `{}` acts illogically in typescript,
|
|
26
|
+
// in this case it's working as expected in the intersection type, see
|
|
27
|
+
// https://github.com/typescript-eslint/typescript-eslint/issues/2063#issuecomment-632833366
|
|
28
|
+
// and https://github.com/typescript-eslint/typescript-eslint/issues/2063#issuecomment-645510515
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
30
|
+
} & (WithValue extends true ? { value: string | number } : {});
|
|
31
|
+
|
|
3
32
|
/**
|
|
4
33
|
* Different APIs inconsistently include the `value` prop. If you know it exists,
|
|
5
34
|
* use `Verification<true>`, otherwise just `Verification`. Verifications from
|
|
@@ -17,27 +46,7 @@ export type Verification<WithValue extends boolean = false> = ProfileObject<{
|
|
|
17
46
|
verifications: [
|
|
18
47
|
{
|
|
19
48
|
signature: string;
|
|
20
|
-
data:
|
|
21
|
-
field: string;
|
|
22
|
-
metadata?: Record<string, unknown>;
|
|
23
|
-
passed: boolean;
|
|
24
|
-
request_div: string;
|
|
25
|
-
/** @deprecated don't use this, it looks like the schema name but it's not */
|
|
26
|
-
source: string;
|
|
27
|
-
/** the n_id of the parent profile object that this ver belongs (NOT the n_id of the field) */
|
|
28
|
-
source_n_id: NId;
|
|
29
|
-
v_id: string;
|
|
30
|
-
verification_date: string;
|
|
31
|
-
verifier_id?: NId;
|
|
32
|
-
verifier_source_id?: NId;
|
|
33
|
-
verifier_service_id?: NId;
|
|
34
|
-
verifier_div: string;
|
|
35
|
-
// we are disabling the eslint rule beacuse even tho `{}` acts illogically in typescript,
|
|
36
|
-
// in this case it's working as expected in the intersection type, see
|
|
37
|
-
// https://github.com/typescript-eslint/typescript-eslint/issues/2063#issuecomment-632833366
|
|
38
|
-
// and https://github.com/typescript-eslint/typescript-eslint/issues/2063#issuecomment-645510515
|
|
39
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
40
|
-
} & (WithValue extends true ? { value: string | number } : {});
|
|
49
|
+
data: VerificationPayload<WithValue>;
|
|
41
50
|
},
|
|
42
51
|
];
|
|
43
52
|
}>;
|
|
@@ -46,6 +55,8 @@ export type Verification<WithValue extends boolean = false> = ProfileObject<{
|
|
|
46
55
|
* "Not Verified" means show no badge, cf. "Verified False" means the
|
|
47
56
|
* verifier revealed that the data was wrong. So show a ❌
|
|
48
57
|
*/
|
|
58
|
+
// We cannot change the enum values, since ScoreRules have been generated
|
|
59
|
+
// with the enum values hardcoded. The enum value are also used to find the "best" or "worst" verification (lower=better)
|
|
49
60
|
export enum FieldVerification {
|
|
50
61
|
Verified = 60_001,
|
|
51
62
|
NotVerified,
|
|
@@ -53,6 +64,8 @@ export enum FieldVerification {
|
|
|
53
64
|
Expired,
|
|
54
65
|
}
|
|
55
66
|
|
|
67
|
+
// We cannot change the enum values, since ScoreRules have been generated
|
|
68
|
+
// with the enum values hardcoded.
|
|
56
69
|
export enum POVerification {
|
|
57
70
|
FullyVerified = 70_001,
|
|
58
71
|
PartiallyVerified,
|
|
@@ -69,13 +82,13 @@ export type VerificationProvider = {
|
|
|
69
82
|
dataSourceNId?: NId;
|
|
70
83
|
serviceProviderNId?: NId;
|
|
71
84
|
/** the date which the verification was verified on, or last re-verified on */
|
|
72
|
-
date
|
|
85
|
+
date?: Date;
|
|
73
86
|
};
|
|
74
87
|
|
|
75
88
|
/** This is what @raytio/core exposes, which is more useable than @see Verification */
|
|
76
89
|
export type RealVer = {
|
|
77
90
|
fieldName: string;
|
|
78
|
-
value:
|
|
91
|
+
value: unknown;
|
|
79
92
|
provider: VerificationProvider;
|
|
80
93
|
signature: string;
|
|
81
94
|
/**
|
package/src/wizard.ts
CHANGED
|
@@ -7,7 +7,12 @@ export type WizardPage = {
|
|
|
7
7
|
filter: "oneOf" | "anyOf";
|
|
8
8
|
schemas: string[];
|
|
9
9
|
|
|
10
|
+
/** the fallback description, if there isn't one for the specific situation */
|
|
10
11
|
description?: string;
|
|
12
|
+
description_select?: string;
|
|
13
|
+
description_create?: string;
|
|
14
|
+
description_update?: string;
|
|
15
|
+
|
|
11
16
|
/** if explictly == false, then it's an AO (not a PO), in which case there can only be one schema */
|
|
12
17
|
profile?: boolean;
|
|
13
18
|
/** if true this page can be skipped. The PageResult wil be undefined */
|
|
@@ -61,9 +66,12 @@ export type WizardPage = {
|
|
|
61
66
|
/** a list of fields that should not be required, even if the schema says they're required */
|
|
62
67
|
optional_fields?: string[];
|
|
63
68
|
|
|
64
|
-
/** the
|
|
69
|
+
/** the information to share. undefined implies both. */
|
|
65
70
|
// TODO: 'profile' is not supported yet
|
|
66
71
|
share?: "profile" | "verification" | "both";
|
|
72
|
+
|
|
73
|
+
/** can you force the colour theme to change for just one page (#1066, #1074). At the moment this on pages that use WebcamImageCapture */
|
|
74
|
+
display_mode?: "light" | "dark" | "default";
|
|
67
75
|
};
|
|
68
76
|
|
|
69
77
|
/**
|
|
@@ -107,7 +115,7 @@ export type WizardConfig = {
|
|
|
107
115
|
emails?: string[];
|
|
108
116
|
|
|
109
117
|
/**
|
|
110
|
-
* whether the
|
|
118
|
+
* whether the passwordless-signup process should be used if the user visits
|
|
111
119
|
* this form, and they are not logged in. If false, the standard sign-up
|
|
112
120
|
* process will be used
|
|
113
121
|
*/
|