@capxul/sdk-react 4.2.0-rc.12 → 4.2.0-rc.13
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 +18 -1
- package/dist/index.mjs +21 -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": "887920e1ba54e17bd8465975fcbc6e1537dfb6b8",
|
|
4
|
+
"tree": "deed16dc942ed9d6b587ceead4dbf8b0b4174e2c",
|
|
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.13"
|
|
11
11
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -833,8 +833,19 @@ type DashboardScope = {
|
|
|
833
833
|
readonly orgId?: string;
|
|
834
834
|
};
|
|
835
835
|
type DashboardAccessPhase = "checking" | "error" | "redirect" | "granted";
|
|
836
|
+
/**
|
|
837
|
+
* Which of the three probes produced the error the screen is showing. The
|
|
838
|
+
* error code alone cannot say: a provider failure reads the same whether the
|
|
839
|
+
* session read, the membership list or the lifecycle read raised it, and a
|
|
840
|
+
* consumer that reports a displayed gate error has to keep those apart
|
|
841
|
+
* (#1963 R05-2). It names the SOURCE only; `retry` still re-runs every failed
|
|
842
|
+
* probe, exactly as before.
|
|
843
|
+
*/
|
|
844
|
+
type DashboardAccessProbe = "session" | "membership" | "lifecycle";
|
|
836
845
|
interface DashboardAccessErrorSlice {
|
|
837
846
|
readonly error: CapxulError;
|
|
847
|
+
/** The probe the surfaced error came from, in the frozen precedence order. */
|
|
848
|
+
readonly probe: DashboardAccessProbe;
|
|
838
849
|
/** Re-runs each failed probe. */
|
|
839
850
|
readonly retry: () => void;
|
|
840
851
|
}
|
|
@@ -853,6 +864,12 @@ declare function Checking({ children }: {
|
|
|
853
864
|
declare function DashboardError({ children }: {
|
|
854
865
|
readonly children: (slice: DashboardAccessErrorSlice) => ReactNode;
|
|
855
866
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
867
|
+
/**
|
|
868
|
+
* Hands the destination and draws nothing. Reaching this part is a REQUEST to
|
|
869
|
+
* navigate, never an arrival: the app may cancel or supersede it, so nothing
|
|
870
|
+
* here — and nothing a consumer hangs off it — may claim a completed redirect
|
|
871
|
+
* (#1963 R05-1). The destination page's own normalized pageview proves arrival.
|
|
872
|
+
*/
|
|
856
873
|
declare function Redirect({ children }: {
|
|
857
874
|
readonly children: (slice: DashboardAccessRedirectSlice) => ReactNode;
|
|
858
875
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1081,4 +1098,4 @@ declare const capxulKeys: {
|
|
|
1081
1098
|
payment: (paymentId: string | undefined) => readonly ["capxul", "payments", string];
|
|
1082
1099
|
};
|
|
1083
1100
|
//#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 };
|
|
1101
|
+
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 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
|
@@ -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.13",
|
|
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.13"
|
|
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/
|
|
46
|
+
"@capxul/types": "0.3.0",
|
|
47
47
|
"@capxul/errors": "0.3.0",
|
|
48
|
-
"@capxul/
|
|
48
|
+
"@capxul/typescript-config": "0.0.0"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"@tanstack/react-query": "^5.66.9",
|