@01.software/sdk 0.42.0 → 0.43.0
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 +38 -0
- package/README.md +10 -4
- package/dist/client.cjs +99 -57
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +9 -6
- package/dist/client.d.ts +9 -6
- package/dist/client.js +99 -57
- package/dist/client.js.map +1 -1
- package/dist/{collection-client-B-qVIBnJ.d.cts → collection-client-U70KizLf.d.cts} +3 -3
- package/dist/{collection-client-BhCMwIus.d.ts → collection-client-gWsA7BVP.d.ts} +3 -3
- package/dist/{const-pmHlwm3E.d.ts → const-BBynifk0.d.cts} +5 -5
- package/dist/{const-BiDujixF.d.cts → const-_WWHU-gX.d.ts} +5 -5
- package/dist/{index-B1UBDaKz.d.ts → index-DPi5NWU8.d.ts} +4 -4
- package/dist/{index-D78ki6Ij.d.cts → index-Dg4Y6Aq7.d.cts} +4 -4
- package/dist/index.cjs +111 -61
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +41 -8
- package/dist/index.d.ts +41 -8
- package/dist/index.js +111 -61
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-C7Ul4ElL.d.cts → payload-types-DLxkB7Mv.d.cts} +399 -27
- package/dist/{payload-types-C7Ul4ElL.d.ts → payload-types-DLxkB7Mv.d.ts} +399 -27
- package/dist/query.cjs +59 -7
- package/dist/query.cjs.map +1 -1
- package/dist/query.d.cts +5 -5
- package/dist/query.d.ts +5 -5
- package/dist/query.js +59 -7
- package/dist/query.js.map +1 -1
- package/dist/realtime.d.cts +2 -2
- package/dist/realtime.d.ts +2 -2
- package/dist/server.cjs +130 -57
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +12 -7
- package/dist/server.d.ts +12 -7
- package/dist/server.js +130 -57
- package/dist/server.js.map +1 -1
- package/dist/{types-ChV1t4ei.d.cts → types-B1ngKbWI.d.cts} +1 -1
- package/dist/{types-BL7M-EUV.d.cts → types-B9lGhZlB.d.ts} +95 -6
- package/dist/{types-Bf2iCjy8.d.ts → types-BiKNBwRA.d.ts} +1 -1
- package/dist/{types-D5dSNIGs.d.ts → types-Bpx5sYKo.d.cts} +95 -6
- package/dist/ui/form.d.cts +1 -1
- package/dist/ui/form.d.ts +1 -1
- package/dist/ui/video.d.cts +1 -1
- package/dist/ui/video.d.ts +1 -1
- package/dist/webhook.cjs +3 -1
- package/dist/webhook.cjs.map +1 -1
- package/dist/webhook.d.cts +4 -4
- package/dist/webhook.d.ts +4 -4
- package/dist/webhook.js +3 -1
- package/dist/webhook.js.map +1 -1
- package/package.json +1 -1
package/dist/query.cjs
CHANGED
|
@@ -599,16 +599,66 @@ var CustomerHooks = class {
|
|
|
599
599
|
// src/core/query/query-hooks.ts
|
|
600
600
|
var import_react_query4 = require("@tanstack/react-query");
|
|
601
601
|
|
|
602
|
+
// src/core/api/endpoints.ts
|
|
603
|
+
var COMMERCE_ENDPOINTS = {
|
|
604
|
+
orders: {
|
|
605
|
+
create: "/api/orders/create",
|
|
606
|
+
update: "/api/orders/update",
|
|
607
|
+
confirmPayment: "/api/orders/confirm-payment",
|
|
608
|
+
byPayment: "/api/orders/by-payment",
|
|
609
|
+
cancel: "/api/orders/cancel",
|
|
610
|
+
resolveCancelRefund: "/api/orders/resolve-cancel-refund",
|
|
611
|
+
checkout: "/api/orders/checkout",
|
|
612
|
+
createFulfillment: "/api/orders/create-fulfillment",
|
|
613
|
+
updateFulfillment: "/api/orders/update-fulfillment"
|
|
614
|
+
},
|
|
615
|
+
transactions: {
|
|
616
|
+
update: "/api/transactions/update"
|
|
617
|
+
},
|
|
618
|
+
returns: {
|
|
619
|
+
create: "/api/returns/create",
|
|
620
|
+
update: "/api/returns/update",
|
|
621
|
+
returnRefund: "/api/returns/return-refund"
|
|
622
|
+
},
|
|
623
|
+
fulfillmentOrders: {
|
|
624
|
+
prepare: "/api/fulfillment-orders/prepare-fulfillment-order"
|
|
625
|
+
},
|
|
626
|
+
fulfillments: {
|
|
627
|
+
bulkImport: "/api/fulfillments/bulk-import"
|
|
628
|
+
},
|
|
629
|
+
carts: {
|
|
630
|
+
mine: "/api/carts/mine",
|
|
631
|
+
merge: "/api/carts/merge",
|
|
632
|
+
addItem: "/api/carts/add-item",
|
|
633
|
+
updateItem: "/api/carts/update-item",
|
|
634
|
+
removeItem: "/api/carts/remove-item",
|
|
635
|
+
applyDiscount: "/api/carts/apply-discount",
|
|
636
|
+
removeDiscount: "/api/carts/remove-discount",
|
|
637
|
+
clear: "/api/carts/clear"
|
|
638
|
+
},
|
|
639
|
+
products: {
|
|
640
|
+
stockCheck: "/api/products/stock-check",
|
|
641
|
+
stockSnapshot: "/api/products/stock",
|
|
642
|
+
listingGroups: "/api/products/listing-groups",
|
|
643
|
+
listingGroupsCatalog: "/api/products/listing-groups/catalog",
|
|
644
|
+
listingGroupsQuery: "/api/products/listing-groups/query",
|
|
645
|
+
listingGroupsQueryCatalog: "/api/products/listing-groups/query/catalog",
|
|
646
|
+
detail: "/api/products/detail",
|
|
647
|
+
detailCatalog: "/api/products/detail/catalog",
|
|
648
|
+
upsert: "/api/products/upsert"
|
|
649
|
+
}
|
|
650
|
+
};
|
|
651
|
+
var COMMERCE_ENDPOINT_PATHS = Object.values(
|
|
652
|
+
COMMERCE_ENDPOINTS
|
|
653
|
+
).flatMap((group) => Object.values(group));
|
|
654
|
+
|
|
602
655
|
// src/core/internal/utils/query-string.ts
|
|
603
656
|
function appendListingGroupsQuerySearchParams(search, options) {
|
|
604
657
|
if (options?.page != null) search.set("page", String(options.page));
|
|
605
658
|
if (options?.limit != null) search.set("limit", String(options.limit));
|
|
606
659
|
if (options?.sort != null) {
|
|
607
660
|
const sort = options.sort;
|
|
608
|
-
search.set(
|
|
609
|
-
"sort",
|
|
610
|
-
Array.isArray(sort) ? sort.join(",") : sort
|
|
611
|
-
);
|
|
661
|
+
search.set("sort", Array.isArray(sort) ? sort.join(",") : sort);
|
|
612
662
|
}
|
|
613
663
|
if (options?.where != null) {
|
|
614
664
|
search.set("whereJson", JSON.stringify(options.where));
|
|
@@ -618,11 +668,11 @@ function listingGroupsQueryCatalogUrl(options) {
|
|
|
618
668
|
const search = new URLSearchParams();
|
|
619
669
|
appendListingGroupsQuerySearchParams(search, options);
|
|
620
670
|
const query = search.toString();
|
|
621
|
-
return
|
|
671
|
+
return `${COMMERCE_ENDPOINTS.products.listingGroupsQueryCatalog}${query ? `?${query}` : ""}`;
|
|
622
672
|
}
|
|
623
673
|
|
|
624
674
|
// src/core/query/query-hooks.ts
|
|
625
|
-
var LISTING_GROUPS_QUERY_PATH =
|
|
675
|
+
var LISTING_GROUPS_QUERY_PATH = COMMERCE_ENDPOINTS.products.listingGroupsQuery;
|
|
626
676
|
function fetchProductListingGroupsQuery(collectionClient, queryOptions) {
|
|
627
677
|
return collectionClient.requestFindEndpoint(
|
|
628
678
|
LISTING_GROUPS_QUERY_PATH,
|
|
@@ -637,7 +687,9 @@ function fetchProductListingGroupsCatalogQuery(collectionClient, queryOptions) {
|
|
|
637
687
|
function productListingPageQueryOptions(commerceClient, params = {}) {
|
|
638
688
|
return {
|
|
639
689
|
queryKey: productKeys.listingPage(params),
|
|
640
|
-
queryFn: () => commerceClient.product.listingPage(
|
|
690
|
+
queryFn: () => commerceClient.product.listingPage(
|
|
691
|
+
params
|
|
692
|
+
)
|
|
641
693
|
};
|
|
642
694
|
}
|
|
643
695
|
function productListingPageInfiniteQueryOptions(commerceClient, params = {}) {
|