diff --git a/apps/api/src/api-v1/deployments/create-deployment.ts b/apps/api/src/api-v1/deployments/create-deployment.ts index b6e97fa2..6bb1e2fb 100644 --- a/apps/api/src/api-v1/deployments/create-deployment.ts +++ b/apps/api/src/api-v1/deployments/create-deployment.ts @@ -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 diff --git a/apps/api/src/lib/billing/upsert-stripe-pricing.ts b/apps/api/src/lib/billing/upsert-stripe-pricing.ts index 5d9b429e..13b73420 100644 --- a/apps/api/src/lib/billing/upsert-stripe-pricing.ts +++ b/apps/api/src/lib/billing/upsert-stripe-pricing.ts @@ -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.` ) diff --git a/apps/api/src/lib/external/stripe.ts b/apps/api/src/lib/external/stripe.ts index 9e0687c3..6a91535e 100644 --- a/apps/api/src/lib/external/stripe.ts +++ b/apps/api/src/lib/external/stripe.ts @@ -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' }) diff --git a/packages/platform/src/parse-agentic-project-config.ts b/packages/platform/src/parse-agentic-project-config.ts index 32d051eb..7d37dce8 100644 --- a/packages/platform/src/parse-agentic-project-config.ts +++ b/packages/platform/src/parse-agentic-project-config.ts @@ -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, 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, ZodTypeDef, diff --git a/packages/types/src/agentic-project-config.ts b/packages/types/src/agentic-project-config.ts index d8451661..59f13c1d 100644 --- a/packages/types/src/agentic-project-config.ts +++ b/packages/types/src/agentic-project-config.ts @@ -162,11 +162,13 @@ export type AgenticProjectConfigInput = Simplify< pricingPlans?: PricingPlanList } > -export type AgenticProjectConfig = Simplify< - Omit, 'pricingPlans'> & { - pricingPlans: PricingPlanList - } -> +export type AgenticProjectConfig = + | Simplify< + Omit, 'pricingPlans'> & { + pricingPlans: PricingPlanList + } + > + | z.output export const resolvedAgenticProjectConfigSchema = agenticProjectConfigSchema.extend({ diff --git a/packages/types/src/pricing.ts b/packages/types/src/pricing.ts index f0a97872..74d16b9e 100644 --- a/packages/types/src/pricing.ts +++ b/packages/types/src/pricing.ts @@ -404,8 +404,10 @@ export const pricingPlanLineItemSchema = z .openapi('PricingPlanLineItem') // export type PricingPlanLineItem = z.infer -// 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