@capxul/sdk 4.1.2 → 4.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{create-capxul-client-DGnNFym7.mjs → create-capxul-client-CipLFLcJ.mjs} +65 -13
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/{observation-D2JnjN2R.d.mts → observation-Bhdq9-l6.d.mts} +8 -2
- package/dist/testing/index.d.mts +1 -1
- package/dist/testing/index.mjs +1 -1
- package/package.json +4 -4
|
@@ -5219,7 +5219,7 @@ const moneyExecutionContract = {
|
|
|
5219
5219
|
};
|
|
5220
5220
|
//#endregion
|
|
5221
5221
|
//#region package.json
|
|
5222
|
-
var version = "4.1.
|
|
5222
|
+
var version = "4.1.3";
|
|
5223
5223
|
//#endregion
|
|
5224
5224
|
//#region src/telemetry/exception-projection.ts
|
|
5225
5225
|
/** Fixed fallback for failures that have no safe message. */
|
|
@@ -6285,8 +6285,18 @@ function parsePaymentRequestKeyState(value) {
|
|
|
6285
6285
|
if (typeof state.key !== "string" || !Array.isArray(state.active) || state.active.some((attempt) => typeof attempt !== "string") || typeof state.resolved !== "boolean") throw new TypeError("Invalid payment request key state");
|
|
6286
6286
|
return state;
|
|
6287
6287
|
}
|
|
6288
|
-
|
|
6289
|
-
|
|
6288
|
+
/** A persisted caller key cannot displace another unresolved or active intent. */
|
|
6289
|
+
function managedRequestKeyState(state, provided, hasActiveAttempt) {
|
|
6290
|
+
if (provided === void 0 || state.key === provided) return state;
|
|
6291
|
+
if (!state.resolved || hasActiveAttempt) throw Errors.invalidInput("requestKey", "another request key is unresolved");
|
|
6292
|
+
return {
|
|
6293
|
+
key: provided,
|
|
6294
|
+
active: [],
|
|
6295
|
+
resolved: false
|
|
6296
|
+
};
|
|
6297
|
+
}
|
|
6298
|
+
async function paymentRequestKeyLifecycle(operation, intent, provided, options) {
|
|
6299
|
+
if (provided !== void 0 && options?.manageProvidedKey !== true) return {
|
|
6290
6300
|
key: provided,
|
|
6291
6301
|
finish: async () => void 0
|
|
6292
6302
|
};
|
|
@@ -6299,11 +6309,12 @@ async function paymentRequestKeyLifecycle(operation, intent, provided) {
|
|
|
6299
6309
|
})}`;
|
|
6300
6310
|
if (typeof window === "undefined") {
|
|
6301
6311
|
const attemptId = randomPaymentRequestKey();
|
|
6302
|
-
|
|
6303
|
-
key: randomPaymentRequestKey(),
|
|
6312
|
+
let state = memoryPaymentRequestKeys.get(slot) ?? {
|
|
6313
|
+
key: provided ?? randomPaymentRequestKey(),
|
|
6304
6314
|
active: [],
|
|
6305
6315
|
resolved: false
|
|
6306
6316
|
};
|
|
6317
|
+
state = managedRequestKeyState(state, provided, state.active.length > 0);
|
|
6307
6318
|
state.active.push(attemptId);
|
|
6308
6319
|
memoryPaymentRequestKeys.set(slot, state);
|
|
6309
6320
|
let finished = false;
|
|
@@ -6327,14 +6338,15 @@ async function paymentRequestKeyLifecycle(operation, intent, provided) {
|
|
|
6327
6338
|
const key = await manager.request(slot, async () => {
|
|
6328
6339
|
const stored = window.localStorage.getItem(slot);
|
|
6329
6340
|
let state = stored === null ? {
|
|
6330
|
-
key: randomPaymentRequestKey(),
|
|
6341
|
+
key: provided ?? randomPaymentRequestKey(),
|
|
6331
6342
|
active: [],
|
|
6332
6343
|
resolved: false
|
|
6333
6344
|
} : parsePaymentRequestKeyState(stored);
|
|
6334
6345
|
const registered = state.active.includes(attemptId);
|
|
6335
6346
|
const active = await heldPaymentAttemptIds(manager, slot);
|
|
6347
|
+
state = managedRequestKeyState(state, provided, active.some((id) => id !== attemptId));
|
|
6336
6348
|
if (!registered && active.every((id) => id === attemptId) && state.resolved) state = {
|
|
6337
|
-
key: randomPaymentRequestKey(),
|
|
6349
|
+
key: provided ?? randomPaymentRequestKey(),
|
|
6338
6350
|
active: [],
|
|
6339
6351
|
resolved: false
|
|
6340
6352
|
};
|
|
@@ -8910,21 +8922,54 @@ function executionDependencies(deps) {
|
|
|
8910
8922
|
signer: deps.signer
|
|
8911
8923
|
};
|
|
8912
8924
|
}
|
|
8925
|
+
/** Read only the exact backend prepare receipt, never an arbitrary signer failure. */
|
|
8926
|
+
function payrollResolution(error, requestKey) {
|
|
8927
|
+
const details = error.details;
|
|
8928
|
+
if (error.code !== "WRONG_STATE" || details?.method !== AUTHORIZE_RUN || details.requestKey !== requestKey || typeof details.commandId !== "string" || typeof details.runId !== "string") return void 0;
|
|
8929
|
+
return details.payrollResolution === "failed" || details.payrollResolution === "settled" ? details.payrollResolution : void 0;
|
|
8930
|
+
}
|
|
8913
8931
|
function makePayrollMethods(deps, orgId) {
|
|
8914
8932
|
const requestKeyScope = deps.requestKeyScope ?? `client-${crypto.randomUUID()}`;
|
|
8915
|
-
async function authorize(input, controls) {
|
|
8933
|
+
async function authorize(input, controls, onRequestKey, onResolved) {
|
|
8916
8934
|
const signal = controls?.signal;
|
|
8917
8935
|
const execution = executionDependencies(deps);
|
|
8918
8936
|
if (execution === null) return {
|
|
8919
8937
|
ok: false,
|
|
8920
8938
|
error: Errors.notImplemented("payroll", "executionComposition")
|
|
8921
8939
|
};
|
|
8922
|
-
const requestKey
|
|
8940
|
+
const { requestKey: provided, ...canonicalInput } = input;
|
|
8941
|
+
const actorId = onRequestKey === void 0 ? void 0 : execution.actor.authSession()?.authUserId;
|
|
8942
|
+
if (onRequestKey !== void 0 && actorId === void 0) return {
|
|
8943
|
+
ok: false,
|
|
8944
|
+
error: Errors.notAuthenticated()
|
|
8945
|
+
};
|
|
8946
|
+
const requestKey = await paymentRequestKeyLifecycle(`${requestKeyScope}:${AUTHORIZE_RUN}`, onRequestKey === void 0 ? {
|
|
8923
8947
|
orgId,
|
|
8924
8948
|
input
|
|
8925
|
-
}
|
|
8949
|
+
} : {
|
|
8950
|
+
actorId,
|
|
8951
|
+
orgId,
|
|
8952
|
+
input: canonicalInput
|
|
8953
|
+
}, provided, onRequestKey === void 0 ? void 0 : { manageProvidedKey: true });
|
|
8954
|
+
try {
|
|
8955
|
+
await onRequestKey?.(requestKey.key);
|
|
8956
|
+
if (onRequestKey !== void 0 && execution.actor.authSession()?.authUserId !== actorId) {
|
|
8957
|
+
await requestKey.finish(false).catch(() => void 0);
|
|
8958
|
+
return {
|
|
8959
|
+
ok: false,
|
|
8960
|
+
error: Errors.notAuthenticated()
|
|
8961
|
+
};
|
|
8962
|
+
}
|
|
8963
|
+
} catch (cause) {
|
|
8964
|
+
await requestKey.finish(false).catch(() => void 0);
|
|
8965
|
+
return {
|
|
8966
|
+
ok: false,
|
|
8967
|
+
error: cause instanceof CapxulError ? cause : Errors.unknown(cause)
|
|
8968
|
+
};
|
|
8969
|
+
}
|
|
8926
8970
|
let authorized;
|
|
8927
8971
|
let preparedClosed = false;
|
|
8972
|
+
let terminalReplay;
|
|
8928
8973
|
const submitted = await executePrepared(execution, async (signerAddress) => {
|
|
8929
8974
|
const prepared = await runIfActive(signal, AUTHORIZE_RUN, () => withInvocationParentSpan(Effect.suspend(() => deps.convexCall.action(payrollContract.authorizeRun, copyInvocationObservation(controls, { input: {
|
|
8930
8975
|
orgId,
|
|
@@ -8934,7 +8979,10 @@ function makePayrollMethods(deps, orgId) {
|
|
|
8934
8979
|
period: input.period,
|
|
8935
8980
|
items: input.items
|
|
8936
8981
|
} }))), controls), deps.runPromise);
|
|
8937
|
-
if (!prepared.ok)
|
|
8982
|
+
if (!prepared.ok) {
|
|
8983
|
+
terminalReplay = payrollResolution(prepared.error, requestKey.key);
|
|
8984
|
+
return prepared;
|
|
8985
|
+
}
|
|
8938
8986
|
authorized = prepared.value.run;
|
|
8939
8987
|
return {
|
|
8940
8988
|
ok: true,
|
|
@@ -8947,8 +8995,12 @@ function makePayrollMethods(deps, orgId) {
|
|
|
8947
8995
|
runId: authorized.id,
|
|
8948
8996
|
items: input.items
|
|
8949
8997
|
})(request), true, () => preparedClosed = true, signal, controls);
|
|
8998
|
+
const resolution = preparedClosed ? "failed" : terminalReplay;
|
|
8999
|
+
if (resolution !== void 0) try {
|
|
9000
|
+
await onResolved?.(resolution);
|
|
9001
|
+
} catch {}
|
|
8950
9002
|
try {
|
|
8951
|
-
await requestKey.finish(submitted.ok ||
|
|
9003
|
+
await requestKey.finish(submitted.ok || resolution !== void 0);
|
|
8952
9004
|
} catch {}
|
|
8953
9005
|
if (!submitted.ok) return submitted;
|
|
8954
9006
|
return authorized === void 0 ? {
|
|
@@ -8970,7 +9022,7 @@ function makePayrollMethods(deps, orgId) {
|
|
|
8970
9022
|
if (controls?.signal?.aborted === true) return yield* Effect.fail(Errors.cancelled({ operation: AUTHORIZE_RUN }));
|
|
8971
9023
|
const parent = yield* Effect.currentSpan.pipe(Effect.orDie);
|
|
8972
9024
|
const result = yield* Effect.tryPromise({
|
|
8973
|
-
try: () => authorize(input, carryInvocationParentSpan(controls, parent)),
|
|
9025
|
+
try: () => authorize(input, carryInvocationParentSpan(controls, parent), options?.onRequestKey, options?.onResolved),
|
|
8974
9026
|
catch: (cause) => cause instanceof CapxulError ? cause : Errors.unknown(cause)
|
|
8975
9027
|
});
|
|
8976
9028
|
return yield* result.ok ? Effect.succeed(result.value) : Effect.fail(result.error);
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { B as EVM_ADDRESS_RE, Ct as RevertSummary, E as Address, G as OrgId, I as CountryCode, J as PayrollGroupId, K as PartyId, M as AuthUserId, P as BudgetId, St as FailureMode, T as AccountId, U as Handle, W as Money, Y as PayrollRunId, _t as isCapxulError, a as SignerStatusStore, bt as ChainUpstream, c as AccountProviderSource, ct as toHandle, d as eip1193AccountProvider, dt as CAPXUL_ERROR_CODES, et as RoleKey, f as localPrivateKeyAccountProvider, ft as CapxulError, g as SmartAccount, h as Session, ht as Errors, i as SignerStatus, j as AuthSession, l as AccountRequirement, lt as toPartyId, m as Profile, mt as CapxulErrorDetails, n as CapxulSigner, o as injectedWalletSigner, ot as toAddress, p as CapxulResult, pt as CapxulErrorCode, r as Eip1193RequestProvider, rt as TesterKind, s as AccountProvider, st as toCountryCode, t as CapxulDigestSigner, u as Eip1193Provider, ut as CAPXUL_PAYMENTS_V2_ADDRESS, vt as CHAIN_UPSTREAMS, w as Account, xt as FAILURE_MODES, yt as ChainCause } from "./signer-C0hZ6Kiy.mjs";
|
|
2
|
-
import { $ as
|
|
2
|
+
import { $ as OrganizationPaymentItemInput, $t as DestinationKind, A as OrgView, An as TargetReference, At as AddressBookLabelInput, B as PayrollGroup, Bn as OrgLifecycle, Bt as ActivityKind, C as DetectPendingOrgInvitationsResult, Cn as PaymentTiming, Ct as ActorProfileMethods, D as OrgMethods, Dn as RecipientResolution, Dt as ActorRequestsMethods, E as MemberView, En as PaymentsPayInput, Et as ActorRequestIssueInput, F as RoleSpendCap, Fn as isSettingUpLifecycle, Ft as ActivityAnnotation, G as PayrollOptions, Gn as SubmittedPermissionExecution, Gt as ActivityReference, H as PayrollGroupMember, Hn as ActorRef, Ht as ActivityMethods, I as RoleView, In as CompleteProfileInput, It as ActivityAnnotationInput, J as PayrollRunStatus, Jn as PAYMENT_STATUSES, Jt as ActivitySummaryTotal, K as PayrollRun, Kn as InboxStatus, Kt as ActivitySummary, L as AuthorizeRunInput, Ln as IdentityMethods, Lt as ActivityDetail, M as OrganizationAuditLogItem, Mn as fingerprintPaymentIntent, Mt as InboxApproveInput, N as ResendInviteTokenInput, Nn as AccountLifecycle, Nt as InboxItem, O as OrgScopedMethods, On as Ref, Ot as AddressBookAddInput, P as RoleDefinition, Pn as AccountSetupStep, Pt as InboxMethods, Q as OrganizationPaymentInput, Qt as DestinationAddInput, R as AuthorizeRunOptions, Rn as SmartAccountMethods, Rt as ActivityFilter, S as CreateOrgInput, Sn as PaymentStatus, St as ActorProfile, T as MemberStatus, Tn as PaymentsMethods, Tt as ActorRequest, U as PayrollGroupsMethods, Un as CurrentHoldings, Ut as ActivityPage, V as PayrollGroupInput, Vn as OrgSetupStep, Vt as ActivityListParams, W as PayrollMethods, Wn as Permission, Wt as ActivityRange, X as PayrollTermsUnit, Xn as RequestStatus, Xt as DepositInstructions, Y as PayrollRuns, Yn as PaymentStatus$1, Yt as ActorReference, Z as OrganizationPaymentBatchInput, Zt as Destination, _ as SystemMethods, _n as PaymentDocumentRef, _t as OrganizationOnboardingInput, a as SdkFailureObservation, an as FinancialOpsMethods, ar as Readiness, at as PermissionOptions, b as CurrentUserContext, bn as PaymentDocumentsMethods, bt as ReadyAccountLifecycle, c as PostHogObservabilityOptions, cn as MovementActivityEvidence, cr as isClaimed, ct as PermissionReadResult, d as CreateCapxulClientInput, dn as OfframpQuoteInput, dr as InvocationControls, dt as OrgMeMethod, en as DestinationListInput, er as TelemetryPort, et as OrganizationPaymentsMethods, f as IdentityProfileDetails, fn as OfframpStatus, ft as OrgMeOptions, g as Holding, gn as PaymentDocumentKind, gt as OrganizationOnboarding, h as HoldingsMethods, hn as PaymentDirection, ht as OnboardingMethods, i as ObservationDelivery, in as DestinationsMethods, ir as OrgLane, it as PermissionMethods, j as OrganizationAccount, jn as TargetsMethods, jt as AddressBookMethods, k as OrgTemplate, kn as ResolvedTarget, kt as AddressBookEntry, l as postHogObservability, ln as OfframpMethods, lr as isRestoring, lt as Budget, m as IdentityRuntimeSendResult, mn as PaymentActivityEvidence, mt as CompletedPersonProfile, n as ObservationAdapter, nn as DestinationRail, nr as IdentityEvent, nt as PermissionChangeInput, o as HostObservability, on as MeMethods, or as StateLabel, ot as PermissionReplaceInput, p as IdentityRuntime, pn as Payment, pt as AccountsMethods, q as PayrollRunItemInput, qn as PAYMENT_DIRECTIONS, qt as ActivitySummaryParams, r as ObservationContext, rn as DestinationRemoveInput, rr as IdentityState, rt as PermissionCreateInput, s as PostHogObservabilityClient, sn as MeProfile, sr as destination, st as PermissionRevokeInput, t as CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, tn as DestinationPayload, tr as Destination$1, tt as PermissionAssignInput, u as CapxulClient, un as OfframpQuote, ur as IdentityTransition, ut as OrgMe, v as SystemHealth, vn as PaymentDocumentRender, vt as PersonOnboarding, w as InviteMemberInput, wn as PaymentType, wt as ActorRelationshipMethods, x as CurrentUserMethods, xn as PaymentMoney, xt as AccountMethods, y as MediaMethods, yn as PaymentDocumentVerification, yt as PersonOnboardingInput, z as PayrollEngagementTerms, zn as AuthMethods, zt as ActivityItem } from "./observation-Bhdq9-l6.mjs";
|
|
3
3
|
import "./OAuthBearerAuthClient-D-DLYlKj.mjs";
|
|
4
4
|
import { Context, Effect, Layer } from "effect";
|
|
5
5
|
import { Hex } from "viem";
|
|
@@ -626,4 +626,4 @@ declare function captureException(telemetry: TelemetryPort, error: unknown, cont
|
|
|
626
626
|
*/
|
|
627
627
|
declare function captureExceptionSync(telemetry: TelemetryPort, error: unknown, context?: HandledErrorReportContext): void;
|
|
628
628
|
//#endregion
|
|
629
|
-
export { type Account, type AccountId, type AccountLifecycle, type AccountMethods, type AccountProvider, type AccountProviderSource, type AccountRequirement, type AccountSetupStep, type AccountsMethods, type ActivityAnnotation, type ActivityAnnotationInput, type ActivityDetail, type ActivityFilter, type ActivityItem, type ActivityKind, type ActivityListParams, type ActivityMethods, type ActivityPage, type ActivityPhase, type ActivityRange, type ActivityReference, type ActivitySummary, type ActivitySummaryParams, type ActivitySummaryTotal, type ActorProfile, type ActorProfileMethods, type ActorRef, type ActorReference, type ActorRelationshipMethods, type ActorRequest, type ActorRequestIssueInput, type ActorRequestsMethods, type Address, type AddressBookAddInput, type AddressBookEntry, type AddressBookLabelInput, type AddressBookMethods, type AuthMethods, type AuthSession, type AuthUserId, type AuthorizeRunInput, type Budget, type BudgetId, CAPXUL_ERROR_CODES, CAPXUL_OPERATIONS, CAPXUL_PAYMENTS_V2_ADDRESS, CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, CHAIN_UPSTREAMS, type CapxulClient, type CapxulClientInput, type CapxulDigestSigner, CapxulError, type CapxulErrorCode, type CapxulErrorDetails, type CapxulOperation, type CapxulResult, type CapxulSigner, type ChainCause, type ChainUpstream, type CompleteProfileInput, type CompletedPersonProfile, type CountryCode, type CreateCapxulClientInput, type CreateOrgInput, type CurrentHoldings, type CurrentUserContext, type CurrentUserMethods, type DepositInstructions, type Destination, type DestinationAddInput, type DestinationKind, type DestinationListInput, type DestinationPayload, type DestinationRail, type DestinationRemoveInput, type DestinationsMethods, type DetectPendingOrgInvitationsResult, type DevPrivateKeySignerInput, EVM_ADDRESS_RE, type Eip1193Provider, type Eip1193RequestProvider, Errors, FAILURE_MODES, type FailureMode, type FinancialOpsMethods, HANDLE_RE, type Handle, type HandledErrorReportContext, type Holding, type HoldingsMethods, type HostObservability, type Destination$1 as IdentityDestination, type IdentityEvent, type IdentityMethods, type IdentityProfileDetails, type IdentityRuntime, type IdentityRuntimeSendResult, type IdentityState, type IdentityTransition, type InboxApproveInput, type InboxItem, type InboxMethods, type InviteMemberInput, type InvocationControls, type MeMethods, type MeProfile, type MediaMethods, type MemberStatus, type MemberView, type Money, type MoneyParseError, type MoneyParseErrorReason, type MovementActivityEvidence, type NormalizedCapxulOperation, type ObservationAdapter, type ObservationContext, type ObservationDelivery, type OfframpMethods, type OfframpQuote, type OfframpQuoteInput, type OfframpStatus, type OnboardingMethods, type OpenfortEmbeddedSignerInput, type OpenfortEmbeddedWalletApi, type OpenfortEmbeddedWalletPort, type OrgId, type OrgLane, type OrgLifecycle, type OrgMe, type OrgMeMethod, type OrgMeOptions, type OrgMethods, type OrgScopedMethods, type OrgSetupStep, type OrgTemplate, type OrgView, type OrganizationAccount, type OrganizationAuditLogItem, type OrganizationOnboarding, type OrganizationOnboardingInput, type OrganizationPaymentBatchInput, type OrganizationPaymentInput, type OrganizationPaymentItemInput, type OrganizationPaymentsMethods, PAYMENT_DIRECTIONS, PAYMENT_STATUSES, type PartyId, type Payment, type PaymentActivityEvidence, type PaymentDirection, type PaymentDocumentKind, type PaymentDocumentRef, type PaymentDocumentRender, type PaymentDocumentVerification, type PaymentDocumentsMethods, type PaymentMoney, type PaymentStatus, type PaymentTiming, type PaymentType, type PaymentsMethods, type PaymentsPayInput, type PayrollEngagementTerms, type PayrollGroup, type PayrollGroupId, type PayrollGroupInput, type PayrollGroupMember, type PayrollGroupsMethods, type PayrollMethods, type PayrollOptions, type PayrollRun, type PayrollRunId, type PayrollRunItemInput, type PayrollRunStatus, type PayrollRuns, type PayrollTermsUnit, type Permission, type PermissionAssignInput, type PermissionChangeInput, type PermissionCreateInput, type PermissionMethods, type PermissionOptions, type PermissionReadResult, type PermissionReplaceInput, type PermissionRevokeInput, type PersonOnboarding, type PersonOnboardingInput, type PostHogObservabilityClient, type PostHogObservabilityOptions, type Profile, type Readiness, type ReadyAccountLifecycle, type RecipientResolution, type Ref, type ResendInviteTokenInput, type ResolvedTarget, type RevertSummary, type RoleDefinition, type RoleKey, type RoleSpendCap, type RoleView, type SdkFailureObservation, type Session, type SignerStatus, type SignerStatusStore, type SmartAccount, type SmartAccountMethods, type StateLabel, type SubmittedPermissionExecution, type SystemHealth, type SystemMethods, type TargetReference, type TargetsMethods, type TelemetryPort, type TesterKind, captureException, captureExceptionSync, createCapxulClient, deriveDevPrivateKey, devPrivateKeySigner, eip1193AccountProvider, embeddedSigner, fingerprintPaymentIntent, formatMoney, inboxPhase, injectedWalletSigner, isCapxulError, isCapxulOperation, isClaimed, isMoneyParseError, isRestoring, isSettingUpLifecycle, localPrivateKeyAccountProvider, normalizeCapxulOperation, openfortEmbeddedSigner, openfortEmbeddedSignerFromWallet, openfortEmbeddedWalletPort, parseMoney, paymentPhase, postHogObservability, requestPhase, destination as resolveIdentityDestination, toCountryCode, toAddress as toEvmAddress, toHandle, toPartyId };
|
|
629
|
+
export { type Account, type AccountId, type AccountLifecycle, type AccountMethods, type AccountProvider, type AccountProviderSource, type AccountRequirement, type AccountSetupStep, type AccountsMethods, type ActivityAnnotation, type ActivityAnnotationInput, type ActivityDetail, type ActivityFilter, type ActivityItem, type ActivityKind, type ActivityListParams, type ActivityMethods, type ActivityPage, type ActivityPhase, type ActivityRange, type ActivityReference, type ActivitySummary, type ActivitySummaryParams, type ActivitySummaryTotal, type ActorProfile, type ActorProfileMethods, type ActorRef, type ActorReference, type ActorRelationshipMethods, type ActorRequest, type ActorRequestIssueInput, type ActorRequestsMethods, type Address, type AddressBookAddInput, type AddressBookEntry, type AddressBookLabelInput, type AddressBookMethods, type AuthMethods, type AuthSession, type AuthUserId, type AuthorizeRunInput, type AuthorizeRunOptions, type Budget, type BudgetId, CAPXUL_ERROR_CODES, CAPXUL_OPERATIONS, CAPXUL_PAYMENTS_V2_ADDRESS, CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, CHAIN_UPSTREAMS, type CapxulClient, type CapxulClientInput, type CapxulDigestSigner, CapxulError, type CapxulErrorCode, type CapxulErrorDetails, type CapxulOperation, type CapxulResult, type CapxulSigner, type ChainCause, type ChainUpstream, type CompleteProfileInput, type CompletedPersonProfile, type CountryCode, type CreateCapxulClientInput, type CreateOrgInput, type CurrentHoldings, type CurrentUserContext, type CurrentUserMethods, type DepositInstructions, type Destination, type DestinationAddInput, type DestinationKind, type DestinationListInput, type DestinationPayload, type DestinationRail, type DestinationRemoveInput, type DestinationsMethods, type DetectPendingOrgInvitationsResult, type DevPrivateKeySignerInput, EVM_ADDRESS_RE, type Eip1193Provider, type Eip1193RequestProvider, Errors, FAILURE_MODES, type FailureMode, type FinancialOpsMethods, HANDLE_RE, type Handle, type HandledErrorReportContext, type Holding, type HoldingsMethods, type HostObservability, type Destination$1 as IdentityDestination, type IdentityEvent, type IdentityMethods, type IdentityProfileDetails, type IdentityRuntime, type IdentityRuntimeSendResult, type IdentityState, type IdentityTransition, type InboxApproveInput, type InboxItem, type InboxMethods, type InviteMemberInput, type InvocationControls, type MeMethods, type MeProfile, type MediaMethods, type MemberStatus, type MemberView, type Money, type MoneyParseError, type MoneyParseErrorReason, type MovementActivityEvidence, type NormalizedCapxulOperation, type ObservationAdapter, type ObservationContext, type ObservationDelivery, type OfframpMethods, type OfframpQuote, type OfframpQuoteInput, type OfframpStatus, type OnboardingMethods, type OpenfortEmbeddedSignerInput, type OpenfortEmbeddedWalletApi, type OpenfortEmbeddedWalletPort, type OrgId, type OrgLane, type OrgLifecycle, type OrgMe, type OrgMeMethod, type OrgMeOptions, type OrgMethods, type OrgScopedMethods, type OrgSetupStep, type OrgTemplate, type OrgView, type OrganizationAccount, type OrganizationAuditLogItem, type OrganizationOnboarding, type OrganizationOnboardingInput, type OrganizationPaymentBatchInput, type OrganizationPaymentInput, type OrganizationPaymentItemInput, type OrganizationPaymentsMethods, PAYMENT_DIRECTIONS, PAYMENT_STATUSES, type PartyId, type Payment, type PaymentActivityEvidence, type PaymentDirection, type PaymentDocumentKind, type PaymentDocumentRef, type PaymentDocumentRender, type PaymentDocumentVerification, type PaymentDocumentsMethods, type PaymentMoney, type PaymentStatus, type PaymentTiming, type PaymentType, type PaymentsMethods, type PaymentsPayInput, type PayrollEngagementTerms, type PayrollGroup, type PayrollGroupId, type PayrollGroupInput, type PayrollGroupMember, type PayrollGroupsMethods, type PayrollMethods, type PayrollOptions, type PayrollRun, type PayrollRunId, type PayrollRunItemInput, type PayrollRunStatus, type PayrollRuns, type PayrollTermsUnit, type Permission, type PermissionAssignInput, type PermissionChangeInput, type PermissionCreateInput, type PermissionMethods, type PermissionOptions, type PermissionReadResult, type PermissionReplaceInput, type PermissionRevokeInput, type PersonOnboarding, type PersonOnboardingInput, type PostHogObservabilityClient, type PostHogObservabilityOptions, type Profile, type Readiness, type ReadyAccountLifecycle, type RecipientResolution, type Ref, type ResendInviteTokenInput, type ResolvedTarget, type RevertSummary, type RoleDefinition, type RoleKey, type RoleSpendCap, type RoleView, type SdkFailureObservation, type Session, type SignerStatus, type SignerStatusStore, type SmartAccount, type SmartAccountMethods, type StateLabel, type SubmittedPermissionExecution, type SystemHealth, type SystemMethods, type TargetReference, type TargetsMethods, type TelemetryPort, type TesterKind, captureException, captureExceptionSync, createCapxulClient, deriveDevPrivateKey, devPrivateKeySigner, eip1193AccountProvider, embeddedSigner, fingerprintPaymentIntent, formatMoney, inboxPhase, injectedWalletSigner, isCapxulError, isCapxulOperation, isClaimed, isMoneyParseError, isRestoring, isSettingUpLifecycle, localPrivateKeyAccountProvider, normalizeCapxulOperation, openfortEmbeddedSigner, openfortEmbeddedSignerFromWallet, openfortEmbeddedWalletPort, parseMoney, paymentPhase, postHogObservability, requestPhase, destination as resolveIdentityDestination, toCountryCode, toAddress as toEvmAddress, toHandle, toPartyId };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as stampTelemetryEnvelope, A as safeExceptionLabel, B as resolveFailureMode, C as observeFailedResult, D as normalizeExceptionErrorKind, E as SDK_VERSION$1, F as causeChain, G as sanitizeObservationContext, H as readInvocationObservation, I as injectedWalletSigner, J as CAPXUL_FUNCTIONS, K as PAYMENT_DIRECTIONS, L as isSignerNotReadySignal, M as fromWei, N as isSettingUpLifecycle, O as normalizeExceptionOperation, P as formatTraceparent, Q as redactTelemetryProps, R as openfortSignerNotReadyCode, S as observationContextProps, T as EXCEPTION_MESSAGE, U as OBSERVATION_CONTEXT_HEADER, V as copyInvocationObservation, W as encodeObservationContextHeader, X as EngineeringTelemetryBootstrapPolicy, Y as BootstrapEnvelope, _ as fingerprintPaymentIntent, a as AccountReadPortTag, at as isRestoring, b as failureDetail, c as retryIdempotentRead, d as IdentityPortTag, et as CAPXUL_OPERATIONS, f as identityErrorFromCapxul, g as bootstrapErrorFromCapxul, h as BootstrapPortTag, i as smartAccountErrorFromCapxul, it as isClaimed, j as version, k as projectSdkException, l as PRODUCT_INVOCATION, m as convexCallErrorFromCapxul, n as detectAuthCacheAdapter, nt as normalizeCapxulOperation, o as accountReadErrorFromCapxul, p as ConvexCallPortTag, q as PAYMENT_STATUSES, r as SmartAccountPortTag, rt as destination, s as TelemetryPortTag, t as assembleCapxulClient, tt as isCapxulOperation, u as wireChainId, v as toWei, w as postHogFailureObservation, x as failureEvidenceProps, y as CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, z as signerFailure } from "./create-capxul-client-
|
|
1
|
+
import { $ as stampTelemetryEnvelope, A as safeExceptionLabel, B as resolveFailureMode, C as observeFailedResult, D as normalizeExceptionErrorKind, E as SDK_VERSION$1, F as causeChain, G as sanitizeObservationContext, H as readInvocationObservation, I as injectedWalletSigner, J as CAPXUL_FUNCTIONS, K as PAYMENT_DIRECTIONS, L as isSignerNotReadySignal, M as fromWei, N as isSettingUpLifecycle, O as normalizeExceptionOperation, P as formatTraceparent, Q as redactTelemetryProps, R as openfortSignerNotReadyCode, S as observationContextProps, T as EXCEPTION_MESSAGE, U as OBSERVATION_CONTEXT_HEADER, V as copyInvocationObservation, W as encodeObservationContextHeader, X as EngineeringTelemetryBootstrapPolicy, Y as BootstrapEnvelope, _ as fingerprintPaymentIntent, a as AccountReadPortTag, at as isRestoring, b as failureDetail, c as retryIdempotentRead, d as IdentityPortTag, et as CAPXUL_OPERATIONS, f as identityErrorFromCapxul, g as bootstrapErrorFromCapxul, h as BootstrapPortTag, i as smartAccountErrorFromCapxul, it as isClaimed, j as version, k as projectSdkException, l as PRODUCT_INVOCATION, m as convexCallErrorFromCapxul, n as detectAuthCacheAdapter, nt as normalizeCapxulOperation, o as accountReadErrorFromCapxul, p as ConvexCallPortTag, q as PAYMENT_STATUSES, r as SmartAccountPortTag, rt as destination, s as TelemetryPortTag, t as assembleCapxulClient, tt as isCapxulOperation, u as wireChainId, v as toWei, w as postHogFailureObservation, x as failureEvidenceProps, y as CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, z as signerFailure } from "./create-capxul-client-CipLFLcJ.mjs";
|
|
2
2
|
import { $ as CapxulError, A as toAuthUserId, B as toJwtToken, D as toAddress, E as toAccountId, F as toDurationMs, H as toOrgId, I as toEmail, J as toSessionToken, K as toPublishableKey, L as toEpochMs, M as toChainId, N as toCountryCode, O as toAllowedOrigin, P as toCurrencyCode, Q as CAPXUL_ERROR_CODES, R as toEpochSeconds, T as currencySymbolFor, U as toPartyId, V as toKycTier, X as HANDLE_RE, Y as toTesterKind, Z as decodeConvexError, d as AuthClientError, f as AuthClientPortTag, g as BASE_SEPOLIA_CHAIN_ID, h as normalizeBindingEmail, it as FAILURE_MODES, l as ClockPortTag, m as CAPXUL_PAYMENTS_V2_ADDRESS, nt as isCapxulError, q as toRoleKey, rt as CHAIN_UPSTREAMS, s as AuthCachePortTag, tt as Errors, u as authClientPortFromPromiseAdapter, x as EVM_ADDRESS_RE, z as toHandle } from "./clock-C2AUlq1V.mjs";
|
|
3
3
|
import { n as SystemClockLayer } from "./OAuthBearerAuthClient-BHvDR8_0.mjs";
|
|
4
4
|
import { Cause, Context, Data, Duration, Effect, Exit, Layer, Result, Schedule, SchemaIssue, SchemaParser, Scope, Tracer } from "effect";
|
|
@@ -2188,6 +2188,12 @@ interface AuthorizeRunInput {
|
|
|
2188
2188
|
type PayrollOptions = {
|
|
2189
2189
|
readonly signal?: AbortSignal;
|
|
2190
2190
|
};
|
|
2191
|
+
type AuthorizeRunOptions = PayrollOptions & {
|
|
2192
|
+
/** Persist this SDK-allocated key before the first backend write. Reject to prevent execution. */
|
|
2193
|
+
readonly onRequestKey?: (key: string) => void | Promise<void>;
|
|
2194
|
+
/** A prior command is conclusively closed. The current failed result remains a failure. */
|
|
2195
|
+
readonly onResolved?: (outcome: "failed" | "settled") => void | Promise<void>;
|
|
2196
|
+
};
|
|
2191
2197
|
interface PayrollGroupsMethods {
|
|
2192
2198
|
list(options?: PayrollOptions): Promise<CapxulResult<readonly PayrollGroup[]>>;
|
|
2193
2199
|
save(input: PayrollGroupInput, options?: PayrollOptions): Promise<CapxulResult<PayrollGroup>>;
|
|
@@ -2195,7 +2201,7 @@ interface PayrollGroupsMethods {
|
|
|
2195
2201
|
}
|
|
2196
2202
|
interface PayrollMethods {
|
|
2197
2203
|
runs(options?: PayrollOptions): Promise<CapxulResult<PayrollRuns>>;
|
|
2198
|
-
authorizeRun(input: AuthorizeRunInput, options?:
|
|
2204
|
+
authorizeRun(input: AuthorizeRunInput, options?: AuthorizeRunOptions): Promise<CapxulResult<PayrollRun>>;
|
|
2199
2205
|
/** The active engagement terms of the org's employed people (ruling Q3). */
|
|
2200
2206
|
terms(options?: PayrollOptions): Promise<CapxulResult<readonly PayrollEngagementTerms[]>>;
|
|
2201
2207
|
readonly groups: PayrollGroupsMethods;
|
|
@@ -2829,4 +2835,4 @@ interface ObservationAdapter {
|
|
|
2829
2835
|
/** Stable PostHog event used for typed failures that are expected product outcomes. */
|
|
2830
2836
|
declare const CAPXUL_SDK_EXPECTED_OUTCOME_EVENT = "capxul_sdk_expected_outcome";
|
|
2831
2837
|
//#endregion
|
|
2832
|
-
export {
|
|
2838
|
+
export { OrganizationPaymentItemInput as $, TelemetryIdentifyInput as $n, DestinationKind as $t, OrgView as A, TargetReference as An, AddressBookLabelInput as At, PayrollGroup as B, OrgLifecycle as Bn, ActivityKind as Bt, DetectPendingOrgInvitationsResult as C, PaymentTiming as Cn, ActorProfileMethods as Ct, OrgMethods as D, RecipientResolution as Dn, ActorRequestsMethods as Dt, MemberView as E, PaymentsPayInput as En, ActorRequestIssueInput as Et, RoleSpendCap as F, isSettingUpLifecycle as Fn, ActivityAnnotation as Ft, PayrollOptions as G, SubmittedPermissionExecution as Gn, ActivityReference as Gt, PayrollGroupMember as H, ActorRef as Hn, ActivityMethods as Ht, RoleView as I, CompleteProfileInput as In, ActivityAnnotationInput as It, PayrollRunStatus as J, PAYMENT_STATUSES as Jn, ActivitySummaryTotal as Jt, PayrollRun as K, InboxStatus as Kn, ActivitySummary as Kt, AuthorizeRunInput as L, IdentityMethods as Ln, ActivityDetail as Lt, OrganizationAuditLogItem as M, fingerprintPaymentIntent as Mn, InboxApproveInput as Mt, ResendInviteTokenInput as N, AccountLifecycle as Nn, InboxItem as Nt, OrgScopedMethods as O, Ref$1 as On, AddressBookAddInput as Ot, RoleDefinition as P, AccountSetupStep as Pn, InboxMethods as Pt, OrganizationPaymentInput as Q, TelemetryGroupInput as Qn, DestinationAddInput as Qt, AuthorizeRunOptions as R, SmartAccountMethods as Rn, ActivityFilter as Rt, CreateOrgInput as S, PaymentStatus as Sn, ActorProfile as St, MemberStatus as T, PaymentsMethods as Tn, ActorRequest as Tt, PayrollGroupsMethods as U, CurrentHoldings as Un, ActivityPage as Ut, PayrollGroupInput as V, OrgSetupStep as Vn, ActivityListParams as Vt, PayrollMethods as W, Permission as Wn, ActivityRange as Wt, PayrollTermsUnit as X, RequestStatus as Xn, DepositInstructions as Xt, PayrollRuns as Y, PaymentStatus$1 as Yn, ActorReference as Yt, OrganizationPaymentBatchInput as Z, TelemetryEvent as Zn, Destination as Zt, SystemMethods as _, PaymentDocumentRef as _n, OrganizationOnboardingInput as _t, SdkFailureObservation as a, FinancialOpsMethods as an, Readiness as ar, PermissionOptions as at, CurrentUserContext as b, PaymentDocumentsMethods as bn, ReadyAccountLifecycle as bt, PostHogObservabilityOptions as c, MovementActivityEvidence as cn, isClaimed as cr, PermissionReadResult as ct, CreateCapxulClientInput as d, OfframpQuoteInput as dn, InvocationControls as dr, OrgMeMethod as dt, DestinationListInput as en, TelemetryPort as er, OrganizationPaymentsMethods as et, IdentityProfileDetails as f, OfframpStatus as fn, OrgMeOptions as ft, Holding as g, PaymentDocumentKind as gn, OrganizationOnboarding as gt, HoldingsMethods as h, PaymentDirection as hn, OnboardingMethods as ht, ObservationDelivery as i, DestinationsMethods as in, OrgLane as ir, PermissionMethods as it, OrganizationAccount as j, TargetsMethods as jn, AddressBookMethods as jt, OrgTemplate as k, ResolvedTarget as kn, AddressBookEntry as kt, postHogObservability as l, OfframpMethods as ln, isRestoring as lr, Budget as lt, IdentityRuntimeSendResult as m, PaymentActivityEvidence as mn, CompletedPersonProfile as mt, ObservationAdapter as n, DestinationRail as nn, IdentityEvent as nr, PermissionChangeInput as nt, HostObservability as o, MeMethods as on, StateLabel as or, PermissionReplaceInput as ot, IdentityRuntime as p, Payment as pn, AccountsMethods as pt, PayrollRunItemInput as q, PAYMENT_DIRECTIONS as qn, ActivitySummaryParams as qt, ObservationContext as r, DestinationRemoveInput as rn, IdentityState as rr, PermissionCreateInput as rt, PostHogObservabilityClient as s, MeProfile as sn, destination as sr, PermissionRevokeInput as st, CAPXUL_SDK_EXPECTED_OUTCOME_EVENT as t, DestinationPayload as tn, Destination$1 as tr, PermissionAssignInput as tt, CapxulClient as u, OfframpQuote as un, IdentityTransition as ur, OrgMe as ut, SystemHealth as v, PaymentDocumentRender as vn, PersonOnboarding as vt, InviteMemberInput as w, PaymentType as wn, ActorRelationshipMethods as wt, CurrentUserMethods as x, PaymentMoney as xn, AccountMethods as xt, MediaMethods as y, PaymentDocumentVerification as yn, PersonOnboardingInput as yt, PayrollEngagementTerms as z, AuthMethods as zn, ActivityItem as zt };
|
package/dist/testing/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $n as TelemetryIdentifyInput, Qn as TelemetryGroupInput, Zn as TelemetryEvent, n as ObservationAdapter, u as CapxulClient, ur as IdentityTransition } from "../observation-Bhdq9-l6.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,4 +1,4 @@
|
|
|
1
|
-
import { M as fromWei, Z as redactTelemetryEvent, f as identityErrorFromCapxul, g as bootstrapErrorFromCapxul, i as smartAccountErrorFromCapxul, m as convexCallErrorFromCapxul, o as accountReadErrorFromCapxul, t as assembleCapxulClient, u as wireChainId, v as toWei } from "../create-capxul-client-
|
|
1
|
+
import { M as fromWei, Z as redactTelemetryEvent, f as identityErrorFromCapxul, g as bootstrapErrorFromCapxul, i as smartAccountErrorFromCapxul, m as convexCallErrorFromCapxul, o as accountReadErrorFromCapxul, t as assembleCapxulClient, u as wireChainId, v as toWei } from "../create-capxul-client-CipLFLcJ.mjs";
|
|
2
2
|
import { $ as CapxulError, A as toAuthUserId, B as toJwtToken, D as toAddress, E as toAccountId, F as toDurationMs, I as toEmail, J as toSessionToken, K as toPublishableKey, L as toEpochMs, M as toChainId, N as toCountryCode, O as toAllowedOrigin, R as toEpochSeconds, V as toKycTier, _ as deriveCapxulSafeAddress, k as toAppId, n as InMemoryAuthCacheAdapter, t as readClockNow, tt as Errors, u as authClientPortFromPromiseAdapter, v as validateHandle, z as toHandle } from "../clock-C2AUlq1V.mjs";
|
|
3
3
|
import { Effect, Result, Semaphore } from "effect";
|
|
4
4
|
import { keccak256 } from "viem";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capxul/sdk",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.3",
|
|
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/typescript-config": "0.0.0",
|
|
52
51
|
"@capxul/errors": "0.3.0",
|
|
53
52
|
"@capxul/types": "0.3.0",
|
|
54
|
-
"@capxul/
|
|
55
|
-
"@capxul/
|
|
53
|
+
"@capxul/observability": "4.1.3",
|
|
54
|
+
"@capxul/typescript-config": "0.0.0",
|
|
55
|
+
"@capxul/wire": "0.7.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": {
|