@gethydra/sdk 0.1.12 → 0.1.14

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 CHANGED
@@ -17796,6 +17796,11 @@ declare class CustomerPhotosResource {
17796
17796
  * Delete a customer photo (soft delete, secret key only).
17797
17797
  */
17798
17798
  delete(id: string): Promise<void>;
17799
+ /**
17800
+ * Replace the image file on an existing customer photo (secret key only).
17801
+ * Preserves all metadata, approval status, and moderation history.
17802
+ */
17803
+ replaceImage(id: string, formData: FormData): Promise<DataResponse<CustomerPhoto>>;
17799
17804
  /**
17800
17805
  * Get approved customer photos for a product (storefront-safe, publishable key works).
17801
17806
  * Returns up to 24 approved photos for display on product pages.
@@ -18398,6 +18403,36 @@ declare class ContentCategoriesResource {
18398
18403
  create(body: CreateBody$1, options?: ResourceRequestOptions): Promise<DataResponse<ContentCategory>>;
18399
18404
  update(id: string, body: UpdateBody$1): Promise<DataResponse<ContentCategory>>;
18400
18405
  delete(id: string): Promise<void>;
18406
+ listPosts(categoryId: string, params?: {
18407
+ limit?: number;
18408
+ cursor?: string;
18409
+ type?: 'post' | 'page';
18410
+ }): Promise<ListResponse<CategoryPost>>;
18411
+ addPosts(categoryId: string, body: {
18412
+ post_ids: string[];
18413
+ }): Promise<DataResponse<ContentCategory>>;
18414
+ removePost(categoryId: string, postId: string): Promise<void>;
18415
+ reorderPosts(categoryId: string, body: {
18416
+ posts: Array<{
18417
+ id: string;
18418
+ position: number;
18419
+ }>;
18420
+ }): Promise<void>;
18421
+ }
18422
+ /** Post within a content category, sorted by position. */
18423
+ interface CategoryPost {
18424
+ id: string;
18425
+ type: string;
18426
+ title: string;
18427
+ handle: string;
18428
+ status: string;
18429
+ position: number;
18430
+ featured_image: {
18431
+ id: string;
18432
+ src: string;
18433
+ alt: string | null;
18434
+ } | null;
18435
+ created_at: string;
18401
18436
  }
18402
18437
 
18403
18438
  type MembershipPlan = components['schemas']['MembershipPlan'];
package/dist/index.js CHANGED
@@ -661,6 +661,13 @@ var CustomerPhotosResource = class {
661
661
  async delete(id) {
662
662
  return this.client.request("DELETE", `/v1/customer-photos/${id}`);
663
663
  }
664
+ /**
665
+ * Replace the image file on an existing customer photo (secret key only).
666
+ * Preserves all metadata, approval status, and moderation history.
667
+ */
668
+ async replaceImage(id, formData) {
669
+ return this.client.upload(`/v1/customer-photos/${id}/replace-image`, formData);
670
+ }
664
671
  /**
665
672
  * Get approved customer photos for a product (storefront-safe, publishable key works).
666
673
  * Returns up to 24 approved photos for display on product pages.
@@ -1550,6 +1557,26 @@ var ContentCategoriesResource = class {
1550
1557
  async delete(id) {
1551
1558
  return this.client.request("DELETE", `/v1/content-categories/${id}`);
1552
1559
  }
1560
+ // ── Post sub-resources ──
1561
+ async listPosts(categoryId, params) {
1562
+ return this.client.request("GET", `/v1/content-categories/${categoryId}/posts`, { params });
1563
+ }
1564
+ async addPosts(categoryId, body) {
1565
+ return this.client.request("POST", `/v1/content-categories/${categoryId}/posts`, { body });
1566
+ }
1567
+ async removePost(categoryId, postId) {
1568
+ return this.client.request(
1569
+ "DELETE",
1570
+ `/v1/content-categories/${categoryId}/posts/${postId}`
1571
+ );
1572
+ }
1573
+ async reorderPosts(categoryId, body) {
1574
+ return this.client.request(
1575
+ "PATCH",
1576
+ `/v1/content-categories/${categoryId}/posts/reorder`,
1577
+ { body }
1578
+ );
1579
+ }
1553
1580
  };
1554
1581
 
1555
1582
  // src/resources/membership-plans.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gethydra/sdk",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "description": "Official TypeScript SDK for the Hydra Commerce API",
5
5
  "license": "MIT",
6
6
  "author": "Grant Capital Group",