@polyguard/sdk 1.1.6 → 1.2.1
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/sdk.js +10668 -10671
- package/package.json +9 -2
- package/src/generated/src/ApiClient.js +0 -16
- package/src/index.js +4 -8
package/package.json
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@polyguard/sdk",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"main": "dist/sdk.js",
|
|
5
6
|
"module": "dist/sdk.js",
|
|
6
7
|
"browser": "dist/sdk.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/sdk.js",
|
|
11
|
+
"default": "./dist/sdk.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
7
14
|
"scripts": {
|
|
8
|
-
"build": "esbuild src/index.js --bundle --outfile=dist/sdk.js",
|
|
15
|
+
"build": "esbuild src/index.js --bundle --format=esm --outfile=dist/sdk.js",
|
|
9
16
|
"prepare": "npm run build",
|
|
10
17
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
11
18
|
"regenerate-client": "bash scripts/regenerate-client.sh"
|
|
@@ -203,22 +203,6 @@ class ApiClient {
|
|
|
203
203
|
* @returns {Boolean} <code>true</code> if <code>param</code> represents a file.
|
|
204
204
|
*/
|
|
205
205
|
isFileParam(param) {
|
|
206
|
-
// fs.ReadStream in Node.js and Electron (but not in runtime like browserify)
|
|
207
|
-
if (typeof require === 'function') {
|
|
208
|
-
let fs;
|
|
209
|
-
try {
|
|
210
|
-
fs = require('fs');
|
|
211
|
-
} catch (err) {}
|
|
212
|
-
if (fs && fs.ReadStream && param instanceof fs.ReadStream) {
|
|
213
|
-
return true;
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
// Buffer in Node.js
|
|
218
|
-
if (typeof Buffer === 'function' && param instanceof Buffer) {
|
|
219
|
-
return true;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
206
|
// Blob in browser
|
|
223
207
|
if (typeof Blob === 'function' && param instanceof Blob) {
|
|
224
208
|
return true;
|
package/src/index.js
CHANGED
|
@@ -8,13 +8,9 @@ if (typeof window !== 'undefined') {
|
|
|
8
8
|
Object.assign(window.Polyguard, PolyguardApi);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
// Export PolyguardClient first to ensure it takes precedence
|
|
11
12
|
export { PolyguardClient };
|
|
13
|
+
// Then export everything else from the generated API
|
|
12
14
|
export * from './generated/src/index.js';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
|
|
16
|
-
module.exports = {
|
|
17
|
-
PolyguardClient,
|
|
18
|
-
...PolyguardApi
|
|
19
|
-
};
|
|
20
|
-
}
|
|
15
|
+
// Default export for easier usage
|
|
16
|
+
export default PolyguardClient;
|