@arcaelas/dynamite 1.0.18 → 1.0.23
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 +11 -42
- package/src/scripts/load_seed.d.ts +5 -0
- package/src/scripts/load_seed.js +54 -0
- package/src/src/@types/index.d.ts +188 -0
- package/src/src/@types/index.js +9 -0
- package/src/{core → src/core}/client.d.ts +4 -16
- package/src/{core → src/core}/client.js +115 -38
- package/src/{core → src/core}/decorator.d.ts +0 -15
- package/src/{core → src/core}/decorator.js +5 -35
- package/src/src/core/table.d.ts +81 -0
- package/src/src/core/table.js +892 -0
- package/src/{decorators → src/decorators}/indexes.d.ts +1 -1
- package/src/{decorators → src/decorators}/indexes.js +12 -20
- package/src/{decorators → src/decorators}/relations.d.ts +20 -1
- package/src/{decorators → src/decorators}/relations.js +32 -2
- package/src/{decorators → src/decorators}/timestamps.d.ts +4 -4
- package/src/{decorators → src/decorators}/timestamps.js +11 -6
- package/src/{decorators → src/decorators}/transforms.d.ts +17 -4
- package/src/{decorators → src/decorators}/transforms.js +40 -28
- package/src/{index.d.ts → src/index.d.ts} +4 -4
- package/src/{index.js → src/index.js} +3 -2
- package/src/src/index.test.d.ts +6 -0
- package/src/src/index.test.js +789 -0
- package/src/{utils → src/utils}/relations.d.ts +5 -3
- package/src/src/utils/relations.js +216 -0
- package/src/@types/index.d.ts +0 -102
- package/src/@types/index.js +0 -9
- package/src/core/method.d.ts +0 -73
- package/src/core/method.js +0 -140
- package/src/core/table.d.ts +0 -56
- package/src/core/table.js +0 -659
- package/src/index.test.d.ts +0 -13
- package/src/index.test.js +0 -1992
- package/src/utils/relations.js +0 -141
|
@@ -35,4 +35,4 @@ export declare const IndexSort: (...params: any[]) => (target: any, propertyKey:
|
|
|
35
35
|
* }
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
38
|
-
export declare
|
|
38
|
+
export declare const PrimaryKey: (...params: any[]) => (target: any, propertyKey: string | symbol) => void;
|
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
* @fecha 2025-01-28
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.IndexSort = exports.Index = void 0;
|
|
10
|
-
exports.PrimaryKey = PrimaryKey;
|
|
9
|
+
exports.PrimaryKey = exports.IndexSort = exports.Index = void 0;
|
|
11
10
|
const decorator_1 = require("../core/decorator");
|
|
12
11
|
/**
|
|
13
12
|
* @description Decorador para marcar propiedad como Partition Key
|
|
@@ -46,22 +45,15 @@ exports.IndexSort = (0, decorator_1.decorator)((_schema, col) => {
|
|
|
46
45
|
* }
|
|
47
46
|
* ```
|
|
48
47
|
*/
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
index: true,
|
|
61
|
-
primaryKey: true,
|
|
62
|
-
nullable: false
|
|
63
|
-
});
|
|
64
|
-
schema.primary_key = column_name;
|
|
65
|
-
};
|
|
66
|
-
}
|
|
48
|
+
exports.PrimaryKey = (0, decorator_1.decorator)((table_class, col) => {
|
|
49
|
+
const schema = table_class[decorator_1.SCHEMA];
|
|
50
|
+
// Configurar como primary key
|
|
51
|
+
Object.assign(col.store, {
|
|
52
|
+
index: true,
|
|
53
|
+
primaryKey: true,
|
|
54
|
+
nullable: false
|
|
55
|
+
});
|
|
56
|
+
// Obtener nombre de columna desde col.name
|
|
57
|
+
schema.primary_key = col.name;
|
|
58
|
+
});
|
|
67
59
|
//# sourceMappingURL=indexes.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file relations.ts
|
|
3
|
-
* @description Decoradores de relaciones: @HasMany, @HasOne, @BelongsTo
|
|
3
|
+
* @description Decoradores de relaciones: @HasMany, @HasOne, @BelongsTo, @ManyToMany
|
|
4
4
|
* @autor Miguel Alejandro
|
|
5
5
|
* @fecha 2025-01-28
|
|
6
6
|
*/
|
|
@@ -53,3 +53,22 @@ export declare const HasOne: (...params: any[]) => (target: any, propertyKey: st
|
|
|
53
53
|
* ```
|
|
54
54
|
*/
|
|
55
55
|
export declare const BelongsTo: (...params: any[]) => (target: any, propertyKey: string | symbol) => void;
|
|
56
|
+
/**
|
|
57
|
+
* @description Decorador para relaciones muchos a muchos (N:M)
|
|
58
|
+
* @param model Función que retorna la clase del modelo relacionado
|
|
59
|
+
* @param pivotTable Nombre de la tabla pivot
|
|
60
|
+
* @param foreignKey Clave foránea en la tabla pivot que apunta al modelo actual
|
|
61
|
+
* @param relatedKey Clave foránea en la tabla pivot que apunta al modelo relacionado
|
|
62
|
+
* @param localKey Clave local (por defecto 'id')
|
|
63
|
+
* @param relatedPK Clave primaria del modelo relacionado (por defecto 'id')
|
|
64
|
+
* @example
|
|
65
|
+
* ```typescript
|
|
66
|
+
* class User extends Table<User> {
|
|
67
|
+
* @PrimaryKey() id: string;
|
|
68
|
+
*
|
|
69
|
+
* @ManyToMany(() => Role, 'users_roles', 'user_id', 'role_id')
|
|
70
|
+
* declare roles: NonAttribute<Role[]>;
|
|
71
|
+
* }
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
export declare const ManyToMany: (...params: any[]) => (target: any, propertyKey: string | symbol) => void;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
3
|
* @file relations.ts
|
|
4
|
-
* @description Decoradores de relaciones: @HasMany, @HasOne, @BelongsTo
|
|
4
|
+
* @description Decoradores de relaciones: @HasMany, @HasOne, @BelongsTo, @ManyToMany
|
|
5
5
|
* @autor Miguel Alejandro
|
|
6
6
|
* @fecha 2025-01-28
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.BelongsTo = exports.HasOne = exports.HasMany = void 0;
|
|
9
|
+
exports.ManyToMany = exports.BelongsTo = exports.HasOne = exports.HasMany = void 0;
|
|
10
10
|
const decorator_1 = require("../core/decorator");
|
|
11
11
|
/**
|
|
12
12
|
* @description Decorador para relaciones uno a muchos (1:N)
|
|
@@ -81,4 +81,34 @@ exports.BelongsTo = (0, decorator_1.decorator)((_schema, col, params) => {
|
|
|
81
81
|
localKey
|
|
82
82
|
};
|
|
83
83
|
});
|
|
84
|
+
/**
|
|
85
|
+
* @description Decorador para relaciones muchos a muchos (N:M)
|
|
86
|
+
* @param model Función que retorna la clase del modelo relacionado
|
|
87
|
+
* @param pivotTable Nombre de la tabla pivot
|
|
88
|
+
* @param foreignKey Clave foránea en la tabla pivot que apunta al modelo actual
|
|
89
|
+
* @param relatedKey Clave foránea en la tabla pivot que apunta al modelo relacionado
|
|
90
|
+
* @param localKey Clave local (por defecto 'id')
|
|
91
|
+
* @param relatedPK Clave primaria del modelo relacionado (por defecto 'id')
|
|
92
|
+
* @example
|
|
93
|
+
* ```typescript
|
|
94
|
+
* class User extends Table<User> {
|
|
95
|
+
* @PrimaryKey() id: string;
|
|
96
|
+
*
|
|
97
|
+
* @ManyToMany(() => Role, 'users_roles', 'user_id', 'role_id')
|
|
98
|
+
* declare roles: NonAttribute<Role[]>;
|
|
99
|
+
* }
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
exports.ManyToMany = (0, decorator_1.decorator)((_schema, col, params) => {
|
|
103
|
+
const [model, pivotTable, foreignKey, relatedKey, localKey = 'id', relatedPK = 'id'] = params;
|
|
104
|
+
col.store.relation = {
|
|
105
|
+
type: 'ManyToMany',
|
|
106
|
+
model,
|
|
107
|
+
foreignKey,
|
|
108
|
+
relatedKey,
|
|
109
|
+
pivotTable,
|
|
110
|
+
localKey,
|
|
111
|
+
relatedPK
|
|
112
|
+
};
|
|
113
|
+
});
|
|
84
114
|
//# sourceMappingURL=relations.js.map
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* @fecha 2025-01-28
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
|
-
* @description Decorador que establece automáticamente la fecha/hora de creación.
|
|
9
|
-
* El valor se genera
|
|
8
|
+
* @description Decorador que establece automáticamente la fecha/hora de creación usando pipelines.
|
|
9
|
+
* El valor se genera en el getter si no existe, y se preserva en el setter.
|
|
10
10
|
* @example
|
|
11
11
|
* ```typescript
|
|
12
12
|
* class User extends Table<User> {
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
*/
|
|
18
18
|
export declare const CreatedAt: (...params: any[]) => (target: any, propertyKey: string | symbol) => void;
|
|
19
19
|
/**
|
|
20
|
-
* @description Decorador que
|
|
21
|
-
*
|
|
20
|
+
* @description Decorador que actualiza automáticamente la fecha/hora en cada asignación usando pipelines.
|
|
21
|
+
* El timestamp se actualiza cada vez que se escribe en la propiedad.
|
|
22
22
|
* @example
|
|
23
23
|
* ```typescript
|
|
24
24
|
* class User extends Table<User> {
|
|
@@ -9,8 +9,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.DeleteAt = exports.UpdatedAt = exports.CreatedAt = void 0;
|
|
10
10
|
const decorator_1 = require("../core/decorator");
|
|
11
11
|
/**
|
|
12
|
-
* @description Decorador que establece automáticamente la fecha/hora de creación.
|
|
13
|
-
* El valor se genera
|
|
12
|
+
* @description Decorador que establece automáticamente la fecha/hora de creación usando pipelines.
|
|
13
|
+
* El valor se genera en el getter si no existe, y se preserva en el setter.
|
|
14
14
|
* @example
|
|
15
15
|
* ```typescript
|
|
16
16
|
* class User extends Table<User> {
|
|
@@ -20,12 +20,14 @@ const decorator_1 = require("../core/decorator");
|
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
22
|
exports.CreatedAt = (0, decorator_1.decorator)((_schema, col) => {
|
|
23
|
-
|
|
23
|
+
// Getter: asignar timestamp si no existe (solo primera vez)
|
|
24
24
|
col.get.push((value) => value ?? new Date().toISOString());
|
|
25
|
+
// Setter: preservar valor si ya existe, ignorar intentos de cambio
|
|
26
|
+
col.set.push((current, next) => current ?? next ?? new Date().toISOString());
|
|
25
27
|
});
|
|
26
28
|
/**
|
|
27
|
-
* @description Decorador que
|
|
28
|
-
*
|
|
29
|
+
* @description Decorador que actualiza automáticamente la fecha/hora en cada asignación usando pipelines.
|
|
30
|
+
* El timestamp se actualiza cada vez que se escribe en la propiedad.
|
|
29
31
|
* @example
|
|
30
32
|
* ```typescript
|
|
31
33
|
* class User extends Table<User> {
|
|
@@ -36,7 +38,10 @@ exports.CreatedAt = (0, decorator_1.decorator)((_schema, col) => {
|
|
|
36
38
|
* ```
|
|
37
39
|
*/
|
|
38
40
|
exports.UpdatedAt = (0, decorator_1.decorator)((_schema, col) => {
|
|
39
|
-
|
|
41
|
+
// Getter: retornar valor actual o timestamp si no existe
|
|
42
|
+
col.get.push((value) => value ?? new Date().toISOString());
|
|
43
|
+
// Setter: siempre actualizar con nuevo timestamp (ignora el valor pasado)
|
|
44
|
+
col.set.push((_current, _next) => new Date().toISOString());
|
|
40
45
|
});
|
|
41
46
|
/**
|
|
42
47
|
* @description Decorador que marca una propiedad como columna de soft delete.
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @fecha 2025-01-28
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
|
-
* @description Decorador para establecer valor por defecto
|
|
8
|
+
* @description Decorador para establecer valor por defecto usando pipeline de getter
|
|
9
9
|
* @param factory Valor por defecto o función que lo genera
|
|
10
10
|
* @example
|
|
11
11
|
* ```typescript
|
|
@@ -32,16 +32,15 @@ export declare const Default: (...params: any[]) => (target: any, propertyKey: s
|
|
|
32
32
|
*/
|
|
33
33
|
export declare const Mutate: (...params: any[]) => (target: any, propertyKey: string | symbol) => void;
|
|
34
34
|
/**
|
|
35
|
-
* @description Decorador para validar valores
|
|
35
|
+
* @description Decorador para validar valores (se ejecuta en el setter)
|
|
36
36
|
* @param validators Función o array de funciones validadoras
|
|
37
|
-
* @param options Opciones de validación (lazy: true para validar en save())
|
|
38
37
|
* @example
|
|
39
38
|
* ```typescript
|
|
40
39
|
* class User extends Table<User> {
|
|
41
40
|
* @Validate((v) => v.length > 0 || 'Email requerido')
|
|
42
41
|
* declare email: string;
|
|
43
42
|
*
|
|
44
|
-
* @Validate([isEmail, isNotEmpty]
|
|
43
|
+
* @Validate([isEmail, isNotEmpty])
|
|
45
44
|
* declare email2: string;
|
|
46
45
|
* }
|
|
47
46
|
* ```
|
|
@@ -84,3 +83,17 @@ export declare const NotNull: (...params: any[]) => (target: any, propertyKey: s
|
|
|
84
83
|
* ```
|
|
85
84
|
*/
|
|
86
85
|
export declare function Name(label: string): ClassDecorator & PropertyDecorator;
|
|
86
|
+
/**
|
|
87
|
+
* @description Decorador para marcar una propiedad como columna sin agregar comportamiento especial
|
|
88
|
+
* @example
|
|
89
|
+
* ```typescript
|
|
90
|
+
* class Product extends Table<Product> {
|
|
91
|
+
* @Column()
|
|
92
|
+
* price!: number;
|
|
93
|
+
*
|
|
94
|
+
* @Column()
|
|
95
|
+
* category_id!: string;
|
|
96
|
+
* }
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
export declare const Column: (...params: any[]) => (target: any, propertyKey: string | symbol) => void;
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
* @fecha 2025-01-28
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.NotNull = exports.Serialize = exports.Validate = exports.Mutate = exports.Default = void 0;
|
|
9
|
+
exports.Column = exports.NotNull = exports.Serialize = exports.Validate = exports.Mutate = exports.Default = void 0;
|
|
10
10
|
exports.Name = Name;
|
|
11
11
|
const decorator_1 = require("../core/decorator");
|
|
12
12
|
/**
|
|
13
|
-
* @description Decorador para establecer valor por defecto
|
|
13
|
+
* @description Decorador para establecer valor por defecto usando pipeline de getter
|
|
14
14
|
* @param factory Valor por defecto o función que lo genera
|
|
15
15
|
* @example
|
|
16
16
|
* ```typescript
|
|
@@ -25,6 +25,7 @@ const decorator_1 = require("../core/decorator");
|
|
|
25
25
|
*/
|
|
26
26
|
exports.Default = (0, decorator_1.decorator)((_schema, col, params) => {
|
|
27
27
|
const fallback = params[0];
|
|
28
|
+
// Usar pipeline de getter con ?? para valores nullish
|
|
28
29
|
col.get.push((value) => value ?? (typeof fallback === 'function' ? fallback() : fallback));
|
|
29
30
|
});
|
|
30
31
|
/**
|
|
@@ -40,44 +41,37 @@ exports.Default = (0, decorator_1.decorator)((_schema, col, params) => {
|
|
|
40
41
|
*/
|
|
41
42
|
exports.Mutate = (0, decorator_1.decorator)((_schema, col, params) => {
|
|
42
43
|
const fn = params[0];
|
|
43
|
-
col.set.push((
|
|
44
|
+
col.set.push((current, next) => fn(next));
|
|
44
45
|
});
|
|
45
46
|
/**
|
|
46
|
-
* @description Decorador para validar valores
|
|
47
|
+
* @description Decorador para validar valores (se ejecuta en el setter)
|
|
47
48
|
* @param validators Función o array de funciones validadoras
|
|
48
|
-
* @param options Opciones de validación (lazy: true para validar en save())
|
|
49
49
|
* @example
|
|
50
50
|
* ```typescript
|
|
51
51
|
* class User extends Table<User> {
|
|
52
52
|
* @Validate((v) => v.length > 0 || 'Email requerido')
|
|
53
53
|
* declare email: string;
|
|
54
54
|
*
|
|
55
|
-
* @Validate([isEmail, isNotEmpty]
|
|
55
|
+
* @Validate([isEmail, isNotEmpty])
|
|
56
56
|
* declare email2: string;
|
|
57
57
|
* }
|
|
58
58
|
* ```
|
|
59
59
|
*/
|
|
60
60
|
exports.Validate = (0, decorator_1.decorator)((_schema, col, params) => {
|
|
61
|
-
const
|
|
61
|
+
const validators = params[0];
|
|
62
62
|
const list = Array.isArray(validators) ? validators : [validators];
|
|
63
|
-
const is_lazy = options?.lazy ?? false;
|
|
64
63
|
if (!list.length || list.some((v) => typeof v !== 'function')) {
|
|
65
64
|
throw new TypeError('@Validate requiere funciones');
|
|
66
65
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
for (const fn of list) {
|
|
73
|
-
const result = fn(value);
|
|
74
|
-
if (result !== true) {
|
|
75
|
-
throw new Error(typeof result === 'string' ? result : 'Validación fallida');
|
|
76
|
-
}
|
|
66
|
+
col.set.push((current, next) => {
|
|
67
|
+
for (const fn of list) {
|
|
68
|
+
const result = fn(next);
|
|
69
|
+
if (result !== true) {
|
|
70
|
+
throw new Error(typeof result === 'string' ? result : 'Validación fallida');
|
|
77
71
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
72
|
+
}
|
|
73
|
+
return next;
|
|
74
|
+
});
|
|
81
75
|
});
|
|
82
76
|
/**
|
|
83
77
|
* @description Decorador para transformar valores entre DB y aplicación
|
|
@@ -96,7 +90,7 @@ exports.Serialize = (0, decorator_1.decorator)((_schema, col, params) => {
|
|
|
96
90
|
if (fromDB)
|
|
97
91
|
col.get.push((v) => v !== null && v !== undefined ? fromDB(v) : v);
|
|
98
92
|
if (toDB)
|
|
99
|
-
col.set.push((
|
|
93
|
+
col.set.push((current, next) => next !== null && next !== undefined ? toDB(next) : next);
|
|
100
94
|
});
|
|
101
95
|
/**
|
|
102
96
|
* @description Decorador que valida que el valor no sea null, undefined o string vacío
|
|
@@ -108,14 +102,16 @@ exports.Serialize = (0, decorator_1.decorator)((_schema, col, params) => {
|
|
|
108
102
|
* }
|
|
109
103
|
* ```
|
|
110
104
|
*/
|
|
111
|
-
exports.NotNull = (0, decorator_1.decorator)((_schema, col) => {
|
|
105
|
+
exports.NotNull = (0, decorator_1.decorator)((_schema, col, params) => {
|
|
106
|
+
const custom_message = params[0];
|
|
112
107
|
col.store.nullable = false;
|
|
113
|
-
col.
|
|
114
|
-
|
|
108
|
+
col.store.notNullMessage = custom_message;
|
|
109
|
+
col.set.push((current, next) => {
|
|
110
|
+
const is_empty = next === null || next === undefined || (typeof next === 'string' && next.trim() === '');
|
|
115
111
|
if (is_empty) {
|
|
116
|
-
throw new Error(`El campo ${col.name} no puede estar vacío`);
|
|
112
|
+
throw new Error(custom_message || `El campo ${col.name} no puede estar vacío`);
|
|
117
113
|
}
|
|
118
|
-
return
|
|
114
|
+
return next;
|
|
119
115
|
});
|
|
120
116
|
});
|
|
121
117
|
/**
|
|
@@ -136,7 +132,7 @@ function Name(label) {
|
|
|
136
132
|
}
|
|
137
133
|
return (target, prop) => {
|
|
138
134
|
const ctor = prop === undefined ? target : target.constructor;
|
|
139
|
-
const schema =
|
|
135
|
+
const schema = ctor[decorator_1.SCHEMA];
|
|
140
136
|
if (prop === undefined) {
|
|
141
137
|
// @Name en clase - renombrar tabla
|
|
142
138
|
schema.name = label;
|
|
@@ -151,4 +147,20 @@ function Name(label) {
|
|
|
151
147
|
}
|
|
152
148
|
};
|
|
153
149
|
}
|
|
150
|
+
/**
|
|
151
|
+
* @description Decorador para marcar una propiedad como columna sin agregar comportamiento especial
|
|
152
|
+
* @example
|
|
153
|
+
* ```typescript
|
|
154
|
+
* class Product extends Table<Product> {
|
|
155
|
+
* @Column()
|
|
156
|
+
* price!: number;
|
|
157
|
+
*
|
|
158
|
+
* @Column()
|
|
159
|
+
* category_id!: string;
|
|
160
|
+
* }
|
|
161
|
+
* ```
|
|
162
|
+
*/
|
|
163
|
+
exports.Column = (0, decorator_1.decorator)((_schema, _col) => {
|
|
164
|
+
// No hace nada, solo marca la propiedad como columna en schema.columns
|
|
165
|
+
});
|
|
154
166
|
//# sourceMappingURL=transforms.js.map
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export { Dynamite } from "./core/client";
|
|
8
8
|
export { default as Table } from "./core/table";
|
|
9
|
-
export { decorator, relationDecorator, SCHEMA
|
|
9
|
+
export { decorator, relationDecorator, SCHEMA } from "./core/decorator";
|
|
10
10
|
export { Index, IndexSort, PrimaryKey } from "./decorators/indexes";
|
|
11
11
|
export { CreatedAt, UpdatedAt, DeleteAt } from "./decorators/timestamps";
|
|
12
|
-
export { Default, Mutate, Validate, Serialize, NotNull, Name } from "./decorators/transforms";
|
|
13
|
-
export { HasMany, BelongsTo, HasOne } from "./decorators/relations";
|
|
14
|
-
export type {
|
|
12
|
+
export { Default, Mutate, Validate, Serialize, NotNull, Name, Column } from "./decorators/transforms";
|
|
13
|
+
export { HasMany, BelongsTo, HasOne, ManyToMany } from "./decorators/relations";
|
|
14
|
+
export type { NonAttribute, CreationOptional, InferAttributes, InferRelations, WhereOptions, QueryOperator, CreateInput, UpdateInput, PickRelations, } from "./@types/index";
|
|
15
15
|
export { TransactionContext } from "./core/client";
|
|
@@ -9,7 +9,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
9
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.TransactionContext = exports.HasOne = exports.BelongsTo = exports.HasMany = exports.Name = exports.NotNull = exports.Serialize = exports.Validate = exports.Mutate = exports.Default = exports.DeleteAt = exports.UpdatedAt = exports.CreatedAt = exports.PrimaryKey = exports.IndexSort = exports.Index = exports.
|
|
12
|
+
exports.TransactionContext = exports.ManyToMany = exports.HasOne = exports.BelongsTo = exports.HasMany = exports.Column = exports.Name = exports.NotNull = exports.Serialize = exports.Validate = exports.Mutate = exports.Default = exports.DeleteAt = exports.UpdatedAt = exports.CreatedAt = exports.PrimaryKey = exports.IndexSort = exports.Index = exports.SCHEMA = exports.relationDecorator = exports.decorator = exports.Table = exports.Dynamite = void 0;
|
|
13
13
|
// Clases núcleo
|
|
14
14
|
var client_1 = require("./core/client");
|
|
15
15
|
Object.defineProperty(exports, "Dynamite", { enumerable: true, get: function () { return client_1.Dynamite; } });
|
|
@@ -20,7 +20,6 @@ var decorator_1 = require("./core/decorator");
|
|
|
20
20
|
Object.defineProperty(exports, "decorator", { enumerable: true, get: function () { return decorator_1.decorator; } });
|
|
21
21
|
Object.defineProperty(exports, "relationDecorator", { enumerable: true, get: function () { return decorator_1.relationDecorator; } });
|
|
22
22
|
Object.defineProperty(exports, "SCHEMA", { enumerable: true, get: function () { return decorator_1.SCHEMA; } });
|
|
23
|
-
Object.defineProperty(exports, "VALUES", { enumerable: true, get: function () { return decorator_1.VALUES; } });
|
|
24
23
|
// Decoradores - Índices
|
|
25
24
|
var indexes_1 = require("./decorators/indexes");
|
|
26
25
|
Object.defineProperty(exports, "Index", { enumerable: true, get: function () { return indexes_1.Index; } });
|
|
@@ -39,11 +38,13 @@ Object.defineProperty(exports, "Validate", { enumerable: true, get: function ()
|
|
|
39
38
|
Object.defineProperty(exports, "Serialize", { enumerable: true, get: function () { return transforms_1.Serialize; } });
|
|
40
39
|
Object.defineProperty(exports, "NotNull", { enumerable: true, get: function () { return transforms_1.NotNull; } });
|
|
41
40
|
Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return transforms_1.Name; } });
|
|
41
|
+
Object.defineProperty(exports, "Column", { enumerable: true, get: function () { return transforms_1.Column; } });
|
|
42
42
|
// Decoradores - Relaciones
|
|
43
43
|
var relations_1 = require("./decorators/relations");
|
|
44
44
|
Object.defineProperty(exports, "HasMany", { enumerable: true, get: function () { return relations_1.HasMany; } });
|
|
45
45
|
Object.defineProperty(exports, "BelongsTo", { enumerable: true, get: function () { return relations_1.BelongsTo; } });
|
|
46
46
|
Object.defineProperty(exports, "HasOne", { enumerable: true, get: function () { return relations_1.HasOne; } });
|
|
47
|
+
Object.defineProperty(exports, "ManyToMany", { enumerable: true, get: function () { return relations_1.ManyToMany; } });
|
|
47
48
|
// Re-exportar TransactionContext para compatibilidad
|
|
48
49
|
var client_2 = require("./core/client");
|
|
49
50
|
Object.defineProperty(exports, "TransactionContext", { enumerable: true, get: function () { return client_2.TransactionContext; } });
|