@23blocks/block-sales 8.0.0 → 8.0.2

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/CHANGELOG.md ADDED
@@ -0,0 +1,473 @@
1
+ ## 8.0.2 (2026-03-14)
2
+
3
+ ### 🩹 Fixes
4
+
5
+ - **@23blocks/block-sales:** use JSON:API codec for vendor payment and provider report list endpoints ([d90e5f7](https://github.com/23blocks-OS/frontend-sdk/commit/d90e5f7))
6
+
7
+ ### ❤️ Thank You
8
+
9
+ - Claude Opus 4.6 (1M context)
10
+ - Juan Pelaez
11
+
12
+ ## 8.0.1 (2026-03-03)
13
+
14
+ ### 🧱 Updated Dependencies
15
+
16
+ - Updated @23blocks/jsonapi-codec to 3.3.2
17
+ - Updated @23blocks/contracts to 2.3.2
18
+
19
+ # 8.0.0 (2026-02-20)
20
+
21
+ ### 🩹 Fixes
22
+
23
+ - ⚠️ replace appId with apiKey across all block configs to align with BlockConfig contract ([f81626d](https://github.com/23blocks-OS/frontend-sdk/commit/f81626d))
24
+ - resolve typecheck errors across all block packages ([6089324](https://github.com/23blocks-OS/frontend-sdk/commit/6089324))
25
+
26
+ ### ⚠️ Breaking Changes
27
+
28
+ - replace appId with apiKey across all block configs to align with BlockConfig contract ([f81626d](https://github.com/23blocks-OS/frontend-sdk/commit/f81626d))
29
+ Block config no longer accepts appId. Use apiKey instead.
30
+ Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
31
+
32
+ ### 🧱 Updated Dependencies
33
+
34
+ - Updated @23blocks/jsonapi-codec to 3.3.1
35
+ - Updated @23blocks/contracts to 2.3.1
36
+
37
+ ### ❤️ Thank You
38
+
39
+ - Claude Opus 4.6
40
+ - Juan Pelaez
41
+
42
+ # 7.0.0 (2026-02-19)
43
+
44
+ ### 🚀 Features
45
+
46
+ - ⚠️ **@23blocks/block-sales:** add paymentIntentId, customer, metadata to StripePaymentIntent ([c0bd1b2](https://github.com/23blocks-OS/frontend-sdk/commit/c0bd1b2))
47
+
48
+ ### ⚠️ Breaking Changes
49
+
50
+ - **@23blocks/block-sales:** add paymentIntentId, customer, metadata to StripePaymentIntent ([c0bd1b2](https://github.com/23blocks-OS/frontend-sdk/commit/c0bd1b2))
51
+
52
+ ### ❤️ Thank You
53
+
54
+ - Claude Opus 4.6
55
+ - Juan Pelaez
56
+
57
+ # 6.0.0 (2026-02-18)
58
+
59
+ ### 🩹 Fixes
60
+
61
+ - ⚠️ **@23blocks/block-sales:** mark breaking change for API strong params rewrite ([8285990](https://github.com/23blocks-OS/frontend-sdk/commit/8285990))
62
+
63
+ ### ⚠️ Breaking Changes
64
+
65
+ - **@23blocks/block-sales:** mark breaking change for API strong params rewrite ([8285990](https://github.com/23blocks-OS/frontend-sdk/commit/8285990))
66
+ All request types, service methods, and response mappers
67
+ rewritten to match Rails API strong params 1:1. Removed methods:
68
+ subscriptions.cancel/pause/resume/listByUser/update. Renamed methods:
69
+ mercadopago.createPaymentIntent→createPayment. Removed types:
70
+ SubscriptionInterval, SubscriptionStatus, MercadoPagoPaymentIntent,
71
+ StripeLineItem. Renamed/removed fields across all request types.
72
+ Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
73
+
74
+ ### ❤️ Thank You
75
+
76
+ - Claude Opus 4.6
77
+ - Juan Pelaez
78
+
79
+ ## 5.2.2 (2026-02-18)
80
+
81
+ ### 🩹 Fixes
82
+
83
+ - **@23blocks/block-sales:** rewrite all types, services, and mappers to match API strong params 1:1 ([6fef3d3](https://github.com/23blocks-OS/frontend-sdk/commit/6fef3d3))
84
+
85
+ ### ❤️ Thank You
86
+
87
+ - Claude Opus 4.6
88
+ - Juan Pelaez
89
+
90
+ ## 5.2.1 (2026-02-18)
91
+
92
+ ### 🩹 Fixes
93
+
94
+ - **@23blocks/block-sales:** add delivery field to Order type and CreateOrderRequest ([28fffbe](https://github.com/23blocks-OS/frontend-sdk/commit/28fffbe))
95
+ - **@23blocks/block-sales:** remove items[] from CreateOrderRequest ([db4743a](https://github.com/23blocks-OS/frontend-sdk/commit/db4743a))
96
+
97
+ ### ❤️ Thank You
98
+
99
+ - Claude Opus 4.6
100
+ - Juan Pelaez
101
+
102
+ ## 5.2.0 (2026-02-18)
103
+
104
+ ### 🚀 Features
105
+
106
+ - **@23blocks/block-sales:** support flat order format in CreateOrderRequest ([f64dbd0](https://github.com/23blocks-OS/frontend-sdk/commit/f64dbd0))
107
+
108
+ ### ❤️ Thank You
109
+
110
+ - Claude Opus 4.6
111
+ - Juan Pelaez
112
+
113
+ ## 5.1.0 (2026-02-17)
114
+
115
+ ### 🚀 Features
116
+
117
+ - add health() method to all 18 blocks for service connectivity checks ([73514a3](https://github.com/23blocks-OS/frontend-sdk/commit/73514a3))
118
+
119
+ ### 🧱 Updated Dependencies
120
+
121
+ - Updated @23blocks/jsonapi-codec to 3.3.0
122
+ - Updated @23blocks/contracts to 2.3.0
123
+
124
+ ### ❤️ Thank You
125
+
126
+ - Claude Opus 4.6
127
+ - Juan Pelaez
128
+
129
+ ## 5.0.3 (2026-02-15)
130
+
131
+ ### 🩹 Fixes
132
+
133
+ - **@23blocks/block-sales:** fix Stripe and MercadoPago JSON:API response decoding ([86e7c1d](https://github.com/23blocks-OS/frontend-sdk/commit/86e7c1d))
134
+
135
+ ### ❤️ Thank You
136
+
137
+ - Claude Opus 4.6
138
+ - Juan Pelaez
139
+
140
+ ## 5.0.2 (2026-02-14)
141
+
142
+ ### 🩹 Fixes
143
+
144
+ - **@23blocks/block-sales:** fix JSON:API mapping in customers, entities, and vendor-payments services ([eacfbb5](https://github.com/23blocks-OS/frontend-sdk/commit/eacfbb5))
145
+
146
+ ### ❤️ Thank You
147
+
148
+ - Claude Opus 4.6
149
+ - Juan Pelaez
150
+
151
+ ## 5.0.1 (2026-02-14)
152
+
153
+ ### 🩹 Fixes
154
+
155
+ - **@23blocks/block-sales:** fix user subscription JSON:API mapping producing empty objects ([b446cec](https://github.com/23blocks-OS/frontend-sdk/commit/b446cec))
156
+
157
+ ### ❤️ Thank You
158
+
159
+ - Claude Opus 4.6
160
+ - Juan Pelaez
161
+
162
+ # 5.0.0 (2026-02-14)
163
+
164
+ ### 🩹 Fixes
165
+
166
+ - ⚠️ **@23blocks/block-sales:** remove amount from payment intent, require orderUniqueId, strip server-managed params ([338b81d](https://github.com/23blocks-OS/frontend-sdk/commit/338b81d))
167
+
168
+ ### ⚠️ Breaking Changes
169
+
170
+ - **@23blocks/block-sales:** remove amount from payment intent, require orderUniqueId, strip server-managed params ([338b81d](https://github.com/23blocks-OS/frontend-sdk/commit/338b81d))
171
+
172
+ ### ❤️ Thank You
173
+
174
+ - Claude Opus 4.6
175
+ - Juan Pelaez
176
+
177
+ # 4.0.0 (2026-02-14)
178
+
179
+ ### 🩹 Fixes
180
+
181
+ - ⚠️ **@23blocks/block-sales:** align user subscription create/update params with API permitted fields ([94c8e6e](https://github.com/23blocks-OS/frontend-sdk/commit/94c8e6e))
182
+
183
+ ### ⚠️ Breaking Changes
184
+
185
+ - **@23blocks/block-sales:** align user subscription create/update params with API permitted fields ([94c8e6e](https://github.com/23blocks-OS/frontend-sdk/commit/94c8e6e))
186
+ CreateUserSubscriptionRequest and UpdateUserSubscriptionRequest
187
+ fields changed. subscriptionModelUniqueId is now required, data param on
188
+ createSubscription is no longer optional.
189
+ Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
190
+
191
+ ### ❤️ Thank You
192
+
193
+ - Claude Opus 4.6
194
+ - Juan Pelaez
195
+
196
+ ## 3.6.0 (2026-02-14)
197
+
198
+ ### 🚀 Features
199
+
200
+ - **@23blocks/block-sales:** add typed groupBy unions for report summary endpoints ([fc87364](https://github.com/23blocks-OS/frontend-sdk/commit/fc87364))
201
+
202
+ ### ❤️ Thank You
203
+
204
+ - Claude Opus 4.6
205
+ - Juan Pelaez
206
+
207
+ ## 3.5.0 (2026-02-14)
208
+
209
+ ### 🚀 Features
210
+
211
+ - **@23blocks/block-sales:** add subscription maxItems/consumption and entity payment fields ([ef7d538](https://github.com/23blocks-OS/frontend-sdk/commit/ef7d538))
212
+
213
+ ### ❤️ Thank You
214
+
215
+ - Claude Opus 4.6
216
+ - Juan Pelaez
217
+
218
+ ## 3.4.0 (2026-02-14)
219
+
220
+ ### 🚀 Features
221
+
222
+ - **@23blocks/block-sales:** add purchases service and refine customer identity types ([ca9a2c8](https://github.com/23blocks-OS/frontend-sdk/commit/ca9a2c8))
223
+
224
+ ### ❤️ Thank You
225
+
226
+ - Claude Opus 4.6
227
+ - Juan Pelaez
228
+
229
+ ## 3.3.2 (2026-02-13)
230
+
231
+ ### 🩹 Fixes
232
+
233
+ - **@23blocks/block-sales:** use discriminated union for CreateStripeCustomerRequest identity types ([c3b73db](https://github.com/23blocks-OS/frontend-sdk/commit/c3b73db))
234
+
235
+ ### ❤️ Thank You
236
+
237
+ - Claude Opus 4.6
238
+ - Juan Pelaez
239
+
240
+ ## 3.3.1 (2026-02-13)
241
+
242
+ ### 🩹 Fixes
243
+
244
+ - **@23blocks/block-sales:** nest Stripe request params under resource keys for Rails strong parameters ([752f3bb](https://github.com/23blocks-OS/frontend-sdk/commit/752f3bb))
245
+
246
+ ### ❤️ Thank You
247
+
248
+ - Claude Opus 4.6
249
+ - Juan Pelaez
250
+
251
+ ## 3.3.0 (2026-02-13)
252
+
253
+ ### 🚀 Features
254
+
255
+ - **@23blocks/block-sales:** add Stripe checkout session verification, coupons, and promotion codes ([b479098](https://github.com/23blocks-OS/frontend-sdk/commit/b479098))
256
+
257
+ ### ❤️ Thank You
258
+
259
+ - Claude Opus 4.6
260
+ - Juan Pelaez
261
+
262
+ ## 3.2.0 (2026-02-08)
263
+
264
+ ### 🚀 Features
265
+
266
+ - add comprehensive JSDoc documentation and llms.txt for AI agent consumption ([fd97df2](https://github.com/23blocks-OS/frontend-sdk/commit/fd97df2))
267
+
268
+ ### 🧱 Updated Dependencies
269
+
270
+ - Updated @23blocks/jsonapi-codec to 3.2.0
271
+ - Updated @23blocks/contracts to 2.2.0
272
+
273
+ ### ❤️ Thank You
274
+
275
+ - Claude Opus 4.6
276
+ - Juan Pelaez
277
+
278
+ ## 3.1.5 (2026-02-07)
279
+
280
+ ### 🧱 Updated Dependencies
281
+
282
+ - Updated @23blocks/jsonapi-codec to 3.1.3
283
+ - Updated @23blocks/contracts to 2.1.3
284
+
285
+ ## 3.1.4 (2026-02-06)
286
+
287
+ ### 🧱 Updated Dependencies
288
+
289
+ - Updated @23blocks/jsonapi-codec to 3.1.2
290
+ - Updated @23blocks/contracts to 2.1.2
291
+
292
+ ## 3.1.3 (2026-01-20)
293
+
294
+ ### 🩹 Fixes
295
+
296
+ - resolve TypeScript errors and add PostTemplate validation support ([250d284](https://github.com/23blocks-OS/frontend-sdk/commit/250d284))
297
+
298
+ ### 🧱 Updated Dependencies
299
+
300
+ - Updated @23blocks/jsonapi-codec to 3.1.1
301
+ - Updated @23blocks/contracts to 2.1.1
302
+
303
+ ### ❤️ Thank You
304
+
305
+ - Claude Opus 4.5
306
+ - Juan Pelaez
307
+
308
+ ## 3.1.2 (2026-01-16)
309
+
310
+ ### 🩹 Fixes
311
+
312
+ - **mappers:** remove dangerous uniqueId fallback to resource.id ([e96c555](https://github.com/23blocks-OS/frontend-sdk/commit/e96c555))
313
+
314
+ ### ❤️ Thank You
315
+
316
+ - Claude Opus 4.5
317
+ - Juan Pelaez
318
+
319
+ ## 3.1.1 (2026-01-04)
320
+
321
+ ### 🩹 Fixes
322
+
323
+ - export all types, services, and mappers from blocks ([82cc41a](https://github.com/23blocks-OS/frontend-sdk/commit/82cc41a))
324
+
325
+ ### ❤️ Thank You
326
+
327
+ - Claude Opus 4.5
328
+ - Juan Pelaez
329
+
330
+ ## 3.1.0 (2026-01-01)
331
+
332
+ ### 🧱 Updated Dependencies
333
+
334
+ - Updated @23blocks/jsonapi-codec to 3.1.0
335
+ - Updated @23blocks/contracts to 2.1.0
336
+
337
+ ## 3.0.1 (2025-12-17)
338
+
339
+ ### 🧱 Updated Dependencies
340
+
341
+ - Updated @23blocks/jsonapi-codec to 3.0.1
342
+ - Updated @23blocks/contracts to 2.0.1
343
+
344
+ # 3.0.0 (2025-12-17)
345
+
346
+ ### 🧱 Updated Dependencies
347
+
348
+ - Updated @23blocks/jsonapi-codec to 3.0.0
349
+ - Updated @23blocks/contracts to 2.0.0
350
+
351
+ ## 2.2.0 (2025-12-15)
352
+
353
+ ### 🚀 Features
354
+
355
+ - achieve full Angular/React parity across all SDK blocks ([7debcce](https://github.com/23blocks-OS/frontend-sdk/commit/7debcce))
356
+
357
+ ### ❤️ Thank You
358
+
359
+ - Claude Opus 4.5
360
+ - Juan Pelaez
361
+
362
+ ## 2.1.0 (2025-12-15)
363
+
364
+ ### 🚀 Features
365
+
366
+ - add missing API services across 6 blocks ([cae5b8c](https://github.com/23blocks-OS/frontend-sdk/commit/cae5b8c))
367
+
368
+ ### ❤️ Thank You
369
+
370
+ - Claude Opus 4.5
371
+ - Juan Pelaez
372
+
373
+ # 2.0.0 (2025-12-15)
374
+
375
+ ### 🩹 Fixes
376
+
377
+ - ⚠️ wrap all API request parameters with correct Rails object keys ([192ad70](https://github.com/23blocks-OS/frontend-sdk/commit/192ad70))
378
+
379
+ ### ⚠️ Breaking Changes
380
+
381
+ - wrap all API request parameters with correct Rails object keys ([192ad70](https://github.com/23blocks-OS/frontend-sdk/commit/192ad70))
382
+ All service methods now correctly wrap request bodies
383
+ with Rails-expected parameter keys (e.g., `user:`, `contact:`, `order:`).
384
+ This fixes the critical issue where API requests were failing validation
385
+ because parameters were sent flat instead of wrapped.
386
+ Affected blocks:
387
+ - block-authentication: auth, users, guests, apps, subscriptions, api-keys, roles
388
+ - block-crm: contacts, accounts, leads, opportunities, meetings, quotes
389
+ - block-company: companies, departments, teams, team-members, quarters
390
+ - block-content: posts, comments, categories, tags
391
+ - block-products: products, cart, catalog
392
+ - block-sales: orders, order-details, payments, subscriptions
393
+ - block-conversations: messages, groups, draft-messages, notifications
394
+ - block-wallet: wallets, authorization-codes
395
+ - block-files: storage-files, entity-files, file-schemas
396
+ - block-forms: forms, form-schemas, form-sets, form-instances
397
+ - block-assets: assets, asset-events, asset-audits
398
+ - block-campaigns: campaigns, campaign-media, audiences, landing-pages
399
+ - block-geolocation: locations, addresses, areas, regions, routes, bookings, premises
400
+ - block-rewards: rewards, coupons, loyalty, badges
401
+ - block-onboarding: onboardings, flows, user-journeys, user-identities
402
+ - block-university: courses, lessons, enrollments, assignments, submissions
403
+ - block-jarvis: agents, prompts, workflows, conversations
404
+ Consumer API remains unchanged - this is an internal fix.
405
+ 🤖 Generated with [Claude Code](https://claude.com/claude-code)
406
+ Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
407
+
408
+ ### 🧱 Updated Dependencies
409
+
410
+ - Updated @23blocks/jsonapi-codec to 2.0.0
411
+
412
+ ### ❤️ Thank You
413
+
414
+ - Claude Opus 4.5
415
+ - Juan Pelaez
416
+
417
+ ## 1.0.4 (2025-12-14)
418
+
419
+ ### 🧱 Updated Dependencies
420
+
421
+ - Updated @23blocks/jsonapi-codec to 1.0.4
422
+ - Updated @23blocks/contracts to 1.0.4
423
+
424
+ ## 1.0.3 (2025-12-14)
425
+
426
+ ### 🧱 Updated Dependencies
427
+
428
+ - Updated @23blocks/jsonapi-codec to 1.0.3
429
+ - Updated @23blocks/contracts to 1.0.3
430
+
431
+ ## 1.0.2 (2025-12-14)
432
+
433
+ ### 🧱 Updated Dependencies
434
+
435
+ - Updated @23blocks/jsonapi-codec to 1.0.2
436
+ - Updated @23blocks/contracts to 1.0.2
437
+
438
+ ## 1.0.1 (2025-12-14)
439
+
440
+ ### 🧱 Updated Dependencies
441
+
442
+ - Updated @23blocks/jsonapi-codec to 1.0.1
443
+ - Updated @23blocks/contracts to 1.0.1
444
+
445
+ # 1.0.0 (2025-12-13)
446
+
447
+ ### 🧱 Updated Dependencies
448
+
449
+ - Updated @23blocks/jsonapi-codec to 1.0.0
450
+ - Updated @23blocks/contracts to 1.0.0
451
+
452
+ ## 0.2.1 (2025-12-13)
453
+
454
+ ### 🧱 Updated Dependencies
455
+
456
+ - Updated @23blocks/jsonapi-codec to 0.1.2
457
+ - Updated @23blocks/contracts to 0.1.2
458
+
459
+ ## 0.2.0 (2025-12-13)
460
+
461
+ ### 🚀 Features
462
+
463
+ - add all block packages with React and Angular bindings ([bbeecf7](https://github.com/23blocks-OS/frontend-sdk/commit/bbeecf7))
464
+
465
+ ### 🧱 Updated Dependencies
466
+
467
+ - Updated @23blocks/jsonapi-codec to 0.1.1
468
+ - Updated @23blocks/contracts to 0.1.1
469
+
470
+ ### ❤️ Thank You
471
+
472
+ - Claude Opus 4.5
473
+ - Juan Pelaez
package/dist/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { decodePageResult, decodeOne, decodeMany } from '@23blocks/jsonapi-codec';
1
+ import { decodePageResult, decodeOne, decodeMany, extractPageMeta } from '@23blocks/jsonapi-codec';
2
2
 
3
3
  /**
4
4
  * Parse a string value, returning undefined for empty/undefined
@@ -1853,33 +1853,39 @@ function createVendorPaymentsService(transport, _config) {
1853
1853
  page: params.page,
1854
1854
  per_page: params.perPage
1855
1855
  });
1856
+ const decoded = decodeMany(response, vendorPaymentMapper);
1857
+ const pageMeta = extractPageMeta(response);
1858
+ const doc = response;
1859
+ const metaObj = doc['meta'] || {};
1860
+ const summaryObj = metaObj['summary'] || {};
1861
+ const periodObj = summaryObj['period'] || {};
1856
1862
  return {
1857
- payments: (response.payments || []).map((p)=>({
1858
- uniqueId: p.unique_id,
1859
- orderUniqueId: p.order_unique_id,
1860
- vendorName: p.vendor_name,
1861
- amount: p.amount,
1862
- status: p.status,
1863
- paidAt: p.paid_at ? new Date(p.paid_at) : undefined,
1864
- createdAt: new Date(p.created_at)
1863
+ payments: decoded.map((vp)=>({
1864
+ uniqueId: vp.uniqueId,
1865
+ orderUniqueId: vp.vendorUniqueId || '',
1866
+ vendorName: vp.vendorName,
1867
+ amount: vp.price || 0,
1868
+ status: vp.status || '',
1869
+ paidAt: vp.paidAt,
1870
+ createdAt: vp.createdAt
1865
1871
  })),
1866
1872
  summary: {
1867
- totalPayments: response.summary.total_payments,
1868
- totalAmount: response.summary.total_amount,
1869
- totalPending: response.summary.total_pending,
1870
- totalPaid: response.summary.total_paid,
1871
- paymentsByStatus: response.summary.payments_by_status,
1872
- currency: response.summary.currency,
1873
+ totalPayments: Number(summaryObj['total_payments'] || 0),
1874
+ totalAmount: Number(summaryObj['total_amount'] || 0),
1875
+ totalPending: Number(summaryObj['total_pending'] || 0),
1876
+ totalPaid: Number(summaryObj['total_paid'] || 0),
1877
+ paymentsByStatus: summaryObj['payments_by_status'] || {},
1878
+ currency: String(summaryObj['currency'] || ''),
1873
1879
  period: {
1874
- startDate: new Date(response.summary.period.start_date),
1875
- endDate: new Date(response.summary.period.end_date)
1880
+ startDate: periodObj['start_date'] ? new Date(periodObj['start_date']) : new Date(),
1881
+ endDate: periodObj['end_date'] ? new Date(periodObj['end_date']) : new Date()
1876
1882
  }
1877
1883
  },
1878
1884
  meta: {
1879
- totalCount: response.meta.total_count,
1880
- page: response.meta.current_page,
1881
- perPage: response.meta.per_page,
1882
- totalPages: response.meta.total_pages
1885
+ totalCount: pageMeta.totalCount,
1886
+ page: pageMeta.currentPage,
1887
+ perPage: pageMeta.perPage,
1888
+ totalPages: pageMeta.totalPages
1883
1889
  }
1884
1890
  };
1885
1891
  },
@@ -1913,30 +1919,36 @@ function createVendorPaymentsService(transport, _config) {
1913
1919
  page: params.page,
1914
1920
  per_page: params.perPage
1915
1921
  });
1922
+ const decoded = decodeMany(response, orderDetailVendorMapper);
1923
+ const pageMeta = extractPageMeta(response);
1924
+ const doc = response;
1925
+ const metaObj = doc['meta'] || {};
1926
+ const summaryObj = metaObj['summary'] || {};
1927
+ const periodObj = summaryObj['period'] || {};
1916
1928
  return {
1917
- providers: (response.providers || []).map((p)=>({
1918
- uniqueId: p.unique_id,
1919
- vendorName: p.vendor_name,
1920
- amount: p.amount,
1921
- commission: p.commission,
1922
- status: p.status,
1923
- createdAt: new Date(p.created_at)
1929
+ providers: decoded.map((odv)=>({
1930
+ uniqueId: odv.uniqueId,
1931
+ vendorName: odv.vendorName,
1932
+ amount: 0,
1933
+ commission: undefined,
1934
+ status: odv.status || '',
1935
+ createdAt: odv.createdAt
1924
1936
  })),
1925
1937
  summary: {
1926
- totalProviders: response.summary.total_providers,
1927
- totalAmount: response.summary.total_amount,
1928
- totalCommission: response.summary.total_commission,
1929
- providersByStatus: response.summary.providers_by_status,
1938
+ totalProviders: Number(summaryObj['total_providers'] || 0),
1939
+ totalAmount: Number(summaryObj['total_amount'] || 0),
1940
+ totalCommission: Number(summaryObj['total_commission'] || 0),
1941
+ providersByStatus: summaryObj['providers_by_status'] || {},
1930
1942
  period: {
1931
- startDate: new Date(response.summary.period.start_date),
1932
- endDate: new Date(response.summary.period.end_date)
1943
+ startDate: periodObj['start_date'] ? new Date(periodObj['start_date']) : new Date(),
1944
+ endDate: periodObj['end_date'] ? new Date(periodObj['end_date']) : new Date()
1933
1945
  }
1934
1946
  },
1935
1947
  meta: {
1936
- totalCount: response.meta.total_count,
1937
- page: response.meta.current_page,
1938
- perPage: response.meta.per_page,
1939
- totalPages: response.meta.total_pages
1948
+ totalCount: pageMeta.totalCount,
1949
+ page: pageMeta.currentPage,
1950
+ perPage: pageMeta.perPage,
1951
+ totalPages: pageMeta.totalPages
1940
1952
  }
1941
1953
  };
1942
1954
  },
@@ -1 +1 @@
1
- {"version":3,"file":"vendor-payments.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/vendor-payments.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EACV,aAAa,EACb,0BAA0B,EAC1B,0BAA0B,EAC1B,uBAAuB,EACvB,iBAAiB,EACjB,8BAA8B,EAC9B,8BAA8B,EAC/B,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,0BAA0B,EAC1B,uBAAuB,EACvB,yBAAyB,EACzB,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAuE5B,MAAM,WAAW,qBAAqB;IACpC,GAAG,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IACrD,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,IAAI,EAAE,0BAA0B,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IACxI,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,IAAI,EAAE,0BAA0B,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IACjK,GAAG,CAAC,aAAa,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,uBAAuB,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAC5J,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtH,cAAc,CAAC,aAAa,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,EAAE,IAAI,EAAE,8BAA8B,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACrI,cAAc,CAAC,aAAa,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,IAAI,EAAE,8BAA8B,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC/J,UAAU,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAChF,aAAa,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;IACtF,kBAAkB,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC9E,qBAAqB,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACrF;AAED,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,qBAAqB,CAqKpH"}
1
+ {"version":3,"file":"vendor-payments.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/vendor-payments.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EACV,aAAa,EACb,0BAA0B,EAC1B,0BAA0B,EAC1B,uBAAuB,EACvB,iBAAiB,EACjB,8BAA8B,EAC9B,8BAA8B,EAC/B,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,0BAA0B,EAC1B,uBAAuB,EACvB,yBAAyB,EACzB,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAuE5B,MAAM,WAAW,qBAAqB;IACpC,GAAG,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IACrD,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,IAAI,EAAE,0BAA0B,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IACxI,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,IAAI,EAAE,0BAA0B,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IACjK,GAAG,CAAC,aAAa,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,uBAAuB,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAC5J,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtH,cAAc,CAAC,aAAa,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,EAAE,IAAI,EAAE,8BAA8B,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACrI,cAAc,CAAC,aAAa,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,IAAI,EAAE,8BAA8B,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC/J,UAAU,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAChF,aAAa,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;IACtF,kBAAkB,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC9E,qBAAqB,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACrF;AAED,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,qBAAqB,CAiLpH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@23blocks/block-sales",
3
- "version": "8.0.0",
3
+ "version": "8.0.2",
4
4
  "description": "Sales block for 23blocks SDK - orders, payments, subscriptions, transactions",
5
5
  "license": "MIT",
6
6
  "author": "23blocks <hello@23blocks.com>",
@@ -36,6 +36,8 @@
36
36
  },
37
37
  "files": [
38
38
  "dist",
39
+ "CHANGELOG.md",
40
+ "README.md",
39
41
  "!**/*.tsbuildinfo"
40
42
  ],
41
43
  "nx": {