lakesync 0.1.3 → 0.1.5

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.
Files changed (61) hide show
  1. package/dist/adapter.d.ts +87 -9
  2. package/dist/adapter.js +8 -2
  3. package/dist/analyst.js +1 -1
  4. package/dist/{base-poller-Dfaj05py.d.ts → base-poller-CBvhdvcj.d.ts} +1 -1
  5. package/dist/catalogue.d.ts +1 -1
  6. package/dist/catalogue.js +2 -2
  7. package/dist/{chunk-265CMYJH.js → chunk-46CKACNC.js} +2 -2
  8. package/dist/{chunk-C7ECMNQ4.js → chunk-7UBS6MFH.js} +295 -1
  9. package/dist/chunk-7UBS6MFH.js.map +1 -0
  10. package/dist/{chunk-TIPMVLIG.js → chunk-B3QEUG6E.js} +2 -2
  11. package/dist/{chunk-E7ZDOJCP.js → chunk-L4ZL5JA7.js} +2 -2
  12. package/dist/{chunk-HAR3YPCY.js → chunk-PWGQ3PXE.js} +32 -9
  13. package/dist/chunk-PWGQ3PXE.js.map +1 -0
  14. package/dist/{chunk-SXQB6JT6.js → chunk-SZSGSTVZ.js} +4 -2
  15. package/dist/{chunk-SXQB6JT6.js.map → chunk-SZSGSTVZ.js.map} +1 -1
  16. package/dist/{chunk-L6LTCXJ4.js → chunk-TVLTXHW6.js} +4 -2
  17. package/dist/{chunk-L6LTCXJ4.js.map → chunk-TVLTXHW6.js.map} +1 -1
  18. package/dist/{chunk-NCMXLWEW.js → chunk-Z7FGLEQU.js} +337 -20
  19. package/dist/chunk-Z7FGLEQU.js.map +1 -0
  20. package/dist/client.d.ts +12 -4
  21. package/dist/client.js +48 -3
  22. package/dist/client.js.map +1 -1
  23. package/dist/compactor.d.ts +1 -1
  24. package/dist/compactor.js +3 -3
  25. package/dist/connector-jira.d.ts +2 -2
  26. package/dist/connector-jira.js +2 -2
  27. package/dist/connector-salesforce.d.ts +2 -2
  28. package/dist/connector-salesforce.js +2 -2
  29. package/dist/{coordinator-CSbsqp5C.d.ts → coordinator-DN8D8C7W.d.ts} +11 -1
  30. package/dist/{db-types-CPAPw8Ws.d.ts → db-types-B6_JKQWK.d.ts} +1 -1
  31. package/dist/{gateway-Cej8JUh9.d.ts → gateway-CvO7Xy3T.d.ts} +5 -3
  32. package/dist/gateway-server.d.ts +4 -4
  33. package/dist/gateway-server.js +14 -8
  34. package/dist/gateway-server.js.map +1 -1
  35. package/dist/gateway.d.ts +12 -7
  36. package/dist/gateway.js +7 -5
  37. package/dist/index.d.ts +6 -5
  38. package/dist/index.js +9 -1
  39. package/dist/parquet.d.ts +1 -1
  40. package/dist/parquet.js +2 -2
  41. package/dist/proto.d.ts +1 -1
  42. package/dist/proto.js +2 -2
  43. package/dist/react.d.ts +32 -3
  44. package/dist/react.js +54 -19
  45. package/dist/react.js.map +1 -1
  46. package/dist/registry-BN_9spxE.d.ts +53 -0
  47. package/dist/{resolver-B10tk8Er.d.ts → resolver-BZURzdlL.d.ts} +1 -1
  48. package/dist/{src-PPKRY5GD.js → src-RR7I76OL.js} +3 -3
  49. package/dist/{src-TLTET7JZ.js → src-SLVE5567.js} +10 -2
  50. package/dist/{src-VVCNNYND.js → src-V2CTPR7V.js} +3 -3
  51. package/dist/{types-BUzzVRD6.d.ts → types-GGBfZBKQ.d.ts} +3 -0
  52. package/package.json +1 -1
  53. package/dist/chunk-C7ECMNQ4.js.map +0 -1
  54. package/dist/chunk-HAR3YPCY.js.map +0 -1
  55. package/dist/chunk-NCMXLWEW.js.map +0 -1
  56. /package/dist/{chunk-265CMYJH.js.map → chunk-46CKACNC.js.map} +0 -0
  57. /package/dist/{chunk-TIPMVLIG.js.map → chunk-B3QEUG6E.js.map} +0 -0
  58. /package/dist/{chunk-E7ZDOJCP.js.map → chunk-L4ZL5JA7.js.map} +0 -0
  59. /package/dist/{src-PPKRY5GD.js.map → src-RR7I76OL.js.map} +0 -0
  60. /package/dist/{src-TLTET7JZ.js.map → src-SLVE5567.js.map} +0 -0
  61. /package/dist/{src-VVCNNYND.js.map → src-V2CTPR7V.js.map} +0 -0
