arky-sdk 0.3.167 → 0.4.1

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
@@ -1376,6 +1376,61 @@ var createWorkflowApi = (apiConfig) => {
1376
1376
  };
1377
1377
  };
1378
1378
 
1379
+ // src/api/audience.ts
1380
+ var createAudienceApi = (apiConfig) => {
1381
+ return {
1382
+ async createAudience(params, options) {
1383
+ return apiConfig.httpClient.post(
1384
+ `/v1/businesses/${apiConfig.businessId}/audiences`,
1385
+ params,
1386
+ options
1387
+ );
1388
+ },
1389
+ async updateAudience(params, options) {
1390
+ return apiConfig.httpClient.put(
1391
+ `/v1/businesses/${apiConfig.businessId}/audiences/${params.id}`,
1392
+ params,
1393
+ options
1394
+ );
1395
+ },
1396
+ async deleteAudience(params, options) {
1397
+ return apiConfig.httpClient.delete(
1398
+ `/v1/businesses/${apiConfig.businessId}/audiences/${params.id}`,
1399
+ options
1400
+ );
1401
+ },
1402
+ async getAudience(params, options) {
1403
+ return apiConfig.httpClient.get(
1404
+ `/v1/businesses/${apiConfig.businessId}/audiences/${params.id}`,
1405
+ options
1406
+ );
1407
+ },
1408
+ async getAudiences(params, options) {
1409
+ return apiConfig.httpClient.get(
1410
+ `/v1/businesses/${apiConfig.businessId}/audiences`,
1411
+ { ...options, params }
1412
+ );
1413
+ },
1414
+ async subscribe(params, options) {
1415
+ return apiConfig.httpClient.post(
1416
+ `/v1/businesses/${apiConfig.businessId}/audiences/${params.id}/subscribe`,
1417
+ {
1418
+ priceId: params.priceId,
1419
+ successUrl: params.successUrl,
1420
+ cancelUrl: params.cancelUrl
1421
+ },
1422
+ options
1423
+ );
1424
+ },
1425
+ async checkAccess(params, options) {
1426
+ return apiConfig.httpClient.get(
1427
+ `/v1/businesses/${apiConfig.businessId}/audiences/${params.id}/access`,
1428
+ options
1429
+ );
1430
+ }
1431
+ };
1432
+ };
1433
+
1379
1434
  // src/utils/currency.ts
1380
1435
  function getCurrencySymbol(currency) {
1381
1436
  const currencySymbols = {
@@ -1799,6 +1854,7 @@ async function createArkySDK(config) {
1799
1854
  location: createLocationApi(apiConfig),
1800
1855
  network: createNetworkApi(apiConfig),
1801
1856
  workflow: createWorkflowApi(apiConfig),
1857
+ audience: createAudienceApi(apiConfig),
1802
1858
  setBusinessId: (businessId) => {
1803
1859
  apiConfig.businessId = businessId;
1804
1860
  },