@capxul/sdk 2.8.2 → 3.0.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/OAuthBearerAuthClient-BxTiv8dg.d.mts +19 -0
- package/dist/OAuthBearerAuthClient-DfS4QOg7.mjs +211 -0
- package/dist/{InMemoryAuthCacheAdapter-BrEN-men.mjs → clock-m_aHLaNm.mjs} +1111 -14
- package/dist/{create-capxul-client-BKJHefmA.mjs → create-capxul-client-Ch_pfcoR.mjs} +114 -1016
- package/dist/index.d.mts +3 -2
- package/dist/index.mjs +7 -23
- package/dist/node/index.d.mts +3 -2
- package/dist/node/index.mjs +3 -2
- package/dist/{observation-D-oCDlMS.d.mts → observation-B3PCugGC.d.mts} +14 -65
- package/dist/{signer-BdDgF200.d.mts → signer-BpjdawiY.d.mts} +87 -3
- package/dist/testing/index.d.mts +1 -1
- package/dist/testing/index.mjs +2 -22
- package/package.json +7 -7
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { $ as OrganizationPaymentsMethods, $n as
|
|
1
|
+
import { $ as RoleKey, D as Address, E as AccountId, F as BudgetId, G as PartyId, J as PayrollRunId, L as CountryCode, M as AuthSession, N as AuthUserId, T as Account, U as Money, W as OrgId, _t as FailureMode, a as SignerStatusStore, at as toCountryCode, c as AccountProviderSource, ct as CapxulErrorCode, d as eip1193AccountProvider, f as localPrivateKeyAccountProvider, ft as isCapxulError, g as SmartAccount, gt as FAILURE_MODES, h as Session, ht as ChainUpstream, i as SignerStatus, it as toAddress, l as AccountRequirement, lt as CapxulErrorDetails, m as Profile, mt as ChainCause, n as CapxulSigner, o as injectedWalletSigner, ot as CAPXUL_ERROR_CODES, p as CapxulResult, pt as CHAIN_UPSTREAMS, q as PayrollGroupId, r as Eip1193RequestProvider, s as AccountProvider, st as CapxulError, t as CapxulDigestSigner, u as Eip1193Provider, ut as Errors, vt as RevertSummary, w as CAPXUL_PAYMENTS_V2_ADDRESS } from "./signer-BpjdawiY.mjs";
|
|
2
|
+
import { $ as OrganizationPaymentsMethods, $n as OrgLane, $t as MeMethods, A as OrgView, An as AccountSetupStep, At as ActivityFilter, B as PayrollGroupInput, Bn as SubmittedPermissionExecution, Bt as ActivitySummaryTotal, C as DetectPendingOrgInvitationsResult, Cn as RecipientResolutionKind, Ct as AddressBookMethods, D as OrgMethods, Dn as TargetsMethods, Dt as ActivityAnnotation, E as MemberView, En as TargetReference, Et as InboxMethods, F as RoleSpendCap, Fn as OrgLifecycle, Ft as ActivityPage, G as PayrollRun, Gn as RequestStatus, Gt as DestinationKind, H as PayrollGroupsMethods, Hn as PAYMENT_DIRECTIONS, Ht as DepositInstructions, I as RoleView, In as OrgSetupStep, It as ActivityRange, J as PayrollRuns, Jt as DestinationRail, K as PayrollRunItemInput, Kt as DestinationListInput, L as AuthorizeRunInput, Ln as ActorRef, Lt as ActivityReference, M as OrganizationAuditLogItem, Mn as IdentityMethods, Mt as ActivityKind, N as ResendInviteTokenInput, Nn as SmartAccountMethods, Nt as ActivityListParams, O as OrgScopedMethods, On as fingerprintPaymentIntent, Ot as ActivityAnnotationInput, P as RoleDefinition, Pn as AuthMethods, Pt as ActivityMethods, Q as OrganizationPaymentItemInput, Qn as IdentityState, Qt as HandlesMethods, R as PayrollEngagementTerms, Rn as CurrentHoldings, Rt as ActivitySummary, S as CreateOrgInput, Sn as RecipientResolution, St as AddressBookLabelInput, T as MemberStatus, Tn as ResolvedTarget, Tt as InboxItem, U as PayrollMethods, Un as PAYMENT_STATUSES, Ut as Destination, V as PayrollGroupMember, Vn as InboxStatus, Vt as ActorReference, W as PayrollOptions, Wn as PaymentStatus$1, Wt as DestinationAddInput, X as OrganizationPaymentBatchInput, Xn as Destination$1, Xt as DestinationsMethods, Y as PayrollTermsUnit, Yn as TelemetryPort, Yt as DestinationRemoveInput, Z as OrganizationPaymentInput, Zn as IdentityEvent, Zt as FinancialOpsMethods, _ as SystemMethods, _n as PaymentStatus, _t as ActorRequest, a as SdkFailureObservation, an as OfframpStatus, ar as IdentityTransition, at as PermissionReplaceInput, b as CurrentUserContext, bn as PaymentsMethods, bt as AddressBookAddInput, c as PostHogObservabilityOptions, cn as Payment, ct as Budget, d as CreateCapxulClientInput, dn as PaymentDocumentKind, dt as OrgMeOptions, en as MeProfile, er as Readiness, et as PermissionAssignInput, f as IdentityProfileDetails, fn as PaymentDocumentRef, ft as AccountsMethods, g as Holding, gn as PaymentMoney, gt as ActorRelationshipMethods, h as HoldingsMethods, hn as PaymentDocumentsMethods, ht as ActorProfileMethods, i as ObservationDelivery, in as OfframpQuoteInput, ir as isRestoring, it as PermissionOptions, j as OrganizationAccount, jn as isSettingUpLifecycle, jt as ActivityItem, k as OrgTemplate, kn as AccountLifecycle, kt as ActivityDetail, l as postHogObservability, ln as PaymentActivityEvidence, lt as OrgMe, m as IdentityRuntimeSendResult, mn as PaymentDocumentVerification, mt as ActorProfile, n as ObservationAdapter, nn as OfframpMethods, nr as destination, nt as PermissionCreateInput, o as HostObservability, on as Payee, or as InvocationControls, ot as PermissionRevokeInput, p as IdentityRuntime, pn as PaymentDocumentRender, pt as AccountMethods, q as PayrollRunStatus, qt as DestinationPayload, r as ObservationContext, rn as OfframpQuote, rr as isClaimed, rt as PermissionMethods, s as PostHogObservabilityClient, sn as PayeesMethods, st as PermissionReadResult, t as CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, tn as MovementActivityEvidence, tr as StateLabel, tt as PermissionChangeInput, u as CapxulClient, un as PaymentDirection, ut as OrgMeMethod, v as SystemHealth, vn as PaymentTiming, vt as ActorRequestIssueInput, w as InviteMemberInput, wn as Ref, wt as InboxApproveInput, x as CurrentUserMethods, xn as PaymentsPayInput, xt as AddressBookEntry, y as MediaMethods, yn as PaymentType, yt as ActorRequestsMethods, z as PayrollGroup, zn as Permission, zt as ActivitySummaryParams } from "./observation-B3PCugGC.mjs";
|
|
3
|
+
import "./OAuthBearerAuthClient-BxTiv8dg.mjs";
|
|
3
4
|
import { Hex } from "viem";
|
|
4
5
|
import { Context, Effect, Layer } from "effect";
|
|
5
6
|
import { FunctionReference } from "convex/server";
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import {
|
|
1
|
+
import { $ as EngineeringTelemetryBootstrapPolicy, A as normalizeExceptionErrorKind, B as isSignerNotReadySignal, C as failureDetail, D as postHogFailureObservation, E as observeFailedResult, F as fromWei, G as readInvocationObservation, H as signerFailure, I as isSettingUpLifecycle, J as sanitizeObservationContext, K as OBSERVATION_CONTEXT_HEADER, L as formatTraceparent, M as projectSdkException, N as safeExceptionLabel, O as EXCEPTION_MESSAGE, P as version, Q as BootstrapEnvelope, R as causeChain, S as CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, T as observationContextProps, U as resolveFailureMode, V as openfortSignerNotReadyCode, W as copyInvocationObservation, X as PAYMENT_STATUSES, Y as PAYMENT_DIRECTIONS, Z as CAPXUL_FUNCTIONS, _ as convexCallErrorFromCapxul, a as AccountReadPortTag, b as fingerprintPaymentIntent, d as retryIdempotentRead, et as destination, f as PRODUCT_INVOCATION, g as ConvexCallPortTag, h as identityErrorFromCapxul, i as smartAccountErrorFromCapxul, j as normalizeExceptionOperation, k as SDK_VERSION$1, l as redactTelemetryProps, m as IdentityPortTag, n as detectAuthCacheAdapter, nt as isRestoring, o as accountReadErrorFromCapxul, p as wireChainId, q as encodeObservationContextHeader, r as SmartAccountPortTag, s as TelemetryPortTag, t as assembleCapxulClient, tt as isClaimed, u as stampTelemetryEnvelope, v as BootstrapPortTag, w as failureEvidenceProps, x as toWei, y as bootstrapErrorFromCapxul, z as injectedWalletSigner } from "./create-capxul-client-Ch_pfcoR.mjs";
|
|
2
|
+
import { $ as CHAIN_UPSTREAMS, B as toOrgId, D as toAllowedOrigin, E as toAddress, F as toEmail, G as toRoleKey, I as toEpochMs, J as CAPXUL_ERROR_CODES, K as toSessionToken, L as toEpochSeconds, M as toCountryCode, N as toCurrencyCode, P as toDurationMs, Q as isCapxulError, R as toJwtToken, T as toAccountId, W as toPublishableKey, Y as CapxulError, Z as Errors, d as AuthClientError, et as FAILURE_MODES, f as AuthClientPortTag, g as BASE_SEPOLIA_CHAIN_ID, h as normalizeBindingEmail, j as toChainId, k as toAuthUserId, l as ClockPortTag, m as CAPXUL_PAYMENTS_V2_ADDRESS, q as decodeConvexError, s as AuthCachePortTag, u as authClientPortFromPromiseAdapter, w as currencySymbolFor, z as toKycTier } from "./clock-m_aHLaNm.mjs";
|
|
3
|
+
import { n as SystemClockLayer } from "./OAuthBearerAuthClient-DfS4QOg7.mjs";
|
|
3
4
|
import { keccak256, recoverAddress, stringToHex } from "viem";
|
|
4
5
|
import { Cause, Context, Data, Duration, Effect, Exit, Layer, Result, Schedule, SchemaIssue, SchemaParser, Scope, Tracer } from "effect";
|
|
5
6
|
import { getFunctionName, makeFunctionReference } from "convex/server";
|
|
@@ -1412,26 +1413,6 @@ function normalizeRuntimeUrl(field, raw) {
|
|
|
1412
1413
|
return parsed.toString().replace(/\/$/, "");
|
|
1413
1414
|
}
|
|
1414
1415
|
//#endregion
|
|
1415
|
-
//#region src/adapters/clock/SystemClockAdapter.ts
|
|
1416
|
-
var SystemClockAdapter = class {
|
|
1417
|
-
now = Effect.try({
|
|
1418
|
-
try: () => toEpochMs(Date.now()),
|
|
1419
|
-
catch: (cause) => new ClockError({
|
|
1420
|
-
operation: "now",
|
|
1421
|
-
cause
|
|
1422
|
-
})
|
|
1423
|
-
});
|
|
1424
|
-
sleep(duration) {
|
|
1425
|
-
return Effect.callback((resume) => {
|
|
1426
|
-
const timeout = setTimeout(() => resume(Effect.void), duration);
|
|
1427
|
-
return Effect.sync(() => clearTimeout(timeout));
|
|
1428
|
-
});
|
|
1429
|
-
}
|
|
1430
|
-
};
|
|
1431
|
-
function SystemClockLayer() {
|
|
1432
|
-
return Layer.succeed(ClockPortTag, new SystemClockAdapter());
|
|
1433
|
-
}
|
|
1434
|
-
//#endregion
|
|
1435
1416
|
//#region src/adapters/convex-call/convex-connection-monitor.ts
|
|
1436
1417
|
var ConvexConnectionMonitor = class {
|
|
1437
1418
|
#connectionId = makeConnectionId();
|
|
@@ -3198,7 +3179,7 @@ function productionBootstrapPortLayer(bootstrap) {
|
|
|
3198
3179
|
return Layer.succeed(BootstrapPortTag, bootstrap);
|
|
3199
3180
|
}
|
|
3200
3181
|
function productionAuthClientLayer(input, refreshConvexAuthRef, resetSignerSessionRef) {
|
|
3201
|
-
return (input.runtime === "browser" ? BetterAuthBrowserLayer({
|
|
3182
|
+
return (input.authClient !== void 0 ? Layer.succeed(AuthClientPortTag, input.authClient) : input.runtime === "browser" ? BetterAuthBrowserLayer({
|
|
3202
3183
|
authBaseUrl: input.runtimeUrls.authBaseUrl,
|
|
3203
3184
|
...input.fetch === void 0 ? {} : { fetch: input.fetch },
|
|
3204
3185
|
...input.observation === void 0 ? {} : { observation: input.observation }
|
|
@@ -3339,6 +3320,7 @@ async function createProductionAdapters(input) {
|
|
|
3339
3320
|
applicationId: bootstrapResult.value.applicationId,
|
|
3340
3321
|
...observation === void 0 ? {} : { observation },
|
|
3341
3322
|
...input.authCache === void 0 ? {} : { authCache: input.authCache },
|
|
3323
|
+
...input.authClient === void 0 ? {} : { authClient: input.authClient },
|
|
3342
3324
|
...telemetry === void 0 ? {} : { telemetry },
|
|
3343
3325
|
...injectedClient === void 0 ? {} : { convexClient: injectedClient },
|
|
3344
3326
|
...input.fetch === void 0 ? {} : { fetch: input.fetch },
|
|
@@ -3793,6 +3775,8 @@ function captureException(telemetry, error, context) {
|
|
|
3793
3775
|
issueDescription: detail.reason ?? failureMode,
|
|
3794
3776
|
...detail.chain_upstream === void 0 ? {} : { chainUpstream: detail.chain_upstream },
|
|
3795
3777
|
...detail.chain_method === void 0 ? {} : { chainMethod: detail.chain_method },
|
|
3778
|
+
...detail.chain_http_status === void 0 ? {} : { chainHttpStatus: detail.chain_http_status },
|
|
3779
|
+
...detail.chain_rpc_code === void 0 ? {} : { chainRpcCode: detail.chain_rpc_code },
|
|
3796
3780
|
exceptionList: buildExceptionList({
|
|
3797
3781
|
type: errorCode,
|
|
3798
3782
|
value: EXCEPTION_MESSAGE,
|
package/dist/node/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as CachedJwt, M as AuthSession, S as AuthCachePortTag, b as AuthCacheError, n as CapxulSigner, x as AuthCachePort } from "../signer-BpjdawiY.mjs";
|
|
2
|
+
import { n as oauthBearerAuthClient, t as OAuthBearerAuthClientInput } from "../OAuthBearerAuthClient-BxTiv8dg.mjs";
|
|
2
3
|
import { Hex } from "viem";
|
|
3
4
|
import { Effect, FileSystem, Layer, Path } from "effect";
|
|
4
5
|
//#region src/adapters/auth-cache/FileSystemAuthCacheAdapter.d.ts
|
|
@@ -47,4 +48,4 @@ declare function localPrivateKeySigner(input: {
|
|
|
47
48
|
*/
|
|
48
49
|
declare function detectNodeAuthCacheAdapter(options?: DetectNodeAuthCacheAdapterOptions): AuthCachePort;
|
|
49
50
|
//#endregion
|
|
50
|
-
export { DetectNodeAuthCacheAdapterOptions, FileSystemAuthCacheAdapter, FileSystemAuthCacheLayer, detectNodeAuthCacheAdapter, localPrivateKeySigner };
|
|
51
|
+
export { DetectNodeAuthCacheAdapterOptions, FileSystemAuthCacheAdapter, FileSystemAuthCacheLayer, type OAuthBearerAuthClientInput, detectNodeAuthCacheAdapter, localPrivateKeySigner, oauthBearerAuthClient };
|
package/dist/node/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as toAddress, a as parseCachedJwt, i as parseAuthSession, n as InMemoryAuthCacheAdapter, o as AuthCacheError, r as BrowserAuthCacheAdapter, s as AuthCachePortTag } from "../clock-m_aHLaNm.mjs";
|
|
2
|
+
import { t as oauthBearerAuthClient } from "../OAuthBearerAuthClient-DfS4QOg7.mjs";
|
|
2
3
|
import { Effect, FileSystem, Layer, Path } from "effect";
|
|
3
4
|
import { privateKeyToAccount } from "viem/accounts";
|
|
4
5
|
import * as os from "node:os";
|
|
@@ -153,4 +154,4 @@ function resolveDefaultAuthCachePath(resolveHomeDirectory) {
|
|
|
153
154
|
}
|
|
154
155
|
}
|
|
155
156
|
//#endregion
|
|
156
|
-
export { FileSystemAuthCacheAdapter, FileSystemAuthCacheLayer, detectNodeAuthCacheAdapter, localPrivateKeySigner };
|
|
157
|
+
export { FileSystemAuthCacheAdapter, FileSystemAuthCacheLayer, detectNodeAuthCacheAdapter, localPrivateKeySigner, oauthBearerAuthClient };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import {
|
|
1
|
+
import { $ as RoleKey, A as AnonymousDistinctId, B as DurationMs, D as Address$1, F as BudgetId, G as PartyId, H as EpochMs, I as ChainId, J as PayrollRunId, K as PaymentCommandId, L as CountryCode, M as AuthSession, N as AuthUserId, O as AllowanceKey, P as BlockNumber, Q as PublishableKey, R as CurrencyCode, T as Account$1, U as Money, V as Email, W as OrgId, X as PermissionId, Y as PermissionAssignmentId, Z as Profile, _ as ClockPort, _t as FailureMode, a as SignerStatusStore, c as AccountProviderSource, ct as CapxulErrorCode, dt as Failure, et as SessionToken, g as SmartAccount$1, h as Session$1, j as AppId, k as AllowedOrigin, l as AccountRequirement, lt as CapxulErrorDetails, m as Profile$1, n as CapxulSigner, nt as TxHash, p as CapxulResult, q as PayrollGroupId, rt as WeiAmount, st as CapxulError, tt as SmartAccount, v as AuthClientPort, x as AuthCachePort, y as CanSendOtpStatus, z as DocumentHash } from "./signer-BpjdawiY.mjs";
|
|
2
|
+
import { Hex } from "viem";
|
|
3
3
|
import { Context, Effect, Layer, Schema, Scope, Tracer } from "effect";
|
|
4
4
|
import { FunctionReference } from "convex/server";
|
|
5
5
|
//#region src/domain/machine/shell.d.ts
|
|
@@ -312,68 +312,6 @@ interface TelemetryGroupInput {
|
|
|
312
312
|
readonly properties?: TelemetryProps;
|
|
313
313
|
}
|
|
314
314
|
//#endregion
|
|
315
|
-
//#region ../config/src/capxul-payments-v2.d.ts
|
|
316
|
-
/** Immutable CapxulPaymentsV2 deployment on Base Sepolia. */
|
|
317
|
-
declare const CAPXUL_PAYMENTS_V2_ADDRESS: Address;
|
|
318
|
-
//#endregion
|
|
319
|
-
//#region src/ports/auth-client.d.ts
|
|
320
|
-
type AuthClientOperationOptions = {
|
|
321
|
-
readonly signal?: AbortSignal;
|
|
322
|
-
};
|
|
323
|
-
type SendOtpInput = {
|
|
324
|
-
readonly email: Email;
|
|
325
|
-
};
|
|
326
|
-
type CanSendOtpInput = {
|
|
327
|
-
readonly email: Email;
|
|
328
|
-
};
|
|
329
|
-
type CanSendOtpStatus = {
|
|
330
|
-
readonly allowed: boolean;
|
|
331
|
-
readonly cooldownMs: DurationMs;
|
|
332
|
-
};
|
|
333
|
-
type VerifyOtpInput = {
|
|
334
|
-
readonly email: Email;
|
|
335
|
-
readonly otp: string;
|
|
336
|
-
};
|
|
337
|
-
type GetConvexJwtOptions = AuthClientOperationOptions & {
|
|
338
|
-
readonly forceRefresh?: boolean;
|
|
339
|
-
};
|
|
340
|
-
declare const AuthClientError_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 & {
|
|
341
|
-
readonly _tag: "AuthClientError";
|
|
342
|
-
} & Readonly<A>;
|
|
343
|
-
declare class AuthClientError extends AuthClientError_base<{
|
|
344
|
-
readonly operation: string;
|
|
345
|
-
readonly kind: string;
|
|
346
|
-
readonly cause: unknown;
|
|
347
|
-
}> {}
|
|
348
|
-
interface AuthClientPort {
|
|
349
|
-
canSendOtp(input: CanSendOtpInput, options?: AuthClientOperationOptions): Effect.Effect<CanSendOtpStatus, AuthClientError>;
|
|
350
|
-
sendOtp(input: SendOtpInput, options?: AuthClientOperationOptions): Effect.Effect<void, AuthClientError>;
|
|
351
|
-
verifyOtp(input: VerifyOtpInput, options?: AuthClientOperationOptions): Effect.Effect<AuthSession, AuthClientError>;
|
|
352
|
-
getSession(options?: AuthClientOperationOptions): Effect.Effect<AuthSession | null, AuthClientError>;
|
|
353
|
-
signOut(options?: AuthClientOperationOptions): Effect.Effect<void, AuthClientError>;
|
|
354
|
-
/**
|
|
355
|
-
* Fetches a Convex-aud JWT from `/api/auth/convex/token` (W7). Server mints
|
|
356
|
-
* a fresh JWT on every call per Probe A's 2026-05-19 finding (RS256, 900 s
|
|
357
|
-
* lifetime, `iss = <site-url>`, `aud = convex`). The caller (the SDK's
|
|
358
|
-
* `tokenProvider` wired into ConvexCallPort) is responsible for the
|
|
359
|
-
* `exp - 30s` proactive cache + `forceRefresh` callback handshake.
|
|
360
|
-
*/
|
|
361
|
-
getConvexJwt(options?: GetConvexJwtOptions): Effect.Effect<CachedJwt, AuthClientError>;
|
|
362
|
-
}
|
|
363
|
-
//#endregion
|
|
364
|
-
//#region src/ports/clock.d.ts
|
|
365
|
-
interface ClockPort {
|
|
366
|
-
readonly now: Effect.Effect<EpochMs, ClockError>;
|
|
367
|
-
readonly sleep: (duration: DurationMs) => Effect.Effect<void, ClockError>;
|
|
368
|
-
}
|
|
369
|
-
declare const ClockError_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 & {
|
|
370
|
-
readonly _tag: "ClockError";
|
|
371
|
-
} & Readonly<A>;
|
|
372
|
-
declare class ClockError extends ClockError_base<{
|
|
373
|
-
readonly operation: "now" | "sleep" | "initialize";
|
|
374
|
-
readonly cause: unknown;
|
|
375
|
-
}> {}
|
|
376
|
-
//#endregion
|
|
377
315
|
//#region ../wire/src/bootstrap.d.ts
|
|
378
316
|
declare const EngineeringTelemetryBootstrapPolicy: Schema.Struct<{
|
|
379
317
|
readonly host: Schema.refine<string, Schema.String>;
|
|
@@ -2825,6 +2763,17 @@ interface SdkFailureDetail {
|
|
|
2825
2763
|
readonly chain_revert_selector?: string;
|
|
2826
2764
|
readonly chain_revert_args?: Readonly<Record<string, string>>;
|
|
2827
2765
|
readonly chain_provider_message?: string;
|
|
2766
|
+
/** #1818: the attempt sequence and the refusing upstream's headers, same bounds as the backend. */
|
|
2767
|
+
readonly chain_attempts?: readonly SdkChainAttempt[];
|
|
2768
|
+
readonly chain_response_headers?: Readonly<Record<string, string>>;
|
|
2769
|
+
}
|
|
2770
|
+
/** One upstream tried, flat: the `chain_attempts` entry shape on every producer's row. */
|
|
2771
|
+
interface SdkChainAttempt {
|
|
2772
|
+
readonly upstream: string;
|
|
2773
|
+
readonly failure_mode: string;
|
|
2774
|
+
readonly http_status?: number;
|
|
2775
|
+
readonly rpc_code?: number;
|
|
2776
|
+
readonly duration_ms: number;
|
|
2828
2777
|
}
|
|
2829
2778
|
type ObservationDelivery = void | PromiseLike<void>;
|
|
2830
2779
|
/**
|
|
@@ -2845,4 +2794,4 @@ interface ObservationAdapter {
|
|
|
2845
2794
|
/** Stable PostHog event used for typed failures that are expected product outcomes. */
|
|
2846
2795
|
declare const CAPXUL_SDK_EXPECTED_OUTCOME_EVENT = "capxul_sdk_expected_outcome";
|
|
2847
2796
|
//#endregion
|
|
2848
|
-
export { OrganizationPaymentsMethods as $,
|
|
2797
|
+
export { OrganizationPaymentsMethods as $, OrgLane as $n, MeMethods as $t, OrgView as A, AccountSetupStep as An, ActivityFilter as At, PayrollGroupInput as B, SubmittedPermissionExecution as Bn, ActivitySummaryTotal as Bt, DetectPendingOrgInvitationsResult as C, RecipientResolutionKind as Cn, AddressBookMethods as Ct, OrgMethods as D, TargetsMethods as Dn, ActivityAnnotation as Dt, MemberView as E, TargetReference as En, InboxMethods as Et, RoleSpendCap as F, OrgLifecycle as Fn, ActivityPage as Ft, PayrollRun as G, RequestStatus as Gn, DestinationKind as Gt, PayrollGroupsMethods as H, PAYMENT_DIRECTIONS as Hn, DepositInstructions as Ht, RoleView as I, OrgSetupStep as In, ActivityRange as It, PayrollRuns as J, TelemetryIdentifyInput as Jn, DestinationRail as Jt, PayrollRunItemInput as K, TelemetryEvent as Kn, DestinationListInput as Kt, AuthorizeRunInput as L, ActorRef as Ln, ActivityReference as Lt, OrganizationAuditLogItem as M, IdentityMethods as Mn, ActivityKind as Mt, ResendInviteTokenInput as N, SmartAccountMethods as Nn, ActivityListParams as Nt, OrgScopedMethods as O, fingerprintPaymentIntent as On, ActivityAnnotationInput as Ot, RoleDefinition as P, AuthMethods as Pn, ActivityMethods as Pt, OrganizationPaymentItemInput as Q, IdentityState as Qn, HandlesMethods as Qt, PayrollEngagementTerms as R, CurrentHoldings as Rn, ActivitySummary as Rt, CreateOrgInput as S, RecipientResolution as Sn, AddressBookLabelInput as St, MemberStatus as T, ResolvedTarget as Tn, InboxItem as Tt, PayrollMethods as U, PAYMENT_STATUSES as Un, Destination as Ut, PayrollGroupMember as V, InboxStatus as Vn, ActorReference as Vt, PayrollOptions as W, PaymentStatus$1 as Wn, DestinationAddInput as Wt, OrganizationPaymentBatchInput as X, Destination$1 as Xn, DestinationsMethods as Xt, PayrollTermsUnit as Y, TelemetryPort as Yn, DestinationRemoveInput as Yt, OrganizationPaymentInput as Z, IdentityEvent as Zn, FinancialOpsMethods as Zt, SystemMethods as _, PaymentStatus as _n, ActorRequest as _t, SdkFailureObservation as a, OfframpStatus as an, IdentityTransition as ar, PermissionReplaceInput as at, CurrentUserContext as b, PaymentsMethods as bn, AddressBookAddInput as bt, PostHogObservabilityOptions as c, Payment as cn, Budget as ct, CreateCapxulClientInput as d, PaymentDocumentKind as dn, OrgMeOptions as dt, MeProfile as en, Readiness as er, PermissionAssignInput as et, IdentityProfileDetails as f, PaymentDocumentRef as fn, AccountsMethods as ft, Holding as g, PaymentMoney as gn, ActorRelationshipMethods as gt, HoldingsMethods as h, PaymentDocumentsMethods as hn, ActorProfileMethods as ht, ObservationDelivery as i, OfframpQuoteInput as in, isRestoring as ir, PermissionOptions as it, OrganizationAccount as j, isSettingUpLifecycle as jn, ActivityItem as jt, OrgTemplate as k, AccountLifecycle as kn, ActivityDetail as kt, postHogObservability as l, PaymentActivityEvidence as ln, OrgMe as lt, IdentityRuntimeSendResult as m, PaymentDocumentVerification as mn, ActorProfile as mt, ObservationAdapter as n, OfframpMethods as nn, destination as nr, PermissionCreateInput as nt, HostObservability as o, Payee as on, InvocationControls as or, PermissionRevokeInput as ot, IdentityRuntime as p, PaymentDocumentRender as pn, AccountMethods as pt, PayrollRunStatus as q, TelemetryGroupInput as qn, DestinationPayload as qt, ObservationContext as r, OfframpQuote as rn, isClaimed as rr, PermissionMethods as rt, PostHogObservabilityClient as s, PayeesMethods as sn, PermissionReadResult as st, CAPXUL_SDK_EXPECTED_OUTCOME_EVENT as t, MovementActivityEvidence as tn, StateLabel as tr, PermissionChangeInput as tt, CapxulClient as u, PaymentDirection as un, OrgMeMethod as ut, SystemHealth as v, PaymentTiming as vn, ActorRequestIssueInput as vt, InviteMemberInput as w, Ref$1 as wn, InboxApproveInput as wt, CurrentUserMethods as x, PaymentsPayInput as xn, AddressBookEntry as xt, MediaMethods as y, PaymentType as yn, ActorRequestsMethods as yt, PayrollGroup as z, Permission as zn, ActivitySummaryParams as zt };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Account, Hex } from "viem";
|
|
1
|
+
import { Account, Address, Hex } from "viem";
|
|
2
2
|
import { Context, Effect } from "effect";
|
|
3
3
|
//#region ../errors/src/chain-cause.d.ts
|
|
4
4
|
/**
|
|
@@ -33,8 +33,14 @@ declare const FAILURE_MODES: readonly [
|
|
|
33
33
|
"insufficient-allowance",
|
|
34
34
|
/** The bundler's validation refused the operation (AA2x/AA3x); its text is carried. */
|
|
35
35
|
"rejected",
|
|
36
|
-
/** The
|
|
36
|
+
/** The upstream refused the credential (HTTP 401): the gateway token or a hosted node key. */
|
|
37
37
|
"unauthorized",
|
|
38
|
+
/** The upstream refused the key, origin, or method (HTTP 403). The next upstream's key may be fine. */
|
|
39
|
+
"forbidden",
|
|
40
|
+
/** The upstream refused the request shape (HTTP 400-family; JSON-RPC -32600, -32602, -32700). */
|
|
41
|
+
"bad-request",
|
|
42
|
+
/** The node does not serve the method (JSON-RPC -32601). The next upstream may. */
|
|
43
|
+
"method-unsupported",
|
|
38
44
|
/** No cause could be determined. */
|
|
39
45
|
"unknown"];
|
|
40
46
|
type FailureMode = (typeof FAILURE_MODES)[number];
|
|
@@ -62,6 +68,22 @@ type ChainCause = {
|
|
|
62
68
|
readonly rpcCode?: number;
|
|
63
69
|
readonly revert?: RevertSummary;
|
|
64
70
|
readonly providerMessage?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Every upstream tried for this read, in order, ending with the one whose
|
|
73
|
+
* answer this cause is (#1818). One `$exception` row then tells the whole
|
|
74
|
+
* story of an exhausted chain; the recovered case stays an event.
|
|
75
|
+
*/
|
|
76
|
+
readonly attempts?: readonly ChainAttempt[];
|
|
77
|
+
/** The refusing upstream's allow-listed response headers, masked and bounded. */
|
|
78
|
+
readonly responseHeaders?: Readonly<Record<string, string>>;
|
|
79
|
+
};
|
|
80
|
+
/** One upstream tried and the word for how it failed (#1818). */
|
|
81
|
+
type ChainAttempt = {
|
|
82
|
+
readonly upstream: ChainUpstream;
|
|
83
|
+
readonly mode: FailureMode;
|
|
84
|
+
readonly httpStatus?: number;
|
|
85
|
+
readonly rpcCode?: number;
|
|
86
|
+
readonly durationMs: number;
|
|
65
87
|
};
|
|
66
88
|
//#endregion
|
|
67
89
|
//#region ../errors/src/errors.d.ts
|
|
@@ -342,6 +364,10 @@ type SupportedCurrencyCode = (typeof SUPPORTED_CURRENCIES)[number]["code"];
|
|
|
342
364
|
declare function toAddress(raw: unknown): Address$1;
|
|
343
365
|
declare function toCountryCode(raw: unknown): CountryCode;
|
|
344
366
|
//#endregion
|
|
367
|
+
//#region ../config/src/capxul-payments-v2.d.ts
|
|
368
|
+
/** Immutable CapxulPaymentsV2 deployment on Base Sepolia. */
|
|
369
|
+
declare const CAPXUL_PAYMENTS_V2_ADDRESS: Address;
|
|
370
|
+
//#endregion
|
|
345
371
|
//#region src/ports/auth-cache.d.ts
|
|
346
372
|
/**
|
|
347
373
|
* AuthCachePort stores the user session and the cached
|
|
@@ -387,6 +413,64 @@ declare class AuthCacheError extends AuthCacheError_base<{
|
|
|
387
413
|
declare const AuthCachePortTag_base: Context.ServiceClass<AuthCachePortTag, "@capxul/sdk/ports/AuthCachePort", AuthCachePort>;
|
|
388
414
|
declare class AuthCachePortTag extends AuthCachePortTag_base {}
|
|
389
415
|
//#endregion
|
|
416
|
+
//#region src/ports/auth-client.d.ts
|
|
417
|
+
type AuthClientOperationOptions = {
|
|
418
|
+
readonly signal?: AbortSignal;
|
|
419
|
+
};
|
|
420
|
+
type SendOtpInput = {
|
|
421
|
+
readonly email: Email;
|
|
422
|
+
};
|
|
423
|
+
type CanSendOtpInput = {
|
|
424
|
+
readonly email: Email;
|
|
425
|
+
};
|
|
426
|
+
type CanSendOtpStatus = {
|
|
427
|
+
readonly allowed: boolean;
|
|
428
|
+
readonly cooldownMs: DurationMs;
|
|
429
|
+
};
|
|
430
|
+
type VerifyOtpInput = {
|
|
431
|
+
readonly email: Email;
|
|
432
|
+
readonly otp: string;
|
|
433
|
+
};
|
|
434
|
+
type GetConvexJwtOptions = AuthClientOperationOptions & {
|
|
435
|
+
readonly forceRefresh?: boolean;
|
|
436
|
+
};
|
|
437
|
+
declare const AuthClientError_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 & {
|
|
438
|
+
readonly _tag: "AuthClientError";
|
|
439
|
+
} & Readonly<A>;
|
|
440
|
+
declare class AuthClientError extends AuthClientError_base<{
|
|
441
|
+
readonly operation: string;
|
|
442
|
+
readonly kind: string;
|
|
443
|
+
readonly cause: unknown;
|
|
444
|
+
}> {}
|
|
445
|
+
interface AuthClientPort {
|
|
446
|
+
canSendOtp(input: CanSendOtpInput, options?: AuthClientOperationOptions): Effect.Effect<CanSendOtpStatus, AuthClientError>;
|
|
447
|
+
sendOtp(input: SendOtpInput, options?: AuthClientOperationOptions): Effect.Effect<void, AuthClientError>;
|
|
448
|
+
verifyOtp(input: VerifyOtpInput, options?: AuthClientOperationOptions): Effect.Effect<AuthSession, AuthClientError>;
|
|
449
|
+
getSession(options?: AuthClientOperationOptions): Effect.Effect<AuthSession | null, AuthClientError>;
|
|
450
|
+
signOut(options?: AuthClientOperationOptions): Effect.Effect<void, AuthClientError>;
|
|
451
|
+
/**
|
|
452
|
+
* Fetches a Convex-aud JWT from `/api/auth/convex/token` (W7). Server mints
|
|
453
|
+
* a fresh JWT on every call per Probe A's 2026-05-19 finding (RS256, 900 s
|
|
454
|
+
* lifetime, `iss = <site-url>`, `aud = convex`). The caller (the SDK's
|
|
455
|
+
* `tokenProvider` wired into ConvexCallPort) is responsible for the
|
|
456
|
+
* `exp - 30s` proactive cache + `forceRefresh` callback handshake.
|
|
457
|
+
*/
|
|
458
|
+
getConvexJwt(options?: GetConvexJwtOptions): Effect.Effect<CachedJwt, AuthClientError>;
|
|
459
|
+
}
|
|
460
|
+
//#endregion
|
|
461
|
+
//#region src/ports/clock.d.ts
|
|
462
|
+
interface ClockPort {
|
|
463
|
+
readonly now: Effect.Effect<EpochMs, ClockError>;
|
|
464
|
+
readonly sleep: (duration: DurationMs) => Effect.Effect<void, ClockError>;
|
|
465
|
+
}
|
|
466
|
+
declare const ClockError_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 & {
|
|
467
|
+
readonly _tag: "ClockError";
|
|
468
|
+
} & Readonly<A>;
|
|
469
|
+
declare class ClockError extends ClockError_base<{
|
|
470
|
+
readonly operation: "now" | "sleep" | "initialize";
|
|
471
|
+
readonly cause: unknown;
|
|
472
|
+
}> {}
|
|
473
|
+
//#endregion
|
|
390
474
|
//#region src/surface/types.d.ts
|
|
391
475
|
type Session = AuthSession;
|
|
392
476
|
type Profile = Profile$1;
|
|
@@ -510,4 +594,4 @@ interface Eip1193RequestProvider {
|
|
|
510
594
|
*/
|
|
511
595
|
declare function injectedWalletSigner(provider: Eip1193RequestProvider): CapxulSigner;
|
|
512
596
|
//#endregion
|
|
513
|
-
export {
|
|
597
|
+
export { RoleKey as $, AnonymousDistinctId as A, DurationMs as B, CachedJwt as C, Address$1 as D, AccountId as E, BudgetId as F, PartyId as G, EpochMs as H, ChainId as I, PayrollRunId as J, PaymentCommandId as K, CountryCode as L, AuthSession as M, AuthUserId as N, AllowanceKey as O, BlockNumber as P, PublishableKey as Q, CurrencyCode as R, AuthCachePortTag as S, Account$1 as T, Money as U, Email as V, OrgId as W, PermissionId as X, PermissionAssignmentId as Y, Profile$1 as Z, ClockPort as _, FailureMode as _t, SignerStatusStore as a, toCountryCode as at, AuthCacheError as b, AccountProviderSource as c, CapxulErrorCode as ct, eip1193AccountProvider as d, Failure as dt, SessionToken as et, localPrivateKeyAccountProvider as f, isCapxulError as ft, SmartAccount as g, FAILURE_MODES as gt, Session as h, ChainUpstream as ht, SignerStatus as i, toAddress as it, AppId as j, AllowedOrigin as k, AccountRequirement as l, CapxulErrorDetails as lt, Profile as m, ChainCause as mt, CapxulSigner as n, TxHash as nt, injectedWalletSigner as o, CAPXUL_ERROR_CODES as ot, CapxulResult as p, CHAIN_UPSTREAMS as pt, PayrollGroupId as q, Eip1193RequestProvider as r, WeiAmount as rt, AccountProvider as s, CapxulError as st, CapxulDigestSigner as t, SmartAccount$1 as tt, Eip1193Provider as u, Errors as ut, AuthClientPort as v, RevertSummary as vt, CAPXUL_PAYMENTS_V2_ADDRESS as w, AuthCachePort as x, CanSendOtpStatus as y, DocumentHash as z };
|
package/dist/testing/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Jn as
|
|
1
|
+
import { Jn as TelemetryIdentifyInput, Kn as TelemetryEvent, ar as IdentityTransition, n as ObservationAdapter, qn as TelemetryGroupInput, u as CapxulClient } from "../observation-B3PCugGC.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 {
|
|
1
|
+
import { F as fromWei, _ as convexCallErrorFromCapxul, c as redactTelemetryEvent, h as identityErrorFromCapxul, i as smartAccountErrorFromCapxul, o as accountReadErrorFromCapxul, p as wireChainId, t as assembleCapxulClient, x as toWei, y as bootstrapErrorFromCapxul } from "../create-capxul-client-Ch_pfcoR.mjs";
|
|
2
|
+
import { D as toAllowedOrigin, E as toAddress, F as toEmail, I as toEpochMs, K as toSessionToken, L as toEpochSeconds, M as toCountryCode, O as toAppId, P as toDurationMs, R as toJwtToken, T as toAccountId, W as toPublishableKey, Y as CapxulError, Z as Errors, _ as deriveCapxulSafeAddress, j as toChainId, k as toAuthUserId, n as InMemoryAuthCacheAdapter, t as readClockNow, u as authClientPortFromPromiseAdapter, z as toKycTier } from "../clock-m_aHLaNm.mjs";
|
|
3
3
|
import { keccak256 } from "viem";
|
|
4
4
|
import { Effect, Result, Semaphore } from "effect";
|
|
5
5
|
import { getFunctionName } from "convex/server";
|
|
@@ -43,26 +43,6 @@ function cloneAccount(account) {
|
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
//#endregion
|
|
46
|
-
//#region src/adapters/_shared/clock.ts
|
|
47
|
-
async function readClockNow(clock) {
|
|
48
|
-
try {
|
|
49
|
-
const result = await Effect.runPromise(Effect.result(clock.now));
|
|
50
|
-
if (Result.isFailure(result)) return {
|
|
51
|
-
ok: false,
|
|
52
|
-
error: Errors.providerError("clock", "now", result.failure)
|
|
53
|
-
};
|
|
54
|
-
return {
|
|
55
|
-
ok: true,
|
|
56
|
-
value: result.success
|
|
57
|
-
};
|
|
58
|
-
} catch (cause) {
|
|
59
|
-
return {
|
|
60
|
-
ok: false,
|
|
61
|
-
error: Errors.providerError("clock", "now", cause)
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
//#endregion
|
|
66
46
|
//#region src/testing/clock/ManualClockAdapter.ts
|
|
67
47
|
/**
|
|
68
48
|
* Event-discipline test clock. Time moves only when a release primitive is
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capxul/sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.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/
|
|
51
|
-
"@capxul/
|
|
52
|
-
"@capxul/
|
|
53
|
-
"@capxul/
|
|
54
|
-
"@capxul/
|
|
55
|
-
"@capxul/
|
|
50
|
+
"@capxul/config": "0.2.3",
|
|
51
|
+
"@capxul/errors": "0.2.0",
|
|
52
|
+
"@capxul/observability": "3.0.2",
|
|
53
|
+
"@capxul/types": "0.2.3",
|
|
54
|
+
"@capxul/typescript-config": "0.0.0",
|
|
55
|
+
"@capxul/wire": "0.6.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": {
|