@decaf-ts/core 0.25.3 → 0.25.5
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/core.cjs +1 -1
- package/dist/core.cjs.map +1 -1
- package/dist/core.js.map +1 -1
- package/lib/cjs/index.cjs +3 -3
- package/lib/esm/index.js +3 -3
- package/lib/esm/repository/Repository.js.map +1 -1
- package/lib/esm/services/ModelService.js.map +1 -1
- package/lib/esm/services/services.js.map +1 -1
- package/lib/esm/tasks/TaskEngine.js.map +1 -1
- package/lib/esm/utils/ContextualLoggedClass.js.map +1 -1
- package/lib/types/index.d.cts +3 -3
- package/lib/types/index.d.mts +3 -3
- package/lib/types/repository/Repository.d.cts +6 -5
- package/lib/types/repository/Repository.d.mts +6 -5
- package/lib/types/services/ModelService.d.cts +5 -4
- package/lib/types/services/ModelService.d.mts +5 -4
- package/lib/types/services/services.d.cts +4 -4
- package/lib/types/services/services.d.mts +4 -4
- package/lib/types/tasks/TaskEngine.d.cts +1 -1
- package/lib/types/tasks/TaskEngine.d.mts +1 -1
- package/lib/types/tasks/types.d.cts +1 -0
- package/lib/types/tasks/types.d.mts +1 -0
- package/lib/types/utils/ContextualLoggedClass.d.cts +5 -5
- package/lib/types/utils/ContextualLoggedClass.d.mts +5 -5
- package/package.json +1 -1
|
@@ -15,6 +15,7 @@ import type { Observer } from "../interfaces/Observer.d.cts";
|
|
|
15
15
|
import { Constructor } from "@decaf-ts/decoration";
|
|
16
16
|
import { Model } from "@decaf-ts/decorator-validation";
|
|
17
17
|
import { SerializedPage } from "../query/Paginator.d.cts";
|
|
18
|
+
import { Context } from "../persistence/index.d.cts";
|
|
18
19
|
/**
|
|
19
20
|
* @description Type alias for Repository class with simplified generic parameters.
|
|
20
21
|
* @summary Provides a more concise way to reference the Repository class with its generic parameters.
|
|
@@ -117,11 +118,11 @@ export declare class Repository<M extends Model<boolean>, A extends Adapter<any,
|
|
|
117
118
|
protected get pkProps(): SequenceOptions;
|
|
118
119
|
get filters(): Record<"onlyOnCreate" | "onlyOnUpdate" | "onlyOnDelete" | "onlyOnTransactional" | "onlyOnSingle" | "onlyOnBulk", ObserverFilter>;
|
|
119
120
|
constructor(adapter?: A, clazz?: Constructor<M>, force?: boolean, ...args: any[]);
|
|
120
|
-
protected logCtx<ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<
|
|
121
|
-
protected logCtx<ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<
|
|
122
|
-
protected logCtx<ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<
|
|
123
|
-
protected logCtx<ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<
|
|
124
|
-
protected logCtx<ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<
|
|
121
|
+
protected logCtx<CONTEXT extends Context<any> = ContextOf<A>, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<CONTEXT, ARGS>, operation: METHOD): ContextualizedArgs<ContextOf<A>, ARGS, METHOD extends string ? true : false>;
|
|
122
|
+
protected logCtx<CONTEXT extends Context<any> = ContextOf<A>, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<CONTEXT, ARGS>, operation: METHOD, allowCreate: false): ContextualizedArgs<ContextOf<A>, ARGS, METHOD extends string ? true : false>;
|
|
123
|
+
protected logCtx<CONTEXT extends Context<any> = ContextOf<A>, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<CONTEXT, ARGS>, operation: METHOD, allowCreate: true): Promise<ContextualizedArgs<ContextOf<A>, ARGS, METHOD extends string ? true : false>>;
|
|
124
|
+
protected logCtx<CONTEXT extends Context<any> = ContextOf<A>, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<CONTEXT, ARGS>, operation: METHOD, allowCreate: true, overrides?: Partial<FlagsOf<ContextOf<A>>>): Promise<ContextualizedArgs<ContextOf<A>, ARGS, METHOD extends string ? true : false>>;
|
|
125
|
+
protected logCtx<CONTEXT extends Context<any> = ContextOf<A>, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<CONTEXT, ARGS>, operation: METHOD, allowCreate: false, overrides?: Partial<FlagsOf<ContextOf<A>>>): ContextualizedArgs<ContextOf<A>, ARGS, METHOD extends string ? true : false>;
|
|
125
126
|
/**
|
|
126
127
|
* @description Creates a proxy with overridden repository flags.
|
|
127
128
|
* @summary Returns a proxy of this repository with the specified flags overridden.
|
|
@@ -15,6 +15,7 @@ import type { Observer } from "../interfaces/Observer.d.mts";
|
|
|
15
15
|
import { Constructor } from "@decaf-ts/decoration";
|
|
16
16
|
import { Model } from "@decaf-ts/decorator-validation";
|
|
17
17
|
import { SerializedPage } from "../query/Paginator.d.mts";
|
|
18
|
+
import { Context } from "../persistence/index.d.mts";
|
|
18
19
|
/**
|
|
19
20
|
* @description Type alias for Repository class with simplified generic parameters.
|
|
20
21
|
* @summary Provides a more concise way to reference the Repository class with its generic parameters.
|
|
@@ -117,11 +118,11 @@ export declare class Repository<M extends Model<boolean>, A extends Adapter<any,
|
|
|
117
118
|
protected get pkProps(): SequenceOptions;
|
|
118
119
|
get filters(): Record<"onlyOnCreate" | "onlyOnUpdate" | "onlyOnDelete" | "onlyOnTransactional" | "onlyOnSingle" | "onlyOnBulk", ObserverFilter>;
|
|
119
120
|
constructor(adapter?: A, clazz?: Constructor<M>, force?: boolean, ...args: any[]);
|
|
120
|
-
protected logCtx<ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<
|
|
121
|
-
protected logCtx<ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<
|
|
122
|
-
protected logCtx<ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<
|
|
123
|
-
protected logCtx<ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<
|
|
124
|
-
protected logCtx<ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<
|
|
121
|
+
protected logCtx<CONTEXT extends Context<any> = ContextOf<A>, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<CONTEXT, ARGS>, operation: METHOD): ContextualizedArgs<ContextOf<A>, ARGS, METHOD extends string ? true : false>;
|
|
122
|
+
protected logCtx<CONTEXT extends Context<any> = ContextOf<A>, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<CONTEXT, ARGS>, operation: METHOD, allowCreate: false): ContextualizedArgs<ContextOf<A>, ARGS, METHOD extends string ? true : false>;
|
|
123
|
+
protected logCtx<CONTEXT extends Context<any> = ContextOf<A>, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<CONTEXT, ARGS>, operation: METHOD, allowCreate: true): Promise<ContextualizedArgs<ContextOf<A>, ARGS, METHOD extends string ? true : false>>;
|
|
124
|
+
protected logCtx<CONTEXT extends Context<any> = ContextOf<A>, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<CONTEXT, ARGS>, operation: METHOD, allowCreate: true, overrides?: Partial<FlagsOf<ContextOf<A>>>): Promise<ContextualizedArgs<ContextOf<A>, ARGS, METHOD extends string ? true : false>>;
|
|
125
|
+
protected logCtx<CONTEXT extends Context<any> = ContextOf<A>, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<CONTEXT, ARGS>, operation: METHOD, allowCreate: false, overrides?: Partial<FlagsOf<ContextOf<A>>>): ContextualizedArgs<ContextOf<A>, ARGS, METHOD extends string ? true : false>;
|
|
125
126
|
/**
|
|
126
127
|
* @description Creates a proxy with overridden repository flags.
|
|
127
128
|
* @summary Returns a proxy of this repository with the specified flags overridden.
|
|
@@ -9,8 +9,9 @@ import { OrderDirection } from "../repository/constants.d.cts";
|
|
|
9
9
|
import { type DirectionLimitOffset } from "../query/types.d.cts";
|
|
10
10
|
import { type Observer } from "../interfaces/index.d.cts";
|
|
11
11
|
import { SelectSelector, WhereOption } from "../query/index.d.cts";
|
|
12
|
+
import { Context } from "../persistence/index.d.cts";
|
|
12
13
|
export type ArrayMode = "one" | "many";
|
|
13
|
-
export declare class ModelService<M extends Model<boolean>, R extends Repo<M> = Repo<M>> extends Service implements IRepository<M, ContextOf<R>>, PersistenceObservable<ContextOf<R>>, PersistenceObserver<ContextOf<R>> {
|
|
14
|
+
export declare class ModelService<M extends Model<boolean>, R extends Repo<M> = Repo<M>> extends Service<ContextOf<R>> implements IRepository<M, ContextOf<R>>, PersistenceObservable<ContextOf<R>>, PersistenceObserver<ContextOf<R>> {
|
|
14
15
|
private readonly clazz;
|
|
15
16
|
protected _repository: R;
|
|
16
17
|
get class(): Constructor<M>;
|
|
@@ -39,7 +40,7 @@ export declare class ModelService<M extends Model<boolean>, R extends Repo<M> =
|
|
|
39
40
|
observe(observer: Observer, filter?: ObserverFilter): () => void;
|
|
40
41
|
unObserve(observer: Observer): void;
|
|
41
42
|
updateObservers(model: Constructor, operation: AllOperationKeys, ids: EventIds, ...args: ContextualArgs<ContextOf<R>>): Promise<void>;
|
|
42
|
-
protected logCtx<ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<
|
|
43
|
-
protected logCtx<ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<
|
|
44
|
-
protected logCtx<ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<
|
|
43
|
+
protected logCtx<CONTEXT extends Context<any> = Context<any>, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<CONTEXT, ARGS>, operation: METHOD): ContextualizedArgs<ContextOf<this["repo"]>, ARGS, METHOD extends string ? true : false>;
|
|
44
|
+
protected logCtx<CONTEXT extends Context<any> = Context<any>, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<CONTEXT, ARGS>, operation: METHOD, allowCreate: false): ContextualizedArgs<ContextOf<this["repo"]>, ARGS, METHOD extends string ? true : false>;
|
|
45
|
+
protected logCtx<CONTEXT extends Context<any> = Context<any>, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<CONTEXT, ARGS>, operation: METHOD, allowCreate: true): Promise<ContextualizedArgs<ContextOf<this["repo"]>, ARGS, METHOD extends string ? true : false>>;
|
|
45
46
|
}
|
|
@@ -9,8 +9,9 @@ import { OrderDirection } from "../repository/constants.d.mts";
|
|
|
9
9
|
import { type DirectionLimitOffset } from "../query/types.d.mts";
|
|
10
10
|
import { type Observer } from "../interfaces/index.d.mts";
|
|
11
11
|
import { SelectSelector, WhereOption } from "../query/index.d.mts";
|
|
12
|
+
import { Context } from "../persistence/index.d.mts";
|
|
12
13
|
export type ArrayMode = "one" | "many";
|
|
13
|
-
export declare class ModelService<M extends Model<boolean>, R extends Repo<M> = Repo<M>> extends Service implements IRepository<M, ContextOf<R>>, PersistenceObservable<ContextOf<R>>, PersistenceObserver<ContextOf<R>> {
|
|
14
|
+
export declare class ModelService<M extends Model<boolean>, R extends Repo<M> = Repo<M>> extends Service<ContextOf<R>> implements IRepository<M, ContextOf<R>>, PersistenceObservable<ContextOf<R>>, PersistenceObserver<ContextOf<R>> {
|
|
14
15
|
private readonly clazz;
|
|
15
16
|
protected _repository: R;
|
|
16
17
|
get class(): Constructor<M>;
|
|
@@ -39,7 +40,7 @@ export declare class ModelService<M extends Model<boolean>, R extends Repo<M> =
|
|
|
39
40
|
observe(observer: Observer, filter?: ObserverFilter): () => void;
|
|
40
41
|
unObserve(observer: Observer): void;
|
|
41
42
|
updateObservers(model: Constructor, operation: AllOperationKeys, ids: EventIds, ...args: ContextualArgs<ContextOf<R>>): Promise<void>;
|
|
42
|
-
protected logCtx<ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<
|
|
43
|
-
protected logCtx<ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<
|
|
44
|
-
protected logCtx<ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<
|
|
43
|
+
protected logCtx<CONTEXT extends Context<any> = Context<any>, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<CONTEXT, ARGS>, operation: METHOD): ContextualizedArgs<ContextOf<this["repo"]>, ARGS, METHOD extends string ? true : false>;
|
|
44
|
+
protected logCtx<CONTEXT extends Context<any> = Context<any>, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<CONTEXT, ARGS>, operation: METHOD, allowCreate: false): ContextualizedArgs<ContextOf<this["repo"]>, ARGS, METHOD extends string ? true : false>;
|
|
45
|
+
protected logCtx<CONTEXT extends Context<any> = Context<any>, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<CONTEXT, ARGS>, operation: METHOD, allowCreate: true): Promise<ContextualizedArgs<ContextOf<this["repo"]>, ARGS, METHOD extends string ? true : false>>;
|
|
45
46
|
}
|
|
@@ -66,9 +66,9 @@ export declare abstract class Service<C extends Context<ContextFlags<any>> = Con
|
|
|
66
66
|
*/
|
|
67
67
|
protected readonly Context: Constructor<C>;
|
|
68
68
|
context(operation: ((...args: any[]) => any) | string, overrides: Partial<FlagsOf<C>>, ...args: MaybeContextualArg<Context<any>>): Promise<C>;
|
|
69
|
-
protected logCtx<
|
|
70
|
-
protected logCtx<CONTEXT extends Context<any> = C, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<CONTEXT, ARGS>, operation: METHOD, allowCreate: false, overrides?: Partial<FlagsOf<CONTEXT>>): ContextualizedArgs<
|
|
71
|
-
protected logCtx<CONTEXT extends Context<any> = C, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<CONTEXT, ARGS>, operation: METHOD, allowCreate: true, overrides?: Partial<FlagsOf<CONTEXT>>): Promise<ContextualizedArgs<
|
|
69
|
+
protected logCtx<ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<C, ARGS>, operation: METHOD): ContextualizedArgs<C, ARGS, METHOD extends string ? true : false>;
|
|
70
|
+
protected logCtx<CONTEXT extends Context<any> = C, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<CONTEXT, ARGS>, operation: METHOD, allowCreate: false, overrides?: Partial<FlagsOf<CONTEXT>>): ContextualizedArgs<C, ARGS, METHOD extends string ? true : false>;
|
|
71
|
+
protected logCtx<CONTEXT extends Context<any> = C, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<CONTEXT, ARGS>, operation: METHOD, allowCreate: true, overrides?: Partial<FlagsOf<CONTEXT>>): Promise<ContextualizedArgs<C, ARGS, METHOD extends string ? true : false>>;
|
|
72
72
|
/**
|
|
73
73
|
* @description Retrieves a Service instance by name/class
|
|
74
74
|
* @summary Looks up and returns a cached API instance by its name or constructor
|
|
@@ -80,7 +80,7 @@ export declare abstract class Service<C extends Context<ContextFlags<any>> = Con
|
|
|
80
80
|
static boot<C extends Context<any> = any>(...args: MaybeContextualArg<C>): Promise<void>;
|
|
81
81
|
static shutdown<C extends Context<any> = any>(...args: MaybeContextualArg<C>): Promise<void>;
|
|
82
82
|
}
|
|
83
|
-
export declare abstract class ClientBasedService<CLIENT, CONF, C extends Context<any> = any> extends Service {
|
|
83
|
+
export declare abstract class ClientBasedService<CLIENT, CONF, C extends Context<any> = any> extends Service<C> {
|
|
84
84
|
protected _client?: CLIENT;
|
|
85
85
|
protected _config?: CONF;
|
|
86
86
|
protected constructor();
|
|
@@ -66,9 +66,9 @@ export declare abstract class Service<C extends Context<ContextFlags<any>> = Con
|
|
|
66
66
|
*/
|
|
67
67
|
protected readonly Context: Constructor<C>;
|
|
68
68
|
context(operation: ((...args: any[]) => any) | string, overrides: Partial<FlagsOf<C>>, ...args: MaybeContextualArg<Context<any>>): Promise<C>;
|
|
69
|
-
protected logCtx<
|
|
70
|
-
protected logCtx<CONTEXT extends Context<any> = C, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<CONTEXT, ARGS>, operation: METHOD, allowCreate: false, overrides?: Partial<FlagsOf<CONTEXT>>): ContextualizedArgs<
|
|
71
|
-
protected logCtx<CONTEXT extends Context<any> = C, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<CONTEXT, ARGS>, operation: METHOD, allowCreate: true, overrides?: Partial<FlagsOf<CONTEXT>>): Promise<ContextualizedArgs<
|
|
69
|
+
protected logCtx<ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<C, ARGS>, operation: METHOD): ContextualizedArgs<C, ARGS, METHOD extends string ? true : false>;
|
|
70
|
+
protected logCtx<CONTEXT extends Context<any> = C, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<CONTEXT, ARGS>, operation: METHOD, allowCreate: false, overrides?: Partial<FlagsOf<CONTEXT>>): ContextualizedArgs<C, ARGS, METHOD extends string ? true : false>;
|
|
71
|
+
protected logCtx<CONTEXT extends Context<any> = C, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<CONTEXT, ARGS>, operation: METHOD, allowCreate: true, overrides?: Partial<FlagsOf<CONTEXT>>): Promise<ContextualizedArgs<C, ARGS, METHOD extends string ? true : false>>;
|
|
72
72
|
/**
|
|
73
73
|
* @description Retrieves a Service instance by name/class
|
|
74
74
|
* @summary Looks up and returns a cached API instance by its name or constructor
|
|
@@ -80,7 +80,7 @@ export declare abstract class Service<C extends Context<ContextFlags<any>> = Con
|
|
|
80
80
|
static boot<C extends Context<any> = any>(...args: MaybeContextualArg<C>): Promise<void>;
|
|
81
81
|
static shutdown<C extends Context<any> = any>(...args: MaybeContextualArg<C>): Promise<void>;
|
|
82
82
|
}
|
|
83
|
-
export declare abstract class ClientBasedService<CLIENT, CONF, C extends Context<any> = any> extends Service {
|
|
83
|
+
export declare abstract class ClientBasedService<CLIENT, CONF, C extends Context<any> = any> extends Service<C> {
|
|
84
84
|
protected _client?: CLIENT;
|
|
85
85
|
protected _config?: CONF;
|
|
86
86
|
protected constructor();
|
|
@@ -25,7 +25,7 @@ type ParsedTaskDependency = {
|
|
|
25
25
|
taskId: string;
|
|
26
26
|
stepRef?: string;
|
|
27
27
|
};
|
|
28
|
-
export declare class TaskEngine<A extends Adapter<any, any, any, any>, C extends TaskEngineConfig<A> = TaskEngineConfig<A>> extends AbsContextual<
|
|
28
|
+
export declare class TaskEngine<A extends Adapter<any, any, any, any>, C extends TaskEngineConfig<A> = TaskEngineConfig<A>> extends AbsContextual<TaskContext> {
|
|
29
29
|
protected config: C;
|
|
30
30
|
private _tasks?;
|
|
31
31
|
private _events?;
|
|
@@ -25,7 +25,7 @@ type ParsedTaskDependency = {
|
|
|
25
25
|
taskId: string;
|
|
26
26
|
stepRef?: string;
|
|
27
27
|
};
|
|
28
|
-
export declare class TaskEngine<A extends Adapter<any, any, any, any>, C extends TaskEngineConfig<A> = TaskEngineConfig<A>> extends AbsContextual<
|
|
28
|
+
export declare class TaskEngine<A extends Adapter<any, any, any, any>, C extends TaskEngineConfig<A> = TaskEngineConfig<A>> extends AbsContextual<TaskContext> {
|
|
29
29
|
protected config: C;
|
|
30
30
|
private _tasks?;
|
|
31
31
|
private _events?;
|
|
@@ -37,6 +37,7 @@ export interface TaskFlags<LOG extends TaskLogger<any> = TaskLogger<any>> extend
|
|
|
37
37
|
heartbeat: () => Promise<void>;
|
|
38
38
|
scheduleCompositeSteps?: (steps: TaskStepSpecModel[]) => Promise<void>;
|
|
39
39
|
resultCache?: Record<string, any>;
|
|
40
|
+
gracefulShutdownMsTimeout?: number;
|
|
40
41
|
}
|
|
41
42
|
export type TaskEngineConfig<A extends Adapter<any, any, any, any>> = {
|
|
42
43
|
adapter: A;
|
|
@@ -37,6 +37,7 @@ export interface TaskFlags<LOG extends TaskLogger<any> = TaskLogger<any>> extend
|
|
|
37
37
|
heartbeat: () => Promise<void>;
|
|
38
38
|
scheduleCompositeSteps?: (steps: TaskStepSpecModel[]) => Promise<void>;
|
|
39
39
|
resultCache?: Record<string, any>;
|
|
40
|
+
gracefulShutdownMsTimeout?: number;
|
|
40
41
|
}
|
|
41
42
|
export type TaskEngineConfig<A extends Adapter<any, any, any, any>> = {
|
|
42
43
|
adapter: A;
|
|
@@ -7,8 +7,8 @@ import { PersistenceKeys } from "../persistence/index.d.cts";
|
|
|
7
7
|
import { PreparedStatementKeys } from "../query/index.d.cts";
|
|
8
8
|
export type ContextualArgs<C extends Context<any>, ARGS extends any[] = any[]> = [...ARGS, C] | [C];
|
|
9
9
|
export type MethodOrOperation = ((...args: any[]) => any) | string | OperationKeys | PersistenceKeys | BulkCrudOperationKeys | PreparedStatementKeys;
|
|
10
|
-
export type MaybeContextualArg<C extends Context<any
|
|
11
|
-
export type ContextualizedArgs<C extends Context<any
|
|
10
|
+
export type MaybeContextualArg<C extends Context<any> = any, ARGS extends any[] = any[]> = any[] | ContextualArgs<C, ARGS>;
|
|
11
|
+
export type ContextualizedArgs<C extends Context<any> = any, ARGS extends any[] = any[], EXTEND extends boolean = false> = EXTEND extends true ? {
|
|
12
12
|
ctx: C;
|
|
13
13
|
log: LoggerOf<C>;
|
|
14
14
|
ctxArgs: ContextualArgs<C, ARGS>;
|
|
@@ -19,9 +19,9 @@ export type ContextualizedArgs<C extends Context<any>, ARGS extends any[] = any[
|
|
|
19
19
|
ctxArgs: ContextualArgs<C, ARGS>;
|
|
20
20
|
};
|
|
21
21
|
export declare abstract class ContextualLoggedClass<C extends Context<any>> extends LoggedClass {
|
|
22
|
-
protected logCtx<CONTEXT extends Context<any> = C, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<CONTEXT, ARGS>, operation: METHOD): ContextualizedArgs<
|
|
23
|
-
protected logCtx<CONTEXT extends Context<any> = C, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<CONTEXT, ARGS>, operation: METHOD, allowCreate: false, overrides?: Partial<FlagsOf<
|
|
24
|
-
protected logCtx<CONTEXT extends Context<any> = C, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<CONTEXT, ARGS>, operation: METHOD, allowCreate: true, overrides?: Partial<FlagsOf<
|
|
22
|
+
protected logCtx<CONTEXT extends Context<any> = C, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<CONTEXT, ARGS>, operation: METHOD): ContextualizedArgs<C, ARGS, METHOD extends string ? true : false>;
|
|
23
|
+
protected logCtx<CONTEXT extends Context<any> = C, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<CONTEXT, ARGS>, operation: METHOD, allowCreate: false, overrides?: Partial<FlagsOf<C>>): ContextualizedArgs<C, ARGS, METHOD extends string ? true : false>;
|
|
24
|
+
protected logCtx<CONTEXT extends Context<any> = C, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<CONTEXT, ARGS>, operation: METHOD, allowCreate: true, overrides?: Partial<FlagsOf<C>>): Promise<ContextualizedArgs<C, ARGS, METHOD extends string ? true : false>>;
|
|
25
25
|
static logFrom<CONTEXT extends Context<any>, A = any | Contextual<CONTEXT>, METHOD extends MethodOrOperation = MethodOrOperation>(obj: A, logger: LoggerOf<any>, ctx: CONTEXT, method?: METHOD | keyof A): Logger;
|
|
26
26
|
static logCtx<CONTEXT extends Context<any>, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(this: any, operation: METHOD, ...args: MaybeContextualArg<CONTEXT, ARGS>): ContextualizedArgs<CONTEXT, ARGS, METHOD extends string ? true : false>;
|
|
27
27
|
}
|
|
@@ -7,8 +7,8 @@ import { PersistenceKeys } from "../persistence/index.d.mts";
|
|
|
7
7
|
import { PreparedStatementKeys } from "../query/index.d.mts";
|
|
8
8
|
export type ContextualArgs<C extends Context<any>, ARGS extends any[] = any[]> = [...ARGS, C] | [C];
|
|
9
9
|
export type MethodOrOperation = ((...args: any[]) => any) | string | OperationKeys | PersistenceKeys | BulkCrudOperationKeys | PreparedStatementKeys;
|
|
10
|
-
export type MaybeContextualArg<C extends Context<any
|
|
11
|
-
export type ContextualizedArgs<C extends Context<any
|
|
10
|
+
export type MaybeContextualArg<C extends Context<any> = any, ARGS extends any[] = any[]> = any[] | ContextualArgs<C, ARGS>;
|
|
11
|
+
export type ContextualizedArgs<C extends Context<any> = any, ARGS extends any[] = any[], EXTEND extends boolean = false> = EXTEND extends true ? {
|
|
12
12
|
ctx: C;
|
|
13
13
|
log: LoggerOf<C>;
|
|
14
14
|
ctxArgs: ContextualArgs<C, ARGS>;
|
|
@@ -19,9 +19,9 @@ export type ContextualizedArgs<C extends Context<any>, ARGS extends any[] = any[
|
|
|
19
19
|
ctxArgs: ContextualArgs<C, ARGS>;
|
|
20
20
|
};
|
|
21
21
|
export declare abstract class ContextualLoggedClass<C extends Context<any>> extends LoggedClass {
|
|
22
|
-
protected logCtx<CONTEXT extends Context<any> = C, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<CONTEXT, ARGS>, operation: METHOD): ContextualizedArgs<
|
|
23
|
-
protected logCtx<CONTEXT extends Context<any> = C, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<CONTEXT, ARGS>, operation: METHOD, allowCreate: false, overrides?: Partial<FlagsOf<
|
|
24
|
-
protected logCtx<CONTEXT extends Context<any> = C, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<CONTEXT, ARGS>, operation: METHOD, allowCreate: true, overrides?: Partial<FlagsOf<
|
|
22
|
+
protected logCtx<CONTEXT extends Context<any> = C, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<CONTEXT, ARGS>, operation: METHOD): ContextualizedArgs<C, ARGS, METHOD extends string ? true : false>;
|
|
23
|
+
protected logCtx<CONTEXT extends Context<any> = C, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<CONTEXT, ARGS>, operation: METHOD, allowCreate: false, overrides?: Partial<FlagsOf<C>>): ContextualizedArgs<C, ARGS, METHOD extends string ? true : false>;
|
|
24
|
+
protected logCtx<CONTEXT extends Context<any> = C, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<CONTEXT, ARGS>, operation: METHOD, allowCreate: true, overrides?: Partial<FlagsOf<C>>): Promise<ContextualizedArgs<C, ARGS, METHOD extends string ? true : false>>;
|
|
25
25
|
static logFrom<CONTEXT extends Context<any>, A = any | Contextual<CONTEXT>, METHOD extends MethodOrOperation = MethodOrOperation>(obj: A, logger: LoggerOf<any>, ctx: CONTEXT, method?: METHOD | keyof A): Logger;
|
|
26
26
|
static logCtx<CONTEXT extends Context<any>, ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(this: any, operation: METHOD, ...args: MaybeContextualArg<CONTEXT, ARGS>): ContextualizedArgs<CONTEXT, ARGS, METHOD extends string ? true : false>;
|
|
27
27
|
}
|