@ecomiq/core 0.1.0 → 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.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/framework`, que toma el slug del config.
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/framework`, que toma el slug del config.
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,