@classytic/revenue 1.1.3 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { a as MonetizationService, i as PaymentService, n as EscrowService, r as TransactionService, t as SettlementService } from "../../settlement.service-BxuiHpNC.mjs";
1
+ import { a as MonetizationService, i as PaymentService, n as EscrowService, r as TransactionService, t as SettlementService } from "../../settlement.service-DjzAjezU.mjs";
2
2
  import "../../index-Dsp7H5Wb.mjs";
3
- import "../../settlement.schema-D5uWB5tP.mjs";
3
+ import "../../settlement.schema-DnNSFpGd.mjs";
4
4
  export { EscrowService, MonetizationService, PaymentService, SettlementService, TransactionService };
@@ -1,3 +1,3 @@
1
- import { a as MonetizationService, i as PaymentService, n as EscrowService, r as TransactionService, t as SettlementService } from "../../settlement.service-CUxbUTzT.mjs";
1
+ import { a as MonetizationService, i as PaymentService, n as EscrowService, r as TransactionService, t as SettlementService } from "../../settlement.service-DmdKv0Zu.mjs";
2
2
 
3
3
  export { EscrowService, MonetizationService, PaymentService, SettlementService, TransactionService };
@@ -1,5 +1,5 @@
1
1
  import { B as TransactionDocument, F as SplitInfo, R as SubscriptionDocument, W as WebhookEventData, _ as PaymentIntentData, b as PaymentResultData } from "../index-Dsp7H5Wb.mjs";
2
- import { t as SettlementDocument } from "../settlement.schema-D5uWB5tP.mjs";
2
+ import { t as SettlementDocument } from "../settlement.schema-DnNSFpGd.mjs";
3
3
  import { i as RefundResult, r as PaymentResult } from "../base-CsTlVQJe.mjs";
4
4
 
5
5
  //#region src/core/events.d.ts
@@ -1,9 +1,9 @@
1
- import { o as Container } from "../settlement.service-BxuiHpNC.mjs";
1
+ import { o as Container } from "../settlement.service-DjzAjezU.mjs";
2
2
  import "../index-Dsp7H5Wb.mjs";
3
- import "../settlement.schema-D5uWB5tP.mjs";
3
+ import "../settlement.schema-DnNSFpGd.mjs";
4
4
  import "../base-CsTlVQJe.mjs";
5
5
  import { BaseEvent, EscrowCancelledEvent, EscrowHeldEvent, EscrowReleasedEvent, EscrowSplitEvent, EventBus, FreeCreatedEvent, MonetizationCreatedEvent, PaymentFailedEvent, PaymentRefundedEvent, PaymentVerifiedEvent, PurchaseCreatedEvent, RevenueEvents, SettlementCompletedEvent, SettlementCreatedEvent, SettlementFailedEvent, SettlementProcessingEvent, SettlementScheduledEvent, SubscriptionActivatedEvent, SubscriptionCancelledEvent, SubscriptionCreatedEvent, SubscriptionPausedEvent, SubscriptionRenewedEvent, SubscriptionResumedEvent, TransactionUpdatedEvent, WebhookProcessedEvent, createEventBus } from "./events.mjs";
6
6
  import { a as PluginManager, c as definePlugin, i as PluginLogger, l as loggingPlugin, n as PluginContext, o as RevenuePlugin, r as PluginHooks, s as auditPlugin, t as HookFn, u as metricsPlugin } from "../plugin-BbK0OVHy.mjs";
7
7
  import { S as unwrapOr, _ as match, b as tryCatchSync, c as Ok, d as err, f as flatMap, g as mapErr, h as map, l as Result, m as isOk, p as isErr, s as Err, u as all, v as ok, x as unwrap, y as tryCatch } from "../retry-HHCOXYdn.mjs";
