@classytic/revenue 1.1.4 → 2.0.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 +90 -0
- package/README.md +638 -632
- package/dist/audit-B39B0Sdq.mjs +53 -0
- package/dist/audit-DZ0eTr9g.d.mts +89 -0
- package/dist/bridges/index.d.mts +2 -0
- package/dist/bridges/index.mjs +1 -0
- package/dist/context-DRqSeTPM.d.mts +35 -0
- package/dist/core/state-machines.d.mts +35 -0
- package/dist/core/state-machines.mjs +134 -0
- package/dist/engine-types-CcjIb4Fy.d.mts +611 -0
- package/dist/enums/index.d.mts +3 -157
- package/dist/enums/index.mjs +3 -55
- package/dist/errors-DHa8JVQ-.mjs +92 -0
- package/dist/escrow.schema-BBv9oVEW.mjs +322 -0
- package/dist/escrow.schema-CC8XuD46.d.mts +629 -0
- package/dist/event-constants-CEMitnIV.mjs +53 -0
- package/dist/events/index.d.mts +3 -0
- package/dist/events/index.mjs +4 -0
- package/dist/index.d.mts +77 -9
- package/dist/index.mjs +465 -29
- package/dist/monetization.enums-BtiU3t8o.mjs +39 -0
- package/dist/monetization.enums-D2xbxXJM.d.mts +34 -0
- package/dist/plugins/plugin.interface.d.mts +28 -0
- package/dist/plugins/plugin.interface.mjs +26 -0
- package/dist/providers/index.d.mts +2 -3
- package/dist/providers/index.mjs +2 -2
- package/dist/{base-DCoyIUj6.mjs → registry-DhFMsSn5.mjs} +34 -36
- package/dist/{base-CsTlVQJe.d.mts → registry-SvIGPAx_.d.mts} +73 -66
- package/dist/repositories/create-repositories.d.mts +21 -0
- package/dist/repositories/create-repositories.mjs +12 -0
- package/dist/revenue-bridges-sdlrR85c.d.mts +145 -0
- package/dist/revenue-event-catalog-BX3g7RUi.d.mts +823 -0
- package/dist/revenue-event-catalog-LqxPnsU_.mjs +388 -0
- package/dist/settlement.repository-Cy3mMWGH.mjs +771 -0
- package/dist/shared/index.d.mts +2 -0
- package/dist/shared/index.mjs +4 -0
- package/dist/split.enums-CQE3ekH1.mjs +172 -0
- package/dist/split.enums-Dw4zCrcZ.d.mts +154 -0
- package/dist/splits-BAfY-a9P.mjs +123 -0
- package/dist/validators/index.d.mts +2 -0
- package/dist/validators/index.mjs +3 -0
- package/package.json +33 -37
- package/dist/application/services/index.d.mts +0 -4
- package/dist/application/services/index.mjs +0 -3
- package/dist/category-resolver-DV83N8ok.mjs +0 -284
- package/dist/commission-split-BzB8cd39.mjs +0 -485
- package/dist/core/events.d.mts +0 -294
- package/dist/core/events.mjs +0 -100
- package/dist/core/index.d.mts +0 -9
- package/dist/core/index.mjs +0 -8
- package/dist/errors-rRdOqnWx.d.mts +0 -787
- package/dist/escrow.enums-CZGrrdg7.mjs +0 -101
- package/dist/escrow.enums-DwdLuuve.d.mts +0 -78
- package/dist/idempotency-DaYcUGY1.mjs +0 -172
- package/dist/index-Dsp7H5Wb.d.mts +0 -471
- package/dist/infrastructure/plugins/index.d.mts +0 -239
- package/dist/infrastructure/plugins/index.mjs +0 -345
- package/dist/money-CvrDOijQ.mjs +0 -271
- package/dist/money-DPG8AtJ8.d.mts +0 -112
- package/dist/payment.enums-HAuAS9Pp.d.mts +0 -70
- package/dist/payment.enums-tEFVa-Xp.mjs +0 -69
- package/dist/plugin-BbK0OVHy.d.mts +0 -327
- package/dist/plugin-Cd_V04Em.mjs +0 -210
- package/dist/reconciliation/index.d.mts +0 -193
- package/dist/reconciliation/index.mjs +0 -192
- package/dist/retry-HHCOXYdn.d.mts +0 -186
- package/dist/revenue-BhdS7nXh.mjs +0 -553
- package/dist/schemas/index.d.mts +0 -2665
- package/dist/schemas/index.mjs +0 -717
- package/dist/schemas/validation.d.mts +0 -375
- package/dist/schemas/validation.mjs +0 -325
- package/dist/settlement.enums-DFhkqZEY.d.mts +0 -132
- package/dist/settlement.schema-DnNSFpGd.d.mts +0 -344
- package/dist/settlement.service-DjzAjezU.d.mts +0 -594
- package/dist/settlement.service-DmdKv0Zu.mjs +0 -2511
- package/dist/split.enums-BrjabxIX.mjs +0 -86
- package/dist/split.enums-DmskfLOM.d.mts +0 -43
- package/dist/tax-BoCt5cEd.d.mts +0 -61
- package/dist/tax-EQ15DO81.mjs +0 -162
- package/dist/transaction.enums-pCyMFT4Z.mjs +0 -96
- package/dist/utils/index.d.mts +0 -428
- package/dist/utils/index.mjs +0 -346
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
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-DZ0eTr9g.mjs";
|
|
2
|
+
export { CURRENCIES, CommissionInfo, type CurrencyCode, CurrencyMismatchError, MINOR_UNIT_FACTOR, type Money, type MoneyValue, SplitInfo, SplitRule, TaxCalculation, TaxConfig, TaxType, absMoney, addMoney, appendAuditEvent, calculateCommission, calculateOrganizationPayout, calculateSplits, calculateTax, compareMoney, equalsMoney, fromMajor, fromSmallestUnit, getAuditTrail, getLastStateChange, getTaxType, isCurrencyCode, isMoney, isNegativeMoney, isPositiveMoney, isZeroMoney, minorUnitFactor, money, multiplyMoney, negateMoney, reverseCommission, reverseTax, subtractMoney, sumMoney, toCurrencyCode, toMajor, toSmallestUnit, validateTaxCalculation };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { a as reverseTax, c as reverseCommission, i as getTaxType, n as calculateSplits, o as validateTaxCalculation, r as calculateTax, s as calculateCommission, t as calculateOrganizationPayout } from "../splits-BAfY-a9P.mjs";
|
|
2
|
+
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-B39B0Sdq.mjs";
|
|
3
|
+
|
|
4
|
+
export { CURRENCIES, CurrencyMismatchError, MINOR_UNIT_FACTOR, absMoney, addMoney, appendAuditEvent, calculateCommission, calculateOrganizationPayout, calculateSplits, calculateTax, compareMoney, equalsMoney, fromMajor, fromSmallestUnit, getAuditTrail, getLastStateChange, getTaxType, isCurrencyCode, isMoney, isNegativeMoney, isPositiveMoney, isZeroMoney, minorUnitFactor, money, multiplyMoney, negateMoney, reverseCommission, reverseTax, subtractMoney, sumMoney, toCurrencyCode, toMajor, toSmallestUnit, validateTaxCalculation };
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
//#region src/enums/transaction.enums.ts
|
|
2
|
+
const TRANSACTION_FLOW = {
|
|
3
|
+
INFLOW: "inflow",
|
|
4
|
+
OUTFLOW: "outflow"
|
|
5
|
+
};
|
|
6
|
+
const TRANSACTION_FLOW_VALUES = Object.values(TRANSACTION_FLOW);
|
|
7
|
+
const TRANSACTION_STATUS = {
|
|
8
|
+
PENDING: "pending",
|
|
9
|
+
PAYMENT_INITIATED: "payment_initiated",
|
|
10
|
+
PROCESSING: "processing",
|
|
11
|
+
REQUIRES_ACTION: "requires_action",
|
|
12
|
+
VERIFIED: "verified",
|
|
13
|
+
COMPLETED: "completed",
|
|
14
|
+
FAILED: "failed",
|
|
15
|
+
CANCELLED: "cancelled",
|
|
16
|
+
EXPIRED: "expired",
|
|
17
|
+
REFUNDED: "refunded",
|
|
18
|
+
PARTIALLY_REFUNDED: "partially_refunded"
|
|
19
|
+
};
|
|
20
|
+
const TRANSACTION_STATUS_VALUES = Object.values(TRANSACTION_STATUS);
|
|
21
|
+
const LIBRARY_CATEGORIES = {
|
|
22
|
+
SUBSCRIPTION: "subscription",
|
|
23
|
+
PURCHASE: "purchase"
|
|
24
|
+
};
|
|
25
|
+
const LIBRARY_CATEGORY_VALUES = Object.values(LIBRARY_CATEGORIES);
|
|
26
|
+
const transactionFlowSet = new Set(TRANSACTION_FLOW_VALUES);
|
|
27
|
+
const transactionStatusSet = new Set(TRANSACTION_STATUS_VALUES);
|
|
28
|
+
const libraryCategorySet = new Set(LIBRARY_CATEGORY_VALUES);
|
|
29
|
+
function isLibraryCategory(value) {
|
|
30
|
+
return typeof value === "string" && libraryCategorySet.has(value);
|
|
31
|
+
}
|
|
32
|
+
function isTransactionFlow(value) {
|
|
33
|
+
return typeof value === "string" && transactionFlowSet.has(value);
|
|
34
|
+
}
|
|
35
|
+
function isTransactionStatus(value) {
|
|
36
|
+
return typeof value === "string" && transactionStatusSet.has(value);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/enums/escrow.enums.ts
|
|
41
|
+
const HOLD_STATUS = {
|
|
42
|
+
PENDING: "pending",
|
|
43
|
+
HELD: "held",
|
|
44
|
+
RELEASED: "released",
|
|
45
|
+
CANCELLED: "cancelled",
|
|
46
|
+
EXPIRED: "expired",
|
|
47
|
+
PARTIALLY_RELEASED: "partially_released"
|
|
48
|
+
};
|
|
49
|
+
const HOLD_STATUS_VALUES = Object.values(HOLD_STATUS);
|
|
50
|
+
const RELEASE_REASON = {
|
|
51
|
+
PAYMENT_VERIFIED: "payment_verified",
|
|
52
|
+
MANUAL_RELEASE: "manual_release",
|
|
53
|
+
AUTO_RELEASE: "auto_release",
|
|
54
|
+
DISPUTE_RESOLVED: "dispute_resolved"
|
|
55
|
+
};
|
|
56
|
+
const RELEASE_REASON_VALUES = Object.values(RELEASE_REASON);
|
|
57
|
+
const HOLD_REASON = {
|
|
58
|
+
PAYMENT_VERIFICATION: "payment_verification",
|
|
59
|
+
FRAUD_CHECK: "fraud_check",
|
|
60
|
+
MANUAL_REVIEW: "manual_review",
|
|
61
|
+
DISPUTE: "dispute",
|
|
62
|
+
COMPLIANCE: "compliance"
|
|
63
|
+
};
|
|
64
|
+
const HOLD_REASON_VALUES = Object.values(HOLD_REASON);
|
|
65
|
+
const holdStatusSet = new Set(HOLD_STATUS_VALUES);
|
|
66
|
+
const releaseReasonSet = new Set(RELEASE_REASON_VALUES);
|
|
67
|
+
const holdReasonSet = new Set(HOLD_REASON_VALUES);
|
|
68
|
+
function isHoldStatus(value) {
|
|
69
|
+
return typeof value === "string" && holdStatusSet.has(value);
|
|
70
|
+
}
|
|
71
|
+
function isReleaseReason(value) {
|
|
72
|
+
return typeof value === "string" && releaseReasonSet.has(value);
|
|
73
|
+
}
|
|
74
|
+
function isHoldReason(value) {
|
|
75
|
+
return typeof value === "string" && holdReasonSet.has(value);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region src/enums/subscription.enums.ts
|
|
80
|
+
const SUBSCRIPTION_STATUS = {
|
|
81
|
+
ACTIVE: "active",
|
|
82
|
+
PAUSED: "paused",
|
|
83
|
+
CANCELLED: "cancelled",
|
|
84
|
+
EXPIRED: "expired",
|
|
85
|
+
PENDING: "pending",
|
|
86
|
+
PENDING_RENEWAL: "pending_renewal",
|
|
87
|
+
INACTIVE: "inactive"
|
|
88
|
+
};
|
|
89
|
+
const SUBSCRIPTION_STATUS_VALUES = Object.values(SUBSCRIPTION_STATUS);
|
|
90
|
+
const PLAN_KEYS = {
|
|
91
|
+
MONTHLY: "monthly",
|
|
92
|
+
QUARTERLY: "quarterly",
|
|
93
|
+
YEARLY: "yearly"
|
|
94
|
+
};
|
|
95
|
+
const PLAN_KEY_VALUES = Object.values(PLAN_KEYS);
|
|
96
|
+
const subscriptionStatusSet = new Set(SUBSCRIPTION_STATUS_VALUES);
|
|
97
|
+
const planKeySet = new Set(PLAN_KEY_VALUES);
|
|
98
|
+
function isSubscriptionStatus(value) {
|
|
99
|
+
return typeof value === "string" && subscriptionStatusSet.has(value);
|
|
100
|
+
}
|
|
101
|
+
function isPlanKey(value) {
|
|
102
|
+
return typeof value === "string" && planKeySet.has(value);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
//#endregion
|
|
106
|
+
//#region src/enums/settlement.enums.ts
|
|
107
|
+
const SETTLEMENT_STATUS = {
|
|
108
|
+
PENDING: "pending",
|
|
109
|
+
PROCESSING: "processing",
|
|
110
|
+
COMPLETED: "completed",
|
|
111
|
+
FAILED: "failed",
|
|
112
|
+
CANCELLED: "cancelled"
|
|
113
|
+
};
|
|
114
|
+
const SETTLEMENT_STATUS_VALUES = Object.values(SETTLEMENT_STATUS);
|
|
115
|
+
const SETTLEMENT_TYPE = {
|
|
116
|
+
SPLIT_PAYOUT: "split_payout",
|
|
117
|
+
PLATFORM_WITHDRAWAL: "platform_withdrawal",
|
|
118
|
+
MANUAL_PAYOUT: "manual_payout",
|
|
119
|
+
ESCROW_RELEASE: "escrow_release"
|
|
120
|
+
};
|
|
121
|
+
const SETTLEMENT_TYPE_VALUES = Object.values(SETTLEMENT_TYPE);
|
|
122
|
+
const settlementStatusSet = new Set(SETTLEMENT_STATUS_VALUES);
|
|
123
|
+
const settlementTypeSet = new Set(SETTLEMENT_TYPE_VALUES);
|
|
124
|
+
function isSettlementStatus(value) {
|
|
125
|
+
return typeof value === "string" && settlementStatusSet.has(value);
|
|
126
|
+
}
|
|
127
|
+
function isSettlementType(value) {
|
|
128
|
+
return typeof value === "string" && settlementTypeSet.has(value);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
//#endregion
|
|
132
|
+
//#region src/enums/split.enums.ts
|
|
133
|
+
const SPLIT_TYPE = {
|
|
134
|
+
PLATFORM_COMMISSION: "platform_commission",
|
|
135
|
+
AFFILIATE_COMMISSION: "affiliate_commission",
|
|
136
|
+
REFERRAL_COMMISSION: "referral_commission",
|
|
137
|
+
PARTNER_COMMISSION: "partner_commission",
|
|
138
|
+
CUSTOM: "custom"
|
|
139
|
+
};
|
|
140
|
+
const SPLIT_TYPE_VALUES = Object.values(SPLIT_TYPE);
|
|
141
|
+
const SPLIT_STATUS = {
|
|
142
|
+
PENDING: "pending",
|
|
143
|
+
DUE: "due",
|
|
144
|
+
PAID: "paid",
|
|
145
|
+
WAIVED: "waived",
|
|
146
|
+
CANCELLED: "cancelled"
|
|
147
|
+
};
|
|
148
|
+
const SPLIT_STATUS_VALUES = Object.values(SPLIT_STATUS);
|
|
149
|
+
const PAYOUT_METHOD = {
|
|
150
|
+
BANK_TRANSFER: "bank_transfer",
|
|
151
|
+
MOBILE_WALLET: "mobile_wallet",
|
|
152
|
+
PLATFORM_BALANCE: "platform_balance",
|
|
153
|
+
CRYPTO: "crypto",
|
|
154
|
+
CHECK: "check",
|
|
155
|
+
MANUAL: "manual"
|
|
156
|
+
};
|
|
157
|
+
const PAYOUT_METHOD_VALUES = Object.values(PAYOUT_METHOD);
|
|
158
|
+
const splitTypeSet = new Set(SPLIT_TYPE_VALUES);
|
|
159
|
+
const splitStatusSet = new Set(SPLIT_STATUS_VALUES);
|
|
160
|
+
const payoutMethodSet = new Set(PAYOUT_METHOD_VALUES);
|
|
161
|
+
function isSplitType(value) {
|
|
162
|
+
return typeof value === "string" && splitTypeSet.has(value);
|
|
163
|
+
}
|
|
164
|
+
function isSplitStatus(value) {
|
|
165
|
+
return typeof value === "string" && splitStatusSet.has(value);
|
|
166
|
+
}
|
|
167
|
+
function isPayoutMethod(value) {
|
|
168
|
+
return typeof value === "string" && payoutMethodSet.has(value);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
//#endregion
|
|
172
|
+
export { isReleaseReason as A, HOLD_REASON_VALUES as C, RELEASE_REASON_VALUES as D, RELEASE_REASON as E, TRANSACTION_STATUS as F, TRANSACTION_STATUS_VALUES as I, isLibraryCategory as L, LIBRARY_CATEGORY_VALUES as M, TRANSACTION_FLOW as N, isHoldReason as O, TRANSACTION_FLOW_VALUES as P, isTransactionFlow as R, HOLD_REASON as S, HOLD_STATUS_VALUES as T, PLAN_KEY_VALUES as _, SPLIT_TYPE as a, isPlanKey as b, isSplitStatus as c, SETTLEMENT_STATUS_VALUES as d, SETTLEMENT_TYPE as f, PLAN_KEYS as g, isSettlementType as h, SPLIT_STATUS_VALUES as i, LIBRARY_CATEGORIES as j, isHoldStatus as k, isSplitType as l, isSettlementStatus as m, PAYOUT_METHOD_VALUES as n, SPLIT_TYPE_VALUES as o, SETTLEMENT_TYPE_VALUES as p, SPLIT_STATUS as r, isPayoutMethod as s, PAYOUT_METHOD as t, SETTLEMENT_STATUS as u, SUBSCRIPTION_STATUS as v, HOLD_STATUS as w, isSubscriptionStatus as x, SUBSCRIPTION_STATUS_VALUES as y, isTransactionStatus as z };
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
//#region src/enums/transaction.enums.d.ts
|
|
2
|
+
declare const TRANSACTION_FLOW: {
|
|
3
|
+
readonly INFLOW: "inflow";
|
|
4
|
+
readonly OUTFLOW: "outflow";
|
|
5
|
+
};
|
|
6
|
+
type TransactionFlow = typeof TRANSACTION_FLOW;
|
|
7
|
+
type TransactionFlowValue = TransactionFlow[keyof TransactionFlow];
|
|
8
|
+
declare const TRANSACTION_FLOW_VALUES: TransactionFlowValue[];
|
|
9
|
+
declare const TRANSACTION_STATUS: {
|
|
10
|
+
readonly PENDING: "pending";
|
|
11
|
+
readonly PAYMENT_INITIATED: "payment_initiated";
|
|
12
|
+
readonly PROCESSING: "processing";
|
|
13
|
+
readonly REQUIRES_ACTION: "requires_action";
|
|
14
|
+
readonly VERIFIED: "verified";
|
|
15
|
+
readonly COMPLETED: "completed";
|
|
16
|
+
readonly FAILED: "failed";
|
|
17
|
+
readonly CANCELLED: "cancelled";
|
|
18
|
+
readonly EXPIRED: "expired";
|
|
19
|
+
readonly REFUNDED: "refunded";
|
|
20
|
+
readonly PARTIALLY_REFUNDED: "partially_refunded";
|
|
21
|
+
};
|
|
22
|
+
type TransactionStatus = typeof TRANSACTION_STATUS;
|
|
23
|
+
type TransactionStatusValue = TransactionStatus[keyof TransactionStatus];
|
|
24
|
+
declare const TRANSACTION_STATUS_VALUES: TransactionStatusValue[];
|
|
25
|
+
declare const LIBRARY_CATEGORIES: {
|
|
26
|
+
readonly SUBSCRIPTION: "subscription";
|
|
27
|
+
readonly PURCHASE: "purchase";
|
|
28
|
+
};
|
|
29
|
+
type LibraryCategories = typeof LIBRARY_CATEGORIES;
|
|
30
|
+
type LibraryCategoryValue = LibraryCategories[keyof LibraryCategories];
|
|
31
|
+
declare const LIBRARY_CATEGORY_VALUES: LibraryCategoryValue[];
|
|
32
|
+
declare function isLibraryCategory(value: unknown): value is LibraryCategoryValue;
|
|
33
|
+
declare function isTransactionFlow(value: unknown): value is TransactionFlowValue;
|
|
34
|
+
declare function isTransactionStatus(value: unknown): value is TransactionStatusValue;
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/enums/subscription.enums.d.ts
|
|
37
|
+
declare const SUBSCRIPTION_STATUS: {
|
|
38
|
+
readonly ACTIVE: "active";
|
|
39
|
+
readonly PAUSED: "paused";
|
|
40
|
+
readonly CANCELLED: "cancelled";
|
|
41
|
+
readonly EXPIRED: "expired";
|
|
42
|
+
readonly PENDING: "pending";
|
|
43
|
+
readonly PENDING_RENEWAL: "pending_renewal";
|
|
44
|
+
readonly INACTIVE: "inactive";
|
|
45
|
+
};
|
|
46
|
+
type SubscriptionStatus = typeof SUBSCRIPTION_STATUS;
|
|
47
|
+
type SubscriptionStatusValue = SubscriptionStatus[keyof SubscriptionStatus];
|
|
48
|
+
declare const SUBSCRIPTION_STATUS_VALUES: SubscriptionStatusValue[];
|
|
49
|
+
declare const PLAN_KEYS: {
|
|
50
|
+
readonly MONTHLY: "monthly";
|
|
51
|
+
readonly QUARTERLY: "quarterly";
|
|
52
|
+
readonly YEARLY: "yearly";
|
|
53
|
+
};
|
|
54
|
+
type PlanKeys = typeof PLAN_KEYS;
|
|
55
|
+
type PlanKeyValue = PlanKeys[keyof PlanKeys];
|
|
56
|
+
declare const PLAN_KEY_VALUES: PlanKeyValue[];
|
|
57
|
+
declare function isSubscriptionStatus(value: unknown): value is SubscriptionStatusValue;
|
|
58
|
+
declare function isPlanKey(value: unknown): value is PlanKeyValue;
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region src/enums/settlement.enums.d.ts
|
|
61
|
+
declare const SETTLEMENT_STATUS: {
|
|
62
|
+
readonly PENDING: "pending";
|
|
63
|
+
readonly PROCESSING: "processing";
|
|
64
|
+
readonly COMPLETED: "completed";
|
|
65
|
+
readonly FAILED: "failed";
|
|
66
|
+
readonly CANCELLED: "cancelled";
|
|
67
|
+
};
|
|
68
|
+
type SettlementStatus = typeof SETTLEMENT_STATUS;
|
|
69
|
+
type SettlementStatusValue = SettlementStatus[keyof SettlementStatus];
|
|
70
|
+
declare const SETTLEMENT_STATUS_VALUES: SettlementStatusValue[];
|
|
71
|
+
declare const SETTLEMENT_TYPE: {
|
|
72
|
+
readonly SPLIT_PAYOUT: "split_payout";
|
|
73
|
+
readonly PLATFORM_WITHDRAWAL: "platform_withdrawal";
|
|
74
|
+
readonly MANUAL_PAYOUT: "manual_payout";
|
|
75
|
+
readonly ESCROW_RELEASE: "escrow_release";
|
|
76
|
+
};
|
|
77
|
+
type SettlementType = typeof SETTLEMENT_TYPE;
|
|
78
|
+
type SettlementTypeValue = SettlementType[keyof SettlementType];
|
|
79
|
+
declare const SETTLEMENT_TYPE_VALUES: SettlementTypeValue[];
|
|
80
|
+
declare function isSettlementStatus(value: unknown): value is SettlementStatusValue;
|
|
81
|
+
declare function isSettlementType(value: unknown): value is SettlementTypeValue;
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/enums/escrow.enums.d.ts
|
|
84
|
+
declare const HOLD_STATUS: {
|
|
85
|
+
readonly PENDING: "pending";
|
|
86
|
+
readonly HELD: "held";
|
|
87
|
+
readonly RELEASED: "released";
|
|
88
|
+
readonly CANCELLED: "cancelled";
|
|
89
|
+
readonly EXPIRED: "expired";
|
|
90
|
+
readonly PARTIALLY_RELEASED: "partially_released";
|
|
91
|
+
};
|
|
92
|
+
type HoldStatus = typeof HOLD_STATUS;
|
|
93
|
+
type HoldStatusValue = HoldStatus[keyof HoldStatus];
|
|
94
|
+
declare const HOLD_STATUS_VALUES: HoldStatusValue[];
|
|
95
|
+
declare const RELEASE_REASON: {
|
|
96
|
+
readonly PAYMENT_VERIFIED: "payment_verified";
|
|
97
|
+
readonly MANUAL_RELEASE: "manual_release";
|
|
98
|
+
readonly AUTO_RELEASE: "auto_release";
|
|
99
|
+
readonly DISPUTE_RESOLVED: "dispute_resolved";
|
|
100
|
+
};
|
|
101
|
+
type ReleaseReason = typeof RELEASE_REASON;
|
|
102
|
+
type ReleaseReasonValue = ReleaseReason[keyof ReleaseReason];
|
|
103
|
+
declare const RELEASE_REASON_VALUES: ReleaseReasonValue[];
|
|
104
|
+
declare const HOLD_REASON: {
|
|
105
|
+
readonly PAYMENT_VERIFICATION: "payment_verification";
|
|
106
|
+
readonly FRAUD_CHECK: "fraud_check";
|
|
107
|
+
readonly MANUAL_REVIEW: "manual_review";
|
|
108
|
+
readonly DISPUTE: "dispute";
|
|
109
|
+
readonly COMPLIANCE: "compliance";
|
|
110
|
+
};
|
|
111
|
+
type HoldReason = typeof HOLD_REASON;
|
|
112
|
+
type HoldReasonValue = HoldReason[keyof HoldReason];
|
|
113
|
+
declare const HOLD_REASON_VALUES: HoldReasonValue[];
|
|
114
|
+
declare function isHoldStatus(value: unknown): value is HoldStatusValue;
|
|
115
|
+
declare function isReleaseReason(value: unknown): value is ReleaseReasonValue;
|
|
116
|
+
declare function isHoldReason(value: unknown): value is HoldReasonValue;
|
|
117
|
+
//#endregion
|
|
118
|
+
//#region src/enums/split.enums.d.ts
|
|
119
|
+
declare const SPLIT_TYPE: {
|
|
120
|
+
readonly PLATFORM_COMMISSION: "platform_commission";
|
|
121
|
+
readonly AFFILIATE_COMMISSION: "affiliate_commission";
|
|
122
|
+
readonly REFERRAL_COMMISSION: "referral_commission";
|
|
123
|
+
readonly PARTNER_COMMISSION: "partner_commission";
|
|
124
|
+
readonly CUSTOM: "custom";
|
|
125
|
+
};
|
|
126
|
+
type SplitType = typeof SPLIT_TYPE;
|
|
127
|
+
type SplitTypeValue = SplitType[keyof SplitType];
|
|
128
|
+
declare const SPLIT_TYPE_VALUES: SplitTypeValue[];
|
|
129
|
+
declare const SPLIT_STATUS: {
|
|
130
|
+
readonly PENDING: "pending";
|
|
131
|
+
readonly DUE: "due";
|
|
132
|
+
readonly PAID: "paid";
|
|
133
|
+
readonly WAIVED: "waived";
|
|
134
|
+
readonly CANCELLED: "cancelled";
|
|
135
|
+
};
|
|
136
|
+
type SplitStatus = typeof SPLIT_STATUS;
|
|
137
|
+
type SplitStatusValue = SplitStatus[keyof SplitStatus];
|
|
138
|
+
declare const SPLIT_STATUS_VALUES: SplitStatusValue[];
|
|
139
|
+
declare const PAYOUT_METHOD: {
|
|
140
|
+
readonly BANK_TRANSFER: "bank_transfer";
|
|
141
|
+
readonly MOBILE_WALLET: "mobile_wallet";
|
|
142
|
+
readonly PLATFORM_BALANCE: "platform_balance";
|
|
143
|
+
readonly CRYPTO: "crypto";
|
|
144
|
+
readonly CHECK: "check";
|
|
145
|
+
readonly MANUAL: "manual";
|
|
146
|
+
};
|
|
147
|
+
type PayoutMethod = typeof PAYOUT_METHOD;
|
|
148
|
+
type PayoutMethodValue = PayoutMethod[keyof PayoutMethod];
|
|
149
|
+
declare const PAYOUT_METHOD_VALUES: PayoutMethodValue[];
|
|
150
|
+
declare function isSplitType(value: unknown): value is SplitTypeValue;
|
|
151
|
+
declare function isSplitStatus(value: unknown): value is SplitStatusValue;
|
|
152
|
+
declare function isPayoutMethod(value: unknown): value is PayoutMethodValue;
|
|
153
|
+
//#endregion
|
|
154
|
+
export { LibraryCategories as $, isReleaseReason as A, isSettlementType as B, HoldStatusValue as C, ReleaseReasonValue as D, ReleaseReason as E, SettlementStatus as F, SUBSCRIPTION_STATUS as G, PLAN_KEY_VALUES as H, SettlementStatusValue as I, SubscriptionStatusValue as J, SUBSCRIPTION_STATUS_VALUES as K, SettlementType as L, SETTLEMENT_STATUS_VALUES as M, SETTLEMENT_TYPE as N, isHoldReason as O, SETTLEMENT_TYPE_VALUES as P, LIBRARY_CATEGORY_VALUES as Q, SettlementTypeValue as R, HoldStatus as S, RELEASE_REASON_VALUES as T, PlanKeyValue as U, PLAN_KEYS as V, PlanKeys as W, isSubscriptionStatus as X, isPlanKey as Y, LIBRARY_CATEGORIES as Z, HOLD_REASON_VALUES as _, SPLIT_STATUS as a, TransactionFlow as at, HoldReason as b, SPLIT_TYPE_VALUES as c, TransactionStatusValue as ct, SplitType as d, isTransactionStatus as dt, LibraryCategoryValue as et, SplitTypeValue as f, HOLD_REASON as g, isSplitType as h, PayoutMethodValue as i, TRANSACTION_STATUS_VALUES as it, SETTLEMENT_STATUS as j, isHoldStatus as k, SplitStatus as l, isLibraryCategory as lt, isSplitStatus as m, PAYOUT_METHOD_VALUES as n, TRANSACTION_FLOW_VALUES as nt, SPLIT_STATUS_VALUES as o, TransactionFlowValue as ot, isPayoutMethod as p, SubscriptionStatus as q, PayoutMethod as r, TRANSACTION_STATUS as rt, SPLIT_TYPE as s, TransactionStatus as st, PAYOUT_METHOD as t, TRANSACTION_FLOW as tt, SplitStatusValue as u, isTransactionFlow as ut, HOLD_STATUS as v, RELEASE_REASON as w, HoldReasonValue as x, HOLD_STATUS_VALUES as y, isSettlementStatus as z };
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
//#region src/shared/calculators/commission.ts
|
|
2
|
+
function calculateCommission(amount, commissionRate, gatewayFeeRate = 0) {
|
|
3
|
+
if (!commissionRate || commissionRate <= 0) return null;
|
|
4
|
+
if (amount < 0) throw new Error("Transaction amount cannot be negative");
|
|
5
|
+
if (commissionRate < 0 || commissionRate > 1) throw new Error("Commission rate must be between 0 and 1");
|
|
6
|
+
if (gatewayFeeRate < 0 || gatewayFeeRate > 1) throw new Error("Gateway fee rate must be between 0 and 1");
|
|
7
|
+
const grossAmount = Math.round(amount * commissionRate);
|
|
8
|
+
const gatewayFeeAmount = Math.round(amount * gatewayFeeRate);
|
|
9
|
+
return {
|
|
10
|
+
rate: commissionRate,
|
|
11
|
+
grossAmount,
|
|
12
|
+
gatewayFeeRate,
|
|
13
|
+
gatewayFeeAmount,
|
|
14
|
+
netAmount: Math.max(0, grossAmount - gatewayFeeAmount),
|
|
15
|
+
status: "pending"
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function reverseCommission(originalCommission, originalAmount, refundAmount) {
|
|
19
|
+
if (!originalCommission?.netAmount) return null;
|
|
20
|
+
if (!originalAmount || originalAmount <= 0) throw new Error("Original amount must be greater than 0");
|
|
21
|
+
if (refundAmount < 0) throw new Error("Refund amount cannot be negative");
|
|
22
|
+
if (refundAmount > originalAmount) throw new Error("Refund amount exceeds original amount");
|
|
23
|
+
const refundRatio = refundAmount / originalAmount;
|
|
24
|
+
return {
|
|
25
|
+
rate: originalCommission.rate,
|
|
26
|
+
grossAmount: Math.round(originalCommission.grossAmount * refundRatio),
|
|
27
|
+
gatewayFeeRate: originalCommission.gatewayFeeRate,
|
|
28
|
+
gatewayFeeAmount: Math.round(originalCommission.gatewayFeeAmount * refundRatio),
|
|
29
|
+
netAmount: Math.round(originalCommission.netAmount * refundRatio),
|
|
30
|
+
status: "waived"
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/shared/calculators/tax.ts
|
|
36
|
+
function calculateTax(amount, category, config) {
|
|
37
|
+
if (!config?.isRegistered || config.exemptCategories?.includes(category)) return {
|
|
38
|
+
isApplicable: false,
|
|
39
|
+
rate: 0,
|
|
40
|
+
baseAmount: amount,
|
|
41
|
+
taxAmount: 0,
|
|
42
|
+
totalAmount: amount,
|
|
43
|
+
pricesIncludeTax: false
|
|
44
|
+
};
|
|
45
|
+
const rate = config.defaultRate;
|
|
46
|
+
const [baseAmount, taxAmount, totalAmount] = config.pricesIncludeTax ? [
|
|
47
|
+
Math.round(amount / (1 + rate)),
|
|
48
|
+
Math.round(amount - amount / (1 + rate)),
|
|
49
|
+
amount
|
|
50
|
+
] : [
|
|
51
|
+
amount,
|
|
52
|
+
Math.round(amount * rate),
|
|
53
|
+
Math.round(amount * (1 + rate))
|
|
54
|
+
];
|
|
55
|
+
return {
|
|
56
|
+
isApplicable: true,
|
|
57
|
+
rate,
|
|
58
|
+
baseAmount,
|
|
59
|
+
taxAmount,
|
|
60
|
+
totalAmount,
|
|
61
|
+
pricesIncludeTax: config.pricesIncludeTax
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
function getTaxType(transactionFlow, category, exemptCategories = []) {
|
|
65
|
+
if (exemptCategories.includes(category)) return "exempt";
|
|
66
|
+
return transactionFlow === "inflow" ? "collected" : "paid";
|
|
67
|
+
}
|
|
68
|
+
function reverseTax(originalTax, originalAmount, refundAmount) {
|
|
69
|
+
if (!originalTax.isApplicable) return {
|
|
70
|
+
isApplicable: false,
|
|
71
|
+
rate: 0,
|
|
72
|
+
baseAmount: refundAmount,
|
|
73
|
+
taxAmount: 0,
|
|
74
|
+
totalAmount: refundAmount,
|
|
75
|
+
pricesIncludeTax: false
|
|
76
|
+
};
|
|
77
|
+
if (!originalAmount || originalAmount <= 0) throw new Error("Original amount must be greater than 0");
|
|
78
|
+
if (refundAmount < 0) throw new Error("Refund amount cannot be negative");
|
|
79
|
+
if (refundAmount > originalAmount) throw new Error("Refund amount exceeds original amount");
|
|
80
|
+
const refundRatio = refundAmount / originalAmount;
|
|
81
|
+
const reversedType = originalTax.type ? originalTax.type === "collected" ? "paid" : originalTax.type === "paid" ? "collected" : "exempt" : void 0;
|
|
82
|
+
return {
|
|
83
|
+
isApplicable: true,
|
|
84
|
+
rate: originalTax.rate,
|
|
85
|
+
baseAmount: Math.round(originalTax.baseAmount * refundRatio),
|
|
86
|
+
taxAmount: Math.round(originalTax.taxAmount * refundRatio),
|
|
87
|
+
totalAmount: Math.round(originalTax.totalAmount * refundRatio),
|
|
88
|
+
pricesIncludeTax: originalTax.pricesIncludeTax,
|
|
89
|
+
type: reversedType
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
function validateTaxCalculation(tax) {
|
|
93
|
+
if (!tax.isApplicable) return true;
|
|
94
|
+
return Math.abs(tax.baseAmount + tax.taxAmount - tax.totalAmount) <= 1;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
//#endregion
|
|
98
|
+
//#region src/shared/calculators/splits.ts
|
|
99
|
+
function calculateSplits(amount, rules, gatewayFeeRate = 0) {
|
|
100
|
+
if (rules.reduce((sum, r) => sum + r.rate, 0) > 1) throw new Error("Split rates exceed 100%");
|
|
101
|
+
return rules.map((rule, index) => {
|
|
102
|
+
const grossAmount = Math.round(amount * rule.rate);
|
|
103
|
+
const feeAmount = index === 0 ? Math.round(amount * gatewayFeeRate) : 0;
|
|
104
|
+
const netAmount = Math.max(0, grossAmount - feeAmount);
|
|
105
|
+
return {
|
|
106
|
+
type: rule.type,
|
|
107
|
+
recipientId: rule.recipientId,
|
|
108
|
+
recipientType: rule.recipientType,
|
|
109
|
+
rate: rule.rate,
|
|
110
|
+
grossAmount,
|
|
111
|
+
gatewayFeeRate: index === 0 ? gatewayFeeRate : 0,
|
|
112
|
+
gatewayFeeAmount: feeAmount,
|
|
113
|
+
netAmount,
|
|
114
|
+
status: "pending"
|
|
115
|
+
};
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
function calculateOrganizationPayout(amount, splits) {
|
|
119
|
+
return amount - splits.reduce((sum, s) => sum + s.grossAmount, 0);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
//#endregion
|
|
123
|
+
export { reverseTax as a, reverseCommission as c, getTaxType as i, calculateSplits as n, validateTaxCalculation as o, calculateTax as r, calculateCommission as s, calculateOrganizationPayout as t };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
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-CC8XuD46.mjs";
|
|
2
|
+
export { EscrowHoldInput, EscrowReleaseInput, PaymentIntentInput, PaymentVerifyInput, RefundInput, SettlementCreateInput, SettlementListFilter, SettlementUpdateInput, SplitRuleInput, SubscriptionCreateInput, SubscriptionListFilter, SubscriptionUpdateInput, TransactionCreateInput, TransactionListFilter, TransactionUpdateInput, escrowHoldSchema, escrowReleaseSchema, paymentIntentSchema, paymentVerifySchema, refundSchema, settlementBaseSchema, settlementCreateSchema, settlementListFilterSchema, settlementUpdateSchema, splitRuleSchema, subscriptionBaseSchema, subscriptionCreateSchema, subscriptionListFilterSchema, subscriptionUpdateSchema, transactionBaseSchema, transactionCreateSchema, transactionListFilterSchema, transactionUpdateSchema };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
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-BBv9oVEW.mjs";
|
|
2
|
+
|
|
3
|
+
export { escrowHoldSchema, escrowReleaseSchema, paymentIntentSchema, paymentVerifySchema, refundSchema, settlementBaseSchema, settlementCreateSchema, settlementListFilterSchema, settlementUpdateSchema, splitRuleSchema, subscriptionBaseSchema, subscriptionCreateSchema, subscriptionListFilterSchema, subscriptionUpdateSchema, transactionBaseSchema, transactionCreateSchema, transactionListFilterSchema, transactionUpdateSchema };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@classytic/revenue",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Payment lifecycle engine — transactions, subscriptions, escrow, settlements, commissions. MongoKit-powered, Arc-compatible, framework-agnostic.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"main": "./dist/index.mjs",
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
"payment",
|
|
15
15
|
"saas",
|
|
16
16
|
"billing",
|
|
17
|
-
"proration",
|
|
18
17
|
"recurring",
|
|
19
18
|
"gateway",
|
|
20
19
|
"webhook",
|
|
@@ -22,7 +21,6 @@
|
|
|
22
21
|
"sslcommerz",
|
|
23
22
|
"bkash",
|
|
24
23
|
"transaction",
|
|
25
|
-
"invoice",
|
|
26
24
|
"escrow",
|
|
27
25
|
"hold",
|
|
28
26
|
"release",
|
|
@@ -30,6 +28,8 @@
|
|
|
30
28
|
"affiliate",
|
|
31
29
|
"commission",
|
|
32
30
|
"marketplace",
|
|
31
|
+
"mongokit",
|
|
32
|
+
"arc",
|
|
33
33
|
"typescript"
|
|
34
34
|
],
|
|
35
35
|
"author": "Classytic <classytic.dev@gmail.com> (https://github.com/classytic)",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"build": "tsdown",
|
|
50
50
|
"dev": "tsdown --watch",
|
|
51
51
|
"typecheck": "tsc --noEmit",
|
|
52
|
-
"prepublishOnly": "
|
|
52
|
+
"prepublishOnly": "tsdown",
|
|
53
53
|
"test": "cd .. && vitest run"
|
|
54
54
|
},
|
|
55
55
|
"exports": {
|
|
@@ -57,67 +57,63 @@
|
|
|
57
57
|
"types": "./dist/index.d.mts",
|
|
58
58
|
"default": "./dist/index.mjs"
|
|
59
59
|
},
|
|
60
|
-
"./
|
|
61
|
-
"types": "./dist/
|
|
62
|
-
"default": "./dist/
|
|
60
|
+
"./schemas": {
|
|
61
|
+
"types": "./dist/validators/index.d.mts",
|
|
62
|
+
"default": "./dist/validators/index.mjs"
|
|
63
63
|
},
|
|
64
64
|
"./enums": {
|
|
65
65
|
"types": "./dist/enums/index.d.mts",
|
|
66
66
|
"default": "./dist/enums/index.mjs"
|
|
67
67
|
},
|
|
68
68
|
"./events": {
|
|
69
|
-
"types": "./dist/
|
|
70
|
-
"default": "./dist/
|
|
71
|
-
},
|
|
72
|
-
"./plugins": {
|
|
73
|
-
"types": "./dist/infrastructure/plugins/index.d.mts",
|
|
74
|
-
"default": "./dist/infrastructure/plugins/index.mjs"
|
|
69
|
+
"types": "./dist/events/index.d.mts",
|
|
70
|
+
"default": "./dist/events/index.mjs"
|
|
75
71
|
},
|
|
76
72
|
"./providers": {
|
|
77
73
|
"types": "./dist/providers/index.d.mts",
|
|
78
74
|
"default": "./dist/providers/index.mjs"
|
|
79
75
|
},
|
|
80
|
-
"./
|
|
81
|
-
"types": "./dist/
|
|
82
|
-
"default": "./dist/
|
|
83
|
-
},
|
|
84
|
-
"./schemas": {
|
|
85
|
-
"types": "./dist/schemas/index.d.mts",
|
|
86
|
-
"default": "./dist/schemas/index.mjs"
|
|
76
|
+
"./bridges": {
|
|
77
|
+
"types": "./dist/bridges/index.d.mts",
|
|
78
|
+
"default": "./dist/bridges/index.mjs"
|
|
87
79
|
},
|
|
88
|
-
"./
|
|
89
|
-
"types": "./dist/
|
|
90
|
-
"default": "./dist/
|
|
91
|
-
},
|
|
92
|
-
"./services": {
|
|
93
|
-
"types": "./dist/application/services/index.d.mts",
|
|
94
|
-
"default": "./dist/application/services/index.mjs"
|
|
80
|
+
"./repositories": {
|
|
81
|
+
"types": "./dist/repositories/create-repositories.d.mts",
|
|
82
|
+
"default": "./dist/repositories/create-repositories.mjs"
|
|
95
83
|
},
|
|
96
84
|
"./utils": {
|
|
97
|
-
"types": "./dist/
|
|
98
|
-
"default": "./dist/
|
|
85
|
+
"types": "./dist/shared/index.d.mts",
|
|
86
|
+
"default": "./dist/shared/index.mjs"
|
|
87
|
+
},
|
|
88
|
+
"./core": {
|
|
89
|
+
"types": "./dist/core/state-machines.d.mts",
|
|
90
|
+
"default": "./dist/core/state-machines.mjs"
|
|
99
91
|
}
|
|
100
92
|
},
|
|
101
93
|
"files": [
|
|
102
94
|
"dist",
|
|
103
95
|
"README.md",
|
|
96
|
+
"CHANGELOG.md",
|
|
104
97
|
"LICENSE"
|
|
105
98
|
],
|
|
106
99
|
"peerDependencies": {
|
|
107
|
-
"@classytic/
|
|
108
|
-
"
|
|
109
|
-
"
|
|
100
|
+
"@classytic/mongokit": ">=3.11.0",
|
|
101
|
+
"@classytic/repo-core": ">=0.2.0",
|
|
102
|
+
"@classytic/primitives": ">=0.1.0",
|
|
103
|
+
"mongoose": ">=9.4.1",
|
|
104
|
+
"zod": ">=4.0.0"
|
|
110
105
|
},
|
|
111
106
|
"engines": {
|
|
112
107
|
"node": ">=18.0.0"
|
|
113
108
|
},
|
|
114
109
|
"devDependencies": {
|
|
110
|
+
"@classytic/mongokit": ">=3.11.0",
|
|
111
|
+
"@classytic/repo-core": ">=0.2.0",
|
|
112
|
+
"@classytic/primitives": ">=0.1.0",
|
|
115
113
|
"@types/node": "^22.8.7",
|
|
114
|
+
"mongoose": "^9.4.1",
|
|
116
115
|
"tsdown": "^0.20.3",
|
|
117
116
|
"typescript": "^5.6.3",
|
|
118
117
|
"zod": "^4.1.13"
|
|
119
|
-
},
|
|
120
|
-
"dependencies": {
|
|
121
|
-
"nanoid": "^5.1.6"
|
|
122
118
|
}
|
|
123
|
-
}
|
|
119
|
+
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { a as MonetizationService, i as PaymentService, n as EscrowService, r as TransactionService, t as SettlementService } from "../../settlement.service-DjzAjezU.mjs";
|
|
2
|
-
import "../../index-Dsp7H5Wb.mjs";
|
|
3
|
-
import "../../settlement.schema-DnNSFpGd.mjs";
|
|
4
|
-
export { EscrowService, MonetizationService, PaymentService, SettlementService, TransactionService };
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { a as MonetizationService, i as PaymentService, n as EscrowService, r as TransactionService, t as SettlementService } from "../../settlement.service-DmdKv0Zu.mjs";
|
|
2
|
-
|
|
3
|
-
export { EscrowService, MonetizationService, PaymentService, SettlementService, TransactionService };
|