@tachybase/database 0.23.8
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/.turbo/turbo-build.log +10 -0
- package/LICENSE +201 -0
- package/lib/collection-factory.d.ts +17 -0
- package/lib/collection-factory.js +52 -0
- package/lib/collection-group-manager.d.ts +26 -0
- package/lib/collection-group-manager.js +57 -0
- package/lib/collection-importer.d.ts +7 -0
- package/lib/collection-importer.js +74 -0
- package/lib/collection.d.ts +138 -0
- package/lib/collection.js +686 -0
- package/lib/database-utils/index.d.ts +9 -0
- package/lib/database-utils/index.js +71 -0
- package/lib/database-utils/traverseJSON.d.ts +10 -0
- package/lib/database-utils/traverseJSON.js +126 -0
- package/lib/database.d.ts +201 -0
- package/lib/database.js +765 -0
- package/lib/decorators/must-have-filter-decorator.d.ts +2 -0
- package/lib/decorators/must-have-filter-decorator.js +38 -0
- package/lib/decorators/target-collection-decorator.d.ts +2 -0
- package/lib/decorators/target-collection-decorator.js +47 -0
- package/lib/decorators/transaction-decorator.d.ts +1 -0
- package/lib/decorators/transaction-decorator.js +88 -0
- package/lib/eager-loading/eager-loading-tree.d.ts +31 -0
- package/lib/eager-loading/eager-loading-tree.js +439 -0
- package/lib/errors/identifier-error.d.ts +3 -0
- package/lib/errors/identifier-error.js +35 -0
- package/lib/errors/zero-column-table-error.d.ts +2 -0
- package/lib/errors/zero-column-table-error.js +31 -0
- package/lib/features/references-map.d.ts +18 -0
- package/lib/features/references-map.js +109 -0
- package/lib/features/referential-integrity-check.d.ts +8 -0
- package/lib/features/referential-integrity-check.js +83 -0
- package/lib/field-repository/array-field-repository.d.ts +28 -0
- package/lib/field-repository/array-field-repository.js +197 -0
- package/lib/fields/array-field.d.ts +11 -0
- package/lib/fields/array-field.js +57 -0
- package/lib/fields/belongs-to-field.d.ts +17 -0
- package/lib/fields/belongs-to-field.js +154 -0
- package/lib/fields/belongs-to-many-field.d.ts +20 -0
- package/lib/fields/belongs-to-many-field.js +187 -0
- package/lib/fields/boolean-field.d.ts +8 -0
- package/lib/fields/boolean-field.js +36 -0
- package/lib/fields/context-field.d.ts +14 -0
- package/lib/fields/context-field.js +70 -0
- package/lib/fields/date-field.d.ts +13 -0
- package/lib/fields/date-field.js +64 -0
- package/lib/fields/field.d.ts +43 -0
- package/lib/fields/field.js +156 -0
- package/lib/fields/has-inverse-field.d.ts +4 -0
- package/lib/fields/has-inverse-field.js +15 -0
- package/lib/fields/has-many-field.d.ts +68 -0
- package/lib/fields/has-many-field.js +156 -0
- package/lib/fields/has-one-field.d.ts +68 -0
- package/lib/fields/has-one-field.js +150 -0
- package/lib/fields/index.d.ts +46 -0
- package/lib/fields/index.js +65 -0
- package/lib/fields/json-field.d.ts +14 -0
- package/lib/fields/json-field.js +54 -0
- package/lib/fields/nanoid-field.d.ts +13 -0
- package/lib/fields/nanoid-field.js +58 -0
- package/lib/fields/number-field.d.ts +41 -0
- package/lib/fields/number-field.js +85 -0
- package/lib/fields/password-field.d.ts +21 -0
- package/lib/fields/password-field.js +95 -0
- package/lib/fields/radio-field.d.ts +16 -0
- package/lib/fields/radio-field.js +66 -0
- package/lib/fields/relation-field.d.ts +21 -0
- package/lib/fields/relation-field.js +79 -0
- package/lib/fields/set-field.d.ts +10 -0
- package/lib/fields/set-field.js +46 -0
- package/lib/fields/sort-field.d.ts +16 -0
- package/lib/fields/sort-field.js +187 -0
- package/lib/fields/string-field.d.ts +8 -0
- package/lib/fields/string-field.js +36 -0
- package/lib/fields/text-field.d.ts +8 -0
- package/lib/fields/text-field.js +36 -0
- package/lib/fields/time-field.d.ts +8 -0
- package/lib/fields/time-field.js +36 -0
- package/lib/fields/uid-field.d.ts +13 -0
- package/lib/fields/uid-field.js +63 -0
- package/lib/fields/uuid-field.d.ts +9 -0
- package/lib/fields/uuid-field.js +45 -0
- package/lib/fields/virtual-field.d.ts +8 -0
- package/lib/fields/virtual-field.js +36 -0
- package/lib/filter-match.d.ts +1 -0
- package/lib/filter-match.js +66 -0
- package/lib/filter-parser.d.ts +21 -0
- package/lib/filter-parser.js +230 -0
- package/lib/helpers.d.ts +3 -0
- package/lib/helpers.js +167 -0
- package/lib/index.d.ts +30 -0
- package/lib/index.js +114 -0
- package/lib/inherited-collection.d.ts +14 -0
- package/lib/inherited-collection.js +138 -0
- package/lib/inherited-map.d.ts +21 -0
- package/lib/inherited-map.js +113 -0
- package/lib/inherited-sync-runner.d.ts +4 -0
- package/lib/inherited-sync-runner.js +175 -0
- package/lib/listeners/adjacency-list.d.ts +2 -0
- package/lib/listeners/adjacency-list.js +42 -0
- package/lib/listeners/append-child-collection-name-after-repository-find.d.ts +6 -0
- package/lib/listeners/append-child-collection-name-after-repository-find.js +66 -0
- package/lib/listeners/index.d.ts +2 -0
- package/lib/listeners/index.js +33 -0
- package/lib/magic-attribute-model.d.ts +8 -0
- package/lib/magic-attribute-model.js +203 -0
- package/lib/migration.d.ts +35 -0
- package/lib/migration.js +103 -0
- package/lib/mock-database.d.ts +25 -0
- package/lib/mock-database.js +126 -0
- package/lib/model-hook.d.ts +12 -0
- package/lib/model-hook.js +92 -0
- package/lib/model.d.ts +23 -0
- package/lib/model.js +152 -0
- package/lib/operators/array.d.ts +2 -0
- package/lib/operators/array.js +158 -0
- package/lib/operators/association.d.ts +2 -0
- package/lib/operators/association.js +35 -0
- package/lib/operators/boolean.d.ts +2 -0
- package/lib/operators/boolean.js +38 -0
- package/lib/operators/child-collection.d.ts +2 -0
- package/lib/operators/child-collection.js +67 -0
- package/lib/operators/date.d.ts +2 -0
- package/lib/operators/date.js +140 -0
- package/lib/operators/empty.d.ts +5 -0
- package/lib/operators/empty.js +89 -0
- package/lib/operators/eq.d.ts +2 -0
- package/lib/operators/eq.js +35 -0
- package/lib/operators/index.d.ts +5 -0
- package/lib/operators/index.js +56 -0
- package/lib/operators/jsonb.d.ts +2 -0
- package/lib/operators/jsonb.js +50 -0
- package/lib/operators/ne.d.ts +2 -0
- package/lib/operators/ne.js +40 -0
- package/lib/operators/notIn.d.ts +2 -0
- package/lib/operators/notIn.js +33 -0
- package/lib/operators/string.d.ts +2 -0
- package/lib/operators/string.js +109 -0
- package/lib/operators/utils.d.ts +4 -0
- package/lib/operators/utils.js +40 -0
- package/lib/options-parser.d.ts +37 -0
- package/lib/options-parser.js +332 -0
- package/lib/playground.d.ts +1 -0
- package/lib/playground.js +43 -0
- package/lib/query-interface/mysql-query-interface.d.ts +35 -0
- package/lib/query-interface/mysql-query-interface.js +122 -0
- package/lib/query-interface/postgres-query-interface.d.ts +32 -0
- package/lib/query-interface/postgres-query-interface.js +189 -0
- package/lib/query-interface/query-interface-builder.d.ts +2 -0
- package/lib/query-interface/query-interface-builder.js +46 -0
- package/lib/query-interface/query-interface.d.ts +42 -0
- package/lib/query-interface/query-interface.js +46 -0
- package/lib/query-interface/sqlite-query-interface.d.ts +35 -0
- package/lib/query-interface/sqlite-query-interface.js +131 -0
- package/lib/relation-repository/belongs-to-many-repository.d.ts +21 -0
- package/lib/relation-repository/belongs-to-many-repository.js +280 -0
- package/lib/relation-repository/belongs-to-repository.d.ts +6 -0
- package/lib/relation-repository/belongs-to-repository.js +39 -0
- package/lib/relation-repository/hasmany-repository.d.ts +10 -0
- package/lib/relation-repository/hasmany-repository.js +182 -0
- package/lib/relation-repository/hasone-repository.d.ts +6 -0
- package/lib/relation-repository/hasone-repository.js +39 -0
- package/lib/relation-repository/multiple-relation-repository.d.ts +20 -0
- package/lib/relation-repository/multiple-relation-repository.js +229 -0
- package/lib/relation-repository/relation-repository.d.ts +29 -0
- package/lib/relation-repository/relation-repository.js +202 -0
- package/lib/relation-repository/single-relation-repository.d.ts +25 -0
- package/lib/relation-repository/single-relation-repository.js +162 -0
- package/lib/relation-repository/types.d.ts +7 -0
- package/lib/relation-repository/types.js +15 -0
- package/lib/repositories/tree-repository/adjacency-list-repository.d.ts +18 -0
- package/lib/repositories/tree-repository/adjacency-list-repository.js +183 -0
- package/lib/repositories/view-repository.d.ts +3 -0
- package/lib/repositories/view-repository.js +32 -0
- package/lib/repository.d.ts +206 -0
- package/lib/repository.js +597 -0
- package/lib/sql-collection/index.d.ts +2 -0
- package/lib/sql-collection/index.js +23 -0
- package/lib/sql-collection/query-generator.d.ts +10 -0
- package/lib/sql-collection/query-generator.js +70 -0
- package/lib/sql-collection/sql-collection.d.ts +7 -0
- package/lib/sql-collection/sql-collection.js +69 -0
- package/lib/sql-collection/sql-model.d.ts +16 -0
- package/lib/sql-collection/sql-model.js +168 -0
- package/lib/sql-parser/index.d.ts +10 -0
- package/lib/sql-parser/index.js +10699 -0
- package/lib/sql-parser/postgres.d.ts +10 -0
- package/lib/sql-parser/postgres.js +31506 -0
- package/lib/sql-parser/sql.pegjs +1297 -0
- package/lib/sync-runner.d.ts +30 -0
- package/lib/sync-runner.js +277 -0
- package/lib/types.d.ts +49 -0
- package/lib/types.js +15 -0
- package/lib/update-associations.d.ts +60 -0
- package/lib/update-associations.js +405 -0
- package/lib/update-guard.d.ts +28 -0
- package/lib/update-guard.js +202 -0
- package/lib/utils.d.ts +7 -0
- package/lib/utils.js +127 -0
- package/lib/value-parsers/array-value-parser.d.ts +8 -0
- package/lib/value-parsers/array-value-parser.js +58 -0
- package/lib/value-parsers/base-value-parser.d.ts +12 -0
- package/lib/value-parsers/base-value-parser.js +63 -0
- package/lib/value-parsers/boolean-value-parser.d.ts +4 -0
- package/lib/value-parsers/boolean-value-parser.js +52 -0
- package/lib/value-parsers/date-value-parser.d.ts +5 -0
- package/lib/value-parsers/date-value-parser.js +88 -0
- package/lib/value-parsers/index.d.ts +12 -0
- package/lib/value-parsers/index.js +78 -0
- package/lib/value-parsers/json-value-parser.d.ts +4 -0
- package/lib/value-parsers/json-value-parser.js +47 -0
- package/lib/value-parsers/number-value-parser.d.ts +4 -0
- package/lib/value-parsers/number-value-parser.js +58 -0
- package/lib/value-parsers/string-value-parser.d.ts +8 -0
- package/lib/value-parsers/string-value-parser.js +64 -0
- package/lib/value-parsers/to-many-value-parser.d.ts +13 -0
- package/lib/value-parsers/to-many-value-parser.js +108 -0
- package/lib/value-parsers/to-one-value-parser.d.ts +4 -0
- package/lib/value-parsers/to-one-value-parser.js +48 -0
- package/lib/view/field-type-map.d.ts +97 -0
- package/lib/view/field-type-map.js +90 -0
- package/lib/view/view-inference.d.ts +32 -0
- package/lib/view/view-inference.js +146 -0
- package/lib/view-collection.d.ts +6 -0
- package/lib/view-collection.js +45 -0
- package/package.json +38 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
31
|
+
var belongs_to_field_exports = {};
|
|
32
|
+
__export(belongs_to_field_exports, {
|
|
33
|
+
BelongsToField: () => BelongsToField
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(belongs_to_field_exports);
|
|
36
|
+
var import_lodash = __toESM(require("lodash"));
|
|
37
|
+
var import_sequelize = require("sequelize");
|
|
38
|
+
var import_references_map = require("../features/references-map");
|
|
39
|
+
var import_utils = require("../utils");
|
|
40
|
+
var import_relation_field = require("./relation-field");
|
|
41
|
+
const _BelongsToField = class _BelongsToField extends import_relation_field.RelationField {
|
|
42
|
+
get dataType() {
|
|
43
|
+
return "BelongsTo";
|
|
44
|
+
}
|
|
45
|
+
get target() {
|
|
46
|
+
const { target, name } = this.options;
|
|
47
|
+
return target || import_sequelize.Utils.pluralize(name);
|
|
48
|
+
}
|
|
49
|
+
static toReference(db, association, onDelete, priority = "default") {
|
|
50
|
+
const targetKey = association.targetKey;
|
|
51
|
+
return (0, import_references_map.buildReference)({
|
|
52
|
+
sourceCollectionName: db.modelCollection.get(association.source).name,
|
|
53
|
+
sourceField: association.foreignKey,
|
|
54
|
+
targetField: targetKey,
|
|
55
|
+
targetCollectionName: db.modelCollection.get(association.target).name,
|
|
56
|
+
onDelete,
|
|
57
|
+
priority
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
reference(association) {
|
|
61
|
+
return _BelongsToField.toReference(
|
|
62
|
+
this.database,
|
|
63
|
+
association,
|
|
64
|
+
this.options.onDelete,
|
|
65
|
+
this.options.onDelete ? "user" : "default"
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
checkAssociationKeys() {
|
|
69
|
+
let { foreignKey, targetKey } = this.options;
|
|
70
|
+
if (!targetKey) {
|
|
71
|
+
targetKey = this.TargetModel.primaryKeyAttribute;
|
|
72
|
+
}
|
|
73
|
+
if (!foreignKey) {
|
|
74
|
+
foreignKey = import_lodash.default.camelCase(`${this.name}_${targetKey}`);
|
|
75
|
+
}
|
|
76
|
+
const targetKeyAttribute = this.TargetModel.rawAttributes[targetKey];
|
|
77
|
+
const foreignKeyAttribute = this.collection.model.rawAttributes[foreignKey];
|
|
78
|
+
if (!foreignKeyAttribute || !targetKeyAttribute) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const foreignKeyType = foreignKeyAttribute.type.constructor.toString();
|
|
82
|
+
const targetKeyType = targetKeyAttribute.type.constructor.toString();
|
|
83
|
+
if (!this.keyPairsTypeMatched(foreignKeyType, targetKeyType)) {
|
|
84
|
+
throw new Error(
|
|
85
|
+
`Foreign key "${foreignKey}" type "${foreignKeyType}" does not match target key "${targetKey}" type "${targetKeyType}" in belongs to relation "${this.name}" of collection "${this.collection.name}"`
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
bind() {
|
|
90
|
+
const { database, collection } = this.context;
|
|
91
|
+
const Target = this.TargetModel;
|
|
92
|
+
if (!Target) {
|
|
93
|
+
database.addPendingField(this);
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
this.checkAssociationKeys();
|
|
97
|
+
if (collection.model.associations[this.name]) {
|
|
98
|
+
delete collection.model.associations[this.name];
|
|
99
|
+
}
|
|
100
|
+
const association = collection.model.belongsTo(Target, {
|
|
101
|
+
as: this.name,
|
|
102
|
+
constraints: false,
|
|
103
|
+
...(0, import_lodash.omit)(this.options, ["name", "type", "target", "onDelete"])
|
|
104
|
+
});
|
|
105
|
+
database.removePendingField(this);
|
|
106
|
+
if (!this.options.foreignKey) {
|
|
107
|
+
this.options.foreignKey = association.foreignKey;
|
|
108
|
+
}
|
|
109
|
+
if (!this.options.targetKey) {
|
|
110
|
+
this.options.targetKey = association.targetKey;
|
|
111
|
+
}
|
|
112
|
+
try {
|
|
113
|
+
(0, import_utils.checkIdentifier)(this.options.foreignKey);
|
|
114
|
+
} catch (error) {
|
|
115
|
+
this.unbind();
|
|
116
|
+
throw error;
|
|
117
|
+
}
|
|
118
|
+
if (!this.options.sourceKey) {
|
|
119
|
+
this.options.sourceKey = association.sourceKey;
|
|
120
|
+
}
|
|
121
|
+
this.collection.addIndex([this.options.foreignKey]);
|
|
122
|
+
const reference = this.reference(association);
|
|
123
|
+
this.database.referenceMap.addReference(reference);
|
|
124
|
+
return true;
|
|
125
|
+
}
|
|
126
|
+
unbind() {
|
|
127
|
+
const { database, collection } = this.context;
|
|
128
|
+
database.removePendingField(this);
|
|
129
|
+
const tcoll = database.collections.get(this.target);
|
|
130
|
+
const foreignKey = this.options.foreignKey;
|
|
131
|
+
const field1 = collection.getField(foreignKey);
|
|
132
|
+
const field2 = tcoll ? tcoll.findField((field) => {
|
|
133
|
+
return field.type === "hasMany" && field.foreignKey === foreignKey;
|
|
134
|
+
}) : null;
|
|
135
|
+
if (!field1 && !field2) {
|
|
136
|
+
collection.model.removeAttribute(foreignKey);
|
|
137
|
+
}
|
|
138
|
+
const association = collection.model.associations[this.name];
|
|
139
|
+
if (association && !this.options.inherit) {
|
|
140
|
+
const reference = this.reference(association);
|
|
141
|
+
this.database.referenceMap.removeReference(reference);
|
|
142
|
+
}
|
|
143
|
+
this.clearAccessors();
|
|
144
|
+
delete collection.model.associations[this.name];
|
|
145
|
+
collection.model.refreshAttributes();
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
__name(_BelongsToField, "BelongsToField");
|
|
149
|
+
__publicField(_BelongsToField, "type", "belongsTo");
|
|
150
|
+
let BelongsToField = _BelongsToField;
|
|
151
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
152
|
+
0 && (module.exports = {
|
|
153
|
+
BelongsToField
|
|
154
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AssociationScope, BelongsToManyOptions as SequelizeBelongsToManyOptions } from 'sequelize';
|
|
2
|
+
import { Reference } from '../features/references-map';
|
|
3
|
+
import { MultipleRelationFieldOptions, RelationField } from './relation-field';
|
|
4
|
+
export declare class BelongsToManyField extends RelationField {
|
|
5
|
+
get dataType(): string;
|
|
6
|
+
get through(): any;
|
|
7
|
+
get otherKey(): any;
|
|
8
|
+
references(association: any): Reference[];
|
|
9
|
+
checkAssociationKeys(database: any): void;
|
|
10
|
+
bind(): boolean;
|
|
11
|
+
unbind(): void;
|
|
12
|
+
}
|
|
13
|
+
export interface BelongsToManyFieldOptions extends MultipleRelationFieldOptions, Omit<SequelizeBelongsToManyOptions, 'through'> {
|
|
14
|
+
type: 'belongsToMany';
|
|
15
|
+
target?: string;
|
|
16
|
+
through?: string;
|
|
17
|
+
throughScope?: AssociationScope;
|
|
18
|
+
throughUnique?: boolean;
|
|
19
|
+
throughParanoid?: boolean;
|
|
20
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var belongs_to_many_field_exports = {};
|
|
20
|
+
__export(belongs_to_many_field_exports, {
|
|
21
|
+
BelongsToManyField: () => BelongsToManyField
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(belongs_to_many_field_exports);
|
|
24
|
+
var import_lodash = require("lodash");
|
|
25
|
+
var import_sequelize = require("sequelize");
|
|
26
|
+
var import_utils = require("../utils");
|
|
27
|
+
var import_belongs_to_field = require("./belongs-to-field");
|
|
28
|
+
var import_relation_field = require("./relation-field");
|
|
29
|
+
const _BelongsToManyField = class _BelongsToManyField extends import_relation_field.RelationField {
|
|
30
|
+
get dataType() {
|
|
31
|
+
return "BelongsToMany";
|
|
32
|
+
}
|
|
33
|
+
get through() {
|
|
34
|
+
return this.options.through || import_sequelize.Utils.camelize(
|
|
35
|
+
[this.context.collection.model.name, this.target].map((name) => name.toLowerCase()).sort().join("_")
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
get otherKey() {
|
|
39
|
+
return this.options.otherKey;
|
|
40
|
+
}
|
|
41
|
+
references(association) {
|
|
42
|
+
const db = this.context.database;
|
|
43
|
+
const onDelete = this.options.onDelete || "CASCADE";
|
|
44
|
+
const priority = this.options.onDelete ? "user" : "default";
|
|
45
|
+
const targetAssociation = association.toTarget;
|
|
46
|
+
if (association.targetKey) {
|
|
47
|
+
targetAssociation.targetKey = association.targetKey;
|
|
48
|
+
}
|
|
49
|
+
const sourceAssociation = association.toSource;
|
|
50
|
+
if (association.sourceKey) {
|
|
51
|
+
sourceAssociation.targetKey = association.sourceKey;
|
|
52
|
+
}
|
|
53
|
+
return [
|
|
54
|
+
import_belongs_to_field.BelongsToField.toReference(db, targetAssociation, onDelete, priority),
|
|
55
|
+
import_belongs_to_field.BelongsToField.toReference(db, sourceAssociation, onDelete, priority)
|
|
56
|
+
];
|
|
57
|
+
}
|
|
58
|
+
checkAssociationKeys(database) {
|
|
59
|
+
let { foreignKey, sourceKey, otherKey, targetKey } = this.options;
|
|
60
|
+
const through = this.through;
|
|
61
|
+
const throughCollection = database.getCollection(through);
|
|
62
|
+
if (!throughCollection) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (!sourceKey) {
|
|
66
|
+
sourceKey = this.collection.model.primaryKeyAttribute;
|
|
67
|
+
}
|
|
68
|
+
if (!foreignKey) {
|
|
69
|
+
foreignKey = import_sequelize.Utils.camelize([import_sequelize.Utils.singularize(this.collection.model.name), sourceKey].join("_"));
|
|
70
|
+
}
|
|
71
|
+
if (!targetKey) {
|
|
72
|
+
targetKey = this.TargetModel.primaryKeyAttribute;
|
|
73
|
+
}
|
|
74
|
+
if (!otherKey) {
|
|
75
|
+
otherKey = import_sequelize.Utils.camelize([import_sequelize.Utils.singularize(this.TargetModel.name), targetKey].join("_"));
|
|
76
|
+
}
|
|
77
|
+
const foreignKeyAttribute = throughCollection.model.rawAttributes[foreignKey];
|
|
78
|
+
const otherKeyAttribute = throughCollection.model.rawAttributes[otherKey];
|
|
79
|
+
const sourceKeyAttribute = this.collection.model.rawAttributes[sourceKey];
|
|
80
|
+
const targetKeyAttribute = this.TargetModel.rawAttributes[targetKey];
|
|
81
|
+
if (!foreignKeyAttribute || !otherKeyAttribute || !sourceKeyAttribute || !targetKeyAttribute) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
const foreignKeyType = foreignKeyAttribute.type.constructor.toString();
|
|
85
|
+
const otherKeyType = otherKeyAttribute.type.constructor.toString();
|
|
86
|
+
const sourceKeyType = sourceKeyAttribute.type.constructor.toString();
|
|
87
|
+
const targetKeyType = targetKeyAttribute.type.constructor.toString();
|
|
88
|
+
if (!this.keyPairsTypeMatched(foreignKeyType, sourceKeyType)) {
|
|
89
|
+
throw new Error(
|
|
90
|
+
`Foreign key "${foreignKey}" type "${foreignKeyType}" does not match source key "${sourceKey}" type "${sourceKeyType}" in belongs to many relation "${this.name}" of collection "${this.collection.name}"`
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
if (!this.keyPairsTypeMatched(otherKeyType, targetKeyType)) {
|
|
94
|
+
throw new Error(
|
|
95
|
+
`Other key "${otherKey}" type "${otherKeyType}" does not match target key "${targetKey}" type "${targetKeyType}" in belongs to many relation "${this.name}" of collection "${this.collection.name}"`
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
bind() {
|
|
100
|
+
const { database, collection } = this.context;
|
|
101
|
+
const Target = this.TargetModel;
|
|
102
|
+
if (!Target) {
|
|
103
|
+
database.addPendingField(this);
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
if (!this.collection.model.primaryKeyAttribute) {
|
|
107
|
+
throw new Error(`Collection model ${this.collection.model.name} has no primary key attribute`);
|
|
108
|
+
}
|
|
109
|
+
if (!Target.primaryKeyAttribute) {
|
|
110
|
+
throw new Error(`Target model ${Target.name} has no primary key attribute`);
|
|
111
|
+
}
|
|
112
|
+
this.checkAssociationKeys(database);
|
|
113
|
+
const through = this.through;
|
|
114
|
+
let Through;
|
|
115
|
+
if (database.hasCollection(through)) {
|
|
116
|
+
Through = database.getCollection(through);
|
|
117
|
+
} else {
|
|
118
|
+
const throughCollectionOptions = {
|
|
119
|
+
name: through
|
|
120
|
+
};
|
|
121
|
+
if (this.collection.options.dumpRules) {
|
|
122
|
+
throughCollectionOptions["dumpRules"] = this.collection.options.dumpRules;
|
|
123
|
+
}
|
|
124
|
+
if (this.collection.collectionSchema()) {
|
|
125
|
+
throughCollectionOptions["schema"] = this.collection.collectionSchema();
|
|
126
|
+
}
|
|
127
|
+
Through = database.collection(throughCollectionOptions);
|
|
128
|
+
Object.defineProperty(Through.model, "isThrough", { value: true });
|
|
129
|
+
}
|
|
130
|
+
const belongsToManyOptions = {
|
|
131
|
+
constraints: false,
|
|
132
|
+
...(0, import_lodash.omit)(this.options, ["name", "type", "target"]),
|
|
133
|
+
as: this.name,
|
|
134
|
+
through: {
|
|
135
|
+
model: Through.model,
|
|
136
|
+
scope: this.options.throughScope,
|
|
137
|
+
paranoid: this.options.throughParanoid,
|
|
138
|
+
unique: this.options.throughUnique
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
const association = collection.model.belongsToMany(Target, belongsToManyOptions);
|
|
142
|
+
database.removePendingField(this);
|
|
143
|
+
if (!this.options.foreignKey) {
|
|
144
|
+
this.options.foreignKey = association.foreignKey;
|
|
145
|
+
}
|
|
146
|
+
if (!this.options.sourceKey) {
|
|
147
|
+
this.options.sourceKey = association.sourceKey;
|
|
148
|
+
}
|
|
149
|
+
if (!this.options.otherKey) {
|
|
150
|
+
this.options.otherKey = association.otherKey;
|
|
151
|
+
}
|
|
152
|
+
if (!this.options.targetKey) {
|
|
153
|
+
this.options.targetKey = association.targetKey;
|
|
154
|
+
}
|
|
155
|
+
try {
|
|
156
|
+
(0, import_utils.checkIdentifier)(this.options.foreignKey);
|
|
157
|
+
(0, import_utils.checkIdentifier)(this.options.otherKey);
|
|
158
|
+
} catch (error) {
|
|
159
|
+
this.unbind();
|
|
160
|
+
throw error;
|
|
161
|
+
}
|
|
162
|
+
if (!this.options.through) {
|
|
163
|
+
this.options.through = this.through;
|
|
164
|
+
}
|
|
165
|
+
Through.addIndex([this.options.foreignKey]);
|
|
166
|
+
Through.addIndex([this.options.otherKey]);
|
|
167
|
+
this.references(association).forEach((reference) => this.database.referenceMap.addReference(reference));
|
|
168
|
+
return true;
|
|
169
|
+
}
|
|
170
|
+
unbind() {
|
|
171
|
+
const { database, collection } = this.context;
|
|
172
|
+
const Through = database.getCollection(this.through);
|
|
173
|
+
database.removePendingField(this);
|
|
174
|
+
const association = collection.model.associations[this.name];
|
|
175
|
+
if (association && !this.options.inherit) {
|
|
176
|
+
this.references(association).forEach((reference) => this.database.referenceMap.removeReference(reference));
|
|
177
|
+
}
|
|
178
|
+
this.clearAccessors();
|
|
179
|
+
delete collection.model.associations[this.name];
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
__name(_BelongsToManyField, "BelongsToManyField");
|
|
183
|
+
let BelongsToManyField = _BelongsToManyField;
|
|
184
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
185
|
+
0 && (module.exports = {
|
|
186
|
+
BelongsToManyField
|
|
187
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DataTypes } from 'sequelize';
|
|
2
|
+
import { BaseColumnFieldOptions, Field } from './field';
|
|
3
|
+
export declare class BooleanField extends Field {
|
|
4
|
+
get dataType(): DataTypes.AbstractDataTypeConstructor;
|
|
5
|
+
}
|
|
6
|
+
export interface BooleanFieldOptions extends BaseColumnFieldOptions {
|
|
7
|
+
type: 'boolean';
|
|
8
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var boolean_field_exports = {};
|
|
20
|
+
__export(boolean_field_exports, {
|
|
21
|
+
BooleanField: () => BooleanField
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(boolean_field_exports);
|
|
24
|
+
var import_sequelize = require("sequelize");
|
|
25
|
+
var import_field = require("./field");
|
|
26
|
+
const _BooleanField = class _BooleanField extends import_field.Field {
|
|
27
|
+
get dataType() {
|
|
28
|
+
return import_sequelize.DataTypes.BOOLEAN;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
__name(_BooleanField, "BooleanField");
|
|
32
|
+
let BooleanField = _BooleanField;
|
|
33
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
+
0 && (module.exports = {
|
|
35
|
+
BooleanField
|
|
36
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Model } from '../model';
|
|
2
|
+
import { BaseColumnFieldOptions, Field } from './field';
|
|
3
|
+
export declare class ContextField extends Field {
|
|
4
|
+
get dataType(): any;
|
|
5
|
+
listener: (model: Model, options: any) => Promise<void>;
|
|
6
|
+
bind(): void;
|
|
7
|
+
unbind(): void;
|
|
8
|
+
}
|
|
9
|
+
export interface ContextFieldOptions extends BaseColumnFieldOptions {
|
|
10
|
+
type: 'context';
|
|
11
|
+
dataIndex: string;
|
|
12
|
+
dataType?: string;
|
|
13
|
+
createOnly?: boolean;
|
|
14
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var context_field_exports = {};
|
|
30
|
+
__export(context_field_exports, {
|
|
31
|
+
ContextField: () => ContextField
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(context_field_exports);
|
|
34
|
+
var import_lodash = __toESM(require("lodash"));
|
|
35
|
+
var import_sequelize = require("sequelize");
|
|
36
|
+
var import_field = require("./field");
|
|
37
|
+
const _ContextField = class _ContextField extends import_field.Field {
|
|
38
|
+
get dataType() {
|
|
39
|
+
const type = this.options.dataType || "string";
|
|
40
|
+
return import_sequelize.DataTypes[type.toUpperCase()] || import_sequelize.DataTypes.STRING;
|
|
41
|
+
}
|
|
42
|
+
listener = /* @__PURE__ */ __name(async (model, options) => {
|
|
43
|
+
const { name, dataIndex } = this.options;
|
|
44
|
+
const { context } = options;
|
|
45
|
+
model.set(name, import_lodash.default.get(context, dataIndex));
|
|
46
|
+
model.changed(name, true);
|
|
47
|
+
}, "listener");
|
|
48
|
+
bind() {
|
|
49
|
+
super.bind();
|
|
50
|
+
const { createOnly } = this.options;
|
|
51
|
+
this.on("beforeCreate", this.listener);
|
|
52
|
+
if (!createOnly) {
|
|
53
|
+
this.on("beforeUpdate", this.listener);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
unbind() {
|
|
57
|
+
super.unbind();
|
|
58
|
+
const { createOnly } = this.options;
|
|
59
|
+
this.off("beforeCreate", this.listener);
|
|
60
|
+
if (!createOnly) {
|
|
61
|
+
this.off("beforeUpdate", this.listener);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
__name(_ContextField, "ContextField");
|
|
66
|
+
let ContextField = _ContextField;
|
|
67
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
68
|
+
0 && (module.exports = {
|
|
69
|
+
ContextField
|
|
70
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DataTypes } from 'sequelize';
|
|
2
|
+
import { BaseColumnFieldOptions, Field } from './field';
|
|
3
|
+
export declare class DateField extends Field {
|
|
4
|
+
get dataType(): DataTypes.DateDataType;
|
|
5
|
+
get timezone(): string;
|
|
6
|
+
getProps(): any;
|
|
7
|
+
isDateOnly(): boolean;
|
|
8
|
+
isGMT(): any;
|
|
9
|
+
bind(): void;
|
|
10
|
+
}
|
|
11
|
+
export interface DateFieldOptions extends BaseColumnFieldOptions {
|
|
12
|
+
type: 'date';
|
|
13
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var date_field_exports = {};
|
|
20
|
+
__export(date_field_exports, {
|
|
21
|
+
DateField: () => DateField
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(date_field_exports);
|
|
24
|
+
var import_sequelize = require("sequelize");
|
|
25
|
+
var import_field = require("./field");
|
|
26
|
+
const _DateField = class _DateField extends import_field.Field {
|
|
27
|
+
get dataType() {
|
|
28
|
+
return import_sequelize.DataTypes.DATE(3);
|
|
29
|
+
}
|
|
30
|
+
get timezone() {
|
|
31
|
+
return this.isGMT() ? "+00:00" : null;
|
|
32
|
+
}
|
|
33
|
+
getProps() {
|
|
34
|
+
var _a, _b;
|
|
35
|
+
return ((_b = (_a = this.options) == null ? void 0 : _a.uiSchema) == null ? void 0 : _b["x-component-props"]) || {};
|
|
36
|
+
}
|
|
37
|
+
isDateOnly() {
|
|
38
|
+
const props = this.getProps();
|
|
39
|
+
return !props.showTime;
|
|
40
|
+
}
|
|
41
|
+
isGMT() {
|
|
42
|
+
const props = this.getProps();
|
|
43
|
+
return props.gmt;
|
|
44
|
+
}
|
|
45
|
+
bind() {
|
|
46
|
+
super.bind();
|
|
47
|
+
if (this.options.interface === "createdAt") {
|
|
48
|
+
const { model } = this.context.collection;
|
|
49
|
+
model._timestampAttributes.createdAt = this.name;
|
|
50
|
+
model.refreshAttributes();
|
|
51
|
+
}
|
|
52
|
+
if (this.options.interface === "updatedAt") {
|
|
53
|
+
const { model } = this.context.collection;
|
|
54
|
+
model._timestampAttributes.updatedAt = this.name;
|
|
55
|
+
model.refreshAttributes();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
__name(_DateField, "DateField");
|
|
60
|
+
let DateField = _DateField;
|
|
61
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
62
|
+
0 && (module.exports = {
|
|
63
|
+
DateField
|
|
64
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { DataType, ModelAttributeColumnOptions, ModelIndexesOptions, SyncOptions, Transactionable } from 'sequelize';
|
|
2
|
+
import { Collection } from '../collection';
|
|
3
|
+
import { Database } from '../database';
|
|
4
|
+
import { ModelEventTypes } from '../types';
|
|
5
|
+
export interface FieldContext {
|
|
6
|
+
database: Database;
|
|
7
|
+
collection: Collection;
|
|
8
|
+
}
|
|
9
|
+
export interface BaseFieldOptions {
|
|
10
|
+
name?: string;
|
|
11
|
+
hidden?: boolean;
|
|
12
|
+
translation?: boolean;
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}
|
|
15
|
+
export interface BaseColumnFieldOptions extends BaseFieldOptions, Omit<ModelAttributeColumnOptions, 'type'> {
|
|
16
|
+
dataType?: DataType;
|
|
17
|
+
index?: boolean | ModelIndexesOptions;
|
|
18
|
+
}
|
|
19
|
+
export declare abstract class Field {
|
|
20
|
+
options: any;
|
|
21
|
+
context: FieldContext;
|
|
22
|
+
database: Database;
|
|
23
|
+
collection: Collection;
|
|
24
|
+
[key: string]: any;
|
|
25
|
+
constructor(options?: any, context?: FieldContext);
|
|
26
|
+
get name(): any;
|
|
27
|
+
get type(): any;
|
|
28
|
+
abstract get dataType(): any;
|
|
29
|
+
sync(syncOptions: SyncOptions): Promise<void>;
|
|
30
|
+
init(): void;
|
|
31
|
+
on(eventName: ModelEventTypes, listener: (...args: any[]) => void): this;
|
|
32
|
+
off(eventName: string, listener: (...args: any[]) => void): this;
|
|
33
|
+
get(name: string): any;
|
|
34
|
+
remove(): void | Field;
|
|
35
|
+
columnName(): any;
|
|
36
|
+
existsInDb(options?: Transactionable): Promise<boolean>;
|
|
37
|
+
merge(obj: any): void;
|
|
38
|
+
bind(): void;
|
|
39
|
+
unbind(): void;
|
|
40
|
+
toSequelize(): any;
|
|
41
|
+
isSqlite(): boolean;
|
|
42
|
+
typeToString(): any;
|
|
43
|
+
}
|