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