@sanity/sdk-react 3.5.0-next.20260922182803 → 3.5.0-next.20260922190712

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.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { DatasetsResponse, DatasetsResponse as DatasetsResponse$1, SanityProjectMember } from "@sanity/client";
2
- import { AccessResourceType, ActionsResult, Application, ApplicationInclude, ApplicationsOptions, ApplicationsResponse, AuthState, ClientOptions, Comment, CommentThread, CommentsOptions, CreateCommentOptions, CurrentUser, DatasetHandle, DocumentAction, DocumentEvent, DocumentHandle as DocumentHandle$1, DocumentOptions, DocumentPermissionsResult, DocumentPresence, DocumentResource, DocumentTypeHandle as DocumentTypeHandle$1, FavoriteStatusResponse, GetUserOptions, GetUsersOptions, Installation, InstallationInclude, InstallationsOptions, InstallationsResponse, JsonMatch, Organization, OrganizationOptions, Organizations, OrganizationsOptions, PresenceSelection, PreviewValue, Project, ProjectHandle, ProjectOptions, ProjectsOptions, QueryOptions, ReleaseAction, ReleaseDocument, RemoveCommentOptions, ReplyToCommentOptions, ResolveDocument, ResolveProjectionResult, ResolveQueryResult, SanityConfig, SanityInstance, SanityUser, SetCommentStatusOptions, TokenSource, UpdateCommentOptions, UserPresence } from "@sanity/sdk";
2
+ import { AccessResourceType, ActionsResult, Application, ApplicationInclude, ApplicationsOptions, ApplicationsResponse, AuthState, ClientOptions, Comment, CommentThread, CommentsOptions, CreateCommentOptions, CurrentUser, DatasetHandle, DocumentAction, DocumentEvent, DocumentHandle as DocumentHandle$1, DocumentOptions, DocumentPermissionsResult, DocumentPresence, DocumentResource, DocumentTypeHandle as DocumentTypeHandle$1, FavoriteStatusResponse, GetUserOptions, GetUsersOptions, Installation, InstallationInclude, InstallationsOptions, InstallationsResponse, JsonMatch, OAuthTokens, Organization, OrganizationOptions, Organizations, OrganizationsOptions, PresenceSelection, PreviewValue, Project, ProjectHandle, ProjectOptions, ProjectsOptions, QueryOptions, ReleaseAction, ReleaseDocument, RemoveCommentOptions, ReplyToCommentOptions, ResolveDocument, ResolveProjectionResult, ResolveQueryResult, SanityConfig, SanityInstance, SanityUser, SetCommentStatusOptions, TokenSource, UpdateCommentOptions, UserPresence } from "@sanity/sdk";
3
3
  import "@sanity/sdk/_internal";
4
4
  import React$1, { PropsWithChildren, ReactElement, ReactNode } from "react";
5
5
  import { FallbackProps } from "react-error-boundary";
@@ -1095,6 +1095,48 @@ export declare const useCurrentUser: UseCurrentUser;
1095
1095
  * @public
1096
1096
  */
1097
1097
  export declare const useHandleAuthCallback: () => (locationHref?: string | undefined) => Promise<string | false>;
1098
+ /**
1099
+ * A React hook that returns a function for handling the OAuth redirect callback.
1100
+ *
1101
+ * @remarks
1102
+ * This is the OAuth counterpart to `useHandleAuthCallback`. The returned
1103
+ * function invokes core's `handleOAuthCallback`, which validates the `state`
1104
+ * parameter, surfaces `?error=` redirects, exchanges the authorization `code`
1105
+ * for tokens, persists them, and transitions the auth state to `LOGGED_IN` —
1106
+ * all in core. It resolves the callback URL cleaned of the OAuth params
1107
+ * (`code`, `state`, `error`, `error_description`) so the caller can strip them
1108
+ * with `history.replaceState`, or `false` when there was nothing to handle.
1109
+ *
1110
+ * Concurrent calls are single-flight in core, so React StrictMode's double
1111
+ * invocation will not trigger a second code exchange. Calling it again after
1112
+ * the exchange has completed, with the OAuth params still in the URL, fails
1113
+ * state validation and moves the auth state to `ERROR`, so apply the returned
1114
+ * URL before the component can remount.
1115
+ *
1116
+ * @example
1117
+ * ```tsx
1118
+ * function OAuthCallback() {
1119
+ * const handleCallback = useHandleOAuthCallback()
1120
+ *
1121
+ * useEffect(() => {
1122
+ * handleCallback(window.location.href)
1123
+ * .then((cleanedUrl) => {
1124
+ * if (cleanedUrl) {
1125
+ * // Remove the OAuth params from the URL without a reload
1126
+ * history.replaceState(null, '', cleanedUrl)
1127
+ * }
1128
+ * })
1129
+ * .catch(console.error)
1130
+ * }, [handleCallback])
1131
+ *
1132
+ * return <div>Completing sign-in…</div>
1133
+ * }
1134
+ * ```
1135
+ *
1136
+ * @returns A callback handler that processes the OAuth redirect
1137
+ * @public
1138
+ */
1139
+ export declare const useHandleOAuthCallback: () => (locationHref?: string | undefined) => Promise<string | false>;
1098
1140
  /**
1099
1141
  * @internal
1100
1142
  */
