dify/packages/contracts/generated/api/console/activate/orpc.gen.ts
zyssyz123 2b8e40af32
fix(auth): validate account before accepting invitations (#39438)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-07-23 03:56:32 +00:00

61 lines
1.7 KiB
TypeScript

// This file is auto-generated by @hey-api/openapi-ts
import { oc } from '@orpc/contract'
import * as z from 'zod'
import {
zGetActivateCheckQuery,
zGetActivateCheckResponse,
zPostActivateBody,
zPostActivateResponse,
} from './zod.gen'
/**
* 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)
export const activate = {
post,
check,
}
export const contract = {
activate,
}