@prisma/generator-helper 6.6.0-dev.42 → 6.6.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.
@@ -1,4 +1,4 @@
1
- import type { GeneratorConfig, GeneratorManifest, GeneratorOptions } from './types';
1
+ import type { GeneratorConfig, GeneratorManifest, GeneratorOptions } from '@prisma/generator';
2
2
  type GeneratorProcessOptions = {
3
3
  isNode?: boolean;
4
4
  /**
@@ -18,10 +18,11 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var GeneratorProcess_exports = {};
20
20
  __export(GeneratorProcess_exports, {
21
- GeneratorError: () => import_chunk_HF3IZ2PW.GeneratorError,
22
- GeneratorProcess: () => import_chunk_HF3IZ2PW.GeneratorProcess
21
+ GeneratorError: () => import_chunk_AXSWIEHZ.GeneratorError,
22
+ GeneratorProcess: () => import_chunk_AXSWIEHZ.GeneratorProcess
23
23
  });
24
24
  module.exports = __toCommonJS(GeneratorProcess_exports);
25
- var import_chunk_HF3IZ2PW = require("./chunk-HF3IZ2PW.js");
25
+ var import_chunk_AXSWIEHZ = require("./chunk-AXSWIEHZ.js");
26
26
  var import_chunk_EOPVK4AE = require("./chunk-EOPVK4AE.js");
27
+ var import_chunk_KEYE2GFS = require("./chunk-KEYE2GFS.js");
27
28
  var import_chunk_QGM4M3NI = require("./chunk-QGM4M3NI.js");
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
6
  var __export = (target, all) => {
9
7
  for (var name in all)
@@ -17,24 +15,17 @@ var __copyProps = (to, from, except, desc) => {
17
15
  }
18
16
  return to;
19
17
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_HF3IZ2PW_exports = {};
30
- __export(chunk_HF3IZ2PW_exports, {
19
+ var chunk_AXSWIEHZ_exports = {};
20
+ __export(chunk_AXSWIEHZ_exports, {
31
21
  GeneratorError: () => GeneratorError,
32
22
  GeneratorProcess: () => GeneratorProcess
33
23
  });
34
- module.exports = __toCommonJS(chunk_HF3IZ2PW_exports);
24
+ module.exports = __toCommonJS(chunk_AXSWIEHZ_exports);
35
25
  var import_chunk_EOPVK4AE = require("./chunk-EOPVK4AE.js");
26
+ var import_chunk_KEYE2GFS = require("./chunk-KEYE2GFS.js");
36
27
  var import_chunk_QGM4M3NI = require("./chunk-QGM4M3NI.js");
37
- var import_debug = __toESM(require("@prisma/debug"));
28
+ var import_debug = require("@prisma/debug");
38
29
  var import_child_process = require("child_process");
39
30
  var require_windows = (0, import_chunk_QGM4M3NI.__commonJS)({
40
31
  "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"(exports, module2) {
@@ -558,7 +549,7 @@ var bgBlue = init(44, 49);
558
549
  var bgMagenta = init(45, 49);
559
550
  var bgCyan = init(46, 49);
560
551
  var bgWhite = init(47, 49);
561
- var debug = (0, import_debug.default)("prisma:GeneratorProcess");
552
+ var debug = (0, import_debug.Debug)("prisma:GeneratorProcess");
562
553
  var globalMessageId = 1;
563
554
  var GeneratorError = class extends Error {
564
555
  constructor(message, code, data) {
@@ -670,7 +661,7 @@ ${this.errorLogs}`
670
661
  throw new Error(`message.id has to be a number. Found value ${data.id}`);
671
662
  }
672
663
  if (this.handlers[data.id]) {
673
- if (isErrorResponse(data)) {
664
+ if ((0, import_chunk_KEYE2GFS.isErrorResponse)(data)) {
674
665
  const error = new GeneratorError(data.error.message, data.error.code, data.error.data);
675
666
  this.handlers[data.id].reject(error);
676
667
  } else {
@@ -760,6 +751,3 @@ ${this.errorLogs}`
760
751
  );
761
752
  generate = this.rpcMethod("generate");
762
753
  };
763
- function isErrorResponse(response) {
764
- return response.error !== void 0;
765
- }
@@ -0,0 +1,26 @@
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 __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var chunk_KEYE2GFS_exports = {};
20
+ __export(chunk_KEYE2GFS_exports, {
21
+ isErrorResponse: () => isErrorResponse
22
+ });
23
+ module.exports = __toCommonJS(chunk_KEYE2GFS_exports);
24
+ function isErrorResponse(response) {
25
+ return response.error !== void 0;
26
+ }
@@ -1,4 +1,4 @@
1
- import type { GeneratorConfig, GeneratorManifest, GeneratorOptions } from './types';
1
+ import type { GeneratorConfig, GeneratorManifest, GeneratorOptions } from '@prisma/generator';
2
2
  export interface Handler {
3
3
  onGenerate(options: GeneratorOptions): Promise<any>;
4
4
  onManifest?(config: GeneratorConfig): GeneratorManifest;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,20 @@
1
- export * from './dmmf';
2
1
  export { generatorHandler } from './generatorHandler';
3
2
  export { GeneratorError, GeneratorProcess } from './GeneratorProcess';
4
- export * from './types';
3
+ /**
4
+ * Exported for backwards compatibility only.
5
+ *
6
+ * @deprecated Generators using `@prisma/generator-helper` shouldn't need JSON-RPC internals.
7
+ */
8
+ export type * as JsonRPC from './json-rpc';
9
+ /**
10
+ * A re-export for backwards compatibility with community generators.
11
+ *
12
+ * @deprecated Use the `@prisma/dmmf` package instead.
13
+ */
14
+ export type * as DMMF from '@prisma/dmmf';
15
+ /**
16
+ * A re-export for backwards compatibility with community generators.
17
+ *
18
+ * @deprecated Use the `@prisma/generator` package instead.
19
+ */
20
+ export type * from '@prisma/generator';
package/dist/index.js CHANGED
@@ -18,16 +18,13 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var index_exports = {};
20
20
  __export(index_exports, {
21
- DMMF: () => import_chunk_JU65QD3H.DMMF,
22
- GeneratorError: () => import_chunk_HF3IZ2PW.GeneratorError,
23
- GeneratorProcess: () => import_chunk_HF3IZ2PW.GeneratorProcess,
24
- datamodelEnumToSchemaEnum: () => import_chunk_JU65QD3H.datamodelEnumToSchemaEnum,
21
+ GeneratorError: () => import_chunk_AXSWIEHZ.GeneratorError,
22
+ GeneratorProcess: () => import_chunk_AXSWIEHZ.GeneratorProcess,
25
23
  generatorHandler: () => import_chunk_NAG6CCUN.generatorHandler
26
24
  });
27
25
  module.exports = __toCommonJS(index_exports);
28
- var import_chunk_HF3IZ2PW = require("./chunk-HF3IZ2PW.js");
29
- var import_chunk_JU65QD3H = require("./chunk-JU65QD3H.js");
26
+ var import_chunk_AXSWIEHZ = require("./chunk-AXSWIEHZ.js");
30
27
  var import_chunk_NAG6CCUN = require("./chunk-NAG6CCUN.js");
31
28
  var import_chunk_EOPVK4AE = require("./chunk-EOPVK4AE.js");
29
+ var import_chunk_KEYE2GFS = require("./chunk-KEYE2GFS.js");
32
30
  var import_chunk_QGM4M3NI = require("./chunk-QGM4M3NI.js");
33
- var import_chunk_6F4PWJZI = require("./chunk-6F4PWJZI.js");
@@ -0,0 +1,22 @@
1
+ export type Request = {
2
+ jsonrpc: '2.0';
3
+ method: string;
4
+ params?: any;
5
+ id: number;
6
+ };
7
+ export type Response = SuccessResponse | ErrorResponse;
8
+ export type SuccessResponse = {
9
+ jsonrpc: '2.0';
10
+ result: any;
11
+ id: number;
12
+ };
13
+ export type ErrorResponse = {
14
+ jsonrpc: '2.0';
15
+ error: {
16
+ code: number;
17
+ message: string;
18
+ data: any;
19
+ };
20
+ id: number;
21
+ };
22
+ export declare function isErrorResponse(response: Response): response is ErrorResponse;
@@ -16,11 +16,10 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var dmmf_exports = {};
20
- __export(dmmf_exports, {
21
- DMMF: () => import_chunk_JU65QD3H.DMMF,
22
- datamodelEnumToSchemaEnum: () => import_chunk_JU65QD3H.datamodelEnumToSchemaEnum
19
+ var json_rpc_exports = {};
20
+ __export(json_rpc_exports, {
21
+ isErrorResponse: () => import_chunk_KEYE2GFS.isErrorResponse
23
22
  });
24
- module.exports = __toCommonJS(dmmf_exports);
25
- var import_chunk_JU65QD3H = require("./chunk-JU65QD3H.js");
23
+ module.exports = __toCommonJS(json_rpc_exports);
24
+ var import_chunk_KEYE2GFS = require("./chunk-KEYE2GFS.js");
26
25
  var import_chunk_QGM4M3NI = require("./chunk-QGM4M3NI.js");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/generator-helper",
3
- "version": "6.6.0-dev.42",
3
+ "version": "6.6.0-dev.50",
4
4
  "description": "This package is intended for Prisma's internal use",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -15,7 +15,9 @@
15
15
  "homepage": "https://www.prisma.io",
16
16
  "bugs": "https://github.com/prisma/prisma/issues",
17
17
  "dependencies": {
18
- "@prisma/debug": "6.6.0-dev.42"
18
+ "@prisma/debug": "6.6.0-dev.50",
19
+ "@prisma/generator": "6.6.0-dev.50",
20
+ "@prisma/dmmf": "6.6.0-dev.50"
19
21
  },
20
22
  "devDependencies": {
21
23
  "@swc-node/register": "1.10.9",
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,55 +0,0 @@
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 __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_JU65QD3H_exports = {};
20
- __export(chunk_JU65QD3H_exports, {
21
- DMMF: () => DMMF,
22
- datamodelEnumToSchemaEnum: () => datamodelEnumToSchemaEnum
23
- });
24
- module.exports = __toCommonJS(chunk_JU65QD3H_exports);
25
- function datamodelEnumToSchemaEnum(datamodelEnum) {
26
- return {
27
- name: datamodelEnum.name,
28
- values: datamodelEnum.values.map((v) => v.name)
29
- };
30
- }
31
- var DMMF;
32
- ((DMMF2) => {
33
- let ModelAction;
34
- ((ModelAction2) => {
35
- ModelAction2["findUnique"] = "findUnique";
36
- ModelAction2["findUniqueOrThrow"] = "findUniqueOrThrow";
37
- ModelAction2["findFirst"] = "findFirst";
38
- ModelAction2["findFirstOrThrow"] = "findFirstOrThrow";
39
- ModelAction2["findMany"] = "findMany";
40
- ModelAction2["create"] = "create";
41
- ModelAction2["createMany"] = "createMany";
42
- ModelAction2["createManyAndReturn"] = "createManyAndReturn";
43
- ModelAction2["update"] = "update";
44
- ModelAction2["updateMany"] = "updateMany";
45
- ModelAction2["updateManyAndReturn"] = "updateManyAndReturn";
46
- ModelAction2["upsert"] = "upsert";
47
- ModelAction2["delete"] = "delete";
48
- ModelAction2["deleteMany"] = "deleteMany";
49
- ModelAction2["groupBy"] = "groupBy";
50
- ModelAction2["count"] = "count";
51
- ModelAction2["aggregate"] = "aggregate";
52
- ModelAction2["findRaw"] = "findRaw";
53
- ModelAction2["aggregateRaw"] = "aggregateRaw";
54
- })(ModelAction = DMMF2.ModelAction || (DMMF2.ModelAction = {}));
55
- })(DMMF || (DMMF = {}));
package/dist/dmmf.d.ts DELETED
@@ -1,242 +0,0 @@
1
- export type ReadonlyDeep<O> = {
2
- +readonly [K in keyof O]: ReadonlyDeep<O[K]>;
3
- };
4
- export declare function datamodelEnumToSchemaEnum(datamodelEnum: DMMF.DatamodelEnum): DMMF.SchemaEnum;
5
- export declare namespace DMMF {
6
- type Document = ReadonlyDeep<{
7
- datamodel: Datamodel;
8
- schema: Schema;
9
- mappings: Mappings;
10
- }>;
11
- type Mappings = ReadonlyDeep<{
12
- modelOperations: ModelMapping[];
13
- otherOperations: {
14
- read: string[];
15
- write: string[];
16
- };
17
- }>;
18
- type OtherOperationMappings = ReadonlyDeep<{
19
- read: string[];
20
- write: string[];
21
- }>;
22
- type DatamodelEnum = ReadonlyDeep<{
23
- name: string;
24
- values: EnumValue[];
25
- dbName?: string | null;
26
- documentation?: string;
27
- }>;
28
- type SchemaEnum = ReadonlyDeep<{
29
- name: string;
30
- values: string[];
31
- }>;
32
- type EnumValue = ReadonlyDeep<{
33
- name: string;
34
- dbName: string | null;
35
- }>;
36
- type Datamodel = ReadonlyDeep<{
37
- models: Model[];
38
- enums: DatamodelEnum[];
39
- types: Model[];
40
- indexes: Index[];
41
- }>;
42
- type uniqueIndex = ReadonlyDeep<{
43
- name: string;
44
- fields: string[];
45
- }>;
46
- type PrimaryKey = ReadonlyDeep<{
47
- name: string | null;
48
- fields: string[];
49
- }>;
50
- type Model = ReadonlyDeep<{
51
- name: string;
52
- dbName: string | null;
53
- schema: string | null;
54
- fields: Field[];
55
- uniqueFields: string[][];
56
- uniqueIndexes: uniqueIndex[];
57
- documentation?: string;
58
- primaryKey: PrimaryKey | null;
59
- isGenerated?: boolean;
60
- }>;
61
- type FieldKind = 'scalar' | 'object' | 'enum' | 'unsupported';
62
- type FieldNamespace = 'model' | 'prisma';
63
- type FieldLocation = 'scalar' | 'inputObjectTypes' | 'outputObjectTypes' | 'enumTypes' | 'fieldRefTypes';
64
- type Field = ReadonlyDeep<{
65
- kind: FieldKind;
66
- name: string;
67
- isRequired: boolean;
68
- isList: boolean;
69
- isUnique: boolean;
70
- isId: boolean;
71
- isReadOnly: boolean;
72
- isGenerated?: boolean;
73
- isUpdatedAt?: boolean;
74
- /**
75
- * Describes the data type in the same the way it is defined in the Prisma schema:
76
- * BigInt, Boolean, Bytes, DateTime, Decimal, Float, Int, JSON, String, $ModelName
77
- */
78
- type: string;
79
- /**
80
- * Native database type, if specified.
81
- * For example, `@db.VarChar(191)` is encoded as `['VarChar', ['191']]`,
82
- * `@db.Text` is encoded as `['Text', []]`.
83
- */
84
- nativeType?: [string, string[]] | null;
85
- dbName?: string | null;
86
- hasDefaultValue: boolean;
87
- default?: FieldDefault | FieldDefaultScalar | FieldDefaultScalar[];
88
- relationFromFields?: string[];
89
- relationToFields?: string[];
90
- relationOnDelete?: string;
91
- relationOnUpdate?: string;
92
- relationName?: string;
93
- documentation?: string;
94
- }>;
95
- type FieldDefault = ReadonlyDeep<{
96
- name: string;
97
- args: Array<string | number>;
98
- }>;
99
- type FieldDefaultScalar = string | boolean | number;
100
- type Index = ReadonlyDeep<{
101
- model: string;
102
- type: IndexType;
103
- isDefinedOnField: boolean;
104
- name?: string;
105
- dbName?: string;
106
- algorithm?: string;
107
- clustered?: boolean;
108
- fields: IndexField[];
109
- }>;
110
- type IndexType = 'id' | 'normal' | 'unique' | 'fulltext';
111
- type IndexField = ReadonlyDeep<{
112
- name: string;
113
- sortOrder?: SortOrder;
114
- length?: number;
115
- operatorClass?: string;
116
- }>;
117
- type SortOrder = 'asc' | 'desc';
118
- type Schema = ReadonlyDeep<{
119
- rootQueryType?: string;
120
- rootMutationType?: string;
121
- inputObjectTypes: {
122
- model?: InputType[];
123
- prisma: InputType[];
124
- };
125
- outputObjectTypes: {
126
- model: OutputType[];
127
- prisma: OutputType[];
128
- };
129
- enumTypes: {
130
- model?: SchemaEnum[];
131
- prisma: SchemaEnum[];
132
- };
133
- fieldRefTypes: {
134
- prisma?: FieldRefType[];
135
- };
136
- }>;
137
- type Query = ReadonlyDeep<{
138
- name: string;
139
- args: SchemaArg[];
140
- output: QueryOutput;
141
- }>;
142
- type QueryOutput = ReadonlyDeep<{
143
- name: string;
144
- isRequired: boolean;
145
- isList: boolean;
146
- }>;
147
- type TypeRef<AllowedLocations extends FieldLocation> = {
148
- isList: boolean;
149
- type: string;
150
- location: AllowedLocations;
151
- namespace?: FieldNamespace;
152
- };
153
- type InputTypeRef = TypeRef<'scalar' | 'inputObjectTypes' | 'enumTypes' | 'fieldRefTypes'>;
154
- type SchemaArg = ReadonlyDeep<{
155
- name: string;
156
- comment?: string;
157
- isNullable: boolean;
158
- isRequired: boolean;
159
- inputTypes: InputTypeRef[];
160
- deprecation?: Deprecation;
161
- }>;
162
- type OutputType = ReadonlyDeep<{
163
- name: string;
164
- fields: SchemaField[];
165
- }>;
166
- type SchemaField = ReadonlyDeep<{
167
- name: string;
168
- isNullable?: boolean;
169
- outputType: OutputTypeRef;
170
- args: SchemaArg[];
171
- deprecation?: Deprecation;
172
- documentation?: string;
173
- }>;
174
- type OutputTypeRef = TypeRef<'scalar' | 'outputObjectTypes' | 'enumTypes'>;
175
- type Deprecation = ReadonlyDeep<{
176
- sinceVersion: string;
177
- reason: string;
178
- plannedRemovalVersion?: string;
179
- }>;
180
- type InputType = ReadonlyDeep<{
181
- name: string;
182
- constraints: {
183
- maxNumFields: number | null;
184
- minNumFields: number | null;
185
- fields?: string[];
186
- };
187
- meta?: {
188
- source?: string;
189
- };
190
- fields: SchemaArg[];
191
- }>;
192
- type FieldRefType = ReadonlyDeep<{
193
- name: string;
194
- allowTypes: FieldRefAllowType[];
195
- fields: SchemaArg[];
196
- }>;
197
- type FieldRefAllowType = TypeRef<'scalar' | 'enumTypes'>;
198
- type ModelMapping = ReadonlyDeep<{
199
- model: string;
200
- plural: string;
201
- findUnique?: string | null;
202
- findUniqueOrThrow?: string | null;
203
- findFirst?: string | null;
204
- findFirstOrThrow?: string | null;
205
- findMany?: string | null;
206
- create?: string | null;
207
- createMany?: string | null;
208
- createManyAndReturn?: string | null;
209
- update?: string | null;
210
- updateMany?: string | null;
211
- updateManyAndReturn?: string | null;
212
- upsert?: string | null;
213
- delete?: string | null;
214
- deleteMany?: string | null;
215
- aggregate?: string | null;
216
- groupBy?: string | null;
217
- count?: string | null;
218
- findRaw?: string | null;
219
- aggregateRaw?: string | null;
220
- }>;
221
- enum ModelAction {
222
- findUnique = "findUnique",
223
- findUniqueOrThrow = "findUniqueOrThrow",
224
- findFirst = "findFirst",
225
- findFirstOrThrow = "findFirstOrThrow",
226
- findMany = "findMany",
227
- create = "create",
228
- createMany = "createMany",
229
- createManyAndReturn = "createManyAndReturn",
230
- update = "update",
231
- updateMany = "updateMany",
232
- updateManyAndReturn = "updateManyAndReturn",
233
- upsert = "upsert",
234
- delete = "delete",
235
- deleteMany = "deleteMany",
236
- groupBy = "groupBy",
237
- count = "count",// TODO: count does not actually exist, why?
238
- aggregate = "aggregate",
239
- findRaw = "findRaw",
240
- aggregateRaw = "aggregateRaw"
241
- }
242
- }
package/dist/types.d.ts DELETED
@@ -1,132 +0,0 @@
1
- import type { DMMF } from './dmmf';
2
- export declare namespace JsonRPC {
3
- type Request = {
4
- jsonrpc: '2.0';
5
- method: string;
6
- params?: any;
7
- id: number;
8
- };
9
- type Response = SuccessResponse | ErrorResponse;
10
- type SuccessResponse = {
11
- jsonrpc: '2.0';
12
- result: any;
13
- id: number;
14
- };
15
- type ErrorResponse = {
16
- jsonrpc: '2.0';
17
- error: {
18
- code: number;
19
- message: string;
20
- data: any;
21
- };
22
- id: number;
23
- };
24
- }
25
- export interface GeneratorConfig {
26
- name: string;
27
- output: EnvValue | null;
28
- isCustomOutput?: boolean;
29
- provider: EnvValue;
30
- config: {
31
- /** `output` is a reserved name and will only be available directly at `generator.output` */
32
- output?: never;
33
- /** `provider` is a reserved name and will only be available directly at `generator.provider` */
34
- provider?: never;
35
- /** `binaryTargets` is a reserved name and will only be available directly at `generator.binaryTargets` */
36
- binaryTargets?: never;
37
- /** `previewFeatures` is a reserved name and will only be available directly at `generator.previewFeatures` */
38
- previewFeatures?: never;
39
- } & {
40
- [key: string]: string | string[] | undefined;
41
- };
42
- binaryTargets: BinaryTargetsEnvValue[];
43
- previewFeatures: string[];
44
- envPaths?: EnvPaths;
45
- sourceFilePath: string;
46
- }
47
- export interface EnvValue {
48
- fromEnvVar: null | string;
49
- value: null | string;
50
- }
51
- export interface BinaryTargetsEnvValue {
52
- fromEnvVar: string | null;
53
- value: string;
54
- native?: boolean;
55
- }
56
- export type ConnectorType = 'mysql' | 'mongodb' | 'sqlite' | 'postgresql' | 'postgres' | 'prisma+postgres' | 'sqlserver' | 'cockroachdb';
57
- export type ActiveConnectorType = Exclude<ConnectorType, 'postgres' | 'prisma+postgres'>;
58
- export interface DataSource {
59
- name: string;
60
- provider: ConnectorType;
61
- activeProvider: ActiveConnectorType;
62
- url: EnvValue;
63
- directUrl?: EnvValue;
64
- schemas: string[] | [];
65
- sourceFilePath: string;
66
- }
67
- export type BinaryPaths = {
68
- schemaEngine?: {
69
- [binaryTarget: string]: string;
70
- };
71
- queryEngine?: {
72
- [binaryTarget: string]: string;
73
- };
74
- libqueryEngine?: {
75
- [binaryTarget: string]: string;
76
- };
77
- };
78
- export type EnvPaths = {
79
- rootEnvPath: string | null;
80
- schemaEnvPath: string | undefined;
81
- };
82
- /** The options passed to the generator implementations */
83
- export type GeneratorOptions = {
84
- generator: GeneratorConfig;
85
- otherGenerators: GeneratorConfig[];
86
- schemaPath: string;
87
- dmmf: DMMF.Document;
88
- datasources: DataSource[];
89
- datamodel: string;
90
- version: string;
91
- binaryPaths?: BinaryPaths;
92
- postinstall?: boolean;
93
- noEngine?: boolean;
94
- noHints?: boolean;
95
- allowNoModels?: boolean;
96
- envPaths?: EnvPaths;
97
- typedSql?: SqlQueryOutput[];
98
- };
99
- export type EngineType = 'queryEngine' | 'libqueryEngine' | 'schemaEngine';
100
- export type GeneratorManifest = {
101
- prettyName?: string;
102
- defaultOutput?: string;
103
- denylists?: {
104
- models?: string[];
105
- fields?: string[];
106
- };
107
- requiresGenerators?: string[];
108
- requiresEngines?: EngineType[];
109
- version?: string;
110
- requiresEngineVersion?: string;
111
- };
112
- export type SqlQueryOutput = {
113
- name: string;
114
- source: string;
115
- documentation: string | null;
116
- parameters: SqlQueryParameterOutput[];
117
- resultColumns: SqlQueryColumnOutput[];
118
- };
119
- export type SqlQueryParameterOutput = {
120
- name: string;
121
- query: string;
122
- typ: QueryIntrospectionType;
123
- documentation: string | null;
124
- nullable: boolean;
125
- };
126
- export type SqlQueryColumnOutput = {
127
- name: string;
128
- typ: QueryIntrospectionType;
129
- nullable: boolean;
130
- };
131
- export type QueryIntrospectionType = QueryIntrospectionBuiltinType | (string & {});
132
- export type QueryIntrospectionBuiltinType = 'int' | 'bigint' | 'float' | 'double' | 'string' | 'enum' | 'bytes' | 'bool' | 'char' | 'decimal' | 'json' | 'xml' | 'uuid' | 'datetime' | 'date' | 'time' | 'int-array' | 'bigint-array' | 'float-array' | 'double-array' | 'string-array' | 'char-array' | 'bytes-array' | 'bool-array' | 'decimal-array' | 'json-array' | 'xml-array' | 'uuid-array' | 'datetime-array' | 'date-array' | 'time-array' | 'null' | 'unknown';
package/dist/types.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- var import_chunk_6F4PWJZI = require("./chunk-6F4PWJZI.js");