arky-sdk 0.7.113 → 0.7.115

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/admin.js CHANGED
@@ -895,123 +895,12 @@ var createEshopApi = (apiConfig) => {
895
895
  }
896
896
  );
897
897
  },
898
- async createOrder(params, options) {
899
- const { store_id, items, ...rest } = params;
900
- const target_store_id = store_id || apiConfig.storeId;
901
- const payload = {
902
- ...rest,
903
- market: rest.market || apiConfig.market,
904
- items: normalizeOrderCheckoutItems(items)
905
- };
906
- return apiConfig.httpClient.post(
907
- `/v1/stores/${target_store_id}/orders`,
908
- payload,
909
- options
910
- );
911
- },
912
- async checkoutOrder(params, options) {
913
- const { store_id, items, ...rest } = params;
914
- const target_store_id = store_id || apiConfig.storeId;
915
- const payload = {
916
- ...rest,
917
- store_id: target_store_id,
918
- market: rest.market || apiConfig.market,
919
- items: normalizeOrderCheckoutItems(items)
920
- };
921
- return apiConfig.httpClient.post(
922
- `/v1/stores/${target_store_id}/orders/checkout`,
923
- payload,
924
- options
925
- );
926
- },
927
- async updateOrder(params, options) {
928
- const { store_id, items, ...rest } = params;
929
- const target_store_id = store_id || apiConfig.storeId;
930
- const payload = {
931
- ...rest,
932
- ...items ? { items: normalizeOrderCheckoutItems(items) } : {}
933
- };
934
- return apiConfig.httpClient.put(
935
- `/v1/stores/${target_store_id}/orders/${params.id}`,
936
- payload,
937
- options
938
- );
939
- },
940
- async getOrder(params, options) {
941
- const target_store_id = params.store_id || apiConfig.storeId;
942
- return apiConfig.httpClient.get(
943
- `/v1/stores/${target_store_id}/orders/${params.id}`,
944
- options
945
- );
946
- },
947
- async getOrders(params, options) {
948
- const { store_id, ...queryParams } = params;
949
- const target_store_id = store_id || apiConfig.storeId;
950
- return apiConfig.httpClient.get(
951
- `/v1/stores/${target_store_id}/orders`,
952
- {
953
- ...options,
954
- params: queryParams
955
- }
956
- );
957
- },
958
- async getQuote(params, options) {
959
- const { location, store_id, items, ...rest } = params;
960
- const target_store_id = store_id || apiConfig.storeId;
961
- const shipping_address = location ? {
962
- country: location.country || "",
963
- state: location.state || "",
964
- city: location.city || "",
965
- postal_code: location.postal_code || "",
966
- name: "",
967
- street1: "",
968
- street2: null
969
- } : rest.shipping_address;
970
- return apiConfig.httpClient.post(
971
- `/v1/stores/${target_store_id}/orders/quote`,
972
- {
973
- ...rest,
974
- items: normalizeOrderQuoteItems(items),
975
- shipping_address,
976
- market: rest.market || apiConfig.market
977
- },
978
- options
979
- );
980
- },
981
- async getOrderAvailability(params, options) {
982
- const { store_id, ...queryParams } = params;
983
- const target_store_id = store_id || apiConfig.storeId;
984
- return apiConfig.httpClient.get(
985
- `/v1/stores/${target_store_id}/orders/availability`,
986
- { ...options, params: queryParams }
987
- );
988
- },
989
- async processRefund(params, options) {
990
- return apiConfig.httpClient.post(
991
- `/v1/stores/${apiConfig.storeId}/orders/${params.id}/refund`,
992
- { amount: params.amount },
993
- options
994
- );
995
- }
996
- };
997
- };
998
-
999
- // src/api/scheduling.ts
1000
- var normalizeTaxonomyAliases2 = (payload) => {
1001
- const { filters, ...rest } = payload;
1002
- return {
1003
- ...rest,
1004
- ...!rest.taxonomies && filters ? { taxonomies: filters } : {}
1005
- };
1006
- };
1007
- var createSchedulingApi = (apiConfig) => {
1008
- return {
1009
898
  async createService(params, options) {
1010
899
  const { store_id, ...payload } = params;
1011
900
  const target_store_id = store_id || apiConfig.storeId;
1012
901
  return apiConfig.httpClient.post(
1013
902
  `/v1/stores/${target_store_id}/services`,
1014
- normalizeTaxonomyAliases2(payload),
903
+ normalizeTaxonomyAliases(payload),
1015
904
  options
1016
905
  );
1017
906
  },
@@ -1020,7 +909,7 @@ var createSchedulingApi = (apiConfig) => {
1020
909
  const target_store_id = store_id || apiConfig.storeId;
1021
910
  return apiConfig.httpClient.put(
1022
911
  `/v1/stores/${target_store_id}/services/${params.id}`,
1023
- normalizeTaxonomyAliases2(payload),
912
+ normalizeTaxonomyAliases(payload),
1024
913
  options
1025
914
  );
1026
915
  },
@@ -1057,12 +946,20 @@ var createSchedulingApi = (apiConfig) => {
1057
946
  }
1058
947
  );
1059
948
  },
