@memberjunction/integration-engine 5.41.0 → 5.42.0
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/README.md +34 -0
- package/dist/BaseIntegrationConnector.d.ts +109 -0
- package/dist/BaseIntegrationConnector.d.ts.map +1 -1
- package/dist/BaseIntegrationConnector.js +308 -93
- package/dist/BaseIntegrationConnector.js.map +1 -1
- package/dist/BaseRESTIntegrationConnector.d.ts +32 -0
- package/dist/BaseRESTIntegrationConnector.d.ts.map +1 -1
- package/dist/BaseRESTIntegrationConnector.js +182 -28
- package/dist/BaseRESTIntegrationConnector.js.map +1 -1
- package/dist/ContentHash.d.ts +22 -0
- package/dist/ContentHash.d.ts.map +1 -1
- package/dist/ContentHash.js +35 -0
- package/dist/ContentHash.js.map +1 -1
- package/dist/CustomColumnPromotion.d.ts +108 -0
- package/dist/CustomColumnPromotion.d.ts.map +1 -0
- package/dist/CustomColumnPromotion.js +202 -0
- package/dist/CustomColumnPromotion.js.map +1 -0
- package/dist/CustomOverflow.d.ts +64 -0
- package/dist/CustomOverflow.d.ts.map +1 -0
- package/dist/CustomOverflow.js +74 -0
- package/dist/CustomOverflow.js.map +1 -0
- package/dist/FieldMappingEngine.d.ts.map +1 -1
- package/dist/FieldMappingEngine.js +22 -3
- package/dist/FieldMappingEngine.js.map +1 -1
- package/dist/IntegrationConnectorCreationPipeline.d.ts +33 -0
- package/dist/IntegrationConnectorCreationPipeline.d.ts.map +1 -1
- package/dist/IntegrationConnectorCreationPipeline.js +157 -0
- package/dist/IntegrationConnectorCreationPipeline.js.map +1 -1
- package/dist/IntegrationEngine.d.ts +106 -6
- package/dist/IntegrationEngine.d.ts.map +1 -1
- package/dist/IntegrationEngine.js +870 -168
- package/dist/IntegrationEngine.js.map +1 -1
- package/dist/IntegrationSchemaSync.d.ts +84 -13
- package/dist/IntegrationSchemaSync.d.ts.map +1 -1
- package/dist/IntegrationSchemaSync.js +198 -36
- package/dist/IntegrationSchemaSync.js.map +1 -1
- package/dist/KeySerialization.d.ts +21 -0
- package/dist/KeySerialization.d.ts.map +1 -0
- package/dist/KeySerialization.js +29 -0
- package/dist/KeySerialization.js.map +1 -0
- package/dist/MatchEngine.d.ts.map +1 -1
- package/dist/MatchEngine.js +12 -4
- package/dist/MatchEngine.js.map +1 -1
- package/dist/RecordFlatten.d.ts +49 -0
- package/dist/RecordFlatten.d.ts.map +1 -0
- package/dist/RecordFlatten.js +50 -0
- package/dist/RecordFlatten.js.map +1 -0
- package/dist/StreamingDiscovery.d.ts +145 -0
- package/dist/StreamingDiscovery.d.ts.map +1 -0
- package/dist/StreamingDiscovery.js +306 -0
- package/dist/StreamingDiscovery.js.map +1 -0
- package/dist/SyncLogger.d.ts +1 -1
- package/dist/SyncLogger.d.ts.map +1 -1
- package/dist/SyncLogger.js +19 -1
- package/dist/SyncLogger.js.map +1 -1
- package/dist/auth-helpers/BasicAuthHeaderBuilder.d.ts +36 -0
- package/dist/auth-helpers/BasicAuthHeaderBuilder.d.ts.map +1 -0
- package/dist/auth-helpers/BasicAuthHeaderBuilder.js +38 -0
- package/dist/auth-helpers/BasicAuthHeaderBuilder.js.map +1 -0
- package/dist/auth-helpers/OAuth1aSigner.d.ts +56 -0
- package/dist/auth-helpers/OAuth1aSigner.d.ts.map +1 -0
- package/dist/auth-helpers/OAuth1aSigner.js +91 -0
- package/dist/auth-helpers/OAuth1aSigner.js.map +1 -0
- package/dist/auth-helpers/OAuth2TokenManager.d.ts +103 -0
- package/dist/auth-helpers/OAuth2TokenManager.d.ts.map +1 -0
- package/dist/auth-helpers/OAuth2TokenManager.js +143 -0
- package/dist/auth-helpers/OAuth2TokenManager.js.map +1 -0
- package/dist/auth-helpers/index.d.ts +11 -0
- package/dist/auth-helpers/index.d.ts.map +1 -0
- package/dist/auth-helpers/index.js +8 -0
- package/dist/auth-helpers/index.js.map +1 -0
- package/dist/index.d.ts +15 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +73 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +7 -7
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OAuth1aSigner — shared OAuth 1.0a request-signing helper for REST integration
|
|
3
|
+
* connectors. Centralizes the OAuth 1.0a signature-base-string construction +
|
|
4
|
+
* HMAC signing so concrete connectors never inline crypto (the
|
|
5
|
+
* connector-code-conventions "no inline crypto" rule).
|
|
6
|
+
*
|
|
7
|
+
* This is the form NetSuite's Token-Based Authentication (TBA) uses: a long-lived
|
|
8
|
+
* consumer key/secret + token id/secret, signed per request with HMAC-SHA256 and
|
|
9
|
+
* a per-account `realm`. It is also the generic OAuth 1.0a one-legged signing flow
|
|
10
|
+
* any vendor that still requires OAuth 1.0a header signing can reuse.
|
|
11
|
+
*
|
|
12
|
+
* The crypto is `node:crypto`'s `createHmac` + `randomBytes` — the standard library
|
|
13
|
+
* primitives, kept here behind a single, tested helper rather than copy-pasted into
|
|
14
|
+
* every connector. There is no token round-trip here (TBA tokens are pre-provisioned);
|
|
15
|
+
* this helper only SIGNS a request and emits the `Authorization` header value.
|
|
16
|
+
*/
|
|
17
|
+
import { createHmac, randomBytes } from 'node:crypto';
|
|
18
|
+
/**
|
|
19
|
+
* RFC 3986 percent-encoding (stricter than `encodeURIComponent`, which leaves
|
|
20
|
+
* `! ' ( ) *` unescaped). OAuth 1.0a requires these to be escaped too.
|
|
21
|
+
*/
|
|
22
|
+
export function percentEncodeRFC3986(value) {
|
|
23
|
+
return encodeURIComponent(value)
|
|
24
|
+
.replace(/!/g, '%21')
|
|
25
|
+
.replace(/'/g, '%27')
|
|
26
|
+
.replace(/\(/g, '%28')
|
|
27
|
+
.replace(/\)/g, '%29')
|
|
28
|
+
.replace(/\*/g, '%2A');
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Stateless OAuth 1.0a signer. One static method builds the `Authorization` header
|
|
32
|
+
* value for a request; connectors call it per request.
|
|
33
|
+
*/
|
|
34
|
+
export class OAuth1aSigner {
|
|
35
|
+
/**
|
|
36
|
+
* Builds the full `Authorization: OAuth ...` header value for a single request,
|
|
37
|
+
* computing the HMAC signature over the canonical signature base string.
|
|
38
|
+
*
|
|
39
|
+
* Spec steps implemented (RFC 5849 §3.4):
|
|
40
|
+
* 1. Collect oauth_* params + the request's query params.
|
|
41
|
+
* 2. Percent-encode, sort, and `&`-join them (the normalized parameter string).
|
|
42
|
+
* 3. Build the base string `METHOD&encode(baseURL)&encode(params)`.
|
|
43
|
+
* 4. Sign with key `encode(consumerSecret)&encode(tokenSecret)`.
|
|
44
|
+
* 5. Emit `OAuth realm="...", oauth_consumer_key="...", ..., oauth_signature="..."`.
|
|
45
|
+
*/
|
|
46
|
+
static BuildAuthorizationHeader(req) {
|
|
47
|
+
const method = req.Method.toUpperCase();
|
|
48
|
+
const sigMethod = req.SignatureMethod ?? 'HMAC-SHA256';
|
|
49
|
+
const timestamp = req.TimestampOverride ?? Math.floor(Date.now() / 1000).toString();
|
|
50
|
+
const nonce = req.NonceOverride ?? randomBytes(16).toString('hex');
|
|
51
|
+
const oauthParams = {
|
|
52
|
+
oauth_consumer_key: req.ConsumerKey,
|
|
53
|
+
oauth_nonce: nonce,
|
|
54
|
+
oauth_signature_method: sigMethod,
|
|
55
|
+
oauth_timestamp: timestamp,
|
|
56
|
+
oauth_token: req.TokenId,
|
|
57
|
+
oauth_version: '1.0',
|
|
58
|
+
};
|
|
59
|
+
const { baseUrl, queryParams } = OAuth1aSigner.splitUrl(req.Url);
|
|
60
|
+
// All params (oauth + query) participate in the signature base string.
|
|
61
|
+
const allParams = { ...oauthParams, ...queryParams };
|
|
62
|
+
const normalizedParams = Object.keys(allParams)
|
|
63
|
+
.sort()
|
|
64
|
+
.map(k => `${percentEncodeRFC3986(k)}=${percentEncodeRFC3986(allParams[k])}`)
|
|
65
|
+
.join('&');
|
|
66
|
+
const baseString = `${method}&${percentEncodeRFC3986(baseUrl)}&${percentEncodeRFC3986(normalizedParams)}`;
|
|
67
|
+
const signingKey = `${percentEncodeRFC3986(req.ConsumerSecret)}&${percentEncodeRFC3986(req.TokenSecret)}`;
|
|
68
|
+
const algo = sigMethod === 'HMAC-SHA1' ? 'sha1' : 'sha256';
|
|
69
|
+
const signature = createHmac(algo, signingKey).update(baseString).digest('base64');
|
|
70
|
+
// The Authorization header contains ONLY the oauth_* params (NOT the query params)
|
|
71
|
+
// plus the signature; values are quoted + percent-encoded.
|
|
72
|
+
const headerParams = { ...oauthParams, oauth_signature: signature };
|
|
73
|
+
const paramList = Object.keys(headerParams)
|
|
74
|
+
.sort()
|
|
75
|
+
.map(k => `${percentEncodeRFC3986(k)}="${percentEncodeRFC3986(headerParams[k])}"`)
|
|
76
|
+
.join(', ');
|
|
77
|
+
const realmPrefix = req.Realm ? `realm="${percentEncodeRFC3986(req.Realm)}", ` : '';
|
|
78
|
+
return `OAuth ${realmPrefix}${paramList}`;
|
|
79
|
+
}
|
|
80
|
+
/** Splits a URL into its base (scheme://host/path, no query) + a decoded query-param map. */
|
|
81
|
+
static splitUrl(url) {
|
|
82
|
+
const qIdx = url.indexOf('?');
|
|
83
|
+
if (qIdx === -1)
|
|
84
|
+
return { baseUrl: url, queryParams: {} };
|
|
85
|
+
const baseUrl = url.substring(0, qIdx);
|
|
86
|
+
const queryParams = {};
|
|
87
|
+
new URLSearchParams(url.substring(qIdx + 1)).forEach((v, k) => { queryParams[k] = v; });
|
|
88
|
+
return { baseUrl, queryParams };
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=OAuth1aSigner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OAuth1aSigner.js","sourceRoot":"","sources":["../../src/auth-helpers/OAuth1aSigner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAkCtD;;;GAGG;AAC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AC;IAC9C,CAAC;IAED,6FAA6F;IACrF,MAAM,CAAC,QAAQ,CAAC,GAAW;QAC/B,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC9B,IAAI,IAAI,KAAK,CAAC,CAAC;YAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC;QAC1D,MAAM,OAAO,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;QACvC,MAAM,WAAW,GAA2B,EAAE,CAAC;QAC/C,IAAI,eAAe,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACxF,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;IACpC,CAAC;CACJ"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OAuth2TokenManager — shared OAuth2 token acquisition + refresh helper for REST
|
|
3
|
+
* integration connectors. Centralizes the token-endpoint round-trip so concrete
|
|
4
|
+
* connectors never inline the grant logic.
|
|
5
|
+
*
|
|
6
|
+
* Supports the two grant types association/CRM APIs commonly expose:
|
|
7
|
+
* - `refresh_token` (primary) — exchange a long-lived refresh token for a fresh
|
|
8
|
+
* access token via `grant_type=refresh_token`.
|
|
9
|
+
* - `password` (fallback) — resource-owner password credentials grant via
|
|
10
|
+
* `grant_type=password` (username + password + scopes), for tenants that issue
|
|
11
|
+
* no refresh token.
|
|
12
|
+
*
|
|
13
|
+
* Client authentication is sent in the request body (`client_id`/`client_secret`)
|
|
14
|
+
* which is the form GrowthZone and most modern OAuth2 servers accept; set
|
|
15
|
+
* {@link OAuth2TokenRequest.UseBasicAuth} to instead send HTTP Basic on the
|
|
16
|
+
* Authorization header.
|
|
17
|
+
*
|
|
18
|
+
* The manager caches the minted access token in memory and only re-mints when the
|
|
19
|
+
* cached token is within {@link OAuth2TokenManager.RefreshBufferMs} of expiry, so a
|
|
20
|
+
* single sync run does one token exchange and reuses it across every request.
|
|
21
|
+
*
|
|
22
|
+
* NOTE: this is a thin, crypto-free wrapper over the standard OAuth2 token endpoint
|
|
23
|
+
* — there is no signing/HMAC here. It exists so connectors share ONE correct token
|
|
24
|
+
* round-trip rather than each re-implementing `grant_type` form bodies.
|
|
25
|
+
*/
|
|
26
|
+
/** Which OAuth2 grant a token request should use. */
|
|
27
|
+
export type OAuth2GrantType = 'refresh_token' | 'password' | 'client_credentials';
|
|
28
|
+
/** Inputs needed to mint/refresh an OAuth2 access token. */
|
|
29
|
+
export interface OAuth2TokenRequest {
|
|
30
|
+
/** Absolute token endpoint URL (e.g. `https://tenant.example.com/oauth/token`). */
|
|
31
|
+
TokenURL: string;
|
|
32
|
+
/** OAuth2 client identifier. */
|
|
33
|
+
ClientId: string;
|
|
34
|
+
/** OAuth2 client secret. */
|
|
35
|
+
ClientSecret: string;
|
|
36
|
+
/** Refresh token — required for the `refresh_token` grant. */
|
|
37
|
+
RefreshToken?: string;
|
|
38
|
+
/** Username — required for the `password` grant. */
|
|
39
|
+
Username?: string;
|
|
40
|
+
/** Password — required for the `password` grant. */
|
|
41
|
+
Password?: string;
|
|
42
|
+
/** Space- or comma-delimited scopes (sent as the `scopes`/`scope` param). */
|
|
43
|
+
Scopes?: string;
|
|
44
|
+
/** Parameter name carrying the scopes. Defaults to `scope`. */
|
|
45
|
+
ScopeParam?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Parameter name carrying the username in a `password` grant. Defaults to `username`
|
|
48
|
+
* (RFC 6749 §4.3). Some Doorkeeper/WineBouncer deployments (e.g. Hivebrite) name it
|
|
49
|
+
* `admin_email`; set this to that key when the vendor diverges from the spec name.
|
|
50
|
+
*/
|
|
51
|
+
UsernameParam?: string;
|
|
52
|
+
/** Send client_id/secret as HTTP Basic instead of in the form body. Default false. */
|
|
53
|
+
UseBasicAuth?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Extra `application/x-www-form-urlencoded` parameters appended to the grant body for vendors
|
|
56
|
+
* whose token endpoint requires non-standard inputs — e.g. Auth0's `audience` on a
|
|
57
|
+
* `client_credentials` grant, or a vendor-specific `resource`/`tenant` param. Applies to every
|
|
58
|
+
* grant type; standard params (grant_type, client_id/secret, scope, refresh_token, username,
|
|
59
|
+
* password) take precedence and are never overwritten by this map.
|
|
60
|
+
*/
|
|
61
|
+
ExtraParams?: Record<string, string>;
|
|
62
|
+
/** Request timeout in ms. Default 30000. */
|
|
63
|
+
TimeoutMs?: number;
|
|
64
|
+
}
|
|
65
|
+
/** A minted access token plus its derived expiry. */
|
|
66
|
+
export interface OAuth2Token {
|
|
67
|
+
/** The bearer access token to send as `Authorization: Bearer {AccessToken}`. */
|
|
68
|
+
AccessToken: string;
|
|
69
|
+
/** The (possibly rotated) refresh token returned by the server, if any. */
|
|
70
|
+
RefreshToken?: string;
|
|
71
|
+
/** Token type reported by the server (typically `Bearer`). */
|
|
72
|
+
TokenType: string;
|
|
73
|
+
/** Absolute epoch-ms time at which this token should be considered expired. */
|
|
74
|
+
ExpiresAt: number;
|
|
75
|
+
/** Scopes granted by the server, if reported. */
|
|
76
|
+
Scope?: string;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Stateful per-connection OAuth2 token manager. One instance caches one access
|
|
80
|
+
* token; a connector typically holds a single manager and resets it when the
|
|
81
|
+
* bound connection/config changes.
|
|
82
|
+
*/
|
|
83
|
+
export declare class OAuth2TokenManager {
|
|
84
|
+
/** Skew window: re-mint when within this many ms of expiry. */
|
|
85
|
+
RefreshBufferMs: number;
|
|
86
|
+
private cached;
|
|
87
|
+
/** The most recently seen refresh token (may rotate across refreshes). */
|
|
88
|
+
private lastRefreshToken;
|
|
89
|
+
/**
|
|
90
|
+
* Returns a valid access token, minting/refreshing only when the cache is
|
|
91
|
+
* empty or near expiry. `grant` selects which flow to run; pass
|
|
92
|
+
* `'refresh_token'` as the primary and `'password'` as the documented
|
|
93
|
+
* fallback when no refresh token is available.
|
|
94
|
+
*/
|
|
95
|
+
GetAccessToken(req: OAuth2TokenRequest, grant: OAuth2GrantType): Promise<OAuth2Token>;
|
|
96
|
+
/** Clears the cached token (e.g. on a 401, or when the bound config changes). */
|
|
97
|
+
Reset(): void;
|
|
98
|
+
/** Executes the token-endpoint round-trip for the chosen grant. */
|
|
99
|
+
private RequestToken;
|
|
100
|
+
/** Builds the `application/x-www-form-urlencoded` grant body for the chosen flow. */
|
|
101
|
+
private BuildGrantBody;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=OAuth2TokenManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OAuth2TokenManager.d.ts","sourceRoot":"","sources":["../../src/auth-helpers/OAuth2TokenManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,qDAAqD;AACrD,MAAM,MAAM,eAAe,GAAG,eAAe,GAAG,UAAU,GAAG,oBAAoB,CAAC;AAElF,4DAA4D;AAC5D,MAAM,WAAW,kBAAkB;IAC/B,mFAAmF;IACnF,QAAQ,EAAE,MAAM,CAAC;IACjB,gCAAgC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,4BAA4B;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,8DAA8D;IAC9D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+DAA+D;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sFAAsF;IACtF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,qDAAqD;AACrD,MAAM,WAAW,WAAW;IACxB,gFAAgF;IAChF,WAAW,EAAE,MAAM,CAAC;IACpB,2EAA2E;IAC3E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8DAA8D;IAC9D,SAAS,EAAE,MAAM,CAAC;IAClB,+EAA+E;IAC/E,SAAS,EAAE,MAAM,CAAC;IAClB,iDAAiD;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAgBD;;;;GAIG;AACH,qBAAa,kBAAkB;IAC3B,+DAA+D;IACxD,eAAe,SAAU;IAEhC,OAAO,CAAC,MAAM,CAA4B;IAC1C,0EAA0E;IAC1E,OAAO,CAAC,gBAAgB,CAAqB;IAE7C;;;;;OAKG;IACU,cAAc,CAAC,GAAG,EAAE,kBAAkB,EAAE,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC;IAclG,iFAAiF;IAC1E,KAAK,IAAI,IAAI;IAKpB,mEAAmE;YACrD,YAAY;IA4C1B,qFAAqF;IACrF,OAAO,CAAC,cAAc;CAmCzB"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OAuth2TokenManager — shared OAuth2 token acquisition + refresh helper for REST
|
|
3
|
+
* integration connectors. Centralizes the token-endpoint round-trip so concrete
|
|
4
|
+
* connectors never inline the grant logic.
|
|
5
|
+
*
|
|
6
|
+
* Supports the two grant types association/CRM APIs commonly expose:
|
|
7
|
+
* - `refresh_token` (primary) — exchange a long-lived refresh token for a fresh
|
|
8
|
+
* access token via `grant_type=refresh_token`.
|
|
9
|
+
* - `password` (fallback) — resource-owner password credentials grant via
|
|
10
|
+
* `grant_type=password` (username + password + scopes), for tenants that issue
|
|
11
|
+
* no refresh token.
|
|
12
|
+
*
|
|
13
|
+
* Client authentication is sent in the request body (`client_id`/`client_secret`)
|
|
14
|
+
* which is the form GrowthZone and most modern OAuth2 servers accept; set
|
|
15
|
+
* {@link OAuth2TokenRequest.UseBasicAuth} to instead send HTTP Basic on the
|
|
16
|
+
* Authorization header.
|
|
17
|
+
*
|
|
18
|
+
* The manager caches the minted access token in memory and only re-mints when the
|
|
19
|
+
* cached token is within {@link OAuth2TokenManager.RefreshBufferMs} of expiry, so a
|
|
20
|
+
* single sync run does one token exchange and reuses it across every request.
|
|
21
|
+
*
|
|
22
|
+
* NOTE: this is a thin, crypto-free wrapper over the standard OAuth2 token endpoint
|
|
23
|
+
* — there is no signing/HMAC here. It exists so connectors share ONE correct token
|
|
24
|
+
* round-trip rather than each re-implementing `grant_type` form bodies.
|
|
25
|
+
*/
|
|
26
|
+
const DEFAULT_TIMEOUT_MS = 30_000;
|
|
27
|
+
const DEFAULT_EXPIRES_IN_S = 3_600;
|
|
28
|
+
/**
|
|
29
|
+
* Stateful per-connection OAuth2 token manager. One instance caches one access
|
|
30
|
+
* token; a connector typically holds a single manager and resets it when the
|
|
31
|
+
* bound connection/config changes.
|
|
32
|
+
*/
|
|
33
|
+
export class OAuth2TokenManager {
|
|
34
|
+
constructor() {
|
|
35
|
+
/** Skew window: re-mint when within this many ms of expiry. */
|
|
36
|
+
this.RefreshBufferMs = 60_000;
|
|
37
|
+
this.cached = null;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Returns a valid access token, minting/refreshing only when the cache is
|
|
41
|
+
* empty or near expiry. `grant` selects which flow to run; pass
|
|
42
|
+
* `'refresh_token'` as the primary and `'password'` as the documented
|
|
43
|
+
* fallback when no refresh token is available.
|
|
44
|
+
*/
|
|
45
|
+
async GetAccessToken(req, grant) {
|
|
46
|
+
if (this.cached && this.cached.ExpiresAt > Date.now() + this.RefreshBufferMs) {
|
|
47
|
+
return this.cached;
|
|
48
|
+
}
|
|
49
|
+
const effectiveReq = {
|
|
50
|
+
...req,
|
|
51
|
+
RefreshToken: this.lastRefreshToken ?? req.RefreshToken,
|
|
52
|
+
};
|
|
53
|
+
const token = await this.RequestToken(effectiveReq, grant);
|
|
54
|
+
this.cached = token;
|
|
55
|
+
this.lastRefreshToken = token.RefreshToken ?? effectiveReq.RefreshToken;
|
|
56
|
+
return token;
|
|
57
|
+
}
|
|
58
|
+
/** Clears the cached token (e.g. on a 401, or when the bound config changes). */
|
|
59
|
+
Reset() {
|
|
60
|
+
this.cached = null;
|
|
61
|
+
this.lastRefreshToken = undefined;
|
|
62
|
+
}
|
|
63
|
+
/** Executes the token-endpoint round-trip for the chosen grant. */
|
|
64
|
+
async RequestToken(req, grant) {
|
|
65
|
+
const body = this.BuildGrantBody(req, grant);
|
|
66
|
+
const headers = {
|
|
67
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
68
|
+
'Accept': 'application/json',
|
|
69
|
+
};
|
|
70
|
+
if (req.UseBasicAuth) {
|
|
71
|
+
const basic = Buffer.from(`${req.ClientId}:${req.ClientSecret}`).toString('base64');
|
|
72
|
+
headers['Authorization'] = `Basic ${basic}`;
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
body.set('client_id', req.ClientId);
|
|
76
|
+
body.set('client_secret', req.ClientSecret);
|
|
77
|
+
}
|
|
78
|
+
const response = await fetch(req.TokenURL, {
|
|
79
|
+
method: 'POST',
|
|
80
|
+
headers,
|
|
81
|
+
body: body.toString(),
|
|
82
|
+
signal: AbortSignal.timeout(req.TimeoutMs ?? DEFAULT_TIMEOUT_MS),
|
|
83
|
+
});
|
|
84
|
+
const text = await response.text();
|
|
85
|
+
let parsed = {};
|
|
86
|
+
if (text.length > 0) {
|
|
87
|
+
try {
|
|
88
|
+
parsed = JSON.parse(text);
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
parsed = {};
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (!response.ok || !parsed.access_token) {
|
|
95
|
+
const detail = parsed.error_description ?? parsed.error ?? text.slice(0, 300);
|
|
96
|
+
throw new Error(`OAuth2 ${grant} token request to ${req.TokenURL} failed: HTTP ${response.status}${detail ? ` — ${detail}` : ''}`);
|
|
97
|
+
}
|
|
98
|
+
const expiresInS = typeof parsed.expires_in === 'number' ? parsed.expires_in : DEFAULT_EXPIRES_IN_S;
|
|
99
|
+
return {
|
|
100
|
+
AccessToken: parsed.access_token,
|
|
101
|
+
RefreshToken: parsed.refresh_token ?? req.RefreshToken,
|
|
102
|
+
TokenType: parsed.token_type ?? 'Bearer',
|
|
103
|
+
ExpiresAt: Date.now() + expiresInS * 1_000,
|
|
104
|
+
Scope: parsed.scope,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
/** Builds the `application/x-www-form-urlencoded` grant body for the chosen flow. */
|
|
108
|
+
BuildGrantBody(req, grant) {
|
|
109
|
+
const body = new URLSearchParams();
|
|
110
|
+
// Seed vendor extra params FIRST so the standard params set below always take precedence
|
|
111
|
+
// (a caller can never clobber grant_type/scope/credentials via ExtraParams).
|
|
112
|
+
if (req.ExtraParams) {
|
|
113
|
+
for (const [k, v] of Object.entries(req.ExtraParams)) {
|
|
114
|
+
if (typeof v === 'string' && v.length > 0)
|
|
115
|
+
body.set(k, v);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
body.set('grant_type', grant);
|
|
119
|
+
const scopeParam = req.ScopeParam ?? 'scope';
|
|
120
|
+
if (req.Scopes)
|
|
121
|
+
body.set(scopeParam, req.Scopes);
|
|
122
|
+
if (grant === 'client_credentials') {
|
|
123
|
+
// grant_type=client_credentials carries no user/refresh params; client auth is
|
|
124
|
+
// either in the body (default) or as HTTP Basic (UseBasicAuth) — handled by the caller.
|
|
125
|
+
return body;
|
|
126
|
+
}
|
|
127
|
+
if (grant === 'refresh_token') {
|
|
128
|
+
if (!req.RefreshToken) {
|
|
129
|
+
throw new Error('OAuth2 refresh_token grant requires a RefreshToken.');
|
|
130
|
+
}
|
|
131
|
+
body.set('refresh_token', req.RefreshToken);
|
|
132
|
+
return body;
|
|
133
|
+
}
|
|
134
|
+
// password grant
|
|
135
|
+
if (!req.Username || !req.Password) {
|
|
136
|
+
throw new Error('OAuth2 password grant requires Username and Password.');
|
|
137
|
+
}
|
|
138
|
+
body.set(req.UsernameParam ?? 'username', req.Username);
|
|
139
|
+
body.set('password', req.Password);
|
|
140
|
+
return body;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=OAuth2TokenManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OAuth2TokenManager.js","sourceRoot":"","sources":["../../src/auth-helpers/OAuth2TokenManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAoEH,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAClC,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAEnC;;;;GAIG;AACH,MAAM,OAAO,kBAAkB;IAA/B;QACI,+DAA+D;QACxD,oBAAe,GAAG,MAAM,CAAC;QAExB,WAAM,GAAuB,IAAI,CAAC;IA+G9C,CAAC;IA3GG;;;;;OAKG;IACI,KAAK,CAAC,cAAc,CAAC,GAAuB,EAAE,KAAsB;QACvE,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;YAC3E,OAAO,IAAI,CAAC,MAAM,CAAC;QACvB,CAAC;QACD,MAAM,YAAY,GAAuB;YACrC,GAAG,GAAG;YACN,YAAY,EAAE,IAAI,CAAC,gBAAgB,IAAI,GAAG,CAAC,YAAY;SAC1D,CAAC;QACF,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;QAC3D,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CA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@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared authentication helpers for REST integration connectors.
|
|
3
|
+
* Connectors import these to avoid re-implementing token/grant logic.
|
|
4
|
+
*/
|
|
5
|
+
export { OAuth2TokenManager } from './OAuth2TokenManager.js';
|
|
6
|
+
export type { OAuth2GrantType, OAuth2TokenRequest, OAuth2Token, } from './OAuth2TokenManager.js';
|
|
7
|
+
export { OAuth1aSigner, percentEncodeRFC3986 } from './OAuth1aSigner.js';
|
|
8
|
+
export type { OAuth1aSignRequest, OAuth1aSignatureMethod, } from './OAuth1aSigner.js';
|
|
9
|
+
export { buildBasicAuthHeaderValue, buildBasicAuthHeader } from './BasicAuthHeaderBuilder.js';
|
|
10
|
+
export type { BasicAuthRequest } from './BasicAuthHeaderBuilder.js';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth-helpers/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,YAAY,EACR,eAAe,EACf,kBAAkB,EAClB,WAAW,GACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AACzE,YAAY,EACR,kBAAkB,EAClB,sBAAsB,GACzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAC9F,YAAY,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared authentication helpers for REST integration connectors.
|
|
3
|
+
* Connectors import these to avoid re-implementing token/grant logic.
|
|
4
|
+
*/
|
|
5
|
+
export { OAuth2TokenManager } from './OAuth2TokenManager.js';
|
|
6
|
+
export { OAuth1aSigner, percentEncodeRFC3986 } from './OAuth1aSigner.js';
|
|
7
|
+
export { buildBasicAuthHeaderValue, buildBasicAuthHeader } from './BasicAuthHeaderBuilder.js';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/auth-helpers/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAM7D,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAKzE,OAAO,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { IIntegrationSourceType, ICompanyIntegrationEntityMap, ICompanyIntegrationFieldMap, ICompanyIntegrationSyncWatermark } from './entity-types.js';
|
|
2
|
-
export type { SyncDirection, SyncTriggerType, WatermarkType, ConflictResolution, DeleteBehavior, RecordChangeType, IntegrationRunStatus, ExternalRecord, MappedRecord, SyncResult, SyncRecordError, DefaultFieldMapping, SyncErrorCode, ErrorSeverity, SyncProgress, SyncProgressSnapshot, OnProgressCallback, SyncNotificationEvent, SyncNotificationSeverity, SyncNotification, OnNotificationCallback, IntegrationSyncOptions, EntityMapSyncResult, SourceSchemaInfo, SourceObjectInfo, SourceFieldInfo, SourceRelationshipInfo, IntrospectSchemaOptions, CRUDContext, CreateRecordContext, UpdateRecordContext, UpsertRecordContext, DeleteRecordContext, GetRecordContext, CRUDResult, SearchContext, SearchResult, ListContext, ListResult, } from './types.js';
|
|
2
|
+
export type { SyncDirection, SyncTriggerType, WatermarkType, ConflictResolution, DeleteBehavior, RecordChangeType, IntegrationRunStatus, ExternalRecord, MappedRecord, SyncResult, SyncRecordError, DefaultFieldMapping, SyncErrorCode, ErrorSeverity, SyncProgress, SyncProgressSnapshot, OnProgressCallback, SyncNotificationEvent, SyncNotificationSeverity, SyncNotification, OnNotificationCallback, IntegrationSyncOptions, EntityMapSyncResult, SourceSchemaInfo, SourceObjectInfo, SourceFieldInfo, SourceRelationshipInfo, IntrospectSchemaOptions, CRUDContext, CreateRecordContext, UpdateRecordContext, UpsertRecordContext, DeleteRecordContext, GetRecordContext, CRUDResult, SearchContext, SearchResult, ListContext, ListResult, SchemaPromotionResult, PostSyncSchemaPromotionCallback, } from './types.js';
|
|
3
3
|
export { IsRetryableError, ClassifyError } from './types.js';
|
|
4
4
|
export type { TransformType, TransformOnError, TransformStep, TransformConfig, DirectConfig, RegexConfig, SplitConfig, CombineConfig, LookupConfig, FormatConfig, CoerceConfig, SubstringConfig, CustomConfig, } from './transforms.js';
|
|
5
5
|
export { BaseIntegrationConnector, WithTimeout, DEFAULT_OPERATION_TIMEOUTS } from './BaseIntegrationConnector.js';
|
|
@@ -9,6 +9,7 @@ export type { RESTAuthContext, RESTResponse, PaginationState, PaginationType } f
|
|
|
9
9
|
export { ConnectorFactory } from './ConnectorFactory.js';
|
|
10
10
|
export { FieldMappingEngine } from './FieldMappingEngine.js';
|
|
11
11
|
export { MatchEngine } from './MatchEngine.js';
|
|
12
|
+
export { serializeKeyValue } from './KeySerialization.js';
|
|
12
13
|
export { WatermarkService } from './WatermarkService.js';
|
|
13
14
|
export { WithRetry, DEFAULT_RETRY_CONFIG } from './RetryRunner.js';
|
|
14
15
|
export type { RetryConfig } from './RetryRunner.js';
|
|
@@ -20,6 +21,11 @@ export { IntegrationEngine } from './IntegrationEngine.js';
|
|
|
20
21
|
export { IntegrationSchemaSync } from './IntegrationSchemaSync.js';
|
|
21
22
|
export type { PersistSchemaOptions, PersistSchemaResult } from './IntegrationSchemaSync.js';
|
|
22
23
|
export { computeContentHash, CONTENT_HASH_COLUMN } from './ContentHash.js';
|
|
24
|
+
export { CUSTOM_OVERFLOW_COLUMN, computeUnmappedFields, hasUnmappedFields } from './CustomOverflow.js';
|
|
25
|
+
export { planPromotions, inferColumnTypeFromSamples, buildOverflowStats, sanitizeColumnName } from './CustomColumnPromotion.js';
|
|
26
|
+
export { discoverFromStream, pickPrimaryKeyFromStats } from './StreamingDiscovery.js';
|
|
27
|
+
export type { StreamDiscoveryOptions, DiscoveredColumnStat, StreamDiscoveryResult, PkPickOptions, PkStatVerdict } from './StreamingDiscovery.js';
|
|
28
|
+
export type { InferredColumnType, OverflowKeyStats, PromotionCandidate, PromotionPlanOptions } from './CustomColumnPromotion.js';
|
|
23
29
|
export { partitionRecords, partitionRollupHash, diffPartitions, partitionKeyForIdentity } from './HashDiff.js';
|
|
24
30
|
export type { PartitionDiff } from './HashDiff.js';
|
|
25
31
|
export { mostRecentWinner, parseTimestamp } from './ConflictRecency.js';
|
|
@@ -34,4 +40,12 @@ export { AdaptiveConcurrencyController, RunAdaptive } from './AdaptiveConcurrenc
|
|
|
34
40
|
export type { AdaptiveConcurrencyOptions, AdaptiveItemOutcome, AdaptiveRunResult } from './AdaptiveConcurrency.js';
|
|
35
41
|
export type { FetchWarning } from './BaseIntegrationConnector.js';
|
|
36
42
|
export type { FieldMergeLog, ObjectMergeLog } from './IntegrationSchemaSync.js';
|
|
43
|
+
export { decideSchemaLimitViolations } from './IntegrationSchemaSync.js';
|
|
44
|
+
export type { SchemaLimitInput } from './IntegrationSchemaSync.js';
|
|
45
|
+
export { OAuth2TokenManager } from './auth-helpers/index.js';
|
|
46
|
+
export type { OAuth2GrantType, OAuth2TokenRequest, OAuth2Token } from './auth-helpers/index.js';
|
|
47
|
+
export { OAuth1aSigner, percentEncodeRFC3986 } from './auth-helpers/index.js';
|
|
48
|
+
export type { OAuth1aSignRequest, OAuth1aSignatureMethod } from './auth-helpers/index.js';
|
|
49
|
+
export { buildBasicAuthHeaderValue, buildBasicAuthHeader } from './auth-helpers/index.js';
|
|
50
|
+
export type { BasicAuthRequest } from './auth-helpers/index.js';
|
|
37
51
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,2BAA2B,EAAE,gCAAgC,EAAE,MAAM,mBAAmB,CAAC;AAG7J,YAAY,EACV,aAAa,EACb,eAAe,EACf,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EACd,YAAY,EACZ,UAAU,EACV,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,YAAY,EACZ,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,EACxB,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,sBAAsB,EACtB,uBAAuB,EACvB,WAAW,EACX,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,UAAU,EACV,aAAa,EACb,YAAY,EACZ,WAAW,EACX,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,2BAA2B,EAAE,gCAAgC,EAAE,MAAM,mBAAmB,CAAC;AAG7J,YAAY,EACV,aAAa,EACb,eAAe,EACf,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EACd,YAAY,EACZ,UAAU,EACV,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,YAAY,EACZ,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,EACxB,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,sBAAsB,E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
10
|
export { FieldMappingEngine } from './FieldMappingEngine.js';
|
|
11
11
|
export { MatchEngine } from './MatchEngine.js';
|
|
12
|
+
export { serializeKeyValue } from './KeySerialization.js';
|
|
12
13
|
// Services
|
|
13
14
|
export { WatermarkService } from './WatermarkService.js';
|
|
14
15
|
// Retry
|
|
@@ -24,10 +25,18 @@ export { IntegrationEngine } from './IntegrationEngine.js';
|
|
|
24
25
|
export { IntegrationSchemaSync } from './IntegrationSchemaSync.js';
|
|
25
26
|
// ── Restored module exports dropped by the origin/next index.ts merge (union) ──
|
|
26
27
|
export { computeContentHash, CONTENT_HASH_COLUMN } from './ContentHash.js';
|
|
28
|
+
export { CUSTOM_OVERFLOW_COLUMN, computeUnmappedFields, hasUnmappedFields } from './CustomOverflow.js';
|
|
29
|
+
export { planPromotions, inferColumnTypeFromSamples, buildOverflowStats, sanitizeColumnName } from './CustomColumnPromotion.js';
|
|
30
|
+
export { discoverFromStream, pickPrimaryKeyFromStats } from './StreamingDiscovery.js';
|
|
27
31
|
export { partitionRecords, partitionRollupHash, diffPartitions, partitionKeyForIdentity } from './HashDiff.js';
|
|
28
32
|
export { mostRecentWinner, parseTimestamp } from './ConflictRecency.js';
|
|
29
33
|
export { EnrichSchemaConstraints } from './EnrichSchemaConstraints.js';
|
|
30
34
|
export { RateLimiter } from './RateLimiter.js';
|
|
31
35
|
export { IntegrationConnectorCreationPipeline } from './IntegrationConnectorCreationPipeline.js';
|
|
32
36
|
export { AdaptiveConcurrencyController, RunAdaptive } from './AdaptiveConcurrency.js';
|
|
37
|
+
export { decideSchemaLimitViolations } from './IntegrationSchemaSync.js';
|
|
38
|
+
// ── Auth helpers (shared OAuth2/token primitives for connectors) ──
|
|
39
|
+
export { OAuth2TokenManager } from './auth-helpers/index.js';
|
|
40
|
+
export { OAuth1aSigner, percentEncodeRFC3986 } from './auth-helpers/index.js';
|
|
41
|
+
export { buildBasicAuthHeaderValue, buildBasicAuthHeader } from './auth-helpers/index.js';
|
|
33
42
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAgDA,+BAA+B;AAC/B,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAmB7D,YAAY;AACZ,OAAO,EAAE,wBAAwB,EAAE,WAAW,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAalH,sBAAsB;AACtB,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAGjF,UAAU;AACV,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,UAAU;AACV,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,WAAW;AACX,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,QAAQ;AACR,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAGnE,4BAA4B;AAC5B,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAGvE,qHAAqH;AACrH,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAG7E,gFAAgF;AAChF,8GAA8G;AAC9G,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,uGAAuG;AACvG,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAGnE,kFAAkF;AAClF,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACvG,OAAO,EAAE,cAAc,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChI,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAGtF,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAE/G,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAExE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,oCAAoC,EAAE,MAAM,2CAA2C,CAAC;AAEjG,OAAO,EAAE,6BAA6B,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAItF,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAGzE,qEAAqE;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAE9E,OAAO,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -49,6 +49,15 @@ export interface MappedRecord {
|
|
|
49
49
|
ChangeType: RecordChangeType;
|
|
50
50
|
/** ID of an existing MJ record if matched */
|
|
51
51
|
MatchedMJRecordID?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Source keys the record returned that have NO active field map — the "extra" fields
|
|
54
|
+
* the target table has no column for (yet). Computed at {@link MapSingleRecord} as
|
|
55
|
+
* `keys(ExternalRecord.Fields) − active map SourceFieldNames`. Empty/undefined in the
|
|
56
|
+
* common case (everything mapped). When non-empty, the engine parks it as JSON in the
|
|
57
|
+
* `__mj_integration_CustomOverflow` system column so a post-sync RSU pass can promote
|
|
58
|
+
* pervasive keys to real columns. Backend staging only — see {@link CustomOverflow}.
|
|
59
|
+
*/
|
|
60
|
+
UnmappedFields?: Record<string, unknown>;
|
|
52
61
|
}
|
|
53
62
|
/** Aggregate result of a sync operation */
|
|
54
63
|
export interface SyncResult {
|
|
@@ -78,7 +87,60 @@ export interface SyncResult {
|
|
|
78
87
|
EntityMapResults?: EntityMapSyncResult[];
|
|
79
88
|
/** Duration of the sync in milliseconds */
|
|
80
89
|
Duration?: number;
|
|
90
|
+
/**
|
|
91
|
+
* True if this map hit a rate-limit/throttle during fetch. Feeds the per-layer AIMD controller
|
|
92
|
+
* so a throttle (not just a per-request token-bucket backoff) also reduces in-flight concurrency.
|
|
93
|
+
* Transient signal — not persisted.
|
|
94
|
+
*/
|
|
95
|
+
Throttled?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Outcome of the post-sync custom-column promotion pass (gaps.md §2). Present only when a
|
|
98
|
+
* promotion callback is registered AND ran; undefined for a customs-free sync (the common
|
|
99
|
+
* case). Lets the resolver surface SchemaUpdatePending to the client.
|
|
100
|
+
*/
|
|
101
|
+
SchemaUpdate?: SchemaPromotionResult;
|
|
102
|
+
}
|
|
103
|
+
/** Outcome of the post-sync custom-column promotion pass (gaps.md §2 / M2). */
|
|
104
|
+
export interface SchemaPromotionResult {
|
|
105
|
+
/** Whether any new column was promoted to real schema this run. */
|
|
106
|
+
Promoted: boolean;
|
|
107
|
+
/** The columns promoted, per target entity. */
|
|
108
|
+
ColumnsAdded: Array<{
|
|
109
|
+
EntityName: string;
|
|
110
|
+
ColumnName: string;
|
|
111
|
+
}>;
|
|
112
|
+
/**
|
|
113
|
+
* Whether a schema change was applied that needs an MJAPI restart for the new columns to
|
|
114
|
+
* be exposed over GraphQL — surfaced so the client reads the restart as intentional, not a
|
|
115
|
+
* crash. False when nothing was promoted. (Restart orchestration itself: M3.)
|
|
116
|
+
*/
|
|
117
|
+
SchemaUpdatePending: boolean;
|
|
118
|
+
/** Non-fatal detail when promotion was attempted but partially/fully failed. */
|
|
119
|
+
Message?: string;
|
|
120
|
+
/**
|
|
121
|
+
* Non-fatal problems encountered during promotion (RSU/DDL failure, IOF or field-map save
|
|
122
|
+
* failure, per-pass churn-cap deferral, a missing entity map). The engine surfaces each as a
|
|
123
|
+
* structured SyncWarning on the run stream so the operator sees what didn't promote — promotion
|
|
124
|
+
* NEVER fails the sync, but a swallowed problem must not be invisible.
|
|
125
|
+
*/
|
|
126
|
+
Warnings?: string[];
|
|
81
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* Server-registered hook that runs the post-sync custom-column promotion (gaps.md §2). The
|
|
130
|
+
* engine never depends on RSU/CodeGen — the server registers an implementation that performs
|
|
131
|
+
* the coverage scan → RSU ADD COLUMN → IOF/field-map. Self-gated INSIDE the callback: a cheap
|
|
132
|
+
* EXISTS over the overflow column means a customs-free sync does no promotion work, so the
|
|
133
|
+
* two-stage process collapses to single-stage (1×) when there is nothing to promote.
|
|
134
|
+
*
|
|
135
|
+
* ContextUser/Provider are typed `unknown` to avoid a circular import; the engine passes a real
|
|
136
|
+
* UserInfo / IMetadataProvider and the server implementation narrows them back.
|
|
137
|
+
*/
|
|
138
|
+
export type PostSyncSchemaPromotionCallback = (ctx: {
|
|
139
|
+
CompanyIntegrationID: string;
|
|
140
|
+
ContextUser: unknown;
|
|
141
|
+
SyncedEntityNames: string[];
|
|
142
|
+
Provider?: unknown;
|
|
143
|
+
}) => Promise<SchemaPromotionResult>;
|
|
82
144
|
/** Per-entity-map result within a sync run */
|
|
83
145
|
export interface EntityMapSyncResult {
|
|
84
146
|
/** The entity map ID */
|
|
@@ -185,6 +247,17 @@ export interface IntegrationSyncOptions {
|
|
|
185
247
|
export interface SourceSchemaInfo {
|
|
186
248
|
/** All objects (tables, API entities) discovered in the source system. */
|
|
187
249
|
Objects: SourceObjectInfo[];
|
|
250
|
+
/**
|
|
251
|
+
* §7 — TRUE only when this schema is an AUTHORITATIVE live enumeration of the FULL gamut the
|
|
252
|
+
* credentials expose (a real list/describe endpoint that returns everything accessible). When true,
|
|
253
|
+
* a comprehensive refresh may DEACTIVATE declared/discovered objects/fields ABSENT from it (the
|
|
254
|
+
* source genuinely dropped them). When false/undefined — the default, and the case for stubbed
|
|
255
|
+
* discovery (`DiscoverObjects` returns nothing) or a CACHE-DRIVEN IntrospectSchema (which just
|
|
256
|
+
* re-reads persisted metadata) or any partial/scoped discovery — deactivation is FORBIDDEN, because
|
|
257
|
+
* absence proves nothing and would wrongly wipe the Declared metadata that is the only source.
|
|
258
|
+
* Set by the connector's `DiscoveryIsAuthoritative` getter; never assume true.
|
|
259
|
+
*/
|
|
260
|
+
IsAuthoritative?: boolean;
|
|
188
261
|
}
|
|
189
262
|
/** Options controlling scope of IntrospectSchema. */
|
|
190
263
|
export interface IntrospectSchemaOptions {
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,uEAAuE;AACvE,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,eAAe,CAAC;AAE9D,+BAA+B;AAC/B,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEjE,kDAAkD;AAClD,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,QAAQ,GAAG,aAAa,GAAG,SAAS,CAAC;AAE/E,4DAA4D;AAC5D,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG,UAAU,GAAG,YAAY,GAAG,QAAQ,CAAC;AAErF,oEAAoE;AACpE,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,WAAW,GAAG,YAAY,CAAC;AAEvE,4DAA4D;AAC5D,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ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