package/dist/adapter.d.ts CHANGED
@@ -1,13 +1,62 @@
1
1
  import { BigQuery } from '@google-cloud/bigquery';
2
2
  import { R as Result, A as AdapterError, H as HLCTimestamp } from './result-CojzlFE2.js';
3
- import { R as RowDelta, T as TableSchema, C as ColumnDelta } from './types-BUzzVRD6.js';
4
- import { D as DatabaseAdapter, a as DatabaseAdapterConfig } from './db-types-CPAPw8Ws.js';
5
- export { i as isDatabaseAdapter, l as lakeSyncTypeToBigQuery } from './db-types-CPAPw8Ws.js';
3
+ import { R as RowDelta, T as TableSchema, C as ColumnDelta } from './types-GGBfZBKQ.js';
4
+ import { D as DatabaseAdapter, a as DatabaseAdapterConfig } from './db-types-B6_JKQWK.js';
5
+ export { i as isDatabaseAdapter, l as lakeSyncTypeToBigQuery } from './db-types-B6_JKQWK.js';
6
6
  import { C as ConnectorConfig } from './types-D-E0VrfS.js';
7
7
  import { L as LakeAdapter, A as AdapterConfig, O as ObjectInfo } from './types-DSC_EiwR.js';
8
8
  import mysql from 'mysql2/promise';
9
9
  import { Pool } from 'pg';
10
10
 
11
+ /**
12
+ * Opt-in capability for adapters that can materialise deltas into destination tables.
13
+ *
14
+ * Materialisation is a separate concern from delta storage — adapters that store
15
+ * deltas (via `DatabaseAdapter.insertDeltas`) may also materialise them into
16
+ * queryable destination tables by implementing this interface.
17
+ *
18
+ * Destination tables follow the hybrid column model:
19
+ * - Synced columns (written by materialiser, derived from `TableSchema.columns`)
20
+ * - `props JSONB DEFAULT '{}'` — consumer-extensible, never touched by materialiser
21
+ * - `synced_at` — updated on every materialise cycle
22
+ */
23
+ interface Materialisable {
24
+ /**
25
+ * Materialise deltas into destination tables.
26
+ *
27
+ * For each table with a matching schema, merges delta history into the
28
+ * latest row state and upserts into the destination table. Tombstoned
29
+ * rows are deleted. The `props` column is never touched.
30
+ *
31
+ * @param deltas - The deltas that were just flushed.
32
+ * @param schemas - Table schemas defining destination tables and column mappings.
33
+ */
34
+ materialise(deltas: RowDelta[], schemas: ReadonlyArray<TableSchema>): Promise<Result<void, AdapterError>>;
35
+ }
36
+ /**
37
+ * Type guard to check if an adapter supports materialisation.
38
+ *
39
+ * Uses duck-typing (same pattern as `isDatabaseAdapter`).
40
+ */
41
+ declare function isMaterialisable(adapter: unknown): adapter is Materialisable;
42
+ /**
43
+ * Group deltas by their table name, collecting the set of affected row IDs per table.
44
+ *
45
+ * @param deltas - The deltas to group.
46
+ * @returns A map from table name to the set of affected row IDs.
47
+ */
48
+ declare function groupDeltasByTable(deltas: ReadonlyArray<RowDelta>): Map<string, Set<string>>;
49
+ /**
50
+ * Build an index from source table name to schema.
51
+ *
52
+ * Keys are `schema.sourceTable ?? schema.table`, so deltas can be matched
53
+ * by their `table` field to find the correct destination schema.
54
+ *
55
+ * @param schemas - The table schemas to index.
56
+ * @returns A map from source table name to schema.
57
+ */
58
+ declare function buildSchemaIndex(schemas: ReadonlyArray<TableSchema>): Map<string, TableSchema>;
59
+
11
60
  /**
12
61
  * Configuration for the BigQuery adapter.
13
62
  * Unlike SQL adapters, BigQuery is HTTP-based — no connection string needed.
@@ -33,7 +82,7 @@ interface BigQueryAdapterConfig {
33
82
  * on standard (non-partitioned) tables. Query latency is seconds, not
34
83
  * milliseconds — this adapter is designed for the analytics tier.
35
84
  */
