@pegasusheavy/nestjs-prisma-graphql 1.4.3 → 1.6.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.
Files changed (210) hide show
  1. package/README.md +18 -7
  2. package/dist/benchmark/analysis.d.ts +7 -0
  3. package/dist/benchmark/analysis.d.ts.map +1 -0
  4. package/dist/benchmark/analysis.js +265 -0
  5. package/dist/benchmark/analysis.js.map +1 -0
  6. package/dist/benchmark/index.d.ts +7 -0
  7. package/dist/benchmark/index.d.ts.map +1 -0
  8. package/dist/benchmark/index.js +272 -0
  9. package/dist/benchmark/index.js.map +1 -0
  10. package/dist/event-names.d.ts +2 -0
  11. package/dist/event-names.d.ts.map +1 -0
  12. package/dist/event-names.js +2 -0
  13. package/dist/event-names.js.map +1 -0
  14. package/dist/generate.d.ts +4 -140
  15. package/dist/generate.d.ts.map +1 -0
  16. package/dist/generate.js +199 -2826
  17. package/dist/generate.js.map +1 -1
  18. package/dist/handlers/args-type.d.ts +7 -0
  19. package/dist/handlers/args-type.d.ts.map +1 -0
  20. package/dist/handlers/args-type.js +68 -0
  21. package/dist/handlers/args-type.js.map +1 -0
  22. package/dist/handlers/combine-scalar-filters.d.ts +6 -0
  23. package/dist/handlers/combine-scalar-filters.d.ts.map +1 -0
  24. package/dist/handlers/combine-scalar-filters.js +110 -0
  25. package/dist/handlers/combine-scalar-filters.js.map +1 -0
  26. package/dist/handlers/create-aggregate-input.d.ts +10 -0
  27. package/dist/handlers/create-aggregate-input.d.ts.map +1 -0
  28. package/dist/handlers/create-aggregate-input.js +33 -0
  29. package/dist/handlers/create-aggregate-input.js.map +1 -0
  30. package/dist/handlers/decimal-helpers.d.ts +10 -0
  31. package/dist/handlers/decimal-helpers.d.ts.map +1 -0
  32. package/dist/handlers/decimal-helpers.js +73 -0
  33. package/dist/handlers/decimal-helpers.js.map +1 -0
  34. package/dist/handlers/emit-single.d.ts +3 -0
  35. package/dist/handlers/emit-single.d.ts.map +1 -0
  36. package/dist/handlers/emit-single.js +14 -0
  37. package/dist/handlers/emit-single.js.map +1 -0
  38. package/dist/handlers/generate-barrel-exports.d.ts +13 -0
  39. package/dist/handlers/generate-barrel-exports.d.ts.map +1 -0
  40. package/dist/handlers/generate-barrel-exports.js +73 -0
  41. package/dist/handlers/generate-barrel-exports.js.map +1 -0
  42. package/dist/handlers/generate-files.d.ts +3 -0
  43. package/dist/handlers/generate-files.d.ts.map +1 -0
  44. package/dist/handlers/generate-files.js +133 -0
  45. package/dist/handlers/generate-files.js.map +1 -0
  46. package/dist/handlers/input-type.d.ts +7 -0
  47. package/dist/handlers/input-type.d.ts.map +1 -0
  48. package/dist/handlers/input-type.js +297 -0
  49. package/dist/handlers/input-type.js.map +1 -0
  50. package/dist/handlers/model-data.d.ts +3 -0
  51. package/dist/handlers/model-data.d.ts.map +1 -0
  52. package/dist/handlers/model-data.js +27 -0
  53. package/dist/handlers/model-data.js.map +1 -0
  54. package/dist/handlers/model-output-type.d.ts +3 -0
  55. package/dist/handlers/model-output-type.d.ts.map +1 -0
  56. package/dist/handlers/model-output-type.js +283 -0
  57. package/dist/handlers/model-output-type.js.map +1 -0
  58. package/dist/handlers/no-atomic-operations.d.ts +3 -0
  59. package/dist/handlers/no-atomic-operations.d.ts.map +1 -0
  60. package/dist/handlers/no-atomic-operations.js +41 -0
  61. package/dist/handlers/no-atomic-operations.js.map +1 -0
  62. package/dist/handlers/output-type.d.ts +3 -0
  63. package/dist/handlers/output-type.d.ts.map +1 -0
  64. package/dist/handlers/output-type.js +179 -0
  65. package/dist/handlers/output-type.js.map +1 -0
  66. package/dist/handlers/patch-type-registry.d.ts +16 -0
  67. package/dist/handlers/patch-type-registry.d.ts.map +1 -0
  68. package/dist/handlers/patch-type-registry.js +47 -0
  69. package/dist/handlers/patch-type-registry.js.map +1 -0
  70. package/dist/handlers/post-process-imports.d.ts +11 -0
  71. package/dist/handlers/post-process-imports.d.ts.map +1 -0
  72. package/dist/handlers/post-process-imports.js +44 -0
  73. package/dist/handlers/post-process-imports.js.map +1 -0
  74. package/dist/handlers/prisma-enum-doc.d.ts +11 -0
  75. package/dist/handlers/prisma-enum-doc.d.ts.map +1 -0
  76. package/dist/handlers/prisma-enum-doc.js +16 -0
  77. package/dist/handlers/prisma-enum-doc.js.map +1 -0
  78. package/dist/handlers/purge-output.d.ts +3 -0
  79. package/dist/handlers/purge-output.d.ts.map +1 -0
  80. package/dist/handlers/purge-output.js +34 -0
  81. package/dist/handlers/purge-output.js.map +1 -0
  82. package/dist/handlers/re-export.d.ts +9 -0
  83. package/dist/handlers/re-export.d.ts.map +1 -0
  84. package/dist/handlers/re-export.js +101 -0
  85. package/dist/handlers/re-export.js.map +1 -0
  86. package/dist/handlers/register-all-types.d.ts +13 -0
  87. package/dist/handlers/register-all-types.d.ts.map +1 -0
  88. package/dist/handlers/register-all-types.js +99 -0
  89. package/dist/handlers/register-all-types.js.map +1 -0
  90. package/dist/handlers/register-enum.d.ts +3 -0
  91. package/dist/handlers/register-enum.d.ts.map +1 -0
  92. package/dist/handlers/register-enum.js +65 -0
  93. package/dist/handlers/register-enum.js.map +1 -0
  94. package/dist/handlers/require-single-fields-in-whereunique-input.d.ts +3 -0
  95. package/dist/handlers/require-single-fields-in-whereunique-input.d.ts.map +1 -0
  96. package/dist/handlers/require-single-fields-in-whereunique-input.js +15 -0
  97. package/dist/handlers/require-single-fields-in-whereunique-input.js.map +1 -0
  98. package/dist/handlers/type-registry.d.ts +14 -0
  99. package/dist/handlers/type-registry.d.ts.map +1 -0
  100. package/dist/handlers/type-registry.js +151 -0
  101. package/dist/handlers/type-registry.js.map +1 -0
  102. package/dist/handlers/warning.d.ts +2 -0
  103. package/dist/handlers/warning.d.ts.map +1 -0
  104. package/dist/handlers/warning.js +14 -0
  105. package/dist/handlers/warning.js.map +1 -0
  106. package/dist/helpers/create-comment.d.ts +3 -0
  107. package/dist/helpers/create-comment.d.ts.map +1 -0
  108. package/dist/helpers/create-comment.js +23 -0
  109. package/dist/helpers/create-comment.js.map +1 -0
  110. package/dist/helpers/create-config.d.ts +51 -0
  111. package/dist/helpers/create-config.d.ts.map +1 -0
  112. package/dist/helpers/create-config.js +165 -0
  113. package/dist/helpers/create-config.js.map +1 -0
  114. package/dist/helpers/create-emit-blocks.d.ts +5 -0
  115. package/dist/helpers/create-emit-blocks.d.ts.map +1 -0
  116. package/dist/helpers/create-emit-blocks.js +37 -0
  117. package/dist/helpers/create-emit-blocks.js.map +1 -0
  118. package/dist/helpers/detect-circular-deps.d.ts +28 -0
  119. package/dist/helpers/detect-circular-deps.d.ts.map +1 -0
  120. package/dist/helpers/detect-circular-deps.js +92 -0
  121. package/dist/helpers/detect-circular-deps.js.map +1 -0
  122. package/dist/helpers/factory-get-source-file.d.ts +13 -0
  123. package/dist/helpers/factory-get-source-file.d.ts.map +1 -0
  124. package/dist/helpers/factory-get-source-file.js +17 -0
  125. package/dist/helpers/factory-get-source-file.js.map +1 -0
  126. package/dist/helpers/file-type-by-location.d.ts +3 -0
  127. package/dist/helpers/file-type-by-location.d.ts.map +1 -0
  128. package/dist/helpers/file-type-by-location.js +19 -0
  129. package/dist/helpers/file-type-by-location.js.map +1 -0
  130. package/dist/helpers/generate-file-name.d.ts +7 -0
  131. package/dist/helpers/generate-file-name.d.ts.map +1 -0
  132. package/dist/helpers/generate-file-name.js +35 -0
  133. package/dist/helpers/generate-file-name.js.map +1 -0
  134. package/dist/helpers/get-enum-name.d.ts +2 -0
  135. package/dist/helpers/get-enum-name.d.ts.map +1 -0
  136. package/dist/helpers/get-enum-name.js +5 -0
  137. package/dist/helpers/get-enum-name.js.map +1 -0
  138. package/dist/helpers/get-graphql-import.d.ts +19 -0
  139. package/dist/helpers/get-graphql-import.d.ts.map +1 -0
  140. package/dist/helpers/get-graphql-import.js +52 -0
  141. package/dist/helpers/get-graphql-import.js.map +1 -0
  142. package/dist/helpers/get-graphql-input-type.d.ts +6 -0
  143. package/dist/helpers/get-graphql-input-type.d.ts.map +1 -0
  144. package/dist/helpers/get-graphql-input-type.js +64 -0
  145. package/dist/helpers/get-graphql-input-type.js.map +1 -0
  146. package/dist/helpers/get-model-name.d.ts +2 -0
  147. package/dist/helpers/get-model-name.d.ts.map +1 -0
  148. package/dist/helpers/get-model-name.js +130 -0
  149. package/dist/helpers/get-model-name.js.map +1 -0
  150. package/dist/helpers/get-output-type-name.d.ts +2 -0
  151. package/dist/helpers/get-output-type-name.d.ts.map +1 -0
  152. package/dist/helpers/get-output-type-name.js +4 -0
  153. package/dist/helpers/get-output-type-name.js.map +1 -0
  154. package/dist/helpers/get-property-type.d.ts +9 -0
  155. package/dist/helpers/get-property-type.d.ts.map +1 -0
  156. package/dist/helpers/get-property-type.js +48 -0
  157. package/dist/helpers/get-property-type.js.map +1 -0
  158. package/dist/helpers/get-where-unique-at-least-keys.d.ts +3 -0
  159. package/dist/helpers/get-where-unique-at-least-keys.d.ts.map +1 -0
  160. package/dist/helpers/get-where-unique-at-least-keys.js +17 -0
  161. package/dist/helpers/get-where-unique-at-least-keys.js.map +1 -0
  162. package/dist/helpers/import-declaration-map.d.ts +19 -0
  163. package/dist/helpers/import-declaration-map.d.ts.map +1 -0
  164. package/dist/helpers/import-declaration-map.js +69 -0
  165. package/dist/helpers/import-declaration-map.js.map +1 -0
  166. package/dist/helpers/is-many-and-return.d.ts +2 -0
  167. package/dist/helpers/is-many-and-return.d.ts.map +1 -0
  168. package/dist/helpers/is-many-and-return.js +9 -0
  169. package/dist/helpers/is-many-and-return.js.map +1 -0
  170. package/dist/helpers/is-where-unique-input-type.d.ts +2 -0
  171. package/dist/helpers/is-where-unique-input-type.d.ts.map +1 -0
  172. package/dist/helpers/is-where-unique-input-type.js +4 -0
  173. package/dist/helpers/is-where-unique-input-type.js.map +1 -0
  174. package/dist/helpers/object-settings.d.ts +39 -0
  175. package/dist/helpers/object-settings.d.ts.map +1 -0
  176. package/dist/helpers/object-settings.js +297 -0
  177. package/dist/helpers/object-settings.js.map +1 -0
  178. package/dist/helpers/pascal-case.d.ts +2 -0
  179. package/dist/helpers/pascal-case.d.ts.map +1 -0
  180. package/dist/helpers/pascal-case.js +5 -0
  181. package/dist/helpers/pascal-case.js.map +1 -0
  182. package/dist/helpers/property-structure.d.ts +13 -0
  183. package/dist/helpers/property-structure.d.ts.map +1 -0
  184. package/dist/helpers/property-structure.js +20 -0
  185. package/dist/helpers/property-structure.js.map +1 -0
  186. package/dist/helpers/relative-path.d.ts +2 -0
  187. package/dist/helpers/relative-path.d.ts.map +1 -0
  188. package/dist/helpers/relative-path.js +20 -0
  189. package/dist/helpers/relative-path.js.map +1 -0
  190. package/dist/helpers/type-safe-assert.d.ts +7 -0
  191. package/dist/helpers/type-safe-assert.d.ts.map +1 -0
  192. package/dist/helpers/type-safe-assert.js +10 -0
  193. package/dist/helpers/type-safe-assert.js.map +1 -0
  194. package/dist/helpers/update-object-property.d.ts +7 -0
  195. package/dist/helpers/update-object-property.d.ts.map +1 -0
  196. package/dist/helpers/update-object-property.js +21 -0
  197. package/dist/helpers/update-object-property.js.map +1 -0
  198. package/dist/index.d.ts +4 -6
  199. package/dist/index.d.ts.map +1 -0
  200. package/dist/index.js +135 -2956
  201. package/dist/index.js.map +1 -1
  202. package/dist/test/test-utils.d.ts +4 -0
  203. package/dist/test/test-utils.d.ts.map +1 -0
  204. package/dist/test/test-utils.js +14 -0
  205. package/dist/test/test-utils.js.map +1 -0
  206. package/dist/types.d.ts +73 -0
  207. package/dist/types.d.ts.map +1 -0
  208. package/dist/types.js +2 -0
  209. package/dist/types.js.map +1 -0
  210. package/package.json +3 -3
