@moneymq/sdk 0.7.0 → 0.9.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/README.md CHANGED
@@ -22,7 +22,7 @@ const moneymq = new MoneyMQ({
22
22
  });
23
23
 
24
24
  // Create a product
25
- const product = await moneymq.catalog.products.create({
25
+ const product = await moneymq.catalog.create({
26
26
  name: 'Pro Plan',
27
27
  description: 'Full access to all features',
28
28
  });
@@ -65,8 +65,17 @@ const moneymq = new MoneyMQ({
65
65
  #### Products
66
66
 
67
67
  ```typescript
68
+ // List all products
69
+ const { data, hasMore } = await moneymq.catalog.list();
70
+
71
+ // With filters
72
+ const { data, hasMore } = await moneymq.catalog.list({
73
+ active: true,
74
+ limit: 10,
75
+ });
76
+
68
77
  // Create a product
69
- const product = await moneymq.catalog.products.create({
78
+ const product = await moneymq.catalog.create({
70
79
  name: 'Pro Plan',
71
80
  description: 'Full access',
72
81
  active: true,
@@ -74,21 +83,15 @@ const product = await moneymq.catalog.products.create({
74
83
  });
75
84
 
76
85
  // Retrieve a product
77
- const product = await moneymq.catalog.products.retrieve('prod_123');
78
-
79
- // List products
80
- const { data, hasMore } = await moneymq.catalog.products.list({
81
- active: true,
82
- limit: 10,
83
- });
86
+ const product = await moneymq.catalog.retrieve('prod_123');
84
87
 
85
88
  // Update a product
86
- const updated = await moneymq.catalog.products.update('prod_123', {
89
+ const updated = await moneymq.catalog.update('prod_123', {
87
90
  name: 'Enterprise Plan',
88
91
  });
89
92
 
90
93
  // Delete a product
91
- await moneymq.catalog.products.delete('prod_123');
94
+ await moneymq.catalog.delete('prod_123');
92
95
  ```
93
96
 
94
97
  #### Prices
@@ -227,7 +230,7 @@ await moneymq.payment.payouts.settings.update({
227
230
  import { MoneyMQ, MoneyMQError } from '@moneymq/sdk';
228
231
 
229
232
  try {
230
- await moneymq.catalog.products.retrieve('invalid_id');
233
+ await moneymq.catalog.retrieve('invalid_id');
231
234
  } catch (error) {
232
235
  if (error instanceof MoneyMQError) {
233
236
  console.error('Status:', error.statusCode);