kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
pull/715/head
rodzic
1532fa6345
commit
3e3f23db35
|
@ -111,8 +111,6 @@ export function registerV1DeploymentsCreateDeployment(
|
|||
// - origin API base URL
|
||||
// - origin adapter OpenAPI or MCP specs
|
||||
// - tool definitions
|
||||
|
||||
// TODO: fix types
|
||||
const agenticProjectConfig = await resolveAgenticProjectConfig(body, {
|
||||
label: `deployment "${deploymentIdentifier}"`,
|
||||
logger
|
||||
|
|
|
@ -216,7 +216,7 @@ export async function upsertStripePricing({
|
|||
`Invalid pricing plan metric "${pricingPlanLineItemSlug}" for pricing plan "${pricingPlanSlug}": unitAmount is required for per_unit billing schemes.`
|
||||
)
|
||||
assert(
|
||||
!pricingPlanLineItem.tiers,
|
||||
!(pricingPlanLineItem as any).tiers,
|
||||
400,
|
||||
`Invalid pricing plan metric "${pricingPlanLineItemSlug}" for pricing plan "${pricingPlanSlug}": per_unit billing schemes cannot have tiers.`
|
||||
)
|
||||
|
|
|
@ -3,5 +3,5 @@ import Stripe from 'stripe'
|
|||
import { env } from '@/lib/env'
|
||||
|
||||
export const stripe = new Stripe(env.STRIPE_SECRET_KEY, {
|
||||
apiVersion: '2025-04-30.basil'
|
||||
apiVersion: '2025-05-28.basil'
|
||||
})
|
||||
|
|
|
@ -7,6 +7,11 @@ import {
|
|||
resolvedAgenticProjectConfigSchema
|
||||
} from '@agentic/platform-types'
|
||||
|
||||
// NOTE: The extra typing and cast here are necessary because we're
|
||||
// overriding the default zod types for some fields (e.g. `pricingPlans`) in
|
||||
// order to get stricter TypeScript types than what zod v3 allows (nested
|
||||
// discrimianted unions). This should be removed once we upgrade to zod v4.
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
|
@ -14,10 +19,6 @@ export function parseAgenticProjectConfig(
|
|||
inputConfig: unknown,
|
||||
{ strip = false, strict = false }: { strip?: boolean; strict?: boolean } = {}
|
||||
): AgenticProjectConfig {
|
||||
// NOTE: The extra typing and cast here are necessary because we're
|
||||
// overriding the default zod types for some fields (e.g. `pricingPlans`) in
|
||||
// order to get stricter TypeScript types than what zod v3 allows (nested
|
||||
// discrimianted unions). This should be removed once we upgrade to zod v4.
|
||||
return parseZodSchema<
|
||||
z.infer<typeof agenticProjectConfigSchema>,
|
||||
ZodTypeDef,
|
||||
|
@ -39,10 +40,6 @@ export function parseResolvedAgenticProjectConfig(
|
|||
inputConfig: unknown,
|
||||
{ strip = false, strict = false }: { strip?: boolean; strict?: boolean } = {}
|
||||
): ResolvedAgenticProjectConfig {
|
||||
// NOTE: The extra typing and cast here are necessary because we're
|
||||
// overriding the default zod types for some fields (e.g. `pricingPlans`) in
|
||||
// order to get stricter TypeScript types than what zod v3 allows (nested
|
||||
// discrimianted unions). This should be removed once we upgrade to zod v4.
|
||||
return parseZodSchema<
|
||||
z.infer<typeof resolvedAgenticProjectConfigSchema>,
|
||||
ZodTypeDef,
|
||||
|
|
|
@ -162,11 +162,13 @@ export type AgenticProjectConfigInput = Simplify<
|
|||
pricingPlans?: PricingPlanList
|
||||
}
|
||||
>
|
||||
export type AgenticProjectConfig = Simplify<
|
||||
Omit<z.output<typeof agenticProjectConfigSchema>, 'pricingPlans'> & {
|
||||
pricingPlans: PricingPlanList
|
||||
}
|
||||
>
|
||||
export type AgenticProjectConfig =
|
||||
| Simplify<
|
||||
Omit<z.output<typeof agenticProjectConfigSchema>, 'pricingPlans'> & {
|
||||
pricingPlans: PricingPlanList
|
||||
}
|
||||
>
|
||||
| z.output<typeof agenticProjectConfigSchema>
|
||||
|
||||
export const resolvedAgenticProjectConfigSchema =
|
||||
agenticProjectConfigSchema.extend({
|
||||
|
|
|
@ -404,8 +404,10 @@ export const pricingPlanLineItemSchema = z
|
|||
.openapi('PricingPlanLineItem')
|
||||
// export type PricingPlanLineItem = z.infer<typeof pricingPlanLineItemSchema>
|
||||
|
||||
// This is a more complex discriminated union based on:
|
||||
// `slug`, `usageType`, and `billingScheme`
|
||||
// This is a more complex discriminated union based on: `slug`, `usageType`,
|
||||
// and `billingScheme`.
|
||||
// TODO: clean up this type
|
||||
// TODO: add `Input` version to support `string` rateLimit.interval
|
||||
export type PricingPlanLineItem =
|
||||
| BasePricingPlanLineItem
|
||||
| RequestsPricingPlanLineItem
|
||||
|
|
Ładowanie…
Reference in New Issue