更新条带 18.2.1 → 22.6.1
import { z } from 'zod';
import { billing } from '@nangohq/billing'; import { plansList } from '@nangohq/shared'; import { getLogger, report, requireEmptyQuery, zodErrorToHTTP } from '@nangohq/utils';
import { disableGrowthAddon, downgradePlan, enableGrowthAddon, getPlanChangeContext, resolvePlanChange, trackPlanChange, upgradePlan } from '../../../../services/planChange.service.js'; import { asyncWrapper } from '../../../../utils/asyncWrapper.js';
import type { PlanChangeContext, PlanChangeError, PlanChanges } from '../../../../services/planChange.service.js'; import type { RequestLocals } from '../../../../utils/express.js'; import type { BillingSubscription, PostPlanChange } from '@nangohq/types'; import type { Response } from 'express'; import type Stripe from 'stripe';
const logger = getLogger('Server.PostChange');
type PlanChangeResponse = Response<PostPlanChange['Reply'], RequestLocals>;
function logContext(context: PlanChangeContext, subscription: BillingSubscription, changes: PlanChanges) { return { accountId: context.team.id, currentPlan: context.currentPlan.name, requestedPlan: context.requested.newPlanCode, …
内容来源: NangoHQ/nango