@capxul/sdk-react 0.1.0-alpha.1 → 0.1.0-alpha.10
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 +138 -0
- package/README.md +21 -1
- package/dist/index.cjs +288 -137
- package/dist/index.d.cts +207 -42
- package/dist/index.d.ts +207 -42
- package/dist/index.js +288 -140
- package/dist/proof/index.cjs +12777 -0
- package/dist/proof/index.d.cts +753 -0
- package/dist/proof/index.d.ts +753 -0
- package/dist/proof/index.js +12750 -0
- package/package.json +12 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,143 @@
|
|
|
1
1
|
# @capxul/sdk-react
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- d252aa7: Widen the published React peer dependency to `>=18.2.0 <20` so React 18 consumers, including the Ink reference proof app, can install the alpha SDK without peer conflicts.
|
|
8
|
+
|
|
9
|
+
## 0.1.0-alpha.9
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- Add the canonical auth bootstrap flow.
|
|
14
|
+
|
|
15
|
+
`verifyOtp()` now resolves a verified email session into either an
|
|
16
|
+
`existing_member` identity or a `bootstrap_required` continuation. New and
|
|
17
|
+
incomplete members continue through `completeBootstrap()`, which validates a
|
|
18
|
+
server-issued bootstrap token, claims the username, provisions the account/Safe
|
|
19
|
+
through the backend bootstrap path, and returns the authenticated product
|
|
20
|
+
identity. The React SDK adds `useAuthBootstrapFlow()` as the typed first-run
|
|
21
|
+
flow wrapper.
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies
|
|
26
|
+
- @capxul/sdk@0.1.0-alpha.9
|
|
27
|
+
|
|
28
|
+
## 0.1.0-alpha.8
|
|
29
|
+
|
|
30
|
+
### Minor Changes
|
|
31
|
+
|
|
32
|
+
- 3af04a9: Public `<CapxulProvider>` now wires authenticated Convex reads end-to-end (#487, closes #484).
|
|
33
|
+
|
|
34
|
+
The `build-time-urls` arm of `BrowserCapxulConfig` now causes the provider to internally instantiate a `ConvexReactClient`, wrap it as a `CapxulDataClient`, and feed it as `config.data` into `createCapxulClient`. The existing `auth.createDataClient` callback is wired to the same singleton so a `verifyOtp` call refreshes the data client's auth header without churning the WebSocket. The provider also wraps `client.auth.signOut` so the data client survives sign-out — post-signout reads return typed backend `NOT_AUTHENTICATED` instead of the SDK's `NOT_IMPLEMENTED` stub (closes the #474 friction as a side-effect).
|
|
35
|
+
|
|
36
|
+
New optional `sessionStore?: AuthSessionStore` prop lets browser apps opt into `localStorage`-backed persistence and Node consumers (CLIs, e2e harnesses) opt into file-backed persistence. Defaults to in-memory.
|
|
37
|
+
|
|
38
|
+
This closes the architectural gap that made the React hook surface (`useMe`, `useAccount`, `useSafe`, ...) impossible to exercise end-to-end through the public provider — previously `config.data` was never populated, so every authenticated read short-circuited to `NOT_IMPLEMENTED`. The Ink reference CLI (`apps/reference-cli/`) is rebuilt on top of the public provider as proof: 17/17 agent-driver assertions pass against live alpha-3 Convex, including a dev-OTP authenticated round-trip that mints a real session via `AUTH_DEV_OTP=00000` and exercises three distinct hook end-states (`NOT_AUTHENTICATED`, `PROFILE_NOT_FOUND`, post-signout `NOT_AUTHENTICATED`).
|
|
39
|
+
|
|
40
|
+
- 57203a4: Withdrawals v1 W2 (#465) — public surface tightening + org-scope create
|
|
41
|
+
- `WithdrawalsCreateInput.destination` no longer accepts `kind`. The
|
|
42
|
+
backend now resolves the `external_account` row by FK and infers
|
|
43
|
+
the kind + rail server-side. Anything that doesn't route to
|
|
44
|
+
`chain_wallet` (or is chain_wallet but non-EVM in slice 1) returns
|
|
45
|
+
`VERIFICATION_REQUIRED` with `details.rail` + `details.currentKind`.
|
|
46
|
+
- `organizations.withdrawals.create` is now a real mutation (no
|
|
47
|
+
longer a `NOT_IMPLEMENTED` stub). Returns the `processing` row
|
|
48
|
+
only — Safe + Zodiac submission orchestration ships in W3+.
|
|
49
|
+
- `Errors.verificationRequired({ rail, currentKind })` factory
|
|
50
|
+
added; the `VERIFICATION_REQUIRED` code now broadens to cover
|
|
51
|
+
both KYC tier gates and unsupported withdrawal rails.
|
|
52
|
+
|
|
53
|
+
**Migration:** Remove `destination.kind` from any
|
|
54
|
+
`capxul.withdrawals.create({ destination: { kind, externalAccountId } })`
|
|
55
|
+
call sites. Pass only `externalAccountId`.
|
|
56
|
+
|
|
57
|
+
### Patch Changes
|
|
58
|
+
|
|
59
|
+
- Updated dependencies [57203a4]
|
|
60
|
+
- @capxul/sdk@0.1.0-alpha.8
|
|
61
|
+
|
|
62
|
+
## 0.1.0-alpha.4
|
|
63
|
+
|
|
64
|
+
### Minor Changes
|
|
65
|
+
|
|
66
|
+
- Post-alpha hardening — WAVE 1 + WAVE 2 cumulative
|
|
67
|
+
|
|
68
|
+
**WAVE 1 (merged 2026-05-03 12:44Z):**
|
|
69
|
+
- S2 story 1: wire onboarding readback hooks (#469) — `me.update`, `accounts.retrieve`, `accounts.update`, `useAccount`, `useSafe`
|
|
70
|
+
- S3 phase 1: Ink reference CLI scaffold + `auth+me` end-to-end against live alpha-3 Convex (#470). Stickiness gate (D3) fired.
|
|
71
|
+
- S5: split `CapxulProvider` into public single-input `BrowserCapxulConfig` + test-only `CapxulTestProvider` from `@capxul/sdk-react/proof` (#473). Q1 lock honored. 7 type-level provider-shape guards including `@ts-expect-error` against test-provider leaking to public barrel.
|
|
72
|
+
|
|
73
|
+
**WAVE 2 (merged 2026-05-03 12:54-13:16Z):**
|
|
74
|
+
- S3 phase 2: per-domain CLI commands closing #458 (#476) — `account retrieve/update`, `safe retrieve`, `payment retrieve`, `withdrawal retrieve/list`. 12/12 agent-driver tests pass.
|
|
75
|
+
- S2 story 2: `capxul.tokenTransfers.*` non-canonical SDK namespace (#479) — Option A per #477 (canon-aligned `transfers.*` shape deferred to alpha.5+ pending backend canon work). New `useTokenTransfers` + `useTokenTransfer` hooks; new `getByTxLogIndex` backend query. Hook proof matrix length unchanged at 41 (non-canonical hooks deliberately excluded).
|
|
76
|
+
|
|
77
|
+
**S1 (#456) closed no-op** — alpha publish infrastructure (tsup, lazy-DX, transport state machine, npm metadata, READMEs, CHANGELOG, changesets, OIDC release workflow) physically merged into `api-first` via PRs #449-#452 earlier the same day; the slice merge produced 0 file changes per clean-room probe.
|
|
78
|
+
|
|
79
|
+
**Friction issues filed for alpha.4+ polish:**
|
|
80
|
+
- #474 — `me.get` returns `NOT_IMPLEMENTED` when `config.data` is undefined; should be `NOT_AUTHENTICATED`.
|
|
81
|
+
- #475 — `@capxul/sdk/headless` slim entry point excludes xstate flow machines + brand constructors (1.6 MB → much smaller).
|
|
82
|
+
- #477 / #478 — `transfers.*` / `balanceLedger.*` / `treasury` canon-shape alignment with indexer feed.
|
|
83
|
+
- #471 — Vercel-capxul-web preview-deploy systemic failure on api-first base (separate from epic).
|
|
84
|
+
|
|
85
|
+
### Patch Changes
|
|
86
|
+
|
|
87
|
+
- Updated dependencies
|
|
88
|
+
- @capxul/sdk@0.1.0-alpha.4
|
|
89
|
+
|
|
90
|
+
## 0.1.0-alpha.3
|
|
91
|
+
|
|
92
|
+
### Patch Changes
|
|
93
|
+
|
|
94
|
+
- Re-export `tryCatch` from `@capxul/sdk`.
|
|
95
|
+
|
|
96
|
+
`tryCatch` is referenced in `packages/sdk/README.md` (live on npm at
|
|
97
|
+
`0.1.0-alpha.2`) and in `.claude/rules/sdk.md` as the canonical
|
|
98
|
+
async-error helper for SDK operations:
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
import { tryCatch } from "@capxul/sdk";
|
|
102
|
+
|
|
103
|
+
const [err, payment] = await tryCatch(capxul.payments.create({ ... }));
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
The helper lives at `@repo/observability/try-catch.ts` and is bundled
|
|
107
|
+
into the SDK dist via tsup `noExternal`, but it was never re-exported
|
|
108
|
+
from `packages/sdk/src/index.ts`. Consumers following the README example
|
|
109
|
+
hit `Module '"@capxul/sdk"' has no exported member 'tryCatch'.` at
|
|
110
|
+
import time.
|
|
111
|
+
|
|
112
|
+
Caught during alpha.2 spike-install verification (REVIEW.html, "What's
|
|
113
|
+
not proven" row 6). One-line public-export addition; no runtime change.
|
|
114
|
+
|
|
115
|
+
- Updated dependencies
|
|
116
|
+
- @capxul/sdk@0.1.0-alpha.3
|
|
117
|
+
|
|
118
|
+
## 0.1.0-alpha.2
|
|
119
|
+
|
|
120
|
+
### Patch Changes
|
|
121
|
+
|
|
122
|
+
- Add `convex` as a peer dependency.
|
|
123
|
+
|
|
124
|
+
`@capxul/sdk`'s bundled `_generated/api` snapshot calls
|
|
125
|
+
`anyApi` / `componentsGeneric` from `convex/server` at runtime — they
|
|
126
|
+
are not just types — and tsup correctly externalizes `convex` /
|
|
127
|
+
`convex/server` / `convex/react` so the consumer's own Convex install
|
|
128
|
+
is reused. The peer was missing from the published manifest, so
|
|
129
|
+
`require('@capxul/sdk')` failed with `Cannot find module 'convex/server'`
|
|
130
|
+
in any spike that hadn't already installed `convex`.
|
|
131
|
+
|
|
132
|
+
`@capxul/sdk-react` mirrors the peer because its bundle re-exports
|
|
133
|
+
flow-machine constructors from `@capxul/sdk` and may transitively
|
|
134
|
+
pull in the same module.
|
|
135
|
+
|
|
136
|
+
Caught during alpha.1 spike-install verification.
|
|
137
|
+
|
|
138
|
+
- Updated dependencies
|
|
139
|
+
- @capxul/sdk@0.1.0-alpha.2
|
|
140
|
+
|
|
3
141
|
## 0.1.0-alpha.1
|
|
4
142
|
|
|
5
143
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -40,7 +40,12 @@ import { CapxulProvider } from "@capxul/sdk-react";
|
|
|
40
40
|
|
|
41
41
|
export default function RootLayout({ children }) {
|
|
42
42
|
return (
|
|
43
|
-
<CapxulProvider
|
|
43
|
+
<CapxulProvider
|
|
44
|
+
config={{
|
|
45
|
+
mode: "publishable-key",
|
|
46
|
+
publishableKey: process.env.NEXT_PUBLIC_CAPXUL_PUBLISHABLE_KEY!,
|
|
47
|
+
}}
|
|
48
|
+
>
|
|
44
49
|
{children}
|
|
45
50
|
</CapxulProvider>
|
|
46
51
|
);
|
|
@@ -119,6 +124,21 @@ subscription against the transport singleton — only the components
|
|
|
119
124
|
that actually call it re-render when state changes. The provider
|
|
120
125
|
itself never re-renders.
|
|
121
126
|
|
|
127
|
+
## Publishable-key proof status
|
|
128
|
+
|
|
129
|
+
The publishable-key path is runtime-proven where the repo can run it
|
|
130
|
+
without secrets:
|
|
131
|
+
|
|
132
|
+
| Surface | Runtime proof | Expected safe signal |
|
|
133
|
+
|---|---|---|
|
|
134
|
+
| Provider + `useMe()` | `corepack pnpm --filter @capxul/sdk-react check-types` plus the headless proof tests under `packages/sdk-react/ops/proof` | provider reaches `useCapxulStatus().status === "ready"` after one bootstrap request |
|
|
135
|
+
| Reference CLI mock | `corepack pnpm --filter @capxul/reference-cli build && node apps/reference-cli/dist/cli.js bootstrap probe --mock --json` | `ok:true`, `mode:"publishable-key"`, `bootstrapRequests:1`, `authRequests:1`, `keyLengthClass:"provided"` |
|
|
136
|
+
| Reference CLI live | same command without `--mock`, with `CAPXUL_REF_PUBLISHABLE_KEY` and optional `CAPXUL_REF_BOOTSTRAP_URL` set locally | success only when the key/origin/runtime are valid; otherwise sanitized SDK error JSON |
|
|
137
|
+
|
|
138
|
+
Do not paste or commit publishable keys, session tokens, Convex JWTs,
|
|
139
|
+
cookies, or provider payloads. Proof output reports only
|
|
140
|
+
`keyLengthClass`.
|
|
141
|
+
|
|
122
142
|
## Hooks catalogue
|
|
123
143
|
|
|
124
144
|
| Surface | Hook |
|