@syncmatters/connector-sdk 1.0.12 → 1.0.14
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/docs/04-meta-objects-fields.md +10 -1
- package/docs/05-query.md +12 -1
- package/package.json +3 -3
|
@@ -111,9 +111,18 @@ upsertFields.unshift({
|
|
|
111
111
|
### Match rules
|
|
112
112
|
|
|
113
113
|
`matchRules` values: `"id"`, `"name[ci]"`, `"email[ci]"`, `"domain[ci]"`,
|
|
114
|
-
`"first_and_last_name[ci]"`, `"field_value_equals[ci]"
|
|
114
|
+
`"first_and_last_name[ci]"`, `"field_value_equals[ci]"`, `"field_values_equal[ci]"`. Declare
|
|
115
115
|
only rules `query()` actually implements via `matchFilter` — see [05-query.md](./05-query.md).
|
|
116
116
|
|
|
117
|
+
`[ci]` = case-insensitive: text values compare ignoring case; enumeration/picklist, number, date
|
|
118
|
+
and boolean values compare on the destination system's canonical stored value (for picklists, the
|
|
119
|
+
option's internal id). Where the API allows, canonicalize the incoming value (e.g. resolve a
|
|
120
|
+
picklist label or differently-cased id to the option id) before filtering.
|
|
121
|
+
|
|
122
|
+
`"field_values_equal[ci]"` is the multi-field variant: 1-5 user-selected (source, destination)
|
|
123
|
+
field pairs that must ALL be equal (`destA = a AND destB = b ...`). Declare it only when the API
|
|
124
|
+
can apply several equality filters in one query (search filter groups, SOQL/OData `and`, ...).
|
|
125
|
+
|
|
117
126
|
**Commonly forgotten:** an object that supports `idsFilter` can ALWAYS offer
|
|
118
127
|
`"field_value_equals[ci]"` — with `canMatch: true` on its id field, the match is just a
|
|
119
128
|
lookup of the supplied value by id. There is no reason for such an object to declare no
|
package/docs/05-query.md
CHANGED
|
@@ -227,7 +227,7 @@ cover yours with a direct query in another prepare hook
|
|
|
227
227
|
|
|
228
228
|
### matchFilter
|
|
229
229
|
|
|
230
|
-
`{ rule, selectOrder?, destFieldPath?, srcData: [{ srcRowId, match: { id?, name?, email?, domain?, firstname?, lastname?, custom? } }], canUse }`.
|
|
230
|
+
`{ rule, selectOrder?, destFieldPath?, destFieldPaths?, srcData: [{ srcRowId, match: { id?, name?, email?, domain?, firstname?, lastname?, custom?, customs? } }], canUse }`.
|
|
231
231
|
|
|
232
232
|
For each `srcData` entry, search rows matching per the `rule` (e.g. `"email[ci]"` — compare
|
|
233
233
|
case-insensitively). Collect candidates, then call `await options.matchFilter.canUse([{ srcRowId,
|
|
@@ -240,6 +240,17 @@ candidates }])` — the platform reserves un-mapped matches and returns the sele
|
|
|
240
240
|
- **first_and_last_name[ci]** - inspect the `match.firstname` and values and `match.lastname` and search for rows with the same name.
|
|
241
241
|
- **id** - inspect the `match.id` value and search in the selected `destFieldPath` (path to the field on the target system) to find rows holding this exact value in this field. This search is case sensitive.
|
|
242
242
|
- **field_value_equals[ci]** - inspect the `match.custom` value and search in the selected `destFieldPath` (path to the field on the target system) to find rows holding this value (case insensitive) in this field.
|
|
243
|
+
- **field_values_equal[ci]** - `destFieldPaths[k]` pairs with `match.customs[k]` (1-5 pairs); find rows where **every** pair is equal (case insensitive), i.e. `destFieldPaths[0] = customs[0] AND destFieldPaths[1] = customs[1] ...`. A `""` entry in `customs` means that destination field must be empty/absent: filter for "empty" (e.g. HubSpot `NOT_HAS_PROPERTY`, SOQL `= null`), never drop the filter, because dropping it widens the search. The platform only sends a blank when the user enabled "match blank values" for that pair, and never sends a row whose values are all blank.
|
|
244
|
+
|
|
245
|
+
`destFieldPath` is set only for `id` and `field_value_equals[ci]`; `destFieldPaths` only for
|
|
246
|
+
`field_values_equal[ci]`. Nested fields use the same path shape as `fields` (e.g.
|
|
247
|
+
`[{ path: "custom_fields" }, { path: "tax_id" }]`). `srcData` is a batch — search them
|
|
248
|
+
together where the API allows it. `match.id` already includes the user's source-id prefix when
|
|
249
|
+
they configured one.
|
|
250
|
+
|
|
251
|
+
The in-app Help article *Calling a connection from a script* has copy-paste `matchFilter`
|
|
252
|
+
objects for every rule (same `rule` / `srcData` / `destFieldPath(s)` the platform sends here,
|
|
253
|
+
plus `canUse` on this path). Do not duplicate that catalog in this file.
|
|
243
254
|
|
|
244
255
|
### relatedFilter
|
|
245
256
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syncmatters/connector-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
4
4
|
"description": "TypeScript type definitions for the SyncMatters connector SDK (types only - connectors execute on the SyncMatters platform)",
|
|
5
5
|
"types": "./index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"author": "SyncMatters",
|
|
14
14
|
"homepage": "https://syncmatters.com",
|
|
15
|
-
"typesContentHash": "
|
|
15
|
+
"typesContentHash": "09f69999930df0f8199bfd417a03cfa1bb882d929614b96a26f8f52e7acab0f9",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@types/node": "*",
|
|
18
|
-
"@syncmatters/script-api": "^1.0.
|
|
18
|
+
"@syncmatters/script-api": "^1.0.15"
|
|
19
19
|
}
|
|
20
20
|
}
|