@classytic/revenue 1.0.2 → 1.0.6
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 +171 -2
- package/dist/{actions-CwG-b7fR.d.ts → actions-Ctf2XUL-.d.ts} +1 -1
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +74 -4
- package/dist/core/index.js.map +1 -1
- package/dist/enums/index.d.ts +35 -27
- package/dist/enums/index.js +107 -11
- package/dist/enums/index.js.map +1 -1
- package/dist/{index-BnJWVXuw.d.ts → index-BnEXsnLJ.d.ts} +1 -1
- package/dist/{index-ChVD3P9k.d.ts → index-C5SsOrV0.d.ts} +31 -1
- package/dist/index.d.ts +10 -9
- package/dist/index.js +187 -36
- package/dist/index.js.map +1 -1
- package/dist/payment.enums-B_RwB8iR.d.ts +184 -0
- package/dist/providers/index.d.ts +1 -1
- package/dist/schemas/index.d.ts +294 -137
- package/dist/schemas/index.js +132 -29
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/validation.d.ts +83 -8
- package/dist/schemas/validation.js +55 -2
- package/dist/schemas/validation.js.map +1 -1
- package/dist/services/index.d.ts +2 -2
- package/dist/services/index.js +74 -4
- package/dist/services/index.js.map +1 -1
- package/dist/{split.schema-DYVP7Wu2.d.ts → split.schema-DLVF3XBI.d.ts} +301 -137
- package/dist/transaction.enums-7uBnuswI.d.ts +87 -0
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.js +75 -2
- package/dist/utils/index.js.map +1 -1
- package/package.json +6 -5
- package/dist/split.enums-Bh24jw8p.d.ts +0 -255
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Split Payment Enums
|
|
3
|
+
* @classytic/revenue
|
|
4
|
+
*
|
|
5
|
+
* Enums for multi-party commission splits
|
|
6
|
+
*/
|
|
7
|
+
declare const SPLIT_TYPE: {
|
|
8
|
+
readonly PLATFORM_COMMISSION: "platform_commission";
|
|
9
|
+
readonly AFFILIATE_COMMISSION: "affiliate_commission";
|
|
10
|
+
readonly REFERRAL_COMMISSION: "referral_commission";
|
|
11
|
+
readonly PARTNER_COMMISSION: "partner_commission";
|
|
12
|
+
readonly CUSTOM: "custom";
|
|
13
|
+
};
|
|
14
|
+
type SplitType = typeof SPLIT_TYPE;
|
|
15
|
+
type SplitTypeValue = SplitType[keyof SplitType];
|
|
16
|
+
declare const SPLIT_TYPE_VALUES: SplitTypeValue[];
|
|
17
|
+
declare const SPLIT_STATUS: {
|
|
18
|
+
readonly PENDING: "pending";
|
|
19
|
+
readonly DUE: "due";
|
|
20
|
+
readonly PAID: "paid";
|
|
21
|
+
readonly WAIVED: "waived";
|
|
22
|
+
readonly CANCELLED: "cancelled";
|
|
23
|
+
};
|
|
24
|
+
type SplitStatus = typeof SPLIT_STATUS;
|
|
25
|
+
type SplitStatusValue = SplitStatus[keyof SplitStatus];
|
|
26
|
+
declare const SPLIT_STATUS_VALUES: SplitStatusValue[];
|
|
27
|
+
declare const PAYOUT_METHOD: {
|
|
28
|
+
readonly BANK_TRANSFER: "bank_transfer";
|
|
29
|
+
readonly MOBILE_WALLET: "mobile_wallet";
|
|
30
|
+
readonly PLATFORM_BALANCE: "platform_balance";
|
|
31
|
+
readonly CRYPTO: "crypto";
|
|
32
|
+
readonly CHECK: "check";
|
|
33
|
+
readonly MANUAL: "manual";
|
|
34
|
+
};
|
|
35
|
+
type PayoutMethod = typeof PAYOUT_METHOD;
|
|
36
|
+
type PayoutMethodValue = PayoutMethod[keyof PayoutMethod];
|
|
37
|
+
declare const PAYOUT_METHOD_VALUES: PayoutMethodValue[];
|
|
38
|
+
declare function isSplitType(value: unknown): value is SplitTypeValue;
|
|
39
|
+
declare function isSplitStatus(value: unknown): value is SplitStatusValue;
|
|
40
|
+
declare function isPayoutMethod(value: unknown): value is PayoutMethodValue;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Escrow/Hold Enums
|
|
44
|
+
* @classytic/revenue
|
|
45
|
+
*
|
|
46
|
+
* Enums for platform-as-intermediary payment flow
|
|
47
|
+
*/
|
|
48
|
+
declare const HOLD_STATUS: {
|
|
49
|
+
readonly PENDING: "pending";
|
|
50
|
+
readonly HELD: "held";
|
|
51
|
+
readonly RELEASED: "released";
|
|
52
|
+
readonly CANCELLED: "cancelled";
|
|
53
|
+
readonly EXPIRED: "expired";
|
|
54
|
+
readonly PARTIALLY_RELEASED: "partially_released";
|
|
55
|
+
};
|
|
56
|
+
type HoldStatus = typeof HOLD_STATUS;
|
|
57
|
+
type HoldStatusValue = HoldStatus[keyof HoldStatus];
|
|
58
|
+
declare const HOLD_STATUS_VALUES: HoldStatusValue[];
|
|
59
|
+
declare const RELEASE_REASON: {
|
|
60
|
+
readonly PAYMENT_VERIFIED: "payment_verified";
|
|
61
|
+
readonly MANUAL_RELEASE: "manual_release";
|
|
62
|
+
readonly AUTO_RELEASE: "auto_release";
|
|
63
|
+
readonly DISPUTE_RESOLVED: "dispute_resolved";
|
|
64
|
+
};
|
|
65
|
+
type ReleaseReason = typeof RELEASE_REASON;
|
|
66
|
+
type ReleaseReasonValue = ReleaseReason[keyof ReleaseReason];
|
|
67
|
+
declare const RELEASE_REASON_VALUES: ReleaseReasonValue[];
|
|
68
|
+
declare const HOLD_REASON: {
|
|
69
|
+
readonly PAYMENT_VERIFICATION: "payment_verification";
|
|
70
|
+
readonly FRAUD_CHECK: "fraud_check";
|
|
71
|
+
readonly MANUAL_REVIEW: "manual_review";
|
|
72
|
+
readonly DISPUTE: "dispute";
|
|
73
|
+
readonly COMPLIANCE: "compliance";
|
|
74
|
+
};
|
|
75
|
+
type HoldReason = typeof HOLD_REASON;
|
|
76
|
+
type HoldReasonValue = HoldReason[keyof HoldReason];
|
|
77
|
+
declare const HOLD_REASON_VALUES: HoldReasonValue[];
|
|
78
|
+
declare function isHoldStatus(value: unknown): value is HoldStatusValue;
|
|
79
|
+
declare function isReleaseReason(value: unknown): value is ReleaseReasonValue;
|
|
80
|
+
declare function isHoldReason(value: unknown): value is HoldReasonValue;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Subscription Enums
|
|
84
|
+
* @classytic/revenue
|
|
85
|
+
*
|
|
86
|
+
* All subscription-related enums and constants
|
|
87
|
+
*/
|
|
88
|
+
/**
|
|
89
|
+
* Subscription Status
|
|
90
|
+
*/
|
|
91
|
+
declare const SUBSCRIPTION_STATUS: {
|
|
92
|
+
readonly ACTIVE: "active";
|
|
93
|
+
readonly PAUSED: "paused";
|
|
94
|
+
readonly CANCELLED: "cancelled";
|
|
95
|
+
readonly EXPIRED: "expired";
|
|
96
|
+
readonly PENDING: "pending";
|
|
97
|
+
readonly INACTIVE: "inactive";
|
|
98
|
+
};
|
|
99
|
+
type SubscriptionStatus = typeof SUBSCRIPTION_STATUS;
|
|
100
|
+
type SubscriptionStatusValue = SubscriptionStatus[keyof SubscriptionStatus];
|
|
101
|
+
declare const SUBSCRIPTION_STATUS_VALUES: SubscriptionStatusValue[];
|
|
102
|
+
/**
|
|
103
|
+
* Supported plan intervals
|
|
104
|
+
*/
|
|
105
|
+
declare const PLAN_KEYS: {
|
|
106
|
+
readonly MONTHLY: "monthly";
|
|
107
|
+
readonly QUARTERLY: "quarterly";
|
|
108
|
+
readonly YEARLY: "yearly";
|
|
109
|
+
};
|
|
110
|
+
type PlanKeys = typeof PLAN_KEYS;
|
|
111
|
+
type PlanKeyValue = PlanKeys[keyof PlanKeys];
|
|
112
|
+
declare const PLAN_KEY_VALUES: PlanKeyValue[];
|
|
113
|
+
declare function isSubscriptionStatus(value: unknown): value is SubscriptionStatusValue;
|
|
114
|
+
declare function isPlanKey(value: unknown): value is PlanKeyValue;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Payment Enums
|
|
118
|
+
* @classytic/revenue
|
|
119
|
+
*
|
|
120
|
+
* Library-managed payment enums only.
|
|
121
|
+
* Users define their own payment methods in their schema.
|
|
122
|
+
*/
|
|
123
|
+
/**
|
|
124
|
+
* Payment Status - Library-managed states
|
|
125
|
+
*/
|
|
126
|
+
declare const PAYMENT_STATUS: {
|
|
127
|
+
readonly PENDING: "pending";
|
|
128
|
+
readonly VERIFIED: "verified";
|
|
129
|
+
readonly FAILED: "failed";
|
|
130
|
+
readonly REFUNDED: "refunded";
|
|
131
|
+
readonly CANCELLED: "cancelled";
|
|
132
|
+
};
|
|
133
|
+
type PaymentStatus = typeof PAYMENT_STATUS;
|
|
134
|
+
type PaymentStatusValue = PaymentStatus[keyof PaymentStatus];
|
|
135
|
+
declare const PAYMENT_STATUS_VALUES: PaymentStatusValue[];
|
|
136
|
+
/**
|
|
137
|
+
* Common gateway type constants for convenience
|
|
138
|
+
*
|
|
139
|
+
* ⚠️ IMPORTANT: These are NOT restrictions - just common reference values
|
|
140
|
+
*
|
|
141
|
+
* You can register ANY custom gateway provider by passing it to createRevenue():
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* ```typescript
|
|
145
|
+
* const revenue = createRevenue({
|
|
146
|
+
* providers: {
|
|
147
|
+
* manual: new ManualProvider(),
|
|
148
|
+
* bkash: new BkashProvider(), // ✅ Custom gateway
|
|
149
|
+
* nagad: new NagadProvider(), // ✅ Custom gateway
|
|
150
|
+
* stripe: new StripeProvider(), // ✅ Custom gateway
|
|
151
|
+
* paypal: new PaypalProvider(), // ✅ Any gateway you want
|
|
152
|
+
* }
|
|
153
|
+
* });
|
|
154
|
+
*
|
|
155
|
+
* // Use by name
|
|
156
|
+
* await revenue.monetization.create({ gateway: 'bkash', ... });
|
|
157
|
+
* ```
|
|
158
|
+
*
|
|
159
|
+
* Reference values:
|
|
160
|
+
* - MANUAL: Built-in manual provider (@classytic/revenue-manual)
|
|
161
|
+
* - STRIPE: Stripe provider (build with @classytic/revenue-stripe)
|
|
162
|
+
* - SSLCOMMERZ: SSLCommerz provider (build with @classytic/revenue-sslcommerz)
|
|
163
|
+
*
|
|
164
|
+
* Add your own: bkash, nagad, rocket, paypal, razorpay, flutterwave, etc.
|
|
165
|
+
*/
|
|
166
|
+
declare const PAYMENT_GATEWAY_TYPE: {
|
|
167
|
+
readonly MANUAL: "manual";
|
|
168
|
+
readonly STRIPE: "stripe";
|
|
169
|
+
readonly SSLCOMMERZ: "sslcommerz";
|
|
170
|
+
};
|
|
171
|
+
type PaymentGatewayType = typeof PAYMENT_GATEWAY_TYPE;
|
|
172
|
+
type PaymentGatewayTypeValue = PaymentGatewayType[keyof PaymentGatewayType];
|
|
173
|
+
declare const PAYMENT_GATEWAY_TYPE_VALUES: PaymentGatewayTypeValue[];
|
|
174
|
+
declare const GATEWAY_TYPES: {
|
|
175
|
+
readonly MANUAL: "manual";
|
|
176
|
+
readonly STRIPE: "stripe";
|
|
177
|
+
readonly SSLCOMMERZ: "sslcommerz";
|
|
178
|
+
};
|
|
179
|
+
declare const GATEWAY_TYPE_VALUES: PaymentGatewayTypeValue[];
|
|
180
|
+
declare function isPaymentStatus(value: unknown): value is PaymentStatusValue;
|
|
181
|
+
declare function isPaymentGatewayType(value: unknown): value is PaymentGatewayTypeValue;
|
|
182
|
+
declare const isGatewayType: typeof isPaymentGatewayType;
|
|
183
|
+
|
|
184
|
+
export { SPLIT_TYPE_VALUES as A, SPLIT_STATUS as B, type SplitStatus as C, SPLIT_STATUS_VALUES as D, PAYOUT_METHOD as E, type PayoutMethod as F, GATEWAY_TYPES as G, HOLD_STATUS as H, PAYOUT_METHOD_VALUES as I, isSplitType as J, isSplitStatus as K, isPayoutMethod as L, type PaymentStatusValue as M, type PaymentGatewayTypeValue as N, type SubscriptionStatusValue as O, PAYMENT_STATUS as P, type PlanKeyValue as Q, RELEASE_REASON as R, SUBSCRIPTION_STATUS as S, type HoldStatusValue as T, type ReleaseReasonValue as U, type HoldReasonValue as V, type SplitTypeValue as W, type SplitStatusValue as X, type PayoutMethodValue as Y, type SubscriptionStatus as Z, type HoldStatus as _, type PaymentStatus as a, PAYMENT_STATUS_VALUES as b, PAYMENT_GATEWAY_TYPE as c, type PaymentGatewayType as d, PAYMENT_GATEWAY_TYPE_VALUES as e, GATEWAY_TYPE_VALUES as f, isPaymentGatewayType as g, isGatewayType as h, isPaymentStatus as i, SUBSCRIPTION_STATUS_VALUES as j, PLAN_KEYS as k, type PlanKeys as l, PLAN_KEY_VALUES as m, isSubscriptionStatus as n, isPlanKey as o, HOLD_STATUS_VALUES as p, type ReleaseReason as q, RELEASE_REASON_VALUES as r, HOLD_REASON as s, type HoldReason as t, HOLD_REASON_VALUES as u, isHoldStatus as v, isReleaseReason as w, isHoldReason as x, SPLIT_TYPE as y, type SplitType as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { s as CreateIntentParams, t as PaymentIntentData, u as PaymentResultData, v as RefundResultData, w as WebhookEventData, x as ProviderCapabilities } from '../index-C5SsOrV0.js';
|
|
2
2
|
import 'mongoose';
|
|
3
3
|
|
|
4
4
|
/**
|