@capxul/sdk 2.0.2 → 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-DZh_Ymsf.mjs → create-capxul-client-CMUq5w10.mjs} +2844 -2529
- package/dist/{create-capxul-client-BixUOzdC.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-CeH3ULzn.d.mts → signer-Bj4F-RwT.d.mts} +9 -11
- package/dist/testing/index.d.mts +1 -1
- package/dist/testing/index.mjs +1 -1
- package/package.json +4 -4
|
@@ -155,26 +155,24 @@ declare function toCountryCode(raw: unknown): CountryCode;
|
|
|
155
155
|
//#endregion
|
|
156
156
|
//#region src/ports/auth-cache.d.ts
|
|
157
157
|
/**
|
|
158
|
-
* AuthCachePort
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
* 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.
|
|
162
161
|
*
|
|
163
|
-
* Three adapters
|
|
162
|
+
* Three adapters implement this port:
|
|
164
163
|
* - `BrowserAuthCacheAdapter` — backed by `localStorage`
|
|
165
164
|
* - `FileSystemAuthCacheAdapter` — mode-0600 JSON file in `~/.config/capxul/`
|
|
166
165
|
* - `InMemoryAuthCacheAdapter` — for tests
|
|
167
166
|
*
|
|
168
|
-
*
|
|
169
|
-
* persistence now share this cache boundary.
|
|
167
|
+
* Session and JWT persistence share this cache boundary.
|
|
170
168
|
*/
|
|
171
169
|
interface AuthCachePort {
|
|
172
170
|
readonly getSession: Effect.Effect<AuthSession | null, AuthCacheError>;
|
|
173
171
|
readonly setSession: (session: AuthSession) => Effect.Effect<void, AuthCacheError>;
|
|
174
172
|
readonly clearSession: Effect.Effect<void, AuthCacheError>;
|
|
175
173
|
/**
|
|
176
|
-
* JWT cache for the `/api/auth/convex/token` bridge endpoint
|
|
177
|
-
* 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
|
|
178
176
|
* invalidate cached JWT.
|
|
179
177
|
*/
|
|
180
178
|
readonly getJwt: Effect.Effect<CachedJwt | null, AuthCacheError>;
|
|
@@ -182,9 +180,9 @@ interface AuthCachePort {
|
|
|
182
180
|
readonly clearJwt: Effect.Effect<void, AuthCacheError>;
|
|
183
181
|
}
|
|
184
182
|
/**
|
|
185
|
-
* Cached Convex JWT shape
|
|
183
|
+
* Cached Convex JWT shape. `expEpochSeconds` is decoded from the JWT's
|
|
186
184
|
* `exp` claim at fetch time so the `tokenProvider` cache eviction logic can
|
|
187
|
-
*
|
|
185
|
+
* refresh at `exp - 30s`.
|
|
188
186
|
*/
|
|
189
187
|
interface CachedJwt {
|
|
190
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
|
-
"@capxul/observability": "2.0.2",
|
|
52
51
|
"@capxul/typescript-config": "0.0.0",
|
|
53
52
|
"@capxul/types": "0.1.0",
|
|
54
|
-
"@capxul/wire": "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": {
|