@decaf-ts/db-decorators 0.4.31 → 0.4.32
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/LICENSE.md +0 -0
- package/README.md +0 -0
- package/dist/db-decorators.js +2 -0
- package/dist/{db-decorators.bundle.min.js.LICENSE.txt → db-decorators.js.LICENSE.txt} +0 -0
- package/dist/esm/db-decorators.js +2 -0
- package/dist/esm/{db-decorators.bundle.min.esm.js.LICENSE.txt → db-decorators.js.LICENSE.txt} +0 -0
- package/{lib/esm → dist/types}/identity/decorators.d.ts +0 -0
- package/{lib/esm → dist/types}/identity/index.d.ts +0 -0
- package/{lib/esm → dist/types}/identity/utils.d.ts +0 -0
- package/{lib/esm → dist/types}/index.d.ts +0 -0
- package/{lib/esm → dist/types}/interfaces/BulkCrudOperator.d.ts +0 -0
- package/{lib/esm → dist/types}/interfaces/Contextual.d.ts +0 -0
- package/{lib/esm → dist/types}/interfaces/CrudOperator.d.ts +0 -0
- package/{lib/esm → dist/types}/interfaces/IRepository.d.ts +0 -0
- package/{lib/esm → dist/types}/interfaces/index.d.ts +0 -0
- package/{lib/esm → dist/types}/model/constants.d.ts +0 -0
- package/{lib/esm → dist/types}/model/decorators.d.ts +0 -0
- package/{lib/esm → dist/types}/model/index.d.ts +0 -0
- package/{lib/esm → dist/types}/model/model.d.ts +0 -0
- package/{lib/esm → dist/types}/model/validation.d.ts +0 -0
- package/{lib/esm → dist/types}/operations/Operations.d.ts +0 -0
- package/{lib/esm → dist/types}/operations/OperationsRegistry.d.ts +0 -0
- package/{lib/esm → dist/types}/operations/constants.d.ts +0 -0
- package/{lib/esm → dist/types}/operations/decorators.d.ts +0 -0
- package/{lib/esm → dist/types}/operations/index.d.ts +0 -0
- package/{lib/esm → dist/types}/operations/types.d.ts +0 -0
- package/{lib/esm → dist/types}/repository/BaseRepository.d.ts +0 -0
- package/{lib/esm → dist/types}/repository/Context.d.ts +0 -0
- package/{lib/esm → dist/types}/repository/DataCache.d.ts +0 -0
- package/{lib/esm → dist/types}/repository/Repository.d.ts +0 -0
- package/{lib/esm → dist/types}/repository/errors.d.ts +0 -0
- package/{lib/esm → dist/types}/repository/index.d.ts +0 -0
- package/{lib/esm → dist/types}/repository/utils.d.ts +0 -0
- package/{lib/esm → dist/types}/repository/wrappers.d.ts +0 -0
- package/{lib/esm → dist/types}/validation/constants.d.ts +0 -0
- package/{lib/esm → dist/types}/validation/decorators.d.ts +0 -0
- package/{lib/esm → dist/types}/validation/index.d.ts +0 -0
- package/{lib/esm → dist/types}/validation/validation.d.ts +1 -1
- package/{lib/esm → dist/types}/validation/validators/ReadOnlyValidator.d.ts +0 -0
- package/{lib/esm → dist/types}/validation/validators/TimestampValidator.d.ts +0 -0
- package/{lib/esm → dist/types}/validation/validators/UpdateValidator.d.ts +0 -0
- package/{lib/esm → dist/types}/validation/validators/index.d.ts +0 -0
- package/lib/esm/identity/decorators.js +0 -0
- package/lib/esm/identity/index.js +0 -0
- package/lib/esm/identity/utils.js +0 -0
- package/lib/esm/index.js +0 -0
- package/lib/esm/interfaces/BulkCrudOperator.js +0 -0
- package/lib/esm/interfaces/Contextual.js +0 -0
- package/lib/esm/interfaces/CrudOperator.js +0 -0
- package/lib/esm/interfaces/IRepository.js +0 -0
- package/lib/esm/interfaces/index.js +0 -0
- package/lib/esm/model/constants.js +0 -0
- package/lib/esm/model/decorators.js +0 -0
- package/lib/esm/model/index.js +0 -0
- package/lib/esm/model/model.js +0 -0
- package/lib/esm/model/validation.js +0 -0
- package/lib/esm/operations/Operations.js +0 -0
- package/lib/esm/operations/OperationsRegistry.js +0 -0
- package/lib/esm/operations/constants.js +0 -0
- package/lib/esm/operations/decorators.js +0 -0
- package/lib/esm/operations/index.js +0 -0
- package/lib/esm/operations/types.js +0 -0
- package/lib/esm/repository/BaseRepository.js +0 -0
- package/lib/esm/repository/Context.js +0 -0
- package/lib/esm/repository/DataCache.js +0 -0
- package/lib/esm/repository/Repository.js +0 -0
- package/lib/esm/repository/errors.js +0 -0
- package/lib/esm/repository/index.js +0 -0
- package/lib/esm/repository/utils.js +0 -0
- package/lib/esm/repository/wrappers.js +0 -0
- package/lib/esm/validation/constants.js +0 -0
- package/lib/esm/validation/decorators.js +0 -0
- package/lib/esm/validation/index.js +0 -0
- package/lib/esm/validation/validation.js +1 -1
- package/lib/esm/validation/validators/ReadOnlyValidator.js +0 -0
- package/lib/esm/validation/validators/TimestampValidator.js +0 -0
- package/lib/esm/validation/validators/UpdateValidator.js +0 -0
- package/lib/esm/validation/validators/index.js +0 -0
- package/lib/identity/decorators.cjs +2 -0
- package/lib/identity/index.cjs +2 -0
- package/lib/identity/utils.cjs +2 -0
- package/lib/index.cjs +2 -0
- package/lib/interfaces/BulkCrudOperator.cjs +2 -0
- package/lib/interfaces/Contextual.cjs +2 -0
- package/lib/interfaces/CrudOperator.cjs +2 -0
- package/lib/interfaces/IRepository.cjs +2 -0
- package/lib/interfaces/index.cjs +2 -0
- package/lib/model/constants.cjs +2 -0
- package/lib/model/decorators.cjs +2 -0
- package/lib/model/index.cjs +2 -0
- package/lib/model/model.cjs +2 -0
- package/lib/model/validation.cjs +2 -0
- package/lib/operations/Operations.cjs +2 -0
- package/lib/operations/OperationsRegistry.cjs +2 -0
- package/lib/operations/constants.cjs +2 -0
- package/lib/operations/decorators.cjs +2 -0
- package/lib/operations/index.cjs +2 -0
- package/lib/operations/types.cjs +2 -0
- package/lib/repository/BaseRepository.cjs +2 -0
- package/lib/repository/Context.cjs +2 -0
- package/lib/repository/DataCache.cjs +2 -0
- package/lib/repository/Repository.cjs +2 -0
- package/lib/repository/errors.cjs +2 -0
- package/lib/repository/index.cjs +2 -0
- package/lib/repository/utils.cjs +2 -0
- package/lib/repository/wrappers.cjs +2 -0
- package/lib/validation/constants.cjs +2 -0
- package/lib/validation/decorators.cjs +2 -0
- package/lib/validation/index.cjs +2 -0
- package/lib/validation/validation.cjs +2 -0
- package/lib/validation/validators/ReadOnlyValidator.cjs +2 -0
- package/lib/validation/validators/TimestampValidator.cjs +2 -0
- package/lib/validation/validators/UpdateValidator.cjs +2 -0
- package/lib/validation/validators/index.cjs +2 -0
- package/package.json +27 -16
- package/dist/db-decorators.bundle.min.js +0 -2
- package/dist/esm/db-decorators.bundle.min.esm.js +0 -2
- package/lib/identity/decorators.d.ts +0 -1
- package/lib/identity/index.d.ts +0 -2
- package/lib/identity/utils.d.ts +0 -34
- package/lib/index.d.ts +0 -33
- package/lib/interfaces/BulkCrudOperator.d.ts +0 -7
- package/lib/interfaces/Contextual.d.ts +0 -6
- package/lib/interfaces/CrudOperator.d.ts +0 -42
- package/lib/interfaces/IRepository.d.ts +0 -11
- package/lib/interfaces/index.d.ts +0 -4
- package/lib/model/constants.d.ts +0 -37
- package/lib/model/decorators.d.ts +0 -50
- package/lib/model/index.d.ts +0 -4
- package/lib/model/model.d.ts +0 -112
- package/lib/model/validation.d.ts +0 -14
- package/lib/operations/Operations.d.ts +0 -19
- package/lib/operations/OperationsRegistry.d.ts +0 -34
- package/lib/operations/constants.d.ts +0 -24
- package/lib/operations/decorators.d.ts +0 -193
- package/lib/operations/index.d.ts +0 -5
- package/lib/operations/types.d.ts +0 -29
- package/lib/repository/BaseRepository.d.ts +0 -36
- package/lib/repository/Context.d.ts +0 -17
- package/lib/repository/DataCache.d.ts +0 -9
- package/lib/repository/Repository.d.ts +0 -10
- package/lib/repository/errors.d.ts +0 -69
- package/lib/repository/index.d.ts +0 -7
- package/lib/repository/utils.d.ts +0 -62
- package/lib/repository/wrappers.d.ts +0 -38
- package/lib/validation/constants.d.ts +0 -30
- package/lib/validation/decorators.d.ts +0 -58
- package/lib/validation/index.d.ts +0 -4
- package/lib/validation/validation.d.ts +0 -41
- package/lib/validation/validators/ReadOnlyValidator.d.ts +0 -23
- package/lib/validation/validators/TimestampValidator.d.ts +0 -14
- package/lib/validation/validators/UpdateValidator.d.ts +0 -23
- package/lib/validation/validators/index.d.ts +0 -3
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { Validator, IValidatorRegistry, ValidatorDefinition } from "@decaf-ts/decorator-validation";
|
|
2
|
-
declare module "@decaf-ts/decorator-validation" {
|
|
3
|
-
class Validation {
|
|
4
|
-
private static actingValidatorRegistry?;
|
|
5
|
-
private constructor();
|
|
6
|
-
/**
|
|
7
|
-
* @summary Defines the acting ValidatorRegistry
|
|
8
|
-
*
|
|
9
|
-
* @param {IValidatorRegistry} validatorRegistry the new implementation of the validator Registry
|
|
10
|
-
* @param {function(Validator): Validator} [migrationHandler] the method to map the validator if required;
|
|
11
|
-
*/
|
|
12
|
-
static setRegistry(validatorRegistry: IValidatorRegistry<Validator>, migrationHandler?: (validator: Validator) => Validator): void;
|
|
13
|
-
/**
|
|
14
|
-
* @summary Returns the current ValidatorRegistry
|
|
15
|
-
*
|
|
16
|
-
* @return IValidatorRegistry, defaults to {@link ValidatorRegistry}
|
|
17
|
-
*/
|
|
18
|
-
private static getRegistry;
|
|
19
|
-
/**
|
|
20
|
-
* @summary Retrieves a validator
|
|
21
|
-
*
|
|
22
|
-
* @param {string} validatorKey one of the {@link ValidationKeys}
|
|
23
|
-
* @return {Validator | undefined} the registered Validator or undefined if there is nono matching the provided key
|
|
24
|
-
*/
|
|
25
|
-
static get<T extends Validator>(validatorKey: string): T | undefined;
|
|
26
|
-
/**
|
|
27
|
-
* @summary Registers the provided validators onto the registry
|
|
28
|
-
*
|
|
29
|
-
* @param {T[] | ValidatorDefinition[]} validator
|
|
30
|
-
*/
|
|
31
|
-
static register<T extends Validator>(...validator: (ValidatorDefinition | T)[]): void;
|
|
32
|
-
/**
|
|
33
|
-
* @summary Builds the key to store as Metadata under Reflections
|
|
34
|
-
* @description concatenates {@link ValidationKeys#REFLECT} with the provided key
|
|
35
|
-
*
|
|
36
|
-
* @param {string} key
|
|
37
|
-
*/
|
|
38
|
-
static key(key: string): string;
|
|
39
|
-
static updateKey(key: string): string;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Validator } from "@decaf-ts/decorator-validation";
|
|
2
|
-
/**
|
|
3
|
-
* @summary Validator for the {@link readonly} decorator
|
|
4
|
-
*
|
|
5
|
-
* @class ReadOnlyValidator
|
|
6
|
-
* @extends Validator
|
|
7
|
-
*
|
|
8
|
-
* @category Validators
|
|
9
|
-
*/
|
|
10
|
-
export declare class ReadOnlyValidator extends Validator {
|
|
11
|
-
constructor();
|
|
12
|
-
/**
|
|
13
|
-
* @inheritDoc
|
|
14
|
-
*/
|
|
15
|
-
hasErrors(value: any, ...args: any[]): string | undefined;
|
|
16
|
-
/**
|
|
17
|
-
* @summary Validates a value has not changed
|
|
18
|
-
* @param {any} value
|
|
19
|
-
* @param {any} oldValue
|
|
20
|
-
* @param {string} [message] the error message override
|
|
21
|
-
*/
|
|
22
|
-
updateHasErrors(value: any, oldValue: any, message?: string): string | undefined;
|
|
23
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Validator } from "@decaf-ts/decorator-validation";
|
|
2
|
-
/**
|
|
3
|
-
* @summary Validates the update of a timestamp
|
|
4
|
-
*
|
|
5
|
-
* @class TimestampValidator
|
|
6
|
-
* @extends Validator
|
|
7
|
-
*
|
|
8
|
-
* @category Validators
|
|
9
|
-
*/
|
|
10
|
-
export declare class TimestampValidator extends Validator {
|
|
11
|
-
constructor();
|
|
12
|
-
hasErrors(value: any, ...args: any[]): string | undefined;
|
|
13
|
-
updateHasErrors(value: Date | string | number, oldValue: Date | string | number, message?: string): string | undefined;
|
|
14
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Validator } from "@decaf-ts/decorator-validation";
|
|
2
|
-
/**
|
|
3
|
-
* @summary Base class for an Update validator
|
|
4
|
-
*
|
|
5
|
-
* @param {string} [message] error message. defaults to {@link DecoratorMessages#DEFAULT}
|
|
6
|
-
* @param {string[]} [acceptedTypes] the accepted value types by the decorator
|
|
7
|
-
*
|
|
8
|
-
* @class UpdateValidator
|
|
9
|
-
* @abstract
|
|
10
|
-
* @extends Validator
|
|
11
|
-
*
|
|
12
|
-
* @category Validators
|
|
13
|
-
*/
|
|
14
|
-
export declare abstract class UpdateValidator extends Validator {
|
|
15
|
-
protected constructor(message?: string, ...acceptedTypes: string[]);
|
|
16
|
-
/**
|
|
17
|
-
* @summary validates a value by comparing to its old version
|
|
18
|
-
* @param {any} value
|
|
19
|
-
* @param {any} oldValue
|
|
20
|
-
* @param {any[]} args
|
|
21
|
-
*/
|
|
22
|
-
abstract updateHasErrors(value: any, oldValue: any, ...args: any[]): string | undefined;
|
|
23
|
-
}
|