@itrocks/framework 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/dependencies.js
CHANGED
|
@@ -24,7 +24,6 @@ const password_1 = require("@itrocks/password");
|
|
|
24
24
|
const transformers_1 = require("@itrocks/password/transformers");
|
|
25
25
|
const property_translate_1 = require("@itrocks/property-translate");
|
|
26
26
|
const transformers_2 = require("@itrocks/property-translate/transformers");
|
|
27
|
-
const property_type_1 = require("@itrocks/property-type");
|
|
28
27
|
const property_view_1 = require("@itrocks/property-view");
|
|
29
28
|
const property_view_2 = require("@itrocks/property-view");
|
|
30
29
|
const rename_1 = require("@itrocks/rename");
|
|
@@ -53,6 +52,9 @@ const sql_join_dependencies_2 = require("./sql-join-dependencies");
|
|
|
53
52
|
const sql_join_dependencies_3 = require("./sql-join-dependencies");
|
|
54
53
|
const sql_join_dependencies_4 = require("./sql-join-dependencies");
|
|
55
54
|
const sql_join_dependencies_5 = require("./sql-join-dependencies");
|
|
55
|
+
const sql_join_dependencies_6 = require("./sql-join-dependencies");
|
|
56
|
+
const sql_join_dependencies_7 = require("./sql-join-dependencies");
|
|
57
|
+
const sql_join_dependencies_8 = require("./sql-join-dependencies");
|
|
56
58
|
async function propertyOutput(object, property) {
|
|
57
59
|
return (0, transformer_1.applyTransformer)(await object[property], object, property, transformer_2.HTML, transformer_3.OUTPUT);
|
|
58
60
|
}
|
|
@@ -110,26 +112,25 @@ function bind() {
|
|
|
110
112
|
(0, property_translate_1.propertyTranslateDependsOn)({
|
|
111
113
|
setTransformers: transformers_2.setPropertyTranslateTransformers
|
|
112
114
|
});
|
|
113
|
-
(0, store_1.storeDependsOn)({
|
|
114
|
-
setTransformers: core_transformers_2.initStoreTransformers,
|
|
115
|
-
toStoreName: rename_1.toColumn
|
|
116
|
-
});
|
|
117
115
|
(0, sql_join_1.sqlJoinDependsOn)({
|
|
118
|
-
columnDefinitionOf:
|
|
119
|
-
columnDefinitionsOf:
|
|
120
|
-
columnOf:
|
|
121
|
-
componentOf:
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
116
|
+
columnDefinitionOf: sql_join_dependencies_1.columnDefinitionOf,
|
|
117
|
+
columnDefinitionsOf: sql_join_dependencies_2.columnDefinitionsOf,
|
|
118
|
+
columnOf: sql_join_dependencies_3.columnOf,
|
|
119
|
+
componentOf: composition_1.componentOf,
|
|
120
|
+
isCollection: sql_join_dependencies_4.isCollection,
|
|
121
|
+
isScalar: sql_join_dependencies_5.isScalar,
|
|
122
|
+
requiredOf: required_1.requiredOf,
|
|
123
|
+
rightColumnDefinitionOf: sql_join_dependencies_6.rightColumnDefinitionOf,
|
|
126
124
|
storedAsValueOf: columnDefinition => {
|
|
127
|
-
const tableDefinition = (0,
|
|
125
|
+
const tableDefinition = (0, sql_join_dependencies_7.tableDefinitionOf)(columnDefinition);
|
|
128
126
|
return !!tableDefinition && !(0, store_2.storeOf)(tableDefinition);
|
|
129
127
|
},
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
128
|
+
tableDefinitionOf: sql_join_dependencies_7.tableDefinitionOf,
|
|
129
|
+
tableOf: sql_join_dependencies_8.tableOf
|
|
130
|
+
});
|
|
131
|
+
(0, store_1.storeDependsOn)({
|
|
132
|
+
setTransformers: core_transformers_2.initStoreTransformers,
|
|
133
|
+
toStoreName: rename_1.toColumn
|
|
133
134
|
});
|
|
134
135
|
(0, template_1.templateDependsOn)({
|
|
135
136
|
toString: async (data) => (((typeof data)[0] === 'o') && (data.toString === Object.prototype.toString))
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { Type } from '@itrocks/class-type';
|
|
2
2
|
import { ReflectProperty } from './reflect-property';
|
|
3
3
|
export type ColumnDefinition = ReflectProperty<any, any>;
|
|
4
|
-
export type TableDefinition = Type
|
|
4
|
+
export type TableDefinition = Type<any>;
|
|
5
|
+
export declare function columnDefinitionOf(tableDefinition: TableDefinition, column: string): ColumnDefinition | undefined;
|
|
5
6
|
export declare function columnDefinitionsOf(tableDefinition: TableDefinition): Record<string, ColumnDefinition>;
|
|
6
7
|
export declare function columnOf(columnDefinition: ColumnDefinition): string;
|
|
8
|
+
export declare function isCollection(columnDefinition: ColumnDefinition): boolean;
|
|
9
|
+
export declare function isScalar(columnDefinition: ColumnDefinition): boolean;
|
|
7
10
|
export declare function rightColumnDefinitionOf(columnDefinition: ColumnDefinition): ColumnDefinition | undefined;
|
|
8
11
|
export declare function tableDefinitionOf(columnDefinition: ColumnDefinition): TableDefinition | undefined;
|
|
9
12
|
export declare function tableOf(tableDefinition: TableDefinition): string;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.columnDefinitionOf = columnDefinitionOf;
|
|
3
4
|
exports.columnDefinitionsOf = columnDefinitionsOf;
|
|
4
5
|
exports.columnOf = columnOf;
|
|
6
|
+
exports.isCollection = isCollection;
|
|
7
|
+
exports.isScalar = isScalar;
|
|
5
8
|
exports.rightColumnDefinitionOf = rightColumnDefinitionOf;
|
|
6
9
|
exports.tableDefinitionOf = tableDefinitionOf;
|
|
7
10
|
exports.tableOf = tableOf;
|
|
@@ -12,6 +15,9 @@ const property_type_1 = require("@itrocks/property-type");
|
|
|
12
15
|
const rename_1 = require("@itrocks/rename");
|
|
13
16
|
const store_1 = require("@itrocks/store");
|
|
14
17
|
const reflect_class_1 = require("./reflect-class");
|
|
18
|
+
function columnDefinitionOf(tableDefinition, column) {
|
|
19
|
+
return columnDefinitionsOf(tableDefinition)[column];
|
|
20
|
+
}
|
|
15
21
|
function columnDefinitionsOf(tableDefinition) {
|
|
16
22
|
return new reflect_class_1.ReflectClass(tableDefinition).property;
|
|
17
23
|
}
|
|
@@ -22,6 +28,12 @@ function columnOf(columnDefinition) {
|
|
|
22
28
|
: columnDefinition.name;
|
|
23
29
|
return (0, rename_1.toColumn)(property);
|
|
24
30
|
}
|
|
31
|
+
function isCollection(columnDefinition) {
|
|
32
|
+
return columnDefinition.type instanceof property_type_1.CollectionType;
|
|
33
|
+
}
|
|
34
|
+
function isScalar(columnDefinition) {
|
|
35
|
+
return tableDefinitionOf(columnDefinition) === undefined;
|
|
36
|
+
}
|
|
25
37
|
function rightColumnDefinitionOf(columnDefinition) {
|
|
26
38
|
const leftTableDefinition = columnDefinition.class.type;
|
|
27
39
|
const rightTableDefinition = tableDefinitionOf(columnDefinition);
|
package/package.json
CHANGED