mirror of
https://github.com/langgenius/dify.git
synced 2026-10-04 13:47:55 +08:00
refactor(api): isolate installed app management (#41957)
This commit is contained in:
62 files changed
+2280
-1368
No files matched your search
@@ -5,8 +5,6 @@ import * as z from 'zod'
|
||||
import {
|
||||
zDeleteInstalledAppsByInstalledAppIdConversationsByCIdPath,
|
||||
zDeleteInstalledAppsByInstalledAppIdConversationsByCIdResponse,
|
||||
zDeleteInstalledAppsByInstalledAppIdPath,
|
||||
zDeleteInstalledAppsByInstalledAppIdResponse,
|
||||
zDeleteInstalledAppsByInstalledAppIdSavedMessagesByMessageIdPath,
|
||||
zDeleteInstalledAppsByInstalledAppIdSavedMessagesByMessageIdResponse,
|
||||
zGetInstalledAppsByInstalledAppIdConversationsPath,
|
||||
@@ -38,7 +36,6 @@ import {
|
||||
zPatchInstalledAppsByInstalledAppIdConversationsByCIdUnpinResponse,
|
||||
zPatchInstalledAppsByInstalledAppIdPath,
|
||||
zPatchInstalledAppsByInstalledAppIdResponse,
|
||||
zPostInstalledAppsBody,
|
||||
zPostInstalledAppsByInstalledAppIdAudioToTextPath,
|
||||
zPostInstalledAppsByInstalledAppIdAudioToTextResponse,
|
||||
zPostInstalledAppsByInstalledAppIdChatMessagesBody,
|
||||
@@ -68,7 +65,6 @@ import {
|
||||
zPostInstalledAppsByInstalledAppIdWorkflowsRunResponse,
|
||||
zPostInstalledAppsByInstalledAppIdWorkflowsTasksByTaskIdStopPath,
|
||||
zPostInstalledAppsByInstalledAppIdWorkflowsTasksByTaskIdStopResponse,
|
||||
zPostInstalledAppsResponse,
|
||||
} from './zod.gen.ts'
|
||||
|
||||
export const post = oc
|
||||
@@ -510,18 +506,6 @@ export const workflows = {
|
||||
tasks,
|
||||
}
|
||||
|
||||
export const delete3 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'DELETE',
|
||||
operationId: 'deleteInstalledAppsByInstalledAppId',
|
||||
path: '/installed-apps/{installed_app_id}',
|
||||
successStatus: 204,
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zDeleteInstalledAppsByInstalledAppIdPath }))
|
||||
.output(zDeleteInstalledAppsByInstalledAppIdResponse)
|
||||
|
||||
export const get8 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
@@ -550,7 +534,6 @@ export const patch3 = oc
|
||||
.output(zPatchInstalledAppsByInstalledAppIdResponse)
|
||||
|
||||
export const byInstalledAppId = {
|
||||
delete: delete3,
|
||||
get: get8,
|
||||
patch: patch3,
|
||||
audioToText,
|
||||
@@ -576,20 +559,8 @@ export const get9 = oc
|
||||
.input(z.object({ query: zGetInstalledAppsQuery.optional() }))
|
||||
.output(zGetInstalledAppsResponse)
|
||||
|
||||
export const post12 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postInstalledApps',
|
||||
path: '/installed-apps',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ body: zPostInstalledAppsBody }))
|
||||
.output(zPostInstalledAppsResponse)
|
||||
|
||||
export const installedApps = {
|
||||
get: get9,
|
||||
post: post12,
|
||||
byInstalledAppId,
|
||||
}
|
||||
|
||||
|
||||
@@ -10,14 +10,6 @@ export type InstalledAppListResponse = {
|
||||
next_cursor: string | null
|
||||
}
|
||||
|
||||
export type InstalledAppCreatePayload = {
|
||||
app_id: string
|
||||
}
|
||||
|
||||
export type SimpleMessageResponse = {
|
||||
message: string
|
||||
}
|
||||
|
||||
export type InstalledAppResponse = {
|
||||
app: InstalledAppInfoResponse
|
||||
app_owner_tenant_id: string
|
||||
@@ -25,7 +17,6 @@ export type InstalledAppResponse = {
|
||||
id: string
|
||||
is_pinned: boolean
|
||||
last_used_at: number | null
|
||||
uninstallable: boolean
|
||||
}
|
||||
|
||||
export type InstalledAppUpdatePayload = {
|
||||
@@ -768,7 +759,6 @@ export type InstalledAppResponseWritable = {
|
||||
id: string
|
||||
is_pinned: boolean
|
||||
last_used_at: number | null
|
||||
uninstallable: boolean
|
||||
}
|
||||
|
||||
export type ExploreMessageInfiniteScrollPaginationWritable = {
|
||||
@@ -831,35 +821,6 @@ export type GetInstalledAppsResponses = {
|
||||
|
||||
export type GetInstalledAppsResponse = GetInstalledAppsResponses[keyof GetInstalledAppsResponses]
|
||||
|
||||
export type PostInstalledAppsData = {
|
||||
body: InstalledAppCreatePayload
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/installed-apps'
|
||||
}
|
||||
|
||||
export type PostInstalledAppsResponses = {
|
||||
200: SimpleMessageResponse
|
||||
}
|
||||
|
||||
export type PostInstalledAppsResponse = PostInstalledAppsResponses[keyof PostInstalledAppsResponses]
|
||||
|
||||
export type DeleteInstalledAppsByInstalledAppIdData = {
|
||||
body?: never
|
||||
path: {
|
||||
installed_app_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/installed-apps/{installed_app_id}'
|
||||
}
|
||||
|
||||
export type DeleteInstalledAppsByInstalledAppIdResponses = {
|
||||
204: void
|
||||
}
|
||||
|
||||
export type DeleteInstalledAppsByInstalledAppIdResponse =
|
||||
DeleteInstalledAppsByInstalledAppIdResponses[keyof DeleteInstalledAppsByInstalledAppIdResponses]
|
||||
|
||||
export type GetInstalledAppsByInstalledAppIdData = {
|
||||
body?: never
|
||||
path: {
|
||||
|
||||
@@ -2,20 +2,6 @@
|
||||
|
||||
import * as z from 'zod'
|
||||
|
||||
/**
|
||||
* InstalledAppCreatePayload
|
||||
*/
|
||||
export const zInstalledAppCreatePayload = z.object({
|
||||
app_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* SimpleMessageResponse
|
||||
*/
|
||||
export const zSimpleMessageResponse = z.object({
|
||||
message: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* InstalledAppUpdatePayload
|
||||
*/
|
||||
@@ -619,7 +605,6 @@ export const zInstalledAppResponse = z.object({
|
||||
id: z.string(),
|
||||
is_pinned: z.boolean(),
|
||||
last_used_at: z.int().nullable(),
|
||||
uninstallable: z.boolean(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -941,7 +926,6 @@ export const zInstalledAppResponseWritable = z.object({
|
||||
id: z.string(),
|
||||
is_pinned: z.boolean(),
|
||||
last_used_at: z.int().nullable(),
|
||||
uninstallable: z.boolean(),
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -1003,22 +987,6 @@ export const zGetInstalledAppsQuery = z.object({
|
||||
*/
|
||||
export const zGetInstalledAppsResponse = zInstalledAppListResponse
|
||||
|
||||
export const zPostInstalledAppsBody = zInstalledAppCreatePayload
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zPostInstalledAppsResponse = zSimpleMessageResponse
|
||||
|
||||
export const zDeleteInstalledAppsByInstalledAppIdPath = z.object({
|
||||
installed_app_id: z.uuid(),
|
||||
})
|
||||
|
||||
/**
|
||||
* App uninstalled successfully
|
||||
*/
|
||||
export const zDeleteInstalledAppsByInstalledAppIdResponse = z.void()
|
||||
|
||||
export const zGetInstalledAppsByInstalledAppIdPath = z.object({
|
||||
installed_app_id: z.uuid(),
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user