UNPKG

@coursebuilder/core

Version:

Core package for Course Builder

64 lines (63 loc) 3.02 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/inngest/stripe/event-customer-subscription-updated.ts var event_customer_subscription_updated_exports = {}; __export(event_customer_subscription_updated_exports, { STRIPE_CUSTOMER_SUBSCRIPTION_UPDATED_EVENT: () => STRIPE_CUSTOMER_SUBSCRIPTION_UPDATED_EVENT, stripeCustomerSubscriptionUpdated: () => stripeCustomerSubscriptionUpdated, stripeCustomerSubscriptionUpdatedConfig: () => stripeCustomerSubscriptionUpdatedConfig, stripeCustomerSubscriptionUpdatedHandler: () => stripeCustomerSubscriptionUpdatedHandler, stripeCustomerSubscriptionUpdatedTrigger: () => stripeCustomerSubscriptionUpdatedTrigger }); module.exports = __toCommonJS(event_customer_subscription_updated_exports); var STRIPE_CUSTOMER_SUBSCRIPTION_UPDATED_EVENT = "stripe/customer-subscription-updated"; var stripeCustomerSubscriptionUpdatedConfig = { id: "stripe-customer-subscription-updated", name: "Stripe Customer Subscription Updated" }; var stripeCustomerSubscriptionUpdatedTrigger = { event: STRIPE_CUSTOMER_SUBSCRIPTION_UPDATED_EVENT }; var stripeCustomerSubscriptionUpdatedHandler = /* @__PURE__ */ __name(async ({ event, step, db }) => { const subscription = event.data.stripeEvent.data.object; const previousAttributes = event.data.stripeEvent.data.previous_attributes; if (previousAttributes?.status) { await step.run("handle subscription status change", async () => { }); } if (previousAttributes?.items) { await step.run("handle subscription plan change", async () => { }); } }, "stripeCustomerSubscriptionUpdatedHandler"); var stripeCustomerSubscriptionUpdated = { config: stripeCustomerSubscriptionUpdatedConfig, trigger: stripeCustomerSubscriptionUpdatedTrigger, handler: stripeCustomerSubscriptionUpdatedHandler }; // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { STRIPE_CUSTOMER_SUBSCRIPTION_UPDATED_EVENT, stripeCustomerSubscriptionUpdated, stripeCustomerSubscriptionUpdatedConfig, stripeCustomerSubscriptionUpdatedHandler, stripeCustomerSubscriptionUpdatedTrigger }); //# sourceMappingURL=event-customer-subscription-updated.cjs.map