mirror of
https://github.com/supabase/supabase.git
synced 2026-12-05 16:09:06 +00:00
## Description Part of the work for OAuth apps with the scoped permissions. This PR: - Update the mock data to the new format returned or expected by the backend - Remove unnecessary hooks that have their feature merged in another one (`useOAuthOrgAppDetailsQuery` is now merged in `useOAuthAppsPreflightValidationQuery`) > [!NOTE] > At this stage, the UI still only use mock data ## Review instructions If all tests pass, we're good.
30 lines
1.5 KiB
TypeScript
30 lines
1.5 KiB
TypeScript
export const oauthAppsKeys = {
|
|
authorizeRequest: (id: string | undefined) => ['oauth-apps', 'authorize', id] as const,
|
|
authorizeOrganizations: (id: string | undefined) =>
|
|
['oauth-apps', 'authorize', id, 'organizations'] as const,
|
|
authorizeOrganizationProjects: (
|
|
slug: string | undefined | null,
|
|
params?: {
|
|
sort?: 'name_asc' | 'name_desc' | 'created_asc' | 'created_desc'
|
|
search?: string
|
|
statuses?: string[]
|
|
}
|
|
) => ['oauth-apps', 'authorize', 'organizations', slug, 'projects', params] as const,
|
|
preflightValidation: (slug: string | undefined, appId: string | undefined) =>
|
|
['oauth-apps', 'organizations', slug, 'apps', appId, 'preflight-validation'] as const,
|
|
// cursor omitted (rather than passed as `undefined`) so the cursor-less key is a true prefix
|
|
// of every paginated key — invalidating without a cursor clears every cached page.
|
|
approvals: (slug: string | undefined, cursor?: string) =>
|
|
cursor === undefined
|
|
? (['oauth-apps', 'approvals', slug] as const)
|
|
: (['oauth-apps', 'approvals', slug, cursor] as const),
|
|
appMemberGrants: (slug: string | undefined, appId: string | undefined, cursor?: string) =>
|
|
cursor === undefined
|
|
? (['oauth-apps', 'authorized', slug, appId, 'member-grants'] as const)
|
|
: (['oauth-apps', 'authorized', slug, appId, 'member-grants', cursor] as const),
|
|
grants: (cursor?: string) =>
|
|
cursor === undefined
|
|
? (['oauth-apps', 'grants'] as const)
|
|
: (['oauth-apps', 'grants', cursor] as const),
|
|
}
|