@profplum700/etsy-v3-api-client 4.0.0 → 4.1.0

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/node.cjs CHANGED
@@ -2022,8 +2022,15 @@ class EtsyClient {
2022
2022
  await this.makeRequest(`/listings/${listingId}`, { method: 'DELETE' }, false);
2023
2023
  }
2024
2024
  async updateListingInventory(listingId, params, options) {
2025
- const legacy = options?.legacy;
2026
- const query = legacy !== undefined ? `?legacy=${legacy}` : '';
2025
+ const searchParams = new URLSearchParams();
2026
+ if (options?.legacy !== undefined) {
2027
+ searchParams.set('legacy', options.legacy.toString());
2028
+ }
2029
+ if (options?.enableScaleValidation !== undefined) {
2030
+ searchParams.set('enable_scale_validation', options.enableScaleValidation.toString());
2031
+ }
2032
+ const queryString = searchParams.toString();
2033
+ const query = queryString ? `?${queryString}` : '';
2027
2034
  if (!Array.isArray(params.products) || params.products.length === 0) {
2028
2035
  throw new TypeError('Inventory update must contain at least one product.');
2029
2036
  }
@@ -2807,7 +2814,7 @@ async function sha256(data) {
2807
2814
  const encoder = new TextEncoder();
2808
2815
  const dataBytes = typeof data === 'string' ? encoder.encode(data) : data;
2809
2816
  if (isBrowser) {
2810
- const hashBuffer = await crypto.subtle.digest('SHA-256', dataBytes);
2817
+ const hashBuffer = await crypto.subtle.digest('SHA-256', new Uint8Array(dataBytes));
2811
2818
  return new Uint8Array(hashBuffer);
2812
2819
  }
2813
2820
  else if (isNode) {