pocketsflow 1.0.0 → 1.0.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 CHANGED
@@ -48,13 +48,42 @@ interface ProductFile {
48
48
  size?: number;
49
49
  }
50
50
  interface CreateProductParams {
51
+ /** Product name (required) */
51
52
  name: string;
53
+ /** Product description */
52
54
  description?: string;
55
+ /** Product price (required, defaults to 0) */
53
56
  price: number;
54
- currency?: string;
55
- type?: 'one-time' | 'subscription';
56
- billingInterval?: 'month' | 'year';
57
- active?: boolean;
57
+ /** Product subtitle */
58
+ subtitle?: string;
59
+ /** Whether customer can pay what they want */
60
+ payWant?: boolean;
61
+ /** Minimum price for pay-what-you-want */
62
+ minPrice?: number;
63
+ /** Maximum price for pay-what-you-want */
64
+ maxPrice?: number;
65
+ /** Whether product is published */
66
+ published?: boolean;
67
+ /** Product slug for URL */
68
+ slug?: string;
69
+ /** Thumbnail image URL */
70
+ thumbnail?: string;
71
+ /** Product images array */
72
+ images?: string[];
73
+ /** Call to action text */
74
+ ctaText?: string;
75
+ /** Show sales count */
76
+ showSales?: boolean;
77
+ /** Show reviews */
78
+ showReviews?: boolean;
79
+ /** Refund policy text */
80
+ refundPolicy?: string;
81
+ /** Callback URL for redirects */
82
+ callbackUrl?: string;
83
+ /** Collect first name */
84
+ hasFirstName?: boolean;
85
+ /** Collect last name */
86
+ hasLastName?: boolean;
58
87
  }
