@punks/backend-entity-manager 0.0.270 → 0.0.272
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 +24 -10
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/platforms/nest/extensions/jobs/abstractions/repository.d.ts +8 -8
- package/dist/cjs/types/platforms/nest/module.d.ts +4 -1
- package/dist/esm/index.js +24 -10
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/platforms/nest/extensions/jobs/abstractions/repository.d.ts +8 -8
- package/dist/esm/types/platforms/nest/module.d.ts +4 -1
- package/dist/index.d.ts +11 -8
- package/package.json +1 -1
|
@@ -2,17 +2,17 @@ import { JobDefinition } from "./definition";
|
|
|
2
2
|
import { JobInstance, JobStatus } from "./instance";
|
|
3
3
|
type JobData = Omit<JobDefinition<unknown, unknown>, "id" | "createdOn" | "updatedOn">;
|
|
4
4
|
export interface IJobDefinitionsRepository {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
getAllDefinitions(): Promise<JobDefinition<unknown, unknown>[]>;
|
|
6
|
+
getDefinitionByUid(uid: string): Promise<JobDefinition<unknown, unknown> | undefined>;
|
|
7
|
+
ensureDefinition(data: JobData): Promise<JobDefinition<unknown, unknown>>;
|
|
8
|
+
createDefinition(data: JobData): Promise<JobDefinition<unknown, unknown>>;
|
|
9
|
+
updateDefinition(uid: string, data: JobData): Promise<JobDefinition<unknown, unknown>>;
|
|
10
10
|
}
|
|
11
11
|
export interface IJobInstancesRepository {
|
|
12
|
-
|
|
12
|
+
getById(id: string): Promise<JobInstance>;
|
|
13
13
|
getByStatus(...status: JobStatus[]): Promise<JobInstance[]>;
|
|
14
14
|
getLastInstance(jobUid: string, scheduleUid: string): Promise<JobInstance | undefined>;
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
appendInstance(job: JobDefinition<unknown, unknown>, data: Pick<JobInstance, "id" | "insertTime" | "scheduleUid" | "runType">): Promise<JobInstance>;
|
|
16
|
+
updateInstance(instanceId: string, data: Pick<JobInstance, "startTime" | "endTime" | "status" | "result" | "error">): Promise<JobInstance>;
|
|
17
17
|
}
|
|
18
18
|
export {};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { OnModuleInit } from "@nestjs/common";
|
|
1
|
+
import { DynamicModule, OnModuleInit, Type } from "@nestjs/common";
|
|
2
2
|
import { EntityManagerRegistry } from "./ioc/registry";
|
|
3
3
|
export declare class EntityManagerModule implements OnModuleInit {
|
|
4
4
|
private readonly registry;
|
|
5
5
|
constructor(registry: EntityManagerRegistry);
|
|
6
6
|
onModuleInit(): void;
|
|
7
|
+
static forRoot(providers: {
|
|
8
|
+
operationsLockRepository: Type<unknown>;
|
|
9
|
+
}): DynamicModule;
|
|
7
10
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -2168,18 +2168,18 @@ declare enum JobProviderState$1 {
|
|
|
2168
2168
|
|
|
2169
2169
|
type JobData = Omit<JobDefinition<unknown, unknown>, "id" | "createdOn" | "updatedOn">;
|
|
2170
2170
|
interface IJobDefinitionsRepository {
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2171
|
+
getAllDefinitions(): Promise<JobDefinition<unknown, unknown>[]>;
|
|
2172
|
+
getDefinitionByUid(uid: string): Promise<JobDefinition<unknown, unknown> | undefined>;
|
|
2173
|
+
ensureDefinition(data: JobData): Promise<JobDefinition<unknown, unknown>>;
|
|
2174
|
+
createDefinition(data: JobData): Promise<JobDefinition<unknown, unknown>>;
|
|
2175
|
+
updateDefinition(uid: string, data: JobData): Promise<JobDefinition<unknown, unknown>>;
|
|
2176
2176
|
}
|
|
2177
2177
|
interface IJobInstancesRepository {
|
|
2178
|
-
|
|
2178
|
+
getById(id: string): Promise<JobInstance>;
|
|
2179
2179
|
getByStatus(...status: JobStatus[]): Promise<JobInstance[]>;
|
|
2180
2180
|
getLastInstance(jobUid: string, scheduleUid: string): Promise<JobInstance | undefined>;
|
|
2181
|
-
|
|
2182
|
-
|
|
2181
|
+
appendInstance(job: JobDefinition<unknown, unknown>, data: Pick<JobInstance, "id" | "insertTime" | "scheduleUid" | "runType">): Promise<JobInstance>;
|
|
2182
|
+
updateInstance(instanceId: string, data: Pick<JobInstance, "startTime" | "endTime" | "status" | "result" | "error">): Promise<JobInstance>;
|
|
2183
2183
|
}
|
|
2184
2184
|
|
|
2185
2185
|
type JobsSettings = {
|
|
@@ -3016,6 +3016,9 @@ declare class EntityManagerModule implements OnModuleInit {
|
|
|
3016
3016
|
private readonly registry;
|
|
3017
3017
|
constructor(registry: EntityManagerRegistry);
|
|
3018
3018
|
onModuleInit(): void;
|
|
3019
|
+
static forRoot(providers: {
|
|
3020
|
+
operationsLockRepository: Type$1<unknown>;
|
|
3021
|
+
}): DynamicModule;
|
|
3019
3022
|
}
|
|
3020
3023
|
|
|
3021
3024
|
interface IAuthenticationUserRole {
|