@capxul/sdk 2.8.0 → 2.8.2
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/{InMemoryAuthCacheAdapter-FptQ2p7C.mjs → InMemoryAuthCacheAdapter-BrEN-men.mjs} +56 -5
- package/dist/{create-capxul-client-YSN2yN8m.mjs → create-capxul-client-BKJHefmA.mjs} +361 -434
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +641 -27
- package/dist/node/index.d.mts +1 -1
- package/dist/node/index.mjs +1 -1
- package/dist/{observation-YhuU8yQX.d.mts → observation-D-oCDlMS.d.mts} +32 -3
- package/dist/{signer-xGhV5Q7i.d.mts → signer-BdDgF200.d.mts} +24 -1
- package/dist/testing/index.d.mts +1 -1
- package/dist/testing/index.mjs +2 -2
- package/package.json +5 -5
package/dist/node/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { O as AuthSession, _ as AuthCacheError, b as CachedJwt, n as CapxulSigner, v as AuthCachePort, y as AuthCachePortTag } from "../signer-
|
|
1
|
+
import { O as AuthSession, _ as AuthCacheError, b as CachedJwt, n as CapxulSigner, v as AuthCachePort, y as AuthCachePortTag } from "../signer-BdDgF200.mjs";
|
|
2
2
|
import { Hex } from "viem";
|
|
3
3
|
import { Effect, FileSystem, Layer, Path } from "effect";
|
|
4
4
|
//#region src/adapters/auth-cache/FileSystemAuthCacheAdapter.d.ts
|
package/dist/node/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as AuthCacheError, h as toAddress, i as parseCachedJwt, n as BrowserAuthCacheAdapter, o as AuthCachePortTag, r as parseAuthSession, t as InMemoryAuthCacheAdapter } from "../InMemoryAuthCacheAdapter-
|
|
1
|
+
import { a as AuthCacheError, h as toAddress, i as parseCachedJwt, n as BrowserAuthCacheAdapter, o as AuthCachePortTag, r as parseAuthSession, t as InMemoryAuthCacheAdapter } from "../InMemoryAuthCacheAdapter-BrEN-men.mjs";
|
|
2
2
|
import { Effect, FileSystem, Layer, Path } from "effect";
|
|
3
3
|
import { privateKeyToAccount } from "viem/accounts";
|
|
4
4
|
import * as os from "node:os";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as WeiAmount, A as BlockNumber, B as OrgId, C as Address$1, D as AppId, E as AnonymousDistinctId, F as DocumentHash, G as PermissionAssignmentId, H as PaymentCommandId, I as DurationMs, J as PublishableKey, K as PermissionId, L as Email, M as ChainId, N as CountryCode, O as AuthSession, P as CurrencyCode, Q as TxHash, R as EpochMs, T as AllowedOrigin, U as PayrollGroupId, V as PartyId, W as PayrollRunId, X as SessionToken, Y as RoleKey, Z as SmartAccount, a as SignerStatusStore, at as CapxulErrorDetails, b as CachedJwt, c as AccountProviderSource, g as SmartAccount$1, h as Session$1, it as CapxulErrorCode, j as BudgetId, k as AuthUserId, l as AccountRequirement, m as Profile$1, n as CapxulSigner, p as CapxulResult, pt as FailureMode, q as Profile, rt as CapxulError, st as Failure, v as AuthCachePort, w as AllowanceKey, x as Account$1, z as Money } from "./signer-
|
|
1
|
+
import { $ as WeiAmount, A as BlockNumber, B as OrgId, C as Address$1, D as AppId, E as AnonymousDistinctId, F as DocumentHash, G as PermissionAssignmentId, H as PaymentCommandId, I as DurationMs, J as PublishableKey, K as PermissionId, L as Email, M as ChainId, N as CountryCode, O as AuthSession, P as CurrencyCode, Q as TxHash, R as EpochMs, T as AllowedOrigin, U as PayrollGroupId, V as PartyId, W as PayrollRunId, X as SessionToken, Y as RoleKey, Z as SmartAccount, a as SignerStatusStore, at as CapxulErrorDetails, b as CachedJwt, c as AccountProviderSource, g as SmartAccount$1, h as Session$1, it as CapxulErrorCode, j as BudgetId, k as AuthUserId, l as AccountRequirement, m as Profile$1, n as CapxulSigner, p as CapxulResult, pt as FailureMode, q as Profile, rt as CapxulError, st as Failure, v as AuthCachePort, w as AllowanceKey, x as Account$1, z as Money } from "./signer-BdDgF200.mjs";
|
|
2
2
|
import { Address, Hex } from "viem";
|
|
3
3
|
import { Context, Effect, Layer, Schema, Scope, Tracer } from "effect";
|
|
4
4
|
import { FunctionReference } from "convex/server";
|
|
@@ -719,6 +719,20 @@ type Snapshot<T, E = CapxulError> = {
|
|
|
719
719
|
readonly status: "error";
|
|
720
720
|
readonly error: E;
|
|
721
721
|
};
|
|
722
|
+
type ConvexTransportFailure = {
|
|
723
|
+
readonly kind: "connection-lost-in-flight";
|
|
724
|
+
readonly connection_id: string;
|
|
725
|
+
readonly start_connection_count: number;
|
|
726
|
+
readonly connection_count: number;
|
|
727
|
+
readonly connection_retries?: number;
|
|
728
|
+
readonly close_code?: number;
|
|
729
|
+
readonly close_was_clean?: boolean;
|
|
730
|
+
readonly close_reason_present?: boolean;
|
|
731
|
+
readonly document_visibility?: string;
|
|
732
|
+
readonly navigator_online?: boolean;
|
|
733
|
+
readonly last_browser_event?: "visibility-visible" | "visibility-hidden" | "pagehide" | "pageshow" | "online" | "offline";
|
|
734
|
+
readonly ms_since_browser_event?: number;
|
|
735
|
+
};
|
|
722
736
|
declare const ConvexCallError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
723
737
|
readonly _tag: "ConvexCallError";
|
|
724
738
|
} & Readonly<A>;
|
|
@@ -728,6 +742,7 @@ declare class ConvexCallError extends ConvexCallError_base<{
|
|
|
728
742
|
readonly publicError: CapxulError;
|
|
729
743
|
readonly cause: unknown;
|
|
730
744
|
readonly details?: CapxulErrorDetails;
|
|
745
|
+
readonly transport?: ConvexTransportFailure;
|
|
731
746
|
}> {}
|
|
732
747
|
interface ConvexCallPort {
|
|
733
748
|
query<TArgs extends Record<string, unknown>, TOutput>(fn: FunctionReference<"query", "public", TArgs, TOutput>, args: TArgs): Effect.Effect<TOutput, ConvexCallError>;
|
|
@@ -2776,16 +2791,30 @@ interface SdkFailureObservation {
|
|
|
2776
2791
|
/**
|
|
2777
2792
|
* The PII-safe subset of `CapxulError.details`, already in PostHog property
|
|
2778
2793
|
* shape. `provider` + `provider_operation` name the failing dependency
|
|
2779
|
-
* (`convex bootstrap`, `openfort configure`)
|
|
2780
|
-
*
|
|
2794
|
+
* (`convex bootstrap`, `openfort configure`). `provider_error_source` names
|
|
2795
|
+
* the owner of an allow-listed `provider_error_code`. `failure_mode` / `reason`
|
|
2796
|
+
* are enumerated codes. `http_status` is the upstream status. Anything else on
|
|
2781
2797
|
* `details` (ids, field names, free text) is dropped at the boundary.
|
|
2782
2798
|
*/
|
|
2783
2799
|
interface SdkFailureDetail {
|
|
2784
2800
|
readonly provider?: string;
|
|
2785
2801
|
readonly provider_operation?: string;
|
|
2802
|
+
readonly provider_error_source?: string;
|
|
2803
|
+
readonly provider_error_code?: string;
|
|
2804
|
+
readonly target_host?: string;
|
|
2786
2805
|
readonly failure_mode?: string;
|
|
2787
2806
|
readonly reason?: string;
|
|
2788
2807
|
readonly http_status?: number;
|
|
2808
|
+
readonly connection_id?: string;
|
|
2809
|
+
readonly connection_count?: number;
|
|
2810
|
+
readonly connection_retries?: number;
|
|
2811
|
+
readonly close_code?: number;
|
|
2812
|
+
readonly close_was_clean?: boolean;
|
|
2813
|
+
readonly close_reason_present?: boolean;
|
|
2814
|
+
readonly document_visibility?: string;
|
|
2815
|
+
readonly navigator_online?: boolean;
|
|
2816
|
+
readonly last_browser_event?: string;
|
|
2817
|
+
readonly ms_since_browser_event?: number;
|
|
2789
2818
|
/** ADR-0023 R7: the chain cause, flat, same keys as every other producer. */
|
|
2790
2819
|
readonly chain_upstream?: string;
|
|
2791
2820
|
readonly chain_method?: string;
|
|
@@ -17,6 +17,8 @@ declare const FAILURE_MODES: readonly [
|
|
|
17
17
|
"app-env-allowlist",
|
|
18
18
|
/** Sandboxed/headless browser with no Web Crypto. */
|
|
19
19
|
"no-secure-context",
|
|
20
|
+
/** The embedded wallet lost its configured signer state. */
|
|
21
|
+
"signer-not-ready",
|
|
20
22
|
/** One upstream answered HTTP 429 or JSON-RPC -32005. Retryable. */
|
|
21
23
|
"rate-limited",
|
|
22
24
|
/** No answer inside the budget. Retryable. */
|
|
@@ -104,6 +106,22 @@ declare class CapxulError extends Error {
|
|
|
104
106
|
constructor(code: CapxulErrorCode, message: string, options?: CapxulErrorOptions);
|
|
105
107
|
}
|
|
106
108
|
declare function isCapxulError(value: unknown): value is CapxulError;
|
|
109
|
+
type NetworkErrorOptions = {
|
|
110
|
+
readonly provider?: string;
|
|
111
|
+
readonly target_host?: string;
|
|
112
|
+
readonly failure_mode?: FailureMode;
|
|
113
|
+
readonly reason?: "connection-lost-in-flight";
|
|
114
|
+
readonly connection_id?: string;
|
|
115
|
+
readonly connection_count?: number;
|
|
116
|
+
readonly connection_retries?: number;
|
|
117
|
+
readonly close_code?: number;
|
|
118
|
+
readonly close_was_clean?: boolean;
|
|
119
|
+
readonly close_reason_present?: boolean;
|
|
120
|
+
readonly document_visibility?: string;
|
|
121
|
+
readonly navigator_online?: boolean;
|
|
122
|
+
readonly last_browser_event?: string;
|
|
123
|
+
readonly ms_since_browser_event?: number;
|
|
124
|
+
};
|
|
107
125
|
declare const Errors: {
|
|
108
126
|
readonly notAuthenticated: (message?: string, opts?: {
|
|
109
127
|
readonly failure_mode?: FailureMode;
|
|
@@ -182,7 +200,7 @@ declare const Errors: {
|
|
|
182
200
|
readonly retryAfterMs?: number;
|
|
183
201
|
readonly resource?: string;
|
|
184
202
|
}) => CapxulError;
|
|
185
|
-
readonly networkError: (operation: string, cause?: unknown) => CapxulError;
|
|
203
|
+
readonly networkError: (operation: string, cause?: unknown, opts?: NetworkErrorOptions) => CapxulError;
|
|
186
204
|
readonly unknown: (cause?: unknown) => CapxulError;
|
|
187
205
|
readonly otpExpired: (details?: {
|
|
188
206
|
readonly email?: string;
|
|
@@ -193,6 +211,11 @@ declare const Errors: {
|
|
|
193
211
|
readonly reason?: string;
|
|
194
212
|
readonly cause?: unknown;
|
|
195
213
|
}) => CapxulError;
|
|
214
|
+
readonly superseded: (details: {
|
|
215
|
+
readonly operation: string;
|
|
216
|
+
readonly reason: string;
|
|
217
|
+
readonly executionId?: string;
|
|
218
|
+
}) => CapxulError;
|
|
196
219
|
readonly cancelled: (details?: {
|
|
197
220
|
readonly operation?: string;
|
|
198
221
|
readonly reason?: string;
|
package/dist/testing/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Jn as TelemetryGroupInput, Yn as TelemetryIdentifyInput, n as ObservationAdapter, or as IdentityTransition, qn as TelemetryEvent, u as CapxulClient } from "../observation-
|
|
1
|
+
import { Jn as TelemetryGroupInput, Yn as TelemetryIdentifyInput, n as ObservationAdapter, or as IdentityTransition, qn as TelemetryEvent, u as CapxulClient } from "../observation-D-oCDlMS.mjs";
|
|
2
2
|
import { Effect, Layer } from "effect";
|
|
3
3
|
//#region src/testing/telemetry/RecordingTelemetryAdapter.d.ts
|
|
4
4
|
type RecordingTelemetryOperation = {
|
package/dist/testing/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { B as Errors, C as toDurationMs, D as toJwtToken, E as toEpochSeconds, F as toSessionToken, N as toPublishableKey, O as toKycTier, R as CapxulError, T as toEpochMs, _ as toAppId, b as toChainId, g as toAllowedOrigin, h as toAddress, m as toAccountId, t as InMemoryAuthCacheAdapter, v as toAuthUserId, w as toEmail, x as toCountryCode } from "../InMemoryAuthCacheAdapter-
|
|
1
|
+
import { B as fromWei, E as toWei, S as authClientPortFromPromiseAdapter, _ as convexCallErrorFromCapxul, c as redactTelemetryEvent, ct as deriveCapxulSafeAddress, h as identityErrorFromCapxul, i as smartAccountErrorFromCapxul, o as accountReadErrorFromCapxul, p as wireChainId, t as assembleCapxulClient, x as bootstrapErrorFromCapxul } from "../create-capxul-client-BKJHefmA.mjs";
|
|
2
|
+
import { B as Errors, C as toDurationMs, D as toJwtToken, E as toEpochSeconds, F as toSessionToken, N as toPublishableKey, O as toKycTier, R as CapxulError, T as toEpochMs, _ as toAppId, b as toChainId, g as toAllowedOrigin, h as toAddress, m as toAccountId, t as InMemoryAuthCacheAdapter, v as toAuthUserId, w as toEmail, x as toCountryCode } from "../InMemoryAuthCacheAdapter-BrEN-men.mjs";
|
|
3
3
|
import { keccak256 } from "viem";
|
|
4
4
|
import { Effect, Result, Semaphore } from "effect";
|
|
5
5
|
import { getFunctionName } from "convex/server";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capxul/sdk",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/Xelmar-tech/infrastructure.git",
|
|
@@ -47,12 +47,12 @@
|
|
|
47
47
|
"vite": "npm:@voidzero-dev/vite-plus-core@0.3.0",
|
|
48
48
|
"vite-plus": "0.3.0",
|
|
49
49
|
"vitest": "4.1.11",
|
|
50
|
-
"@capxul/types": "0.2.1",
|
|
51
50
|
"@capxul/errors": "0.0.2",
|
|
51
|
+
"@capxul/observability": "2.8.2",
|
|
52
|
+
"@capxul/types": "0.2.1",
|
|
53
|
+
"@capxul/config": "0.2.1",
|
|
52
54
|
"@capxul/wire": "0.5.1",
|
|
53
|
-
"@capxul/typescript-config": "0.0.0"
|
|
54
|
-
"@capxul/observability": "2.8.0",
|
|
55
|
-
"@capxul/config": "0.2.1"
|
|
55
|
+
"@capxul/typescript-config": "0.0.0"
|
|
56
56
|
},
|
|
57
57
|
"_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.",
|
|
58
58
|
"scripts": {
|