@lostgradient/weft 0.13.0 → 0.14.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/README.md +1 -1
- package/dist/cli/help-text.d.ts +3 -3
- package/dist/cli/help-text.js +4 -4
- package/dist/cli/operation-catalog-snapshot.d.ts +1 -1
- package/dist/cli/schedule.js +1 -3
- package/dist/cli/serve-registrations.d.ts +3 -3
- package/dist/cli/serve-registrations.js +2 -2
- package/dist/cli/shutdown.d.ts +11 -0
- package/dist/cli/shutdown.js +25 -0
- package/dist/cli/validate.d.ts +1 -1
- package/dist/cli/version-check.d.ts +1 -1
- package/dist/cli/version-check.js +1 -1
- package/dist/cli-main.js +10 -29
- package/dist/client/http-client-storage.js +7 -35
- package/dist/client/http-request.d.ts +8 -9
- package/dist/client/http-request.js +3 -25
- package/dist/core/context/parallel-operations.d.ts +0 -2
- package/dist/core/context/parallel-operations.js +0 -7
- package/dist/core/engine/callback-checkpoint-persistence.d.ts +2 -0
- package/dist/core/engine/callback-checkpoint-persistence.js +6 -3
- package/dist/core/engine/callback-creators.js +4 -22
- package/dist/core/engine/checkpoint-io.d.ts +1 -1
- package/dist/core/engine/operations-coordination.js +1 -1
- package/dist/core/engine/parallel-dispatch.d.ts +1 -1
- package/dist/core/engine/parallel-dispatch.js +1 -1
- package/dist/core/engine/review-list-entries.d.ts +1 -1
- package/dist/core/engine/review-list-entries.js +6 -30
- package/dist/core/engine/timeline-coordinator-detail.d.ts +1 -1
- package/dist/core/review/index.d.ts +87 -0
- package/dist/core/review/index.js +29 -0
- package/dist/diagnostics/validate.d.ts +9 -30
- package/dist/diagnostics/validate.js +83 -21
- package/dist/diagnostics/version-check.d.ts +2 -2
- package/dist/http.js +2 -2
- package/dist/server/openapi-error-responses.js +0 -14
- package/dist/server/operation-catalog/index.d.ts +1 -1
- package/dist/server/operation-catalog/raise-fault.d.ts +2 -1
- package/dist/server/operation-catalog/types.d.ts +2 -1
- package/dist/server/operation-fault.d.ts +1 -4
- package/dist/server/operation-fault.js +1 -1
- package/dist/server/operation-registry.d.ts +1 -1
- package/dist/server/operations/list-reviews.js +2 -19
- package/dist/server/operations/recover-all.js +1 -10
- package/dist/server/operations/single-workflow-control-operation.d.ts +2 -1
- package/dist/storage/bounded-ndjson-response.d.ts +5 -0
- package/dist/storage/bounded-ndjson-response.js +33 -0
- package/dist/storage/http.js +5 -37
- package/dist/storage/neon.d.ts +3 -16
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/storage/http.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { readBoundedNdjsonResponse } from "./bounded-ndjson-response.js";
|
|
1
2
|
import { decodeBase64ToBytes, encodeBytesToBase64, isRecord } from "./byte-encoding.js";
|
|
2
3
|
import { normalizeDeleteRangeOptions } from "./delete-range.js";
|
|
3
4
|
import {
|
|
@@ -47,42 +48,6 @@ function parseScanLine(line) {
|
|
|
47
48
|
const entry = parseScanEntry(JSON.parse(line));
|
|
48
49
|
return [entry.key, decodeBase64ToBytes(entry.value)];
|
|
49
50
|
}
|
|
50
|
-
function assertScanResponseSize(bytesRead) {
|
|
51
|
-
if (bytesRead > MAX_SCAN_RESPONSE_BYTES)
|
|
52
|
-
throw Error("HTTPStorage scan response exceeded the maximum allowed size.");
|
|
53
|
-
}
|
|
54
|
-
async function* readNdjsonLines(response) {
|
|
55
|
-
if (response.body === null)
|
|
56
|
-
return;
|
|
57
|
-
const reader = response.body.getReader(), decoder = new TextDecoder;
|
|
58
|
-
let bufferedText = "", bytesRead = 0, reachedEndOfStream = !1;
|
|
59
|
-
try {
|
|
60
|
-
while (!0) {
|
|
61
|
-
const { done, value } = await reader.read();
|
|
62
|
-
if (done) {
|
|
63
|
-
reachedEndOfStream = !0;
|
|
64
|
-
break;
|
|
65
|
-
}
|
|
66
|
-
bytesRead += value.byteLength;
|
|
67
|
-
assertScanResponseSize(bytesRead);
|
|
68
|
-
bufferedText += decoder.decode(value, { stream: !0 });
|
|
69
|
-
const lines = bufferedText.split(`
|
|
70
|
-
`);
|
|
71
|
-
bufferedText = lines.pop() ?? "";
|
|
72
|
-
for (const line of lines)
|
|
73
|
-
yield line;
|
|
74
|
-
}
|
|
75
|
-
bufferedText += decoder.decode();
|
|
76
|
-
if (bufferedText.length > 0)
|
|
77
|
-
yield bufferedText;
|
|
78
|
-
} finally {
|
|
79
|
-
try {
|
|
80
|
-
if (!reachedEndOfStream)
|
|
81
|
-
await reader.cancel();
|
|
82
|
-
} catch {}
|
|
83
|
-
reader.releaseLock();
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
51
|
|
|
87
52
|
export class HTTPStorage {
|
|
88
53
|
#baseUrl;
|
|
@@ -151,7 +116,10 @@ export class HTTPStorage {
|
|
|
151
116
|
method: "GET",
|
|
152
117
|
headers: { accept: "application/x-ndjson" }
|
|
153
118
|
});
|
|
154
|
-
for await (const line of
|
|
119
|
+
for await (const line of readBoundedNdjsonResponse(response, {
|
|
120
|
+
maximumBytes: MAX_SCAN_RESPONSE_BYTES,
|
|
121
|
+
sizeLimitError: () => Error("HTTPStorage scan response exceeded the maximum allowed size.")
|
|
122
|
+
})) {
|
|
155
123
|
const entry = parseScanLine(line);
|
|
156
124
|
if (entry !== null)
|
|
157
125
|
yield entry;
|
package/dist/storage/neon.d.ts
CHANGED
|
@@ -1,20 +1,7 @@
|
|
|
1
|
-
import { PostgresKeyValueStorage, type PostgresKeyValueStorageOptions, type PostgresPool
|
|
1
|
+
import { PostgresKeyValueStorage, type PostgresKeyValueStorageOptions, type PostgresPool } from './postgres-key-value-storage.ts';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* {@link PostgresPoolClient}; kept for backward-compatible imports.
|
|
6
|
-
*/
|
|
7
|
-
export type NeonPoolClient = PostgresPoolClient;
|
|
8
|
-
/**
|
|
9
|
-
* Minimal structural view of a node-postgres `Pool`. The Neon serverless `Pool`
|
|
10
|
-
* satisfies this; the PGlite test backend is wrapped to satisfy it too. Alias of
|
|
11
|
-
* the driver-agnostic {@link PostgresPool}; kept for backward-compatible imports.
|
|
12
|
-
*/
|
|
13
|
-
export type NeonPool = PostgresPool;
|
|
14
|
-
/**
|
|
15
|
-
* Configuration for connecting to a Neon (or any Postgres) database. Alias of the
|
|
16
|
-
* shared {@link PostgresKeyValueStorageOptions}; `url` is optional and required
|
|
17
|
-
* only when no `pool` is supplied.
|
|
3
|
+
* Configuration for connecting {@link NeonStorage} to a Neon database.
|
|
4
|
+
* `url` is optional and required only when no `pool` is supplied.
|
|
18
5
|
*
|
|
19
6
|
* @example
|
|
20
7
|
* ```ts
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "0.
|
|
1
|
+
export const VERSION = "0.14.0";
|