wapi-client 0.8.1 → 0.8.3

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.
@@ -1,11 +1,7 @@
1
- var __create = Object.create;
2
1
  var __defProp = Object.defineProperty;
3
2
  var __defProps = Object.defineProperties;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
3
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
4
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
- var __getProtoOf = Object.getPrototypeOf;
9
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
10
6
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
7
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
@@ -21,25 +17,6 @@ var __spreadValues = (a, b) => {
21
17
  return a;
22
18
  };
23
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
- var __commonJS = (cb, mod) => function __require() {
25
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
26
- };
27
- var __copyProps = (to, from, except, desc) => {
28
- if (from && typeof from === "object" || typeof from === "function") {
29
- for (let key of __getOwnPropNames(from))
30
- if (!__hasOwnProp.call(to, key) && key !== except)
31
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
32
- }
33
- return to;
34
- };
35
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
36
- // If the importer is in node compatibility mode or this is not an ESM
37
- // file that has been converted to a CommonJS file using a Babel-
38
- // compatible transform (i.e. "__esModule" has not been set), then set
39
- // "default" to the CommonJS "module.exports" for node compatibility.
40
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
41
- mod
42
- ));
43
20
  var __async = (__this, __arguments, generator) => {
44
21
  return new Promise((resolve, reject) => {
45
22
  var fulfilled = (value) => {
@@ -61,529 +38,8 @@ var __async = (__this, __arguments, generator) => {
61
38
  });
62
39
  };
63
40
 
64
- // node_modules/cross-fetch/dist/browser-ponyfill.js
65
- var require_browser_ponyfill = __commonJS({
66
- "node_modules/cross-fetch/dist/browser-ponyfill.js"(exports, module) {
67
- var __global__ = typeof globalThis !== "undefined" && globalThis || typeof self !== "undefined" && self || typeof global !== "undefined" && global;
68
- var __globalThis__ = function() {
69
- function F() {
70
- this.fetch = false;
71
- this.DOMException = __global__.DOMException;
72
- }
73
- F.prototype = __global__;
74
- return new F();
75
- }();
76
- (function(globalThis2) {
77
- var irrelevant = function(exports2) {
78
- var global2 = typeof globalThis2 !== "undefined" && globalThis2 || typeof self !== "undefined" && self || typeof global2 !== "undefined" && global2;
79
- var support = {
80
- searchParams: "URLSearchParams" in global2,
81
- iterable: "Symbol" in global2 && "iterator" in Symbol,
82
- blob: "FileReader" in global2 && "Blob" in global2 && function() {
83
- try {
84
- new Blob();
85
- return true;
86
- } catch (e) {
87
- return false;
88
- }
89
- }(),
90
- formData: "FormData" in global2,
91
- arrayBuffer: "ArrayBuffer" in global2
92
- };
93
- function isDataView(obj) {
94
- return obj && DataView.prototype.isPrototypeOf(obj);
95
- }
96
- if (support.arrayBuffer) {
97
- var viewClasses = [
98
- "[object Int8Array]",
99
- "[object Uint8Array]",
100
- "[object Uint8ClampedArray]",
101
- "[object Int16Array]",
102
- "[object Uint16Array]",
103
- "[object Int32Array]",
104
- "[object Uint32Array]",
105
- "[object Float32Array]",
106
- "[object Float64Array]"
107
- ];
108
- var isArrayBufferView = ArrayBuffer.isView || function(obj) {
109
- return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1;
110
- };
111
- }
112
- function normalizeName(name) {
113
- if (typeof name !== "string") {
114
- name = String(name);
115
- }
116
- if (/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(name) || name === "") {
117
- throw new TypeError('Invalid character in header field name: "' + name + '"');
118
- }
119
- return name.toLowerCase();
120
- }
121
- function normalizeValue(value) {
122
- if (typeof value !== "string") {
123
- value = String(value);
124
- }
125
- return value;
126
- }
127
- function iteratorFor(items) {
128
- var iterator = {
129
- next: function() {
130
- var value = items.shift();
131
- return { done: value === void 0, value };
132
- }
133
- };
134
- if (support.iterable) {
135
- iterator[Symbol.iterator] = function() {
136
- return iterator;
137
- };
138
- }
139
- return iterator;
140
- }
141
- function Headers(headers) {
142
- this.map = {};
143
- if (headers instanceof Headers) {
144
- headers.forEach(function(value, name) {
145
- this.append(name, value);
146
- }, this);
147
- } else if (Array.isArray(headers)) {
148
- headers.forEach(function(header) {
149
- this.append(header[0], header[1]);
150
- }, this);
151
- } else if (headers) {
152
- Object.getOwnPropertyNames(headers).forEach(function(name) {
153
- this.append(name, headers[name]);
154
- }, this);
155
- }
156
- }
157
- Headers.prototype.append = function(name, value) {
158
- name = normalizeName(name);
159
- value = normalizeValue(value);
160
- var oldValue = this.map[name];
161
- this.map[name] = oldValue ? oldValue + ", " + value : value;
162
- };
163
- Headers.prototype["delete"] = function(name) {
164
- delete this.map[normalizeName(name)];
165
- };
166
- Headers.prototype.get = function(name) {
167
- name = normalizeName(name);
168
- return this.has(name) ? this.map[name] : null;
169
- };
170
- Headers.prototype.has = function(name) {
171
- return this.map.hasOwnProperty(normalizeName(name));
172
- };
173
- Headers.prototype.set = function(name, value) {
174
- this.map[normalizeName(name)] = normalizeValue(value);
175
- };
176
- Headers.prototype.forEach = function(callback, thisArg) {
177
- for (var name in this.map) {
178
- if (this.map.hasOwnProperty(name)) {
179
- callback.call(thisArg, this.map[name], name, this);
180
- }
181
- }
182
- };
183
- Headers.prototype.keys = function() {
184
- var items = [];
185
- this.forEach(function(value, name) {
186
- items.push(name);
187
- });
188
- return iteratorFor(items);
189
- };
190
- Headers.prototype.values = function() {
191
- var items = [];
192
- this.forEach(function(value) {
193
- items.push(value);
194
- });
195
- return iteratorFor(items);
196
- };
197
- Headers.prototype.entries = function() {
198
- var items = [];
199
- this.forEach(function(value, name) {
200
- items.push([name, value]);
201
- });
202
- return iteratorFor(items);
203
- };
204
- if (support.iterable) {
205
- Headers.prototype[Symbol.iterator] = Headers.prototype.entries;
206
- }
207
- function consumed(body) {
208
- if (body.bodyUsed) {
209
- return Promise.reject(new TypeError("Already read"));
210
- }
211
- body.bodyUsed = true;
212
- }
213
- function fileReaderReady(reader) {
214
- return new Promise(function(resolve, reject) {
215
- reader.onload = function() {
216
- resolve(reader.result);
217
- };
218
- reader.onerror = function() {
219
- reject(reader.error);
220
- };
221
- });
222
- }
223
- function readBlobAsArrayBuffer(blob) {
224
- var reader = new FileReader();
225
- var promise = fileReaderReady(reader);
226
- reader.readAsArrayBuffer(blob);
227
- return promise;
228
- }
229
- function readBlobAsText(blob) {
230
- var reader = new FileReader();
231
- var promise = fileReaderReady(reader);
232
- reader.readAsText(blob);
233
- return promise;
234
- }
235
- function readArrayBufferAsText(buf) {
236
- var view = new Uint8Array(buf);
237
- var chars = new Array(view.length);
238
- for (var i = 0; i < view.length; i++) {
239
- chars[i] = String.fromCharCode(view[i]);
240
- }
241
- return chars.join("");
242
- }
243
- function bufferClone(buf) {
244
- if (buf.slice) {
245
- return buf.slice(0);
246
- } else {
247
- var view = new Uint8Array(buf.byteLength);
248
- view.set(new Uint8Array(buf));
249
- return view.buffer;
250
- }
251
- }
252
- function Body() {
253
- this.bodyUsed = false;
254
- this._initBody = function(body) {
255
- this.bodyUsed = this.bodyUsed;
256
- this._bodyInit = body;
257
- if (!body) {
258
- this._bodyText = "";
259
- } else if (typeof body === "string") {
260
- this._bodyText = body;
261
- } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
262
- this._bodyBlob = body;
263
- } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
264
- this._bodyFormData = body;
265
- } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
266
- this._bodyText = body.toString();
267
- } else if (support.arrayBuffer && support.blob && isDataView(body)) {
268
- this._bodyArrayBuffer = bufferClone(body.buffer);
269
- this._bodyInit = new Blob([this._bodyArrayBuffer]);
270
- } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {
271
- this._bodyArrayBuffer = bufferClone(body);
272
- } else {
273
- this._bodyText = body = Object.prototype.toString.call(body);
274
- }
275
- if (!this.headers.get("content-type")) {
276
- if (typeof body === "string") {
277
- this.headers.set("content-type", "text/plain;charset=UTF-8");
278
- } else if (this._bodyBlob && this._bodyBlob.type) {
279
- this.headers.set("content-type", this._bodyBlob.type);
280
- } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
281
- this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8");
282
- }
283
- }
284
- };
285
- if (support.blob) {
286
- this.blob = function() {
287
- var rejected = consumed(this);
288
- if (rejected) {
289
- return rejected;
290
- }
291
- if (this._bodyBlob) {
292
- return Promise.resolve(this._bodyBlob);
293
- } else if (this._bodyArrayBuffer) {
294
- return Promise.resolve(new Blob([this._bodyArrayBuffer]));
295
- } else if (this._bodyFormData) {
296
- throw new Error("could not read FormData body as blob");
297
- } else {
298
- return Promise.resolve(new Blob([this._bodyText]));
299
- }
300
- };
301
- this.arrayBuffer = function() {
302
- if (this._bodyArrayBuffer) {
303
- var isConsumed = consumed(this);
304
- if (isConsumed) {
305
- return isConsumed;
306
- }
307
- if (ArrayBuffer.isView(this._bodyArrayBuffer)) {
308
- return Promise.resolve(
309
- this._bodyArrayBuffer.buffer.slice(
310
- this._bodyArrayBuffer.byteOffset,
311
- this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength
312
- )
313
- );
314
- } else {
315
- return Promise.resolve(this._bodyArrayBuffer);
316
- }
317
- } else {
318
- return this.blob().then(readBlobAsArrayBuffer);
319
- }
320
- };
321
- }
322
- this.text = function() {
323
- var rejected = consumed(this);
324
- if (rejected) {
325
- return rejected;
326
- }
327
- if (this._bodyBlob) {
328
- return readBlobAsText(this._bodyBlob);
329
- } else if (this._bodyArrayBuffer) {
330
- return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer));
331
- } else if (this._bodyFormData) {
332
- throw new Error("could not read FormData body as text");
333
- } else {
334
- return Promise.resolve(this._bodyText);
335
- }
336
- };
337
- if (support.formData) {
338
- this.formData = function() {
339
- return this.text().then(decode);
340
- };
341
- }
342
- this.json = function() {
343
- return this.text().then(JSON.parse);
344
- };
345
- return this;
346
- }
347
- var methods = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"];
348
- function normalizeMethod(method) {
349
- var upcased = method.toUpperCase();
350
- return methods.indexOf(upcased) > -1 ? upcased : method;
351
- }
352
- function Request(input, options) {
353
- if (!(this instanceof Request)) {
354
- throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');
355
- }
356
- options = options || {};
357
- var body = options.body;
358
- if (input instanceof Request) {
359
- if (input.bodyUsed) {
360
- throw new TypeError("Already read");
361
- }
362
- this.url = input.url;
363
- this.credentials = input.credentials;
364
- if (!options.headers) {
365
- this.headers = new Headers(input.headers);
366
- }
367
- this.method = input.method;
368
- this.mode = input.mode;
369
- this.signal = input.signal;
370
- if (!body && input._bodyInit != null) {
371
- body = input._bodyInit;
372
- input.bodyUsed = true;
373
- }
374
- } else {
375
- this.url = String(input);
376
- }
377
- this.credentials = options.credentials || this.credentials || "same-origin";
378
- if (options.headers || !this.headers) {
379
- this.headers = new Headers(options.headers);
380
- }
381
- this.method = normalizeMethod(options.method || this.method || "GET");
382
- this.mode = options.mode || this.mode || null;
383
- this.signal = options.signal || this.signal;
384
- this.referrer = null;
385
- if ((this.method === "GET" || this.method === "HEAD") && body) {
386
- throw new TypeError("Body not allowed for GET or HEAD requests");
387
- }
388
- this._initBody(body);
389
- if (this.method === "GET" || this.method === "HEAD") {
390
- if (options.cache === "no-store" || options.cache === "no-cache") {
391
- var reParamSearch = /([?&])_=[^&]*/;
392
- if (reParamSearch.test(this.url)) {
393
- this.url = this.url.replace(reParamSearch, "$1_=" + (/* @__PURE__ */ new Date()).getTime());
394
- } else {
395
- var reQueryString = /\?/;
396
- this.url += (reQueryString.test(this.url) ? "&" : "?") + "_=" + (/* @__PURE__ */ new Date()).getTime();
397
- }
398
- }
399
- }
400
- }
401
- Request.prototype.clone = function() {
402
- return new Request(this, { body: this._bodyInit });
403
- };
404
- function decode(body) {
405
- var form = new FormData();
406
- body.trim().split("&").forEach(function(bytes) {
407
- if (bytes) {
408
- var split = bytes.split("=");
409
- var name = split.shift().replace(/\+/g, " ");
410
- var value = split.join("=").replace(/\+/g, " ");
411
- form.append(decodeURIComponent(name), decodeURIComponent(value));
412
- }
413
- });
414
- return form;
415
- }
416
- function parseHeaders(rawHeaders) {
417
- var headers = new Headers();
418
- var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, " ");
419
- preProcessedHeaders.split("\r").map(function(header) {
420
- return header.indexOf("\n") === 0 ? header.substr(1, header.length) : header;
421
- }).forEach(function(line) {
422
- var parts = line.split(":");
423
- var key = parts.shift().trim();
424
- if (key) {
425
- var value = parts.join(":").trim();
426
- headers.append(key, value);
427
- }
428
- });
429
- return headers;
430
- }
431
- Body.call(Request.prototype);
432
- function Response(bodyInit, options) {
433
- if (!(this instanceof Response)) {
434
- throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');
435
- }
436
- if (!options) {
437
- options = {};
438
- }
439
- this.type = "default";
440
- this.status = options.status === void 0 ? 200 : options.status;
441
- this.ok = this.status >= 200 && this.status < 300;
442
- this.statusText = options.statusText === void 0 ? "" : "" + options.statusText;
443
- this.headers = new Headers(options.headers);
444
- this.url = options.url || "";
445
- this._initBody(bodyInit);
446
- }
447
- Body.call(Response.prototype);
448
- Response.prototype.clone = function() {
449
- return new Response(this._bodyInit, {
450
- status: this.status,
451
- statusText: this.statusText,
452
- headers: new Headers(this.headers),
453
- url: this.url
454
- });
455
- };
456
- Response.error = function() {
457
- var response = new Response(null, { status: 0, statusText: "" });
458
- response.type = "error";
459
- return response;
460
- };
461
- var redirectStatuses = [301, 302, 303, 307, 308];
462
- Response.redirect = function(url, status) {
463
- if (redirectStatuses.indexOf(status) === -1) {
464
- throw new RangeError("Invalid status code");
465
- }
466
- return new Response(null, { status, headers: { location: url } });
467
- };
468
- exports2.DOMException = global2.DOMException;
469
- try {
470
- new exports2.DOMException();
471
- } catch (err) {
472
- exports2.DOMException = function(message, name) {
473
- this.message = message;
474
- this.name = name;
475
- var error = Error(message);
476
- this.stack = error.stack;
477
- };
478
- exports2.DOMException.prototype = Object.create(Error.prototype);
479
- exports2.DOMException.prototype.constructor = exports2.DOMException;
480
- }
481
- function fetch2(input, init) {
482
- return new Promise(function(resolve, reject) {
483
- var request = new Request(input, init);
484
- if (request.signal && request.signal.aborted) {
485
- return reject(new exports2.DOMException("Aborted", "AbortError"));
486
- }
487
- var xhr = new XMLHttpRequest();
488
- function abortXhr() {
489
- xhr.abort();
490
- }
491
- xhr.onload = function() {
492
- var options = {
493
- status: xhr.status,
494
- statusText: xhr.statusText,
495
- headers: parseHeaders(xhr.getAllResponseHeaders() || "")
496
- };
497
- options.url = "responseURL" in xhr ? xhr.responseURL : options.headers.get("X-Request-URL");
498
- var body = "response" in xhr ? xhr.response : xhr.responseText;
499
- setTimeout(function() {
500
- resolve(new Response(body, options));
501
- }, 0);
502
- };
503
- xhr.onerror = function() {
504
- setTimeout(function() {
505
- reject(new TypeError("Network request failed"));
506
- }, 0);
507
- };
508
- xhr.ontimeout = function() {
509
- setTimeout(function() {
510
- reject(new TypeError("Network request failed"));
511
- }, 0);
512
- };
513
- xhr.onabort = function() {
514
- setTimeout(function() {
515
- reject(new exports2.DOMException("Aborted", "AbortError"));
516
- }, 0);
517
- };
518
- function fixUrl(url) {
519
- try {
520
- return url === "" && global2.location.href ? global2.location.href : url;
521
- } catch (e) {
522
- return url;
523
- }
524
- }
525
- xhr.open(request.method, fixUrl(request.url), true);
526
- if (request.credentials === "include") {
527
- xhr.withCredentials = true;
528
- } else if (request.credentials === "omit") {
529
- xhr.withCredentials = false;
530
- }
531
- if ("responseType" in xhr) {
532
- if (support.blob) {
533
- xhr.responseType = "blob";
534
- } else if (support.arrayBuffer && request.headers.get("Content-Type") && request.headers.get("Content-Type").indexOf("application/octet-stream") !== -1) {
535
- xhr.responseType = "arraybuffer";
536
- }
537
- }
538
- if (init && typeof init.headers === "object" && !(init.headers instanceof Headers)) {
539
- Object.getOwnPropertyNames(init.headers).forEach(function(name) {
540
- xhr.setRequestHeader(name, normalizeValue(init.headers[name]));
541
- });
542
- } else {
543
- request.headers.forEach(function(value, name) {
544
- xhr.setRequestHeader(name, value);
545
- });
546
- }
547
- if (request.signal) {
548
- request.signal.addEventListener("abort", abortXhr);
549
- xhr.onreadystatechange = function() {
550
- if (xhr.readyState === 4) {
551
- request.signal.removeEventListener("abort", abortXhr);
552
- }
553
- };
554
- }
555
- xhr.send(typeof request._bodyInit === "undefined" ? null : request._bodyInit);
556
- });
557
- }
558
- fetch2.polyfill = true;
559
- if (!global2.fetch) {
560
- global2.fetch = fetch2;
561
- global2.Headers = Headers;
562
- global2.Request = Request;
563
- global2.Response = Response;
564
- }
565
- exports2.Headers = Headers;
566
- exports2.Request = Request;
567
- exports2.Response = Response;
568
- exports2.fetch = fetch2;
569
- return exports2;
570
- }({});
571
- })(__globalThis__);
572
- __globalThis__.fetch.ponyfill = true;
573
- delete __globalThis__.fetch.polyfill;
574
- var ctx = __global__.fetch ? __global__ : __globalThis__;
575
- exports = ctx.fetch;
576
- exports.default = ctx.fetch;
577
- exports.fetch = ctx.fetch;
578
- exports.Headers = ctx.Headers;
579
- exports.Request = ctx.Request;
580
- exports.Response = ctx.Response;
581
- module.exports = exports;
582
- }
583
- });
584
-
585
41
  // src/api/http-client.ts
