Skip to content

Commit

Permalink
chore(root): Release 2024-11-27 10:41 (#7146)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Nov 27, 2024
2 parents 7ae8769 + 9225ea9 commit 0a1e34c
Show file tree
Hide file tree
Showing 57 changed files with 511 additions and 150 deletions.
2 changes: 1 addition & 1 deletion .source
7 changes: 6 additions & 1 deletion apps/api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@novu/api",
"version": "2.0.3",
"version": "2.1.0",
"description": "description",
"author": "",
"private": "true",
Expand Down Expand Up @@ -132,5 +132,10 @@
"@novu/ee-billing": "workspace:*",
"@novu/ee-shared-services": "workspace:*",
"@novu/ee-translation": "workspace:*"
},
"nx": {
"tags": [
"type:app"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,32 +40,32 @@ export class SyncToEnvironmentUseCase {
throw new BadRequestException('Cannot sync workflow to the same environment');
}

const workflowToClone = await this.getWorkflowToClone(command);
const preferencesToClone = await this.getWorkflowPreferences(workflowToClone._id, command.user.environmentId);
const externalId = workflowToClone.workflowId;
const existingWorkflow = await this.findWorkflowInTargetEnvironment(command, externalId);
const workflowDto = await this.buildRequestDto(workflowToClone, preferencesToClone, command, existingWorkflow);
const originWorkflow = await this.getWorkflowToClone(command);
const preferencesToClone = await this.getWorkflowPreferences(originWorkflow._id, command.user.environmentId);
const externalId = originWorkflow.workflowId;
const targetWorkflow = await this.findWorkflowInTargetEnvironment(command, externalId);
const workflowDto = await this.buildRequestDto(originWorkflow, preferencesToClone, command, targetWorkflow);

return await this.upsertWorkflowUseCase.execute(
UpsertWorkflowCommand.create({
user: { ...command.user, environmentId: command.targetEnvironmentId },
identifierOrInternalId: existingWorkflow?._id,
identifierOrInternalId: targetWorkflow?._id,
workflowDto,
})
);
}

private async buildRequestDto(
workflowToClone: WorkflowResponseDto,
originWorkflow: WorkflowResponseDto,
preferencesToClone: PreferencesEntity[],
command: SyncToEnvironmentCommand,
existingWorkflow?: WorkflowResponseDto
targetWorkflow?: WorkflowResponseDto
) {
if (existingWorkflow) {
return await this.mapWorkflowToUpdateWorkflowDto(workflowToClone, existingWorkflow, preferencesToClone, command);
if (targetWorkflow) {
return await this.mapWorkflowToUpdateWorkflowDto(originWorkflow, targetWorkflow, preferencesToClone, command);
}

return await this.mapWorkflowToCreateWorkflowDto(workflowToClone, preferencesToClone, command);
return await this.mapWorkflowToCreateWorkflowDto(originWorkflow, preferencesToClone, command);
}

private async getWorkflowToClone(command: SyncToEnvironmentCommand): Promise<WorkflowResponseDto> {
Expand Down Expand Up @@ -94,18 +94,18 @@ export class SyncToEnvironmentUseCase {
}

private async mapWorkflowToCreateWorkflowDto(
workflowToClone: WorkflowResponseDto,
originWorkflow: WorkflowResponseDto,
preferences: PreferencesEntity[],
command: SyncToEnvironmentCommand
): Promise<CreateWorkflowDto> {
return {
workflowId: workflowToClone.workflowId,
name: workflowToClone.name,
active: workflowToClone.active,
tags: workflowToClone.tags,
description: workflowToClone.description,
workflowId: originWorkflow.workflowId,
name: originWorkflow.name,
active: originWorkflow.active,
tags: originWorkflow.tags,
description: originWorkflow.description,
__source: WorkflowCreationSourceEnum.DASHBOARD,
steps: await this.mapStepsToDto(workflowToClone.steps, command),
steps: await this.mapStepsToDto(originWorkflow.steps, command),
preferences: this.mapPreferences(preferences),
};
}
Expand All @@ -128,20 +128,20 @@ export class SyncToEnvironmentUseCase {
}

private async mapStepsToDto(
steps: StepResponseDto[],
originSteps: StepResponseDto[],
command: SyncToEnvironmentCommand,
existingWorkflowSteps?: StepResponseDto[]
targetWorkflowSteps?: StepResponseDto[]
): Promise<(StepUpdateDto | StepCreateDto)[]> {
const augmentedSteps: (StepUpdateDto | StepCreateDto)[] = [];
for (const step of steps) {
const idAsOptionalObject = this.prodDbIdAsOptionalObject(existingWorkflowSteps, step);
for (const originStep of originSteps) {
const idAsOptionalObject = this.prodDbIdAsOptionalObject(originStep, targetWorkflowSteps);
const stepDataDto = await this.buildStepDataUsecase.execute({
identifierOrInternalId: command.identifierOrInternalId,
stepId: step.stepId,
stepId: originStep.stepId,
user: command.user,
});

augmentedSteps.push(this.buildSingleStepRequest(idAsOptionalObject, step, stepDataDto));
augmentedSteps.push(this.buildSingleStepRequest(idAsOptionalObject, originStep, stepDataDto));
}

return augmentedSteps;
Expand All @@ -164,8 +164,8 @@ export class SyncToEnvironmentUseCase {
};
}

private prodDbIdAsOptionalObject(existingWorkflowSteps: StepResponseDto[] | undefined, step: StepResponseDto) {
const prodDatabaseId = this.findDatabaseIdInProdByExternalId(existingWorkflowSteps, step);
private prodDbIdAsOptionalObject(originStep: StepResponseDto, targetWorkflowSteps?: StepResponseDto[]) {
const prodDatabaseId = this.findDatabaseIdInProdByExternalId(originStep, targetWorkflowSteps);

if (prodDatabaseId) {
return {
Expand All @@ -176,11 +176,8 @@ export class SyncToEnvironmentUseCase {
}
}

private findDatabaseIdInProdByExternalId(
existingWorkflowSteps: StepResponseDto[] | undefined,
step: StepResponseDto
) {
return existingWorkflowSteps?.find((existingStep) => existingStep.stepId === step.stepId)?._id ?? step._id;
private findDatabaseIdInProdByExternalId(originStep: StepResponseDto, targetWorkflowSteps?: StepResponseDto[]) {
return targetWorkflowSteps?.find((targetStep) => targetStep.stepId === originStep.stepId)?._id;
}

private mapPreferences(preferences: PreferencesEntity[]): {
Expand Down
3 changes: 3 additions & 0 deletions apps/api/src/app/workflows-v2/workflow.controller.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,9 @@ describe('Workflow Controller E2E API Testing', () => {
it('should promote by creating a new workflow in production environment with the same properties', async () => {
// Create a workflow in the development environment
const devWorkflow = await createWorkflowAndValidate('-promote-workflow');
await workflowsClient.patchWorkflowStepData(devWorkflow._id, devWorkflow.steps[0]._id, {
controlValues: { vinyl: 'vinyl', color: 'red', band: 'beatles' },
});

// Switch to production environment and get its ID
const devEnvironmentId = session.environment._id;
Expand Down
7 changes: 6 additions & 1 deletion apps/dashboard/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@novu/dashboard",
"private": true,
"version": "0.0.1",
"version": "2.1.0",
"type": "module",
"scripts": {
"start": "vite",
Expand Down Expand Up @@ -116,5 +116,10 @@
},
"peerDependencies": {
"@novu/web": "workspace:*"
},
"nx": {
"tags": [
"type:app"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,14 @@ export const TestWorkflowTabs = ({ testData }: { testData: WorkflowTestDataRespo
<>
<ToastIcon variant="default" />
<div className="flex flex-col gap-2">
<span className="font-medium">Test workflow triggered successfully</span>
<span className="text-foreground-600">{`Test workflow ${workflowSlug} was triggered successfully`}</span>
<span className="font-medium">Test workflow succeeded</span>
<span className="text-foreground-600 inline">
Workflow <strong>{workflow?.name}</strong> was triggered successfully.
</span>
<Link
to={`${LEGACY_ROUTES.ACTIVITY_FEED}?transactionId=${transactionId}`}
reloadDocument
className="text-foreground-950 flex items-center gap-1 text-sm font-medium"
className="text-primary text-sm font-medium"
>
View activity feed
</Link>
Expand Down
7 changes: 6 additions & 1 deletion apps/inbound-mail/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@novu/inbound-mail",
"version": "2.0.2",
"version": "2.1.0",
"description": "",
"author": "",
"private": true,
Expand Down Expand Up @@ -62,5 +62,10 @@
"ts-node": "~10.9.1",
"tsconfig-paths": "~4.1.0",
"typescript": "5.6.2"
},
"nx": {
"tags": [
"type:app"
]
}
}
7 changes: 6 additions & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@novu/web",
"version": "2.0.2",
"version": "2.1.0",
"private": true,
"scripts": {
"start": "pnpm panda --watch & cross-env NODE_OPTIONS=--max_old_space_size=8192 DISABLE_ESLINT_PLUGIN=true PORT=4200 react-app-rewired start",
Expand Down Expand Up @@ -207,5 +207,10 @@
}
}
]
},
"nx": {
"tags": [
"type:app"
]
}
}
7 changes: 6 additions & 1 deletion apps/webhook/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@novu/webhook",
"version": "2.0.2",
"version": "2.1.0",
"description": "",
"author": "",
"private": true,
Expand Down Expand Up @@ -79,5 +79,10 @@
"@nestjs/platform-socket.io",
"@nestjs/platform-socket.io/**"
]
},
"nx": {
"tags": [
"type:app"
]
}
}
7 changes: 6 additions & 1 deletion apps/widget/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@novu/widget",
"version": "2.0.2",
"version": "2.1.0",
"private": true,
"scripts": {
"start": "DISABLE_ESLINT_PLUGIN=true react-app-rewired start",
Expand Down Expand Up @@ -121,5 +121,10 @@
"**/@babel",
"**/@babel/**"
]
},
"nx": {
"tags": [
"type:app"
]
}
}
7 changes: 6 additions & 1 deletion apps/worker/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@novu/worker",
"version": "2.0.2",
"version": "2.1.0",
"description": "description",
"author": "",
"private": "true",
Expand Down Expand Up @@ -92,5 +92,10 @@
"@novu/ee-billing": "workspace:*",
"@novu/ee-shared-services": "workspace:*",
"@novu/ee-translation": "workspace:*"
},
"nx": {
"tags": [
"type:app"
]
}
}
7 changes: 6 additions & 1 deletion apps/ws/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@novu/ws",
"version": "2.0.2",
"version": "2.1.0",
"description": "",
"author": "",
"private": true,
Expand Down Expand Up @@ -84,5 +84,10 @@
"@nestjs/platform-socket.io",
"@nestjs/platform-socket.io/**"
]
},
"nx": {
"tags": [
"type:app"
]
}
}
2 changes: 1 addition & 1 deletion enterprise/packages/auth/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@novu/ee-auth",
"version": "2.0.2",
"version": "2.0.6",
"private": true,
"main": "dist/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion enterprise/packages/billing/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@novu/ee-billing",
"version": "2.0.2",
"version": "2.0.8",
"private": true,
"main": "dist/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion enterprise/packages/dal/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@novu/ee-dal",
"version": "2.0.2",
"version": "2.0.3",
"description": "",
"private": true,
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion enterprise/packages/shared-services/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@novu/ee-shared-services",
"version": "2.0.2",
"version": "2.0.3",
"description": "Generic service used inside of Novu's different services - can not be depended on application-generic",
"main": "build/main/index.js",
"typings": "build/main/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion enterprise/packages/translation/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@novu/ee-translation",
"version": "2.0.2",
"version": "2.0.6",
"private": true,
"main": "dist/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
"message": "chore(release): publish - ci skip"
}
},
"version": "2.0.1"
"version": "2.1.0"
}
2 changes: 1 addition & 1 deletion libs/application-generic/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@novu/application-generic",
"version": "2.0.2",
"version": "2.0.6",
"description": "Generic backend code used inside of Novu's different services",
"main": "build/main/index.js",
"typings": "build/main/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion libs/dal/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@novu/dal",
"version": "2.0.2",
"version": "2.0.3",
"description": "",
"private": true,
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion libs/design-system/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@novu/design-system",
"version": "2.0.2",
"version": "2.0.3",
"repository": "https://github.com/novuhq/novu",
"description": "",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion libs/embed/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@novu/embed",
"version": "2.0.2",
"version": "2.0.4",
"private": true,
"description": "",
"keywords": [],
Expand Down
2 changes: 1 addition & 1 deletion libs/notifications/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@novu/notifications",
"version": "1.0.1",
"version": "1.0.4",
"description": "Novu notification templates and workflows",
"main": "build/main/index.js",
"typings": "build/main/index.d.ts",
Expand Down
Loading

0 comments on commit 0a1e34c

Please sign in to comment.