@ecomiq/core 0.1.9 → 1.1.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/LICENSE +21 -0
- package/README.md +39 -2
- package/dist/_virtual/_rolldown/runtime-C6LprzCP.cjs +22 -0
- package/dist/api.cjs +117 -102
- package/dist/api.d.cts +33 -37
- package/dist/api.d.ts +33 -37
- package/dist/api.js +116 -100
- package/dist/client.cjs +499 -1676
- package/dist/client.d.cts +156 -15
- package/dist/client.d.ts +156 -15
- package/dist/client.js +500 -1675
- package/dist/index.cjs +344 -2092
- package/dist/index.d.cts +54 -1127
- package/dist/index.d.ts +54 -1127
- package/dist/index.js +53 -1895
- package/dist/libs/bounded-read-cache-Abmb5VnJ.js +41 -0
- package/dist/libs/bounded-read-cache-D4644LJo.cjs +41 -0
- package/dist/libs/catalog-link-key-B7l5KZsF.js +9 -0
- package/dist/libs/catalog-link-key-CZTHJBGD.cjs +9 -0
- package/dist/libs/catalog-link-key.d.cts +2 -0
- package/dist/libs/catalog-link-key.d.ts +2 -0
- package/dist/libs/graphql-_6Y8lR_Q.js +49 -0
- package/dist/libs/graphql-selection-Cj51WkJn.cjs +21 -0
- package/dist/libs/graphql-selection-H1RMh6VD.js +21 -0
- package/dist/libs/graphql-selection.d.cts +3 -0
- package/dist/libs/graphql-selection.d.ts +3 -0
- package/dist/libs/graphql-wJH7HaQU.cjs +50 -0
- package/dist/libs/graphql.d.cts +24 -0
- package/dist/libs/graphql.d.ts +24 -0
- package/dist/models/amounts-cKBCecl7.js +5 -0
- package/dist/models/amounts-lmg89eJQ.cjs +4 -0
- package/dist/models/articles-C-4JvT2Z.js +27 -0
- package/dist/models/articles-xHCXLKDK.cjs +30 -0
- package/dist/models/articles.d.cts +46 -0
- package/dist/models/articles.d.ts +46 -0
- package/dist/models/catalog-links-BzJeyBy4.js +80 -0
- package/dist/models/catalog-links-c4LADGf_.cjs +88 -0
- package/dist/models/catalog-links.d.cts +39 -0
- package/dist/models/catalog-links.d.ts +39 -0
- package/dist/models/categories-CKkJY8_P.js +42 -0
- package/dist/models/categories-DZ5i5kwi.cjs +45 -0
- package/dist/models/categories.d.cts +54 -0
- package/dist/models/categories.d.ts +54 -0
- package/dist/models/collections.cjs +13 -22
- package/dist/models/collections.d.cts +23 -56
- package/dist/models/collections.d.ts +23 -56
- package/dist/models/collections.js +12 -20
- package/dist/models/complaint-book-D5INpuI2.cjs +64 -0
- package/dist/models/complaint-book-QpQZe7Xl.js +58 -0
- package/dist/models/complaint-book.d.cts +71 -0
- package/dist/models/complaint-book.d.ts +71 -0
- package/dist/models/customer-address.cjs +39 -38
- package/dist/models/customer-address.d.cts +59 -158
- package/dist/models/customer-address.d.ts +59 -158
- package/dist/models/customer-address.js +38 -36
- package/dist/models/customer-order.cjs +183 -142
- package/dist/models/customer-order.d.cts +474 -857
- package/dist/models/customer-order.d.ts +474 -857
- package/dist/models/customer-order.js +180 -141
- package/dist/models/customer-profile.cjs +121 -118
- package/dist/models/customer-profile.d.cts +89 -174
- package/dist/models/customer-profile.d.ts +89 -174
- package/dist/models/customer-profile.js +121 -116
- package/dist/models/customer-registration-C13knqyv.js +28 -0
- package/dist/models/customer-registration-EZ0yZgGr.cjs +31 -0
- package/dist/models/customer-registration.d.cts +66 -0
- package/dist/models/customer-registration.d.ts +66 -0
- package/dist/models/customer-session-BiX0TXhO.js +41 -0
- package/dist/models/customer-session-JeQiC8Yx.cjs +45 -0
- package/dist/models/customer-session.d.cts +61 -0
- package/dist/models/customer-session.d.ts +61 -0
- package/dist/models/geo.cjs +52 -49
- package/dist/models/geo.d.cts +141 -270
- package/dist/models/geo.d.ts +141 -270
- package/dist/models/geo.js +51 -47
- package/dist/models/ids.cjs +8 -11
- package/dist/models/ids.d.cts +7 -10
- package/dist/models/ids.d.ts +7 -10
- package/dist/models/ids.js +7 -9
- package/dist/models/order-draft-C-2WRbjl.cjs +41 -0
- package/dist/models/order-draft-CSIWRIV0.js +39 -0
- package/dist/models/order-draft.d.cts +69 -0
- package/dist/models/order-draft.d.ts +69 -0
- package/dist/models/order-review--xGlZKtS.cjs +18 -0
- package/dist/models/order-review-egGeCaqB.js +17 -0
- package/dist/models/order-review.d.cts +22 -0
- package/dist/models/order-review.d.ts +22 -0
- package/dist/models/order-status-CS_OeSPY.cjs +66 -0
- package/dist/models/order-status-CgaLkU0M.js +60 -0
- package/dist/models/order-status.d.cts +307 -0
- package/dist/models/order-status.d.ts +307 -0
- package/dist/models/payment-methods--VUUZpMz.js +17 -0
- package/dist/models/payment-methods-CmK08zBM.cjs +19 -0
- package/dist/models/payment-methods.d.cts +28 -0
- package/dist/models/payment-methods.d.ts +28 -0
- package/dist/models/personalization-BPFmkdJ0.js +69 -0
- package/dist/models/personalization-CQosKg8O.cjs +77 -0
- package/dist/models/personalization.d.cts +83 -0
- package/dist/models/personalization.d.ts +83 -0
- package/dist/models/products.cjs +218 -194
- package/dist/models/products.d.cts +646 -1353
- package/dist/models/products.d.ts +646 -1353
- package/dist/models/products.js +214 -187
- package/dist/models/search.cjs +13 -23
- package/dist/models/search.d.cts +21 -51
- package/dist/models/search.d.ts +21 -51
- package/dist/models/search.js +12 -21
- package/dist/models/sellers.cjs +44 -0
- package/dist/models/sellers.d.cts +82 -0
- package/dist/models/sellers.d.ts +82 -0
- package/dist/models/sellers.js +38 -0
- package/dist/models/settings.cjs +205 -236
- package/dist/models/settings.d.cts +853 -6940
- package/dist/models/settings.d.ts +853 -6940
- package/dist/models/settings.js +213 -239
- package/dist/models/storefront-cart.cjs +152 -118
- package/dist/models/storefront-cart.d.cts +277 -706
- package/dist/models/storefront-cart.d.ts +277 -706
- package/dist/models/storefront-cart.js +148 -117
- package/dist/models/storefront-checkout.cjs +212 -297
- package/dist/models/storefront-checkout.d.cts +672 -2449
- package/dist/models/storefront-checkout.d.ts +672 -2449
- package/dist/models/storefront-checkout.js +208 -297
- package/dist/models/storefront-reviews.cjs +58 -43
- package/dist/models/storefront-reviews.d.cts +71 -139
- package/dist/models/storefront-reviews.d.ts +71 -139
- package/dist/models/storefront-reviews.js +55 -42
- package/dist/models/tracking-CiIAhQW0.js +33 -0
- package/dist/models/tracking-wNyzQ6Bp.cjs +36 -0
- package/dist/models/tracking.d.cts +26 -0
- package/dist/models/tracking.d.ts +26 -0
- package/dist/models/urls-B0ZODOwH.cjs +35 -0
- package/dist/models/urls-Dt_dTt4Q.js +33 -0
- package/dist/models/urls.d.cts +233 -0
- package/dist/models/urls.d.ts +233 -0
- package/dist/redirects.cjs +113 -0
- package/dist/redirects.d.cts +11 -0
- package/dist/redirects.d.ts +11 -0
- package/dist/redirects.js +108 -0
- package/dist/services/article.service-DBsOvflH.js +10 -0
- package/dist/services/article.service-zmTkbbPV.cjs +11 -0
- package/dist/services/article.service.d.cts +4 -0
- package/dist/services/article.service.d.ts +4 -0
- package/dist/services/cart.service-B0D8s6jI.cjs +37 -0
- package/dist/services/cart.service-yMCz9oQP.js +33 -0
- package/dist/services/cart.service.d.cts +572 -0
- package/dist/services/cart.service.d.ts +572 -0
- package/dist/services/catalog-link.service-BQ2d-EPX.js +8 -0
- package/dist/services/catalog-link.service-DiB-OVjn.cjs +8 -0
- package/dist/services/category.service-8tieYX2r.js +6 -0
- package/dist/services/category.service-BsSJZV2B.cjs +6 -0
- package/dist/services/checkout.service-CC-3tm2y.js +60 -0
- package/dist/services/checkout.service-CG8KrDNY.cjs +69 -0
- package/dist/services/checkout.service.d.cts +475 -0
- package/dist/services/checkout.service.d.ts +475 -0
- package/dist/services/collection.service-C4QETpuI.js +11 -0
- package/dist/services/collection.service-DHGN3rhs.cjs +12 -0
- package/dist/services/complaint-book.service-C7TxltQe.cjs +13 -0
- package/dist/services/complaint-book.service-DXiVyKdD.js +12 -0
- package/dist/services/complaint-book.service.d.cts +4 -0
- package/dist/services/complaint-book.service.d.ts +4 -0
- package/dist/services/customer-address.service-Ca4qla_R.cjs +51 -0
- package/dist/services/customer-address.service-xEThx7cQ.js +47 -0
- package/dist/services/customer-address.service.d.cts +19 -0
- package/dist/services/customer-address.service.d.ts +19 -0
- package/dist/services/customer-order.service-DLGgT0xa.cjs +54 -0
- package/dist/services/customer-order.service-qHoRBuyX.js +51 -0
- package/dist/services/customer-order.service.d.cts +34 -0
- package/dist/services/customer-order.service.d.ts +34 -0
- package/dist/services/customer-registration.service-C3BNyCHP.cjs +10 -0
- package/dist/services/customer-registration.service-CxcWD2hf.js +9 -0
- package/dist/services/customer-registration.service.d.cts +5 -0
- package/dist/services/customer-registration.service.d.ts +5 -0
- package/dist/services/customer-session.service-4YgfbWRB.js +16 -0
- package/dist/services/customer-session.service-Bd8pLC2v.cjs +19 -0
- package/dist/services/customer.service-BM0NrOxP.cjs +26 -0
- package/dist/services/customer.service-BoU6l2-R.js +25 -0
- package/dist/services/customer.service.d.cts +10 -0
- package/dist/services/customer.service.d.ts +10 -0
- package/dist/services/geo.service-C32R7N8W.js +39 -0
- package/dist/services/geo.service-JeTT3Wun.cjs +42 -0
- package/dist/services/geo.service.d.cts +10 -0
- package/dist/services/geo.service.d.ts +10 -0
- package/dist/services/layout.service-BkvLzl1g.cjs +50 -0
- package/dist/services/layout.service-DmbeMOkK.js +50 -0
- package/dist/services/layout.service.d.cts +9 -0
- package/dist/services/layout.service.d.ts +9 -0
- package/dist/services/order-draft.service-B0VcmWhn.js +13 -0
- package/dist/services/order-draft.service-Dlu6eEkV.cjs +14 -0
- package/dist/services/order-draft.service.d.cts +4 -0
- package/dist/services/order-draft.service.d.ts +4 -0
- package/dist/services/order-review.service-BEr-FB6_.cjs +11 -0
- package/dist/services/order-review.service-PdBPUsxE.js +11 -0
- package/dist/services/order-review.service.d.cts +7 -0
- package/dist/services/order-review.service.d.ts +7 -0
- package/dist/services/order-status.service-Cn7dsaJo.cjs +26 -0
- package/dist/services/order-status.service-MC9hVpP-.js +23 -0
- package/dist/services/order-status.service.d.cts +16 -0
- package/dist/services/order-status.service.d.ts +16 -0
- package/dist/services/page.service-CWhWCjMQ.js +7 -0
- package/dist/services/page.service-DmCSeMiR.cjs +7 -0
- package/dist/services/page.service.d.cts +4 -0
- package/dist/services/page.service.d.ts +4 -0
- package/dist/services/payment-method.service-CEt_nB4R.cjs +7 -0
- package/dist/services/payment-method.service-CjKbAsOh.js +7 -0
- package/dist/services/payment-method.service.d.cts +4 -0
- package/dist/services/payment-method.service.d.ts +4 -0
- package/dist/services/product.service-B05Qmbuh.js +35 -0
- package/dist/services/product.service-B7OFZWB1.cjs +37 -0
- package/dist/services/product.service.d.cts +256 -0
- package/dist/services/product.service.d.ts +256 -0
- package/dist/services/review.service-CO2icjpu.cjs +46 -0
- package/dist/services/review.service-De1YkhFp.js +43 -0
- package/dist/services/review.service.d.cts +28 -0
- package/dist/services/review.service.d.ts +28 -0
- package/dist/services/search.service-Bx1zbTHJ.cjs +10 -0
- package/dist/services/search.service-DSBMhaSY.js +10 -0
- package/dist/services/search.service.d.cts +9 -0
- package/dist/services/search.service.d.ts +9 -0
- package/dist/services/seller.service-D11WHhbC.cjs +10 -0
- package/dist/services/seller.service-DUptDTv4.js +9 -0
- package/dist/services/seller.service.d.cts +42 -0
- package/dist/services/seller.service.d.ts +42 -0
- package/dist/services/tracking.service-CPK1B69N.js +11 -0
- package/dist/services/tracking.service-DqOoi8qr.cjs +11 -0
- package/dist/services/tracking.service.d.cts +7 -0
- package/dist/services/tracking.service.d.ts +7 -0
- package/dist/services/url.service-B-nC14Ue.cjs +19 -0
- package/dist/services/url.service-CLW0Tc7S.js +18 -0
- package/dist/storefront-cache-revision.cjs +23 -0
- package/dist/storefront-cache-revision.d.cts +16 -0
- package/dist/storefront-cache-revision.d.ts +16 -0
- package/dist/storefront-cache-revision.js +17 -0
- package/dist/storefront-routes.cjs +14 -0
- package/dist/storefront-routes.d.cts +11 -0
- package/dist/storefront-routes.d.ts +11 -0
- package/dist/storefront-routes.js +12 -0
- package/dist/utils-CDEC5xcY.cjs +139 -0
- package/dist/utils-DK7qa54o.js +136 -0
- package/dist/utils.d.cts +3 -0
- package/dist/utils.d.ts +3 -0
- package/dist/video-links-CbRO0m8V.js +47 -0
- package/dist/video-links-ClryQjPH.cjs +47 -0
- package/dist/video-links.d.cts +7 -0
- package/dist/video-links.d.ts +7 -0
- package/package.json +28 -11
- package/dist/api.cjs.map +0 -1
- package/dist/api.js.map +0 -1
- package/dist/client-Ba1r_uiO.d.ts +0 -195
- package/dist/client-Cqcnv2tC.d.cts +0 -195
- package/dist/client.cjs.map +0 -1
- package/dist/client.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/models/collections.cjs.map +0 -1
- package/dist/models/collections.js.map +0 -1
- package/dist/models/customer-address.cjs.map +0 -1
- package/dist/models/customer-address.js.map +0 -1
- package/dist/models/customer-order.cjs.map +0 -1
- package/dist/models/customer-order.js.map +0 -1
- package/dist/models/customer-profile.cjs.map +0 -1
- package/dist/models/customer-profile.js.map +0 -1
- package/dist/models/geo.cjs.map +0 -1
- package/dist/models/geo.js.map +0 -1
- package/dist/models/ids.cjs.map +0 -1
- package/dist/models/ids.js.map +0 -1
- package/dist/models/products.cjs.map +0 -1
- package/dist/models/products.js.map +0 -1
- package/dist/models/search.cjs.map +0 -1
- package/dist/models/search.js.map +0 -1
- package/dist/models/settings.cjs.map +0 -1
- package/dist/models/settings.js.map +0 -1
- package/dist/models/storefront-cart.cjs.map +0 -1
- package/dist/models/storefront-cart.js.map +0 -1
- package/dist/models/storefront-checkout.cjs.map +0 -1
- package/dist/models/storefront-checkout.js.map +0 -1
- package/dist/models/storefront-reviews.cjs.map +0 -1
- package/dist/models/storefront-reviews.js.map +0 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Api } from "../api.js";
|
|
2
|
+
import { OrderReviewContext } from "../models/order-review.js";
|
|
3
|
+
export type OrderReviewRequestOptions = {
|
|
4
|
+
headers?: Record<string, string>;
|
|
5
|
+
signal?: AbortSignal;
|
|
6
|
+
};
|
|
7
|
+
export declare function getOrderReviewContext(api: Api, reviewToken: string, options?: OrderReviewRequestOptions): Promise<OrderReviewContext>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const require_order_status = require("../models/order-status-CS_OeSPY.cjs");
|
|
2
|
+
// src/services/order-status.service.ts
|
|
3
|
+
function statusPath(token) {
|
|
4
|
+
const value = token.trim();
|
|
5
|
+
if (!value) throw new Error("token requerido");
|
|
6
|
+
return `orders/status/${encodeURIComponent(value)}`;
|
|
7
|
+
}
|
|
8
|
+
async function getOrderStatus(api, token) {
|
|
9
|
+
return api.get(statusPath(token), require_order_status.OrderStatusViewSchema);
|
|
10
|
+
}
|
|
11
|
+
async function startOrderPayment(api, token, input) {
|
|
12
|
+
return api.post(`${statusPath(token)}/payment`, input, require_order_status.OrderPaymentStartSchema);
|
|
13
|
+
}
|
|
14
|
+
async function uploadOrderPaymentReceipt(api, token, input) {
|
|
15
|
+
const form = new FormData();
|
|
16
|
+
form.set("paymentMethodCode", input.paymentMethodCode);
|
|
17
|
+
form.set("file", input.file);
|
|
18
|
+
return api.postForm(`${statusPath(token)}/payment-receipt`, form, require_order_status.OrderPaymentStartSchema);
|
|
19
|
+
}
|
|
20
|
+
async function authenticateOrderPayment(api, token, transactionId, input) {
|
|
21
|
+
return api.post(`${statusPath(token)}/payments/${encodeURIComponent(transactionId)}/authenticate`, require_order_status.AuthenticateOrderPaymentInputSchema.parse(input), require_order_status.OrderPaymentStartSchema);
|
|
22
|
+
}
|
|
23
|
+
exports.authenticateOrderPayment = authenticateOrderPayment;
|
|
24
|
+
exports.getOrderStatus = getOrderStatus;
|
|
25
|
+
exports.startOrderPayment = startOrderPayment;
|
|
26
|
+
exports.uploadOrderPaymentReceipt = uploadOrderPaymentReceipt;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AuthenticateOrderPaymentInputSchema, OrderPaymentStartSchema, OrderStatusViewSchema } from "../models/order-status-CgaLkU0M.js";
|
|
2
|
+
// src/services/order-status.service.ts
|
|
3
|
+
function statusPath(token) {
|
|
4
|
+
const value = token.trim();
|
|
5
|
+
if (!value) throw new Error("token requerido");
|
|
6
|
+
return `orders/status/${encodeURIComponent(value)}`;
|
|
7
|
+
}
|
|
8
|
+
async function getOrderStatus(api, token) {
|
|
9
|
+
return api.get(statusPath(token), OrderStatusViewSchema);
|
|
10
|
+
}
|
|
11
|
+
async function startOrderPayment(api, token, input) {
|
|
12
|
+
return api.post(`${statusPath(token)}/payment`, input, OrderPaymentStartSchema);
|
|
13
|
+
}
|
|
14
|
+
async function uploadOrderPaymentReceipt(api, token, input) {
|
|
15
|
+
const form = new FormData();
|
|
16
|
+
form.set("paymentMethodCode", input.paymentMethodCode);
|
|
17
|
+
form.set("file", input.file);
|
|
18
|
+
return api.postForm(`${statusPath(token)}/payment-receipt`, form, OrderPaymentStartSchema);
|
|
19
|
+
}
|
|
20
|
+
async function authenticateOrderPayment(api, token, transactionId, input) {
|
|
21
|
+
return api.post(`${statusPath(token)}/payments/${encodeURIComponent(transactionId)}/authenticate`, AuthenticateOrderPaymentInputSchema.parse(input), OrderPaymentStartSchema);
|
|
22
|
+
}
|
|
23
|
+
export { authenticateOrderPayment, getOrderStatus, startOrderPayment, uploadOrderPaymentReceipt };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Api } from "../api.cjs";
|
|
2
|
+
import { AuthenticateOrderPaymentInput, OrderPaymentStart, OrderStatusView } from "../models/order-status.cjs";
|
|
3
|
+
export type StartOrderPaymentInput = {
|
|
4
|
+
paymentMethodCode: string;
|
|
5
|
+
token?: string;
|
|
6
|
+
providerPaymentMethodId?: string;
|
|
7
|
+
deviceSessionId?: string;
|
|
8
|
+
};
|
|
9
|
+
export type UploadOrderPaymentReceiptInput = {
|
|
10
|
+
paymentMethodCode: string;
|
|
11
|
+
file: File;
|
|
12
|
+
};
|
|
13
|
+
export declare function getOrderStatus(api: Api, token: string): Promise<OrderStatusView>;
|
|
14
|
+
export declare function startOrderPayment(api: Api, token: string, input: StartOrderPaymentInput): Promise<OrderPaymentStart>;
|
|
15
|
+
export declare function uploadOrderPaymentReceipt(api: Api, token: string, input: UploadOrderPaymentReceiptInput): Promise<OrderPaymentStart>;
|
|
16
|
+
export declare function authenticateOrderPayment(api: Api, token: string, transactionId: string, input: AuthenticateOrderPaymentInput): Promise<OrderPaymentStart>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Api } from "../api.js";
|
|
2
|
+
import { AuthenticateOrderPaymentInput, OrderPaymentStart, OrderStatusView } from "../models/order-status.js";
|
|
3
|
+
export type StartOrderPaymentInput = {
|
|
4
|
+
paymentMethodCode: string;
|
|
5
|
+
token?: string;
|
|
6
|
+
providerPaymentMethodId?: string;
|
|
7
|
+
deviceSessionId?: string;
|
|
8
|
+
};
|
|
9
|
+
export type UploadOrderPaymentReceiptInput = {
|
|
10
|
+
paymentMethodCode: string;
|
|
11
|
+
file: File;
|
|
12
|
+
};
|
|
13
|
+
export declare function getOrderStatus(api: Api, token: string): Promise<OrderStatusView>;
|
|
14
|
+
export declare function startOrderPayment(api: Api, token: string, input: StartOrderPaymentInput): Promise<OrderPaymentStart>;
|
|
15
|
+
export declare function uploadOrderPaymentReceipt(api: Api, token: string, input: UploadOrderPaymentReceiptInput): Promise<OrderPaymentStart>;
|
|
16
|
+
export declare function authenticateOrderPayment(api: Api, token: string, transactionId: string, input: AuthenticateOrderPaymentInput): Promise<OrderPaymentStart>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CmsPageDetailsDtoSchema } from "../models/settings.js";
|
|
2
|
+
// src/services/page.service.ts
|
|
3
|
+
/** GET /v1/pages/{slug} */
|
|
4
|
+
async function getPageBySlug(api, pageSlug) {
|
|
5
|
+
return api.get(`pages/${encodeURIComponent(pageSlug)}`, CmsPageDetailsDtoSchema);
|
|
6
|
+
}
|
|
7
|
+
export { getPageBySlug };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const require_models_settings = require("../models/settings.cjs");
|
|
2
|
+
// src/services/page.service.ts
|
|
3
|
+
/** GET /v1/pages/{slug} */
|
|
4
|
+
async function getPageBySlug(api, pageSlug) {
|
|
5
|
+
return api.get(`pages/${encodeURIComponent(pageSlug)}`, require_models_settings.CmsPageDetailsDtoSchema);
|
|
6
|
+
}
|
|
7
|
+
exports.getPageBySlug = getPageBySlug;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const require_payment_methods = require("../models/payment-methods-CmK08zBM.cjs");
|
|
2
|
+
// src/services/payment-method.service.ts
|
|
3
|
+
/** GET /v1/payments/methods */
|
|
4
|
+
async function getPaymentMethods(api) {
|
|
5
|
+
return api.get("payments/methods", require_payment_methods.StorefrontPaymentMethodsSchema);
|
|
6
|
+
}
|
|
7
|
+
exports.getPaymentMethods = getPaymentMethods;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { StorefrontPaymentMethodsSchema } from "../models/payment-methods--VUUZpMz.js";
|
|
2
|
+
// src/services/payment-method.service.ts
|
|
3
|
+
/** GET /v1/payments/methods */
|
|
4
|
+
async function getPaymentMethods(api) {
|
|
5
|
+
return api.get("payments/methods", StorefrontPaymentMethodsSchema);
|
|
6
|
+
}
|
|
7
|
+
export { getPaymentMethods };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ProductDetailSchema, ProductSummariesSchema, ProductsParamsSchema, ProductsResponseSchema, RelatedProductsParamsSchema } from "../models/products.js";
|
|
2
|
+
// src/services/product.service.ts
|
|
3
|
+
async function getProducts(api, params = {}) {
|
|
4
|
+
const input = ProductsParamsSchema.parse(params);
|
|
5
|
+
const query = new URLSearchParams();
|
|
6
|
+
query.set("page", String(input.page));
|
|
7
|
+
query.set("pageSize", String(input.pageSize));
|
|
8
|
+
if (input.includeFilters !== void 0) query.set("includeFilters", String(input.includeFilters));
|
|
9
|
+
for (const productId of input.productIds ?? []) query.append("productIds", productId);
|
|
10
|
+
for (const slug of input.slugs ?? []) query.append("slugs", slug);
|
|
11
|
+
if (input.sort) query.set("sort", input.sort);
|
|
12
|
+
for (const seller of input.sellers ?? []) query.append("sellers", seller);
|
|
13
|
+
if (input.search) query.set("search", input.search);
|
|
14
|
+
for (const collection of input.collections ?? []) query.append("collections", collection);
|
|
15
|
+
if (input.collectionId) query.set("collectionId", input.collectionId);
|
|
16
|
+
if (input.categoryId) query.set("categoryId", input.categoryId);
|
|
17
|
+
for (const category of input.categories ?? []) query.append("categories", category);
|
|
18
|
+
for (const brand of input.brands ?? []) query.append("brands", brand);
|
|
19
|
+
for (const productType of input.productTypes ?? []) query.append("productTypes", productType);
|
|
20
|
+
for (const tag of input.tags ?? []) query.append("tags", tag);
|
|
21
|
+
for (const filter of input.filters ?? []) query.append("filters", filter);
|
|
22
|
+
if (input.inStock !== void 0) query.set("inStock", String(input.inStock));
|
|
23
|
+
if (input.minPrice !== void 0) query.set("minPrice", String(input.minPrice));
|
|
24
|
+
if (input.maxPrice !== void 0) query.set("maxPrice", String(input.maxPrice));
|
|
25
|
+
return api.get(`products?${query.toString()}`, ProductsResponseSchema);
|
|
26
|
+
}
|
|
27
|
+
async function getProductBySlug(api, slug, options = {}) {
|
|
28
|
+
const path = `products/${encodeURIComponent(slug)}`;
|
|
29
|
+
return api.get(path, ProductDetailSchema, { query: { previewKey: options.previewKey } });
|
|
30
|
+
}
|
|
31
|
+
async function getRelatedProducts(api, params) {
|
|
32
|
+
const input = RelatedProductsParamsSchema.parse(params);
|
|
33
|
+
return api.get(`products/${encodeURIComponent(input.productId)}/related`, ProductSummariesSchema, { query: { limit: input.limit } });
|
|
34
|
+
}
|
|
35
|
+
export { getProductBySlug, getProducts, getRelatedProducts };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const require_models_products = require("../models/products.cjs");
|
|
2
|
+
// src/services/product.service.ts
|
|
3
|
+
async function getProducts(api, params = {}) {
|
|
4
|
+
const input = require_models_products.ProductsParamsSchema.parse(params);
|
|
5
|
+
const query = new URLSearchParams();
|
|
6
|
+
query.set("page", String(input.page));
|
|
7
|
+
query.set("pageSize", String(input.pageSize));
|
|
8
|
+
if (input.includeFilters !== void 0) query.set("includeFilters", String(input.includeFilters));
|
|
9
|
+
for (const productId of input.productIds ?? []) query.append("productIds", productId);
|
|
10
|
+
for (const slug of input.slugs ?? []) query.append("slugs", slug);
|
|
11
|
+
if (input.sort) query.set("sort", input.sort);
|
|
12
|
+
for (const seller of input.sellers ?? []) query.append("sellers", seller);
|
|
13
|
+
if (input.search) query.set("search", input.search);
|
|
14
|
+
for (const collection of input.collections ?? []) query.append("collections", collection);
|
|
15
|
+
if (input.collectionId) query.set("collectionId", input.collectionId);
|
|
16
|
+
if (input.categoryId) query.set("categoryId", input.categoryId);
|
|
17
|
+
for (const category of input.categories ?? []) query.append("categories", category);
|
|
18
|
+
for (const brand of input.brands ?? []) query.append("brands", brand);
|
|
19
|
+
for (const productType of input.productTypes ?? []) query.append("productTypes", productType);
|
|
20
|
+
for (const tag of input.tags ?? []) query.append("tags", tag);
|
|
21
|
+
for (const filter of input.filters ?? []) query.append("filters", filter);
|
|
22
|
+
if (input.inStock !== void 0) query.set("inStock", String(input.inStock));
|
|
23
|
+
if (input.minPrice !== void 0) query.set("minPrice", String(input.minPrice));
|
|
24
|
+
if (input.maxPrice !== void 0) query.set("maxPrice", String(input.maxPrice));
|
|
25
|
+
return api.get(`products?${query.toString()}`, require_models_products.ProductsResponseSchema);
|
|
26
|
+
}
|
|
27
|
+
async function getProductBySlug(api, slug, options = {}) {
|
|
28
|
+
const path = `products/${encodeURIComponent(slug)}`;
|
|
29
|
+
return api.get(path, require_models_products.ProductDetailSchema, { query: { previewKey: options.previewKey } });
|
|
30
|
+
}
|
|
31
|
+
async function getRelatedProducts(api, params) {
|
|
32
|
+
const input = require_models_products.RelatedProductsParamsSchema.parse(params);
|
|
33
|
+
return api.get(`products/${encodeURIComponent(input.productId)}/related`, require_models_products.ProductSummariesSchema, { query: { limit: input.limit } });
|
|
34
|
+
}
|
|
35
|
+
exports.getProductBySlug = getProductBySlug;
|
|
36
|
+
exports.getProducts = getProducts;
|
|
37
|
+
exports.getRelatedProducts = getRelatedProducts;
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import { Api } from "../api.cjs";
|
|
2
|
+
import { ProductBySlugOptions, ProductsParamsInput, RelatedProductsParams } from "../models/products.cjs";
|
|
3
|
+
export declare function getProducts(api: Api, params?: ProductsParamsInput): Promise<{
|
|
4
|
+
pageIndex: number;
|
|
5
|
+
pageSize: number;
|
|
6
|
+
totalCount: number;
|
|
7
|
+
totalPages: number;
|
|
8
|
+
products: {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
slug: string;
|
|
12
|
+
url: string;
|
|
13
|
+
productType: string;
|
|
14
|
+
imageUrl: string;
|
|
15
|
+
price: number;
|
|
16
|
+
compareAtPrice: number | null;
|
|
17
|
+
variantCount: number;
|
|
18
|
+
isAvailable: boolean;
|
|
19
|
+
totalInventory: number;
|
|
20
|
+
bundleItemsCount: number;
|
|
21
|
+
brand: string;
|
|
22
|
+
category: string;
|
|
23
|
+
status: string;
|
|
24
|
+
collections: string[];
|
|
25
|
+
tags: string[];
|
|
26
|
+
seller: {
|
|
27
|
+
id: string;
|
|
28
|
+
name: string;
|
|
29
|
+
slug: string;
|
|
30
|
+
} | null;
|
|
31
|
+
options: {
|
|
32
|
+
key: string;
|
|
33
|
+
name: string;
|
|
34
|
+
type?: "checkbox" | "colorPicker" | "datePicker" | "dateTimePicker" | "file" | "input" | "number" | "select" | "textArea" | "timePicker" | "url" | undefined;
|
|
35
|
+
values: {
|
|
36
|
+
key: string;
|
|
37
|
+
name: string;
|
|
38
|
+
value: string;
|
|
39
|
+
valueId?: string | null | undefined;
|
|
40
|
+
valueName?: string | null | undefined;
|
|
41
|
+
type?: "checkbox" | "colorPicker" | "datePicker" | "dateTimePicker" | "file" | "input" | "number" | "select" | "textArea" | "timePicker" | "url" | undefined;
|
|
42
|
+
color?: string | null | undefined;
|
|
43
|
+
imageUrl?: string | null | undefined;
|
|
44
|
+
unit?: string | null | undefined;
|
|
45
|
+
}[];
|
|
46
|
+
}[];
|
|
47
|
+
images: {
|
|
48
|
+
url: string;
|
|
49
|
+
name: string;
|
|
50
|
+
order: number;
|
|
51
|
+
type: "image" | "video";
|
|
52
|
+
}[];
|
|
53
|
+
availableVariantId: string | null;
|
|
54
|
+
hasModifierGroups: boolean;
|
|
55
|
+
}[];
|
|
56
|
+
filters: {
|
|
57
|
+
id: string;
|
|
58
|
+
label: string;
|
|
59
|
+
type: "list" | "price_range";
|
|
60
|
+
values: {
|
|
61
|
+
value: string;
|
|
62
|
+
count: number;
|
|
63
|
+
label: string | null;
|
|
64
|
+
selected: boolean;
|
|
65
|
+
}[];
|
|
66
|
+
min: number | null;
|
|
67
|
+
max: number | null;
|
|
68
|
+
selectedMin: number | null;
|
|
69
|
+
selectedMax: number | null;
|
|
70
|
+
}[];
|
|
71
|
+
}>;
|
|
72
|
+
export declare function getProductBySlug(api: Api, slug: string, options?: ProductBySlugOptions): Promise<{
|
|
73
|
+
id: string;
|
|
74
|
+
name: string;
|
|
75
|
+
slug: string;
|
|
76
|
+
url: string;
|
|
77
|
+
description: string;
|
|
78
|
+
productType: string;
|
|
79
|
+
status: string;
|
|
80
|
+
imageUrl: string;
|
|
81
|
+
price: number;
|
|
82
|
+
compareAtPrice: number | null;
|
|
83
|
+
isAvailable: boolean;
|
|
84
|
+
totalInventory: number;
|
|
85
|
+
brand: string;
|
|
86
|
+
category: string;
|
|
87
|
+
categoryId: string | null;
|
|
88
|
+
tags: string[];
|
|
89
|
+
specifications: {
|
|
90
|
+
key: string;
|
|
91
|
+
name: string;
|
|
92
|
+
value: string;
|
|
93
|
+
valueId?: string | null | undefined;
|
|
94
|
+
valueName?: string | null | undefined;
|
|
95
|
+
type?: "checkbox" | "colorPicker" | "datePicker" | "dateTimePicker" | "file" | "input" | "number" | "select" | "textArea" | "timePicker" | "url" | undefined;
|
|
96
|
+
color?: string | null | undefined;
|
|
97
|
+
imageUrl?: string | null | undefined;
|
|
98
|
+
unit?: string | null | undefined;
|
|
99
|
+
}[];
|
|
100
|
+
variants: {
|
|
101
|
+
id: string | null;
|
|
102
|
+
sku: string;
|
|
103
|
+
status: string;
|
|
104
|
+
price: number;
|
|
105
|
+
compareAtPrice: number | null;
|
|
106
|
+
quantity: number;
|
|
107
|
+
isAvailable: boolean | null;
|
|
108
|
+
requiresShipping: boolean;
|
|
109
|
+
options: {
|
|
110
|
+
key: string;
|
|
111
|
+
name: string;
|
|
112
|
+
value: string;
|
|
113
|
+
valueId?: string | null | undefined;
|
|
114
|
+
valueName?: string | null | undefined;
|
|
115
|
+
type?: "checkbox" | "colorPicker" | "datePicker" | "dateTimePicker" | "file" | "input" | "number" | "select" | "textArea" | "timePicker" | "url" | undefined;
|
|
116
|
+
color?: string | null | undefined;
|
|
117
|
+
imageUrl?: string | null | undefined;
|
|
118
|
+
unit?: string | null | undefined;
|
|
119
|
+
}[];
|
|
120
|
+
images: {
|
|
121
|
+
url: string;
|
|
122
|
+
name: string;
|
|
123
|
+
order: number;
|
|
124
|
+
type: "image" | "video";
|
|
125
|
+
}[];
|
|
126
|
+
}[];
|
|
127
|
+
images: {
|
|
128
|
+
url: string;
|
|
129
|
+
name: string;
|
|
130
|
+
order: number;
|
|
131
|
+
type: "image" | "video";
|
|
132
|
+
}[];
|
|
133
|
+
bundleItems: {
|
|
134
|
+
productId: string;
|
|
135
|
+
variantId: string;
|
|
136
|
+
productName: string;
|
|
137
|
+
variantName: string | null;
|
|
138
|
+
sku: string | null;
|
|
139
|
+
brand: string | null;
|
|
140
|
+
imageUrl: string | null;
|
|
141
|
+
quantity: number;
|
|
142
|
+
available: number;
|
|
143
|
+
allowBackorders: boolean;
|
|
144
|
+
requiresShipping: boolean;
|
|
145
|
+
}[];
|
|
146
|
+
sizeGuide: {
|
|
147
|
+
id: string;
|
|
148
|
+
name: string;
|
|
149
|
+
slug: string;
|
|
150
|
+
description: string | null;
|
|
151
|
+
imageUrl: string | null;
|
|
152
|
+
gender: string;
|
|
153
|
+
measurementType: string;
|
|
154
|
+
unit: string;
|
|
155
|
+
notes: string | null;
|
|
156
|
+
rows: {
|
|
157
|
+
label: string;
|
|
158
|
+
sizeKey: string;
|
|
159
|
+
order: number;
|
|
160
|
+
measurements: {
|
|
161
|
+
key: string;
|
|
162
|
+
name: string;
|
|
163
|
+
min: number | null;
|
|
164
|
+
max: number | null;
|
|
165
|
+
value: number | null;
|
|
166
|
+
description: string | null;
|
|
167
|
+
}[];
|
|
168
|
+
}[];
|
|
169
|
+
} | null;
|
|
170
|
+
priceTiers: {
|
|
171
|
+
variantId: string;
|
|
172
|
+
minQuantity: number;
|
|
173
|
+
maxQuantity: number | null;
|
|
174
|
+
unitPrice: number;
|
|
175
|
+
}[];
|
|
176
|
+
modifierGroups: {
|
|
177
|
+
id: string;
|
|
178
|
+
name: string;
|
|
179
|
+
description: string | null;
|
|
180
|
+
selectionType: "multiple" | "single" | "text";
|
|
181
|
+
display: "color" | "font" | "image" | "list";
|
|
182
|
+
isRequired: boolean;
|
|
183
|
+
minSelections: number;
|
|
184
|
+
maxSelections: number | null;
|
|
185
|
+
maxLength: number | null;
|
|
186
|
+
priceDelta: number;
|
|
187
|
+
options: {
|
|
188
|
+
id: string;
|
|
189
|
+
name: string;
|
|
190
|
+
priceDelta: number;
|
|
191
|
+
isDefault: boolean;
|
|
192
|
+
color: string | null;
|
|
193
|
+
fileUrl: string | null;
|
|
194
|
+
fileName: string | null;
|
|
195
|
+
tag: string | null;
|
|
196
|
+
maxQuantity: number;
|
|
197
|
+
}[];
|
|
198
|
+
}[];
|
|
199
|
+
createdAt: string | null;
|
|
200
|
+
updatedAt: string | null;
|
|
201
|
+
seller: {
|
|
202
|
+
id: string;
|
|
203
|
+
name: string;
|
|
204
|
+
slug: string;
|
|
205
|
+
} | null;
|
|
206
|
+
isPreview: boolean;
|
|
207
|
+
template: string | null;
|
|
208
|
+
}>;
|
|
209
|
+
export declare function getRelatedProducts(api: Api, params: RelatedProductsParams): Promise<{
|
|
210
|
+
id: string;
|
|
211
|
+
name: string;
|
|
212
|
+
slug: string;
|
|
213
|
+
url: string;
|
|
214
|
+
productType: string;
|
|
215
|
+
imageUrl: string;
|
|
216
|
+
price: number;
|
|
217
|
+
compareAtPrice: number | null;
|
|
218
|
+
variantCount: number;
|
|
219
|
+
isAvailable: boolean;
|
|
220
|
+
totalInventory: number;
|
|
221
|
+
bundleItemsCount: number;
|
|
222
|
+
brand: string;
|
|
223
|
+
category: string;
|
|
224
|
+
status: string;
|
|
225
|
+
collections: string[];
|
|
226
|
+
tags: string[];
|
|
227
|
+
seller: {
|
|
228
|
+
id: string;
|
|
229
|
+
name: string;
|
|
230
|
+
slug: string;
|
|
231
|
+
} | null;
|
|
232
|
+
options: {
|
|
233
|
+
key: string;
|
|
234
|
+
name: string;
|
|
235
|
+
type?: "checkbox" | "colorPicker" | "datePicker" | "dateTimePicker" | "file" | "input" | "number" | "select" | "textArea" | "timePicker" | "url" | undefined;
|
|
236
|
+
values: {
|
|
237
|
+
key: string;
|
|
238
|
+
name: string;
|
|
239
|
+
value: string;
|
|
240
|
+
valueId?: string | null | undefined;
|
|
241
|
+
valueName?: string | null | undefined;
|
|
242
|
+
type?: "checkbox" | "colorPicker" | "datePicker" | "dateTimePicker" | "file" | "input" | "number" | "select" | "textArea" | "timePicker" | "url" | undefined;
|
|
243
|
+
color?: string | null | undefined;
|
|
244
|
+
imageUrl?: string | null | undefined;
|
|
245
|
+
unit?: string | null | undefined;
|
|
246
|
+
}[];
|
|
247
|
+
}[];
|
|
248
|
+
images: {
|
|
249
|
+
url: string;
|
|
250
|
+
name: string;
|
|
251
|
+
order: number;
|
|
252
|
+
type: "image" | "video";
|
|
253
|
+
}[];
|
|
254
|
+
availableVariantId: string | null;
|
|
255
|
+
hasModifierGroups: boolean;
|
|
256
|
+
}[]>;
|