deepline 0.1.55 → 0.1.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +461 -62
- package/dist/cli/index.mjs +461 -62
- package/dist/index.d.mts +220 -34
- package/dist/index.d.ts +220 -34
- package/dist/index.js +22 -4
- package/dist/index.mjs +22 -4
- package/dist/repo/apps/play-runner-workers/src/entry.ts +36 -12
- package/dist/repo/apps/play-runner-workers/src/runtime/dataset-handles.ts +35 -7
- package/dist/repo/sdk/src/client.ts +33 -2
- package/dist/repo/sdk/src/play.ts +167 -33
- package/dist/repo/sdk/src/release.ts +3 -3
- package/dist/repo/sdk/src/types.ts +21 -0
- package/dist/repo/shared_libs/play-runtime/csv-rename.ts +55 -3
- package/dist/repo/shared_libs/plays/dataset.ts +25 -1
- package/package.json +1 -1
|
@@ -55,14 +55,34 @@ export type PlayDatasetInput<T> =
|
|
|
55
55
|
| AsyncIterable<T>
|
|
56
56
|
| PlayDataset<T>;
|
|
57
57
|
|
|
58
|
+
/**
|
|
59
|
+
* Durable handle for rows produced by `ctx.csv(...)` or `ctx.map(...).run()`.
|
|
60
|
+
*
|
|
61
|
+
* A `PlayDataset` is not a normal in-memory array. It points at runtime-managed
|
|
62
|
+
* rows, usually backed by persisted sheet storage, and carries metadata such as
|
|
63
|
+
* dataset kind, dataset id, table namespace, count, and preview rows.
|
|
64
|
+
*
|
|
65
|
+
* Pass dataset handles directly into later `ctx.map(...)` stages by default so
|
|
66
|
+
* Deepline keeps row progress, retries, memory use, and table output under
|
|
67
|
+
* runtime control. Use `count()` and `peek()` for bounded inspection. Use
|
|
68
|
+
* `materialize(limit)` or async iteration only when the dataset is intentionally
|
|
69
|
+
* small and bounded.
|
|
70
|
+
*/
|
|
58
71
|
export interface PlayDataset<T> extends AsyncIterable<T> {
|
|
59
72
|
readonly [PLAY_DATASET_BRAND]: true;
|
|
73
|
+
/** Dataset kind. */
|
|
60
74
|
readonly datasetKind: PlayDatasetKind;
|
|
75
|
+
/** Dataset id. */
|
|
61
76
|
readonly datasetId: string;
|
|
77
|
+
/** Backing store info. */
|
|
62
78
|
readonly backing?: PlayDatasetBacking;
|
|
79
|
+
/** Display label. */
|
|
63
80
|
readonly sourceLabel?: string | null;
|
|
81
|
+
/** Runtime table name. */
|
|
64
82
|
readonly tableNamespace?: string | null;
|
|
83
|
+
/** Row count. */
|
|
65
84
|
count(): Promise<number>;
|
|
85
|
+
/** Preview rows. */
|
|
66
86
|
peek(limit?: number): Promise<T[]>;
|
|
67
87
|
/**
|
|
68
88
|
* Explicit escape hatch for bounded result sets.
|
|
@@ -310,7 +330,11 @@ export async function materializePlayDatasetInput<T>(
|
|
|
310
330
|
input: PlayDatasetInput<T>,
|
|
311
331
|
): Promise<T[]> {
|
|
312
332
|
if (isPlayDataset(input)) {
|
|
313
|
-
|
|
333
|
+
const rows: T[] = [];
|
|
334
|
+
for await (const row of input) {
|
|
335
|
+
rows.push(row);
|
|
336
|
+
}
|
|
337
|
+
return rows;
|
|
314
338
|
}
|
|
315
339
|
|
|
316
340
|
if (Array.isArray(input)) {
|