@pegasusheavy/nestjs-prisma-graphql 1.2.3 → 1.4.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/LICENSE +1 -0
- package/dist/generate.d.ts +41 -40
- package/dist/generate.js +724 -542
- package/dist/generate.js.map +1 -1
- package/dist/index.d.ts +1 -17
- package/dist/index.js +774 -561
- package/dist/index.js.map +1 -1
- package/package.json +33 -33
package/LICENSE
CHANGED
|
@@ -187,6 +187,7 @@
|
|
|
187
187
|
identification within third-party archives.
|
|
188
188
|
|
|
189
189
|
Copyright 2026 Pegasus Heavy Industries LLC
|
|
190
|
+
Copyright 2026 Joseph Quinn
|
|
190
191
|
|
|
191
192
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
193
|
you may not use this file except in compliance with the License.
|
package/dist/generate.d.ts
CHANGED
|
@@ -9,7 +9,8 @@ declare enum ReExport {
|
|
|
9
9
|
All = "All"
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
type
|
|
12
|
+
type ConfigFieldSetting = Partial<Omit<ObjectSetting, 'name'>>;
|
|
13
|
+
interface DecorateElement {
|
|
13
14
|
isMatchField: (s: string) => boolean;
|
|
14
15
|
isMatchType: (s: string) => boolean;
|
|
15
16
|
from: string;
|
|
@@ -18,44 +19,44 @@ type DecorateElement = {
|
|
|
18
19
|
namedImport: boolean;
|
|
19
20
|
defaultImport?: string | true;
|
|
20
21
|
namespaceImport?: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
22
|
+
}
|
|
23
|
+
interface CustomImport {
|
|
23
24
|
from: string;
|
|
24
25
|
name: string;
|
|
25
26
|
namedImport: boolean;
|
|
26
27
|
defaultImport?: string | true;
|
|
27
28
|
namespaceImport?: string;
|
|
28
|
-
}
|
|
29
|
+
}
|
|
29
30
|
declare function createConfig(data: Record<string, unknown>): {
|
|
30
|
-
|
|
31
|
-
tsConfigFilePath: string | undefined;
|
|
32
|
-
prismaClientImport: string;
|
|
31
|
+
$warnings: string[];
|
|
33
32
|
combineScalarFilters: boolean;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
customImport: CustomImport[];
|
|
34
|
+
decorate: DecorateElement[];
|
|
35
|
+
emitBlocks: Record<string, boolean>;
|
|
37
36
|
emitCompiled: boolean;
|
|
38
|
-
|
|
37
|
+
emitSingle: boolean;
|
|
38
|
+
esmCompatible: boolean;
|
|
39
|
+
fields: Record<string, ConfigFieldSetting | undefined>;
|
|
40
|
+
graphqlScalars: Record<string, ImportNameSpec | undefined>;
|
|
41
|
+
noAtomicOperations: boolean;
|
|
42
|
+
noTypeId: boolean;
|
|
39
43
|
omitModelsCount: boolean;
|
|
40
|
-
|
|
41
|
-
|
|
44
|
+
outputFilePattern: string;
|
|
45
|
+
prismaClientImport: string;
|
|
42
46
|
purgeOutput: boolean;
|
|
43
|
-
|
|
44
|
-
noTypeId: boolean;
|
|
47
|
+
reExport: ReExport;
|
|
45
48
|
requireSingleFieldsInWhereUniqueInput: boolean;
|
|
49
|
+
tsConfigFilePath: string | undefined;
|
|
46
50
|
unsafeCompatibleWhereUniqueInput: boolean;
|
|
47
|
-
|
|
48
|
-
decorate: DecorateElement[];
|
|
49
|
-
customImport: CustomImport[];
|
|
50
|
-
esmCompatible: boolean;
|
|
51
|
+
useInputType: ConfigInputItem[];
|
|
51
52
|
};
|
|
52
|
-
|
|
53
|
+
interface ConfigInputItem {
|
|
53
54
|
typeName: string;
|
|
54
55
|
ALL?: string;
|
|
55
56
|
[index: string]: string | undefined;
|
|
56
|
-
}
|
|
57
|
+
}
|
|
57
58
|
|
|
58
|
-
|
|
59
|
+
interface ObjectSetting {
|
|
59
60
|
/**
|
|
60
61
|
* Act as named import or namespaceImport or defaultImport
|
|
61
62
|
*/
|
|
@@ -71,16 +72,16 @@ type ObjectSetting = {
|
|
|
71
72
|
defaultImport?: string | true;
|
|
72
73
|
namespaceImport?: string;
|
|
73
74
|
namedImport?: boolean;
|
|
74
|
-
}
|
|
75
|
+
}
|
|
75
76
|
interface ObjectSettingsFilterArgs {
|
|
76
77
|
name: string;
|
|
77
78
|
input?: boolean;
|
|
78
79
|
output?: boolean;
|
|
79
80
|
}
|
|
80
81
|
declare class ObjectSettings extends Array<ObjectSetting> {
|
|
81
|
-
shouldHideField({
|
|
82
|
-
getFieldType({
|
|
83
|
-
getPropertyType({
|
|
82
|
+
shouldHideField({ input, name, output, }: ObjectSettingsFilterArgs): boolean;
|
|
83
|
+
getFieldType({ input, name, output, }: ObjectSettingsFilterArgs): ObjectSetting | undefined;
|
|
84
|
+
getPropertyType({ input, name, output, }: ObjectSettingsFilterArgs): ObjectSetting | undefined;
|
|
84
85
|
getObjectTypeArguments(options: Record<string, unknown>): string[];
|
|
85
86
|
fieldArguments(): Record<string, unknown> | undefined;
|
|
86
87
|
}
|
|
@@ -89,18 +90,18 @@ declare class ObjectSettings extends Array<ObjectSetting> {
|
|
|
89
90
|
* Event emitter interface for type safety across ESM modules
|
|
90
91
|
*/
|
|
91
92
|
interface EventEmitter {
|
|
92
|
-
on(type: string | symbol, fn:
|
|
93
|
-
once(type: string | symbol, fn:
|
|
94
|
-
off(type: string | symbol, nullOrFn?:
|
|
95
|
-
emit(type: string | symbol, ...args: unknown[])
|
|
96
|
-
emitSync(type: string | symbol, ...args: unknown[])
|
|
97
|
-
removeAllListeners()
|
|
98
|
-
listeners(type: string | symbol):
|
|
93
|
+
on: (type: string | symbol, fn: (...args: any[]) => any) => this;
|
|
94
|
+
once: (type: string | symbol, fn: (...args: any[]) => any) => this;
|
|
95
|
+
off: (type: string | symbol, nullOrFn?: (...args: any[]) => any) => boolean;
|
|
96
|
+
emit: (type: string | symbol, ...args: unknown[]) => Promise<boolean>;
|
|
97
|
+
emitSync: (type: string | symbol, ...args: unknown[]) => boolean;
|
|
98
|
+
removeAllListeners: () => void;
|
|
99
|
+
listeners: (type: string | symbol) => Array<(...args: any[]) => any>;
|
|
99
100
|
}
|
|
100
101
|
type Model = WritableDeep<DMMF.Model>;
|
|
101
102
|
type Schema = WritableDeep<DMMF.Schema>;
|
|
102
103
|
type GeneratorConfiguration = ReturnType<typeof createConfig>;
|
|
103
|
-
|
|
104
|
+
interface EventArguments {
|
|
104
105
|
schema: Schema;
|
|
105
106
|
models: Map<string, Model>;
|
|
106
107
|
modelNames: string[];
|
|
@@ -109,15 +110,15 @@ type EventArguments = {
|
|
|
109
110
|
config: GeneratorConfiguration;
|
|
110
111
|
project: Project;
|
|
111
112
|
output: string;
|
|
112
|
-
getSourceFile(args: {
|
|
113
|
+
getSourceFile: (args: {
|
|
113
114
|
type: string;
|
|
114
115
|
name: string;
|
|
115
|
-
})
|
|
116
|
+
}) => SourceFile;
|
|
116
117
|
eventEmitter: EventEmitter;
|
|
117
118
|
typeNames: Set<string>;
|
|
118
119
|
removeTypes: Set<string>;
|
|
119
120
|
enums: Record<string, DMMF.DatamodelEnum | undefined>;
|
|
120
|
-
getModelName(name: string)
|
|
121
|
+
getModelName: (name: string) => string | undefined;
|
|
121
122
|
/**
|
|
122
123
|
* Input types for this models should be decorated @Type(() => Self)
|
|
123
124
|
*/
|
|
@@ -127,11 +128,11 @@ type EventArguments = {
|
|
|
127
128
|
* Format: "ModelA:ModelB" where ModelA < ModelB alphabetically
|
|
128
129
|
*/
|
|
129
130
|
circularDependencies: Set<string>;
|
|
130
|
-
}
|
|
131
|
-
|
|
131
|
+
}
|
|
132
|
+
interface ImportNameSpec {
|
|
132
133
|
name: string;
|
|
133
134
|
specifier?: string;
|
|
134
|
-
}
|
|
135
|
+
}
|
|
135
136
|
type Field = DMMF.Field;
|
|
136
137
|
|
|
137
138
|
declare function generate(args: GeneratorOptions & {
|