@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/CHANGELOG.md +6 -0
- package/dist/browser.esm.js +10 -3
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +1 -1
- package/dist/browser.umd.js.map +1 -1
- package/dist/index.cjs +10 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +10 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/node.cjs +10 -3
- package/dist/node.cjs.map +1 -1
- package/dist/node.esm.js +10 -3
- package/dist/node.esm.js.map +1 -1
- package/package.json +15 -8
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
|
|
2026
|
-
|
|
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) {
|