@cogito.ai/cli 0.4.3 → 0.4.4
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/index.js +1 -1
- package/dist/templates/web-nextjs/apps/docs/.source/browser.ts +8 -18
- package/dist/templates/web-nextjs/apps/docs/.source/dynamic.ts +5 -11
- package/dist/templates/web-nextjs/apps/docs/.source/server.ts +17 -37
- package/dist/templates/web-nextjs/apps/web/.env.example +35 -0
- package/dist/templates/web-nextjs/apps/web/messages/en.json +70 -0
- package/dist/templates/web-nextjs/apps/web/messages/zh.json +71 -1
- package/dist/templates/web-nextjs/apps/web/next-env.d.ts +1 -1
- package/dist/templates/web-nextjs/apps/web/package.json +4 -0
- package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(auth)/forgot-password/page.tsx +4 -10
- package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(protected)/payment/[paymentId]/page.tsx +88 -0
- package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(protected)/payment/checkout/page.tsx +170 -0
- package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(protected)/pricing/page.tsx +120 -0
- package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(protected)/settings/layout.tsx +48 -1
- package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(protected)/settings/subscription/page.tsx +128 -0
- package/dist/templates/web-nextjs/apps/web/src/app/[locale]/layout.tsx +1 -1
- package/dist/templates/web-nextjs/apps/web/src/app/api/payments/alipay/create/route.ts +43 -0
- package/dist/templates/web-nextjs/apps/web/src/app/api/payments/alipay/notify/route.ts +105 -0
- package/dist/templates/web-nextjs/apps/web/src/app/api/payments/alipay/query/route.ts +54 -0
- package/dist/templates/web-nextjs/apps/web/src/app/api/payments/alipay/return/route.ts +20 -0
- package/dist/templates/web-nextjs/apps/web/src/app/api/payments/create/route.ts +52 -0
- package/dist/templates/web-nextjs/apps/web/src/app/api/payments/wechat/create/route.ts +58 -0
- package/dist/templates/web-nextjs/apps/web/src/app/api/payments/wechat/notify/route.ts +92 -0
- package/dist/templates/web-nextjs/apps/web/src/app/api/payments/wechat/query/route.ts +54 -0
- package/dist/templates/web-nextjs/apps/web/src/features/subscription/alipay/client.ts +36 -0
- package/dist/templates/web-nextjs/apps/web/src/features/subscription/alipay/server.ts +83 -0
- package/dist/templates/web-nextjs/apps/web/src/features/subscription/components/index.ts +4 -0
- package/dist/templates/web-nextjs/apps/web/src/features/subscription/components/pro-badge.tsx +9 -0
- package/dist/templates/web-nextjs/apps/web/src/features/subscription/components/pro-feature-comparison.tsx +70 -0
- package/dist/templates/web-nextjs/apps/web/src/features/subscription/components/quota-warning-banner.tsx +37 -0
- package/dist/templates/web-nextjs/apps/web/src/features/subscription/components/upgrade-button.tsx +42 -0
- package/dist/templates/web-nextjs/apps/web/src/features/subscription/hooks.ts +141 -0
- package/dist/templates/web-nextjs/apps/web/src/features/subscription/payment-helpers.ts +27 -0
- package/dist/templates/web-nextjs/apps/web/src/features/subscription/payment-service.ts +56 -0
- package/dist/templates/web-nextjs/apps/web/src/features/subscription/service.ts +55 -0
- package/dist/templates/web-nextjs/apps/web/src/features/subscription/types.ts +73 -0
- package/dist/templates/web-nextjs/apps/web/src/features/subscription/wechat/client.ts +33 -0
- package/dist/templates/web-nextjs/apps/web/src/features/subscription/wechat/server.ts +147 -0
- package/dist/templates/web-nextjs/apps/web/src/lib/supabase/admin.ts +23 -0
- package/dist/templates/web-nextjs/apps/web/src/lib/wechat-pay/client.ts +66 -0
- package/dist/templates/web-nextjs/apps/web/src/lib/wechat-pay/crypto.ts +99 -0
- package/dist/templates/web-nextjs/apps/web/src/lib/wechat-pay/types.ts +10 -0
- package/dist/templates/web-nextjs/pnpm-lock.yaml +319 -0
- package/dist/templates/web-nextjs/supabase/migrations/20250608_add_subscription_tables.sql +125 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -868,7 +868,7 @@ var package_default;
|
|
|
868
868
|
var init_package = __esm(() => {
|
|
869
869
|
package_default = {
|
|
870
870
|
name: "@cogito.ai/cli",
|
|
871
|
-
version: "0.4.
|
|
871
|
+
version: "0.4.4",
|
|
872
872
|
type: "module",
|
|
873
873
|
description: "AgentDock CLI – scaffold projects for humans and AI agents",
|
|
874
874
|
publishConfig: {
|
|
@@ -1,22 +1,12 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
import { browser } from 'fumadocs-mdx/runtime/browser'
|
|
3
|
-
import type * as Config from '../source.config'
|
|
2
|
+
import { browser } from 'fumadocs-mdx/runtime/browser';
|
|
3
|
+
import type * as Config from '../source.config';
|
|
4
4
|
|
|
5
|
-
const create = browser<
|
|
6
|
-
|
|
7
|
-
import('fumadocs-mdx/runtime/types').InternalTypeConfig & {
|
|
8
|
-
DocData: {}
|
|
5
|
+
const create = browser<typeof Config, import("fumadocs-mdx/runtime/types").InternalTypeConfig & {
|
|
6
|
+
DocData: {
|
|
9
7
|
}
|
|
10
|
-
>()
|
|
8
|
+
}>();
|
|
11
9
|
const browserCollections = {
|
|
12
|
-
docs: create.doc(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
'decisions/turbo-package-manager.mdx': () =>
|
|
16
|
-
import('../content/docs/decisions/turbo-package-manager.mdx?collection=docs'),
|
|
17
|
-
'features/auth.mdx': () => import('../content/docs/features/auth.mdx?collection=docs'),
|
|
18
|
-
'features/hello.mdx': () => import('../content/docs/features/hello.mdx?collection=docs'),
|
|
19
|
-
'roadmap/index.mdx': () => import('../content/docs/roadmap/index.mdx?collection=docs'),
|
|
20
|
-
}),
|
|
21
|
-
}
|
|
22
|
-
export default browserCollections
|
|
10
|
+
docs: create.doc("docs", {"index.mdx": () => import("../content/docs/index.mdx?collection=docs"), "changelog/index.mdx": () => import("../content/docs/changelog/index.mdx?collection=docs"), "features/auth.mdx": () => import("../content/docs/features/auth.mdx?collection=docs"), "features/hello.mdx": () => import("../content/docs/features/hello.mdx?collection=docs"), "decisions/turbo-package-manager.mdx": () => import("../content/docs/decisions/turbo-package-manager.mdx?collection=docs"), "roadmap/index.mdx": () => import("../content/docs/roadmap/index.mdx?collection=docs"), }),
|
|
11
|
+
};
|
|
12
|
+
export default browserCollections;
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
import { dynamic } from 'fumadocs-mdx/runtime/dynamic'
|
|
3
|
-
import * as Config from '../source.config'
|
|
2
|
+
import { dynamic } from 'fumadocs-mdx/runtime/dynamic';
|
|
3
|
+
import * as Config from '../source.config';
|
|
4
4
|
|
|
5
|
-
const create = await dynamic<
|
|
6
|
-
|
|
7
|
-
import('fumadocs-mdx/runtime/types').InternalTypeConfig & {
|
|
8
|
-
DocData: {}
|
|
5
|
+
const create = await dynamic<typeof Config, import("fumadocs-mdx/runtime/types").InternalTypeConfig & {
|
|
6
|
+
DocData: {
|
|
9
7
|
}
|
|
10
|
-
>(
|
|
11
|
-
Config,
|
|
12
|
-
{ configPath: 'source.config.ts', environment: 'next', outDir: '.source' },
|
|
13
|
-
{ doc: { passthroughs: ['extractedReferences'] } },
|
|
14
|
-
)
|
|
8
|
+
}>(Config, {"configPath":"source.config.ts","environment":"next","outDir":".source"}, {"doc":{"passthroughs":["extractedReferences"]}});
|
|
@@ -1,41 +1,21 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
import * as __fd_glob_10 from
|
|
3
|
-
import * as __fd_glob_9 from
|
|
4
|
-
import * as __fd_glob_8 from
|
|
5
|
-
import * as __fd_glob_7 from
|
|
6
|
-
import * as __fd_glob_6 from
|
|
7
|
-
import * as __fd_glob_5 from
|
|
8
|
-
import { default as __fd_glob_4 } from
|
|
9
|
-
import { default as __fd_glob_3 } from
|
|
10
|
-
import { default as __fd_glob_2 } from
|
|
11
|
-
import { default as __fd_glob_1 } from
|
|
12
|
-
import { default as __fd_glob_0 } from
|
|
13
|
-
import { server } from 'fumadocs-mdx/runtime/server'
|
|
14
|
-
import type * as Config from '../source.config'
|
|
2
|
+
import * as __fd_glob_10 from "../content/docs/roadmap/index.mdx?collection=docs"
|
|
3
|
+
import * as __fd_glob_9 from "../content/docs/decisions/turbo-package-manager.mdx?collection=docs"
|
|
4
|
+
import * as __fd_glob_8 from "../content/docs/features/hello.mdx?collection=docs"
|
|
5
|
+
import * as __fd_glob_7 from "../content/docs/features/auth.mdx?collection=docs"
|
|
6
|
+
import * as __fd_glob_6 from "../content/docs/changelog/index.mdx?collection=docs"
|
|
7
|
+
import * as __fd_glob_5 from "../content/docs/index.mdx?collection=docs"
|
|
8
|
+
import { default as __fd_glob_4 } from "../content/docs/roadmap/meta.json?collection=docs"
|
|
9
|
+
import { default as __fd_glob_3 } from "../content/docs/features/meta.json?collection=docs"
|
|
10
|
+
import { default as __fd_glob_2 } from "../content/docs/decisions/meta.json?collection=docs"
|
|
11
|
+
import { default as __fd_glob_1 } from "../content/docs/changelog/meta.json?collection=docs"
|
|
12
|
+
import { default as __fd_glob_0 } from "../content/docs/meta.json?collection=docs"
|
|
13
|
+
import { server } from 'fumadocs-mdx/runtime/server';
|
|
14
|
+
import type * as Config from '../source.config';
|
|
15
15
|
|
|
16
|
-
const create = server<
|
|
17
|
-
|
|
18
|
-
import('fumadocs-mdx/runtime/types').InternalTypeConfig & {
|
|
19
|
-
DocData: {}
|
|
16
|
+
const create = server<typeof Config, import("fumadocs-mdx/runtime/types").InternalTypeConfig & {
|
|
17
|
+
DocData: {
|
|
20
18
|
}
|
|
21
|
-
>({
|
|
19
|
+
}>({"doc":{"passthroughs":["extractedReferences"]}});
|
|
22
20
|
|
|
23
|
-
export const docs = await create.docs(
|
|
24
|
-
'docs',
|
|
25
|
-
'content/docs',
|
|
26
|
-
{
|
|
27
|
-
'meta.json': __fd_glob_0,
|
|
28
|
-
'changelog/meta.json': __fd_glob_1,
|
|
29
|
-
'features/meta.json': __fd_glob_2,
|
|
30
|
-
'decisions/meta.json': __fd_glob_3,
|
|
31
|
-
'roadmap/meta.json': __fd_glob_4,
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
'index.mdx': __fd_glob_5,
|
|
35
|
-
'changelog/index.mdx': __fd_glob_6,
|
|
36
|
-
'decisions/turbo-package-manager.mdx': __fd_glob_7,
|
|
37
|
-
'features/auth.mdx': __fd_glob_8,
|
|
38
|
-
'features/hello.mdx': __fd_glob_9,
|
|
39
|
-
'roadmap/index.mdx': __fd_glob_10,
|
|
40
|
-
},
|
|
41
|
-
)
|
|
21
|
+
export const docs = await create.docs("docs", "content/docs", {"meta.json": __fd_glob_0, "changelog/meta.json": __fd_glob_1, "decisions/meta.json": __fd_glob_2, "features/meta.json": __fd_glob_3, "roadmap/meta.json": __fd_glob_4, }, {"index.mdx": __fd_glob_5, "changelog/index.mdx": __fd_glob_6, "features/auth.mdx": __fd_glob_7, "features/hello.mdx": __fd_glob_8, "decisions/turbo-package-manager.mdx": __fd_glob_9, "roadmap/index.mdx": __fd_glob_10, });
|
|
@@ -24,3 +24,38 @@ NEXT_PUBLIC_APP_URL=http://localhost:3000
|
|
|
24
24
|
# Default locale used for root redirects and i18n fallback
|
|
25
25
|
# Allowed values: en, zh
|
|
26
26
|
APP_DEFAULT_LOCALE=zh
|
|
27
|
+
|
|
28
|
+
# ──────────────────────────────────────────────────────────────────────────────
|
|
29
|
+
# Alipay Payment (Optional)
|
|
30
|
+
# Get these from: Alipay Open Platform → App Center → your app
|
|
31
|
+
# Sandbox: https://open.alipay.com/develop/sandbox
|
|
32
|
+
# ──────────────────────────────────────────────────────────────────────────────
|
|
33
|
+
ALIPAY_APP_ID=<your-app-id>
|
|
34
|
+
ALIPAY_PRIVATE_KEY=-----BEGIN RSA PRIVATE KEY-----
|
|
35
|
+
<your-private-key>
|
|
36
|
+
-----END RSA PRIVATE KEY-----
|
|
37
|
+
ALIPAY_PUBLIC_KEY=-----BEGIN PUBLIC KEY-----
|
|
38
|
+
<your-public-key>
|
|
39
|
+
-----END PUBLIC KEY-----
|
|
40
|
+
# Sandbox gateway (uncomment for sandbox testing):
|
|
41
|
+
# ALIPAY_GATEWAY=https://openapi-sandbox.dl.alipaydev.com/gateway.do
|
|
42
|
+
ALIPAY_NOTIFY_URL=https://your-domain.com/api/payments/alipay/notify
|
|
43
|
+
|
|
44
|
+
# ──────────────────────────────────────────────────────────────────────────────
|
|
45
|
+
# WeChat Pay (Optional)
|
|
46
|
+
# Get these from: WeChat Pay Merchant Platform
|
|
47
|
+
# ──────────────────────────────────────────────────────────────────────────────
|
|
48
|
+
WECHAT_PAY_APP_ID=wx<your-app-id>
|
|
49
|
+
WECHAT_PAY_MCH_ID=<your-mch-id>
|
|
50
|
+
WECHAT_PAY_API_V3_KEY=<your-32-char-apiv3-key>
|
|
51
|
+
WECHAT_PAY_PRIVATE_KEY=-----BEGIN PRIVATE KEY-----
|
|
52
|
+
<your-private-key>
|
|
53
|
+
-----END PRIVATE KEY-----
|
|
54
|
+
WECHAT_PAY_SERIAL_NO=<your-cert-serial-no>
|
|
55
|
+
# Platform public key (download from GET /v3/certificates)
|
|
56
|
+
WECHAT_PAY_PLATFORM_PUBLIC_KEY=-----BEGIN PUBLIC KEY-----
|
|
57
|
+
<platform-public-key>
|
|
58
|
+
-----END PUBLIC KEY-----
|
|
59
|
+
# Domestic: https://api.mch.weixin.qq.com; Overseas: https://apihk.mch.weixin.qq.com
|
|
60
|
+
WECHAT_PAY_BASE_URL=https://api.mch.weixin.qq.com
|
|
61
|
+
WECHAT_PAY_NOTIFY_URL=https://your-domain.com/api/payments/wechat/notify
|
|
@@ -124,6 +124,8 @@
|
|
|
124
124
|
"resetPasswordSuccess": "Password updated. Please log in."
|
|
125
125
|
},
|
|
126
126
|
"settings": {
|
|
127
|
+
"profileTitle": "Profile",
|
|
128
|
+
"subscriptionTitle": "Subscription & Billing",
|
|
127
129
|
"profile": {
|
|
128
130
|
"title": "Profile Settings",
|
|
129
131
|
"subtitle": "Manage your account settings and preferences.",
|
|
@@ -160,5 +162,73 @@
|
|
|
160
162
|
"description": "Learn more about AgentDock.",
|
|
161
163
|
"placeholder": "This page is a placeholder. Replace it with your actual about information before shipping."
|
|
162
164
|
}
|
|
165
|
+
},
|
|
166
|
+
"pricing": {
|
|
167
|
+
"title": "Pricing",
|
|
168
|
+
"description": "Choose the plan that fits your needs",
|
|
169
|
+
"monthly": "Monthly",
|
|
170
|
+
"yearly": "Yearly",
|
|
171
|
+
"free": "Free",
|
|
172
|
+
"perMonth": "mo",
|
|
173
|
+
"perYear": "yr",
|
|
174
|
+
"currentPlan": "Current Plan",
|
|
175
|
+
"popular": "Popular",
|
|
176
|
+
"upgrade": "Upgrade",
|
|
177
|
+
"getStarted": "Get Started"
|
|
178
|
+
},
|
|
179
|
+
"payment": {
|
|
180
|
+
"checkoutTitle": "Checkout",
|
|
181
|
+
"orderSummary": "Order Summary",
|
|
182
|
+
"plan": "Plan",
|
|
183
|
+
"billingCycle": "Billing Cycle",
|
|
184
|
+
"total": "Total",
|
|
185
|
+
"paymentMethod": "Payment Method",
|
|
186
|
+
"alipay": "Alipay",
|
|
187
|
+
"wechatPay": "WeChat Pay",
|
|
188
|
+
"coupon": "Coupon",
|
|
189
|
+
"couponPlaceholder": "Enter coupon code",
|
|
190
|
+
"invalidCoupon": "Invalid coupon",
|
|
191
|
+
"paymentError": "Payment failed. Please try again.",
|
|
192
|
+
"confirmPayment": "Confirm Payment",
|
|
193
|
+
"processing": "Processing...",
|
|
194
|
+
"statusTitle": "Payment Status",
|
|
195
|
+
"paymentStatus": "Payment Status",
|
|
196
|
+
"paid": "Paid",
|
|
197
|
+
"pending": "Pending",
|
|
198
|
+
"failed": "Failed",
|
|
199
|
+
"paymentSuccess": "Payment successful!",
|
|
200
|
+
"paymentFailed": "Payment failed",
|
|
201
|
+
"paymentPending": "Waiting for payment...",
|
|
202
|
+
"paymentPendingDescription": "Please complete the payment. This page will update automatically.",
|
|
203
|
+
"goToDashboard": "Go to Dashboard",
|
|
204
|
+
"tryAgain": "Try Again"
|
|
205
|
+
},
|
|
206
|
+
"subscription": {
|
|
207
|
+
"title": "Subscription & Billing",
|
|
208
|
+
"description": "Manage your subscription and payment history",
|
|
209
|
+
"currentPlan": "Current Plan",
|
|
210
|
+
"status": "Status",
|
|
211
|
+
"active": "Active",
|
|
212
|
+
"trial": "Trial",
|
|
213
|
+
"expired": "Expired",
|
|
214
|
+
"cancelled": "Cancelled",
|
|
215
|
+
"pending": "Pending",
|
|
216
|
+
"billingCycle": "Billing Cycle",
|
|
217
|
+
"monthly": "Monthly",
|
|
218
|
+
"yearly": "Yearly",
|
|
219
|
+
"expiresOn": "Expires on",
|
|
220
|
+
"cancelRenewal": "Cancel Auto-Renewal",
|
|
221
|
+
"cancelledAtPeriodEnd": "Set to cancel at end of period",
|
|
222
|
+
"noActiveSubscription": "No active subscription",
|
|
223
|
+
"upgradeNow": "Upgrade Now",
|
|
224
|
+
"paymentHistory": "Payment History",
|
|
225
|
+
"noPayments": "No payment history",
|
|
226
|
+
"feature": "Feature",
|
|
227
|
+
"free": "Free",
|
|
228
|
+
"pro": "Pro",
|
|
229
|
+
"featureProjects": "Projects",
|
|
230
|
+
"featureApiCalls": "API Calls",
|
|
231
|
+
"featureSupport": "Priority Support",
|
|
232
|
+
"featureAnalytics": "Advanced Analytics"
|
|
163
233
|
}
|
|
164
234
|
}
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"verificationCodeLabel": "邮箱验证码",
|
|
109
109
|
"verificationCodePlaceholder": "输入 6 位验证码",
|
|
110
110
|
"resendIn": "{seconds} 秒后重新发送",
|
|
111
|
-
"resendCode": "
|
|
111
|
+
"resendCode": "重新发送",
|
|
112
112
|
"resetPasswordTitle": "设置新密码",
|
|
113
113
|
"resetPasswordSubtitle": "在下方输入您的新密码。",
|
|
114
114
|
"newPasswordLabel": "新密码",
|
|
@@ -124,6 +124,8 @@
|
|
|
124
124
|
"resetPasswordSuccess": "密码已更新,请登录。"
|
|
125
125
|
},
|
|
126
126
|
"settings": {
|
|
127
|
+
"profileTitle": "个人资料",
|
|
128
|
+
"subscriptionTitle": "订阅与账单",
|
|
127
129
|
"profile": {
|
|
128
130
|
"title": "个人资料设置",
|
|
129
131
|
"subtitle": "管理您的账号设置和偏好。",
|
|
@@ -160,5 +162,73 @@
|
|
|
160
162
|
"description": "了解更多关于 AgentDock 的信息。",
|
|
161
163
|
"placeholder": "此页面为占位符。在发布前请替换为实际的关于我们信息。"
|
|
162
164
|
}
|
|
165
|
+
},
|
|
166
|
+
"pricing": {
|
|
167
|
+
"title": "定价",
|
|
168
|
+
"description": "选择适合您的方案",
|
|
169
|
+
"monthly": "月付",
|
|
170
|
+
"yearly": "年付",
|
|
171
|
+
"free": "免费",
|
|
172
|
+
"perMonth": "月",
|
|
173
|
+
"perYear": "年",
|
|
174
|
+
"currentPlan": "当前方案",
|
|
175
|
+
"popular": "热门",
|
|
176
|
+
"upgrade": "升级",
|
|
177
|
+
"getStarted": "开始使用"
|
|
178
|
+
},
|
|
179
|
+
"payment": {
|
|
180
|
+
"checkoutTitle": "结算",
|
|
181
|
+
"orderSummary": "订单摘要",
|
|
182
|
+
"plan": "方案",
|
|
183
|
+
"billingCycle": "计费周期",
|
|
184
|
+
"total": "总计",
|
|
185
|
+
"paymentMethod": "支付方式",
|
|
186
|
+
"alipay": "支付宝",
|
|
187
|
+
"wechatPay": "微信支付",
|
|
188
|
+
"coupon": "优惠码",
|
|
189
|
+
"couponPlaceholder": "输入优惠码",
|
|
190
|
+
"invalidCoupon": "无效优惠码",
|
|
191
|
+
"paymentError": "支付失败,请重试",
|
|
192
|
+
"confirmPayment": "确认支付",
|
|
193
|
+
"processing": "处理中...",
|
|
194
|
+
"statusTitle": "支付状态",
|
|
195
|
+
"paymentStatus": "支付状态",
|
|
196
|
+
"paid": "已支付",
|
|
197
|
+
"pending": "待支付",
|
|
198
|
+
"failed": "失败",
|
|
199
|
+
"paymentSuccess": "支付成功!",
|
|
200
|
+
"paymentFailed": "支付失败",
|
|
201
|
+
"paymentPending": "等待支付...",
|
|
202
|
+
"paymentPendingDescription": "请完成支付,页面将自动更新",
|
|
203
|
+
"goToDashboard": "进入控制台",
|
|
204
|
+
"tryAgain": "重试"
|
|
205
|
+
},
|
|
206
|
+
"subscription": {
|
|
207
|
+
"title": "订阅与账单",
|
|
208
|
+
"description": "管理您的订阅和支付历史",
|
|
209
|
+
"currentPlan": "当前方案",
|
|
210
|
+
"status": "状态",
|
|
211
|
+
"active": "活跃",
|
|
212
|
+
"trial": "试用",
|
|
213
|
+
"expired": "已过期",
|
|
214
|
+
"cancelled": "已取消",
|
|
215
|
+
"pending": "待处理",
|
|
216
|
+
"billingCycle": "计费周期",
|
|
217
|
+
"monthly": "月付",
|
|
218
|
+
"yearly": "年付",
|
|
219
|
+
"expiresOn": "到期时间",
|
|
220
|
+
"cancelRenewal": "取消自动续费",
|
|
221
|
+
"cancelledAtPeriodEnd": "已设置为当前周期结束后取消",
|
|
222
|
+
"noActiveSubscription": "暂无活跃订阅",
|
|
223
|
+
"upgradeNow": "立即升级",
|
|
224
|
+
"paymentHistory": "支付历史",
|
|
225
|
+
"noPayments": "暂无支付记录",
|
|
226
|
+
"feature": "功能",
|
|
227
|
+
"free": "免费版",
|
|
228
|
+
"pro": "专业版",
|
|
229
|
+
"featureProjects": "项目数量",
|
|
230
|
+
"featureApiCalls": "API 调用次数",
|
|
231
|
+
"featureSupport": "优先支持",
|
|
232
|
+
"featureAnalytics": "高级分析"
|
|
163
233
|
}
|
|
164
234
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="next" />
|
|
2
2
|
/// <reference types="next/image-types/global" />
|
|
3
|
-
import "./.next/
|
|
3
|
+
import "./.next/types/routes.d.ts";
|
|
4
4
|
|
|
5
5
|
// NOTE: This file should not be edited
|
|
6
6
|
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
|
@@ -33,9 +33,12 @@
|
|
|
33
33
|
"@radix-ui/react-toggle": "^1.1.10",
|
|
34
34
|
"@radix-ui/react-toggle-group": "^1.1.11",
|
|
35
35
|
"@supabase/ssr": "^0.10.3",
|
|
36
|
+
"@supabase/supabase-js": "^2.107.0",
|
|
36
37
|
"@tabler/icons-react": "^3.44.0",
|
|
37
38
|
"@tailwindcss/postcss": "^4.3.0",
|
|
39
|
+
"@tanstack/react-query": "^5.101.0",
|
|
38
40
|
"@tanstack/react-table": "^8.21.3",
|
|
41
|
+
"alipay-sdk": "^4.14.0",
|
|
39
42
|
"class-variance-authority": "^0.7.1",
|
|
40
43
|
"clsx": "^2.1.1",
|
|
41
44
|
"cmdk": "^1.1.1",
|
|
@@ -44,6 +47,7 @@
|
|
|
44
47
|
"next": "16",
|
|
45
48
|
"next-intl": "^4.13.0",
|
|
46
49
|
"next-themes": "^0.4.6",
|
|
50
|
+
"qrcode.react": "^4.2.0",
|
|
47
51
|
"radix-ui": "^1.4.3",
|
|
48
52
|
"react": "19",
|
|
49
53
|
"react-dom": "19",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
-
import { useActionState, useEffect, useState
|
|
3
|
+
import { useActionState, useEffect, useState } from 'react'
|
|
4
4
|
import { useParams } from 'next/navigation'
|
|
5
5
|
import Link from 'next/link'
|
|
6
6
|
import { useTranslations } from 'next-intl'
|
|
@@ -78,18 +78,14 @@ export default function ForgotPasswordPage() {
|
|
|
78
78
|
formData.append('email', data.email)
|
|
79
79
|
setEmail(data.email)
|
|
80
80
|
setValue('email', data.email)
|
|
81
|
-
|
|
82
|
-
await sendAction(formData)
|
|
83
|
-
})
|
|
81
|
+
sendAction(formData)
|
|
84
82
|
}
|
|
85
83
|
|
|
86
84
|
async function onResendOTP() {
|
|
87
85
|
if (countdown > 0) return
|
|
88
86
|
const formData = new FormData()
|
|
89
87
|
formData.append('email', email)
|
|
90
|
-
|
|
91
|
-
await sendAction(formData)
|
|
92
|
-
})
|
|
88
|
+
sendAction(formData)
|
|
93
89
|
}
|
|
94
90
|
|
|
95
91
|
async function onSubmit(data: ResetPasswordWithOTPInput) {
|
|
@@ -99,9 +95,7 @@ export default function ForgotPasswordPage() {
|
|
|
99
95
|
formData.append('password', data.password)
|
|
100
96
|
formData.append('confirmPassword', data.confirmPassword)
|
|
101
97
|
formData.append('locale', locale)
|
|
102
|
-
|
|
103
|
-
await verifyAction(formData)
|
|
104
|
-
})
|
|
98
|
+
verifyAction(formData)
|
|
105
99
|
}
|
|
106
100
|
|
|
107
101
|
if (step === 'send') {
|
package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(protected)/payment/[paymentId]/page.tsx
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { useEffect, useState } from 'react'
|
|
4
|
+
import { useParams, useRouter } from 'next/navigation'
|
|
5
|
+
import { useTranslations } from 'next-intl'
|
|
6
|
+
import { Button } from '@/components/ui/button'
|
|
7
|
+
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
|
|
8
|
+
import { Badge } from '@/components/ui/badge'
|
|
9
|
+
import { usePaymentStatus } from '@/features/subscription/hooks'
|
|
10
|
+
import { createBrowserClient } from '@supabase/ssr'
|
|
11
|
+
|
|
12
|
+
export default function PaymentStatusPage() {
|
|
13
|
+
const t = useTranslations('payment')
|
|
14
|
+
const router = useRouter()
|
|
15
|
+
const params = useParams()
|
|
16
|
+
const paymentId = params.paymentId as string
|
|
17
|
+
|
|
18
|
+
const [paymentMethod, setPaymentMethod] = useState<string>('')
|
|
19
|
+
const [orderNo, setOrderNo] = useState<string>('')
|
|
20
|
+
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
async function fetchPayment() {
|
|
23
|
+
const supabase = createBrowserClient(
|
|
24
|
+
process.env.NEXT_PUBLIC_SUPABASE_URL!,
|
|
25
|
+
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
|
|
26
|
+
)
|
|
27
|
+
const { data } = await supabase.from('payments').select('*').eq('id', paymentId).single()
|
|
28
|
+
|
|
29
|
+
if (data) {
|
|
30
|
+
setPaymentMethod(data.payment_method)
|
|
31
|
+
setOrderNo(data.order_no)
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
fetchPayment()
|
|
35
|
+
}, [paymentId])
|
|
36
|
+
|
|
37
|
+
const { data: paymentStatus } = usePaymentStatus(orderNo, paymentMethod, {
|
|
38
|
+
enabled: !!orderNo && !!paymentMethod,
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
const status = paymentStatus?.status || 'pending'
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<div className="container mx-auto max-w-2xl px-4 py-10">
|
|
45
|
+
<h1 className="text-2xl font-bold mb-6">{t('statusTitle')}</h1>
|
|
46
|
+
|
|
47
|
+
<Card>
|
|
48
|
+
<CardHeader>
|
|
49
|
+
<CardTitle className="flex items-center gap-2">
|
|
50
|
+
{t('paymentStatus')}
|
|
51
|
+
<Badge
|
|
52
|
+
variant={
|
|
53
|
+
status === 'paid' ? 'default' : status === 'failed' ? 'destructive' : 'secondary'
|
|
54
|
+
}
|
|
55
|
+
>
|
|
56
|
+
{t(status)}
|
|
57
|
+
</Badge>
|
|
58
|
+
</CardTitle>
|
|
59
|
+
</CardHeader>
|
|
60
|
+
<CardContent className="space-y-6">
|
|
61
|
+
{status === 'paid' && (
|
|
62
|
+
<div className="text-center space-y-4">
|
|
63
|
+
<div className="text-6xl">✓</div>
|
|
64
|
+
<p className="text-lg font-medium">{t('paymentSuccess')}</p>
|
|
65
|
+
<Button onClick={() => router.push('/dashboard')}>{t('goToDashboard')}</Button>
|
|
66
|
+
</div>
|
|
67
|
+
)}
|
|
68
|
+
|
|
69
|
+
{status === 'failed' && (
|
|
70
|
+
<div className="text-center space-y-4">
|
|
71
|
+
<div className="text-6xl">✗</div>
|
|
72
|
+
<p className="text-lg font-medium">{t('paymentFailed')}</p>
|
|
73
|
+
<Button onClick={() => router.push('/pricing')}>{t('tryAgain')}</Button>
|
|
74
|
+
</div>
|
|
75
|
+
)}
|
|
76
|
+
|
|
77
|
+
{status === 'pending' && (
|
|
78
|
+
<div className="text-center space-y-4">
|
|
79
|
+
<div className="h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent mx-auto" />
|
|
80
|
+
<p className="text-lg font-medium">{t('paymentPending')}</p>
|
|
81
|
+
<p className="text-sm text-muted-foreground">{t('paymentPendingDescription')}</p>
|
|
82
|
+
</div>
|
|
83
|
+
)}
|
|
84
|
+
</CardContent>
|
|
85
|
+
</Card>
|
|
86
|
+
</div>
|
|
87
|
+
)
|
|
88
|
+
}
|