arky-sdk 0.3.129 → 0.3.131

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
@@ -7,12 +7,6 @@ var PaymentMethodType = /* @__PURE__ */ ((PaymentMethodType2) => {
7
7
  PaymentMethodType2["Free"] = "FREE";
8
8
  return PaymentMethodType2;
9
9
  })(PaymentMethodType || {});
10
- var TaxonomyScope = /* @__PURE__ */ ((TaxonomyScope2) => {
11
- TaxonomyScope2["SERVICE"] = "SERVICE";
12
- TaxonomyScope2["PROVIDER"] = "PROVIDER";
13
- TaxonomyScope2["PRODUCT"] = "PRODUCT";
14
- return TaxonomyScope2;
15
- })(TaxonomyScope || {});
16
10
 
17
11
  // src/utils/errors.ts
18
12
  var convertServerErrorToRequestError = (serverError, renameRules) => {
@@ -408,7 +402,7 @@ var createMediaApi = (apiConfig) => {
408
402
  const url = `${apiConfig.baseUrl}/v1/businesses/${apiConfig.businessId}/media`;
409
403
  const formData = new FormData();
410
404
  files.forEach((file) => formData.append("files", file));
411
- urls.forEach((url2) => formData.append("files", url2));
405
+ urls.forEach((url2) => formData.append("urls", url2));
412
406
  const tokens = await apiConfig.getToken();
413
407
  const response = await fetch(url, {
414
408
  method: "POST",
@@ -689,7 +683,7 @@ function unwrapBlock(block, locale) {
689
683
  return parsed;
690
684
  });
691
685
  }
692
- const isLocalized = block.type === "TEXT";
686
+ const isLocalized = block.type === "LOCALIZED_TEXT" || block.type === "MARKDOWN";
693
687
  const isList = block.properties?.ui === "list" || (block.properties?.maxValues ?? 1) > 1 || block.value.length > 1;
694
688
  if (isList) {
695
689
  return isLocalized ? block.value.map((v) => v[locale] || v["en"]) : [...block.value];
@@ -1455,213 +1449,6 @@ var createNewsletterApi = (apiConfig) => {
1455
1449
  };
1456
1450
  };
1457
1451
 
1458
- // src/api/emailTemplate.ts
1459
- var createEmailTemplateApi = (apiConfig) => {
1460
- return {
1461
- /**
1462
- * List all email templates for the business
1463
- * Returns paginated list of email templates
1464
- */
1465
- async getTemplates(params, options) {
1466
- const businessId = params?.businessId || apiConfig.businessId;
1467
- const queryParams = {};
1468
- if (params?.key) queryParams.key = params.key;
1469
- if (params?.keys) queryParams.keys = params.keys;
1470
- if (params?.query) queryParams.query = params.query;
1471
- if (params?.limit) queryParams.limit = params.limit;
1472
- if (params?.cursor) queryParams.cursor = params.cursor;
1473
- return apiConfig.httpClient.get(
1474
- `/v1/businesses/${businessId}/email-templates`,
1475
- { ...options, params: queryParams }
1476
- );
1477
- },
1478
- /**
1479
- * Get a specific email template by ID
1480
- */
1481
- async getTemplate(params, options) {
1482
- const businessId = params.businessId || apiConfig.businessId;
1483
- return apiConfig.httpClient.get(
1484
- `/v1/businesses/${businessId}/email-templates/${params.id}`,
1485
- options
1486
- );
1487
- },
1488
- /**
1489
- * Get a specific email template by key
1490
- */
1491
- async getTemplateByKey(params, options) {
1492
- const businessId = params.businessId || apiConfig.businessId;
1493
- return apiConfig.httpClient.get(
1494
- `/v1/businesses/${businessId}/email-templates/by-key/${params.key}`,
1495
- options
1496
- );
1497
- },
1498
- /**
1499
- * Create a new email template
1500
- */
1501
- async createTemplate(params, options) {
1502
- const { businessId: paramBusinessId, ...body } = params;
1503
- const businessId = paramBusinessId || apiConfig.businessId;
1504
- return apiConfig.httpClient.post(
1505
- `/v1/businesses/${businessId}/email-templates`,
1506
- body,
1507
- options
1508
- );
1509
- },
1510
- /**
1511
- * Update an existing email template
1512
- */
1513
- async updateTemplate(params, options) {
1514
- const { id, businessId: paramBusinessId, ...body } = params;
1515
- const businessId = paramBusinessId || apiConfig.businessId;
1516
- return apiConfig.httpClient.put(
1517
- `/v1/businesses/${businessId}/email-templates/${id}`,
1518
- body,
1519
- options
1520
- );
1521
- },
1522
- /**
1523
- * Delete an email template
1524
- */
1525
- async deleteTemplate(params, options) {
1526
- const businessId = params.businessId || apiConfig.businessId;
1527
- return apiConfig.httpClient.delete(
1528
- `/v1/businesses/${businessId}/email-templates/${params.id}`,
1529
- options
1530
- );
1531
- }
1532
- };
1533
- };
1534
-
1535
- // src/api/taxonomy.ts
1536
- var createTaxonomyApi = (apiConfig) => {
1537
- return {
1538
- async getTaxonomies(params, options) {
1539
- return apiConfig.httpClient.get(
1540
- `/v1/businesses/${apiConfig.businessId}/taxonomies`,
1541
- {
1542
- ...options,
1543
- params
1544
- }
1545
- );
1546
- },
1547
- async getTaxonomy(params, options) {
1548
- return apiConfig.httpClient.get(
1549
- `/v1/businesses/${apiConfig.businessId}/taxonomies/${params.id}`,
1550
- options
1551
- );
1552
- },
1553
- async createTaxonomy(params, options) {
1554
- return apiConfig.httpClient.post(
1555
- `/v1/businesses/${apiConfig.businessId}/taxonomies`,
1556
- params,
1557
- options
1558
- );
1559
- },
1560
- async updateTaxonomy(params, options) {
1561
- return apiConfig.httpClient.put(
1562
- `/v1/businesses/${apiConfig.businessId}/taxonomies/${params.id}`,
1563
- params,
1564
- options
1565
- );
1566
- },
1567
- async deleteTaxonomy(params, options) {
1568
- return apiConfig.httpClient.delete(
1569
- `/v1/businesses/${apiConfig.businessId}/taxonomies/${params.id}`,
1570
- options
1571
- );
1572
- },
1573
- async getTaxonomyChildren(params, options) {
1574
- return apiConfig.httpClient.get(
1575
- `/v1/businesses/${apiConfig.businessId}/taxonomies/${params.id}/children`,
1576
- options
1577
- );
1578
- },
1579
- async getRootTaxonomies(scope, options) {
1580
- const result = await apiConfig.httpClient.get(
1581
- `/v1/businesses/${apiConfig.businessId}/taxonomies`,
1582
- {
1583
- ...options,
1584
- params: { scope, root: true }
1585
- }
1586
- );
1587
- return result.items || [];
1588
- }
1589
- };
1590
- };
1591
-
1592
- // src/api/form.ts
1593
- var createFormApi = (apiConfig) => {
1594
- return {
1595
- // Form CRUD
1596
- async getForms(params, options) {
1597
- return apiConfig.httpClient.get(
1598
- `/v1/businesses/${apiConfig.businessId}/forms`,
1599
- {
1600
- ...options,
1601
- params
1602
- }
1603
- );
1604
- },
1605
- async getForm(params, options) {
1606
- return apiConfig.httpClient.get(
1607
- `/v1/businesses/${apiConfig.businessId}/forms/${params.id}`,
1608
- options
1609
- );
1610
- },
1611
- async createForm(params, options) {
1612
- return apiConfig.httpClient.post(
1613
- `/v1/businesses/${apiConfig.businessId}/forms`,
1614
- params,
1615
- options
1616
- );
1617
- },
1618
- async updateForm(params, options) {
1619
- return apiConfig.httpClient.put(
1620
- `/v1/businesses/${apiConfig.businessId}/forms/${params.id}`,
1621
- params,
1622
- options
1623
- );
1624
- },
1625
- async deleteForm(params, options) {
1626
- return apiConfig.httpClient.delete(
1627
- `/v1/businesses/${apiConfig.businessId}/forms/${params.id}`,
1628
- options
1629
- );
1630
- },
1631
- // Form Entry CRUD
1632
- async getEntries(params, options) {
1633
- const { formId, ...queryParams } = params;
1634
- return apiConfig.httpClient.get(
1635
- `/v1/businesses/${apiConfig.businessId}/forms/${formId}/entries`,
1636
- {
1637
- ...options,
1638
- params: queryParams
1639
- }
1640
- );
1641
- },
1642
- async createEntry(params, options) {
1643
- const { formId, ...body } = params;
1644
- return apiConfig.httpClient.post(
1645
- `/v1/businesses/${apiConfig.businessId}/forms/${formId}/entries`,
1646
- body,
1647
- options
1648
- );
1649
- },
1650
- async getEntry(params, options) {
1651
- return apiConfig.httpClient.get(
1652
- `/v1/businesses/${apiConfig.businessId}/forms/${params.formId}/entries/${params.entryId}`,
1653
- options
1654
- );
1655
- },
1656
- async deleteEntry(params, options) {
1657
- return apiConfig.httpClient.delete(
1658
- `/v1/businesses/${apiConfig.businessId}/forms/${params.formId}/entries/${params.entryId}`,
1659
- options
1660
- );
1661
- }
1662
- };
1663
- };
1664
-
1665
1452
  // src/utils/currency.ts
1666
1453
  function getCurrencySymbol(currency) {
1667
1454
  const currencySymbols = {
@@ -2048,7 +1835,7 @@ function nameToKey(name) {
2048
1835
  }
2049
1836
 
2050
1837
  // src/index.ts
2051
- var SDK_VERSION = "0.3.88";
1838
+ var SDK_VERSION = "0.3.131";
2052
1839
  var SUPPORTED_FRAMEWORKS = [
2053
1840
  "astro",
2054
1841
  "react",
@@ -2100,9 +1887,6 @@ async function createArkySDK(config) {
2100
1887
  featureFlags: createFeatureFlagsApi(apiConfig),
2101
1888
  location: createLocationApi(apiConfig),
2102
1889
  newsletter: createNewsletterApi(apiConfig),
2103
- emailTemplate: createEmailTemplateApi(apiConfig),
2104
- taxonomy: createTaxonomyApi(apiConfig),
2105
- form: createFormApi(apiConfig),
2106
1890
  setBusinessId: (businessId) => {
2107
1891
  apiConfig.businessId = businessId;
2108
1892
  },
@@ -2167,7 +1951,6 @@ async function createArkySDK(config) {
2167
1951
  exports.PaymentMethodType = PaymentMethodType;
2168
1952
  exports.SDK_VERSION = SDK_VERSION;
2169
1953
  exports.SUPPORTED_FRAMEWORKS = SUPPORTED_FRAMEWORKS;
2170
- exports.TaxonomyScope = TaxonomyScope;
2171
1954
  exports.createArkySDK = createArkySDK;
2172
1955
  //# sourceMappingURL=index.cjs.map
2173
1956
  //# sourceMappingURL=index.cjs.map