framework-do-dede 1.0.37 → 1.0.39
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.
|
@@ -7,6 +7,6 @@ export declare function Expose(configOrMapping: ExposeConfig | string): Property
|
|
|
7
7
|
export declare function VirtualProperty(propertyName: string): (target: any, methodName: string, descriptor: PropertyDescriptor) => void;
|
|
8
8
|
export type DbColumnConfig<T = any> = {
|
|
9
9
|
column?: string | Record<string, string>;
|
|
10
|
-
serialize?: (value: T) => any | Promise<any>;
|
|
10
|
+
serialize?: (value: T, data: any) => any | Promise<any>;
|
|
11
11
|
};
|
|
12
12
|
export declare function DbColumn<T>(configOrColumn: DbColumnConfig<T> | string): PropertyDecorator;
|
|
@@ -48,7 +48,7 @@ export function DbColumn(configOrColumn) {
|
|
|
48
48
|
...(configs.get(propertyKey) || []),
|
|
49
49
|
{
|
|
50
50
|
column: configOrColumn,
|
|
51
|
-
serialize: (value) => value
|
|
51
|
+
serialize: (value, ctor) => value
|
|
52
52
|
}
|
|
53
53
|
]);
|
|
54
54
|
}
|
|
@@ -57,7 +57,7 @@ export function DbColumn(configOrColumn) {
|
|
|
57
57
|
...(configs.get(propertyKey) || []),
|
|
58
58
|
{
|
|
59
59
|
column: configOrColumn.column,
|
|
60
|
-
serialize: configOrColumn.serialize || ((value) => value)
|
|
60
|
+
serialize: configOrColumn.serialize || ((value, ctor) => value)
|
|
61
61
|
}
|
|
62
62
|
]);
|
|
63
63
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Registry } from "../di/registry";
|
|
2
|
-
import { StorageGateway } from "../protocols/StorageGateway";
|
|
3
2
|
export function Storage(gatewayName) {
|
|
4
3
|
return function (target, propertyKey) {
|
|
5
4
|
const instanceSymbol = Symbol();
|
|
@@ -11,7 +10,7 @@ export function Storage(gatewayName) {
|
|
|
11
10
|
throw new Error(`StorageGateway ${gatewayName} not registered`);
|
|
12
11
|
}
|
|
13
12
|
const GatewayClass = Registry.resolve(gatewayName);
|
|
14
|
-
if (!
|
|
13
|
+
if (!GatewayClass.save || !GatewayClass.get || !GatewayClass.delete) {
|
|
15
14
|
throw new Error(`${gatewayName} is not a valid StorageGateway`);
|
|
16
15
|
}
|
|
17
16
|
this[instanceSymbol] = GatewayClass;
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
save(file, path) {
|
|
3
|
-
throw new Error(this.constructor.name + ' save method not implemented');
|
|
4
|
-
}
|
|
5
|
-
get(key) {
|
|
6
|
-
throw new Error(this.constructor.name + ' get method not implemented');
|
|
7
|
-
}
|
|
8
|
-
delete(key) {
|
|
9
|
-
throw new Error(this.constructor.name + ' delete method not implemented');
|
|
10
|
-
}
|
|
11
|
-
}
|
|
1
|
+
export {};
|