payment-kit 1.29.5 → 1.29.6
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.yml +1 -1
- package/cloudflare/cf-adapter.ts +14 -1
- package/package.json +7 -7
package/blocklet.yml
CHANGED
package/cloudflare/cf-adapter.ts
CHANGED
|
@@ -39,6 +39,7 @@ import crons from '../api/src/crons/index';
|
|
|
39
39
|
import { createEmbeddedPaymentService } from '../api/src/service';
|
|
40
40
|
import type { EmbeddedPaymentService } from '../api/src/service';
|
|
41
41
|
import { context as requestContext } from '../api/src/libs/context';
|
|
42
|
+
import { warmTenantIdentity } from '../api/src/libs/did-connect/tenant-identity';
|
|
42
43
|
import {
|
|
43
44
|
createD1DbDriver,
|
|
44
45
|
createD1LocksDriver,
|
|
@@ -231,7 +232,19 @@ export function buildFetch(deps: FetchDeps) {
|
|
|
231
232
|
// the core's connect/context middleware then resolves via the identity driver,
|
|
232
233
|
// which returns null → TENANT_HOST_UNRESOLVED 4xx (multi-mode fail-closed). The
|
|
233
234
|
// bare health route still answers without a tenant.
|
|
234
|
-
|
|
235
|
+
//
|
|
236
|
+
// Warm the tenant identity (app:ek + business wallets) INSIDE the withTenant
|
|
237
|
+
// scope before any route handler runs. The CF resource pipeline is the LITE
|
|
238
|
+
// app-shell (no contextMiddleware), so unlike the node host nothing else warms
|
|
239
|
+
// it — and wallet field access (e.g. `wallet.publicKey` in GET /api/vendors) is
|
|
240
|
+
// a SYNCHRONOUS getCachedTenantIdentity() that fails-closed on a cold cache.
|
|
241
|
+
// Best-effort (warmTenantIdentity swallows errors); cached 5 min per tenant so
|
|
242
|
+
// only the first request per window pays the RPC. Queue jobs / bootstrapTenant
|
|
243
|
+
// already warm on their own paths.
|
|
244
|
+
const run = async () => {
|
|
245
|
+
if (instanceDid) await warmTenantIdentity(instanceDid);
|
|
246
|
+
return deps.svc.http.fetch(forwarded, { basePath: deps.basePath });
|
|
247
|
+
};
|
|
235
248
|
const res = instanceDid ? await requestContext.withTenant(instanceDid, run) : await run();
|
|
236
249
|
|
|
237
250
|
await deps.flush(); // drain workerd deferred queue work before responding
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "payment-kit",
|
|
3
|
-
"version": "1.29.
|
|
3
|
+
"version": "1.29.6",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "blocklet dev --open",
|
|
6
6
|
"prelint": "npm run types",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@abtnode/cron": "^1.17.13-beta-20260613-094425-b81920c8",
|
|
50
50
|
"@apple/app-store-server-library": "^3.1.0",
|
|
51
51
|
"@arcblock/did": "^1.30.24",
|
|
52
|
-
"@arcblock/did-connect-js": "^4.0.
|
|
52
|
+
"@arcblock/did-connect-js": "^4.0.7",
|
|
53
53
|
"@arcblock/did-connect-react": "^3.5.4",
|
|
54
54
|
"@arcblock/did-connect-storage-nedb": "^1.8.0",
|
|
55
55
|
"@arcblock/did-util": "^1.30.24",
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
"@blocklet/error": "^0.3.5",
|
|
62
62
|
"@blocklet/js-sdk": "^1.17.13-beta-20260613-094425-b81920c8",
|
|
63
63
|
"@blocklet/logger": "^1.17.13-beta-20260613-094425-b81920c8",
|
|
64
|
-
"@blocklet/payment-broker-client": "1.29.
|
|
65
|
-
"@blocklet/payment-react": "1.29.
|
|
66
|
-
"@blocklet/payment-vendor": "1.29.
|
|
64
|
+
"@blocklet/payment-broker-client": "1.29.6",
|
|
65
|
+
"@blocklet/payment-react": "1.29.6",
|
|
66
|
+
"@blocklet/payment-vendor": "1.29.6",
|
|
67
67
|
"@blocklet/sdk": "^1.17.13-beta-20260613-094425-b81920c8",
|
|
68
68
|
"@blocklet/ui-react": "^3.5.4",
|
|
69
69
|
"@blocklet/uploader": "^0.3.20",
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
"devDependencies": {
|
|
136
136
|
"@abtnode/types": "^1.17.13-beta-20260613-094425-b81920c8",
|
|
137
137
|
"@arcblock/eslint-config-ts": "^0.3.3",
|
|
138
|
-
"@blocklet/payment-types": "1.29.
|
|
138
|
+
"@blocklet/payment-types": "1.29.6",
|
|
139
139
|
"@types/connect": "^3.4.38",
|
|
140
140
|
"@types/debug": "^4.1.12",
|
|
141
141
|
"@types/dotenv-flow": "^3.3.3",
|
|
@@ -183,5 +183,5 @@
|
|
|
183
183
|
"parser": "typescript"
|
|
184
184
|
}
|
|
185
185
|
},
|
|
186
|
-
"gitHead": "
|
|
186
|
+
"gitHead": "ee97756d3e9ba56def933580a6cb6bb93d97b55c"
|
|
187
187
|
}
|