@raytio/types 7.2.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 +439 -141
- 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 +115 -59
- package/dist/schema.d.ts +52 -10
- package/dist/subscription.d.ts +89 -0
- package/dist/subscription.js +2 -0
- package/dist/verification.d.ts +41 -3
- package/dist/wizard.d.ts +4 -4
- package/package.json +2 -2
- package/src/__tests__/raytio.typetest.ts +1 -1
- package/src/__tests__/schema.typetest.ts +1 -1
- package/src/index.ts +2 -0
- package/src/merchant.ts +22 -0
- package/src/orgs.ts +103 -31
- package/src/raytio.ts +122 -60
- package/src/schema.ts +58 -9
- package/src/subscription.ts +106 -0
- package/src/verification.ts +52 -3
- package/src/wizard.ts +4 -4
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -21,3 +21,5 @@ __exportStar(require("./theme"), exports);
|
|
|
21
21
|
__exportStar(require("./verification"), exports);
|
|
22
22
|
__exportStar(require("./wizard"), exports);
|
|
23
23
|
__exportStar(require("./orgs"), exports);
|
|
24
|
+
__exportStar(require("./subscription"), exports);
|
|
25
|
+
__exportStar(require("./merchant"), exports);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CommonFields, Json, MId, PRid } from "./raytio";
|
|
2
|
+
export type MerchantTypeCode = "TYPE_1" | "TYPE_2";
|
|
3
|
+
export type MerchantClassCode = "CLASS_1" | "CLASS_2";
|
|
4
|
+
export type MerchantStatusCode = "ACTIVE" | "INACTIVE";
|
|
5
|
+
export type MerchantApprovalStatusCode = "PENDING" | "APPROVED";
|
|
6
|
+
export type Merchant = CommonFields<MId> & {
|
|
7
|
+
party_id: PRid;
|
|
8
|
+
merchant_name: string | null;
|
|
9
|
+
merchant_name_i18n: Json | null;
|
|
10
|
+
merchant_common_name: string | null;
|
|
11
|
+
merchant_common_name_i18n: Json | null;
|
|
12
|
+
merchant_description: string | null;
|
|
13
|
+
merchant_description_i18n: Json | null;
|
|
14
|
+
merchant_image_url_logo: string | null;
|
|
15
|
+
merchant_image_url_thumbnail: string | null;
|
|
16
|
+
merchant_type_code: MerchantTypeCode | null;
|
|
17
|
+
merchant_class_code: MerchantClassCode | null;
|
|
18
|
+
merchant_status_code: MerchantStatusCode | null;
|
|
19
|
+
merchant_approval_status_code: MerchantApprovalStatusCode | null;
|
|
20
|
+
};
|
package/dist/merchant.js
ADDED
package/dist/orgs.d.ts
CHANGED
|
@@ -1,15 +1,70 @@
|
|
|
1
|
+
import type { CId, CommonFields, LOCId, Lookup, OId, PCId, PRid, PermissionType, UId } from "./raytio";
|
|
1
2
|
/** Types Used for Organization Related API Responses */
|
|
2
|
-
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
/**
|
|
4
|
+
* An organization.
|
|
5
|
+
* NOTE: this is different to how the schema defines an Organization. **The schema is wrong (see #468)**
|
|
6
|
+
*/
|
|
7
|
+
export type Organization = {
|
|
8
|
+
id: CId;
|
|
9
|
+
orgId: OId;
|
|
10
|
+
name: string;
|
|
11
|
+
contact_point?: Pick<ContactPoint, "email_address" | "id">;
|
|
12
|
+
address?: unknown;
|
|
13
|
+
customerUsers: CustomerUser[];
|
|
14
|
+
};
|
|
15
|
+
/** @internal some APIs now return extra info. this is what gets passed around in the client. */
|
|
16
|
+
export type FullOrg = {
|
|
17
|
+
id: CId;
|
|
18
|
+
organization: Omit<Organization, "id">;
|
|
19
|
+
/** 🧙♂️ */
|
|
20
|
+
gandalf?: unknown;
|
|
21
|
+
stripe?: {
|
|
22
|
+
customer: unknown;
|
|
23
|
+
};
|
|
24
|
+
centrix_credentials?: unknown;
|
|
25
|
+
};
|
|
26
|
+
/** An organization/customer, directly returned by the API */
|
|
27
|
+
export type Customer = CommonFields<CId> & {
|
|
28
|
+
customer_code: string;
|
|
29
|
+
party_id: PRid;
|
|
30
|
+
party_description: OId;
|
|
31
|
+
permission_type: PermissionType | null;
|
|
32
|
+
user_id: UId | null;
|
|
33
|
+
owner_email: string;
|
|
34
|
+
user_email: string;
|
|
35
|
+
prm_parties?: Party;
|
|
36
|
+
};
|
|
37
|
+
/** Organization Customer / User, Returned directly by the API */
|
|
38
|
+
export type CustomerUser = CommonFields<CId> & {
|
|
39
|
+
customer_code: string;
|
|
40
|
+
party_id: PRid;
|
|
8
41
|
party_name: string;
|
|
9
|
-
party_description:
|
|
42
|
+
party_description: OId;
|
|
43
|
+
owner_id: UId;
|
|
44
|
+
owner_email: string;
|
|
45
|
+
permission_type: PermissionType | null;
|
|
46
|
+
user_id: UId | null;
|
|
47
|
+
user_email: string | null;
|
|
48
|
+
group_name: string | null;
|
|
49
|
+
};
|
|
50
|
+
export type Party = CommonFields<PRid, PartyMetadata> & {
|
|
51
|
+
party_name: string;
|
|
52
|
+
party_description: OId;
|
|
10
53
|
party_type: string;
|
|
11
|
-
|
|
12
|
-
|
|
54
|
+
party_image_url_logo: string | null;
|
|
55
|
+
far_customers: CommonFields<CId> & {
|
|
56
|
+
freight_term_code: string;
|
|
57
|
+
customer_type_code: string;
|
|
58
|
+
customer_class_code: string;
|
|
59
|
+
customer_status_code: string;
|
|
60
|
+
price_list_version_id: string | null;
|
|
61
|
+
customer_approval_status_code: string;
|
|
62
|
+
far_customers_customer_type_lookup: Lookup;
|
|
63
|
+
far_customers_freight_terms_lookup: Lookup;
|
|
64
|
+
far_customers_customer_class_lookup: Lookup;
|
|
65
|
+
far_customers_customer_status_lookup: Lookup;
|
|
66
|
+
far_customers_customer_approval_status_lookup: Lookup;
|
|
67
|
+
}[];
|
|
13
68
|
};
|
|
14
69
|
/** An Organizations credentials */
|
|
15
70
|
export type PartyMetadata = {
|
|
@@ -20,26 +75,31 @@ export type PartyMetadata = {
|
|
|
20
75
|
centrix_credentials: unknown;
|
|
21
76
|
};
|
|
22
77
|
/** An Organization Site */
|
|
23
|
-
export type PartySite = {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
end_date: string;
|
|
27
|
-
active: boolean;
|
|
28
|
-
party_id: string;
|
|
29
|
-
location_number: number;
|
|
78
|
+
export type PartySite = CommonFields<never> & {
|
|
79
|
+
party_id: PRid;
|
|
80
|
+
location_id: number;
|
|
30
81
|
party_site_name: string;
|
|
31
82
|
party_site_description: string | null;
|
|
32
|
-
party_site_number: string | null;
|
|
33
83
|
party_uses: string[];
|
|
34
84
|
party_use_primary: string;
|
|
35
|
-
|
|
85
|
+
};
|
|
86
|
+
export type CustomerSite = CommonFields<never> & {
|
|
87
|
+
org_id: OId;
|
|
88
|
+
party_site_id: string;
|
|
89
|
+
customer_site_code: string;
|
|
90
|
+
customer_site_status_code: string;
|
|
91
|
+
};
|
|
92
|
+
export type CustomerSiteUse = CommonFields<never> & {
|
|
93
|
+
org_id: OId;
|
|
94
|
+
customer_site_id: string;
|
|
95
|
+
customer_site_use_purpose_code: string;
|
|
96
|
+
customer_site_use_name: string;
|
|
97
|
+
freight_term_code: string | null;
|
|
98
|
+
payment_term_id: string;
|
|
99
|
+
price_list_version_id: string | null;
|
|
36
100
|
};
|
|
37
101
|
/** An Organization Location */
|
|
38
|
-
export type Location = {
|
|
39
|
-
id: string;
|
|
40
|
-
start_date: string;
|
|
41
|
-
end_date: string;
|
|
42
|
-
active: boolean;
|
|
102
|
+
export type Location = CommonFields<LOCId> & {
|
|
43
103
|
location_name: string;
|
|
44
104
|
location_description: string | null;
|
|
45
105
|
address_line_1: string | null;
|
|
@@ -61,15 +121,10 @@ export type Location = {
|
|
|
61
121
|
country: string | null;
|
|
62
122
|
geolocation: string | null;
|
|
63
123
|
geolocation_outline: string | null;
|
|
64
|
-
metadata: unknown;
|
|
65
124
|
};
|
|
66
125
|
/** A Contact Point for an Organization */
|
|
67
|
-
export type ContactPoint = {
|
|
68
|
-
|
|
69
|
-
start_date: string;
|
|
70
|
-
end_date: string;
|
|
71
|
-
active: boolean;
|
|
72
|
-
to_table: string;
|
|
126
|
+
export type ContactPoint = CommonFields<PCId> & {
|
|
127
|
+
party_id: PRid;
|
|
73
128
|
uuid: string | undefined;
|
|
74
129
|
contact_point_purpose: string;
|
|
75
130
|
contact_point_type: string;
|
|
@@ -80,5 +135,4 @@ export type ContactPoint = {
|
|
|
80
135
|
url_type: string | null;
|
|
81
136
|
email_address: string;
|
|
82
137
|
email_address_preferred_format: string;
|
|
83
|
-
metadata: unknown;
|
|
84
138
|
};
|
package/dist/raytio.d.ts
CHANGED
|
@@ -1,32 +1,101 @@
|
|
|
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;
|
|
6
6
|
};
|
|
7
7
|
/** @internal */
|
|
8
|
-
type Json = Record<string, any>;
|
|
8
|
+
export type Json = Record<string, any>;
|
|
9
9
|
/** A `p_id` is the ID of a {@link Relationship} */
|
|
10
10
|
export type PId = StringWithIdentity<"PId">;
|
|
11
11
|
/** An `i_id` is the ID of an {@link Instance} */
|
|
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 */
|
|
18
20
|
export type UId = StringWithIdentity<"UId">;
|
|
19
21
|
/** An `a_id` is the ID of an {@link AA} */
|
|
20
22
|
export type AId = StringWithIdentity<"AId">;
|
|
21
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* An `o_id` is the ID of an {@link Organization}
|
|
25
|
+
*
|
|
26
|
+
* NOTE: Will be deprecated soon. Use CId instead.
|
|
27
|
+
* */
|
|
22
28
|
export type OId = StringWithIdentity<"OId">;
|
|
29
|
+
/** A `pr_id` is the ID of a {@link Party} */
|
|
30
|
+
export type PRid = StringWithIdentity<"PRid">;
|
|
31
|
+
/** A `pc_id` is the ID of a Party Contact Point */
|
|
32
|
+
export type PCId = StringWithIdentity<"PCId">;
|
|
23
33
|
/** A `wi_id` is the ID of a {@link Webhook} */
|
|
24
34
|
export type WId = StringWithIdentity<"WId">;
|
|
25
35
|
/** An `l_id` is the ID of any data stored in the KV-Store */ export type LId = StringWithIdentity<"LId">;
|
|
36
|
+
/** A `k_id` (also called a `aack_id` or a `publicKeyId`) is the ID of an AA's public key */
|
|
37
|
+
export type KId = StringWithIdentity<"KId">;
|
|
38
|
+
/** A `pk_id` is the ID of an AA's private key */
|
|
39
|
+
export type PKId = StringWithIdentity<"PKId">;
|
|
40
|
+
/** A `c_id` is the ID of a {@link Customer}, (will eventually replace org_id) */
|
|
41
|
+
export type CId = StringWithIdentity<"CId">;
|
|
42
|
+
/** A `t_id` is the ID of a transaction */
|
|
43
|
+
export type TId = StringWithIdentity<"TId">;
|
|
44
|
+
/** A `ws_id` is the ID of a transition */
|
|
45
|
+
export type WSId = StringWithIdentity<"WSId">;
|
|
46
|
+
/** A `SchemaName` is the ID of a {@link Schema} */
|
|
47
|
+
export type SchemaName = StringWithIdentity<"SchemaName">;
|
|
48
|
+
/** A `loc_id` is the ID of a location */
|
|
49
|
+
export type LOCId = StringWithIdentity<"LOCId">;
|
|
50
|
+
/** A `pl_id` is the ID of a PriceList */
|
|
51
|
+
export type PLId = StringWithIdentity<"PLId">;
|
|
52
|
+
/** A `prc_id` is the ID of a Price */
|
|
53
|
+
export type PRCId = StringWithIdentity<"PRCId">;
|
|
54
|
+
/** A `pll_id` is the ID of a PriceListLine/Plan */
|
|
55
|
+
export type PLLId = StringWithIdentity<"PLLId">;
|
|
56
|
+
/** A `s_id` is the ID of a Subscription */
|
|
57
|
+
export type SId = StringWithIdentity<"SId">;
|
|
58
|
+
/** A `sl_id` is the ID of a SubscriptionLine */
|
|
59
|
+
export type SLId = StringWithIdentity<"SLId">;
|
|
60
|
+
/** A `pm_id` is the ID of a PaymentMethod */
|
|
61
|
+
export type PMId = StringWithIdentity<"PMId">;
|
|
62
|
+
/** A `pt_id` is the ID of a PaymentProcessor */
|
|
63
|
+
export type PTId = StringWithIdentity<"PTId">;
|
|
64
|
+
/** A `m_id` is the ID of a Merchant */
|
|
65
|
+
export type MId = StringWithIdentity<"MId">;
|
|
66
|
+
/** A `gpm_id` is the ID of a Verification Type */
|
|
67
|
+
export type GPMId = StringWithIdentity<"GPMId">;
|
|
26
68
|
export type DataTypes = "string" | "number" | "boolean" | "object" | "integer" | "array" | "null";
|
|
27
69
|
export type SubmissionStatus = "Submitted" | "Processing" | "Rejected" | "Expired" | "Completed" | "DataChanged" | "Received" | "Accepted";
|
|
70
|
+
/**
|
|
71
|
+
* Every object in the new database has these fields. In the
|
|
72
|
+
* interest of type-safety, the `id` should be one of the
|
|
73
|
+
* well-known IDs that extend {@link StringWithIdentity} (e.g.
|
|
74
|
+
* {@link NId} or {@link AId}). If the ID is irrelevant, then
|
|
75
|
+
* use `CommonFields<never>` rather than `CommonFields<string>`.
|
|
76
|
+
* This will deliberately prevent you from utilising the `id`
|
|
77
|
+
* field until you define a special type for that ID.
|
|
78
|
+
*
|
|
79
|
+
* This is especially important with the new API where it is much
|
|
80
|
+
* easier to mix up the different types of IDs.
|
|
81
|
+
*/
|
|
82
|
+
export type CommonFields<IdType extends StringWithIdentity<string>, Metadata = unknown> = {
|
|
83
|
+
id: IdType;
|
|
84
|
+
/** ISO Date */
|
|
85
|
+
start_date: string;
|
|
86
|
+
/** ISO Date */
|
|
87
|
+
end_date: string;
|
|
88
|
+
active: boolean;
|
|
89
|
+
metadata: Metadata | undefined;
|
|
90
|
+
row_version?: number;
|
|
91
|
+
resource_group?: string;
|
|
92
|
+
resource_name?: string;
|
|
93
|
+
resource_url?: string;
|
|
94
|
+
tenant_id?: string;
|
|
95
|
+
};
|
|
96
|
+
export type PermissionType = "ADMINS" | "VIEWS" | "EDITS" | "OWNS";
|
|
28
97
|
/** You can supply an option type argument if you know exactly what the properties will be */
|
|
29
|
-
export type ProfileObject<Properties = Json> = {
|
|
98
|
+
export type ProfileObject<Properties = Json> = Partial<CommonFields<NId2>> & {
|
|
30
99
|
n_id: NId;
|
|
31
100
|
properties: Properties;
|
|
32
101
|
labels: string[];
|
|
@@ -46,12 +115,13 @@ export type ProfileObjectForUpload<Properties = Json> = {
|
|
|
46
115
|
type?: string;
|
|
47
116
|
};
|
|
48
117
|
labels?: string[];
|
|
49
|
-
schema?:
|
|
118
|
+
schema?: SchemaName;
|
|
50
119
|
n_id?: NId;
|
|
51
120
|
};
|
|
52
121
|
export type UrnNodeType = "user" | "profile_object" | "instance" | "schema" | "temp_object" | "document";
|
|
53
122
|
/** e.g. "urn:user:..." */
|
|
54
|
-
export type Urn = `urn:user:${UId}` | `urn:profile_object:${NId}` | `urn:instance:${IId}` | `urn:temp_object:${LId}` | `urn:schema:${
|
|
123
|
+
export type Urn = `urn:user:${UId}` | `urn:profile_object:${NId}` | `urn:instance:${IId}` | `urn:temp_object:${LId}` | `urn:schema:${SchemaName}` | `urn:document:${NId}`;
|
|
124
|
+
export type ContentUrl = `url:${string}`;
|
|
55
125
|
export type Relationship = {
|
|
56
126
|
start: Urn;
|
|
57
127
|
end: Urn;
|
|
@@ -62,6 +132,9 @@ export type Relationship = {
|
|
|
62
132
|
name?: string;
|
|
63
133
|
[fieldName: string]: unknown;
|
|
64
134
|
};
|
|
135
|
+
start_date?: string;
|
|
136
|
+
end_date?: string;
|
|
137
|
+
active?: boolean;
|
|
65
138
|
};
|
|
66
139
|
export type Lookup = {
|
|
67
140
|
key: string | number;
|
|
@@ -96,7 +169,8 @@ export type AA = {
|
|
|
96
169
|
/** the n_id of the associated service provider */
|
|
97
170
|
service_provider_n_id?: NId;
|
|
98
171
|
/** the id of the associated organization */
|
|
99
|
-
org_id
|
|
172
|
+
org_id?: OId;
|
|
173
|
+
customer_id: CId;
|
|
100
174
|
/** configuration for the submission rules */
|
|
101
175
|
ruleset?: unknown;
|
|
102
176
|
/** if true, only specific email addresses can submit the form */
|
|
@@ -109,16 +183,16 @@ export type AA = {
|
|
|
109
183
|
logout_uri?: string[];
|
|
110
184
|
metadata?: unknown;
|
|
111
185
|
secret?: unknown;
|
|
112
|
-
/** @internal */
|
|
186
|
+
/** @internal fetched separately (see #1511) */
|
|
113
187
|
transitions?: unknown[];
|
|
114
188
|
};
|
|
115
|
-
export type
|
|
116
|
-
|
|
117
|
-
|
|
189
|
+
export type InstanceWithoutData = CommonFields<IId, {
|
|
190
|
+
message?: string;
|
|
191
|
+
}> & {
|
|
118
192
|
/** ID of the access application this submission was made to */
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
|
|
193
|
+
aa_id: AId;
|
|
194
|
+
/** ID of the public key for this AA */
|
|
195
|
+
aack_id: KId;
|
|
122
196
|
/** Code that validates information has been shared */
|
|
123
197
|
confirmation_code: string;
|
|
124
198
|
/** reference provided by the user who shared the data */
|
|
@@ -126,29 +200,12 @@ export type Instance = {
|
|
|
126
200
|
/** Email of user who shared the data */
|
|
127
201
|
data_provider_email: string;
|
|
128
202
|
thread: string;
|
|
129
|
-
/** Latest date in which the shared information was available */
|
|
130
|
-
end_date: string;
|
|
131
|
-
/** Earliest date on which the shared information was available */
|
|
132
|
-
start_date: string;
|
|
133
203
|
/** The status of a submission */
|
|
134
204
|
state: SubmissionStatus;
|
|
135
|
-
/** @deprecated The status of a submission */
|
|
136
|
-
_state?: SubmissionStatus;
|
|
137
205
|
/** Hash of the Service Provider ID */
|
|
138
|
-
sub_service_provider_hash
|
|
206
|
+
sub_service_provider_hash: string;
|
|
139
207
|
/** Service provider ID */
|
|
140
|
-
service_provider_n_id
|
|
141
|
-
/** data associated is access application's instance */
|
|
142
|
-
profile_objects: ProfileObject[];
|
|
143
|
-
keys: {
|
|
144
|
-
[nId: NId]: {
|
|
145
|
-
[fieldName: string]: {
|
|
146
|
-
data: string;
|
|
147
|
-
n_id: NId;
|
|
148
|
-
};
|
|
149
|
-
};
|
|
150
|
-
};
|
|
151
|
-
relationships?: Relationship[];
|
|
208
|
+
service_provider_n_id: NId;
|
|
152
209
|
/** added by the client once it calculates the score */
|
|
153
210
|
score?: unknown;
|
|
154
211
|
/** Previous status of the shared information */
|
|
@@ -165,34 +222,21 @@ export type Instance = {
|
|
|
165
222
|
platform_footer_html?: unknown;
|
|
166
223
|
/** Related Service Types */
|
|
167
224
|
related_service_types?: unknown;
|
|
168
|
-
/** Activity Status */
|
|
169
|
-
active?: boolean;
|
|
170
|
-
/** Key (Can be used to retrieve instance) */
|
|
171
|
-
aack_id?: string;
|
|
172
|
-
/** Metadata */
|
|
173
|
-
metadata?: unknown;
|
|
174
225
|
};
|
|
175
226
|
/**
|
|
176
|
-
*
|
|
177
|
-
*
|
|
227
|
+
* The API used to store data in this format, but it no
|
|
228
|
+
* longer does :( so `@raytio/core` reconstructs this object.
|
|
178
229
|
*/
|
|
179
|
-
export type
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
export type FullOrg = {
|
|
188
|
-
id: OId;
|
|
189
|
-
organization: Omit<Organization, "id">;
|
|
190
|
-
/** 🧙♂️ */
|
|
191
|
-
gandalf: unknown;
|
|
192
|
-
stripe: {
|
|
193
|
-
customer: unknown;
|
|
230
|
+
export type Instance = InstanceWithoutData & {
|
|
231
|
+
profile_objects: ProfileObject[];
|
|
232
|
+
keys: {
|
|
233
|
+
[nId2: NId2]: {
|
|
234
|
+
[fieldName: string]: {
|
|
235
|
+
data: string;
|
|
236
|
+
};
|
|
237
|
+
};
|
|
194
238
|
};
|
|
195
|
-
|
|
239
|
+
relationships: Relationship[];
|
|
196
240
|
};
|
|
197
241
|
/** validation data returned by preVerify (part of the extract&map API) */
|
|
198
242
|
export type Validation = {
|
|
@@ -244,4 +288,16 @@ export type Webhook = {
|
|
|
244
288
|
response_payload: Json;
|
|
245
289
|
}[];
|
|
246
290
|
};
|
|
247
|
-
|
|
291
|
+
/**
|
|
292
|
+
* Link used for an Access Application, including all additional information
|
|
293
|
+
*/
|
|
294
|
+
export type Link = {
|
|
295
|
+
id: NId;
|
|
296
|
+
a_id: AId;
|
|
297
|
+
name: string;
|
|
298
|
+
subtitle: string;
|
|
299
|
+
code: LId;
|
|
300
|
+
url: string;
|
|
301
|
+
details?: AA;
|
|
302
|
+
isDefault?: boolean;
|
|
303
|
+
};
|
package/dist/schema.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { AA, DataTypes,
|
|
2
|
-
import {
|
|
1
|
+
import type { AA, DataTypes, SchemaName, Urn } from "./raytio";
|
|
2
|
+
import type { Organization } from "./orgs";
|
|
3
|
+
import type { WizardConfig } from "./wizard";
|
|
3
4
|
/** should be renamed since this applies to ConditionallyVerifiable */
|
|
4
5
|
export type ConditionallyRequired = {
|
|
5
6
|
field: string;
|
|
@@ -7,8 +8,8 @@ export type ConditionallyRequired = {
|
|
|
7
8
|
[fieldName: string]: (string | number | boolean)[];
|
|
8
9
|
};
|
|
9
10
|
};
|
|
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}'
|
|
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";
|
|
11
|
+
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:mask" | `display:replace:('${string}', '${string}')` | "display:terms_conditions" | `display:main_media:${string}` | "date_component:day" | "date_component:month" | "date_component:year" | "action:allow_copy" | "action:allow_unreplace" | "action:allow_password_compromise_check" | "action:client_upload" | "action:hash" | "action:require_webauthn" | `action:generate_pepper:` | "verify:show_if_pending" | "special:hide_select_behind_button" | "type:capture_geolocation" | "type:extract_required";
|
|
12
|
+
export type SchemaTag = "action:experimental_pass_object_store_id" | "action:verify" | `action:display_qr_code:${string}:${string}` | "default_camera:rear" | "default_camera:front" | `oauth2_component:name:${string}` | `oauth2_component:redirect_url:${string}` | `time:${string}:${number}` | `link_to:${string}:${string}` | "display:default_view:edit" | "type:service_provider" | "type:service_offer" | "type:marketplace" | "type:client_only" | "type:globally_unique_field";
|
|
12
13
|
export type SchemaField = {
|
|
13
14
|
/** @deprecated don't use, it's inconsistent */
|
|
14
15
|
$id?: string;
|
|
@@ -41,6 +42,20 @@ export type SchemaField = {
|
|
|
41
42
|
format?: "date" | "date-time" | "uri";
|
|
42
43
|
contentMediaType?: string;
|
|
43
44
|
contentEncoding?: "base64";
|
|
45
|
+
/**
|
|
46
|
+
* if this field is a foreign key, i.e. it is a primary key
|
|
47
|
+
* of a different schema, then that other's schema name should be listed here.
|
|
48
|
+
* e.g.
|
|
49
|
+
* ```json
|
|
50
|
+
* {
|
|
51
|
+
* "name": "ss_AA",
|
|
52
|
+
* "properties": {
|
|
53
|
+
* "org_id": { "foreign_key_of": "ss_Org" }
|
|
54
|
+
* }
|
|
55
|
+
* }
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
foreign_key_of?: SchemaName;
|
|
44
59
|
/** `items` is used for nested arrays, (while `properties` is used for nested objects) */
|
|
45
60
|
items?: {
|
|
46
61
|
type: DataTypes;
|
|
@@ -53,7 +68,7 @@ export type SchemaField = {
|
|
|
53
68
|
[subFieldName: string]: SchemaField;
|
|
54
69
|
};
|
|
55
70
|
/** If this field refers to a sub-object */
|
|
56
|
-
$ref?:
|
|
71
|
+
$ref?: SchemaName;
|
|
57
72
|
/**
|
|
58
73
|
* @internal
|
|
59
74
|
* the client adds this for conditional properties, see #329
|
|
@@ -79,6 +94,10 @@ export type SchemaField = {
|
|
|
79
94
|
description_decorator?: "md";
|
|
80
95
|
/** if a `pattern` is specified, this is the error message */
|
|
81
96
|
patternMessage?: string;
|
|
97
|
+
/** the input string for a platform_unique_id */
|
|
98
|
+
hash_inputs?: string;
|
|
99
|
+
/** determines where an image is sourced from */
|
|
100
|
+
content_source?: string;
|
|
82
101
|
override?: {
|
|
83
102
|
permissions: {
|
|
84
103
|
/**
|
|
@@ -175,9 +194,9 @@ export type CommonSchemaAttributes = {
|
|
|
175
194
|
/** if required_relationship then use will be alerted in relationship menu and won't be able to share PO unless filled out */
|
|
176
195
|
required_relationship?: boolean;
|
|
177
196
|
/** Specify `oneOf` XOR `anyOf`. It's a list of schema names, or `"instance"` (see #784) */
|
|
178
|
-
oneOf?:
|
|
197
|
+
oneOf?: (SchemaName | "instance")[];
|
|
179
198
|
/** Specify `oneOf` XOR `anyOf` It's a list of schema names. */
|
|
180
|
-
anyOf?:
|
|
199
|
+
anyOf?: SchemaName[];
|
|
181
200
|
/** assume TRUE if not specified */
|
|
182
201
|
multiple?: boolean;
|
|
183
202
|
/** these are arbitary fields on the relationship */
|
|
@@ -212,12 +231,25 @@ export type CommonSchemaAttributes = {
|
|
|
212
231
|
fields: string[];
|
|
213
232
|
label: string;
|
|
214
233
|
}[];
|
|
234
|
+
/**
|
|
235
|
+
* By default, the admin dashboard shows columns for all fields
|
|
236
|
+
* in listed in `head_main`. In rare cases you can use this property
|
|
237
|
+
* to specify a different set of fields to show to admins by default.
|
|
238
|
+
*/
|
|
239
|
+
tabular?: {
|
|
240
|
+
fields: string[];
|
|
241
|
+
};
|
|
242
|
+
/**
|
|
243
|
+
* determines if profile pages should display using compacted 'MiniPO'
|
|
244
|
+
* view or deafult view
|
|
245
|
+
*/
|
|
246
|
+
compact_table?: boolean;
|
|
215
247
|
};
|
|
216
248
|
/** only the schema used for the onboarding wizard have this property */
|
|
217
249
|
onboard_properties?: {
|
|
218
250
|
/** Profile Objects that should be created */
|
|
219
251
|
profile_objects?: {
|
|
220
|
-
schema_name:
|
|
252
|
+
schema_name: SchemaName;
|
|
221
253
|
properties: Record<string, unknown>;
|
|
222
254
|
}[];
|
|
223
255
|
/** Relationships that should be created */
|
|
@@ -254,7 +286,7 @@ export type CommonSchemaAttributes = {
|
|
|
254
286
|
*/
|
|
255
287
|
export type Schema = CommonSchemaAttributes & {
|
|
256
288
|
/** added by the client, copied from {@link WrappedSchema} */
|
|
257
|
-
name:
|
|
289
|
+
name: SchemaName;
|
|
258
290
|
/** added by client */
|
|
259
291
|
type?: DataTypes;
|
|
260
292
|
/** the localized title of the `schema_group`. added by the client */
|
|
@@ -273,6 +305,16 @@ export type Schema = CommonSchemaAttributes & {
|
|
|
273
305
|
properties: {
|
|
274
306
|
[fieldName: string]: SchemaField;
|
|
275
307
|
};
|
|
308
|
+
/**
|
|
309
|
+
* Some schema's represent data that is not stored as a profile object.
|
|
310
|
+
* In this case, this attribute defines what database table we need to use
|
|
311
|
+
* to fetch the corresponding data, and which field is the primary_key of that
|
|
312
|
+
* table (e.g. `id`, `o_id` etc.)
|
|
313
|
+
*/
|
|
314
|
+
database?: {
|
|
315
|
+
table: string;
|
|
316
|
+
primary_key: string;
|
|
317
|
+
};
|
|
276
318
|
/** the client adds this after processing the i18n property */
|
|
277
319
|
groupNames?: Record<string, string>;
|
|
278
320
|
/** added by the client to inform downstream components which locale from schema.i18n was used */
|
|
@@ -299,7 +341,7 @@ export type WrappedSchema = {
|
|
|
299
341
|
/** ISO Date. If this tag exists, the schema is deprecated. */
|
|
300
342
|
end_date: string;
|
|
301
343
|
/** Schema Name Type and Version Properties */
|
|
302
|
-
schema_name:
|
|
344
|
+
schema_name: SchemaName;
|
|
303
345
|
schema_type: SchemaType;
|
|
304
346
|
schema_version: string;
|
|
305
347
|
/** whether the \`version\` is the latest version */
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { CId, CommonFields, PLId, PLLId, PMId, PRCId, PRid, PTId, SId, SLId } from "./raytio";
|
|
2
|
+
export type PriceList = {
|
|
3
|
+
id: PLId;
|
|
4
|
+
price_list_type: string;
|
|
5
|
+
price_list_currency: string;
|
|
6
|
+
price_list_name: string;
|
|
7
|
+
price_list_name_i18n?: string;
|
|
8
|
+
price_list_description?: string;
|
|
9
|
+
price_list_description_i18n?: string;
|
|
10
|
+
pcm_price_list_versions?: [
|
|
11
|
+
{
|
|
12
|
+
id: string;
|
|
13
|
+
price_list_version_name: string;
|
|
14
|
+
pcm_price_list_lines: PriceListLine[];
|
|
15
|
+
}
|
|
16
|
+
];
|
|
17
|
+
};
|
|
18
|
+
export type PriceListLine = {
|
|
19
|
+
id: PLLId;
|
|
20
|
+
pcm_prices: {
|
|
21
|
+
id: PRCId;
|
|
22
|
+
amount: number;
|
|
23
|
+
gpm_items: {
|
|
24
|
+
id: string;
|
|
25
|
+
item_key: string;
|
|
26
|
+
item_name: string;
|
|
27
|
+
primary_uom: string;
|
|
28
|
+
item_name_i18n: string | null;
|
|
29
|
+
item_description: string;
|
|
30
|
+
item_description_i18n: string | null;
|
|
31
|
+
};
|
|
32
|
+
price_currency: string;
|
|
33
|
+
billing_recurrence: string;
|
|
34
|
+
recurring_billing_scheme: string;
|
|
35
|
+
recurring_billing_interval: string | null;
|
|
36
|
+
recurring_billing_usage_type: string;
|
|
37
|
+
recurring_billing_interval_count: number;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export type Subscription = CommonFields<SId> & {
|
|
41
|
+
subscribed_to_customer_id: string;
|
|
42
|
+
subscribed_to_customer_site_id: string | null;
|
|
43
|
+
subscribed_to_party_contact_point_id: string;
|
|
44
|
+
billing_cycle_month: number | null;
|
|
45
|
+
billing_cycle_day_of_month: number | null;
|
|
46
|
+
billing_cycle_day_of_week: number | null;
|
|
47
|
+
billing_cycle_hour: number | null;
|
|
48
|
+
billing_cycle_minute: number | null;
|
|
49
|
+
billing_cycle_second: number | null;
|
|
50
|
+
subscription_name: string;
|
|
51
|
+
subscription_name_i18n: string | null;
|
|
52
|
+
current_billing_period_start: string;
|
|
53
|
+
current_billing_period_end: string | null;
|
|
54
|
+
cancellation_request_date: string | null;
|
|
55
|
+
cancellation_effective_date: string | null;
|
|
56
|
+
cancellation_request_reason: string | null;
|
|
57
|
+
cancellation_final_invoice_action: string;
|
|
58
|
+
};
|
|
59
|
+
export type SubscriptionLine = CommonFields<SLId> & {
|
|
60
|
+
billing_subscription_id: SId;
|
|
61
|
+
price_id: PRCId;
|
|
62
|
+
subscribed_qty: number;
|
|
63
|
+
metadata: string | null;
|
|
64
|
+
};
|
|
65
|
+
export type PaymentMethod = CommonFields<PMId> & {
|
|
66
|
+
customer_id: CId;
|
|
67
|
+
payer_payment_method_type: string;
|
|
68
|
+
primary_payment_method: boolean;
|
|
69
|
+
payment_processor_id: string;
|
|
70
|
+
payment_method_country_code: string | null;
|
|
71
|
+
payment_method_scheme: string;
|
|
72
|
+
payment_method_available_networks: string[] | string;
|
|
73
|
+
payment_method_preferred_network?: string | null;
|
|
74
|
+
card_expiry_month: number;
|
|
75
|
+
card_expiry_year: number;
|
|
76
|
+
card_funding_method: string;
|
|
77
|
+
card_last_4_digits: string;
|
|
78
|
+
card_fingerprint?: string | null;
|
|
79
|
+
payment_processor_payment_method_id: string;
|
|
80
|
+
address_line1_check?: string | null;
|
|
81
|
+
address_postal_code_check?: string | null;
|
|
82
|
+
cvc_check?: string | null;
|
|
83
|
+
three_d_secure_usage?: string | null;
|
|
84
|
+
};
|
|
85
|
+
export type PaymentProcessor = CommonFields<PTId> & {
|
|
86
|
+
party_id: PRid;
|
|
87
|
+
payment_processor_name: string;
|
|
88
|
+
payment_processor_system: string;
|
|
89
|
+
};
|