949
+ async getServiceAvailability(params, options) {
950
+ const { store_id, ...queryParams } = params;
951
+ const target_store_id = store_id || apiConfig.storeId;
952
+ return apiConfig.httpClient.get(
953
+ `/v1/stores/${target_store_id}/services/availability`,
954
+ { ...options, params: queryParams }
955
+ );
956
+ },
1060
957
  async createProvider(params, options) {
1061
958
  const { store_id, ...payload } = params;
1062
959
  const target_store_id = store_id || apiConfig.storeId;
1063
960
  return apiConfig.httpClient.post(
1064
961
  `/v1/stores/${target_store_id}/providers`,
1065
- normalizeTaxonomyAliases2(payload),
962
+ normalizeTaxonomyAliases(payload),
1066
963
  options
1067
964
  );
1068
965
  },
@@ -1071,7 +968,7 @@ var createSchedulingApi = (apiConfig) => {
1071
968
  const target_store_id = store_id || apiConfig.storeId;
1072
969
  return apiConfig.httpClient.put(
1073
970
  `/v1/stores/${target_store_id}/providers/${params.id}`,
1074
- normalizeTaxonomyAliases2(payload),
971
+ normalizeTaxonomyAliases(payload),
1075
972
  options
1076
973
  );
1077
974
  },
@@ -1140,6 +1037,96 @@ var createSchedulingApi = (apiConfig) => {
1140
1037
  `/v1/stores/${target_store_id}/service-providers/${params.id}`,
1141
1038
  options
1142
1039
  );
1040
+ },
1041
+ async createOrder(params, options) {
1042
+ const { store_id, items, ...rest } = params;
1043
+ const target_store_id = store_id || apiConfig.storeId;
1044
+ const payload = {
1045
+ ...rest,
1046
+ market: rest.market || apiConfig.market,
1047
+ items: normalizeOrderCheckoutItems(items)
1048
+ };
1049
+ return apiConfig.httpClient.post(
1050
+ `/v1/stores/${target_store_id}/orders`,
1051
+ payload,
1052
+ options
1053
+ );
1054
+ },
1055
+ async checkoutOrder(params, options) {
1056
+ const { store_id, items, ...rest } = params;
1057
+ const target_store_id = store_id || apiConfig.storeId;
1058
+ const payload = {
1059
+ ...rest,
1060
+ store_id: target_store_id,
1061
+ market: rest.market || apiConfig.market,
1062
+ items: normalizeOrderCheckoutItems(items)
1063
+ };
1064
+ return apiConfig.httpClient.post(
1065
+ `/v1/stores/${target_store_id}/orders/checkout`,
1066
+ payload,
1067
+ options
1068
+ );
1069
+ },
1070
+ async updateOrder(params, options) {
1071
+ const { store_id, items, ...rest } = params;
1072
+ const target_store_id = store_id || apiConfig.storeId;
1073
+ const payload = {
1074
+ ...rest,
1075
+ ...items ? { items: normalizeOrderCheckoutItems(items) } : {}
1076
+ };
1077
+ return apiConfig.httpClient.put(
1078
+ `/v1/stores/${target_store_id}/orders/${params.id}`,
1079
+ payload,
1080
+ options
1081
+ );
1082
+ },
1083
+ async getOrder(params, options) {
1084
+ const target_store_id = params.store_id || apiConfig.storeId;
1085
+ return apiConfig.httpClient.get(
1086
+ `/v1/stores/${target_store_id}/orders/${params.id}`,
1087
+ options
1088
+ );
1089
+ },
1090
+ async getOrders(params, options) {
1091
+ const { store_id, ...queryParams } = params;
1092
+ const target_store_id = store_id || apiConfig.storeId;
1093
+ return apiConfig.httpClient.get(
1094
+ `/v1/stores/${target_store_id}/orders`,
1095
+ {
1096
+ ...options,
1097
+ params: queryParams
1098
+ }
1099
+ );
1100
+ },
1101
+ async getQuote(params, options) {
1102
+ const { location, store_id, items, ...rest } = params;
1103
+ const target_store_id = store_id || apiConfig.storeId;
1104
+ const shipping_address = location ? {
1105
+ country: location.country || "",
1106
+ state: location.state || "",
1107
+ city: location.city || "",
1108
+ postal_code: location.postal_code || "",
1109
+ name: "",
1110
+ street1: "",
1111
+ street2: null
1112
+ } : rest.shipping_address;
1113
+ return apiConfig.httpClient.post(
1114
+ `/v1/stores/${target_store_id}/orders/quote`,
1115
+ {
1116
+ ...rest,
1117
+ items: normalizeOrderQuoteItems(items),
1118
+ shipping_address,
1119
+ market: rest.market || apiConfig.market
1120
+ },
1121
+ options
1122
+ );
1123
+ },
1124
+ async processRefund(params, options) {
1125
+ return apiConfig.httpClient.post(
1126
+ `/v1/stores/${apiConfig.storeId}/orders/${params.id}/refund`,
1127
+ { amount: params.amount },
1128
+ options
1129
+ );
1143
1130
  }
