Skip to content

Commit 0a1e34c

Browse files
chore(root): Release 2024-11-27 10:41 (#7146)
2 parents 7ae8769 + 9225ea9 commit 0a1e34c

File tree

57 files changed

+511
-150
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+511
-150
lines changed

.source

apps/api/package.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@novu/api",
3-
"version": "2.0.3",
3+
"version": "2.1.0",
44
"description": "description",
55
"author": "",
66
"private": "true",
@@ -132,5 +132,10 @@
132132
"@novu/ee-billing": "workspace:*",
133133
"@novu/ee-shared-services": "workspace:*",
134134
"@novu/ee-translation": "workspace:*"
135+
},
136+
"nx": {
137+
"tags": [
138+
"type:app"
139+
]
135140
}
136141
}

apps/api/src/app/workflows-v2/usecases/sync-to-environment/sync-to-environment.usecase.ts

+28-31
Original file line numberDiff line numberDiff line change
@@ -40,32 +40,32 @@ export class SyncToEnvironmentUseCase {
4040
throw new BadRequestException('Cannot sync workflow to the same environment');
4141
}
4242

43-
const workflowToClone = await this.getWorkflowToClone(command);
44-
const preferencesToClone = await this.getWorkflowPreferences(workflowToClone._id, command.user.environmentId);
45-
const externalId = workflowToClone.workflowId;
46-
const existingWorkflow = await this.findWorkflowInTargetEnvironment(command, externalId);
47-
const workflowDto = await this.buildRequestDto(workflowToClone, preferencesToClone, command, existingWorkflow);
43+
const originWorkflow = await this.getWorkflowToClone(command);
44+
const preferencesToClone = await this.getWorkflowPreferences(originWorkflow._id, command.user.environmentId);
45+
const externalId = originWorkflow.workflowId;
46+
const targetWorkflow = await this.findWorkflowInTargetEnvironment(command, externalId);
47+
const workflowDto = await this.buildRequestDto(originWorkflow, preferencesToClone, command, targetWorkflow);
4848

4949
return await this.upsertWorkflowUseCase.execute(
5050
UpsertWorkflowCommand.create({
5151
user: { ...command.user, environmentId: command.targetEnvironmentId },
52-
identifierOrInternalId: existingWorkflow?._id,
52+
identifierOrInternalId: targetWorkflow?._id,
5353
workflowDto,
5454
})
5555
);
5656
}
5757

