@capxul/sdk-react 4.2.0-rc.12 → 4.2.0-rc.14
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 +28 -2
- package/dist/index.mjs +23 -3
- 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": "ad9386dd8d539fea17964d05292fc0ca16495d2f",
|
|
4
|
+
"tree": "87b1723ed13d7be72487cbcbbfded24b0ac850e5",
|
|
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-react",
|
|
10
|
-
"version": "4.2.0-rc.
|
|
10
|
+
"version": "4.2.0-rc.14"
|
|
11
11
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -200,12 +200,21 @@ type UseCapxulCreateOrgReturn = UseMutationResult<OrgView, CapxulError, CreateOr
|
|
|
200
200
|
declare function useCapxulCreateOrg(): UseCapxulCreateOrgReturn;
|
|
201
201
|
//#endregion
|
|
202
202
|
//#region src/hooks/use-capxul-invite-member.d.ts
|
|
203
|
+
/**
|
|
204
|
+
* R06 (#1964): `options` is the browser attempt the caller captured before the
|
|
205
|
+
* person pressed Send. It reaches the SDK operation unchanged, so the durable
|
|
206
|
+
* `org_invite_sent` and the later `org_invite_progressed` carry that attempt's
|
|
207
|
+
* correlation. Absent, the invitation keeps its own invocation context.
|
|
208
|
+
*/
|
|
209
|
+
type UseCapxulInviteMemberInput = InviteMemberInput & {
|
|
210
|
+
readonly options?: InvocationOptions;
|
|
211
|
+
};
|
|
203
212
|
/**
|
|
204
213
|
* Invite a member to an Organization by email. The hook uses the closed-over `orgId`.
|
|
205
214
|
* It binds directly to
|
|
206
215
|
* `capxul.org(orgId).invite(input)`. On success, invalidates the member list.
|
|
207
216
|
*/
|
|
208
|
-
type UseCapxulInviteMemberReturn = UseMutationResult<MemberView, CapxulError,
|
|
217
|
+
type UseCapxulInviteMemberReturn = UseMutationResult<MemberView, CapxulError, UseCapxulInviteMemberInput>;
|
|
209
218
|
declare function useCapxulInviteMember(orgId: OrgId | undefined): UseCapxulInviteMemberReturn;
|
|
210
219
|
//#endregion
|
|
211
220
|
//#region src/headless/journey/journey-state.d.ts
|
|
@@ -833,8 +842,19 @@ type DashboardScope = {
|
|
|
833
842
|
readonly orgId?: string;
|
|
834
843
|
};
|
|
835
844
|
type DashboardAccessPhase = "checking" | "error" | "redirect" | "granted";
|
|
845
|
+
/**
|
|
846
|
+
* Which of the three probes produced the error the screen is showing. The
|
|
847
|
+
* error code alone cannot say: a provider failure reads the same whether the
|
|
848
|
+
* session read, the membership list or the lifecycle read raised it, and a
|
|
849
|
+
* consumer that reports a displayed gate error has to keep those apart
|
|
850
|
+
* (#1963 R05-2). It names the SOURCE only; `retry` still re-runs every failed
|
|
851
|
+
* probe, exactly as before.
|
|
852
|
+
*/
|
|
853
|
+
type DashboardAccessProbe = "session" | "membership" | "lifecycle";
|
|
836
854
|
interface DashboardAccessErrorSlice {
|
|
837
855
|
readonly error: CapxulError;
|
|
856
|
+
/** The probe the surfaced error came from, in the frozen precedence order. */
|
|
857
|
+
readonly probe: DashboardAccessProbe;
|
|
838
858
|
/** Re-runs each failed probe. */
|
|
839
859
|
readonly retry: () => void;
|
|
840
860
|
}
|
|
@@ -853,6 +873,12 @@ declare function Checking({ children }: {
|
|
|
853
873
|
declare function DashboardError({ children }: {
|
|
854
874
|
readonly children: (slice: DashboardAccessErrorSlice) => ReactNode;
|
|
855
875
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
876
|
+
/**
|
|
877
|
+
* Hands the destination and draws nothing. Reaching this part is a REQUEST to
|
|
878
|
+
* navigate, never an arrival: the app may cancel or supersede it, so nothing
|
|
879
|
+
* here — and nothing a consumer hangs off it — may claim a completed redirect
|
|
880
|
+
* (#1963 R05-1). The destination page's own normalized pageview proves arrival.
|
|
881
|
+
*/
|
|
856
882
|
declare function Redirect({ children }: {
|
|
857
883
|
readonly children: (slice: DashboardAccessRedirectSlice) => ReactNode;
|
|
858
884
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1081,4 +1107,4 @@ declare const capxulKeys: {
|
|
|
1081
1107
|
payment: (paymentId: string | undefined) => readonly ["capxul", "payments", string];
|
|
1082
1108
|
};
|
|
1083
1109
|
//#endregion
|
|
1084
|
-
export { type AccountFailure, type AccountProgress, type ActionResult, type ActivityDetailSlice, type ActivityExportSlice, type ActivityFilterValues, type ActivityFiltersSlice, type ActivityLoadMoreSlice, type ActivityReceipt, type ActivityRow, type ActivityRowsSlice, type ActivitySearchSlice, type ActivitySummarySlice, type AuthenticatedState, type AuthenticationSlots, type CanReason, CapxulActivity, type CapxulActivityProps, type CapxulAuth, CapxulAuthenticationController, type CapxulBootstrapState, type CapxulBootstrapStatus, CapxulContacts, type CapxulContactsProps, CapxulDashboardAccess, type CapxulDashboardAccessProps, CapxulOnboardingController, CapxulOrgMember, type CapxulOrgMemberProps, CapxulPayroll, type CapxulPayrollProps, CapxulPayrollRun, type CapxulPayrollRunBlockedReason, type CapxulPayrollRunProps, CapxulProvider, type CapxulProviderProps, type CapxulSend, CapxulSendMoney, type CapxulSendMoneyBlockedReason, type CapxulSendMoneyProps, type Contact, type ContactRelationship, type ContactRow, type ContactsActor, type ContactsAddBlockedReason, type ContactsAddError, type ContactsAddSlice, type ContactsListOptions, type ContactsListSlice, type ContactsRefusal, type ContactsSummarySlice, type ControllerAction, type CreateOrganizationFailure, type CreateOrganizationSubmission, type CsvExport, type DashboardAccessErrorSlice, type DashboardAccessPhase, type DashboardAccessRedirectSlice, type DashboardScope, type Destination, type FaultedState, type HandleAvailability, type ImageUploadInput, type ImageUploadTarget, type InvocationOptions, type NavigationAction, type OnboardingControllerProps, type OnboardingIntent, type OnboardingJourney, type OnboardingJourneyPosition, type OnboardingOrigin, type OnboardingStep, type OrgFailure, type OrgMemberAction, type OrgMemberCanSlice, type OrgMemberStanding, type OrgMemberStandingSlice, type OrgProgress, type OrganizationDetails, type OrganizationDraft, type OtpPendingState, type PayoutDraftChain, type PayoutDraftEntry, type PayrollGroupRow, type PayrollGroupsSlice, type PayrollRecipientOption, type PayrollRunActionsSlice, type PayrollRunAmountEntry, type PayrollRunAmountsSlice, type PayrollRunAssetSlice, type PayrollRunGroupOption, type PayrollRunPrefill, type PayrollRunRecipientsSlice, type PayrollRunStatus, type PayrollRunSummarySlice, type PayrollSummarySlice, type PendingAuthState, type ProfileDetails, type ProfileDraft, type ProfileSlotProps, type ReadyDestination, type RetryAction, type SendActor, type SendMoneyActionsSlice, type SendMoneyAmountSlice, type SendMoneyAssetError, type SendMoneyAssetOption, type SendMoneyAssetSlice, type SendMoneyRecipientSlice, type SendMoneyRecipientStatus, type SendMoneySourceError, type SendMoneySourceOption, type SendMoneySourceSlice, type SendResult, type SentPayment, type SentPayrollRun, type SignedOutState, type Slot, type SummaryWindow, type UseCapxulAccountBalanceOptions, type UseCapxulAccountBalanceReturn, type UseCapxulAccountFundReturn, type UseCapxulCreateCommitmentReturn, type UseCapxulCreateOrgReturn, type UseCapxulHandleAvailabilityReturn, type UseCapxulImageUploadReturn, type UseCapxulInviteMemberReturn, type UseCapxulOrgMembersOptions, type UseCapxulOrgMembersReturn, type UseCapxulOrgRolesOptions, type UseCapxulOrgRolesReturn, type UseCapxulOrgTreasuryOptions, type UseCapxulOrgTreasuryReturn, type UseCapxulOrgsReturn, type UseCapxulPayReturn, type UseCapxulPaymentReturn, type UseCapxulPaymentsReturn, type UseCapxulProfileReturn, type UseCapxulRedirectPaymentReturn, type UseCapxulUploadImageReturn, acknowledgeOnboardingDestination, activeOnboardingRecovery, capxulKeys, clearOnboardingJourney, currentOnboardingJourneyId, entered, invalidateOnboardingJourneyObservation, isClaimed, isRestoring, loadOnboardingJourney, onboardingJourneyPosition, saveOnboardingJourney, startOnboardingJourney, useCapxul, useCapxulAccountBalance, useCapxulAccountFund, useCapxulActivity, useCapxulActivityDetail, useCapxulAnnotateMovement, useCapxulAuth, useCapxulCancelPayment, useCapxulClaimPayment, useCapxulClientOrNull, useCapxulCreateCommitment, useCapxulCreateOrg, useCapxulDestination, useCapxulHandleAvailability, useCapxulHoldings, useCapxulIdentity, useCapxulImageUpload, useCapxulInviteMember, useCapxulOrgMembers, useCapxulOrgRoles, useCapxulOrgTreasury, useCapxulOrganizationPay, useCapxulOrganizationPayBatch, useCapxulOrgs, useCapxulPay, useCapxulPayment, useCapxulPayments, useCapxulPermission, useCapxulPermissionAssign, useCapxulPermissionChange, useCapxulPermissionCreate, useCapxulPermissionReplace, useCapxulPermissionRevoke, useCapxulPermissions, useCapxulProfile, useCapxulRedirectPayment, useCapxulSend, useCapxulTransitions, useCapxulUploadImage };
|
|
1110
|
+
export { type AccountFailure, type AccountProgress, type ActionResult, type ActivityDetailSlice, type ActivityExportSlice, type ActivityFilterValues, type ActivityFiltersSlice, type ActivityLoadMoreSlice, type ActivityReceipt, type ActivityRow, type ActivityRowsSlice, type ActivitySearchSlice, type ActivitySummarySlice, type AuthenticatedState, type AuthenticationSlots, type CanReason, CapxulActivity, type CapxulActivityProps, type CapxulAuth, CapxulAuthenticationController, type CapxulBootstrapState, type CapxulBootstrapStatus, CapxulContacts, type CapxulContactsProps, CapxulDashboardAccess, type CapxulDashboardAccessProps, CapxulOnboardingController, CapxulOrgMember, type CapxulOrgMemberProps, CapxulPayroll, type CapxulPayrollProps, CapxulPayrollRun, type CapxulPayrollRunBlockedReason, type CapxulPayrollRunProps, CapxulProvider, type CapxulProviderProps, type CapxulSend, CapxulSendMoney, type CapxulSendMoneyBlockedReason, type CapxulSendMoneyProps, type Contact, type ContactRelationship, type ContactRow, type ContactsActor, type ContactsAddBlockedReason, type ContactsAddError, type ContactsAddSlice, type ContactsListOptions, type ContactsListSlice, type ContactsRefusal, type ContactsSummarySlice, type ControllerAction, type CreateOrganizationFailure, type CreateOrganizationSubmission, type CsvExport, type DashboardAccessErrorSlice, type DashboardAccessPhase, type DashboardAccessProbe, type DashboardAccessRedirectSlice, type DashboardScope, type Destination, type FaultedState, type HandleAvailability, type ImageUploadInput, type ImageUploadTarget, type InvocationOptions, type NavigationAction, type OnboardingControllerProps, type OnboardingIntent, type OnboardingJourney, type OnboardingJourneyPosition, type OnboardingOrigin, type OnboardingStep, type OrgFailure, type OrgMemberAction, type OrgMemberCanSlice, type OrgMemberStanding, type OrgMemberStandingSlice, type OrgProgress, type OrganizationDetails, type OrganizationDraft, type OtpPendingState, type PayoutDraftChain, type PayoutDraftEntry, type PayrollGroupRow, type PayrollGroupsSlice, type PayrollRecipientOption, type PayrollRunActionsSlice, type PayrollRunAmountEntry, type PayrollRunAmountsSlice, type PayrollRunAssetSlice, type PayrollRunGroupOption, type PayrollRunPrefill, type PayrollRunRecipientsSlice, type PayrollRunStatus, type PayrollRunSummarySlice, type PayrollSummarySlice, type PendingAuthState, type ProfileDetails, type ProfileDraft, type ProfileSlotProps, type ReadyDestination, type RetryAction, type SendActor, type SendMoneyActionsSlice, type SendMoneyAmountSlice, type SendMoneyAssetError, type SendMoneyAssetOption, type SendMoneyAssetSlice, type SendMoneyRecipientSlice, type SendMoneyRecipientStatus, type SendMoneySourceError, type SendMoneySourceOption, type SendMoneySourceSlice, type SendResult, type SentPayment, type SentPayrollRun, type SignedOutState, type Slot, type SummaryWindow, type UseCapxulAccountBalanceOptions, type UseCapxulAccountBalanceReturn, type UseCapxulAccountFundReturn, type UseCapxulCreateCommitmentReturn, type UseCapxulCreateOrgReturn, type UseCapxulHandleAvailabilityReturn, type UseCapxulImageUploadReturn, type UseCapxulInviteMemberInput, type UseCapxulInviteMemberReturn, type UseCapxulOrgMembersOptions, type UseCapxulOrgMembersReturn, type UseCapxulOrgRolesOptions, type UseCapxulOrgRolesReturn, type UseCapxulOrgTreasuryOptions, type UseCapxulOrgTreasuryReturn, type UseCapxulOrgsReturn, type UseCapxulPayReturn, type UseCapxulPaymentReturn, type UseCapxulPaymentsReturn, type UseCapxulProfileReturn, type UseCapxulRedirectPaymentReturn, type UseCapxulUploadImageReturn, acknowledgeOnboardingDestination, activeOnboardingRecovery, capxulKeys, clearOnboardingJourney, currentOnboardingJourneyId, entered, invalidateOnboardingJourneyObservation, isClaimed, isRestoring, loadOnboardingJourney, onboardingJourneyPosition, saveOnboardingJourney, startOnboardingJourney, useCapxul, useCapxulAccountBalance, useCapxulAccountFund, useCapxulActivity, useCapxulActivityDetail, useCapxulAnnotateMovement, useCapxulAuth, useCapxulCancelPayment, useCapxulClaimPayment, useCapxulClientOrNull, useCapxulCreateCommitment, useCapxulCreateOrg, useCapxulDestination, useCapxulHandleAvailability, useCapxulHoldings, useCapxulIdentity, useCapxulImageUpload, useCapxulInviteMember, useCapxulOrgMembers, useCapxulOrgRoles, useCapxulOrgTreasury, useCapxulOrganizationPay, useCapxulOrganizationPayBatch, useCapxulOrgs, useCapxulPay, useCapxulPayment, useCapxulPayments, useCapxulPermission, useCapxulPermissionAssign, useCapxulPermissionChange, useCapxulPermissionCreate, useCapxulPermissionReplace, useCapxulPermissionRevoke, useCapxulPermissions, useCapxulProfile, useCapxulRedirectPayment, useCapxulSend, useCapxulTransitions, useCapxulUploadImage };
|
package/dist/index.mjs
CHANGED
|
@@ -547,9 +547,9 @@ function useCapxulInviteMember(orgId) {
|
|
|
547
547
|
const client = useCapxulClientOrNull();
|
|
548
548
|
const queryClient = useQueryClient();
|
|
549
549
|
return useMutation({
|
|
550
|
-
mutationFn: async (input) => {
|
|
550
|
+
mutationFn: async ({ options, ...input }) => {
|
|
551
551
|
if (orgId === void 0) throw Errors.invalidInput("orgId", "required for useCapxulInviteMember");
|
|
552
|
-
return unwrapCapxulResult(await requireBootstrappedClient(client, CAPXUL_OPERATIONS.org.invite).org(orgId).invite(input));
|
|
552
|
+
return unwrapCapxulResult(await requireBootstrappedClient(client, CAPXUL_OPERATIONS.org.invite).org(orgId).invite(input, toInvocationControls(options)));
|
|
553
553
|
},
|
|
554
554
|
onSuccess: async () => {
|
|
555
555
|
if (orgId === void 0) return;
|
|
@@ -2315,6 +2315,16 @@ function decidePhase(input) {
|
|
|
2315
2315
|
if (input.orgLaneSettled && input.destination !== null) return "redirect";
|
|
2316
2316
|
return "checking";
|
|
2317
2317
|
}
|
|
2318
|
+
/**
|
|
2319
|
+
* Which probe produced the surfaced error — the SAME precedence `error` itself
|
|
2320
|
+
* is chosen by, written once so the code and its source can never disagree.
|
|
2321
|
+
*/
|
|
2322
|
+
function probeOf(session, membership, lifecycle) {
|
|
2323
|
+
if (session !== null) return "session";
|
|
2324
|
+
if (membership !== null) return "membership";
|
|
2325
|
+
if (lifecycle !== null) return "lifecycle";
|
|
2326
|
+
return null;
|
|
2327
|
+
}
|
|
2318
2328
|
/** The engine — all the logic. NOT exported from the package barrel. */
|
|
2319
2329
|
function useDashboardAccess(scope) {
|
|
2320
2330
|
const client = useCapxulClientOrNull();
|
|
@@ -2351,6 +2361,7 @@ function useDashboardAccess(scope) {
|
|
|
2351
2361
|
lifecycle.refetch
|
|
2352
2362
|
]);
|
|
2353
2363
|
const error = sessionError ?? membershipError ?? lifecycleError;
|
|
2364
|
+
const probe = probeOf(sessionError, membershipError, lifecycleError);
|
|
2354
2365
|
const phase = decidePhase({
|
|
2355
2366
|
error,
|
|
2356
2367
|
settled: client !== null && identity !== null && !isRestoring$1(identity) && membershipsSettled && lifecycleSettled,
|
|
@@ -2361,11 +2372,13 @@ function useDashboardAccess(scope) {
|
|
|
2361
2372
|
return useMemo(() => ({
|
|
2362
2373
|
phase,
|
|
2363
2374
|
error,
|
|
2375
|
+
probe,
|
|
2364
2376
|
destination,
|
|
2365
2377
|
retry
|
|
2366
2378
|
}), [
|
|
2367
2379
|
phase,
|
|
2368
2380
|
error,
|
|
2381
|
+
probe,
|
|
2369
2382
|
destination,
|
|
2370
2383
|
retry
|
|
2371
2384
|
]);
|
|
@@ -2410,12 +2423,19 @@ function Checking({ children }) {
|
|
|
2410
2423
|
}
|
|
2411
2424
|
function DashboardError({ children }) {
|
|
2412
2425
|
const state = usePart("error");
|
|
2413
|
-
if (state === null || state.error === null) return null;
|
|
2426
|
+
if (state === null || state.error === null || state.probe === null) return null;
|
|
2414
2427
|
return /* @__PURE__ */ jsx(Fragment, { children: children({
|
|
2415
2428
|
error: state.error,
|
|
2429
|
+
probe: state.probe,
|
|
2416
2430
|
retry: state.retry
|
|
2417
2431
|
}) });
|
|
2418
2432
|
}
|
|
2433
|
+
/**
|
|
2434
|
+
* Hands the destination and draws nothing. Reaching this part is a REQUEST to
|
|
2435
|
+
* navigate, never an arrival: the app may cancel or supersede it, so nothing
|
|
2436
|
+
* here — and nothing a consumer hangs off it — may claim a completed redirect
|
|
2437
|
+
* (#1963 R05-1). The destination page's own normalized pageview proves arrival.
|
|
2438
|
+
*/
|
|
2419
2439
|
function Redirect({ children }) {
|
|
2420
2440
|
const state = usePart("redirect");
|
|
2421
2441
|
if (state === null || state.destination === null) return null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capxul/sdk-react",
|
|
3
|
-
"version": "4.2.0-rc.
|
|
3
|
+
"version": "4.2.0-rc.14",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/Xelmar-tech/infrastructure.git",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"access": "public"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@capxul/sdk": "4.2.0-rc.
|
|
29
|
+
"@capxul/sdk": "4.2.0-rc.14"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@tanstack/react-query": "^5.66.9",
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
"vite": "npm:@voidzero-dev/vite-plus-core@0.3.0",
|
|
44
44
|
"vite-plus": "0.3.0",
|
|
45
45
|
"vitest": "4.1.11",
|
|
46
|
+
"@capxul/types": "0.3.0",
|
|
46
47
|
"@capxul/typescript-config": "0.0.0",
|
|
47
|
-
"@capxul/errors": "0.3.0"
|
|
48
|
-
"@capxul/types": "0.3.0"
|
|
48
|
+
"@capxul/errors": "0.3.0"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"@tanstack/react-query": "^5.66.9",
|