payment-kit 1.19.18 → 1.19.20
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/api/src/index.ts +3 -1
- package/api/src/integrations/ethereum/tx.ts +11 -0
- package/api/src/integrations/stripe/handlers/invoice.ts +26 -6
- package/api/src/integrations/stripe/handlers/setup-intent.ts +34 -2
- package/api/src/integrations/stripe/resource.ts +185 -1
- package/api/src/libs/invoice.ts +2 -1
- package/api/src/libs/session.ts +6 -1
- package/api/src/queues/auto-recharge.ts +343 -0
- package/api/src/queues/credit-consume.ts +15 -1
- package/api/src/queues/credit-grant.ts +15 -0
- package/api/src/queues/payment.ts +14 -1
- package/api/src/queues/space.ts +1 -0
- package/api/src/routes/auto-recharge-configs.ts +454 -0
- package/api/src/routes/connect/auto-recharge-auth.ts +182 -0
- package/api/src/routes/connect/recharge-account.ts +72 -10
- package/api/src/routes/connect/setup.ts +5 -3
- package/api/src/routes/connect/shared.ts +45 -4
- package/api/src/routes/customers.ts +10 -6
- package/api/src/routes/index.ts +2 -0
- package/api/src/routes/invoices.ts +10 -1
- package/api/src/routes/meters.ts +1 -1
- package/api/src/routes/payment-currencies.ts +129 -0
- package/api/src/store/migrate.ts +20 -0
- package/api/src/store/migrations/20250821-auto-recharge-config.ts +38 -0
- package/api/src/store/models/auto-recharge-config.ts +225 -0
- package/api/src/store/models/credit-grant.ts +1 -1
- package/api/src/store/models/customer.ts +1 -0
- package/api/src/store/models/index.ts +3 -0
- package/api/src/store/models/invoice.ts +2 -1
- package/api/src/store/models/payment-currency.ts +10 -2
- package/api/src/store/models/types.ts +11 -0
- package/blocklet.yml +1 -1
- package/package.json +18 -17
- package/src/components/customer/credit-overview.tsx +103 -18
- package/src/components/customer/overdraft-protection.tsx +5 -5
- package/src/components/info-metric.tsx +11 -2
- package/src/components/invoice/recharge.tsx +8 -2
- package/src/components/metadata/form.tsx +29 -27
- package/src/components/meter/form.tsx +1 -2
- package/src/components/price/form.tsx +39 -26
- package/src/components/product/form.tsx +1 -2
- package/src/locales/en.tsx +15 -0
- package/src/locales/zh.tsx +14 -0
- package/src/pages/admin/billing/meters/detail.tsx +18 -0
- package/src/pages/admin/customers/customers/credit-grant/detail.tsx +10 -0
- package/src/pages/admin/products/prices/actions.tsx +42 -2
- package/src/pages/admin/products/products/create.tsx +1 -2
- package/src/pages/admin/settings/vault-config/edit-form.tsx +8 -8
- package/src/pages/customer/credit-grant/detail.tsx +9 -1
- package/src/pages/customer/recharge/account.tsx +14 -7
- package/src/pages/customer/recharge/subscription.tsx +4 -4
- package/vite.config.ts +26 -1
package/vite.config.ts
CHANGED
|
@@ -6,6 +6,7 @@ import svgr from 'vite-plugin-svgr';
|
|
|
6
6
|
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
7
7
|
import { visualizer } from 'rollup-plugin-visualizer';
|
|
8
8
|
import path from 'path';
|
|
9
|
+
import { codeInspectorPlugin } from 'code-inspector-plugin';
|
|
9
10
|
|
|
10
11
|
// https://vitejs.dev/config/
|
|
11
12
|
export default defineConfig(({ mode }) => {
|
|
@@ -13,9 +14,29 @@ export default defineConfig(({ mode }) => {
|
|
|
13
14
|
const isDevelopment = mode === 'development';
|
|
14
15
|
const alias: Record<string, string> = {};
|
|
15
16
|
|
|
17
|
+
const arcblockUxBasePath = process.env.ARCBLOCK_UX_BASE_PATH;
|
|
18
|
+
const exclude: string[] = [];
|
|
19
|
+
if (arcblockUxBasePath) {
|
|
20
|
+
alias['@arcblock/ux'] = `${arcblockUxBasePath}/packages/ux`;
|
|
21
|
+
alias['@arcblock/ux/lib'] = `${arcblockUxBasePath}/packages/ux/src`;
|
|
22
|
+
alias['@blocklet/ui-react'] = `${arcblockUxBasePath}/packages/blocklet-ui-react`;
|
|
23
|
+
alias['@blocklet/ui-react/lib'] = `${arcblockUxBasePath}/packages/blocklet-ui-react/src`;
|
|
24
|
+
alias['@arcblock/did-connect-react'] = `${arcblockUxBasePath}/packages/did-connect`;
|
|
25
|
+
alias['@arcblock/did-connect-react/lib'] = `${arcblockUxBasePath}/packages/did-connect/src`;
|
|
26
|
+
exclude.push(
|
|
27
|
+
'@arcblock/ux',
|
|
28
|
+
'@arcblock/ux/lib',
|
|
29
|
+
'@blocklet/ui-react',
|
|
30
|
+
'@blocklet/ui-react/lib',
|
|
31
|
+
'@arcblock/did-connect-react',
|
|
32
|
+
'@arcblock/did-connect-react/lib'
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
16
36
|
if (isDevelopment) {
|
|
17
37
|
alias['@blocklet/payment-react'] = path.resolve(__dirname, '../../packages/react/src');
|
|
18
38
|
alias['@blocklet/payment-js'] = path.resolve(__dirname, '../../packages/client/src');
|
|
39
|
+
exclude.push('@blocklet/payment-react', '@blocklet/payment-js');
|
|
19
40
|
}
|
|
20
41
|
|
|
21
42
|
if (isProduction) {
|
|
@@ -34,6 +55,10 @@ export default defineConfig(({ mode }) => {
|
|
|
34
55
|
createBlockletPlugin(),
|
|
35
56
|
svgr(),
|
|
36
57
|
process.env.ANALYZE && visualizer({ open: true, gzipSize: true, brotliSize: true }),
|
|
58
|
+
// @note: 如果开发期间,文件隔离模式报错了,那么可以关闭server的文件隔离模式
|
|
59
|
+
codeInspectorPlugin({
|
|
60
|
+
bundler: 'vite',
|
|
61
|
+
}),
|
|
37
62
|
].filter(Boolean),
|
|
38
63
|
|
|
39
64
|
build: {
|
|
@@ -79,7 +104,7 @@ export default defineConfig(({ mode }) => {
|
|
|
79
104
|
optimizeDeps: {
|
|
80
105
|
include: ['react', 'react-dom', 'react/jsx-runtime'],
|
|
81
106
|
esbuildOptions: { mainFields: ['module', 'main'], resolveExtensions: ['.ts', '.tsx', '.js', '.jsx'] },
|
|
82
|
-
exclude
|
|
107
|
+
exclude,
|
|
83
108
|
},
|
|
84
109
|
resolve: {
|
|
85
110
|
alias,
|