@syncmatters/connector-sdk 1.0.23 → 1.0.25

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.
@@ -174,11 +174,15 @@ Rules worth knowing before you mark anything:
174
174
  previous result is kept and the user is offered a re-collect. Nothing is queued automatically.
175
175
  - A setting with no `options`, in the sidecar or in the overrides, renders as free text. The
176
176
  overrides may also supply `default`, `mandatory`, `readonly`, `hidden` and `description`.
177
- - `prerequisite` is ignored when `discovery` is absent, and `sm validate` rejects
178
- `"discovery": true` with no `prerequisite` setting. It warns when it finds no `discover()` on
179
- the entry class (and vice versa): the flag is what the platform reads, so a flagged class
180
- without the method fails loudly in the wizard with `NotImplimented` rather than being treated
181
- as single-phase.
177
+ - `prerequisite` is ignored when `discovery` is absent. `sm validate` rejects
178
+ `"discovery": true` with no `prerequisite` setting, unless `oauth2_mode` is `"connector"`,
179
+ `"connection"`, or `"connection_optional"`. Those reach the tenant through the OAuth grant,
180
+ which is obtained before `discover()` and is not a connection setting — a connector whose
181
+ only setting is Debug is valid. Do not mark Debug (or any other setting `discover()` does not
182
+ read) `"prerequisite": true` just to pass validation: changing it marks the catalogue stale.
183
+ `sm validate` warns when it finds no `discover()` on the entry class (and vice versa): the
184
+ flag is what the platform reads, so a flagged class without the method fails loudly in the
185
+ wizard with `NotImplimented` rather than being treated as single-phase.
182
186
 
183
187
  #### A version that cannot discover: `"discovery": false` on its option
184
188
 
@@ -18,6 +18,14 @@ this.#http = SDK.utilities.httpClient({
18
18
  `rateLimiter` types: `{ type: "rolling", count, ms }` (N requests per window) and
19
19
  `{ type: "concurrent", count }` (N in flight). Set them from the API's documented limits.
20
20
 
21
+ Thrown error messages have the values of sensitive keys (`password`, `api_key`, `client_secret`,
22
+ `token`, ...) replaced with `***` in the URL, the request body and the response text; keys match
23
+ case-insensitively and ignore `_`/`-`. Pass `redactKeys: { url?: string[], body?: string[] }` to
24
+ replace either default set (`SDK.defaultRedactKeys`), e.g.
25
+ `redactKeys: { body: [...SDK.defaultRedactKeys.body, "ssn"] }`. `SDK.utilities.redact()` gives the
26
+ same `redactUrl` / `redactJSON` / `redactText` helpers for anything the connector logs itself.
27
+ `err.responseBodyString` is never redacted, so parse the raw response from there.
28
+
21
29
  When a window limiter alone is not enough (some APIs also punish burst concurrency), compose
22
30
  two limiters:
23
31
 
package/module.d.ts CHANGED
@@ -2,8 +2,8 @@
2
2
  * Connector SDK (SDK) is a fusion of elements from the script API and
3
3
  * SDK specific elements that would be of no interest to users of the API.
4
4
  */
5
- export { EventScriptComplete } from "@syncmatters/script-api";
6
- export type { Cache, FileProvider, HttpRequest, HttpClientOptions, KvCollection, KvIterator, Logger, EventContext, TestResult, Row, ObjectMeta, ObjectField, ObjectFieldOption, RateLimiterOptions, ScriptType, JsonValuePath, JsonValuePathPart, QueryMatchFilter, QueryCheckpointFilter, EventTypeMeta, ObjectIndex, ObjectMetaUpsert, ObjectRowFilter, ObjectRelationship, ObjectFieldConstraints, ObjectSettingMeta, ObjectUnavailableReason, DiscoverResult, DiscoveredObject, MetaState, MetaStateObject, UpsertIssue, UpsertFieldOptionMeta, RowMatchRuleType, RowMatchData, RowMatchRuleOrder, SyncSession, SyncOptimalBatchSizeOperation, SyncOptimalBatchSizeBatchType, } from "@syncmatters/script-api";
5
+ export { EventScriptComplete, defaultRedactKeys } from "@syncmatters/script-api";
6
+ export type { Cache, FileProvider, HttpRequest, HttpClientOptions, Redactor, RedactorOptions, KvCollection, KvIterator, Logger, EventContext, TestResult, Row, ObjectMeta, ObjectField, ObjectFieldOption, RateLimiterOptions, ScriptType, JsonValuePath, JsonValuePathPart, QueryMatchFilter, QueryCheckpointFilter, EventTypeMeta, ObjectIndex, ObjectMetaUpsert, ObjectRowFilter, ObjectRelationship, ObjectFieldConstraints, ObjectSettingMeta, ObjectUnavailableReason, DiscoverResult, DiscoveredObject, MetaState, MetaStateObject, UpsertIssue, UpsertFieldOptionMeta, RowMatchRuleType, RowMatchData, RowMatchRuleOrder, SyncSession, SyncOptimalBatchSizeOperation, SyncOptimalBatchSizeBatchType, } from "@syncmatters/script-api";
7
7
  export * from "./lib/connector.js";
8
8
  export * from "./lib/connector-error.js";
9
9
  export { envSet } from "./lib/environment.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncmatters/connector-sdk",
3
- "version": "1.0.23",
3
+ "version": "1.0.25",
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": "e95f9d6b630e71d88bbe6141c111d148e0024e2e77b094d06f9874fc8de4a89f",
15
+ "typesContentHash": "5ea245d19c1ae9cf77813b006dc086f8af3da239b45a765793beec7b482770f3",
16
16
  "dependencies": {
17
17
  "@types/node": "*",
18
- "@syncmatters/script-api": "^1.0.25"
18
+ "@syncmatters/script-api": "^1.0.28"
19
19
  }
20
20
  }