36
- declare class BigQueryAdapter implements DatabaseAdapter {
85
+ declare class BigQueryAdapter implements DatabaseAdapter, Materialisable {
37
86
  /** @internal */
38
87
  readonly client: BigQuery;
39
88
  /** @internal */
@@ -61,6 +110,15 @@ declare class BigQueryAdapter implements DatabaseAdapter {
61
110
  * internal table structure is fixed (deltas store column data as JSON).
62
111
  */
63
112
  ensureSchema(_schema: TableSchema): Promise<Result<void, AdapterError>>;
113
+ /**
114
+ * Materialise deltas into destination tables.
115
+ *
116
+ * For each affected table, queries the full delta history for touched rows,
117
+ * merges to latest state via column-level LWW, then upserts live rows and
118
+ * deletes tombstoned rows. The consumer-owned `props` column is never
119
+ * touched on UPDATE.
120
+ */
121
+ materialise(deltas: RowDelta[], schemas: ReadonlyArray<TableSchema>): Promise<Result<void, AdapterError>>;
64
122
  /**
65
123
  * No-op — BigQuery client is HTTP-based with no persistent connections.
66
124
  */
@@ -128,7 +186,7 @@ interface FanOutAdapterConfig {
128
186
  * Secondary failures are silently caught and never affect the return value.
129
187
  * Use case: write to Postgres (fast, operational), replicate to BigQuery (analytics).
130
188
  */
131
- declare class FanOutAdapter implements DatabaseAdapter {
189
+ declare class FanOutAdapter implements DatabaseAdapter, Materialisable {
132
190
  private readonly primary;
133
191
  private readonly secondaries;
134
192
  constructor(config: FanOutAdapterConfig);
@@ -140,6 +198,8 @@ declare class FanOutAdapter implements DatabaseAdapter {
140
198
  getLatestState(table: string, rowId: string): Promise<Result<Record<string, unknown> | null, AdapterError>>;
141
199
  /** Ensure schema on the primary first, then best-effort on secondaries. */
142
200
  ensureSchema(schema: TableSchema): Promise<Result<void, AdapterError>>;
201
+ /** Materialise via primary, then replicate to materialisable secondaries (fire-and-forget). */
202
+ materialise(deltas: RowDelta[], schemas: ReadonlyArray<TableSchema>): Promise<Result<void, AdapterError>>;
143
203
  /** Close primary and all secondary adapters. */
144
204
  close(): Promise<void>;
145
205
  }
@@ -168,7 +228,7 @@ interface LifecycleAdapterConfig {
168
228
  * Use {@link migrateToTier} as a background job to copy aged-out deltas
169
229
  * from hot to cold.
170
230
  */
171
- declare class LifecycleAdapter implements DatabaseAdapter {
231
+ declare class LifecycleAdapter implements DatabaseAdapter, Materialisable {
172
232
  private readonly hot;
173
233
  private readonly cold;
174
234
  private readonly maxAgeMs;
@@ -186,6 +246,8 @@ declare class LifecycleAdapter implements DatabaseAdapter {
186
246
  getLatestState(table: string, rowId: string): Promise<Result<Record<string, unknown> | null, AdapterError>>;
187
247
  /** Ensure schema exists on both hot and cold adapters. */
188
248
  ensureSchema(schema: TableSchema): Promise<Result<void, AdapterError>>;
249
+ /** Materialise via hot tier only — cold tier stores archived deltas, not destination tables. */
250
+ materialise(deltas: RowDelta[], schemas: ReadonlyArray<TableSchema>): Promise<Result<void, AdapterError>>;
189
251
  /** Close both hot and cold adapters. */
190
252
  close(): Promise<void>;
191
253
  }
@@ -276,7 +338,7 @@ declare class MinIOAdapter implements LakeAdapter {
276
338
  * idempotent writes. All public methods return `Result` and never throw.
277
339
  * Uses mysql2/promise connection pool for async operations.
278
340
  */
279
- declare class MySQLAdapter implements DatabaseAdapter {
341
+ declare class MySQLAdapter implements DatabaseAdapter, Materialisable {
280
342
  /** @internal */
281
343
  readonly pool: mysql.Pool;
282
344
  constructor(config: DatabaseAdapterConfig);
@@ -300,6 +362,14 @@ declare class MySQLAdapter implements DatabaseAdapter {
300
362
  * and a user table matching the given TableSchema definition.
301
363
  */
302
364
  ensureSchema(schema: TableSchema): Promise<Result<void, AdapterError>>;
365
+ /**
366
+ * Materialise deltas into destination tables.
367
+ *
368
+ * For each table with a matching schema, merges delta history into the
369
+ * latest row state and upserts into the destination table. Tombstoned
370
+ * rows are deleted. The `props` column is never touched.
371
+ */
372
+ materialise(deltas: RowDelta[], schemas: ReadonlyArray<TableSchema>): Promise<Result<void, AdapterError>>;
303
373
  /** Close the database connection pool and release resources. */
304
374
  close(): Promise<void>;
305
375
  }
@@ -310,7 +380,7 @@ declare class MySQLAdapter implements DatabaseAdapter {
310
380
  * Stores deltas in a `lakesync_deltas` table using pg Pool.
311
381
  * All public methods return `Result` and never throw.
312
382
  */
313
- declare class PostgresAdapter implements DatabaseAdapter {
383
+ declare class PostgresAdapter implements DatabaseAdapter, Materialisable {
314
384
  /** @internal */
315
385
  readonly pool: Pool;
316
386
  constructor(config: DatabaseAdapterConfig);
@@ -334,6 +404,14 @@ declare class PostgresAdapter implements DatabaseAdapter {
334
404
  * internal table structure is fixed (deltas store column data as JSONB).
335
405
  */
336
406
  ensureSchema(_schema: TableSchema): Promise<Result<void, AdapterError>>;
407
+ /**
408
+ * Materialise deltas into destination tables.
409
+ *
410
+ * For each table with a matching schema, merges delta history into the
411
+ * latest row state and upserts into the destination table. Tombstoned
412
+ * rows are deleted. The `props` column is never touched.
413
+ */
414
+ materialise(deltas: RowDelta[], schemas: ReadonlyArray<TableSchema>): Promise<Result<void, AdapterError>>;
337
415
  /** Close the database connection pool and release resources. */
338
416
  close(): Promise<void>;
339
417
  }
@@ -366,4 +444,4 @@ declare function mergeLatestState(rows: Array<{
366
444
  op: string;
367
445
  }>): Record<string, unknown> | null;
368
446
 
369
- export { AdapterConfig, BigQueryAdapter, type BigQueryAdapterConfig, CompositeAdapter, type CompositeAdapterConfig, type CompositeRoute, DatabaseAdapter, DatabaseAdapterConfig, FanOutAdapter, type FanOutAdapterConfig, LakeAdapter, LifecycleAdapter, type LifecycleAdapterConfig, type MigrateOptions, type MigrateProgress, type MigrateResult, MinIOAdapter, MySQLAdapter, ObjectInfo, PostgresAdapter, type QueryFn, createDatabaseAdapter, createQueryFn, mergeLatestState, migrateAdapter, migrateToTier, toCause, wrapAsync };
447
+ export { AdapterConfig, BigQueryAdapter, type BigQueryAdapterConfig, CompositeAdapter, type CompositeAdapterConfig, type CompositeRoute, DatabaseAdapter, DatabaseAdapterConfig, FanOutAdapter, type FanOutAdapterConfig, LakeAdapter, LifecycleAdapter, type LifecycleAdapterConfig, type Materialisable, type MigrateOptions, type MigrateProgress, type MigrateResult, MinIOAdapter, MySQLAdapter, ObjectInfo, PostgresAdapter, type QueryFn, buildSchemaIndex, createDatabaseAdapter, createQueryFn, groupDeltasByTable, isMaterialisable, mergeLatestState, migrateAdapter, migrateToTier, toCause, wrapAsync };
package/dist/adapter.js CHANGED
@@ -6,17 +6,20 @@ import {
6
6
  MinIOAdapter,
7
7
  MySQLAdapter,
8
8
  PostgresAdapter,
9
+ buildSchemaIndex,
9
10
  createDatabaseAdapter,
10
11
  createQueryFn,
12
+ groupDeltasByTable,
11
13
  isDatabaseAdapter,
14
+ isMaterialisable,
12
15
  lakeSyncTypeToBigQuery,
13
16
  mergeLatestState,
14
17
  migrateAdapter,
15
18
  migrateToTier,
16
19
  toCause,
17
20
  wrapAsync
18
- } from "./chunk-NCMXLWEW.js";
19
- import "./chunk-C7ECMNQ4.js";
21
+ } from "./chunk-Z7FGLEQU.js";
22
+ import "./chunk-7UBS6MFH.js";
20
23
  import "./chunk-7D4SUZUM.js";
21
24
  export {
22
25
  BigQueryAdapter,
@@ -26,9 +29,12 @@ export {
26
29
  MinIOAdapter,
27
30
  MySQLAdapter,
28
31
  PostgresAdapter,
32
+ buildSchemaIndex,
29
33
  createDatabaseAdapter,
30
34
  createQueryFn,
35
+ groupDeltasByTable,
31
36
  isDatabaseAdapter,
37
+ isMaterialisable,
32
38
  lakeSyncTypeToBigQuery,
33
39
  mergeLatestState,
34
40
  migrateAdapter,
package/dist/analyst.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  Err,
3
3
  LakeSyncError,
4
4
  Ok
5
- } from "./chunk-C7ECMNQ4.js";
5
+ } from "./chunk-7UBS6MFH.js";
6
6
  import "./chunk-7D4SUZUM.js";
7
7
 
8
8
  // ../analyst/src/duckdb.ts
@@ -1,4 +1,4 @@
1
- import { S as SyncPush, R as RowDelta } from './types-BUzzVRD6.js';
1
+ import { S as SyncPush, R as RowDelta } from './types-GGBfZBKQ.js';
2
2
  import { H as HLC } from './hlc-DiD8QNG3.js';
3
3
  import { R as Result, F as FlushError } from './result-CojzlFE2.js';
4
4
 
@@ -1,6 +1,6 @@
1
1
  import { I as IcebergSchema, P as PartitionSpec } from './nessie-client-DrNikVXy.js';
2
2
  export { C as CatalogueConfig, a as CatalogueError, D as DataFile, b as IcebergField, N as NessieCatalogueClient, S as Snapshot, T as TableMetadata } from './nessie-client-DrNikVXy.js';
3
- import { T as TableSchema } from './types-BUzzVRD6.js';
3
+ import { T as TableSchema } from './types-GGBfZBKQ.js';
4
4
  import './result-CojzlFE2.js';
5
5
 
6
6
  /**
package/dist/catalogue.js CHANGED
@@ -4,8 +4,8 @@ import {
4
4
  buildPartitionSpec,
5
5
  lakeSyncTableName,
6
6
  tableSchemaToIceberg
7
- } from "./chunk-TIPMVLIG.js";
8
- import "./chunk-C7ECMNQ4.js";
7
+ } from "./chunk-B3QEUG6E.js";
8
+ import "./chunk-7UBS6MFH.js";
9
9
  import "./chunk-7D4SUZUM.js";
10
10
  export {
11
11
  CatalogueError,
@@ -2,7 +2,7 @@ import {
2
2
  Err,
3
3
  FlushError,
4
4
  Ok
5
- } from "./chunk-C7ECMNQ4.js";
5
+ } from "./chunk-7UBS6MFH.js";
6
6
 
7
7
  // ../parquet/src/arrow-schema.ts
8
8
  import * as arrow from "apache-arrow";
@@ -254,4 +254,4 @@ export {
254
254
  readParquetToDeltas,
255
255
  writeDeltasToParquet
256
256
  };
257
- //# sourceMappingURL=chunk-265CMYJH.js.map
257
+ //# sourceMappingURL=chunk-46CKACNC.js.map
@@ -620,6 +620,23 @@ var ConnectorValidationError = class extends LakeSyncError {
620
620
  }
621
621
  };
622
622
 
623
+ // ../core/src/connector/registry.ts
624
+ var descriptors = /* @__PURE__ */ new Map();
625
+ function registerConnectorDescriptor(descriptor) {
626
+ descriptors.set(descriptor.type, descriptor);
627
+ }
628
+ function registerOutputSchemas(type, schemas) {
629
+ const existing = descriptors.get(type);
630
+ if (!existing) return;
631
+ descriptors.set(type, { ...existing, outputTables: schemas });
632
+ }
633
+ function getConnectorDescriptor(type) {
634
+ return descriptors.get(type);
635
+ }
636
+ function listConnectorDescriptors() {
637
+ return [...descriptors.values()].sort((a, b) => a.type.localeCompare(b.type));
638
+ }
639
+
623
640
  // ../core/src/connector/types.ts
624
641
  var CONNECTOR_TYPES = ["postgres", "mysql", "bigquery", "jira", "salesforce"];
625
642
 
@@ -814,6 +831,279 @@ function validateConnectorConfig(input) {
814
831
  return Ok(input);
815
832
  }
816
833
 
834
+ // ../core/src/connector/schemas/bigquery.ts
835
+ var BIGQUERY_CONFIG_SCHEMA = {
836
+ $schema: "http://json-schema.org/draft-07/schema#",
837
+ type: "object",
838
+ properties: {
839
+ projectId: {
840
+ type: "string",
841
+ description: "GCP project ID."
842
+ },
843
+ dataset: {
844
+ type: "string",
845
+ description: "BigQuery dataset name."
846
+ },
847
+ keyFilename: {
848
+ type: "string",
849
+ description: "Path to service account JSON key file. Falls back to ADC when omitted."
850
+ },
851
+ location: {
852
+ type: "string",
853
+ description: 'Dataset location (default "US").'
854
+ }
855
+ },
856
+ required: ["projectId", "dataset"],
857
+ additionalProperties: false
858
+ };
859
+
860
+ // ../core/src/connector/schemas/ingest.ts
861
+ var DATABASE_INGEST_SCHEMA = {
862
+ $schema: "http://json-schema.org/draft-07/schema#",
863
+ type: "object",
864
+ properties: {
865
+ tables: {
866
+ type: "array",
867
+ description: "Tables to poll for changes.",
868
+ items: {
869
+ type: "object",
870
+ properties: {
871
+ table: { type: "string", description: "Target table name in LakeSync." },
872
+ query: {
873
+ type: "string",
874
+ description: "SQL query to poll (must return rowId + data columns)."
875
+ },
876
+ rowIdColumn: {
877
+ type: "string",
878
+ description: 'Primary key column name (default "id").'
879
+ },
880
+ strategy: {
881
+ oneOf: [
882
+ {
883
+ type: "object",
884
+ properties: {
885
+ type: { const: "cursor" },
886
+ cursorColumn: { type: "string" },
887
+ lookbackMs: { type: "number" }
888
+ },
889
+ required: ["type", "cursorColumn"]
890
+ },
891
+ {
892
+ type: "object",
893
+ properties: {
894
+ type: { const: "diff" }
895
+ },
896
+ required: ["type"]
897
+ }
898
+ ]
899
+ }
900
+ },
901
+ required: ["table", "query", "strategy"]
902
+ }
903
+ },
904
+ intervalMs: {
905
+ type: "number",
906
+ description: "Poll interval in milliseconds (default 10 000)."
907
+ },
908
+ chunkSize: {
909
+ type: "number",
910
+ description: "Deltas per push chunk (default 500)."
911
+ },
912
+ memoryBudgetBytes: {
913
+ type: "number",
914
+ description: "Approximate memory budget in bytes \u2014 triggers flush at 70%."
915
+ }
916
+ },
917
+ required: ["tables"],
918
+ additionalProperties: false
919
+ };
920
+ var API_INGEST_SCHEMA = {
921
+ $schema: "http://json-schema.org/draft-07/schema#",
922
+ type: "object",
923
+ properties: {
924
+ intervalMs: {
925
+ type: "number",
926
+ description: "Poll interval in milliseconds (default 10 000)."
927
+ },
928
+ chunkSize: {
929
+ type: "number",
930
+ description: "Deltas per push chunk (default 500)."
931
+ },
932
+ memoryBudgetBytes: {
933
+ type: "number",
934
+ description: "Approximate memory budget in bytes \u2014 triggers flush at 70%."
935
+ }
936
+ },
937
+ additionalProperties: false
938
+ };
939
+
940
+ // ../core/src/connector/schemas/jira.ts
941
+ var JIRA_CONFIG_SCHEMA = {
942
+ $schema: "http://json-schema.org/draft-07/schema#",
943
+ type: "object",
944
+ properties: {
945
+ domain: {
946
+ type: "string",
947
+ description: "Jira Cloud domain (e.g. mycompany for mycompany.atlassian.net)."
948
+ },
949
+ email: {
950
+ type: "string",
951
+ description: "Email address for Basic auth."
952
+ },
953
+ apiToken: {
954
+ type: "string",
955
+ description: "API token paired with the email."
956
+ },
957
+ jql: {
958
+ type: "string",
959
+ description: "Optional JQL filter to scope issue polling."
960
+ },
961
+ includeComments: {
962
+ type: "boolean",
963
+ description: "Whether to include comments (default true)."
964
+ },
965
+ includeProjects: {
966
+ type: "boolean",
967
+ description: "Whether to include projects (default true)."
968
+ }
969
+ },
970
+ required: ["domain", "email", "apiToken"],
971
+ additionalProperties: false
972
+ };
973
+
974
+ // ../core/src/connector/schemas/mysql.ts
975
+ var MYSQL_CONFIG_SCHEMA = {
976
+ $schema: "http://json-schema.org/draft-07/schema#",
977
+ type: "object",
978
+ properties: {
979
+ connectionString: {
980
+ type: "string",
981
+ description: "MySQL connection string (e.g. mysql://user:pass@host/db)."
982
+ }
983
+ },
984
+ required: ["connectionString"],
985
+ additionalProperties: false
986
+ };
987
+
988
+ // ../core/src/connector/schemas/postgres.ts
989
+ var POSTGRES_CONFIG_SCHEMA = {
990
+ $schema: "http://json-schema.org/draft-07/schema#",
991
+ type: "object",
992
+ properties: {
993
+ connectionString: {
994
+ type: "string",
995
+ description: "PostgreSQL connection string (e.g. postgres://user:pass@host/db)."
996
+ }
997
+ },
998
+ required: ["connectionString"],
999
+ additionalProperties: false
1000
+ };
1001
+
1002
+ // ../core/src/connector/schemas/salesforce.ts
1003
+ var SALESFORCE_CONFIG_SCHEMA = {
1004
+ $schema: "http://json-schema.org/draft-07/schema#",
1005
+ type: "object",
1006
+ properties: {
1007
+ instanceUrl: {
1008
+ type: "string",
1009
+ description: "Salesforce instance URL (e.g. https://mycompany.salesforce.com)."
1010
+ },
1011
+ clientId: {
1012
+ type: "string",
1013
+ description: "Connected App consumer key."
1014
+ },
1015
+ clientSecret: {
1016
+ type: "string",
1017
+ description: "Connected App consumer secret."
1018
+ },
1019
+ username: {
1020
+ type: "string",
1021
+ description: "Salesforce username."
1022
+ },
1023
+ password: {
1024
+ type: "string",
1025
+ description: "Salesforce password + security token concatenated."
1026
+ },
1027
+ apiVersion: {
1028
+ type: "string",
1029
+ description: 'REST API version (default "v62.0").'
1030
+ },
1031
+ isSandbox: {
1032
+ type: "boolean",
1033
+ description: "Use test.salesforce.com for auth (default false)."
1034
+ },
1035
+ soqlFilter: {
1036
+ type: "string",
1037
+ description: "Optional WHERE clause fragment appended to all SOQL queries."
1038
+ },
1039
+ includeAccounts: {
1040
+ type: "boolean",
1041
+ description: "Whether to include Account objects (default true)."
1042
+ },
1043
+ includeContacts: {
1044
+ type: "boolean",
1045
+ description: "Whether to include Contact objects (default true)."
1046
+ },
1047
+ includeOpportunities: {
1048
+ type: "boolean",
1049
+ description: "Whether to include Opportunity objects (default true)."
1050
+ },
1051
+ includeLeads: {
1052
+ type: "boolean",
1053
+ description: "Whether to include Lead objects (default true)."
1054
+ }
1055
+ },
1056
+ required: ["instanceUrl", "clientId", "clientSecret", "username", "password"],
1057
+ additionalProperties: false
1058
+ };
1059
+
1060
+ // ../core/src/connector/register-builtin.ts
1061
+ registerConnectorDescriptor({
1062
+ type: "bigquery",
1063
+ displayName: "BigQuery",
1064
+ description: "Google BigQuery data warehouse connector.",
1065
+ category: "database",
1066
+ configSchema: BIGQUERY_CONFIG_SCHEMA,
1067
+ ingestSchema: DATABASE_INGEST_SCHEMA,
1068
+ outputTables: null
1069
+ });
1070
+ registerConnectorDescriptor({
1071
+ type: "jira",
1072
+ displayName: "Jira",
1073
+ description: "Atlassian Jira Cloud issue tracker connector.",
1074
+ category: "api",
1075
+ configSchema: JIRA_CONFIG_SCHEMA,
1076
+ ingestSchema: API_INGEST_SCHEMA,
1077
+ outputTables: null
1078
+ });
1079
+ registerConnectorDescriptor({
1080
+ type: "mysql",
1081
+ displayName: "MySQL",
1082
+ description: "MySQL relational database connector.",
1083
+ category: "database",
1084
+ configSchema: MYSQL_CONFIG_SCHEMA,
1085
+ ingestSchema: DATABASE_INGEST_SCHEMA,
1086
+ outputTables: null
1087
+ });
1088
+ registerConnectorDescriptor({
1089
+ type: "postgres",
1090
+ displayName: "PostgreSQL",
1091
+ description: "PostgreSQL relational database connector.",
1092
+ category: "database",
1093
+ configSchema: POSTGRES_CONFIG_SCHEMA,
1094
+ ingestSchema: DATABASE_INGEST_SCHEMA,
1095
+ outputTables: null
1096
+ });
1097
+ registerConnectorDescriptor({
1098
+ type: "salesforce",
1099
+ displayName: "Salesforce",
1100
+ description: "Salesforce CRM connector for accounts, contacts, opportunities, and leads.",
1101
+ category: "api",
1102
+ configSchema: SALESFORCE_CONFIG_SCHEMA,
1103
+ ingestSchema: API_INGEST_SCHEMA,
1104
+ outputTables: null
1105
+ });
1106
+
817
1107
  // ../core/src/create-poller.ts
818
1108
  var pollerFactories = /* @__PURE__ */ new Map();
819
1109
  function registerPollerFactory(type, factory) {
@@ -1192,6 +1482,10 @@ export {
1192
1482
  resolveLWW,
1193
1483
  isActionHandler,
1194
1484
  ConnectorValidationError,
1485
+ registerConnectorDescriptor,
1486
+ registerOutputSchemas,
1487
+ getConnectorDescriptor,
1488
+ listConnectorDescriptors,
1195
1489
  CONNECTOR_TYPES,
1196
1490
  validateConnectorConfig,
1197
1491
  registerPollerFactory,
@@ -1213,4 +1507,4 @@ export {
1213
1507
  assertValidIdentifier,
1214
1508
  quoteIdentifier
1215
1509
  };
1216
- //# sourceMappingURL=chunk-C7ECMNQ4.js.map
1510
+ //# sourceMappingURL=chunk-7UBS6MFH.js.map