@gethydra/sdk 0.1.21 → 0.1.22
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.d.ts +669 -231
- package/dist/index.js +44 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1705,6 +1705,47 @@ var BookingsResource = class {
|
|
|
1705
1705
|
}
|
|
1706
1706
|
};
|
|
1707
1707
|
|
|
1708
|
+
// src/resources/lookbooks.ts
|
|
1709
|
+
var LookbooksResource = class {
|
|
1710
|
+
constructor(client) {
|
|
1711
|
+
this.client = client;
|
|
1712
|
+
}
|
|
1713
|
+
client;
|
|
1714
|
+
async list(params) {
|
|
1715
|
+
return this.client.request("GET", "/v1/lookbooks", { params });
|
|
1716
|
+
}
|
|
1717
|
+
iterate(params, options) {
|
|
1718
|
+
return paginate((cursor) => this.list({ ...params, cursor }), options);
|
|
1719
|
+
}
|
|
1720
|
+
async toArray(params, options) {
|
|
1721
|
+
return toArray(this.iterate(params, options), options);
|
|
1722
|
+
}
|
|
1723
|
+
async get(id, params) {
|
|
1724
|
+
return this.client.request("GET", `/v1/lookbooks/${id}`, { params });
|
|
1725
|
+
}
|
|
1726
|
+
async create(body, options) {
|
|
1727
|
+
return this.client.request("POST", "/v1/lookbooks", { body, ...options });
|
|
1728
|
+
}
|
|
1729
|
+
async update(id, body) {
|
|
1730
|
+
return this.client.request("PATCH", `/v1/lookbooks/${id}`, { body });
|
|
1731
|
+
}
|
|
1732
|
+
async delete(id) {
|
|
1733
|
+
return this.client.request("DELETE", `/v1/lookbooks/${id}`);
|
|
1734
|
+
}
|
|
1735
|
+
/** Upload or replace the primary (BW) image for a lookbook. */
|
|
1736
|
+
async uploadImage(id, formData) {
|
|
1737
|
+
return this.client.upload(`/v1/lookbooks/${id}/image`, formData);
|
|
1738
|
+
}
|
|
1739
|
+
/** Upload or replace the color (hover) image for a lookbook. */
|
|
1740
|
+
async uploadColorImage(id, formData) {
|
|
1741
|
+
return this.client.upload(`/v1/lookbooks/${id}/image-color`, formData);
|
|
1742
|
+
}
|
|
1743
|
+
/** List all lookbook tags for this store, ordered by position then slug. */
|
|
1744
|
+
async listTags() {
|
|
1745
|
+
return this.client.request("GET", "/v1/lookbooks/tags");
|
|
1746
|
+
}
|
|
1747
|
+
};
|
|
1748
|
+
|
|
1708
1749
|
// src/client.ts
|
|
1709
1750
|
var SDK_VERSION = "0.1.0";
|
|
1710
1751
|
var INITIAL_RETRY_DELAY = 0.5;
|
|
@@ -1787,6 +1828,8 @@ var Hydra = class {
|
|
|
1787
1828
|
membershipPlans = new MembershipPlansResource(this);
|
|
1788
1829
|
// P9: Bookings
|
|
1789
1830
|
bookings = new BookingsResource(this);
|
|
1831
|
+
// P10: Lookbooks
|
|
1832
|
+
lookbooks = new LookbooksResource(this);
|
|
1790
1833
|
constructor(config) {
|
|
1791
1834
|
for (const key of Object.keys(config)) {
|
|
1792
1835
|
if (!VALID_CONFIG_KEYS.has(key)) {
|
|
@@ -2024,6 +2067,7 @@ export {
|
|
|
2024
2067
|
IntegrationsResource,
|
|
2025
2068
|
InventoryResource,
|
|
2026
2069
|
LocationsResource,
|
|
2070
|
+
LookbooksResource,
|
|
2027
2071
|
MembershipPlansResource,
|
|
2028
2072
|
MetafieldsResource,
|
|
2029
2073
|
NotificationsResource,
|