@bytescale/sdk 3.0.0-alpha.17 → 3.0.0-alpha.19

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.
@@ -507,6 +507,9 @@ var BaseAPI = /*#__PURE__*/function () {
507
507
  this.config = config;
508
508
  BytescaleApiClientConfigUtils.validate(config);
509
509
  }
510
+ /**
511
+ * Returns a successful response (2**) else throws an error.
512
+ */
510
513
  runtime_createClass(BaseAPI, [{
511
514
  key: "request",
512
515
  value: function request(context, initOverrides, baseUrlOverride) {
@@ -525,64 +528,9 @@ var BaseAPI = /*#__PURE__*/function () {
525
528
  return runtime_await(_this2.createFetchParams(context, initOverrides, baseUrlOverride === undefined ? undefined : (_a = nonDefaultBasePaths[baseUrlOverride]) !== null && _a !== void 0 ? _a : baseUrlOverride), function (_ref) {
526
529
  var url = _ref.url,
527
530
  init = _ref.init;
528
- return _this2.doFetch(url, init, true);
529
- });
530
- } catch (e) {
531
- return Promise.reject(e);
532
- }
533
- }
534
- /**
535
- * Returns a successful response (2**) else throws an error.
536
- */
537
- }, {
538
- key: "doFetch",
539
- value: function doFetch(url, init, isBytescaleApi) {
540
- try {
541
- var _exit3 = false;
542
- var _this4 = this;
543
- var _a, _b;
544
- var response;
545
- return runtime_continue(_catch(function () {
546
- return runtime_await(BytescaleApiClientConfigUtils.getFetchApi(_this4.config)(url, Object.assign(Object.assign({}, init), {
547
- // This is specifically added to cater for Next.js's Fetch implementation, which caches POST requests...
548
- //
549
- // "fetch requests that use the POST method are also automatically cached."
550
- // - https://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating#caching-data
551
- //
552
- // However, this is probably a good idea, even for all GET requests, as if the user is refreshing a JWT
553
- // or downloading a file via 'FileApi.downloadFile', then they'll likely want the latest.
554
- cache: "no-store"
555
- })), function (_BytescaleApiClientCo) {
556
- response = _BytescaleApiClientCo;
557
- });
558
- }, function (e) {
559
- // Network-level errors, CORS errors, or HTTP-level errors from intermediary services (e.g. AWS or the user's own infrastructure/proxies).
560
- // HTTP-level errors from external services (e.g. AWS or the user's own proxy) will appear as CORS errors as their response headers won't include the appropriate CORS values.
561
- throw new Error(isBytescaleApi ? "Unable to resolve the Bytescale API: ".concat(e.message, " If the problem persists, and your network connection is OK, then please contact support@bytescale.com and provide: (a) time of failed request in UTC (b) screenshot of failed network response header + body (c) screenshot of failed network request header + body (d) browser and OS version.") : "Unable to resolve URL (".concat(url, "): ").concat(e.message));
562
- }), function (_result) {
563
- var _exit2 = false;
564
- if (_exit3) return _result;
565
- return response.status >= 200 && response.status < 300 ? response : _invoke(function () {
566
- if (isBytescaleApi) {
567
- var jsonError = undefined;
568
- return runtime_continue(_catch(function () {
569
- return runtime_await(response.json(), function (_response$json) {
570
- jsonError = _response$json;
571
- });
572
- }, runtime_empty), function () {
573
- if (typeof ((_a = jsonError === null || jsonError === void 0 ? void 0 : jsonError.error) === null || _a === void 0 ? void 0 : _a.code) === "string") {
574
- throw new BytescaleApiError(jsonError);
575
- }
576
- // HTTP-level errors from intermediary services (e.g. AWS or the user's own infrastructure/proxies). On the browser,
577
- // this error is unlikely to be triggered since these errors will masqurade as CORS errors (see above) but in Node.js
578
- // this error will appear from any intermediary service failure.
579
- throw new Error("Unable to connect to the Bytescale API (".concat(response.status, "): please try again."));
580
- });
581
- }
582
- }, function (_result2) {
583
- if (_exit2) return _result2;
584
- throw new Error("Failure status code (".concat(response.status, ") received for request: ").concat((_b = init.method) !== null && _b !== void 0 ? _b : "GET", " ").concat(url));
585
- });
531
+ return BaseAPI.fetch(url, init, Object.assign(Object.assign({}, _this2.config), {
532
+ isBytescaleApi: true
533
+ }));
586
534
  });
587
535
  } catch (e) {
588
536
  return Promise.reject(e);
@@ -605,15 +553,15 @@ var BaseAPI = /*#__PURE__*/function () {
605
553
  key: "createFetchParams",
606
554
  value: function createFetchParams(context, initOverrides, baseUrlOverride) {
607
555
  try {
608
- var _this6 = this;
609
- var url = (baseUrlOverride !== null && baseUrlOverride !== void 0 ? baseUrlOverride : BytescaleApiClientConfigUtils.getApiUrl(_this6.config)) + context.path;
556
+ var _this4 = this;
557
+ var url = (baseUrlOverride !== null && baseUrlOverride !== void 0 ? baseUrlOverride : BytescaleApiClientConfigUtils.getApiUrl(_this4.config)) + context.path;
610
558
  if (context.query !== undefined && Object.keys(context.query).length !== 0) {
611
559
  // only add the querystring to the URL if there are query parameters.
612
560
  // this is done to avoid urls ending with a "?" character which buggy webservers
613
561
  // do not handle correctly sometimes.
614
562
  url += "?" + querystring(context.query);
615
563
  }
616
- var configHeaders = _this6.config.headers;
564
+ var configHeaders = _this4.config.headers;
617
565
  var _Object$assign3 = Object.assign({}, context.headers);
618
566
  return runtime_await(configHeaders === undefined ? {} : configHeaders(), function (_configHeaders) {
619
567
  var headers = Object.assign(_Object$assign3, _configHeaders);
@@ -647,6 +595,59 @@ var BaseAPI = /*#__PURE__*/function () {
647
595
  return Promise.reject(e);
648
596
  }
649
597
  }
598
+ }], [{
599
+ key: "fetch",
600
+ value: function fetch(url, init, config) {
601
+ try {
602
+ var _exit3 = false;
603
+ var _a, _b;
604
+ var response;
605
+ return runtime_continue(_catch(function () {
606
+ return runtime_await(BytescaleApiClientConfigUtils.getFetchApi(config)(url, Object.assign(Object.assign({}, init), {
607
+ // This is specifically added to cater for Next.js's Fetch implementation, which caches POST requests...
608
+ //
609
+ // "fetch requests that use the POST method are also automatically cached."
610
+ // - https://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating#caching-data
611
+ //
612
+ // However, this is probably a good idea, even for all GET requests, as if the user is refreshing a JWT
613
+ // or downloading a file via 'FileApi.downloadFile', then they'll likely want the latest.
614
+ cache: "no-store"
615
+ })), function (_BytescaleApiClientCo) {
616
+ response = _BytescaleApiClientCo;
617
+ });
618
+ }, function (e) {
619
+ // Network-level errors, CORS errors, or HTTP-level errors from intermediary services (e.g. AWS or the user's own infrastructure/proxies).
620
+ // HTTP-level errors from external services (e.g. AWS or the user's own proxy) will appear as CORS errors as their response headers won't include the appropriate CORS values.
621
+ throw new Error(config.isBytescaleApi ? "Unable to resolve the Bytescale API: ".concat(e.message, " If the problem persists, and your network connection is OK, then please contact support@bytescale.com and provide: (a) time of failed request in UTC (b) screenshot of failed network response header + body (c) screenshot of failed network request header + body (d) browser and OS version.") : "Unable to resolve URL (".concat(url, "): ").concat(e.message));
622
+ }), function (_result) {
623
+ var _exit2 = false;
624
+ if (_exit3) return _result;
625
+ return response.status >= 200 && response.status < 300 ? response : _invoke(function () {
626
+ if (config.isBytescaleApi) {
627
+ var jsonError = undefined;
628
+ return runtime_continue(_catch(function () {
629
+ return runtime_await(response.json(), function (_response$json) {
630
+ jsonError = _response$json;
631
+ });
632
+ }, runtime_empty), function () {
633
+ if (typeof ((_a = jsonError === null || jsonError === void 0 ? void 0 : jsonError.error) === null || _a === void 0 ? void 0 : _a.code) === "string") {
634
+ throw new BytescaleApiError(jsonError);
635
+ }
636
+ // HTTP-level errors from intermediary services (e.g. AWS or the user's own infrastructure/proxies). On the browser,
637
+ // this error is unlikely to be triggered since these errors will masqurade as CORS errors (see above) but in Node.js
638
+ // this error will appear from any intermediary service failure.
639
+ throw new Error("Unable to connect to the Bytescale API (".concat(response.status, "): please try again."));
640
+ });
641
+ }
642
+ }, function (_result2) {
643
+ if (_exit2) return _result2;
644
+ throw new Error("Failure status code (".concat(response.status, ") received for request: ").concat((_b = init.method) !== null && _b !== void 0 ? _b : "GET", " ").concat(url));
645
+ });
646
+ });
647
+ } catch (e) {
648
+ return Promise.reject(e);
649
+ }
650
+ }
650
651
  }]);
651
652
  return BaseAPI;
652
653
  }();
@@ -654,11 +655,11 @@ var CancelledError = /*#__PURE__*/function (_Error) {
654
655
  _inherits(CancelledError, _Error);
655
656
  var _super = _createSuper(CancelledError);
656
657
  function CancelledError() {
657
- var _this7;
658
+ var _this5;
658
659
  runtime_classCallCheck(this, CancelledError);
659
- _this7 = _super.call(this, "Operation cancelled by caller.");
660
- _this7.name = "CancelledError";
661
- return _this7;
660
+ _this5 = _super.call(this, "Operation cancelled by caller.");
661
+ _this5.name = "CancelledError";
662
+ return _this5;
662
663
  }
663
664
  return runtime_createClass(CancelledError);
664
665
  }( /*#__PURE__*/_wrapNativeSuper(Error));
@@ -666,13 +667,13 @@ var BytescaleApiError = /*#__PURE__*/function (_Error2) {
666
667
  _inherits(BytescaleApiError, _Error2);
667
668
  var _super2 = _createSuper(BytescaleApiError);
668
669
  function BytescaleApiError(response) {
669
- var _this8;
670
+ var _this6;
670
671
  runtime_classCallCheck(this, BytescaleApiError);
671
- _this8 = _super2.call(this, response.error.message);
672
- _this8.name = "BytescaleApiError";
673
- _this8.errorCode = response.error.code;
674
- _this8.details = response.error.details;
675
- return _this8;
672
+ _this6 = _super2.call(this, response.error.message);
673
+ _this6.name = "BytescaleApiError";
674
+ _this6.errorCode = response.error.code;
675
+ _this6.details = response.error.details;
676
+ return _this6;
676
677
  }
677
678
  return runtime_createClass(BytescaleApiError);
678
679
  }( /*#__PURE__*/_wrapNativeSuper(Error));
@@ -698,8 +699,8 @@ var JSONApiResponse = /*#__PURE__*/function () {
698
699
  key: "value",
699
700
  value: function value() {
700
701
  try {
701
- var _this10 = this;
702
- return runtime_await(_this10.raw.json());
702
+ var _this8 = this;
703
+ return runtime_await(_this8.raw.json());
703
704
  } catch (e) {
704
705
  return Promise.reject(e);
705
706
  }
@@ -740,8 +741,8 @@ var BinaryResult = /*#__PURE__*/function () {
740
741
  key: "text",
741
742
  value: function text() {
742
743
  try {
743
- var _this12 = this;
744
- return runtime_await(_this12.raw.text());
744
+ var _this10 = this;
745
+ return runtime_await(_this10.raw.text());
745
746
  } catch (e) {
746
747
  return Promise.reject(e);
747
748
  }
@@ -750,8 +751,8 @@ var BinaryResult = /*#__PURE__*/function () {
750
751
  key: "blob",
751
752
  value: function blob() {
752
753
  try {
753
- var _this14 = this;
754
- return runtime_await(_this14.raw.blob());
754
+ var _this12 = this;
755
+ return runtime_await(_this12.raw.blob());
755
756
  } catch (e) {
756
757
  return Promise.reject(e);
757
758
  }
@@ -760,8 +761,8 @@ var BinaryResult = /*#__PURE__*/function () {
760
761
  key: "json",
761
762
  value: function json() {
762
763
  try {
763
- var _this16 = this;
764
- return runtime_await(_this16.raw.json());
764
+ var _this14 = this;
765
+ return runtime_await(_this14.raw.json());
765
766
  } catch (e) {
766
767
  return Promise.reject(e);
767
768
  }
@@ -2530,13 +2531,13 @@ function AuthManagerNode_createClass(Constructor, protoProps, staticProps) { if
2530
2531
  function AuthManagerNode_toPropertyKey(arg) { var key = AuthManagerNode_toPrimitive(arg, "string"); return AuthManagerNode_typeof(key) === "symbol" ? key : String(key); }
2531
2532
  function AuthManagerNode_toPrimitive(input, hint) { if (AuthManagerNode_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (AuthManagerNode_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
2532
2533
 
2533
- var AuthManager = /*#__PURE__*/function () {
2534
- function AuthManager() {
2535
- AuthManagerNode_classCallCheck(this, AuthManager);
2534
+ var AuthManagerImpl = /*#__PURE__*/function () {
2535
+ function AuthManagerImpl() {
2536
+ AuthManagerNode_classCallCheck(this, AuthManagerImpl);
2536
2537
  }
2537
- AuthManagerNode_createClass(AuthManager, [{
2538
+ AuthManagerNode_createClass(AuthManagerImpl, [{
2538
2539
  key: "beginAuthSession",
2539
- value: function beginAuthSession(_authUrl, _authHeaders) {
2540
+ value: function beginAuthSession(_params) {
2540
2541
  try {
2541
2542
  throw EnvChecker.methodRequiresBrowser("beginAuthSession");
2542
2543
  } catch (e) {
@@ -2558,8 +2559,12 @@ var AuthManager = /*#__PURE__*/function () {
2558
2559
  return false;
2559
2560
  }
2560
2561
  }]);
2561
- return AuthManager;
2562
+ return AuthManagerImpl;
2562
2563
  }();
2564
+ /**
2565
+ * Alternative way of implementing a static class (i.e. all methods static). We do this so we can use a interface on the class (interfaces can't define static methods).
2566
+ */
2567
+ var AuthManager = new AuthManagerImpl();
2563
2568
  ;// CONCATENATED MODULE: ./src/public/worker/index.ts
2564
2569
 
2565
2570
 
@@ -492,6 +492,9 @@ var BaseAPI = /*#__PURE__*/function () {
492
492
  this.config = config;
493
493
  BytescaleApiClientConfigUtils.validate(config);
494
494
  }
495
+ /**
496
+ * Returns a successful response (2**) else throws an error.
497
+ */
495
498
  runtime_createClass(BaseAPI, [{
496
499
  key: "request",
497
500
  value: function request(context, initOverrides, baseUrlOverride) {
@@ -510,64 +513,9 @@ var BaseAPI = /*#__PURE__*/function () {
510
513
  return runtime_await(_this2.createFetchParams(context, initOverrides, baseUrlOverride === undefined ? undefined : (_a = nonDefaultBasePaths[baseUrlOverride]) !== null && _a !== void 0 ? _a : baseUrlOverride), function (_ref) {
511
514
  var url = _ref.url,
512
515
  init = _ref.init;
513
- return _this2.doFetch(url, init, true);
514
- });
515
- } catch (e) {
516
- return Promise.reject(e);
517
- }
518
- }
519
- /**
520
- * Returns a successful response (2**) else throws an error.
521
- */
522
- }, {
523
- key: "doFetch",
524
- value: function doFetch(url, init, isBytescaleApi) {
525
- try {
526
- var _exit3 = false;
527
- var _this4 = this;
528
- var _a, _b;
529
- var response;
530
- return runtime_continue(_catch(function () {
531
- return runtime_await(BytescaleApiClientConfigUtils.getFetchApi(_this4.config)(url, Object.assign(Object.assign({}, init), {
532
- // This is specifically added to cater for Next.js's Fetch implementation, which caches POST requests...
533
- //
534
- // "fetch requests that use the POST method are also automatically cached."
535
- // - https://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating#caching-data
536
- //
537
- // However, this is probably a good idea, even for all GET requests, as if the user is refreshing a JWT
538
- // or downloading a file via 'FileApi.downloadFile', then they'll likely want the latest.
539
- cache: "no-store"
540
- })), function (_BytescaleApiClientCo) {
541
- response = _BytescaleApiClientCo;
542
- });
543
- }, function (e) {
544
- // Network-level errors, CORS errors, or HTTP-level errors from intermediary services (e.g. AWS or the user's own infrastructure/proxies).
545
- // HTTP-level errors from external services (e.g. AWS or the user's own proxy) will appear as CORS errors as their response headers won't include the appropriate CORS values.
546
- throw new Error(isBytescaleApi ? "Unable to resolve the Bytescale API: ".concat(e.message, " If the problem persists, and your network connection is OK, then please contact support@bytescale.com and provide: (a) time of failed request in UTC (b) screenshot of failed network response header + body (c) screenshot of failed network request header + body (d) browser and OS version.") : "Unable to resolve URL (".concat(url, "): ").concat(e.message));
547
- }), function (_result) {
548
- var _exit2 = false;
549
- if (_exit3) return _result;
550
- return response.status >= 200 && response.status < 300 ? response : _invoke(function () {
551
- if (isBytescaleApi) {
552
- var jsonError = undefined;
553
- return runtime_continue(_catch(function () {
554
- return runtime_await(response.json(), function (_response$json) {
555
- jsonError = _response$json;
556
- });
557
- }, runtime_empty), function () {
558
- if (typeof ((_a = jsonError === null || jsonError === void 0 ? void 0 : jsonError.error) === null || _a === void 0 ? void 0 : _a.code) === "string") {
559
- throw new BytescaleApiError(jsonError);
560
- }
561
- // HTTP-level errors from intermediary services (e.g. AWS or the user's own infrastructure/proxies). On the browser,
562
- // this error is unlikely to be triggered since these errors will masqurade as CORS errors (see above) but in Node.js
563
- // this error will appear from any intermediary service failure.
564
- throw new Error("Unable to connect to the Bytescale API (".concat(response.status, "): please try again."));
565
- });
566
- }
567
- }, function (_result2) {
568
- if (_exit2) return _result2;
569
- throw new Error("Failure status code (".concat(response.status, ") received for request: ").concat((_b = init.method) !== null && _b !== void 0 ? _b : "GET", " ").concat(url));
570
- });
516
+ return BaseAPI.fetch(url, init, Object.assign(Object.assign({}, _this2.config), {
517
+ isBytescaleApi: true
518
+ }));
571
519
  });
572
520
  } catch (e) {
573
521
  return Promise.reject(e);
@@ -590,15 +538,15 @@ var BaseAPI = /*#__PURE__*/function () {
590
538
  key: "createFetchParams",
591
539
  value: function createFetchParams(context, initOverrides, baseUrlOverride) {
592
540
  try {
593
- var _this6 = this;
594
- var url = (baseUrlOverride !== null && baseUrlOverride !== void 0 ? baseUrlOverride : BytescaleApiClientConfigUtils.getApiUrl(_this6.config)) + context.path;
541
+ var _this4 = this;
542
+ var url = (baseUrlOverride !== null && baseUrlOverride !== void 0 ? baseUrlOverride : BytescaleApiClientConfigUtils.getApiUrl(_this4.config)) + context.path;
595
543
  if (context.query !== undefined && Object.keys(context.query).length !== 0) {
596
544
  // only add the querystring to the URL if there are query parameters.
597
545
  // this is done to avoid urls ending with a "?" character which buggy webservers
598
546
  // do not handle correctly sometimes.
599
547
  url += "?" + querystring(context.query);
600
548
  }
601
- var configHeaders = _this6.config.headers;
549
+ var configHeaders = _this4.config.headers;
602
550
  var _Object$assign3 = Object.assign({}, context.headers);
603
551
  return runtime_await(configHeaders === undefined ? {} : configHeaders(), function (_configHeaders) {
604
552
  var headers = Object.assign(_Object$assign3, _configHeaders);
@@ -632,6 +580,59 @@ var BaseAPI = /*#__PURE__*/function () {
632
580
  return Promise.reject(e);
633
581
  }
634
582
  }
583
+ }], [{
584
+ key: "fetch",
585
+ value: function fetch(url, init, config) {
586
+ try {
587
+ var _exit3 = false;
588
+ var _a, _b;
589
+ var response;
590
+ return runtime_continue(_catch(function () {
591
+ return runtime_await(BytescaleApiClientConfigUtils.getFetchApi(config)(url, Object.assign(Object.assign({}, init), {
592
+ // This is specifically added to cater for Next.js's Fetch implementation, which caches POST requests...
593
+ //
594
+ // "fetch requests that use the POST method are also automatically cached."
595
+ // - https://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating#caching-data
596
+ //
597
+ // However, this is probably a good idea, even for all GET requests, as if the user is refreshing a JWT
598
+ // or downloading a file via 'FileApi.downloadFile', then they'll likely want the latest.
599
+ cache: "no-store"
600
+ })), function (_BytescaleApiClientCo) {
601
+ response = _BytescaleApiClientCo;
602
+ });
603
+ }, function (e) {
604
+ // Network-level errors, CORS errors, or HTTP-level errors from intermediary services (e.g. AWS or the user's own infrastructure/proxies).
605
+ // HTTP-level errors from external services (e.g. AWS or the user's own proxy) will appear as CORS errors as their response headers won't include the appropriate CORS values.
606
+ throw new Error(config.isBytescaleApi ? "Unable to resolve the Bytescale API: ".concat(e.message, " If the problem persists, and your network connection is OK, then please contact support@bytescale.com and provide: (a) time of failed request in UTC (b) screenshot of failed network response header + body (c) screenshot of failed network request header + body (d) browser and OS version.") : "Unable to resolve URL (".concat(url, "): ").concat(e.message));
607
+ }), function (_result) {
608
+ var _exit2 = false;
609
+ if (_exit3) return _result;
610
+ return response.status >= 200 && response.status < 300 ? response : _invoke(function () {
611
+ if (config.isBytescaleApi) {
612
+ var jsonError = undefined;
613
+ return runtime_continue(_catch(function () {
614
+ return runtime_await(response.json(), function (_response$json) {
615
+ jsonError = _response$json;
616
+ });
617
+ }, runtime_empty), function () {
618
+ if (typeof ((_a = jsonError === null || jsonError === void 0 ? void 0 : jsonError.error) === null || _a === void 0 ? void 0 : _a.code) === "string") {
619
+ throw new BytescaleApiError(jsonError);
620
+ }
621
+ // HTTP-level errors from intermediary services (e.g. AWS or the user's own infrastructure/proxies). On the browser,
622
+ // this error is unlikely to be triggered since these errors will masqurade as CORS errors (see above) but in Node.js
623
+ // this error will appear from any intermediary service failure.
624
+ throw new Error("Unable to connect to the Bytescale API (".concat(response.status, "): please try again."));
625
+ });
626
+ }
627
+ }, function (_result2) {
628
+ if (_exit2) return _result2;
629
+ throw new Error("Failure status code (".concat(response.status, ") received for request: ").concat((_b = init.method) !== null && _b !== void 0 ? _b : "GET", " ").concat(url));
630
+ });
631
+ });
632
+ } catch (e) {
633
+ return Promise.reject(e);
634
+ }
635
+ }
635
636
  }]);
636
637
  return BaseAPI;
637
638
  }();
@@ -639,11 +640,11 @@ var CancelledError = /*#__PURE__*/function (_Error) {
639
640
  _inherits(CancelledError, _Error);
640
641
  var _super = _createSuper(CancelledError);
641
642
  function CancelledError() {
642
- var _this7;
643
+ var _this5;
643
644
  runtime_classCallCheck(this, CancelledError);
644
- _this7 = _super.call(this, "Operation cancelled by caller.");
645
- _this7.name = "CancelledError";
646
- return _this7;
645
+ _this5 = _super.call(this, "Operation cancelled by caller.");
646
+ _this5.name = "CancelledError";
647
+ return _this5;
647
648
  }
648
649
  return runtime_createClass(CancelledError);
649
650
  }( /*#__PURE__*/_wrapNativeSuper(Error));
@@ -651,13 +652,13 @@ var BytescaleApiError = /*#__PURE__*/function (_Error2) {
651
652
  _inherits(BytescaleApiError, _Error2);
652
653
  var _super2 = _createSuper(BytescaleApiError);
653
654
  function BytescaleApiError(response) {
654
- var _this8;
655
+ var _this6;
655
656
  runtime_classCallCheck(this, BytescaleApiError);
656
- _this8 = _super2.call(this, response.error.message);
657
- _this8.name = "BytescaleApiError";
658
- _this8.errorCode = response.error.code;
659
- _this8.details = response.error.details;
660
- return _this8;
657
+ _this6 = _super2.call(this, response.error.message);
658
+ _this6.name = "BytescaleApiError";
659
+ _this6.errorCode = response.error.code;
660
+ _this6.details = response.error.details;
661
+ return _this6;
661
662
  }
662
663
  return runtime_createClass(BytescaleApiError);
663
664
  }( /*#__PURE__*/_wrapNativeSuper(Error));
@@ -683,8 +684,8 @@ var JSONApiResponse = /*#__PURE__*/function () {
683
684
  key: "value",
684
685
  value: function value() {
685
686
  try {
686
- var _this10 = this;
687
- return runtime_await(_this10.raw.json());
687
+ var _this8 = this;
688
+ return runtime_await(_this8.raw.json());
688
689
  } catch (e) {
689
690
  return Promise.reject(e);
690
691
  }
@@ -725,8 +726,8 @@ var BinaryResult = /*#__PURE__*/function () {
725
726
  key: "text",
726
727
  value: function text() {
727
728
  try {
728
- var _this12 = this;
729
- return runtime_await(_this12.raw.text());
729
+ var _this10 = this;
730
+ return runtime_await(_this10.raw.text());
730
731
  } catch (e) {
731
732
  return Promise.reject(e);
732
733
  }
@@ -735,8 +736,8 @@ var BinaryResult = /*#__PURE__*/function () {
735
736
  key: "blob",
736
737
  value: function blob() {
737
738
  try {
738
- var _this14 = this;
739
- return runtime_await(_this14.raw.blob());
739
+ var _this12 = this;
740
+ return runtime_await(_this12.raw.blob());
740
741
  } catch (e) {
741
742
  return Promise.reject(e);
742
743
  }
@@ -745,8 +746,8 @@ var BinaryResult = /*#__PURE__*/function () {
745
746
  key: "json",
746
747
  value: function json() {
747
748
  try {
748
- var _this16 = this;
749
- return runtime_await(_this16.raw.json());
749
+ var _this14 = this;
750
+ return runtime_await(_this14.raw.json());
750
751
  } catch (e) {
751
752
  return Promise.reject(e);
752
753
  }
@@ -2515,13 +2516,13 @@ function AuthManagerNode_createClass(Constructor, protoProps, staticProps) { if
2515
2516
  function AuthManagerNode_toPropertyKey(arg) { var key = AuthManagerNode_toPrimitive(arg, "string"); return AuthManagerNode_typeof(key) === "symbol" ? key : String(key); }
2516
2517
  function AuthManagerNode_toPrimitive(input, hint) { if (AuthManagerNode_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (AuthManagerNode_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
2517
2518
 
2518
- var AuthManager = /*#__PURE__*/function () {
2519
- function AuthManager() {
2520
- AuthManagerNode_classCallCheck(this, AuthManager);
2519
+ var AuthManagerImpl = /*#__PURE__*/function () {
2520
+ function AuthManagerImpl() {
2521
+ AuthManagerNode_classCallCheck(this, AuthManagerImpl);
2521
2522
  }
2522
- AuthManagerNode_createClass(AuthManager, [{
2523
+ AuthManagerNode_createClass(AuthManagerImpl, [{
2523
2524
  key: "beginAuthSession",
2524
- value: function beginAuthSession(_authUrl, _authHeaders) {
2525
+ value: function beginAuthSession(_params) {
2525
2526
  try {
2526
2527
  throw EnvChecker.methodRequiresBrowser("beginAuthSession");
2527
2528
  } catch (e) {
@@ -2543,8 +2544,12 @@ var AuthManager = /*#__PURE__*/function () {
2543
2544
  return false;
2544
2545
  }
2545
2546
  }]);
2546
- return AuthManager;
2547
+ return AuthManagerImpl;
2547
2548
  }();
2549
+ /**
2550
+ * Alternative way of implementing a static class (i.e. all methods static). We do this so we can use a interface on the class (interfaces can't define static methods).
2551
+ */
2552
+ var AuthManager = new AuthManagerImpl();
2548
2553
  ;// CONCATENATED MODULE: ./src/public/worker/index.ts
2549
2554
 
2550
2555
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytescale/sdk",
3
- "version": "3.0.0-alpha.17",
3
+ "version": "3.0.0-alpha.19",
4
4
  "description": "Bytescale JavaScript SDK",
5
5
  "author": "Bytescale <hello@bytescale.com> (https://www.bytescale.com)",
6
6
  "license": "MIT",