@nestledjs/api 1.0.10 → 1.0.12
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestledjs/api",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"generators": "./generators.json",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -25,6 +25,6 @@
|
|
|
25
25
|
"pg": "^8.13.0"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@nestledjs/utils": "0.2.
|
|
28
|
+
"@nestledjs/utils": "0.2.7"
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -230,16 +230,6 @@ function generateModels(models: readonly any[], enums: readonly any[]): string {
|
|
|
230
230
|
const isFieldRequired = isRelation ? false : field.isRequired
|
|
231
231
|
// const isRequired = field.isRequired // Natively supported by DMMF
|
|
232
232
|
|
|
233
|
-
// ALWAYS LOG: Print every field processed for debugging
|
|
234
|
-
console.log('*** FIELD DEBUG ***', {
|
|
235
|
-
model: model.name,
|
|
236
|
-
field: field.name,
|
|
237
|
-
kind: field.kind,
|
|
238
|
-
type: field.type,
|
|
239
|
-
isList: field.isList,
|
|
240
|
-
isRequired: field.isRequired,
|
|
241
|
-
})
|
|
242
|
-
|
|
243
233
|
let tsType = originalType
|
|
244
234
|
|
|
245
235
|
if (field.kind === 'scalar') {
|
|
@@ -322,15 +312,6 @@ function generateModels(models: readonly any[], enums: readonly any[]): string {
|
|
|
322
312
|
if (isRelation) {
|
|
323
313
|
// For relations, always use Partial<Type> (for both single and list)
|
|
324
314
|
finalTsType = `Partial<${tsType}>`
|
|
325
|
-
// DEBUG: Log relation fields
|
|
326
|
-
console.log('DEBUG: Relation field detected:', {
|
|
327
|
-
model: model.name,
|
|
328
|
-
field: field.name,
|
|
329
|
-
kind: field.kind,
|
|
330
|
-
type: field.type,
|
|
331
|
-
isList: field.isList,
|
|
332
|
-
isRequired: field.isRequired,
|
|
333
|
-
})
|
|
334
315
|
}
|
|
335
316
|
|
|
336
317
|
// Add null union type only for non-required fields
|
|
@@ -348,8 +329,7 @@ function generateEnums(enums: readonly any[]): string {
|
|
|
348
329
|
|
|
349
330
|
if (enums.length > 0) {
|
|
350
331
|
const enumNames = enums.map(e => e.name).join(', ')
|
|
351
|
-
output += `
|
|
352
|
-
output += `export { ${enumNames} };\n\n`
|
|
332
|
+
output += `export { ${enumNames} } from '${prismaImportPath}';\n\n`
|
|
353
333
|
|
|
354
334
|
enums.forEach(enumType => {
|
|
355
335
|
output += `registerEnumType(${enumType.name}, { name: '${enumType.name}' });\n\n`
|
package/src/index.js
CHANGED
|
@@ -14,4 +14,5 @@ tslib_1.__exportStar(require("./user/generator"), exports);
|
|
|
14
14
|
tslib_1.__exportStar(require("./workspace-setup/generator"), exports);
|
|
15
15
|
tslib_1.__exportStar(require("./plugin/generator"), exports);
|
|
16
16
|
tslib_1.__exportStar(require("./utils/generator"), exports);
|
|
17
|
+
// Added lint configuration
|
|
17
18
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../generators/api/src/index.ts"],"names":[],"mappings":";;;AAAA,8DAAmC;AACnC,0DAA+B;AAC/B,6DAAkC;AAClC,2DAAgC;AAChC,6DAAkC;AAClC,oEAAyC;AACzC,kEAAuC;AACvC,6DAAkC;AAClC,4DAAiC;AACjC,2DAAgC;AAChC,sEAA2C;AAC3C,6DAAkC;AAClC,4DAAiC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../generators/api/src/index.ts"],"names":[],"mappings":";;;AAAA,8DAAmC;AACnC,0DAA+B;AAC/B,6DAAkC;AAClC,2DAAgC;AAChC,6DAAkC;AAClC,oEAAyC;AACzC,kEAAuC;AACvC,6DAAkC;AAClC,4DAAiC;AACjC,2DAAgC;AAChC,sEAA2C;AAC3C,6DAAkC;AAClC,4DAAiC;AACjC,2BAA2B"}
|