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): converted bulk trigger to use SDK #7166

Merged
merged 2 commits into from
Dec 2, 2024

Conversation

tatarco
Copy link
Contributor

@tatarco tatarco commented Nov 29, 2024

What changed? Why was the change needed?

Screenshots

Expand for optional sections

Related enterprise PR

Special notes for your reviewer

Copy link

linear bot commented Nov 29, 2024

Copy link

netlify bot commented Nov 29, 2024

Deploy Preview for novu-stg-vite-dashboard-poc ready!

Name Link
🔨 Latest commit 4a9bd8b
🔍 Latest deploy log https://app.netlify.com/sites/novu-stg-vite-dashboard-poc/deploys/674dc8714f07db000856b1ed
😎 Deploy Preview https://deploy-preview-7166.dashboard-v2.novu-staging.co
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

// eslint-disable-next-line no-restricted-imports
import { NovuCore } from '@novu/api/core';
// eslint-disable-next-line no-restricted-imports
import { triggerBulk } from '@novu/api/funcs/triggerBulk';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

cannot do that, it's failing compilation, if importing type the method cannot be called, it's for typescript compilation and intelisense only

const { data: body } = response;
expect(body.data).to.be.ok;
expect(body.data.length).to.equal(3);
const dtoList = bulkTriggerResponse.value.result;
Copy link
Contributor

Choose a reason for hiding this comment

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

This .value.result duplication is subpar DX. Can we remove the .value part?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the value belongs to the reilroad programming, the result belongs to the response always being wrapped, we get the body and the headers where the body is in the results, what do you want to do?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally, it should be bulkTriggerResponse.result and bulkTriggerResponse.error, right? Do we have leverage to change that on the speakeasy generated code?

Copy link
Contributor

Choose a reason for hiding this comment

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

This was resolved offline. We will chat with speakeasy to get flatter responses.

// eslint-disable-next-line no-restricted-imports
import { NovuCore } from '@novu/api/core';
// eslint-disable-next-line no-restricted-imports
import { triggerBulk } from '@novu/api/funcs/triggerBulk';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

cannot do that, it's failing compilation, if importing type the method cannot be called, it's for typescript compilation and intelisense only

Copy link

netlify bot commented Nov 30, 2024

Deploy Preview for dev-web-novu ready!

Name Link
🔨 Latest commit 50c3870
🔍 Latest deploy log https://app.netlify.com/sites/dev-web-novu/deploys/674e18e50d0a3c0008ae7916
😎 Deploy Preview https://deploy-preview-7166.dashboard.novu-staging.co
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

pkg-pr-new bot commented Nov 30, 2024

Open in Stackblitz

@novu/client

npm i https://pkg.pr.new/novuhq/novu/@novu/client@7166

@novu/headless

npm i https://pkg.pr.new/novuhq/novu/@novu/headless@7166

@novu/framework

npm i https://pkg.pr.new/novuhq/novu/@novu/framework@7166

@novu/js

npm i https://pkg.pr.new/novuhq/novu/@novu/js@7166

@novu/nextjs

npm i https://pkg.pr.new/novuhq/novu/@novu/nextjs@7166

@novu/nest

npm i https://pkg.pr.new/novuhq/novu/@novu/nest@7166

@novu/node

npm i https://pkg.pr.new/novuhq/novu/@novu/node@7166

@novu/notification-center

npm i https://pkg.pr.new/novuhq/novu/@novu/notification-center@7166

novu

npm i https://pkg.pr.new/novuhq/novu@7166

@novu/providers

npm i https://pkg.pr.new/novuhq/novu/@novu/providers@7166

@novu/react

npm i https://pkg.pr.new/novuhq/novu/@novu/react@7166

@novu/react-native

npm i https://pkg.pr.new/novuhq/novu/@novu/react-native@7166

@novu/shared

npm i https://pkg.pr.new/novuhq/novu/@novu/shared@7166

@novu/stateless

npm i https://pkg.pr.new/novuhq/novu/@novu/stateless@7166

commit: 50c3870

Copy link

netlify bot commented Nov 30, 2024

Deploy Preview for dashboard-v2-novu-staging ready!

Name Link
🔨 Latest commit 50c3870
🔍 Latest deploy log https://app.netlify.com/sites/dashboard-v2-novu-staging/deploys/674e18e51ebaa10008307db8
😎 Deploy Preview https://deploy-preview-7166.dashboard-v2.novu-staging.co
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

feat(api): change trigger to use sdk

feat(api): pr comments

feat(api): converted bulk trigger to use SDK
@tatarco tatarco merged commit d8a7db6 into next Dec 2, 2024
43 checks passed
@tatarco tatarco deleted the nv-4861-e2e-testing-happy-path branch December 2, 2024 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants