@blocklet/payment-types 1.19.18 → 1.19.19
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/lib/auto-recharge-config.d.ts +129 -0
- package/lib/checkout-session.d.ts +1 -1
- package/lib/credit-grant.d.ts +1 -1
- package/lib/index.d.ts +3 -0
- package/lib/invoice.d.ts +1 -1
- package/lib/meter.d.ts +1 -1
- package/lib/payment-currency.d.ts +2 -1
- package/lib/payment-method.d.ts +1 -1
- package/lib/pricing-table.d.ts +1 -1
- package/lib/subscription-schedule.d.ts +1 -1
- package/lib/types.d.ts +10 -0
- package/lib/webhook-endpoint.d.ts +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { CreationOptional, DataTypes, InferAttributes, InferCreationAttributes, Model } from 'sequelize';
|
|
2
|
+
import { PaymentDetails, PaymentSettings } from './types';
|
|
3
|
+
export declare class AutoRechargeConfig extends Model<InferAttributes<AutoRechargeConfig>, InferCreationAttributes<AutoRechargeConfig>> {
|
|
4
|
+
id: CreationOptional<string>;
|
|
5
|
+
customer_id: string;
|
|
6
|
+
livemode: boolean;
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
threshold: string;
|
|
9
|
+
currency_id: string;
|
|
10
|
+
recharge_currency_id?: string;
|
|
11
|
+
price_id: string;
|
|
12
|
+
quantity: number;
|
|
13
|
+
payment_method_id?: string;
|
|
14
|
+
payment_settings?: PaymentSettings;
|
|
15
|
+
payment_details?: PaymentDetails;
|
|
16
|
+
daily_limits?: {
|
|
17
|
+
max_attempts: number;
|
|
18
|
+
max_amount: string;
|
|
19
|
+
};
|
|
20
|
+
last_recharge_date?: string;
|
|
21
|
+
daily_stats?: {
|
|
22
|
+
attempt_count: number;
|
|
23
|
+
total_amount: string;
|
|
24
|
+
};
|
|
25
|
+
metadata?: Record<string, any>;
|
|
26
|
+
created_at: CreationOptional<Date>;
|
|
27
|
+
updated_at: CreationOptional<Date>;
|
|
28
|
+
static readonly GENESIS_ATTRIBUTES: {
|
|
29
|
+
id: {
|
|
30
|
+
type: DataTypes.StringDataType;
|
|
31
|
+
primaryKey: boolean;
|
|
32
|
+
allowNull: boolean;
|
|
33
|
+
defaultValue: (size?: number) => string;
|
|
34
|
+
};
|
|
35
|
+
customer_id: {
|
|
36
|
+
type: DataTypes.StringDataType;
|
|
37
|
+
allowNull: boolean;
|
|
38
|
+
references: {
|
|
39
|
+
model: string;
|
|
40
|
+
key: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
livemode: {
|
|
44
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
45
|
+
allowNull: boolean;
|
|
46
|
+
};
|
|
47
|
+
enabled: {
|
|
48
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
49
|
+
allowNull: boolean;
|
|
50
|
+
defaultValue: boolean;
|
|
51
|
+
};
|
|
52
|
+
threshold: {
|
|
53
|
+
type: DataTypes.StringDataType;
|
|
54
|
+
allowNull: boolean;
|
|
55
|
+
};
|
|
56
|
+
payment_method_id: {
|
|
57
|
+
type: DataTypes.StringDataType;
|
|
58
|
+
allowNull: boolean;
|
|
59
|
+
};
|
|
60
|
+
currency_id: {
|
|
61
|
+
type: DataTypes.StringDataType;
|
|
62
|
+
allowNull: boolean;
|
|
63
|
+
};
|
|
64
|
+
recharge_currency_id: {
|
|
65
|
+
type: DataTypes.StringDataType;
|
|
66
|
+
allowNull: boolean;
|
|
67
|
+
};
|
|
68
|
+
price_id: {
|
|
69
|
+
type: DataTypes.StringDataType;
|
|
70
|
+
allowNull: boolean;
|
|
71
|
+
};
|
|
72
|
+
quantity: {
|
|
73
|
+
type: DataTypes.IntegerDataTypeConstructor;
|
|
74
|
+
defaultValue: number;
|
|
75
|
+
allowNull: boolean;
|
|
76
|
+
};
|
|
77
|
+
payment_settings: {
|
|
78
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
79
|
+
allowNull: boolean;
|
|
80
|
+
defaultValue: {
|
|
81
|
+
payment_method_types: never[];
|
|
82
|
+
payment_method_options: {};
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
payment_details: {
|
|
86
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
87
|
+
allowNull: boolean;
|
|
88
|
+
};
|
|
89
|
+
daily_limits: {
|
|
90
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
91
|
+
allowNull: boolean;
|
|
92
|
+
defaultValue: {
|
|
93
|
+
max_attempts: number;
|
|
94
|
+
max_amount: string;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
last_recharge_date: {
|
|
98
|
+
type: DataTypes.StringDataType;
|
|
99
|
+
allowNull: boolean;
|
|
100
|
+
};
|
|
101
|
+
daily_stats: {
|
|
102
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
103
|
+
allowNull: boolean;
|
|
104
|
+
defaultValue: {
|
|
105
|
+
attempt_count: number;
|
|
106
|
+
total_amount: string;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
metadata: {
|
|
110
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
111
|
+
allowNull: boolean;
|
|
112
|
+
};
|
|
113
|
+
created_at: {
|
|
114
|
+
type: DataTypes.DateDataTypeConstructor;
|
|
115
|
+
defaultValue: DataTypes.AbstractDataTypeConstructor;
|
|
116
|
+
allowNull: boolean;
|
|
117
|
+
};
|
|
118
|
+
updated_at: {
|
|
119
|
+
type: DataTypes.DateDataTypeConstructor;
|
|
120
|
+
defaultValue: DataTypes.AbstractDataTypeConstructor;
|
|
121
|
+
allowNull: boolean;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
static initialize(sequelize: any): void;
|
|
125
|
+
static associate(models: any): void;
|
|
126
|
+
canRechargeToday(nextAmount: string): boolean;
|
|
127
|
+
updateDailyStats(amount: string): Promise<void>;
|
|
128
|
+
}
|
|
129
|
+
export type TAutoRechargeConfig = InferAttributes<AutoRechargeConfig>;
|
|
@@ -157,7 +157,7 @@ export declare class CheckoutSession extends Model<InferAttributes<CheckoutSessi
|
|
|
157
157
|
allowNull: boolean;
|
|
158
158
|
};
|
|
159
159
|
status: {
|
|
160
|
-
type: DataTypes.EnumDataType<"open" | "
|
|
160
|
+
type: DataTypes.EnumDataType<"open" | "complete" | "expired">;
|
|
161
161
|
allowNull: boolean;
|
|
162
162
|
};
|
|
163
163
|
payment_status: {
|
package/lib/credit-grant.d.ts
CHANGED
|
@@ -102,7 +102,7 @@ export declare class CreditGrant extends Model<InferAttributes<CreditGrant>, Inf
|
|
|
102
102
|
allowNull: boolean;
|
|
103
103
|
};
|
|
104
104
|
status: {
|
|
105
|
-
type: DataTypes.EnumDataType<"pending" | "voided" | "
|
|
105
|
+
type: DataTypes.EnumDataType<"pending" | "voided" | "expired" | "depleted" | "granted">;
|
|
106
106
|
defaultValue: string;
|
|
107
107
|
allowNull: boolean;
|
|
108
108
|
};
|
package/lib/index.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ import { CreditGrant, TCreditGrant } from './credit-grant';
|
|
|
31
31
|
import { CreditTransaction, TCreditTransaction } from './credit-transaction';
|
|
32
32
|
import { Meter, TMeter } from './meter';
|
|
33
33
|
import { MeterEvent, TMeterEvent } from './meter-event';
|
|
34
|
+
import { AutoRechargeConfig } from './auto-recharge-config';
|
|
34
35
|
declare const models: {
|
|
35
36
|
CheckoutSession: typeof CheckoutSession;
|
|
36
37
|
Coupon: typeof Coupon;
|
|
@@ -64,6 +65,7 @@ declare const models: {
|
|
|
64
65
|
CreditTransaction: typeof CreditTransaction;
|
|
65
66
|
Meter: typeof Meter;
|
|
66
67
|
MeterEvent: typeof MeterEvent;
|
|
68
|
+
AutoRechargeConfig: typeof AutoRechargeConfig;
|
|
67
69
|
};
|
|
68
70
|
export declare function initialize(sequelize: any): void;
|
|
69
71
|
export default models;
|
|
@@ -100,6 +102,7 @@ export * from './credit-grant';
|
|
|
100
102
|
export * from './credit-transaction';
|
|
101
103
|
export * from './meter';
|
|
102
104
|
export * from './meter-event';
|
|
105
|
+
export * from './auto-recharge-config';
|
|
103
106
|
export type TPriceExpanded = TPrice & {
|
|
104
107
|
object: 'price';
|
|
105
108
|
product: TProduct;
|
package/lib/invoice.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare class Invoice extends Model<InferAttributes<Invoice>, InferCreati
|
|
|
15
15
|
paid_out_of_band: boolean;
|
|
16
16
|
status: LiteralUnion<'draft' | 'open' | 'void' | 'paid' | 'uncollectible', string>;
|
|
17
17
|
collection_method: LiteralUnion<'charge_automatically' | 'send_invoice', string>;
|
|
18
|
-
billing_reason: LiteralUnion<'subscription_create' | 'subscription_cycle' | 'subscription_update' | 'subscription_recover' | 'subscription_threshold' | 'subscription_cancel' | 'subscription' | 'manual' | 'upcoming' | 'slash_stake' | 'stake' | 'overdraft_protection' | 'stake_overdraft_protection' | 'recharge', string>;
|
|
18
|
+
billing_reason: LiteralUnion<'subscription_create' | 'subscription_cycle' | 'subscription_update' | 'subscription_recover' | 'subscription_threshold' | 'subscription_cancel' | 'subscription' | 'manual' | 'upcoming' | 'slash_stake' | 'stake' | 'overdraft_protection' | 'stake_overdraft_protection' | 'recharge' | 'auto_recharge', string>;
|
|
19
19
|
currency_id: string;
|
|
20
20
|
customer_id: string;
|
|
21
21
|
payment_intent_id?: string;
|
package/lib/meter.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ export declare class Meter extends Model<InferAttributes<Meter>, InferCreationAt
|
|
|
45
45
|
unique: boolean;
|
|
46
46
|
};
|
|
47
47
|
aggregation_method: {
|
|
48
|
-
type: DataTypes.EnumDataType<"
|
|
48
|
+
type: DataTypes.EnumDataType<"sum" | "count" | "last">;
|
|
49
49
|
defaultValue: string;
|
|
50
50
|
allowNull: boolean;
|
|
51
51
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CreationOptional, DataTypes, FindOptions, InferAttributes, InferCreationAttributes, Model } from 'sequelize';
|
|
2
2
|
import type { LiteralUnion } from 'type-fest';
|
|
3
|
-
import { VaultConfig } from './types';
|
|
3
|
+
import { RechargeConfig, VaultConfig } from './types';
|
|
4
4
|
export declare class PaymentCurrency extends Model<InferAttributes<PaymentCurrency>, InferCreationAttributes<PaymentCurrency>> {
|
|
5
5
|
id: CreationOptional<string>;
|
|
6
6
|
payment_method_id: string;
|
|
@@ -22,6 +22,7 @@ export declare class PaymentCurrency extends Model<InferAttributes<PaymentCurren
|
|
|
22
22
|
updated_at: CreationOptional<Date>;
|
|
23
23
|
vault_config?: VaultConfig;
|
|
24
24
|
type: LiteralUnion<'standard' | 'credit', string>;
|
|
25
|
+
recharge_config?: RechargeConfig;
|
|
25
26
|
static readonly GENESIS_ATTRIBUTES: {
|
|
26
27
|
id: {
|
|
27
28
|
type: DataTypes.StringDataType;
|
package/lib/payment-method.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ export declare class PaymentMethod extends Model<InferAttributes<PaymentMethod>,
|
|
|
47
47
|
defaultValue: boolean;
|
|
48
48
|
};
|
|
49
49
|
type: {
|
|
50
|
-
type: DataTypes.EnumDataType<"arcblock" | "ethereum" | "
|
|
50
|
+
type: DataTypes.EnumDataType<"arcblock" | "ethereum" | "base" | "bitcoin" | "stripe">;
|
|
51
51
|
};
|
|
52
52
|
name: {
|
|
53
53
|
type: DataTypes.StringDataType;
|
package/lib/pricing-table.d.ts
CHANGED
|
@@ -100,7 +100,7 @@ export declare class PricingTable extends Model<InferAttributes<PricingTable>, I
|
|
|
100
100
|
};
|
|
101
101
|
submit_type: string;
|
|
102
102
|
cross_sell_behavior: string;
|
|
103
|
-
} & Pick<any, "custom_fields" | "
|
|
103
|
+
} & Pick<any, "custom_fields" | "allow_promotion_codes" | "consent_collection" | "phone_number_collection" | "submit_type" | "billing_address_collection" | "subscription_data" | "nft_mint_settings" | "cross_sell_behavior" | "price_id" | "adjustable_quantity" | "after_completion" | "product_id" | "highlight_text" | "is_highlight">;
|
|
104
104
|
static format(payload: any): Partial<PricingTable>;
|
|
105
105
|
expand(): Promise<InferAttributes<PricingTable, {
|
|
106
106
|
omit: never;
|
|
@@ -70,7 +70,7 @@ export declare class SubscriptionSchedule extends Model<InferAttributes<Subscrip
|
|
|
70
70
|
allowNull: boolean;
|
|
71
71
|
};
|
|
72
72
|
end_behavior: {
|
|
73
|
-
type: DataTypes.EnumDataType<"
|
|
73
|
+
type: DataTypes.EnumDataType<"cancel" | "release">;
|
|
74
74
|
allowNull: boolean;
|
|
75
75
|
};
|
|
76
76
|
test_clock_id: {
|
package/lib/types.d.ts
CHANGED
|
@@ -279,6 +279,7 @@ export type PaymentDetails = {
|
|
|
279
279
|
subscription_id?: string;
|
|
280
280
|
customer_id?: string;
|
|
281
281
|
refund_id?: string;
|
|
282
|
+
payment_method_id?: string;
|
|
282
283
|
};
|
|
283
284
|
ethereum?: {
|
|
284
285
|
tx_hash: string;
|
|
@@ -455,4 +456,13 @@ export type MeterEventPayload = {
|
|
|
455
456
|
value: string;
|
|
456
457
|
subscription_id?: string;
|
|
457
458
|
};
|
|
459
|
+
export type RechargeConfig = {
|
|
460
|
+
base_price_id: string;
|
|
461
|
+
payment_link_id?: string;
|
|
462
|
+
checkout_url?: string;
|
|
463
|
+
settings?: {
|
|
464
|
+
min_recharge_amount?: number;
|
|
465
|
+
max_recharge_amount?: number;
|
|
466
|
+
};
|
|
467
|
+
};
|
|
458
468
|
export {};
|
|
@@ -45,7 +45,7 @@ export declare class WebhookEndpoint extends Model<InferAttributes<WebhookEndpoi
|
|
|
45
45
|
allowNull: boolean;
|
|
46
46
|
};
|
|
47
47
|
status: {
|
|
48
|
-
type: DataTypes.EnumDataType<"
|
|
48
|
+
type: DataTypes.EnumDataType<"enabled" | "disabled">;
|
|
49
49
|
allowNull: boolean;
|
|
50
50
|
};
|
|
51
51
|
created_at: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/payment-types",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.19",
|
|
4
4
|
"description": "Typings for Payment Kit SDK",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"types",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"sequelize": "^6.37.7",
|
|
49
49
|
"type-fest": "^4.41.0"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "76facca620eda1132f8c6d5b8f42d8fd9ef78b05"
|
|
52
52
|
}
|