@syncmatters/connector-sdk 1.0.29 → 1.0.31

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.
@@ -69,7 +69,7 @@ await this.#core.init(args);
69
69
  | Field | Values / meaning |
70
70
  | -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
71
71
  | `name` | the file name, e.g. `"Acme.mjs"` |
72
- | `type` | `"connector"` (entry) · `"module"` · `"connectortest"` · `"json"` · `"yaml"` · `"markdown"` (help docs shipped beside the connector, e.g. `Connectors/<Name>/help/index.md` — see [17-user-help-pages.md](./17-user-help-pages.md); never a module, never staged at runtime) |
72
+ | `type` | `"connector"` (entry) · `"module"` · `"connectortest"` · `"json"` · `"yaml"` · `"markdown"` (help docs shipped beside the connector, e.g. `Connectors/<Name>/help/index.md` — see [17-user-help-pages.md](./17-user-help-pages.md); never a module, never staged at runtime) · `"connector_overrides"` (a derived connector; see [Connector overrides](#connector-overrides) below) |
73
73
  | `runnable` | `false` for connector files (they are invoked by the platform, not run directly) |
74
74
  | `engine` | runtime engine version int; leave as scaffolded unless told otherwise |
75
75
  | `resource_size` | `""` or `"medium"` — runtime resource class hint |
@@ -229,6 +229,52 @@ Delete and Full columns) and optional `read_mandatory`/`write_mandatory`/`delete
229
229
  (`"write": "acme:create acme:update"`), never commas. The Delete column only shows when some item
230
230
  sets `delete`.
231
231
 
232
+ ## Connector overrides
233
+
234
+ A partner can publish a variant of an existing connector (its own OAuth app, different defaults,
235
+ an on-premise edition) without copying the code. The variant is a `connector_overrides` file:
236
+ `files/Connectors/<Name>/<Name>.json` (contents `{}`) with a connector sidecar whose
237
+ `connector_metadata` is **sparse** and names the source bundle. The CLI writes the pair with
238
+ `sm connector overrides init <Name> --source <connector>`; `sm files push` creates it, and
239
+ publishing happens in the web UI as for any connector.
240
+
241
+ ```json
242
+ {
243
+ "type": "connector_overrides",
244
+ "connector_metadata": {
245
+ "source_bundle_unique_id": "<unique id of the source bundle>",
246
+ "connector_name": "HubSpot for Acme",
247
+ "application_name": "for Acme",
248
+ "oauth2_provider": { "client_id": "...", "client_secret": "..." },
249
+ "agent_mode": "always",
250
+ "default_objects": ["Contacts", "Companies"],
251
+ "settings": {
252
+ "event_types_exclude": { "default": { "type": "string", "expression": "acme" } },
253
+ "url": { "hidden": true, "default": { "type": "string", "expression": "https://..." } }
254
+ }
255
+ }
256
+ }
257
+ ```
258
+
259
+ Merge rules: a key present overrides the source, absent inherits, `null` clears; `settings` merge
260
+ per setting id and, inside a setting, per attribute; arrays (`default_objects`, `scope_groups`,
261
+ `categories`) replace whole. A setting's contract with the code (`type`, `control`, `options`,
262
+ `template`, `secret`, `readonly`, `staticonly`, `connector_managed`, `mandatory`,
263
+ `defines_version`, `prerequisite`, `affects_meta`) cannot be overridden, a child may only touch
264
+ settings the source declares, and the source must be a published, non-deprecated connector that
265
+ is not itself derived (one level only). A source sidecar may opt out with `"overrides": false`
266
+ beside `connector_metadata`. Secrets round-trip as for any connector: after the first push the
267
+ platform withholds `client_secret` and a secret setting's default, and pushing the sidecar back
268
+ without them keeps the stored values. `sm pull` returns the sparse document, never the merged one;
269
+ `sm connector overrides show <Name>` prints the merged view with each key tagged inherited or
270
+ overridden, and `sm validate` applies the rules above locally (`--offline` skips the checks that
271
+ need the source).
272
+
273
+ The connector code is unchanged and never sees the difference: `args.connectorMetadata`, the
274
+ settings form, `discover()` pre-selection (`default_objects`) and the OAuth token all come from the
275
+ merged document at run time. `sm connector features` and `sm connector test` run against the
276
+ source's code; point them at the source when iterating on a child.
277
+
232
278
  ## Do not edit
233
279
 
234
280
  - `.sm/` (CLI state), and the CLI-generated `package.json` / `jsconfig.json` / `AGENTS.md`
@@ -142,7 +142,7 @@ same as "no list support". See [the query capability bar](#the-query-capability-
142
142
  | `objectFields` | child fields when `type: "object"` |
143
143
  | `arrayType` / `arrayObjectFields` | element type / element fields when `type: "array"` |
144
144
  | `constraints` | validation: `mandatory` (`"always"` · `"add"` · `"update"`; array children only when parent array is non-empty), `max/min/maxLen/minLen`, `regex`, `email`, `integer`, `decimals`, `trim`, `dt: { format: "iso8601", "unix", ... }` |
145
- | `isCustom` | account-specific/custom field |
145
+ | `isCustom` | the field, and everything below it, is account-specific: a field the account created, or a vendor field with no meaning of its own that only holds an attribute each account defines (a user-defined-value slot, a generic custom-field array, `Custom1..N`). Put it on the container, not only on its leaves. A tenant-defined picklist or a notes field is not custom: the vendor defines what it holds. See below |
146
146
  | `data` | connector-private payload, echoed back in metadata |
147
147
 
148
148
  ### `isKey` vs `isUserKey`
@@ -173,6 +173,23 @@ upsertFields.unshift({
173
173
  });
174
174
  ```
175
175
 
176
+ ### `isCustom`: what counts as custom
177
+
178
+ The test is whether the vendor gives the field a meaning of its own. Custom (`isCustom: true`):
179
+
180
+ - fields the account created (Salesforce `__c`, NetSuite `custentity*`, HubSpot portal properties);
181
+ - vendor fields that are only a slot for an attribute each account defines: user-defined-value
182
+ blocks (Rent Manager `UserDefinedValues`, `PreferredUnitUserDefinedValues`), generic
183
+ custom-field arrays (QuickBooks `CustomField`, Greenhouse `custom_fields`), numbered
184
+ `Custom1..N` fields.
185
+
186
+ Not custom: a vendor field whose picklist options or free text vary per account (a status, a
187
+ notes field). The vendor defines what it holds; only the values differ.
188
+
189
+ Set the flag on the container (the object or array field), so tools that walk the tree skip
190
+ everything below it. The field-type corpus extractor leaves custom fields out of the training
191
+ data, and the fields table badges them; auto-map does not read the flag today (2026-11-15).
192
+
176
193
  ### Match rules
177
194
 
178
195
  `matchRules` values: `"id"`, `"name[ci]"`, `"email[ci]"`, `"domain[ci]"`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncmatters/connector-sdk",
3
- "version": "1.0.29",
3
+ "version": "1.0.31",
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": "576827d7dfbc5a2f3ab03eb3d88826793cdf7f5165bb8269649390db04919211",
15
+ "typesContentHash": "3c75400956eb3109c9b2590713c62e2117abb6deb975ac47b98b055ceb6de7c0",
16
16
  "dependencies": {
17
17
  "@types/node": "*",
18
- "@syncmatters/script-api": "^1.0.33"
18
+ "@syncmatters/script-api": "^1.0.36"
19
19
  }
20
20
  }