@chkit/plugin-ingest 0.2.0-beta.8
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/README.md +30 -0
- package/dist/destination.d.ts +40 -0
- package/dist/destination.d.ts.map +1 -0
- package/dist/destination.js +63 -0
- package/dist/destination.js.map +1 -0
- package/dist/errors.d.ts +33 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +133 -0
- package/dist/errors.js.map +1 -0
- package/dist/executor.d.ts +30 -0
- package/dist/executor.d.ts.map +1 -0
- package/dist/executor.js +538 -0
- package/dist/executor.js.map +1 -0
- package/dist/incremental.d.ts +45 -0
- package/dist/incremental.d.ts.map +1 -0
- package/dist/incremental.js +72 -0
- package/dist/incremental.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/journal.d.ts +44 -0
- package/dist/journal.d.ts.map +1 -0
- package/dist/journal.js +222 -0
- package/dist/journal.js.map +1 -0
- package/dist/loader.d.ts +12 -0
- package/dist/loader.d.ts.map +1 -0
- package/dist/loader.js +37 -0
- package/dist/loader.js.map +1 -0
- package/dist/paginate.d.ts +20 -0
- package/dist/paginate.d.ts.map +1 -0
- package/dist/paginate.js +29 -0
- package/dist/paginate.js.map +1 -0
- package/dist/plugin.d.ts +110 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +255 -0
- package/dist/plugin.js.map +1 -0
- package/dist/queue.d.ts +9 -0
- package/dist/queue.d.ts.map +1 -0
- package/dist/queue.js +47 -0
- package/dist/queue.js.map +1 -0
- package/dist/registry.d.ts +48 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +109 -0
- package/dist/registry.js.map +1 -0
- package/dist/retry.d.ts +12 -0
- package/dist/retry.d.ts.map +1 -0
- package/dist/retry.js +69 -0
- package/dist/retry.js.map +1 -0
- package/dist/testing.d.ts +16 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +46 -0
- package/dist/testing.js.map +1 -0
- package/dist/types.d.ts +221 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +57 -0
package/dist/testing.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { emptyCheckpoint, toJournalRow } from './journal.js';
|
|
2
|
+
/** In-memory journal with the same projection semantics as the ClickHouse one. */
|
|
3
|
+
export function createMemoryJournal() {
|
|
4
|
+
const events = [];
|
|
5
|
+
const rows = [];
|
|
6
|
+
return {
|
|
7
|
+
events,
|
|
8
|
+
rows,
|
|
9
|
+
async ensure() { },
|
|
10
|
+
async append(event) {
|
|
11
|
+
events.push(event);
|
|
12
|
+
rows.push(toJournalRow(event, 'memory', new Date(0)));
|
|
13
|
+
},
|
|
14
|
+
async readCheckpoint(namespaceId) {
|
|
15
|
+
const scoped = events.filter((event) => event.namespaceId === namespaceId);
|
|
16
|
+
if (scoped.length === 0)
|
|
17
|
+
return emptyCheckpoint();
|
|
18
|
+
const headSeq = Math.max(...scoped.map((event) => event.eventSeq));
|
|
19
|
+
const lastSuccessSeq = Math.max(0, ...scoped
|
|
20
|
+
.filter((event) => event.eventKind === 'work_finished' && event.workState === 'succeeded')
|
|
21
|
+
.map((event) => event.eventSeq));
|
|
22
|
+
const committed = scoped
|
|
23
|
+
.filter((event) => event.eventKind === 'batch_committed')
|
|
24
|
+
.sort((a, b) => a.checkpointVersion - b.checkpointVersion || a.eventSeq - b.eventSeq)
|
|
25
|
+
.at(-1);
|
|
26
|
+
return { version: committed?.checkpointVersion ?? 0, envelope: committed?.checkpoint, headSeq, lastSuccessSeq };
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/** In-memory destination that honours `insert_deduplication_token` like ClickHouse. */
|
|
31
|
+
export function createMemoryDestination() {
|
|
32
|
+
const tables = new Map();
|
|
33
|
+
const tokens = [];
|
|
34
|
+
return {
|
|
35
|
+
tables,
|
|
36
|
+
tokens,
|
|
37
|
+
async insert({ table, rows, token }) {
|
|
38
|
+
const key = `${table.database}.${table.name}`;
|
|
39
|
+
if (tokens.includes(`${key}:${token}`))
|
|
40
|
+
return;
|
|
41
|
+
tokens.push(`${key}:${token}`);
|
|
42
|
+
tables.set(key, [...(tables.get(key) ?? []), ...rows]);
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=testing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testing.js","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAmB,MAAM,cAAc,CAAA;AAc7E,kFAAkF;AAClF,MAAM,UAAU,mBAAmB;IACjC,MAAM,MAAM,GAAmB,EAAE,CAAA;IACjC,MAAM,IAAI,GAAiB,EAAE,CAAA;IAC7B,OAAO;QACL,MAAM;QACN,IAAI;QACJ,KAAK,CAAC,MAAM,KAAI,CAAC;QACjB,KAAK,CAAC,MAAM,CAAC,KAAK;YAChB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;YAClB,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QACvD,CAAC;QACD,KAAK,CAAC,cAAc,CAAC,WAAW;YAC9B,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,KAAK,WAAW,CAAC,CAAA;YAC1E,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;gBAAE,OAAO,eAAe,EAAE,CAAA;YACjD,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC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AG,IAAI,KAAK,EAAE,CAAC,CAAA;YAC9B,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,CAAA;QACxD,CAAC;KACF,CAAA;AACH,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import type { Options as PRetryOptions, RetryContext as PRetryContext } from 'p-retry';
|
|
2
|
+
import type { TableDefinition } from '@chkit/core';
|
|
3
|
+
import type { FetchFailure } from './errors.js';
|
|
4
|
+
/** JSON-compatible column values; the ClickHouse destination encodes bigint as decimal strings. */
|
|
5
|
+
export type Row = Record<string, unknown>;
|
|
6
|
+
/**
|
|
7
|
+
* One bounded unit produced by a stream reader. Rows are already shaped for the
|
|
8
|
+
* destination table: mapping is ordinary code inside the reader.
|
|
9
|
+
*
|
|
10
|
+
* `state` is optional and, when present, must be the COMPLETE candidate
|
|
11
|
+
* provider state that is safe to commit once every row up to and including
|
|
12
|
+
* this chunk has sink evidence. The executor never infers ordering: a reader
|
|
13
|
+
* that cannot claim a safe frontier simply omits `state`.
|
|
14
|
+
*/
|
|
15
|
+
export interface SourceChunk<TRow extends Row = Row, TState = unknown> {
|
|
16
|
+
rows: readonly TRow[];
|
|
17
|
+
state?: TState;
|
|
18
|
+
/**
|
|
19
|
+
* Stable, non-secret identity of the logical source interval this chunk
|
|
20
|
+
* covers (a page cursor, an id range, a day…). Declare it only when a replay
|
|
21
|
+
* of the same interval is the same logical write: batch identity then ignores
|
|
22
|
+
* row content, so mutable provider fields cannot defeat retry deduplication.
|
|
23
|
+
* Without it, identity falls back to a content hash, which prefers a possible
|
|
24
|
+
* duplicate over suppressing rows that changed between attempts.
|
|
25
|
+
*/
|
|
26
|
+
id?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface AttemptOptions {
|
|
29
|
+
/** Short non-secret label used in journal and telemetry, e.g. `GET /v2/objects`. */
|
|
30
|
+
label?: string;
|
|
31
|
+
}
|
|
32
|
+
/** Source request capabilities, independent of selection and checkpoint types. */
|
|
33
|
+
export interface FetchContext {
|
|
34
|
+
signal: AbortSignal;
|
|
35
|
+
/**
|
|
36
|
+
* Run one source operation under executor authority: fetch permit, retry
|
|
37
|
+
* policy, failure classification and cancellation. Operations that bypass it
|
|
38
|
+
* only get coarse recovery (reader recreation from the last checkpoint).
|
|
39
|
+
*/
|
|
40
|
+
attempt<T>(operation: (signal: AbortSignal) => Promise<T>, options?: AttemptOptions): Promise<T>;
|
|
41
|
+
}
|
|
42
|
+
export interface ReadContext<TSelection, TState> extends FetchContext {
|
|
43
|
+
streamId: string;
|
|
44
|
+
/** What to read this execution, planned by the incremental strategy. */
|
|
45
|
+
selection: TSelection;
|
|
46
|
+
/** Last committed provider state, already validated by the strategy. */
|
|
47
|
+
state: TState | undefined;
|
|
48
|
+
/** Immutable cutoff shared by every stream selected in this execution. */
|
|
49
|
+
cutoff: Date;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Provider-owned incremental strategy inside the ChKit-owned checkpoint
|
|
53
|
+
* envelope `{ strategy, version, state }`. Core treats `state` as opaque.
|
|
54
|
+
*/
|
|
55
|
+
export interface IncrementalStrategy<TState, TSelection> {
|
|
56
|
+
readonly id: string;
|
|
57
|
+
readonly version: number;
|
|
58
|
+
/** Validate previously committed state. Throw when it cannot be trusted. */
|
|
59
|
+
parseState(raw: unknown): TState;
|
|
60
|
+
plan(input: PlanInput<TState>): TSelection;
|
|
61
|
+
/**
|
|
62
|
+
* Candidate state once the WHOLE selection has sink evidence. Return
|
|
63
|
+
* `undefined` to leave the checkpoint untouched.
|
|
64
|
+
*/
|
|
65
|
+
complete?(input: {
|
|
66
|
+
state: TState | undefined;
|
|
67
|
+
selection: TSelection;
|
|
68
|
+
}): TState | undefined;
|
|
69
|
+
}
|
|
70
|
+
export interface PlanInput<TState> {
|
|
71
|
+
state: TState | undefined;
|
|
72
|
+
cutoff: Date;
|
|
73
|
+
/** Explicit historical range from a backfill invocation. */
|
|
74
|
+
range: {
|
|
75
|
+
from: Date | undefined;
|
|
76
|
+
to: Date | undefined;
|
|
77
|
+
} | undefined;
|
|
78
|
+
}
|
|
79
|
+
/** p-retry context with the original provider failure and its classification. */
|
|
80
|
+
export type RetryContext = Omit<PRetryContext, 'error'> & {
|
|
81
|
+
error: FetchFailure;
|
|
82
|
+
};
|
|
83
|
+
export type RetryOptions = Pick<PRetryOptions, 'retries' | 'factor' | 'minTimeout' | 'maxTimeout' | 'randomize' | 'maxRetryTime'> & {
|
|
84
|
+
shouldRetry?: (context: RetryContext) => boolean | Promise<boolean>;
|
|
85
|
+
shouldConsumeRetry?: (context: RetryContext) => boolean | Promise<boolean>;
|
|
86
|
+
};
|
|
87
|
+
export interface StreamBudget {
|
|
88
|
+
/** Maximum source chunks pulled in one execution of this stream. */
|
|
89
|
+
maxChunks?: number;
|
|
90
|
+
/** Largest chunk a reader may yield. A bigger chunk fails the stream instead of being buffered. */
|
|
91
|
+
maxChunkRows?: number;
|
|
92
|
+
}
|
|
93
|
+
export interface StreamDefinition<TRow extends Row = Row, TState = unknown, TSelection = unknown> {
|
|
94
|
+
readonly kind: 'ingest_stream';
|
|
95
|
+
/** Globally stable identity. Owns the checkpoint; never derived from the pipeline. */
|
|
96
|
+
readonly id: string;
|
|
97
|
+
readonly destination: TableDefinition;
|
|
98
|
+
readonly tags: readonly string[];
|
|
99
|
+
readonly incremental: IncrementalStrategy<TState, TSelection>;
|
|
100
|
+
readonly read: (context: ReadContext<TSelection, TState>) => AsyncIterable<SourceChunk<TRow, TState>>;
|
|
101
|
+
readonly loader: LoaderFactory | undefined;
|
|
102
|
+
readonly retry: RetryOptions | undefined;
|
|
103
|
+
readonly batchSize: number | undefined;
|
|
104
|
+
readonly budget: StreamBudget | undefined;
|
|
105
|
+
readonly classifyError: ErrorClassifier | undefined;
|
|
106
|
+
}
|
|
107
|
+
export type AnyStreamDefinition = StreamDefinition<any, any, any>;
|
|
108
|
+
export interface PipelineDefinition {
|
|
109
|
+
readonly kind: 'ingest_pipeline';
|
|
110
|
+
readonly id: string;
|
|
111
|
+
readonly tags: readonly string[];
|
|
112
|
+
readonly streams: readonly AnyStreamDefinition[];
|
|
113
|
+
readonly maxStreams: number;
|
|
114
|
+
readonly maxFetches: number;
|
|
115
|
+
readonly maxLoads: number;
|
|
116
|
+
readonly retry: RetryOptions | undefined;
|
|
117
|
+
}
|
|
118
|
+
export type FailureClass = {
|
|
119
|
+
kind: 'cancelled';
|
|
120
|
+
} | {
|
|
121
|
+
kind: 'rate_limited';
|
|
122
|
+
retryAfterMs: number | undefined;
|
|
123
|
+
} | {
|
|
124
|
+
kind: 'transient';
|
|
125
|
+
} | {
|
|
126
|
+
kind: 'permanent';
|
|
127
|
+
} | {
|
|
128
|
+
kind: 'unknown';
|
|
129
|
+
};
|
|
130
|
+
export type ErrorClassifier = (cause: unknown, fallback: FailureClass) => FailureClass | undefined;
|
|
131
|
+
export type SinkEvidenceKind = 'clickhouse_ack' | 'none_required';
|
|
132
|
+
export interface SinkReceipt {
|
|
133
|
+
evidence: SinkEvidenceKind;
|
|
134
|
+
rows: number;
|
|
135
|
+
writeUnits: number;
|
|
136
|
+
}
|
|
137
|
+
export interface LoadBatch {
|
|
138
|
+
/** Stable across every retry and crash replay of the same logical batch. */
|
|
139
|
+
batchId: string;
|
|
140
|
+
rows: readonly Row[];
|
|
141
|
+
}
|
|
142
|
+
export interface LoaderContext {
|
|
143
|
+
streamId: string;
|
|
144
|
+
runId: string;
|
|
145
|
+
table: TableDefinition;
|
|
146
|
+
destination: DestinationAdapter;
|
|
147
|
+
signal: AbortSignal;
|
|
148
|
+
}
|
|
149
|
+
export interface Loader {
|
|
150
|
+
readonly ctx: LoaderContext;
|
|
151
|
+
write(batch: LoadBatch): Promise<void>;
|
|
152
|
+
finalize(): Promise<SinkReceipt>;
|
|
153
|
+
abort(reason: unknown): Promise<void>;
|
|
154
|
+
}
|
|
155
|
+
export type LoaderFactory = (ctx: LoaderContext) => Loader;
|
|
156
|
+
/** Low-level destination writes performed on behalf of a portable Loader. */
|
|
157
|
+
export interface DestinationAdapter {
|
|
158
|
+
insert(input: {
|
|
159
|
+
table: TableDefinition;
|
|
160
|
+
rows: readonly Row[];
|
|
161
|
+
/** Deterministic `insert_deduplication_token` for this write unit. */
|
|
162
|
+
token: string;
|
|
163
|
+
}): Promise<void>;
|
|
164
|
+
}
|
|
165
|
+
export type JournalEventKind = 'run_started' | 'work_planned' | 'attempt_started' | 'retry_scheduled' | 'batch_committed' | 'work_finished' | 'run_finished';
|
|
166
|
+
export type WorkState = '' | 'planned' | 'running' | 'succeeded' | 'failed' | 'budget_exhausted' | 'cancelled';
|
|
167
|
+
export interface CheckpointEnvelope {
|
|
168
|
+
strategy: string;
|
|
169
|
+
version: number;
|
|
170
|
+
state: unknown;
|
|
171
|
+
}
|
|
172
|
+
export interface JournalEvent {
|
|
173
|
+
namespaceId: string;
|
|
174
|
+
eventSeq: number;
|
|
175
|
+
eventKind: JournalEventKind;
|
|
176
|
+
runId: string;
|
|
177
|
+
workId: string;
|
|
178
|
+
attemptNo: number;
|
|
179
|
+
batchId: string;
|
|
180
|
+
expectedCheckpointVersion: number;
|
|
181
|
+
checkpointVersion: number;
|
|
182
|
+
checkpoint: CheckpointEnvelope | undefined;
|
|
183
|
+
workState: WorkState;
|
|
184
|
+
sinkEvidence: SinkEvidenceKind | '';
|
|
185
|
+
retryAt: Date | undefined;
|
|
186
|
+
errorClass: string;
|
|
187
|
+
detail: Record<string, unknown>;
|
|
188
|
+
}
|
|
189
|
+
export interface CommittedCheckpoint {
|
|
190
|
+
version: number;
|
|
191
|
+
envelope: CheckpointEnvelope | undefined;
|
|
192
|
+
/** Highest journal sequence observed for the namespace (any event kind). */
|
|
193
|
+
headSeq: number;
|
|
194
|
+
/** Last successful work_finished sequence, or zero. Separates new syncs from replays. */
|
|
195
|
+
lastSuccessSeq: number;
|
|
196
|
+
}
|
|
197
|
+
/** Authoritative append-only control state. Checkpoints are projections of it. */
|
|
198
|
+
export interface Journal {
|
|
199
|
+
ensure(): Promise<void>;
|
|
200
|
+
append(event: JournalEvent): Promise<void>;
|
|
201
|
+
readCheckpoint(namespaceId: string): Promise<CommittedCheckpoint>;
|
|
202
|
+
}
|
|
203
|
+
export type StreamOutcome = 'succeeded' | 'failed' | 'budget_exhausted' | 'cancelled';
|
|
204
|
+
export interface StreamResult {
|
|
205
|
+
streamId: string;
|
|
206
|
+
pipelineId: string;
|
|
207
|
+
namespaceId: string;
|
|
208
|
+
outcome: StreamOutcome;
|
|
209
|
+
rows: number;
|
|
210
|
+
batches: number;
|
|
211
|
+
chunks: number;
|
|
212
|
+
checkpointVersion: number;
|
|
213
|
+
error: string | undefined;
|
|
214
|
+
}
|
|
215
|
+
export interface ExecutionResult {
|
|
216
|
+
runId: string;
|
|
217
|
+
cutoff: string;
|
|
218
|
+
streams: StreamResult[];
|
|
219
|
+
ok: boolean;
|
|
220
|
+
}
|
|
221
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE,YAAY,IAAI,aAAa,EAAE,MAAM,SAAS,CAAA;AAEtF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAElD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAI/C,mGAAmG;AACnG,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAEzC;;;;;;;;GAQG;AACH,MAAM,WAAW,WAAW,CAAC,IAAI,SAAS,GAAG,GAAG,GAAG,EAAE,MAAM,GAAG,OAAO;IACnE,IAAI,EAAE,SAAS,IAAI,EAAE,CAAA;IACrB,KAAK,CAAC,EAAE,MA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GAAG,kBAAkB,GAAG,WAAW,CAAA;AAErF,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,aAAa,CAAA;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,iBAAiB,EAAE,MAAM,CAAA;IACzB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,EAAE,EAAE,OAAO,CAAA;CACZ"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@chkit/plugin-ingest",
|
|
3
|
+
"version": "0.2.0-beta.8",
|
|
4
|
+
"description": "Scheduled pull ingestion into ClickHouse with journaled checkpoints for chkit",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "ObsessionDB",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"clickhouse",
|
|
9
|
+
"ingestion",
|
|
10
|
+
"etl",
|
|
11
|
+
"chkit-plugin"
|
|
12
|
+
],
|
|
13
|
+
"homepage": "https://chkit.obsessiondb.com",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/obsessiondb/chkit/issues"
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/obsessiondb/chkit.git",
|
|
20
|
+
"directory": "packages/plugin-ingest"
|
|
21
|
+
},
|
|
22
|
+
"type": "module",
|
|
23
|
+
"main": "./dist/index.js",
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"exports": {
|
|
26
|
+
".": {
|
|
27
|
+
"source": "./src/index.ts",
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"default": "./dist/index.js"
|
|
30
|
+
},
|
|
31
|
+
"./testing": {
|
|
32
|
+
"source": "./src/testing.ts",
|
|
33
|
+
"types": "./dist/testing.d.ts",
|
|
34
|
+
"default": "./dist/testing.js"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"files": [
|
|
38
|
+
"dist"
|
|
39
|
+
],
|
|
40
|
+
"scripts": {
|
|
41
|
+
"build": "tsc -p tsconfig.json",
|
|
42
|
+
"dev": "tsc -p tsconfig.json --watch",
|
|
43
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
44
|
+
"lint": "biome lint src",
|
|
45
|
+
"test": "bun test src",
|
|
46
|
+
"test:env": "doppler run --project chkit --config ci -- bun test src",
|
|
47
|
+
"clean": "rm -rf dist"
|
|
48
|
+
},
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"@chkit/clickhouse": "0.2.0-beta.8",
|
|
51
|
+
"@chkit/core": "0.2.0-beta.8",
|
|
52
|
+
"@opentelemetry/api": "^1.9.1",
|
|
53
|
+
"p-limit": "^7.2.0",
|
|
54
|
+
"p-retry": "^7.1.1",
|
|
55
|
+
"zod": "^4.3.6"
|
|
56
|
+
}
|
|
57
|
+
}
|