@polyguard/sdk 1.0.2 → 1.0.4
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
CHANGED
|
@@ -11038,7 +11038,7 @@
|
|
|
11038
11038
|
const ticketRes = await fetch(`https://${this.apiServer}/v2/ticket/${this.appId}`, {
|
|
11039
11039
|
method: "POST",
|
|
11040
11040
|
headers: { "Content-Type": "application/json" },
|
|
11041
|
-
body: JSON.stringify({ requiredProofs: this.requiredProofs })
|
|
11041
|
+
body: JSON.stringify({ requiredProofs: this.requiredProofs, scanType: this.scanType })
|
|
11042
11042
|
});
|
|
11043
11043
|
if (!ticketRes.ok) {
|
|
11044
11044
|
showError("Failed to get ticket");
|
|
@@ -11096,6 +11096,7 @@
|
|
|
11096
11096
|
showError(`Unknown message type from server`);
|
|
11097
11097
|
}
|
|
11098
11098
|
} catch (e) {
|
|
11099
|
+
console.error("Invalid message format from server", e);
|
|
11099
11100
|
showError("Invalid message format from server");
|
|
11100
11101
|
}
|
|
11101
11102
|
});
|
package/package.json
CHANGED
|
@@ -100,7 +100,7 @@ export class PolyguardWebsocketClientImpl {
|
|
|
100
100
|
const ticketRes = await fetch(`https://${this.apiServer}/v2/ticket/${this.appId}`, {
|
|
101
101
|
method: 'POST',
|
|
102
102
|
headers: { 'Content-Type': 'application/json' },
|
|
103
|
-
body: JSON.stringify({ requiredProofs: this.requiredProofs }),
|
|
103
|
+
body: JSON.stringify({ requiredProofs: this.requiredProofs, scanType: this.scanType }),
|
|
104
104
|
});
|
|
105
105
|
if (!ticketRes.ok) {
|
|
106
106
|
showError('Failed to get ticket');
|
|
@@ -168,7 +168,9 @@ export class PolyguardWebsocketClientImpl {
|
|
|
168
168
|
showError(`Unknown message type from server`);
|
|
169
169
|
}
|
|
170
170
|
} catch (e) {
|
|
171
|
+
console.error('Invalid message format from server', e);
|
|
171
172
|
showError('Invalid message format from server');
|
|
173
|
+
// ws.close();
|
|
172
174
|
}
|
|
173
175
|
});
|
|
174
176
|
ws.addEventListener('error', () => {
|