@decaf-ts/core 0.5.1 → 0.5.3
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 +21 -157
- package/README.md +652 -15
- package/dist/core.cjs +2111 -133
- package/dist/core.esm.cjs +2112 -134
- package/lib/esm/identity/decorators.d.ts +52 -7
- package/lib/esm/identity/decorators.js +58 -13
- package/lib/esm/identity/index.js +3 -3
- package/lib/esm/identity/utils.d.ts +19 -0
- package/lib/esm/identity/utils.js +22 -3
- package/lib/esm/index.d.ts +10 -3
- package/lib/esm/index.js +19 -12
- package/lib/esm/interfaces/ErrorParser.d.ts +12 -0
- package/lib/esm/interfaces/ErrorParser.js +1 -1
- package/lib/esm/interfaces/Executor.d.ts +13 -0
- package/lib/esm/interfaces/Executor.js +1 -1
- package/lib/esm/interfaces/Observable.d.ts +27 -0
- package/lib/esm/interfaces/Observable.js +1 -1
- package/lib/esm/interfaces/Observer.d.ts +12 -0
- package/lib/esm/interfaces/Observer.js +1 -1
- package/lib/esm/interfaces/Paginatable.d.ts +15 -0
- package/lib/esm/interfaces/Paginatable.js +1 -1
- package/lib/esm/interfaces/Queriable.d.ts +34 -9
- package/lib/esm/interfaces/Queriable.js +1 -1
- package/lib/esm/interfaces/RawExecutor.d.ts +14 -0
- package/lib/esm/interfaces/RawExecutor.js +1 -1
- package/lib/esm/interfaces/SequenceOptions.d.ts +52 -0
- package/lib/esm/interfaces/SequenceOptions.js +19 -1
- package/lib/esm/interfaces/index.js +8 -8
- package/lib/esm/model/BaseModel.d.ts +31 -0
- package/lib/esm/model/BaseModel.js +24 -1
- package/lib/esm/model/construction.d.ts +433 -0
- package/lib/esm/model/construction.js +444 -5
- package/lib/esm/model/decorators.d.ts +159 -29
- package/lib/esm/model/decorators.js +167 -37
- package/lib/esm/model/index.js +5 -5
- package/lib/esm/model/types.d.ts +9 -0
- package/lib/esm/model/types.js +1 -1
- package/lib/esm/persistence/Adapter.d.ts +358 -17
- package/lib/esm/persistence/Adapter.js +292 -24
- package/lib/esm/persistence/Dispatch.d.ts +114 -1
- package/lib/esm/persistence/Dispatch.js +104 -6
- package/lib/esm/persistence/ObserverHandler.d.ts +95 -0
- package/lib/esm/persistence/ObserverHandler.js +96 -1
- package/lib/esm/persistence/Sequence.d.ts +89 -0
- package/lib/esm/persistence/Sequence.js +71 -2
- package/lib/esm/persistence/constants.d.ts +22 -0
- package/lib/esm/persistence/constants.js +23 -1
- package/lib/esm/persistence/decorators.d.ts +10 -0
- package/lib/esm/persistence/decorators.js +13 -3
- package/lib/esm/persistence/errors.d.ts +23 -0
- package/lib/esm/persistence/errors.js +24 -1
- package/lib/esm/persistence/index.js +9 -9
- package/lib/esm/persistence/types.d.ts +18 -0
- package/lib/esm/persistence/types.js +1 -1
- package/lib/esm/query/Condition.d.ts +78 -31
- package/lib/esm/query/Condition.js +134 -55
- package/lib/esm/query/Paginator.d.ts +56 -0
- package/lib/esm/query/Paginator.js +58 -2
- package/lib/esm/query/Statement.d.ts +51 -0
- package/lib/esm/query/Statement.js +55 -4
- package/lib/esm/query/constants.d.ts +25 -0
- package/lib/esm/query/constants.js +26 -1
- package/lib/esm/query/errors.d.ts +14 -0
- package/lib/esm/query/errors.js +15 -1
- package/lib/esm/query/index.js +8 -8
- package/lib/esm/query/options.d.ts +21 -3
- package/lib/esm/query/options.js +1 -1
- package/lib/esm/query/selectors.d.ts +26 -0
- package/lib/esm/query/selectors.js +1 -1
- package/lib/esm/ram/RamAdapter.d.ts +311 -0
- package/lib/esm/ram/RamAdapter.js +319 -8
- package/lib/esm/ram/RamContext.d.ts +16 -1
- package/lib/esm/ram/RamContext.js +18 -3
- package/lib/esm/ram/RamPaginator.d.ts +43 -0
- package/lib/esm/ram/RamPaginator.js +55 -3
- package/lib/esm/ram/RamSequence.d.ts +61 -0
- package/lib/esm/ram/RamSequence.js +66 -5
- package/lib/esm/ram/RamStatement.d.ts +74 -0
- package/lib/esm/ram/RamStatement.js +78 -4
- package/lib/esm/ram/constants.d.ts +8 -0
- package/lib/esm/ram/constants.js +9 -1
- package/lib/esm/ram/handlers.d.ts +19 -0
- package/lib/esm/ram/handlers.js +21 -2
- package/lib/esm/ram/index.js +11 -11
- package/lib/esm/ram/model/RamSequence.d.ts +25 -0
- package/lib/esm/ram/model/RamSequence.js +21 -3
- package/lib/esm/ram/model/index.js +2 -2
- package/lib/esm/ram/types.d.ts +42 -0
- package/lib/esm/ram/types.js +1 -1
- package/lib/esm/repository/Repository.d.ts +363 -8
- package/lib/esm/repository/Repository.js +369 -24
- package/lib/esm/repository/constants.d.ts +25 -0
- package/lib/esm/repository/constants.js +26 -1
- package/lib/esm/repository/decorators.d.ts +27 -0
- package/lib/esm/repository/decorators.js +29 -2
- package/lib/esm/repository/errors.d.ts +12 -5
- package/lib/esm/repository/errors.js +13 -6
- package/lib/esm/repository/index.js +8 -8
- package/lib/esm/repository/injectables.d.ts +18 -0
- package/lib/esm/repository/injectables.js +23 -5
- package/lib/esm/repository/types.d.ts +15 -0
- package/lib/esm/repository/types.js +1 -1
- package/lib/esm/repository/utils.d.ts +11 -0
- package/lib/esm/repository/utils.js +15 -4
- package/lib/esm/utils/decorators.d.ts +8 -0
- package/lib/esm/utils/decorators.js +9 -1
- package/lib/esm/utils/errors.d.ts +46 -0
- package/lib/esm/utils/errors.js +47 -1
- package/lib/esm/utils/index.js +3 -3
- package/lib/identity/decorators.cjs +53 -8
- package/lib/identity/decorators.d.ts +52 -7
- package/lib/identity/utils.cjs +20 -1
- package/lib/identity/utils.d.ts +19 -0
- package/lib/index.cjs +11 -4
- package/lib/index.d.ts +10 -3
- package/lib/interfaces/ErrorParser.cjs +1 -1
- package/lib/interfaces/ErrorParser.d.ts +12 -0
- package/lib/interfaces/Executor.cjs +1 -1
- package/lib/interfaces/Executor.d.ts +13 -0
- package/lib/interfaces/Observable.cjs +1 -1
- package/lib/interfaces/Observable.d.ts +27 -0
- package/lib/interfaces/Observer.cjs +1 -1
- package/lib/interfaces/Observer.d.ts +12 -0
- package/lib/interfaces/Paginatable.cjs +1 -1
- package/lib/interfaces/Paginatable.d.ts +15 -0
- package/lib/interfaces/Queriable.cjs +1 -1
- package/lib/interfaces/Queriable.d.ts +34 -9
- package/lib/interfaces/RawExecutor.cjs +1 -1
- package/lib/interfaces/RawExecutor.d.ts +14 -0
- package/lib/interfaces/SequenceOptions.cjs +19 -1
- package/lib/interfaces/SequenceOptions.d.ts +52 -0
- package/lib/model/BaseModel.cjs +24 -1
- package/lib/model/BaseModel.d.ts +31 -0
- package/lib/model/construction.cjs +441 -2
- package/lib/model/construction.d.ts +433 -0
- package/lib/model/decorators.cjs +160 -30
- package/lib/model/decorators.d.ts +159 -29
- package/lib/model/types.cjs +1 -1
- package/lib/model/types.d.ts +9 -0
- package/lib/persistence/Adapter.cjs +287 -19
- package/lib/persistence/Adapter.d.ts +358 -17
- package/lib/persistence/Dispatch.cjs +102 -4
- package/lib/persistence/Dispatch.d.ts +114 -1
- package/lib/persistence/ObserverHandler.cjs +96 -1
- package/lib/persistence/ObserverHandler.d.ts +95 -0
- package/lib/persistence/Sequence.cjs +70 -1
- package/lib/persistence/Sequence.d.ts +89 -0
- package/lib/persistence/constants.cjs +23 -1
- package/lib/persistence/constants.d.ts +22 -0
- package/lib/persistence/decorators.cjs +11 -1
- package/lib/persistence/decorators.d.ts +10 -0
- package/lib/persistence/errors.cjs +24 -1
- package/lib/persistence/errors.d.ts +23 -0
- package/lib/persistence/types.cjs +1 -1
- package/lib/persistence/types.d.ts +18 -0
- package/lib/query/Condition.cjs +132 -53
- package/lib/query/Condition.d.ts +78 -31
- package/lib/query/Paginator.cjs +57 -1
- package/lib/query/Paginator.d.ts +56 -0
- package/lib/query/Statement.cjs +52 -1
- package/lib/query/Statement.d.ts +51 -0
- package/lib/query/constants.cjs +26 -1
- package/lib/query/constants.d.ts +25 -0
- package/lib/query/errors.cjs +15 -1
- package/lib/query/errors.d.ts +14 -0
- package/lib/query/options.cjs +1 -1
- package/lib/query/options.d.ts +21 -3
- package/lib/query/selectors.cjs +1 -1
- package/lib/query/selectors.d.ts +26 -0
- package/lib/ram/RamAdapter.cjs +312 -1
- package/lib/ram/RamAdapter.d.ts +311 -0
- package/lib/ram/RamContext.cjs +18 -3
- package/lib/ram/RamContext.d.ts +16 -1
- package/lib/ram/RamPaginator.cjs +54 -2
- package/lib/ram/RamPaginator.d.ts +43 -0
- package/lib/ram/RamSequence.cjs +63 -2
- package/lib/ram/RamSequence.d.ts +61 -0
- package/lib/ram/RamStatement.cjs +75 -1
- package/lib/ram/RamStatement.d.ts +74 -0
- package/lib/ram/constants.cjs +9 -1
- package/lib/ram/constants.d.ts +8 -0
- package/lib/ram/handlers.cjs +20 -1
- package/lib/ram/handlers.d.ts +19 -0
- package/lib/ram/model/RamSequence.cjs +19 -1
- package/lib/ram/model/RamSequence.d.ts +25 -0
- package/lib/ram/types.cjs +1 -1
- package/lib/ram/types.d.ts +42 -0
- package/lib/repository/Repository.cjs +360 -15
- package/lib/repository/Repository.d.ts +363 -8
- package/lib/repository/constants.cjs +26 -1
- package/lib/repository/constants.d.ts +25 -0
- package/lib/repository/decorators.cjs +28 -1
- package/lib/repository/decorators.d.ts +27 -0
- package/lib/repository/errors.cjs +13 -6
- package/lib/repository/errors.d.ts +12 -5
- package/lib/repository/injectables.cjs +19 -1
- package/lib/repository/injectables.d.ts +18 -0
- package/lib/repository/types.cjs +1 -1
- package/lib/repository/types.d.ts +15 -0
- package/lib/repository/utils.cjs +12 -1
- package/lib/repository/utils.d.ts +11 -0
- package/lib/utils/decorators.cjs +9 -1
- package/lib/utils/decorators.d.ts +8 -0
- package/lib/utils/errors.cjs +47 -1
- package/lib/utils/errors.d.ts +46 -0
- package/package.json +5 -5
@@ -1,7 +1,32 @@
|
|
1
1
|
import type { ModelArg } from "@decaf-ts/decorator-validation";
|
2
2
|
import { BaseModel } from "../../model";
|
3
|
+
/**
|
4
|
+
* @description RAM sequence model for auto-incrementing values
|
5
|
+
* @summary A model class that represents a sequence in the RAM adapter. It stores the current value
|
6
|
+
* of a sequence that can be used for generating sequential identifiers for entities.
|
7
|
+
* The sequence is identified by its ID and maintains the current value.
|
8
|
+
* @param {ModelArg<Sequence>} seq - Initial sequence data
|
9
|
+
* @class Sequence
|
10
|
+
* @category Ram
|
11
|
+
* @example
|
12
|
+
* ```typescript
|
13
|
+
* // Create a new sequence
|
14
|
+
* const orderSequence = new Sequence({ id: 'order_seq', current: 1 });
|
15
|
+
*
|
16
|
+
* // Use the sequence to get the next value
|
17
|
+
* const nextOrderId = parseInt(orderSequence.current.toString()) + 1;
|
18
|
+
* orderSequence.current = nextOrderId;
|
19
|
+
* ```
|
20
|
+
*/
|
3
21
|
export declare class Sequence extends BaseModel {
|
22
|
+
/**
|
23
|
+
* @description Primary key identifier for the sequence
|
24
|
+
*/
|
4
25
|
id: string;
|
26
|
+
/**
|
27
|
+
* @description Current value of the sequence
|
28
|
+
* Used to generate the next sequential value
|
29
|
+
*/
|
5
30
|
current: string | number;
|
6
31
|
constructor(seq?: ModelArg<Sequence>);
|
7
32
|
}
|
package/lib/ram/types.cjs
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
//# sourceMappingURL=data:application/json;base64,
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvcmFtL3R5cGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBDb25zdHJ1Y3RvciwgTW9kZWwgfSBmcm9tIFwiQGRlY2FmLXRzL2RlY29yYXRvci12YWxpZGF0aW9uXCI7XG5pbXBvcnQgeyBSZXBvc2l0b3J5IH0gZnJvbSBcIi4uL3JlcG9zaXRvcnlcIjtcbmltcG9ydCB7IENvbnRleHQ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GFuZCBjb250ZXh0IHR5cGVzLlxuICogQHRlbXBsYXRlIE0gLSBUaGUgbW9kZWwgdHlwZSBtYW5hZ2VkIGJ5IHRoZSByZXBvc2l0b3J5XG4gKiBAdHlwZWRlZiB7UmVwb3NpdG9yeTxNLCBSYXdSYW1RdWVyeTxhbnk+LCBSYW1BZGFwdGVyLCBSYW1GbGFncywgQ29udGV4dDxSYW1GbGFncz4+fSBSYW1SZXBvc2l0b3J5XG4gKiBAbWVtYmVyT2YgbW9kdWxlOmNvcmVcbiAqIEBjYXRlZ29yeSBSYW1cbiAqL1xuZXhwb3J0IHR5cGUgUmFtUmVwb3NpdG9yeTxNIGV4dGVuZHMgTW9kZWw+ID0gUmVwb3NpdG9yeTxcbiAgTSxcbiAgUmF3UmFtUXVlcnk8YW55PixcbiAgUmFtQWRhcHRlcixcbiAgUmFtRmxhZ3MsXG4gIENvbnRleHQ8UmFtRmxhZ3M+XG4+O1xuIl19
|
package/lib/ram/types.d.ts
CHANGED
@@ -2,7 +2,31 @@ import { Constructor, Model } from "@decaf-ts/decorator-validation";
|
|
2
2
|
import { Repository } from "../repository";
|
3
3
|
import { Context, RepositoryFlags } from "@decaf-ts/db-decorators";
|
4
4
|
import { RamAdapter } from "./RamAdapter";
|
5
|
+
/**
|
6
|
+
* @description In-memory storage structure for the RAM adapter
|
7
|
+
* @summary A nested Map structure that stores all entities by their table name and primary key.
|
8
|
+
* The outer Map uses table names as keys, while the inner Map uses entity IDs as keys and entity instances as values.
|
9
|
+
* @typedef {Map<string, Map<string | number, any>>} RamStorage
|
10
|
+
* @memberOf module:core
|
11
|
+
* @category Ram
|
12
|
+
*/
|
5
13
|
export type RamStorage = Map<string, Map<string | number, any>>;
|
14
|
+
/**
|
15
|
+
* @description Query specification for RAM adapter
|
16
|
+
* @summary Defines the structure of a query for retrieving data from the in-memory storage.
|
17
|
+
* It specifies what fields to select, which model to query, filtering conditions,
|
18
|
+
* sorting criteria, and pagination options.
|
19
|
+
* @template M - The model type being queried
|
20
|
+
* @typedef {Object} RawRamQuery
|
21
|
+
* @property select - Fields to select from the model, or undefined for all fields
|
22
|
+
* @property {Constructor<M>} from - The model constructor to query
|
23
|
+
* @property {function(M): boolean} where - Predicate function for filtering entities
|
24
|
+
* @property {function(M, M): number} [sort] - Optional comparator function for sorting results
|
25
|
+
* @property {number} [limit] - Optional maximum number of results to return
|
26
|
+
* @property {number} [skip] - Optional number of results to skip (for pagination)
|
27
|
+
* @memberOf module:core
|
28
|
+
* @category Ram
|
29
|
+
*/
|
6
30
|
export type RawRamQuery<M extends Model> = {
|
7
31
|
select: undefined | (keyof M)[];
|
8
32
|
from: Constructor<M>;
|
@@ -11,7 +35,25 @@ export type RawRamQuery<M extends Model> = {
|
|
11
35
|
limit?: number;
|
12
36
|
skip?: number;
|
13
37
|
};
|
38
|
+
/**
|
39
|
+
* @description Flags for RAM adapter operations
|
40
|
+
* @summary Interface that extends the base repository flags with RAM-specific flags.
|
41
|
+
* Contains user identification information needed for tracking entity creation and updates.
|
42
|
+
* @interface RamFlags
|
43
|
+
* @property {string} UUID - Unique identifier for the current user
|
44
|
+
* @memberOf module:core
|
45
|
+
* @category Ram
|
46
|
+
*/
|
14
47
|
export interface RamFlags extends RepositoryFlags {
|
15
48
|
UUID: string;
|
16
49
|
}
|
50
|
+
/**
|
51
|
+
* @description Type definition for RAM-specific repository
|
52
|
+
* @summary A specialized repository type for working with models in the RAM adapter.
|
53
|
+
* It combines the model type with RAM-specific query, adapter, flags, and context types.
|
54
|
+
* @template M - The model type managed by the repository
|
55
|
+
* @typedef {Repository<M, RawRamQuery<any>, RamAdapter, RamFlags, Context<RamFlags>>} RamRepository
|
56
|
+
* @memberOf module:core
|
57
|
+
* @category Ram
|
58
|
+
*/
|
17
59
|
export type RamRepository<M extends Model> = Repository<M, RawRamQuery<any>, RamAdapter, RamFlags, Context<RamFlags>>;
|