@prisma/json-protocol 0.0.1

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/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # @prisma/json-protocol
2
+
3
+ Type definitions for JSON protocol representations of Prisma queries.
4
+
5
+ This is an internal package not covered by semver.
@@ -0,0 +1,81 @@
1
+ export declare type BigIntTaggedValue = {
2
+ $type: 'BigInt';
3
+ value: string;
4
+ };
5
+
6
+ export declare type BytesTaggedValue = {
7
+ $type: 'Bytes';
8
+ value: string;
9
+ };
10
+
11
+ export declare type DateTaggedValue = {
12
+ $type: 'DateTime';
13
+ value: string;
14
+ };
15
+
16
+ export declare type DecimalTaggedValue = {
17
+ $type: 'Decimal';
18
+ value: string;
19
+ };
20
+
21
+ export declare type EnumTaggedValue = {
22
+ $type: 'Enum';
23
+ value: string;
24
+ };
25
+
26
+ export declare type FieldRefTaggedValue = {
27
+ $type: 'FieldRef';
28
+ value: {
29
+ _ref: string;
30
+ _container: string;
31
+ };
32
+ };
33
+
34
+ export declare type IsolationLevel = 'ReadUncommitted' | 'ReadCommitted' | 'RepeatableRead' | 'Snapshot' | 'Serializable';
35
+
36
+ export declare type JsonArgumentValue = number | string | boolean | null | RawTaggedValue | JsonArgumentValue[] | {
37
+ [key: string]: JsonArgumentValue;
38
+ };
39
+
40
+ export declare type JsonBatchQuery = {
41
+ batch: JsonQuery[];
42
+ transaction?: {
43
+ isolationLevel?: IsolationLevel;
44
+ };
45
+ };
46
+
47
+ export declare type JsonFieldSelection = {
48
+ arguments?: Record<string, JsonArgumentValue> | RawTaggedValue;
49
+ selection: JsonSelectionSet;
50
+ };
51
+
52
+ export declare type JsonInputTaggedValue = DateTaggedValue | DecimalTaggedValue | BytesTaggedValue | BigIntTaggedValue | FieldRefTaggedValue | JsonTaggedValue | EnumTaggedValue | RawTaggedValue;
53
+
54
+ export declare type JsonOutputTaggedValue = DateTaggedValue | DecimalTaggedValue | BytesTaggedValue | BigIntTaggedValue | JsonTaggedValue;
55
+
56
+ export declare type JsonQuery = {
57
+ modelName?: string;
58
+ action: JsonQueryAction;
59
+ query: JsonFieldSelection;
60
+ };
61
+
62
+ export declare type JsonQueryAction = 'findUnique' | 'findUniqueOrThrow' | 'findFirst' | 'findFirstOrThrow' | 'findMany' | 'createOne' | 'createMany' | 'createManyAndReturn' | 'updateOne' | 'updateMany' | 'updateManyAndReturn' | 'deleteOne' | 'deleteMany' | 'upsertOne' | 'aggregate' | 'groupBy' | 'executeRaw' | 'queryRaw' | 'runCommandRaw' | 'findRaw' | 'aggregateRaw';
63
+
64
+ export declare type JsonSelectionSet = {
65
+ $scalars?: boolean;
66
+ $composites?: boolean;
67
+ } & {
68
+ [fieldName: string]: boolean | JsonFieldSelection;
69
+ };
70
+
71
+ export declare type JsonTaggedValue = {
72
+ $type: 'Json';
73
+ value: string;
74
+ };
75
+
76
+ export declare type RawTaggedValue = {
77
+ $type: 'Raw';
78
+ value: unknown;
79
+ };
80
+
81
+ export { }
@@ -0,0 +1,81 @@
1
+ export declare type BigIntTaggedValue = {
2
+ $type: 'BigInt';
3
+ value: string;
4
+ };
5
+
6
+ export declare type BytesTaggedValue = {
7
+ $type: 'Bytes';
8
+ value: string;
9
+ };
10
+
11
+ export declare type DateTaggedValue = {
12
+ $type: 'DateTime';
13
+ value: string;
14
+ };
15
+
16
+ export declare type DecimalTaggedValue = {
17
+ $type: 'Decimal';
18
+ value: string;
19
+ };
20
+
21
+ export declare type EnumTaggedValue = {
22
+ $type: 'Enum';
23
+ value: string;
24
+ };
25
+
26
+ export declare type FieldRefTaggedValue = {
27
+ $type: 'FieldRef';
28
+ value: {
29
+ _ref: string;
30
+ _container: string;
31
+ };
32
+ };
33
+
34
+ export declare type IsolationLevel = 'ReadUncommitted' | 'ReadCommitted' | 'RepeatableRead' | 'Snapshot' | 'Serializable';
35
+
36
+ export declare type JsonArgumentValue = number | string | boolean | null | RawTaggedValue | JsonArgumentValue[] | {
37
+ [key: string]: JsonArgumentValue;
38
+ };
39
+
40
+ export declare type JsonBatchQuery = {
41
+ batch: JsonQuery[];
42
+ transaction?: {
43
+ isolationLevel?: IsolationLevel;
44
+ };
45
+ };
46
+
47
+ export declare type JsonFieldSelection = {
48
+ arguments?: Record<string, JsonArgumentValue> | RawTaggedValue;
49
+ selection: JsonSelectionSet;
50
+ };
51
+
52
+ export declare type JsonInputTaggedValue = DateTaggedValue | DecimalTaggedValue | BytesTaggedValue | BigIntTaggedValue | FieldRefTaggedValue | JsonTaggedValue | EnumTaggedValue | RawTaggedValue;
53
+
54
+ export declare type JsonOutputTaggedValue = DateTaggedValue | DecimalTaggedValue | BytesTaggedValue | BigIntTaggedValue | JsonTaggedValue;
55
+
56
+ export declare type JsonQuery = {
57
+ modelName?: string;
58
+ action: JsonQueryAction;
59
+ query: JsonFieldSelection;
60
+ };
61
+
62
+ export declare type JsonQueryAction = 'findUnique' | 'findUniqueOrThrow' | 'findFirst' | 'findFirstOrThrow' | 'findMany' | 'createOne' | 'createMany' | 'createManyAndReturn' | 'updateOne' | 'updateMany' | 'updateManyAndReturn' | 'deleteOne' | 'deleteMany' | 'upsertOne' | 'aggregate' | 'groupBy' | 'executeRaw' | 'queryRaw' | 'runCommandRaw' | 'findRaw' | 'aggregateRaw';
63
+
64
+ export declare type JsonSelectionSet = {
65
+ $scalars?: boolean;
66
+ $composites?: boolean;
67
+ } & {
68
+ [fieldName: string]: boolean | JsonFieldSelection;
69
+ };
70
+
71
+ export declare type JsonTaggedValue = {
72
+ $type: 'Json';
73
+ value: string;
74
+ };
75
+
76
+ export declare type RawTaggedValue = {
77
+ $type: 'Raw';
78
+ value: unknown;
79
+ };
80
+
81
+ export { }
package/dist/index.js ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/index.ts
17
+ var index_exports = {};
18
+ module.exports = __toCommonJS(index_exports);
package/dist/index.mjs ADDED
File without changes
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@prisma/json-protocol",
3
+ "version": "0.0.1",
4
+ "description": "JSON protocol types for Prisma",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.mjs",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "require": {
11
+ "types": "./dist/index.d.ts",
12
+ "default": "./dist/index.js"
13
+ },
14
+ "import": {
15
+ "types": "./dist/index.d.mts",
16
+ "default": "./dist/index.mjs"
17
+ }
18
+ }
19
+ },
20
+ "license": "Apache-2.0",
21
+ "homepage": "https://www.prisma.io",
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "https://github.com/prisma/prisma.git",
25
+ "directory": "packages/json-protocol"
26
+ },
27
+ "bugs": "https://github.com/prisma/prisma/issues",
28
+ "scripts": {
29
+ "dev": "DEV=true tsx helpers/build.ts",
30
+ "build": "tsx helpers/build.ts",
31
+ "prepublishOnly": "pnpm run build"
32
+ },
33
+ "files": [
34
+ "dist"
35
+ ],
36
+ "sideEffects": false
37
+ }