@useairfoil/connector-kit 0.6.0 → 0.7.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/LICENSE.txt +201 -0
- package/METRICS.md +38 -42
- package/README.md +111 -444
- package/dist/annotations-vzSzXtr-.d.mts +34 -0
- package/dist/arrow-flight-DDQ0ktx9.mjs +251 -0
- package/dist/arrow-flight-DDQ0ktx9.mjs.map +1 -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-C6_dZnhE.mjs +256 -0
- package/dist/connector-app-C6_dZnhE.mjs.map +1 -0
- package/dist/{constants-D113Ut1x.js → constants-v3UX-hf6.mjs} +5 -5
- package/dist/constants-v3UX-hf6.mjs.map +1 -0
- package/dist/demo/index.d.mts +2 -0
- package/dist/demo/index.mjs +2 -0
- package/dist/demo-DqTJ7TWI.mjs +204 -0
- package/dist/demo-DqTJ7TWI.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-Cj2PwlNm.mjs +30 -0
- package/dist/iceberg-Cj2PwlNm.mjs.map +1 -0
- package/dist/index-BTAbexBp.d.mts +55 -0
- package/dist/{index-DXa26Ry5.d.ts → index-BX8G7d41.d.mts} +1 -2
- package/dist/{index-VpHaZXZw.d.ts → index-Byr8NTdG.d.mts} +11 -13
- package/dist/index-CV6V6fyx.d.mts +79 -0
- package/dist/{index-C5Ma7V7t.d.ts → index-CZKx2Yce.d.mts} +72 -37
- package/dist/{index-DYpEMJf-.d.ts → index-CgvFomO6.d.mts} +6 -7
- package/dist/{index-bfjH7Yb0.d.ts → index-DeTwIUKl.d.mts} +9 -10
- package/dist/{index-DKoRwyFn.d.ts → index-DkVNO6ks.d.mts} +2 -5
- package/dist/{index-BKw7jA2a.d.ts → index-dHS59EZl.d.mts} +10 -8
- package/dist/{index-CR9HJDdr.d.ts → index-eFuoMZZ3.d.mts} +18 -20
- package/dist/{index-ZSuiZX5H.d.ts → index-fHIJJoRe.d.mts} +25 -30
- package/dist/index-uFa2wwYo.d.mts +27 -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-DoCUwm5N.mjs +275 -0
- package/dist/ingestion-DoCUwm5N.mjs.map +1 -0
- package/dist/ingestor/index.d.mts +3 -0
- package/dist/ingestor/index.mjs +4 -0
- package/dist/ingestor-DjCEzBzZ.mjs +26 -0
- package/dist/ingestor-DjCEzBzZ.mjs.map +1 -0
- package/dist/instrumented-Bq1WX2L5.mjs +29 -0
- package/dist/instrumented-Bq1WX2L5.mjs.map +1 -0
- package/dist/manifest/index.d.mts +2 -0
- package/dist/manifest/{index.js → index.mjs} +2 -4
- package/dist/{manifest-P7kBnch9.js → manifest-CABeIhAG.mjs} +14 -19
- package/dist/manifest-CABeIhAG.mjs.map +1 -0
- package/dist/{telemetry-j_nxwYfh.js → metrics-C901IIYZ.mjs} +172 -26
- package/dist/metrics-C901IIYZ.mjs.map +1 -0
- package/dist/{metrics-C4V1pm6v.d.ts → metrics-DoJ0WeKu.d.mts} +18 -13
- 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-Bn8Fivt1.mjs +100 -0
- package/dist/runtime-config-Bn8Fivt1.mjs.map +1 -0
- package/dist/server-D1TTN0_D.mjs +144 -0
- package/dist/server-D1TTN0_D.mjs.map +1 -0
- package/dist/service-BRoy_EId.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-BdYulQOY.js → state-store-DhSrKVEH.mjs} +15 -22
- package/dist/state-store-DhSrKVEH.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-BTTd7AUR.js → status-4h6Oxh-O.mjs} +14 -16
- package/dist/status-4h6Oxh-O.mjs.map +1 -0
- package/dist/table-CxM09xf7.mjs +307 -0
- package/dist/table-CxM09xf7.mjs.map +1 -0
- package/dist/types-NtSv6gwl.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/package.json +72 -58
- package/src/catalog/retry.ts +25 -0
- package/src/catalog/table.ts +237 -0
- package/src/connector-app/create-table.ts +47 -0
- package/src/connector-app/demo.ts +47 -0
- package/src/connector-app/index.ts +3 -0
- package/src/connector-app/setup.ts +69 -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 +172 -0
- package/src/iceberg/annotations.ts +49 -0
- package/src/iceberg/error.ts +9 -0
- package/src/iceberg/index.ts +3 -0
- package/src/iceberg/table.ts +461 -0
- package/src/index.ts +3 -1
- package/src/ingestion/engine.ts +240 -60
- package/src/ingestor/arrow-flight.ts +141 -0
- package/src/ingestor/arrow.ts +248 -0
- package/src/ingestor/console.ts +13 -0
- package/src/ingestor/index.ts +13 -0
- package/src/ingestor/instrumented.ts +61 -0
- package/src/ingestor/service.ts +30 -0
- package/src/manifest/config.ts +3 -3
- package/src/metrics.ts +66 -20
- package/src/runtime-config/config.ts +11 -8
- package/src/runtime-config/constants.ts +3 -2
- package/src/runtime-config/index.ts +2 -7
- package/src/runtime-config/layer.ts +1 -1
- package/src/runtime-config/table-bindings.ts +50 -136
- 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 +20 -28
- 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 -12
- package/dist/connector-app-BljHd0Pe.js +0 -64
- package/dist/connector-app-BljHd0Pe.js.map +0 -1
- package/dist/constants-D113Ut1x.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-BA8ASHKr.d.ts +0 -31
- package/dist/index.d.ts +0 -14
- package/dist/index.js +0 -60
- package/dist/index.js.map +0 -1
- package/dist/ingestion/index.d.ts +0 -6
- package/dist/ingestion/index.js +0 -11
- package/dist/ingestion-QBGKrFr9.js +0 -200
- package/dist/ingestion-QBGKrFr9.js.map +0 -1
- package/dist/manifest/index.d.ts +0 -2
- package/dist/manifest-P7kBnch9.js.map +0 -1
- package/dist/metrics-inkCAxKq.js +0 -136
- package/dist/metrics-inkCAxKq.js.map +0 -1
- package/dist/metrics.d.ts +0 -4
- package/dist/metrics.js +0 -5
- package/dist/publisher/index.d.ts +0 -6
- package/dist/publisher/index.js +0 -8
- package/dist/publisher-BdWJOfer.js +0 -138
- package/dist/publisher-BdWJOfer.js.map +0 -1
- package/dist/runtime-config/index.d.ts +0 -4
- package/dist/runtime-config/index.js +0 -5
- package/dist/runtime-config-IbyCVpei.js +0 -60
- package/dist/runtime-config-IbyCVpei.js.map +0 -1
- package/dist/server-D-eLX3yN.js +0 -183
- package/dist/server-D-eLX3yN.js.map +0 -1
- package/dist/service-CUjGhe-7.d.ts +0 -32
- package/dist/service-DiP-XETo.js +0 -8
- package/dist/service-DiP-XETo.js.map +0 -1
- package/dist/state-store/index.d.ts +0 -3
- package/dist/state-store/index.js +0 -5
- package/dist/state-store-BdYulQOY.js.map +0 -1
- package/dist/status-BTTd7AUR.js.map +0 -1
- package/dist/table-bindings-Dp1DhTeS.js +0 -106
- package/dist/table-bindings-Dp1DhTeS.js.map +0 -1
- package/dist/telemetry-j_nxwYfh.js.map +0 -1
- package/dist/types-jVD5Ys43.d.ts +0 -174
- package/dist/webhook/index.d.ts +0 -7
- package/dist/webhook/index.js +0 -9
- package/dist/webhook-MhFcLW-o.js +0 -13
- package/dist/webhook-MhFcLW-o.js.map +0 -1
- package/src/publisher/console.ts +0 -18
- package/src/publisher/index.ts +0 -7
- package/src/publisher/instrumented.ts +0 -75
- package/src/publisher/service.ts +0 -37
- package/src/publisher/wings.ts +0 -204
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { t as ConnectorError } from "./index-DkVNO6ks.mjs";
|
|
2
|
+
import { _ as ResourceRequiredField, b as ResourceSchema } from "./types-NtSv6gwl.mjs";
|
|
3
|
+
import { i as Ingestor, n as IngestResult } from "./service-BRoy_EId.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 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, 1000 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
|
+
/** Omit for random data on each run. */
|
|
57
|
+
readonly seed?: number;
|
|
58
|
+
/** The time data is made around. Same seed, time and tables give the same rows. */
|
|
59
|
+
readonly now: Date;
|
|
60
|
+
/** Maximum rows per ingestion batch. Defaults to 500. Must be a positive integer. */
|
|
61
|
+
readonly batchSize?: number;
|
|
62
|
+
/** Groups per chunk. Overrides the demo's. */
|
|
63
|
+
readonly groupsPerChunk?: number;
|
|
64
|
+
};
|
|
65
|
+
type DemoTotals = IngestResult & {
|
|
66
|
+
readonly tables: Readonly<Record<string, IngestResult>>;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Writes the setup rows, then groups, until it reaches the size or the demo's
|
|
70
|
+
* count. It can go over the size by one chunk. Only bound tables are
|
|
71
|
+
* written; keys still point to the others.
|
|
72
|
+
*/
|
|
73
|
+
declare const run: (demo: DemoDefinition, options: RunOptions) => Effect.Effect<DemoTotals, ConnectorError, Ingestor>;
|
|
74
|
+
declare namespace index_d_exports {
|
|
75
|
+
export { DemoContext, DemoDefinition, DemoRows, DemoTable, DemoTotals, RunOptions, define, run, table };
|
|
76
|
+
}
|
|
77
|
+
//#endregion
|
|
78
|
+
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 };
|
|
79
|
+
//# sourceMappingURL=index-CV6V6fyx.d.mts.map
|
|
@@ -1,12 +1,22 @@
|
|
|
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-vzSzXtr-.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-NtSv6gwl.mjs";
|
|
5
|
+
import { a as DemoDefinition } from "./index-CV6V6fyx.mjs";
|
|
6
|
+
import { i as Ingestor } from "./service-BRoy_EId.mjs";
|
|
7
|
+
import "./index-BTAbexBp.mjs";
|
|
8
|
+
import { i as StateStore } from "./index-CgvFomO6.mjs";
|
|
9
|
+
import "./index-DeTwIUKl.mjs";
|
|
10
|
+
import "./index-uFa2wwYo.mjs";
|
|
11
|
+
import { f as RuntimeConfigError, t as index_d_exports$1 } from "./index-fHIJJoRe.mjs";
|
|
12
|
+
import "./index-eFuoMZZ3.mjs";
|
|
13
|
+
import "./metrics-DoJ0WeKu.mjs";
|
|
14
|
+
import "./index-Byr8NTdG.mjs";
|
|
15
|
+
import "./index-dHS59EZl.mjs";
|
|
16
|
+
import { Config, Context, Duration, Effect, Layer, Option, Schema } from "effect";
|
|
17
|
+
import { CliError, Command } from "effect/cli";
|
|
18
|
+
import { CatalogManager } from "@useairfoil/api";
|
|
19
|
+
import { HttpRouter } from "effect/http";
|
|
10
20
|
//#region src/connector-app/check.d.ts
|
|
11
21
|
type ResourceCheckResult = {
|
|
12
22
|
readonly _tag: "ok";
|
|
@@ -17,7 +27,7 @@ type ResourceCheckResult = {
|
|
|
17
27
|
type CheckOptions<Name extends string> = {
|
|
18
28
|
readonly resources: ReadonlyArray<Name>;
|
|
19
29
|
};
|
|
20
|
-
type ResourceCheckResults<Name extends PropertyKey> = { readonly [Key in Name]: ResourceCheckResult };
|
|
30
|
+
type ResourceCheckResults<Name extends PropertyKey> = { readonly [Key in Name]: ResourceCheckResult; };
|
|
21
31
|
type CheckResult<Resources extends ReadonlyArray<ResourceDefinition>, Name extends ResourceName<Resources> = ResourceName<Resources>> = ResourceCheckResults<Name>;
|
|
22
32
|
type CheckFailure = {
|
|
23
33
|
readonly message: string;
|
|
@@ -30,25 +40,20 @@ declare function check<Identifier, const Resources extends ReadonlyArray<Resourc
|
|
|
30
40
|
//#endregion
|
|
31
41
|
//#region src/core/builder.d.ts
|
|
32
42
|
declare const Connector: {
|
|
33
|
-
define: <const Resources extends ReadonlyArray<ResourceDefinition
|
|
43
|
+
define: <const Resources extends ReadonlyArray<ResourceDefinition>, const FeedResources extends ReadonlyArray<Resources[number]> = Resources>(definition: ConnectorDefinition<Resources, FeedResources>) => ConnectorDefinition<Resources, FeedResources>;
|
|
34
44
|
};
|
|
35
45
|
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>;
|
|
46
|
+
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
47
|
};
|
|
44
48
|
declare const Fetch: {
|
|
45
49
|
page: <Row extends object = never, R = never>(definition: PageFetch<Row, R>) => PageFetch<Row, R>;
|
|
46
50
|
changes: <Row extends object = never, R = never>(definition: ChangesFetch<Row, R>) => ChangesFetch<Row, R>;
|
|
51
|
+
feed: <const Resources extends ReadonlyArray<ResourceDefinition>, R = never>(definition: ChangesFeed<Resources, R>) => ChangesFeed<Resources, R>;
|
|
47
52
|
};
|
|
48
|
-
declare const Cursor
|
|
49
|
-
string: () => Cursor.Definition<string>;
|
|
50
|
-
number: () => Cursor.Definition<number>;
|
|
51
|
-
isoDateTime: () => Cursor.Definition<string>;
|
|
53
|
+
declare const Cursor: {
|
|
54
|
+
string: () => Cursor$1.Definition<string>;
|
|
55
|
+
number: () => Cursor$1.Definition<number>;
|
|
56
|
+
isoDateTime: () => Cursor$1.Definition<string>;
|
|
52
57
|
nowIsoDateTime: Effect.Effect<string, never, never>;
|
|
53
58
|
};
|
|
54
59
|
declare namespace telemetry_d_exports {
|
|
@@ -59,7 +64,7 @@ declare const SpanName: {
|
|
|
59
64
|
readonly batchProcess: "connector.batch.process";
|
|
60
65
|
readonly webhookDecode: "connector.webhook.decode";
|
|
61
66
|
readonly webhookHandle: "connector.webhook.handle";
|
|
62
|
-
readonly
|
|
67
|
+
readonly ingest: "connector.ingest";
|
|
63
68
|
readonly stateSet: "connector.state.set";
|
|
64
69
|
readonly apiFetch: "connector.api.fetch";
|
|
65
70
|
};
|
|
@@ -69,13 +74,13 @@ declare const Attr: {
|
|
|
69
74
|
readonly connectorResourcesCount: "airfoil.connector.resources.count";
|
|
70
75
|
readonly resourceName: "airfoil.resource.name";
|
|
71
76
|
readonly resourceSource: "airfoil.resource.source";
|
|
72
|
-
readonly
|
|
77
|
+
readonly batchRows: "airfoil.batch.rows";
|
|
73
78
|
readonly batchOutcome: "airfoil.batch.outcome";
|
|
74
79
|
readonly webhookPath: "airfoil.webhook.path";
|
|
75
80
|
readonly webhookOutcome: "airfoil.webhook.outcome";
|
|
76
81
|
readonly syncState: "airfoil.connector.sync.state";
|
|
77
82
|
readonly apiRetryReason: "airfoil.connector.api.retry.reason";
|
|
78
|
-
readonly
|
|
83
|
+
readonly ingestionSuccess: "airfoil.ingestion.success";
|
|
79
84
|
readonly stateKey: "airfoil.state.key";
|
|
80
85
|
readonly apiPath: "airfoil.api.path";
|
|
81
86
|
readonly errorPhase: "airfoil.error.phase";
|
|
@@ -120,18 +125,18 @@ type OtlpMetricsOptions = {
|
|
|
120
125
|
* Trace-only OTLP export with sensitive HTTP header redaction.
|
|
121
126
|
* Takes direct config values — no `ConfigProvider` required.
|
|
122
127
|
*/
|
|
123
|
-
declare const layer: (config?: OtlpTracingConfig, options?: OtlpTracingOptions) => Layer.Layer<never, Error,
|
|
128
|
+
declare const layer: (config?: OtlpTracingConfig, options?: OtlpTracingOptions) => Layer.Layer<never, Error, import("effect/http/HttpClient").HttpClient>;
|
|
124
129
|
/**
|
|
125
130
|
* Trace-only OTLP export with sensitive HTTP header redaction.
|
|
126
131
|
* Takes Effect Config-wrapped values — reads from `ConfigProvider`.
|
|
127
132
|
*
|
|
128
133
|
* @example
|
|
129
134
|
* Telemetry.layerConfig({
|
|
130
|
-
* enabled: Config.
|
|
131
|
-
* endpoint: Config.
|
|
135
|
+
* enabled: Config.Boolean("MY_OTEL_ENABLED"),
|
|
136
|
+
* endpoint: Config.String("MY_COLLECTOR_URL"),
|
|
132
137
|
* })
|
|
133
138
|
*/
|
|
134
|
-
declare const layerConfig: (config: Config.Wrap<OtlpTracingConfig>, options?: OtlpTracingOptions) => Layer.Layer<never, Error | Config.ConfigError,
|
|
139
|
+
declare const layerConfig: (config: Config.Wrap<OtlpTracingConfig>, options?: OtlpTracingOptions) => Layer.Layer<never, Error | Config.ConfigError, import("effect/http/HttpClient").HttpClient>;
|
|
135
140
|
/**
|
|
136
141
|
* Trace-only OTLP export with sensitive HTTP header redaction.
|
|
137
142
|
* Zero-config shortcut that reads the standard `OTEL_*` env var names.
|
|
@@ -140,28 +145,58 @@ declare const layerConfig: (config: Config.Wrap<OtlpTracingConfig>, options?: Ot
|
|
|
140
145
|
* `OTEL_EXPORTER_OTLP_HEADERS`. Effect's OTLP resource handling reads
|
|
141
146
|
* `OTEL_SERVICE_NAME`, `OTEL_SERVICE_VERSION`, and `OTEL_RESOURCE_ATTRIBUTES`.
|
|
142
147
|
*/
|
|
143
|
-
declare const layerOtlpTracing: (options?: OtlpTracingOptions) => Layer.Layer<never, Error | Config.ConfigError,
|
|
148
|
+
declare const layerOtlpTracing: (options?: OtlpTracingOptions) => Layer.Layer<never, Error | Config.ConfigError, import("effect/http/HttpClient").HttpClient>;
|
|
144
149
|
/** Exports connector metrics over OTLP when telemetry is enabled. */
|
|
145
|
-
declare const layerOtlpMetrics: (options?: OtlpMetricsOptions) => Layer.Layer<never, Error | Config.ConfigError,
|
|
150
|
+
declare const layerOtlpMetrics: (options?: OtlpMetricsOptions) => Layer.Layer<never, Error | Config.ConfigError, import("effect/http/HttpClient").HttpClient>;
|
|
146
151
|
/** Enables OTLP traces and metrics with shared environment configuration. */
|
|
147
|
-
declare const layerOtlp: (options?: OtlpTracingOptions & OtlpMetricsOptions) => Layer.Layer<never, Error | Config.ConfigError,
|
|
152
|
+
declare const layerOtlp: (options?: OtlpTracingOptions & OtlpMetricsOptions) => Layer.Layer<never, Error | Config.ConfigError, import("effect/http/HttpClient").HttpClient>;
|
|
148
153
|
/** Periodically logs the in-memory metric snapshot for local debugging. */
|
|
149
154
|
declare const layerMetricsConsoleDump: (interval?: Duration.Input) => Layer.Layer<never, never, never>;
|
|
150
155
|
//#endregion
|
|
156
|
+
//#region src/connector-app/create-table.d.ts
|
|
157
|
+
/** Creates the table command; existing tables must match the connector's row schemas. */
|
|
158
|
+
declare const makeCreateTableCommand: (schemas: Readonly<Record<string, Schema.Top>>) => Command.Command<"create-table", {
|
|
159
|
+
readonly table: string;
|
|
160
|
+
readonly catalog: string;
|
|
161
|
+
readonly location: Option.Option<string>;
|
|
162
|
+
readonly resource: Option.Option<string>;
|
|
163
|
+
}, {}, ConnectorError | import("effect/Config").ConfigError | CliError.UserError, import("effect/http/HttpClient").HttpClient>;
|
|
164
|
+
//#endregion
|
|
165
|
+
//#region src/connector-app/demo.d.ts
|
|
166
|
+
/** Reads byte sizes such as `512kB`, `128MB` or `1.5GB`. */
|
|
167
|
+
declare const parseSize: (input: string) => Option.Option<number>;
|
|
168
|
+
/**
|
|
169
|
+
* Creates the command that writes demo data over Arrow Flight, then exits.
|
|
170
|
+
* It reads hosted config and table bindings, so provide `RuntimeConfig.layerHosted()`.
|
|
171
|
+
*/
|
|
172
|
+
declare const makeDemoCommand: (demo: DemoDefinition) => Command.Command<"demo", {
|
|
173
|
+
readonly size: number;
|
|
174
|
+
readonly seed: Option.Option<number>;
|
|
175
|
+
readonly batchSize: Option.Option<number>;
|
|
176
|
+
}, {}, ConnectorError, never>;
|
|
177
|
+
//#endregion
|
|
151
178
|
//#region src/connector-app/start.d.ts
|
|
152
179
|
type App = ConnectorDefinition;
|
|
153
180
|
type StartOptions = {
|
|
154
181
|
readonly port: number;
|
|
155
|
-
readonly initialCutoff?: Cursor.Value;
|
|
182
|
+
readonly initialCutoff?: Cursor$1.Value;
|
|
156
183
|
readonly healthPath?: HttpRouter.PathInput;
|
|
157
184
|
readonly metricsPath?: HttpRouter.PathInput | false;
|
|
158
185
|
readonly statusPath?: HttpRouter.PathInput | false;
|
|
159
186
|
readonly disableHttpLogger?: boolean;
|
|
160
187
|
};
|
|
161
|
-
declare const start: (app: App, options: StartOptions) => Effect.Effect<void, ConnectorError |
|
|
188
|
+
declare const start: (app: App, options: StartOptions) => Effect.Effect<void, ConnectorError | import("effect/http/HttpServerError").ServeError, StateStore | Ingestor>;
|
|
189
|
+
//#endregion
|
|
190
|
+
//#region src/connector-app/setup.d.ts
|
|
191
|
+
/** Creates or verifies all bound tables without loading provider credentials. */
|
|
192
|
+
declare const makeSetupCommand: (schemas: Readonly<Record<string, Schema.Top>>) => Command.Command<"setup", {
|
|
193
|
+
readonly checkpointIntervalSec: Option.Option<number>;
|
|
194
|
+
readonly retryInterval: Duration.Duration;
|
|
195
|
+
readonly retries: number;
|
|
196
|
+
}, {}, ConnectorError | import("effect/Config").ConfigError | RuntimeConfigError | CatalogManager.CatalogManagerError, import("effect/http/HttpClient").HttpClient | import("effect/Scope").Scope>;
|
|
162
197
|
declare namespace index_d_exports {
|
|
163
|
-
export { App, CheckOptions, CheckResult, ResourceCheckResult, StartOptions, check, start };
|
|
198
|
+
export { App, CheckOptions, CheckResult, ResourceCheckResult, StartOptions, check, makeCreateTableCommand, makeDemoCommand, makeSetupCommand, parseSize, start };
|
|
164
199
|
}
|
|
165
200
|
//#endregion
|
|
166
|
-
export {
|
|
167
|
-
//# sourceMappingURL=index-
|
|
201
|
+
export { check as _, start as a, makeCreateTableCommand as c, Cursor as d, Fetch as f, ResourceCheckResult as g, CheckResult as h, StartOptions as i, telemetry_d_exports as l, CheckOptions as m, makeSetupCommand as n, makeDemoCommand as o, Resource as p, App as r, parseSize as s, index_d_exports as t, Connector as u };
|
|
202
|
+
//# sourceMappingURL=index-CZKx2Yce.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
|
|
@@ -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-NtSv6gwl.mjs";
|
|
3
|
+
import { i as Ingestor } from "./service-BRoy_EId.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-DeTwIUKl.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,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-NtSv6gwl.mjs";
|
|
2
|
+
import { i as Ingestor } from "./service-BRoy_EId.mjs";
|
|
3
|
+
import "./index-uFa2wwYo.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-dHS59EZl.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
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import { f as ResourceName, n as ConnectorDefinition } from "./types-jVD5Ys43.js";
|
|
2
1
|
import { Config, Effect, FileSystem } from "effect";
|
|
3
|
-
import
|
|
4
|
-
import * as effect_Types0 from "effect/Types";
|
|
5
|
-
import * as effect_Cause0 from "effect/Cause";
|
|
6
|
-
import * as effect_Layer0 from "effect/Layer";
|
|
7
|
-
|
|
2
|
+
import { TableIdentifier } from "iceberg-js";
|
|
8
3
|
//#region src/runtime-config/error.d.ts
|
|
9
4
|
type RuntimeConfigErrorCode = "CONFIG_PATH_MISSING" | "CONFIG_FILE_UNREADABLE" | "CONFIG_JSON_INVALID" | "TABLE_BINDINGS_MISSING" | "TABLE_BINDINGS_INVALID" | "TABLE_BINDINGS_MISMATCH";
|
|
10
|
-
declare const RuntimeConfigError_base: new <A extends Record<string, any> = {}>(args:
|
|
5
|
+
declare const RuntimeConfigError_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 & {
|
|
11
6
|
readonly _tag: "RuntimeConfigError";
|
|
12
7
|
} & Readonly<A>;
|
|
13
8
|
/** Expected hosted-config failure with a stable code and diagnostic cause. */
|
|
@@ -20,11 +15,12 @@ declare class RuntimeConfigError extends RuntimeConfigError_base<{
|
|
|
20
15
|
//#region src/runtime-config/config.d.ts
|
|
21
16
|
/** Shared HTTP port used by hosted and sandbox connector entrypoints. */
|
|
22
17
|
declare const httpPort: Config.Config<number>;
|
|
23
|
-
/**
|
|
24
|
-
declare const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
/** Engine URL, including the protocol. */
|
|
19
|
+
declare const engineUri: Config.Config<URL>;
|
|
20
|
+
/** Arrow Flight URL. Uses the engine URL when unset. */
|
|
21
|
+
declare const flightUri: Config.Config<URL>;
|
|
22
|
+
/** Catalog ID. */
|
|
23
|
+
declare const catalog: Config.Config<string>;
|
|
28
24
|
//#endregion
|
|
29
25
|
//#region src/runtime-config/constants.d.ts
|
|
30
26
|
/** Shared runtime keys owned by Airfoil rather than an individual connector. */
|
|
@@ -35,8 +31,9 @@ declare const PlatformRuntimeKey: {
|
|
|
35
31
|
readonly connectorInstanceId: "AIRFOIL_CONNECTOR_INSTANCE_ID";
|
|
36
32
|
readonly stateTable: "AIRFOIL_STATE_TABLE";
|
|
37
33
|
readonly postgresConnectionString: "POSTGRES_CONNECTION_STRING";
|
|
38
|
-
readonly
|
|
39
|
-
readonly
|
|
34
|
+
readonly engineUri: "ENGINE_URI";
|
|
35
|
+
readonly flightUri: "FLIGHT_URI";
|
|
36
|
+
readonly catalog: "AIRFOIL_CATALOG";
|
|
40
37
|
readonly otelEnabled: "OTEL_ENABLED";
|
|
41
38
|
readonly otelExporterOtlpEndpoint: "OTEL_EXPORTER_OTLP_ENDPOINT";
|
|
42
39
|
readonly otelExporterOtlpHeaders: "OTEL_EXPORTER_OTLP_HEADERS";
|
|
@@ -60,26 +57,24 @@ declare const PlatformRuntimeDefault: {
|
|
|
60
57
|
* program.pipe(Effect.provide(layerHosted()));
|
|
61
58
|
* ```
|
|
62
59
|
*/
|
|
63
|
-
declare const layerHosted: () =>
|
|
60
|
+
declare const layerHosted: () => import("effect/Layer").Layer<never, RuntimeConfigError, FileSystem.FileSystem>;
|
|
64
61
|
//#endregion
|
|
65
62
|
//#region src/runtime-config/table-bindings.d.ts
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
type BindingSource = {
|
|
64
|
+
readonly resources: ReadonlyArray<{
|
|
65
|
+
readonly name: string;
|
|
66
|
+
}>;
|
|
70
67
|
};
|
|
71
|
-
/**
|
|
72
|
-
type
|
|
73
|
-
readonly
|
|
74
|
-
readonly partitionValue?: Wings.PartitionValue.PartitionValue;
|
|
68
|
+
/** An Iceberg table and its storage location for each connector resource. */
|
|
69
|
+
type TableBinding = TableIdentifier & {
|
|
70
|
+
readonly location?: string | undefined;
|
|
75
71
|
};
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
declare const loadTableBindings: <const Connector extends ConnectorDefinition>(connector: Connector) => Effect.Effect<ResolvedTableBindings<Connector>, RuntimeConfigError>;
|
|
72
|
+
type ResolvedTableBindings<Source extends BindingSource> = Readonly<Partial<Record<Source["resources"][number]["name"], TableBinding>>>;
|
|
73
|
+
/** Reads hosted table bindings and checks they name resources of the connector. */
|
|
74
|
+
declare const loadTableBindings: <const Source extends BindingSource>(connector: Source) => Effect.Effect<ResolvedTableBindings<Source>, RuntimeConfigError>;
|
|
80
75
|
declare namespace index_d_exports {
|
|
81
|
-
export {
|
|
76
|
+
export { PlatformRuntimeDefault, PlatformRuntimeKey, ResolvedTableBindings, RuntimeConfigError, RuntimeConfigErrorCode, TableBinding, catalog, engineUri, flightUri, httpPort, layerHosted, loadTableBindings };
|
|
82
77
|
}
|
|
83
78
|
//#endregion
|
|
84
|
-
export {
|
|
85
|
-
//# sourceMappingURL=index-
|
|
79
|
+
export { layerHosted as a, catalog as c, httpPort as d, RuntimeConfigError as f, loadTableBindings as i, engineUri as l, ResolvedTableBindings as n, PlatformRuntimeDefault as o, RuntimeConfigErrorCode as p, TableBinding as r, PlatformRuntimeKey as s, index_d_exports as t, flightUri as u };
|
|
80
|
+
//# sourceMappingURL=index-fHIJJoRe.d.mts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { t as ConnectorError } from "./index-DkVNO6ks.mjs";
|
|
2
|
+
import { E as TableSource } from "./types-NtSv6gwl.mjs";
|
|
3
|
+
import { a as IngestorService, i as Ingestor, n as IngestResult, r as IngestSource, t as IngestOptions } from "./service-BRoy_EId.mjs";
|
|
4
|
+
import { n as ResolvedTableBindings, t as index_d_exports$1 } from "./index-fHIJJoRe.mjs";
|
|
5
|
+
import { Layer } from "effect";
|
|
6
|
+
import { CatalogManager } from "@useairfoil/api";
|
|
7
|
+
//#region src/ingestor/console.d.ts
|
|
8
|
+
/** Logs batches without sending them over Arrow Flight. */
|
|
9
|
+
declare const layerConsole: Layer.Layer<Ingestor, never, never>;
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/ingestor/arrow-flight.d.ts
|
|
12
|
+
/** One catalog and an Iceberg table for each resource that runs. */
|
|
13
|
+
type ArrowFlightIngestorConfig<Source extends TableSource = TableSource> = {
|
|
14
|
+
readonly connector: Source;
|
|
15
|
+
readonly catalog: string;
|
|
16
|
+
readonly tables: ResolvedTableBindings<Source>;
|
|
17
|
+
};
|
|
18
|
+
/** Compiles local schemas and opens one Arrow Flight stream per bound resource. */
|
|
19
|
+
declare const layerArrowFlight: <const Source extends TableSource>(config: ArrowFlightIngestorConfig<Source>) => Layer.Layer<Ingestor, ConnectorError, CatalogManager.CatalogManager>;
|
|
20
|
+
/** Configures Arrow Flight ingestion from the hosted URL, catalog and table bindings. */
|
|
21
|
+
declare const layerArrowFlightConfig: (connector: TableSource) => Layer.Layer<Ingestor, ConnectorError, never>;
|
|
22
|
+
declare namespace index_d_exports {
|
|
23
|
+
export { ArrowFlightIngestorConfig, IngestOptions, IngestResult, IngestSource, Ingestor, IngestorService, layerArrowFlight, layerArrowFlightConfig, layerConsole };
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { layerConsole as a, layerArrowFlightConfig as i, ArrowFlightIngestorConfig as n, layerArrowFlight as r, index_d_exports as t };
|
|
27
|
+
//# sourceMappingURL=index-uFa2wwYo.d.mts.map
|