@gethydra/sdk 0.1.14 → 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) {
@@ -1673,6 +1705,7 @@ var Hydra = class {
1673
1705
  tags = new TagsResource(this);
1674
1706
  redirects = new RedirectsResource(this);
1675
1707
  // P6: Advanced
1708
+ channels = new ChannelsResource(this);
1676
1709
  locations = new LocationsResource(this);
1677
1710
  companies = new CompaniesResource(this);
1678
1711
  purchaseOrders = new PurchaseOrdersResource(this);
@@ -1899,6 +1932,7 @@ export {
1899
1932
  AddressesResource,
1900
1933
  AnalyticsResource,
1901
1934
  CartResource,
1935
+ ChannelsResource,
1902
1936
  CheckoutResource,
1903
1937
  CheckoutsResource,
1904
1938
  CollectionsResource,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gethydra/sdk",
3
- "version": "0.1.14",
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",