@punks/backend-entity-manager 0.0.269 → 0.0.271
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 +25 -10
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/platforms/nest/extensions/jobs/module.d.ts +5 -2
- package/dist/cjs/types/platforms/nest/module.d.ts +4 -1
- package/dist/esm/index.js +26 -11
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/platforms/nest/extensions/jobs/module.d.ts +5 -2
- package/dist/esm/types/platforms/nest/module.d.ts +4 -1
- package/dist/index.d.ts +7 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DynamicModule, OnModuleInit } from "@nestjs/common";
|
|
1
|
+
import { DynamicModule, OnModuleInit, Type } from "@nestjs/common";
|
|
2
2
|
import { JobsSettings } from "./abstractions/settings";
|
|
3
3
|
import { JobsScheduler } from "./providers/scheduler";
|
|
4
4
|
import { JobsProviderFactory } from "./resolvers/factory";
|
|
@@ -7,5 +7,8 @@ export declare class JobsModule implements OnModuleInit {
|
|
|
7
7
|
private readonly jobsProviderFactory;
|
|
8
8
|
constructor(jobsScheduler: JobsScheduler, jobsProviderFactory: JobsProviderFactory);
|
|
9
9
|
onModuleInit(): Promise<void>;
|
|
10
|
-
static forRoot(input: JobsSettings
|
|
10
|
+
static forRoot(input: JobsSettings, providers: {
|
|
11
|
+
jobInstancesRepository: Type<unknown>;
|
|
12
|
+
jobDefinitionsRepository: Type<unknown>;
|
|
13
|
+
}): DynamicModule;
|
|
11
14
|
}
|
|
@@ -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/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Log, csvParse, excelParse, excelBuild, csvBuild, isNullOrUndefined, addTime, newUuid as newUuid$1, buildObject, toDict, sort, byField, toArrayDict, toItemsDict, ensureTailingSlash, ensureStartSlash, removeUndefinedProps } from '@punks/backend-core';
|
|
2
2
|
import { MoreThanOrEqual, In, Equal, Not, IsNull, And, MoreThan, LessThanOrEqual, LessThan, ILike, Repository } from 'typeorm';
|
|
3
|
-
import { applyDecorators, Injectable, SetMetadata, createParamDecorator, Global, Module, Scope,
|
|
3
|
+
import { applyDecorators, Injectable, SetMetadata, createParamDecorator, Global, Module, Scope, Inject, Logger, StreamableFile, HttpException, HttpStatus } from '@nestjs/common';
|
|
4
4
|
import { Reflector } from '@nestjs/core';
|
|
5
5
|
import { AsyncLocalStorage } from 'async_hooks';
|
|
6
6
|
import { hash } from 'bcrypt';
|
|
@@ -21962,17 +21962,10 @@ let OperationLockService = OperationLockService_1 = class OperationLockService {
|
|
|
21962
21962
|
this.isLockExpired = (item, refDate, timeoutMinutes) => {
|
|
21963
21963
|
return differenceInMinutes(refDate, item.createdOn) > timeoutMinutes;
|
|
21964
21964
|
};
|
|
21965
|
-
if (!operations) {
|
|
21966
|
-
this.logger.warn(`Cannot resolve locks repository: ${getEntityManagerProviderToken("OperationsLockRepository")}`);
|
|
21967
|
-
}
|
|
21968
|
-
else {
|
|
21969
|
-
this.logger.info(`Resolved locks repository: ${getEntityManagerProviderToken("OperationsLockRepository")}`);
|
|
21970
|
-
}
|
|
21971
21965
|
}
|
|
21972
21966
|
};
|
|
21973
21967
|
OperationLockService = OperationLockService_1 = __decorate([
|
|
21974
21968
|
Injectable(),
|
|
21975
|
-
__param(0, Optional()),
|
|
21976
21969
|
__param(0, Inject(getEntityManagerProviderToken("OperationsLockRepository"))),
|
|
21977
21970
|
__metadata("design:paramtypes", [Object])
|
|
21978
21971
|
], OperationLockService);
|
|
@@ -23620,6 +23613,7 @@ const getIoCContext = () => {
|
|
|
23620
23613
|
return _context;
|
|
23621
23614
|
};
|
|
23622
23615
|
|
|
23616
|
+
var EntityManagerModule_1;
|
|
23623
23617
|
const ModuleData$9 = {
|
|
23624
23618
|
imports: [CustomDiscoveryModule, EventEmitterModule],
|
|
23625
23619
|
providers: [
|
|
@@ -23631,7 +23625,7 @@ const ModuleData$9 = {
|
|
|
23631
23625
|
],
|
|
23632
23626
|
exports: [EntityManagerRegistry, ...Services$1],
|
|
23633
23627
|
};
|
|
23634
|
-
let EntityManagerModule = class EntityManagerModule {
|
|
23628
|
+
let EntityManagerModule = EntityManagerModule_1 = class EntityManagerModule {
|
|
23635
23629
|
constructor(registry) {
|
|
23636
23630
|
this.registry = registry;
|
|
23637
23631
|
}
|
|
@@ -23640,8 +23634,21 @@ let EntityManagerModule = class EntityManagerModule {
|
|
|
23640
23634
|
registry: this.registry,
|
|
23641
23635
|
});
|
|
23642
23636
|
}
|
|
23637
|
+
static forRoot(providers) {
|
|
23638
|
+
return {
|
|
23639
|
+
module: EntityManagerModule_1,
|
|
23640
|
+
...ModuleData$9,
|
|
23641
|
+
providers: [
|
|
23642
|
+
...ModuleData$9.providers,
|
|
23643
|
+
{
|
|
23644
|
+
provide: getEntityManagerProviderToken("OperationsLockRepository"),
|
|
23645
|
+
useClass: providers.operationsLockRepository,
|
|
23646
|
+
},
|
|
23647
|
+
],
|
|
23648
|
+
};
|
|
23649
|
+
}
|
|
23643
23650
|
};
|
|
23644
|
-
EntityManagerModule = __decorate([
|
|
23651
|
+
EntityManagerModule = EntityManagerModule_1 = __decorate([
|
|
23645
23652
|
Module({
|
|
23646
23653
|
imports: ModuleData$9.imports,
|
|
23647
23654
|
providers: ModuleData$9.providers,
|
|
@@ -34066,7 +34073,7 @@ let JobsModule = JobsModule_1 = class JobsModule {
|
|
|
34066
34073
|
this.jobsScheduler.register();
|
|
34067
34074
|
await this.jobsProviderFactory.initialize();
|
|
34068
34075
|
}
|
|
34069
|
-
static forRoot(input) {
|
|
34076
|
+
static forRoot(input, providers) {
|
|
34070
34077
|
return {
|
|
34071
34078
|
module: JobsModule_1,
|
|
34072
34079
|
...ModuleData$7,
|
|
@@ -34076,6 +34083,14 @@ let JobsModule = JobsModule_1 = class JobsModule {
|
|
|
34076
34083
|
provide: getEntityManagerProviderToken("JobsModuleSettings"),
|
|
34077
34084
|
useValue: input,
|
|
34078
34085
|
},
|
|
34086
|
+
{
|
|
34087
|
+
provide: getEntityManagerProviderToken("JobInstancesRepository"),
|
|
34088
|
+
useClass: providers.jobInstancesRepository,
|
|
34089
|
+
},
|
|
34090
|
+
{
|
|
34091
|
+
provide: getEntityManagerProviderToken("JobDefinitionsRepository"),
|
|
34092
|
+
useClass: providers.jobDefinitionsRepository,
|
|
34093
|
+
},
|
|
34079
34094
|
],
|
|
34080
34095
|
};
|
|
34081
34096
|
}
|