@raytio/types 8.2.0 → 8.3.1
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 +8 -3
- package/dist/schema.d.ts +61 -6
- package/package.json +1 -1
- package/src/schema.ts +141 -82
package/README.md
CHANGED
|
@@ -346,7 +346,7 @@ not exported. Attributes that are identical in both client schema & server schem
|
|
|
346
346
|
| :------ | :------ | :------ |
|
|
347
347
|
| `description` | `string` | - |
|
|
348
348
|
| `description_decorator?` | ``"md"`` | **`Deprecated`** Markdown is now rendered by default for all descriptions. This property is no longer needed. |
|
|
349
|
-
| `display?` | { `compact_table?`: `boolean` ; `expand?`: { `fields`: `string`[] ; `label`: `string` }[] ; `filters?`: { `name`: `string` ; `operation`: ``"and"`` \| ``"or"`` ; `tokens`: { `operator`: `string` ; `propertyKey`: `string` ; `value`: `string` }[] }[] ; `head_main?`: { `fields`: `string`[] ; `format?`: `string` } ; `head_sub?`: { `fields`: `string`[] ; `format?`: `string` } ; `kanban?`: { `card_fields?`: `string`[] ; `column_field?`: `string` ; `title_field?`: `string` } ; `tabular?`: { `fields`: `string`[] } } | - |
|
|
349
|
+
| `display?` | { `compact_table?`: `boolean` ; `expand?`: { `fields`: `string`[] ; `label`: `string` }[] ; `filters?`: { `name`: `string` ; `operation`: ``"and"`` \| ``"or"`` ; `tokens`: { `operator`: `string` ; `propertyKey`: `string` ; `value`: `string` }[] }[] ; `head_main?`: { `fields`: `string`[] ; `format?`: `string` } ; `head_sub?`: { `fields`: `string`[] ; `format?`: `string` } ; `kanban?`: { `card_fields?`: `string`[] ; `column_field?`: `string` ; `title_field?`: `string` } ; `tabular?`: { `fields`: `string`[] } ; `views?`: { `columnPrefs?`: { `id`: `string` ; `visible`: `boolean` }[] ; `contentDensity?`: ``"comfortable"`` \| ``"compact"`` ; `filter?`: { `operation`: ``"and"`` \| ``"or"`` ; `tokens`: { `operator`: `string` ; `propertyKey`: `string` ; `value`: `string` }[] } ; `name`: `string` ; `pageSize?`: `number` ; `sorting?`: { `isDescending`: `boolean` ; `sortingColumn`: `string` } \| ``null`` ; `stickyColumns?`: { `first`: `number` ; `last`: `number` } ; `stripedRows?`: `boolean` ; `wrapLines?`: `boolean` }[] } | - |
|
|
350
350
|
| `display.compact_table?` | `boolean` | determines if profile pages should display using compacted 'MiniPO' view or deafult view |
|
|
351
351
|
| `display.expand?` | { `fields`: `string`[] ; `label`: `string` }[] | list of fields that should not be shown by default, unless you expand a collpase section which has a name from the label property. Array because there could be multiple expand groups |
|
|
352
352
|
| `display.filters?` | { `name`: `string` ; `operation`: ``"and"`` \| ``"or"`` ; `tokens`: { `operator`: `string` ; `propertyKey`: `string` ; `value`: `string` }[] }[] | Pre-defined filter presets provided by the schema author. These appear as "Default filters" in the admin table UI and cannot be deleted by users (unlike user-saved filters). Each token's `propertyKey` must match a key in `properties`. Valid operators: `=`, `!=`, `:`, `!:`, `>`, `<`, `>=`, `<=` |
|
|
@@ -362,6 +362,7 @@ not exported. Attributes that are identical in both client schema & server schem
|
|
|
362
362
|
| `display.kanban.title_field?` | `string` | Field displayed as the card title |
|
|
363
363
|
| `display.tabular?` | { `fields`: `string`[] } | By default, the admin dashboard shows columns for all fields in listed in `head_main`. In rare cases you can use this property to specify a different set of fields to show to admins by default. |
|
|
364
364
|
| `display.tabular.fields` | `string`[] | - |
|
|
365
|
+
| `display.views?` | { `columnPrefs?`: { `id`: `string` ; `visible`: `boolean` }[] ; `contentDensity?`: ``"comfortable"`` \| ``"compact"`` ; `filter?`: { `operation`: ``"and"`` \| ``"or"`` ; `tokens`: { `operator`: `string` ; `propertyKey`: `string` ; `value`: `string` }[] } ; `name`: `string` ; `pageSize?`: `number` ; `sorting?`: { `isDescending`: `boolean` ; `sortingColumn`: `string` } \| ``null`` ; `stickyColumns?`: { `first`: `number` ; `last`: `number` } ; `stripedRows?`: `boolean` ; `wrapLines?`: `boolean` }[] | Pre-defined view presets provided by the schema author. A view bundles filter, sorting, column visibility/order, and display settings (page size, density, etc.) into a named configuration. These appear as "Default views" in the admin table UI and cannot be deleted by users (unlike user-saved views). Every field except `name` is optional. When applied, fields the view does not specify leave the user's current preference untouched. This lets a schema author define partial views (e.g. just sorting + columns). |
|
|
365
366
|
| `i18n?` | { `[locale: string]`: { `[fieldNameOrGroupName: string]`: [`ServerSchemaField`](#serverschemafield) & { `title_plural?`: `string` }; `$loading_create_sub_obj`: { `title`: `string` } ; `$loading_delete_pending_ver`: { `title`: `string` } ; `$loading_extract`: { `title`: `string` } ; `$loading_link_to_person`: { `title`: `string` } ; `$loading_long_verification_message`: { `description?`: `string` ; `title?`: `string` } ; `$loading_pending_ver_resubmit`: { `title`: `string` } ; `$loading_permission`: { `title`: `string` } ; `$loading_save`: { `title`: `string` } ; `$loading_update`: { `title`: `string` } ; `$loading_upload`: { `title`: `string` } ; `$loading_verify`: { `title`: `string` } ; `$schema`: { `description?`: `string` ; `title`: `string` ; `title_plural?`: `string` } }; } | - |
|
|
366
367
|
| `onboard_properties?` | { `[namespace: string]`: { `[version: string]`: { `[endpoint: string]`: `Record`<`string`, `unknown`\>[] \| `undefined`; } \| `undefined`; } \| `object` \| `string`[] \| `string` \| `undefined`; `actions?`: { `[key: string]`: `any`; `create_access_application_link?`: { `properties`: `Record`<`string`, `unknown`\> ; `store_as?`: `string` }[] ; `create_organization?`: { `properties`: `Json` ; `store_as?`: `string` }[] } ; `db?`: { `[version: string]`: { `[endpoint: string]`: `Record`<`string`, `unknown`\>[] \| `undefined`; } \| `undefined`; `v1?`: { `[endpoint: string]`: `Record`<`string`, `unknown`\>[] \| `undefined`; `dsm_access_applications?`: `Omit`<[`AA`](#aa), ``"org_id"`` \| ``"a_id"``\> & { `links?`: { `description`: `string` ; `wizardConfig`: `Omit`<[`WizardConfig`](#wizardconfig), ``"a_id"``\> }[] ; `org_id?`: `string` }[] ; `dsm_node_relationships?`: { `from`: `string` ; `properties?`: `Record`<`string`, `unknown`\> ; `to`: `string` ; `type`: `string` }[] ; `dsm_nodes?`: { `labels?`: `string`[] ; `properties`: `Record`<`string`, `unknown`\> ; `schema_name?`: [`SchemaName`](#schemaname) }[] ; `xrm_merchants?`: `Record`<`string`, `unknown`\>[] } ; `v2?`: { `[endpoint: string]`: `Record`<`string`, `unknown`\>[] \| `undefined`; } } ; `execution_order?`: `string`[] ; `return_to?`: `string` } | only the schema used for the onboarding wizard have this property |
|
|
367
368
|
| `onboard_properties.actions?` | { `[key: string]`: `any`; `create_access_application_link?`: { `properties`: `Record`<`string`, `unknown`\> ; `store_as?`: `string` }[] ; `create_organization?`: { `properties`: `Json` ; `store_as?`: `string` }[] } | High-level actions for complex workflows. create_organization: Single object for creating one organization create_access_application_link: Array for creating multiple links |
|
|
@@ -993,7 +994,7 @@ ___
|
|
|
993
994
|
|
|
994
995
|
### Schema
|
|
995
996
|
|
|
996
|
-
Ƭ **Schema**: [`CommonSchemaAttributes`](#commonschemaattributes) & { `clientLocale?`: `string` ; `conditionalTags?`: [`ConditionalTags`](#conditionaltags)[] ; `database?`: { `method?`: ``"POST"`` \| ``"PATCH"`` \| ``"DELETE"`` ; `path?`: `string` ; `primary_key`: `string` ; `query_parameters?`: `string` ; `return_to?`: [`SchemaName`](#schemaname) ; `select?`: `string` ; `table?`: `string` } ; `
|
|
997
|
+
Ƭ **Schema**: [`CommonFields`](#commonfields)<`never`\> & [`CommonSchemaAttributes`](#commonschemaattributes) & { `clientLocale?`: `string` ; `conditionalTags?`: [`ConditionalTags`](#conditionaltags)[] ; `database?`: { `method?`: ``"POST"`` \| ``"PATCH"`` \| ``"DELETE"`` ; `path?`: `string` ; `primary_key`: `string` ; `query_parameters?`: `string` ; `return_to?`: [`SchemaName`](#schemaname) ; `select?`: `string` ; `table?`: `string` } ; `groupNames?`: `Record`<`string`, `string`\> ; `group_title?`: `string` ; `groups?`: { `order?`: `string`[] } ; `isProfileSchema?`: `boolean` ; `isSpSchema?`: `boolean` ; `name`: [`SchemaName`](#schemaname) ; `properties`: { `[fieldName: string]`: [`SchemaField`](#schemafield); } ; `required?`: (`string` \| [`ConditionallyRequired`](#conditionallyrequired))[] ; `timing?`: `Record`<``"extract"`` \| ``"live_person"`` \| ``"verify_pending_delay"``, `number`\> ; `type?`: [`DataTypes`](#datatypes) ; `verified_fields?`: (`string` \| [`ConditionallyRequired`](#conditionallyrequired))[] ; `version`: `string` ; `wasExpandedByClient?`: `boolean` }
|
|
997
998
|
|
|
998
999
|
Raytio's variant of JSON Schema, as used by the client. It is a modified version
|
|
999
1000
|
of what the API returns.
|
|
@@ -1056,7 +1057,7 @@ ___
|
|
|
1056
1057
|
|
|
1057
1058
|
### SchemaFieldTag
|
|
1058
1059
|
|
|
1059
|
-
Ƭ **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}\` \| ``"display:content-block"`` \| ``"display:info"`` \| ``"display:warning"`` \| ``"display:error"`` \| ``"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:"`` \| \`action:timeout:${number}\` \| \`action:server-search:${string}\` \| ``"verify:show_if_pending"`` \| ``"special:hide_select_behind_button"`` \| ``"type:capture_geolocation"`` \| ``"type:extract_required"``
|
|
1060
|
+
Ƭ **SchemaFieldTag**: ``"password"`` \| \`group:${string}\` \| \`upload-group:${string}\` \| ``"display:stars"`` \| ``"display:no_autofill"`` \| ``"display:currency"`` \| \`display:currency:${string}\` \| ``"display:checkbox"`` \| ``"display:radio"`` \| ``"display:cascade"`` \| ``"display:survey"`` \| ``"display:quoting"`` \| ``"display:customModal"`` \| ``"display:mask"`` \| \`display:replace:('${string}', '${string}')\` \| ``"display:terms_conditions"`` \| \`display:main\_media:${string}\` \| ``"display:markdown"`` \| ``"display:content-block"`` \| ``"display:info"`` \| ``"display:warning"`` \| ``"display:error"`` \| ``"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:"`` \| \`action:timeout:${number}\` \| \`action:server-search:${string}\` \| ``"verify:show_if_pending"`` \| ``"special:hide_select_behind_button"`` \| ``"type:capture_geolocation"`` \| ``"type:extract_required"``
|
|
1060
1061
|
|
|
1061
1062
|
___
|
|
1062
1063
|
|
|
@@ -1348,6 +1349,10 @@ This is what's returned by the API
|
|
|
1348
1349
|
| :------ | :------ | :------ |
|
|
1349
1350
|
| `active` | ``true`` | - |
|
|
1350
1351
|
| `end_date` | `string` | ISO Date. If this tag exists, the schema is deprecated. |
|
|
1352
|
+
| `extends_schema_name?` | [`SchemaName`](#schemaname) \| ``null`` | Base schema to extend (same tenant). NULL = not an extension. |
|
|
1353
|
+
| `extends_schema_version?` | `string` \| ``null`` | Pin to specific base schema version. NULL = use version_current. |
|
|
1354
|
+
| `resource_group?` | `string` | CommonFields row metadata — the polymorphic entity this schema maps to. |
|
|
1355
|
+
| `resource_name?` | `string` | - |
|
|
1351
1356
|
| `schema` | [`CommonSchemaAttributes`](#commonschemaattributes) & { `$id?`: `string` ; `$schema?`: `string` ; `allOf?`: { `$ref?`: `string` ; `if?`: `Partial`<[`WrappedSchema`](#wrappedschema)[``"schema"``]\> ; `then?`: `Partial`<[`WrappedSchema`](#wrappedschema)[``"schema"``]\> }[] ; `definitions?`: `Record`<`string`, { `$ref`: [`Urn`](#urn) }\> ; `properties`: { `[fieldName: string]`: [`ServerSchemaField`](#serverschemafield); } ; `required?`: `string`[] ; `verified_fields?`: `string`[] } | - |
|
|
1352
1357
|
| `schema_country_codes?` | `string`[] | Country codes that this schema is available for |
|
|
1353
1358
|
| `schema_name` | [`SchemaName`](#schemaname) | Schema Name Type and Version Properties |
|
package/dist/schema.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export type ConditionalTags = {
|
|
|
14
14
|
[fieldName: string]: (string | number | boolean)[];
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
|
-
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}` | "display:content-block" | "display:info" | "display:warning" | "display:error" | "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:` | `action:timeout:${number}` | `action:server-search:${string}` | "verify:show_if_pending" | "special:hide_select_behind_button" | "type:capture_geolocation" | "type:extract_required";
|
|
17
|
+
export type SchemaFieldTag = "password" | `group:${string}` | `upload-group:${string}` | "display:stars" | "display:no_autofill" | "display:currency" | `display:currency:${string}` | "display:checkbox" | "display:radio" | "display:cascade" | "display:survey" | "display:quoting" | "display:customModal" | "display:mask" | `display:replace:('${string}', '${string}')` | "display:terms_conditions" | `display:main_media:${string}` | "display:markdown" | "display:content-block" | "display:info" | "display:warning" | "display:error" | "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:` | `action:timeout:${number}` | `action:server-search:${string}` | "verify:show_if_pending" | "special:hide_select_behind_button" | "type:capture_geolocation" | "type:extract_required";
|
|
18
18
|
export type SchemaTag = "action:experimental_pass_object_store_id" | "action:verify" | `action:display_qr_code:${string}:${string}` | `action:display_global_idv_app_qr_code:${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" | "support_challenge" | "type:merchant" | "type:service_offer" | "type:marketplace" | "type:client_only" | "type:globally_unique_field" | "type:application_object";
|
|
19
19
|
export type SchemaField = {
|
|
20
20
|
/** @deprecated don't use, it's inconsistent */
|
|
@@ -319,6 +319,58 @@ export type CommonSchemaAttributes = {
|
|
|
319
319
|
value: string;
|
|
320
320
|
}[];
|
|
321
321
|
}[];
|
|
322
|
+
/**
|
|
323
|
+
* Pre-defined view presets provided by the schema author.
|
|
324
|
+
* A view bundles filter, sorting, column visibility/order, and display
|
|
325
|
+
* settings (page size, density, etc.) into a named configuration.
|
|
326
|
+
* These appear as "Default views" in the admin table UI and cannot be
|
|
327
|
+
* deleted by users (unlike user-saved views).
|
|
328
|
+
*
|
|
329
|
+
* Every field except `name` is optional. When applied, fields the view
|
|
330
|
+
* does not specify leave the user's current preference untouched. This
|
|
331
|
+
* lets a schema author define partial views (e.g. just sorting + columns).
|
|
332
|
+
*/
|
|
333
|
+
views?: {
|
|
334
|
+
/** Display name for the view preset */
|
|
335
|
+
name: string;
|
|
336
|
+
/** Filter to apply (PropertyFilter tokens + operation) */
|
|
337
|
+
filter?: {
|
|
338
|
+
/** How tokens are combined: "and" = all must match, "or" = any must match */
|
|
339
|
+
operation: "and" | "or";
|
|
340
|
+
/** Filter conditions */
|
|
341
|
+
tokens: {
|
|
342
|
+
/** Must match a key in schema `properties` */
|
|
343
|
+
propertyKey: string;
|
|
344
|
+
/** Comparison operator */
|
|
345
|
+
operator: string;
|
|
346
|
+
/** Value to compare against */
|
|
347
|
+
value: string;
|
|
348
|
+
}[];
|
|
349
|
+
};
|
|
350
|
+
/** Server-side sorting state, or `null` to explicitly clear sorting */
|
|
351
|
+
sorting?: {
|
|
352
|
+
sortingColumn: string;
|
|
353
|
+
isDescending: boolean;
|
|
354
|
+
} | null;
|
|
355
|
+
/** Column visibility + order. `id` must match a key in `properties`. */
|
|
356
|
+
columnPrefs?: {
|
|
357
|
+
id: string;
|
|
358
|
+
visible: boolean;
|
|
359
|
+
}[];
|
|
360
|
+
/** Page size (rows per page) */
|
|
361
|
+
pageSize?: number;
|
|
362
|
+
/** Whether to wrap cell content onto multiple lines */
|
|
363
|
+
wrapLines?: boolean;
|
|
364
|
+
/** Whether alternating rows are striped */
|
|
365
|
+
stripedRows?: boolean;
|
|
366
|
+
/** Density of the table content */
|
|
367
|
+
contentDensity?: "comfortable" | "compact";
|
|
368
|
+
/** Number of sticky columns pinned to the start/end of the table */
|
|
369
|
+
stickyColumns?: {
|
|
370
|
+
first: number;
|
|
371
|
+
last: number;
|
|
372
|
+
};
|
|
373
|
+
}[];
|
|
322
374
|
/** Kanban board configuration for admin dashboard */
|
|
323
375
|
kanban?: {
|
|
324
376
|
/** Field that determines which column a card belongs to */
|
|
@@ -419,7 +471,7 @@ export type CommonSchemaAttributes = {
|
|
|
419
471
|
* Raytio's variant of JSON Schema, as used by the client. It is a modified version
|
|
420
472
|
* of what the API returns.
|
|
421
473
|
*/
|
|
422
|
-
export type Schema = CommonSchemaAttributes & {
|
|
474
|
+
export type Schema = CommonFields<never> & CommonSchemaAttributes & {
|
|
423
475
|
/** added by the client, copied from {@link WrappedSchema} */
|
|
424
476
|
name: SchemaName;
|
|
425
477
|
/** added by client */
|
|
@@ -437,10 +489,6 @@ export type Schema = CommonSchemaAttributes & {
|
|
|
437
489
|
required?: (string | ConditionallyRequired)[];
|
|
438
490
|
/** added by client */
|
|
439
491
|
wasExpandedByClient?: boolean;
|
|
440
|
-
/** ISO Date. Copied from {@link WrappedSchema} */
|
|
441
|
-
start_date?: string;
|
|
442
|
-
/** ISO Date. Copied from {@link WrappedSchema} If this tag exists, the schema is deprecated */
|
|
443
|
-
end_date?: string;
|
|
444
492
|
/** 🚨 Note that there are cases where properties are undefined, e.g. if the schema is a sub-object */
|
|
445
493
|
properties: {
|
|
446
494
|
[fieldName: string]: SchemaField;
|
|
@@ -511,6 +559,9 @@ export type WrappedSchema = {
|
|
|
511
559
|
start_date: string;
|
|
512
560
|
/** ISO Date. If this tag exists, the schema is deprecated. */
|
|
513
561
|
end_date: string;
|
|
562
|
+
/** CommonFields row metadata — the polymorphic entity this schema maps to. */
|
|
563
|
+
resource_group?: string;
|
|
564
|
+
resource_name?: string;
|
|
514
565
|
/** Schema Name Type and Version Properties */
|
|
515
566
|
schema_name: SchemaName;
|
|
516
567
|
schema_type: SchemaType;
|
|
@@ -519,6 +570,10 @@ export type WrappedSchema = {
|
|
|
519
570
|
version_current: boolean;
|
|
520
571
|
/** Country codes that this schema is available for */
|
|
521
572
|
schema_country_codes?: string[];
|
|
573
|
+
/** Base schema to extend (same tenant). NULL = not an extension. */
|
|
574
|
+
extends_schema_name?: SchemaName | null;
|
|
575
|
+
/** Pin to specific base schema version. NULL = use version_current. */
|
|
576
|
+
extends_schema_version?: string | null;
|
|
522
577
|
schema: CommonSchemaAttributes & {
|
|
523
578
|
/** @deprecated don't use this */
|
|
524
579
|
$id?: string;
|
package/package.json
CHANGED
package/src/schema.ts
CHANGED
|
@@ -36,6 +36,14 @@ export type SchemaFieldTag =
|
|
|
36
36
|
| "display:stars"
|
|
37
37
|
| "display:no_autofill"
|
|
38
38
|
| "display:currency"
|
|
39
|
+
// currency with an explicit ISO 4217 code, e.g. `display:currency:usd`.
|
|
40
|
+
// The code is case-insensitive; a malformed code falls back to the bare behaviour.
|
|
41
|
+
| `display:currency:${string}`
|
|
42
|
+
// renders a fixed-option (enum) multi-select array as a checkbox group
|
|
43
|
+
| "display:checkbox"
|
|
44
|
+
// forces radio rendering for string + (enum|lookup) fields regardless of
|
|
45
|
+
// list size; the automatic ≤ 7 behaviour is handled by the rules directly
|
|
46
|
+
| "display:radio"
|
|
39
47
|
| "display:cascade"
|
|
40
48
|
| "display:survey"
|
|
41
49
|
| "display:quoting"
|
|
@@ -44,6 +52,8 @@ export type SchemaFieldTag =
|
|
|
44
52
|
| `display:replace:('${string}', '${string}')`
|
|
45
53
|
| "display:terms_conditions"
|
|
46
54
|
| `display:main_media:${string}` // property name to determine what image to display
|
|
55
|
+
// render the field value as markdown in Cloudscape detail views (#1902)
|
|
56
|
+
| "display:markdown"
|
|
47
57
|
// content block variants (see ContentBlockField)
|
|
48
58
|
| "display:content-block"
|
|
49
59
|
| "display:info"
|
|
@@ -397,6 +407,50 @@ export type CommonSchemaAttributes = {
|
|
|
397
407
|
}[];
|
|
398
408
|
}[];
|
|
399
409
|
|
|
410
|
+
/**
|
|
411
|
+
* Pre-defined view presets provided by the schema author.
|
|
412
|
+
* A view bundles filter, sorting, column visibility/order, and display
|
|
413
|
+
* settings (page size, density, etc.) into a named configuration.
|
|
414
|
+
* These appear as "Default views" in the admin table UI and cannot be
|
|
415
|
+
* deleted by users (unlike user-saved views).
|
|
416
|
+
*
|
|
417
|
+
* Every field except `name` is optional. When applied, fields the view
|
|
418
|
+
* does not specify leave the user's current preference untouched. This
|
|
419
|
+
* lets a schema author define partial views (e.g. just sorting + columns).
|
|
420
|
+
*/
|
|
421
|
+
views?: {
|
|
422
|
+
/** Display name for the view preset */
|
|
423
|
+
name: string;
|
|
424
|
+
/** Filter to apply (PropertyFilter tokens + operation) */
|
|
425
|
+
filter?: {
|
|
426
|
+
/** How tokens are combined: "and" = all must match, "or" = any must match */
|
|
427
|
+
operation: "and" | "or";
|
|
428
|
+
/** Filter conditions */
|
|
429
|
+
tokens: {
|
|
430
|
+
/** Must match a key in schema `properties` */
|
|
431
|
+
propertyKey: string;
|
|
432
|
+
/** Comparison operator */
|
|
433
|
+
operator: string;
|
|
434
|
+
/** Value to compare against */
|
|
435
|
+
value: string;
|
|
436
|
+
}[];
|
|
437
|
+
};
|
|
438
|
+
/** Server-side sorting state, or `null` to explicitly clear sorting */
|
|
439
|
+
sorting?: { sortingColumn: string; isDescending: boolean } | null;
|
|
440
|
+
/** Column visibility + order. `id` must match a key in `properties`. */
|
|
441
|
+
columnPrefs?: { id: string; visible: boolean }[];
|
|
442
|
+
/** Page size (rows per page) */
|
|
443
|
+
pageSize?: number;
|
|
444
|
+
/** Whether to wrap cell content onto multiple lines */
|
|
445
|
+
wrapLines?: boolean;
|
|
446
|
+
/** Whether alternating rows are striped */
|
|
447
|
+
stripedRows?: boolean;
|
|
448
|
+
/** Density of the table content */
|
|
449
|
+
contentDensity?: "comfortable" | "compact";
|
|
450
|
+
/** Number of sticky columns pinned to the start/end of the table */
|
|
451
|
+
stickyColumns?: { first: number; last: number };
|
|
452
|
+
}[];
|
|
453
|
+
|
|
400
454
|
/** Kanban board configuration for admin dashboard */
|
|
401
455
|
kanban?: {
|
|
402
456
|
/** Field that determines which column a card belongs to */
|
|
@@ -516,105 +570,101 @@ export type CommonSchemaAttributes = {
|
|
|
516
570
|
* Raytio's variant of JSON Schema, as used by the client. It is a modified version
|
|
517
571
|
* of what the API returns.
|
|
518
572
|
*/
|
|
519
|
-
export type Schema =
|
|
520
|
-
|
|
521
|
-
|
|
573
|
+
export type Schema = CommonFields<never> &
|
|
574
|
+
CommonSchemaAttributes & {
|
|
575
|
+
/** added by the client, copied from {@link WrappedSchema} */
|
|
576
|
+
name: SchemaName;
|
|
522
577
|
|
|
523
|
-
|
|
524
|
-
|
|
578
|
+
/** added by client */
|
|
579
|
+
type?: DataTypes;
|
|
525
580
|
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
/** the localized title of the `schema_group`. added by the client */
|
|
533
|
-
group_title?: string;
|
|
581
|
+
/**
|
|
582
|
+
* Schema-level conditional tags, pre-processed for runtime evaluation.
|
|
583
|
+
* When form values match the `if` condition, the tags are added to the schema.
|
|
584
|
+
*/
|
|
585
|
+
conditionalTags?: ConditionalTags[];
|
|
534
586
|
|
|
535
|
-
|
|
536
|
-
|
|
587
|
+
/** the localized title of the `schema_group`. added by the client */
|
|
588
|
+
group_title?: string;
|
|
537
589
|
|
|
538
|
-
|
|
539
|
-
|
|
590
|
+
/** originally `string[]`, the client modifies this */
|
|
591
|
+
verified_fields?: (string | ConditionallyRequired)[];
|
|
540
592
|
|
|
541
|
-
|
|
542
|
-
|
|
593
|
+
/** originally `string[]`, the client modifies this */
|
|
594
|
+
required?: (string | ConditionallyRequired)[];
|
|
543
595
|
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
/** ISO Date. Copied from {@link WrappedSchema} If this tag exists, the schema is deprecated */
|
|
547
|
-
end_date?: string;
|
|
596
|
+
/** added by client */
|
|
597
|
+
wasExpandedByClient?: boolean;
|
|
548
598
|
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
599
|
+
/** 🚨 Note that there are cases where properties are undefined, e.g. if the schema is a sub-object */
|
|
600
|
+
properties: {
|
|
601
|
+
[fieldName: string]: SchemaField;
|
|
602
|
+
};
|
|
553
603
|
|
|
554
|
-
/**
|
|
555
|
-
* Some schema's represent data that is not stored as a profile object.
|
|
556
|
-
* In this case, this attribute defines what database table we need to use
|
|
557
|
-
* to fetch the corresponding data, and which field is the primary_key of that
|
|
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.
|
|
571
|
-
*/
|
|
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
604
|
/**
|
|
584
|
-
*
|
|
585
|
-
*
|
|
586
|
-
*
|
|
587
|
-
*
|
|
605
|
+
* Some schema's represent data that is not stored as a profile object.
|
|
606
|
+
* In this case, this attribute defines what database table we need to use
|
|
607
|
+
* to fetch the corresponding data, and which field is the primary_key of that
|
|
608
|
+
* table (e.g. `id`, `o_id` etc.)
|
|
609
|
+
*
|
|
610
|
+
* The `path` property specifies the complete API path to use. If not provided,
|
|
611
|
+
* defaults to `/db/v1/{table}`. When `path` is specified, it is used directly
|
|
612
|
+
* without appending the table name.
|
|
613
|
+
* Examples:
|
|
614
|
+
* - `path: "/db/v1/rpc/my_function"` for RPC endpoints
|
|
615
|
+
* - `path: "/api/v2/custom_endpoint"` for custom API paths
|
|
616
|
+
*
|
|
617
|
+
* The optional `select` parameter supports PostgREST select syntax for nested
|
|
618
|
+
* objects/arrays. For example:
|
|
619
|
+
* `select: "id,item_id,gpm_items(id,item_key)"`
|
|
620
|
+
* This will return nested objects in the response.
|
|
588
621
|
*/
|
|
589
|
-
|
|
590
|
-
|
|
622
|
+
database?: {
|
|
623
|
+
/** Table name (required when path is not specified to construct `/db/v1/{table}`) */
|
|
624
|
+
table?: string;
|
|
625
|
+
primary_key: string;
|
|
626
|
+
/** Complete API path. If specified, used directly instead of `/db/v1/{table}` */
|
|
627
|
+
path?: string;
|
|
628
|
+
select?: string;
|
|
629
|
+
/** Schema to redirect to after creating a record (for insert schemas) */
|
|
630
|
+
return_to?: SchemaName;
|
|
631
|
+
/** HTTP method override. If specified, uses this instead of the default (POST for create, PATCH for edit, DELETE for delete) */
|
|
632
|
+
method?: "POST" | "PATCH" | "DELETE";
|
|
633
|
+
/**
|
|
634
|
+
* PostgREST query parameters to include in requests.
|
|
635
|
+
* Supports variable substitution: {$context.organizationId}, {$context.userId}, {$context.tenantId}
|
|
636
|
+
* Example: "org_id=eq.{$context.organizationId}&active=eq.true"
|
|
637
|
+
* If this contains "select=", it takes precedence over the `select` property.
|
|
638
|
+
*/
|
|
639
|
+
query_parameters?: string;
|
|
640
|
+
};
|
|
591
641
|
|
|
592
|
-
|
|
593
|
-
|
|
642
|
+
/** the client adds this after processing the i18n property */
|
|
643
|
+
groupNames?: Record<string, string>;
|
|
594
644
|
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
645
|
+
/** specifies the order in which groups should be displayed */
|
|
646
|
+
groups?: {
|
|
647
|
+
order?: string[];
|
|
648
|
+
};
|
|
599
649
|
|
|
600
|
-
|
|
601
|
-
|
|
650
|
+
/** added by the client to inform downstream components which locale from schema.i18n was used */
|
|
651
|
+
clientLocale?: string;
|
|
602
652
|
|
|
603
|
-
|
|
604
|
-
|
|
653
|
+
/** added by the client, copied from {@link WrappedSchema} */
|
|
654
|
+
version: string;
|
|
605
655
|
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
656
|
+
/**
|
|
657
|
+
* the estimated loading times in seconds for various API calls. The client adds
|
|
658
|
+
* this field after processing the schema tags.
|
|
659
|
+
*/
|
|
660
|
+
timing?: Record<"extract" | "live_person" | "verify_pending_delay", number>;
|
|
611
661
|
|
|
612
|
-
|
|
613
|
-
|
|
662
|
+
/** added by the client. If true, this should be shown to the client */
|
|
663
|
+
isProfileSchema?: boolean;
|
|
614
664
|
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
};
|
|
665
|
+
/** added by the client. If true, this schema somehow relates to legacy service providers */
|
|
666
|
+
isSpSchema?: boolean;
|
|
667
|
+
};
|
|
618
668
|
|
|
619
669
|
/** Type Classification of a Schema returned by API */
|
|
620
670
|
export type SchemaType = "ss" | "ps" | "us" | "ms";
|
|
@@ -627,6 +677,10 @@ export type WrappedSchema = {
|
|
|
627
677
|
/** ISO Date. If this tag exists, the schema is deprecated. */
|
|
628
678
|
end_date: string;
|
|
629
679
|
|
|
680
|
+
/** CommonFields row metadata — the polymorphic entity this schema maps to. */
|
|
681
|
+
resource_group?: string;
|
|
682
|
+
resource_name?: string;
|
|
683
|
+
|
|
630
684
|
/** Schema Name Type and Version Properties */
|
|
631
685
|
schema_name: SchemaName;
|
|
632
686
|
schema_type: SchemaType;
|
|
@@ -638,6 +692,11 @@ export type WrappedSchema = {
|
|
|
638
692
|
/** Country codes that this schema is available for */
|
|
639
693
|
schema_country_codes?: string[];
|
|
640
694
|
|
|
695
|
+
/** Base schema to extend (same tenant). NULL = not an extension. */
|
|
696
|
+
extends_schema_name?: SchemaName | null;
|
|
697
|
+
/** Pin to specific base schema version. NULL = use version_current. */
|
|
698
|
+
extends_schema_version?: string | null;
|
|
699
|
+
|
|
641
700
|
schema: CommonSchemaAttributes & {
|
|
642
701
|
/** @deprecated don't use this */
|
|
643
702
|
$id?: string;
|