@epilot/entity-client 7.2.0 → 7.2.1-rc1
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.d.ts +1076 -333
- package/dist/openapi.json +232 -18
- package/package.json +1 -1
package/dist/openapi.json
CHANGED
|
@@ -5640,17 +5640,15 @@
|
|
|
5640
5640
|
"type": "boolean"
|
|
5641
5641
|
},
|
|
5642
5642
|
"edit_mode": {
|
|
5643
|
-
"
|
|
5644
|
-
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
"external",
|
|
5648
|
-
"approval"
|
|
5643
|
+
"allOf": [
|
|
5644
|
+
{
|
|
5645
|
+
"$ref": "#/components/schemas/EditMode"
|
|
5646
|
+
}
|
|
5649
5647
|
],
|
|
5650
|
-
"
|
|
5648
|
+
"description": "Controls how updates to this attribute are handled. See the `EditMode`\nschema for the per-mode semantics. Defaults to `direct`.\n"
|
|
5651
5649
|
},
|
|
5652
5650
|
"edit_mode_config": {
|
|
5653
|
-
"description": "Configuration for
|
|
5651
|
+
"description": "Configuration for auto-clear matching on `edit_mode: external` attributes.\n`match_strategy` and `fuzzy_config` are only consulted for `external` mode —\nthey are ignored for `approval` mode, which resolves via explicit\n`:apply` / `:dismiss` endpoints and never auto-clears.\n",
|
|
5654
5652
|
"allOf": [
|
|
5655
5653
|
{
|
|
5656
5654
|
"$ref": "#/components/schemas/EditModeConfig"
|
|
@@ -7581,7 +7579,7 @@
|
|
|
7581
7579
|
"readOnly": true,
|
|
7582
7580
|
"type": "object",
|
|
7583
7581
|
"nullable": true,
|
|
7584
|
-
"description": "Pending attribute changesets for attributes configured with external or approval edit mode.\nRead-only via normal entity PATCH/PUT operations —
|
|
7582
|
+
"description": "Pending attribute changesets for attributes configured with external or approval edit mode.\n\nThe value shape is `Changeset` (`proposed_value`, `created_at`, `edit_mode`, ...)\nand is what `:apply` / `:dismiss` operate on.\n\nRead-only via normal entity PATCH/PUT operations — those handlers strip `_changesets`\nfrom request bodies. Use the changeset management endpoints to mutate this field.\n",
|
|
7585
7583
|
"additionalProperties": {
|
|
7586
7584
|
"$ref": "#/components/schemas/Changeset"
|
|
7587
7585
|
}
|
|
@@ -9729,14 +9727,19 @@
|
|
|
9729
9727
|
},
|
|
9730
9728
|
"edit_mode": {
|
|
9731
9729
|
"type": "string",
|
|
9732
|
-
"description": "The edit mode that triggered this changeset",
|
|
9730
|
+
"description": "The edit mode that triggered this changeset.\n- `external`: auto-cleared by a matching `?direct=true` write (see `match_strategy`).\n- `approval`: resolved only via explicit `:apply` / `:dismiss` endpoints; never auto-clears.\n",
|
|
9733
9731
|
"enum": [
|
|
9734
9732
|
"external",
|
|
9735
9733
|
"approval"
|
|
9736
9734
|
]
|
|
9737
9735
|
},
|
|
9738
9736
|
"match_strategy": {
|
|
9739
|
-
"
|
|
9737
|
+
"description": "Match strategy copied from the attribute's `edit_mode_config` at changeset\ncreation time. Only consulted when `edit_mode` is `external`; ignored for\n`approval` (which never auto-clears).\n",
|
|
9738
|
+
"allOf": [
|
|
9739
|
+
{
|
|
9740
|
+
"$ref": "#/components/schemas/MatchStrategy"
|
|
9741
|
+
}
|
|
9742
|
+
]
|
|
9740
9743
|
},
|
|
9741
9744
|
"source": {
|
|
9742
9745
|
"type": "string",
|
|
@@ -9766,9 +9769,188 @@
|
|
|
9766
9769
|
"$ref": "#/components/schemas/Changeset"
|
|
9767
9770
|
}
|
|
9768
9771
|
},
|
|
9772
|
+
"MeterReadingChangesetEntry": {
|
|
9773
|
+
"type": "object",
|
|
9774
|
+
"description": "A meter readings changeset entry — service-managed by metering-api.\nStored on `Meter._meter_readings_changeset` array attribute. Each entry mirrors a\nClickHouse meter reading row plus a changeset metadata overlay.\n\nNote: `org_id` is NOT stored on the entry. The entries live on the Meter entity,\nwhich is already org-scoped (`_org`). Round-tripping it would only invite drift;\ndownstream consumers receive the org from the meter / handler context.\n",
|
|
9775
|
+
"required": [
|
|
9776
|
+
"changeset_id",
|
|
9777
|
+
"meter_id",
|
|
9778
|
+
"counter_id",
|
|
9779
|
+
"value",
|
|
9780
|
+
"edit_mode",
|
|
9781
|
+
"created_at"
|
|
9782
|
+
],
|
|
9783
|
+
"properties": {
|
|
9784
|
+
"value": {
|
|
9785
|
+
"type": "number"
|
|
9786
|
+
},
|
|
9787
|
+
"direction": {
|
|
9788
|
+
"type": "string",
|
|
9789
|
+
"enum": [
|
|
9790
|
+
"feed-in",
|
|
9791
|
+
"feed-out"
|
|
9792
|
+
]
|
|
9793
|
+
},
|
|
9794
|
+
"timestamp": {
|
|
9795
|
+
"type": "string",
|
|
9796
|
+
"format": "date-time"
|
|
9797
|
+
},
|
|
9798
|
+
"meter_id": {
|
|
9799
|
+
"type": "string",
|
|
9800
|
+
"format": "uuid"
|
|
9801
|
+
},
|
|
9802
|
+
"counter_id": {
|
|
9803
|
+
"type": "string",
|
|
9804
|
+
"format": "uuid"
|
|
9805
|
+
},
|
|
9806
|
+
"source": {
|
|
9807
|
+
"type": "string"
|
|
9808
|
+
},
|
|
9809
|
+
"reason": {
|
|
9810
|
+
"type": "string"
|
|
9811
|
+
},
|
|
9812
|
+
"read_by": {
|
|
9813
|
+
"type": "string"
|
|
9814
|
+
},
|
|
9815
|
+
"status": {
|
|
9816
|
+
"type": "string",
|
|
9817
|
+
"enum": [
|
|
9818
|
+
"valid",
|
|
9819
|
+
"in-validation",
|
|
9820
|
+
"implausible"
|
|
9821
|
+
]
|
|
9822
|
+
},
|
|
9823
|
+
"external_id": {
|
|
9824
|
+
"type": "string"
|
|
9825
|
+
},
|
|
9826
|
+
"remark": {
|
|
9827
|
+
"type": "string"
|
|
9828
|
+
},
|
|
9829
|
+
"metadata": {
|
|
9830
|
+
"type": "object",
|
|
9831
|
+
"additionalProperties": {
|
|
9832
|
+
"type": "string"
|
|
9833
|
+
}
|
|
9834
|
+
},
|
|
9835
|
+
"changeset_id": {
|
|
9836
|
+
"type": "string",
|
|
9837
|
+
"description": "Unique changeset identifier (UUID v4)."
|
|
9838
|
+
},
|
|
9839
|
+
"edit_mode": {
|
|
9840
|
+
"type": "string",
|
|
9841
|
+
"enum": [
|
|
9842
|
+
"external",
|
|
9843
|
+
"approval"
|
|
9844
|
+
]
|
|
9845
|
+
},
|
|
9846
|
+
"match_strategy": {
|
|
9847
|
+
"type": "string",
|
|
9848
|
+
"enum": [
|
|
9849
|
+
"exact",
|
|
9850
|
+
"fuzzy"
|
|
9851
|
+
]
|
|
9852
|
+
},
|
|
9853
|
+
"timestamp_tolerance": {
|
|
9854
|
+
"description": "Slack on `reading.timestamp` when metering-api auto-clear matches an\nincoming reading against this pending changeset.\n\nVariants:\n- `'exact'`: strict millisecond equality.\n- `{ type: 'same-day', timezone? }`: strip the time component and\n compare year-month-day. Optional `timezone` is an IANA name\n (e.g. `'Europe/Berlin'`); the day is bucketed in that zone.\n Defaults to UTC when omitted.\n- `{ type: 'within-seconds', seconds }`: symmetric ±N-second window.\n",
|
|
9855
|
+
"oneOf": [
|
|
9856
|
+
{
|
|
9857
|
+
"type": "string",
|
|
9858
|
+
"enum": [
|
|
9859
|
+
"exact"
|
|
9860
|
+
]
|
|
9861
|
+
},
|
|
9862
|
+
{
|
|
9863
|
+
"type": "object",
|
|
9864
|
+
"required": [
|
|
9865
|
+
"type"
|
|
9866
|
+
],
|
|
9867
|
+
"properties": {
|
|
9868
|
+
"type": {
|
|
9869
|
+
"type": "string",
|
|
9870
|
+
"enum": [
|
|
9871
|
+
"same-day"
|
|
9872
|
+
]
|
|
9873
|
+
},
|
|
9874
|
+
"timezone": {
|
|
9875
|
+
"type": "string",
|
|
9876
|
+
"description": "IANA timezone identifier (e.g. `'Europe/Berlin'`, `'UTC'`).\nWhen omitted, the day is bucketed in UTC.\n"
|
|
9877
|
+
}
|
|
9878
|
+
}
|
|
9879
|
+
},
|
|
9880
|
+
{
|
|
9881
|
+
"type": "object",
|
|
9882
|
+
"required": [
|
|
9883
|
+
"type",
|
|
9884
|
+
"seconds"
|
|
9885
|
+
],
|
|
9886
|
+
"properties": {
|
|
9887
|
+
"type": {
|
|
9888
|
+
"type": "string",
|
|
9889
|
+
"enum": [
|
|
9890
|
+
"within-seconds"
|
|
9891
|
+
]
|
|
9892
|
+
},
|
|
9893
|
+
"seconds": {
|
|
9894
|
+
"type": "integer",
|
|
9895
|
+
"minimum": 0,
|
|
9896
|
+
"description": "Tolerance in seconds. e.g. 60 = ±1 minute, 3600 = ±1 hour."
|
|
9897
|
+
}
|
|
9898
|
+
}
|
|
9899
|
+
}
|
|
9900
|
+
]
|
|
9901
|
+
},
|
|
9902
|
+
"fuzzy_config": {
|
|
9903
|
+
"type": "object",
|
|
9904
|
+
"properties": {
|
|
9905
|
+
"percentage_threshold": {
|
|
9906
|
+
"type": "number"
|
|
9907
|
+
},
|
|
9908
|
+
"absolute_threshold": {
|
|
9909
|
+
"type": "number"
|
|
9910
|
+
}
|
|
9911
|
+
}
|
|
9912
|
+
},
|
|
9913
|
+
"created_at": {
|
|
9914
|
+
"type": "string",
|
|
9915
|
+
"format": "date-time"
|
|
9916
|
+
},
|
|
9917
|
+
"created_by": {
|
|
9918
|
+
"$ref": "#/components/schemas/ChangesetCreator"
|
|
9919
|
+
},
|
|
9920
|
+
"previous": {
|
|
9921
|
+
"type": "object",
|
|
9922
|
+
"properties": {
|
|
9923
|
+
"value": {
|
|
9924
|
+
"type": "number"
|
|
9925
|
+
},
|
|
9926
|
+
"direction": {
|
|
9927
|
+
"type": "string",
|
|
9928
|
+
"enum": [
|
|
9929
|
+
"feed-in",
|
|
9930
|
+
"feed-out"
|
|
9931
|
+
]
|
|
9932
|
+
},
|
|
9933
|
+
"timestamp": {
|
|
9934
|
+
"type": "string",
|
|
9935
|
+
"format": "date-time"
|
|
9936
|
+
}
|
|
9937
|
+
}
|
|
9938
|
+
}
|
|
9939
|
+
}
|
|
9940
|
+
},
|
|
9941
|
+
"EditMode": {
|
|
9942
|
+
"type": "string",
|
|
9943
|
+
"description": "Controls whether a write goes through immediately or is held as a pending entry\non the parent entity's `_changesets` map.\n\n- `direct`: write applied immediately. No changeset created.\n- `external`: write held as a pending changeset; auto-cleared on a matching direct/ERP write.\n- `approval`: write held as a pending changeset; requires explicit human apply/dismiss.\n\nUsed at two levels: per-attribute (entity-attribute changesets) and per-capability\n(currently the `meter_readings` capability on the Meter schema, gating reading submissions).\n",
|
|
9944
|
+
"enum": [
|
|
9945
|
+
"direct",
|
|
9946
|
+
"external",
|
|
9947
|
+
"approval"
|
|
9948
|
+
],
|
|
9949
|
+
"default": "direct"
|
|
9950
|
+
},
|
|
9769
9951
|
"EditModeConfig": {
|
|
9770
9952
|
"type": "object",
|
|
9771
|
-
"description": "Configuration for
|
|
9953
|
+
"description": "Configuration for `edit_mode: external` auto-clear matching.\nFields here (`match_strategy`, `fuzzy_config`) only take effect when\n`edit_mode` is `external`. They are ignored for `edit_mode: approval`,\nwhich never auto-clears and is resolved exclusively via the\n`:apply` / `:dismiss` changeset endpoints.\n",
|
|
9772
9954
|
"properties": {
|
|
9773
9955
|
"match_strategy": {
|
|
9774
9956
|
"$ref": "#/components/schemas/MatchStrategy"
|
|
@@ -9780,7 +9962,7 @@
|
|
|
9780
9962
|
},
|
|
9781
9963
|
"FuzzyConfig": {
|
|
9782
9964
|
"type": "object",
|
|
9783
|
-
"description": "Configuration for fuzzy
|
|
9965
|
+
"description": "Configuration for fuzzy auto-clear matching on `edit_mode: external` attributes.\nNot used for `edit_mode: approval`.\n\nType compatibility with attribute shape is enforced at schema save time:\n- scalar string attributes: `suffix`, `digits_only`, `regex`\n- repeatable attributes: `set_equivalent`, `entry_match`, `ignore_fields`, `normalize_phone`\n- relation attributes: `relation_set`\n",
|
|
9784
9966
|
"required": [
|
|
9785
9967
|
"type"
|
|
9786
9968
|
],
|
|
@@ -9793,7 +9975,9 @@
|
|
|
9793
9975
|
"digits_only",
|
|
9794
9976
|
"normalize_phone",
|
|
9795
9977
|
"ignore_fields",
|
|
9796
|
-
"
|
|
9978
|
+
"set_equivalent",
|
|
9979
|
+
"entry_match",
|
|
9980
|
+
"relation_set",
|
|
9797
9981
|
"regex"
|
|
9798
9982
|
]
|
|
9799
9983
|
},
|
|
@@ -9806,7 +9990,7 @@
|
|
|
9806
9990
|
"items": {
|
|
9807
9991
|
"type": "string"
|
|
9808
9992
|
},
|
|
9809
|
-
"description": "For type=ignore_fields: field names to exclude when comparing array entries."
|
|
9993
|
+
"description": "For type=ignore_fields and type=set_equivalent: field names to exclude when comparing array entries. `_id` is always stripped by the platform regardless of this config."
|
|
9810
9994
|
},
|
|
9811
9995
|
"regex_flags": {
|
|
9812
9996
|
"type": "string",
|
|
@@ -9818,7 +10002,37 @@
|
|
|
9818
10002
|
},
|
|
9819
10003
|
"match_on": {
|
|
9820
10004
|
"type": "string",
|
|
9821
|
-
"description": "For type=normalize_phone
|
|
10005
|
+
"description": "For type=normalize_phone: attribute key within array entries to compare on (e.g. 'phone_number')."
|
|
10006
|
+
},
|
|
10007
|
+
"key": {
|
|
10008
|
+
"description": "For type=entry_match: business key(s) within each entry used to match proposed entries against incoming entries.",
|
|
10009
|
+
"oneOf": [
|
|
10010
|
+
{
|
|
10011
|
+
"type": "string"
|
|
10012
|
+
},
|
|
10013
|
+
{
|
|
10014
|
+
"type": "array",
|
|
10015
|
+
"items": {
|
|
10016
|
+
"type": "string"
|
|
10017
|
+
}
|
|
10018
|
+
}
|
|
10019
|
+
]
|
|
10020
|
+
},
|
|
10021
|
+
"mode": {
|
|
10022
|
+
"type": "string",
|
|
10023
|
+
"description": "For type=entry_match and type=set_equivalent: how strict the comparison is.\n- `subset` (default for entry_match): every proposed entry must exist in incoming; extra incoming entries are allowed.\n- `exact_set` (default for set_equivalent): the two sides must contain the same entries (order-insensitive, multiset semantics).\n",
|
|
10024
|
+
"enum": [
|
|
10025
|
+
"subset",
|
|
10026
|
+
"exact_set"
|
|
10027
|
+
]
|
|
10028
|
+
},
|
|
10029
|
+
"ordered": {
|
|
10030
|
+
"type": "boolean",
|
|
10031
|
+
"description": "For type=relation_set: when true, relation order is significant. Defaults to false (order-insensitive)."
|
|
10032
|
+
},
|
|
10033
|
+
"require_tags_match": {
|
|
10034
|
+
"type": "boolean",
|
|
10035
|
+
"description": "For type=relation_set: when true, each relation item's `_tags` must match on both sides (order-insensitive). Defaults to false — `_tags` are stripped before compare."
|
|
9822
10036
|
},
|
|
9823
10037
|
"pattern": {
|
|
9824
10038
|
"type": "string",
|
|
@@ -9828,7 +10042,7 @@
|
|
|
9828
10042
|
},
|
|
9829
10043
|
"MatchStrategy": {
|
|
9830
10044
|
"type": "string",
|
|
9831
|
-
"description": "Strategy for auto-clearing
|
|
10045
|
+
"description": "Strategy for auto-clearing a changeset on an `edit_mode: external` attribute\nwhen a direct write (`?direct=true`) arrives — typically an ERP inbound sync.\nIgnored for `edit_mode: approval`, which does not auto-clear and is resolved\nexclusively via the `:apply` / `:dismiss` changeset endpoints.\n- `exact`: The inbound value must exactly match the proposed value (deep equality).\n- `fuzzy`: The inbound value is compared using the configured `fuzzy_config` algorithm.\n- `any`: Any update to the attribute clears the changeset, regardless of value.\n",
|
|
9832
10046
|
"enum": [
|
|
9833
10047
|
"exact",
|
|
9834
10048
|
"fuzzy",
|
|
@@ -10074,7 +10288,7 @@
|
|
|
10074
10288
|
},
|
|
10075
10289
|
"DirectQueryParam": {
|
|
10076
10290
|
"name": "direct",
|
|
10077
|
-
"description": "When true, bypasses changeset interception
|
|
10291
|
+
"description": "When true, bypasses changeset interception: attribute values in the payload\nare written directly to the entity regardless of each attribute's `edit_mode`.\nThe write always lands, independently of any auto-clear outcome below.\n\nAfter the direct write, for each attribute in the payload that also has a\npending changeset:\n- `edit_mode: external` — the incoming value is checked against the\n changeset's `match_strategy` (and `fuzzy_config` when `fuzzy`). On match,\n `_changesets[attr]` is cleared. On no-match, the write still stands and\n the changeset stays pending (signalling the ERP/trusted source applied a\n different correction than originally proposed; resolve via a later\n matching direct write, or via the `:apply` / `:dismiss` endpoints).\n- `edit_mode: approval` — never auto-cleared. The write lands but the\n pending changeset remains until explicitly resolved via `:apply` or\n `:dismiss`.\n\nIntended for trusted integrations (e.g. ERP inbound sync). ERP middleware\nmust always use `?direct=true` — without it, an inbound sync on an\n`external` attribute would create a new changeset instead of confirming\nthe pending one.\n\nDefaults to false — no breaking change for existing callers.\n",
|
|
10078
10292
|
"in": "query",
|
|
10079
10293
|
"required": false,
|
|
10080
10294
|
"schema": {
|