@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
|
@@ -2590,119 +2590,11 @@ function useUserEnterpriseConnections(params = {}) {
|
|
|
2590
2590
|
placeholderData: defineKeepPreviousDataFn(keepPreviousData)
|
|
2591
2591
|
});
|
|
2592
2592
|
const revalidate = (0, react.useCallback)(() => queryClient.invalidateQueries({ queryKey: [stableKey] }), [queryClient, stableKey]);
|
|
2593
|
-
const createEnterpriseConnection = (0, react.useCallback)(async (createParams) => {
|
|
2594
|
-
const created = await user?.createEnterpriseConnection(createParams);
|
|
2595
|
-
await revalidate();
|
|
2596
|
-
return created;
|
|
2597
|
-
}, [user, revalidate]);
|
|
2598
|
-
const updateEnterpriseConnection = (0, react.useCallback)(async (enterpriseConnectionId, updateParams) => {
|
|
2599
|
-
const updated = await user?.updateEnterpriseConnection(enterpriseConnectionId, updateParams);
|
|
2600
|
-
await revalidate();
|
|
2601
|
-
return updated;
|
|
2602
|
-
}, [user, revalidate]);
|
|
2603
|
-
const deleteEnterpriseConnection = (0, react.useCallback)(async (enterpriseConnectionId) => {
|
|
2604
|
-
const deleted = await user?.deleteEnterpriseConnection(enterpriseConnectionId);
|
|
2605
|
-
await revalidate();
|
|
2606
|
-
return deleted;
|
|
2607
|
-
}, [user, revalidate]);
|
|
2608
2593
|
return {
|
|
2609
2594
|
data: query.data,
|
|
2610
2595
|
error: query.error ?? null,
|
|
2611
2596
|
isLoading: query.isLoading,
|
|
2612
2597
|
isFetching: query.isFetching,
|
|
2613
|
-
createEnterpriseConnection,
|
|
2614
|
-
updateEnterpriseConnection,
|
|
2615
|
-
deleteEnterpriseConnection,
|
|
2616
|
-
revalidate
|
|
2617
|
-
};
|
|
2618
|
-
}
|
|
2619
|
-
|
|
2620
|
-
//#endregion
|
|
2621
|
-
//#region src/react/hooks/useEnterpriseConnectionTestRuns.shared.ts
|
|
2622
|
-
/**
|
|
2623
|
-
* @internal
|
|
2624
|
-
*/
|
|
2625
|
-
function useEnterpriseConnectionTestRunsCacheKeys(params) {
|
|
2626
|
-
const { userId, enterpriseConnectionId, args } = params;
|
|
2627
|
-
return (0, react.useMemo)(() => {
|
|
2628
|
-
return createCacheKeys({
|
|
2629
|
-
stablePrefix: INTERNAL_STABLE_KEYS.ENTERPRISE_CONNECTION_TEST_RUNS_KEY,
|
|
2630
|
-
authenticated: Boolean(userId),
|
|
2631
|
-
tracked: {
|
|
2632
|
-
userId: userId ?? null,
|
|
2633
|
-
enterpriseConnectionId: enterpriseConnectionId ?? null
|
|
2634
|
-
},
|
|
2635
|
-
untracked: { args }
|
|
2636
|
-
});
|
|
2637
|
-
}, [
|
|
2638
|
-
userId,
|
|
2639
|
-
enterpriseConnectionId,
|
|
2640
|
-
JSON.stringify(args)
|
|
2641
|
-
]);
|
|
2642
|
-
}
|
|
2643
|
-
|
|
2644
|
-
//#endregion
|
|
2645
|
-
//#region src/react/hooks/useEnterpriseConnectionTestRuns.tsx
|
|
2646
|
-
const DEFAULT_POLL_INTERVAL_MS$1 = 2e3;
|
|
2647
|
-
/**
|
|
2648
|
-
* Subscribes to the list of enterprise-connection test runs for the signed-in user
|
|
2649
|
-
*
|
|
2650
|
-
* @internal
|
|
2651
|
-
*/
|
|
2652
|
-
function useEnterpriseConnectionTestRuns(params) {
|
|
2653
|
-
const { enterpriseConnectionId, params: fetchParams = {
|
|
2654
|
-
initialPage: 1,
|
|
2655
|
-
pageSize: 10
|
|
2656
|
-
}, pollIntervalMs = DEFAULT_POLL_INTERVAL_MS$1, enabled = true } = params;
|
|
2657
|
-
const clerk = useClerkInstanceContext();
|
|
2658
|
-
const user = useUserBase();
|
|
2659
|
-
const [queryClient] = useClerkQueryClient();
|
|
2660
|
-
const { queryKey, invalidationKey, stableKey, authenticated } = useEnterpriseConnectionTestRunsCacheKeys({
|
|
2661
|
-
userId: user?.id ?? null,
|
|
2662
|
-
enterpriseConnectionId,
|
|
2663
|
-
args: fetchParams
|
|
2664
|
-
});
|
|
2665
|
-
useClearQueriesOnSignOut({
|
|
2666
|
-
isSignedOut: user === null,
|
|
2667
|
-
authenticated,
|
|
2668
|
-
stableKeys: stableKey
|
|
2669
|
-
});
|
|
2670
|
-
const queryEnabled = enabled && clerk.loaded && Boolean(user) && Boolean(enterpriseConnectionId);
|
|
2671
|
-
const [shouldPoll, setShouldPoll] = (0, react.useState)(false);
|
|
2672
|
-
const query = useClerkQuery({
|
|
2673
|
-
queryKey,
|
|
2674
|
-
queryFn: () => {
|
|
2675
|
-
if (!enterpriseConnectionId) throw new Error("enterpriseConnectionId is required to fetch test runs");
|
|
2676
|
-
return user?.getEnterpriseConnectionTestRuns(enterpriseConnectionId, fetchParams);
|
|
2677
|
-
},
|
|
2678
|
-
refetchInterval: (q) => {
|
|
2679
|
-
if (!shouldPoll) return false;
|
|
2680
|
-
return (q.state.data?.data?.length ?? 0) > 0 ? false : pollIntervalMs;
|
|
2681
|
-
},
|
|
2682
|
-
enabled: queryEnabled,
|
|
2683
|
-
refetchIntervalInBackground: false,
|
|
2684
|
-
refetchOnWindowFocus: false
|
|
2685
|
-
});
|
|
2686
|
-
const hasRows = (query.data?.data?.length ?? 0) > 0;
|
|
2687
|
-
(0, react.useEffect)(() => {
|
|
2688
|
-
if (shouldPoll && hasRows) setShouldPoll(false);
|
|
2689
|
-
}, [shouldPoll, hasRows]);
|
|
2690
|
-
const revalidate = (0, react.useCallback)(async () => {
|
|
2691
|
-
if (!hasRows) setShouldPoll(true);
|
|
2692
|
-
await queryClient.invalidateQueries({ queryKey: invalidationKey });
|
|
2693
|
-
}, [
|
|
2694
|
-
queryClient,
|
|
2695
|
-
invalidationKey,
|
|
2696
|
-
hasRows
|
|
2697
|
-
]);
|
|
2698
|
-
const isPolling = queryEnabled && shouldPoll && !hasRows;
|
|
2699
|
-
return {
|
|
2700
|
-
data: query.data?.data,
|
|
2701
|
-
totalCount: query.data?.total_count,
|
|
2702
|
-
error: query.error ?? null,
|
|
2703
|
-
isLoading: query.isLoading,
|
|
2704
|
-
isFetching: query.isFetching,
|
|
2705
|
-
isPolling,
|
|
2706
2598
|
revalidate
|
|
2707
2599
|
};
|
|
2708
2600
|
}
|
|
@@ -2819,7 +2711,7 @@ function useOrganizationEnterpriseConnectionTestRuns(params) {
|
|
|
2819
2711
|
const { enterpriseConnectionId, params: fetchParams = {
|
|
2820
2712
|
initialPage: 1,
|
|
2821
2713
|
pageSize: 10
|
|
2822
|
-
}, pollIntervalMs = DEFAULT_POLL_INTERVAL_MS, enabled = true } = params;
|
|
2714
|
+
}, pollIntervalMs = DEFAULT_POLL_INTERVAL_MS, enabled = true, keepPreviousData = false } = params;
|
|
2823
2715
|
const clerk = useClerkInstanceContext();
|
|
2824
2716
|
const organization = useOrganizationBase();
|
|
2825
2717
|
const [queryClient] = useClerkQueryClient();
|
|
@@ -2835,6 +2727,9 @@ function useOrganizationEnterpriseConnectionTestRuns(params) {
|
|
|
2835
2727
|
});
|
|
2836
2728
|
const queryEnabled = enabled && clerk.loaded && Boolean(organization) && Boolean(enterpriseConnectionId);
|
|
2837
2729
|
const [shouldPoll, setShouldPoll] = (0, react.useState)(false);
|
|
2730
|
+
(0, react.useEffect)(() => {
|
|
2731
|
+
setShouldPoll(false);
|
|
2732
|
+
}, [enterpriseConnectionId]);
|
|
2838
2733
|
const query = useClerkQuery({
|
|
2839
2734
|
queryKey,
|
|
2840
2735
|
queryFn: () => {
|
|
@@ -2846,14 +2741,15 @@ function useOrganizationEnterpriseConnectionTestRuns(params) {
|
|
|
2846
2741
|
return (q.state.data?.data?.length ?? 0) > 0 ? false : pollIntervalMs;
|
|
2847
2742
|
},
|
|
2848
2743
|
enabled: queryEnabled,
|
|
2849
|
-
refetchIntervalInBackground: false
|
|
2744
|
+
refetchIntervalInBackground: false,
|
|
2745
|
+
placeholderData: defineKeepPreviousDataFn(keepPreviousData)
|
|
2850
2746
|
});
|
|
2851
2747
|
const hasRows = (query.data?.data?.length ?? 0) > 0;
|
|
2852
2748
|
(0, react.useEffect)(() => {
|
|
2853
2749
|
if (shouldPoll && hasRows) setShouldPoll(false);
|
|
2854
2750
|
}, [shouldPoll, hasRows]);
|
|
2855
|
-
const revalidate = (0, react.useCallback)(async () => {
|
|
2856
|
-
if (!hasRows) setShouldPoll(true);
|
|
2751
|
+
const revalidate = (0, react.useCallback)(async (options) => {
|
|
2752
|
+
if ((options?.armPolling ?? true) && !hasRows) setShouldPoll(true);
|
|
2857
2753
|
await queryClient.invalidateQueries({ queryKey: invalidationKey });
|
|
2858
2754
|
}, [
|
|
2859
2755
|
queryClient,
|
|
@@ -3467,7 +3363,6 @@ exports.__experimental_usePlans = usePlans;
|
|
|
3467
3363
|
exports.__experimental_useStatements = useStatements;
|
|
3468
3364
|
exports.__experimental_useSubscription = useSubscription;
|
|
3469
3365
|
exports.__internal_useClientBase = useClientBase;
|
|
3470
|
-
exports.__internal_useEnterpriseConnectionTestRuns = useEnterpriseConnectionTestRuns;
|
|
3471
3366
|
exports.__internal_useOrganizationBase = useOrganizationBase;
|
|
3472
3367
|
exports.__internal_useOrganizationEnterpriseConnectionTestRuns = useOrganizationEnterpriseConnectionTestRuns;
|
|
3473
3368
|
exports.__internal_useOrganizationEnterpriseConnections = useOrganizationEnterpriseConnections;
|