@epilot/entity-client 7.2.0 → 7.2.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/dist/openapi.json CHANGED
@@ -5650,7 +5650,7 @@
5650
5650
  "default": "direct"
5651
5651
  },
5652
5652
  "edit_mode_config": {
5653
- "description": "Configuration for non-direct edit modes. Required when edit_mode is external or approval with fuzzy match strategy.",
5653
+ "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
5654
  "allOf": [
5655
5655
  {
5656
5656
  "$ref": "#/components/schemas/EditModeConfig"
@@ -9729,14 +9729,19 @@
9729
9729
  },
9730
9730
  "edit_mode": {
9731
9731
  "type": "string",
9732
- "description": "The edit mode that triggered this changeset",
9732
+ "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
9733
  "enum": [
9734
9734
  "external",
9735
9735
  "approval"
9736
9736
  ]
9737
9737
  },
9738
9738
  "match_strategy": {
9739
- "$ref": "#/components/schemas/MatchStrategy"
9739
+ "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",
9740
+ "allOf": [
9741
+ {
9742
+ "$ref": "#/components/schemas/MatchStrategy"
9743
+ }
9744
+ ]
9740
9745
  },
9741
9746
  "source": {
9742
9747
  "type": "string",
@@ -9768,7 +9773,7 @@
9768
9773
  },
9769
9774
  "EditModeConfig": {
9770
9775
  "type": "object",
9771
- "description": "Configuration for non-direct edit modes on an entity attribute.",
9776
+ "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
9777
  "properties": {
9773
9778
  "match_strategy": {
9774
9779
  "$ref": "#/components/schemas/MatchStrategy"
@@ -9780,7 +9785,7 @@
9780
9785
  },
9781
9786
  "FuzzyConfig": {
9782
9787
  "type": "object",
9783
- "description": "Configuration for fuzzy match strategies on changeset auto-clearing.",
9788
+ "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
9789
  "required": [
9785
9790
  "type"
9786
9791
  ],
@@ -9793,7 +9798,9 @@
9793
9798
  "digits_only",
9794
9799
  "normalize_phone",
9795
9800
  "ignore_fields",
9796
- "contains_entry",
9801
+ "set_equivalent",
9802
+ "entry_match",
9803
+ "relation_set",
9797
9804
  "regex"
9798
9805
  ]
9799
9806
  },
@@ -9806,7 +9813,7 @@
9806
9813
  "items": {
9807
9814
  "type": "string"
9808
9815
  },
9809
- "description": "For type=ignore_fields: field names to exclude when comparing array entries."
9816
+ "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
9817
  },
9811
9818
  "regex_flags": {
9812
9819
  "type": "string",
@@ -9818,7 +9825,37 @@
9818
9825
  },
9819
9826
  "match_on": {
9820
9827
  "type": "string",
9821
- "description": "For type=normalize_phone and type=contains_entry: attribute key(s) within array entries to compare on."
9828
+ "description": "For type=normalize_phone: attribute key within array entries to compare on (e.g. 'phone_number')."
9829
+ },
9830
+ "key": {
9831
+ "description": "For type=entry_match: business key(s) within each entry used to match proposed entries against incoming entries.",
9832
+ "oneOf": [
9833
+ {
9834
+ "type": "string"
9835
+ },
9836
+ {
9837
+ "type": "array",
9838
+ "items": {
9839
+ "type": "string"
9840
+ }
9841
+ }
9842
+ ]
9843
+ },
9844
+ "mode": {
9845
+ "type": "string",
9846
+ "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",
9847
+ "enum": [
9848
+ "subset",
9849
+ "exact_set"
9850
+ ]
9851
+ },
9852
+ "ordered": {
9853
+ "type": "boolean",
9854
+ "description": "For type=relation_set: when true, relation order is significant. Defaults to false (order-insensitive)."
9855
+ },
9856
+ "require_tags_match": {
9857
+ "type": "boolean",
9858
+ "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
9859
  },
9823
9860
  "pattern": {
9824
9861
  "type": "string",
@@ -9828,7 +9865,7 @@
9828
9865
  },
9829
9866
  "MatchStrategy": {
9830
9867
  "type": "string",
9831
- "description": "Strategy for auto-clearing the changeset when an external update is received.\n- `exact`: The inbound value must exactly match the proposed value (deep equality).\n- `fuzzy`: The inbound value is compared using the configured fuzzy algorithm.\n- `any`: Any update to the attribute clears the changeset, regardless of value.\n",
9868
+ "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
9869
  "enum": [
9833
9870
  "exact",
9834
9871
  "fuzzy",
@@ -10074,7 +10111,7 @@
10074
10111
  },
10075
10112
  "DirectQueryParam": {
10076
10113
  "name": "direct",
10077
- "description": "When true, bypasses changeset interception and applies attribute updates directly.\nUsed by trusted integrations (e.g. ERP inbound sync) to confirm changes and auto-clear matching pending changesets.\nDefaults to false — no breaking change for existing callers.\n",
10114
+ "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
10115
  "in": "query",
10079
10116
  "required": false,
10080
10117
  "schema": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/entity-client",
3
- "version": "7.2.0",
3
+ "version": "7.2.1",
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",