@@ -1105,6 +1147,103 @@ export declare function useLoginUrl(): string;
1105
1147
  * @returns A function to log out of the current session
1106
1148
  */
1107
1149
  export declare const useLogOut: () => () => Promise<void>;
1150
+ /**
1151
+ * A React hook that returns a function for starting the OAuth authorization-code + PKCE flow.
1152
+ *
1153
+ * @remarks
1154
+ * The returned function invokes core's `startOAuthAuthorization`, which generates
1155
+ * the PKCE `code_verifier`, `code_challenge` and `state`, persists the verifier and
1156
+ * state to `sessionStorage`, and navigates the browser to the authorize endpoint.
1157
+ * `clientId`, `redirectUri` and `organizationId` are read from the instance's
1158
+ * `auth.oauth` config. The returned promise rejects if the instance has no `auth.oauth` config.
1159
+ *
1160
+ * Pair with {@link useHandleOAuthCallback} on the redirect URI to complete the flow.
1161
+ *
1162
+ * @example
1163
+ * ```tsx
1164
+ * function LoginButton() {
1165
+ * const authorize = useOAuthAuthorize()
1166
+ * return <button onClick={() => authorize().catch(console.error)}>Sign in</button>
1167
+ * }
1168
+ * ```
1169
+ *
1170
+ * @returns A function that starts the OAuth flow by navigating to the authorization URL
1171
+ * @public
1172
+ */
1173
+ export declare const useOAuthAuthorize: () => () => Promise<void>;
1174
+ /**
1175
+ * The current OAuth token state, plus actions to refresh and revoke it.
1176
+ *
1177
+ * @public
1178
+ */
1179
+ interface UseOAuthTokensResult {
1180
+ /**
1181
+ * The stored OAuth tokens, or `null` when not logged in via OAuth. The
1182
+ * refresh token is omitted — core retains it internally for `refresh`.
1183
+ */
1184
+ tokens: Omit<OAuthTokens, 'refreshToken'> | null;
1185
+ /**
1186
+ * Returns whether the access token has expired, comparing the latest stored
1187
+ * `expiresAt` against the current time at the moment it is called. Both the
1188
+ * tokens and the clock are read at call time, so a reference captured in an
1189
+ * earlier render stays accurate after a `refresh`. Reading the clock does not
1190
+ * trigger a re-render, so call this in an event handler or effect rather than
1191
+ * during render. Returns `false` when there are no tokens.
1192
+ */
1193
+ isExpired: () => boolean;
1194
+ /**
1195
+ * Refresh via the OAuth `refresh_token` grant. When there is no refresh token,
1196
+ * core clears the stored tokens, logs the user out, and this resolves `null`.
1197
+ * Rejects on transient failures (network, 5xx, 408, 429), leaving tokens
1198
+ * unchanged so the call can be retried. Also rejects when the server rejects
1199
+ * the refresh token itself (other 4xx); core clears the tokens and logs out
1200
+ * first, so check `tokens` before retrying.
1201
+ */
1202
+ refresh: () => Promise<Omit<OAuthTokens, 'refreshToken'> | null>;
1203
+ /** Revoke the tokens at the OAuth server, clear them locally, and log out. */
1204
+ revoke: () => Promise<void>;
1205
+ }
1206
+ /**
1207
+ * A React hook that exposes the stored OAuth token state along with `refresh`
1208
+ * and `revoke` actions.
1209
+ *
1210
+ * @remarks
1211
+ * The token view is a synchronous read over core's token state source, so the
1212
+ * hook re-renders whenever tokens change — including changes made in another
1213
+ * tab, which core propagates via `storage` events.
1214
+ *
1215
+ * @returns The current {@link UseOAuthTokensResult}
1216
+ *
1217
+ * @example
1218
+ * ```tsx
1219
+ * function TokenStatus() {
1220
+ * const {tokens, isExpired, refresh, revoke} = useOAuthTokens()
1221
+ *
1222
+ * if (!tokens) return <div>Not signed in</div>
1223
+ *
1224
+ * const handleRefresh = async () => {
1225
+ * if (!isExpired()) return
1226
+ * try {
1227
+ * await refresh()
1228
+ * } catch {
1229
+ * // Transient failure (tokens unchanged, retry later) or the refresh
1230
+ * // token was rejected (tokens now null, user is logged out).
1231
+ * }
1232
+ * }
1233
+ *
1234
+ * return (
1235
+ * <div>
1236
+ * <p>Expires at {tokens.expiresAt.toLocaleTimeString()}</p>
1237
+ * <button onClick={handleRefresh}>Refresh if expired</button>
1238
+ * <button onClick={() => revoke()}>Revoke tokens</button>
1239
+ * </div>
1240
+ * )
1241
+ * }
1242
+ * ```
1243
+ *
1244
+ * @public
1245
+ */
1246
+ export declare function useOAuthTokens(): UseOAuthTokensResult;
1108
1247
  /**
1109
1248
  * Hook that verifies the current projects belongs to the organization ID specified in the dashboard context.
1110
1249
  *
@@ -3522,5 +3661,5 @@ export declare function useUsers(options?: GetUsersOptions): UsersResult;
3522
3661
  * @internal
3523
3662
  */
