@capxul/sdk 2.0.1 → 2.1.0
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/dist/{create-capxul-client-oqLlUkzI.mjs → create-capxul-client-CMUq5w10.mjs} +2846 -2516
- package/dist/{create-capxul-client-BklYjuYQ.d.mts → create-capxul-client-DmV6qEq4.d.mts} +75 -124
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +2 -3
- package/dist/node/index.d.mts +2 -2
- package/dist/node/index.mjs +1 -1
- package/dist/{signer-ZijoFiUs.d.mts → signer-Bj4F-RwT.d.mts} +10 -11
- package/dist/testing/index.d.mts +1 -1
- package/dist/testing/index.mjs +1 -1
- package/package.json +5 -5
|
@@ -31,6 +31,7 @@ interface Failure {
|
|
|
31
31
|
readonly code: CapxulErrorCode;
|
|
32
32
|
readonly message: string;
|
|
33
33
|
readonly mode?: FailureMode;
|
|
34
|
+
readonly error?: CapxulError;
|
|
34
35
|
}
|
|
35
36
|
type CapxulErrorDetails = Record<string, unknown>;
|
|
36
37
|
type CapxulErrorOptions = {
|
|
@@ -154,26 +155,24 @@ declare function toCountryCode(raw: unknown): CountryCode;
|
|
|
154
155
|
//#endregion
|
|
155
156
|
//#region src/ports/auth-cache.d.ts
|
|
156
157
|
/**
|
|
157
|
-
* AuthCachePort
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
* refresh doesn't invalidate the JWT and vice versa.
|
|
158
|
+
* AuthCachePort stores the user session and the cached
|
|
159
|
+
* Convex JWT. The two slots are independent. A session refresh does not
|
|
160
|
+
* invalidate the JWT.
|
|
161
161
|
*
|
|
162
|
-
* Three adapters
|
|
162
|
+
* Three adapters implement this port:
|
|
163
163
|
* - `BrowserAuthCacheAdapter` — backed by `localStorage`
|
|
164
164
|
* - `FileSystemAuthCacheAdapter` — mode-0600 JSON file in `~/.config/capxul/`
|
|
165
165
|
* - `InMemoryAuthCacheAdapter` — for tests
|
|
166
166
|
*
|
|
167
|
-
*
|
|
168
|
-
* persistence now share this cache boundary.
|
|
167
|
+
* Session and JWT persistence share this cache boundary.
|
|
169
168
|
*/
|
|
170
169
|
interface AuthCachePort {
|
|
171
170
|
readonly getSession: Effect.Effect<AuthSession | null, AuthCacheError>;
|
|
172
171
|
readonly setSession: (session: AuthSession) => Effect.Effect<void, AuthCacheError>;
|
|
173
172
|
readonly clearSession: Effect.Effect<void, AuthCacheError>;
|
|
174
173
|
/**
|
|
175
|
-
* JWT cache for the `/api/auth/convex/token` bridge endpoint
|
|
176
|
-
* Stored separately from the session so a session refresh
|
|
174
|
+
* JWT cache for the `/api/auth/convex/token` bridge endpoint.
|
|
175
|
+
* Stored separately from the session so a session refresh does not
|
|
177
176
|
* invalidate cached JWT.
|
|
178
177
|
*/
|
|
179
178
|
readonly getJwt: Effect.Effect<CachedJwt | null, AuthCacheError>;
|
|
@@ -181,9 +180,9 @@ interface AuthCachePort {
|
|
|
181
180
|
readonly clearJwt: Effect.Effect<void, AuthCacheError>;
|
|
182
181
|
}
|
|
183
182
|
/**
|
|
184
|
-
* Cached Convex JWT shape
|
|
183
|
+
* Cached Convex JWT shape. `expEpochSeconds` is decoded from the JWT's
|
|
185
184
|
* `exp` claim at fetch time so the `tokenProvider` cache eviction logic can
|
|
186
|
-
*
|
|
185
|
+
* refresh at `exp - 30s`.
|
|
187
186
|
*/
|
|
188
187
|
interface CachedJwt {
|
|
189
188
|
readonly token: JwtToken;
|
package/dist/testing/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cn as TelemetryGroupInput, ln as TelemetryIdentifyInput, sn as TelemetryEvent, t as CapxulClient, yn as IdentityTransition } from "../create-capxul-client-DmV6qEq4.mjs";
|
|
2
2
|
import { Effect, Layer } from "effect";
|
|
3
3
|
|
|
4
4
|
//#region src/testing/telemetry/RecordingTelemetryAdapter.d.ts
|
package/dist/testing/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as bootstrapErrorFromCapxul, G as deriveCapxulSafeAddress, O as toWei, _ as identityErrorFromCapxul, f as smartAccountErrorFromCapxul, h as wireChainId, k as fromWei, m as accountReadErrorFromCapxul, t as assembleCapxulClient, u as redactTelemetryEvent, w as authClientPortFromPromiseAdapter, y as convexCallErrorFromCapxul } from "../create-capxul-client-CMUq5w10.mjs";
|
|
2
2
|
import { A as toSessionToken, C as toEpochMs, E as toKycTier, M as CapxulError, O as toPublishableKey, P as Errors, S as toEmail, T as toJwtToken, _ as toAuthUserId, g as toAppId, h as toAllowedOrigin, m as toAddress, p as toAccountId, t as InMemoryAuthCacheAdapter, v as toChainId, w as toEpochSeconds, x as toDurationMs, y as toCountryCode } from "../InMemoryAuthCacheAdapter-Rc8tCtml.mjs";
|
|
3
3
|
import { keccak256 } from "viem";
|
|
4
4
|
import { Effect, Result, Semaphore } from "effect";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capxul/sdk",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/Xelmar-tech/infrastructure.git",
|
|
@@ -42,16 +42,16 @@
|
|
|
42
42
|
"@vitest/coverage-v8": "4.1.7",
|
|
43
43
|
"fast-check": "^3.23.2",
|
|
44
44
|
"permissionless": "0.3.4",
|
|
45
|
-
"posthog-js": "^1.
|
|
45
|
+
"posthog-js": "^1.418.10",
|
|
46
46
|
"typescript": "npm:@typescript/typescript6@6.0.2",
|
|
47
47
|
"vite-plus": "0.1.23",
|
|
48
48
|
"vitest": "npm:@voidzero-dev/vite-plus-test@0.1.23",
|
|
49
49
|
"@capxul/config": "0.1.1",
|
|
50
50
|
"@capxul/errors": "0.0.1",
|
|
51
51
|
"@capxul/typescript-config": "0.0.0",
|
|
52
|
-
"@capxul/
|
|
53
|
-
"@capxul/wire": "0.
|
|
54
|
-
"@capxul/
|
|
52
|
+
"@capxul/types": "0.1.0",
|
|
53
|
+
"@capxul/wire": "0.2.0",
|
|
54
|
+
"@capxul/observability": "2.1.0"
|
|
55
55
|
},
|
|
56
56
|
"_permissionlessPinReason": "permissionless.toSafeSmartAccount is pinned to 0.3.4 for live Safe deployment E2E. Counterfactual address fixtures captured 2026-05-17 in packages/backend/convex/_shared/__tests__/counterfactual.test.ts and packages/config/tests/safe.test.ts must be re-verified before upgrading.",
|
|
57
57
|
"scripts": {
|