586
- var import_browser_ponyfill = __toESM(require_browser_ponyfill(), 1);
42
+ import { fetch } from "../lib/isomorphic/web/fetch.browser.js";
587
43
  import { debugLog } from "../lib/debug.browser.js";
588
44
  import {
589
45
  JSONRPC
@@ -605,7 +61,7 @@ function createConnection(opts) {
605
61
  function send(body, jwt) {
606
62
  return __async(this, null, function* () {
607
63
  const jsonBody = JSON.parse(body);
608
- const res = yield (0, import_browser_ponyfill.default)(`${opts.host}/api`, {
64
+ const res = yield fetch(`${opts.host}/api`, {
609
65
  keepalive: true,
610
66
  method: "POST",
611
67
  headers: {
@@ -617,7 +73,7 @@ function createConnection(opts) {
617
73
  this.onmessage(__spreadProps(__spreadValues({}, responseBody), { id: jsonBody.id }));
618
74
  });
619
75
  }
620
- const $connect = (0, import_browser_ponyfill.default)(`${url}/api`, {
76
+ const $connect = fetch(`${url}/api`, {
621
77
  method: "POST",
622
78
  headers: {
623
79
  Authorization: `Bearer ${opts.jwt}`
@@ -632,7 +88,7 @@ function createConnection(opts) {
632
88
  if (res.error) {
633
89
  throw new Error(res.error.message);
634
90
  }
635
- return true;
91
+ return;
636
92
  });
637
93
  return {
638
94
  send,
@@ -1,11 +1,9 @@
1
- var __create = Object.create;
2
1
  var __defProp = Object.defineProperty;
3
2
  var __defProps = Object.defineProperties;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
6
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
- var __getProtoOf = Object.getPrototypeOf;
9
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
10
8
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
9
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
@@ -33,14 +31,6 @@ var __copyProps = (to, from, except, desc) => {
33
31
  }
34
32
  return to;
35
33
  };
36
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
37
- // If the importer is in node compatibility mode or this is not an ESM
38
- // file that has been converted to a CommonJS file using a Babel-
39
- // compatible transform (i.e. "__esModule" has not been set), then set
40
- // "default" to the CommonJS "module.exports" for node compatibility.
41
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
42
- mod
43
- ));
44
34
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
45
35
  var __async = (__this, __arguments, generator) => {
46
36
  return new Promise((resolve, reject) => {
@@ -70,7 +60,7 @@ __export(http_client_exports, {
70
60
  createHttpClient: () => createHttpClient
71
61
  });
72
62
  module.exports = __toCommonJS(http_client_exports);
73
- var import_node_ponyfill = __toESM(require("cross-fetch/dist/node-ponyfill"), 1);
63
+ var import_fetch = require('../lib/isomorphic/node/fetch.cjs');
74
64
  var import_debug = require('../lib/debug.cjs');
75
65
  var import_jsonrpc = require('./jsonrpc/jsonrpc.enums.cjs');
76
66
  var import_base_client = require('./base-client.cjs');
@@ -90,7 +80,7 @@ function createConnection(opts) {
90
80
  function send(body, jwt) {
91
81
  return __async(this, null, function* () {
92
82
  const jsonBody = JSON.parse(body);
93
- const res = yield (0, import_node_ponyfill.default)(`${opts.host}/api`, {
83
+ const res = yield (0, import_fetch.fetch)(`${opts.host}/api`, {
94
84
  keepalive: true,
95
85
  method: "POST",
96
86
  headers: {
@@ -102,7 +92,7 @@ function createConnection(opts) {
102
92
  this.onmessage(__spreadProps(__spreadValues({}, responseBody), { id: jsonBody.id }));
103
93
  });
104
94
  }
105
- const $connect = (0, import_node_ponyfill.default)(`${url}/api`, {
95
+ const $connect = (0, import_fetch.fetch)(`${url}/api`, {
106
96
  method: "POST",
107
97
  headers: {
108
98
  Authorization: `Bearer ${opts.jwt}`
@@ -117,7 +107,7 @@ function createConnection(opts) {
117
107
  if (res.error) {
118
108
  throw new Error(res.error.message);
119
109
  }
120
- return true;
110
+ return;
121
111
  });
122
112
  return {
123
113
  send,
@@ -39,7 +39,7 @@ var __async = (__this, __arguments, generator) => {
39
39
  };
40
40
 
41
41
  // src/api/http-client.ts
42
- import fetch from "cross-fetch/dist/node-ponyfill";
42
+ import { fetch } from "../lib/isomorphic/node/fetch";
43
43
  import { debugLog } from "../lib/debug";
44
44
  import {
45
45
  JSONRPC
@@ -88,7 +88,7 @@ function createConnection(opts) {
88
88
  if (res.error) {
89
89
  throw new Error(res.error.message);
90
90
  }
91
- return true;
91
+ return;
92
92
  });
93
93
  return {
94
94
  send,
@@ -61,7 +61,7 @@ var import_base_client = require('./base-client.cjs');
61
61
  var import_connection = require('./connection/connection.enums.cjs');
62
62
  var import__ = require('../index.cjs');
63
63
  var _a;
64
- var CLIENT_VERSION = (_a = '0.8.1') != null ? _a : "";
64
+ var CLIENT_VERSION = (_a = '0.8.3') != null ? _a : "";
65
65
  function createWsClient(opts) {
66
66
  const initialConnection = createConnection(opts);
67
67
  return new WsClient(initialConnection, opts);
@@ -35,7 +35,7 @@ import {
35
35
  } from "./connection/connection.enums";
36
36
  import { WapiClientType } from "../index";
37
37
  var _a;
38
- var CLIENT_VERSION = (_a = '0.8.1') != null ? _a : "";
38
+ var CLIENT_VERSION = (_a = '0.8.3') != null ? _a : "";
39
39
  function createWsClient(opts) {
40
40
  const initialConnection = createConnection(opts);
41
41
  return new WsClient(initialConnection, opts);