@classytic/revenue 2.4.0 → 2.5.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 +19 -0
- package/dist/{engine-types-BU8kkttr.d.mts → engine-types-F3f1lWNG.d.mts} +31 -2
- package/dist/{escrow.schema-Cklvlywy.d.mts → escrow.schema-o4qhjOca.d.mts} +54 -54
- package/dist/events/index.d.mts +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/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-BU_KYN2-.d.mts → revenue-event-catalog-j8Fh7Yag.d.mts} +126 -126
- package/dist/{settlement.repository-DtLSBDIk.mjs → settlement.repository-BDrJQc27.mjs} +48 -0
- package/dist/validators/index.d.mts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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
|
+
## [2.5.0]
|
|
7
|
+
|
|
8
|
+
### Added — `SettlementRepository.recipientBalance()` (the seller/creator "wallet")
|
|
9
|
+
|
|
10
|
+
`recipientBalance(recipientId, { recipientType?, currency? }, ctx)` returns a
|
|
11
|
+
recipient's payout balance bucketed by settlement status —
|
|
12
|
+
`{ pending, held, available, processing, paidOut, failed, lifetime, currency }`
|
|
13
|
+
in minor units. `pending` splits into `held` (escrowed — `scheduledAt` in the
|
|
14
|
+
future) and `available` (cleared — due now), so a marketplace can show "in
|
|
15
|
+
clearance" vs "ready to pay". One tenant-scoped `aggregatePipeline` over the
|
|
16
|
+
`{ recipientId, status }` index, so hosts stop hand-rolling a raw
|
|
17
|
+
`Model.aggregate` (which bypasses multi-tenant scope).
|
|
18
|
+
|
|
19
|
+
### Added — `processPending({ recipientId })` filter
|
|
20
|
+
|
|
21
|
+
`processPending` now accepts an optional `recipientId` so a host can pay out a
|
|
22
|
+
single seller/participant (gating each via their own KYC/eligibility check)
|
|
23
|
+
instead of only by organization.
|
|
24
|
+
|
|
6
25
|
## [2.4.0] - 2026-06-14
|
|
7
26
|
|
|
8
27
|
### Added — `settled` bank-feed/manual status + `settle()` / `unsettle()` verbs
|
|
@@ -922,6 +922,30 @@ interface SettlementProcessingError {
|
|
|
922
922
|
settlementId: SettlementDocument['_id'];
|
|
923
923
|
error: unknown;
|
|
924
924
|
}
|
|
925
|
+
/**
|
|
926
|
+
* A recipient's payout balance — the amounts the platform has scheduled,
|
|
927
|
+
* is processing, has paid, or failed to pay, in minor units. The "wallet"
|
|
928
|
+
* view a marketplace shows a seller/creator. Derived from settlement status;
|
|
929
|
+
* tenant-scoped.
|
|
930
|
+
*/
|
|
931
|
+
interface RecipientBalance {
|
|
932
|
+
recipientId: string;
|
|
933
|
+
currency: string | null;
|
|
934
|
+
/** Scheduled, awaiting payout (status: pending) = held + available. */
|
|
935
|
+
pending: number;
|
|
936
|
+
/** Pending but still in the clearance window (`scheduledAt` in the future) — escrowed, not yet payable. */
|
|
937
|
+
held: number;
|
|
938
|
+
/** Pending and due (`scheduledAt <= now`) — cleared, ready to pay out. */
|
|
939
|
+
available: number;
|
|
940
|
+
/** Payout in flight (status: processing). */
|
|
941
|
+
processing: number;
|
|
942
|
+
/** Paid out, lifetime (status: completed). */
|
|
943
|
+
paidOut: number;
|
|
944
|
+
/** Failed payouts (status: failed). */
|
|
945
|
+
failed: number;
|
|
946
|
+
/** pending + processing + paidOut — the total the platform has committed to this recipient. */
|
|
947
|
+
lifetime: number;
|
|
948
|
+
}
|
|
925
949
|
/**
|
|
926
950
|
* SettlementRepository — payouts to recipients (organizations, vendors,
|
|
927
951
|
* affiliates).
|
|
@@ -962,7 +986,8 @@ declare class SettlementRepository extends RevenueRepositoryBase<SettlementDocum
|
|
|
962
986
|
processPending(options?: {
|
|
963
987
|
limit?: number;
|
|
964
988
|
organizationId?: string;
|
|
965
|
-
payoutMethod?: string;
|
|
989
|
+
payoutMethod?: string; /** Restrict the sweep to a single recipient — pay one seller/participant. */
|
|
990
|
+
recipientId?: string;
|
|
966
991
|
dryRun?: boolean;
|
|
967
992
|
}, ctx?: RevenueContext): Promise<{
|
|
968
993
|
processed: number;
|
|
@@ -982,6 +1007,10 @@ declare class SettlementRepository extends RevenueRepositoryBase<SettlementDocum
|
|
|
982
1007
|
code?: string;
|
|
983
1008
|
retry?: boolean;
|
|
984
1009
|
}, ctx?: RevenueContext): Promise<SettlementDocument>;
|
|
1010
|
+
recipientBalance(recipientId: string, options?: {
|
|
1011
|
+
recipientType?: string;
|
|
1012
|
+
currency?: string;
|
|
1013
|
+
}, ctx?: RevenueContext): Promise<RecipientBalance>;
|
|
985
1014
|
}
|
|
986
1015
|
//#endregion
|
|
987
1016
|
//#region src/engine/engine-types.d.ts
|
|
@@ -1236,4 +1265,4 @@ interface RevenueEngine {
|
|
|
1236
1265
|
destroy(): Promise<void>;
|
|
1237
1266
|
}
|
|
1238
1267
|
//#endregion
|
|
1239
|
-
export { RevenueConfig as a,
|
|
1268
|
+
export { RevenueConfig as a, SettlementRepository as c, RevenueModels as d, RevenueSchemaOptions as f, TransactionDocument as h, RetryConfig as i, SubscriptionRepository as l, SubscriptionDocument as m, BankFeedModuleConfig as n, RevenueEngine as o, SettlementDocument as p, CommissionConfig as r, RecipientBalance as s, BankFeedIndexConfig as t, TransactionRepository as u };
|
|
@@ -27,10 +27,8 @@ declare const transactionBaseSchema: z.ZodObject<{
|
|
|
27
27
|
}, z.core.$strip>>;
|
|
28
28
|
method: z.ZodString;
|
|
29
29
|
methodKind: z.ZodEnum<{
|
|
30
|
-
manual: "manual";
|
|
31
|
-
bank_transfer: "bank_transfer";
|
|
32
|
-
cryptocurrency: "cryptocurrency";
|
|
33
30
|
card: "card";
|
|
31
|
+
bank_transfer: "bank_transfer";
|
|
34
32
|
instant_bank_transfer: "instant_bank_transfer";
|
|
35
33
|
direct_debit: "direct_debit";
|
|
36
34
|
wallet: "wallet";
|
|
@@ -39,6 +37,8 @@ declare const transactionBaseSchema: z.ZodObject<{
|
|
|
39
37
|
gift_card: "gift_card";
|
|
40
38
|
cash: "cash";
|
|
41
39
|
cheque: "cheque";
|
|
40
|
+
cryptocurrency: "cryptocurrency";
|
|
41
|
+
manual: "manual";
|
|
42
42
|
other: "other";
|
|
43
43
|
}>;
|
|
44
44
|
status: z.ZodDefault<z.ZodString>;
|
|
@@ -110,16 +110,45 @@ declare const transactionBaseSchema: z.ZodObject<{
|
|
|
110
110
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
111
111
|
}, z.core.$strip>;
|
|
112
112
|
declare const transactionCreateSchema: z.ZodObject<{
|
|
113
|
-
|
|
114
|
-
customerId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
113
|
+
status: z.ZodDefault<z.ZodString>;
|
|
115
114
|
type: z.ZodString;
|
|
115
|
+
amount: z.ZodNumber;
|
|
116
|
+
currency: z.ZodString;
|
|
117
|
+
methodKind: z.ZodEnum<{
|
|
118
|
+
card: "card";
|
|
119
|
+
bank_transfer: "bank_transfer";
|
|
120
|
+
instant_bank_transfer: "instant_bank_transfer";
|
|
121
|
+
direct_debit: "direct_debit";
|
|
122
|
+
wallet: "wallet";
|
|
123
|
+
mobile_money: "mobile_money";
|
|
124
|
+
bnpl: "bnpl";
|
|
125
|
+
gift_card: "gift_card";
|
|
126
|
+
cash: "cash";
|
|
127
|
+
cheque: "cheque";
|
|
128
|
+
cryptocurrency: "cryptocurrency";
|
|
129
|
+
manual: "manual";
|
|
130
|
+
other: "other";
|
|
131
|
+
}>;
|
|
132
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
133
|
+
customerId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
134
|
+
splits: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
135
|
+
type: z.ZodString;
|
|
136
|
+
recipientId: z.ZodString;
|
|
137
|
+
recipientType: z.ZodString;
|
|
138
|
+
rate: z.ZodNumber;
|
|
139
|
+
grossAmount: z.ZodNumber;
|
|
140
|
+
gatewayFeeRate: z.ZodNumber;
|
|
141
|
+
gatewayFeeAmount: z.ZodNumber;
|
|
142
|
+
netAmount: z.ZodNumber;
|
|
143
|
+
status: z.ZodString;
|
|
144
|
+
}, z.core.$strip>>>;
|
|
145
|
+
relatedTransactionId: z.ZodOptional<z.ZodString>;
|
|
146
|
+
organizationId: z.ZodOptional<z.ZodString>;
|
|
116
147
|
flow: z.ZodEnum<{
|
|
117
148
|
inflow: "inflow";
|
|
118
149
|
outflow: "outflow";
|
|
119
150
|
}>;
|
|
120
151
|
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
121
|
-
amount: z.ZodNumber;
|
|
122
|
-
currency: z.ZodString;
|
|
123
152
|
fee: z.ZodDefault<z.ZodNumber>;
|
|
124
153
|
tax: z.ZodDefault<z.ZodNumber>;
|
|
125
154
|
net: z.ZodDefault<z.ZodNumber>;
|
|
@@ -133,23 +162,6 @@ declare const transactionCreateSchema: z.ZodObject<{
|
|
|
133
162
|
isInclusive: z.ZodOptional<z.ZodBoolean>;
|
|
134
163
|
}, z.core.$strip>>;
|
|
135
164
|
method: z.ZodString;
|
|
136
|
-
methodKind: z.ZodEnum<{
|
|
137
|
-
manual: "manual";
|
|
138
|
-
bank_transfer: "bank_transfer";
|
|
139
|
-
cryptocurrency: "cryptocurrency";
|
|
140
|
-
card: "card";
|
|
141
|
-
instant_bank_transfer: "instant_bank_transfer";
|
|
142
|
-
direct_debit: "direct_debit";
|
|
143
|
-
wallet: "wallet";
|
|
144
|
-
mobile_money: "mobile_money";
|
|
145
|
-
bnpl: "bnpl";
|
|
146
|
-
gift_card: "gift_card";
|
|
147
|
-
cash: "cash";
|
|
148
|
-
cheque: "cheque";
|
|
149
|
-
other: "other";
|
|
150
|
-
}>;
|
|
151
|
-
status: z.ZodDefault<z.ZodString>;
|
|
152
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
153
165
|
gateway: z.ZodOptional<z.ZodObject<{
|
|
154
166
|
type: z.ZodString;
|
|
155
167
|
sessionId: z.ZodOptional<z.ZodString>;
|
|
@@ -167,17 +179,6 @@ declare const transactionCreateSchema: z.ZodObject<{
|
|
|
167
179
|
netAmount: z.ZodNumber;
|
|
168
180
|
status: z.ZodString;
|
|
169
181
|
}, z.core.$strip>>;
|
|
170
|
-
splits: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
171
|
-
type: z.ZodString;
|
|
172
|
-
recipientId: z.ZodString;
|
|
173
|
-
recipientType: z.ZodString;
|
|
174
|
-
rate: z.ZodNumber;
|
|
175
|
-
grossAmount: z.ZodNumber;
|
|
176
|
-
gatewayFeeRate: z.ZodNumber;
|
|
177
|
-
gatewayFeeAmount: z.ZodNumber;
|
|
178
|
-
netAmount: z.ZodNumber;
|
|
179
|
-
status: z.ZodString;
|
|
180
|
-
}, z.core.$strip>>>;
|
|
181
182
|
hold: z.ZodOptional<z.ZodObject<{
|
|
182
183
|
status: z.ZodString;
|
|
183
184
|
heldAmount: z.ZodNumber;
|
|
@@ -200,7 +201,6 @@ declare const transactionCreateSchema: z.ZodObject<{
|
|
|
200
201
|
}, z.core.$strip>>;
|
|
201
202
|
sourceId: z.ZodOptional<z.ZodString>;
|
|
202
203
|
sourceModel: z.ZodOptional<z.ZodString>;
|
|
203
|
-
relatedTransactionId: z.ZodOptional<z.ZodString>;
|
|
204
204
|
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
205
205
|
}, z.core.$strip>;
|
|
206
206
|
declare const transactionUpdateSchema: z.ZodObject<{
|
|
@@ -229,10 +229,8 @@ 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
|
-
manual: "manual";
|
|
233
|
-
bank_transfer: "bank_transfer";
|
|
234
|
-
cryptocurrency: "cryptocurrency";
|
|
235
232
|
card: "card";
|
|
233
|
+
bank_transfer: "bank_transfer";
|
|
236
234
|
instant_bank_transfer: "instant_bank_transfer";
|
|
237
235
|
direct_debit: "direct_debit";
|
|
238
236
|
wallet: "wallet";
|
|
@@ -241,6 +239,8 @@ declare const transactionUpdateSchema: z.ZodObject<{
|
|
|
241
239
|
gift_card: "gift_card";
|
|
242
240
|
cash: "cash";
|
|
243
241
|
cheque: "cheque";
|
|
242
|
+
cryptocurrency: "cryptocurrency";
|
|
243
|
+
manual: "manual";
|
|
244
244
|
other: "other";
|
|
245
245
|
}>>;
|
|
246
246
|
status: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
@@ -360,12 +360,12 @@ declare const subscriptionBaseSchema: z.ZodObject<{
|
|
|
360
360
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
361
361
|
}, z.core.$strip>;
|
|
362
362
|
declare const subscriptionCreateSchema: z.ZodObject<{
|
|
363
|
-
organizationId: z.ZodOptional<z.ZodString>;
|
|
364
|
-
customerId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
365
363
|
amount: z.ZodNumber;
|
|
366
364
|
currency: z.ZodOptional<z.ZodString>;
|
|
367
|
-
paymentIntentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
368
365
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
366
|
+
customerId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
367
|
+
organizationId: z.ZodOptional<z.ZodString>;
|
|
368
|
+
paymentIntentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
369
369
|
planKey: z.ZodString;
|
|
370
370
|
transactionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
371
371
|
startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
@@ -432,12 +432,12 @@ declare const settlementBaseSchema: z.ZodObject<{
|
|
|
432
432
|
}>;
|
|
433
433
|
status: z.ZodDefault<z.ZodString>;
|
|
434
434
|
payoutMethod: z.ZodEnum<{
|
|
435
|
-
|
|
435
|
+
check: "check";
|
|
436
436
|
bank_transfer: "bank_transfer";
|
|
437
|
+
manual: "manual";
|
|
437
438
|
mobile_wallet: "mobile_wallet";
|
|
438
439
|
platform_balance: "platform_balance";
|
|
439
440
|
crypto: "crypto";
|
|
440
|
-
check: "check";
|
|
441
441
|
}>;
|
|
442
442
|
amount: z.ZodNumber;
|
|
443
443
|
currency: z.ZodString;
|
|
@@ -478,7 +478,6 @@ declare const settlementBaseSchema: z.ZodObject<{
|
|
|
478
478
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
479
479
|
}, z.core.$strip>;
|
|
480
480
|
declare const settlementCreateSchema: z.ZodObject<{
|
|
481
|
-
organizationId: z.ZodString;
|
|
482
481
|
type: z.ZodEnum<{
|
|
483
482
|
split_payout: "split_payout";
|
|
484
483
|
platform_withdrawal: "platform_withdrawal";
|
|
@@ -497,13 +496,16 @@ declare const settlementCreateSchema: z.ZodObject<{
|
|
|
497
496
|
partner: "partner";
|
|
498
497
|
}>;
|
|
499
498
|
payoutMethod: z.ZodEnum<{
|
|
500
|
-
|
|
499
|
+
check: "check";
|
|
501
500
|
bank_transfer: "bank_transfer";
|
|
501
|
+
manual: "manual";
|
|
502
502
|
mobile_wallet: "mobile_wallet";
|
|
503
503
|
platform_balance: "platform_balance";
|
|
504
504
|
crypto: "crypto";
|
|
505
|
-
check: "check";
|
|
506
505
|
}>;
|
|
506
|
+
scheduledAt: z.ZodDefault<z.ZodCoercedDate<unknown>>;
|
|
507
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
508
|
+
organizationId: z.ZodString;
|
|
507
509
|
sourceTransactionIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
508
510
|
sourceSplitIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
509
511
|
bankTransferDetails: z.ZodOptional<z.ZodObject<{
|
|
@@ -529,8 +531,6 @@ declare const settlementCreateSchema: z.ZodObject<{
|
|
|
529
531
|
transactionHash: z.ZodOptional<z.ZodString>;
|
|
530
532
|
transferredAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
531
533
|
}, z.core.$strip>>;
|
|
532
|
-
scheduledAt: z.ZodDefault<z.ZodCoercedDate<unknown>>;
|
|
533
|
-
notes: z.ZodOptional<z.ZodString>;
|
|
534
534
|
}, z.core.$strip>;
|
|
535
535
|
declare const settlementUpdateSchema: z.ZodObject<{
|
|
536
536
|
publicId: z.ZodOptional<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
|
-
|
|
554
|
+
check: "check";
|
|
555
555
|
bank_transfer: "bank_transfer";
|
|
556
|
+
manual: "manual";
|
|
556
557
|
mobile_wallet: "mobile_wallet";
|
|
557
558
|
platform_balance: "platform_balance";
|
|
558
559
|
crypto: "crypto";
|
|
559
|
-
check: "check";
|
|
560
560
|
}>>;
|
|
561
561
|
amount: z.ZodOptional<z.ZodNumber>;
|
|
562
562
|
currency: z.ZodOptional<z.ZodString>;
|
|
@@ -618,10 +618,8 @@ declare const paymentIntentSchema: z.ZodObject<{
|
|
|
618
618
|
currency: z.ZodString;
|
|
619
619
|
gateway: z.ZodString;
|
|
620
620
|
methodKind: z.ZodEnum<{
|
|
621
|
-
manual: "manual";
|
|
622
|
-
bank_transfer: "bank_transfer";
|
|
623
|
-
cryptocurrency: "cryptocurrency";
|
|
624
621
|
card: "card";
|
|
622
|
+
bank_transfer: "bank_transfer";
|
|
625
623
|
instant_bank_transfer: "instant_bank_transfer";
|
|
626
624
|
direct_debit: "direct_debit";
|
|
627
625
|
wallet: "wallet";
|
|
@@ -630,6 +628,8 @@ declare const paymentIntentSchema: z.ZodObject<{
|
|
|
630
628
|
gift_card: "gift_card";
|
|
631
629
|
cash: "cash";
|
|
632
630
|
cheque: "cheque";
|
|
631
|
+
cryptocurrency: "cryptocurrency";
|
|
632
|
+
manual: "manual";
|
|
633
633
|
other: "other";
|
|
634
634
|
}>;
|
|
635
635
|
customerId: z.ZodOptional<z.ZodString>;
|
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-j8Fh7Yag.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/index.d.mts
CHANGED
|
@@ -4,11 +4,11 @@ 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-j8Fh7Yag.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 { a as RevenueConfig, c as SettlementRepository, d as RevenueModels, f as RevenueSchemaOptions, h as TransactionDocument, i as RetryConfig, l as SubscriptionRepository, m as SubscriptionDocument, n as BankFeedModuleConfig, o as RevenueEngine, p as SettlementDocument, r as CommissionConfig, s as RecipientBalance, t as BankFeedIndexConfig, u as TransactionRepository } from "./engine-types-F3f1lWNG.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-
|
|
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-o4qhjOca.mjs";
|
|
12
12
|
import { A as SplitInfo, B as validateTaxCalculation, C as multiplyMoney, D as toCurrencyCode, E as sumMoney, F as TaxConfig, H as calculateCommission, I as TaxType, L as calculateTax, M as calculateOrganizationPayout, N as calculateSplits, O as toMajor, P as TaxCalculation, R as getTaxType, S as money, T as subtractMoney, U as reverseCommission, V as CommissionInfo, _ 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 reverseTax } from "./audit-DRKuLBFO.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";
|
|
@@ -115,4 +115,4 @@ declare class BankFeedProviderNotFoundError extends RevenueError {
|
|
|
115
115
|
constructor(providerName: string);
|
|
116
116
|
}
|
|
117
117
|
//#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, 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 };
|
|
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 };
|
package/dist/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 { n as SubscriptionRepository, r as TransactionRepository, t as SettlementRepository } from "./settlement.repository-
|
|
2
|
+
import { n as SubscriptionRepository, r as TransactionRepository, t as SettlementRepository } from "./settlement.repository-BDrJQc27.mjs";
|
|
3
3
|
import { n as createEvent, t as REVENUE_EVENTS } from "./event-constants-DM_-A57b.mjs";
|
|
4
4
|
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-95othr0i.mjs";
|
|
5
5
|
import { _ as WrongTransactionKindError, a as InvalidStateTransitionError, c as PaymentVerificationError, d as RefundNotSupportedError, f as RevenueError, g as ValidationError, 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 } from "./errors-Bt5NRVMq.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as
|
|
1
|
+
import { c as SettlementRepository, d as RevenueModels, l as SubscriptionRepository, u as TransactionRepository } from "../engine-types-F3f1lWNG.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-BDrJQc27.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/repositories/create-repositories.ts
|
|
4
4
|
function createRevenueRepositories(models, builtInPlugins, hostPlugins = {}) {
|