arky-sdk 0.3.134 → 0.3.137
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 +219 -64
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +25 -2
- package/dist/index.d.ts +25 -2
- package/dist/index.js +219 -64
- package/dist/index.js.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +61 -14
- package/dist/types.d.ts +61 -14
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -309,7 +309,10 @@ var createBusinessApi = (apiConfig) => {
|
|
|
309
309
|
);
|
|
310
310
|
},
|
|
311
311
|
async getBusinesses(params, options) {
|
|
312
|
-
return apiConfig.httpClient.get(`/v1/businesses`,
|
|
312
|
+
return apiConfig.httpClient.get(`/v1/businesses`, {
|
|
313
|
+
...options,
|
|
314
|
+
params
|
|
315
|
+
});
|
|
313
316
|
},
|
|
314
317
|
async getBusinessParents(params, options) {
|
|
315
318
|
return apiConfig.httpClient.get(
|
|
@@ -398,8 +401,9 @@ var createBusinessApi = (apiConfig) => {
|
|
|
398
401
|
var createMediaApi = (apiConfig) => {
|
|
399
402
|
return {
|
|
400
403
|
async uploadBusinessMedia(params, options) {
|
|
401
|
-
const { files = [], urls = [] } = params;
|
|
402
|
-
const
|
|
404
|
+
const { businessId, files = [], urls = [] } = params;
|
|
405
|
+
const targetBusinessId = businessId || apiConfig.businessId;
|
|
406
|
+
const url = `${apiConfig.baseUrl}/v1/businesses/${targetBusinessId}/media`;
|
|
403
407
|
const formData = new FormData();
|
|
404
408
|
files.forEach((file) => formData.append("files", file));
|
|
405
409
|
urls.forEach((url2) => formData.append("urls", url2));
|
|
@@ -424,8 +428,9 @@ var createMediaApi = (apiConfig) => {
|
|
|
424
428
|
);
|
|
425
429
|
},
|
|
426
430
|
async getBusinessMedia(params, options) {
|
|
427
|
-
const { cursor, limit, ids, query, mimeType, sortField, sortDirection } = params;
|
|
428
|
-
const
|
|
431
|
+
const { businessId, cursor, limit, ids, query, mimeType, sortField, sortDirection } = params;
|
|
432
|
+
const targetBusinessId = businessId || apiConfig.businessId;
|
|
433
|
+
const url = `${apiConfig.baseUrl}/v1/businesses/${targetBusinessId}/media`;
|
|
429
434
|
const queryParams = { limit: String(limit) };
|
|
430
435
|
if (cursor) queryParams.cursor = cursor;
|
|
431
436
|
if (ids && ids.length > 0) queryParams.ids = ids.join(",");
|
|
@@ -447,9 +452,10 @@ var createMediaApi = (apiConfig) => {
|
|
|
447
452
|
return await response.json();
|
|
448
453
|
},
|
|
449
454
|
async updateMedia(params, options) {
|
|
450
|
-
const { mediaId, ...updateData } = params;
|
|
455
|
+
const { mediaId, businessId, ...updateData } = params;
|
|
456
|
+
const targetBusinessId = businessId || apiConfig.businessId;
|
|
451
457
|
return apiConfig.httpClient.put(
|
|
452
|
-
`/v1/businesses/${
|
|
458
|
+
`/v1/businesses/${targetBusinessId}/media/${mediaId}`,
|
|
453
459
|
updateData,
|
|
454
460
|
options
|
|
455
461
|
);
|
|
@@ -569,21 +575,6 @@ var createAnalyticsApi = (apiConfig) => {
|
|
|
569
575
|
};
|
|
570
576
|
};
|
|
571
577
|
|
|
572
|
-
// src/utils/slug.ts
|
|
573
|
-
var isUuid = (str) => {
|
|
574
|
-
const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
575
|
-
return uuidRegex.test(str);
|
|
576
|
-
};
|
|
577
|
-
var formatIdOrSlug = (id, apiConfig) => {
|
|
578
|
-
if (isUuid(id)) {
|
|
579
|
-
return id;
|
|
580
|
-
}
|
|
581
|
-
if (id.includes(":")) {
|
|
582
|
-
return id;
|
|
583
|
-
}
|
|
584
|
-
return `${apiConfig.businessId}:${apiConfig.locale}:${id}`;
|
|
585
|
-
};
|
|
586
|
-
|
|
587
578
|
// src/utils/blocks.ts
|
|
588
579
|
function getBlockLabel(block, locale = "en") {
|
|
589
580
|
if (!block) return "";
|
|
@@ -749,29 +740,44 @@ var getImageUrl = (imageBlock, isBlock = true) => {
|
|
|
749
740
|
var createCmsApi = (apiConfig) => {
|
|
750
741
|
return {
|
|
751
742
|
async createNode(params, options) {
|
|
743
|
+
const { businessId, ...payload } = params;
|
|
744
|
+
const targetBusinessId = businessId || apiConfig.businessId;
|
|
752
745
|
return apiConfig.httpClient.post(
|
|
753
|
-
`/v1/businesses/${
|
|
754
|
-
|
|
746
|
+
`/v1/businesses/${targetBusinessId}/nodes`,
|
|
747
|
+
payload,
|
|
755
748
|
options
|
|
756
749
|
);
|
|
757
750
|
},
|
|
758
751
|
async updateNode(params, options) {
|
|
752
|
+
const { businessId, ...payload } = params;
|
|
753
|
+
const targetBusinessId = businessId || apiConfig.businessId;
|
|
759
754
|
return apiConfig.httpClient.put(
|
|
760
|
-
`/v1/businesses/${
|
|
761
|
-
|
|
755
|
+
`/v1/businesses/${targetBusinessId}/nodes/${params.id}`,
|
|
756
|
+
payload,
|
|
762
757
|
options
|
|
763
758
|
);
|
|
764
759
|
},
|
|
765
760
|
async deleteNode(params, options) {
|
|
761
|
+
const targetBusinessId = params.businessId || apiConfig.businessId;
|
|
766
762
|
return apiConfig.httpClient.delete(
|
|
767
|
-
`/v1/businesses/${
|
|
763
|
+
`/v1/businesses/${targetBusinessId}/nodes/${params.id}`,
|
|
768
764
|
options
|
|
769
765
|
);
|
|
770
766
|
},
|
|
771
767
|
async getNode(params, options) {
|
|
772
|
-
const
|
|
768
|
+
const targetBusinessId = params.businessId || apiConfig.businessId;
|
|
769
|
+
let identifier;
|
|
770
|
+
if (params.id) {
|
|
771
|
+
identifier = params.id;
|
|
772
|
+
} else if (params.slug) {
|
|
773
|
+
identifier = `${targetBusinessId}:${apiConfig.locale}:${params.slug}`;
|
|
774
|
+
} else if (params.key) {
|
|
775
|
+
identifier = `${targetBusinessId}:${params.key}`;
|
|
776
|
+
} else {
|
|
777
|
+
throw new Error("GetNodeParams requires id, slug, or key");
|
|
778
|
+
}
|
|
773
779
|
const response = await apiConfig.httpClient.get(
|
|
774
|
-
`/v1/businesses/${
|
|
780
|
+
`/v1/businesses/${targetBusinessId}/nodes/${identifier}`,
|
|
775
781
|
options
|
|
776
782
|
);
|
|
777
783
|
return {
|
|
@@ -789,18 +795,21 @@ var createCmsApi = (apiConfig) => {
|
|
|
789
795
|
};
|
|
790
796
|
},
|
|
791
797
|
async getNodes(params, options) {
|
|
798
|
+
const { businessId, ...queryParams } = params;
|
|
799
|
+
const targetBusinessId = businessId || apiConfig.businessId;
|
|
792
800
|
return apiConfig.httpClient.get(
|
|
793
|
-
`/v1/businesses/${
|
|
801
|
+
`/v1/businesses/${targetBusinessId}/nodes`,
|
|
794
802
|
{
|
|
795
803
|
...options,
|
|
796
|
-
params
|
|
804
|
+
params: queryParams
|
|
797
805
|
}
|
|
798
806
|
);
|
|
799
807
|
},
|
|
800
808
|
async getNodeChildren(params, options) {
|
|
801
|
-
const { id, ...queryParams } = params;
|
|
809
|
+
const { id, businessId, ...queryParams } = params;
|
|
810
|
+
const targetBusinessId = businessId || apiConfig.businessId;
|
|
802
811
|
return apiConfig.httpClient.get(
|
|
803
|
-
`/v1/businesses/${
|
|
812
|
+
`/v1/businesses/${targetBusinessId}/nodes/${id}/children`,
|
|
804
813
|
{
|
|
805
814
|
...options,
|
|
806
815
|
params: queryParams
|
|
@@ -881,9 +890,16 @@ var createEshopApi = (apiConfig) => {
|
|
|
881
890
|
);
|
|
882
891
|
},
|
|
883
892
|
async getProduct(params, options) {
|
|
884
|
-
|
|
893
|
+
let identifier;
|
|
894
|
+
if (params.id) {
|
|
895
|
+
identifier = params.id;
|
|
896
|
+
} else if (params.slug) {
|
|
897
|
+
identifier = `${apiConfig.businessId}:${apiConfig.locale}:${params.slug}`;
|
|
898
|
+
} else {
|
|
899
|
+
throw new Error("GetProductParams requires id or slug");
|
|
900
|
+
}
|
|
885
901
|
return apiConfig.httpClient.get(
|
|
886
|
-
`/v1/businesses/${apiConfig.businessId}/products/${
|
|
902
|
+
`/v1/businesses/${apiConfig.businessId}/products/${identifier}`,
|
|
887
903
|
options
|
|
888
904
|
);
|
|
889
905
|
},
|
|
@@ -972,12 +988,14 @@ var createReservationApi = (apiConfig) => {
|
|
|
972
988
|
},
|
|
973
989
|
// ===== RESERVATIONS =====
|
|
974
990
|
async createReservation(params, options) {
|
|
991
|
+
const { businessId, ...rest } = params;
|
|
992
|
+
const targetBusinessId = businessId || apiConfig.businessId;
|
|
975
993
|
const payload = {
|
|
976
994
|
market: apiConfig.market,
|
|
977
|
-
...
|
|
995
|
+
...rest
|
|
978
996
|
};
|
|
979
997
|
return apiConfig.httpClient.post(
|
|
980
|
-
`/v1/businesses/${
|
|
998
|
+
`/v1/businesses/${targetBusinessId}/reservations`,
|
|
981
999
|
payload,
|
|
982
1000
|
options
|
|
983
1001
|
);
|
|
@@ -991,7 +1009,9 @@ var createReservationApi = (apiConfig) => {
|
|
|
991
1009
|
);
|
|
992
1010
|
},
|
|
993
1011
|
async checkout(params, options) {
|
|
994
|
-
const
|
|
1012
|
+
const { businessId, ...rest } = params || {};
|
|
1013
|
+
const targetBusinessId = businessId || apiConfig.businessId;
|
|
1014
|
+
const items = rest?.items || cart.map((s) => ({
|
|
995
1015
|
serviceId: s.serviceId,
|
|
996
1016
|
providerId: s.providerId,
|
|
997
1017
|
from: s.from,
|
|
@@ -999,60 +1019,70 @@ var createReservationApi = (apiConfig) => {
|
|
|
999
1019
|
}));
|
|
1000
1020
|
const payload = {
|
|
1001
1021
|
market: apiConfig.market,
|
|
1002
|
-
...
|
|
1022
|
+
...rest,
|
|
1003
1023
|
items
|
|
1004
1024
|
};
|
|
1005
1025
|
return apiConfig.httpClient.post(
|
|
1006
|
-
`/v1/businesses/${
|
|
1026
|
+
`/v1/businesses/${targetBusinessId}/reservations/checkout`,
|
|
1007
1027
|
payload,
|
|
1008
1028
|
options
|
|
1009
1029
|
);
|
|
1010
1030
|
},
|
|
1011
1031
|
async getReservation(params, options) {
|
|
1032
|
+
const targetBusinessId = params.businessId || apiConfig.businessId;
|
|
1012
1033
|
return apiConfig.httpClient.get(
|
|
1013
|
-
`/v1/businesses/${
|
|
1034
|
+
`/v1/businesses/${targetBusinessId}/reservations/${params.id}`,
|
|
1014
1035
|
options
|
|
1015
1036
|
);
|
|
1016
1037
|
},
|
|
1017
1038
|
async searchReservations(params, options) {
|
|
1039
|
+
const { businessId, ...queryParams } = params;
|
|
1040
|
+
const targetBusinessId = businessId || apiConfig.businessId;
|
|
1018
1041
|
return apiConfig.httpClient.get(
|
|
1019
|
-
`/v1/businesses/${
|
|
1042
|
+
`/v1/businesses/${targetBusinessId}/reservations`,
|
|
1020
1043
|
{
|
|
1021
1044
|
...options,
|
|
1022
|
-
params
|
|
1045
|
+
params: queryParams
|
|
1023
1046
|
}
|
|
1024
1047
|
);
|
|
1025
1048
|
},
|
|
1026
1049
|
// ===== QUOTES =====
|
|
1027
1050
|
async getQuote(params, options) {
|
|
1051
|
+
const { businessId, ...rest } = params;
|
|
1052
|
+
const targetBusinessId = businessId || apiConfig.businessId;
|
|
1028
1053
|
const payload = {
|
|
1029
1054
|
market: apiConfig.market,
|
|
1030
|
-
...
|
|
1055
|
+
...rest
|
|
1031
1056
|
};
|
|
1032
1057
|
return apiConfig.httpClient.post(
|
|
1033
|
-
`/v1/businesses/${
|
|
1058
|
+
`/v1/businesses/${targetBusinessId}/reservations/quote`,
|
|
1034
1059
|
payload,
|
|
1035
1060
|
options
|
|
1036
1061
|
);
|
|
1037
1062
|
},
|
|
1038
1063
|
// ===== SERVICES =====
|
|
1039
1064
|
async createService(params, options) {
|
|
1065
|
+
const { businessId, ...payload } = params;
|
|
1066
|
+
const targetBusinessId = businessId || apiConfig.businessId;
|
|
1040
1067
|
return apiConfig.httpClient.post(
|
|
1041
|
-
`/v1/businesses/${
|
|
1042
|
-
|
|
1068
|
+
`/v1/businesses/${targetBusinessId}/services`,
|
|
1069
|
+
payload,
|
|
1043
1070
|
options
|
|
1044
1071
|
);
|
|
1045
1072
|
},
|
|
1046
1073
|
async updateService(params, options) {
|
|
1074
|
+
const { businessId, ...payload } = params;
|
|
1075
|
+
const targetBusinessId = businessId || apiConfig.businessId;
|
|
1047
1076
|
return apiConfig.httpClient.put(
|
|
1048
|
-
`/v1/businesses/${
|
|
1049
|
-
|
|
1077
|
+
`/v1/businesses/${targetBusinessId}/services/${params.id}`,
|
|
1078
|
+
payload,
|
|
1050
1079
|
options
|
|
1051
1080
|
);
|
|
1052
1081
|
},
|
|
1053
1082
|
async deleteService(params, options) {
|
|
1083
|
+
const targetBusinessId = params.businessId || apiConfig.businessId;
|
|
1054
1084
|
return apiConfig.httpClient.delete(
|
|
1055
|
-
`/v1/businesses/${
|
|
1085
|
+
`/v1/businesses/${targetBusinessId}/services/${params.id}`,
|
|
1056
1086
|
options
|
|
1057
1087
|
);
|
|
1058
1088
|
},
|
|
@@ -1064,54 +1094,80 @@ var createReservationApi = (apiConfig) => {
|
|
|
1064
1094
|
);
|
|
1065
1095
|
},
|
|
1066
1096
|
async getService(params, options) {
|
|
1067
|
-
const
|
|
1097
|
+
const businessId = params.businessId || apiConfig.businessId;
|
|
1098
|
+
let identifier;
|
|
1099
|
+
if (params.id) {
|
|
1100
|
+
identifier = params.id;
|
|
1101
|
+
} else if (params.slug) {
|
|
1102
|
+
identifier = `${businessId}:${apiConfig.locale}:${params.slug}`;
|
|
1103
|
+
} else {
|
|
1104
|
+
throw new Error("GetServiceParams requires id or slug");
|
|
1105
|
+
}
|
|
1068
1106
|
return apiConfig.httpClient.get(
|
|
1069
|
-
`/v1/businesses/${
|
|
1107
|
+
`/v1/businesses/${businessId}/services/${identifier}`,
|
|
1070
1108
|
options
|
|
1071
1109
|
);
|
|
1072
1110
|
},
|
|
1073
1111
|
async getServices(params, options) {
|
|
1112
|
+
const { businessId, ...queryParams } = params;
|
|
1113
|
+
const targetBusinessId = businessId || apiConfig.businessId;
|
|
1074
1114
|
return apiConfig.httpClient.get(
|
|
1075
|
-
`/v1/businesses/${
|
|
1115
|
+
`/v1/businesses/${targetBusinessId}/services`,
|
|
1076
1116
|
{
|
|
1077
1117
|
...options,
|
|
1078
|
-
params
|
|
1118
|
+
params: queryParams
|
|
1079
1119
|
}
|
|
1080
1120
|
);
|
|
1081
1121
|
},
|
|
1082
1122
|
// ===== PROVIDERS =====
|
|
1083
1123
|
async createProvider(params, options) {
|
|
1124
|
+
const { businessId, ...payload } = params;
|
|
1125
|
+
const targetBusinessId = businessId || apiConfig.businessId;
|
|
1084
1126
|
return apiConfig.httpClient.post(
|
|
1085
|
-
`/v1/businesses/${
|
|
1086
|
-
|
|
1127
|
+
`/v1/businesses/${targetBusinessId}/providers`,
|
|
1128
|
+
payload,
|
|
1087
1129
|
options
|
|
1088
1130
|
);
|
|
1089
1131
|
},
|
|
1090
1132
|
async updateProvider(params, options) {
|
|
1133
|
+
const { businessId, ...payload } = params;
|
|
1134
|
+
const targetBusinessId = businessId || apiConfig.businessId;
|
|
1091
1135
|
return apiConfig.httpClient.put(
|
|
1092
|
-
`/v1/businesses/${
|
|
1093
|
-
|
|
1136
|
+
`/v1/businesses/${targetBusinessId}/providers/${params.id}`,
|
|
1137
|
+
payload,
|
|
1094
1138
|
options
|
|
1095
1139
|
);
|
|
1096
1140
|
},
|
|
1097
1141
|
async deleteProvider(params, options) {
|
|
1142
|
+
const targetBusinessId = params.businessId || apiConfig.businessId;
|
|
1098
1143
|
return apiConfig.httpClient.delete(
|
|
1099
|
-
`/v1/businesses/${
|
|
1144
|
+
`/v1/businesses/${targetBusinessId}/providers/${params.id}`,
|
|
1100
1145
|
options
|
|
1101
1146
|
);
|
|
1102
1147
|
},
|
|
1103
1148
|
async getProvider(params, options) {
|
|
1149
|
+
const businessId = params.businessId || apiConfig.businessId;
|
|
1150
|
+
let identifier;
|
|
1151
|
+
if (params.id) {
|
|
1152
|
+
identifier = params.id;
|
|
1153
|
+
} else if (params.slug) {
|
|
1154
|
+
identifier = `${businessId}:${apiConfig.locale}:${params.slug}`;
|
|
1155
|
+
} else {
|
|
1156
|
+
throw new Error("GetProviderParams requires id or slug");
|
|
1157
|
+
}
|
|
1104
1158
|
return apiConfig.httpClient.get(
|
|
1105
|
-
`/v1/businesses/${
|
|
1159
|
+
`/v1/businesses/${businessId}/providers/${identifier}`,
|
|
1106
1160
|
options
|
|
1107
1161
|
);
|
|
1108
1162
|
},
|
|
1109
1163
|
async getProviders(params, options) {
|
|
1164
|
+
const { businessId, ...queryParams } = params;
|
|
1165
|
+
const targetBusinessId = businessId || apiConfig.businessId;
|
|
1110
1166
|
return apiConfig.httpClient.get(
|
|
1111
|
-
`/v1/businesses/${
|
|
1167
|
+
`/v1/businesses/${targetBusinessId}/providers`,
|
|
1112
1168
|
{
|
|
1113
1169
|
...options,
|
|
1114
|
-
params
|
|
1170
|
+
params: queryParams
|
|
1115
1171
|
}
|
|
1116
1172
|
);
|
|
1117
1173
|
},
|
|
@@ -1137,7 +1193,8 @@ var createDatabaseApi = (apiConfig) => {
|
|
|
1137
1193
|
{
|
|
1138
1194
|
...options,
|
|
1139
1195
|
params: {
|
|
1140
|
-
key: params.key
|
|
1196
|
+
key: params.key,
|
|
1197
|
+
limit: params.limit || 200
|
|
1141
1198
|
}
|
|
1142
1199
|
}
|
|
1143
1200
|
);
|
|
@@ -1311,6 +1368,103 @@ var createLocationApi = (apiConfig) => {
|
|
|
1311
1368
|
};
|
|
1312
1369
|
};
|
|
1313
1370
|
|
|
1371
|
+
// src/api/network.ts
|
|
1372
|
+
var createNetworkApi = (apiConfig) => {
|
|
1373
|
+
return {
|
|
1374
|
+
/**
|
|
1375
|
+
* Search services across all businesses that have opted into a network
|
|
1376
|
+
* @param networkKey - The network key (e.g., "delfin")
|
|
1377
|
+
* @param params - Search parameters
|
|
1378
|
+
*/
|
|
1379
|
+
async searchServices(networkKey, params, options) {
|
|
1380
|
+
const queryParams = {};
|
|
1381
|
+
if (params?.limit !== void 0) queryParams.limit = params.limit;
|
|
1382
|
+
if (params?.cursor) queryParams.cursor = params.cursor;
|
|
1383
|
+
if (params?.query) queryParams.query = params.query;
|
|
1384
|
+
if (params?.nodeId) queryParams.nodeId = params.nodeId;
|
|
1385
|
+
if (params?.nodeIds && params.nodeIds.length > 0)
|
|
1386
|
+
queryParams.nodeIds = params.nodeIds.join(",");
|
|
1387
|
+
if (params?.statuses && params.statuses.length > 0)
|
|
1388
|
+
queryParams.statuses = params.statuses.join(",");
|
|
1389
|
+
if (params?.sortField) queryParams.sortField = params.sortField;
|
|
1390
|
+
if (params?.sortDirection) queryParams.sortDirection = params.sortDirection;
|
|
1391
|
+
if (params?.createdAtFrom !== void 0)
|
|
1392
|
+
queryParams.createdAtFrom = params.createdAtFrom;
|
|
1393
|
+
if (params?.createdAtTo !== void 0)
|
|
1394
|
+
queryParams.createdAtTo = params.createdAtTo;
|
|
1395
|
+
if (params?.priceFrom !== void 0) queryParams.priceFrom = params.priceFrom;
|
|
1396
|
+
if (params?.priceTo !== void 0) queryParams.priceTo = params.priceTo;
|
|
1397
|
+
if (params?.matchAll !== void 0) queryParams.matchAll = params.matchAll;
|
|
1398
|
+
if (params?.blocks && params.blocks.length > 0)
|
|
1399
|
+
queryParams.blocks = JSON.stringify(params.blocks);
|
|
1400
|
+
return apiConfig.httpClient.get(`/v1/networks/${networkKey}/services`, {
|
|
1401
|
+
...options,
|
|
1402
|
+
params: queryParams
|
|
1403
|
+
});
|
|
1404
|
+
},
|
|
1405
|
+
/**
|
|
1406
|
+
* Search products across all businesses that have opted into a network
|
|
1407
|
+
* @param networkKey - The network key (e.g., "delfin")
|
|
1408
|
+
* @param params - Search parameters
|
|
1409
|
+
*/
|
|
1410
|
+
async searchProducts(networkKey, params, options) {
|
|
1411
|
+
const queryParams = {};
|
|
1412
|
+
if (params?.limit !== void 0) queryParams.limit = params.limit;
|
|
1413
|
+
if (params?.cursor) queryParams.cursor = params.cursor;
|
|
1414
|
+
if (params?.query) queryParams.query = params.query;
|
|
1415
|
+
if (params?.nodeId) queryParams.nodeId = params.nodeId;
|
|
1416
|
+
if (params?.nodeIds && params.nodeIds.length > 0)
|
|
1417
|
+
queryParams.nodeIds = params.nodeIds.join(",");
|
|
1418
|
+
if (params?.statuses && params.statuses.length > 0)
|
|
1419
|
+
queryParams.statuses = params.statuses.join(",");
|
|
1420
|
+
if (params?.sortField) queryParams.sortField = params.sortField;
|
|
1421
|
+
if (params?.sortDirection) queryParams.sortDirection = params.sortDirection;
|
|
1422
|
+
if (params?.createdAtFrom !== void 0)
|
|
1423
|
+
queryParams.createdAtFrom = params.createdAtFrom;
|
|
1424
|
+
if (params?.createdAtTo !== void 0)
|
|
1425
|
+
queryParams.createdAtTo = params.createdAtTo;
|
|
1426
|
+
if (params?.priceFrom !== void 0) queryParams.priceFrom = params.priceFrom;
|
|
1427
|
+
if (params?.priceTo !== void 0) queryParams.priceTo = params.priceTo;
|
|
1428
|
+
if (params?.matchAll !== void 0) queryParams.matchAll = params.matchAll;
|
|
1429
|
+
if (params?.blocks && params.blocks.length > 0)
|
|
1430
|
+
queryParams.blocks = JSON.stringify(params.blocks);
|
|
1431
|
+
return apiConfig.httpClient.get(`/v1/networks/${networkKey}/products`, {
|
|
1432
|
+
...options,
|
|
1433
|
+
params: queryParams
|
|
1434
|
+
});
|
|
1435
|
+
},
|
|
1436
|
+
/**
|
|
1437
|
+
* Search providers across all businesses that have opted into a network
|
|
1438
|
+
* @param networkKey - The network key (e.g., "delfin")
|
|
1439
|
+
* @param params - Search parameters
|
|
1440
|
+
*/
|
|
1441
|
+
async searchProviders(networkKey, params, options) {
|
|
1442
|
+
const queryParams = {};
|
|
1443
|
+
if (params?.limit !== void 0) queryParams.limit = params.limit;
|
|
1444
|
+
if (params?.cursor) queryParams.cursor = params.cursor;
|
|
1445
|
+
if (params?.query) queryParams.query = params.query;
|
|
1446
|
+
if (params?.nodeId) queryParams.nodeId = params.nodeId;
|
|
1447
|
+
if (params?.nodeIds && params.nodeIds.length > 0)
|
|
1448
|
+
queryParams.nodeIds = params.nodeIds.join(",");
|
|
1449
|
+
if (params?.statuses && params.statuses.length > 0)
|
|
1450
|
+
queryParams.statuses = params.statuses.join(",");
|
|
1451
|
+
if (params?.sortField) queryParams.sortField = params.sortField;
|
|
1452
|
+
if (params?.sortDirection) queryParams.sortDirection = params.sortDirection;
|
|
1453
|
+
if (params?.createdAtFrom !== void 0)
|
|
1454
|
+
queryParams.createdAtFrom = params.createdAtFrom;
|
|
1455
|
+
if (params?.createdAtTo !== void 0)
|
|
1456
|
+
queryParams.createdAtTo = params.createdAtTo;
|
|
1457
|
+
if (params?.matchAll !== void 0) queryParams.matchAll = params.matchAll;
|
|
1458
|
+
if (params?.blocks && params.blocks.length > 0)
|
|
1459
|
+
queryParams.blocks = JSON.stringify(params.blocks);
|
|
1460
|
+
return apiConfig.httpClient.get(`/v1/networks/${networkKey}/providers`, {
|
|
1461
|
+
...options,
|
|
1462
|
+
params: queryParams
|
|
1463
|
+
});
|
|
1464
|
+
}
|
|
1465
|
+
};
|
|
1466
|
+
};
|
|
1467
|
+
|
|
1314
1468
|
// src/utils/currency.ts
|
|
1315
1469
|
function getCurrencySymbol(currency) {
|
|
1316
1470
|
const currencySymbols = {
|
|
@@ -1697,7 +1851,7 @@ function nameToKey(name) {
|
|
|
1697
1851
|
}
|
|
1698
1852
|
|
|
1699
1853
|
// src/index.ts
|
|
1700
|
-
var SDK_VERSION = "0.3.
|
|
1854
|
+
var SDK_VERSION = "0.3.136";
|
|
1701
1855
|
var SUPPORTED_FRAMEWORKS = [
|
|
1702
1856
|
"astro",
|
|
1703
1857
|
"react",
|
|
@@ -1748,6 +1902,7 @@ async function createArkySDK(config) {
|
|
|
1748
1902
|
database: createDatabaseApi(apiConfig),
|
|
1749
1903
|
featureFlags: createFeatureFlagsApi(apiConfig),
|
|
1750
1904
|
location: createLocationApi(apiConfig),
|
|
1905
|
+
network: createNetworkApi(apiConfig),
|
|
1751
1906
|
setBusinessId: (businessId) => {
|
|
1752
1907
|
apiConfig.businessId = businessId;
|
|
1753
1908
|
},
|