@punks/backend-entity-manager 0.0.324 → 0.0.326
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/cjs/index.js +41 -16
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/platforms/nest/pipelines/template/utils.d.ts +6 -6
- package/dist/cjs/types/platforms/nest/services/operations/operation-lock.service.d.ts +2 -2
- package/dist/cjs/types/platforms/nest/services/operations/types.d.ts +9 -0
- package/dist/esm/index.js +42 -17
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/platforms/nest/pipelines/template/utils.d.ts +6 -6
- package/dist/esm/types/platforms/nest/services/operations/operation-lock-execute-exclusive.spec.d.ts +1 -0
- package/dist/esm/types/platforms/nest/services/operations/operation-lock-execute-sequential.spec.d.ts +1 -0
- package/dist/esm/types/platforms/nest/services/operations/operation-lock.service.d.ts +2 -2
- package/dist/esm/types/platforms/nest/services/operations/types.d.ts +9 -0
- package/dist/index.d.ts +14 -7
- package/package.json +1 -1
- /package/dist/cjs/types/platforms/nest/services/operations/{operation-lock.service.spec.d.ts → operation-lock-execute-exclusive.spec.d.ts} +0 -0
- /package/dist/{esm/types/platforms/nest/services/operations/operation-lock.service.spec.d.ts → cjs/types/platforms/nest/services/operations/operation-lock-execute-sequential.spec.d.ts} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { PipelineCompletedStepState } from "../../../../types";
|
|
2
2
|
export declare class PipelineUtils<TPipelineInput, TPipelineOutput, TContext> {
|
|
3
|
-
getStepByKey: (
|
|
4
|
-
getStepInputByKey: <TStepInput>(
|
|
5
|
-
getStepOutputByKey: <TStepOutput>(
|
|
6
|
-
getStep: (
|
|
7
|
-
getStepInput: <TStepInput>(
|
|
8
|
-
getStepOutput: <TStepOutput>(
|
|
3
|
+
getStepByKey: (state: PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>, key: string) => PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>;
|
|
4
|
+
getStepInputByKey: <TStepInput>(state: PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>, key: string) => TStepInput;
|
|
5
|
+
getStepOutputByKey: <TStepOutput>(state: PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>, key: string) => TStepOutput;
|
|
6
|
+
getStep: (state: PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>, index: number) => PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>;
|
|
7
|
+
getStepInput: <TStepInput>(state: PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>, index: number) => TStepInput;
|
|
8
|
+
getStepOutput: <TStepOutput>(state: PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>, index: number) => TStepOutput;
|
|
9
9
|
}
|
package/dist/esm/types/platforms/nest/services/operations/operation-lock-execute-exclusive.spec.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ILockRepository } from "../../../../abstractions";
|
|
2
|
-
import { ExclusiveOperationResult, ExecuteExclusiveInput } from "./types";
|
|
2
|
+
import { ExclusiveOperationResult, ExecuteExclusiveInput, ExecuteSequentialInput } from "./types";
|
|
3
3
|
export declare class OperationLockService {
|
|
4
4
|
private readonly operations;
|
|
5
5
|
private readonly logger;
|
|
6
6
|
constructor(operations: ILockRepository);
|
|
7
|
+
executeSequential: <T>(input: ExecuteSequentialInput<T>) => Promise<T>;
|
|
7
8
|
executeExclusive: <T>(input: ExecuteExclusiveInput<T>) => Promise<ExclusiveOperationResult<T>>;
|
|
8
|
-
private executeOperation;
|
|
9
9
|
private isLockExpired;
|
|
10
10
|
}
|
|
@@ -10,3 +10,12 @@ export declare class ExclusiveOperationResult<T> {
|
|
|
10
10
|
skipped: boolean;
|
|
11
11
|
result?: T;
|
|
12
12
|
}
|
|
13
|
+
export interface ExecuteSequentialInput<T> {
|
|
14
|
+
lockUid: string;
|
|
15
|
+
requestedBy?: string;
|
|
16
|
+
lockTimeout?: number;
|
|
17
|
+
lockPolling?: number;
|
|
18
|
+
operation: () => Promise<T>;
|
|
19
|
+
}
|
|
20
|
+
export declare class ExecuteSequentialTimeoutError extends Error {
|
|
21
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1740,13 +1740,20 @@ declare class ExclusiveOperationResult<T> {
|
|
|
1740
1740
|
skipped: boolean;
|
|
1741
1741
|
result?: T;
|
|
1742
1742
|
}
|
|
1743
|
+
interface ExecuteSequentialInput<T> {
|
|
1744
|
+
lockUid: string;
|
|
1745
|
+
requestedBy?: string;
|
|
1746
|
+
lockTimeout?: number;
|
|
1747
|
+
lockPolling?: number;
|
|
1748
|
+
operation: () => Promise<T>;
|
|
1749
|
+
}
|
|
1743
1750
|
|
|
1744
1751
|
declare class OperationLockService {
|
|
1745
1752
|
private readonly operations;
|
|
1746
1753
|
private readonly logger;
|
|
1747
1754
|
constructor(operations: ILockRepository);
|
|
1755
|
+
executeSequential: <T>(input: ExecuteSequentialInput<T>) => Promise<T>;
|
|
1748
1756
|
executeExclusive: <T>(input: ExecuteExclusiveInput<T>) => Promise<ExclusiveOperationResult<T>>;
|
|
1749
|
-
private executeOperation;
|
|
1750
1757
|
private isLockExpired;
|
|
1751
1758
|
}
|
|
1752
1759
|
|
|
@@ -2633,12 +2640,12 @@ declare class PipelinesRunner {
|
|
|
2633
2640
|
}
|
|
2634
2641
|
|
|
2635
2642
|
declare class PipelineUtils<TPipelineInput, TPipelineOutput, TContext> {
|
|
2636
|
-
getStepByKey: (
|
|
2637
|
-
getStepInputByKey: <TStepInput>(
|
|
2638
|
-
getStepOutputByKey: <TStepOutput>(
|
|
2639
|
-
getStep: (
|
|
2640
|
-
getStepInput: <TStepInput>(
|
|
2641
|
-
getStepOutput: <TStepOutput>(
|
|
2643
|
+
getStepByKey: (state: PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>, key: string) => PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>;
|
|
2644
|
+
getStepInputByKey: <TStepInput>(state: PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>, key: string) => TStepInput;
|
|
2645
|
+
getStepOutputByKey: <TStepOutput>(state: PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>, key: string) => TStepOutput;
|
|
2646
|
+
getStep: (state: PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>, index: number) => PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>;
|
|
2647
|
+
getStepInput: <TStepInput>(state: PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>, index: number) => TStepInput;
|
|
2648
|
+
getStepOutput: <TStepOutput>(state: PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>, index: number) => TStepOutput;
|
|
2642
2649
|
}
|
|
2643
2650
|
|
|
2644
2651
|
declare abstract class NestPipelineTemplate<TPipelineInput, TPipelineOutput, TContext> {
|
package/package.json
CHANGED
|
File without changes
|