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.cjs +120 -132
- package/dist/admin.cjs.map +1 -1
- package/dist/admin.js +120 -132
- package/dist/admin.js.map +1 -1
- package/dist/index.cjs +128 -140
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +128 -140
- package/dist/index.js.map +1 -1
- package/dist/storefront.cjs +8 -8
- package/dist/storefront.cjs.map +1 -1
- package/dist/storefront.js +8 -8
- package/dist/storefront.js.map +1 -1
- package/dist/types.d.cts +3 -0
- package/dist/types.d.ts +3 -0
- package/package.json +1 -1
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
};
|
|
@@ -1244,7 +1231,7 @@ var createActivityAdminApi = (apiConfig) => ({
|
|
|
1244
1231
|
);
|
|
1245
1232
|
},
|
|
1246
1233
|
async find(params, options) {
|
|
1247
|
-
const store_id = apiConfig.storeId;
|
|
1234
|
+
const store_id = params.store_id || apiConfig.storeId;
|
|
1248
1235
|
const queryParams = {};
|
|
1249
1236
|
if (params.customer_id) queryParams.customer_id = params.customer_id;
|
|
1250
1237
|
if (params.types && params.types.length > 0) queryParams.types = params.types;
|
|
@@ -1280,6 +1267,8 @@ var createCustomerApi = (apiConfig) => {
|
|
|
1280
1267
|
if (params?.limit !== void 0) queryParams.limit = params.limit;
|
|
1281
1268
|
if (params?.cursor) queryParams.cursor = params.cursor;
|
|
1282
1269
|
if (params?.query) queryParams.query = params.query;
|
|
1270
|
+
if (params?.taxonomy_query) queryParams.taxonomy_query = params.taxonomy_query;
|
|
1271
|
+
if (params?.status) queryParams.status = params.status;
|
|
1283
1272
|
if (params?.sort_field) queryParams.sort_field = params.sort_field;
|
|
1284
1273
|
if (params?.sort_direction) queryParams.sort_direction = params.sort_direction;
|
|
1285
1274
|
return apiConfig.httpClient.get(
|
|
@@ -2227,7 +2216,6 @@ function createAdmin(config) {
|
|
|
2227
2216
|
const platformApi = createPlatformApi(apiConfig);
|
|
2228
2217
|
const cmsApi = createCmsApi(apiConfig);
|
|
2229
2218
|
const eshopApi = createEshopApi(apiConfig);
|
|
2230
|
-
const schedulingApi = createSchedulingApi(apiConfig);
|
|
2231
2219
|
const promoCodeApi = createPromoCodeApi(apiConfig);
|
|
2232
2220
|
const crmApi = createCustomerApi(apiConfig);
|
|
2233
2221
|
const locationApi = createLocationApi(apiConfig);
|
|
@@ -2302,26 +2290,26 @@ function createAdmin(config) {
|
|
|
2302
2290
|
find: eshopApi.getOrders,
|
|
2303
2291
|
getQuote: eshopApi.getQuote,
|
|
2304
2292
|
checkout: eshopApi.checkoutOrder,
|
|
2305
|
-
getAvailability: eshopApi.getOrderAvailability,
|
|
2306
2293
|
processRefund: eshopApi.processRefund
|
|
2307
2294
|
},
|
|
2308
2295
|
service: {
|
|
2309
|
-
create:
|
|
2310
|
-
update:
|
|
2311
|
-
delete:
|
|
2312
|
-
get:
|
|
2313
|
-
find:
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
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
|
|
2318
2306
|
},
|
|
2319
2307
|
provider: {
|
|
2320
|
-
create:
|
|
2321
|
-
update:
|
|
2322
|
-
delete:
|
|
2323
|
-
get:
|
|
2324
|
-
find:
|
|
2308
|
+
create: eshopApi.createProvider,
|
|
2309
|
+
update: eshopApi.updateProvider,
|
|
2310
|
+
delete: eshopApi.deleteProvider,
|
|
2311
|
+
get: eshopApi.getProvider,
|
|
2312
|
+
find: eshopApi.getProviders
|
|
2325
2313
|
},
|
|
2326
2314
|
promoCode: promoCodeApi
|
|
2327
2315
|
},
|