@tinkerlandai/longplay-sdk 0.10.20 → 0.10.21-rc.2

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.
Files changed (57) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +23 -4
  3. package/README.zh-CN.md +22 -3
  4. package/dist/{ai-usage-wsrO7M2I.d.ts → ai-usage-3NrLouAi.d.ts} +1 -1
  5. package/dist/{api-BDUQ1udV.d.ts → api-C65zMJI6.d.ts} +30 -0
  6. package/dist/{chunk-SHEGSRUV.js → chunk-2QSCQD6Q.js} +1 -1
  7. package/dist/chunk-5SHVM4AF.js +10 -0
  8. package/dist/chunk-6DTGBDYG.js +1 -0
  9. package/dist/chunk-6SPHXEK4.js +1 -0
  10. package/dist/{chunk-327BKZ6Q.js → chunk-CKOTDDP7.js} +1 -1
  11. package/dist/{chunk-LE4UIZGR.js → chunk-DZUPXUMV.js} +1 -1
  12. package/dist/chunk-FJCDYAPZ.js +1 -0
  13. package/dist/{chunk-CRIFRDSD.js → chunk-H6PIJ4WG.js} +1 -1
  14. package/dist/{chunk-4SWGHICJ.js → chunk-HDVLCRC6.js} +2 -2
  15. package/dist/chunk-JGG4R75K.js +1 -0
  16. package/dist/{chunk-BO5DJEMS.js → chunk-KOFZECHE.js} +1 -1
  17. package/dist/{chunk-KHIQQNTR.js → chunk-QVGTHPWT.js} +1 -1
  18. package/dist/chunk-RXJC2LV5.js +1 -0
  19. package/dist/chunk-UCOKLDSW.js +1 -0
  20. package/dist/{chunk-FISFN5IY.js → chunk-YAVWELIV.js} +1 -1
  21. package/dist/{chunk-5QS6C4AI.js → chunk-ZC6PDVLR.js} +2 -2
  22. package/dist/{configuration-sync-C2jtm37f.d.ts → configuration-sync-eEFj_oKG.d.ts} +18 -0
  23. package/dist/content-NQHRLJQT.js +1 -0
  24. package/dist/funnel-local-client-WOMhUCjI.d.ts +46182 -0
  25. package/dist/{funnel-node-evaluation-D9FwkMa3.d.ts → funnel-node-evaluation-Dhv2hYnn.d.ts} +99 -1
  26. package/dist/{funnel-process-client-DRztj2Cb.d.ts → funnel-process-client-C6q2FqFc.d.ts} +40580 -39253
  27. package/dist/funnel-runtime-host-TO43LOMU.js +1 -0
  28. package/dist/index.d.ts +36 -471
  29. package/dist/index.js +1 -1
  30. package/dist/native-shell.js +1 -1
  31. package/dist/openrouter.d.ts +2 -2
  32. package/dist/openrouter.js +1 -1
  33. package/dist/page.d.ts +1 -1
  34. package/dist/page.js +1 -1
  35. package/dist/paywall-YBC5XAB7.js +1 -0
  36. package/dist/popup.d.ts +4 -3
  37. package/dist/popup.js +1 -1
  38. package/dist/{customer-page-BV5EvCUY.d.ts → presentation-loading-Ctk1djAi.d.ts} +22 -1
  39. package/dist/react-native.d.ts +6 -6
  40. package/dist/react-native.js +1 -1
  41. package/dist/screen-renderer-TEVGVUT5.js +1 -0
  42. package/dist/server.d.ts +68 -8
  43. package/dist/server.js +1 -1
  44. package/dist/visual.js +1 -1
  45. package/package.json +1 -1
  46. package/dist/chunk-6WFCEV3R.js +0 -1
  47. package/dist/chunk-E6GGMHIY.js +0 -1
  48. package/dist/chunk-EDVR7FPD.js +0 -10
  49. package/dist/chunk-P3EOONST.js +0 -1
  50. package/dist/chunk-S4LVODTE.js +0 -1
  51. package/dist/chunk-SSLZKIIU.js +0 -1
  52. package/dist/chunk-XIYNQHN7.js +0 -1
  53. package/dist/content-42ORME22.js +0 -1
  54. package/dist/funnel-local-client-DInl0SJb.d.ts +0 -71974
  55. package/dist/funnel-runtime-host-FG4BOC3T.js +0 -1
  56. package/dist/paywall-GVZTDHXI.js +0 -1
  57. package/dist/screen-renderer-ZNELQB64.js +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.10.21 — 2026-11-07
