@raytio/types 8.2.0 → 8.3.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 +6 -2
- package/dist/schema.d.ts +9 -6
- package/package.json +1 -1
- package/src/schema.ts +89 -82
package/README.md
CHANGED
|
@@ -993,7 +993,7 @@ ___
|
|
|
993
993
|
|
|
994
994
|
### Schema
|
|
995
995
|
|
|
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` } ; `
|
|
996
|
+
Ƭ **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
997
|
|
|
998
998
|
Raytio's variant of JSON Schema, as used by the client. It is a modified version
|
|
999
999
|
of what the API returns.
|
|
@@ -1056,7 +1056,7 @@ ___
|
|
|
1056
1056
|
|
|
1057
1057
|
### SchemaFieldTag
|
|
1058
1058
|
|
|
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"``
|
|
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: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
1060
|
|
|
1061
1061
|
___
|
|
1062
1062
|
|
|
@@ -1348,6 +1348,10 @@ This is what's returned by the API
|
|
|
1348
1348
|
| :------ | :------ | :------ |
|
|
1349
1349
|
| `active` | ``true`` | - |
|
|
1350
1350
|
| `end_date` | `string` | ISO Date. If this tag exists, the schema is deprecated. |
|
|
1351
|
+
| `extends_schema_name?` | [`SchemaName`](#schemaname) \| ``null`` | Base schema to extend (same tenant). NULL = not an extension. |
|
|
1352
|
+
| `extends_schema_version?` | `string` \| ``null`` | Pin to specific base schema version. NULL = use version_current. |
|
|
1353
|
+
| `resource_group?` | `string` | CommonFields row metadata — the polymorphic entity this schema maps to. |
|
|
1354
|
+
| `resource_name?` | `string` | - |
|
|
1351
1355
|
| `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
1356
|
| `schema_country_codes?` | `string`[] | Country codes that this schema is available for |
|
|
1353
1357
|
| `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: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 */
|
|
@@ -419,7 +419,7 @@ export type CommonSchemaAttributes = {
|
|
|
419
419
|
* Raytio's variant of JSON Schema, as used by the client. It is a modified version
|
|
420
420
|
* of what the API returns.
|
|
421
421
|
*/
|
|
422
|
-
export type Schema = CommonSchemaAttributes & {
|
|
422
|
+
export type Schema = CommonFields<never> & CommonSchemaAttributes & {
|
|
423
423
|
/** added by the client, copied from {@link WrappedSchema} */
|
|
424
424
|
name: SchemaName;
|
|
425
425
|
/** added by client */
|
|
@@ -437,10 +437,6 @@ export type Schema = CommonSchemaAttributes & {
|
|
|
437
437
|
required?: (string | ConditionallyRequired)[];
|
|
438
438
|
/** added by client */
|
|
439
439
|
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
440
|
/** 🚨 Note that there are cases where properties are undefined, e.g. if the schema is a sub-object */
|
|
445
441
|
properties: {
|
|
446
442
|
[fieldName: string]: SchemaField;
|
|
@@ -511,6 +507,9 @@ export type WrappedSchema = {
|
|
|
511
507
|
start_date: string;
|
|
512
508
|
/** ISO Date. If this tag exists, the schema is deprecated. */
|
|
513
509
|
end_date: string;
|
|
510
|
+
/** CommonFields row metadata — the polymorphic entity this schema maps to. */
|
|
511
|
+
resource_group?: string;
|
|
512
|
+
resource_name?: string;
|
|
514
513
|
/** Schema Name Type and Version Properties */
|
|
515
514
|
schema_name: SchemaName;
|
|
516
515
|
schema_type: SchemaType;
|
|
@@ -519,6 +518,10 @@ export type WrappedSchema = {
|
|
|
519
518
|
version_current: boolean;
|
|
520
519
|
/** Country codes that this schema is available for */
|
|
521
520
|
schema_country_codes?: string[];
|
|
521
|
+
/** Base schema to extend (same tenant). NULL = not an extension. */
|
|
522
|
+
extends_schema_name?: SchemaName | null;
|
|
523
|
+
/** Pin to specific base schema version. NULL = use version_current. */
|
|
524
|
+
extends_schema_version?: string | null;
|
|
522
525
|
schema: CommonSchemaAttributes & {
|
|
523
526
|
/** @deprecated don't use this */
|
|
524
527
|
$id?: string;
|
package/package.json
CHANGED
package/src/schema.ts
CHANGED
|
@@ -44,6 +44,8 @@ export type SchemaFieldTag =
|
|
|
44
44
|
| `display:replace:('${string}', '${string}')`
|
|
45
45
|
| "display:terms_conditions"
|
|
46
46
|
| `display:main_media:${string}` // property name to determine what image to display
|
|
47
|
+
// render the field value as markdown in Cloudscape detail views (#1902)
|
|
48
|
+
| "display:markdown"
|
|
47
49
|
// content block variants (see ContentBlockField)
|
|
48
50
|
| "display:content-block"
|
|
49
51
|
| "display:info"
|
|
@@ -516,105 +518,101 @@ export type CommonSchemaAttributes = {
|
|
|
516
518
|
* Raytio's variant of JSON Schema, as used by the client. It is a modified version
|
|
517
519
|
* of what the API returns.
|
|
518
520
|
*/
|
|
519
|
-
export type Schema =
|
|
520
|
-
|
|
521
|
-
|
|
521
|
+
export type Schema = CommonFields<never> &
|
|
522
|
+
CommonSchemaAttributes & {
|
|
523
|
+
/** added by the client, copied from {@link WrappedSchema} */
|
|
524
|
+
name: SchemaName;
|
|
522
525
|
|
|
523
|
-
|
|
524
|
-
|
|
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[];
|
|
526
|
+
/** added by client */
|
|
527
|
+
type?: DataTypes;
|
|
531
528
|
|
|
532
|
-
|
|
533
|
-
|
|
529
|
+
/**
|
|
530
|
+
* Schema-level conditional tags, pre-processed for runtime evaluation.
|
|
531
|
+
* When form values match the `if` condition, the tags are added to the schema.
|
|
532
|
+
*/
|
|
533
|
+
conditionalTags?: ConditionalTags[];
|
|
534
534
|
|
|
535
|
-
|
|
536
|
-
|
|
535
|
+
/** the localized title of the `schema_group`. added by the client */
|
|
536
|
+
group_title?: string;
|
|
537
537
|
|
|
538
|
-
|
|
539
|
-
|
|
538
|
+
/** originally `string[]`, the client modifies this */
|
|
539
|
+
verified_fields?: (string | ConditionallyRequired)[];
|
|
540
540
|
|
|
541
|
-
|
|
542
|
-
|
|
541
|
+
/** originally `string[]`, the client modifies this */
|
|
542
|
+
required?: (string | ConditionallyRequired)[];
|
|
543
543
|
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
/** ISO Date. Copied from {@link WrappedSchema} If this tag exists, the schema is deprecated */
|
|
547
|
-
end_date?: string;
|
|
544
|
+
/** added by client */
|
|
545
|
+
wasExpandedByClient?: boolean;
|
|
548
546
|
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
547
|
+
/** 🚨 Note that there are cases where properties are undefined, e.g. if the schema is a sub-object */
|
|
548
|
+
properties: {
|
|
549
|
+
[fieldName: string]: SchemaField;
|
|
550
|
+
};
|
|
553
551
|
|
|
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
552
|
/**
|
|
584
|
-
*
|
|
585
|
-
*
|
|
586
|
-
*
|
|
587
|
-
*
|
|
553
|
+
* Some schema's represent data that is not stored as a profile object.
|
|
554
|
+
* In this case, this attribute defines what database table we need to use
|
|
555
|
+
* to fetch the corresponding data, and which field is the primary_key of that
|
|
556
|
+
* table (e.g. `id`, `o_id` etc.)
|
|
557
|
+
*
|
|
558
|
+
* The `path` property specifies the complete API path to use. If not provided,
|
|
559
|
+
* defaults to `/db/v1/{table}`. When `path` is specified, it is used directly
|
|
560
|
+
* without appending the table name.
|
|
561
|
+
* Examples:
|
|
562
|
+
* - `path: "/db/v1/rpc/my_function"` for RPC endpoints
|
|
563
|
+
* - `path: "/api/v2/custom_endpoint"` for custom API paths
|
|
564
|
+
*
|
|
565
|
+
* The optional `select` parameter supports PostgREST select syntax for nested
|
|
566
|
+
* objects/arrays. For example:
|
|
567
|
+
* `select: "id,item_id,gpm_items(id,item_key)"`
|
|
568
|
+
* This will return nested objects in the response.
|
|
588
569
|
*/
|
|
589
|
-
|
|
590
|
-
|
|
570
|
+
database?: {
|
|
571
|
+
/** Table name (required when path is not specified to construct `/db/v1/{table}`) */
|
|
572
|
+
table?: string;
|
|
573
|
+
primary_key: string;
|
|
574
|
+
/** Complete API path. If specified, used directly instead of `/db/v1/{table}` */
|
|
575
|
+
path?: string;
|
|
576
|
+
select?: string;
|
|
577
|
+
/** Schema to redirect to after creating a record (for insert schemas) */
|
|
578
|
+
return_to?: SchemaName;
|
|
579
|
+
/** HTTP method override. If specified, uses this instead of the default (POST for create, PATCH for edit, DELETE for delete) */
|
|
580
|
+
method?: "POST" | "PATCH" | "DELETE";
|
|
581
|
+
/**
|
|
582
|
+
* PostgREST query parameters to include in requests.
|
|
583
|
+
* Supports variable substitution: {$context.organizationId}, {$context.userId}, {$context.tenantId}
|
|
584
|
+
* Example: "org_id=eq.{$context.organizationId}&active=eq.true"
|
|
585
|
+
* If this contains "select=", it takes precedence over the `select` property.
|
|
586
|
+
*/
|
|
587
|
+
query_parameters?: string;
|
|
588
|
+
};
|
|
591
589
|
|
|
592
|
-
|
|
593
|
-
|
|
590
|
+
/** the client adds this after processing the i18n property */
|
|
591
|
+
groupNames?: Record<string, string>;
|
|
594
592
|
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
593
|
+
/** specifies the order in which groups should be displayed */
|
|
594
|
+
groups?: {
|
|
595
|
+
order?: string[];
|
|
596
|
+
};
|
|
599
597
|
|
|
600
|
-
|
|
601
|
-
|
|
598
|
+
/** added by the client to inform downstream components which locale from schema.i18n was used */
|
|
599
|
+
clientLocale?: string;
|
|
602
600
|
|
|
603
|
-
|
|
604
|
-
|
|
601
|
+
/** added by the client, copied from {@link WrappedSchema} */
|
|
602
|
+
version: string;
|
|
605
603
|
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
604
|
+
/**
|
|
605
|
+
* the estimated loading times in seconds for various API calls. The client adds
|
|
606
|
+
* this field after processing the schema tags.
|
|
607
|
+
*/
|
|
608
|
+
timing?: Record<"extract" | "live_person" | "verify_pending_delay", number>;
|
|
611
609
|
|
|
612
|
-
|
|
613
|
-
|
|
610
|
+
/** added by the client. If true, this should be shown to the client */
|
|
611
|
+
isProfileSchema?: boolean;
|
|
614
612
|
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
};
|
|
613
|
+
/** added by the client. If true, this schema somehow relates to legacy service providers */
|
|
614
|
+
isSpSchema?: boolean;
|
|
615
|
+
};
|
|
618
616
|
|
|
619
617
|
/** Type Classification of a Schema returned by API */
|
|
620
618
|
export type SchemaType = "ss" | "ps" | "us" | "ms";
|
|
@@ -627,6 +625,10 @@ export type WrappedSchema = {
|
|
|
627
625
|
/** ISO Date. If this tag exists, the schema is deprecated. */
|
|
628
626
|
end_date: string;
|
|
629
627
|
|
|
628
|
+
/** CommonFields row metadata — the polymorphic entity this schema maps to. */
|
|
629
|
+
resource_group?: string;
|
|
630
|
+
resource_name?: string;
|
|
631
|
+
|
|
630
632
|
/** Schema Name Type and Version Properties */
|
|
631
633
|
schema_name: SchemaName;
|
|
632
634
|
schema_type: SchemaType;
|
|
@@ -638,6 +640,11 @@ export type WrappedSchema = {
|
|
|
638
640
|
/** Country codes that this schema is available for */
|
|
639
641
|
schema_country_codes?: string[];
|
|
640
642
|
|
|
643
|
+
/** Base schema to extend (same tenant). NULL = not an extension. */
|
|
644
|
+
extends_schema_name?: SchemaName | null;
|
|
645
|
+
/** Pin to specific base schema version. NULL = use version_current. */
|
|
646
|
+
extends_schema_version?: string | null;
|
|
647
|
+
|
|
641
648
|
schema: CommonSchemaAttributes & {
|
|
642
649
|
/** @deprecated don't use this */
|
|
643
650
|
$id?: string;
|