arky-sdk 0.7.134 → 0.9.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/dist/index.cjs CHANGED
@@ -156,6 +156,12 @@ function normalizeOrderCheckoutItems(items) {
156
156
  return { type: "service", ...item };
157
157
  });
158
158
  }
159
+ function normalizePublicCheckoutItems(items) {
160
+ return normalizeOrderCheckoutItems(items).map((item) => {
161
+ const { price: _price, ...publicItem } = item;
162
+ return publicItem;
163
+ });
164
+ }
159
165
 
160
166
  // src/api/storefront.ts
161
167
  var COMMON_ACTIVITY_TYPES = [
@@ -371,7 +377,7 @@ var createStorefrontApi = (apiConfig, updateCustomerSession) => {
371
377
  {
372
378
  ...payload,
373
379
  store_id: target,
374
- ...items ? { items: normalizeOrderCheckoutItems(items) } : {}
380
+ ...items ? { items: normalizePublicCheckoutItems(items) } : {}
375
381
  },
376
382
  options
377
383
  );
@@ -384,7 +390,7 @@ var createStorefrontApi = (apiConfig, updateCustomerSession) => {
384
390
  {
385
391
  ...payload,
386
392
  store_id: target,
387
- item: normalizeOrderCheckoutItems([item])[0]
393
+ item: normalizePublicCheckoutItems([item])[0]
388
394
  },
389
395
  options
390
396
  );
@@ -2536,11 +2542,11 @@ var createTaxonomyApi = (apiConfig) => {
2536
2542
  // src/api/analytics.ts
2537
2543
  var createAnalyticsApi = (apiConfig) => {
2538
2544
  return {
2539
- async query(spec, options) {
2545
+ async get(request, options) {
2540
2546
  const store_id = options?.store_id || apiConfig.storeId;
2541
2547
  return apiConfig.httpClient.post(
2542
- `/v1/stores/${store_id}/analytics/query`,
2543
- spec,
2548
+ `/v1/stores/${store_id}/analytics`,
2549
+ request,
2544
2550
  options
2545
2551
  );
2546
2552
  }
@@ -3087,9 +3093,7 @@ function createAdmin(config) {
3087
3093
  getExecution: workflowApi.getWorkflowExecution
3088
3094
  }
3089
3095
  },
3090
- analytics: {
3091
- query: analyticsApi.query
3092
- },
3096
+ analytics: analyticsApi,
3093
3097
  setStoreId: (storeId) => {
3094
3098
  apiConfig.storeId = storeId;
3095
3099
  },