@shushed/helpers 0.0.200-v2-20251127150547 → 0.0.200-v2-20251128093319

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.
@@ -652,5 +652,29 @@ class DatoHelper extends runtime_1.default {
652
652
  throw err;
653
653
  }
654
654
  }
655
+ async publishProduct(productId) {
656
+ try {
657
+ const res = await fetch(`${this.baseUrl}/items/${productId}/publish`, {
658
+ method: "PUT",
659
+ headers: {
660
+ Authorization: `Bearer ${this.apiToken}`,
661
+ "X-Api-Version": "3",
662
+ "X-Environment": this.environment,
663
+ "Content-Type": "application/vnd.api+json",
664
+ Accept: "application/json",
665
+ },
666
+ });
667
+ this.handle429(res);
668
+ if (!res.ok) {
669
+ const errorText = await res.text();
670
+ throw new Error(`Failed to publish product: ${res.status} ${res.statusText} - ${errorText}`);
671
+ }
672
+ return await res.json();
673
+ }
674
+ catch (err) {
675
+ this.logging.error(`publishProduct failed: ${err.message}`);
676
+ throw err;
677
+ }
678
+ }
655
679
  }
656
680
  exports.default = DatoHelper;
@@ -90,5 +90,6 @@ export default class DatoHelper extends Runtime {
90
90
  createProduct(sku: string, productTypeId: string): Promise<any>;
91
91
  updateProductGallery(productId: string, gallery: any[]): Promise<any>;
92
92
  updateProductSwatch(productId: string, uploadId: string): Promise<any>;
93
+ publishProduct(productId: string): Promise<any>;
93
94
  }
94
95
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shushed/helpers",
3
- "version": "0.0.200-v2-20251127150547",
3
+ "version": "0.0.200-v2-20251128093319",
4
4
  "author": "",
5
5
  "license": "UNLICENSED",
6
6
  "description": "",