pricing4ts
Version:
 Pricing4TS is a TypeScript-based toolkit designed to enhance the server-side functionality of a pricing-driven SaaS by enabling the seamless integration of pricing plans into the application logic. T
22 lines (21 loc) • 836 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PricingContextManager = void 0;
var pricing_jwt_utils_1 = require("../utils/pricing-jwt-utils");
var PricingContextManager = /** @class */ (function () {
function PricingContextManager() {
}
PricingContextManager.registerContext = function (context) {
this.context = context;
pricing_jwt_utils_1.PricingJwtUtils.setContext(context);
};
PricingContextManager.getContext = function () {
if (!this.context) {
throw new Error("PricingContext is not registered. Call 'PricingContextManager.registerContext' first.");
}
return this.context;
};
PricingContextManager.context = null;
return PricingContextManager;
}());
exports.PricingContextManager = PricingContextManager;