@prisma-next/sql-contract 0.11.0-dev.49 → 0.11.0-dev.50

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.
@@ -0,0 +1,10 @@
1
+ import { PreserveEmptyPredicate, StorageSort } from "@prisma-next/contract/hashing";
2
+
3
+ //#region src/canonicalization-hooks.d.ts
4
+ declare const sqlContractCanonicalizationHooks: {
5
+ readonly shouldPreserveEmpty: PreserveEmptyPredicate;
6
+ readonly sortStorage: StorageSort;
7
+ };
8
+ //#endregion
9
+ export { sqlContractCanonicalizationHooks };
10
+ //# sourceMappingURL=canonicalization-hooks.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canonicalization-hooks.d.mts","names":[],"sources":["../src/canonicalization-hooks.ts"],"mappings":";;;cAyBa,gCAAA;EAAA,SACF,mBAAA,EAAqB,sBAAA;EAAA,SACrB,WAAA,EAAa,WAAW;AAAA"}
@@ -0,0 +1,58 @@
1
+ import { createPreserveEmptyPredicate, createStorageSort } from "@prisma-next/contract/hashing-utils";
2
+ const sqlContractCanonicalizationHooks = {
3
+ shouldPreserveEmpty: createPreserveEmptyPredicate([
4
+ [
5
+ "storage",
6
+ "namespaces",
7
+ "*",
8
+ "tables"
9
+ ],
10
+ [
11
+ "storage",
12
+ "namespaces",
13
+ "*",
14
+ "tables",
15
+ "*"
16
+ ],
17
+ [
18
+ "storage",
19
+ "namespaces",
20
+ "*",
21
+ "tables",
22
+ "*",
23
+ [
24
+ "uniques",
25
+ "indexes",
26
+ "foreignKeys"
27
+ ]
28
+ ],
29
+ [
30
+ "storage",
31
+ "namespaces",
32
+ "*",
33
+ "tables",
34
+ "*",
35
+ "foreignKeys",
36
+ ["constraint", "index"]
37
+ ],
38
+ [
39
+ "storage",
40
+ "types",
41
+ "*",
42
+ "typeParams"
43
+ ]
44
+ ]),
45
+ sortStorage: createStorageSort([{
46
+ path: [
47
+ "namespaces",
48
+ "*",
49
+ "tables",
50
+ "*"
51
+ ],
52
+ arrayKeys: ["indexes", "uniques"]
53
+ }])
54
+ };
55
+ //#endregion
56
+ export { sqlContractCanonicalizationHooks };
57
+
58
+ //# sourceMappingURL=canonicalization-hooks.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canonicalization-hooks.mjs","names":[],"sources":["../src/canonicalization-hooks.ts"],"sourcesContent":["import type { PreserveEmptyPredicate, StorageSort } from '@prisma-next/contract/hashing';\nimport {\n createPreserveEmptyPredicate,\n createStorageSort,\n type NamedArraySortTarget,\n type PathPattern,\n} from '@prisma-next/contract/hashing-utils';\n\nconst preserveEmptyPatterns = [\n ['storage', 'namespaces', '*', 'tables'],\n ['storage', 'namespaces', '*', 'tables', '*'],\n ['storage', 'namespaces', '*', 'tables', '*', ['uniques', 'indexes', 'foreignKeys']],\n ['storage', 'namespaces', '*', 'tables', '*', 'foreignKeys', ['constraint', 'index']],\n ['storage', 'types', '*', 'typeParams'],\n] as const satisfies readonly PathPattern[];\n\nconst sortTargets = [\n { path: ['namespaces', '*', 'tables', '*'], arrayKeys: ['indexes', 'uniques'] },\n] as const satisfies readonly NamedArraySortTarget[];\n\nconst shouldPreserveEmpty: PreserveEmptyPredicate =\n createPreserveEmptyPredicate(preserveEmptyPatterns);\n\nconst sortStorage: StorageSort = createStorageSort(sortTargets);\n\nexport const sqlContractCanonicalizationHooks: {\n readonly shouldPreserveEmpty: PreserveEmptyPredicate;\n readonly sortStorage: StorageSort;\n} = {\n shouldPreserveEmpty,\n sortStorage,\n};\n"],"mappings":";AAyBA,MAAa,mCAGT;CACF,qBARA,6BAA6B;EAZ7B;GAAC;GAAW;GAAc;GAAK;EAAQ;EACvC;GAAC;GAAW;GAAc;GAAK;GAAU;EAAG;EAC5C;GAAC;GAAW;GAAc;GAAK;GAAU;GAAK;IAAC;IAAW;IAAW;GAAa;EAAC;EACnF;GAAC;GAAW;GAAc;GAAK;GAAU;GAAK;GAAe,CAAC,cAAc,OAAO;EAAC;EACpF;GAAC;GAAW;GAAS;GAAK;EAAY;CAQT,CAQ7B;CACA,aAP+B,kBAAkB,CANjD;EAAE,MAAM;GAAC;GAAc;GAAK;GAAU;EAAG;EAAG,WAAW,CAAC,WAAW,SAAS;CAAE,CAM7B,CAOjD;AACF"}
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@prisma-next/sql-contract",
3
- "version": "0.11.0-dev.49",
3
+ "version": "0.11.0-dev.50",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "description": "SQL contract types, validators, and IR factories for Prisma Next",
8
8
  "dependencies": {
9
- "@prisma-next/contract": "0.11.0-dev.49",
10
- "@prisma-next/framework-components": "0.11.0-dev.49",
11
- "@prisma-next/utils": "0.11.0-dev.49",
9
+ "@prisma-next/contract": "0.11.0-dev.50",
10
+ "@prisma-next/framework-components": "0.11.0-dev.50",
11
+ "@prisma-next/utils": "0.11.0-dev.50",
12
12
  "arktype": "^2.2.0"
13
13
  },