3524
3663
  export declare const REACT_SDK_VERSION: {};
3525
- export type { AuthBoundaryProps, Status as ComlinkStatus, CommentActions, CreateDocumentOverrides, DatasetsResponse, DocumentHandle, DocumentTypeHandle, DocumentsOptions, DocumentsResponse, FetcherHookResult, FrameConnection, FrameMessageHandler as MessageHandler, MutationHookResult, PaginatedDocumentsOptions, PaginatedDocumentsResponse, ResourceHandle, ResourceProviderProps, SDKProviderProps, SanityAppProps, SanityDocument, SanityInstanceProviderProps, SanityProjectMember, SortOrderingItem, StudioWorkspaceHandle, UseCommentThreadsResult, UseCommentsResult, UseFrameConnectionOptions, UsePresenceForDocumentOptions, UseReportPresenceOptions, UseWindowConnectionOptions, UserResult, UsersResult, WindowConnection, WindowMessageHandler, useDocumentPreviewOptions, useDocumentPreviewResults, useDocumentProjectionOptions, useDocumentProjectionResults };
3664
+ export type { AuthBoundaryProps, Status as ComlinkStatus, CommentActions, CreateDocumentOverrides, DatasetsResponse, DocumentHandle, DocumentTypeHandle, DocumentsOptions, DocumentsResponse, FetcherHookResult, FrameConnection, FrameMessageHandler as MessageHandler, MutationHookResult, PaginatedDocumentsOptions, PaginatedDocumentsResponse, ResourceHandle, ResourceProviderProps, SDKProviderProps, SanityAppProps, SanityDocument, SanityInstanceProviderProps, SanityProjectMember, SortOrderingItem, StudioWorkspaceHandle, UseCommentThreadsResult, UseCommentsResult, UseFrameConnectionOptions, UseOAuthTokensResult, UsePresenceForDocumentOptions, UseReportPresenceOptions, UseWindowConnectionOptions, UserResult, UsersResult, WindowConnection, WindowMessageHandler, useDocumentPreviewOptions, useDocumentPreviewResults, useDocumentProjectionOptions, useDocumentProjectionResults };
3526
3665
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/components/auth/LoginError.tsx","../src/components/auth/AuthBoundary.tsx","../src/components/SanityApp.tsx","../src/components/SDKProvider.tsx","../src/config/handles.ts","../src/context/ComlinkTokenRefresh.tsx","../src/context/renderSanityApp.tsx","../src/context/ResourceProvider.tsx","../src/context/SanityInstanceProvider.tsx","../src/context/SDKStudioContext.ts","../src/hooks/helpers/createFetcherHook.ts","../src/hooks/access/useCheckPermissions.ts","../src/hooks/agent/agentActions.ts","../src/hooks/applications/useApplication.ts","../src/hooks/applications/useApplications.ts","../src/hooks/helpers/createMutationHook.tsx","../src/hooks/applications/useDeleteApplication.ts","../src/hooks/applications/useUpdateApplication.ts","../src/hooks/auth/useAuthState.tsx","../src/hooks/auth/useAuthToken.tsx","../src/hooks/auth/useCurrentUser.tsx","../src/hooks/auth/useHandleAuthCallback.tsx","../src/hooks/auth/useLoginUrl.tsx","../src/hooks/auth/useLogOut.tsx","../src/hooks/auth/useVerifyOrgProjects.tsx","../src/hooks/client/useClient.ts","../../../node_modules/.pnpm/xstate@5.32.6/node_modules/xstate/dist/declarations/src/index.d.ts","../../../node_modules/.pnpm/@sanity+comlink@4.0.3/node_modules/@sanity/comlink/dist/index.d.ts","../src/hooks/comlink/useFrameConnection.ts","../src/hooks/comlink/useWindowConnection.ts","../src/hooks/helpers/useNormalizedResourceOptions.ts","../src/hooks/comments/useCommentActions.ts","../src/hooks/comments/useComments.ts","../src/hooks/comments/useCommentThreads.ts","../src/hooks/context/useResource.ts","../src/hooks/context/useSanityInstance.ts","../src/hooks/dashboard/useFavoriteContext.ts","../src/hooks/dashboard/useFavorite.ts","../src/hooks/dashboard/useRecordDocumentHistoryEvent.ts","../src/hooks/dashboard/useStudioWorkspacesByProjectIdDataset.ts","../src/hooks/dashboard/useUpdateFavorite.ts","../src/hooks/datasets/useDatasets.ts","../src/hooks/document/useApplyDocumentActions.ts","../src/hooks/document/useCreateDocument.ts","../src/hooks/document/useDocument.ts","../src/hooks/document/useDocumentEvent.ts","../src/hooks/document/useDocumentPermissions.ts","../src/hooks/document/useDocumentSyncStatus.ts","../src/hooks/document/useEditDocument.ts","../src/hooks/documents/useDocuments.ts","../src/hooks/installations/useInstallation.ts","../src/hooks/installations/useInstallations.ts","../src/hooks/organizations/useOrganization.ts","../src/hooks/organizations/useOrganizations.ts","../src/hooks/paginatedDocuments/usePaginatedDocuments.ts","../src/hooks/presence/usePresence.ts","../src/hooks/presence/usePresenceForDocument.ts","../src/hooks/presence/useReportPresence.ts","../src/hooks/preview/useDocumentPreview.tsx","../src/hooks/projection/useDocumentProjection.ts","../src/hooks/projects/useProject.ts","../src/hooks/projects/useProjects.ts","../src/hooks/query/useQuery.ts","../src/hooks/releases/useActiveReleases.ts","../src/hooks/releases/useAllReleases.ts","../src/hooks/releases/useApplyReleaseActions.ts","../src/hooks/releases/usePerspective.ts","../src/hooks/users/useUser.ts","../src/hooks/users/useUsers.ts","../src/version.ts"],"x_google_ignoreList":[26,27],"mappings":";;;;;;;;;;;;;KAoBY,kBAAkB;;;;UCkBb;;;;;EAKf,iBAAiB,MAAM;IACrB,SAAS,MAAM;IACf,SAAS,MAAM;;;;;;EAOjB,oBAAoB,MAAM;IACxB,SAAS,MAAM;IACf,SAAS,MAAM;;;;;;;EAQjB,sBAAsB,MAAM,cAAc;;EAG1C,SAAS,MAAM;;;;EAKf;;EAGA,SAAS,MAAM;;EAGf,WAAW,MAAM;;;;;;;;EASjB;;;;;;;;;;;;;;;;;;;;;;;wBAwBc,eACd,wBACG,SACF,oBAAoB,MAAM;;;;;UCpGZ;;;;;;;EAOf,SAAS,eAAe;EACxB,YAAY,eAAe;EAC3B,UAAU,MAAM;EAEhB,UAAU,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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tC,kBAAkB,QAAQ,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBCblC,cACX,wCACA,wCAEA,UAAU,gBAAgB,gBAAgB,qBACvC,kBAAkB,QAAQ,gBAAgB;;;;;KC1B1C,gBACH,gCACA,kCACA,sCACE,wBAAwB,aAAa,QAAQ,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA0D3C,SACd,gCACA,kCACA,oCAEA,SAAS,gBAAgB,QAAQ,UAAU;;EAG3C,MAAM,mBAAmB,WAAW,cAAc;;EAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAgCc,SAAS,OAAO,SAAS,wBAAwB;;EAE/D,MAAM;;EAEN;;;;;;;;;;;;;;;;;;wBCzEc,kBACd,UAAU,wBAAwB,6BACjC;;;;;;;;;;;;;;;;;;;;;;;;;;wBCKa,eACd,UAAU,wBAAwB,6BACjC;;;;UClDO;OACH,QAAQ,gBAAgB,iBAAiB,UAAU,mBAAmB,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAsExE,wBAAwB;;;;;wBC1BrB,eAAe,oBAAoB;;;;;UC1ClC;;;;EAIf,MAAM;;;;EAIN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAmCc,QAAQ,SAAS,iBAAiB;;;;;UCpCjC;;;;EAIf,MAAM;;;;EAIN;;;;EAKA;;;;EAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA0Dc,SAAS,UAAU,kBAAkB;;;;;qBCtFxC"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/components/auth/LoginError.tsx","../src/components/auth/AuthBoundary.tsx","../src/components/SanityApp.tsx","../src/components/SDKProvider.tsx","../src/config/handles.ts","../src/context/ComlinkTokenRefresh.tsx","../src/context/renderSanityApp.tsx","../src/context/ResourceProvider.tsx","../src/context/SanityInstanceProvider.tsx","../src/context/SDKStudioContext.ts","../src/hooks/helpers/createFetcherHook.ts","../src/hooks/access/useCheckPermissions.ts","../src/hooks/agent/agentActions.ts","../src/hooks/applications/useApplication.ts","../src/hooks/applications/useApplications.ts","../src/hooks/helpers/createMutationHook.tsx","../src/hooks/applications/useDeleteApplication.ts","../src/hooks/applications/useUpdateApplication.ts","../src/hooks/auth/useAuthState.tsx","../src/hooks/auth/useAuthToken.tsx","../src/hooks/auth/useCurrentUser.tsx","../src/hooks/auth/useHandleAuthCallback.tsx","../src/hooks/auth/useHandleOAuthCallback.tsx","../src/hooks/auth/useLoginUrl.tsx","../src/hooks/auth/useLogOut.tsx","../src/hooks/auth/useOAuthAuthorize.tsx","../src/hooks/auth/useOAuthTokens.tsx","../src/hooks/auth/useVerifyOrgProjects.tsx","../src/hooks/client/useClient.ts","../../../node_modules/.pnpm/xstate@5.32.6/node_modules/xstate/dist/declarations/src/index.d.ts","../../../node_modules/.pnpm/@sanity+comlink@4.0.3/node_modules/@sanity/comlink/dist/index.d.ts","../src/hooks/comlink/useFrameConnection.ts","../src/hooks/comlink/useWindowConnection.ts","../src/hooks/helpers/useNormalizedResourceOptions.ts","../src/hooks/comments/useCommentActions.ts","../src/hooks/comments/useComments.ts","../src/hooks/comments/useCommentThreads.ts","../src/hooks/context/useResource.ts","../src/hooks/context/useSanityInstance.ts","../src/hooks/dashboard/useFavoriteContext.ts","../src/hooks/dashboard/useFavorite.ts","../src/hooks/dashboard/useRecordDocumentHistoryEvent.ts","../src/hooks/dashboard/useStudioWorkspacesByProjectIdDataset.ts","../src/hooks/dashboard/useUpdateFavorite.ts","../src/hooks/datasets/useDatasets.ts","../src/hooks/document/useApplyDocumentActions.ts","../src/hooks/document/useCreateDocument.ts","../src/hooks/document/useDocument.ts","../src/hooks/document/useDocumentEvent.ts","../src/hooks/document/useDocumentPermissions.ts","../src/hooks/document/useDocumentSyncStatus.ts","../src/hooks/document/useEditDocument.ts","../src/hooks/documents/useDocuments.ts","../src/hooks/installations/useInstallation.ts","../src/hooks/installations/useInstallations.ts","../src/hooks/organizations/useOrganization.ts","../src/hooks/organizations/useOrganizations.ts","../src/hooks/paginatedDocuments/usePaginatedDocuments.ts","../src/hooks/presence/usePresence.ts","../src/hooks/presence/usePresenceForDocument.ts","../src/hooks/presence/useReportPresence.ts","../src/hooks/preview/useDocumentPreview.tsx","../src/hooks/projection/useDocumentProjection.ts","../src/hooks/projects/useProject.ts","../src/hooks/projects/useProjects.ts","../src/hooks/query/useQuery.ts","../src/hooks/releases/useActiveReleases.ts","../src/hooks/releases/useAllReleases.ts","../src/hooks/releases/useApplyReleaseActions.ts","../src/hooks/releases/usePerspective.ts","../src/hooks/users/useUser.ts","../src/hooks/users/useUsers.ts","../src/version.ts"],"x_google_ignoreList":[29,30],"mappings":";;;;;;;;;;;;;KAoBY,kBAAkB;;;;UCkBb;;;;;EAKf,iBAAiB,MAAM;IACrB,SAAS,MAAM;IACf,SAAS,MAAM;;;;;;EAOjB,oBAAoB,MAAM;IACxB,SAAS,MAAM;IACf,SAAS,MAAM;;;;;;;EAQjB,sBAAsB,MAAM,cAAc;;EAG1C,SAAS,MAAM;;;;EAKf;;EAGA,SAAS,MAAM;;EAGf,WAAW,MAAM;;;;;;;;EASjB;;;;;;;;;;;;;;;;;;;;;;;wBAwBc,eACd,wBACG,SACF,oBAAoB,MAAM;;;;;UCpGZ;;;;;;;EAOf,SAAS,eAAe;EACxB,YAAY,eAAe;EAC3B,UAAU,MAAM;EAEhB,UAAU,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAqFc,YACd,UACA,UACA,QAAQ,eACL,SACF,iBAAiB;;;;UC3HH,yBAAyB;EACxC,UAAU;EACV,QAAQ,eAAe;EACvB,UAAU;EACV,YAAY,eAAe;;EAE3B;;;;;;;wBAoBc,cACd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ateSourceHook, i as useOrganizationId, l as useSanityInstance, n as useTopic, o as useWindowConnection, r as useEmit, s as useAuthState, t as useStudioWorkspacesByProjectIdDataset, u as SanityInstanceContext } from "./useStudioWorkspacesByProjectIdDataset-DL6_9jgU.js";
2
2
  import { c } from "react-compiler-runtime";
