@shopware/api-client 1.3.0 → 1.4.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/README.md +70 -13
- package/api-types/adminApiSchema.json +76278 -51743
- package/api-types/adminApiTypes.d.ts +17039 -25893
- package/api-types/storeApiSchema.6.6.10.json +25865 -0
- package/api-types/storeApiSchema.6.6.10.overrides.json +1011 -0
- package/api-types/storeApiSchema.b2b.overrides.json +1 -29
- package/api-types/storeApiSchema.json +2321 -1025
- package/api-types/storeApiSchema.overrides.json +43 -857
- package/api-types/storeApiTypes.d.ts +1629 -1161
- package/dist/helpers.cjs +13 -0
- package/dist/helpers.d.cts +9 -0
- package/dist/helpers.d.mts +9 -0
- package/dist/helpers.d.ts +9 -0
- package/dist/helpers.mjs +11 -0
- package/dist/index.d.cts +22750 -31136
- package/dist/index.d.mts +22750 -31136
- package/dist/index.d.ts +22750 -31136
- package/package.json +16 -6
- package/api-types/storeApiTypes.overrides.ts +0 -48
package/dist/helpers.cjs
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const fflate = require('fflate');
|
|
4
|
+
|
|
5
|
+
function encodeForQuery(obj) {
|
|
6
|
+
const json = JSON.stringify(obj);
|
|
7
|
+
const compressed = fflate.gzipSync(fflate.strToU8(json));
|
|
8
|
+
let base64 = btoa(String.fromCharCode.apply(null, Array.from(compressed)));
|
|
9
|
+
base64 = base64.replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
10
|
+
return base64;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
exports.encodeForQuery = encodeForQuery;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 🔹 Compress object -> base64url for query string
|
|
3
|
+
*
|
|
4
|
+
* This is a helper to support https://github.com/shopware/shopware/issues/12388 for _criteria query field in store-api GET requests
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
declare function encodeForQuery(obj: unknown): string;
|
|
8
|
+
|
|
9
|
+
export { encodeForQuery };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 🔹 Compress object -> base64url for query string
|
|
3
|
+
*
|
|
4
|
+
* This is a helper to support https://github.com/shopware/shopware/issues/12388 for _criteria query field in store-api GET requests
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
declare function encodeForQuery(obj: unknown): string;
|
|
8
|
+
|
|
9
|
+
export { encodeForQuery };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 🔹 Compress object -> base64url for query string
|
|
3
|
+
*
|
|
4
|
+
* This is a helper to support https://github.com/shopware/shopware/issues/12388 for _criteria query field in store-api GET requests
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
declare function encodeForQuery(obj: unknown): string;
|
|
8
|
+
|
|
9
|
+
export { encodeForQuery };
|
package/dist/helpers.mjs
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { gzipSync, strToU8 } from 'fflate';
|
|
2
|
+
|
|
3
|
+
function encodeForQuery(obj) {
|
|
4
|
+
const json = JSON.stringify(obj);
|
|
5
|
+
const compressed = gzipSync(strToU8(json));
|
|
6
|
+
let base64 = btoa(String.fromCharCode.apply(null, Array.from(compressed)));
|
|
7
|
+
base64 = base64.replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
8
|
+
return base64;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { encodeForQuery };
|