@decaf-ts/core 0.7.1 → 0.7.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/README.md +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.cjs.map +1 -1
- package/dist/core.js +1 -1
- package/dist/core.js.map +1 -1
- package/lib/esm/identity/decorators.d.ts +3 -4
- package/lib/esm/identity/decorators.js +4 -10
- package/lib/esm/identity/decorators.js.map +1 -1
- package/lib/esm/identity/index.d.ts +0 -1
- package/lib/esm/identity/index.js +0 -1
- package/lib/esm/identity/index.js.map +1 -1
- package/lib/esm/index.d.ts +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/interfaces/ContextuallyLogged.d.ts +8 -0
- package/lib/esm/interfaces/ContextuallyLogged.js +2 -0
- package/lib/esm/interfaces/ContextuallyLogged.js.map +1 -0
- package/lib/esm/interfaces/ErrorParser.d.ts +2 -2
- package/lib/esm/interfaces/Executor.d.ts +1 -1
- package/lib/esm/interfaces/Observable.d.ts +8 -8
- package/lib/esm/interfaces/Observer.d.ts +2 -2
- package/lib/esm/interfaces/RawExecutor.d.ts +1 -1
- package/lib/esm/model/BaseModel.d.ts +2 -2
- package/lib/esm/model/BaseModel.js +2 -2
- package/lib/esm/model/construction.d.ts +9 -8
- package/lib/esm/model/construction.js +2 -2
- package/lib/esm/model/construction.js.map +1 -1
- package/lib/esm/model/decorators.d.ts +4 -3
- package/lib/esm/model/decorators.js +2 -2
- package/lib/esm/model/decorators.js.map +1 -1
- package/lib/esm/overrides/Metadata.d.ts +1 -8
- package/lib/esm/overrides/Model.d.ts +75 -0
- package/lib/esm/overrides/Model.js +2 -0
- package/lib/esm/overrides/Model.js.map +1 -0
- package/lib/esm/overrides/index.d.ts +2 -0
- package/lib/esm/overrides/index.js +2 -0
- package/lib/esm/overrides/index.js.map +1 -1
- package/lib/esm/overrides/injectables.d.ts +10 -0
- package/lib/esm/overrides/injectables.js +2 -0
- package/lib/esm/overrides/injectables.js.map +1 -0
- package/lib/esm/overrides/overrides.js +45 -3
- package/lib/esm/overrides/overrides.js.map +1 -1
- package/lib/esm/persistence/Adapter.d.ts +54 -51
- package/lib/esm/persistence/Adapter.js +78 -57
- package/lib/esm/persistence/Adapter.js.map +1 -1
- package/lib/esm/persistence/Dispatch.d.ts +7 -6
- package/lib/esm/persistence/Dispatch.js +25 -18
- package/lib/esm/persistence/Dispatch.js.map +1 -1
- package/lib/esm/persistence/ObserverHandler.d.ts +7 -6
- package/lib/esm/persistence/ObserverHandler.js +5 -4
- package/lib/esm/persistence/ObserverHandler.js.map +1 -1
- package/lib/esm/persistence/Sequence.d.ts +10 -17
- package/lib/esm/persistence/Sequence.js +10 -15
- package/lib/esm/persistence/Sequence.js.map +1 -1
- package/lib/esm/persistence/constants.d.ts +1 -0
- package/lib/esm/persistence/constants.js +1 -0
- package/lib/esm/persistence/constants.js.map +1 -1
- package/lib/esm/persistence/migrations.d.ts +8 -8
- package/lib/esm/persistence/migrations.js +8 -9
- package/lib/esm/persistence/migrations.js.map +1 -1
- package/lib/esm/persistence/types.d.ts +38 -20
- package/lib/esm/query/Paginator.d.ts +6 -5
- package/lib/esm/query/Paginator.js +4 -4
- package/lib/esm/query/Paginator.js.map +1 -1
- package/lib/esm/query/Statement.d.ts +9 -8
- package/lib/esm/query/Statement.js +23 -10
- package/lib/esm/query/Statement.js.map +1 -1
- package/lib/esm/ram/RamAdapter.d.ts +21 -21
- package/lib/esm/ram/RamAdapter.js +36 -23
- package/lib/esm/ram/RamAdapter.js.map +1 -1
- package/lib/esm/ram/RamPaginator.d.ts +2 -1
- package/lib/esm/ram/RamPaginator.js +5 -3
- package/lib/esm/ram/RamPaginator.js.map +1 -1
- package/lib/esm/ram/RamSequence.d.ts +4 -11
- package/lib/esm/ram/RamSequence.js +20 -24
- package/lib/esm/ram/RamSequence.js.map +1 -1
- package/lib/esm/ram/RamStatement.d.ts +7 -7
- package/lib/esm/ram/RamStatement.js.map +1 -1
- package/lib/esm/ram/handlers.d.ts +3 -4
- package/lib/esm/ram/handlers.js.map +1 -1
- package/lib/esm/ram/index.d.ts +0 -1
- package/lib/esm/ram/index.js +0 -1
- package/lib/esm/ram/index.js.map +1 -1
- package/lib/esm/ram/types.d.ts +4 -12
- package/lib/esm/repository/Repository.d.ts +31 -95
- package/lib/esm/repository/Repository.js +106 -201
- package/lib/esm/repository/Repository.js.map +1 -1
- package/lib/esm/repository/decorators.js +3 -2
- package/lib/esm/repository/decorators.js.map +1 -1
- package/lib/esm/repository/utils.d.ts +1 -1
- package/lib/esm/repository/utils.js +2 -3
- package/lib/esm/repository/utils.js.map +1 -1
- package/lib/esm/utils/ContextualLoggedClass.d.ts +16 -0
- package/lib/esm/utils/ContextualLoggedClass.js +29 -0
- package/lib/esm/utils/ContextualLoggedClass.js.map +1 -0
- package/lib/esm/utils/Services.d.ts +28 -0
- package/lib/esm/utils/Services.js +88 -0
- package/lib/esm/utils/Services.js.map +1 -0
- package/lib/esm/utils/decorators.d.ts +1 -9
- package/lib/esm/utils/decorators.js +26 -15
- package/lib/esm/utils/decorators.js.map +1 -1
- package/lib/esm/utils/index.d.ts +2 -1
- package/lib/esm/utils/index.js +2 -1
- package/lib/esm/utils/index.js.map +1 -1
- package/lib/identity/decorators.cjs +3 -9
- package/lib/identity/decorators.d.ts +3 -4
- package/lib/identity/decorators.js.map +1 -1
- package/lib/identity/index.cjs +0 -1
- package/lib/identity/index.d.ts +0 -1
- package/lib/identity/index.js.map +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/interfaces/ContextuallyLogged.cjs +3 -0
- package/lib/interfaces/ContextuallyLogged.d.ts +8 -0
- package/lib/interfaces/ContextuallyLogged.js.map +1 -0
- package/lib/interfaces/ErrorParser.d.ts +2 -2
- package/lib/interfaces/Executor.d.ts +1 -1
- package/lib/interfaces/Observable.d.ts +8 -8
- package/lib/interfaces/Observer.d.ts +2 -2
- package/lib/interfaces/RawExecutor.d.ts +1 -1
- package/lib/model/BaseModel.cjs +2 -2
- package/lib/model/BaseModel.d.ts +2 -2
- package/lib/model/construction.cjs +2 -2
- package/lib/model/construction.d.ts +9 -8
- package/lib/model/construction.js.map +1 -1
- package/lib/model/decorators.cjs +1 -1
- package/lib/model/decorators.d.ts +4 -3
- package/lib/model/decorators.js.map +1 -1
- package/lib/overrides/Metadata.d.ts +1 -8
- package/lib/overrides/Model.cjs +4 -0
- package/lib/overrides/Model.d.ts +75 -0
- package/lib/overrides/Model.js.map +1 -0
- package/lib/overrides/index.cjs +2 -0
- package/lib/overrides/index.d.ts +2 -0
- package/lib/overrides/index.js.map +1 -1
- package/lib/overrides/injectables.cjs +4 -0
- package/lib/overrides/injectables.d.ts +10 -0
- package/lib/overrides/injectables.js.map +1 -0
- package/lib/overrides/overrides.cjs +43 -1
- package/lib/overrides/overrides.js.map +1 -1
- package/lib/persistence/Adapter.cjs +83 -62
- package/lib/persistence/Adapter.d.ts +54 -51
- package/lib/persistence/Adapter.js.map +1 -1
- package/lib/persistence/Dispatch.cjs +25 -18
- package/lib/persistence/Dispatch.d.ts +7 -6
- package/lib/persistence/Dispatch.js.map +1 -1
- package/lib/persistence/ObserverHandler.cjs +5 -4
- package/lib/persistence/ObserverHandler.d.ts +7 -6
- package/lib/persistence/ObserverHandler.js.map +1 -1
- package/lib/persistence/Sequence.cjs +10 -15
- package/lib/persistence/Sequence.d.ts +10 -17
- package/lib/persistence/Sequence.js.map +1 -1
- package/lib/persistence/constants.cjs +1 -0
- package/lib/persistence/constants.d.ts +1 -0
- package/lib/persistence/constants.js.map +1 -1
- package/lib/persistence/migrations.cjs +7 -8
- package/lib/persistence/migrations.d.ts +8 -8
- package/lib/persistence/migrations.js.map +1 -1
- package/lib/persistence/types.d.ts +38 -20
- package/lib/query/Paginator.cjs +4 -4
- package/lib/query/Paginator.d.ts +6 -5
- package/lib/query/Paginator.js.map +1 -1
- package/lib/query/Statement.cjs +34 -21
- package/lib/query/Statement.d.ts +9 -8
- package/lib/query/Statement.js.map +1 -1
- package/lib/ram/RamAdapter.cjs +35 -22
- package/lib/ram/RamAdapter.d.ts +21 -21
- package/lib/ram/RamAdapter.js.map +1 -1
- package/lib/ram/RamPaginator.cjs +5 -3
- package/lib/ram/RamPaginator.d.ts +2 -1
- package/lib/ram/RamPaginator.js.map +1 -1
- package/lib/ram/RamSequence.cjs +19 -23
- package/lib/ram/RamSequence.d.ts +4 -11
- package/lib/ram/RamSequence.js.map +1 -1
- package/lib/ram/RamStatement.d.ts +7 -7
- package/lib/ram/RamStatement.js.map +1 -1
- package/lib/ram/handlers.d.ts +3 -4
- package/lib/ram/handlers.js.map +1 -1
- package/lib/ram/index.cjs +0 -1
- package/lib/ram/index.d.ts +0 -1
- package/lib/ram/index.js.map +1 -1
- package/lib/ram/types.d.ts +4 -12
- package/lib/repository/Repository.cjs +107 -202
- package/lib/repository/Repository.d.ts +31 -95
- package/lib/repository/Repository.js.map +1 -1
- package/lib/repository/decorators.cjs +1 -0
- package/lib/repository/decorators.js.map +1 -1
- package/lib/repository/utils.cjs +2 -3
- package/lib/repository/utils.d.ts +1 -1
- package/lib/repository/utils.js.map +1 -1
- package/lib/utils/ContextualLoggedClass.cjs +33 -0
- package/lib/utils/ContextualLoggedClass.d.ts +16 -0
- package/lib/utils/ContextualLoggedClass.js.map +1 -0
- package/lib/utils/Services.cjs +93 -0
- package/lib/utils/Services.d.ts +28 -0
- package/lib/utils/Services.js.map +1 -0
- package/lib/utils/decorators.cjs +27 -16
- package/lib/utils/decorators.d.ts +1 -9
- package/lib/utils/decorators.js.map +1 -1
- package/lib/utils/index.cjs +2 -1
- package/lib/utils/index.d.ts +2 -1
- package/lib/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/lib/esm/identity/utils.d.ts +0 -24
- package/lib/esm/identity/utils.js +0 -44
- package/lib/esm/identity/utils.js.map +0 -1
- package/lib/esm/ram/RamContext.d.ts +0 -28
- package/lib/esm/ram/RamContext.js +0 -30
- package/lib/esm/ram/RamContext.js.map +0 -1
- package/lib/identity/utils.cjs +0 -49
- package/lib/identity/utils.d.ts +0 -24
- package/lib/identity/utils.js.map +0 -1
- package/lib/ram/RamContext.cjs +0 -34
- package/lib/ram/RamContext.d.ts +0 -28
- package/lib/ram/RamContext.js.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Sequence = void 0;
|
|
4
|
-
const
|
|
5
|
-
const logging_1 = require("@decaf-ts/logging");
|
|
4
|
+
const decorator_validation_1 = require("@decaf-ts/decorator-validation");
|
|
6
5
|
const errors_1 = require("./errors.cjs");
|
|
6
|
+
const ContextualLoggedClass_1 = require("./../utils/ContextualLoggedClass.cjs");
|
|
7
7
|
/**
|
|
8
8
|
* @description Abstract base class for sequence generation
|
|
9
9
|
* @summary Provides a framework for generating sequential values (like primary keys) in the persistence layer.
|
|
@@ -50,23 +50,18 @@ const errors_1 = require("./errors.cjs");
|
|
|
50
50
|
* const nextId = await sequence.next();
|
|
51
51
|
* ```
|
|
52
52
|
*/
|
|
53
|
-
class Sequence {
|
|
54
|
-
/**
|
|
55
|
-
* @description Accessor for the logger instance
|
|
56
|
-
* @summary Gets or initializes the logger for this sequence
|
|
57
|
-
* @return {Logger} The logger instance
|
|
58
|
-
*/
|
|
59
|
-
get log() {
|
|
60
|
-
if (!this.logger)
|
|
61
|
-
this.logger = logging_1.Logging.for(this);
|
|
62
|
-
return this.logger;
|
|
63
|
-
}
|
|
53
|
+
class Sequence extends ContextualLoggedClass_1.ContextualLoggedClass {
|
|
64
54
|
/**
|
|
65
55
|
* @description Creates a new sequence instance
|
|
66
56
|
* @summary Protected constructor that initializes the sequence with the provided options
|
|
67
57
|
*/
|
|
68
|
-
constructor(options) {
|
|
58
|
+
constructor(options, adapter) {
|
|
59
|
+
super();
|
|
69
60
|
this.options = options;
|
|
61
|
+
this.adapter = adapter;
|
|
62
|
+
}
|
|
63
|
+
parse(value) {
|
|
64
|
+
return Sequence.parseValue(this.options.type, value);
|
|
70
65
|
}
|
|
71
66
|
/**
|
|
72
67
|
* @description Gets the primary key sequence name for a model
|
|
@@ -76,7 +71,7 @@ class Sequence {
|
|
|
76
71
|
* @return {string} The sequence name for the model's primary key
|
|
77
72
|
*/
|
|
78
73
|
static pk(model) {
|
|
79
|
-
return
|
|
74
|
+
return decorator_validation_1.Model.sequenceName(model, "pk");
|
|
80
75
|
}
|
|
81
76
|
/**
|
|
82
77
|
* @description Parses a sequence value to the appropriate type
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Model } from "@decaf-ts/decorator-validation";
|
|
2
2
|
import { SequenceOptions } from "../interfaces/SequenceOptions";
|
|
3
|
-
import { Logger } from "@decaf-ts/logging";
|
|
4
3
|
import { Constructor } from "@decaf-ts/decoration";
|
|
4
|
+
import { PrimaryKeyType } from "@decaf-ts/db-decorators";
|
|
5
|
+
import { ContextualLoggedClass, MaybeContextualArg } from "../utils/ContextualLoggedClass";
|
|
6
|
+
import { Adapter } from "./Adapter";
|
|
5
7
|
/**
|
|
6
8
|
* @description Abstract base class for sequence generation
|
|
7
9
|
* @summary Provides a framework for generating sequential values (like primary keys) in the persistence layer.
|
|
@@ -48,43 +50,34 @@ import { Constructor } from "@decaf-ts/decoration";
|
|
|
48
50
|
* const nextId = await sequence.next();
|
|
49
51
|
* ```
|
|
50
52
|
*/
|
|
51
|
-
export declare abstract class Sequence {
|
|
53
|
+
export declare abstract class Sequence extends ContextualLoggedClass<any> {
|
|
52
54
|
protected readonly options: SequenceOptions;
|
|
53
|
-
|
|
54
|
-
* @description Logger instance for this sequence
|
|
55
|
-
* @summary Lazily initialized logger for the sequence instance
|
|
56
|
-
*/
|
|
57
|
-
private logger;
|
|
58
|
-
/**
|
|
59
|
-
* @description Accessor for the logger instance
|
|
60
|
-
* @summary Gets or initializes the logger for this sequence
|
|
61
|
-
* @return {Logger} The logger instance
|
|
62
|
-
*/
|
|
63
|
-
protected get log(): Logger;
|
|
55
|
+
protected readonly adapter: Adapter<any, any, any>;
|
|
64
56
|
/**
|
|
65
57
|
* @description Creates a new sequence instance
|
|
66
58
|
* @summary Protected constructor that initializes the sequence with the provided options
|
|
67
59
|
*/
|
|
68
|
-
protected constructor(options: SequenceOptions);
|
|
60
|
+
protected constructor(options: SequenceOptions, adapter: Adapter<any, any, any>);
|
|
69
61
|
/**
|
|
70
62
|
* @description Gets the next value in the sequence
|
|
71
63
|
* @summary Retrieves the next value from the sequence, incrementing it in the process
|
|
72
64
|
* @return A promise that resolves to the next value in the sequence
|
|
73
65
|
*/
|
|
74
|
-
abstract next(): Promise<
|
|
66
|
+
abstract next(...args: MaybeContextualArg<any>): Promise<PrimaryKeyType>;
|
|
75
67
|
/**
|
|
76
68
|
* @description Gets the current value of the sequence
|
|
77
69
|
* @summary Retrieves the current value of the sequence without incrementing it
|
|
78
70
|
* @return A promise that resolves to the current value in the sequence
|
|
79
71
|
*/
|
|
80
|
-
abstract current(): Promise<
|
|
72
|
+
abstract current(...args: MaybeContextualArg<any>): Promise<PrimaryKeyType>;
|
|
73
|
+
protected parse(value: string | number | bigint): string | number | bigint;
|
|
81
74
|
/**
|
|
82
75
|
* @description Gets a range of sequential values
|
|
83
76
|
* @summary Retrieves multiple sequential values at once, which can be more efficient than calling next() multiple times
|
|
84
77
|
* @param {number} count - The number of sequential values to retrieve
|
|
85
78
|
* @return A promise that resolves to an array of sequential values
|
|
86
79
|
*/
|
|
87
|
-
abstract range(count: number): Promise<(number | string | bigint)[]>;
|
|
80
|
+
abstract range(count: number, ...argz: MaybeContextualArg<any>): Promise<(number | string | bigint)[]>;
|
|
88
81
|
/**
|
|
89
82
|
* @description Gets the primary key sequence name for a model
|
|
90
83
|
* @summary Utility method that returns the standardized sequence name for a model's primary key
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sequence.js","sourceRoot":"","sources":["../../src/persistence/Sequence.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"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
|
|
18
18
|
PersistenceKeys["ADAPTER"] = "adapter";
|
|
19
19
|
/** @description Template for injectable adapter names */
|
|
20
20
|
PersistenceKeys["INJECTABLE"] = "decaf_{0}_adapter_for_{1}";
|
|
21
|
+
PersistenceKeys["SERVICE"] = "service";
|
|
21
22
|
/** @description Key for table name metadata */
|
|
22
23
|
PersistenceKeys["TABLE"] = "table";
|
|
23
24
|
/** @description Key for column name metadata */
|
|
@@ -14,6 +14,7 @@ export declare enum PersistenceKeys {
|
|
|
14
14
|
ADAPTER = "adapter",
|
|
15
15
|
/** @description Template for injectable adapter names */
|
|
16
16
|
INJECTABLE = "decaf_{0}_adapter_for_{1}",
|
|
17
|
+
SERVICE = "service",
|
|
17
18
|
/** @description Key for table name metadata */
|
|
18
19
|
TABLE = "table",
|
|
19
20
|
/** @description Key for column name metadata */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/persistence/constants.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,IAAY,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/persistence/constants.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,IAAY,eA0DX;AA1DD,WAAY,eAAe;IACzB,0CAA0C;IAC1C,kCAAe,CAAA;IAEf,sDAAsD;IACtD,oCAAiB,CAAA;IAEjB,4CAA4C;IAC5C,sCAAmB,CAAA;IAEnB,yDAAyD;IACzD,2DAAwC,CAAA;IAExC,sCAAmB,CAAA;IACnB,+CAA+C;IAC/C,kCAAe,CAAA;IAEf,gDAAgD;IAChD,oCAAiB,CAAA;IAEjB,oDAAoD;IACpD,0CAAuB,CAAA;IAEvB,YAAY;IACZ,yDAAyD;IACzD,0CAAuB,CAAA;IAEvB,yDAAyD;IACzD,sDAAsC,CAAA;IAEtC,yDAAyD;IACzD,sDAAsC,CAAA;IAEtC,YAAY;IAEZ,sDAAsD;IACtD,4CAAyB,CAAA;IAEzB,sDAAsD;IACtD,wCAAqB,CAAA;IAErB,wDAAwD;IACxD,qDAAqC,CAAA;IAErC,yDAAyD;IACzD,uDAAuC,CAAA;IAEvC,yDAAyD;IACzD,uDAAuC,CAAA;IACvC,yDAAyD;IACzD,yDAAyC,CAAA;IAEzC,6CAA6C;IAC7C,wCAAqB,CAAA;IACrB,6CAA6C;IAC7C,8CAA2B,CAAA;IAC3B,6CAA6C;IAC7C,0CAAuB,CAAA;AACzB,CAAC,EA1DW,eAAe,+BAAf,eAAe,QA0D1B"}
|
|
@@ -9,6 +9,7 @@ const logging_1 = require("@decaf-ts/logging");
|
|
|
9
9
|
const constants_1 = require("./constants.cjs");
|
|
10
10
|
const decoration_1 = require("@decaf-ts/decoration");
|
|
11
11
|
const errors_1 = require("./errors.cjs");
|
|
12
|
+
const decorator_validation_1 = require("@decaf-ts/decorator-validation");
|
|
12
13
|
function prefixMethod(obj, after, prefix, afterName) {
|
|
13
14
|
async function wrapper(...args) {
|
|
14
15
|
let results;
|
|
@@ -48,14 +49,12 @@ class AbsMigration extends logging_1.LoggedClass {
|
|
|
48
49
|
const flavour = meta.flavour;
|
|
49
50
|
return Adapter_1.Adapter.get(flavour);
|
|
50
51
|
}
|
|
51
|
-
async enforceRules(qr, adapter,
|
|
52
|
+
async enforceRules(qr, adapter, ctx) {
|
|
52
53
|
const rules = decoration_1.Metadata.get(this.constructor, constants_1.PersistenceKeys.MIGRATION)?.rules;
|
|
53
54
|
if (!rules || !rules.length)
|
|
54
55
|
return true;
|
|
55
|
-
let log;
|
|
56
56
|
for (const rule of rules) {
|
|
57
|
-
|
|
58
|
-
const result = await rule(qr, adapter, log);
|
|
57
|
+
const result = await rule(qr, adapter, ctx);
|
|
59
58
|
if (!result)
|
|
60
59
|
return false;
|
|
61
60
|
}
|
|
@@ -71,13 +70,13 @@ class AbsMigration extends logging_1.LoggedClass {
|
|
|
71
70
|
qr = qrOrAdapter;
|
|
72
71
|
qrOrAdapter = this.adapter;
|
|
73
72
|
}
|
|
74
|
-
const
|
|
75
|
-
const allowed = await this.enforceRules(qr, qrOrAdapter,
|
|
73
|
+
const ctx = await db_decorators_1.Context.args("migration", decorator_validation_1.Model, [name], qrOrAdapter);
|
|
74
|
+
const allowed = await this.enforceRules(qr, qrOrAdapter, ctx.context);
|
|
76
75
|
if (!allowed) {
|
|
77
|
-
|
|
76
|
+
ctx.context.logger.verbose(`Skipping migration ${this.constructor.name} due to rules`);
|
|
78
77
|
throw new errors_1.MigrationRuleError("Migration skipped for rule enforcement");
|
|
79
78
|
}
|
|
80
|
-
return [qr, qrOrAdapter,
|
|
79
|
+
return [qr, qrOrAdapter, ctx.context];
|
|
81
80
|
}.bind(this);
|
|
82
81
|
}
|
|
83
82
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { Migration } from "./types";
|
|
1
|
+
import { ContextOf, Migration } from "./types";
|
|
2
2
|
import { Adapter } from "./Adapter";
|
|
3
|
-
import {
|
|
4
|
-
import { LoggedClass, Logger } from "@decaf-ts/logging";
|
|
3
|
+
import { LoggedClass } from "@decaf-ts/logging";
|
|
5
4
|
export declare function prefixMethod(obj: any, after: (...args: any[]) => any, prefix: (...args: any[]) => any, afterName?: string): void;
|
|
6
|
-
export
|
|
5
|
+
export type ConnectionForAdapter<A extends Adapter<any, any, any, any>> = A extends Adapter<any, any, infer CONN, any> ? CONN : never;
|
|
6
|
+
export declare abstract class AbsMigration<A extends Adapter<any, any, any, any>, QUERYRUNNER = ConnectionForAdapter<A>> extends LoggedClass implements Migration<QUERYRUNNER, A> {
|
|
7
7
|
transaction: boolean;
|
|
8
8
|
protected constructor();
|
|
9
9
|
protected get adapter(): A;
|
|
10
|
-
protected abstract getQueryRunner(conn:
|
|
10
|
+
protected abstract getQueryRunner(conn: ConnectionForAdapter<A>): QUERYRUNNER;
|
|
11
11
|
private enforceRules;
|
|
12
12
|
private prefix;
|
|
13
|
-
abstract down(qr: QUERYRUNNER, adapter: A,
|
|
14
|
-
abstract up(qr: QUERYRUNNER, adapter: A,
|
|
13
|
+
abstract down(qr: QUERYRUNNER, adapter: A, ctx: ContextOf<A>): Promise<void>;
|
|
14
|
+
abstract up(qr: QUERYRUNNER, adapter: A, ctx: ContextOf<A>): Promise<void>;
|
|
15
15
|
}
|
|
16
|
-
export type MigrationRule<A extends Adapter<
|
|
16
|
+
export type MigrationRule<A extends Adapter<any, any, any, any> = any, QUERYRUNNER = ConnectionForAdapter<A>> = (qr: QUERYRUNNER, adapter: A, ctx: ContextOf<A>) => Promise<boolean>;
|
|
17
17
|
export type MigrationMetadata = {
|
|
18
18
|
flavour: string;
|
|
19
19
|
rules?: MigrationRule[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrations.js","sourceRoot":"","sources":["../../src/persistence/migrations.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"migrations.js","sourceRoot":"","sources":["../../src/persistence/migrations.ts"],"names":[],"mappings":";;;AASA,oCA0BC;AAkGD,8BAyBC;AA7JD,2CAAoC;AACpC,2DAAiE;AACjE,+CAAgD;AAChD,+CAA8C;AAC9C,qDAAsE;AACtE,yCAA8C;AAC9C,yEAAuD;AAEvD,SAAgB,YAAY,CAC1B,GAAQ,EACR,KAA8B,EAC9B,MAA+B,EAC/B,SAAkB;IAElB,KAAK,UAAU,OAAO,CAAY,GAAG,IAAW;QAC9C,IAAI,OAAc,CAAC;QACnB,IAAI,CAAC;YACH,OAAO,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;QAC9D,CAAC;QAAC,OAAO,CAAU,EAAE,CAAC;YACpB,IAAI,CAAC,YAAY,2BAAkB;gBAAE,OAAO;YAC5C,MAAM,CAAC,CAAC;QACV,CAAC;QACD,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;IACrD,CAAC;IAED,MAAM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AAC,CAAC;IACf,CAAC;CAKF;AAjFD,oCAiFC;AAYD,SAAgB,SAAS,CAAC,OAAe,EAAE,KAAuB;IAChE,SAAS,cAAc,CAAC,OAAe,EAAE,KAAuB;QAC9D,OAAO,UAAU,QAAgB;YAC/B,MAAM,OAAO,GACX,qBAAQ,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,2BAAe,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;gBACpE,EAAE,CAAC;YACL,qBAAQ,CAAC,GAAG,CAAC,2BAAe,CAAC,SAAS,EAAE,OAAO,EAAE;gBAC/C,GAAG,OAAO;gBACV;oBACE,KAAK,EAAE,QAAQ;iBAChB;aACF,CAAC,CAAC;YACH,OAAO,IAAA,qBAAQ,EAAC,2BAAe,CAAC,SAAS,EAAE;gBACzC,OAAO,EAAE,OAAO;gBAChB,KAAK,EAAE,KAAK;aACb,CAAC,CAAC,QAAQ,CAAC,CAAC;QACf,CAAC,CAAC;IACJ,CAAC;IAED,OAAO,uBAAU,CAAC,GAAG,CAAC,2BAAe,CAAC,SAAS,CAAC;SAC7C,MAAM,CAAC;QACN,SAAS,EAAE,cAAc;QACzB,IAAI,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC;KACvB,CAAC;SACD,KAAK,EAAE,CAAC;AACb,CAAC"}
|
|
@@ -1,7 +1,30 @@
|
|
|
1
|
-
import { BulkCrudOperationKeys, Context, OperationKeys, RepositoryFlags } from "@decaf-ts/db-decorators";
|
|
1
|
+
import { BulkCrudOperationKeys, Context, ContextOfRepository, FlagsOfContext, FlagsOfRepository, IRepository, LoggerOfContext, LoggerOfFlags, LoggerOfRepository, OperationKeys, RepositoryFlags } from "@decaf-ts/db-decorators";
|
|
2
2
|
import { Adapter } from "./Adapter";
|
|
3
|
-
import { Observable } from "../interfaces/index";
|
|
3
|
+
import { Observable, type Observer } from "../interfaces/index";
|
|
4
4
|
import { Logger } from "@decaf-ts/logging";
|
|
5
|
+
import { Constructor } from "@decaf-ts/decoration";
|
|
6
|
+
import { Model } from "@decaf-ts/decorator-validation";
|
|
7
|
+
import { ContextualArgs } from "../utils/index";
|
|
8
|
+
export type ContextOf<OBJ extends IRepository<any, any> | Adapter<any, any, any, any>> = OBJ extends Adapter<any, any, any, infer C> ? C : OBJ extends IRepository<any, any> ? ContextOfRepository<OBJ> : never;
|
|
9
|
+
export type LoggerOfAdapter<A extends Adapter<any, any, any, any>> = A extends Adapter<any, any, any, infer C> ? LoggerOfContext<C> : never;
|
|
10
|
+
export type FlagsOfAdapter<A extends Adapter<any, any, any, any>> = A extends Adapter<any, any, any, infer C> ? FlagsOfContext<C> : never;
|
|
11
|
+
export type LoggerOf<OBJ extends RepositoryFlags<any> | Context<any> | Adapter<any, any, any> | IRepository<any, any>> = OBJ extends RepositoryFlags<any> ? LoggerOfFlags<OBJ> : OBJ extends Context<any> ? LoggerOfContext<OBJ> : OBJ extends IRepository<any, any> ? LoggerOfRepository<OBJ> : OBJ extends Adapter<any, any, any> ? LoggerOfAdapter<OBJ> : Logger;
|
|
12
|
+
export type FlagsOf<OBJ extends IRepository<any, any> | Adapter<any, any, any, any> | Context<any>> = OBJ extends Context<any> ? FlagsOfContext<OBJ> : OBJ extends IRepository<any, any> ? FlagsOfRepository<OBJ> : OBJ extends Adapter<any, any, any, any> ? FlagsOfAdapter<OBJ> : never;
|
|
13
|
+
export type PersistenceObservable<CONTEXT extends Context<any>> = Observable<[
|
|
14
|
+
Observer,
|
|
15
|
+
ObserverFilter?
|
|
16
|
+
], [
|
|
17
|
+
Constructor | string,
|
|
18
|
+
OperationKeys | BulkCrudOperationKeys | string,
|
|
19
|
+
EventIds,
|
|
20
|
+
...ContextualArgs<CONTEXT>
|
|
21
|
+
]>;
|
|
22
|
+
export type PersistenceObserver<CONTEXT extends Context<any>> = Observer<[
|
|
23
|
+
Constructor | string,
|
|
24
|
+
OperationKeys | BulkCrudOperationKeys | string,
|
|
25
|
+
EventIds,
|
|
26
|
+
...ContextualArgs<CONTEXT>
|
|
27
|
+
]>;
|
|
5
28
|
/**
|
|
6
29
|
* @description Type representing possible ID formats for database events
|
|
7
30
|
* @summary A union type that defines the possible formats for event identifiers in the persistence layer.
|
|
@@ -10,25 +33,20 @@ import { Logger } from "@decaf-ts/logging";
|
|
|
10
33
|
* @memberOf module:core
|
|
11
34
|
*/
|
|
12
35
|
export type EventIds = string | number | bigint | string[] | number[] | bigint[];
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
* about a specific database event. The filter examines the table name, event type, and affected IDs.
|
|
17
|
-
* @param {string} table - The name of the database table where the event occurred
|
|
18
|
-
* @param {(OperationKeys|BulkCrudOperationKeys|string)} event - The type of operation that triggered the event
|
|
19
|
-
* @param {EventIds} id - The identifier(s) of the affected record(s)
|
|
20
|
-
* @return {boolean} True if the observer should be notified, false otherwise
|
|
21
|
-
* @typedef {Function} ObserverFilter
|
|
22
|
-
* @memberOf module:core
|
|
23
|
-
*/
|
|
24
|
-
export type ObserverFilter = (table: string, event: OperationKeys | BulkCrudOperationKeys | string, id: EventIds) => boolean;
|
|
25
|
-
export type InferredAdapterConfig<A> = A extends Adapter<infer CONF, any, any, any> ? CONF : never;
|
|
26
|
-
export interface AdapterDispatch extends Observable {
|
|
36
|
+
export type ObserverFilter = (table: string | Constructor, event: OperationKeys | BulkCrudOperationKeys | string, id: EventIds, ...args: [...any[], Context<any>]) => boolean;
|
|
37
|
+
export type InferredAdapterConfig<A> = A extends Adapter<infer CONF, any, any> ? CONF : never;
|
|
38
|
+
export interface AdapterDispatch<A extends Adapter<any, any, any, any>> extends PersistenceObservable<ContextOf<A>> {
|
|
27
39
|
close(): Promise<void>;
|
|
28
|
-
updateObservers(table: string, event: OperationKeys | BulkCrudOperationKeys | string, id: EventIds): Promise<void>;
|
|
40
|
+
updateObservers<M extends Model>(table: Constructor<M> | string, event: OperationKeys | BulkCrudOperationKeys | string, id: EventIds, ...args: ContextualArgs<ContextOf<A>>): Promise<void>;
|
|
29
41
|
}
|
|
30
|
-
export interface Migration<QUERYRUNNER, A extends Adapter<
|
|
42
|
+
export interface Migration<QUERYRUNNER, A extends Adapter<any, any, any, any>> {
|
|
31
43
|
transaction: boolean;
|
|
32
|
-
up(qr: QUERYRUNNER, adapter?: A,
|
|
33
|
-
down(qr: QUERYRUNNER, adapter?: A,
|
|
44
|
+
up(qr: QUERYRUNNER, adapter?: A, ctx?: ContextOf<A>): Promise<void>;
|
|
45
|
+
down(qr: QUERYRUNNER, adapter?: A, ctx?: ContextOf<A>): Promise<void>;
|
|
34
46
|
}
|
|
47
|
+
export type RepositoryFor<A extends Adapter<any, any, any, any>> = A extends Adapter<any, any, any, any> ? ReturnType<A["repository"]> : never;
|
|
48
|
+
export type PreparedModel = {
|
|
49
|
+
record: Record<string, any>;
|
|
50
|
+
id: string;
|
|
51
|
+
transient?: Record<string, any>;
|
|
52
|
+
};
|
package/lib/query/Paginator.cjs
CHANGED
|
@@ -81,11 +81,11 @@ class Paginator extends logging_1.LoggedClass {
|
|
|
81
81
|
this.size = size;
|
|
82
82
|
this.clazz = clazz;
|
|
83
83
|
}
|
|
84
|
-
async next() {
|
|
85
|
-
return this.page(this.current + 1);
|
|
84
|
+
async next(...args) {
|
|
85
|
+
return this.page(this.current + 1, ...args);
|
|
86
86
|
}
|
|
87
|
-
async previous() {
|
|
88
|
-
return this.page(this.current - 1);
|
|
87
|
+
async previous(...args) {
|
|
88
|
+
return this.page(this.current - 1, ...args);
|
|
89
89
|
}
|
|
90
90
|
validatePage(page) {
|
|
91
91
|
if (page < 1 || !Number.isInteger(page))
|
package/lib/query/Paginator.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Adapter } from "../persistence";
|
|
|
2
2
|
import { Model } from "@decaf-ts/decorator-validation";
|
|
3
3
|
import { Constructor } from "@decaf-ts/decoration";
|
|
4
4
|
import { LoggedClass } from "@decaf-ts/logging";
|
|
5
|
+
import { MaybeContextualArg } from "../utils/index";
|
|
5
6
|
/**
|
|
6
7
|
* @description Handles pagination for database queries
|
|
7
8
|
* @summary Provides functionality for navigating through paginated query results
|
|
@@ -59,7 +60,7 @@ import { LoggedClass } from "@decaf-ts/logging";
|
|
|
59
60
|
* Paginator-->>Client: return page results
|
|
60
61
|
*/
|
|
61
62
|
export declare abstract class Paginator<M extends Model, R = M[], Q = any> extends LoggedClass {
|
|
62
|
-
protected readonly adapter: Adapter<any, any, Q, any
|
|
63
|
+
protected readonly adapter: Adapter<any, any, Q, any>;
|
|
63
64
|
protected readonly query: Q;
|
|
64
65
|
readonly size: number;
|
|
65
66
|
protected readonly clazz: Constructor<M>;
|
|
@@ -72,10 +73,10 @@ export declare abstract class Paginator<M extends Model, R = M[], Q = any> exten
|
|
|
72
73
|
get total(): number;
|
|
73
74
|
get count(): number;
|
|
74
75
|
protected get statement(): Q;
|
|
75
|
-
protected constructor(adapter: Adapter<any, any, Q, any
|
|
76
|
+
protected constructor(adapter: Adapter<any, any, Q, any>, query: Q, size: number, clazz: Constructor<M>);
|
|
76
77
|
protected abstract prepare(rawStatement: Q): Q;
|
|
77
|
-
next(): Promise<R[]>;
|
|
78
|
-
previous(): Promise<R[]>;
|
|
78
|
+
next(...args: MaybeContextualArg<any>): Promise<R[]>;
|
|
79
|
+
previous(...args: MaybeContextualArg<any>): Promise<R[]>;
|
|
79
80
|
protected validatePage(page: number): number;
|
|
80
|
-
abstract page(page?: number): Promise<R[]>;
|
|
81
|
+
abstract page(page?: number, ...args: MaybeContextualArg<any>): Promise<R[]>;
|
|
81
82
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Paginator.js","sourceRoot":"","sources":["../../src/query/Paginator.ts"],"names":[],"mappings":";;;AAAA,yCAAuC;AAIvC,+CAAgD;
|
|
1
|
+
{"version":3,"file":"Paginator.js","sourceRoot":"","sources":["../../src/query/Paginator.ts"],"names":[],"mappings":";;;AAAA,yCAAuC;AAIvC,+CAAgD;AAGhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,IAAI,CAAC,WAAW,qCAAqC,IAAI,EAAE,CACpE,CAAC;QACJ,OAAO,IAAI,CAAC;IACd,CAAC;CAGF;AA7DD,8BA6DC"}
|
package/lib/query/Statement.cjs
CHANGED
|
@@ -14,9 +14,10 @@ exports.Statement = void 0;
|
|
|
14
14
|
const decorator_validation_1 = require("@decaf-ts/decorator-validation");
|
|
15
15
|
const Condition_1 = require("./Condition.cjs");
|
|
16
16
|
const db_decorators_1 = require("@decaf-ts/db-decorators");
|
|
17
|
-
const decorators_1 = require("./../utils/decorators.cjs");
|
|
18
|
-
const errors_1 = require("./errors.cjs");
|
|
19
17
|
const logging_1 = require("@decaf-ts/logging");
|
|
18
|
+
const persistence_1 = require("./../persistence/index.cjs");
|
|
19
|
+
const errors_1 = require("./errors.cjs");
|
|
20
|
+
const index_1 = require("./../utils/index.cjs");
|
|
20
21
|
/**
|
|
21
22
|
* @description Base class for database query statements
|
|
22
23
|
* @summary Provides a foundation for building and executing database queries
|
|
@@ -68,7 +69,7 @@ const logging_1 = require("@decaf-ts/logging");
|
|
|
68
69
|
* Adapter-->>Statement: return processed results
|
|
69
70
|
* Statement-->>Client: return final results
|
|
70
71
|
*/
|
|
71
|
-
class Statement extends
|
|
72
|
+
class Statement extends index_1.ContextualLoggedClass {
|
|
72
73
|
constructor(adapter) {
|
|
73
74
|
super();
|
|
74
75
|
this.adapter = adapter;
|
|
@@ -125,100 +126,112 @@ class Statement extends logging_1.LoggedClass {
|
|
|
125
126
|
this.offsetSelector = value;
|
|
126
127
|
return this;
|
|
127
128
|
}
|
|
128
|
-
async execute() {
|
|
129
|
+
async execute(...args) {
|
|
130
|
+
let execArgs = args;
|
|
131
|
+
if ((!execArgs.length ||
|
|
132
|
+
!(execArgs[execArgs.length - 1] instanceof db_decorators_1.Context)) &&
|
|
133
|
+
this.fromSelector) {
|
|
134
|
+
const ctx = await this.adapter.context(db_decorators_1.OperationKeys.READ, {}, this.fromSelector);
|
|
135
|
+
execArgs = [...execArgs, ctx];
|
|
136
|
+
}
|
|
137
|
+
const { ctx } = persistence_1.Adapter.logCtx(execArgs, this.toString());
|
|
129
138
|
try {
|
|
130
139
|
const query = this.build();
|
|
131
|
-
return (await this.raw(query));
|
|
140
|
+
return (await this.raw(query, ctx));
|
|
132
141
|
}
|
|
133
142
|
catch (e) {
|
|
134
143
|
throw new db_decorators_1.InternalError(e);
|
|
135
144
|
}
|
|
136
145
|
}
|
|
137
|
-
async raw(rawInput) {
|
|
138
|
-
const
|
|
146
|
+
async raw(rawInput, ...args) {
|
|
147
|
+
const { ctx, ctxArgs } = this.logCtx(args, this.raw);
|
|
148
|
+
const results = await this.adapter.raw(rawInput, ...ctxArgs);
|
|
139
149
|
if (!this.selectSelector)
|
|
140
150
|
return results;
|
|
141
151
|
const pkAttr = decorator_validation_1.Model.pk(this.fromSelector);
|
|
142
152
|
const processor = function recordProcessor(r) {
|
|
143
153
|
const id = r[pkAttr];
|
|
144
|
-
return this.adapter.revert(r, this.fromSelector,
|
|
154
|
+
return this.adapter.revert(r, this.fromSelector, id, undefined, ctx);
|
|
145
155
|
}.bind(this);
|
|
146
156
|
if (Array.isArray(results))
|
|
147
157
|
return results.map(processor);
|
|
148
158
|
return processor(results);
|
|
149
159
|
}
|
|
160
|
+
toString() {
|
|
161
|
+
return `${this.adapter.flavour} statement`;
|
|
162
|
+
}
|
|
150
163
|
}
|
|
151
164
|
exports.Statement = Statement;
|
|
152
165
|
__decorate([
|
|
153
|
-
(0,
|
|
166
|
+
(0, logging_1.final)(),
|
|
154
167
|
__metadata("design:type", Function),
|
|
155
168
|
__metadata("design:paramtypes", [Array]),
|
|
156
169
|
__metadata("design:returntype", Object)
|
|
157
170
|
], Statement.prototype, "select", null);
|
|
158
171
|
__decorate([
|
|
159
|
-
(0,
|
|
172
|
+
(0, logging_1.final)(),
|
|
160
173
|
__metadata("design:type", Function),
|
|
161
174
|
__metadata("design:paramtypes", [typeof (_a = typeof S !== "undefined" && S) === "function" ? _a : Object]),
|
|
162
175
|
__metadata("design:returntype", Object)
|
|
163
176
|
], Statement.prototype, "distinct", null);
|
|
164
177
|
__decorate([
|
|
165
|
-
(0,
|
|
178
|
+
(0, logging_1.final)(),
|
|
166
179
|
__metadata("design:type", Function),
|
|
167
180
|
__metadata("design:paramtypes", [typeof (_b = typeof S !== "undefined" && S) === "function" ? _b : Object]),
|
|
168
181
|
__metadata("design:returntype", Object)
|
|
169
182
|
], Statement.prototype, "max", null);
|
|
170
183
|
__decorate([
|
|
171
|
-
(0,
|
|
184
|
+
(0, logging_1.final)(),
|
|
172
185
|
__metadata("design:type", Function),
|
|
173
186
|
__metadata("design:paramtypes", [typeof (_c = typeof S !== "undefined" && S) === "function" ? _c : Object]),
|
|
174
187
|
__metadata("design:returntype", Object)
|
|
175
188
|
], Statement.prototype, "min", null);
|
|
176
189
|
__decorate([
|
|
177
|
-
(0,
|
|
190
|
+
(0, logging_1.final)(),
|
|
178
191
|
__metadata("design:type", Function),
|
|
179
192
|
__metadata("design:paramtypes", [typeof (_d = typeof S !== "undefined" && S) === "function" ? _d : Object]),
|
|
180
193
|
__metadata("design:returntype", Object)
|
|
181
194
|
], Statement.prototype, "count", null);
|
|
182
195
|
__decorate([
|
|
183
|
-
(0,
|
|
196
|
+
(0, logging_1.final)(),
|
|
184
197
|
__metadata("design:type", Function),
|
|
185
198
|
__metadata("design:paramtypes", [Object]),
|
|
186
199
|
__metadata("design:returntype", Object)
|
|
187
200
|
], Statement.prototype, "from", null);
|
|
188
201
|
__decorate([
|
|
189
|
-
(0,
|
|
202
|
+
(0, logging_1.final)(),
|
|
190
203
|
__metadata("design:type", Function),
|
|
191
204
|
__metadata("design:paramtypes", [Condition_1.Condition]),
|
|
192
205
|
__metadata("design:returntype", Object)
|
|
193
206
|
], Statement.prototype, "where", null);
|
|
194
207
|
__decorate([
|
|
195
|
-
(0,
|
|
208
|
+
(0, logging_1.final)(),
|
|
196
209
|
__metadata("design:type", Function),
|
|
197
210
|
__metadata("design:paramtypes", [Array]),
|
|
198
211
|
__metadata("design:returntype", Object)
|
|
199
212
|
], Statement.prototype, "orderBy", null);
|
|
200
213
|
__decorate([
|
|
201
|
-
(0,
|
|
214
|
+
(0, logging_1.final)(),
|
|
202
215
|
__metadata("design:type", Function),
|
|
203
216
|
__metadata("design:paramtypes", [Object]),
|
|
204
217
|
__metadata("design:returntype", Object)
|
|
205
218
|
], Statement.prototype, "groupBy", null);
|
|
206
219
|
__decorate([
|
|
207
|
-
(0,
|
|
220
|
+
(0, logging_1.final)(),
|
|
208
221
|
__metadata("design:type", Function),
|
|
209
222
|
__metadata("design:paramtypes", [Number]),
|
|
210
223
|
__metadata("design:returntype", Object)
|
|
211
224
|
], Statement.prototype, "limit", null);
|
|
212
225
|
__decorate([
|
|
213
|
-
(0,
|
|
226
|
+
(0, logging_1.final)(),
|
|
214
227
|
__metadata("design:type", Function),
|
|
215
228
|
__metadata("design:paramtypes", [Number]),
|
|
216
229
|
__metadata("design:returntype", Object)
|
|
217
230
|
], Statement.prototype, "offset", null);
|
|
218
231
|
__decorate([
|
|
219
|
-
(0,
|
|
232
|
+
(0, logging_1.final)(),
|
|
220
233
|
__metadata("design:type", Function),
|
|
221
|
-
__metadata("design:paramtypes", []),
|
|
234
|
+
__metadata("design:paramtypes", [void 0]),
|
|
222
235
|
__metadata("design:returntype", Promise)
|
|
223
236
|
], Statement.prototype, "execute", null);
|
|
224
237
|
//# sourceMappingURL=Statement.js.map
|
package/lib/query/Statement.d.ts
CHANGED
|
@@ -5,10 +5,10 @@ import { Condition } from "./Condition";
|
|
|
5
5
|
import type { CountOption, DistinctOption, LimitOption, MaxOption, MinOption, OffsetOption, OrderAndGroupOption, SelectOption, WhereOption } from "./options";
|
|
6
6
|
import { Paginatable } from "../interfaces/Paginatable";
|
|
7
7
|
import { Paginator } from "./Paginator";
|
|
8
|
-
import { Adapter } from "../persistence";
|
|
8
|
+
import { Adapter, type ContextOf } from "../persistence";
|
|
9
9
|
import { Logger } from "@decaf-ts/logging";
|
|
10
|
-
import { LoggedClass } from "@decaf-ts/logging";
|
|
11
10
|
import { Constructor } from "@decaf-ts/decoration";
|
|
11
|
+
import { type ContextualArgs, ContextualLoggedClass, type MaybeContextualArg } from "../utils/index";
|
|
12
12
|
/**
|
|
13
13
|
* @description Base class for database query statements
|
|
14
14
|
* @summary Provides a foundation for building and executing database queries
|
|
@@ -60,8 +60,8 @@ import { Constructor } from "@decaf-ts/decoration";
|
|
|
60
60
|
* Adapter-->>Statement: return processed results
|
|
61
61
|
* Statement-->>Client: return final results
|
|
62
62
|
*/
|
|
63
|
-
export declare abstract class Statement<
|
|
64
|
-
protected adapter: Adapter<any, any, Q, any
|
|
63
|
+
export declare abstract class Statement<M extends Model, A extends Adapter<any, any, any, any>, R, Q = A extends Adapter<any, any, infer Q, any> ? Q : never> extends ContextualLoggedClass<ContextOf<A>> implements Executor<R>, RawExecutor<Q>, Paginatable<M, R, Q> {
|
|
64
|
+
protected adapter: Adapter<any, any, Q, any>;
|
|
65
65
|
protected readonly selectSelector?: SelectSelector<M>[];
|
|
66
66
|
protected distinctSelector?: SelectSelector<M>;
|
|
67
67
|
protected maxSelector?: SelectSelector<M>;
|
|
@@ -73,7 +73,7 @@ export declare abstract class Statement<Q, M extends Model, R> extends LoggedCla
|
|
|
73
73
|
protected groupBySelector?: GroupBySelector<M>;
|
|
74
74
|
protected limitSelector?: number;
|
|
75
75
|
protected offsetSelector?: number;
|
|
76
|
-
protected constructor(adapter: Adapter<any, any, Q, any
|
|
76
|
+
protected constructor(adapter: Adapter<any, any, Q, any>);
|
|
77
77
|
protected get log(): Logger;
|
|
78
78
|
select<S extends readonly SelectSelector<M>[]>(): SelectOption<M, M[]>;
|
|
79
79
|
select<S extends readonly SelectSelector<M>[]>(selector: readonly [...S]): SelectOption<M, Pick<M, S[number]>[]>;
|
|
@@ -87,9 +87,10 @@ export declare abstract class Statement<Q, M extends Model, R> extends LoggedCla
|
|
|
87
87
|
groupBy(selector: GroupBySelector<M>): LimitOption<M, R>;
|
|
88
88
|
limit(value: number): OffsetOption<R>;
|
|
89
89
|
offset(value: number): Executor<R>;
|
|
90
|
-
execute(): Promise<R>;
|
|
91
|
-
raw<R>(rawInput: Q): Promise<R>;
|
|
90
|
+
execute(...args: MaybeContextualArg<ContextOf<A>>): Promise<R>;
|
|
91
|
+
raw<R>(rawInput: Q, ...args: ContextualArgs<ContextOf<A>>): Promise<R>;
|
|
92
92
|
protected abstract build(): Q;
|
|
93
93
|
protected abstract parseCondition(condition: Condition<M>, ...args: any[]): Q;
|
|
94
|
-
abstract paginate(size: number): Promise<Paginator<M, R, Q>>;
|
|
94
|
+
abstract paginate(size: number, ...args: MaybeContextualArg<ContextOf<A>>): Promise<Paginator<M, R, Q>>;
|
|
95
|
+
toString(): string;
|
|
95
96
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Statement.js","sourceRoot":"","sources":["../../src/query/Statement.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,yEAAuD;AAQvD,+CAAwC;AACxC,
|
|
1
|
+
{"version":3,"file":"Statement.js","sourceRoot":"","sources":["../../src/query/Statement.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,yEAAuD;AAQvD,+CAAwC;AACxC,2DAAgF;AAChF,+CAA0C;AAc1C,4DAAyD;AACzD,yCAAsC;AAGtC,gDAIwB;AAExB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,MAAsB,SAMpB,SAAQ,6BAAmC;IAe3C,YAAgC,OAAkC;QAChE,KAAK,EAAE,CAAC;QADsB,YAAO,GAAP,OAAO,CAA2B;IAElE,CAAC;IAED,IAAuB,GAAG;QACxB,OAAQ,IAAI,CAAC,OAAe,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAClD,CAAC;IAWD,MAAM,CACJ,QAA0B;QAE1B,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,gBAAgB,EAAE;YAC5C,KAAK,EAAE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