@ecomiq/core 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.cjs +10 -0
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +4 -2
- package/dist/client.d.ts +4 -2
- package/dist/client.js +10 -0
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +11 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +328 -324
- package/dist/index.d.ts +328 -324
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/models/collections.d.cts +4 -4
- package/dist/models/collections.d.ts +4 -4
- package/dist/models/geo.d.cts +14 -14
- package/dist/models/geo.d.ts +14 -14
- package/dist/models/products.d.cts +130 -130
- package/dist/models/products.d.ts +130 -130
- package/dist/models/search.d.cts +4 -4
- package/dist/models/search.d.ts +4 -4
- package/dist/models/settings.d.cts +514 -514
- package/dist/models/settings.d.ts +514 -514
- package/dist/models/storefront-cart.d.cts +80 -80
- package/dist/models/storefront-cart.d.ts +80 -80
- package/dist/models/storefront-checkout.d.cts +400 -400
- package/dist/models/storefront-checkout.d.ts +400 -400
- package/dist/models/storefront-reviews.d.cts +8 -8
- package/dist/models/storefront-reviews.d.ts +8 -8
- package/package.json +7 -8
package/dist/client.d.cts
CHANGED
|
@@ -6,7 +6,7 @@ import { ListProductReviewsParams, StorefrontReviews, CreateProductReviewParams,
|
|
|
6
6
|
import { CreateCartParams, StorefrontCart, GetCartParams, AddCartItemParams, UpdateCartItemQuantityParams, RemoveCartItemParams } from './models/storefront-cart.cjs';
|
|
7
7
|
import { CartCheckoutReadParams, CartCheckoutReadResponse, GetShippingOptionsParams, ShippingOptionsResponse, PutShippingMethodParams, CartBuyerParams, CartAddressesParams, CartCheckoutParams, CartCheckoutResponse, UploadPaymentReceiptParams, CartPaymentReceiptResponse, CartPromotionCodeParams } from './models/storefront-checkout.cjs';
|
|
8
8
|
import { Countries, GetDepartmentsParams, Departments, GetProvincesParams, Provinces, GetDistrictsParams, Districts } from './models/geo.cjs';
|
|
9
|
-
import { StorefrontSettings } from './models/settings.cjs';
|
|
9
|
+
import { StorefrontSettings, CmsPageDetailsDto } from './models/settings.cjs';
|
|
10
10
|
import 'zod';
|
|
11
11
|
|
|
12
12
|
interface CreateClientOptions extends CreateApiOptions {
|
|
@@ -25,6 +25,8 @@ interface StorefrontClient extends Api {
|
|
|
25
25
|
getCollections(): Promise<Collections>;
|
|
26
26
|
/** GET /v1/collections/by-slug/:slug */
|
|
27
27
|
getCollectionBySlug(slug: string): Promise<Collection>;
|
|
28
|
+
/** GET /v1/pages/{slug} */
|
|
29
|
+
getPageBySlug(slug: string): Promise<CmsPageDetailsDto>;
|
|
28
30
|
/** Invalida el cache de settings. */
|
|
29
31
|
clearCache(): void;
|
|
30
32
|
getProducts(params?: ProductsParamsInput): Promise<ProductsResponse>;
|
|
@@ -68,7 +70,7 @@ interface StorefrontClient extends Api {
|
|
|
68
70
|
}
|
|
69
71
|
/**
|
|
70
72
|
* Crea el cliente storefront de bajo nivel (requiere slug).
|
|
71
|
-
* En apps Ecomiq usa `createClient()` de `@ecomiq/
|
|
73
|
+
* En apps Ecomiq usa `createClient()` de `@ecomiq/storefront`, que toma el slug del config.
|
|
72
74
|
*
|
|
73
75
|
* ```ts
|
|
74
76
|
* const api = createClient({ slug: 'marketplace' })
|
package/dist/client.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { ListProductReviewsParams, StorefrontReviews, CreateProductReviewParams,
|
|
|
6
6
|
import { CreateCartParams, StorefrontCart, GetCartParams, AddCartItemParams, UpdateCartItemQuantityParams, RemoveCartItemParams } from './models/storefront-cart.js';
|
|
7
7
|
import { CartCheckoutReadParams, CartCheckoutReadResponse, GetShippingOptionsParams, ShippingOptionsResponse, PutShippingMethodParams, CartBuyerParams, CartAddressesParams, CartCheckoutParams, CartCheckoutResponse, UploadPaymentReceiptParams, CartPaymentReceiptResponse, CartPromotionCodeParams } from './models/storefront-checkout.js';
|
|
8
8
|
import { Countries, GetDepartmentsParams, Departments, GetProvincesParams, Provinces, GetDistrictsParams, Districts } from './models/geo.js';
|
|
9
|
-
import { StorefrontSettings } from './models/settings.js';
|
|
9
|
+
import { StorefrontSettings, CmsPageDetailsDto } from './models/settings.js';
|
|
10
10
|
import 'zod';
|
|
11
11
|
|
|
12
12
|
interface CreateClientOptions extends CreateApiOptions {
|
|
@@ -25,6 +25,8 @@ interface StorefrontClient extends Api {
|
|
|
25
25
|
getCollections(): Promise<Collections>;
|
|
26
26
|
/** GET /v1/collections/by-slug/:slug */
|
|
27
27
|
getCollectionBySlug(slug: string): Promise<Collection>;
|
|
28
|
+
/** GET /v1/pages/{slug} */
|
|
29
|
+
getPageBySlug(slug: string): Promise<CmsPageDetailsDto>;
|
|
28
30
|
/** Invalida el cache de settings. */
|
|
29
31
|
clearCache(): void;
|
|
30
32
|
getProducts(params?: ProductsParamsInput): Promise<ProductsResponse>;
|
|
@@ -68,7 +70,7 @@ interface StorefrontClient extends Api {
|
|
|
68
70
|
}
|
|
69
71
|
/**
|
|
70
72
|
* Crea el cliente storefront de bajo nivel (requiere slug).
|
|
71
|
-
* En apps Ecomiq usa `createClient()` de `@ecomiq/
|
|
73
|
+
* En apps Ecomiq usa `createClient()` de `@ecomiq/storefront`, que toma el slug del config.
|
|
72
74
|
*
|
|
73
75
|
* ```ts
|
|
74
76
|
* const api = createClient({ slug: 'marketplace' })
|
package/dist/client.js
CHANGED
|
@@ -817,6 +817,11 @@ async function getCollections(api) {
|
|
|
817
817
|
async function getCollectionBySlug(api, collectionSlug) {
|
|
818
818
|
return api.get(`collections/${encodeURIComponent(collectionSlug)}`, CollectionSchema);
|
|
819
819
|
}
|
|
820
|
+
|
|
821
|
+
// src/services/page.service.ts
|
|
822
|
+
async function getPageBySlug(api, pageSlug) {
|
|
823
|
+
return api.get(`pages/${encodeURIComponent(pageSlug)}`, CmsPageDetailsDtoSchema);
|
|
824
|
+
}
|
|
820
825
|
var CartBuyerParamsSchema = z.object({
|
|
821
826
|
cartId: z.string().uuid(),
|
|
822
827
|
email: z.string().email(),
|
|
@@ -1209,6 +1214,10 @@ function createClient(options) {
|
|
|
1209
1214
|
const client = await apiClient();
|
|
1210
1215
|
return getCollectionBySlug(client, collectionSlug);
|
|
1211
1216
|
}
|
|
1217
|
+
async function getPageBySlug2(pageSlug) {
|
|
1218
|
+
const client = await apiClient();
|
|
1219
|
+
return getPageBySlug(client, pageSlug);
|
|
1220
|
+
}
|
|
1212
1221
|
async function getProducts2(params = {}) {
|
|
1213
1222
|
const client = await apiClient();
|
|
1214
1223
|
return getProducts(client, params);
|
|
@@ -1307,6 +1316,7 @@ function createClient(options) {
|
|
|
1307
1316
|
getStoreId,
|
|
1308
1317
|
getCollections: getCollections2,
|
|
1309
1318
|
getCollectionBySlug: getCollectionBySlug2,
|
|
1319
|
+
getPageBySlug: getPageBySlug2,
|
|
1310
1320
|
clearCache,
|
|
1311
1321
|
getProducts: getProducts2,
|
|
1312
1322
|
getProductBySlug: getProductBySlug2,
|