@hapiboo/flux 1.1.0 → 1.1.2
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/dist/application.js +12 -5
- package/dist/decorators.d.ts +1 -0
- package/dist/decorators.js +8 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -1
- package/package.json +1 -1
package/dist/application.js
CHANGED
|
@@ -119,12 +119,19 @@ var fluxApplication;
|
|
|
119
119
|
if (sCOl.info.type !== 'S' && sCOl.info.type !== 'N') {
|
|
120
120
|
throw new Error(`Index sort column '${index.sort}' in model '${source.name}' has invalid type '${sCOl.info.type}'. Only 'String' and 'Number' are allowed.`);
|
|
121
121
|
}
|
|
122
|
+
return {
|
|
123
|
+
name: index.name,
|
|
124
|
+
key: kCol.info,
|
|
125
|
+
sort: sCOl?.info
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
return {
|
|
130
|
+
name: index.name,
|
|
131
|
+
key: kCol.info,
|
|
132
|
+
sort: { name: 'id', type: 'S' }
|
|
133
|
+
};
|
|
122
134
|
}
|
|
123
|
-
return {
|
|
124
|
-
name: index.name,
|
|
125
|
-
key: kCol.info,
|
|
126
|
-
sort: sCOl?.info
|
|
127
|
-
};
|
|
128
135
|
});
|
|
129
136
|
modelCache.set(source, { table: tableName, id: '' });
|
|
130
137
|
columnCache.set(source, columnsInfo);
|
package/dist/decorators.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { FluxDBColumnExposed, FluxDBObjectCreator } from './types';
|
|
|
3
3
|
import { IFluxColumnInfo } from './interfaces';
|
|
4
4
|
export declare function FluxTable(name: string): ClassDecorator;
|
|
5
5
|
export declare function FluxIndex(name: string, key: string, sort: string | undefined): ClassDecorator;
|
|
6
|
+
export declare function FluxIndexSimple(name: string, key: string): ClassDecorator;
|
|
6
7
|
export declare function FluxIdentifier(): PropertyDecorator;
|
|
7
8
|
export declare function FluxColumn(name: string, type?: FluxDBColumnExposed): PropertyDecorator;
|
|
8
9
|
export declare function FluxColumnCalculated(name: string, type?: FluxDBColumnExposed): MethodDecorator;
|
package/dist/decorators.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.hapibooDecorators = void 0;
|
|
4
4
|
exports.FluxTable = FluxTable;
|
|
5
5
|
exports.FluxIndex = FluxIndex;
|
|
6
|
+
exports.FluxIndexSimple = FluxIndexSimple;
|
|
6
7
|
exports.FluxIdentifier = FluxIdentifier;
|
|
7
8
|
exports.FluxColumn = FluxColumn;
|
|
8
9
|
exports.FluxColumnCalculated = FluxColumnCalculated;
|
|
@@ -25,6 +26,13 @@ function FluxIndex(name, key, sort) {
|
|
|
25
26
|
Reflect.defineMetadata(META_INDEX, indexes, target);
|
|
26
27
|
};
|
|
27
28
|
}
|
|
29
|
+
function FluxIndexSimple(name, key) {
|
|
30
|
+
return target => {
|
|
31
|
+
const indexes = Reflect.getMetadata(META_INDEX, target) || [];
|
|
32
|
+
indexes.push({ name, key, sort: undefined });
|
|
33
|
+
Reflect.defineMetadata(META_INDEX, indexes, target);
|
|
34
|
+
};
|
|
35
|
+
}
|
|
28
36
|
function FluxIdentifier() {
|
|
29
37
|
return (target, key) => {
|
|
30
38
|
Reflect.defineMetadata(META_IDENTIFIER, { propertyKey: key }, target.constructor);
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IFluxIndexInfo, IFluxColumnInfo, IFluxIndexData, IFluxDataModel, IFluxDataModelDefinition, IFluxDataModelWriter, IFluxDataModelReader, IFluxDBFilter, IFluxDBCondition, IFluxDBSubCondition, IFluxObject, IFluxModule, IDBProviderFlux } from './interfaces';
|
|
2
2
|
import { FluxDBColumn, FluxDBColumnIndex, FluxDBColumnExposed, FluxDBFilterLogic, FluxDBFilterOperator, FluxDBFilterOperatorValues, FluxDBFilterOperatorCollection } from './types';
|
|
3
|
-
import { FluxTable, FluxIndex, FluxIdentifier, FluxColumn, FluxColumnCalculated } from './decorators';
|
|
3
|
+
import { FluxTable, FluxIndex, FluxIndexSimple, FluxIdentifier, FluxColumn, FluxColumnCalculated } from './decorators';
|
|
4
4
|
import { fluxApplication } from './application';
|
|
5
5
|
import { conditionBuilder } from './conditions';
|
|
6
6
|
export { FluxDBColumn, FluxDBColumnIndex, FluxDBColumnExposed };
|
|
@@ -12,4 +12,4 @@ export { IFluxObject, IFluxModule };
|
|
|
12
12
|
export { IDBProviderFlux };
|
|
13
13
|
export { conditionBuilder };
|
|
14
14
|
export { fluxApplication };
|
|
15
|
-
export { FluxTable, FluxIndex, FluxIdentifier, FluxColumn, FluxColumnCalculated };
|
|
15
|
+
export { FluxTable, FluxIndex, FluxIndexSimple, FluxIdentifier, FluxColumn, FluxColumnCalculated };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FluxColumnCalculated = exports.FluxColumn = exports.FluxIdentifier = exports.FluxIndex = exports.FluxTable = exports.fluxApplication = exports.conditionBuilder = exports.FluxDBColumnExposed = exports.FluxDBColumnIndex = exports.FluxDBColumn = void 0;
|
|
3
|
+
exports.FluxColumnCalculated = exports.FluxColumn = exports.FluxIdentifier = exports.FluxIndexSimple = exports.FluxIndex = exports.FluxTable = exports.fluxApplication = exports.conditionBuilder = exports.FluxDBColumnExposed = exports.FluxDBColumnIndex = exports.FluxDBColumn = void 0;
|
|
4
4
|
const types_1 = require("./types");
|
|
5
5
|
Object.defineProperty(exports, "FluxDBColumn", { enumerable: true, get: function () { return types_1.FluxDBColumn; } });
|
|
6
6
|
Object.defineProperty(exports, "FluxDBColumnIndex", { enumerable: true, get: function () { return types_1.FluxDBColumnIndex; } });
|
|
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "FluxDBColumnExposed", { enumerable: true, get: f
|
|
|
8
8
|
const decorators_1 = require("./decorators");
|
|
9
9
|
Object.defineProperty(exports, "FluxTable", { enumerable: true, get: function () { return decorators_1.FluxTable; } });
|
|
10
10
|
Object.defineProperty(exports, "FluxIndex", { enumerable: true, get: function () { return decorators_1.FluxIndex; } });
|
|
11
|
+
Object.defineProperty(exports, "FluxIndexSimple", { enumerable: true, get: function () { return decorators_1.FluxIndexSimple; } });
|
|
11
12
|
Object.defineProperty(exports, "FluxIdentifier", { enumerable: true, get: function () { return decorators_1.FluxIdentifier; } });
|
|
12
13
|
Object.defineProperty(exports, "FluxColumn", { enumerable: true, get: function () { return decorators_1.FluxColumn; } });
|
|
13
14
|
Object.defineProperty(exports, "FluxColumnCalculated", { enumerable: true, get: function () { return decorators_1.FluxColumnCalculated; } });
|