3
3
  import { ClientError, CorsOriginError } from "@sanity/client";
4
- import { AuthStateType, application, applications, applyDocumentActions, checkPermissions, createComment, createDocument, createSanityInstance, datasets, deleteApplication, editDocument, favorites, getActiveReleasesState, getAllReleasesState, getClientState, getCommentThreadsState, getCommentsState, getCorsErrorProjectId, getCurrentUserState, getDocumentPresence, getDocumentState, getDocumentSyncStatus, getIsInDashboardState, getLoginUrlState, getPermissionsState, getPerspectiveState, getPresence, getProjectionState, getQueryState, getTokenState, getUsersState, handleAuthCallback, installation, installations, isDatasetResource, isImportError, isMediaLibraryResource, loadMoreUsers, logout, observeOrganizationVerificationState, organization, organizations, project, projects, removeComment, replyToComment, reportPresence, resolveCommentThreads, resolveComments, resolveDocument, resolveProjection, resolveQuery, resolveUsers, setAuthToken, setCommentStatus, setFavorite, subscribeDocumentEvents, updateApplication, updateComment } from "@sanity/sdk";
4
+ import { AuthStateType, application, applications, applyDocumentActions, checkPermissions, createComment, createDocument, createSanityInstance, datasets, deleteApplication, editDocument, favorites, getActiveReleasesState, getAllReleasesState, getClientState, getCommentThreadsState, getCommentsState, getCorsErrorProjectId, getCurrentUserState, getDocumentPresence, getDocumentState, getDocumentSyncStatus, getIsInDashboardState, getLoginUrlState, getOAuthTokensState, getPermissionsState, getPerspectiveState, getPresence, getProjectionState, getQueryState, getTokenState, getUsersState, handleAuthCallback, handleOAuthCallback, installation, installations, isDatasetResource, isImportError, isMediaLibraryResource, loadMoreUsers, logout, observeOrganizationVerificationState, organization, organizations, project, projects, refreshOAuthTokens, removeComment, replyToComment, reportPresence, resolveCommentThreads, resolveComments, resolveDocument, resolveProjection, resolveQuery, resolveUsers, revokeOAuthTokens, setAuthToken, setCommentStatus, setFavorite, startOAuthAuthorization, subscribeDocumentEvents, updateApplication, updateComment } from "@sanity/sdk";
5
5
  import { PREVIEW_PROJECTION, createGroqSearchFilter, getClientErrorApiBody, getClientErrorApiDescription, getCommentsOptionsKey, getQueryKey, getUsersKey, initTelemetry, isDashboardEnvironment, isDeepEqual, isProjectUserNotFoundClientError, isStudioConfig, parseCommentsOptionsKey, parseQueryKey, parseUsersKey, pickProperties, randomUuid, trackHookMounted, transformProjectionToPreview } from "@sanity/sdk/_internal";
