@gethydra/sdk 0.1.13 → 0.1.15

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
@@ -1417,6 +1417,38 @@ var SearchResource = class {
1417
1417
  }
1418
1418
  };
1419
1419
 
1420
+ // src/resources/channels.ts
1421
+ var ChannelsResource = class {
1422
+ constructor(client) {
1423
+ this.client = client;
1424
+ }
1425
+ client;
1426
+ async list(params) {
1427
+ return this.client.request("GET", "/v1/channels", { params });
1428
+ }
1429
+ iterate(params, options) {
1430
+ return paginate((cursor) => this.list({ ...params, cursor }), options);
1431
+ }
1432
+ async toArray(params, options) {
1433
+ return toArray(this.iterate(params, options), options);
1434
+ }
1435
+ async get(slug, params) {
1436
+ return this.client.request("GET", `/v1/channels/${slug}`, { params });
1437
+ }
1438
+ async create(body, options) {
1439
+ return this.client.request("POST", "/v1/channels", { body, ...options });
1440
+ }
1441
+ async update(slug, body) {
1442
+ return this.client.request("PATCH", `/v1/channels/${slug}`, { body });
1443
+ }
1444
+ async archive(slug) {
1445
+ return this.client.request("DELETE", `/v1/channels/${slug}`);
1446
+ }
1447
+ async setDefault(slug) {
1448
+ return this.client.request("PUT", `/v1/channels/${slug}/default`, { body: {} });
1449
+ }
1450
+ };
1451
+
1420
1452
  // src/resources/locations.ts
1421
1453
  var LocationsResource = class {
1422
1454
  constructor(client) {
@@ -1557,6 +1589,26 @@ var ContentCategoriesResource = class {
1557
1589
  async delete(id) {
1558
1590
  return this.client.request("DELETE", `/v1/content-categories/${id}`);
1559
1591
  }
1592
+ // ── Post sub-resources ──
1593
+ async listPosts(categoryId, params) {
1594
+ return this.client.request("GET", `/v1/content-categories/${categoryId}/posts`, { params });
1595
+ }
1596
+ async addPosts(categoryId, body) {
1597
+ return this.client.request("POST", `/v1/content-categories/${categoryId}/posts`, { body });
1598
+ }
1599
+ async removePost(categoryId, postId) {
1600
+ return this.client.request(
1601
+ "DELETE",
1602
+ `/v1/content-categories/${categoryId}/posts/${postId}`
1603
+ );
1604
+ }
1605
+ async reorderPosts(categoryId, body) {
1606
+ return this.client.request(
1607
+ "PATCH",
1608
+ `/v1/content-categories/${categoryId}/posts/reorder`,
1609
+ { body }
1610
+ );
1611
+ }
1560
1612
  };
1561
1613
 
1562
1614
  // src/resources/membership-plans.ts
@@ -1653,6 +1705,7 @@ var Hydra = class {
1653
1705
  tags = new TagsResource(this);
1654
1706
  redirects = new RedirectsResource(this);
1655
1707
  // P6: Advanced
1708
+ channels = new ChannelsResource(this);
1656
1709
  locations = new LocationsResource(this);
1657
1710
  companies = new CompaniesResource(this);
1658
1711
  purchaseOrders = new PurchaseOrdersResource(this);
@@ -1879,6 +1932,7 @@ export {
1879
1932
  AddressesResource,
1880
1933
  AnalyticsResource,
1881
1934
  CartResource,
1935
+ ChannelsResource,
1882
1936
  CheckoutResource,
1883
1937
  CheckoutsResource,
1884
1938
  CollectionsResource,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gethydra/sdk",
3
- "version": "0.1.13",
3
+ "version": "0.1.15",
4
4
  "description": "Official TypeScript SDK for the Hydra Commerce API",
5
5
  "license": "MIT",
6
6
  "author": "Grant Capital Group",