@memberjunction/integration-connectors 5.45.0 → 5.46.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/RelationalDBConnector.d.ts +7 -0
- package/dist/RelationalDBConnector.d.ts.map +1 -1
- package/dist/RelationalDBConnector.js +7 -0
- package/dist/RelationalDBConnector.js.map +1 -1
- package/dist/datasource/BaseDocumentDataSourceConnector.d.ts +21 -0
- package/dist/datasource/BaseDocumentDataSourceConnector.d.ts.map +1 -0
- package/dist/datasource/BaseDocumentDataSourceConnector.js +23 -0
- package/dist/datasource/BaseDocumentDataSourceConnector.js.map +1 -0
- package/dist/datasource/BaseExternalDataSourceConnector.d.ts +117 -0
- package/dist/datasource/BaseExternalDataSourceConnector.d.ts.map +1 -0
- package/dist/datasource/BaseExternalDataSourceConnector.js +337 -0
- package/dist/datasource/BaseExternalDataSourceConnector.js.map +1 -0
- package/dist/datasource/BaseSqlExternalDataSourceConnector.d.ts +20 -0
- package/dist/datasource/BaseSqlExternalDataSourceConnector.d.ts.map +1 -0
- package/dist/datasource/BaseSqlExternalDataSourceConnector.js +22 -0
- package/dist/datasource/BaseSqlExternalDataSourceConnector.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/package.json +7 -6
|
@@ -19,6 +19,13 @@ export interface ConnectionConfig {
|
|
|
19
19
|
* Abstract base class for connectors that read from relational databases via mssql.
|
|
20
20
|
* Handles connection management, object/field discovery, and connection testing.
|
|
21
21
|
* Subclasses must implement FetchChanges to define record extraction logic.
|
|
22
|
+
*
|
|
23
|
+
* @deprecated SQL-Server-only, inline-`mssql`, read-only, and carries its own connection from
|
|
24
|
+
* `CompanyIntegration.Configuration`. Superseded by {@link BaseSqlExternalDataSourceConnector} (and the
|
|
25
|
+
* family-neutral {@link BaseExternalDataSourceConnector}), which consume the shared External Data Sources
|
|
26
|
+
* connection layer — every engine's connect/introspect/read single-sourced in the EDS drivers, credentials
|
|
27
|
+
* via CredentialEngine. Prefer the per-engine leaves (`SQLServerConnector`, `PostgresConnector`, …). Kept
|
|
28
|
+
* for backward compatibility; do not build new connectors on it.
|
|
22
29
|
*/
|
|
23
30
|
export declare abstract class RelationalDBConnector extends BaseIntegrationConnector {
|
|
24
31
|
/** Cache of open connection pools keyed by "server|database" */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RelationalDBConnector.d.ts","sourceRoot":"","sources":["../src/RelationalDBConnector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EACH,wBAAwB,EACxB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACtB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,GAAG,MAAM,OAAO,CAAC;AAExB,iFAAiF;AACjF,MAAM,WAAW,gBAAgB;IAC7B,0BAA0B;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,wBAAwB;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,mEAAmE;IACnE,MAAM,EAAE,MAAM,CAAC;CAClB;AAED
|
|
1
|
+
{"version":3,"file":"RelationalDBConnector.d.ts","sourceRoot":"","sources":["../src/RelationalDBConnector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EACH,wBAAwB,EACxB,KAAK,oBAAoB,EACzB,KAAK,oBA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OAAO,CAAC,EAC5B,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,eAAe,EAAE,MAAM,EACvB,YAAY,CAAC,EAAE,MAAM,GACtB,cAAc;IAcjB;;;;;;;;OAQG;cACa,qBAAqB,CACjC,GAAG,EAAE,YAAY,EACjB,OAAO,EAAE,MAAM,EACf,eAAe,EAAE,MAAM,EACvB,YAAY,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,gBAAgB,CAAC;IAsC5B;;;;;;OAMG;IACH,OAAO,CAAC,mBAAmB;IAM3B;;OAEG;IACU,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;CAQ9C"}
|
|
@@ -4,6 +4,13 @@ import sql from 'mssql';
|
|
|
4
4
|
* Abstract base class for connectors that read from relational databases via mssql.
|
|
5
5
|
* Handles connection management, object/field discovery, and connection testing.
|
|
6
6
|
* Subclasses must implement FetchChanges to define record extraction logic.
|
|
7
|
+
*
|
|
8
|
+
* @deprecated SQL-Server-only, inline-`mssql`, read-only, and carries its own connection from
|
|
9
|
+
* `CompanyIntegration.Configuration`. Superseded by {@link BaseSqlExternalDataSourceConnector} (and the
|
|
10
|
+
* family-neutral {@link BaseExternalDataSourceConnector}), which consume the shared External Data Sources
|
|
11
|
+
* connection layer — every engine's connect/introspect/read single-sourced in the EDS drivers, credentials
|
|
12
|
+
* via CredentialEngine. Prefer the per-engine leaves (`SQLServerConnector`, `PostgresConnector`, …). Kept
|
|
13
|
+
* for backward compatibility; do not build new connectors on it.
|
|
7
14
|
*/
|
|
8
15
|
export class RelationalDBConnector extends BaseIntegrationConnector {
|
|
9
16
|
constructor() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RelationalDBConnector.js","sourceRoot":"","sources":["../src/RelationalDBConnector.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,wBAAwB,GAO3B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,GAAG,MAAM,OAAO,CAAC;AAgBxB
|
|
1
|
+
{"version":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
|
3
|
+
* Document / NoSQL family of the EDS-consuming ingestion connector (MongoDB today). The heart's ingestion
|
|
4
|
+
* flow applies unchanged — the MongoDB EDS driver's `RunView` accepts the same structured `incrementalSince`
|
|
5
|
+
* bound + ordering columns as the SQL drivers (rendering them to a Mongo query, coercing the watermark to a
|
|
6
|
+
* `Date`, itself) — so this family supplies only the one document-specific difference:
|
|
7
|
+
*
|
|
8
|
+
* - **Non-authoritative discovery** — document introspection SAMPLES documents (a bounded scan), so it
|
|
9
|
+
* does NOT enumerate the full field gamut; a field absent from a refresh proves nothing and must NOT
|
|
10
|
+
* drive deactivation. `DiscoveryIsAuthoritative` stays false (§7).
|
|
11
|
+
*
|
|
12
|
+
* Incremental sync on a document store depends on the collection carrying a conventional "last changed"
|
|
13
|
+
* field (name-detected by the heart); a collection without one syncs full, not incremental.
|
|
14
|
+
*
|
|
15
|
+
* Still abstract: a thin per-engine leaf (`MongoConnector`) registers it via `@RegisterClass`.
|
|
16
|
+
*/
|
|
17
|
+
export declare abstract class BaseDocumentDataSourceConnector extends BaseExternalDataSourceConnector {
|
|
18
|
+
/** Sampled introspection is not a full enumeration — never deactivate on absence. */
|
|
19
|
+
get DiscoveryIsAuthoritative(): boolean;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=BaseDocumentDataSourceConnector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseDocumentDataSourceConnector.d.ts","sourceRoot":"","sources":["../../src/datasource/BaseDocumentDataSourceConnector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AAEvF;;;;;;;;;;;;;;GAcG;AACH,8BAAsB,+BAAgC,SAAQ,+BAA+B;IACzF,qFAAqF;IACrF,IAAoB,wBAAwB,IAAI,OAAO,CAEtD;CACJ"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BaseExternalDataSourceConnector } from './BaseExternalDataSourceConnector.js';
|
|
2
|
+
/**
|
|
3
|
+
* Document / NoSQL family of the EDS-consuming ingestion connector (MongoDB today). The heart's ingestion
|
|
4
|
+
* flow applies unchanged — the MongoDB EDS driver's `RunView` accepts the same structured `incrementalSince`
|
|
5
|
+
* bound + ordering columns as the SQL drivers (rendering them to a Mongo query, coercing the watermark to a
|
|
6
|
+
* `Date`, itself) — so this family supplies only the one document-specific difference:
|
|
7
|
+
*
|
|
8
|
+
* - **Non-authoritative discovery** — document introspection SAMPLES documents (a bounded scan), so it
|
|
9
|
+
* does NOT enumerate the full field gamut; a field absent from a refresh proves nothing and must NOT
|
|
10
|
+
* drive deactivation. `DiscoveryIsAuthoritative` stays false (§7).
|
|
11
|
+
*
|
|
12
|
+
* Incremental sync on a document store depends on the collection carrying a conventional "last changed"
|
|
13
|
+
* field (name-detected by the heart); a collection without one syncs full, not incremental.
|
|
14
|
+
*
|
|
15
|
+
* Still abstract: a thin per-engine leaf (`MongoConnector`) registers it via `@RegisterClass`.
|
|
16
|
+
*/
|
|
17
|
+
export class BaseDocumentDataSourceConnector extends BaseExternalDataSourceConnector {
|
|
18
|
+
/** Sampled introspection is not a full enumeration — never deactivate on absence. */
|
|
19
|
+
get DiscoveryIsAuthoritative() {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=BaseDocumentDataSourceConnector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseDocumentDataSourceConnector.js","sourceRoot":"","sources":["../../src/datasource/BaseDocumentDataSourceConnector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AAEvF;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAgB,+BAAgC,SAAQ,+BAA+B;IACzF,qFAAqF;IACrF,IAAoB,wBAAwB;QACxC,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import type { UserInfo } from '@memberjunction/core';
|
|
2
|
+
import type { ExternalSchemaColumn, ExternalSchemaObject } from '@memberjunction/core';
|
|
3
|
+
import type { MJCompanyIntegrationEntity } from '@memberjunction/core-entities';
|
|
4
|
+
import { BaseIntegrationConnector, type ConnectionTestResult, type ExternalObjectSchema, type ExternalFieldSchema, type SourceSchemaInfo, type SourceObjectInfo, type SourceFieldInfo, type IntrospectSchemaOptions, type FetchContext, type FetchBatchResult, type ExternalRecord } from '@memberjunction/integration-engine';
|
|
5
|
+
import { type ResolvedExternalDataSource } from '@memberjunction/external-data-sources';
|
|
6
|
+
/** Resolved foreign-key edge for one referencing column (built from the descriptor's relationships). */
|
|
7
|
+
interface ForeignKeyEdge {
|
|
8
|
+
/** The source object the column references. */
|
|
9
|
+
Target: string;
|
|
10
|
+
/** The referenced column on the target object. */
|
|
11
|
+
TargetField: string;
|
|
12
|
+
}
|
|
13
|
+
/** Per-object sync metadata resolved from the persisted IntegrationObject/Field cache. */
|
|
14
|
+
interface ExternalObjectMeta {
|
|
15
|
+
/** The vendor-side "last changed" column, when the object declares one. */
|
|
16
|
+
WatermarkField?: string;
|
|
17
|
+
/** Primary-key column name(s), used for record identity + deterministic ordering. */
|
|
18
|
+
PrimaryKeyFields: string[];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Base for **integration connectors that ingest from a shared External Data Source (EDS)** — the
|
|
22
|
+
* "dbconnection" heart of the ingestion-connector hierarchy.
|
|
23
|
+
*
|
|
24
|
+
* It does NOT open its own connection, re-implement per-engine introspection, or write any dialect SQL.
|
|
25
|
+
* Instead it resolves the SAME first-class `MJ: External Data Sources` row that EDS live-read/materialize
|
|
26
|
+
* use (connection config + credential via CredentialEngine + the engine driver), through
|
|
27
|
+
* {@link ExternalDataSourceRouter}, and on top of that shared connection provides the whole integration
|
|
28
|
+
* contract: `TestConnection`, schema introspection (mapping EDS's `ExternalSchemaDescriptor` → the
|
|
29
|
+
* framework's `SourceSchemaInfo`), object/field discovery, AND incremental delta ingestion (`FetchChanges`).
|
|
30
|
+
*
|
|
31
|
+
* `FetchChanges` is generic across every EDS driver: it passes a **structured** `incrementalSince` watermark
|
|
32
|
+
* bound plus raw ordering columns to `driver.RunView`, and the EDS driver renders the dialect predicate,
|
|
33
|
+
* identifier quoting, and literal formatting itself. So this connector carries **NO** dialect knowledge —
|
|
34
|
+
* the only per-family variance is **whether discovery is authoritative** (SQL introspection enumerates the
|
|
35
|
+
* full column set; document introspection samples — see the family subclasses). A future family whose
|
|
36
|
+
* driver can't take these `RunView` params simply overrides `FetchChanges`.
|
|
37
|
+
*
|
|
38
|
+
* This supersedes the SQL-Server-hardcoded, inline-`mssql` {@link RelationalDBConnector}: every engine's
|
|
39
|
+
* connect/introspect/read is single-sourced in the EDS drivers, so this class is engine-agnostic.
|
|
40
|
+
*
|
|
41
|
+
* ### The bridge
|
|
42
|
+
* The `MJ: Company Integrations` connection names its shared EDS row via
|
|
43
|
+
* `Configuration.externalDataSourceID` (JSON). Credentials live on the EDS row (`CredentialID` →
|
|
44
|
+
* CredentialEngine), NEVER in the integration's Configuration.
|
|
45
|
+
*/
|
|
46
|
+
export declare abstract class BaseExternalDataSourceConnector extends BaseIntegrationConnector {
|
|
47
|
+
/** Configuration key on `CompanyIntegration.Configuration` naming the shared EDS data-source row. */
|
|
48
|
+
protected static readonly ExternalDataSourceIDKey = "externalDataSourceID";
|
|
49
|
+
/**
|
|
50
|
+
* We fetch strictly in watermark order, so the last batch's max watermark IS the true high-water mark
|
|
51
|
+
* and an updated row always re-surfaces at a new, higher watermark — the engine can safely narrow the
|
|
52
|
+
* next incremental to it (§ MonotonicWatermark).
|
|
53
|
+
*/
|
|
54
|
+
get MonotonicWatermark(): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Reads the shared EDS data-source ID from the connection's `Configuration` JSON. Throws a clear,
|
|
57
|
+
* actionable error when it is absent — an EDS-backed connector is meaningless without one.
|
|
58
|
+
*/
|
|
59
|
+
protected ReadExternalDataSourceID(companyIntegration: MJCompanyIntegrationEntity): string;
|
|
60
|
+
/**
|
|
61
|
+
* Resolves the shared EDS data-source to its live driver via the EDS router (reusing the engine's
|
|
62
|
+
* pooling, credential resolution, and auth self-heal). Returns the data source row, its type, and driver.
|
|
63
|
+
*/
|
|
64
|
+
protected Resolve(companyIntegration: MJCompanyIntegrationEntity, contextUser: UserInfo): Promise<ResolvedExternalDataSource>;
|
|
65
|
+
TestConnection(companyIntegration: MJCompanyIntegrationEntity, contextUser: UserInfo): Promise<ConnectionTestResult>;
|
|
66
|
+
/**
|
|
67
|
+
* Introspects the shared EDS source and maps its `ExternalSchemaDescriptor` (native types, PK,
|
|
68
|
+
* nullability, composite FKs) into the framework's `SourceSchemaInfo` in ONE round-trip.
|
|
69
|
+
*/
|
|
70
|
+
IntrospectSchema(companyIntegration: MJCompanyIntegrationEntity, contextUser: UserInfo, options?: IntrospectSchemaOptions): Promise<SourceSchemaInfo>;
|
|
71
|
+
DiscoverObjects(companyIntegration: MJCompanyIntegrationEntity, contextUser: UserInfo): Promise<ExternalObjectSchema[]>;
|
|
72
|
+
DiscoverFields(companyIntegration: MJCompanyIntegrationEntity, objectName: string, contextUser: UserInfo): Promise<ExternalFieldSchema[]>;
|
|
73
|
+
FetchChanges(ctx: FetchContext): Promise<FetchBatchResult>;
|
|
74
|
+
/** Resolve the object's watermark + PK columns from the persisted IntegrationObject/Field cache. */
|
|
75
|
+
protected ResolveObjectMeta(ctx: FetchContext): Promise<ExternalObjectMeta>;
|
|
76
|
+
/** Build an `ExternalRecord` from a source row — full-record pass-through in `Fields`. */
|
|
77
|
+
protected BuildRecord(row: Record<string, unknown>, objectName: string, primaryKeyFields: string[], watermarkField: string | undefined): ExternalRecord;
|
|
78
|
+
/** Stable string for one primary-key component (Dates → ISO, null → empty). */
|
|
79
|
+
protected StringifyKeyPart(value: unknown): string;
|
|
80
|
+
/**
|
|
81
|
+
* Deterministic content key for a genuinely PK-less row (rare); lets such tables still dedupe.
|
|
82
|
+
* Excludes `watermarkField` when given — the watermark column changes on every update by definition, so
|
|
83
|
+
* including it would mint a new `ExternalID` (and therefore a new inserted record) on every update to
|
|
84
|
+
* the same PK-less row instead of matching its prior identity.
|
|
85
|
+
*/
|
|
86
|
+
protected ContentKey(row: Record<string, unknown>, watermarkField?: string): string;
|
|
87
|
+
/** The batch's max watermark = the last row's watermark value (rows are watermark-ordered ascending). */
|
|
88
|
+
protected MaxWatermark(rows: Record<string, unknown>[], watermarkField: string | undefined): string | undefined;
|
|
89
|
+
/**
|
|
90
|
+
* Coerce a raw watermark value into a Date for `ExternalRecord.ModifiedAt` (undefined when unparseable).
|
|
91
|
+
* Delegates full ISO-8601 date-times to the shared {@link parseIso8601AsUtc} helper — the same one the
|
|
92
|
+
* EDS drivers use for incremental-watermark literal formatting and Mongo date coercion — so a ZONELESS
|
|
93
|
+
* ISO string is interpreted as UTC consistently everywhere, not via a locally-reimplemented regex. Falls
|
|
94
|
+
* back to `Date`'s own parsing for non-ISO shapes (e.g. a date-only string) that helper intentionally
|
|
95
|
+
* rejects. (In practice the driver returns `Date`s from `RunView`; this string path is the fallback.)
|
|
96
|
+
*/
|
|
97
|
+
protected CoerceDate(value: unknown): Date | undefined;
|
|
98
|
+
/** Map one EDS object (table/view/collection) to the framework's `SourceObjectInfo`. */
|
|
99
|
+
protected MapObjectToSourceObject(obj: ExternalSchemaObject): SourceObjectInfo;
|
|
100
|
+
/** Map one EDS column to a `SourceFieldInfo`. Length/precision are absent from the EDS descriptor today. */
|
|
101
|
+
protected MapColumnToSourceField(column: ExternalSchemaColumn, fkByColumn: Map<string, ForeignKeyEdge>): SourceFieldInfo;
|
|
102
|
+
/** Map one EDS column to the `ExternalFieldSchema` shape used by DiscoverFields. */
|
|
103
|
+
protected MapColumnToExternalField(column: ExternalSchemaColumn, fkByColumn: Map<string, ForeignKeyEdge>): ExternalFieldSchema;
|
|
104
|
+
/** Build a column-name → FK-edge map from an object's referencing-side relationships. */
|
|
105
|
+
protected BuildForeignKeyMap(obj: ExternalSchemaObject): Map<string, ForeignKeyEdge>;
|
|
106
|
+
/** Common "last-changed" column names, normalized (letters only) for a forgiving match. */
|
|
107
|
+
private static readonly WatermarkNameHints;
|
|
108
|
+
/**
|
|
109
|
+
* Best-effort default watermark column, matched by NAME only (engine-neutral — never inferred from a
|
|
110
|
+
* native type, since e.g. Postgres `timestamp` is a plain datetime, not a rowversion). Only sets the
|
|
111
|
+
* DEFAULT `IncrementalWatermarkField`; an operator can override it on the persisted IntegrationObject.
|
|
112
|
+
* Returns undefined when no conventional column is present (that object then syncs full, not incremental).
|
|
113
|
+
*/
|
|
114
|
+
protected DetectWatermarkField(obj: ExternalSchemaObject): string | undefined;
|
|
115
|
+
}
|
|
116
|
+
export {};
|
|
117
|
+
//# sourceMappingURL=BaseExternalDataSourceConnector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseExternalDataSourceConnector.d.ts","sourceRoot":"","sources":["../../src/datasource/BaseExternalDataSourceConnector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EACR,oBAAoB,EACpB,oBAAoB,EACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EACH,wBAAwB,EACxB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EAEpB,KAAK,uBAAuB,EAC5B,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACtB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAA+C,KAAK,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AAErI,wGAAwG;AACxG,UAAU,cAAc;IACpB,+CAA+C;IAC/C,MAAM,EAAE,MAAM,CAAC;IACf,kDAAkD;IA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IACH,SAAS,CAAC,oBAAoB,CAAC,GAAG,EAAE,oBAAoB,GAAG,MAAM,GAAG,SAAS;CAKhF"}
|
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
import { BaseIntegrationConnector, } from '@memberjunction/integration-engine';
|
|
2
|
+
import { IntegrationEngineBase } from '@memberjunction/integration-engine-base';
|
|
3
|
+
import { ExternalDataSourceRouter, parseIso8601AsUtc } from '@memberjunction/external-data-sources';
|
|
4
|
+
/**
|
|
5
|
+
* Base for **integration connectors that ingest from a shared External Data Source (EDS)** — the
|
|
6
|
+
* "dbconnection" heart of the ingestion-connector hierarchy.
|
|
7
|
+
*
|
|
8
|
+
* It does NOT open its own connection, re-implement per-engine introspection, or write any dialect SQL.
|
|
9
|
+
* Instead it resolves the SAME first-class `MJ: External Data Sources` row that EDS live-read/materialize
|
|
10
|
+
* use (connection config + credential via CredentialEngine + the engine driver), through
|
|
11
|
+
* {@link ExternalDataSourceRouter}, and on top of that shared connection provides the whole integration
|
|
12
|
+
* contract: `TestConnection`, schema introspection (mapping EDS's `ExternalSchemaDescriptor` → the
|
|
13
|
+
* framework's `SourceSchemaInfo`), object/field discovery, AND incremental delta ingestion (`FetchChanges`).
|
|
14
|
+
*
|
|
15
|
+
* `FetchChanges` is generic across every EDS driver: it passes a **structured** `incrementalSince` watermark
|
|
16
|
+
* bound plus raw ordering columns to `driver.RunView`, and the EDS driver renders the dialect predicate,
|
|
17
|
+
* identifier quoting, and literal formatting itself. So this connector carries **NO** dialect knowledge —
|
|
18
|
+
* the only per-family variance is **whether discovery is authoritative** (SQL introspection enumerates the
|
|
19
|
+
* full column set; document introspection samples — see the family subclasses). A future family whose
|
|
20
|
+
* driver can't take these `RunView` params simply overrides `FetchChanges`.
|
|
21
|
+
*
|
|
22
|
+
* This supersedes the SQL-Server-hardcoded, inline-`mssql` {@link RelationalDBConnector}: every engine's
|
|
23
|
+
* connect/introspect/read is single-sourced in the EDS drivers, so this class is engine-agnostic.
|
|
24
|
+
*
|
|
25
|
+
* ### The bridge
|
|
26
|
+
* The `MJ: Company Integrations` connection names its shared EDS row via
|
|
27
|
+
* `Configuration.externalDataSourceID` (JSON). Credentials live on the EDS row (`CredentialID` →
|
|
28
|
+
* CredentialEngine), NEVER in the integration's Configuration.
|
|
29
|
+
*/
|
|
30
|
+
export class BaseExternalDataSourceConnector extends BaseIntegrationConnector {
|
|
31
|
+
/** Configuration key on `CompanyIntegration.Configuration` naming the shared EDS data-source row. */
|
|
32
|
+
static { this.ExternalDataSourceIDKey = 'externalDataSourceID'; }
|
|
33
|
+
/**
|
|
34
|
+
* We fetch strictly in watermark order, so the last batch's max watermark IS the true high-water mark
|
|
35
|
+
* and an updated row always re-surfaces at a new, higher watermark — the engine can safely narrow the
|
|
36
|
+
* next incremental to it (§ MonotonicWatermark).
|
|
37
|
+
*/
|
|
38
|
+
get MonotonicWatermark() {
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
// ─── The bridge: CompanyIntegration → shared EDS data-source row ──────────────
|
|
42
|
+
/**
|
|
43
|
+
* Reads the shared EDS data-source ID from the connection's `Configuration` JSON. Throws a clear,
|
|
44
|
+
* actionable error when it is absent — an EDS-backed connector is meaningless without one.
|
|
45
|
+
*/
|
|
46
|
+
ReadExternalDataSourceID(companyIntegration) {
|
|
47
|
+
const label = companyIntegration.Name ?? companyIntegration.ID;
|
|
48
|
+
const raw = companyIntegration.Configuration;
|
|
49
|
+
if (!raw) {
|
|
50
|
+
throw new Error(`CompanyIntegration '${label}' has no Configuration; an external-data-source connector requires ` +
|
|
51
|
+
`Configuration.${BaseExternalDataSourceConnector.ExternalDataSourceIDKey}.`);
|
|
52
|
+
}
|
|
53
|
+
let parsed;
|
|
54
|
+
try {
|
|
55
|
+
parsed = JSON.parse(raw);
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
throw new Error(`CompanyIntegration '${label}'.Configuration is not valid JSON.`);
|
|
59
|
+
}
|
|
60
|
+
const id = parsed[BaseExternalDataSourceConnector.ExternalDataSourceIDKey] ?? parsed['ExternalDataSourceID'];
|
|
61
|
+
if (typeof id !== 'string' || id.trim().length === 0) {
|
|
62
|
+
throw new Error(`CompanyIntegration '${label}'.Configuration.${BaseExternalDataSourceConnector.ExternalDataSourceIDKey} ` +
|
|
63
|
+
`is required (the shared MJ: External Data Sources row ID).`);
|
|
64
|
+
}
|
|
65
|
+
return id.trim();
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Resolves the shared EDS data-source to its live driver via the EDS router (reusing the engine's
|
|
69
|
+
* pooling, credential resolution, and auth self-heal). Returns the data source row, its type, and driver.
|
|
70
|
+
*/
|
|
71
|
+
async Resolve(companyIntegration, contextUser) {
|
|
72
|
+
const id = this.ReadExternalDataSourceID(companyIntegration);
|
|
73
|
+
// NOTE (multi-provider): the connector method signature carries no provider, so this uses the
|
|
74
|
+
// process-default provider (the common server case). A future refinement can thread the request
|
|
75
|
+
// provider through when the integration engine begins passing it to connectors.
|
|
76
|
+
return ExternalDataSourceRouter.Instance.Resolve(id, contextUser);
|
|
77
|
+
}
|
|
78
|
+
// ─── Connectivity ────────────────────────────────────────────────────────────
|
|
79
|
+
async TestConnection(companyIntegration, contextUser) {
|
|
80
|
+
try {
|
|
81
|
+
const { dataSource, driver } = await this.Resolve(companyIntegration, contextUser);
|
|
82
|
+
const result = await driver.TestConnection(dataSource, contextUser);
|
|
83
|
+
return { Success: result.success, Message: result.message };
|
|
84
|
+
}
|
|
85
|
+
catch (err) {
|
|
86
|
+
return { Success: false, Message: `Connection failed: ${err instanceof Error ? err.message : String(err)}` };
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
// ─── Schema introspection (delegate to EDS, map the descriptor) ───────────────
|
|
90
|
+
/**
|
|
91
|
+
* Introspects the shared EDS source and maps its `ExternalSchemaDescriptor` (native types, PK,
|
|
92
|
+
* nullability, composite FKs) into the framework's `SourceSchemaInfo` in ONE round-trip.
|
|
93
|
+
*/
|
|
94
|
+
async IntrospectSchema(companyIntegration, contextUser, options) {
|
|
95
|
+
const { dataSource, driver } = await this.Resolve(companyIntegration, contextUser);
|
|
96
|
+
const descriptor = await driver.IntrospectSchema(dataSource, dataSource.DefaultSchema ?? undefined, contextUser);
|
|
97
|
+
const wanted = options?.ObjectNames && options.ObjectNames.length > 0
|
|
98
|
+
? new Set(options.ObjectNames.map(n => n.toLowerCase()))
|
|
99
|
+
: null;
|
|
100
|
+
const objects = wanted
|
|
101
|
+
? descriptor.Objects.filter(o => wanted.has(o.Name.toLowerCase()))
|
|
102
|
+
: descriptor.Objects;
|
|
103
|
+
return {
|
|
104
|
+
Objects: objects.map(o => this.MapObjectToSourceObject(o)),
|
|
105
|
+
// A scoped introspection is never authoritative over the whole surface (mirrors the base rule).
|
|
106
|
+
IsAuthoritative: this.DiscoveryIsAuthoritative && !wanted,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
async DiscoverObjects(companyIntegration, contextUser) {
|
|
110
|
+
const { dataSource, driver } = await this.Resolve(companyIntegration, contextUser);
|
|
111
|
+
const descriptor = await driver.IntrospectSchema(dataSource, dataSource.DefaultSchema ?? undefined, contextUser);
|
|
112
|
+
return descriptor.Objects.map(o => ({
|
|
113
|
+
Name: o.Name,
|
|
114
|
+
Label: o.Name,
|
|
115
|
+
SupportsIncrementalSync: this.DetectWatermarkField(o) !== undefined,
|
|
116
|
+
// EDS is read-only today (SupportsReadWrite defaults off); ingestion is Pull-only for now.
|
|
117
|
+
SupportsWrite: false,
|
|
118
|
+
}));
|
|
119
|
+
}
|
|
120
|
+
async DiscoverFields(companyIntegration, objectName, contextUser) {
|
|
121
|
+
const { dataSource, driver } = await this.Resolve(companyIntegration, contextUser);
|
|
122
|
+
const descriptor = await driver.IntrospectSchema(dataSource, dataSource.DefaultSchema ?? undefined, contextUser);
|
|
123
|
+
const obj = descriptor.Objects.find(o => o.Name.toLowerCase() === objectName.toLowerCase());
|
|
124
|
+
if (!obj) {
|
|
125
|
+
return [];
|
|
126
|
+
}
|
|
127
|
+
const fkByColumn = this.BuildForeignKeyMap(obj);
|
|
128
|
+
return obj.Columns.map(c => this.MapColumnToExternalField(c, fkByColumn));
|
|
129
|
+
}
|
|
130
|
+
// ─── Incremental delta ingestion (generic across all EDS drivers) ─────────────
|
|
131
|
+
async FetchChanges(ctx) {
|
|
132
|
+
const { dataSource, driver } = await this.Resolve(ctx.CompanyIntegration, ctx.ContextUser);
|
|
133
|
+
const meta = await this.ResolveObjectMeta(ctx);
|
|
134
|
+
// Order by watermark then PK (ascending) so the last row carries the max watermark and paging is
|
|
135
|
+
// deterministic. Raw identifiers — the EDS driver quotes them per its own dialect.
|
|
136
|
+
const orderColumns = [meta.WatermarkField, ...meta.PrimaryKeyFields].filter((c) => typeof c === 'string' && c.length > 0);
|
|
137
|
+
const offset = ctx.CurrentOffset ?? 0;
|
|
138
|
+
const result = await driver.RunView(dataSource, {
|
|
139
|
+
objectName: ctx.ObjectName,
|
|
140
|
+
// Structured incremental bound (>=) — the EDS driver renders the dialect predicate, quoting,
|
|
141
|
+
// and literal formatting itself, so this connector writes no SQL. Full fetch when unset.
|
|
142
|
+
incrementalSince: ctx.WatermarkValue && meta.WatermarkField
|
|
143
|
+
? { Field: meta.WatermarkField, Value: ctx.WatermarkValue }
|
|
144
|
+
: undefined,
|
|
145
|
+
defaultOrderByColumns: orderColumns.length ? orderColumns : undefined,
|
|
146
|
+
// Fetch one extra to detect HasMore without a separate COUNT.
|
|
147
|
+
maxRows: ctx.BatchSize + 1,
|
|
148
|
+
offset,
|
|
149
|
+
}, ctx.ContextUser);
|
|
150
|
+
if (!result.success) {
|
|
151
|
+
throw new Error(result.errorMessage ?? `RunView failed for object '${ctx.ObjectName}'`);
|
|
152
|
+
}
|
|
153
|
+
const hasMore = result.rows.length > ctx.BatchSize;
|
|
154
|
+
const rows = hasMore ? result.rows.slice(0, ctx.BatchSize) : result.rows;
|
|
155
|
+
return {
|
|
156
|
+
Records: rows.map(r => this.BuildRecord(r, ctx.ObjectName, meta.PrimaryKeyFields, meta.WatermarkField)),
|
|
157
|
+
HasMore: hasMore,
|
|
158
|
+
NextOffset: hasMore ? offset + ctx.BatchSize : undefined,
|
|
159
|
+
NewWatermarkValue: this.MaxWatermark(rows, meta.WatermarkField),
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
/** Resolve the object's watermark + PK columns from the persisted IntegrationObject/Field cache. */
|
|
163
|
+
async ResolveObjectMeta(ctx) {
|
|
164
|
+
const engine = IntegrationEngineBase.Instance;
|
|
165
|
+
await engine.Config(false, ctx.ContextUser);
|
|
166
|
+
const object = engine.GetIntegrationObject(ctx.CompanyIntegration.IntegrationID, ctx.ObjectName);
|
|
167
|
+
if (!object) {
|
|
168
|
+
return { PrimaryKeyFields: [] };
|
|
169
|
+
}
|
|
170
|
+
const primaryKeyFields = engine
|
|
171
|
+
.GetIntegrationObjectFields(object.ID)
|
|
172
|
+
.filter(f => f.IsPrimaryKey)
|
|
173
|
+
.map(f => f.Name);
|
|
174
|
+
return { WatermarkField: object.IncrementalWatermarkField ?? undefined, PrimaryKeyFields: primaryKeyFields };
|
|
175
|
+
}
|
|
176
|
+
// ─── Record assembly ──────────────────────────────────────────────────────────
|
|
177
|
+
/** Build an `ExternalRecord` from a source row — full-record pass-through in `Fields`. */
|
|
178
|
+
BuildRecord(row, objectName, primaryKeyFields, watermarkField) {
|
|
179
|
+
const watermarkRaw = watermarkField ? row[watermarkField] : undefined;
|
|
180
|
+
return {
|
|
181
|
+
ExternalID: primaryKeyFields.length
|
|
182
|
+
? primaryKeyFields.map(f => this.StringifyKeyPart(row[f])).join('|')
|
|
183
|
+
: this.ContentKey(row, watermarkField),
|
|
184
|
+
ObjectType: objectName,
|
|
185
|
+
// Full source record — never a hand-filtered subset (forward-compat custom-field capture).
|
|
186
|
+
Fields: { ...row },
|
|
187
|
+
ModifiedAt: this.CoerceDate(watermarkRaw),
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
/** Stable string for one primary-key component (Dates → ISO, null → empty). */
|
|
191
|
+
StringifyKeyPart(value) {
|
|
192
|
+
if (value == null) {
|
|
193
|
+
return '';
|
|
194
|
+
}
|
|
195
|
+
return value instanceof Date ? value.toISOString() : String(value);
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Deterministic content key for a genuinely PK-less row (rare); lets such tables still dedupe.
|
|
199
|
+
* Excludes `watermarkField` when given — the watermark column changes on every update by definition, so
|
|
200
|
+
* including it would mint a new `ExternalID` (and therefore a new inserted record) on every update to
|
|
201
|
+
* the same PK-less row instead of matching its prior identity.
|
|
202
|
+
*/
|
|
203
|
+
ContentKey(row, watermarkField) {
|
|
204
|
+
const excluded = watermarkField?.toLowerCase();
|
|
205
|
+
return Object.keys(row)
|
|
206
|
+
.filter(k => k.toLowerCase() !== excluded)
|
|
207
|
+
.sort()
|
|
208
|
+
.map(k => `${k}=${this.StringifyKeyPart(row[k])}`)
|
|
209
|
+
.join('|');
|
|
210
|
+
}
|
|
211
|
+
/** The batch's max watermark = the last row's watermark value (rows are watermark-ordered ascending). */
|
|
212
|
+
MaxWatermark(rows, watermarkField) {
|
|
213
|
+
if (!watermarkField || rows.length === 0) {
|
|
214
|
+
return undefined;
|
|
215
|
+
}
|
|
216
|
+
const last = rows[rows.length - 1][watermarkField];
|
|
217
|
+
if (last == null) {
|
|
218
|
+
return undefined;
|
|
219
|
+
}
|
|
220
|
+
return last instanceof Date ? last.toISOString() : String(last);
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Coerce a raw watermark value into a Date for `ExternalRecord.ModifiedAt` (undefined when unparseable).
|
|
224
|
+
* Delegates full ISO-8601 date-times to the shared {@link parseIso8601AsUtc} helper — the same one the
|
|
225
|
+
* EDS drivers use for incremental-watermark literal formatting and Mongo date coercion — so a ZONELESS
|
|
226
|
+
* ISO string is interpreted as UTC consistently everywhere, not via a locally-reimplemented regex. Falls
|
|
227
|
+
* back to `Date`'s own parsing for non-ISO shapes (e.g. a date-only string) that helper intentionally
|
|
228
|
+
* rejects. (In practice the driver returns `Date`s from `RunView`; this string path is the fallback.)
|
|
229
|
+
*/
|
|
230
|
+
CoerceDate(value) {
|
|
231
|
+
if (value instanceof Date) {
|
|
232
|
+
return value;
|
|
233
|
+
}
|
|
234
|
+
if (typeof value === 'string') {
|
|
235
|
+
const parsed = parseIso8601AsUtc(value);
|
|
236
|
+
if (parsed) {
|
|
237
|
+
return parsed;
|
|
238
|
+
}
|
|
239
|
+
const d = new Date(value);
|
|
240
|
+
return Number.isNaN(d.getTime()) ? undefined : d;
|
|
241
|
+
}
|
|
242
|
+
if (typeof value === 'number') {
|
|
243
|
+
const d = new Date(value);
|
|
244
|
+
return Number.isNaN(d.getTime()) ? undefined : d;
|
|
245
|
+
}
|
|
246
|
+
return undefined;
|
|
247
|
+
}
|
|
248
|
+
// ─── Descriptor → integration-metadata mapping ────────────────────────────────
|
|
249
|
+
/** Map one EDS object (table/view/collection) to the framework's `SourceObjectInfo`. */
|
|
250
|
+
MapObjectToSourceObject(obj) {
|
|
251
|
+
const fkByColumn = this.BuildForeignKeyMap(obj);
|
|
252
|
+
const relationships = (obj.Relationships ?? []).flatMap(rel => rel.Columns.map(pair => ({
|
|
253
|
+
FieldName: pair.Column,
|
|
254
|
+
TargetObject: rel.ReferencedObject,
|
|
255
|
+
TargetField: pair.ReferencedColumn,
|
|
256
|
+
})));
|
|
257
|
+
return {
|
|
258
|
+
ExternalName: obj.Name,
|
|
259
|
+
ExternalLabel: obj.Name,
|
|
260
|
+
Fields: obj.Columns.map(c => this.MapColumnToSourceField(c, fkByColumn)),
|
|
261
|
+
PrimaryKeyFields: obj.Columns.filter(c => c.IsPrimaryKey).map(c => c.Name),
|
|
262
|
+
Relationships: relationships,
|
|
263
|
+
IncrementalWatermarkField: this.DetectWatermarkField(obj),
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
/** Map one EDS column to a `SourceFieldInfo`. Length/precision are absent from the EDS descriptor today. */
|
|
267
|
+
MapColumnToSourceField(column, fkByColumn) {
|
|
268
|
+
const fk = fkByColumn.get(column.Name.toLowerCase());
|
|
269
|
+
return {
|
|
270
|
+
Name: column.Name,
|
|
271
|
+
Label: column.Name,
|
|
272
|
+
Description: column.Description,
|
|
273
|
+
SourceType: column.NativeType,
|
|
274
|
+
// A NOT-NULL source column is required-on-create AND non-null at rest.
|
|
275
|
+
IsRequired: !column.Nullable,
|
|
276
|
+
AllowsNull: column.Nullable,
|
|
277
|
+
// The EDS descriptor doesn't yet carry length/precision/scale/default — leave null (the schema
|
|
278
|
+
// builder sizes generously). A future EDS descriptor enhancement can surface these.
|
|
279
|
+
MaxLength: null,
|
|
280
|
+
Precision: null,
|
|
281
|
+
Scale: null,
|
|
282
|
+
DefaultValue: null,
|
|
283
|
+
IsPrimaryKey: column.IsPrimaryKey,
|
|
284
|
+
// EDS doesn't distinguish non-PK uniqueness — leave undefined (honest gap) rather than guess.
|
|
285
|
+
IsUniqueKey: undefined,
|
|
286
|
+
IsReadOnly: undefined,
|
|
287
|
+
IsForeignKey: fk !== undefined,
|
|
288
|
+
ForeignKeyTarget: fk?.Target ?? null,
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
/** Map one EDS column to the `ExternalFieldSchema` shape used by DiscoverFields. */
|
|
292
|
+
MapColumnToExternalField(column, fkByColumn) {
|
|
293
|
+
const fk = fkByColumn.get(column.Name.toLowerCase());
|
|
294
|
+
return {
|
|
295
|
+
Name: column.Name,
|
|
296
|
+
Label: column.Name,
|
|
297
|
+
Description: column.Description,
|
|
298
|
+
DataType: column.NativeType,
|
|
299
|
+
IsRequired: !column.Nullable,
|
|
300
|
+
AllowsNull: column.Nullable,
|
|
301
|
+
IsPrimaryKey: column.IsPrimaryKey,
|
|
302
|
+
IsUniqueKey: false,
|
|
303
|
+
IsReadOnly: false,
|
|
304
|
+
IsForeignKey: fk !== undefined,
|
|
305
|
+
ForeignKeyTarget: fk?.Target ?? null,
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
/** Build a column-name → FK-edge map from an object's referencing-side relationships. */
|
|
309
|
+
BuildForeignKeyMap(obj) {
|
|
310
|
+
const map = new Map();
|
|
311
|
+
for (const rel of obj.Relationships ?? []) {
|
|
312
|
+
for (const pair of rel.Columns) {
|
|
313
|
+
map.set(pair.Column.toLowerCase(), { Target: rel.ReferencedObject, TargetField: pair.ReferencedColumn });
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
return map;
|
|
317
|
+
}
|
|
318
|
+
// ─── Watermark detection (conservative, name-based default; operator-overridable) ─
|
|
319
|
+
/** Common "last-changed" column names, normalized (letters only) for a forgiving match. */
|
|
320
|
+
static { this.WatermarkNameHints = new Set([
|
|
321
|
+
'modifiedat', 'updatedat', 'lastmodified', 'lastupdated', 'modified', 'updated',
|
|
322
|
+
'datemodified', 'dateupdated', 'lastmodifieddate', 'lastupdateddate', 'changedate',
|
|
323
|
+
'mjupdatedat', 'rowlastupdated', 'lastchange', 'lastchanged',
|
|
324
|
+
]); }
|
|
325
|
+
/**
|
|
326
|
+
* Best-effort default watermark column, matched by NAME only (engine-neutral — never inferred from a
|
|
327
|
+
* native type, since e.g. Postgres `timestamp` is a plain datetime, not a rowversion). Only sets the
|
|
328
|
+
* DEFAULT `IncrementalWatermarkField`; an operator can override it on the persisted IntegrationObject.
|
|
329
|
+
* Returns undefined when no conventional column is present (that object then syncs full, not incremental).
|
|
330
|
+
*/
|
|
331
|
+
DetectWatermarkField(obj) {
|
|
332
|
+
const normalize = (name) => name.toLowerCase().replace(/[^a-z]/g, '');
|
|
333
|
+
const match = obj.Columns.find(c => BaseExternalDataSourceConnector.WatermarkNameHints.has(normalize(c.Name)));
|
|
334
|
+
return match?.Name;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
//# sourceMappingURL=BaseExternalDataSourceConnector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseExternalDataSourceConnector.js","sourceRoot":"","sources":["../../src/datasource/BaseExternalDataSour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,CAAC,WAAW,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,gBAAgB,EAAE,WAAW,EAAE,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC;YAC7G,CAAC;QACL,CAAC;QACD,OAAO,GAAG,CAAC;IACf,CAAC;IAED,qFAAqF;IAErF,2FAA2F;aACnE,uBAAkB,GAAG,IAAI,GAAG,CAAC;QACjD,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS;QAC/E,cAAc,EAAE,aAAa,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,YAAY;QAClF,aAAa,EAAE,gBAAgB,EAAE,YAAY,EAAE,aAAa;KAC/D,CAAC,CAAC;IAEH;;;;;OAKG;IACO,oBAAoB,CAAC,GAAyB;QACpD,MAAM,SAAS,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;QACtF,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,+BAA+B,CAAC,kBAAkB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC/G,OAAO,KAAK,EAAE,IAAI,CAAC;IACvB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BaseExternalDataSourceConnector } from './BaseExternalDataSourceConnector.js';
|
|
2
|
+
/**
|
|
3
|
+
* Relational (SQL) family of the EDS-consuming ingestion connector. Covers every SQL engine EDS drives
|
|
4
|
+
* (SQL Server, Postgres, MySQL, Oracle, Snowflake). The heart provides the entire ingestion flow
|
|
5
|
+
* (connect / introspect / incremental `FetchChanges`); the EDS driver renders all dialect SQL — identifier
|
|
6
|
+
* quoting, the watermark predicate, and literal formatting. So this family supplies only the one thing that
|
|
7
|
+
* is genuinely SQL-specific at the connector layer:
|
|
8
|
+
*
|
|
9
|
+
* - **Authoritative discovery** — SQL introspection reads `INFORMATION_SCHEMA` / catalog views, which
|
|
10
|
+
* enumerate the FULL column set, so an object/field absent from a refresh genuinely means the source
|
|
11
|
+
* dropped it and it may be deactivated (§7).
|
|
12
|
+
*
|
|
13
|
+
* Still abstract: a thin per-engine leaf (`SQLServerConnector`, `PostgresConnector`, …) registers it via
|
|
14
|
+
* `@RegisterClass` and names the connector — no logic.
|
|
15
|
+
*/
|
|
16
|
+
export declare abstract class BaseSqlExternalDataSourceConnector extends BaseExternalDataSourceConnector {
|
|
17
|
+
/** INFORMATION_SCHEMA / catalog introspection enumerates the full column set → safe to deactivate on absence. */
|
|
18
|
+
get DiscoveryIsAuthoritative(): boolean;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=BaseSqlExternalDataSourceConnector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseSqlExternalDataSourceConnector.d.ts","sourceRoot":"","sources":["../../src/datasource/BaseSqlExternalDataSourceConnector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AAEvF;;;;;;;;;;;;;GAaG;AACH,8BAAsB,kCAAmC,SAAQ,+BAA+B;IAC5F,iHAAiH;IACjH,IAAoB,wBAAwB,IAAI,OAAO,CAEtD;CACJ"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseExternalDataSourceConnector } from './BaseExternalDataSourceConnector.js';
|
|
2
|
+
/**
|
|
3
|
+
* Relational (SQL) family of the EDS-consuming ingestion connector. Covers every SQL engine EDS drives
|
|
4
|
+
* (SQL Server, Postgres, MySQL, Oracle, Snowflake). The heart provides the entire ingestion flow
|
|
5
|
+
* (connect / introspect / incremental `FetchChanges`); the EDS driver renders all dialect SQL — identifier
|
|
6
|
+
* quoting, the watermark predicate, and literal formatting. So this family supplies only the one thing that
|
|
7
|
+
* is genuinely SQL-specific at the connector layer:
|
|
8
|
+
*
|
|
9
|
+
* - **Authoritative discovery** — SQL introspection reads `INFORMATION_SCHEMA` / catalog views, which
|
|
10
|
+
* enumerate the FULL column set, so an object/field absent from a refresh genuinely means the source
|
|
11
|
+
* dropped it and it may be deactivated (§7).
|
|
12
|
+
*
|
|
13
|
+
* Still abstract: a thin per-engine leaf (`SQLServerConnector`, `PostgresConnector`, …) registers it via
|
|
14
|
+
* `@RegisterClass` and names the connector — no logic.
|
|
15
|
+
*/
|
|
16
|
+
export class BaseSqlExternalDataSourceConnector extends BaseExternalDataSourceConnector {
|
|
17
|
+
/** INFORMATION_SCHEMA / catalog introspection enumerates the full column set → safe to deactivate on absence. */
|
|
18
|
+
get DiscoveryIsAuthoritative() {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=BaseSqlExternalDataSourceConnector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseSqlExternalDataSourceConnector.js","sourceRoot":"","sources":["../../src/datasource/BaseSqlExternalDataSourceConnector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AAEvF;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAgB,kCAAmC,SAAQ,+BAA+B;IAC5F,iHAAiH;IACjH,IAAoB,wBAAwB;QACxC,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export { RelationalDBConnector, type ConnectionConfig } from './RelationalDBConnector.js';
|
|
2
|
+
export { BaseExternalDataSourceConnector } from './datasource/BaseExternalDataSourceConnector.js';
|
|
3
|
+
export { BaseSqlExternalDataSourceConnector } from './datasource/BaseSqlExternalDataSourceConnector.js';
|
|
4
|
+
export { BaseDocumentDataSourceConnector } from './datasource/BaseDocumentDataSourceConnector.js';
|
|
2
5
|
export { HubSpotConnector } from './HubSpotConnector.js';
|
|
3
6
|
export { SalesforceConnector, type SalesforceConnectionConfig } from './SalesforceConnector.js';
|
|
4
7
|
export { FontevaConnector, LoadFontevaConnector } from './FontevaConnector.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAK1F,OAAO,EAAE,+BAA+B,EAAE,MAAM,iDAAiD,CAAC;AAClG,OAAO,EAAE,kCAAkC,EAAE,MAAM,oDAAoD,CAAC;AACxG,OAAO,EAAE,+BAA+B,EAAE,MAAM,iDAAiD,CAAC;AAClG,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,KAAK,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAChG,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,KAAK,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAChG,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,KAAK,gBAAgB,EAAE,KAAK,mBAAmB,EAAE,KAAK,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACjI,OAAO,EAAE,oBAAoB,EAAE,KAAK,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AACnG,OAAO,EAAE,mBAAmB,EAAE,KA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AC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,KAAK,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACrH,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,KAAK,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACrG,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,KAAK,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAC7G,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,KAAK,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AACzG,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AACjG,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
export { RelationalDBConnector } from './RelationalDBConnector.js';
|
|
2
|
+
// ── EDS-consuming ingestion connector ABSTRACTIONS (the "heart" — share the External Data Sources
|
|
3
|
+
// connection layer). The thin per-engine leaves (SQLServerConnector, PostgresConnector, …) ship as
|
|
4
|
+
// per-engine Open Apps in the MemberJunction/Integrations repo, each extending one of these. ──
|
|
5
|
+
export { BaseExternalDataSourceConnector } from './datasource/BaseExternalDataSourceConnector.js';
|
|
6
|
+
export { BaseSqlExternalDataSourceConnector } from './datasource/BaseSqlExternalDataSourceConnector.js';
|
|
7
|
+
export { BaseDocumentDataSourceConnector } from './datasource/BaseDocumentDataSourceConnector.js';
|
|
2
8
|
export { HubSpotConnector } from './HubSpotConnector.js';
|
|
3
9
|
export { SalesforceConnector } from './SalesforceConnector.js';
|
|
4
10
|
export { FontevaConnector, LoadFontevaConnector } from './FontevaConnector.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["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package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/integration-connectors",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.46.0",
|
|
5
5
|
"description": "MemberJunction Integration Connectors - HubSpot, Salesforce, YourMembership, and FileFeed connectors",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -14,11 +14,12 @@
|
|
|
14
14
|
"test:watch": "vitest"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@memberjunction/core": "5.
|
|
18
|
-
"@memberjunction/core-entities": "5.
|
|
19
|
-
"@memberjunction/
|
|
20
|
-
"@memberjunction/
|
|
21
|
-
"@memberjunction/integration-engine
|
|
17
|
+
"@memberjunction/core": "5.46.0",
|
|
18
|
+
"@memberjunction/core-entities": "5.46.0",
|
|
19
|
+
"@memberjunction/external-data-sources": "5.46.0",
|
|
20
|
+
"@memberjunction/global": "5.46.0",
|
|
21
|
+
"@memberjunction/integration-engine": "5.46.0",
|
|
22
|
+
"@memberjunction/integration-engine-base": "5.46.0",
|
|
22
23
|
"jsonwebtoken": "9.0.3",
|
|
23
24
|
"mssql": "^12.2.0",
|
|
24
25
|
"zod": "~3.24.4"
|