@raytio/types 7.3.0 → 8.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,4 @@
1
+ /** Relation types used by the new authz tuple system */
2
+ export type AuthzRelation = "viewer" | "editor" | "admin" | "owner" | "member";
3
+ export type AuthzSubjectType = "user" | "group";
4
+ export type AuthzObjectType = "dsm_node" | "dsm_access_application" | "dsm_access_application_instance" | "dsm_link" | "dsm_public_profile" | "far_customer" | "group";
package/dist/authz.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/dist/index.d.ts CHANGED
@@ -5,3 +5,7 @@ export * from "./theme";
5
5
  export * from "./verification";
6
6
  export * from "./wizard";
7
7
  export * from "./orgs";
8
+ export * from "./subscription";
9
+ export * from "./merchant";
10
+ export * from "./tenant";
11
+ export * from "./authz";
package/dist/index.js CHANGED
@@ -21,3 +21,7 @@ __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);
26
+ __exportStar(require("./tenant"), exports);
27
+ __exportStar(require("./authz"), 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
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
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
- /** An Organisation */
3
- export type Party = {
4
- id: string;
5
- start_date: string;
6
- end_date: string;
7
- active: boolean;
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: string;
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
- metadata: PartyMetadata;
12
- party_number: number;
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
- id: string;
25
- start_date: string;
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
- metadata: unknown;
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
- id: string;
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
@@ -5,7 +5,7 @@ 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} */
@@ -20,17 +20,65 @@ export type GId = StringWithIdentity<"GId">;
20
20
  export type UId = StringWithIdentity<"UId">;
21
21
  /** An `a_id` is the ID of an {@link AA} */
22
22
  export type AId = StringWithIdentity<"AId">;
23
- /** An `o_id` is the ID of an {@link Organization} */
23
+ /** An `ao_id` is the ID of an {@link AAObject} */
24
+ export type AOId = StringWithIdentity<"AOId">;
25
+ /** A `aain_id` is the ID of an Instance Node */
26
+ export type AINId = StringWithIdentity<"AINId">;
27
+ /** A `aaink_id` is the ID of an Instance Node Key */
28
+ export type AINKId = StringWithIdentity<"AINKId">;
29
+ /** A `tnt_id` is the ID of a Tenant */
30
+ export type TNTId = StringWithIdentity<"TNTId">;
31
+ /**
32
+ * An `o_id` is the ID of an {@link Organization}
33
+ *
34
+ * NOTE: Will be deprecated soon. Use CId instead.
35
+ * */
24
36
  export type OId = StringWithIdentity<"OId">;
37
+ /** A `pr_id` is the ID of a {@link Party} */
38
+ export type PRid = StringWithIdentity<"PRid">;
39
+ /** A `pc_id` is the ID of a Party Contact Point */
40
+ export type PCId = StringWithIdentity<"PCId">;
25
41
  /** A `wi_id` is the ID of a {@link Webhook} */
26
42
  export type WId = StringWithIdentity<"WId">;
27
43
  /** An `l_id` is the ID of any data stored in the KV-Store */ export type LId = StringWithIdentity<"LId">;
28
44
  /** A `k_id` (also called a `aack_id` or a `publicKeyId`) is the ID of an AA's public key */
29
45
  export type KId = StringWithIdentity<"KId">;
46
+ /** A `pk_id` is the ID of an AA's private key */
47
+ export type PKId = StringWithIdentity<"PKId">;
48
+ /** A `c_id` is the ID of a {@link Customer}, (will eventually replace org_id) */
49
+ export type CId = StringWithIdentity<"CId">;
50
+ /** A `t_id` is the ID of a transaction */
51
+ export type TId = StringWithIdentity<"TId">;
52
+ /** A `ws_id` is the ID of a transition */
53
+ export type WSId = StringWithIdentity<"WSId">;
30
54
  /** A `SchemaName` is the ID of a {@link Schema} */
31
55
  export type SchemaName = StringWithIdentity<"SchemaName">;
56
+ /** A `loc_id` is the ID of a location */
57
+ export type LOCId = StringWithIdentity<"LOCId">;
58
+ /** A `pl_id` is the ID of a PriceList */
59
+ export type PLId = StringWithIdentity<"PLId">;
60
+ /** A `prc_id` is the ID of a Price */
61
+ export type PRCId = StringWithIdentity<"PRCId">;
62
+ /** A `pll_id` is the ID of a PriceListLine/Plan */
63
+ export type PLLId = StringWithIdentity<"PLLId">;
64
+ /** A `s_id` is the ID of a Subscription */
65
+ export type SId = StringWithIdentity<"SId">;
66
+ /** A `sl_id` is the ID of a SubscriptionLine */
67
+ export type SLId = StringWithIdentity<"SLId">;
68
+ /** A `pm_id` is the ID of a PaymentMethod */
69
+ export type PMId = StringWithIdentity<"PMId">;
70
+ /** A `pt_id` is the ID of a PaymentProcessor */
71
+ export type PTId = StringWithIdentity<"PTId">;
72
+ /** A `m_id` is the ID of a Merchant */
73
+ export type MId = StringWithIdentity<"MId">;
74
+ /** A `gpm_id` is the ID of a Verification Type */
75
+ export type GPMId = StringWithIdentity<"GPMId">;
76
+ /** A `b_id` is the ID of a badge definition */
77
+ export type BId = StringWithIdentity<"BId">;
78
+ /** a `GroupName` is the unique name of a group, often used instead of {@link GId} */
79
+ export type GroupName = StringWithIdentity<"GroupName">;
32
80
  export type DataTypes = "string" | "number" | "boolean" | "object" | "integer" | "array" | "null";
33
- export type SubmissionStatus = "Submitted" | "Processing" | "Rejected" | "Expired" | "Completed" | "DataChanged" | "Received" | "Accepted";
81
+ export type SubmissionStatus = "Submitted" | "Processing" | "Rejected" | "Expired" | "Completed" | "DataChanged" | "Received" | "Pending" | "Accepted";
34
82
  /**
35
83
  * Every object in the new database has these fields. In the
36
84
  * interest of type-safety, the `id` should be one of the
@@ -51,7 +99,13 @@ export type CommonFields<IdType extends StringWithIdentity<string>, Metadata = u
51
99
  end_date: string;
52
100
  active: boolean;
53
101
  metadata: Metadata | undefined;
102
+ row_version?: number;
103
+ resource_group?: string;
104
+ resource_name?: string;
105
+ resource_url?: string;
106
+ tenant_id?: string;
54
107
  };
108
+ export type PermissionType = "ADMINS" | "VIEWS" | "EDITS" | "OWNS";
55
109
  /** You can supply an option type argument if you know exactly what the properties will be */
56
110
  export type ProfileObject<Properties = Json> = Partial<CommonFields<NId2>> & {
57
111
  n_id: NId;
@@ -79,6 +133,7 @@ export type ProfileObjectForUpload<Properties = Json> = {
79
133
  export type UrnNodeType = "user" | "profile_object" | "instance" | "schema" | "temp_object" | "document";
80
134
  /** e.g. "urn:user:..." */
81
135
  export type Urn = `urn:user:${UId}` | `urn:profile_object:${NId}` | `urn:instance:${IId}` | `urn:temp_object:${LId}` | `urn:schema:${SchemaName}` | `urn:document:${NId}`;
136
+ export type ContentUrl = `url:${string}`;
82
137
  export type Relationship = {
83
138
  start: Urn;
84
139
  end: Urn;
@@ -100,10 +155,12 @@ export type Lookup = {
100
155
  label?: string | number;
101
156
  children?: Lookup[];
102
157
  description?: string;
158
+ /** Icon source in format `icon:{AntDesignIconName}` (e.g., `icon:CameraOutlined`) */
159
+ image_src?: string;
103
160
  /** used in AkahuDynamicSection only */
104
161
  requires_2FA?: boolean;
105
162
  };
106
- export type AATag = "type:client_only" | "type:share_with_new_user" | `related_service_provider:n_id:${NId}` | "ServiceProvider";
163
+ export type AATag = "type:client_only" | "type:share_with_new_user" | "Merchant";
107
164
  export type AA = {
108
165
  a_id: AId;
109
166
  name: string;
@@ -123,14 +180,19 @@ export type AA = {
123
180
  font?: CustomFonts;
124
181
  colors?: Colors;
125
182
  };
126
- /** the n_id of the associated service provider */
183
+ /** @deprecated use merchant_id instead */
127
184
  service_provider_n_id?: NId;
128
185
  /** the id of the associated organization */
129
- org_id: OId;
186
+ org_id?: OId;
187
+ customer_id: CId;
188
+ /** the id of the associated merchant (replaces service_provider_n_id) */
189
+ merchant_id?: MId;
130
190
  /** configuration for the submission rules */
131
191
  ruleset?: unknown;
132
192
  /** if true, only specific email addresses can submit the form */
133
193
  auth_list_enabled?: boolean;
194
+ /** Bot protection challenge type. If set, users must complete a challenge before accessing the wizard. */
195
+ client_challenge_type?: "turnstile" | null;
134
196
  /** Currently Unused Attributes */
135
197
  start_date?: Date;
136
198
  end_date?: Date;
@@ -139,9 +201,27 @@ export type AA = {
139
201
  logout_uri?: string[];
140
202
  metadata?: unknown;
141
203
  secret?: unknown;
142
- /** @internal */
204
+ /** @internal fetched separately (see #1511) */
143
205
  transitions?: unknown[];
144
206
  };
207
+ export type AAObject = CommonFields<AOId> & {
208
+ aa_id: AId;
209
+ aai_id: IId;
210
+ properties: Json;
211
+ labels: string[];
212
+ };
213
+ export type InstanceNode = CommonFields<AINId> & {
214
+ aa_id: AId;
215
+ n_id: NId;
216
+ field_list: string[];
217
+ };
218
+ export type InstanceNodeKey = CommonFields<AINKId> & {
219
+ aa_id: AId;
220
+ aai_id: IId;
221
+ aain_id: AINId;
222
+ field_name: string;
223
+ key_data: string;
224
+ };
145
225
  export type InstanceWithoutData = CommonFields<IId, {
146
226
  message?: string;
147
227
  }> & {
@@ -158,10 +238,10 @@ export type InstanceWithoutData = CommonFields<IId, {
158
238
  thread: string;
159
239
  /** The status of a submission */
160
240
  state: SubmissionStatus;
161
- /** Hash of the Service Provider ID */
162
- sub_service_provider_hash: string;
163
- /** Service provider ID */
164
- service_provider_n_id: NId;
241
+ /** Hash of the Merchant ID */
242
+ sub_merchant_hash: string;
243
+ /** Merchant ID (replaces service_provider_n_id) */
244
+ merchant_id: MId;
165
245
  /** added by the client once it calculates the score */
166
246
  score?: unknown;
167
247
  /** Previous status of the shared information */
@@ -194,28 +274,6 @@ export type Instance = InstanceWithoutData & {
194
274
  };
195
275
  relationships: Relationship[];
196
276
  };
197
- /**
198
- * An organization.
199
- * NOTE: this is different to how the schema defines an Organization. **The schema is wrong (see #468)**
200
- */
201
- export type Organization = {
202
- id: OId;
203
- name: string;
204
- email: string;
205
- address: unknown;
206
- customer: unknown;
207
- };
208
- /** @internal some APIs now return extra info */
209
- export type FullOrg = {
210
- id: OId;
211
- organization: Omit<Organization, "id">;
212
- /** 🧙‍♂️ */
213
- gandalf: unknown;
214
- stripe: {
215
- customer: unknown;
216
- };
217
- centrix_credentials: unknown;
218
- };
219
277
  /** validation data returned by preVerify (part of the extract&map API) */
220
278
  export type Validation = {
221
279
  score: number;
@@ -232,38 +290,62 @@ export type Validation = {
232
290
  };
233
291
  };
234
292
  };
235
- export type WebhookStatus = "subscribed" | "pending" | "unsubscribe_failed";
236
- export type Webhook = {
237
- wi_id: WId;
238
- /** n_id of "the webhook provider which can be set up against a service provider" */
239
- provider_webhook_id: NId;
240
- /** not sure what this is */
241
- provider_webhook_subscription_id: NId;
242
- status: WebhookStatus;
243
- /** ISO Date */
244
- date_created: string;
245
- /** ISO Date */
246
- date_updated: string;
293
+ export type WebhookStatus = "PENDING" | "SUBSCRIBED" | "UNSUBSCRIBED" | "UNSUBSCRIBE_FAILED" | "ERROR" | "ARCHIVED";
294
+ export type Webhook = CommonFields<WId> & {
295
+ aa_id: AId;
296
+ webhook_processing_rules: unknown;
297
+ provider_subscription_credentials: unknown;
298
+ provider_signature_check_enabled: boolean;
299
+ provider_signature_credentials: unknown;
300
+ webhook_filter_source: string | null;
247
301
  webhook_filter_schema: {
248
302
  operator: string;
249
303
  field_value: string;
250
304
  field_name: string;
251
- };
305
+ } | null;
252
306
  webhook_action: {
253
307
  webhook_action_type: string;
254
- }[];
255
- webhook_filter_source: string;
308
+ }[] | null;
256
309
  webhook_field_mapping_schema: {
257
310
  [key: string]: string;
258
- };
259
- webhook_processing_rules: unknown;
260
- provider_subscription_credentials: unknown;
261
- provider_signature_check_enabled: boolean;
262
- provider_signature_credentials: unknown;
311
+ } | null;
312
+ provider_webhook_id: string;
313
+ provider_webhook_subscription_id: string | null;
263
314
  subscribe_log?: {
264
315
  date: string;
265
316
  response_status_code: number;
266
317
  response_payload: Json;
267
- }[];
318
+ }[] | null;
319
+ status: WebhookStatus;
320
+ metadata: unknown;
321
+ wi_id?: WId;
322
+ date_created?: string;
323
+ date_updated?: string;
324
+ };
325
+ /**
326
+ * Link used for an Access Application, including all additional information
327
+ */
328
+ export type Link = {
329
+ id: NId;
330
+ a_id: AId;
331
+ name: string;
332
+ subtitle: string;
333
+ code: LId;
334
+ url: string;
335
+ details?: AA;
336
+ isDefault?: boolean;
337
+ };
338
+ export type Permission = {
339
+ id: NId;
340
+ n_id: NId;
341
+ labels: string[];
342
+ properties: {
343
+ permissions: string;
344
+ provider_name: string;
345
+ };
346
+ user_permission_type: string | null;
347
+ group_permission_type: "VIEWS" | "EDITS" | null;
348
+ group_name: "ALL" | "Public" | `sharing|${UId}|${UId}` | GId;
349
+ is_owner: boolean;
350
+ permission_id: PId;
268
351
  };
269
- export {};