@gethydra/sdk 0.1.14 → 0.1.16
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/README.md +3 -3
- package/dist/index.d.ts +735 -211
- package/dist/index.js +37 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1415,6 +1415,41 @@ var SearchResource = class {
|
|
|
1415
1415
|
async suggest(params) {
|
|
1416
1416
|
return this.client.request("GET", "/v1/search/suggest", { params });
|
|
1417
1417
|
}
|
|
1418
|
+
async bootstrap() {
|
|
1419
|
+
return this.client.request("POST", "/v1/search/bootstrap");
|
|
1420
|
+
}
|
|
1421
|
+
};
|
|
1422
|
+
|
|
1423
|
+
// src/resources/channels.ts
|
|
1424
|
+
var ChannelsResource = class {
|
|
1425
|
+
constructor(client) {
|
|
1426
|
+
this.client = client;
|
|
1427
|
+
}
|
|
1428
|
+
client;
|
|
1429
|
+
async list(params) {
|
|
1430
|
+
return this.client.request("GET", "/v1/channels", { params });
|
|
1431
|
+
}
|
|
1432
|
+
iterate(params, options) {
|
|
1433
|
+
return paginate((cursor) => this.list({ ...params, cursor }), options);
|
|
1434
|
+
}
|
|
1435
|
+
async toArray(params, options) {
|
|
1436
|
+
return toArray(this.iterate(params, options), options);
|
|
1437
|
+
}
|
|
1438
|
+
async get(slug, params) {
|
|
1439
|
+
return this.client.request("GET", `/v1/channels/${slug}`, { params });
|
|
1440
|
+
}
|
|
1441
|
+
async create(body, options) {
|
|
1442
|
+
return this.client.request("POST", "/v1/channels", { body, ...options });
|
|
1443
|
+
}
|
|
1444
|
+
async update(slug, body) {
|
|
1445
|
+
return this.client.request("PATCH", `/v1/channels/${slug}`, { body });
|
|
1446
|
+
}
|
|
1447
|
+
async archive(slug) {
|
|
1448
|
+
return this.client.request("DELETE", `/v1/channels/${slug}`);
|
|
1449
|
+
}
|
|
1450
|
+
async setDefault(slug) {
|
|
1451
|
+
return this.client.request("PUT", `/v1/channels/${slug}/default`, { body: {} });
|
|
1452
|
+
}
|
|
1418
1453
|
};
|
|
1419
1454
|
|
|
1420
1455
|
// src/resources/locations.ts
|
|
@@ -1673,6 +1708,7 @@ var Hydra = class {
|
|
|
1673
1708
|
tags = new TagsResource(this);
|
|
1674
1709
|
redirects = new RedirectsResource(this);
|
|
1675
1710
|
// P6: Advanced
|
|
1711
|
+
channels = new ChannelsResource(this);
|
|
1676
1712
|
locations = new LocationsResource(this);
|
|
1677
1713
|
companies = new CompaniesResource(this);
|
|
1678
1714
|
purchaseOrders = new PurchaseOrdersResource(this);
|
|
@@ -1899,6 +1935,7 @@ export {
|
|
|
1899
1935
|
AddressesResource,
|
|
1900
1936
|
AnalyticsResource,
|
|
1901
1937
|
CartResource,
|
|
1938
|
+
ChannelsResource,
|
|
1902
1939
|
CheckoutResource,
|
|
1903
1940
|
CheckoutsResource,
|
|
1904
1941
|
CollectionsResource,
|