@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
package/dist/client.d.cts
CHANGED
|
@@ -1,15 +1,156 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
1
|
+
import { AuthenticateOrderPaymentInput, OrderPaymentStart, OrderStatusView } from "./models/order-status.cjs";
|
|
2
|
+
import { Api, CreateApiOptions } from "./api.cjs";
|
|
3
|
+
import { GraphQLRequestOptions, GraphQLVariables } from "./libs/graphql.cjs";
|
|
4
|
+
import { StorefrontPaymentMethods } from "./models/payment-methods.cjs";
|
|
5
|
+
import { Collection, Collections } from "./models/collections.cjs";
|
|
6
|
+
import { CategoryDetail } from "./models/categories.cjs";
|
|
7
|
+
import { SitemapPage, UrlResolution, UrlResolutionOptions } from "./models/urls.cjs";
|
|
8
|
+
import { CatalogLink } from "./models/catalog-links.cjs";
|
|
9
|
+
import { StorefrontLayout } from "./services/layout.service.cjs";
|
|
10
|
+
import { Article, ArticleSummary, ListArticlesParams } from "./models/articles.cjs";
|
|
11
|
+
import { ProductBySlugOptions, ProductDetail, ProductSummary, ProductsParamsInput, ProductsResponse, RelatedProductsParams } from "./models/products.cjs";
|
|
12
|
+
import { ProductAutocompleteParams, ProductSuggestion } from "./models/search.cjs";
|
|
13
|
+
import { CreateCustomerProductReviewParams, CreateProductReviewParams, ListProductReviewsParams, ListStoreReviewsParams, StorefrontReview, StorefrontReviews, StorefrontStoreReview } from "./models/storefront-reviews.cjs";
|
|
14
|
+
import { AddCartItemParams, CreateCartParams, GetCartParams, RemoveCartItemParams, StorefrontCart, UpdateCartItemQuantityParams } from "./models/storefront-cart.cjs";
|
|
15
|
+
import { CartAddressesParams, CartBuyerParams, CartCheckoutParams, CartCheckoutReadParams, CartCheckoutReadResponse, CartCheckoutResponse, CartPaymentReceiptResponse, CartPromotionCodeParams, GetShippingOptionsParams, PutCartPaymentMethodParams, PutShippingMethodParams, ShippingOptionsResponse, UploadPaymentReceiptParams } from "./models/storefront-checkout.cjs";
|
|
16
|
+
import { Countries, Departments, Districts, GetDepartmentsParams, GetDistrictsParams, GetProvincesParams, Provinces } from "./models/geo.cjs";
|
|
17
|
+
import { SellerProfile, Sellers } from "./models/sellers.cjs";
|
|
18
|
+
import { CustomerAddressUpsertInput, CustomerAddresses } from "./models/customer-address.cjs";
|
|
19
|
+
import { CustomerAddressCreated, CustomerAddressRequestOptions } from "./services/customer-address.service.cjs";
|
|
20
|
+
import { CustomerRegistration, CustomerRegistrationInput } from "./models/customer-registration.cjs";
|
|
21
|
+
import { CustomerMe, CustomerProfilePatch } from "./models/customer-profile.cjs";
|
|
22
|
+
import { CustomerRequestOptions } from "./services/customer.service.cjs";
|
|
23
|
+
import { CustomerAuthConfiguration, CustomerSession, CustomerSessionCreate, CustomerSessionCreated } from "./models/customer-session.cjs";
|
|
24
|
+
import { CustomerOrderDetail, CustomerOrderPage } from "./models/customer-order.cjs";
|
|
25
|
+
import { CustomerOrderCancellationInput, CustomerOrderListOptions, CustomerOrderRequestOptions, CustomerOrderReturnInput } from "./services/customer-order.service.cjs";
|
|
26
|
+
import { OrderDraft, OrderDraftCheckout } from "./models/order-draft.cjs";
|
|
27
|
+
import { StartOrderPaymentInput, UploadOrderPaymentReceiptInput } from "./services/order-status.service.cjs";
|
|
28
|
+
import { ComplaintBook, ComplaintBookEntry, ComplaintBookEntryInput } from "./models/complaint-book.cjs";
|
|
29
|
+
import { CmsPageDetailsDto, StorefrontSettings } from "./models/settings.cjs";
|
|
30
|
+
import { z } from "zod";
|
|
31
|
+
export interface CreateClientOptions extends CreateApiOptions {
|
|
32
|
+
/**
|
|
33
|
+
* Dominio/slug de la tienda (header x-Store-Domain).
|
|
34
|
+
* Debe venir de ecomiq.config.js (`config.domain`).
|
|
35
|
+
* Acepta `marketplace`, `marketplace.ecomiq.app` o `marketplace.pe`.
|
|
36
|
+
*/
|
|
37
|
+
domain: string;
|
|
38
|
+
/** Store ID fijado por el deployer para que el SSR no espere settings antes de leer catálogo. */
|
|
39
|
+
storeId?: string;
|
|
40
|
+
settingsCacheTtlMs?: number;
|
|
41
|
+
}
|
|
42
|
+
export interface StorefrontClient extends Api {
|
|
43
|
+
/** Ejecuta una lectura GraphQL sin alterar los métodos REST existentes. */
|
|
44
|
+
graphql<S extends z.ZodTypeAny, V extends GraphQLVariables = GraphQLVariables>(document: string, dataSchema: S, variables?: V, options?: GraphQLRequestOptions): Promise<z.output<S>>;
|
|
45
|
+
getSettings(): Promise<StorefrontSettings>;
|
|
46
|
+
getLayout(links: readonly CatalogLink[]): Promise<StorefrontLayout>;
|
|
47
|
+
/** store.id desde settings (asegura cache). */
|
|
48
|
+
getStoreId(): Promise<string>;
|
|
49
|
+
/** GET /v1/collections */
|
|
50
|
+
getCollections(): Promise<Collections>;
|
|
51
|
+
/** GET /v1/payments/methods */
|
|
52
|
+
getPaymentMethods(): Promise<StorefrontPaymentMethods>;
|
|
53
|
+
/** GET /v1/collections/by-slug/:slug */
|
|
54
|
+
getCollectionBySlug(slug: string): Promise<Collection>;
|
|
55
|
+
/** GET /v1/pages/{slug} */
|
|
56
|
+
getPageBySlug(slug: string): Promise<CmsPageDetailsDto>;
|
|
57
|
+
getCategoryBySlug(slug: string): Promise<CategoryDetail>;
|
|
58
|
+
resolveUrl(path: string, options?: UrlResolutionOptions): Promise<UrlResolution | null>;
|
|
59
|
+
getLinks(links: readonly CatalogLink[]): Promise<CatalogLink[]>;
|
|
60
|
+
getSitemap(page: number): Promise<SitemapPage>;
|
|
61
|
+
listArticles(params?: ListArticlesParams): Promise<ArticleSummary[]>;
|
|
62
|
+
getArticleBySlug(slug: string): Promise<Article>;
|
|
63
|
+
/** Invalida el cache de settings. */
|
|
64
|
+
clearCache(): void;
|
|
65
|
+
getSellers(): Promise<Sellers>;
|
|
66
|
+
getSellerBySlug(slug: string): Promise<SellerProfile>;
|
|
67
|
+
getProducts(params?: ProductsParamsInput): Promise<ProductsResponse>;
|
|
68
|
+
/** GET product by slug con x-Store-Id. */
|
|
69
|
+
getProductBySlug(slug: string, options?: ProductBySlugOptions): Promise<ProductDetail>;
|
|
70
|
+
getRelatedProducts(params: RelatedProductsParams): Promise<ProductSummary[]>;
|
|
71
|
+
autocompleteProducts(params: ProductAutocompleteParams): Promise<ProductSuggestion[]>;
|
|
72
|
+
listProductReviews(params: ListProductReviewsParams): Promise<StorefrontReviews>;
|
|
73
|
+
/** Últimas reseñas aprobadas de la tienda, para testimonios. */
|
|
74
|
+
listStoreReviews(params?: ListStoreReviewsParams): Promise<StorefrontStoreReview[]>;
|
|
75
|
+
createProductReview(params: CreateProductReviewParams): Promise<StorefrontReview>;
|
|
76
|
+
createCustomerProductReview(params: CreateCustomerProductReviewParams, options: CustomerRequestOptions): Promise<StorefrontReview>;
|
|
77
|
+
createCart(params: CreateCartParams): Promise<StorefrontCart>;
|
|
78
|
+
getCart(params: GetCartParams): Promise<StorefrontCart>;
|
|
79
|
+
addCartItem(params: AddCartItemParams): Promise<StorefrontCart>;
|
|
80
|
+
updateCartItemQuantity(params: UpdateCartItemQuantityParams): Promise<StorefrontCart>;
|
|
81
|
+
removeCartItem(params: RemoveCartItemParams): Promise<StorefrontCart>;
|
|
82
|
+
/** GET /v1/carts/{id}/checkout */
|
|
83
|
+
getCartCheckout(params: CartCheckoutReadParams): Promise<CartCheckoutReadResponse>;
|
|
84
|
+
/** GET /v1/carts/{id}/shipping-options */
|
|
85
|
+
getShippingOptions(params: GetShippingOptionsParams): Promise<ShippingOptionsResponse>;
|
|
86
|
+
/** PUT /v1/carts/{id}/shipping-method */
|
|
87
|
+
putCartShippingMethod(params: PutShippingMethodParams): Promise<StorefrontCart>;
|
|
88
|
+
putCartPaymentMethod(params: PutCartPaymentMethodParams): Promise<StorefrontCart>;
|
|
89
|
+
/** PATCH /v1/carts/{id}/buyer */
|
|
90
|
+
patchCartBuyer(params: CartBuyerParams): Promise<StorefrontCart>;
|
|
91
|
+
/** PATCH /v1/carts/{id}/addresses */
|
|
92
|
+
patchCartAddresses(params: CartAddressesParams): Promise<StorefrontCart>;
|
|
93
|
+
/** POST /v1/carts/{id}/checkout */
|
|
94
|
+
checkoutCart(params: CartCheckoutParams, options?: CustomerRequestOptions): Promise<CartCheckoutResponse>;
|
|
95
|
+
/** POST /v1/carts/{id}/payment-receipt */
|
|
96
|
+
uploadPaymentReceipt(params: UploadPaymentReceiptParams): Promise<CartPaymentReceiptResponse>;
|
|
97
|
+
/** POST /v1/carts/{id}/promotion-codes */
|
|
98
|
+
addCartPromotionCode(params: CartPromotionCodeParams): Promise<StorefrontCart>;
|
|
99
|
+
/** DELETE /v1/carts/{id}/promotion-codes/{code} */
|
|
100
|
+
removeCartPromotionCode(params: CartPromotionCodeParams): Promise<StorefrontCart>;
|
|
101
|
+
/** GET /v1/geo/countries */
|
|
102
|
+
getCountries(): Promise<Countries>;
|
|
103
|
+
/** GET /v1/geo/departments */
|
|
104
|
+
getDepartments(params: GetDepartmentsParams): Promise<Departments>;
|
|
105
|
+
/** GET /v1/geo/provinces */
|
|
106
|
+
getProvinces(params: GetProvincesParams): Promise<Provinces>;
|
|
107
|
+
/** GET /v1/geo/districts */
|
|
108
|
+
getDistricts(params: GetDistrictsParams): Promise<Districts>;
|
|
109
|
+
upsertCustomerAuthConfiguration(origin: string): Promise<CustomerAuthConfiguration>;
|
|
110
|
+
createCustomerSession(input: CustomerSessionCreate): Promise<CustomerSessionCreated>;
|
|
111
|
+
getCustomerRegistration(options: CustomerRequestOptions): Promise<CustomerRegistration>;
|
|
112
|
+
completeCustomerRegistration(input: CustomerRegistrationInput, options: CustomerRequestOptions): Promise<CustomerRegistration>;
|
|
113
|
+
getCustomerSession(options: CustomerRequestOptions): Promise<CustomerSession>;
|
|
114
|
+
deleteCustomerSession(options: CustomerRequestOptions): Promise<void>;
|
|
115
|
+
/** GET customer addresses (requiere una sesión de comprador). */
|
|
116
|
+
getCustomerAddresses(options?: CustomerAddressRequestOptions): Promise<CustomerAddresses>;
|
|
117
|
+
/** POST customer address. */
|
|
118
|
+
createCustomerAddress(data: CustomerAddressUpsertInput, options?: CustomerAddressRequestOptions): Promise<CustomerAddressCreated>;
|
|
119
|
+
/** PUT customer address. */
|
|
120
|
+
updateCustomerAddress(addressId: string, data: CustomerAddressUpsertInput, options?: CustomerAddressRequestOptions): Promise<void>;
|
|
121
|
+
/** DELETE customer address. */
|
|
122
|
+
deleteCustomerAddress(addressId: string, options?: CustomerAddressRequestOptions): Promise<void>;
|
|
123
|
+
/** GET /v1/customer/me */
|
|
124
|
+
getCustomerMe(options?: CustomerRequestOptions): Promise<CustomerMe>;
|
|
125
|
+
/** PATCH /v1/customer */
|
|
126
|
+
patchCustomer(data: CustomerProfilePatch, options?: CustomerRequestOptions): Promise<void>;
|
|
127
|
+
/** GET /v1/customer/orders */
|
|
128
|
+
getCustomerOrders(options?: CustomerOrderListOptions): Promise<CustomerOrderPage>;
|
|
129
|
+
/** GET /v1/customer/orders/{orderId} */
|
|
130
|
+
getCustomerOrder(orderId: string, options?: CustomerOrderRequestOptions): Promise<CustomerOrderDetail>;
|
|
131
|
+
/** POST /v1/customer/orders/{orderId}/return-request */
|
|
132
|
+
requestCustomerOrderReturn(orderId: string, input: CustomerOrderReturnInput, options?: CustomerOrderRequestOptions): Promise<void>;
|
|
133
|
+
/** POST /v1/customer/orders/{orderId}/cancellation-request */
|
|
134
|
+
requestCustomerOrderCancellation(orderId: string, input: CustomerOrderCancellationInput, options?: CustomerOrderRequestOptions): Promise<void>;
|
|
135
|
+
getOrderStatus(token: string): Promise<OrderStatusView>;
|
|
136
|
+
startOrderPayment(token: string, input: StartOrderPaymentInput): Promise<OrderPaymentStart>;
|
|
137
|
+
authenticateOrderPayment(token: string, transactionId: string, input: AuthenticateOrderPaymentInput): Promise<OrderPaymentStart>;
|
|
138
|
+
uploadOrderPaymentReceipt(token: string, input: UploadOrderPaymentReceiptInput): Promise<OrderPaymentStart>;
|
|
139
|
+
getOrderDraft(token: string): Promise<OrderDraft>;
|
|
140
|
+
checkoutOrderDraft(token: string): Promise<OrderDraftCheckout>;
|
|
141
|
+
/** GET /v1/complaint-book */
|
|
142
|
+
getComplaintBook(): Promise<ComplaintBook>;
|
|
143
|
+
/** POST /v1/complaint-book/entries (multipart) */
|
|
144
|
+
createComplaintBookEntry(input: ComplaintBookEntryInput, files: readonly File[], captchaToken: string): Promise<ComplaintBookEntry>;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Crea el cliente storefront de bajo nivel (requiere domain).
|
|
148
|
+
* En apps Ecomiq usa `createClient()` de `@ecomiq/storefront`, que toma el domain del config.
|
|
149
|
+
*
|
|
150
|
+
* ```ts
|
|
151
|
+
* const api = createClient({ domain: 'marketplace' })
|
|
152
|
+
* const collections = await api.getCollections()
|
|
153
|
+
* ```
|
|
154
|
+
*/
|
|
155
|
+
export declare function createClient(options: CreateClientOptions): StorefrontClient;
|
|
156
|
+
export type { CreateApiOptions };
|
package/dist/client.d.ts
CHANGED
|
@@ -1,15 +1,156 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
1
|
+
import { AuthenticateOrderPaymentInput, OrderPaymentStart, OrderStatusView } from "./models/order-status.js";
|
|
2
|
+
import { Api, CreateApiOptions } from "./api.js";
|
|
3
|
+
import { GraphQLRequestOptions, GraphQLVariables } from "./libs/graphql.js";
|
|
4
|
+
import { StorefrontPaymentMethods } from "./models/payment-methods.js";
|
|
5
|
+
import { Collection, Collections } from "./models/collections.js";
|
|
6
|
+
import { CategoryDetail } from "./models/categories.js";
|
|
7
|
+
import { SitemapPage, UrlResolution, UrlResolutionOptions } from "./models/urls.js";
|
|
8
|
+
import { CatalogLink } from "./models/catalog-links.js";
|
|
9
|
+
import { StorefrontLayout } from "./services/layout.service.js";
|
|
10
|
+
import { Article, ArticleSummary, ListArticlesParams } from "./models/articles.js";
|
|
11
|
+
import { ProductBySlugOptions, ProductDetail, ProductSummary, ProductsParamsInput, ProductsResponse, RelatedProductsParams } from "./models/products.js";
|
|
12
|
+
import { ProductAutocompleteParams, ProductSuggestion } from "./models/search.js";
|
|
13
|
+
import { CreateCustomerProductReviewParams, CreateProductReviewParams, ListProductReviewsParams, ListStoreReviewsParams, StorefrontReview, StorefrontReviews, StorefrontStoreReview } from "./models/storefront-reviews.js";
|
|
14
|
+
import { AddCartItemParams, CreateCartParams, GetCartParams, RemoveCartItemParams, StorefrontCart, UpdateCartItemQuantityParams } from "./models/storefront-cart.js";
|
|
15
|
+
import { CartAddressesParams, CartBuyerParams, CartCheckoutParams, CartCheckoutReadParams, CartCheckoutReadResponse, CartCheckoutResponse, CartPaymentReceiptResponse, CartPromotionCodeParams, GetShippingOptionsParams, PutCartPaymentMethodParams, PutShippingMethodParams, ShippingOptionsResponse, UploadPaymentReceiptParams } from "./models/storefront-checkout.js";
|
|
16
|
+
import { Countries, Departments, Districts, GetDepartmentsParams, GetDistrictsParams, GetProvincesParams, Provinces } from "./models/geo.js";
|
|
17
|
+
import { SellerProfile, Sellers } from "./models/sellers.js";
|
|
18
|
+
import { CustomerAddressUpsertInput, CustomerAddresses } from "./models/customer-address.js";
|
|
19
|
+
import { CustomerAddressCreated, CustomerAddressRequestOptions } from "./services/customer-address.service.js";
|
|
20
|
+
import { CustomerRegistration, CustomerRegistrationInput } from "./models/customer-registration.js";
|
|
21
|
+
import { CustomerMe, CustomerProfilePatch } from "./models/customer-profile.js";
|
|
22
|
+
import { CustomerRequestOptions } from "./services/customer.service.js";
|
|
23
|
+
import { CustomerAuthConfiguration, CustomerSession, CustomerSessionCreate, CustomerSessionCreated } from "./models/customer-session.js";
|
|
24
|
+
import { CustomerOrderDetail, CustomerOrderPage } from "./models/customer-order.js";
|
|
25
|
+
import { CustomerOrderCancellationInput, CustomerOrderListOptions, CustomerOrderRequestOptions, CustomerOrderReturnInput } from "./services/customer-order.service.js";
|
|
26
|
+
import { OrderDraft, OrderDraftCheckout } from "./models/order-draft.js";
|
|
27
|
+
import { StartOrderPaymentInput, UploadOrderPaymentReceiptInput } from "./services/order-status.service.js";
|
|
28
|
+
import { ComplaintBook, ComplaintBookEntry, ComplaintBookEntryInput } from "./models/complaint-book.js";
|
|
29
|
+
import { CmsPageDetailsDto, StorefrontSettings } from "./models/settings.js";
|
|
30
|
+
import { z } from "zod";
|
|
31
|
+
export interface CreateClientOptions extends CreateApiOptions {
|
|
32
|
+
/**
|
|
33
|
+
* Dominio/slug de la tienda (header x-Store-Domain).
|
|
34
|
+
* Debe venir de ecomiq.config.js (`config.domain`).
|
|
35
|
+
* Acepta `marketplace`, `marketplace.ecomiq.app` o `marketplace.pe`.
|
|
36
|
+
*/
|
|
37
|
+
domain: string;
|
|
38
|
+
/** Store ID fijado por el deployer para que el SSR no espere settings antes de leer catálogo. */
|
|
39
|
+
storeId?: string;
|
|
40
|
+
settingsCacheTtlMs?: number;
|
|
41
|
+
}
|
|
42
|
+
export interface StorefrontClient extends Api {
|
|
43
|
+
/** Ejecuta una lectura GraphQL sin alterar los métodos REST existentes. */
|
|
44
|
+
graphql<S extends z.ZodTypeAny, V extends GraphQLVariables = GraphQLVariables>(document: string, dataSchema: S, variables?: V, options?: GraphQLRequestOptions): Promise<z.output<S>>;
|
|
45
|
+
getSettings(): Promise<StorefrontSettings>;
|
|
46
|
+
getLayout(links: readonly CatalogLink[]): Promise<StorefrontLayout>;
|
|
47
|
+
/** store.id desde settings (asegura cache). */
|
|
48
|
+
getStoreId(): Promise<string>;
|
|
49
|
+
/** GET /v1/collections */
|
|
50
|
+
getCollections(): Promise<Collections>;
|
|
51
|
+
/** GET /v1/payments/methods */
|
|
52
|
+
getPaymentMethods(): Promise<StorefrontPaymentMethods>;
|
|
53
|
+
/** GET /v1/collections/by-slug/:slug */
|
|
54
|
+
getCollectionBySlug(slug: string): Promise<Collection>;
|
|
55
|
+
/** GET /v1/pages/{slug} */
|
|
56
|
+
getPageBySlug(slug: string): Promise<CmsPageDetailsDto>;
|
|
57
|
+
getCategoryBySlug(slug: string): Promise<CategoryDetail>;
|
|
58
|
+
resolveUrl(path: string, options?: UrlResolutionOptions): Promise<UrlResolution | null>;
|
|
59
|
+
getLinks(links: readonly CatalogLink[]): Promise<CatalogLink[]>;
|
|
60
|
+
getSitemap(page: number): Promise<SitemapPage>;
|
|
61
|
+
listArticles(params?: ListArticlesParams): Promise<ArticleSummary[]>;
|
|
62
|
+
getArticleBySlug(slug: string): Promise<Article>;
|
|
63
|
+
/** Invalida el cache de settings. */
|
|
64
|
+
clearCache(): void;
|
|
65
|
+
getSellers(): Promise<Sellers>;
|
|
66
|
+
getSellerBySlug(slug: string): Promise<SellerProfile>;
|
|
67
|
+
getProducts(params?: ProductsParamsInput): Promise<ProductsResponse>;
|
|
68
|
+
/** GET product by slug con x-Store-Id. */
|
|
69
|
+
getProductBySlug(slug: string, options?: ProductBySlugOptions): Promise<ProductDetail>;
|
|
70
|
+
getRelatedProducts(params: RelatedProductsParams): Promise<ProductSummary[]>;
|
|
71
|
+
autocompleteProducts(params: ProductAutocompleteParams): Promise<ProductSuggestion[]>;
|
|
72
|
+
listProductReviews(params: ListProductReviewsParams): Promise<StorefrontReviews>;
|
|
73
|
+
/** Últimas reseñas aprobadas de la tienda, para testimonios. */
|
|
74
|
+
listStoreReviews(params?: ListStoreReviewsParams): Promise<StorefrontStoreReview[]>;
|
|
75
|
+
createProductReview(params: CreateProductReviewParams): Promise<StorefrontReview>;
|
|
76
|
+
createCustomerProductReview(params: CreateCustomerProductReviewParams, options: CustomerRequestOptions): Promise<StorefrontReview>;
|
|
77
|
+
createCart(params: CreateCartParams): Promise<StorefrontCart>;
|
|
78
|
+
getCart(params: GetCartParams): Promise<StorefrontCart>;
|
|
79
|
+
addCartItem(params: AddCartItemParams): Promise<StorefrontCart>;
|
|
80
|
+
updateCartItemQuantity(params: UpdateCartItemQuantityParams): Promise<StorefrontCart>;
|
|
81
|
+
removeCartItem(params: RemoveCartItemParams): Promise<StorefrontCart>;
|
|
82
|
+
/** GET /v1/carts/{id}/checkout */
|
|
83
|
+
getCartCheckout(params: CartCheckoutReadParams): Promise<CartCheckoutReadResponse>;
|
|
84
|
+
/** GET /v1/carts/{id}/shipping-options */
|
|
85
|
+
getShippingOptions(params: GetShippingOptionsParams): Promise<ShippingOptionsResponse>;
|
|
86
|
+
/** PUT /v1/carts/{id}/shipping-method */
|
|
87
|
+
putCartShippingMethod(params: PutShippingMethodParams): Promise<StorefrontCart>;
|
|
88
|
+
putCartPaymentMethod(params: PutCartPaymentMethodParams): Promise<StorefrontCart>;
|
|
89
|
+
/** PATCH /v1/carts/{id}/buyer */
|
|
90
|
+
patchCartBuyer(params: CartBuyerParams): Promise<StorefrontCart>;
|
|
91
|
+
/** PATCH /v1/carts/{id}/addresses */
|
|
92
|
+
patchCartAddresses(params: CartAddressesParams): Promise<StorefrontCart>;
|
|
93
|
+
/** POST /v1/carts/{id}/checkout */
|
|
94
|
+
checkoutCart(params: CartCheckoutParams, options?: CustomerRequestOptions): Promise<CartCheckoutResponse>;
|
|
95
|
+
/** POST /v1/carts/{id}/payment-receipt */
|
|
96
|
+
uploadPaymentReceipt(params: UploadPaymentReceiptParams): Promise<CartPaymentReceiptResponse>;
|
|
97
|
+
/** POST /v1/carts/{id}/promotion-codes */
|
|
98
|
+
addCartPromotionCode(params: CartPromotionCodeParams): Promise<StorefrontCart>;
|
|
99
|
+
/** DELETE /v1/carts/{id}/promotion-codes/{code} */
|
|
100
|
+
removeCartPromotionCode(params: CartPromotionCodeParams): Promise<StorefrontCart>;
|
|
101
|
+
/** GET /v1/geo/countries */
|
|
102
|
+
getCountries(): Promise<Countries>;
|
|
103
|
+
/** GET /v1/geo/departments */
|
|
104
|
+
getDepartments(params: GetDepartmentsParams): Promise<Departments>;
|
|
105
|
+
/** GET /v1/geo/provinces */
|
|
106
|
+
getProvinces(params: GetProvincesParams): Promise<Provinces>;
|
|
107
|
+
/** GET /v1/geo/districts */
|
|
108
|
+
getDistricts(params: GetDistrictsParams): Promise<Districts>;
|
|
109
|
+
upsertCustomerAuthConfiguration(origin: string): Promise<CustomerAuthConfiguration>;
|
|
110
|
+
createCustomerSession(input: CustomerSessionCreate): Promise<CustomerSessionCreated>;
|
|
111
|
+
getCustomerRegistration(options: CustomerRequestOptions): Promise<CustomerRegistration>;
|
|
112
|
+
completeCustomerRegistration(input: CustomerRegistrationInput, options: CustomerRequestOptions): Promise<CustomerRegistration>;
|
|
113
|
+
getCustomerSession(options: CustomerRequestOptions): Promise<CustomerSession>;
|
|
114
|
+
deleteCustomerSession(options: CustomerRequestOptions): Promise<void>;
|
|
115
|
+
/** GET customer addresses (requiere una sesión de comprador). */
|
|
116
|
+
getCustomerAddresses(options?: CustomerAddressRequestOptions): Promise<CustomerAddresses>;
|
|
117
|
+
/** POST customer address. */
|
|
118
|
+
createCustomerAddress(data: CustomerAddressUpsertInput, options?: CustomerAddressRequestOptions): Promise<CustomerAddressCreated>;
|
|
119
|
+
/** PUT customer address. */
|
|
120
|
+
updateCustomerAddress(addressId: string, data: CustomerAddressUpsertInput, options?: CustomerAddressRequestOptions): Promise<void>;
|
|
121
|
+
/** DELETE customer address. */
|
|
122
|
+
deleteCustomerAddress(addressId: string, options?: CustomerAddressRequestOptions): Promise<void>;
|
|
123
|
+
/** GET /v1/customer/me */
|
|
124
|
+
getCustomerMe(options?: CustomerRequestOptions): Promise<CustomerMe>;
|
|
125
|
+
/** PATCH /v1/customer */
|
|
126
|
+
patchCustomer(data: CustomerProfilePatch, options?: CustomerRequestOptions): Promise<void>;
|
|
127
|
+
/** GET /v1/customer/orders */
|
|
128
|
+
getCustomerOrders(options?: CustomerOrderListOptions): Promise<CustomerOrderPage>;
|
|
129
|
+
/** GET /v1/customer/orders/{orderId} */
|
|
130
|
+
getCustomerOrder(orderId: string, options?: CustomerOrderRequestOptions): Promise<CustomerOrderDetail>;
|
|
131
|
+
/** POST /v1/customer/orders/{orderId}/return-request */
|
|
132
|
+
requestCustomerOrderReturn(orderId: string, input: CustomerOrderReturnInput, options?: CustomerOrderRequestOptions): Promise<void>;
|
|
133
|
+
/** POST /v1/customer/orders/{orderId}/cancellation-request */
|
|
134
|
+
requestCustomerOrderCancellation(orderId: string, input: CustomerOrderCancellationInput, options?: CustomerOrderRequestOptions): Promise<void>;
|
|
135
|
+
getOrderStatus(token: string): Promise<OrderStatusView>;
|
|
136
|
+
startOrderPayment(token: string, input: StartOrderPaymentInput): Promise<OrderPaymentStart>;
|
|
137
|
+
authenticateOrderPayment(token: string, transactionId: string, input: AuthenticateOrderPaymentInput): Promise<OrderPaymentStart>;
|
|
138
|
+
uploadOrderPaymentReceipt(token: string, input: UploadOrderPaymentReceiptInput): Promise<OrderPaymentStart>;
|
|
139
|
+
getOrderDraft(token: string): Promise<OrderDraft>;
|
|
140
|
+
checkoutOrderDraft(token: string): Promise<OrderDraftCheckout>;
|
|
141
|
+
/** GET /v1/complaint-book */
|
|
142
|
+
getComplaintBook(): Promise<ComplaintBook>;
|
|
143
|
+
/** POST /v1/complaint-book/entries (multipart) */
|
|
144
|
+
createComplaintBookEntry(input: ComplaintBookEntryInput, files: readonly File[], captchaToken: string): Promise<ComplaintBookEntry>;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Crea el cliente storefront de bajo nivel (requiere domain).
|
|
148
|
+
* En apps Ecomiq usa `createClient()` de `@ecomiq/storefront`, que toma el domain del config.
|
|
149
|
+
*
|
|
150
|
+
* ```ts
|
|
151
|
+
* const api = createClient({ domain: 'marketplace' })
|
|
152
|
+
* const collections = await api.getCollections()
|
|
153
|
+
* ```
|
|
154
|
+
*/
|
|
155
|
+
export declare function createClient(options: CreateClientOptions): StorefrontClient;
|
|
156
|
+
export type { CreateApiOptions };
|