mirror of
https://github.com/langgenius/dify.git
synced 2026-09-21 05:11:22 +08:00
feat: archive logs export (#38207)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -78,5 +78,9 @@ export const contractLoaders = {
|
||||
workflow: () => import('./workflow/orpc.gen').then(({ workflow }) => ({ workflow })),
|
||||
workflowGenerate: () =>
|
||||
import('./workflow-generate/orpc.gen').then(({ workflowGenerate }) => ({ workflowGenerate })),
|
||||
workflowRunArchives: () =>
|
||||
import('./workflow-run-archives/orpc.gen').then(({ workflowRunArchives }) => ({
|
||||
workflowRunArchives,
|
||||
})),
|
||||
workspaces: () => import('./workspaces/orpc.gen').then(({ workspaces }) => ({ workspaces })),
|
||||
}
|
||||
|
||||
@@ -52,6 +52,7 @@ import { trialModels } from './trial-models/orpc.gen'
|
||||
import { version } from './version/orpc.gen'
|
||||
import { website } from './website/orpc.gen'
|
||||
import { workflowGenerate } from './workflow-generate/orpc.gen'
|
||||
import { workflowRunArchives } from './workflow-run-archives/orpc.gen'
|
||||
import { workflow } from './workflow/orpc.gen'
|
||||
import { workspaces } from './workspaces/orpc.gen'
|
||||
|
||||
@@ -108,6 +109,7 @@ const communityContract = {
|
||||
website,
|
||||
workflow,
|
||||
workflowGenerate,
|
||||
workflowRunArchives,
|
||||
workspaces,
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { oc } from '@orpc/contract'
|
||||
import * as z from 'zod'
|
||||
import {
|
||||
zGetWorkflowRunArchivesDownloadsByDownloadIdPath,
|
||||
zGetWorkflowRunArchivesDownloadsByDownloadIdResponse,
|
||||
zGetWorkflowRunArchivesResponse,
|
||||
zPostWorkflowRunArchivesDownloadsBody,
|
||||
zPostWorkflowRunArchivesDownloadsResponse,
|
||||
} from './zod.gen'
|
||||
|
||||
/**
|
||||
* Get a temporary workflow-run archive download task
|
||||
*/
|
||||
export const get = oc
|
||||
.route({
|
||||
description: 'Get a temporary workflow-run archive download task',
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getWorkflowRunArchivesDownloadsByDownloadId',
|
||||
path: '/workflow-run-archives/downloads/{download_id}',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zGetWorkflowRunArchivesDownloadsByDownloadIdPath }))
|
||||
.output(zGetWorkflowRunArchivesDownloadsByDownloadIdResponse)
|
||||
|
||||
export const byDownloadId = {
|
||||
get,
|
||||
}
|
||||
|
||||
/**
|
||||
* Create or return a temporary workflow-run archive download task
|
||||
*/
|
||||
export const post = oc
|
||||
.route({
|
||||
description: 'Create or return a temporary workflow-run archive download task',
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postWorkflowRunArchivesDownloads',
|
||||
path: '/workflow-run-archives/downloads',
|
||||
successStatus: 202,
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ body: zPostWorkflowRunArchivesDownloadsBody }))
|
||||
.output(zPostWorkflowRunArchivesDownloadsResponse)
|
||||
|
||||
export const downloads = {
|
||||
post,
|
||||
byDownloadId,
|
||||
}
|
||||
|
||||
/**
|
||||
* List monthly workflow-run archive metadata for the current workspace
|
||||
*/
|
||||
export const get2 = oc
|
||||
.route({
|
||||
description: 'List monthly workflow-run archive metadata for the current workspace',
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getWorkflowRunArchives',
|
||||
path: '/workflow-run-archives',
|
||||
tags: ['console'],
|
||||
})
|
||||
.output(zGetWorkflowRunArchivesResponse)
|
||||
|
||||
export const workflowRunArchives = {
|
||||
get: get2,
|
||||
downloads,
|
||||
}
|
||||
|
||||
export const contract = {
|
||||
workflowRunArchives,
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type ClientOptions = {
|
||||
baseUrl: `${string}://${string}/console/api` | (string & {})
|
||||
}
|
||||
|
||||
export type WorkflowRunArchiveListResponse = {
|
||||
months: Array<WorkflowRunArchiveMonthResponse>
|
||||
summary: WorkflowRunArchiveSummaryResponse
|
||||
}
|
||||
|
||||
export type WorkflowRunArchiveDownloadPayload = {
|
||||
month: number
|
||||
year: number
|
||||
}
|
||||
|
||||
export type WorkflowRunArchiveDownloadTaskResponse = {
|
||||
archive_bytes: number
|
||||
bundle_count: number
|
||||
created_at: string
|
||||
download_id: string
|
||||
error?: string | null
|
||||
expires_at: string
|
||||
file_name?: string | null
|
||||
file_size_bytes?: number | null
|
||||
finished_at?: string | null
|
||||
month: number
|
||||
started_at?: string | null
|
||||
status: WorkflowRunArchiveDownloadStatus
|
||||
updated_at: string
|
||||
year: number
|
||||
}
|
||||
|
||||
export type WorkflowRunArchiveMonthResponse = {
|
||||
archive_bytes: number
|
||||
bundle_count: number
|
||||
download_task?: WorkflowRunArchiveDownloadTaskResponse | null
|
||||
latest_archived_at: string
|
||||
month: number
|
||||
row_count: number
|
||||
workflow_run_count: number
|
||||
year: number
|
||||
}
|
||||
|
||||
export type WorkflowRunArchiveSummaryResponse = {
|
||||
archive_bytes: number
|
||||
archived_month_count: number
|
||||
latest_archived_at?: string | null
|
||||
workflow_run_count: number
|
||||
}
|
||||
|
||||
export type WorkflowRunArchiveDownloadStatus = 'failed' | 'pending' | 'processing' | 'ready'
|
||||
|
||||
export type GetWorkflowRunArchivesData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/workflow-run-archives'
|
||||
}
|
||||
|
||||
export type GetWorkflowRunArchivesResponses = {
|
||||
200: WorkflowRunArchiveListResponse
|
||||
}
|
||||
|
||||
export type GetWorkflowRunArchivesResponse =
|
||||
GetWorkflowRunArchivesResponses[keyof GetWorkflowRunArchivesResponses]
|
||||
|
||||
export type PostWorkflowRunArchivesDownloadsData = {
|
||||
body: WorkflowRunArchiveDownloadPayload
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/workflow-run-archives/downloads'
|
||||
}
|
||||
|
||||
export type PostWorkflowRunArchivesDownloadsResponses = {
|
||||
202: WorkflowRunArchiveDownloadTaskResponse
|
||||
}
|
||||
|
||||
export type PostWorkflowRunArchivesDownloadsResponse =
|
||||
PostWorkflowRunArchivesDownloadsResponses[keyof PostWorkflowRunArchivesDownloadsResponses]
|
||||
|
||||
export type GetWorkflowRunArchivesDownloadsByDownloadIdData = {
|
||||
body?: never
|
||||
path: {
|
||||
download_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/workflow-run-archives/downloads/{download_id}'
|
||||
}
|
||||
|
||||
export type GetWorkflowRunArchivesDownloadsByDownloadIdResponses = {
|
||||
200: WorkflowRunArchiveDownloadTaskResponse
|
||||
}
|
||||
|
||||
export type GetWorkflowRunArchivesDownloadsByDownloadIdResponse =
|
||||
GetWorkflowRunArchivesDownloadsByDownloadIdResponses[keyof GetWorkflowRunArchivesDownloadsByDownloadIdResponses]
|
||||
@@ -0,0 +1,99 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import * as z from 'zod'
|
||||
|
||||
/**
|
||||
* WorkflowRunArchiveDownloadPayload
|
||||
*
|
||||
* Request body for preparing one monthly workflow-run archive download.
|
||||
*/
|
||||
export const zWorkflowRunArchiveDownloadPayload = z.object({
|
||||
month: z.int().gte(1).lte(12),
|
||||
year: z.int().gte(1),
|
||||
})
|
||||
|
||||
/**
|
||||
* WorkflowRunArchiveSummaryResponse
|
||||
*/
|
||||
export const zWorkflowRunArchiveSummaryResponse = z.object({
|
||||
archive_bytes: z.int(),
|
||||
archived_month_count: z.int(),
|
||||
latest_archived_at: z.iso.datetime().nullish(),
|
||||
workflow_run_count: z.int(),
|
||||
})
|
||||
|
||||
/**
|
||||
* WorkflowRunArchiveDownloadStatus
|
||||
*
|
||||
* Lifecycle state for an asynchronous archive download request.
|
||||
*/
|
||||
export const zWorkflowRunArchiveDownloadStatus = z.enum([
|
||||
'failed',
|
||||
'pending',
|
||||
'processing',
|
||||
'ready',
|
||||
])
|
||||
|
||||
/**
|
||||
* WorkflowRunArchiveDownloadTaskResponse
|
||||
*/
|
||||
export const zWorkflowRunArchiveDownloadTaskResponse = z.object({
|
||||
archive_bytes: z.int(),
|
||||
bundle_count: z.int(),
|
||||
created_at: z.iso.datetime(),
|
||||
download_id: z.string(),
|
||||
error: z.string().nullish(),
|
||||
expires_at: z.iso.datetime(),
|
||||
file_name: z.string().nullish(),
|
||||
file_size_bytes: z.int().nullish(),
|
||||
finished_at: z.iso.datetime().nullish(),
|
||||
month: z.int(),
|
||||
started_at: z.iso.datetime().nullish(),
|
||||
status: zWorkflowRunArchiveDownloadStatus,
|
||||
updated_at: z.iso.datetime(),
|
||||
year: z.int(),
|
||||
})
|
||||
|
||||
/**
|
||||
* WorkflowRunArchiveMonthResponse
|
||||
*/
|
||||
export const zWorkflowRunArchiveMonthResponse = z.object({
|
||||
archive_bytes: z.int(),
|
||||
bundle_count: z.int(),
|
||||
download_task: zWorkflowRunArchiveDownloadTaskResponse.nullish(),
|
||||
latest_archived_at: z.iso.datetime(),
|
||||
month: z.int(),
|
||||
row_count: z.int(),
|
||||
workflow_run_count: z.int(),
|
||||
year: z.int(),
|
||||
})
|
||||
|
||||
/**
|
||||
* WorkflowRunArchiveListResponse
|
||||
*/
|
||||
export const zWorkflowRunArchiveListResponse = z.object({
|
||||
months: z.array(zWorkflowRunArchiveMonthResponse),
|
||||
summary: zWorkflowRunArchiveSummaryResponse,
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zGetWorkflowRunArchivesResponse = zWorkflowRunArchiveListResponse
|
||||
|
||||
export const zPostWorkflowRunArchivesDownloadsBody = zWorkflowRunArchiveDownloadPayload
|
||||
|
||||
/**
|
||||
* Download task accepted
|
||||
*/
|
||||
export const zPostWorkflowRunArchivesDownloadsResponse = zWorkflowRunArchiveDownloadTaskResponse
|
||||
|
||||
export const zGetWorkflowRunArchivesDownloadsByDownloadIdPath = z.object({
|
||||
download_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zGetWorkflowRunArchivesDownloadsByDownloadIdResponse =
|
||||
zWorkflowRunArchiveDownloadTaskResponse
|
||||
Reference in New Issue
Block a user