@memberjunction/integration-connectors 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/dist/CventConnector.d.ts +146 -0
- package/dist/CventConnector.d.ts.map +1 -0
- package/dist/CventConnector.js +540 -0
- package/dist/CventConnector.js.map +1 -0
- package/dist/DynamicsDataverseConnector.d.ts +296 -0
- package/dist/DynamicsDataverseConnector.d.ts.map +1 -0
- package/dist/DynamicsDataverseConnector.js +790 -0
- package/dist/DynamicsDataverseConnector.js.map +1 -0
- package/dist/FontevaConnector.d.ts +153 -0
- package/dist/FontevaConnector.d.ts.map +1 -0
- package/dist/FontevaConnector.js +421 -0
- package/dist/FontevaConnector.js.map +1 -0
- package/dist/GrowthZoneConnector.d.ts +123 -125
- package/dist/GrowthZoneConnector.d.ts.map +1 -1
- package/dist/GrowthZoneConnector.js +456 -499
- package/dist/GrowthZoneConnector.js.map +1 -1
- package/dist/HivebriteConnector.d.ts +151 -0
- package/dist/HivebriteConnector.d.ts.map +1 -0
- package/dist/HivebriteConnector.js +533 -0
- package/dist/HivebriteConnector.js.map +1 -0
- package/dist/IMISConnector.d.ts +112 -96
- package/dist/IMISConnector.d.ts.map +1 -1
- package/dist/IMISConnector.js +430 -417
- package/dist/IMISConnector.js.map +1 -1
- package/dist/MemberSuiteConnector.d.ts +185 -0
- package/dist/MemberSuiteConnector.d.ts.map +1 -0
- package/dist/MemberSuiteConnector.js +762 -0
- package/dist/MemberSuiteConnector.js.map +1 -0
- package/dist/NeonCRMConnector.d.ts +273 -0
- package/dist/NeonCRMConnector.d.ts.map +1 -0
- package/dist/NeonCRMConnector.js +1039 -0
- package/dist/NeonCRMConnector.js.map +1 -0
- package/dist/NetForumConnector.d.ts +140 -47
- package/dist/NetForumConnector.d.ts.map +1 -1
- package/dist/NetForumConnector.js +668 -395
- package/dist/NetForumConnector.js.map +1 -1
- package/dist/NetSuiteConnector.d.ts +116 -50
- package/dist/NetSuiteConnector.d.ts.map +1 -1
- package/dist/NetSuiteConnector.js +608 -510
- package/dist/NetSuiteConnector.js.map +1 -1
- package/dist/NimbleAMSConnector.d.ts +104 -11
- package/dist/NimbleAMSConnector.d.ts.map +1 -1
- package/dist/NimbleAMSConnector.js +552 -258
- package/dist/NimbleAMSConnector.js.map +1 -1
- package/dist/NoviConnector.d.ts +178 -0
- package/dist/NoviConnector.d.ts.map +1 -0
- package/dist/NoviConnector.js +566 -0
- package/dist/NoviConnector.js.map +1 -0
- package/dist/ORCIDConnector.d.ts +207 -0
- package/dist/ORCIDConnector.d.ts.map +1 -0
- package/dist/ORCIDConnector.js +708 -0
- package/dist/ORCIDConnector.js.map +1 -0
- package/dist/OpenWaterConnector.d.ts +173 -0
- package/dist/OpenWaterConnector.d.ts.map +1 -0
- package/dist/OpenWaterConnector.js +893 -0
- package/dist/OpenWaterConnector.js.map +1 -0
- package/dist/PathLMSConnector.d.ts +395 -0
- package/dist/PathLMSConnector.d.ts.map +1 -0
- package/dist/PathLMSConnector.js +1281 -0
- package/dist/PathLMSConnector.js.map +1 -0
- package/dist/PheedLoopConnector.d.ts +119 -0
- package/dist/PheedLoopConnector.d.ts.map +1 -0
- package/dist/PheedLoopConnector.js +429 -0
- package/dist/PheedLoopConnector.js.map +1 -0
- package/dist/PropFuelConnector.d.ts +135 -61
- package/dist/PropFuelConnector.d.ts.map +1 -1
- package/dist/PropFuelConnector.js +366 -467
- package/dist/PropFuelConnector.js.map +1 -1
- package/dist/RhythmConnector.d.ts +188 -0
- package/dist/RhythmConnector.d.ts.map +1 -0
- package/dist/RhythmConnector.js +784 -0
- package/dist/RhythmConnector.js.map +1 -0
- package/dist/SalesforceConnector.d.ts +69 -3
- package/dist/SalesforceConnector.d.ts.map +1 -1
- package/dist/SalesforceConnector.js +188 -166
- package/dist/SalesforceConnector.js.map +1 -1
- package/dist/SharePointConnector.d.ts +37 -30
- package/dist/SharePointConnector.d.ts.map +1 -1
- package/dist/SharePointConnector.js +163 -243
- package/dist/SharePointConnector.js.map +1 -1
- package/dist/YourMembershipConnector.d.ts.map +1 -1
- package/dist/YourMembershipConnector.js +13 -5
- package/dist/YourMembershipConnector.js.map +1 -1
- package/dist/index.d.ts +14 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -3
- package/dist/index.js.map +1 -1
- package/package.json +8 -7
- package/dist/BettyConnector.d.ts +0 -288
- package/dist/BettyConnector.d.ts.map +0 -1
- package/dist/BettyConnector.js +0 -909
- package/dist/BettyConnector.js.map +0 -1
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
import { type UserInfo } from '@memberjunction/core';
|
|
2
|
+
import type { MJCompanyIntegrationEntity, MJIntegrationObjectEntity, MJIntegrationObjectFieldEntity } from '@memberjunction/core-entities';
|
|
3
|
+
import { BaseRESTIntegrationConnector, type RESTAuthContext, type RESTResponse, type PaginationState, type PaginationType, type ConnectionTestResult, type ExternalObjectSchema, type ExternalFieldSchema, type FetchContext, type FetchBatchResult, type RateLimitPolicy } from '@memberjunction/integration-engine';
|
|
4
|
+
/**
|
|
5
|
+
* Connection configuration parsed from the CompanyIntegration's MJ Credential
|
|
6
|
+
* (preferred) or its Configuration JSON. Dynamics 365 / Dataverse is reached
|
|
7
|
+
* through the OData v4 Web API using a Microsoft Entra ID (Azure AD)
|
|
8
|
+
* client-credentials (server-to-server / app-only) token.
|
|
9
|
+
*
|
|
10
|
+
* Field names are read case-insensitively so a credential authored as
|
|
11
|
+
* `tenantId`/`TenantID`/`tenant_id` all resolve.
|
|
12
|
+
*/
|
|
13
|
+
export interface DynamicsConnectionConfig {
|
|
14
|
+
/** Microsoft Entra ID tenant GUID (or `common`/`organizations`). */
|
|
15
|
+
TenantId: string;
|
|
16
|
+
/** Application (client) registration GUID. */
|
|
17
|
+
ClientId: string;
|
|
18
|
+
/** Application client secret. */
|
|
19
|
+
ClientSecret: string;
|
|
20
|
+
/**
|
|
21
|
+
* The Dataverse environment URL, e.g. `https://contoso.crm.dynamics.com`.
|
|
22
|
+
* Per-customer — NEVER hardcoded. The OAuth resource/audience scope is
|
|
23
|
+
* `<EnvironmentUrl>/.default` and the Web API base is `<EnvironmentUrl>/api/data/v9.2`.
|
|
24
|
+
*/
|
|
25
|
+
EnvironmentUrl: string;
|
|
26
|
+
/** Override the Web API version segment. Default: `v9.2`. */
|
|
27
|
+
ApiVersion?: string;
|
|
28
|
+
/** Override the Entra ID token endpoint origin. Default: `https://login.microsoftonline.com`. */
|
|
29
|
+
AuthorityHost?: string;
|
|
30
|
+
/** Override the OAuth scope. Default: `<EnvironmentUrl>/.default`. */
|
|
31
|
+
Scope?: string;
|
|
32
|
+
/** Maximum retries for rate-limited / transient failures. Default: 5. */
|
|
33
|
+
MaxRetries?: number;
|
|
34
|
+
/** HTTP request timeout in milliseconds. Default: 60000. */
|
|
35
|
+
RequestTimeoutMs?: number;
|
|
36
|
+
/** Minimum milliseconds between API requests. Default: 0 (governed by the engine's adaptive bucket). */
|
|
37
|
+
MinRequestIntervalMs?: number;
|
|
38
|
+
/** Requested OData max page size (capped at 5000 by the service). Default: 5000. */
|
|
39
|
+
MaxPageSize?: number;
|
|
40
|
+
}
|
|
41
|
+
/** Auth context carrying the minted bearer token plus the resolved Web API base URL + config. */
|
|
42
|
+
interface DynamicsAuthContext extends RESTAuthContext {
|
|
43
|
+
Config: DynamicsConnectionConfig;
|
|
44
|
+
/**
|
|
45
|
+
* Org ROOT URL (`<EnvironmentUrl>`) used by the base class's BuildFullURL(baseURL, APIPath).
|
|
46
|
+
* The frozen IO `APIPath`s are ABSOLUTE-from-root (they already include `/api/data/v9.2/...`), so
|
|
47
|
+
* the base must be the org root to avoid doubling the version segment.
|
|
48
|
+
*/
|
|
49
|
+
BaseUrl: string;
|
|
50
|
+
/** Versioned Web API base (`<EnvironmentUrl>/api/data/v9.2`) for the connector's OWN calls (WhoAmI, EntityDefinitions, delta). */
|
|
51
|
+
ApiBaseUrl: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Connector for Microsoft Dynamics 365 / Dataverse (Common Data Service) via the
|
|
55
|
+
* OData v4 Web API.
|
|
56
|
+
*
|
|
57
|
+
* - **Auth**: Microsoft Entra ID OAuth 2.0 client-credentials (app-only). Token is
|
|
58
|
+
* minted/cached by the shared {@link OAuth2TokenManager}; the credential bytes are
|
|
59
|
+
* resolved at runtime from the connection's MJ Credential / Configuration — never baked.
|
|
60
|
+
* - **Base URL**: `<EnvironmentUrl>/api/data/v9.2`, per-connection (every customer
|
|
61
|
+
* environment differs — nothing is hardcoded).
|
|
62
|
+
* - **Discovery**: `DiscoverObjects` / `DiscoverFields` parse the credentialed
|
|
63
|
+
* `EntityDefinitions` describe endpoint at runtime (case-2 auth-gated discovery) so
|
|
64
|
+
* BOTH standard and custom/solution-installed tables surface. The documented standard
|
|
65
|
+
* catalog lives in the Declared metadata file, not in this class.
|
|
66
|
+
* - **Pagination**: OData `@odata.nextLink` cursor, followed verbatim.
|
|
67
|
+
* - **Write**: generic per-operation CRUD from {@link BaseRESTIntegrationConnector}
|
|
68
|
+
* (flat body; create ID read from the `OData-EntityId` response header; update PATCH
|
|
69
|
+
* `/<entityset>(id)`; delete DELETE `/<entityset>(id)`; alternate-key upsert path form).
|
|
70
|
+
* - **Incremental**: change-tracking delta (`Prefer: odata.track-changes` →
|
|
71
|
+
* `@odata.deltaLink`) when a table declares it; `modifiedon`-polling fallback otherwise.
|
|
72
|
+
*/
|
|
73
|
+
export declare class DynamicsDataverseConnector extends BaseRESTIntegrationConnector {
|
|
74
|
+
private readonly tokenManager;
|
|
75
|
+
private cachedAuth;
|
|
76
|
+
/** Verbatim from the upstream identity handoff. Drives the three-way name invariant.
|
|
77
|
+
* Returned as a string literal (not the INTEGRATION_NAME const ref) so the T1
|
|
78
|
+
* ThreeWayName static parser can extract it from source. */
|
|
79
|
+
get IntegrationName(): string;
|
|
80
|
+
get SupportsCreate(): boolean;
|
|
81
|
+
get SupportsUpdate(): boolean;
|
|
82
|
+
get SupportsDelete(): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* §7 — `EntityDefinitions` enumerates the COMPLETE credentialed gamut (standard + custom +
|
|
85
|
+
* solution-installed tables / attributes), not a filtered subset, so a comprehensive refresh
|
|
86
|
+
* may safely + reversibly deactivate objects no longer in the response.
|
|
87
|
+
*/
|
|
88
|
+
get DiscoveryIsAuthoritative(): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* §7 — the watermark this connector advances (delta-link / modifiedon high-water) IS monotonic:
|
|
91
|
+
* change-tracking yields a forward-only delta token, and the modifiedon fallback fetches in
|
|
92
|
+
* ascending `modifiedon` order so the last batch carries the true maximum. Lets the engine narrow
|
|
93
|
+
* the next incremental instead of advancing to wall-clock now.
|
|
94
|
+
*/
|
|
95
|
+
get MonotonicWatermark(): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* §7 — keyset/seek resume key for watermark-less objects: the table's GUID primary key
|
|
98
|
+
* (`<logicalName>id`), read from the IO's Configuration. Stable + monotonic-enough for
|
|
99
|
+
* resume-from-last-seen; `null` when no PK is known.
|
|
100
|
+
*/
|
|
101
|
+
StableOrderingKey(objectName: string): string | null;
|
|
102
|
+
/**
|
|
103
|
+
* §7 — Dataverse enforces a per-environment Web API service-protection limit (≈ 6000 requests /
|
|
104
|
+
* 300s sliding window, plus an execution-time budget). Conservative sustained rate keeps the
|
|
105
|
+
* connector under the request-count limit; the engine's AIMD bucket adapts on 429s via
|
|
106
|
+
* {@link ExtractRetryAfterMs}. (≈6000/300 ≈ 20 req/s; we stay below to leave headroom.)
|
|
107
|
+
*/
|
|
108
|
+
get RateLimitPolicy(): RateLimitPolicy | null;
|
|
109
|
+
get MaxConcurrencyHint(): number | null;
|
|
110
|
+
/**
|
|
111
|
+
* Parse Dataverse's throttle signal. The service returns HTTP 429 with a `Retry-After` header
|
|
112
|
+
* (seconds) on a service-protection limit; honor it precisely.
|
|
113
|
+
*/
|
|
114
|
+
ExtractRetryAfterMs(error: unknown): number | undefined;
|
|
115
|
+
/**
|
|
116
|
+
* Validates the service principal can reach the environment by issuing a fresh token and a
|
|
117
|
+
* lightweight `WhoAmI` call (an unbound function returning the calling user/org GUIDs).
|
|
118
|
+
*/
|
|
119
|
+
TestConnection(companyIntegration: MJCompanyIntegrationEntity, contextUser: UserInfo): Promise<ConnectionTestResult>;
|
|
120
|
+
/**
|
|
121
|
+
* Case-2 (auth-gated) runtime discovery: enumerates EVERY table the credential can see via the
|
|
122
|
+
* `EntityDefinitions` describe endpoint (standard + custom + solution-installed) — NOT a baked
|
|
123
|
+
* catalog. The documented standard catalog seeded in the Declared metadata file is the floor;
|
|
124
|
+
* this returns what the live environment actually exposes (the ceiling), which is strictly a
|
|
125
|
+
* superset for custom-bearing tenants.
|
|
126
|
+
*/
|
|
127
|
+
DiscoverObjects(companyIntegration: MJCompanyIntegrationEntity, contextUser: UserInfo): Promise<ExternalObjectSchema[]>;
|
|
128
|
+
/**
|
|
129
|
+
* Case-2 runtime discovery for a single object's columns: describes the table's `Attributes`
|
|
130
|
+
* collection and maps each Property → {@link ExternalFieldSchema}, surfacing Type/MaxLength,
|
|
131
|
+
* the GUID PK (`IsPrimaryId` / `PrimaryIdAttribute` → `IsPrimaryKey`), and scalar Lookup
|
|
132
|
+
* columns → FK (with `ForeignKeyTarget` = the referenced table's logical name).
|
|
133
|
+
*/
|
|
134
|
+
DiscoverFields(companyIntegration: MJCompanyIntegrationEntity, objectName: string, contextUser: UserInfo): Promise<ExternalFieldSchema[]>;
|
|
135
|
+
/**
|
|
136
|
+
* Routes to the change-tracking delta path when the table declares it AND a watermark exists;
|
|
137
|
+
* otherwise delegates to the base metadata-driven fetch (which applies the `modifiedon` watermark
|
|
138
|
+
* fallback + standard `@odata.nextLink` pagination). The base path already handles
|
|
139
|
+
* `TransformRecord` (annotation stripping) + full-record pass-through, so the delta path mirrors it.
|
|
140
|
+
*/
|
|
141
|
+
FetchChanges(ctx: FetchContext): Promise<FetchBatchResult>;
|
|
142
|
+
/**
|
|
143
|
+
* Removes the OData control annotations (`@odata.etag`, `@odata.context`, `@odata.id`,
|
|
144
|
+
* `<lookup>@odata.bind`, `<lookup>@OData.Community.Display.V1.FormattedValue`, etc.) Dataverse
|
|
145
|
+
* sprinkles onto every record — they are response transport metadata, not columns. Every other
|
|
146
|
+
* source key is preserved (full-record pass-through); the removed keys are declared in
|
|
147
|
+
* {@link ExcludedSourceKeys} so the base re-add doesn't restore them and change-detection ignores them.
|
|
148
|
+
*/
|
|
149
|
+
protected TransformRecord(raw: Record<string, unknown>, _obj: MJIntegrationObjectEntity, _fields: MJIntegrationObjectFieldEntity[]): Record<string, unknown>;
|
|
150
|
+
/**
|
|
151
|
+
* The well-known static OData control annotation keys {@link TransformRecord} drops. The base
|
|
152
|
+
* `applyTransformPreservingKeys` uses this to avoid re-adding them. Dataverse ALSO emits dynamic,
|
|
153
|
+
* per-lookup annotation suffixes (`<col>@odata.bind`, `<col>@OData.Community.Display.V1.FormattedValue`,
|
|
154
|
+
* `<col>@Microsoft.Dynamics.CRM.lookuplogicalname`) whose exact names vary by record and cannot be
|
|
155
|
+
* enumerated statically — those are handled by the {@link applyTransformPreservingKeys} override
|
|
156
|
+
* below (predicate exclusion), so they never re-appear. This static list covers the always-present
|
|
157
|
+
* envelope keys for completeness / auditability.
|
|
158
|
+
*/
|
|
159
|
+
protected ExcludedSourceKeys(_objectName: string): string[];
|
|
160
|
+
/**
|
|
161
|
+
* Overrides the base re-add so the DYNAMIC OData annotation keys (`<col>@odata.bind`, FormattedValue,
|
|
162
|
+
* lookuplogicalname, etc.) {@link TransformRecord} strips are NOT restored. The base loop re-adds any
|
|
163
|
+
* `raw` key absent from the transform output unless it is in the static {@link ExcludedSourceKeys}
|
|
164
|
+
* set — which can't enumerate the per-record annotation suffixes. Here we re-add a dropped key only
|
|
165
|
+
* when it is neither statically excluded NOR an annotation key (by predicate). This keeps full-record
|
|
166
|
+
* pass-through for genuine columns while making the annotation removal stick (auditable, by rule).
|
|
167
|
+
*/
|
|
168
|
+
protected applyTransformPreservingKeys(raw: Record<string, unknown>, obj: MJIntegrationObjectEntity, fields: MJIntegrationObjectFieldEntity[]): Record<string, unknown>;
|
|
169
|
+
/**
|
|
170
|
+
* Mints/caches a Microsoft Entra ID access token via client-credentials. The scope is the
|
|
171
|
+
* environment's `.default` (`<EnvironmentUrl>/.default`) so the token's audience matches the
|
|
172
|
+
* Dataverse resource. Token is cached by {@link OAuth2TokenManager} until near expiry.
|
|
173
|
+
*/
|
|
174
|
+
protected Authenticate(companyIntegration: MJCompanyIntegrationEntity, contextUser: UserInfo, forceRefresh?: boolean): Promise<DynamicsAuthContext>;
|
|
175
|
+
/** Runs the client_credentials token round-trip through {@link OAuth2TokenManager}. */
|
|
176
|
+
private MintToken;
|
|
177
|
+
/** Standard OData/Dataverse headers — bearer token + JSON + OData version + return-representation. */
|
|
178
|
+
protected BuildHeaders(auth: RESTAuthContext): Record<string, string>;
|
|
179
|
+
/**
|
|
180
|
+
* HTTP transport with retry/backoff on 429/503/504 (Dataverse service-protection limits). The
|
|
181
|
+
* thrown error on a retryable status carries the response headers so {@link ExtractRetryAfterMs}
|
|
182
|
+
* can read `Retry-After` for the engine's adaptive bucket.
|
|
183
|
+
*/
|
|
184
|
+
protected MakeHTTPRequest(auth: RESTAuthContext, url: string, method: string, headers: Record<string, string>, body?: unknown): Promise<RESTResponse>;
|
|
185
|
+
/**
|
|
186
|
+
* Unwraps the OData collection envelope's `value` array. A single-record GET (`/<set>(id)`) is
|
|
187
|
+
* returned as a one-element array. Honors a metadata-declared `ResponseDataKey` if set, defaulting
|
|
188
|
+
* to the OData `value` convention.
|
|
189
|
+
*/
|
|
190
|
+
protected NormalizeResponse(rawBody: unknown, responseDataKey: string | null): Record<string, unknown>[];
|
|
191
|
+
/**
|
|
192
|
+
* Cursor pagination via `@odata.nextLink`. The nextLink is an ABSOLUTE continuation URL that
|
|
193
|
+
* encodes the exact next request (including the opaque `$skiptoken`); it is followed VERBATIM and
|
|
194
|
+
* never hand-built. A present nextLink means another page exists.
|
|
195
|
+
*/
|
|
196
|
+
protected ExtractPaginationInfo(rawBody: unknown, _paginationType: PaginationType, _currentPage: number, _currentOffset: number, _pageSize: number): PaginationState;
|
|
197
|
+
/**
|
|
198
|
+
* Per-connection base the engine joins the IO `APIPath` onto. The frozen Dataverse IO APIPaths are
|
|
199
|
+
* ABSOLUTE-from-root (they already include `/api/data/v9.2/...`), so this returns the org ROOT
|
|
200
|
+
* (`<EnvironmentUrl>`) and the resolved request URL is `<EnvironmentUrl>/api/data/v9.2/<entityset>`.
|
|
201
|
+
* The versioned Web API base (`<EnvironmentUrl>/api/data/v9.2`) is `ApiBaseUrl`, used by the
|
|
202
|
+
* connector's OWN calls (WhoAmI / EntityDefinitions / delta). Never a hardcoded org URL.
|
|
203
|
+
*/
|
|
204
|
+
protected GetBaseURL(_companyIntegration: MJCompanyIntegrationEntity, auth: RESTAuthContext): string;
|
|
205
|
+
/**
|
|
206
|
+
* Honors the OData `@odata.nextLink` cursor (used verbatim) and otherwise injects the page-size
|
|
207
|
+
* request as a `$top`-free first page — Dataverse caps page size via the `Prefer: odata.maxpagesize`
|
|
208
|
+
* header (added in {@link MakeFirstPageHeaders}), NOT a query param, and does NOT support `$skip`.
|
|
209
|
+
*/
|
|
210
|
+
protected BuildPaginatedURL(basePath: string, _obj: MJIntegrationObjectEntity, _page: number, _offset: number, cursor?: string, _effectivePageSize?: number): string;
|
|
211
|
+
/**
|
|
212
|
+
* Dataverse returns the created record's URI in the `OData-EntityId` response header
|
|
213
|
+
* (e.g. `https://org.crm.dynamics.com/api/data/v9.2/accounts(00000000-...)`); the GUID is the
|
|
214
|
+
* trailing `(...)` segment. Falls back to the `Location` header, then the body PK, so a tenant
|
|
215
|
+
* configured to return-representation still resolves. An empty ID makes the create FAIL LOUDLY
|
|
216
|
+
* via the base's BuildCreatedResult (never a silent duplicate-create).
|
|
217
|
+
*/
|
|
218
|
+
protected ExtractIDFromResponse(response: RESTResponse, idLocation: string | null): string | undefined;
|
|
219
|
+
/**
|
|
220
|
+
* Substitutes the target ID into a Dataverse single-record path. Supports the standard GUID form
|
|
221
|
+
* `/<entityset>(id)` AND the alternate-key upsert form `/<entityset>(<altkey>='<value>')` — when
|
|
222
|
+
* the ExternalID already contains an `=` it is an alternate-key expression and is inserted as-is
|
|
223
|
+
* (only the value is escaped); otherwise it is treated as a GUID. Handles both `({id})` template
|
|
224
|
+
* placeholders and a bare `(id)` suffix.
|
|
225
|
+
*/
|
|
226
|
+
protected SubstituteIDInPath(path: string, externalID: string, idLocation: string | null): string;
|
|
227
|
+
/**
|
|
228
|
+
* Builds the OData key expression for a single-record path. A plain GUID → `00000000-...`. An
|
|
229
|
+
* alternate-key expression (`key='value'` or `k1='v1',k2='v2'`) is passed through with each value
|
|
230
|
+
* single-quote-escaped. This realizes the alternate-key upsert path form the metadata may declare.
|
|
231
|
+
*/
|
|
232
|
+
private BuildKeyExpression;
|
|
233
|
+
/** Whether a table is configured for change tracking (Configuration.changeTrackingHeader present). */
|
|
234
|
+
private ObjectUsesChangeTracking;
|
|
235
|
+
/**
|
|
236
|
+
* Fetches changed records via Dataverse change tracking. The watermark holds the previous poll's
|
|
237
|
+
* `@odata.deltaLink` (a full URL carrying `$deltatoken`) — followed VERBATIM. Deleted records
|
|
238
|
+
* arrive as `$deletedEntity` references; they are surfaced with `IsDeleted=true`. The last page's
|
|
239
|
+
* `@odata.deltaLink` becomes the new watermark for the next poll.
|
|
240
|
+
*/
|
|
241
|
+
private FetchChangesViaDelta;
|
|
242
|
+
/** Maps one change-tracking row (live record OR `$deletedEntity` tombstone) to an ExternalRecord. */
|
|
243
|
+
private DeltaRowToExternalRecord;
|
|
244
|
+
/** Fetches the full table list via `EntityDefinitions` (paged, following @odata.nextLink). */
|
|
245
|
+
private FetchEntityDefinitions;
|
|
246
|
+
/** Describes one table + its Attributes by logical name. Returns null if not visible to the credential. */
|
|
247
|
+
private FetchEntityDefinition;
|
|
248
|
+
/** Resolves the Dataverse logical name for an IO (Configuration.logicalName, else the IO name). */
|
|
249
|
+
private ResolveLogicalName;
|
|
250
|
+
/** Maps a Dataverse table describe entry → ExternalObjectSchema. */
|
|
251
|
+
private EntityMetadataToObjectSchema;
|
|
252
|
+
/** Maps a Dataverse attribute describe entry → ExternalFieldSchema. */
|
|
253
|
+
private AttributeMetadataToFieldSchema;
|
|
254
|
+
/** Reads a Dataverse localized label, falling back to undefined. */
|
|
255
|
+
private LocalizedLabel;
|
|
256
|
+
/** Parses the connection config, preferring the attached MJ Credential over Configuration JSON. */
|
|
257
|
+
private ParseConfig;
|
|
258
|
+
/** Loads the OAuth2 config from the MJ: Credentials entity Values JSON. */
|
|
259
|
+
private ParseConfigFromCredential;
|
|
260
|
+
/** Validates the parsed config + applies defaults. Field names are read case-insensitively. */
|
|
261
|
+
private ValidateConfig;
|
|
262
|
+
/** Resolves the Web API base URL: `<EnvironmentUrl>/api/data/v9.2`. */
|
|
263
|
+
private ResolveBaseUrl;
|
|
264
|
+
private ExecuteOneRequest;
|
|
265
|
+
private ParseResponseBody;
|
|
266
|
+
private ExtractHeaders;
|
|
267
|
+
private IsRetryable;
|
|
268
|
+
private ComputeBackoffDelay;
|
|
269
|
+
private Sleep;
|
|
270
|
+
/**
|
|
271
|
+
* True for any OData/Dataverse annotation key. Genuine columns never contain `@`; every annotation
|
|
272
|
+
* does — the response-level controls (`@odata.etag`, `@odata.context`, …) and the per-column
|
|
273
|
+
* suffixes (`<col>@odata.bind`, `<col>@OData.Community.Display.V1.FormattedValue`,
|
|
274
|
+
* `<col>@Microsoft.Dynamics.CRM.lookuplogicalname`). So an `@`-containing key is an annotation.
|
|
275
|
+
*/
|
|
276
|
+
private IsODataAnnotationKey;
|
|
277
|
+
private buildDataverseURL;
|
|
278
|
+
private previewBody;
|
|
279
|
+
/** Integration ID of the most recent fetch — lets the no-arg StableOrderingKey hook locate the IO. */
|
|
280
|
+
private lastIntegrationID;
|
|
281
|
+
/**
|
|
282
|
+
* Best-effort cached-object lookup by NAME using the last-seen integration ID. Used by
|
|
283
|
+
* {@link StableOrderingKey}, which the engine calls without a CompanyIntegration; returns null
|
|
284
|
+
* (keyset resume simply unavailable) before any fetch has run.
|
|
285
|
+
*/
|
|
286
|
+
private tryGetCachedObject;
|
|
287
|
+
private tryGetCachedObjectFor;
|
|
288
|
+
/** Reads a trimmed string from an IO's Configuration JSON, tolerant of absent/invalid. */
|
|
289
|
+
private readObjectConfigString;
|
|
290
|
+
/** Extracts response headers from a thrown error, when the connector throws an error carrying them. */
|
|
291
|
+
private extractHeadersFromError;
|
|
292
|
+
}
|
|
293
|
+
/** Tree-shaking prevention function — import and call from the package entry point. */
|
|
294
|
+
export declare function LoadDynamicsDataverseConnector(): void;
|
|
295
|
+
export {};
|
|
296
|
+
//# sourceMappingURL=DynamicsDataverseConnector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DynamicsDataverseConnector.d.ts","sourceRoot":"","sources":["../src/DynamicsDataverseConnector.ts"],"names":[],"mappings":"AACA,OAAO,EAAoC,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACvF,OAAO,KAAK,EACR,0BAA0B,EAE1B,yBAAyB,EACzB,8BAA8B,EACjC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAEH,4BAA4B,EAG5B,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EAErB,KAAK,eAAe,EACvB,MAAM,oCAAoC,CAAC;AAI5C;;;;;;;;GAQG;AACH,MAAM,WAAW,wBAAwB;IACrC,oEAAoE;IACpE,QAAQ,EAAE,MAAM,CAAC;IACjB,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,CAAC;IACjB,iCAAiC;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB,6DAA6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