@raytio/types 7.3.0 → 8.0.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 +350 -87
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/merchant.d.ts +20 -0
- package/dist/merchant.js +2 -0
- package/dist/orgs.d.ts +85 -31
- package/dist/raytio.d.ts +61 -27
- package/dist/schema.d.ts +45 -3
- package/dist/subscription.d.ts +89 -0
- package/dist/subscription.js +2 -0
- package/dist/verification.d.ts +40 -2
- package/package.json +2 -2
- package/src/index.ts +2 -0
- package/src/merchant.ts +22 -0
- package/src/orgs.ts +103 -31
- package/src/raytio.ts +64 -26
- package/src/schema.ts +51 -2
- package/src/subscription.ts +106 -0
- package/src/verification.ts +51 -2
package/src/orgs.ts
CHANGED
|
@@ -1,15 +1,86 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
CId,
|
|
3
|
+
CommonFields,
|
|
4
|
+
LOCId,
|
|
5
|
+
Lookup,
|
|
6
|
+
OId,
|
|
7
|
+
PCId,
|
|
8
|
+
PRid,
|
|
9
|
+
PermissionType,
|
|
10
|
+
UId,
|
|
11
|
+
} from "./raytio";
|
|
12
|
+
|
|
1
13
|
/** Types Used for Organization Related API Responses */
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* An organization.
|
|
17
|
+
* NOTE: this is different to how the schema defines an Organization. **The schema is wrong (see #468)**
|
|
18
|
+
*/
|
|
19
|
+
export type Organization = {
|
|
20
|
+
id: CId;
|
|
21
|
+
orgId: OId;
|
|
22
|
+
name: string;
|
|
23
|
+
// just using email_address for now until ss_Billing_Organization gets updated to support the additional fields
|
|
24
|
+
contact_point?: Pick<ContactPoint, "email_address" | "id">;
|
|
25
|
+
address?: unknown; // Waiting on Backend Progress Before being properly updated (as of #1361)
|
|
26
|
+
customerUsers: CustomerUser[];
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** @internal some APIs now return extra info. this is what gets passed around in the client. */
|
|
30
|
+
export type FullOrg = {
|
|
31
|
+
id: CId;
|
|
32
|
+
organization: Omit<Organization, "id">;
|
|
33
|
+
/** 🧙♂️ */
|
|
34
|
+
gandalf?: unknown;
|
|
35
|
+
stripe?: { customer: unknown };
|
|
36
|
+
centrix_credentials?: unknown;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/** An organization/customer, directly returned by the API */
|
|
40
|
+
export type Customer = CommonFields<CId> & {
|
|
41
|
+
customer_code: string;
|
|
42
|
+
party_id: PRid;
|
|
43
|
+
party_description: OId; // this is the old org_id but it's not a UUID so it's stored here (see #1361)
|
|
44
|
+
permission_type: PermissionType | null; // Once we start caring about Permissions (Sometime after #1390) this should be in a similar format to "ADMINS" | "OWNS" etc
|
|
45
|
+
user_id: UId | null;
|
|
46
|
+
owner_email: string;
|
|
47
|
+
user_email: string;
|
|
48
|
+
prm_parties?: Party;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/** Organization Customer / User, Returned directly by the API */
|
|
52
|
+
export type CustomerUser = CommonFields<CId> & {
|
|
53
|
+
customer_code: string;
|
|
54
|
+
party_id: PRid;
|
|
8
55
|
party_name: string;
|
|
9
|
-
party_description:
|
|
56
|
+
party_description: OId;
|
|
57
|
+
owner_id: UId;
|
|
58
|
+
owner_email: string;
|
|
59
|
+
permission_type: PermissionType | null;
|
|
60
|
+
user_id: UId | null;
|
|
61
|
+
user_email: string | null;
|
|
62
|
+
group_name: string | null;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export type Party = CommonFields<PRid, PartyMetadata> & {
|
|
66
|
+
party_name: string;
|
|
67
|
+
party_description: OId;
|
|
10
68
|
party_type: string;
|
|
11
|
-
|
|
12
|
-
|
|
69
|
+
party_image_url_logo: string | null;
|
|
70
|
+
far_customers: CommonFields<CId> &
|
|
71
|
+
{
|
|
72
|
+
freight_term_code: string;
|
|
73
|
+
customer_type_code: string;
|
|
74
|
+
customer_class_code: string;
|
|
75
|
+
customer_status_code: string;
|
|
76
|
+
price_list_version_id: string | null;
|
|
77
|
+
customer_approval_status_code: string;
|
|
78
|
+
far_customers_customer_type_lookup: Lookup;
|
|
79
|
+
far_customers_freight_terms_lookup: Lookup;
|
|
80
|
+
far_customers_customer_class_lookup: Lookup;
|
|
81
|
+
far_customers_customer_status_lookup: Lookup;
|
|
82
|
+
far_customers_customer_approval_status_lookup: Lookup;
|
|
83
|
+
}[];
|
|
13
84
|
};
|
|
14
85
|
|
|
15
86
|
/** An Organizations credentials */
|
|
@@ -20,27 +91,34 @@ export type PartyMetadata = {
|
|
|
20
91
|
};
|
|
21
92
|
|
|
22
93
|
/** An Organization Site */
|
|
23
|
-
export type PartySite = {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
end_date: string;
|
|
27
|
-
active: boolean;
|
|
28
|
-
party_id: string;
|
|
29
|
-
location_number: number;
|
|
94
|
+
export type PartySite = CommonFields<never> & {
|
|
95
|
+
party_id: PRid;
|
|
96
|
+
location_id: number;
|
|
30
97
|
party_site_name: string;
|
|
31
98
|
party_site_description: string | null;
|
|
32
|
-
party_site_number: string | null;
|
|
33
99
|
party_uses: string[];
|
|
34
100
|
party_use_primary: string;
|
|
35
|
-
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export type CustomerSite = CommonFields<never> & {
|
|
104
|
+
org_id: OId;
|
|
105
|
+
party_site_id: string;
|
|
106
|
+
customer_site_code: string;
|
|
107
|
+
customer_site_status_code: string;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
export type CustomerSiteUse = CommonFields<never> & {
|
|
111
|
+
org_id: OId;
|
|
112
|
+
customer_site_id: string;
|
|
113
|
+
customer_site_use_purpose_code: string;
|
|
114
|
+
customer_site_use_name: string;
|
|
115
|
+
freight_term_code: string | null;
|
|
116
|
+
payment_term_id: string;
|
|
117
|
+
price_list_version_id: string | null;
|
|
36
118
|
};
|
|
37
119
|
|
|
38
120
|
/** An Organization Location */
|
|
39
|
-
export type Location = {
|
|
40
|
-
id: string;
|
|
41
|
-
start_date: string;
|
|
42
|
-
end_date: string;
|
|
43
|
-
active: boolean;
|
|
121
|
+
export type Location = CommonFields<LOCId> & {
|
|
44
122
|
location_name: string;
|
|
45
123
|
location_description: string | null;
|
|
46
124
|
address_line_1: string | null;
|
|
@@ -62,16 +140,11 @@ export type Location = {
|
|
|
62
140
|
country: string | null;
|
|
63
141
|
geolocation: string | null;
|
|
64
142
|
geolocation_outline: string | null;
|
|
65
|
-
metadata: unknown;
|
|
66
143
|
};
|
|
67
144
|
|
|
68
145
|
/** A Contact Point for an Organization */
|
|
69
|
-
export type ContactPoint = {
|
|
70
|
-
|
|
71
|
-
start_date: string;
|
|
72
|
-
end_date: string;
|
|
73
|
-
active: boolean;
|
|
74
|
-
to_table: string;
|
|
146
|
+
export type ContactPoint = CommonFields<PCId> & {
|
|
147
|
+
party_id: PRid;
|
|
75
148
|
uuid: string | undefined;
|
|
76
149
|
contact_point_purpose: string;
|
|
77
150
|
contact_point_type: string;
|
|
@@ -82,5 +155,4 @@ export type ContactPoint = {
|
|
|
82
155
|
url_type: string | null;
|
|
83
156
|
email_address: string;
|
|
84
157
|
email_address_preferred_format: string;
|
|
85
|
-
metadata: unknown;
|
|
86
158
|
};
|
package/src/raytio.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { Colors, CustomFonts } from "./theme";
|
|
|
5
5
|
export type StringWithIdentity<T> = string & { $$typeof$$: T };
|
|
6
6
|
|
|
7
7
|
/** @internal */
|
|
8
|
-
type Json = Record<string, any>; // TODO: (semver breaking) unknown
|
|
8
|
+
export type Json = Record<string, any>; // TODO: (semver breaking) unknown
|
|
9
9
|
|
|
10
10
|
/** A `p_id` is the ID of a {@link Relationship} */
|
|
11
11
|
export type PId = StringWithIdentity<"PId">;
|
|
@@ -21,16 +21,52 @@ export type GId = StringWithIdentity<"GId">;
|
|
|
21
21
|
export type UId = StringWithIdentity<"UId">;
|
|
22
22
|
/** An `a_id` is the ID of an {@link AA} */
|
|
23
23
|
export type AId = StringWithIdentity<"AId">;
|
|
24
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* An `o_id` is the ID of an {@link Organization}
|
|
26
|
+
*
|
|
27
|
+
* NOTE: Will be deprecated soon. Use CId instead.
|
|
28
|
+
* */
|
|
25
29
|
export type OId = StringWithIdentity<"OId">;
|
|
30
|
+
/** A `pr_id` is the ID of a {@link Party} */
|
|
31
|
+
export type PRid = StringWithIdentity<"PRid">;
|
|
32
|
+
/** A `pc_id` is the ID of a Party Contact Point */
|
|
33
|
+
export type PCId = StringWithIdentity<"PCId">;
|
|
26
34
|
/** A `wi_id` is the ID of a {@link Webhook} */
|
|
27
35
|
export type WId = StringWithIdentity<"WId">;
|
|
28
36
|
/** An `l_id` is the ID of any data stored in the KV-Store */ // e.g. StoredWizardConfig and VerBundleMetadata
|
|
29
37
|
export type LId = StringWithIdentity<"LId">;
|
|
30
38
|
/** A `k_id` (also called a `aack_id` or a `publicKeyId`) is the ID of an AA's public key */
|
|
31
39
|
export type KId = StringWithIdentity<"KId">;
|
|
40
|
+
/** A `pk_id` is the ID of an AA's private key */
|
|
41
|
+
export type PKId = StringWithIdentity<"PKId">;
|
|
42
|
+
/** A `c_id` is the ID of a {@link Customer}, (will eventually replace org_id) */
|
|
43
|
+
export type CId = StringWithIdentity<"CId">;
|
|
44
|
+
/** A `t_id` is the ID of a transaction */
|
|
45
|
+
export type TId = StringWithIdentity<"TId">;
|
|
46
|
+
/** A `ws_id` is the ID of a transition */
|
|
47
|
+
export type WSId = StringWithIdentity<"WSId">;
|
|
32
48
|
/** A `SchemaName` is the ID of a {@link Schema} */
|
|
33
49
|
export type SchemaName = StringWithIdentity<"SchemaName">;
|
|
50
|
+
/** A `loc_id` is the ID of a location */
|
|
51
|
+
export type LOCId = StringWithIdentity<"LOCId">;
|
|
52
|
+
/** A `pl_id` is the ID of a PriceList */
|
|
53
|
+
export type PLId = StringWithIdentity<"PLId">;
|
|
54
|
+
/** A `prc_id` is the ID of a Price */
|
|
55
|
+
export type PRCId = StringWithIdentity<"PRCId">;
|
|
56
|
+
/** A `pll_id` is the ID of a PriceListLine/Plan */
|
|
57
|
+
export type PLLId = StringWithIdentity<"PLLId">;
|
|
58
|
+
/** A `s_id` is the ID of a Subscription */
|
|
59
|
+
export type SId = StringWithIdentity<"SId">;
|
|
60
|
+
/** A `sl_id` is the ID of a SubscriptionLine */
|
|
61
|
+
export type SLId = StringWithIdentity<"SLId">;
|
|
62
|
+
/** A `pm_id` is the ID of a PaymentMethod */
|
|
63
|
+
export type PMId = StringWithIdentity<"PMId">;
|
|
64
|
+
/** A `pt_id` is the ID of a PaymentProcessor */
|
|
65
|
+
export type PTId = StringWithIdentity<"PTId">;
|
|
66
|
+
/** A `m_id` is the ID of a Merchant */
|
|
67
|
+
export type MId = StringWithIdentity<"MId">;
|
|
68
|
+
/** A `gpm_id` is the ID of a Verification Type */
|
|
69
|
+
export type GPMId = StringWithIdentity<"GPMId">;
|
|
34
70
|
|
|
35
71
|
export type DataTypes =
|
|
36
72
|
| "string"
|
|
@@ -74,8 +110,15 @@ export type CommonFields<
|
|
|
74
110
|
end_date: string;
|
|
75
111
|
active: boolean;
|
|
76
112
|
metadata: Metadata | undefined;
|
|
113
|
+
row_version?: number;
|
|
114
|
+
resource_group?: string;
|
|
115
|
+
resource_name?: string;
|
|
116
|
+
resource_url?: string;
|
|
117
|
+
tenant_id?: string;
|
|
77
118
|
};
|
|
78
119
|
|
|
120
|
+
export type PermissionType = "ADMINS" | "VIEWS" | "EDITS" | "OWNS";
|
|
121
|
+
|
|
79
122
|
/** You can supply an option type argument if you know exactly what the properties will be */
|
|
80
123
|
export type ProfileObject<Properties = Json> = Partial<CommonFields<NId2>> & {
|
|
81
124
|
n_id: NId;
|
|
@@ -122,6 +165,8 @@ export type Urn =
|
|
|
122
165
|
| `urn:schema:${SchemaName}`
|
|
123
166
|
| `urn:document:${NId}`;
|
|
124
167
|
|
|
168
|
+
export type ContentUrl = `url:${string}`;
|
|
169
|
+
|
|
125
170
|
export type Relationship = {
|
|
126
171
|
start: Urn;
|
|
127
172
|
end: Urn;
|
|
@@ -178,7 +223,8 @@ export type AA = {
|
|
|
178
223
|
/** the n_id of the associated service provider */
|
|
179
224
|
service_provider_n_id?: NId;
|
|
180
225
|
/** the id of the associated organization */
|
|
181
|
-
org_id
|
|
226
|
+
org_id?: OId;
|
|
227
|
+
customer_id: CId;
|
|
182
228
|
|
|
183
229
|
/** configuration for the submission rules */
|
|
184
230
|
// we know the type should be `ScoreConfig`, but we can't rely that it's valid, or the right version
|
|
@@ -196,7 +242,7 @@ export type AA = {
|
|
|
196
242
|
metadata?: unknown;
|
|
197
243
|
secret?: unknown;
|
|
198
244
|
|
|
199
|
-
/** @internal */
|
|
245
|
+
/** @internal fetched separately (see #1511) */
|
|
200
246
|
transitions?: unknown[];
|
|
201
247
|
};
|
|
202
248
|
|
|
@@ -258,28 +304,6 @@ export type Instance = InstanceWithoutData & {
|
|
|
258
304
|
relationships: Relationship[];
|
|
259
305
|
};
|
|
260
306
|
|
|
261
|
-
/**
|
|
262
|
-
* An organization.
|
|
263
|
-
* NOTE: this is different to how the schema defines an Organization. **The schema is wrong (see #468)**
|
|
264
|
-
*/
|
|
265
|
-
export type Organization = {
|
|
266
|
-
id: OId;
|
|
267
|
-
name: string;
|
|
268
|
-
email: string;
|
|
269
|
-
address: unknown; // Waiting on Backend Progress Before being properly updated (as of #1361)
|
|
270
|
-
customer: unknown; // Waiting on Backend Progress Before being properly updated (as of #1361) (was previously Record<string, unknown>)
|
|
271
|
-
};
|
|
272
|
-
|
|
273
|
-
/** @internal some APIs now return extra info */
|
|
274
|
-
export type FullOrg = {
|
|
275
|
-
id: OId;
|
|
276
|
-
organization: Omit<Organization, "id">;
|
|
277
|
-
/** 🧙♂️ */
|
|
278
|
-
gandalf: unknown;
|
|
279
|
-
stripe: { customer: unknown };
|
|
280
|
-
centrix_credentials: unknown;
|
|
281
|
-
};
|
|
282
|
-
|
|
283
307
|
/** validation data returned by preVerify (part of the extract&map API) */
|
|
284
308
|
export type Validation = {
|
|
285
309
|
score: number;
|
|
@@ -333,3 +357,17 @@ export type Webhook = {
|
|
|
333
357
|
response_payload: Json;
|
|
334
358
|
}[];
|
|
335
359
|
};
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* Link used for an Access Application, including all additional information
|
|
363
|
+
*/
|
|
364
|
+
export type Link = {
|
|
365
|
+
id: NId;
|
|
366
|
+
a_id: AId;
|
|
367
|
+
name: string;
|
|
368
|
+
subtitle: string;
|
|
369
|
+
code: LId;
|
|
370
|
+
url: string;
|
|
371
|
+
details?: AA;
|
|
372
|
+
isDefault?: boolean;
|
|
373
|
+
};
|
package/src/schema.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { AA, DataTypes,
|
|
1
|
+
import type { AA, DataTypes, SchemaName, Urn } from "./raytio";
|
|
2
|
+
import type { Organization } from "./orgs";
|
|
2
3
|
import type { WizardConfig } from "./wizard";
|
|
3
4
|
|
|
4
5
|
/** should be renamed since this applies to ConditionallyVerifiable */
|
|
@@ -24,7 +25,8 @@ export type SchemaFieldTag =
|
|
|
24
25
|
| "display:survey"
|
|
25
26
|
| "display:quoting"
|
|
26
27
|
| "display:customModal"
|
|
27
|
-
|
|
|
28
|
+
| "display:mask"
|
|
29
|
+
| `display:replace:('${string}', '${string}')`
|
|
28
30
|
| "display:terms_conditions"
|
|
29
31
|
| `display:main_media:${string}` // property name to determine what image to display
|
|
30
32
|
// date picker components
|
|
@@ -32,8 +34,13 @@ export type SchemaFieldTag =
|
|
|
32
34
|
| "date_component:month"
|
|
33
35
|
| "date_component:year"
|
|
34
36
|
// other
|
|
37
|
+
| "action:allow_copy" // adds clipboard to input field
|
|
38
|
+
| "action:allow_unreplace" // adds reveal button for passwords
|
|
39
|
+
| "action:allow_password_compromise_check" // adds check if password is breached
|
|
35
40
|
| "action:client_upload"
|
|
41
|
+
| "action:hash" // creates hash containing specified information
|
|
36
42
|
| "action:require_webauthn"
|
|
43
|
+
| `action:generate_pepper:` // generates a pepper length 'n'
|
|
37
44
|
| "verify:show_if_pending"
|
|
38
45
|
| "special:hide_select_behind_button"
|
|
39
46
|
| "type:capture_geolocation" // triggers the wizard's GeoLocationInput field
|
|
@@ -43,6 +50,7 @@ export type SchemaTag =
|
|
|
43
50
|
// action
|
|
44
51
|
| "action:experimental_pass_object_store_id"
|
|
45
52
|
| "action:verify"
|
|
53
|
+
| `action:display_qr_code:${/* either extract or verify */ string}:${/* when to display QR */ string}`
|
|
46
54
|
// camera
|
|
47
55
|
| "default_camera:rear"
|
|
48
56
|
| "default_camera:front"
|
|
@@ -52,6 +60,7 @@ export type SchemaTag =
|
|
|
52
60
|
// misc
|
|
53
61
|
| `time:${/* type */ string}:${/* seconds */ number}`
|
|
54
62
|
| `link_to:${/* schemaName */ string}:${/* relationshipType */ string}`
|
|
63
|
+
| "display:default_view:edit" // links profile POcard direct to edit menu
|
|
55
64
|
// type
|
|
56
65
|
| "type:service_provider"
|
|
57
66
|
| "type:service_offer"
|
|
@@ -91,6 +100,21 @@ export type SchemaField = {
|
|
|
91
100
|
format?: "date" | "date-time" | "uri";
|
|
92
101
|
contentMediaType?: string;
|
|
93
102
|
contentEncoding?: "base64";
|
|
103
|
+
/**
|
|
104
|
+
* if this field is a foreign key, i.e. it is a primary key
|
|
105
|
+
* of a different schema, then that other's schema name should be listed here.
|
|
106
|
+
* e.g.
|
|
107
|
+
* ```json
|
|
108
|
+
* {
|
|
109
|
+
* "name": "ss_AA",
|
|
110
|
+
* "properties": {
|
|
111
|
+
* "org_id": { "foreign_key_of": "ss_Org" }
|
|
112
|
+
* }
|
|
113
|
+
* }
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
foreign_key_of?: SchemaName;
|
|
117
|
+
|
|
94
118
|
/** `items` is used for nested arrays, (while `properties` is used for nested objects) */
|
|
95
119
|
items?: {
|
|
96
120
|
type: DataTypes;
|
|
@@ -131,6 +155,10 @@ export type SchemaField = {
|
|
|
131
155
|
description_decorator?: "md";
|
|
132
156
|
/** if a `pattern` is specified, this is the error message */
|
|
133
157
|
patternMessage?: string;
|
|
158
|
+
/** the input string for a platform_unique_id */
|
|
159
|
+
hash_inputs?: string;
|
|
160
|
+
/** determines where an image is sourced from */
|
|
161
|
+
content_source?: string;
|
|
134
162
|
|
|
135
163
|
override?: {
|
|
136
164
|
permissions: {
|
|
@@ -253,6 +281,19 @@ export type CommonSchemaAttributes = {
|
|
|
253
281
|
* Array because there could be multiple expand groups
|
|
254
282
|
*/
|
|
255
283
|
expand?: { fields: string[]; label: string }[];
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* By default, the admin dashboard shows columns for all fields
|
|
287
|
+
* in listed in `head_main`. In rare cases you can use this property
|
|
288
|
+
* to specify a different set of fields to show to admins by default.
|
|
289
|
+
*/
|
|
290
|
+
tabular?: { fields: string[] };
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* determines if profile pages should display using compacted 'MiniPO'
|
|
294
|
+
* view or deafult view
|
|
295
|
+
*/
|
|
296
|
+
compact_table?: boolean;
|
|
256
297
|
};
|
|
257
298
|
|
|
258
299
|
/** only the schema used for the onboarding wizard have this property */
|
|
@@ -327,6 +368,14 @@ export type Schema = CommonSchemaAttributes & {
|
|
|
327
368
|
[fieldName: string]: SchemaField;
|
|
328
369
|
};
|
|
329
370
|
|
|
371
|
+
/**
|
|
372
|
+
* Some schema's represent data that is not stored as a profile object.
|
|
373
|
+
* In this case, this attribute defines what database table we need to use
|
|
374
|
+
* to fetch the corresponding data, and which field is the primary_key of that
|
|
375
|
+
* table (e.g. `id`, `o_id` etc.)
|
|
376
|
+
*/
|
|
377
|
+
database?: { table: string; primary_key: string };
|
|
378
|
+
|
|
330
379
|
/** the client adds this after processing the i18n property */
|
|
331
380
|
groupNames?: Record<string, string>;
|
|
332
381
|
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
CId,
|
|
3
|
+
CommonFields,
|
|
4
|
+
PLId,
|
|
5
|
+
PLLId,
|
|
6
|
+
PMId,
|
|
7
|
+
PRCId,
|
|
8
|
+
PRid,
|
|
9
|
+
PTId,
|
|
10
|
+
SId,
|
|
11
|
+
SLId,
|
|
12
|
+
} from "./raytio";
|
|
13
|
+
|
|
14
|
+
export type PriceList = {
|
|
15
|
+
id: PLId;
|
|
16
|
+
price_list_type: string;
|
|
17
|
+
price_list_currency: string;
|
|
18
|
+
price_list_name: string;
|
|
19
|
+
price_list_name_i18n?: string;
|
|
20
|
+
price_list_description?: string;
|
|
21
|
+
price_list_description_i18n?: string;
|
|
22
|
+
pcm_price_list_versions?: [
|
|
23
|
+
{
|
|
24
|
+
id: string;
|
|
25
|
+
price_list_version_name: string;
|
|
26
|
+
pcm_price_list_lines: PriceListLine[];
|
|
27
|
+
},
|
|
28
|
+
];
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export type PriceListLine = {
|
|
32
|
+
id: PLLId;
|
|
33
|
+
pcm_prices: {
|
|
34
|
+
id: PRCId;
|
|
35
|
+
amount: number;
|
|
36
|
+
gpm_items: {
|
|
37
|
+
id: string; // not sure what this is
|
|
38
|
+
item_key: string;
|
|
39
|
+
item_name: string;
|
|
40
|
+
primary_uom: string;
|
|
41
|
+
item_name_i18n: string | null;
|
|
42
|
+
item_description: string;
|
|
43
|
+
item_description_i18n: string | null;
|
|
44
|
+
};
|
|
45
|
+
price_currency: string;
|
|
46
|
+
billing_recurrence: string;
|
|
47
|
+
recurring_billing_scheme: string;
|
|
48
|
+
recurring_billing_interval: string | null; // null if `billing_recurrence` is set to "ONCE"
|
|
49
|
+
recurring_billing_usage_type: string;
|
|
50
|
+
recurring_billing_interval_count: number;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export type Subscription = CommonFields<SId> & {
|
|
55
|
+
subscribed_to_customer_id: string;
|
|
56
|
+
subscribed_to_customer_site_id: string | null;
|
|
57
|
+
subscribed_to_party_contact_point_id: string;
|
|
58
|
+
billing_cycle_month: number | null;
|
|
59
|
+
billing_cycle_day_of_month: number | null;
|
|
60
|
+
billing_cycle_day_of_week: number | null;
|
|
61
|
+
billing_cycle_hour: number | null;
|
|
62
|
+
billing_cycle_minute: number | null;
|
|
63
|
+
billing_cycle_second: number | null;
|
|
64
|
+
subscription_name: string;
|
|
65
|
+
subscription_name_i18n: string | null;
|
|
66
|
+
current_billing_period_start: string;
|
|
67
|
+
current_billing_period_end: string | null;
|
|
68
|
+
cancellation_request_date: string | null;
|
|
69
|
+
cancellation_effective_date: string | null;
|
|
70
|
+
cancellation_request_reason: string | null;
|
|
71
|
+
cancellation_final_invoice_action: string;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export type SubscriptionLine = CommonFields<SLId> & {
|
|
75
|
+
billing_subscription_id: SId;
|
|
76
|
+
price_id: PRCId;
|
|
77
|
+
subscribed_qty: number;
|
|
78
|
+
metadata: string | null;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export type PaymentMethod = CommonFields<PMId> & {
|
|
82
|
+
customer_id: CId;
|
|
83
|
+
payer_payment_method_type: string;
|
|
84
|
+
primary_payment_method: boolean;
|
|
85
|
+
payment_processor_id: string;
|
|
86
|
+
payment_method_country_code: string | null;
|
|
87
|
+
payment_method_scheme: string;
|
|
88
|
+
payment_method_available_networks: string[] | string;
|
|
89
|
+
payment_method_preferred_network?: string | null;
|
|
90
|
+
card_expiry_month: number;
|
|
91
|
+
card_expiry_year: number;
|
|
92
|
+
card_funding_method: string;
|
|
93
|
+
card_last_4_digits: string;
|
|
94
|
+
card_fingerprint?: string | null;
|
|
95
|
+
payment_processor_payment_method_id: string;
|
|
96
|
+
address_line1_check?: string | null;
|
|
97
|
+
address_postal_code_check?: string | null;
|
|
98
|
+
cvc_check?: string | null;
|
|
99
|
+
three_d_secure_usage?: string | null;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export type PaymentProcessor = CommonFields<PTId> & {
|
|
103
|
+
party_id: PRid;
|
|
104
|
+
payment_processor_name: string;
|
|
105
|
+
payment_processor_system: string;
|
|
106
|
+
};
|
package/src/verification.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
CommonFields,
|
|
3
|
+
GPMId,
|
|
4
|
+
Json,
|
|
5
|
+
NId,
|
|
6
|
+
ProfileObject,
|
|
7
|
+
SchemaName,
|
|
8
|
+
} from "./raytio";
|
|
2
9
|
|
|
3
10
|
// see #659
|
|
4
11
|
export enum SafeHarbourCode {
|
|
@@ -16,7 +23,11 @@ export type VerificationPayload<WithValue extends boolean> = {
|
|
|
16
23
|
schema?: SchemaName;
|
|
17
24
|
metadata?: {
|
|
18
25
|
safeHarbourScore?: SafeHarbourCode;
|
|
19
|
-
status?: "pending";
|
|
26
|
+
status?: "pending" | "approved";
|
|
27
|
+
validation?: {
|
|
28
|
+
id: string;
|
|
29
|
+
url: string;
|
|
30
|
+
};
|
|
20
31
|
pending_details?: {
|
|
21
32
|
/**
|
|
22
33
|
* for pending verifications - whether the verifier will complete fast enough that
|
|
@@ -42,6 +53,7 @@ export type VerificationPayload<WithValue extends boolean> = {
|
|
|
42
53
|
source_hashed_n_id?: NId;
|
|
43
54
|
type?: null;
|
|
44
55
|
v_id: string;
|
|
56
|
+
verification_type_id: GPMId;
|
|
45
57
|
verification_date: string;
|
|
46
58
|
verifier_id?: NId;
|
|
47
59
|
verifier_source_id?: NId;
|
|
@@ -115,6 +127,7 @@ export type VerificationProvider = {
|
|
|
115
127
|
verifierNId?: NId;
|
|
116
128
|
dataSourceNId?: NId;
|
|
117
129
|
serviceProviderNId?: NId;
|
|
130
|
+
verificationTypeId?: GPMId;
|
|
118
131
|
/** the date which the verification was verified on, or last re-verified on */
|
|
119
132
|
date?: Date;
|
|
120
133
|
};
|
|
@@ -141,3 +154,39 @@ export type RealVer = {
|
|
|
141
154
|
/** If the verification has expired, it's the date that it expired on. Otherwise it's `false` */
|
|
142
155
|
expired: Date | false;
|
|
143
156
|
};
|
|
157
|
+
|
|
158
|
+
export type VerificationType = CommonFields<GPMId> & {
|
|
159
|
+
item_number: number;
|
|
160
|
+
org_number: number;
|
|
161
|
+
item_key: string;
|
|
162
|
+
item_key_01: string | null;
|
|
163
|
+
item_key_02: string | null;
|
|
164
|
+
item_key_03: string | null;
|
|
165
|
+
item_type: string | null;
|
|
166
|
+
item_name: string;
|
|
167
|
+
item_name_i18n: Json | null;
|
|
168
|
+
item_description: string;
|
|
169
|
+
item_description_i18n: Json | null;
|
|
170
|
+
|
|
171
|
+
primary_uom: string;
|
|
172
|
+
secondary_uom: string | null;
|
|
173
|
+
item_mass: number | null;
|
|
174
|
+
item_mass_uom: string | null;
|
|
175
|
+
item_volume: number | null;
|
|
176
|
+
item_volume_uom: string | null;
|
|
177
|
+
item_dimension_length: number | null;
|
|
178
|
+
item_dimension_width: number | null;
|
|
179
|
+
item_dimension_height: number | null;
|
|
180
|
+
item_dimension_uom: string | null;
|
|
181
|
+
|
|
182
|
+
purchased: boolean | null;
|
|
183
|
+
shipped: boolean | null;
|
|
184
|
+
stocked: boolean | null;
|
|
185
|
+
transacted: boolean | null;
|
|
186
|
+
asset: boolean | null;
|
|
187
|
+
returnable: boolean | null;
|
|
188
|
+
|
|
189
|
+
inventory_organization_number: number | null;
|
|
190
|
+
source_type: string | null;
|
|
191
|
+
source_organization_number: number | null;
|
|
192
|
+
};
|