@qelos/global-types 4.0.0 → 4.1.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/integration-sources.ts +33 -0
- package/package.json +1 -1
- package/payments.ts +13 -0
package/integration-sources.ts
CHANGED
|
@@ -14,6 +14,7 @@ export enum IntegrationSourceKind {
|
|
|
14
14
|
Sumit = 'sumit',
|
|
15
15
|
PayPal = 'paypal',
|
|
16
16
|
Paddle = 'paddle',
|
|
17
|
+
DodoPayments = 'dodopayments',
|
|
17
18
|
AWS = 'aws',
|
|
18
19
|
Cloudflare = 'cloudflare',
|
|
19
20
|
}
|
|
@@ -117,6 +118,27 @@ export const PaddleTargetOperation = {
|
|
|
117
118
|
listCustomers: 'listCustomers',
|
|
118
119
|
} as const;
|
|
119
120
|
|
|
121
|
+
export const DodoPaymentsTargetOperation = {
|
|
122
|
+
// Payments
|
|
123
|
+
createPayment: 'createPayment',
|
|
124
|
+
getPayment: 'getPayment',
|
|
125
|
+
listPayments: 'listPayments',
|
|
126
|
+
// Subscriptions
|
|
127
|
+
createSubscription: 'createSubscription',
|
|
128
|
+
getSubscription: 'getSubscription',
|
|
129
|
+
updateSubscription: 'updateSubscription',
|
|
130
|
+
cancelSubscription: 'cancelSubscription',
|
|
131
|
+
listSubscriptions: 'listSubscriptions',
|
|
132
|
+
// Products
|
|
133
|
+
createProduct: 'createProduct',
|
|
134
|
+
getProduct: 'getProduct',
|
|
135
|
+
listProducts: 'listProducts',
|
|
136
|
+
// Customers
|
|
137
|
+
createCustomer: 'createCustomer',
|
|
138
|
+
getCustomer: 'getCustomer',
|
|
139
|
+
listCustomers: 'listCustomers',
|
|
140
|
+
} as const;
|
|
141
|
+
|
|
120
142
|
export const AWSTargetOperation = {
|
|
121
143
|
callFunction: 'callFunction',
|
|
122
144
|
getFunction: 'getFunction',
|
|
@@ -203,6 +225,17 @@ export interface IPaddleSource extends IIntegrationSource {
|
|
|
203
225
|
};
|
|
204
226
|
}
|
|
205
227
|
|
|
228
|
+
export interface IDodoPaymentsSource extends IIntegrationSource {
|
|
229
|
+
_id?: string;
|
|
230
|
+
kind: IntegrationSourceKind.DodoPayments;
|
|
231
|
+
authentication: {
|
|
232
|
+
apiKey: string;
|
|
233
|
+
};
|
|
234
|
+
metadata: {
|
|
235
|
+
environment: 'test' | 'live';
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
|
|
206
239
|
export interface IQelosSource extends IIntegrationSource {
|
|
207
240
|
_id?: string;
|
|
208
241
|
kind: IntegrationSourceKind.Qelos;
|
package/package.json
CHANGED
package/payments.ts
CHANGED
|
@@ -49,6 +49,13 @@ export interface IPlan {
|
|
|
49
49
|
isActive: boolean;
|
|
50
50
|
/** Controls display order — lower numbers appear first. */
|
|
51
51
|
sortOrder: number;
|
|
52
|
+
/**
|
|
53
|
+
* When `true`, the price is not fixed — it is calculated at checkout time
|
|
54
|
+
* (e.g. per-user, per-item, or otherwise variable). `monthlyPrice` /
|
|
55
|
+
* `yearlyPrice` are ignored for dynamic plans; the caller must supply an
|
|
56
|
+
* `amount` at checkout instead.
|
|
57
|
+
*/
|
|
58
|
+
dynamic?: boolean;
|
|
52
59
|
limits?: IPlanLimits;
|
|
53
60
|
externalIds?: IPlanExternalIds;
|
|
54
61
|
metadata?: Record<string, any>;
|
|
@@ -74,6 +81,12 @@ export interface ISubscription {
|
|
|
74
81
|
/** Payment provider kind (e.g. "paddle", "paypal", "sumit"). */
|
|
75
82
|
providerKind?: string;
|
|
76
83
|
couponId?: string;
|
|
84
|
+
/**
|
|
85
|
+
* Admin-configured charge amount for dynamic-priced plans. Only admins may
|
|
86
|
+
* set this field; it is read by the checkout service when `IPlan.dynamic` is
|
|
87
|
+
* `true`. Must be set before checkout can proceed on a dynamic plan.
|
|
88
|
+
*/
|
|
89
|
+
dynamicAmount?: number;
|
|
77
90
|
metadata?: Record<string, any>;
|
|
78
91
|
created?: Date;
|
|
79
92
|
}
|