@@ -0,0 +1,165 @@
1
+ import { unflatten } from 'flat';
2
+ import JSON5 from 'json5';
3
+ import { memoize, merge, trim } from 'lodash-es';
4
+ import { existsSync } from 'node:fs';
5
+ import outmatch from 'outmatch';
6
+ import { ok } from './type-safe-assert.js';
7
+ import { ReExport } from '../handlers/re-export.js';
8
+ import { createEmitBlocks } from './create-emit-blocks.js';
9
+ export function createConfig(data) {
10
+ const config = merge({}, unflatten(data, { delimiter: '_' }));
11
+ const $warnings = [];
12
+ const defaultPattern = `{model}/{name}.{type}.ts`;
13
+ const outputFilePatternValue = config.outputFilePattern;
14
+ const configOutputFilePattern = typeof outputFilePatternValue === 'string' ? outputFilePatternValue : defaultPattern;
15
+ // Validate and sanitize the output file pattern
16
+ // We don't use filenamify on the template itself since it contains placeholders like {model}, {name}, {type}
17
+ // Instead, we just normalize the path separators and trim
18
+ const sanitizedStep1 = configOutputFilePattern
19
+ .replaceAll('..', '/')
20
+ .replaceAll(/\/+/g, '/');
21
+ const outputFilePattern = trim(sanitizedStep1, '/');
22
+ if (outputFilePattern !== configOutputFilePattern) {
23
+ $warnings.push(`Due to invalid filepath 'outputFilePattern' changed to '${outputFilePattern}'`);
24
+ }
25
+ if (config.reExportAll !== undefined &&
26
+ config.reExportAll !== null &&
27
+ config.reExportAll !== false) {
28
+ $warnings.push(`Option 'reExportAll' is deprecated, use 'reExport' instead`);
29
+ if (toBoolean(config.reExportAll)) {
30
+ config.reExport = 'All';
31
+ }
32
+ }
33
+ const fields = Object.fromEntries(Object.entries((config.fields ?? {}))
34
+ .filter(({ 1: value }) => typeof value === 'object')
35
+ .map(([name, value]) => {
36
+ const fieldSetting = {
37
+ arguments: [],
38
+ defaultImport: toBoolean(value.defaultImport) ? true : value.defaultImport,
39
+ from: value.from,
40
+ input: toBoolean(value.input),
41
+ model: toBoolean(value.model),
42
+ namespaceImport: value.namespaceImport,
43
+ output: toBoolean(value.output),
44
+ };
45
+ return [name, fieldSetting];
46
+ }));
47
+ const decorate = [];
48
+ const decorateConfig = config.decorate !== undefined && config.decorate !== null
49
+ ? config.decorate
50
+ : {};
51
+ const configDecorate = Object.values(decorateConfig);
52
+ for (const element of configDecorate) {
53
+ if (element === undefined || element === null) {
54
+ continue;
55
+ }
56
+ ok(element.from !== undefined &&
57
+ element.from !== '' &&
58
+ element.name !== undefined &&
59
+ element.name !== '', `Missed 'from' or 'name' part in configuration for decorate`);
60
+ decorate.push({
61
+ arguments: element.arguments !== undefined && element.arguments !== ''
62
+ ? JSON5.parse(element.arguments)
63
+ : undefined,
64
+ defaultImport: toBoolean(element.defaultImport) ? true : element.defaultImport,
65
+ from: element.from,
66
+ isMatchField: outmatch(element.field, { separator: false }),
67
+ isMatchType: outmatch(element.type, { separator: false }),
68
+ name: element.name,
69
+ namedImport: toBoolean(element.namedImport),
70
+ namespaceImport: element.namespaceImport,
71
+ });
72
+ }
73
+ const customImport = [];
74
+ const customImportConfig = config.customImport !== undefined && config.customImport !== null
75
+ ? config.customImport
76
+ : {};
77
+ const configCustomImport = Object.values(customImportConfig);
78
+ for (const element of configCustomImport) {
79
+ if (element === undefined || element === null) {
80
+ continue;
81
+ }
82
+ ok(element.from !== undefined &&
83
+ element.from !== '' &&
84
+ element.name !== undefined &&
85
+ element.name !== '', `Missed 'from' or 'name' part in configuration for customImport`);
86
+ customImport.push({
87
+ defaultImport: toBoolean(element.defaultImport) ? true : element.defaultImport,
88
+ from: element.from,
89
+ name: element.name,
90
+ namedImport: toBoolean(element.namedImport),
91
+ namespaceImport: element.namespaceImport,
92
+ });
93
+ }
94
+ return {
95
+ $warnings,
96
+ combineScalarFilters: toBoolean(config.combineScalarFilters),
97
+ customImport,
98
+ decorate,
99
+ emitBlocks: createEmitBlocks(config.emitBlocks),
100
+ emitCompiled: toBoolean(config.emitCompiled),
101
+ emitSingle: toBoolean(config.emitSingle),
102
+ esmCompatible: toBoolean(config.esmCompatible),
103
+ esmSuppressTypeErrors: toBoolean(config.esmSuppressTypeErrors),
104
+ fields,
105
+ graphqlScalars: (config.graphqlScalars ?? {}),
106
+ noAtomicOperations: toBoolean(config.noAtomicOperations),
107
+ noTypeId: toBoolean(config.noTypeId),
108
+ omitModelsCount: toBoolean(config.omitModelsCount),
109
+ outputFilePattern,
110
+ prismaClientImport: createPrismaImport(config.prismaClientImport),
111
+ purgeOutput: toBoolean(config.purgeOutput),
112
+ reExport: ReExport[String(config.reExport)] ?? ReExport.None,
113
+ requireSingleFieldsInWhereUniqueInput: toBoolean(config.requireSingleFieldsInWhereUniqueInput),
114
+ tsConfigFilePath: createTsConfigFilePathValue(config.tsConfigFilePath),
115
+ unsafeCompatibleWhereUniqueInput: toBoolean(config.unsafeCompatibleWhereUniqueInput),
116
+ useInputType: createUseInputType(config.useInputType),
117
+ };
118
+ }
119
+ const existsSyncTyped = existsSync;
120
+ const tsConfigFileExistsRaw = memoize((filePath) => {
121
+ const exists = existsSyncTyped(filePath);
122
+ return exists;
123
+ });
124
+ const tsConfigFileExists = tsConfigFileExistsRaw;
125
+ function createTsConfigFilePathValue(value) {
126
+ if (typeof value === 'string' && value !== '') {
127
+ return value;
128
+ }
129
+ const fileExists = tsConfigFileExists('tsconfig.json');
130
+ if (fileExists) {
131
+ return 'tsconfig.json';
132
+ }
133
+ return undefined;
134
+ }
135
+ function createPrismaImport(value) {
136
+ if (typeof value === 'string' && value !== '') {
137
+ return value;
138
+ }
139
+ return '@prisma/client';
140
+ }
141
+ function createUseInputType(data) {
142
+ if (data === undefined || data === null) {
143
+ return [];
144
+ }
145
+ const result = [];
146
+ for (const [typeName, useInputs] of Object.entries(data)) {
147
+ const entry = {
148
+ ALL: undefined,
149
+ typeName,
150
+ };
151
+ if (useInputs.ALL !== undefined && useInputs.ALL !== '') {
152
+ entry.ALL = useInputs.ALL;
153
+ delete useInputs.ALL;
154
+ }
155
+ for (const [propertyName, pattern] of Object.entries(useInputs)) {
156
+ entry[propertyName] = pattern;
157
+ }
158
+ result.push(entry);
159
+ }
160
+ return result;
161
+ }
162
+ function toBoolean(value) {
163
+ return ['true', '1', 'on'].includes(String(value));
164
+ }
165
+ //# sourceMappingURL=create-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-config.js","sourceRoot":"","sources":["../../src/helpers/create-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,KA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,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAED,SAAS,kBAAkB,CAAC,IAAsC;IAChE,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QACxC,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,MAAM,GAAsB,EAAE,CAAC;IACrC,KAAK,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACzD,MAAM,KAAK,GAAoB;YAC7B,GAAG,EAAE,SAAS;YACd,QAAQ;SACT,CAAC;QACF,IAAI,SAAS,CAAC,GAAG,KAAK,SAAS,IAAI,SAAS,CAAC,GAAG,KAAK,EAAE,EAAE,CAAC;YACxD,KAAK,CAAC,GAAG,GAAG,SAAS,CAAC,GAAG,CAAC;YAC1B,OAAO,SAAS,CAAC,GAAG,CAAC;QACvB,CAAC;QAED,KAAK,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;YAChE,KAAK,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC;QAChC,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,SAAS,CAAC,KAAc;IAC/B,OAAO,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AACrD,CAAC"}
@@ -0,0 +1,5 @@
1
+ type EmittedBlockType = 'prismaEnums' | 'schemaEnums' | 'models' | 'inputs' | 'args' | 'outputs';
2
+ export type EmitBlocksOption = 'enums' | 'models' | 'inputs' | 'args' | 'outputs';
3
+ export declare function createEmitBlocks(data?: string[]): Record<EmittedBlockType, boolean>;
4
+ export {};
5
+ //# sourceMappingURL=create-emit-blocks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-emit-blocks.d.ts","sourceRoot":"","sources":["../../src/helpers/create-emit-blocks.ts"],"names":[],"mappings":"AAAA,KAAK,gBAAgB,GACjB,aAAa,GACb,aAAa,GACb,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,SAAS,CAAC;AAEd,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;AAmBlF,wBAAgB,gBAAgB,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC,CA6BnF"}
@@ -0,0 +1,37 @@
1
+ const allEmmittedBlocks = [
2
+ 'prismaEnums',
3
+ 'schemaEnums',
4
+ 'models',
5
+ 'inputs',
6
+ 'args',
7
+ 'outputs',
8
+ ];
9
+ const blocksDependencyMap = {
10
+ args: ['args', 'inputs', 'prismaEnums'],
11
+ enums: ['schemaEnums', 'prismaEnums'],
12
+ inputs: ['inputs', 'prismaEnums'],
13
+ models: ['models', 'schemaEnums'],
14
+ outputs: ['outputs'],
15
+ };
16
+ export function createEmitBlocks(data) {
17
+ if (!data) {
18
+ const entries = allEmmittedBlocks.map(block => [block, true]);
19
+ const allBlocks = Object.fromEntries(entries);
20
+ return allBlocks;
21
+ }
22
+ const initialBlocks = {};
23
+ let currentBlocks = initialBlocks;
24
+ for (const block of data) {
25
+ if (!Object.keys(blocksDependencyMap).includes(block)) {
26
+ continue;
27
+ }
28
+ const blockEntries = blocksDependencyMap[block].map(emittedBlock => [emittedBlock, true]);
29
+ const newBlocks = Object.fromEntries(blockEntries);
30
+ currentBlocks = {
31
+ ...currentBlocks,
32
+ ...newBlocks,
33
+ };
34
+ }
35
+ return currentBlocks;
36
+ }
37
+ //# sourceMappingURL=create-emit-blocks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-emit-blocks.js","sourceRoot":"","sources":["../../src/helpers/create-emit-blocks.ts"],"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AAa,CAAC;AACvB,CAAC"}
@@ -0,0 +1,28 @@
1
+ import type { Model } from '../types.js';
2
+ /**
3
+ * Represents a dependency graph where keys are model names and values are sets of dependent model names
4
+ */
5
+ export type DependencyGraph = Map<string, Set<string>>;
6
+ /**
7
+ * Represents a set of model name pairs that have circular dependencies
8
+ * Format: "ModelA:ModelB" where ModelA < ModelB alphabetically
9
+ */
10
+ export type CircularDependencySet = Set<string>;
11
+ /**
12
+ * Build a dependency graph from Prisma models based on their relations
13
+ */
14
+ export declare function buildDependencyGraph(models: Model[]): DependencyGraph;
15
+ /**
16
+ * Detect all circular dependencies in the dependency graph using DFS
17
+ * Returns a set of model pairs that form cycles
18
+ */
19
+ export declare function detectCircularDependencies(graph: DependencyGraph): CircularDependencySet;
20
+ /**
21
+ * Check if two models have a circular dependency relationship
22
+ */
23
+ export declare function hasCircularDependency(circularDeps: CircularDependencySet, modelA: string, modelB: string): boolean;
24
+ /**
25
+ * Get all models that are involved in any circular dependency
26
+ */
27
+ export declare function getModelsInCircularDeps(circularDeps: CircularDependencySet): Set<string>;
28
+ //# sourceMappingURL=detect-circular-deps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detect-circular-deps.d.ts","sourceRoot":"","sources":["../../src/helpers/detect-circular-deps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;AAEvD;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC;AAEhD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,eAAe,CA0BrE;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,eAAe,GACrB,qBAAqB,CA4CvB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,qBAAqB,EACnC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GACb,OAAO,CAGT;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,qBAAqB,GAClC,GAAG,CAAC,MAAM,CAAC,CAQb"}
@@ -0,0 +1,92 @@
1
+ /**
2
+ * Build a dependency graph from Prisma models based on their relations
3
+ */
4
+ export function buildDependencyGraph(models) {
5
+ const graph = new Map();
6
+ // Initialize all models in the graph
7
+ for (const model of models) {
8
+ graph.set(model.name, new Set());
9
+ }
10
+ // Add edges for each relation field
11
+ for (const model of models) {
12
+ const dependencies = graph.get(model.name);
13
+ if (!dependencies) {
14
+ continue;
15
+ }
16
+ for (const field of model.fields) {
17
+ // Only consider object/relation fields that reference other models
18
+ if (field.kind === 'object' && field.type !== model.name) {
19
+ // Check if the referenced type is actually a model
20
+ if (graph.has(field.type)) {
21
+ dependencies.add(field.type);
22
+ }
23
+ }
24
+ }
25
+ }
26
+ return graph;
27
+ }
28
+ /**
29
+ * Detect all circular dependencies in the dependency graph using DFS
30
+ * Returns a set of model pairs that form cycles
31
+ */
32
+ export function detectCircularDependencies(graph) {
33
+ const circularPairs = new Set();
34
+ const visited = new Set();
35
+ const recursionStack = new Set();
36
+ const path = [];
37
+ function dfs(node) {
38
+ visited.add(node);
39
+ recursionStack.add(node);
40
+ path.push(node);
41
+ const dependencies = graph.get(node) ?? new Set();
42
+ for (const dep of dependencies) {
43
+ if (!visited.has(dep)) {
44
+ dfs(dep);
45
+ }
46
+ else if (recursionStack.has(dep)) {
47
+ // Found a cycle - record all pairs in the cycle path
48
+ const cycleStartIndex = path.indexOf(dep);
49
+ if (cycleStartIndex !== -1) {
50
+ const cyclePath = path.slice(cycleStartIndex);
51
+ // Add all pairs in the cycle
52
+ for (let i = 0; i < cyclePath.length; i++) {
53
+ const a = cyclePath[i];
54
+ const b = cyclePath[(i + 1) % cyclePath.length];
55
+ // Store in alphabetical order for consistency
56
+ const pair = a < b ? `${a}:${b}` : `${b}:${a}`;
57
+ circularPairs.add(pair);
58
+ }
59
+ }
60
+ }
61
+ }
62
+ path.pop();
63
+ recursionStack.delete(node);
64
+ }
65
+ // Run DFS from each unvisited node
66
+ for (const node of graph.keys()) {
67
+ if (!visited.has(node)) {
68
+ dfs(node);
69
+ }
70
+ }
71
+ return circularPairs;
72
+ }
73
+ /**
74
+ * Check if two models have a circular dependency relationship
75
+ */
76
+ export function hasCircularDependency(circularDeps, modelA, modelB) {
77
+ const pair = modelA < modelB ? `${modelA}:${modelB}` : `${modelB}:${modelA}`;
78
+ return circularDeps.has(pair);
79
+ }
80
+ /**
81
+ * Get all models that are involved in any circular dependency
82
+ */
83
+ export function getModelsInCircularDeps(circularDeps) {
84
+ const models = new Set();
85
+ for (const pair of circularDeps) {
86
+ const [a, b] = pair.split(':');
87
+ models.add(a);
88
+ models.add(b);
89
+ }
90
+ return models;
91
+ }
92
+ //# sourceMappingURL=detect-circular-deps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detect-circular-deps.js","sourceRoot":"","sources":["../../src/helpers/detect-circular-deps.ts"],"names":[],"mappings":"AAaA;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAe;IAClD,MAAM,KAAK,GAAoB,IAAI,GAAG,EAAE,CAAC;IAEzC,qCAAqC;IACrC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;IACnC,CAAC;IAED,oCAAoC;IACpC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,YAAY,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,SAAS;QACX,CAAC;QACD,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,MAA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EG;AACH,MAAM,UAAU,uBAAuB,CACrC,YAAmC;IAEnC,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;IACjC,KAAK,MAAM,IAAI,IAAI,YAAY,EAAE,CAAC;QAChC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC/B,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACd,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAChB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { EventEmitter } from '../types.js';
2
+ import type { Project, SourceFile } from 'ts-morph';
3
+ export declare function factoryGetSourceFile(args: {
4
+ output: string;
5
+ outputFilePattern: string;
6
+ project: Project;
7
+ getModelName: (name: string) => string | undefined;
8
+ eventEmitter: EventEmitter;
9
+ }): (getSourceFileArgs: {
10
+ type: string;
11
+ name: string;
12
+ }) => SourceFile;
13
+ //# sourceMappingURL=factory-get-source-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory-get-source-file.d.ts","sourceRoot":"","sources":["../../src/helpers/factory-get-source-file.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAIpD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IACnD,YAAY,EAAE,YAAY,CAAC;CAC5B,IAG+B,mBAAmB;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,KAAG,UAAU,CAef"}
@@ -0,0 +1,17 @@
1
+ import { generateFileName } from './generate-file-name.js';
2
+ export function factoryGetSourceFile(args) {
3
+ const { getModelName, output, outputFilePattern, project } = args;
4
+ return function getSourceFile(getSourceFileArgs) {
5
+ const { name, type } = getSourceFileArgs;
6
+ let filePath = generateFileName({
7
+ getModelName,
8
+ name,
9
+ template: outputFilePattern,
10
+ type,
11
+ });
12
+ filePath = `${output}/${filePath}`;
13
+ return (project.getSourceFile(filePath) ??
14
+ project.createSourceFile(filePath, undefined, { overwrite: true }));
15
+ };
16
+ }
17
+ //# sourceMappingURL=factory-get-source-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory-get-source-file.js","sourceRoot":"","sources":["../../src/helpers/factory-get-source-file.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,MAAM,UAAU,oBAAoB,CAAC,IAMpC;IACC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAElE,OAAO,SAAS,aAAa,CAAC,iBAG7B;QACC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,iBAAiB,CAAC;QACzC,IAAI,QAAQ,GAAG,gBAAgB,CAAC;YAC9B,YAAY;YACZ,IAAI;YACJ,QAAQ,EAAE,iBAAiB;YAC3B,IAAI;SACL,CAAC,CAAC;QACH,QAAQ,GAAG,GAAG,MAAM,IAAI,QAAQ,EAAE,CAAC;QAEnC,OAAO,CACL,OAAO,CAAC,aAAa,CAAC,QAAQ,CAAC;YAC/B,OAAO,CAAC,gBAAgB,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CACnE,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { FieldLocation } from '../types.js';
2
+ export declare function fileTypeByLocation(fieldLocation: FieldLocation): string;
3
+ //# sourceMappingURL=file-type-by-location.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-type-by-location.d.ts","sourceRoot":"","sources":["../../src/helpers/file-type-by-location.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,aAAa,GAAG,MAAM,CAiBvE"}
@@ -0,0 +1,19 @@
1
+ export function fileTypeByLocation(fieldLocation) {
2
+ switch (fieldLocation) {
3
+ case 'inputObjectTypes': {
4
+ return 'input';
5
+ }
6
+ case 'outputObjectTypes': {
7
+ return 'output';
8
+ }
9
+ case 'enumTypes': {
10
+ return 'enum';
11
+ }
12
+ case 'fieldRefTypes':
13
+ case 'scalar':
14
+ default: {
15
+ return 'object';
16
+ }
17
+ }
18
+ }
19
+ //# sourceMappingURL=file-type-by-location.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-type-by-location.js","sourceRoot":"","sources":["../../src/helpers/file-type-by-location.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,kBAAkB,CAAC,aAA4B;IAC7D,QAAQ,aAAa,EAAE,CAAC;QACtB,KAAK,kBAAkB,CAAC,CAAC,CAAC;YACxB,OAAO,OAAO,CAAC;QACjB,CAAC;QACD,KAAK,mBAAmB,CAAC,CAAC,CAAC;YACzB,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,KAAK,WAAW,CAAC,CAAC,CAAC;YACjB,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,KAAK,eAAe,CAAC;QACrB,KAAK,QAAQ,CAAC;QACd,OAAO,CAAC,CAAC,CAAC;YACR,OAAO,QAAQ,CAAC;QAClB,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare function generateFileName(args: {
2
+ type: string;
3
+ name: string;
4
+ getModelName: (name: string) => string | undefined;
5
+ template: string;
6
+ }): string;
7
+ //# sourceMappingURL=generate-file-name.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-file-name.d.ts","sourceRoot":"","sources":["../../src/helpers/generate-file-name.ts"],"names":[],"mappings":"AAKA,wBAAgB,gBAAgB,CAAC,IAAI,EAAE;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IACnD,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,MAAM,CAgCT"}
@@ -0,0 +1,35 @@
1
+ import filenamify from 'filenamify';
2
+ import { kebabCase } from 'lodash-es';
3
+ import pluralize from 'pluralize';
4
+ import pupa from 'pupa';
5
+ export function generateFileName(args) {
6
+ const { getModelName, name, template, type } = args;
7
+ const rawPath = pupa(template, {
8
+ get model() {
9
+ const result = getModelName(name) ?? 'prisma';
10
+ return kebabCase(result);
11
+ },
12
+ get name() {
13
+ let result = kebabCase(name);
14
+ for (const suffix of ['input', 'args', 'enum']) {
15
+ const ending = `-${suffix}`;
16
+ if (type === suffix && result.endsWith(ending)) {
17
+ result = result.slice(0, -ending.length);
18
+ }
19
+ }
20
+ return result;
21
+ },
22
+ plural: {
23
+ get type() {
24
+ return pluralize(type);
25
+ },
26
+ },
27
+ type,
28
+ });
29
+ // Apply filenamify to each path segment after template expansion
30
+ return rawPath
31
+ .split('/')
32
+ .map(segment => filenamify(segment, { replacement: '-' }))
33
+ .join('/');
34
+ }
35
+ //# sourceMappingURL=generate-file-name.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-file-name.js","sourceRoot":"","sources":["../../src/helpers/generate-file-name.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,SAAS,MAAM,WAAW,CAAC;AAClC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,UAAU,gBAAgB,CAAC,IAKhC;IACC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;IAEpD,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,EAAE;QAC7B,IAAI,KAAK;YACP,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC;YAC9C,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC;QAC3B,CAAC;QACD,IAAI,IAAI;YACN,IAAI,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;YAE7B,KAAK,MAAM,MAAM,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;gBAC/C,MAAM,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;gBAC5B,IAAI,IAAI,KAAK,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;oBAC/C,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;gBAC3C,CAAC;YACH,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,MAAM,EAAE;YACN,IAAI,IAAI;gBACN,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;YACzB,CAAC;SACF;QACD,IAAI;KACL,CAAC,CAAC;IAEH,iEAAiE;IACjE,OAAO,OAAO;SACX,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC;SACzD,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function getEnumName(referenceName: string): string;
2
+ //# sourceMappingURL=get-enum-name.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-enum-name.d.ts","sourceRoot":"","sources":["../../src/helpers/get-enum-name.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAGzD"}
@@ -0,0 +1,5 @@
1
+ export function getEnumName(referenceName) {
2
+ // `${Role}`
3
+ return referenceName.slice(3, -2);
4
+ }
5
+ //# sourceMappingURL=get-enum-name.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-enum-name.js","sourceRoot":"","sources":["../../src/helpers/get-enum-name.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,WAAW,CAAC,aAAqB;IAC/C,YAAY;IACZ,OAAO,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACpC,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { FieldLocation, GeneratorConfiguration } from '../types.js';
2
+ import type { SourceFile } from 'ts-morph';
3
+ export declare function getGraphqlImport(args: {
4
+ sourceFile: SourceFile;
5
+ typeName: string;
6
+ location: FieldLocation;
7
+ isId?: boolean;
8
+ fileType?: string;
9
+ noTypeId?: boolean;
10
+ getSourceFile: (args: {
11
+ type: string;
12
+ name: string;
13
+ }) => SourceFile;
14
+ config: GeneratorConfiguration;
15
+ }): {
16
+ name: string;
17
+ specifier?: string;
18
+ };
19
+ //# sourceMappingURL=get-graphql-import.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-graphql-import.d.ts","sourceRoot":"","sources":["../../src/helpers/get-graphql-import.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAK3C,wBAAgB,gBAAgB,CAAC,IAAI,EAAE;IACrC,UAAU,EAAE,UAAU,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,aAAa,CAAC;IACxB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,UAAU,CAAC;IACpE,MAAM,EAAE,sBAAsB,CAAC;CAChC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAoEvC"}
@@ -0,0 +1,52 @@
1
+ import { fileTypeByLocation } from './file-type-by-location.js';
2
+ import { relativePath } from './relative-path.js';
3
+ export function getGraphqlImport(args) {
4
+ const { config, fileType, getSourceFile, isId, location, noTypeId, sourceFile, typeName, } = args;
5
+ if (location === 'scalar') {
6
+ if (isId && !noTypeId) {
7
+ return { name: 'ID', specifier: '@nestjs/graphql' };
8
+ }
9
+ const graphqlType = config.graphqlScalars[typeName];
10
+ if (graphqlType) {
11
+ return { name: graphqlType.name, specifier: graphqlType.specifier };
12
+ }
13
+ switch (typeName) {
14
+ case 'Float':
15
+ case 'Int': {
16
+ return { name: typeName, specifier: '@nestjs/graphql' };
17
+ }
18
+ case 'DateTime': {
19
+ return { name: 'Date', specifier: undefined };
20
+ }
21
+ case 'true':
22
+ case 'Boolean': {
23
+ return { name: 'Boolean', specifier: undefined };
24
+ }
25
+ case 'Decimal': {
26
+ // Use graphql-scalars by default for Prisma 7+ compatibility
27
+ return {
28
+ name: 'GraphQLDecimal',
29
+ specifier: 'graphql-scalars',
30
+ };
31
+ }
32
+ case 'Json': {
33
+ return { name: 'GraphQLJSON', specifier: 'graphql-type-json' };
34
+ }
35
+ }
36
+ return { name: 'String', specifier: undefined };
37
+ }
38
+ let sourceFileType = fileTypeByLocation(location);
39
+ if (sourceFileType === 'output' && fileType === 'model') {
40
+ sourceFileType = 'model';
41
+ }
42
+ let specifier = relativePath(sourceFile.getFilePath(), getSourceFile({
43
+ name: typeName,
44
+ type: sourceFileType,
45
+ }).getFilePath());
46
+ // In ESM mode, add .js extension for module resolution
47
+ if (config.esmCompatible && !specifier.startsWith('@') && !specifier.endsWith('.js')) {
48
+ specifier += '.js';
49
+ }
50
+ return { name: typeName, specifier };
51
+ }
52
+ //# sourceMappingURL=get-graphql-import.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-graphql-import.js","sourceRoot":"","sources":["../../src/helpers/get-graphql-import.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,UAAU,gBAAgB,CAAC,IAShC;IACC,MAAM,EACJ,MAAM,EACN,QAAQ,EACR,aAAa,EACb,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,QAAQ,GACT,GAAG,IAAI,CAAC;IAET,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC1B,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACtB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;QACtD,CAAC;QAED,MAAM,WAAW,GAAG,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QACpD,IAAI,WAAW,EAAE,CAAC;YAChB,OAAO,EAAE,IAAI,EAAE,WAAW,CAAC,IAAI,EAAE,SAAS,EAAE,WAAW,CAAC,SAAS,EAAE,CAAC;QACtE,CAAC;QAED,QAAQ,QAAQ,EAAE,CAAC;YACjB,KAAK,OAAO,CAAC;YACb,KAAK,KAAK,CAAC,CAAC,CAAC;gBACX,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;YAC1D,CAAC;YACD,KAAK,UAAU,CAAC,CAAC,CAAC;gBAChB,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;YAChD,CAAC;YACD,KAAK,MAAM,CAAC;YACZ,KAAK,SAAS,CAAC,CAAC,CAAC;gBACf,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;YACnD,CAAC;YACD,KAAK,SAAS,CAAC,CAAC,CAAC;gBACf,6DAA6D;gBAC7D,OAAO;oBACL,IAAI,EAAE,gBAAgB;oBACtB,SAAS,EAAE,iBAAiB;iBAC7B,CAAC;YACJ,CAAC;YACD,KAAK,MAAM,CAAC,CAAC,CAAC;gBACZ,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC;YACjE,CAAC;QACH,CAAC;QAED,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;IAClD,CAAC;IAED,IAAI,cAAc,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAClD,IAAI,cAAc,KAAK,QAAQ,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;QACxD,cAAc,GAAG,OAAO,CAAC;IAC3B,CAAC;IAED,IAAI,SAAS,GAAG,YAAY,CAC1B,UAAU,CAAC,WAAW,EAAE,EACxB,aAAa,CAAC;QACZ,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,cAAc;KACrB,CAAC,CAAC,WAAW,EAAE,CACjB,CAAC;IAEF,uDAAuD;IACvD,IAAI,MAAM,CAAC,aAAa,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACrF,SAAS,IAAI,KAAK,CAAC;IACrB,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;AACvC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { DMMF } from '../types.js';
2
+ /**
3
+ * Find input type for graphql field decorator.
4
+ */
5
+ export declare function getGraphqlInputType(inputTypes: DMMF.InputTypeRef[], pattern?: string): DMMF.InputTypeRef;
6
+ //# sourceMappingURL=get-graphql-input-type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-graphql-input-type.d.ts","sourceRoot":"","sources":["../../src/helpers/get-graphql-input-type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAKxC;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,IAAI,CAAC,YAAY,EAAE,EAC/B,OAAO,CAAC,EAAE,MAAM,GACf,IAAI,CAAC,YAAY,CA+EnB"}