4
+
5
+ - Reopen a Funnel on the first click after its Paywall closes. The Paywall dialog stays open until the Run confirms Close, then the host removes it, restores focus and calls `onDismiss` in the same handoff, so an entry, including the SDK IAM button, no longer ignores a click made while the old Run was still closing. If Close cannot be confirmed, the same dialog retries the original Close with its `requestId`, and repeated Close clicks are merged. A purchase left on the closed Run remains recoverable by its original `operationId`.
6
+ - Show a placeholder until the first screen has rendered. A Paywall, a Funnel screen and a Page, Popup or Banner display a local skeleton from the moment they open, and keep it through the frame handshake until the screen reports that it has rendered. Pass `loading: "host"` to keep your own placeholder and follow `onPresentationState`: `loading` carries `dismiss()`, then `ready`, `dismissed`, `skipped` or `error` ends it. Pass `signal` to cancel while data is pending; a reply that arrives after a Close, timeout, Customer change or node change no longer reopens the old view.
7
+ - Funnels reach their first screen sooner. `showFunnelRun` renders the Run the start reply already carries instead of reading it again, and `createFunnelRunController` accepts an optional `initialResponse` so a merchant backend can forward its start reply. With the current runtime a Local Funnel enters in one request.
8
+ - Fewer repeated reads. A Funnel Paywall reuses the presentation delivered with the Run and refreshes only its personal capabilities, identical concurrent reads share one request, and idle presentation and public configuration polls pause while the page is hidden. A pending purchase keeps a slower bounded read.
9
+ - Cached Funnel views appear only after the current identity confirms them, and the public Paywall entry's allowed-access path no longer depends on the renderer loading.
10
+ - Content popups follow the authored desktop width, mobile presentation and backdrop, and accept `closeControl: "content"` for an authored Close action and `canDismiss` to hold the popup open while a native operation is pending.
11
+ - The Paywall confirmation shows purchase status and processing text in the screen's language, follows the screen theme, prints a single recurring price once and uses the shared corner close control.
12
+ - `createLocalFunnelClient` has an explicit `LocalFunnelClient` type; its shape is unchanged.
13
+ - The Python and Go Server SDKs type the optional merchant `nextAction` redirect (`url`, `expiresAt`) on purchase operations.
14
+
3
15
  ## 0.10.20 — 2026-11-06
4
16
 
5
17
  - **Breaking:** tracked events now declare their type. `track()` is unchanged, but direct `trackEvents` callers in JavaScript, Python and Go must send `kind`: `custom`, `experiment_exposure` or `feature_usage`. Exposure and Feature usage reports also name the Feature `generation` that produced them. Once the runtime serves this contract, earlier SDKs cannot record events. Wire protocol stays `0.10`, and only this route changes.
package/README.md CHANGED
@@ -57,6 +57,17 @@ printf 'export * from "%s";\n' "$SDK_MODULE_URL" > longplay-sdk.js
57
57
 
58
58
  Commit the generated longplay-sdk.js to lock the immutable module URL; resolve it again only when upgrading. The optional classic loader at `https://cdn.longplayai.com/sdk.js` still follows Web releases and uses matching API/credentials. `Longplay.ready` provides every root browser export plus `createPageExperiments` and `createVisualExperiments`; replace npm imports below with destructuring those names. Loading activates no sessions, events or experiments. Server Keys remain on your backend; Funnel start/recovery and logout cleanup retain the existing contracts. Duplicate tags share readiness, failures reject the Promise and UI loads lazily. With `async`/`defer`, wait for the loader tag's load event before accessing `Longplay`. CSP must allow the script origin and API connections. Page experiments use the same script entry; explicitly create their clients and call `start()`. See [script distribution](../../docs/sdk-architecture.md#web-script-distribution) and [the complete integration example](https://www.longplayai.com/docs/sdk/javascript#script).
59
59
 
60
+ ### Connect early
61
+
62
+ Pages that show a Funnel or Paywall can open their connections before the SDK needs them. Put this in the page `<head>`:
63
+
64
+ ```html
65
+ <link rel="preconnect" href="https://api.longplayai.com" crossorigin />
66
+ <link rel="preconnect" href="https://cdn.longplayai.com" crossorigin />
67
+ ```
68
+
69
+ `crossorigin` is required. The SDK sends its requests without credentials, and browsers keep those connections apart, so a preconnect without it opens a connection the SDK cannot use. The `api` line covers commands and public configuration. The `cdn` line covers SDK modules, so a bundled app can leave it out.
70
+
60
71
  ## React Native core
