@capxul/sdk 4.2.0-rc.6 → 4.2.0-rc.8
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/capxul-source.json +3 -3
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{production-Dkp_cJ5N.d.mts → production-BOMKT0n7.d.mts} +2 -10
- package/dist/{production-XxSdhlsI.mjs → production-Y3yqeOSE.mjs} +14 -52
- package/dist/testing/index.d.mts +1 -1
- package/dist/testing/index.mjs +1 -1
- package/package.json +4 -4
package/dist/capxul-source.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"source": {
|
|
3
|
-
"commit": "
|
|
4
|
-
"tree": "
|
|
3
|
+
"commit": "29f8bbef5a60b623572ba982e895a10b47aaba27",
|
|
4
|
+
"tree": "9d831c3273591ecc4767094f887088781e786531",
|
|
5
5
|
"branch": "codex/programme-rc",
|
|
6
6
|
"repository": "https://github.com/Xelmar-tech/infrastructure",
|
|
7
7
|
"lockfileSha256": "5870f53b72706d103220c1bcf733cb4fb71196aea32a9cfbdc277d73cc959264"
|
|
8
8
|
},
|
|
9
9
|
"name": "@capxul/sdk",
|
|
10
|
-
"version": "4.2.0-rc.
|
|
10
|
+
"version": "4.2.0-rc.8"
|
|
11
11
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $ as PayrollGroupId, B as ChainId, Ct as ChainCause, D as Account, Dt as RevertSummary, E as CAPXUL_PAYMENTS_V2_ADDRESS, Et as FailureMode, F as AssetId, G as EVM_ADDRESS_RE, H as CurrencyCode, I as AuthSession, J as Handle, L as AuthUserId, O as AccountId, P as AssetAmount, St as CHAIN_UPSTREAMS, Tt as FAILURE_MODES, V as CountryCode, X as OrgId, Y as Money, Z as PartyId, _ as Session, _t as CapxulErrorCode, a as Eip1193RequestProvider, at as RoleKey, c as injectedWalletSigner, ct as TesterKind, d as AccountRequirement, dt as toAddress, et as PayrollRunId, f as Eip1193Provider, ft as toCountryCode, g as Profile, gt as CapxulError, h as CapxulResult, ht as CAPXUL_ERROR_CODES, i as CapxulSigner, k as Address, l as AccountProvider, m as localPrivateKeyAccountProvider, mt as toPartyId, o as SignerStatus, p as eip1193AccountProvider, pt as toHandle, r as CapxulDigestSigner, s as SignerStatusStore, u as AccountProviderSource, v as SmartAccount, vt as CapxulErrorDetails, wt as ChainUpstream, xt as isCapxulError, yt as Errors, z as BudgetId } from "./OAuthBearerAuthClient-C-ip-z8M.mjs";
|
|
2
|
-
import { $ as OrganizationPaymentBatchInput, $n as RequestStatus, $t as Destination, A as OrgScopedMethods, An as Ref, At as AddressBookAddInput, B as AuthorizeRunOptions, Bn as SmartAccountMethods, Bt as ActivityFilter, C as CurrentUserMethods, Cn as PaymentMoney, Ct as AccountMethods, D as MemberStatus, Dn as PaymentsMethods, Dt as ActorRequest, E as InviteMemberInput, En as PaymentType, Et as ActorRelationshipMethods, F as ResendInviteTokenInput, Fn as AccountLifecycle, Ft as InboxItem, G as PayrollGroupsMethods, Gn as ActorRef, Gt as ActivityPage, H as PayrollGroup, Hn as OrgLifecycle, Ht as ActivityKind, I as RoleDefinition, In as AccountSetupStep, It as InboxMethods, J as PayrollRun, Jn as SubmittedPermissionExecution, Jt as ActivitySummary, K as PayrollMethods, Kn as CurrentHoldings, Kt as ActivityRange, L as RoleSpendCap, Ln as isSettingUpLifecycle, Lt as ActivityAnnotation, M as OrgView, Mn as TargetReference, Mt as AddressBookLabelInput, N as OrganizationAccount, Nn as TargetsMethods, Nt as AddressBookMethods, O as MemberView, On as PaymentsPayInput, Ot as ActorRequestIssueInput, P as OrganizationAuditLogItem, Pn as fingerprintPaymentIntent, Pt as InboxApproveInput, Q as PayrollTermsUnit, Qn as PaymentStatus$1, Qt as DepositInstructions, R as RoleView, Rn as CompleteProfileInput, Rt as ActivityAnnotationInput, S as CurrentUserContext, Sn as PaymentDocumentsMethods, St as ReadyAccountLifecycle, T as DetectPendingOrgInvitationsResult, Tn as PaymentTiming, Tt as ActorProfileMethods, U as PayrollGroupInput, Un as OrgSetupStep, Ut as ActivityListParams, V as PayrollEngagementTerms, Vn as AuthMethods, Vt as ActivityItem, W as PayrollGroupMember, Wn as PayoutAddress, Wt as ActivityMethods, X as PayrollRunStatus, Xn as PAYMENT_DIRECTIONS, Xt as ActivitySummaryTotal, Y as PayrollRunItemInput, Yn as InboxStatus, Yt as ActivitySummaryParams, Z as PayrollRuns, Zn as PAYMENT_STATUSES, Zt as ActorReference, _ as HoldingsMethods, _n as PaymentDirection, _t as OnboardingMethods, a as ObservationContext, an as DestinationRemoveInput, ar as IdentityEvent, at as PermissionCreateInput, b as SystemHealth, bn as PaymentDocumentRender, bt as PersonOnboarding, c as HostObservability, cn as MeMethods, cr as Readiness, ct as PermissionReplaceInput, d as postHogObservability, dn as OfframpMethods, dr as isClaimed, dt as Budget, en as DestinationAddInput, et as OrganizationPaymentInput, f as CapxulClient, fn as OfframpQuote, fr as isRestoring, ft as OrgMe, g as IdentityRuntimeSendResult, gn as PaymentActivityEvidence, gt as CompletedPersonProfile, h as IdentityRuntime, hn as Payment, ht as AccountsMethods, i as ObservationAdapter, in as DestinationRail, ir as Destination$1, it as PermissionChangeInput, j as OrgTemplate, jn as ResolvedTarget, jt as AddressBookEntry, k as OrgMethods, kn as RecipientResolution, kt as ActorRequestsMethods, l as PostHogObservabilityClient, ln as MeProfile, lr as StateLabel, lt as PermissionRevokeInput, m as IdentityProfileDetails, mn as OfframpStatus, mr as InvocationControls, mt as OrgMeOptions, nn as DestinationListInput, nt as OrganizationPaymentsMethods, o as ObservationDelivery, on as DestinationsMethods, or as IdentityState, ot as PermissionMethods, p as CreateCapxulClientInput, pn as OfframpQuoteInput, pr as IdentityTransition, pt as OrgMeMethod, q as PayrollOptions, qn as Permission, qt as ActivityReference, r as CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, rn as DestinationPayload, rr as TelemetryPort, rt as PermissionAssignInput, s as SdkFailureObservation, sn as FinancialOpsMethods, sr as OrgLane, st as PermissionOptions, t as CapxulClientInput, tn as DestinationKind, tt as OrganizationPaymentItemInput, u as PostHogObservabilityOptions, un as MovementActivityEvidence, ur as destination, ut as PermissionReadResult, v as Holding, vn as PaymentDocumentKind, vt as OrganizationOnboarding, w as CreateOrgInput, wn as PaymentStatus, wt as ActorProfile, x as MediaMethods, xn as PaymentDocumentVerification, xt as PersonOnboardingInput, y as SystemMethods, yn as PaymentDocumentRef, yt as OrganizationOnboardingInput, z as AuthorizeRunInput, zn as IdentityMethods, zt as ActivityDetail } from "./production-
|
|
2
|
+
import { $ as OrganizationPaymentBatchInput, $n as RequestStatus, $t as Destination, A as OrgScopedMethods, An as Ref, At as AddressBookAddInput, B as AuthorizeRunOptions, Bn as SmartAccountMethods, Bt as ActivityFilter, C as CurrentUserMethods, Cn as PaymentMoney, Ct as AccountMethods, D as MemberStatus, Dn as PaymentsMethods, Dt as ActorRequest, E as InviteMemberInput, En as PaymentType, Et as ActorRelationshipMethods, F as ResendInviteTokenInput, Fn as AccountLifecycle, Ft as InboxItem, G as PayrollGroupsMethods, Gn as ActorRef, Gt as ActivityPage, H as PayrollGroup, Hn as OrgLifecycle, Ht as ActivityKind, I as RoleDefinition, In as AccountSetupStep, It as InboxMethods, J as PayrollRun, Jn as SubmittedPermissionExecution, Jt as ActivitySummary, K as PayrollMethods, Kn as CurrentHoldings, Kt as ActivityRange, L as RoleSpendCap, Ln as isSettingUpLifecycle, Lt as ActivityAnnotation, M as OrgView, Mn as TargetReference, Mt as AddressBookLabelInput, N as OrganizationAccount, Nn as TargetsMethods, Nt as AddressBookMethods, O as MemberView, On as PaymentsPayInput, Ot as ActorRequestIssueInput, P as OrganizationAuditLogItem, Pn as fingerprintPaymentIntent, Pt as InboxApproveInput, Q as PayrollTermsUnit, Qn as PaymentStatus$1, Qt as DepositInstructions, R as RoleView, Rn as CompleteProfileInput, Rt as ActivityAnnotationInput, S as CurrentUserContext, Sn as PaymentDocumentsMethods, St as ReadyAccountLifecycle, T as DetectPendingOrgInvitationsResult, Tn as PaymentTiming, Tt as ActorProfileMethods, U as PayrollGroupInput, Un as OrgSetupStep, Ut as ActivityListParams, V as PayrollEngagementTerms, Vn as AuthMethods, Vt as ActivityItem, W as PayrollGroupMember, Wn as PayoutAddress, Wt as ActivityMethods, X as PayrollRunStatus, Xn as PAYMENT_DIRECTIONS, Xt as ActivitySummaryTotal, Y as PayrollRunItemInput, Yn as InboxStatus, Yt as ActivitySummaryParams, Z as PayrollRuns, Zn as PAYMENT_STATUSES, Zt as ActorReference, _ as HoldingsMethods, _n as PaymentDirection, _t as OnboardingMethods, a as ObservationContext, an as DestinationRemoveInput, ar as IdentityEvent, at as PermissionCreateInput, b as SystemHealth, bn as PaymentDocumentRender, bt as PersonOnboarding, c as HostObservability, cn as MeMethods, cr as Readiness, ct as PermissionReplaceInput, d as postHogObservability, dn as OfframpMethods, dr as isClaimed, dt as Budget, en as DestinationAddInput, et as OrganizationPaymentInput, f as CapxulClient, fn as OfframpQuote, fr as isRestoring, ft as OrgMe, g as IdentityRuntimeSendResult, gn as PaymentActivityEvidence, gt as CompletedPersonProfile, h as IdentityRuntime, hn as Payment, ht as AccountsMethods, i as ObservationAdapter, in as DestinationRail, ir as Destination$1, it as PermissionChangeInput, j as OrgTemplate, jn as ResolvedTarget, jt as AddressBookEntry, k as OrgMethods, kn as RecipientResolution, kt as ActorRequestsMethods, l as PostHogObservabilityClient, ln as MeProfile, lr as StateLabel, lt as PermissionRevokeInput, m as IdentityProfileDetails, mn as OfframpStatus, mr as InvocationControls, mt as OrgMeOptions, nn as DestinationListInput, nt as OrganizationPaymentsMethods, o as ObservationDelivery, on as DestinationsMethods, or as IdentityState, ot as PermissionMethods, p as CreateCapxulClientInput, pn as OfframpQuoteInput, pr as IdentityTransition, pt as OrgMeMethod, q as PayrollOptions, qn as Permission, qt as ActivityReference, r as CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, rn as DestinationPayload, rr as TelemetryPort, rt as PermissionAssignInput, s as SdkFailureObservation, sn as FinancialOpsMethods, sr as OrgLane, st as PermissionOptions, t as CapxulClientInput, tn as DestinationKind, tt as OrganizationPaymentItemInput, u as PostHogObservabilityOptions, un as MovementActivityEvidence, ur as destination, ut as PermissionReadResult, v as Holding, vn as PaymentDocumentKind, vt as OrganizationOnboarding, w as CreateOrgInput, wn as PaymentStatus, wt as ActorProfile, x as MediaMethods, xn as PaymentDocumentVerification, xt as PersonOnboardingInput, y as SystemMethods, yn as PaymentDocumentRef, yt as OrganizationOnboardingInput, z as AuthorizeRunInput, zn as IdentityMethods, zt as ActivityDetail } from "./production-BOMKT0n7.mjs";
|
|
3
3
|
import { Hex } from "viem";
|
|
4
4
|
import { Effect, Layer } from "effect";
|
|
5
5
|
//#region ../errors/src/index.d.ts
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as signerFailure, B as isRestoring, C as normalizeExceptionErrorKind, E as safeExceptionLabel, F as CAPXUL_OPERATIONS, I as isCapxulOperation, L as normalizeCapxulOperation, M as PAYMENT_DIRECTIONS, N as PAYMENT_STATUSES, O as isSettingUpLifecycle, R as destination, S as SDK_VERSION, T as projectSdkException, _ as fingerprintPaymentIntent, b as failureDetail, d as embeddedSigner, f as openfortEmbeddedSigner, g as devPrivateKeySigner, h as deriveDevPrivateKey, j as resolveFailureMode, k as injectedWalletSigner, m as openfortEmbeddedWalletPort, p as openfortEmbeddedSignerFromWallet, r as postHogObservability, t as createCapxulClient$1, w as normalizeExceptionOperation, x as EXCEPTION_MESSAGE, y as CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, z as isClaimed } from "./production-
|
|
1
|
+
import { A as signerFailure, B as isRestoring, C as normalizeExceptionErrorKind, E as safeExceptionLabel, F as CAPXUL_OPERATIONS, I as isCapxulOperation, L as normalizeCapxulOperation, M as PAYMENT_DIRECTIONS, N as PAYMENT_STATUSES, O as isSettingUpLifecycle, R as destination, S as SDK_VERSION, T as projectSdkException, _ as fingerprintPaymentIntent, b as failureDetail, d as embeddedSigner, f as openfortEmbeddedSigner, g as devPrivateKeySigner, h as deriveDevPrivateKey, j as resolveFailureMode, k as injectedWalletSigner, m as openfortEmbeddedWalletPort, p as openfortEmbeddedSignerFromWallet, r as postHogObservability, t as createCapxulClient$1, w as normalizeExceptionOperation, x as EXCEPTION_MESSAGE, y as CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, z as isClaimed } from "./production-Y3yqeOSE.mjs";
|
|
2
2
|
import { A as currencySymbolFor, J as toPartyId, M as toAddress, R as toCountryCode, T as EVM_ADDRESS_RE, W as toHandle, at as CapxulError, b as configuredMoneyAssetById, ct as isCapxulError, g as CAPXUL_PAYMENTS_V2_ADDRESS, it as CAPXUL_ERROR_CODES, k as assetIdFor, lt as CHAIN_UPSTREAMS, nt as HANDLE_RE, st as Errors, ut as FAILURE_MODES, z as toCurrencyCode } from "./OAuthBearerAuthClient-hPwtSpEf.mjs";
|
|
3
3
|
import { formatUnits } from "viem";
|
|
4
4
|
import { Effect } from "effect";
|
|
@@ -611,6 +611,8 @@ type BootstrapResolution = {
|
|
|
611
611
|
readonly siteBaseUrl: string;
|
|
612
612
|
readonly openfortPublishableKey: string;
|
|
613
613
|
readonly shieldPublishableKey: string;
|
|
614
|
+
/** Openfort third-party auth provider the signer presents; absent means better-auth. */
|
|
615
|
+
readonly openfortAuthProvider?: "better-auth" | "oidc";
|
|
614
616
|
readonly engineeringTelemetry?: EngineeringTelemetryBootstrapPolicyV1;
|
|
615
617
|
};
|
|
616
618
|
type BootstrapErrorKind = "notAuthenticated" | "network" | "provider" | "malformedBody" | "invalidInput" | "rateLimited";
|
|
@@ -1959,7 +1961,6 @@ type ResendOrgInviteTokenInput = {
|
|
|
1959
1961
|
readonly email: string;
|
|
1960
1962
|
};
|
|
1961
1963
|
type DetectPendingOrgInvitationsInput = Record<never, never>;
|
|
1962
|
-
type PendingOrgSetupInput = Record<never, never>;
|
|
1963
1964
|
type DetectPendingOrgInvitationsResult$1 = {
|
|
1964
1965
|
readonly matched: readonly OrgId[];
|
|
1965
1966
|
};
|
|
@@ -1981,15 +1982,6 @@ interface OrgPort {
|
|
|
1981
1982
|
listRoles(input: ListOrgRolesInput): Effect.Effect<readonly RoleView[], OrgError, never>;
|
|
1982
1983
|
listMembers(input: ListOrgMembersInput): Effect.Effect<readonly MemberView[], OrgError, never>;
|
|
1983
1984
|
pendingMembers?(input: ListOrgMembersInput): Effect.Effect<readonly MemberView[], OrgError, never>;
|
|
1984
|
-
/**
|
|
1985
|
-
* The caller's own Organization whose setup has not finished, or `null`.
|
|
1986
|
-
* Optional: only the Convex read adapter answers it. The client's attach
|
|
1987
|
-
* subscriber starts nothing without it, exactly as a signerless client
|
|
1988
|
-
* starts no readiness cycle.
|
|
1989
|
-
*/
|
|
1990
|
-
pendingSetup?(input: PendingOrgSetupInput): Effect.Effect<{
|
|
1991
|
-
readonly orgId: OrgId;
|
|
1992
|
-
} | null, OrgError, never>;
|
|
1993
1985
|
inviteMember(input: InviteOrgMemberInput): Effect.Effect<MemberView, OrgError, never>;
|
|
1994
1986
|
resendInviteToken?(input: ResendOrgInviteTokenInput): Effect.Effect<MemberView, OrgError, never>;
|
|
1995
1987
|
detectAndAcceptPendingInvitations(input: DetectPendingOrgInvitationsInput): Effect.Effect<DetectPendingOrgInvitationsResult$1, OrgError, never>;
|
|
@@ -2212,6 +2212,8 @@ const BootstrapEnvelope = Schema.Struct({
|
|
|
2212
2212
|
siteBaseUrl: Schema.String,
|
|
2213
2213
|
openfortPublishableKey: Schema.String,
|
|
2214
2214
|
shieldPublishableKey: Schema.String,
|
|
2215
|
+
/** Which Openfort third-party auth provider the signer presents; absent means better-auth. */
|
|
2216
|
+
openfortAuthProvider: Schema.optional(Schema.Literals(["better-auth", "oidc"])),
|
|
2215
2217
|
engineeringTelemetry: Schema.optional(EngineeringTelemetryBootstrapPolicy)
|
|
2216
2218
|
})
|
|
2217
2219
|
});
|
|
@@ -2334,8 +2336,7 @@ const CAPXUL_FUNCTIONS = {
|
|
|
2334
2336
|
listMine: "org/queries:listMine",
|
|
2335
2337
|
listRolesByOrgId: "org/queries:listRolesByOrgId",
|
|
2336
2338
|
loadByOrgId: "org/queries:loadByOrgId",
|
|
2337
|
-
me: "org/queries:me"
|
|
2338
|
-
pendingSetup: "org/queries:pendingSetup"
|
|
2339
|
+
me: "org/queries:me"
|
|
2339
2340
|
},
|
|
2340
2341
|
"smartAccount/actions": {
|
|
2341
2342
|
claim: "smartAccount/actions:claim",
|
|
@@ -5657,7 +5658,7 @@ const moneyExecutionContract = {
|
|
|
5657
5658
|
};
|
|
5658
5659
|
//#endregion
|
|
5659
5660
|
//#region package.json
|
|
5660
|
-
var version = "4.2.0-rc.
|
|
5661
|
+
var version = "4.2.0-rc.8";
|
|
5661
5662
|
//#endregion
|
|
5662
5663
|
//#region src/telemetry/exception-projection.ts
|
|
5663
5664
|
/** Fixed fallback for failures that have no safe message. */
|
|
@@ -8746,6 +8747,7 @@ var HttpBootstrapAdapter = class {
|
|
|
8746
8747
|
siteBaseUrl: normalizeRuntimeUrl("siteBaseUrl", decodedState.siteBaseUrl),
|
|
8747
8748
|
openfortPublishableKey: decodedState.openfortPublishableKey,
|
|
8748
8749
|
shieldPublishableKey: decodedState.shieldPublishableKey,
|
|
8750
|
+
...decodedState.openfortAuthProvider === void 0 ? {} : { openfortAuthProvider: decodedState.openfortAuthProvider },
|
|
8749
8751
|
...decodedEngineeringTelemetry !== void 0 && Result.isSuccess(decodedEngineeringTelemetry) ? { engineeringTelemetry: decodedEngineeringTelemetry.success } : {}
|
|
8750
8752
|
};
|
|
8751
8753
|
},
|
|
@@ -9656,7 +9658,6 @@ function orgIdBody(orgId) {
|
|
|
9656
9658
|
//#region src/adapters/org/ConvexOrganizationAdapter.ts
|
|
9657
9659
|
const DEFAULT_FUNCTIONS$1 = {
|
|
9658
9660
|
listAll: makeFunctionReference(CAPXUL_FUNCTIONS["org/queries"].listAll),
|
|
9659
|
-
pendingSetup: makeFunctionReference(CAPXUL_FUNCTIONS["org/queries"].pendingSetup),
|
|
9660
9661
|
listRoles: makeFunctionReference(CAPXUL_FUNCTIONS["org/queries"].listRolesByOrgId),
|
|
9661
9662
|
listMembers: makeFunctionReference(CAPXUL_FUNCTIONS["org/queries"].listMembersByOrgId),
|
|
9662
9663
|
readTreasury: makeFunctionReference(CAPXUL_FUNCTIONS["org/actions"].readTreasury),
|
|
@@ -9692,9 +9693,6 @@ var ConvexOrganizationAdapter = class {
|
|
|
9692
9693
|
return brandOrgView(wire, treasury, viewerRole);
|
|
9693
9694
|
})))), Effect.catchDefect((cause) => Effect.fail(toOrgError("listOrgs", cause))));
|
|
9694
9695
|
}
|
|
9695
|
-
pendingSetup(input) {
|
|
9696
|
-
return this.#convex.query(this.#fns.pendingSetup, copyInvocationObservation(input, {})).pipe(Effect.mapError((error) => orgErrorFromCapxul("pendingSetup", error.publicError, error)), Effect.map((wire) => wire === null ? null : { orgId: toOrgId(wire.orgId) }), Effect.catchDefect((cause) => Effect.fail(toOrgError("pendingSetup", cause))));
|
|
9697
|
-
}
|
|
9698
9696
|
readTreasury(input) {
|
|
9699
9697
|
return this.#readTreasuryWire(input).pipe(Effect.catchDefect((cause) => Effect.fail(toOrgError("readTreasury", cause))));
|
|
9700
9698
|
}
|
|
@@ -10269,8 +10267,9 @@ function createOpenfortBrowserSignerFromBootstrap(bootstrap, options = {}) {
|
|
|
10269
10267
|
});
|
|
10270
10268
|
throw failOpenfort("configure", "no-secure-context", /* @__PURE__ */ new Error("Web Crypto unavailable: browser is not a secure context"));
|
|
10271
10269
|
}
|
|
10272
|
-
|
|
10273
|
-
|
|
10270
|
+
const authProvider = bootstrap.openfortAuthProvider ?? "better-auth";
|
|
10271
|
+
function accessTokenUrl() {
|
|
10272
|
+
return authProvider === "oidc" ? `${authBaseUrl}/convex/token` : `${authBaseUrl}/get-session`;
|
|
10274
10273
|
}
|
|
10275
10274
|
function encryptionSessionUrl() {
|
|
10276
10275
|
return `${authBaseUrl}/encryption-session`;
|
|
@@ -10293,7 +10292,7 @@ function createOpenfortBrowserSignerFromBootstrap(bootstrap, options = {}) {
|
|
|
10293
10292
|
tokenCalls += 1;
|
|
10294
10293
|
const tokenStartedAt = Date.now();
|
|
10295
10294
|
try {
|
|
10296
|
-
const response = await fetch(
|
|
10295
|
+
const response = await fetch(accessTokenUrl(), {
|
|
10297
10296
|
credentials: "include",
|
|
10298
10297
|
cache: "no-store"
|
|
10299
10298
|
});
|
|
@@ -10306,7 +10305,8 @@ function createOpenfortBrowserSignerFromBootstrap(bootstrap, options = {}) {
|
|
|
10306
10305
|
});
|
|
10307
10306
|
return null;
|
|
10308
10307
|
}
|
|
10309
|
-
const
|
|
10308
|
+
const body = await response.json();
|
|
10309
|
+
const token = (authProvider === "oidc" ? body.token : body.session?.token)?.trim();
|
|
10310
10310
|
if (token === void 0 || token.length === 0) {
|
|
10311
10311
|
diagnostic?.trace("openfort.token", {
|
|
10312
10312
|
ok: false,
|
|
@@ -10318,6 +10318,7 @@ function createOpenfortBrowserSignerFromBootstrap(bootstrap, options = {}) {
|
|
|
10318
10318
|
diagnostic?.trace("openfort.token", {
|
|
10319
10319
|
ok: true,
|
|
10320
10320
|
tokenPresent: true,
|
|
10321
|
+
provider: authProvider,
|
|
10321
10322
|
call: tokenCalls,
|
|
10322
10323
|
duration_ms: Date.now() - tokenStartedAt,
|
|
10323
10324
|
elapsed_ms: sinceCycleStart()
|
|
@@ -10336,7 +10337,7 @@ function createOpenfortBrowserSignerFromBootstrap(bootstrap, options = {}) {
|
|
|
10336
10337
|
baseConfiguration: { publishableKey: bootstrap.openfortPublishableKey },
|
|
10337
10338
|
shieldConfiguration: { shieldPublishableKey: bootstrap.shieldPublishableKey },
|
|
10338
10339
|
thirdPartyAuth: {
|
|
10339
|
-
provider: ThirdPartyOAuthProvider.BETTER_AUTH,
|
|
10340
|
+
provider: authProvider === "oidc" ? ThirdPartyOAuthProvider.OIDC : ThirdPartyOAuthProvider.BETTER_AUTH,
|
|
10340
10341
|
getAccessToken: fetchBetterAuthAccessToken
|
|
10341
10342
|
}
|
|
10342
10343
|
});
|
|
@@ -13420,43 +13421,6 @@ function startSignerReadinessOnClaim(actor, signer) {
|
|
|
13420
13421
|
browserSigner.ensureWalletReady?.().catch(() => {});
|
|
13421
13422
|
});
|
|
13422
13423
|
}
|
|
13423
|
-
/**
|
|
13424
|
-
* Attach a pending Organization when the identity becomes claimed.
|
|
13425
|
-
*
|
|
13426
|
-
* A reload during Organization setup used to leave the app re-submitting the
|
|
13427
|
-
* stored draft, and that second submission raced the controller's resume on
|
|
13428
|
-
* `ReadSession` — the loser was refused with `SUPERSEDED`. The backend already
|
|
13429
|
-
* knows the truth: `pendingSetup()` reports the owner's Organization whose
|
|
13430
|
-
* setup has not finished. The SDK asks once per authenticated user and sends
|
|
13431
|
-
* `AttachOrganization`, which the identity flow runs as `orgLane(…, attach)`.
|
|
13432
|
-
* The app then re-submits nothing.
|
|
13433
|
-
*
|
|
13434
|
-
* The read is fire-and-forget, as the signer readiness cycle is: a failure is
|
|
13435
|
-
* swallowed and the ask is released, so the next state change retries. The ask
|
|
13436
|
-
* is held to ONE per authUserId, so the claimed transitions that follow (the
|
|
13437
|
-
* org lane's own) start no second read, and a new session asks again.
|
|
13438
|
-
*/
|
|
13439
|
-
function attachPendingOrganizationOnClaim(actor, organizationPort) {
|
|
13440
|
-
const pendingSetup = organizationPort?.pendingSetup?.bind(organizationPort);
|
|
13441
|
-
if (pendingSetup === void 0) return () => {};
|
|
13442
|
-
let askedFor = null;
|
|
13443
|
-
return actor.subscribe((state) => {
|
|
13444
|
-
if (state.phase !== "authenticated" || state.account.at !== "claimed") return;
|
|
13445
|
-
if (state.account.org !== null) return;
|
|
13446
|
-
const authUserId = state.session.authUserId;
|
|
13447
|
-
if (askedFor === authUserId) return;
|
|
13448
|
-
askedFor = authUserId;
|
|
13449
|
-
Effect.runPromise(pendingSetup({})).then((pending) => {
|
|
13450
|
-
if (pending === null) return;
|
|
13451
|
-
return Effect.runPromise(actor.ask({
|
|
13452
|
-
_tag: "AttachOrganization",
|
|
13453
|
-
orgId: String(pending.orgId)
|
|
13454
|
-
}));
|
|
13455
|
-
}).catch(() => {
|
|
13456
|
-
askedFor = null;
|
|
13457
|
-
});
|
|
13458
|
-
});
|
|
13459
|
-
}
|
|
13460
13424
|
function assembleCapxulClient(input) {
|
|
13461
13425
|
const observation = input;
|
|
13462
13426
|
const authCache = input.authCache ?? detectAuthCacheAdapter();
|
|
@@ -13486,20 +13450,18 @@ function assembleCapxulClient(input) {
|
|
|
13486
13450
|
}, failureObservation, normalizeCapxulOperation(`identity.${record.event}`), "machine");
|
|
13487
13451
|
});
|
|
13488
13452
|
const unsubscribeSignerReadiness = startSignerReadinessOnClaim(actor, input.signer);
|
|
13489
|
-
const selectedOrgPort = input.orgPort ?? input.orgDeploymentPort;
|
|
13490
|
-
const unsubscribePendingOrganization = attachPendingOrganizationOnClaim(actor, selectedOrgPort);
|
|
13491
13453
|
let stopPromise = null;
|
|
13492
13454
|
const stopActor = () => {
|
|
13493
13455
|
if (stopPromise === null) {
|
|
13494
13456
|
unsubscribeProductTelemetry();
|
|
13495
13457
|
unsubscribeFailureObservation();
|
|
13496
13458
|
unsubscribeSignerReadiness();
|
|
13497
|
-
unsubscribePendingOrganization();
|
|
13498
13459
|
stopPromise = effectRunner.runPromise(Scope.close(scope, Exit.void));
|
|
13499
13460
|
}
|
|
13500
13461
|
return stopPromise;
|
|
13501
13462
|
};
|
|
13502
13463
|
if (input.signal !== void 0) input.signal.addEventListener("abort", () => void stopActor(), { once: true });
|
|
13464
|
+
const selectedOrgPort = input.orgPort ?? input.orgDeploymentPort;
|
|
13503
13465
|
let detectPendingOrgInvitations;
|
|
13504
13466
|
let kickProvisioning;
|
|
13505
13467
|
const financialOps = makeFinancialOpsMethods({
|
package/dist/testing/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h as CapxulResult } from "../OAuthBearerAuthClient-C-ip-z8M.mjs";
|
|
2
|
-
import { er as TelemetryEvent, f as CapxulClient, i as ObservationAdapter, n as ProductionSignerControls, nr as TelemetryIdentifyInput, pr as IdentityTransition, t as CapxulClientInput, tr as TelemetryGroupInput } from "../production-
|
|
2
|
+
import { er as TelemetryEvent, f as CapxulClient, i as ObservationAdapter, n as ProductionSignerControls, nr as TelemetryIdentifyInput, pr as IdentityTransition, t as CapxulClientInput, tr as TelemetryGroupInput } from "../production-BOMKT0n7.mjs";
|
|
3
3
|
import { Effect, Layer } from "effect";
|
|
4
4
|
//#region src/testing/production-client.d.ts
|
|
5
5
|
/** Create the one production client with per-client controls at its signing boundaries. */
|
package/dist/testing/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as fromWei, P as redactTelemetryEvent, a as smartAccountErrorFromCapxul, c as identityErrorFromCapxul, i as assembleCapxulClient, l as convexCallErrorFromCapxul, n as createCapxulClientWithSignerControls, o as accountReadErrorFromCapxul, s as wireChainId, u as bootstrapErrorFromCapxul, v as toWei } from "../production-
|
|
1
|
+
import { D as fromWei, P as redactTelemetryEvent, a as smartAccountErrorFromCapxul, c as identityErrorFromCapxul, i as assembleCapxulClient, l as convexCallErrorFromCapxul, n as createCapxulClientWithSignerControls, o as accountReadErrorFromCapxul, s as wireChainId, u as bootstrapErrorFromCapxul, v as toWei } from "../production-Y3yqeOSE.mjs";
|
|
2
2
|
import { $ as toSessionToken, B as toDurationMs, F as toAuthUserId, G as toJwtToken, H as toEpochMs, K as toKycTier, L as toChainId, M as toAddress, N as toAllowedOrigin, P as toAppId, R as toCountryCode, U as toEpochSeconds, V as toEmail, W as toHandle, Z as toPublishableKey, at as CapxulError, d as authClientPortFromPromiseAdapter, j as toAccountId, n as readClockNow, r as InMemoryAuthCacheAdapter, st as Errors, tt as validateHandle, y as deriveCapxulSafeAddress } from "../OAuthBearerAuthClient-hPwtSpEf.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": "4.2.0-rc.
|
|
3
|
+
"version": "4.2.0-rc.8",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/Xelmar-tech/infrastructure.git",
|
|
@@ -48,11 +48,11 @@
|
|
|
48
48
|
"vite-plus": "0.3.0",
|
|
49
49
|
"vitest": "4.1.11",
|
|
50
50
|
"@capxul/config": "0.3.0",
|
|
51
|
+
"@capxul/observability": "4.2.0-rc.8",
|
|
51
52
|
"@capxul/errors": "0.3.0",
|
|
52
|
-
"@capxul/observability": "4.2.0-rc.6",
|
|
53
53
|
"@capxul/types": "0.3.0",
|
|
54
|
-
"@capxul/
|
|
55
|
-
"@capxul/
|
|
54
|
+
"@capxul/wire": "0.7.0",
|
|
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": {
|