@prisma/client 7.5.0-dev.41 → 7.5.0-dev.43
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/generator-build/index.js +2 -2
- package/package.json +34 -34
- package/runtime/client.d.mts +3 -0
- package/runtime/client.d.ts +3 -0
- package/runtime/client.js +20 -20
- package/runtime/client.js.map +3 -3
- package/runtime/client.mjs +11 -11
- package/runtime/client.mjs.map +3 -3
- package/runtime/index-browser.d.mts +3 -0
- package/runtime/index-browser.d.ts +3 -0
- package/runtime/index-browser.js +1 -1
- package/runtime/index-browser.js.map +2 -2
- package/runtime/index-browser.mjs +1 -1
- package/runtime/index-browser.mjs.map +3 -3
- package/runtime/wasm-compiler-edge.js +16 -16
- package/runtime/wasm-compiler-edge.js.map +4 -4
- package/runtime/wasm-compiler-edge.mjs +12 -12
- package/runtime/wasm-compiler-edge.mjs.map +4 -4
- package/scripts/default-index.js +1 -1
|
@@ -4,6 +4,7 @@ import { Decimal } from '@prisma/client-runtime-utils';
|
|
|
4
4
|
import { isAnyNull } from '@prisma/client-runtime-utils';
|
|
5
5
|
import { isDbNull } from '@prisma/client-runtime-utils';
|
|
6
6
|
import { isJsonNull } from '@prisma/client-runtime-utils';
|
|
7
|
+
import { isObjectEnumValue } from '@prisma/client-runtime-utils';
|
|
7
8
|
import { JsonNull } from '@prisma/client-runtime-utils';
|
|
8
9
|
import { NullTypes } from '@prisma/client-runtime-utils';
|
|
9
10
|
|
|
@@ -43,6 +44,8 @@ export { isDbNull }
|
|
|
43
44
|
|
|
44
45
|
export { isJsonNull }
|
|
45
46
|
|
|
47
|
+
export { isObjectEnumValue }
|
|
48
|
+
|
|
46
49
|
export { JsonNull }
|
|
47
50
|
|
|
48
51
|
/**
|
|
@@ -4,6 +4,7 @@ import { Decimal } from '@prisma/client-runtime-utils';
|
|
|
4
4
|
import { isAnyNull } from '@prisma/client-runtime-utils';
|
|
5
5
|
import { isDbNull } from '@prisma/client-runtime-utils';
|
|
6
6
|
import { isJsonNull } from '@prisma/client-runtime-utils';
|
|
7
|
+
import { isObjectEnumValue } from '@prisma/client-runtime-utils';
|
|
7
8
|
import { JsonNull } from '@prisma/client-runtime-utils';
|
|
8
9
|
import { NullTypes } from '@prisma/client-runtime-utils';
|
|
9
10
|
|
|
@@ -43,6 +44,8 @@ export { isDbNull }
|
|
|
43
44
|
|
|
44
45
|
export { isJsonNull }
|
|
45
46
|
|
|
47
|
+
export { isObjectEnumValue }
|
|
48
|
+
|
|
46
49
|
export { JsonNull }
|
|
47
50
|
|
|
48
51
|
/**
|
package/runtime/index-browser.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var s=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var a=(e,t)=>{for(var n in t)s(e,n,{get:t[n],enumerable:!0})},y=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of p(t))!f.call(e,i)&&i!==n&&s(e,i,{get:()=>t[i],enumerable:!(r=g(t,i))||r.enumerable});return e};var x=e=>y(s({},"__esModule",{value:!0}),e);var
|
|
1
|
+
"use strict";var s=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var a=(e,t)=>{for(var n in t)s(e,n,{get:t[n],enumerable:!0})},y=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of p(t))!f.call(e,i)&&i!==n&&s(e,i,{get:()=>t[i],enumerable:!(r=g(t,i))||r.enumerable});return e};var x=e=>y(s({},"__esModule",{value:!0}),e);var M={};a(M,{AnyNull:()=>o.AnyNull,DbNull:()=>o.DbNull,Decimal:()=>m.Decimal,JsonNull:()=>o.JsonNull,NullTypes:()=>o.NullTypes,Public:()=>l,getRuntime:()=>c,isAnyNull:()=>o.isAnyNull,isDbNull:()=>o.isDbNull,isJsonNull:()=>o.isJsonNull,isObjectEnumValue:()=>o.isObjectEnumValue,makeStrictEnum:()=>u});module.exports=x(M);var l={};a(l,{validator:()=>d});function d(...e){return t=>t}var b=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function u(e){return new Proxy(e,{get(t,n){if(n in t)return t[n];if(!b.has(n))throw new TypeError("Invalid enum value: ".concat(String(n)))}})}var N=()=>{var e,t;return((t=(e=globalThis.process)==null?void 0:e.release)==null?void 0:t.name)==="node"},E=()=>{var e,t;return!!globalThis.Bun||!!((t=(e=globalThis.process)==null?void 0:e.versions)!=null&&t.bun)},S=()=>!!globalThis.Deno,R=()=>typeof globalThis.Netlify=="object",h=()=>typeof globalThis.EdgeRuntime=="object",C=()=>{var e;return((e=globalThis.navigator)==null?void 0:e.userAgent)==="Cloudflare-Workers"};function k(){var n;return(n=[[R,"netlify"],[h,"edge-light"],[C,"workerd"],[S,"deno"],[E,"bun"],[N,"node"]].flatMap(r=>r[0]()?[r[1]]:[]).at(0))!=null?n:""}var O={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware)"};function c(){let e=k();return{id:e,prettyName:O[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}var o=require("@prisma/client-runtime-utils"),m=require("@prisma/client-runtime-utils");0&&(module.exports={AnyNull,DbNull,Decimal,JsonNull,NullTypes,Public,getRuntime,isAnyNull,isDbNull,isJsonNull,isObjectEnumValue,makeStrictEnum});
|
|
2
2
|
//# sourceMappingURL=index-browser.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/runtime/index-browser.ts", "../src/runtime/core/public/index.ts", "../src/runtime/core/public/validator.ts", "../src/runtime/strictEnum.ts", "../src/runtime/utils/getRuntime.ts"],
|
|
4
|
-
"sourcesContent": ["import * as Public from './core/public'\n\nexport { makeStrictEnum } from './strictEnum'\nexport { getRuntime } from './utils/getRuntime'\nexport {
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,8HAAAE,EAAA,eAAAC,EAAA,
|
|
4
|
+
"sourcesContent": ["import * as Public from './core/public'\n\nexport { makeStrictEnum } from './strictEnum'\nexport { getRuntime } from './utils/getRuntime'\nexport {\n AnyNull,\n DbNull,\n isAnyNull,\n isDbNull,\n isJsonNull,\n isObjectEnumValue,\n JsonNull,\n NullTypes,\n} from '@prisma/client-runtime-utils'\nexport { Decimal } from '@prisma/client-runtime-utils'\n\nexport { Public }\n", "import { validator } from './validator'\n\n/*\n * /!\\ These exports are exposed to the user. Proceed with caution.\n *\n * TODO: Move more hardcoded utils from generation into here\n */\n\nexport { validator }\n", "import { Args, Operation } from '../types/exported/Public'\nimport { Exact } from '../types/exported/Utils'\n\nexport function validator<V>(): <S>(select: Exact<S, V>) => S\nexport function validator<C, M extends Exclude<keyof C, `$${string}`>, O extends keyof C[M] & Operation>(\n client: C,\n model: M,\n operation: O,\n): <S>(select: Exact<S, Args<C[M], O>>) => S\nexport function validator<\n C,\n M extends Exclude<keyof C, `$${string}`>,\n O extends keyof C[M] & Operation,\n P extends keyof Args<C[M], O>,\n>(client: C, model: M, operation: O, prop: P): <S>(select: Exact<S, Args<C[M], O>[P]>) => S\nexport function validator(..._args: any[]) {\n return (args: any) => args\n}\n", "/**\n * List of properties that won't throw exception on access and return undefined instead\n */\nconst allowList = new Set([\n 'toJSON', // used by JSON.stringify\n '$$typeof', // used by old React tooling\n 'asymmetricMatch', // used by Jest\n Symbol.iterator, // used by various JS constructs/methods\n Symbol.toStringTag, // Used by .toString()\n Symbol.isConcatSpreadable, // Used by Array#concat,\n Symbol.toPrimitive, // Used when getting converted to primitive values\n])\n/**\n * Generates more strict variant of an enum which, unlike regular enum,\n * throws on non-existing property access. This can be useful in following situations:\n * - we have an API, that accepts both `undefined` and `SomeEnumType` as an input\n * - enum values are generated dynamically from DMMF.\n *\n * In that case, if using normal enums and no compile-time typechecking, using non-existing property\n * will result in `undefined` value being used, which will be accepted. Using strict enum\n * in this case will help to have a runtime exception, telling you that you are probably doing something wrong.\n *\n * Note: if you need to check for existence of a value in the enum you can still use either\n * `in` operator or `hasOwnProperty` function.\n *\n * @param definition\n * @returns\n */\nexport function makeStrictEnum<T extends Record<PropertyKey, string | number>>(definition: T): T {\n return new Proxy(definition, {\n get(target, property) {\n if (property in target) {\n return target[property]\n }\n if (allowList.has(property)) {\n return undefined\n }\n throw new TypeError(`Invalid enum value: ${String(property)}`)\n },\n })\n}\n", "// https://runtime-keys.proposal.wintercg.org/\nexport type RuntimeName = 'workerd' | 'deno' | 'netlify' | 'node' | 'bun' | 'edge-light' | '' /* unknown */\n\n/**\n * Indicates if running in Node.js or a Node.js compatible runtime.\n *\n * **Note:** When running code in Bun and Deno with Node.js compatibility mode, `isNode` flag will be also `true`, indicating running in a Node.js compatible runtime.\n */\nconst isNode = () => globalThis.process?.release?.name === 'node'\n\n/**\n * Indicates if running in Bun runtime.\n */\nconst isBun = () => !!globalThis.Bun || !!globalThis.process?.versions?.bun\n\n/**\n * Indicates if running in Deno runtime.\n */\nconst isDeno = () => !!globalThis.Deno\n\n/**\n * Indicates if running in Netlify runtime.\n */\nconst isNetlify = () => typeof globalThis.Netlify === 'object'\n\n/**\n * Indicates if running in EdgeLight (Vercel Edge) runtime.\n */\nconst isEdgeLight = () => typeof globalThis.EdgeRuntime === 'object'\n\n/**\n * Indicates if running in Cloudflare Workers runtime.\n * See: https://developers.cloudflare.com/workers/runtime-apis/web-standards/#navigatoruseragent\n */\nconst isWorkerd = () => globalThis.navigator?.userAgent === 'Cloudflare-Workers'\n\nfunction detectRuntime(): RuntimeName {\n // Note: we're currently not taking 'fastly' into account. Why?\n const runtimeChecks = [\n [isNetlify, 'netlify'],\n [isEdgeLight, 'edge-light'],\n [isWorkerd, 'workerd'],\n [isDeno, 'deno'],\n [isBun, 'bun'],\n [isNode, 'node'],\n ] as const\n\n const detectedRuntime =\n runtimeChecks\n // TODO: Transforming destructuring to the configured target environment ('chrome58', 'edge16', 'firefox57', 'safari11') is not supported yet,\n // so we can't write the following code yet:\n // ```\n // .flatMap(([isCurrentRuntime, runtime]) => isCurrentRuntime() ? [runtime] : [])\n // ```\n .flatMap((check) => (check[0]() ? [check[1]] : []))\n .at(0) ?? ''\n\n return detectedRuntime\n}\n\nconst runtimesPrettyNames = {\n node: 'Node.js',\n workerd: 'Cloudflare Workers',\n deno: 'Deno and Deno Deploy',\n netlify: 'Netlify Edge Functions',\n 'edge-light':\n 'Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware)',\n} as const\n\ntype GetRuntimeOutput = {\n id: RuntimeName\n prettyName: string\n isEdge: boolean\n}\n\nexport function getRuntime(): GetRuntimeOutput {\n const runtimeId = detectRuntime()\n\n return {\n id: runtimeId,\n // Fallback to the runtimeId if the runtime is not in the list\n prettyName: runtimesPrettyNames[runtimeId] || runtimeId,\n isEdge: ['workerd', 'deno', 'netlify', 'edge-light'].includes(runtimeId),\n }\n}\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,8HAAAE,EAAA,eAAAC,EAAA,2IAAAC,IAAA,eAAAC,EAAAL,GCAA,IAAAM,EAAA,GAAAC,EAAAD,EAAA,eAAAE,ICeO,SAASC,KAAaC,EAAc,CACzC,OAAQC,GAAcA,CACxB,CCdA,IAAMC,EAAY,IAAI,IAAI,CACxB,SACA,WACA,kBACA,OAAO,SACP,OAAO,YACP,OAAO,mBACP,OAAO,WACT,CAAC,EAiBM,SAASC,EAA+DC,EAAkB,CAC/F,OAAO,IAAI,MAAMA,EAAY,CAC3B,IAAIC,EAAQC,EAAU,CACpB,GAAIA,KAAYD,EACd,OAAOA,EAAOC,CAAQ,EAExB,GAAI,CAAAJ,EAAU,IAAII,CAAQ,EAG1B,MAAM,IAAI,UAAU,uBAAuB,cAAOA,CAAQ,EAAG,CAC/D,CACF,CAAC,CACH,CChCA,IAAMC,EAAS,IAAG,CARlB,IAAAC,EAAAC,EAQqB,QAAAA,GAAAD,EAAA,WAAW,UAAX,YAAAA,EAAoB,UAApB,YAAAC,EAA6B,QAAS,QAKrDC,EAAQ,IAAG,CAbjB,IAAAF,EAAAC,EAaoB,OAAC,CAAC,WAAW,KAAO,CAAC,GAACA,GAAAD,EAAA,WAAW,UAAX,YAAAA,EAAoB,WAApB,MAAAC,EAA8B,MAKlEE,EAAS,IAAM,CAAC,CAAC,WAAW,KAK5BC,EAAY,IAAM,OAAO,WAAW,SAAY,SAKhDC,EAAc,IAAM,OAAO,WAAW,aAAgB,SAMtDC,EAAY,IAAG,CAlCrB,IAAAN,EAkCwB,QAAAA,EAAA,WAAW,YAAX,YAAAA,EAAsB,aAAc,sBAE5D,SAASO,GAA6B,CApCtC,IAAAP,EAyDE,OATEA,EAVoB,CACpB,CAACI,EAAW,SAAS,EACrB,CAACC,EAAa,YAAY,EAC1B,CAACC,EAAW,SAAS,EACrB,CAACH,EAAQ,MAAM,EACf,CAACD,EAAO,KAAK,EACb,CAACH,EAAQ,MAAM,CACjB,EASK,QAASS,GAAWA,EAAM,CAAC,EAAE,EAAI,CAACA,EAAM,CAAC,CAAC,EAAI,CAAC,CAAE,EACjD,GAAG,CAAC,IAPP,KAAAR,EAOY,EAGhB,CAEA,IAAMS,EAAsB,CAC1B,KAAM,UACN,QAAS,qBACT,KAAM,uBACN,QAAS,yBACT,aACE,sKACJ,EAQO,SAASC,GAA+B,CAC7C,IAAMC,EAAYJ,EAAc,EAEhC,MAAO,CACL,GAAII,EAEJ,WAAYF,EAAoBE,CAAS,GAAKA,EAC9C,OAAQ,CAAC,UAAW,OAAQ,UAAW,YAAY,EAAE,SAASA,CAAS,CACzE,CACF,CJhFA,IAAAC,EASO,wCACPA,EAAwB",
|
|
6
6
|
"names": ["index_browser_exports", "__export", "public_exports", "getRuntime", "makeStrictEnum", "__toCommonJS", "public_exports", "__export", "validator", "validator", "_args", "args", "allowList", "makeStrictEnum", "definition", "target", "property", "isNode", "_a", "_b", "isBun", "isDeno", "isNetlify", "isEdgeLight", "isWorkerd", "detectRuntime", "check", "runtimesPrettyNames", "getRuntime", "runtimeId", "import_client_runtime_utils"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var s=Object.defineProperty;var l=(e,t)=>{for(var o in t)s(e,o,{get:t[o],enumerable:!0})};var i={};l(i,{validator:()=>r});function r(...e){return t=>t}var a=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function d(e){return new Proxy(e,{get(t,o){if(o in t)return t[o];if(!a.has(o))throw new TypeError("Invalid enum value: ".concat(String(o)))}})}var u=()=>{var e,t;return((t=(e=globalThis.process)==null?void 0:e.release)==null?void 0:t.name)==="node"},c=()=>{var e,t;return!!globalThis.Bun||!!((t=(e=globalThis.process)==null?void 0:e.versions)!=null&&t.bun)},m=()=>!!globalThis.Deno,g=()=>typeof globalThis.Netlify=="object",p=()=>typeof globalThis.EdgeRuntime=="object",f=()=>{var e;return((e=globalThis.navigator)==null?void 0:e.userAgent)==="Cloudflare-Workers"};function y(){var o;return(o=[[g,"netlify"],[p,"edge-light"],[f,"workerd"],[m,"deno"],[c,"bun"],[u,"node"]].flatMap(n=>n[0]()?[n[1]]:[]).at(0))!=null?o:""}var x={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware)"};function b(){let e=y();return{id:e,prettyName:x[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}import{AnyNull as T,DbNull as w,isAnyNull as v,isDbNull as P,isJsonNull as A,
|
|
1
|
+
var s=Object.defineProperty;var l=(e,t)=>{for(var o in t)s(e,o,{get:t[o],enumerable:!0})};var i={};l(i,{validator:()=>r});function r(...e){return t=>t}var a=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function d(e){return new Proxy(e,{get(t,o){if(o in t)return t[o];if(!a.has(o))throw new TypeError("Invalid enum value: ".concat(String(o)))}})}var u=()=>{var e,t;return((t=(e=globalThis.process)==null?void 0:e.release)==null?void 0:t.name)==="node"},c=()=>{var e,t;return!!globalThis.Bun||!!((t=(e=globalThis.process)==null?void 0:e.versions)!=null&&t.bun)},m=()=>!!globalThis.Deno,g=()=>typeof globalThis.Netlify=="object",p=()=>typeof globalThis.EdgeRuntime=="object",f=()=>{var e;return((e=globalThis.navigator)==null?void 0:e.userAgent)==="Cloudflare-Workers"};function y(){var o;return(o=[[g,"netlify"],[p,"edge-light"],[f,"workerd"],[m,"deno"],[c,"bun"],[u,"node"]].flatMap(n=>n[0]()?[n[1]]:[]).at(0))!=null?o:""}var x={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware)"};function b(){let e=y();return{id:e,prettyName:x[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}import{AnyNull as T,DbNull as w,isAnyNull as v,isDbNull as P,isJsonNull as A,isObjectEnumValue as D,JsonNull as j,NullTypes as $}from"@prisma/client-runtime-utils";import{Decimal as I}from"@prisma/client-runtime-utils";export{T as AnyNull,w as DbNull,I as Decimal,j as JsonNull,$ as NullTypes,i as Public,b as getRuntime,v as isAnyNull,P as isDbNull,A as isJsonNull,D as isObjectEnumValue,d as makeStrictEnum};
|
|
2
2
|
//# sourceMappingURL=index-browser.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/runtime/core/public/index.ts", "../src/runtime/core/public/validator.ts", "../src/runtime/strictEnum.ts", "../src/runtime/utils/getRuntime.ts", "../src/runtime/index-browser.ts"],
|
|
4
|
-
"sourcesContent": ["import { validator } from './validator'\n\n/*\n * /!\\ These exports are exposed to the user. Proceed with caution.\n *\n * TODO: Move more hardcoded utils from generation into here\n */\n\nexport { validator }\n", "import { Args, Operation } from '../types/exported/Public'\nimport { Exact } from '../types/exported/Utils'\n\nexport function validator<V>(): <S>(select: Exact<S, V>) => S\nexport function validator<C, M extends Exclude<keyof C, `$${string}`>, O extends keyof C[M] & Operation>(\n client: C,\n model: M,\n operation: O,\n): <S>(select: Exact<S, Args<C[M], O>>) => S\nexport function validator<\n C,\n M extends Exclude<keyof C, `$${string}`>,\n O extends keyof C[M] & Operation,\n P extends keyof Args<C[M], O>,\n>(client: C, model: M, operation: O, prop: P): <S>(select: Exact<S, Args<C[M], O>[P]>) => S\nexport function validator(..._args: any[]) {\n return (args: any) => args\n}\n", "/**\n * List of properties that won't throw exception on access and return undefined instead\n */\nconst allowList = new Set([\n 'toJSON', // used by JSON.stringify\n '$$typeof', // used by old React tooling\n 'asymmetricMatch', // used by Jest\n Symbol.iterator, // used by various JS constructs/methods\n Symbol.toStringTag, // Used by .toString()\n Symbol.isConcatSpreadable, // Used by Array#concat,\n Symbol.toPrimitive, // Used when getting converted to primitive values\n])\n/**\n * Generates more strict variant of an enum which, unlike regular enum,\n * throws on non-existing property access. This can be useful in following situations:\n * - we have an API, that accepts both `undefined` and `SomeEnumType` as an input\n * - enum values are generated dynamically from DMMF.\n *\n * In that case, if using normal enums and no compile-time typechecking, using non-existing property\n * will result in `undefined` value being used, which will be accepted. Using strict enum\n * in this case will help to have a runtime exception, telling you that you are probably doing something wrong.\n *\n * Note: if you need to check for existence of a value in the enum you can still use either\n * `in` operator or `hasOwnProperty` function.\n *\n * @param definition\n * @returns\n */\nexport function makeStrictEnum<T extends Record<PropertyKey, string | number>>(definition: T): T {\n return new Proxy(definition, {\n get(target, property) {\n if (property in target) {\n return target[property]\n }\n if (allowList.has(property)) {\n return undefined\n }\n throw new TypeError(`Invalid enum value: ${String(property)}`)\n },\n })\n}\n", "// https://runtime-keys.proposal.wintercg.org/\nexport type RuntimeName = 'workerd' | 'deno' | 'netlify' | 'node' | 'bun' | 'edge-light' | '' /* unknown */\n\n/**\n * Indicates if running in Node.js or a Node.js compatible runtime.\n *\n * **Note:** When running code in Bun and Deno with Node.js compatibility mode, `isNode` flag will be also `true`, indicating running in a Node.js compatible runtime.\n */\nconst isNode = () => globalThis.process?.release?.name === 'node'\n\n/**\n * Indicates if running in Bun runtime.\n */\nconst isBun = () => !!globalThis.Bun || !!globalThis.process?.versions?.bun\n\n/**\n * Indicates if running in Deno runtime.\n */\nconst isDeno = () => !!globalThis.Deno\n\n/**\n * Indicates if running in Netlify runtime.\n */\nconst isNetlify = () => typeof globalThis.Netlify === 'object'\n\n/**\n * Indicates if running in EdgeLight (Vercel Edge) runtime.\n */\nconst isEdgeLight = () => typeof globalThis.EdgeRuntime === 'object'\n\n/**\n * Indicates if running in Cloudflare Workers runtime.\n * See: https://developers.cloudflare.com/workers/runtime-apis/web-standards/#navigatoruseragent\n */\nconst isWorkerd = () => globalThis.navigator?.userAgent === 'Cloudflare-Workers'\n\nfunction detectRuntime(): RuntimeName {\n // Note: we're currently not taking 'fastly' into account. Why?\n const runtimeChecks = [\n [isNetlify, 'netlify'],\n [isEdgeLight, 'edge-light'],\n [isWorkerd, 'workerd'],\n [isDeno, 'deno'],\n [isBun, 'bun'],\n [isNode, 'node'],\n ] as const\n\n const detectedRuntime =\n runtimeChecks\n // TODO: Transforming destructuring to the configured target environment ('chrome58', 'edge16', 'firefox57', 'safari11') is not supported yet,\n // so we can't write the following code yet:\n // ```\n // .flatMap(([isCurrentRuntime, runtime]) => isCurrentRuntime() ? [runtime] : [])\n // ```\n .flatMap((check) => (check[0]() ? [check[1]] : []))\n .at(0) ?? ''\n\n return detectedRuntime\n}\n\nconst runtimesPrettyNames = {\n node: 'Node.js',\n workerd: 'Cloudflare Workers',\n deno: 'Deno and Deno Deploy',\n netlify: 'Netlify Edge Functions',\n 'edge-light':\n 'Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware)',\n} as const\n\ntype GetRuntimeOutput = {\n id: RuntimeName\n prettyName: string\n isEdge: boolean\n}\n\nexport function getRuntime(): GetRuntimeOutput {\n const runtimeId = detectRuntime()\n\n return {\n id: runtimeId,\n // Fallback to the runtimeId if the runtime is not in the list\n prettyName: runtimesPrettyNames[runtimeId] || runtimeId,\n isEdge: ['workerd', 'deno', 'netlify', 'edge-light'].includes(runtimeId),\n }\n}\n", "import * as Public from './core/public'\n\nexport { makeStrictEnum } from './strictEnum'\nexport { getRuntime } from './utils/getRuntime'\nexport {
|
|
5
|
-
"mappings": "0FAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,eAAAE,ICeO,SAASC,KAAaC,EAAc,CACzC,OAAQC,GAAcA,CACxB,CCdA,IAAMC,EAAY,IAAI,IAAI,CACxB,SACA,WACA,kBACA,OAAO,SACP,OAAO,YACP,OAAO,mBACP,OAAO,WACT,CAAC,EAiBM,SAASC,EAA+DC,EAAkB,CAC/F,OAAO,IAAI,MAAMA,EAAY,CAC3B,IAAIC,EAAQC,EAAU,CACpB,GAAIA,KAAYD,EACd,OAAOA,EAAOC,CAAQ,EAExB,GAAI,CAAAJ,EAAU,IAAII,CAAQ,EAG1B,MAAM,IAAI,UAAU,uBAAuB,cAAOA,CAAQ,EAAG,CAC/D,CACF,CAAC,CACH,CChCA,IAAMC,EAAS,IAAG,CARlB,IAAAC,EAAAC,EAQqB,QAAAA,GAAAD,EAAA,WAAW,UAAX,YAAAA,EAAoB,UAApB,YAAAC,EAA6B,QAAS,QAKrDC,EAAQ,IAAG,CAbjB,IAAAF,EAAAC,EAaoB,OAAC,CAAC,WAAW,KAAO,CAAC,GAACA,GAAAD,EAAA,WAAW,UAAX,YAAAA,EAAoB,WAApB,MAAAC,EAA8B,MAKlEE,EAAS,IAAM,CAAC,CAAC,WAAW,KAK5BC,EAAY,IAAM,OAAO,WAAW,SAAY,SAKhDC,EAAc,IAAM,OAAO,WAAW,aAAgB,SAMtDC,EAAY,IAAG,CAlCrB,IAAAN,EAkCwB,QAAAA,EAAA,WAAW,YAAX,YAAAA,EAAsB,aAAc,sBAE5D,SAASO,GAA6B,CApCtC,IAAAP,EAyDE,OATEA,EAVoB,CACpB,CAACI,EAAW,SAAS,EACrB,CAACC,EAAa,YAAY,EAC1B,CAACC,EAAW,SAAS,EACrB,CAACH,EAAQ,MAAM,EACf,CAACD,EAAO,KAAK,EACb,CAACH,EAAQ,MAAM,CACjB,EASK,QAASS,GAAWA,EAAM,CAAC,EAAE,EAAI,CAACA,EAAM,CAAC,CAAC,EAAI,CAAC,CAAE,EACjD,GAAG,CAAC,IAPP,KAAAR,EAOY,EAGhB,CAEA,IAAMS,EAAsB,CAC1B,KAAM,UACN,QAAS,qBACT,KAAM,uBACN,QAAS,yBACT,aACE,sKACJ,EAQO,SAASC,GAA+B,CAC7C,IAAMC,EAAYJ,EAAc,EAEhC,MAAO,CACL,GAAII,EAEJ,WAAYF,EAAoBE,CAAS,GAAKA,EAC9C,OAAQ,CAAC,UAAW,OAAQ,UAAW,YAAY,EAAE,SAASA,CAAS,CACzE,CACF,CChFA,
|
|
6
|
-
"names": ["public_exports", "__export", "validator", "validator", "_args", "args", "allowList", "makeStrictEnum", "definition", "target", "property", "isNode", "_a", "_b", "isBun", "isDeno", "isNetlify", "isEdgeLight", "isWorkerd", "detectRuntime", "check", "runtimesPrettyNames", "getRuntime", "runtimeId", "AnyNull", "DbNull", "isAnyNull", "isDbNull", "isJsonNull", "JsonNull", "NullTypes", "Decimal"]
|
|
4
|
+
"sourcesContent": ["import { validator } from './validator'\n\n/*\n * /!\\ These exports are exposed to the user. Proceed with caution.\n *\n * TODO: Move more hardcoded utils from generation into here\n */\n\nexport { validator }\n", "import { Args, Operation } from '../types/exported/Public'\nimport { Exact } from '../types/exported/Utils'\n\nexport function validator<V>(): <S>(select: Exact<S, V>) => S\nexport function validator<C, M extends Exclude<keyof C, `$${string}`>, O extends keyof C[M] & Operation>(\n client: C,\n model: M,\n operation: O,\n): <S>(select: Exact<S, Args<C[M], O>>) => S\nexport function validator<\n C,\n M extends Exclude<keyof C, `$${string}`>,\n O extends keyof C[M] & Operation,\n P extends keyof Args<C[M], O>,\n>(client: C, model: M, operation: O, prop: P): <S>(select: Exact<S, Args<C[M], O>[P]>) => S\nexport function validator(..._args: any[]) {\n return (args: any) => args\n}\n", "/**\n * List of properties that won't throw exception on access and return undefined instead\n */\nconst allowList = new Set([\n 'toJSON', // used by JSON.stringify\n '$$typeof', // used by old React tooling\n 'asymmetricMatch', // used by Jest\n Symbol.iterator, // used by various JS constructs/methods\n Symbol.toStringTag, // Used by .toString()\n Symbol.isConcatSpreadable, // Used by Array#concat,\n Symbol.toPrimitive, // Used when getting converted to primitive values\n])\n/**\n * Generates more strict variant of an enum which, unlike regular enum,\n * throws on non-existing property access. This can be useful in following situations:\n * - we have an API, that accepts both `undefined` and `SomeEnumType` as an input\n * - enum values are generated dynamically from DMMF.\n *\n * In that case, if using normal enums and no compile-time typechecking, using non-existing property\n * will result in `undefined` value being used, which will be accepted. Using strict enum\n * in this case will help to have a runtime exception, telling you that you are probably doing something wrong.\n *\n * Note: if you need to check for existence of a value in the enum you can still use either\n * `in` operator or `hasOwnProperty` function.\n *\n * @param definition\n * @returns\n */\nexport function makeStrictEnum<T extends Record<PropertyKey, string | number>>(definition: T): T {\n return new Proxy(definition, {\n get(target, property) {\n if (property in target) {\n return target[property]\n }\n if (allowList.has(property)) {\n return undefined\n }\n throw new TypeError(`Invalid enum value: ${String(property)}`)\n },\n })\n}\n", "// https://runtime-keys.proposal.wintercg.org/\nexport type RuntimeName = 'workerd' | 'deno' | 'netlify' | 'node' | 'bun' | 'edge-light' | '' /* unknown */\n\n/**\n * Indicates if running in Node.js or a Node.js compatible runtime.\n *\n * **Note:** When running code in Bun and Deno with Node.js compatibility mode, `isNode` flag will be also `true`, indicating running in a Node.js compatible runtime.\n */\nconst isNode = () => globalThis.process?.release?.name === 'node'\n\n/**\n * Indicates if running in Bun runtime.\n */\nconst isBun = () => !!globalThis.Bun || !!globalThis.process?.versions?.bun\n\n/**\n * Indicates if running in Deno runtime.\n */\nconst isDeno = () => !!globalThis.Deno\n\n/**\n * Indicates if running in Netlify runtime.\n */\nconst isNetlify = () => typeof globalThis.Netlify === 'object'\n\n/**\n * Indicates if running in EdgeLight (Vercel Edge) runtime.\n */\nconst isEdgeLight = () => typeof globalThis.EdgeRuntime === 'object'\n\n/**\n * Indicates if running in Cloudflare Workers runtime.\n * See: https://developers.cloudflare.com/workers/runtime-apis/web-standards/#navigatoruseragent\n */\nconst isWorkerd = () => globalThis.navigator?.userAgent === 'Cloudflare-Workers'\n\nfunction detectRuntime(): RuntimeName {\n // Note: we're currently not taking 'fastly' into account. Why?\n const runtimeChecks = [\n [isNetlify, 'netlify'],\n [isEdgeLight, 'edge-light'],\n [isWorkerd, 'workerd'],\n [isDeno, 'deno'],\n [isBun, 'bun'],\n [isNode, 'node'],\n ] as const\n\n const detectedRuntime =\n runtimeChecks\n // TODO: Transforming destructuring to the configured target environment ('chrome58', 'edge16', 'firefox57', 'safari11') is not supported yet,\n // so we can't write the following code yet:\n // ```\n // .flatMap(([isCurrentRuntime, runtime]) => isCurrentRuntime() ? [runtime] : [])\n // ```\n .flatMap((check) => (check[0]() ? [check[1]] : []))\n .at(0) ?? ''\n\n return detectedRuntime\n}\n\nconst runtimesPrettyNames = {\n node: 'Node.js',\n workerd: 'Cloudflare Workers',\n deno: 'Deno and Deno Deploy',\n netlify: 'Netlify Edge Functions',\n 'edge-light':\n 'Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware)',\n} as const\n\ntype GetRuntimeOutput = {\n id: RuntimeName\n prettyName: string\n isEdge: boolean\n}\n\nexport function getRuntime(): GetRuntimeOutput {\n const runtimeId = detectRuntime()\n\n return {\n id: runtimeId,\n // Fallback to the runtimeId if the runtime is not in the list\n prettyName: runtimesPrettyNames[runtimeId] || runtimeId,\n isEdge: ['workerd', 'deno', 'netlify', 'edge-light'].includes(runtimeId),\n }\n}\n", "import * as Public from './core/public'\n\nexport { makeStrictEnum } from './strictEnum'\nexport { getRuntime } from './utils/getRuntime'\nexport {\n AnyNull,\n DbNull,\n isAnyNull,\n isDbNull,\n isJsonNull,\n isObjectEnumValue,\n JsonNull,\n NullTypes,\n} from '@prisma/client-runtime-utils'\nexport { Decimal } from '@prisma/client-runtime-utils'\n\nexport { Public }\n"],
|
|
5
|
+
"mappings": "0FAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,eAAAE,ICeO,SAASC,KAAaC,EAAc,CACzC,OAAQC,GAAcA,CACxB,CCdA,IAAMC,EAAY,IAAI,IAAI,CACxB,SACA,WACA,kBACA,OAAO,SACP,OAAO,YACP,OAAO,mBACP,OAAO,WACT,CAAC,EAiBM,SAASC,EAA+DC,EAAkB,CAC/F,OAAO,IAAI,MAAMA,EAAY,CAC3B,IAAIC,EAAQC,EAAU,CACpB,GAAIA,KAAYD,EACd,OAAOA,EAAOC,CAAQ,EAExB,GAAI,CAAAJ,EAAU,IAAII,CAAQ,EAG1B,MAAM,IAAI,UAAU,uBAAuB,cAAOA,CAAQ,EAAG,CAC/D,CACF,CAAC,CACH,CChCA,IAAMC,EAAS,IAAG,CARlB,IAAAC,EAAAC,EAQqB,QAAAA,GAAAD,EAAA,WAAW,UAAX,YAAAA,EAAoB,UAApB,YAAAC,EAA6B,QAAS,QAKrDC,EAAQ,IAAG,CAbjB,IAAAF,EAAAC,EAaoB,OAAC,CAAC,WAAW,KAAO,CAAC,GAACA,GAAAD,EAAA,WAAW,UAAX,YAAAA,EAAoB,WAApB,MAAAC,EAA8B,MAKlEE,EAAS,IAAM,CAAC,CAAC,WAAW,KAK5BC,EAAY,IAAM,OAAO,WAAW,SAAY,SAKhDC,EAAc,IAAM,OAAO,WAAW,aAAgB,SAMtDC,EAAY,IAAG,CAlCrB,IAAAN,EAkCwB,QAAAA,EAAA,WAAW,YAAX,YAAAA,EAAsB,aAAc,sBAE5D,SAASO,GAA6B,CApCtC,IAAAP,EAyDE,OATEA,EAVoB,CACpB,CAACI,EAAW,SAAS,EACrB,CAACC,EAAa,YAAY,EAC1B,CAACC,EAAW,SAAS,EACrB,CAACH,EAAQ,MAAM,EACf,CAACD,EAAO,KAAK,EACb,CAACH,EAAQ,MAAM,CACjB,EASK,QAASS,GAAWA,EAAM,CAAC,EAAE,EAAI,CAACA,EAAM,CAAC,CAAC,EAAI,CAAC,CAAE,EACjD,GAAG,CAAC,IAPP,KAAAR,EAOY,EAGhB,CAEA,IAAMS,EAAsB,CAC1B,KAAM,UACN,QAAS,qBACT,KAAM,uBACN,QAAS,yBACT,aACE,sKACJ,EAQO,SAASC,GAA+B,CAC7C,IAAMC,EAAYJ,EAAc,EAEhC,MAAO,CACL,GAAII,EAEJ,WAAYF,EAAoBE,CAAS,GAAKA,EAC9C,OAAQ,CAAC,UAAW,OAAQ,UAAW,YAAY,EAAE,SAASA,CAAS,CACzE,CACF,CChFA,OACE,WAAAC,EACA,UAAAC,EACA,aAAAC,EACA,YAAAC,EACA,cAAAC,EACA,qBAAAC,EACA,YAAAC,EACA,aAAAC,MACK,+BACP,OAAS,WAAAC,MAAe",
|
|
6
|
+
"names": ["public_exports", "__export", "validator", "validator", "_args", "args", "allowList", "makeStrictEnum", "definition", "target", "property", "isNode", "_a", "_b", "isBun", "isDeno", "isNetlify", "isEdgeLight", "isWorkerd", "detectRuntime", "check", "runtimesPrettyNames", "getRuntime", "runtimeId", "AnyNull", "DbNull", "isAnyNull", "isDbNull", "isJsonNull", "isObjectEnumValue", "JsonNull", "NullTypes", "Decimal"]
|
|
7
7
|
}
|