61
72
 
62
73
  Use the independent `@tinkerlandai/longplay-react-native` package. The `@tinkerlandai/longplay-sdk/react-native` subpath shares the same implementation. Both support Customer Token identity, holdings, entitlement checks and usage reporting through your authenticated backend. It requires no DOM or native UI/store bridge. See [mobile SDK installation and examples](../../docs/mobile-sdk.md).
@@ -84,6 +95,8 @@ The same package supports JavaScript and TypeScript and includes type declaratio
84
95
 
85
96
  For an independent **Page, Popup or Banner resource**, import `createLongplay` and `mountContent` from the root entry, resolve it with `longplay.resolveContent(...)`, then mount the result. `/page` runs GB URL redirect experiments on an existing merchant page; `/visual` applies GB visual changes to that page. `/popup` exposes lower-level screen rendering and preview primitives. Its name does not select or resolve a Popup resource. The public import paths stay unchanged; see [entry ownership](../../docs/sdk-architecture.md#public-entry-points-and-capability-ownership).
86
97
 
98
+ The Web SDK displays a local placeholder while a Paywall, Funnel screen, Page, Popup or Banner prepares its first render. To supply a merchant placeholder, pass `loading: "host"` and use `onPresentationState`. The `loading` event provides `dismiss()`. Remove the placeholder on `ready`, `dismissed`, `skipped` or `error`. Use `ready` for the visual handoff even when the mount promise has already returned. Pass an `AbortSignal` as `signal` when the host can unmount or change Customers. Content resolved separately begins this lifecycle at `mountContent`. Preparation through `prepareContent` or `preparePopup` stays hidden until `show()`. Purchase progress and original-operation recovery continue through their existing APIs.
99
+
87
100
  The separate [Python server SDK](../python/README.md) provides synchronous and asynchronous Customer, holdings, entitlement-check and usage clients against the same current HTTP protocol. It is distributed from `https://cdn.longplayai.com/sdk/python` (not PyPI) and is not part of this npm package.
88
101
 
89
102
  The [Go server SDK](../go/README.md) provides the same initial capabilities with typed responses, Context cancellation and goroutine-safe client reuse. It is installed with `go get longplayai.com/sdk/go` through the default Go module proxy and shares the release version with the other business SDKs.
@@ -94,7 +107,7 @@ The canonical repository policy, including production/test domain roles, package
94
107
 
95
108
  Omitting `baseUrl` selects `https://api.longplayai.com`. This applies to Customer/Server, Funnel, Feature, Paywall, page and visual clients. `createConfigurationSync` also defaults its optional `origin` to that address. Swift `LongplayConfiguration(scope: ...)` and Kotlin `LongplayConfiguration(scope = ...)` uses the same default and shared release version. Explicit `baseURL` / `baseUrl` still overrides it. Funnel and Paywall shells and renderers are packaged locally; their executable code is not downloaded from that API origin.
96
109
 
97
- Release candidates (`next`) and stable releases (`latest`) published with this default both use the production API address. Tags select package versions, not deployments. The separate test API at `https://api.dev.longplayai.com` requires its own credentials and a runtime serving the current protocol 0.10.
110
+ Both `beta` and `latest` versions published with this default use the production API address. Tags select package versions, not deployments. The separate test API at `https://api.dev.longplayai.com` requires its own credentials and a runtime serving the current protocol 0.10.
98
111
 
99
112
  Use the same API origin for every client and configuration-sync instance in one integration. Sandbox/Live selects business scope inside that deployment, not a different service or database. Never retry against another service automatically after an error or unknown command result. Maintainer test runs require an explicit target and must not fall back to production; follow the [SDK testing guide](../../docs/sdk-selfserve.md#maintainer-api-origin-testing).
100
113
 
@@ -104,10 +117,10 @@ Use the same API origin for every client and configuration-sync instance in one
104
117
  import { createLongplayServer } from "@tinkerlandai/longplay-sdk/server";
105
118
 
106
119
  const longplay = createLongplayServer({
107
- baseUrl: process.env.INDIANA_BASE_URL!,
108
- apiKey: process.env.INDIANA_SECRET_KEY!,
120
+ baseUrl: process.env.LONGPLAY_API_URL!,
121
+ apiKey: process.env.LONGPLAY_SERVER_KEY!,
109
122
  scope: {
110
- projectId: process.env.INDIANA_PROJECT_ID!,
123
+ projectId: process.env.LONGPLAY_PROJECT_ID!,
111
124
  environment: "sandbox",
112
125
  },
113
126
  });
@@ -169,6 +182,10 @@ A trusted backend calls `createFunnelStartClient().start()` with `funnelId`, a r
169
182
 
170
183
  In a browser, use `createFunnelRunController` and `showFunnelRun`. The controller handles current-protocol commands, reads, retries, recovery, and subscriptions. Presentation handles provide `refresh()` and `destroy()`. Published nodes delegate business operations to the server. A client assertion or redirect is not payment evidence.
171
184
 
185
+ `showFunnelRun` renders a Run its controller already holds straight away, and with none it reads the Run first. `createFunnelClient().start()` and `createLocalFunnelClient().start()` return a controller holding the Run, so the first screen needs no read. After a start on your backend, forward its reply and pass it as `initialResponse` to `createFunnelRunController` to get the same result. Pass only the reply your backend just received. Leave it out after a reload, so the controller reads the current Run.
186
+
187
+ When a customer dismisses a Funnel Paywall, the Web host keeps the dialog open until the Run closes. If Close cannot be confirmed, the same dialog offers a retry of the original pending Close. The host removes the dialog, restores focus, and calls `onDismiss` in the same handoff; an entry can open a new Run on the next click. An unresolved purchase remains recoverable on the original Run with its original operation ID.
188
+
172
189
  Each Funnel chooses local or remote evaluation. `createFunnelDecisionClient` supports `configuration()`, `features()`, submission, and result reads. `createFeatureClient` identifies configuration by `generation`. Downloaded local rules are visible to clients; use remote evaluation and verified business facts for sensitive decisions.
173
190
 
174
191
  ### Guest entry and same-Run login
@@ -531,6 +548,8 @@ In `record_only` mode your backend owns payment execution, verifies its results
531
548
 
532
549
  `createMerchantBridge` consumes bridge version 3 at POST `/integrations/indiana`, scoped by App and environment. It uses native login for Customer sessions, presentation, commerce reads and confirmed original operations. Call `reset()` on logout/account switch. The client never automatically retries financial execution or opens Checkout. Protocol 0.10 accepts no older protocol.
533
550
 
551
+ A pending subscription-change snapshot may carry `nextAction: {type: "redirect", url, expiresAt}` for the merchant's original hosted payment page. `readOperation` preserves that action for the same operation; returning from authentication reads the original result instead of starting another purchase. Treat the action as expired at `expiresAt` and stop presenting it when the snapshot no longer contains it. Provider client secrets stay with the merchant. The runtime and installed SDK must accept the same snapshot contract before enabling this path.
552
+
534
553
  The Server entry exports `createMerchantBridgeHandler`, `createMerchantBridgeAuthorityResolver`, `signMerchantBridgeMessage` and `verifyMerchantBridgeMessage`. Supply backend signing keys, native authorization/CSRF, implemented capabilities/profiles and typed handlers. Set `resolveOperationAuthority: createMerchantBridgeAuthorityResolver(server)` so every financial/read command obtains fresh Longplay authority from the original operation API. A signed service request still requires confirmation and exact scope/Customer ownership; it cannot issue user sessions.
535
554
 
536
555
  Handlers must durably reserve the original operation before external effects and retain the same provider idempotency key. The SDK's preceding lookup is not a concurrency lock. `operation.read` returns `found` or `not_received` without creating effects. Recover `RESULT_UNKNOWN` through that original operation; never infer permission from a browser quote or `pending`. Console discovery is configuration validation, not commercial completion. See the [merchant specification](https://www.longplayai.com/docs/guides/merchant-execution) for exact fields and recovery.
package/README.zh-CN.md CHANGED
@@ -57,6 +57,17 @@ printf 'export * from "%s";\n' "$SDK_MODULE_URL" > longplay-sdk.js
57
57
 
58
58
  提交生成的 longplay-sdk.js,即可锁定不可变模块地址;仅在升级时重新解析。经典脚本 `https://cdn.longplayai.com/sdk.js` 仍随 Web 发布更新,并配套使用同环境 API 和凭据。`Longplay.ready` 返回根入口的全部浏览器导出,以及 `createPageExperiments` / `createVisualExperiments`;下文 npm import 可替换为从该 Promise 解构同名函数。加载不自动创建会话、发送事件或启动实验。Server Key 留在后端,Funnel 启动恢复与退出清理沿用现有流程。重复标签共用 ready,失败会拒绝 Promise,UI 按需加载。加载标签使用普通 script;添加 async/defer 时先等标签 load 事件,再访问 `Longplay`。CSP 需允许脚本来源和 API 连接。页面实验也使用该统一入口,显式创建客户端并调用 `start()`。详见 [script 分发](../../docs/sdk-architecture.md#web-script-distribution)和[完整接入示例](https://www.longplayai.com/zh-hans/docs/sdk/javascript#script)。
59
59
 
60
+ ### 提前建立连接
61
+
62
+ 展示 Funnel 或 Paywall 的页面可以在 SDK 用到之前先建立连接。放进页面的 `<head>`:
63
+
64
+ ```html
65
+ <link rel="preconnect" href="https://api.longplayai.com" crossorigin />
66
+ <link rel="preconnect" href="https://cdn.longplayai.com" crossorigin />
67
+ ```
68
+
69
+ `crossorigin` 必须带上。SDK 发请求时不带凭据,浏览器把这类连接和带凭据的连接分开,缺了它打开的连接 SDK 用不上。`api` 这一行用于命令和公开配置。`cdn` 这一行用于加载 SDK 模块,打包接入的应用可以不写。
70
+
60
71
  ## React Native 核心入口
61
72
 
62
73
  React Native 使用独立包 `@tinkerlandai/longplay-react-native`,原 `@tinkerlandai/longplay-sdk/react-native` 子入口共用同一实现。两者均支持 Customer Token 身份接入、权益读取和经业务后端转发的用量上报。此入口无需 DOM,不包含原生 UI 或内购桥接。参见[移动端 SDK 安装与示例](../../docs/mobile-sdk.md)。
@@ -94,6 +105,8 @@ JavaScript 与 TypeScript 共用本包,声明文件随包提供。内部 `@ind
94
105
 
95
106
  展示独立的 **Page、Popup 或 Banner 资源**,从主入口导入 `createLongplay` 和 `mountContent`,先用 `longplay.resolveContent(...)` 解析,再挂载结果。`/page` 用于商户现有页面的 GB 网址跳转实验,`/visual` 用于该页面的 GB 视觉修改;`/popup` 提供底层屏幕渲染与预览工具,不负责选择或解析 Popup 资源。现有公开导入路径保持不变,详见[入口职责](../../docs/sdk-architecture.md#public-entry-points-and-capability-ownership)。
96
107
 
108
+ Web SDK 在 Paywall、Funnel Screen、Page、Popup 或 Banner 准备首屏时展示本地骨架。宿主可传入 `loading: "host"`,通过 `onPresentationState` 接管占位。收到 `loading` 时可保存 `dismiss()` 用于关闭,收到 `ready`、`dismissed`、`skipped` 或 `error` 时撤下占位。挂载 Promise 返回后仍应等 `ready` 再交接。宿主卸载或切换 Customer 时,可通过传入的 `signal` 取消展示。单独解析的 Content 从 `mountContent` 开始加载。通过 `prepareContent` 或 `preparePopup` 预渲染的内容会保持隐藏,直到调用 `show()`。购买进度和原单恢复继续使用各自的现有 API。
109
+
97
110
  独立的 [Python 服务端 SDK](../python/README.md) 使用同一当前 HTTP 协议,提供同步、异步 Customer、持仓/权益检查和用量上报。它从 `https://cdn.longplayai.com/sdk/python` 分发(不在 PyPI),不属于这个 npm 包。
98
111
 
99
112
  [Go 服务端 SDK](../go/README.md) 提供同样的首版能力,使用类型化响应、Context 取消和 goroutine 并发复用客户端。通过 Go 默认模块代理以 `go get longplayai.com/sdk/go` 安装,与其他业务 SDK 共用发行版本。
@@ -116,10 +129,10 @@ JavaScript 与 TypeScript 共用本包,声明文件随包提供。内部 `@ind
116
129
  import { createLongplayServer } from "@tinkerlandai/longplay-sdk/server";
117
130
 
118
131
  const longplay = createLongplayServer({
119
- baseUrl: process.env.INDIANA_BASE_URL!,
120
- apiKey: process.env.INDIANA_SECRET_KEY!,
132
+ baseUrl: process.env.LONGPLAY_API_URL!,
133
+ apiKey: process.env.LONGPLAY_SERVER_KEY!,
121
134
  scope: {
122
- projectId: process.env.INDIANA_PROJECT_ID!,
135
+ projectId: process.env.LONGPLAY_PROJECT_ID!,
123
136
  environment: "sandbox",
124
137
  },
125
138
  });
@@ -181,6 +194,10 @@ Web 宿主可以用独立的第一方安装 cookie 保留信号。清除 cookie
181
194
 
182
195
  浏览器使用 `createFunnelRunController` 与 `showFunnelRun`。控制器负责当前协议的命令、读取、重试、恢复和订阅;展示句柄提供 `refresh()` 和 `destroy()`。业务操作按当前发布节点委派给服务端,客户端声明或重定向不构成付款证明。
183
196
 
197
+ `showFunnelRun` 在控制器已有 Run 时立即渲染,没有时先读取。`createFunnelClient().start()` 和 `createLocalFunnelClient().start()` 返回的控制器已经带着 Run,首屏不用再读一次。如果 Funnel 由你的后端启动,把启动响应转给浏览器,作为 `initialResponse` 传给 `createFunnelRunController`,效果相同。只传后端刚收到的响应。页面重新加载后不要传,让控制器读取当前 Run。
198
+
199
+ 顾客关闭 Funnel Paywall 时,Web 宿主会保留原弹窗,直到 Run 确认关闭。关闭结果未确认时,可在原弹窗内重试同一条待确认的 Close。宿主在同一次交接中移除弹窗、归还焦点并调用 `onDismiss`,下一次点击入口即可打开新 Run。未结算的购买仍可在原 Run 上按原操作 ID 恢复。
200
+
184
201
  Local/Remote 求值策略由每个 Funnel 决定。`createFunnelDecisionClient` 支持当前 `configuration()`、`features()`、提交和结果读取;`createFeatureClient` 以 `generation` 标识配置。Local 下载的规则对客户端可见;敏感决策应使用 Remote 和可信业务事实。
185
202
 
186
203
  ### 独立消费方的分桶身份
@@ -374,6 +391,8 @@ export async function showBanner(
374
391
 
375
392
  `createMerchantBridge` 使用版本 3 单入口 POST `/integrations/indiana`,按 App 和环境固定范围,通过原生登录接入 Customer 会话、展示、商业读取和已确认原操作。退出或换号调用 `reset()`。客户端不自动重试财务执行或打开 Checkout。当前协议为 0.10,不兼容旧协议。
376
393
 
394
+ 等待支付验证的订阅变更快照可带 `nextAction: {type: "redirect", url, expiresAt}`,指向商户原账单的支付页。`readOperation` 会在同一操作的恢复查询中保留该动作;验证返回后继续查询原结果,不另起购买。到达 `expiresAt` 或后续快照不再包含该动作时,停止展示验证入口。支付服务商的 `client_secret` 保留在商户侧。启用前,运行时和已安装 SDK 必须支持同一份快照协议。
395
+
377
396
  Server 入口导出 `createMerchantBridgeHandler`、`createMerchantBridgeAuthorityResolver`、`signMerchantBridgeMessage` 和 `verifyMerchantBridgeMessage`。配置后端签名密钥、原生授权/CSRF、实际已实现的能力与 profiles,并设置 `resolveOperationAuthority: createMerchantBridgeAuthorityResolver(server)`,每次从 Longplay 原操作 API 读取最新权限。服务签名仍需原确认事实和准确范围、Customer 归属,不能据此签发用户会话。
378
397
 
379
398
  业务处理器必须在调用外部渠道前持久预留原 operationId,并使用稳定渠道幂等键;SDK 的先查询不能代替并发锁。`operation.read` 返回 `found` 或 `not_received`,严格只读。`RESULT_UNKNOWN` 只恢复原操作,不能根据浏览器报价或 pending 状态自行推断执行权限。Console 能力检查不证明商业完成。精确字段和恢复规则见[商户接入规范](https://www.longplayai.com/zh-hans/docs/guides/merchant-execution)。
@@ -1,5 +1,5 @@
1
1
  import { LanguageModelV4Usage, LanguageModelV4Middleware } from '@ai-sdk/provider';
2
- import { F as FoundationApi, A as ApiInput } from './api-BDUQ1udV.js';
2
+ import { F as FoundationApi, A as ApiInput } from './api-C65zMJI6.js';
3
3
  import { z } from 'zod';
4
4
 
5
5
  declare const tokenCounts: z.ZodObject<{
@@ -6661,6 +6661,11 @@ declare const apiOperations: {
6661
6661
  }>;
6662
6662
  merchantSubscriptionId: z$1.ZodString;
6663
6663
  scheduledFor: z$1.ZodNullable<z$1.ZodISODateTime>;
6664
+ nextAction: z$1.ZodOptional<z$1.ZodObject<{
6665
+ type: z$1.ZodLiteral<"redirect">;
6666
+ url: z$1.ZodURL;
6667
+ expiresAt: z$1.ZodISODateTime;
6668
+ }, z$1.core.$strict>>;
6664
6669
  operationId: z$1.ZodUUID;
6665
6670
  customerId: z$1.ZodUUID;
6666
6671
  merchantExecutionId: z$1.ZodString;
@@ -8186,6 +8191,11 @@ declare const apiOperations: {
8186
8191
  }>;
8187
8192
  merchantSubscriptionId: z$1.ZodString;
8188
8193
  scheduledFor: z$1.ZodNullable<z$1.ZodISODateTime>;
8194
+ nextAction: z$1.ZodOptional<z$1.ZodObject<{
8195
+ type: z$1.ZodLiteral<"redirect">;
8196
+ url: z$1.ZodURL;
8197
+ expiresAt: z$1.ZodISODateTime;
8198
+ }, z$1.core.$strict>>;
8189
8199
  operationId: z$1.ZodUUID;
8190
8200
  customerId: z$1.ZodUUID;
8191
8201
  merchantExecutionId: z$1.ZodString;
@@ -9573,6 +9583,11 @@ declare const apiOperations: {
9573
9583
  }>;
9574
9584
  merchantSubscriptionId: z$1.ZodString;
9575
9585
  scheduledFor: z$1.ZodNullable<z$1.ZodISODateTime>;
9586
+ nextAction: z$1.ZodOptional<z$1.ZodObject<{
9587
+ type: z$1.ZodLiteral<"redirect">;
9588
+ url: z$1.ZodURL;
9589
+ expiresAt: z$1.ZodISODateTime;
9590
+ }, z$1.core.$strict>>;
9576
9591
  operationId: z$1.ZodUUID;
9577
9592
  customerId: z$1.ZodUUID;
9578
9593
  merchantExecutionId: z$1.ZodString;
@@ -10927,6 +10942,11 @@ declare const apiOperations: {
10927
10942
  }>;
10928
10943
  merchantSubscriptionId: z$1.ZodString;
10929
10944
  scheduledFor: z$1.ZodNullable<z$1.ZodISODateTime>;
10945
+ nextAction: z$1.ZodOptional<z$1.ZodObject<{
10946
+ type: z$1.ZodLiteral<"redirect">;
10947
+ url: z$1.ZodURL;
10948
+ expiresAt: z$1.ZodISODateTime;
10949
+ }, z$1.core.$strict>>;
10930
10950
  operationId: z$1.ZodUUID;
10931
10951
  customerId: z$1.ZodUUID;
10932
10952
  merchantExecutionId: z$1.ZodString;
@@ -12756,6 +12776,11 @@ declare const apiOperations: {
12756
12776
  }>;
12757
12777
  merchantSubscriptionId: z$1.ZodString;
12758
12778
  scheduledFor: z$1.ZodNullable<z$1.ZodISODateTime>;
12779
+ nextAction: z$1.ZodOptional<z$1.ZodObject<{
12780
+ type: z$1.ZodLiteral<"redirect">;
12781
+ url: z$1.ZodURL;
12782
+ expiresAt: z$1.ZodISODateTime;
12783
+ }, z$1.core.$strict>>;
12759
12784
  operationId: z$1.ZodUUID;
12760
12785
  customerId: z$1.ZodUUID;
12761
12786
  merchantExecutionId: z$1.ZodString;
@@ -13805,6 +13830,11 @@ declare const apiOperations: {
13805
13830
  }>;
13806
13831
  merchantSubscriptionId: z$1.ZodString;
13807
13832
  scheduledFor: z$1.ZodNullable<z$1.ZodISODateTime>;
13833
+ nextAction: z$1.ZodOptional<z$1.ZodObject<{
13834
+ type: z$1.ZodLiteral<"redirect">;
13835
+ url: z$1.ZodURL;
13836
+ expiresAt: z$1.ZodISODateTime;
13837
+ }, z$1.core.$strict>>;
13808
13838
  operationId: z$1.ZodUUID;
13809
13839
  customerId: z$1.ZodUUID;
13810
13840
  merchantExecutionId: z$1.ZodString;
@@ -1 +1 @@
1
- import{a as u}from"./chunk-DSPLGTQI.js";import{lb as d}from"./chunk-5QS6C4AI.js";function m(e){if(!/^[A-Za-z0-9_-]{1,64}$/.test(e))throw new Error("Invalid device cookie name");let t="";for(let i of document.cookie.split(";"))if(i.trim().startsWith(`${e}=`))try{t=decodeURIComponent(i.trim().slice(e.length+1))}catch{}return/^[A-Za-z0-9_-]{8,128}$/.test(t)||(t=crypto.randomUUID(),document.cookie=`${e}=${encodeURIComponent(t)}; path=/; max-age=${400*24*3600}; SameSite=Lax`),t}function y(){try{let e=sessionStorage.getItem("indiana_sid");return e||(e=crypto.randomUUID(),sessionStorage.setItem("indiana_sid",e)),e}catch{return}}function g(e=d){let t=new URL(e);if(t.protocol!=="https:"&&!(t.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(t.hostname))||t.username||t.password||t.search||t.hash)throw new Error("baseUrl must be an https origin without credentials");return t.origin}var o=new Set,s;function S(e){let t=()=>e();if(o.add(t),!s){let i=!0,a=history.pushState,p=history.replaceState,r=()=>{if(i)for(let n of[...o])o.has(n)&&u(n)},c=function(...n){a.apply(this,n),r()},h=function(...n){p.apply(this,n),r()};history.pushState=c,history.replaceState=h,addEventListener("popstate",r),addEventListener("hashchange",r),s=()=>{i=!1,history.pushState===c&&(history.pushState=a),history.replaceState===h&&(history.replaceState=p),removeEventListener("popstate",r),removeEventListener("hashchange",r)}}return()=>{o.delete(t)&&(o.size||(s?.(),s=void 0))}}export{m as a,y as b,g as c,S as d};
1
+ import{lb as d}from"./chunk-ZC6PDVLR.js";import{a as u}from"./chunk-DSPLGTQI.js";function m(e){if(!/^[A-Za-z0-9_-]{1,64}$/.test(e))throw new Error("Invalid device cookie name");let t="";for(let i of document.cookie.split(";"))if(i.trim().startsWith(`${e}=`))try{t=decodeURIComponent(i.trim().slice(e.length+1))}catch{}return/^[A-Za-z0-9_-]{8,128}$/.test(t)||(t=crypto.randomUUID(),document.cookie=`${e}=${encodeURIComponent(t)}; path=/; max-age=${400*24*3600}; SameSite=Lax`),t}function y(){try{let e=sessionStorage.getItem("indiana_sid");return e||(e=crypto.randomUUID(),sessionStorage.setItem("indiana_sid",e)),e}catch{return}}function g(e=d){let t=new URL(e);if(t.protocol!=="https:"&&!(t.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(t.hostname))||t.username||t.password||t.search||t.hash)throw new Error("baseUrl must be an https origin without credentials");return t.origin}var o=new Set,s;function S(e){let t=()=>e();if(o.add(t),!s){let i=!0,a=history.pushState,p=history.replaceState,r=()=>{if(i)for(let n of[...o])o.has(n)&&u(n)},c=function(...n){a.apply(this,n),r()},h=function(...n){p.apply(this,n),r()};history.pushState=c,history.replaceState=h,addEventListener("popstate",r),addEventListener("hashchange",r),s=()=>{i=!1,history.pushState===c&&(history.pushState=a),history.replaceState===h&&(history.replaceState=p),removeEventListener("popstate",r),removeEventListener("hashchange",r)}}return()=>{o.delete(t)&&(o.size||(s?.(),s=void 0))}}export{m as a,y as b,g as c,S as d};