@raytio/types 8.0.0 → 8.2.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 +215 -51
- package/dist/authz.d.ts +4 -0
- package/dist/authz.js +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/raytio.d.ts +80 -28
- package/dist/schema.d.ts +211 -38
- package/dist/subscription.d.ts +1 -0
- package/dist/tenant.d.ts +6 -0
- package/dist/tenant.js +2 -0
- package/dist/theme.d.ts +4 -0
- package/dist/verification.d.ts +9 -8
- package/dist/wizard.d.ts +37 -2
- package/package.json +2 -2
- package/src/authz.ts +13 -0
- package/src/index.ts +2 -0
- package/src/raytio.ts +98 -35
- package/src/schema.ts +261 -39
- package/src/subscription.ts +1 -0
- package/src/tenant.ts +7 -0
- package/src/theme.ts +4 -0
- package/src/verification.ts +9 -7
- package/src/wizard.ts +44 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@raytio/types",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.2.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "index",
|
|
6
6
|
"types": "index",
|
|
@@ -13,6 +13,6 @@
|
|
|
13
13
|
"scripts": {
|
|
14
14
|
"docs": "sh ../../scripts/generate-docs.sh",
|
|
15
15
|
"test": "npm run build && yarn docs",
|
|
16
|
-
"build": "tsc && rm -rf dist/__tests__"
|
|
16
|
+
"build": "yarn run -T tsc && rm -rf dist/__tests__"
|
|
17
17
|
}
|
|
18
18
|
}
|
package/src/authz.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Relation types used by the new authz tuple system */
|
|
2
|
+
export type AuthzRelation = "viewer" | "editor" | "admin" | "owner" | "member";
|
|
3
|
+
|
|
4
|
+
export type AuthzSubjectType = "user" | "group";
|
|
5
|
+
|
|
6
|
+
export type AuthzObjectType =
|
|
7
|
+
| "dsm_node"
|
|
8
|
+
| "dsm_access_application"
|
|
9
|
+
| "dsm_access_application_instance"
|
|
10
|
+
| "dsm_link"
|
|
11
|
+
| "dsm_public_profile"
|
|
12
|
+
| "far_customer"
|
|
13
|
+
| "group";
|
package/src/index.ts
CHANGED
package/src/raytio.ts
CHANGED
|
@@ -21,6 +21,14 @@ 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
|
+
/** An `ao_id` is the ID of an {@link AAObject} */
|
|
25
|
+
export type AOId = StringWithIdentity<"AOId">;
|
|
26
|
+
/** A `aain_id` is the ID of an Instance Node */
|
|
27
|
+
export type AINId = StringWithIdentity<"AINId">;
|
|
28
|
+
/** A `aaink_id` is the ID of an Instance Node Key */
|
|
29
|
+
export type AINKId = StringWithIdentity<"AINKId">;
|
|
30
|
+
/** A `tnt_id` is the ID of a Tenant */
|
|
31
|
+
export type TNTId = StringWithIdentity<"TNTId">;
|
|
24
32
|
/**
|
|
25
33
|
* An `o_id` is the ID of an {@link Organization}
|
|
26
34
|
*
|
|
@@ -67,6 +75,10 @@ export type PTId = StringWithIdentity<"PTId">;
|
|
|
67
75
|
export type MId = StringWithIdentity<"MId">;
|
|
68
76
|
/** A `gpm_id` is the ID of a Verification Type */
|
|
69
77
|
export type GPMId = StringWithIdentity<"GPMId">;
|
|
78
|
+
/** A `b_id` is the ID of a badge definition */
|
|
79
|
+
export type BId = StringWithIdentity<"BId">;
|
|
80
|
+
/** a `GroupName` is the unique name of a group, often used instead of {@link GId} */
|
|
81
|
+
export type GroupName = StringWithIdentity<"GroupName">;
|
|
70
82
|
|
|
71
83
|
export type DataTypes =
|
|
72
84
|
| "string"
|
|
@@ -85,6 +97,7 @@ export type SubmissionStatus =
|
|
|
85
97
|
| "Completed"
|
|
86
98
|
| "DataChanged"
|
|
87
99
|
| "Received"
|
|
100
|
+
| "Pending"
|
|
88
101
|
| "Accepted";
|
|
89
102
|
|
|
90
103
|
/**
|
|
@@ -189,17 +202,22 @@ export type Lookup = {
|
|
|
189
202
|
label?: string | number;
|
|
190
203
|
children?: Lookup[];
|
|
191
204
|
description?: string;
|
|
205
|
+
/** Icon source in format `icon:{AntDesignIconName}` (e.g., `icon:CameraOutlined`) */
|
|
206
|
+
image_src?: string;
|
|
192
207
|
|
|
193
208
|
/** used in AkahuDynamicSection only */
|
|
194
209
|
requires_2FA?: boolean;
|
|
210
|
+
|
|
211
|
+
/** Sort order within a lookup set. NULL = unordered. */
|
|
212
|
+
display_order?: number;
|
|
213
|
+
/** Group heading for dropdown lists (e.g., "APAC", "EMEA"). NULL = ungrouped. */
|
|
214
|
+
lookup_group?: string;
|
|
195
215
|
};
|
|
196
216
|
|
|
197
217
|
export type AATag =
|
|
198
218
|
| "type:client_only"
|
|
199
219
|
| "type:share_with_new_user"
|
|
200
|
-
//
|
|
201
|
-
| `related_service_provider:n_id:${NId}`
|
|
202
|
-
| "ServiceProvider"; // TODO: document or delete
|
|
220
|
+
| "Merchant"; // TODO: document or delete
|
|
203
221
|
|
|
204
222
|
export type AA = {
|
|
205
223
|
a_id: AId;
|
|
@@ -220,11 +238,13 @@ export type AA = {
|
|
|
220
238
|
font?: CustomFonts;
|
|
221
239
|
colors?: Colors;
|
|
222
240
|
};
|
|
223
|
-
/**
|
|
241
|
+
/** @deprecated use merchant_id instead */
|
|
224
242
|
service_provider_n_id?: NId;
|
|
225
243
|
/** the id of the associated organization */
|
|
226
244
|
org_id?: OId;
|
|
227
245
|
customer_id: CId;
|
|
246
|
+
/** the id of the associated merchant (replaces service_provider_n_id) */
|
|
247
|
+
merchant_id?: MId;
|
|
228
248
|
|
|
229
249
|
/** configuration for the submission rules */
|
|
230
250
|
// we know the type should be `ScoreConfig`, but we can't rely that it's valid, or the right version
|
|
@@ -233,6 +253,9 @@ export type AA = {
|
|
|
233
253
|
/** if true, only specific email addresses can submit the form */
|
|
234
254
|
auth_list_enabled?: boolean;
|
|
235
255
|
|
|
256
|
+
/** Bot protection challenge type. If set, users must complete a challenge before accessing the wizard. */
|
|
257
|
+
client_challenge_type?: "turnstile" | null;
|
|
258
|
+
|
|
236
259
|
/** Currently Unused Attributes */
|
|
237
260
|
start_date?: Date;
|
|
238
261
|
end_date?: Date;
|
|
@@ -246,6 +269,28 @@ export type AA = {
|
|
|
246
269
|
transitions?: unknown[];
|
|
247
270
|
};
|
|
248
271
|
|
|
272
|
+
export type AAObject = CommonFields<AOId> & {
|
|
273
|
+
aa_id: AId;
|
|
274
|
+
aai_id: IId;
|
|
275
|
+
properties: Json;
|
|
276
|
+
labels: string[];
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
export type InstanceNode = CommonFields<AINId> & {
|
|
280
|
+
aa_id: AId;
|
|
281
|
+
/* The n_id of the shared PO */
|
|
282
|
+
n_id: NId;
|
|
283
|
+
field_list: string[];
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
export type InstanceNodeKey = CommonFields<AINKId> & {
|
|
287
|
+
aa_id: AId;
|
|
288
|
+
aai_id: IId;
|
|
289
|
+
aain_id: AINId;
|
|
290
|
+
field_name: string;
|
|
291
|
+
key_data: string;
|
|
292
|
+
};
|
|
293
|
+
|
|
249
294
|
export type InstanceWithoutData = CommonFields<IId, { message?: string }> & {
|
|
250
295
|
/** ID of the access application this submission was made to */
|
|
251
296
|
aa_id: AId;
|
|
@@ -260,10 +305,10 @@ export type InstanceWithoutData = CommonFields<IId, { message?: string }> & {
|
|
|
260
305
|
thread: string;
|
|
261
306
|
/** The status of a submission */
|
|
262
307
|
state: SubmissionStatus;
|
|
263
|
-
/** Hash of the
|
|
264
|
-
|
|
265
|
-
/**
|
|
266
|
-
|
|
308
|
+
/** Hash of the Merchant ID */
|
|
309
|
+
sub_merchant_hash: string;
|
|
310
|
+
/** Merchant ID (replaces service_provider_n_id) */
|
|
311
|
+
merchant_id: MId;
|
|
267
312
|
|
|
268
313
|
/** added by the client once it calculates the score */
|
|
269
314
|
// Defined as `unknown` instead of `ScoreResult` because it could be nonsense,
|
|
@@ -321,41 +366,46 @@ export type Validation = {
|
|
|
321
366
|
};
|
|
322
367
|
};
|
|
323
368
|
|
|
324
|
-
export type WebhookStatus =
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
provider_webhook_subscription_id: NId;
|
|
332
|
-
status: WebhookStatus;
|
|
333
|
-
/** ISO Date */
|
|
334
|
-
date_created: string;
|
|
335
|
-
/** ISO Date */
|
|
336
|
-
date_updated: string;
|
|
369
|
+
export type WebhookStatus =
|
|
370
|
+
| "PENDING"
|
|
371
|
+
| "SUBSCRIBED"
|
|
372
|
+
| "UNSUBSCRIBED"
|
|
373
|
+
| "UNSUBSCRIBE_FAILED"
|
|
374
|
+
| "ERROR"
|
|
375
|
+
| "ARCHIVED";
|
|
337
376
|
|
|
377
|
+
export type Webhook = CommonFields<WId> & {
|
|
378
|
+
aa_id: AId;
|
|
379
|
+
webhook_processing_rules: unknown;
|
|
380
|
+
provider_subscription_credentials: unknown;
|
|
381
|
+
provider_signature_check_enabled: boolean;
|
|
382
|
+
provider_signature_credentials: unknown;
|
|
383
|
+
webhook_filter_source: string | null;
|
|
338
384
|
webhook_filter_schema: {
|
|
339
385
|
operator: string;
|
|
340
386
|
field_value: string;
|
|
341
387
|
field_name: string;
|
|
342
|
-
};
|
|
343
|
-
webhook_action: { webhook_action_type: string }[];
|
|
344
|
-
webhook_filter_source: string;
|
|
388
|
+
} | null;
|
|
389
|
+
webhook_action: { webhook_action_type: string }[] | null;
|
|
345
390
|
webhook_field_mapping_schema: {
|
|
346
391
|
[key: string]: string;
|
|
347
|
-
};
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
392
|
+
} | null;
|
|
393
|
+
provider_webhook_id: string;
|
|
394
|
+
provider_webhook_subscription_id: string | null;
|
|
395
|
+
subscribe_log?:
|
|
396
|
+
| {
|
|
397
|
+
date: string;
|
|
398
|
+
response_status_code: number;
|
|
399
|
+
response_payload: Json;
|
|
400
|
+
}[]
|
|
401
|
+
| null;
|
|
402
|
+
status: WebhookStatus;
|
|
403
|
+
metadata: unknown;
|
|
353
404
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
}[];
|
|
405
|
+
// Legacy compatibility - these will be computed from the new fields
|
|
406
|
+
wi_id?: WId; // mapped from id
|
|
407
|
+
date_created?: string; // mapped from start_date
|
|
408
|
+
date_updated?: string; // computed or mapped as needed
|
|
359
409
|
};
|
|
360
410
|
|
|
361
411
|
/**
|
|
@@ -371,3 +421,16 @@ export type Link = {
|
|
|
371
421
|
details?: AA;
|
|
372
422
|
isDefault?: boolean;
|
|
373
423
|
};
|
|
424
|
+
|
|
425
|
+
// Used in Permissions - Get for Node
|
|
426
|
+
export type Permission = {
|
|
427
|
+
id: NId;
|
|
428
|
+
n_id: NId;
|
|
429
|
+
labels: string[];
|
|
430
|
+
properties: { permissions: string; provider_name: string };
|
|
431
|
+
user_permission_type: string | null;
|
|
432
|
+
group_permission_type: "VIEWS" | "EDITS" | null;
|
|
433
|
+
group_name: "ALL" | "Public" | `sharing|${UId}|${UId}` | GId;
|
|
434
|
+
is_owner: boolean;
|
|
435
|
+
permission_id: PId;
|
|
436
|
+
};
|
package/src/schema.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type {
|
|
2
|
+
AA,
|
|
3
|
+
CommonFields,
|
|
4
|
+
DataTypes,
|
|
5
|
+
Json,
|
|
6
|
+
SchemaName,
|
|
7
|
+
Urn,
|
|
8
|
+
} from "./raytio";
|
|
3
9
|
import type { WizardConfig } from "./wizard";
|
|
4
10
|
|
|
5
11
|
/** should be renamed since this applies to ConditionallyVerifiable */
|
|
@@ -11,6 +17,15 @@ export type ConditionallyRequired = {
|
|
|
11
17
|
};
|
|
12
18
|
};
|
|
13
19
|
|
|
20
|
+
/** Schema-level conditional tags, evaluated at runtime based on form values */
|
|
21
|
+
export type ConditionalTags = {
|
|
22
|
+
tags: string[];
|
|
23
|
+
// see `isConditionMet` for how this syntax works
|
|
24
|
+
if: {
|
|
25
|
+
[fieldName: string]: (string | number | boolean)[];
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
|
|
14
29
|
export type SchemaFieldTag =
|
|
15
30
|
// legacy (TODO: remove these)
|
|
16
31
|
| "password"
|
|
@@ -29,6 +44,11 @@ export type SchemaFieldTag =
|
|
|
29
44
|
| `display:replace:('${string}', '${string}')`
|
|
30
45
|
| "display:terms_conditions"
|
|
31
46
|
| `display:main_media:${string}` // property name to determine what image to display
|
|
47
|
+
// content block variants (see ContentBlockField)
|
|
48
|
+
| "display:content-block"
|
|
49
|
+
| "display:info"
|
|
50
|
+
| "display:warning"
|
|
51
|
+
| "display:error"
|
|
32
52
|
// date picker components
|
|
33
53
|
| "date_component:day"
|
|
34
54
|
| "date_component:month"
|
|
@@ -41,6 +61,8 @@ export type SchemaFieldTag =
|
|
|
41
61
|
| "action:hash" // creates hash containing specified information
|
|
42
62
|
| "action:require_webauthn"
|
|
43
63
|
| `action:generate_pepper:` // generates a pepper length 'n'
|
|
64
|
+
| `action:timeout:${number}` // for a lookup field. Signifies it should expire after 'n' seconds
|
|
65
|
+
| `action:server-search:${string}` // for a lookup field. Enables server-side search on the specified column(s)
|
|
44
66
|
| "verify:show_if_pending"
|
|
45
67
|
| "special:hide_select_behind_button"
|
|
46
68
|
| "type:capture_geolocation" // triggers the wizard's GeoLocationInput field
|
|
@@ -51,6 +73,7 @@ export type SchemaTag =
|
|
|
51
73
|
| "action:experimental_pass_object_store_id"
|
|
52
74
|
| "action:verify"
|
|
53
75
|
| `action:display_qr_code:${/* either extract or verify */ string}:${/* when to display QR */ string}`
|
|
76
|
+
| `action:display_global_idv_app_qr_code:${/* either extract or verify */ string}`
|
|
54
77
|
// camera
|
|
55
78
|
| "default_camera:rear"
|
|
56
79
|
| "default_camera:front"
|
|
@@ -61,12 +84,15 @@ export type SchemaTag =
|
|
|
61
84
|
| `time:${/* type */ string}:${/* seconds */ number}`
|
|
62
85
|
| `link_to:${/* schemaName */ string}:${/* relationshipType */ string}`
|
|
63
86
|
| "display:default_view:edit" // links profile POcard direct to edit menu
|
|
87
|
+
// bot protection
|
|
88
|
+
| "support_challenge"
|
|
64
89
|
// type
|
|
65
|
-
| "type:
|
|
90
|
+
| "type:merchant"
|
|
66
91
|
| "type:service_offer"
|
|
67
92
|
| "type:marketplace"
|
|
68
93
|
| "type:client_only"
|
|
69
|
-
| "type:globally_unique_field"
|
|
94
|
+
| "type:globally_unique_field"
|
|
95
|
+
| "type:application_object";
|
|
70
96
|
|
|
71
97
|
export type SchemaField = {
|
|
72
98
|
/** @deprecated don't use, it's inconsistent */
|
|
@@ -88,9 +114,9 @@ export type SchemaField = {
|
|
|
88
114
|
step?: number;
|
|
89
115
|
/** if true, the user must have encryption enabled to save this data, see #1324 */
|
|
90
116
|
encrypt_require?: boolean;
|
|
91
|
-
/**
|
|
117
|
+
/** for string inputs, the maximum character length. Also used to determine textarea rendering (maxLength > 30 renders a textarea) */
|
|
92
118
|
maxLength?: number;
|
|
93
|
-
/**
|
|
119
|
+
/** for string inputs, the minimum character length. Not currently used anywhere in the client */
|
|
94
120
|
minLength?: number;
|
|
95
121
|
/** the default value */
|
|
96
122
|
default?: unknown;
|
|
@@ -146,12 +172,40 @@ export type SchemaField = {
|
|
|
146
172
|
content?: string;
|
|
147
173
|
/** URL to a JSON file in the `Lookup` format */
|
|
148
174
|
lookup?: string;
|
|
175
|
+
/**
|
|
176
|
+
* Transforms the lookup response into the expected `{ key, value }[]` format.
|
|
177
|
+
* Use when the API returns data in a different structure.
|
|
178
|
+
*
|
|
179
|
+
* Simple format (extract array from path, use values as both key and value):
|
|
180
|
+
* ```json
|
|
181
|
+
* "lookupTransform": "[0].scopes"
|
|
182
|
+
* ```
|
|
183
|
+
*
|
|
184
|
+
* Object format (specify key/value mapping):
|
|
185
|
+
* ```json
|
|
186
|
+
* "lookupTransform": {
|
|
187
|
+
* "path": "[0].items",
|
|
188
|
+
* "key": "id",
|
|
189
|
+
* "value": "name"
|
|
190
|
+
* }
|
|
191
|
+
* ```
|
|
192
|
+
*/
|
|
193
|
+
lookupTransform?:
|
|
194
|
+
| string
|
|
195
|
+
| {
|
|
196
|
+
/** JSON path to extract the array (e.g., "[0].scopes", "data.items") */
|
|
197
|
+
path: string;
|
|
198
|
+
/** Property name to use as the lookup key (if omitted, uses the value itself) */
|
|
199
|
+
key?: string;
|
|
200
|
+
/** Property name to use as the lookup value (if omitted, uses the value itself) */
|
|
201
|
+
value?: string;
|
|
202
|
+
};
|
|
149
203
|
/** @internal the client adds this - it's the fieldName. */
|
|
150
204
|
$prop: string;
|
|
151
205
|
priority?: number;
|
|
152
206
|
/** @internal if supplied, it's the existing field values. Added by the client */
|
|
153
207
|
subObjectRef?: unknown[];
|
|
154
|
-
/**
|
|
208
|
+
/** @deprecated Markdown is now rendered by default for all descriptions. This property is no longer needed. */
|
|
155
209
|
description_decorator?: "md";
|
|
156
210
|
/** if a `pattern` is specified, this is the error message */
|
|
157
211
|
patternMessage?: string;
|
|
@@ -191,12 +245,25 @@ export type SchemaField = {
|
|
|
191
245
|
/** the only difference between the client & server's definition is that the client adds `$prop` */
|
|
192
246
|
export type ServerSchemaField = Omit<SchemaField, "$prop">;
|
|
193
247
|
|
|
248
|
+
/** An i18n entry from the fnd_i18n_entries API endpoint */
|
|
249
|
+
export type FndI18nEntry = CommonFields<never> & {
|
|
250
|
+
i18n_key: string;
|
|
251
|
+
category: string;
|
|
252
|
+
translations: {
|
|
253
|
+
[locale: string]: {
|
|
254
|
+
title: string;
|
|
255
|
+
description?: string;
|
|
256
|
+
title_plural?: string;
|
|
257
|
+
};
|
|
258
|
+
};
|
|
259
|
+
};
|
|
260
|
+
|
|
194
261
|
/** not exported. Attributes that are identical in both client schema & server schema */
|
|
195
262
|
export type CommonSchemaAttributes = {
|
|
196
263
|
/** these fields will always exist on schema */
|
|
197
264
|
title: string;
|
|
198
265
|
description: string;
|
|
199
|
-
/**
|
|
266
|
+
/** @deprecated Markdown is now rendered by default for all descriptions. This property is no longer needed. */
|
|
200
267
|
description_decorator?: "md";
|
|
201
268
|
|
|
202
269
|
schema_type?: SchemaType;
|
|
@@ -207,11 +274,22 @@ export type CommonSchemaAttributes = {
|
|
|
207
274
|
/**
|
|
208
275
|
* the group that a schema belongs to, such as "passports". This is useful for
|
|
209
276
|
* forms that accept different types of similar documents.
|
|
277
|
+
* Can be a single group (string) or multiple groups (string[]) to allow a schema
|
|
278
|
+
* to appear in multiple lists.
|
|
210
279
|
*/
|
|
211
|
-
schema_group?: string;
|
|
280
|
+
schema_group?: string | string[];
|
|
281
|
+
|
|
282
|
+
/** Additional search terms to help users find schemas (e.g., ["license", "passport", "drivers license"]) */
|
|
283
|
+
search_terms?: string[];
|
|
212
284
|
|
|
213
285
|
tags?: SchemaTag[];
|
|
214
286
|
|
|
287
|
+
/** if specified, suggests this onboarding scenario after creating a PO of this schema type */
|
|
288
|
+
suggest_post_create?: SchemaName;
|
|
289
|
+
|
|
290
|
+
/** Array of 2-character country codes that this schema is available for */
|
|
291
|
+
schema_country_codes?: string[];
|
|
292
|
+
|
|
215
293
|
/* any overrides can be specfied per field or for the whole schema */
|
|
216
294
|
i18n?: {
|
|
217
295
|
[locale: string]: {
|
|
@@ -294,41 +372,140 @@ export type CommonSchemaAttributes = {
|
|
|
294
372
|
* view or deafult view
|
|
295
373
|
*/
|
|
296
374
|
compact_table?: boolean;
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* Pre-defined filter presets provided by the schema author.
|
|
378
|
+
* These appear as "Default filters" in the admin table UI and
|
|
379
|
+
* cannot be deleted by users (unlike user-saved filters).
|
|
380
|
+
*
|
|
381
|
+
* Each token's `propertyKey` must match a key in `properties`.
|
|
382
|
+
* Valid operators: `=`, `!=`, `:`, `!:`, `>`, `<`, `>=`, `<=`
|
|
383
|
+
*/
|
|
384
|
+
filters?: {
|
|
385
|
+
/** Display name for the filter preset */
|
|
386
|
+
name: string;
|
|
387
|
+
/** How tokens are combined: "and" = all must match, "or" = any must match */
|
|
388
|
+
operation: "and" | "or";
|
|
389
|
+
/** Filter conditions */
|
|
390
|
+
tokens: {
|
|
391
|
+
/** Must match a key in schema `properties` */
|
|
392
|
+
propertyKey: string;
|
|
393
|
+
/** Comparison operator */
|
|
394
|
+
operator: string;
|
|
395
|
+
/** Value to compare against */
|
|
396
|
+
value: string;
|
|
397
|
+
}[];
|
|
398
|
+
}[];
|
|
399
|
+
|
|
400
|
+
/** Kanban board configuration for admin dashboard */
|
|
401
|
+
kanban?: {
|
|
402
|
+
/** Field that determines which column a card belongs to */
|
|
403
|
+
column_field?: string;
|
|
404
|
+
/** Field displayed as the card title */
|
|
405
|
+
title_field?: string;
|
|
406
|
+
/** Additional fields displayed on each card */
|
|
407
|
+
card_fields?: string[];
|
|
408
|
+
};
|
|
297
409
|
};
|
|
298
410
|
|
|
299
411
|
/** only the schema used for the onboarding wizard have this property */
|
|
300
412
|
onboard_properties?: {
|
|
301
|
-
/**
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
413
|
+
/**
|
|
414
|
+
* High-level actions for complex workflows.
|
|
415
|
+
* create_organization: Single object for creating one organization
|
|
416
|
+
* create_access_application_link: Array for creating multiple links
|
|
417
|
+
*/
|
|
418
|
+
actions?: {
|
|
419
|
+
/** Creates a single organization. Use this instead of legacy 'organizations' array. */
|
|
420
|
+
create_organization?: Array<{
|
|
421
|
+
properties: Json;
|
|
422
|
+
store_as?: string; // alias used to reference the created organization
|
|
423
|
+
}>;
|
|
424
|
+
/** Creates access application links (can be multiple) */
|
|
425
|
+
create_access_application_link?: Array<{
|
|
426
|
+
properties: Record<string, unknown>;
|
|
427
|
+
store_as?: string;
|
|
428
|
+
}>;
|
|
429
|
+
/** Other actions can be defined as needed */
|
|
430
|
+
[key: string]: any;
|
|
431
|
+
};
|
|
432
|
+
/**
|
|
433
|
+
* Execution order for entity creation. If not specified, uses default order.
|
|
434
|
+
* Examples: ["actions.create_organization", "db.v1.xrm_merchants", "db.v1.dsm_nodes"]
|
|
435
|
+
*/
|
|
436
|
+
execution_order?: string[];
|
|
315
437
|
|
|
316
438
|
/**
|
|
317
|
-
*
|
|
318
|
-
*
|
|
439
|
+
* Generic API endpoints organized by namespace and version.
|
|
440
|
+
*
|
|
441
|
+
* Structure: `{namespace}.{version}.{endpoint_name}` → `POST /{namespace}/{version}/{endpoint_name}`
|
|
442
|
+
*
|
|
443
|
+
* Examples:
|
|
444
|
+
* - `db.v1.xrm_merchants` → `POST /db/v1/xrm_merchants`
|
|
445
|
+
* - `db.v2.something` → `POST /db/v2/something`
|
|
446
|
+
* - `persist.v2.endpoint` → `POST /persist/v2/endpoint`
|
|
447
|
+
*
|
|
448
|
+
* Any namespace can be used. The `db` namespace is shown below as the primary example.
|
|
319
449
|
*/
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
450
|
+
db?: {
|
|
451
|
+
v1?: {
|
|
452
|
+
/** Profile objects - POST /db/v1/dsm_nodes */
|
|
453
|
+
dsm_nodes?: Array<{
|
|
454
|
+
labels?: string[];
|
|
455
|
+
properties: Record<string, unknown>;
|
|
456
|
+
schema_name?: SchemaName;
|
|
457
|
+
}>;
|
|
458
|
+
|
|
459
|
+
/** Merchants - POST /db/v1/xrm_merchants */
|
|
460
|
+
xrm_merchants?: Array<Record<string, unknown>>;
|
|
461
|
+
|
|
462
|
+
/** Access Applications - POST /db/v1/dsm_access_applications */
|
|
463
|
+
dsm_access_applications?: Array<
|
|
464
|
+
Omit<AA, "org_id" | "a_id"> & {
|
|
465
|
+
org_id?: string;
|
|
466
|
+
links?: {
|
|
467
|
+
description: string;
|
|
468
|
+
wizardConfig: Omit<WizardConfig, "a_id">;
|
|
469
|
+
}[];
|
|
470
|
+
}
|
|
471
|
+
>;
|
|
472
|
+
|
|
473
|
+
/** Relationships - POST /db/v1/dsm_node_relationships */
|
|
474
|
+
dsm_node_relationships?: Array<{
|
|
475
|
+
from: string;
|
|
476
|
+
to: string;
|
|
477
|
+
type: string;
|
|
478
|
+
properties?: Record<string, unknown>;
|
|
479
|
+
}>;
|
|
480
|
+
|
|
481
|
+
/** Extensible for any other endpoint */
|
|
482
|
+
[endpoint: string]: Array<Record<string, unknown>> | undefined;
|
|
483
|
+
};
|
|
484
|
+
v2?: {
|
|
485
|
+
[endpoint: string]: Array<Record<string, unknown>> | undefined;
|
|
486
|
+
};
|
|
487
|
+
[version: string]:
|
|
488
|
+
| {
|
|
489
|
+
[endpoint: string]: Array<Record<string, unknown>> | undefined;
|
|
490
|
+
}
|
|
491
|
+
| undefined;
|
|
492
|
+
};
|
|
493
|
+
/**
|
|
494
|
+
* Additional namespaces can be added following the same structure as `db`.
|
|
495
|
+
* Example: persist?: { v2?: { [endpoint: string]: Array<Record<string, unknown>> } }
|
|
496
|
+
*/
|
|
497
|
+
[namespace: string]:
|
|
498
|
+
| {
|
|
499
|
+
[version: string]:
|
|
500
|
+
| {
|
|
501
|
+
[endpoint: string]: Array<Record<string, unknown>> | undefined;
|
|
502
|
+
}
|
|
503
|
+
| undefined;
|
|
504
|
+
}
|
|
505
|
+
| object // for actions
|
|
506
|
+
| string[] // for execution_order
|
|
507
|
+
| string // for return_to
|
|
508
|
+
| undefined;
|
|
332
509
|
|
|
333
510
|
/** The relative path in the client to redirect to once finished. May include variables */
|
|
334
511
|
return_to?: string;
|
|
@@ -346,6 +523,12 @@ export type Schema = CommonSchemaAttributes & {
|
|
|
346
523
|
/** added by client */
|
|
347
524
|
type?: DataTypes;
|
|
348
525
|
|
|
526
|
+
/**
|
|
527
|
+
* Schema-level conditional tags, pre-processed for runtime evaluation.
|
|
528
|
+
* When form values match the `if` condition, the tags are added to the schema.
|
|
529
|
+
*/
|
|
530
|
+
conditionalTags?: ConditionalTags[];
|
|
531
|
+
|
|
349
532
|
/** the localized title of the `schema_group`. added by the client */
|
|
350
533
|
group_title?: string;
|
|
351
534
|
|
|
@@ -373,12 +556,47 @@ export type Schema = CommonSchemaAttributes & {
|
|
|
373
556
|
* In this case, this attribute defines what database table we need to use
|
|
374
557
|
* to fetch the corresponding data, and which field is the primary_key of that
|
|
375
558
|
* table (e.g. `id`, `o_id` etc.)
|
|
559
|
+
*
|
|
560
|
+
* The `path` property specifies the complete API path to use. If not provided,
|
|
561
|
+
* defaults to `/db/v1/{table}`. When `path` is specified, it is used directly
|
|
562
|
+
* without appending the table name.
|
|
563
|
+
* Examples:
|
|
564
|
+
* - `path: "/db/v1/rpc/my_function"` for RPC endpoints
|
|
565
|
+
* - `path: "/api/v2/custom_endpoint"` for custom API paths
|
|
566
|
+
*
|
|
567
|
+
* The optional `select` parameter supports PostgREST select syntax for nested
|
|
568
|
+
* objects/arrays. For example:
|
|
569
|
+
* `select: "id,item_id,gpm_items(id,item_key)"`
|
|
570
|
+
* This will return nested objects in the response.
|
|
376
571
|
*/
|
|
377
|
-
database?: {
|
|
572
|
+
database?: {
|
|
573
|
+
/** Table name (required when path is not specified to construct `/db/v1/{table}`) */
|
|
574
|
+
table?: string;
|
|
575
|
+
primary_key: string;
|
|
576
|
+
/** Complete API path. If specified, used directly instead of `/db/v1/{table}` */
|
|
577
|
+
path?: string;
|
|
578
|
+
select?: string;
|
|
579
|
+
/** Schema to redirect to after creating a record (for insert schemas) */
|
|
580
|
+
return_to?: SchemaName;
|
|
581
|
+
/** HTTP method override. If specified, uses this instead of the default (POST for create, PATCH for edit, DELETE for delete) */
|
|
582
|
+
method?: "POST" | "PATCH" | "DELETE";
|
|
583
|
+
/**
|
|
584
|
+
* PostgREST query parameters to include in requests.
|
|
585
|
+
* Supports variable substitution: {$context.organizationId}, {$context.userId}, {$context.tenantId}
|
|
586
|
+
* Example: "org_id=eq.{$context.organizationId}&active=eq.true"
|
|
587
|
+
* If this contains "select=", it takes precedence over the `select` property.
|
|
588
|
+
*/
|
|
589
|
+
query_parameters?: string;
|
|
590
|
+
};
|
|
378
591
|
|
|
379
592
|
/** the client adds this after processing the i18n property */
|
|
380
593
|
groupNames?: Record<string, string>;
|
|
381
594
|
|
|
595
|
+
/** specifies the order in which groups should be displayed */
|
|
596
|
+
groups?: {
|
|
597
|
+
order?: string[];
|
|
598
|
+
};
|
|
599
|
+
|
|
382
600
|
/** added by the client to inform downstream components which locale from schema.i18n was used */
|
|
383
601
|
clientLocale?: string;
|
|
384
602
|
|
|
@@ -399,7 +617,7 @@ export type Schema = CommonSchemaAttributes & {
|
|
|
399
617
|
};
|
|
400
618
|
|
|
401
619
|
/** Type Classification of a Schema returned by API */
|
|
402
|
-
export type SchemaType = "ss" | "ps" | "us";
|
|
620
|
+
export type SchemaType = "ss" | "ps" | "us" | "ms";
|
|
403
621
|
|
|
404
622
|
/** This is what's returned by the API */
|
|
405
623
|
export type WrappedSchema = {
|
|
@@ -416,6 +634,10 @@ export type WrappedSchema = {
|
|
|
416
634
|
|
|
417
635
|
/** whether the \`version\` is the latest version */
|
|
418
636
|
version_current: boolean;
|
|
637
|
+
|
|
638
|
+
/** Country codes that this schema is available for */
|
|
639
|
+
schema_country_codes?: string[];
|
|
640
|
+
|
|
419
641
|
schema: CommonSchemaAttributes & {
|
|
420
642
|
/** @deprecated don't use this */
|
|
421
643
|
$id?: string;
|