@drax/crud-back 1.4.1 → 2.0.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.
@@ -4,14 +4,13 @@ export class CrudSchemaBuilder {
4
4
  constructor(entitySchema, entityCreateSchema, entityUpdateSchema, entityName, target = 'openapi-3.0', tags = []) {
5
5
  this.target = 'openapi-3.0'; //"jsonSchema7" | "jsonSchema2019-09" | "openapi-3.0" | "openAi"
6
6
  this.entitySchema = this.schemaAdapter(entitySchema);
7
- this.entityCreateSchema = entityCreateSchema;
8
- this.entityUpdateSchema = entityUpdateSchema;
7
+ this.entityCreateSchema = this.schemaAdapter(entityCreateSchema);
8
+ this.entityUpdateSchema = this.schemaAdapter(entityUpdateSchema);
9
9
  this.entityName = entityName;
10
10
  this.tags = tags;
11
11
  this.target = target;
12
12
  }
13
13
  getTypeName(field) {
14
- // Zod v4 suele tener constructor.name útil en runtime
15
14
  return field?.constructor?.name;
16
15
  }
17
16
  fieldAdapter(field) {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.4.1",
6
+ "version": "2.0.1",
7
7
  "description": "Crud utils across modules",
8
8
  "main": "dist/index.js",
9
9
  "types": "types/index.d.ts",
@@ -22,13 +22,13 @@
22
22
  "author": "Cristian Incarnato & Drax Team",
23
23
  "license": "ISC",
24
24
  "dependencies": {
25
- "@drax/common-back": "^1.1.1",
26
- "@drax/common-share": "^1.0.0",
27
- "@drax/identity-share": "^1.0.0",
28
- "@drax/media-back": "^1.4.1",
25
+ "@drax/common-back": "^2.0.0",
26
+ "@drax/common-share": "^2.0.0",
27
+ "@drax/identity-share": "^2.0.0",
28
+ "@drax/media-back": "^2.0.1",
29
29
  "@graphql-tools/load-files": "^7.0.0",
30
30
  "@graphql-tools/merge": "^9.0.4",
31
- "mongoose": "^8.21.0",
31
+ "mongoose": "^8.23.0",
32
32
  "mongoose-lean-virtuals": "^1.1.0",
33
33
  "mongoose-paginate-v2": "^1.8.3"
34
34
  },
@@ -38,13 +38,13 @@
38
38
  "zod": "^4.3.6"
39
39
  },
40
40
  "devDependencies": {
41
- "@types/node": "^20.12.10",
41
+ "@types/node": "^25.2.3",
42
42
  "copyfiles": "^2.4.1",
43
43
  "mongoose-paginate-v2": "^1.8.3",
44
44
  "nodemon": "^3.1.0",
45
45
  "ts-node": "^10.9.2",
46
46
  "tsc-alias": "^1.8.10",
47
- "typescript": "^5.6.2"
47
+ "typescript": "^5.9.3"
48
48
  },
49
- "gitHead": "4e9bd229508c1f9758cf9ebf009255674fc4eae7"
49
+ "gitHead": "4e6370b8c79b34e92d14e506e6daf8f89f1c015b"
50
50
  }
@@ -27,16 +27,15 @@ export class CrudSchemaBuilder<
27
27
  private target: string = 'openapi-3.0'; //"jsonSchema7" | "jsonSchema2019-09" | "openapi-3.0" | "openAi"
28
28
 
29
29
  constructor(entitySchema: T, entityCreateSchema: TCreate, entityUpdateSchema: TUpdate, entityName: string, target:string = 'openapi-3.0', tags: string[] = []) {
30
- this.entitySchema = this.schemaAdapter(entitySchema);
31
- this.entityCreateSchema = entityCreateSchema;
32
- this.entityUpdateSchema = entityUpdateSchema;
33
- this.entityName = entityName;
30
+ this.entitySchema = this.schemaAdapter(entitySchema)
31
+ this.entityCreateSchema = this.schemaAdapter(entityCreateSchema)
32
+ this.entityUpdateSchema = this.schemaAdapter(entityUpdateSchema)
33
+ this.entityName = entityName
34
34
  this.tags = tags
35
- this.target = target;
35
+ this.target = target
36
36
  }
37
37
 
38
38
  private getTypeName(field: any): string | undefined {
39
- // Zod v4 suele tener constructor.name útil en runtime
40
39
  return field?.constructor?.name;
41
40
  }
42
41