@blocklet/payment-types 1.13.113
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 +9 -0
- package/index.js +1 -0
- package/lib/.gitkeep +0 -0
- package/lib/checkout-session.d.ts +291 -0
- package/lib/coupon.d.ts +99 -0
- package/lib/customer.d.ts +137 -0
- package/lib/discount.d.ts +81 -0
- package/lib/event.d.ts +76 -0
- package/lib/index.d.ts +196 -0
- package/lib/invoice-item.d.ts +127 -0
- package/lib/invoice.d.ts +356 -0
- package/lib/job.d.ts +56 -0
- package/lib/payment-currency.d.ts +99 -0
- package/lib/payment-intent.d.ts +158 -0
- package/lib/payment-link.d.ts +143 -0
- package/lib/payment-method.d.ts +102 -0
- package/lib/price.d.ts +156 -0
- package/lib/pricing-table.d.ts +109 -0
- package/lib/product.d.ts +104 -0
- package/lib/promotion-code.d.ts +81 -0
- package/lib/setup-intent.d.ts +112 -0
- package/lib/subscription-item.d.ts +61 -0
- package/lib/subscription-schedule.d.ts +110 -0
- package/lib/subscription.d.ts +216 -0
- package/lib/types.d.ts +285 -0
- package/lib/usage-record.d.ts +54 -0
- package/lib/webhook-attempt.d.ts +63 -0
- package/lib/webhook-endpoint.d.ts +68 -0
- package/package.json +52 -0
package/README.md
ADDED
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = {};
|
package/lib/.gitkeep
ADDED
|
File without changes
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import { CreationOptional, DataTypes, FindOptions, InferAttributes, InferCreationAttributes, Model } from 'sequelize';
|
|
2
|
+
import type { LiteralUnion } from 'type-fest';
|
|
3
|
+
import type { CurrencyConversion, CustomField, CustomerDetail, InvoiceData, LineItem, NftMintDetails, NftMintSettings, PaymentDetails } from './types';
|
|
4
|
+
export declare const nextCheckoutSessionId: (size?: number | undefined) => string;
|
|
5
|
+
export declare class CheckoutSession extends Model<InferAttributes<CheckoutSession>, InferCreationAttributes<CheckoutSession>> {
|
|
6
|
+
id: CreationOptional<string>;
|
|
7
|
+
livemode: boolean;
|
|
8
|
+
client_reference_id?: string;
|
|
9
|
+
currency_id: string;
|
|
10
|
+
invoice_id?: string;
|
|
11
|
+
customer_id?: string;
|
|
12
|
+
customer_did?: string;
|
|
13
|
+
payment_link_id?: string;
|
|
14
|
+
subscription_id?: string;
|
|
15
|
+
recovered_from?: string;
|
|
16
|
+
payment_intent_id?: string;
|
|
17
|
+
setup_intent_id?: string;
|
|
18
|
+
mode: LiteralUnion<'payment' | 'setup' | 'subscription', string>;
|
|
19
|
+
status: LiteralUnion<'complete' | 'open' | 'expired', string>;
|
|
20
|
+
payment_status: LiteralUnion<'paid' | 'unpaid' | 'no_payment_required', string>;
|
|
21
|
+
line_items: LineItem[];
|
|
22
|
+
amount_subtotal: string;
|
|
23
|
+
amount_total: string;
|
|
24
|
+
total_details?: {
|
|
25
|
+
amount_discount?: string;
|
|
26
|
+
amount_shipping?: string;
|
|
27
|
+
amount_tax?: string;
|
|
28
|
+
breakdown?: {
|
|
29
|
+
discounts?: {
|
|
30
|
+
amount?: string;
|
|
31
|
+
discount?: string;
|
|
32
|
+
}[];
|
|
33
|
+
taxes?: {
|
|
34
|
+
amount?: string;
|
|
35
|
+
rate?: string;
|
|
36
|
+
}[];
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
url?: string;
|
|
40
|
+
cancel_url?: string;
|
|
41
|
+
success_url?: string;
|
|
42
|
+
currency_conversion?: CurrencyConversion;
|
|
43
|
+
customer_details?: CustomerDetail;
|
|
44
|
+
customer_creation: LiteralUnion<'if_required' | 'always', string>;
|
|
45
|
+
customer_update?: {
|
|
46
|
+
address: LiteralUnion<'auto' | 'never', string>;
|
|
47
|
+
name: LiteralUnion<'auto' | 'never', string>;
|
|
48
|
+
shipping: LiteralUnion<'auto' | 'never', string>;
|
|
49
|
+
};
|
|
50
|
+
after_expiration?: {
|
|
51
|
+
recovery: {
|
|
52
|
+
enabled: boolean;
|
|
53
|
+
allow_promotion_codes?: boolean;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
allow_promotion_codes?: boolean;
|
|
57
|
+
consent_collection?: {
|
|
58
|
+
promotions?: LiteralUnion<'auto' | 'none', string>;
|
|
59
|
+
terms_of_service?: LiteralUnion<'required' | 'none', string>;
|
|
60
|
+
};
|
|
61
|
+
consent?: {
|
|
62
|
+
promotions?: LiteralUnion<'opt_in', string>;
|
|
63
|
+
terms_of_service?: LiteralUnion<'accepted', string>;
|
|
64
|
+
};
|
|
65
|
+
custom_fields?: CustomField[];
|
|
66
|
+
custom_text?: {
|
|
67
|
+
shipping_address?: string;
|
|
68
|
+
submit?: string;
|
|
69
|
+
};
|
|
70
|
+
expires_at: number;
|
|
71
|
+
invoice_creation?: {
|
|
72
|
+
enabled: boolean;
|
|
73
|
+
invoice_data?: InvoiceData;
|
|
74
|
+
};
|
|
75
|
+
payment_method_types: string[];
|
|
76
|
+
phone_number_collection?: {
|
|
77
|
+
enabled: boolean;
|
|
78
|
+
};
|
|
79
|
+
submit_type: LiteralUnion<'auto' | 'book' | 'donate' | 'pay', string>;
|
|
80
|
+
metadata?: Record<string, any>;
|
|
81
|
+
billing_address_collection?: LiteralUnion<'auto' | 'required', string>;
|
|
82
|
+
subscription_data?: {
|
|
83
|
+
description: string;
|
|
84
|
+
trial_period_days: number;
|
|
85
|
+
billing_cycle_anchor?: number;
|
|
86
|
+
metadata?: Record<string, any>;
|
|
87
|
+
proration_behavior?: LiteralUnion<'create_prorations' | 'none', string>;
|
|
88
|
+
trial_end?: number;
|
|
89
|
+
trial_settings?: {
|
|
90
|
+
end_behavior: {
|
|
91
|
+
missing_payment_method: LiteralUnion<'cancel' | 'pause' | 'create_invoice', string>;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
payment_details?: PaymentDetails;
|
|
96
|
+
payment_intent_data?: {
|
|
97
|
+
description?: string;
|
|
98
|
+
statement_descriptor?: string;
|
|
99
|
+
metadata?: Record<string, any>;
|
|
100
|
+
};
|
|
101
|
+
nft_mint_status: LiteralUnion<'disabled' | 'pending' | 'minted' | 'sent' | 'error', string>;
|
|
102
|
+
nft_mint_settings?: NftMintSettings;
|
|
103
|
+
nft_mint_details?: NftMintDetails;
|
|
104
|
+
cross_sell_behavior?: LiteralUnion<'auto' | 'required', string>;
|
|
105
|
+
created_at: CreationOptional<Date>;
|
|
106
|
+
created_via: LiteralUnion<'api' | 'dashboard' | 'portal', string>;
|
|
107
|
+
updated_at: CreationOptional<Date>;
|
|
108
|
+
static readonly GENESIS_ATTRIBUTES: {
|
|
109
|
+
id: {
|
|
110
|
+
type: DataTypes.StringDataType;
|
|
111
|
+
primaryKey: boolean;
|
|
112
|
+
allowNull: boolean;
|
|
113
|
+
defaultValue: (size?: number | undefined) => string;
|
|
114
|
+
};
|
|
115
|
+
livemode: {
|
|
116
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
117
|
+
allowNull: boolean;
|
|
118
|
+
};
|
|
119
|
+
client_reference_id: {
|
|
120
|
+
type: DataTypes.StringDataType;
|
|
121
|
+
allowNull: boolean;
|
|
122
|
+
};
|
|
123
|
+
currency_id: {
|
|
124
|
+
type: DataTypes.StringDataType;
|
|
125
|
+
allowNull: boolean;
|
|
126
|
+
};
|
|
127
|
+
invoice_id: {
|
|
128
|
+
type: DataTypes.StringDataType;
|
|
129
|
+
allowNull: boolean;
|
|
130
|
+
};
|
|
131
|
+
customer_id: {
|
|
132
|
+
type: DataTypes.StringDataType;
|
|
133
|
+
allowNull: boolean;
|
|
134
|
+
};
|
|
135
|
+
customer_did: {
|
|
136
|
+
type: DataTypes.StringDataType;
|
|
137
|
+
allowNull: boolean;
|
|
138
|
+
};
|
|
139
|
+
payment_link_id: {
|
|
140
|
+
type: DataTypes.StringDataType;
|
|
141
|
+
allowNull: boolean;
|
|
142
|
+
};
|
|
143
|
+
subscription_id: {
|
|
144
|
+
type: DataTypes.StringDataType;
|
|
145
|
+
allowNull: boolean;
|
|
146
|
+
};
|
|
147
|
+
recovered_from: {
|
|
148
|
+
type: DataTypes.StringDataType;
|
|
149
|
+
allowNull: boolean;
|
|
150
|
+
};
|
|
151
|
+
payment_intent_id: {
|
|
152
|
+
type: DataTypes.StringDataType;
|
|
153
|
+
allowNull: boolean;
|
|
154
|
+
};
|
|
155
|
+
mode: {
|
|
156
|
+
type: DataTypes.EnumDataType<"subscription" | "payment" | "setup">;
|
|
157
|
+
allowNull: boolean;
|
|
158
|
+
};
|
|
159
|
+
status: {
|
|
160
|
+
type: DataTypes.EnumDataType<"open" | "complete" | "expired">;
|
|
161
|
+
allowNull: boolean;
|
|
162
|
+
};
|
|
163
|
+
payment_status: {
|
|
164
|
+
type: DataTypes.EnumDataType<"paid" | "unpaid" | "no_payment_required">;
|
|
165
|
+
allowNull: boolean;
|
|
166
|
+
};
|
|
167
|
+
line_items: {
|
|
168
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
169
|
+
allowNull: boolean;
|
|
170
|
+
};
|
|
171
|
+
amount_subtotal: {
|
|
172
|
+
type: DataTypes.StringDataType;
|
|
173
|
+
allowNull: boolean;
|
|
174
|
+
};
|
|
175
|
+
amount_total: {
|
|
176
|
+
type: DataTypes.StringDataType;
|
|
177
|
+
allowNull: boolean;
|
|
178
|
+
};
|
|
179
|
+
total_details: {
|
|
180
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
181
|
+
allowNull: boolean;
|
|
182
|
+
};
|
|
183
|
+
url: {
|
|
184
|
+
type: DataTypes.StringDataType;
|
|
185
|
+
allowNull: boolean;
|
|
186
|
+
};
|
|
187
|
+
cancel_url: {
|
|
188
|
+
type: DataTypes.StringDataType;
|
|
189
|
+
allowNull: boolean;
|
|
190
|
+
};
|
|
191
|
+
success_url: {
|
|
192
|
+
type: DataTypes.StringDataType;
|
|
193
|
+
allowNull: boolean;
|
|
194
|
+
};
|
|
195
|
+
currency_conversion: {
|
|
196
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
197
|
+
allowNull: boolean;
|
|
198
|
+
};
|
|
199
|
+
after_expiration: {
|
|
200
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
201
|
+
allowNull: boolean;
|
|
202
|
+
};
|
|
203
|
+
allow_promotion_codes: {
|
|
204
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
205
|
+
defaultValue: boolean;
|
|
206
|
+
};
|
|
207
|
+
consent_collection: {
|
|
208
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
209
|
+
allowNull: boolean;
|
|
210
|
+
};
|
|
211
|
+
consent: {
|
|
212
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
213
|
+
allowNull: boolean;
|
|
214
|
+
};
|
|
215
|
+
custom_fields: {
|
|
216
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
217
|
+
defaultValue: never[];
|
|
218
|
+
};
|
|
219
|
+
custom_text: {
|
|
220
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
221
|
+
allowNull: boolean;
|
|
222
|
+
};
|
|
223
|
+
customer_creation: {
|
|
224
|
+
type: DataTypes.EnumDataType<"if_required" | "always">;
|
|
225
|
+
allowNull: boolean;
|
|
226
|
+
};
|
|
227
|
+
customer_update: {
|
|
228
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
229
|
+
defaultValue: {
|
|
230
|
+
address: string;
|
|
231
|
+
name: string;
|
|
232
|
+
shipping: string;
|
|
233
|
+
};
|
|
234
|
+
};
|
|
235
|
+
expires_at: {
|
|
236
|
+
type: DataTypes.IntegerDataTypeConstructor;
|
|
237
|
+
allowNull: boolean;
|
|
238
|
+
};
|
|
239
|
+
invoice_creation: {
|
|
240
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
241
|
+
allowNull: boolean;
|
|
242
|
+
};
|
|
243
|
+
payment_method_types: {
|
|
244
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
245
|
+
defaultValue: never[];
|
|
246
|
+
};
|
|
247
|
+
phone_number_collection: {
|
|
248
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
249
|
+
allowNull: boolean;
|
|
250
|
+
};
|
|
251
|
+
billing_address_collection: {
|
|
252
|
+
type: DataTypes.EnumDataType<"auto" | "required">;
|
|
253
|
+
defaultValue: string;
|
|
254
|
+
allowNull: boolean;
|
|
255
|
+
};
|
|
256
|
+
submit_type: {
|
|
257
|
+
type: DataTypes.EnumDataType<"auto" | "book" | "donate" | "pay">;
|
|
258
|
+
allowNull: boolean;
|
|
259
|
+
};
|
|
260
|
+
subscription_data: {
|
|
261
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
262
|
+
allowNull: boolean;
|
|
263
|
+
};
|
|
264
|
+
payment_details: {
|
|
265
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
266
|
+
allowNull: boolean;
|
|
267
|
+
};
|
|
268
|
+
metadata: {
|
|
269
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
270
|
+
allowNull: boolean;
|
|
271
|
+
};
|
|
272
|
+
created_at: {
|
|
273
|
+
type: DataTypes.DateDataTypeConstructor;
|
|
274
|
+
defaultValue: DataTypes.AbstractDataTypeConstructor;
|
|
275
|
+
allowNull: boolean;
|
|
276
|
+
};
|
|
277
|
+
created_via: {
|
|
278
|
+
type: DataTypes.EnumDataType<"api" | "dashboard" | "portal">;
|
|
279
|
+
};
|
|
280
|
+
updated_at: {
|
|
281
|
+
type: DataTypes.DateDataTypeConstructor;
|
|
282
|
+
defaultValue: DataTypes.AbstractDataTypeConstructor;
|
|
283
|
+
allowNull: boolean;
|
|
284
|
+
};
|
|
285
|
+
};
|
|
286
|
+
static initialize(sequelize: any): void;
|
|
287
|
+
static associate(models: any): void;
|
|
288
|
+
static findByPkOrClientRefId(id: string, options?: FindOptions<CheckoutSession>): Promise<CheckoutSession | null>;
|
|
289
|
+
isImmutable(): boolean;
|
|
290
|
+
}
|
|
291
|
+
export type TCheckoutSession = InferAttributes<CheckoutSession>;
|
package/lib/coupon.d.ts
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { CreationOptional, DataTypes, InferAttributes, InferCreationAttributes, Model } from 'sequelize';
|
|
2
|
+
import type { LiteralUnion } from 'type-fest';
|
|
3
|
+
export declare class Coupon extends Model<InferAttributes<Coupon>, InferCreationAttributes<Coupon>> {
|
|
4
|
+
id: CreationOptional<string>;
|
|
5
|
+
livemode: boolean;
|
|
6
|
+
amount_off: string;
|
|
7
|
+
percent_off: number;
|
|
8
|
+
currency_id: string;
|
|
9
|
+
duration: LiteralUnion<'forever' | 'once' | 'repeating', string>;
|
|
10
|
+
duration_in_months: number;
|
|
11
|
+
name: string;
|
|
12
|
+
metadata: Record<string, any>;
|
|
13
|
+
applies_to?: {
|
|
14
|
+
products: string[];
|
|
15
|
+
};
|
|
16
|
+
currency_options?: Record<string, number>;
|
|
17
|
+
max_redemptions?: number;
|
|
18
|
+
redeem_by?: Date;
|
|
19
|
+
times_redeemed?: number;
|
|
20
|
+
valid?: boolean;
|
|
21
|
+
created_at: CreationOptional<Date>;
|
|
22
|
+
updated_at: CreationOptional<Date>;
|
|
23
|
+
static readonly GENESIS_ATTRIBUTES: {
|
|
24
|
+
id: {
|
|
25
|
+
type: DataTypes.StringDataType;
|
|
26
|
+
primaryKey: boolean;
|
|
27
|
+
allowNull: boolean;
|
|
28
|
+
defaultValue: (size?: number | undefined) => string;
|
|
29
|
+
};
|
|
30
|
+
livemode: {
|
|
31
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
32
|
+
allowNull: boolean;
|
|
33
|
+
};
|
|
34
|
+
amount_off: {
|
|
35
|
+
type: DataTypes.StringDataType;
|
|
36
|
+
defaultValue: string;
|
|
37
|
+
};
|
|
38
|
+
percent_off: {
|
|
39
|
+
type: DataTypes.IntegerDataTypeConstructor;
|
|
40
|
+
defaultValue: number;
|
|
41
|
+
};
|
|
42
|
+
currency_id: {
|
|
43
|
+
type: DataTypes.StringDataType;
|
|
44
|
+
allowNull: boolean;
|
|
45
|
+
};
|
|
46
|
+
duration: {
|
|
47
|
+
type: DataTypes.EnumDataType<"forever" | "once" | "repeating">;
|
|
48
|
+
};
|
|
49
|
+
duration_in_months: {
|
|
50
|
+
type: DataTypes.IntegerDataTypeConstructor;
|
|
51
|
+
allowNull: boolean;
|
|
52
|
+
};
|
|
53
|
+
name: {
|
|
54
|
+
type: DataTypes.StringDataType;
|
|
55
|
+
allowNull: boolean;
|
|
56
|
+
};
|
|
57
|
+
applies_to: {
|
|
58
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
59
|
+
allowNull: boolean;
|
|
60
|
+
};
|
|
61
|
+
currency_options: {
|
|
62
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
63
|
+
defaultValue: {};
|
|
64
|
+
};
|
|
65
|
+
max_redemptions: {
|
|
66
|
+
type: DataTypes.IntegerDataTypeConstructor;
|
|
67
|
+
allowNull: boolean;
|
|
68
|
+
};
|
|
69
|
+
redeem_by: {
|
|
70
|
+
type: DataTypes.DateDataTypeConstructor;
|
|
71
|
+
allowNull: boolean;
|
|
72
|
+
};
|
|
73
|
+
times_redeemed: {
|
|
74
|
+
type: DataTypes.IntegerDataTypeConstructor;
|
|
75
|
+
defaultValue: number;
|
|
76
|
+
};
|
|
77
|
+
valid: {
|
|
78
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
79
|
+
defaultValue: boolean;
|
|
80
|
+
};
|
|
81
|
+
metadata: {
|
|
82
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
83
|
+
allowNull: boolean;
|
|
84
|
+
};
|
|
85
|
+
created_at: {
|
|
86
|
+
type: DataTypes.DateDataTypeConstructor;
|
|
87
|
+
defaultValue: DataTypes.AbstractDataTypeConstructor;
|
|
88
|
+
allowNull: boolean;
|
|
89
|
+
};
|
|
90
|
+
updated_at: {
|
|
91
|
+
type: DataTypes.DateDataTypeConstructor;
|
|
92
|
+
defaultValue: DataTypes.AbstractDataTypeConstructor;
|
|
93
|
+
allowNull: boolean;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
static initialize(sequelize: any): void;
|
|
97
|
+
static associate(models: any): void;
|
|
98
|
+
}
|
|
99
|
+
export type TCoupon = InferAttributes<Coupon>;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { CreationOptional, DataTypes, FindOptions, InferAttributes, InferCreationAttributes, Model } from 'sequelize';
|
|
2
|
+
import type { CustomerAddress, CustomerShipping } from './types';
|
|
3
|
+
export declare const nextCustomerId: (size?: number | undefined) => string;
|
|
4
|
+
export declare class Customer extends Model<InferAttributes<Customer>, InferCreationAttributes<Customer>> {
|
|
5
|
+
id: CreationOptional<string>;
|
|
6
|
+
livemode: boolean;
|
|
7
|
+
did: string;
|
|
8
|
+
description: string;
|
|
9
|
+
name: string;
|
|
10
|
+
email: string;
|
|
11
|
+
phone: string;
|
|
12
|
+
address?: CustomerAddress;
|
|
13
|
+
shipping?: CustomerShipping;
|
|
14
|
+
balance?: string;
|
|
15
|
+
token_balance?: Record<string, string>;
|
|
16
|
+
currency_id?: string;
|
|
17
|
+
delinquent: boolean;
|
|
18
|
+
discount_id?: string;
|
|
19
|
+
metadata: Record<string, any>;
|
|
20
|
+
invoice_credit_balance?: any;
|
|
21
|
+
invoice_prefix?: string;
|
|
22
|
+
invoice_settings?: {
|
|
23
|
+
custom_fields?: {
|
|
24
|
+
name: string;
|
|
25
|
+
value: string;
|
|
26
|
+
}[];
|
|
27
|
+
default_payment_method?: string;
|
|
28
|
+
footer?: string;
|
|
29
|
+
};
|
|
30
|
+
next_invoice_sequence?: number;
|
|
31
|
+
created_at: CreationOptional<Date>;
|
|
32
|
+
updated_at: CreationOptional<Date>;
|
|
33
|
+
static readonly GENESIS_ATTRIBUTES: {
|
|
34
|
+
id: {
|
|
35
|
+
type: DataTypes.StringDataType;
|
|
36
|
+
primaryKey: boolean;
|
|
37
|
+
allowNull: boolean;
|
|
38
|
+
defaultValue: (size?: number | undefined) => string;
|
|
39
|
+
};
|
|
40
|
+
livemode: {
|
|
41
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
42
|
+
allowNull: boolean;
|
|
43
|
+
};
|
|
44
|
+
did: {
|
|
45
|
+
type: DataTypes.StringDataType;
|
|
46
|
+
allowNull: boolean;
|
|
47
|
+
};
|
|
48
|
+
address: {
|
|
49
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
50
|
+
allowNull: boolean;
|
|
51
|
+
};
|
|
52
|
+
description: {
|
|
53
|
+
type: DataTypes.StringDataType;
|
|
54
|
+
allowNull: boolean;
|
|
55
|
+
};
|
|
56
|
+
name: {
|
|
57
|
+
type: DataTypes.StringDataType;
|
|
58
|
+
allowNull: boolean;
|
|
59
|
+
};
|
|
60
|
+
email: {
|
|
61
|
+
type: DataTypes.StringDataType;
|
|
62
|
+
allowNull: boolean;
|
|
63
|
+
};
|
|
64
|
+
phone: {
|
|
65
|
+
type: DataTypes.StringDataType;
|
|
66
|
+
allowNull: boolean;
|
|
67
|
+
};
|
|
68
|
+
shipping: {
|
|
69
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
70
|
+
allowNull: boolean;
|
|
71
|
+
};
|
|
72
|
+
balance: {
|
|
73
|
+
type: DataTypes.StringDataType;
|
|
74
|
+
defaultValue: string;
|
|
75
|
+
};
|
|
76
|
+
currency_id: {
|
|
77
|
+
type: DataTypes.StringDataType;
|
|
78
|
+
allowNull: boolean;
|
|
79
|
+
};
|
|
80
|
+
delinquent: {
|
|
81
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
82
|
+
allowNull: boolean;
|
|
83
|
+
};
|
|
84
|
+
discount_id: {
|
|
85
|
+
type: DataTypes.StringDataType;
|
|
86
|
+
allowNull: boolean;
|
|
87
|
+
};
|
|
88
|
+
metadata: {
|
|
89
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
90
|
+
allowNull: boolean;
|
|
91
|
+
};
|
|
92
|
+
invoice_credit_balance: {
|
|
93
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
94
|
+
allowNull: boolean;
|
|
95
|
+
};
|
|
96
|
+
invoice_prefix: {
|
|
97
|
+
type: DataTypes.StringDataType;
|
|
98
|
+
allowNull: boolean;
|
|
99
|
+
};
|
|
100
|
+
invoice_settings: {
|
|
101
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
102
|
+
allowNull: boolean;
|
|
103
|
+
};
|
|
104
|
+
next_invoice_sequence: {
|
|
105
|
+
type: DataTypes.NumberDataTypeConstructor;
|
|
106
|
+
defaultValue: number;
|
|
107
|
+
};
|
|
108
|
+
created_at: {
|
|
109
|
+
type: DataTypes.DateDataTypeConstructor;
|
|
110
|
+
defaultValue: DataTypes.AbstractDataTypeConstructor;
|
|
111
|
+
allowNull: boolean;
|
|
112
|
+
};
|
|
113
|
+
updated_at: {
|
|
114
|
+
type: DataTypes.DateDataTypeConstructor;
|
|
115
|
+
defaultValue: DataTypes.AbstractDataTypeConstructor;
|
|
116
|
+
allowNull: boolean;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
getInvoiceNumber(): Promise<string>;
|
|
120
|
+
getBalanceToApply(currencyId: string, amount: string): string;
|
|
121
|
+
decreaseTokenBalance(currencyId: string, amount: string, dryRun?: boolean): Promise<{
|
|
122
|
+
starting: Record<string, string>;
|
|
123
|
+
ending: {
|
|
124
|
+
[x: string]: any;
|
|
125
|
+
};
|
|
126
|
+
}>;
|
|
127
|
+
increaseTokenBalance(currencyId: string, amount: string, dryRun?: boolean): Promise<{
|
|
128
|
+
starting: Record<string, string>;
|
|
129
|
+
ending: {
|
|
130
|
+
[x: string]: any;
|
|
131
|
+
};
|
|
132
|
+
}>;
|
|
133
|
+
static initialize(sequelize: any): void;
|
|
134
|
+
static associate(models: any): void;
|
|
135
|
+
static findByPkOrDid(id: string, options?: FindOptions<Customer>): Promise<Customer | null>;
|
|
136
|
+
}
|
|
137
|
+
export type TCustomer = InferAttributes<Customer>;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { CreationOptional, DataTypes, InferAttributes, InferCreationAttributes, Model } from 'sequelize';
|
|
2
|
+
export declare class Discount extends Model<InferAttributes<Discount>, InferCreationAttributes<Discount>> {
|
|
3
|
+
id: CreationOptional<string>;
|
|
4
|
+
livemode: boolean;
|
|
5
|
+
coupon_id: string;
|
|
6
|
+
promotion_code_id?: string;
|
|
7
|
+
customer_id: string;
|
|
8
|
+
subscription_id?: string;
|
|
9
|
+
checkout_session_id?: string;
|
|
10
|
+
invoice_id?: string;
|
|
11
|
+
invoice_item_id?: string;
|
|
12
|
+
start: number;
|
|
13
|
+
end: number;
|
|
14
|
+
created_at: CreationOptional<Date>;
|
|
15
|
+
updated_at: CreationOptional<Date>;
|
|
16
|
+
static readonly GENESIS_ATTRIBUTES: {
|
|
17
|
+
id: {
|
|
18
|
+
type: DataTypes.StringDataType;
|
|
19
|
+
primaryKey: boolean;
|
|
20
|
+
allowNull: boolean;
|
|
21
|
+
defaultValue: (size?: number | undefined) => string;
|
|
22
|
+
};
|
|
23
|
+
livemode: {
|
|
24
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
25
|
+
allowNull: boolean;
|
|
26
|
+
};
|
|
27
|
+
coupon_id: {
|
|
28
|
+
type: DataTypes.StringDataType;
|
|
29
|
+
allowNull: boolean;
|
|
30
|
+
};
|
|
31
|
+
customer_id: {
|
|
32
|
+
type: DataTypes.StringDataType;
|
|
33
|
+
allowNull: boolean;
|
|
34
|
+
};
|
|
35
|
+
promotion_code_id: {
|
|
36
|
+
type: DataTypes.StringDataType;
|
|
37
|
+
allowNull: boolean;
|
|
38
|
+
};
|
|
39
|
+
subscription_id: {
|
|
40
|
+
type: DataTypes.StringDataType;
|
|
41
|
+
allowNull: boolean;
|
|
42
|
+
};
|
|
43
|
+
checkout_session_id: {
|
|
44
|
+
type: DataTypes.StringDataType;
|
|
45
|
+
allowNull: boolean;
|
|
46
|
+
};
|
|
47
|
+
invoice_id: {
|
|
48
|
+
type: DataTypes.StringDataType;
|
|
49
|
+
allowNull: boolean;
|
|
50
|
+
};
|
|
51
|
+
invoice_item_id: {
|
|
52
|
+
type: DataTypes.StringDataType;
|
|
53
|
+
allowNull: boolean;
|
|
54
|
+
};
|
|
55
|
+
start: {
|
|
56
|
+
type: DataTypes.DateDataTypeConstructor;
|
|
57
|
+
allowNull: boolean;
|
|
58
|
+
};
|
|
59
|
+
end: {
|
|
60
|
+
type: DataTypes.DateDataTypeConstructor;
|
|
61
|
+
allowNull: boolean;
|
|
62
|
+
};
|
|
63
|
+
metadata: {
|
|
64
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
65
|
+
allowNull: boolean;
|
|
66
|
+
};
|
|
67
|
+
created_at: {
|
|
68
|
+
type: DataTypes.DateDataTypeConstructor;
|
|
69
|
+
defaultValue: DataTypes.AbstractDataTypeConstructor;
|
|
70
|
+
allowNull: boolean;
|
|
71
|
+
};
|
|
72
|
+
updated_at: {
|
|
73
|
+
type: DataTypes.DateDataTypeConstructor;
|
|
74
|
+
defaultValue: DataTypes.AbstractDataTypeConstructor;
|
|
75
|
+
allowNull: boolean;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
static initialize(sequelize: any): void;
|
|
79
|
+
static associate(models: any): void;
|
|
80
|
+
}
|
|
81
|
+
export type TDiscount = InferAttributes<Discount>;
|
package/lib/event.d.ts
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { CreationOptional, DataTypes, InferAttributes, InferCreationAttributes, Model } from 'sequelize';
|
|
2
|
+
import type { EventType } from './types';
|
|
3
|
+
export declare class Event extends Model<InferAttributes<Event>, InferCreationAttributes<Event>> {
|
|
4
|
+
id: CreationOptional<string>;
|
|
5
|
+
livemode: boolean;
|
|
6
|
+
type: EventType;
|
|
7
|
+
api_version: string;
|
|
8
|
+
data: Record<string, any>;
|
|
9
|
+
object_type: string;
|
|
10
|
+
object_id: string;
|
|
11
|
+
request: {
|
|
12
|
+
id: string;
|
|
13
|
+
idempotency_key: string;
|
|
14
|
+
};
|
|
15
|
+
pending_webhooks: number;
|
|
16
|
+
metadata: Record<string, any>;
|
|
17
|
+
created_at: CreationOptional<Date>;
|
|
18
|
+
updated_at: CreationOptional<Date>;
|
|
19
|
+
static readonly GENESIS_ATTRIBUTES: {
|
|
20
|
+
id: {
|
|
21
|
+
type: DataTypes.StringDataType;
|
|
22
|
+
primaryKey: boolean;
|
|
23
|
+
allowNull: boolean;
|
|
24
|
+
defaultValue: (size?: number | undefined) => string;
|
|
25
|
+
};
|
|
26
|
+
livemode: {
|
|
27
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
28
|
+
allowNull: boolean;
|
|
29
|
+
};
|
|
30
|
+
type: {
|
|
31
|
+
type: DataTypes.StringDataType;
|
|
32
|
+
allowNull: boolean;
|
|
33
|
+
};
|
|
34
|
+
api_version: {
|
|
35
|
+
type: DataTypes.StringDataType;
|
|
36
|
+
allowNull: boolean;
|
|
37
|
+
};
|
|
38
|
+
object_type: {
|
|
39
|
+
type: DataTypes.StringDataType;
|
|
40
|
+
allowNull: boolean;
|
|
41
|
+
};
|
|
42
|
+
object_id: {
|
|
43
|
+
type: DataTypes.StringDataType;
|
|
44
|
+
allowNull: boolean;
|
|
45
|
+
};
|
|
46
|
+
data: {
|
|
47
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
48
|
+
allowNull: boolean;
|
|
49
|
+
};
|
|
50
|
+
request: {
|
|
51
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
52
|
+
allowNull: boolean;
|
|
53
|
+
};
|
|
54
|
+
pending_webhooks: {
|
|
55
|
+
type: DataTypes.NumberDataTypeConstructor;
|
|
56
|
+
allowNull: boolean;
|
|
57
|
+
};
|
|
58
|
+
metadata: {
|
|
59
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
60
|
+
allowNull: boolean;
|
|
61
|
+
};
|
|
62
|
+
created_at: {
|
|
63
|
+
type: DataTypes.DateDataTypeConstructor;
|
|
64
|
+
defaultValue: DataTypes.AbstractDataTypeConstructor;
|
|
65
|
+
allowNull: boolean;
|
|
66
|
+
};
|
|
67
|
+
updated_at: {
|
|
68
|
+
type: DataTypes.DateDataTypeConstructor;
|
|
69
|
+
defaultValue: DataTypes.AbstractDataTypeConstructor;
|
|
70
|
+
allowNull: boolean;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
static initialize(sequelize: any): void;
|
|
74
|
+
static associate(models: any): void;
|
|
75
|
+
}
|
|
76
|
+
export type TEvent = InferAttributes<Event>;
|