@tinkerlandai/indiana-sdk 0.9.5 → 0.10.1
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/CHANGELOG.md +11 -0
- package/README.md +7 -18
- package/README.zh-CN.md +8 -6
- package/dist/{ai-usage-CUTIHAU0.d.ts → ai-usage-Cn7dhvFw.d.ts} +3 -3
- package/dist/{api-BXu6TAoB.d.ts → api-DC44FaTV.d.ts} +6354 -904
- package/dist/chunk-2Y4G5364.js +6 -0
- package/dist/{chunk-XSOEA4A5.js → chunk-ABNSU3ZG.js} +1 -1
- package/dist/chunk-ACF2FBUB.js +1 -0
- package/dist/{chunk-4C3HUZ3B.js → chunk-AHXYGGAA.js} +1 -1
- package/dist/{chunk-MKV726FV.js → chunk-CCPNMQHZ.js} +1 -1
- package/dist/chunk-EDQCH2QS.js +1 -0
- package/dist/chunk-IWWKVNEX.js +1 -0
- package/dist/{chunk-AOGPGUWE.js → chunk-QUWPPZHH.js} +1 -1
- package/dist/chunk-SBPTOOYB.js +1 -0
- package/dist/chunk-WYZI3TNB.js +1 -0
- package/dist/{chunk-M7JWCLYX.js → chunk-X6BCUINI.js} +1 -1
- package/dist/chunk-Y46ALAKP.js +1 -0
- package/dist/{configuration-sync-DuJl4SbM.d.ts → configuration-sync-CXe9Zcng.d.ts} +11 -11
- package/dist/{content-PQJYLAGQ.js → content-ZRWZ26PF.js} +1 -1
- package/dist/{funnel-local-client-BhHdi5_V.d.ts → funnel-local-client-BQsdOjQ7.d.ts} +18474 -2596
- package/dist/funnel-node-evaluation-P5B4fPfJ.d.ts +2054 -0
- package/dist/{funnel-resource-client-BoIhL_my.d.ts → funnel-resource-client-Zof1WLgA.d.ts} +5977 -1126
- package/dist/funnel-runtime-host-N7TX3LWI.js +1 -0
- package/dist/index.d.ts +9924 -1958
- package/dist/index.js +1 -1
- package/dist/openrouter.d.ts +3 -3
- package/dist/openrouter.js +1 -1
- package/dist/page.d.ts +3 -3
- package/dist/page.js +1 -1
- package/dist/paywall-DR65VN2G.js +1 -0
- package/dist/popup.d.ts +1 -1
- package/dist/popup.js +1 -1
- package/dist/react-native.d.ts +19930 -7179
- package/dist/react-native.js +1 -1
- package/dist/{screen-renderer-VAMWY7ID.js → screen-renderer-ZSAR7LPS.js} +1 -1
- package/dist/server.d.ts +2737 -573
- package/dist/server.js +1 -1
- package/dist/visual.d.ts +1 -1
- package/dist/visual.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-5ZWSFE2C.js +0 -1
- package/dist/chunk-HEGNIATD.js +0 -1
- package/dist/chunk-LMO3FXRT.js +0 -1
- package/dist/chunk-QYECMZJJ.js +0 -1
- package/dist/chunk-UBMPFTGE.js +0 -1
- package/dist/chunk-UWFYBRM2.js +0 -6
- package/dist/chunk-XRXI3DMZ.js +0 -1
- package/dist/funnel-node-evaluation-DuPmqIo1.d.ts +0 -998
- package/dist/funnel-runtime-host-3YUGXD3Y.js +0 -1
- package/dist/paywall-CSAGKPCP.js +0 -1
- package/dist/{screen-CvfI_L41.d.ts → screen-D81zCpfi.d.ts} +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
Release facts and artifact evidence: [SDK release ledger](../../docs/sdk-releases.md).
|
|
4
4
|
|
|
5
|
+
## 0.10.1 — 2026-10-29
|
|
6
|
+
|
|
7
|
+
- Add the Server SDK supplemental Invoice preparation API with explicit Customer scope, reason normalization and bounded amounts; align Python/Go methods and transport fixtures.
|
|
8
|
+
- Preserve the original merchant purchase while recovering Paywall failures, and open its Checkout only once.
|
|
9
|
+
- Accept the App Console host in visual diagnostics after the public-site domain split.
|
|
10
|
+
|
|
11
|
+
- Support merchant-native purchase, subscription changes, refunds and billing records without requiring Stripe object identifiers or credentials.
|
|
12
|
+
- Upgrade the merchant receiver to version 3 with declared commercial profiles, explicit original-operation lookup and fresh Indiana authority before financial execution. Unknown results retain recovery of the original operation.
|
|
13
|
+
- Add the Server SDK authority resolver and align generated DTOs, financial validation and native merchant-provider entry points across all six SDKs.
|
|
14
|
+
- Use only wire protocol 0.10. Requests and responses from protocol 0.9 are refused; Customer Access/Refresh credentials retain their existing lifecycle.
|
|
15
|
+
|
|
5
16
|
## 0.9.5 — 2026-10-29
|
|
6
17
|
|
|
7
18
|
- Synchronize JavaScript, React Native, Swift, Kotlin, Python and Go with the current Customer operations, scope checks, response validation and document semantics.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @tinkerlandai/indiana-sdk
|
|
2
2
|
|
|
3
|
-
This source checkout is SDK 0.
|
|
3
|
+
This source checkout is SDK 0.10.1, protocol 0.10. These examples use `https://api.tinker.cash` with a Sandbox App and credentials issued by the production deployment. Sandbox still contains production data; do not reuse credentials from the separate test deployment. Confirm runtime readiness in [environment state](../../docs/development-status.md) before running them.
|
|
4
4
|
|
|
5
5
|
[简体中文](./README.zh-CN.md)
|
|
6
6
|
|
|
@@ -9,7 +9,7 @@ The Indiana business SDK groups its capabilities as **Identity, Commerce, experi
|
|
|
9
9
|
**IAM source scanning, generation, validation and upload belong to the independent build package `@tinkerlandai/indiana-iam`.** This business SDK retains only the runtime release binding used by GB visual changes. See [SDK boundaries](../../docs/sdk-architecture.md) and the [IAM package](../iam/README.md).
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
|
-
npm install --save-exact @tinkerlandai/indiana-sdk@0.9.
|
|
12
|
+
npm install --save-exact @tinkerlandai/indiana-sdk@0.9.5
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
This SDK requires HTTP protocol 0.9. Install a version that matches your runtime; publishing a package does not deploy the server. Publication and accepted environment scope are recorded in the [release ledger](../../docs/sdk-releases.md) and [development status](../../docs/development-status.md).
|
|
@@ -463,23 +463,12 @@ Customer sessions contain `customerId`, `sessionId`, `accessToken`, `refreshToke
|
|
|
463
463
|
|
|
464
464
|
## Merchant-recorded billing
|
|
465
465
|
|
|
466
|
-
In
|
|
467
|
-
|
|
468
|
-
```ts
|
|
469
|
-
await server.recordBillingEvent({
|
|
470
|
-
provider: "stripe",
|
|
471
|
-
accountId: "acct_your_account",
|
|
472
|
-
eventId: "your-stable-event-id",
|
|
473
|
-
type: "invoice.paid",
|
|
474
|
-
occurredAt: Date.now(),
|
|
475
|
-
data: completePaidInvoice,
|
|
476
|
-
});
|
|
477
|
-
```
|
|
478
|
-
|
|
479
|
-
Keep the same event ID, timestamp and data when retrying. Submit all Invoice lines and subscription items; incomplete snapshots are rejected. Existing quote metadata and Price bindings associate the record with the purchase. The receipt identifies merchant provenance with `providerVerified: false`. Customer/Guest clients cannot record billing results.
|
|
466
|
+
In `record_only` mode your backend owns payment execution, verifies its results and submits normalized `provider: "merchant"` facts with the Server SDK. Use `purchase.completed`, `purchase.closed`, `subscription.observed`, `subscription.change.completed`, `invoice.paid` or `refund.updated`. Include the original operation/Customer, complete Invoice lines and subscription items as required. Amounts use minor units; `occurredAt` is an ISO observation time. A durable outbox retains the exact event ID and facts on retry. The receipt records merchant provenance with `providerVerified: false`; Customer/Guest clients cannot submit billing facts. Managed mode retains Indiana-owned provider execution.
|
|
480
467
|
|
|
481
468
|
## Merchant bridge
|
|
482
469
|
|
|
483
|
-
|
|
470
|
+
`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.
|
|
471
|
+
|
|
472
|
+
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 Indiana authority from the original operation API. A signed service request still requires confirmation and exact scope/Customer ownership; it cannot issue user sessions.
|
|
484
473
|
|
|
485
|
-
|
|
474
|
+
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://tinker.cash/docs/merchant-execution) for exact fields and recovery.
|
package/README.zh-CN.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[English](./README.md)
|
|
2
2
|
|
|
3
|
-
当前源码为 SDK 0.
|
|
3
|
+
当前源码为 SDK 0.10.1、协议 0.10。本页示例使用 `https://api.tinker.cash` 以及生产部署内签发的 Sandbox App/凭据。Sandbox 仍属于生产数据,不能复用独立测试部署的凭据。运行前核对[环境状态](../../docs/development-status.md),确认服务已就绪。
|
|
4
4
|
|
|
5
5
|
# @tinkerlandai/indiana-sdk
|
|
6
6
|
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
**IAM 的源码扫描、生成、校验和上传属于独立构建包 `@tinkerlandai/indiana-iam`。** 普通业务 SDK 只保留 GB visual 应用页面变更所需的运行时 release 绑定。完整定义见 [SDK 边界](../../docs/sdk-architecture.md) 与 [IAM 构建包](../iam/README.md)。
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
|
-
npm install --save-exact @tinkerlandai/indiana-sdk@0.9.
|
|
12
|
+
npm install --save-exact @tinkerlandai/indiana-sdk@0.9.5
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
SDK 0.9.
|
|
15
|
+
SDK 0.9.5 要求 HTTP 协议 0.9。安装版本须与运行服务匹配;发布包不会部署服务端。实际发布、标签与环境验收范围见 [SDK 发布总账](../../docs/sdk-releases.md) 和 [开发状态](../../docs/development-status.md)。
|
|
16
16
|
|
|
17
17
|
数据/会话层负责公开 JSON、完整性校验和鉴权操作;展示宿主将会话接口接入打包的屏幕渲染器,渲染器消费已提供的数据并返回动作意图。客户端按需加载展示;`/server` 入口使用商户后端的受限 Server Key,不加载屏幕展示。SDK 本地检查不替代运行时授权或付款核实。后台 Preview 为同一个展示宿主提供模拟会话和数据。
|
|
18
18
|
|
|
@@ -352,10 +352,12 @@ export async function showBanner(
|
|
|
352
352
|
|
|
353
353
|
## 商户主动记账
|
|
354
354
|
|
|
355
|
-
`record_only`
|
|
355
|
+
`record_only` 由商户后端执行并核对支付,再提交 `provider: "merchant"` 的归一化事实。事件包括 `purchase.completed`、`purchase.closed`、`subscription.observed`、`subscription.change.completed`、`invoice.paid`、`refund.updated`,按事件携带原操作、Customer、完整发票行和订阅项目。金额使用最小币种单位,`occurredAt` 为真实观察时间的 ISO 字符串。可靠 outbox 在重试时保留相同事件 ID 和事实。回执以 `providerVerified: false` 标记商户来源;Customer/Guest 无权记账。托管模式继续由 Indiana 执行渠道业务。
|
|
356
356
|
|
|
357
357
|
## 商户桥接
|
|
358
358
|
|
|
359
|
-
|
|
359
|
+
`createMerchantBridge` 使用版本 3 单入口 POST `/integrations/indiana`,按 App 和环境固定范围,通过原生登录接入 Customer 会话、展示、商业读取和已确认原操作。退出或换号调用 `reset()`。客户端不自动重试财务执行或打开 Checkout。当前协议为 0.10,不兼容旧协议。
|
|
360
360
|
|
|
361
|
-
Server
|
|
361
|
+
Server 入口导出 `createMerchantBridgeHandler`、`createMerchantBridgeAuthorityResolver`、`signMerchantBridgeMessage` 和 `verifyMerchantBridgeMessage`。配置后端签名密钥、原生授权/CSRF、实际已实现的能力与 profiles,并设置 `resolveOperationAuthority: createMerchantBridgeAuthorityResolver(server)`,每次从 Indiana 原操作 API 读取最新权限。服务签名仍需原确认事实和准确范围、Customer 归属,不能据此签发用户会话。
|
|
362
|
+
|
|
363
|
+
业务处理器必须在调用外部渠道前持久预留原 operationId,并使用稳定渠道幂等键;SDK 的先查询不能代替并发锁。`operation.read` 返回 `found` 或 `not_received`,严格只读。`RESULT_UNKNOWN` 只恢复原操作,不能根据浏览器报价或 pending 状态自行推断执行权限。Console 能力检查不证明商业完成。精确字段和恢复规则见[商户接入规范](https://tinker.cash/zh-CN/docs/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-
|
|
2
|
+
import { F as FoundationApi, A as ApiInput } from './api-DC44FaTV.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
declare const tokenCounts: z.ZodObject<{
|
|
@@ -98,7 +98,7 @@ declare function createAiPricing(options?: AiPricingOptions): {
|
|
|
98
98
|
receipt: {
|
|
99
99
|
id: string;
|
|
100
100
|
internal_feature_id: string;
|
|
101
|
-
kind: "
|
|
101
|
+
kind: "release" | "refund" | "consume" | "reserve" | "confirm" | "expire";
|
|
102
102
|
originalId: string | null;
|
|
103
103
|
quantity: string;
|
|
104
104
|
accepted: boolean;
|
|
@@ -169,7 +169,7 @@ declare function createConfiguredAiPricing(client: Pick<FoundationApi, "readAiPr
|
|
|
169
169
|
receipt: {
|
|
170
170
|
id: string;
|
|
171
171
|
internal_feature_id: string;
|
|
172
|
-
kind: "
|
|
172
|
+
kind: "release" | "refund" | "consume" | "reserve" | "confirm" | "expire";
|
|
173
173
|
originalId: string | null;
|
|
174
174
|
quantity: string;
|
|
175
175
|
accepted: boolean;
|