arky-sdk 0.8.0 → 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,20 +2542,13 @@ 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
- },
2547
- async activityFeed(query = {}, options) {
2548
- const store_id = options?.store_id || apiConfig.storeId;
2549
- return apiConfig.httpClient.get(
2550
- `/v1/stores/${store_id}/analytics/activity-feed`,
2551
- { ...options, params: query }
2552
- );
2553
2552
  }
2554
2553
  };
2555
2554
  };
@@ -3094,10 +3093,7 @@ function createAdmin(config) {
3094
3093
  getExecution: workflowApi.getWorkflowExecution
3095
3094
  }
3096
3095
  },
3097
- analytics: {
3098
- query: analyticsApi.query,
3099
- activityFeed: analyticsApi.activityFeed
3100
- },
3096
+ analytics: analyticsApi,
3101
3097
  setStoreId: (storeId) => {
3102
3098
  apiConfig.storeId = storeId;
3103
3099
  },