5858
private async buildRequestDto(
59-
workflowToClone: WorkflowResponseDto,
59+
originWorkflow: WorkflowResponseDto,
6060
preferencesToClone: PreferencesEntity[],
6161
command: SyncToEnvironmentCommand,
62-
existingWorkflow?: WorkflowResponseDto
62+
targetWorkflow?: WorkflowResponseDto
6363
) {
64-
if (existingWorkflow) {
65-
return await this.mapWorkflowToUpdateWorkflowDto(workflowToClone, existingWorkflow, preferencesToClone, command);
64+
if (targetWorkflow) {
65+
return await this.mapWorkflowToUpdateWorkflowDto(originWorkflow, targetWorkflow, preferencesToClone, command);
6666
}
6767

68-
return await this.mapWorkflowToCreateWorkflowDto(workflowToClone, preferencesToClone, command);
68+
return await this.mapWorkflowToCreateWorkflowDto(originWorkflow, preferencesToClone, command);
6969
}
7070

7171
private async getWorkflowToClone(command: SyncToEnvironmentCommand): Promise<WorkflowResponseDto> {
@@ -94,18 +94,18 @@ export class SyncToEnvironmentUseCase {
9494
}
9595

9696
private async mapWorkflowToCreateWorkflowDto(
97-
workflowToClone: WorkflowResponseDto,
97+
originWorkflow: WorkflowResponseDto,
9898
preferences: PreferencesEntity[],
9999
command: SyncToEnvironmentCommand
100100
): Promise<CreateWorkflowDto> {
101101
return {
102-
workflowId: workflowToClone.workflowId,
103-
name: workflowToClone.name,
104-
active: workflowToClone.active,
105-
tags: workflowToClone.tags,
106-
description: workflowToClone.description,
102+
workflowId: originWorkflow.workflowId,
103+
name: originWorkflow.name,
104+
active: originWorkflow.active,
105+
tags: originWorkflow.tags,
106+
description: originWorkflow.description,
107107
__source: WorkflowCreationSourceEnum.DASHBOARD,
108-
steps: await this.mapStepsToDto(workflowToClone.steps, command),
108+
steps: await this.mapStepsToDto(originWorkflow.steps, command),
109109
preferences: this.mapPreferences(preferences),
110110
};
111111
}
@@ -128,20 +128,20 @@ export class SyncToEnvironmentUseCase {
128128
}
129129

130130
private async mapStepsToDto(
131-
steps: StepResponseDto[],
131+
originSteps: StepResponseDto[],
132132
command: SyncToEnvironmentCommand,
133-
existingWorkflowSteps?: StepResponseDto[]
133+
targetWorkflowSteps?: StepResponseDto[]
134134
): Promise<(StepUpdateDto | StepCreateDto)[]> {
135135
const augmentedSteps: (StepUpdateDto | StepCreateDto)[] = [];
136-
for (const step of steps) {
137-
const idAsOptionalObject = this.prodDbIdAsOptionalObject(existingWorkflowSteps, step);
136+
for (const originStep of originSteps) {
137+
const idAsOptionalObject = this.prodDbIdAsOptionalObject(originStep, targetWorkflowSteps);
138138
const stepDataDto = await this.buildStepDataUsecase.execute({
139139
identifierOrInternalId: command.identifierOrInternalId,
140-
stepId: step.stepId,
140+
stepId: originStep.stepId,
141141
user: command.user,
142142
});
143143

144-
augmentedSteps.push(this.buildSingleStepRequest(idAsOptionalObject, step, stepDataDto));
144+
augmentedSteps.push(this.buildSingleStepRequest(idAsOptionalObject, originStep, stepDataDto));
145145
}
146146

147147
return augmentedSteps;
@@ -164,8 +164,8 @@ export class SyncToEnvironmentUseCase {
164164
};
165165
}
166166

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

170170
if (prodDatabaseId) {
171171
return {
@@ -176,11 +176,8 @@ export class SyncToEnvironmentUseCase {
176176
}
177177
}
178178

179-
private findDatabaseIdInProdByExternalId(
180-
existingWorkflowSteps: StepResponseDto[] | undefined,
181-
step: StepResponseDto
182-
) {
183-
return existingWorkflowSteps?.find((existingStep) => existingStep.stepId === step.stepId)?._id ?? step._id;
179+
private findDatabaseIdInProdByExternalId(originStep: StepResponseDto, targetWorkflowSteps?: StepResponseDto[]) {
180+
return targetWorkflowSteps?.find((targetStep) => targetStep.stepId === originStep.stepId)?._id;
184181
}
185182

186183
private mapPreferences(preferences: PreferencesEntity[]): {

apps/api/src/app/workflows-v2/workflow.controller.e2e.ts

+3
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,9 @@ describe('Workflow Controller E2E API Testing', () => {
447447
it('should promote by creating a new workflow in production environment with the same properties', async () => {
448448
// Create a workflow in the development environment
449449
const devWorkflow = await createWorkflowAndValidate('-promote-workflow');
450+
await workflowsClient.patchWorkflowStepData(devWorkflow._id, devWorkflow.steps[0]._id, {
451+
controlValues: { vinyl: 'vinyl', color: 'red', band: 'beatles' },
452+
});
450453

451454
// Switch to production environment and get its ID
452455
const devEnvironmentId = session.environment._id;

apps/dashboard/package.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@novu/dashboard",
33
"private": true,
4-
"version": "0.0.1",
4+
"version": "2.1.0",
55
"type": "module",
66
"scripts": {
77
"start": "vite",
@@ -116,5 +116,10 @@
116116
},
117117
"peerDependencies": {
118118
"@novu/web": "workspace:*"
119+
},
120+
"nx": {
121+
"tags": [
122+
"type:app"
123+
]
119124
}
120125
}

apps/dashboard/src/components/workflow-editor/test-workflow/test-workflow-tabs.tsx

+5-3
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,14 @@ export const TestWorkflowTabs = ({ testData }: { testData: WorkflowTestDataRespo
5353
<>
5454
<ToastIcon variant="default" />
5555
<div className="flex flex-col gap-2">
56-
<span className="font-medium">Test workflow triggered successfully</span>
57-
<span className="text-foreground-600">{`Test workflow ${workflowSlug} was triggered successfully`}</span>
56+
<span className="font-medium">Test workflow succeeded</span>
57+
<span className="text-foreground-600 inline">
58+
Workflow <strong>{workflow?.name}</strong> was triggered successfully.
59+
</span>
5860
<Link
5961
to={`${LEGACY_ROUTES.ACTIVITY_FEED}?transactionId=${transactionId}`}
6062
reloadDocument
61-
className="text-foreground-950 flex items-center gap-1 text-sm font-medium"
63+
className="text-primary text-sm font-medium"
6264
>
6365
View activity feed
6466
</Link>

apps/inbound-mail/package.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@novu/inbound-mail",
3-
"version": "2.0.2",
3+
"version": "2.1.0",
44
"description": "",
55
"author": "",
66
"private": true,
@@ -62,5 +62,10 @@
6262
"ts-node": "~10.9.1",
6363
"tsconfig-paths": "~4.1.0",
6464
"typescript": "5.6.2"
65+
},
66+
"nx": {
67+
"tags": [
68+
"type:app"
69+
]
6570
}
6671
}

apps/web/package.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@novu/web",
3-
"version": "2.0.2",
3+
"version": "2.1.0",
44
"private": true,
55
"scripts": {
66
"start": "pnpm panda --watch & cross-env NODE_OPTIONS=--max_old_space_size=8192 DISABLE_ESLINT_PLUGIN=true PORT=4200 react-app-rewired start",
@@ -207,5 +207,10 @@
207207
}
208208
}
209209
]
210+
},
211+
"nx": {
212+
"tags": [
213+
"type:app"
214+
]
210215
}
211216
}

apps/webhook/package.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@novu/webhook",
3-
"version": "2.0.2",
3+
"version": "2.1.0",
44
"description": "",
55
"author": "",
66
"private": true,
@@ -79,5 +79,10 @@
7979
"@nestjs/platform-socket.io",
8080
"@nestjs/platform-socket.io/**"
8181
]
82+
},
83+
"nx": {
84+
"tags": [
85+
"type:app"
86+
]
8287
}
8388
}

apps/widget/package.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@novu/widget",
3-
"version": "2.0.2",
3+
"version": "2.1.0",
44
"private": true,
55
"scripts": {
66
"start": "DISABLE_ESLINT_PLUGIN=true react-app-rewired start",
@@ -121,5 +121,10 @@
121121
"**/@babel",
122122
"**/@babel/**"
123123
]
124+
},
125+
"nx": {
126+
"tags": [
127+
"type:app"
128+
]
124129
}
125130
}

