arky-sdk 0.5.17 → 0.5.20

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
@@ -1056,46 +1056,6 @@ var createBookingApi = (apiConfig) => {
1056
1056
  };
1057
1057
  };
1058
1058
 
1059
- // src/api/database.ts
1060
- var createDatabaseApi = (apiConfig) => {
1061
- return {
1062
- async scanData(params, options) {
1063
- const response = await apiConfig.httpClient.get(
1064
- `/v1/platform/data`,
1065
- {
1066
- ...options,
1067
- params: {
1068
- key: params.key,
1069
- limit: params.limit || 200
1070
- }
1071
- }
1072
- );
1073
- return response.value || [];
1074
- },
1075
- async putData(params, options) {
1076
- return apiConfig.httpClient.post(
1077
- `/v1/platform/data`,
1078
- params,
1079
- options
1080
- );
1081
- },
1082
- async deleteData(params, options) {
1083
- return apiConfig.httpClient.delete(
1084
- `/v1/platform/data`,
1085
- {
1086
- ...options,
1087
- params: {
1088
- key: params.key
1089
- }
1090
- }
1091
- );
1092
- },
1093
- async runScript(params, options) {
1094
- return apiConfig.httpClient.post(`/v1/platform/scripts`, params, options);
1095
- }
1096
- };
1097
- };
1098
-
1099
1059
  // src/api/location.ts
1100
1060
  var createLocationApi = (apiConfig) => {
1101
1061
  return {
@@ -1346,6 +1306,9 @@ var createPlatformApi = (apiConfig) => {
1346
1306
  },
1347
1307
  async getIntegrationServices(options) {
1348
1308
  return apiConfig.httpClient.get("/v1/platform/integration-services", options);
1309
+ },
1310
+ async getWebhookEvents(options) {
1311
+ return apiConfig.httpClient.get("/v1/platform/events", options);
1349
1312
  }
1350
1313
  };
1351
1314
  };
@@ -1378,14 +1341,79 @@ var createShippingApi = (apiConfig) => {
1378
1341
  };
1379
1342
  };
1380
1343
 
1381
- // src/api/events.ts
1382
- function createEventsApi(apiConfig) {
1344
+ // src/api/agent.ts
1345
+ var createAgentApi = (apiConfig) => {
1383
1346
  return {
1384
- async getWebhookEvents(options) {
1385
- return apiConfig.httpClient.get(`/v1/platform/events`, options);
1347
+ async createAgent(params, options) {
1348
+ const businessId = params.businessId || apiConfig.businessId;
1349
+ return apiConfig.httpClient.post(
1350
+ `/v1/businesses/${businessId}/agents`,
1351
+ { ...params, businessId },
1352
+ options
1353
+ );
1354
+ },
1355
+ async updateAgent(params, options) {
1356
+ return apiConfig.httpClient.put(
1357
+ `/v1/businesses/${apiConfig.businessId}/agents/${params.id}`,
1358
+ params,
1359
+ options
1360
+ );
1361
+ },
1362
+ async deleteAgent(params, options) {
1363
+ return apiConfig.httpClient.delete(
1364
+ `/v1/businesses/${apiConfig.businessId}/agents/${params.id}`,
1365
+ options
1366
+ );
1367
+ },
1368
+ async getAgent(params, options) {
1369
+ return apiConfig.httpClient.get(
1370
+ `/v1/businesses/${apiConfig.businessId}/agents/${params.id}`,
1371
+ options
1372
+ );
1373
+ },
1374
+ async getAgents(params, options) {
1375
+ const businessId = params?.businessId || apiConfig.businessId;
1376
+ const { businessId: _, ...queryParams } = params || {};
1377
+ return apiConfig.httpClient.get(`/v1/businesses/${businessId}/agents`, {
1378
+ ...options,
1379
+ params: Object.keys(queryParams).length > 0 ? queryParams : void 0
1380
+ });
1381
+ },
1382
+ async setupWebhook(params, options) {
1383
+ const businessId = params.businessId || apiConfig.businessId;
1384
+ return apiConfig.httpClient.post(
1385
+ `/v1/businesses/${businessId}/agents/${params.id}/webhook`,
1386
+ params,
1387
+ options
1388
+ );
1389
+ },
1390
+ async runAgent(params, options) {
1391
+ return apiConfig.httpClient.post(
1392
+ `/v1/businesses/${apiConfig.businessId}/agents/${params.id}/run`,
1393
+ { message: params.message },
1394
+ options
1395
+ );
1396
+ },
1397
+ async getMemories(params, options) {
1398
+ const queryParams = {};
1399
+ if (params.category) queryParams.category = params.category;
1400
+ if (params.limit) queryParams.limit = String(params.limit);
1401
+ return apiConfig.httpClient.get(
1402
+ `/v1/businesses/${apiConfig.businessId}/agents/${params.id}/memories`,
1403
+ {
1404
+ ...options,
1405
+ params: Object.keys(queryParams).length > 0 ? queryParams : void 0
1406
+ }
1407
+ );
1408
+ },
1409
+ async deleteMemory(params, options) {
1410
+ return apiConfig.httpClient.delete(
1411
+ `/v1/businesses/${apiConfig.businessId}/agents/${params.id}/memories/${params.memoryId}`,
1412
+ options
1413
+ );
1386
1414
  }
1387
1415
  };
1388
- }
1416
+ };
1389
1417
 
1390
1418
  // src/utils/price.ts
1391
1419
  function formatCurrency(amount, currencyCode, locale = "en") {
@@ -1673,7 +1701,7 @@ function getAnalyticsConfigs(configs) {
1673
1701
  }
1674
1702
 
1675
1703
  // src/index.ts
1676
- var SDK_VERSION = "0.4.74";
1704
+ var SDK_VERSION = "0.5.20";
1677
1705
  var SUPPORTED_FRAMEWORKS = [
1678
1706
  "astro",
1679
1707
  "react",
@@ -1721,13 +1749,12 @@ async function createArkySDK(config) {
1721
1749
  cms: createCmsApi(apiConfig),
1722
1750
  eshop: createEshopApi(apiConfig),
1723
1751
  booking: createBookingApi(apiConfig),
1724
- database: createDatabaseApi(apiConfig),
1725
1752
  location: createLocationApi(apiConfig),
1726
1753
  network: createNetworkApi(apiConfig),
1727
1754
  workflow: createWorkflowApi(apiConfig),
1728
1755
  audience: createAudienceApi(apiConfig),
1729
1756
  shipping: createShippingApi(apiConfig),
1730
- events: createEventsApi(apiConfig),
1757
+ agent: createAgentApi(apiConfig),
1731
1758
  analytics: {
1732
1759
  track
1733
1760
  },