@classytic/revenue 2.0.1 → 2.1.3
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 +66 -0
- package/README.md +33 -10
- package/dist/bank-feed-BlQeq2rK.mjs +133 -0
- package/dist/bank-feed.enums-BadqNJTC.d.mts +118 -0
- package/dist/bank-feed.enums-kYTLTTbe.mjs +165 -0
- package/dist/bridges/index.d.mts +1 -1
- package/dist/core/state-machines.d.mts +25 -2
- package/dist/core/state-machines.mjs +43 -3
- package/dist/engine-types-Jctrbasz.d.mts +1160 -0
- package/dist/enums/index.d.mts +4 -3
- package/dist/enums/index.mjs +4 -3
- package/dist/{errors-DHa8JVQ-.mjs → errors-LYYg9wcs.mjs} +23 -1
- package/dist/{escrow.schema-D5X32LwX.d.mts → escrow.schema-YuBgjL-I.d.mts} +27 -27
- package/dist/{event-constants-CEMitnIV.mjs → event-constants-Dn1TKahe.mjs} +6 -0
- package/dist/events/index.d.mts +2 -2
- package/dist/events/index.mjs +3 -3
- package/dist/index.d.mts +32 -13
- package/dist/index.mjs +142 -19
- package/dist/providers/index.d.mts +2 -2
- package/dist/providers/index.mjs +2 -2
- package/dist/registry-h8sasoLh.d.mts +145 -0
- package/dist/repositories/create-repositories.d.mts +1 -1
- package/dist/repositories/create-repositories.mjs +1 -1
- package/dist/{revenue-bridges-sdlrR85c.d.mts → revenue-bridges-BtkWFsJu.d.mts} +107 -1
- package/dist/{revenue-event-catalog-LqxPnsU_.mjs → revenue-event-catalog-BvjNVnPd.mjs} +77 -3
- package/dist/{revenue-event-catalog-BX3g7RUi.d.mts → revenue-event-catalog-JpJcyK1E.d.mts} +198 -2
- package/dist/settlement.repository-BAdc9qGl.mjs +1444 -0
- package/dist/shared/index.d.mts +1 -1
- package/dist/shared/index.mjs +2 -2
- package/dist/{subscription.enums-tfoAgsTv.mjs → subscription.enums-95othr0i.mjs} +1 -40
- package/dist/{transaction.enums-u4MshXcL.d.mts → subscription.enums-k24kLpF7.d.mts} +1 -36
- package/dist/validators/index.d.mts +158 -2
- package/dist/validators/index.mjs +95 -2
- package/package.json +7 -7
- package/dist/engine-types-CcjIb4Fy.d.mts +0 -611
- package/dist/registry-DhFMsSn5.mjs +0 -150
- package/dist/registry-SvIGPAx_.d.mts +0 -143
- package/dist/settlement.repository-DHIPx5S4.mjs +0 -771
- /package/dist/{audit-B39B0Sdq.mjs → audit-Ba2XB2C4.mjs} +0 -0
- /package/dist/{audit-DZ0eTr9g.d.mts → audit-DRKuLBFO.d.mts} +0 -0
- /package/dist/{context-DRqSeTPM.d.mts → context-pjP1QeE3.d.mts} +0 -0
- /package/dist/{escrow.schema-BBv9oVEW.mjs → escrow.schema-C-b41z_G.mjs} +0 -0
- /package/dist/{monetization.enums-BtiU3t8o.mjs → monetization.enums-B9HBOecd.mjs} +0 -0
- /package/dist/{monetization.enums-D2xbxXJM.d.mts → monetization.enums-DzAI4sT7.d.mts} +0 -0
- /package/dist/{splits-BAfY-a9P.mjs → splits-CNfQj92L.mjs} +0 -0
package/dist/enums/index.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
3
|
-
|
|
1
|
+
import { A as SettlementStatus, B as HoldReason, C as isPayoutMethod, D as SETTLEMENT_STATUS_VALUES, E as SETTLEMENT_STATUS, F as isSettlementType, G as RELEASE_REASON_VALUES, H as HoldStatus, I as HOLD_REASON, J as isHoldReason, K as ReleaseReason, L as HOLD_REASON_VALUES, M as SettlementType, N as SettlementTypeValue, O as SETTLEMENT_TYPE, P as isSettlementStatus, R as HOLD_STATUS, S as SplitTypeValue, T as isSplitType, U as HoldStatusValue, V as HoldReasonValue, W as RELEASE_REASON, X as isReleaseReason, Y as isHoldStatus, _ as SPLIT_TYPE, a as SUBSCRIPTION_STATUS, b as SplitStatusValue, c as SubscriptionStatusValue, d as PAYOUT_METHOD, f as PAYOUT_METHOD_VALUES, g as SPLIT_STATUS_VALUES, h as SPLIT_STATUS, i as PlanKeys, j as SettlementStatusValue, k as SETTLEMENT_TYPE_VALUES, l as isPlanKey, m as PayoutMethodValue, n as PLAN_KEY_VALUES, o as SUBSCRIPTION_STATUS_VALUES, p as PayoutMethod, q as ReleaseReasonValue, r as PlanKeyValue, s as SubscriptionStatus, t as PLAN_KEYS, u as isSubscriptionStatus, v as SPLIT_TYPE_VALUES, w as isSplitStatus, x as SplitType, y as SplitStatus, z as HOLD_STATUS_VALUES } from "../subscription.enums-k24kLpF7.mjs";
|
|
2
|
+
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-BadqNJTC.mjs";
|
|
3
|
+
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";
|
|
4
|
+
export { BANK_FEED_SOURCE, BANK_FEED_SOURCE_VALUES, BANK_FEED_STATUS, BANK_FEED_STATUS_VALUES, BankFeedSourceValue, BankFeedStatusValue, HOLD_REASON, HOLD_REASON_VALUES, HOLD_STATUS, HOLD_STATUS_VALUES, HoldReason, HoldReasonValue, HoldStatus, HoldStatusValue, LIBRARY_CATEGORIES, LIBRARY_CATEGORY_VALUES, LibraryCategories, LibraryCategoryValue, MONETIZATION_TYPES, MONETIZATION_TYPE_VALUES, MonetizationTypeValue, MonetizationTypes, PAYMENT_GATEWAY_TYPE, PAYMENT_GATEWAY_TYPE_VALUES, PAYMENT_STATUS, PAYMENT_STATUS_VALUES, PAYOUT_METHOD, PAYOUT_METHOD_VALUES, PLAN_KEYS, PLAN_KEY_VALUES, PaymentGatewayType, PaymentGatewayTypeValue, PaymentStatus, PaymentStatusValue, PayoutMethod, PayoutMethodValue, PlanKeyValue, PlanKeys, RELEASE_REASON, RELEASE_REASON_VALUES, ReleaseReason, ReleaseReasonValue, 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, SettlementStatus, SettlementStatusValue, SettlementType, SettlementTypeValue, SplitStatus, SplitStatusValue, SplitType, SplitTypeValue, SubscriptionStatus, SubscriptionStatusValue, TRANSACTION_FLOW, TRANSACTION_FLOW_VALUES, TRANSACTION_KIND, TRANSACTION_KIND_VALUES, TRANSACTION_STATUS, TRANSACTION_STATUS_VALUES, TransactionFlow, TransactionFlowValue, TransactionKind, TransactionKindValue, TransactionStatus, TransactionStatusValue, initialStatusFor, isBankFeedSource, isBankFeedStatus, isHoldReason, isHoldStatus, isLibraryCategory, isMonetizationType, isPaymentGatewayType, isPaymentStatus, isPayoutMethod, isPlanKey, isReleaseReason, isSettlementStatus, isSettlementType, isSplitStatus, isSplitType, isStatusValidForKind, isSubscriptionStatus, isTransactionFlow, isTransactionKind, isTransactionStatus, statusesForKind };
|
package/dist/enums/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
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-kYTLTTbe.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-95othr0i.mjs";
|
|
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";
|
|
3
4
|
|
|
4
|
-
export { 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_STATUS, TRANSACTION_STATUS_VALUES, isHoldReason, isHoldStatus, isLibraryCategory, isMonetizationType, isPaymentGatewayType, isPaymentStatus, isPayoutMethod, isPlanKey, isReleaseReason, isSettlementStatus, isSettlementType, isSplitStatus, isSplitType, isSubscriptionStatus, isTransactionFlow, isTransactionStatus };
|
|
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 };
|
|
@@ -87,6 +87,28 @@ var PaymentVerificationError = class extends RevenueError {
|
|
|
87
87
|
this.name = "PaymentVerificationError";
|
|
88
88
|
}
|
|
89
89
|
};
|
|
90
|
+
var BankFeedImportError = class extends RevenueError {
|
|
91
|
+
constructor(message, details) {
|
|
92
|
+
super(message, "BANK_FEED_IMPORT_ERROR", details);
|
|
93
|
+
this.name = "BankFeedImportError";
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
var WrongTransactionKindError = class extends RevenueError {
|
|
97
|
+
constructor(transactionId, expected, actual) {
|
|
98
|
+
super(`Transaction '${transactionId}' is kind '${actual}', not '${expected}'`, "WRONG_TRANSACTION_KIND", {
|
|
99
|
+
transactionId,
|
|
100
|
+
expected,
|
|
101
|
+
actual
|
|
102
|
+
});
|
|
103
|
+
this.name = "WrongTransactionKindError";
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
var BankFeedProviderNotFoundError = class extends RevenueError {
|
|
107
|
+
constructor(providerName) {
|
|
108
|
+
super(`Bank-feed provider '${providerName}' not registered. Use \`engine.bankFeedProviders.register(name, provider)\`.`, "BANK_FEED_PROVIDER_NOT_FOUND", { providerName });
|
|
109
|
+
this.name = "BankFeedProviderNotFoundError";
|
|
110
|
+
}
|
|
111
|
+
};
|
|
90
112
|
|
|
91
113
|
//#endregion
|
|
92
|
-
export {
|
|
114
|
+
export { InvalidStateTransitionError as a, ProviderCapabilityError as c, RevenueError as d, SettlementNotFoundError as f, WrongTransactionKindError as g, ValidationError as h, ConfigurationError as i, ProviderNotFoundError as l, TransactionNotFoundError as m, BankFeedImportError as n, PaymentIntentCreationError as o, SubscriptionNotFoundError as p, BankFeedProviderNotFoundError as r, PaymentVerificationError as s, AlreadyVerifiedError as t, RefundNotSupportedError as u };
|
|
@@ -95,16 +95,30 @@ declare const transactionBaseSchema: z.ZodObject<{
|
|
|
95
95
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
96
96
|
}, z.core.$strip>;
|
|
97
97
|
declare const transactionCreateSchema: z.ZodObject<{
|
|
98
|
-
organizationId: z.ZodOptional<z.ZodString>;
|
|
99
|
-
customerId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
100
98
|
type: z.ZodString;
|
|
99
|
+
amount: z.ZodNumber;
|
|
100
|
+
currency: z.ZodString;
|
|
101
|
+
relatedTransactionId: z.ZodOptional<z.ZodString>;
|
|
101
102
|
flow: z.ZodEnum<{
|
|
102
103
|
inflow: "inflow";
|
|
103
104
|
outflow: "outflow";
|
|
104
105
|
}>;
|
|
106
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
107
|
+
status: z.ZodDefault<z.ZodString>;
|
|
108
|
+
gateway: z.ZodOptional<z.ZodObject<{
|
|
109
|
+
type: z.ZodString;
|
|
110
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
111
|
+
paymentIntentId: z.ZodOptional<z.ZodString>;
|
|
112
|
+
chargeId: z.ZodOptional<z.ZodString>;
|
|
113
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
114
|
+
verificationData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
115
|
+
}, z.core.$strip>>;
|
|
116
|
+
customerId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
117
|
+
sourceId: z.ZodOptional<z.ZodString>;
|
|
118
|
+
sourceModel: z.ZodOptional<z.ZodString>;
|
|
119
|
+
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
120
|
+
organizationId: z.ZodOptional<z.ZodString>;
|
|
105
121
|
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
106
|
-
amount: z.ZodNumber;
|
|
107
|
-
currency: z.ZodString;
|
|
108
122
|
fee: z.ZodDefault<z.ZodNumber>;
|
|
109
123
|
tax: z.ZodDefault<z.ZodNumber>;
|
|
110
124
|
net: z.ZodDefault<z.ZodNumber>;
|
|
@@ -118,16 +132,6 @@ declare const transactionCreateSchema: z.ZodObject<{
|
|
|
118
132
|
isInclusive: z.ZodOptional<z.ZodBoolean>;
|
|
119
133
|
}, z.core.$strip>>;
|
|
120
134
|
method: z.ZodString;
|
|
121
|
-
status: z.ZodDefault<z.ZodString>;
|
|
122
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
123
|
-
gateway: z.ZodOptional<z.ZodObject<{
|
|
124
|
-
type: z.ZodString;
|
|
125
|
-
sessionId: z.ZodOptional<z.ZodString>;
|
|
126
|
-
paymentIntentId: z.ZodOptional<z.ZodString>;
|
|
127
|
-
chargeId: z.ZodOptional<z.ZodString>;
|
|
128
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
129
|
-
verificationData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
130
|
-
}, z.core.$strip>>;
|
|
131
135
|
paymentDetails: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
132
136
|
commission: z.ZodOptional<z.ZodObject<{
|
|
133
137
|
rate: z.ZodNumber;
|
|
@@ -168,10 +172,6 @@ declare const transactionCreateSchema: z.ZodObject<{
|
|
|
168
172
|
}, z.core.$strip>>>;
|
|
169
173
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
170
174
|
}, z.core.$strip>>;
|
|
171
|
-
sourceId: z.ZodOptional<z.ZodString>;
|
|
172
|
-
sourceModel: z.ZodOptional<z.ZodString>;
|
|
173
|
-
relatedTransactionId: z.ZodOptional<z.ZodString>;
|
|
174
|
-
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
175
175
|
}, z.core.$strip>;
|
|
176
176
|
declare const transactionUpdateSchema: z.ZodObject<{
|
|
177
177
|
publicId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
@@ -315,14 +315,14 @@ declare const subscriptionBaseSchema: z.ZodObject<{
|
|
|
315
315
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
316
316
|
}, z.core.$strip>;
|
|
317
317
|
declare const subscriptionCreateSchema: z.ZodObject<{
|
|
318
|
-
organizationId: z.ZodOptional<z.ZodString>;
|
|
319
|
-
customerId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
320
318
|
amount: z.ZodNumber;
|
|
321
319
|
currency: z.ZodOptional<z.ZodString>;
|
|
322
|
-
paymentIntentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
323
320
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
324
|
-
|
|
321
|
+
customerId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
325
322
|
planKey: z.ZodString;
|
|
323
|
+
paymentIntentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
324
|
+
transactionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
325
|
+
organizationId: z.ZodOptional<z.ZodString>;
|
|
326
326
|
startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
327
327
|
endDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
328
328
|
pauseReason: z.ZodOptional<z.ZodString>;
|
|
@@ -387,12 +387,12 @@ declare const settlementBaseSchema: z.ZodObject<{
|
|
|
387
387
|
}>;
|
|
388
388
|
status: z.ZodDefault<z.ZodString>;
|
|
389
389
|
payoutMethod: z.ZodEnum<{
|
|
390
|
+
manual: "manual";
|
|
390
391
|
bank_transfer: "bank_transfer";
|
|
391
392
|
mobile_wallet: "mobile_wallet";
|
|
392
393
|
platform_balance: "platform_balance";
|
|
393
394
|
crypto: "crypto";
|
|
394
395
|
check: "check";
|
|
395
|
-
manual: "manual";
|
|
396
396
|
}>;
|
|
397
397
|
amount: z.ZodNumber;
|
|
398
398
|
currency: z.ZodString;
|
|
@@ -433,7 +433,6 @@ declare const settlementBaseSchema: z.ZodObject<{
|
|
|
433
433
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
434
434
|
}, z.core.$strip>;
|
|
435
435
|
declare const settlementCreateSchema: z.ZodObject<{
|
|
436
|
-
organizationId: z.ZodString;
|
|
437
436
|
type: z.ZodEnum<{
|
|
438
437
|
split_payout: "split_payout";
|
|
439
438
|
platform_withdrawal: "platform_withdrawal";
|
|
@@ -442,6 +441,7 @@ declare const settlementCreateSchema: z.ZodObject<{
|
|
|
442
441
|
}>;
|
|
443
442
|
amount: z.ZodNumber;
|
|
444
443
|
currency: z.ZodString;
|
|
444
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
445
445
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
446
446
|
recipientId: z.ZodString;
|
|
447
447
|
recipientType: z.ZodEnum<{
|
|
@@ -451,13 +451,14 @@ declare const settlementCreateSchema: z.ZodObject<{
|
|
|
451
451
|
affiliate: "affiliate";
|
|
452
452
|
partner: "partner";
|
|
453
453
|
}>;
|
|
454
|
+
organizationId: z.ZodString;
|
|
454
455
|
payoutMethod: z.ZodEnum<{
|
|
456
|
+
manual: "manual";
|
|
455
457
|
bank_transfer: "bank_transfer";
|
|
456
458
|
mobile_wallet: "mobile_wallet";
|
|
457
459
|
platform_balance: "platform_balance";
|
|
458
460
|
crypto: "crypto";
|
|
459
461
|
check: "check";
|
|
460
|
-
manual: "manual";
|
|
461
462
|
}>;
|
|
462
463
|
sourceTransactionIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
463
464
|
sourceSplitIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
@@ -485,7 +486,6 @@ declare const settlementCreateSchema: z.ZodObject<{
|
|
|
485
486
|
transferredAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
486
487
|
}, z.core.$strip>>;
|
|
487
488
|
scheduledAt: z.ZodDefault<z.ZodCoercedDate<unknown>>;
|
|
488
|
-
notes: z.ZodOptional<z.ZodString>;
|
|
489
489
|
}, z.core.$strip>;
|
|
490
490
|
declare const settlementUpdateSchema: z.ZodObject<{
|
|
491
491
|
publicId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
@@ -506,12 +506,12 @@ declare const settlementUpdateSchema: z.ZodObject<{
|
|
|
506
506
|
}>>;
|
|
507
507
|
status: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
508
508
|
payoutMethod: z.ZodOptional<z.ZodEnum<{
|
|
509
|
+
manual: "manual";
|
|
509
510
|
bank_transfer: "bank_transfer";
|
|
510
511
|
mobile_wallet: "mobile_wallet";
|
|
511
512
|
platform_balance: "platform_balance";
|
|
512
513
|
crypto: "crypto";
|
|
513
514
|
check: "check";
|
|
514
|
-
manual: "manual";
|
|
515
515
|
}>>;
|
|
516
516
|
amount: z.ZodOptional<z.ZodNumber>;
|
|
517
517
|
currency: z.ZodOptional<z.ZodString>;
|
|
@@ -37,6 +37,12 @@ const REVENUE_EVENTS = {
|
|
|
37
37
|
SUBSCRIPTION_PAUSED: "revenue:subscription.paused",
|
|
38
38
|
SUBSCRIPTION_RESUMED: "revenue:subscription.resumed",
|
|
39
39
|
TRANSACTION_UPDATED: "revenue:transaction.updated",
|
|
40
|
+
TRANSACTION_IMPORTED: "revenue:transaction.imported",
|
|
41
|
+
TRANSACTION_MATCHED: "revenue:transaction.matched",
|
|
42
|
+
TRANSACTION_UNMATCHED: "revenue:transaction.unmatched",
|
|
43
|
+
TRANSACTION_JOURNALIZED: "revenue:transaction.journalized",
|
|
44
|
+
TRANSACTION_REJECTED: "revenue:transaction.rejected",
|
|
45
|
+
TRANSACTION_REMOVED_BY_FEED: "revenue:transaction.removed_by_feed",
|
|
40
46
|
ESCROW_HELD: "revenue:escrow.held",
|
|
41
47
|
ESCROW_RELEASED: "revenue:escrow.released",
|
|
42
48
|
ESCROW_CANCELLED: "revenue:escrow.cancelled",
|
package/dist/events/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as
|
|
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-JpJcyK1E.mjs";
|
|
2
2
|
import { DomainEvent, EventHandler, EventTransport } from "@classytic/primitives/events";
|
|
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, TransactionUpdated, type TransactionUpdatedPayload, WebhookProcessed, type WebhookProcessedPayload, createEvent, revenueEventDefinitions };
|
|
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 { C as SubscriptionResumed, D as
|
|
1
|
+
import { n as createEvent, t as REVENUE_EVENTS } from "../event-constants-Dn1TKahe.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-BvjNVnPd.mjs";
|
|
3
3
|
|
|
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, TransactionUpdated, WebhookProcessed, createEvent, revenueEventDefinitions };
|
|
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
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { t as RevenueContext } from "./context-
|
|
2
|
-
import { a as CurrencyBridge, c as LedgerBridge, i as CustomerBridge, o as NotificationBridge, r as AnalyticsBridge, s as TaxBridge, t as RevenueBridges } from "./revenue-bridges-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { a as
|
|
1
|
+
import { t as RevenueContext } from "./context-pjP1QeE3.mjs";
|
|
2
|
+
import { a as CurrencyBridge, c as LedgerBridge, i as CustomerBridge, o as NotificationBridge, r as AnalyticsBridge, s as TaxBridge, t as RevenueBridges } from "./revenue-bridges-BtkWFsJu.mjs";
|
|
3
|
+
import { A as SettlementStatus, B as HoldReason, C as isPayoutMethod, D as SETTLEMENT_STATUS_VALUES, E as SETTLEMENT_STATUS, F as isSettlementType, G as RELEASE_REASON_VALUES, H as HoldStatus, I as HOLD_REASON, J as isHoldReason, K as ReleaseReason, L as HOLD_REASON_VALUES, M as SettlementType, N as SettlementTypeValue, O as SETTLEMENT_TYPE, P as isSettlementStatus, R as HOLD_STATUS, S as SplitTypeValue, T as isSplitType, U as HoldStatusValue, V as HoldReasonValue, W as RELEASE_REASON, X as isReleaseReason, Y as isHoldStatus, _ as SPLIT_TYPE, a as SUBSCRIPTION_STATUS, b as SplitStatusValue, c as SubscriptionStatusValue, d as PAYOUT_METHOD, f as PAYOUT_METHOD_VALUES, g as SPLIT_STATUS_VALUES, h as SPLIT_STATUS, i as PlanKeys, j as SettlementStatusValue, k as SETTLEMENT_TYPE_VALUES, l as isPlanKey, m as PayoutMethodValue, n as PLAN_KEY_VALUES, o as SUBSCRIPTION_STATUS_VALUES, p as PayoutMethod, q as ReleaseReasonValue, r as PlanKeyValue, s as SubscriptionStatus, t as PLAN_KEYS, u as isSubscriptionStatus, v as SPLIT_TYPE_VALUES, w as isSplitStatus, x as SplitType, y as SplitStatus, z as HOLD_STATUS_VALUES } from "./subscription.enums-k24kLpF7.mjs";
|
|
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-BadqNJTC.mjs";
|
|
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
|
+
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-JpJcyK1E.mjs";
|
|
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-h8sasoLh.mjs";
|
|
9
|
+
import { a as RevenueConfig, c as SubscriptionRepository, d as RevenueSchemaOptions, f as SettlementDocument, i as RetryConfig, l as TransactionRepository, m as TransactionDocument, n as BankFeedModuleConfig, o as RevenueEngine, p as SubscriptionDocument, r as CommissionConfig, s as SettlementRepository, t as BankFeedIndexConfig, u as RevenueModels } from "./engine-types-Jctrbasz.mjs";
|
|
9
10
|
import { RepositoryPluginBundle, RevenueRepositories } from "./repositories/create-repositories.mjs";
|
|
10
|
-
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 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-
|
|
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-YuBgjL-I.mjs";
|
|
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";
|
|
12
13
|
import { HookHandler, PluginContext, PluginManager, RevenuePluginDefinition } from "./plugins/plugin.interface.mjs";
|
|
13
|
-
import { DomainEvent, EventHandler, EventTransport } from "@classytic/primitives/events";
|
|
14
|
-
import { InvalidOutboxEventError, OutboxAcknowledgeOptions, OutboxClaimOptions, OutboxErrorInfo, OutboxFailOptions, OutboxFailureContext, OutboxFailureDecision, OutboxFailurePolicy, OutboxOwnershipError, OutboxStore, OutboxWriteOptions } from "@classytic/primitives/outbox";
|
|
14
|
+
import { DomainEvent, DomainEvent as DomainEvent$1, EventHandler, EventTransport } from "@classytic/primitives/events";
|
|
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";
|
|
15
16
|
import { Result, err, isErr, isOk, ok } from "@classytic/primitives/result";
|
|
16
17
|
|
|
17
18
|
//#region src/engine/create-revenue.d.ts
|
|
@@ -31,6 +32,15 @@ import { Result, err, isErr, isOk, ok } from "@classytic/primitives/result";
|
|
|
31
32
|
*/
|
|
32
33
|
declare function createRevenue(config: RevenueConfig): Promise<RevenueEngine>;
|
|
33
34
|
//#endregion
|
|
35
|
+
//#region src/events/outbox-store.d.ts
|
|
36
|
+
declare class MemoryOutboxStore implements OutboxStore$1 {
|
|
37
|
+
private events;
|
|
38
|
+
save(event: DomainEvent$1, _options?: OutboxWriteOptions$1): Promise<void>;
|
|
39
|
+
getPending(limit: number): Promise<DomainEvent$1[]>;
|
|
40
|
+
acknowledge(eventId: string, _options?: OutboxAcknowledgeOptions$1): Promise<void>;
|
|
41
|
+
purge(olderThanMs: number): Promise<number>;
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
34
44
|
//#region src/core/errors.d.ts
|
|
35
45
|
declare class RevenueError extends Error {
|
|
36
46
|
readonly code: string;
|
|
@@ -73,5 +83,14 @@ declare class RefundNotSupportedError extends RevenueError {
|
|
|
73
83
|
declare class PaymentVerificationError extends RevenueError {
|
|
74
84
|
constructor(message: string, details?: Record<string, unknown>);
|
|
75
85
|
}
|
|
86
|
+
declare class BankFeedImportError extends RevenueError {
|
|
87
|
+
constructor(message: string, details?: Record<string, unknown>);
|
|
88
|
+
}
|
|
89
|
+
declare class WrongTransactionKindError extends RevenueError {
|
|
90
|
+
constructor(transactionId: string, expected: string, actual: string);
|
|
91
|
+
}
|
|
92
|
+
declare class BankFeedProviderNotFoundError extends RevenueError {
|
|
93
|
+
constructor(providerName: string);
|
|
94
|
+
}
|
|
76
95
|
//#endregion
|
|
77
|
-
export { AlreadyVerifiedError, type AnalyticsBridge, CURRENCIES, type CommissionConfig, type CommissionInfo, ConfigurationError, type
|
|
96
|
+
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, 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 };
|