@pegasusheavy/nestjs-prisma-graphql 1.2.2 → 1.3.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.
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.
@@ -9,7 +9,8 @@ declare enum ReExport {
9
9
  All = "All"
10
10
  }
11
11
 
12
- type DecorateElement = {
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
- type CustomImport = {
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
- outputFilePattern: string;
31
- tsConfigFilePath: string | undefined;
32
- prismaClientImport: string;
31
+ $warnings: string[];
33
32
  combineScalarFilters: boolean;
34
- noAtomicOperations: boolean;
35
- reExport: ReExport;
36
- emitSingle: boolean;
33
+ customImport: CustomImport[];
34
+ decorate: DecorateElement[];
35
+ emitBlocks: Record<string, boolean>;
37
36
  emitCompiled: boolean;
38
- emitBlocks: Record<"models" | "inputs" | "args" | "outputs" | "prismaEnums" | "schemaEnums", boolean>;
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
- $warnings: string[];
41
- fields: Record<string, Partial<Omit<ObjectSetting, "name">> | undefined>;
44
+ outputFilePattern: string;
45
+ prismaClientImport: string;
42
46
  purgeOutput: boolean;
43
- useInputType: ConfigInputItem[];
44
- noTypeId: boolean;
47
+ reExport: ReExport;
45
48
  requireSingleFieldsInWhereUniqueInput: boolean;
49
+ tsConfigFilePath: string | undefined;
46
50
  unsafeCompatibleWhereUniqueInput: boolean;
47
- graphqlScalars: Record<string, ImportNameSpec | undefined>;
48
- decorate: DecorateElement[];
49
- customImport: CustomImport[];
50
- esmCompatible: boolean;
51
+ useInputType: ConfigInputItem[];
51
52
  };
52
- type ConfigInputItem = {
53
+ interface ConfigInputItem {
53
54
  typeName: string;
54
55
  ALL?: string;
55
56
  [index: string]: string | undefined;
56
- };
57
+ }
57
58
 
58
- type ObjectSetting = {
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({ name, input, output, }: ObjectSettingsFilterArgs): boolean;
82
- getFieldType({ name, input, output, }: ObjectSettingsFilterArgs): ObjectSetting | undefined;
83
- getPropertyType({ name, input, output, }: ObjectSettingsFilterArgs): ObjectSetting | undefined;
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: Function): this;
93
- once(type: string | symbol, fn: Function): this;
94
- off(type: string | symbol, nullOrFn?: Function): boolean;
95
- emit(type: string | symbol, ...args: unknown[]): Promise<boolean>;
96
- emitSync(type: string | symbol, ...args: unknown[]): boolean;
97
- removeAllListeners(): void;
98
- listeners(type: string | symbol): Function[];
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
- type EventArguments = {
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
- }): SourceFile;
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): string | undefined;
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
- type ImportNameSpec = {
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 & {