@syncmatters/connector-sdk 1.0.9 → 1.0.11
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.
|
@@ -100,7 +100,11 @@ Frequently used:
|
|
|
100
100
|
settings values ("a, b,c" → `["a","b","c"]` / a `Set`).
|
|
101
101
|
- `emailCleanse(email)` / `emailIsPublic` / `domainParse` / `nameParse` — normalize match-key
|
|
102
102
|
values before comparing (pairs with `matchRules`).
|
|
103
|
-
- `xmlParse({ string })` —
|
|
103
|
+
- `xmlParse({ source: { string | fileProvider, encoding? } })` — preferred full-document XML
|
|
104
|
+
parse. Deprecated: `xmlParse({ string })` (still supported).
|
|
105
|
+
- `xmlParse({ source, emit })` — stream matching elements as xml2js-shaped chunks (XPath
|
|
106
|
+
subset: `//Name`, `/A/B/C`, `A/B`; prefixes ignored). Use for large documents; iterate
|
|
107
|
+
with `for await…of` (do not `await` the call itself).
|
|
104
108
|
- `kvStore()` — scratch key-value collections for cross-page state (05) or import staging (06).
|
|
105
109
|
- `fileProvider({ string | buffer | file: { path, deleteOnClose } })` — wrap content as a
|
|
106
110
|
`FileProvider` (13); `tempFile`/`tempDir` for staging.
|
package/lib/connector.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export interface InitArgs {
|
|
|
24
24
|
readonly webhookUid?: string;
|
|
25
25
|
/** settings holds the configured connection instance settings */
|
|
26
26
|
readonly settings: Map<string, any>;
|
|
27
|
-
/** if the connection has a
|
|
27
|
+
/** if the connection has a managed OAuth2 token this provider will grant access to the access token */
|
|
28
28
|
oauth2Provider?: OAuth2TokenProvider;
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
@@ -453,16 +453,20 @@ export interface ObjectMetaDetail {
|
|
|
453
453
|
}
|
|
454
454
|
/**
|
|
455
455
|
* OAuth2TokenProvider provides access to the auto-refreshing OAuth2 access token. Register a callback to the onRefresh
|
|
456
|
-
* event to
|
|
456
|
+
* event to auto update HTTP authentication headers.
|
|
457
457
|
*/
|
|
458
458
|
export interface OAuth2TokenProvider {
|
|
459
|
+
/** current access token cached by the platform */
|
|
459
460
|
token: string;
|
|
461
|
+
/** authentication parameters included in the token */
|
|
460
462
|
authParams: {
|
|
461
463
|
[key: string]: string | string[];
|
|
462
464
|
};
|
|
463
|
-
/** called when the background process
|
|
465
|
+
/** called when the platform background process has refreshed the token */
|
|
464
466
|
onRefresh: (cb: (token: string) => void) => void;
|
|
465
|
-
/**
|
|
467
|
+
/** replace the in-memory token with the latest platform-cached access token (does not exchange the refresh token, calls onRefresh before returning; rejects if the token could not be retrieved) */
|
|
468
|
+
reloadToken: () => Promise<void>;
|
|
469
|
+
/** force an immediate synchronous exchange of the platform refresh token for a new access token (only needed if token expiry is unknown; rejects if the token could not be retrieved) */
|
|
466
470
|
forceRefresh: () => Promise<void>;
|
|
467
471
|
/** introspect the current access token */
|
|
468
472
|
introspectToken?: () => Promise<unknown>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syncmatters/connector-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
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": "7acede6f1dec917ea321ed2af103576725fe0d3c6844d242ec7d98d226988809",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@types/node": "*",
|
|
18
|
-
"@syncmatters/script-api": "^1.0.
|
|
18
|
+
"@syncmatters/script-api": "^1.0.12"
|
|
19
19
|
}
|
|
20
20
|
}
|