@nextsparkjs/core 0.1.0-beta.131 → 0.1.0-beta.132
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/dashboard/block-editor/builder-editor-view.d.ts +2 -1
- package/dist/components/dashboard/block-editor/builder-editor-view.d.ts.map +1 -1
- package/dist/components/dashboard/block-editor/builder-editor-view.js +3 -2
- package/dist/styles/classes.json +1 -1
- package/dist/templates/app/(auth)/accept-invite/[token]/page.tsx +1 -1
- package/dist/templates/app/api/v1/billing/webhooks/polar/route.ts +10 -2
- package/dist/templates/app/api/v1/billing/webhooks/stripe/route.ts +12 -3
- package/package.json +2 -2
- package/templates/app/(auth)/accept-invite/[token]/page.tsx +1 -1
- package/templates/app/api/v1/billing/webhooks/polar/route.ts +10 -2
- package/templates/app/api/v1/billing/webhooks/stripe/route.ts +12 -3
|
@@ -4,6 +4,7 @@ export interface BuilderEditorViewProps {
|
|
|
4
4
|
entityConfig: ClientEntityConfig;
|
|
5
5
|
id?: string;
|
|
6
6
|
mode: 'create' | 'edit';
|
|
7
|
+
onEntityFieldChange?: (field: string, value: unknown) => void;
|
|
7
8
|
}
|
|
8
|
-
export declare function BuilderEditorView({ entitySlug, entityConfig, id, mode }: BuilderEditorViewProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function BuilderEditorView({ entitySlug, entityConfig, id, mode, onEntityFieldChange: onEntityFieldChangeProp }: BuilderEditorViewProps): import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
//# sourceMappingURL=builder-editor-view.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder-editor-view.d.ts","sourceRoot":"","sources":["../../../../src/components/dashboard/block-editor/builder-editor-view.tsx"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAA;AAwCxF,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,kBAAkB,CAAA;IAChC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"builder-editor-view.d.ts","sourceRoot":"","sources":["../../../../src/components/dashboard/block-editor/builder-editor-view.tsx"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAA;AAwCxF,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,kBAAkB,CAAA;IAChC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAA;IACvB,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;CAC9D;AAED,wBAAgB,iBAAiB,CAAC,EAAE,UAAU,EAAE,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,EAAE,sBAAsB,2CAgsB7I"}
|
|
@@ -41,7 +41,7 @@ function buildApiHeaders(includeContentType = false) {
|
|
|
41
41
|
function slugify(text) {
|
|
42
42
|
return text.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/[^a-z0-9\s-]/g, "").trim().replace(/\s+/g, "-").replace(/-+/g, "-");
|
|
43
43
|
}
|
|
44
|
-
function BuilderEditorView({ entitySlug, entityConfig, id, mode }) {
|
|
44
|
+
function BuilderEditorView({ entitySlug, entityConfig, id, mode, onEntityFieldChange: onEntityFieldChangeProp }) {
|
|
45
45
|
var _a;
|
|
46
46
|
const router = useRouter();
|
|
47
47
|
const t = useTranslations("admin.builder");
|
|
@@ -311,7 +311,8 @@ function BuilderEditorView({ entitySlug, entityConfig, id, mode }) {
|
|
|
311
311
|
}, []);
|
|
312
312
|
const handleEntityFieldChange = useCallback((field, value) => {
|
|
313
313
|
setEntityFields((prev) => ({ ...prev, [field]: value }));
|
|
314
|
-
|
|
314
|
+
onEntityFieldChangeProp == null ? void 0 : onEntityFieldChangeProp(field, value);
|
|
315
|
+
}, [onEntityFieldChangeProp]);
|
|
315
316
|
const handleLeftSidebarToggle = useCallback((value) => {
|
|
316
317
|
if (!value || value === leftSidebarMode) {
|
|
317
318
|
setLeftSidebarMode("none");
|
package/dist/styles/classes.json
CHANGED
|
@@ -68,7 +68,7 @@ function AcceptInvitePage() {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
// Check email match
|
|
71
|
-
if (user.email.toLowerCase()
|
|
71
|
+
if ((user.email ?? '').toLowerCase() !== data.data.email.toLowerCase()) {
|
|
72
72
|
setStatus('email_mismatch')
|
|
73
73
|
setErrorMessage(`This invitation was sent to ${data.data.email}, but you are logged in as ${user.email}`)
|
|
74
74
|
return
|
|
@@ -22,7 +22,15 @@ import { query, queryOne } from '@nextsparkjs/core/lib/db'
|
|
|
22
22
|
import { getBillingGateway } from '@nextsparkjs/core/lib/billing/gateways/factory'
|
|
23
23
|
import { withRateLimitTier } from '@nextsparkjs/core/lib/api/rate-limit'
|
|
24
24
|
import type { PolarWebhookExtensions } from '@nextsparkjs/core/lib/billing/polar-webhook'
|
|
25
|
-
|
|
25
|
+
|
|
26
|
+
async function loadExtensions(): Promise<PolarWebhookExtensions> {
|
|
27
|
+
try {
|
|
28
|
+
const mod = await import('@/lib/billing/polar-webhook-extensions')
|
|
29
|
+
return mod.polarWebhookExtensions
|
|
30
|
+
} catch {
|
|
31
|
+
return {}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
26
34
|
|
|
27
35
|
async function handlePolarWebhook(request: NextRequest) {
|
|
28
36
|
// 1. Get raw body and ALL headers (Polar needs full headers for verification)
|
|
@@ -86,7 +94,7 @@ async function handlePolarWebhook(request: NextRequest) {
|
|
|
86
94
|
break
|
|
87
95
|
|
|
88
96
|
case 'order.paid':
|
|
89
|
-
await handleOrderPaid(event.data, eventId,
|
|
97
|
+
await handleOrderPaid(event.data, eventId, await loadExtensions())
|
|
90
98
|
break
|
|
91
99
|
|
|
92
100
|
default:
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Handles Stripe subscription lifecycle events.
|
|
5
5
|
* To add one-time payment handling (credit packs, LTD, upsells),
|
|
6
|
-
*
|
|
6
|
+
* create lib/billing/stripe-webhook-extensions.ts in your project.
|
|
7
7
|
*
|
|
8
8
|
* Rate limiting: 500 requests/hour per IP (tier: webhook).
|
|
9
9
|
* Stripe signature verification is the primary security layer;
|
|
@@ -14,12 +14,21 @@
|
|
|
14
14
|
|
|
15
15
|
import { NextRequest } from 'next/server'
|
|
16
16
|
import { handleStripeWebhook } from '@nextsparkjs/core/lib/billing/stripe-webhook'
|
|
17
|
-
import { stripeWebhookExtensions } from '@/lib/billing/stripe-webhook-extensions'
|
|
18
17
|
import { withRateLimitTier } from '@nextsparkjs/core/lib/api/rate-limit'
|
|
19
18
|
|
|
19
|
+
async function loadExtensions() {
|
|
20
|
+
try {
|
|
21
|
+
const mod = await import('@/lib/billing/stripe-webhook-extensions')
|
|
22
|
+
return mod.stripeWebhookExtensions
|
|
23
|
+
} catch {
|
|
24
|
+
return {}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
20
28
|
export const POST = withRateLimitTier(
|
|
21
29
|
async (request: NextRequest) => {
|
|
22
|
-
|
|
30
|
+
const extensions = await loadExtensions()
|
|
31
|
+
return handleStripeWebhook(request, extensions)
|
|
23
32
|
},
|
|
24
33
|
'webhook'
|
|
25
34
|
)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextsparkjs/core",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.132",
|
|
4
4
|
"description": "NextSpark - The complete SaaS framework for Next.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "NextSpark <hello@nextspark.dev>",
|
|
@@ -462,7 +462,7 @@
|
|
|
462
462
|
"tailwind-merge": "^3.3.1",
|
|
463
463
|
"uuid": "^13.0.0",
|
|
464
464
|
"zod": "^4.1.5",
|
|
465
|
-
"@nextsparkjs/testing": "0.1.0-beta.
|
|
465
|
+
"@nextsparkjs/testing": "0.1.0-beta.132"
|
|
466
466
|
},
|
|
467
467
|
"scripts": {
|
|
468
468
|
"postinstall": "node scripts/postinstall.mjs || true",
|
|
@@ -68,7 +68,7 @@ function AcceptInvitePage() {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
// Check email match
|
|
71
|
-
if (user.email.toLowerCase()
|
|
71
|
+
if ((user.email ?? '').toLowerCase() !== data.data.email.toLowerCase()) {
|
|
72
72
|
setStatus('email_mismatch')
|
|
73
73
|
setErrorMessage(`This invitation was sent to ${data.data.email}, but you are logged in as ${user.email}`)
|
|
74
74
|
return
|
|
@@ -22,7 +22,15 @@ import { query, queryOne } from '@nextsparkjs/core/lib/db'
|
|
|
22
22
|
import { getBillingGateway } from '@nextsparkjs/core/lib/billing/gateways/factory'
|
|
23
23
|
import { withRateLimitTier } from '@nextsparkjs/core/lib/api/rate-limit'
|
|
24
24
|
import type { PolarWebhookExtensions } from '@nextsparkjs/core/lib/billing/polar-webhook'
|
|
25
|
-
|
|
25
|
+
|
|
26
|
+
async function loadExtensions(): Promise<PolarWebhookExtensions> {
|
|
27
|
+
try {
|
|
28
|
+
const mod = await import('@/lib/billing/polar-webhook-extensions')
|
|
29
|
+
return mod.polarWebhookExtensions
|
|
30
|
+
} catch {
|
|
31
|
+
return {}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
26
34
|
|
|
27
35
|
async function handlePolarWebhook(request: NextRequest) {
|
|
28
36
|
// 1. Get raw body and ALL headers (Polar needs full headers for verification)
|
|
@@ -86,7 +94,7 @@ async function handlePolarWebhook(request: NextRequest) {
|
|
|
86
94
|
break
|
|
87
95
|
|
|
88
96
|
case 'order.paid':
|
|
89
|
-
await handleOrderPaid(event.data, eventId,
|
|
97
|
+
await handleOrderPaid(event.data, eventId, await loadExtensions())
|
|
90
98
|
break
|
|
91
99
|
|
|
92
100
|
default:
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Handles Stripe subscription lifecycle events.
|
|
5
5
|
* To add one-time payment handling (credit packs, LTD, upsells),
|
|
6
|
-
*
|
|
6
|
+
* create lib/billing/stripe-webhook-extensions.ts in your project.
|
|
7
7
|
*
|
|
8
8
|
* Rate limiting: 500 requests/hour per IP (tier: webhook).
|
|
9
9
|
* Stripe signature verification is the primary security layer;
|
|
@@ -14,12 +14,21 @@
|
|
|
14
14
|
|
|
15
15
|
import { NextRequest } from 'next/server'
|
|
16
16
|
import { handleStripeWebhook } from '@nextsparkjs/core/lib/billing/stripe-webhook'
|
|
17
|
-
import { stripeWebhookExtensions } from '@/lib/billing/stripe-webhook-extensions'
|
|
18
17
|
import { withRateLimitTier } from '@nextsparkjs/core/lib/api/rate-limit'
|
|
19
18
|
|
|
19
|
+
async function loadExtensions() {
|
|
20
|
+
try {
|
|
21
|
+
const mod = await import('@/lib/billing/stripe-webhook-extensions')
|
|
22
|
+
return mod.stripeWebhookExtensions
|
|
23
|
+
} catch {
|
|
24
|
+
return {}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
20
28
|
export const POST = withRateLimitTier(
|
|
21
29
|
async (request: NextRequest) => {
|
|
22
|
-
|
|
30
|
+
const extensions = await loadExtensions()
|
|
31
|
+
return handleStripeWebhook(request, extensions)
|
|
23
32
|
},
|
|
24
33
|
'webhook'
|
|
25
34
|
)
|