apps/worker/package.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@novu/worker",
3-
"version": "2.0.2",
3+
"version": "2.1.0",
44
"description": "description",
55
"author": "",
66
"private": "true",
@@ -92,5 +92,10 @@
9292
"@novu/ee-billing": "workspace:*",
9393
"@novu/ee-shared-services": "workspace:*",
9494
"@novu/ee-translation": "workspace:*"
95+
},
96+
"nx": {
97+
"tags": [
98+
"type:app"
99+
]
95100
}
96101
}

apps/ws/package.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@novu/ws",
3-
"version": "2.0.2",
3+
"version": "2.1.0",
44
"description": "",
55
"author": "",
66
"private": true,
@@ -84,5 +84,10 @@
8484
"@nestjs/platform-socket.io",
8585
"@nestjs/platform-socket.io/**"
8686
]
87+
},
88+
"nx": {
89+
"tags": [
90+
"type:app"
91+
]
8792
}
8893
}

enterprise/packages/auth/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@novu/ee-auth",
3-
"version": "2.0.2",
3+
"version": "2.0.6",
44
"private": true,
55
"main": "dist/index.js",
66
"scripts": {

enterprise/packages/billing/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@novu/ee-billing",
3-
"version": "2.0.2",
3+
"version": "2.0.8",
44
"private": true,
55
"main": "dist/index.js",
66
"scripts": {

enterprise/packages/dal/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@novu/ee-dal",
3-
"version": "2.0.2",
3+
"version": "2.0.3",
44
"description": "",
55
"private": true,
66
"scripts": {

enterprise/packages/shared-services/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@novu/ee-shared-services",
3-
"version": "2.0.2",
3+
"version": "2.0.3",
44
"description": "Generic service used inside of Novu's different services - can not be depended on application-generic",
55
"main": "build/main/index.js",
66
"typings": "build/main/index.d.ts",

enterprise/packages/translation/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@novu/ee-translation",
3-
"version": "2.0.2",
3+
"version": "2.0.6",
44
"private": true,
55
"main": "dist/index.js",
66
"scripts": {

lerna.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
"message": "chore(release): publish - ci skip"
1616
}
1717
},
18-
"version": "2.0.1"
18+
"version": "2.1.0"
1919
}

libs/application-generic/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@novu/application-generic",
3-
"version": "2.0.2",
3+
"version": "2.0.6",
44
"description": "Generic backend code used inside of Novu's different services",
55
"main": "build/main/index.js",
66
"typings": "build/main/index.d.ts",

libs/dal/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@novu/dal",
3-
"version": "2.0.2",
3+
"version": "2.0.3",
44
"description": "",
55
"private": true,
66
"scripts": {

libs/design-system/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@novu/design-system",
3-
"version": "2.0.2",
3+
"version": "2.0.3",
44
"repository": "https://github.com/novuhq/novu",
55
"description": "",
66
"private": true,

libs/embed/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@novu/embed",
3-
"version": "2.0.2",
3+
"version": "2.0.4",
44
"private": true,
55
"description": "",
66
"keywords": [],

libs/notifications/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@novu/notifications",
3-
"version": "1.0.1",
3+
"version": "1.0.4",
44
"description": "Novu notification templates and workflows",
55
"main": "build/main/index.js",
66
"typings": "build/main/index.d.ts",

0 commit comments

Comments
 (0)