@lumnsh/node 0.1.0 → 0.1.1
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/dist/index.d.mts +34 -36
- package/dist/index.d.ts +34 -36
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -52,45 +52,47 @@ declare class Customers extends ApiResource {
|
|
|
52
52
|
list(params?: CustomerListParams): Promise<PaginatedList<Customer>>;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
interface PricingTier {
|
|
56
|
+
upTo: number | null;
|
|
57
|
+
unitAmount: number;
|
|
58
|
+
flatAmount?: number;
|
|
59
|
+
}
|
|
60
|
+
interface IntervalPricing {
|
|
61
|
+
amount?: number;
|
|
62
|
+
currency: string;
|
|
63
|
+
discount?: number;
|
|
64
|
+
tiersMode?: 'graduated' | 'volume';
|
|
65
|
+
tiers?: PricingTier[];
|
|
66
|
+
perUnits?: number;
|
|
67
|
+
}
|
|
55
68
|
interface ProductPricing {
|
|
56
|
-
monthly?:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
discount?: number;
|
|
60
|
-
};
|
|
61
|
-
quarterly?: {
|
|
62
|
-
amount: number;
|
|
63
|
-
currency: string;
|
|
64
|
-
discount?: number;
|
|
65
|
-
};
|
|
66
|
-
yearly?: {
|
|
67
|
-
amount: number;
|
|
68
|
-
currency: string;
|
|
69
|
-
discount?: number;
|
|
70
|
-
};
|
|
69
|
+
monthly?: IntervalPricing;
|
|
70
|
+
quarterly?: IntervalPricing;
|
|
71
|
+
yearly?: IntervalPricing;
|
|
71
72
|
trial?: {
|
|
72
73
|
days: number;
|
|
73
74
|
};
|
|
74
75
|
}
|
|
76
|
+
type ProductType = 'recurring' | 'one_time' | 'usage_based' | 'seat_based' | 'tiered';
|
|
75
77
|
interface Product {
|
|
76
78
|
id: string;
|
|
77
|
-
projectId: string;
|
|
78
|
-
environment: 'development' | 'production';
|
|
79
|
-
name: string;
|
|
80
79
|
slug: string;
|
|
80
|
+
name: string;
|
|
81
81
|
description: string | null;
|
|
82
|
-
|
|
82
|
+
type: ProductType | null;
|
|
83
83
|
pricing: ProductPricing | null;
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
active: boolean;
|
|
85
|
+
provider_product_id: string | null;
|
|
86
|
+
provider_price_ids: Record<string, string> | null;
|
|
86
87
|
metadata: Record<string, unknown> | null;
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
created_at: string;
|
|
89
|
+
updated_at: string;
|
|
89
90
|
}
|
|
90
91
|
interface ProductCreateParams {
|
|
91
92
|
slug: string;
|
|
92
93
|
name: string;
|
|
93
94
|
description?: string;
|
|
95
|
+
type?: ProductType;
|
|
94
96
|
pricing?: ProductPricing;
|
|
95
97
|
active?: boolean;
|
|
96
98
|
metadata?: Record<string, unknown>;
|
|
@@ -229,18 +231,13 @@ declare class Events extends ApiResource {
|
|
|
229
231
|
}
|
|
230
232
|
|
|
231
233
|
interface MeterEvent {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
value: number;
|
|
236
|
-
idempotency_key: string;
|
|
237
|
-
cached: boolean;
|
|
238
|
-
timestamp: string;
|
|
239
|
-
created_at: string;
|
|
234
|
+
success: boolean;
|
|
235
|
+
event_id: string;
|
|
236
|
+
deduplicated: boolean;
|
|
240
237
|
}
|
|
241
238
|
interface MeterRecordParams {
|
|
242
239
|
customer_id: string;
|
|
243
|
-
|
|
240
|
+
event_name: string;
|
|
244
241
|
value?: number;
|
|
245
242
|
idempotency_key: string;
|
|
246
243
|
timestamp?: string;
|
|
@@ -278,7 +275,7 @@ interface ConnectionCapabilities {
|
|
|
278
275
|
interface Connection {
|
|
279
276
|
id: string;
|
|
280
277
|
provider: Provider;
|
|
281
|
-
environment: 'development' | '
|
|
278
|
+
environment: 'development' | 'production';
|
|
282
279
|
status: 'pending' | 'active' | 'error' | 'disconnected';
|
|
283
280
|
capabilities: ConnectionCapabilities | null;
|
|
284
281
|
lastHealthCheck: string | null;
|
|
@@ -290,7 +287,7 @@ interface ConnectionCreateParams {
|
|
|
290
287
|
api_key: string;
|
|
291
288
|
publishable_key?: string;
|
|
292
289
|
webhook_secret?: string;
|
|
293
|
-
environment?: 'development' | '
|
|
290
|
+
environment?: 'development' | 'production';
|
|
294
291
|
}
|
|
295
292
|
|
|
296
293
|
declare class Connections extends ApiResource {
|
|
@@ -301,7 +298,7 @@ declare class Connections extends ApiResource {
|
|
|
301
298
|
interface ApiKey {
|
|
302
299
|
id: string;
|
|
303
300
|
name: string;
|
|
304
|
-
environment: 'development' | '
|
|
301
|
+
environment: 'development' | 'production';
|
|
305
302
|
keyPrefix: string;
|
|
306
303
|
scopes: string[] | null;
|
|
307
304
|
lastUsedAt: string | null;
|
|
@@ -313,7 +310,7 @@ interface ApiKeyWithSecret extends ApiKey {
|
|
|
313
310
|
}
|
|
314
311
|
interface ApiKeyCreateParams {
|
|
315
312
|
name: string;
|
|
316
|
-
environment?: 'development' | '
|
|
313
|
+
environment?: 'development' | 'production';
|
|
317
314
|
scopes?: string[];
|
|
318
315
|
expires_in_days?: number;
|
|
319
316
|
}
|
|
@@ -350,6 +347,7 @@ interface CheckoutCreateParams {
|
|
|
350
347
|
customer_id: string;
|
|
351
348
|
product_slug: string;
|
|
352
349
|
price_interval: 'monthly' | 'quarterly' | 'yearly';
|
|
350
|
+
quantity?: number;
|
|
353
351
|
success_url: string;
|
|
354
352
|
cancel_url: string;
|
|
355
353
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -52,45 +52,47 @@ declare class Customers extends ApiResource {
|
|
|
52
52
|
list(params?: CustomerListParams): Promise<PaginatedList<Customer>>;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
interface PricingTier {
|
|
56
|
+
upTo: number | null;
|
|
57
|
+
unitAmount: number;
|
|
58
|
+
flatAmount?: number;
|
|
59
|
+
}
|
|
60
|
+
interface IntervalPricing {
|
|
61
|
+
amount?: number;
|
|
62
|
+
currency: string;
|
|
63
|
+
discount?: number;
|
|
64
|
+
tiersMode?: 'graduated' | 'volume';
|
|
65
|
+
tiers?: PricingTier[];
|
|
66
|
+
perUnits?: number;
|
|
67
|
+
}
|
|
55
68
|
interface ProductPricing {
|
|
56
|
-
monthly?:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
discount?: number;
|
|
60
|
-
};
|
|
61
|
-
quarterly?: {
|
|
62
|
-
amount: number;
|
|
63
|
-
currency: string;
|
|
64
|
-
discount?: number;
|
|
65
|
-
};
|
|
66
|
-
yearly?: {
|
|
67
|
-
amount: number;
|
|
68
|
-
currency: string;
|
|
69
|
-
discount?: number;
|
|
70
|
-
};
|
|
69
|
+
monthly?: IntervalPricing;
|
|
70
|
+
quarterly?: IntervalPricing;
|
|
71
|
+
yearly?: IntervalPricing;
|
|
71
72
|
trial?: {
|
|
72
73
|
days: number;
|
|
73
74
|
};
|
|
74
75
|
}
|
|
76
|
+
type ProductType = 'recurring' | 'one_time' | 'usage_based' | 'seat_based' | 'tiered';
|
|
75
77
|
interface Product {
|
|
76
78
|
id: string;
|
|
77
|
-
projectId: string;
|
|
78
|
-
environment: 'development' | 'production';
|
|
79
|
-
name: string;
|
|
80
79
|
slug: string;
|
|
80
|
+
name: string;
|
|
81
81
|
description: string | null;
|
|
82
|
-
|
|
82
|
+
type: ProductType | null;
|
|
83
83
|
pricing: ProductPricing | null;
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
active: boolean;
|
|
85
|
+
provider_product_id: string | null;
|
|
86
|
+
provider_price_ids: Record<string, string> | null;
|
|
86
87
|
metadata: Record<string, unknown> | null;
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
created_at: string;
|
|
89
|
+
updated_at: string;
|
|
89
90
|
}
|
|
90
91
|
interface ProductCreateParams {
|
|
91
92
|
slug: string;
|
|
92
93
|
name: string;
|
|
93
94
|
description?: string;
|
|
95
|
+
type?: ProductType;
|
|
94
96
|
pricing?: ProductPricing;
|
|
95
97
|
active?: boolean;
|
|
96
98
|
metadata?: Record<string, unknown>;
|
|
@@ -229,18 +231,13 @@ declare class Events extends ApiResource {
|
|
|
229
231
|
}
|
|
230
232
|
|
|
231
233
|
interface MeterEvent {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
value: number;
|
|
236
|
-
idempotency_key: string;
|
|
237
|
-
cached: boolean;
|
|
238
|
-
timestamp: string;
|
|
239
|
-
created_at: string;
|
|
234
|
+
success: boolean;
|
|
235
|
+
event_id: string;
|
|
236
|
+
deduplicated: boolean;
|
|
240
237
|
}
|
|
241
238
|
interface MeterRecordParams {
|
|
242
239
|
customer_id: string;
|
|
243
|
-
|
|
240
|
+
event_name: string;
|
|
244
241
|
value?: number;
|
|
245
242
|
idempotency_key: string;
|
|
246
243
|
timestamp?: string;
|
|
@@ -278,7 +275,7 @@ interface ConnectionCapabilities {
|
|
|
278
275
|
interface Connection {
|
|
279
276
|
id: string;
|
|
280
277
|
provider: Provider;
|
|
281
|
-
environment: 'development' | '
|
|
278
|
+
environment: 'development' | 'production';
|
|
282
279
|
status: 'pending' | 'active' | 'error' | 'disconnected';
|
|
283
280
|
capabilities: ConnectionCapabilities | null;
|
|
284
281
|
lastHealthCheck: string | null;
|
|
@@ -290,7 +287,7 @@ interface ConnectionCreateParams {
|
|
|
290
287
|
api_key: string;
|
|
291
288
|
publishable_key?: string;
|
|
292
289
|
webhook_secret?: string;
|
|
293
|
-
environment?: 'development' | '
|
|
290
|
+
environment?: 'development' | 'production';
|
|
294
291
|
}
|
|
295
292
|
|
|
296
293
|
declare class Connections extends ApiResource {
|
|
@@ -301,7 +298,7 @@ declare class Connections extends ApiResource {
|
|
|
301
298
|
interface ApiKey {
|
|
302
299
|
id: string;
|
|
303
300
|
name: string;
|
|
304
|
-
environment: 'development' | '
|
|
301
|
+
environment: 'development' | 'production';
|
|
305
302
|
keyPrefix: string;
|
|
306
303
|
scopes: string[] | null;
|
|
307
304
|
lastUsedAt: string | null;
|
|
@@ -313,7 +310,7 @@ interface ApiKeyWithSecret extends ApiKey {
|
|
|
313
310
|
}
|
|
314
311
|
interface ApiKeyCreateParams {
|
|
315
312
|
name: string;
|
|
316
|
-
environment?: 'development' | '
|
|
313
|
+
environment?: 'development' | 'production';
|
|
317
314
|
scopes?: string[];
|
|
318
315
|
expires_in_days?: number;
|
|
319
316
|
}
|
|
@@ -350,6 +347,7 @@ interface CheckoutCreateParams {
|
|
|
350
347
|
customer_id: string;
|
|
351
348
|
product_slug: string;
|
|
352
349
|
price_interval: 'monthly' | 'quarterly' | 'yearly';
|
|
350
|
+
quantity?: number;
|
|
353
351
|
success_url: string;
|
|
354
352
|
cancel_url: string;
|
|
355
353
|
}
|