@syncmatters/connector-sdk 1.0.10 → 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.
@@ -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 managet OAuth2 token this provider will grant access to the access token */
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 e.g. auto update HTTP authentication headers.
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 refreshes the token */
465
+ /** called when the platform background process has refreshed the token */
464
466
  onRefresh: (cb: (token: string) => void) => void;
465
- /** force an immediate refresh of the access token (only needed if token expiry is any) */
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.10",
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": "bdf8ea0fa31c6e621dbb7a18fc5d88a0d2e708f9ebbc185ad8b5dda2a831c92b",
15
+ "typesContentHash": "7acede6f1dec917ea321ed2af103576725fe0d3c6844d242ec7d98d226988809",
16
16
  "dependencies": {
17
17
  "@types/node": "*",
18
- "@syncmatters/script-api": "^1.0.10"
18
+ "@syncmatters/script-api": "^1.0.12"
19
19
  }
20
20
  }