@nextsparkjs/core 0.1.0-beta.147 → 0.1.0-beta.148
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/lib/auth.d.ts.map +1 -1
- package/dist/lib/auth.js +1 -0
- package/dist/lib/billing/gateways/stripe.d.ts +11 -0
- package/dist/lib/billing/gateways/stripe.d.ts.map +1 -1
- package/dist/lib/billing/gateways/stripe.js +13 -12
- package/dist/presets/plugin/.env.example.template +19 -0
- package/dist/presets/plugin/entities/.gitkeep +18 -0
- package/dist/presets/theme/blocks/.gitkeep +17 -0
- package/dist/presets/theme/public/brand/.gitkeep +8 -0
- package/dist/presets/theme/tests/cypress/.gitkeep +10 -0
- package/dist/styles/classes.json +1 -1
- package/dist/templates/contents/plugins/starter/plugin/.env.example.template +19 -0
- package/package.json +2 -2
- package/templates/contents/plugins/starter/plugin/.env.example.template +19 -0
package/dist/lib/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/lib/auth.ts"],"names":[],"mappings":"AAMA,OAAO,EAAgF,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAkDvH,eAAO,MAAM,IAAI;;;;
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/lib/auth.ts"],"names":[],"mappings":"AAMA,OAAO,EAAgF,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAkDvH,eAAO,MAAM,IAAI;;;;kGA+W07rgB,CAAC;oBAAyB,CAAC;;sBAAqD,CAAC;;qBAA4D,CAAC;;sBAA2E,CAAC;;uBAAgE,CAAC;;uBAAoD,CAAC;;0BAA2D,CAAC;6BAAwC,CAAC;mBAA8B,CAAC;oBAAgD,CAAC;;0BAAsD,CAAC;6BAAuD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kGAA8pD,CAAC;oBAAyB,CAAC;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAjDnkjqB,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;AACjD,MAAM,MAAM,WAAW,GAAG,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,GAAG;IAC1D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,kBAAkB,EAAE,QAAQ,EAAE,CAAC;CAC/C,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC5B,IAAI,EAAE,WAAW,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAO9B"}
|
package/dist/lib/auth.js
CHANGED
|
@@ -6,8 +6,19 @@
|
|
|
6
6
|
*
|
|
7
7
|
* P2: Stripe Integration
|
|
8
8
|
*/
|
|
9
|
+
import Stripe from 'stripe';
|
|
9
10
|
import type { BillingGateway } from './interface';
|
|
10
11
|
import type { CheckoutSessionResult, PortalSessionResult, SubscriptionResult, CustomerResult, WebhookEventResult, CreateCheckoutParams, CreatePortalParams, CreateCustomerParams, UpdateSubscriptionParams, CreateOneTimeCheckoutParams } from './types';
|
|
12
|
+
/**
|
|
13
|
+
* Lazy accessor for the shared Stripe SDK client. Returns the same instance on
|
|
14
|
+
* every call. Throws if STRIPE_SECRET_KEY is not configured.
|
|
15
|
+
*
|
|
16
|
+
* Exported so theme code can reach the SDK directly for the few cases the
|
|
17
|
+
* BillingGateway interface does not cover (e.g. updating subscription
|
|
18
|
+
* `quantity`, which is not part of UpdateSubscriptionParams). Prefer the
|
|
19
|
+
* BillingGateway interface for everything it already exposes.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getStripeInstance(): Stripe;
|
|
11
22
|
/**
|
|
12
23
|
* Stripe implementation of the BillingGateway interface.
|
|
13
24
|
* Maps Stripe SDK types to provider-agnostic result types.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stripe.d.ts","sourceRoot":"","sources":["../../../../src/lib/billing/gateways/stripe.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"stripe.d.ts","sourceRoot":"","sources":["../../../../src/lib/billing/gateways/stripe.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,MAAM,MAAM,QAAQ,CAAA;AAG3B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,KAAK,EACV,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,2BAA2B,EAC5B,MAAM,SAAS,CAAA;AAKhB;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAW1C;AAED;;;GAGG;AACH,qBAAa,aAAc,YAAW,cAAc;IAC5C,qBAAqB,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IA2CnF,qBAAqB,CAAC,MAAM,EAAE,2BAA2B,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAuB1F,mBAAmB,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAQnF,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,kBAAkB,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,kBAAkB;IAiBnH,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAYxD,cAAc,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC;IASrE,sBAAsB,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IA2BrF,6BAA6B,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAWlF,6BAA6B,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IASxF,eAAe,IAAI,MAAM;IAIzB,sBAAsB,IAAI;QAAE,UAAU,EAAE,MAAM,EAAE,CAAC;QAAC,WAAW,EAAE,MAAM,EAAE,CAAA;KAAE;IASzE,2BAA2B,CAAC,sBAAsB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI;IAOvF,sBAAsB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAUlF"}
|
|
@@ -2,7 +2,7 @@ import Stripe from "stripe";
|
|
|
2
2
|
import { BILLING_REGISTRY } from "@nextsparkjs/registries/billing-registry";
|
|
3
3
|
import { PlanService } from "../../services/plan.service.js";
|
|
4
4
|
let stripeInstance = null;
|
|
5
|
-
function
|
|
5
|
+
function getStripeInstance() {
|
|
6
6
|
if (!stripeInstance) {
|
|
7
7
|
if (!process.env.STRIPE_SECRET_KEY) {
|
|
8
8
|
throw new Error("STRIPE_SECRET_KEY is not configured");
|
|
@@ -44,7 +44,7 @@ class StripeGateway {
|
|
|
44
44
|
trial_period_days: planConfig.trialDays
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
const session = await
|
|
47
|
+
const session = await getStripeInstance().checkout.sessions.create(sessionParams);
|
|
48
48
|
return { id: session.id, url: session.url };
|
|
49
49
|
}
|
|
50
50
|
async createOneTimeCheckout(params) {
|
|
@@ -63,11 +63,11 @@ class StripeGateway {
|
|
|
63
63
|
} else if (customerEmail) {
|
|
64
64
|
sessionParams.customer_email = customerEmail;
|
|
65
65
|
}
|
|
66
|
-
const session = await
|
|
66
|
+
const session = await getStripeInstance().checkout.sessions.create(sessionParams);
|
|
67
67
|
return { id: session.id, url: session.url };
|
|
68
68
|
}
|
|
69
69
|
async createPortalSession(params) {
|
|
70
|
-
const session = await
|
|
70
|
+
const session = await getStripeInstance().billingPortal.sessions.create({
|
|
71
71
|
customer: params.customerId,
|
|
72
72
|
return_url: params.returnUrl
|
|
73
73
|
});
|
|
@@ -79,7 +79,7 @@ class StripeGateway {
|
|
|
79
79
|
throw new Error("STRIPE_WEBHOOK_SECRET is not configured");
|
|
80
80
|
}
|
|
81
81
|
const signature = typeof signatureOrHeaders === "string" ? signatureOrHeaders : signatureOrHeaders["stripe-signature"] || "";
|
|
82
|
-
const event =
|
|
82
|
+
const event = getStripeInstance().webhooks.constructEvent(payload, signature, webhookSecret);
|
|
83
83
|
return {
|
|
84
84
|
id: event.id,
|
|
85
85
|
type: event.type,
|
|
@@ -87,7 +87,7 @@ class StripeGateway {
|
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
89
|
async getCustomer(customerId) {
|
|
90
|
-
const customer = await
|
|
90
|
+
const customer = await getStripeInstance().customers.retrieve(customerId);
|
|
91
91
|
if ("deleted" in customer && customer.deleted) {
|
|
92
92
|
throw new Error(`Customer ${customerId} has been deleted`);
|
|
93
93
|
}
|
|
@@ -98,7 +98,7 @@ class StripeGateway {
|
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
100
|
async createCustomer(params) {
|
|
101
|
-
const customer = await
|
|
101
|
+
const customer = await getStripeInstance().customers.create(params);
|
|
102
102
|
return {
|
|
103
103
|
id: customer.id,
|
|
104
104
|
email: customer.email ?? null,
|
|
@@ -108,7 +108,7 @@ class StripeGateway {
|
|
|
108
108
|
async updateSubscriptionPlan(params) {
|
|
109
109
|
var _a;
|
|
110
110
|
const { subscriptionId, newPriceId, prorationBehavior = "create_prorations" } = params;
|
|
111
|
-
const stripe =
|
|
111
|
+
const stripe = getStripeInstance();
|
|
112
112
|
const subscription = await stripe.subscriptions.retrieve(subscriptionId);
|
|
113
113
|
const itemId = (_a = subscription.items.data[0]) == null ? void 0 : _a.id;
|
|
114
114
|
if (!itemId) {
|
|
@@ -128,7 +128,7 @@ class StripeGateway {
|
|
|
128
128
|
};
|
|
129
129
|
}
|
|
130
130
|
async cancelSubscriptionAtPeriodEnd(subscriptionId) {
|
|
131
|
-
const updated = await
|
|
131
|
+
const updated = await getStripeInstance().subscriptions.update(subscriptionId, {
|
|
132
132
|
cancel_at_period_end: true
|
|
133
133
|
});
|
|
134
134
|
return {
|
|
@@ -138,7 +138,7 @@ class StripeGateway {
|
|
|
138
138
|
};
|
|
139
139
|
}
|
|
140
140
|
async cancelSubscriptionImmediately(subscriptionId) {
|
|
141
|
-
const canceled = await
|
|
141
|
+
const canceled = await getStripeInstance().subscriptions.cancel(subscriptionId);
|
|
142
142
|
return {
|
|
143
143
|
id: canceled.id,
|
|
144
144
|
status: canceled.status,
|
|
@@ -164,7 +164,7 @@ class StripeGateway {
|
|
|
164
164
|
return `https://dashboard.stripe.com/${prefix}subscriptions/${externalSubscriptionId}`;
|
|
165
165
|
}
|
|
166
166
|
async reactivateSubscription(subscriptionId) {
|
|
167
|
-
const updated = await
|
|
167
|
+
const updated = await getStripeInstance().subscriptions.update(subscriptionId, {
|
|
168
168
|
cancel_at_period_end: false
|
|
169
169
|
});
|
|
170
170
|
return {
|
|
@@ -175,5 +175,6 @@ class StripeGateway {
|
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
export {
|
|
178
|
-
StripeGateway
|
|
178
|
+
StripeGateway,
|
|
179
|
+
getStripeInstance
|
|
179
180
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# {{PLUGIN_DISPLAY_NAME}} Plugin Environment Variables
|
|
2
|
+
# Copy this file to .env and configure your values
|
|
3
|
+
|
|
4
|
+
# =============================================================================
|
|
5
|
+
# REQUIRED CONFIGURATION
|
|
6
|
+
# =============================================================================
|
|
7
|
+
|
|
8
|
+
# API Key for external service (if applicable)
|
|
9
|
+
{{PLUGIN_ENV_PREFIX}}_API_KEY=your-api-key-here
|
|
10
|
+
|
|
11
|
+
# =============================================================================
|
|
12
|
+
# OPTIONAL CONFIGURATION
|
|
13
|
+
# =============================================================================
|
|
14
|
+
|
|
15
|
+
# Enable debug mode
|
|
16
|
+
{{PLUGIN_ENV_PREFIX}}_DEBUG=false
|
|
17
|
+
|
|
18
|
+
# Custom endpoint (if applicable)
|
|
19
|
+
# {{PLUGIN_ENV_PREFIX}}_ENDPOINT=https://api.example.com
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Plugin Entities
|
|
2
|
+
|
|
3
|
+
This directory is for plugin-specific entities.
|
|
4
|
+
|
|
5
|
+
If your plugin requires database entities, create them here following
|
|
6
|
+
the standard entity structure:
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
entities/
|
|
10
|
+
└── my-entity/
|
|
11
|
+
├── my-entity.config.ts
|
|
12
|
+
├── my-entity.fields.ts
|
|
13
|
+
└── messages/
|
|
14
|
+
├── en.json
|
|
15
|
+
└── es.json
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
See core/docs/04-entities/ for entity documentation.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Blocks Directory
|
|
2
|
+
#
|
|
3
|
+
# Add your page builder blocks here. Each block should have:
|
|
4
|
+
# - config.ts - Block metadata (slug, name, category, icon)
|
|
5
|
+
# - schema.ts - Zod validation schema
|
|
6
|
+
# - fields.ts - Field definitions for the editor
|
|
7
|
+
# - component.tsx - React component
|
|
8
|
+
# - thumbnail.png - Preview image (optional)
|
|
9
|
+
#
|
|
10
|
+
# Example structure:
|
|
11
|
+
# blocks/
|
|
12
|
+
# └── hero/
|
|
13
|
+
# ├── config.ts
|
|
14
|
+
# ├── schema.ts
|
|
15
|
+
# ├── fields.ts
|
|
16
|
+
# ├── component.tsx
|
|
17
|
+
# └── thumbnail.png
|
package/dist/styles/classes.json
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# {{PLUGIN_DISPLAY_NAME}} Plugin Environment Variables
|
|
2
|
+
# Copy this file to .env and configure your values
|
|
3
|
+
|
|
4
|
+
# =============================================================================
|
|
5
|
+
# REQUIRED CONFIGURATION
|
|
6
|
+
# =============================================================================
|
|
7
|
+
|
|
8
|
+
# API Key for external service (if applicable)
|
|
9
|
+
{{PLUGIN_ENV_PREFIX}}_API_KEY=your-api-key-here
|
|
10
|
+
|
|
11
|
+
# =============================================================================
|
|
12
|
+
# OPTIONAL CONFIGURATION
|
|
13
|
+
# =============================================================================
|
|
14
|
+
|
|
15
|
+
# Enable debug mode
|
|
16
|
+
{{PLUGIN_ENV_PREFIX}}_DEBUG=false
|
|
17
|
+
|
|
18
|
+
# Custom endpoint (if applicable)
|
|
19
|
+
# {{PLUGIN_ENV_PREFIX}}_ENDPOINT=https://api.example.com
|
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.148",
|
|
4
4
|
"description": "NextSpark - The complete SaaS framework for Next.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "NextSpark <hello@nextspark.dev>",
|
|
@@ -463,7 +463,7 @@
|
|
|
463
463
|
"tailwind-merge": "^3.3.1",
|
|
464
464
|
"uuid": "^13.0.0",
|
|
465
465
|
"zod": "^4.1.5",
|
|
466
|
-
"@nextsparkjs/testing": "0.1.0-beta.
|
|
466
|
+
"@nextsparkjs/testing": "0.1.0-beta.148"
|
|
467
467
|
},
|
|
468
468
|
"scripts": {
|
|
469
469
|
"postinstall": "node scripts/postinstall.mjs || true",
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# {{PLUGIN_DISPLAY_NAME}} Plugin Environment Variables
|
|
2
|
+
# Copy this file to .env and configure your values
|
|
3
|
+
|
|
4
|
+
# =============================================================================
|
|
5
|
+
# REQUIRED CONFIGURATION
|
|
6
|
+
# =============================================================================
|
|
7
|
+
|
|
8
|
+
# API Key for external service (if applicable)
|
|
9
|
+
{{PLUGIN_ENV_PREFIX}}_API_KEY=your-api-key-here
|
|
10
|
+
|
|
11
|
+
# =============================================================================
|
|
12
|
+
# OPTIONAL CONFIGURATION
|
|
13
|
+
# =============================================================================
|
|
14
|
+
|
|
15
|
+
# Enable debug mode
|
|
16
|
+
{{PLUGIN_ENV_PREFIX}}_DEBUG=false
|
|
17
|
+
|
|
18
|
+
# Custom endpoint (if applicable)
|
|
19
|
+
# {{PLUGIN_ENV_PREFIX}}_ENDPOINT=https://api.example.com
|