@prisma/orm-extension-supabase 8.0.0-rc.20-dev.13 → 8.0.0-rc.20-dev.15

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.
@@ -18,7 +18,6 @@ declare const AuthUser: import("@prisma/orm-family-sql/contract-ts/contract-buil
18
18
  readonly nullable: false;
19
19
  readonly columnName?: undefined;
20
20
  readonly default?: import("@prisma/orm-family-sql/contract-ts/contract-builder").AuthoredColumnDefault | undefined;
21
- readonly executionDefaults?: import("@prisma/orm-framework/contract/types").ExecutionMutationDefaultPhases | undefined;
22
21
  readonly generatorCalls?: {
23
22
  readonly onCreate?: import("@prisma/orm-framework/components/components").GeneratorFunctionCall;
24
23
  readonly onUpdate?: import("@prisma/orm-framework/components/components").GeneratorFunctionCall;
@@ -47,7 +46,6 @@ declare const AuthUser: import("@prisma/orm-family-sql/contract-ts/contract-buil
47
46
  readonly nullable: false;
48
47
  readonly columnName?: undefined;
49
48
  readonly default?: import("@prisma/orm-family-sql/contract-ts/contract-builder").AuthoredColumnDefault | undefined;
50
- readonly executionDefaults?: import("@prisma/orm-framework/contract/types").ExecutionMutationDefaultPhases | undefined;
51
49
  readonly generatorCalls?: {
52
50
  readonly onCreate?: import("@prisma/orm-framework/components/components").GeneratorFunctionCall;
53
51
  readonly onUpdate?: import("@prisma/orm-framework/components/components").GeneratorFunctionCall;
@@ -74,7 +72,6 @@ declare const AuthUser: import("@prisma/orm-family-sql/contract-ts/contract-buil
74
72
  readonly nullable: false;
75
73
  readonly columnName?: undefined;
76
74
  readonly default?: import("@prisma/orm-family-sql/contract-ts/contract-builder").AuthoredColumnDefault | undefined;
77
- readonly executionDefaults?: import("@prisma/orm-framework/contract/types").ExecutionMutationDefaultPhases | undefined;
78
75
  readonly generatorCalls?: {
79
76
  readonly onCreate?: import("@prisma/orm-framework/components/components").GeneratorFunctionCall;
80
77
  readonly onUpdate?: import("@prisma/orm-framework/components/components").GeneratorFunctionCall;
@@ -101,7 +98,6 @@ declare const AuthUser: import("@prisma/orm-family-sql/contract-ts/contract-buil
101
98
  readonly nullable: false;
102
99
  readonly columnName?: undefined;
103
100
  readonly default?: import("@prisma/orm-family-sql/contract-ts/contract-builder").AuthoredColumnDefault | undefined;
104
- readonly executionDefaults?: import("@prisma/orm-framework/contract/types").ExecutionMutationDefaultPhases | undefined;
105
101
  readonly generatorCalls?: {
106
102
  readonly onCreate?: import("@prisma/orm-framework/components/components").GeneratorFunctionCall;
107
103
  readonly onUpdate?: import("@prisma/orm-framework/components/components").GeneratorFunctionCall;
@@ -130,7 +126,6 @@ declare const AuthIdentity: import("@prisma/orm-family-sql/contract-ts/contract-
130
126
  readonly nullable: false;
131
127
  readonly columnName?: undefined;
132
128
  readonly default?: import("@prisma/orm-family-sql/contract-ts/contract-builder").AuthoredColumnDefault | undefined;
133
- readonly executionDefaults?: import("@prisma/orm-framework/contract/types").ExecutionMutationDefaultPhases | undefined;
134
129
  readonly generatorCalls?: {
135
130
  readonly onCreate?: import("@prisma/orm-framework/components/components").GeneratorFunctionCall;
136
131
  readonly onUpdate?: import("@prisma/orm-framework/components/components").GeneratorFunctionCall;
@@ -159,7 +154,6 @@ declare const AuthIdentity: import("@prisma/orm-family-sql/contract-ts/contract-
159
154
  readonly nullable: false;
160
155
  readonly columnName?: undefined;
161
156
  readonly default?: import("@prisma/orm-family-sql/contract-ts/contract-builder").AuthoredColumnDefault | undefined;
162
- readonly executionDefaults?: import("@prisma/orm-framework/contract/types").ExecutionMutationDefaultPhases | undefined;
163
157
  readonly generatorCalls?: {
164
158
  readonly onCreate?: import("@prisma/orm-framework/components/components").GeneratorFunctionCall;
165
159
  readonly onUpdate?: import("@prisma/orm-framework/components/components").GeneratorFunctionCall;
@@ -186,7 +180,6 @@ declare const AuthIdentity: import("@prisma/orm-family-sql/contract-ts/contract-
186
180
  readonly nullable: false;
187
181
  readonly columnName?: undefined;
188
182
  readonly default?: import("@prisma/orm-family-sql/contract-ts/contract-builder").AuthoredColumnDefault | undefined;
189
- readonly executionDefaults?: import("@prisma/orm-framework/contract/types").ExecutionMutationDefaultPhases | undefined;
190
183
  readonly generatorCalls?: {
191
184
  readonly onCreate?: import("@prisma/orm-framework/components/components").GeneratorFunctionCall;
192
185
  readonly onUpdate?: import("@prisma/orm-framework/components/components").GeneratorFunctionCall;
@@ -213,7 +206,6 @@ declare const AuthIdentity: import("@prisma/orm-family-sql/contract-ts/contract-
213
206
  readonly nullable: false;
214
207
  readonly columnName?: undefined;
215
208
  readonly default?: import("@prisma/orm-family-sql/contract-ts/contract-builder").AuthoredColumnDefault | undefined;
216
- readonly executionDefaults?: import("@prisma/orm-framework/contract/types").ExecutionMutationDefaultPhases | undefined;
217
209
  readonly generatorCalls?: {
218
210
  readonly onCreate?: import("@prisma/orm-framework/components/components").GeneratorFunctionCall;
219
211
  readonly onUpdate?: import("@prisma/orm-framework/components/components").GeneratorFunctionCall;
@@ -240,7 +232,6 @@ declare const AuthIdentity: import("@prisma/orm-family-sql/contract-ts/contract-
240
232
  readonly nullable: false;
241
233
  readonly columnName?: undefined;
242
234
  readonly default?: import("@prisma/orm-family-sql/contract-ts/contract-builder").AuthoredColumnDefault | undefined;
243
- readonly executionDefaults?: import("@prisma/orm-framework/contract/types").ExecutionMutationDefaultPhases | undefined;
244
235
  readonly generatorCalls?: {
245
236
  readonly onCreate?: import("@prisma/orm-framework/components/components").GeneratorFunctionCall;
246
237
  readonly onUpdate?: import("@prisma/orm-framework/components/components").GeneratorFunctionCall;
@@ -269,7 +260,6 @@ declare const StorageBucket: import("@prisma/orm-family-sql/contract-ts/contract
269
260
  readonly nullable: false;
270
261
  readonly columnName?: undefined;
271
262
  readonly default?: import("@prisma/orm-family-sql/contract-ts/contract-builder").AuthoredColumnDefault | undefined;
272
- readonly executionDefaults?: import("@prisma/orm-framework/contract/types").ExecutionMutationDefaultPhases | undefined;
273
263
  readonly generatorCalls?: {
274
264
  readonly onCreate?: import("@prisma/orm-framework/components/components").GeneratorFunctionCall;
275
265
  readonly onUpdate?: import("@prisma/orm-framework/components/components").GeneratorFunctionCall;
@@ -298,7 +288,6 @@ declare const StorageBucket: import("@prisma/orm-family-sql/contract-ts/contract
298
288
  readonly nullable: false;
299
289
  readonly columnName?: undefined;
300
290
  readonly default?: import("@prisma/orm-family-sql/contract-ts/contract-builder").AuthoredColumnDefault | undefined;
301
- readonly executionDefaults?: import("@prisma/orm-framework/contract/types").ExecutionMutationDefaultPhases | undefined;
302
291
  readonly generatorCalls?: {
303
292
  readonly onCreate?: import("@prisma/orm-framework/components/components").GeneratorFunctionCall;
304
293
  readonly onUpdate?: import("@prisma/orm-framework/components/components").GeneratorFunctionCall;
@@ -325,7 +314,6 @@ declare const StorageBucket: import("@prisma/orm-family-sql/contract-ts/contract
325
314
  readonly nullable: false;
326
315
  readonly columnName?: undefined;
327
316
  readonly default?: import("@prisma/orm-family-sql/contract-ts/contract-builder").AuthoredColumnDefault | undefined;
328
- readonly executionDefaults?: import("@prisma/orm-framework/contract/types").ExecutionMutationDefaultPhases | undefined;
329
317
  readonly generatorCalls?: {
330
318
  readonly onCreate?: import("@prisma/orm-framework/components/components").GeneratorFunctionCall;
331
319
  readonly onUpdate?: import("@prisma/orm-framework/components/components").GeneratorFunctionCall;
@@ -352,7 +340,6 @@ declare const StorageBucket: import("@prisma/orm-family-sql/contract-ts/contract
352
340
  readonly nullable: false;
353
341
  readonly columnName?: undefined;
354
342
  readonly default?: import("@prisma/orm-family-sql/contract-ts/contract-builder").AuthoredColumnDefault | undefined;
355
- readonly executionDefaults?: import("@prisma/orm-framework/contract/types").ExecutionMutationDefaultPhases | undefined;
356
343
  readonly generatorCalls?: {
357
344
  readonly onCreate?: import("@prisma/orm-framework/components/components").GeneratorFunctionCall;
358
345
  readonly onUpdate?: import("@prisma/orm-framework/components/components").GeneratorFunctionCall;
@@ -381,7 +368,6 @@ declare const StorageObject: import("@prisma/orm-family-sql/contract-ts/contract
381
368
  readonly nullable: false;
382
369
  readonly columnName?: undefined;
383
370
  readonly default?: import("@prisma/orm-family-sql/contract-ts/contract-builder").AuthoredColumnDefault | undefined;
384
- readonly executionDefaults?: import("@prisma/orm-framework/contract/types").ExecutionMutationDefaultPhases | undefined;
385
371
  readonly generatorCalls?: {
386
372
  readonly onCreate?: import("@prisma/orm-framework/components/components").GeneratorFunctionCall;
387
373
  readonly onUpdate?: import("@prisma/orm-framework/components/components").GeneratorFunctionCall;
@@ -410,7 +396,6 @@ declare const StorageObject: import("@prisma/orm-family-sql/contract-ts/contract
410
396
  readonly nullable: false;
411
397
  readonly columnName?: undefined;
412
398
  readonly default?: import("@prisma/orm-family-sql/contract-ts/contract-builder").AuthoredColumnDefault | undefined;
413
- readonly executionDefaults?: import("@prisma/orm-framework/contract/types").ExecutionMutationDefaultPhases | undefined;
414
399
  readonly generatorCalls?: {
415
400
  readonly onCreate?: import("@prisma/orm-framework/components/components").GeneratorFunctionCall;
416
401
  readonly onUpdate?: import("@prisma/orm-framework/components/components").GeneratorFunctionCall;
@@ -437,7 +422,6 @@ declare const StorageObject: import("@prisma/orm-family-sql/contract-ts/contract
437
422
  readonly nullable: false;
438
423
  readonly columnName?: undefined;
439
424
  readonly default?: import("@prisma/orm-family-sql/contract-ts/contract-builder").AuthoredColumnDefault | undefined;
440
- readonly executionDefaults?: import("@prisma/orm-framework/contract/types").ExecutionMutationDefaultPhases | undefined;
441
425
  readonly generatorCalls?: {
442
426
  readonly onCreate?: import("@prisma/orm-framework/components/components").GeneratorFunctionCall;
443
427
  readonly onUpdate?: import("@prisma/orm-framework/components/components").GeneratorFunctionCall;
@@ -464,7 +448,6 @@ declare const StorageObject: import("@prisma/orm-family-sql/contract-ts/contract
464
448
  readonly nullable: false;
465
449
  readonly columnName?: undefined;
466
450
  readonly default?: import("@prisma/orm-family-sql/contract-ts/contract-builder").AuthoredColumnDefault | undefined;
467
- readonly executionDefaults?: import("@prisma/orm-framework/contract/types").ExecutionMutationDefaultPhases | undefined;
468
451
  readonly generatorCalls?: {
469
452
  readonly onCreate?: import("@prisma/orm-framework/components/components").GeneratorFunctionCall;
470
453
  readonly onUpdate?: import("@prisma/orm-framework/components/components").GeneratorFunctionCall;
@@ -491,7 +474,6 @@ declare const StorageObject: import("@prisma/orm-family-sql/contract-ts/contract
491
474
  readonly nullable: false;
492
475
  readonly columnName?: undefined;
493
476
  readonly default?: import("@prisma/orm-family-sql/contract-ts/contract-builder").AuthoredColumnDefault | undefined;
494
- readonly executionDefaults?: import("@prisma/orm-framework/contract/types").ExecutionMutationDefaultPhases | undefined;
495
477
  readonly generatorCalls?: {
496
478
  readonly onCreate?: import("@prisma/orm-framework/components/components").GeneratorFunctionCall;
497
479
  readonly onUpdate?: import("@prisma/orm-framework/components/components").GeneratorFunctionCall;
@@ -1 +1 @@
1
- {"version":3,"file":"contract.d.mts","names":[],"sources":["../../../../3-extensions/supabase/dist/contract.d.mts"],"mappings":";;;cAEc,+DAA+D;EAC3E,yDAAyD;aAC9C;aACA;eACE;eACA;eACA;;aAEF;eACE;;MAET,cAAc;;aAEP;aACA;aACA;aACA,+DAA+D;aAC/D,uDAAuD;aACvD;eACE,+DAA+D;eAC/D,+DAA+D;;aAEjE;;aAEA;eACE;;;aAGF;;EAEX,4DAA4D;aACjD;aACA;eACE;eACA;eACA;;aAEF;eACE;;MAET,cAAc;;aAEP;aACA;aACA;aACA,+DAA+D;aAC/D,uDAAuD;aACvD;eACE,+DAA+D;eAC/D,+DAA+D;;aAEjE;;aAEA;;aAEA;;EAEX,iEAAiE;aACtD;aACA;eACE;eACA;eACA;;aAEF;eACE;;MAET,cAAc;;aAEP;aACA;aACA;aACA,+DAA+D;aAC/D,uDAAuD;aACvD;eACE,+DAA+D;eAC/D,+DAA+D;;aAEjE;;aAEA;;aAEA;;EAEX,iEAAiE;aACtD;aACA;eACE;eACA;eACA;;aAEF;eACE;;MAET,cAAc;;aAEP;aACA;aACA;aACA,+DAA+D;aAC/D,uDAAuD;aACvD;eACE,+DAA+D;eAC/D,+DAA+D;;aAEjE;;aAEA;;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A;;aAEA;;GAEV,4CAA4C"}
1
+ {"version":3,"file":"contract.d.mts","names":[],"sources":["../../../../3-extensions/supabase/dist/contract.d.mts"],"mappings":";;;cAEc,+DAA+D;EAC3E,yDAAyD;aAC9C;aACA;eACE;eACA;eACA;;aAEF;eACE;;MAET,cAAc;;aAEP;aACA;aACA;aACA,+DAA+D;aAC/D;eACE,+DAA+D;eAC/D,+DAA+D;;aAEjE;;aAEA;eACE;;;aAGF;;EAEX,4DAA4D;aACjD;aACA;eACE;eACA;eACA;;aAEF;eACE;;MAET,cAAc;;aAEP;aACA;aACA;aACA,+DAA+D;aAC/D;eACE,+DAA+D;eAC/D,+DAA+D;;aAEjE;;aAEA;;aAEA;;EAEX,iEAAiE;aACtD;aACA;eACE;eACA;eACA;;aAEF;eACE;;MAET,cAAc;;aAEP;aACA;aACA;aACA,+DAA+D;aAC/D;eACE,+DAA+D;eAC/D,+DAA+D;;aAEjE;;aAEA;;aAEA;;EAEX,iEAAiE;aACtD;aACA;eACE;eACA;eACA;;aAEF;eACE;;MAET,cAAc;;aAEP;aACA;aACA;aACA,+DAA+D;aAC/D;eACE,+DAA+D;eAC/D,+DAA+D;;aAEjE;;aAEA;;aAEA;;GAEV,4CAA4C;cACjC,mEAAmE;EAC/E,yDAAyD;aAC9C;aACA;eACE;eACA;eACA;;aAEF;eACE;;MAET,cAAc;;aAEP;aACA;aACA;aACA,+DAA+D;aAC/D;eACE,+DAA+D;eAC/D,+DAA+D;;aAEjE;;aAEA;eACE;;;aAGF;;EAEX,8DAA8D;aACnD;aACA;eACE;eACA;eACA;;aAEF;eACE;;MAET,cAAc;;aAEP;aACA;aACA;aACA,+DAA+D;aAC/D;eACE,+DAA+D;eAC/D,+DAA+D;;aAEjE;;aAEA;;aAEA;;EAEX,+DAA+D;aACpD;aACA;eACE;eACA;eACA;;aAEF;eACE;;MAET,cAAc;;aAEP;aACA;aACA;aACA,+DAA+D;aAC/D;eACE,+DAA+D;eAC/D,+DAA+D;;aAEjE;;aA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;aACA;aACA;aACA,+DAA+D;aAC/D;eACE,+DAA+D;eAC/D,+DAA+D;;aAEjE;;aAEA;;aAEA;;EAEX,2DAA2D;aAChD;aACA;eACE;eACA;eACA;;aAEF;eACE;;MAET,cAAc;;aAEP;aACA;aACA;aACA,+DAA+D;aAC/D;eACE,+DAA+D;eAC/D,+DAA+D;;aAEjE;;aAEA;;aAEA;;EAEX,iEAAiE;aACtD;aACA;eACE;eACA;eACA;;aAEF;eACE;;MAET,cAAc;;aAEP;aACA;aACA;aACA,+DAA+D;aAC/D;eACE,+DAA+D;eAC/D,+DAA+D;;aAEjE;;aAEA;;aAEA;;EAEX,iEAAiE;aACtD;aACA;eACE;eACA;eACA;;aAEF;eACE;;MAET,cAAc;;aAEP;aACA;aACA;aACA,+DAA+D;aAC/D;eACE,+DAA+D;eAC/D,+DAA+D;;aAEjE;;aAEA;;aAEA;;GAEV,4CAA4C"}
package/dist/pack.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as version, t as contract_default } from "./contract-BIIhvdhY-CAUIh4vp.mjs";
1
+ import { n as version, t as contract_default } from "./contract-DWAaUaiQ-DDPkgqJr.mjs";
2
2
  import { blindCast } from "@prisma/orm-framework/utils/casts";
3
3
  //#region ../../../3-extensions/supabase/dist/pack.mjs
4
4
  const SUPABASE_SPACE_ID = "supabase";
package/dist/pack.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"pack.mjs","names":[],"sources":["../../../../3-extensions/supabase/dist/pack.mjs"],"sourcesContent":["import { n as version, t as contract_default } from \"./contract-BIIhvdhY.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\n//#region src/pack/index.ts\nconst SUPABASE_SPACE_ID = \"supabase\";\nfunction buildContractSpace(contractOverride) {\n\tconst contract = blindCast(contractOverride ?? contract_default);\n\treturn {\n\t\tcontractJson: contract,\n\t\tmigrations: [],\n\t\theadRef: {\n\t\t\thash: contract.storage.storageHash,\n\t\t\tinvariants: []\n\t\t}\n\t};\n}\nconst supabasePackBase = {\n\tkind: \"extension\",\n\tid: SUPABASE_SPACE_ID,\n\tfamilyId: \"sql\",\n\ttargetId: \"postgres\",\n\tversion,\n\tcontractSpace: buildContractSpace(),\n\tcreate: () => ({\n\t\tfamilyId: \"sql\",\n\t\ttargetId: \"postgres\"\n\t})\n};\nconst supabasePack = supabasePackBase;\n/**\n* Returns a pack using `contractOverride` in place of the shipped\n* `contract.json` when provided, otherwise returns the default pack.\n*\n* Intended for tests that need to drive the framework with a synthetic\n* contract while still exercising the full descriptor wiring.\n*/\nfunction supabasePackWith(options) {\n\tif (options?.contractOverride === void 0) return supabasePack;\n\treturn {\n\t\t...supabasePackBase,\n\t\tcontractSpace: buildContractSpace(options.contractOverride)\n\t};\n}\n//#endregion\nexport { supabasePack as default, supabasePackWith };\n\n//# sourceMappingURL=pack.mjs.map"],"mappings":";;;AAGA,MAAM,oBAAoB;AAC1B,SAAS,mBAAmB,kBAAkB;CAC7C,MAAM,WAAW,UAAU,oBAAoB,gBAAgB;CAC/D,OAAO;EACN,cAAc;EACd,YAAY,CAAC;EACb,SAAS;GACR,MAAM,SAAS,QAAQ;GACvB,YAAY,CAAC;EACd;CACD;AACD;AACA,MAAM,mBAAmB;CACxB,MAAM;CACN,IAAI;CACJ,UAAU;CACV,UAAU;CACV;CACA,eAAe,mBAAmB;CAClC,eAAe;EACd,UAAU;EACV,UAAU;CACX;AACD;AACA,MAAM,eAAe;;;;;;;;AAQrB,SAAS,iBAAiB,SAAS;CAClC,IAAI,SAAS,qBAAqB,KAAK,GAAG,OAAO;CACjD,OAAO;EACN,GAAG;EACH,eAAe,mBAAmB,QAAQ,gBAAgB;CAC3D;AACD"}
1
+ {"version":3,"file":"pack.mjs","names":[],"sources":["../../../../3-extensions/supabase/dist/pack.mjs"],"sourcesContent":["import { n as version, t as contract_default } from \"./contract-DWAaUaiQ.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\n//#region src/pack/index.ts\nconst SUPABASE_SPACE_ID = \"supabase\";\nfunction buildContractSpace(contractOverride) {\n\tconst contract = blindCast(contractOverride ?? contract_default);\n\treturn {\n\t\tcontractJson: contract,\n\t\tmigrations: [],\n\t\theadRef: {\n\t\t\thash: contract.storage.storageHash,\n\t\t\tinvariants: []\n\t\t}\n\t};\n}\nconst supabasePackBase = {\n\tkind: \"extension\",\n\tid: SUPABASE_SPACE_ID,\n\tfamilyId: \"sql\",\n\ttargetId: \"postgres\",\n\tversion,\n\tcontractSpace: buildContractSpace(),\n\tcreate: () => ({\n\t\tfamilyId: \"sql\",\n\t\ttargetId: \"postgres\"\n\t})\n};\nconst supabasePack = supabasePackBase;\n/**\n* Returns a pack using `contractOverride` in place of the shipped\n* `contract.json` when provided, otherwise returns the default pack.\n*\n* Intended for tests that need to drive the framework with a synthetic\n* contract while still exercising the full descriptor wiring.\n*/\nfunction supabasePackWith(options) {\n\tif (options?.contractOverride === void 0) return supabasePack;\n\treturn {\n\t\t...supabasePackBase,\n\t\tcontractSpace: buildContractSpace(options.contractOverride)\n\t};\n}\n//#endregion\nexport { supabasePack as default, supabasePackWith };\n\n//# sourceMappingURL=pack.mjs.map"],"mappings":";;;AAGA,MAAM,oBAAoB;AAC1B,SAAS,mBAAmB,kBAAkB;CAC7C,MAAM,WAAW,UAAU,oBAAoB,gBAAgB;CAC/D,OAAO;EACN,cAAc;EACd,YAAY,CAAC;EACb,SAAS;GACR,MAAM,SAAS,QAAQ;GACvB,YAAY,CAAC;EACd;CACD;AACD;AACA,MAAM,mBAAmB;CACxB,MAAM;CACN,IAAI;CACJ,UAAU;CACV,UAAU;CACV;CACA,eAAe,mBAAmB;CAClC,eAAe;EACd,UAAU;EACV,UAAU;CACX;AACD;AACA,MAAM,eAAe;;;;;;;;AAQrB,SAAS,iBAAiB,SAAS;CAClC,IAAI,SAAS,qBAAqB,KAAK,GAAG,OAAO;CACjD,OAAO;EACN,GAAG;EACH,eAAe,mBAAmB,QAAQ,gBAAgB;CAC3D;AACD"}
package/dist/runtime.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as version, t as contract_default } from "./contract-BIIhvdhY-CAUIh4vp.mjs";
1
+ import { n as version, t as contract_default } from "./contract-DWAaUaiQ-DDPkgqJr.mjs";
2
2
  import { a as isSupabaseRole, n as SupabaseRole, t as SUPABASE_JWT_ROLE_CLAIM } from "./roles-9Ql17Kbb-p1cF6Jlt.mjs";
3
3
  import { blindCast } from "@prisma/orm-framework/utils/casts";
4
4
  import postgresAdapter from "@prisma/orm-target-postgres/adapter/runtime";
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.mjs","names":[],"sources":["../../../../3-extensions/supabase/dist/runtime.mjs"],"sourcesContent":["import { n as version, t as contract_default } from \"./contract-BIIhvdhY.mjs\";\nimport { a as isSupabaseRole, n as SupabaseRole, t as SUPABASE_JWT_ROLE_CLAIM } from \"./roles-9Ql17Kbb.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport postgresAdapter from \"@internal/adapter-postgres/runtime\";\nimport postgresDriver, { createPgPool, suppressIdleConnectionErrors } from \"@internal/driver-postgres/runtime\";\nimport { buildPostgresStaticContext } from \"@internal/postgres/internal/static-context\";\nimport { buildPostgresQueryMembers } from \"@internal/postgres/internal/transaction-members\";\nimport { validatePostgresContract } from \"@internal/postgres/internal/validate-contract\";\nimport { PostgresRuntimeImpl, isPgPool } from \"@internal/postgres/runtime\";\nimport { checkCollectionClasses, orm, prepareQuery } from \"@internal/sql-orm-client\";\nimport { activitySource, createExecutionContext, createSqlExecutionStack, delegatingRuntime, withTransaction, withTransactionMembers } from \"@internal/sql-runtime\";\nimport { createTransactionStart, preparedStatementExecute, preparedStatementQuery, transactionStart } from \"@internal/sql-runtime/internal/prepared-query\";\nimport postgresTarget, { PostgresContractSerializer } from \"@internal/target-postgres/runtime\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { createRemoteJWKSet, decodeProtectedHeader, jwtVerify } from \"jose\";\nimport { AsyncIterableResult } from \"@internal/framework-components/runtime\";\n//#region src/runtime/descriptor.ts\n/**\n* Tells the runtime that the Supabase pack's runtime component is available.\n*\n* When a contract declares the Supabase pack, the runtime checks that a\n* matching descriptor has been registered. Without this, loading a Supabase\n* contract errors with \"pack runtime component missing\". The `supabase()`\n* factory registers this descriptor automatically — app code never needs to\n* reference it directly.\n*/\nconst supabaseRuntimeDescriptor = {\n\tkind: \"extension\",\n\tid: \"supabase\",\n\tversion,\n\tfamilyId: \"sql\",\n\ttargetId: \"postgres\",\n\tcodecs: () => [],\n\tcreate() {\n\t\treturn {\n\t\t\tfamilyId: \"sql\",\n\t\t\ttargetId: \"postgres\"\n\t\t};\n\t}\n};\n//#endregion\n//#region src/runtime/supabase-errors.ts\nfunction supabaseError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n//#endregion\n//#region src/runtime/supabase-runtime.ts\nlet buildRoleScope;\n/**\n* The operations under `binding` of the runtime `runtime()` returns. Each operation calls `runtime()` when it runs, so a client can build its role scope before its runtime exists; when `runtime()` throws, the operation rejects. For the facade only; the package entry does not export it.\n*/\nfunction roleScope(runtime, binding) {\n\treturn buildRoleScope(runtime, binding);\n}\nvar SupabaseRuntimeImpl = class extends PostgresRuntimeImpl {\n\t/**\n\t* Opens a raw connection and applies role + JWT claims via session-scoped set_config. On bind failure, destroys the connection before rethrowing — no leaked connections. Every operation of `forRole(binding)` runs on a session opened here.\n\t*/\n\tasync openRoleSession(binding) {\n\t\treturn (await this.openRoleConnection(binding)).session;\n\t}\n\tasync openRoleConnection(binding, options) {\n\t\tconst conn = await this.acquireRawConnection(options);\n\t\ttry {\n\t\t\tawait conn.execute({\n\t\t\t\tsql: \"SELECT set_config($1, $2, false)\",\n\t\t\t\tparams: [\"role\", binding.role]\n\t\t\t});\n\t\t\tawait conn.execute({\n\t\t\t\tsql: \"SELECT set_config($1, $2, false)\",\n\t\t\t\tparams: [\"request.jwt.claims\", JSON.stringify(binding.claims ?? {})]\n\t\t\t});\n\t\t} catch (err) {\n\t\t\tawait conn.destroy(err).catch(() => void 0);\n\t\t\tthrow err;\n\t\t}\n\t\tconst self = this;\n\t\tconst session = {\n\t\t\t[transactionStart]: createTransactionStart(),\n\t\t\t[activitySource]: self.connectionActivitySource(conn, () => session),\n\t\t\tquery(plan, options) {\n\t\t\t\treturn self.queryAgainstQueryable(plan, conn, {\n\t\t\t\t\t...options,\n\t\t\t\t\tscope: \"connection\"\n\t\t\t\t});\n\t\t\t},\n\t\t\texecute(plan, options) {\n\t\t\t\treturn self.executeStatisticsAgainstQueryable(plan, conn, {\n\t\t\t\t\t...options,\n\t\t\t\t\tscope: \"connection\"\n\t\t\t\t});\n\t\t\t},\n\t\t\t[preparedStatementQuery](prepared, params, options) {\n\t\t\t\treturn self.runPreparedQueryAgainstRoleQueryable(prepared, params, conn, options);\n\t\t\t},\n\t\t\t[preparedStatementExecute](prepared, params, options) {\n\t\t\t\treturn self.runPreparedExecuteAgainstRoleQueryable(prepared, params, conn, options);\n\t\t\t},\n\t\t\tasync transaction() {\n\t\t\t\treturn self.beginTransactionOn(conn, session, void 0);\n\t\t\t},\n\t\t\t/**\n\t\t\t* Resets all session-local config then releases the connection back to the pool.\n\t\t\t* If RESET ALL fails, destroys the connection instead — pool-poisoning guarantee.\n\t\t\t*/\n\t\t\tasync release() {\n\t\t\t\ttry {\n\t\t\t\t\tawait conn.execute({ sql: \"RESET ALL\" });\n\t\t\t\t\tawait conn.release();\n\t\t\t\t} catch (resetError) {\n\t\t\t\t\tawait conn.destroy(resetError).catch(() => void 0);\n\t\t\t\t}\n\t\t\t},\n\t\t\tasync destroy(reason) {\n\t\t\t\tawait conn.destroy(reason);\n\t\t\t}\n\t\t};\n\t\treturn {\n\t\t\tconn,\n\t\t\tsession\n\t\t};\n\t}\n\tforRole(binding) {\n\t\treturn buildRoleScope(() => this, binding);\n\t}\n\tstatic {\n\t\tbuildRoleScope = (runtime, binding) => {\n\t\t\tconst open = (options) => async () => (await runtime().openRoleConnection(binding, options)).session;\n\t\t\tconst scope = {\n\t\t\t\tquery(plan, options) {\n\t\t\t\t\treturn streamOnSession(open(options), (session) => session.query(plan, options));\n\t\t\t\t},\n\t\t\t\texecute(plan, options) {\n\t\t\t\t\treturn executeOnSession(open(options), (session) => session.execute(plan, options));\n\t\t\t\t},\n\t\t\t\t[preparedStatementQuery](statement, params, options) {\n\t\t\t\t\treturn streamOnSession(open(options), (session) => session[preparedStatementQuery](statement, params, options));\n\t\t\t\t},\n\t\t\t\t[preparedStatementExecute](statement, params, options) {\n\t\t\t\t\treturn executeOnSession(open(options), (session) => session[preparedStatementExecute](statement, params, options));\n\t\t\t\t},\n\t\t\t\tconnection: open(void 0),\n\t\t\t\t[activitySource]: {\n\t\t\t\t\tstartActivity: async (activity) => runtime().startActivityOnRoute(route, activity, void 0),\n\t\t\t\t\tplanContentHash: async (plan) => runtime().planContentHashFor(plan, \"connection\", void 0)\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst route = {\n\t\t\t\tscope: \"connection\",\n\t\t\t\tparent: () => void 0,\n\t\t\t\truntimeWork: true,\n\t\t\t\tquery: (plan, options) => scope.query(plan, options),\n\t\t\t\texecute: (plan, options) => scope.execute(plan, options),\n\t\t\t\tpreparedQuery: (statement, params, options) => scope[preparedStatementQuery](statement, params, options),\n\t\t\t\tpreparedExecute: (statement, params, options) => scope[preparedStatementExecute](statement, params, options),\n\t\t\t\ttransaction: (parent) => runtime().beginRoleTransaction(binding, parent)\n\t\t\t};\n\t\t\treturn scope;\n\t\t};\n\t}\n\tasync beginRoleTransaction(binding, parent) {\n\t\tconst { conn, session } = await this.openRoleConnection(binding, { activityParent: parent });\n\t\treturn this.ownTransaction(session, () => this.beginTransactionOn(conn, session, parent));\n\t}\n\trunPreparedExecuteAgainstRoleQueryable(prepared, params, queryable, options) {\n\t\treturn this.runPreparedExecuteAgainstQueryable(blindCast(prepared), blindCast(params), queryable, {\n\t\t\t...options,\n\t\t\tscope: \"connection\"\n\t\t});\n\t}\n\trunPreparedQueryAgainstRoleQueryable(prepared, params, queryable, options) {\n\t\treturn this.runPreparedQueryAgainstQueryable(blindCast(prepared), blindCast(params), queryable, {\n\t\t\t...options,\n\t\t\tscope: \"connection\"\n\t\t});\n\t}\n};\nfunction streamOnSession(open, rows) {\n\tconst generator = async function* () {\n\t\tconst session = await open();\n\t\tlet errored = false;\n\t\ttry {\n\t\t\tfor await (const row of rows(session)) yield row;\n\t\t} catch (err) {\n\t\t\terrored = true;\n\t\t\tawait session.destroy(err).catch(() => void 0);\n\t\t\tthrow err;\n\t\t} finally {\n\t\t\tif (!errored) await session.release();\n\t\t}\n\t};\n\treturn new AsyncIterableResult(generator());\n}\nasync function executeOnSession(open, run) {\n\tconst session = await open();\n\ttry {\n\t\tconst stats = await run(session);\n\t\tawait session.release();\n\t\treturn stats;\n\t} catch (err) {\n\t\tawait session.destroy(err).catch(() => void 0);\n\t\tthrow err;\n\t}\n}\n//#endregion\n//#region src/runtime/supabase.ts\nconst contractSerializer = new PostgresContractSerializer();\nfunction closedClientError() {\n\treturn structuredError(\"DRIVER.NOT_CONNECTED\", \"Runtime is closed\", {\n\t\twhy: \"close() was called on this client.\",\n\t\tfix: \"Create a new supabase(...) client.\",\n\t\tmeta: { extension: \"supabase\" }\n\t});\n}\nfunction resolveKeyMaterial(options) {\n\tconst jwtSecret = \"jwtSecret\" in options ? options.jwtSecret : void 0;\n\tconst jwksUrl = \"jwksUrl\" in options ? options.jwksUrl : void 0;\n\tif (jwtSecret !== void 0 && jwksUrl !== void 0) throw supabaseError(\"SUPABASE.CONFIG_INVALID\", \"Provide either jwtSecret or jwksUrl, not both\", { meta: { reason: \"both jwtSecret and jwksUrl provided\" } });\n\tif (jwtSecret !== void 0) return {\n\t\tkind: \"secret\",\n\t\tkey: new TextEncoder().encode(jwtSecret)\n\t};\n\tif (jwksUrl !== void 0) return {\n\t\tkind: \"jwks\",\n\t\tkeyset: createRemoteJWKSet(new URL(jwksUrl))\n\t};\n\tthrow supabaseError(\"SUPABASE.CONFIG_INVALID\", \"Either jwtSecret or jwksUrl is required\", { meta: { reason: \"neither jwtSecret nor jwksUrl provided\" } });\n}\n/**\n* Pre-verification check that the token's signing algorithm can possibly\n* match the configured key material. Without it the mismatch surfaces as a\n* jose internal (\"Key for the ES256 algorithm must be one of type\n* CryptoKey... Received an instance of Uint8Array\") that never names the\n* actual problem: current Supabase projects sign ES256 via JWKS by default,\n* while `supabase status` still prints a JWT_SECRET that only fits legacy\n* HS256 projects. Returns `undefined` when the pairing is plausible or the\n* header is unreadable (jwtVerify then produces the canonical error).\n*/\nfunction algKeyMismatchReason(jwt, kind) {\n\tlet alg;\n\ttry {\n\t\talg = decodeProtectedHeader(jwt).alg;\n\t} catch {\n\t\treturn;\n\t}\n\tif (alg === void 0) return void 0;\n\tconst asymmetric = /^(?:ES|RS|PS)\\d{3}$/.test(alg) || alg === \"EdDSA\" || alg === \"Ed25519\";\n\tif (kind === \"secret\" && asymmetric) return `token is signed with ${alg} but this client is configured with jwtSecret (HS256). Current Supabase projects sign with asymmetric keys by default — configure jwksUrl (https://<project>/auth/v1/.well-known/jwks.json) instead of jwtSecret.`;\n\tif (kind === \"jwks\" && alg.startsWith(\"HS\")) return `token is signed with ${alg} (a symmetric algorithm) but this client is configured with jwksUrl. A legacy HS256 Supabase project needs jwtSecret (the JWT_SECRET from \\`supabase status\\`) instead of jwksUrl.`;\n}\nfunction checkPgOption(pg) {\n\tif (pg === void 0 || typeof pg === \"object\" && pg !== null && isPgPool(pg)) return;\n\tthrow supabaseError(\"SUPABASE.CONFIG_INVALID\", \"The pg option takes a pg.Pool\", {\n\t\twhy: \"Each role-bound query needs a connection of its own, which a single pg.Client cannot give.\",\n\t\tfix: \"Pass a pg.Pool as pg, or pass url.\",\n\t\tmeta: { reason: \"pg is not a pg.Pool\" }\n\t});\n}\nfunction toPoolBinding(options) {\n\tif (options.pg !== void 0 && isPgPool(options.pg)) return {\n\t\tkind: \"pgPool\",\n\t\tpool: options.pg,\n\t\townedByDriver: false\n\t};\n\tif (typeof options.url === \"string\") return {\n\t\tkind: \"pgPool\",\n\t\tpool: suppressIdleConnectionErrors(createPgPool({\n\t\t\tconnectionString: options.url,\n\t\t\tconnectionTimeoutMillis: options.poolOptions?.connectionTimeoutMillis ?? 2e4,\n\t\t\tidleTimeoutMillis: options.poolOptions?.idleTimeoutMillis ?? 3e4\n\t\t}, postgresTarget.sessionSettings ?? {})),\n\t\townedByDriver: true\n\t};\n}\nfunction withSupabaseDescriptor(extensions) {\n\tconst packs = extensions ?? [];\n\treturn packs.some((pack) => pack.id === supabaseRuntimeDescriptor.id) ? packs : [...packs, supabaseRuntimeDescriptor];\n}\n/**\n* Deserializes the Supabase extension's own emitted contract into a runtime\n* contract: namespaces hydrate into `PostgresSchema` instances (with\n* `qualifyTable`), and each column resolves its codec through the codec\n* registry. Exposed only via `service_role`'s `.supabase`\n* secondary root — never merged into the app contract.\n*/\nfunction buildExtensionContract() {\n\treturn blindCast(contractSerializer.deserializeContract(contract_default));\n}\n/**\n* Creates a Supabase client whose queries run as the role a JWT names. The client infers its\n* contract type from `contract`: a value from `contractFromJson` of `@prisma/orm-postgres/static`\n* for an emitted contract, or a TypeScript-authored contract. A contract is validated once, however\n* many clients are built from it. The pool is created on the first query.\n*\n* @example\n* ```ts\n* import { contractFromJson } from '@prisma/orm-postgres/static';\n* import { supabase } from '@prisma/orm-extension-supabase/runtime';\n* import type { Contract } from './contract.d';\n* import contractJson from './contract.json' with { type: 'json' };\n*\n* export const contract = contractFromJson<Contract>(contractJson);\n* export const db = await supabase({ contract, url, jwtSecret });\n* ```\n*/\nasync function supabase(options) {\n\tconst keyMaterial = resolveKeyMaterial(options);\n\tcheckPgOption(options.pg);\n\tconst contract = validatePostgresContract(options.contract);\n\tconst stack = createSqlExecutionStack({\n\t\ttarget: postgresTarget,\n\t\tadapter: postgresAdapter,\n\t\tdriver: postgresDriver,\n\t\textensions: withSupabaseDescriptor(options.extensions)\n\t});\n\tconst context = createExecutionContext({\n\t\tcontract,\n\t\tstack\n\t});\n\tcheckCollectionClasses(contract, options.collections);\n\tconst { sql: appSql, raw, toSql, enums, nativeEnums } = buildPostgresStaticContext(contract, context, stack);\n\tconst extContract = buildExtensionContract();\n\tconst extContext = createExecutionContext({\n\t\tcontract: extContract,\n\t\tstack\n\t});\n\tconst extStatic = buildPostgresStaticContext(extContract, extContext, stack);\n\tlet runtimes;\n\tlet connectError;\n\tlet closed = false;\n\tfunction getRuntimes() {\n\t\tif (connectError !== void 0) throw connectError.error;\n\t\tif (runtimes !== void 0) return runtimes;\n\t\tif (closed) throw closedClientError();\n\t\tconst driverDescriptor = stack.driver;\n\t\tif (!driverDescriptor) throw new InternalError(\"Driver descriptor missing from execution stack\");\n\t\tconst adapter = stack.adapter.create(stack);\n\t\tconst driver = driverDescriptor.create({ cursor: { disabled: true } });\n\t\tconst sharedOptions = {\n\t\t\tadapter,\n\t\t\tdriver,\n\t\t\t...ifDefined(\"middleware\", options.middleware),\n\t\t\t...ifDefined(\"log\", options.log),\n\t\t\t...ifDefined(\"mode\", options.mode),\n\t\t\tcloseRefusal: \"at-once\",\n\t\t\townsDriver: false\n\t\t};\n\t\tconst runtime = new SupabaseRuntimeImpl({\n\t\t\tcontext,\n\t\t\t...sharedOptions,\n\t\t\t...ifDefined(\"verifyMarker\", options.verifyMarker)\n\t\t});\n\t\tconst extRuntime = new SupabaseRuntimeImpl({\n\t\t\tcontext: extContext,\n\t\t\t...sharedOptions,\n\t\t\tverifyMarker: false\n\t\t});\n\t\tconst poolBinding = toPoolBinding(options);\n\t\tif (poolBinding) driver.connect(poolBinding).catch(async (err) => {\n\t\t\tconnectError = { error: err };\n\t\t\tif (poolBinding.ownedByDriver) await poolBinding.pool.end().catch(() => void 0);\n\t\t});\n\t\truntimes = {\n\t\t\truntime,\n\t\t\textRuntime,\n\t\t\tdriver,\n\t\t\tpoolBinding\n\t\t};\n\t\treturn runtimes;\n\t}\n\tconst runtime = () => getRuntimes().runtime;\n\tconst extRuntime = () => getRuntimes().extRuntime;\n\tconst workRuntime = delegatingRuntime(runtime);\n\tasync function verifyJwt(jwt) {\n\t\tconst mismatch = algKeyMismatchReason(jwt, keyMaterial.kind);\n\t\tif (mismatch !== void 0) throw supabaseError(\"SUPABASE.JWT_INVALID\", `Invalid JWT: ${mismatch}`, { meta: { reason: mismatch } });\n\t\ttry {\n\t\t\tif (keyMaterial.kind === \"secret\") return await jwtVerify(jwt, keyMaterial.key);\n\t\t\treturn await jwtVerify(jwt, keyMaterial.keyset);\n\t\t} catch (err) {\n\t\t\tconst reason = err instanceof Error ? err.message : String(err);\n\t\t\tthrow supabaseError(\"SUPABASE.JWT_INVALID\", `Invalid JWT: ${reason}`, {\n\t\t\t\tmeta: { reason },\n\t\t\t\tcause: err\n\t\t\t});\n\t\t}\n\t}\n\tfunction buildRoleBoundDb(binding) {\n\t\tconst role = roleScope(runtime, binding);\n\t\tconst roleOrm = orm({\n\t\t\truntime: role,\n\t\t\tcontext,\n\t\t\t...ifDefined(\"collections\", options.collections)\n\t\t});\n\t\tconst roleBound = {\n\t\t\tsql: appSql,\n\t\t\torm: roleOrm,\n\t\t\traw,\n\t\t\ttoSql,\n\t\t\tenums,\n\t\t\tnativeEnums,\n\t\t\tprepare(declaration, callback) {\n\t\t\t\treturn prepareQuery(workRuntime, declaration, callback);\n\t\t\t},\n\t\t\tquery: role.query,\n\t\t\texecute: role.execute,\n\t\t\t[preparedStatementQuery]: role[preparedStatementQuery],\n\t\t\t[preparedStatementExecute]: role[preparedStatementExecute],\n\t\t\ttransaction(fn) {\n\t\t\t\treturn withTransaction(role, (txCtx) => fn(withTransactionMembers(txCtx, {\n\t\t\t\t\t...buildPostgresQueryMembers({\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\tcollections: options.collections,\n\t\t\t\t\t\tsql: appSql,\n\t\t\t\t\t\traw,\n\t\t\t\t\t\ttoSql,\n\t\t\t\t\t\tprepareRuntime: workRuntime\n\t\t\t\t\t}, txCtx),\n\t\t\t\t\tenums,\n\t\t\t\t\tnativeEnums\n\t\t\t\t})));\n\t\t\t}\n\t\t};\n\t\treturn Object.assign(roleBound, { [activitySource]: role[activitySource] });\n\t}\n\tconst serviceRoleBinding = {\n\t\trole: SupabaseRole.members.ServiceRole,\n\t\tclaims: {}\n\t};\n\tconst serviceRole = roleScope(extRuntime, serviceRoleBinding);\n\tconst supabaseInternal = {\n\t\tsql: extStatic.sql,\n\t\ttoSql: extStatic.toSql,\n\t\torm: orm({\n\t\t\truntime: serviceRole,\n\t\t\tcontext: extContext\n\t\t}),\n\t\tnativeEnums: extStatic.nativeEnums,\n\t\tquery: serviceRole.query,\n\t\texecute: serviceRole.execute\n\t};\n\tlet closePromise;\n\tasync function closeRuntimes() {\n\t\tif (runtimes === void 0) return;\n\t\tconst { runtime, extRuntime, driver } = runtimes;\n\t\tawait Promise.all([runtime.close(), extRuntime.close()]);\n\t\tawait driver.close();\n\t}\n\tfunction closeDb() {\n\t\tclosed = true;\n\t\tclosePromise ??= closeRuntimes();\n\t\treturn closePromise;\n\t}\n\treturn {\n\t\tcontext,\n\t\tstack,\n\t\tasync asUser(jwt) {\n\t\t\tconst { payload } = await verifyJwt(jwt);\n\t\t\tconst rawRole = payload[SUPABASE_JWT_ROLE_CLAIM];\n\t\t\tconst roleStr = typeof rawRole === \"string\" ? rawRole : SupabaseRole.members.Authenticated;\n\t\t\treturn buildRoleBoundDb({\n\t\t\t\trole: isSupabaseRole(roleStr) ? roleStr : SupabaseRole.members.Authenticated,\n\t\t\t\tclaims: payload\n\t\t\t});\n\t\t},\n\t\tasAnon() {\n\t\t\treturn buildRoleBoundDb({\n\t\t\t\trole: SupabaseRole.members.Anon,\n\t\t\t\tclaims: {}\n\t\t\t});\n\t\t},\n\t\tasServiceRole() {\n\t\t\treturn {\n\t\t\t\t...buildRoleBoundDb(serviceRoleBinding),\n\t\t\t\tsupabase: supabaseInternal\n\t\t\t};\n\t\t},\n\t\tclose: closeDb,\n\t\t[Symbol.asyncDispose]: closeDb\n\t};\n}\n//#endregion\n//#region src/exports/runtime.ts\nvar runtime_default = supabaseRuntimeDescriptor;\n//#endregion\nexport { SupabaseRuntimeImpl, runtime_default as default, supabase };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAM,4BAA4B;CACjC,MAAM;CACN,IAAI;CACJ;CACA,UAAU;CACV,UAAU;CACV,cAAc,CAAC;CACf,SAAS;EACR,OAAO;GACN,UAAU;GACV,UAAU;EACX;CACD;AACD;AAGA,SAAS,cAAc,MAAM,SAAS,SAAS;CAC9C,OAAO,gBAAgB,MAAM,SAAS,OAAO;AAC9C;AAGA,IAAI;;;;AAIJ,SAAS,UAAU,SAAS,SAAS;CACpC,OAAO,eAAe,SAAS,OAAO;AACvC;AACA,IAAI,sBAAsB,cAAc,oBAAoB;;;;CAI3D,MAAM,gBAAgB,SAAS;EAC9B,QAAQ,MAAM,KAAK,mBAAmB,OAAO,EAAA,CAAG;CACjD;CACA,MAAM,mBAAmB,SAAS,SAAS;EAC1C,MAAM,OAAO,MAAM,KAAK,qBAAqB,OAAO;EACpD,IAAI;GACH,MAAM,KAAK,QAAQ;IAClB,KAAK;IACL,QAAQ,CAAC,QAAQ,QAAQ,IAAI;GAC9B,CAAC;GACD,MAAM,KAAK,QAAQ;IAClB,KAAK;IACL,QAAQ,CAAC,sBAAsB,KAAK,UAAU,QAAQ,UAAU,CAAC,CAAC,CAAC;GACpE,CAAC;EACF,SAAS,KAAK;GACb,MAAM,KAAK,QAAQ,GAAG,CAAC,CAAC,YAAY,KAAK,CAAC;GAC1C,MAAM;EACP;EACA,MAAM,OAAO;EACb,MAAM,UAAU;IACd,mBAAmB,uBAAuB;IAC1C,iBAAiB,KAAK,yBAAyB,YAAY,OAAO;GACnE,MAAM,MAAM,SAAS;IACpB,OAAO,KAAK,sBAAsB,MAAM,MAAM;KAC7C,GAAG;KACH,OAAO;IACR,CAAC;GACF;GACA,QAAQ,MAAM,SAA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gB;GACf,OAAO;IACN,GAAG,iBAAiB,kBAAkB;IACtC,UAAU;GACX;EACD;EACA,OAAO;GACN,OAAO,eAAe;CACxB;AACD;AAGA,IAAI,kBAAkB"}
1
+ {"version":3,"file":"runtime.mjs","names":[],"sources":["../../../../3-extensions/supabase/dist/runtime.mjs"],"sourcesContent":["import { n as version, t as contract_default } from \"./contract-DWAaUaiQ.mjs\";\nimport { a as isSupabaseRole, n as SupabaseRole, t as SUPABASE_JWT_ROLE_CLAIM } from \"./roles-9Ql17Kbb.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport postgresAdapter from \"@internal/adapter-postgres/runtime\";\nimport postgresDriver, { createPgPool, suppressIdleConnectionErrors } from \"@internal/driver-postgres/runtime\";\nimport { buildPostgresStaticContext } from \"@internal/postgres/internal/static-context\";\nimport { buildPostgresQueryMembers } from \"@internal/postgres/internal/transaction-members\";\nimport { validatePostgresContract } from \"@internal/postgres/internal/validate-contract\";\nimport { PostgresRuntimeImpl, isPgPool } from \"@internal/postgres/runtime\";\nimport { checkCollectionClasses, orm, prepareQuery } from \"@internal/sql-orm-client\";\nimport { activitySource, createExecutionContext, createSqlExecutionStack, delegatingRuntime, withTransaction, withTransactionMembers } from \"@internal/sql-runtime\";\nimport { createTransactionStart, preparedStatementExecute, preparedStatementQuery, transactionStart } from \"@internal/sql-runtime/internal/prepared-query\";\nimport postgresTarget, { PostgresContractSerializer } from \"@internal/target-postgres/runtime\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { createRemoteJWKSet, decodeProtectedHeader, jwtVerify } from \"jose\";\nimport { AsyncIterableResult } from \"@internal/framework-components/runtime\";\n//#region src/runtime/descriptor.ts\n/**\n* Tells the runtime that the Supabase pack's runtime component is available.\n*\n* When a contract declares the Supabase pack, the runtime checks that a\n* matching descriptor has been registered. Without this, loading a Supabase\n* contract errors with \"pack runtime component missing\". The `supabase()`\n* factory registers this descriptor automatically — app code never needs to\n* reference it directly.\n*/\nconst supabaseRuntimeDescriptor = {\n\tkind: \"extension\",\n\tid: \"supabase\",\n\tversion,\n\tfamilyId: \"sql\",\n\ttargetId: \"postgres\",\n\tcodecs: () => [],\n\tcreate() {\n\t\treturn {\n\t\t\tfamilyId: \"sql\",\n\t\t\ttargetId: \"postgres\"\n\t\t};\n\t}\n};\n//#endregion\n//#region src/runtime/supabase-errors.ts\nfunction supabaseError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n//#endregion\n//#region src/runtime/supabase-runtime.ts\nlet buildRoleScope;\n/**\n* The operations under `binding` of the runtime `runtime()` returns. Each operation calls `runtime()` when it runs, so a client can build its role scope before its runtime exists; when `runtime()` throws, the operation rejects. For the facade only; the package entry does not export it.\n*/\nfunction roleScope(runtime, binding) {\n\treturn buildRoleScope(runtime, binding);\n}\nvar SupabaseRuntimeImpl = class extends PostgresRuntimeImpl {\n\t/**\n\t* Opens a raw connection and applies role + JWT claims via session-scoped set_config. On bind failure, destroys the connection before rethrowing — no leaked connections. Every operation of `forRole(binding)` runs on a session opened here.\n\t*/\n\tasync openRoleSession(binding) {\n\t\treturn (await this.openRoleConnection(binding)).session;\n\t}\n\tasync openRoleConnection(binding, options) {\n\t\tconst conn = await this.acquireRawConnection(options);\n\t\ttry {\n\t\t\tawait conn.execute({\n\t\t\t\tsql: \"SELECT set_config($1, $2, false)\",\n\t\t\t\tparams: [\"role\", binding.role]\n\t\t\t});\n\t\t\tawait conn.execute({\n\t\t\t\tsql: \"SELECT set_config($1, $2, false)\",\n\t\t\t\tparams: [\"request.jwt.claims\", JSON.stringify(binding.claims ?? {})]\n\t\t\t});\n\t\t} catch (err) {\n\t\t\tawait conn.destroy(err).catch(() => void 0);\n\t\t\tthrow err;\n\t\t}\n\t\tconst self = this;\n\t\tconst session = {\n\t\t\t[transactionStart]: createTransactionStart(),\n\t\t\t[activitySource]: self.connectionActivitySource(conn, () => session),\n\t\t\tquery(plan, options) {\n\t\t\t\treturn self.queryAgainstQueryable(plan, conn, {\n\t\t\t\t\t...options,\n\t\t\t\t\tscope: \"connection\"\n\t\t\t\t});\n\t\t\t},\n\t\t\texecute(plan, options) {\n\t\t\t\treturn self.executeStatisticsAgainstQueryable(plan, conn, {\n\t\t\t\t\t...options,\n\t\t\t\t\tscope: \"connection\"\n\t\t\t\t});\n\t\t\t},\n\t\t\t[preparedStatementQuery](prepared, params, options) {\n\t\t\t\treturn self.runPreparedQueryAgainstRoleQueryable(prepared, params, conn, options);\n\t\t\t},\n\t\t\t[preparedStatementExecute](prepared, params, options) {\n\t\t\t\treturn self.runPreparedExecuteAgainstRoleQueryable(prepared, params, conn, options);\n\t\t\t},\n\t\t\tasync transaction() {\n\t\t\t\treturn self.beginTransactionOn(conn, session, void 0);\n\t\t\t},\n\t\t\t/**\n\t\t\t* Resets all session-local config then releases the connection back to the pool.\n\t\t\t* If RESET ALL fails, destroys the connection instead — pool-poisoning guarantee.\n\t\t\t*/\n\t\t\tasync release() {\n\t\t\t\ttry {\n\t\t\t\t\tawait conn.execute({ sql: \"RESET ALL\" });\n\t\t\t\t\tawait conn.release();\n\t\t\t\t} catch (resetError) {\n\t\t\t\t\tawait conn.destroy(resetError).catch(() => void 0);\n\t\t\t\t}\n\t\t\t},\n\t\t\tasync destroy(reason) {\n\t\t\t\tawait conn.destroy(reason);\n\t\t\t}\n\t\t};\n\t\treturn {\n\t\t\tconn,\n\t\t\tsession\n\t\t};\n\t}\n\tforRole(binding) {\n\t\treturn buildRoleScope(() => this, binding);\n\t}\n\tstatic {\n\t\tbuildRoleScope = (runtime, binding) => {\n\t\t\tconst open = (options) => async () => (await runtime().openRoleConnection(binding, options)).session;\n\t\t\tconst scope = {\n\t\t\t\tquery(plan, options) {\n\t\t\t\t\treturn streamOnSession(open(options), (session) => session.query(plan, options));\n\t\t\t\t},\n\t\t\t\texecute(plan, options) {\n\t\t\t\t\treturn executeOnSession(open(options), (session) => session.execute(plan, options));\n\t\t\t\t},\n\t\t\t\t[preparedStatementQuery](statement, params, options) {\n\t\t\t\t\treturn streamOnSession(open(options), (session) => session[preparedStatementQuery](statement, params, options));\n\t\t\t\t},\n\t\t\t\t[preparedStatementExecute](statement, params, options) {\n\t\t\t\t\treturn executeOnSession(open(options), (session) => session[preparedStatementExecute](statement, params, options));\n\t\t\t\t},\n\t\t\t\tconnection: open(void 0),\n\t\t\t\t[activitySource]: {\n\t\t\t\t\tstartActivity: async (activity) => runtime().startActivityOnRoute(route, activity, void 0),\n\t\t\t\t\tplanContentHash: async (plan) => runtime().planContentHashFor(plan, \"connection\", void 0)\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst route = {\n\t\t\t\tscope: \"connection\",\n\t\t\t\tparent: () => void 0,\n\t\t\t\truntimeWork: true,\n\t\t\t\tquery: (plan, options) => scope.query(plan, options),\n\t\t\t\texecute: (plan, options) => scope.execute(plan, options),\n\t\t\t\tpreparedQuery: (statement, params, options) => scope[preparedStatementQuery](statement, params, options),\n\t\t\t\tpreparedExecute: (statement, params, options) => scope[preparedStatementExecute](statement, params, options),\n\t\t\t\ttransaction: (parent) => runtime().beginRoleTransaction(binding, parent)\n\t\t\t};\n\t\t\treturn scope;\n\t\t};\n\t}\n\tasync beginRoleTransaction(binding, parent) {\n\t\tconst { conn, session } = await this.openRoleConnection(binding, { activityParent: parent });\n\t\treturn this.ownTransaction(session, () => this.beginTransactionOn(conn, session, parent));\n\t}\n\trunPreparedExecuteAgainstRoleQueryable(prepared, params, queryable, options) {\n\t\treturn this.runPreparedExecuteAgainstQueryable(blindCast(prepared), blindCast(params), queryable, {\n\t\t\t...options,\n\t\t\tscope: \"connection\"\n\t\t});\n\t}\n\trunPreparedQueryAgainstRoleQueryable(prepared, params, queryable, options) {\n\t\treturn this.runPreparedQueryAgainstQueryable(blindCast(prepared), blindCast(params), queryable, {\n\t\t\t...options,\n\t\t\tscope: \"connection\"\n\t\t});\n\t}\n};\nfunction streamOnSession(open, rows) {\n\tconst generator = async function* () {\n\t\tconst session = await open();\n\t\tlet errored = false;\n\t\ttry {\n\t\t\tfor await (const row of rows(session)) yield row;\n\t\t} catch (err) {\n\t\t\terrored = true;\n\t\t\tawait session.destroy(err).catch(() => void 0);\n\t\t\tthrow err;\n\t\t} finally {\n\t\t\tif (!errored) await session.release();\n\t\t}\n\t};\n\treturn new AsyncIterableResult(generator());\n}\nasync function executeOnSession(open, run) {\n\tconst session = await open();\n\ttry {\n\t\tconst stats = await run(session);\n\t\tawait session.release();\n\t\treturn stats;\n\t} catch (err) {\n\t\tawait session.destroy(err).catch(() => void 0);\n\t\tthrow err;\n\t}\n}\n//#endregion\n//#region src/runtime/supabase.ts\nconst contractSerializer = new PostgresContractSerializer();\nfunction closedClientError() {\n\treturn structuredError(\"DRIVER.NOT_CONNECTED\", \"Runtime is closed\", {\n\t\twhy: \"close() was called on this client.\",\n\t\tfix: \"Create a new supabase(...) client.\",\n\t\tmeta: { extension: \"supabase\" }\n\t});\n}\nfunction resolveKeyMaterial(options) {\n\tconst jwtSecret = \"jwtSecret\" in options ? options.jwtSecret : void 0;\n\tconst jwksUrl = \"jwksUrl\" in options ? options.jwksUrl : void 0;\n\tif (jwtSecret !== void 0 && jwksUrl !== void 0) throw supabaseError(\"SUPABASE.CONFIG_INVALID\", \"Provide either jwtSecret or jwksUrl, not both\", { meta: { reason: \"both jwtSecret and jwksUrl provided\" } });\n\tif (jwtSecret !== void 0) return {\n\t\tkind: \"secret\",\n\t\tkey: new TextEncoder().encode(jwtSecret)\n\t};\n\tif (jwksUrl !== void 0) return {\n\t\tkind: \"jwks\",\n\t\tkeyset: createRemoteJWKSet(new URL(jwksUrl))\n\t};\n\tthrow supabaseError(\"SUPABASE.CONFIG_INVALID\", \"Either jwtSecret or jwksUrl is required\", { meta: { reason: \"neither jwtSecret nor jwksUrl provided\" } });\n}\n/**\n* Pre-verification check that the token's signing algorithm can possibly\n* match the configured key material. Without it the mismatch surfaces as a\n* jose internal (\"Key for the ES256 algorithm must be one of type\n* CryptoKey... Received an instance of Uint8Array\") that never names the\n* actual problem: current Supabase projects sign ES256 via JWKS by default,\n* while `supabase status` still prints a JWT_SECRET that only fits legacy\n* HS256 projects. Returns `undefined` when the pairing is plausible or the\n* header is unreadable (jwtVerify then produces the canonical error).\n*/\nfunction algKeyMismatchReason(jwt, kind) {\n\tlet alg;\n\ttry {\n\t\talg = decodeProtectedHeader(jwt).alg;\n\t} catch {\n\t\treturn;\n\t}\n\tif (alg === void 0) return void 0;\n\tconst asymmetric = /^(?:ES|RS|PS)\\d{3}$/.test(alg) || alg === \"EdDSA\" || alg === \"Ed25519\";\n\tif (kind === \"secret\" && asymmetric) return `token is signed with ${alg} but this client is configured with jwtSecret (HS256). Current Supabase projects sign with asymmetric keys by default — configure jwksUrl (https://<project>/auth/v1/.well-known/jwks.json) instead of jwtSecret.`;\n\tif (kind === \"jwks\" && alg.startsWith(\"HS\")) return `token is signed with ${alg} (a symmetric algorithm) but this client is configured with jwksUrl. A legacy HS256 Supabase project needs jwtSecret (the JWT_SECRET from \\`supabase status\\`) instead of jwksUrl.`;\n}\nfunction checkPgOption(pg) {\n\tif (pg === void 0 || typeof pg === \"object\" && pg !== null && isPgPool(pg)) return;\n\tthrow supabaseError(\"SUPABASE.CONFIG_INVALID\", \"The pg option takes a pg.Pool\", {\n\t\twhy: \"Each role-bound query needs a connection of its own, which a single pg.Client cannot give.\",\n\t\tfix: \"Pass a pg.Pool as pg, or pass url.\",\n\t\tmeta: { reason: \"pg is not a pg.Pool\" }\n\t});\n}\nfunction toPoolBinding(options) {\n\tif (options.pg !== void 0 && isPgPool(options.pg)) return {\n\t\tkind: \"pgPool\",\n\t\tpool: options.pg,\n\t\townedByDriver: false\n\t};\n\tif (typeof options.url === \"string\") return {\n\t\tkind: \"pgPool\",\n\t\tpool: suppressIdleConnectionErrors(createPgPool({\n\t\t\tconnectionString: options.url,\n\t\t\tconnectionTimeoutMillis: options.poolOptions?.connectionTimeoutMillis ?? 2e4,\n\t\t\tidleTimeoutMillis: options.poolOptions?.idleTimeoutMillis ?? 3e4\n\t\t}, postgresTarget.sessionSettings ?? {})),\n\t\townedByDriver: true\n\t};\n}\nfunction withSupabaseDescriptor(extensions) {\n\tconst packs = extensions ?? [];\n\treturn packs.some((pack) => pack.id === supabaseRuntimeDescriptor.id) ? packs : [...packs, supabaseRuntimeDescriptor];\n}\n/**\n* Deserializes the Supabase extension's own emitted contract into a runtime\n* contract: namespaces hydrate into `PostgresSchema` instances (with\n* `qualifyTable`), and each column resolves its codec through the codec\n* registry. Exposed only via `service_role`'s `.supabase`\n* secondary root — never merged into the app contract.\n*/\nfunction buildExtensionContract() {\n\treturn blindCast(contractSerializer.deserializeContract(contract_default));\n}\n/**\n* Creates a Supabase client whose queries run as the role a JWT names. The client infers its\n* contract type from `contract`: a value from `contractFromJson` of `@prisma/orm-postgres/static`\n* for an emitted contract, or a TypeScript-authored contract. A contract is validated once, however\n* many clients are built from it. The pool is created on the first query.\n*\n* @example\n* ```ts\n* import { contractFromJson } from '@prisma/orm-postgres/static';\n* import { supabase } from '@prisma/orm-extension-supabase/runtime';\n* import type { Contract } from './contract.d';\n* import contractJson from './contract.json' with { type: 'json' };\n*\n* export const contract = contractFromJson<Contract>(contractJson);\n* export const db = await supabase({ contract, url, jwtSecret });\n* ```\n*/\nasync function supabase(options) {\n\tconst keyMaterial = resolveKeyMaterial(options);\n\tcheckPgOption(options.pg);\n\tconst contract = validatePostgresContract(options.contract);\n\tconst stack = createSqlExecutionStack({\n\t\ttarget: postgresTarget,\n\t\tadapter: postgresAdapter,\n\t\tdriver: postgresDriver,\n\t\textensions: withSupabaseDescriptor(options.extensions)\n\t});\n\tconst context = createExecutionContext({\n\t\tcontract,\n\t\tstack\n\t});\n\tcheckCollectionClasses(contract, options.collections);\n\tconst { sql: appSql, raw, toSql, enums, nativeEnums } = buildPostgresStaticContext(contract, context, stack);\n\tconst extContract = buildExtensionContract();\n\tconst extContext = createExecutionContext({\n\t\tcontract: extContract,\n\t\tstack\n\t});\n\tconst extStatic = buildPostgresStaticContext(extContract, extContext, stack);\n\tlet runtimes;\n\tlet connectError;\n\tlet closed = false;\n\tfunction getRuntimes() {\n\t\tif (connectError !== void 0) throw connectError.error;\n\t\tif (runtimes !== void 0) return runtimes;\n\t\tif (closed) throw closedClientError();\n\t\tconst driverDescriptor = stack.driver;\n\t\tif (!driverDescriptor) throw new InternalError(\"Driver descriptor missing from execution stack\");\n\t\tconst adapter = stack.adapter.create(stack);\n\t\tconst driver = driverDescriptor.create({ cursor: { disabled: true } });\n\t\tconst sharedOptions = {\n\t\t\tadapter,\n\t\t\tdriver,\n\t\t\t...ifDefined(\"middleware\", options.middleware),\n\t\t\t...ifDefined(\"log\", options.log),\n\t\t\t...ifDefined(\"mode\", options.mode),\n\t\t\tcloseRefusal: \"at-once\",\n\t\t\townsDriver: false\n\t\t};\n\t\tconst runtime = new SupabaseRuntimeImpl({\n\t\t\tcontext,\n\t\t\t...sharedOptions,\n\t\t\t...ifDefined(\"verifyMarker\", options.verifyMarker)\n\t\t});\n\t\tconst extRuntime = new SupabaseRuntimeImpl({\n\t\t\tcontext: extContext,\n\t\t\t...sharedOptions,\n\t\t\tverifyMarker: false\n\t\t});\n\t\tconst poolBinding = toPoolBinding(options);\n\t\tif (poolBinding) driver.connect(poolBinding).catch(async (err) => {\n\t\t\tconnectError = { error: err };\n\t\t\tif (poolBinding.ownedByDriver) await poolBinding.pool.end().catch(() => void 0);\n\t\t});\n\t\truntimes = {\n\t\t\truntime,\n\t\t\textRuntime,\n\t\t\tdriver,\n\t\t\tpoolBinding\n\t\t};\n\t\treturn runtimes;\n\t}\n\tconst runtime = () => getRuntimes().runtime;\n\tconst extRuntime = () => getRuntimes().extRuntime;\n\tconst workRuntime = delegatingRuntime(runtime);\n\tasync function verifyJwt(jwt) {\n\t\tconst mismatch = algKeyMismatchReason(jwt, keyMaterial.kind);\n\t\tif (mismatch !== void 0) throw supabaseError(\"SUPABASE.JWT_INVALID\", `Invalid JWT: ${mismatch}`, { meta: { reason: mismatch } });\n\t\ttry {\n\t\t\tif (keyMaterial.kind === \"secret\") return await jwtVerify(jwt, keyMaterial.key);\n\t\t\treturn await jwtVerify(jwt, keyMaterial.keyset);\n\t\t} catch (err) {\n\t\t\tconst reason = err instanceof Error ? err.message : String(err);\n\t\t\tthrow supabaseError(\"SUPABASE.JWT_INVALID\", `Invalid JWT: ${reason}`, {\n\t\t\t\tmeta: { reason },\n\t\t\t\tcause: err\n\t\t\t});\n\t\t}\n\t}\n\tfunction buildRoleBoundDb(binding) {\n\t\tconst role = roleScope(runtime, binding);\n\t\tconst roleOrm = orm({\n\t\t\truntime: role,\n\t\t\tcontext,\n\t\t\t...ifDefined(\"collections\", options.collections)\n\t\t});\n\t\tconst roleBound = {\n\t\t\tsql: appSql,\n\t\t\torm: roleOrm,\n\t\t\traw,\n\t\t\ttoSql,\n\t\t\tenums,\n\t\t\tnativeEnums,\n\t\t\tprepare(declaration, callback) {\n\t\t\t\treturn prepareQuery(workRuntime, declaration, callback);\n\t\t\t},\n\t\t\tquery: role.query,\n\t\t\texecute: role.execute,\n\t\t\t[preparedStatementQuery]: role[preparedStatementQuery],\n\t\t\t[preparedStatementExecute]: role[preparedStatementExecute],\n\t\t\ttransaction(fn) {\n\t\t\t\treturn withTransaction(role, (txCtx) => fn(withTransactionMembers(txCtx, {\n\t\t\t\t\t...buildPostgresQueryMembers({\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\tcollections: options.collections,\n\t\t\t\t\t\tsql: appSql,\n\t\t\t\t\t\traw,\n\t\t\t\t\t\ttoSql,\n\t\t\t\t\t\tprepareRuntime: workRuntime\n\t\t\t\t\t}, txCtx),\n\t\t\t\t\tenums,\n\t\t\t\t\tnativeEnums\n\t\t\t\t})));\n\t\t\t}\n\t\t};\n\t\treturn Object.assign(roleBound, { [activitySource]: role[activitySource] });\n\t}\n\tconst serviceRoleBinding = {\n\t\trole: SupabaseRole.members.ServiceRole,\n\t\tclaims: {}\n\t};\n\tconst serviceRole = roleScope(extRuntime, serviceRoleBinding);\n\tconst supabaseInternal = {\n\t\tsql: extStatic.sql,\n\t\ttoSql: extStatic.toSql,\n\t\torm: orm({\n\t\t\truntime: serviceRole,\n\t\t\tcontext: extContext\n\t\t}),\n\t\tnativeEnums: extStatic.nativeEnums,\n\t\tquery: serviceRole.query,\n\t\texecute: serviceRole.execute\n\t};\n\tlet closePromise;\n\tasync function closeRuntimes() {\n\t\tif (runtimes === void 0) return;\n\t\tconst { runtime, extRuntime, driver } = runtimes;\n\t\tawait Promise.all([runtime.close(), extRuntime.close()]);\n\t\tawait driver.close();\n\t}\n\tfunction closeDb() {\n\t\tclosed = true;\n\t\tclosePromise ??= closeRuntimes();\n\t\treturn closePromise;\n\t}\n\treturn {\n\t\tcontext,\n\t\tstack,\n\t\tasync asUser(jwt) {\n\t\t\tconst { payload } = await verifyJwt(jwt);\n\t\t\tconst rawRole = payload[SUPABASE_JWT_ROLE_CLAIM];\n\t\t\tconst roleStr = typeof rawRole === \"string\" ? rawRole : SupabaseRole.members.Authenticated;\n\t\t\treturn buildRoleBoundDb({\n\t\t\t\trole: isSupabaseRole(roleStr) ? roleStr : SupabaseRole.members.Authenticated,\n\t\t\t\tclaims: payload\n\t\t\t});\n\t\t},\n\t\tasAnon() {\n\t\t\treturn buildRoleBoundDb({\n\t\t\t\trole: SupabaseRole.members.Anon,\n\t\t\t\tclaims: {}\n\t\t\t});\n\t\t},\n\t\tasServiceRole() {\n\t\t\treturn {\n\t\t\t\t...buildRoleBoundDb(serviceRoleBinding),\n\t\t\t\tsupabase: supabaseInternal\n\t\t\t};\n\t\t},\n\t\tclose: closeDb,\n\t\t[Symbol.asyncDispose]: closeDb\n\t};\n}\n//#endregion\n//#region src/exports/runtime.ts\nvar runtime_default = supabaseRuntimeDescriptor;\n//#endregion\nexport { SupabaseRuntimeImpl, runtime_default as default, supabase };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAA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
3
- "version": "8.0.0-rc.20-dev.13",
3
+ "version": "8.0.0-rc.20-dev.15",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -9,10 +9,10 @@
9
9
  "dist"
10
10
  ],
11
11
  "dependencies": {
12
- "@prisma/orm-family-sql": "8.0.0-rc.20-dev.13",
13
- "@prisma/orm-framework": "8.0.0-rc.20-dev.13",
14
- "@prisma/orm-postgres": "8.0.0-rc.20-dev.13",
15
- "@prisma/orm-toolchain": "8.0.0-rc.20-dev.13",
12
+ "@prisma/orm-family-sql": "8.0.0-rc.20-dev.15",
13
+ "@prisma/orm-framework": "8.0.0-rc.20-dev.15",
14
+ "@prisma/orm-postgres": "8.0.0-rc.20-dev.15",
15
+ "@prisma/orm-toolchain": "8.0.0-rc.20-dev.15",
16
16
  "@standard-schema/spec": "^1.1.0",
17
17
  "@types/node": "26.1.2",
18
18
  "@types/pg": "8.20.4",
@@ -21,15 +21,15 @@
21
21
  "pg": "8.22.0"
22
22
  },
23
23
  "devDependencies": {
24
- "@internal/extension-supabase": "8.0.0-rc.20-dev.13",
25
- "@repo/tsconfig": "8.0.0-rc.20-dev.13",
26
- "@repo/tsdown": "8.0.0-rc.20-dev.13",
27
- "@prisma/orm-target-postgres": "8.0.0-rc.20-dev.13",
24
+ "@internal/extension-supabase": "8.0.0-rc.20-dev.15",
25
+ "@repo/tsconfig": "8.0.0-rc.20-dev.15",
26
+ "@repo/tsdown": "8.0.0-rc.20-dev.15",
27
+ "@prisma/orm-target-postgres": "8.0.0-rc.20-dev.15",
28
28
  "tsdown": "0.22.14",
29
29
  "typescript": "5.9.3"
30
30
  },
31
31
  "peerDependencies": {
32
- "@prisma/orm-target-postgres": "8.0.0-rc.20-dev.13",
32
+ "@prisma/orm-target-postgres": "8.0.0-rc.20-dev.15",
33
33
  "typescript": ">=5.9"
34
34
  },
35
35
  "peerDependenciesMeta": {