59
88
  interface UpdateProductParams {
60
89
  name?: string;
@@ -162,12 +191,19 @@ interface Discount {
162
191
  createdAt: string;
163
192
  }
164
193
  interface CreateDiscountParams {
194
+ /** Discount name (required) */
165
195
  name: string;
196
+ /** Discount code (required) - what customers enter at checkout */
166
197
  code: string;
198
+ /** Discount value (required) */
167
199
  value: number;
168
- valueType: 'percentage' | 'fixed';
200
+ /** Value type: 'percentage' or 'fixed' (defaults to 'percentage') */
201
+ valueType?: 'percentage' | 'fixed';
202
+ /** Whether discount is active (defaults to true) */
169
203
  active?: boolean;
204
+ /** Product IDs this discount applies to (required) */
170
205
  mainProductIds: string[];
206
+ /** Expiration date (ISO 8601 string) */
171
207
  expiration?: string;
172
208
  }
173
209
  interface UpdateDiscountParams {
@@ -199,14 +235,23 @@ interface UpsellsResponse {
199
235
  salesWithUpsells: any[];
200
236
  }
201
237
  interface CreateUpsellParams {
202
- name: string;
238
+ /** Upsell name */
239
+ name?: string;
240
+ /** Offer text/headline */
241
+ offer?: string;
242
+ /** Product IDs that trigger this upsell (required) */
203
243
  mainProductIds: string[];
244
+ /** Product ID to upsell (required) */
204
245
  upsellProductId: string;
246
+ /** Upsell price (required) */
205
247
  upsellPrice: number;
248
+ /** Upsell description shown to customer */
206
249
  upsellDescription?: string;
250
+ /** Primary button text (e.g., "Yes, add this!") */
207
251
  primaryButtonText?: string;
252
+ /** Secondary button text (e.g., "No thanks") */
208
253
  secondaryButtonText?: string;
209
- offer?: string;
254
+ /** Whether upsell is active (defaults to true) */
210
255
  active?: boolean;
211
256
  }
212
257
  interface UpdateUpsellParams {
@@ -248,11 +293,17 @@ interface Webhook {
248
293
  createdAt: string;
249
294
  }
250
295
  interface CreateWebhookParams {
296
+ /** Webhook endpoint URL (required) */
251
297
  url: string;
252
- events: string[];
298
+ /** Events to subscribe to (required) */
299
+ events: WebhookEvent[];
300
+ /** Webhook description */
253
301
  description?: string;
302
+ /** Whether webhook is active (defaults to true) */
254
303
  active?: boolean;
255
304
  }
305
+ /** Available webhook events */
306
+ type WebhookEvent = 'order.completed' | 'order.refunded' | 'product.created' | 'product.updated' | 'product.deleted' | 'review.created' | 'customer.created' | 'customer.subscription.updated' | 'customer.subscription.deleted' | 'invoice.payment_succeeded' | 'invoice.payment_failed' | 'invoice.created' | 'invoice.upcoming' | 'payment_intent.succeeded' | 'payment_intent.payment_failed' | 'customer.subscription.trial_will_end' | 'customer.subscription.pause' | 'customer.subscription.resumed' | 'identity.verification_session.verified' | 'identity.verification_session.processing' | 'identity.verification_session.requires_input';
256
307
  interface UpdateWebhookParams {
257
308
  url?: string;
258
309
  events?: string[];
@@ -480,4 +531,4 @@ declare class RefundsResource {
480
531
  create(params: CreateRefundParams): Promise<Refund>;
481
532
  }
482
533
 
483
- export { type ApiError, type CheckoutSession, type CreateCheckoutParams, type CreateDiscountParams, type CreateProductParams, type CreateRefundParams, type CreateUpsellParams, type CreateVariantParams, type CreateWebhookParams, type Customer, type DateRangeParams, type Discount, type ListCustomersParams, type ListOrdersParams, type ListReviewsParams, type ListSubscriptionsParams, type Order, type OrdersResponse, type PaginatedResponse, type PaginationParams, Pocketsflow, type PocketsflowConfig, PocketsflowError, type Product, type ProductFile, type ProductVariant, type Refund, type Review, type Subscription, type UpdateDiscountParams, type UpdateProductParams, type UpdateUpsellParams, type UpdateUserParams, type UpdateWebhookParams, type Upsell, type UpsellsResponse, type User, type Webhook };
534
+ export { type ApiError, type CheckoutSession, type CreateCheckoutParams, type CreateDiscountParams, type CreateProductParams, type CreateRefundParams, type CreateUpsellParams, type CreateVariantParams, type CreateWebhookParams, type Customer, type DateRangeParams, type Discount, type ListCustomersParams, type ListOrdersParams, type ListReviewsParams, type ListSubscriptionsParams, type Order, type OrdersResponse, type PaginatedResponse, type PaginationParams, Pocketsflow, type PocketsflowConfig, PocketsflowError, type Product, type ProductFile, type ProductVariant, type Refund, type Review, type Subscription, type UpdateDiscountParams, type UpdateProductParams, type UpdateUpsellParams, type UpdateUserParams, type UpdateWebhookParams, type Upsell, type UpsellsResponse, type User, type Webhook, type WebhookEvent };
package/dist/index.d.ts CHANGED
@@ -48,13 +48,42 @@ interface ProductFile {
48
48
  size?: number;
49
49
  }
50
50
  interface CreateProductParams {
51
+ /** Product name (required) */
51
52
  name: string;
53
+ /** Product description */
52
54
  description?: string;
55
+ /** Product price (required, defaults to 0) */
53
56
  price: number;
54
- currency?: string;
55
- type?: 'one-time' | 'subscription';
56
- billingInterval?: 'month' | 'year';
57
- active?: boolean;
57
+ /** Product subtitle */
58
+ subtitle?: string;
59
+ /** Whether customer can pay what they want */
60
+ payWant?: boolean;
61
+ /** Minimum price for pay-what-you-want */
62
+ minPrice?: number;
63
+ /** Maximum price for pay-what-you-want */
64
+ maxPrice?: number;
65
+ /** Whether product is published */
66
+ published?: boolean;
67
+ /** Product slug for URL */
68
+ slug?: string;
69
+ /** Thumbnail image URL */
70
+ thumbnail?: string;
71
+ /** Product images array */
72
+ images?: string[];
73
+ /** Call to action text */
74
+ ctaText?: string;
75
+ /** Show sales count */
76
+ showSales?: boolean;
77
+ /** Show reviews */
78
+ showReviews?: boolean;
79
+ /** Refund policy text */
80
+ refundPolicy?: string;
81
+ /** Callback URL for redirects */
82
+ callbackUrl?: string;
83
+ /** Collect first name */
84
+ hasFirstName?: boolean;
85
+ /** Collect last name */
86
+ hasLastName?: boolean;
58
87
  }
59
88
  interface UpdateProductParams {
60
89
  name?: string;
@@ -162,12 +191,19 @@ interface Discount {
162
191
  createdAt: string;
163
192
  }
164
193
  interface CreateDiscountParams {
194
+ /** Discount name (required) */
165
195
  name: string;
196
+ /** Discount code (required) - what customers enter at checkout */
166
197
  code: string;
198
+ /** Discount value (required) */
167
199
  value: number;
168
- valueType: 'percentage' | 'fixed';
200
+ /** Value type: 'percentage' or 'fixed' (defaults to 'percentage') */
201
+ valueType?: 'percentage' | 'fixed';
202
+ /** Whether discount is active (defaults to true) */
169
203
  active?: boolean;
204
+ /** Product IDs this discount applies to (required) */
170
205
  mainProductIds: string[];
206
+ /** Expiration date (ISO 8601 string) */
171
207
  expiration?: string;
172
208
  }
173
209
  interface UpdateDiscountParams {
@@ -199,14 +235,23 @@ interface UpsellsResponse {
199
235
  salesWithUpsells: any[];
200
236
  }
201
237
  interface CreateUpsellParams {
202
- name: string;
238
+ /** Upsell name */
239
+ name?: string;
240
+ /** Offer text/headline */
241
+ offer?: string;
242
+ /** Product IDs that trigger this upsell (required) */
203
243
  mainProductIds: string[];
244
+ /** Product ID to upsell (required) */
204
245
  upsellProductId: string;
246
+ /** Upsell price (required) */
205
247
  upsellPrice: number;
248
+ /** Upsell description shown to customer */
206
249
  upsellDescription?: string;
250
+ /** Primary button text (e.g., "Yes, add this!") */
207
251
  primaryButtonText?: string;
252
+ /** Secondary button text (e.g., "No thanks") */
208
253
  secondaryButtonText?: string;
209
- offer?: string;
254
+ /** Whether upsell is active (defaults to true) */
210
255
  active?: boolean;
211
256
  }
212
257
  interface UpdateUpsellParams {
@@ -248,11 +293,17 @@ interface Webhook {
248
293
  createdAt: string;
249
294
  }
250
295
  interface CreateWebhookParams {
296
+ /** Webhook endpoint URL (required) */
251
297
  url: string;
252
- events: string[];
298
+ /** Events to subscribe to (required) */
299
+ events: WebhookEvent[];
300
+ /** Webhook description */
253
301
  description?: string;
302
+ /** Whether webhook is active (defaults to true) */
254
303
  active?: boolean;
255
304
  }
305
+ /** Available webhook events */
306
+ type WebhookEvent = 'order.completed' | 'order.refunded' | 'product.created' | 'product.updated' | 'product.deleted' | 'review.created' | 'customer.created' | 'customer.subscription.updated' | 'customer.subscription.deleted' | 'invoice.payment_succeeded' | 'invoice.payment_failed' | 'invoice.created' | 'invoice.upcoming' | 'payment_intent.succeeded' | 'payment_intent.payment_failed' | 'customer.subscription.trial_will_end' | 'customer.subscription.pause' | 'customer.subscription.resumed' | 'identity.verification_session.verified' | 'identity.verification_session.processing' | 'identity.verification_session.requires_input';
256
307
  interface UpdateWebhookParams {
257
308
  url?: string;
258
309
  events?: string[];
@@ -480,4 +531,4 @@ declare class RefundsResource {
480
531
  create(params: CreateRefundParams): Promise<Refund>;
481
532
  }
482
533
 
483
- export { type ApiError, type CheckoutSession, type CreateCheckoutParams, type CreateDiscountParams, type CreateProductParams, type CreateRefundParams, type CreateUpsellParams, type CreateVariantParams, type CreateWebhookParams, type Customer, type DateRangeParams, type Discount, type ListCustomersParams, type ListOrdersParams, type ListReviewsParams, type ListSubscriptionsParams, type Order, type OrdersResponse, type PaginatedResponse, type PaginationParams, Pocketsflow, type PocketsflowConfig, PocketsflowError, type Product, type ProductFile, type ProductVariant, type Refund, type Review, type Subscription, type UpdateDiscountParams, type UpdateProductParams, type UpdateUpsellParams, type UpdateUserParams, type UpdateWebhookParams, type Upsell, type UpsellsResponse, type User, type Webhook };
534
+ export { type ApiError, type CheckoutSession, type CreateCheckoutParams, type CreateDiscountParams, type CreateProductParams, type CreateRefundParams, type CreateUpsellParams, type CreateVariantParams, type CreateWebhookParams, type Customer, type DateRangeParams, type Discount, type ListCustomersParams, type ListOrdersParams, type ListReviewsParams, type ListSubscriptionsParams, type Order, type OrdersResponse, type PaginatedResponse, type PaginationParams, Pocketsflow, type PocketsflowConfig, PocketsflowError, type Product, type ProductFile, type ProductVariant, type Refund, type Review, type Subscription, type UpdateDiscountParams, type UpdateProductParams, type UpdateUpsellParams, type UpdateUserParams, type UpdateWebhookParams, type Upsell, type UpsellsResponse, type User, type Webhook, type WebhookEvent };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pocketsflow",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Official Pocketsflow SDK for Node.js and TypeScript",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",