8
- import { A as SUBSCRIPTION_STATE_MACHINE, B as Revenue, C as TransactionNotFoundError, D as HOLD_STATE_MACHINE, E as isRevenueError, H as RevenueOptions, M as StateMachine, O as SETTLEMENT_STATE_MACHINE, R as ModelsConfig, S as SubscriptionNotFoundError, T as isRetryable, U as createRevenue, V as RevenueBuilder, _ as RefundNotSupportedError, a as InvalidAmountError, b as StateError, c as ModelNotRegisteredError, d as PaymentIntentCreationError, f as PaymentVerificationError, g as RefundError, h as ProviderNotFoundError, i as ErrorCode, j as TRANSACTION_STATE_MACHINE, k as SPLIT_STATE_MACHINE, l as NotFoundError, m as ProviderError, n as ConfigurationError, o as InvalidStateTransitionError, p as ProviderCapabilityError, r as ERROR_CODES, s as MissingRequiredFieldError, t as AlreadyVerifiedError, u as OperationError, v as RevenueError, w as ValidationError, x as SubscriptionNotActiveError, y as RevenueErrorOptions, z as ProvidersConfig } from "../errors-CorrWz7A.mjs";
8
+ import { A as SUBSCRIPTION_STATE_MACHINE, B as Revenue, C as TransactionNotFoundError, D as HOLD_STATE_MACHINE, E as isRevenueError, H as RevenueOptions, M as StateMachine, O as SETTLEMENT_STATE_MACHINE, R as ModelsConfig, S as SubscriptionNotFoundError, T as isRetryable, U as createRevenue, V as RevenueBuilder, _ as RefundNotSupportedError, a as InvalidAmountError, b as StateError, c as ModelNotRegisteredError, d as PaymentIntentCreationError, f as PaymentVerificationError, g as RefundError, h as ProviderNotFoundError, i as ErrorCode, j as TRANSACTION_STATE_MACHINE, k as SPLIT_STATE_MACHINE, l as NotFoundError, m as ProviderError, n as ConfigurationError, o as InvalidStateTransitionError, p as ProviderCapabilityError, r as ERROR_CODES, s as MissingRequiredFieldError, t as AlreadyVerifiedError, u as OperationError, v as RevenueError, w as ValidationError, x as SubscriptionNotActiveError, y as RevenueErrorOptions, z as ProvidersConfig } from "../errors-rRdOqnWx.mjs";
9
9
  export { AlreadyVerifiedError, type BaseEvent, ConfigurationError, Container, ERROR_CODES, type Err, ErrorCode, type EscrowCancelledEvent, type EscrowHeldEvent, type EscrowReleasedEvent, type EscrowSplitEvent, EventBus, type FreeCreatedEvent, HOLD_STATE_MACHINE, type HookFn, InvalidAmountError, InvalidStateTransitionError, MissingRequiredFieldError, ModelNotRegisteredError, type ModelsConfig, type MonetizationCreatedEvent, NotFoundError, type Ok, OperationError, type PaymentFailedEvent, PaymentIntentCreationError, type PaymentRefundedEvent, PaymentVerificationError, type PaymentVerifiedEvent, type PluginContext, type PluginHooks, type PluginLogger, PluginManager, ProviderCapabilityError, ProviderError, ProviderNotFoundError, type ProvidersConfig, type PurchaseCreatedEvent, RefundError, RefundNotSupportedError, Result, Revenue, RevenueBuilder, RevenueError, RevenueErrorOptions, type RevenueEvents, type RevenueOptions, type RevenuePlugin, SETTLEMENT_STATE_MACHINE, SPLIT_STATE_MACHINE, SUBSCRIPTION_STATE_MACHINE, type SettlementCompletedEvent, type SettlementCreatedEvent, type SettlementFailedEvent, type SettlementProcessingEvent, type SettlementScheduledEvent, StateError, StateMachine, type SubscriptionActivatedEvent, type SubscriptionCancelledEvent, type SubscriptionCreatedEvent, SubscriptionNotActiveError, SubscriptionNotFoundError, type SubscriptionPausedEvent, type SubscriptionRenewedEvent, type SubscriptionResumedEvent, TRANSACTION_STATE_MACHINE, TransactionNotFoundError, type TransactionUpdatedEvent, ValidationError, type WebhookProcessedEvent, all, auditPlugin, createEventBus, createRevenue, definePlugin, err, flatMap, isErr, isOk, isRetryable, isRevenueError, loggingPlugin, map, mapErr, match, metricsPlugin, ok, tryCatch, tryCatchSync, unwrap, unwrapOr };
@@ -1,8 +1,8 @@
1
- import { i as Container, n as RevenueBuilder, r as createRevenue, t as Revenue } from "../revenue-9scqKSef.mjs";
1
+ import { i as Container, n as RevenueBuilder, r as createRevenue, t as Revenue } from "../revenue-BhdS7nXh.mjs";
2
2
  import { EventBus, createEventBus } from "./events.mjs";
