@decaf-ts/core 0.25.2 → 0.25.4
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/cjs/index.cjs +16 -2
- package/lib/cjs/index.cjs.map +1 -1
- package/lib/cjs/services/ModelService.cjs +2 -2
- package/lib/cjs/services/ModelService.cjs.map +1 -1
- package/lib/cjs/services/services.cjs +1 -2
- package/lib/cjs/services/services.cjs.map +1 -1
- package/lib/esm/index.js +15 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/services/ModelService.js +2 -2
- package/lib/esm/services/ModelService.js.map +1 -1
- package/lib/esm/services/services.js +1 -2
- 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 +15 -1
- package/lib/types/index.d.mts +15 -1
- package/lib/types/services/ModelService.d.cts +1 -1
- package/lib/types/services/ModelService.d.mts +1 -1
- package/lib/types/services/services.d.cts +1 -2
- package/lib/types/services/services.d.mts +1 -2
- 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
|
@@ -5,10 +5,9 @@ import { Constructor } from "@decaf-ts/decoration";
|
|
|
5
5
|
import type { Observer } from "../interfaces/Observer.d.mts";
|
|
6
6
|
import { ObserverHandler } from "../persistence/ObserverHandler.d.mts";
|
|
7
7
|
export declare abstract class Service<C extends Context<ContextFlags<any>> = Context<ContextFlags<any>>> extends ContextualLoggedClass<C> implements PersistenceObservable<C>, PersistenceObserver<C> {
|
|
8
|
-
readonly name?: string | undefined;
|
|
9
8
|
protected observers: Observer[];
|
|
10
9
|
protected observerHandler?: ObserverHandler;
|
|
11
|
-
protected constructor(
|
|
10
|
+
protected constructor();
|
|
12
11
|
for(conf: any, ...args: any[]): this;
|
|
13
12
|
override(conf: any, ...args: any[]): this;
|
|
14
13
|
/**
|
|
@@ -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<
|
|
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<ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<C, 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<
|
|
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<ARGS extends any[] = any[], METHOD extends MethodOrOperation = MethodOrOperation>(args: MaybeContextualArg<C, 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
|
}
|