@coursebuilder/core
Version:
Core package for Course Builder
162 lines (159 loc) • 5.92 kB
text/typescript
import { I as InternalOptions } from '../../adapters-DK4L3hbS.cjs';
import '@auth/core/adapters';
import '../../schemas/coupon-schema.cjs';
import 'zod';
import '../../schemas/merchant-coupon-schema.cjs';
import '../../schemas/merchant-customer-schema.cjs';
import '../../schemas/merchant-product-schema.cjs';
import '../../schemas/price-schema.cjs';
import '../../schemas/product-schema.cjs';
import '../../schemas/purchase-schema.cjs';
import '../../schemas/purchase-user-transfer-schema.cjs';
import '../../schemas/resource-progress-schema.cjs';
import '../../schemas/user-schema.cjs';
import '../../schemas/video-resource.cjs';
import '../../schemas/upgradable-product-schema.cjs';
import '../../schemas/merchant-charge-schema.cjs';
import '../../schemas/merchant-price-schema.cjs';
import '../../schemas/content-resource-schema.cjs';
import '../../schemas/merchant-account-schema.cjs';
import '../../schemas/merchant-session.cjs';
import '../../schemas/merchant-subscription.cjs';
import '../../schemas/organization-member.cjs';
import '../../schemas/organization-schema.cjs';
import '../../schemas/subscription.cjs';
import '@auth/core';
import '@auth/core/providers/nodemailer';
import 'ai';
import 'cookie';
import 'inngest';
import 'stripe';
import '../utils/logger.cjs';
import '@auth/core/providers';
import '../../schemas/subscriber-schema.cjs';
import '../../providers/partykit.cjs';
import '../../providers/slack.cjs';
import '../../schemas/purchase-info.cjs';
import '../../schemas/subscription-info.cjs';
declare function updatePurchaseStatus({ status, stripeChargeId, options, }: {
options: InternalOptions<'payment'>;
stripeChargeId: string;
status: 'Refunded' | 'Disputed' | 'Banned';
}): Promise<{
id: string;
createdAt: Date;
fields: Record<string, any>;
status: string;
productId: string;
totalAmount: number;
organizationId?: string | null | undefined;
userId?: string | null | undefined;
product?: {
type: "live" | "self-paced" | "membership" | "cohort";
name: string;
id: string;
createdAt: Date | null;
fields: {
slug: string;
action: string | null;
state: "draft" | "published" | "archived" | "deleted";
visibility: "public" | "private" | "unlisted";
body?: string | null | undefined;
description?: string | null | undefined;
image?: {
url: string;
alt?: string | null | undefined;
width?: number | null | undefined;
height?: number | null | undefined;
} | null | undefined;
};
status: number;
resources: {
createdAt: Date | null;
productId: string;
resourceId: string;
position: number;
metadata: Record<string, any> | null;
updatedAt: Date | null;
deletedAt: Date | null;
resource?: any;
product?: any;
}[] | null;
quantityAvailable: number;
organizationId?: string | null | undefined;
key?: string | null | undefined;
price?: {
id: string;
createdAt: Date | null;
fields: Record<string, any>;
status: number;
unitAmount: number;
organizationId?: string | null | undefined;
productId?: string | null | undefined;
nickname?: string | null | undefined;
} | null | undefined;
} | null | undefined;
state?: string | null | undefined;
user?: {
id: string;
role: "user" | "admin";
email: string;
memberships: {
id: string;
organizationId: string;
}[] | null;
roles: {
name: string;
id: string;
description: string | null;
active: boolean;
createdAt?: Date | null | undefined;
updatedAt?: Date | null | undefined;
deletedAt?: Date | null | undefined;
}[];
organizationRoles: {
name: string;
id: string;
organizationId: string;
description: string | null;
active: boolean;
createdAt?: Date | null | undefined;
updatedAt?: Date | null | undefined;
deletedAt?: Date | null | undefined;
}[];
name?: string | null | undefined;
createdAt?: Date | null | undefined;
image?: string | null | undefined;
emailVerified?: Date | null | undefined;
} | null | undefined;
ipAddress?: string | null | undefined;
city?: string | null | undefined;
country?: string | null | undefined;
couponId?: string | null | undefined;
merchantChargeId?: string | null | undefined;
upgradedFromId?: string | null | undefined;
bulkCouponId?: string | null | undefined;
merchantSessionId?: string | null | undefined;
redeemedBulkCouponId?: string | null | undefined;
bulkCoupon?: {
id: string;
createdAt: Date | null;
expires: Date | null;
fields: Record<string, any>;
maxUses: number;
default: boolean;
status: number;
usedCount: number;
percentageDiscount: number;
bulkPurchases: any[];
redeemedBulkCouponPurchases: any[];
code?: string | null | undefined;
merchantCouponId?: string | null | undefined;
restrictedToProductId?: string | null | undefined;
bulkPurchaseId?: string | null | undefined;
organizationId?: string | null | undefined;
} | null | undefined;
purchasedByorganizationMembershipId?: string | null | undefined;
} | undefined>;
declare function processStripeWebhook(event: any, options: InternalOptions<'payment'>): Promise<void>;
export { processStripeWebhook, updatePurchaseStatus };