@clerk/shared 4.16.0-snapshot.v20260604171840 → 4.16.0
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/runtime/_chunks/{index-_uCrz--r.d.ts → index-B5XpCs9l.d.ts} +355 -86
- package/dist/runtime/_chunks/index-B5XpCs9l.d.ts.map +1 -0
- package/dist/runtime/_chunks/{index-CENbuWgK.d.mts → index-U8nAlSHe.d.mts} +355 -86
- package/dist/runtime/_chunks/index-U8nAlSHe.d.mts.map +1 -0
- package/dist/runtime/_chunks/{url-BknJ-q4g.d.mts → url-CEwBLvpw.d.mts} +2 -2
- package/dist/runtime/_chunks/{url-BknJ-q4g.d.mts.map → url-CEwBLvpw.d.mts.map} +1 -1
- package/dist/runtime/_chunks/{url-B_n9WxIg.d.ts → url-DJ-DnkAW.d.ts} +2 -2
- package/dist/runtime/_chunks/{url-B_n9WxIg.d.ts.map → url-DJ-DnkAW.d.ts.map} +1 -1
- package/dist/runtime/_chunks/{versionSelector-VH3EEcNp.mjs → versionSelector-C67hCt-f.mjs} +2 -2
- package/dist/runtime/_chunks/{versionSelector-VH3EEcNp.mjs.map → versionSelector-C67hCt-f.mjs.map} +1 -1
- package/dist/runtime/_chunks/{versionSelector-DBziPeOB.js → versionSelector-Dxa73x5_.js} +2 -2
- package/dist/runtime/_chunks/{versionSelector-DBziPeOB.js.map → versionSelector-Dxa73x5_.js.map} +1 -1
- package/dist/runtime/alternativePhoneCode.d.mts +1 -1
- package/dist/runtime/alternativePhoneCode.d.ts +1 -1
- package/dist/runtime/apiUrlFromPublishableKey.d.mts.map +1 -1
- package/dist/runtime/apiUrlFromPublishableKey.d.ts.map +1 -1
- package/dist/runtime/apiUrlFromPublishableKey.js.map +1 -1
- package/dist/runtime/apiUrlFromPublishableKey.mjs.map +1 -1
- package/dist/runtime/authorization-errors.d.mts +1 -1
- package/dist/runtime/authorization-errors.d.ts +1 -1
- package/dist/runtime/authorization.d.mts +1 -1
- package/dist/runtime/authorization.d.ts +1 -1
- package/dist/runtime/clerkEventBus.d.mts +1 -1
- package/dist/runtime/clerkEventBus.d.ts +1 -1
- package/dist/runtime/color.d.mts +1 -1
- package/dist/runtime/color.d.mts.map +1 -1
- package/dist/runtime/color.d.ts +1 -1
- package/dist/runtime/deriveState.d.mts +1 -1
- package/dist/runtime/deriveState.d.ts +1 -1
- package/dist/runtime/error.d.mts +1 -1
- package/dist/runtime/error.d.ts +1 -1
- package/dist/runtime/getToken.d.mts +1 -1
- package/dist/runtime/getToken.d.ts +1 -1
- package/dist/runtime/globs.d.ts.map +1 -1
- package/dist/runtime/internal/clerk-js/completeSignUpFlow.d.mts +1 -1
- package/dist/runtime/internal/clerk-js/completeSignUpFlow.d.ts +1 -1
- package/dist/runtime/internal/clerk-js/componentGuards.d.mts +1 -1
- package/dist/runtime/internal/clerk-js/componentGuards.d.ts +1 -1
- package/dist/runtime/internal/clerk-js/injectedWeb3EthProviders.d.mts +1 -1
- package/dist/runtime/internal/clerk-js/injectedWeb3EthProviders.d.ts +1 -1
- package/dist/runtime/internal/clerk-js/passkeys.d.mts +1 -1
- package/dist/runtime/internal/clerk-js/passkeys.d.ts +1 -1
- package/dist/runtime/internal/clerk-js/passkeys.d.ts.map +1 -1
- package/dist/runtime/internal/clerk-js/passwords/complexity.d.mts +1 -1
- package/dist/runtime/internal/clerk-js/passwords/complexity.d.ts +1 -1
- package/dist/runtime/internal/clerk-js/passwords/loadZxcvbn.d.mts +1 -1
- package/dist/runtime/internal/clerk-js/passwords/loadZxcvbn.d.ts +1 -1
- package/dist/runtime/internal/clerk-js/passwords/password.d.mts +1 -1
- package/dist/runtime/internal/clerk-js/passwords/password.d.ts +1 -1
- package/dist/runtime/internal/clerk-js/passwords/strength.d.mts +1 -1
- package/dist/runtime/internal/clerk-js/passwords/strength.d.ts +1 -1
- package/dist/runtime/internal/clerk-js/queryParams.d.mts +1 -1
- package/dist/runtime/internal/clerk-js/queryParams.d.ts +1 -1
- package/dist/runtime/internal/clerk-js/redirectUrls.d.mts +1 -1
- package/dist/runtime/internal/clerk-js/redirectUrls.d.ts +1 -1
- package/dist/runtime/internal/clerk-js/sessionTasks.d.mts +2 -2
- package/dist/runtime/internal/clerk-js/sessionTasks.d.ts +2 -2
- package/dist/runtime/internal/clerk-js/url.d.mts +2 -2
- package/dist/runtime/internal/clerk-js/url.d.ts +2 -2
- package/dist/runtime/internal/clerk-js/user.d.mts +1 -1
- package/dist/runtime/internal/clerk-js/user.d.ts +1 -1
- package/dist/runtime/internal/clerk-js/web3.d.mts +1 -1
- package/dist/runtime/internal/clerk-js/web3.d.ts +1 -1
- package/dist/runtime/jwtPayloadParser.d.mts +1 -1
- package/dist/runtime/jwtPayloadParser.d.ts +1 -1
- package/dist/runtime/keys.d.mts +1 -1
- package/dist/runtime/keys.d.ts +1 -1
- package/dist/runtime/loadClerkJsScript.d.mts +1 -1
- package/dist/runtime/loadClerkJsScript.d.ts +1 -1
- package/dist/runtime/loadClerkJsScript.js +2 -2
- package/dist/runtime/loadClerkJsScript.js.map +1 -1
- package/dist/runtime/loadClerkJsScript.mjs +2 -2
- package/dist/runtime/loadClerkJsScript.mjs.map +1 -1
- package/dist/runtime/oauth.d.mts +1 -1
- package/dist/runtime/oauth.d.ts +1 -1
- package/dist/runtime/organization.d.mts +1 -1
- package/dist/runtime/organization.d.ts +1 -1
- package/dist/runtime/pathMatcher.d.mts +1 -1
- package/dist/runtime/pathMatcher.d.ts +1 -1
- package/dist/runtime/poller.d.mts.map +1 -1
- package/dist/runtime/react/index.d.mts +29 -52
- package/dist/runtime/react/index.d.mts.map +1 -1
- package/dist/runtime/react/index.d.ts +29 -52
- package/dist/runtime/react/index.d.ts.map +1 -1
- package/dist/runtime/react/index.js +8 -113
- package/dist/runtime/react/index.js.map +1 -1
- package/dist/runtime/react/index.mjs +9 -113
- package/dist/runtime/react/index.mjs.map +1 -1
- package/dist/runtime/router.d.mts +1 -1
- package/dist/runtime/router.d.mts.map +1 -1
- package/dist/runtime/router.d.ts +1 -1
- package/dist/runtime/saml.d.mts +1 -1
- package/dist/runtime/saml.d.ts +1 -1
- package/dist/runtime/telemetry.d.mts +1 -1
- package/dist/runtime/telemetry.d.ts +1 -1
- package/dist/runtime/types/index.d.mts +2 -2
- package/dist/runtime/types/index.d.ts +2 -2
- package/dist/runtime/ui/index.d.mts +1 -1
- package/dist/runtime/ui/index.d.ts +1 -1
- package/dist/runtime/versionSelector.js +1 -1
- package/dist/runtime/versionSelector.mjs +1 -1
- package/dist/runtime/web3.d.mts +1 -1
- package/dist/runtime/web3.d.ts +1 -1
- package/dist/types/index.d.mts +354 -85
- package/dist/types/index.d.mts.map +1 -1
- package/dist/types/index.d.ts +354 -85
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/runtime/_chunks/index-CENbuWgK.d.mts.map +0 -1
- package/dist/runtime/_chunks/index-_uCrz--r.d.ts.map +0 -1
|
@@ -2589,119 +2589,11 @@ function useUserEnterpriseConnections(params = {}) {
|
|
|
2589
2589
|
placeholderData: defineKeepPreviousDataFn(keepPreviousData)
|
|
2590
2590
|
});
|
|
2591
2591
|
const revalidate = useCallback(() => queryClient.invalidateQueries({ queryKey: [stableKey] }), [queryClient, stableKey]);
|
|
2592
|
-
const createEnterpriseConnection = useCallback(async (createParams) => {
|
|
2593
|
-
const created = await user?.createEnterpriseConnection(createParams);
|
|
2594
|
-
await revalidate();
|
|
2595
|
-
return created;
|
|
2596
|
-
}, [user, revalidate]);
|
|
2597
|
-
const updateEnterpriseConnection = useCallback(async (enterpriseConnectionId, updateParams) => {
|
|
2598
|
-
const updated = await user?.updateEnterpriseConnection(enterpriseConnectionId, updateParams);
|
|
2599
|
-
await revalidate();
|
|
2600
|
-
return updated;
|
|
2601
|
-
}, [user, revalidate]);
|
|
2602
|
-
const deleteEnterpriseConnection = useCallback(async (enterpriseConnectionId) => {
|
|
2603
|
-
const deleted = await user?.deleteEnterpriseConnection(enterpriseConnectionId);
|
|
2604
|
-
await revalidate();
|
|
2605
|
-
return deleted;
|
|
2606
|
-
}, [user, revalidate]);
|
|
2607
2592
|
return {
|
|
2608
2593
|
data: query.data,
|
|
2609
2594
|
error: query.error ?? null,
|
|
2610
2595
|
isLoading: query.isLoading,
|
|
2611
2596
|
isFetching: query.isFetching,
|
|
2612
|
-
createEnterpriseConnection,
|
|
2613
|
-
updateEnterpriseConnection,
|
|
2614
|
-
deleteEnterpriseConnection,
|
|
2615
|
-
revalidate
|
|
2616
|
-
};
|
|
2617
|
-
}
|
|
2618
|
-
|
|
2619
|
-
//#endregion
|
|
2620
|
-
//#region src/react/hooks/useEnterpriseConnectionTestRuns.shared.ts
|
|
2621
|
-
/**
|
|
2622
|
-
* @internal
|
|
2623
|
-
*/
|
|
2624
|
-
function useEnterpriseConnectionTestRunsCacheKeys(params) {
|
|
2625
|
-
const { userId, enterpriseConnectionId, args } = params;
|
|
2626
|
-
return useMemo(() => {
|
|
2627
|
-
return createCacheKeys({
|
|
2628
|
-
stablePrefix: INTERNAL_STABLE_KEYS.ENTERPRISE_CONNECTION_TEST_RUNS_KEY,
|
|
2629
|
-
authenticated: Boolean(userId),
|
|
2630
|
-
tracked: {
|
|
2631
|
-
userId: userId ?? null,
|
|
2632
|
-
enterpriseConnectionId: enterpriseConnectionId ?? null
|
|
2633
|
-
},
|
|
2634
|
-
untracked: { args }
|
|
2635
|
-
});
|
|
2636
|
-
}, [
|
|
2637
|
-
userId,
|
|
2638
|
-
enterpriseConnectionId,
|
|
2639
|
-
JSON.stringify(args)
|
|
2640
|
-
]);
|
|
2641
|
-
}
|
|
2642
|
-
|
|
2643
|
-
//#endregion
|
|
2644
|
-
//#region src/react/hooks/useEnterpriseConnectionTestRuns.tsx
|
|
2645
|
-
const DEFAULT_POLL_INTERVAL_MS$1 = 2e3;
|
|
2646
|
-
/**
|
|
2647
|
-
* Subscribes to the list of enterprise-connection test runs for the signed-in user
|
|
2648
|
-
*
|
|
2649
|
-
* @internal
|
|
2650
|
-
*/
|
|
2651
|
-
function useEnterpriseConnectionTestRuns(params) {
|
|
2652
|
-
const { enterpriseConnectionId, params: fetchParams = {
|
|
2653
|
-
initialPage: 1,
|
|
2654
|
-
pageSize: 10
|
|
2655
|
-
}, pollIntervalMs = DEFAULT_POLL_INTERVAL_MS$1, enabled = true } = params;
|
|
2656
|
-
const clerk = useClerkInstanceContext();
|
|
2657
|
-
const user = useUserBase();
|
|
2658
|
-
const [queryClient] = useClerkQueryClient();
|
|
2659
|
-
const { queryKey, invalidationKey, stableKey, authenticated } = useEnterpriseConnectionTestRunsCacheKeys({
|
|
2660
|
-
userId: user?.id ?? null,
|
|
2661
|
-
enterpriseConnectionId,
|
|
2662
|
-
args: fetchParams
|
|
2663
|
-
});
|
|
2664
|
-
useClearQueriesOnSignOut({
|
|
2665
|
-
isSignedOut: user === null,
|
|
2666
|
-
authenticated,
|
|
2667
|
-
stableKeys: stableKey
|
|
2668
|
-
});
|
|
2669
|
-
const queryEnabled = enabled && clerk.loaded && Boolean(user) && Boolean(enterpriseConnectionId);
|
|
2670
|
-
const [shouldPoll, setShouldPoll] = useState(false);
|
|
2671
|
-
const query = useClerkQuery({
|
|
2672
|
-
queryKey,
|
|
2673
|
-
queryFn: () => {
|
|
2674
|
-
if (!enterpriseConnectionId) throw new Error("enterpriseConnectionId is required to fetch test runs");
|
|
2675
|
-
return user?.getEnterpriseConnectionTestRuns(enterpriseConnectionId, fetchParams);
|
|
2676
|
-
},
|
|
2677
|
-
refetchInterval: (q) => {
|
|
2678
|
-
if (!shouldPoll) return false;
|
|
2679
|
-
return (q.state.data?.data?.length ?? 0) > 0 ? false : pollIntervalMs;
|
|
2680
|
-
},
|
|
2681
|
-
enabled: queryEnabled,
|
|
2682
|
-
refetchIntervalInBackground: false,
|
|
2683
|
-
refetchOnWindowFocus: false
|
|
2684
|
-
});
|
|
2685
|
-
const hasRows = (query.data?.data?.length ?? 0) > 0;
|
|
2686
|
-
useEffect(() => {
|
|
2687
|
-
if (shouldPoll && hasRows) setShouldPoll(false);
|
|
2688
|
-
}, [shouldPoll, hasRows]);
|
|
2689
|
-
const revalidate = useCallback(async () => {
|
|
2690
|
-
if (!hasRows) setShouldPoll(true);
|
|
2691
|
-
await queryClient.invalidateQueries({ queryKey: invalidationKey });
|
|
2692
|
-
}, [
|
|
2693
|
-
queryClient,
|
|
2694
|
-
invalidationKey,
|
|
2695
|
-
hasRows
|
|
2696
|
-
]);
|
|
2697
|
-
const isPolling = queryEnabled && shouldPoll && !hasRows;
|
|
2698
|
-
return {
|
|
2699
|
-
data: query.data?.data,
|
|
2700
|
-
totalCount: query.data?.total_count,
|
|
2701
|
-
error: query.error ?? null,
|
|
2702
|
-
isLoading: query.isLoading,
|
|
2703
|
-
isFetching: query.isFetching,
|
|
2704
|
-
isPolling,
|
|
2705
2597
|
revalidate
|
|
2706
2598
|
};
|
|
2707
2599
|
}
|
|
@@ -2818,7 +2710,7 @@ function useOrganizationEnterpriseConnectionTestRuns(params) {
|
|
|
2818
2710
|
const { enterpriseConnectionId, params: fetchParams = {
|
|
2819
2711
|
initialPage: 1,
|
|
2820
2712
|
pageSize: 10
|
|
2821
|
-
}, pollIntervalMs = DEFAULT_POLL_INTERVAL_MS, enabled = true } = params;
|
|
2713
|
+
}, pollIntervalMs = DEFAULT_POLL_INTERVAL_MS, enabled = true, keepPreviousData = false } = params;
|
|
2822
2714
|
const clerk = useClerkInstanceContext();
|
|
2823
2715
|
const organization = useOrganizationBase();
|
|
2824
2716
|
const [queryClient] = useClerkQueryClient();
|
|
@@ -2834,6 +2726,9 @@ function useOrganizationEnterpriseConnectionTestRuns(params) {
|
|
|
2834
2726
|
});
|
|
2835
2727
|
const queryEnabled = enabled && clerk.loaded && Boolean(organization) && Boolean(enterpriseConnectionId);
|
|
2836
2728
|
const [shouldPoll, setShouldPoll] = useState(false);
|
|
2729
|
+
useEffect(() => {
|
|
2730
|
+
setShouldPoll(false);
|
|
2731
|
+
}, [enterpriseConnectionId]);
|
|
2837
2732
|
const query = useClerkQuery({
|
|
2838
2733
|
queryKey,
|
|
2839
2734
|
queryFn: () => {
|
|
@@ -2845,14 +2740,15 @@ function useOrganizationEnterpriseConnectionTestRuns(params) {
|
|
|
2845
2740
|
return (q.state.data?.data?.length ?? 0) > 0 ? false : pollIntervalMs;
|
|
2846
2741
|
},
|
|
2847
2742
|
enabled: queryEnabled,
|
|
2848
|
-
refetchIntervalInBackground: false
|
|
2743
|
+
refetchIntervalInBackground: false,
|
|
2744
|
+
placeholderData: defineKeepPreviousDataFn(keepPreviousData)
|
|
2849
2745
|
});
|
|
2850
2746
|
const hasRows = (query.data?.data?.length ?? 0) > 0;
|
|
2851
2747
|
useEffect(() => {
|
|
2852
2748
|
if (shouldPoll && hasRows) setShouldPoll(false);
|
|
2853
2749
|
}, [shouldPoll, hasRows]);
|
|
2854
|
-
const revalidate = useCallback(async () => {
|
|
2855
|
-
if (!hasRows) setShouldPoll(true);
|
|
2750
|
+
const revalidate = useCallback(async (options) => {
|
|
2751
|
+
if ((options?.armPolling ?? true) && !hasRows) setShouldPoll(true);
|
|
2856
2752
|
await queryClient.invalidateQueries({ queryKey: invalidationKey });
|
|
2857
2753
|
}, [
|
|
2858
2754
|
queryClient,
|
|
@@ -3449,5 +3345,5 @@ const usePortalRoot = () => {
|
|
|
3449
3345
|
};
|
|
3450
3346
|
|
|
3451
3347
|
//#endregion
|
|
3452
|
-
export { ClerkContextProvider, ClerkInstanceContext, InitialStateProvider, OptionsContext, UNSAFE_PortalProvider, __createClerkTestQueryClient, __experimental_CheckoutProvider, PaymentElement as __experimental_PaymentElement, PaymentElementProvider as __experimental_PaymentElementProvider, useCheckout as __experimental_useCheckout, usePaymentAttempts as __experimental_usePaymentAttempts, usePaymentElement as __experimental_usePaymentElement, usePaymentMethods as __experimental_usePaymentMethods, usePlans as __experimental_usePlans, useStatements as __experimental_useStatements, useSubscription as __experimental_useSubscription, useClientBase as __internal_useClientBase,
|
|
3348
|
+
export { ClerkContextProvider, ClerkInstanceContext, InitialStateProvider, OptionsContext, UNSAFE_PortalProvider, __createClerkTestQueryClient, __experimental_CheckoutProvider, PaymentElement as __experimental_PaymentElement, PaymentElementProvider as __experimental_PaymentElementProvider, useCheckout as __experimental_useCheckout, usePaymentAttempts as __experimental_usePaymentAttempts, usePaymentElement as __experimental_usePaymentElement, usePaymentMethods as __experimental_usePaymentMethods, usePlans as __experimental_usePlans, useStatements as __experimental_useStatements, useSubscription as __experimental_useSubscription, useClientBase as __internal_useClientBase, useOrganizationBase as __internal_useOrganizationBase, useOrganizationEnterpriseConnectionTestRuns as __internal_useOrganizationEnterpriseConnectionTestRuns, useOrganizationEnterpriseConnections as __internal_useOrganizationEnterpriseConnections, usePaymentAttemptQuery as __internal_usePaymentAttemptQuery, __internal_usePlanDetailsQuery, useSessionBase as __internal_useSessionBase, useStatementQuery as __internal_useStatementQuery, useUserBase as __internal_useUserBase, useUserEnterpriseConnections as __internal_useUserEnterpriseConnections, __resetClerkQueryClientForTest, __setClerkQueryClientForTest, assertContextExists, createContextAndHook, getClerkQueryClient, isDeeplyEqual, useAPIKeys, useAssertWrappedByClerkProvider, useAttemptToEnableOrganizations, useClerk, useClerkInstanceContext, useDeepEqualMemo, useInitialStateContext, useOAuthConsent, useOptionsContext, useOrganization, useOrganizationCreationDefaults, useOrganizationList, usePortalRoot, useReverification, useSafeLayoutEffect, useSession, useSessionList, useUser };
|
|
3453
3349
|
//# sourceMappingURL=index.mjs.map
|