Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): Add Novu-managed Bridge endpoint per environment #6451

Merged
merged 112 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
8e09300
refactor(api): add novu bridge handler and update methods
rifont Sep 6, 2024
6c7291f
fix: Correct spelling error in variable name
rifont Sep 6, 2024
a3d012a
docs(environments): update TODO comment in GET handler
rifont Sep 6, 2024
e51c309
refactor(environments): rename NovuBridgeHandler to NovuNestjsHandler
rifont Sep 6, 2024
69f6d04
feat(api): add EnvironmentsBridgeController
rifont Sep 6, 2024
40612b2
feat(environments): add OPTIONS method and refactor code
rifont Sep 6, 2024
2cff9ad
fix(environments): remove unnecessary @Options decorator
rifont Sep 6, 2024
ba266c4
fix(environments): fix method type in handleRequest call
rifont Sep 6, 2024
dfb0428
refactor(api): add novu bridge handler and update methods
rifont Sep 6, 2024
a4b1eaa
fix: Correct spelling error in variable name
rifont Sep 6, 2024
e0e12ef
docs(environments): update TODO comment in GET handler
rifont Sep 6, 2024
4c288d0
refactor(environments): rename NovuBridgeHandler to NovuNestjsHandler
rifont Sep 6, 2024
b54451d
feat(api): add EnvironmentsBridgeController
rifont Sep 6, 2024
dcd8f58
feat(environments): add OPTIONS method and refactor code
rifont Sep 6, 2024
57b9fe9
fix(environments): remove unnecessary @Options decorator
rifont Sep 6, 2024
43f7c2f
fix(environments): fix method type in handleRequest call
rifont Sep 6, 2024
8d5c4b8
Merge branch 'novu-managed-bridge-endpoint' of ssh://github.com/novuh…
rifont Sep 30, 2024
9d33b7d
feat: Add NestJS support to framework
rifont Oct 4, 2024
2e931b8
Merge branch 'next' into novu-managed-bridge-endpoint
rifont Oct 4, 2024
43c6b4f
docs(nest.module): update JSON middleware usage example
rifont Oct 4, 2024
3745a20
refactor(nest): simplify request handling logic
rifont Oct 4, 2024
c9d5ae6
refactor(nest): simplify handleRequest method call
rifont Oct 4, 2024
65d903b
refactor(nest.controller): replace @All with specific methods
rifont Oct 4, 2024
279d0ce
Merge branch 'next' into novu-managed-bridge-endpoint
rifont Oct 10, 2024
f26fd0d
refactor: remove unused NestJS files
rifont Oct 10, 2024
621d605
revert changes
rifont Oct 10, 2024
b9991e8
revert changes
rifont Oct 10, 2024
772245e
refactor(api): remove novu-nestjs-handler file
rifont Oct 10, 2024
0279f35
refactor(environments): remove bridge controller
rifont Oct 10, 2024
3b14d62
fix(novu-bridge-client): correct action enum check logic
rifont Oct 10, 2024
73aa9d8
fix(execute-bridge-job): correct IDs for control vars lookup
rifont Oct 11, 2024
7cc7c82
fix(novu-bridge-client): handle missing step template
rifont Oct 11, 2024
640a035
Merge branch 'next' into novu-managed-bridge-endpoint
rifont Oct 11, 2024
ff46ad9
refactor(novu-bridge-client): update step type handling
rifont Oct 11, 2024
1de53c5
style: Remove unused import in novu-bridge-client
rifont Oct 11, 2024
28eb94a
style: Update tsconfig and remove unused import
rifont Oct 11, 2024
7c330d7
refactor(api): rename validateBridgeUrlUsecase variable
rifont Oct 13, 2024
236c03d
refactor(novu-bridge): use command pattern in workflow creation
rifont Oct 14, 2024
dd78f10
refactor(environments): rename create to construct
rifont Oct 14, 2024
ff3c8d4
docs(api): add comments for NovuBridgeClient class
rifont Oct 14, 2024
efcb21c
refactor: Rename createFrameworkWorkflow variable
rifont Oct 14, 2024
0337e46
refactor(construct-framework-workflow): enhance step options
rifont Oct 14, 2024
82cef5d
Merge branch 'next' into novu-managed-bridge-endpoint
rifont Oct 14, 2024
913d52b
style: Simplify comment syntax
rifont Oct 14, 2024
e853ade
style: Add type assertion for StepOptions
rifont Oct 14, 2024
b262cbd
refactor(api): add novu bridge handler and update methods
rifont Sep 6, 2024
a46310a
fix: Correct spelling error in variable name
rifont Sep 6, 2024
850eae7
docs(environments): update TODO comment in GET handler
rifont Sep 6, 2024
4158d6b
refactor(environments): rename NovuBridgeHandler to NovuNestjsHandler
rifont Sep 6, 2024
2141915
feat(api): add EnvironmentsBridgeController
rifont Sep 6, 2024
4a3bddc
feat(environments): add OPTIONS method and refactor code
rifont Sep 6, 2024
b5c05f8
fix(environments): remove unnecessary @Options decorator
rifont Sep 6, 2024
48cf9d9
fix(environments): fix method type in handleRequest call
rifont Sep 6, 2024
d96c57e
refactor(api): add novu bridge handler and update methods
rifont Sep 6, 2024
a591636
fix: Correct spelling error in variable name
rifont Sep 6, 2024
68b9839
docs(environments): update TODO comment in GET handler
rifont Sep 6, 2024
35f90b7
refactor(environments): rename NovuBridgeHandler to NovuNestjsHandler
rifont Sep 6, 2024
f8b0e34
feat(api): add EnvironmentsBridgeController
rifont Sep 6, 2024
c005246
feat: Add NestJS support to framework
rifont Oct 4, 2024
995d2b2
refactor(nest): simplify request handling logic
rifont Oct 4, 2024
54ab80c
refactor: remove unused NestJS files
rifont Oct 10, 2024
329ae1d
revert changes
rifont Oct 10, 2024
f5d27df
refactor(api): remove novu-nestjs-handler file
rifont Oct 10, 2024
23eb424
refactor(environments): remove bridge controller
rifont Oct 10, 2024
8712f28
fix(novu-bridge-client): correct action enum check logic
rifont Oct 10, 2024
61f1cb6
fix(execute-bridge-job): correct IDs for control vars lookup
rifont Oct 11, 2024
3472cba
fix(novu-bridge-client): handle missing step template
rifont Oct 11, 2024
9984034
refactor(novu-bridge-client): update step type handling
rifont Oct 11, 2024
d7ba8f9
style: Remove unused import in novu-bridge-client
rifont Oct 11, 2024
689ab2f
style: Update tsconfig and remove unused import
rifont Oct 11, 2024
6083329
refactor(api): rename validateBridgeUrlUsecase variable
rifont Oct 13, 2024
be5d3d2
refactor(novu-bridge): use command pattern in workflow creation
rifont Oct 14, 2024
077beac
refactor(environments): rename create to construct
rifont Oct 14, 2024
86d1389
docs(api): add comments for NovuBridgeClient class
rifont Oct 14, 2024
050ea33
refactor: Rename createFrameworkWorkflow variable
rifont Oct 14, 2024
48308d8
refactor(construct-framework-workflow): enhance step options
rifont Oct 14, 2024
bb534b2
style: Simplify comment syntax
rifont Oct 14, 2024
8d2663a
style: Add type assertion for StepOptions
rifont Oct 14, 2024
f01932c
Merge branch 'novu-managed-bridge-endpoint' of ssh://github.com/novuh…
rifont Oct 14, 2024
f226829
refactor(headers): remove duplicate enum entry
rifont Oct 14, 2024
45ad34a
style(analytics): remove unnecessary line breaks
rifont Oct 14, 2024
9f83947
Merge branch 'next' into novu-managed-bridge-endpoint
rifont Oct 14, 2024
bd3ebe3
fix: handle undefined bridge URL fallback
rifont Oct 14, 2024
59bb34b
refactor(construct-workflow): remove controlValues param
rifont Oct 14, 2024
78a9b0b
chore: add "Maily" to cspell dictionary
rifont Oct 14, 2024
d85982f
refactor(construct-framework): extract step logic
rifont Oct 14, 2024
13da6e2
Merge branch 'next' into novu-managed-bridge-endpoint
rifont Oct 14, 2024
f6f5248
style: Update hydration logic comments
rifont Oct 14, 2024
955d25b
docs: add TODO comment for step options resolution
rifont Oct 14, 2024
f0e8e19
refactor(construct-framework): add StepOutput return type
rifont Oct 14, 2024
308b1e6
refactor: remove unused controlValues parameter
rifont Oct 14, 2024
b8a58bb
refactor(execute-bridge-request): use error constants
rifont Oct 14, 2024
c02d843
feat: Add logging for job step details
rifont Oct 14, 2024
9f9cfb3
refactor(construct-framework-workflow): remove TODO comments
rifont Oct 15, 2024
0afbe95
refactor(api): add novu bridge handler and update methods
rifont Sep 6, 2024
5bbfdbc
Merge branch 'novu-managed-bridge-endpoint' of ssh://github.com/novuh…
rifont Oct 15, 2024
a991f46
feat(upsert-workflow): use slugify for stepId creation
rifont Oct 15, 2024
c36d9bb
fix(upsert-workflow): handle missing step ID exception
rifont Oct 15, 2024
2e1a312
fix(api): Hide bridge controller from OAS
rifont Oct 15, 2024
fe006a9
fix: update exception type for missing step elements
rifont Oct 15, 2024
bf92708
fix(workflow): change exception to InternalServerErrorException
rifont Oct 15, 2024
95bc9d4
feat: add error logging for bridge endpoint issues
rifont Oct 15, 2024
169ee2a
feat(e2e): add novu-hosted bridge trigger test
rifont Oct 15, 2024
05f70e9
feat: use slug instead of name for workflow triggers
rifont Oct 15, 2024
8368d7b
refactor(notification-template-mapper): remove undefined return
rifont Oct 15, 2024
5b4dff2
feat(workflows-v2): add schema controls to steps
rifont Oct 15, 2024
dcd2033
Merge branch 'next' into novu-managed-bridge-endpoint
rifont Oct 15, 2024
c665dbe
refactor(workflow): replace slug with workflowId usage
rifont Oct 15, 2024
63e236d
refactor(upsert-workflow): remove unused import slugify
rifont Oct 15, 2024
f11ef8a
fix(upsert-workflow): correct stepId to _templateId mapping
rifont Oct 15, 2024
8e9ba81
refactor(upsert-workflow): remove unused import
rifont Oct 15, 2024
a421f74
feat(workflows): prevent duplicate step IDs creation
rifont Oct 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions apps/api/src/app/events/e2e/bridge-trigger.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1488,6 +1488,7 @@ describe('Novu-Hosted Bridge Trigger', () => {
name: 'Test Workflow',
description: 'Test Workflow',
__source: WorkflowCreationSourceEnum.DASHBOARD,
workflowId: 'test-workflow',
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@djabarovgeorge I'm adding the workflowId during creation here for the time being, let's discuss separately.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

steps: [
{
type: StepTypeEnum.IN_APP,
Expand Down Expand Up @@ -1517,13 +1518,13 @@ describe('Novu-Hosted Bridge Trigger', () => {

const responseData = response.body.data as WorkflowResponseDto;

await triggerEvent(session, responseData.slug, subscriber._id, {});
await triggerEvent(session, responseData.workflowId, subscriber._id, {});
await session.awaitRunningJobs();

const sentMessages = await messageRepository.find({
_environmentId: session.environment._id,
_subscriberId: session.subscriberProfile?._id,
templateIdentifier: responseData.slug,
templateIdentifier: responseData.workflowId,
channel: StepTypeEnum.IN_APP,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export function toResponseWorkflowDto(

return {
_id: template._id,
slug: template.triggers[0].identifier,
tags: template.tags,
active: template.active,
preferences: preferencesDto,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ export class UpsertWorkflowUseCase {
controls: step.controls,
content: '',
},
stepId: slugify(step.name, { lower: true, strict: true, trim: true }),
stepId: slugifyName(step.name),
name: step.name,
};
}
Expand Down
4 changes: 0 additions & 4 deletions packages/shared/src/dto/workflows/workflow-response-dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,4 @@ export class WorkflowResponseDto extends WorkflowCommonsFields {
@IsEnum(WorkflowTypeEnum)
@IsDefined()
type: WorkflowTypeEnum;

@IsString()
@IsDefined()
slug: string;
}
Loading