@brainerce/mcp-server 2.6.0 → 2.8.0
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/bin/http.js +468 -41
- package/dist/bin/stdio.js +468 -41
- package/dist/index.d.mts +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +468 -41
- package/dist/index.mjs +468 -41
- package/package.json +54 -53
package/dist/index.d.mts
CHANGED
|
@@ -33,7 +33,14 @@ declare const AVAILABLE_DOMAINS: string[];
|
|
|
33
33
|
declare const PROJECT_TEMPLATE = "# Next.js Brainerce Store \u2014 Project Structure\n\n```\nmy-store/\n\u251C\u2500\u2500 package.json # Dependencies: brainerce, next, react, tailwindcss\n\u251C\u2500\u2500 next.config.js\n\u251C\u2500\u2500 tailwind.config.ts\n\u251C\u2500\u2500 tsconfig.json\n\u251C\u2500\u2500 lib/\n\u2502 \u2514\u2500\u2500 brainerce.ts # SDK client setup, cart helpers, auth helpers\n\u251C\u2500\u2500 app/\n\u2502 \u251C\u2500\u2500 layout.tsx # Root layout with StoreProvider\n\u2502 \u251C\u2500\u2500 page.tsx # Home: hero, featured products, categories\n\u2502 \u251C\u2500\u2500 products/\n\u2502 \u2502 \u251C\u2500\u2500 page.tsx # Product listing with infinite scroll\n\u2502 \u2502 \u2514\u2500\u2500 [slug]/\n\u2502 \u2502 \u2514\u2500\u2500 page.tsx # Product detail: images, variants, add to cart\n\u2502 \u251C\u2500\u2500 cart/\n\u2502 \u2502 \u2514\u2500\u2500 page.tsx # Cart: items with checkboxes, coupon, totals\n\u2502 \u251C\u2500\u2500 checkout/\n\u2502 \u2502 \u2514\u2500\u2500 page.tsx # Checkout: address \u2192 shipping \u2192 payment\n\u2502 \u251C\u2500\u2500 order-confirmation/\n\u2502 \u2502 \u2514\u2500\u2500 page.tsx # Order confirmation: waitForOrder() + handlePaymentSuccess()\n\u2502 \u251C\u2500\u2500 login/\n\u2502 \u2502 \u2514\u2500\u2500 page.tsx # Login: email/password + OAuth buttons\n\u2502 \u251C\u2500\u2500 register/\n\u2502 \u2502 \u2514\u2500\u2500 page.tsx # Register: form + OAuth buttons\n\u2502 \u251C\u2500\u2500 verify-email/\n\u2502 \u2502 \u2514\u2500\u2500 page.tsx # Email verification: 6-digit code + resend\n\u2502 \u251C\u2500\u2500 auth/\n\u2502 \u2502 \u2514\u2500\u2500 callback/\n\u2502 \u2502 \u2514\u2500\u2500 page.tsx # OAuth callback: extract token from URL params\n\u2502 \u2514\u2500\u2500 account/\n\u2502 \u2514\u2500\u2500 page.tsx # Account: profile + order history (protected)\n\u251C\u2500\u2500 components/\n\u2502 \u251C\u2500\u2500 Header.tsx # Logo, nav, cart icon, search autocomplete\n\u2502 \u251C\u2500\u2500 ProductCard.tsx # Product card with image, price, stock badge\n\u2502 \u251C\u2500\u2500 StockBadge.tsx # \"Only X left!\" low stock indicator\n\u2502 \u251C\u2500\u2500 ReservationCountdown.tsx # Timer for reserved items\n\u2502 \u251C\u2500\u2500 StripePaymentForm.tsx # Stripe Elements payment form\n\u2502 \u251C\u2500\u2500 GrowPaymentForm.tsx # Grow iframe payment form\n\u2502 \u2514\u2500\u2500 PayPalPaymentForm.tsx # PayPal Buttons payment form\n\u2514\u2500\u2500 public/\n \u2514\u2500\u2500 placeholder.jpg # Fallback product image\n```\n\n## Key Dependencies\n\n```json\n{\n \"dependencies\": {\n \"brainerce\": \"latest\",\n \"next\": \"^15\",\n \"react\": \"^19\",\n \"react-dom\": \"^19\",\n \"@stripe/stripe-js\": \"latest\",\n \"@stripe/react-stripe-js\": \"latest\",\n \"@paypal/react-paypal-js\": \"latest\"\n },\n \"devDependencies\": {\n \"tailwindcss\": \"^4\",\n \"typescript\": \"^5\",\n \"@types/react\": \"latest\",\n \"@types/node\": \"latest\"\n }\n}\n```\n\n## File Descriptions\n\n| File | Purpose |\n|------|---------|\n| `lib/brainerce.ts` | SDK client init, cart ID helpers, customer token helpers |\n| `app/page.tsx` | Homepage with hero section and featured products grid |\n| `app/products/page.tsx` | Product listing with infinite scroll (50/page), filters, search |\n| `app/products/[slug]/page.tsx` | Product detail with variant switching, description, metafields |\n| `app/cart/page.tsx` | Cart with checkboxes for partial checkout, coupon input, reservation timer |\n| `app/checkout/page.tsx` | Multi-step: address \u2192 shipping rates \u2192 payment (Stripe/Grow/PayPal) |\n| `app/order-confirmation/page.tsx` | Polls waitForOrder(), shows order number, clears cart |\n| `app/login/page.tsx` | Email/password login + OAuth buttons, handles requiresVerification |\n| `app/register/page.tsx` | Registration form + OAuth, handles requiresVerification |\n| `app/verify-email/page.tsx` | 6-digit verification code input with resend button |\n| `app/auth/callback/page.tsx` | Extracts OAuth token from URL params, stores in localStorage |\n| `app/account/page.tsx` | Protected page: getMyProfile() + getMyOrders() |\n| `components/Header.tsx` | Site header with nav, cart count badge, search autocomplete |\n\n## Content Security Policy (CSP)\n\nPayment SDKs load iframes and scripts from external domains. Add these CSP headers in `next.config.js`:\n\n```js\n// next.config.js\nmodule.exports = {\n async headers() {\n return [{\n source: '/(.*)',\n headers: [{\n key: 'Content-Security-Policy',\n value: [\n \"default-src 'self'\",\n \"script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdn.meshulam.co.il https://meshulam.co.il https://*.meshulam.co.il https://grow.link https://*.grow.link https://*.grow.security https://js.stripe.com https://pay.google.com\",\n \"style-src 'self' 'unsafe-inline'\",\n \"img-src 'self' data: blob: https:\",\n \"font-src 'self' data:\",\n \"frame-src 'self' https://*.meshulam.co.il https://grow.link https://*.grow.link https://*.grow.security https://*.creditguard.co.il https://js.stripe.com https://hooks.stripe.com https://pay.google.com\",\n \"connect-src 'self' https://*.meshulam.co.il https://grow.link https://*.grow.link https://*.grow.security https://google.com https://pay.google.com https://*.stripe.com https://*.creditguard.co.il\",\n \"worker-src 'self' blob:\",\n ].join('; '),\n }],\n }];\n },\n};\n```\n\n**Required domains by provider:**\n- **Grow**: `*.meshulam.co.il`, `grow.link`, `*.grow.link`, `*.grow.security`, `*.creditguard.co.il`\n- **Stripe**: `js.stripe.com`, `hooks.stripe.com`, `*.stripe.com`\n- **Google Pay**: `pay.google.com`, `google.com`\n";
|
|
34
34
|
|
|
35
35
|
interface StoreInfo {
|
|
36
|
+
/**
|
|
37
|
+
* Display name — prefers the per-connection channel name (what the user
|
|
38
|
+
* sees in their Brainerce dashboard sales-channel card), falling back to
|
|
39
|
+
* the parent store name.
|
|
40
|
+
*/
|
|
36
41
|
name: string;
|
|
42
|
+
/** Parent store name (the account-level store). */
|
|
43
|
+
storeName: string;
|
|
37
44
|
currency: string;
|
|
38
45
|
language: string;
|
|
39
46
|
i18n?: {
|
|
@@ -46,7 +53,10 @@ declare function fetchStoreInfo(connectionId: string, baseUrl?: string): Promise
|
|
|
46
53
|
|
|
47
54
|
interface StoreCapabilities {
|
|
48
55
|
store: {
|
|
56
|
+
/** Parent store name (account-level). */
|
|
49
57
|
name: string;
|
|
58
|
+
/** Per-connection channel display name (what the user sees in the dashboard). */
|
|
59
|
+
channelName?: string;
|
|
50
60
|
currency: string;
|
|
51
61
|
language: string;
|
|
52
62
|
i18n?: {
|
|
@@ -79,6 +89,7 @@ interface StoreCapabilities {
|
|
|
79
89
|
hasDiscountRules: boolean;
|
|
80
90
|
hasDownloadableProducts: boolean;
|
|
81
91
|
hasCoupons: boolean;
|
|
92
|
+
hasCheckoutCustomFields: boolean;
|
|
82
93
|
};
|
|
83
94
|
}
|
|
84
95
|
declare function fetchStoreCapabilities(connectionId: string, baseUrl?: string): Promise<StoreCapabilities>;
|
package/dist/index.d.ts
CHANGED
|
@@ -33,7 +33,14 @@ declare const AVAILABLE_DOMAINS: string[];
|
|
|
33
33
|
declare const PROJECT_TEMPLATE = "# Next.js Brainerce Store \u2014 Project Structure\n\n```\nmy-store/\n\u251C\u2500\u2500 package.json # Dependencies: brainerce, next, react, tailwindcss\n\u251C\u2500\u2500 next.config.js\n\u251C\u2500\u2500 tailwind.config.ts\n\u251C\u2500\u2500 tsconfig.json\n\u251C\u2500\u2500 lib/\n\u2502 \u2514\u2500\u2500 brainerce.ts # SDK client setup, cart helpers, auth helpers\n\u251C\u2500\u2500 app/\n\u2502 \u251C\u2500\u2500 layout.tsx # Root layout with StoreProvider\n\u2502 \u251C\u2500\u2500 page.tsx # Home: hero, featured products, categories\n\u2502 \u251C\u2500\u2500 products/\n\u2502 \u2502 \u251C\u2500\u2500 page.tsx # Product listing with infinite scroll\n\u2502 \u2502 \u2514\u2500\u2500 [slug]/\n\u2502 \u2502 \u2514\u2500\u2500 page.tsx # Product detail: images, variants, add to cart\n\u2502 \u251C\u2500\u2500 cart/\n\u2502 \u2502 \u2514\u2500\u2500 page.tsx # Cart: items with checkboxes, coupon, totals\n\u2502 \u251C\u2500\u2500 checkout/\n\u2502 \u2502 \u2514\u2500\u2500 page.tsx # Checkout: address \u2192 shipping \u2192 payment\n\u2502 \u251C\u2500\u2500 order-confirmation/\n\u2502 \u2502 \u2514\u2500\u2500 page.tsx # Order confirmation: waitForOrder() + handlePaymentSuccess()\n\u2502 \u251C\u2500\u2500 login/\n\u2502 \u2502 \u2514\u2500\u2500 page.tsx # Login: email/password + OAuth buttons\n\u2502 \u251C\u2500\u2500 register/\n\u2502 \u2502 \u2514\u2500\u2500 page.tsx # Register: form + OAuth buttons\n\u2502 \u251C\u2500\u2500 verify-email/\n\u2502 \u2502 \u2514\u2500\u2500 page.tsx # Email verification: 6-digit code + resend\n\u2502 \u251C\u2500\u2500 auth/\n\u2502 \u2502 \u2514\u2500\u2500 callback/\n\u2502 \u2502 \u2514\u2500\u2500 page.tsx # OAuth callback: extract token from URL params\n\u2502 \u2514\u2500\u2500 account/\n\u2502 \u2514\u2500\u2500 page.tsx # Account: profile + order history (protected)\n\u251C\u2500\u2500 components/\n\u2502 \u251C\u2500\u2500 Header.tsx # Logo, nav, cart icon, search autocomplete\n\u2502 \u251C\u2500\u2500 ProductCard.tsx # Product card with image, price, stock badge\n\u2502 \u251C\u2500\u2500 StockBadge.tsx # \"Only X left!\" low stock indicator\n\u2502 \u251C\u2500\u2500 ReservationCountdown.tsx # Timer for reserved items\n\u2502 \u251C\u2500\u2500 StripePaymentForm.tsx # Stripe Elements payment form\n\u2502 \u251C\u2500\u2500 GrowPaymentForm.tsx # Grow iframe payment form\n\u2502 \u2514\u2500\u2500 PayPalPaymentForm.tsx # PayPal Buttons payment form\n\u2514\u2500\u2500 public/\n \u2514\u2500\u2500 placeholder.jpg # Fallback product image\n```\n\n## Key Dependencies\n\n```json\n{\n \"dependencies\": {\n \"brainerce\": \"latest\",\n \"next\": \"^15\",\n \"react\": \"^19\",\n \"react-dom\": \"^19\",\n \"@stripe/stripe-js\": \"latest\",\n \"@stripe/react-stripe-js\": \"latest\",\n \"@paypal/react-paypal-js\": \"latest\"\n },\n \"devDependencies\": {\n \"tailwindcss\": \"^4\",\n \"typescript\": \"^5\",\n \"@types/react\": \"latest\",\n \"@types/node\": \"latest\"\n }\n}\n```\n\n## File Descriptions\n\n| File | Purpose |\n|------|---------|\n| `lib/brainerce.ts` | SDK client init, cart ID helpers, customer token helpers |\n| `app/page.tsx` | Homepage with hero section and featured products grid |\n| `app/products/page.tsx` | Product listing with infinite scroll (50/page), filters, search |\n| `app/products/[slug]/page.tsx` | Product detail with variant switching, description, metafields |\n| `app/cart/page.tsx` | Cart with checkboxes for partial checkout, coupon input, reservation timer |\n| `app/checkout/page.tsx` | Multi-step: address \u2192 shipping rates \u2192 payment (Stripe/Grow/PayPal) |\n| `app/order-confirmation/page.tsx` | Polls waitForOrder(), shows order number, clears cart |\n| `app/login/page.tsx` | Email/password login + OAuth buttons, handles requiresVerification |\n| `app/register/page.tsx` | Registration form + OAuth, handles requiresVerification |\n| `app/verify-email/page.tsx` | 6-digit verification code input with resend button |\n| `app/auth/callback/page.tsx` | Extracts OAuth token from URL params, stores in localStorage |\n| `app/account/page.tsx` | Protected page: getMyProfile() + getMyOrders() |\n| `components/Header.tsx` | Site header with nav, cart count badge, search autocomplete |\n\n## Content Security Policy (CSP)\n\nPayment SDKs load iframes and scripts from external domains. Add these CSP headers in `next.config.js`:\n\n```js\n// next.config.js\nmodule.exports = {\n async headers() {\n return [{\n source: '/(.*)',\n headers: [{\n key: 'Content-Security-Policy',\n value: [\n \"default-src 'self'\",\n \"script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdn.meshulam.co.il https://meshulam.co.il https://*.meshulam.co.il https://grow.link https://*.grow.link https://*.grow.security https://js.stripe.com https://pay.google.com\",\n \"style-src 'self' 'unsafe-inline'\",\n \"img-src 'self' data: blob: https:\",\n \"font-src 'self' data:\",\n \"frame-src 'self' https://*.meshulam.co.il https://grow.link https://*.grow.link https://*.grow.security https://*.creditguard.co.il https://js.stripe.com https://hooks.stripe.com https://pay.google.com\",\n \"connect-src 'self' https://*.meshulam.co.il https://grow.link https://*.grow.link https://*.grow.security https://google.com https://pay.google.com https://*.stripe.com https://*.creditguard.co.il\",\n \"worker-src 'self' blob:\",\n ].join('; '),\n }],\n }];\n },\n};\n```\n\n**Required domains by provider:**\n- **Grow**: `*.meshulam.co.il`, `grow.link`, `*.grow.link`, `*.grow.security`, `*.creditguard.co.il`\n- **Stripe**: `js.stripe.com`, `hooks.stripe.com`, `*.stripe.com`\n- **Google Pay**: `pay.google.com`, `google.com`\n";
|
|
34
34
|
|
|
35
35
|
interface StoreInfo {
|
|
36
|
+
/**
|
|
37
|
+
* Display name — prefers the per-connection channel name (what the user
|
|
38
|
+
* sees in their Brainerce dashboard sales-channel card), falling back to
|
|
39
|
+
* the parent store name.
|
|
40
|
+
*/
|
|
36
41
|
name: string;
|
|
42
|
+
/** Parent store name (the account-level store). */
|
|
43
|
+
storeName: string;
|
|
37
44
|
currency: string;
|
|
38
45
|
language: string;
|
|
39
46
|
i18n?: {
|
|
@@ -46,7 +53,10 @@ declare function fetchStoreInfo(connectionId: string, baseUrl?: string): Promise
|
|
|
46
53
|
|
|
47
54
|
interface StoreCapabilities {
|
|
48
55
|
store: {
|
|
56
|
+
/** Parent store name (account-level). */
|
|
49
57
|
name: string;
|
|
58
|
+
/** Per-connection channel display name (what the user sees in the dashboard). */
|
|
59
|
+
channelName?: string;
|
|
50
60
|
currency: string;
|
|
51
61
|
language: string;
|
|
52
62
|
i18n?: {
|
|
@@ -79,6 +89,7 @@ interface StoreCapabilities {
|
|
|
79
89
|
hasDiscountRules: boolean;
|
|
80
90
|
hasDownloadableProducts: boolean;
|
|
81
91
|
hasCoupons: boolean;
|
|
92
|
+
hasCheckoutCustomFields: boolean;
|
|
82
93
|
};
|
|
83
94
|
}
|
|
84
95
|
declare function fetchStoreCapabilities(connectionId: string, baseUrl?: string): Promise<StoreCapabilities>;
|