@prisma/composer-prisma-cloud 0.1.0-dev.12 → 0.1.0-dev.14
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.d.mts +3 -3
- package/dist/control.mjs +4 -4
- package/dist/control.mjs.map +1 -1
- package/dist/cron/scheduler-entrypoint.mjs.map +1 -1
- package/dist/cron/scheduler-service.mjs.map +1 -1
- package/dist/{prisma-next-qPB8_Az6.mjs → prisma-next-DlU01kXJ-2sP5mQb6.mjs} +3 -3
- package/dist/prisma-next-DlU01kXJ-2sP5mQb6.mjs.map +1 -0
- package/dist/prisma-next.d.mts +1 -1
- package/dist/prisma-next.mjs +1 -1
- package/dist/storage/index.d.mts +11 -10
- package/dist/storage/index.mjs +1 -1
- package/dist/storage/index.mjs.map +1 -1
- package/dist/storage/storage-entrypoint.mjs.map +1 -1
- package/dist/storage/storage-service.mjs +1 -1
- package/dist/storage/storage-service.mjs.map +1 -1
- package/dist/storage/testing.mjs.map +1 -1
- package/dist/streams/index.d.mts +13 -12
- package/dist/streams/index.mjs +2 -2
- package/dist/streams/index.mjs.map +1 -1
- package/dist/streams/streams-entrypoint.mjs.map +1 -1
- package/dist/streams/streams-service.mjs +1 -1
- package/dist/streams/streams-service.mjs.map +1 -1
- package/dist/streams/testing.d.mts +1 -1
- package/dist/streams/testing.mjs.map +1 -1
- package/dist/testing.d.mts +1 -1
- package/dist/testing.mjs.map +1 -1
- package/package.json +13 -13
- package/dist/prisma-next-qPB8_Az6.mjs.map +0 -1
package/dist/testing.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Config, Deps, Expose, Params, RunnableServiceNode } from "@prisma/composer";
|
|
2
2
|
//#region ../../1-prisma-cloud/1-extensions/target/dist/testing.d.mts
|
|
3
|
-
//#region src/
|
|
3
|
+
//#region src/testing.d.ts
|
|
4
4
|
/** What `bootstrapService` hands back: a live, driveable instance of the booted entry. */
|
|
5
5
|
interface BootstrappedService {
|
|
6
6
|
readonly url: string;
|
package/dist/testing.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.mjs","names":[],"sources":["../../../1-prisma-cloud/1-extensions/target/dist/testing.mjs"],"sourcesContent":["import { c as stash } from \"./serializer-CX4VYdf_.mjs\";\n//#region src/
|
|
1
|
+
{"version":3,"file":"testing.mjs","names":[],"sources":["../../../1-prisma-cloud/1-extensions/target/dist/testing.mjs"],"sourcesContent":["import { c as stash } from \"./serializer-CX4VYdf_.mjs\";\n//#region src/testing.ts\n/**\n* Boots `service`'s real entry against `config`, in-process. By default the\n* entry is `service.build.entry` resolved against `service.build.module` —\n* exactly how the printed deploy bootstrap imports it (see `@internal/lowering`'s\n* artifact.ts) — which fits a build adapter whose `entry` is a plain\n* module-relative path (`@prisma/composer/node`'s). A build adapter whose bootable\n* path isn't module-relative (`@prisma/composer/nextjs`'s standalone output)\n* supplies its own `boot` thunk; the target owns that resolution.\n*\n* `config.service.port` must be concrete — the entry self-listens and never\n* reports an OS-assigned port back. No `close()`: teardown rides bun-test's\n* per-file process isolation (H3's resolved decision).\n*/\nasync function bootstrapService(service, config, boot) {\n\tconst port = config.service[\"port\"];\n\tif (typeof port !== \"number\") throw new Error(\"bootstrapService(): config.service.port must be a concrete port number — the booted entry self-listens with no way to report an OS-assigned one back to the caller.\");\n\tconst bootEntry = boot ?? (async () => {\n\t\tawait import(new URL(service.build.entry, service.build.module).href);\n\t});\n\tstash(service, config);\n\tawait bootEntry();\n\treturn {\n\t\turl: `http://localhost:${port}/`,\n\t\tfetch\n\t};\n}\n//#endregion\nexport { bootstrapService };\n\n//# sourceMappingURL=testing.mjs.map"],"mappings":";;;;;;;;;;;;;;;AAeA,eAAe,iBAAiB,SAAS,QAAQ,MAAM;CACtD,MAAM,OAAO,OAAO,QAAQ;CAC5B,IAAI,OAAO,SAAS,UAAU,MAAM,IAAI,MAAM,qKAAqK;CACnN,MAAM,YAAY,SAAS,YAAY;EACtC,MAAM,OAAO,IAAI,IAAI,QAAQ,MAAM,OAAO,QAAQ,MAAM,MAAM,CAAC,CAAC;CACjE;CACA,MAAM,SAAS,MAAM;CACrB,MAAM,UAAU;CAChB,OAAO;EACN,KAAK,oBAAoB,KAAK;EAC9B;CACD;AACD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/composer-prisma-cloud",
|
|
3
|
-
"version": "0.1.0-dev.
|
|
3
|
+
"version": "0.1.0-dev.14",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The Prisma Cloud target for Prisma Composer: compute(), postgres(), the target extension, and first-party modules realized on Prisma Cloud (cron).",
|
|
6
6
|
"exports": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@prisma-next/migration-tools": "0.15.0",
|
|
29
29
|
"@prisma-next/postgres": "0.15.0",
|
|
30
30
|
"@prisma-next/sql-contract": "0.15.0",
|
|
31
|
-
"@prisma/composer": "0.1.0-dev.
|
|
31
|
+
"@prisma/composer": "0.1.0-dev.14",
|
|
32
32
|
"@prisma/management-api-sdk": "^1.50.0",
|
|
33
33
|
"@standard-schema/spec": "^1.1.0",
|
|
34
34
|
"alchemy": "2.0.0-beta.59",
|
|
@@ -40,17 +40,17 @@
|
|
|
40
40
|
"tsdown": "^0.22.7"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@internal/core": "0.1.0-dev.
|
|
44
|
-
"@internal/cron": "0.1.0-dev.
|
|
45
|
-
"@internal/foundation": "0.1.0-dev.
|
|
46
|
-
"@internal/lowering": "0.1.0-dev.
|
|
47
|
-
"@internal/nextjs": "0.1.0-dev.
|
|
48
|
-
"@internal/node": "0.1.0-dev.
|
|
49
|
-
"@internal/prisma-cloud": "0.1.0-dev.
|
|
50
|
-
"@internal/service-rpc": "0.1.0-dev.
|
|
51
|
-
"@internal/storage": "0.1.0-dev.
|
|
52
|
-
"@internal/streams": "0.1.0-dev.
|
|
53
|
-
"@internal/tsdown-config": "0.1.0-dev.
|
|
43
|
+
"@internal/core": "0.1.0-dev.14",
|
|
44
|
+
"@internal/cron": "0.1.0-dev.14",
|
|
45
|
+
"@internal/foundation": "0.1.0-dev.14",
|
|
46
|
+
"@internal/lowering": "0.1.0-dev.14",
|
|
47
|
+
"@internal/nextjs": "0.1.0-dev.14",
|
|
48
|
+
"@internal/node": "0.1.0-dev.14",
|
|
49
|
+
"@internal/prisma-cloud": "0.1.0-dev.14",
|
|
50
|
+
"@internal/service-rpc": "0.1.0-dev.14",
|
|
51
|
+
"@internal/storage": "0.1.0-dev.14",
|
|
52
|
+
"@internal/streams": "0.1.0-dev.14",
|
|
53
|
+
"@internal/tsdown-config": "0.1.0-dev.14",
|
|
54
54
|
"@types/node": "^25.9.3",
|
|
55
55
|
"typescript": "^6.0.3"
|
|
56
56
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prisma-next-qPB8_Az6.mjs","names":[],"sources":["../../../1-prisma-cloud/1-extensions/target/dist/connection.mjs","../../../1-prisma-cloud/1-extensions/target/dist/prisma-next.mjs"],"sourcesContent":["//#region src/exports/pg-connection.ts\n/** Connection resilience helpers for Prisma Postgres cold-starts (FT-5226); no heavy imports (no `effect`/`alchemy`/`pg`), so the deploy lowerings, the pnPostgres runtime client, and bun-runnable services (the storage store, via the pure `@internal/prisma-cloud/connection` subpath) all share one implementation. */\n/** Network-level socket failures node-postgres surfaces as `err.code`. */\nconst TRANSIENT_CODES = /* @__PURE__ */ new Set([\n\t\"ECONNREFUSED\",\n\t\"ECONNRESET\",\n\t\"ETIMEDOUT\",\n\t\"EPIPE\",\n\t\"ENOTFOUND\",\n\t\"EAI_AGAIN\"\n]);\n/** Connection-establishment failure messages (no useful `err.code`). */\nconst TRANSIENT_MESSAGE_FRAGMENTS = [\n\t\"upstream database\",\n\t\"connection terminated\",\n\t\"connection refused\",\n\t\"terminating connection\",\n\t\"server closed the connection\",\n\t\"connection timeout\",\n\t\"timeout expired\"\n];\n/** Whether an error is a transient connection failure worth retrying, as opposed to a real query error that must surface at once. */\nfunction isTransientConnectionError(error) {\n\tif (typeof error !== \"object\" || error === null) return false;\n\tconst code = \"code\" in error && typeof error.code === \"string\" ? error.code : void 0;\n\tif (code !== void 0 && TRANSIENT_CODES.has(code)) return true;\n\tconst message = \"message\" in error && typeof error.message === \"string\" ? error.message.toLowerCase() : \"\";\n\treturn TRANSIENT_MESSAGE_FRAGMENTS.some((fragment) => message.includes(fragment));\n}\n/**\n* Rewrites a deprecating `sslmode` (`require`/`prefer`/`verify-ca`) to the\n* explicit `verify-full` these already mean, silencing node-postgres's\n* deprecation warning. `disable`/`no-verify`/unset are left untouched.\n*/\nfunction normalizeSslMode(url) {\n\tlet parsed;\n\ttry {\n\t\tparsed = new URL(url);\n\t} catch {\n\t\treturn url;\n\t}\n\tconst sslmode = parsed.searchParams.get(\"sslmode\");\n\tif (sslmode === \"require\" || sslmode === \"prefer\" || sslmode === \"verify-ca\") {\n\t\tparsed.searchParams.set(\"sslmode\", \"verify-full\");\n\t\treturn parsed.toString();\n\t}\n\treturn url;\n}\n/**\n* Retries an operation past a transient connection failure, bounded (default\n* ~1 min). `shouldRetry` decides what's transient — defaults to retrying\n* everything; the runtime client passes {@link isTransientConnectionError}.\n*/\nasync function withConnectionRetry(operation, opts = {}) {\n\tconst attempts = opts.attempts ?? 12;\n\tconst delayMs = opts.delayMs ?? 5e3;\n\tconst sleep = opts.sleep ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));\n\tconst shouldRetry = opts.shouldRetry ?? (() => true);\n\tlet lastError;\n\tfor (let attempt = 1; attempt <= attempts; attempt++) try {\n\t\treturn await operation();\n\t} catch (error) {\n\t\tif (!shouldRetry(error)) throw error;\n\t\tlastError = error;\n\t\tif (attempt < attempts) await sleep(delayMs);\n\t}\n\tthrow lastError;\n}\n/** Retries acquiring a connection past a transient cold-start; {@link withConnectionRetry} with {@link isTransientConnectionError} fixed as the predicate. */\nfunction retryTransientConnect(acquire, opts = {}) {\n\treturn withConnectionRetry(acquire, {\n\t\t...opts,\n\t\tshouldRetry: isTransientConnectionError\n\t});\n}\n//#endregion\nexport { isTransientConnectionError, normalizeSslMode, retryTransientConnect, withConnectionRetry };\n\n//# sourceMappingURL=connection.mjs.map","import { normalizeSslMode, retryTransientConnect } from \"./connection.mjs\";\nimport { ResourceNodeBase, dependency, freezeNode, string } from \"@internal/core\";\nimport { blindCast } from \"@internal/foundation/casts\";\nimport pg from \"pg\";\nimport pnPostgresRuntime from \"@prisma-next/postgres/runtime\";\n//#region src/exports/prisma-next.ts\n/**\n* The `prisma-next` resource node: a core Resource node plus `config`, the\n* `prisma-next.config.ts` path the deploy-only migration lowering loads to\n* find the migrations directory — the app build never imports it.\n*/\nvar PnPostgresResourceNode = class extends ResourceNodeBase {\n\tconfig;\n\tconstructor(def) {\n\t\tsuper({\n\t\t\tname: def.name,\n\t\t\textension: \"@prisma/composer-prisma-cloud\",\n\t\t\tprovides: def.contract\n\t\t});\n\t\tthis.config = def.config;\n\t\tif (def.targetRef !== void 0) this.targetRef = def.targetRef;\n\t\tfreezeNode(this);\n\t}\n};\n/** Narrows `ctx.node` to a `pnPostgres` resource node so the deploy lowering reads `config` without a bare cast. Structural, never `instanceof`. */\nfunction isPnPostgresResourceNode(node) {\n\treturn node.kind === \"resource\" && node.type === \"prisma-next\" && \"config\" in node && typeof node.config === \"string\";\n}\nfunction pnContract(contract) {\n\tconst value = {\n\t\tkind: \"prisma-next\",\n\t\t__cmp: { contractJson: contract },\n\t\tsatisfies: (required) => {\n\t\t\tconst requiredHash = storageHashOf(required);\n\t\t\treturn requiredHash !== void 0 && requiredHash === storageHashOf(value);\n\t\t}\n\t};\n\treturn Object.freeze(value);\n}\nfunction pnPostgres(arg) {\n\tif (!isPnPostgresContract(arg)) return new PnPostgresResourceNode(arg);\n\tconst contract = arg;\n\treturn dependency({\n\t\ttype: \"prisma-next\",\n\t\tconnection: {\n\t\t\tparams: { url: string() },\n\t\t\thydrate: ({ url }) => buildClient(contract, url)\n\t\t},\n\t\trequired: contract\n\t});\n}\nfunction isPnPostgresContract(value) {\n\treturn typeof value === \"object\" && value !== null && \"kind\" in value && value.kind === \"prisma-next\" && \"__cmp\" in value && \"satisfies\" in value;\n}\n/**\n* Builds the typed Prisma Next client over a connection pool that rides out\n* a transient cold-start (FT-5226). We pass our own `pg.Pool` rather than a\n* bare `url`: the runtime's bare-`url` connect is a one-shot that fails\n* permanently, but a pool connects lazily on first query, so a bounded retry there suffices.\n*/\nfunction buildClient(contract, url) {\n\treturn pnPostgresRuntime({\n\t\tcontractJson: contract.__cmp.contractJson,\n\t\tbinding: {\n\t\t\tkind: \"pgPool\",\n\t\t\tpool: resilientPool(url)\n\t\t}\n\t});\n}\n/**\n* A `pg.Pool` whose connection acquisition retries a transient cold-start\n* (bounded ~1 min). Only `pool.connect()` is wrapped — a real query error\n* still surfaces at once from `client.query()`.\n*/\nfunction resilientPool(url) {\n\tconst pool = new pg.Pool({\n\t\tconnectionString: normalizeSslMode(url),\n\t\tconnectionTimeoutMillis: 2e4,\n\t\tidleTimeoutMillis: 5e3\n\t});\n\tpool.on(\"error\", (err) => console.error(\"pg pool idle client error\", err));\n\tconst acquire = pool.connect.bind(pool);\n\tpool.connect = blindCast(() => retryTransientConnect(() => acquire()));\n\treturn pool;\n}\n/** Reads `__cmp.contractJson.storage.storageHash` off a `prisma-next` Contract, defensively — `__cmp` is opaque to core, so nothing guarantees its shape without a runtime check. */\nfunction storageHashOf(contract) {\n\tif (contract === void 0) return void 0;\n\tconst cmp = contract.__cmp;\n\tif (typeof cmp !== \"object\" || cmp === null || !(\"contractJson\" in cmp)) return void 0;\n\tconst contractJson = cmp.contractJson;\n\tif (typeof contractJson !== \"object\" || contractJson === null || !(\"storage\" in contractJson)) return;\n\tconst storage = contractJson.storage;\n\tif (typeof storage !== \"object\" || storage === null || !(\"storageHash\" in storage)) return void 0;\n\tconst hash = storage.storageHash;\n\treturn typeof hash === \"string\" ? hash : void 0;\n}\n//#endregion\nexport { PnPostgresResourceNode, isPnPostgresResourceNode, pnContract, pnPostgres };\n\n//# sourceMappingURL=prisma-next.mjs.map"],"mappings":";;;;;;;AAGA,MAAM,kCAAkC,IAAI,IAAI;CAC/C;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;;AAED,MAAM,8BAA8B;CACnC;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,SAAS,2BAA2B,OAAO;CAC1C,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO;CACxD,MAAM,OAAO,UAAU,SAAS,OAAO,MAAM,SAAS,WAAW,MAAM,OAAO,KAAK;CACnF,IAAI,SAAS,KAAK,KAAK,gBAAgB,IAAI,IAAI,GAAG,OAAO;CACzD,MAAM,UAAU,aAAa,SAAS,OAAO,MAAM,YAAY,WAAW,MAAM,QAAQ,YAAY,IAAI;CACxG,OAAO,4BAA4B,MAAM,aAAa,QAAQ,SAAS,QAAQ,CAAC;AACjF;;;;;;AAMA,SAAS,iBAAiB,KAAK;CAC9B,IAAI;CACJ,IAAI;EACH,SAAS,IAAI,IAAI,GAAG;CACrB,QAAQ;EACP,OAAO;CACR;CACA,MAAM,UAAU,OAAO,aAAa,IAAI,SAAS;CACjD,IAAI,YAAY,aAAa,YAAY,YAAY,YAAY,aAAa;EAC7E,OAAO,aAAa,IAAI,WAAW,aAAa;EAChD,OAAO,OAAO,SAAS;CACxB;CACA,OAAO;AACR;;;;;;AAMA,eAAe,oBAAoB,WAAW,OAAO,CAAC,GAAG;CACxD,MAAM,WAAW,KAAK,YAAY;CAClC,MAAM,UAAU,KAAK,WAAW;CAChC,MAAM,QAAQ,KAAK,WAAW,OAAO,IAAI,SAAS,YAAY,WAAW,SAAS,EAAE,CAAC;CACrF,MAAM,cAAc,KAAK,sBAAsB;CAC/C,IAAI;CACJ,KAAK,IAAI,UAAU,GAAG,WAAW,UAAU,WAAW,IAAI;EACzD,OAAO,MAAM,UAAU;CACx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