@qed-proof/sdk 0.1.3 → 0.1.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/CHANGELOG.md +5 -0
- package/dist/index.cjs +3 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,11 @@ All notable changes to `@qed-proof/sdk` are documented here. Format follows
|
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project uses
|
|
5
5
|
[Semantic Versioning](https://semver.org/).
|
|
6
6
|
|
|
7
|
+
## [0.1.4] - Unreleased
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
- Works in browsers: `QedProof` now calls `fetch` as a plain function. 0.1.0–0.1.3 called it as a method of the client, which browsers reject with "Illegal invocation" (Node accepts it).
|
|
11
|
+
|
|
7
12
|
## [0.1.3] - Unreleased
|
|
8
13
|
|
|
9
14
|
Same code as 0.1.2. 0.1.2 was tagged but never published: the release job's npm was too old for trusted publishing.
|
package/dist/index.cjs
CHANGED
|
@@ -1768,10 +1768,11 @@ var QedProof = class {
|
|
|
1768
1768
|
constructor(options = {}) {
|
|
1769
1769
|
this.apiKey = options.apiKey;
|
|
1770
1770
|
this.baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\/+$/, "");
|
|
1771
|
-
|
|
1772
|
-
if (!
|
|
1771
|
+
const f = options.fetch ?? globalThis.fetch;
|
|
1772
|
+
if (!f) {
|
|
1773
1773
|
throw new Error("QedProof: no fetch implementation available; pass { fetch } explicitly");
|
|
1774
1774
|
}
|
|
1775
|
+
this.fetchImpl = (input, init) => f(input, init);
|
|
1775
1776
|
}
|
|
1776
1777
|
async request(method, path, { auth = true, body, text = false } = {}) {
|
|
1777
1778
|
const headers = { accept: "application/json" };
|