@commercengine/pos 0.3.9 → 0.3.11
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/{admin-types.d.ts → admin-types.d.mts} +47 -18
- package/dist/{index.d.ts → index.d.mts} +77 -64
- package/dist/{index.js → index.mjs} +11 -21
- package/dist/index.mjs.map +1 -0
- package/package.json +17 -17
- package/dist/index.js.map +0 -1
- /package/dist/{admin-types.js → admin-types.mjs} +0 -0
|
@@ -407,6 +407,12 @@ interface components {
|
|
|
407
407
|
/** @enum {unknown} */
|
|
408
408
|
card_type?: "Visa" | "Master Card" | "Rupay";
|
|
409
409
|
};
|
|
410
|
+
/** CollectInStoreFulfillment */
|
|
411
|
+
CollectInStoreFulfillment: {
|
|
412
|
+
/** @constant */
|
|
413
|
+
fulfillment_type: "collect-in-store";
|
|
414
|
+
pickup_location_id: string;
|
|
415
|
+
};
|
|
410
416
|
/** Customer */
|
|
411
417
|
Customer: components["schemas"]["CustomerInfo"] & {
|
|
412
418
|
business?: components["schemas"]["BusinessInfo"];
|
|
@@ -517,6 +523,27 @@ interface components {
|
|
|
517
523
|
id?: string;
|
|
518
524
|
name?: string;
|
|
519
525
|
};
|
|
526
|
+
/** DeliveryFulfillment */
|
|
527
|
+
DeliveryFulfillment: {
|
|
528
|
+
/** @constant */
|
|
529
|
+
fulfillment_type: "delivery";
|
|
530
|
+
shipping_provider_id?: string | null;
|
|
531
|
+
shipping_provider_name?: string | null;
|
|
532
|
+
courier_company_id?: string | null;
|
|
533
|
+
courier_company_name?: string | null;
|
|
534
|
+
};
|
|
535
|
+
/** FulfillmentItem */
|
|
536
|
+
FulfillmentItem: {
|
|
537
|
+
product_id: string;
|
|
538
|
+
readonly product_name: string;
|
|
539
|
+
variant_id: string | null;
|
|
540
|
+
readonly variant_name: string | null;
|
|
541
|
+
quantity: number;
|
|
542
|
+
};
|
|
543
|
+
/** FulfillmentPreference */
|
|
544
|
+
FulfillmentPreference: components["schemas"]["CollectInStoreFulfillment"] | components["schemas"]["DeliveryFulfillment"] | components["schemas"]["PartialCollectAndDelivery"];
|
|
545
|
+
/** @enum {unknown} */
|
|
546
|
+
FulfillmentType: "collect-in-store" | "delivery" | "partial-collect-and-delivery";
|
|
520
547
|
/** InventoryActivity */
|
|
521
548
|
InventoryActivity: {
|
|
522
549
|
product_id?: string;
|
|
@@ -816,9 +843,8 @@ interface components {
|
|
|
816
843
|
/** Format: double */
|
|
817
844
|
coupon_discount_amount?: number | null;
|
|
818
845
|
on_subscription?: boolean;
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
fulfillment_preferences?: components["schemas"]["PartialCollectAndDelivery"] | null;
|
|
846
|
+
fulfillment_type?: components["schemas"]["FulfillmentType"];
|
|
847
|
+
fulfillment_preference?: components["schemas"]["FulfillmentPreference"];
|
|
822
848
|
sales_channel?: {
|
|
823
849
|
id?: string;
|
|
824
850
|
name?: string;
|
|
@@ -1050,21 +1076,19 @@ interface components {
|
|
|
1050
1076
|
};
|
|
1051
1077
|
/** PartialCollectAndDelivery */
|
|
1052
1078
|
PartialCollectAndDelivery: {
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
}[];
|
|
1079
|
+
/** @constant */
|
|
1080
|
+
fulfillment_type: "partial-collect-and-delivery";
|
|
1081
|
+
"collect-in-store": {
|
|
1082
|
+
pickup_location_id?: string;
|
|
1083
|
+
items?: components["schemas"]["FulfillmentItem"][];
|
|
1084
|
+
};
|
|
1060
1085
|
delivery: {
|
|
1061
|
-
|
|
1062
|
-
readonly
|
|
1063
|
-
|
|
1064
|
-
readonly
|
|
1065
|
-
|
|
1066
|
-
}
|
|
1067
|
-
shipping_address: components["schemas"]["CustomerAddress"];
|
|
1086
|
+
shipping_provider_id: string | null;
|
|
1087
|
+
readonly shipping_provider_name: string | null;
|
|
1088
|
+
courier_company_id?: string | null;
|
|
1089
|
+
readonly courier_company_name?: string | null;
|
|
1090
|
+
items: components["schemas"]["FulfillmentItem"][];
|
|
1091
|
+
};
|
|
1068
1092
|
};
|
|
1069
1093
|
/** Shipment */
|
|
1070
1094
|
Shipment: components["schemas"]["ShipmentInfo"] & {
|
|
@@ -1880,12 +1904,17 @@ type AppliedPromotion = components["schemas"]["AppliedPromotion"];
|
|
|
1880
1904
|
type BankTransfer = components["schemas"]["BankTransfer"];
|
|
1881
1905
|
type BusinessInfo = components["schemas"]["BusinessInfo"];
|
|
1882
1906
|
type CardPayment = components["schemas"]["CardPayment"];
|
|
1907
|
+
type CollectInStoreFulfillment = components["schemas"]["CollectInStoreFulfillment"];
|
|
1883
1908
|
type Customer = components["schemas"]["Customer"];
|
|
1884
1909
|
type CustomerAddress = components["schemas"]["CustomerAddress"];
|
|
1885
1910
|
type CustomerDetail = components["schemas"]["CustomerDetail"];
|
|
1886
1911
|
type CustomerInfo = components["schemas"]["CustomerInfo"];
|
|
1887
1912
|
type CustomerLoyalty = components["schemas"]["CustomerLoyalty"];
|
|
1888
1913
|
type CustomerSegment = components["schemas"]["CustomerSegment"];
|
|
1914
|
+
type DeliveryFulfillment = components["schemas"]["DeliveryFulfillment"];
|
|
1915
|
+
type FulfillmentItem = components["schemas"]["FulfillmentItem"];
|
|
1916
|
+
type FulfillmentPreference = components["schemas"]["FulfillmentPreference"];
|
|
1917
|
+
type FulfillmentType = components["schemas"]["FulfillmentType"];
|
|
1889
1918
|
type InventoryActivity = components["schemas"]["InventoryActivity"];
|
|
1890
1919
|
type InventoryDetail = components["schemas"]["InventoryDetail"];
|
|
1891
1920
|
type Invoice = components["schemas"]["Invoice"];
|
|
@@ -1978,4 +2007,4 @@ type PosUpdateShipmentContent = PosUpdateShipmentResponse["content"];
|
|
|
1978
2007
|
type PosUpdateShipmentPathParams = paths["/pos/shipping/shipments/{reference_number}/manual-update"]["put"]["parameters"]["path"];
|
|
1979
2008
|
type PosUpdateShipmentBody = NonNullable<paths["/pos/shipping/shipments/{reference_number}/manual-update"]["put"]["requestBody"]>["content"]["application/json"];
|
|
1980
2009
|
//#endregion
|
|
1981
|
-
export { AppliedCoupon, AppliedPromotion, BankTransfer, BusinessInfo, CardPayment, Customer, CustomerAddress, CustomerDetail, CustomerInfo, CustomerLoyalty, CustomerSegment, InventoryActivity, InventoryDetail, Invoice, InvoiceDetail, InvoiceItem, ItemWiseInventory, LotBatchWiseInventory, LoyaltyPointPayment, NetbankingPayment, NotificationChannelPreferences, NotificationPreferences, OpeningHours, Order, OrderActivity, OrderDetail, OrderItem, OrderList, OrderPayment, OrderPaymentInfo, OrderReceiptJsonFormat, OrderShipment, Pagination, PartialCollectAndDelivery, PosCheckOrderInventoryContent, PosCheckOrderInventoryPathParams, PosCheckOrderInventoryResponse, PosGetCustomerDetailContent, PosGetCustomerDetailPathParams, PosGetCustomerDetailResponse, PosGetOrderDetailContent, PosGetOrderDetailPathParams, PosGetOrderDetailResponse, PosGetOrderInvoiceContent, PosGetOrderInvoicePathParams, PosGetOrderInvoiceQuery, PosGetOrderInvoiceResponse, PosGetOrderReceiptContent, PosGetOrderReceiptPathParams, PosGetOrderReceiptQuery, PosGetOrderReceiptResponse, PosGetShipmentDetailContent, PosGetShipmentDetailPathParams, PosGetShipmentDetailResponse, PosGetShipmentInvoiceContent, PosGetShipmentInvoicePathParams, PosGetShipmentInvoiceQuery, PosGetShipmentInvoiceResponse, PosListCustomersContent, PosListCustomersQuery, PosListCustomersResponse, PosListInventoryActivityContent, PosListInventoryActivityQuery, PosListInventoryActivityResponse, PosListInventoryContent, PosListInventoryDetailContent, PosListInventoryDetailQuery, PosListInventoryDetailResponse, PosListInventoryQuery, PosListInventoryResponse, PosListOrderActivityContent, PosListOrderActivityPathParams, PosListOrderActivityResponse, PosListOrderShipmentsContent, PosListOrderShipmentsPathParams, PosListOrderShipmentsResponse, PosListOrdersContent, PosListOrdersQuery, PosListOrdersResponse, PosListShipmentsContent, PosListShipmentsQuery, PosListShipmentsResponse, PosRefundShortfallBody, PosRefundShortfallPathParams, PosRefundShortfallResponse, PosUpdateShipmentBody, PosUpdateShipmentContent, PosUpdateShipmentPathParams, PosUpdateShipmentResponse, Shipment, ShipmentBox, ShipmentDetail, ShipmentInfo, ShipmentItem, ShipmentList, ShipmentPackaging, ShipmentProgression, UpiPayment, WalletPayment, Warehouse, WarehouseBasicDetail, WarehouseWiseInventory, type components, type operations, type paths };
|
|
2010
|
+
export { AppliedCoupon, AppliedPromotion, BankTransfer, BusinessInfo, CardPayment, CollectInStoreFulfillment, Customer, CustomerAddress, CustomerDetail, CustomerInfo, CustomerLoyalty, CustomerSegment, DeliveryFulfillment, FulfillmentItem, FulfillmentPreference, FulfillmentType, InventoryActivity, InventoryDetail, Invoice, InvoiceDetail, InvoiceItem, ItemWiseInventory, LotBatchWiseInventory, LoyaltyPointPayment, NetbankingPayment, NotificationChannelPreferences, NotificationPreferences, OpeningHours, Order, OrderActivity, OrderDetail, OrderItem, OrderList, OrderPayment, OrderPaymentInfo, OrderReceiptJsonFormat, OrderShipment, Pagination, PartialCollectAndDelivery, PosCheckOrderInventoryContent, PosCheckOrderInventoryPathParams, PosCheckOrderInventoryResponse, PosGetCustomerDetailContent, PosGetCustomerDetailPathParams, PosGetCustomerDetailResponse, PosGetOrderDetailContent, PosGetOrderDetailPathParams, PosGetOrderDetailResponse, PosGetOrderInvoiceContent, PosGetOrderInvoicePathParams, PosGetOrderInvoiceQuery, PosGetOrderInvoiceResponse, PosGetOrderReceiptContent, PosGetOrderReceiptPathParams, PosGetOrderReceiptQuery, PosGetOrderReceiptResponse, PosGetShipmentDetailContent, PosGetShipmentDetailPathParams, PosGetShipmentDetailResponse, PosGetShipmentInvoiceContent, PosGetShipmentInvoicePathParams, PosGetShipmentInvoiceQuery, PosGetShipmentInvoiceResponse, PosListCustomersContent, PosListCustomersQuery, PosListCustomersResponse, PosListInventoryActivityContent, PosListInventoryActivityQuery, PosListInventoryActivityResponse, PosListInventoryContent, PosListInventoryDetailContent, PosListInventoryDetailQuery, PosListInventoryDetailResponse, PosListInventoryQuery, PosListInventoryResponse, PosListOrderActivityContent, PosListOrderActivityPathParams, PosListOrderActivityResponse, PosListOrderShipmentsContent, PosListOrderShipmentsPathParams, PosListOrderShipmentsResponse, PosListOrdersContent, PosListOrdersQuery, PosListOrdersResponse, PosListShipmentsContent, PosListShipmentsQuery, PosListShipmentsResponse, PosRefundShortfallBody, PosRefundShortfallPathParams, PosRefundShortfallResponse, PosUpdateShipmentBody, PosUpdateShipmentContent, PosUpdateShipmentPathParams, PosUpdateShipmentResponse, Shipment, ShipmentBox, ShipmentDetail, ShipmentInfo, ShipmentItem, ShipmentList, ShipmentPackaging, ShipmentProgression, UpiPayment, WalletPayment, Warehouse, WarehouseBasicDetail, WarehouseWiseInventory, type components, type operations, type paths };
|
|
@@ -1144,10 +1144,7 @@ interface components {
|
|
|
1144
1144
|
shipping_tax_amount: number | null;
|
|
1145
1145
|
/** @description Shipping amount including shipping tax. */
|
|
1146
1146
|
shipping_amount_including_tax: number | null;
|
|
1147
|
-
|
|
1148
|
-
shipping_provider_name: string | null;
|
|
1149
|
-
courier_company_id: string | null;
|
|
1150
|
-
courier_company_name: string | null;
|
|
1147
|
+
fulfillment_preference?: components["schemas"]["FulfillmentPreference"];
|
|
1151
1148
|
estimated_delivery_days: number | null;
|
|
1152
1149
|
/**
|
|
1153
1150
|
* Format: double
|
|
@@ -1504,6 +1501,10 @@ interface components {
|
|
|
1504
1501
|
DeliveryFulfillment: {
|
|
1505
1502
|
/** @constant */
|
|
1506
1503
|
fulfillment_type: "delivery";
|
|
1504
|
+
shipping_provider_id?: string | null;
|
|
1505
|
+
shipping_provider_name?: string | null;
|
|
1506
|
+
courier_company_id?: string | null;
|
|
1507
|
+
courier_company_name?: string | null;
|
|
1507
1508
|
};
|
|
1508
1509
|
/** DiscountBasedPromotion */
|
|
1509
1510
|
DiscountBasedPromotion: {
|
|
@@ -1608,6 +1609,16 @@ interface components {
|
|
|
1608
1609
|
FreeGoodsRule: components["schemas"]["AutoScaleBasedOnQuantity"] | components["schemas"]["AutoScaleBasedOnAmount"] | components["schemas"]["CustomSlabsBasedOnQuantity"] | components["schemas"]["CustomSlabsBasedOnAmount"];
|
|
1609
1610
|
/** FreeShipingCouponPromotion */
|
|
1610
1611
|
FreeShipingCouponPromotion: components["schemas"]["CouponPromotionCommonDetail"];
|
|
1612
|
+
/** FulfillmentItem */
|
|
1613
|
+
FulfillmentItem: {
|
|
1614
|
+
product_id: string;
|
|
1615
|
+
readonly product_name: string;
|
|
1616
|
+
variant_id: string | null;
|
|
1617
|
+
readonly variant_name: string | null;
|
|
1618
|
+
quantity: number;
|
|
1619
|
+
};
|
|
1620
|
+
/** FulfillmentPreference */
|
|
1621
|
+
FulfillmentPreference: components["schemas"]["CollectInStoreFulfillment"] | components["schemas"]["DeliveryFulfillment"] | components["schemas"]["PartialCollectAndDelivery"];
|
|
1611
1622
|
InapplicableCoupon: {
|
|
1612
1623
|
id?: string;
|
|
1613
1624
|
name?: string;
|
|
@@ -1782,10 +1793,7 @@ interface components {
|
|
|
1782
1793
|
shipping_tax_amount?: number;
|
|
1783
1794
|
/** Format: double */
|
|
1784
1795
|
shipping_amount_including_tax?: number;
|
|
1785
|
-
|
|
1786
|
-
shipping_provider_name?: string | null;
|
|
1787
|
-
courier_company_id?: string | null;
|
|
1788
|
-
courier_company_name?: string | null;
|
|
1796
|
+
fulfillment_preference?: components["schemas"]["FulfillmentPreference"];
|
|
1789
1797
|
estimated_delivery_days?: number | null;
|
|
1790
1798
|
/** Format: double */
|
|
1791
1799
|
handling_charge_excluding_tax?: number;
|
|
@@ -1970,22 +1978,16 @@ interface components {
|
|
|
1970
1978
|
PartialCollectAndDelivery: {
|
|
1971
1979
|
/** @constant */
|
|
1972
1980
|
fulfillment_type: "partial-collect-and-delivery";
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
readonly product_name: string;
|
|
1984
|
-
variant_id: string | null;
|
|
1985
|
-
readonly variant_name: string | null;
|
|
1986
|
-
quantity: number;
|
|
1987
|
-
}[];
|
|
1988
|
-
shipping_address: components["schemas"]["CustomerAddress"];
|
|
1981
|
+
"collect-in-store": {
|
|
1982
|
+
pickup_location_id?: string;
|
|
1983
|
+
items?: components["schemas"]["FulfillmentItem"][];
|
|
1984
|
+
};
|
|
1985
|
+
delivery: {
|
|
1986
|
+
shipping_provider_id: string | null;
|
|
1987
|
+
readonly shipping_provider_name: string | null;
|
|
1988
|
+
courier_company_id?: string | null;
|
|
1989
|
+
readonly courier_company_name?: string | null;
|
|
1990
|
+
items: components["schemas"]["FulfillmentItem"][];
|
|
1989
1991
|
};
|
|
1990
1992
|
};
|
|
1991
1993
|
/** @enum {string} */
|
|
@@ -3489,6 +3491,9 @@ interface operations {
|
|
|
3489
3491
|
"application/json": {
|
|
3490
3492
|
message: string;
|
|
3491
3493
|
success: boolean;
|
|
3494
|
+
content: {
|
|
3495
|
+
cart?: components["schemas"]["Cart"];
|
|
3496
|
+
};
|
|
3492
3497
|
};
|
|
3493
3498
|
};
|
|
3494
3499
|
};
|
|
@@ -5090,6 +5095,12 @@ interface components$1 {
|
|
|
5090
5095
|
/** @enum {unknown} */
|
|
5091
5096
|
card_type?: "Visa" | "Master Card" | "Rupay";
|
|
5092
5097
|
};
|
|
5098
|
+
/** CollectInStoreFulfillment */
|
|
5099
|
+
CollectInStoreFulfillment: {
|
|
5100
|
+
/** @constant */
|
|
5101
|
+
fulfillment_type: "collect-in-store";
|
|
5102
|
+
pickup_location_id: string;
|
|
5103
|
+
};
|
|
5093
5104
|
/** Customer */
|
|
5094
5105
|
Customer: components$1["schemas"]["CustomerInfo"] & {
|
|
5095
5106
|
business?: components$1["schemas"]["BusinessInfo"];
|
|
@@ -5200,6 +5211,27 @@ interface components$1 {
|
|
|
5200
5211
|
id?: string;
|
|
5201
5212
|
name?: string;
|
|
5202
5213
|
};
|
|
5214
|
+
/** DeliveryFulfillment */
|
|
5215
|
+
DeliveryFulfillment: {
|
|
5216
|
+
/** @constant */
|
|
5217
|
+
fulfillment_type: "delivery";
|
|
5218
|
+
shipping_provider_id?: string | null;
|
|
5219
|
+
shipping_provider_name?: string | null;
|
|
5220
|
+
courier_company_id?: string | null;
|
|
5221
|
+
courier_company_name?: string | null;
|
|
5222
|
+
};
|
|
5223
|
+
/** FulfillmentItem */
|
|
5224
|
+
FulfillmentItem: {
|
|
5225
|
+
product_id: string;
|
|
5226
|
+
readonly product_name: string;
|
|
5227
|
+
variant_id: string | null;
|
|
5228
|
+
readonly variant_name: string | null;
|
|
5229
|
+
quantity: number;
|
|
5230
|
+
};
|
|
5231
|
+
/** FulfillmentPreference */
|
|
5232
|
+
FulfillmentPreference: components$1["schemas"]["CollectInStoreFulfillment"] | components$1["schemas"]["DeliveryFulfillment"] | components$1["schemas"]["PartialCollectAndDelivery"];
|
|
5233
|
+
/** @enum {unknown} */
|
|
5234
|
+
FulfillmentType: "collect-in-store" | "delivery" | "partial-collect-and-delivery";
|
|
5203
5235
|
/** InventoryActivity */
|
|
5204
5236
|
InventoryActivity: {
|
|
5205
5237
|
product_id?: string;
|
|
@@ -5499,9 +5531,8 @@ interface components$1 {
|
|
|
5499
5531
|
/** Format: double */
|
|
5500
5532
|
coupon_discount_amount?: number | null;
|
|
5501
5533
|
on_subscription?: boolean;
|
|
5502
|
-
|
|
5503
|
-
|
|
5504
|
-
fulfillment_preferences?: components$1["schemas"]["PartialCollectAndDelivery"] | null;
|
|
5534
|
+
fulfillment_type?: components$1["schemas"]["FulfillmentType"];
|
|
5535
|
+
fulfillment_preference?: components$1["schemas"]["FulfillmentPreference"];
|
|
5505
5536
|
sales_channel?: {
|
|
5506
5537
|
id?: string;
|
|
5507
5538
|
name?: string;
|
|
@@ -5733,21 +5764,19 @@ interface components$1 {
|
|
|
5733
5764
|
};
|
|
5734
5765
|
/** PartialCollectAndDelivery */
|
|
5735
5766
|
PartialCollectAndDelivery: {
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
|
|
5741
|
-
|
|
5742
|
-
}[];
|
|
5767
|
+
/** @constant */
|
|
5768
|
+
fulfillment_type: "partial-collect-and-delivery";
|
|
5769
|
+
"collect-in-store": {
|
|
5770
|
+
pickup_location_id?: string;
|
|
5771
|
+
items?: components$1["schemas"]["FulfillmentItem"][];
|
|
5772
|
+
};
|
|
5743
5773
|
delivery: {
|
|
5744
|
-
|
|
5745
|
-
readonly
|
|
5746
|
-
|
|
5747
|
-
readonly
|
|
5748
|
-
|
|
5749
|
-
}
|
|
5750
|
-
shipping_address: components$1["schemas"]["CustomerAddress"];
|
|
5774
|
+
shipping_provider_id: string | null;
|
|
5775
|
+
readonly shipping_provider_name: string | null;
|
|
5776
|
+
courier_company_id?: string | null;
|
|
5777
|
+
readonly courier_company_name?: string | null;
|
|
5778
|
+
items: components$1["schemas"]["FulfillmentItem"][];
|
|
5779
|
+
};
|
|
5751
5780
|
};
|
|
5752
5781
|
/** Shipment */
|
|
5753
5782
|
Shipment: components$1["schemas"]["ShipmentInfo"] & {
|
|
@@ -6557,7 +6586,7 @@ interface operations$1 {
|
|
|
6557
6586
|
};
|
|
6558
6587
|
}
|
|
6559
6588
|
//#endregion
|
|
6560
|
-
//#region ../sdk-core/dist/index.d.
|
|
6589
|
+
//#region ../sdk-core/dist/index.d.mts
|
|
6561
6590
|
//#region src/types/api.d.ts
|
|
6562
6591
|
|
|
6563
6592
|
/**
|
|
@@ -6711,13 +6740,6 @@ declare class BaseAPIClient<TPaths extends Record<string, any>, THeaders extends
|
|
|
6711
6740
|
* @returns Current default headers
|
|
6712
6741
|
*/
|
|
6713
6742
|
getDefaultHeaders(): THeaders | undefined;
|
|
6714
|
-
/**
|
|
6715
|
-
* Add middleware to the client
|
|
6716
|
-
* This allows SDK extensions to add custom middleware like authentication
|
|
6717
|
-
*
|
|
6718
|
-
* @param middleware - Middleware to add to the client
|
|
6719
|
-
*/
|
|
6720
|
-
use(middleware: any): void;
|
|
6721
6743
|
}
|
|
6722
6744
|
//#endregion
|
|
6723
6745
|
//#region src/utils/url.d.ts
|
|
@@ -6981,9 +7003,6 @@ declare enum Environment {
|
|
|
6981
7003
|
Staging = "staging",
|
|
6982
7004
|
Production = "production",
|
|
6983
7005
|
}
|
|
6984
|
-
/**
|
|
6985
|
-
* Configuration for building POS API URLs
|
|
6986
|
-
*/
|
|
6987
7006
|
//#endregion
|
|
6988
7007
|
//#region src/types/pos-api-types.d.ts
|
|
6989
7008
|
type AcceleratedRewardCouponPromotion = components["schemas"]["AcceleratedRewardCouponPromotion"];
|
|
@@ -7033,6 +7052,8 @@ type FreeGoodCouponPromotion = components["schemas"]["FreeGoodCouponPromotion"];
|
|
|
7033
7052
|
type FreeGoodsPromotion = components["schemas"]["FreeGoodsPromotion"];
|
|
7034
7053
|
type FreeGoodsRule = components["schemas"]["FreeGoodsRule"];
|
|
7035
7054
|
type FreeShipingCouponPromotion = components["schemas"]["FreeShipingCouponPromotion"];
|
|
7055
|
+
type FulfillmentItem = components["schemas"]["FulfillmentItem"];
|
|
7056
|
+
type FulfillmentPreference = components["schemas"]["FulfillmentPreference"];
|
|
7036
7057
|
type InapplicableCoupon = components["schemas"]["InapplicableCoupon"];
|
|
7037
7058
|
type InapplicablePromotion = components["schemas"]["InapplicablePromotion"];
|
|
7038
7059
|
type Item = components["schemas"]["Item"];
|
|
@@ -7159,6 +7180,7 @@ type PosEvaluatePromotionsResponse = paths["/pos/carts/{id}/evaluate-promotions"
|
|
|
7159
7180
|
type PosEvaluatePromotionsContent = PosEvaluatePromotionsResponse["content"];
|
|
7160
7181
|
type PosEvaluatePromotionsPathParams = paths["/pos/carts/{id}/evaluate-promotions"]["get"]["parameters"]["path"];
|
|
7161
7182
|
type PosUpdateFulfillmentPreferenceResponse = paths["/pos/carts/{id}/fulfillment-preference"]["post"]["responses"][200]["content"]["application/json"];
|
|
7183
|
+
type PosUpdateFulfillmentPreferenceContent = PosUpdateFulfillmentPreferenceResponse["content"];
|
|
7162
7184
|
type PosUpdateFulfillmentPreferencePathParams = paths["/pos/carts/{id}/fulfillment-preference"]["post"]["parameters"]["path"];
|
|
7163
7185
|
type PosUpdateFulfillmentPreferenceBody = NonNullable<paths["/pos/carts/{id}/fulfillment-preference"]["post"]["requestBody"]>["content"]["application/json"];
|
|
7164
7186
|
type PosUpdateCartResponse = paths["/pos/carts/{id}/items"]["post"]["responses"][200]["content"]["application/json"];
|
|
@@ -7976,7 +7998,7 @@ declare class PosClient extends PosAPIClient {
|
|
|
7976
7998
|
* }
|
|
7977
7999
|
* ```
|
|
7978
8000
|
*/
|
|
7979
|
-
updateFulfillmentPreference(pathParams: PosUpdateFulfillmentPreferencePathParams, body: PosUpdateFulfillmentPreferenceBody): Promise<ApiResult<
|
|
8001
|
+
updateFulfillmentPreference(pathParams: PosUpdateFulfillmentPreferencePathParams, body: PosUpdateFulfillmentPreferenceBody): Promise<ApiResult<PosUpdateFulfillmentPreferenceContent>>;
|
|
7980
8002
|
/**
|
|
7981
8003
|
* Get fulfillment options for cart
|
|
7982
8004
|
* @param body - Cart data for fulfillment calculation
|
|
@@ -9032,9 +9054,6 @@ declare class BrowserTokenStorage implements TokenStorage {
|
|
|
9032
9054
|
setRefreshToken(token: string): Promise<void>;
|
|
9033
9055
|
clearTokens(): Promise<void>;
|
|
9034
9056
|
}
|
|
9035
|
-
/**
|
|
9036
|
-
* Configuration for the POS auth middleware
|
|
9037
|
-
*/
|
|
9038
9057
|
//#endregion
|
|
9039
9058
|
//#region src/lib/utils/jwt.d.ts
|
|
9040
9059
|
/**
|
|
@@ -9069,12 +9088,6 @@ interface UserInfo {
|
|
|
9069
9088
|
tokenExpiry: Date;
|
|
9070
9089
|
tokenIssuedAt: Date;
|
|
9071
9090
|
}
|
|
9072
|
-
/**
|
|
9073
|
-
* Decode and extract user information from a JWT token
|
|
9074
|
-
*
|
|
9075
|
-
* @param token - The JWT token to decode
|
|
9076
|
-
* @returns User information or null if token is invalid
|
|
9077
|
-
*/
|
|
9078
9091
|
//#endregion
|
|
9079
9092
|
//#region src/index.d.ts
|
|
9080
9093
|
/**
|
|
@@ -9245,5 +9258,5 @@ declare class PosSDK {
|
|
|
9245
9258
|
getTenantId(): Promise<string | null>;
|
|
9246
9259
|
}
|
|
9247
9260
|
//#endregion
|
|
9248
|
-
export { AcceleratedRewardCouponPromotion, AcceleratedRewardRule, AdditionalProductDetails, ApiErrorResponse, ApiResult, ApplicableCoupon, ApplicablePromotion, AppliedCoupon, AppliedPromotion, AssociatedOption, AutoScaleBasedOnAmount, AutoScaleBasedOnQuantity, BankTransfer, BaseAPIClient, BaseSDKOptions, BooleanAttribute, BrowserTokenStorage, BuyXGetYCouponPromotion, BuyXGetYRule, BuyXGetYRuleBasedOnAmount, BuyXGetYRuleBasedOnQuantity, CardPayment, Cart, CartBasedServiceabilityCheck, CartItem, Category, ClaimPosDeviceContent, ClaimPosDevicePathParams, ClaimPosDeviceResponse, CollectInStore, CollectInStoreFulfillment, ColorAttribute, ColorOption, Coupon, CouponPromotionCommonDetail, CouponType, CreatePosOrderBody, CreatePosOrderContent, CreatePosOrderResponse, Currency, CustomSlabsBasedOnAmount, CustomSlabsBasedOnQuantity, CustomerAddress, DateAttribute, DebugLogger, DebugLoggerFn, DeliveryFulfillment, DiscountBasedPromotion, DiscountCouponPromotion, DiscountRule, Environment, FixedAmountDiscountRule, FixedPriceCouponPromotion, FixedPricePromotion, FixedPriceRule, FixedPriceRuleBasedAmount, FixedPriceRuleBasedQuantity, FreeGoodCouponPromotion, FreeGoodsPromotion, FreeGoodsRule, FreeShipingCouponPromotion, GetPosFulfillmentOptionsBody, GetPosFulfillmentOptionsContent, GetPosFulfillmentOptionsResponse, GetPosUserContent, GetPosUserPathParams, GetPosUserResponse, HeaderConfig, InapplicableCoupon, InapplicablePromotion, Item, JuspayPaymentGatewayParams, ListPosDevicesContent, ListPosDevicesResponse, ListPosLocationsContent, ListPosLocationsResponse, LoginPosDeviceWithEmailBody, LoginPosDeviceWithEmailContent, LoginPosDeviceWithEmailHeaderParams, LoginPosDeviceWithEmailResponse, LoginPosDeviceWithPhoneBody, LoginPosDeviceWithPhoneContent, LoginPosDeviceWithPhoneHeaderParams, LoginPosDeviceWithPhoneResponse, LoginPosDeviceWithWhatsappBody, LoginPosDeviceWithWhatsappContent, LoginPosDeviceWithWhatsappHeaderParams, LoginPosDeviceWithWhatsappResponse, LogoutFromPosDeviceResponse, LotBatchDetail, MemoryTokenStorage, MultiSelectAttribute, NetbankingPayment, NumberAttribute, Order, OrderDetail, OrderItem, OrderPayment, OrderRefund, OrderShipment, Pagination, PairPosDeviceBody, PairPosDeviceContent, PairPosDeviceResponse, PartialCollectAndDelivery, PayWithCard, PayWithCash, PayWithPaymentGateway, PayWithUpi, PaymentGateway, PaymentGatewayParams, PaymentInfo, PayuPaymentGatewayParams, PercentageDiscountRule, PincodeServiceability, PosAPIClient, PosApplyCouponBody, PosApplyCouponContent, PosApplyCouponPathParams, PosApplyCouponResponse, PosClient, PosCreateCartAddressBody, PosCreateCartAddressContent, PosCreateCartAddressPathParams, PosCreateCartAddressResponse, PosCreateCartBody, PosCreateCartContent, PosCreateCartResponse, PosDeleteCartPathParams, PosDeleteCartResponse, PosDevice, PosDeviceClaimedUser, PosEvaluateCouponsContent, PosEvaluateCouponsPathParams, PosEvaluateCouponsResponse, PosEvaluatePromotionsContent, PosEvaluatePromotionsPathParams, PosEvaluatePromotionsResponse, PosGetCartContent, PosGetCartPathParams, PosGetCartResponse, PosGetPaymentStatusContent, PosGetPaymentStatusPathParams, PosGetPaymentStatusResponse, PosGetProductDetailContent, PosGetProductDetailHeaderParams, PosGetProductDetailPathParams, PosGetProductDetailQuery, PosGetProductDetailResponse, PosGetUserCartContent, PosGetUserCartPathParams, PosGetUserCartResponse, PosGetVariantDetailContent, PosGetVariantDetailHeaderParams, PosGetVariantDetailPathParams, PosGetVariantDetailQuery, PosGetVariantDetailResponse, PosListCategoriesContent, PosListCategoriesQuery, PosListCategoriesResponse, PosListCouponsContent, PosListCouponsHeaderParams, PosListCouponsResponse, PosListCrosssellProductsContent, PosListCrosssellProductsHeaderParams, PosListCrosssellProductsQuery, PosListCrosssellProductsResponse, PosListPaymentOptionsContent, PosListPaymentOptionsResponse, PosListProductReviewsContent, PosListProductReviewsPathParams, PosListProductReviewsQuery, PosListProductReviewsResponse, PosListProductVariantsContent, PosListProductVariantsHeaderParams, PosListProductVariantsPathParams, PosListProductVariantsQuery, PosListProductVariantsResponse, PosListProductsContent, PosListProductsHeaderParams, PosListProductsQuery, PosListProductsResponse, PosListPromotionsContent, PosListPromotionsHeaderParams, PosListPromotionsResponse, PosListSimilarProductsContent, PosListSimilarProductsHeaderParams, PosListSimilarProductsQuery, PosListSimilarProductsResponse, PosListSkusContent, PosListSkusHeaderParams, PosListSkusQuery, PosListSkusResponse, PosListUpsellProductsContent, PosListUpsellProductsHeaderParams, PosListUpsellProductsQuery, PosListUpsellProductsResponse, PosLocation, PosRedeemCreditBalanceBody, PosRedeemCreditBalanceContent, PosRedeemCreditBalancePathParams, PosRedeemCreditBalanceResponse, PosRedeemLoyaltyPointsBody, PosRedeemLoyaltyPointsContent, PosRedeemLoyaltyPointsPathParams, PosRedeemLoyaltyPointsResponse, PosRemoveCouponContent, PosRemoveCouponPathParams, PosRemoveCouponResponse, PosRemoveCreditBalanceContent, PosRemoveCreditBalancePathParams, PosRemoveCreditBalanceResponse, PosRemoveLoyaltyPointsContent, PosRemoveLoyaltyPointsPathParams, PosRemoveLoyaltyPointsResponse, PosSDK, PosSDK as default, PosSDKOptions, PosSearchProductsBody, PosSearchProductsContent, PosSearchProductsHeaderParams, PosSearchProductsResponse, PosUpdateCartBody, PosUpdateCartContent, PosUpdateCartPathParams, PosUpdateCartResponse, PosUpdateCustomerWithEmail, PosUpdateCustomerWithId, PosUpdateCustomerWithPhone, PosUpdateFulfillmentPreferenceBody, PosUpdateFulfillmentPreferencePathParams, PosUpdateFulfillmentPreferenceResponse, PosUser, Product, ProductAttribute, ProductBundleItem, ProductCategory, ProductDetail, ProductImage, ProductPricing, ProductPromotion, ProductReview, ProductShipping, ProductSubscription, ProductVideo, Promotion, PromotionType, RefreshPosAccessTokenBody, RefreshPosAccessTokenContent, RefreshPosAccessTokenResponse, ResponseUtils, SearchProduct, Seo, ShipmentItem, SingleSelectAttribute, SingleSelectOption, SupportedDefaultHeaders, TextAttribute, type TokenStorage, UnclaimPosDeviceContent, UnclaimPosDevicePathParams, UnclaimPosDeviceResponse, UpdateCartItem, UpdatePosCartCustomerBody, UpdatePosCartCustomerContent, UpdatePosCartCustomerPathParams, UpdatePosCartCustomerResponse, UpiPayment, type UserInfo, Variant, VariantDetail, VariantOption, VerifyPosLoginOtpBody, VerifyPosLoginOtpContent, VerifyPosLoginOtpResponse, VolumeBasedCouponPromotion, VolumeBasedPromotion, VolumeBasedRule, WalletPayment, type components, createDebugMiddleware, createTimeoutMiddleware, executeRequest, extractRequestBody, getPathnameFromUrl, mergeAndTransformHeaders, mergeHeaders, type operations, type paths, transformHeaders };
|
|
9249
|
-
//# sourceMappingURL=index.d.
|
|
9261
|
+
export { AcceleratedRewardCouponPromotion, AcceleratedRewardRule, AdditionalProductDetails, ApiErrorResponse, ApiResult, ApplicableCoupon, ApplicablePromotion, AppliedCoupon, AppliedPromotion, AssociatedOption, AutoScaleBasedOnAmount, AutoScaleBasedOnQuantity, BankTransfer, BaseAPIClient, BaseSDKOptions, BooleanAttribute, BrowserTokenStorage, BuyXGetYCouponPromotion, BuyXGetYRule, BuyXGetYRuleBasedOnAmount, BuyXGetYRuleBasedOnQuantity, CardPayment, Cart, CartBasedServiceabilityCheck, CartItem, Category, ClaimPosDeviceContent, ClaimPosDevicePathParams, ClaimPosDeviceResponse, CollectInStore, CollectInStoreFulfillment, ColorAttribute, ColorOption, Coupon, CouponPromotionCommonDetail, CouponType, CreatePosOrderBody, CreatePosOrderContent, CreatePosOrderResponse, Currency, CustomSlabsBasedOnAmount, CustomSlabsBasedOnQuantity, CustomerAddress, DateAttribute, DebugLogger, DebugLoggerFn, DeliveryFulfillment, DiscountBasedPromotion, DiscountCouponPromotion, DiscountRule, Environment, FixedAmountDiscountRule, FixedPriceCouponPromotion, FixedPricePromotion, FixedPriceRule, FixedPriceRuleBasedAmount, FixedPriceRuleBasedQuantity, FreeGoodCouponPromotion, FreeGoodsPromotion, FreeGoodsRule, FreeShipingCouponPromotion, FulfillmentItem, FulfillmentPreference, GetPosFulfillmentOptionsBody, GetPosFulfillmentOptionsContent, GetPosFulfillmentOptionsResponse, GetPosUserContent, GetPosUserPathParams, GetPosUserResponse, HeaderConfig, InapplicableCoupon, InapplicablePromotion, Item, JuspayPaymentGatewayParams, ListPosDevicesContent, ListPosDevicesResponse, ListPosLocationsContent, ListPosLocationsResponse, LoginPosDeviceWithEmailBody, LoginPosDeviceWithEmailContent, LoginPosDeviceWithEmailHeaderParams, LoginPosDeviceWithEmailResponse, LoginPosDeviceWithPhoneBody, LoginPosDeviceWithPhoneContent, LoginPosDeviceWithPhoneHeaderParams, LoginPosDeviceWithPhoneResponse, LoginPosDeviceWithWhatsappBody, LoginPosDeviceWithWhatsappContent, LoginPosDeviceWithWhatsappHeaderParams, LoginPosDeviceWithWhatsappResponse, LogoutFromPosDeviceResponse, LotBatchDetail, MemoryTokenStorage, MultiSelectAttribute, NetbankingPayment, NumberAttribute, Order, OrderDetail, OrderItem, OrderPayment, OrderRefund, OrderShipment, Pagination, PairPosDeviceBody, PairPosDeviceContent, PairPosDeviceResponse, PartialCollectAndDelivery, PayWithCard, PayWithCash, PayWithPaymentGateway, PayWithUpi, PaymentGateway, PaymentGatewayParams, PaymentInfo, PayuPaymentGatewayParams, PercentageDiscountRule, PincodeServiceability, PosAPIClient, PosApplyCouponBody, PosApplyCouponContent, PosApplyCouponPathParams, PosApplyCouponResponse, PosClient, PosCreateCartAddressBody, PosCreateCartAddressContent, PosCreateCartAddressPathParams, PosCreateCartAddressResponse, PosCreateCartBody, PosCreateCartContent, PosCreateCartResponse, PosDeleteCartPathParams, PosDeleteCartResponse, PosDevice, PosDeviceClaimedUser, PosEvaluateCouponsContent, PosEvaluateCouponsPathParams, PosEvaluateCouponsResponse, PosEvaluatePromotionsContent, PosEvaluatePromotionsPathParams, PosEvaluatePromotionsResponse, PosGetCartContent, PosGetCartPathParams, PosGetCartResponse, PosGetPaymentStatusContent, PosGetPaymentStatusPathParams, PosGetPaymentStatusResponse, PosGetProductDetailContent, PosGetProductDetailHeaderParams, PosGetProductDetailPathParams, PosGetProductDetailQuery, PosGetProductDetailResponse, PosGetUserCartContent, PosGetUserCartPathParams, PosGetUserCartResponse, PosGetVariantDetailContent, PosGetVariantDetailHeaderParams, PosGetVariantDetailPathParams, PosGetVariantDetailQuery, PosGetVariantDetailResponse, PosListCategoriesContent, PosListCategoriesQuery, PosListCategoriesResponse, PosListCouponsContent, PosListCouponsHeaderParams, PosListCouponsResponse, PosListCrosssellProductsContent, PosListCrosssellProductsHeaderParams, PosListCrosssellProductsQuery, PosListCrosssellProductsResponse, PosListPaymentOptionsContent, PosListPaymentOptionsResponse, PosListProductReviewsContent, PosListProductReviewsPathParams, PosListProductReviewsQuery, PosListProductReviewsResponse, PosListProductVariantsContent, PosListProductVariantsHeaderParams, PosListProductVariantsPathParams, PosListProductVariantsQuery, PosListProductVariantsResponse, PosListProductsContent, PosListProductsHeaderParams, PosListProductsQuery, PosListProductsResponse, PosListPromotionsContent, PosListPromotionsHeaderParams, PosListPromotionsResponse, PosListSimilarProductsContent, PosListSimilarProductsHeaderParams, PosListSimilarProductsQuery, PosListSimilarProductsResponse, PosListSkusContent, PosListSkusHeaderParams, PosListSkusQuery, PosListSkusResponse, PosListUpsellProductsContent, PosListUpsellProductsHeaderParams, PosListUpsellProductsQuery, PosListUpsellProductsResponse, PosLocation, PosRedeemCreditBalanceBody, PosRedeemCreditBalanceContent, PosRedeemCreditBalancePathParams, PosRedeemCreditBalanceResponse, PosRedeemLoyaltyPointsBody, PosRedeemLoyaltyPointsContent, PosRedeemLoyaltyPointsPathParams, PosRedeemLoyaltyPointsResponse, PosRemoveCouponContent, PosRemoveCouponPathParams, PosRemoveCouponResponse, PosRemoveCreditBalanceContent, PosRemoveCreditBalancePathParams, PosRemoveCreditBalanceResponse, PosRemoveLoyaltyPointsContent, PosRemoveLoyaltyPointsPathParams, PosRemoveLoyaltyPointsResponse, PosSDK, PosSDK as default, PosSDKOptions, PosSearchProductsBody, PosSearchProductsContent, PosSearchProductsHeaderParams, PosSearchProductsResponse, PosUpdateCartBody, PosUpdateCartContent, PosUpdateCartPathParams, PosUpdateCartResponse, PosUpdateCustomerWithEmail, PosUpdateCustomerWithId, PosUpdateCustomerWithPhone, PosUpdateFulfillmentPreferenceBody, PosUpdateFulfillmentPreferenceContent, PosUpdateFulfillmentPreferencePathParams, PosUpdateFulfillmentPreferenceResponse, PosUser, Product, ProductAttribute, ProductBundleItem, ProductCategory, ProductDetail, ProductImage, ProductPricing, ProductPromotion, ProductReview, ProductShipping, ProductSubscription, ProductVideo, Promotion, PromotionType, RefreshPosAccessTokenBody, RefreshPosAccessTokenContent, RefreshPosAccessTokenResponse, ResponseUtils, SearchProduct, Seo, ShipmentItem, SingleSelectAttribute, SingleSelectOption, SupportedDefaultHeaders, TextAttribute, type TokenStorage, UnclaimPosDeviceContent, UnclaimPosDevicePathParams, UnclaimPosDeviceResponse, UpdateCartItem, UpdatePosCartCustomerBody, UpdatePosCartCustomerContent, UpdatePosCartCustomerPathParams, UpdatePosCartCustomerResponse, UpiPayment, type UserInfo, Variant, VariantDetail, VariantOption, VerifyPosLoginOtpBody, VerifyPosLoginOtpContent, VerifyPosLoginOtpResponse, VolumeBasedCouponPromotion, VolumeBasedPromotion, VolumeBasedRule, WalletPayment, type components, createDebugMiddleware, createTimeoutMiddleware, executeRequest, extractRequestBody, getPathnameFromUrl, mergeAndTransformHeaders, mergeHeaders, type operations, type paths, transformHeaders };
|
|
9262
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import createClient from "openapi-fetch";
|
|
2
2
|
import { decodeJwt } from "jose";
|
|
3
3
|
|
|
4
|
-
//#region ../sdk-core/dist/index.
|
|
4
|
+
//#region ../sdk-core/dist/index.mjs
|
|
5
5
|
/**
|
|
6
6
|
* Response utilities for debugging and working with Response objects
|
|
7
7
|
*/
|
|
@@ -308,6 +308,10 @@ async function executeRequest(apiCall) {
|
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
310
|
/**
|
|
311
|
+
* Base API client for Commerce Engine SDKs
|
|
312
|
+
* Provides common functionality without token management
|
|
313
|
+
*/
|
|
314
|
+
/**
|
|
311
315
|
* Generic base API client that all Commerce Engine SDKs can extend
|
|
312
316
|
* Handles common functionality like middleware setup, request execution, and header management
|
|
313
317
|
* Does NOT include token management - that's SDK-specific
|
|
@@ -392,15 +396,6 @@ var BaseAPIClient = class {
|
|
|
392
396
|
getDefaultHeaders() {
|
|
393
397
|
return this.config.defaultHeaders;
|
|
394
398
|
}
|
|
395
|
-
/**
|
|
396
|
-
* Add middleware to the client
|
|
397
|
-
* This allows SDK extensions to add custom middleware like authentication
|
|
398
|
-
*
|
|
399
|
-
* @param middleware - Middleware to add to the client
|
|
400
|
-
*/
|
|
401
|
-
use(middleware) {
|
|
402
|
-
this.client.use(middleware);
|
|
403
|
-
}
|
|
404
399
|
};
|
|
405
400
|
/**
|
|
406
401
|
* Generic URL utility functions for any SDK
|
|
@@ -473,9 +468,7 @@ function isTokenExpired(token, bufferSeconds = 30) {
|
|
|
473
468
|
try {
|
|
474
469
|
const payload = decodeJwt(token);
|
|
475
470
|
if (!payload.exp) return true;
|
|
476
|
-
|
|
477
|
-
const expiryTime = payload.exp;
|
|
478
|
-
return currentTime >= expiryTime - bufferSeconds;
|
|
471
|
+
return Math.floor(Date.now() / 1e3) >= payload.exp - bufferSeconds;
|
|
479
472
|
} catch (error) {
|
|
480
473
|
console.warn("Failed to decode JWT token:", error);
|
|
481
474
|
return true;
|
|
@@ -779,9 +772,8 @@ function createPosAuthMiddleware(config) {
|
|
|
779
772
|
* Helper function to create POS auth middleware with sensible defaults
|
|
780
773
|
*/
|
|
781
774
|
function createDefaultPosAuthMiddleware(options) {
|
|
782
|
-
const tokenStorage = options.tokenStorage || (typeof localStorage !== "undefined" ? new BrowserTokenStorage() : new MemoryTokenStorage());
|
|
783
775
|
return createPosAuthMiddleware({
|
|
784
|
-
tokenStorage,
|
|
776
|
+
tokenStorage: options.tokenStorage || (typeof localStorage !== "undefined" ? new BrowserTokenStorage() : new MemoryTokenStorage()),
|
|
785
777
|
apiKey: options.apiKey,
|
|
786
778
|
baseUrl: options.baseUrl,
|
|
787
779
|
onTokensUpdated: options.onTokensUpdated,
|
|
@@ -898,8 +890,7 @@ var PosAPIClient = class PosAPIClient extends BaseAPIClient {
|
|
|
898
890
|
config.refreshToken = void 0;
|
|
899
891
|
}
|
|
900
892
|
} else this.client.use({ onRequest: async ({ request }) => {
|
|
901
|
-
|
|
902
|
-
if (isApiKeyEndpoint(pathname)) {
|
|
893
|
+
if (isApiKeyEndpoint(getPathnameFromUrl(request.url))) {
|
|
903
894
|
request.headers.set("X-Api-Key", config.apiKey);
|
|
904
895
|
return request;
|
|
905
896
|
}
|
|
@@ -2916,7 +2907,7 @@ var PosSDK = class {
|
|
|
2916
2907
|
* @param options - Configuration options for the SDK
|
|
2917
2908
|
*/
|
|
2918
2909
|
constructor(options) {
|
|
2919
|
-
|
|
2910
|
+
this.pos = new PosClient({
|
|
2920
2911
|
storeId: options.storeId,
|
|
2921
2912
|
environment: options.environment,
|
|
2922
2913
|
baseUrl: options.baseUrl,
|
|
@@ -2930,8 +2921,7 @@ var PosSDK = class {
|
|
|
2930
2921
|
defaultHeaders: options.defaultHeaders,
|
|
2931
2922
|
debug: options.debug,
|
|
2932
2923
|
logger: options.logger
|
|
2933
|
-
};
|
|
2934
|
-
this.pos = new PosClient(config);
|
|
2924
|
+
});
|
|
2935
2925
|
}
|
|
2936
2926
|
/**
|
|
2937
2927
|
* Set authentication tokens for the client
|
|
@@ -3062,4 +3052,4 @@ var src_default = PosSDK;
|
|
|
3062
3052
|
|
|
3063
3053
|
//#endregion
|
|
3064
3054
|
export { BrowserTokenStorage, Environment, MemoryTokenStorage, PosAPIClient, PosClient, PosSDK, ResponseUtils, src_default as default };
|
|
3065
|
-
//# sourceMappingURL=index.
|
|
3055
|
+
//# sourceMappingURL=index.mjs.map
|