@uniformdev/mesh-sdk-react 20.50.2-alpha.39 → 20.50.2-alpha.77
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/index.d.mts +54 -3
- package/dist/index.d.ts +54 -3
- package/dist/index.esm.js +175 -89
- package/dist/index.js +252 -166
- package/dist/index.mjs +175 -89
- package/package.json +11 -10
package/dist/index.d.mts
CHANGED
|
@@ -892,20 +892,35 @@ type DataTypeEditorProps = PropsWithChildren<{
|
|
|
892
892
|
*/
|
|
893
893
|
declare function DataTypeEditor({ onChange, children, editVariableComponent }: DataTypeEditorProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
894
894
|
|
|
895
|
-
/**
|
|
895
|
+
/**
|
|
896
|
+
* Status of the delegation session as seen from the React provider.
|
|
897
|
+
*
|
|
898
|
+
* @deprecated This beta identity delegation API may change with breaking changes.
|
|
899
|
+
*/
|
|
896
900
|
type DelegationStatus = 'idle' | 'acquiring' | 'active' | 'disabled' | 'error';
|
|
897
|
-
/**
|
|
901
|
+
/**
|
|
902
|
+
* Value provided by DelegationProvider via React context.
|
|
903
|
+
*
|
|
904
|
+
* @deprecated This beta identity delegation API may change with breaking changes.
|
|
905
|
+
*/
|
|
898
906
|
interface DelegationContextValue {
|
|
899
907
|
status: DelegationStatus;
|
|
900
908
|
error: Error | null;
|
|
901
909
|
reacquire: () => void;
|
|
902
910
|
}
|
|
911
|
+
/** @deprecated This beta identity delegation API may change with breaking changes. */
|
|
903
912
|
declare const DelegationContext: React$1.Context<DelegationContextValue | null>;
|
|
904
913
|
|
|
914
|
+
/**
|
|
915
|
+
* @deprecated This beta identity delegation API may change with breaking changes.
|
|
916
|
+
*/
|
|
905
917
|
interface DelegationGateProps {
|
|
906
918
|
children: React__default.ReactNode;
|
|
919
|
+
/** Shown while delegation is starting. Omit to use the default loading UI. */
|
|
907
920
|
loadingComponent?: React__default.ReactNode;
|
|
921
|
+
/** Shown when identity delegation is not enabled for this integration. Omit to use the default callout. */
|
|
908
922
|
disabledComponent?: React__default.ReactNode;
|
|
923
|
+
/** Shown when delegation fails. Omit to use the default error callout. */
|
|
909
924
|
errorComponent?: React__default.ReactNode | ((props: {
|
|
910
925
|
error: Error;
|
|
911
926
|
}) => React__default.ReactNode);
|
|
@@ -913,9 +928,17 @@ interface DelegationGateProps {
|
|
|
913
928
|
/**
|
|
914
929
|
* Renders children only when the delegation session is active.
|
|
915
930
|
* Shows appropriate fallback UI for loading, disabled, and error states.
|
|
931
|
+
*
|
|
932
|
+
* Sensible defaults use the design system (loading overlay, callouts). Pass `loadingComponent`,
|
|
933
|
+
* `disabledComponent`, or `errorComponent` to customize; pass `null` to render nothing for that state.
|
|
934
|
+
*
|
|
935
|
+
* @deprecated This beta identity delegation API may change with breaking changes.
|
|
916
936
|
*/
|
|
917
937
|
declare function DelegationGate({ children, loadingComponent, disabledComponent, errorComponent, }: DelegationGateProps): _emotion_react_jsx_runtime.JSX.Element | null;
|
|
918
938
|
|
|
939
|
+
/**
|
|
940
|
+
* @deprecated This beta identity delegation API may change with breaking changes.
|
|
941
|
+
*/
|
|
919
942
|
interface DelegationProviderProps {
|
|
920
943
|
/** `UniformMeshSDK` instance obtained from `useUniformMeshSdk()`. */
|
|
921
944
|
sdk: UniformMeshSDK;
|
|
@@ -929,13 +952,39 @@ interface DelegationProviderProps {
|
|
|
929
952
|
* Return `true` to skip the session-token exchange.
|
|
930
953
|
*/
|
|
931
954
|
checkActive: () => Promise<boolean>;
|
|
955
|
+
/**
|
|
956
|
+
* When `true`, re-checks the delegation session after the tab becomes visible again
|
|
957
|
+
* following a period of being hidden. If the server reports the session is no longer
|
|
958
|
+
* active (e.g. the access token expired and the refresh token is gone/invalid), the
|
|
959
|
+
* full session-token exchange is re-run; otherwise the check is silent and does not
|
|
960
|
+
* flip the status back to `acquiring`.
|
|
961
|
+
*
|
|
962
|
+
* Defaults to `true`.
|
|
963
|
+
*/
|
|
964
|
+
revalidateOnFocus?: boolean;
|
|
965
|
+
/**
|
|
966
|
+
* Minimum number of milliseconds the tab must have been hidden before a
|
|
967
|
+
* `revalidateOnFocus` check runs. Prevents hammering the server on rapid tab
|
|
968
|
+
* switches. Defaults to 5 minutes.
|
|
969
|
+
*/
|
|
970
|
+
revalidateAfterMs?: number;
|
|
932
971
|
children: React__default.ReactNode;
|
|
933
972
|
}
|
|
934
973
|
/**
|
|
935
974
|
* Manages the identity delegation lifecycle: checks for an existing session, acquires a
|
|
936
975
|
* session token from the dashboard parent if needed, and delegates exchange to the caller.
|
|
976
|
+
*
|
|
977
|
+
* Should ONLY be used to wrap locations which actually needed delegation and not the entire app like <MeshApp />.
|
|
978
|
+
*
|
|
979
|
+
* Also handles stale-session recovery: when the tab becomes visible again after being
|
|
980
|
+
* hidden for longer than `revalidateAfterMs`, the provider silently re-checks via
|
|
981
|
+
* `checkActive` and re-runs the session exchange only if the server says the session is
|
|
982
|
+
* no longer active. This covers the "returned after a long time" case where the stored
|
|
983
|
+
* access token has expired and the refresh token is also gone or no longer valid.
|
|
984
|
+
*
|
|
985
|
+
* @deprecated This beta identity delegation API may change with breaking changes.
|
|
937
986
|
*/
|
|
938
|
-
declare function DelegationProvider({ sdk, onSessionToken, checkActive, children }: DelegationProviderProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
987
|
+
declare function DelegationProvider({ sdk, onSessionToken, checkActive, revalidateOnFocus, revalidateAfterMs, children, }: DelegationProviderProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
939
988
|
|
|
940
989
|
type MeshAppProps = {
|
|
941
990
|
loadingComponent?: React__default.ComponentType;
|
|
@@ -2013,6 +2062,8 @@ declare function useConnectedDataAsVariables(connectedData: Record<string, unkno
|
|
|
2013
2062
|
/**
|
|
2014
2063
|
* Returns the current delegation session state.
|
|
2015
2064
|
* Must be used within a `DelegationProvider`.
|
|
2065
|
+
*
|
|
2066
|
+
* @deprecated This beta identity delegation API may change with breaking changes.
|
|
2016
2067
|
*/
|
|
2017
2068
|
declare function useDelegation(): DelegationContextValue;
|
|
2018
2069
|
|
package/dist/index.d.ts
CHANGED
|
@@ -892,20 +892,35 @@ type DataTypeEditorProps = PropsWithChildren<{
|
|
|
892
892
|
*/
|
|
893
893
|
declare function DataTypeEditor({ onChange, children, editVariableComponent }: DataTypeEditorProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
894
894
|
|
|
895
|
-
/**
|
|
895
|
+
/**
|
|
896
|
+
* Status of the delegation session as seen from the React provider.
|
|
897
|
+
*
|
|
898
|
+
* @deprecated This beta identity delegation API may change with breaking changes.
|
|
899
|
+
*/
|
|
896
900
|
type DelegationStatus = 'idle' | 'acquiring' | 'active' | 'disabled' | 'error';
|
|
897
|
-
/**
|
|
901
|
+
/**
|
|
902
|
+
* Value provided by DelegationProvider via React context.
|
|
903
|
+
*
|
|
904
|
+
* @deprecated This beta identity delegation API may change with breaking changes.
|
|
905
|
+
*/
|
|
898
906
|
interface DelegationContextValue {
|
|
899
907
|
status: DelegationStatus;
|
|
900
908
|
error: Error | null;
|
|
901
909
|
reacquire: () => void;
|
|
902
910
|
}
|
|
911
|
+
/** @deprecated This beta identity delegation API may change with breaking changes. */
|
|
903
912
|
declare const DelegationContext: React$1.Context<DelegationContextValue | null>;
|
|
904
913
|
|
|
914
|
+
/**
|
|
915
|
+
* @deprecated This beta identity delegation API may change with breaking changes.
|
|
916
|
+
*/
|
|
905
917
|
interface DelegationGateProps {
|
|
906
918
|
children: React__default.ReactNode;
|
|
919
|
+
/** Shown while delegation is starting. Omit to use the default loading UI. */
|
|
907
920
|
loadingComponent?: React__default.ReactNode;
|
|
921
|
+
/** Shown when identity delegation is not enabled for this integration. Omit to use the default callout. */
|
|
908
922
|
disabledComponent?: React__default.ReactNode;
|
|
923
|
+
/** Shown when delegation fails. Omit to use the default error callout. */
|
|
909
924
|
errorComponent?: React__default.ReactNode | ((props: {
|
|
910
925
|
error: Error;
|
|
911
926
|
}) => React__default.ReactNode);
|
|
@@ -913,9 +928,17 @@ interface DelegationGateProps {
|
|
|
913
928
|
/**
|
|
914
929
|
* Renders children only when the delegation session is active.
|
|
915
930
|
* Shows appropriate fallback UI for loading, disabled, and error states.
|
|
931
|
+
*
|
|
932
|
+
* Sensible defaults use the design system (loading overlay, callouts). Pass `loadingComponent`,
|
|
933
|
+
* `disabledComponent`, or `errorComponent` to customize; pass `null` to render nothing for that state.
|
|
934
|
+
*
|
|
935
|
+
* @deprecated This beta identity delegation API may change with breaking changes.
|
|
916
936
|
*/
|
|
917
937
|
declare function DelegationGate({ children, loadingComponent, disabledComponent, errorComponent, }: DelegationGateProps): _emotion_react_jsx_runtime.JSX.Element | null;
|
|
918
938
|
|
|
939
|
+
/**
|
|
940
|
+
* @deprecated This beta identity delegation API may change with breaking changes.
|
|
941
|
+
*/
|
|
919
942
|
interface DelegationProviderProps {
|
|
920
943
|
/** `UniformMeshSDK` instance obtained from `useUniformMeshSdk()`. */
|
|
921
944
|
sdk: UniformMeshSDK;
|
|
@@ -929,13 +952,39 @@ interface DelegationProviderProps {
|
|
|
929
952
|
* Return `true` to skip the session-token exchange.
|
|
930
953
|
*/
|
|
931
954
|
checkActive: () => Promise<boolean>;
|
|
955
|
+
/**
|
|
956
|
+
* When `true`, re-checks the delegation session after the tab becomes visible again
|
|
957
|
+
* following a period of being hidden. If the server reports the session is no longer
|
|
958
|
+
* active (e.g. the access token expired and the refresh token is gone/invalid), the
|
|
959
|
+
* full session-token exchange is re-run; otherwise the check is silent and does not
|
|
960
|
+
* flip the status back to `acquiring`.
|
|
961
|
+
*
|
|
962
|
+
* Defaults to `true`.
|
|
963
|
+
*/
|
|
964
|
+
revalidateOnFocus?: boolean;
|
|
965
|
+
/**
|
|
966
|
+
* Minimum number of milliseconds the tab must have been hidden before a
|
|
967
|
+
* `revalidateOnFocus` check runs. Prevents hammering the server on rapid tab
|
|
968
|
+
* switches. Defaults to 5 minutes.
|
|
969
|
+
*/
|
|
970
|
+
revalidateAfterMs?: number;
|
|
932
971
|
children: React__default.ReactNode;
|
|
933
972
|
}
|
|
934
973
|
/**
|
|
935
974
|
* Manages the identity delegation lifecycle: checks for an existing session, acquires a
|
|
936
975
|
* session token from the dashboard parent if needed, and delegates exchange to the caller.
|
|
976
|
+
*
|
|
977
|
+
* Should ONLY be used to wrap locations which actually needed delegation and not the entire app like <MeshApp />.
|
|
978
|
+
*
|
|
979
|
+
* Also handles stale-session recovery: when the tab becomes visible again after being
|
|
980
|
+
* hidden for longer than `revalidateAfterMs`, the provider silently re-checks via
|
|
981
|
+
* `checkActive` and re-runs the session exchange only if the server says the session is
|
|
982
|
+
* no longer active. This covers the "returned after a long time" case where the stored
|
|
983
|
+
* access token has expired and the refresh token is also gone or no longer valid.
|
|
984
|
+
*
|
|
985
|
+
* @deprecated This beta identity delegation API may change with breaking changes.
|
|
937
986
|
*/
|
|
938
|
-
declare function DelegationProvider({ sdk, onSessionToken, checkActive, children }: DelegationProviderProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
987
|
+
declare function DelegationProvider({ sdk, onSessionToken, checkActive, revalidateOnFocus, revalidateAfterMs, children, }: DelegationProviderProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
939
988
|
|
|
940
989
|
type MeshAppProps = {
|
|
941
990
|
loadingComponent?: React__default.ComponentType;
|
|
@@ -2013,6 +2062,8 @@ declare function useConnectedDataAsVariables(connectedData: Record<string, unkno
|
|
|
2013
2062
|
/**
|
|
2014
2063
|
* Returns the current delegation session state.
|
|
2015
2064
|
* Must be used within a `DelegationProvider`.
|
|
2065
|
+
*
|
|
2066
|
+
* @deprecated This beta identity delegation API may change with breaking changes.
|
|
2016
2067
|
*/
|
|
2017
2068
|
declare function useDelegation(): DelegationContextValue;
|
|
2018
2069
|
|