@coursebuilder/core
Version:
Core package for Course Builder
68 lines (65 loc) • 2.78 kB
TypeScript
import * as z from 'zod';
import { c as CourseBuilderAdapter } from '../../adapters-BjQ3VSch.js';
import { PurchaseType } from '../../schemas/purchase-type.js';
import Stripe from 'stripe';
import '@auth/core/adapters';
import '../../schemas/coupon-schema.js';
import '../../schemas/merchant-coupon-schema.js';
import '../../schemas/merchant-customer-schema.js';
import '../../schemas/merchant-product-schema.js';
import '../../schemas/price-schema.js';
import '../../schemas/product-schema.js';
import '../../schemas/purchase-schema.js';
import '../../schemas/purchase-user-transfer-schema.js';
import '../../schemas/resource-progress-schema.js';
import '../../schemas/user-schema.js';
import '../../schemas/video-resource.js';
import '../../schemas/upgradable-product-schema.js';
import '../../schemas/merchant-charge-schema.js';
import '../../schemas/merchant-price-schema.js';
import '../../schemas/content-resource-schema.js';
import '../../schemas/merchant-account-schema.js';
import '../../schemas/merchant-session.js';
import '../../schemas/merchant-subscription.js';
import '../../schemas/organization-member.js';
import '../../schemas/organization-schema.js';
import '../../schemas/subscription.js';
import '@auth/core';
import '@auth/core/providers/nodemailer';
import 'ai';
import 'cookie';
import 'inngest';
import '../utils/logger.js';
import '@auth/core/providers';
import '../../schemas/subscriber-schema.js';
import '../../providers/partykit.js';
import '../../providers/slack.js';
import '../../schemas/purchase-info.js';
import '../../schemas/subscription-info.js';
declare function parsePurchaseInfoFromCheckoutSession(checkoutSession: Stripe.Checkout.Session, courseBuilderAdapter: CourseBuilderAdapter): Promise<{
product: {
name: string | null;
};
email: string | null;
quantity: number;
customerIdentifier: string;
productIdentifier: string;
chargeIdentifier: string;
chargeAmount: number;
purchaseType: "EXISTING_BULK_COUPON" | "NEW_BULK_COUPON" | "NEW_INDIVIDUAL_PURCHASE" | "INDIVIDUAL_TO_BULK_UPGRADE";
name?: string | null | undefined;
metadata?: z.objectOutputType<{
country: z.ZodOptional<z.ZodString>;
appliedPPPStripeCouponId: z.ZodOptional<z.ZodString>;
upgradedFromPurchaseId: z.ZodOptional<z.ZodString>;
usedCouponId: z.ZodOptional<z.ZodString>;
}, z.ZodTypeAny, "passthrough"> | undefined;
couponIdentifier?: string | undefined;
}>;
type DeterminePurchaseTypeOptions = {
chargeIdentifier: string;
email: string | null;
courseBuilderAdapter: CourseBuilderAdapter;
};
declare function determinePurchaseType(options: DeterminePurchaseTypeOptions): Promise<PurchaseType>;
export { determinePurchaseType, parsePurchaseInfoFromCheckoutSession };