3
3
  import { a as metricsPlugin, i as loggingPlugin, n as auditPlugin, r as definePlugin, t as PluginManager } from "../plugin-Cd_V04Em.mjs";
4
4
  import { S as unwrapOr, _ as match, b as tryCatchSync, d as err, f as flatMap, g as mapErr, h as map, l as Result, m as isOk, p as isErr, u as all, v as ok, x as unwrap, y as tryCatch } from "../commission-split-BzB8cd39.mjs";
5
5
  import { C as ValidationError, S as TransactionNotFoundError, T as isRevenueError, _ as RefundNotSupportedError, a as InvalidAmountError, b as SubscriptionNotActiveError, c as ModelNotRegisteredError, d as PaymentIntentCreationError, f as PaymentVerificationError, g as RefundError, h as ProviderNotFoundError, i as ERROR_CODES, l as NotFoundError, m as ProviderError, n as AlreadyVerifiedError, o as InvalidStateTransitionError, p as ProviderCapabilityError, r as ConfigurationError, s as MissingRequiredFieldError, u as OperationError, v as RevenueError, w as isRetryable, x as SubscriptionNotFoundError, y as StateError } from "../category-resolver-DV83N8ok.mjs";
6
- import { d as SETTLEMENT_STATE_MACHINE, f as SPLIT_STATE_MACHINE, h as StateMachine, m as TRANSACTION_STATE_MACHINE, p as SUBSCRIPTION_STATE_MACHINE, u as HOLD_STATE_MACHINE } from "../settlement.service-CUxbUTzT.mjs";
6
+ import { d as SETTLEMENT_STATE_MACHINE, f as SPLIT_STATE_MACHINE, h as StateMachine, m as TRANSACTION_STATE_MACHINE, p as SUBSCRIPTION_STATE_MACHINE, u as HOLD_STATE_MACHINE } from "../settlement.service-DmdKv0Zu.mjs";
7
7
 
8
8
  export { AlreadyVerifiedError, ConfigurationError, Container, ERROR_CODES, EventBus, HOLD_STATE_MACHINE, InvalidAmountError, InvalidStateTransitionError, MissingRequiredFieldError, ModelNotRegisteredError, NotFoundError, OperationError, PaymentIntentCreationError, PaymentVerificationError, PluginManager, ProviderCapabilityError, ProviderError, ProviderNotFoundError, RefundError, RefundNotSupportedError, Result, Revenue, RevenueBuilder, RevenueError, SETTLEMENT_STATE_MACHINE, SPLIT_STATE_MACHINE, SUBSCRIPTION_STATE_MACHINE, StateError, StateMachine, SubscriptionNotActiveError, SubscriptionNotFoundError, TRANSACTION_STATE_MACHINE, TransactionNotFoundError, ValidationError, all, auditPlugin, createEventBus, createRevenue, definePlugin, err, flatMap, isErr, isOk, isRetryable, isRevenueError, loggingPlugin, map, mapErr, match, metricsPlugin, ok, tryCatch, tryCatchSync, unwrap, unwrapOr };
@@ -1,4 +1,4 @@
1
- import { a as MonetizationService, i as PaymentService, n as EscrowService, o as Container, r as TransactionService, t as SettlementService } from "./settlement.service-BxuiHpNC.mjs";
1
+ import { a as MonetizationService, i as PaymentService, n as EscrowService, o as Container, r as TransactionService, t as SettlementService } from "./settlement.service-DjzAjezU.mjs";
2
2
  import { P as RevenueConfig, V as TransactionFlowValue, h as MongooseModel, v as PaymentProviderInterface } from "./index-Dsp7H5Wb.mjs";
3
3
  import { u as SplitStatusValue } from "./split.enums-DmskfLOM.mjs";
4
4
  import { n as PaymentProvider } from "./base-CsTlVQJe.mjs";
package/dist/index.d.mts CHANGED
@@ -1,9 +1,9 @@
1
- import "./settlement.service-BxuiHpNC.mjs";
1
+ import "./settlement.service-DjzAjezU.mjs";
2
2
  import { K as ITransaction, q as ITransactionCreateInput } from "./index-Dsp7H5Wb.mjs";
