@nestledjs/api 2.6.0 → 2.7.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/package.json
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<claude-mem-context>
|
|
2
|
+
# Recent Activity
|
|
3
|
+
|
|
4
|
+
<!-- This section is auto-generated by claude-mem. Edit content outside the tags. -->
|
|
5
|
+
|
|
6
|
+
### Feb 4, 2026
|
|
7
|
+
|
|
8
|
+
| ID | Time | T | Title | Read |
|
|
9
|
+
|----|------|---|-------|------|
|
|
10
|
+
| #212 | 4:17 PM | ✅ | Prisma v7 Decimal Type Handling Updated | ~318 |
|
|
11
|
+
| #205 | 4:16 PM | ✅ | Updated Decimal Import for Prisma v7 Compatibility | ~276 |
|
|
12
|
+
| #203 | " | 🔵 | Generate-Models Script Implementation Details | ~232 |
|
|
13
|
+
| #202 | 4:15 PM | 🔵 | Prisma V7 Client Import Path Changed from index to client | ~442 |
|
|
14
|
+
|
|
15
|
+
### Feb 5, 2026
|
|
16
|
+
|
|
17
|
+
| ID | Time | T | Title | Read |
|
|
18
|
+
|----|------|---|-------|------|
|
|
19
|
+
| #497 | 10:33 AM | 🔴 | Fixed Enum Import/Export Order in Model Generator | ~300 |
|
|
20
|
+
| #489 | 10:32 AM | 🔴 | Fixed PgBouncer Support and Enum Import Issues | ~417 |
|
|
21
|
+
| #402 | 10:05 AM | 🔴 | Generate-Models Template Enum Import/Export Order Fixed | ~379 |
|
|
22
|
+
| #400 | " | 🔵 | Generate-Models Script Exports Prisma Enums for GraphQL | ~345 |
|
|
23
|
+
</claude-mem-context>
|
|
@@ -197,7 +197,11 @@ function generateModels(models: readonly any[], enums: readonly any[]): string {
|
|
|
197
197
|
const usesBigInt = models.some(model =>
|
|
198
198
|
model.fields.some((field: { type: string }) => field.type === 'BigInt'),
|
|
199
199
|
)
|
|
200
|
-
|
|
200
|
+
// Check if any model field uses DateTime
|
|
201
|
+
const usesDateTime = models.some(model =>
|
|
202
|
+
model.fields.some((field: { type: string }) => field.type === 'DateTime'),
|
|
203
|
+
)
|
|
204
|
+
let output = `import { Field, ObjectType${usesFloat ? ', Float' : ''}${usesDateTime ? ', GraphQLISODateTime' : ''}, Int } from '@nestjs/graphql';\n`
|
|
201
205
|
output += `import { GraphQLJSONObject } from 'graphql-type-json';\n`
|
|
202
206
|
|
|
203
207
|
// Check if any model field uses Decimal
|
|
@@ -215,9 +219,9 @@ function generateModels(models: readonly any[], enums: readonly any[]): string {
|
|
|
215
219
|
if (usesBigInt) {
|
|
216
220
|
output += `import { GraphQLBigInt } from 'graphql-scalars';\n`
|
|
217
221
|
}
|
|
218
|
-
// Import JsonValue type
|
|
222
|
+
// Import JsonValue type directly from Prisma v7 runtime (where it now lives)
|
|
219
223
|
if (usesJson) {
|
|
220
|
-
output += `import type { JsonValue } from '
|
|
224
|
+
output += `import type { JsonValue } from '@prisma/client/runtime/client';\n`
|
|
221
225
|
}
|
|
222
226
|
// Ensure enums are imported correctly
|
|
223
227
|
const enumNames = enums.map(e => e.name)
|
|
@@ -281,7 +285,7 @@ function generateModels(models: readonly any[], enums: readonly any[]): string {
|
|
|
281
285
|
else if (originalType === 'Json') listItemGraphQLType = 'GraphQLJSONObject'
|
|
282
286
|
else if (isEnum || isRelation)
|
|
283
287
|
listItemGraphQLType = originalType // Assumes enum/type is registered with GraphQL
|
|
284
|
-
else if (originalType === 'DateTime') listItemGraphQLType = '
|
|
288
|
+
else if (originalType === 'DateTime') listItemGraphQLType = 'GraphQLISODateTime'
|
|
285
289
|
else if (originalType === 'Boolean') listItemGraphQLType = 'Boolean'
|
|
286
290
|
else if (originalType.toLowerCase() === 'string' || originalType === 'ID') {
|
|
287
291
|
listItemGraphQLType = 'String'
|
|
@@ -297,7 +301,7 @@ function generateModels(models: readonly any[], enums: readonly any[]): string {
|
|
|
297
301
|
else if (originalType === 'BigInt') decoratorType = '() => GraphQLBigInt'
|
|
298
302
|
else if (originalType === 'Json') decoratorType = '() => GraphQLJSONObject'
|
|
299
303
|
else if (isEnum || isRelation) decoratorType = `() => ${originalType}`
|
|
300
|
-
else if (originalType === 'DateTime') decoratorType = '() =>
|
|
304
|
+
else if (originalType === 'DateTime') decoratorType = '() => GraphQLISODateTime'
|
|
301
305
|
else if (originalType === 'Boolean') decoratorType = '() => Boolean'
|
|
302
306
|
else if (originalType.toLowerCase() === 'string' || originalType === 'ID')
|
|
303
307
|
decoratorType = '() => String'
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
let gqlImports = new Set(['Field', 'InputType'])
|
|
4
4
|
let usesGraphQLJSON = false
|
|
5
5
|
let usesGraphQLBigInt = false
|
|
6
|
+
let usesDateTime = false
|
|
6
7
|
let usesInt = false
|
|
7
8
|
let usesFloat = false
|
|
8
9
|
let usesID = false
|
|
@@ -72,6 +73,7 @@ for (const model of models) {
|
|
|
72
73
|
if (field.type === 'Float' || field.type === 'Decimal') usesFloat = true
|
|
73
74
|
if (field.type === 'Json') usesGraphQLJSON = true
|
|
74
75
|
if (field.type === 'BigInt') usesGraphQLBigInt = true
|
|
76
|
+
if (field.type === 'DateTime') usesDateTime = true
|
|
75
77
|
if (field.type === 'ID') usesID = true
|
|
76
78
|
if (field.kind === 'enum') {
|
|
77
79
|
enumNames.add(field.type)
|
|
@@ -82,6 +84,7 @@ for (const model of models) {
|
|
|
82
84
|
if (usesInt) gqlImports.add('Int')
|
|
83
85
|
if (usesFloat) gqlImports.add('Float')
|
|
84
86
|
if (usesID) gqlImports.add('ID')
|
|
87
|
+
if (usesDateTime) gqlImports.add('GraphQLISODateTime')
|
|
85
88
|
usesPartialType = models.length > 0 // If we generate any Update input, we need PartialType
|
|
86
89
|
%>
|
|
87
90
|
import { <%= Array.from(gqlImports).join(', ') %> } from '@nestjs/graphql'
|
|
@@ -109,7 +112,7 @@ export class Create<%= model.modelName %>Input {
|
|
|
109
112
|
else if (field.type === 'Float') { baseGqlType = 'Float'; tsType = 'number'; }
|
|
110
113
|
else if (field.type === 'Decimal') { baseGqlType = 'Float'; tsType = 'number'; }
|
|
111
114
|
else if (field.type === 'Boolean') { baseGqlType = 'Boolean'; tsType = 'boolean'; }
|
|
112
|
-
else if (field.type === 'DateTime') { baseGqlType = '
|
|
115
|
+
else if (field.type === 'DateTime') { baseGqlType = 'GraphQLISODateTime'; tsType = 'Date'; }
|
|
113
116
|
else if (field.type === 'Json') { baseGqlType = 'GraphQLJSON'; tsType = 'typeof GraphQLJSON'; }
|
|
114
117
|
else if (field.type === 'ID') { baseGqlType = 'ID'; tsType = 'string'; }
|
|
115
118
|
else if (field.kind === 'enum') {
|
|
@@ -153,7 +156,7 @@ export class Update<%= model.modelName %>Input {
|
|
|
153
156
|
else if (field.type === 'Float') { baseGqlType = 'Float'; tsType = 'number'; }
|
|
154
157
|
else if (field.type === 'Decimal') { baseGqlType = 'Float'; tsType = 'number'; }
|
|
155
158
|
else if (field.type === 'Boolean') { baseGqlType = 'Boolean'; tsType = 'boolean'; }
|
|
156
|
-
else if (field.type === 'DateTime') { baseGqlType = '
|
|
159
|
+
else if (field.type === 'DateTime') { baseGqlType = 'GraphQLISODateTime'; tsType = 'Date'; }
|
|
157
160
|
else if (field.type === 'Json') { baseGqlType = 'GraphQLJSON'; tsType = 'typeof GraphQLJSON'; }
|
|
158
161
|
else if (field.type === 'ID') { baseGqlType = 'ID'; tsType = 'string'; }
|
|
159
162
|
else if (field.kind === 'enum') {
|
|
@@ -190,7 +193,7 @@ export class List<%= model.modelName %>Input extends CorePagingInput {
|
|
|
190
193
|
else if (field.type === 'Float') { baseGqlType = 'Float'; tsType = 'number'; }
|
|
191
194
|
else if (field.type === 'Decimal') { baseGqlType = 'Float'; tsType = 'number'; }
|
|
192
195
|
else if (field.type === 'Boolean') { baseGqlType = 'Boolean'; tsType = 'boolean'; }
|
|
193
|
-
else if (field.type === 'DateTime') { baseGqlType = '
|
|
196
|
+
else if (field.type === 'DateTime') { baseGqlType = 'GraphQLISODateTime'; tsType = 'Date'; }
|
|
194
197
|
else if (field.type === 'Json') { baseGqlType = 'GraphQLJSON'; tsType = 'typeof GraphQLJSON'; }
|
|
195
198
|
else if (field.type === 'ID') { baseGqlType = 'ID'; tsType = 'string'; }
|
|
196
199
|
else if (field.kind === 'enum') {
|