6
6
  import { StrictMode, Suspense, createContext, use, useCallback, useContext, useEffect, useInsertionEffect, useMemo, useRef, useState, useSyncExternalStore, useTransition } from "react";
7
7
  import { ErrorBoundary, getErrorMessage } from "react-error-boundary";
@@ -1753,7 +1753,87 @@ function createMutationHook(mutation) {
1753
1753
  * @internal
1754
1754
  * @returns The mutation envelope `{mutate, isPending, error, data, reset}`.
1755
1755
  */
1756
- const useDeleteApplication = createMutationHook(deleteApplication), useUpdateApplication = createMutationHook(updateApplication), useAuthToken = createStateSourceHook(getTokenState), useCurrentUser = createStateSourceHook(getCurrentUserState), useClient = createStateSourceHook({
1756
+ const useDeleteApplication = createMutationHook(deleteApplication), useUpdateApplication = createMutationHook(updateApplication), useAuthToken = createStateSourceHook(getTokenState), useCurrentUser = createStateSourceHook(getCurrentUserState), useHandleOAuthCallback = createCallbackHook(handleOAuthCallback), useOAuthAuthorize = createCallbackHook(startOAuthAuthorization), useOAuthTokensState = createStateSourceHook(getOAuthTokensState), useRefreshOAuthTokens = createCallbackHook(refreshOAuthTokens), useRevokeOAuthTokens = createCallbackHook(revokeOAuthTokens), useIsOAuthTokenExpired = createCallbackHook((instance) => {
1757
+ let tokens = getOAuthTokensState(instance).getCurrent();
1758
+ return tokens ? tokens.expiresAt.getTime() <= Date.now() : !1;
1759
+ });
1760
+ /**
1761
+ * A React hook that exposes the stored OAuth token state along with `refresh`
1762
+ * and `revoke` actions.
1763
+ *
1764
+ * @remarks
1765
+ * The token view is a synchronous read over core's token state source, so the
1766
+ * hook re-renders whenever tokens change — including changes made in another
1767
+ * tab, which core propagates via `storage` events.
1768
+ *
1769
+ * @returns The current {@link UseOAuthTokensResult}
1770
+ *
1771
+ * @example
1772
+ * ```tsx
1773
+ * function TokenStatus() {
1774
+ * const {tokens, isExpired, refresh, revoke} = useOAuthTokens()
1775
+ *
1776
+ * if (!tokens) return <div>Not signed in</div>
1777
+ *
1778
+ * const handleRefresh = async () => {
1779
+ * if (!isExpired()) return
1780
+ * try {
1781
+ * await refresh()
1782
+ * } catch {
1783
+ * // Transient failure (tokens unchanged, retry later) or the refresh
1784
+ * // token was rejected (tokens now null, user is logged out).
1785
+ * }
1786
+ * }
1787
+ *
1788
+ * return (
1789
+ * <div>
1790
+ * <p>Expires at {tokens.expiresAt.toLocaleTimeString()}</p>
1791
+ * <button onClick={handleRefresh}>Refresh if expired</button>
1792
+ * <button onClick={() => revoke()}>Revoke tokens</button>
1793
+ * </div>
1794
+ * )
1795
+ * }
1796
+ * ```
1797
+ *
1798
+ * @public
1799
+ */
1800
+ function useOAuthTokens() {
1801
+ let $ = c(5), t0 = useOAuthTokensState(), t1 = useIsOAuthTokenExpired(), t2 = useRefreshOAuthTokens(), t3 = useRevokeOAuthTokens(), t4;
1802
+ return $[0] !== t0 || $[1] !== t1 || $[2] !== t2 || $[3] !== t3 ? (t4 = {
1803
+ tokens: t0,
1804
+ isExpired: t1,
1805
+ refresh: t2,
1806
+ revoke: t3
1807
+ }, $[0] = t0, $[1] = t1, $[2] = t2, $[3] = t3, $[4] = t4) : t4 = $[4], t4;
1808
+ }
1809
+ /**
1810
+ * A React hook that provides a client that subscribes to changes in your application,
1811
+ *
1812
+ * @remarks
1813
+ * This hook is intended for advanced use cases and special API calls that the React SDK
1814
+ * does not yet provide hooks for. We welcome you to get in touch with us to let us know
1815
+ * your use cases for this!
1816
+ *
1817
+ * @category Platform
1818
+ * @returns A Sanity client
1819
+ *
1820
+ * @example
1821
+ * ```tsx
1822
+ * function MyComponent() {
1823
+ * const client = useClient({apiVersion: '2024-11-12'})
1824
+ * const [document, setDocument] = useState(null)
1825
+ * useEffect(async () => {
1826
+ * const doc = client.fetch('*[_id == "myDocumentId"]')
1827
+ * setDocument(doc)
1828
+ * }, [])
1829
+ * return <div>{JSON.stringify(document) ?? 'Loading...'}</div>
1830
+ * }
1831
+ * ```
1832
+ *
1833
+ * @public
1834
+ * @function
1835
+ */
1836
+ const useClient = createStateSourceHook({
1757
1837
  getState: (instance, options) => {
1758
1838
  if (!options || typeof options != "object") throw Error("useClient() requires a configuration object with at least an \"apiVersion\" property. Example: useClient({ apiVersion: \"2024-11-12\" })");
1759
1839
  return getClientState(instance, options);
@@ -4049,7 +4129,7 @@ function useUsers(options) {
4049
4129
  loadMore
4050
4130
  }, $[20] = data, $[21] = hasMore, $[22] = isPending, $[23] = loadMore, $[24] = t8) : t8 = $[24], t8;
4051
4131
  }
4052
- var version = "3.5.0-next.20260922182803";
4132
+ var version = "3.5.0-next.20260922190712";
4053
4133
  function getEnv(key) {
4054
4134
  if (import.meta.env) return import.meta.env[key];
4055
4135
  if (typeof process < "u" && process.env) return process.env[key];
@@ -4060,6 +4140,6 @@ function getEnv(key) {
4060
4140
  * @internal
4061
4141
  */
4062
4142
  const REACT_SDK_VERSION = getEnv("PKG_VERSION") || `${version}-development`;
4063
- export { AuthBoundary, ComlinkTokenRefreshProvider, REACT_SDK_VERSION, ResourceProvider, SDKProvider, SDKStudioContext, SanityApp, SanityInstanceProvider, renderSanityApp, useActiveReleases, useAgentGenerate, useAgentPatch, useAgentPrompt, useAgentTransform, useAgentTranslate, useAllReleases, useApplication, useApplications, useApplyDocumentActions, useApplyReleaseActions, useAuthState, useAuthToken, useCheckPermissions, useClient, useCommentActions, useCommentThreads, useComments, useCreateDocument, useCurrentUser, useDatasets, useDeleteApplication, useDocument, useDocumentEvent, useDocumentPermissions, useDocumentPreview, useDocumentProjection, useDocumentSyncStatus, useDocuments, useEditDocument, useFavorite, useFrameConnection, useHandleAuthCallback, useInstallation, useInstallations, useLogOut, useLoginUrl, useOrganization, useOrganizations, usePaginatedDocuments, usePerspective, usePresence, usePresenceForDocument, useProject, useProjects, useQuery, useRecordDocumentHistoryEvent, useReportPresence, useResource, useSanityInstance, useStudioWorkspacesByProjectIdDataset, useUpdateApplication, useUpdateFavorite, useUser, useUsers, useVerifyOrgProjects, useWindowConnection };
4143
+ export { AuthBoundary, ComlinkTokenRefreshProvider, REACT_SDK_VERSION, ResourceProvider, SDKProvider, SDKStudioContext, SanityApp, SanityInstanceProvider, renderSanityApp, useActiveReleases, useAgentGenerate, useAgentPatch, useAgentPrompt, useAgentTransform, useAgentTranslate, useAllReleases, useApplication, useApplications, useApplyDocumentActions, useApplyReleaseActions, useAuthState, useAuthToken, useCheckPermissions, useClient, useCommentActions, useCommentThreads, useComments, useCreateDocument, useCurrentUser, useDatasets, useDeleteApplication, useDocument, useDocumentEvent, useDocumentPermissions, useDocumentPreview, useDocumentProjection, useDocumentSyncStatus, useDocuments, useEditDocument, useFavorite, useFrameConnection, useHandleAuthCallback, useHandleOAuthCallback, useInstallation, useInstallations, useLogOut, useLoginUrl, useOAuthAuthorize, useOAuthTokens, useOrganization, useOrganizations, usePaginatedDocuments, usePerspective, usePresence, usePresenceForDocument, useProject, useProjects, useQuery, useRecordDocumentHistoryEvent, useReportPresence, useResource, useSanityInstance, useStudioWorkspacesByProjectIdDataset, useUpdateApplication, useUpdateFavorite, useUser, useUsers, useVerifyOrgProjects, useWindowConnection };
4064
4144
 
4065
4145
  //# sourceMappingURL=index.js.map