@classytic/revenue 2.5.0 → 2.7.0
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.
- package/CHANGELOG.md +50 -0
- package/dist/{audit-Ba2XB2C4.mjs → audit-C5c4LAf6.mjs} +1 -1
- package/dist/{audit-DRKuLBFO.d.mts → audit-Cug6g_31.d.mts} +3 -2
- package/dist/{bank-feed-ClxNob_I.mjs → bank-feed-yxrt4YpT.mjs} +1 -1
- package/dist/core/state-machines.mjs +2 -2
- package/dist/{engine-types-F3f1lWNG.d.mts → engine-types-D6ijamqA.d.mts} +29 -1
- package/dist/enums/index.mjs +1 -1
- package/dist/{errors-Bt5NRVMq.mjs → errors-8P5tRgV7.mjs} +11 -1
- package/dist/{escrow.schema-o4qhjOca.d.mts → escrow.schema-DSx7EywJ.d.mts} +18 -18
- package/dist/{escrow.schema-BcKdzrJ7.mjs → escrow.schema-gksK8F-W.mjs} +5 -4
- package/dist/events/index.d.mts +1 -1
- package/dist/events/index.mjs +2 -2
- package/dist/index.d.mts +13 -5
- package/dist/index.mjs +10 -10
- package/dist/providers/index.mjs +1 -1
- package/dist/repositories/create-repositories.d.mts +1 -1
- package/dist/repositories/create-repositories.mjs +1 -1
- package/dist/{revenue-event-catalog-j8Fh7Yag.d.mts → revenue-event-catalog-BU_KYN2-.d.mts} +126 -126
- package/dist/{revenue-event-catalog-B9aZmNpL.mjs → revenue-event-catalog-DQXCuS-l.mjs} +3 -2
- package/dist/{settlement.repository-BDrJQc27.mjs → settlement.repository-KDKH2jcq.mjs} +104 -44
- package/dist/shared/index.d.mts +2 -2
- package/dist/shared/index.mjs +3 -3
- package/dist/{splits-CNfQj92L.mjs → splits-rs6mkdGN.mjs} +22 -7
- package/dist/validators/index.d.mts +1 -1
- package/dist/validators/index.mjs +5 -4
- package/package.json +8 -7
- /package/dist/{event-constants-DM_-A57b.mjs → event-constants-CPmh2sIt.mjs} +0 -0
- /package/dist/{subscription.enums-95othr0i.mjs → subscription.enums-olW5dyly.mjs} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,56 @@
|
|
|
3
3
|
Format based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
4
4
|
adhering to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
5
5
|
|
|
6
|
+
## [Unreleased] → 2.7.0
|
|
7
|
+
|
|
8
|
+
### Fixed (behavioral) — 2026-07-05 addendum
|
|
9
|
+
|
|
10
|
+
- **Ghost-event publish under host sessions (§P8.1).** `dispatch` published
|
|
11
|
+
regardless of `ctx.session`. Now: session + NO outbox throws the new
|
|
12
|
+
`UnmanagedSessionError` (`revenue.session.unmanaged`); session + outbox is
|
|
13
|
+
durable-relay-only (row joins the host tx, immediate publish skipped —
|
|
14
|
+
the relay delivers post-commit).
|
|
15
|
+
|
|
16
|
+
### Changed — ISO 4217 currency gate via primitives (P1, 2026-07-04)
|
|
17
|
+
|
|
18
|
+
- Every zod currency validator (payment / settlement / subscription /
|
|
19
|
+
transaction / bank-feed schemas + the revenue event catalog) replaced
|
|
20
|
+
its hand-rolled `length(3)` / `min(3).max(3)` checks (which accepted
|
|
21
|
+
lowercase `usd`) with `CURRENCY_PATTERN` from
|
|
22
|
+
`@classytic/primitives/currency`. Primitives peer floor raised to
|
|
23
|
+
`>=0.9.1`.
|
|
24
|
+
|
|
25
|
+
### Fixed — subscription period math via `@classytic/primitives/calendar`
|
|
26
|
+
|
|
27
|
+
- `subscription.activate` computed `endDate` with LOCAL `setMonth` /
|
|
28
|
+
`setFullYear` / `setDate`: (1) the boundary silently shifted with the deploy
|
|
29
|
+
machine's `TZ` env, and (2) month-ends overflowed — a Jan 31 monthly
|
|
30
|
+
activation ended **Mar 2/3** instead of Feb 28/29. Now `addMonths` /
|
|
31
|
+
`addYears` / `addDays` from `@classytic/primitives/calendar` (UTC-stable,
|
|
32
|
+
month-end clamping). Primitives peer bumped to `>=0.9.0`.
|
|
33
|
+
|
|
34
|
+
## [2.6.0]
|
|
35
|
+
|
|
36
|
+
### Added — generalized settlement rollups (`summary` + `breakdownByRecipient`)
|
|
37
|
+
|
|
38
|
+
`recipientBalance` only rolled up ONE recipient, forcing hosts to hand-roll raw
|
|
39
|
+
aggregations for platform-wide / per-recipient / cross-org views. Two reusable
|
|
40
|
+
primitives now cover all of them (the `recipientBalance` status+due bucketing,
|
|
41
|
+
generalized — one tenant-scoped `aggregatePipeline`, never a raw `Model.aggregate`):
|
|
42
|
+
|
|
43
|
+
- **`summary(filter = {}, ctx)` → `SettlementSummary`** — the money-state
|
|
44
|
+
(`held / available / processing / paidOut / pending / failed / lifetime /
|
|
45
|
+
currency`) for an ARBITRARY filter: a recipient, an org, or the whole platform
|
|
46
|
+
(pass `_bypassTenant` in ctx). Backs platform reconciliation + cross-org
|
|
47
|
+
earnings.
|
|
48
|
+
- **`breakdownByRecipient(filter = {}, ctx)` → `RecipientBreakdown[]`** — one
|
|
49
|
+
rollup per distinct `(recipientId, recipientType)` (plus first-seen `role`),
|
|
50
|
+
for a "who is owed what" platform view.
|
|
51
|
+
|
|
52
|
+
`recipientBalance` is now a thin wrapper over `summary({ recipientId, … })`.
|
|
53
|
+
Exported types: `SettlementSummary`, `RecipientBreakdown`. No migration; no
|
|
54
|
+
breaking change to `recipientBalance`'s shape.
|
|
55
|
+
|
|
6
56
|
## [2.5.0]
|
|
7
57
|
|
|
8
58
|
### Added — `SettlementRepository.recipientBalance()` (the seller/creator "wallet")
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CurrencyMismatchError, absMoney, addMoney, compareMoney, equalsMoney, fromMajor, fromMajor as fromMajor$1, isMoney, isNegativeMoney, isPositiveMoney, isZeroMoney, money, money as money$1, multiplyMoney, negateMoney, subtractMoney, sumMoney, toMajor, toMajor as toMajor$1 } from "@classytic/primitives/money";
|
|
2
1
|
import { CURRENCIES, MINOR_UNIT_FACTOR, isCurrencyCode, minorUnitFactor, toCurrencyCode } from "@classytic/primitives/currency";
|
|
2
|
+
import { CurrencyMismatchError, absMoney, addMoney, compareMoney, equalsMoney, fromMajor, fromMajor as fromMajor$1, isMoney, isNegativeMoney, isPositiveMoney, isZeroMoney, money, money as money$1, multiplyMoney, negateMoney, subtractMoney, sumMoney, toMajor, toMajor as toMajor$1 } from "@classytic/primitives/money";
|
|
3
3
|
|
|
4
4
|
//#region src/shared/formatters/money.ts
|
|
5
5
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StateChangeEvent } from "./core/state-machines.mjs";
|
|
2
|
-
import { CurrencyMismatchError, Money, Money as MoneyValue, absMoney, addMoney, compareMoney, equalsMoney, fromMajor as fromMajor$1, isMoney, isNegativeMoney, isPositiveMoney, isZeroMoney, money as money$1, multiplyMoney, negateMoney, subtractMoney, sumMoney, toMajor as toMajor$1 } from "@classytic/primitives/money";
|
|
3
2
|
import { CURRENCIES, CurrencyCode, MINOR_UNIT_FACTOR, isCurrencyCode, minorUnitFactor, toCurrencyCode } from "@classytic/primitives/currency";
|
|
3
|
+
import { CurrencyMismatchError, Money, Money as MoneyValue, absMoney, addMoney, compareMoney, equalsMoney, fromMajor as fromMajor$1, isMoney, isNegativeMoney, isPositiveMoney, isZeroMoney, money as money$1, multiplyMoney, negateMoney, subtractMoney, sumMoney, toMajor as toMajor$1 } from "@classytic/primitives/money";
|
|
4
4
|
|
|
5
5
|
//#region src/shared/calculators/commission.d.ts
|
|
6
6
|
interface CommissionInfo {
|
|
@@ -60,6 +60,7 @@ interface SplitInfo {
|
|
|
60
60
|
}
|
|
61
61
|
declare function calculateSplits(amount: number, rules: SplitRule[], gatewayFeeRate?: number): SplitInfo[];
|
|
62
62
|
declare function calculateOrganizationPayout(amount: number, splits: SplitInfo[]): number;
|
|
63
|
+
declare function reverseSplits(originalSplits: SplitInfo[], originalAmount: number, refundAmount: number): SplitInfo[];
|
|
63
64
|
//#endregion
|
|
64
65
|
//#region src/shared/formatters/money.d.ts
|
|
65
66
|
/**
|
|
@@ -86,4 +87,4 @@ declare function getLastStateChange(doc: {
|
|
|
86
87
|
metadata?: Record<string, unknown>;
|
|
87
88
|
}): StateChangeEvent | undefined;
|
|
88
89
|
//#endregion
|
|
89
|
-
export { SplitInfo as A,
|
|
90
|
+
export { SplitInfo as A, reverseTax as B, multiplyMoney as C, toCurrencyCode as D, sumMoney as E, TaxCalculation as F, CommissionInfo as H, TaxConfig as I, TaxType as L, calculateOrganizationPayout as M, calculateSplits as N, toMajor$1 as O, reverseSplits as P, calculateTax as R, money$1 as S, subtractMoney as T, calculateCommission as U, validateTaxCalculation as V, reverseCommission as W, isMoney as _, CurrencyCode as a, isZeroMoney as b, Money as c, addMoney as d, compareMoney as f, isCurrencyCode as g, fromSmallestUnit as h, CURRENCIES as i, SplitRule as j, toSmallestUnit as k, MoneyValue as l, fromMajor$1 as m, getAuditTrail as n, CurrencyMismatchError as o, equalsMoney as p, getLastStateChange as r, MINOR_UNIT_FACTOR as s, appendAuditEvent as t, absMoney as u, isNegativeMoney as v, negateMoney as w, minorUnitFactor as x, isPositiveMoney as y, getTaxType as z };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _ as TRANSACTION_STATUS, a as TRANSACTION_KIND } from "../bank-feed.enums-ByS3mjX0.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { a as InvalidStateTransitionError } from "../errors-8P5tRgV7.mjs";
|
|
3
|
+
import { g as SETTLEMENT_STATUS, l as SPLIT_STATUS, r as SUBSCRIPTION_STATUS, w as HOLD_STATUS } from "../subscription.enums-olW5dyly.mjs";
|
|
4
4
|
import { defineStateMachine } from "@classytic/primitives/state-machine";
|
|
5
5
|
|
|
6
6
|
//#region src/core/state-machines.ts
|
|
@@ -946,6 +946,18 @@ interface RecipientBalance {
|
|
|
946
946
|
/** pending + processing + paidOut — the total the platform has committed to this recipient. */
|
|
947
947
|
lifetime: number;
|
|
948
948
|
}
|
|
949
|
+
/**
|
|
950
|
+
* Settlement money-state for an arbitrary filter (a recipient, an org, or the
|
|
951
|
+
* whole platform) — the same status+due rollup as {@link RecipientBalance} but
|
|
952
|
+
* not tied to a single recipient. The reusable shape behind `summary`.
|
|
953
|
+
*/
|
|
954
|
+
type SettlementSummary = Omit<RecipientBalance, 'recipientId'>;
|
|
955
|
+
/** One row of {@link SettlementRepository.breakdownByRecipient}. */
|
|
956
|
+
interface RecipientBreakdown extends RecipientBalance {
|
|
957
|
+
recipientType: string;
|
|
958
|
+
/** First-seen settlement role (creator_earning | co_instructor | referrer | …). */
|
|
959
|
+
role: string | null;
|
|
960
|
+
}
|
|
949
961
|
/**
|
|
950
962
|
* SettlementRepository — payouts to recipients (organizations, vendors,
|
|
951
963
|
* affiliates).
|
|
@@ -1007,6 +1019,22 @@ declare class SettlementRepository extends RevenueRepositoryBase<SettlementDocum
|
|
|
1007
1019
|
code?: string;
|
|
1008
1020
|
retry?: boolean;
|
|
1009
1021
|
}, ctx?: RevenueContext): Promise<SettlementDocument>;
|
|
1022
|
+
/**
|
|
1023
|
+
* Settlement money-state for an ARBITRARY filter — a recipient, an org, or
|
|
1024
|
+
* the whole platform (pass `_bypassTenant` in ctx to span every org). One
|
|
1025
|
+
* tenant-scoped `aggregatePipeline` (the `{ recipientId, status }` index backs
|
|
1026
|
+
* the `$match`), never a raw `Model.aggregate`. The reusable rollup behind
|
|
1027
|
+
* `recipientBalance`, platform reconciliation, and cross-org earnings.
|
|
1028
|
+
*/
|
|
1029
|
+
summary(filter?: Record<string, unknown>, ctx?: RevenueContext): Promise<SettlementSummary>;
|
|
1030
|
+
/**
|
|
1031
|
+
* Per-recipient settlement rollup — one {@link RecipientBreakdown} per
|
|
1032
|
+
* distinct (recipientId, recipientType) matching `filter`. The reusable list
|
|
1033
|
+
* behind a platform "who is owed what" view; pass `_bypassTenant` to span all
|
|
1034
|
+
* orgs.
|
|
1035
|
+
*/
|
|
1036
|
+
breakdownByRecipient(filter?: Record<string, unknown>, ctx?: RevenueContext): Promise<RecipientBreakdown[]>;
|
|
1037
|
+
/** One recipient's wallet — a thin `summary` over `{ recipientId, … }`. */
|
|
1010
1038
|
recipientBalance(recipientId: string, options?: {
|
|
1011
1039
|
recipientType?: string;
|
|
1012
1040
|
currency?: string;
|
|
@@ -1265,4 +1293,4 @@ interface RevenueEngine {
|
|
|
1265
1293
|
destroy(): Promise<void>;
|
|
1266
1294
|
}
|
|
1267
1295
|
//#endregion
|
|
1268
|
-
export { RevenueConfig as a,
|
|
1296
|
+
export { TransactionDocument as _, RevenueConfig as a, RecipientBreakdown as c, SubscriptionRepository as d, TransactionRepository as f, SubscriptionDocument as g, SettlementDocument as h, RetryConfig as i, SettlementRepository as l, RevenueSchemaOptions as m, BankFeedModuleConfig as n, RevenueEngine as o, RevenueModels as p, CommissionConfig as r, RecipientBalance as s, BankFeedIndexConfig as t, SettlementSummary as u };
|
package/dist/enums/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as TRANSACTION_STATUS, a as TRANSACTION_KIND, b as isTransactionFlow, c as isBankFeedSource, d as isTransactionKind, f as statusesForKind, g as TRANSACTION_FLOW_VALUES, h as TRANSACTION_FLOW, i as BANK_FEED_STATUS_VALUES, l as isBankFeedStatus, m as LIBRARY_CATEGORY_VALUES, n as BANK_FEED_SOURCE_VALUES, o as TRANSACTION_KIND_VALUES, p as LIBRARY_CATEGORIES, r as BANK_FEED_STATUS, s as initialStatusFor, t as BANK_FEED_SOURCE, u as isStatusValidForKind, v as TRANSACTION_STATUS_VALUES, x as isTransactionStatus, y as isLibraryCategory } from "../bank-feed.enums-ByS3mjX0.mjs";
|
|
2
|
-
import { A as isReleaseReason, C as HOLD_REASON_VALUES, D as RELEASE_REASON_VALUES, E as RELEASE_REASON, O as isHoldReason, S as HOLD_REASON, T as HOLD_STATUS_VALUES, _ as SETTLEMENT_STATUS_VALUES, a as isPlanKey, b as isSettlementStatus, c as PAYOUT_METHOD_VALUES, d as SPLIT_TYPE, f as SPLIT_TYPE_VALUES, g as SETTLEMENT_STATUS, h as isSplitType, i as SUBSCRIPTION_STATUS_VALUES, k as isHoldStatus, l as SPLIT_STATUS, m as isSplitStatus, n as PLAN_KEY_VALUES, o as isSubscriptionStatus, p as isPayoutMethod, r as SUBSCRIPTION_STATUS, s as PAYOUT_METHOD, t as PLAN_KEYS, u as SPLIT_STATUS_VALUES, v as SETTLEMENT_TYPE, w as HOLD_STATUS, x as isSettlementType, y as SETTLEMENT_TYPE_VALUES } from "../subscription.enums-
|
|
2
|
+
import { A as isReleaseReason, C as HOLD_REASON_VALUES, D as RELEASE_REASON_VALUES, E as RELEASE_REASON, O as isHoldReason, S as HOLD_REASON, T as HOLD_STATUS_VALUES, _ as SETTLEMENT_STATUS_VALUES, a as isPlanKey, b as isSettlementStatus, c as PAYOUT_METHOD_VALUES, d as SPLIT_TYPE, f as SPLIT_TYPE_VALUES, g as SETTLEMENT_STATUS, h as isSplitType, i as SUBSCRIPTION_STATUS_VALUES, k as isHoldStatus, l as SPLIT_STATUS, m as isSplitStatus, n as PLAN_KEY_VALUES, o as isSubscriptionStatus, p as isPayoutMethod, r as SUBSCRIPTION_STATUS, s as PAYOUT_METHOD, t as PLAN_KEYS, u as SPLIT_STATUS_VALUES, v as SETTLEMENT_TYPE, w as HOLD_STATUS, x as isSettlementType, y as SETTLEMENT_TYPE_VALUES } from "../subscription.enums-olW5dyly.mjs";
|
|
3
3
|
import { a as PAYMENT_GATEWAY_TYPE_VALUES, c as isPaymentGatewayType, i as PAYMENT_GATEWAY_TYPE, l as isPaymentStatus, n as MONETIZATION_TYPE_VALUES, o as PAYMENT_STATUS, r as isMonetizationType, s as PAYMENT_STATUS_VALUES, t as MONETIZATION_TYPES } from "../monetization.enums-B9HBOecd.mjs";
|
|
4
4
|
|
|
5
5
|
export { BANK_FEED_SOURCE, BANK_FEED_SOURCE_VALUES, BANK_FEED_STATUS, BANK_FEED_STATUS_VALUES, HOLD_REASON, HOLD_REASON_VALUES, HOLD_STATUS, HOLD_STATUS_VALUES, LIBRARY_CATEGORIES, LIBRARY_CATEGORY_VALUES, MONETIZATION_TYPES, MONETIZATION_TYPE_VALUES, PAYMENT_GATEWAY_TYPE, PAYMENT_GATEWAY_TYPE_VALUES, PAYMENT_STATUS, PAYMENT_STATUS_VALUES, PAYOUT_METHOD, PAYOUT_METHOD_VALUES, PLAN_KEYS, PLAN_KEY_VALUES, RELEASE_REASON, RELEASE_REASON_VALUES, SETTLEMENT_STATUS, SETTLEMENT_STATUS_VALUES, SETTLEMENT_TYPE, SETTLEMENT_TYPE_VALUES, SPLIT_STATUS, SPLIT_STATUS_VALUES, SPLIT_TYPE, SPLIT_TYPE_VALUES, SUBSCRIPTION_STATUS, SUBSCRIPTION_STATUS_VALUES, TRANSACTION_FLOW, TRANSACTION_FLOW_VALUES, TRANSACTION_KIND, TRANSACTION_KIND_VALUES, TRANSACTION_STATUS, TRANSACTION_STATUS_VALUES, initialStatusFor, isBankFeedSource, isBankFeedStatus, isHoldReason, isHoldStatus, isLibraryCategory, isMonetizationType, isPaymentGatewayType, isPaymentStatus, isPayoutMethod, isPlanKey, isReleaseReason, isSettlementStatus, isSettlementType, isSplitStatus, isSplitType, isStatusValidForKind, isSubscriptionStatus, isTransactionFlow, isTransactionKind, isTransactionStatus, statusesForKind };
|
|
@@ -8,6 +8,16 @@ var RevenueError = class extends Error {
|
|
|
8
8
|
this.name = "RevenueError";
|
|
9
9
|
}
|
|
10
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* Thrown when a host passes ctx.session but NO outbox is wired —
|
|
13
|
+
* publishing mid-transaction leaks ghost events on rollback (§P8.1).
|
|
14
|
+
* Session + outbox is legal durable-relay-only mode.
|
|
15
|
+
*/
|
|
16
|
+
var UnmanagedSessionError = class extends RevenueError {
|
|
17
|
+
constructor() {
|
|
18
|
+
super("ctx.session provided but no OutboxStore is wired — events would leak or be lost. Wire an outbox or drop the session.", "revenue.session.unmanaged", void 0, 409);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
11
21
|
var ValidationError = class extends RevenueError {
|
|
12
22
|
constructor(message, details) {
|
|
13
23
|
super(message, "VALIDATION_ERROR", details);
|
|
@@ -128,4 +138,4 @@ var BankFeedProviderNotFoundError = class extends RevenueError {
|
|
|
128
138
|
};
|
|
129
139
|
|
|
130
140
|
//#endregion
|
|
131
|
-
export {
|
|
141
|
+
export { ValidationError as _, InvalidStateTransitionError as a, PaymentVerificationError as c, RefundNotSupportedError as d, RevenueError as f, UnmanagedSessionError as g, TransactionNotFoundError as h, ConfigurationError as i, ProviderCapabilityError as l, SubscriptionNotFoundError as m, BankFeedImportError as n, MethodKindLockedError as o, SettlementNotFoundError as p, BankFeedProviderNotFoundError as r, PaymentIntentCreationError as s, AlreadyVerifiedError as t, ProviderNotFoundError as u, WrongTransactionKindError as v };
|
|
@@ -27,8 +27,10 @@ declare const transactionBaseSchema: z.ZodObject<{
|
|
|
27
27
|
}, z.core.$strip>>;
|
|
28
28
|
method: z.ZodString;
|
|
29
29
|
methodKind: z.ZodEnum<{
|
|
30
|
-
|
|
30
|
+
manual: "manual";
|
|
31
31
|
bank_transfer: "bank_transfer";
|
|
32
|
+
cryptocurrency: "cryptocurrency";
|
|
33
|
+
card: "card";
|
|
32
34
|
instant_bank_transfer: "instant_bank_transfer";
|
|
33
35
|
direct_debit: "direct_debit";
|
|
34
36
|
wallet: "wallet";
|
|
@@ -37,8 +39,6 @@ declare const transactionBaseSchema: z.ZodObject<{
|
|
|
37
39
|
gift_card: "gift_card";
|
|
38
40
|
cash: "cash";
|
|
39
41
|
cheque: "cheque";
|
|
40
|
-
cryptocurrency: "cryptocurrency";
|
|
41
|
-
manual: "manual";
|
|
42
42
|
other: "other";
|
|
43
43
|
}>;
|
|
44
44
|
status: z.ZodDefault<z.ZodString>;
|
|
@@ -115,8 +115,10 @@ declare const transactionCreateSchema: z.ZodObject<{
|
|
|
115
115
|
amount: z.ZodNumber;
|
|
116
116
|
currency: z.ZodString;
|
|
117
117
|
methodKind: z.ZodEnum<{
|
|
118
|
-
|
|
118
|
+
manual: "manual";
|
|
119
119
|
bank_transfer: "bank_transfer";
|
|
120
|
+
cryptocurrency: "cryptocurrency";
|
|
121
|
+
card: "card";
|
|
120
122
|
instant_bank_transfer: "instant_bank_transfer";
|
|
121
123
|
direct_debit: "direct_debit";
|
|
122
124
|
wallet: "wallet";
|
|
@@ -125,8 +127,6 @@ declare const transactionCreateSchema: z.ZodObject<{
|
|
|
125
127
|
gift_card: "gift_card";
|
|
126
128
|
cash: "cash";
|
|
127
129
|
cheque: "cheque";
|
|
128
|
-
cryptocurrency: "cryptocurrency";
|
|
129
|
-
manual: "manual";
|
|
130
130
|
other: "other";
|
|
131
131
|
}>;
|
|
132
132
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -229,8 +229,10 @@ declare const transactionUpdateSchema: z.ZodObject<{
|
|
|
229
229
|
}, z.core.$strip>>>;
|
|
230
230
|
method: z.ZodOptional<z.ZodString>;
|
|
231
231
|
methodKind: z.ZodOptional<z.ZodEnum<{
|
|
232
|
-
|
|
232
|
+
manual: "manual";
|
|
233
233
|
bank_transfer: "bank_transfer";
|
|
234
|
+
cryptocurrency: "cryptocurrency";
|
|
235
|
+
card: "card";
|
|
234
236
|
instant_bank_transfer: "instant_bank_transfer";
|
|
235
237
|
direct_debit: "direct_debit";
|
|
236
238
|
wallet: "wallet";
|
|
@@ -239,8 +241,6 @@ declare const transactionUpdateSchema: z.ZodObject<{
|
|
|
239
241
|
gift_card: "gift_card";
|
|
240
242
|
cash: "cash";
|
|
241
243
|
cheque: "cheque";
|
|
242
|
-
cryptocurrency: "cryptocurrency";
|
|
243
|
-
manual: "manual";
|
|
244
244
|
other: "other";
|
|
245
245
|
}>>;
|
|
246
246
|
status: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
@@ -432,12 +432,12 @@ declare const settlementBaseSchema: z.ZodObject<{
|
|
|
432
432
|
}>;
|
|
433
433
|
status: z.ZodDefault<z.ZodString>;
|
|
434
434
|
payoutMethod: z.ZodEnum<{
|
|
435
|
-
check: "check";
|
|
436
|
-
bank_transfer: "bank_transfer";
|
|
437
435
|
manual: "manual";
|
|
436
|
+
bank_transfer: "bank_transfer";
|
|
438
437
|
mobile_wallet: "mobile_wallet";
|
|
439
438
|
platform_balance: "platform_balance";
|
|
440
439
|
crypto: "crypto";
|
|
440
|
+
check: "check";
|
|
441
441
|
}>;
|
|
442
442
|
amount: z.ZodNumber;
|
|
443
443
|
currency: z.ZodString;
|
|
@@ -496,12 +496,12 @@ declare const settlementCreateSchema: z.ZodObject<{
|
|
|
496
496
|
partner: "partner";
|
|
497
497
|
}>;
|
|
498
498
|
payoutMethod: z.ZodEnum<{
|
|
499
|
-
check: "check";
|
|
500
|
-
bank_transfer: "bank_transfer";
|
|
501
499
|
manual: "manual";
|
|
500
|
+
bank_transfer: "bank_transfer";
|
|
502
501
|
mobile_wallet: "mobile_wallet";
|
|
503
502
|
platform_balance: "platform_balance";
|
|
504
503
|
crypto: "crypto";
|
|
504
|
+
check: "check";
|
|
505
505
|
}>;
|
|
506
506
|
scheduledAt: z.ZodDefault<z.ZodCoercedDate<unknown>>;
|
|
507
507
|
notes: z.ZodOptional<z.ZodString>;
|
|
@@ -551,12 +551,12 @@ declare const settlementUpdateSchema: z.ZodObject<{
|
|
|
551
551
|
}>>;
|
|
552
552
|
status: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
553
553
|
payoutMethod: z.ZodOptional<z.ZodEnum<{
|
|
554
|
-
check: "check";
|
|
555
|
-
bank_transfer: "bank_transfer";
|
|
556
554
|
manual: "manual";
|
|
555
|
+
bank_transfer: "bank_transfer";
|
|
557
556
|
mobile_wallet: "mobile_wallet";
|
|
558
557
|
platform_balance: "platform_balance";
|
|
559
558
|
crypto: "crypto";
|
|
559
|
+
check: "check";
|
|
560
560
|
}>>;
|
|
561
561
|
amount: z.ZodOptional<z.ZodNumber>;
|
|
562
562
|
currency: z.ZodOptional<z.ZodString>;
|
|
@@ -618,8 +618,10 @@ declare const paymentIntentSchema: z.ZodObject<{
|
|
|
618
618
|
currency: z.ZodString;
|
|
619
619
|
gateway: z.ZodString;
|
|
620
620
|
methodKind: z.ZodEnum<{
|
|
621
|
-
|
|
621
|
+
manual: "manual";
|
|
622
622
|
bank_transfer: "bank_transfer";
|
|
623
|
+
cryptocurrency: "cryptocurrency";
|
|
624
|
+
card: "card";
|
|
623
625
|
instant_bank_transfer: "instant_bank_transfer";
|
|
624
626
|
direct_debit: "direct_debit";
|
|
625
627
|
wallet: "wallet";
|
|
@@ -628,8 +630,6 @@ declare const paymentIntentSchema: z.ZodObject<{
|
|
|
628
630
|
gift_card: "gift_card";
|
|
629
631
|
cash: "cash";
|
|
630
632
|
cheque: "cheque";
|
|
631
|
-
cryptocurrency: "cryptocurrency";
|
|
632
|
-
manual: "manual";
|
|
633
633
|
other: "other";
|
|
634
634
|
}>;
|
|
635
635
|
customerId: z.ZodOptional<z.ZodString>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PAYMENT_METHOD_KIND } from "@classytic/primitives/payment-method-kind";
|
|
2
|
+
import { CURRENCY_PATTERN } from "@classytic/primitives/currency";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
|
|
4
5
|
//#region src/validators/transaction.schema.ts
|
|
@@ -66,7 +67,7 @@ const transactionBaseSchema = z.object({
|
|
|
66
67
|
flow: z.enum(["inflow", "outflow"]),
|
|
67
68
|
tags: z.array(z.string()).default([]),
|
|
68
69
|
amount: z.number().int().min(0),
|
|
69
|
-
currency: z.string().
|
|
70
|
+
currency: z.string().regex(CURRENCY_PATTERN, "ISO 4217 (3 uppercase letters)"),
|
|
70
71
|
fee: z.number().int().default(0),
|
|
71
72
|
tax: z.number().int().default(0),
|
|
72
73
|
net: z.number().int().default(0),
|
|
@@ -137,7 +138,7 @@ const subscriptionBaseSchema = z.object({
|
|
|
137
138
|
customerId: z.string().nullish(),
|
|
138
139
|
planKey: z.string(),
|
|
139
140
|
amount: z.number().int().min(0),
|
|
140
|
-
currency: z.string().
|
|
141
|
+
currency: z.string().regex(CURRENCY_PATTERN, "ISO 4217 (3 uppercase letters)").optional(),
|
|
141
142
|
status: z.string().default("pending"),
|
|
142
143
|
isActive: z.boolean().default(false),
|
|
143
144
|
transactionId: z.string().nullish(),
|
|
@@ -204,7 +205,7 @@ const settlementBaseSchema = z.object({
|
|
|
204
205
|
"manual"
|
|
205
206
|
]),
|
|
206
207
|
amount: z.number().int().min(0),
|
|
207
|
-
currency: z.string().
|
|
208
|
+
currency: z.string().regex(CURRENCY_PATTERN, "ISO 4217 (3 uppercase letters)"),
|
|
208
209
|
sourceTransactionIds: z.array(z.string()).default([]),
|
|
209
210
|
sourceSplitIds: z.array(z.string()).default([]),
|
|
210
211
|
bankTransferDetails: z.object({
|
|
@@ -271,7 +272,7 @@ const settlementListFilterSchema = z.object({
|
|
|
271
272
|
const PAYMENT_METHOD_KIND_VALUES = Object.values(PAYMENT_METHOD_KIND);
|
|
272
273
|
const paymentIntentSchema = z.object({
|
|
273
274
|
amount: z.number().int().min(1),
|
|
274
|
-
currency: z.string().
|
|
275
|
+
currency: z.string().regex(CURRENCY_PATTERN, "ISO 4217 (3 uppercase letters)"),
|
|
275
276
|
gateway: z.string(),
|
|
276
277
|
methodKind: z.enum(PAYMENT_METHOD_KIND_VALUES),
|
|
277
278
|
customerId: z.string().optional(),
|
package/dist/events/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as TransactionJournalizedPayload, A as SettlementCreated, B as SubscriptionCancelled, C as PurchaseCreated, D as RevenueEventSchema, E as RevenueEventPayloadOf, F as SettlementProcessingPayload, G as SubscriptionPausedPayload, H as SubscriptionCreated, I as SettlementScheduled, J as SubscriptionResumed, K as SubscriptionRenewed, L as SettlementScheduledPayload, M as SettlementFailed, N as SettlementFailedPayload, O as SettlementCompleted, P as SettlementProcessing, Q as TransactionJournalized, R as SubscriptionActivated, S as PaymentVerifiedPayload, T as RevenueEventDefinition, U as SubscriptionCreatedPayload, V as SubscriptionCancelledPayload, W as SubscriptionPaused, X as TransactionImported, Y as SubscriptionResumedPayload, Z as TransactionImportedPayload, _ as PaymentRefunded, _t as InProcessRevenueBusOptions, a as EscrowReleased, at as TransactionRemovedByFeedPayload, b as PaymentRequiresActionPayload, c as EscrowSplitPayload, ct as TransactionUpdated, d as MonetizationCreated, dt as WebhookProcessedPayload, et as TransactionMatched, f as MonetizationCreatedPayload, ft as revenueEventDefinitions, g as PaymentProcessingPayload, gt as InProcessRevenueBus, h as PaymentProcessing, ht as createEvent, i as EscrowHeldPayload, it as TransactionRemovedByFeed, j as SettlementCreatedPayload, k as SettlementCompletedPayload, l as FreeCreated, lt as TransactionUpdatedPayload, m as PaymentFailedPayload, mt as RevenueEventName, n as EscrowCancelledPayload, nt as TransactionRejected, o as EscrowReleasedPayload, ot as TransactionUnmatched, p as PaymentFailed, pt as REVENUE_EVENTS, q as SubscriptionRenewedPayload, r as EscrowHeld, rt as TransactionRejectedPayload, s as EscrowSplit, st as TransactionUnmatchedPayload, t as EscrowCancelled, tt as TransactionMatchedPayload, u as FreeCreatedPayload, ut as WebhookProcessed, v as PaymentRefundedPayload, w as PurchaseCreatedPayload, x as PaymentVerified, y as PaymentRequiresAction, z as SubscriptionActivatedPayload } from "../revenue-event-catalog-
|
|
1
|
+
import { $ as TransactionJournalizedPayload, A as SettlementCreated, B as SubscriptionCancelled, C as PurchaseCreated, D as RevenueEventSchema, E as RevenueEventPayloadOf, F as SettlementProcessingPayload, G as SubscriptionPausedPayload, H as SubscriptionCreated, I as SettlementScheduled, J as SubscriptionResumed, K as SubscriptionRenewed, L as SettlementScheduledPayload, M as SettlementFailed, N as SettlementFailedPayload, O as SettlementCompleted, P as SettlementProcessing, Q as TransactionJournalized, R as SubscriptionActivated, S as PaymentVerifiedPayload, T as RevenueEventDefinition, U as SubscriptionCreatedPayload, V as SubscriptionCancelledPayload, W as SubscriptionPaused, X as TransactionImported, Y as SubscriptionResumedPayload, Z as TransactionImportedPayload, _ as PaymentRefunded, _t as InProcessRevenueBusOptions, a as EscrowReleased, at as TransactionRemovedByFeedPayload, b as PaymentRequiresActionPayload, c as EscrowSplitPayload, ct as TransactionUpdated, d as MonetizationCreated, dt as WebhookProcessedPayload, et as TransactionMatched, f as MonetizationCreatedPayload, ft as revenueEventDefinitions, g as PaymentProcessingPayload, gt as InProcessRevenueBus, h as PaymentProcessing, ht as createEvent, i as EscrowHeldPayload, it as TransactionRemovedByFeed, j as SettlementCreatedPayload, k as SettlementCompletedPayload, l as FreeCreated, lt as TransactionUpdatedPayload, m as PaymentFailedPayload, mt as RevenueEventName, n as EscrowCancelledPayload, nt as TransactionRejected, o as EscrowReleasedPayload, ot as TransactionUnmatched, p as PaymentFailed, pt as REVENUE_EVENTS, q as SubscriptionRenewedPayload, r as EscrowHeld, rt as TransactionRejectedPayload, s as EscrowSplit, st as TransactionUnmatchedPayload, t as EscrowCancelled, tt as TransactionMatchedPayload, u as FreeCreatedPayload, ut as WebhookProcessed, v as PaymentRefundedPayload, w as PurchaseCreatedPayload, x as PaymentVerified, y as PaymentRequiresAction, z as SubscriptionActivatedPayload } from "../revenue-event-catalog-BU_KYN2-.mjs";
|
|
2
2
|
import { DomainEvent, EventHandler, EventTransport } from "@classytic/primitives/events";
|
|
3
3
|
export { type DomainEvent, EscrowCancelled, type EscrowCancelledPayload, EscrowHeld, type EscrowHeldPayload, EscrowReleased, type EscrowReleasedPayload, EscrowSplit, type EscrowSplitPayload, type EventHandler, type EventTransport, FreeCreated, type FreeCreatedPayload, InProcessRevenueBus, type InProcessRevenueBusOptions, MonetizationCreated, type MonetizationCreatedPayload, PaymentFailed, type PaymentFailedPayload, PaymentProcessing, type PaymentProcessingPayload, PaymentRefunded, type PaymentRefundedPayload, PaymentRequiresAction, type PaymentRequiresActionPayload, PaymentVerified, type PaymentVerifiedPayload, PurchaseCreated, type PurchaseCreatedPayload, REVENUE_EVENTS, type RevenueEventDefinition, type RevenueEventName, type RevenueEventPayloadOf, type RevenueEventSchema, SettlementCompleted, type SettlementCompletedPayload, SettlementCreated, type SettlementCreatedPayload, SettlementFailed, type SettlementFailedPayload, SettlementProcessing, type SettlementProcessingPayload, SettlementScheduled, type SettlementScheduledPayload, SubscriptionActivated, type SubscriptionActivatedPayload, SubscriptionCancelled, type SubscriptionCancelledPayload, SubscriptionCreated, type SubscriptionCreatedPayload, SubscriptionPaused, type SubscriptionPausedPayload, SubscriptionRenewed, type SubscriptionRenewedPayload, SubscriptionResumed, type SubscriptionResumedPayload, TransactionImported, type TransactionImportedPayload, TransactionJournalized, type TransactionJournalizedPayload, TransactionMatched, type TransactionMatchedPayload, TransactionRejected, type TransactionRejectedPayload, TransactionRemovedByFeed, type TransactionRemovedByFeedPayload, TransactionUnmatched, type TransactionUnmatchedPayload, TransactionUpdated, type TransactionUpdatedPayload, WebhookProcessed, type WebhookProcessedPayload, createEvent, revenueEventDefinitions };
|
package/dist/events/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as createEvent, t as REVENUE_EVENTS } from "../event-constants-
|
|
2
|
-
import { A as TransactionUpdated, C as SubscriptionResumed, D as TransactionRejected, E as TransactionMatched, M as revenueEventDefinitions, N as InProcessRevenueBus, O as TransactionRemovedByFeed, S as SubscriptionRenewed, T as TransactionJournalized, _ as SettlementScheduled, a as FreeCreated, b as SubscriptionCreated, c as PaymentProcessing, d as PaymentVerified, f as PurchaseCreated, g as SettlementProcessing, h as SettlementFailed, i as EscrowSplit, j as WebhookProcessed, k as TransactionUnmatched, l as PaymentRefunded, m as SettlementCreated, n as EscrowHeld, o as MonetizationCreated, p as SettlementCompleted, r as EscrowReleased, s as PaymentFailed, t as EscrowCancelled, u as PaymentRequiresAction, v as SubscriptionActivated, w as TransactionImported, x as SubscriptionPaused, y as SubscriptionCancelled } from "../revenue-event-catalog-
|
|
1
|
+
import { n as createEvent, t as REVENUE_EVENTS } from "../event-constants-CPmh2sIt.mjs";
|
|
2
|
+
import { A as TransactionUpdated, C as SubscriptionResumed, D as TransactionRejected, E as TransactionMatched, M as revenueEventDefinitions, N as InProcessRevenueBus, O as TransactionRemovedByFeed, S as SubscriptionRenewed, T as TransactionJournalized, _ as SettlementScheduled, a as FreeCreated, b as SubscriptionCreated, c as PaymentProcessing, d as PaymentVerified, f as PurchaseCreated, g as SettlementProcessing, h as SettlementFailed, i as EscrowSplit, j as WebhookProcessed, k as TransactionUnmatched, l as PaymentRefunded, m as SettlementCreated, n as EscrowHeld, o as MonetizationCreated, p as SettlementCompleted, r as EscrowReleased, s as PaymentFailed, t as EscrowCancelled, u as PaymentRequiresAction, v as SubscriptionActivated, w as TransactionImported, x as SubscriptionPaused, y as SubscriptionCancelled } from "../revenue-event-catalog-DQXCuS-l.mjs";
|
|
3
3
|
|
|
4
4
|
export { EscrowCancelled, EscrowHeld, EscrowReleased, EscrowSplit, FreeCreated, InProcessRevenueBus, MonetizationCreated, PaymentFailed, PaymentProcessing, PaymentRefunded, PaymentRequiresAction, PaymentVerified, PurchaseCreated, REVENUE_EVENTS, SettlementCompleted, SettlementCreated, SettlementFailed, SettlementProcessing, SettlementScheduled, SubscriptionActivated, SubscriptionCancelled, SubscriptionCreated, SubscriptionPaused, SubscriptionRenewed, SubscriptionResumed, TransactionImported, TransactionJournalized, TransactionMatched, TransactionRejected, TransactionRemovedByFeed, TransactionUnmatched, TransactionUpdated, WebhookProcessed, createEvent, revenueEventDefinitions };
|
package/dist/index.d.mts
CHANGED
|
@@ -4,12 +4,12 @@ import { A as SettlementStatus, B as HoldReason, C as isPayoutMethod, D as SETTL
|
|
|
4
4
|
import { A as isTransactionFlow, C as TRANSACTION_STATUS, D as TransactionStatus, E as TransactionFlowValue, O as TransactionStatusValue, S as TRANSACTION_FLOW_VALUES, T as TransactionFlow, _ as LIBRARY_CATEGORIES, a as BankFeedSourceValue, b as LibraryCategoryValue, c as TRANSACTION_KIND_VALUES, d as initialStatusFor, f as isBankFeedSource, g as statusesForKind, h as isTransactionKind, i as BANK_FEED_STATUS_VALUES, j as isTransactionStatus, k as isLibraryCategory, l as TransactionKind, m as isStatusValidForKind, n as BANK_FEED_SOURCE_VALUES, o as BankFeedStatusValue, p as isBankFeedStatus, r as BANK_FEED_STATUS, s as TRANSACTION_KIND, t as BANK_FEED_SOURCE, u as TransactionKindValue, v as LIBRARY_CATEGORY_VALUES, w as TRANSACTION_STATUS_VALUES, x as TRANSACTION_FLOW, y as LibraryCategories } from "./bank-feed.enums-CqTW2Blz.mjs";
|
|
5
5
|
import { BANK_FEED_STATE_MACHINE, HOLD_STATE_MACHINE, MANUAL_STATE_MACHINE, PAYMENT_FLOW_STATE_MACHINE, SETTLEMENT_STATE_MACHINE, SPLIT_STATE_MACHINE, SUBSCRIPTION_STATE_MACHINE, StateChangeEvent, StateMachine, TRANSACTION_STATE_MACHINE, smFor } from "./core/state-machines.mjs";
|
|
6
6
|
import { a as isMonetizationType, c as PAYMENT_STATUS, d as PaymentGatewayTypeValue, f as PaymentStatus, h as isPaymentStatus, i as MonetizationTypes, l as PAYMENT_STATUS_VALUES, m as isPaymentGatewayType, n as MONETIZATION_TYPE_VALUES, o as PAYMENT_GATEWAY_TYPE, p as PaymentStatusValue, r as MonetizationTypeValue, s as PAYMENT_GATEWAY_TYPE_VALUES, t as MONETIZATION_TYPES, u as PaymentGatewayType } from "./monetization.enums-DzAI4sT7.mjs";
|
|
7
|
-
import { D as RevenueEventSchema, E as RevenueEventPayloadOf, T as RevenueEventDefinition, _t as InProcessRevenueBusOptions, ft as revenueEventDefinitions, gt as InProcessRevenueBus, ht as createEvent, mt as RevenueEventName, pt as REVENUE_EVENTS } from "./revenue-event-catalog-
|
|
7
|
+
import { D as RevenueEventSchema, E as RevenueEventPayloadOf, T as RevenueEventDefinition, _t as InProcessRevenueBusOptions, ft as revenueEventDefinitions, gt as InProcessRevenueBus, ht as createEvent, mt as RevenueEventName, pt as REVENUE_EVENTS } from "./revenue-event-catalog-BU_KYN2-.mjs";
|
|
8
8
|
import { a as BankFeedProviderRegistry, c as ParseUploadParams, d as PaymentProvider, i as BankFeedProviderCapabilities, l as ParseUploadResult, n as createProviderRegistry, o as FetchTransactionsParams, r as BankFeedProvider, s as FetchTransactionsResult, t as ProviderRegistry, u as createBankFeedProviderRegistry } from "./registry-DSG7x-Cl.mjs";
|
|
9
|
-
import { a as RevenueConfig, c as
|
|
9
|
+
import { _ as TransactionDocument, a as RevenueConfig, c as RecipientBreakdown, d as SubscriptionRepository, f as TransactionRepository, g as SubscriptionDocument, h as SettlementDocument, i as RetryConfig, l as SettlementRepository, m as RevenueSchemaOptions, n as BankFeedModuleConfig, o as RevenueEngine, p as RevenueModels, r as CommissionConfig, s as RecipientBalance, t as BankFeedIndexConfig, u as SettlementSummary } from "./engine-types-D6ijamqA.mjs";
|
|
10
10
|
import { RepositoryPluginBundle, RevenueRepositories } from "./repositories/create-repositories.mjs";
|
|
11
|
-
import { A as transactionBaseSchema, C as subscriptionBaseSchema, D as TransactionCreateInput, E as subscriptionUpdateSchema, M as transactionListFilterSchema, N as transactionUpdateSchema, O as TransactionListFilter, S as SubscriptionUpdateInput, T as subscriptionListFilterSchema, _ as settlementCreateSchema, a as escrowReleaseSchema, b as SubscriptionCreateInput, c as PaymentVerifyInput, d as paymentVerifySchema, f as refundSchema, g as settlementBaseSchema, h as SettlementUpdateInput, i as escrowHoldSchema, j as transactionCreateSchema, k as TransactionUpdateInput, l as RefundInput, m as SettlementListFilter, n as EscrowReleaseInput, o as splitRuleSchema, p as SettlementCreateInput, r as SplitRuleInput, s as PaymentIntentInput, t as EscrowHoldInput, u as paymentIntentSchema, v as settlementListFilterSchema, w as subscriptionCreateSchema, x as SubscriptionListFilter, y as settlementUpdateSchema } from "./escrow.schema-
|
|
12
|
-
import { A as SplitInfo, B as
|
|
11
|
+
import { A as transactionBaseSchema, C as subscriptionBaseSchema, D as TransactionCreateInput, E as subscriptionUpdateSchema, M as transactionListFilterSchema, N as transactionUpdateSchema, O as TransactionListFilter, S as SubscriptionUpdateInput, T as subscriptionListFilterSchema, _ as settlementCreateSchema, a as escrowReleaseSchema, b as SubscriptionCreateInput, c as PaymentVerifyInput, d as paymentVerifySchema, f as refundSchema, g as settlementBaseSchema, h as SettlementUpdateInput, i as escrowHoldSchema, j as transactionCreateSchema, k as TransactionUpdateInput, l as RefundInput, m as SettlementListFilter, n as EscrowReleaseInput, o as splitRuleSchema, p as SettlementCreateInput, r as SplitRuleInput, s as PaymentIntentInput, t as EscrowHoldInput, u as paymentIntentSchema, v as settlementListFilterSchema, w as subscriptionCreateSchema, x as SubscriptionListFilter, y as settlementUpdateSchema } from "./escrow.schema-DSx7EywJ.mjs";
|
|
12
|
+
import { A as SplitInfo, B as reverseTax, C as multiplyMoney, D as toCurrencyCode, E as sumMoney, F as TaxCalculation, H as CommissionInfo, I as TaxConfig, L as TaxType, M as calculateOrganizationPayout, N as calculateSplits, O as toMajor, R as calculateTax, S as money, T as subtractMoney, U as calculateCommission, V as validateTaxCalculation, W as reverseCommission, _ as isMoney, a as CurrencyCode, b as isZeroMoney, c as Money, d as addMoney, f as compareMoney, g as isCurrencyCode, h as fromSmallestUnit, i as CURRENCIES, j as SplitRule, k as toSmallestUnit, l as MoneyValue, m as fromMajor, n as getAuditTrail, o as CurrencyMismatchError, p as equalsMoney, r as getLastStateChange, s as MINOR_UNIT_FACTOR, t as appendAuditEvent, u as absMoney, v as isNegativeMoney, w as negateMoney, x as minorUnitFactor, y as isPositiveMoney, z as getTaxType } from "./audit-Cug6g_31.mjs";
|
|
13
13
|
import { HookHandler, PluginContext, PluginManager, RevenuePluginDefinition } from "./plugins/plugin.interface.mjs";
|
|
14
14
|
import { DomainEvent, DomainEvent as DomainEvent$1, EventHandler, EventTransport } from "@classytic/primitives/events";
|
|
15
15
|
import { InvalidOutboxEventError, OutboxAcknowledgeOptions, OutboxAcknowledgeOptions as OutboxAcknowledgeOptions$1, OutboxClaimOptions, OutboxErrorInfo, OutboxFailOptions, OutboxFailureContext, OutboxFailureDecision, OutboxFailurePolicy, OutboxOwnershipError, OutboxStore, OutboxStore as OutboxStore$1, OutboxWriteOptions, OutboxWriteOptions as OutboxWriteOptions$1 } from "@classytic/primitives/outbox";
|
|
@@ -60,6 +60,14 @@ declare class RevenueError extends Error {
|
|
|
60
60
|
|
|
61
61
|
httpStatus?: number | undefined);
|
|
62
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Thrown when a host passes ctx.session but NO outbox is wired —
|
|
65
|
+
* publishing mid-transaction leaks ghost events on rollback (§P8.1).
|
|
66
|
+
* Session + outbox is legal durable-relay-only mode.
|
|
67
|
+
*/
|
|
68
|
+
declare class UnmanagedSessionError extends RevenueError {
|
|
69
|
+
constructor();
|
|
70
|
+
}
|
|
63
71
|
declare class ValidationError extends RevenueError {
|
|
64
72
|
constructor(message: string, details?: Record<string, unknown>);
|
|
65
73
|
}
|
|
@@ -115,4 +123,4 @@ declare class BankFeedProviderNotFoundError extends RevenueError {
|
|
|
115
123
|
constructor(providerName: string);
|
|
116
124
|
}
|
|
117
125
|
//#endregion
|
|
118
|
-
export { AlreadyVerifiedError, type AnalyticsBridge, BANK_FEED_SOURCE, BANK_FEED_SOURCE_VALUES, BANK_FEED_STATE_MACHINE, BANK_FEED_STATUS, BANK_FEED_STATUS_VALUES, BankFeedImportError, type BankFeedIndexConfig, type BankFeedModuleConfig, BankFeedProvider, type BankFeedProviderCapabilities, BankFeedProviderNotFoundError, BankFeedProviderRegistry, BankFeedSourceValue, BankFeedStatusValue, CURRENCIES, type CommissionConfig, type CommissionInfo, ConfigurationError, type CurrencyBridge, type CurrencyCode, CurrencyMismatchError, type CustomerBridge, type DomainEvent, EscrowHoldInput, EscrowReleaseInput, type EventHandler, type EventTransport, type FetchTransactionsParams, type FetchTransactionsResult, HOLD_REASON, HOLD_REASON_VALUES, HOLD_STATE_MACHINE, HOLD_STATUS, HOLD_STATUS_VALUES, HoldReason, HoldReasonValue, HoldStatus, HoldStatusValue, type HookHandler, InProcessRevenueBus, type InProcessRevenueBusOptions, InvalidOutboxEventError, InvalidStateTransitionError, LIBRARY_CATEGORIES, LIBRARY_CATEGORY_VALUES, type LedgerBridge, LibraryCategories, LibraryCategoryValue, MANUAL_STATE_MACHINE, MINOR_UNIT_FACTOR, MONETIZATION_TYPES, MONETIZATION_TYPE_VALUES, MemoryOutboxStore, MethodKindLockedError, MonetizationTypeValue, MonetizationTypes, type Money, type MoneyValue, type NotificationBridge, type OutboxAcknowledgeOptions, type OutboxClaimOptions, type OutboxErrorInfo, type OutboxFailOptions, type OutboxFailureContext, type OutboxFailureDecision, type OutboxFailurePolicy, OutboxOwnershipError, type OutboxStore, type OutboxWriteOptions, PAYMENT_FLOW_STATE_MACHINE, PAYMENT_GATEWAY_TYPE, PAYMENT_GATEWAY_TYPE_VALUES, PAYMENT_STATUS, PAYMENT_STATUS_VALUES, PAYOUT_METHOD, PAYOUT_METHOD_VALUES, PLAN_KEYS, PLAN_KEY_VALUES, type ParseUploadParams, type ParseUploadResult, PaymentGatewayType, PaymentGatewayTypeValue, PaymentIntentCreationError, PaymentIntentInput, PaymentProvider, PaymentStatus, PaymentStatusValue, PaymentVerificationError, PaymentVerifyInput, PayoutMethod, PayoutMethodValue, PlanKeyValue, PlanKeys, type PluginContext, PluginManager, ProviderCapabilityError, ProviderNotFoundError, ProviderRegistry, RELEASE_REASON, RELEASE_REASON_VALUES, REVENUE_EVENTS, type RecipientBalance, RefundInput, RefundNotSupportedError, ReleaseReason, ReleaseReasonValue, type RepositoryPluginBundle, type Result, type RetryConfig, type RevenueBridges, type RevenueConfig, type RevenueContext, type RevenueEngine, RevenueError, type RevenueEventDefinition, type RevenueEventName, type RevenueEventPayloadOf, type RevenueEventSchema, type RevenueModels, type RevenuePluginDefinition, type RevenueRepositories, type RevenueSchemaOptions, SETTLEMENT_STATE_MACHINE, SETTLEMENT_STATUS, SETTLEMENT_STATUS_VALUES, SETTLEMENT_TYPE, SETTLEMENT_TYPE_VALUES, SPLIT_STATE_MACHINE, SPLIT_STATUS, SPLIT_STATUS_VALUES, SPLIT_TYPE, SPLIT_TYPE_VALUES, SUBSCRIPTION_STATE_MACHINE, SUBSCRIPTION_STATUS, SUBSCRIPTION_STATUS_VALUES, SettlementCreateInput, type SettlementDocument, SettlementListFilter, SettlementNotFoundError, SettlementRepository, SettlementStatus, SettlementStatusValue, SettlementType, SettlementTypeValue, SettlementUpdateInput, type SplitInfo, type SplitRule, SplitRuleInput, SplitStatus, SplitStatusValue, SplitType, SplitTypeValue, type StateChangeEvent, StateMachine, SubscriptionCreateInput, type SubscriptionDocument, SubscriptionListFilter, SubscriptionNotFoundError, SubscriptionRepository, SubscriptionStatus, SubscriptionStatusValue, SubscriptionUpdateInput, TRANSACTION_FLOW, TRANSACTION_FLOW_VALUES, TRANSACTION_KIND, TRANSACTION_KIND_VALUES, TRANSACTION_STATE_MACHINE, TRANSACTION_STATUS, TRANSACTION_STATUS_VALUES, type TaxBridge, type TaxCalculation, type TaxConfig, type TaxType, TransactionCreateInput, type TransactionDocument, TransactionFlow, TransactionFlowValue, TransactionKind, TransactionKindValue, TransactionListFilter, TransactionNotFoundError, TransactionRepository, TransactionStatus, TransactionStatusValue, TransactionUpdateInput, ValidationError, WrongTransactionKindError, absMoney, addMoney, appendAuditEvent, calculateCommission, calculateOrganizationPayout, calculateSplits, calculateTax, compareMoney, createBankFeedProviderRegistry, createEvent, createProviderRegistry, createRevenue, equalsMoney, err, escrowHoldSchema, escrowReleaseSchema, fromMajor, fromSmallestUnit, getAuditTrail, getLastStateChange, getTaxType, initialStatusFor, isBankFeedSource, isBankFeedStatus, isCurrencyCode, isErr, isHoldReason, isHoldStatus, isLibraryCategory, isMonetizationType, isMoney, isNegativeMoney, isOk, isPaymentGatewayType, isPaymentStatus, isPayoutMethod, isPlanKey, isPositiveMoney, isReleaseReason, isSettlementStatus, isSettlementType, isSplitStatus, isSplitType, isStatusValidForKind, isSubscriptionStatus, isTransactionFlow, isTransactionKind, isTransactionStatus, isZeroMoney, minorUnitFactor, money, multiplyMoney, negateMoney, ok, paymentIntentSchema, paymentVerifySchema, refundSchema, revenueEventDefinitions, reverseCommission, reverseTax, settlementBaseSchema, settlementCreateSchema, settlementListFilterSchema, settlementUpdateSchema, smFor, splitRuleSchema, statusesForKind, subscriptionBaseSchema, subscriptionCreateSchema, subscriptionListFilterSchema, subscriptionUpdateSchema, subtractMoney, sumMoney, toCurrencyCode, toMajor, toSmallestUnit, transactionBaseSchema, transactionCreateSchema, transactionListFilterSchema, transactionUpdateSchema, validateTaxCalculation };
|
|
126
|
+
export { AlreadyVerifiedError, type AnalyticsBridge, BANK_FEED_SOURCE, BANK_FEED_SOURCE_VALUES, BANK_FEED_STATE_MACHINE, BANK_FEED_STATUS, BANK_FEED_STATUS_VALUES, BankFeedImportError, type BankFeedIndexConfig, type BankFeedModuleConfig, BankFeedProvider, type BankFeedProviderCapabilities, BankFeedProviderNotFoundError, BankFeedProviderRegistry, BankFeedSourceValue, BankFeedStatusValue, CURRENCIES, type CommissionConfig, type CommissionInfo, ConfigurationError, type CurrencyBridge, type CurrencyCode, CurrencyMismatchError, type CustomerBridge, type DomainEvent, EscrowHoldInput, EscrowReleaseInput, type EventHandler, type EventTransport, type FetchTransactionsParams, type FetchTransactionsResult, HOLD_REASON, HOLD_REASON_VALUES, HOLD_STATE_MACHINE, HOLD_STATUS, HOLD_STATUS_VALUES, HoldReason, HoldReasonValue, HoldStatus, HoldStatusValue, type HookHandler, InProcessRevenueBus, type InProcessRevenueBusOptions, InvalidOutboxEventError, InvalidStateTransitionError, LIBRARY_CATEGORIES, LIBRARY_CATEGORY_VALUES, type LedgerBridge, LibraryCategories, LibraryCategoryValue, MANUAL_STATE_MACHINE, MINOR_UNIT_FACTOR, MONETIZATION_TYPES, MONETIZATION_TYPE_VALUES, MemoryOutboxStore, MethodKindLockedError, MonetizationTypeValue, MonetizationTypes, type Money, type MoneyValue, type NotificationBridge, type OutboxAcknowledgeOptions, type OutboxClaimOptions, type OutboxErrorInfo, type OutboxFailOptions, type OutboxFailureContext, type OutboxFailureDecision, type OutboxFailurePolicy, OutboxOwnershipError, type OutboxStore, type OutboxWriteOptions, PAYMENT_FLOW_STATE_MACHINE, PAYMENT_GATEWAY_TYPE, PAYMENT_GATEWAY_TYPE_VALUES, PAYMENT_STATUS, PAYMENT_STATUS_VALUES, PAYOUT_METHOD, PAYOUT_METHOD_VALUES, PLAN_KEYS, PLAN_KEY_VALUES, type ParseUploadParams, type ParseUploadResult, PaymentGatewayType, PaymentGatewayTypeValue, PaymentIntentCreationError, PaymentIntentInput, PaymentProvider, PaymentStatus, PaymentStatusValue, PaymentVerificationError, PaymentVerifyInput, PayoutMethod, PayoutMethodValue, PlanKeyValue, PlanKeys, type PluginContext, PluginManager, ProviderCapabilityError, ProviderNotFoundError, ProviderRegistry, RELEASE_REASON, RELEASE_REASON_VALUES, REVENUE_EVENTS, type RecipientBalance, type RecipientBreakdown, RefundInput, RefundNotSupportedError, ReleaseReason, ReleaseReasonValue, type RepositoryPluginBundle, type Result, type RetryConfig, type RevenueBridges, type RevenueConfig, type RevenueContext, type RevenueEngine, RevenueError, type RevenueEventDefinition, type RevenueEventName, type RevenueEventPayloadOf, type RevenueEventSchema, type RevenueModels, type RevenuePluginDefinition, type RevenueRepositories, type RevenueSchemaOptions, SETTLEMENT_STATE_MACHINE, SETTLEMENT_STATUS, SETTLEMENT_STATUS_VALUES, SETTLEMENT_TYPE, SETTLEMENT_TYPE_VALUES, SPLIT_STATE_MACHINE, SPLIT_STATUS, SPLIT_STATUS_VALUES, SPLIT_TYPE, SPLIT_TYPE_VALUES, SUBSCRIPTION_STATE_MACHINE, SUBSCRIPTION_STATUS, SUBSCRIPTION_STATUS_VALUES, SettlementCreateInput, type SettlementDocument, SettlementListFilter, SettlementNotFoundError, SettlementRepository, SettlementStatus, SettlementStatusValue, type SettlementSummary, SettlementType, SettlementTypeValue, SettlementUpdateInput, type SplitInfo, type SplitRule, SplitRuleInput, SplitStatus, SplitStatusValue, SplitType, SplitTypeValue, type StateChangeEvent, StateMachine, SubscriptionCreateInput, type SubscriptionDocument, SubscriptionListFilter, SubscriptionNotFoundError, SubscriptionRepository, SubscriptionStatus, SubscriptionStatusValue, SubscriptionUpdateInput, TRANSACTION_FLOW, TRANSACTION_FLOW_VALUES, TRANSACTION_KIND, TRANSACTION_KIND_VALUES, TRANSACTION_STATE_MACHINE, TRANSACTION_STATUS, TRANSACTION_STATUS_VALUES, type TaxBridge, type TaxCalculation, type TaxConfig, type TaxType, TransactionCreateInput, type TransactionDocument, TransactionFlow, TransactionFlowValue, TransactionKind, TransactionKindValue, TransactionListFilter, TransactionNotFoundError, TransactionRepository, TransactionStatus, TransactionStatusValue, TransactionUpdateInput, UnmanagedSessionError, ValidationError, WrongTransactionKindError, absMoney, addMoney, appendAuditEvent, calculateCommission, calculateOrganizationPayout, calculateSplits, calculateTax, compareMoney, createBankFeedProviderRegistry, createEvent, createProviderRegistry, createRevenue, equalsMoney, err, escrowHoldSchema, escrowReleaseSchema, fromMajor, fromSmallestUnit, getAuditTrail, getLastStateChange, getTaxType, initialStatusFor, isBankFeedSource, isBankFeedStatus, isCurrencyCode, isErr, isHoldReason, isHoldStatus, isLibraryCategory, isMonetizationType, isMoney, isNegativeMoney, isOk, isPaymentGatewayType, isPaymentStatus, isPayoutMethod, isPlanKey, isPositiveMoney, isReleaseReason, isSettlementStatus, isSettlementType, isSplitStatus, isSplitType, isStatusValidForKind, isSubscriptionStatus, isTransactionFlow, isTransactionKind, isTransactionStatus, isZeroMoney, minorUnitFactor, money, multiplyMoney, negateMoney, ok, paymentIntentSchema, paymentVerifySchema, refundSchema, revenueEventDefinitions, reverseCommission, reverseTax, settlementBaseSchema, settlementCreateSchema, settlementListFilterSchema, settlementUpdateSchema, smFor, splitRuleSchema, statusesForKind, subscriptionBaseSchema, subscriptionCreateSchema, subscriptionListFilterSchema, subscriptionUpdateSchema, subtractMoney, sumMoney, toCurrencyCode, toMajor, toSmallestUnit, transactionBaseSchema, transactionCreateSchema, transactionListFilterSchema, transactionUpdateSchema, validateTaxCalculation };
|
package/dist/index.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { _ as TRANSACTION_STATUS, a as TRANSACTION_KIND, b as isTransactionFlow, c as isBankFeedSource, d as isTransactionKind, f as statusesForKind, g as TRANSACTION_FLOW_VALUES, h as TRANSACTION_FLOW, i as BANK_FEED_STATUS_VALUES, l as isBankFeedStatus, m as LIBRARY_CATEGORY_VALUES, n as BANK_FEED_SOURCE_VALUES, o as TRANSACTION_KIND_VALUES, p as LIBRARY_CATEGORIES, r as BANK_FEED_STATUS, s as initialStatusFor, t as BANK_FEED_SOURCE, u as isStatusValidForKind, v as TRANSACTION_STATUS_VALUES, x as isTransactionStatus, y as isLibraryCategory } from "./bank-feed.enums-ByS3mjX0.mjs";
|
|
2
|
-
import { n as
|
|
3
|
-
import { n as
|
|
4
|
-
import {
|
|
5
|
-
import { _ as
|
|
2
|
+
import { _ as ValidationError, a as InvalidStateTransitionError, c as PaymentVerificationError, d as RefundNotSupportedError, f as RevenueError, g as UnmanagedSessionError, h as TransactionNotFoundError, i as ConfigurationError, l as ProviderCapabilityError, m as SubscriptionNotFoundError, n as BankFeedImportError, o as MethodKindLockedError, p as SettlementNotFoundError, r as BankFeedProviderNotFoundError, s as PaymentIntentCreationError, t as AlreadyVerifiedError, u as ProviderNotFoundError, v as WrongTransactionKindError } from "./errors-8P5tRgV7.mjs";
|
|
3
|
+
import { n as SubscriptionRepository, r as TransactionRepository, t as SettlementRepository } from "./settlement.repository-KDKH2jcq.mjs";
|
|
4
|
+
import { n as createEvent, t as REVENUE_EVENTS } from "./event-constants-CPmh2sIt.mjs";
|
|
5
|
+
import { A as isReleaseReason, C as HOLD_REASON_VALUES, D as RELEASE_REASON_VALUES, E as RELEASE_REASON, O as isHoldReason, S as HOLD_REASON, T as HOLD_STATUS_VALUES, _ as SETTLEMENT_STATUS_VALUES, a as isPlanKey, b as isSettlementStatus, c as PAYOUT_METHOD_VALUES, d as SPLIT_TYPE, f as SPLIT_TYPE_VALUES, g as SETTLEMENT_STATUS, h as isSplitType, i as SUBSCRIPTION_STATUS_VALUES, k as isHoldStatus, l as SPLIT_STATUS, m as isSplitStatus, n as PLAN_KEY_VALUES, o as isSubscriptionStatus, p as isPayoutMethod, r as SUBSCRIPTION_STATUS, s as PAYOUT_METHOD, t as PLAN_KEYS, u as SPLIT_STATUS_VALUES, v as SETTLEMENT_TYPE, w as HOLD_STATUS, x as isSettlementType, y as SETTLEMENT_TYPE_VALUES } from "./subscription.enums-olW5dyly.mjs";
|
|
6
6
|
import { BANK_FEED_STATE_MACHINE, HOLD_STATE_MACHINE, MANUAL_STATE_MACHINE, PAYMENT_FLOW_STATE_MACHINE, SETTLEMENT_STATE_MACHINE, SPLIT_STATE_MACHINE, SUBSCRIPTION_STATE_MACHINE, StateMachine, TRANSACTION_STATE_MACHINE, smFor } from "./core/state-machines.mjs";
|
|
7
|
-
import { a as
|
|
7
|
+
import { a as getTaxType, c as calculateCommission, i as calculateTax, l as reverseCommission, n as calculateSplits, o as reverseTax, s as validateTaxCalculation, t as calculateOrganizationPayout } from "./splits-rs6mkdGN.mjs";
|
|
8
8
|
import { createRevenueRepositories } from "./repositories/create-repositories.mjs";
|
|
9
|
-
import { a as createProviderRegistry, i as ProviderRegistry, n as BankFeedProviderRegistry, o as PaymentProvider, r as createBankFeedProviderRegistry, t as BankFeedProvider } from "./bank-feed-
|
|
10
|
-
import { M as revenueEventDefinitions, N as InProcessRevenueBus } from "./revenue-event-catalog-
|
|
9
|
+
import { a as createProviderRegistry, i as ProviderRegistry, n as BankFeedProviderRegistry, o as PaymentProvider, r as createBankFeedProviderRegistry, t as BankFeedProvider } from "./bank-feed-yxrt4YpT.mjs";
|
|
10
|
+
import { M as revenueEventDefinitions, N as InProcessRevenueBus } from "./revenue-event-catalog-DQXCuS-l.mjs";
|
|
11
11
|
import { a as PAYMENT_GATEWAY_TYPE_VALUES, c as isPaymentGatewayType, i as PAYMENT_GATEWAY_TYPE, l as isPaymentStatus, n as MONETIZATION_TYPE_VALUES, o as PAYMENT_STATUS, r as isMonetizationType, s as PAYMENT_STATUS_VALUES, t as MONETIZATION_TYPES } from "./monetization.enums-B9HBOecd.mjs";
|
|
12
|
-
import { _ as transactionListFilterSchema, a as paymentVerifySchema, c as settlementCreateSchema, d as subscriptionBaseSchema, f as subscriptionCreateSchema, g as transactionCreateSchema, h as transactionBaseSchema, i as paymentIntentSchema, l as settlementListFilterSchema, m as subscriptionUpdateSchema, n as escrowReleaseSchema, o as refundSchema, p as subscriptionListFilterSchema, r as splitRuleSchema, s as settlementBaseSchema, t as escrowHoldSchema, u as settlementUpdateSchema, v as transactionUpdateSchema } from "./escrow.schema-
|
|
13
|
-
import { C as sumMoney, E as toSmallestUnit, S as subtractMoney, T as toMajor, _ as isZeroMoney, a as CurrencyMismatchError, b as multiplyMoney, c as addMoney, d as fromMajor, f as fromSmallestUnit, g as isPositiveMoney, h as isNegativeMoney, i as CURRENCIES, l as compareMoney, m as isMoney, n as getAuditTrail, o as MINOR_UNIT_FACTOR, p as isCurrencyCode, r as getLastStateChange, s as absMoney, t as appendAuditEvent, u as equalsMoney, v as minorUnitFactor, w as toCurrencyCode, x as negateMoney, y as money } from "./audit-
|
|
12
|
+
import { _ as transactionListFilterSchema, a as paymentVerifySchema, c as settlementCreateSchema, d as subscriptionBaseSchema, f as subscriptionCreateSchema, g as transactionCreateSchema, h as transactionBaseSchema, i as paymentIntentSchema, l as settlementListFilterSchema, m as subscriptionUpdateSchema, n as escrowReleaseSchema, o as refundSchema, p as subscriptionListFilterSchema, r as splitRuleSchema, s as settlementBaseSchema, t as escrowHoldSchema, u as settlementUpdateSchema, v as transactionUpdateSchema } from "./escrow.schema-gksK8F-W.mjs";
|
|
13
|
+
import { C as sumMoney, E as toSmallestUnit, S as subtractMoney, T as toMajor, _ as isZeroMoney, a as CurrencyMismatchError, b as multiplyMoney, c as addMoney, d as fromMajor, f as fromSmallestUnit, g as isPositiveMoney, h as isNegativeMoney, i as CURRENCIES, l as compareMoney, m as isMoney, n as getAuditTrail, o as MINOR_UNIT_FACTOR, p as isCurrencyCode, r as getLastStateChange, s as absMoney, t as appendAuditEvent, u as equalsMoney, v as minorUnitFactor, w as toCurrencyCode, x as negateMoney, y as money } from "./audit-C5c4LAf6.mjs";
|
|
14
14
|
import { PluginManager } from "./plugins/plugin.interface.mjs";
|
|
15
15
|
import { batchOperationsPlugin, customIdPlugin, methodRegistryPlugin, multiTenantPlugin, prefixedId, softDeletePlugin } from "@classytic/mongokit";
|
|
16
16
|
import { resolveTenantConfig } from "@classytic/repo-core/tenant";
|
|
@@ -601,4 +601,4 @@ var MemoryOutboxStore = class {
|
|
|
601
601
|
};
|
|
602
602
|
|
|
603
603
|
//#endregion
|
|
604
|
-
export { AlreadyVerifiedError, BANK_FEED_SOURCE, BANK_FEED_SOURCE_VALUES, BANK_FEED_STATE_MACHINE, BANK_FEED_STATUS, BANK_FEED_STATUS_VALUES, BankFeedImportError, BankFeedProvider, BankFeedProviderNotFoundError, BankFeedProviderRegistry, CURRENCIES, ConfigurationError, CurrencyMismatchError, HOLD_REASON, HOLD_REASON_VALUES, HOLD_STATE_MACHINE, HOLD_STATUS, HOLD_STATUS_VALUES, InProcessRevenueBus, InvalidOutboxEventError, InvalidStateTransitionError, LIBRARY_CATEGORIES, LIBRARY_CATEGORY_VALUES, MANUAL_STATE_MACHINE, MINOR_UNIT_FACTOR, MONETIZATION_TYPES, MONETIZATION_TYPE_VALUES, MemoryOutboxStore, MethodKindLockedError, OutboxOwnershipError, PAYMENT_FLOW_STATE_MACHINE, PAYMENT_GATEWAY_TYPE, PAYMENT_GATEWAY_TYPE_VALUES, PAYMENT_STATUS, PAYMENT_STATUS_VALUES, PAYOUT_METHOD, PAYOUT_METHOD_VALUES, PLAN_KEYS, PLAN_KEY_VALUES, PaymentIntentCreationError, PaymentProvider, PaymentVerificationError, PluginManager, ProviderCapabilityError, ProviderNotFoundError, ProviderRegistry, RELEASE_REASON, RELEASE_REASON_VALUES, REVENUE_EVENTS, RefundNotSupportedError, RevenueError, SETTLEMENT_STATE_MACHINE, SETTLEMENT_STATUS, SETTLEMENT_STATUS_VALUES, SETTLEMENT_TYPE, SETTLEMENT_TYPE_VALUES, SPLIT_STATE_MACHINE, SPLIT_STATUS, SPLIT_STATUS_VALUES, SPLIT_TYPE, SPLIT_TYPE_VALUES, SUBSCRIPTION_STATE_MACHINE, SUBSCRIPTION_STATUS, SUBSCRIPTION_STATUS_VALUES, SettlementNotFoundError, SettlementRepository, StateMachine, SubscriptionNotFoundError, SubscriptionRepository, TRANSACTION_FLOW, TRANSACTION_FLOW_VALUES, TRANSACTION_KIND, TRANSACTION_KIND_VALUES, TRANSACTION_STATE_MACHINE, TRANSACTION_STATUS, TRANSACTION_STATUS_VALUES, TransactionNotFoundError, TransactionRepository, ValidationError, WrongTransactionKindError, absMoney, addMoney, appendAuditEvent, calculateCommission, calculateOrganizationPayout, calculateSplits, calculateTax, compareMoney, createBankFeedProviderRegistry, createEvent, createProviderRegistry, createRevenue, equalsMoney, err, escrowHoldSchema, escrowReleaseSchema, fromMajor, fromSmallestUnit, getAuditTrail, getLastStateChange, getTaxType, initialStatusFor, isBankFeedSource, isBankFeedStatus, isCurrencyCode, isErr, isHoldReason, isHoldStatus, isLibraryCategory, isMonetizationType, isMoney, isNegativeMoney, isOk, isPaymentGatewayType, isPaymentStatus, isPayoutMethod, isPlanKey, isPositiveMoney, isReleaseReason, isSettlementStatus, isSettlementType, isSplitStatus, isSplitType, isStatusValidForKind, isSubscriptionStatus, isTransactionFlow, isTransactionKind, isTransactionStatus, isZeroMoney, minorUnitFactor, money, multiplyMoney, negateMoney, ok, paymentIntentSchema, paymentVerifySchema, refundSchema, revenueEventDefinitions, reverseCommission, reverseTax, settlementBaseSchema, settlementCreateSchema, settlementListFilterSchema, settlementUpdateSchema, smFor, splitRuleSchema, statusesForKind, subscriptionBaseSchema, subscriptionCreateSchema, subscriptionListFilterSchema, subscriptionUpdateSchema, subtractMoney, sumMoney, toCurrencyCode, toMajor, toSmallestUnit, transactionBaseSchema, transactionCreateSchema, transactionListFilterSchema, transactionUpdateSchema, validateTaxCalculation };
|
|
604
|
+
export { AlreadyVerifiedError, BANK_FEED_SOURCE, BANK_FEED_SOURCE_VALUES, BANK_FEED_STATE_MACHINE, BANK_FEED_STATUS, BANK_FEED_STATUS_VALUES, BankFeedImportError, BankFeedProvider, BankFeedProviderNotFoundError, BankFeedProviderRegistry, CURRENCIES, ConfigurationError, CurrencyMismatchError, HOLD_REASON, HOLD_REASON_VALUES, HOLD_STATE_MACHINE, HOLD_STATUS, HOLD_STATUS_VALUES, InProcessRevenueBus, InvalidOutboxEventError, InvalidStateTransitionError, LIBRARY_CATEGORIES, LIBRARY_CATEGORY_VALUES, MANUAL_STATE_MACHINE, MINOR_UNIT_FACTOR, MONETIZATION_TYPES, MONETIZATION_TYPE_VALUES, MemoryOutboxStore, MethodKindLockedError, OutboxOwnershipError, PAYMENT_FLOW_STATE_MACHINE, PAYMENT_GATEWAY_TYPE, PAYMENT_GATEWAY_TYPE_VALUES, PAYMENT_STATUS, PAYMENT_STATUS_VALUES, PAYOUT_METHOD, PAYOUT_METHOD_VALUES, PLAN_KEYS, PLAN_KEY_VALUES, PaymentIntentCreationError, PaymentProvider, PaymentVerificationError, PluginManager, ProviderCapabilityError, ProviderNotFoundError, ProviderRegistry, RELEASE_REASON, RELEASE_REASON_VALUES, REVENUE_EVENTS, RefundNotSupportedError, RevenueError, SETTLEMENT_STATE_MACHINE, SETTLEMENT_STATUS, SETTLEMENT_STATUS_VALUES, SETTLEMENT_TYPE, SETTLEMENT_TYPE_VALUES, SPLIT_STATE_MACHINE, SPLIT_STATUS, SPLIT_STATUS_VALUES, SPLIT_TYPE, SPLIT_TYPE_VALUES, SUBSCRIPTION_STATE_MACHINE, SUBSCRIPTION_STATUS, SUBSCRIPTION_STATUS_VALUES, SettlementNotFoundError, SettlementRepository, StateMachine, SubscriptionNotFoundError, SubscriptionRepository, TRANSACTION_FLOW, TRANSACTION_FLOW_VALUES, TRANSACTION_KIND, TRANSACTION_KIND_VALUES, TRANSACTION_STATE_MACHINE, TRANSACTION_STATUS, TRANSACTION_STATUS_VALUES, TransactionNotFoundError, TransactionRepository, UnmanagedSessionError, ValidationError, WrongTransactionKindError, absMoney, addMoney, appendAuditEvent, calculateCommission, calculateOrganizationPayout, calculateSplits, calculateTax, compareMoney, createBankFeedProviderRegistry, createEvent, createProviderRegistry, createRevenue, equalsMoney, err, escrowHoldSchema, escrowReleaseSchema, fromMajor, fromSmallestUnit, getAuditTrail, getLastStateChange, getTaxType, initialStatusFor, isBankFeedSource, isBankFeedStatus, isCurrencyCode, isErr, isHoldReason, isHoldStatus, isLibraryCategory, isMonetizationType, isMoney, isNegativeMoney, isOk, isPaymentGatewayType, isPaymentStatus, isPayoutMethod, isPlanKey, isPositiveMoney, isReleaseReason, isSettlementStatus, isSettlementType, isSplitStatus, isSplitType, isStatusValidForKind, isSubscriptionStatus, isTransactionFlow, isTransactionKind, isTransactionStatus, isZeroMoney, minorUnitFactor, money, multiplyMoney, negateMoney, ok, paymentIntentSchema, paymentVerifySchema, refundSchema, revenueEventDefinitions, reverseCommission, reverseTax, settlementBaseSchema, settlementCreateSchema, settlementListFilterSchema, settlementUpdateSchema, smFor, splitRuleSchema, statusesForKind, subscriptionBaseSchema, subscriptionCreateSchema, subscriptionListFilterSchema, subscriptionUpdateSchema, subtractMoney, sumMoney, toCurrencyCode, toMajor, toSmallestUnit, transactionBaseSchema, transactionCreateSchema, transactionListFilterSchema, transactionUpdateSchema, validateTaxCalculation };
|
package/dist/providers/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as createProviderRegistry, i as ProviderRegistry, n as BankFeedProviderRegistry, o as PaymentProvider, r as createBankFeedProviderRegistry, t as BankFeedProvider } from "../bank-feed-
|
|
1
|
+
import { a as createProviderRegistry, i as ProviderRegistry, n as BankFeedProviderRegistry, o as PaymentProvider, r as createBankFeedProviderRegistry, t as BankFeedProvider } from "../bank-feed-yxrt4YpT.mjs";
|
|
2
2
|
|
|
3
3
|
export { BankFeedProvider, BankFeedProviderRegistry, PaymentProvider, ProviderRegistry, createBankFeedProviderRegistry, createProviderRegistry };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { d as SubscriptionRepository, f as TransactionRepository, l as SettlementRepository, p as RevenueModels } from "../engine-types-D6ijamqA.mjs";
|
|
2
2
|
import { PluginType } from "@classytic/mongokit";
|
|
3
3
|
|
|
4
4
|
//#region src/repositories/create-repositories.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as SubscriptionRepository, r as TransactionRepository, t as SettlementRepository } from "../settlement.repository-
|
|
1
|
+
import { n as SubscriptionRepository, r as TransactionRepository, t as SettlementRepository } from "../settlement.repository-KDKH2jcq.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/repositories/create-repositories.ts
|
|
4
4
|
function createRevenueRepositories(models, builtInPlugins, hostPlugins = {}) {
|