@capxul/sdk 4.1.4 → 4.2.0-rc.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/{clock-C2AUlq1V.mjs → OAuthBearerAuthClient-BrbXrndM.mjs} +525 -52
- package/dist/{signer-C0hZ6Kiy.d.mts → OAuthBearerAuthClient-C-ip-z8M.d.mts} +30 -6
- package/dist/capxul-source.json +11 -0
- package/dist/index.d.mts +53 -51
- package/dist/index.mjs +144 -3505
- package/dist/node/index.d.mts +2 -3
- package/dist/node/index.mjs +1 -2
- package/dist/{observation-Bhdq9-l6.d.mts → production-CBKHzqYP.d.mts} +97 -4
- package/dist/{create-capxul-client-B3ET402J.mjs → production-WbMhv2Fb.mjs} +4098 -181
- package/dist/testing/index.d.mts +7 -2
- package/dist/testing/index.mjs +10 -4
- package/package.json +3 -3
- package/dist/OAuthBearerAuthClient-BHvDR8_0.mjs +0 -211
- package/dist/OAuthBearerAuthClient-D-DLYlKj.d.mts +0 -19
package/dist/node/index.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import { n as oauthBearerAuthClient, t as OAuthBearerAuthClientInput } from "../OAuthBearerAuthClient-D-DLYlKj.mjs";
|
|
3
|
-
import { Effect, FileSystem, Layer, Path } from "effect";
|
|
1
|
+
import { C as AuthCachePort, I as AuthSession, S as AuthCacheError, T as CachedJwt, i as CapxulSigner, n as oauthBearerAuthClient, t as OAuthBearerAuthClientInput, w as AuthCachePortTag } from "../OAuthBearerAuthClient-C-ip-z8M.mjs";
|
|
4
2
|
import { Hex } from "viem";
|
|
3
|
+
import { Effect, FileSystem, Layer, Path } from "effect";
|
|
5
4
|
//#region src/adapters/auth-cache/FileSystemAuthCacheAdapter.d.ts
|
|
6
5
|
type FileSystemRuntime = FileSystem.FileSystem | Path.Path;
|
|
7
6
|
declare class FileSystemAuthCacheAdapter implements AuthCachePort {
|
package/dist/node/index.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as oauthBearerAuthClient } from "../OAuthBearerAuthClient-BHvDR8_0.mjs";
|
|
1
|
+
import { a as parseAuthSession, c as AuthCachePortTag, i as BrowserAuthCacheAdapter, j as toAddress, o as parseCachedJwt, r as InMemoryAuthCacheAdapter, s as AuthCacheError, t as oauthBearerAuthClient } from "../OAuthBearerAuthClient-BrbXrndM.mjs";
|
|
3
2
|
import { Effect, FileSystem, Layer, Path } from "effect";
|
|
4
3
|
import { privateKeyToAccount } from "viem/accounts";
|
|
5
4
|
import * as os from "node:os";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { Context, Effect, Layer, Schema, Scope, Tracer } from "effect";
|
|
1
|
+
import { $ as PayrollGroupId, A as AllowanceKey, B as ChainId, C as AuthCachePort, D as Account$1, Et as FailureMode, H as CurrencyCode, I as AuthSession, K as Email, L as AuthUserId, M as AnonymousDistinctId, N as AppId, Q as PaymentCommandId, R as BlockNumber, U as DocumentHash, V as CountryCode, W as DurationMs, X as OrgId, Y as Money, Z as PartyId, _ as Session$1, _t as CapxulErrorCode, at as RoleKey, b as AuthClientPort, bt as Failure, ct as TesterKind, d as AccountRequirement, et as PayrollRunId, g as Profile$1, gt as CapxulError, h as CapxulResult, i as CapxulSigner, it as PublishableKey, j as AllowedOrigin, k as Address$1, lt as TxHash, nt as PermissionId, ot as SessionToken, q as EpochMs, rt as Profile, s as SignerStatusStore, st as SmartAccount, tt as PermissionAssignmentId, u as AccountProviderSource, ut as WeiAmount, v as SmartAccount$1, vt as CapxulErrorDetails, x as CanSendOtpStatus, y as ClockPort, z as BudgetId } from "./OAuthBearerAuthClient-C-ip-z8M.mjs";
|
|
3
2
|
import { Hex } from "viem";
|
|
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
|
|
6
6
|
declare const INVOCATION_PARENT_SPAN: unique symbol;
|
|
@@ -78,6 +78,11 @@ interface OrgDraft {
|
|
|
78
78
|
interface OrgSubmissionDraft extends OrgDraft {
|
|
79
79
|
readonly bio?: string;
|
|
80
80
|
readonly size?: string;
|
|
81
|
+
/**
|
|
82
|
+
* #1955: the logo uploaded on file pick. The org lane spreads this draft
|
|
83
|
+
* straight into `startOrResume`, which records it on the `orgs` insert.
|
|
84
|
+
*/
|
|
85
|
+
readonly logoStorageId?: string;
|
|
81
86
|
}
|
|
82
87
|
/** The org lane, keyed by the active orgId — which does not exist yet while the
|
|
83
88
|
* FIRST DURABLE ORG WRITE is in flight, hence `creating` carrying only a draft. */
|
|
@@ -710,6 +715,16 @@ type UpdateIdentityInput = {
|
|
|
710
715
|
readonly displayName?: string;
|
|
711
716
|
readonly country?: CountryCode;
|
|
712
717
|
};
|
|
718
|
+
/** The chain families a payout address may name (#1955). */
|
|
719
|
+
declare const PAYOUT_CHAINS: readonly ["evm", "solana", "starknet"];
|
|
720
|
+
/**
|
|
721
|
+
* One payout address, named BY CHAIN FAMILY. The network is the deployment's
|
|
722
|
+
* and the backend derives it (#1955) — a caller never sends one.
|
|
723
|
+
*/
|
|
724
|
+
type PayoutAddress = {
|
|
725
|
+
readonly chain: (typeof PAYOUT_CHAINS)[number];
|
|
726
|
+
readonly address: string;
|
|
727
|
+
};
|
|
713
728
|
/**
|
|
714
729
|
* D-ONBOARD (#669) — the onboarding-complete identity write. Composes the
|
|
715
730
|
* existing create/update write into one idempotent upsert that ALSO sets the
|
|
@@ -717,6 +732,10 @@ type UpdateIdentityInput = {
|
|
|
717
732
|
* allowed raw-0x class). `displayName` + `country` are required at onboarding
|
|
718
733
|
* time. The returned `Profile` is the existing branded shape — the onboarding
|
|
719
734
|
* flags live on the wire row and are not projected onto the read surface.
|
|
735
|
+
*
|
|
736
|
+
* #1955: it also carries the photo the signup form uploaded and the payout
|
|
737
|
+
* addresses it collected, so the backend writes all three in one transaction
|
|
738
|
+
* instead of the app binding them with two more calls afterwards.
|
|
720
739
|
*/
|
|
721
740
|
type CompleteOnboardingIdentityInput = {
|
|
722
741
|
readonly authUserId: AuthUserId;
|
|
@@ -726,6 +745,9 @@ type CompleteOnboardingIdentityInput = {
|
|
|
726
745
|
readonly withdrawalAddress?: Address$1;
|
|
727
746
|
/** One globally unique Party handle. */
|
|
728
747
|
readonly handle: string;
|
|
748
|
+
/** Storage id from `media.uploadImage`; bound on the identity write itself. */
|
|
749
|
+
readonly imageStorageId?: string;
|
|
750
|
+
readonly payoutAddresses?: readonly PayoutAddress[];
|
|
729
751
|
};
|
|
730
752
|
declare const IdentityError_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 & {
|
|
731
753
|
readonly _tag: "IdentityError";
|
|
@@ -929,6 +951,8 @@ type StartOrResumeOrganizationInput = {
|
|
|
929
951
|
/** #1064: optional onboarding-collected description + size bucket. */
|
|
930
952
|
readonly bio?: string;
|
|
931
953
|
readonly size?: string;
|
|
954
|
+
/** #1955: storage id from `media.uploadImage`, recorded on the org insert. */
|
|
955
|
+
readonly logoStorageId?: string;
|
|
932
956
|
/** @internal Safe trace/correlation carriage owned by the identity flow. */
|
|
933
957
|
readonly observationContext?: WireObservationContext;
|
|
934
958
|
};
|
|
@@ -1019,7 +1043,16 @@ interface SmartAccountMethods {
|
|
|
1019
1043
|
}
|
|
1020
1044
|
//#endregion
|
|
1021
1045
|
//#region src/surface/identity.d.ts
|
|
1022
|
-
|
|
1046
|
+
/**
|
|
1047
|
+
* #1955: what a create call may carry besides the three required fields — the
|
|
1048
|
+
* photo already uploaded and the payout addresses the form collected.
|
|
1049
|
+
*/
|
|
1050
|
+
interface ProfileCarriage {
|
|
1051
|
+
/** Storage id from `media.uploadImage`. */
|
|
1052
|
+
readonly imageStorageId?: string;
|
|
1053
|
+
readonly payoutAddresses?: readonly PayoutAddress[];
|
|
1054
|
+
}
|
|
1055
|
+
interface CompleteProfileInput extends ProfileCarriage {
|
|
1023
1056
|
readonly displayName: string;
|
|
1024
1057
|
readonly country: string;
|
|
1025
1058
|
readonly handle: string;
|
|
@@ -2545,6 +2578,13 @@ type IdentityProfileDetails = {
|
|
|
2545
2578
|
readonly displayName: string;
|
|
2546
2579
|
readonly country: string;
|
|
2547
2580
|
readonly handle: string;
|
|
2581
|
+
/**
|
|
2582
|
+
* #1955: the storage id `useCapxulUploadImage` handed back on file pick, and
|
|
2583
|
+
* the payout addresses the form collected. The create call carries them, so
|
|
2584
|
+
* the backend binds the photo and writes the rails in the same durable step.
|
|
2585
|
+
*/
|
|
2586
|
+
readonly imageStorageId?: string;
|
|
2587
|
+
readonly payoutAddresses?: readonly PayoutAddress[];
|
|
2548
2588
|
};
|
|
2549
2589
|
interface IdentityRuntime {
|
|
2550
2590
|
readonly snapshot: () => IdentityState;
|
|
@@ -2835,4 +2875,57 @@ interface ObservationAdapter {
|
|
|
2835
2875
|
/** Stable PostHog event used for typed failures that are expected product outcomes. */
|
|
2836
2876
|
declare const CAPXUL_SDK_EXPECTED_OUTCOME_EVENT = "capxul_sdk_expected_outcome";
|
|
2837
2877
|
//#endregion
|
|
2838
|
-
|
|
2878
|
+
//#region src/ports/diagnostic.d.ts
|
|
2879
|
+
type DiagnosticDetail = Readonly<Record<string, unknown>>;
|
|
2880
|
+
interface DiagnosticPort {
|
|
2881
|
+
readonly trace: (scope: string, detail: DiagnosticDetail) => void;
|
|
2882
|
+
}
|
|
2883
|
+
//#endregion
|
|
2884
|
+
//#region src/openfort/create-openfort-browser-signer.d.ts
|
|
2885
|
+
interface OpenfortBrowserSignerOptions {
|
|
2886
|
+
readonly diagnostic?: DiagnosticPort;
|
|
2887
|
+
/** Testing seam below the existing one-retry recovery owner. */
|
|
2888
|
+
readonly signUserOpHash?: ((hash: Parameters<CapxulSigner["signUserOpHash"]>[0], delegate: CapxulSigner["signUserOpHash"]) => ReturnType<CapxulSigner["signUserOpHash"]>) | undefined;
|
|
2889
|
+
}
|
|
2890
|
+
//#endregion
|
|
2891
|
+
//#region src/production.d.ts
|
|
2892
|
+
/**
|
|
2893
|
+
* Consumer-facing `createCapxulClient` input (SDK DX public surface · #326).
|
|
2894
|
+
* The publishable key is the primary input; bootstrap host, invoke timeout,
|
|
2895
|
+
* runtime detection, and auth-cache selection are SDK-owned defaults.
|
|
2896
|
+
*/
|
|
2897
|
+
interface CapxulClientInput {
|
|
2898
|
+
readonly publishableKey: string;
|
|
2899
|
+
/**
|
|
2900
|
+
* One host-owned product/failure observability module around the host's
|
|
2901
|
+
* existing analytics client. Omit for zero host observation work.
|
|
2902
|
+
*/
|
|
2903
|
+
readonly observability?: HostObservability;
|
|
2904
|
+
/**
|
|
2905
|
+
* Init-time account readiness target (issue #159 · AC4). Threaded into
|
|
2906
|
+
* `assembleCapxulClient` so `client.account.{getStatus,ensureReady}` reflect
|
|
2907
|
+
* the consumer's chosen requirement. Optional — defaults to `"none"` (SDK
|
|
2908
|
+
* publish readiness · I3) so `createCapxulClient({ publishableKey })` works
|
|
2909
|
+
* with no account lane.
|
|
2910
|
+
*/
|
|
2911
|
+
readonly requirement?: AccountRequirement;
|
|
2912
|
+
/**
|
|
2913
|
+
* Consumer-held signer (backend-orchestrated-deploy.md). Required for
|
|
2914
|
+
* `requirement: "deployed"` flows: `provision` reads `getAddress()` and the
|
|
2915
|
+
* deploy path signs the backend's SafeOp digest via `signUserOpHash()`. The
|
|
2916
|
+
* backend orchestrates build + gas + paymaster + submit — the client never
|
|
2917
|
+
* holds an RPC URL, a gas-sponsorship policy, or a bundler.
|
|
2918
|
+
*/
|
|
2919
|
+
readonly signer?: CapxulSigner;
|
|
2920
|
+
}
|
|
2921
|
+
/** Per-client signing controls; only the testing entry exposes these to consumers. */
|
|
2922
|
+
interface ProductionSignerControls {
|
|
2923
|
+
/** Final signing call. Address, readiness and session lifecycle retain their real owner. */
|
|
2924
|
+
readonly signUserOpHash?: (hash: Parameters<CapxulSigner["signUserOpHash"]>[0], signer: CapxulSigner & {
|
|
2925
|
+
readonly resetSession?: () => void;
|
|
2926
|
+
}) => ReturnType<CapxulSigner["signUserOpHash"]>;
|
|
2927
|
+
/** Embedded signing calls, including the existing recovery owner's single retry. */
|
|
2928
|
+
readonly signEmbeddedUserOpHash?: OpenfortBrowserSignerOptions["signUserOpHash"];
|
|
2929
|
+
}
|
|
2930
|
+
//#endregion
|
|
2931
|
+
export { OrganizationPaymentBatchInput as $, RequestStatus as $n, Destination as $t, OrgScopedMethods as A, Ref$1 as An, AddressBookAddInput as At, AuthorizeRunOptions as B, SmartAccountMethods as Bn, ActivityFilter as Bt, CurrentUserMethods as C, PaymentMoney as Cn, AccountMethods as Ct, MemberStatus as D, PaymentsMethods as Dn, ActorRequest as Dt, InviteMemberInput as E, PaymentType as En, ActorRelationshipMethods as Et, ResendInviteTokenInput as F, AccountLifecycle as Fn, InboxItem as Ft, PayrollGroupsMethods as G, ActorRef as Gn, ActivityPage as Gt, PayrollGroup as H, OrgLifecycle as Hn, ActivityKind as Ht, RoleDefinition as I, AccountSetupStep as In, InboxMethods as It, PayrollRun as J, SubmittedPermissionExecution as Jn, ActivitySummary as Jt, PayrollMethods as K, CurrentHoldings as Kn, ActivityRange as Kt, RoleSpendCap as L, isSettingUpLifecycle as Ln, ActivityAnnotation as Lt, OrgView as M, TargetReference as Mn, AddressBookLabelInput as Mt, OrganizationAccount as N, TargetsMethods as Nn, AddressBookMethods as Nt, MemberView as O, PaymentsPayInput as On, ActorRequestIssueInput as Ot, OrganizationAuditLogItem as P, fingerprintPaymentIntent as Pn, InboxApproveInput as Pt, PayrollTermsUnit as Q, PaymentStatus$1 as Qn, DepositInstructions as Qt, RoleView as R, CompleteProfileInput as Rn, ActivityAnnotationInput as Rt, CurrentUserContext as S, PaymentDocumentsMethods as Sn, ReadyAccountLifecycle as St, DetectPendingOrgInvitationsResult as T, PaymentTiming as Tn, ActorProfileMethods as Tt, PayrollGroupInput as U, OrgSetupStep as Un, ActivityListParams as Ut, PayrollEngagementTerms as V, AuthMethods as Vn, ActivityItem as Vt, PayrollGroupMember as W, PayoutAddress as Wn, ActivityMethods as Wt, PayrollRunStatus as X, PAYMENT_DIRECTIONS as Xn, ActivitySummaryTotal as Xt, PayrollRunItemInput as Y, InboxStatus as Yn, ActivitySummaryParams as Yt, PayrollRuns as Z, PAYMENT_STATUSES as Zn, ActorReference as Zt, HoldingsMethods as _, PaymentDirection as _n, OnboardingMethods as _t, ObservationContext as a, DestinationRemoveInput as an, IdentityEvent as ar, PermissionCreateInput as at, SystemHealth as b, PaymentDocumentRender as bn, PersonOnboarding as bt, HostObservability as c, MeMethods as cn, Readiness as cr, PermissionReplaceInput as ct, postHogObservability as d, OfframpMethods as dn, isClaimed as dr, Budget as dt, DestinationAddInput as en, TelemetryEvent as er, OrganizationPaymentInput as et, CapxulClient as f, OfframpQuote as fn, isRestoring as fr, OrgMe as ft, IdentityRuntimeSendResult as g, PaymentActivityEvidence as gn, CompletedPersonProfile as gt, IdentityRuntime as h, Payment as hn, AccountsMethods as ht, ObservationAdapter as i, DestinationRail as in, Destination$1 as ir, PermissionChangeInput as it, OrgTemplate as j, ResolvedTarget as jn, AddressBookEntry as jt, OrgMethods as k, RecipientResolution as kn, ActorRequestsMethods as kt, PostHogObservabilityClient as l, MeProfile as ln, StateLabel as lr, PermissionRevokeInput as lt, IdentityProfileDetails as m, OfframpStatus as mn, InvocationControls as mr, OrgMeOptions as mt, ProductionSignerControls as n, DestinationListInput as nn, TelemetryIdentifyInput as nr, OrganizationPaymentsMethods as nt, ObservationDelivery as o, DestinationsMethods as on, IdentityState as or, PermissionMethods as ot, CreateCapxulClientInput as p, OfframpQuoteInput as pn, IdentityTransition as pr, OrgMeMethod as pt, PayrollOptions as q, Permission as qn, ActivityReference as qt, CAPXUL_SDK_EXPECTED_OUTCOME_EVENT as r, DestinationPayload as rn, TelemetryPort as rr, PermissionAssignInput as rt, SdkFailureObservation as s, FinancialOpsMethods as sn, OrgLane as sr, PermissionOptions as st, CapxulClientInput as t, DestinationKind as tn, TelemetryGroupInput as tr, OrganizationPaymentItemInput as tt, PostHogObservabilityOptions as u, MovementActivityEvidence as un, destination as ur, PermissionReadResult as ut, Holding as v, PaymentDocumentKind as vn, OrganizationOnboarding as vt, CreateOrgInput as w, PaymentStatus as wn, ActorProfile as wt, MediaMethods as x, PaymentDocumentVerification as xn, PersonOnboardingInput as xt, SystemMethods as y, PaymentDocumentRef as yn, OrganizationOnboardingInput as yt, AuthorizeRunInput as z, IdentityMethods as zn, ActivityDetail as zt };
|