@prisma/composer-prisma-cloud 0.2.0-dev.10 → 0.2.0-dev.12
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/control.mjs +33 -19
- package/dist/control.mjs.map +1 -1
- package/dist/storage/storage-entrypoint.mjs +4 -21
- package/dist/storage/storage-entrypoint.mjs.map +1 -1
- package/dist/storage/testing.d.mts +7 -6
- package/dist/storage/testing.d.mts.map +1 -1
- package/dist/storage/testing.mjs +4 -21
- package/dist/storage/testing.mjs.map +1 -1
- package/package.json +15 -14
|
@@ -66,7 +66,7 @@ function retryTransientConnect(acquire, opts = {}) {
|
|
|
66
66
|
* Runtime engine code (`bun` SQL + `node:crypto`); NOT re-exported from the
|
|
67
67
|
* authoring barrel.
|
|
68
68
|
*/
|
|
69
|
-
const DEFAULT_MAX_KEYS
|
|
69
|
+
const DEFAULT_MAX_KEYS = 1e3;
|
|
70
70
|
function etagOf(bytes) {
|
|
71
71
|
return `"${createHash("sha256").update(bytes).digest("hex")}"`;
|
|
72
72
|
}
|
|
@@ -129,7 +129,7 @@ var PgObjectStore = class {
|
|
|
129
129
|
}
|
|
130
130
|
async list(bucket, opts = {}) {
|
|
131
131
|
const prefix = opts.prefix ?? "";
|
|
132
|
-
const maxKeys = opts.maxKeys ?? DEFAULT_MAX_KEYS
|
|
132
|
+
const maxKeys = opts.maxKeys ?? DEFAULT_MAX_KEYS;
|
|
133
133
|
const token = opts.continuationToken;
|
|
134
134
|
const limit = maxKeys + 1;
|
|
135
135
|
const keys = (token === void 0 ? await this.sql`select key from objects
|
|
@@ -170,13 +170,6 @@ async function createPgStore(url) {
|
|
|
170
170
|
)`);
|
|
171
171
|
return new PgObjectStore(sql);
|
|
172
172
|
}
|
|
173
|
-
/**
|
|
174
|
-
* AWS SigV4 verification for the S3 wire protocol (spec § 2 auth). The payload
|
|
175
|
-
* hash comes from the client — `x-amz-content-sha256` (a real hash or
|
|
176
|
-
* `UNSIGNED-PAYLOAD`) for header auth, `UNSIGNED-PAYLOAD` for presign — and is
|
|
177
|
-
* never re-hashed; the verifier trusts what was signed, like a real S3 endpoint.
|
|
178
|
-
* Runtime engine code (`node:crypto`); not re-exported from the authoring barrel.
|
|
179
|
-
*/
|
|
180
173
|
const ALGORITHM = "AWS4-HMAC-SHA256";
|
|
181
174
|
const UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD";
|
|
182
175
|
function sha256Hex(data) {
|
|
@@ -391,12 +384,12 @@ function listXml(bucket, prefix, maxKeys, result) {
|
|
|
391
384
|
const next = result.isTruncated && result.nextContinuationToken !== void 0 ? `<NextContinuationToken>${xmlEscape(result.nextContinuationToken)}</NextContinuationToken>` : "";
|
|
392
385
|
return `<?xml version="1.0" encoding="UTF-8"?><ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Name>${xmlEscape(bucket)}</Name><Prefix>${xmlEscape(prefix)}</Prefix><KeyCount>${result.keys.length}</KeyCount><MaxKeys>${maxKeys}</MaxKeys><IsTruncated>${result.isTruncated}</IsTruncated>` + contents + next + "</ListBucketResult>";
|
|
393
386
|
}
|
|
394
|
-
const DEFAULT_MAX_KEYS = 1e3;
|
|
387
|
+
const DEFAULT_MAX_KEYS$1 = 1e3;
|
|
395
388
|
async function handleList(store, bucket, url) {
|
|
396
389
|
const prefix = url.searchParams.get("prefix") ?? "";
|
|
397
390
|
const continuationToken = url.searchParams.get("continuation-token");
|
|
398
391
|
const maxKeysRaw = url.searchParams.get("max-keys");
|
|
399
|
-
const maxKeys = maxKeysRaw !== null && Number.isFinite(Number(maxKeysRaw)) ? Number(maxKeysRaw) : DEFAULT_MAX_KEYS;
|
|
392
|
+
const maxKeys = maxKeysRaw !== null && Number.isFinite(Number(maxKeysRaw)) ? Number(maxKeysRaw) : DEFAULT_MAX_KEYS$1;
|
|
400
393
|
const result = await store.list(bucket, {
|
|
401
394
|
prefix,
|
|
402
395
|
maxKeys,
|
|
@@ -490,16 +483,6 @@ function createS3Handler(opts) {
|
|
|
490
483
|
}
|
|
491
484
|
};
|
|
492
485
|
}
|
|
493
|
-
/**
|
|
494
|
-
* Boots the S3 wire protocol on `Bun.serve` — the D2 handler over any
|
|
495
|
-
* `ObjectStore`. Binds all interfaces (Compute routes external HTTP to the VM,
|
|
496
|
-
* so a loopback-only listener would be unreachable). Installs the FT-5219
|
|
497
|
-
* process guards so an idle Bun.SQL connection close surfaces as a logged
|
|
498
|
-
* error instead of crash-looping the process on scale-to-zero.
|
|
499
|
-
*
|
|
500
|
-
* Runtime engine code; NOT re-exported from the authoring barrel. The D4
|
|
501
|
-
* entrypoint reads deps via `load()` and calls this.
|
|
502
|
-
*/
|
|
503
486
|
let guardsInstalled = false;
|
|
504
487
|
/** FT-5219: keep the process alive when Bun.SQL surfaces an idle-close as an unawaited async error. Installed once. */
|
|
505
488
|
function installProcessGuards() {
|