Skip to content

feat: add initial version of createGetCentraWebhookEvents#319

Open
adamsoderstrom wants to merge 2 commits into
mainfrom
feature/create-get-centra-webhook-events
Open

feat: add initial version of createGetCentraWebhookEvents#319
adamsoderstrom wants to merge 2 commits into
mainfrom
feature/create-get-centra-webhook-events

Conversation

@adamsoderstrom
Copy link
Copy Markdown
Member

No description provided.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Oct 28, 2024

🦋 Changeset detected

Latest commit: 1c87da3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@noaignite/centra-types Minor
@noaignite/next-centra-checkout Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Copy Markdown

vercel Bot commented Oct 28, 2024

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
docs Ready Ready Preview Comment Oct 2, 2025 7:21am

Comment thread packages/react-centra-checkout/package.json Outdated
Comment thread packages/react-centra-checkout/src/server/createGetCentraWebhookEvents.ts Outdated
Comment thread packages/react-centra-checkout/src/server/createGetCentraWebhookEvents.ts Outdated
Comment thread packages/react-centra-checkout/src/server/createGetCentraWebhookEvents.ts Outdated
Comment thread packages/react-centra-checkout/src/server/createGetCentraWebhookEvents.ts Outdated
Comment thread packages/react-centra-checkout/src/server/createGetCentraWebhookEvents.ts Outdated
@adamsoderstrom adamsoderstrom removed the request for review from alexanderflink March 10, 2025 12:11
@adamsoderstrom adamsoderstrom force-pushed the feature/create-get-centra-webhook-events branch from e7d5fff to 67bf809 Compare April 27, 2025 11:06
@adamsoderstrom adamsoderstrom force-pushed the feature/create-get-centra-webhook-events branch from 67bf809 to bceaa36 Compare April 27, 2025 13:18
@adamsoderstrom adamsoderstrom force-pushed the feature/create-get-centra-webhook-events branch from bceaa36 to 02a4092 Compare April 27, 2025 22:19
@adamsoderstrom adamsoderstrom force-pushed the feature/create-get-centra-webhook-events branch 2 times, most recently from f30d3cc to 23b1375 Compare May 1, 2025 11:26
@adamsoderstrom adamsoderstrom force-pushed the feature/create-get-centra-webhook-events branch from 23b1375 to 7de2df1 Compare May 24, 2025 22:01
@adamsoderstrom adamsoderstrom force-pushed the feature/create-get-centra-webhook-events branch from 7de2df1 to b9cbe8b Compare July 2, 2025 11:52
@adamsoderstrom adamsoderstrom force-pushed the feature/create-get-centra-webhook-events branch from b9cbe8b to a64f348 Compare July 2, 2025 11:53
@maeertin maeertin requested a review from Copilot September 24, 2025 17:23
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds initial support for handling Centra webhook events in Next.js applications by introducing the createGetCentraWebhookEvents function and related utilities.

  • Implements webhook event parsing with signature validation for security
  • Provides adapters for both Next.js App Router and Pages Router
  • Adds comprehensive type definitions for webhook events and error handling

Reviewed Changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/next-centra-checkout/src/createGetCentraWebhookEvents.ts Core implementation of webhook event parser with signature validation and router adapters
packages/next-centra-checkout/src/createGetCentraWebhookEvents.test.ts Comprehensive test suite covering all validation scenarios and adapter functionality
packages/centra-types/src/models/Events.ts Type definitions for Centra webhook events
packages/next-centra-checkout/package.json Package configuration and dependencies for the new library
packages/next-centra-checkout/tsup.config.ts Build configuration for TypeScript compilation
packages/next-centra-checkout/tsconfig.json TypeScript compiler configuration
packages/next-centra-checkout/src/index.ts Package exports
packages/next-centra-checkout/eslint.config.js ESLint configuration
packages/centra-types/src/models/index.ts Export addition for Events type
.changeset/shiny-kangaroos-dress.md Changeset for next-centra-checkout package
.changeset/curvy-wombats-itch.md Changeset for centra-types package
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread packages/next-centra-checkout/src/createGetCentraWebhookEvents.ts Outdated
Comment thread packages/next-centra-checkout/src/createGetCentraWebhookEvents.ts
Comment thread packages/next-centra-checkout/src/createGetCentraWebhookEvents.ts
@adamsoderstrom adamsoderstrom force-pushed the feature/create-get-centra-webhook-events branch from a64f348 to a81618d Compare September 24, 2025 17:48
Copilot AI review requested due to automatic review settings September 24, 2025 17:50
@adamsoderstrom adamsoderstrom force-pushed the feature/create-get-centra-webhook-events branch from a81618d to c9a892d Compare September 24, 2025 17:50
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 11 out of 12 changed files in this pull request and generated 3 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

sign(secret, `${parameters.t}.payload=${encodeURIComponent(body.payload)}`) !==
parameters.v1
) {
console.error('Invalid signature')
Copy link

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

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

The console.error call should be removed or made configurable. Logging to console directly in a library function can interfere with application logging strategies and may not be appropriate for all environments.

Copilot uses AI. Check for mistakes.
Comment thread packages/next-centra-checkout/src/createGetCentraWebhookEvents.ts Outdated
Comment thread packages/next-centra-checkout/src/createGetCentraWebhookEvents.ts Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 24, 2025

Codecov Report

❌ Patch coverage is 89.24731% with 10 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...entra-checkout/src/createGetCentraWebhookEvents.ts 90.21% 9 Missing ⚠️
packages/next-centra-checkout/src/index.ts 0.00% 0 Missing and 1 partial ⚠️
@@            Coverage Diff             @@
##             main     #319      +/-   ##
==========================================
+ Coverage   73.81%   74.46%   +0.65%     
==========================================
  Files          62       64       +2     
  Lines        2112     2205      +93     
  Branches      295      320      +25     
==========================================
+ Hits         1559     1642      +83     
- Misses        541      550       +9     
- Partials       12       13       +1     
Files with missing lines Coverage Δ
packages/next-centra-checkout/src/index.ts 0.00% <0.00%> (ø)
...entra-checkout/src/createGetCentraWebhookEvents.ts 90.21% <90.21%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@adamsoderstrom adamsoderstrom force-pushed the feature/create-get-centra-webhook-events branch from c9a892d to 068abe7 Compare September 24, 2025 18:12
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 11 out of 12 changed files in this pull request and generated 3 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

parameters.v1
) {
console.error('Invalid signature')

Copy link

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider making the error logging configurable or removing it entirely. Console.error calls in library code can clutter application logs and should ideally be handled by the consuming application.

Copilot uses AI. Check for mistakes.
return [undefined, payloadParsed] as CentraWebhookEventsData
} catch (e) {
console.error(e)

Copy link

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider making the error logging configurable or removing it entirely. Console.error calls in library code can clutter application logs and should ideally be handled by the consuming application.

Copilot uses AI. Check for mistakes.
Comment thread packages/next-centra-checkout/src/createGetCentraWebhookEvents.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants