arky-sdk 0.5.15 → 0.5.17

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
@@ -220,12 +220,6 @@ var createAccountApi = (apiConfig) => {
220
220
  async deleteAccount(params, options) {
221
221
  return apiConfig.httpClient.delete("/v1/accounts", options);
222
222
  },
223
- async addPhoneNumber(params, options) {
224
- return apiConfig.httpClient.post("/v1/accounts/phone-number", params, options);
225
- },
226
- async phoneNumberConfirm(params, options) {
227
- return apiConfig.httpClient.post("/v1/accounts/phone-number/confirm", params, options);
228
- },
229
223
  async getMe(params, options) {
230
224
  return apiConfig.httpClient.get("/v1/accounts/me", options);
231
225
  },
@@ -237,9 +231,6 @@ var createAccountApi = (apiConfig) => {
237
231
  businessId: apiConfig.businessId
238
232
  }
239
233
  });
240
- },
241
- async subscribe(params, options) {
242
- return apiConfig.httpClient.post("/v1/accounts/subscribe", params, options);
243
234
  }
244
235
  };
245
236
  };
@@ -327,12 +318,6 @@ var createBusinessApi = (apiConfig) => {
327
318
  params
328
319
  });
329
320
  },
330
- async getBusinessParents(params, options) {
331
- return apiConfig.httpClient.get(
332
- `/v1/businesses/${apiConfig.businessId}/parents`,
333
- options
334
- );
335
- },
336
321
  async triggerBuilds(params, options) {
337
322
  return apiConfig.httpClient.post(
338
323
  `/v1/businesses/${params.id}/trigger-builds`,
@@ -343,12 +328,6 @@ var createBusinessApi = (apiConfig) => {
343
328
  async getSubscriptionPlans(params, options) {
344
329
  return apiConfig.httpClient.get("/v1/businesses/plans", options);
345
330
  },
346
- async getSubscription(params, options) {
347
- return apiConfig.httpClient.get(
348
- `/v1/businesses/${apiConfig.businessId}/subscription`,
349
- options
350
- );
351
- },
352
331
  async subscribe(params, options) {
353
332
  return apiConfig.httpClient.put(
354
333
  `/v1/businesses/${apiConfig.businessId}/subscribe`,
@@ -433,6 +412,13 @@ var createBusinessApi = (apiConfig) => {
433
412
  // src/api/media.ts
434
413
  var createMediaApi = (apiConfig) => {
435
414
  return {
415
+ async getMedia(params, options) {
416
+ const targetBusinessId = params.businessId || apiConfig.businessId;
417
+ return apiConfig.httpClient.get(
418
+ `/v1/businesses/${targetBusinessId}/media/${params.mediaId}`,
419
+ options
420
+ );
421
+ },
436
422
  async uploadBusinessMedia(params, options) {
437
423
  const { businessId, files = [], urls = [] } = params;
438
424
  const targetBusinessId = businessId || apiConfig.businessId;
@@ -501,13 +487,14 @@ var createNotificationApi = (apiConfig) => {
501
487
  return {
502
488
  async trackEmailOpen(params, options) {
503
489
  return apiConfig.httpClient.get(
504
- `/v1/notifications/track/email/${params.trackingPixelId}`,
490
+ `/v1/notifications/track/pixel/${params.trackingPixelId}`,
505
491
  options
506
492
  );
507
493
  },
508
- async getDeliveryStats(params, options) {
509
- return apiConfig.httpClient.get(
510
- `/v1/notifications/track/stats/${apiConfig.businessId}`,
494
+ async trigger(params, options) {
495
+ return apiConfig.httpClient.post(
496
+ "/v1/notifications/trigger",
497
+ params,
511
498
  options
512
499
  );
513
500
  }
@@ -1287,8 +1274,16 @@ var createAudienceApi = (apiConfig) => {
1287
1274
  );
1288
1275
  },
1289
1276
  async getAudience(params, options) {
1277
+ let identifier;
1278
+ if (params.id) {
1279
+ identifier = params.id;
1280
+ } else if (params.key) {
1281
+ identifier = `${apiConfig.businessId}:${params.key}`;
1282
+ } else {
1283
+ throw new Error("GetAudienceParams requires id or key");
1284
+ }
1290
1285
  return apiConfig.httpClient.get(
1291
- `/v1/businesses/${apiConfig.businessId}/audiences/${params.id}`,
1286
+ `/v1/businesses/${apiConfig.businessId}/audiences/${identifier}`,
1292
1287
  options
1293
1288
  );
1294
1289
  },
@@ -1364,7 +1359,7 @@ var createShippingApi = (apiConfig) => {
1364
1359
  async getRates(params, options) {
1365
1360
  const { orderId, ...payload } = params;
1366
1361
  return apiConfig.httpClient.post(
1367
- `/v1/businesses/${apiConfig.businessId}/orders/${orderId}/rates`,
1362
+ `/v1/businesses/${apiConfig.businessId}/orders/${orderId}/shipping/rates`,
1368
1363
  payload,
1369
1364
  options
1370
1365
  );
@@ -1386,26 +1381,6 @@ var createShippingApi = (apiConfig) => {
1386
1381
  // src/api/events.ts
1387
1382
  function createEventsApi(apiConfig) {
1388
1383
  return {
1389
- async getEvents(params, options) {
1390
- return apiConfig.httpClient.get(`/v1/events`, {
1391
- ...options,
1392
- params: {
1393
- entity: params.entity,
1394
- limit: params.limit,
1395
- cursor: params.cursor
1396
- }
1397
- });
1398
- },
1399
- async updateEvent(params, options) {
1400
- return apiConfig.httpClient.put(
1401
- `/v1/events/${params.eventId}`,
1402
- {
1403
- eventId: params.eventId,
1404
- event: params.event
1405
- },
1406
- options
1407
- );
1408
- },
1409
1384
  async getWebhookEvents(options) {
1410
1385
  return apiConfig.httpClient.get(`/v1/platform/events`, options);
1411
1386
  }