Skip to content

Commit 630d393

Browse files
committed
chore: update @smscode/sdk (generated from the SMSCode monorepo)
1 parent d95c96f commit 630d393

5 files changed

Lines changed: 7 additions & 7 deletions

File tree

docs/ai.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Compact integration guidance for coding agents building on the SMSCode virtual-n
77

88
## Rules
99

10-
1. **Public surfaces only — `/v1` and `/v2`.** NEVER call `/internal`, `/admin`, or `/mobile`. Those are private surfaces (the web app, the admin panel, the Android app) and are not part of the public contract — they require different auth and can change without notice.
10+
1. **Public surfaces only — `/v1` and `/v2`.** Use only the documented public surfaces; do not depend on undocumented endpoints — they are outside the public contract and may change without notice.
1111
2. **Prefer `/v2` (USD-native).** `/v2` returns USD money objects with the exact IDR canonical amount and an FX receipt (`meta.fx`). `/v1` is the legacy IDR-only API (money is an integer in IDR minor units). Pick ONE version per integration; do not mix shapes.
1212
3. **Auth is `Authorization: Bearer <token>`** on every request (token from Account Settings). No cookies, no separate API-key header.
1313
4. **Idempotency is money safety.** Order create sends an `idempotency-key`. On a FAILED create, **retry with the SAME key — never mint a new one.** A new key on retry can double-charge you (the server dedups by key → at-most-once). With the SDK, the key is on the thrown error: reuse `error.idempotencyKey`.

docs/openapi/openapi.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ info:
2424
with `/v1`; pick one per integration.
2525
2626
27-
Only these public surfaces are documented here. The internal admin, web,
28-
and mobile surfaces are private and out of scope.
27+
Only `/v1` and `/v2` are documented as public surfaces. Undocumented
28+
endpoints are out of scope and may change without notice.
2929
3030
3131
## Authentication

packages/sdk-js/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Official TypeScript/JavaScript SDK for the [SMSCode](https://smscode.gg) virtual
77
- **Typed errors**: branch on `instanceof` (or `err.code`), never on `err.message`.
88
- **Zero runtime dependencies**, isomorphic (Node 18+, Bun, Deno, browsers — anything with `fetch` + Web Crypto).
99

10-
> AI agents: see [`docs/ai.md`](https://github.com/smscode-gg/sdks/blob/main/docs/ai.md) for compact integration rules. Coding agents should **prefer `/v2`** and **never** call `/internal`, `/admin`, or `/mobile`.
10+
> AI agents: see [`docs/ai.md`](https://github.com/smscode-gg/sdks/blob/main/docs/ai.md) for compact integration rules. Coding agents should **prefer `/v2`** and use only the documented public API surfaces.
1111
1212
## Install
1313

packages/sdk-js/test/orders.idempotency.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ describe("MONEY-SAFETY: retry exhaustion keeps the SAME key (never a new one)",
456456
});
457457
});
458458

459-
describe("MONEY-SAFETY: a POST-SUCCESS decode error still carries the key (swarm PI367-BLOCKER-1)", () => {
459+
describe("MONEY-SAFETY: a POST-SUCCESS decode error still carries the key", () => {
460460
const PROVIDED = "stable-key";
461461

462462
it("/v2 success with an UNSAFE canonical_amount → INVALID_MONEY error carries the resolved key", async () => {
@@ -497,7 +497,7 @@ describe("MONEY-SAFETY: a POST-SUCCESS decode error still carries the key (swarm
497497
expect(err.idempotencyKey).toBe(PROVIDED);
498498
});
499499

500-
it("/v2 success with valid meta.fx but an order item MISSING `amount` → a TYPED SmscodeError (not a raw TypeError) carries the resolved key (PI367-BLOCKER-1B)", async () => {
500+
it("/v2 success with valid meta.fx but an order item MISSING `amount` → a TYPED SmscodeError (not a raw TypeError) carries the resolved key", async () => {
501501
const calls: Captured[] = [];
502502
const client = new SmscodeClient({
503503
token: "t",

packages/sdk-js/test/orders.mutations.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ describe("orders mutations — NO auto-retry (no idempotency key)", () => {
252252
});
253253
});
254254

255-
describe("orders /v2 reads — TYPED error on a malformed 2xx envelope (swarm note)", () => {
255+
describe("orders /v2 reads — TYPED error on a malformed 2xx envelope", () => {
256256
// A `/v2` order summary with valid money but NO `meta.fx` on the 2xx envelope.
257257
// These are reads — no idempotency key is involved (do NOT assert one).
258258
const V2_ORDER_OK = {

0 commit comments

Comments
 (0)