@punks/backend-entity-manager 0.0.73 → 0.0.75
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 +117 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/abstractions/index.d.ts +1 -1
- package/dist/cjs/types/platforms/nest/__test__/server/app/organizations/organization.controller.d.ts +1 -5
- package/dist/cjs/types/platforms/nest/__test__/server/app/setup/setup.controller.d.ts +13 -0
- package/dist/cjs/types/platforms/nest/__test__/server/app/setup/setup.module.d.ts +2 -0
- package/dist/cjs/types/platforms/nest/__test__/server/app/setup/templates/index.d.ts +4 -0
- package/dist/cjs/types/platforms/nest/__test__/server/app/{organizations → setup}/templates/organization-register/index.d.ts +3 -3
- package/dist/{esm/types/platforms/nest/__test__/server/app/organizations → cjs/types/platforms/nest/__test__/server/app/setup}/templates/organization-register/models.d.ts +2 -2
- package/dist/cjs/types/platforms/nest/__test__/server/app/tenants/tenant.controller.d.ts +1 -7
- package/dist/cjs/types/platforms/nest/pipelines/builder/builder.d.ts +7 -0
- package/dist/cjs/types/platforms/nest/pipelines/builder/index.d.ts +2 -7
- package/dist/cjs/types/platforms/nest/pipelines/index.d.ts +3 -2
- package/dist/cjs/types/platforms/nest/pipelines/runner/index.d.ts +1 -11
- package/dist/cjs/types/platforms/nest/pipelines/runner/runner.d.ts +11 -0
- package/dist/cjs/types/platforms/nest/pipelines/template/index.d.ts +1 -22
- package/dist/cjs/types/platforms/nest/pipelines/template/template.d.ts +22 -0
- package/dist/esm/index.js +117 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/abstractions/index.d.ts +1 -1
- package/dist/esm/types/platforms/nest/__test__/server/app/organizations/organization.controller.d.ts +1 -5
- package/dist/esm/types/platforms/nest/__test__/server/app/setup/setup.controller.d.ts +13 -0
- package/dist/esm/types/platforms/nest/__test__/server/app/setup/setup.module.d.ts +2 -0
- package/dist/esm/types/platforms/nest/__test__/server/app/setup/templates/index.d.ts +4 -0
- package/dist/esm/types/platforms/nest/__test__/server/app/{organizations → setup}/templates/organization-register/index.d.ts +3 -3
- package/dist/{cjs/types/platforms/nest/__test__/server/app/organizations → esm/types/platforms/nest/__test__/server/app/setup}/templates/organization-register/models.d.ts +2 -2
- package/dist/esm/types/platforms/nest/__test__/server/app/tenants/tenant.controller.d.ts +1 -7
- package/dist/esm/types/platforms/nest/pipelines/builder/builder.d.ts +7 -0
- package/dist/esm/types/platforms/nest/pipelines/builder/index.d.ts +2 -7
- package/dist/esm/types/platforms/nest/pipelines/index.d.ts +3 -2
- package/dist/esm/types/platforms/nest/pipelines/runner/index.d.ts +1 -11
- package/dist/esm/types/platforms/nest/pipelines/runner/runner.d.ts +11 -0
- package/dist/esm/types/platforms/nest/pipelines/template/index.d.ts +1 -22
- package/dist/esm/types/platforms/nest/pipelines/template/template.d.ts +22 -0
- package/dist/index.d.ts +26 -1
- package/package.json +1 -1
- package/dist/cjs/types/platforms/nest/__test__/server/app/organizations/templates/index.d.ts +0 -2
- package/dist/cjs/types/platforms/nest/__test__/server/app/tenants/templates/index.d.ts +0 -3
- package/dist/cjs/types/platforms/nest/__test__/tests/pipelines/crud_pipeline_api.test.d.ts +0 -1
- package/dist/cjs/types/platforms/nest/__test__/tests/pipelines/crud_pipeline_template.test.d.ts +0 -1
- package/dist/esm/types/platforms/nest/__test__/server/app/organizations/templates/index.d.ts +0 -2
- package/dist/esm/types/platforms/nest/__test__/server/app/tenants/templates/index.d.ts +0 -3
- package/dist/esm/types/platforms/nest/__test__/tests/pipelines/crud_pipeline_api.test.d.ts +0 -1
- package/dist/esm/types/platforms/nest/__test__/tests/pipelines/crud_pipeline_template.test.d.ts +0 -1
- /package/dist/cjs/types/platforms/nest/__test__/server/app/{tenants → setup}/templates/instance-initialize/index.d.ts +0 -0
- /package/dist/cjs/types/platforms/nest/__test__/server/app/{tenants → setup}/templates/instance-initialize/models.d.ts +0 -0
- /package/dist/cjs/types/platforms/nest/__test__/server/app/{organizations/templates/organization-register → setup/templates/instance-initialize}/pipeline.test.d.ts +0 -0
- /package/dist/cjs/types/platforms/nest/__test__/server/app/{tenants/templates/instance-initialize → setup/templates/organization-register}/pipeline.test.d.ts +0 -0
- /package/dist/cjs/types/platforms/nest/__test__/server/app/{tenants → setup}/templates/tenant-initialize/index.d.ts +0 -0
- /package/dist/cjs/types/platforms/nest/__test__/server/app/{tenants → setup}/templates/tenant-initialize/models.d.ts +0 -0
- /package/dist/cjs/types/platforms/nest/__test__/server/app/{tenants → setup}/templates/tenant-initialize/pipeline.test.d.ts +0 -0
- /package/dist/esm/types/platforms/nest/__test__/server/app/{tenants → setup}/templates/instance-initialize/index.d.ts +0 -0
- /package/dist/esm/types/platforms/nest/__test__/server/app/{tenants → setup}/templates/instance-initialize/models.d.ts +0 -0
- /package/dist/esm/types/platforms/nest/__test__/server/app/{organizations/templates/organization-register → setup/templates/instance-initialize}/pipeline.test.d.ts +0 -0
- /package/dist/esm/types/platforms/nest/__test__/server/app/{tenants/templates/instance-initialize → setup/templates/organization-register}/pipeline.test.d.ts +0 -0
- /package/dist/esm/types/platforms/nest/__test__/server/app/{tenants → setup}/templates/tenant-initialize/index.d.ts +0 -0
- /package/dist/esm/types/platforms/nest/__test__/server/app/{tenants → setup}/templates/tenant-initialize/models.d.ts +0 -0
- /package/dist/esm/types/platforms/nest/__test__/server/app/{tenants → setup}/templates/tenant-initialize/pipeline.test.d.ts +0 -0
|
@@ -2,7 +2,7 @@ export { IEntityCreateAction, IEntityDeleteAction, IEntityGetAction, IEntityUpda
|
|
|
2
2
|
export { IEntityAdapter } from "./adapters";
|
|
3
3
|
export * from "./authentication";
|
|
4
4
|
export { IAuthorizationResult, IEntityAuthorizationMiddleware, } from "./authorization";
|
|
5
|
-
export { IEntityCreateCommand, IEntityUpdateCommand, IEntityUpsertCommand, IEntityDeleteCommand, } from "./commands";
|
|
5
|
+
export { IEntityCreateCommand, IEntityUpdateCommand, IEntityUpsertCommand, IEntityDeleteCommand, IEntitiesDeleteParameters, } from "./commands";
|
|
6
6
|
export { SortingType } from "./common";
|
|
7
7
|
export { IEntityManagerServiceRoot, IEntityManagerServiceCollection, } from "./configuration";
|
|
8
8
|
export { IEntityConverter } from "./converters";
|
package/dist/cjs/types/platforms/nest/__test__/server/app/organizations/organization.controller.d.ts
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import { OrganizationActions } from "./organization.actions";
|
|
2
2
|
import { OrganizationCreateDto, OrganizationDto, OrganizationSearchRequest, OrganizationSearchResponse, OrganizationUpdateDto } from "./organization.dto";
|
|
3
|
-
import { OrganizationRegisterTemplate } from "./templates/organization-register";
|
|
4
|
-
import { OrganizationRegisterRequest, OrganizationRegisterResponse } from "./templates/organization-register/models";
|
|
5
3
|
export declare class OrganizationController {
|
|
6
4
|
private readonly actions;
|
|
7
|
-
|
|
8
|
-
constructor(actions: OrganizationActions, registerPipeline: OrganizationRegisterTemplate);
|
|
5
|
+
constructor(actions: OrganizationActions);
|
|
9
6
|
item(id: string): Promise<OrganizationDto | undefined>;
|
|
10
7
|
create(data: OrganizationCreateDto): Promise<OrganizationDto>;
|
|
11
8
|
update(id: string, item: OrganizationUpdateDto): Promise<OrganizationDto>;
|
|
12
9
|
delete(id: string): Promise<void>;
|
|
13
10
|
search(request: OrganizationSearchRequest): Promise<OrganizationSearchResponse>;
|
|
14
|
-
register(request: OrganizationRegisterRequest): Promise<OrganizationRegisterResponse>;
|
|
15
11
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TenantInitializeRequest, TenantInitializeResponse } from "./templates/tenant-initialize/models";
|
|
2
|
+
import { TenantInitializeTemplate } from "./templates/tenant-initialize";
|
|
3
|
+
import { InstanceInitializeTemplate } from "./templates/instance-initialize";
|
|
4
|
+
import { OrganizationInitializeRequest, OrganizationInitializeResponse } from "./templates/organization-register/models";
|
|
5
|
+
import { OrganizationRegisterTemplate } from "./templates/organization-register";
|
|
6
|
+
export declare class SetupController {
|
|
7
|
+
private readonly tenantInit;
|
|
8
|
+
private readonly instanceInit;
|
|
9
|
+
private readonly organizationInit;
|
|
10
|
+
constructor(tenantInit: TenantInitializeTemplate, instanceInit: InstanceInitializeTemplate, organizationInit: OrganizationRegisterTemplate);
|
|
11
|
+
tenantInitialize(request: TenantInitializeRequest): Promise<TenantInitializeResponse>;
|
|
12
|
+
organizationInitialize(request: OrganizationInitializeRequest): Promise<OrganizationInitializeResponse>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { InstanceInitializeTemplate } from "./instance-initialize";
|
|
2
|
+
import { OrganizationRegisterTemplate } from "./organization-register";
|
|
3
|
+
import { TenantInitializeTemplate } from "./tenant-initialize";
|
|
4
|
+
export declare const SetupTemplates: (typeof InstanceInitializeTemplate | typeof OrganizationRegisterTemplate | typeof TenantInitializeTemplate)[];
|
|
@@ -6,13 +6,13 @@ import { AppAuthContext } from "../../../../infrastructure/authentication";
|
|
|
6
6
|
import { UserGroupEntityManager } from "../../../../entities/userGroups/userGroup.manager";
|
|
7
7
|
import { OrganizationEntityManager } from "../../../../entities/organizations/organization.manager";
|
|
8
8
|
import { TenantEntityManager } from "../../../../entities/tenants/tenant.manager";
|
|
9
|
-
import {
|
|
10
|
-
export declare class OrganizationRegisterTemplate extends NestPipelineTemplate<
|
|
9
|
+
import { OrganizationInitializeRequest, OrganizationInitializeResponse } from "./models";
|
|
10
|
+
export declare class OrganizationRegisterTemplate extends NestPipelineTemplate<OrganizationInitializeRequest, OrganizationInitializeResponse, AppAuthContext> {
|
|
11
11
|
private readonly organizations;
|
|
12
12
|
private readonly tenants;
|
|
13
13
|
private readonly companies;
|
|
14
14
|
private readonly userGroups;
|
|
15
15
|
constructor(organizations: OrganizationEntityManager, tenants: TenantEntityManager, companies: CompanyEntityManager, userGroups: UserGroupEntityManager);
|
|
16
16
|
protected isAuthorized(context: AppAuthContext): boolean;
|
|
17
|
-
protected buildTemplate(builder: IPipelineTemplateBuilder<
|
|
17
|
+
protected buildTemplate(builder: IPipelineTemplateBuilder<OrganizationInitializeRequest, AppAuthContext>): PipelineDefinition<OrganizationInitializeRequest, OrganizationInitializeResponse, AppAuthContext>;
|
|
18
18
|
}
|
|
@@ -7,11 +7,11 @@ export declare class CompanyRegistrationInfo {
|
|
|
7
7
|
name: string;
|
|
8
8
|
uid: string;
|
|
9
9
|
}
|
|
10
|
-
export declare class
|
|
10
|
+
export declare class OrganizationInitializeRequest {
|
|
11
11
|
organization: OrganizationRegistrationInfo;
|
|
12
12
|
company: CompanyRegistrationInfo;
|
|
13
13
|
}
|
|
14
|
-
export declare class
|
|
14
|
+
export declare class OrganizationInitializeResponse {
|
|
15
15
|
organizationId: string;
|
|
16
16
|
companyId: string;
|
|
17
17
|
}
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import { TenantActions } from "./tenant.actions";
|
|
2
2
|
import { TenantCreateDto, TenantDto, TenantSearchRequest, TenantSearchResponse, TenantUpdateDto } from "./tenant.dto";
|
|
3
|
-
import { TenantInitializeRequest, TenantInitializeResponse } from "./templates/tenant-initialize/models";
|
|
4
|
-
import { TenantInitializeTemplate } from "./templates/tenant-initialize";
|
|
5
|
-
import { InstanceInitializeTemplate } from "./templates/instance-initialize";
|
|
6
3
|
export declare class TenantController {
|
|
7
4
|
private readonly actions;
|
|
8
|
-
|
|
9
|
-
private readonly instanceInit;
|
|
10
|
-
constructor(actions: TenantActions, tenantInit: TenantInitializeTemplate, instanceInit: InstanceInitializeTemplate);
|
|
5
|
+
constructor(actions: TenantActions);
|
|
11
6
|
item(id: string): Promise<TenantDto | undefined>;
|
|
12
7
|
create(data: TenantCreateDto): Promise<TenantDto>;
|
|
13
8
|
update(id: string, item: TenantUpdateDto): Promise<TenantDto>;
|
|
14
9
|
delete(id: string): Promise<void>;
|
|
15
10
|
search(request: TenantSearchRequest): Promise<TenantSearchResponse>;
|
|
16
|
-
initialize(request: TenantInitializeRequest): Promise<TenantInitializeResponse>;
|
|
17
11
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EntityManagerRegistry } from "../../ioc";
|
|
2
|
+
import { IPipelineTemplateBuilder } from "./types";
|
|
3
|
+
export declare class PipelinesBuilder {
|
|
4
|
+
private readonly registry;
|
|
5
|
+
constructor(registry: EntityManagerRegistry);
|
|
6
|
+
createTemplate<TInput, TContext>(): IPipelineTemplateBuilder<TInput, TContext>;
|
|
7
|
+
}
|
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare class PipelinesBuilder {
|
|
4
|
-
private readonly registry;
|
|
5
|
-
constructor(registry: EntityManagerRegistry);
|
|
6
|
-
createTemplate<TInput, TContext>(): IPipelineTemplateBuilder<TInput, TContext>;
|
|
7
|
-
}
|
|
1
|
+
export { PipelinesBuilder } from "./builder";
|
|
2
|
+
export { IPipelineStepOperationOptionsBuilder, IPipelineStepOperationBuilder, IPipelineStepBuilder, IPipelineTemplateBuilder, } from "./types";
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export * from "./builder";
|
|
2
|
+
export * from "./runner";
|
|
3
|
+
export * from "./template";
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { PipelineDefinition } from "../../../../types";
|
|
3
|
-
export declare class PipelinesRunner {
|
|
4
|
-
private readonly registry;
|
|
5
|
-
constructor(registry: EntityManagerRegistry);
|
|
6
|
-
invokePipeline<TPipelineInput, TPipelineOutput, TContext>(definition: PipelineDefinition<TPipelineInput, TPipelineOutput, TContext>, data: {
|
|
7
|
-
input: TPipelineInput;
|
|
8
|
-
context: TContext;
|
|
9
|
-
}): Promise<import("../../../../types").PipelineResult<TPipelineInput, TPipelineOutput>>;
|
|
10
|
-
private get controller();
|
|
11
|
-
}
|
|
1
|
+
export { PipelinesRunner } from "./runner";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EntityManagerRegistry } from "../../ioc";
|
|
2
|
+
import { PipelineDefinition } from "../../../../types";
|
|
3
|
+
export declare class PipelinesRunner {
|
|
4
|
+
private readonly registry;
|
|
5
|
+
constructor(registry: EntityManagerRegistry);
|
|
6
|
+
invokePipeline<TPipelineInput, TPipelineOutput, TContext>(definition: PipelineDefinition<TPipelineInput, TPipelineOutput, TContext>, data: {
|
|
7
|
+
input: TPipelineInput;
|
|
8
|
+
context: TContext;
|
|
9
|
+
}): Promise<import("../../../../types").PipelineResult<TPipelineInput, TPipelineOutput>>;
|
|
10
|
+
private get controller();
|
|
11
|
+
}
|
|
@@ -1,22 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { IPipelineTemplateBuilder } from "../builder/types";
|
|
3
|
-
import { PipelineUtils } from "./utils";
|
|
4
|
-
import { PipelineTemplateProps } from "../../decorators";
|
|
5
|
-
export declare abstract class NestPipelineTemplate<TPipelineInput, TPipelineOutput, TContext> {
|
|
6
|
-
private readonly logger;
|
|
7
|
-
protected readonly utils: PipelineUtils<TPipelineInput, TPipelineOutput, TContext>;
|
|
8
|
-
private cachedDefinition;
|
|
9
|
-
protected abstract buildTemplate(builder: IPipelineTemplateBuilder<TPipelineInput, TContext>): PipelineDefinition<TPipelineInput, TPipelineOutput, TContext>;
|
|
10
|
-
protected isAuthorized(context: TContext): boolean;
|
|
11
|
-
invoke(input: TPipelineInput): Promise<TPipelineOutput>;
|
|
12
|
-
execute(data: {
|
|
13
|
-
input: TPipelineInput;
|
|
14
|
-
context: TContext;
|
|
15
|
-
}): Promise<PipelineResult<TPipelineInput, TPipelineOutput>>;
|
|
16
|
-
private getDefinition;
|
|
17
|
-
private buildDefinition;
|
|
18
|
-
private getContext;
|
|
19
|
-
private get controller();
|
|
20
|
-
private get registry();
|
|
21
|
-
protected get metadata(): PipelineTemplateProps;
|
|
22
|
-
}
|
|
1
|
+
export { NestPipelineTemplate } from "./template";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { PipelineDefinition, PipelineResult } from "../../../../types";
|
|
2
|
+
import { IPipelineTemplateBuilder } from "../builder/types";
|
|
3
|
+
import { PipelineUtils } from "./utils";
|
|
4
|
+
import { PipelineTemplateProps } from "../../decorators";
|
|
5
|
+
export declare abstract class NestPipelineTemplate<TPipelineInput, TPipelineOutput, TContext> {
|
|
6
|
+
private readonly logger;
|
|
7
|
+
protected readonly utils: PipelineUtils<TPipelineInput, TPipelineOutput, TContext>;
|
|
8
|
+
private cachedDefinition;
|
|
9
|
+
protected abstract buildTemplate(builder: IPipelineTemplateBuilder<TPipelineInput, TContext>): PipelineDefinition<TPipelineInput, TPipelineOutput, TContext>;
|
|
10
|
+
protected isAuthorized(context: TContext): boolean;
|
|
11
|
+
invoke(input: TPipelineInput): Promise<TPipelineOutput>;
|
|
12
|
+
execute(data: {
|
|
13
|
+
input: TPipelineInput;
|
|
14
|
+
context: TContext;
|
|
15
|
+
}): Promise<PipelineResult<TPipelineInput, TPipelineOutput>>;
|
|
16
|
+
private getDefinition;
|
|
17
|
+
private buildDefinition;
|
|
18
|
+
private getContext;
|
|
19
|
+
private get controller();
|
|
20
|
+
private get registry();
|
|
21
|
+
protected get metadata(): PipelineTemplateProps;
|
|
22
|
+
}
|
package/dist/esm/index.js
CHANGED
|
@@ -20638,7 +20638,15 @@ PipelinesRunner = __decorate([
|
|
|
20638
20638
|
const PipelineProviders = [PipelinesBuilder, PipelinesRunner];
|
|
20639
20639
|
|
|
20640
20640
|
// export const iocStorage = new AsyncLocalStorage<IocContext>()
|
|
20641
|
+
let _context;
|
|
20641
20642
|
const initializeIoCContext = (context) => {
|
|
20643
|
+
_context = context;
|
|
20644
|
+
};
|
|
20645
|
+
const getIoCContext = () => {
|
|
20646
|
+
if (!_context) {
|
|
20647
|
+
throw new Error("IoC context not initialized");
|
|
20648
|
+
}
|
|
20649
|
+
return _context;
|
|
20642
20650
|
};
|
|
20643
20651
|
|
|
20644
20652
|
let EntityManagerModule = class EntityManagerModule {
|
|
@@ -21186,6 +21194,114 @@ class AppExceptionsFilterBase {
|
|
|
21186
21194
|
}
|
|
21187
21195
|
}
|
|
21188
21196
|
|
|
21197
|
+
const buildCompletedStepsSequence = (step) => {
|
|
21198
|
+
const steps = [];
|
|
21199
|
+
let currentStep = step;
|
|
21200
|
+
while (currentStep) {
|
|
21201
|
+
steps.push(currentStep);
|
|
21202
|
+
currentStep = currentStep.previousStep;
|
|
21203
|
+
}
|
|
21204
|
+
return steps.reverse();
|
|
21205
|
+
};
|
|
21206
|
+
class PipelineUtils {
|
|
21207
|
+
constructor() {
|
|
21208
|
+
this.getStep = (step, index) => {
|
|
21209
|
+
const sequence = buildCompletedStepsSequence(step);
|
|
21210
|
+
if (index >= sequence.length) {
|
|
21211
|
+
throw new Error(`Step index ${index} is out of range`);
|
|
21212
|
+
}
|
|
21213
|
+
return sequence[index];
|
|
21214
|
+
};
|
|
21215
|
+
this.getStepInput = (step, index) => {
|
|
21216
|
+
return this.getStep(step, index).stepInput;
|
|
21217
|
+
};
|
|
21218
|
+
this.getStepOutput = (step, index) => {
|
|
21219
|
+
return this.getStep(step, index).stepOutput;
|
|
21220
|
+
};
|
|
21221
|
+
}
|
|
21222
|
+
}
|
|
21223
|
+
|
|
21224
|
+
class NestPipelineTemplate {
|
|
21225
|
+
constructor() {
|
|
21226
|
+
this.logger = Log.getLogger(NestPipelineTemplate.name);
|
|
21227
|
+
this.utils = new PipelineUtils();
|
|
21228
|
+
}
|
|
21229
|
+
isAuthorized(context) {
|
|
21230
|
+
return true;
|
|
21231
|
+
}
|
|
21232
|
+
async invoke(input) {
|
|
21233
|
+
const result = await this.execute({
|
|
21234
|
+
input,
|
|
21235
|
+
context: await this.getContext(),
|
|
21236
|
+
});
|
|
21237
|
+
if (result.type !== "success") {
|
|
21238
|
+
throw new PipelineInvocationError(result.errorType, result.exception);
|
|
21239
|
+
}
|
|
21240
|
+
return result.output;
|
|
21241
|
+
}
|
|
21242
|
+
async execute(data) {
|
|
21243
|
+
const instanceId = newUuid$1();
|
|
21244
|
+
const logMetadata = {
|
|
21245
|
+
input: data.input,
|
|
21246
|
+
context: data.context,
|
|
21247
|
+
instanceId,
|
|
21248
|
+
};
|
|
21249
|
+
this.logger.debug(`[START] | ${this.metadata.name}`, logMetadata);
|
|
21250
|
+
if (!this.isAuthorized(data.context)) {
|
|
21251
|
+
this.logger.debug(`[ERROR] | ${this.metadata.name} -> Unauthorized`, logMetadata);
|
|
21252
|
+
return {
|
|
21253
|
+
type: "error",
|
|
21254
|
+
errorType: PipelineErrorType.Unauthorized,
|
|
21255
|
+
input: data.input,
|
|
21256
|
+
stepResults: [],
|
|
21257
|
+
};
|
|
21258
|
+
}
|
|
21259
|
+
const instance = await this.controller.createInstance(this.getDefinition(), data.input, data.context);
|
|
21260
|
+
const result = await instance.execute();
|
|
21261
|
+
if (result.type === "error") {
|
|
21262
|
+
this.logger.error(`[ERROR] | ${this.metadata.name} -> ${result.exception?.name}`, {
|
|
21263
|
+
...logMetadata,
|
|
21264
|
+
result,
|
|
21265
|
+
});
|
|
21266
|
+
}
|
|
21267
|
+
else {
|
|
21268
|
+
this.logger.debug(`[COMPLETED] | ${this.metadata.name}`, {
|
|
21269
|
+
...logMetadata,
|
|
21270
|
+
result,
|
|
21271
|
+
});
|
|
21272
|
+
}
|
|
21273
|
+
return result;
|
|
21274
|
+
}
|
|
21275
|
+
getDefinition() {
|
|
21276
|
+
if (!this.cachedDefinition) {
|
|
21277
|
+
this.cachedDefinition = this.buildDefinition();
|
|
21278
|
+
}
|
|
21279
|
+
return this.cachedDefinition;
|
|
21280
|
+
}
|
|
21281
|
+
buildDefinition() {
|
|
21282
|
+
return this.buildTemplate(new PipelineTemplateBuilder());
|
|
21283
|
+
}
|
|
21284
|
+
async getContext() {
|
|
21285
|
+
const contextService = this.registry
|
|
21286
|
+
.getContainer()
|
|
21287
|
+
.getEntitiesServicesLocator()
|
|
21288
|
+
.resolveAuthenticationContextProvider();
|
|
21289
|
+
return (await contextService?.getContext());
|
|
21290
|
+
}
|
|
21291
|
+
get controller() {
|
|
21292
|
+
return this.registry
|
|
21293
|
+
.getContainer()
|
|
21294
|
+
.getEntitiesServicesLocator()
|
|
21295
|
+
.resolvePipelinesController();
|
|
21296
|
+
}
|
|
21297
|
+
get registry() {
|
|
21298
|
+
return getIoCContext().registry;
|
|
21299
|
+
}
|
|
21300
|
+
get metadata() {
|
|
21301
|
+
return getInstanceDecoratorData(EntityManagerSymbols.PipelineTemplate, this);
|
|
21302
|
+
}
|
|
21303
|
+
}
|
|
21304
|
+
|
|
21189
21305
|
const AwsSesModuleSymbols = {
|
|
21190
21306
|
EmailTemplate: Symbol.for("WP.PLG:AWS_SES.EMAIL_TEMPLATE"),
|
|
21191
21307
|
};
|
|
@@ -26400,5 +26516,5 @@ SendgridEmailModule = SendgridEmailModule_1 = __decorate([
|
|
|
26400
26516
|
})
|
|
26401
26517
|
], SendgridEmailModule);
|
|
26402
26518
|
|
|
26403
|
-
export { AUTHENTICATION_EVENTS_NAMESPACE, AppExceptionsFilterBase, AppHashingService, AppInMemorySettings, AppSessionMiddleware, AppSessionService, AuthGuard, Authenticated, AuthenticationEmailTemplates, AuthenticationError, AuthenticationEvents, AuthenticationExtensionSymbols, AuthenticationModule, AuthenticationService, AwsEmailModule, AwsSesEmailTemplate, BooleanFacet, BooleanFacetItem, EmailService, EntityManagerConfigurationError, EntityManagerException, EntityManagerInitializer, EntityManagerModule, EntityManagerRegistry, EntityManagerService, EntityManagerSymbols, EntityManagerUnauthorizedException, EntityNotFoundException, EntityOperationType, EntityOperationUnauthorizedException, EntitySeeder, EventsService, InvalidCredentialsError, MemberOf, ModulesContainerProvider, MultiTenancyModule, MultipleEntitiesFoundException, NestEntityActions, NestEntityAuthorizationMiddleware, NestEntityManager, NestTypeOrmEntitySeeder, NestTypeOrmQueryBuilder, NestTypeOrmRepository, NumericFacet, NumericFacetItem, OperationTokenMismatchError, PLATFORM_EVENT_NAMESPACE, PipelineController, PipelineErrorType, PipelineStatus, PipelineStepErrorType, PipelinesBuilder, PipelinesRunner, PlatformEvents, Public, QueryBuilderBase, ReplicationMode, Roles, SendgridEmailModule, SendgridEmailTemplate, SortDirection, StringFacet, StringFacetItem, TrackingService, UserCreationError, UserRegistrationError, WpAppInitializer, WpAwsSesEmailTemplate, WpEmailTemplate, WpEntity, WpEntityActions, WpEntityAdapter, WpEntityAuthMiddleware, WpEntityConnector, WpEntityConverter, WpEntityManager, WpEntityQueryBuilder, WpEntityRepository, WpEntitySeeder, WpEventsTracker, WpPipeline, WpRolesService, WpSendgridEmailTemplate, WpUserRolesService, WpUserService, getLocalizedText, newUuid, renderHandlebarsTemplate };
|
|
26519
|
+
export { AUTHENTICATION_EVENTS_NAMESPACE, AppExceptionsFilterBase, AppHashingService, AppInMemorySettings, AppSessionMiddleware, AppSessionService, AuthGuard, Authenticated, AuthenticationEmailTemplates, AuthenticationError, AuthenticationEvents, AuthenticationExtensionSymbols, AuthenticationModule, AuthenticationService, AwsEmailModule, AwsSesEmailTemplate, BooleanFacet, BooleanFacetItem, EmailService, EntityManagerConfigurationError, EntityManagerException, EntityManagerInitializer, EntityManagerModule, EntityManagerRegistry, EntityManagerService, EntityManagerSymbols, EntityManagerUnauthorizedException, EntityNotFoundException, EntityOperationType, EntityOperationUnauthorizedException, EntitySeeder, EventsService, InvalidCredentialsError, MemberOf, ModulesContainerProvider, MultiTenancyModule, MultipleEntitiesFoundException, NestEntityActions, NestEntityAuthorizationMiddleware, NestEntityManager, NestPipelineTemplate, NestTypeOrmEntitySeeder, NestTypeOrmQueryBuilder, NestTypeOrmRepository, NumericFacet, NumericFacetItem, OperationTokenMismatchError, PLATFORM_EVENT_NAMESPACE, PipelineController, PipelineErrorType, PipelineStatus, PipelineStepErrorType, PipelinesBuilder, PipelinesRunner, PlatformEvents, Public, QueryBuilderBase, ReplicationMode, Roles, SendgridEmailModule, SendgridEmailTemplate, SortDirection, StringFacet, StringFacetItem, TrackingService, UserCreationError, UserRegistrationError, WpAppInitializer, WpAwsSesEmailTemplate, WpEmailTemplate, WpEntity, WpEntityActions, WpEntityAdapter, WpEntityAuthMiddleware, WpEntityConnector, WpEntityConverter, WpEntityManager, WpEntityQueryBuilder, WpEntityRepository, WpEntitySeeder, WpEventsTracker, WpPipeline, WpRolesService, WpSendgridEmailTemplate, WpUserRolesService, WpUserService, getLocalizedText, newUuid, renderHandlebarsTemplate };
|
|
26404
26520
|
//# sourceMappingURL=index.js.map
|