payment-kit 1.27.2 → 1.29.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/__blocklet__.js +37 -0
- package/api/ocap-1.30-subpath-shims.d.ts +35 -0
- package/api/src/crons/index.ts +32 -0
- package/api/src/crons/metering-subscription-detection.ts +12 -14
- package/api/src/crons/overdue-detection.ts +51 -74
- package/api/src/crons/retry-pending-events.ts +58 -0
- package/api/src/integrations/app-store/apple-root-certs.ts +26 -0
- package/api/src/integrations/app-store/client.ts +369 -0
- package/api/src/integrations/app-store/handlers/index.ts +46 -0
- package/api/src/integrations/app-store/handlers/subscription.ts +635 -0
- package/api/src/integrations/app-store/node-apple-receipt-verify.d.ts +17 -0
- package/api/src/integrations/app-store/notification-routing.ts +18 -0
- package/api/src/integrations/app-store/signed-data-verifier.ts +150 -0
- package/api/src/integrations/arcblock/nft.ts +6 -2
- package/api/src/integrations/arcblock/stake.ts +3 -2
- package/api/src/integrations/arcblock/token.ts +4 -4
- package/api/src/integrations/blocklet/notification.ts +1 -1
- package/api/src/integrations/ethereum/tx.ts +29 -0
- package/api/src/integrations/google-play/client.ts +276 -0
- package/api/src/integrations/google-play/handlers/index.ts +69 -0
- package/api/src/integrations/google-play/handlers/subscription.ts +565 -0
- package/api/src/integrations/google-play/handlers/voided.ts +106 -0
- package/api/src/integrations/google-play/setup.ts +43 -0
- package/api/src/integrations/google-play/verify.ts +251 -0
- package/api/src/integrations/iap-reconcile.ts +415 -0
- package/api/src/integrations/stripe/handlers/invoice.ts +70 -53
- package/api/src/integrations/stripe/handlers/payment-intent.ts +8 -1
- package/api/src/integrations/stripe/resource.ts +8 -0
- package/api/src/libs/audit.ts +70 -24
- package/api/src/libs/auth.ts +49 -2
- package/api/src/libs/chain-error.ts +31 -0
- package/api/src/libs/entitlement.ts +399 -0
- package/api/src/libs/env.ts +2 -0
- package/api/src/libs/error.ts +15 -0
- package/api/src/libs/event.ts +42 -1
- package/api/src/libs/invoice.ts +69 -34
- package/api/src/libs/notification/template/customer-auto-recharge-daily-limit-exceeded.ts +1 -3
- package/api/src/libs/notification/template/customer-auto-recharge-failed.ts +1 -3
- package/api/src/libs/notification/template/customer-credit-grant-granted.ts +1 -3
- package/api/src/libs/notification/template/customer-credit-insufficient.ts +1 -3
- package/api/src/libs/notification/template/customer-credit-low-balance.ts +1 -3
- package/api/src/libs/notification/template/customer-revenue-succeeded.ts +1 -3
- package/api/src/libs/notification/template/customer-reward-succeeded.ts +1 -3
- package/api/src/libs/notification/template/one-time-payment-refund-succeeded.ts +1 -3
- package/api/src/libs/notification/template/one-time-payment-succeeded.ts +1 -3
- package/api/src/libs/notification/template/subscription-renew-failed.ts +1 -3
- package/api/src/libs/notification/template/subscription-slippage-exceeded.ts +1 -3
- package/api/src/libs/notification/template/subscription-slippage-warning.ts +1 -3
- package/api/src/libs/notification/template/subscription-succeeded.ts +1 -1
- package/api/src/libs/pagination.ts +14 -9
- package/api/src/libs/payment.ts +25 -10
- package/api/src/libs/security.ts +51 -0
- package/api/src/libs/session.ts +1 -1
- package/api/src/libs/subscription.ts +13 -1
- package/api/src/libs/timing.ts +35 -0
- package/api/src/libs/util.ts +29 -15
- package/api/src/libs/wallet-migration.ts +72 -53
- package/api/src/queues/auto-recharge.ts +1 -1
- package/api/src/queues/credit-consume.ts +94 -12
- package/api/src/queues/credit-grant.ts +4 -0
- package/api/src/queues/event.ts +39 -21
- package/api/src/queues/invoice.ts +1 -0
- package/api/src/queues/payment.ts +83 -15
- package/api/src/queues/refund.ts +84 -71
- package/api/src/queues/subscription.ts +1 -0
- package/api/src/queues/webhook.ts +12 -2
- package/api/src/routes/checkout-sessions.ts +82 -43
- package/api/src/routes/connect/change-payment.ts +2 -0
- package/api/src/routes/connect/change-plan.ts +2 -0
- package/api/src/routes/connect/pay.ts +12 -3
- package/api/src/routes/connect/setup.ts +3 -1
- package/api/src/routes/connect/shared.ts +52 -39
- package/api/src/routes/connect/subscribe.ts +4 -1
- package/api/src/routes/credit-grants.ts +25 -17
- package/api/src/routes/donations.ts +2 -2
- package/api/src/routes/entitlements.ts +105 -0
- package/api/src/routes/events.ts +2 -2
- package/api/src/routes/index.ts +12 -2
- package/api/src/routes/integrations/app-store.ts +267 -0
- package/api/src/routes/integrations/google-play.ts +324 -0
- package/api/src/routes/meter-events.ts +16 -6
- package/api/src/routes/payment-links.ts +1 -1
- package/api/src/routes/payment-methods.ts +131 -1
- package/api/src/routes/settings.ts +1 -1
- package/api/src/routes/tax-rates.ts +1 -1
- package/api/src/store/migrations/20260526-iap-foundation.ts +105 -0
- package/api/src/store/models/customer.ts +37 -1
- package/api/src/store/models/entitlement-grant.ts +118 -0
- package/api/src/store/models/entitlement-product.ts +48 -0
- package/api/src/store/models/entitlement.ts +86 -0
- package/api/src/store/models/index.ts +9 -0
- package/api/src/store/models/invoice.ts +20 -0
- package/api/src/store/models/payment-method.ts +66 -1
- package/api/src/store/models/price.ts +23 -14
- package/api/src/store/models/refund.ts +10 -0
- package/api/src/store/models/subscription.ts +14 -0
- package/api/src/store/models/types.ts +32 -0
- package/api/tests/integrations/app-store/client.spec.ts +335 -0
- package/api/tests/integrations/app-store/handlers.spec.ts +480 -0
- package/api/tests/integrations/app-store/notifications.spec.ts +381 -0
- package/api/tests/integrations/app-store/signed-data-verifier.spec.ts +72 -0
- package/api/tests/integrations/app-store/webhook-routing.spec.ts +27 -0
- package/api/tests/integrations/google-play/handlers.spec.ts +341 -0
- package/api/tests/integrations/google-play/verify.spec.ts +215 -0
- package/api/tests/integrations/iap-reconcile.spec.ts +237 -0
- package/api/tests/libs/entitlement.spec.ts +347 -0
- package/api/tests/libs/wallet-migration.spec.ts +4 -4
- package/api/tests/queues/credit-consume-batch.spec.ts +5 -2
- package/api/tests/queues/credit-consume.spec.ts +8 -4
- package/api/tests/routes/credit-grants.spec.ts +1 -0
- package/blocklet.yml +1 -1
- package/cloudflare/MIGRATION-CHALLENGES.md +676 -0
- package/cloudflare/MIGRATION-RUNBOOK.md +777 -0
- package/cloudflare/README.md +499 -0
- package/cloudflare/STAGING-MIGRATION-GUIDE.md +602 -0
- package/cloudflare/build.ts +151 -0
- package/cloudflare/did-connect-auth.ts +527 -0
- package/cloudflare/docs/2026-04-22-sdk-1.30.9-upgrade-retro.md +324 -0
- package/cloudflare/docs/2026-04-24-queue-ops-followup.md +218 -0
- package/cloudflare/docs/cf-queues-ops-alert-analysis.md +663 -0
- package/cloudflare/docs/cf-workers-local-dev-and-fixes.md +284 -0
- package/cloudflare/docs/cleanup-tasks-2026-05.md +62 -0
- package/cloudflare/docs/payment-kit-platform-analysis-2026-04-20.md +354 -0
- package/cloudflare/frontend-shims/buffer-polyfill.ts +9 -0
- package/cloudflare/frontend-shims/js-sdk.ts +43 -0
- package/cloudflare/frontend-shims/mime-types.ts +46 -0
- package/cloudflare/frontend-shims/session.ts +24 -0
- package/cloudflare/frontend-shims/vite-plugin-noop.ts +6 -0
- package/cloudflare/index.html +40 -0
- package/cloudflare/migrate-to-d1.js +252 -0
- package/cloudflare/migrations/0001_initial_schema.sql +82 -0
- package/cloudflare/migrations/0002_indexes.sql +75 -0
- package/cloudflare/migrations/0003_locks_and_constraints.sql +18 -0
- package/cloudflare/migrations/0004_iap_foundation.sql +72 -0
- package/cloudflare/migrations/0005_iap_tenant_backfill.sql +112 -0
- package/cloudflare/run-build.js +391 -0
- package/cloudflare/scripts/test-decrypt.js +102 -0
- package/cloudflare/shims/arcblock-ws.ts +20 -0
- package/cloudflare/shims/axios-http-adapter.ts +4 -0
- package/cloudflare/shims/axios-lite.ts +117 -0
- package/cloudflare/shims/blocklet-sdk/auth-service.ts +33 -0
- package/cloudflare/shims/blocklet-sdk/cdn.ts +3 -0
- package/cloudflare/shims/blocklet-sdk/component-api.ts +35 -0
- package/cloudflare/shims/blocklet-sdk/component.ts +18 -0
- package/cloudflare/shims/blocklet-sdk/config.ts +8 -0
- package/cloudflare/shims/blocklet-sdk/did.ts +14 -0
- package/cloudflare/shims/blocklet-sdk/env.ts +12 -0
- package/cloudflare/shims/blocklet-sdk/eventbus.ts +3 -0
- package/cloudflare/shims/blocklet-sdk/fallback.ts +3 -0
- package/cloudflare/shims/blocklet-sdk/index.ts +11 -0
- package/cloudflare/shims/blocklet-sdk/logger.ts +11 -0
- package/cloudflare/shims/blocklet-sdk/middlewares.ts +15 -0
- package/cloudflare/shims/blocklet-sdk/notification.ts +11 -0
- package/cloudflare/shims/blocklet-sdk/security.ts +53 -0
- package/cloudflare/shims/blocklet-sdk/session.ts +8 -0
- package/cloudflare/shims/blocklet-sdk/verify-session.ts +44 -0
- package/cloudflare/shims/blocklet-sdk/verify-sign.ts +38 -0
- package/cloudflare/shims/blocklet-sdk/wallet-authenticator.ts +3 -0
- package/cloudflare/shims/blocklet-sdk/wallet-handler.ts +6 -0
- package/cloudflare/shims/blocklet-sdk/wallet.ts +103 -0
- package/cloudflare/shims/cookie-parser.ts +3 -0
- package/cloudflare/shims/cors.ts +21 -0
- package/cloudflare/shims/cron.ts +189 -0
- package/cloudflare/shims/crypto-js-warn.ts +7 -0
- package/cloudflare/shims/did-space-js.ts +17 -0
- package/cloudflare/shims/did-space.ts +11 -0
- package/cloudflare/shims/error.ts +18 -0
- package/cloudflare/shims/express-compat/index.ts +80 -0
- package/cloudflare/shims/express-compat/types.ts +41 -0
- package/cloudflare/shims/fastq.ts +105 -0
- package/cloudflare/shims/lock.ts +115 -0
- package/cloudflare/shims/mime-types.ts +56 -0
- package/cloudflare/shims/nedb-storage.ts +9 -0
- package/cloudflare/shims/node-child-process.ts +9 -0
- package/cloudflare/shims/node-fs.ts +20 -0
- package/cloudflare/shims/node-http.ts +13 -0
- package/cloudflare/shims/node-https.ts +4 -0
- package/cloudflare/shims/node-misc.ts +15 -0
- package/cloudflare/shims/node-net.ts +8 -0
- package/cloudflare/shims/node-os.ts +14 -0
- package/cloudflare/shims/node-tty.ts +8 -0
- package/cloudflare/shims/node-zlib.ts +17 -0
- package/cloudflare/shims/noop.ts +26 -0
- package/cloudflare/shims/payment-vendor.ts +14 -0
- package/cloudflare/shims/querystring.ts +12 -0
- package/cloudflare/shims/queue.ts +611 -0
- package/cloudflare/shims/rolldown-runtime.ts +43 -0
- package/cloudflare/shims/sequelize-d1/datatypes.ts +24 -0
- package/cloudflare/shims/sequelize-d1/helpers.ts +46 -0
- package/cloudflare/shims/sequelize-d1/index.ts +34 -0
- package/cloudflare/shims/sequelize-d1/model.ts +1176 -0
- package/cloudflare/shims/sequelize-d1/operators.ts +306 -0
- package/cloudflare/shims/sequelize-d1/retry.ts +85 -0
- package/cloudflare/shims/sequelize-d1/sequelize-class.ts +119 -0
- package/cloudflare/shims/sequelize-d1/timing.ts +81 -0
- package/cloudflare/shims/sequelize-d1/types.ts +35 -0
- package/cloudflare/shims/stripe-cf.ts +29 -0
- package/cloudflare/shims/ws-lite.ts +103 -0
- package/cloudflare/shims/xss.ts +3 -0
- package/cloudflare/tests/shims/cron.spec.ts +210 -0
- package/cloudflare/tests/shims/queue-delayed-persist.spec.ts +87 -0
- package/cloudflare/tests/shims/queue-scheduled.spec.ts +186 -0
- package/cloudflare/vite.config.ts +162 -0
- package/cloudflare/worker.ts +1608 -0
- package/cloudflare/wrangler.json +63 -0
- package/cloudflare/wrangler.jsonc +75 -0
- package/cloudflare/wrangler.staging.json +67 -0
- package/cloudflare/wrangler.toml +28 -0
- package/jest.config.js +4 -12
- package/package.json +30 -22
- package/scripts/seed-google-play.ts +79 -0
- package/src/app.tsx +62 -4
- package/src/components/customer/link.tsx +9 -13
- package/src/components/customer/notification-preference.tsx +3 -2
- package/src/components/filter-toolbar.tsx +4 -0
- package/src/components/invoice/list.tsx +9 -1
- package/src/components/invoice-pdf/utils.ts +2 -1
- package/src/components/layout/admin.tsx +39 -5
- package/src/components/layout/user-cf.tsx +77 -0
- package/src/components/payment-intent/actions.tsx +23 -3
- package/src/components/payment-method/app-store.tsx +103 -0
- package/src/components/payment-method/form.tsx +7 -1
- package/src/components/payment-method/google-play.tsx +85 -0
- package/src/components/safe-did-address.tsx +75 -0
- package/src/components/subscription/list.tsx +20 -0
- package/src/libs/patch-user-card.ts +25 -0
- package/src/libs/util.ts +5 -7
- package/src/locales/en.tsx +63 -0
- package/src/locales/zh.tsx +63 -0
- package/src/pages/admin/billing/meter-events/index.tsx +4 -0
- package/src/pages/admin/billing/subscriptions/detail.tsx +80 -0
- package/src/pages/admin/customers/customers/detail.tsx +8 -2
- package/src/pages/admin/customers/customers/index.tsx +2 -2
- package/src/pages/admin/overview.tsx +3 -1
- package/src/pages/admin/settings/payment-methods/create.tsx +12 -0
- package/src/pages/admin/settings/payment-methods/index.tsx +1 -1
- package/src/pages/customer/subscription/detail.tsx +4 -4
- package/tsconfig.api.json +1 -6
- package/tsconfig.json +3 -4
- package/tsconfig.types.json +2 -1
- package/vite.config.ts +6 -1
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import react from '@vitejs/plugin-react';
|
|
2
|
+
import { defineConfig } from 'vite';
|
|
3
|
+
import svgr from 'vite-plugin-svgr';
|
|
4
|
+
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
5
|
+
import path from 'path';
|
|
6
|
+
|
|
7
|
+
const coreDir = path.resolve(__dirname, '..');
|
|
8
|
+
|
|
9
|
+
// Absolute path to the original session file we want to replace
|
|
10
|
+
const originalSessionPath = path.resolve(coreDir, 'src/contexts/session');
|
|
11
|
+
// Absolute path to our CF shim
|
|
12
|
+
const cfSessionShimPath = path.resolve(__dirname, 'frontend-shims/session.ts');
|
|
13
|
+
|
|
14
|
+
export default defineConfig({
|
|
15
|
+
root: coreDir, // blocklets/core/ — where index.html and src/ live
|
|
16
|
+
plugins: [
|
|
17
|
+
// Redirect contexts/session imports to CF shim (must be first plugin)
|
|
18
|
+
{
|
|
19
|
+
name: 'cf-session-redirect',
|
|
20
|
+
enforce: 'pre' as const,
|
|
21
|
+
resolveId(source: string, importer: string | undefined) {
|
|
22
|
+
if (!importer) return null;
|
|
23
|
+
// Match relative imports that resolve to src/contexts/session
|
|
24
|
+
if (source.endsWith('/contexts/session') || source.endsWith('/contexts/session.ts')) {
|
|
25
|
+
const resolved = path.resolve(path.dirname(importer), source).replace(/\.ts$/, '');
|
|
26
|
+
if (resolved === originalSessionPath) {
|
|
27
|
+
return cfSessionShimPath;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return null;
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
// Inject window.blocklet + global polyfills into HTML
|
|
34
|
+
{
|
|
35
|
+
name: 'cf-inject-blocklet',
|
|
36
|
+
transformIndexHtml(html: string) {
|
|
37
|
+
const injection = `<script>
|
|
38
|
+
window.global = globalThis;
|
|
39
|
+
// Minimal bootstrap — full config loaded from __blocklet__.js
|
|
40
|
+
if (!window.blocklet) {
|
|
41
|
+
window.blocklet = {
|
|
42
|
+
prefix: '/',
|
|
43
|
+
groupPrefix: '/',
|
|
44
|
+
appUrl: window.location.origin,
|
|
45
|
+
componentMountPoints: [{did:'z8ia1mAXo8ZE7ytGF36L5uBf9kD2kenhqFGp9',name:'Media Kit',mountPoint:'/media-kit',appId:'z8ia1mAXo8ZE7ytGF36L5uBf9kD2kenhqFGp9',status:'running',capabilities:{component:true}}],
|
|
46
|
+
navigation: [
|
|
47
|
+
{id:'payments',title:{en:'Payments',zh:'支付管理'},icon:'ion:card-outline',link:'/admin',section:['dashboard','sessionManager'],role:['admin','owner']},
|
|
48
|
+
{id:'integrations',title:{en:'Integrations',zh:'快速集成'},icon:'ion:flash-outline',link:'/integrations',section:['dashboard','sessionManager'],role:['admin','owner']},
|
|
49
|
+
{id:'billing',title:{en:'Billing',zh:'我的账单'},icon:'ion:receipt-outline',link:'/customer',private:true,section:['userCenter','sessionManager'],role:['owner','admin','member','guest']},
|
|
50
|
+
],
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
// Load full config from /__blocklet__.js?type=json (served by worker, includes auth/branding/theme from AUTH_SERVICE).
|
|
54
|
+
// Using type=json lets us JSON.parse the response directly instead of slicing out a { } substring from a JS assignment.
|
|
55
|
+
(function() {
|
|
56
|
+
try {
|
|
57
|
+
var xhr = new XMLHttpRequest();
|
|
58
|
+
var pfx = (window.blocklet && window.blocklet.prefix) || '/';
|
|
59
|
+
xhr.open('GET', pfx + '__blocklet__.js?type=json&_t=' + Date.now(), false);
|
|
60
|
+
xhr.send();
|
|
61
|
+
if (xhr.status === 200) {
|
|
62
|
+
var remote = JSON.parse(xhr.responseText);
|
|
63
|
+
// navigation / componentMountPoints are owned by this blocklet — AUTH_SERVICE
|
|
64
|
+
// doesn't know about them, so we never want remote values to clobber the
|
|
65
|
+
// ones the bootstrap above set.
|
|
66
|
+
var localOnly = ['navigation', 'componentMountPoints'];
|
|
67
|
+
Object.keys(remote).forEach(function(k) {
|
|
68
|
+
if (localOnly.indexOf(k) === -1) {
|
|
69
|
+
window.blocklet[k] = remote[k];
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
if (!window.blocklet.env) window.blocklet.env = {};
|
|
73
|
+
window.blocklet.env.appName = window.blocklet.appName || '';
|
|
74
|
+
window.blocklet.env.appDescription = window.blocklet.appDescription || '';
|
|
75
|
+
window.blocklet.env.appLogo = window.blocklet.appLogo || '';
|
|
76
|
+
window.blocklet.env.appUrl = window.blocklet.appUrl || '';
|
|
77
|
+
}
|
|
78
|
+
} catch(e) { /* ignore */ }
|
|
79
|
+
})();
|
|
80
|
+
</script>`;
|
|
81
|
+
return html.replace('<head>', '<head>' + injection);
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
// Inject Buffer polyfill at the top of the entry file
|
|
85
|
+
{
|
|
86
|
+
name: 'cf-buffer-polyfill',
|
|
87
|
+
enforce: 'pre' as const,
|
|
88
|
+
transform(code: string, id: string) {
|
|
89
|
+
if (id.endsWith('/src/index.tsx')) {
|
|
90
|
+
return `import '${path.resolve(__dirname, 'frontend-shims/buffer-polyfill.ts').replace(/\\/g, '/')}';\n` + code;
|
|
91
|
+
}
|
|
92
|
+
return undefined;
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
tsconfigPaths({ root: coreDir }),
|
|
96
|
+
react(),
|
|
97
|
+
svgr(),
|
|
98
|
+
],
|
|
99
|
+
resolve: {
|
|
100
|
+
alias: {
|
|
101
|
+
// Point to source code (workspace packages)
|
|
102
|
+
'@blocklet/payment-react': path.resolve(coreDir, '../../packages/react/src'),
|
|
103
|
+
'@blocklet/payment-react-headless': path.resolve(coreDir, '../../packages/payment-react-headless/src'),
|
|
104
|
+
'@blocklet/payment-js': path.resolve(coreDir, '../../packages/client/src'),
|
|
105
|
+
|
|
106
|
+
// Replace @blocklet/js-sdk with a simple axios wrapper
|
|
107
|
+
'@blocklet/js-sdk': path.resolve(__dirname, 'frontend-shims/js-sdk.ts'),
|
|
108
|
+
|
|
109
|
+
// Fix mime-types CJS interop for @blocklet/uploader
|
|
110
|
+
'mime-types': path.resolve(__dirname, 'frontend-shims/mime-types.ts'),
|
|
111
|
+
|
|
112
|
+
// lodash aliases
|
|
113
|
+
'lodash.assign': 'lodash/assign',
|
|
114
|
+
'lodash.clonedeep': 'lodash/cloneDeep',
|
|
115
|
+
'lodash.isequal': 'lodash/isEqual',
|
|
116
|
+
'lodash.merge': 'lodash/merge',
|
|
117
|
+
'lodash.find': 'lodash/find',
|
|
118
|
+
},
|
|
119
|
+
dedupe: [
|
|
120
|
+
'@arcblock/ux',
|
|
121
|
+
'@arcblock/did-connect-react',
|
|
122
|
+
'@blocklet/ui-react',
|
|
123
|
+
'@mui/material',
|
|
124
|
+
'@mui/icons-material',
|
|
125
|
+
'react',
|
|
126
|
+
'react-dom',
|
|
127
|
+
'lodash',
|
|
128
|
+
],
|
|
129
|
+
},
|
|
130
|
+
build: {
|
|
131
|
+
outDir: path.resolve(__dirname, 'public'),
|
|
132
|
+
emptyOutDir: true,
|
|
133
|
+
cssCodeSplit: false,
|
|
134
|
+
modulePreload: false,
|
|
135
|
+
commonjsOptions: {
|
|
136
|
+
include: [/node_modules/],
|
|
137
|
+
transformMixedEsModules: true,
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
define: {
|
|
141
|
+
'global': 'globalThis',
|
|
142
|
+
},
|
|
143
|
+
optimizeDeps: {
|
|
144
|
+
include: ['react', 'react-dom', 'react/jsx-runtime', 'buffer'],
|
|
145
|
+
esbuildOptions: {
|
|
146
|
+
mainFields: ['module', 'main'],
|
|
147
|
+
resolveExtensions: ['.ts', '.tsx', '.js', '.jsx'],
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
server: {
|
|
151
|
+
proxy: {
|
|
152
|
+
'/api': {
|
|
153
|
+
target: 'http://localhost:8800',
|
|
154
|
+
changeOrigin: true,
|
|
155
|
+
},
|
|
156
|
+
'/.well-known': {
|
|
157
|
+
target: 'http://localhost:8800',
|
|
158
|
+
changeOrigin: true,
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
});
|