chore: 纳入本地 Dify 1.19.0 源码及品牌与免登改动
演示目录只保留可重建的源码。运行密钥、数据卷、依赖和带口令的本地配置不进入仓库。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
60158935f4
commit
6519682885
15831 files changed
+3063428
No files matched your search
+290
@@ -0,0 +1,290 @@
|
||||
// This file is auto-generated by scripts/add-orpc-error-maps.ts
|
||||
import * as z from 'zod'
|
||||
|
||||
const zErrorResponse = /* @__PURE__ */ (() =>
|
||||
z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
}))()
|
||||
|
||||
const zAccountNotFoundError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('account_not_found'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zInvalidEmailError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invalid_email'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zInvalidOrExpiredTokenError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invalid_or_expired_token'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zEmailChangeRateLimitExceededError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_change_rate_limit_exceeded'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zEmailSendIpLimitError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_send_ip_limit'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zAccountInFreezeError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('account_in_freeze'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zEmailAlreadyInUseError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_already_in_use'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zEmailDomainSuspendedError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_domain_suspended'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zEmailCodeError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_code_error'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zEmailChangeLimitError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_change_limit'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zInvalidAccountDeletionCodeError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invalid_account_deletion_code'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zEmailCodeAccountDeletionRateLimitExceededError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_code_account_deletion_rate_limit_exceeded'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zBillingRequestInProgressError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('billing_request_in_progress'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zBillingOperationFailedError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('billing_operation_failed'),
|
||||
status: z.literal(502),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zBillingUnavailableError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('billing_unavailable'),
|
||||
status: z.literal(503),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zEducationActivateFailedError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('education_activate_failed'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zEducationActivateLimitError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('education_activate_limit'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zEducationVerifyFailedError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('education_verify_failed'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zEducationVerifyLimitError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('education_verify_limit'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zAccountAlreadyInitedError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('account_already_inited'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zInvalidInvitationCodeError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invalid_invitation_code'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zMissingInvitationCodeError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('missing_invitation_code'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zCurrentPasswordIncorrectError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('current_password_incorrect'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zInvalidAccountPasswordError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invalid_account_password'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
export const postErrors = {
|
||||
account_in_freeze: { status: 400, data: zAccountInFreezeError },
|
||||
email_already_in_use: { status: 400, data: zEmailAlreadyInUseError },
|
||||
email_domain_suspended: { status: 400, data: zEmailDomainSuspendedError },
|
||||
}
|
||||
|
||||
export const post2Errors = {
|
||||
account_in_freeze: { status: 400, data: zAccountInFreezeError },
|
||||
account_not_found: { status: 400, data: zAccountNotFoundError },
|
||||
email_already_in_use: { status: 400, data: zEmailAlreadyInUseError },
|
||||
email_domain_suspended: { status: 400, data: zEmailDomainSuspendedError },
|
||||
invalid_or_expired_token: { status: 400, data: zInvalidOrExpiredTokenError },
|
||||
}
|
||||
|
||||
export const post3Errors = {
|
||||
email_change_limit: { status: 429, data: zEmailChangeLimitError },
|
||||
email_code_error: { status: 400, data: zEmailCodeError },
|
||||
invalid_email: { status: 400, data: zInvalidEmailError },
|
||||
invalid_or_expired_token: { status: 400, data: zInvalidOrExpiredTokenError },
|
||||
}
|
||||
|
||||
export const post4Errors = {
|
||||
account_not_found: { status: 400, data: zAccountNotFoundError },
|
||||
email_change_rate_limit_exceeded: { status: 429, data: zEmailChangeRateLimitExceededError },
|
||||
email_send_ip_limit: { status: 429, data: zEmailSendIpLimitError },
|
||||
invalid_email: { status: 400, data: zInvalidEmailError },
|
||||
invalid_or_expired_token: { status: 400, data: zInvalidOrExpiredTokenError },
|
||||
}
|
||||
|
||||
export const get2Errors = {
|
||||
account_not_found: { status: 400, data: zAccountNotFoundError },
|
||||
email_code_account_deletion_rate_limit_exceeded: {
|
||||
status: 429,
|
||||
data: zEmailCodeAccountDeletionRateLimitExceededError,
|
||||
},
|
||||
}
|
||||
|
||||
export const post6Errors = {
|
||||
invalid_account_deletion_code: { status: 400, data: zInvalidAccountDeletionCodeError },
|
||||
}
|
||||
|
||||
export const get3Errors = {
|
||||
billing_operation_failed: { status: 502, data: zBillingOperationFailedError },
|
||||
billing_unavailable: { status: 503, data: zBillingUnavailableError },
|
||||
}
|
||||
|
||||
export const get4Errors = {
|
||||
account_not_found: { status: 400, data: zAccountNotFoundError },
|
||||
billing_operation_failed: { status: 502, data: zBillingOperationFailedError },
|
||||
billing_request_in_progress: { status: 429, data: zBillingRequestInProgressError },
|
||||
billing_unavailable: { status: 503, data: zBillingUnavailableError },
|
||||
education_verify_failed: { status: 400, data: zEducationVerifyFailedError },
|
||||
education_verify_limit: { status: 429, data: zEducationVerifyLimitError },
|
||||
}
|
||||
|
||||
export const get5Errors = {
|
||||
billing_operation_failed: { status: 502, data: zBillingOperationFailedError },
|
||||
billing_request_in_progress: { status: 429, data: zBillingRequestInProgressError },
|
||||
billing_unavailable: { status: 503, data: zBillingUnavailableError },
|
||||
}
|
||||
|
||||
export const post7Errors = {
|
||||
account_not_found: { status: 400, data: zAccountNotFoundError },
|
||||
billing_operation_failed: { status: 502, data: zBillingOperationFailedError },
|
||||
billing_request_in_progress: { status: 429, data: zBillingRequestInProgressError },
|
||||
billing_unavailable: { status: 503, data: zBillingUnavailableError },
|
||||
education_activate_failed: { status: 400, data: zEducationActivateFailedError },
|
||||
education_activate_limit: { status: 429, data: zEducationActivateLimitError },
|
||||
}
|
||||
|
||||
export const post8Errors = {
|
||||
account_already_inited: { status: 400, data: zAccountAlreadyInitedError },
|
||||
account_not_found: { status: 400, data: zAccountNotFoundError },
|
||||
invalid_invitation_code: { status: 400, data: zInvalidInvitationCodeError },
|
||||
missing_invitation_code: { status: 400, data: zMissingInvitationCodeError },
|
||||
}
|
||||
|
||||
export const post9Errors = {
|
||||
account_not_found: { status: 400, data: zAccountNotFoundError },
|
||||
current_password_incorrect: { status: 400, data: zCurrentPasswordIncorrectError },
|
||||
invalid_account_password: { status: 400, data: zInvalidAccountPasswordError },
|
||||
}
|
||||
|
||||
export const get7Errors = { account_not_found: { status: 400, data: zAccountNotFoundError } }
|
||||
|
||||
export const patchErrors = { account_not_found: { status: 400, data: zAccountNotFoundError } }
|
||||
+404
@@ -0,0 +1,404 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { oc } from '@orpc/contract'
|
||||
import * as z from 'zod'
|
||||
import {
|
||||
zAccountAlreadyInitedError,
|
||||
zAccountInFreezeError,
|
||||
zAccountNotFoundError,
|
||||
zBillingOperationFailedError,
|
||||
zBillingRequestInProgressError,
|
||||
zBillingUnavailableError,
|
||||
zCurrentPasswordIncorrectError,
|
||||
zEducationActivateFailedError,
|
||||
zEducationActivateLimitError,
|
||||
zEducationVerifyFailedError,
|
||||
zEducationVerifyLimitError,
|
||||
zEmailAlreadyInUseError,
|
||||
zEmailChangeLimitError,
|
||||
zEmailChangeRateLimitExceededError,
|
||||
zEmailCodeAccountDeletionRateLimitExceededError,
|
||||
zEmailCodeError,
|
||||
zEmailDomainSuspendedError,
|
||||
zEmailSendIpLimitError,
|
||||
zInvalidAccountDeletionCodeError,
|
||||
zInvalidAccountPasswordError,
|
||||
zInvalidEmailError,
|
||||
zInvalidInvitationCodeError,
|
||||
zInvalidOrExpiredTokenError,
|
||||
zMissingInvitationCodeError,
|
||||
} from './zod.gen.ts'
|
||||
import {
|
||||
zGetAccountAvatarQuery,
|
||||
zGetAccountAvatarResponse,
|
||||
zGetAccountDeleteVerifyResponse,
|
||||
zGetAccountEducationAutocompleteQuery,
|
||||
zGetAccountEducationAutocompleteResponse,
|
||||
zGetAccountEducationResponse,
|
||||
zGetAccountEducationVerifyResponse,
|
||||
zGetAccountIntegratesResponse,
|
||||
zGetAccountProfileResponse,
|
||||
zPatchAccountProfileBody,
|
||||
zPatchAccountProfileResponse,
|
||||
zPostAccountChangeEmailBody,
|
||||
zPostAccountChangeEmailCheckEmailUniqueBody,
|
||||
zPostAccountChangeEmailCheckEmailUniqueResponse,
|
||||
zPostAccountChangeEmailResetBody,
|
||||
zPostAccountChangeEmailResetResponse,
|
||||
zPostAccountChangeEmailResponse,
|
||||
zPostAccountChangeEmailValidityBody,
|
||||
zPostAccountChangeEmailValidityResponse,
|
||||
zPostAccountDeleteBody,
|
||||
zPostAccountDeleteFeedbackBody,
|
||||
zPostAccountDeleteFeedbackResponse,
|
||||
zPostAccountDeleteResponse,
|
||||
zPostAccountEducationBody,
|
||||
zPostAccountEducationResponse,
|
||||
zPostAccountInitBody,
|
||||
zPostAccountInitResponse,
|
||||
zPostAccountPasswordBody,
|
||||
zPostAccountPasswordResponse,
|
||||
} from './zod.gen.ts'
|
||||
|
||||
/**
|
||||
* Get account avatar url
|
||||
*/
|
||||
export const get = oc
|
||||
.route({
|
||||
description: 'Get account avatar url',
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getAccountAvatar',
|
||||
path: '/account/avatar',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ query: zGetAccountAvatarQuery }))
|
||||
.output(zGetAccountAvatarResponse)
|
||||
|
||||
export const avatar = {
|
||||
get,
|
||||
}
|
||||
|
||||
export const post = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postAccountChangeEmailCheckEmailUnique',
|
||||
path: '/account/change-email/check-email-unique',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ body: zPostAccountChangeEmailCheckEmailUniqueBody }))
|
||||
.output(zPostAccountChangeEmailCheckEmailUniqueResponse)
|
||||
.errors({
|
||||
account_in_freeze: { status: 400, data: zAccountInFreezeError },
|
||||
email_already_in_use: { status: 400, data: zEmailAlreadyInUseError },
|
||||
email_domain_suspended: { status: 400, data: zEmailDomainSuspendedError },
|
||||
})
|
||||
|
||||
export const checkEmailUnique = {
|
||||
post,
|
||||
}
|
||||
|
||||
export const post2 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postAccountChangeEmailReset',
|
||||
path: '/account/change-email/reset',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ body: zPostAccountChangeEmailResetBody }))
|
||||
.output(zPostAccountChangeEmailResetResponse)
|
||||
.errors({
|
||||
account_in_freeze: { status: 400, data: zAccountInFreezeError },
|
||||
account_not_found: { status: 400, data: zAccountNotFoundError },
|
||||
email_already_in_use: { status: 400, data: zEmailAlreadyInUseError },
|
||||
email_domain_suspended: { status: 400, data: zEmailDomainSuspendedError },
|
||||
invalid_or_expired_token: { status: 400, data: zInvalidOrExpiredTokenError },
|
||||
})
|
||||
|
||||
export const reset = {
|
||||
post: post2,
|
||||
}
|
||||
|
||||
export const post3 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postAccountChangeEmailValidity',
|
||||
path: '/account/change-email/validity',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ body: zPostAccountChangeEmailValidityBody }))
|
||||
.output(zPostAccountChangeEmailValidityResponse)
|
||||
.errors({
|
||||
email_change_limit: { status: 429, data: zEmailChangeLimitError },
|
||||
email_code_error: { status: 400, data: zEmailCodeError },
|
||||
invalid_email: { status: 400, data: zInvalidEmailError },
|
||||
invalid_or_expired_token: { status: 400, data: zInvalidOrExpiredTokenError },
|
||||
})
|
||||
|
||||
export const validity = {
|
||||
post: post3,
|
||||
}
|
||||
|
||||
export const post4 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postAccountChangeEmail',
|
||||
path: '/account/change-email',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ body: zPostAccountChangeEmailBody }))
|
||||
.output(zPostAccountChangeEmailResponse)
|
||||
.errors({
|
||||
account_not_found: { status: 400, data: zAccountNotFoundError },
|
||||
email_change_rate_limit_exceeded: { status: 429, data: zEmailChangeRateLimitExceededError },
|
||||
email_send_ip_limit: { status: 429, data: zEmailSendIpLimitError },
|
||||
invalid_email: { status: 400, data: zInvalidEmailError },
|
||||
invalid_or_expired_token: { status: 400, data: zInvalidOrExpiredTokenError },
|
||||
})
|
||||
|
||||
export const changeEmail = {
|
||||
post: post4,
|
||||
checkEmailUnique,
|
||||
reset,
|
||||
validity,
|
||||
}
|
||||
|
||||
export const post5 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postAccountDeleteFeedback',
|
||||
path: '/account/delete/feedback',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ body: zPostAccountDeleteFeedbackBody }))
|
||||
.output(zPostAccountDeleteFeedbackResponse)
|
||||
|
||||
export const feedback = {
|
||||
post: post5,
|
||||
}
|
||||
|
||||
export const get2 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getAccountDeleteVerify',
|
||||
path: '/account/delete/verify',
|
||||
tags: ['console'],
|
||||
})
|
||||
.output(zGetAccountDeleteVerifyResponse)
|
||||
.errors({
|
||||
account_not_found: { status: 400, data: zAccountNotFoundError },
|
||||
email_code_account_deletion_rate_limit_exceeded: {
|
||||
status: 429,
|
||||
data: zEmailCodeAccountDeletionRateLimitExceededError,
|
||||
},
|
||||
})
|
||||
|
||||
export const verify = {
|
||||
get: get2,
|
||||
}
|
||||
|
||||
export const post6 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postAccountDelete',
|
||||
path: '/account/delete',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ body: zPostAccountDeleteBody }))
|
||||
.output(zPostAccountDeleteResponse)
|
||||
.errors({
|
||||
invalid_account_deletion_code: { status: 400, data: zInvalidAccountDeletionCodeError },
|
||||
})
|
||||
|
||||
export const delete_ = {
|
||||
post: post6,
|
||||
feedback,
|
||||
verify,
|
||||
}
|
||||
|
||||
export const get3 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getAccountEducationAutocomplete',
|
||||
path: '/account/education/autocomplete',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ query: zGetAccountEducationAutocompleteQuery }))
|
||||
.output(zGetAccountEducationAutocompleteResponse)
|
||||
.errors({
|
||||
billing_operation_failed: { status: 502, data: zBillingOperationFailedError },
|
||||
billing_unavailable: { status: 503, data: zBillingUnavailableError },
|
||||
})
|
||||
|
||||
export const autocomplete = {
|
||||
get: get3,
|
||||
}
|
||||
|
||||
export const get4 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getAccountEducationVerify',
|
||||
path: '/account/education/verify',
|
||||
tags: ['console'],
|
||||
})
|
||||
.output(zGetAccountEducationVerifyResponse)
|
||||
.errors({
|
||||
account_not_found: { status: 400, data: zAccountNotFoundError },
|
||||
billing_operation_failed: { status: 502, data: zBillingOperationFailedError },
|
||||
billing_request_in_progress: { status: 429, data: zBillingRequestInProgressError },
|
||||
billing_unavailable: { status: 503, data: zBillingUnavailableError },
|
||||
education_verify_failed: { status: 400, data: zEducationVerifyFailedError },
|
||||
education_verify_limit: { status: 429, data: zEducationVerifyLimitError },
|
||||
})
|
||||
|
||||
export const verify2 = {
|
||||
get: get4,
|
||||
}
|
||||
|
||||
export const get5 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getAccountEducation',
|
||||
path: '/account/education',
|
||||
tags: ['console'],
|
||||
})
|
||||
.output(zGetAccountEducationResponse)
|
||||
.errors({
|
||||
billing_operation_failed: { status: 502, data: zBillingOperationFailedError },
|
||||
billing_request_in_progress: { status: 429, data: zBillingRequestInProgressError },
|
||||
billing_unavailable: { status: 503, data: zBillingUnavailableError },
|
||||
})
|
||||
|
||||
export const post7 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postAccountEducation',
|
||||
path: '/account/education',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ body: zPostAccountEducationBody }))
|
||||
.output(zPostAccountEducationResponse)
|
||||
.errors({
|
||||
account_not_found: { status: 400, data: zAccountNotFoundError },
|
||||
billing_operation_failed: { status: 502, data: zBillingOperationFailedError },
|
||||
billing_request_in_progress: { status: 429, data: zBillingRequestInProgressError },
|
||||
billing_unavailable: { status: 503, data: zBillingUnavailableError },
|
||||
education_activate_failed: { status: 400, data: zEducationActivateFailedError },
|
||||
education_activate_limit: { status: 429, data: zEducationActivateLimitError },
|
||||
})
|
||||
|
||||
export const education = {
|
||||
get: get5,
|
||||
post: post7,
|
||||
autocomplete,
|
||||
verify: verify2,
|
||||
}
|
||||
|
||||
export const post8 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postAccountInit',
|
||||
path: '/account/init',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ body: zPostAccountInitBody }))
|
||||
.output(zPostAccountInitResponse)
|
||||
.errors({
|
||||
account_already_inited: { status: 400, data: zAccountAlreadyInitedError },
|
||||
account_not_found: { status: 400, data: zAccountNotFoundError },
|
||||
invalid_invitation_code: { status: 400, data: zInvalidInvitationCodeError },
|
||||
missing_invitation_code: { status: 400, data: zMissingInvitationCodeError },
|
||||
})
|
||||
|
||||
export const init = {
|
||||
post: post8,
|
||||
}
|
||||
|
||||
export const get6 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getAccountIntegrates',
|
||||
path: '/account/integrates',
|
||||
tags: ['console'],
|
||||
})
|
||||
.output(zGetAccountIntegratesResponse)
|
||||
|
||||
export const integrates = {
|
||||
get: get6,
|
||||
}
|
||||
|
||||
export const post9 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postAccountPassword',
|
||||
path: '/account/password',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ body: zPostAccountPasswordBody }))
|
||||
.output(zPostAccountPasswordResponse)
|
||||
.errors({
|
||||
account_not_found: { status: 400, data: zAccountNotFoundError },
|
||||
current_password_incorrect: { status: 400, data: zCurrentPasswordIncorrectError },
|
||||
invalid_account_password: { status: 400, data: zInvalidAccountPasswordError },
|
||||
})
|
||||
|
||||
export const password = {
|
||||
post: post9,
|
||||
}
|
||||
|
||||
export const get7 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getAccountProfile',
|
||||
path: '/account/profile',
|
||||
tags: ['console'],
|
||||
})
|
||||
.output(zGetAccountProfileResponse)
|
||||
.errors({ account_not_found: { status: 400, data: zAccountNotFoundError } })
|
||||
|
||||
export const patch = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'PATCH',
|
||||
operationId: 'patchAccountProfile',
|
||||
path: '/account/profile',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ body: zPatchAccountProfileBody }))
|
||||
.output(zPatchAccountProfileResponse)
|
||||
.errors({ account_not_found: { status: 400, data: zAccountNotFoundError } })
|
||||
|
||||
export const profile = {
|
||||
get: get7,
|
||||
patch,
|
||||
}
|
||||
|
||||
export const account = {
|
||||
avatar,
|
||||
changeEmail,
|
||||
delete: delete_,
|
||||
education,
|
||||
init,
|
||||
integrates,
|
||||
password,
|
||||
profile,
|
||||
}
|
||||
|
||||
export const contract = {
|
||||
account,
|
||||
}
|
||||
+677
@@ -0,0 +1,677 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type ClientOptions = {
|
||||
baseUrl: `${string}://${string}/console/api` | (string & {})
|
||||
}
|
||||
|
||||
export type AvatarUrlResponse = {
|
||||
avatar_url: string
|
||||
}
|
||||
|
||||
export type ErrorResponse = {
|
||||
code: string
|
||||
details?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
message: string
|
||||
params?: string
|
||||
status: number
|
||||
}
|
||||
|
||||
export type ChangeEmailSendPayload = {
|
||||
email: string
|
||||
language?: string | null
|
||||
phase?: string | null
|
||||
token?: string | null
|
||||
}
|
||||
|
||||
export type SimpleResultDataResponse = {
|
||||
data: string
|
||||
result: string
|
||||
}
|
||||
|
||||
export type AccountNotFoundError = ErrorResponse & {
|
||||
code: 'account_not_found'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type InvalidEmailError = ErrorResponse & {
|
||||
code: 'invalid_email'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type InvalidOrExpiredTokenError = ErrorResponse & {
|
||||
code: 'invalid_or_expired_token'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type EmailChangeRateLimitExceededError = ErrorResponse & {
|
||||
code: 'email_change_rate_limit_exceeded'
|
||||
status: 429
|
||||
}
|
||||
|
||||
export type EmailSendIpLimitError = ErrorResponse & {
|
||||
code: 'email_send_ip_limit'
|
||||
status: 429
|
||||
}
|
||||
|
||||
export type CheckEmailUniquePayload = {
|
||||
email: string
|
||||
}
|
||||
|
||||
export type SimpleResultResponse = {
|
||||
result: string
|
||||
}
|
||||
|
||||
export type AccountInFreezeError = ErrorResponse & {
|
||||
code: 'account_in_freeze'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type EmailAlreadyInUseError = ErrorResponse & {
|
||||
code: 'email_already_in_use'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type EmailDomainSuspendedError = ErrorResponse & {
|
||||
code: 'email_domain_suspended'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type ChangeEmailResetPayload = {
|
||||
new_email: string
|
||||
token: string
|
||||
}
|
||||
|
||||
export type AccountResponse = {
|
||||
avatar?: string | null
|
||||
readonly avatar_url: string | null
|
||||
created_at?: number | null
|
||||
email: string
|
||||
id: string
|
||||
interface_language?: string | null
|
||||
interface_theme?: string | null
|
||||
is_password_set: boolean
|
||||
last_login_at?: number | null
|
||||
last_login_ip?: string | null
|
||||
name: string
|
||||
timezone?: string | null
|
||||
}
|
||||
|
||||
export type ChangeEmailValidityPayload = {
|
||||
code: string
|
||||
email: string
|
||||
token: string
|
||||
}
|
||||
|
||||
export type VerificationTokenResponse = {
|
||||
email: string
|
||||
is_valid: boolean
|
||||
token: string
|
||||
}
|
||||
|
||||
export type EmailCodeError = ErrorResponse & {
|
||||
code: 'email_code_error'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type EmailChangeLimitError = ErrorResponse & {
|
||||
code: 'email_change_limit'
|
||||
status: 429
|
||||
}
|
||||
|
||||
export type AccountDeletePayload = {
|
||||
code: string
|
||||
token: string
|
||||
}
|
||||
|
||||
export type InvalidAccountDeletionCodeError = ErrorResponse & {
|
||||
code: 'invalid_account_deletion_code'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type AccountDeletionFeedbackPayload = {
|
||||
email: string
|
||||
feedback: string
|
||||
}
|
||||
|
||||
export type EmailCodeAccountDeletionRateLimitExceededError = ErrorResponse & {
|
||||
code: 'email_code_account_deletion_rate_limit_exceeded'
|
||||
status: 429
|
||||
}
|
||||
|
||||
export type EducationStatusResponse = {
|
||||
allow_refresh: boolean
|
||||
expire_at: number | null
|
||||
is_student: boolean
|
||||
result: boolean
|
||||
}
|
||||
|
||||
export type BillingRequestInProgressError = ErrorResponse & {
|
||||
code: 'billing_request_in_progress'
|
||||
status: 429
|
||||
}
|
||||
|
||||
export type BillingOperationFailedError = ErrorResponse & {
|
||||
code: 'billing_operation_failed'
|
||||
status: 502
|
||||
}
|
||||
|
||||
export type BillingUnavailableError = ErrorResponse & {
|
||||
code: 'billing_unavailable'
|
||||
status: 503
|
||||
}
|
||||
|
||||
export type EducationActivatePayload = {
|
||||
institution: string
|
||||
role: string
|
||||
token: string
|
||||
}
|
||||
|
||||
export type EducationActivateResponse = {
|
||||
message: string
|
||||
}
|
||||
|
||||
export type EducationActivateFailedError = ErrorResponse & {
|
||||
code: 'education_activate_failed'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type EducationActivateLimitError = ErrorResponse & {
|
||||
code: 'education_activate_limit'
|
||||
status: 429
|
||||
}
|
||||
|
||||
export type EducationAutocompleteResponse = {
|
||||
curr_page: number
|
||||
data: Array<string>
|
||||
has_next: boolean
|
||||
}
|
||||
|
||||
export type EducationVerifyResponse =
|
||||
| ({
|
||||
status: 'eligible'
|
||||
} & EducationVerifyEligibleResponse)
|
||||
| ({
|
||||
status: 'not_eligible'
|
||||
} & EducationVerifyNotEligibleResponse)
|
||||
|
||||
export type EducationVerifyFailedError = ErrorResponse & {
|
||||
code: 'education_verify_failed'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type EducationVerifyLimitError = ErrorResponse & {
|
||||
code: 'education_verify_limit'
|
||||
status: 429
|
||||
}
|
||||
|
||||
export type AccountInitPayload = {
|
||||
interface_language: string
|
||||
invitation_code?: string | null
|
||||
timezone: string
|
||||
}
|
||||
|
||||
export type AccountAlreadyInitedError = ErrorResponse & {
|
||||
code: 'account_already_inited'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type InvalidInvitationCodeError = ErrorResponse & {
|
||||
code: 'invalid_invitation_code'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type MissingInvitationCodeError = ErrorResponse & {
|
||||
code: 'missing_invitation_code'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type AccountIntegrateListResponse = {
|
||||
data: Array<AccountIntegrateResponse>
|
||||
}
|
||||
|
||||
export type AccountPasswordPayload = {
|
||||
new_password: string
|
||||
password?: string | null
|
||||
repeat_new_password: string
|
||||
}
|
||||
|
||||
export type CurrentPasswordIncorrectError = ErrorResponse & {
|
||||
code: 'current_password_incorrect'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type InvalidAccountPasswordError = ErrorResponse & {
|
||||
code: 'invalid_account_password'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type AccountProfilePatchPayload = {
|
||||
avatar?: string
|
||||
interface_language?: string
|
||||
interface_theme?: 'dark' | 'light'
|
||||
name?: string
|
||||
timezone?: string
|
||||
}
|
||||
|
||||
export type EducationVerifyEligibleResponse = {
|
||||
status: 'eligible'
|
||||
token: string
|
||||
}
|
||||
|
||||
export type EducationVerifyNotEligibleResponse = {
|
||||
status: 'not_eligible'
|
||||
}
|
||||
|
||||
export type AccountIntegrateResponse = {
|
||||
created_at?: number | null
|
||||
is_bound: boolean
|
||||
link?: string | null
|
||||
provider: string
|
||||
}
|
||||
|
||||
export type AccountResponseWritable = {
|
||||
avatar?: string | null
|
||||
created_at?: number | null
|
||||
email: string
|
||||
id: string
|
||||
interface_language?: string | null
|
||||
interface_theme?: string | null
|
||||
is_password_set: boolean
|
||||
last_login_at?: number | null
|
||||
last_login_ip?: string | null
|
||||
name: string
|
||||
timezone?: string | null
|
||||
}
|
||||
|
||||
export type GetAccountAvatarData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query: {
|
||||
avatar: string
|
||||
}
|
||||
url: '/account/avatar'
|
||||
}
|
||||
|
||||
export type GetAccountAvatarErrors = {
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type GetAccountAvatarError = GetAccountAvatarErrors[keyof GetAccountAvatarErrors]
|
||||
|
||||
export type GetAccountAvatarResponses = {
|
||||
200: AvatarUrlResponse
|
||||
}
|
||||
|
||||
export type GetAccountAvatarResponse = GetAccountAvatarResponses[keyof GetAccountAvatarResponses]
|
||||
|
||||
export type PostAccountChangeEmailData = {
|
||||
body: ChangeEmailSendPayload
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/account/change-email'
|
||||
}
|
||||
|
||||
export type PostAccountChangeEmailErrors = {
|
||||
400: AccountNotFoundError | InvalidEmailError | InvalidOrExpiredTokenError | ErrorResponse
|
||||
429: EmailChangeRateLimitExceededError | EmailSendIpLimitError | ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type PostAccountChangeEmailError =
|
||||
PostAccountChangeEmailErrors[keyof PostAccountChangeEmailErrors]
|
||||
|
||||
export type PostAccountChangeEmailResponses = {
|
||||
200: SimpleResultDataResponse
|
||||
}
|
||||
|
||||
export type PostAccountChangeEmailResponse =
|
||||
PostAccountChangeEmailResponses[keyof PostAccountChangeEmailResponses]
|
||||
|
||||
export type PostAccountChangeEmailCheckEmailUniqueData = {
|
||||
body: CheckEmailUniquePayload
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/account/change-email/check-email-unique'
|
||||
}
|
||||
|
||||
export type PostAccountChangeEmailCheckEmailUniqueErrors = {
|
||||
400: AccountInFreezeError | EmailAlreadyInUseError | EmailDomainSuspendedError | ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type PostAccountChangeEmailCheckEmailUniqueError =
|
||||
PostAccountChangeEmailCheckEmailUniqueErrors[keyof PostAccountChangeEmailCheckEmailUniqueErrors]
|
||||
|
||||
export type PostAccountChangeEmailCheckEmailUniqueResponses = {
|
||||
200: SimpleResultResponse
|
||||
}
|
||||
|
||||
export type PostAccountChangeEmailCheckEmailUniqueResponse =
|
||||
PostAccountChangeEmailCheckEmailUniqueResponses[keyof PostAccountChangeEmailCheckEmailUniqueResponses]
|
||||
|
||||
export type PostAccountChangeEmailResetData = {
|
||||
body: ChangeEmailResetPayload
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/account/change-email/reset'
|
||||
}
|
||||
|
||||
export type PostAccountChangeEmailResetErrors = {
|
||||
400:
|
||||
| AccountInFreezeError
|
||||
| AccountNotFoundError
|
||||
| EmailAlreadyInUseError
|
||||
| EmailDomainSuspendedError
|
||||
| InvalidOrExpiredTokenError
|
||||
| ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type PostAccountChangeEmailResetError =
|
||||
PostAccountChangeEmailResetErrors[keyof PostAccountChangeEmailResetErrors]
|
||||
|
||||
export type PostAccountChangeEmailResetResponses = {
|
||||
200: AccountResponse
|
||||
}
|
||||
|
||||
export type PostAccountChangeEmailResetResponse =
|
||||
PostAccountChangeEmailResetResponses[keyof PostAccountChangeEmailResetResponses]
|
||||
|
||||
export type PostAccountChangeEmailValidityData = {
|
||||
body: ChangeEmailValidityPayload
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/account/change-email/validity'
|
||||
}
|
||||
|
||||
export type PostAccountChangeEmailValidityErrors = {
|
||||
400: EmailCodeError | InvalidEmailError | InvalidOrExpiredTokenError | ErrorResponse
|
||||
429: EmailChangeLimitError | ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type PostAccountChangeEmailValidityError =
|
||||
PostAccountChangeEmailValidityErrors[keyof PostAccountChangeEmailValidityErrors]
|
||||
|
||||
export type PostAccountChangeEmailValidityResponses = {
|
||||
200: VerificationTokenResponse
|
||||
}
|
||||
|
||||
export type PostAccountChangeEmailValidityResponse =
|
||||
PostAccountChangeEmailValidityResponses[keyof PostAccountChangeEmailValidityResponses]
|
||||
|
||||
export type PostAccountDeleteData = {
|
||||
body: AccountDeletePayload
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/account/delete'
|
||||
}
|
||||
|
||||
export type PostAccountDeleteErrors = {
|
||||
400: InvalidAccountDeletionCodeError | ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type PostAccountDeleteError = PostAccountDeleteErrors[keyof PostAccountDeleteErrors]
|
||||
|
||||
export type PostAccountDeleteResponses = {
|
||||
200: SimpleResultResponse
|
||||
}
|
||||
|
||||
export type PostAccountDeleteResponse = PostAccountDeleteResponses[keyof PostAccountDeleteResponses]
|
||||
|
||||
export type PostAccountDeleteFeedbackData = {
|
||||
body: AccountDeletionFeedbackPayload
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/account/delete/feedback'
|
||||
}
|
||||
|
||||
export type PostAccountDeleteFeedbackErrors = {
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type PostAccountDeleteFeedbackError =
|
||||
PostAccountDeleteFeedbackErrors[keyof PostAccountDeleteFeedbackErrors]
|
||||
|
||||
export type PostAccountDeleteFeedbackResponses = {
|
||||
200: SimpleResultResponse
|
||||
}
|
||||
|
||||
export type PostAccountDeleteFeedbackResponse =
|
||||
PostAccountDeleteFeedbackResponses[keyof PostAccountDeleteFeedbackResponses]
|
||||
|
||||
export type GetAccountDeleteVerifyData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/account/delete/verify'
|
||||
}
|
||||
|
||||
export type GetAccountDeleteVerifyErrors = {
|
||||
400: AccountNotFoundError | ErrorResponse
|
||||
429: EmailCodeAccountDeletionRateLimitExceededError | ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type GetAccountDeleteVerifyError =
|
||||
GetAccountDeleteVerifyErrors[keyof GetAccountDeleteVerifyErrors]
|
||||
|
||||
export type GetAccountDeleteVerifyResponses = {
|
||||
200: SimpleResultDataResponse
|
||||
}
|
||||
|
||||
export type GetAccountDeleteVerifyResponse =
|
||||
GetAccountDeleteVerifyResponses[keyof GetAccountDeleteVerifyResponses]
|
||||
|
||||
export type GetAccountEducationData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/account/education'
|
||||
}
|
||||
|
||||
export type GetAccountEducationErrors = {
|
||||
429: BillingRequestInProgressError | ErrorResponse
|
||||
502: BillingOperationFailedError | ErrorResponse
|
||||
503: BillingUnavailableError | ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type GetAccountEducationError = GetAccountEducationErrors[keyof GetAccountEducationErrors]
|
||||
|
||||
export type GetAccountEducationResponses = {
|
||||
200: EducationStatusResponse
|
||||
}
|
||||
|
||||
export type GetAccountEducationResponse =
|
||||
GetAccountEducationResponses[keyof GetAccountEducationResponses]
|
||||
|
||||
export type PostAccountEducationData = {
|
||||
body: EducationActivatePayload
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/account/education'
|
||||
}
|
||||
|
||||
export type PostAccountEducationErrors = {
|
||||
400: AccountNotFoundError | EducationActivateFailedError | ErrorResponse
|
||||
429: BillingRequestInProgressError | EducationActivateLimitError | ErrorResponse
|
||||
502: BillingOperationFailedError | ErrorResponse
|
||||
503: BillingUnavailableError | ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type PostAccountEducationError = PostAccountEducationErrors[keyof PostAccountEducationErrors]
|
||||
|
||||
export type PostAccountEducationResponses = {
|
||||
200: EducationActivateResponse
|
||||
}
|
||||
|
||||
export type PostAccountEducationResponse =
|
||||
PostAccountEducationResponses[keyof PostAccountEducationResponses]
|
||||
|
||||
export type GetAccountEducationAutocompleteData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query: {
|
||||
keywords: string
|
||||
limit?: number
|
||||
page?: number
|
||||
}
|
||||
url: '/account/education/autocomplete'
|
||||
}
|
||||
|
||||
export type GetAccountEducationAutocompleteErrors = {
|
||||
502: BillingOperationFailedError | ErrorResponse
|
||||
503: BillingUnavailableError | ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type GetAccountEducationAutocompleteError =
|
||||
GetAccountEducationAutocompleteErrors[keyof GetAccountEducationAutocompleteErrors]
|
||||
|
||||
export type GetAccountEducationAutocompleteResponses = {
|
||||
200: EducationAutocompleteResponse
|
||||
}
|
||||
|
||||
export type GetAccountEducationAutocompleteResponse =
|
||||
GetAccountEducationAutocompleteResponses[keyof GetAccountEducationAutocompleteResponses]
|
||||
|
||||
export type GetAccountEducationVerifyData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/account/education/verify'
|
||||
}
|
||||
|
||||
export type GetAccountEducationVerifyErrors = {
|
||||
400: AccountNotFoundError | EducationVerifyFailedError | ErrorResponse
|
||||
429: BillingRequestInProgressError | EducationVerifyLimitError | ErrorResponse
|
||||
502: BillingOperationFailedError | ErrorResponse
|
||||
503: BillingUnavailableError | ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type GetAccountEducationVerifyError =
|
||||
GetAccountEducationVerifyErrors[keyof GetAccountEducationVerifyErrors]
|
||||
|
||||
export type GetAccountEducationVerifyResponses = {
|
||||
200: EducationVerifyResponse
|
||||
}
|
||||
|
||||
export type GetAccountEducationVerifyResponse =
|
||||
GetAccountEducationVerifyResponses[keyof GetAccountEducationVerifyResponses]
|
||||
|
||||
export type PostAccountInitData = {
|
||||
body: AccountInitPayload
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/account/init'
|
||||
}
|
||||
|
||||
export type PostAccountInitErrors = {
|
||||
400:
|
||||
| AccountAlreadyInitedError
|
||||
| AccountNotFoundError
|
||||
| InvalidInvitationCodeError
|
||||
| MissingInvitationCodeError
|
||||
| ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type PostAccountInitError = PostAccountInitErrors[keyof PostAccountInitErrors]
|
||||
|
||||
export type PostAccountInitResponses = {
|
||||
200: SimpleResultResponse
|
||||
}
|
||||
|
||||
export type PostAccountInitResponse = PostAccountInitResponses[keyof PostAccountInitResponses]
|
||||
|
||||
export type GetAccountIntegratesData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/account/integrates'
|
||||
}
|
||||
|
||||
export type GetAccountIntegratesErrors = {
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type GetAccountIntegratesError = GetAccountIntegratesErrors[keyof GetAccountIntegratesErrors]
|
||||
|
||||
export type GetAccountIntegratesResponses = {
|
||||
200: AccountIntegrateListResponse
|
||||
}
|
||||
|
||||
export type GetAccountIntegratesResponse =
|
||||
GetAccountIntegratesResponses[keyof GetAccountIntegratesResponses]
|
||||
|
||||
export type PostAccountPasswordData = {
|
||||
body: AccountPasswordPayload
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/account/password'
|
||||
}
|
||||
|
||||
export type PostAccountPasswordErrors = {
|
||||
400:
|
||||
| AccountNotFoundError
|
||||
| CurrentPasswordIncorrectError
|
||||
| InvalidAccountPasswordError
|
||||
| ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type PostAccountPasswordError = PostAccountPasswordErrors[keyof PostAccountPasswordErrors]
|
||||
|
||||
export type PostAccountPasswordResponses = {
|
||||
200: AccountResponse
|
||||
}
|
||||
|
||||
export type PostAccountPasswordResponse =
|
||||
PostAccountPasswordResponses[keyof PostAccountPasswordResponses]
|
||||
|
||||
export type GetAccountProfileData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/account/profile'
|
||||
}
|
||||
|
||||
export type GetAccountProfileErrors = {
|
||||
400: AccountNotFoundError | ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type GetAccountProfileError = GetAccountProfileErrors[keyof GetAccountProfileErrors]
|
||||
|
||||
export type GetAccountProfileResponses = {
|
||||
200: AccountResponse
|
||||
}
|
||||
|
||||
export type GetAccountProfileResponse = GetAccountProfileResponses[keyof GetAccountProfileResponses]
|
||||
|
||||
export type PatchAccountProfileData = {
|
||||
body: AccountProfilePatchPayload
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/account/profile'
|
||||
}
|
||||
|
||||
export type PatchAccountProfileErrors = {
|
||||
400: AccountNotFoundError | ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type PatchAccountProfileError = PatchAccountProfileErrors[keyof PatchAccountProfileErrors]
|
||||
|
||||
export type PatchAccountProfileResponses = {
|
||||
200: AccountResponse
|
||||
}
|
||||
|
||||
export type PatchAccountProfileResponse =
|
||||
PatchAccountProfileResponses[keyof PatchAccountProfileResponses]
|
||||
@@ -0,0 +1,646 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import * as z from 'zod'
|
||||
|
||||
/**
|
||||
* AvatarUrlResponse
|
||||
*/
|
||||
export const zAvatarUrlResponse = z.object({
|
||||
avatar_url: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* ErrorResponse
|
||||
*
|
||||
* Documented non-2xx body emitted by ``register_external_error_handlers``.
|
||||
*
|
||||
* ``params`` and ``details`` appear only on the errors that set them. The schema
|
||||
* stays open because ``HTTPException.data`` may carry extra keys.
|
||||
*/
|
||||
export const zErrorResponse = z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
})
|
||||
|
||||
/**
|
||||
* ChangeEmailSendPayload
|
||||
*/
|
||||
export const zChangeEmailSendPayload = z.object({
|
||||
email: z.string(),
|
||||
language: z.string().nullish(),
|
||||
phase: z.string().nullish(),
|
||||
token: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* SimpleResultDataResponse
|
||||
*/
|
||||
export const zSimpleResultDataResponse = z.object({
|
||||
data: z.string(),
|
||||
result: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AccountNotFoundError
|
||||
*
|
||||
* Account not found.
|
||||
*/
|
||||
export const zAccountNotFoundError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('account_not_found'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* InvalidEmailError
|
||||
*
|
||||
* The email address is not valid.
|
||||
*/
|
||||
export const zInvalidEmailError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invalid_email'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* InvalidOrExpiredTokenError
|
||||
*
|
||||
* The token is invalid or has expired.
|
||||
*/
|
||||
export const zInvalidOrExpiredTokenError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invalid_or_expired_token'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* EmailChangeRateLimitExceededError
|
||||
*
|
||||
* Too many email change emails have been sent. Please try again in {minutes} minutes.
|
||||
*/
|
||||
export const zEmailChangeRateLimitExceededError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_change_rate_limit_exceeded'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* EmailSendIpLimitError
|
||||
*
|
||||
* Too many emails have been sent from this IP address recently. Please try again later.
|
||||
*/
|
||||
export const zEmailSendIpLimitError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_send_ip_limit'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* CheckEmailUniquePayload
|
||||
*/
|
||||
export const zCheckEmailUniquePayload = z.object({
|
||||
email: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* SimpleResultResponse
|
||||
*/
|
||||
export const zSimpleResultResponse = z.object({
|
||||
result: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AccountInFreezeError
|
||||
*
|
||||
* This email account has been deleted within the past 30 days and is temporarily unavailable for new account registration.
|
||||
*/
|
||||
export const zAccountInFreezeError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('account_in_freeze'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* EmailAlreadyInUseError
|
||||
*
|
||||
* A user with this email already exists.
|
||||
*/
|
||||
export const zEmailAlreadyInUseError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_already_in_use'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* EmailDomainSuspendedError
|
||||
*
|
||||
* This email domain has been suspended.
|
||||
*/
|
||||
export const zEmailDomainSuspendedError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_domain_suspended'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* ChangeEmailResetPayload
|
||||
*/
|
||||
export const zChangeEmailResetPayload = z.object({
|
||||
new_email: z.string(),
|
||||
token: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AccountResponse
|
||||
*/
|
||||
export const zAccountResponse = z.object({
|
||||
avatar: z.string().nullish(),
|
||||
avatar_url: z.string().nullable(),
|
||||
created_at: z.int().nullish(),
|
||||
email: z.string(),
|
||||
id: z.string(),
|
||||
interface_language: z.string().nullish(),
|
||||
interface_theme: z.string().nullish(),
|
||||
is_password_set: z.boolean(),
|
||||
last_login_at: z.int().nullish(),
|
||||
last_login_ip: z.string().nullish(),
|
||||
name: z.string(),
|
||||
timezone: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* ChangeEmailValidityPayload
|
||||
*/
|
||||
export const zChangeEmailValidityPayload = z.object({
|
||||
code: z.string(),
|
||||
email: z.string(),
|
||||
token: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* VerificationTokenResponse
|
||||
*/
|
||||
export const zVerificationTokenResponse = z.object({
|
||||
email: z.string(),
|
||||
is_valid: z.boolean(),
|
||||
token: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* EmailCodeError
|
||||
*
|
||||
* Email code is invalid or expired.
|
||||
*/
|
||||
export const zEmailCodeError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_code_error'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* EmailChangeLimitError
|
||||
*
|
||||
* Too many failed email change attempts. Please try again in 24 hours.
|
||||
*/
|
||||
export const zEmailChangeLimitError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_change_limit'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* AccountDeletePayload
|
||||
*/
|
||||
export const zAccountDeletePayload = z.object({
|
||||
code: z.string(),
|
||||
token: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* InvalidAccountDeletionCodeError
|
||||
*
|
||||
* Invalid account deletion code.
|
||||
*/
|
||||
export const zInvalidAccountDeletionCodeError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invalid_account_deletion_code'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* AccountDeletionFeedbackPayload
|
||||
*/
|
||||
export const zAccountDeletionFeedbackPayload = z.object({
|
||||
email: z.string(),
|
||||
feedback: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* EmailCodeAccountDeletionRateLimitExceededError
|
||||
*
|
||||
* Too many account deletion emails have been sent. Please try again in {minutes} minutes.
|
||||
*/
|
||||
export const zEmailCodeAccountDeletionRateLimitExceededError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_code_account_deletion_rate_limit_exceeded'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* EducationStatusResponse
|
||||
*/
|
||||
export const zEducationStatusResponse = z.object({
|
||||
allow_refresh: z.boolean(),
|
||||
expire_at: z.int().nullable(),
|
||||
is_student: z.boolean(),
|
||||
result: z.boolean(),
|
||||
})
|
||||
|
||||
/**
|
||||
* BillingRequestInProgressError
|
||||
*
|
||||
* A previous request is still being processed. Please try again shortly.
|
||||
*/
|
||||
export const zBillingRequestInProgressError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('billing_request_in_progress'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* BillingOperationFailedError
|
||||
*
|
||||
* We couldn't complete this request. Please try again. If the problem persists, contact support.
|
||||
*/
|
||||
export const zBillingOperationFailedError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('billing_operation_failed'),
|
||||
status: z.literal(502),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* BillingUnavailableError
|
||||
*
|
||||
* This operation is temporarily unavailable. Please try again later.
|
||||
*/
|
||||
export const zBillingUnavailableError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('billing_unavailable'),
|
||||
status: z.literal(503),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* EducationActivatePayload
|
||||
*/
|
||||
export const zEducationActivatePayload = z.object({
|
||||
institution: z.string(),
|
||||
role: z.string(),
|
||||
token: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* EducationActivateResponse
|
||||
*/
|
||||
export const zEducationActivateResponse = z.object({
|
||||
message: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* EducationActivateFailedError
|
||||
*
|
||||
* We couldn't activate your education discount.
|
||||
*/
|
||||
export const zEducationActivateFailedError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('education_activate_failed'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* EducationActivateLimitError
|
||||
*
|
||||
* Rate limit exceeded
|
||||
*/
|
||||
export const zEducationActivateLimitError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('education_activate_limit'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* EducationAutocompleteResponse
|
||||
*/
|
||||
export const zEducationAutocompleteResponse = z.object({
|
||||
curr_page: z.int(),
|
||||
data: z.array(z.string()),
|
||||
has_next: z.boolean(),
|
||||
})
|
||||
|
||||
/**
|
||||
* EducationVerifyFailedError
|
||||
*
|
||||
* We couldn't verify your education status.
|
||||
*/
|
||||
export const zEducationVerifyFailedError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('education_verify_failed'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* EducationVerifyLimitError
|
||||
*
|
||||
* Rate limit exceeded
|
||||
*/
|
||||
export const zEducationVerifyLimitError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('education_verify_limit'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* AccountInitPayload
|
||||
*/
|
||||
export const zAccountInitPayload = z.object({
|
||||
interface_language: z.string(),
|
||||
invitation_code: z.string().nullish(),
|
||||
timezone: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AccountAlreadyInitedError
|
||||
*
|
||||
* The account has been initialized. Please refresh the page.
|
||||
*/
|
||||
export const zAccountAlreadyInitedError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('account_already_inited'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* InvalidInvitationCodeError
|
||||
*
|
||||
* Invalid invitation code.
|
||||
*/
|
||||
export const zInvalidInvitationCodeError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invalid_invitation_code'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* MissingInvitationCodeError
|
||||
*
|
||||
* Invitation code is required.
|
||||
*/
|
||||
export const zMissingInvitationCodeError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('missing_invitation_code'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* AccountPasswordPayload
|
||||
*/
|
||||
export const zAccountPasswordPayload = z.object({
|
||||
new_password: z.string(),
|
||||
password: z.string().nullish(),
|
||||
repeat_new_password: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* CurrentPasswordIncorrectError
|
||||
*
|
||||
* Current password is incorrect.
|
||||
*/
|
||||
export const zCurrentPasswordIncorrectError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('current_password_incorrect'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* InvalidAccountPasswordError
|
||||
*
|
||||
* The password does not satisfy the account password policy.
|
||||
*/
|
||||
export const zInvalidAccountPasswordError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invalid_account_password'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* AccountProfilePatchPayload
|
||||
*/
|
||||
export const zAccountProfilePatchPayload = z
|
||||
.object({
|
||||
avatar: z.string().optional(),
|
||||
interface_language: z.string().optional(),
|
||||
interface_theme: z.enum(['dark', 'light']).optional(),
|
||||
name: z.string().min(3).max(30).optional(),
|
||||
timezone: z.string().optional(),
|
||||
})
|
||||
.strict()
|
||||
|
||||
/**
|
||||
* EducationVerifyEligibleResponse
|
||||
*/
|
||||
export const zEducationVerifyEligibleResponse = z.object({
|
||||
status: z.literal('eligible'),
|
||||
token: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* EducationVerifyNotEligibleResponse
|
||||
*/
|
||||
export const zEducationVerifyNotEligibleResponse = z.object({
|
||||
status: z.literal('not_eligible'),
|
||||
})
|
||||
|
||||
/**
|
||||
* EducationVerifyResponse
|
||||
*
|
||||
* Education verification result: a token for an eligible account, none for an ineligible one.
|
||||
*/
|
||||
export const zEducationVerifyResponse = z.discriminatedUnion('status', [
|
||||
zEducationVerifyEligibleResponse,
|
||||
zEducationVerifyNotEligibleResponse,
|
||||
])
|
||||
|
||||
/**
|
||||
* AccountIntegrateResponse
|
||||
*/
|
||||
export const zAccountIntegrateResponse = z.object({
|
||||
created_at: z.int().nullish(),
|
||||
is_bound: z.boolean(),
|
||||
link: z.string().nullish(),
|
||||
provider: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AccountIntegrateListResponse
|
||||
*/
|
||||
export const zAccountIntegrateListResponse = z.object({
|
||||
data: z.array(zAccountIntegrateResponse),
|
||||
})
|
||||
|
||||
/**
|
||||
* AccountResponse
|
||||
*/
|
||||
export const zAccountResponseWritable = z.object({
|
||||
avatar: z.string().nullish(),
|
||||
created_at: z.int().nullish(),
|
||||
email: z.string(),
|
||||
id: z.string(),
|
||||
interface_language: z.string().nullish(),
|
||||
interface_theme: z.string().nullish(),
|
||||
is_password_set: z.boolean(),
|
||||
last_login_at: z.int().nullish(),
|
||||
last_login_ip: z.string().nullish(),
|
||||
name: z.string(),
|
||||
timezone: z.string().nullish(),
|
||||
})
|
||||
|
||||
export const zGetAccountAvatarQuery = z.object({
|
||||
avatar: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zGetAccountAvatarResponse = zAvatarUrlResponse
|
||||
|
||||
export const zPostAccountChangeEmailBody = zChangeEmailSendPayload
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zPostAccountChangeEmailResponse = zSimpleResultDataResponse
|
||||
|
||||
export const zPostAccountChangeEmailCheckEmailUniqueBody = zCheckEmailUniquePayload
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zPostAccountChangeEmailCheckEmailUniqueResponse = zSimpleResultResponse
|
||||
|
||||
export const zPostAccountChangeEmailResetBody = zChangeEmailResetPayload
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zPostAccountChangeEmailResetResponse = zAccountResponse
|
||||
|
||||
export const zPostAccountChangeEmailValidityBody = zChangeEmailValidityPayload
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zPostAccountChangeEmailValidityResponse = zVerificationTokenResponse
|
||||
|
||||
export const zPostAccountDeleteBody = zAccountDeletePayload
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zPostAccountDeleteResponse = zSimpleResultResponse
|
||||
|
||||
export const zPostAccountDeleteFeedbackBody = zAccountDeletionFeedbackPayload
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zPostAccountDeleteFeedbackResponse = zSimpleResultResponse
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zGetAccountDeleteVerifyResponse = zSimpleResultDataResponse
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zGetAccountEducationResponse = zEducationStatusResponse
|
||||
|
||||
export const zPostAccountEducationBody = zEducationActivatePayload
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zPostAccountEducationResponse = zEducationActivateResponse
|
||||
|
||||
export const zGetAccountEducationAutocompleteQuery = z.object({
|
||||
keywords: z.string(),
|
||||
limit: z.int().optional().default(20),
|
||||
page: z.int().optional().default(0),
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zGetAccountEducationAutocompleteResponse = zEducationAutocompleteResponse
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zGetAccountEducationVerifyResponse = zEducationVerifyResponse
|
||||
|
||||
export const zPostAccountInitBody = zAccountInitPayload
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zPostAccountInitResponse = zSimpleResultResponse
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zGetAccountIntegratesResponse = zAccountIntegrateListResponse
|
||||
|
||||
export const zPostAccountPasswordBody = zAccountPasswordPayload
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zPostAccountPasswordResponse = zAccountResponse
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zGetAccountProfileResponse = zAccountResponse
|
||||
|
||||
export const zPatchAccountProfileBody = zAccountProfilePatchPayload
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zPatchAccountProfileResponse = zAccountResponse
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
// This file is auto-generated by scripts/add-orpc-error-maps.ts
|
||||
import * as z from 'zod'
|
||||
|
||||
const zErrorResponse = /* @__PURE__ */ (() =>
|
||||
z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
}))()
|
||||
|
||||
const zAccountInFreezeError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('account_in_freeze'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zEmailDomainSuspendedError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_domain_suspended'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zAlreadyActivateError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('already_activate'),
|
||||
status: z.literal(403),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zInvitationAccountMismatchError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invitation_account_mismatch'),
|
||||
status: z.literal(403),
|
||||
}),
|
||||
))()
|
||||
|
||||
export const postErrors = {
|
||||
account_in_freeze: { status: 400, data: zAccountInFreezeError },
|
||||
already_activate: { status: 403, data: zAlreadyActivateError },
|
||||
email_domain_suspended: { status: 400, data: zEmailDomainSuspendedError },
|
||||
invitation_account_mismatch: { status: 403, data: zInvitationAccountMismatchError },
|
||||
}
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { oc } from '@orpc/contract'
|
||||
import * as z from 'zod'
|
||||
import {
|
||||
zAccountInFreezeError,
|
||||
zAlreadyActivateError,
|
||||
zEmailDomainSuspendedError,
|
||||
zInvitationAccountMismatchError,
|
||||
} from './zod.gen.ts'
|
||||
import {
|
||||
zGetActivateCheckQuery,
|
||||
zGetActivateCheckResponse,
|
||||
zPostActivateBody,
|
||||
zPostActivateResponse,
|
||||
} from './zod.gen.ts'
|
||||
|
||||
/**
|
||||
* Check if activation token is valid
|
||||
*/
|
||||
export const get = oc
|
||||
.route({
|
||||
description: 'Check if activation token is valid',
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getActivateCheck',
|
||||
path: '/activate/check',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ query: zGetActivateCheckQuery }))
|
||||
.output(zGetActivateCheckResponse)
|
||||
|
||||
export const check = {
|
||||
get,
|
||||
}
|
||||
|
||||
/**
|
||||
* Accept an invitation without letting an existing session act for another account
|
||||
*
|
||||
* Activate account with invitation token
|
||||
* Token-only activation remains available for legacy clients. When the request already
|
||||
* carries a console session, that session must belong to the account encoded in the
|
||||
* invitation before the token is consumed or tenant membership is changed.
|
||||
*/
|
||||
export const post = oc
|
||||
.route({
|
||||
description:
|
||||
'Activate account with invitation token\nToken-only activation remains available for legacy clients. When the request already\ncarries a console session, that session must belong to the account encoded in the\ninvitation before the token is consumed or tenant membership is changed.',
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postActivate',
|
||||
path: '/activate',
|
||||
summary: 'Accept an invitation without letting an existing session act for another account',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ body: zPostActivateBody }))
|
||||
.output(zPostActivateResponse)
|
||||
.errors({
|
||||
account_in_freeze: { status: 400, data: zAccountInFreezeError },
|
||||
already_activate: { status: 403, data: zAlreadyActivateError },
|
||||
email_domain_suspended: { status: 400, data: zEmailDomainSuspendedError },
|
||||
invitation_account_mismatch: { status: 403, data: zInvitationAccountMismatchError },
|
||||
})
|
||||
|
||||
export const activate = {
|
||||
post,
|
||||
check,
|
||||
}
|
||||
|
||||
export const contract = {
|
||||
activate,
|
||||
}
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type ClientOptions = {
|
||||
baseUrl: `${string}://${string}/console/api` | (string & {})
|
||||
}
|
||||
|
||||
export type ActivatePayload = {
|
||||
email?: string | null
|
||||
interface_language?: string | null
|
||||
name?: string | null
|
||||
timezone?: string | null
|
||||
token: string
|
||||
workspace_id?: string | null
|
||||
}
|
||||
|
||||
export type ActivationResponse = {
|
||||
result: string
|
||||
}
|
||||
|
||||
export type AccountInFreezeError = ErrorResponse & {
|
||||
code: 'account_in_freeze'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type EmailDomainSuspendedError = ErrorResponse & {
|
||||
code: 'email_domain_suspended'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type ErrorResponse = {
|
||||
code: string
|
||||
details?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
message: string
|
||||
params?: string
|
||||
status: number
|
||||
}
|
||||
|
||||
export type AlreadyActivateError = ErrorResponse & {
|
||||
code: 'already_activate'
|
||||
status: 403
|
||||
}
|
||||
|
||||
export type InvitationAccountMismatchError = ErrorResponse & {
|
||||
code: 'invitation_account_mismatch'
|
||||
status: 403
|
||||
}
|
||||
|
||||
export type ActivationCheckResponse = {
|
||||
data?: ActivationCheckData | null
|
||||
is_valid: boolean
|
||||
}
|
||||
|
||||
export type ActivationCheckData = {
|
||||
account_status?: string | null
|
||||
email: string | null
|
||||
requires_setup?: boolean | null
|
||||
workspace_id: string | null
|
||||
workspace_name: string | null
|
||||
}
|
||||
|
||||
export type PostActivateData = {
|
||||
body: ActivatePayload
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/activate'
|
||||
}
|
||||
|
||||
export type PostActivateErrors = {
|
||||
400: AccountInFreezeError | EmailDomainSuspendedError | ErrorResponse
|
||||
403: AlreadyActivateError | InvitationAccountMismatchError | ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type PostActivateError = PostActivateErrors[keyof PostActivateErrors]
|
||||
|
||||
export type PostActivateResponses = {
|
||||
200: ActivationResponse
|
||||
}
|
||||
|
||||
export type PostActivateResponse = PostActivateResponses[keyof PostActivateResponses]
|
||||
|
||||
export type GetActivateCheckData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query: {
|
||||
email?: string
|
||||
token: string
|
||||
workspace_id?: string
|
||||
}
|
||||
url: '/activate/check'
|
||||
}
|
||||
|
||||
export type GetActivateCheckErrors = {
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type GetActivateCheckError = GetActivateCheckErrors[keyof GetActivateCheckErrors]
|
||||
|
||||
export type GetActivateCheckResponses = {
|
||||
200: ActivationCheckResponse
|
||||
}
|
||||
|
||||
export type GetActivateCheckResponse = GetActivateCheckResponses[keyof GetActivateCheckResponses]
|
||||
+123
@@ -0,0 +1,123 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import * as z from 'zod'
|
||||
|
||||
/**
|
||||
* ActivatePayload
|
||||
*/
|
||||
export const zActivatePayload = z.object({
|
||||
email: z.string().nullish(),
|
||||
interface_language: z.string().nullish(),
|
||||
name: z.string().max(30).nullish(),
|
||||
timezone: z.string().nullish(),
|
||||
token: z.string(),
|
||||
workspace_id: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* ActivationResponse
|
||||
*/
|
||||
export const zActivationResponse = z.object({
|
||||
result: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* ErrorResponse
|
||||
*
|
||||
* Documented non-2xx body emitted by ``register_external_error_handlers``.
|
||||
*
|
||||
* ``params`` and ``details`` appear only on the errors that set them. The schema
|
||||
* stays open because ``HTTPException.data`` may carry extra keys.
|
||||
*/
|
||||
export const zErrorResponse = z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AccountInFreezeError
|
||||
*
|
||||
* This email account has been deleted within the past 30 days and is temporarily unavailable for new account registration.
|
||||
*/
|
||||
export const zAccountInFreezeError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('account_in_freeze'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* EmailDomainSuspendedError
|
||||
*
|
||||
* This email domain has been suspended.
|
||||
*/
|
||||
export const zEmailDomainSuspendedError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_domain_suspended'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* AlreadyActivateError
|
||||
*
|
||||
* Auth Token is invalid or account already activated, please check again.
|
||||
*/
|
||||
export const zAlreadyActivateError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('already_activate'),
|
||||
status: z.literal(403),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* InvitationAccountMismatchError
|
||||
*
|
||||
* This invitation was sent to another account. Please sign in with the invited account.
|
||||
*/
|
||||
export const zInvitationAccountMismatchError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invitation_account_mismatch'),
|
||||
status: z.literal(403),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* ActivationCheckData
|
||||
*/
|
||||
export const zActivationCheckData = z.object({
|
||||
account_status: z.string().nullish(),
|
||||
email: z.string().nullable(),
|
||||
requires_setup: z.boolean().nullish(),
|
||||
workspace_id: z.string().nullable(),
|
||||
workspace_name: z.string().nullable(),
|
||||
})
|
||||
|
||||
/**
|
||||
* ActivationCheckResponse
|
||||
*/
|
||||
export const zActivationCheckResponse = z.object({
|
||||
data: zActivationCheckData.nullish(),
|
||||
is_valid: z.boolean(),
|
||||
})
|
||||
|
||||
export const zPostActivateBody = zActivatePayload
|
||||
|
||||
/**
|
||||
* Account activated successfully
|
||||
*/
|
||||
export const zPostActivateResponse = zActivationResponse
|
||||
|
||||
export const zGetActivateCheckQuery = z.object({
|
||||
email: z.string().optional(),
|
||||
token: z.string(),
|
||||
workspace_id: z.string().optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zGetActivateCheckResponse = zActivationCheckResponse
|
||||
+696
@@ -0,0 +1,696 @@
|
||||
// This file is auto-generated by scripts/add-orpc-error-maps.ts
|
||||
import * as z from 'zod'
|
||||
|
||||
const zErrorResponse = /* @__PURE__ */ (() =>
|
||||
z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
}))()
|
||||
|
||||
const zAgentNotFoundError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('agent_not_found_error'),
|
||||
status: z.literal(404),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zAgentNameConflictError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('agent_name_conflict_error'),
|
||||
status: z.literal(409),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zAgentNotPublishedError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('agent_not_published'),
|
||||
status: z.literal(409),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zMaxKeysExceededError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('max_keys_exceeded'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zAppUnavailableError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('app_unavailable'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zCompletionRequestError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('completion_request_error'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zModelCurrentlyNotSupportError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('model_currently_not_support'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zNoAudioUploadedError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('no_audio_uploaded'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zProviderNotInitializeError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('provider_not_initialize'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zProviderNotSupportSpeechToTextError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('provider_not_support_speech_to_text'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zProviderQuotaExceededError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('provider_quota_exceeded'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zSpeechToTextDisabledError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('speech_to_text_disabled'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zAgentVersionNotFoundError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('agent_version_not_found_error'),
|
||||
status: z.literal(404),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zAudioTooLargeError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('audio_too_large'),
|
||||
status: z.literal(413),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zUnsupportedAudioTypeError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('unsupported_audio_type'),
|
||||
status: z.literal(415),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zRateLimitError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('rate_limit_error'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zAgentBuildSandboxNotFoundError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('agent_build_sandbox_not_found'),
|
||||
status: z.literal(404),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zAgentSoulLockedError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('agent_soul_locked_error'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zInvalidComposerConfigError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invalid_composer_config_error'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zPlaintextSecretNotAllowedError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('plaintext_secret_not_allowed_error'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zAgentHomeSnapshotTooLargeError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('agent_home_snapshot_too_large'),
|
||||
status: z.literal(413),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zAgentHomeSnapshotCreateFailedError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('agent_home_snapshot_create_failed'),
|
||||
status: z.literal(502),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zAppSuggestedQuestionsAfterAnswerDisabledError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('app_suggested_questions_after_answer_disabled'),
|
||||
status: z.literal(403),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zMessageFeedbackRatingRequiredError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('message_feedback_rating_required'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zAgentModelNotConfiguredError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('agent_model_not_configured'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zNoActiveBindingError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('no_active_binding'),
|
||||
status: z.literal(404),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zAgentBackendUnreachableError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('agent_backend_unreachable'),
|
||||
status: z.literal(502),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zInspectorUnavailableError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('inspector_unavailable'),
|
||||
status: z.literal(503),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zBindingFileDownloadUnavailableError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('binding_file_download_unavailable'),
|
||||
status: z.literal(502),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zProviderNotSupportTextToSpeechError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('provider_not_support_text_to_speech'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zInvalidTracingConfigError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invalid_tracing_config'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zTracingProviderUnavailableError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('tracing_provider_unavailable'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zUnsupportedTracingProviderError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('unsupported_tracing_provider'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zTraceConfigNotFoundError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('trace_config_not_found'),
|
||||
status: z.literal(404),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zTracingConfigConflictError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('tracing_config_conflict'),
|
||||
status: z.literal(409),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zTracingConfigProcessingFailedError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('tracing_config_processing_failed'),
|
||||
status: z.literal(500),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zAppNotFoundError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('app_not_found'),
|
||||
status: z.literal(404),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zTracingConfigVerificationFailedError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('tracing_config_verification_failed'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zTraceConfigAlreadyExistsError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('trace_config_already_exists'),
|
||||
status: z.literal(409),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zTracingNodeNotFoundError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('tracing_node_not_found'),
|
||||
status: z.literal(404),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zTracingSourceNotFoundError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('tracing_source_not_found'),
|
||||
status: z.literal(404),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zTracingRunNotFoundError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('tracing_run_not_found'),
|
||||
status: z.literal(404),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zTracingAlreadyAcceptedError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('tracing_already_accepted'),
|
||||
status: z.literal(409),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zTracingDuplicateAcknowledgementRequiredError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('tracing_duplicate_acknowledgement_required'),
|
||||
status: z.literal(409),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zTracingRetryNotAllowedError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('tracing_retry_not_allowed'),
|
||||
status: z.literal(409),
|
||||
}),
|
||||
))()
|
||||
|
||||
export const get2Errors = { agent_not_found_error: { status: 404, data: zAgentNotFoundError } }
|
||||
|
||||
export const postErrors = {
|
||||
agent_not_found_error: { status: 404, data: zAgentNotFoundError },
|
||||
agent_not_published: { status: 409, data: zAgentNotPublishedError },
|
||||
}
|
||||
|
||||
export const post2Errors = {
|
||||
agent_not_published: { status: 409, data: zAgentNotPublishedError },
|
||||
max_keys_exceeded: { status: 400, data: zMaxKeysExceededError },
|
||||
}
|
||||
|
||||
export const post3Errors = {
|
||||
agent_not_found_error: { status: 404, data: zAgentNotFoundError },
|
||||
agent_version_not_found_error: { status: 404, data: zAgentVersionNotFoundError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
audio_too_large: { status: 413, data: zAudioTooLargeError },
|
||||
completion_request_error: { status: 400, data: zCompletionRequestError },
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
no_audio_uploaded: { status: 400, data: zNoAudioUploadedError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_not_support_speech_to_text: { status: 400, data: zProviderNotSupportSpeechToTextError },
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
speech_to_text_disabled: { status: 400, data: zSpeechToTextDisabledError },
|
||||
unsupported_audio_type: { status: 415, data: zUnsupportedAudioTypeError },
|
||||
}
|
||||
|
||||
export const post4Errors = {
|
||||
agent_not_found_error: { status: 404, data: zAgentNotFoundError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
completion_request_error: { status: 400, data: zCompletionRequestError },
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
rate_limit_error: { status: 429, data: zRateLimitError },
|
||||
}
|
||||
|
||||
export const post5Errors = {
|
||||
agent_build_sandbox_not_found: { status: 404, data: zAgentBuildSandboxNotFoundError },
|
||||
agent_home_snapshot_create_failed: { status: 502, data: zAgentHomeSnapshotCreateFailedError },
|
||||
agent_home_snapshot_too_large: { status: 413, data: zAgentHomeSnapshotTooLargeError },
|
||||
agent_not_found_error: { status: 404, data: zAgentNotFoundError },
|
||||
agent_version_not_found_error: { status: 404, data: zAgentVersionNotFoundError },
|
||||
invalid_composer_config_error: { status: 400, data: zInvalidComposerConfigError },
|
||||
plaintext_secret_not_allowed_error: { status: 400, data: zPlaintextSecretNotAllowedError },
|
||||
}
|
||||
|
||||
export const post6Errors = {
|
||||
agent_build_sandbox_not_found: { status: 404, data: zAgentBuildSandboxNotFoundError },
|
||||
agent_not_found_error: { status: 404, data: zAgentNotFoundError },
|
||||
agent_version_not_found_error: { status: 404, data: zAgentVersionNotFoundError },
|
||||
}
|
||||
|
||||
export const delete2Errors = {
|
||||
agent_build_sandbox_not_found: { status: 404, data: zAgentBuildSandboxNotFoundError },
|
||||
agent_not_found_error: { status: 404, data: zAgentNotFoundError },
|
||||
}
|
||||
|
||||
export const get4Errors = {
|
||||
agent_version_not_found_error: { status: 404, data: zAgentVersionNotFoundError },
|
||||
}
|
||||
|
||||
export const putErrors = {
|
||||
agent_not_found_error: { status: 404, data: zAgentNotFoundError },
|
||||
agent_soul_locked_error: { status: 400, data: zAgentSoulLockedError },
|
||||
agent_version_not_found_error: { status: 404, data: zAgentVersionNotFoundError },
|
||||
}
|
||||
|
||||
export const get5Errors = {
|
||||
agent_not_found_error: { status: 404, data: zAgentNotFoundError },
|
||||
agent_version_not_found_error: { status: 404, data: zAgentVersionNotFoundError },
|
||||
app_suggested_questions_after_answer_disabled: {
|
||||
status: 403,
|
||||
data: zAppSuggestedQuestionsAfterAnswerDisabledError,
|
||||
},
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
completion_request_error: { status: 400, data: zCompletionRequestError },
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
}
|
||||
|
||||
export const post7Errors = { agent_not_found_error: { status: 404, data: zAgentNotFoundError } }
|
||||
|
||||
export const get6Errors = {
|
||||
agent_not_found_error: { status: 404, data: zAgentNotFoundError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
}
|
||||
|
||||
export const get7Errors = {
|
||||
agent_version_not_found_error: { status: 404, data: zAgentVersionNotFoundError },
|
||||
}
|
||||
|
||||
export const post8Errors = {
|
||||
agent_not_found_error: { status: 404, data: zAgentNotFoundError },
|
||||
agent_soul_locked_error: { status: 400, data: zAgentSoulLockedError },
|
||||
agent_version_not_found_error: { status: 404, data: zAgentVersionNotFoundError },
|
||||
invalid_composer_config_error: { status: 400, data: zInvalidComposerConfigError },
|
||||
plaintext_secret_not_allowed_error: { status: 400, data: zPlaintextSecretNotAllowedError },
|
||||
}
|
||||
|
||||
export const get8Errors = {
|
||||
agent_not_found_error: { status: 404, data: zAgentNotFoundError },
|
||||
agent_version_not_found_error: { status: 404, data: zAgentVersionNotFoundError },
|
||||
}
|
||||
|
||||
export const put2Errors = {
|
||||
agent_not_found_error: { status: 404, data: zAgentNotFoundError },
|
||||
agent_soul_locked_error: { status: 400, data: zAgentSoulLockedError },
|
||||
agent_version_not_found_error: { status: 404, data: zAgentVersionNotFoundError },
|
||||
invalid_composer_config_error: { status: 400, data: zInvalidComposerConfigError },
|
||||
plaintext_secret_not_allowed_error: { status: 400, data: zPlaintextSecretNotAllowedError },
|
||||
}
|
||||
|
||||
export const post9Errors = { agent_not_found_error: { status: 404, data: zAgentNotFoundError } }
|
||||
|
||||
export const get9Errors = { agent_not_found_error: { status: 404, data: zAgentNotFoundError } }
|
||||
|
||||
export const get10Errors = { agent_not_found_error: { status: 404, data: zAgentNotFoundError } }
|
||||
|
||||
export const delete3Errors = { agent_not_found_error: { status: 404, data: zAgentNotFoundError } }
|
||||
|
||||
export const get11Errors = { agent_not_found_error: { status: 404, data: zAgentNotFoundError } }
|
||||
|
||||
export const post10Errors = { agent_not_found_error: { status: 404, data: zAgentNotFoundError } }
|
||||
|
||||
export const get12Errors = { agent_not_found_error: { status: 404, data: zAgentNotFoundError } }
|
||||
|
||||
export const post11Errors = { agent_not_found_error: { status: 404, data: zAgentNotFoundError } }
|
||||
|
||||
export const get13Errors = { agent_not_found_error: { status: 404, data: zAgentNotFoundError } }
|
||||
|
||||
export const get14Errors = { agent_not_found_error: { status: 404, data: zAgentNotFoundError } }
|
||||
|
||||
export const get15Errors = { agent_not_found_error: { status: 404, data: zAgentNotFoundError } }
|
||||
|
||||
export const get16Errors = { agent_not_found_error: { status: 404, data: zAgentNotFoundError } }
|
||||
|
||||
export const get17Errors = { agent_not_found_error: { status: 404, data: zAgentNotFoundError } }
|
||||
|
||||
export const delete4Errors = { agent_not_found_error: { status: 404, data: zAgentNotFoundError } }
|
||||
|
||||
export const get18Errors = { agent_not_found_error: { status: 404, data: zAgentNotFoundError } }
|
||||
|
||||
export const post12Errors = {
|
||||
agent_name_conflict_error: { status: 409, data: zAgentNameConflictError },
|
||||
agent_not_found_error: { status: 404, data: zAgentNotFoundError },
|
||||
agent_version_not_found_error: { status: 404, data: zAgentVersionNotFoundError },
|
||||
}
|
||||
|
||||
export const post13Errors = {
|
||||
agent_build_sandbox_not_found: { status: 404, data: zAgentBuildSandboxNotFoundError },
|
||||
agent_not_found_error: { status: 404, data: zAgentNotFoundError },
|
||||
}
|
||||
|
||||
export const post14Errors = { agent_not_found_error: { status: 404, data: zAgentNotFoundError } }
|
||||
|
||||
export const post15Errors = {
|
||||
agent_not_found_error: { status: 404, data: zAgentNotFoundError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
message_feedback_rating_required: { status: 400, data: zMessageFeedbackRatingRequiredError },
|
||||
}
|
||||
|
||||
export const get19Errors = { agent_not_found_error: { status: 404, data: zAgentNotFoundError } }
|
||||
|
||||
export const get20Errors = { agent_not_found_error: { status: 404, data: zAgentNotFoundError } }
|
||||
|
||||
export const get21Errors = { agent_not_found_error: { status: 404, data: zAgentNotFoundError } }
|
||||
|
||||
export const get22Errors = {
|
||||
agent_not_found_error: { status: 404, data: zAgentNotFoundError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
}
|
||||
|
||||
export const post16Errors = {
|
||||
agent_model_not_configured: { status: 400, data: zAgentModelNotConfiguredError },
|
||||
agent_not_found_error: { status: 404, data: zAgentNotFoundError },
|
||||
agent_version_not_found_error: { status: 404, data: zAgentVersionNotFoundError },
|
||||
invalid_composer_config_error: { status: 400, data: zInvalidComposerConfigError },
|
||||
plaintext_secret_not_allowed_error: { status: 400, data: zPlaintextSecretNotAllowedError },
|
||||
}
|
||||
|
||||
export const get23Errors = { agent_not_found_error: { status: 404, data: zAgentNotFoundError } }
|
||||
|
||||
export const post17Errors = {
|
||||
agent_backend_unreachable: { status: 502, data: zAgentBackendUnreachableError },
|
||||
agent_not_found_error: { status: 404, data: zAgentNotFoundError },
|
||||
binding_file_download_unavailable: { status: 502, data: zBindingFileDownloadUnavailableError },
|
||||
inspector_unavailable: { status: 503, data: zInspectorUnavailableError },
|
||||
no_active_binding: { status: 404, data: zNoActiveBindingError },
|
||||
}
|
||||
|
||||
export const get24Errors = {
|
||||
agent_backend_unreachable: { status: 502, data: zAgentBackendUnreachableError },
|
||||
agent_not_found_error: { status: 404, data: zAgentNotFoundError },
|
||||
inspector_unavailable: { status: 503, data: zInspectorUnavailableError },
|
||||
no_active_binding: { status: 404, data: zNoActiveBindingError },
|
||||
}
|
||||
|
||||
export const get25Errors = {
|
||||
agent_backend_unreachable: { status: 502, data: zAgentBackendUnreachableError },
|
||||
agent_not_found_error: { status: 404, data: zAgentNotFoundError },
|
||||
inspector_unavailable: { status: 503, data: zInspectorUnavailableError },
|
||||
no_active_binding: { status: 404, data: zNoActiveBindingError },
|
||||
}
|
||||
|
||||
export const get26Errors = {
|
||||
agent_not_found_error: { status: 404, data: zAgentNotFoundError },
|
||||
no_active_binding: { status: 404, data: zNoActiveBindingError },
|
||||
}
|
||||
|
||||
export const get27Errors = { agent_not_found_error: { status: 404, data: zAgentNotFoundError } }
|
||||
|
||||
export const get28Errors = {
|
||||
agent_not_found_error: { status: 404, data: zAgentNotFoundError },
|
||||
completion_request_error: { status: 400, data: zCompletionRequestError },
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
}
|
||||
|
||||
export const post18Errors = {
|
||||
agent_not_found_error: { status: 404, data: zAgentNotFoundError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
completion_request_error: { status: 400, data: zCompletionRequestError },
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_not_support_text_to_speech: { status: 400, data: zProviderNotSupportTextToSpeechError },
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
}
|
||||
|
||||
export const post19Errors = {
|
||||
invalid_tracing_config: { status: 400, data: zInvalidTracingConfigError },
|
||||
trace_config_not_found: { status: 404, data: zTraceConfigNotFoundError },
|
||||
tracing_config_conflict: { status: 409, data: zTracingConfigConflictError },
|
||||
tracing_config_processing_failed: { status: 500, data: zTracingConfigProcessingFailedError },
|
||||
tracing_provider_unavailable: { status: 400, data: zTracingProviderUnavailableError },
|
||||
unsupported_tracing_provider: { status: 400, data: zUnsupportedTracingProviderError },
|
||||
}
|
||||
|
||||
export const get30Errors = {
|
||||
tracing_provider_unavailable: { status: 400, data: zTracingProviderUnavailableError },
|
||||
unsupported_tracing_provider: { status: 400, data: zUnsupportedTracingProviderError },
|
||||
}
|
||||
|
||||
export const delete5Errors = {
|
||||
app_not_found: { status: 404, data: zAppNotFoundError },
|
||||
trace_config_not_found: { status: 404, data: zTraceConfigNotFoundError },
|
||||
tracing_config_processing_failed: { status: 500, data: zTracingConfigProcessingFailedError },
|
||||
unsupported_tracing_provider: { status: 400, data: zUnsupportedTracingProviderError },
|
||||
}
|
||||
|
||||
export const get31Errors = {
|
||||
app_not_found: { status: 404, data: zAppNotFoundError },
|
||||
tracing_config_processing_failed: { status: 500, data: zTracingConfigProcessingFailedError },
|
||||
tracing_provider_unavailable: { status: 400, data: zTracingProviderUnavailableError },
|
||||
unsupported_tracing_provider: { status: 400, data: zUnsupportedTracingProviderError },
|
||||
}
|
||||
|
||||
export const patchErrors = {
|
||||
app_not_found: { status: 404, data: zAppNotFoundError },
|
||||
invalid_tracing_config: { status: 400, data: zInvalidTracingConfigError },
|
||||
trace_config_not_found: { status: 404, data: zTraceConfigNotFoundError },
|
||||
tracing_config_conflict: { status: 409, data: zTracingConfigConflictError },
|
||||
tracing_config_processing_failed: { status: 500, data: zTracingConfigProcessingFailedError },
|
||||
tracing_config_verification_failed: { status: 400, data: zTracingConfigVerificationFailedError },
|
||||
tracing_provider_unavailable: { status: 400, data: zTracingProviderUnavailableError },
|
||||
unsupported_tracing_provider: { status: 400, data: zUnsupportedTracingProviderError },
|
||||
}
|
||||
|
||||
export const post20Errors = {
|
||||
app_not_found: { status: 404, data: zAppNotFoundError },
|
||||
invalid_tracing_config: { status: 400, data: zInvalidTracingConfigError },
|
||||
trace_config_already_exists: { status: 409, data: zTraceConfigAlreadyExistsError },
|
||||
tracing_config_processing_failed: { status: 500, data: zTracingConfigProcessingFailedError },
|
||||
tracing_config_verification_failed: { status: 400, data: zTracingConfigVerificationFailedError },
|
||||
tracing_provider_unavailable: { status: 400, data: zTracingProviderUnavailableError },
|
||||
unsupported_tracing_provider: { status: 400, data: zUnsupportedTracingProviderError },
|
||||
}
|
||||
|
||||
export const post21Errors = {
|
||||
tracing_already_accepted: { status: 409, data: zTracingAlreadyAcceptedError },
|
||||
tracing_duplicate_acknowledgement_required: {
|
||||
status: 409,
|
||||
data: zTracingDuplicateAcknowledgementRequiredError,
|
||||
},
|
||||
tracing_node_not_found: { status: 404, data: zTracingNodeNotFoundError },
|
||||
tracing_retry_not_allowed: { status: 409, data: zTracingRetryNotAllowedError },
|
||||
tracing_run_not_found: { status: 404, data: zTracingRunNotFoundError },
|
||||
tracing_source_not_found: { status: 404, data: zTracingSourceNotFoundError },
|
||||
}
|
||||
|
||||
export const get32Errors = {
|
||||
tracing_node_not_found: { status: 404, data: zTracingNodeNotFoundError },
|
||||
tracing_source_not_found: { status: 404, data: zTracingSourceNotFoundError },
|
||||
}
|
||||
|
||||
export const post22Errors = {
|
||||
agent_not_found_error: { status: 404, data: zAgentNotFoundError },
|
||||
agent_version_not_found_error: { status: 404, data: zAgentVersionNotFoundError },
|
||||
}
|
||||
|
||||
export const get33Errors = {
|
||||
agent_not_found_error: { status: 404, data: zAgentNotFoundError },
|
||||
agent_version_not_found_error: { status: 404, data: zAgentVersionNotFoundError },
|
||||
}
|
||||
|
||||
export const get34Errors = { agent_not_found_error: { status: 404, data: zAgentNotFoundError } }
|
||||
|
||||
export const delete6Errors = { agent_not_found_error: { status: 404, data: zAgentNotFoundError } }
|
||||
|
||||
export const get35Errors = { agent_not_found_error: { status: 404, data: zAgentNotFoundError } }
|
||||
|
||||
export const put3Errors = {
|
||||
agent_name_conflict_error: { status: 409, data: zAgentNameConflictError },
|
||||
agent_not_found_error: { status: 404, data: zAgentNotFoundError },
|
||||
}
|
||||
|
||||
export const get36Errors = { agent_not_found_error: { status: 404, data: zAgentNotFoundError } }
|
||||
|
||||
export const post23Errors = {
|
||||
agent_name_conflict_error: { status: 409, data: zAgentNameConflictError },
|
||||
agent_not_found_error: { status: 404, data: zAgentNotFoundError },
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
+4574
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
+24
@@ -0,0 +1,24 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { oc } from '@orpc/contract'
|
||||
import * as z from 'zod'
|
||||
import { zGetAllWorkspacesQuery, zGetAllWorkspacesResponse } from './zod.gen.ts'
|
||||
|
||||
export const get = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getAllWorkspaces',
|
||||
path: '/all-workspaces',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ query: zGetAllWorkspacesQuery.optional() }).optional())
|
||||
.output(zGetAllWorkspacesResponse)
|
||||
|
||||
export const allWorkspaces = {
|
||||
get,
|
||||
}
|
||||
|
||||
export const contract = {
|
||||
allWorkspaces,
|
||||
}
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type ClientOptions = {
|
||||
baseUrl: `${string}://${string}/console/api` | (string & {})
|
||||
}
|
||||
|
||||
export type WorkspacePaginationResponse = {
|
||||
data: Array<WorkspaceListItemResponse>
|
||||
has_more: boolean
|
||||
limit: number
|
||||
page: number
|
||||
total: number
|
||||
}
|
||||
|
||||
export type ErrorResponse = {
|
||||
code: string
|
||||
details?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
message: string
|
||||
params?: string
|
||||
status: number
|
||||
}
|
||||
|
||||
export type WorkspaceListItemResponse = {
|
||||
created_at?: number | null
|
||||
id: string
|
||||
name?: string | null
|
||||
status?: string | null
|
||||
}
|
||||
|
||||
export type GetAllWorkspacesData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
limit?: number
|
||||
page?: number
|
||||
}
|
||||
url: '/all-workspaces'
|
||||
}
|
||||
|
||||
export type GetAllWorkspacesErrors = {
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type GetAllWorkspacesError = GetAllWorkspacesErrors[keyof GetAllWorkspacesErrors]
|
||||
|
||||
export type GetAllWorkspacesResponses = {
|
||||
200: WorkspacePaginationResponse
|
||||
}
|
||||
|
||||
export type GetAllWorkspacesResponse = GetAllWorkspacesResponses[keyof GetAllWorkspacesResponses]
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import * as z from 'zod'
|
||||
|
||||
/**
|
||||
* ErrorResponse
|
||||
*
|
||||
* Documented non-2xx body emitted by ``register_external_error_handlers``.
|
||||
*
|
||||
* ``params`` and ``details`` appear only on the errors that set them. The schema
|
||||
* stays open because ``HTTPException.data`` may carry extra keys.
|
||||
*/
|
||||
export const zErrorResponse = z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
})
|
||||
|
||||
/**
|
||||
* WorkspaceListItemResponse
|
||||
*/
|
||||
export const zWorkspaceListItemResponse = z.object({
|
||||
created_at: z.int().nullish(),
|
||||
id: z.string(),
|
||||
name: z.string().nullish(),
|
||||
status: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* WorkspacePaginationResponse
|
||||
*/
|
||||
export const zWorkspacePaginationResponse = z.object({
|
||||
data: z.array(zWorkspaceListItemResponse),
|
||||
has_more: z.boolean(),
|
||||
limit: z.int(),
|
||||
page: z.int(),
|
||||
total: z.int(),
|
||||
})
|
||||
|
||||
export const zGetAllWorkspacesQuery = z.object({
|
||||
limit: z.int().gte(1).lte(100).optional().default(20),
|
||||
page: z.int().gte(1).lte(99999).optional().default(1),
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zGetAllWorkspacesResponse = zWorkspacePaginationResponse
|
||||
+108
@@ -0,0 +1,108 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { oc } from '@orpc/contract'
|
||||
import * as z from 'zod'
|
||||
import {
|
||||
zDeleteApiBasedExtensionByIdPath,
|
||||
zDeleteApiBasedExtensionByIdResponse,
|
||||
zGetApiBasedExtensionByIdPath,
|
||||
zGetApiBasedExtensionByIdResponse,
|
||||
zGetApiBasedExtensionResponse,
|
||||
zPostApiBasedExtensionBody,
|
||||
zPostApiBasedExtensionByIdBody,
|
||||
zPostApiBasedExtensionByIdPath,
|
||||
zPostApiBasedExtensionByIdResponse,
|
||||
zPostApiBasedExtensionResponse,
|
||||
} from './zod.gen.ts'
|
||||
|
||||
/**
|
||||
* Delete API-based extension
|
||||
*/
|
||||
export const delete_ = oc
|
||||
.route({
|
||||
description: 'Delete API-based extension',
|
||||
inputStructure: 'detailed',
|
||||
method: 'DELETE',
|
||||
operationId: 'deleteApiBasedExtensionById',
|
||||
path: '/api-based-extension/{id}',
|
||||
successStatus: 204,
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zDeleteApiBasedExtensionByIdPath }))
|
||||
.output(zDeleteApiBasedExtensionByIdResponse)
|
||||
|
||||
/**
|
||||
* Get API-based extension by ID
|
||||
*/
|
||||
export const get = oc
|
||||
.route({
|
||||
description: 'Get API-based extension by ID',
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getApiBasedExtensionById',
|
||||
path: '/api-based-extension/{id}',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zGetApiBasedExtensionByIdPath }))
|
||||
.output(zGetApiBasedExtensionByIdResponse)
|
||||
|
||||
/**
|
||||
* Update API-based extension
|
||||
*/
|
||||
export const post = oc
|
||||
.route({
|
||||
description: 'Update API-based extension',
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postApiBasedExtensionById',
|
||||
path: '/api-based-extension/{id}',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ body: zPostApiBasedExtensionByIdBody, params: zPostApiBasedExtensionByIdPath }))
|
||||
.output(zPostApiBasedExtensionByIdResponse)
|
||||
|
||||
export const byId = {
|
||||
delete: delete_,
|
||||
get,
|
||||
post,
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all API-based extensions for current tenant
|
||||
*/
|
||||
export const get2 = oc
|
||||
.route({
|
||||
description: 'Get all API-based extensions for current tenant',
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getApiBasedExtension',
|
||||
path: '/api-based-extension',
|
||||
tags: ['console'],
|
||||
})
|
||||
.output(zGetApiBasedExtensionResponse)
|
||||
|
||||
/**
|
||||
* Create a new API-based extension
|
||||
*/
|
||||
export const post2 = oc
|
||||
.route({
|
||||
description: 'Create a new API-based extension',
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postApiBasedExtension',
|
||||
path: '/api-based-extension',
|
||||
successStatus: 201,
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ body: zPostApiBasedExtensionBody }))
|
||||
.output(zPostApiBasedExtensionResponse)
|
||||
|
||||
export const apiBasedExtension = {
|
||||
get: get2,
|
||||
post: post2,
|
||||
byId,
|
||||
}
|
||||
|
||||
export const contract = {
|
||||
apiBasedExtension,
|
||||
}
|
||||
+141
@@ -0,0 +1,141 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type ClientOptions = {
|
||||
baseUrl: `${string}://${string}/console/api` | (string & {})
|
||||
}
|
||||
|
||||
export type ApiBasedExtensionListResponse = Array<ApiBasedExtensionResponse>
|
||||
|
||||
export type ErrorResponse = {
|
||||
code: string
|
||||
details?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
message: string
|
||||
params?: string
|
||||
status: number
|
||||
}
|
||||
|
||||
export type ApiBasedExtensionPayload = {
|
||||
api_endpoint: string
|
||||
api_key: string
|
||||
name: string
|
||||
}
|
||||
|
||||
export type ApiBasedExtensionResponse = {
|
||||
api_endpoint: string
|
||||
api_key: string
|
||||
created_at?: number | null
|
||||
id: string
|
||||
name: string
|
||||
}
|
||||
|
||||
export type GetApiBasedExtensionData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/api-based-extension'
|
||||
}
|
||||
|
||||
export type GetApiBasedExtensionErrors = {
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type GetApiBasedExtensionError = GetApiBasedExtensionErrors[keyof GetApiBasedExtensionErrors]
|
||||
|
||||
export type GetApiBasedExtensionResponses = {
|
||||
200: ApiBasedExtensionListResponse
|
||||
}
|
||||
|
||||
export type GetApiBasedExtensionResponse =
|
||||
GetApiBasedExtensionResponses[keyof GetApiBasedExtensionResponses]
|
||||
|
||||
export type PostApiBasedExtensionData = {
|
||||
body: ApiBasedExtensionPayload
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/api-based-extension'
|
||||
}
|
||||
|
||||
export type PostApiBasedExtensionErrors = {
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type PostApiBasedExtensionError =
|
||||
PostApiBasedExtensionErrors[keyof PostApiBasedExtensionErrors]
|
||||
|
||||
export type PostApiBasedExtensionResponses = {
|
||||
201: ApiBasedExtensionResponse
|
||||
}
|
||||
|
||||
export type PostApiBasedExtensionResponse =
|
||||
PostApiBasedExtensionResponses[keyof PostApiBasedExtensionResponses]
|
||||
|
||||
export type DeleteApiBasedExtensionByIdData = {
|
||||
body?: never
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/api-based-extension/{id}'
|
||||
}
|
||||
|
||||
export type DeleteApiBasedExtensionByIdErrors = {
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type DeleteApiBasedExtensionByIdError =
|
||||
DeleteApiBasedExtensionByIdErrors[keyof DeleteApiBasedExtensionByIdErrors]
|
||||
|
||||
export type DeleteApiBasedExtensionByIdResponses = {
|
||||
204: void
|
||||
}
|
||||
|
||||
export type DeleteApiBasedExtensionByIdResponse =
|
||||
DeleteApiBasedExtensionByIdResponses[keyof DeleteApiBasedExtensionByIdResponses]
|
||||
|
||||
export type GetApiBasedExtensionByIdData = {
|
||||
body?: never
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/api-based-extension/{id}'
|
||||
}
|
||||
|
||||
export type GetApiBasedExtensionByIdErrors = {
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type GetApiBasedExtensionByIdError =
|
||||
GetApiBasedExtensionByIdErrors[keyof GetApiBasedExtensionByIdErrors]
|
||||
|
||||
export type GetApiBasedExtensionByIdResponses = {
|
||||
200: ApiBasedExtensionResponse
|
||||
}
|
||||
|
||||
export type GetApiBasedExtensionByIdResponse =
|
||||
GetApiBasedExtensionByIdResponses[keyof GetApiBasedExtensionByIdResponses]
|
||||
|
||||
export type PostApiBasedExtensionByIdData = {
|
||||
body: ApiBasedExtensionPayload
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/api-based-extension/{id}'
|
||||
}
|
||||
|
||||
export type PostApiBasedExtensionByIdErrors = {
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type PostApiBasedExtensionByIdError =
|
||||
PostApiBasedExtensionByIdErrors[keyof PostApiBasedExtensionByIdErrors]
|
||||
|
||||
export type PostApiBasedExtensionByIdResponses = {
|
||||
200: ApiBasedExtensionResponse
|
||||
}
|
||||
|
||||
export type PostApiBasedExtensionByIdResponse =
|
||||
PostApiBasedExtensionByIdResponses[keyof PostApiBasedExtensionByIdResponses]
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import * as z from 'zod'
|
||||
|
||||
/**
|
||||
* ErrorResponse
|
||||
*
|
||||
* Documented non-2xx body emitted by ``register_external_error_handlers``.
|
||||
*
|
||||
* ``params`` and ``details`` appear only on the errors that set them. The schema
|
||||
* stays open because ``HTTPException.data`` may carry extra keys.
|
||||
*/
|
||||
export const zErrorResponse = z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
})
|
||||
|
||||
/**
|
||||
* APIBasedExtensionPayload
|
||||
*/
|
||||
export const zApiBasedExtensionPayload = z.object({
|
||||
api_endpoint: z.string(),
|
||||
api_key: z.string(),
|
||||
name: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* APIBasedExtensionResponse
|
||||
*/
|
||||
export const zApiBasedExtensionResponse = z.object({
|
||||
api_endpoint: z.string(),
|
||||
api_key: z.string(),
|
||||
created_at: z.int().nullish(),
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* APIBasedExtensionListResponse
|
||||
*/
|
||||
export const zApiBasedExtensionListResponse = z.array(zApiBasedExtensionResponse)
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zGetApiBasedExtensionResponse = zApiBasedExtensionListResponse
|
||||
|
||||
export const zPostApiBasedExtensionBody = zApiBasedExtensionPayload
|
||||
|
||||
/**
|
||||
* Extension created successfully
|
||||
*/
|
||||
export const zPostApiBasedExtensionResponse = zApiBasedExtensionResponse
|
||||
|
||||
export const zDeleteApiBasedExtensionByIdPath = z.object({
|
||||
id: z.uuid(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Extension deleted successfully
|
||||
*/
|
||||
export const zDeleteApiBasedExtensionByIdResponse = z.void()
|
||||
|
||||
export const zGetApiBasedExtensionByIdPath = z.object({
|
||||
id: z.uuid(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zGetApiBasedExtensionByIdResponse = zApiBasedExtensionResponse
|
||||
|
||||
export const zPostApiBasedExtensionByIdBody = zApiBasedExtensionPayload
|
||||
|
||||
export const zPostApiBasedExtensionByIdPath = z.object({
|
||||
id: z.uuid(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Extension updated successfully
|
||||
*/
|
||||
export const zPostApiBasedExtensionByIdResponse = zApiBasedExtensionResponse
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
// This file is auto-generated by scripts/add-orpc-error-maps.ts
|
||||
import * as z from 'zod'
|
||||
|
||||
const zErrorResponse = /* @__PURE__ */ (() =>
|
||||
z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
}))()
|
||||
|
||||
const zUnsupportedDataSourceApiKeyAuthProviderError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('unsupported_data_source_api_key_auth_provider'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zDataSourceApiKeyAuthProviderUnavailableError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('data_source_api_key_auth_provider_unavailable'),
|
||||
status: z.literal(502),
|
||||
}),
|
||||
))()
|
||||
|
||||
export const postErrors = {
|
||||
data_source_api_key_auth_provider_unavailable: {
|
||||
status: 502,
|
||||
data: zDataSourceApiKeyAuthProviderUnavailableError,
|
||||
},
|
||||
unsupported_data_source_api_key_auth_provider: {
|
||||
status: 400,
|
||||
data: zUnsupportedDataSourceApiKeyAuthProviderError,
|
||||
},
|
||||
}
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { oc } from '@orpc/contract'
|
||||
import * as z from 'zod'
|
||||
import {
|
||||
zDataSourceApiKeyAuthProviderUnavailableError,
|
||||
zUnsupportedDataSourceApiKeyAuthProviderError,
|
||||
} from './zod.gen.ts'
|
||||
import {
|
||||
zDeleteApiKeyAuthDataSourceByBindingIdPath,
|
||||
zDeleteApiKeyAuthDataSourceByBindingIdResponse,
|
||||
zGetApiKeyAuthDataSourceResponse,
|
||||
zPostApiKeyAuthDataSourceBindingBody,
|
||||
zPostApiKeyAuthDataSourceBindingResponse,
|
||||
} from './zod.gen.ts'
|
||||
|
||||
export const post = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postApiKeyAuthDataSourceBinding',
|
||||
path: '/api-key-auth/data-source/binding',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ body: zPostApiKeyAuthDataSourceBindingBody }))
|
||||
.output(zPostApiKeyAuthDataSourceBindingResponse)
|
||||
.errors({
|
||||
data_source_api_key_auth_provider_unavailable: {
|
||||
status: 502,
|
||||
data: zDataSourceApiKeyAuthProviderUnavailableError,
|
||||
},
|
||||
unsupported_data_source_api_key_auth_provider: {
|
||||
status: 400,
|
||||
data: zUnsupportedDataSourceApiKeyAuthProviderError,
|
||||
},
|
||||
})
|
||||
|
||||
export const binding = {
|
||||
post,
|
||||
}
|
||||
|
||||
export const delete_ = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'DELETE',
|
||||
operationId: 'deleteApiKeyAuthDataSourceByBindingId',
|
||||
path: '/api-key-auth/data-source/{binding_id}',
|
||||
successStatus: 204,
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zDeleteApiKeyAuthDataSourceByBindingIdPath }))
|
||||
.output(zDeleteApiKeyAuthDataSourceByBindingIdResponse)
|
||||
|
||||
export const byBindingId = {
|
||||
delete: delete_,
|
||||
}
|
||||
|
||||
export const get = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getApiKeyAuthDataSource',
|
||||
path: '/api-key-auth/data-source',
|
||||
tags: ['console'],
|
||||
})
|
||||
.output(zGetApiKeyAuthDataSourceResponse)
|
||||
|
||||
export const dataSource = {
|
||||
get,
|
||||
binding,
|
||||
byBindingId,
|
||||
}
|
||||
|
||||
export const apiKeyAuth = {
|
||||
dataSource,
|
||||
}
|
||||
|
||||
export const contract = {
|
||||
apiKeyAuth,
|
||||
}
|
||||
+125
@@ -0,0 +1,125 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type ClientOptions = {
|
||||
baseUrl: `${string}://${string}/console/api` | (string & {})
|
||||
}
|
||||
|
||||
export type ApiKeyAuthDataSourceListResponse = {
|
||||
sources: Array<ApiKeyAuthDataSourceItem>
|
||||
}
|
||||
|
||||
export type ErrorResponse = {
|
||||
code: string
|
||||
details?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
message: string
|
||||
params?: string
|
||||
status: number
|
||||
}
|
||||
|
||||
export type ApiKeyAuthBindingPayload = {
|
||||
category: string
|
||||
credentials: ApiKeyAuthCredentialsPayload
|
||||
provider: string
|
||||
}
|
||||
|
||||
export type SimpleResultResponse = {
|
||||
result: string
|
||||
}
|
||||
|
||||
export type UnsupportedDataSourceApiKeyAuthProviderError = ErrorResponse & {
|
||||
code: 'unsupported_data_source_api_key_auth_provider'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type DataSourceApiKeyAuthProviderUnavailableError = ErrorResponse & {
|
||||
code: 'data_source_api_key_auth_provider_unavailable'
|
||||
status: 502
|
||||
}
|
||||
|
||||
export type ApiKeyAuthDataSourceItem = {
|
||||
category: string
|
||||
created_at: number
|
||||
disabled: boolean
|
||||
id: string
|
||||
provider: string
|
||||
updated_at: number
|
||||
}
|
||||
|
||||
export type ApiKeyAuthCredentialsPayload = {
|
||||
auth_type: string
|
||||
config: ApiKeyAuthConfigPayload
|
||||
}
|
||||
|
||||
export type ApiKeyAuthConfigPayload = {
|
||||
api_key: string
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
export type GetApiKeyAuthDataSourceData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/api-key-auth/data-source'
|
||||
}
|
||||
|
||||
export type GetApiKeyAuthDataSourceErrors = {
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type GetApiKeyAuthDataSourceError =
|
||||
GetApiKeyAuthDataSourceErrors[keyof GetApiKeyAuthDataSourceErrors]
|
||||
|
||||
export type GetApiKeyAuthDataSourceResponses = {
|
||||
200: ApiKeyAuthDataSourceListResponse
|
||||
}
|
||||
|
||||
export type GetApiKeyAuthDataSourceResponse =
|
||||
GetApiKeyAuthDataSourceResponses[keyof GetApiKeyAuthDataSourceResponses]
|
||||
|
||||
export type PostApiKeyAuthDataSourceBindingData = {
|
||||
body: ApiKeyAuthBindingPayload
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/api-key-auth/data-source/binding'
|
||||
}
|
||||
|
||||
export type PostApiKeyAuthDataSourceBindingErrors = {
|
||||
400: UnsupportedDataSourceApiKeyAuthProviderError | ErrorResponse
|
||||
502: DataSourceApiKeyAuthProviderUnavailableError | ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type PostApiKeyAuthDataSourceBindingError =
|
||||
PostApiKeyAuthDataSourceBindingErrors[keyof PostApiKeyAuthDataSourceBindingErrors]
|
||||
|
||||
export type PostApiKeyAuthDataSourceBindingResponses = {
|
||||
200: SimpleResultResponse
|
||||
}
|
||||
|
||||
export type PostApiKeyAuthDataSourceBindingResponse =
|
||||
PostApiKeyAuthDataSourceBindingResponses[keyof PostApiKeyAuthDataSourceBindingResponses]
|
||||
|
||||
export type DeleteApiKeyAuthDataSourceByBindingIdData = {
|
||||
body?: never
|
||||
path: {
|
||||
binding_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/api-key-auth/data-source/{binding_id}'
|
||||
}
|
||||
|
||||
export type DeleteApiKeyAuthDataSourceByBindingIdErrors = {
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type DeleteApiKeyAuthDataSourceByBindingIdError =
|
||||
DeleteApiKeyAuthDataSourceByBindingIdErrors[keyof DeleteApiKeyAuthDataSourceByBindingIdErrors]
|
||||
|
||||
export type DeleteApiKeyAuthDataSourceByBindingIdResponses = {
|
||||
204: void
|
||||
}
|
||||
|
||||
export type DeleteApiKeyAuthDataSourceByBindingIdResponse =
|
||||
DeleteApiKeyAuthDataSourceByBindingIdResponses[keyof DeleteApiKeyAuthDataSourceByBindingIdResponses]
|
||||
+114
@@ -0,0 +1,114 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import * as z from 'zod'
|
||||
|
||||
/**
|
||||
* ErrorResponse
|
||||
*
|
||||
* Documented non-2xx body emitted by ``register_external_error_handlers``.
|
||||
*
|
||||
* ``params`` and ``details`` appear only on the errors that set them. The schema
|
||||
* stays open because ``HTTPException.data`` may carry extra keys.
|
||||
*/
|
||||
export const zErrorResponse = z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
})
|
||||
|
||||
/**
|
||||
* SimpleResultResponse
|
||||
*/
|
||||
export const zSimpleResultResponse = z.object({
|
||||
result: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* UnsupportedDataSourceApiKeyAuthProviderError
|
||||
*
|
||||
* The data-source API-key authentication provider is not supported.
|
||||
*/
|
||||
export const zUnsupportedDataSourceApiKeyAuthProviderError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('unsupported_data_source_api_key_auth_provider'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* DataSourceApiKeyAuthProviderUnavailableError
|
||||
*
|
||||
* The data-source API-key authentication provider is temporarily unavailable.
|
||||
*/
|
||||
export const zDataSourceApiKeyAuthProviderUnavailableError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('data_source_api_key_auth_provider_unavailable'),
|
||||
status: z.literal(502),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* ApiKeyAuthDataSourceItem
|
||||
*/
|
||||
export const zApiKeyAuthDataSourceItem = z.object({
|
||||
category: z.string(),
|
||||
created_at: z.int(),
|
||||
disabled: z.boolean(),
|
||||
id: z.string(),
|
||||
provider: z.string(),
|
||||
updated_at: z.int(),
|
||||
})
|
||||
|
||||
/**
|
||||
* ApiKeyAuthDataSourceListResponse
|
||||
*/
|
||||
export const zApiKeyAuthDataSourceListResponse = z.object({
|
||||
sources: z.array(zApiKeyAuthDataSourceItem),
|
||||
})
|
||||
|
||||
/**
|
||||
* ApiKeyAuthConfigPayload
|
||||
*/
|
||||
export const zApiKeyAuthConfigPayload = z.object({
|
||||
api_key: z.string().min(1),
|
||||
})
|
||||
|
||||
/**
|
||||
* ApiKeyAuthCredentialsPayload
|
||||
*/
|
||||
export const zApiKeyAuthCredentialsPayload = z.object({
|
||||
auth_type: z.string().min(1),
|
||||
config: zApiKeyAuthConfigPayload,
|
||||
})
|
||||
|
||||
/**
|
||||
* ApiKeyAuthBindingPayload
|
||||
*/
|
||||
export const zApiKeyAuthBindingPayload = z.object({
|
||||
category: z.string().min(1),
|
||||
credentials: zApiKeyAuthCredentialsPayload,
|
||||
provider: z.string().min(1),
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zGetApiKeyAuthDataSourceResponse = zApiKeyAuthDataSourceListResponse
|
||||
|
||||
export const zPostApiKeyAuthDataSourceBindingBody = zApiKeyAuthBindingPayload
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zPostApiKeyAuthDataSourceBindingResponse = zSimpleResultResponse
|
||||
|
||||
export const zDeleteApiKeyAuthDataSourceByBindingIdPath = z.object({
|
||||
binding_id: z.uuid(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Binding deleted successfully
|
||||
*/
|
||||
export const zDeleteApiKeyAuthDataSourceByBindingIdResponse = z.void()
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { oc } from '@orpc/contract'
|
||||
import { zGetAppDslVersionResponse } from './zod.gen.ts'
|
||||
|
||||
/**
|
||||
* Get current app DSL version for workflow clipboard compatibility
|
||||
*
|
||||
* Get current app DSL version
|
||||
*/
|
||||
export const get = oc
|
||||
.route({
|
||||
description: 'Get current app DSL version',
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getAppDslVersion',
|
||||
path: '/app-dsl-version',
|
||||
summary: 'Get current app DSL version for workflow clipboard compatibility',
|
||||
tags: ['console'],
|
||||
})
|
||||
.output(zGetAppDslVersionResponse)
|
||||
|
||||
export const appDslVersion = {
|
||||
get,
|
||||
}
|
||||
|
||||
export const contract = {
|
||||
appDslVersion,
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type ClientOptions = {
|
||||
baseUrl: `${string}://${string}/console/api` | (string & {})
|
||||
}
|
||||
|
||||
export type AppDslVersionResponse = {
|
||||
app_dsl_version: string
|
||||
}
|
||||
|
||||
export type ErrorResponse = {
|
||||
code: string
|
||||
details?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
message: string
|
||||
params?: string
|
||||
status: number
|
||||
}
|
||||
|
||||
export type GetAppDslVersionData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/app-dsl-version'
|
||||
}
|
||||
|
||||
export type GetAppDslVersionErrors = {
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type GetAppDslVersionError = GetAppDslVersionErrors[keyof GetAppDslVersionErrors]
|
||||
|
||||
export type GetAppDslVersionResponses = {
|
||||
200: AppDslVersionResponse
|
||||
}
|
||||
|
||||
export type GetAppDslVersionResponse = GetAppDslVersionResponses[keyof GetAppDslVersionResponses]
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import * as z from 'zod'
|
||||
|
||||
/**
|
||||
* AppDslVersionResponse
|
||||
*/
|
||||
export const zAppDslVersionResponse = z.object({
|
||||
app_dsl_version: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* ErrorResponse
|
||||
*
|
||||
* Documented non-2xx body emitted by ``register_external_error_handlers``.
|
||||
*
|
||||
* ``params`` and ``details`` appear only on the errors that set them. The schema
|
||||
* stays open because ``HTTPException.data`` may carry extra keys.
|
||||
*/
|
||||
export const zErrorResponse = z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zGetAppDslVersionResponse = zAppDslVersionResponse
|
||||
@@ -0,0 +1,32 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { oc } from '@orpc/contract'
|
||||
import * as z from 'zod'
|
||||
import { zGetAppPromptTemplatesQuery, zGetAppPromptTemplatesResponse } from './zod.gen.ts'
|
||||
|
||||
/**
|
||||
* Get advanced prompt templates based on app mode and model configuration
|
||||
*/
|
||||
export const get = oc
|
||||
.route({
|
||||
description: 'Get advanced prompt templates based on app mode and model configuration',
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getAppPromptTemplates',
|
||||
path: '/app/prompt-templates',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ query: zGetAppPromptTemplatesQuery }))
|
||||
.output(zGetAppPromptTemplatesResponse)
|
||||
|
||||
export const promptTemplates = {
|
||||
get,
|
||||
}
|
||||
|
||||
export const app = {
|
||||
promptTemplates,
|
||||
}
|
||||
|
||||
export const contract = {
|
||||
app,
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type ClientOptions = {
|
||||
baseUrl: `${string}://${string}/console/api` | (string & {})
|
||||
}
|
||||
|
||||
export type AdvancedPromptTemplateResponse = {
|
||||
chat_prompt_config?: ChatPromptTemplateResponse | null
|
||||
completion_prompt_config?: CompletionPromptTemplateResponse | null
|
||||
stop?: Array<string> | null
|
||||
}
|
||||
|
||||
export type ErrorResponse = {
|
||||
code: string
|
||||
details?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
message: string
|
||||
params?: string
|
||||
status: number
|
||||
}
|
||||
|
||||
export type ChatPromptTemplateResponse = {
|
||||
prompt: Array<PromptTemplateMessageResponse>
|
||||
}
|
||||
|
||||
export type CompletionPromptTemplateResponse = {
|
||||
conversation_histories_role?: ConversationHistoriesRoleResponse | null
|
||||
prompt: CompletionPromptTemplateTextResponse
|
||||
}
|
||||
|
||||
export type PromptTemplateMessageResponse = {
|
||||
role: 'assistant' | 'system' | 'user'
|
||||
text: string
|
||||
}
|
||||
|
||||
export type ConversationHistoriesRoleResponse = {
|
||||
assistant_prefix: string
|
||||
user_prefix: string
|
||||
}
|
||||
|
||||
export type CompletionPromptTemplateTextResponse = {
|
||||
text: string
|
||||
}
|
||||
|
||||
export type GetAppPromptTemplatesData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query: {
|
||||
app_mode: string
|
||||
has_context?: string
|
||||
model_mode: string
|
||||
model_name: string
|
||||
}
|
||||
url: '/app/prompt-templates'
|
||||
}
|
||||
|
||||
export type GetAppPromptTemplatesErrors = {
|
||||
400: ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type GetAppPromptTemplatesError =
|
||||
GetAppPromptTemplatesErrors[keyof GetAppPromptTemplatesErrors]
|
||||
|
||||
export type GetAppPromptTemplatesResponses = {
|
||||
200: AdvancedPromptTemplateResponse
|
||||
}
|
||||
|
||||
export type GetAppPromptTemplatesResponse =
|
||||
GetAppPromptTemplatesResponses[keyof GetAppPromptTemplatesResponses]
|
||||
@@ -0,0 +1,78 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import * as z from 'zod'
|
||||
|
||||
/**
|
||||
* ErrorResponse
|
||||
*
|
||||
* Documented non-2xx body emitted by ``register_external_error_handlers``.
|
||||
*
|
||||
* ``params`` and ``details`` appear only on the errors that set them. The schema
|
||||
* stays open because ``HTTPException.data`` may carry extra keys.
|
||||
*/
|
||||
export const zErrorResponse = z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
})
|
||||
|
||||
/**
|
||||
* PromptTemplateMessageResponse
|
||||
*/
|
||||
export const zPromptTemplateMessageResponse = z.object({
|
||||
role: z.enum(['assistant', 'system', 'user']),
|
||||
text: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* ChatPromptTemplateResponse
|
||||
*/
|
||||
export const zChatPromptTemplateResponse = z.object({
|
||||
prompt: z.array(zPromptTemplateMessageResponse),
|
||||
})
|
||||
|
||||
/**
|
||||
* ConversationHistoriesRoleResponse
|
||||
*/
|
||||
export const zConversationHistoriesRoleResponse = z.object({
|
||||
assistant_prefix: z.string(),
|
||||
user_prefix: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* CompletionPromptTemplateTextResponse
|
||||
*/
|
||||
export const zCompletionPromptTemplateTextResponse = z.object({
|
||||
text: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* CompletionPromptTemplateResponse
|
||||
*/
|
||||
export const zCompletionPromptTemplateResponse = z.object({
|
||||
conversation_histories_role: zConversationHistoriesRoleResponse.nullish(),
|
||||
prompt: zCompletionPromptTemplateTextResponse,
|
||||
})
|
||||
|
||||
/**
|
||||
* AdvancedPromptTemplateResponse
|
||||
*/
|
||||
export const zAdvancedPromptTemplateResponse = z.object({
|
||||
chat_prompt_config: zChatPromptTemplateResponse.nullish(),
|
||||
completion_prompt_config: zCompletionPromptTemplateResponse.nullish(),
|
||||
stop: z.array(z.string()).nullish(),
|
||||
})
|
||||
|
||||
export const zGetAppPromptTemplatesQuery = z.object({
|
||||
app_mode: z.string(),
|
||||
has_context: z.string().optional().default('true'),
|
||||
model_mode: z.string(),
|
||||
model_name: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Prompt templates retrieved successfully
|
||||
*/
|
||||
export const zGetAppPromptTemplatesResponse = zAdvancedPromptTemplateResponse
|
||||
+1259
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,226 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { oc } from '@orpc/contract'
|
||||
import * as z from 'zod'
|
||||
import {
|
||||
zDeleteAuthPluginDatasourceByProviderIdCustomClientPath,
|
||||
zDeleteAuthPluginDatasourceByProviderIdCustomClientResponse,
|
||||
zGetAuthPluginDatasourceByProviderIdPath,
|
||||
zGetAuthPluginDatasourceByProviderIdResponse,
|
||||
zGetAuthPluginDatasourceDefaultListResponse,
|
||||
zGetAuthPluginDatasourceListResponse,
|
||||
zPostAuthPluginDatasourceByProviderIdBody,
|
||||
zPostAuthPluginDatasourceByProviderIdCustomClientBody,
|
||||
zPostAuthPluginDatasourceByProviderIdCustomClientPath,
|
||||
zPostAuthPluginDatasourceByProviderIdCustomClientResponse,
|
||||
zPostAuthPluginDatasourceByProviderIdDefaultBody,
|
||||
zPostAuthPluginDatasourceByProviderIdDefaultPath,
|
||||
zPostAuthPluginDatasourceByProviderIdDefaultResponse,
|
||||
zPostAuthPluginDatasourceByProviderIdDeleteBody,
|
||||
zPostAuthPluginDatasourceByProviderIdDeletePath,
|
||||
zPostAuthPluginDatasourceByProviderIdDeleteResponse,
|
||||
zPostAuthPluginDatasourceByProviderIdPath,
|
||||
zPostAuthPluginDatasourceByProviderIdResponse,
|
||||
zPostAuthPluginDatasourceByProviderIdUpdateBody,
|
||||
zPostAuthPluginDatasourceByProviderIdUpdateNameBody,
|
||||
zPostAuthPluginDatasourceByProviderIdUpdateNamePath,
|
||||
zPostAuthPluginDatasourceByProviderIdUpdateNameResponse,
|
||||
zPostAuthPluginDatasourceByProviderIdUpdatePath,
|
||||
zPostAuthPluginDatasourceByProviderIdUpdateResponse,
|
||||
} from './zod.gen.ts'
|
||||
|
||||
export const get = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getAuthPluginDatasourceDefaultList',
|
||||
path: '/auth/plugin/datasource/default-list',
|
||||
tags: ['console'],
|
||||
})
|
||||
.output(zGetAuthPluginDatasourceDefaultListResponse)
|
||||
|
||||
export const defaultList = {
|
||||
get,
|
||||
}
|
||||
|
||||
export const get2 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getAuthPluginDatasourceList',
|
||||
path: '/auth/plugin/datasource/list',
|
||||
tags: ['console'],
|
||||
})
|
||||
.output(zGetAuthPluginDatasourceListResponse)
|
||||
|
||||
export const list = {
|
||||
get: get2,
|
||||
}
|
||||
|
||||
export const delete_ = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'DELETE',
|
||||
operationId: 'deleteAuthPluginDatasourceByProviderIdCustomClient',
|
||||
path: '/auth/plugin/datasource/{provider_id}/custom-client',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zDeleteAuthPluginDatasourceByProviderIdCustomClientPath }))
|
||||
.output(zDeleteAuthPluginDatasourceByProviderIdCustomClientResponse)
|
||||
|
||||
export const post = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postAuthPluginDatasourceByProviderIdCustomClient',
|
||||
path: '/auth/plugin/datasource/{provider_id}/custom-client',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
body: zPostAuthPluginDatasourceByProviderIdCustomClientBody,
|
||||
params: zPostAuthPluginDatasourceByProviderIdCustomClientPath,
|
||||
}),
|
||||
)
|
||||
.output(zPostAuthPluginDatasourceByProviderIdCustomClientResponse)
|
||||
|
||||
export const customClient = {
|
||||
delete: delete_,
|
||||
post,
|
||||
}
|
||||
|
||||
export const post2 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postAuthPluginDatasourceByProviderIdDefault',
|
||||
path: '/auth/plugin/datasource/{provider_id}/default',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
body: zPostAuthPluginDatasourceByProviderIdDefaultBody,
|
||||
params: zPostAuthPluginDatasourceByProviderIdDefaultPath,
|
||||
}),
|
||||
)
|
||||
.output(zPostAuthPluginDatasourceByProviderIdDefaultResponse)
|
||||
|
||||
export const default_ = {
|
||||
post: post2,
|
||||
}
|
||||
|
||||
export const post3 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postAuthPluginDatasourceByProviderIdDelete',
|
||||
path: '/auth/plugin/datasource/{provider_id}/delete',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
body: zPostAuthPluginDatasourceByProviderIdDeleteBody,
|
||||
params: zPostAuthPluginDatasourceByProviderIdDeletePath,
|
||||
}),
|
||||
)
|
||||
.output(zPostAuthPluginDatasourceByProviderIdDeleteResponse)
|
||||
|
||||
export const delete2 = {
|
||||
post: post3,
|
||||
}
|
||||
|
||||
export const post4 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postAuthPluginDatasourceByProviderIdUpdate',
|
||||
path: '/auth/plugin/datasource/{provider_id}/update',
|
||||
successStatus: 201,
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
body: zPostAuthPluginDatasourceByProviderIdUpdateBody,
|
||||
params: zPostAuthPluginDatasourceByProviderIdUpdatePath,
|
||||
}),
|
||||
)
|
||||
.output(zPostAuthPluginDatasourceByProviderIdUpdateResponse)
|
||||
|
||||
export const update = {
|
||||
post: post4,
|
||||
}
|
||||
|
||||
export const post5 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postAuthPluginDatasourceByProviderIdUpdateName',
|
||||
path: '/auth/plugin/datasource/{provider_id}/update-name',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
body: zPostAuthPluginDatasourceByProviderIdUpdateNameBody,
|
||||
params: zPostAuthPluginDatasourceByProviderIdUpdateNamePath,
|
||||
}),
|
||||
)
|
||||
.output(zPostAuthPluginDatasourceByProviderIdUpdateNameResponse)
|
||||
|
||||
export const updateName = {
|
||||
post: post5,
|
||||
}
|
||||
|
||||
export const get3 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getAuthPluginDatasourceByProviderId',
|
||||
path: '/auth/plugin/datasource/{provider_id}',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zGetAuthPluginDatasourceByProviderIdPath }))
|
||||
.output(zGetAuthPluginDatasourceByProviderIdResponse)
|
||||
|
||||
export const post6 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postAuthPluginDatasourceByProviderId',
|
||||
path: '/auth/plugin/datasource/{provider_id}',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
body: zPostAuthPluginDatasourceByProviderIdBody,
|
||||
params: zPostAuthPluginDatasourceByProviderIdPath,
|
||||
}),
|
||||
)
|
||||
.output(zPostAuthPluginDatasourceByProviderIdResponse)
|
||||
|
||||
export const byProviderId = {
|
||||
get: get3,
|
||||
post: post6,
|
||||
customClient,
|
||||
default: default_,
|
||||
delete: delete2,
|
||||
update,
|
||||
updateName,
|
||||
}
|
||||
|
||||
export const datasource = {
|
||||
defaultList,
|
||||
list,
|
||||
byProviderId,
|
||||
}
|
||||
|
||||
export const plugin = {
|
||||
datasource,
|
||||
}
|
||||
|
||||
export const auth = {
|
||||
plugin,
|
||||
}
|
||||
|
||||
export const contract = {
|
||||
auth,
|
||||
}
|
||||
@@ -0,0 +1,372 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type ClientOptions = {
|
||||
baseUrl: `${string}://${string}/console/api` | (string & {})
|
||||
}
|
||||
|
||||
export type DatasourceProviderAuthListResponse = {
|
||||
result: Array<DatasourceProviderAuthResponse>
|
||||
}
|
||||
|
||||
export type ErrorResponse = {
|
||||
code: string
|
||||
details?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
message: string
|
||||
params?: string
|
||||
status: number
|
||||
}
|
||||
|
||||
export type DatasourceCredentialListResponse = {
|
||||
result: Array<DatasourceCredentialResponse>
|
||||
}
|
||||
|
||||
export type DatasourceCredentialPayload = {
|
||||
credentials: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
name?: string | null
|
||||
}
|
||||
|
||||
export type SimpleResultResponse = {
|
||||
result: string
|
||||
}
|
||||
|
||||
export type DatasourceCustomClientPayload = {
|
||||
client_params?: {
|
||||
[key: string]: unknown
|
||||
} | null
|
||||
enable_oauth_custom_client?: boolean | null
|
||||
}
|
||||
|
||||
export type DatasourceDefaultPayload = {
|
||||
id: string
|
||||
}
|
||||
|
||||
export type DatasourceCredentialDeletePayload = {
|
||||
credential_id: string
|
||||
}
|
||||
|
||||
export type DatasourceCredentialUpdatePayload = {
|
||||
credential_id: string
|
||||
credentials?: {
|
||||
[key: string]: unknown
|
||||
} | null
|
||||
name?: string | null
|
||||
}
|
||||
|
||||
export type DatasourceUpdateNamePayload = {
|
||||
credential_id: string
|
||||
name: string
|
||||
}
|
||||
|
||||
export type DatasourceProviderAuthResponse = {
|
||||
author: string
|
||||
credential_schema: Array<ProviderConfig>
|
||||
credentials_list: Array<DatasourceCredentialResponse>
|
||||
description: I18nObject
|
||||
icon: string
|
||||
label: I18nObject
|
||||
name: string
|
||||
oauth_schema: DatasourceOAuthSchemaResponse | null
|
||||
plugin_id: string
|
||||
plugin_unique_identifier: string
|
||||
provider: string
|
||||
}
|
||||
|
||||
export type DatasourceCredentialResponse = {
|
||||
avatar_url: string | null
|
||||
credential: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
id: string
|
||||
is_default: boolean
|
||||
name: string
|
||||
type: string
|
||||
}
|
||||
|
||||
export type ProviderConfig = {
|
||||
default?: number | string | number | boolean | null
|
||||
help?: I18nObject | null
|
||||
label?: I18nObject | null
|
||||
multiple?: boolean
|
||||
name: string
|
||||
options?: Array<Option> | null
|
||||
placeholder?: I18nObject | null
|
||||
required?: boolean
|
||||
scope?: AppSelectorScope | ModelSelectorScope | ToolSelectorScope | null
|
||||
type: ProviderConfigType
|
||||
url?: string | null
|
||||
}
|
||||
|
||||
export type I18nObject = {
|
||||
en_US: string
|
||||
ja_JP?: string | null
|
||||
pt_BR?: string | null
|
||||
zh_Hans?: string | null
|
||||
}
|
||||
|
||||
export type DatasourceOAuthSchemaResponse = {
|
||||
client_schema: Array<ProviderConfig>
|
||||
credentials_schema: Array<ProviderConfig>
|
||||
is_oauth_custom_client_enabled: boolean
|
||||
is_system_oauth_params_exists: boolean
|
||||
oauth_custom_client_params: {
|
||||
[key: string]: unknown
|
||||
} | null
|
||||
redirect_uri: string
|
||||
}
|
||||
|
||||
export type Option = {
|
||||
label: I18nObject
|
||||
value: string
|
||||
}
|
||||
|
||||
export type AppSelectorScope = 'all' | 'chat' | 'completion' | 'workflow'
|
||||
|
||||
export type ModelSelectorScope =
|
||||
| 'llm'
|
||||
| 'moderation'
|
||||
| 'rerank'
|
||||
| 'speech2text'
|
||||
| 'text-embedding'
|
||||
| 'tts'
|
||||
| 'vision'
|
||||
|
||||
export type ToolSelectorScope = 'all' | 'builtin' | 'custom' | 'workflow'
|
||||
|
||||
export type ProviderConfigType =
|
||||
| 'app-selector'
|
||||
| 'array[tools]'
|
||||
| 'boolean'
|
||||
| 'model-selector'
|
||||
| 'secret-input'
|
||||
| 'select'
|
||||
| 'text-input'
|
||||
|
||||
export type GetAuthPluginDatasourceDefaultListData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/auth/plugin/datasource/default-list'
|
||||
}
|
||||
|
||||
export type GetAuthPluginDatasourceDefaultListErrors = {
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type GetAuthPluginDatasourceDefaultListError =
|
||||
GetAuthPluginDatasourceDefaultListErrors[keyof GetAuthPluginDatasourceDefaultListErrors]
|
||||
|
||||
export type GetAuthPluginDatasourceDefaultListResponses = {
|
||||
200: DatasourceProviderAuthListResponse
|
||||
}
|
||||
|
||||
export type GetAuthPluginDatasourceDefaultListResponse =
|
||||
GetAuthPluginDatasourceDefaultListResponses[keyof GetAuthPluginDatasourceDefaultListResponses]
|
||||
|
||||
export type GetAuthPluginDatasourceListData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/auth/plugin/datasource/list'
|
||||
}
|
||||
|
||||
export type GetAuthPluginDatasourceListErrors = {
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type GetAuthPluginDatasourceListError =
|
||||
GetAuthPluginDatasourceListErrors[keyof GetAuthPluginDatasourceListErrors]
|
||||
|
||||
export type GetAuthPluginDatasourceListResponses = {
|
||||
200: DatasourceProviderAuthListResponse
|
||||
}
|
||||
|
||||
export type GetAuthPluginDatasourceListResponse =
|
||||
GetAuthPluginDatasourceListResponses[keyof GetAuthPluginDatasourceListResponses]
|
||||
|
||||
export type GetAuthPluginDatasourceByProviderIdData = {
|
||||
body?: never
|
||||
path: {
|
||||
provider_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/auth/plugin/datasource/{provider_id}'
|
||||
}
|
||||
|
||||
export type GetAuthPluginDatasourceByProviderIdErrors = {
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type GetAuthPluginDatasourceByProviderIdError =
|
||||
GetAuthPluginDatasourceByProviderIdErrors[keyof GetAuthPluginDatasourceByProviderIdErrors]
|
||||
|
||||
export type GetAuthPluginDatasourceByProviderIdResponses = {
|
||||
200: DatasourceCredentialListResponse
|
||||
}
|
||||
|
||||
export type GetAuthPluginDatasourceByProviderIdResponse =
|
||||
GetAuthPluginDatasourceByProviderIdResponses[keyof GetAuthPluginDatasourceByProviderIdResponses]
|
||||
|
||||
export type PostAuthPluginDatasourceByProviderIdData = {
|
||||
body: DatasourceCredentialPayload
|
||||
path: {
|
||||
provider_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/auth/plugin/datasource/{provider_id}'
|
||||
}
|
||||
|
||||
export type PostAuthPluginDatasourceByProviderIdErrors = {
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type PostAuthPluginDatasourceByProviderIdError =
|
||||
PostAuthPluginDatasourceByProviderIdErrors[keyof PostAuthPluginDatasourceByProviderIdErrors]
|
||||
|
||||
export type PostAuthPluginDatasourceByProviderIdResponses = {
|
||||
200: SimpleResultResponse
|
||||
}
|
||||
|
||||
export type PostAuthPluginDatasourceByProviderIdResponse =
|
||||
PostAuthPluginDatasourceByProviderIdResponses[keyof PostAuthPluginDatasourceByProviderIdResponses]
|
||||
|
||||
export type DeleteAuthPluginDatasourceByProviderIdCustomClientData = {
|
||||
body?: never
|
||||
path: {
|
||||
provider_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/auth/plugin/datasource/{provider_id}/custom-client'
|
||||
}
|
||||
|
||||
export type DeleteAuthPluginDatasourceByProviderIdCustomClientErrors = {
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type DeleteAuthPluginDatasourceByProviderIdCustomClientError =
|
||||
DeleteAuthPluginDatasourceByProviderIdCustomClientErrors[keyof DeleteAuthPluginDatasourceByProviderIdCustomClientErrors]
|
||||
|
||||
export type DeleteAuthPluginDatasourceByProviderIdCustomClientResponses = {
|
||||
200: SimpleResultResponse
|
||||
}
|
||||
|
||||
export type DeleteAuthPluginDatasourceByProviderIdCustomClientResponse =
|
||||
DeleteAuthPluginDatasourceByProviderIdCustomClientResponses[keyof DeleteAuthPluginDatasourceByProviderIdCustomClientResponses]
|
||||
|
||||
export type PostAuthPluginDatasourceByProviderIdCustomClientData = {
|
||||
body: DatasourceCustomClientPayload
|
||||
path: {
|
||||
provider_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/auth/plugin/datasource/{provider_id}/custom-client'
|
||||
}
|
||||
|
||||
export type PostAuthPluginDatasourceByProviderIdCustomClientErrors = {
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type PostAuthPluginDatasourceByProviderIdCustomClientError =
|
||||
PostAuthPluginDatasourceByProviderIdCustomClientErrors[keyof PostAuthPluginDatasourceByProviderIdCustomClientErrors]
|
||||
|
||||
export type PostAuthPluginDatasourceByProviderIdCustomClientResponses = {
|
||||
200: SimpleResultResponse
|
||||
}
|
||||
|
||||
export type PostAuthPluginDatasourceByProviderIdCustomClientResponse =
|
||||
PostAuthPluginDatasourceByProviderIdCustomClientResponses[keyof PostAuthPluginDatasourceByProviderIdCustomClientResponses]
|
||||
|
||||
export type PostAuthPluginDatasourceByProviderIdDefaultData = {
|
||||
body: DatasourceDefaultPayload
|
||||
path: {
|
||||
provider_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/auth/plugin/datasource/{provider_id}/default'
|
||||
}
|
||||
|
||||
export type PostAuthPluginDatasourceByProviderIdDefaultErrors = {
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type PostAuthPluginDatasourceByProviderIdDefaultError =
|
||||
PostAuthPluginDatasourceByProviderIdDefaultErrors[keyof PostAuthPluginDatasourceByProviderIdDefaultErrors]
|
||||
|
||||
export type PostAuthPluginDatasourceByProviderIdDefaultResponses = {
|
||||
200: SimpleResultResponse
|
||||
}
|
||||
|
||||
export type PostAuthPluginDatasourceByProviderIdDefaultResponse =
|
||||
PostAuthPluginDatasourceByProviderIdDefaultResponses[keyof PostAuthPluginDatasourceByProviderIdDefaultResponses]
|
||||
|
||||
export type PostAuthPluginDatasourceByProviderIdDeleteData = {
|
||||
body: DatasourceCredentialDeletePayload
|
||||
path: {
|
||||
provider_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/auth/plugin/datasource/{provider_id}/delete'
|
||||
}
|
||||
|
||||
export type PostAuthPluginDatasourceByProviderIdDeleteErrors = {
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type PostAuthPluginDatasourceByProviderIdDeleteError =
|
||||
PostAuthPluginDatasourceByProviderIdDeleteErrors[keyof PostAuthPluginDatasourceByProviderIdDeleteErrors]
|
||||
|
||||
export type PostAuthPluginDatasourceByProviderIdDeleteResponses = {
|
||||
200: SimpleResultResponse
|
||||
}
|
||||
|
||||
export type PostAuthPluginDatasourceByProviderIdDeleteResponse =
|
||||
PostAuthPluginDatasourceByProviderIdDeleteResponses[keyof PostAuthPluginDatasourceByProviderIdDeleteResponses]
|
||||
|
||||
export type PostAuthPluginDatasourceByProviderIdUpdateData = {
|
||||
body: DatasourceCredentialUpdatePayload
|
||||
path: {
|
||||
provider_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/auth/plugin/datasource/{provider_id}/update'
|
||||
}
|
||||
|
||||
export type PostAuthPluginDatasourceByProviderIdUpdateErrors = {
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type PostAuthPluginDatasourceByProviderIdUpdateError =
|
||||
PostAuthPluginDatasourceByProviderIdUpdateErrors[keyof PostAuthPluginDatasourceByProviderIdUpdateErrors]
|
||||
|
||||
export type PostAuthPluginDatasourceByProviderIdUpdateResponses = {
|
||||
201: SimpleResultResponse
|
||||
}
|
||||
|
||||
export type PostAuthPluginDatasourceByProviderIdUpdateResponse =
|
||||
PostAuthPluginDatasourceByProviderIdUpdateResponses[keyof PostAuthPluginDatasourceByProviderIdUpdateResponses]
|
||||
|
||||
export type PostAuthPluginDatasourceByProviderIdUpdateNameData = {
|
||||
body: DatasourceUpdateNamePayload
|
||||
path: {
|
||||
provider_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/auth/plugin/datasource/{provider_id}/update-name'
|
||||
}
|
||||
|
||||
export type PostAuthPluginDatasourceByProviderIdUpdateNameErrors = {
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type PostAuthPluginDatasourceByProviderIdUpdateNameError =
|
||||
PostAuthPluginDatasourceByProviderIdUpdateNameErrors[keyof PostAuthPluginDatasourceByProviderIdUpdateNameErrors]
|
||||
|
||||
export type PostAuthPluginDatasourceByProviderIdUpdateNameResponses = {
|
||||
200: SimpleResultResponse
|
||||
}
|
||||
|
||||
export type PostAuthPluginDatasourceByProviderIdUpdateNameResponse =
|
||||
PostAuthPluginDatasourceByProviderIdUpdateNameResponses[keyof PostAuthPluginDatasourceByProviderIdUpdateNameResponses]
|
||||
@@ -0,0 +1,297 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import * as z from 'zod'
|
||||
|
||||
/**
|
||||
* ErrorResponse
|
||||
*
|
||||
* Documented non-2xx body emitted by ``register_external_error_handlers``.
|
||||
*
|
||||
* ``params`` and ``details`` appear only on the errors that set them. The schema
|
||||
* stays open because ``HTTPException.data`` may carry extra keys.
|
||||
*/
|
||||
export const zErrorResponse = z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
})
|
||||
|
||||
/**
|
||||
* DatasourceCredentialPayload
|
||||
*/
|
||||
export const zDatasourceCredentialPayload = z.object({
|
||||
credentials: z.record(z.string(), z.unknown()),
|
||||
name: z.string().max(100).nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* SimpleResultResponse
|
||||
*/
|
||||
export const zSimpleResultResponse = z.object({
|
||||
result: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* DatasourceCustomClientPayload
|
||||
*/
|
||||
export const zDatasourceCustomClientPayload = z.object({
|
||||
client_params: z.record(z.string(), z.unknown()).nullish(),
|
||||
enable_oauth_custom_client: z.boolean().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* DatasourceDefaultPayload
|
||||
*/
|
||||
export const zDatasourceDefaultPayload = z.object({
|
||||
id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* DatasourceCredentialDeletePayload
|
||||
*/
|
||||
export const zDatasourceCredentialDeletePayload = z.object({
|
||||
credential_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* DatasourceCredentialUpdatePayload
|
||||
*/
|
||||
export const zDatasourceCredentialUpdatePayload = z.object({
|
||||
credential_id: z.string(),
|
||||
credentials: z.record(z.string(), z.unknown()).nullish(),
|
||||
name: z.string().max(100).nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* DatasourceUpdateNamePayload
|
||||
*/
|
||||
export const zDatasourceUpdateNamePayload = z.object({
|
||||
credential_id: z.string(),
|
||||
name: z.string().max(100),
|
||||
})
|
||||
|
||||
/**
|
||||
* DatasourceCredentialResponse
|
||||
*/
|
||||
export const zDatasourceCredentialResponse = z.object({
|
||||
avatar_url: z.string().nullable(),
|
||||
credential: z.record(z.string(), z.unknown()),
|
||||
id: z.string(),
|
||||
is_default: z.boolean(),
|
||||
name: z.string(),
|
||||
type: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* DatasourceCredentialListResponse
|
||||
*/
|
||||
export const zDatasourceCredentialListResponse = z.object({
|
||||
result: z.array(zDatasourceCredentialResponse),
|
||||
})
|
||||
|
||||
/**
|
||||
* I18nObject
|
||||
*
|
||||
* Model class for i18n object.
|
||||
*/
|
||||
export const zI18nObject = z.object({
|
||||
en_US: z.string(),
|
||||
ja_JP: z.string().nullish(),
|
||||
pt_BR: z.string().nullish(),
|
||||
zh_Hans: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Option
|
||||
*/
|
||||
export const zOption = z.object({
|
||||
label: zI18nObject,
|
||||
value: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AppSelectorScope
|
||||
*/
|
||||
export const zAppSelectorScope = z.enum(['all', 'chat', 'completion', 'workflow'])
|
||||
|
||||
/**
|
||||
* ModelSelectorScope
|
||||
*/
|
||||
export const zModelSelectorScope = z.enum([
|
||||
'llm',
|
||||
'moderation',
|
||||
'rerank',
|
||||
'speech2text',
|
||||
'text-embedding',
|
||||
'tts',
|
||||
'vision',
|
||||
])
|
||||
|
||||
/**
|
||||
* ToolSelectorScope
|
||||
*/
|
||||
export const zToolSelectorScope = z.enum(['all', 'builtin', 'custom', 'workflow'])
|
||||
|
||||
/**
|
||||
* ProviderConfigType
|
||||
*/
|
||||
export const zProviderConfigType = z.enum([
|
||||
'app-selector',
|
||||
'array[tools]',
|
||||
'boolean',
|
||||
'model-selector',
|
||||
'secret-input',
|
||||
'select',
|
||||
'text-input',
|
||||
])
|
||||
|
||||
/**
|
||||
* ProviderConfig
|
||||
*
|
||||
* Model class for common provider settings like credentials
|
||||
*/
|
||||
export const zProviderConfig = z.object({
|
||||
default: z.union([z.int(), z.string(), z.number(), z.boolean()]).nullish(),
|
||||
help: zI18nObject.nullish(),
|
||||
label: zI18nObject.nullish(),
|
||||
multiple: z.boolean().optional().default(false),
|
||||
name: z.string(),
|
||||
options: z.array(zOption).nullish(),
|
||||
placeholder: zI18nObject.nullish(),
|
||||
required: z.boolean().optional().default(false),
|
||||
scope: z.union([zAppSelectorScope, zModelSelectorScope, zToolSelectorScope]).nullish(),
|
||||
type: zProviderConfigType,
|
||||
url: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* DatasourceOAuthSchemaResponse
|
||||
*/
|
||||
export const zDatasourceOAuthSchemaResponse = z.object({
|
||||
client_schema: z.array(zProviderConfig),
|
||||
credentials_schema: z.array(zProviderConfig),
|
||||
is_oauth_custom_client_enabled: z.boolean(),
|
||||
is_system_oauth_params_exists: z.boolean(),
|
||||
oauth_custom_client_params: z.record(z.string(), z.unknown()).nullable(),
|
||||
redirect_uri: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* DatasourceProviderAuthResponse
|
||||
*/
|
||||
export const zDatasourceProviderAuthResponse = z.object({
|
||||
author: z.string(),
|
||||
credential_schema: z.array(zProviderConfig),
|
||||
credentials_list: z.array(zDatasourceCredentialResponse),
|
||||
description: zI18nObject,
|
||||
icon: z.string(),
|
||||
label: zI18nObject,
|
||||
name: z.string(),
|
||||
oauth_schema: zDatasourceOAuthSchemaResponse.nullable(),
|
||||
plugin_id: z.string(),
|
||||
plugin_unique_identifier: z.string(),
|
||||
provider: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* DatasourceProviderAuthListResponse
|
||||
*/
|
||||
export const zDatasourceProviderAuthListResponse = z.object({
|
||||
result: z.array(zDatasourceProviderAuthResponse),
|
||||
})
|
||||
|
||||
/**
|
||||
* Default datasource credentials retrieved successfully
|
||||
*/
|
||||
export const zGetAuthPluginDatasourceDefaultListResponse = zDatasourceProviderAuthListResponse
|
||||
|
||||
/**
|
||||
* Datasource credentials retrieved successfully
|
||||
*/
|
||||
export const zGetAuthPluginDatasourceListResponse = zDatasourceProviderAuthListResponse
|
||||
|
||||
export const zGetAuthPluginDatasourceByProviderIdPath = z.object({
|
||||
provider_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Datasource credentials retrieved successfully
|
||||
*/
|
||||
export const zGetAuthPluginDatasourceByProviderIdResponse = zDatasourceCredentialListResponse
|
||||
|
||||
export const zPostAuthPluginDatasourceByProviderIdBody = zDatasourceCredentialPayload
|
||||
|
||||
export const zPostAuthPluginDatasourceByProviderIdPath = z.object({
|
||||
provider_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Datasource credential created successfully
|
||||
*/
|
||||
export const zPostAuthPluginDatasourceByProviderIdResponse = zSimpleResultResponse
|
||||
|
||||
export const zDeleteAuthPluginDatasourceByProviderIdCustomClientPath = z.object({
|
||||
provider_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zDeleteAuthPluginDatasourceByProviderIdCustomClientResponse = zSimpleResultResponse
|
||||
|
||||
export const zPostAuthPluginDatasourceByProviderIdCustomClientBody = zDatasourceCustomClientPayload
|
||||
|
||||
export const zPostAuthPluginDatasourceByProviderIdCustomClientPath = z.object({
|
||||
provider_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Datasource OAuth custom client saved successfully
|
||||
*/
|
||||
export const zPostAuthPluginDatasourceByProviderIdCustomClientResponse = zSimpleResultResponse
|
||||
|
||||
export const zPostAuthPluginDatasourceByProviderIdDefaultBody = zDatasourceDefaultPayload
|
||||
|
||||
export const zPostAuthPluginDatasourceByProviderIdDefaultPath = z.object({
|
||||
provider_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zPostAuthPluginDatasourceByProviderIdDefaultResponse = zSimpleResultResponse
|
||||
|
||||
export const zPostAuthPluginDatasourceByProviderIdDeleteBody = zDatasourceCredentialDeletePayload
|
||||
|
||||
export const zPostAuthPluginDatasourceByProviderIdDeletePath = z.object({
|
||||
provider_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zPostAuthPluginDatasourceByProviderIdDeleteResponse = zSimpleResultResponse
|
||||
|
||||
export const zPostAuthPluginDatasourceByProviderIdUpdateBody = zDatasourceCredentialUpdatePayload
|
||||
|
||||
export const zPostAuthPluginDatasourceByProviderIdUpdatePath = z.object({
|
||||
provider_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Datasource credential updated successfully
|
||||
*/
|
||||
export const zPostAuthPluginDatasourceByProviderIdUpdateResponse = zSimpleResultResponse
|
||||
|
||||
export const zPostAuthPluginDatasourceByProviderIdUpdateNameBody = zDatasourceUpdateNamePayload
|
||||
|
||||
export const zPostAuthPluginDatasourceByProviderIdUpdateNamePath = z.object({
|
||||
provider_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zPostAuthPluginDatasourceByProviderIdUpdateNameResponse = zSimpleResultResponse
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
// This file is auto-generated by scripts/add-orpc-error-maps.ts
|
||||
import * as z from 'zod'
|
||||
|
||||
const zErrorResponse = /* @__PURE__ */ (() =>
|
||||
z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
}))()
|
||||
|
||||
const zBillingOperationFailedError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('billing_operation_failed'),
|
||||
status: z.literal(502),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zBillingUnavailableError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('billing_unavailable'),
|
||||
status: z.literal(503),
|
||||
}),
|
||||
))()
|
||||
|
||||
export const getErrors = {
|
||||
billing_operation_failed: { status: 502, data: zBillingOperationFailedError },
|
||||
billing_unavailable: { status: 503, data: zBillingUnavailableError },
|
||||
}
|
||||
|
||||
export const get2Errors = {
|
||||
billing_operation_failed: { status: 502, data: zBillingOperationFailedError },
|
||||
billing_unavailable: { status: 503, data: zBillingUnavailableError },
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { oc } from '@orpc/contract'
|
||||
import * as z from 'zod'
|
||||
import { zBillingOperationFailedError, zBillingUnavailableError } from './zod.gen.ts'
|
||||
import {
|
||||
zGetBillingInvoicesResponse,
|
||||
zGetBillingSubscriptionQuery,
|
||||
zGetBillingSubscriptionResponse,
|
||||
} from './zod.gen.ts'
|
||||
|
||||
export const get = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getBillingInvoices',
|
||||
path: '/billing/invoices',
|
||||
tags: ['console'],
|
||||
})
|
||||
.output(zGetBillingInvoicesResponse)
|
||||
.errors({
|
||||
billing_operation_failed: { status: 502, data: zBillingOperationFailedError },
|
||||
billing_unavailable: { status: 503, data: zBillingUnavailableError },
|
||||
})
|
||||
|
||||
export const invoices = {
|
||||
get,
|
||||
}
|
||||
|
||||
export const get2 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getBillingSubscription',
|
||||
path: '/billing/subscription',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ query: zGetBillingSubscriptionQuery }))
|
||||
.output(zGetBillingSubscriptionResponse)
|
||||
.errors({
|
||||
billing_operation_failed: { status: 502, data: zBillingOperationFailedError },
|
||||
billing_unavailable: { status: 503, data: zBillingUnavailableError },
|
||||
})
|
||||
|
||||
export const subscription = {
|
||||
get: get2,
|
||||
}
|
||||
|
||||
export const billing = {
|
||||
invoices,
|
||||
subscription,
|
||||
}
|
||||
|
||||
export const contract = {
|
||||
billing,
|
||||
}
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type ClientOptions = {
|
||||
baseUrl: `${string}://${string}/console/api` | (string & {})
|
||||
}
|
||||
|
||||
export type BillingInvoiceResponse = {
|
||||
url: string
|
||||
}
|
||||
|
||||
export type ErrorResponse = {
|
||||
code: string
|
||||
details?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
message: string
|
||||
params?: string
|
||||
status: number
|
||||
}
|
||||
|
||||
export type BillingOperationFailedErrorResponse = {
|
||||
code: 'billing_operation_failed'
|
||||
message: string
|
||||
status: 502
|
||||
}
|
||||
|
||||
export type BillingOperationFailedError = ErrorResponse & {
|
||||
code: 'billing_operation_failed'
|
||||
status: 502
|
||||
}
|
||||
|
||||
export type BillingUnavailableErrorResponse = {
|
||||
code: 'billing_unavailable'
|
||||
message: string
|
||||
status: 503
|
||||
}
|
||||
|
||||
export type BillingUnavailableError = ErrorResponse & {
|
||||
code: 'billing_unavailable'
|
||||
status: 503
|
||||
}
|
||||
|
||||
export type BillingSubscriptionResponse = {
|
||||
url: string
|
||||
}
|
||||
|
||||
export type BillingUnprocessableEntityErrorResponse = {
|
||||
code: 'unprocessable_entity'
|
||||
message: string
|
||||
status: 422
|
||||
}
|
||||
|
||||
export type GetBillingInvoicesData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/billing/invoices'
|
||||
}
|
||||
|
||||
export type GetBillingInvoicesErrors = {
|
||||
403: ErrorResponse
|
||||
502: BillingOperationFailedErrorResponse | BillingOperationFailedError | ErrorResponse
|
||||
503: BillingUnavailableErrorResponse | BillingUnavailableError | ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type GetBillingInvoicesError = GetBillingInvoicesErrors[keyof GetBillingInvoicesErrors]
|
||||
|
||||
export type GetBillingInvoicesResponses = {
|
||||
200: BillingInvoiceResponse
|
||||
}
|
||||
|
||||
export type GetBillingInvoicesResponse =
|
||||
GetBillingInvoicesResponses[keyof GetBillingInvoicesResponses]
|
||||
|
||||
export type GetBillingSubscriptionData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query: {
|
||||
interval: 'month' | 'year'
|
||||
plan: 'professional' | 'team'
|
||||
}
|
||||
url: '/billing/subscription'
|
||||
}
|
||||
|
||||
export type GetBillingSubscriptionErrors = {
|
||||
403: ErrorResponse
|
||||
422: BillingUnprocessableEntityErrorResponse | ErrorResponse
|
||||
502: BillingOperationFailedErrorResponse | BillingOperationFailedError | ErrorResponse
|
||||
503: BillingUnavailableErrorResponse | BillingUnavailableError | ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type GetBillingSubscriptionError =
|
||||
GetBillingSubscriptionErrors[keyof GetBillingSubscriptionErrors]
|
||||
|
||||
export type GetBillingSubscriptionResponses = {
|
||||
200: BillingSubscriptionResponse
|
||||
}
|
||||
|
||||
export type GetBillingSubscriptionResponse =
|
||||
GetBillingSubscriptionResponses[keyof GetBillingSubscriptionResponses]
|
||||
@@ -0,0 +1,99 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import * as z from 'zod'
|
||||
|
||||
/**
|
||||
* BillingInvoiceResponse
|
||||
*/
|
||||
export const zBillingInvoiceResponse = z.object({
|
||||
url: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* ErrorResponse
|
||||
*
|
||||
* Documented non-2xx body emitted by ``register_external_error_handlers``.
|
||||
*
|
||||
* ``params`` and ``details`` appear only on the errors that set them. The schema
|
||||
* stays open because ``HTTPException.data`` may carry extra keys.
|
||||
*/
|
||||
export const zErrorResponse = z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
})
|
||||
|
||||
/**
|
||||
* BillingOperationFailedErrorResponse
|
||||
*/
|
||||
export const zBillingOperationFailedErrorResponse = z.object({
|
||||
code: z.literal('billing_operation_failed'),
|
||||
message: z.string(),
|
||||
status: z.literal(502),
|
||||
})
|
||||
|
||||
/**
|
||||
* BillingOperationFailedError
|
||||
*
|
||||
* We couldn't complete this request. Please try again. If the problem persists, contact support.
|
||||
*/
|
||||
export const zBillingOperationFailedError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('billing_operation_failed'),
|
||||
status: z.literal(502),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* BillingUnavailableErrorResponse
|
||||
*/
|
||||
export const zBillingUnavailableErrorResponse = z.object({
|
||||
code: z.literal('billing_unavailable'),
|
||||
message: z.string(),
|
||||
status: z.literal(503),
|
||||
})
|
||||
|
||||
/**
|
||||
* BillingUnavailableError
|
||||
*
|
||||
* This operation is temporarily unavailable. Please try again later.
|
||||
*/
|
||||
export const zBillingUnavailableError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('billing_unavailable'),
|
||||
status: z.literal(503),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* BillingSubscriptionResponse
|
||||
*/
|
||||
export const zBillingSubscriptionResponse = z.object({
|
||||
url: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* BillingUnprocessableEntityErrorResponse
|
||||
*/
|
||||
export const zBillingUnprocessableEntityErrorResponse = z.object({
|
||||
code: z.literal('unprocessable_entity'),
|
||||
message: z.string(),
|
||||
status: z.literal(422),
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zGetBillingInvoicesResponse = zBillingInvoiceResponse
|
||||
|
||||
export const zGetBillingSubscriptionQuery = z.object({
|
||||
interval: z.enum(['month', 'year']),
|
||||
plan: z.enum(['professional', 'team']),
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zGetBillingSubscriptionResponse = zBillingSubscriptionResponse
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { oc } from '@orpc/contract'
|
||||
import * as z from 'zod'
|
||||
import { zGetCodeBasedExtensionQuery, zGetCodeBasedExtensionResponse } from './zod.gen.ts'
|
||||
|
||||
/**
|
||||
* Get code-based extension data by module name
|
||||
*/
|
||||
export const get = oc
|
||||
.route({
|
||||
description: 'Get code-based extension data by module name',
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getCodeBasedExtension',
|
||||
path: '/code-based-extension',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ query: zGetCodeBasedExtensionQuery }))
|
||||
.output(zGetCodeBasedExtensionResponse)
|
||||
|
||||
export const codeBasedExtension = {
|
||||
get,
|
||||
}
|
||||
|
||||
export const contract = {
|
||||
codeBasedExtension,
|
||||
}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type ClientOptions = {
|
||||
baseUrl: `${string}://${string}/console/api` | (string & {})
|
||||
}
|
||||
|
||||
export type CodeBasedExtensionResponse = {
|
||||
data: Array<CodeBasedExtensionItemResponse>
|
||||
module: string
|
||||
}
|
||||
|
||||
export type ErrorResponse = {
|
||||
code: string
|
||||
details?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
message: string
|
||||
params?: string
|
||||
status: number
|
||||
}
|
||||
|
||||
export type CodeBasedExtensionItemResponse = {
|
||||
form_schema?: Array<{
|
||||
[key: string]: unknown
|
||||
}> | null
|
||||
label?: {
|
||||
[key: string]: unknown
|
||||
} | null
|
||||
name: string
|
||||
}
|
||||
|
||||
export type GetCodeBasedExtensionData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query: {
|
||||
module: string
|
||||
}
|
||||
url: '/code-based-extension'
|
||||
}
|
||||
|
||||
export type GetCodeBasedExtensionErrors = {
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type GetCodeBasedExtensionError =
|
||||
GetCodeBasedExtensionErrors[keyof GetCodeBasedExtensionErrors]
|
||||
|
||||
export type GetCodeBasedExtensionResponses = {
|
||||
200: CodeBasedExtensionResponse
|
||||
}
|
||||
|
||||
export type GetCodeBasedExtensionResponse =
|
||||
GetCodeBasedExtensionResponses[keyof GetCodeBasedExtensionResponses]
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import * as z from 'zod'
|
||||
|
||||
/**
|
||||
* ErrorResponse
|
||||
*
|
||||
* Documented non-2xx body emitted by ``register_external_error_handlers``.
|
||||
*
|
||||
* ``params`` and ``details`` appear only on the errors that set them. The schema
|
||||
* stays open because ``HTTPException.data`` may carry extra keys.
|
||||
*/
|
||||
export const zErrorResponse = z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
})
|
||||
|
||||
/**
|
||||
* CodeBasedExtensionItemResponse
|
||||
*/
|
||||
export const zCodeBasedExtensionItemResponse = z.object({
|
||||
form_schema: z.array(z.record(z.string(), z.unknown())).nullish(),
|
||||
label: z.record(z.string(), z.unknown()).nullish(),
|
||||
name: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* CodeBasedExtensionResponse
|
||||
*/
|
||||
export const zCodeBasedExtensionResponse = z.object({
|
||||
data: z.array(zCodeBasedExtensionItemResponse),
|
||||
module: z.string(),
|
||||
})
|
||||
|
||||
export const zGetCodeBasedExtensionQuery = z.object({
|
||||
module: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zGetCodeBasedExtensionResponse = zCodeBasedExtensionResponse
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
// This file is auto-generated by scripts/add-orpc-error-maps.ts
|
||||
import * as z from 'zod'
|
||||
|
||||
const zErrorResponse = /* @__PURE__ */ (() =>
|
||||
z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
}))()
|
||||
|
||||
const zComplianceDownloadForbiddenError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('compliance_download_forbidden'),
|
||||
status: z.literal(403),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zComplianceDocumentNotFoundError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('compliance_document_not_found'),
|
||||
status: z.literal(404),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zBillingRequestInProgressError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('billing_request_in_progress'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zComplianceRateLimitError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('compliance_rate_limit'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zBillingOperationFailedError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('billing_operation_failed'),
|
||||
status: z.literal(502),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zBillingUnavailableError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('billing_unavailable'),
|
||||
status: z.literal(503),
|
||||
}),
|
||||
))()
|
||||
|
||||
export const getErrors = {
|
||||
billing_operation_failed: { status: 502, data: zBillingOperationFailedError },
|
||||
billing_request_in_progress: { status: 429, data: zBillingRequestInProgressError },
|
||||
billing_unavailable: { status: 503, data: zBillingUnavailableError },
|
||||
compliance_document_not_found: { status: 404, data: zComplianceDocumentNotFoundError },
|
||||
compliance_download_forbidden: { status: 403, data: zComplianceDownloadForbiddenError },
|
||||
compliance_rate_limit: { status: 429, data: zComplianceRateLimitError },
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { oc } from '@orpc/contract'
|
||||
import * as z from 'zod'
|
||||
import {
|
||||
zBillingOperationFailedError,
|
||||
zBillingRequestInProgressError,
|
||||
zBillingUnavailableError,
|
||||
zComplianceDocumentNotFoundError,
|
||||
zComplianceDownloadForbiddenError,
|
||||
zComplianceRateLimitError,
|
||||
} from './zod.gen.ts'
|
||||
import { zGetComplianceDownloadQuery, zGetComplianceDownloadResponse } from './zod.gen.ts'
|
||||
|
||||
/**
|
||||
* Get compliance document download link
|
||||
*/
|
||||
export const get = oc
|
||||
.route({
|
||||
description: 'Get compliance document download link',
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getComplianceDownload',
|
||||
path: '/compliance/download',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ query: zGetComplianceDownloadQuery }))
|
||||
.output(zGetComplianceDownloadResponse)
|
||||
.errors({
|
||||
billing_operation_failed: { status: 502, data: zBillingOperationFailedError },
|
||||
billing_request_in_progress: { status: 429, data: zBillingRequestInProgressError },
|
||||
billing_unavailable: { status: 503, data: zBillingUnavailableError },
|
||||
compliance_document_not_found: { status: 404, data: zComplianceDocumentNotFoundError },
|
||||
compliance_download_forbidden: { status: 403, data: zComplianceDownloadForbiddenError },
|
||||
compliance_rate_limit: { status: 429, data: zComplianceRateLimitError },
|
||||
})
|
||||
|
||||
export const download = {
|
||||
get,
|
||||
}
|
||||
|
||||
export const compliance = {
|
||||
download,
|
||||
}
|
||||
|
||||
export const contract = {
|
||||
compliance,
|
||||
}
|
||||
+106
@@ -0,0 +1,106 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type ClientOptions = {
|
||||
baseUrl: `${string}://${string}/console/api` | (string & {})
|
||||
}
|
||||
|
||||
export type ComplianceDownloadResponse = {
|
||||
url: string
|
||||
}
|
||||
|
||||
export type ComplianceDownloadForbiddenError = ErrorResponse & {
|
||||
code: 'compliance_download_forbidden'
|
||||
status: 403
|
||||
}
|
||||
|
||||
export type ErrorResponse = {
|
||||
code: string
|
||||
details?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
message: string
|
||||
params?: string
|
||||
status: number
|
||||
}
|
||||
|
||||
export type ComplianceDocumentNotFoundError = ErrorResponse & {
|
||||
code: 'compliance_document_not_found'
|
||||
status: 404
|
||||
}
|
||||
|
||||
export type BillingUnprocessableEntityErrorResponse = {
|
||||
code: 'unprocessable_entity'
|
||||
message: string
|
||||
status: 422
|
||||
}
|
||||
|
||||
export type ComplianceRateLimitErrorResponse = {
|
||||
code: 'compliance_rate_limit'
|
||||
message: string
|
||||
status: 429
|
||||
}
|
||||
|
||||
export type BillingRequestInProgressError = ErrorResponse & {
|
||||
code: 'billing_request_in_progress'
|
||||
status: 429
|
||||
}
|
||||
|
||||
export type ComplianceRateLimitError = ErrorResponse & {
|
||||
code: 'compliance_rate_limit'
|
||||
status: 429
|
||||
}
|
||||
|
||||
export type BillingOperationFailedErrorResponse = {
|
||||
code: 'billing_operation_failed'
|
||||
message: string
|
||||
status: 502
|
||||
}
|
||||
|
||||
export type BillingOperationFailedError = ErrorResponse & {
|
||||
code: 'billing_operation_failed'
|
||||
status: 502
|
||||
}
|
||||
|
||||
export type BillingUnavailableErrorResponse = {
|
||||
code: 'billing_unavailable'
|
||||
message: string
|
||||
status: 503
|
||||
}
|
||||
|
||||
export type BillingUnavailableError = ErrorResponse & {
|
||||
code: 'billing_unavailable'
|
||||
status: 503
|
||||
}
|
||||
|
||||
export type GetComplianceDownloadData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query: {
|
||||
doc_name: string
|
||||
}
|
||||
url: '/compliance/download'
|
||||
}
|
||||
|
||||
export type GetComplianceDownloadErrors = {
|
||||
403: ComplianceDownloadForbiddenError | ErrorResponse
|
||||
404: ComplianceDocumentNotFoundError | ErrorResponse
|
||||
422: BillingUnprocessableEntityErrorResponse | ErrorResponse
|
||||
429:
|
||||
| ComplianceRateLimitErrorResponse
|
||||
| BillingRequestInProgressError
|
||||
| ComplianceRateLimitError
|
||||
| ErrorResponse
|
||||
502: BillingOperationFailedErrorResponse | BillingOperationFailedError | ErrorResponse
|
||||
503: BillingUnavailableErrorResponse | BillingUnavailableError | ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type GetComplianceDownloadError =
|
||||
GetComplianceDownloadErrors[keyof GetComplianceDownloadErrors]
|
||||
|
||||
export type GetComplianceDownloadResponses = {
|
||||
200: ComplianceDownloadResponse
|
||||
}
|
||||
|
||||
export type GetComplianceDownloadResponse =
|
||||
GetComplianceDownloadResponses[keyof GetComplianceDownloadResponses]
|
||||
+143
@@ -0,0 +1,143 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import * as z from 'zod'
|
||||
|
||||
/**
|
||||
* ComplianceDownloadResponse
|
||||
*/
|
||||
export const zComplianceDownloadResponse = z.object({
|
||||
url: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* ErrorResponse
|
||||
*
|
||||
* Documented non-2xx body emitted by ``register_external_error_handlers``.
|
||||
*
|
||||
* ``params`` and ``details`` appear only on the errors that set them. The schema
|
||||
* stays open because ``HTTPException.data`` may carry extra keys.
|
||||
*/
|
||||
export const zErrorResponse = z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
})
|
||||
|
||||
/**
|
||||
* ComplianceDownloadForbiddenError
|
||||
*
|
||||
* Your current plan does not allow downloading this compliance document.
|
||||
*/
|
||||
export const zComplianceDownloadForbiddenError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('compliance_download_forbidden'),
|
||||
status: z.literal(403),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* ComplianceDocumentNotFoundError
|
||||
*
|
||||
* The compliance document was not found.
|
||||
*/
|
||||
export const zComplianceDocumentNotFoundError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('compliance_document_not_found'),
|
||||
status: z.literal(404),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* BillingUnprocessableEntityErrorResponse
|
||||
*/
|
||||
export const zBillingUnprocessableEntityErrorResponse = z.object({
|
||||
code: z.literal('unprocessable_entity'),
|
||||
message: z.string(),
|
||||
status: z.literal(422),
|
||||
})
|
||||
|
||||
/**
|
||||
* ComplianceRateLimitErrorResponse
|
||||
*/
|
||||
export const zComplianceRateLimitErrorResponse = z.object({
|
||||
code: z.literal('compliance_rate_limit'),
|
||||
message: z.string(),
|
||||
status: z.literal(429),
|
||||
})
|
||||
|
||||
/**
|
||||
* BillingRequestInProgressError
|
||||
*
|
||||
* A previous request is still being processed. Please try again shortly.
|
||||
*/
|
||||
export const zBillingRequestInProgressError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('billing_request_in_progress'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* ComplianceRateLimitError
|
||||
*
|
||||
* Rate limit exceeded for downloading compliance report.
|
||||
*/
|
||||
export const zComplianceRateLimitError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('compliance_rate_limit'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* BillingOperationFailedErrorResponse
|
||||
*/
|
||||
export const zBillingOperationFailedErrorResponse = z.object({
|
||||
code: z.literal('billing_operation_failed'),
|
||||
message: z.string(),
|
||||
status: z.literal(502),
|
||||
})
|
||||
|
||||
/**
|
||||
* BillingOperationFailedError
|
||||
*
|
||||
* We couldn't complete this request. Please try again. If the problem persists, contact support.
|
||||
*/
|
||||
export const zBillingOperationFailedError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('billing_operation_failed'),
|
||||
status: z.literal(502),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* BillingUnavailableErrorResponse
|
||||
*/
|
||||
export const zBillingUnavailableErrorResponse = z.object({
|
||||
code: z.literal('billing_unavailable'),
|
||||
message: z.string(),
|
||||
status: z.literal(503),
|
||||
})
|
||||
|
||||
/**
|
||||
* BillingUnavailableError
|
||||
*
|
||||
* This operation is temporarily unavailable. Please try again later.
|
||||
*/
|
||||
export const zBillingUnavailableError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('billing_unavailable'),
|
||||
status: z.literal(503),
|
||||
}),
|
||||
)
|
||||
|
||||
export const zGetComplianceDownloadQuery = z.object({
|
||||
doc_name: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zGetComplianceDownloadResponse = zComplianceDownloadResponse
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
// This file is auto-generated by scripts/add-orpc-error-maps.ts
|
||||
import * as z from 'zod'
|
||||
|
||||
const zErrorResponse = /* @__PURE__ */ (() =>
|
||||
z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
}))()
|
||||
|
||||
const zInvalidActionError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invalid_action'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
export const patchErrors = { invalid_action: { status: 400, data: zInvalidActionError } }
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { oc } from '@orpc/contract'
|
||||
import * as z from 'zod'
|
||||
import { zInvalidActionError } from './zod.gen.ts'
|
||||
import {
|
||||
zGetDataSourceIntegratesResponse,
|
||||
zPatchDataSourceIntegratesByBindingIdByActionPath,
|
||||
zPatchDataSourceIntegratesByBindingIdByActionResponse,
|
||||
} from './zod.gen.ts'
|
||||
|
||||
export const patch = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'PATCH',
|
||||
operationId: 'patchDataSourceIntegratesByBindingIdByAction',
|
||||
path: '/data-source/integrates/{binding_id}/{action}',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zPatchDataSourceIntegratesByBindingIdByActionPath }))
|
||||
.output(zPatchDataSourceIntegratesByBindingIdByActionResponse)
|
||||
.errors({ invalid_action: { status: 400, data: zInvalidActionError } })
|
||||
|
||||
export const byAction = {
|
||||
patch,
|
||||
}
|
||||
|
||||
export const byBindingId = {
|
||||
byAction,
|
||||
}
|
||||
|
||||
export const get = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getDataSourceIntegrates',
|
||||
path: '/data-source/integrates',
|
||||
tags: ['console'],
|
||||
})
|
||||
.output(zGetDataSourceIntegratesResponse)
|
||||
|
||||
export const integrates = {
|
||||
get,
|
||||
byBindingId,
|
||||
}
|
||||
|
||||
export const dataSource = {
|
||||
integrates,
|
||||
}
|
||||
|
||||
export const contract = {
|
||||
dataSource,
|
||||
}
|
||||
+108
@@ -0,0 +1,108 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type ClientOptions = {
|
||||
baseUrl: `${string}://${string}/console/api` | (string & {})
|
||||
}
|
||||
|
||||
export type DataSourceIntegrateListResponse = {
|
||||
data: Array<DataSourceIntegrateResponse>
|
||||
}
|
||||
|
||||
export type ErrorResponse = {
|
||||
code: string
|
||||
details?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
message: string
|
||||
params?: string
|
||||
status: number
|
||||
}
|
||||
|
||||
export type SimpleResultResponse = {
|
||||
result: string
|
||||
}
|
||||
|
||||
export type InvalidActionError = ErrorResponse & {
|
||||
code: 'invalid_action'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type DataSourceIntegrateResponse = {
|
||||
created_at: number | null
|
||||
disabled: boolean | null
|
||||
id: string | null
|
||||
is_bound: boolean
|
||||
link: string
|
||||
provider: string
|
||||
source_info: DataSourceIntegrateWorkspaceResponse | null
|
||||
}
|
||||
|
||||
export type DataSourceIntegrateWorkspaceResponse = {
|
||||
pages: Array<DataSourceIntegratePageResponse>
|
||||
total: number
|
||||
workspace_icon: string | null
|
||||
workspace_id: string | null
|
||||
workspace_name: string | null
|
||||
}
|
||||
|
||||
export type DataSourceIntegratePageResponse = {
|
||||
page_icon: DataSourceIntegrateIconResponse | null
|
||||
page_id: string
|
||||
page_name: string
|
||||
parent_id: string
|
||||
type: NotionPageType
|
||||
}
|
||||
|
||||
export type DataSourceIntegrateIconResponse = {
|
||||
emoji?: string | null
|
||||
type?: string | null
|
||||
url?: string | null
|
||||
}
|
||||
|
||||
export type NotionPageType = 'database' | 'page'
|
||||
|
||||
export type GetDataSourceIntegratesData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/data-source/integrates'
|
||||
}
|
||||
|
||||
export type GetDataSourceIntegratesErrors = {
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type GetDataSourceIntegratesError =
|
||||
GetDataSourceIntegratesErrors[keyof GetDataSourceIntegratesErrors]
|
||||
|
||||
export type GetDataSourceIntegratesResponses = {
|
||||
200: DataSourceIntegrateListResponse
|
||||
}
|
||||
|
||||
export type GetDataSourceIntegratesResponse =
|
||||
GetDataSourceIntegratesResponses[keyof GetDataSourceIntegratesResponses]
|
||||
|
||||
export type PatchDataSourceIntegratesByBindingIdByActionData = {
|
||||
body?: never
|
||||
path: {
|
||||
action: string
|
||||
binding_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/data-source/integrates/{binding_id}/{action}'
|
||||
}
|
||||
|
||||
export type PatchDataSourceIntegratesByBindingIdByActionErrors = {
|
||||
400: InvalidActionError | ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type PatchDataSourceIntegratesByBindingIdByActionError =
|
||||
PatchDataSourceIntegratesByBindingIdByActionErrors[keyof PatchDataSourceIntegratesByBindingIdByActionErrors]
|
||||
|
||||
export type PatchDataSourceIntegratesByBindingIdByActionResponses = {
|
||||
200: SimpleResultResponse
|
||||
}
|
||||
|
||||
export type PatchDataSourceIntegratesByBindingIdByActionResponse =
|
||||
PatchDataSourceIntegratesByBindingIdByActionResponses[keyof PatchDataSourceIntegratesByBindingIdByActionResponses]
|
||||
+109
@@ -0,0 +1,109 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import * as z from 'zod'
|
||||
|
||||
/**
|
||||
* ErrorResponse
|
||||
*
|
||||
* Documented non-2xx body emitted by ``register_external_error_handlers``.
|
||||
*
|
||||
* ``params`` and ``details`` appear only on the errors that set them. The schema
|
||||
* stays open because ``HTTPException.data`` may carry extra keys.
|
||||
*/
|
||||
export const zErrorResponse = z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
})
|
||||
|
||||
/**
|
||||
* SimpleResultResponse
|
||||
*/
|
||||
export const zSimpleResultResponse = z.object({
|
||||
result: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* InvalidActionError
|
||||
*
|
||||
* Invalid action.
|
||||
*/
|
||||
export const zInvalidActionError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invalid_action'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* DataSourceIntegrateIconResponse
|
||||
*/
|
||||
export const zDataSourceIntegrateIconResponse = z.object({
|
||||
emoji: z.string().nullish(),
|
||||
type: z.string().nullish(),
|
||||
url: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* NotionPageType
|
||||
*/
|
||||
export const zNotionPageType = z.enum(['database', 'page'])
|
||||
|
||||
/**
|
||||
* DataSourceIntegratePageResponse
|
||||
*/
|
||||
export const zDataSourceIntegratePageResponse = z.object({
|
||||
page_icon: zDataSourceIntegrateIconResponse.nullable(),
|
||||
page_id: z.string(),
|
||||
page_name: z.string(),
|
||||
parent_id: z.string(),
|
||||
type: zNotionPageType,
|
||||
})
|
||||
|
||||
/**
|
||||
* DataSourceIntegrateWorkspaceResponse
|
||||
*/
|
||||
export const zDataSourceIntegrateWorkspaceResponse = z.object({
|
||||
pages: z.array(zDataSourceIntegratePageResponse),
|
||||
total: z.int(),
|
||||
workspace_icon: z.string().nullable(),
|
||||
workspace_id: z.string().nullable(),
|
||||
workspace_name: z.string().nullable(),
|
||||
})
|
||||
|
||||
/**
|
||||
* DataSourceIntegrateResponse
|
||||
*/
|
||||
export const zDataSourceIntegrateResponse = z.object({
|
||||
created_at: z.int().nullable(),
|
||||
disabled: z.boolean().nullable(),
|
||||
id: z.string().nullable(),
|
||||
is_bound: z.boolean(),
|
||||
link: z.string(),
|
||||
provider: z.string(),
|
||||
source_info: zDataSourceIntegrateWorkspaceResponse.nullable(),
|
||||
})
|
||||
|
||||
/**
|
||||
* DataSourceIntegrateListResponse
|
||||
*/
|
||||
export const zDataSourceIntegrateListResponse = z.object({
|
||||
data: z.array(zDataSourceIntegrateResponse),
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zGetDataSourceIntegratesResponse = zDataSourceIntegrateListResponse
|
||||
|
||||
export const zPatchDataSourceIntegratesByBindingIdByActionPath = z.object({
|
||||
action: z.string(),
|
||||
binding_id: z.uuid(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zPatchDataSourceIntegratesByBindingIdByActionResponse = zSimpleResultResponse
|
||||
+303
@@ -0,0 +1,303 @@
|
||||
// This file is auto-generated by scripts/add-orpc-error-maps.ts
|
||||
import * as z from 'zod'
|
||||
|
||||
const zErrorResponse = /* @__PURE__ */ (() =>
|
||||
z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
}))()
|
||||
|
||||
const zDatasetNameDuplicateError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('dataset_name_duplicate'),
|
||||
status: z.literal(409),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zMaxKeysExceededError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('max_keys_exceeded'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zProviderNotInitializeError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('provider_not_initialize'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zDatasetAccessDeniedError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('dataset_access_denied'),
|
||||
status: z.literal(403),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zIndexingEstimateError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('indexing_estimate_error'),
|
||||
status: z.literal(500),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zModelCurrentlyNotSupportError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('model_currently_not_support'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zProviderQuotaExceededError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('provider_quota_exceeded'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zDocumentAlreadyFinishedError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('document_already_finished'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zInvalidActionError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invalid_action'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zInvalidMetadataError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invalid_metadata'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zDocumentIndexingError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('document_indexing'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zArchivedDocumentImmutableError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('archived_document_immutable'),
|
||||
status: z.literal(403),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zChildChunkIndexingError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('child_chunk_indexing_error'),
|
||||
status: z.literal(500),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zChildChunkDeleteIndexError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('child_chunk_delete_index_error'),
|
||||
status: z.literal(500),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zCompletionRequestError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('completion_request_error'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zKnowledgeFsUpgradeModelIssueResponse = /* @__PURE__ */ (() =>
|
||||
z.object({
|
||||
field: z.enum(['embedding', 'reasoning', 'rerank']),
|
||||
model: z.string().nullish(),
|
||||
provider: z.string().nullish(),
|
||||
reason: z.enum([
|
||||
'credential-removed',
|
||||
'deprecated',
|
||||
'disabled',
|
||||
'missing',
|
||||
'no-configure',
|
||||
'no-permission',
|
||||
'not_found',
|
||||
'quota-exceeded',
|
||||
]),
|
||||
}))()
|
||||
|
||||
const zKnowledgeFsUpgradeModelErrorDetailsResponse = /* @__PURE__ */ (() =>
|
||||
z.object({
|
||||
issues: z.array(zKnowledgeFsUpgradeModelIssueResponse).min(1).max(3),
|
||||
}))()
|
||||
|
||||
const zKnowledgeFsUpgradeModelsUnavailableError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('knowledge_fs_upgrade_models_unavailable'),
|
||||
details: zKnowledgeFsUpgradeModelErrorDetailsResponse.optional(),
|
||||
status: z.literal(422),
|
||||
}),
|
||||
))()
|
||||
|
||||
export const postErrors = { max_keys_exceeded: { status: 400, data: zMaxKeysExceededError } }
|
||||
|
||||
export const post2Errors = {
|
||||
dataset_name_duplicate: { status: 409, data: zDatasetNameDuplicateError },
|
||||
}
|
||||
|
||||
export const delete2Errors = {
|
||||
dataset_name_duplicate: { status: 409, data: zDatasetNameDuplicateError },
|
||||
}
|
||||
|
||||
export const get5Errors = {
|
||||
dataset_name_duplicate: { status: 409, data: zDatasetNameDuplicateError },
|
||||
}
|
||||
|
||||
export const patchErrors = {
|
||||
dataset_name_duplicate: { status: 409, data: zDatasetNameDuplicateError },
|
||||
}
|
||||
|
||||
export const post3Errors = {
|
||||
dataset_name_duplicate: { status: 409, data: zDatasetNameDuplicateError },
|
||||
}
|
||||
|
||||
export const post4Errors = {
|
||||
dataset_access_denied: { status: 403, data: zDatasetAccessDeniedError },
|
||||
indexing_estimate_error: { status: 500, data: zIndexingEstimateError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
}
|
||||
|
||||
export const post5Errors = {
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
}
|
||||
|
||||
export const post6Errors = {
|
||||
indexing_estimate_error: { status: 500, data: zIndexingEstimateError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
}
|
||||
|
||||
export const get13Errors = {
|
||||
dataset_access_denied: { status: 403, data: zDatasetAccessDeniedError },
|
||||
document_already_finished: { status: 400, data: zDocumentAlreadyFinishedError },
|
||||
indexing_estimate_error: { status: 500, data: zIndexingEstimateError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
}
|
||||
|
||||
export const patch2Errors = { invalid_action: { status: 400, data: zInvalidActionError } }
|
||||
|
||||
export const get16Errors = {
|
||||
dataset_access_denied: { status: 403, data: zDatasetAccessDeniedError },
|
||||
document_already_finished: { status: 400, data: zDocumentAlreadyFinishedError },
|
||||
indexing_estimate_error: { status: 500, data: zIndexingEstimateError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
}
|
||||
|
||||
export const get18Errors = {
|
||||
dataset_access_denied: { status: 403, data: zDatasetAccessDeniedError },
|
||||
}
|
||||
|
||||
export const patch3Errors = {
|
||||
archived_document_immutable: { status: 403, data: zArchivedDocumentImmutableError },
|
||||
document_indexing: { status: 400, data: zDocumentIndexingError },
|
||||
}
|
||||
|
||||
export const patch4Errors = {
|
||||
archived_document_immutable: { status: 403, data: zArchivedDocumentImmutableError },
|
||||
document_indexing: { status: 400, data: zDocumentIndexingError },
|
||||
}
|
||||
|
||||
export const patch5Errors = { invalid_action: { status: 400, data: zInvalidActionError } }
|
||||
|
||||
export const patch6Errors = {
|
||||
invalid_action: { status: 400, data: zInvalidActionError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
}
|
||||
|
||||
export const post12Errors = {
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
}
|
||||
|
||||
export const delete3Errors = {
|
||||
child_chunk_delete_index_error: { status: 500, data: zChildChunkDeleteIndexError },
|
||||
}
|
||||
|
||||
export const patch7Errors = {
|
||||
child_chunk_indexing_error: { status: 500, data: zChildChunkIndexingError },
|
||||
}
|
||||
|
||||
export const patch8Errors = {
|
||||
child_chunk_indexing_error: { status: 500, data: zChildChunkIndexingError },
|
||||
}
|
||||
|
||||
export const post14Errors = {
|
||||
child_chunk_indexing_error: { status: 500, data: zChildChunkIndexingError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
}
|
||||
|
||||
export const patch9Errors = {
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
}
|
||||
|
||||
export const get23Errors = {
|
||||
archived_document_immutable: { status: 403, data: zArchivedDocumentImmutableError },
|
||||
}
|
||||
|
||||
export const get24Errors = { invalid_metadata: { status: 400, data: zInvalidMetadataError } }
|
||||
|
||||
export const post15Errors = {
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
}
|
||||
|
||||
export const post16Errors = {
|
||||
dataset_name_duplicate: { status: 409, data: zDatasetNameDuplicateError },
|
||||
}
|
||||
|
||||
export const post17Errors = {
|
||||
completion_request_error: { status: 400, data: zCompletionRequestError },
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
}
|
||||
|
||||
export const post19Errors = {
|
||||
knowledge_fs_upgrade_models_unavailable: {
|
||||
status: 422,
|
||||
data: zKnowledgeFsUpgradeModelsUnavailableError,
|
||||
},
|
||||
}
|
||||
|
||||
export const get31Errors = {
|
||||
dataset_access_denied: { status: 403, data: zDatasetAccessDeniedError },
|
||||
}
|
||||
|
||||
export const post23Errors = { max_keys_exceeded: { status: 400, data: zMaxKeysExceededError } }
|
||||
|
||||
export const post24Errors = {
|
||||
dataset_name_duplicate: { status: 409, data: zDatasetNameDuplicateError },
|
||||
}
|
||||
+1983
File diff suppressed because it is too large.
Load diff
+3496
File diff suppressed because it is too large.
Load diff
+2931
File diff suppressed because it is too large.
Load diff
+167
@@ -0,0 +1,167 @@
|
||||
// This file is auto-generated by scripts/add-orpc-error-maps.ts
|
||||
import * as z from 'zod'
|
||||
|
||||
const zErrorResponse = /* @__PURE__ */ (() =>
|
||||
z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
}))()
|
||||
|
||||
const zAccountBannedError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('account_banned'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zAccountInFreezeError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('account_in_freeze'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zEmailDomainSuspendedError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_domain_suspended'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zTurnstileVerificationFailedError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('turnstile_verification_failed'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zEmailCodeLoginRateLimitExceededError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_code_login_rate_limit_exceeded'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zEmailSendIpLimitError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_send_ip_limit'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zEmailCodeLoginServiceUnavailableError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_code_login_service_unavailable'),
|
||||
status: z.literal(503),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zTurnstileServiceUnavailableError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('turnstile_service_unavailable'),
|
||||
status: z.literal(503),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zAccountNotFoundError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('account_not_found'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zEmailCodeError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_code_error'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zInvalidEmailError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invalid_email'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zInvalidOrExpiredTokenError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invalid_or_expired_token'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zLimitExceededError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('limit_exceeded'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zNormalizedEmailAlreadyInUseError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('normalized_email_already_in_use'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zNotAllowedCreateWorkspaceError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('not_allowed_create_workspace'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
export const postErrors = {
|
||||
account_banned: { status: 400, data: zAccountBannedError },
|
||||
account_in_freeze: { status: 400, data: zAccountInFreezeError },
|
||||
account_not_found: { status: 400, data: zAccountNotFoundError },
|
||||
email_code_error: { status: 400, data: zEmailCodeError },
|
||||
email_code_login_service_unavailable: {
|
||||
status: 503,
|
||||
data: zEmailCodeLoginServiceUnavailableError,
|
||||
},
|
||||
email_domain_suspended: { status: 400, data: zEmailDomainSuspendedError },
|
||||
invalid_email: { status: 400, data: zInvalidEmailError },
|
||||
invalid_or_expired_token: { status: 400, data: zInvalidOrExpiredTokenError },
|
||||
limit_exceeded: { status: 400, data: zLimitExceededError },
|
||||
normalized_email_already_in_use: { status: 400, data: zNormalizedEmailAlreadyInUseError },
|
||||
not_allowed_create_workspace: { status: 400, data: zNotAllowedCreateWorkspaceError },
|
||||
turnstile_service_unavailable: { status: 503, data: zTurnstileServiceUnavailableError },
|
||||
turnstile_verification_failed: { status: 400, data: zTurnstileVerificationFailedError },
|
||||
}
|
||||
|
||||
export const post2Errors = {
|
||||
account_banned: { status: 400, data: zAccountBannedError },
|
||||
account_in_freeze: { status: 400, data: zAccountInFreezeError },
|
||||
email_code_login_rate_limit_exceeded: {
|
||||
status: 429,
|
||||
data: zEmailCodeLoginRateLimitExceededError,
|
||||
},
|
||||
email_code_login_service_unavailable: {
|
||||
status: 503,
|
||||
data: zEmailCodeLoginServiceUnavailableError,
|
||||
},
|
||||
email_domain_suspended: { status: 400, data: zEmailDomainSuspendedError },
|
||||
email_send_ip_limit: { status: 429, data: zEmailSendIpLimitError },
|
||||
turnstile_service_unavailable: { status: 503, data: zTurnstileServiceUnavailableError },
|
||||
turnstile_verification_failed: { status: 400, data: zTurnstileVerificationFailedError },
|
||||
}
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { oc } from '@orpc/contract'
|
||||
import * as z from 'zod'
|
||||
import {
|
||||
zAccountBannedError,
|
||||
zAccountInFreezeError,
|
||||
zAccountNotFoundError,
|
||||
zEmailCodeError,
|
||||
zEmailCodeLoginRateLimitExceededError,
|
||||
zEmailCodeLoginServiceUnavailableError,
|
||||
zEmailDomainSuspendedError,
|
||||
zEmailSendIpLimitError,
|
||||
zInvalidEmailError,
|
||||
zInvalidOrExpiredTokenError,
|
||||
zLimitExceededError,
|
||||
zNormalizedEmailAlreadyInUseError,
|
||||
zNotAllowedCreateWorkspaceError,
|
||||
zTurnstileServiceUnavailableError,
|
||||
zTurnstileVerificationFailedError,
|
||||
} from './zod.gen.ts'
|
||||
import {
|
||||
zPostEmailCodeLoginBody,
|
||||
zPostEmailCodeLoginResponse,
|
||||
zPostEmailCodeLoginValidityBody,
|
||||
zPostEmailCodeLoginValidityResponse,
|
||||
} from './zod.gen.ts'
|
||||
|
||||
export const post = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postEmailCodeLoginValidity',
|
||||
path: '/email-code-login/validity',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ body: zPostEmailCodeLoginValidityBody }))
|
||||
.output(zPostEmailCodeLoginValidityResponse)
|
||||
.errors({
|
||||
account_banned: { status: 400, data: zAccountBannedError },
|
||||
account_in_freeze: { status: 400, data: zAccountInFreezeError },
|
||||
account_not_found: { status: 400, data: zAccountNotFoundError },
|
||||
email_code_error: { status: 400, data: zEmailCodeError },
|
||||
email_code_login_service_unavailable: {
|
||||
status: 503,
|
||||
data: zEmailCodeLoginServiceUnavailableError,
|
||||
},
|
||||
email_domain_suspended: { status: 400, data: zEmailDomainSuspendedError },
|
||||
invalid_email: { status: 400, data: zInvalidEmailError },
|
||||
invalid_or_expired_token: { status: 400, data: zInvalidOrExpiredTokenError },
|
||||
limit_exceeded: { status: 400, data: zLimitExceededError },
|
||||
normalized_email_already_in_use: { status: 400, data: zNormalizedEmailAlreadyInUseError },
|
||||
not_allowed_create_workspace: { status: 400, data: zNotAllowedCreateWorkspaceError },
|
||||
turnstile_service_unavailable: { status: 503, data: zTurnstileServiceUnavailableError },
|
||||
turnstile_verification_failed: { status: 400, data: zTurnstileVerificationFailedError },
|
||||
})
|
||||
|
||||
export const validity = {
|
||||
post,
|
||||
}
|
||||
|
||||
export const post2 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postEmailCodeLogin',
|
||||
path: '/email-code-login',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ body: zPostEmailCodeLoginBody }))
|
||||
.output(zPostEmailCodeLoginResponse)
|
||||
.errors({
|
||||
account_banned: { status: 400, data: zAccountBannedError },
|
||||
account_in_freeze: { status: 400, data: zAccountInFreezeError },
|
||||
email_code_login_rate_limit_exceeded: {
|
||||
status: 429,
|
||||
data: zEmailCodeLoginRateLimitExceededError,
|
||||
},
|
||||
email_code_login_service_unavailable: {
|
||||
status: 503,
|
||||
data: zEmailCodeLoginServiceUnavailableError,
|
||||
},
|
||||
email_domain_suspended: { status: 400, data: zEmailDomainSuspendedError },
|
||||
email_send_ip_limit: { status: 429, data: zEmailSendIpLimitError },
|
||||
turnstile_service_unavailable: { status: 503, data: zTurnstileServiceUnavailableError },
|
||||
turnstile_verification_failed: { status: 400, data: zTurnstileVerificationFailedError },
|
||||
})
|
||||
|
||||
export const emailCodeLogin = {
|
||||
post: post2,
|
||||
validity,
|
||||
}
|
||||
|
||||
export const contract = {
|
||||
emailCodeLogin,
|
||||
}
|
||||
+177
@@ -0,0 +1,177 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type ClientOptions = {
|
||||
baseUrl: `${string}://${string}/console/api` | (string & {})
|
||||
}
|
||||
|
||||
export type EmailCodeSendPayload = {
|
||||
email: string
|
||||
language?: string | null
|
||||
turnstile_token?: string | null
|
||||
}
|
||||
|
||||
export type SimpleResultDataResponse = {
|
||||
data: string
|
||||
result: string
|
||||
}
|
||||
|
||||
export type AccountBannedError = ErrorResponse & {
|
||||
code: 'account_banned'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type AccountInFreezeError = ErrorResponse & {
|
||||
code: 'account_in_freeze'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type EmailDomainSuspendedError = ErrorResponse & {
|
||||
code: 'email_domain_suspended'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type TurnstileVerificationFailedError = ErrorResponse & {
|
||||
code: 'turnstile_verification_failed'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type ErrorResponse = {
|
||||
code: string
|
||||
details?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
message: string
|
||||
params?: string
|
||||
status: number
|
||||
}
|
||||
|
||||
export type EmailCodeLoginRateLimitExceededError = ErrorResponse & {
|
||||
code: 'email_code_login_rate_limit_exceeded'
|
||||
status: 429
|
||||
}
|
||||
|
||||
export type EmailSendIpLimitError = ErrorResponse & {
|
||||
code: 'email_send_ip_limit'
|
||||
status: 429
|
||||
}
|
||||
|
||||
export type EmailCodeLoginServiceUnavailableError = ErrorResponse & {
|
||||
code: 'email_code_login_service_unavailable'
|
||||
status: 503
|
||||
}
|
||||
|
||||
export type TurnstileServiceUnavailableError = ErrorResponse & {
|
||||
code: 'turnstile_service_unavailable'
|
||||
status: 503
|
||||
}
|
||||
|
||||
export type EmailCodeLoginPayload = {
|
||||
code: string
|
||||
email: string
|
||||
language?: string | null
|
||||
timezone?: string | null
|
||||
token: string
|
||||
turnstile_token?: string | null
|
||||
}
|
||||
|
||||
export type SimpleResultResponse = {
|
||||
result: string
|
||||
}
|
||||
|
||||
export type AccountNotFoundError = ErrorResponse & {
|
||||
code: 'account_not_found'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type EmailCodeError = ErrorResponse & {
|
||||
code: 'email_code_error'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type InvalidEmailError = ErrorResponse & {
|
||||
code: 'invalid_email'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type InvalidOrExpiredTokenError = ErrorResponse & {
|
||||
code: 'invalid_or_expired_token'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type LimitExceededError = ErrorResponse & {
|
||||
code: 'limit_exceeded'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type NormalizedEmailAlreadyInUseError = ErrorResponse & {
|
||||
code: 'normalized_email_already_in_use'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type NotAllowedCreateWorkspaceError = ErrorResponse & {
|
||||
code: 'not_allowed_create_workspace'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type PostEmailCodeLoginData = {
|
||||
body: EmailCodeSendPayload
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/email-code-login'
|
||||
}
|
||||
|
||||
export type PostEmailCodeLoginErrors = {
|
||||
400:
|
||||
| AccountBannedError
|
||||
| AccountInFreezeError
|
||||
| EmailDomainSuspendedError
|
||||
| TurnstileVerificationFailedError
|
||||
| ErrorResponse
|
||||
429: EmailCodeLoginRateLimitExceededError | EmailSendIpLimitError | ErrorResponse
|
||||
503: EmailCodeLoginServiceUnavailableError | TurnstileServiceUnavailableError | ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type PostEmailCodeLoginError = PostEmailCodeLoginErrors[keyof PostEmailCodeLoginErrors]
|
||||
|
||||
export type PostEmailCodeLoginResponses = {
|
||||
200: SimpleResultDataResponse
|
||||
}
|
||||
|
||||
export type PostEmailCodeLoginResponse =
|
||||
PostEmailCodeLoginResponses[keyof PostEmailCodeLoginResponses]
|
||||
|
||||
export type PostEmailCodeLoginValidityData = {
|
||||
body: EmailCodeLoginPayload
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/email-code-login/validity'
|
||||
}
|
||||
|
||||
export type PostEmailCodeLoginValidityErrors = {
|
||||
400:
|
||||
| AccountBannedError
|
||||
| AccountInFreezeError
|
||||
| AccountNotFoundError
|
||||
| EmailCodeError
|
||||
| EmailDomainSuspendedError
|
||||
| InvalidEmailError
|
||||
| InvalidOrExpiredTokenError
|
||||
| LimitExceededError
|
||||
| NormalizedEmailAlreadyInUseError
|
||||
| NotAllowedCreateWorkspaceError
|
||||
| TurnstileVerificationFailedError
|
||||
| ErrorResponse
|
||||
503: EmailCodeLoginServiceUnavailableError | TurnstileServiceUnavailableError | ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type PostEmailCodeLoginValidityError =
|
||||
PostEmailCodeLoginValidityErrors[keyof PostEmailCodeLoginValidityErrors]
|
||||
|
||||
export type PostEmailCodeLoginValidityResponses = {
|
||||
200: SimpleResultResponse
|
||||
}
|
||||
|
||||
export type PostEmailCodeLoginValidityResponse =
|
||||
PostEmailCodeLoginValidityResponses[keyof PostEmailCodeLoginValidityResponses]
|
||||
+249
@@ -0,0 +1,249 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import * as z from 'zod'
|
||||
|
||||
/**
|
||||
* EmailCodeSendPayload
|
||||
*/
|
||||
export const zEmailCodeSendPayload = z.object({
|
||||
email: z.string(),
|
||||
language: z.string().nullish(),
|
||||
turnstile_token: z.string().max(2048).nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* SimpleResultDataResponse
|
||||
*/
|
||||
export const zSimpleResultDataResponse = z.object({
|
||||
data: z.string(),
|
||||
result: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* ErrorResponse
|
||||
*
|
||||
* Documented non-2xx body emitted by ``register_external_error_handlers``.
|
||||
*
|
||||
* ``params`` and ``details`` appear only on the errors that set them. The schema
|
||||
* stays open because ``HTTPException.data`` may carry extra keys.
|
||||
*/
|
||||
export const zErrorResponse = z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AccountBannedError
|
||||
*
|
||||
* Account is banned.
|
||||
*/
|
||||
export const zAccountBannedError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('account_banned'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* AccountInFreezeError
|
||||
*
|
||||
* This email account has been deleted within the past 30 days and is temporarily unavailable for new account registration.
|
||||
*/
|
||||
export const zAccountInFreezeError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('account_in_freeze'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* EmailDomainSuspendedError
|
||||
*
|
||||
* This email domain has been suspended.
|
||||
*/
|
||||
export const zEmailDomainSuspendedError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_domain_suspended'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* TurnstileVerificationFailedError
|
||||
*
|
||||
* Turnstile verification failed. Please try again.
|
||||
*/
|
||||
export const zTurnstileVerificationFailedError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('turnstile_verification_failed'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* EmailCodeLoginRateLimitExceededError
|
||||
*
|
||||
* Too many login emails have been sent. Please try again in {minutes} minutes.
|
||||
*/
|
||||
export const zEmailCodeLoginRateLimitExceededError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_code_login_rate_limit_exceeded'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* EmailSendIpLimitError
|
||||
*
|
||||
* Too many emails have been sent from this IP address recently. Please try again later.
|
||||
*/
|
||||
export const zEmailSendIpLimitError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_send_ip_limit'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* EmailCodeLoginServiceUnavailableError
|
||||
*
|
||||
* Email code verification is temporarily unavailable. Please try again later.
|
||||
*/
|
||||
export const zEmailCodeLoginServiceUnavailableError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_code_login_service_unavailable'),
|
||||
status: z.literal(503),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* TurnstileServiceUnavailableError
|
||||
*
|
||||
* Turnstile verification is temporarily unavailable. Please try again later.
|
||||
*/
|
||||
export const zTurnstileServiceUnavailableError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('turnstile_service_unavailable'),
|
||||
status: z.literal(503),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* EmailCodeLoginPayload
|
||||
*/
|
||||
export const zEmailCodeLoginPayload = z.object({
|
||||
code: z.string(),
|
||||
email: z.string(),
|
||||
language: z.string().nullish(),
|
||||
timezone: z.string().nullish(),
|
||||
token: z.uuid(),
|
||||
turnstile_token: z.string().max(2048).nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* SimpleResultResponse
|
||||
*/
|
||||
export const zSimpleResultResponse = z.object({
|
||||
result: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AccountNotFoundError
|
||||
*
|
||||
* Account not found.
|
||||
*/
|
||||
export const zAccountNotFoundError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('account_not_found'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* EmailCodeError
|
||||
*
|
||||
* Email code is invalid or expired.
|
||||
*/
|
||||
export const zEmailCodeError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_code_error'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* InvalidEmailError
|
||||
*
|
||||
* The email address is not valid.
|
||||
*/
|
||||
export const zInvalidEmailError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invalid_email'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* InvalidOrExpiredTokenError
|
||||
*
|
||||
* The token is invalid or has expired.
|
||||
*/
|
||||
export const zInvalidOrExpiredTokenError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invalid_or_expired_token'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* LimitExceededError
|
||||
*
|
||||
* Unable to create account because the licensed seats limit was exceeded
|
||||
*/
|
||||
export const zLimitExceededError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('limit_exceeded'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* NormalizedEmailAlreadyInUseError
|
||||
*
|
||||
* An account with an equivalent email address already exists.
|
||||
*/
|
||||
export const zNormalizedEmailAlreadyInUseError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('normalized_email_already_in_use'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* NotAllowedCreateWorkspaceError
|
||||
*
|
||||
* Workspace not found, please contact system admin to invite you to join in a workspace.
|
||||
*/
|
||||
export const zNotAllowedCreateWorkspaceError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('not_allowed_create_workspace'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
export const zPostEmailCodeLoginBody = zEmailCodeSendPayload
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zPostEmailCodeLoginResponse = zSimpleResultDataResponse
|
||||
|
||||
export const zPostEmailCodeLoginValidityBody = zEmailCodeLoginPayload
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zPostEmailCodeLoginValidityResponse = zSimpleResultResponse
|
||||
+131
@@ -0,0 +1,131 @@
|
||||
// This file is auto-generated by scripts/add-orpc-error-maps.ts
|
||||
import * as z from 'zod'
|
||||
|
||||
const zErrorResponse = /* @__PURE__ */ (() =>
|
||||
z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
}))()
|
||||
|
||||
const zAccountInFreezeError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('account_in_freeze'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zEmailAlreadyInUseError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_already_in_use'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zEmailDomainSuspendedError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_domain_suspended'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zInvalidOrExpiredTokenError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invalid_or_expired_token'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zLimitExceededError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('limit_exceeded'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zNormalizedEmailAlreadyInUseError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('normalized_email_already_in_use'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zPasswordMismatchError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('password_mismatch'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zEmailRegisterRateLimitExceededError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_register_rate_limit_exceeded'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zEmailSendIpLimitError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_send_ip_limit'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zEmailCodeError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_code_error'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zInvalidEmailError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invalid_email'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zEmailRegisterLimitError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_register_limit'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
))()
|
||||
|
||||
export const postErrors = {
|
||||
account_in_freeze: { status: 400, data: zAccountInFreezeError },
|
||||
email_domain_suspended: { status: 400, data: zEmailDomainSuspendedError },
|
||||
email_register_rate_limit_exceeded: { status: 429, data: zEmailRegisterRateLimitExceededError },
|
||||
email_send_ip_limit: { status: 429, data: zEmailSendIpLimitError },
|
||||
}
|
||||
|
||||
export const post2Errors = {
|
||||
email_code_error: { status: 400, data: zEmailCodeError },
|
||||
email_register_limit: { status: 429, data: zEmailRegisterLimitError },
|
||||
invalid_email: { status: 400, data: zInvalidEmailError },
|
||||
invalid_or_expired_token: { status: 400, data: zInvalidOrExpiredTokenError },
|
||||
}
|
||||
|
||||
export const post3Errors = {
|
||||
account_in_freeze: { status: 400, data: zAccountInFreezeError },
|
||||
email_already_in_use: { status: 400, data: zEmailAlreadyInUseError },
|
||||
email_domain_suspended: { status: 400, data: zEmailDomainSuspendedError },
|
||||
invalid_or_expired_token: { status: 400, data: zInvalidOrExpiredTokenError },
|
||||
limit_exceeded: { status: 400, data: zLimitExceededError },
|
||||
normalized_email_already_in_use: { status: 400, data: zNormalizedEmailAlreadyInUseError },
|
||||
password_mismatch: { status: 400, data: zPasswordMismatchError },
|
||||
}
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { oc } from '@orpc/contract'
|
||||
import * as z from 'zod'
|
||||
import {
|
||||
zAccountInFreezeError,
|
||||
zEmailAlreadyInUseError,
|
||||
zEmailCodeError,
|
||||
zEmailDomainSuspendedError,
|
||||
zEmailRegisterLimitError,
|
||||
zEmailRegisterRateLimitExceededError,
|
||||
zEmailSendIpLimitError,
|
||||
zInvalidEmailError,
|
||||
zInvalidOrExpiredTokenError,
|
||||
zLimitExceededError,
|
||||
zNormalizedEmailAlreadyInUseError,
|
||||
zPasswordMismatchError,
|
||||
} from './zod.gen.ts'
|
||||
import {
|
||||
zPostEmailRegisterBody,
|
||||
zPostEmailRegisterResponse,
|
||||
zPostEmailRegisterSendEmailBody,
|
||||
zPostEmailRegisterSendEmailResponse,
|
||||
zPostEmailRegisterValidityBody,
|
||||
zPostEmailRegisterValidityResponse,
|
||||
} from './zod.gen.ts'
|
||||
|
||||
export const post = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postEmailRegisterSendEmail',
|
||||
path: '/email-register/send-email',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ body: zPostEmailRegisterSendEmailBody }))
|
||||
.output(zPostEmailRegisterSendEmailResponse)
|
||||
.errors({
|
||||
account_in_freeze: { status: 400, data: zAccountInFreezeError },
|
||||
email_domain_suspended: { status: 400, data: zEmailDomainSuspendedError },
|
||||
email_register_rate_limit_exceeded: { status: 429, data: zEmailRegisterRateLimitExceededError },
|
||||
email_send_ip_limit: { status: 429, data: zEmailSendIpLimitError },
|
||||
})
|
||||
|
||||
export const sendEmail = {
|
||||
post,
|
||||
}
|
||||
|
||||
export const post2 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postEmailRegisterValidity',
|
||||
path: '/email-register/validity',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ body: zPostEmailRegisterValidityBody }))
|
||||
.output(zPostEmailRegisterValidityResponse)
|
||||
.errors({
|
||||
email_code_error: { status: 400, data: zEmailCodeError },
|
||||
email_register_limit: { status: 429, data: zEmailRegisterLimitError },
|
||||
invalid_email: { status: 400, data: zInvalidEmailError },
|
||||
invalid_or_expired_token: { status: 400, data: zInvalidOrExpiredTokenError },
|
||||
})
|
||||
|
||||
export const validity = {
|
||||
post: post2,
|
||||
}
|
||||
|
||||
export const post3 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postEmailRegister',
|
||||
path: '/email-register',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ body: zPostEmailRegisterBody }))
|
||||
.output(zPostEmailRegisterResponse)
|
||||
.errors({
|
||||
account_in_freeze: { status: 400, data: zAccountInFreezeError },
|
||||
email_already_in_use: { status: 400, data: zEmailAlreadyInUseError },
|
||||
email_domain_suspended: { status: 400, data: zEmailDomainSuspendedError },
|
||||
invalid_or_expired_token: { status: 400, data: zInvalidOrExpiredTokenError },
|
||||
limit_exceeded: { status: 400, data: zLimitExceededError },
|
||||
normalized_email_already_in_use: { status: 400, data: zNormalizedEmailAlreadyInUseError },
|
||||
password_mismatch: { status: 400, data: zPasswordMismatchError },
|
||||
})
|
||||
|
||||
export const emailRegister = {
|
||||
post: post3,
|
||||
sendEmail,
|
||||
validity,
|
||||
}
|
||||
|
||||
export const contract = {
|
||||
emailRegister,
|
||||
}
|
||||
+190
@@ -0,0 +1,190 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type ClientOptions = {
|
||||
baseUrl: `${string}://${string}/console/api` | (string & {})
|
||||
}
|
||||
|
||||
export type EmailRegisterResetPayload = {
|
||||
language?: string | null
|
||||
new_password: string
|
||||
password_confirm: string
|
||||
timezone?: string | null
|
||||
token: string
|
||||
}
|
||||
|
||||
export type EmailRegisterResetResponse = {
|
||||
data: EmailRegisterTokenPairResponse
|
||||
result: string
|
||||
}
|
||||
|
||||
export type AccountInFreezeError = ErrorResponse & {
|
||||
code: 'account_in_freeze'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type EmailAlreadyInUseError = ErrorResponse & {
|
||||
code: 'email_already_in_use'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type EmailDomainSuspendedError = ErrorResponse & {
|
||||
code: 'email_domain_suspended'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type InvalidOrExpiredTokenError = ErrorResponse & {
|
||||
code: 'invalid_or_expired_token'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type LimitExceededError = ErrorResponse & {
|
||||
code: 'limit_exceeded'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type NormalizedEmailAlreadyInUseError = ErrorResponse & {
|
||||
code: 'normalized_email_already_in_use'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type PasswordMismatchError = ErrorResponse & {
|
||||
code: 'password_mismatch'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type ErrorResponse = {
|
||||
code: string
|
||||
details?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
message: string
|
||||
params?: string
|
||||
status: number
|
||||
}
|
||||
|
||||
export type EmailRegisterSendPayload = {
|
||||
email: string
|
||||
language?: string | null
|
||||
}
|
||||
|
||||
export type SimpleResultDataResponse = {
|
||||
data: string
|
||||
result: string
|
||||
}
|
||||
|
||||
export type EmailRegisterRateLimitExceededError = ErrorResponse & {
|
||||
code: 'email_register_rate_limit_exceeded'
|
||||
status: 429
|
||||
}
|
||||
|
||||
export type EmailSendIpLimitError = ErrorResponse & {
|
||||
code: 'email_send_ip_limit'
|
||||
status: 429
|
||||
}
|
||||
|
||||
export type EmailRegisterValidityPayload = {
|
||||
code: string
|
||||
email: string
|
||||
token: string
|
||||
}
|
||||
|
||||
export type VerificationTokenResponse = {
|
||||
email: string
|
||||
is_valid: boolean
|
||||
token: string
|
||||
}
|
||||
|
||||
export type EmailCodeError = ErrorResponse & {
|
||||
code: 'email_code_error'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type InvalidEmailError = ErrorResponse & {
|
||||
code: 'invalid_email'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type EmailRegisterLimitError = ErrorResponse & {
|
||||
code: 'email_register_limit'
|
||||
status: 429
|
||||
}
|
||||
|
||||
export type EmailRegisterTokenPairResponse = {
|
||||
access_token: string
|
||||
csrf_token: string
|
||||
refresh_token: string
|
||||
}
|
||||
|
||||
export type PostEmailRegisterData = {
|
||||
body: EmailRegisterResetPayload
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/email-register'
|
||||
}
|
||||
|
||||
export type PostEmailRegisterErrors = {
|
||||
400:
|
||||
| AccountInFreezeError
|
||||
| EmailAlreadyInUseError
|
||||
| EmailDomainSuspendedError
|
||||
| InvalidOrExpiredTokenError
|
||||
| LimitExceededError
|
||||
| NormalizedEmailAlreadyInUseError
|
||||
| PasswordMismatchError
|
||||
| ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type PostEmailRegisterError = PostEmailRegisterErrors[keyof PostEmailRegisterErrors]
|
||||
|
||||
export type PostEmailRegisterResponses = {
|
||||
200: EmailRegisterResetResponse
|
||||
}
|
||||
|
||||
export type PostEmailRegisterResponse = PostEmailRegisterResponses[keyof PostEmailRegisterResponses]
|
||||
|
||||
export type PostEmailRegisterSendEmailData = {
|
||||
body: EmailRegisterSendPayload
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/email-register/send-email'
|
||||
}
|
||||
|
||||
export type PostEmailRegisterSendEmailErrors = {
|
||||
400: AccountInFreezeError | EmailDomainSuspendedError | ErrorResponse
|
||||
429: EmailRegisterRateLimitExceededError | EmailSendIpLimitError | ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type PostEmailRegisterSendEmailError =
|
||||
PostEmailRegisterSendEmailErrors[keyof PostEmailRegisterSendEmailErrors]
|
||||
|
||||
export type PostEmailRegisterSendEmailResponses = {
|
||||
200: SimpleResultDataResponse
|
||||
}
|
||||
|
||||
export type PostEmailRegisterSendEmailResponse =
|
||||
PostEmailRegisterSendEmailResponses[keyof PostEmailRegisterSendEmailResponses]
|
||||
|
||||
export type PostEmailRegisterValidityData = {
|
||||
body: EmailRegisterValidityPayload
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/email-register/validity'
|
||||
}
|
||||
|
||||
export type PostEmailRegisterValidityErrors = {
|
||||
400: EmailCodeError | InvalidEmailError | InvalidOrExpiredTokenError | ErrorResponse
|
||||
429: EmailRegisterLimitError | ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type PostEmailRegisterValidityError =
|
||||
PostEmailRegisterValidityErrors[keyof PostEmailRegisterValidityErrors]
|
||||
|
||||
export type PostEmailRegisterValidityResponses = {
|
||||
200: VerificationTokenResponse
|
||||
}
|
||||
|
||||
export type PostEmailRegisterValidityResponse =
|
||||
PostEmailRegisterValidityResponses[keyof PostEmailRegisterValidityResponses]
|
||||
+246
@@ -0,0 +1,246 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import * as z from 'zod'
|
||||
|
||||
/**
|
||||
* EmailRegisterResetPayload
|
||||
*/
|
||||
export const zEmailRegisterResetPayload = z.object({
|
||||
language: z.string().nullish(),
|
||||
new_password: z.string(),
|
||||
password_confirm: z.string(),
|
||||
timezone: z.string().nullish(),
|
||||
token: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* ErrorResponse
|
||||
*
|
||||
* Documented non-2xx body emitted by ``register_external_error_handlers``.
|
||||
*
|
||||
* ``params`` and ``details`` appear only on the errors that set them. The schema
|
||||
* stays open because ``HTTPException.data`` may carry extra keys.
|
||||
*/
|
||||
export const zErrorResponse = z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AccountInFreezeError
|
||||
*
|
||||
* This email account has been deleted within the past 30 days and is temporarily unavailable for new account registration.
|
||||
*/
|
||||
export const zAccountInFreezeError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('account_in_freeze'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* EmailAlreadyInUseError
|
||||
*
|
||||
* A user with this email already exists.
|
||||
*/
|
||||
export const zEmailAlreadyInUseError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_already_in_use'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* EmailDomainSuspendedError
|
||||
*
|
||||
* This email domain has been suspended.
|
||||
*/
|
||||
export const zEmailDomainSuspendedError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_domain_suspended'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* InvalidOrExpiredTokenError
|
||||
*
|
||||
* The token is invalid or has expired.
|
||||
*/
|
||||
export const zInvalidOrExpiredTokenError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invalid_or_expired_token'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* LimitExceededError
|
||||
*
|
||||
* Unable to create account because the licensed seats limit was exceeded
|
||||
*/
|
||||
export const zLimitExceededError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('limit_exceeded'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* NormalizedEmailAlreadyInUseError
|
||||
*
|
||||
* An account with an equivalent email address already exists.
|
||||
*/
|
||||
export const zNormalizedEmailAlreadyInUseError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('normalized_email_already_in_use'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* PasswordMismatchError
|
||||
*
|
||||
* The passwords do not match.
|
||||
*/
|
||||
export const zPasswordMismatchError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('password_mismatch'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* EmailRegisterSendPayload
|
||||
*/
|
||||
export const zEmailRegisterSendPayload = z.object({
|
||||
email: z.string(),
|
||||
language: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* SimpleResultDataResponse
|
||||
*/
|
||||
export const zSimpleResultDataResponse = z.object({
|
||||
data: z.string(),
|
||||
result: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* EmailRegisterRateLimitExceededError
|
||||
*
|
||||
* Too many email register emails have been sent. Please try again in {minutes} minutes.
|
||||
*/
|
||||
export const zEmailRegisterRateLimitExceededError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_register_rate_limit_exceeded'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* EmailSendIpLimitError
|
||||
*
|
||||
* Too many emails have been sent from this IP address recently. Please try again later.
|
||||
*/
|
||||
export const zEmailSendIpLimitError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_send_ip_limit'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* EmailRegisterValidityPayload
|
||||
*/
|
||||
export const zEmailRegisterValidityPayload = z.object({
|
||||
code: z.string(),
|
||||
email: z.string(),
|
||||
token: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* VerificationTokenResponse
|
||||
*/
|
||||
export const zVerificationTokenResponse = z.object({
|
||||
email: z.string(),
|
||||
is_valid: z.boolean(),
|
||||
token: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* EmailCodeError
|
||||
*
|
||||
* Email code is invalid or expired.
|
||||
*/
|
||||
export const zEmailCodeError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_code_error'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* InvalidEmailError
|
||||
*
|
||||
* The email address is not valid.
|
||||
*/
|
||||
export const zInvalidEmailError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invalid_email'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* EmailRegisterLimitError
|
||||
*
|
||||
* Too many failed email register attempts. Please try again in 24 hours.
|
||||
*/
|
||||
export const zEmailRegisterLimitError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_register_limit'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* EmailRegisterTokenPairResponse
|
||||
*/
|
||||
export const zEmailRegisterTokenPairResponse = z.object({
|
||||
access_token: z.string(),
|
||||
csrf_token: z.string(),
|
||||
refresh_token: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* EmailRegisterResetResponse
|
||||
*/
|
||||
export const zEmailRegisterResetResponse = z.object({
|
||||
data: zEmailRegisterTokenPairResponse,
|
||||
result: z.string(),
|
||||
})
|
||||
|
||||
export const zPostEmailRegisterBody = zEmailRegisterResetPayload
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zPostEmailRegisterResponse = zEmailRegisterResetResponse
|
||||
|
||||
export const zPostEmailRegisterSendEmailBody = zEmailRegisterSendPayload
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zPostEmailRegisterSendEmailResponse = zSimpleResultDataResponse
|
||||
|
||||
export const zPostEmailRegisterValidityBody = zEmailRegisterValidityPayload
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zPostEmailRegisterValidityResponse = zVerificationTokenResponse
|
||||
@@ -0,0 +1,583 @@
|
||||
// This file is auto-generated by scripts/add-orpc-error-maps.ts
|
||||
export { delete10Errors as 'DELETE /apps/{app_id}/workflow/comments/{comment_id}' } from './apps/errors.gen.ts'
|
||||
export { delete10Errors as 'DELETE /knowledge-fs/spaces/{control_space_id}/research-tasks/{task_id}' } from './knowledge-fs/errors.gen.ts'
|
||||
export { delete11Errors as 'DELETE /apps/{app_id}/workflows/draft/nodes/{node_id}/variables' } from './apps/errors.gen.ts'
|
||||
export { delete11Errors as 'DELETE /knowledge-fs/spaces/{control_space_id}/sources/{source_id}' } from './knowledge-fs/errors.gen.ts'
|
||||
export { delete12Errors as 'DELETE /apps/{app_id}/workflows/draft/variables/{variable_id}' } from './apps/errors.gen.ts'
|
||||
export { delete12Errors as 'DELETE /knowledge-fs/spaces/{control_space_id}' } from './knowledge-fs/errors.gen.ts'
|
||||
export { delete12Errors as 'DELETE /workspaces/current/network-access-groups/{group_id}' } from './workspaces/errors.gen.ts'
|
||||
export { delete13Errors as 'DELETE /apps/{app_id}/workflows/draft/variables' } from './apps/errors.gen.ts'
|
||||
export { delete13Errors as 'DELETE /knowledge-fs/uploads/{upload_id}' } from './knowledge-fs/errors.gen.ts'
|
||||
export { delete14Errors as 'DELETE /apps/{app_id}/workflows/{workflow_id}' } from './apps/errors.gen.ts'
|
||||
export { delete20Errors as 'DELETE /workspaces/current/skills/{skill_id}' } from './workspaces/errors.gen.ts'
|
||||
export { delete2Errors as 'DELETE /agent/{agent_id}/build-draft' } from './agent/errors.gen.ts'
|
||||
export { delete2Errors as 'DELETE /apps/{app_id}/agent/config/skills/{name}' } from './apps/errors.gen.ts'
|
||||
export { delete2Errors as 'DELETE /datasets/external-knowledge-api/{external_knowledge_api_id}' } from './datasets/errors.gen.ts'
|
||||
export { delete2Errors as 'DELETE /installed-apps/{installed_app_id}/saved-messages/{message_id}' } from './installed-apps/errors.gen.ts'
|
||||
export { delete2Errors as 'DELETE /knowledge-fs/spaces/{control_space_id}/app-bindings/{caller_kind}/{app_id}' } from './knowledge-fs/errors.gen.ts'
|
||||
export { delete2Errors as 'DELETE /rag/pipelines/{pipeline_id}/workflows/draft/nodes/{node_id}/variables' } from './rag/errors.gen.ts'
|
||||
export { delete3Errors as 'DELETE /agent/{agent_id}/config/files/{name}' } from './agent/errors.gen.ts'
|
||||
export { delete3Errors as 'DELETE /datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks/{child_chunk_id}' } from './datasets/errors.gen.ts'
|
||||
export { delete3Errors as 'DELETE /knowledge-fs/spaces/{control_space_id}/documents/bulk' } from './knowledge-fs/errors.gen.ts'
|
||||
export { delete3Errors as 'DELETE /rag/pipelines/{pipeline_id}/workflows/draft/variables/{variable_id}' } from './rag/errors.gen.ts'
|
||||
export { delete4Errors as 'DELETE /agent/{agent_id}/config/skills/{name}' } from './agent/errors.gen.ts'
|
||||
export { delete4Errors as 'DELETE /apps/{app_id}/annotations' } from './apps/errors.gen.ts'
|
||||
export { delete4Errors as 'DELETE /knowledge-fs/spaces/{control_space_id}/documents/{document_id}' } from './knowledge-fs/errors.gen.ts'
|
||||
export { delete4Errors as 'DELETE /rag/pipelines/{pipeline_id}/workflows/draft/variables' } from './rag/errors.gen.ts'
|
||||
export { delete5Errors as 'DELETE /agent/{agent_id}/trace-config' } from './agent/errors.gen.ts'
|
||||
export { delete5Errors as 'DELETE /apps/{app_id}/chat-conversations/{conversation_id}' } from './apps/errors.gen.ts'
|
||||
export { delete5Errors as 'DELETE /knowledge-fs/spaces/{control_space_id}/golden-questions/{question_id}' } from './knowledge-fs/errors.gen.ts'
|
||||
export { delete5Errors as 'DELETE /rag/pipelines/{pipeline_id}/workflows/{workflow_id}' } from './rag/errors.gen.ts'
|
||||
export { delete6Errors as 'DELETE /agent/{agent_id}' } from './agent/errors.gen.ts'
|
||||
export { delete6Errors as 'DELETE /apps/{app_id}/completion-conversations/{conversation_id}' } from './apps/errors.gen.ts'
|
||||
export { delete6Errors as 'DELETE /knowledge-fs/spaces/{control_space_id}/jobs/{job_id}' } from './knowledge-fs/errors.gen.ts'
|
||||
export { delete7Errors as 'DELETE /knowledge-fs/spaces/{control_space_id}/logical-documents/bulk' } from './knowledge-fs/errors.gen.ts'
|
||||
export { delete8Errors as 'DELETE /apps/{app_id}/trace-config' } from './apps/errors.gen.ts'
|
||||
export { delete8Errors as 'DELETE /knowledge-fs/spaces/{control_space_id}/logical-documents/{document_id}' } from './knowledge-fs/errors.gen.ts'
|
||||
export { delete8Errors as 'DELETE /workspaces/current/members/{member_id}' } from './workspaces/errors.gen.ts'
|
||||
export { delete9Errors as 'DELETE /apps/{app_id}/workflow/comments/{comment_id}/replies/{reply_id}' } from './apps/errors.gen.ts'
|
||||
export { delete9Errors as 'DELETE /knowledge-fs/spaces/{control_space_id}/metadata/{field_id}' } from './knowledge-fs/errors.gen.ts'
|
||||
export { delete_Errors as 'DELETE /apps/{app_id}/agent/config/files/{name}' } from './apps/errors.gen.ts'
|
||||
export { delete_Errors as 'DELETE /installed-apps/{installed_app_id}/conversations/{c_id}' } from './installed-apps/errors.gen.ts'
|
||||
export { delete_Errors as 'DELETE /knowledge-fs/source-provider-preview/jobs/{job_id}' } from './knowledge-fs/errors.gen.ts'
|
||||
export { delete_Errors as 'DELETE /workflow-run-archives/{year}/{month}' } from './workflow-run-archives/errors.gen.ts'
|
||||
export { get101Errors as 'GET /workspaces/current/summary' } from './workspaces/errors.gen.ts'
|
||||
export { get10Errors as 'GET /agent/{agent_id}/config/files/{name}/preview' } from './agent/errors.gen.ts'
|
||||
export { get10Errors as 'GET /apps/{app_id}/agent/config/skills/{name}/download' } from './apps/errors.gen.ts'
|
||||
export { get10Errors as 'GET /knowledge-fs/spaces/{control_space_id}/documents/{document_id}/multimodal' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get10Errors as 'GET /rag/pipelines/{pipeline_id}/workflows/default-workflow-block-configs/{block_type}' } from './rag/errors.gen.ts'
|
||||
export { get10Errors as 'GET /trial-apps/{app_id}/agent/config/skills' } from './trial-apps/errors.gen.ts'
|
||||
export { get11Errors as 'GET /agent/{agent_id}/config/files' } from './agent/errors.gen.ts'
|
||||
export { get11Errors as 'GET /apps/{app_id}/agent/config/skills/{name}/files/content' } from './apps/errors.gen.ts'
|
||||
export { get11Errors as 'GET /knowledge-fs/spaces/{control_space_id}/documents/{document_id}/outline' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get11Errors as 'GET /rag/pipelines/{pipeline_id}/workflows/default-workflow-block-configs' } from './rag/errors.gen.ts'
|
||||
export { get11Errors as 'GET /trial-apps/{app_id}/datasets' } from './trial-apps/errors.gen.ts'
|
||||
export { get12Errors as 'GET /agent/{agent_id}/config/manifest' } from './agent/errors.gen.ts'
|
||||
export { get12Errors as 'GET /apps/{app_id}/agent/config/skills/{name}/files/download' } from './apps/errors.gen.ts'
|
||||
export { get12Errors as 'GET /knowledge-fs/spaces/{control_space_id}/documents/{document_id}/revisions/{revision}/chunks/{chunk_id}' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get12Errors as 'GET /rag/pipelines/{pipeline_id}/workflows/draft/environment-variables' } from './rag/errors.gen.ts'
|
||||
export { get12Errors as 'GET /trial-apps/{app_id}/export' } from './trial-apps/errors.gen.ts'
|
||||
export { get13Errors as 'GET /agent/{agent_id}/config/skills/{name}/download' } from './agent/errors.gen.ts'
|
||||
export { get13Errors as 'GET /apps/{app_id}/agent/config/skills/{name}/files/preview' } from './apps/errors.gen.ts'
|
||||
export { get13Errors as 'GET /datasets/{dataset_id}/batch/{batch}/indexing-estimate' } from './datasets/errors.gen.ts'
|
||||
export { get13Errors as 'GET /knowledge-fs/spaces/{control_space_id}/documents/{document_id}/revisions/{revision}/chunks' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get13Errors as 'GET /rag/pipelines/{pipeline_id}/workflows/draft/nodes/{node_id}/last-run' } from './rag/errors.gen.ts'
|
||||
export { get13Errors as 'GET /trial-apps/{app_id}/messages/{message_id}/suggested-questions' } from './trial-apps/errors.gen.ts'
|
||||
export { get14Errors as 'GET /agent/{agent_id}/config/skills/{name}/files/content' } from './agent/errors.gen.ts'
|
||||
export { get14Errors as 'GET /apps/{app_id}/agent/config/skills/{name}/inspect' } from './apps/errors.gen.ts'
|
||||
export { get14Errors as 'GET /knowledge-fs/spaces/{control_space_id}/documents/{document_id}/revisions' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get14Errors as 'GET /rag/pipelines/{pipeline_id}/workflows/draft/nodes/{node_id}/variables' } from './rag/errors.gen.ts'
|
||||
export { get14Errors as 'GET /snippets/{snippet_id}/workflows/draft/variables' } from './snippets/errors.gen.ts'
|
||||
export { get14Errors as 'GET /trial-apps/{app_id}/parameters' } from './trial-apps/errors.gen.ts'
|
||||
export { get15Errors as 'GET /agent/{agent_id}/config/skills/{name}/files/download' } from './agent/errors.gen.ts'
|
||||
export { get15Errors as 'GET /apps/{app_id}/agent/config/skills' } from './apps/errors.gen.ts'
|
||||
export { get15Errors as 'GET /knowledge-fs/spaces/{control_space_id}/documents/{document_id}' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get15Errors as 'GET /rag/pipelines/{pipeline_id}/workflows/draft/pre-processing/parameters' } from './rag/errors.gen.ts'
|
||||
export { get15Errors as 'GET /snippets/{snippet_id}/workflows/draft' } from './snippets/errors.gen.ts'
|
||||
export { get15Errors as 'GET /trial-apps/{app_id}/site' } from './trial-apps/errors.gen.ts'
|
||||
export { get16Errors as 'GET /agent/{agent_id}/config/skills/{name}/files/preview' } from './agent/errors.gen.ts'
|
||||
export { get16Errors as 'GET /apps/{app_id}/agent/logs' } from './apps/errors.gen.ts'
|
||||
export { get16Errors as 'GET /datasets/{dataset_id}/documents/{document_id}/indexing-estimate' } from './datasets/errors.gen.ts'
|
||||
export { get16Errors as 'GET /knowledge-fs/spaces/{control_space_id}/documents' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get16Errors as 'GET /rag/pipelines/{pipeline_id}/workflows/draft/processing/parameters' } from './rag/errors.gen.ts'
|
||||
export { get16Errors as 'GET /trial-apps/{app_id}/workflows' } from './trial-apps/errors.gen.ts'
|
||||
export { get17Errors as 'GET /agent/{agent_id}/config/skills/{name}/inspect' } from './agent/errors.gen.ts'
|
||||
export { get17Errors as 'GET /knowledge-fs/spaces/{control_space_id}/external-access' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get17Errors as 'GET /rag/pipelines/{pipeline_id}/workflows/draft/system-variables' } from './rag/errors.gen.ts'
|
||||
export { get17Errors as 'GET /trial-apps/{app_id}' } from './trial-apps/errors.gen.ts'
|
||||
export { get18Errors as 'GET /agent/{agent_id}/config/skills' } from './agent/errors.gen.ts'
|
||||
export { get18Errors as 'GET /datasets/{dataset_id}/documents/{document_id}/notion/sync' } from './datasets/errors.gen.ts'
|
||||
export { get18Errors as 'GET /knowledge-fs/spaces/{control_space_id}/golden-questions' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get18Errors as 'GET /rag/pipelines/{pipeline_id}/workflows/draft/variables/{variable_id}' } from './rag/errors.gen.ts'
|
||||
export { get19Errors as 'GET /agent/{agent_id}/log-sources' } from './agent/errors.gen.ts'
|
||||
export { get19Errors as 'GET /knowledge-fs/spaces/{control_space_id}/jobs/{job_id}' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get19Errors as 'GET /rag/pipelines/{pipeline_id}/workflows/draft/variables' } from './rag/errors.gen.ts'
|
||||
export { get20Errors as 'GET /agent/{agent_id}/logs/{conversation_id}/messages' } from './agent/errors.gen.ts'
|
||||
export { get20Errors as 'GET /apps/{app_id}/annotations/count' } from './apps/errors.gen.ts'
|
||||
export { get20Errors as 'GET /knowledge-fs/spaces/{control_space_id}/logical-documents/{document_id}/download' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get20Errors as 'GET /rag/pipelines/{pipeline_id}/workflows/draft' } from './rag/errors.gen.ts'
|
||||
export { get21Errors as 'GET /agent/{agent_id}/logs' } from './agent/errors.gen.ts'
|
||||
export { get21Errors as 'GET /knowledge-fs/spaces/{control_space_id}/logical-documents/{document_id}' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get21Errors as 'GET /rag/pipelines/{pipeline_id}/workflows/publish' } from './rag/errors.gen.ts'
|
||||
export { get22Errors as 'GET /agent/{agent_id}/messages/{message_id}' } from './agent/errors.gen.ts'
|
||||
export { get22Errors as 'GET /knowledge-fs/spaces/{control_space_id}/logical-documents' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get22Errors as 'GET /rag/pipelines/{pipeline_id}/workflows/published/pre-processing/parameters' } from './rag/errors.gen.ts'
|
||||
export { get23Errors as 'GET /agent/{agent_id}/referencing-workflows' } from './agent/errors.gen.ts'
|
||||
export { get23Errors as 'GET /datasets/{dataset_id}/documents/{document_id}/website-sync' } from './datasets/errors.gen.ts'
|
||||
export { get23Errors as 'GET /knowledge-fs/spaces/{control_space_id}/metadata' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get23Errors as 'GET /rag/pipelines/{pipeline_id}/workflows/published/processing/parameters' } from './rag/errors.gen.ts'
|
||||
export { get24Errors as 'GET /agent/{agent_id}/sandbox/files/read' } from './agent/errors.gen.ts'
|
||||
export { get24Errors as 'GET /apps/{app_id}/chat-conversations/{conversation_id}' } from './apps/errors.gen.ts'
|
||||
export { get24Errors as 'GET /datasets/{dataset_id}/documents/{document_id}' } from './datasets/errors.gen.ts'
|
||||
export { get24Errors as 'GET /knowledge-fs/spaces/{control_space_id}/overview/activity' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get24Errors as 'GET /rag/pipelines/{pipeline_id}/workflows' } from './rag/errors.gen.ts'
|
||||
export { get25Errors as 'GET /agent/{agent_id}/sandbox/files' } from './agent/errors.gen.ts'
|
||||
export { get25Errors as 'GET /apps/{app_id}/chat-conversations' } from './apps/errors.gen.ts'
|
||||
export { get25Errors as 'GET /knowledge-fs/spaces/{control_space_id}/overview/attention' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get26Errors as 'GET /agent/{agent_id}/sandbox' } from './agent/errors.gen.ts'
|
||||
export { get26Errors as 'GET /apps/{app_id}/chat-messages/{message_id}/suggested-questions' } from './apps/errors.gen.ts'
|
||||
export { get26Errors as 'GET /knowledge-fs/spaces/{control_space_id}/overview/health' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get27Errors as 'GET /agent/{agent_id}/statistics/summary' } from './agent/errors.gen.ts'
|
||||
export { get27Errors as 'GET /apps/{app_id}/chat-messages' } from './apps/errors.gen.ts'
|
||||
export { get27Errors as 'GET /knowledge-fs/spaces/{control_space_id}/overview/inventory' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get28Errors as 'GET /agent/{agent_id}/text-to-audio/voices' } from './agent/errors.gen.ts'
|
||||
export { get28Errors as 'GET /apps/{app_id}/completion-conversations/{conversation_id}' } from './apps/errors.gen.ts'
|
||||
export { get28Errors as 'GET /knowledge-fs/spaces/{control_space_id}/overview/query-outcomes' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get29Errors as 'GET /apps/{app_id}/completion-conversations' } from './apps/errors.gen.ts'
|
||||
export { get29Errors as 'GET /knowledge-fs/spaces/{control_space_id}/overview/stats' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get2Errors as 'GET /account/delete/verify' } from './account/errors.gen.ts'
|
||||
export { get2Errors as 'GET /agent/{agent_id}/api-access' } from './agent/errors.gen.ts'
|
||||
export { get2Errors as 'GET /billing/subscription' } from './billing/errors.gen.ts'
|
||||
export { get2Errors as 'GET /explore/apps/{app_id}' } from './explore/errors.gen.ts'
|
||||
export { get2Errors as 'GET /form/human_input/{form_token}' } from './form/errors.gen.ts'
|
||||
export { get2Errors as 'GET /installed-apps/{installed_app_id}/messages/{message_id}/more-like-this' } from './installed-apps/errors.gen.ts'
|
||||
export { get2Errors as 'GET /notion/pre-import/pages' } from './notion/errors.gen.ts'
|
||||
export { get2Errors as 'GET /trial-apps/{app_id}/agent/config/files/{name}/download' } from './trial-apps/errors.gen.ts'
|
||||
export { get2Errors as 'GET /workflow-run-archives' } from './workflow-run-archives/errors.gen.ts'
|
||||
export { get30Errors as 'GET /agent/{agent_id}/trace-capabilities' } from './agent/errors.gen.ts'
|
||||
export { get30Errors as 'GET /apps/{app_id}/conversation-variables' } from './apps/errors.gen.ts'
|
||||
export { get30Errors as 'GET /knowledge-fs/spaces/{control_space_id}/permissions' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get31Errors as 'GET /agent/{agent_id}/trace-config' } from './agent/errors.gen.ts'
|
||||
export { get31Errors as 'GET /apps/{app_id}/export' } from './apps/errors.gen.ts'
|
||||
export { get31Errors as 'GET /datasets/{dataset_id}/notion/sync' } from './datasets/errors.gen.ts'
|
||||
export { get31Errors as 'GET /knowledge-fs/spaces/{control_space_id}/quality/bad-cases/{bad_case_id}/trace-reference' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get32Errors as 'GET /agent/{agent_id}/trace-runs/{message_id}' } from './agent/errors.gen.ts'
|
||||
export { get32Errors as 'GET /apps/{app_id}/messages/{message_id}' } from './apps/errors.gen.ts'
|
||||
export { get32Errors as 'GET /knowledge-fs/spaces/{control_space_id}/quality/bad-cases/{bad_case_id}' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get33Errors as 'GET /agent/{agent_id}/versions/{version_id}' } from './agent/errors.gen.ts'
|
||||
export { get33Errors as 'GET /apps/{app_id}/network-access-group/status' } from './apps/errors.gen.ts'
|
||||
export { get33Errors as 'GET /knowledge-fs/spaces/{control_space_id}/quality/bad-cases' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get34Errors as 'GET /agent/{agent_id}/versions' } from './agent/errors.gen.ts'
|
||||
export { get34Errors as 'GET /apps/{app_id}/network-access-group' } from './apps/errors.gen.ts'
|
||||
export { get34Errors as 'GET /knowledge-fs/spaces/{control_space_id}/quality/replay-runs/{run_id}' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get35Errors as 'GET /agent/{agent_id}' } from './agent/errors.gen.ts'
|
||||
export { get35Errors as 'GET /apps/{app_id}/server' } from './apps/errors.gen.ts'
|
||||
export { get35Errors as 'GET /knowledge-fs/spaces/{control_space_id}/quality/replay-runs' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get35Errors as 'GET /workspaces/current/network-access-groups/current-ip' } from './workspaces/errors.gen.ts'
|
||||
export { get36Errors as 'GET /agent' } from './agent/errors.gen.ts'
|
||||
export { get36Errors as 'GET /apps/{app_id}/statistics/average-response-time' } from './apps/errors.gen.ts'
|
||||
export { get36Errors as 'GET /knowledge-fs/spaces/{control_space_id}/research-tasks/{task_id}/partials' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get36Errors as 'GET /workspaces/current/network-access-groups/{group_id}/check-current-ip' } from './workspaces/errors.gen.ts'
|
||||
export { get37Errors as 'GET /apps/{app_id}/statistics/average-session-interactions' } from './apps/errors.gen.ts'
|
||||
export { get37Errors as 'GET /knowledge-fs/spaces/{control_space_id}/research-tasks/{task_id}' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get37Errors as 'GET /workspaces/current/network-access-groups/{group_id}' } from './workspaces/errors.gen.ts'
|
||||
export { get38Errors as 'GET /apps/{app_id}/statistics/daily-conversations' } from './apps/errors.gen.ts'
|
||||
export { get38Errors as 'GET /knowledge-fs/spaces/{control_space_id}/research-tasks' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get38Errors as 'GET /workspaces/current/network-access-groups' } from './workspaces/errors.gen.ts'
|
||||
export { get39Errors as 'GET /apps/{app_id}/statistics/daily-end-users' } from './apps/errors.gen.ts'
|
||||
export { get39Errors as 'GET /knowledge-fs/spaces/{control_space_id}/settings/migrations/{migration_id}' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get3Errors as 'GET /account/education/autocomplete' } from './account/errors.gen.ts'
|
||||
export { get3Errors as 'GET /installed-apps/{installed_app_id}/messages/{message_id}/suggested-questions' } from './installed-apps/errors.gen.ts'
|
||||
export { get3Errors as 'GET /knowledge-fs/research-tasks/{task_id}/events' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get3Errors as 'GET /trial-apps/{app_id}/agent/config/files/{name}/preview' } from './trial-apps/errors.gen.ts'
|
||||
export { get40Errors as 'GET /apps/{app_id}/statistics/daily-messages' } from './apps/errors.gen.ts'
|
||||
export { get40Errors as 'GET /knowledge-fs/spaces/{control_space_id}/settings' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get40Errors as 'GET /workspaces/current/plugin/asset' } from './workspaces/errors.gen.ts'
|
||||
export { get41Errors as 'GET /apps/{app_id}/statistics/token-costs' } from './apps/errors.gen.ts'
|
||||
export { get41Errors as 'GET /knowledge-fs/spaces/{control_space_id}/source-connections' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get42Errors as 'GET /apps/{app_id}/statistics/tokens-per-second' } from './apps/errors.gen.ts'
|
||||
export { get42Errors as 'GET /knowledge-fs/spaces/{control_space_id}/source-providers' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get42Errors as 'GET /workspaces/current/plugin/debugging-key' } from './workspaces/errors.gen.ts'
|
||||
export { get43Errors as 'GET /apps/{app_id}/statistics/user-satisfaction-rate' } from './apps/errors.gen.ts'
|
||||
export { get43Errors as 'GET /knowledge-fs/spaces/{control_space_id}/source-workflows/{run_id}/pages' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get43Errors as 'GET /workspaces/current/plugin/fetch-manifest' } from './workspaces/errors.gen.ts'
|
||||
export { get44Errors as 'GET /apps/{app_id}/text-to-audio/voices' } from './apps/errors.gen.ts'
|
||||
export { get44Errors as 'GET /knowledge-fs/spaces/{control_space_id}/source-workflows/{run_id}' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get44Errors as 'GET /workspaces/current/plugin/icon' } from './workspaces/errors.gen.ts'
|
||||
export { get45Errors as 'GET /knowledge-fs/spaces/{control_space_id}/sources/{source_id}/files' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get45Errors as 'GET /workspaces/current/plugin/installed-ids' } from './workspaces/errors.gen.ts'
|
||||
export { get46Errors as 'GET /apps/{app_id}/trace-capabilities' } from './apps/errors.gen.ts'
|
||||
export { get46Errors as 'GET /knowledge-fs/spaces/{control_space_id}/sources/{source_id}/pages' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get46Errors as 'GET /workspaces/current/plugin/list' } from './workspaces/errors.gen.ts'
|
||||
export { get47Errors as 'GET /apps/{app_id}/trace-config' } from './apps/errors.gen.ts'
|
||||
export { get47Errors as 'GET /knowledge-fs/spaces/{control_space_id}/sources/{source_id}/sync-policy' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get47Errors as 'GET /workspaces/current/plugin/marketplace/pkg' } from './workspaces/errors.gen.ts'
|
||||
export { get48Errors as 'GET /apps/{app_id}/trace-runs/{source_kind}/{source_id}' } from './apps/errors.gen.ts'
|
||||
export { get48Errors as 'GET /knowledge-fs/spaces/{control_space_id}/sources/{source_id}' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get48Errors as 'GET /workspaces/current/plugin/parameters/dynamic-options' } from './workspaces/errors.gen.ts'
|
||||
export { get49Errors as 'GET /apps/{app_id}/triggers' } from './apps/errors.gen.ts'
|
||||
export { get49Errors as 'GET /knowledge-fs/spaces/{control_space_id}/sources' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get4Errors as 'GET /account/education/verify' } from './account/errors.gen.ts'
|
||||
export { get4Errors as 'GET /agent/{agent_id}/build-draft' } from './agent/errors.gen.ts'
|
||||
export { get4Errors as 'GET /apps/{app_id}/advanced-chat/workflow-runs/count' } from './apps/errors.gen.ts'
|
||||
export { get4Errors as 'GET /installed-apps/{installed_app_id}/messages' } from './installed-apps/errors.gen.ts'
|
||||
export { get4Errors as 'GET /knowledge-fs/source-provider-preview/jobs/{job_id}' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get4Errors as 'GET /rag/pipelines/imports/{pipeline_id}/check-dependencies' } from './rag/errors.gen.ts'
|
||||
export { get4Errors as 'GET /trial-apps/{app_id}/agent/config/files' } from './trial-apps/errors.gen.ts'
|
||||
export { get50Errors as 'GET /apps/{app_id}/workflow-app-logs' } from './apps/errors.gen.ts'
|
||||
export { get50Errors as 'GET /knowledge-fs/spaces/{control_space_id}/tags' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get51Errors as 'GET /apps/{app_id}/workflow-runs/count' } from './apps/errors.gen.ts'
|
||||
export { get51Errors as 'GET /knowledge-fs/spaces/{control_space_id}/traces/{trace_id}/conflicts' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get51Errors as 'GET /workspaces/current/plugin/tasks/{task_id}' } from './workspaces/errors.gen.ts'
|
||||
export { get52Errors as 'GET /apps/{app_id}/workflow-runs/{run_id}/node-executions/{node_execution_id}/children' } from './apps/errors.gen.ts'
|
||||
export { get52Errors as 'GET /knowledge-fs/spaces/{control_space_id}/traces/{trace_id}/evidence' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get52Errors as 'GET /workspaces/current/plugin/tasks' } from './workspaces/errors.gen.ts'
|
||||
export { get53Errors as 'GET /apps/{app_id}/workflow-runs/{run_id}/node-executions' } from './apps/errors.gen.ts'
|
||||
export { get53Errors as 'GET /knowledge-fs/spaces/{control_space_id}/traces/{trace_id}/missing' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get53Errors as 'GET /workspaces/current/plugin/{category}/list' } from './workspaces/errors.gen.ts'
|
||||
export { get54Errors as 'GET /apps/{app_id}/workflow-runs/{run_id}' } from './apps/errors.gen.ts'
|
||||
export { get54Errors as 'GET /knowledge-fs/spaces/{control_space_id}/traces/{trace_id}' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get55Errors as 'GET /apps/{app_id}/workflow-runs/{workflow_run_id}/agent-nodes/{node_id}/sandbox/files/read' } from './apps/errors.gen.ts'
|
||||
export { get55Errors as 'GET /knowledge-fs/spaces/{control_space_id}/traces' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get56Errors as 'GET /apps/{app_id}/workflow-runs/{workflow_run_id}/agent-nodes/{node_id}/sandbox/files' } from './apps/errors.gen.ts'
|
||||
export { get56Errors as 'GET /knowledge-fs/spaces/{control_space_id}' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get57Errors as 'GET /apps/{app_id}/workflow-runs' } from './apps/errors.gen.ts'
|
||||
export { get57Errors as 'GET /knowledge-fs/spaces' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get58Errors as 'GET /apps/{app_id}/workflow/comments/mention-users' } from './apps/errors.gen.ts'
|
||||
export { get59Errors as 'GET /apps/{app_id}/workflow/comments/{comment_id}' } from './apps/errors.gen.ts'
|
||||
export { get5Errors as 'GET /account/education' } from './account/errors.gen.ts'
|
||||
export { get5Errors as 'GET /agent/{agent_id}/chat-messages/{message_id}/suggested-questions' } from './agent/errors.gen.ts'
|
||||
export { get5Errors as 'GET /apps/{app_id}/advanced-chat/workflow-runs' } from './apps/errors.gen.ts'
|
||||
export { get5Errors as 'GET /datasets/external-knowledge-api/{external_knowledge_api_id}' } from './datasets/errors.gen.ts'
|
||||
export { get5Errors as 'GET /installed-apps/{installed_app_id}/meta' } from './installed-apps/errors.gen.ts'
|
||||
export { get5Errors as 'GET /knowledge-fs/spaces/{control_space_id}/app-bindings' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get5Errors as 'GET /trial-apps/{app_id}/agent/config/skills/{name}/download' } from './trial-apps/errors.gen.ts'
|
||||
export { get60Errors as 'GET /apps/{app_id}/workflow/comments' } from './apps/errors.gen.ts'
|
||||
export { get61Errors as 'GET /apps/{app_id}/workflow/statistics/average-app-interactions' } from './apps/errors.gen.ts'
|
||||
export { get62Errors as 'GET /apps/{app_id}/workflow/statistics/daily-conversations' } from './apps/errors.gen.ts'
|
||||
export { get63Errors as 'GET /apps/{app_id}/workflow/statistics/daily-terminals' } from './apps/errors.gen.ts'
|
||||
export { get64Errors as 'GET /apps/{app_id}/workflow/statistics/token-costs' } from './apps/errors.gen.ts'
|
||||
export { get65Errors as 'GET /apps/{app_id}/workflows/default-workflow-block-configs/{block_type}' } from './apps/errors.gen.ts'
|
||||
export { get66Errors as 'GET /apps/{app_id}/workflows/default-workflow-block-configs' } from './apps/errors.gen.ts'
|
||||
export { get67Errors as 'GET /apps/{app_id}/workflows/draft/conversation-variables' } from './apps/errors.gen.ts'
|
||||
export { get68Errors as 'GET /apps/{app_id}/workflows/draft/environment-variables' } from './apps/errors.gen.ts'
|
||||
export { get69Errors as 'GET /apps/{app_id}/workflows/draft/nodes/{node_id}/agent-composer/candidates' } from './apps/errors.gen.ts'
|
||||
export { get6Errors as 'GET /agent/{agent_id}/chat-messages' } from './agent/errors.gen.ts'
|
||||
export { get6Errors as 'GET /apps/{app_id}/agent/config/files/{name}/download' } from './apps/errors.gen.ts'
|
||||
export { get6Errors as 'GET /installed-apps/{installed_app_id}/parameters' } from './installed-apps/errors.gen.ts'
|
||||
export { get6Errors as 'GET /knowledge-fs/spaces/{control_space_id}/background-tasks' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get6Errors as 'GET /rag/pipelines/{pipeline_id}/exports' } from './rag/errors.gen.ts'
|
||||
export { get6Errors as 'GET /trial-apps/{app_id}/agent/config/skills/{name}/files/content' } from './trial-apps/errors.gen.ts'
|
||||
export { get70Errors as 'GET /apps/{app_id}/workflows/draft/nodes/{node_id}/agent-composer' } from './apps/errors.gen.ts'
|
||||
export { get71Errors as 'GET /apps/{app_id}/workflows/draft/nodes/{node_id}/last-run' } from './apps/errors.gen.ts'
|
||||
export { get72Errors as 'GET /apps/{app_id}/workflows/draft/nodes/{node_id}/variables' } from './apps/errors.gen.ts'
|
||||
export { get73Errors as 'GET /apps/{app_id}/workflows/draft/runs/{run_id}/node-outputs/events' } from './apps/errors.gen.ts'
|
||||
export { get74Errors as 'GET /apps/{app_id}/workflows/draft/runs/{run_id}/node-outputs/{node_id}/{output_name}/preview' } from './apps/errors.gen.ts'
|
||||
export { get75Errors as 'GET /apps/{app_id}/workflows/draft/runs/{run_id}/node-outputs/{node_id}' } from './apps/errors.gen.ts'
|
||||
export { get76Errors as 'GET /apps/{app_id}/workflows/draft/runs/{run_id}/node-outputs' } from './apps/errors.gen.ts'
|
||||
export { get77Errors as 'GET /apps/{app_id}/workflows/draft/system-variables' } from './apps/errors.gen.ts'
|
||||
export { get78Errors as 'GET /apps/{app_id}/workflows/draft/variables/{variable_id}' } from './apps/errors.gen.ts'
|
||||
export { get79Errors as 'GET /apps/{app_id}/workflows/draft/variables' } from './apps/errors.gen.ts'
|
||||
export { get7Errors as 'GET /account/profile' } from './account/errors.gen.ts'
|
||||
export { get7Errors as 'GET /agent/{agent_id}/composer/candidates' } from './agent/errors.gen.ts'
|
||||
export { get7Errors as 'GET /apps/{app_id}/agent/config/files/{name}/preview' } from './apps/errors.gen.ts'
|
||||
export { get7Errors as 'GET /installed-apps/{installed_app_id}/saved-messages' } from './installed-apps/errors.gen.ts'
|
||||
export { get7Errors as 'GET /knowledge-fs/spaces/{control_space_id}/bulk-jobs/{job_id}' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get7Errors as 'GET /rag/pipelines/{pipeline_id}/workflow-runs/{run_id}/node-executions' } from './rag/errors.gen.ts'
|
||||
export { get7Errors as 'GET /snippets/{snippet_id}/workflows/draft/environment-variables' } from './snippets/errors.gen.ts'
|
||||
export { get7Errors as 'GET /trial-apps/{app_id}/agent/config/skills/{name}/files/download' } from './trial-apps/errors.gen.ts'
|
||||
export { get80Errors as 'GET /apps/{app_id}/workflows/draft' } from './apps/errors.gen.ts'
|
||||
export { get81Errors as 'GET /apps/{app_id}/workflows/publish' } from './apps/errors.gen.ts'
|
||||
export { get82Errors as 'GET /apps/{app_id}/workflows/published/runs/{run_id}/node-outputs/events' } from './apps/errors.gen.ts'
|
||||
export { get83Errors as 'GET /apps/{app_id}/workflows/published/runs/{run_id}/node-outputs/{node_id}/{output_name}/preview' } from './apps/errors.gen.ts'
|
||||
export { get84Errors as 'GET /apps/{app_id}/workflows/published/runs/{run_id}/node-outputs/{node_id}' } from './apps/errors.gen.ts'
|
||||
export { get85Errors as 'GET /apps/{app_id}/workflows/published/runs/{run_id}/node-outputs' } from './apps/errors.gen.ts'
|
||||
export { get86Errors as 'GET /apps/{app_id}/workflows/triggers/webhook' } from './apps/errors.gen.ts'
|
||||
export { get87Errors as 'GET /apps/{app_id}/workflows' } from './apps/errors.gen.ts'
|
||||
export { get8Errors as 'GET /agent/{agent_id}/composer' } from './agent/errors.gen.ts'
|
||||
export { get8Errors as 'GET /apps/{app_id}/agent/config/files' } from './apps/errors.gen.ts'
|
||||
export { get8Errors as 'GET /installed-apps/{installed_app_id}' } from './installed-apps/errors.gen.ts'
|
||||
export { get8Errors as 'GET /knowledge-fs/spaces/{control_space_id}/document-references/resolve' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get8Errors as 'GET /rag/pipelines/{pipeline_id}/workflow-runs/{run_id}' } from './rag/errors.gen.ts'
|
||||
export { get8Errors as 'GET /trial-apps/{app_id}/agent/config/skills/{name}/files/preview' } from './trial-apps/errors.gen.ts'
|
||||
export { get94Errors as 'GET /workspaces/current/skills/{skill_id}/files/content' } from './workspaces/errors.gen.ts'
|
||||
export { get95Errors as 'GET /workspaces/current/skills/{skill_id}/files/preview' } from './workspaces/errors.gen.ts'
|
||||
export { get9Errors as 'GET /agent/{agent_id}/config/files/{name}/download' } from './agent/errors.gen.ts'
|
||||
export { get9Errors as 'GET /apps/{app_id}/agent/config/manifest' } from './apps/errors.gen.ts'
|
||||
export { get9Errors as 'GET /installed-apps' } from './installed-apps/errors.gen.ts'
|
||||
export { get9Errors as 'GET /knowledge-fs/spaces/{control_space_id}/documents/{document_id}/multimodal/{item_id}/asset' } from './knowledge-fs/errors.gen.ts'
|
||||
export { get9Errors as 'GET /rag/pipelines/{pipeline_id}/workflow-runs' } from './rag/errors.gen.ts'
|
||||
export { get9Errors as 'GET /snippets/{snippet_id}/workflows/draft/nodes/{node_id}/agent-composer' } from './snippets/errors.gen.ts'
|
||||
export { get9Errors as 'GET /trial-apps/{app_id}/agent/config/skills/{name}/inspect' } from './trial-apps/errors.gen.ts'
|
||||
export { getErrors as 'GET /apps/imports/{app_id}/check-dependencies' } from './apps/errors.gen.ts'
|
||||
export { getErrors as 'GET /billing/invoices' } from './billing/errors.gen.ts'
|
||||
export { getErrors as 'GET /compliance/download' } from './compliance/errors.gen.ts'
|
||||
export { getErrors as 'GET /form/human-input/v2/{form_token}' } from './form/errors.gen.ts'
|
||||
export { getErrors as 'GET /installed-apps/{installed_app_id}/conversations' } from './installed-apps/errors.gen.ts'
|
||||
export { getErrors as 'GET /remote-files/{url}' } from './remote-files/errors.gen.ts'
|
||||
export { getErrors as 'GET /trial-apps/{app_id}/agent-composer' } from './trial-apps/errors.gen.ts'
|
||||
export { getErrors as 'GET /website/crawl/status/{job_id}' } from './website/errors.gen.ts'
|
||||
export { getErrors as 'GET /workflow-run-archives/downloads/{download_id}' } from './workflow-run-archives/errors.gen.ts'
|
||||
export { patch2Errors as 'PATCH /apps/{app_id}/workflows/draft/variables/{variable_id}' } from './apps/errors.gen.ts'
|
||||
export { patch2Errors as 'PATCH /datasets/{dataset_id}/documents/status/{action}/batch' } from './datasets/errors.gen.ts'
|
||||
export { patch2Errors as 'PATCH /installed-apps/{installed_app_id}/conversations/{c_id}/unpin' } from './installed-apps/errors.gen.ts'
|
||||
export { patch2Errors as 'PATCH /knowledge-fs/spaces/{control_space_id}/golden-questions/{question_id}' } from './knowledge-fs/errors.gen.ts'
|
||||
export { patch2Errors as 'PATCH /rag/pipelines/{pipeline_id}/workflows/draft/variables/{variable_id}' } from './rag/errors.gen.ts'
|
||||
export { patch3Errors as 'PATCH /apps/{app_id}/workflows/{workflow_id}' } from './apps/errors.gen.ts'
|
||||
export { patch3Errors as 'PATCH /datasets/{dataset_id}/documents/{document_id}/processing/pause' } from './datasets/errors.gen.ts'
|
||||
export { patch3Errors as 'PATCH /installed-apps/{installed_app_id}' } from './installed-apps/errors.gen.ts'
|
||||
export { patch3Errors as 'PATCH /knowledge-fs/spaces/{control_space_id}/logical-documents/{document_id}' } from './knowledge-fs/errors.gen.ts'
|
||||
export { patch3Errors as 'PATCH /rag/pipelines/{pipeline_id}/workflows/{workflow_id}' } from './rag/errors.gen.ts'
|
||||
export { patch4Errors as 'PATCH /datasets/{dataset_id}/documents/{document_id}/processing/resume' } from './datasets/errors.gen.ts'
|
||||
export { patch4Errors as 'PATCH /knowledge-fs/spaces/{control_space_id}/logical-documents' } from './knowledge-fs/errors.gen.ts'
|
||||
export { patch5Errors as 'PATCH /datasets/{dataset_id}/documents/{document_id}/processing/{action}' } from './datasets/errors.gen.ts'
|
||||
export { patch5Errors as 'PATCH /knowledge-fs/spaces/{control_space_id}/metadata/{field_id}' } from './knowledge-fs/errors.gen.ts'
|
||||
export { patch6Errors as 'PATCH /datasets/{dataset_id}/documents/{document_id}/segment/{action}' } from './datasets/errors.gen.ts'
|
||||
export { patch6Errors as 'PATCH /knowledge-fs/spaces/{control_space_id}/quality/bad-cases/{bad_case_id}' } from './knowledge-fs/errors.gen.ts'
|
||||
export { patch6Errors as 'PATCH /workspaces/current/skills/{skill_id}/files' } from './workspaces/errors.gen.ts'
|
||||
export { patch7Errors as 'PATCH /datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks/{child_chunk_id}' } from './datasets/errors.gen.ts'
|
||||
export { patch7Errors as 'PATCH /knowledge-fs/spaces/{control_space_id}/settings' } from './knowledge-fs/errors.gen.ts'
|
||||
export { patch7Errors as 'PATCH /workspaces/current/skills/{skill_id}/versions/{version_id}' } from './workspaces/errors.gen.ts'
|
||||
export { patch8Errors as 'PATCH /datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks' } from './datasets/errors.gen.ts'
|
||||
export { patch8Errors as 'PATCH /knowledge-fs/spaces/{control_space_id}/sources/{source_id}' } from './knowledge-fs/errors.gen.ts'
|
||||
export { patch8Errors as 'PATCH /workspaces/current/skills/{skill_id}' } from './workspaces/errors.gen.ts'
|
||||
export { patch9Errors as 'PATCH /datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}' } from './datasets/errors.gen.ts'
|
||||
export { patch9Errors as 'PATCH /knowledge-fs/spaces/{control_space_id}' } from './knowledge-fs/errors.gen.ts'
|
||||
export { patchErrors as 'PATCH /account/profile' } from './account/errors.gen.ts'
|
||||
export { patchErrors as 'PATCH /agent/{agent_id}/trace-config' } from './agent/errors.gen.ts'
|
||||
export { patchErrors as 'PATCH /apps/{app_id}/trace-config' } from './apps/errors.gen.ts'
|
||||
export { patchErrors as 'PATCH /data-source/integrates/{binding_id}/{action}' } from './data-source/errors.gen.ts'
|
||||
export { patchErrors as 'PATCH /datasets/external-knowledge-api/{external_knowledge_api_id}' } from './datasets/errors.gen.ts'
|
||||
export { patchErrors as 'PATCH /installed-apps/{installed_app_id}/conversations/{c_id}/pin' } from './installed-apps/errors.gen.ts'
|
||||
export { patchErrors as 'PATCH /knowledge-fs/spaces/{control_space_id}/documents/{document_id}' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post10Errors as 'POST /agent/{agent_id}/config/files' } from './agent/errors.gen.ts'
|
||||
export { post10Errors as 'POST /apps/{app_id}/agent/config/files/batch' } from './apps/errors.gen.ts'
|
||||
export { post10Errors as 'POST /installed-apps/{installed_app_id}/workflows/run' } from './installed-apps/errors.gen.ts'
|
||||
export { post10Errors as 'POST /knowledge-fs/spaces/{control_space_id}/golden-questions' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post10Errors as 'POST /rag/pipelines/{pipeline_id}/workflows/draft/datasource/variables-inspect' } from './rag/errors.gen.ts'
|
||||
export { post10Errors as 'POST /snippets/{snippet_id}/workflows/draft' } from './snippets/errors.gen.ts'
|
||||
export { post11Errors as 'POST /agent/{agent_id}/config/skills/upload' } from './agent/errors.gen.ts'
|
||||
export { post11Errors as 'POST /apps/{app_id}/agent/config/files' } from './apps/errors.gen.ts'
|
||||
export { post11Errors as 'POST /installed-apps/{installed_app_id}/workflows/tasks/{task_id}/stop' } from './installed-apps/errors.gen.ts'
|
||||
export { post11Errors as 'POST /knowledge-fs/spaces/{control_space_id}/jobs/{job_id}/retry' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post11Errors as 'POST /rag/pipelines/{pipeline_id}/workflows/draft/iteration/nodes/{node_id}/run' } from './rag/errors.gen.ts'
|
||||
export { post12Errors as 'POST /agent/{agent_id}/copy' } from './agent/errors.gen.ts'
|
||||
export { post12Errors as 'POST /apps/{app_id}/agent/config/skills/upload' } from './apps/errors.gen.ts'
|
||||
export { post12Errors as 'POST /datasets/{dataset_id}/documents/{document_id}/segment' } from './datasets/errors.gen.ts'
|
||||
export { post12Errors as 'POST /knowledge-fs/spaces/{control_space_id}/logical-documents/download-zip' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post12Errors as 'POST /rag/pipelines/{pipeline_id}/workflows/draft/loop/nodes/{node_id}/run' } from './rag/errors.gen.ts'
|
||||
export { post13Errors as 'POST /agent/{agent_id}/debug-conversation/refresh' } from './agent/errors.gen.ts'
|
||||
export { post13Errors as 'POST /knowledge-fs/spaces/{control_space_id}/metadata' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post13Errors as 'POST /rag/pipelines/{pipeline_id}/workflows/draft/nodes/{node_id}/run' } from './rag/errors.gen.ts'
|
||||
export { post14Errors as 'POST /agent/{agent_id}/features' } from './agent/errors.gen.ts'
|
||||
export { post14Errors as 'POST /datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks' } from './datasets/errors.gen.ts'
|
||||
export { post14Errors as 'POST /knowledge-fs/spaces/{control_space_id}/quality/bad-cases' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post14Errors as 'POST /rag/pipelines/{pipeline_id}/workflows/draft/run' } from './rag/errors.gen.ts'
|
||||
export { post15Errors as 'POST /agent/{agent_id}/feedbacks' } from './agent/errors.gen.ts'
|
||||
export { post15Errors as 'POST /apps/{app_id}/annotations/batch-import' } from './apps/errors.gen.ts'
|
||||
export { post15Errors as 'POST /datasets/{dataset_id}/documents' } from './datasets/errors.gen.ts'
|
||||
export { post15Errors as 'POST /knowledge-fs/spaces/{control_space_id}/quality/replay-runs' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post15Errors as 'POST /rag/pipelines/{pipeline_id}/workflows/draft' } from './rag/errors.gen.ts'
|
||||
export { post16Errors as 'POST /agent/{agent_id}/publish' } from './agent/errors.gen.ts'
|
||||
export { post16Errors as 'POST /datasets/{dataset_id}/external-hit-testing' } from './datasets/errors.gen.ts'
|
||||
export { post16Errors as 'POST /knowledge-fs/spaces/{control_space_id}/queries/admission' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post16Errors as 'POST /rag/pipelines/{pipeline_id}/workflows/publish' } from './rag/errors.gen.ts'
|
||||
export { post17Errors as 'POST /agent/{agent_id}/sandbox/files/download' } from './agent/errors.gen.ts'
|
||||
export { post17Errors as 'POST /datasets/{dataset_id}/hit-testing' } from './datasets/errors.gen.ts'
|
||||
export { post17Errors as 'POST /knowledge-fs/spaces/{control_space_id}/queries' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post17Errors as 'POST /rag/pipelines/{pipeline_id}/workflows/published/datasource/nodes/{node_id}/preview' } from './rag/errors.gen.ts'
|
||||
export { post18Errors as 'POST /agent/{agent_id}/text-to-audio' } from './agent/errors.gen.ts'
|
||||
export { post18Errors as 'POST /knowledge-fs/spaces/{control_space_id}/query-stream-capability' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post18Errors as 'POST /rag/pipelines/{pipeline_id}/workflows/published/datasource/nodes/{node_id}/run' } from './rag/errors.gen.ts'
|
||||
export { post19Errors as 'POST /agent/{agent_id}/trace' } from './agent/errors.gen.ts'
|
||||
export { post19Errors as 'POST /apps/{app_id}/audio-to-text' } from './apps/errors.gen.ts'
|
||||
export { post19Errors as 'POST /datasets/{dataset_id}/knowledge-fs-upgrades' } from './datasets/errors.gen.ts'
|
||||
export { post19Errors as 'POST /knowledge-fs/spaces/{control_space_id}/research-tasks/plan' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post19Errors as 'POST /rag/pipelines/{pipeline_id}/workflows/published/run' } from './rag/errors.gen.ts'
|
||||
export { post20Errors as 'POST /agent/{agent_id}/trace-config' } from './agent/errors.gen.ts'
|
||||
export { post20Errors as 'POST /apps/{app_id}/chat-messages/{task_id}/stop' } from './apps/errors.gen.ts'
|
||||
export { post20Errors as 'POST /knowledge-fs/spaces/{control_space_id}/research-tasks' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post20Errors as 'POST /rag/pipelines/{pipeline_id}/workflows/{workflow_id}/restore' } from './rag/errors.gen.ts'
|
||||
export { post21Errors as 'POST /agent/{agent_id}/trace-runs/{message_id}/retry' } from './agent/errors.gen.ts'
|
||||
export { post21Errors as 'POST /apps/{app_id}/completion-messages/{task_id}/stop' } from './apps/errors.gen.ts'
|
||||
export { post21Errors as 'POST /knowledge-fs/spaces/{control_space_id}/source-connections/{connection_id}/refresh' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post22Errors as 'POST /agent/{agent_id}/versions/{version_id}/restore' } from './agent/errors.gen.ts'
|
||||
export { post22Errors as 'POST /apps/{app_id}/completion-messages' } from './apps/errors.gen.ts'
|
||||
export { post22Errors as 'POST /knowledge-fs/spaces/{control_space_id}/source-connections' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post23Errors as 'POST /agent' } from './agent/errors.gen.ts'
|
||||
export { post23Errors as 'POST /apps/{app_id}/convert-to-workflow' } from './apps/errors.gen.ts'
|
||||
export { post23Errors as 'POST /datasets/{resource_id}/api-keys' } from './datasets/errors.gen.ts'
|
||||
export { post23Errors as 'POST /knowledge-fs/spaces/{control_space_id}/source-workflows/{run_id}/cancel' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post24Errors as 'POST /datasets' } from './datasets/errors.gen.ts'
|
||||
export { post24Errors as 'POST /knowledge-fs/spaces/{control_space_id}/source-workflows/{run_id}/retry' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post24Errors as 'POST /workspaces/current/members/invite-email' } from './workspaces/errors.gen.ts'
|
||||
export { post25Errors as 'POST /apps/{app_id}/feedbacks' } from './apps/errors.gen.ts'
|
||||
export { post25Errors as 'POST /knowledge-fs/spaces/{control_space_id}/source-workflows/{run_id}/selection' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post25Errors as 'POST /workspaces/current/members/owner-transfer-check' } from './workspaces/errors.gen.ts'
|
||||
export { post26Errors as 'POST /knowledge-fs/spaces/{control_space_id}/sources/{source_id}/async-import' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post26Errors as 'POST /workspaces/current/members/send-owner-transfer-confirm-email' } from './workspaces/errors.gen.ts'
|
||||
export { post27Errors as 'POST /apps/{app_id}/model-config' } from './apps/errors.gen.ts'
|
||||
export { post27Errors as 'POST /knowledge-fs/spaces/{control_space_id}/sources/{source_id}/crawl-import' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post27Errors as 'POST /workspaces/current/members/{member_id}/owner-transfer' } from './workspaces/errors.gen.ts'
|
||||
export { post28Errors as 'POST /knowledge-fs/spaces/{control_space_id}/sources/{source_id}/crawl-preview' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post29Errors as 'POST /knowledge-fs/spaces/{control_space_id}/sources/{source_id}/import' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post2Errors as 'POST /account/change-email/reset' } from './account/errors.gen.ts'
|
||||
export { post2Errors as 'POST /agent/{agent_id}/api-keys' } from './agent/errors.gen.ts'
|
||||
export { post2Errors as 'POST /apps/imports' } from './apps/errors.gen.ts'
|
||||
export { post2Errors as 'POST /datasets/external' } from './datasets/errors.gen.ts'
|
||||
export { post2Errors as 'POST /email-code-login' } from './email-code-login/errors.gen.ts'
|
||||
export { post2Errors as 'POST /email-register/validity' } from './email-register/errors.gen.ts'
|
||||
export { post2Errors as 'POST /forgot-password/validity' } from './forgot-password/errors.gen.ts'
|
||||
export { post2Errors as 'POST /form/human_input/{form_token}' } from './form/errors.gen.ts'
|
||||
export { post2Errors as 'POST /installed-apps/{installed_app_id}/chat-messages/{task_id}/stop' } from './installed-apps/errors.gen.ts'
|
||||
export { post2Errors as 'POST /instruction-generate' } from './instruction-generate/errors.gen.ts'
|
||||
export { post2Errors as 'POST /knowledge-fs/source-provider-preview/jobs' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post2Errors as 'POST /rag/pipeline/dataset' } from './rag/errors.gen.ts'
|
||||
export { post2Errors as 'POST /trial-apps/{app_id}/chat-messages/{task_id}/stop' } from './trial-apps/errors.gen.ts'
|
||||
export { post30Errors as 'POST /apps/{app_id}/server/refresh' } from './apps/errors.gen.ts'
|
||||
export { post30Errors as 'POST /knowledge-fs/spaces/{control_space_id}/sources/{source_id}/import-files' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post31Errors as 'POST /apps/{app_id}/server' } from './apps/errors.gen.ts'
|
||||
export { post31Errors as 'POST /knowledge-fs/spaces/{control_space_id}/sources/{source_id}/sync' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post32Errors as 'POST /apps/{app_id}/site/access-token-reset' } from './apps/errors.gen.ts'
|
||||
export { post32Errors as 'POST /knowledge-fs/spaces/{control_space_id}/sources/{source_id}/test' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post33Errors as 'POST /apps/{app_id}/site' } from './apps/errors.gen.ts'
|
||||
export { post33Errors as 'POST /knowledge-fs/spaces/{control_space_id}/sources/{source_id}/workflow-imports' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post34Errors as 'POST /knowledge-fs/spaces/{control_space_id}/sources' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post35Errors as 'POST /knowledge-fs/spaces/{control_space_id}/upload-sessions/{upload_session_id}/abort' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post36Errors as 'POST /apps/{app_id}/text-to-audio' } from './apps/errors.gen.ts'
|
||||
export { post36Errors as 'POST /knowledge-fs/spaces/{control_space_id}/upload-sessions/{upload_session_id}/complete' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post37Errors as 'POST /apps/{app_id}/trace' } from './apps/errors.gen.ts'
|
||||
export { post37Errors as 'POST /knowledge-fs/spaces/{control_space_id}/upload-sessions/{upload_session_id}/parts/{part_number}/presign' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post38Errors as 'POST /apps/{app_id}/trace-config' } from './apps/errors.gen.ts'
|
||||
export { post38Errors as 'POST /knowledge-fs/spaces/{control_space_id}/upload-sessions/{upload_session_id}/small-file' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post38Errors as 'POST /workspaces/current/network-access-groups' } from './workspaces/errors.gen.ts'
|
||||
export { post39Errors as 'POST /apps/{app_id}/trace-runs/{source_kind}/{source_id}/retry' } from './apps/errors.gen.ts'
|
||||
export { post39Errors as 'POST /knowledge-fs/spaces/{control_space_id}/upload-sessions' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post3Errors as 'POST /account/change-email/validity' } from './account/errors.gen.ts'
|
||||
export { post3Errors as 'POST /agent/{agent_id}/audio-to-text' } from './agent/errors.gen.ts'
|
||||
export { post3Errors as 'POST /datasets/external-knowledge-api' } from './datasets/errors.gen.ts'
|
||||
export { post3Errors as 'POST /email-register' } from './email-register/errors.gen.ts'
|
||||
export { post3Errors as 'POST /forgot-password' } from './forgot-password/errors.gen.ts'
|
||||
export { post3Errors as 'POST /installed-apps/{installed_app_id}/chat-messages' } from './installed-apps/errors.gen.ts'
|
||||
export { post3Errors as 'POST /knowledge-fs/source-provider-preview' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post3Errors as 'POST /trial-apps/{app_id}/chat-messages' } from './trial-apps/errors.gen.ts'
|
||||
export { post3Errors as 'POST /workflow-generate' } from './workflow-generate/errors.gen.ts'
|
||||
export { post40Errors as 'POST /apps/{app_id}/trigger-enable' } from './apps/errors.gen.ts'
|
||||
export { post40Errors as 'POST /knowledge-fs/spaces' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post41Errors as 'POST /apps/{app_id}/workflow-runs/tasks/{task_id}/stop' } from './apps/errors.gen.ts'
|
||||
export { post41Errors as 'POST /knowledge-fs/tasks/{task_id}/stream-capability' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post41Errors as 'POST /workspaces/current/plugin/install/github' } from './workspaces/errors.gen.ts'
|
||||
export { post42Errors as 'POST /apps/{app_id}/workflow-runs/{workflow_run_id}/agent-nodes/{node_id}/sandbox/files/download' } from './apps/errors.gen.ts'
|
||||
export { post42Errors as 'POST /knowledge-fs/uploads' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post42Errors as 'POST /workspaces/current/plugin/install/marketplace' } from './workspaces/errors.gen.ts'
|
||||
export { post43Errors as 'POST /apps/{app_id}/workflow/comments/{comment_id}/replies' } from './apps/errors.gen.ts'
|
||||
export { post43Errors as 'POST /workspaces/current/plugin/install/pkg' } from './workspaces/errors.gen.ts'
|
||||
export { post44Errors as 'POST /apps/{app_id}/workflow/comments/{comment_id}/resolve' } from './apps/errors.gen.ts'
|
||||
export { post44Errors as 'POST /workspaces/current/plugin/list/installations/ids' } from './workspaces/errors.gen.ts'
|
||||
export { post45Errors as 'POST /apps/{app_id}/workflow/comments' } from './apps/errors.gen.ts'
|
||||
export { post45Errors as 'POST /workspaces/current/plugin/list/latest-versions' } from './workspaces/errors.gen.ts'
|
||||
export { post46Errors as 'POST /apps/{app_id}/workflows/draft/conversation-variables' } from './apps/errors.gen.ts'
|
||||
export { post46Errors as 'POST /workspaces/current/plugin/parameters/dynamic-options-with-credentials' } from './workspaces/errors.gen.ts'
|
||||
export { post47Errors as 'POST /apps/{app_id}/workflows/draft/environment-variables' } from './apps/errors.gen.ts'
|
||||
export { post48Errors as 'POST /apps/{app_id}/workflows/draft/features' } from './apps/errors.gen.ts'
|
||||
export { post48Errors as 'POST /workspaces/current/plugin/tasks/delete_all' } from './workspaces/errors.gen.ts'
|
||||
export { post49Errors as 'POST /apps/{app_id}/workflows/draft/human-input/nodes/{node_id}/delivery-test' } from './apps/errors.gen.ts'
|
||||
export { post49Errors as 'POST /workspaces/current/plugin/tasks/{task_id}/delete/{identifier}' } from './workspaces/errors.gen.ts'
|
||||
export { post4Errors as 'POST /account/change-email' } from './account/errors.gen.ts'
|
||||
export { post4Errors as 'POST /agent/{agent_id}/build-chat/finalize' } from './agent/errors.gen.ts'
|
||||
export { post4Errors as 'POST /apps/{app_id}/advanced-chat/workflows/draft/human-input/nodes/{node_id}/form/preview' } from './apps/errors.gen.ts'
|
||||
export { post4Errors as 'POST /datasets/indexing-estimate' } from './datasets/errors.gen.ts'
|
||||
export { post4Errors as 'POST /installed-apps/{installed_app_id}/completion-messages/{task_id}/stop' } from './installed-apps/errors.gen.ts'
|
||||
export { post4Errors as 'POST /knowledge-fs/spaces/{control_space_id}/background-tasks/{task_kind}/{task_id}/cancel' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post4Errors as 'POST /snippets/{snippet_id}/workflows/draft/nodes/{node_id}/agent-composer/copy-from-roster' } from './snippets/errors.gen.ts'
|
||||
export { post4Errors as 'POST /trial-apps/{app_id}/completion-messages' } from './trial-apps/errors.gen.ts'
|
||||
export { post50Errors as 'POST /apps/{app_id}/workflows/draft/human-input/nodes/{node_id}/form/preview' } from './apps/errors.gen.ts'
|
||||
export { post50Errors as 'POST /workspaces/current/plugin/tasks/{task_id}/delete' } from './workspaces/errors.gen.ts'
|
||||
export { post51Errors as 'POST /apps/{app_id}/workflows/draft/human-input/nodes/{node_id}/form/run' } from './apps/errors.gen.ts'
|
||||
export { post51Errors as 'POST /workspaces/current/plugin/uninstall' } from './workspaces/errors.gen.ts'
|
||||
export { post52Errors as 'POST /apps/{app_id}/workflows/draft/human-input/nodes/{node_id}/message-template/test' } from './apps/errors.gen.ts'
|
||||
export { post52Errors as 'POST /workspaces/current/plugin/upgrade/github' } from './workspaces/errors.gen.ts'
|
||||
export { post53Errors as 'POST /apps/{app_id}/workflows/draft/iteration/nodes/{node_id}/run' } from './apps/errors.gen.ts'
|
||||
export { post53Errors as 'POST /workspaces/current/plugin/upgrade/marketplace' } from './workspaces/errors.gen.ts'
|
||||
export { post54Errors as 'POST /apps/{app_id}/workflows/draft/loop/nodes/{node_id}/run' } from './apps/errors.gen.ts'
|
||||
export { post55Errors as 'POST /apps/{app_id}/workflows/draft/nodes/{node_id}/agent-composer/copy-from-roster' } from './apps/errors.gen.ts'
|
||||
export { post55Errors as 'POST /workspaces/current/plugin/upload/github' } from './workspaces/errors.gen.ts'
|
||||
export { post56Errors as 'POST /apps/{app_id}/workflows/draft/nodes/{node_id}/agent-composer/impact' } from './apps/errors.gen.ts'
|
||||
export { post56Errors as 'POST /workspaces/current/plugin/upload/pkg' } from './workspaces/errors.gen.ts'
|
||||
export { post57Errors as 'POST /apps/{app_id}/workflows/draft/nodes/{node_id}/agent-composer/save-to-roster' } from './apps/errors.gen.ts'
|
||||
export { post58Errors as 'POST /apps/{app_id}/workflows/draft/nodes/{node_id}/agent-composer/validate' } from './apps/errors.gen.ts'
|
||||
export { post59Errors as 'POST /apps/{app_id}/workflows/draft/nodes/{node_id}/run' } from './apps/errors.gen.ts'
|
||||
export { post5Errors as 'POST /agent/{agent_id}/build-draft/apply' } from './agent/errors.gen.ts'
|
||||
export { post5Errors as 'POST /apps/{app_id}/advanced-chat/workflows/draft/human-input/nodes/{node_id}/form/run' } from './apps/errors.gen.ts'
|
||||
export { post5Errors as 'POST /datasets/init' } from './datasets/errors.gen.ts'
|
||||
export { post5Errors as 'POST /installed-apps/{installed_app_id}/completion-messages' } from './installed-apps/errors.gen.ts'
|
||||
export { post5Errors as 'POST /knowledge-fs/spaces/{control_space_id}/background-tasks/{task_kind}/{task_id}/retry' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post5Errors as 'POST /trial-apps/{app_id}/files/upload' } from './trial-apps/errors.gen.ts'
|
||||
export { post60Errors as 'POST /apps/{app_id}/workflows/draft/nodes/{node_id}/trigger/run' } from './apps/errors.gen.ts'
|
||||
export { post61Errors as 'POST /apps/{app_id}/workflows/draft/run' } from './apps/errors.gen.ts'
|
||||
export { post61Errors as 'POST /workspaces/current/skills/files/upload' } from './workspaces/errors.gen.ts'
|
||||
export { post62Errors as 'POST /apps/{app_id}/workflows/draft/trigger/run' } from './apps/errors.gen.ts'
|
||||
export { post62Errors as 'POST /workspaces/current/skills/import' } from './workspaces/errors.gen.ts'
|
||||
export { post63Errors as 'POST /apps/{app_id}/workflows/draft/trigger/run-all' } from './apps/errors.gen.ts'
|
||||
export { post63Errors as 'POST /workspaces/current/skills/{skill_id}/assist/messages' } from './workspaces/errors.gen.ts'
|
||||
export { post64Errors as 'POST /apps/{app_id}/workflows/draft' } from './apps/errors.gen.ts'
|
||||
export { post65Errors as 'POST /apps/{app_id}/workflows/publish' } from './apps/errors.gen.ts'
|
||||
export { post65Errors as 'POST /workspaces/current/skills/{skill_id}/files/check' } from './workspaces/errors.gen.ts'
|
||||
export { post66Errors as 'POST /apps/{app_id}/workflows/{workflow_id}/restore' } from './apps/errors.gen.ts'
|
||||
export { post66Errors as 'POST /workspaces/current/skills/{skill_id}/publish' } from './workspaces/errors.gen.ts'
|
||||
export { post67Errors as 'POST /apps/{resource_id}/api-keys' } from './apps/errors.gen.ts'
|
||||
export { post67Errors as 'POST /workspaces/current/skills/{skill_id}/restore' } from './workspaces/errors.gen.ts'
|
||||
export { post68Errors as 'POST /workspaces/current/skills' } from './workspaces/errors.gen.ts'
|
||||
export { post6Errors as 'POST /account/delete' } from './account/errors.gen.ts'
|
||||
export { post6Errors as 'POST /agent/{agent_id}/build-draft/checkout' } from './agent/errors.gen.ts'
|
||||
export { post6Errors as 'POST /apps/{app_id}/advanced-chat/workflows/draft/human-input/nodes/{node_id}/message-template/test' } from './apps/errors.gen.ts'
|
||||
export { post6Errors as 'POST /datasets/notion-indexing-estimate' } from './datasets/errors.gen.ts'
|
||||
export { post6Errors as 'POST /installed-apps/{installed_app_id}/conversations/{c_id}/name' } from './installed-apps/errors.gen.ts'
|
||||
export { post6Errors as 'POST /knowledge-fs/spaces/{control_space_id}/documents/reindex' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post6Errors as 'POST /snippets/{snippet_id}/workflows/draft/nodes/{node_id}/agent-composer/save-to-roster' } from './snippets/errors.gen.ts'
|
||||
export { post6Errors as 'POST /trial-apps/{app_id}/remote-files/upload' } from './trial-apps/errors.gen.ts'
|
||||
export { post7Errors as 'POST /account/education' } from './account/errors.gen.ts'
|
||||
export { post7Errors as 'POST /agent/{agent_id}/chat-messages/{task_id}/stop' } from './agent/errors.gen.ts'
|
||||
export { post7Errors as 'POST /apps/{app_id}/advanced-chat/workflows/draft/iteration/nodes/{node_id}/run' } from './apps/errors.gen.ts'
|
||||
export { post7Errors as 'POST /installed-apps/{installed_app_id}/messages/{message_id}/feedbacks' } from './installed-apps/errors.gen.ts'
|
||||
export { post7Errors as 'POST /knowledge-fs/spaces/{control_space_id}/documents' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post7Errors as 'POST /rag/pipelines/{pipeline_id}/customized/publish' } from './rag/errors.gen.ts'
|
||||
export { post7Errors as 'POST /snippets/{snippet_id}/workflows/draft/nodes/{node_id}/agent-composer/validate' } from './snippets/errors.gen.ts'
|
||||
export { post7Errors as 'POST /trial-apps/{app_id}/text-to-audio' } from './trial-apps/errors.gen.ts'
|
||||
export { post8Errors as 'POST /account/init' } from './account/errors.gen.ts'
|
||||
export { post8Errors as 'POST /agent/{agent_id}/composer/validate' } from './agent/errors.gen.ts'
|
||||
export { post8Errors as 'POST /apps/{app_id}/advanced-chat/workflows/draft/loop/nodes/{node_id}/run' } from './apps/errors.gen.ts'
|
||||
export { post8Errors as 'POST /installed-apps/{installed_app_id}/saved-messages' } from './installed-apps/errors.gen.ts'
|
||||
export { post8Errors as 'POST /knowledge-fs/spaces/{control_space_id}/golden-questions/bulk-import' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post8Errors as 'POST /rag/pipelines/{pipeline_id}/workflow-runs/tasks/{task_id}/stop' } from './rag/errors.gen.ts'
|
||||
export { post8Errors as 'POST /trial-apps/{app_id}/workflows/run' } from './trial-apps/errors.gen.ts'
|
||||
export { post92Errors as 'POST /workspaces/custom-config/webapp-logo/upload' } from './workspaces/errors.gen.ts'
|
||||
export { post95Errors as 'POST /workspaces/switch' } from './workspaces/errors.gen.ts'
|
||||
export { post9Errors as 'POST /account/password' } from './account/errors.gen.ts'
|
||||
export { post9Errors as 'POST /agent/{agent_id}/config/files/batch' } from './agent/errors.gen.ts'
|
||||
export { post9Errors as 'POST /apps/{app_id}/advanced-chat/workflows/draft/run' } from './apps/errors.gen.ts'
|
||||
export { post9Errors as 'POST /installed-apps/{installed_app_id}/text-to-audio' } from './installed-apps/errors.gen.ts'
|
||||
export { post9Errors as 'POST /knowledge-fs/spaces/{control_space_id}/golden-questions/evidence-matches' } from './knowledge-fs/errors.gen.ts'
|
||||
export { post9Errors as 'POST /rag/pipelines/{pipeline_id}/workflows/draft/datasource/nodes/{node_id}/run' } from './rag/errors.gen.ts'
|
||||
export { post9Errors as 'POST /trial-apps/{app_id}/workflows/tasks/{task_id}/stop' } from './trial-apps/errors.gen.ts'
|
||||
export { postErrors as 'POST /account/change-email/check-email-unique' } from './account/errors.gen.ts'
|
||||
export { postErrors as 'POST /activate' } from './activate/errors.gen.ts'
|
||||
export { postErrors as 'POST /agent/{agent_id}/api-enable' } from './agent/errors.gen.ts'
|
||||
export { postErrors as 'POST /api-key-auth/data-source/binding' } from './api-key-auth/errors.gen.ts'
|
||||
export { postErrors as 'POST /datasets/api-keys' } from './datasets/errors.gen.ts'
|
||||
export { postErrors as 'POST /email-code-login/validity' } from './email-code-login/errors.gen.ts'
|
||||
export { postErrors as 'POST /email-register/send-email' } from './email-register/errors.gen.ts'
|
||||
export { postErrors as 'POST /files/upload' } from './files/errors.gen.ts'
|
||||
export { postErrors as 'POST /forgot-password/resets' } from './forgot-password/errors.gen.ts'
|
||||
export { postErrors as 'POST /form/human-input/v2/{form_token}' } from './form/errors.gen.ts'
|
||||
export { postErrors as 'POST /installed-apps/{installed_app_id}/audio-to-text' } from './installed-apps/errors.gen.ts'
|
||||
export { postErrors as 'POST /knowledge-fs/query-stream' } from './knowledge-fs/errors.gen.ts'
|
||||
export { postErrors as 'POST /login' } from './login/errors.gen.ts'
|
||||
export { postErrors as 'POST /remote-files/upload' } from './remote-files/errors.gen.ts'
|
||||
export { postErrors as 'POST /reset-password' } from './reset-password/errors.gen.ts'
|
||||
export { postErrors as 'POST /rule-code-generate' } from './rule-code-generate/errors.gen.ts'
|
||||
export { postErrors as 'POST /rule-generate' } from './rule-generate/errors.gen.ts'
|
||||
export { postErrors as 'POST /rule-structured-output-generate' } from './rule-structured-output-generate/errors.gen.ts'
|
||||
export { postErrors as 'POST /trial-apps/{app_id}/audio-to-text' } from './trial-apps/errors.gen.ts'
|
||||
export { postErrors as 'POST /website/crawl' } from './website/errors.gen.ts'
|
||||
export { postErrors as 'POST /workflow-run-archives/downloads' } from './workflow-run-archives/errors.gen.ts'
|
||||
export { put24Errors as 'PUT /workspaces/current/skills/{skill_id}/files' } from './workspaces/errors.gen.ts'
|
||||
export { put2Errors as 'PUT /agent/{agent_id}/composer' } from './agent/errors.gen.ts'
|
||||
export { put2Errors as 'PUT /apps/{app_id}/server' } from './apps/errors.gen.ts'
|
||||
export { put2Errors as 'PUT /knowledge-fs/spaces/{control_space_id}/external-access' } from './knowledge-fs/errors.gen.ts'
|
||||
export { put3Errors as 'PUT /agent/{agent_id}' } from './agent/errors.gen.ts'
|
||||
export { put3Errors as 'PUT /apps/{app_id}/workflow/comments/{comment_id}/replies/{reply_id}' } from './apps/errors.gen.ts'
|
||||
export { put3Errors as 'PUT /knowledge-fs/spaces/{control_space_id}/members' } from './knowledge-fs/errors.gen.ts'
|
||||
export { put4Errors as 'PUT /apps/{app_id}/workflow/comments/{comment_id}' } from './apps/errors.gen.ts'
|
||||
export { put4Errors as 'PUT /knowledge-fs/spaces/{control_space_id}/sources/{source_id}/sync-policy' } from './knowledge-fs/errors.gen.ts'
|
||||
export { put5Errors as 'PUT /apps/{app_id}/workflows/draft/nodes/{node_id}/agent-composer' } from './apps/errors.gen.ts'
|
||||
export { put5Errors as 'PUT /knowledge-fs/spaces/{control_space_id}/tags' } from './knowledge-fs/errors.gen.ts'
|
||||
export { put6Errors as 'PUT /apps/{app_id}/workflows/draft/variables/{variable_id}/reset' } from './apps/errors.gen.ts'
|
||||
export { put6Errors as 'PUT /workspaces/current/members/{member_id}/update-role' } from './workspaces/errors.gen.ts'
|
||||
export { put9Errors as 'PUT /workspaces/current/network-access-groups/{group_id}' } from './workspaces/errors.gen.ts'
|
||||
export { putErrors as 'PUT /agent/{agent_id}/build-draft' } from './agent/errors.gen.ts'
|
||||
export { putErrors as 'PUT /apps/{app_id}/network-access-group' } from './apps/errors.gen.ts'
|
||||
export { putErrors as 'PUT /knowledge-fs/spaces/{control_space_id}/app-bindings' } from './knowledge-fs/errors.gen.ts'
|
||||
export { putErrors as 'PUT /rag/pipelines/{pipeline_id}/workflows/draft/variables/{variable_id}/reset' } from './rag/errors.gen.ts'
|
||||
export { putErrors as 'PUT /snippets/{snippet_id}/workflows/draft/nodes/{node_id}/agent-composer' } from './snippets/errors.gen.ts'
|
||||
export { putErrors as 'PUT /workspaces/current/agents/{agent_id}/skills' } from './workspaces/errors.gen.ts'
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
// This file is auto-generated by scripts/add-orpc-error-maps.ts
|
||||
import * as z from 'zod'
|
||||
|
||||
const zErrorResponse = /* @__PURE__ */ (() =>
|
||||
z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
}))()
|
||||
|
||||
const zRecommendedAppNotFoundError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('recommended_app_not_found'),
|
||||
status: z.literal(404),
|
||||
}),
|
||||
))()
|
||||
|
||||
export const get2Errors = {
|
||||
recommended_app_not_found: { status: 404, data: zRecommendedAppNotFoundError },
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { oc } from '@orpc/contract'
|
||||
import * as z from 'zod'
|
||||
import { zRecommendedAppNotFoundError } from './zod.gen.ts'
|
||||
import {
|
||||
zGetExploreAppsByAppIdPath,
|
||||
zGetExploreAppsByAppIdResponse,
|
||||
zGetExploreAppsLearnDifyQuery,
|
||||
zGetExploreAppsLearnDifyResponse,
|
||||
zGetExploreAppsQuery,
|
||||
zGetExploreAppsResponse,
|
||||
zGetExploreBannersQuery,
|
||||
zGetExploreBannersResponse,
|
||||
} from './zod.gen.ts'
|
||||
|
||||
export const get = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getExploreAppsLearnDify',
|
||||
path: '/explore/apps/learn-dify',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ query: zGetExploreAppsLearnDifyQuery.optional() }).optional())
|
||||
.output(zGetExploreAppsLearnDifyResponse)
|
||||
|
||||
export const learnDify = {
|
||||
get,
|
||||
}
|
||||
|
||||
export const get2 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getExploreAppsByAppId',
|
||||
path: '/explore/apps/{app_id}',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zGetExploreAppsByAppIdPath }))
|
||||
.output(zGetExploreAppsByAppIdResponse)
|
||||
.errors({ recommended_app_not_found: { status: 404, data: zRecommendedAppNotFoundError } })
|
||||
|
||||
export const byAppId = {
|
||||
get: get2,
|
||||
}
|
||||
|
||||
export const get3 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getExploreApps',
|
||||
path: '/explore/apps',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ query: zGetExploreAppsQuery.optional() }).optional())
|
||||
.output(zGetExploreAppsResponse)
|
||||
|
||||
export const apps = {
|
||||
get: get3,
|
||||
learnDify,
|
||||
byAppId,
|
||||
}
|
||||
|
||||
/**
|
||||
* Get banner list
|
||||
*/
|
||||
export const get4 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getExploreBanners',
|
||||
path: '/explore/banners',
|
||||
summary: 'Get banner list',
|
||||
tags: ['default'],
|
||||
})
|
||||
.input(z.object({ query: zGetExploreBannersQuery.optional() }).optional())
|
||||
.output(zGetExploreBannersResponse)
|
||||
|
||||
export const banners = {
|
||||
get: get4,
|
||||
}
|
||||
|
||||
export const explore = {
|
||||
apps,
|
||||
banners,
|
||||
}
|
||||
|
||||
export const contract = {
|
||||
explore,
|
||||
}
|
||||
+204
@@ -0,0 +1,204 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type ClientOptions = {
|
||||
baseUrl: `${string}://${string}/console/api` | (string & {})
|
||||
}
|
||||
|
||||
export type RecommendedAppListResponse = {
|
||||
categories: Array<string>
|
||||
recommended_apps: Array<RecommendedAppResponse>
|
||||
}
|
||||
|
||||
export type ErrorResponse = {
|
||||
code: string
|
||||
details?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
message: string
|
||||
params?: string
|
||||
status: number
|
||||
}
|
||||
|
||||
export type LearnDifyAppListResponse = {
|
||||
recommended_apps: Array<RecommendedAppResponse>
|
||||
}
|
||||
|
||||
export type RecommendedAppDetailResponse = {
|
||||
can_trial: boolean
|
||||
export_data: string
|
||||
icon?: string | null
|
||||
icon_background?: string | null
|
||||
id: string
|
||||
mode: string
|
||||
name: string
|
||||
package_url?: string | null
|
||||
version_id?: string | null
|
||||
}
|
||||
|
||||
export type RecommendedAppNotFoundError = ErrorResponse & {
|
||||
code: 'recommended_app_not_found'
|
||||
status: 404
|
||||
}
|
||||
|
||||
export type BannerListResponse = Array<BannerResponse>
|
||||
|
||||
export type RecommendedAppResponse = {
|
||||
app?: RecommendedAppInfoResponse | null
|
||||
app_id: string
|
||||
can_trial: boolean
|
||||
categories?: Array<string>
|
||||
copyright?: string | null
|
||||
custom_disclaimer?: string | null
|
||||
description?: string | null
|
||||
is_listed?: boolean | null
|
||||
position?: number | null
|
||||
privacy_policy?: string | null
|
||||
}
|
||||
|
||||
export type BannerResponse = {
|
||||
content: BannerContentResponse
|
||||
created_at: string
|
||||
id: string
|
||||
link: string
|
||||
sort: number
|
||||
status: BannerStatus
|
||||
}
|
||||
|
||||
export type RecommendedAppInfoResponse = {
|
||||
icon?: string | null
|
||||
icon_background?: string | null
|
||||
icon_type?: string | null
|
||||
readonly icon_url: string | null
|
||||
id: string
|
||||
mode?: string | null
|
||||
name?: string | null
|
||||
}
|
||||
|
||||
export type BannerContentResponse = {
|
||||
category: string
|
||||
description: string
|
||||
'img-src': string
|
||||
title: string
|
||||
}
|
||||
|
||||
export type BannerStatus = 'disabled' | 'enabled'
|
||||
|
||||
export type RecommendedAppListResponseWritable = {
|
||||
categories: Array<string>
|
||||
recommended_apps: Array<RecommendedAppResponseWritable>
|
||||
}
|
||||
|
||||
export type LearnDifyAppListResponseWritable = {
|
||||
recommended_apps: Array<RecommendedAppResponseWritable>
|
||||
}
|
||||
|
||||
export type RecommendedAppResponseWritable = {
|
||||
app?: RecommendedAppInfoResponseWritable | null
|
||||
app_id: string
|
||||
can_trial: boolean
|
||||
categories?: Array<string>
|
||||
copyright?: string | null
|
||||
custom_disclaimer?: string | null
|
||||
description?: string | null
|
||||
is_listed?: boolean | null
|
||||
position?: number | null
|
||||
privacy_policy?: string | null
|
||||
}
|
||||
|
||||
export type RecommendedAppInfoResponseWritable = {
|
||||
icon?: string | null
|
||||
icon_background?: string | null
|
||||
icon_type?: string | null
|
||||
id: string
|
||||
mode?: string | null
|
||||
name?: string | null
|
||||
}
|
||||
|
||||
export type GetExploreAppsData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
language?: string
|
||||
}
|
||||
url: '/explore/apps'
|
||||
}
|
||||
|
||||
export type GetExploreAppsErrors = {
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type GetExploreAppsError = GetExploreAppsErrors[keyof GetExploreAppsErrors]
|
||||
|
||||
export type GetExploreAppsResponses = {
|
||||
200: RecommendedAppListResponse
|
||||
}
|
||||
|
||||
export type GetExploreAppsResponse = GetExploreAppsResponses[keyof GetExploreAppsResponses]
|
||||
|
||||
export type GetExploreAppsLearnDifyData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
language?: string
|
||||
}
|
||||
url: '/explore/apps/learn-dify'
|
||||
}
|
||||
|
||||
export type GetExploreAppsLearnDifyErrors = {
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type GetExploreAppsLearnDifyError =
|
||||
GetExploreAppsLearnDifyErrors[keyof GetExploreAppsLearnDifyErrors]
|
||||
|
||||
export type GetExploreAppsLearnDifyResponses = {
|
||||
200: LearnDifyAppListResponse
|
||||
}
|
||||
|
||||
export type GetExploreAppsLearnDifyResponse =
|
||||
GetExploreAppsLearnDifyResponses[keyof GetExploreAppsLearnDifyResponses]
|
||||
|
||||
export type GetExploreAppsByAppIdData = {
|
||||
body?: never
|
||||
path: {
|
||||
app_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/explore/apps/{app_id}'
|
||||
}
|
||||
|
||||
export type GetExploreAppsByAppIdErrors = {
|
||||
404: RecommendedAppNotFoundError | ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type GetExploreAppsByAppIdError =
|
||||
GetExploreAppsByAppIdErrors[keyof GetExploreAppsByAppIdErrors]
|
||||
|
||||
export type GetExploreAppsByAppIdResponses = {
|
||||
200: RecommendedAppDetailResponse
|
||||
}
|
||||
|
||||
export type GetExploreAppsByAppIdResponse =
|
||||
GetExploreAppsByAppIdResponses[keyof GetExploreAppsByAppIdResponses]
|
||||
|
||||
export type GetExploreBannersData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
language?: string
|
||||
}
|
||||
url: '/explore/banners'
|
||||
}
|
||||
|
||||
export type GetExploreBannersErrors = {
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type GetExploreBannersError = GetExploreBannersErrors[keyof GetExploreBannersErrors]
|
||||
|
||||
export type GetExploreBannersResponses = {
|
||||
200: BannerListResponse
|
||||
}
|
||||
|
||||
export type GetExploreBannersResponse = GetExploreBannersResponses[keyof GetExploreBannersResponses]
|
||||
@@ -0,0 +1,203 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import * as z from 'zod'
|
||||
|
||||
/**
|
||||
* ErrorResponse
|
||||
*
|
||||
* Documented non-2xx body emitted by ``register_external_error_handlers``.
|
||||
*
|
||||
* ``params`` and ``details`` appear only on the errors that set them. The schema
|
||||
* stays open because ``HTTPException.data`` may carry extra keys.
|
||||
*/
|
||||
export const zErrorResponse = z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
})
|
||||
|
||||
/**
|
||||
* RecommendedAppDetailResponse
|
||||
*/
|
||||
export const zRecommendedAppDetailResponse = z.object({
|
||||
can_trial: z.boolean(),
|
||||
export_data: z.string(),
|
||||
icon: z.string().nullish(),
|
||||
icon_background: z.string().nullish(),
|
||||
id: z.string(),
|
||||
mode: z.string(),
|
||||
name: z.string(),
|
||||
package_url: z.string().nullish(),
|
||||
version_id: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* RecommendedAppNotFoundError
|
||||
*
|
||||
* Recommended app not found.
|
||||
*/
|
||||
export const zRecommendedAppNotFoundError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('recommended_app_not_found'),
|
||||
status: z.literal(404),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* RecommendedAppInfoResponse
|
||||
*/
|
||||
export const zRecommendedAppInfoResponse = z.object({
|
||||
icon: z.string().nullish(),
|
||||
icon_background: z.string().nullish(),
|
||||
icon_type: z.string().nullish(),
|
||||
icon_url: z.string().nullable(),
|
||||
id: z.string(),
|
||||
mode: z.string().nullish(),
|
||||
name: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* RecommendedAppResponse
|
||||
*/
|
||||
export const zRecommendedAppResponse = z.object({
|
||||
app: zRecommendedAppInfoResponse.nullish(),
|
||||
app_id: z.string(),
|
||||
can_trial: z.boolean(),
|
||||
categories: z.array(z.string()).optional(),
|
||||
copyright: z.string().nullish(),
|
||||
custom_disclaimer: z.string().nullish(),
|
||||
description: z.string().nullish(),
|
||||
is_listed: z.boolean().nullish(),
|
||||
position: z.int().nullish(),
|
||||
privacy_policy: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* RecommendedAppListResponse
|
||||
*/
|
||||
export const zRecommendedAppListResponse = z.object({
|
||||
categories: z.array(z.string()),
|
||||
recommended_apps: z.array(zRecommendedAppResponse),
|
||||
})
|
||||
|
||||
/**
|
||||
* LearnDifyAppListResponse
|
||||
*/
|
||||
export const zLearnDifyAppListResponse = z.object({
|
||||
recommended_apps: z.array(zRecommendedAppResponse),
|
||||
})
|
||||
|
||||
/**
|
||||
* BannerContentResponse
|
||||
*/
|
||||
export const zBannerContentResponse = z.object({
|
||||
category: z.string(),
|
||||
description: z.string(),
|
||||
'img-src': z.string().min(1),
|
||||
title: z.string().min(1),
|
||||
})
|
||||
|
||||
/**
|
||||
* BannerStatus
|
||||
*
|
||||
* ExporleBanner status
|
||||
*/
|
||||
export const zBannerStatus = z.enum(['disabled', 'enabled'])
|
||||
|
||||
/**
|
||||
* BannerResponse
|
||||
*/
|
||||
export const zBannerResponse = z.object({
|
||||
content: zBannerContentResponse,
|
||||
created_at: z.string(),
|
||||
id: z.string(),
|
||||
link: z.string(),
|
||||
sort: z.int(),
|
||||
status: zBannerStatus,
|
||||
})
|
||||
|
||||
/**
|
||||
* BannerListResponse
|
||||
*/
|
||||
export const zBannerListResponse = z.array(zBannerResponse)
|
||||
|
||||
/**
|
||||
* RecommendedAppInfoResponse
|
||||
*/
|
||||
export const zRecommendedAppInfoResponseWritable = z.object({
|
||||
icon: z.string().nullish(),
|
||||
icon_background: z.string().nullish(),
|
||||
icon_type: z.string().nullish(),
|
||||
id: z.string(),
|
||||
mode: z.string().nullish(),
|
||||
name: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* RecommendedAppResponse
|
||||
*/
|
||||
export const zRecommendedAppResponseWritable = z.object({
|
||||
app: zRecommendedAppInfoResponseWritable.nullish(),
|
||||
app_id: z.string(),
|
||||
can_trial: z.boolean(),
|
||||
categories: z.array(z.string()).optional(),
|
||||
copyright: z.string().nullish(),
|
||||
custom_disclaimer: z.string().nullish(),
|
||||
description: z.string().nullish(),
|
||||
is_listed: z.boolean().nullish(),
|
||||
position: z.int().nullish(),
|
||||
privacy_policy: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* RecommendedAppListResponse
|
||||
*/
|
||||
export const zRecommendedAppListResponseWritable = z.object({
|
||||
categories: z.array(z.string()),
|
||||
recommended_apps: z.array(zRecommendedAppResponseWritable),
|
||||
})
|
||||
|
||||
/**
|
||||
* LearnDifyAppListResponse
|
||||
*/
|
||||
export const zLearnDifyAppListResponseWritable = z.object({
|
||||
recommended_apps: z.array(zRecommendedAppResponseWritable),
|
||||
})
|
||||
|
||||
export const zGetExploreAppsQuery = z.object({
|
||||
language: z.string().optional().default('en-US'),
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zGetExploreAppsResponse = zRecommendedAppListResponse
|
||||
|
||||
export const zGetExploreAppsLearnDifyQuery = z.object({
|
||||
language: z.string().optional().default('en-US'),
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zGetExploreAppsLearnDifyResponse = zLearnDifyAppListResponse
|
||||
|
||||
export const zGetExploreAppsByAppIdPath = z.object({
|
||||
app_id: z.uuid(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zGetExploreAppsByAppIdResponse = zRecommendedAppDetailResponse
|
||||
|
||||
export const zGetExploreBannersQuery = z.object({
|
||||
language: z.string().optional().default('en-US'),
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zGetExploreBannersResponse = zBannerListResponse
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { oc } from '@orpc/contract'
|
||||
import { zGetFeaturesResponse, zGetFeaturesVectorSpaceResponse } from './zod.gen.ts'
|
||||
|
||||
/**
|
||||
* Get vector-space usage and limit for current tenant
|
||||
*
|
||||
* Get vector-space usage and limit for current tenant
|
||||
*/
|
||||
export const get = oc
|
||||
.route({
|
||||
description: 'Get vector-space usage and limit for current tenant',
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getFeaturesVectorSpace',
|
||||
path: '/features/vector-space',
|
||||
summary: 'Get vector-space usage and limit for current tenant',
|
||||
tags: ['console'],
|
||||
})
|
||||
.output(zGetFeaturesVectorSpaceResponse)
|
||||
|
||||
export const vectorSpace = {
|
||||
get,
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current workspace features
|
||||
*
|
||||
* Get feature availability and limits for the current workspace
|
||||
*/
|
||||
export const get2 = oc
|
||||
.route({
|
||||
description: 'Get feature availability and limits for the current workspace',
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getFeatures',
|
||||
path: '/features',
|
||||
summary: 'Get current workspace features',
|
||||
tags: ['console'],
|
||||
})
|
||||
.output(zGetFeaturesResponse)
|
||||
|
||||
export const features = {
|
||||
get: get2,
|
||||
vectorSpace,
|
||||
}
|
||||
|
||||
export const contract = {
|
||||
features,
|
||||
}
|
||||
+119
@@ -0,0 +1,119 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type ClientOptions = {
|
||||
baseUrl: `${string}://${string}/console/api` | (string & {})
|
||||
}
|
||||
|
||||
export type FeatureModel = {
|
||||
annotation_quota_limit: LimitationModel
|
||||
api_rate_limit: Quota
|
||||
apps: LimitationModel
|
||||
billing: BillingModel
|
||||
can_replace_logo: boolean
|
||||
documents_upload_quota: LimitationModel
|
||||
education: EducationModel
|
||||
enable_knowledge_fs: boolean
|
||||
enable_skill: boolean
|
||||
human_input_email_delivery_enabled: boolean
|
||||
im_centrally_managed: boolean
|
||||
is_allow_transfer_workspace: boolean
|
||||
knowledge_pipeline: KnowledgePipeline
|
||||
members: LimitationModel
|
||||
model_load_balancing_enabled: boolean
|
||||
trigger_event: Quota
|
||||
webapp_copyright_enabled: boolean
|
||||
workspace_members: LicenseLimitationModel
|
||||
}
|
||||
|
||||
export type ErrorResponse = {
|
||||
code: string
|
||||
details?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
message: string
|
||||
params?: string
|
||||
status: number
|
||||
}
|
||||
|
||||
export type VectorSpaceLimitationModel = {
|
||||
limit: number
|
||||
size: number
|
||||
usage_unknown?: boolean
|
||||
}
|
||||
|
||||
export type LimitationModel = {
|
||||
limit: number
|
||||
size: number
|
||||
}
|
||||
|
||||
export type Quota = {
|
||||
limit: number
|
||||
reset_date: number
|
||||
usage: number
|
||||
}
|
||||
|
||||
export type BillingModel = {
|
||||
subscription: SubscriptionModel
|
||||
}
|
||||
|
||||
export type EducationModel = {
|
||||
activated: boolean
|
||||
enabled: boolean
|
||||
}
|
||||
|
||||
export type KnowledgePipeline = {
|
||||
publish_enabled: boolean
|
||||
}
|
||||
|
||||
export type LicenseLimitationModel = {
|
||||
enabled: boolean
|
||||
limit: number
|
||||
size: number
|
||||
}
|
||||
|
||||
export type SubscriptionModel = {
|
||||
interval: '' | 'month' | 'year'
|
||||
plan: CloudPlan
|
||||
}
|
||||
|
||||
export type CloudPlan = 'professional' | 'sandbox' | 'team'
|
||||
|
||||
export type GetFeaturesData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/features'
|
||||
}
|
||||
|
||||
export type GetFeaturesErrors = {
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type GetFeaturesError = GetFeaturesErrors[keyof GetFeaturesErrors]
|
||||
|
||||
export type GetFeaturesResponses = {
|
||||
200: FeatureModel
|
||||
}
|
||||
|
||||
export type GetFeaturesResponse = GetFeaturesResponses[keyof GetFeaturesResponses]
|
||||
|
||||
export type GetFeaturesVectorSpaceData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/features/vector-space'
|
||||
}
|
||||
|
||||
export type GetFeaturesVectorSpaceErrors = {
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type GetFeaturesVectorSpaceError =
|
||||
GetFeaturesVectorSpaceErrors[keyof GetFeaturesVectorSpaceErrors]
|
||||
|
||||
export type GetFeaturesVectorSpaceResponses = {
|
||||
200: VectorSpaceLimitationModel
|
||||
}
|
||||
|
||||
export type GetFeaturesVectorSpaceResponse =
|
||||
GetFeaturesVectorSpaceResponses[keyof GetFeaturesVectorSpaceResponses]
|
||||
+147
@@ -0,0 +1,147 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import * as z from 'zod'
|
||||
|
||||
/**
|
||||
* ErrorResponse
|
||||
*
|
||||
* Documented non-2xx body emitted by ``register_external_error_handlers``.
|
||||
*
|
||||
* ``params`` and ``details`` appear only on the errors that set them. The schema
|
||||
* stays open because ``HTTPException.data`` may carry extra keys.
|
||||
*/
|
||||
export const zErrorResponse = z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
})
|
||||
|
||||
/**
|
||||
* VectorSpaceLimitationModel
|
||||
*/
|
||||
export const zVectorSpaceLimitationModel = z.object({
|
||||
limit: z.int(),
|
||||
size: z.int(),
|
||||
usage_unknown: z.boolean().optional().default(false),
|
||||
})
|
||||
|
||||
/**
|
||||
* LimitationModel
|
||||
*/
|
||||
export const zLimitationModel = z.object({
|
||||
limit: z.int().default(0),
|
||||
size: z.int().default(0),
|
||||
})
|
||||
|
||||
/**
|
||||
* Quota
|
||||
*/
|
||||
export const zQuota = z.object({
|
||||
limit: z.int().default(0),
|
||||
reset_date: z.int().default(-1),
|
||||
usage: z.int().default(0),
|
||||
})
|
||||
|
||||
/**
|
||||
* EducationModel
|
||||
*/
|
||||
export const zEducationModel = z.object({
|
||||
activated: z.boolean().default(false),
|
||||
enabled: z.boolean().default(false),
|
||||
})
|
||||
|
||||
/**
|
||||
* KnowledgePipeline
|
||||
*/
|
||||
export const zKnowledgePipeline = z.object({
|
||||
publish_enabled: z.boolean().default(false),
|
||||
})
|
||||
|
||||
/**
|
||||
* LicenseLimitationModel
|
||||
*
|
||||
* - enabled: whether this limit is enforced
|
||||
* - size: current usage count
|
||||
* - limit: maximum allowed count; 0 means unlimited
|
||||
*/
|
||||
export const zLicenseLimitationModel = z.object({
|
||||
enabled: z.boolean().default(false),
|
||||
limit: z.int().default(0),
|
||||
size: z.int().default(0),
|
||||
})
|
||||
|
||||
/**
|
||||
* CloudPlan
|
||||
*
|
||||
* Enum representing user plan types in the cloud platform.
|
||||
*
|
||||
* SANDBOX: Free/default plan with limited features
|
||||
* PROFESSIONAL: Professional paid plan
|
||||
* TEAM: Team collaboration paid plan
|
||||
*/
|
||||
export const zCloudPlan = z.enum(['professional', 'sandbox', 'team'])
|
||||
|
||||
/**
|
||||
* SubscriptionModel
|
||||
*/
|
||||
export const zSubscriptionModel = z.object({
|
||||
interval: z.enum(['', 'month', 'year']).default(''),
|
||||
plan: zCloudPlan.default('sandbox'),
|
||||
})
|
||||
|
||||
/**
|
||||
* BillingModel
|
||||
*/
|
||||
export const zBillingModel = z.object({
|
||||
subscription: zSubscriptionModel.default({ interval: '', plan: 'sandbox' }),
|
||||
})
|
||||
|
||||
/**
|
||||
* FeatureModel
|
||||
*
|
||||
* Effective feature availability and limits for the current workspace.
|
||||
*/
|
||||
export const zFeatureModel = z.object({
|
||||
annotation_quota_limit: zLimitationModel.default({ limit: 10, size: 0 }),
|
||||
api_rate_limit: zQuota.default({
|
||||
limit: 5000,
|
||||
reset_date: 0,
|
||||
usage: 0,
|
||||
}),
|
||||
apps: zLimitationModel.default({ limit: 10, size: 0 }),
|
||||
billing: zBillingModel.default({ subscription: { interval: '', plan: 'sandbox' } }),
|
||||
can_replace_logo: z.boolean().default(false),
|
||||
documents_upload_quota: zLimitationModel.default({ limit: 50, size: 0 }),
|
||||
education: zEducationModel.default({ activated: false, enabled: false }),
|
||||
enable_knowledge_fs: z.boolean().default(false),
|
||||
enable_skill: z.boolean().default(true),
|
||||
human_input_email_delivery_enabled: z.boolean().default(false),
|
||||
im_centrally_managed: z.boolean().default(false),
|
||||
is_allow_transfer_workspace: z.boolean().default(true),
|
||||
knowledge_pipeline: zKnowledgePipeline.default({ publish_enabled: false }),
|
||||
members: zLimitationModel.default({ limit: 1, size: 0 }),
|
||||
model_load_balancing_enabled: z.boolean().default(false),
|
||||
trigger_event: zQuota.default({
|
||||
limit: 3000,
|
||||
reset_date: 0,
|
||||
usage: 0,
|
||||
}),
|
||||
webapp_copyright_enabled: z.boolean().default(false),
|
||||
workspace_members: zLicenseLimitationModel.default({
|
||||
enabled: false,
|
||||
limit: 0,
|
||||
size: 0,
|
||||
}),
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zGetFeaturesResponse = zFeatureModel
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zGetFeaturesVectorSpaceResponse = zVectorSpaceLimitationModel
|
||||
@@ -0,0 +1,68 @@
|
||||
// This file is auto-generated by scripts/add-orpc-error-maps.ts
|
||||
import * as z from 'zod'
|
||||
|
||||
const zErrorResponse = /* @__PURE__ */ (() =>
|
||||
z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
}))()
|
||||
|
||||
const zFileExtensionBlockedError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('file_extension_blocked'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zFilenameNotExistsError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('filename_not_exists_error'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zNoFileUploadedError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('no_file_uploaded'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zTooManyFilesError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('too_many_files'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zFileTooLargeError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('file_too_large'),
|
||||
status: z.literal(413),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zUnsupportedFileTypeError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('unsupported_file_type'),
|
||||
status: z.literal(415),
|
||||
}),
|
||||
))()
|
||||
|
||||
export const postErrors = {
|
||||
file_extension_blocked: { status: 400, data: zFileExtensionBlockedError },
|
||||
file_too_large: { status: 413, data: zFileTooLargeError },
|
||||
filename_not_exists_error: { status: 400, data: zFilenameNotExistsError },
|
||||
no_file_uploaded: { status: 400, data: zNoFileUploadedError },
|
||||
too_many_files: { status: 400, data: zTooManyFilesError },
|
||||
unsupported_file_type: { status: 415, data: zUnsupportedFileTypeError },
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { oc } from '@orpc/contract'
|
||||
import * as z from 'zod'
|
||||
import {
|
||||
zFileExtensionBlockedError,
|
||||
zFileTooLargeError,
|
||||
zFilenameNotExistsError,
|
||||
zNoFileUploadedError,
|
||||
zTooManyFilesError,
|
||||
zUnsupportedFileTypeError,
|
||||
} from './zod.gen.ts'
|
||||
import {
|
||||
zGetFilesByFileIdPreviewPath,
|
||||
zGetFilesByFileIdPreviewResponse,
|
||||
zGetFilesSupportTypeResponse,
|
||||
zGetFilesUploadResponse,
|
||||
zPostFilesUploadBody,
|
||||
zPostFilesUploadResponse,
|
||||
} from './zod.gen.ts'
|
||||
|
||||
export const get = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getFilesSupportType',
|
||||
path: '/files/support-type',
|
||||
tags: ['console'],
|
||||
})
|
||||
.output(zGetFilesSupportTypeResponse)
|
||||
|
||||
export const supportType = {
|
||||
get,
|
||||
}
|
||||
|
||||
export const get2 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getFilesUpload',
|
||||
path: '/files/upload',
|
||||
tags: ['console'],
|
||||
})
|
||||
.output(zGetFilesUploadResponse)
|
||||
|
||||
export const post = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postFilesUpload',
|
||||
path: '/files/upload',
|
||||
successStatus: 201,
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ body: zPostFilesUploadBody }))
|
||||
.output(zPostFilesUploadResponse)
|
||||
.errors({
|
||||
file_extension_blocked: { status: 400, data: zFileExtensionBlockedError },
|
||||
file_too_large: { status: 413, data: zFileTooLargeError },
|
||||
filename_not_exists_error: { status: 400, data: zFilenameNotExistsError },
|
||||
no_file_uploaded: { status: 400, data: zNoFileUploadedError },
|
||||
too_many_files: { status: 400, data: zTooManyFilesError },
|
||||
unsupported_file_type: { status: 415, data: zUnsupportedFileTypeError },
|
||||
})
|
||||
|
||||
export const upload = {
|
||||
get: get2,
|
||||
post,
|
||||
}
|
||||
|
||||
export const get3 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getFilesByFileIdPreview',
|
||||
path: '/files/{file_id}/preview',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zGetFilesByFileIdPreviewPath }))
|
||||
.output(zGetFilesByFileIdPreviewResponse)
|
||||
|
||||
export const preview = {
|
||||
get: get3,
|
||||
}
|
||||
|
||||
export const byFileId = {
|
||||
preview,
|
||||
}
|
||||
|
||||
export const files = {
|
||||
supportType,
|
||||
upload,
|
||||
byFileId,
|
||||
}
|
||||
|
||||
export const contract = {
|
||||
files,
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type ClientOptions = {
|
||||
baseUrl: `${string}://${string}/console/api` | (string & {})
|
||||
}
|
||||
|
||||
export type AllowedExtensionsResponse = {
|
||||
allowed_extensions: Array<string>
|
||||
}
|
||||
|
||||
export type ErrorResponse = {
|
||||
code: string
|
||||
details?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
message: string
|
||||
params?: string
|
||||
status: number
|
||||
}
|
||||
|
||||
export type UploadConfig = {
|
||||
attachment_image_file_size_limit: number
|
||||
audio_file_size_limit: number
|
||||
batch_count_limit: number
|
||||
file_size_limit: number
|
||||
file_upload_limit: number
|
||||
image_file_batch_limit: number
|
||||
image_file_size_limit: number
|
||||
knowledge_file_size_limit: number
|
||||
single_chunk_attachment_limit: number
|
||||
skill_file_size_limit: number
|
||||
video_file_size_limit: number
|
||||
workflow_file_upload_limit: number
|
||||
}
|
||||
|
||||
export type FileResponse = {
|
||||
conversation_id?: string | null
|
||||
created_at?: number | null
|
||||
created_by?: string | null
|
||||
extension?: string | null
|
||||
file_key?: string | null
|
||||
id: string
|
||||
mime_type?: string | null
|
||||
name: string
|
||||
original_url?: string | null
|
||||
preview_url?: string | null
|
||||
reference?: string | null
|
||||
size: number
|
||||
source_url?: string | null
|
||||
tenant_id?: string | null
|
||||
user_id?: string | null
|
||||
}
|
||||
|
||||
export type FileExtensionBlockedError = ErrorResponse & {
|
||||
code: 'file_extension_blocked'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type FilenameNotExistsError = ErrorResponse & {
|
||||
code: 'filename_not_exists_error'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type NoFileUploadedError = ErrorResponse & {
|
||||
code: 'no_file_uploaded'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type TooManyFilesError = ErrorResponse & {
|
||||
code: 'too_many_files'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type FileTooLargeError = ErrorResponse & {
|
||||
code: 'file_too_large'
|
||||
status: 413
|
||||
}
|
||||
|
||||
export type UnsupportedFileTypeError = ErrorResponse & {
|
||||
code: 'unsupported_file_type'
|
||||
status: 415
|
||||
}
|
||||
|
||||
export type TextContentResponse = {
|
||||
content: string
|
||||
}
|
||||
|
||||
export type GetFilesSupportTypeData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/files/support-type'
|
||||
}
|
||||
|
||||
export type GetFilesSupportTypeErrors = {
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type GetFilesSupportTypeError = GetFilesSupportTypeErrors[keyof GetFilesSupportTypeErrors]
|
||||
|
||||
export type GetFilesSupportTypeResponses = {
|
||||
200: AllowedExtensionsResponse
|
||||
}
|
||||
|
||||
export type GetFilesSupportTypeResponse =
|
||||
GetFilesSupportTypeResponses[keyof GetFilesSupportTypeResponses]
|
||||
|
||||
export type GetFilesUploadData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/files/upload'
|
||||
}
|
||||
|
||||
export type GetFilesUploadErrors = {
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type GetFilesUploadError = GetFilesUploadErrors[keyof GetFilesUploadErrors]
|
||||
|
||||
export type GetFilesUploadResponses = {
|
||||
200: UploadConfig
|
||||
}
|
||||
|
||||
export type GetFilesUploadResponse = GetFilesUploadResponses[keyof GetFilesUploadResponses]
|
||||
|
||||
export type PostFilesUploadData = {
|
||||
body: {
|
||||
file: Blob | File
|
||||
source?: 'datasets'
|
||||
}
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/files/upload'
|
||||
}
|
||||
|
||||
export type PostFilesUploadErrors = {
|
||||
400:
|
||||
| FileExtensionBlockedError
|
||||
| FilenameNotExistsError
|
||||
| NoFileUploadedError
|
||||
| TooManyFilesError
|
||||
| ErrorResponse
|
||||
413: FileTooLargeError | ErrorResponse
|
||||
415: UnsupportedFileTypeError | ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type PostFilesUploadError = PostFilesUploadErrors[keyof PostFilesUploadErrors]
|
||||
|
||||
export type PostFilesUploadResponses = {
|
||||
201: FileResponse
|
||||
}
|
||||
|
||||
export type PostFilesUploadResponse = PostFilesUploadResponses[keyof PostFilesUploadResponses]
|
||||
|
||||
export type GetFilesByFileIdPreviewData = {
|
||||
body?: never
|
||||
path: {
|
||||
file_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/files/{file_id}/preview'
|
||||
}
|
||||
|
||||
export type GetFilesByFileIdPreviewErrors = {
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type GetFilesByFileIdPreviewError =
|
||||
GetFilesByFileIdPreviewErrors[keyof GetFilesByFileIdPreviewErrors]
|
||||
|
||||
export type GetFilesByFileIdPreviewResponses = {
|
||||
200: TextContentResponse
|
||||
}
|
||||
|
||||
export type GetFilesByFileIdPreviewResponse =
|
||||
GetFilesByFileIdPreviewResponses[keyof GetFilesByFileIdPreviewResponses]
|
||||
@@ -0,0 +1,173 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import * as z from 'zod'
|
||||
|
||||
/**
|
||||
* AllowedExtensionsResponse
|
||||
*/
|
||||
export const zAllowedExtensionsResponse = z.object({
|
||||
allowed_extensions: z.array(z.string()),
|
||||
})
|
||||
|
||||
/**
|
||||
* ErrorResponse
|
||||
*
|
||||
* Documented non-2xx body emitted by ``register_external_error_handlers``.
|
||||
*
|
||||
* ``params`` and ``details`` appear only on the errors that set them. The schema
|
||||
* stays open because ``HTTPException.data`` may carry extra keys.
|
||||
*/
|
||||
export const zErrorResponse = z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
})
|
||||
|
||||
/**
|
||||
* UploadConfig
|
||||
*/
|
||||
export const zUploadConfig = z.object({
|
||||
attachment_image_file_size_limit: z.int(),
|
||||
audio_file_size_limit: z.int(),
|
||||
batch_count_limit: z.int(),
|
||||
file_size_limit: z.int(),
|
||||
file_upload_limit: z.int(),
|
||||
image_file_batch_limit: z.int(),
|
||||
image_file_size_limit: z.int(),
|
||||
knowledge_file_size_limit: z.int(),
|
||||
single_chunk_attachment_limit: z.int(),
|
||||
skill_file_size_limit: z.int(),
|
||||
video_file_size_limit: z.int(),
|
||||
workflow_file_upload_limit: z.int(),
|
||||
})
|
||||
|
||||
/**
|
||||
* FileResponse
|
||||
*/
|
||||
export const zFileResponse = z.object({
|
||||
conversation_id: z.uuid().nullish(),
|
||||
created_at: z.int().nullish(),
|
||||
created_by: z.uuid().nullish(),
|
||||
extension: z.string().nullish(),
|
||||
file_key: z.string().nullish(),
|
||||
id: z.uuid(),
|
||||
mime_type: z.string().nullish(),
|
||||
name: z.string(),
|
||||
original_url: z.string().nullish(),
|
||||
preview_url: z.string().nullish(),
|
||||
reference: z.string().nullish(),
|
||||
size: z.int(),
|
||||
source_url: z.string().nullish(),
|
||||
tenant_id: z.uuid().nullish(),
|
||||
user_id: z.uuid().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* FileExtensionBlockedError
|
||||
*
|
||||
* The file extension is blocked for security reasons.
|
||||
*/
|
||||
export const zFileExtensionBlockedError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('file_extension_blocked'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* FilenameNotExistsError
|
||||
*
|
||||
* The specified filename does not exist.
|
||||
*/
|
||||
export const zFilenameNotExistsError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('filename_not_exists_error'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* NoFileUploadedError
|
||||
*
|
||||
* Please upload your file.
|
||||
*/
|
||||
export const zNoFileUploadedError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('no_file_uploaded'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* TooManyFilesError
|
||||
*
|
||||
* Only one file is allowed.
|
||||
*/
|
||||
export const zTooManyFilesError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('too_many_files'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* FileTooLargeError
|
||||
*
|
||||
* File size exceeded. {message}
|
||||
*/
|
||||
export const zFileTooLargeError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('file_too_large'),
|
||||
status: z.literal(413),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* UnsupportedFileTypeError
|
||||
*
|
||||
* File type not allowed.
|
||||
*/
|
||||
export const zUnsupportedFileTypeError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('unsupported_file_type'),
|
||||
status: z.literal(415),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* TextContentResponse
|
||||
*/
|
||||
export const zTextContentResponse = z.object({
|
||||
content: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zGetFilesSupportTypeResponse = zAllowedExtensionsResponse
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zGetFilesUploadResponse = zUploadConfig
|
||||
|
||||
export const zPostFilesUploadBody = z.object({
|
||||
file: z.custom<Blob | File>((value) => value instanceof Blob || value instanceof File),
|
||||
source: z.enum(['datasets']).optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
* File uploaded successfully
|
||||
*/
|
||||
export const zPostFilesUploadResponse = zFileResponse
|
||||
|
||||
export const zGetFilesByFileIdPreviewPath = z.object({
|
||||
file_id: z.uuid(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zGetFilesByFileIdPreviewResponse = zTextContentResponse
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
// This file is auto-generated by scripts/add-orpc-error-maps.ts
|
||||
import * as z from 'zod'
|
||||
|
||||
const zErrorResponse = /* @__PURE__ */ (() =>
|
||||
z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
}))()
|
||||
|
||||
const zEmailSendIpLimitError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_send_ip_limit'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zPasswordResetRateLimitExceededError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('password_reset_rate_limit_exceeded'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zAccountNotFoundError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('account_not_found'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zInvalidOrExpiredTokenError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invalid_or_expired_token'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zPasswordMismatchError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('password_mismatch'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zEmailCodeError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_code_error'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zInvalidEmailError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invalid_email'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zEmailPasswordResetLimitError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_password_reset_limit'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
))()
|
||||
|
||||
export const postErrors = {
|
||||
account_not_found: { status: 400, data: zAccountNotFoundError },
|
||||
invalid_or_expired_token: { status: 400, data: zInvalidOrExpiredTokenError },
|
||||
password_mismatch: { status: 400, data: zPasswordMismatchError },
|
||||
}
|
||||
|
||||
export const post2Errors = {
|
||||
email_code_error: { status: 400, data: zEmailCodeError },
|
||||
email_password_reset_limit: { status: 429, data: zEmailPasswordResetLimitError },
|
||||
invalid_email: { status: 400, data: zInvalidEmailError },
|
||||
invalid_or_expired_token: { status: 400, data: zInvalidOrExpiredTokenError },
|
||||
}
|
||||
|
||||
export const post3Errors = {
|
||||
email_send_ip_limit: { status: 429, data: zEmailSendIpLimitError },
|
||||
password_reset_rate_limit_exceeded: { status: 429, data: zPasswordResetRateLimitExceededError },
|
||||
}
|
||||
+100
@@ -0,0 +1,100 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { oc } from '@orpc/contract'
|
||||
import * as z from 'zod'
|
||||
import {
|
||||
zAccountNotFoundError,
|
||||
zEmailCodeError,
|
||||
zEmailPasswordResetLimitError,
|
||||
zEmailSendIpLimitError,
|
||||
zInvalidEmailError,
|
||||
zInvalidOrExpiredTokenError,
|
||||
zPasswordMismatchError,
|
||||
zPasswordResetRateLimitExceededError,
|
||||
} from './zod.gen.ts'
|
||||
import {
|
||||
zPostForgotPasswordBody,
|
||||
zPostForgotPasswordResetsBody,
|
||||
zPostForgotPasswordResetsResponse,
|
||||
zPostForgotPasswordResponse,
|
||||
zPostForgotPasswordValidityBody,
|
||||
zPostForgotPasswordValidityResponse,
|
||||
} from './zod.gen.ts'
|
||||
|
||||
/**
|
||||
* Reset password with verification token
|
||||
*/
|
||||
export const post = oc
|
||||
.route({
|
||||
description: 'Reset password with verification token',
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postForgotPasswordResets',
|
||||
path: '/forgot-password/resets',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ body: zPostForgotPasswordResetsBody }))
|
||||
.output(zPostForgotPasswordResetsResponse)
|
||||
.errors({
|
||||
account_not_found: { status: 400, data: zAccountNotFoundError },
|
||||
invalid_or_expired_token: { status: 400, data: zInvalidOrExpiredTokenError },
|
||||
password_mismatch: { status: 400, data: zPasswordMismatchError },
|
||||
})
|
||||
|
||||
export const resets = {
|
||||
post,
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify password reset code
|
||||
*/
|
||||
export const post2 = oc
|
||||
.route({
|
||||
description: 'Verify password reset code',
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postForgotPasswordValidity',
|
||||
path: '/forgot-password/validity',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ body: zPostForgotPasswordValidityBody }))
|
||||
.output(zPostForgotPasswordValidityResponse)
|
||||
.errors({
|
||||
email_code_error: { status: 400, data: zEmailCodeError },
|
||||
email_password_reset_limit: { status: 429, data: zEmailPasswordResetLimitError },
|
||||
invalid_email: { status: 400, data: zInvalidEmailError },
|
||||
invalid_or_expired_token: { status: 400, data: zInvalidOrExpiredTokenError },
|
||||
})
|
||||
|
||||
export const validity = {
|
||||
post: post2,
|
||||
}
|
||||
|
||||
/**
|
||||
* Send password reset email
|
||||
*/
|
||||
export const post3 = oc
|
||||
.route({
|
||||
description: 'Send password reset email',
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postForgotPassword',
|
||||
path: '/forgot-password',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ body: zPostForgotPasswordBody }))
|
||||
.output(zPostForgotPasswordResponse)
|
||||
.errors({
|
||||
email_send_ip_limit: { status: 429, data: zEmailSendIpLimitError },
|
||||
password_reset_rate_limit_exceeded: { status: 429, data: zPasswordResetRateLimitExceededError },
|
||||
})
|
||||
|
||||
export const forgotPassword = {
|
||||
post: post3,
|
||||
resets,
|
||||
validity,
|
||||
}
|
||||
|
||||
export const contract = {
|
||||
forgotPassword,
|
||||
}
|
||||
+154
@@ -0,0 +1,154 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type ClientOptions = {
|
||||
baseUrl: `${string}://${string}/console/api` | (string & {})
|
||||
}
|
||||
|
||||
export type ForgotPasswordSendPayload = {
|
||||
email: string
|
||||
language?: string | null
|
||||
}
|
||||
|
||||
export type ForgotPasswordEmailResponse = {
|
||||
data?: string | null
|
||||
result: string
|
||||
}
|
||||
|
||||
export type ErrorResponse = {
|
||||
code: string
|
||||
details?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
message: string
|
||||
params?: string
|
||||
status: number
|
||||
}
|
||||
|
||||
export type EmailSendIpLimitError = ErrorResponse & {
|
||||
code: 'email_send_ip_limit'
|
||||
status: 429
|
||||
}
|
||||
|
||||
export type PasswordResetRateLimitExceededError = ErrorResponse & {
|
||||
code: 'password_reset_rate_limit_exceeded'
|
||||
status: 429
|
||||
}
|
||||
|
||||
export type ForgotPasswordResetPayload = {
|
||||
new_password: string
|
||||
password_confirm: string
|
||||
token: string
|
||||
}
|
||||
|
||||
export type ForgotPasswordResetResponse = {
|
||||
result: string
|
||||
}
|
||||
|
||||
export type AccountNotFoundError = ErrorResponse & {
|
||||
code: 'account_not_found'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type InvalidOrExpiredTokenError = ErrorResponse & {
|
||||
code: 'invalid_or_expired_token'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type PasswordMismatchError = ErrorResponse & {
|
||||
code: 'password_mismatch'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type ForgotPasswordCheckPayload = {
|
||||
code: string
|
||||
email: string
|
||||
token: string
|
||||
}
|
||||
|
||||
export type ForgotPasswordCheckResponse = {
|
||||
email: string
|
||||
is_valid: boolean
|
||||
token: string
|
||||
}
|
||||
|
||||
export type EmailCodeError = ErrorResponse & {
|
||||
code: 'email_code_error'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type InvalidEmailError = ErrorResponse & {
|
||||
code: 'invalid_email'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type EmailPasswordResetLimitError = ErrorResponse & {
|
||||
code: 'email_password_reset_limit'
|
||||
status: 429
|
||||
}
|
||||
|
||||
export type PostForgotPasswordData = {
|
||||
body: ForgotPasswordSendPayload
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/forgot-password'
|
||||
}
|
||||
|
||||
export type PostForgotPasswordErrors = {
|
||||
400: ErrorResponse
|
||||
429: EmailSendIpLimitError | PasswordResetRateLimitExceededError | ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type PostForgotPasswordError = PostForgotPasswordErrors[keyof PostForgotPasswordErrors]
|
||||
|
||||
export type PostForgotPasswordResponses = {
|
||||
200: ForgotPasswordEmailResponse
|
||||
}
|
||||
|
||||
export type PostForgotPasswordResponse =
|
||||
PostForgotPasswordResponses[keyof PostForgotPasswordResponses]
|
||||
|
||||
export type PostForgotPasswordResetsData = {
|
||||
body: ForgotPasswordResetPayload
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/forgot-password/resets'
|
||||
}
|
||||
|
||||
export type PostForgotPasswordResetsErrors = {
|
||||
400: AccountNotFoundError | InvalidOrExpiredTokenError | PasswordMismatchError | ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type PostForgotPasswordResetsError =
|
||||
PostForgotPasswordResetsErrors[keyof PostForgotPasswordResetsErrors]
|
||||
|
||||
export type PostForgotPasswordResetsResponses = {
|
||||
200: ForgotPasswordResetResponse
|
||||
}
|
||||
|
||||
export type PostForgotPasswordResetsResponse =
|
||||
PostForgotPasswordResetsResponses[keyof PostForgotPasswordResetsResponses]
|
||||
|
||||
export type PostForgotPasswordValidityData = {
|
||||
body: ForgotPasswordCheckPayload
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/forgot-password/validity'
|
||||
}
|
||||
|
||||
export type PostForgotPasswordValidityErrors = {
|
||||
400: EmailCodeError | InvalidEmailError | InvalidOrExpiredTokenError | ErrorResponse
|
||||
429: EmailPasswordResetLimitError | ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type PostForgotPasswordValidityError =
|
||||
PostForgotPasswordValidityErrors[keyof PostForgotPasswordValidityErrors]
|
||||
|
||||
export type PostForgotPasswordValidityResponses = {
|
||||
200: ForgotPasswordCheckResponse
|
||||
}
|
||||
|
||||
export type PostForgotPasswordValidityResponse =
|
||||
PostForgotPasswordValidityResponses[keyof PostForgotPasswordValidityResponses]
|
||||
+186
@@ -0,0 +1,186 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import * as z from 'zod'
|
||||
|
||||
/**
|
||||
* ForgotPasswordSendPayload
|
||||
*/
|
||||
export const zForgotPasswordSendPayload = z.object({
|
||||
email: z.string(),
|
||||
language: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* ForgotPasswordEmailResponse
|
||||
*/
|
||||
export const zForgotPasswordEmailResponse = z.object({
|
||||
data: z.string().nullish(),
|
||||
result: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* ErrorResponse
|
||||
*
|
||||
* Documented non-2xx body emitted by ``register_external_error_handlers``.
|
||||
*
|
||||
* ``params`` and ``details`` appear only on the errors that set them. The schema
|
||||
* stays open because ``HTTPException.data`` may carry extra keys.
|
||||
*/
|
||||
export const zErrorResponse = z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
})
|
||||
|
||||
/**
|
||||
* EmailSendIpLimitError
|
||||
*
|
||||
* Too many emails have been sent from this IP address recently. Please try again later.
|
||||
*/
|
||||
export const zEmailSendIpLimitError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_send_ip_limit'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* PasswordResetRateLimitExceededError
|
||||
*
|
||||
* Too many password reset emails have been sent. Please try again in {minutes} minutes.
|
||||
*/
|
||||
export const zPasswordResetRateLimitExceededError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('password_reset_rate_limit_exceeded'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* ForgotPasswordResetPayload
|
||||
*/
|
||||
export const zForgotPasswordResetPayload = z.object({
|
||||
new_password: z.string(),
|
||||
password_confirm: z.string(),
|
||||
token: z.string().min(1),
|
||||
})
|
||||
|
||||
/**
|
||||
* ForgotPasswordResetResponse
|
||||
*/
|
||||
export const zForgotPasswordResetResponse = z.object({
|
||||
result: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AccountNotFoundError
|
||||
*
|
||||
* Account not found.
|
||||
*/
|
||||
export const zAccountNotFoundError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('account_not_found'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* InvalidOrExpiredTokenError
|
||||
*
|
||||
* The token is invalid or has expired.
|
||||
*/
|
||||
export const zInvalidOrExpiredTokenError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invalid_or_expired_token'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* PasswordMismatchError
|
||||
*
|
||||
* The passwords do not match.
|
||||
*/
|
||||
export const zPasswordMismatchError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('password_mismatch'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* ForgotPasswordCheckPayload
|
||||
*/
|
||||
export const zForgotPasswordCheckPayload = z.object({
|
||||
code: z.string(),
|
||||
email: z.string(),
|
||||
token: z.string().min(1),
|
||||
})
|
||||
|
||||
/**
|
||||
* ForgotPasswordCheckResponse
|
||||
*/
|
||||
export const zForgotPasswordCheckResponse = z.object({
|
||||
email: z.string(),
|
||||
is_valid: z.boolean(),
|
||||
token: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* EmailCodeError
|
||||
*
|
||||
* Email code is invalid or expired.
|
||||
*/
|
||||
export const zEmailCodeError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_code_error'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* InvalidEmailError
|
||||
*
|
||||
* The email address is not valid.
|
||||
*/
|
||||
export const zInvalidEmailError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invalid_email'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* EmailPasswordResetLimitError
|
||||
*
|
||||
* Too many failed password reset attempts. Please try again in 24 hours.
|
||||
*/
|
||||
export const zEmailPasswordResetLimitError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_password_reset_limit'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
)
|
||||
|
||||
export const zPostForgotPasswordBody = zForgotPasswordSendPayload
|
||||
|
||||
/**
|
||||
* Email sent successfully
|
||||
*/
|
||||
export const zPostForgotPasswordResponse = zForgotPasswordEmailResponse
|
||||
|
||||
export const zPostForgotPasswordResetsBody = zForgotPasswordResetPayload
|
||||
|
||||
/**
|
||||
* Password reset successfully
|
||||
*/
|
||||
export const zPostForgotPasswordResetsResponse = zForgotPasswordResetResponse
|
||||
|
||||
export const zPostForgotPasswordValidityBody = zForgotPasswordCheckPayload
|
||||
|
||||
/**
|
||||
* Code verified successfully
|
||||
*/
|
||||
export const zPostForgotPasswordValidityResponse = zForgotPasswordCheckResponse
|
||||
@@ -0,0 +1,89 @@
|
||||
// This file is auto-generated by scripts/add-orpc-error-maps.ts
|
||||
import * as z from 'zod'
|
||||
|
||||
const zErrorResponse = /* @__PURE__ */ (() =>
|
||||
z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
}))()
|
||||
|
||||
const zAlreadySubmittedError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('already_submitted'),
|
||||
status: z.literal(409),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zExpiredError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('expired'),
|
||||
status: z.literal(410),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zInvalidInputError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invalid_input'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zWorkflowNotActiveError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('workflow_not_active'),
|
||||
status: z.literal(409),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zHumanInputFormSubmittedError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('human_input_form_submitted'),
|
||||
status: z.literal(412),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zInvalidFormDataError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invalid_form_data'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zHumanInputFormExpiredError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('human_input_form_expired'),
|
||||
status: z.literal(412),
|
||||
}),
|
||||
))()
|
||||
|
||||
export const getErrors = {
|
||||
already_submitted: { status: 409, data: zAlreadySubmittedError },
|
||||
expired: { status: 410, data: zExpiredError },
|
||||
}
|
||||
|
||||
export const postErrors = {
|
||||
already_submitted: { status: 409, data: zAlreadySubmittedError },
|
||||
expired: { status: 410, data: zExpiredError },
|
||||
invalid_input: { status: 400, data: zInvalidInputError },
|
||||
workflow_not_active: { status: 409, data: zWorkflowNotActiveError },
|
||||
}
|
||||
|
||||
export const get2Errors = {
|
||||
human_input_form_submitted: { status: 412, data: zHumanInputFormSubmittedError },
|
||||
}
|
||||
|
||||
export const post2Errors = {
|
||||
human_input_form_expired: { status: 412, data: zHumanInputFormExpiredError },
|
||||
human_input_form_submitted: { status: 412, data: zHumanInputFormSubmittedError },
|
||||
invalid_form_data: { status: 400, data: zInvalidFormDataError },
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { oc } from '@orpc/contract'
|
||||
import * as z from 'zod'
|
||||
import {
|
||||
zAlreadySubmittedError,
|
||||
zExpiredError,
|
||||
zHumanInputFormExpiredError,
|
||||
zHumanInputFormSubmittedError,
|
||||
zInvalidFormDataError,
|
||||
zInvalidInputError,
|
||||
zWorkflowNotActiveError,
|
||||
} from './zod.gen.ts'
|
||||
import {
|
||||
zGetFormHumanInputByFormTokenPath,
|
||||
zGetFormHumanInputByFormTokenResponse,
|
||||
zGetFormHumanInputV2ByFormTokenPath,
|
||||
zGetFormHumanInputV2ByFormTokenResponse,
|
||||
zPostFormHumanInputByFormTokenBody,
|
||||
zPostFormHumanInputByFormTokenPath,
|
||||
zPostFormHumanInputByFormTokenResponse,
|
||||
zPostFormHumanInputV2ByFormTokenBody,
|
||||
zPostFormHumanInputV2ByFormTokenPath,
|
||||
zPostFormHumanInputV2ByFormTokenResponse,
|
||||
} from './zod.gen.ts'
|
||||
|
||||
/**
|
||||
* Read a frozen v2 form using the current Account's Contact authorization.
|
||||
*/
|
||||
export const get = oc
|
||||
.route({
|
||||
description: "Read a frozen v2 form using the current Account's Contact authorization.",
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getFormHumanInputV2ByFormToken',
|
||||
path: '/form/human-input/v2/{form_token}',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zGetFormHumanInputV2ByFormTokenPath }))
|
||||
.output(zGetFormHumanInputV2ByFormTokenResponse)
|
||||
.errors({
|
||||
already_submitted: { status: 409, data: zAlreadySubmittedError },
|
||||
expired: { status: 410, data: zExpiredError },
|
||||
})
|
||||
|
||||
export const post = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postFormHumanInputV2ByFormToken',
|
||||
path: '/form/human-input/v2/{form_token}',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
body: zPostFormHumanInputV2ByFormTokenBody,
|
||||
params: zPostFormHumanInputV2ByFormTokenPath,
|
||||
}),
|
||||
)
|
||||
.output(zPostFormHumanInputV2ByFormTokenResponse)
|
||||
.errors({
|
||||
already_submitted: { status: 409, data: zAlreadySubmittedError },
|
||||
expired: { status: 410, data: zExpiredError },
|
||||
invalid_input: { status: 400, data: zInvalidInputError },
|
||||
workflow_not_active: { status: 409, data: zWorkflowNotActiveError },
|
||||
})
|
||||
|
||||
export const byFormToken = {
|
||||
get,
|
||||
post,
|
||||
}
|
||||
|
||||
export const v2 = {
|
||||
byFormToken,
|
||||
}
|
||||
|
||||
/**
|
||||
* Get human input form definition by form token
|
||||
*
|
||||
* GET /console/api/form/human_input/<form_token>
|
||||
*/
|
||||
export const get2 = oc
|
||||
.route({
|
||||
description: 'GET /console/api/form/human_input/<form_token>',
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getFormHumanInputByFormToken',
|
||||
path: '/form/human_input/{form_token}',
|
||||
summary: 'Get human input form definition by form token',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zGetFormHumanInputByFormTokenPath }))
|
||||
.output(zGetFormHumanInputByFormTokenResponse)
|
||||
.errors({ human_input_form_submitted: { status: 412, data: zHumanInputFormSubmittedError } })
|
||||
|
||||
/**
|
||||
* Submit human input form by form token
|
||||
*
|
||||
* POST /console/api/form/human_input/<form_token>
|
||||
*
|
||||
* Request body:
|
||||
* {
|
||||
* "inputs": {
|
||||
* "content": "User input content"
|
||||
* },
|
||||
* "action": "Approve"
|
||||
* }
|
||||
*/
|
||||
export const post2 = oc
|
||||
.route({
|
||||
description:
|
||||
'POST /console/api/form/human_input/<form_token>\n\nRequest body:\n{\n "inputs": {\n "content": "User input content"\n },\n "action": "Approve"\n}',
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postFormHumanInputByFormToken',
|
||||
path: '/form/human_input/{form_token}',
|
||||
summary: 'Submit human input form by form token',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
body: zPostFormHumanInputByFormTokenBody,
|
||||
params: zPostFormHumanInputByFormTokenPath,
|
||||
}),
|
||||
)
|
||||
.output(zPostFormHumanInputByFormTokenResponse)
|
||||
.errors({
|
||||
human_input_form_expired: { status: 412, data: zHumanInputFormExpiredError },
|
||||
human_input_form_submitted: { status: 412, data: zHumanInputFormSubmittedError },
|
||||
invalid_form_data: { status: 400, data: zInvalidFormDataError },
|
||||
})
|
||||
|
||||
export const byFormToken2 = {
|
||||
get: get2,
|
||||
post: post2,
|
||||
}
|
||||
|
||||
export const humanInput = {
|
||||
v2,
|
||||
byFormToken: byFormToken2,
|
||||
}
|
||||
|
||||
export const form = {
|
||||
humanInput,
|
||||
}
|
||||
|
||||
export const contract = {
|
||||
form,
|
||||
}
|
||||
@@ -0,0 +1,256 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type ClientOptions = {
|
||||
baseUrl: `${string}://${string}/console/api` | (string & {})
|
||||
}
|
||||
|
||||
export type ConsoleHumanInputV2FormDefinitionResponse = {
|
||||
expiration_time: number
|
||||
resolved_form: ResolvedForm
|
||||
}
|
||||
|
||||
export type ErrorResponse = {
|
||||
code: string
|
||||
details?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
message: string
|
||||
params?: string
|
||||
status: number
|
||||
}
|
||||
|
||||
export type AlreadySubmittedError = ErrorResponse & {
|
||||
code: 'already_submitted'
|
||||
status: 409
|
||||
}
|
||||
|
||||
export type ExpiredError = ErrorResponse & {
|
||||
code: 'expired'
|
||||
status: 410
|
||||
}
|
||||
|
||||
export type ConsoleHumanInputV2SubmitPayload = {
|
||||
action: string
|
||||
inputs: {
|
||||
[key: string]: JsonValue
|
||||
}
|
||||
}
|
||||
|
||||
export type ConsoleHumanInputV2SubmitResponse = {
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
export type InvalidInputError = ErrorResponse & {
|
||||
code: 'invalid_input'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type WorkflowNotActiveError = ErrorResponse & {
|
||||
code: 'workflow_not_active'
|
||||
status: 409
|
||||
}
|
||||
|
||||
export type ConsoleHumanInputFormDefinitionResponse = {
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
export type HumanInputFormSubmittedError = ErrorResponse & {
|
||||
code: 'human_input_form_submitted'
|
||||
status: 412
|
||||
}
|
||||
|
||||
export type HumanInputFormSubmitPayload = {
|
||||
action: string
|
||||
inputs: {
|
||||
[key: string]: JsonValue
|
||||
}
|
||||
}
|
||||
|
||||
export type ConsoleHumanInputFormSubmitResponse = {
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
export type InvalidFormDataError = ErrorResponse & {
|
||||
code: 'invalid_form_data'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type HumanInputFormExpiredError = ErrorResponse & {
|
||||
code: 'human_input_form_expired'
|
||||
status: 412
|
||||
}
|
||||
|
||||
export type ResolvedForm = {
|
||||
actions: Array<UserAction>
|
||||
legacy_form_content: string
|
||||
parts: Array<FormPart>
|
||||
title: string
|
||||
}
|
||||
|
||||
export type JsonValue = unknown
|
||||
|
||||
export type UserAction = {
|
||||
button_style: ButtonStyle
|
||||
id: string
|
||||
title: string
|
||||
}
|
||||
|
||||
export type FormPart =
|
||||
| ({
|
||||
type: 'markdown_fragment'
|
||||
} & MarkdownFragment)
|
||||
| ({
|
||||
type: 'paragraph_input'
|
||||
} & ParagraphInput)
|
||||
| ({
|
||||
type: 'select_input'
|
||||
} & SelectInput)
|
||||
| ({
|
||||
type: 'file_input'
|
||||
} & FileInput)
|
||||
| ({
|
||||
type: 'file_list_input'
|
||||
} & FileListInput)
|
||||
|
||||
export type ButtonStyle = 'accent' | 'default' | 'ghost' | 'primary'
|
||||
|
||||
export type MarkdownFragment = {
|
||||
text: string
|
||||
type?: 'markdown_fragment'
|
||||
}
|
||||
|
||||
export type ParagraphInput = {
|
||||
default_value: string | null
|
||||
output_variable_name: string
|
||||
type?: 'paragraph_input'
|
||||
}
|
||||
|
||||
export type SelectInput = {
|
||||
default_value: string | null
|
||||
options: Array<string>
|
||||
output_variable_name: string
|
||||
type?: 'select_input'
|
||||
}
|
||||
|
||||
export type FileInput = {
|
||||
allowed_file_extensions: Array<string>
|
||||
allowed_file_types: Array<FileType>
|
||||
allowed_file_upload_methods: Array<FileTransferMethod>
|
||||
output_variable_name: string
|
||||
type?: 'file_input'
|
||||
}
|
||||
|
||||
export type FileListInput = {
|
||||
allowed_file_extensions: Array<string>
|
||||
allowed_file_types: Array<FileType>
|
||||
allowed_file_upload_methods: Array<FileTransferMethod>
|
||||
number_limits: number
|
||||
output_variable_name: string
|
||||
type?: 'file_list_input'
|
||||
}
|
||||
|
||||
export type FileType = 'audio' | 'custom' | 'document' | 'image' | 'video'
|
||||
|
||||
export type FileTransferMethod = 'datasource_file' | 'local_file' | 'remote_url' | 'tool_file'
|
||||
|
||||
export type GetFormHumanInputV2ByFormTokenData = {
|
||||
body?: never
|
||||
path: {
|
||||
form_token: string
|
||||
}
|
||||
query?: never
|
||||
url: '/form/human-input/v2/{form_token}'
|
||||
}
|
||||
|
||||
export type GetFormHumanInputV2ByFormTokenErrors = {
|
||||
401: ErrorResponse
|
||||
404: ErrorResponse
|
||||
409: AlreadySubmittedError | ErrorResponse
|
||||
410: ExpiredError | ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type GetFormHumanInputV2ByFormTokenError =
|
||||
GetFormHumanInputV2ByFormTokenErrors[keyof GetFormHumanInputV2ByFormTokenErrors]
|
||||
|
||||
export type GetFormHumanInputV2ByFormTokenResponses = {
|
||||
200: ConsoleHumanInputV2FormDefinitionResponse
|
||||
}
|
||||
|
||||
export type GetFormHumanInputV2ByFormTokenResponse =
|
||||
GetFormHumanInputV2ByFormTokenResponses[keyof GetFormHumanInputV2ByFormTokenResponses]
|
||||
|
||||
export type PostFormHumanInputV2ByFormTokenData = {
|
||||
body: ConsoleHumanInputV2SubmitPayload
|
||||
path: {
|
||||
form_token: string
|
||||
}
|
||||
query?: never
|
||||
url: '/form/human-input/v2/{form_token}'
|
||||
}
|
||||
|
||||
export type PostFormHumanInputV2ByFormTokenErrors = {
|
||||
400: InvalidInputError | ErrorResponse
|
||||
409: AlreadySubmittedError | WorkflowNotActiveError | ErrorResponse
|
||||
410: ExpiredError | ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type PostFormHumanInputV2ByFormTokenError =
|
||||
PostFormHumanInputV2ByFormTokenErrors[keyof PostFormHumanInputV2ByFormTokenErrors]
|
||||
|
||||
export type PostFormHumanInputV2ByFormTokenResponses = {
|
||||
200: ConsoleHumanInputV2SubmitResponse
|
||||
}
|
||||
|
||||
export type PostFormHumanInputV2ByFormTokenResponse =
|
||||
PostFormHumanInputV2ByFormTokenResponses[keyof PostFormHumanInputV2ByFormTokenResponses]
|
||||
|
||||
export type GetFormHumanInputByFormTokenData = {
|
||||
body?: never
|
||||
path: {
|
||||
form_token: string
|
||||
}
|
||||
query?: never
|
||||
url: '/form/human_input/{form_token}'
|
||||
}
|
||||
|
||||
export type GetFormHumanInputByFormTokenErrors = {
|
||||
412: HumanInputFormSubmittedError | ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type GetFormHumanInputByFormTokenError =
|
||||
GetFormHumanInputByFormTokenErrors[keyof GetFormHumanInputByFormTokenErrors]
|
||||
|
||||
export type GetFormHumanInputByFormTokenResponses = {
|
||||
200: ConsoleHumanInputFormDefinitionResponse
|
||||
}
|
||||
|
||||
export type GetFormHumanInputByFormTokenResponse =
|
||||
GetFormHumanInputByFormTokenResponses[keyof GetFormHumanInputByFormTokenResponses]
|
||||
|
||||
export type PostFormHumanInputByFormTokenData = {
|
||||
body: HumanInputFormSubmitPayload
|
||||
path: {
|
||||
form_token: string
|
||||
}
|
||||
query?: never
|
||||
url: '/form/human_input/{form_token}'
|
||||
}
|
||||
|
||||
export type PostFormHumanInputByFormTokenErrors = {
|
||||
400: InvalidFormDataError | ErrorResponse
|
||||
412: HumanInputFormExpiredError | HumanInputFormSubmittedError | ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type PostFormHumanInputByFormTokenError =
|
||||
PostFormHumanInputByFormTokenErrors[keyof PostFormHumanInputByFormTokenErrors]
|
||||
|
||||
export type PostFormHumanInputByFormTokenResponses = {
|
||||
200: ConsoleHumanInputFormSubmitResponse
|
||||
}
|
||||
|
||||
export type PostFormHumanInputByFormTokenResponse =
|
||||
PostFormHumanInputByFormTokenResponses[keyof PostFormHumanInputByFormTokenResponses]
|
||||
@@ -0,0 +1,289 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import * as z from 'zod'
|
||||
|
||||
/**
|
||||
* ErrorResponse
|
||||
*
|
||||
* Documented non-2xx body emitted by ``register_external_error_handlers``.
|
||||
*
|
||||
* ``params`` and ``details`` appear only on the errors that set them. The schema
|
||||
* stays open because ``HTTPException.data`` may carry extra keys.
|
||||
*/
|
||||
export const zErrorResponse = z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AlreadySubmittedError
|
||||
*/
|
||||
export const zAlreadySubmittedError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('already_submitted'),
|
||||
status: z.literal(409),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* ExpiredError
|
||||
*/
|
||||
export const zExpiredError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('expired'),
|
||||
status: z.literal(410),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* ConsoleHumanInputV2SubmitResponse
|
||||
*/
|
||||
export const zConsoleHumanInputV2SubmitResponse = z.record(z.string(), z.unknown())
|
||||
|
||||
/**
|
||||
* InvalidInputError
|
||||
*/
|
||||
export const zInvalidInputError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invalid_input'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* WorkflowNotActiveError
|
||||
*/
|
||||
export const zWorkflowNotActiveError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('workflow_not_active'),
|
||||
status: z.literal(409),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* ConsoleHumanInputFormDefinitionResponse
|
||||
*/
|
||||
export const zConsoleHumanInputFormDefinitionResponse = z.record(z.string(), z.unknown())
|
||||
|
||||
/**
|
||||
* HumanInputFormSubmittedError
|
||||
*
|
||||
* This form has already been submitted by another user, form_id={form_id}
|
||||
*/
|
||||
export const zHumanInputFormSubmittedError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('human_input_form_submitted'),
|
||||
status: z.literal(412),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* ConsoleHumanInputFormSubmitResponse
|
||||
*/
|
||||
export const zConsoleHumanInputFormSubmitResponse = z.record(z.string(), z.unknown())
|
||||
|
||||
/**
|
||||
* InvalidFormDataError
|
||||
*/
|
||||
export const zInvalidFormDataError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invalid_form_data'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* HumanInputFormExpiredError
|
||||
*/
|
||||
export const zHumanInputFormExpiredError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('human_input_form_expired'),
|
||||
status: z.literal(412),
|
||||
}),
|
||||
)
|
||||
|
||||
export const zJsonValue = z.unknown()
|
||||
|
||||
/**
|
||||
* ConsoleHumanInputV2SubmitPayload
|
||||
*/
|
||||
export const zConsoleHumanInputV2SubmitPayload = z.object({
|
||||
action: z.string(),
|
||||
inputs: z.record(z.string(), zJsonValue),
|
||||
})
|
||||
|
||||
/**
|
||||
* HumanInputFormSubmitPayload
|
||||
*
|
||||
* Legacy Human Input v1 submit payload shared by existing runtime surfaces.
|
||||
*/
|
||||
export const zHumanInputFormSubmitPayload = z.object({
|
||||
action: z.string(),
|
||||
inputs: z.record(z.string(), zJsonValue),
|
||||
})
|
||||
|
||||
/**
|
||||
* ButtonStyle
|
||||
*
|
||||
* Button styles for user actions.
|
||||
*/
|
||||
export const zButtonStyle = z.enum(['accent', 'default', 'ghost', 'primary'])
|
||||
|
||||
/**
|
||||
* UserAction
|
||||
*
|
||||
* Resolved action values required for presentation and submission validation.
|
||||
*/
|
||||
export const zUserAction = z.object({
|
||||
button_style: zButtonStyle,
|
||||
id: z.string(),
|
||||
title: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* MarkdownFragment
|
||||
*
|
||||
* One source-ordered Markdown fragment in a resolved form.
|
||||
*/
|
||||
export const zMarkdownFragment = z.object({
|
||||
text: z.string(),
|
||||
type: z.literal('markdown_fragment').optional().default('markdown_fragment'),
|
||||
})
|
||||
|
||||
/**
|
||||
* ParagraphInput
|
||||
*
|
||||
* Resolved multiline text input.
|
||||
*/
|
||||
export const zParagraphInput = z.object({
|
||||
default_value: z.string().nullable(),
|
||||
output_variable_name: z.string(),
|
||||
type: z.literal('paragraph_input').optional().default('paragraph_input'),
|
||||
})
|
||||
|
||||
/**
|
||||
* SelectInput
|
||||
*
|
||||
* Resolved single-choice input with immutable concrete options.
|
||||
*/
|
||||
export const zSelectInput = z.object({
|
||||
default_value: z.string().nullable(),
|
||||
options: z.array(z.string()),
|
||||
output_variable_name: z.string(),
|
||||
type: z.literal('select_input').optional().default('select_input'),
|
||||
})
|
||||
|
||||
/**
|
||||
* FileType
|
||||
*/
|
||||
export const zFileType = z.enum(['audio', 'custom', 'document', 'image', 'video'])
|
||||
|
||||
/**
|
||||
* FileTransferMethod
|
||||
*/
|
||||
export const zFileTransferMethod = z.enum([
|
||||
'datasource_file',
|
||||
'local_file',
|
||||
'remote_url',
|
||||
'tool_file',
|
||||
])
|
||||
|
||||
/**
|
||||
* FileInput
|
||||
*
|
||||
* Resolved single-file input constraints.
|
||||
*/
|
||||
export const zFileInput = z.object({
|
||||
allowed_file_extensions: z.array(z.string()),
|
||||
allowed_file_types: z.array(zFileType),
|
||||
allowed_file_upload_methods: z.array(zFileTransferMethod),
|
||||
output_variable_name: z.string(),
|
||||
type: z.literal('file_input').optional().default('file_input'),
|
||||
})
|
||||
|
||||
/**
|
||||
* FileListInput
|
||||
*
|
||||
* Resolved multi-file input constraints and effective number limit.
|
||||
*/
|
||||
export const zFileListInput = z.object({
|
||||
allowed_file_extensions: z.array(z.string()),
|
||||
allowed_file_types: z.array(zFileType),
|
||||
allowed_file_upload_methods: z.array(zFileTransferMethod),
|
||||
number_limits: z.int(),
|
||||
output_variable_name: z.string(),
|
||||
type: z.literal('file_list_input').optional().default('file_list_input'),
|
||||
})
|
||||
|
||||
export const zFormPart = z.discriminatedUnion('type', [
|
||||
zMarkdownFragment,
|
||||
zParagraphInput,
|
||||
zSelectInput,
|
||||
zFileInput,
|
||||
zFileListInput,
|
||||
])
|
||||
|
||||
/**
|
||||
* ResolvedForm
|
||||
*
|
||||
* Immutable authoritative presentation snapshot for one v2 form.
|
||||
*/
|
||||
export const zResolvedForm = z.object({
|
||||
actions: z.array(zUserAction),
|
||||
legacy_form_content: z.string(),
|
||||
parts: z.array(zFormPart),
|
||||
title: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* ConsoleHumanInputV2FormDefinitionResponse
|
||||
*
|
||||
* Frozen form definition and effective expiration in UTC epoch seconds.
|
||||
*/
|
||||
export const zConsoleHumanInputV2FormDefinitionResponse = z.object({
|
||||
expiration_time: z.int(),
|
||||
resolved_form: zResolvedForm,
|
||||
})
|
||||
|
||||
export const zGetFormHumanInputV2ByFormTokenPath = z.object({
|
||||
form_token: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Form retrieved
|
||||
*/
|
||||
export const zGetFormHumanInputV2ByFormTokenResponse = zConsoleHumanInputV2FormDefinitionResponse
|
||||
|
||||
export const zPostFormHumanInputV2ByFormTokenBody = zConsoleHumanInputV2SubmitPayload
|
||||
|
||||
export const zPostFormHumanInputV2ByFormTokenPath = z.object({
|
||||
form_token: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Approval accepted
|
||||
*/
|
||||
export const zPostFormHumanInputV2ByFormTokenResponse = zConsoleHumanInputV2SubmitResponse
|
||||
|
||||
export const zGetFormHumanInputByFormTokenPath = z.object({
|
||||
form_token: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zGetFormHumanInputByFormTokenResponse = zConsoleHumanInputFormDefinitionResponse
|
||||
|
||||
export const zPostFormHumanInputByFormTokenBody = zHumanInputFormSubmitPayload
|
||||
|
||||
export const zPostFormHumanInputByFormTokenPath = z.object({
|
||||
form_token: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zPostFormHumanInputByFormTokenResponse = zConsoleHumanInputFormSubmitResponse
|
||||
@@ -0,0 +1,44 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { oc } from '@orpc/contract'
|
||||
import * as z from 'zod'
|
||||
import { zGetInitResponse, zPostInitBody, zPostInitResponse } from './zod.gen.ts'
|
||||
|
||||
/**
|
||||
* Get initialization validation status.
|
||||
*/
|
||||
export const get = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getInit',
|
||||
path: '/init',
|
||||
summary: 'Get initialization validation status.',
|
||||
tags: ['console'],
|
||||
})
|
||||
.output(zGetInitResponse)
|
||||
|
||||
/**
|
||||
* Validate initialization password.
|
||||
*/
|
||||
export const post = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postInit',
|
||||
path: '/init',
|
||||
successStatus: 201,
|
||||
summary: 'Validate initialization password.',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ body: zPostInitBody }))
|
||||
.output(zPostInitResponse)
|
||||
|
||||
export const init = {
|
||||
get,
|
||||
post,
|
||||
}
|
||||
|
||||
export const contract = {
|
||||
init,
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type ClientOptions = {
|
||||
baseUrl: `${string}://${string}/console/api` | (string & {})
|
||||
}
|
||||
|
||||
export type InitStatusResponse = {
|
||||
status: 'finished' | 'not_started'
|
||||
}
|
||||
|
||||
export type InitValidatePayload = {
|
||||
password: string
|
||||
}
|
||||
|
||||
export type InitValidateResponse = {
|
||||
result: string
|
||||
}
|
||||
|
||||
export type GetInitData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/init'
|
||||
}
|
||||
|
||||
export type GetInitResponses = {
|
||||
200: InitStatusResponse
|
||||
}
|
||||
|
||||
export type GetInitResponse = GetInitResponses[keyof GetInitResponses]
|
||||
|
||||
export type PostInitData = {
|
||||
body: InitValidatePayload
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/init'
|
||||
}
|
||||
|
||||
export type PostInitResponses = {
|
||||
201: InitValidateResponse
|
||||
}
|
||||
|
||||
export type PostInitResponse = PostInitResponses[keyof PostInitResponses]
|
||||
@@ -0,0 +1,36 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import * as z from 'zod'
|
||||
|
||||
/**
|
||||
* InitStatusResponse
|
||||
*/
|
||||
export const zInitStatusResponse = z.object({
|
||||
status: z.enum(['finished', 'not_started']),
|
||||
})
|
||||
|
||||
/**
|
||||
* InitValidatePayload
|
||||
*/
|
||||
export const zInitValidatePayload = z.object({
|
||||
password: z.string().max(30),
|
||||
})
|
||||
|
||||
/**
|
||||
* InitValidateResponse
|
||||
*/
|
||||
export const zInitValidateResponse = z.object({
|
||||
result: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* OK
|
||||
*/
|
||||
export const zGetInitResponse = zInitStatusResponse
|
||||
|
||||
export const zPostInitBody = zInitValidatePayload
|
||||
|
||||
/**
|
||||
* Created
|
||||
*/
|
||||
export const zPostInitResponse = zInitValidateResponse
|
||||
+488
@@ -0,0 +1,488 @@
|
||||
// This file is auto-generated by scripts/add-orpc-error-maps.ts
|
||||
import * as z from 'zod'
|
||||
|
||||
const zErrorResponse = /* @__PURE__ */ (() =>
|
||||
z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
}))()
|
||||
|
||||
const zInvalidCursorError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invalid_cursor'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zWebAppAccessUnavailableError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('web_app_access_unavailable'),
|
||||
status: z.literal(503),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zAccessDeniedError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('access_denied'),
|
||||
status: z.literal(403),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zInstalledAppNotFoundError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('installed_app_not_found'),
|
||||
status: z.literal(404),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zInstalledAppUnavailableError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('installed_app_unavailable'),
|
||||
status: z.literal(404),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zAppUnavailableError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('app_unavailable'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zCompletionRequestError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('completion_request_error'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zModelCurrentlyNotSupportError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('model_currently_not_support'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zNoAudioUploadedError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('no_audio_uploaded'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zProviderNotInitializeError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('provider_not_initialize'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zProviderNotSupportSpeechToTextError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('provider_not_support_speech_to_text'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zProviderQuotaExceededError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('provider_quota_exceeded'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zSpeechToTextDisabledError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('speech_to_text_disabled'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zAgentVersionNotFoundError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('agent_version_not_found_error'),
|
||||
status: z.literal(404),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zAudioTooLargeError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('audio_too_large'),
|
||||
status: z.literal(413),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zUnsupportedAudioTypeError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('unsupported_audio_type'),
|
||||
status: z.literal(415),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zNotChatAppError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('not_chat_app'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zRateLimitError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('rate_limit_error'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zNotCompletionAppError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('not_completion_app'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zConversationCursorNotFoundError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('conversation_cursor_not_found'),
|
||||
status: z.literal(404),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zConversationNotFoundError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('conversation_not_found'),
|
||||
status: z.literal(404),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zConversationNameRequiredError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('conversation_name_required'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zConversationFirstMessageNotFoundError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('conversation_first_message_not_found'),
|
||||
status: z.literal(404),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zMessageCursorNotFoundError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('message_cursor_not_found'),
|
||||
status: z.literal(404),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zMessageFeedbackRatingRequiredError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('message_feedback_rating_required'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zMessageNotFoundError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('message_not_found'),
|
||||
status: z.literal(404),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zAppMoreLikeThisDisabledError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('app_more_like_this_disabled'),
|
||||
status: z.literal(403),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zAppSuggestedQuestionsAfterAnswerDisabledError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('app_suggested_questions_after_answer_disabled'),
|
||||
status: z.literal(403),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zProviderNotSupportTextToSpeechError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('provider_not_support_text_to_speech'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zNotWorkflowAppError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('not_workflow_app'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
export const postErrors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
agent_version_not_found_error: { status: 404, data: zAgentVersionNotFoundError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
audio_too_large: { status: 413, data: zAudioTooLargeError },
|
||||
completion_request_error: { status: 400, data: zCompletionRequestError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
no_audio_uploaded: { status: 400, data: zNoAudioUploadedError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_not_support_speech_to_text: { status: 400, data: zProviderNotSupportSpeechToTextError },
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
speech_to_text_disabled: { status: 400, data: zSpeechToTextDisabledError },
|
||||
unsupported_audio_type: { status: 415, data: zUnsupportedAudioTypeError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const post2Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_chat_app: { status: 400, data: zNotChatAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const post3Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
completion_request_error: { status: 400, data: zCompletionRequestError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
not_chat_app: { status: 400, data: zNotChatAppError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
rate_limit_error: { status: 429, data: zRateLimitError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const post4Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_completion_app: { status: 400, data: zNotCompletionAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const post5Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
completion_request_error: { status: 400, data: zCompletionRequestError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
not_completion_app: { status: 400, data: zNotCompletionAppError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const post6Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
conversation_first_message_not_found: {
|
||||
status: 404,
|
||||
data: zConversationFirstMessageNotFoundError,
|
||||
},
|
||||
conversation_name_required: { status: 400, data: zConversationNameRequiredError },
|
||||
conversation_not_found: { status: 404, data: zConversationNotFoundError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_chat_app: { status: 400, data: zNotChatAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const patchErrors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
conversation_not_found: { status: 404, data: zConversationNotFoundError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_chat_app: { status: 400, data: zNotChatAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const patch2Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
conversation_not_found: { status: 404, data: zConversationNotFoundError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_chat_app: { status: 400, data: zNotChatAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const delete_Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
conversation_not_found: { status: 404, data: zConversationNotFoundError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_chat_app: { status: 400, data: zNotChatAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const getErrors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
conversation_cursor_not_found: { status: 404, data: zConversationCursorNotFoundError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_chat_app: { status: 400, data: zNotChatAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const post7Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
message_feedback_rating_required: { status: 400, data: zMessageFeedbackRatingRequiredError },
|
||||
message_not_found: { status: 404, data: zMessageNotFoundError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const get2Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
app_more_like_this_disabled: { status: 403, data: zAppMoreLikeThisDisabledError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
completion_request_error: { status: 400, data: zCompletionRequestError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
message_not_found: { status: 404, data: zMessageNotFoundError },
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
not_completion_app: { status: 400, data: zNotCompletionAppError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const get3Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
app_suggested_questions_after_answer_disabled: {
|
||||
status: 403,
|
||||
data: zAppSuggestedQuestionsAfterAnswerDisabledError,
|
||||
},
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
completion_request_error: { status: 400, data: zCompletionRequestError },
|
||||
conversation_not_found: { status: 404, data: zConversationNotFoundError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
message_not_found: { status: 404, data: zMessageNotFoundError },
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
not_chat_app: { status: 400, data: zNotChatAppError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const get4Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
conversation_not_found: { status: 404, data: zConversationNotFoundError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
message_cursor_not_found: { status: 404, data: zMessageCursorNotFoundError },
|
||||
not_chat_app: { status: 400, data: zNotChatAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const get5Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const get6Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const delete2Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_completion_app: { status: 400, data: zNotCompletionAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const get7Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_completion_app: { status: 400, data: zNotCompletionAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const post8Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_completion_app: { status: 400, data: zNotCompletionAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const post9Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
agent_version_not_found_error: { status: 404, data: zAgentVersionNotFoundError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
completion_request_error: { status: 400, data: zCompletionRequestError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_not_support_text_to_speech: { status: 400, data: zProviderNotSupportTextToSpeechError },
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const post10Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
completion_request_error: { status: 400, data: zCompletionRequestError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
not_workflow_app: { status: 400, data: zNotWorkflowAppError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
rate_limit_error: { status: 429, data: zRateLimitError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const post11Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_workflow_app: { status: 400, data: zNotWorkflowAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const get8Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
installed_app_unavailable: { status: 404, data: zInstalledAppUnavailableError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const patch3Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const get9Errors = {
|
||||
invalid_cursor: { status: 400, data: zInvalidCursorError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
+819
@@ -0,0 +1,819 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { oc } from '@orpc/contract'
|
||||
import * as z from 'zod'
|
||||
import {
|
||||
zAccessDeniedError,
|
||||
zAgentVersionNotFoundError,
|
||||
zAppMoreLikeThisDisabledError,
|
||||
zAppSuggestedQuestionsAfterAnswerDisabledError,
|
||||
zAppUnavailableError,
|
||||
zAudioTooLargeError,
|
||||
zCompletionRequestError,
|
||||
zConversationCursorNotFoundError,
|
||||
zConversationFirstMessageNotFoundError,
|
||||
zConversationNameRequiredError,
|
||||
zConversationNotFoundError,
|
||||
zInstalledAppNotFoundError,
|
||||
zInstalledAppUnavailableError,
|
||||
zInvalidCursorError,
|
||||
zMessageCursorNotFoundError,
|
||||
zMessageFeedbackRatingRequiredError,
|
||||
zMessageNotFoundError,
|
||||
zModelCurrentlyNotSupportError,
|
||||
zNoAudioUploadedError,
|
||||
zNotChatAppError,
|
||||
zNotCompletionAppError,
|
||||
zNotWorkflowAppError,
|
||||
zProviderNotInitializeError,
|
||||
zProviderNotSupportSpeechToTextError,
|
||||
zProviderNotSupportTextToSpeechError,
|
||||
zProviderQuotaExceededError,
|
||||
zRateLimitError,
|
||||
zSpeechToTextDisabledError,
|
||||
zUnsupportedAudioTypeError,
|
||||
zWebAppAccessUnavailableError,
|
||||
} from './zod.gen.ts'
|
||||
import {
|
||||
zDeleteInstalledAppsByInstalledAppIdConversationsByCIdPath,
|
||||
zDeleteInstalledAppsByInstalledAppIdConversationsByCIdResponse,
|
||||
zDeleteInstalledAppsByInstalledAppIdSavedMessagesByMessageIdPath,
|
||||
zDeleteInstalledAppsByInstalledAppIdSavedMessagesByMessageIdResponse,
|
||||
zGetInstalledAppsByInstalledAppIdConversationsPath,
|
||||
zGetInstalledAppsByInstalledAppIdConversationsQuery,
|
||||
zGetInstalledAppsByInstalledAppIdConversationsResponse,
|
||||
zGetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisPath,
|
||||
zGetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisQuery,
|
||||
zGetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisResponse,
|
||||
zGetInstalledAppsByInstalledAppIdMessagesByMessageIdSuggestedQuestionsPath,
|
||||
zGetInstalledAppsByInstalledAppIdMessagesByMessageIdSuggestedQuestionsResponse,
|
||||
zGetInstalledAppsByInstalledAppIdMessagesPath,
|
||||
zGetInstalledAppsByInstalledAppIdMessagesQuery,
|
||||
zGetInstalledAppsByInstalledAppIdMessagesResponse,
|
||||
zGetInstalledAppsByInstalledAppIdMetaPath,
|
||||
zGetInstalledAppsByInstalledAppIdMetaResponse,
|
||||
zGetInstalledAppsByInstalledAppIdParametersPath,
|
||||
zGetInstalledAppsByInstalledAppIdParametersResponse,
|
||||
zGetInstalledAppsByInstalledAppIdPath,
|
||||
zGetInstalledAppsByInstalledAppIdResponse,
|
||||
zGetInstalledAppsByInstalledAppIdSavedMessagesPath,
|
||||
zGetInstalledAppsByInstalledAppIdSavedMessagesQuery,
|
||||
zGetInstalledAppsByInstalledAppIdSavedMessagesResponse,
|
||||
zGetInstalledAppsQuery,
|
||||
zGetInstalledAppsResponse,
|
||||
zPatchInstalledAppsByInstalledAppIdBody,
|
||||
zPatchInstalledAppsByInstalledAppIdConversationsByCIdPinPath,
|
||||
zPatchInstalledAppsByInstalledAppIdConversationsByCIdPinResponse,
|
||||
zPatchInstalledAppsByInstalledAppIdConversationsByCIdUnpinPath,
|
||||
zPatchInstalledAppsByInstalledAppIdConversationsByCIdUnpinResponse,
|
||||
zPatchInstalledAppsByInstalledAppIdPath,
|
||||
zPatchInstalledAppsByInstalledAppIdResponse,
|
||||
zPostInstalledAppsByInstalledAppIdAudioToTextPath,
|
||||
zPostInstalledAppsByInstalledAppIdAudioToTextResponse,
|
||||
zPostInstalledAppsByInstalledAppIdChatMessagesBody,
|
||||
zPostInstalledAppsByInstalledAppIdChatMessagesByTaskIdStopPath,
|
||||
zPostInstalledAppsByInstalledAppIdChatMessagesByTaskIdStopResponse,
|
||||
zPostInstalledAppsByInstalledAppIdChatMessagesPath,
|
||||
zPostInstalledAppsByInstalledAppIdChatMessagesResponse,
|
||||
zPostInstalledAppsByInstalledAppIdCompletionMessagesBody,
|
||||
zPostInstalledAppsByInstalledAppIdCompletionMessagesByTaskIdStopPath,
|
||||
zPostInstalledAppsByInstalledAppIdCompletionMessagesByTaskIdStopResponse,
|
||||
zPostInstalledAppsByInstalledAppIdCompletionMessagesPath,
|
||||
zPostInstalledAppsByInstalledAppIdCompletionMessagesResponse,
|
||||
zPostInstalledAppsByInstalledAppIdConversationsByCIdNameBody,
|
||||
zPostInstalledAppsByInstalledAppIdConversationsByCIdNamePath,
|
||||
zPostInstalledAppsByInstalledAppIdConversationsByCIdNameResponse,
|
||||
zPostInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacksBody,
|
||||
zPostInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacksPath,
|
||||
zPostInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacksResponse,
|
||||
zPostInstalledAppsByInstalledAppIdSavedMessagesBody,
|
||||
zPostInstalledAppsByInstalledAppIdSavedMessagesPath,
|
||||
zPostInstalledAppsByInstalledAppIdSavedMessagesResponse,
|
||||
zPostInstalledAppsByInstalledAppIdTextToAudioBody,
|
||||
zPostInstalledAppsByInstalledAppIdTextToAudioPath,
|
||||
zPostInstalledAppsByInstalledAppIdTextToAudioResponse,
|
||||
zPostInstalledAppsByInstalledAppIdWorkflowsRunBody,
|
||||
zPostInstalledAppsByInstalledAppIdWorkflowsRunPath,
|
||||
zPostInstalledAppsByInstalledAppIdWorkflowsRunResponse,
|
||||
zPostInstalledAppsByInstalledAppIdWorkflowsTasksByTaskIdStopPath,
|
||||
zPostInstalledAppsByInstalledAppIdWorkflowsTasksByTaskIdStopResponse,
|
||||
} from './zod.gen.ts'
|
||||
|
||||
export const post = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postInstalledAppsByInstalledAppIdAudioToText',
|
||||
path: '/installed-apps/{installed_app_id}/audio-to-text',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zPostInstalledAppsByInstalledAppIdAudioToTextPath }))
|
||||
.output(zPostInstalledAppsByInstalledAppIdAudioToTextResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
agent_version_not_found_error: { status: 404, data: zAgentVersionNotFoundError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
audio_too_large: { status: 413, data: zAudioTooLargeError },
|
||||
completion_request_error: { status: 400, data: zCompletionRequestError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
no_audio_uploaded: { status: 400, data: zNoAudioUploadedError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_not_support_speech_to_text: {
|
||||
status: 400,
|
||||
data: zProviderNotSupportSpeechToTextError,
|
||||
},
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
speech_to_text_disabled: { status: 400, data: zSpeechToTextDisabledError },
|
||||
unsupported_audio_type: { status: 415, data: zUnsupportedAudioTypeError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const audioToText = {
|
||||
post,
|
||||
}
|
||||
|
||||
export const post2 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postInstalledAppsByInstalledAppIdChatMessagesByTaskIdStop',
|
||||
path: '/installed-apps/{installed_app_id}/chat-messages/{task_id}/stop',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zPostInstalledAppsByInstalledAppIdChatMessagesByTaskIdStopPath }))
|
||||
.output(zPostInstalledAppsByInstalledAppIdChatMessagesByTaskIdStopResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_chat_app: { status: 400, data: zNotChatAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const stop = {
|
||||
post: post2,
|
||||
}
|
||||
|
||||
export const byTaskId = {
|
||||
stop,
|
||||
}
|
||||
|
||||
export const post3 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postInstalledAppsByInstalledAppIdChatMessages',
|
||||
path: '/installed-apps/{installed_app_id}/chat-messages',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
body: zPostInstalledAppsByInstalledAppIdChatMessagesBody,
|
||||
params: zPostInstalledAppsByInstalledAppIdChatMessagesPath,
|
||||
}),
|
||||
)
|
||||
.output(zPostInstalledAppsByInstalledAppIdChatMessagesResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
completion_request_error: { status: 400, data: zCompletionRequestError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
not_chat_app: { status: 400, data: zNotChatAppError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
rate_limit_error: { status: 429, data: zRateLimitError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const chatMessages = {
|
||||
post: post3,
|
||||
byTaskId,
|
||||
}
|
||||
|
||||
export const post4 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postInstalledAppsByInstalledAppIdCompletionMessagesByTaskIdStop',
|
||||
path: '/installed-apps/{installed_app_id}/completion-messages/{task_id}/stop',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zPostInstalledAppsByInstalledAppIdCompletionMessagesByTaskIdStopPath }))
|
||||
.output(zPostInstalledAppsByInstalledAppIdCompletionMessagesByTaskIdStopResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_completion_app: { status: 400, data: zNotCompletionAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const stop2 = {
|
||||
post: post4,
|
||||
}
|
||||
|
||||
export const byTaskId2 = {
|
||||
stop: stop2,
|
||||
}
|
||||
|
||||
export const post5 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postInstalledAppsByInstalledAppIdCompletionMessages',
|
||||
path: '/installed-apps/{installed_app_id}/completion-messages',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
body: zPostInstalledAppsByInstalledAppIdCompletionMessagesBody,
|
||||
params: zPostInstalledAppsByInstalledAppIdCompletionMessagesPath,
|
||||
}),
|
||||
)
|
||||
.output(zPostInstalledAppsByInstalledAppIdCompletionMessagesResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
completion_request_error: { status: 400, data: zCompletionRequestError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
not_completion_app: { status: 400, data: zNotCompletionAppError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const completionMessages = {
|
||||
post: post5,
|
||||
byTaskId: byTaskId2,
|
||||
}
|
||||
|
||||
export const post6 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postInstalledAppsByInstalledAppIdConversationsByCIdName',
|
||||
path: '/installed-apps/{installed_app_id}/conversations/{c_id}/name',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
body: zPostInstalledAppsByInstalledAppIdConversationsByCIdNameBody,
|
||||
params: zPostInstalledAppsByInstalledAppIdConversationsByCIdNamePath,
|
||||
}),
|
||||
)
|
||||
.output(zPostInstalledAppsByInstalledAppIdConversationsByCIdNameResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
conversation_first_message_not_found: {
|
||||
status: 404,
|
||||
data: zConversationFirstMessageNotFoundError,
|
||||
},
|
||||
conversation_name_required: { status: 400, data: zConversationNameRequiredError },
|
||||
conversation_not_found: { status: 404, data: zConversationNotFoundError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_chat_app: { status: 400, data: zNotChatAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const name = {
|
||||
post: post6,
|
||||
}
|
||||
|
||||
export const patch = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'PATCH',
|
||||
operationId: 'patchInstalledAppsByInstalledAppIdConversationsByCIdPin',
|
||||
path: '/installed-apps/{installed_app_id}/conversations/{c_id}/pin',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zPatchInstalledAppsByInstalledAppIdConversationsByCIdPinPath }))
|
||||
.output(zPatchInstalledAppsByInstalledAppIdConversationsByCIdPinResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
conversation_not_found: { status: 404, data: zConversationNotFoundError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_chat_app: { status: 400, data: zNotChatAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const pin = {
|
||||
patch,
|
||||
}
|
||||
|
||||
export const patch2 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'PATCH',
|
||||
operationId: 'patchInstalledAppsByInstalledAppIdConversationsByCIdUnpin',
|
||||
path: '/installed-apps/{installed_app_id}/conversations/{c_id}/unpin',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zPatchInstalledAppsByInstalledAppIdConversationsByCIdUnpinPath }))
|
||||
.output(zPatchInstalledAppsByInstalledAppIdConversationsByCIdUnpinResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
conversation_not_found: { status: 404, data: zConversationNotFoundError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_chat_app: { status: 400, data: zNotChatAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const unpin = {
|
||||
patch: patch2,
|
||||
}
|
||||
|
||||
export const delete_ = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'DELETE',
|
||||
operationId: 'deleteInstalledAppsByInstalledAppIdConversationsByCId',
|
||||
path: '/installed-apps/{installed_app_id}/conversations/{c_id}',
|
||||
successStatus: 204,
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zDeleteInstalledAppsByInstalledAppIdConversationsByCIdPath }))
|
||||
.output(zDeleteInstalledAppsByInstalledAppIdConversationsByCIdResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
conversation_not_found: { status: 404, data: zConversationNotFoundError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_chat_app: { status: 400, data: zNotChatAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const byCId = {
|
||||
delete: delete_,
|
||||
name,
|
||||
pin,
|
||||
unpin,
|
||||
}
|
||||
|
||||
export const get = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getInstalledAppsByInstalledAppIdConversations',
|
||||
path: '/installed-apps/{installed_app_id}/conversations',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
params: zGetInstalledAppsByInstalledAppIdConversationsPath,
|
||||
query: zGetInstalledAppsByInstalledAppIdConversationsQuery.optional(),
|
||||
}),
|
||||
)
|
||||
.output(zGetInstalledAppsByInstalledAppIdConversationsResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
conversation_cursor_not_found: { status: 404, data: zConversationCursorNotFoundError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_chat_app: { status: 400, data: zNotChatAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const conversations = {
|
||||
get,
|
||||
byCId,
|
||||
}
|
||||
|
||||
export const post7 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacks',
|
||||
path: '/installed-apps/{installed_app_id}/messages/{message_id}/feedbacks',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
body: zPostInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacksBody,
|
||||
params: zPostInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacksPath,
|
||||
}),
|
||||
)
|
||||
.output(zPostInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacksResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
message_feedback_rating_required: { status: 400, data: zMessageFeedbackRatingRequiredError },
|
||||
message_not_found: { status: 404, data: zMessageNotFoundError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const feedbacks = {
|
||||
post: post7,
|
||||
}
|
||||
|
||||
export const get2 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThis',
|
||||
path: '/installed-apps/{installed_app_id}/messages/{message_id}/more-like-this',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
params: zGetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisPath,
|
||||
query: zGetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisQuery,
|
||||
}),
|
||||
)
|
||||
.output(zGetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
app_more_like_this_disabled: { status: 403, data: zAppMoreLikeThisDisabledError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
completion_request_error: { status: 400, data: zCompletionRequestError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
message_not_found: { status: 404, data: zMessageNotFoundError },
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
not_completion_app: { status: 400, data: zNotCompletionAppError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const moreLikeThis = {
|
||||
get: get2,
|
||||
}
|
||||
|
||||
export const get3 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getInstalledAppsByInstalledAppIdMessagesByMessageIdSuggestedQuestions',
|
||||
path: '/installed-apps/{installed_app_id}/messages/{message_id}/suggested-questions',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
params: zGetInstalledAppsByInstalledAppIdMessagesByMessageIdSuggestedQuestionsPath,
|
||||
}),
|
||||
)
|
||||
.output(zGetInstalledAppsByInstalledAppIdMessagesByMessageIdSuggestedQuestionsResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
app_suggested_questions_after_answer_disabled: {
|
||||
status: 403,
|
||||
data: zAppSuggestedQuestionsAfterAnswerDisabledError,
|
||||
},
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
completion_request_error: { status: 400, data: zCompletionRequestError },
|
||||
conversation_not_found: { status: 404, data: zConversationNotFoundError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
message_not_found: { status: 404, data: zMessageNotFoundError },
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
not_chat_app: { status: 400, data: zNotChatAppError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const suggestedQuestions = {
|
||||
get: get3,
|
||||
}
|
||||
|
||||
export const byMessageId = {
|
||||
feedbacks,
|
||||
moreLikeThis,
|
||||
suggestedQuestions,
|
||||
}
|
||||
|
||||
export const get4 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getInstalledAppsByInstalledAppIdMessages',
|
||||
path: '/installed-apps/{installed_app_id}/messages',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
params: zGetInstalledAppsByInstalledAppIdMessagesPath,
|
||||
query: zGetInstalledAppsByInstalledAppIdMessagesQuery,
|
||||
}),
|
||||
)
|
||||
.output(zGetInstalledAppsByInstalledAppIdMessagesResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
conversation_not_found: { status: 404, data: zConversationNotFoundError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
message_cursor_not_found: { status: 404, data: zMessageCursorNotFoundError },
|
||||
not_chat_app: { status: 400, data: zNotChatAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const messages = {
|
||||
get: get4,
|
||||
byMessageId,
|
||||
}
|
||||
|
||||
/**
|
||||
* Get app meta
|
||||
*/
|
||||
export const get5 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getInstalledAppsByInstalledAppIdMeta',
|
||||
path: '/installed-apps/{installed_app_id}/meta',
|
||||
summary: 'Get app meta',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zGetInstalledAppsByInstalledAppIdMetaPath }))
|
||||
.output(zGetInstalledAppsByInstalledAppIdMetaResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const meta = {
|
||||
get: get5,
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve app parameters
|
||||
*/
|
||||
export const get6 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getInstalledAppsByInstalledAppIdParameters',
|
||||
path: '/installed-apps/{installed_app_id}/parameters',
|
||||
summary: 'Retrieve app parameters',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zGetInstalledAppsByInstalledAppIdParametersPath }))
|
||||
.output(zGetInstalledAppsByInstalledAppIdParametersResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const parameters = {
|
||||
get: get6,
|
||||
}
|
||||
|
||||
export const delete2 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'DELETE',
|
||||
operationId: 'deleteInstalledAppsByInstalledAppIdSavedMessagesByMessageId',
|
||||
path: '/installed-apps/{installed_app_id}/saved-messages/{message_id}',
|
||||
successStatus: 204,
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zDeleteInstalledAppsByInstalledAppIdSavedMessagesByMessageIdPath }))
|
||||
.output(zDeleteInstalledAppsByInstalledAppIdSavedMessagesByMessageIdResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_completion_app: { status: 400, data: zNotCompletionAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const byMessageId2 = {
|
||||
delete: delete2,
|
||||
}
|
||||
|
||||
export const get7 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getInstalledAppsByInstalledAppIdSavedMessages',
|
||||
path: '/installed-apps/{installed_app_id}/saved-messages',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
params: zGetInstalledAppsByInstalledAppIdSavedMessagesPath,
|
||||
query: zGetInstalledAppsByInstalledAppIdSavedMessagesQuery.optional(),
|
||||
}),
|
||||
)
|
||||
.output(zGetInstalledAppsByInstalledAppIdSavedMessagesResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_completion_app: { status: 400, data: zNotCompletionAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const post8 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postInstalledAppsByInstalledAppIdSavedMessages',
|
||||
path: '/installed-apps/{installed_app_id}/saved-messages',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
body: zPostInstalledAppsByInstalledAppIdSavedMessagesBody,
|
||||
params: zPostInstalledAppsByInstalledAppIdSavedMessagesPath,
|
||||
}),
|
||||
)
|
||||
.output(zPostInstalledAppsByInstalledAppIdSavedMessagesResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_completion_app: { status: 400, data: zNotCompletionAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const savedMessages = {
|
||||
get: get7,
|
||||
post: post8,
|
||||
byMessageId: byMessageId2,
|
||||
}
|
||||
|
||||
export const post9 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postInstalledAppsByInstalledAppIdTextToAudio',
|
||||
path: '/installed-apps/{installed_app_id}/text-to-audio',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
body: zPostInstalledAppsByInstalledAppIdTextToAudioBody,
|
||||
params: zPostInstalledAppsByInstalledAppIdTextToAudioPath,
|
||||
}),
|
||||
)
|
||||
.output(zPostInstalledAppsByInstalledAppIdTextToAudioResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
agent_version_not_found_error: { status: 404, data: zAgentVersionNotFoundError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
completion_request_error: { status: 400, data: zCompletionRequestError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_not_support_text_to_speech: {
|
||||
status: 400,
|
||||
data: zProviderNotSupportTextToSpeechError,
|
||||
},
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const textToAudio = {
|
||||
post: post9,
|
||||
}
|
||||
|
||||
/**
|
||||
* Run workflow
|
||||
*/
|
||||
export const post10 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postInstalledAppsByInstalledAppIdWorkflowsRun',
|
||||
path: '/installed-apps/{installed_app_id}/workflows/run',
|
||||
summary: 'Run workflow',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
body: zPostInstalledAppsByInstalledAppIdWorkflowsRunBody,
|
||||
params: zPostInstalledAppsByInstalledAppIdWorkflowsRunPath,
|
||||
}),
|
||||
)
|
||||
.output(zPostInstalledAppsByInstalledAppIdWorkflowsRunResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
completion_request_error: { status: 400, data: zCompletionRequestError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
not_workflow_app: { status: 400, data: zNotWorkflowAppError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
rate_limit_error: { status: 429, data: zRateLimitError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const run = {
|
||||
post: post10,
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop workflow task
|
||||
*/
|
||||
export const post11 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postInstalledAppsByInstalledAppIdWorkflowsTasksByTaskIdStop',
|
||||
path: '/installed-apps/{installed_app_id}/workflows/tasks/{task_id}/stop',
|
||||
summary: 'Stop workflow task',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zPostInstalledAppsByInstalledAppIdWorkflowsTasksByTaskIdStopPath }))
|
||||
.output(zPostInstalledAppsByInstalledAppIdWorkflowsTasksByTaskIdStopResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_workflow_app: { status: 400, data: zNotWorkflowAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const stop3 = {
|
||||
post: post11,
|
||||
}
|
||||
|
||||
export const byTaskId3 = {
|
||||
stop: stop3,
|
||||
}
|
||||
|
||||
export const tasks = {
|
||||
byTaskId: byTaskId3,
|
||||
}
|
||||
|
||||
export const workflows = {
|
||||
run,
|
||||
tasks,
|
||||
}
|
||||
|
||||
export const get8 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getInstalledAppsByInstalledAppId',
|
||||
path: '/installed-apps/{installed_app_id}',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zGetInstalledAppsByInstalledAppIdPath }))
|
||||
.output(zGetInstalledAppsByInstalledAppIdResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
installed_app_unavailable: { status: 404, data: zInstalledAppUnavailableError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const patch3 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'PATCH',
|
||||
operationId: 'patchInstalledAppsByInstalledAppId',
|
||||
path: '/installed-apps/{installed_app_id}',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
body: zPatchInstalledAppsByInstalledAppIdBody,
|
||||
params: zPatchInstalledAppsByInstalledAppIdPath,
|
||||
}),
|
||||
)
|
||||
.output(zPatchInstalledAppsByInstalledAppIdResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const byInstalledAppId = {
|
||||
get: get8,
|
||||
patch: patch3,
|
||||
audioToText,
|
||||
chatMessages,
|
||||
completionMessages,
|
||||
conversations,
|
||||
messages,
|
||||
meta,
|
||||
parameters,
|
||||
savedMessages,
|
||||
textToAudio,
|
||||
workflows,
|
||||
}
|
||||
|
||||
export const get9 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getInstalledApps',
|
||||
path: '/installed-apps',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ query: zGetInstalledAppsQuery.optional() }).optional())
|
||||
.output(zGetInstalledAppsResponse)
|
||||
.errors({
|
||||
invalid_cursor: { status: 400, data: zInvalidCursorError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const installedApps = {
|
||||
get: get9,
|
||||
byInstalledAppId,
|
||||
}
|
||||
|
||||
export const contract = {
|
||||
installedApps,
|
||||
}
|
||||
+1748
File diff suppressed because it is too large.
Load diff
+1669
File diff suppressed because it is too large.
Load diff
Generated
+50
@@ -0,0 +1,50 @@
|
||||
// This file is auto-generated by scripts/add-orpc-error-maps.ts
|
||||
import * as z from 'zod'
|
||||
|
||||
const zErrorResponse = /* @__PURE__ */ (() =>
|
||||
z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
}))()
|
||||
|
||||
const zCompletionRequestError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('completion_request_error'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zModelCurrentlyNotSupportError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('model_currently_not_support'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zProviderNotInitializeError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('provider_not_initialize'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zProviderQuotaExceededError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('provider_quota_exceeded'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
export const post2Errors = {
|
||||
completion_request_error: { status: 400, data: zCompletionRequestError },
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
}
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { oc } from '@orpc/contract'
|
||||
import * as z from 'zod'
|
||||
import {
|
||||
zCompletionRequestError,
|
||||
zModelCurrentlyNotSupportError,
|
||||
zProviderNotInitializeError,
|
||||
zProviderQuotaExceededError,
|
||||
} from './zod.gen.ts'
|
||||
import {
|
||||
zPostInstructionGenerateBody,
|
||||
zPostInstructionGenerateResponse,
|
||||
zPostInstructionGenerateTemplateBody,
|
||||
zPostInstructionGenerateTemplateResponse,
|
||||
} from './zod.gen.ts'
|
||||
|
||||
/**
|
||||
* Get instruction generation template
|
||||
*/
|
||||
export const post = oc
|
||||
.route({
|
||||
description: 'Get instruction generation template',
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postInstructionGenerateTemplate',
|
||||
path: '/instruction-generate/template',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ body: zPostInstructionGenerateTemplateBody }))
|
||||
.output(zPostInstructionGenerateTemplateResponse)
|
||||
|
||||
export const template = {
|
||||
post,
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate instruction for workflow nodes or general use
|
||||
*/
|
||||
export const post2 = oc
|
||||
.route({
|
||||
description: 'Generate instruction for workflow nodes or general use',
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postInstructionGenerate',
|
||||
path: '/instruction-generate',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ body: zPostInstructionGenerateBody }))
|
||||
.output(zPostInstructionGenerateResponse)
|
||||
.errors({
|
||||
completion_request_error: { status: 400, data: zCompletionRequestError },
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
})
|
||||
|
||||
export const instructionGenerate = {
|
||||
post: post2,
|
||||
template,
|
||||
}
|
||||
|
||||
export const contract = {
|
||||
instructionGenerate,
|
||||
}
|
||||
+120
@@ -0,0 +1,120 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type ClientOptions = {
|
||||
baseUrl: `${string}://${string}/console/api` | (string & {})
|
||||
}
|
||||
|
||||
export type InstructionGeneratePayload = {
|
||||
current?: string
|
||||
flow_id: string
|
||||
ideal_output?: string
|
||||
instruction: string
|
||||
language?: string
|
||||
model_config: ModelConfig
|
||||
node_id?: string
|
||||
}
|
||||
|
||||
export type GeneratorResponse = unknown
|
||||
|
||||
export type ErrorMessageResponse = {
|
||||
error: string
|
||||
}
|
||||
|
||||
export type CompletionRequestError = ErrorResponse & {
|
||||
code: 'completion_request_error'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type ModelCurrentlyNotSupportError = ErrorResponse & {
|
||||
code: 'model_currently_not_support'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type ProviderNotInitializeError = ErrorResponse & {
|
||||
code: 'provider_not_initialize'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type ProviderQuotaExceededError = ErrorResponse & {
|
||||
code: 'provider_quota_exceeded'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type ErrorResponse = {
|
||||
code: string
|
||||
details?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
message: string
|
||||
params?: string
|
||||
status: number
|
||||
}
|
||||
|
||||
export type InstructionTemplatePayload = {
|
||||
type: string
|
||||
}
|
||||
|
||||
export type SimpleDataResponse = {
|
||||
data: string
|
||||
}
|
||||
|
||||
export type ModelConfig = {
|
||||
completion_params?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
mode: LlmMode
|
||||
name: string
|
||||
provider: string
|
||||
}
|
||||
|
||||
export type LlmMode = 'chat' | 'completion'
|
||||
|
||||
export type PostInstructionGenerateData = {
|
||||
body: InstructionGeneratePayload
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/instruction-generate'
|
||||
}
|
||||
|
||||
export type PostInstructionGenerateErrors = {
|
||||
400:
|
||||
| ErrorMessageResponse
|
||||
| CompletionRequestError
|
||||
| ModelCurrentlyNotSupportError
|
||||
| ProviderNotInitializeError
|
||||
| ProviderQuotaExceededError
|
||||
| ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type PostInstructionGenerateError =
|
||||
PostInstructionGenerateErrors[keyof PostInstructionGenerateErrors]
|
||||
|
||||
export type PostInstructionGenerateResponses = {
|
||||
200: GeneratorResponse
|
||||
}
|
||||
|
||||
export type PostInstructionGenerateResponse =
|
||||
PostInstructionGenerateResponses[keyof PostInstructionGenerateResponses]
|
||||
|
||||
export type PostInstructionGenerateTemplateData = {
|
||||
body: InstructionTemplatePayload
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/instruction-generate/template'
|
||||
}
|
||||
|
||||
export type PostInstructionGenerateTemplateErrors = {
|
||||
400: ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type PostInstructionGenerateTemplateError =
|
||||
PostInstructionGenerateTemplateErrors[keyof PostInstructionGenerateTemplateErrors]
|
||||
|
||||
export type PostInstructionGenerateTemplateResponses = {
|
||||
200: SimpleDataResponse
|
||||
}
|
||||
|
||||
export type PostInstructionGenerateTemplateResponse =
|
||||
PostInstructionGenerateTemplateResponses[keyof PostInstructionGenerateTemplateResponses]
|
||||
+139
@@ -0,0 +1,139 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import * as z from 'zod'
|
||||
|
||||
/**
|
||||
* GeneratorResponse
|
||||
*/
|
||||
export const zGeneratorResponse = z.unknown()
|
||||
|
||||
/**
|
||||
* ErrorMessageResponse
|
||||
*
|
||||
* Legacy ``{"error": message}`` body a few endpoints return instead of the standard error body.
|
||||
*/
|
||||
export const zErrorMessageResponse = z.object({
|
||||
error: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* ErrorResponse
|
||||
*
|
||||
* Documented non-2xx body emitted by ``register_external_error_handlers``.
|
||||
*
|
||||
* ``params`` and ``details`` appear only on the errors that set them. The schema
|
||||
* stays open because ``HTTPException.data`` may carry extra keys.
|
||||
*/
|
||||
export const zErrorResponse = z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
})
|
||||
|
||||
/**
|
||||
* CompletionRequestError
|
||||
*
|
||||
* Completion request failed.
|
||||
*/
|
||||
export const zCompletionRequestError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('completion_request_error'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* ModelCurrentlyNotSupportError
|
||||
*
|
||||
* Dify Hosted OpenAI trial currently not support the GPT-4 model.
|
||||
*/
|
||||
export const zModelCurrentlyNotSupportError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('model_currently_not_support'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* ProviderNotInitializeError
|
||||
*
|
||||
* No valid model provider credentials found. Please go to Settings -> Model Provider to complete your provider credentials.
|
||||
*/
|
||||
export const zProviderNotInitializeError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('provider_not_initialize'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* ProviderQuotaExceededError
|
||||
*
|
||||
* Your quota for Dify Hosted Model Provider has been exhausted. Please go to Settings -> Model Provider to complete your own provider credentials.
|
||||
*/
|
||||
export const zProviderQuotaExceededError = zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('provider_quota_exceeded'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
)
|
||||
|
||||
/**
|
||||
* InstructionTemplatePayload
|
||||
*/
|
||||
export const zInstructionTemplatePayload = z.object({
|
||||
type: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* SimpleDataResponse
|
||||
*/
|
||||
export const zSimpleDataResponse = z.object({
|
||||
data: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* LLMMode
|
||||
*
|
||||
* Enum class for large language model mode.
|
||||
*/
|
||||
export const zLlmMode = z.enum(['chat', 'completion'])
|
||||
|
||||
/**
|
||||
* ModelConfig
|
||||
*/
|
||||
export const zModelConfig = z.object({
|
||||
completion_params: z.record(z.string(), z.unknown()).optional(),
|
||||
mode: zLlmMode,
|
||||
name: z.string(),
|
||||
provider: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* InstructionGeneratePayload
|
||||
*/
|
||||
export const zInstructionGeneratePayload = z.object({
|
||||
current: z.string().optional().default(''),
|
||||
flow_id: z.string(),
|
||||
ideal_output: z.string().optional().default(''),
|
||||
instruction: z.string(),
|
||||
language: z.string().optional().default('javascript'),
|
||||
model_config: zModelConfig,
|
||||
node_id: z.string().optional().default(''),
|
||||
})
|
||||
|
||||
export const zPostInstructionGenerateBody = zInstructionGeneratePayload
|
||||
|
||||
/**
|
||||
* Instruction generated successfully
|
||||
*/
|
||||
export const zPostInstructionGenerateResponse = zGeneratorResponse
|
||||
|
||||
export const zPostInstructionGenerateTemplateBody = zInstructionTemplatePayload
|
||||
|
||||
/**
|
||||
* Template retrieved successfully
|
||||
*/
|
||||
export const zPostInstructionGenerateTemplateResponse = zSimpleDataResponse
|
||||
+1366
File diff suppressed because it is too large.
Load diff
+4215
File diff suppressed because it is too large.
Load diff
+6335
File diff suppressed because it is too large.
Load diff
+5201
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,95 @@
|
||||
// This file is auto-generated by scripts/add-orpc-error-maps.ts
|
||||
import * as z from 'zod'
|
||||
|
||||
const zErrorResponse = /* @__PURE__ */ (() =>
|
||||
z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
}))()
|
||||
|
||||
const zAccountBannedError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('account_banned'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zAccountInFreezeError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('account_in_freeze'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zAccountNotFoundError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('account_not_found'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zEmailDomainSuspendedError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_domain_suspended'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zInvalidAccountPasswordError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invalid_account_password'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zInvalidEmailError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invalid_email'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zLimitExceededError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('limit_exceeded'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zAuthenticationFailedError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('authentication_failed'),
|
||||
status: z.literal(401),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zEmailCodeLoginLimitError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('email_code_login_limit'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
))()
|
||||
|
||||
export const postErrors = {
|
||||
account_banned: { status: 400, data: zAccountBannedError },
|
||||
account_in_freeze: { status: 400, data: zAccountInFreezeError },
|
||||
account_not_found: { status: 400, data: zAccountNotFoundError },
|
||||
authentication_failed: { status: 401, data: zAuthenticationFailedError },
|
||||
email_code_login_limit: { status: 429, data: zEmailCodeLoginLimitError },
|
||||
email_domain_suspended: { status: 400, data: zEmailDomainSuspendedError },
|
||||
invalid_account_password: { status: 400, data: zInvalidAccountPasswordError },
|
||||
invalid_email: { status: 400, data: zInvalidEmailError },
|
||||
limit_exceeded: { status: 400, data: zLimitExceededError },
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { oc } from '@orpc/contract'
|
||||
import * as z from 'zod'
|
||||
import {
|
||||
zAccountBannedError,
|
||||
zAccountInFreezeError,
|
||||
zAccountNotFoundError,
|
||||
zAuthenticationFailedError,
|
||||
zEmailCodeLoginLimitError,
|
||||
zEmailDomainSuspendedError,
|
||||
zInvalidAccountPasswordError,
|
||||
zInvalidEmailError,
|
||||
zLimitExceededError,
|
||||
} from './zod.gen.ts'
|
||||
import { zPostLoginBody, zPostLoginResponse } from './zod.gen.ts'
|
||||
|
||||
/**
|
||||
* Authenticate user and login
|
||||
*/
|
||||
export const post = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postLogin',
|
||||
path: '/login',
|
||||
summary: 'Authenticate user and login',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ body: zPostLoginBody }))
|
||||
.output(zPostLoginResponse)
|
||||
.errors({
|
||||
account_banned: { status: 400, data: zAccountBannedError },
|
||||
account_in_freeze: { status: 400, data: zAccountInFreezeError },
|
||||
account_not_found: { status: 400, data: zAccountNotFoundError },
|
||||
authentication_failed: { status: 401, data: zAuthenticationFailedError },
|
||||
email_code_login_limit: { status: 429, data: zEmailCodeLoginLimitError },
|
||||
email_domain_suspended: { status: 400, data: zEmailDomainSuspendedError },
|
||||
invalid_account_password: { status: 400, data: zInvalidAccountPasswordError },
|
||||
invalid_email: { status: 400, data: zInvalidEmailError },
|
||||
limit_exceeded: { status: 400, data: zLimitExceededError },
|
||||
})
|
||||
|
||||
export const login = {
|
||||
post,
|
||||
}
|
||||
|
||||
export const contract = {
|
||||
login,
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type ClientOptions = {
|
||||
baseUrl: `${string}://${string}/console/api` | (string & {})
|
||||
}
|
||||
|
||||
export type LoginPayload = {
|
||||
email: string
|
||||
invite_token?: string | null
|
||||
password: string
|
||||
remember_me?: boolean
|
||||
}
|
||||
|
||||
export type SimpleResultOptionalDataResponse = {
|
||||
data?: string | null
|
||||
result: string
|
||||
}
|
||||
|
||||
export type AccountBannedError = ErrorResponse & {
|
||||
code: 'account_banned'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type AccountInFreezeError = ErrorResponse & {
|
||||
code: 'account_in_freeze'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type AccountNotFoundError = ErrorResponse & {
|
||||
code: 'account_not_found'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type EmailDomainSuspendedError = ErrorResponse & {
|
||||
code: 'email_domain_suspended'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type InvalidAccountPasswordError = ErrorResponse & {
|
||||
code: 'invalid_account_password'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type InvalidEmailError = ErrorResponse & {
|
||||
code: 'invalid_email'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type LimitExceededError = ErrorResponse & {
|
||||
code: 'limit_exceeded'
|
||||
status: 400
|
||||
}
|
||||
|
||||
export type ErrorResponse = {
|
||||
code: string
|
||||
details?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
message: string
|
||||
params?: string
|
||||
status: number
|
||||
}
|
||||
|
||||
export type AuthenticationFailedError = ErrorResponse & {
|
||||
code: 'authentication_failed'
|
||||
status: 401
|
||||
}
|
||||
|
||||
export type EmailCodeLoginLimitError = ErrorResponse & {
|
||||
code: 'email_code_login_limit'
|
||||
status: 429
|
||||
}
|
||||
|
||||
export type PostLoginData = {
|
||||
body: LoginPayload
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/login'
|
||||
}
|
||||
|
||||
export type PostLoginErrors = {
|
||||
400:
|
||||
| AccountBannedError
|
||||
| AccountInFreezeError
|
||||
| AccountNotFoundError
|
||||
| EmailDomainSuspendedError
|
||||
| InvalidAccountPasswordError
|
||||
| InvalidEmailError
|
||||
| LimitExceededError
|
||||
| ErrorResponse
|
||||
401: AuthenticationFailedError | ErrorResponse
|
||||
429: EmailCodeLoginLimitError | ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type PostLoginError = PostLoginErrors[keyof PostLoginErrors]
|
||||
|
||||
export type PostLoginResponses = {
|
||||
200: SimpleResultOptionalDataResponse
|
||||
}
|
||||
|
||||
export type PostLoginResponse = PostLoginResponses[keyof PostLoginResponses]
|
||||
Loaded 100 of 15831 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user