@raytio/types 7.1.0 → 7.3.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/README.md +250 -80
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/orgs.d.ts +84 -0
- package/dist/orgs.js +2 -0
- package/dist/raytio.d.ts +79 -48
- package/dist/schema.d.ts +24 -12
- package/dist/verification.d.ts +36 -4
- package/dist/verification.js +13 -3
- package/dist/wizard.d.ts +8 -4
- package/package.json +1 -1
- package/src/__tests__/raytio.typetest.ts +6 -0
- package/src/__tests__/{schema.ts → schema.typetest.ts} +1 -1
- package/src/index.ts +1 -0
- package/src/orgs.ts +86 -0
- package/src/raytio.ts +95 -54
- package/src/schema.ts +32 -12
- package/src/verification.ts +40 -4
- package/src/wizard.ts +10 -4
package/dist/orgs.d.ts
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/** Types Used for Organization Related API Responses */
|
|
2
|
+
/** An Organisation */
|
|
3
|
+
export type Party = {
|
|
4
|
+
id: string;
|
|
5
|
+
start_date: string;
|
|
6
|
+
end_date: string;
|
|
7
|
+
active: boolean;
|
|
8
|
+
party_name: string;
|
|
9
|
+
party_description: string;
|
|
10
|
+
party_type: string;
|
|
11
|
+
metadata: PartyMetadata;
|
|
12
|
+
party_number: number;
|
|
13
|
+
};
|
|
14
|
+
/** An Organizations credentials */
|
|
15
|
+
export type PartyMetadata = {
|
|
16
|
+
gandalf: unknown;
|
|
17
|
+
stripe: {
|
|
18
|
+
customer: unknown;
|
|
19
|
+
};
|
|
20
|
+
centrix_credentials: unknown;
|
|
21
|
+
};
|
|
22
|
+
/** An Organization Site */
|
|
23
|
+
export type PartySite = {
|
|
24
|
+
id: string;
|
|
25
|
+
start_date: string;
|
|
26
|
+
end_date: string;
|
|
27
|
+
active: boolean;
|
|
28
|
+
party_id: string;
|
|
29
|
+
location_number: number;
|
|
30
|
+
party_site_name: string;
|
|
31
|
+
party_site_description: string | null;
|
|
32
|
+
party_site_number: string | null;
|
|
33
|
+
party_uses: string[];
|
|
34
|
+
party_use_primary: string;
|
|
35
|
+
metadata: unknown;
|
|
36
|
+
};
|
|
37
|
+
/** An Organization Location */
|
|
38
|
+
export type Location = {
|
|
39
|
+
id: string;
|
|
40
|
+
start_date: string;
|
|
41
|
+
end_date: string;
|
|
42
|
+
active: boolean;
|
|
43
|
+
location_name: string;
|
|
44
|
+
location_description: string | null;
|
|
45
|
+
address_line_1: string | null;
|
|
46
|
+
address_line_2: string | null;
|
|
47
|
+
address_line_3: string | null;
|
|
48
|
+
address_line_4: string | null;
|
|
49
|
+
premise: string | null;
|
|
50
|
+
subpremise: string | null;
|
|
51
|
+
street_number: string | null;
|
|
52
|
+
administrative_area_level_1: string | null;
|
|
53
|
+
administrative_area_level_2: string | null;
|
|
54
|
+
administrative_area_level_3: string | null;
|
|
55
|
+
route: string | null;
|
|
56
|
+
locality: string | null;
|
|
57
|
+
postal_code: string;
|
|
58
|
+
postal_code_suffix: string | null;
|
|
59
|
+
city: string | null;
|
|
60
|
+
region: string | null;
|
|
61
|
+
country: string | null;
|
|
62
|
+
geolocation: string | null;
|
|
63
|
+
geolocation_outline: string | null;
|
|
64
|
+
metadata: unknown;
|
|
65
|
+
};
|
|
66
|
+
/** A Contact Point for an Organization */
|
|
67
|
+
export type ContactPoint = {
|
|
68
|
+
id: string;
|
|
69
|
+
start_date: string;
|
|
70
|
+
end_date: string;
|
|
71
|
+
active: boolean;
|
|
72
|
+
to_table: string;
|
|
73
|
+
uuid: string | undefined;
|
|
74
|
+
contact_point_purpose: string;
|
|
75
|
+
contact_point_type: string;
|
|
76
|
+
e164: string | null;
|
|
77
|
+
e164_suffix: string | null;
|
|
78
|
+
e164_type: string | null;
|
|
79
|
+
url: string | null;
|
|
80
|
+
url_type: string | null;
|
|
81
|
+
email_address: string;
|
|
82
|
+
email_address_preferred_format: string;
|
|
83
|
+
metadata: unknown;
|
|
84
|
+
};
|
package/dist/orgs.js
ADDED
package/dist/raytio.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Encrypted } from "./crypto";
|
|
2
|
-
import { Colors, CustomFonts } from "./theme";
|
|
1
|
+
import type { Encrypted } from "./crypto";
|
|
2
|
+
import type { Colors, CustomFonts } from "./theme";
|
|
3
3
|
/** @internal see Microsoft/TypeScript#202 */
|
|
4
4
|
export type StringWithIdentity<T> = string & {
|
|
5
5
|
$$typeof$$: T;
|
|
@@ -12,6 +12,8 @@ export type PId = StringWithIdentity<"PId">;
|
|
|
12
12
|
export type IId = StringWithIdentity<"IId">;
|
|
13
13
|
/** An `n_id` is the ID of a {@link ProfileObject} */
|
|
14
14
|
export type NId = StringWithIdentity<"NId">;
|
|
15
|
+
/** ⚠️ This ID duplicates the {@link NId} and should only be used in exceptional circumstances */
|
|
16
|
+
export type NId2 = StringWithIdentity<"NId2">;
|
|
15
17
|
/** A `g_id` is the ID of a group */
|
|
16
18
|
export type GId = StringWithIdentity<"GId">;
|
|
17
19
|
/** A `u_id` is the ID of a user */
|
|
@@ -23,11 +25,35 @@ export type OId = StringWithIdentity<"OId">;
|
|
|
23
25
|
/** A `wi_id` is the ID of a {@link Webhook} */
|
|
24
26
|
export type WId = StringWithIdentity<"WId">;
|
|
25
27
|
/** An `l_id` is the ID of any data stored in the KV-Store */ export type LId = StringWithIdentity<"LId">;
|
|
26
|
-
|
|
28
|
+
/** A `k_id` (also called a `aack_id` or a `publicKeyId`) is the ID of an AA's public key */
|
|
29
|
+
export type KId = StringWithIdentity<"KId">;
|
|
30
|
+
/** A `SchemaName` is the ID of a {@link Schema} */
|
|
31
|
+
export type SchemaName = StringWithIdentity<"SchemaName">;
|
|
27
32
|
export type DataTypes = "string" | "number" | "boolean" | "object" | "integer" | "array" | "null";
|
|
28
33
|
export type SubmissionStatus = "Submitted" | "Processing" | "Rejected" | "Expired" | "Completed" | "DataChanged" | "Received" | "Accepted";
|
|
34
|
+
/**
|
|
35
|
+
* Every object in the new database has these fields. In the
|
|
36
|
+
* interest of type-safety, the `id` should be one of the
|
|
37
|
+
* well-known IDs that extend {@link StringWithIdentity} (e.g.
|
|
38
|
+
* {@link NId} or {@link AId}). If the ID is irrelevant, then
|
|
39
|
+
* use `CommonFields<never>` rather than `CommonFields<string>`.
|
|
40
|
+
* This will deliberately prevent you from utilising the `id`
|
|
41
|
+
* field until you define a special type for that ID.
|
|
42
|
+
*
|
|
43
|
+
* This is especially important with the new API where it is much
|
|
44
|
+
* easier to mix up the different types of IDs.
|
|
45
|
+
*/
|
|
46
|
+
export type CommonFields<IdType extends StringWithIdentity<string>, Metadata = unknown> = {
|
|
47
|
+
id: IdType;
|
|
48
|
+
/** ISO Date */
|
|
49
|
+
start_date: string;
|
|
50
|
+
/** ISO Date */
|
|
51
|
+
end_date: string;
|
|
52
|
+
active: boolean;
|
|
53
|
+
metadata: Metadata | undefined;
|
|
54
|
+
};
|
|
29
55
|
/** You can supply an option type argument if you know exactly what the properties will be */
|
|
30
|
-
export type ProfileObject<Properties = Json> = {
|
|
56
|
+
export type ProfileObject<Properties = Json> = Partial<CommonFields<NId2>> & {
|
|
31
57
|
n_id: NId;
|
|
32
58
|
properties: Properties;
|
|
33
59
|
labels: string[];
|
|
@@ -47,22 +73,12 @@ export type ProfileObjectForUpload<Properties = Json> = {
|
|
|
47
73
|
type?: string;
|
|
48
74
|
};
|
|
49
75
|
labels?: string[];
|
|
50
|
-
schema?:
|
|
76
|
+
schema?: SchemaName;
|
|
51
77
|
n_id?: NId;
|
|
52
78
|
};
|
|
53
|
-
/**
|
|
54
|
-
* arbitrary key-values pairs stored on a Profile Object.
|
|
55
|
-
* May contain nested JSON and {@link Encrypted} properties.
|
|
56
|
-
*
|
|
57
|
-
* There are some limits to field names: they cannot be called
|
|
58
|
-
* `__signature` nor can they include the character sequence `<=>`.
|
|
59
|
-
*
|
|
60
|
-
* @deprecated - use {@link Json}
|
|
61
|
-
*/
|
|
62
|
-
export type Properties = Json;
|
|
63
79
|
export type UrnNodeType = "user" | "profile_object" | "instance" | "schema" | "temp_object" | "document";
|
|
64
80
|
/** e.g. "urn:user:..." */
|
|
65
|
-
export type Urn = `urn:${
|
|
81
|
+
export type Urn = `urn:user:${UId}` | `urn:profile_object:${NId}` | `urn:instance:${IId}` | `urn:temp_object:${LId}` | `urn:schema:${SchemaName}` | `urn:document:${NId}`;
|
|
66
82
|
export type Relationship = {
|
|
67
83
|
start: Urn;
|
|
68
84
|
end: Urn;
|
|
@@ -73,6 +89,9 @@ export type Relationship = {
|
|
|
73
89
|
name?: string;
|
|
74
90
|
[fieldName: string]: unknown;
|
|
75
91
|
};
|
|
92
|
+
start_date?: string;
|
|
93
|
+
end_date?: string;
|
|
94
|
+
active?: boolean;
|
|
76
95
|
};
|
|
77
96
|
export type Lookup = {
|
|
78
97
|
key: string | number;
|
|
@@ -91,8 +110,9 @@ export type AA = {
|
|
|
91
110
|
description?: string;
|
|
92
111
|
/** If a user signs up while completing this form, this message will be sent in the sign up email. */
|
|
93
112
|
aa_introduction?: string;
|
|
113
|
+
/** @deprecated see !2101 */
|
|
94
114
|
picture?: Urn;
|
|
95
|
-
/** Easy to use AA logo url for pasting
|
|
115
|
+
/** Easy to use AA logo url for pasting into emails */
|
|
96
116
|
picture_url?: string;
|
|
97
117
|
scopes?: string[];
|
|
98
118
|
tags?: AATag[];
|
|
@@ -111,16 +131,24 @@ export type AA = {
|
|
|
111
131
|
ruleset?: unknown;
|
|
112
132
|
/** if true, only specific email addresses can submit the form */
|
|
113
133
|
auth_list_enabled?: boolean;
|
|
134
|
+
/** Currently Unused Attributes */
|
|
135
|
+
start_date?: Date;
|
|
136
|
+
end_date?: Date;
|
|
137
|
+
active?: boolean;
|
|
138
|
+
key?: string;
|
|
139
|
+
logout_uri?: string[];
|
|
140
|
+
metadata?: unknown;
|
|
141
|
+
secret?: unknown;
|
|
114
142
|
/** @internal */
|
|
115
143
|
transitions?: unknown[];
|
|
116
144
|
};
|
|
117
|
-
export type
|
|
118
|
-
|
|
119
|
-
|
|
145
|
+
export type InstanceWithoutData = CommonFields<IId, {
|
|
146
|
+
message?: string;
|
|
147
|
+
}> & {
|
|
120
148
|
/** ID of the access application this submission was made to */
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
|
|
149
|
+
aa_id: AId;
|
|
150
|
+
/** ID of the public key for this AA */
|
|
151
|
+
aack_id: KId;
|
|
124
152
|
/** Code that validates information has been shared */
|
|
125
153
|
confirmation_code: string;
|
|
126
154
|
/** reference provided by the user who shared the data */
|
|
@@ -128,33 +156,43 @@ export type Instance = {
|
|
|
128
156
|
/** Email of user who shared the data */
|
|
129
157
|
data_provider_email: string;
|
|
130
158
|
thread: string;
|
|
131
|
-
/** Latest date in which the shared information was available */
|
|
132
|
-
end_date: string;
|
|
133
|
-
/** Earliest date on which the shared information was available */
|
|
134
|
-
start_date: string;
|
|
135
159
|
/** The status of a submission */
|
|
136
160
|
state: SubmissionStatus;
|
|
137
|
-
/** @deprecated The status of a submission */
|
|
138
|
-
_state?: SubmissionStatus;
|
|
139
|
-
/** Previous status of the shared information */
|
|
140
|
-
previous_state: SubmissionStatus;
|
|
141
161
|
/** Hash of the Service Provider ID */
|
|
142
|
-
sub_service_provider_hash
|
|
162
|
+
sub_service_provider_hash: string;
|
|
143
163
|
/** Service provider ID */
|
|
144
|
-
service_provider_n_id
|
|
145
|
-
/**
|
|
164
|
+
service_provider_n_id: NId;
|
|
165
|
+
/** added by the client once it calculates the score */
|
|
166
|
+
score?: unknown;
|
|
167
|
+
/** Previous status of the shared information */
|
|
168
|
+
previous_state?: SubmissionStatus;
|
|
169
|
+
/** Device Id */
|
|
170
|
+
device_id?: unknown;
|
|
171
|
+
/** Source IP */
|
|
172
|
+
source_ip?: unknown;
|
|
173
|
+
/** Related Offers */
|
|
174
|
+
related_offers?: unknown;
|
|
175
|
+
/** Instance Version */
|
|
176
|
+
instance_version?: unknown;
|
|
177
|
+
/** Footer Html */
|
|
178
|
+
platform_footer_html?: unknown;
|
|
179
|
+
/** Related Service Types */
|
|
180
|
+
related_service_types?: unknown;
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* The API used to store data in this format, but it no
|
|
184
|
+
* longer does :( so `@raytio/core` reconstructs this object.
|
|
185
|
+
*/
|
|
186
|
+
export type Instance = InstanceWithoutData & {
|
|
146
187
|
profile_objects: ProfileObject[];
|
|
147
188
|
keys: {
|
|
148
|
-
[
|
|
189
|
+
[nId2: NId2]: {
|
|
149
190
|
[fieldName: string]: {
|
|
150
191
|
data: string;
|
|
151
|
-
n_id: NId;
|
|
152
192
|
};
|
|
153
193
|
};
|
|
154
194
|
};
|
|
155
|
-
relationships
|
|
156
|
-
/** added by the client once it calculates the score */
|
|
157
|
-
score?: unknown;
|
|
195
|
+
relationships: Relationship[];
|
|
158
196
|
};
|
|
159
197
|
/**
|
|
160
198
|
* An organization.
|
|
@@ -164,15 +202,8 @@ export type Organization = {
|
|
|
164
202
|
id: OId;
|
|
165
203
|
name: string;
|
|
166
204
|
email: string;
|
|
167
|
-
address:
|
|
168
|
-
|
|
169
|
-
street1: string;
|
|
170
|
-
street2: string;
|
|
171
|
-
city: string;
|
|
172
|
-
region: string;
|
|
173
|
-
country: string;
|
|
174
|
-
};
|
|
175
|
-
customer: Record<string, unknown>;
|
|
205
|
+
address: unknown;
|
|
206
|
+
customer: unknown;
|
|
176
207
|
};
|
|
177
208
|
/** @internal some APIs now return extra info */
|
|
178
209
|
export type FullOrg = {
|
package/dist/schema.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AA, DataTypes, Organization, Urn } from "./raytio";
|
|
2
|
-
import { WizardConfig } from "./wizard";
|
|
1
|
+
import type { AA, DataTypes, Organization, SchemaName, Urn } from "./raytio";
|
|
2
|
+
import type { WizardConfig } from "./wizard";
|
|
3
3
|
/** should be renamed since this applies to ConditionallyVerifiable */
|
|
4
4
|
export type ConditionallyRequired = {
|
|
5
5
|
field: string;
|
|
@@ -7,7 +7,7 @@ export type ConditionallyRequired = {
|
|
|
7
7
|
[fieldName: string]: (string | number | boolean)[];
|
|
8
8
|
};
|
|
9
9
|
};
|
|
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";
|
|
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" | "action:require_webauthn" | "verify:show_if_pending" | "special:hide_select_behind_button" | "type:capture_geolocation" | "type:extract_required";
|
|
11
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
12
|
export type SchemaField = {
|
|
13
13
|
/** @deprecated don't use, it's inconsistent */
|
|
@@ -53,7 +53,7 @@ export type SchemaField = {
|
|
|
53
53
|
[subFieldName: string]: SchemaField;
|
|
54
54
|
};
|
|
55
55
|
/** If this field refers to a sub-object */
|
|
56
|
-
$ref?:
|
|
56
|
+
$ref?: SchemaName;
|
|
57
57
|
/**
|
|
58
58
|
* @internal
|
|
59
59
|
* the client adds this for conditional properties, see #329
|
|
@@ -108,11 +108,12 @@ export type SchemaField = {
|
|
|
108
108
|
export type ServerSchemaField = Omit<SchemaField, "$prop">;
|
|
109
109
|
/** not exported. Attributes that are identical in both client schema & server schema */
|
|
110
110
|
export type CommonSchemaAttributes = {
|
|
111
|
-
type?: DataTypes;
|
|
112
111
|
/** these fields will always exist on schema */
|
|
113
|
-
name: string;
|
|
114
112
|
title: string;
|
|
115
113
|
description: string;
|
|
114
|
+
/** specifies that the description is formatted in markdown */
|
|
115
|
+
description_decorator?: "md";
|
|
116
|
+
schema_type?: SchemaType;
|
|
116
117
|
/** plural version of the title */
|
|
117
118
|
title_plural?: string;
|
|
118
119
|
/**
|
|
@@ -158,6 +159,10 @@ export type CommonSchemaAttributes = {
|
|
|
158
159
|
$loading_pending_ver_resubmit: {
|
|
159
160
|
title: string;
|
|
160
161
|
};
|
|
162
|
+
$loading_long_verification_message: {
|
|
163
|
+
title?: string;
|
|
164
|
+
description?: string;
|
|
165
|
+
};
|
|
161
166
|
[fieldNameOrGroupName: string]: ServerSchemaField & {
|
|
162
167
|
title_plural?: string;
|
|
163
168
|
};
|
|
@@ -170,9 +175,9 @@ export type CommonSchemaAttributes = {
|
|
|
170
175
|
/** if required_relationship then use will be alerted in relationship menu and won't be able to share PO unless filled out */
|
|
171
176
|
required_relationship?: boolean;
|
|
172
177
|
/** Specify `oneOf` XOR `anyOf`. It's a list of schema names, or `"instance"` (see #784) */
|
|
173
|
-
oneOf?:
|
|
178
|
+
oneOf?: (SchemaName | "instance")[];
|
|
174
179
|
/** Specify `oneOf` XOR `anyOf` It's a list of schema names. */
|
|
175
|
-
anyOf?:
|
|
180
|
+
anyOf?: SchemaName[];
|
|
176
181
|
/** assume TRUE if not specified */
|
|
177
182
|
multiple?: boolean;
|
|
178
183
|
/** these are arbitary fields on the relationship */
|
|
@@ -212,7 +217,7 @@ export type CommonSchemaAttributes = {
|
|
|
212
217
|
onboard_properties?: {
|
|
213
218
|
/** Profile Objects that should be created */
|
|
214
219
|
profile_objects?: {
|
|
215
|
-
schema_name:
|
|
220
|
+
schema_name: SchemaName;
|
|
216
221
|
properties: Record<string, unknown>;
|
|
217
222
|
}[];
|
|
218
223
|
/** Relationships that should be created */
|
|
@@ -248,6 +253,10 @@ export type CommonSchemaAttributes = {
|
|
|
248
253
|
* of what the API returns.
|
|
249
254
|
*/
|
|
250
255
|
export type Schema = CommonSchemaAttributes & {
|
|
256
|
+
/** added by the client, copied from {@link WrappedSchema} */
|
|
257
|
+
name: SchemaName;
|
|
258
|
+
/** added by client */
|
|
259
|
+
type?: DataTypes;
|
|
251
260
|
/** the localized title of the `schema_group`. added by the client */
|
|
252
261
|
group_title?: string;
|
|
253
262
|
/** originally `string[]`, the client modifies this */
|
|
@@ -280,6 +289,8 @@ export type Schema = CommonSchemaAttributes & {
|
|
|
280
289
|
/** added by the client. If true, this schema somehow relates to legacy service providers */
|
|
281
290
|
isSpSchema?: boolean;
|
|
282
291
|
};
|
|
292
|
+
/** Type Classification of a Schema returned by API */
|
|
293
|
+
export type SchemaType = "ss" | "ps" | "us";
|
|
283
294
|
/** This is what's returned by the API */
|
|
284
295
|
export type WrappedSchema = {
|
|
285
296
|
active: true;
|
|
@@ -287,9 +298,10 @@ export type WrappedSchema = {
|
|
|
287
298
|
start_date: string;
|
|
288
299
|
/** ISO Date. If this tag exists, the schema is deprecated. */
|
|
289
300
|
end_date: string;
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
301
|
+
/** Schema Name Type and Version Properties */
|
|
302
|
+
schema_name: SchemaName;
|
|
303
|
+
schema_type: SchemaType;
|
|
304
|
+
schema_version: string;
|
|
293
305
|
/** whether the \`version\` is the latest version */
|
|
294
306
|
version_current: boolean;
|
|
295
307
|
schema: CommonSchemaAttributes & {
|
package/dist/verification.d.ts
CHANGED
|
@@ -1,8 +1,32 @@
|
|
|
1
|
-
import { NId, ProfileObject } from "./raytio";
|
|
1
|
+
import type { NId, ProfileObject, SchemaName } from "./raytio";
|
|
2
|
+
export declare enum SafeHarbourCode {
|
|
3
|
+
/** “a match has been made on each the Full Name, Address and Date of Birth” */
|
|
4
|
+
M1 = "M1",
|
|
5
|
+
/** “a match has been made on both Full Name and Date of Birth (but not Address)” */
|
|
6
|
+
M2 = "M2",
|
|
7
|
+
/** “a match has been made on both Full Name and Address (but not Date of Birth)” */
|
|
8
|
+
N1 = "N1"
|
|
9
|
+
}
|
|
2
10
|
export type VerificationPayload<WithValue extends boolean> = {
|
|
3
11
|
field: string;
|
|
4
|
-
schema?:
|
|
5
|
-
metadata?:
|
|
12
|
+
schema?: SchemaName;
|
|
13
|
+
metadata?: {
|
|
14
|
+
safeHarbourScore?: SafeHarbourCode;
|
|
15
|
+
status?: "pending";
|
|
16
|
+
pending_details?: {
|
|
17
|
+
/**
|
|
18
|
+
* for pending verifications - whether the verifier will complete fast enough that
|
|
19
|
+
* we can show a loading indicator. If not, the user has to come back another day.
|
|
20
|
+
*/
|
|
21
|
+
pending_time: "short" | "long";
|
|
22
|
+
/**
|
|
23
|
+
* for pending verifications - whether further user interaction is required to
|
|
24
|
+
* complete the verification, or if it will complete silently in the background.
|
|
25
|
+
*/
|
|
26
|
+
pending_type: "time" | "user";
|
|
27
|
+
};
|
|
28
|
+
[otherAttributes: string]: unknown;
|
|
29
|
+
};
|
|
6
30
|
passed: boolean;
|
|
7
31
|
request_div: string;
|
|
8
32
|
/** @deprecated don't use this, it looks like the schema name but it's not */
|
|
@@ -39,6 +63,14 @@ export type Verification<WithValue extends boolean = false> = ProfileObject<{
|
|
|
39
63
|
{
|
|
40
64
|
signature: string;
|
|
41
65
|
data: VerificationPayload<WithValue>;
|
|
66
|
+
/** undefined for data created before July 2023 */
|
|
67
|
+
key_id?: string;
|
|
68
|
+
/** undefined for data created before July 2023 */
|
|
69
|
+
key_urn?: string;
|
|
70
|
+
/** undefined for data created before July 2023 */
|
|
71
|
+
signing_algorithm?: "RSASSA_PSS_SHA_512";
|
|
72
|
+
/** undefined for data created before July 2023 */
|
|
73
|
+
hashing_algorithm?: "SHA512";
|
|
42
74
|
}
|
|
43
75
|
];
|
|
44
76
|
}>;
|
|
@@ -81,7 +113,7 @@ export type RealVer = {
|
|
|
81
113
|
*/
|
|
82
114
|
verified: boolean;
|
|
83
115
|
/** arbitary metadata returned by the verifier */
|
|
84
|
-
metadata?:
|
|
116
|
+
metadata?: VerificationPayload<false>["metadata"];
|
|
85
117
|
/** nId of the verification */
|
|
86
118
|
nID: NId;
|
|
87
119
|
/** nId of the PO that the verification belongs to. Could be undefined */
|
package/dist/verification.js
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.POVerification = exports.FieldVerification = void 0;
|
|
3
|
+
exports.POVerification = exports.FieldVerification = exports.SafeHarbourCode = void 0;
|
|
4
|
+
// see #659
|
|
5
|
+
var SafeHarbourCode;
|
|
6
|
+
(function (SafeHarbourCode) {
|
|
7
|
+
/** “a match has been made on each the Full Name, Address and Date of Birth” */
|
|
8
|
+
SafeHarbourCode["M1"] = "M1";
|
|
9
|
+
/** “a match has been made on both Full Name and Date of Birth (but not Address)” */
|
|
10
|
+
SafeHarbourCode["M2"] = "M2";
|
|
11
|
+
/** “a match has been made on both Full Name and Address (but not Date of Birth)” */
|
|
12
|
+
SafeHarbourCode["N1"] = "N1";
|
|
13
|
+
})(SafeHarbourCode || (exports.SafeHarbourCode = SafeHarbourCode = {}));
|
|
4
14
|
/**
|
|
5
15
|
* "Not Verified" means show no badge, cf. "Verified False" means the
|
|
6
16
|
* verifier revealed that the data was wrong. So show a ❌
|
|
@@ -13,7 +23,7 @@ var FieldVerification;
|
|
|
13
23
|
FieldVerification[FieldVerification["NotVerified"] = 60002] = "NotVerified";
|
|
14
24
|
FieldVerification[FieldVerification["VerifiedFalse"] = 60003] = "VerifiedFalse";
|
|
15
25
|
FieldVerification[FieldVerification["Expired"] = 60004] = "Expired";
|
|
16
|
-
})(FieldVerification
|
|
26
|
+
})(FieldVerification || (exports.FieldVerification = FieldVerification = {}));
|
|
17
27
|
// We cannot change the enum values, since ScoreRules have been generated
|
|
18
28
|
// with the enum values hardcoded.
|
|
19
29
|
var POVerification;
|
|
@@ -25,4 +35,4 @@ var POVerification;
|
|
|
25
35
|
POVerification[POVerification["NotVerified"] = 70005] = "NotVerified";
|
|
26
36
|
POVerification[POVerification["Expired"] = 70006] = "Expired";
|
|
27
37
|
POVerification[POVerification["Loading"] = 70007] = "Loading";
|
|
28
|
-
})(POVerification
|
|
38
|
+
})(POVerification || (exports.POVerification = POVerification = {}));
|
package/dist/wizard.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { AId } from "./raytio";
|
|
1
|
+
import type { AId, SchemaName } from "./raytio";
|
|
2
2
|
export type WizardPageTag = "action:require_chip";
|
|
3
3
|
/** configuration data for a single wizard page ({@link WizardConfig}) */
|
|
4
4
|
export type WizardPage = {
|
|
5
5
|
/** if undefined, the schema title will be used */
|
|
6
6
|
name?: string | symbol;
|
|
7
7
|
filter: "oneOf" | "anyOf";
|
|
8
|
-
schemas:
|
|
8
|
+
schemas: SchemaName[];
|
|
9
9
|
/** the fallback description, if there isn't one for the specific situation */
|
|
10
10
|
description?: string;
|
|
11
11
|
description_select?: string;
|
|
@@ -81,9 +81,9 @@ export type WizardConfig = {
|
|
|
81
81
|
/** number of days in the future */
|
|
82
82
|
expiry_date?: number;
|
|
83
83
|
/** if specified, a Wizard will be shown on the review page with this schema */
|
|
84
|
-
terms_schema?:
|
|
84
|
+
terms_schema?: SchemaName;
|
|
85
85
|
/** if specified, a Wizard will be shown on the review page with this schema */
|
|
86
|
-
signature_schema?:
|
|
86
|
+
signature_schema?: SchemaName;
|
|
87
87
|
reference?: string;
|
|
88
88
|
/**
|
|
89
89
|
* the callback url to redirect to once complete. Must be in the AA's
|
|
@@ -102,6 +102,8 @@ export type WizardConfig = {
|
|
|
102
102
|
quick_onboard?: boolean;
|
|
103
103
|
/** the loading message to show next to the spinner after the review screen */
|
|
104
104
|
sharing_data_message?: string;
|
|
105
|
+
/** If this value is true, the form will display some data sharing information before the form (WizardPreview) */
|
|
106
|
+
display_sharing_preview?: boolean;
|
|
105
107
|
/** a list of relationships that should be created after the wizard completes (see #987) */
|
|
106
108
|
relationships?: {
|
|
107
109
|
/** schema name */
|
|
@@ -113,4 +115,6 @@ export type WizardConfig = {
|
|
|
113
115
|
/** relationship properties */
|
|
114
116
|
properties?: Record<string, any>;
|
|
115
117
|
}[];
|
|
118
|
+
/** if specified, the user must validate their WebAuthN credential before they can submit the form */
|
|
119
|
+
webauthn_type?: ("usb" | "nfc" | "ble" | "internal")[];
|
|
116
120
|
};
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
package/src/orgs.ts
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/** Types Used for Organization Related API Responses */
|
|
2
|
+
/** An Organisation */
|
|
3
|
+
export type Party = {
|
|
4
|
+
id: string;
|
|
5
|
+
start_date: string;
|
|
6
|
+
end_date: string;
|
|
7
|
+
active: boolean;
|
|
8
|
+
party_name: string;
|
|
9
|
+
party_description: string;
|
|
10
|
+
party_type: string;
|
|
11
|
+
metadata: PartyMetadata;
|
|
12
|
+
party_number: number;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/** An Organizations credentials */
|
|
16
|
+
export type PartyMetadata = {
|
|
17
|
+
gandalf: unknown;
|
|
18
|
+
stripe: { customer: unknown };
|
|
19
|
+
centrix_credentials: unknown;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/** An Organization Site */
|
|
23
|
+
export type PartySite = {
|
|
24
|
+
id: string;
|
|
25
|
+
start_date: string;
|
|
26
|
+
end_date: string;
|
|
27
|
+
active: boolean;
|
|
28
|
+
party_id: string;
|
|
29
|
+
location_number: number;
|
|
30
|
+
party_site_name: string;
|
|
31
|
+
party_site_description: string | null;
|
|
32
|
+
party_site_number: string | null;
|
|
33
|
+
party_uses: string[];
|
|
34
|
+
party_use_primary: string;
|
|
35
|
+
metadata: unknown;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/** An Organization Location */
|
|
39
|
+
export type Location = {
|
|
40
|
+
id: string;
|
|
41
|
+
start_date: string;
|
|
42
|
+
end_date: string;
|
|
43
|
+
active: boolean;
|
|
44
|
+
location_name: string;
|
|
45
|
+
location_description: string | null;
|
|
46
|
+
address_line_1: string | null;
|
|
47
|
+
address_line_2: string | null;
|
|
48
|
+
address_line_3: string | null;
|
|
49
|
+
address_line_4: string | null;
|
|
50
|
+
premise: string | null;
|
|
51
|
+
subpremise: string | null;
|
|
52
|
+
street_number: string | null;
|
|
53
|
+
administrative_area_level_1: string | null;
|
|
54
|
+
administrative_area_level_2: string | null;
|
|
55
|
+
administrative_area_level_3: string | null;
|
|
56
|
+
route: string | null;
|
|
57
|
+
locality: string | null;
|
|
58
|
+
postal_code: string;
|
|
59
|
+
postal_code_suffix: string | null;
|
|
60
|
+
city: string | null;
|
|
61
|
+
region: string | null;
|
|
62
|
+
country: string | null;
|
|
63
|
+
geolocation: string | null;
|
|
64
|
+
geolocation_outline: string | null;
|
|
65
|
+
metadata: unknown;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/** A Contact Point for an Organization */
|
|
69
|
+
export type ContactPoint = {
|
|
70
|
+
id: string;
|
|
71
|
+
start_date: string;
|
|
72
|
+
end_date: string;
|
|
73
|
+
active: boolean;
|
|
74
|
+
to_table: string;
|
|
75
|
+
uuid: string | undefined;
|
|
76
|
+
contact_point_purpose: string;
|
|
77
|
+
contact_point_type: string;
|
|
78
|
+
e164: string | null;
|
|
79
|
+
e164_suffix: string | null;
|
|
80
|
+
e164_type: string | null;
|
|
81
|
+
url: string | null;
|
|
82
|
+
url_type: string | null;
|
|
83
|
+
email_address: string;
|
|
84
|
+
email_address_preferred_format: string;
|
|
85
|
+
metadata: unknown;
|
|
86
|
+
};
|