@prisma-next/operations 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";UAAiB,SAAA;EAAA,SACN,OAAA;EAAA,SACA,MAAA;EAAA,SACA,QAAA;AAAA;AAAA,UAGM,UAAA;EAAA,SACN,OAAA;EAAA,SACA,QAAA;AAAA;AAAA,KAGC,QAAA;EAAA,SACG,OAAA;EAAA,SAA0B,MAAA;AAAA;EAAA,SAC1B,MAAA;EAAA,SAAoC,OAAA;AAAA;AAAA,UAElC,cAAA;EAAA,SACN,IAAA,GAAO,QAAA;EAAA,SACP,IAAA,MAAU,IAAA;AAAA;AAAA,KAGT,mBAAA,WAA8B,cAAA,GAAiB,cAAA,IAAkB,CAAA;AAAA,KAEjE,oBAAA,WAA+B,cAAA,GAAiB,cAAA,IAAkB,QAAA,CAC5E,MAAA,SAAe,mBAAA,CAAoB,CAAA;AAAA,UAGpB,iBAAA,WAA4B,cAAA,GAAiB,cAAA;EAC5D,QAAA,CAAS,IAAA,UAAc,UAAA,EAAY,mBAAA,CAAoB,CAAA;EACvD,OAAA,IAAW,QAAA,CAAS,MAAA,SAAe,CAAA;AAAA;AAAA,iBAGrB,uBAAA,WACJ,cAAA,GAAiB,cAAA,CAAA,CAAA,GACxB,iBAAA,CAAkB,CAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";UAAiB,SAAA;EAAA,SACN,OAAA;EAAA,SACA,MAAA;EAAA,SACA,QAAA;AAAA;AAAA,UAGM,UAAA;EAAA,SACN,OAAA;EAAA,SACA,QAAQ;AAAA;AAAA,KAGP,QAAA;EAAA,SACG,OAAA;EAAA,SAA0B,MAAA;AAAA;EAAA,SAC1B,MAAA;EAAA,SAAoC,OAAA;AAAA;AAAA,UAElC,cAAA;EAAA,SACN,IAAA,GAAO,QAAQ;EAAA,SACf,IAAA,MAAU,IAAA;AAAA;AAAA,KAGT,mBAAA,WAA8B,cAAA,GAAiB,cAAA,IAAkB,CAAA;AAAA,KAEjE,oBAAA,WAA+B,cAAA,GAAiB,cAAA,IAAkB,QAAA,CAC5E,MAAA,SAAe,mBAAA,CAAoB,CAAA;AAAA,UAGpB,iBAAA,WAA4B,cAAA,GAAiB,cAAA;EAC5D,QAAA,CAAS,IAAA,UAAc,UAAA,EAAY,mBAAA,CAAoB,CAAA;EACvD,OAAA,IAAW,QAAA,CAAS,MAAA,SAAe,CAAA;AAAA;AAAA,iBAGrB,uBAAA,WACJ,cAAA,GAAiB,cAAA,CAAA,CAAA,GACxB,iBAAA,CAAkB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["export interface ParamSpec {\n readonly codecId?: string;\n readonly traits?: readonly string[];\n readonly nullable: boolean;\n}\n\nexport interface ReturnSpec {\n readonly codecId: string;\n readonly nullable: boolean;\n}\n\nexport type SelfSpec =\n | { readonly codecId: string; readonly traits?: never }\n | { readonly traits: readonly string[]; readonly codecId?: never };\n\nexport interface OperationEntry {\n readonly self?: SelfSpec;\n readonly impl: (...args: never[]) => unknown;\n}\n\nexport type OperationDescriptor<T extends OperationEntry = OperationEntry> = T;\n\nexport type OperationDescriptors<T extends OperationEntry = OperationEntry> = Readonly<\n Record<string, OperationDescriptor<T>>\n>;\n\nexport interface OperationRegistry<T extends OperationEntry = OperationEntry> {\n register(name: string, descriptor: OperationDescriptor<T>): void;\n entries(): Readonly<Record<string, T>>;\n}\n\nexport function createOperationRegistry<\n T extends OperationEntry = OperationEntry,\n>(): OperationRegistry<T> {\n const operations: Record<string, T> = Object.create(null);\n\n return {\n register(name: string, descriptor: OperationDescriptor<T>) {\n if (name in operations) {\n throw new Error(`Operation \"${name}\" is already registered`);\n }\n if (descriptor.self) {\n const hasCodecId = descriptor.self.codecId !== undefined;\n const hasTraits = descriptor.self.traits !== undefined && descriptor.self.traits.length > 0;\n if (!hasCodecId && !hasTraits) {\n throw new Error(`Operation \"${name}\" self has neither codecId nor traits`);\n }\n if (hasCodecId && hasTraits) {\n throw new Error(`Operation \"${name}\" self has both codecId and traits`);\n }\n }\n operations[name] = descriptor;\n },\n entries() {\n return Object.freeze({ ...operations });\n },\n };\n}\n"],"mappings":";AA+BA,SAAgB,0BAEU;CACxB,MAAM,aAAgC,OAAO,OAAO,KAAK;CAEzD,OAAO;EACL,SAAS,MAAc,YAAoC;GACzD,IAAI,QAAQ,YACV,MAAM,IAAI,MAAM,cAAc,KAAK,yBAAyB;GAE9D,IAAI,WAAW,MAAM;IACnB,MAAM,aAAa,WAAW,KAAK,YAAY,KAAA;IAC/C,MAAM,YAAY,WAAW,KAAK,WAAW,KAAA,KAAa,WAAW,KAAK,OAAO,SAAS;IAC1F,IAAI,CAAC,cAAc,CAAC,WAClB,MAAM,IAAI,MAAM,cAAc,KAAK,uCAAuC;IAE5E,IAAI,cAAc,WAChB,MAAM,IAAI,MAAM,cAAc,KAAK,oCAAoC;;GAG3E,WAAW,QAAQ;;EAErB,UAAU;GACR,OAAO,OAAO,OAAO,EAAE,GAAG,YAAY,CAAC;;EAE1C"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["export interface ParamSpec {\n readonly codecId?: string;\n readonly traits?: readonly string[];\n readonly nullable: boolean;\n}\n\nexport interface ReturnSpec {\n readonly codecId: string;\n readonly nullable: boolean;\n}\n\nexport type SelfSpec =\n | { readonly codecId: string; readonly traits?: never }\n | { readonly traits: readonly string[]; readonly codecId?: never };\n\nexport interface OperationEntry {\n readonly self?: SelfSpec;\n readonly impl: (...args: never[]) => unknown;\n}\n\nexport type OperationDescriptor<T extends OperationEntry = OperationEntry> = T;\n\nexport type OperationDescriptors<T extends OperationEntry = OperationEntry> = Readonly<\n Record<string, OperationDescriptor<T>>\n>;\n\nexport interface OperationRegistry<T extends OperationEntry = OperationEntry> {\n register(name: string, descriptor: OperationDescriptor<T>): void;\n entries(): Readonly<Record<string, T>>;\n}\n\nexport function createOperationRegistry<\n T extends OperationEntry = OperationEntry,\n>(): OperationRegistry<T> {\n const operations: Record<string, T> = Object.create(null);\n\n return {\n register(name: string, descriptor: OperationDescriptor<T>) {\n if (name in operations) {\n throw new Error(`Operation \"${name}\" is already registered`);\n }\n if (descriptor.self) {\n const hasCodecId = descriptor.self.codecId !== undefined;\n const hasTraits = descriptor.self.traits !== undefined && descriptor.self.traits.length > 0;\n if (!hasCodecId && !hasTraits) {\n throw new Error(`Operation \"${name}\" self has neither codecId nor traits`);\n }\n if (hasCodecId && hasTraits) {\n throw new Error(`Operation \"${name}\" self has both codecId and traits`);\n }\n }\n operations[name] = descriptor;\n },\n entries() {\n return Object.freeze({ ...operations });\n },\n };\n}\n"],"mappings":";AA+BA,SAAgB,0BAEU;CACxB,MAAM,aAAgC,OAAO,OAAO,IAAI;CAExD,OAAO;EACL,SAAS,MAAc,YAAoC;GACzD,IAAI,QAAQ,YACV,MAAM,IAAI,MAAM,cAAc,KAAK,wBAAwB;GAE7D,IAAI,WAAW,MAAM;IACnB,MAAM,aAAa,WAAW,KAAK,YAAY,KAAA;IAC/C,MAAM,YAAY,WAAW,KAAK,WAAW,KAAA,KAAa,WAAW,KAAK,OAAO,SAAS;IAC1F,IAAI,CAAC,cAAc,CAAC,WAClB,MAAM,IAAI,MAAM,cAAc,KAAK,sCAAsC;IAE3E,IAAI,cAAc,WAChB,MAAM,IAAI,MAAM,cAAc,KAAK,mCAAmC;GAE1E;GACA,WAAW,QAAQ;EACrB;EACA,UAAU;GACR,OAAO,OAAO,OAAO,EAAE,GAAG,WAAW,CAAC;EACxC;CACF;AACF"}
package/package.json CHANGED
@@ -1,31 +1,39 @@
1
1
  {
2
2
  "name": "@prisma-next/operations",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "description": "Target-neutral operation registry and capability helpers for Prisma Next",
8
8
  "dependencies": {},
9
9
  "devDependencies": {
10
- "@prisma-next/test-utils": "0.11.0",
11
- "@prisma-next/tsconfig": "0.11.0",
12
- "@prisma-next/tsdown": "0.11.0",
10
+ "@prisma-next/test-utils": "0.12.0",
11
+ "@prisma-next/tsconfig": "0.12.0",
12
+ "@prisma-next/tsdown": "0.12.0",
13
13
  "tsdown": "0.22.0",
14
14
  "typescript": "5.9.3",
15
15
  "vitest": "4.1.6"
16
16
  },
17
+ "peerDependencies": {
18
+ "typescript": ">=5.9"
19
+ },
20
+ "peerDependenciesMeta": {
21
+ "typescript": {
22
+ "optional": true
23
+ }
24
+ },
17
25
  "files": [
18
26
  "dist",
19
27
  "src"
20
28
  ],
21
- "engines": {
22
- "node": ">=20"
23
- },
29
+ "types": "./dist/index.d.mts",
24
30
  "exports": {
25
31
  ".": "./dist/index.mjs",
26
32
  "./package.json": "./package.json"
27
33
  },
28
- "types": "./dist/index.d.mts",
34
+ "engines": {
35
+ "node": ">=24"
36
+ },
29
37
  "repository": {
30
38
  "type": "git",
31
39
  "url": "https://github.com/prisma/prisma-next.git",