autobrr/web/src/api/query_keys.ts
martylukyy 1a23b69bcf
feat(web): move from react-router to @tanstack/router (#1338)
* fix(auth): invalid cookie handling and wrongful basic auth invalidation

* fix(auth): fix test to reflect new HTTP status code

* fix(auth/web): do not throw on error

* fix(http): replace http codes in middleware to prevent basic auth invalidation
fix typo in comment

* fix test

* fix(web): api client handle 403

* refactor(http): auth_test use testify.assert

* refactor(http): set session opts after valid login

* refactor(http): send more client headers

* fix(http): test

* refactor(web): move router to tanstack/router

* refactor(web): use route loaders and suspense

* refactor(web): useSuspense for settings

* refactor(web): invalidate cookie in middleware

* fix: loclfile

* fix: load filter/id

* fix(web): login, onboard, types, imports

* fix(web): filter load

* fix(web): build errors

* fix(web): ts-expect-error

* fix(tests): filter_test.go

* fix(filters): tests

* refactor: remove duplicate spinner components
refactor: ReleaseTable.tsx loading animation
refactor: remove dedicated `pendingComponent` for `settingsRoute`

* fix: refactor missed SectionLoader to RingResizeSpinner

* fix: substitute divides with borders to account for unloaded elements

* fix(api): action status URL param

* revert: action status URL param
add comment

* fix(routing): notfound handling and split files

* fix(filters): notfound get params

* fix(queries): colon

* fix(queries): comments ts-ignore

* fix(queries): extract queryKeys

* fix(queries): remove err

* fix(routes): move zob schema inline

* fix(auth): middleware and redirect to login

* fix(auth): failing test

* fix(logs): invalidate correct key

* fix(logs): invalidate correct key

* fix(logs): invalidate correct key

* fix: JSX element stealing focus from searchbar

* reimplement empty release table state text

* fix(context): use deep-copy

* fix(releases): empty state and filter input warnings

* fix(releases): empty states

* fix(auth): onboarding

* fix(cache): invalidate queries

---------

Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
2024-02-12 13:07:00 +01:00

77 lines
No EOL
3.1 KiB
TypeScript

export const SettingsKeys = {
all: ["settings"] as const,
updates: () => [...SettingsKeys.all, "updates"] as const,
config: () => [...SettingsKeys.all, "config"] as const,
lists: () => [...SettingsKeys.all, "list"] as const,
};
export const FilterKeys = {
all: ["filters"] as const,
lists: () => [...FilterKeys.all, "list"] as const,
list: (indexers: string[], sortOrder: string) => [...FilterKeys.lists(), {indexers, sortOrder}] as const,
details: () => [...FilterKeys.all, "detail"] as const,
detail: (id: number) => [...FilterKeys.details(), id] as const
};
export const ReleaseKeys = {
all: ["releases"] as const,
lists: () => [...ReleaseKeys.all, "list"] as const,
list: (pageIndex: number, pageSize: number, filters: ReleaseFilter[]) => [...ReleaseKeys.lists(), {
pageIndex,
pageSize,
filters
}] as const,
details: () => [...ReleaseKeys.all, "detail"] as const,
detail: (id: number) => [...ReleaseKeys.details(), id] as const,
indexers: () => [...ReleaseKeys.all, "indexers"] as const,
stats: () => [...ReleaseKeys.all, "stats"] as const,
latestActivity: () => [...ReleaseKeys.all, "latest-activity"] as const,
};
export const ApiKeys = {
all: ["api_keys"] as const,
lists: () => [...ApiKeys.all, "list"] as const,
details: () => [...ApiKeys.all, "detail"] as const,
detail: (id: string) => [...ApiKeys.details(), id] as const
};
export const DownloadClientKeys = {
all: ["download_clients"] as const,
lists: () => [...DownloadClientKeys.all, "list"] as const,
// list: (indexers: string[], sortOrder: string) => [...clientKeys.lists(), { indexers, sortOrder }] as const,
details: () => [...DownloadClientKeys.all, "detail"] as const,
detail: (id: number) => [...DownloadClientKeys.details(), id] as const
};
export const FeedKeys = {
all: ["feeds"] as const,
lists: () => [...FeedKeys.all, "list"] as const,
// list: (indexers: string[], sortOrder: string) => [...feedKeys.lists(), { indexers, sortOrder }] as const,
details: () => [...FeedKeys.all, "detail"] as const,
detail: (id: number) => [...FeedKeys.details(), id] as const
};
export const IndexerKeys = {
all: ["indexers"] as const,
schema: () => [...IndexerKeys.all, "indexer-definitions"] as const,
options: () => [...IndexerKeys.all, "options"] as const,
lists: () => [...IndexerKeys.all, "list"] as const,
// list: (indexers: string[], sortOrder: string) => [...indexerKeys.lists(), { indexers, sortOrder }] as const,
details: () => [...IndexerKeys.all, "detail"] as const,
detail: (id: number) => [...IndexerKeys.details(), id] as const
};
export const IrcKeys = {
all: ["irc_networks"] as const,
lists: () => [...IrcKeys.all, "list"] as const,
// list: (indexers: string[], sortOrder: string) => [...ircKeys.lists(), { indexers, sortOrder }] as const,
details: () => [...IrcKeys.all, "detail"] as const,
detail: (id: number) => [...IrcKeys.details(), id] as const
};
export const NotificationKeys = {
all: ["notifications"] as const,
lists: () => [...NotificationKeys.all, "list"] as const,
details: () => [...NotificationKeys.all, "detail"] as const,
detail: (id: number) => [...NotificationKeys.details(), id] as const
};