- HERENCIA-SIMCO.md actualizado con directivas v3.7 y v3.8 - Actualizaciones de configuracion Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
177 lines
8.7 KiB
JavaScript
177 lines
8.7 KiB
JavaScript
"use strict";
|
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
};
|
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.StripeWebhookResponseDto = exports.CreateBillingPortalSessionDto = exports.CreateCheckoutSessionDto = exports.CreateStripeSubscriptionDto = exports.CreateStripeCustomerDto = exports.StripeWebhookDto = exports.StripeWebhookEventType = void 0;
|
|
const class_validator_1 = require("class-validator");
|
|
const swagger_1 = require("@nestjs/swagger");
|
|
var StripeWebhookEventType;
|
|
(function (StripeWebhookEventType) {
|
|
StripeWebhookEventType["CUSTOMER_CREATED"] = "customer.created";
|
|
StripeWebhookEventType["CUSTOMER_UPDATED"] = "customer.updated";
|
|
StripeWebhookEventType["CUSTOMER_DELETED"] = "customer.deleted";
|
|
StripeWebhookEventType["SUBSCRIPTION_CREATED"] = "customer.subscription.created";
|
|
StripeWebhookEventType["SUBSCRIPTION_UPDATED"] = "customer.subscription.updated";
|
|
StripeWebhookEventType["SUBSCRIPTION_DELETED"] = "customer.subscription.deleted";
|
|
StripeWebhookEventType["SUBSCRIPTION_TRIAL_WILL_END"] = "customer.subscription.trial_will_end";
|
|
StripeWebhookEventType["INVOICE_CREATED"] = "invoice.created";
|
|
StripeWebhookEventType["INVOICE_PAID"] = "invoice.paid";
|
|
StripeWebhookEventType["INVOICE_PAYMENT_FAILED"] = "invoice.payment_failed";
|
|
StripeWebhookEventType["INVOICE_FINALIZED"] = "invoice.finalized";
|
|
StripeWebhookEventType["INVOICE_VOIDED"] = "invoice.voided";
|
|
StripeWebhookEventType["PAYMENT_INTENT_SUCCEEDED"] = "payment_intent.succeeded";
|
|
StripeWebhookEventType["PAYMENT_INTENT_FAILED"] = "payment_intent.payment_failed";
|
|
StripeWebhookEventType["PAYMENT_METHOD_ATTACHED"] = "payment_method.attached";
|
|
StripeWebhookEventType["PAYMENT_METHOD_DETACHED"] = "payment_method.detached";
|
|
StripeWebhookEventType["CHECKOUT_SESSION_COMPLETED"] = "checkout.session.completed";
|
|
StripeWebhookEventType["CHECKOUT_SESSION_EXPIRED"] = "checkout.session.expired";
|
|
})(StripeWebhookEventType || (exports.StripeWebhookEventType = StripeWebhookEventType = {}));
|
|
class StripeWebhookDto {
|
|
}
|
|
exports.StripeWebhookDto = StripeWebhookDto;
|
|
__decorate([
|
|
(0, swagger_1.ApiProperty)({ description: 'Webhook event ID from Stripe' }),
|
|
(0, class_validator_1.IsString)(),
|
|
__metadata("design:type", String)
|
|
], StripeWebhookDto.prototype, "id", void 0);
|
|
__decorate([
|
|
(0, swagger_1.ApiProperty)({ description: 'Event type', enum: StripeWebhookEventType }),
|
|
(0, class_validator_1.IsString)(),
|
|
__metadata("design:type", String)
|
|
], StripeWebhookDto.prototype, "type", void 0);
|
|
__decorate([
|
|
(0, swagger_1.ApiProperty)({ description: 'Event data object' }),
|
|
(0, class_validator_1.IsObject)(),
|
|
__metadata("design:type", Object)
|
|
], StripeWebhookDto.prototype, "data", void 0);
|
|
__decorate([
|
|
(0, swagger_1.ApiProperty)({ description: 'API version used' }),
|
|
(0, class_validator_1.IsString)(),
|
|
__metadata("design:type", String)
|
|
], StripeWebhookDto.prototype, "api_version", void 0);
|
|
__decorate([
|
|
(0, swagger_1.ApiProperty)({ description: 'Unix timestamp of event creation' }),
|
|
(0, class_validator_1.IsNumber)(),
|
|
__metadata("design:type", Number)
|
|
], StripeWebhookDto.prototype, "created", void 0);
|
|
__decorate([
|
|
(0, swagger_1.ApiPropertyOptional)({ description: 'Whether this is a live mode event' }),
|
|
(0, class_validator_1.IsOptional)(),
|
|
(0, class_validator_1.IsBoolean)(),
|
|
__metadata("design:type", Boolean)
|
|
], StripeWebhookDto.prototype, "livemode", void 0);
|
|
class CreateStripeCustomerDto {
|
|
}
|
|
exports.CreateStripeCustomerDto = CreateStripeCustomerDto;
|
|
__decorate([
|
|
(0, swagger_1.ApiProperty)({ description: 'Tenant ID to link customer' }),
|
|
(0, class_validator_1.IsString)(),
|
|
__metadata("design:type", String)
|
|
], CreateStripeCustomerDto.prototype, "tenant_id", void 0);
|
|
__decorate([
|
|
(0, swagger_1.ApiProperty)({ description: 'Customer email' }),
|
|
(0, class_validator_1.IsString)(),
|
|
__metadata("design:type", String)
|
|
], CreateStripeCustomerDto.prototype, "email", void 0);
|
|
__decorate([
|
|
(0, swagger_1.ApiPropertyOptional)({ description: 'Customer name' }),
|
|
(0, class_validator_1.IsOptional)(),
|
|
(0, class_validator_1.IsString)(),
|
|
__metadata("design:type", String)
|
|
], CreateStripeCustomerDto.prototype, "name", void 0);
|
|
__decorate([
|
|
(0, swagger_1.ApiPropertyOptional)({ description: 'Additional metadata' }),
|
|
(0, class_validator_1.IsOptional)(),
|
|
(0, class_validator_1.IsObject)(),
|
|
__metadata("design:type", Object)
|
|
], CreateStripeCustomerDto.prototype, "metadata", void 0);
|
|
class CreateStripeSubscriptionDto {
|
|
}
|
|
exports.CreateStripeSubscriptionDto = CreateStripeSubscriptionDto;
|
|
__decorate([
|
|
(0, swagger_1.ApiProperty)({ description: 'Stripe customer ID' }),
|
|
(0, class_validator_1.IsString)(),
|
|
__metadata("design:type", String)
|
|
], CreateStripeSubscriptionDto.prototype, "customer_id", void 0);
|
|
__decorate([
|
|
(0, swagger_1.ApiProperty)({ description: 'Stripe price ID' }),
|
|
(0, class_validator_1.IsString)(),
|
|
__metadata("design:type", String)
|
|
], CreateStripeSubscriptionDto.prototype, "price_id", void 0);
|
|
__decorate([
|
|
(0, swagger_1.ApiPropertyOptional)({ description: 'Trial period in days' }),
|
|
(0, class_validator_1.IsOptional)(),
|
|
(0, class_validator_1.IsNumber)(),
|
|
__metadata("design:type", Number)
|
|
], CreateStripeSubscriptionDto.prototype, "trial_period_days", void 0);
|
|
__decorate([
|
|
(0, swagger_1.ApiPropertyOptional)({ description: 'Additional metadata' }),
|
|
(0, class_validator_1.IsOptional)(),
|
|
(0, class_validator_1.IsObject)(),
|
|
__metadata("design:type", Object)
|
|
], CreateStripeSubscriptionDto.prototype, "metadata", void 0);
|
|
class CreateCheckoutSessionDto {
|
|
}
|
|
exports.CreateCheckoutSessionDto = CreateCheckoutSessionDto;
|
|
__decorate([
|
|
(0, swagger_1.ApiProperty)({ description: 'Tenant ID' }),
|
|
(0, class_validator_1.IsString)(),
|
|
__metadata("design:type", String)
|
|
], CreateCheckoutSessionDto.prototype, "tenant_id", void 0);
|
|
__decorate([
|
|
(0, swagger_1.ApiProperty)({ description: 'Stripe price ID' }),
|
|
(0, class_validator_1.IsString)(),
|
|
__metadata("design:type", String)
|
|
], CreateCheckoutSessionDto.prototype, "price_id", void 0);
|
|
__decorate([
|
|
(0, swagger_1.ApiProperty)({ description: 'Success redirect URL' }),
|
|
(0, class_validator_1.IsString)(),
|
|
__metadata("design:type", String)
|
|
], CreateCheckoutSessionDto.prototype, "success_url", void 0);
|
|
__decorate([
|
|
(0, swagger_1.ApiProperty)({ description: 'Cancel redirect URL' }),
|
|
(0, class_validator_1.IsString)(),
|
|
__metadata("design:type", String)
|
|
], CreateCheckoutSessionDto.prototype, "cancel_url", void 0);
|
|
__decorate([
|
|
(0, swagger_1.ApiPropertyOptional)({ description: 'Trial period in days' }),
|
|
(0, class_validator_1.IsOptional)(),
|
|
(0, class_validator_1.IsNumber)(),
|
|
__metadata("design:type", Number)
|
|
], CreateCheckoutSessionDto.prototype, "trial_period_days", void 0);
|
|
class CreateBillingPortalSessionDto {
|
|
}
|
|
exports.CreateBillingPortalSessionDto = CreateBillingPortalSessionDto;
|
|
__decorate([
|
|
(0, swagger_1.ApiProperty)({ description: 'Tenant ID' }),
|
|
(0, class_validator_1.IsString)(),
|
|
__metadata("design:type", String)
|
|
], CreateBillingPortalSessionDto.prototype, "tenant_id", void 0);
|
|
__decorate([
|
|
(0, swagger_1.ApiProperty)({ description: 'Return URL after portal session' }),
|
|
(0, class_validator_1.IsString)(),
|
|
__metadata("design:type", String)
|
|
], CreateBillingPortalSessionDto.prototype, "return_url", void 0);
|
|
class StripeWebhookResponseDto {
|
|
}
|
|
exports.StripeWebhookResponseDto = StripeWebhookResponseDto;
|
|
__decorate([
|
|
(0, swagger_1.ApiProperty)({ description: 'Whether the webhook was processed successfully' }),
|
|
__metadata("design:type", Boolean)
|
|
], StripeWebhookResponseDto.prototype, "received", void 0);
|
|
__decorate([
|
|
(0, swagger_1.ApiPropertyOptional)({ description: 'Event type processed' }),
|
|
__metadata("design:type", String)
|
|
], StripeWebhookResponseDto.prototype, "event_type", void 0);
|
|
__decorate([
|
|
(0, swagger_1.ApiPropertyOptional)({ description: 'Error message if failed' }),
|
|
__metadata("design:type", String)
|
|
], StripeWebhookResponseDto.prototype, "error", void 0);
|
|
//# sourceMappingURL=stripe-webhook.dto.js.map
|