1144
1131
  };
1145
1132
  };
@@ -1242,7 +1229,7 @@ var createActivityAdminApi = (apiConfig) => ({
1242
1229
  );
1243
1230
  },
1244
1231
  async find(params, options) {
1245
- const store_id = apiConfig.storeId;
1232
+ const store_id = params.store_id || apiConfig.storeId;
1246
1233
  const queryParams = {};
1247
1234
  if (params.customer_id) queryParams.customer_id = params.customer_id;
1248
1235
  if (params.types && params.types.length > 0) queryParams.types = params.types;
@@ -1278,6 +1265,8 @@ var createCustomerApi = (apiConfig) => {
1278
1265
  if (params?.limit !== void 0) queryParams.limit = params.limit;
1279
1266
  if (params?.cursor) queryParams.cursor = params.cursor;
1280
1267
  if (params?.query) queryParams.query = params.query;
1268
+ if (params?.taxonomy_query) queryParams.taxonomy_query = params.taxonomy_query;
1269
+ if (params?.status) queryParams.status = params.status;
1281
1270
  if (params?.sort_field) queryParams.sort_field = params.sort_field;
1282
1271
  if (params?.sort_direction) queryParams.sort_direction = params.sort_direction;
1283
1272
  return apiConfig.httpClient.get(
@@ -2225,7 +2214,6 @@ function createAdmin(config) {
2225
2214
  const platformApi = createPlatformApi(apiConfig);
2226
2215
  const cmsApi = createCmsApi(apiConfig);
2227
2216
  const eshopApi = createEshopApi(apiConfig);
2228
- const schedulingApi = createSchedulingApi(apiConfig);
2229
2217
  const promoCodeApi = createPromoCodeApi(apiConfig);
2230
2218
  const crmApi = createCustomerApi(apiConfig);
2231
2219
  const locationApi = createLocationApi(apiConfig);
@@ -2300,26 +2288,26 @@ function createAdmin(config) {
2300
2288
  find: eshopApi.getOrders,
2301
2289
  getQuote: eshopApi.getQuote,
2302
2290
  checkout: eshopApi.checkoutOrder,
2303
- getAvailability: eshopApi.getOrderAvailability,
2304
2291
  processRefund: eshopApi.processRefund
2305
2292
  },
2306
2293
  service: {
2307
- create: schedulingApi.createService,
2308
- update: schedulingApi.updateService,
2309
- delete: schedulingApi.deleteService,
2310
- get: schedulingApi.getService,
2311
- find: schedulingApi.getServices,
2312
- findProviders: schedulingApi.findServiceProviders,
2313
- createProvider: schedulingApi.createServiceProvider,
2314
- updateProvider: schedulingApi.updateServiceProvider,
2315
- deleteProvider: schedulingApi.deleteServiceProvider
2294
+ create: eshopApi.createService,
2295
+ update: eshopApi.updateService,
2296
+ delete: eshopApi.deleteService,
2297
+ get: eshopApi.getService,
2298
+ find: eshopApi.getServices,
2299
+ getAvailability: eshopApi.getServiceAvailability,
2300
+ findProviders: eshopApi.findServiceProviders,
2301
+ createProvider: eshopApi.createServiceProvider,
2302
+ updateProvider: eshopApi.updateServiceProvider,
2303
+ deleteProvider: eshopApi.deleteServiceProvider
2316
2304
  },
2317
2305
  provider: {
2318
- create: schedulingApi.createProvider,
2319
- update: schedulingApi.updateProvider,
2320
- delete: schedulingApi.deleteProvider,
2321
- get: schedulingApi.getProvider,
2322
- find: schedulingApi.getProviders
2306
+ create: eshopApi.createProvider,
2307
+ update: eshopApi.updateProvider,
2308
+ delete: eshopApi.deleteProvider,
2309
+ get: eshopApi.getProvider,
2310
+ find: eshopApi.getProviders
2323
2311
  },
2324
2312
  promoCode: promoCodeApi
2325
2313
  },