3
- import "./settlement.schema-D5uWB5tP.mjs";
3
+ import "./settlement.schema-DnNSFpGd.mjs";
4
4
  import { a as WebhookEvent, i as RefundResult, n as PaymentProvider, r as PaymentResult, t as PaymentIntent } from "./base-CsTlVQJe.mjs";
5
5
  import "./plugin-BbK0OVHy.mjs";
6
6
  import { S as unwrapOr, c as Ok, d as err, l as Result, m as isOk, p as isErr, s as Err, v as ok, x as unwrap } from "./retry-HHCOXYdn.mjs";
7
- import { A as SUBSCRIPTION_STATE_MACHINE, B as Revenue, C as TransactionNotFoundError, D as HOLD_STATE_MACHINE, E as isRevenueError, F as filterAuditTrail, H as RevenueOptions, I as getAuditTrail, L as getLastStateChange, M as StateMachine, N as StateChangeEvent, O as SETTLEMENT_STATE_MACHINE, P as appendAuditEvent, R as ModelsConfig, S as SubscriptionNotFoundError, T as isRetryable, U as createRevenue, V as RevenueBuilder, _ as RefundNotSupportedError, a as InvalidAmountError, b as StateError, c as ModelNotRegisteredError, d as PaymentIntentCreationError, f as PaymentVerificationError, g as RefundError, h as ProviderNotFoundError, i as ErrorCode, j as TRANSACTION_STATE_MACHINE, k as SPLIT_STATE_MACHINE, l as NotFoundError, m as ProviderError, n as ConfigurationError, o as InvalidStateTransitionError, p as ProviderCapabilityError, r as ERROR_CODES, s as MissingRequiredFieldError, t as AlreadyVerifiedError, u as OperationError, v as RevenueError, w as ValidationError, x as SubscriptionNotActiveError, y as RevenueErrorOptions, z as ProvidersConfig } from "./errors-CorrWz7A.mjs";
7
+ import { A as SUBSCRIPTION_STATE_MACHINE, B as Revenue, C as TransactionNotFoundError, D as HOLD_STATE_MACHINE, E as isRevenueError, F as filterAuditTrail, H as RevenueOptions, I as getAuditTrail, L as getLastStateChange, M as StateMachine, N as StateChangeEvent, O as SETTLEMENT_STATE_MACHINE, P as appendAuditEvent, R as ModelsConfig, S as SubscriptionNotFoundError, T as isRetryable, U as createRevenue, V as RevenueBuilder, _ as RefundNotSupportedError, a as InvalidAmountError, b as StateError, c as ModelNotRegisteredError, d as PaymentIntentCreationError, f as PaymentVerificationError, g as RefundError, h as ProviderNotFoundError, i as ErrorCode, j as TRANSACTION_STATE_MACHINE, k as SPLIT_STATE_MACHINE, l as NotFoundError, m as ProviderError, n as ConfigurationError, o as InvalidStateTransitionError, p as ProviderCapabilityError, r as ERROR_CODES, s as MissingRequiredFieldError, t as AlreadyVerifiedError, u as OperationError, v as RevenueError, w as ValidationError, x as SubscriptionNotActiveError, y as RevenueErrorOptions, z as ProvidersConfig } from "./errors-rRdOqnWx.mjs";
8
8
  import { i as toSmallestUnit, n as MoneyValue, r as fromSmallestUnit, t as Money } from "./money-DPG8AtJ8.mjs";
9
9
  export { AlreadyVerifiedError, ConfigurationError, ERROR_CODES, type Err, ErrorCode, HOLD_STATE_MACHINE, type ITransaction, type ITransactionCreateInput, InvalidAmountError, InvalidStateTransitionError, MissingRequiredFieldError, ModelNotRegisteredError, type ModelsConfig, Money, type MoneyValue, NotFoundError, type Ok, OperationError, PaymentIntent, PaymentIntentCreationError, PaymentProvider, PaymentResult, PaymentVerificationError, ProviderCapabilityError, ProviderError, ProviderNotFoundError, type ProvidersConfig, RefundError, RefundNotSupportedError, RefundResult, Result, Revenue, RevenueBuilder, RevenueError, RevenueErrorOptions, type RevenueOptions, SETTLEMENT_STATE_MACHINE, SPLIT_STATE_MACHINE, SUBSCRIPTION_STATE_MACHINE, type StateChangeEvent, StateError, StateMachine, SubscriptionNotActiveError, SubscriptionNotFoundError, TRANSACTION_STATE_MACHINE, TransactionNotFoundError, ValidationError, WebhookEvent, appendAuditEvent, createRevenue, err, filterAuditTrail, fromSmallestUnit, getAuditTrail, getLastStateChange, isErr, isOk, isRetryable, isRevenueError, ok, toSmallestUnit, unwrap, unwrapOr };
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { n as RevenueBuilder, r as createRevenue, t as Revenue } from "./revenue-9scqKSef.mjs";
1
+ import { n as RevenueBuilder, r as createRevenue, t as Revenue } from "./revenue-BhdS7nXh.mjs";
2
2
  import { S as unwrapOr, d as err, l as Result, m as isOk, p as isErr, v as ok, x as unwrap } from "./commission-split-BzB8cd39.mjs";
