@useairfoil/connector-kit 0.5.3 → 0.6.1
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/METRICS.md +20 -19
- package/README.md +127 -430
- package/dist/annotations-BE74YmAO.d.mts +39 -0
- package/dist/auth/index.d.mts +2 -0
- package/dist/{auth-DvU_CZ7C.js → auth/index.mjs} +6 -8
- package/dist/auth/index.mjs.map +1 -0
- package/dist/connector-app/index.d.mts +2 -0
- package/dist/connector-app/index.mjs +2 -0
- package/dist/connector-app-C-L4QqG6.mjs +123 -0
- package/dist/connector-app-C-L4QqG6.mjs.map +1 -0
- package/dist/{constants-BRhIX_rz.js → constants-D-GQzpHZ.mjs} +10 -6
- package/dist/constants-D-GQzpHZ.mjs.map +1 -0
- package/dist/demo/index.d.mts +2 -0
- package/dist/demo/index.mjs +2 -0
- package/dist/demo-B30Vlkk2.mjs +191 -0
- package/dist/demo-B30Vlkk2.mjs.map +1 -0
- package/dist/errors/index.d.mts +2 -0
- package/dist/errors/index.mjs +2 -0
- package/dist/{errors-DHWylqRZ.js → errors-pT0YVJU5.mjs} +2 -3
- package/dist/errors-pT0YVJU5.mjs.map +1 -0
- package/dist/iceberg/index.d.mts +3 -0
- package/dist/iceberg/index.mjs +3 -0
- package/dist/iceberg-D6L8I6vA.mjs +39 -0
- package/dist/iceberg-D6L8I6vA.mjs.map +1 -0
- package/dist/{index-Cq2IzY7T.d.ts → index-BUHSGm9Q.d.mts} +11 -13
- package/dist/{index-CTHVudvQ.d.ts → index-BX8G7d41.d.mts} +1 -2
- package/dist/{index-J42AZaXU.d.ts → index-BfXpgxk9.d.mts} +9 -10
- package/dist/{index-DKWIh6M1.d.ts → index-CRVAwJ5-.d.mts} +10 -8
- package/dist/index-CUPP2A_m.d.mts +27 -0
- package/dist/{index-Coh_SkBs.d.ts → index-CgvFomO6.d.mts} +6 -7
- package/dist/index-DJhDp4Xc.d.mts +58 -0
- package/dist/index-Dk7urvpF.d.mts +76 -0
- package/dist/{index-D54ySAKn.d.ts → index-DkVNO6ks.d.mts} +2 -5
- package/dist/{index-DtJX_tic.d.ts → index-NnCutIqM.d.mts} +77 -38
- package/dist/{index-CBT-JX-T.d.ts → index-eFuoMZZ3.d.mts} +18 -20
- package/dist/index-ygpml2kC.d.mts +73 -0
- package/dist/index.d.mts +16 -0
- package/dist/index.mjs +45 -0
- package/dist/index.mjs.map +1 -0
- package/dist/ingestion/index.d.mts +2 -0
- package/dist/ingestion/index.mjs +2 -0
- package/dist/ingestion-q0WwqUSt.mjs +275 -0
- package/dist/ingestion-q0WwqUSt.mjs.map +1 -0
- package/dist/ingestor/index.d.mts +3 -0
- package/dist/ingestor/index.mjs +4 -0
- package/dist/ingestor-D4L-HPkg.mjs +26 -0
- package/dist/ingestor-D4L-HPkg.mjs.map +1 -0
- package/dist/instrumented-Bhp7fyvh.mjs +29 -0
- package/dist/instrumented-Bhp7fyvh.mjs.map +1 -0
- package/dist/manifest/index.d.mts +2 -0
- package/dist/manifest/{index.js → index.mjs} +2 -4
- package/dist/{manifest-ByE6YPG0.js → manifest-BGKxmKLy.mjs} +14 -19
- package/dist/manifest-BGKxmKLy.mjs.map +1 -0
- package/dist/metrics-BaEX__MN.mjs +352 -0
- package/dist/metrics-BaEX__MN.mjs.map +1 -0
- package/dist/metrics-CVXFL7YT.d.mts +64 -0
- package/dist/metrics.d.mts +2 -0
- package/dist/metrics.mjs +2 -0
- package/dist/{chunk-Bp6m_JJh.js → rolldown-runtime-D7D4PA-g.mjs} +4 -4
- package/dist/runtime-config/index.d.mts +2 -0
- package/dist/runtime-config/index.mjs +3 -0
- package/dist/runtime-config-Oa55gAew.mjs +97 -0
- package/dist/runtime-config-Oa55gAew.mjs.map +1 -0
- package/dist/{server-CXTQ7odl.js → server-CMnxz3h0.mjs} +21 -60
- package/dist/server-CMnxz3h0.mjs.map +1 -0
- package/dist/service-DLkhuxYl.d.mts +27 -0
- package/dist/service-jWxxfEht.mjs +7 -0
- package/dist/service-jWxxfEht.mjs.map +1 -0
- package/dist/state-store/index.d.mts +2 -0
- package/dist/state-store/index.mjs +2 -0
- package/dist/{state-store-yl6LiTQ0.js → state-store-uFvHY7Ax.mjs} +15 -22
- package/dist/state-store-uFvHY7Ax.mjs.map +1 -0
- package/dist/status/{index.d.ts → index.d.mts} +1 -4
- package/dist/status/{index.js → index.mjs} +2 -6
- package/dist/{status-B-oZBc33.js → status-CKb9IhQ9.mjs} +14 -16
- package/dist/status-CKb9IhQ9.mjs.map +1 -0
- package/dist/table-V0tgUC5i.mjs +370 -0
- package/dist/table-V0tgUC5i.mjs.map +1 -0
- package/dist/types-xZtSmrGA.d.mts +220 -0
- package/dist/webhook/index.d.mts +3 -0
- package/dist/webhook/index.mjs +12 -0
- package/dist/webhook/index.mjs.map +1 -0
- package/dist/wings-I56hGtNv.mjs +325 -0
- package/dist/wings-I56hGtNv.mjs.map +1 -0
- package/package.json +64 -51
- package/src/catalog/table.ts +201 -0
- package/src/connector-app/create-table.ts +47 -0
- package/src/connector-app/demo.ts +42 -0
- package/src/connector-app/index.ts +2 -0
- package/src/connector-app/start.ts +1 -1
- package/src/core/builder.ts +15 -23
- package/src/core/index.ts +11 -1
- package/src/core/types.ts +114 -39
- package/src/demo/definition.ts +68 -0
- package/src/demo/generate.ts +167 -0
- package/src/demo/index.ts +3 -0
- package/src/demo/run.ts +142 -0
- package/src/iceberg/annotations.ts +62 -0
- package/src/iceberg/error.ts +9 -0
- package/src/iceberg/index.ts +3 -0
- package/src/iceberg/table.ts +511 -0
- package/src/index.ts +3 -1
- package/src/ingestion/engine.ts +240 -60
- package/src/ingestor/arrow.ts +248 -0
- package/src/ingestor/console.ts +13 -0
- package/src/ingestor/index.ts +9 -0
- package/src/ingestor/instrumented.ts +61 -0
- package/src/ingestor/service.ts +30 -0
- package/src/ingestor/wings.ts +143 -0
- package/src/manifest/config.ts +3 -3
- package/src/metrics.ts +125 -33
- package/src/runtime-config/config.ts +14 -0
- package/src/runtime-config/constants.ts +5 -2
- package/src/runtime-config/error.ts +4 -1
- package/src/runtime-config/index.ts +2 -0
- package/src/runtime-config/layer.ts +1 -1
- package/src/runtime-config/table-bindings.ts +92 -0
- package/src/state-store/layer-key-value-store.ts +8 -3
- package/src/state-store/layer-memory.ts +1 -1
- package/src/state-store/layer-sql.ts +4 -4
- package/src/state-store/schema.ts +2 -2
- package/src/state-store/state.ts +14 -2
- package/src/status/route.ts +2 -2
- package/src/telemetry.ts +25 -10
- package/src/webhook/server.ts +39 -40
- package/dist/auth/index.d.ts +0 -2
- package/dist/auth/index.js +0 -3
- package/dist/auth-DvU_CZ7C.js.map +0 -1
- package/dist/connector-app/index.d.ts +0 -14
- package/dist/connector-app/index.js +0 -11
- package/dist/connector-app-d7Z-SZLQ.js +0 -64
- package/dist/connector-app-d7Z-SZLQ.js.map +0 -1
- package/dist/constants-BRhIX_rz.js.map +0 -1
- package/dist/errors/index.d.ts +0 -2
- package/dist/errors/index.js +0 -3
- package/dist/errors-DHWylqRZ.js.map +0 -1
- package/dist/index-Byr0Lf0C.d.ts +0 -25
- package/dist/index-o1-Z3n7V.d.ts +0 -55
- package/dist/index.d.ts +0 -14
- package/dist/index.js +0 -58
- package/dist/index.js.map +0 -1
- package/dist/ingestion/index.d.ts +0 -6
- package/dist/ingestion/index.js +0 -10
- package/dist/ingestion-BQo4cbGw.js +0 -200
- package/dist/ingestion-BQo4cbGw.js.map +0 -1
- package/dist/manifest/index.d.ts +0 -2
- package/dist/manifest-ByE6YPG0.js.map +0 -1
- package/dist/metrics-CVAk1ALR.d.ts +0 -53
- package/dist/metrics-CWPy2Aqc.js +0 -96
- package/dist/metrics-CWPy2Aqc.js.map +0 -1
- package/dist/metrics.d.ts +0 -4
- package/dist/metrics.js +0 -3
- package/dist/publisher/index.d.ts +0 -5
- package/dist/publisher/index.js +0 -6
- package/dist/publisher-BYT3RLVO.js +0 -131
- package/dist/publisher-BYT3RLVO.js.map +0 -1
- package/dist/runtime-config/index.d.ts +0 -2
- package/dist/runtime-config/index.js +0 -4
- package/dist/runtime-config-BpB-d_bF.js +0 -51
- package/dist/runtime-config-BpB-d_bF.js.map +0 -1
- package/dist/server-CXTQ7odl.js.map +0 -1
- package/dist/service-DuFiQwid.js +0 -191
- package/dist/service-DuFiQwid.js.map +0 -1
- package/dist/service-IE5qaf9x.d.ts +0 -32
- package/dist/state-store/index.d.ts +0 -3
- package/dist/state-store/index.js +0 -5
- package/dist/state-store-yl6LiTQ0.js.map +0 -1
- package/dist/status-B-oZBc33.js.map +0 -1
- package/dist/types-B35J5YPu.d.ts +0 -174
- package/dist/webhook/index.d.ts +0 -6
- package/dist/webhook/index.js +0 -8
- package/dist/webhook-DI-Afxkg.js +0 -13
- package/dist/webhook-DI-Afxkg.js.map +0 -1
- package/src/publisher/console.ts +0 -18
- package/src/publisher/index.ts +0 -7
- package/src/publisher/instrumented.ts +0 -68
- package/src/publisher/service.ts +0 -37
- package/src/publisher/wings.ts +0 -204
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Duration, Effect, Redacted } from "effect";
|
|
2
|
-
|
|
3
2
|
//#region src/auth/token-cache.d.ts
|
|
4
3
|
interface ExpiringToken {
|
|
5
4
|
/** The credential kept in memory by the cache. */
|
|
@@ -38,4 +37,4 @@ declare namespace index_d_exports {
|
|
|
38
37
|
}
|
|
39
38
|
//#endregion
|
|
40
39
|
export { makeTokenCache as i, ExpiringToken as n, TokenCache as r, index_d_exports as t };
|
|
41
|
-
//# sourceMappingURL=index-
|
|
40
|
+
//# sourceMappingURL=index-BX8G7d41.d.mts.map
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { t as ConnectorError } from "./index-
|
|
2
|
-
import {
|
|
3
|
-
import { i as
|
|
4
|
-
import { i as StateStore } from "./index-
|
|
1
|
+
import { t as ConnectorError } from "./index-DkVNO6ks.mjs";
|
|
2
|
+
import { d as ResourceDefinition, i as Cursor, k as WebhookRoute, r as ConnectorDefinition } from "./types-xZtSmrGA.mjs";
|
|
3
|
+
import { i as Ingestor } from "./service-DLkhuxYl.mjs";
|
|
4
|
+
import { i as StateStore } from "./index-CgvFomO6.mjs";
|
|
5
5
|
import { Effect } from "effect";
|
|
6
|
-
import { HttpRouter, HttpServer } from "effect/
|
|
7
|
-
|
|
6
|
+
import { HttpRouter, HttpServer } from "effect/http";
|
|
8
7
|
//#region src/ingestion/engine.d.ts
|
|
9
8
|
type RunBaseOptions = {
|
|
10
9
|
readonly initialCutoff?: Cursor.Value;
|
|
@@ -25,14 +24,14 @@ type RunWebhookOptions = RunOptions & {
|
|
|
25
24
|
readonly webhook: NonNullable<RunOptions["webhook"]>;
|
|
26
25
|
};
|
|
27
26
|
/**
|
|
28
|
-
* Runs all connector ingestion loops. Callers provide the
|
|
27
|
+
* Runs all connector ingestion loops. Callers provide the Ingestor and
|
|
29
28
|
* StateStore layers; webhook mode additionally requires an HttpServer layer.
|
|
30
29
|
*/
|
|
31
|
-
declare function run<const Resources extends ReadonlyArray<ResourceDefinition>>(connector: ConnectorDefinition<Resources>, options?: RunNoWebhookOptions): Effect.Effect<void, ConnectorError, StateStore |
|
|
32
|
-
declare function run<const Resources extends ReadonlyArray<ResourceDefinition>>(connector: ConnectorDefinition<Resources>, options: RunWebhookOptions): Effect.Effect<void, ConnectorError, StateStore |
|
|
30
|
+
declare function run<const Resources extends ReadonlyArray<ResourceDefinition>>(connector: ConnectorDefinition<Resources>, options?: RunNoWebhookOptions): Effect.Effect<void, ConnectorError, StateStore | Ingestor>;
|
|
31
|
+
declare function run<const Resources extends ReadonlyArray<ResourceDefinition>>(connector: ConnectorDefinition<Resources>, options: RunWebhookOptions): Effect.Effect<void, ConnectorError, StateStore | Ingestor | HttpServer.HttpServer>;
|
|
33
32
|
declare namespace index_d_exports {
|
|
34
33
|
export { RunOptions, run };
|
|
35
34
|
}
|
|
36
35
|
//#endregion
|
|
37
36
|
export { RunOptions as n, run as r, index_d_exports as t };
|
|
38
|
-
//# sourceMappingURL=index-
|
|
37
|
+
//# sourceMappingURL=index-BfXpgxk9.d.mts.map
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as
|
|
1
|
+
import { A as WebhookRouteContext, D as WebhookAckMode, d as ResourceDefinition, j as WebhookRouteInput, k as WebhookRoute, u as ResourceBatch } from "./types-xZtSmrGA.mjs";
|
|
2
|
+
import { i as Ingestor } from "./service-DLkhuxYl.mjs";
|
|
3
|
+
import "./index-CUPP2A_m.mjs";
|
|
3
4
|
import { Context, Queue } from "effect";
|
|
4
|
-
import { HttpRouter } from "effect/
|
|
5
|
-
import * as effect_Layer1 from "effect/Layer";
|
|
6
|
-
|
|
5
|
+
import { HttpRouter } from "effect/http";
|
|
7
6
|
//#region src/webhook/server.d.ts
|
|
8
7
|
type QueuedWebhookBatch = {
|
|
9
8
|
readonly resource: string;
|
|
@@ -13,13 +12,16 @@ declare const WebhookQueue_base: Context.ServiceClass<WebhookQueue, "@useairfoil
|
|
|
13
12
|
readonly queue: Queue.Queue<QueuedWebhookBatch>;
|
|
14
13
|
}>;
|
|
15
14
|
declare class WebhookQueue extends WebhookQueue_base {}
|
|
16
|
-
|
|
15
|
+
type RouterOptions = {
|
|
17
16
|
readonly connectorName: string;
|
|
18
|
-
|
|
17
|
+
/** Events for other resources are skipped. */
|
|
18
|
+
readonly resourceNames: ReadonlyArray<string>;
|
|
19
|
+
};
|
|
20
|
+
declare const router: (routes: ReadonlyArray<WebhookRoute>, options: RouterOptions) => import("effect/Layer").Layer<never, never, HttpRouter.HttpRouter | HttpRouter.Request<"Requires", Ingestor> | HttpRouter.Request<"Requires", WebhookQueue>>;
|
|
19
21
|
declare namespace index_d_exports {
|
|
20
22
|
export { WebhookAckMode, WebhookRoute, WebhookRouteContext, WebhookRouteInput, route, router };
|
|
21
23
|
}
|
|
22
24
|
declare const route: <const Resources extends ReadonlyArray<ResourceDefinition>, Payload>(definition: WebhookRouteInput<Resources, Payload>) => WebhookRoute<Resources, Payload>;
|
|
23
25
|
//#endregion
|
|
24
26
|
export { route as n, router as r, index_d_exports as t };
|
|
25
|
-
//# sourceMappingURL=index-
|
|
27
|
+
//# sourceMappingURL=index-CRVAwJ5-.d.mts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { t as ConnectorError } from "./index-DkVNO6ks.mjs";
|
|
2
|
+
import { E as TableSource } from "./types-xZtSmrGA.mjs";
|
|
3
|
+
import { a as IngestorService, i as Ingestor, n as IngestResult, r as IngestSource, t as IngestOptions } from "./service-DLkhuxYl.mjs";
|
|
4
|
+
import { n as ResolvedTableBindings, t as index_d_exports$1 } from "./index-ygpml2kC.mjs";
|
|
5
|
+
import { Layer } from "effect";
|
|
6
|
+
import * as Wings from "@useairfoil/wings";
|
|
7
|
+
//#region src/ingestor/console.d.ts
|
|
8
|
+
/** Logs batches without sending them to Wings. */
|
|
9
|
+
declare const layerConsole: Layer.Layer<Ingestor, never, never>;
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/ingestor/wings.d.ts
|
|
12
|
+
/** One catalog and an Iceberg table for each resource that runs. */
|
|
13
|
+
type WingsIngestorConfig<Source extends TableSource = TableSource> = {
|
|
14
|
+
readonly connector: Source;
|
|
15
|
+
readonly catalog: string;
|
|
16
|
+
readonly tables: ResolvedTableBindings<Source>;
|
|
17
|
+
};
|
|
18
|
+
/** Loads each table schema and opens one Wings stream per bound resource. */
|
|
19
|
+
declare const layerWings: <const Source extends TableSource>(config: WingsIngestorConfig<Source>) => Layer.Layer<Ingestor, ConnectorError, Wings.CatalogManager.CatalogManager>;
|
|
20
|
+
/** Reads the Wings URL, catalog and table bindings from hosted config. */
|
|
21
|
+
declare const layerWingsConfig: (connector: TableSource) => Layer.Layer<Ingestor, ConnectorError, never>;
|
|
22
|
+
declare namespace index_d_exports {
|
|
23
|
+
export { IngestOptions, IngestResult, IngestSource, Ingestor, IngestorService, WingsIngestorConfig, layerConsole, layerWings, layerWingsConfig };
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { layerConsole as a, layerWingsConfig as i, WingsIngestorConfig as n, layerWings as r, index_d_exports as t };
|
|
27
|
+
//# sourceMappingURL=index-CUPP2A_m.d.mts.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { t as ConnectorError } from "./index-
|
|
1
|
+
import { t as ConnectorError } from "./index-DkVNO6ks.mjs";
|
|
2
2
|
import { Config, Context, Effect, Layer, Schema } from "effect";
|
|
3
|
-
import { SqlClient } from "effect/
|
|
4
|
-
|
|
3
|
+
import { SqlClient } from "effect/sql";
|
|
5
4
|
//#region src/state-store/schema.d.ts
|
|
6
5
|
/** Durable progress for a finite historical backfill. */
|
|
7
6
|
declare const BackfillStateSchema: Schema.Struct<{
|
|
@@ -16,7 +15,7 @@ declare const ChangesStateSchema: Schema.Struct<{
|
|
|
16
15
|
readonly lastSuccessAt: Schema.optional<Schema.String>;
|
|
17
16
|
}>;
|
|
18
17
|
declare const StateSourceSchema: Schema.Literals<readonly ["backfill", "changes"]>;
|
|
19
|
-
declare const StateOperationSchema: Schema.Literals<readonly ["fetch", "
|
|
18
|
+
declare const StateOperationSchema: Schema.Literals<readonly ["fetch", "ingest", "checkpoint"]>;
|
|
20
19
|
/** Complete persisted state assembled from independently stored components. */
|
|
21
20
|
declare const ResourceStateSchema: Schema.Struct<{
|
|
22
21
|
readonly backfill: Schema.optional<Schema.Struct<{
|
|
@@ -32,8 +31,8 @@ declare const ResourceStateSchema: Schema.Struct<{
|
|
|
32
31
|
readonly lastError: Schema.optional<Schema.Struct<{
|
|
33
32
|
readonly at: Schema.String;
|
|
34
33
|
readonly source: Schema.Literals<readonly ["backfill", "changes"]>;
|
|
35
|
-
readonly operation: Schema.Literals<readonly ["fetch", "
|
|
36
|
-
readonly code: Schema.Literals<readonly ["fetch_failed", "
|
|
34
|
+
readonly operation: Schema.Literals<readonly ["fetch", "ingest", "checkpoint"]>;
|
|
35
|
+
readonly code: Schema.Literals<readonly ["fetch_failed", "ingest_failed", "checkpoint_failed"]>;
|
|
37
36
|
readonly message: Schema.String;
|
|
38
37
|
}>>;
|
|
39
38
|
}>;
|
|
@@ -92,4 +91,4 @@ declare namespace index_d_exports {
|
|
|
92
91
|
}
|
|
93
92
|
//#endregion
|
|
94
93
|
export { StateStoreService as a, StateStore as i, layerSql as n, layerMemory as r, index_d_exports as t };
|
|
95
|
-
//# sourceMappingURL=index-
|
|
94
|
+
//# sourceMappingURL=index-CgvFomO6.d.mts.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { a as ids, i as identifier, r as field } from "./annotations-BE74YmAO.mjs";
|
|
2
|
+
import { Effect, Schema } from "effect";
|
|
3
|
+
import { CommitTableRequest } from "iceberg-js";
|
|
4
|
+
//#region src/iceberg/error.d.ts
|
|
5
|
+
declare const IcebergSchemaError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
6
|
+
readonly _tag: "IcebergSchemaError";
|
|
7
|
+
} & Readonly<A>;
|
|
8
|
+
/** A schema could not be turned into an Iceberg table. */
|
|
9
|
+
declare class IcebergSchemaError extends IcebergSchemaError_base<{
|
|
10
|
+
/** Schema path, such as `$.orders.element`. */
|
|
11
|
+
readonly path: string;
|
|
12
|
+
readonly message: string;
|
|
13
|
+
readonly cause?: unknown;
|
|
14
|
+
}> {}
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/iceberg/table.d.ts
|
|
17
|
+
/** Options for creating a table. */
|
|
18
|
+
type CreateTableCommitOptions = {
|
|
19
|
+
/** Where the table's files go. The catalog may choose this when omitted. */
|
|
20
|
+
readonly location?: string | undefined;
|
|
21
|
+
/** UUID for the table. Random by default. */
|
|
22
|
+
readonly uuid?: string | undefined;
|
|
23
|
+
/** Extra table properties. These win over the ones from the schema. */
|
|
24
|
+
readonly properties?: Readonly<Record<string, string>> | undefined;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Builds the commit that creates an Iceberg table from an Effect schema.
|
|
28
|
+
*
|
|
29
|
+
* The field IDs come from the schema, so the table has to keep them. Send the
|
|
30
|
+
* commit with `commitTable`. Then load the table and check the IDs before you
|
|
31
|
+
* write any rows. Don't use `createTable` here, because it can change the IDs.
|
|
32
|
+
*
|
|
33
|
+
* A root `description` becomes the table `comment`, and a field `description`
|
|
34
|
+
* becomes its `doc`. `title` and `examples` are dropped.
|
|
35
|
+
*
|
|
36
|
+
* `Iceberg.identifier` sets the `identifier-field-ids`, and makes every other
|
|
37
|
+
* top-level column nullable.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* const Row = Schema.Struct({
|
|
42
|
+
* id: Schema.String.pipe(Iceberg.field(1, { description: "Stable row identifier" })),
|
|
43
|
+
* })
|
|
44
|
+
* .annotate({ description: "Connector rows" })
|
|
45
|
+
* .pipe(Iceberg.identifier("id"))
|
|
46
|
+
*
|
|
47
|
+
* const request = yield* Iceberg.makeCreateTableCommitRequest(Row, {
|
|
48
|
+
* location: "s3://warehouse/rows"
|
|
49
|
+
* })
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
declare const makeCreateTableCommitRequest: (schema: Schema.Top, options: CreateTableCommitOptions) => Effect.Effect<CommitTableRequest, IcebergSchemaError>;
|
|
53
|
+
declare namespace index_d_exports {
|
|
54
|
+
export { CreateTableCommitOptions, IcebergSchemaError, field, identifier, ids, makeCreateTableCommitRequest };
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
export { IcebergSchemaError as i, CreateTableCommitOptions as n, makeCreateTableCommitRequest as r, index_d_exports as t };
|
|
58
|
+
//# sourceMappingURL=index-DJhDp4Xc.d.mts.map
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { t as ConnectorError } from "./index-DkVNO6ks.mjs";
|
|
2
|
+
import { _ as ResourceRequiredField, b as ResourceSchema } from "./types-xZtSmrGA.mjs";
|
|
3
|
+
import { i as Ingestor, n as IngestResult } from "./service-DLkhuxYl.mjs";
|
|
4
|
+
import { Effect, Schema } from "effect";
|
|
5
|
+
import { Faker } from "@faker-js/faker";
|
|
6
|
+
//#region src/demo/generate.d.ts
|
|
7
|
+
/** What one run shares: the seeded Faker and the time the run started. */
|
|
8
|
+
type DemoContext = {
|
|
9
|
+
readonly faker: Faker;
|
|
10
|
+
readonly now: Date;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/demo/definition.d.ts
|
|
14
|
+
/** A table a demo writes: the same name, row schema and version as its resource. */
|
|
15
|
+
type DemoTable<Name extends string = string, S extends ResourceSchema = ResourceSchema, Version extends string = string> = {
|
|
16
|
+
readonly name: Name;
|
|
17
|
+
readonly rowSchema: S;
|
|
18
|
+
readonly version: Version;
|
|
19
|
+
};
|
|
20
|
+
declare const table: <const Name extends string, S extends ResourceSchema, const Version extends ResourceRequiredField<S>>(definition: DemoTable<Name, S, Version>) => DemoTable<Name, S, Version>;
|
|
21
|
+
/** Rows by table. Required fields a row leaves out get placeholder values. */
|
|
22
|
+
type DemoRows<Tables extends ReadonlyArray<DemoTable>> = { readonly [Table in Tables[number] as Table["name"]]?: ReadonlyArray<Partial<Schema.Schema.Type<Table["rowSchema"]>>>; };
|
|
23
|
+
type DemoDefinition<Setup extends ReadonlyArray<DemoTable> = ReadonlyArray<DemoTable>, Group extends ReadonlyArray<DemoTable> = ReadonlyArray<DemoTable>> = {
|
|
24
|
+
readonly name: string;
|
|
25
|
+
/** Tables written once, before any group, such as a product catalog. */
|
|
26
|
+
readonly setup: {
|
|
27
|
+
readonly tables: Setup;
|
|
28
|
+
readonly rows: (context: DemoContext) => DemoRows<Setup>;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Tables for one related unit, such as a customer and their orders. The run
|
|
32
|
+
* adds groups until it reaches the size. Build keys from the index, so they
|
|
33
|
+
* are unique and other groups can point to them.
|
|
34
|
+
*/
|
|
35
|
+
readonly group: {
|
|
36
|
+
readonly tables: Group;
|
|
37
|
+
readonly rows: (index: number, context: DemoContext) => DemoRows<Group>;
|
|
38
|
+
/**
|
|
39
|
+
* Groups written per chunk, 100 by default. A run can go over the size by
|
|
40
|
+
* one chunk, so lower it when a group is big.
|
|
41
|
+
*/
|
|
42
|
+
readonly groupsPerChunk?: number;
|
|
43
|
+
/**
|
|
44
|
+
* The number of groups there are, when the provider only keeps so much
|
|
45
|
+
* history. The run stops there, even below the size.
|
|
46
|
+
*/
|
|
47
|
+
readonly count?: number;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
declare const define: <const Setup extends ReadonlyArray<DemoTable>, const Group extends ReadonlyArray<DemoTable>>(definition: DemoDefinition<Setup, Group>) => DemoDefinition<Setup, Group>;
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/demo/run.d.ts
|
|
53
|
+
type RunOptions = {
|
|
54
|
+
/** Stop once this many Arrow bytes are written. */
|
|
55
|
+
readonly bytes: number;
|
|
56
|
+
readonly seed: number;
|
|
57
|
+
/** The time data is made around. Same seed, time and tables give the same rows. */
|
|
58
|
+
readonly now: Date;
|
|
59
|
+
/** Groups per chunk. Overrides the demo's. */
|
|
60
|
+
readonly groupsPerChunk?: number;
|
|
61
|
+
};
|
|
62
|
+
type DemoTotals = IngestResult & {
|
|
63
|
+
readonly tables: Readonly<Record<string, IngestResult>>;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Writes the setup rows, then groups, until it reaches the size or the demo's
|
|
67
|
+
* count. It can go over the size by one chunk. Only bound tables are
|
|
68
|
+
* written; keys still point to the others.
|
|
69
|
+
*/
|
|
70
|
+
declare const run: (demo: DemoDefinition, options: RunOptions) => Effect.Effect<DemoTotals, ConnectorError, Ingestor>;
|
|
71
|
+
declare namespace index_d_exports {
|
|
72
|
+
export { DemoContext, DemoDefinition, DemoRows, DemoTable, DemoTotals, RunOptions, define, run, table };
|
|
73
|
+
}
|
|
74
|
+
//#endregion
|
|
75
|
+
export { DemoDefinition as a, define as c, run as i, table as l, DemoTotals as n, DemoRows as o, RunOptions as r, DemoTable as s, index_d_exports as t, DemoContext as u };
|
|
76
|
+
//# sourceMappingURL=index-Dk7urvpF.d.mts.map
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import * as effect_Types0 from "effect/Types";
|
|
2
|
-
import * as effect_Cause0 from "effect/Cause";
|
|
3
|
-
|
|
4
1
|
//#region src/errors/connector-error.d.ts
|
|
5
|
-
declare const ConnectorError_base: new <A extends Record<string, any> = {}>(args:
|
|
2
|
+
declare const ConnectorError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
6
3
|
readonly _tag: "ConnectorError";
|
|
7
4
|
} & Readonly<A>;
|
|
8
5
|
declare class ConnectorError extends ConnectorError_base<{
|
|
@@ -11,4 +8,4 @@ declare class ConnectorError extends ConnectorError_base<{
|
|
|
11
8
|
}> {}
|
|
12
9
|
//#endregion
|
|
13
10
|
export { ConnectorError as t };
|
|
14
|
-
//# sourceMappingURL=index-
|
|
11
|
+
//# sourceMappingURL=index-DkVNO6ks.d.mts.map
|
|
@@ -1,12 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { i as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
1
|
+
import "./index-BX8G7d41.mjs";
|
|
2
|
+
import { t as ConnectorError } from "./index-DkVNO6ks.mjs";
|
|
3
|
+
import "./annotations-BE74YmAO.mjs";
|
|
4
|
+
import { _ as ResourceRequiredField, b as ResourceSchema, d as ResourceDefinition, h as ResourceName, i as Cursor$1, l as PageFetch, n as ChangesFetch, r as ConnectorDefinition, t as ChangesFeed } from "./types-xZtSmrGA.mjs";
|
|
5
|
+
import { a as DemoDefinition } from "./index-Dk7urvpF.mjs";
|
|
6
|
+
import { i as Ingestor } from "./service-DLkhuxYl.mjs";
|
|
7
|
+
import "./index-DJhDp4Xc.mjs";
|
|
8
|
+
import { i as StateStore } from "./index-CgvFomO6.mjs";
|
|
9
|
+
import "./index-BfXpgxk9.mjs";
|
|
10
|
+
import "./index-CUPP2A_m.mjs";
|
|
11
|
+
import "./index-ygpml2kC.mjs";
|
|
12
|
+
import "./index-eFuoMZZ3.mjs";
|
|
13
|
+
import "./metrics-CVXFL7YT.mjs";
|
|
14
|
+
import "./index-BUHSGm9Q.mjs";
|
|
15
|
+
import "./index-CRVAwJ5-.mjs";
|
|
16
|
+
import { Config, Context, Duration, Effect, Layer, Option, Schema } from "effect";
|
|
17
|
+
import { CliError, Command } from "effect/cli";
|
|
18
|
+
import { HttpRouter } from "effect/http";
|
|
10
19
|
//#region src/connector-app/check.d.ts
|
|
11
20
|
type ResourceCheckResult = {
|
|
12
21
|
readonly _tag: "ok";
|
|
@@ -17,7 +26,7 @@ type ResourceCheckResult = {
|
|
|
17
26
|
type CheckOptions<Name extends string> = {
|
|
18
27
|
readonly resources: ReadonlyArray<Name>;
|
|
19
28
|
};
|
|
20
|
-
type ResourceCheckResults<Name extends PropertyKey> = { readonly [Key in Name]: ResourceCheckResult };
|
|
29
|
+
type ResourceCheckResults<Name extends PropertyKey> = { readonly [Key in Name]: ResourceCheckResult; };
|
|
21
30
|
type CheckResult<Resources extends ReadonlyArray<ResourceDefinition>, Name extends ResourceName<Resources> = ResourceName<Resources>> = ResourceCheckResults<Name>;
|
|
22
31
|
type CheckFailure = {
|
|
23
32
|
readonly message: string;
|
|
@@ -30,36 +39,31 @@ declare function check<Identifier, const Resources extends ReadonlyArray<Resourc
|
|
|
30
39
|
//#endregion
|
|
31
40
|
//#region src/core/builder.d.ts
|
|
32
41
|
declare const Connector: {
|
|
33
|
-
define: <const Resources extends ReadonlyArray<ResourceDefinition
|
|
42
|
+
define: <const Resources extends ReadonlyArray<ResourceDefinition>, const FeedResources extends ReadonlyArray<Resources[number]> = Resources>(definition: ConnectorDefinition<Resources, FeedResources>) => ConnectorDefinition<Resources, FeedResources>;
|
|
34
43
|
};
|
|
35
44
|
declare const Resource: {
|
|
36
|
-
entity: <S extends ResourceSchema, Payload = never, R = never, const Name extends string = string>(definition: ResourceDefinition<S, Payload, R, Name>) => ResourceDefinition<S, Payload, R, Name>;
|
|
37
|
-
webhook: <Payload, Row extends object = never>(definition: WebhookHandler<Row, Payload>) => WebhookHandler<Row, Payload>;
|
|
38
|
-
upsert: <Row extends object>(row: Row) => ResourceMutation<Row>;
|
|
39
|
-
delete: (options: {
|
|
40
|
-
readonly key: DeleteValue;
|
|
41
|
-
readonly version: DeleteValue;
|
|
42
|
-
}) => ResourceMutation<never>;
|
|
45
|
+
entity: <S extends ResourceSchema, Payload = never, R = never, const Name extends string = string, const Version extends ResourceRequiredField<S> = ResourceRequiredField<S>>(definition: ResourceDefinition<S, Payload, R, Name, Version>) => ResourceDefinition<S, Payload, R, Name, Version>;
|
|
43
46
|
};
|
|
44
47
|
declare const Fetch: {
|
|
45
48
|
page: <Row extends object = never, R = never>(definition: PageFetch<Row, R>) => PageFetch<Row, R>;
|
|
46
49
|
changes: <Row extends object = never, R = never>(definition: ChangesFetch<Row, R>) => ChangesFetch<Row, R>;
|
|
50
|
+
feed: <const Resources extends ReadonlyArray<ResourceDefinition>, R = never>(definition: ChangesFeed<Resources, R>) => ChangesFeed<Resources, R>;
|
|
47
51
|
};
|
|
48
|
-
declare const Cursor
|
|
49
|
-
string: () => Cursor.Definition<string>;
|
|
50
|
-
number: () => Cursor.Definition<number>;
|
|
51
|
-
isoDateTime: () => Cursor.Definition<string>;
|
|
52
|
+
declare const Cursor: {
|
|
53
|
+
string: () => Cursor$1.Definition<string>;
|
|
54
|
+
number: () => Cursor$1.Definition<number>;
|
|
55
|
+
isoDateTime: () => Cursor$1.Definition<string>;
|
|
52
56
|
nowIsoDateTime: Effect.Effect<string, never, never>;
|
|
53
57
|
};
|
|
54
58
|
declare namespace telemetry_d_exports {
|
|
55
|
-
export { Attr, EventAttr, EventName, OtlpMetricsOptions, OtlpTracingConfig, OtlpTracingOptions, SpanName, addCurrentSpanEvent, annotateError, layer, layerConfig, layerMetricsConsoleDump, layerOtlp, layerOtlpMetrics, layerOtlpTracing };
|
|
59
|
+
export { Attr, EventAttr, EventName, OtlpMetricsOptions, OtlpTracingConfig, OtlpTracingOptions, ResourceAttr, SpanName, addCurrentSpanEvent, annotateError, layer, layerConfig, layerMetricsConsoleDump, layerOtlp, layerOtlpMetrics, layerOtlpTracing };
|
|
56
60
|
}
|
|
57
61
|
/** Canonical span names emitted by connector-kit runtime instrumentation. */
|
|
58
62
|
declare const SpanName: {
|
|
59
63
|
readonly batchProcess: "connector.batch.process";
|
|
60
64
|
readonly webhookDecode: "connector.webhook.decode";
|
|
61
65
|
readonly webhookHandle: "connector.webhook.handle";
|
|
62
|
-
readonly
|
|
66
|
+
readonly ingest: "connector.ingest";
|
|
63
67
|
readonly stateSet: "connector.state.set";
|
|
64
68
|
readonly apiFetch: "connector.api.fetch";
|
|
65
69
|
};
|
|
@@ -69,9 +73,13 @@ declare const Attr: {
|
|
|
69
73
|
readonly connectorResourcesCount: "airfoil.connector.resources.count";
|
|
70
74
|
readonly resourceName: "airfoil.resource.name";
|
|
71
75
|
readonly resourceSource: "airfoil.resource.source";
|
|
72
|
-
readonly
|
|
76
|
+
readonly batchRows: "airfoil.batch.rows";
|
|
77
|
+
readonly batchOutcome: "airfoil.batch.outcome";
|
|
73
78
|
readonly webhookPath: "airfoil.webhook.path";
|
|
74
|
-
readonly
|
|
79
|
+
readonly webhookOutcome: "airfoil.webhook.outcome";
|
|
80
|
+
readonly syncState: "airfoil.connector.sync.state";
|
|
81
|
+
readonly apiRetryReason: "airfoil.connector.api.retry.reason";
|
|
82
|
+
readonly ingestionSuccess: "airfoil.ingestion.success";
|
|
75
83
|
readonly stateKey: "airfoil.state.key";
|
|
76
84
|
readonly apiPath: "airfoil.api.path";
|
|
77
85
|
readonly errorPhase: "airfoil.error.phase";
|
|
@@ -79,6 +87,12 @@ declare const Attr: {
|
|
|
79
87
|
readonly errorMessage: "airfoil.error.message";
|
|
80
88
|
readonly errorDetails: "airfoil.error.details";
|
|
81
89
|
};
|
|
90
|
+
/** Resource attributes injected by the hosted operator through standard OTel environment keys. */
|
|
91
|
+
declare const ResourceAttr: {
|
|
92
|
+
readonly serviceInstanceId: "service.instance.id";
|
|
93
|
+
readonly connectorRevision: "airfoil.connector.revision";
|
|
94
|
+
readonly teamId: "airfoil.team.id";
|
|
95
|
+
};
|
|
82
96
|
/** Span event names for high-cardinality reproduction details. */
|
|
83
97
|
declare const EventName: {
|
|
84
98
|
readonly batchCheckpoint: "airfoil.batch.checkpoint";
|
|
@@ -102,6 +116,7 @@ type OtlpTracingOptions = {
|
|
|
102
116
|
/** Additional connector-specific header names or regexes to redact from HTTP logs/traces. */
|
|
103
117
|
readonly redactedHeaders?: ReadonlyArray<string | RegExp>;
|
|
104
118
|
};
|
|
119
|
+
/** OTLP metric export settings. */
|
|
105
120
|
type OtlpMetricsOptions = {
|
|
106
121
|
readonly exportInterval?: Duration.Input;
|
|
107
122
|
};
|
|
@@ -109,18 +124,18 @@ type OtlpMetricsOptions = {
|
|
|
109
124
|
* Trace-only OTLP export with sensitive HTTP header redaction.
|
|
110
125
|
* Takes direct config values — no `ConfigProvider` required.
|
|
111
126
|
*/
|
|
112
|
-
declare const layer: (config?: OtlpTracingConfig, options?: OtlpTracingOptions) => Layer.Layer<never, Error,
|
|
127
|
+
declare const layer: (config?: OtlpTracingConfig, options?: OtlpTracingOptions) => Layer.Layer<never, Error, import("effect/http/HttpClient").HttpClient>;
|
|
113
128
|
/**
|
|
114
129
|
* Trace-only OTLP export with sensitive HTTP header redaction.
|
|
115
130
|
* Takes Effect Config-wrapped values — reads from `ConfigProvider`.
|
|
116
131
|
*
|
|
117
132
|
* @example
|
|
118
133
|
* Telemetry.layerConfig({
|
|
119
|
-
* enabled: Config.
|
|
120
|
-
* endpoint: Config.
|
|
134
|
+
* enabled: Config.Boolean("MY_OTEL_ENABLED"),
|
|
135
|
+
* endpoint: Config.String("MY_COLLECTOR_URL"),
|
|
121
136
|
* })
|
|
122
137
|
*/
|
|
123
|
-
declare const layerConfig: (config: Config.Wrap<OtlpTracingConfig>, options?: OtlpTracingOptions) => Layer.Layer<never, Error | Config.ConfigError,
|
|
138
|
+
declare const layerConfig: (config: Config.Wrap<OtlpTracingConfig>, options?: OtlpTracingOptions) => Layer.Layer<never, Error | Config.ConfigError, import("effect/http/HttpClient").HttpClient>;
|
|
124
139
|
/**
|
|
125
140
|
* Trace-only OTLP export with sensitive HTTP header redaction.
|
|
126
141
|
* Zero-config shortcut that reads the standard `OTEL_*` env var names.
|
|
@@ -129,25 +144,49 @@ declare const layerConfig: (config: Config.Wrap<OtlpTracingConfig>, options?: Ot
|
|
|
129
144
|
* `OTEL_EXPORTER_OTLP_HEADERS`. Effect's OTLP resource handling reads
|
|
130
145
|
* `OTEL_SERVICE_NAME`, `OTEL_SERVICE_VERSION`, and `OTEL_RESOURCE_ATTRIBUTES`.
|
|
131
146
|
*/
|
|
132
|
-
declare const layerOtlpTracing: (options?: OtlpTracingOptions) => Layer.Layer<never, Error | Config.ConfigError,
|
|
133
|
-
|
|
134
|
-
declare const
|
|
147
|
+
declare const layerOtlpTracing: (options?: OtlpTracingOptions) => Layer.Layer<never, Error | Config.ConfigError, import("effect/http/HttpClient").HttpClient>;
|
|
148
|
+
/** Exports connector metrics over OTLP when telemetry is enabled. */
|
|
149
|
+
declare const layerOtlpMetrics: (options?: OtlpMetricsOptions) => Layer.Layer<never, Error | Config.ConfigError, import("effect/http/HttpClient").HttpClient>;
|
|
150
|
+
/** Enables OTLP traces and metrics with shared environment configuration. */
|
|
151
|
+
declare const layerOtlp: (options?: OtlpTracingOptions & OtlpMetricsOptions) => Layer.Layer<never, Error | Config.ConfigError, import("effect/http/HttpClient").HttpClient>;
|
|
152
|
+
/** Periodically logs the in-memory metric snapshot for local debugging. */
|
|
135
153
|
declare const layerMetricsConsoleDump: (interval?: Duration.Input) => Layer.Layer<never, never, never>;
|
|
136
154
|
//#endregion
|
|
155
|
+
//#region src/connector-app/create-table.d.ts
|
|
156
|
+
/** Creates the table command for a connector's row schemas. */
|
|
157
|
+
declare const makeCreateTableCommand: (schemas: Readonly<Record<string, Schema.Top>>) => Command.Command<"create-table", {
|
|
158
|
+
readonly table: string;
|
|
159
|
+
readonly catalog: string;
|
|
160
|
+
readonly location: Option.Option<string>;
|
|
161
|
+
readonly resource: Option.Option<string>;
|
|
162
|
+
}, {}, ConnectorError | import("effect/Config").ConfigError | CliError.UserError, import("effect/http/HttpClient").HttpClient>;
|
|
163
|
+
//#endregion
|
|
164
|
+
//#region src/connector-app/demo.d.ts
|
|
165
|
+
/** Reads sizes such as `512KiB`, `128MiB` or `1GiB`. */
|
|
166
|
+
declare const parseSize: (input: string) => Option.Option<number>;
|
|
167
|
+
/**
|
|
168
|
+
* Creates the command that writes the demo data to Wings, then exits.
|
|
169
|
+
* It reads Wings and table bindings from Config, so provide `RuntimeConfig.layerHosted()`.
|
|
170
|
+
*/
|
|
171
|
+
declare const makeDemoCommand: (demo: DemoDefinition) => Command.Command<"demo", {
|
|
172
|
+
readonly size: number;
|
|
173
|
+
readonly seed: number;
|
|
174
|
+
}, {}, ConnectorError, never>;
|
|
175
|
+
//#endregion
|
|
137
176
|
//#region src/connector-app/start.d.ts
|
|
138
177
|
type App = ConnectorDefinition;
|
|
139
178
|
type StartOptions = {
|
|
140
179
|
readonly port: number;
|
|
141
|
-
readonly initialCutoff?: Cursor.Value;
|
|
180
|
+
readonly initialCutoff?: Cursor$1.Value;
|
|
142
181
|
readonly healthPath?: HttpRouter.PathInput;
|
|
143
182
|
readonly metricsPath?: HttpRouter.PathInput | false;
|
|
144
183
|
readonly statusPath?: HttpRouter.PathInput | false;
|
|
145
184
|
readonly disableHttpLogger?: boolean;
|
|
146
185
|
};
|
|
147
|
-
declare const start: (app: App, options: StartOptions) => Effect.Effect<void, ConnectorError |
|
|
186
|
+
declare const start: (app: App, options: StartOptions) => Effect.Effect<void, ConnectorError | import("effect/http/HttpServerError").ServeError, StateStore | Ingestor>;
|
|
148
187
|
declare namespace index_d_exports {
|
|
149
|
-
export { App, CheckOptions, CheckResult, ResourceCheckResult, StartOptions, check, start };
|
|
188
|
+
export { App, CheckOptions, CheckResult, ResourceCheckResult, StartOptions, check, makeCreateTableCommand, makeDemoCommand, parseSize, start };
|
|
150
189
|
}
|
|
151
190
|
//#endregion
|
|
152
|
-
export {
|
|
153
|
-
//# sourceMappingURL=index-
|
|
191
|
+
export { makeDemoCommand as a, telemetry_d_exports as c, Fetch as d, Resource as f, check as g, ResourceCheckResult as h, start as i, Connector as l, CheckResult as m, App as n, parseSize as o, CheckOptions as p, StartOptions as r, makeCreateTableCommand as s, index_d_exports as t, Cursor as u };
|
|
192
|
+
//# sourceMappingURL=index-NnCutIqM.d.mts.map
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { Config, Option, Redacted, Schema, Types } from "effect";
|
|
2
|
-
import * as effect_Effect0 from "effect/Effect";
|
|
3
|
-
|
|
4
2
|
//#region src/manifest/number-schema.d.ts
|
|
5
3
|
type NumberConstraints = {
|
|
6
4
|
readonly integer?: boolean;
|
|
@@ -46,28 +44,28 @@ type ConfigFieldSpec = ConfigFieldDefinition & {
|
|
|
46
44
|
readonly name: string;
|
|
47
45
|
};
|
|
48
46
|
/** Pairs an Effect runtime config with the metadata used to generate its form field. */
|
|
49
|
-
type ConfigField<A
|
|
50
|
-
readonly config: Config.Config<A
|
|
47
|
+
type ConfigField<A> = {
|
|
48
|
+
readonly config: Config.Config<A>;
|
|
51
49
|
readonly spec: ConfigFieldDefinition;
|
|
52
50
|
};
|
|
53
51
|
type FieldBaseOptions = {
|
|
54
52
|
readonly runtimeKey: string;
|
|
55
53
|
readonly description?: string;
|
|
56
54
|
};
|
|
57
|
-
type FieldOptions<A
|
|
55
|
+
type FieldOptions<A extends string | number | boolean = string | number | boolean> = FieldBaseOptions & ({
|
|
58
56
|
readonly required?: true;
|
|
59
|
-
readonly default?: A
|
|
57
|
+
readonly default?: A;
|
|
60
58
|
} | {
|
|
61
59
|
readonly required: false;
|
|
62
|
-
readonly default: A
|
|
60
|
+
readonly default: A;
|
|
63
61
|
});
|
|
64
62
|
type NumberFieldOptions = FieldOptions<number> & NumberConstraints;
|
|
65
63
|
type FieldsRecord = Record<string, ConfigField<unknown>>;
|
|
66
|
-
type ConfigOf<Fields
|
|
64
|
+
type ConfigOf<Fields extends FieldsRecord> = { readonly [Key in keyof Fields]: Fields[Key] extends ConfigField<infer A> ? A : never; };
|
|
67
65
|
/** Effect config and serializable manifest metadata produced from one field definition. */
|
|
68
|
-
type ConnectorConfigDef<Fields
|
|
69
|
-
readonly fields: { readonly [Key in keyof Fields
|
|
70
|
-
readonly config: Config.Config<ConfigOf<Fields
|
|
66
|
+
type ConnectorConfigDef<Fields extends FieldsRecord> = {
|
|
67
|
+
readonly fields: { readonly [Key in keyof Fields]: Fields[Key] extends ConfigField<infer A> ? Config.Config<A> : never; };
|
|
68
|
+
readonly config: Config.Config<ConfigOf<Fields>>;
|
|
71
69
|
readonly spec: ReadonlyArray<ConfigFieldSpec>;
|
|
72
70
|
};
|
|
73
71
|
type ConfigValuesOf<Def extends ConnectorConfigDef<FieldsRecord>> = Def extends ConnectorConfigDef<infer Fields> ? ConfigOf<Fields> : never;
|
|
@@ -86,7 +84,7 @@ declare const secret: (options: FieldBaseOptions & {
|
|
|
86
84
|
readonly required?: true;
|
|
87
85
|
}) => ConfigField<Redacted.Redacted<string>>;
|
|
88
86
|
/** Makes an existing field optional and represents a missing value as `Option.none()`. */
|
|
89
|
-
declare const optional: <A
|
|
87
|
+
declare const optional: <A>(field: ConfigField<A>) => ConfigField<Option.Option<A>>;
|
|
90
88
|
/**
|
|
91
89
|
* Defines user-facing connector config once for both Effect runtime loading and
|
|
92
90
|
* frontend form generation. The object keys become logical form/API field names;
|
|
@@ -103,7 +101,7 @@ declare const optional: <A$1>(field: ConfigField<A$1>) => ConfigField<Option.Opt
|
|
|
103
101
|
* const formFields = config.spec;
|
|
104
102
|
* ```
|
|
105
103
|
*/
|
|
106
|
-
declare const define: <const Fields
|
|
104
|
+
declare const define$1: <const Fields extends FieldsRecord>(fields: Fields) => ConnectorConfigDef<Fields>;
|
|
107
105
|
//#endregion
|
|
108
106
|
//#region src/manifest/manifest.d.ts
|
|
109
107
|
type ResourceCapability = "backfill" | "changes" | "webhook";
|
|
@@ -131,11 +129,11 @@ type ConnectorManifest = {
|
|
|
131
129
|
* });
|
|
132
130
|
* ```
|
|
133
131
|
*/
|
|
134
|
-
declare const define
|
|
132
|
+
declare const define: <const Manifest extends ConnectorManifest>(manifest: Manifest) => Manifest;
|
|
135
133
|
//#endregion
|
|
136
134
|
//#region src/manifest/schema.d.ts
|
|
137
|
-
type FieldValueOf<Field
|
|
138
|
-
type ConnectorConfigValues<Manifest extends ConnectorManifest> = Types.Simplify<{ readonly [Field in Manifest["config"][number] as Field["required"] extends true ? Field["name"] : never]: FieldValueOf<Field
|
|
135
|
+
type FieldValueOf<Field extends ConfigFieldSpec> = Field["type"] extends "number" ? number : Field["type"] extends "boolean" ? boolean : Field["values"] extends ReadonlyArray<string> ? Field["values"][number] : string;
|
|
136
|
+
type ConnectorConfigValues<Manifest extends ConnectorManifest> = Types.Simplify<{ readonly [Field in Manifest["config"][number] as Field["required"] extends true ? Field["name"] : never]: FieldValueOf<Field>; } & { readonly [Field in Manifest["config"][number] as Field["required"] extends true ? never : Field["name"]]?: FieldValueOf<Field> | undefined; }> & object;
|
|
139
137
|
type ConnectorConfigSchema<Manifest extends ConnectorManifest> = Schema.Codec<ConnectorConfigValues<Manifest>, unknown>;
|
|
140
138
|
/** Flat primitive document keyed by the runtime keys consumed by Effect Config. */
|
|
141
139
|
type RuntimeConfigDocument = Readonly<Record<string, string | number | boolean>>;
|
|
@@ -153,7 +151,7 @@ type RuntimeConfigDocument = Readonly<Record<string, string | number | boolean>>
|
|
|
153
151
|
*/
|
|
154
152
|
declare const configSchema: <const Manifest extends ConnectorManifest>(manifest: Manifest) => ConnectorConfigSchema<Manifest>;
|
|
155
153
|
/** Decodes browser/API config, applies manifest defaults, and rejects undeclared fields. */
|
|
156
|
-
declare const decodeConfig: <const Manifest extends ConnectorManifest>(manifest: Manifest, input: unknown) =>
|
|
154
|
+
declare const decodeConfig: <const Manifest extends ConnectorManifest>(manifest: Manifest, input: unknown) => import("effect/Effect").Effect<ConnectorConfigValues<Manifest>, Schema.SchemaError, never>;
|
|
157
155
|
/**
|
|
158
156
|
* Maps validated logical values to the flat runtime-key document mounted in a pod.
|
|
159
157
|
* Missing optional values are omitted.
|
|
@@ -166,8 +164,8 @@ declare const decodeConfig: <const Manifest extends ConnectorManifest>(manifest:
|
|
|
166
164
|
*/
|
|
167
165
|
declare const toRuntimeDocument: <const Manifest extends ConnectorManifest>(manifest: Manifest, values: ConnectorConfigValues<Manifest>) => RuntimeConfigDocument;
|
|
168
166
|
declare namespace index_d_exports {
|
|
169
|
-
export { ConfigField, ConfigFieldSpec, ConfigValuesOf, ConnectorConfigDef, ConnectorConfigSchema, ConnectorConfigValues, ConnectorManifest, ResourceCapability, RuntimeConfigDocument, boolean, configSchema, decodeConfig, define
|
|
167
|
+
export { ConfigField, ConfigFieldSpec, ConfigValuesOf, ConnectorConfigDef, ConnectorConfigSchema, ConnectorConfigValues, ConnectorManifest, ResourceCapability, RuntimeConfigDocument, boolean, configSchema, decodeConfig, define, define$1 as defineConfig, number, optional, secret, select, string, toRuntimeDocument };
|
|
170
168
|
}
|
|
171
169
|
//#endregion
|
|
172
|
-
export { number as _, configSchema as a, select as b, ConnectorManifest as c, ConfigField as d, ConfigFieldSpec as f, define as g, boolean as h, RuntimeConfigDocument as i, ResourceCapability as l, ConnectorConfigDef as m, ConnectorConfigSchema as n, decodeConfig as o, ConfigValuesOf as p, ConnectorConfigValues as r, toRuntimeDocument as s, index_d_exports as t, define
|
|
173
|
-
//# sourceMappingURL=index-
|
|
170
|
+
export { number as _, configSchema as a, select as b, ConnectorManifest as c, ConfigField as d, ConfigFieldSpec as f, define$1 as g, boolean as h, RuntimeConfigDocument as i, ResourceCapability as l, ConnectorConfigDef as m, ConnectorConfigSchema as n, decodeConfig as o, ConfigValuesOf as p, ConnectorConfigValues as r, toRuntimeDocument as s, index_d_exports as t, define as u, optional as v, string as x, secret as y };
|
|
171
|
+
//# sourceMappingURL=index-eFuoMZZ3.d.mts.map
|