@epilot/entity-client 7.4.0 → 7.5.2
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/dist/definition.js +1 -1
- package/dist/openapi-runtime.json +12 -3
- package/dist/openapi.d.ts +440 -79
- package/dist/openapi.json +167 -23
- package/dist/schema-model.d.ts +23 -4
- package/dist/schema-model.js +48 -5
- package/package.json +2 -1
package/dist/openapi.json
CHANGED
|
@@ -75,7 +75,8 @@
|
|
|
75
75
|
{
|
|
76
76
|
"in": "query",
|
|
77
77
|
"name": "latest",
|
|
78
|
-
"
|
|
78
|
+
"deprecated": true,
|
|
79
|
+
"description": "No longer has any effect: schema freezing is retired and the latest version is always returned.\n",
|
|
79
80
|
"schema": {
|
|
80
81
|
"type": "boolean",
|
|
81
82
|
"default": false
|
|
@@ -161,7 +162,8 @@
|
|
|
161
162
|
{
|
|
162
163
|
"in": "query",
|
|
163
164
|
"name": "latest",
|
|
164
|
-
"
|
|
165
|
+
"deprecated": true,
|
|
166
|
+
"description": "No longer has any effect: schema freezing is retired and the latest version is always returned.\n",
|
|
165
167
|
"schema": {
|
|
166
168
|
"type": "boolean",
|
|
167
169
|
"default": false
|
|
@@ -223,7 +225,7 @@
|
|
|
223
225
|
"get": {
|
|
224
226
|
"operationId": "getSchema",
|
|
225
227
|
"summary": "getSchema",
|
|
226
|
-
"description": "
|
|
228
|
+
"description": "Gets the latest version of the Schema.\nPass ?id= to get a specific version by ID.\n",
|
|
227
229
|
"tags": [
|
|
228
230
|
"Schemas"
|
|
229
231
|
],
|
|
@@ -241,7 +243,8 @@
|
|
|
241
243
|
{
|
|
242
244
|
"in": "query",
|
|
243
245
|
"name": "latest",
|
|
244
|
-
"
|
|
246
|
+
"deprecated": true,
|
|
247
|
+
"description": "No longer has any effect: schema freezing is retired and the latest version is always returned.\n",
|
|
245
248
|
"schema": {
|
|
246
249
|
"type": "boolean",
|
|
247
250
|
"default": false
|
|
@@ -267,7 +270,7 @@
|
|
|
267
270
|
"put": {
|
|
268
271
|
"operationId": "putSchema",
|
|
269
272
|
"summary": "putSchema",
|
|
270
|
-
"description": "Create or update a schema with a new version.\
|
|
273
|
+
"description": "Create or update a schema with a new version.\n",
|
|
271
274
|
"tags": [
|
|
272
275
|
"Schemas"
|
|
273
276
|
],
|
|
@@ -792,7 +795,8 @@
|
|
|
792
795
|
"type": "boolean"
|
|
793
796
|
},
|
|
794
797
|
"frozen_version": {
|
|
795
|
-
"
|
|
798
|
+
"deprecated": true,
|
|
799
|
+
"description": "No longer returned: schema freezing is retired.\n",
|
|
796
800
|
"allOf": [
|
|
797
801
|
{
|
|
798
802
|
"$ref": "#/components/schemas/SchemaId"
|
|
@@ -815,7 +819,8 @@
|
|
|
815
819
|
"post": {
|
|
816
820
|
"operationId": "freezeSchema",
|
|
817
821
|
"summary": "freezeSchema",
|
|
818
|
-
"
|
|
822
|
+
"deprecated": true,
|
|
823
|
+
"description": "Deprecated no-op: schema freezing is retired and every read returns the latest version.\nReturns the latest version of the schema unchanged. This endpoint will be removed.\n",
|
|
819
824
|
"tags": [
|
|
820
825
|
"Schemas"
|
|
821
826
|
],
|
|
@@ -864,7 +869,8 @@
|
|
|
864
869
|
"post": {
|
|
865
870
|
"operationId": "unfreezeSchema",
|
|
866
871
|
"summary": "unfreezeSchema",
|
|
867
|
-
"
|
|
872
|
+
"deprecated": true,
|
|
873
|
+
"description": "Deprecated: schema freezing is retired. Cleans up a leftover frozen pointer by promoting the\nlatest version to the current version, and succeeds when there is nothing to clean up.\nThis endpoint will be removed.\n",
|
|
868
874
|
"tags": [
|
|
869
875
|
"Schemas"
|
|
870
876
|
],
|
|
@@ -1777,7 +1783,7 @@
|
|
|
1777
1783
|
"get": {
|
|
1778
1784
|
"operationId": "autocomplete",
|
|
1779
1785
|
"summary": "autocomplete",
|
|
1780
|
-
"description": "Autocomplete entity attributes\n",
|
|
1786
|
+
"description": "Autocomplete entity attributes.\n\nSuggestions are derived from the values **currently stored on entities** the caller is allowed to read.\nA value only shows up while at least one entity carries it, so this endpoint reflects usage, not\nconfiguration.\n\nTo enumerate the label catalogue managed in the Label Builder (including labels that are not\nassigned to any entity yet, and excluding archived ones), use the Taxonomy endpoints instead:\n`POST /v1/entity/taxonomies/classifications:search` (`taxonomiesClassificationsSearch`) or\n`GET /v1/entity/taxonomies/{taxonomySlug}:autocomplete` (`taxonomyAutocomplete`).\n\nFor `attribute=_tags` the distinct values are aggregated across all matching entities, `hits` is the exact\nnumber of distinct values (capped at 1000) and results are ordered by usage. For other attributes the\n1000 most recently updated entities are scanned and `hits` is the number of distinct values found so far.\n",
|
|
1781
1787
|
"tags": [
|
|
1782
1788
|
"Entities"
|
|
1783
1789
|
],
|
|
@@ -1788,7 +1794,7 @@
|
|
|
1788
1794
|
{
|
|
1789
1795
|
"name": "input",
|
|
1790
1796
|
"in": "query",
|
|
1791
|
-
"description": "Input to autocomplete",
|
|
1797
|
+
"description": "Input to autocomplete (case-insensitive substring match)",
|
|
1792
1798
|
"schema": {
|
|
1793
1799
|
"type": "string"
|
|
1794
1800
|
}
|
|
@@ -1821,6 +1827,17 @@
|
|
|
1821
1827
|
"minimum": 1,
|
|
1822
1828
|
"maximum": 250
|
|
1823
1829
|
}
|
|
1830
|
+
},
|
|
1831
|
+
{
|
|
1832
|
+
"name": "from",
|
|
1833
|
+
"in": "query",
|
|
1834
|
+
"description": "Number of distinct values to skip, for paging through results when `hits` exceeds `size`.\n`from + size` may not exceed 1000.\n",
|
|
1835
|
+
"schema": {
|
|
1836
|
+
"type": "integer",
|
|
1837
|
+
"default": 0,
|
|
1838
|
+
"minimum": 0,
|
|
1839
|
+
"maximum": 999
|
|
1840
|
+
}
|
|
1824
1841
|
}
|
|
1825
1842
|
],
|
|
1826
1843
|
"responses": {
|
|
@@ -1833,6 +1850,7 @@
|
|
|
1833
1850
|
"properties": {
|
|
1834
1851
|
"hits": {
|
|
1835
1852
|
"type": "number",
|
|
1853
|
+
"description": "Number of distinct values matching the input. Exact (independent of `size`, capped at 1000) for\n`_tags`; for other attributes the number of distinct values collected so far, which may grow with `size`.\n",
|
|
1836
1854
|
"example": 1
|
|
1837
1855
|
},
|
|
1838
1856
|
"results": {
|
|
@@ -3947,7 +3965,7 @@
|
|
|
3947
3965
|
"description": "ISO 8601 timestamp to filter jobs created after this time (e.g., 2023-01-01T00:00:00Z).",
|
|
3948
3966
|
"type": "string",
|
|
3949
3967
|
"format": "date-time",
|
|
3950
|
-
"example": "2023-01-01T00:00:
|
|
3968
|
+
"example": "2023-01-01T00:00:00Z"
|
|
3951
3969
|
}
|
|
3952
3970
|
},
|
|
3953
3971
|
{
|
|
@@ -5126,6 +5144,100 @@
|
|
|
5126
5144
|
"address_map": "full_width",
|
|
5127
5145
|
"recent_communications": "one_third_width"
|
|
5128
5146
|
}
|
|
5147
|
+
},
|
|
5148
|
+
"custom_tabs": {
|
|
5149
|
+
"type": "array",
|
|
5150
|
+
"description": "Configured tabs that host widgets, shown alongside capability tabs in entity details. Interleaves with capability `EntityDetailsV2:Tab` ui_hooks on a shared `order`: the host merges both lists and sorts by `order`, with capability tabs winning ties. Unlike the header grid, a tab's `widgets` list is the entire membership — a widget's ui_hook `default_visible` is never consulted for tab placement.",
|
|
5151
|
+
"items": {
|
|
5152
|
+
"type": "object",
|
|
5153
|
+
"additionalProperties": true,
|
|
5154
|
+
"description": "A single configured tab. `type` discriminates the payload shape; readers must skip an entry whose `type` they don't recognize instead of failing, and writers must round-trip such entries unchanged, so a stable host and a canary host can safely share one schema. Mirrors the same skip-unknown/round-trip contract already used for capability `ui_hooks` entries above.",
|
|
5155
|
+
"properties": {
|
|
5156
|
+
"id": {
|
|
5157
|
+
"type": "string",
|
|
5158
|
+
"description": "Generated when the tab is created and never edited afterward, so a blueprint-authored tab and a customer-authored tab can never collide and identity survives a rename.",
|
|
5159
|
+
"example": "8f14e45f-ceea-467e-a0d6-c8a4ea1c9e6d"
|
|
5160
|
+
},
|
|
5161
|
+
"slug": {
|
|
5162
|
+
"type": "string",
|
|
5163
|
+
"description": "URL route segment for the tab, derived from `title`. Unique within the schema, and against capability tab ids, since both share one route-segment namespace.",
|
|
5164
|
+
"example": "sales-overview"
|
|
5165
|
+
},
|
|
5166
|
+
"title": {
|
|
5167
|
+
"type": "string",
|
|
5168
|
+
"description": "Tab label, authored by the configuring user.",
|
|
5169
|
+
"example": "Sales Overview"
|
|
5170
|
+
},
|
|
5171
|
+
"order": {
|
|
5172
|
+
"type": "integer",
|
|
5173
|
+
"description": "Authoritative render position; array position carries no meaning. Shares one ordering space with capability tab ui_hook `order` — at equal `order`, capability tabs sort first.",
|
|
5174
|
+
"example": 10
|
|
5175
|
+
},
|
|
5176
|
+
"icon": {
|
|
5177
|
+
"type": "string",
|
|
5178
|
+
"description": "Icon name from the existing entity icon set.",
|
|
5179
|
+
"example": "person"
|
|
5180
|
+
},
|
|
5181
|
+
"type": {
|
|
5182
|
+
"type": "string",
|
|
5183
|
+
"description": "Discriminator for the tab's payload. Currently `widgets`, carried by the `widgets` property below; a future tab kind adds its own payload property rather than reusing this one. Deliberately not an enum, so a type introduced by a newer host still round-trips through an older one instead of failing validation.",
|
|
5184
|
+
"example": "widgets"
|
|
5185
|
+
},
|
|
5186
|
+
"widgets": {
|
|
5187
|
+
"type": "array",
|
|
5188
|
+
"description": "Payload for `type: widgets`. Membership in this list IS the tab's widget set, in render order — there is no separate visibility map, and a widget's ui_hook `default_visible` is not consulted.",
|
|
5189
|
+
"items": {
|
|
5190
|
+
"type": "object",
|
|
5191
|
+
"properties": {
|
|
5192
|
+
"id": {
|
|
5193
|
+
"type": "string",
|
|
5194
|
+
"description": "Widget id — a capability widget's `component`, or `summary` for the synthesized summary card.",
|
|
5195
|
+
"example": "next_best_action"
|
|
5196
|
+
},
|
|
5197
|
+
"width": {
|
|
5198
|
+
"type": "string",
|
|
5199
|
+
"description": "Width for this widget within the tab's grid. Falls back the same way as the header's `widget_widths` when omitted: widget's ui_hook `default_width`, then `full_width`.",
|
|
5200
|
+
"enum": [
|
|
5201
|
+
"one_third_width",
|
|
5202
|
+
"half_width",
|
|
5203
|
+
"two_third_width",
|
|
5204
|
+
"full_width"
|
|
5205
|
+
]
|
|
5206
|
+
}
|
|
5207
|
+
},
|
|
5208
|
+
"required": [
|
|
5209
|
+
"id"
|
|
5210
|
+
]
|
|
5211
|
+
}
|
|
5212
|
+
}
|
|
5213
|
+
},
|
|
5214
|
+
"required": [
|
|
5215
|
+
"id",
|
|
5216
|
+
"slug",
|
|
5217
|
+
"title",
|
|
5218
|
+
"order",
|
|
5219
|
+
"type"
|
|
5220
|
+
]
|
|
5221
|
+
},
|
|
5222
|
+
"example": [
|
|
5223
|
+
{
|
|
5224
|
+
"id": "8f14e45f-ceea-467e-a0d6-c8a4ea1c9e6d",
|
|
5225
|
+
"slug": "sales-overview",
|
|
5226
|
+
"title": "Sales Overview",
|
|
5227
|
+
"order": 10,
|
|
5228
|
+
"type": "widgets",
|
|
5229
|
+
"widgets": [
|
|
5230
|
+
{
|
|
5231
|
+
"id": "next_best_action",
|
|
5232
|
+
"width": "full_width"
|
|
5233
|
+
},
|
|
5234
|
+
{
|
|
5235
|
+
"id": "recent_communications",
|
|
5236
|
+
"width": "one_third_width"
|
|
5237
|
+
}
|
|
5238
|
+
]
|
|
5239
|
+
}
|
|
5240
|
+
]
|
|
5129
5241
|
}
|
|
5130
5242
|
}
|
|
5131
5243
|
},
|
|
@@ -5257,7 +5369,7 @@
|
|
|
5257
5369
|
"conditions": {
|
|
5258
5370
|
"type": "array",
|
|
5259
5371
|
"nullable": true,
|
|
5260
|
-
"description": "Dimensions that conditional variants of this entity type are keyed by.\n\nAbsent or `null` means entities of this type are not conditional. Attributes whose\nvalues a variant may override are marked with `
|
|
5372
|
+
"description": "Dimensions that conditional variants of this entity type are keyed by.\n\nAbsent or `null` means entities of this type are not conditional. Attributes whose\nvalues a variant may override are marked with `overridable_attribute`.\n",
|
|
5261
5373
|
"items": {
|
|
5262
5374
|
"$ref": "#/components/schemas/ConditionDefinition"
|
|
5263
5375
|
}
|
|
@@ -5300,11 +5412,13 @@
|
|
|
5300
5412
|
}
|
|
5301
5413
|
},
|
|
5302
5414
|
"frozen": {
|
|
5303
|
-
"
|
|
5415
|
+
"deprecated": true,
|
|
5416
|
+
"description": "No longer returned: schema freezing is retired.\n",
|
|
5304
5417
|
"type": "boolean"
|
|
5305
5418
|
},
|
|
5306
5419
|
"latest": {
|
|
5307
|
-
"
|
|
5420
|
+
"deprecated": true,
|
|
5421
|
+
"description": "No longer returned: every read returns the latest version.\n",
|
|
5308
5422
|
"type": "boolean"
|
|
5309
5423
|
},
|
|
5310
5424
|
"_summary": {
|
|
@@ -5690,10 +5804,10 @@
|
|
|
5690
5804
|
"type": "boolean",
|
|
5691
5805
|
"default": false
|
|
5692
5806
|
},
|
|
5693
|
-
"
|
|
5807
|
+
"overridable_attribute": {
|
|
5694
5808
|
"type": "boolean",
|
|
5695
5809
|
"default": false,
|
|
5696
|
-
"description": "Allow conditional variants of the entity to override this attribute's value.\nOnly meaningful on schemas that declare `conditions`. Unflagged attributes stay\nfixed on the base entity.\n"
|
|
5810
|
+
"description": "Allow conditional variants of the entity to override this attribute's value.\nOnly meaningful on schemas that declare `conditions`. Unflagged attributes stay\nfixed on the base entity.\n\nAccepted on scalar attributes and on relations — a variant overrides a relation by\nreplacing its whole `$relation` list (e.g. a product's prices). Rejected on system\n(`_`-prefixed), `readonly`, `hidden`, `computed` and `repeatable` attributes.\n"
|
|
5697
5811
|
},
|
|
5698
5812
|
"default_value": {},
|
|
5699
5813
|
"group": {
|
|
@@ -7365,15 +7479,36 @@
|
|
|
7365
7479
|
"select"
|
|
7366
7480
|
]
|
|
7367
7481
|
},
|
|
7368
|
-
"
|
|
7482
|
+
"options": {
|
|
7369
7483
|
"type": "array",
|
|
7370
|
-
"description": "Selectable options. May be empty while the condition is being
|
|
7484
|
+
"description": "Selectable options, in the same shape a `select` attribute's `options` take: a bare\nvalue or a `{ value, title }` object. May be empty while the condition is being\nconfigured.\n",
|
|
7371
7485
|
"items": {
|
|
7372
|
-
"
|
|
7486
|
+
"anyOf": [
|
|
7487
|
+
{
|
|
7488
|
+
"type": "string"
|
|
7489
|
+
},
|
|
7490
|
+
{
|
|
7491
|
+
"type": "object",
|
|
7492
|
+
"properties": {
|
|
7493
|
+
"value": {
|
|
7494
|
+
"type": "string"
|
|
7495
|
+
},
|
|
7496
|
+
"title": {
|
|
7497
|
+
"type": "string"
|
|
7498
|
+
}
|
|
7499
|
+
},
|
|
7500
|
+
"required": [
|
|
7501
|
+
"value"
|
|
7502
|
+
]
|
|
7503
|
+
}
|
|
7504
|
+
]
|
|
7373
7505
|
},
|
|
7374
7506
|
"example": [
|
|
7375
7507
|
"12_months",
|
|
7376
|
-
|
|
7508
|
+
{
|
|
7509
|
+
"value": "24_months",
|
|
7510
|
+
"title": "24 months"
|
|
7511
|
+
}
|
|
7377
7512
|
]
|
|
7378
7513
|
}
|
|
7379
7514
|
},
|
|
@@ -7415,7 +7550,7 @@
|
|
|
7415
7550
|
]
|
|
7416
7551
|
},
|
|
7417
7552
|
"ConditionDefinition": {
|
|
7418
|
-
"description": "One dimension that conditional variants of an entity type are keyed by. `type`\ndiscriminates the variants: only a `select` condition carries `
|
|
7553
|
+
"description": "One dimension that conditional variants of an entity type are keyed by. `type`\ndiscriminates the variants: only a `select` condition carries `options`, and only a\n`location` condition carries `format`.\n",
|
|
7419
7554
|
"oneOf": [
|
|
7420
7555
|
{
|
|
7421
7556
|
"$ref": "#/components/schemas/ScalarConditionDefinition"
|
|
@@ -7477,10 +7612,19 @@
|
|
|
7477
7612
|
"$ref": "#/components/schemas/Attribute"
|
|
7478
7613
|
}
|
|
7479
7614
|
},
|
|
7480
|
-
"
|
|
7615
|
+
"overridable_attribute": {
|
|
7481
7616
|
"type": "boolean",
|
|
7482
7617
|
"default": false,
|
|
7483
|
-
"description": "Allow conditional variants
|
|
7618
|
+
"description": "Allow conditional variants to override the fields this capability manages. Only\nmeaningful on schemas that declare `conditions`, and requires `managed_fields`: the\nflag covers exactly what that lists, not the capability's name.\n"
|
|
7619
|
+
},
|
|
7620
|
+
"managed_fields": {
|
|
7621
|
+
"type": "array",
|
|
7622
|
+
"description": "Every entity field this capability writes, including one named after the capability\nitself. With `overridable_attribute`, this is the definitive list of what a variant\nmay override through the capability, applied as a single patch.\n\nFields, not attributes: a capability may write entity fields that have no attribute\ndefinition, so entries need not resolve to one. Where an entry does resolve to an\nattribute, `hidden` and `computed` do not disqualify it.\n",
|
|
7623
|
+
"items": {
|
|
7624
|
+
"type": "string",
|
|
7625
|
+
"pattern": "^[a-z0-9_]+$",
|
|
7626
|
+
"example": "status"
|
|
7627
|
+
}
|
|
7484
7628
|
},
|
|
7485
7629
|
"_purpose": {
|
|
7486
7630
|
"type": "array",
|
package/dist/schema-model.d.ts
CHANGED
|
@@ -1,8 +1,27 @@
|
|
|
1
|
+
import type { Attribute } from './openapi';
|
|
2
|
+
/** Every `type` an entity schema attribute can have. */
|
|
3
|
+
export type AttributeType = NonNullable<Attribute['type']>;
|
|
1
4
|
export declare enum RelationAffinityMode {
|
|
2
|
-
/**
|
|
3
|
-
* For strong affinity mode on a relation attribute, deleting or creating the parent or the relation linkage will trigger a CASCADE delete or create to the relation entity itself.
|
|
4
|
-
* For weak affinity mode on a relation attribute, deleting or creating the parent or the relation linkage will NOT trigger a CASCADE delete or create to the relation entity itself.
|
|
5
|
-
*/
|
|
5
|
+
/** Deleting or creating the parent or the linkage does NOT cascade to the relation entity. */
|
|
6
6
|
WEAK = "weak",
|
|
7
|
+
/** Deleting or creating the parent or the linkage cascades to the relation entity. */
|
|
7
8
|
STRONG = "strong"
|
|
8
9
|
}
|
|
10
|
+
/** Types that point at another entity. A repeatable relation is still a relation. */
|
|
11
|
+
export declare const RELATION_ATTRIBUTE_TYPE_LIST: readonly ["relation", "relation_user", "relation_address", "relation_payment_method"];
|
|
12
|
+
/** `string`, not `AttributeType`, so callers can test an unnarrowed `attribute.type`. */
|
|
13
|
+
export declare const RELATION_ATTRIBUTE_TYPES: ReadonlySet<string>;
|
|
14
|
+
/**
|
|
15
|
+
* Entity attribute types a conditional pricing variant may override (`overridable_attribute`).
|
|
16
|
+
* An allowlist, so a new scalar type is never overridable by default; a new relation type is, since
|
|
17
|
+
* relations are overridable by kind. No pricing schema to `satisfies` against — `models.test.ts`
|
|
18
|
+
* checks these against the entity spec.
|
|
19
|
+
*
|
|
20
|
+
* Scalars are overridden value for value. The relation types are overridden as a whole: the
|
|
21
|
+
* variant's `$relation` list replaces the base entity's, which is how a variant swaps a product's
|
|
22
|
+
* prices or a composite price's components. They are spread from `RELATION_ATTRIBUTE_TYPE_LIST`
|
|
23
|
+
* above rather than restated, so the two sets cannot drift.
|
|
24
|
+
*/
|
|
25
|
+
export declare const OVERRIDABLE_ATTRIBUTE_TYPE_LIST: readonly ["string", "number", "currency", "boolean", "date", "datetime", "select", "radio", "multiselect", "checkbox", "country", "tags", "relation", "relation_user", "relation_address", "relation_payment_method"];
|
|
26
|
+
/** `string`, not a literal union, so callers can test an unnarrowed `attribute.type`. */
|
|
27
|
+
export declare const OVERRIDABLE_ATTRIBUTE_TYPES: ReadonlySet<string>;
|
package/dist/schema-model.js
CHANGED
|
@@ -1,13 +1,56 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
+
if (ar || !(i in from)) {
|
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
+
ar[i] = from[i];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RelationAffinityMode = void 0;
|
|
12
|
+
exports.OVERRIDABLE_ATTRIBUTE_TYPES = exports.OVERRIDABLE_ATTRIBUTE_TYPE_LIST = exports.RELATION_ATTRIBUTE_TYPES = exports.RELATION_ATTRIBUTE_TYPE_LIST = exports.RelationAffinityMode = void 0;
|
|
4
13
|
var RelationAffinityMode;
|
|
5
14
|
(function (RelationAffinityMode) {
|
|
6
|
-
/**
|
|
7
|
-
* For strong affinity mode on a relation attribute, deleting or creating the parent or the relation linkage will trigger a CASCADE delete or create to the relation entity itself.
|
|
8
|
-
* For weak affinity mode on a relation attribute, deleting or creating the parent or the relation linkage will NOT trigger a CASCADE delete or create to the relation entity itself.
|
|
9
|
-
*/
|
|
15
|
+
/** Deleting or creating the parent or the linkage does NOT cascade to the relation entity. */
|
|
10
16
|
RelationAffinityMode["WEAK"] = "weak";
|
|
17
|
+
/** Deleting or creating the parent or the linkage cascades to the relation entity. */
|
|
11
18
|
RelationAffinityMode["STRONG"] = "strong";
|
|
12
19
|
})(RelationAffinityMode = exports.RelationAffinityMode || (exports.RelationAffinityMode = {}));
|
|
20
|
+
/** Types that point at another entity. A repeatable relation is still a relation. */
|
|
21
|
+
exports.RELATION_ATTRIBUTE_TYPE_LIST = [
|
|
22
|
+
'relation',
|
|
23
|
+
'relation_user',
|
|
24
|
+
'relation_address',
|
|
25
|
+
'relation_payment_method',
|
|
26
|
+
];
|
|
27
|
+
/** `string`, not `AttributeType`, so callers can test an unnarrowed `attribute.type`. */
|
|
28
|
+
exports.RELATION_ATTRIBUTE_TYPES = new Set(exports.RELATION_ATTRIBUTE_TYPE_LIST);
|
|
29
|
+
/**
|
|
30
|
+
* Entity attribute types a conditional pricing variant may override (`overridable_attribute`).
|
|
31
|
+
* An allowlist, so a new scalar type is never overridable by default; a new relation type is, since
|
|
32
|
+
* relations are overridable by kind. No pricing schema to `satisfies` against — `models.test.ts`
|
|
33
|
+
* checks these against the entity spec.
|
|
34
|
+
*
|
|
35
|
+
* Scalars are overridden value for value. The relation types are overridden as a whole: the
|
|
36
|
+
* variant's `$relation` list replaces the base entity's, which is how a variant swaps a product's
|
|
37
|
+
* prices or a composite price's components. They are spread from `RELATION_ATTRIBUTE_TYPE_LIST`
|
|
38
|
+
* above rather than restated, so the two sets cannot drift.
|
|
39
|
+
*/
|
|
40
|
+
exports.OVERRIDABLE_ATTRIBUTE_TYPE_LIST = __spreadArray([
|
|
41
|
+
'string',
|
|
42
|
+
'number',
|
|
43
|
+
'currency',
|
|
44
|
+
'boolean',
|
|
45
|
+
'date',
|
|
46
|
+
'datetime',
|
|
47
|
+
'select',
|
|
48
|
+
'radio',
|
|
49
|
+
'multiselect',
|
|
50
|
+
'checkbox',
|
|
51
|
+
'country',
|
|
52
|
+
'tags'
|
|
53
|
+
], exports.RELATION_ATTRIBUTE_TYPE_LIST, true);
|
|
54
|
+
/** `string`, not a literal union, so callers can test an unnarrowed `attribute.type`. */
|
|
55
|
+
exports.OVERRIDABLE_ATTRIBUTE_TYPES = new Set(exports.OVERRIDABLE_ATTRIBUTE_TYPE_LIST);
|
|
13
56
|
//# sourceMappingURL=schema-model.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epilot/entity-client",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.5.2",
|
|
4
4
|
"description": "JavaScript client library for the epilot Core Entity API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"prepublishOnly": "npm run typegen && npm run build",
|
|
29
29
|
"openapi": "node ../../scripts/update-openapi.js https://docs.api.epilot.io/entity.yaml",
|
|
30
30
|
"typegen": "openapi typegen src/openapi.json --client > src/openapi.d.ts",
|
|
31
|
+
"openapi:local": "node ../../scripts/update-openapi.js ../../../entity-api/lambda/ApiHandlerFunction/openapi.yml",
|
|
31
32
|
"build": "tsc && npm run build:patch && npm run bundle-definition",
|
|
32
33
|
"build:patch": "sed -i'' -e '/^__exportStar.*openapi.*$/d' dist/index.js",
|
|
33
34
|
"build:watch": "npm run build && tsc -w",
|