@classytic/revenue 1.1.2 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -7
- package/dist/application/services/index.d.mts +4 -0
- package/dist/application/services/index.mjs +3 -0
- package/dist/base-CsTlVQJe.d.mts +136 -0
- package/dist/base-DCoyIUj6.mjs +152 -0
- package/dist/category-resolver-DV83N8ok.mjs +284 -0
- package/dist/commission-split-BzB8cd39.mjs +485 -0
- package/dist/core/events.d.mts +294 -0
- package/dist/core/events.mjs +100 -0
- package/dist/core/index.d.mts +9 -0
- package/dist/core/index.mjs +8 -0
- package/dist/enums/index.d.mts +157 -0
- package/dist/enums/index.mjs +56 -0
- package/dist/errors-rRdOqnWx.d.mts +787 -0
- package/dist/escrow.enums-CZGrrdg7.mjs +101 -0
- package/dist/{escrow.enums-CE0VQsfe.d.ts → escrow.enums-DwdLuuve.d.mts} +30 -28
- package/dist/idempotency-DaYcUGY1.mjs +172 -0
- package/dist/index-Dsp7H5Wb.d.mts +471 -0
- package/dist/index.d.mts +9 -0
- package/dist/index.mjs +38 -0
- package/dist/infrastructure/plugins/{index.d.ts → index.d.mts} +81 -109
- package/dist/infrastructure/plugins/index.mjs +345 -0
- package/dist/money-CvrDOijQ.mjs +271 -0
- package/dist/money-DPG8AtJ8.d.mts +112 -0
- package/dist/{payment.enums-C1BiGlRa.d.ts → payment.enums-HAuAS9Pp.d.mts} +14 -13
- package/dist/payment.enums-tEFVa-Xp.mjs +69 -0
- package/dist/plugin-BbK0OVHy.d.mts +327 -0
- package/dist/plugin-Cd_V04Em.mjs +210 -0
- package/dist/providers/index.d.mts +3 -0
- package/dist/providers/index.mjs +3 -0
- package/dist/reconciliation/{index.d.ts → index.d.mts} +90 -112
- package/dist/reconciliation/index.mjs +192 -0
- package/dist/retry-HHCOXYdn.d.mts +186 -0
- package/dist/revenue-BhdS7nXh.mjs +553 -0
- package/dist/schemas/index.d.mts +2665 -0
- package/dist/schemas/index.mjs +717 -0
- package/dist/schemas/validation.d.mts +375 -0
- package/dist/schemas/validation.mjs +325 -0
- package/dist/{settlement.enums-ByC1x0ye.d.ts → settlement.enums-DFhkqZEY.d.mts} +31 -29
- package/dist/settlement.schema-DnNSFpGd.d.mts +344 -0
- package/dist/settlement.service-DjzAjezU.d.mts +594 -0
- package/dist/settlement.service-DmdKv0Zu.mjs +2511 -0
- package/dist/split.enums-BrjabxIX.mjs +86 -0
- package/dist/split.enums-DmskfLOM.d.mts +43 -0
- package/dist/tax-BoCt5cEd.d.mts +61 -0
- package/dist/tax-EQ15DO81.mjs +162 -0
- package/dist/transaction.enums-pCyMFT4Z.mjs +96 -0
- package/dist/utils/{index.d.ts → index.d.mts} +91 -161
- package/dist/utils/index.mjs +346 -0
- package/package.json +39 -37
- package/dist/application/services/index.d.ts +0 -6
- package/dist/application/services/index.js +0 -3288
- package/dist/application/services/index.js.map +0 -1
- package/dist/core/events.d.ts +0 -455
- package/dist/core/events.js +0 -122
- package/dist/core/events.js.map +0 -1
- package/dist/core/index.d.ts +0 -13
- package/dist/core/index.js +0 -4591
- package/dist/core/index.js.map +0 -1
- package/dist/enums/index.d.ts +0 -159
- package/dist/enums/index.js +0 -296
- package/dist/enums/index.js.map +0 -1
- package/dist/index-DxIK0UmZ.d.ts +0 -633
- package/dist/index-EnfKzDbs.d.ts +0 -806
- package/dist/index-cLJBLUvx.d.ts +0 -478
- package/dist/index.d.ts +0 -43
- package/dist/index.js +0 -4864
- package/dist/index.js.map +0 -1
- package/dist/infrastructure/plugins/index.js +0 -292
- package/dist/infrastructure/plugins/index.js.map +0 -1
- package/dist/money-widWVD7r.d.ts +0 -111
- package/dist/plugin-Bb9HOE10.d.ts +0 -336
- package/dist/providers/index.d.ts +0 -145
- package/dist/providers/index.js +0 -141
- package/dist/providers/index.js.map +0 -1
- package/dist/reconciliation/index.js +0 -140
- package/dist/reconciliation/index.js.map +0 -1
- package/dist/retry-D4hFUwVk.d.ts +0 -194
- package/dist/schemas/index.d.ts +0 -2655
- package/dist/schemas/index.js +0 -841
- package/dist/schemas/index.js.map +0 -1
- package/dist/schemas/validation.d.ts +0 -384
- package/dist/schemas/validation.js +0 -303
- package/dist/schemas/validation.js.map +0 -1
- package/dist/settlement.schema-CpamV7ZY.d.ts +0 -343
- package/dist/split.enums-DG3TxQf9.d.ts +0 -42
- package/dist/tax-CV8A0sxl.d.ts +0 -60
- package/dist/utils/index.js +0 -1202
- package/dist/utils/index.js.map +0 -1
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import { B as TransactionDocument, F as SplitInfo, R as SubscriptionDocument, W as WebhookEventData, _ as PaymentIntentData, b as PaymentResultData } from "../index-Dsp7H5Wb.mjs";
|
|
2
|
+
import { t as SettlementDocument } from "../settlement.schema-DnNSFpGd.mjs";
|
|
3
|
+
import { i as RefundResult, r as PaymentResult } from "../base-CsTlVQJe.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/core/events.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* All revenue events with their payload types
|
|
8
|
+
*/
|
|
9
|
+
interface RevenueEvents {
|
|
10
|
+
'payment.verified': PaymentVerifiedEvent;
|
|
11
|
+
'payment.failed': PaymentFailedEvent;
|
|
12
|
+
'payment.refunded': PaymentRefundedEvent;
|
|
13
|
+
'payment.requires_action': PaymentRequiresActionEvent;
|
|
14
|
+
'payment.processing': PaymentProcessingEvent;
|
|
15
|
+
'monetization.created': MonetizationCreatedEvent;
|
|
16
|
+
'purchase.created': PurchaseCreatedEvent;
|
|
17
|
+
'free.created': FreeCreatedEvent;
|
|
18
|
+
'subscription.created': SubscriptionCreatedEvent;
|
|
19
|
+
'subscription.activated': SubscriptionActivatedEvent;
|
|
20
|
+
'subscription.renewed': SubscriptionRenewedEvent;
|
|
21
|
+
'subscription.cancelled': SubscriptionCancelledEvent;
|
|
22
|
+
'subscription.paused': SubscriptionPausedEvent;
|
|
23
|
+
'subscription.resumed': SubscriptionResumedEvent;
|
|
24
|
+
'transaction.updated': TransactionUpdatedEvent;
|
|
25
|
+
'escrow.held': EscrowHeldEvent;
|
|
26
|
+
'escrow.released': EscrowReleasedEvent;
|
|
27
|
+
'escrow.cancelled': EscrowCancelledEvent;
|
|
28
|
+
'escrow.split': EscrowSplitEvent;
|
|
29
|
+
'settlement.created': SettlementCreatedEvent;
|
|
30
|
+
'settlement.scheduled': SettlementScheduledEvent;
|
|
31
|
+
'settlement.processing': SettlementProcessingEvent;
|
|
32
|
+
'settlement.completed': SettlementCompletedEvent;
|
|
33
|
+
'settlement.failed': SettlementFailedEvent;
|
|
34
|
+
'webhook.processed': WebhookProcessedEvent;
|
|
35
|
+
'*': BaseEvent;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Base event with auto-injected fields (type + timestamp added by EventBus)
|
|
39
|
+
*/
|
|
40
|
+
interface BaseEvent {
|
|
41
|
+
readonly type: string;
|
|
42
|
+
readonly timestamp: Date;
|
|
43
|
+
readonly metadata?: Record<string, unknown>;
|
|
44
|
+
}
|
|
45
|
+
/** Derive a full event type from its data type */
|
|
46
|
+
type EventOf<K extends string, D> = D & BaseEvent & {
|
|
47
|
+
readonly type: K;
|
|
48
|
+
};
|
|
49
|
+
interface PaymentVerifiedEventData {
|
|
50
|
+
transaction: TransactionDocument;
|
|
51
|
+
paymentResult: PaymentResult | PaymentResultData;
|
|
52
|
+
verifiedBy?: string | null;
|
|
53
|
+
}
|
|
54
|
+
interface PaymentFailedEventData {
|
|
55
|
+
transaction: TransactionDocument;
|
|
56
|
+
error: string;
|
|
57
|
+
provider: string;
|
|
58
|
+
paymentIntentId: string;
|
|
59
|
+
}
|
|
60
|
+
interface PaymentRefundedEventData {
|
|
61
|
+
transaction: TransactionDocument;
|
|
62
|
+
refundTransaction: TransactionDocument;
|
|
63
|
+
refundResult: RefundResult;
|
|
64
|
+
refundAmount: number;
|
|
65
|
+
reason?: string;
|
|
66
|
+
isPartialRefund: boolean;
|
|
67
|
+
}
|
|
68
|
+
interface PaymentRequiresActionEventData {
|
|
69
|
+
transaction: TransactionDocument;
|
|
70
|
+
paymentResult: PaymentResult | PaymentResultData;
|
|
71
|
+
action?: string | Record<string, unknown>;
|
|
72
|
+
}
|
|
73
|
+
interface PaymentProcessingEventData {
|
|
74
|
+
transaction: TransactionDocument;
|
|
75
|
+
paymentResult: PaymentResult | PaymentResultData;
|
|
76
|
+
}
|
|
77
|
+
interface MonetizationCreatedEventData {
|
|
78
|
+
monetizationType: string;
|
|
79
|
+
subscription?: SubscriptionDocument;
|
|
80
|
+
transaction?: TransactionDocument;
|
|
81
|
+
paymentIntent?: PaymentIntentData;
|
|
82
|
+
}
|
|
83
|
+
interface PurchaseCreatedEventData {
|
|
84
|
+
monetizationType: string;
|
|
85
|
+
subscription?: SubscriptionDocument;
|
|
86
|
+
transaction: TransactionDocument;
|
|
87
|
+
paymentIntent?: PaymentIntentData;
|
|
88
|
+
}
|
|
89
|
+
interface FreeCreatedEventData {
|
|
90
|
+
monetizationType: string;
|
|
91
|
+
subscription?: SubscriptionDocument;
|
|
92
|
+
transaction?: TransactionDocument;
|
|
93
|
+
paymentIntent?: PaymentIntentData;
|
|
94
|
+
}
|
|
95
|
+
interface SubscriptionCreatedEventData {
|
|
96
|
+
subscriptionId: string;
|
|
97
|
+
subscription: SubscriptionDocument;
|
|
98
|
+
transactionId?: string;
|
|
99
|
+
}
|
|
100
|
+
interface SubscriptionActivatedEventData {
|
|
101
|
+
subscription: SubscriptionDocument;
|
|
102
|
+
activatedAt: Date;
|
|
103
|
+
}
|
|
104
|
+
interface SubscriptionRenewedEventData {
|
|
105
|
+
subscription: SubscriptionDocument;
|
|
106
|
+
transaction: TransactionDocument;
|
|
107
|
+
paymentIntent?: PaymentIntentData;
|
|
108
|
+
renewalCount: number;
|
|
109
|
+
}
|
|
110
|
+
interface SubscriptionCancelledEventData {
|
|
111
|
+
subscription: SubscriptionDocument;
|
|
112
|
+
immediate: boolean;
|
|
113
|
+
reason?: string;
|
|
114
|
+
canceledAt: Date;
|
|
115
|
+
}
|
|
116
|
+
interface SubscriptionPausedEventData {
|
|
117
|
+
subscription: SubscriptionDocument;
|
|
118
|
+
reason?: string;
|
|
119
|
+
pausedAt: Date;
|
|
120
|
+
}
|
|
121
|
+
interface SubscriptionResumedEventData {
|
|
122
|
+
subscription: SubscriptionDocument;
|
|
123
|
+
extendPeriod: boolean;
|
|
124
|
+
pauseDuration: number;
|
|
125
|
+
resumedAt: Date;
|
|
126
|
+
}
|
|
127
|
+
interface TransactionUpdatedEventData {
|
|
128
|
+
transaction: TransactionDocument;
|
|
129
|
+
updates: Partial<TransactionDocument>;
|
|
130
|
+
}
|
|
131
|
+
interface EscrowHeldEventData {
|
|
132
|
+
transaction: TransactionDocument;
|
|
133
|
+
heldAmount: number;
|
|
134
|
+
reason: string;
|
|
135
|
+
}
|
|
136
|
+
interface EscrowReleasedEventData {
|
|
137
|
+
transaction: TransactionDocument;
|
|
138
|
+
releaseTransaction: TransactionDocument | null;
|
|
139
|
+
releaseAmount: number;
|
|
140
|
+
recipientId: string;
|
|
141
|
+
recipientType: string;
|
|
142
|
+
reason: string;
|
|
143
|
+
isFullRelease: boolean;
|
|
144
|
+
isPartialRelease: boolean;
|
|
145
|
+
}
|
|
146
|
+
interface EscrowCancelledEventData {
|
|
147
|
+
transaction: TransactionDocument;
|
|
148
|
+
reason: string;
|
|
149
|
+
}
|
|
150
|
+
interface EscrowSplitEventData {
|
|
151
|
+
transaction: TransactionDocument;
|
|
152
|
+
splits: SplitInfo[];
|
|
153
|
+
splitTransactions: TransactionDocument[];
|
|
154
|
+
organizationTransaction: TransactionDocument | null;
|
|
155
|
+
organizationPayout: number;
|
|
156
|
+
}
|
|
157
|
+
interface SettlementCreatedEventData {
|
|
158
|
+
settlements: SettlementDocument[];
|
|
159
|
+
transactionId: string;
|
|
160
|
+
count: number;
|
|
161
|
+
}
|
|
162
|
+
interface SettlementScheduledEventData {
|
|
163
|
+
settlement: SettlementDocument;
|
|
164
|
+
scheduledAt: Date;
|
|
165
|
+
}
|
|
166
|
+
interface SettlementProcessingEventData {
|
|
167
|
+
settlement: SettlementDocument;
|
|
168
|
+
processedAt?: Date;
|
|
169
|
+
}
|
|
170
|
+
interface SettlementCompletedEventData {
|
|
171
|
+
settlement: SettlementDocument;
|
|
172
|
+
completedAt?: Date;
|
|
173
|
+
}
|
|
174
|
+
interface SettlementFailedEventData {
|
|
175
|
+
settlement: SettlementDocument;
|
|
176
|
+
reason: string;
|
|
177
|
+
code?: string;
|
|
178
|
+
retry: boolean;
|
|
179
|
+
}
|
|
180
|
+
interface WebhookProcessedEventData {
|
|
181
|
+
webhookType: string;
|
|
182
|
+
provider: string;
|
|
183
|
+
event: WebhookEventData;
|
|
184
|
+
transaction: TransactionDocument;
|
|
185
|
+
processedAt: Date;
|
|
186
|
+
}
|
|
187
|
+
type PaymentVerifiedEvent = EventOf<'payment.verified', PaymentVerifiedEventData>;
|
|
188
|
+
type PaymentFailedEvent = EventOf<'payment.failed', PaymentFailedEventData>;
|
|
189
|
+
type PaymentRefundedEvent = EventOf<'payment.refunded', PaymentRefundedEventData>;
|
|
190
|
+
type PaymentRequiresActionEvent = EventOf<'payment.requires_action', PaymentRequiresActionEventData>;
|
|
191
|
+
type PaymentProcessingEvent = EventOf<'payment.processing', PaymentProcessingEventData>;
|
|
192
|
+
type MonetizationCreatedEvent = EventOf<'monetization.created', MonetizationCreatedEventData>;
|
|
193
|
+
type PurchaseCreatedEvent = EventOf<'purchase.created', PurchaseCreatedEventData>;
|
|
194
|
+
type FreeCreatedEvent = EventOf<'free.created', FreeCreatedEventData>;
|
|
195
|
+
type SubscriptionCreatedEvent = EventOf<'subscription.created', SubscriptionCreatedEventData>;
|
|
196
|
+
type SubscriptionActivatedEvent = EventOf<'subscription.activated', SubscriptionActivatedEventData>;
|
|
197
|
+
type SubscriptionRenewedEvent = EventOf<'subscription.renewed', SubscriptionRenewedEventData>;
|
|
198
|
+
type SubscriptionCancelledEvent = EventOf<'subscription.cancelled', SubscriptionCancelledEventData>;
|
|
199
|
+
type SubscriptionPausedEvent = EventOf<'subscription.paused', SubscriptionPausedEventData>;
|
|
200
|
+
type SubscriptionResumedEvent = EventOf<'subscription.resumed', SubscriptionResumedEventData>;
|
|
201
|
+
type TransactionUpdatedEvent = EventOf<'transaction.updated', TransactionUpdatedEventData>;
|
|
202
|
+
type EscrowHeldEvent = EventOf<'escrow.held', EscrowHeldEventData>;
|
|
203
|
+
type EscrowReleasedEvent = EventOf<'escrow.released', EscrowReleasedEventData>;
|
|
204
|
+
type EscrowCancelledEvent = EventOf<'escrow.cancelled', EscrowCancelledEventData>;
|
|
205
|
+
type EscrowSplitEvent = EventOf<'escrow.split', EscrowSplitEventData>;
|
|
206
|
+
type SettlementCreatedEvent = EventOf<'settlement.created', SettlementCreatedEventData>;
|
|
207
|
+
type SettlementScheduledEvent = EventOf<'settlement.scheduled', SettlementScheduledEventData>;
|
|
208
|
+
type SettlementProcessingEvent = EventOf<'settlement.processing', SettlementProcessingEventData>;
|
|
209
|
+
type SettlementCompletedEvent = EventOf<'settlement.completed', SettlementCompletedEventData>;
|
|
210
|
+
type SettlementFailedEvent = EventOf<'settlement.failed', SettlementFailedEventData>;
|
|
211
|
+
type WebhookProcessedEvent = EventOf<'webhook.processed', WebhookProcessedEventData>;
|
|
212
|
+
/**
|
|
213
|
+
* Maps event names to their data types (what you pass to emit).
|
|
214
|
+
* EventBus auto-injects type + timestamp.
|
|
215
|
+
*/
|
|
216
|
+
interface EventDataMap {
|
|
217
|
+
'payment.verified': PaymentVerifiedEventData;
|
|
218
|
+
'payment.failed': PaymentFailedEventData;
|
|
219
|
+
'payment.refunded': PaymentRefundedEventData;
|
|
220
|
+
'payment.requires_action': PaymentRequiresActionEventData;
|
|
221
|
+
'payment.processing': PaymentProcessingEventData;
|
|
222
|
+
'monetization.created': MonetizationCreatedEventData;
|
|
223
|
+
'purchase.created': PurchaseCreatedEventData;
|
|
224
|
+
'free.created': FreeCreatedEventData;
|
|
225
|
+
'subscription.created': SubscriptionCreatedEventData;
|
|
226
|
+
'subscription.activated': SubscriptionActivatedEventData;
|
|
227
|
+
'subscription.renewed': SubscriptionRenewedEventData;
|
|
228
|
+
'subscription.cancelled': SubscriptionCancelledEventData;
|
|
229
|
+
'subscription.paused': SubscriptionPausedEventData;
|
|
230
|
+
'subscription.resumed': SubscriptionResumedEventData;
|
|
231
|
+
'transaction.updated': TransactionUpdatedEventData;
|
|
232
|
+
'escrow.held': EscrowHeldEventData;
|
|
233
|
+
'escrow.released': EscrowReleasedEventData;
|
|
234
|
+
'escrow.cancelled': EscrowCancelledEventData;
|
|
235
|
+
'escrow.split': EscrowSplitEventData;
|
|
236
|
+
'settlement.created': SettlementCreatedEventData;
|
|
237
|
+
'settlement.scheduled': SettlementScheduledEventData;
|
|
238
|
+
'settlement.processing': SettlementProcessingEventData;
|
|
239
|
+
'settlement.completed': SettlementCompletedEventData;
|
|
240
|
+
'settlement.failed': SettlementFailedEventData;
|
|
241
|
+
'webhook.processed': WebhookProcessedEventData;
|
|
242
|
+
}
|
|
243
|
+
type EventHandler<T> = (event: T) => void | Promise<void>;
|
|
244
|
+
type EventKey = keyof RevenueEvents;
|
|
245
|
+
/**
|
|
246
|
+
* Type-safe event bus with clean, simple API
|
|
247
|
+
*/
|
|
248
|
+
declare class EventBus {
|
|
249
|
+
private handlers;
|
|
250
|
+
private onceHandlers;
|
|
251
|
+
/**
|
|
252
|
+
* Subscribe to an event
|
|
253
|
+
*/
|
|
254
|
+
on<K extends EventKey>(event: K, handler: EventHandler<RevenueEvents[K]>): () => void;
|
|
255
|
+
/**
|
|
256
|
+
* Subscribe to an event once
|
|
257
|
+
*/
|
|
258
|
+
once<K extends EventKey>(event: K, handler: EventHandler<RevenueEvents[K]>): () => void;
|
|
259
|
+
/**
|
|
260
|
+
* Unsubscribe from an event
|
|
261
|
+
*/
|
|
262
|
+
off<K extends EventKey>(event: K, handler: EventHandler<RevenueEvents[K]>): void;
|
|
263
|
+
/**
|
|
264
|
+
* Emit an event (fire and forget, non-blocking)
|
|
265
|
+
*
|
|
266
|
+
* @example
|
|
267
|
+
* ```typescript
|
|
268
|
+
* events.emit('payment.verified', {
|
|
269
|
+
* transaction: txDoc,
|
|
270
|
+
* paymentResult: result,
|
|
271
|
+
* verifiedBy: 'admin_123'
|
|
272
|
+
* });
|
|
273
|
+
* ```
|
|
274
|
+
*/
|
|
275
|
+
emit<K extends keyof EventDataMap>(event: K, data: EventDataMap[K]): void;
|
|
276
|
+
/**
|
|
277
|
+
* Emit and wait for all handlers to complete
|
|
278
|
+
*/
|
|
279
|
+
emitAsync<K extends EventKey>(event: K, payload: Omit<RevenueEvents[K], 'timestamp' | 'type'>): Promise<void>;
|
|
280
|
+
/**
|
|
281
|
+
* Remove all handlers
|
|
282
|
+
*/
|
|
283
|
+
clear(): void;
|
|
284
|
+
/**
|
|
285
|
+
* Get handler count for an event
|
|
286
|
+
*/
|
|
287
|
+
listenerCount(event: EventKey): number;
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Create a new event bus
|
|
291
|
+
*/
|
|
292
|
+
declare function createEventBus(): EventBus;
|
|
293
|
+
//#endregion
|
|
294
|
+
export { BaseEvent, EscrowCancelledEvent, EscrowCancelledEventData, EscrowHeldEvent, EscrowHeldEventData, EscrowReleasedEvent, EscrowReleasedEventData, EscrowSplitEvent, EscrowSplitEventData, EventBus, EventBus as default, EventDataMap, FreeCreatedEvent, FreeCreatedEventData, MonetizationCreatedEvent, MonetizationCreatedEventData, PaymentFailedEvent, PaymentFailedEventData, PaymentProcessingEvent, PaymentProcessingEventData, PaymentRefundedEvent, PaymentRefundedEventData, PaymentRequiresActionEvent, PaymentRequiresActionEventData, PaymentVerifiedEvent, PaymentVerifiedEventData, PurchaseCreatedEvent, PurchaseCreatedEventData, RevenueEvents, SettlementCompletedEvent, SettlementCompletedEventData, SettlementCreatedEvent, SettlementCreatedEventData, SettlementFailedEvent, SettlementFailedEventData, SettlementProcessingEvent, SettlementProcessingEventData, SettlementScheduledEvent, SettlementScheduledEventData, SubscriptionActivatedEvent, SubscriptionActivatedEventData, SubscriptionCancelledEvent, SubscriptionCancelledEventData, SubscriptionCreatedEvent, SubscriptionCreatedEventData, SubscriptionPausedEvent, SubscriptionPausedEventData, SubscriptionRenewedEvent, SubscriptionRenewedEventData, SubscriptionResumedEvent, SubscriptionResumedEventData, TransactionUpdatedEvent, TransactionUpdatedEventData, WebhookProcessedEvent, WebhookProcessedEventData, createEventBus };
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
//#region src/core/events.ts
|
|
2
|
+
/**
|
|
3
|
+
* Type-safe event bus with clean, simple API
|
|
4
|
+
*/
|
|
5
|
+
var EventBus = class {
|
|
6
|
+
handlers = /* @__PURE__ */ new Map();
|
|
7
|
+
onceHandlers = /* @__PURE__ */ new Map();
|
|
8
|
+
/**
|
|
9
|
+
* Subscribe to an event
|
|
10
|
+
*/
|
|
11
|
+
on(event, handler) {
|
|
12
|
+
if (!this.handlers.has(event)) this.handlers.set(event, /* @__PURE__ */ new Set());
|
|
13
|
+
this.handlers.get(event).add(handler);
|
|
14
|
+
return () => this.off(event, handler);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Subscribe to an event once
|
|
18
|
+
*/
|
|
19
|
+
once(event, handler) {
|
|
20
|
+
if (!this.onceHandlers.has(event)) this.onceHandlers.set(event, /* @__PURE__ */ new Set());
|
|
21
|
+
this.onceHandlers.get(event).add(handler);
|
|
22
|
+
return () => this.onceHandlers.get(event)?.delete(handler);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Unsubscribe from an event
|
|
26
|
+
*/
|
|
27
|
+
off(event, handler) {
|
|
28
|
+
this.handlers.get(event)?.delete(handler);
|
|
29
|
+
this.onceHandlers.get(event)?.delete(handler);
|
|
30
|
+
}
|
|
31
|
+
emit(event, data) {
|
|
32
|
+
const fullPayload = {
|
|
33
|
+
...data,
|
|
34
|
+
type: event,
|
|
35
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
36
|
+
};
|
|
37
|
+
const handlers = this.handlers.get(event);
|
|
38
|
+
if (handlers) for (const handler of handlers) Promise.resolve(handler(fullPayload)).catch((err) => {
|
|
39
|
+
console.error(`[Revenue] Event handler error for "${event}":`, err);
|
|
40
|
+
});
|
|
41
|
+
const onceHandlers = this.onceHandlers.get(event);
|
|
42
|
+
if (onceHandlers) {
|
|
43
|
+
for (const handler of onceHandlers) Promise.resolve(handler(fullPayload)).catch((err) => {
|
|
44
|
+
console.error(`[Revenue] Once handler error for "${event}":`, err);
|
|
45
|
+
});
|
|
46
|
+
this.onceHandlers.delete(event);
|
|
47
|
+
}
|
|
48
|
+
if (event !== "*") {
|
|
49
|
+
const wildcardHandlers = this.handlers.get("*");
|
|
50
|
+
if (wildcardHandlers) for (const handler of wildcardHandlers) Promise.resolve(handler(fullPayload)).catch((err) => {
|
|
51
|
+
console.error(`[Revenue] Wildcard handler error:`, err);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Emit and wait for all handlers to complete
|
|
57
|
+
*/
|
|
58
|
+
async emitAsync(event, payload) {
|
|
59
|
+
const fullPayload = {
|
|
60
|
+
...payload,
|
|
61
|
+
type: event,
|
|
62
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
63
|
+
};
|
|
64
|
+
const promises = [];
|
|
65
|
+
const handlers = this.handlers.get(event);
|
|
66
|
+
if (handlers) for (const handler of handlers) promises.push(Promise.resolve(handler(fullPayload)));
|
|
67
|
+
const onceHandlers = this.onceHandlers.get(event);
|
|
68
|
+
if (onceHandlers) {
|
|
69
|
+
for (const handler of onceHandlers) promises.push(Promise.resolve(handler(fullPayload)));
|
|
70
|
+
this.onceHandlers.delete(event);
|
|
71
|
+
}
|
|
72
|
+
if (event !== "*") {
|
|
73
|
+
const wildcardHandlers = this.handlers.get("*");
|
|
74
|
+
if (wildcardHandlers) for (const handler of wildcardHandlers) promises.push(Promise.resolve(handler(fullPayload)));
|
|
75
|
+
}
|
|
76
|
+
await Promise.all(promises);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Remove all handlers
|
|
80
|
+
*/
|
|
81
|
+
clear() {
|
|
82
|
+
this.handlers.clear();
|
|
83
|
+
this.onceHandlers.clear();
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Get handler count for an event
|
|
87
|
+
*/
|
|
88
|
+
listenerCount(event) {
|
|
89
|
+
return (this.handlers.get(event)?.size ?? 0) + (this.onceHandlers.get(event)?.size ?? 0);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Create a new event bus
|
|
94
|
+
*/
|
|
95
|
+
function createEventBus() {
|
|
96
|
+
return new EventBus();
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
//#endregion
|
|
100
|
+
export { EventBus, EventBus as default, createEventBus };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { o as Container } from "../settlement.service-DjzAjezU.mjs";
|
|
2
|
+
import "../index-Dsp7H5Wb.mjs";
|
|
3
|
+
import "../settlement.schema-DnNSFpGd.mjs";
|
|
4
|
+
import "../base-CsTlVQJe.mjs";
|
|
5
|
+
import { BaseEvent, EscrowCancelledEvent, EscrowHeldEvent, EscrowReleasedEvent, EscrowSplitEvent, EventBus, FreeCreatedEvent, MonetizationCreatedEvent, PaymentFailedEvent, PaymentRefundedEvent, PaymentVerifiedEvent, PurchaseCreatedEvent, RevenueEvents, SettlementCompletedEvent, SettlementCreatedEvent, SettlementFailedEvent, SettlementProcessingEvent, SettlementScheduledEvent, SubscriptionActivatedEvent, SubscriptionCancelledEvent, SubscriptionCreatedEvent, SubscriptionPausedEvent, SubscriptionRenewedEvent, SubscriptionResumedEvent, TransactionUpdatedEvent, WebhookProcessedEvent, createEventBus } from "./events.mjs";
|
|
6
|
+
import { a as PluginManager, c as definePlugin, i as PluginLogger, l as loggingPlugin, n as PluginContext, o as RevenuePlugin, r as PluginHooks, s as auditPlugin, t as HookFn, u as metricsPlugin } from "../plugin-BbK0OVHy.mjs";
|
|
7
|
+
import { S as unwrapOr, _ as match, b as tryCatchSync, c as Ok, d as err, f as flatMap, g as mapErr, h as map, l as Result, m as isOk, p as isErr, s as Err, u as all, v as ok, x as unwrap, y as tryCatch } from "../retry-HHCOXYdn.mjs";
|
|
8
|
+
import { A as SUBSCRIPTION_STATE_MACHINE, B as Revenue, C as TransactionNotFoundError, D as HOLD_STATE_MACHINE, E as isRevenueError, H as RevenueOptions, M as StateMachine, O as SETTLEMENT_STATE_MACHINE, R as ModelsConfig, S as SubscriptionNotFoundError, T as isRetryable, U as createRevenue, V as RevenueBuilder, _ as RefundNotSupportedError, a as InvalidAmountError, b as StateError, c as ModelNotRegisteredError, d as PaymentIntentCreationError, f as PaymentVerificationError, g as RefundError, h as ProviderNotFoundError, i as ErrorCode, j as TRANSACTION_STATE_MACHINE, k as SPLIT_STATE_MACHINE, l as NotFoundError, m as ProviderError, n as ConfigurationError, o as InvalidStateTransitionError, p as ProviderCapabilityError, r as ERROR_CODES, s as MissingRequiredFieldError, t as AlreadyVerifiedError, u as OperationError, v as RevenueError, w as ValidationError, x as SubscriptionNotActiveError, y as RevenueErrorOptions, z as ProvidersConfig } from "../errors-rRdOqnWx.mjs";
|
|
9
|
+
export { AlreadyVerifiedError, type BaseEvent, ConfigurationError, Container, ERROR_CODES, type Err, ErrorCode, type EscrowCancelledEvent, type EscrowHeldEvent, type EscrowReleasedEvent, type EscrowSplitEvent, EventBus, type FreeCreatedEvent, HOLD_STATE_MACHINE, type HookFn, InvalidAmountError, InvalidStateTransitionError, MissingRequiredFieldError, ModelNotRegisteredError, type ModelsConfig, type MonetizationCreatedEvent, NotFoundError, type Ok, OperationError, type PaymentFailedEvent, PaymentIntentCreationError, type PaymentRefundedEvent, PaymentVerificationError, type PaymentVerifiedEvent, type PluginContext, type PluginHooks, type PluginLogger, PluginManager, ProviderCapabilityError, ProviderError, ProviderNotFoundError, type ProvidersConfig, type PurchaseCreatedEvent, RefundError, RefundNotSupportedError, Result, Revenue, RevenueBuilder, RevenueError, RevenueErrorOptions, type RevenueEvents, type RevenueOptions, type RevenuePlugin, SETTLEMENT_STATE_MACHINE, SPLIT_STATE_MACHINE, SUBSCRIPTION_STATE_MACHINE, type SettlementCompletedEvent, type SettlementCreatedEvent, type SettlementFailedEvent, type SettlementProcessingEvent, type SettlementScheduledEvent, StateError, StateMachine, type SubscriptionActivatedEvent, type SubscriptionCancelledEvent, type SubscriptionCreatedEvent, SubscriptionNotActiveError, SubscriptionNotFoundError, type SubscriptionPausedEvent, type SubscriptionRenewedEvent, type SubscriptionResumedEvent, TRANSACTION_STATE_MACHINE, TransactionNotFoundError, type TransactionUpdatedEvent, ValidationError, type WebhookProcessedEvent, all, auditPlugin, createEventBus, createRevenue, definePlugin, err, flatMap, isErr, isOk, isRetryable, isRevenueError, loggingPlugin, map, mapErr, match, metricsPlugin, ok, tryCatch, tryCatchSync, unwrap, unwrapOr };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { i as Container, n as RevenueBuilder, r as createRevenue, t as Revenue } from "../revenue-BhdS7nXh.mjs";
|
|
2
|
+
import { EventBus, createEventBus } from "./events.mjs";
|
|
3
|
+
import { a as metricsPlugin, i as loggingPlugin, n as auditPlugin, r as definePlugin, t as PluginManager } from "../plugin-Cd_V04Em.mjs";
|
|
4
|
+
import { S as unwrapOr, _ as match, b as tryCatchSync, d as err, f as flatMap, g as mapErr, h as map, l as Result, m as isOk, p as isErr, u as all, v as ok, x as unwrap, y as tryCatch } from "../commission-split-BzB8cd39.mjs";
|
|
5
|
+
import { C as ValidationError, S as TransactionNotFoundError, T as isRevenueError, _ as RefundNotSupportedError, a as InvalidAmountError, b as SubscriptionNotActiveError, c as ModelNotRegisteredError, d as PaymentIntentCreationError, f as PaymentVerificationError, g as RefundError, h as ProviderNotFoundError, i as ERROR_CODES, l as NotFoundError, m as ProviderError, n as AlreadyVerifiedError, o as InvalidStateTransitionError, p as ProviderCapabilityError, r as ConfigurationError, s as MissingRequiredFieldError, u as OperationError, v as RevenueError, w as isRetryable, x as SubscriptionNotFoundError, y as StateError } from "../category-resolver-DV83N8ok.mjs";
|
|
6
|
+
import { d as SETTLEMENT_STATE_MACHINE, f as SPLIT_STATE_MACHINE, h as StateMachine, m as TRANSACTION_STATE_MACHINE, p as SUBSCRIPTION_STATE_MACHINE, u as HOLD_STATE_MACHINE } from "../settlement.service-DmdKv0Zu.mjs";
|
|
7
|
+
|
|
8
|
+
export { AlreadyVerifiedError, ConfigurationError, Container, ERROR_CODES, EventBus, HOLD_STATE_MACHINE, InvalidAmountError, InvalidStateTransitionError, MissingRequiredFieldError, ModelNotRegisteredError, NotFoundError, OperationError, PaymentIntentCreationError, PaymentVerificationError, PluginManager, ProviderCapabilityError, ProviderError, ProviderNotFoundError, RefundError, RefundNotSupportedError, Result, Revenue, RevenueBuilder, RevenueError, SETTLEMENT_STATE_MACHINE, SPLIT_STATE_MACHINE, SUBSCRIPTION_STATE_MACHINE, StateError, StateMachine, SubscriptionNotActiveError, SubscriptionNotFoundError, TRANSACTION_STATE_MACHINE, TransactionNotFoundError, ValidationError, all, auditPlugin, createEventBus, createRevenue, definePlugin, err, flatMap, isErr, isOk, isRetryable, isRevenueError, loggingPlugin, map, mapErr, match, metricsPlugin, ok, tryCatch, tryCatchSync, unwrap, unwrapOr };
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { a as SPLIT_STATUS, c as SPLIT_TYPE_VALUES, d as SplitType, f as SplitTypeValue, h as isSplitType, i as PayoutMethodValue, l as SplitStatus, m as isSplitStatus, n as PAYOUT_METHOD_VALUES, o as SPLIT_STATUS_VALUES, p as isPayoutMethod, r as PayoutMethod, s as SPLIT_TYPE, t as PAYOUT_METHOD, u as SplitStatusValue } from "../split.enums-DmskfLOM.mjs";
|
|
2
|
+
import { A as isTransactionType, C as TransactionStatus, D as isLibraryCategory, E as TransactionTypeValue, O as isTransactionFlow, S as TransactionFlowValue, T as TransactionType, _ as TRANSACTION_STATUS, a as SettlementStatus, b as TRANSACTION_TYPE_VALUES, c as SettlementTypeValue, d as LIBRARY_CATEGORIES, f as LIBRARY_CATEGORY_VALUES, g as TRANSACTION_FLOW_VALUES, h as TRANSACTION_FLOW, i as SETTLEMENT_TYPE_VALUES, k as isTransactionStatus, l as isSettlementStatus, m as LibraryCategoryValue, n as SETTLEMENT_STATUS_VALUES, o as SettlementStatusValue, p as LibraryCategories, r as SETTLEMENT_TYPE, s as SettlementType, t as SETTLEMENT_STATUS, u as isSettlementType, v as TRANSACTION_STATUS_VALUES, w as TransactionStatusValue, x as TransactionFlow, y as TRANSACTION_TYPE } from "../settlement.enums-DFhkqZEY.mjs";
|
|
3
|
+
import { C as SubscriptionStatusValue, S as SubscriptionStatus, T as isSubscriptionStatus, _ as PLAN_KEY_VALUES, a as HoldReason, b as SUBSCRIPTION_STATUS, c as HoldStatusValue, d as ReleaseReason, f as ReleaseReasonValue, g as PLAN_KEYS, h as isReleaseReason, i as HOLD_STATUS_VALUES, l as RELEASE_REASON, m as isHoldStatus, n as HOLD_REASON_VALUES, o as HoldReasonValue, p as isHoldReason, r as HOLD_STATUS, s as HoldStatus, t as HOLD_REASON, u as RELEASE_REASON_VALUES, v as PlanKeyValue, w as isPlanKey, x as SUBSCRIPTION_STATUS_VALUES, y as PlanKeys } from "../escrow.enums-DwdLuuve.mjs";
|
|
4
|
+
import { a as PAYMENT_STATUS, c as PaymentGatewayTypeValue, d as isGatewayType, f as isPaymentGatewayType, i as PAYMENT_GATEWAY_TYPE_VALUES, l as PaymentStatus, n as GATEWAY_TYPE_VALUES, o as PAYMENT_STATUS_VALUES, p as isPaymentStatus, r as PAYMENT_GATEWAY_TYPE, s as PaymentGatewayType, t as GATEWAY_TYPES, u as PaymentStatusValue } from "../payment.enums-HAuAS9Pp.mjs";
|
|
5
|
+
|
|
6
|
+
//#region src/enums/monetization.enums.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Monetization Enums
|
|
9
|
+
* @classytic/revenue
|
|
10
|
+
*
|
|
11
|
+
* General monetization enums and constants
|
|
12
|
+
*/
|
|
13
|
+
declare const MONETIZATION_TYPES: {
|
|
14
|
+
readonly FREE: "free";
|
|
15
|
+
readonly PURCHASE: "purchase";
|
|
16
|
+
readonly SUBSCRIPTION: "subscription";
|
|
17
|
+
};
|
|
18
|
+
type MonetizationTypes = typeof MONETIZATION_TYPES;
|
|
19
|
+
type MonetizationTypeValue = MonetizationTypes[keyof MonetizationTypes];
|
|
20
|
+
declare const MONETIZATION_TYPE_VALUES: MonetizationTypeValue[];
|
|
21
|
+
declare function isMonetizationType(value: unknown): value is MonetizationTypeValue;
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/enums/index.d.ts
|
|
24
|
+
declare const _default: {
|
|
25
|
+
readonly TRANSACTION_TYPE: {
|
|
26
|
+
readonly INFLOW: "inflow";
|
|
27
|
+
readonly OUTFLOW: "outflow";
|
|
28
|
+
};
|
|
29
|
+
readonly TRANSACTION_TYPE_VALUES: TransactionFlowValue[];
|
|
30
|
+
readonly TRANSACTION_STATUS: {
|
|
31
|
+
readonly PENDING: "pending";
|
|
32
|
+
readonly PAYMENT_INITIATED: "payment_initiated";
|
|
33
|
+
readonly PROCESSING: "processing";
|
|
34
|
+
readonly REQUIRES_ACTION: "requires_action";
|
|
35
|
+
readonly VERIFIED: "verified";
|
|
36
|
+
readonly COMPLETED: "completed";
|
|
37
|
+
readonly FAILED: "failed";
|
|
38
|
+
readonly CANCELLED: "cancelled";
|
|
39
|
+
readonly EXPIRED: "expired";
|
|
40
|
+
readonly REFUNDED: "refunded";
|
|
41
|
+
readonly PARTIALLY_REFUNDED: "partially_refunded";
|
|
42
|
+
};
|
|
43
|
+
readonly TRANSACTION_STATUS_VALUES: TransactionStatusValue[];
|
|
44
|
+
readonly LIBRARY_CATEGORIES: {
|
|
45
|
+
readonly SUBSCRIPTION: "subscription";
|
|
46
|
+
readonly PURCHASE: "purchase";
|
|
47
|
+
};
|
|
48
|
+
readonly LIBRARY_CATEGORY_VALUES: LibraryCategoryValue[];
|
|
49
|
+
readonly isLibraryCategory: typeof isLibraryCategory;
|
|
50
|
+
readonly isTransactionType: typeof isTransactionType;
|
|
51
|
+
readonly isTransactionStatus: typeof isTransactionStatus;
|
|
52
|
+
readonly PAYMENT_STATUS: {
|
|
53
|
+
readonly PENDING: "pending";
|
|
54
|
+
readonly VERIFIED: "verified";
|
|
55
|
+
readonly FAILED: "failed";
|
|
56
|
+
readonly REFUNDED: "refunded";
|
|
57
|
+
readonly CANCELLED: "cancelled";
|
|
58
|
+
};
|
|
59
|
+
readonly PAYMENT_STATUS_VALUES: PaymentStatusValue[];
|
|
60
|
+
readonly PAYMENT_GATEWAY_TYPE: {
|
|
61
|
+
readonly MANUAL: "manual";
|
|
62
|
+
readonly STRIPE: "stripe";
|
|
63
|
+
readonly SSLCOMMERZ: "sslcommerz";
|
|
64
|
+
};
|
|
65
|
+
readonly PAYMENT_GATEWAY_TYPE_VALUES: PaymentGatewayTypeValue[];
|
|
66
|
+
readonly GATEWAY_TYPES: {
|
|
67
|
+
readonly MANUAL: "manual";
|
|
68
|
+
readonly STRIPE: "stripe";
|
|
69
|
+
readonly SSLCOMMERZ: "sslcommerz";
|
|
70
|
+
};
|
|
71
|
+
readonly GATEWAY_TYPE_VALUES: PaymentGatewayTypeValue[];
|
|
72
|
+
readonly isPaymentStatus: typeof isPaymentStatus;
|
|
73
|
+
readonly isPaymentGatewayType: typeof isPaymentGatewayType;
|
|
74
|
+
readonly isGatewayType: typeof isPaymentGatewayType;
|
|
75
|
+
readonly SUBSCRIPTION_STATUS: {
|
|
76
|
+
readonly ACTIVE: "active";
|
|
77
|
+
readonly PAUSED: "paused";
|
|
78
|
+
readonly CANCELLED: "cancelled";
|
|
79
|
+
readonly EXPIRED: "expired";
|
|
80
|
+
readonly PENDING: "pending";
|
|
81
|
+
readonly PENDING_RENEWAL: "pending_renewal";
|
|
82
|
+
readonly INACTIVE: "inactive";
|
|
83
|
+
};
|
|
84
|
+
readonly SUBSCRIPTION_STATUS_VALUES: SubscriptionStatusValue[];
|
|
85
|
+
readonly PLAN_KEYS: {
|
|
86
|
+
readonly MONTHLY: "monthly";
|
|
87
|
+
readonly QUARTERLY: "quarterly";
|
|
88
|
+
readonly YEARLY: "yearly";
|
|
89
|
+
};
|
|
90
|
+
readonly PLAN_KEY_VALUES: PlanKeyValue[];
|
|
91
|
+
readonly isSubscriptionStatus: typeof isSubscriptionStatus;
|
|
92
|
+
readonly isPlanKey: typeof isPlanKey;
|
|
93
|
+
readonly MONETIZATION_TYPES: {
|
|
94
|
+
readonly FREE: "free";
|
|
95
|
+
readonly PURCHASE: "purchase";
|
|
96
|
+
readonly SUBSCRIPTION: "subscription";
|
|
97
|
+
};
|
|
98
|
+
readonly MONETIZATION_TYPE_VALUES: MonetizationTypeValue[];
|
|
99
|
+
readonly isMonetizationType: typeof isMonetizationType;
|
|
100
|
+
readonly HOLD_STATUS: {
|
|
101
|
+
readonly PENDING: "pending";
|
|
102
|
+
readonly HELD: "held";
|
|
103
|
+
readonly RELEASED: "released";
|
|
104
|
+
readonly CANCELLED: "cancelled";
|
|
105
|
+
readonly EXPIRED: "expired";
|
|
106
|
+
readonly PARTIALLY_RELEASED: "partially_released";
|
|
107
|
+
};
|
|
108
|
+
readonly HOLD_STATUS_VALUES: HoldStatusValue[];
|
|
109
|
+
readonly RELEASE_REASON: {
|
|
110
|
+
readonly PAYMENT_VERIFIED: "payment_verified";
|
|
111
|
+
readonly MANUAL_RELEASE: "manual_release";
|
|
112
|
+
readonly AUTO_RELEASE: "auto_release";
|
|
113
|
+
readonly DISPUTE_RESOLVED: "dispute_resolved";
|
|
114
|
+
};
|
|
115
|
+
readonly RELEASE_REASON_VALUES: ReleaseReasonValue[];
|
|
116
|
+
readonly HOLD_REASON: {
|
|
117
|
+
readonly PAYMENT_VERIFICATION: "payment_verification";
|
|
118
|
+
readonly FRAUD_CHECK: "fraud_check";
|
|
119
|
+
readonly MANUAL_REVIEW: "manual_review";
|
|
120
|
+
readonly DISPUTE: "dispute";
|
|
121
|
+
readonly COMPLIANCE: "compliance";
|
|
122
|
+
};
|
|
123
|
+
readonly HOLD_REASON_VALUES: HoldReasonValue[];
|
|
124
|
+
readonly isHoldStatus: typeof isHoldStatus;
|
|
125
|
+
readonly isReleaseReason: typeof isReleaseReason;
|
|
126
|
+
readonly isHoldReason: typeof isHoldReason;
|
|
127
|
+
readonly SPLIT_TYPE: {
|
|
128
|
+
readonly PLATFORM_COMMISSION: "platform_commission";
|
|
129
|
+
readonly AFFILIATE_COMMISSION: "affiliate_commission";
|
|
130
|
+
readonly REFERRAL_COMMISSION: "referral_commission";
|
|
131
|
+
readonly PARTNER_COMMISSION: "partner_commission";
|
|
132
|
+
readonly CUSTOM: "custom";
|
|
133
|
+
};
|
|
134
|
+
readonly SPLIT_TYPE_VALUES: SplitTypeValue[];
|
|
135
|
+
readonly SPLIT_STATUS: {
|
|
136
|
+
readonly PENDING: "pending";
|
|
137
|
+
readonly DUE: "due";
|
|
138
|
+
readonly PAID: "paid";
|
|
139
|
+
readonly WAIVED: "waived";
|
|
140
|
+
readonly CANCELLED: "cancelled";
|
|
141
|
+
};
|
|
142
|
+
readonly SPLIT_STATUS_VALUES: SplitStatusValue[];
|
|
143
|
+
readonly PAYOUT_METHOD: {
|
|
144
|
+
readonly BANK_TRANSFER: "bank_transfer";
|
|
145
|
+
readonly MOBILE_WALLET: "mobile_wallet";
|
|
146
|
+
readonly PLATFORM_BALANCE: "platform_balance";
|
|
147
|
+
readonly CRYPTO: "crypto";
|
|
148
|
+
readonly CHECK: "check";
|
|
149
|
+
readonly MANUAL: "manual";
|
|
150
|
+
};
|
|
151
|
+
readonly PAYOUT_METHOD_VALUES: PayoutMethodValue[];
|
|
152
|
+
readonly isSplitType: typeof isSplitType;
|
|
153
|
+
readonly isSplitStatus: typeof isSplitStatus;
|
|
154
|
+
readonly isPayoutMethod: typeof isPayoutMethod;
|
|
155
|
+
};
|
|
156
|
+
//#endregion
|
|
157
|
+
export { GATEWAY_TYPES, GATEWAY_TYPE_VALUES, 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_STATUS, TRANSACTION_STATUS_VALUES, TRANSACTION_TYPE, TRANSACTION_TYPE_VALUES, TransactionFlow, TransactionFlowValue, TransactionStatus, TransactionStatusValue, TransactionType, TransactionTypeValue, _default as default, isGatewayType, isHoldReason, isHoldStatus, isLibraryCategory, isMonetizationType, isPaymentGatewayType, isPaymentStatus, isPayoutMethod, isPlanKey, isReleaseReason, isSettlementStatus, isSettlementType, isSplitStatus, isSplitType, isSubscriptionStatus, isTransactionFlow, isTransactionStatus, isTransactionType };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { a as TRANSACTION_STATUS, c as TRANSACTION_TYPE_VALUES, d as isTransactionStatus, f as isTransactionType, i as TRANSACTION_FLOW_VALUES, l as isLibraryCategory, n as LIBRARY_CATEGORY_VALUES, o as TRANSACTION_STATUS_VALUES, r as TRANSACTION_FLOW, s as TRANSACTION_TYPE, t as LIBRARY_CATEGORIES, u as isTransactionFlow } from "../transaction.enums-pCyMFT4Z.mjs";
|
|
2
|
+
import { _ as MONETIZATION_TYPE_VALUES, a as RELEASE_REASON, c as isHoldStatus, d as SETTLEMENT_STATUS_VALUES, f as SETTLEMENT_TYPE, g as MONETIZATION_TYPES, h as isSettlementType, i as HOLD_STATUS_VALUES, l as isReleaseReason, m as isSettlementStatus, n as HOLD_REASON_VALUES, o as RELEASE_REASON_VALUES, p as SETTLEMENT_TYPE_VALUES, r as HOLD_STATUS, s as isHoldReason, t as HOLD_REASON, u as SETTLEMENT_STATUS, v as isMonetizationType } from "../escrow.enums-CZGrrdg7.mjs";
|
|
3
|
+
import { a as SPLIT_TYPE, c as isSplitStatus, d as PLAN_KEY_VALUES, f as SUBSCRIPTION_STATUS, h as isSubscriptionStatus, i as SPLIT_STATUS_VALUES, l as isSplitType, m as isPlanKey, n as PAYOUT_METHOD_VALUES, o as SPLIT_TYPE_VALUES, p as SUBSCRIPTION_STATUS_VALUES, r as SPLIT_STATUS, s as isPayoutMethod, t as PAYOUT_METHOD, u as PLAN_KEYS } from "../split.enums-BrjabxIX.mjs";
|
|
4
|
+
import { a as PAYMENT_STATUS, c as isPaymentGatewayType, i as PAYMENT_GATEWAY_TYPE_VALUES, l as isPaymentStatus, n as GATEWAY_TYPE_VALUES, o as PAYMENT_STATUS_VALUES, r as PAYMENT_GATEWAY_TYPE, s as isGatewayType, t as GATEWAY_TYPES } from "../payment.enums-tEFVa-Xp.mjs";
|
|
5
|
+
|
|
6
|
+
//#region src/enums/index.ts
|
|
7
|
+
var enums_default = {
|
|
8
|
+
TRANSACTION_TYPE,
|
|
9
|
+
TRANSACTION_TYPE_VALUES,
|
|
10
|
+
TRANSACTION_STATUS,
|
|
11
|
+
TRANSACTION_STATUS_VALUES,
|
|
12
|
+
LIBRARY_CATEGORIES,
|
|
13
|
+
LIBRARY_CATEGORY_VALUES,
|
|
14
|
+
isLibraryCategory,
|
|
15
|
+
isTransactionType,
|
|
16
|
+
isTransactionStatus,
|
|
17
|
+
PAYMENT_STATUS,
|
|
18
|
+
PAYMENT_STATUS_VALUES,
|
|
19
|
+
PAYMENT_GATEWAY_TYPE,
|
|
20
|
+
PAYMENT_GATEWAY_TYPE_VALUES,
|
|
21
|
+
GATEWAY_TYPES,
|
|
22
|
+
GATEWAY_TYPE_VALUES,
|
|
23
|
+
isPaymentStatus,
|
|
24
|
+
isPaymentGatewayType,
|
|
25
|
+
isGatewayType,
|
|
26
|
+
SUBSCRIPTION_STATUS,
|
|
27
|
+
SUBSCRIPTION_STATUS_VALUES,
|
|
28
|
+
PLAN_KEYS,
|
|
29
|
+
PLAN_KEY_VALUES,
|
|
30
|
+
isSubscriptionStatus,
|
|
31
|
+
isPlanKey,
|
|
32
|
+
MONETIZATION_TYPES,
|
|
33
|
+
MONETIZATION_TYPE_VALUES,
|
|
34
|
+
isMonetizationType,
|
|
35
|
+
HOLD_STATUS,
|
|
36
|
+
HOLD_STATUS_VALUES,
|
|
37
|
+
RELEASE_REASON,
|
|
38
|
+
RELEASE_REASON_VALUES,
|
|
39
|
+
HOLD_REASON,
|
|
40
|
+
HOLD_REASON_VALUES,
|
|
41
|
+
isHoldStatus,
|
|
42
|
+
isReleaseReason,
|
|
43
|
+
isHoldReason,
|
|
44
|
+
SPLIT_TYPE,
|
|
45
|
+
SPLIT_TYPE_VALUES,
|
|
46
|
+
SPLIT_STATUS,
|
|
47
|
+
SPLIT_STATUS_VALUES,
|
|
48
|
+
PAYOUT_METHOD,
|
|
49
|
+
PAYOUT_METHOD_VALUES,
|
|
50
|
+
isSplitType,
|
|
51
|
+
isSplitStatus,
|
|
52
|
+
isPayoutMethod
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
//#endregion
|
|
56
|
+
export { GATEWAY_TYPES, GATEWAY_TYPE_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_STATUS, TRANSACTION_STATUS_VALUES, TRANSACTION_TYPE, TRANSACTION_TYPE_VALUES, enums_default as default, isGatewayType, isHoldReason, isHoldStatus, isLibraryCategory, isMonetizationType, isPaymentGatewayType, isPaymentStatus, isPayoutMethod, isPlanKey, isReleaseReason, isSettlementStatus, isSettlementType, isSplitStatus, isSplitType, isSubscriptionStatus, isTransactionFlow, isTransactionStatus, isTransactionType };
|