arky-sdk 0.3.129 → 0.3.130

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