14
14
  "devDependencies": {
15
- "@prisma-next/test-utils": "0.11.0-dev.49",
16
- "@prisma-next/tsconfig": "0.11.0-dev.49",
17
- "@prisma-next/tsdown": "0.11.0-dev.49",
15
+ "@prisma-next/test-utils": "0.11.0-dev.50",
16
+ "@prisma-next/tsconfig": "0.11.0-dev.50",
17
+ "@prisma-next/tsdown": "0.11.0-dev.50",
18
18
  "tsdown": "0.22.0",
19
19
  "typescript": "5.9.3",
20
20
  "vitest": "4.1.6"
@@ -24,6 +24,7 @@
24
24
  "src"
25
25
  ],
26
26
  "exports": {
27
+ "./canonicalization-hooks": "./dist/canonicalization-hooks.mjs",
27
28
  "./factories": "./dist/factories.mjs",
28
29
  "./index-type-validation": "./dist/index-type-validation.mjs",
29
30
  "./index-types": "./dist/index-types.mjs",
@@ -0,0 +1,32 @@
1
+ import type { PreserveEmptyPredicate, StorageSort } from '@prisma-next/contract/hashing';
2
+ import {
3
+ createPreserveEmptyPredicate,
4
+ createStorageSort,
5
+ type NamedArraySortTarget,
6
+ type PathPattern,
7
+ } from '@prisma-next/contract/hashing-utils';
8
+
9
+ const preserveEmptyPatterns = [
10
+ ['storage', 'namespaces', '*', 'tables'],
11
+ ['storage', 'namespaces', '*', 'tables', '*'],
12
+ ['storage', 'namespaces', '*', 'tables', '*', ['uniques', 'indexes', 'foreignKeys']],
13
+ ['storage', 'namespaces', '*', 'tables', '*', 'foreignKeys', ['constraint', 'index']],
14
+ ['storage', 'types', '*', 'typeParams'],
15
+ ] as const satisfies readonly PathPattern[];
16
+
17
+ const sortTargets = [
18
+ { path: ['namespaces', '*', 'tables', '*'], arrayKeys: ['indexes', 'uniques'] },
19
+ ] as const satisfies readonly NamedArraySortTarget[];
20
+
21
+ const shouldPreserveEmpty: PreserveEmptyPredicate =
22
+ createPreserveEmptyPredicate(preserveEmptyPatterns);
23
+
24
+ const sortStorage: StorageSort = createStorageSort(sortTargets);
25
+
26
+ export const sqlContractCanonicalizationHooks: {
27
+ readonly shouldPreserveEmpty: PreserveEmptyPredicate;
28
+ readonly sortStorage: StorageSort;
29
+ } = {
30
+ shouldPreserveEmpty,
31
+ sortStorage,
32
+ };
@@ -0,0 +1 @@
1
+ export { sqlContractCanonicalizationHooks } from '../canonicalization-hooks';