3
3
  import { C as ValidationError, S as TransactionNotFoundError, T as isRevenueError, _ as RefundNotSupportedError, a as InvalidAmountError, b as SubscriptionNotActiveError, c as ModelNotRegisteredError, d as PaymentIntentCreationError, f as PaymentVerificationError, g as RefundError, h as ProviderNotFoundError, i as ERROR_CODES, l as NotFoundError, m as ProviderError, n as AlreadyVerifiedError, o as InvalidStateTransitionError, p as ProviderCapabilityError, r as ConfigurationError, s as MissingRequiredFieldError, u as OperationError, v as RevenueError, w as isRetryable, x as SubscriptionNotFoundError, y as StateError } from "./category-resolver-DV83N8ok.mjs";
4
- import { c as getAuditTrail, d as SETTLEMENT_STATE_MACHINE, f as SPLIT_STATE_MACHINE, h as StateMachine, l as getLastStateChange, m as TRANSACTION_STATE_MACHINE, o as appendAuditEvent, p as SUBSCRIPTION_STATE_MACHINE, s as filterAuditTrail, u as HOLD_STATE_MACHINE } from "./settlement.service-CUxbUTzT.mjs";
4
+ import { c as getAuditTrail, d as SETTLEMENT_STATE_MACHINE, f as SPLIT_STATE_MACHINE, h as StateMachine, l as getLastStateChange, m as TRANSACTION_STATE_MACHINE, o as appendAuditEvent, p as SUBSCRIPTION_STATE_MACHINE, s as filterAuditTrail, u as HOLD_STATE_MACHINE } from "./settlement.service-DmdKv0Zu.mjs";
5
5
  import { a as WebhookEvent, i as RefundResult, n as PaymentProvider, r as PaymentResult, t as PaymentIntent } from "./base-DCoyIUj6.mjs";
6
6
  import { n as fromSmallestUnit, r as toSmallestUnit, t as Money } from "./money-CvrDOijQ.mjs";
7
7
 
@@ -1,5 +1,5 @@
1
1
  import "../../index-Dsp7H5Wb.mjs";
2
- import "../../settlement.schema-D5uWB5tP.mjs";
2
+ import "../../settlement.schema-DnNSFpGd.mjs";
3
3
  import "../../base-CsTlVQJe.mjs";
4
4
  import { c as definePlugin, o as RevenuePlugin } from "../../plugin-BbK0OVHy.mjs";
5
5
  import { n as TaxConfig } from "../../tax-BoCt5cEd.mjs";
@@ -3,7 +3,7 @@ import { t as PluginManager } from "./plugin-Cd_V04Em.mjs";
3
3
  import { c as retry, s as createCircuitBreaker, y as tryCatch } from "./commission-split-BzB8cd39.mjs";
4
4
  import { n as createIdempotencyManager } from "./idempotency-DaYcUGY1.mjs";
5
5
  import { r as ConfigurationError } from "./category-resolver-DV83N8ok.mjs";
6
- import { a as MonetizationService, g as resolveConfig, i as PaymentService, n as EscrowService, r as TransactionService, t as SettlementService } from "./settlement.service-CUxbUTzT.mjs";
6
+ import { a as MonetizationService, g as resolveConfig, i as PaymentService, n as EscrowService, r as TransactionService, t as SettlementService } from "./settlement.service-DmdKv0Zu.mjs";
7
7
  import { nanoid } from "nanoid";
8
8
 
9
9
  //#region src/core/container.ts