@23blocks/block-sales 5.0.1 → 5.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/dist/index.esm.js +101 -177
- package/dist/src/lib/mappers/customer-subscription.mapper.d.ts +4 -0
- package/dist/src/lib/mappers/customer-subscription.mapper.d.ts.map +1 -0
- package/dist/src/lib/mappers/entity-subscription.mapper.d.ts +4 -0
- package/dist/src/lib/mappers/entity-subscription.mapper.d.ts.map +1 -0
- package/dist/src/lib/mappers/index.d.ts +4 -0
- package/dist/src/lib/mappers/index.d.ts.map +1 -1
- package/dist/src/lib/mappers/order-detail-vendor.mapper.d.ts +4 -0
- package/dist/src/lib/mappers/order-detail-vendor.mapper.d.ts.map +1 -0
- package/dist/src/lib/mappers/vendor-payment.mapper.d.ts +4 -0
- package/dist/src/lib/mappers/vendor-payment.mapper.d.ts.map +1 -0
- package/dist/src/lib/services/customers.service.d.ts.map +1 -1
- package/dist/src/lib/services/entities.service.d.ts.map +1 -1
- package/dist/src/lib/services/vendor-payments.service.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -607,6 +607,27 @@ const salesEntityMapper = {
|
|
|
607
607
|
}
|
|
608
608
|
};
|
|
609
609
|
|
|
610
|
+
const entitySubscriptionMapper = {
|
|
611
|
+
type: 'EntitySubscription',
|
|
612
|
+
map: (resource)=>{
|
|
613
|
+
var _resource_attributes_subscription_unique_id, _resource_attributes_subscription_model_unique_id, _resource_attributes_start_at, _resource_attributes_end_at, _resource_attributes_closed_at, _resource_attributes_created_at, _parseDate, _resource_attributes_updated_at, _parseDate1;
|
|
614
|
+
return {
|
|
615
|
+
id: resource.id,
|
|
616
|
+
uniqueId: (_resource_attributes_subscription_unique_id = resource.attributes['subscription_unique_id']) != null ? _resource_attributes_subscription_unique_id : resource.attributes['unique_id'],
|
|
617
|
+
entityUniqueId: resource.attributes['entity_unique_id'],
|
|
618
|
+
subscriptionModelUniqueId: (_resource_attributes_subscription_model_unique_id = resource.attributes['subscription_model_unique_id']) != null ? _resource_attributes_subscription_model_unique_id : resource.attributes['code'],
|
|
619
|
+
status: resource.attributes['status'],
|
|
620
|
+
startDate: parseDate((_resource_attributes_start_at = resource.attributes['start_at']) != null ? _resource_attributes_start_at : resource.attributes['start_date']),
|
|
621
|
+
endDate: parseDate((_resource_attributes_end_at = resource.attributes['end_at']) != null ? _resource_attributes_end_at : resource.attributes['end_date']),
|
|
622
|
+
trialEndDate: parseDate(resource.attributes['trial_end_date']),
|
|
623
|
+
cancelledAt: parseDate((_resource_attributes_closed_at = resource.attributes['closed_at']) != null ? _resource_attributes_closed_at : resource.attributes['cancelled_at']),
|
|
624
|
+
payload: resource.attributes['payload'],
|
|
625
|
+
createdAt: (_parseDate = parseDate((_resource_attributes_created_at = resource.attributes['created_at']) != null ? _resource_attributes_created_at : resource.attributes['subscribed_at'])) != null ? _parseDate : new Date(),
|
|
626
|
+
updatedAt: (_parseDate1 = parseDate((_resource_attributes_updated_at = resource.attributes['updated_at']) != null ? _resource_attributes_updated_at : resource.attributes['subscribed_at'])) != null ? _parseDate1 : new Date()
|
|
627
|
+
};
|
|
628
|
+
}
|
|
629
|
+
};
|
|
630
|
+
|
|
610
631
|
function createSalesEntitiesService(transport, _config) {
|
|
611
632
|
return {
|
|
612
633
|
async list (params) {
|
|
@@ -658,20 +679,7 @@ function createSalesEntitiesService(transport, _config) {
|
|
|
658
679
|
payload: data.payload
|
|
659
680
|
}
|
|
660
681
|
});
|
|
661
|
-
return
|
|
662
|
-
id: response.id,
|
|
663
|
-
uniqueId: response.unique_id,
|
|
664
|
-
entityUniqueId: response.entity_unique_id,
|
|
665
|
-
subscriptionModelUniqueId: response.subscription_model_unique_id,
|
|
666
|
-
status: response.status,
|
|
667
|
-
startDate: response.start_date ? new Date(response.start_date) : undefined,
|
|
668
|
-
endDate: response.end_date ? new Date(response.end_date) : undefined,
|
|
669
|
-
trialEndDate: response.trial_end_date ? new Date(response.trial_end_date) : undefined,
|
|
670
|
-
cancelledAt: response.cancelled_at ? new Date(response.cancelled_at) : undefined,
|
|
671
|
-
payload: response.payload,
|
|
672
|
-
createdAt: new Date(response.created_at),
|
|
673
|
-
updatedAt: new Date(response.updated_at)
|
|
674
|
-
};
|
|
682
|
+
return decodeOne(response, entitySubscriptionMapper);
|
|
675
683
|
},
|
|
676
684
|
async updateSubscription (uniqueId, subscriptionUniqueId, data) {
|
|
677
685
|
const response = await transport.put(`/entities/${uniqueId}/subscriptions/${subscriptionUniqueId}`, {
|
|
@@ -681,20 +689,7 @@ function createSalesEntitiesService(transport, _config) {
|
|
|
681
689
|
payload: data.payload
|
|
682
690
|
}
|
|
683
691
|
});
|
|
684
|
-
return
|
|
685
|
-
id: response.id,
|
|
686
|
-
uniqueId: response.unique_id,
|
|
687
|
-
entityUniqueId: response.entity_unique_id,
|
|
688
|
-
subscriptionModelUniqueId: response.subscription_model_unique_id,
|
|
689
|
-
status: response.status,
|
|
690
|
-
startDate: response.start_date ? new Date(response.start_date) : undefined,
|
|
691
|
-
endDate: response.end_date ? new Date(response.end_date) : undefined,
|
|
692
|
-
trialEndDate: response.trial_end_date ? new Date(response.trial_end_date) : undefined,
|
|
693
|
-
cancelledAt: response.cancelled_at ? new Date(response.cancelled_at) : undefined,
|
|
694
|
-
payload: response.payload,
|
|
695
|
-
createdAt: new Date(response.created_at),
|
|
696
|
-
updatedAt: new Date(response.updated_at)
|
|
697
|
-
};
|
|
692
|
+
return decodeOne(response, entitySubscriptionMapper);
|
|
698
693
|
}
|
|
699
694
|
};
|
|
700
695
|
}
|
|
@@ -883,6 +878,27 @@ const salesCustomerMapper = {
|
|
|
883
878
|
}
|
|
884
879
|
};
|
|
885
880
|
|
|
881
|
+
const customerSubscriptionMapper = {
|
|
882
|
+
type: 'CustomerSubscription',
|
|
883
|
+
map: (resource)=>{
|
|
884
|
+
var _resource_attributes_subscription_unique_id, _resource_attributes_subscription_model_unique_id, _resource_attributes_start_at, _resource_attributes_end_at, _resource_attributes_closed_at, _resource_attributes_created_at, _parseDate, _resource_attributes_updated_at, _parseDate1;
|
|
885
|
+
return {
|
|
886
|
+
id: resource.id,
|
|
887
|
+
uniqueId: (_resource_attributes_subscription_unique_id = resource.attributes['subscription_unique_id']) != null ? _resource_attributes_subscription_unique_id : resource.attributes['unique_id'],
|
|
888
|
+
customerUniqueId: resource.attributes['customer_unique_id'],
|
|
889
|
+
subscriptionModelUniqueId: (_resource_attributes_subscription_model_unique_id = resource.attributes['subscription_model_unique_id']) != null ? _resource_attributes_subscription_model_unique_id : resource.attributes['code'],
|
|
890
|
+
status: resource.attributes['status'],
|
|
891
|
+
startDate: parseDate((_resource_attributes_start_at = resource.attributes['start_at']) != null ? _resource_attributes_start_at : resource.attributes['start_date']),
|
|
892
|
+
endDate: parseDate((_resource_attributes_end_at = resource.attributes['end_at']) != null ? _resource_attributes_end_at : resource.attributes['end_date']),
|
|
893
|
+
trialEndDate: parseDate(resource.attributes['trial_end_date']),
|
|
894
|
+
cancelledAt: parseDate((_resource_attributes_closed_at = resource.attributes['closed_at']) != null ? _resource_attributes_closed_at : resource.attributes['cancelled_at']),
|
|
895
|
+
payload: resource.attributes['payload'],
|
|
896
|
+
createdAt: (_parseDate = parseDate((_resource_attributes_created_at = resource.attributes['created_at']) != null ? _resource_attributes_created_at : resource.attributes['subscribed_at'])) != null ? _parseDate : new Date(),
|
|
897
|
+
updatedAt: (_parseDate1 = parseDate((_resource_attributes_updated_at = resource.attributes['updated_at']) != null ? _resource_attributes_updated_at : resource.attributes['subscribed_at'])) != null ? _parseDate1 : new Date()
|
|
898
|
+
};
|
|
899
|
+
}
|
|
900
|
+
};
|
|
901
|
+
|
|
886
902
|
function createSalesCustomersService(transport, _config) {
|
|
887
903
|
return {
|
|
888
904
|
async get (uniqueId) {
|
|
@@ -904,20 +920,7 @@ function createSalesCustomersService(transport, _config) {
|
|
|
904
920
|
},
|
|
905
921
|
async getSubscription (uniqueId, subscriptionUniqueId) {
|
|
906
922
|
const response = await transport.get(`/customers/${uniqueId}/subscriptions/${subscriptionUniqueId}`);
|
|
907
|
-
return
|
|
908
|
-
id: response.id,
|
|
909
|
-
uniqueId: response.unique_id,
|
|
910
|
-
customerUniqueId: response.customer_unique_id,
|
|
911
|
-
subscriptionModelUniqueId: response.subscription_model_unique_id,
|
|
912
|
-
status: response.status,
|
|
913
|
-
startDate: response.start_date ? new Date(response.start_date) : undefined,
|
|
914
|
-
endDate: response.end_date ? new Date(response.end_date) : undefined,
|
|
915
|
-
trialEndDate: response.trial_end_date ? new Date(response.trial_end_date) : undefined,
|
|
916
|
-
cancelledAt: response.cancelled_at ? new Date(response.cancelled_at) : undefined,
|
|
917
|
-
payload: response.payload,
|
|
918
|
-
createdAt: new Date(response.created_at),
|
|
919
|
-
updatedAt: new Date(response.updated_at)
|
|
920
|
-
};
|
|
923
|
+
return decodeOne(response, customerSubscriptionMapper);
|
|
921
924
|
},
|
|
922
925
|
async createSubscription (uniqueId, data) {
|
|
923
926
|
const response = await transport.post(`/customers/${uniqueId}/subscriptions`, {
|
|
@@ -928,20 +931,7 @@ function createSalesCustomersService(transport, _config) {
|
|
|
928
931
|
payload: data.payload
|
|
929
932
|
}
|
|
930
933
|
});
|
|
931
|
-
return
|
|
932
|
-
id: response.id,
|
|
933
|
-
uniqueId: response.unique_id,
|
|
934
|
-
customerUniqueId: response.customer_unique_id,
|
|
935
|
-
subscriptionModelUniqueId: response.subscription_model_unique_id,
|
|
936
|
-
status: response.status,
|
|
937
|
-
startDate: response.start_date ? new Date(response.start_date) : undefined,
|
|
938
|
-
endDate: response.end_date ? new Date(response.end_date) : undefined,
|
|
939
|
-
trialEndDate: response.trial_end_date ? new Date(response.trial_end_date) : undefined,
|
|
940
|
-
cancelledAt: response.cancelled_at ? new Date(response.cancelled_at) : undefined,
|
|
941
|
-
payload: response.payload,
|
|
942
|
-
createdAt: new Date(response.created_at),
|
|
943
|
-
updatedAt: new Date(response.updated_at)
|
|
944
|
-
};
|
|
934
|
+
return decodeOne(response, customerSubscriptionMapper);
|
|
945
935
|
},
|
|
946
936
|
async updateSubscription (uniqueId, subscriptionUniqueId, data) {
|
|
947
937
|
const response = await transport.put(`/customers/${uniqueId}/subscriptions/${subscriptionUniqueId}`, {
|
|
@@ -951,20 +941,7 @@ function createSalesCustomersService(transport, _config) {
|
|
|
951
941
|
payload: data.payload
|
|
952
942
|
}
|
|
953
943
|
});
|
|
954
|
-
return
|
|
955
|
-
id: response.id,
|
|
956
|
-
uniqueId: response.unique_id,
|
|
957
|
-
customerUniqueId: response.customer_unique_id,
|
|
958
|
-
subscriptionModelUniqueId: response.subscription_model_unique_id,
|
|
959
|
-
status: response.status,
|
|
960
|
-
startDate: response.start_date ? new Date(response.start_date) : undefined,
|
|
961
|
-
endDate: response.end_date ? new Date(response.end_date) : undefined,
|
|
962
|
-
trialEndDate: response.trial_end_date ? new Date(response.trial_end_date) : undefined,
|
|
963
|
-
cancelledAt: response.cancelled_at ? new Date(response.cancelled_at) : undefined,
|
|
964
|
-
payload: response.payload,
|
|
965
|
-
createdAt: new Date(response.created_at),
|
|
966
|
-
updatedAt: new Date(response.updated_at)
|
|
967
|
-
};
|
|
944
|
+
return decodeOne(response, customerSubscriptionMapper);
|
|
968
945
|
}
|
|
969
946
|
};
|
|
970
947
|
}
|
|
@@ -1521,26 +1498,55 @@ function createMercadoPagoService(transport, _config) {
|
|
|
1521
1498
|
};
|
|
1522
1499
|
}
|
|
1523
1500
|
|
|
1501
|
+
const vendorPaymentMapper = {
|
|
1502
|
+
type: 'VendorPayment',
|
|
1503
|
+
map: (resource)=>{
|
|
1504
|
+
var _parseDate, _parseDate1;
|
|
1505
|
+
return {
|
|
1506
|
+
id: resource.id,
|
|
1507
|
+
uniqueId: resource.attributes['unique_id'],
|
|
1508
|
+
orderUniqueId: resource.attributes['order_unique_id'],
|
|
1509
|
+
detailUniqueId: resource.attributes['detail_unique_id'],
|
|
1510
|
+
vendorUniqueId: resource.attributes['vendor_unique_id'],
|
|
1511
|
+
amount: parseNumber(resource.attributes['amount']),
|
|
1512
|
+
currency: resource.attributes['currency'],
|
|
1513
|
+
status: resource.attributes['status'],
|
|
1514
|
+
paidAt: parseDate(resource.attributes['paid_at']),
|
|
1515
|
+
reference: resource.attributes['reference'],
|
|
1516
|
+
notes: resource.attributes['notes'],
|
|
1517
|
+
payload: resource.attributes['payload'],
|
|
1518
|
+
createdAt: (_parseDate = parseDate(resource.attributes['created_at'])) != null ? _parseDate : new Date(),
|
|
1519
|
+
updatedAt: (_parseDate1 = parseDate(resource.attributes['updated_at'])) != null ? _parseDate1 : new Date()
|
|
1520
|
+
};
|
|
1521
|
+
}
|
|
1522
|
+
};
|
|
1523
|
+
|
|
1524
|
+
const orderDetailVendorMapper = {
|
|
1525
|
+
type: 'OrderDetailVendor',
|
|
1526
|
+
map: (resource)=>{
|
|
1527
|
+
var _parseDate, _parseDate1;
|
|
1528
|
+
return {
|
|
1529
|
+
id: resource.id,
|
|
1530
|
+
uniqueId: resource.attributes['unique_id'],
|
|
1531
|
+
orderDetailUniqueId: resource.attributes['order_detail_unique_id'],
|
|
1532
|
+
sourceId: resource.attributes['source_id'],
|
|
1533
|
+
vendorUniqueId: resource.attributes['vendor_unique_id'],
|
|
1534
|
+
vendorName: resource.attributes['vendor_name'],
|
|
1535
|
+
amount: parseNumber(resource.attributes['amount']),
|
|
1536
|
+
commission: parseOptionalNumber(resource.attributes['commission']),
|
|
1537
|
+
status: resource.attributes['status'],
|
|
1538
|
+
payload: resource.attributes['payload'],
|
|
1539
|
+
createdAt: (_parseDate = parseDate(resource.attributes['created_at'])) != null ? _parseDate : new Date(),
|
|
1540
|
+
updatedAt: (_parseDate1 = parseDate(resource.attributes['updated_at'])) != null ? _parseDate1 : new Date()
|
|
1541
|
+
};
|
|
1542
|
+
}
|
|
1543
|
+
};
|
|
1544
|
+
|
|
1524
1545
|
function createVendorPaymentsService(transport, _config) {
|
|
1525
1546
|
return {
|
|
1526
1547
|
async get (paymentUniqueId) {
|
|
1527
1548
|
const response = await transport.get(`/payables/${paymentUniqueId}`);
|
|
1528
|
-
return
|
|
1529
|
-
id: response.id,
|
|
1530
|
-
uniqueId: response.unique_id,
|
|
1531
|
-
orderUniqueId: response.order_unique_id,
|
|
1532
|
-
detailUniqueId: response.detail_unique_id,
|
|
1533
|
-
vendorUniqueId: response.vendor_unique_id,
|
|
1534
|
-
amount: response.amount,
|
|
1535
|
-
currency: response.currency,
|
|
1536
|
-
status: response.status,
|
|
1537
|
-
paidAt: response.paid_at ? new Date(response.paid_at) : undefined,
|
|
1538
|
-
reference: response.reference,
|
|
1539
|
-
notes: response.notes,
|
|
1540
|
-
payload: response.payload,
|
|
1541
|
-
createdAt: new Date(response.created_at),
|
|
1542
|
-
updatedAt: new Date(response.updated_at)
|
|
1543
|
-
};
|
|
1549
|
+
return decodeOne(response, vendorPaymentMapper);
|
|
1544
1550
|
},
|
|
1545
1551
|
async create (orderUniqueId, detailUniqueId, vendorUniqueId, data) {
|
|
1546
1552
|
const response = await transport.post(`/orders/${orderUniqueId}/details/${detailUniqueId}/vendors/${vendorUniqueId}/payments`, {
|
|
@@ -1552,22 +1558,7 @@ function createVendorPaymentsService(transport, _config) {
|
|
|
1552
1558
|
payload: data.payload
|
|
1553
1559
|
}
|
|
1554
1560
|
});
|
|
1555
|
-
return
|
|
1556
|
-
id: response.id,
|
|
1557
|
-
uniqueId: response.unique_id,
|
|
1558
|
-
orderUniqueId: response.order_unique_id,
|
|
1559
|
-
detailUniqueId: response.detail_unique_id,
|
|
1560
|
-
vendorUniqueId: response.vendor_unique_id,
|
|
1561
|
-
amount: response.amount,
|
|
1562
|
-
currency: response.currency,
|
|
1563
|
-
status: response.status,
|
|
1564
|
-
paidAt: response.paid_at ? new Date(response.paid_at) : undefined,
|
|
1565
|
-
reference: response.reference,
|
|
1566
|
-
notes: response.notes,
|
|
1567
|
-
payload: response.payload,
|
|
1568
|
-
createdAt: new Date(response.created_at),
|
|
1569
|
-
updatedAt: new Date(response.updated_at)
|
|
1570
|
-
};
|
|
1561
|
+
return decodeOne(response, vendorPaymentMapper);
|
|
1571
1562
|
},
|
|
1572
1563
|
async update (orderUniqueId, detailUniqueId, vendorUniqueId, paymentUniqueId, data) {
|
|
1573
1564
|
const response = await transport.put(`/orders/${orderUniqueId}/details/${detailUniqueId}/vendors/${vendorUniqueId}/payments/${paymentUniqueId}`, {
|
|
@@ -1579,41 +1570,11 @@ function createVendorPaymentsService(transport, _config) {
|
|
|
1579
1570
|
payload: data.payload
|
|
1580
1571
|
}
|
|
1581
1572
|
});
|
|
1582
|
-
return
|
|
1583
|
-
id: response.id,
|
|
1584
|
-
uniqueId: response.unique_id,
|
|
1585
|
-
orderUniqueId: response.order_unique_id,
|
|
1586
|
-
detailUniqueId: response.detail_unique_id,
|
|
1587
|
-
vendorUniqueId: response.vendor_unique_id,
|
|
1588
|
-
amount: response.amount,
|
|
1589
|
-
currency: response.currency,
|
|
1590
|
-
status: response.status,
|
|
1591
|
-
paidAt: response.paid_at ? new Date(response.paid_at) : undefined,
|
|
1592
|
-
reference: response.reference,
|
|
1593
|
-
notes: response.notes,
|
|
1594
|
-
payload: response.payload,
|
|
1595
|
-
createdAt: new Date(response.created_at),
|
|
1596
|
-
updatedAt: new Date(response.updated_at)
|
|
1597
|
-
};
|
|
1573
|
+
return decodeOne(response, vendorPaymentMapper);
|
|
1598
1574
|
},
|
|
1599
1575
|
async pay (orderUniqueId, detailUniqueId, vendorUniqueId, paymentUniqueId) {
|
|
1600
1576
|
const response = await transport.put(`/orders/${orderUniqueId}/details/${detailUniqueId}/vendors/${vendorUniqueId}/payments/${paymentUniqueId}/pay`, {});
|
|
1601
|
-
return
|
|
1602
|
-
id: response.id,
|
|
1603
|
-
uniqueId: response.unique_id,
|
|
1604
|
-
orderUniqueId: response.order_unique_id,
|
|
1605
|
-
detailUniqueId: response.detail_unique_id,
|
|
1606
|
-
vendorUniqueId: response.vendor_unique_id,
|
|
1607
|
-
amount: response.amount,
|
|
1608
|
-
currency: response.currency,
|
|
1609
|
-
status: response.status,
|
|
1610
|
-
paidAt: response.paid_at ? new Date(response.paid_at) : undefined,
|
|
1611
|
-
reference: response.reference,
|
|
1612
|
-
notes: response.notes,
|
|
1613
|
-
payload: response.payload,
|
|
1614
|
-
createdAt: new Date(response.created_at),
|
|
1615
|
-
updatedAt: new Date(response.updated_at)
|
|
1616
|
-
};
|
|
1577
|
+
return decodeOne(response, vendorPaymentMapper);
|
|
1617
1578
|
},
|
|
1618
1579
|
async delete (orderUniqueId, detailUniqueId, vendorUniqueId, paymentUniqueId) {
|
|
1619
1580
|
await transport.delete(`/orders/${orderUniqueId}/details/${detailUniqueId}/vendors/${vendorUniqueId}/payments/${paymentUniqueId}`);
|
|
@@ -1627,19 +1588,7 @@ function createVendorPaymentsService(transport, _config) {
|
|
|
1627
1588
|
payload: data.payload
|
|
1628
1589
|
}
|
|
1629
1590
|
});
|
|
1630
|
-
return
|
|
1631
|
-
id: response.id,
|
|
1632
|
-
uniqueId: response.unique_id,
|
|
1633
|
-
orderDetailUniqueId: response.order_detail_unique_id,
|
|
1634
|
-
vendorUniqueId: response.vendor_unique_id,
|
|
1635
|
-
vendorName: response.vendor_name,
|
|
1636
|
-
amount: response.amount,
|
|
1637
|
-
commission: response.commission,
|
|
1638
|
-
status: response.status,
|
|
1639
|
-
payload: response.payload,
|
|
1640
|
-
createdAt: new Date(response.created_at),
|
|
1641
|
-
updatedAt: new Date(response.updated_at)
|
|
1642
|
-
};
|
|
1591
|
+
return decodeOne(response, orderDetailVendorMapper);
|
|
1643
1592
|
},
|
|
1644
1593
|
async createProviderBySource (sourceId, data) {
|
|
1645
1594
|
const response = await transport.post(`/sources/${sourceId}/providers`, {
|
|
@@ -1652,20 +1601,7 @@ function createVendorPaymentsService(transport, _config) {
|
|
|
1652
1601
|
payload: data.payload
|
|
1653
1602
|
}
|
|
1654
1603
|
});
|
|
1655
|
-
return
|
|
1656
|
-
id: response.id,
|
|
1657
|
-
uniqueId: response.unique_id,
|
|
1658
|
-
sourceId: response.source_id,
|
|
1659
|
-
orderDetailUniqueId: response.order_detail_unique_id,
|
|
1660
|
-
vendorUniqueId: response.vendor_unique_id,
|
|
1661
|
-
vendorName: response.vendor_name,
|
|
1662
|
-
amount: response.amount,
|
|
1663
|
-
commission: response.commission,
|
|
1664
|
-
status: response.status,
|
|
1665
|
-
payload: response.payload,
|
|
1666
|
-
createdAt: new Date(response.created_at),
|
|
1667
|
-
updatedAt: new Date(response.updated_at)
|
|
1668
|
-
};
|
|
1604
|
+
return decodeOne(response, orderDetailVendorMapper);
|
|
1669
1605
|
},
|
|
1670
1606
|
async updateProvider (orderUniqueId, orderDetailUniqueId, providerUniqueId, data) {
|
|
1671
1607
|
const response = await transport.put(`/orders/${orderUniqueId}/details/${orderDetailUniqueId}/providers/${providerUniqueId}`, {
|
|
@@ -1676,19 +1612,7 @@ function createVendorPaymentsService(transport, _config) {
|
|
|
1676
1612
|
payload: data.payload
|
|
1677
1613
|
}
|
|
1678
1614
|
});
|
|
1679
|
-
return
|
|
1680
|
-
id: response.id,
|
|
1681
|
-
uniqueId: response.unique_id,
|
|
1682
|
-
orderDetailUniqueId: response.order_detail_unique_id,
|
|
1683
|
-
vendorUniqueId: response.vendor_unique_id,
|
|
1684
|
-
vendorName: response.vendor_name,
|
|
1685
|
-
amount: response.amount,
|
|
1686
|
-
commission: response.commission,
|
|
1687
|
-
status: response.status,
|
|
1688
|
-
payload: response.payload,
|
|
1689
|
-
createdAt: new Date(response.created_at),
|
|
1690
|
-
updatedAt: new Date(response.updated_at)
|
|
1691
|
-
};
|
|
1615
|
+
return decodeOne(response, orderDetailVendorMapper);
|
|
1692
1616
|
},
|
|
1693
1617
|
async reportList (params) {
|
|
1694
1618
|
const response = await transport.post('/reports/vendors/payments/list', {
|
|
@@ -1723,7 +1647,7 @@ function createVendorPaymentsService(transport, _config) {
|
|
|
1723
1647
|
},
|
|
1724
1648
|
meta: {
|
|
1725
1649
|
totalCount: response.meta.total_count,
|
|
1726
|
-
|
|
1650
|
+
page: response.meta.current_page,
|
|
1727
1651
|
perPage: response.meta.per_page,
|
|
1728
1652
|
totalPages: response.meta.total_pages
|
|
1729
1653
|
}
|
|
@@ -1780,7 +1704,7 @@ function createVendorPaymentsService(transport, _config) {
|
|
|
1780
1704
|
},
|
|
1781
1705
|
meta: {
|
|
1782
1706
|
totalCount: response.meta.total_count,
|
|
1783
|
-
|
|
1707
|
+
page: response.meta.current_page,
|
|
1784
1708
|
perPage: response.meta.per_page,
|
|
1785
1709
|
totalPages: response.meta.total_pages
|
|
1786
1710
|
}
|
|
@@ -1882,4 +1806,4 @@ const salesBlockMetadata = {
|
|
|
1882
1806
|
]
|
|
1883
1807
|
};
|
|
1884
1808
|
|
|
1885
|
-
export { createFlexibleOrdersService, createMercadoPagoService, createOrderDetailsService, createOrderTaxesService, createOrdersService, createPaymentsService, createPurchasesService, createSalesBlock, createSalesCustomersService, createSalesEntitiesService, createSalesUsersService, createStripeService, createSubscriptionModelsService, createSubscriptionsService, createVendorPaymentsService, flexibleOrderMapper, orderDetailMapper, orderMapper, orderTaxMapper, parseBoolean, parseDate, parseNumber, parseOptionalNumber, parseOrderStatus, parsePaymentStatus, parseStatus, parseString, parseStringArray, parseSubscriptionInterval, parseSubscriptionStatus, paymentMapper, purchaseMapper, salesBlockMetadata, salesCustomerMapper, salesEntityMapper, salesUserMapper, subscriptionMapper, subscriptionModelMapper, userSubscriptionMapper };
|
|
1809
|
+
export { createFlexibleOrdersService, createMercadoPagoService, createOrderDetailsService, createOrderTaxesService, createOrdersService, createPaymentsService, createPurchasesService, createSalesBlock, createSalesCustomersService, createSalesEntitiesService, createSalesUsersService, createStripeService, createSubscriptionModelsService, createSubscriptionsService, createVendorPaymentsService, customerSubscriptionMapper, entitySubscriptionMapper, flexibleOrderMapper, orderDetailMapper, orderDetailVendorMapper, orderMapper, orderTaxMapper, parseBoolean, parseDate, parseNumber, parseOptionalNumber, parseOrderStatus, parsePaymentStatus, parseStatus, parseString, parseStringArray, parseSubscriptionInterval, parseSubscriptionStatus, paymentMapper, purchaseMapper, salesBlockMetadata, salesCustomerMapper, salesEntityMapper, salesUserMapper, subscriptionMapper, subscriptionModelMapper, userSubscriptionMapper, vendorPaymentMapper };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ResourceMapper } from '@23blocks/jsonapi-codec';
|
|
2
|
+
import type { CustomerSubscription } from '../types/customer.js';
|
|
3
|
+
export declare const customerSubscriptionMapper: ResourceMapper<CustomerSubscription>;
|
|
4
|
+
//# sourceMappingURL=customer-subscription.mapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customer-subscription.mapper.d.ts","sourceRoot":"","sources":["../../../../src/lib/mappers/customer-subscription.mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAGjE,eAAO,MAAM,0BAA0B,EAAE,cAAc,CAAC,oBAAoB,CAgB3E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-subscription.mapper.d.ts","sourceRoot":"","sources":["../../../../src/lib/mappers/entity-subscription.mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAG7D,eAAO,MAAM,wBAAwB,EAAE,cAAc,CAAC,kBAAkB,CAgBvE,CAAC"}
|
|
@@ -10,5 +10,9 @@ export * from './customer.mapper.js';
|
|
|
10
10
|
export * from './flexible-order.mapper.js';
|
|
11
11
|
export * from './purchase.mapper.js';
|
|
12
12
|
export * from './user-subscription.mapper.js';
|
|
13
|
+
export * from './customer-subscription.mapper.js';
|
|
14
|
+
export * from './entity-subscription.mapper.js';
|
|
15
|
+
export * from './vendor-payment.mapper.js';
|
|
16
|
+
export * from './order-detail-vendor.mapper.js';
|
|
13
17
|
export * from './utils.js';
|
|
14
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/mappers/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/mappers/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mCAAmC,CAAC;AAClD,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ResourceMapper } from '@23blocks/jsonapi-codec';
|
|
2
|
+
import type { OrderDetailVendor } from '../types/vendor-payment.js';
|
|
3
|
+
export declare const orderDetailVendorMapper: ResourceMapper<OrderDetailVendor>;
|
|
4
|
+
//# sourceMappingURL=order-detail-vendor.mapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"order-detail-vendor.mapper.d.ts","sourceRoot":"","sources":["../../../../src/lib/mappers/order-detail-vendor.mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAGpE,eAAO,MAAM,uBAAuB,EAAE,cAAc,CAAC,iBAAiB,CAgBrE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vendor-payment.mapper.d.ts","sourceRoot":"","sources":["../../../../src/lib/mappers/vendor-payment.mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAGhE,eAAO,MAAM,mBAAmB,EAAE,cAAc,CAAC,aAAa,CAkB7D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customers.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/customers.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EACV,aAAa,EACb,4BAA4B,EAC5B,oBAAoB,EACpB,iCAAiC,EACjC,iCAAiC,EAClC,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"customers.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/customers.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EACV,aAAa,EACb,4BAA4B,EAC5B,oBAAoB,EACpB,iCAAiC,EACjC,iCAAiC,EAClC,MAAM,sBAAsB,CAAC;AAI9B,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAE9C;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,4BAA4B,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAExF;;;OAGG;IACH,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAE/F;;;OAGG;IACH,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,iCAAiC,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAE7G;;;OAGG;IACH,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,IAAI,EAAE,iCAAiC,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAC5I;AAED,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,qBAAqB,CAiDnH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entities.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/entities.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EACV,WAAW,EACX,0BAA0B,EAC1B,wBAAwB,EACxB,uBAAuB,EACvB,kBAAkB,EAClB,+BAA+B,EAC/B,+BAA+B,EAChC,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"entities.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/entities.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EACV,WAAW,EACX,0BAA0B,EAC1B,wBAAwB,EACxB,uBAAuB,EACvB,kBAAkB,EAClB,+BAA+B,EAC/B,+BAA+B,EAChC,MAAM,oBAAoB,CAAC;AAI5B,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,IAAI,CAAC,MAAM,CAAC,EAAE,uBAAuB,GAAG,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC;IAEzE;;;OAGG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAE5C;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,0BAA0B,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAEpF;;;OAGG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,wBAAwB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAE/E;;;OAGG;IACH,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,+BAA+B,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAEzG;;;OAGG;IACH,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,IAAI,EAAE,+BAA+B,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CACxI;AAED,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,oBAAoB,CAoEjH"}
|
|
@@ -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,
|
|
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,iBAAiB,EACjB,8BAA8B,EAC9B,8BAA8B,EAC9B,sCAAsC,EACvC,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,0BAA0B,EAC1B,uBAAuB,EACvB,yBAAyB,EACzB,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAI5B,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,GAAG,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAErD;;;OAGG;IACH,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,IAAI,EAAE,0BAA0B,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAExI;;;OAGG;IACH,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;IAEjK;;;OAGG;IACH,GAAG,CAAC,aAAa,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAE5H;;OAEG;IACH,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtH;;;OAGG;IACH,cAAc,CAAC,aAAa,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,EAAE,IAAI,EAAE,8BAA8B,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAErI;;;OAGG;IACH,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,sCAAsC,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAEnH;;;OAGG;IACH,cAAc,CAAC,aAAa,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,IAAI,EAAE,8BAA8B,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAE/J;;;OAGG;IACH,UAAU,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAEhF;;;OAGG;IACH,aAAa,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;IAEtF;;;OAGG;IACH,kBAAkB,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAE9E;;;OAGG;IACH,qBAAqB,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACrF;AAED,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,qBAAqB,CAuMnH"}
|
package/package.json
CHANGED