mirror of
https://github.com/langgenius/dify.git
synced 2026-05-13 08:57:28 +08:00
16 lines
805 B
TypeScript
16 lines
805 B
TypeScript
import type { ListAppDeploymentsQuery } from '../data'
|
|
import type { DeploymentsStore } from './actions'
|
|
import { emptySourceAppsList, sourceAppsListKey } from './source-apps'
|
|
|
|
export const deploymentsSelectors = {
|
|
appData: (appId?: string) => (state: DeploymentsStore) =>
|
|
appId ? state.appData[appId] : undefined,
|
|
createdApiToken: (state: DeploymentsStore) => state.createdApiToken,
|
|
instance: (appId?: string) => (state: DeploymentsStore) =>
|
|
appId ? state.instancesById[appId] : undefined,
|
|
instancesById: (state: DeploymentsStore) => state.instancesById,
|
|
listRefreshToken: (state: DeploymentsStore) => state.listRefreshToken,
|
|
sourceAppsList: (query: ListAppDeploymentsQuery) => (state: DeploymentsStore) =>
|
|
state.sourceAppLists[sourceAppsListKey(query)] ?? emptySourceAppsList,
|
|
}
|