kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
pull/715/head
rodzic
364f6a022b
commit
cc78a67719
|
@ -13,7 +13,7 @@ import {
|
|||
import { consumerTokenParamsSchema, populateConsumerSchema } from './schemas'
|
||||
|
||||
const route = createRoute({
|
||||
description: 'Gets a consumer by API token',
|
||||
description: 'Gets a consumer by API token (admin-only)',
|
||||
tags: ['admin', 'consumers'],
|
||||
operationId: 'adminGetConsumerByToken',
|
||||
method: 'get',
|
||||
|
@ -25,7 +25,7 @@ const route = createRoute({
|
|||
},
|
||||
responses: {
|
||||
200: {
|
||||
description: 'A consumer object',
|
||||
description: 'An admin consumer object',
|
||||
content: {
|
||||
'application/json': {
|
||||
schema: schema.consumerSelectSchema
|
||||
|
|
|
@ -15,7 +15,7 @@ import { deploymentIdentifierAndPopulateSchema } from './schemas'
|
|||
|
||||
const route = createRoute({
|
||||
description: 'Gets a deployment by its public identifier (admin-only)',
|
||||
tags: ['deployments'],
|
||||
tags: ['admin', 'deployments'],
|
||||
operationId: 'adminGetDeploymentByIdentifier',
|
||||
method: 'get',
|
||||
path: 'admin/deployments/by-identifier',
|
||||
|
@ -52,6 +52,20 @@ export function registerV1AdminDeploymentsGetDeploymentByIdentifier(
|
|||
assert(deployment, 404, `Deployment not found "${deploymentIdentifier}"`)
|
||||
await acl(c, deployment, { label: 'Deployment' })
|
||||
|
||||
// TODO
|
||||
// TODO: switch from published to publishedAt?
|
||||
// if (deployment.published) {
|
||||
// c.res.headers.set(
|
||||
// 'cache-control',
|
||||
// 'public, max-age=1, s-maxage=1 stale-while-revalidate=1'
|
||||
// )
|
||||
// } else {
|
||||
// c.res.headers.set(
|
||||
// 'cache-control',
|
||||
// 'public, max-age=120, s-maxage=120, stale-while-revalidate=10'
|
||||
// )
|
||||
// }
|
||||
|
||||
return c.json(
|
||||
parseZodSchema(schema.deploymentAdminSelectSchema, deployment)
|
||||
)
|
|
@ -11,7 +11,7 @@ import { registerV1ConsumersGetConsumer } from './consumers/get-consumer'
|
|||
import { registerV1ProjectsListConsumers } from './consumers/list-consumers'
|
||||
import { registerV1ConsumersRefreshConsumerToken } from './consumers/refresh-consumer-token'
|
||||
import { registerV1ConsumersUpdateConsumer } from './consumers/update-consumer'
|
||||
import { registerV1AdminDeploymentsGetDeploymentByIdentifier } from './deployments/admin-get-deployment-by-identifier copy'
|
||||
import { registerV1AdminDeploymentsGetDeploymentByIdentifier } from './deployments/admin-get-deployment-by-identifier'
|
||||
import { registerV1DeploymentsCreateDeployment } from './deployments/create-deployment'
|
||||
import { registerV1DeploymentsGetDeployment } from './deployments/get-deployment'
|
||||
import { registerV1DeploymentsGetDeploymentByIdentifier } from './deployments/get-deployment-by-identifier'
|
||||
|
|
Ładowanie…
Reference in New Issue