@nocobase/database 1.2.13-alpha → 1.3.0-alpha.20240710084543
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 +4 -4
- package/lib/collection-factory.d.ts +0 -25
- package/lib/collection-factory.js +0 -61
- package/lib/collection-group-manager.d.ts +0 -34
- package/lib/collection-group-manager.js +0 -66
- package/lib/collection-importer.d.ts +0 -15
- package/lib/collection-importer.js +0 -83
- package/lib/collection.d.ts +0 -145
- package/lib/collection.js +0 -663
- package/lib/database-utils/index.d.ts +0 -16
- package/lib/database-utils/index.js +0 -75
- package/lib/database.d.ts +0 -228
- package/lib/database.js +0 -795
- package/lib/decorators/must-have-filter-decorator.d.ts +0 -10
- package/lib/decorators/must-have-filter-decorator.js +0 -48
- package/lib/decorators/target-collection-decorator.d.ts +0 -10
- package/lib/decorators/target-collection-decorator.js +0 -56
- package/lib/decorators/transaction-decorator.d.ts +0 -9
- package/lib/decorators/transaction-decorator.js +0 -95
- package/lib/eager-loading/eager-loading-tree.d.ts +0 -39
- package/lib/eager-loading/eager-loading-tree.js +0 -448
- package/lib/errors/identifier-error.d.ts +0 -11
- package/lib/errors/identifier-error.js +0 -44
- package/lib/errors/zero-column-table-error.d.ts +0 -10
- package/lib/errors/zero-column-table-error.js +0 -40
- package/lib/features/references-map.d.ts +0 -29
- package/lib/features/references-map.js +0 -120
- package/lib/features/referential-integrity-check.d.ts +0 -16
- package/lib/features/referential-integrity-check.js +0 -86
- package/lib/field-repository/array-field-repository.d.ts +0 -36
- package/lib/field-repository/array-field-repository.js +0 -179
- package/lib/fields/array-field.d.ts +0 -19
- package/lib/fields/array-field.js +0 -66
- package/lib/fields/belongs-to-field.d.ts +0 -25
- package/lib/fields/belongs-to-field.js +0 -166
- package/lib/fields/belongs-to-many-field.d.ts +0 -28
- package/lib/fields/belongs-to-many-field.js +0 -196
- package/lib/fields/boolean-field.d.ts +0 -16
- package/lib/fields/boolean-field.js +0 -45
- package/lib/fields/context-field.d.ts +0 -22
- package/lib/fields/context-field.js +0 -79
- package/lib/fields/date-field.d.ts +0 -21
- package/lib/fields/date-field.js +0 -73
- package/lib/fields/field.d.ts +0 -52
- package/lib/fields/field.js +0 -168
- package/lib/fields/has-inverse-field.d.ts +0 -12
- package/lib/fields/has-inverse-field.js +0 -24
- package/lib/fields/has-many-field.d.ts +0 -76
- package/lib/fields/has-many-field.js +0 -165
- package/lib/fields/has-one-field.d.ts +0 -76
- package/lib/fields/has-one-field.js +0 -159
- package/lib/fields/index.d.ts +0 -54
- package/lib/fields/index.js +0 -74
- package/lib/fields/json-field.d.ts +0 -22
- package/lib/fields/json-field.js +0 -63
- package/lib/fields/nanoid-field.d.ts +0 -22
- package/lib/fields/nanoid-field.js +0 -65
- package/lib/fields/number-field.d.ts +0 -49
- package/lib/fields/number-field.js +0 -94
- package/lib/fields/password-field.d.ts +0 -29
- package/lib/fields/password-field.js +0 -106
- package/lib/fields/radio-field.d.ts +0 -24
- package/lib/fields/radio-field.js +0 -75
- package/lib/fields/relation-field.d.ts +0 -31
- package/lib/fields/relation-field.js +0 -94
- package/lib/fields/set-field.d.ts +0 -18
- package/lib/fields/set-field.js +0 -55
- package/lib/fields/sort-field.d.ts +0 -22
- package/lib/fields/sort-field.js +0 -197
- package/lib/fields/string-field.d.ts +0 -16
- package/lib/fields/string-field.js +0 -45
- package/lib/fields/text-field.d.ts +0 -18
- package/lib/fields/text-field.js +0 -53
- package/lib/fields/time-field.d.ts +0 -16
- package/lib/fields/time-field.js +0 -45
- package/lib/fields/uid-field.d.ts +0 -21
- package/lib/fields/uid-field.js +0 -72
- package/lib/fields/uuid-field.d.ts +0 -20
- package/lib/fields/uuid-field.js +0 -63
- package/lib/fields/virtual-field.d.ts +0 -16
- package/lib/fields/virtual-field.js +0 -45
- package/lib/filter-match.d.ts +0 -9
- package/lib/filter-match.js +0 -75
- package/lib/filter-parser.d.ts +0 -29
- package/lib/filter-parser.js +0 -238
- package/lib/helpers.d.ts +0 -11
- package/lib/helpers.js +0 -182
- package/lib/index.d.ts +0 -37
- package/lib/index.js +0 -138
- package/lib/inherited-collection.d.ts +0 -22
- package/lib/inherited-collection.js +0 -147
- package/lib/inherited-map.d.ts +0 -29
- package/lib/inherited-map.js +0 -125
- package/lib/inherited-sync-runner.d.ts +0 -12
- package/lib/inherited-sync-runner.js +0 -184
- package/lib/interface-manager.d.ts +0 -17
- package/lib/interface-manager.js +0 -50
- package/lib/interfaces/base-interface.d.ts +0 -33
- package/lib/interfaces/base-interface.js +0 -80
- package/lib/interfaces/boolean-interface.d.ts +0 -13
- package/lib/interfaces/boolean-interface.js +0 -70
- package/lib/interfaces/checkboxes-interface.d.ts +0 -11
- package/lib/interfaces/checkboxes-interface.js +0 -41
- package/lib/interfaces/datetime-interface.d.ts +0 -13
- package/lib/interfaces/datetime-interface.js +0 -108
- package/lib/interfaces/index.d.ts +0 -14
- package/lib/interfaces/index.js +0 -40
- package/lib/interfaces/integer-interface.d.ts +0 -12
- package/lib/interfaces/integer-interface.js +0 -44
- package/lib/interfaces/json-interface.d.ts +0 -13
- package/lib/interfaces/json-interface.js +0 -47
- package/lib/interfaces/many-to-many-interface.d.ts +0 -11
- package/lib/interfaces/many-to-many-interface.js +0 -41
- package/lib/interfaces/many-to-one-interface.d.ts +0 -11
- package/lib/interfaces/many-to-one-interface.js +0 -41
- package/lib/interfaces/multiple-select-interface.d.ts +0 -13
- package/lib/interfaces/multiple-select-interface.js +0 -76
- package/lib/interfaces/number-interface.d.ts +0 -15
- package/lib/interfaces/number-interface.js +0 -72
- package/lib/interfaces/one-belongs-to-one-interface.d.ts +0 -11
- package/lib/interfaces/one-belongs-to-one-interface.js +0 -41
- package/lib/interfaces/one-has-one-interface.d.ts +0 -11
- package/lib/interfaces/one-has-one-interface.js +0 -41
- package/lib/interfaces/one-to-many-interface.d.ts +0 -11
- package/lib/interfaces/one-to-many-interface.js +0 -41
- package/lib/interfaces/percent-interface.d.ts +0 -13
- package/lib/interfaces/percent-interface.js +0 -55
- package/lib/interfaces/select-interface.d.ts +0 -13
- package/lib/interfaces/select-interface.js +0 -63
- package/lib/interfaces/to-many-interface.d.ts +0 -12
- package/lib/interfaces/to-many-interface.js +0 -61
- package/lib/interfaces/to-one-interface.d.ts +0 -13
- package/lib/interfaces/to-one-interface.js +0 -61
- package/lib/interfaces/utils.d.ts +0 -10
- package/lib/interfaces/utils.js +0 -72
- package/lib/listeners/adjacency-list.d.ts +0 -10
- package/lib/listeners/adjacency-list.js +0 -51
- package/lib/listeners/append-child-collection-name-after-repository-find.d.ts +0 -14
- package/lib/listeners/append-child-collection-name-after-repository-find.js +0 -75
- package/lib/listeners/index.d.ts +0 -10
- package/lib/listeners/index.js +0 -42
- package/lib/magic-attribute-model.d.ts +0 -16
- package/lib/magic-attribute-model.js +0 -213
- package/lib/migration.d.ts +0 -43
- package/lib/migration.js +0 -112
- package/lib/mock-database.d.ts +0 -33
- package/lib/mock-database.js +0 -136
- package/lib/model-hook.d.ts +0 -20
- package/lib/model-hook.js +0 -96
- package/lib/model.d.ts +0 -32
- package/lib/model.js +0 -179
- package/lib/operators/array.d.ts +0 -10
- package/lib/operators/array.js +0 -196
- package/lib/operators/association.d.ts +0 -10
- package/lib/operators/association.js +0 -44
- package/lib/operators/boolean.d.ts +0 -10
- package/lib/operators/boolean.js +0 -47
- package/lib/operators/child-collection.d.ts +0 -10
- package/lib/operators/child-collection.js +0 -77
- package/lib/operators/date.d.ts +0 -10
- package/lib/operators/date.js +0 -149
- package/lib/operators/empty.d.ts +0 -13
- package/lib/operators/empty.js +0 -102
- package/lib/operators/eq.d.ts +0 -10
- package/lib/operators/eq.js +0 -44
- package/lib/operators/index.d.ts +0 -13
- package/lib/operators/index.js +0 -63
- package/lib/operators/ne.d.ts +0 -10
- package/lib/operators/ne.js +0 -49
- package/lib/operators/notIn.d.ts +0 -10
- package/lib/operators/notIn.js +0 -42
- package/lib/operators/string.d.ts +0 -10
- package/lib/operators/string.js +0 -118
- package/lib/operators/utils.d.ts +0 -12
- package/lib/operators/utils.js +0 -53
- package/lib/options-parser.d.ts +0 -45
- package/lib/options-parser.js +0 -350
- package/lib/query-interface/mysql-query-interface.d.ts +0 -44
- package/lib/query-interface/mysql-query-interface.js +0 -134
- package/lib/query-interface/postgres-query-interface.d.ts +0 -41
- package/lib/query-interface/postgres-query-interface.js +0 -207
- package/lib/query-interface/query-interface-builder.d.ts +0 -10
- package/lib/query-interface/query-interface-builder.js +0 -55
- package/lib/query-interface/query-interface.d.ts +0 -52
- package/lib/query-interface/query-interface.js +0 -59
- package/lib/query-interface/sqlite-query-interface.d.ts +0 -44
- package/lib/query-interface/sqlite-query-interface.js +0 -141
- package/lib/relation-repository/belongs-to-many-repository.d.ts +0 -28
- package/lib/relation-repository/belongs-to-many-repository.js +0 -248
- package/lib/relation-repository/belongs-to-repository.d.ts +0 -17
- package/lib/relation-repository/belongs-to-repository.js +0 -51
- package/lib/relation-repository/hasmany-repository.d.ts +0 -21
- package/lib/relation-repository/hasmany-repository.js +0 -158
- package/lib/relation-repository/hasone-repository.d.ts +0 -17
- package/lib/relation-repository/hasone-repository.js +0 -51
- package/lib/relation-repository/multiple-relation-repository.d.ts +0 -27
- package/lib/relation-repository/multiple-relation-repository.js +0 -200
- package/lib/relation-repository/relation-repository.d.ts +0 -38
- package/lib/relation-repository/relation-repository.js +0 -175
- package/lib/relation-repository/single-relation-repository.d.ts +0 -36
- package/lib/relation-repository/single-relation-repository.js +0 -151
- package/lib/relation-repository/types.d.ts +0 -15
- package/lib/relation-repository/types.js +0 -24
- package/lib/repositories/tree-repository/adjacency-list-repository.d.ts +0 -26
- package/lib/repositories/tree-repository/adjacency-list-repository.js +0 -192
- package/lib/repositories/view-repository.d.ts +0 -11
- package/lib/repositories/view-repository.js +0 -41
- package/lib/repository.d.ts +0 -214
- package/lib/repository.js +0 -609
- package/lib/sql-parser/index.d.ts +0 -13
- package/lib/sql-parser/index.js +0 -33
- package/lib/sync-runner.d.ts +0 -41
- package/lib/sync-runner.js +0 -335
- package/lib/types.d.ts +0 -57
- package/lib/types.js +0 -24
- package/lib/update-associations.d.ts +0 -68
- package/lib/update-associations.js +0 -429
- package/lib/update-guard.d.ts +0 -36
- package/lib/update-guard.js +0 -212
- package/lib/utils.d.ts +0 -15
- package/lib/utils.js +0 -136
- package/lib/value-parsers/array-value-parser.d.ts +0 -16
- package/lib/value-parsers/array-value-parser.js +0 -67
- package/lib/value-parsers/base-value-parser.d.ts +0 -20
- package/lib/value-parsers/base-value-parser.js +0 -72
- package/lib/value-parsers/boolean-value-parser.d.ts +0 -12
- package/lib/value-parsers/boolean-value-parser.js +0 -61
- package/lib/value-parsers/date-value-parser.d.ts +0 -13
- package/lib/value-parsers/date-value-parser.js +0 -99
- package/lib/value-parsers/index.d.ts +0 -20
- package/lib/value-parsers/index.js +0 -87
- package/lib/value-parsers/json-value-parser.d.ts +0 -12
- package/lib/value-parsers/json-value-parser.js +0 -56
- package/lib/value-parsers/number-value-parser.d.ts +0 -12
- package/lib/value-parsers/number-value-parser.js +0 -67
- package/lib/value-parsers/string-value-parser.d.ts +0 -16
- package/lib/value-parsers/string-value-parser.js +0 -73
- package/lib/value-parsers/to-many-value-parser.d.ts +0 -21
- package/lib/value-parsers/to-many-value-parser.js +0 -117
- package/lib/value-parsers/to-one-value-parser.d.ts +0 -12
- package/lib/value-parsers/to-one-value-parser.js +0 -57
- package/lib/view/field-type-map.d.ts +0 -109
- package/lib/view/field-type-map.js +0 -101
- package/lib/view/view-inference.d.ts +0 -40
- package/lib/view/view-inference.js +0 -157
- package/lib/view-collection.d.ts +0 -14
- package/lib/view-collection.js +0 -54
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
15
|
-
var __export = (target, all) => {
|
|
16
|
-
for (var name in all)
|
|
17
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
18
|
-
};
|
|
19
|
-
var __copyProps = (to, from, except, desc) => {
|
|
20
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
-
for (let key of __getOwnPropNames(from))
|
|
22
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
23
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
24
|
-
}
|
|
25
|
-
return to;
|
|
26
|
-
};
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var number_interface_exports = {};
|
|
29
|
-
__export(number_interface_exports, {
|
|
30
|
-
NumberInterface: () => NumberInterface
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(number_interface_exports);
|
|
33
|
-
var import_base_interface = require("./base-interface");
|
|
34
|
-
const _NumberInterface = class _NumberInterface extends import_base_interface.BaseInterface {
|
|
35
|
-
sanitizeValue(value) {
|
|
36
|
-
if (typeof value === "string") {
|
|
37
|
-
if (["n/a", "-"].includes(value.toLowerCase())) {
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
|
-
if (value.includes(",")) {
|
|
41
|
-
value = value.replace(/,/g, "");
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return value;
|
|
45
|
-
}
|
|
46
|
-
async toValue(value) {
|
|
47
|
-
if (value === null || value === void 0 || typeof value === "number") {
|
|
48
|
-
return value;
|
|
49
|
-
}
|
|
50
|
-
if (!value) {
|
|
51
|
-
return null;
|
|
52
|
-
}
|
|
53
|
-
const sanitizedValue = this.sanitizeValue(value);
|
|
54
|
-
const numberValue = this.parseValue(sanitizedValue);
|
|
55
|
-
if (!this.validate(numberValue)) {
|
|
56
|
-
throw new Error(`Invalid number value: "${value}"`);
|
|
57
|
-
}
|
|
58
|
-
return numberValue;
|
|
59
|
-
}
|
|
60
|
-
parseValue(value) {
|
|
61
|
-
return value;
|
|
62
|
-
}
|
|
63
|
-
validate(value) {
|
|
64
|
-
return !isNaN(value);
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
__name(_NumberInterface, "NumberInterface");
|
|
68
|
-
let NumberInterface = _NumberInterface;
|
|
69
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
70
|
-
0 && (module.exports = {
|
|
71
|
-
NumberInterface
|
|
72
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import { ToOneInterface } from './to-one-interface';
|
|
10
|
-
export declare class OneBelongsToOneInterface extends ToOneInterface {
|
|
11
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
15
|
-
var __export = (target, all) => {
|
|
16
|
-
for (var name in all)
|
|
17
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
18
|
-
};
|
|
19
|
-
var __copyProps = (to, from, except, desc) => {
|
|
20
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
-
for (let key of __getOwnPropNames(from))
|
|
22
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
23
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
24
|
-
}
|
|
25
|
-
return to;
|
|
26
|
-
};
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var one_belongs_to_one_interface_exports = {};
|
|
29
|
-
__export(one_belongs_to_one_interface_exports, {
|
|
30
|
-
OneBelongsToOneInterface: () => OneBelongsToOneInterface
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(one_belongs_to_one_interface_exports);
|
|
33
|
-
var import_to_one_interface = require("./to-one-interface");
|
|
34
|
-
const _OneBelongsToOneInterface = class _OneBelongsToOneInterface extends import_to_one_interface.ToOneInterface {
|
|
35
|
-
};
|
|
36
|
-
__name(_OneBelongsToOneInterface, "OneBelongsToOneInterface");
|
|
37
|
-
let OneBelongsToOneInterface = _OneBelongsToOneInterface;
|
|
38
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
39
|
-
0 && (module.exports = {
|
|
40
|
-
OneBelongsToOneInterface
|
|
41
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import { ToOneInterface } from './to-one-interface';
|
|
10
|
-
export declare class OneHasOneInterface extends ToOneInterface {
|
|
11
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
15
|
-
var __export = (target, all) => {
|
|
16
|
-
for (var name in all)
|
|
17
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
18
|
-
};
|
|
19
|
-
var __copyProps = (to, from, except, desc) => {
|
|
20
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
-
for (let key of __getOwnPropNames(from))
|
|
22
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
23
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
24
|
-
}
|
|
25
|
-
return to;
|
|
26
|
-
};
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var one_has_one_interface_exports = {};
|
|
29
|
-
__export(one_has_one_interface_exports, {
|
|
30
|
-
OneHasOneInterface: () => OneHasOneInterface
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(one_has_one_interface_exports);
|
|
33
|
-
var import_to_one_interface = require("./to-one-interface");
|
|
34
|
-
const _OneHasOneInterface = class _OneHasOneInterface extends import_to_one_interface.ToOneInterface {
|
|
35
|
-
};
|
|
36
|
-
__name(_OneHasOneInterface, "OneHasOneInterface");
|
|
37
|
-
let OneHasOneInterface = _OneHasOneInterface;
|
|
38
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
39
|
-
0 && (module.exports = {
|
|
40
|
-
OneHasOneInterface
|
|
41
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import { ToManyInterface } from './to-many-interface';
|
|
10
|
-
export declare class OneToManyInterface extends ToManyInterface {
|
|
11
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
15
|
-
var __export = (target, all) => {
|
|
16
|
-
for (var name in all)
|
|
17
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
18
|
-
};
|
|
19
|
-
var __copyProps = (to, from, except, desc) => {
|
|
20
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
-
for (let key of __getOwnPropNames(from))
|
|
22
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
23
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
24
|
-
}
|
|
25
|
-
return to;
|
|
26
|
-
};
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var one_to_many_interface_exports = {};
|
|
29
|
-
__export(one_to_many_interface_exports, {
|
|
30
|
-
OneToManyInterface: () => OneToManyInterface
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(one_to_many_interface_exports);
|
|
33
|
-
var import_to_many_interface = require("./to-many-interface");
|
|
34
|
-
const _OneToManyInterface = class _OneToManyInterface extends import_to_many_interface.ToManyInterface {
|
|
35
|
-
};
|
|
36
|
-
__name(_OneToManyInterface, "OneToManyInterface");
|
|
37
|
-
let OneToManyInterface = _OneToManyInterface;
|
|
38
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
39
|
-
0 && (module.exports = {
|
|
40
|
-
OneToManyInterface
|
|
41
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import { NumberInterface } from './number-interface';
|
|
10
|
-
export declare class PercentInterface extends NumberInterface {
|
|
11
|
-
parseValue(value: any): any;
|
|
12
|
-
toString(value: any): string;
|
|
13
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
15
|
-
var __export = (target, all) => {
|
|
16
|
-
for (var name in all)
|
|
17
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
18
|
-
};
|
|
19
|
-
var __copyProps = (to, from, except, desc) => {
|
|
20
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
-
for (let key of __getOwnPropNames(from))
|
|
22
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
23
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
24
|
-
}
|
|
25
|
-
return to;
|
|
26
|
-
};
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var percent_interface_exports = {};
|
|
29
|
-
__export(percent_interface_exports, {
|
|
30
|
-
PercentInterface: () => PercentInterface
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(percent_interface_exports);
|
|
33
|
-
var import_utils = require("@nocobase/utils");
|
|
34
|
-
var import_number_interface = require("./number-interface");
|
|
35
|
-
var import_utils2 = require("../utils");
|
|
36
|
-
const _PercentInterface = class _PercentInterface extends import_number_interface.NumberInterface {
|
|
37
|
-
parseValue(value) {
|
|
38
|
-
if (typeof value === "string" && value.endsWith("%")) {
|
|
39
|
-
const parsedValue = (0, import_utils2.percent2float)(value);
|
|
40
|
-
return parsedValue;
|
|
41
|
-
}
|
|
42
|
-
return value;
|
|
43
|
-
}
|
|
44
|
-
toString(value) {
|
|
45
|
-
var _a, _b, _c;
|
|
46
|
-
const step = ((_c = (_b = (_a = this.options) == null ? void 0 : _a.uiSchema) == null ? void 0 : _b["x-component-props"]) == null ? void 0 : _c["step"]) ?? 0;
|
|
47
|
-
return value && `${(0, import_utils.toFixedByStep)(value * 100, step)}%`;
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
__name(_PercentInterface, "PercentInterface");
|
|
51
|
-
let PercentInterface = _PercentInterface;
|
|
52
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
53
|
-
0 && (module.exports = {
|
|
54
|
-
PercentInterface
|
|
55
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import { BaseInterface } from './base-interface';
|
|
10
|
-
export declare class SelectInterface extends BaseInterface {
|
|
11
|
-
toValue(str: string, ctx?: any): Promise<any>;
|
|
12
|
-
toString(value: any, ctx?: any): any;
|
|
13
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
15
|
-
var __export = (target, all) => {
|
|
16
|
-
for (var name in all)
|
|
17
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
18
|
-
};
|
|
19
|
-
var __copyProps = (to, from, except, desc) => {
|
|
20
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
-
for (let key of __getOwnPropNames(from))
|
|
22
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
23
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
24
|
-
}
|
|
25
|
-
return to;
|
|
26
|
-
};
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var select_interface_exports = {};
|
|
29
|
-
__export(select_interface_exports, {
|
|
30
|
-
SelectInterface: () => SelectInterface
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(select_interface_exports);
|
|
33
|
-
var import_base_interface = require("./base-interface");
|
|
34
|
-
const _SelectInterface = class _SelectInterface extends import_base_interface.BaseInterface {
|
|
35
|
-
async toValue(str, ctx) {
|
|
36
|
-
var _a;
|
|
37
|
-
if (!str) {
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
|
-
const enumConfig = ((_a = this.options.uiSchema) == null ? void 0 : _a.enum) || [];
|
|
41
|
-
const option = enumConfig.find((item) => item.label === str);
|
|
42
|
-
if (option) {
|
|
43
|
-
return option.value;
|
|
44
|
-
}
|
|
45
|
-
const valueOption = enumConfig.find((item) => item.value === str);
|
|
46
|
-
if (valueOption) {
|
|
47
|
-
return valueOption.value;
|
|
48
|
-
}
|
|
49
|
-
throw new Error(`"${str}" is not a valid option in ${ctx.field.name} field.`);
|
|
50
|
-
}
|
|
51
|
-
toString(value, ctx) {
|
|
52
|
-
var _a;
|
|
53
|
-
const enumConfig = ((_a = this.options.uiSchema) == null ? void 0 : _a.enum) || [];
|
|
54
|
-
const option = enumConfig.find((item) => item.value === value);
|
|
55
|
-
return (option == null ? void 0 : option.label) || value;
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
__name(_SelectInterface, "SelectInterface");
|
|
59
|
-
let SelectInterface = _SelectInterface;
|
|
60
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
61
|
-
0 && (module.exports = {
|
|
62
|
-
SelectInterface
|
|
63
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import { BaseInterface } from './base-interface';
|
|
10
|
-
export declare class ToManyInterface extends BaseInterface {
|
|
11
|
-
toValue(str: string, ctx?: any): Promise<any>;
|
|
12
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
15
|
-
var __export = (target, all) => {
|
|
16
|
-
for (var name in all)
|
|
17
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
18
|
-
};
|
|
19
|
-
var __copyProps = (to, from, except, desc) => {
|
|
20
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
-
for (let key of __getOwnPropNames(from))
|
|
22
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
23
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
24
|
-
}
|
|
25
|
-
return to;
|
|
26
|
-
};
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var to_many_interface_exports = {};
|
|
29
|
-
__export(to_many_interface_exports, {
|
|
30
|
-
ToManyInterface: () => ToManyInterface
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(to_many_interface_exports);
|
|
33
|
-
var import_base_interface = require("./base-interface");
|
|
34
|
-
const _ToManyInterface = class _ToManyInterface extends import_base_interface.BaseInterface {
|
|
35
|
-
async toValue(str, ctx) {
|
|
36
|
-
if (!str) {
|
|
37
|
-
return null;
|
|
38
|
-
}
|
|
39
|
-
const items = str.split(",");
|
|
40
|
-
const { filterKey, targetCollection, transaction } = ctx;
|
|
41
|
-
const targetInstances = await targetCollection.repository.find({
|
|
42
|
-
filter: {
|
|
43
|
-
[filterKey]: items
|
|
44
|
-
},
|
|
45
|
-
transaction
|
|
46
|
-
});
|
|
47
|
-
items.forEach((item) => {
|
|
48
|
-
if (!targetInstances.find((targetInstance) => targetInstance[filterKey] === item)) {
|
|
49
|
-
throw new Error(`"${item}" not found in ${targetCollection.model.name} ${filterKey}`);
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
const primaryKeyAttribute = targetCollection.model.primaryKeyAttribute;
|
|
53
|
-
return targetInstances.map((targetInstance) => targetInstance[primaryKeyAttribute]);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
__name(_ToManyInterface, "ToManyInterface");
|
|
57
|
-
let ToManyInterface = _ToManyInterface;
|
|
58
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
59
|
-
0 && (module.exports = {
|
|
60
|
-
ToManyInterface
|
|
61
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import { BaseInterface } from './base-interface';
|
|
10
|
-
export declare class ToOneInterface extends BaseInterface {
|
|
11
|
-
toString(value: any, ctx?: any): string;
|
|
12
|
-
toValue(str: string, ctx?: any): Promise<any>;
|
|
13
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
15
|
-
var __export = (target, all) => {
|
|
16
|
-
for (var name in all)
|
|
17
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
18
|
-
};
|
|
19
|
-
var __copyProps = (to, from, except, desc) => {
|
|
20
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
-
for (let key of __getOwnPropNames(from))
|
|
22
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
23
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
24
|
-
}
|
|
25
|
-
return to;
|
|
26
|
-
};
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var to_one_interface_exports = {};
|
|
29
|
-
__export(to_one_interface_exports, {
|
|
30
|
-
ToOneInterface: () => ToOneInterface
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(to_one_interface_exports);
|
|
33
|
-
var import_base_interface = require("./base-interface");
|
|
34
|
-
const _ToOneInterface = class _ToOneInterface extends import_base_interface.BaseInterface {
|
|
35
|
-
toString(value, ctx) {
|
|
36
|
-
return value;
|
|
37
|
-
}
|
|
38
|
-
async toValue(str, ctx) {
|
|
39
|
-
if (!str) {
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
const { filterKey, targetCollection, transaction } = ctx;
|
|
43
|
-
const targetInstance = await targetCollection.repository.findOne({
|
|
44
|
-
filter: {
|
|
45
|
-
[filterKey]: str
|
|
46
|
-
},
|
|
47
|
-
transaction
|
|
48
|
-
});
|
|
49
|
-
if (!targetInstance) {
|
|
50
|
-
throw new Error(`"${str}" not found in ${targetCollection.model.name} ${filterKey}`);
|
|
51
|
-
}
|
|
52
|
-
const primaryKeyAttribute = targetCollection.model.primaryKeyAttribute;
|
|
53
|
-
return targetInstance[primaryKeyAttribute];
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
__name(_ToOneInterface, "ToOneInterface");
|
|
57
|
-
let ToOneInterface = _ToOneInterface;
|
|
58
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
59
|
-
0 && (module.exports = {
|
|
60
|
-
ToOneInterface
|
|
61
|
-
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import Database from '../database';
|
|
10
|
-
export declare function registerInterfaces(db: Database): void;
|
package/lib/interfaces/utils.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
15
|
-
var __export = (target, all) => {
|
|
16
|
-
for (var name in all)
|
|
17
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
18
|
-
};
|
|
19
|
-
var __copyProps = (to, from, except, desc) => {
|
|
20
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
-
for (let key of __getOwnPropNames(from))
|
|
22
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
23
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
24
|
-
}
|
|
25
|
-
return to;
|
|
26
|
-
};
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var utils_exports = {};
|
|
29
|
-
__export(utils_exports, {
|
|
30
|
-
registerInterfaces: () => registerInterfaces
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(utils_exports);
|
|
33
|
-
var import_index = require("./index");
|
|
34
|
-
var import_many_to_one_interface = require("./many-to-one-interface");
|
|
35
|
-
var import_many_to_many_interface = require("./many-to-many-interface");
|
|
36
|
-
var import_one_has_one_interface = require("./one-has-one-interface");
|
|
37
|
-
var import_one_belongs_to_one_interface = require("./one-belongs-to-one-interface");
|
|
38
|
-
var import_one_to_many_interface = require("./one-to-many-interface");
|
|
39
|
-
var import_integer_interface = require("./integer-interface");
|
|
40
|
-
var import_number_interface = require("./number-interface");
|
|
41
|
-
var import_json_interface = require("./json-interface");
|
|
42
|
-
const interfaces = {
|
|
43
|
-
integer: import_integer_interface.IntegerInterface,
|
|
44
|
-
number: import_number_interface.NumberInterface,
|
|
45
|
-
multipleSelect: import_index.MultipleSelectInterface,
|
|
46
|
-
checkboxes: import_index.MultipleSelectInterface,
|
|
47
|
-
checkboxGroup: import_index.MultipleSelectInterface,
|
|
48
|
-
select: import_index.SelectInterface,
|
|
49
|
-
radio: import_index.SelectInterface,
|
|
50
|
-
radioGroup: import_index.SelectInterface,
|
|
51
|
-
percent: import_index.PercentInterface,
|
|
52
|
-
datetime: import_index.DatetimeInterface,
|
|
53
|
-
createdAt: import_index.DatetimeInterface,
|
|
54
|
-
updatedAt: import_index.DatetimeInterface,
|
|
55
|
-
boolean: import_index.BooleanInterface,
|
|
56
|
-
json: import_json_interface.JsonInterface,
|
|
57
|
-
oho: import_one_has_one_interface.OneHasOneInterface,
|
|
58
|
-
obo: import_one_belongs_to_one_interface.OneBelongsToOneInterface,
|
|
59
|
-
o2m: import_one_to_many_interface.OneToManyInterface,
|
|
60
|
-
m2o: import_many_to_one_interface.ManyToOneInterface,
|
|
61
|
-
m2m: import_many_to_many_interface.ManyToManyInterface
|
|
62
|
-
};
|
|
63
|
-
function registerInterfaces(db) {
|
|
64
|
-
for (const [interfaceName, type] of Object.entries(interfaces)) {
|
|
65
|
-
db.interfaceManager.registerInterfaceType(interfaceName, type);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
__name(registerInterfaces, "registerInterfaces");
|
|
69
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
70
|
-
0 && (module.exports = {
|
|
71
|
-
registerInterfaces
|
|
72
|
-
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import { CollectionOptions } from '../collection';
|
|
10
|
-
export declare const beforeDefineAdjacencyListCollection: (options: CollectionOptions) => void;
|