@bytescale/sdk 1.2.0 → 1.3.0

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.
Files changed (48) hide show
  1. package/dist/browser/cjs/main.js +891 -179
  2. package/dist/node/cjs/main.js +405 -186
  3. package/dist/node/esm/main.mjs +411 -188
  4. package/dist/types/index.d.ts +2 -0
  5. package/dist/types/private/AuthSessionState.d.ts +13 -0
  6. package/dist/types/private/ConsoleUtils.d.ts +5 -0
  7. package/dist/types/private/EnvChecker.d.ts +4 -0
  8. package/dist/types/private/Mutex.d.ts +16 -0
  9. package/dist/types/private/TypeUtils.d.ts +2 -0
  10. package/dist/types/{uploads/private → private}/UploadManagerBase.d.ts +2 -2
  11. package/dist/types/private/dtos/SetAccessTokenRequestDto.d.ts +6 -0
  12. package/dist/types/private/dtos/SetAccessTokenResponseDto.d.ts +7 -0
  13. package/dist/types/private/model/AuthManagerInterface.d.ts +44 -0
  14. package/dist/types/private/model/AuthSession.d.ts +7 -0
  15. package/dist/types/private/model/UploadManagerInterface.d.ts +5 -0
  16. package/dist/types/{uploads/private → private}/model/UploadSourceProcessed.d.ts +1 -1
  17. package/dist/types/public/browser/AuthManagerBrowser.d.ts +20 -0
  18. package/dist/types/{uploads/public → public}/browser/UploadManagerBrowser.d.ts +2 -2
  19. package/dist/types/{uploads/public → public}/browser/index.d.ts +1 -0
  20. package/dist/types/public/node/AuthManagerNode.d.ts +6 -0
  21. package/dist/types/{uploads/public → public}/node/UploadManagerNode.d.ts +2 -2
  22. package/dist/types/{uploads/public → public}/node/index.d.ts +1 -0
  23. package/dist/types/{uploads/public/shared/Model.d.ts → public/shared/CommonTypes.d.ts} +3 -9
  24. package/dist/types/public/shared/UrlBuilder.d.ts +28 -0
  25. package/dist/types/public/shared/UrlBuilderTypes.d.ts +173 -0
  26. package/dist/types/{generated → public/shared/generated}/runtime.d.ts +44 -14
  27. package/dist/types/public/shared/index.d.ts +4 -0
  28. package/package.json +2 -2
  29. package/tests/ChunkedStream.test.ts +1 -1
  30. package/tests/UrlBuilder.test.ts +168 -0
  31. package/dist/types/index.browser.d.ts +0 -3
  32. package/dist/types/index.node.d.ts +0 -3
  33. package/dist/types/uploads/private/TypeUtils.d.ts +0 -1
  34. package/dist/types/uploads/private/model/UploadManagerInterface.d.ts +0 -5
  35. package/dist/types/uploads/public/shared/index.d.ts +0 -1
  36. /package/dist/types/{uploads/private → private}/NodeChunkedStream.d.ts +0 -0
  37. /package/dist/types/{uploads/private → private}/StreamUtils.d.ts +0 -0
  38. /package/dist/types/{uploads/private → private}/model/AddCancellationHandler.d.ts +0 -0
  39. /package/dist/types/{uploads/private → private}/model/OnPartProgress.d.ts +0 -0
  40. /package/dist/types/{uploads/private → private}/model/PreUploadInfo.d.ts +0 -0
  41. /package/dist/types/{uploads/private → private}/model/PutUploadPartResult.d.ts +0 -0
  42. /package/dist/types/{generated → public/shared/generated}/apis/FileApi.d.ts +0 -0
  43. /package/dist/types/{generated → public/shared/generated}/apis/FolderApi.d.ts +0 -0
  44. /package/dist/types/{generated → public/shared/generated}/apis/JobApi.d.ts +0 -0
  45. /package/dist/types/{generated → public/shared/generated}/apis/UploadApi.d.ts +0 -0
  46. /package/dist/types/{generated → public/shared/generated}/apis/index.d.ts +0 -0
  47. /package/dist/types/{generated → public/shared/generated}/index.d.ts +0 -0
  48. /package/dist/types/{generated → public/shared/generated}/models/index.d.ts +0 -0
@@ -61,26 +61,40 @@ __lib_require__.r(__lib_exports__);
61
61
 
62
62
  // EXPORTS
63
63
  __lib_require__.d(__lib_exports__, {
64
- "BASE_PATH": function() { return /* reexport */ BASE_PATH; },
64
+ "AuthManager": function() { return /* reexport */ AuthManager; },
65
65
  "BaseAPI": function() { return /* reexport */ BaseAPI; },
66
66
  "BinaryResult": function() { return /* reexport */ BinaryResult; },
67
+ "BytescaleApiClientConfigResolver": function() { return /* reexport */ BytescaleApiClientConfigResolver; },
67
68
  "BytescaleApiError": function() { return /* reexport */ BytescaleApiError; },
68
69
  "CancelledError": function() { return /* reexport */ CancelledError; },
70
+ "CommonTypesNoOp": function() { return /* reexport */ CommonTypesNoOp; },
69
71
  "FileApi": function() { return /* reexport */ FileApi; },
70
72
  "FolderApi": function() { return /* reexport */ FolderApi; },
71
73
  "JSONApiResponse": function() { return /* reexport */ JSONApiResponse; },
72
74
  "JobApi": function() { return /* reexport */ JobApi; },
73
75
  "UploadApi": function() { return /* reexport */ UploadApi; },
74
76
  "UploadManager": function() { return /* reexport */ UploadManager; },
77
+ "UrlBuilder": function() { return /* reexport */ UrlBuilder; },
78
+ "UrlBuilderTypesNoOp": function() { return /* reexport */ UrlBuilderTypesNoOp; },
75
79
  "VoidApiResponse": function() { return /* reexport */ VoidApiResponse; },
76
80
  "querystring": function() { return /* reexport */ querystring; }
77
81
  });
78
82
 
79
- ;// CONCATENATED MODULE: ./src/generated/runtime.ts
83
+ ;// CONCATENATED MODULE: ./src/private/AuthSessionState.ts
80
84
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
85
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
86
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
87
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
88
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
89
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
90
+ var AuthSessionState = /*#__PURE__*/_createClass(function AuthSessionState() {
91
+ _classCallCheck(this, AuthSessionState);
92
+ });
93
+ ;// CONCATENATED MODULE: ./src/public/shared/generated/runtime.ts
94
+ function runtime_typeof(obj) { "@babel/helpers - typeof"; return runtime_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, runtime_typeof(obj); }
81
95
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
82
96
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
83
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
97
+ function _possibleConstructorReturn(self, call) { if (call && (runtime_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
84
98
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
85
99
  function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
86
100
  function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
@@ -88,15 +102,6 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
88
102
  function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
89
103
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
90
104
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
91
- function _await(value, then, direct) {
92
- if (direct) {
93
- return then ? then(value) : value;
94
- }
95
- if (!value || !value.then) {
96
- value = Promise.resolve(value);
97
- }
98
- return then ? value.then(then) : value;
99
- }
100
105
  function _catch(body, recover) {
101
106
  try {
102
107
  var result = body();
@@ -108,22 +113,10 @@ function _catch(body, recover) {
108
113
  }
109
114
  return result;
110
115
  }
116
+ function _empty() {}
111
117
  function _continue(value, then) {
112
118
  return value && value.then ? value.then(then) : then(value);
113
119
  }
114
- function _async(f) {
115
- return function () {
116
- for (var args = [], i = 0; i < arguments.length; i++) {
117
- args[i] = arguments[i];
118
- }
119
- try {
120
- return Promise.resolve(f.apply(this, args));
121
- } catch (e) {
122
- return Promise.reject(e);
123
- }
124
- };
125
- }
126
- function _empty() {}
127
120
  function _invoke(body, then) {
128
121
  var result = body();
129
122
  if (result && result.then) {
@@ -131,81 +124,122 @@ function _invoke(body, then) {
131
124
  }
132
125
  return then(result);
133
126
  }
134
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
135
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
136
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
137
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
138
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
139
- /**
140
- * @bytescale/api
141
- * Bytescale API
142
- *
143
- * The version of the OpenAPI document: 2.0.0
144
- * Contact: hello@bytescale.com
145
- *
146
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
147
- * https://openapi-generator.tech
148
- * Do not edit the class manually.
149
- */
150
- var BASE_PATH = "https://api.bytescale.com".replace(/\/+$/, "");
127
+ function _defineProperty(obj, key, value) { key = runtime_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
128
+ function _await(value, then, direct) {
129
+ if (direct) {
130
+ return then ? then(value) : value;
131
+ }
132
+ if (!value || !value.then) {
133
+ value = Promise.resolve(value);
134
+ }
135
+ return then ? value.then(then) : value;
136
+ }
137
+ function runtime_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
138
+ function runtime_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, runtime_toPropertyKey(descriptor.key), descriptor); } }
139
+ function runtime_createClass(Constructor, protoProps, staticProps) { if (protoProps) runtime_defineProperties(Constructor.prototype, protoProps); if (staticProps) runtime_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
140
+ function runtime_toPropertyKey(arg) { var key = runtime_toPrimitive(arg, "string"); return runtime_typeof(key) === "symbol" ? key : String(key); }
141
+ function runtime_toPrimitive(input, hint) { if (runtime_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (runtime_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
142
+
143
+ var BytescaleApiClientConfigResolver = /*#__PURE__*/function () {
144
+ function BytescaleApiClientConfigResolver() {
145
+ runtime_classCallCheck(this, BytescaleApiClientConfigResolver);
146
+ }
147
+ runtime_createClass(BytescaleApiClientConfigResolver, null, [{
148
+ key: "getApiUrl",
149
+ value: function getApiUrl(config) {
150
+ var _a;
151
+ return (_a = config.apiUrl) !== null && _a !== void 0 ? _a : BytescaleApiClientConfigResolver.defaultApiUrl;
152
+ }
153
+ }, {
154
+ key: "getCdnUrl",
155
+ value: function getCdnUrl(config) {
156
+ var _a;
157
+ return (_a = config.cdnUrl) !== null && _a !== void 0 ? _a : BytescaleApiClientConfigResolver.defaultCdnUrl;
158
+ }
159
+ }, {
160
+ key: "getFetchApi",
161
+ value: function getFetchApi(config) {
162
+ var _a;
163
+ return (_a = config.fetchApi) !== null && _a !== void 0 ? _a : fetch;
164
+ }
165
+ }]);
166
+ return BytescaleApiClientConfigResolver;
167
+ }();
168
+ BytescaleApiClientConfigResolver.defaultApiUrl = "https://api.bytescale.com";
169
+ BytescaleApiClientConfigResolver.defaultCdnUrl = "https://upcdn.io";
151
170
  /**
152
171
  * This is the base class for all generated API classes.
153
172
  */
154
173
  var BaseAPI = /*#__PURE__*/function () {
155
174
  function BaseAPI(config) {
156
- var _this = this;
157
- _classCallCheck(this, BaseAPI);
175
+ runtime_classCallCheck(this, BaseAPI);
158
176
  this.config = config;
159
- this.fetchApi = _async(function (url, init) {
160
- var _exit = false;
161
- var fetchParams = {
162
- url: url,
163
- init: init
164
- };
165
- var response = undefined;
166
- return _continue(_catch(function () {
167
- return _await((_this.config.fetchApi || fetch)(fetchParams.url, fetchParams.init), function (_temp) {
168
- response = _temp;
169
- });
170
- }, function (e) {
171
- if (response === undefined) {
172
- throw e;
173
- }
174
- }), function (_result) {
175
- return _exit ? _result : response;
176
- });
177
- });
178
177
  }
179
- _createClass(BaseAPI, [{
178
+ runtime_createClass(BaseAPI, [{
180
179
  key: "request",
181
- value: function request(context, initOverrides, operationBasePathOverride) {
180
+ value: function request(context, initOverrides, baseUrlOverride) {
182
181
  try {
183
- var _this3 = this;
184
- var _a;
185
- var apiKey = _this3.config.apiKey;
182
+ var _this2 = this;
183
+ var _a, _b;
184
+ var apiKey = _this2.config.apiKey;
186
185
  context.headers["Authorization"] = "Bearer ".concat(apiKey); // authorization-header authentication
187
- return _await(_this3.createFetchParams(context, initOverrides, operationBasePathOverride), function (_ref) {
186
+ if (((_a = AuthSessionState.session) === null || _a === void 0 ? void 0 : _a.accessToken) !== undefined) {
187
+ context.headers["Authorization-Token"] = AuthSessionState.session.accessToken;
188
+ }
189
+ // Key: any possible value for 'baseUrlOverride'
190
+ // Value: user-overridden value for that base URL from the config.
191
+ var nonDefaultBasePaths = _defineProperty({}, BytescaleApiClientConfigResolver.defaultCdnUrl, BytescaleApiClientConfigResolver.getCdnUrl(_this2.config));
192
+ return _await(_this2.createFetchParams(context, initOverrides, baseUrlOverride === undefined ? undefined : (_b = nonDefaultBasePaths[baseUrlOverride]) !== null && _b !== void 0 ? _b : baseUrlOverride), function (_ref) {
188
193
  var url = _ref.url,
189
194
  init = _ref.init;
190
- return _await(_this3.fetchApi(url, init), function (response) {
191
- var _exit2 = false;
192
- return response && response.status >= 200 && response.status < 300 ? response : _invoke(function () {
193
- if (response !== undefined) {
194
- var jsonError = undefined;
195
- return _continue(_catch(function () {
196
- return _await(response.json(), function (_response$json) {
197
- jsonError = _response$json;
198
- });
199
- }, _empty), function () {
200
- if (typeof ((_a = jsonError === null || jsonError === void 0 ? void 0 : jsonError.error) === null || _a === void 0 ? void 0 : _a.code) === "string") {
201
- throw new BytescaleApiError(jsonError);
202
- }
195
+ return _this2.doFetch(url, init, true);
196
+ });
197
+ } catch (e) {
198
+ return Promise.reject(e);
199
+ }
200
+ }
201
+ /**
202
+ * Returns a successful response (2**) else throws an error.
203
+ */
204
+ }, {
205
+ key: "doFetch",
206
+ value: function doFetch(url, init, isBytescaleApi) {
207
+ try {
208
+ var _exit3 = false;
209
+ var _this4 = this;
210
+ var _a, _b;
211
+ var response;
212
+ return _continue(_catch(function () {
213
+ return _await(BytescaleApiClientConfigResolver.getFetchApi(_this4.config)(url, init), function (_BytescaleApiClientCo) {
214
+ response = _BytescaleApiClientCo;
215
+ });
216
+ }, function (e) {
217
+ // Network-level errors, CORS errors, or HTTP-level errors from intermediary services (e.g. AWS or the user's own infrastructure/proxies).
218
+ // 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.
219
+ 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));
220
+ }), function (_result) {
221
+ var _exit2 = false;
222
+ if (_exit3) return _result;
223
+ return response.status >= 200 && response.status < 300 ? response : _invoke(function () {
224
+ if (isBytescaleApi) {
225
+ var jsonError = undefined;
226
+ return _continue(_catch(function () {
227
+ return _await(response.json(), function (_response$json) {
228
+ jsonError = _response$json;
203
229
  });
204
- }
205
- }, function (_result2) {
206
- if (_exit2) return _result2;
207
- throw new Error("Unable to connect to the Bytescale API: please try again.");
208
- });
230
+ }, _empty), function () {
231
+ if (typeof ((_a = jsonError === null || jsonError === void 0 ? void 0 : jsonError.error) === null || _a === void 0 ? void 0 : _a.code) === "string") {
232
+ throw new BytescaleApiError(jsonError);
233
+ }
234
+ // HTTP-level errors from intermediary services (e.g. AWS or the user's own infrastructure/proxies). On the browser,
235
+ // this error is unlikely to be triggered since these errors will masqurade as CORS errors (see above) but in Node.js
236
+ // this error will appear from any intermediary service failure.
237
+ throw new Error("Unable to connect to the Bytescale API (".concat(response.status, "): please try again."));
238
+ });
239
+ }
240
+ }, function (_result2) {
241
+ if (_exit2) return _result2;
242
+ throw new Error("Failure status code (".concat(response.status, ") received for request: ").concat((_b = init.method) !== null && _b !== void 0 ? _b : "GET", " ").concat(url));
209
243
  });
210
244
  });
211
245
  } catch (e) {
@@ -227,17 +261,17 @@ var BaseAPI = /*#__PURE__*/function () {
227
261
  }
228
262
  }, {
229
263
  key: "createFetchParams",
230
- value: function createFetchParams(context, initOverrides, operationBasePathOverride) {
264
+ value: function createFetchParams(context, initOverrides, baseUrlOverride) {
231
265
  try {
232
- var _this5 = this;
233
- var url = (operationBasePathOverride !== null && operationBasePathOverride !== void 0 ? operationBasePathOverride : BASE_PATH) + context.path;
266
+ var _this6 = this;
267
+ var url = (baseUrlOverride !== null && baseUrlOverride !== void 0 ? baseUrlOverride : BytescaleApiClientConfigResolver.getApiUrl(_this6.config)) + context.path;
234
268
  if (context.query !== undefined && Object.keys(context.query).length !== 0) {
235
269
  // only add the querystring to the URL if there are query parameters.
236
270
  // this is done to avoid urls ending with a "?" character which buggy webservers
237
271
  // do not handle correctly sometimes.
238
272
  url += "?" + querystring(context.query);
239
273
  }
240
- var configHeaders = _this5.config.headers;
274
+ var configHeaders = _this6.config.headers;
241
275
  var _Object$assign3 = Object.assign({}, context.headers);
242
276
  return _await(configHeaders === undefined ? {} : configHeaders(), function (_configHeaders) {
243
277
  var headers = Object.assign(_Object$assign3, _configHeaders);
@@ -274,19 +308,34 @@ var BaseAPI = /*#__PURE__*/function () {
274
308
  }]);
275
309
  return BaseAPI;
276
310
  }();
277
- var BytescaleApiError = /*#__PURE__*/function (_Error) {
278
- _inherits(BytescaleApiError, _Error);
279
- var _super = _createSuper(BytescaleApiError);
311
+ BaseAPI.specialApiKeys = ["free", "demo"];
312
+ BaseAPI.specialApiKeyAccountId = "W142hJk";
313
+ BaseAPI.accountIdLength = 7; // Sync with: upload/shared/**/AccountIdUtils
314
+ var CancelledError = /*#__PURE__*/function (_Error) {
315
+ _inherits(CancelledError, _Error);
316
+ var _super = _createSuper(CancelledError);
317
+ function CancelledError() {
318
+ var _this7;
319
+ runtime_classCallCheck(this, CancelledError);
320
+ _this7 = _super.call(this, "Operation cancelled by caller.");
321
+ _this7.name = "CancelledError";
322
+ return _this7;
323
+ }
324
+ return runtime_createClass(CancelledError);
325
+ }( /*#__PURE__*/_wrapNativeSuper(Error));
326
+ var BytescaleApiError = /*#__PURE__*/function (_Error2) {
327
+ _inherits(BytescaleApiError, _Error2);
328
+ var _super2 = _createSuper(BytescaleApiError);
280
329
  function BytescaleApiError(response) {
281
- var _this6;
282
- _classCallCheck(this, BytescaleApiError);
283
- _this6 = _super.call(this, response.error.message);
284
- _this6.name = "BytescaleApiError";
285
- _this6.errorCode = response.error.code;
286
- _this6.details = response.error.details;
287
- return _this6;
330
+ var _this8;
331
+ runtime_classCallCheck(this, BytescaleApiError);
332
+ _this8 = _super2.call(this, response.error.message);
333
+ _this8.name = "BytescaleApiError";
334
+ _this8.errorCode = response.error.code;
335
+ _this8.details = response.error.details;
336
+ return _this8;
288
337
  }
289
- return _createClass(BytescaleApiError);
338
+ return runtime_createClass(BytescaleApiError);
290
339
  }( /*#__PURE__*/_wrapNativeSuper(Error));
291
340
  function querystring(params) {
292
341
  var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
@@ -319,22 +368,15 @@ function querystringSingleKey(key, value) {
319
368
  }
320
369
  var JSONApiResponse = /*#__PURE__*/function () {
321
370
  function JSONApiResponse(raw) {
322
- var transformer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (jsonValue) {
323
- return jsonValue;
324
- };
325
- _classCallCheck(this, JSONApiResponse);
371
+ runtime_classCallCheck(this, JSONApiResponse);
326
372
  this.raw = raw;
327
- this.transformer = transformer;
328
373
  }
329
- _createClass(JSONApiResponse, [{
374
+ runtime_createClass(JSONApiResponse, [{
330
375
  key: "value",
331
376
  value: function value() {
332
377
  try {
333
- var _this8 = this;
334
- var _transformer2 = _this8.transformer;
335
- return _await(_this8.raw.json(), function (_this7$raw$json) {
336
- return _transformer2.call(_this8, _this7$raw$json);
337
- });
378
+ var _this10 = this;
379
+ return _await(_this10.raw.json());
338
380
  } catch (e) {
339
381
  return Promise.reject(e);
340
382
  }
@@ -344,10 +386,10 @@ var JSONApiResponse = /*#__PURE__*/function () {
344
386
  }();
345
387
  var VoidApiResponse = /*#__PURE__*/function () {
346
388
  function VoidApiResponse(raw) {
347
- _classCallCheck(this, VoidApiResponse);
389
+ runtime_classCallCheck(this, VoidApiResponse);
348
390
  this.raw = raw;
349
391
  }
350
- _createClass(VoidApiResponse, [{
392
+ runtime_createClass(VoidApiResponse, [{
351
393
  key: "value",
352
394
  value: function value() {
353
395
  return _await(undefined);
@@ -357,10 +399,10 @@ var VoidApiResponse = /*#__PURE__*/function () {
357
399
  }();
358
400
  var BinaryResult = /*#__PURE__*/function () {
359
401
  function BinaryResult(raw) {
360
- _classCallCheck(this, BinaryResult);
402
+ runtime_classCallCheck(this, BinaryResult);
361
403
  this.raw = raw;
362
404
  }
363
- _createClass(BinaryResult, [{
405
+ runtime_createClass(BinaryResult, [{
364
406
  key: "stream",
365
407
  value: function stream() {
366
408
  if (this.raw.bodyUsed) {
@@ -375,8 +417,8 @@ var BinaryResult = /*#__PURE__*/function () {
375
417
  key: "text",
376
418
  value: function text() {
377
419
  try {
378
- var _this10 = this;
379
- return _await(_this10.raw.text());
420
+ var _this12 = this;
421
+ return _await(_this12.raw.text());
380
422
  } catch (e) {
381
423
  return Promise.reject(e);
382
424
  }
@@ -385,8 +427,8 @@ var BinaryResult = /*#__PURE__*/function () {
385
427
  key: "blob",
386
428
  value: function blob() {
387
429
  try {
388
- var _this12 = this;
389
- return _await(_this12.raw.blob());
430
+ var _this14 = this;
431
+ return _await(_this14.raw.blob());
390
432
  } catch (e) {
391
433
  return Promise.reject(e);
392
434
  }
@@ -395,8 +437,8 @@ var BinaryResult = /*#__PURE__*/function () {
395
437
  key: "json",
396
438
  value: function json() {
397
439
  try {
398
- var _this14 = this;
399
- return _await(_this14.raw.json());
440
+ var _this16 = this;
441
+ return _await(_this16.raw.json());
400
442
  } catch (e) {
401
443
  return Promise.reject(e);
402
444
  }
@@ -404,7 +446,7 @@ var BinaryResult = /*#__PURE__*/function () {
404
446
  }]);
405
447
  return BinaryResult;
406
448
  }();
407
- ;// CONCATENATED MODULE: ./src/generated/apis/FileApi.ts
449
+ ;// CONCATENATED MODULE: ./src/public/shared/generated/apis/FileApi.ts
408
450
  function FileApi_typeof(obj) { "@babel/helpers - typeof"; return FileApi_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FileApi_typeof(obj); }
409
451
  function FileApi_await(value, then, direct) {
410
452
  if (direct) {
@@ -699,7 +741,7 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
699
741
  }]);
700
742
  return FileApi;
701
743
  }(BaseAPI);
702
- ;// CONCATENATED MODULE: ./src/generated/apis/FolderApi.ts
744
+ ;// CONCATENATED MODULE: ./src/public/shared/generated/apis/FolderApi.ts
703
745
  function FolderApi_typeof(obj) { "@babel/helpers - typeof"; return FolderApi_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FolderApi_typeof(obj); }
704
746
  function FolderApi_await(value, then, direct) {
705
747
  if (direct) {
@@ -959,7 +1001,7 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
959
1001
  }]);
960
1002
  return FolderApi;
961
1003
  }(BaseAPI);
962
- ;// CONCATENATED MODULE: ./src/generated/apis/JobApi.ts
1004
+ ;// CONCATENATED MODULE: ./src/public/shared/generated/apis/JobApi.ts
963
1005
  function JobApi_typeof(obj) { "@babel/helpers - typeof"; return JobApi_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, JobApi_typeof(obj); }
964
1006
  function JobApi_await(value, then, direct) {
965
1007
  if (direct) {
@@ -1094,7 +1136,7 @@ var JobApi = /*#__PURE__*/function (_runtime$BaseAPI) {
1094
1136
  }]);
1095
1137
  return JobApi;
1096
1138
  }(BaseAPI);
1097
- ;// CONCATENATED MODULE: ./src/generated/apis/UploadApi.ts
1139
+ ;// CONCATENATED MODULE: ./src/public/shared/generated/apis/UploadApi.ts
1098
1140
  function UploadApi_typeof(obj) { "@babel/helpers - typeof"; return UploadApi_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, UploadApi_typeof(obj); }
1099
1141
  function UploadApi_await(value, then, direct) {
1100
1142
  if (direct) {
@@ -1282,53 +1324,170 @@ var UploadApi = /*#__PURE__*/function (_runtime$BaseAPI) {
1282
1324
  }]);
1283
1325
  return UploadApi;
1284
1326
  }(BaseAPI);
1285
- ;// CONCATENATED MODULE: ./src/generated/apis/index.ts
1327
+ ;// CONCATENATED MODULE: ./src/public/shared/generated/apis/index.ts
1286
1328
  /* tslint:disable */
1287
1329
  /* eslint-disable */
1288
1330
 
1289
1331
 
1290
1332
 
1291
1333
 
1292
- ;// CONCATENATED MODULE: ./src/generated/index.ts
1334
+ ;// CONCATENATED MODULE: ./src/public/shared/generated/index.ts
1293
1335
  /* tslint:disable */
1294
1336
  /* eslint-disable */
1295
1337
 
1296
1338
 
1297
1339
 
1298
- ;// CONCATENATED MODULE: ./src/uploads/public/shared/Model.ts
1299
- function Model_typeof(obj) { "@babel/helpers - typeof"; return Model_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Model_typeof(obj); }
1300
- function Model_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, Model_toPropertyKey(descriptor.key), descriptor); } }
1301
- function Model_createClass(Constructor, protoProps, staticProps) { if (protoProps) Model_defineProperties(Constructor.prototype, protoProps); if (staticProps) Model_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
1302
- function Model_toPropertyKey(arg) { var key = Model_toPrimitive(arg, "string"); return Model_typeof(key) === "symbol" ? key : String(key); }
1303
- function Model_toPrimitive(input, hint) { if (Model_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (Model_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
1304
- function Model_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1305
- function Model_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Model_setPrototypeOf(subClass, superClass); }
1306
- function Model_createSuper(Derived) { var hasNativeReflectConstruct = Model_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Model_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Model_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Model_possibleConstructorReturn(this, result); }; }
1307
- function Model_possibleConstructorReturn(self, call) { if (call && (Model_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Model_assertThisInitialized(self); }
1308
- function Model_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
1309
- function Model_wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; Model_wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !Model_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return Model_construct(Class, arguments, Model_getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return Model_setPrototypeOf(Wrapper, Class); }; return Model_wrapNativeSuper(Class); }
1310
- function Model_construct(Parent, args, Class) { if (Model_isNativeReflectConstruct()) { Model_construct = Reflect.construct.bind(); } else { Model_construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) Model_setPrototypeOf(instance, Class.prototype); return instance; }; } return Model_construct.apply(null, arguments); }
1311
- function Model_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
1312
- function Model_isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
1313
- function Model_setPrototypeOf(o, p) { Model_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Model_setPrototypeOf(o, p); }
1314
- function Model_getPrototypeOf(o) { Model_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Model_getPrototypeOf(o); }
1315
- var CancelledError = /*#__PURE__*/function (_Error) {
1316
- Model_inherits(CancelledError, _Error);
1317
- var _super = Model_createSuper(CancelledError);
1318
- function CancelledError() {
1319
- var _this;
1320
- Model_classCallCheck(this, CancelledError);
1321
- _this = _super.call(this, "Upload cancelled by user.");
1322
- _this.name = "CancelledError";
1323
- return _this;
1340
+ ;// CONCATENATED MODULE: ./src/public/shared/CommonTypes.ts
1341
+ /**
1342
+ * Workaround for tsc aliases, where we cannot export implementation-less modules in our dists.
1343
+ */
1344
+ var CommonTypesNoOp = false;
1345
+ ;// CONCATENATED MODULE: ./src/private/TypeUtils.ts
1346
+ function assertUnreachable(x) {
1347
+ throw new Error("Didn't expect to get here: ".concat(JSON.stringify(x)));
1348
+ }
1349
+ function isDefinedEntry(object) {
1350
+ return object[1] !== undefined && object[1] !== null;
1351
+ }
1352
+ ;// CONCATENATED MODULE: ./src/public/shared/UrlBuilder.ts
1353
+ function UrlBuilder_typeof(obj) { "@babel/helpers - typeof"; return UrlBuilder_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, UrlBuilder_typeof(obj); }
1354
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
1355
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
1356
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
1357
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
1358
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
1359
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
1360
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
1361
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
1362
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
1363
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
1364
+ function UrlBuilder_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1365
+ function UrlBuilder_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, UrlBuilder_toPropertyKey(descriptor.key), descriptor); } }
1366
+ function UrlBuilder_createClass(Constructor, protoProps, staticProps) { if (protoProps) UrlBuilder_defineProperties(Constructor.prototype, protoProps); if (staticProps) UrlBuilder_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
1367
+ function UrlBuilder_toPropertyKey(arg) { var key = UrlBuilder_toPrimitive(arg, "string"); return UrlBuilder_typeof(key) === "symbol" ? key : String(key); }
1368
+ function UrlBuilder_toPrimitive(input, hint) { if (UrlBuilder_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (UrlBuilder_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
1369
+
1370
+
1371
+ var UrlBuilder = /*#__PURE__*/function () {
1372
+ function UrlBuilder(config) {
1373
+ UrlBuilder_classCallCheck(this, UrlBuilder);
1374
+ var _a;
1375
+ this.cdnUrl = (_a = config === null || config === void 0 ? void 0 : config.cdnUrl) !== null && _a !== void 0 ? _a : BytescaleApiClientConfigResolver.defaultCdnUrl;
1324
1376
  }
1325
- return Model_createClass(CancelledError);
1326
- }( /*#__PURE__*/Model_wrapNativeSuper(Error));
1327
- ;// CONCATENATED MODULE: ./src/uploads/public/shared/index.ts
1377
+ /**
1378
+ * Builds a URL to either a raw file or a transformed file.
1379
+ *
1380
+ * Example 1) Raw file:
1381
+ *
1382
+ * new UrlBuilder().url({ accountId: "1234abc", filePath: "/example.jpg" })
1383
+ *
1384
+ * Example 2) Image resized to 500x500:
1385
+ *
1386
+ * new UrlBuilder().url({ accountId: "1234abc", filePath: "/example.jpg", transformation: { type: "image", params: { w: 500, h: 500, fit: "crop" } } })
1387
+ *
1388
+ * Example 3) Image resized to 500x500, which is privately accessible (i.e. requires 'AuthManager.beginAuthSession' before it can be accessed):
1389
+ *
1390
+ * new UrlBuilder().url({ accountId: "1234abc", filePath: "/example.jpg", transformation: { type: "image", params: { w: 500, h: 500, fit: "crop" } }, auth: true })
1391
+ */
1392
+ UrlBuilder_createClass(UrlBuilder, [{
1393
+ key: "url",
1394
+ value: function url(params) {
1395
+ var _a;
1396
+ return ((_a = params.options) === null || _a === void 0 ? void 0 : _a.transformation) === undefined ? this.raw(params) : this.transformation(params, params.options.transformation);
1397
+ }
1398
+ }, {
1399
+ key: "raw",
1400
+ value: function raw(params) {
1401
+ var _a;
1402
+ var baseUrl = this.getBaseUrl(params, "raw");
1403
+ var commonParams = this.getCommonQueryParams((_a = params.options) !== null && _a !== void 0 ? _a : {});
1404
+ return this.addQueryParams(baseUrl, commonParams);
1405
+ }
1406
+ }, {
1407
+ key: "transformation",
1408
+ value: function transformation(params, trans) {
1409
+ var _a;
1410
+ var baseUrl = this.getBaseUrl(params, trans.type === "preset" ? trans.preset : trans.type);
1411
+ var transParams = this.getTransformationParams(trans, {
1412
+ cachePermanently: "cache_perm"
1413
+ });
1414
+ var commonParams = this.getCommonQueryParams((_a = params.options) !== null && _a !== void 0 ? _a : {});
1415
+ return this.addQueryParams(baseUrl, [].concat(_toConsumableArray(commonParams), _toConsumableArray(transParams)));
1416
+ }
1417
+ }, {
1418
+ key: "getBaseUrl",
1419
+ value: function getBaseUrl(params, prefix) {
1420
+ return "".concat(this.cdnUrl, "/").concat(params.accountId, "/").concat(prefix).concat(params.filePath);
1421
+ }
1422
+ }, {
1423
+ key: "getCommonQueryParams",
1424
+ value: function getCommonQueryParams(params) {
1425
+ return this.makeQueryParams(["auth", "cache", "cacheTtl", "version", "forceDownloadPrompt"], {
1426
+ cacheTtl: "cache_ttl",
1427
+ forceDownloadPrompt: "download"
1428
+ })(params);
1429
+ }
1430
+ }, {
1431
+ key: "makeQueryParams",
1432
+ value: function makeQueryParams(keys, keyOverrides) {
1433
+ return function (data) {
1434
+ var result = [];
1435
+ keys.forEach(function (key) {
1436
+ var _a;
1437
+ var value = data[key];
1438
+ if (value !== undefined) {
1439
+ result.push([(_a = keyOverrides[key]) !== null && _a !== void 0 ? _a : key, value.toString()]);
1440
+ }
1441
+ });
1442
+ return result;
1443
+ };
1444
+ }
1445
+ }, {
1446
+ key: "getTransformationParams",
1447
+ value: function getTransformationParams(trans, keyRewrites) {
1448
+ if (trans.params === undefined) {
1449
+ return [];
1450
+ }
1451
+ var serializeObj = function serializeObj(obj) {
1452
+ return Object.entries(obj).filter(isDefinedEntry).map(function (_ref) {
1453
+ var _ref2 = _slicedToArray(_ref, 2),
1454
+ key = _ref2[0],
1455
+ value = _ref2[1];
1456
+ var _a;
1457
+ return [(_a = keyRewrites[key]) !== null && _a !== void 0 ? _a : key, value.toString()];
1458
+ });
1459
+ };
1460
+ return Array.isArray(trans.params) ? trans.params.flatMap(serializeObj) : serializeObj(trans.params);
1461
+ }
1462
+ }, {
1463
+ key: "addQueryParams",
1464
+ value: function addQueryParams(baseUrl, params) {
1465
+ if (params.length === 0) {
1466
+ return baseUrl;
1467
+ }
1468
+ return "".concat(baseUrl, "?").concat(params.map(function (_ref3) {
1469
+ var _ref4 = _slicedToArray(_ref3, 2),
1470
+ key = _ref4[0],
1471
+ value = _ref4[1];
1472
+ return "".concat(encodeURIComponent(key), "=").concat(encodeURIComponent(value));
1473
+ }).join("&"));
1474
+ }
1475
+ }]);
1476
+ return UrlBuilder;
1477
+ }();
1478
+ ;// CONCATENATED MODULE: ./src/public/shared/UrlBuilderTypes.ts
1479
+ /**
1480
+ * Workaround for tsc aliases, where we cannot export implementation-less modules in our dists.
1481
+ */
1482
+ var UrlBuilderTypesNoOp = false;
1483
+ ;// CONCATENATED MODULE: ./src/public/shared/index.ts
1484
+
1328
1485
 
1329
- ;// CONCATENATED MODULE: ./src/uploads/private/UploadManagerBase.ts
1486
+
1487
+
1488
+ ;// CONCATENATED MODULE: ./src/private/UploadManagerBase.ts
1330
1489
  function UploadManagerBase_typeof(obj) { "@babel/helpers - typeof"; return UploadManagerBase_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, UploadManagerBase_typeof(obj); }
1331
- function UploadManagerBase_async(f) {
1490
+ function _async(f) {
1332
1491
  return function () {
1333
1492
  for (var args = [], i = 0; i < arguments.length; i++) {
1334
1493
  args[i] = arguments[i];
@@ -1500,12 +1659,12 @@ function _continueIgnored(value) {
1500
1659
  return value.then(UploadManagerBase_empty);
1501
1660
  }
1502
1661
  }
1503
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
1504
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
1505
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
1506
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
1507
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
1508
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
1662
+ function UploadManagerBase_toConsumableArray(arr) { return UploadManagerBase_arrayWithoutHoles(arr) || UploadManagerBase_iterableToArray(arr) || UploadManagerBase_unsupportedIterableToArray(arr) || UploadManagerBase_nonIterableSpread(); }
1663
+ function UploadManagerBase_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
1664
+ function UploadManagerBase_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return UploadManagerBase_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return UploadManagerBase_arrayLikeToArray(o, minLen); }
1665
+ function UploadManagerBase_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
1666
+ function UploadManagerBase_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return UploadManagerBase_arrayLikeToArray(arr); }
1667
+ function UploadManagerBase_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
1509
1668
  function UploadManagerBase_empty() {}
1510
1669
  function _awaitIgnored(value, direct) {
1511
1670
  if (!direct) {
@@ -1545,7 +1704,6 @@ function UploadManagerBase_createClass(Constructor, protoProps, staticProps) { i
1545
1704
  function UploadManagerBase_toPropertyKey(arg) { var key = UploadManagerBase_toPrimitive(arg, "string"); return UploadManagerBase_typeof(key) === "symbol" ? key : String(key); }
1546
1705
  function UploadManagerBase_toPrimitive(input, hint) { if (UploadManagerBase_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (UploadManagerBase_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
1547
1706
 
1548
-
1549
1707
  /**
1550
1708
  * Methods common to UploadManagerNode and UploadManagerBrowser.
1551
1709
  */
@@ -1572,13 +1730,13 @@ var UploadManagerBase = /*#__PURE__*/function () {
1572
1730
  onProgress(0);
1573
1731
  return UploadManagerBase_await(_this2.beginUpload(request, preUploadInfo), function (uploadInfo) {
1574
1732
  var partCount = uploadInfo.uploadParts.count;
1575
- var parts = _toConsumableArray(Array(partCount).keys());
1733
+ var parts = UploadManagerBase_toConsumableArray(Array(partCount).keys());
1576
1734
  var _this2$makeCancellati = _this2.makeCancellationMethods(),
1577
1735
  cancel = _this2$makeCancellati.cancel,
1578
1736
  addCancellationHandler = _this2$makeCancellati.addCancellationHandler;
1579
1737
  var intervalHandle = setInterval(_this2.onIntervalTick(request, cancel), _this2.intervalMs);
1580
1738
  return UploadManagerBase_continue(_finallyRethrows(function () {
1581
- return UploadManagerBase_await(_this2.mapAsync(parts, preUploadInfo.maxConcurrentUploadParts, UploadManagerBase_async(function (part) {
1739
+ return UploadManagerBase_await(_this2.mapAsync(parts, preUploadInfo.maxConcurrentUploadParts, _async(function (part) {
1582
1740
  return _this2.uploadPart(request, source, part, uploadInfo, onProgress, addCancellationHandler);
1583
1741
  })), function () {
1584
1742
  return _awaitIgnored(_this2.postUpload(init));
@@ -1770,8 +1928,8 @@ var UploadManagerBase = /*#__PURE__*/function () {
1770
1928
  key: "mapAsync",
1771
1929
  value: function mapAsync(items, concurrency, callback) {
1772
1930
  try {
1773
- var workQueue = _toConsumableArray(items);
1774
- return _awaitIgnored(Promise.all(_toConsumableArray(Array(concurrency).keys()).map(UploadManagerBase_async(function () {
1931
+ var workQueue = UploadManagerBase_toConsumableArray(items);
1932
+ return _awaitIgnored(Promise.all(UploadManagerBase_toConsumableArray(Array(concurrency).keys()).map(_async(function () {
1775
1933
  return _continueIgnored(_for(function () {
1776
1934
  return workQueue.length > 0;
1777
1935
  }, void 0, function () {
@@ -1792,7 +1950,7 @@ var UploadManagerBase = /*#__PURE__*/function () {
1792
1950
  }();
1793
1951
  ;// CONCATENATED MODULE: external "stream"
1794
1952
  var external_stream_namespaceObject = require("stream");
1795
- ;// CONCATENATED MODULE: ./src/uploads/private/StreamUtils.ts
1953
+ ;// CONCATENATED MODULE: ./src/private/StreamUtils.ts
1796
1954
  function StreamUtils_typeof(obj) { "@babel/helpers - typeof"; return StreamUtils_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, StreamUtils_typeof(obj); }
1797
1955
  function StreamUtils_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1798
1956
  function StreamUtils_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, StreamUtils_toPropertyKey(descriptor.key), descriptor); } }
@@ -1834,14 +1992,14 @@ var StreamUtils = /*#__PURE__*/function () {
1834
1992
  }]);
1835
1993
  return StreamUtils;
1836
1994
  }();
1837
- ;// CONCATENATED MODULE: ./src/uploads/private/NodeChunkedStream.ts
1995
+ ;// CONCATENATED MODULE: ./src/private/NodeChunkedStream.ts
1838
1996
  function NodeChunkedStream_typeof(obj) { "@babel/helpers - typeof"; return NodeChunkedStream_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, NodeChunkedStream_typeof(obj); }
1839
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || NodeChunkedStream_unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
1840
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
1997
+ function NodeChunkedStream_slicedToArray(arr, i) { return NodeChunkedStream_arrayWithHoles(arr) || NodeChunkedStream_iterableToArrayLimit(arr, i) || NodeChunkedStream_unsupportedIterableToArray(arr, i) || NodeChunkedStream_nonIterableRest(); }
1998
+ function NodeChunkedStream_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
1841
1999
  function NodeChunkedStream_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return NodeChunkedStream_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return NodeChunkedStream_arrayLikeToArray(o, minLen); }
1842
2000
  function NodeChunkedStream_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
1843
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
1844
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
2001
+ function NodeChunkedStream_iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
2002
+ function NodeChunkedStream_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
1845
2003
  function NodeChunkedStream_await(value, then, direct) {
1846
2004
  if (direct) {
1847
2005
  return then ? then(value) : value;
@@ -1929,7 +2087,7 @@ var NodeChunkedStream = /*#__PURE__*/function () {
1929
2087
  return; // Received empty data.
1930
2088
  }
1931
2089
 
1932
- var _splitResult = _slicedToArray(splitResult, 2),
2090
+ var _splitResult = NodeChunkedStream_slicedToArray(splitResult, 2),
1933
2091
  consumed = _splitResult[0],
1934
2092
  remaining = _splitResult[1];
1935
2093
  _this2.buffer = remaining;
@@ -2000,7 +2158,7 @@ var NodeChunkedStream = /*#__PURE__*/function () {
2000
2158
  if (splitResult === undefined) {
2001
2159
  return undefined;
2002
2160
  }
2003
- var _splitResult2 = _slicedToArray(splitResult, 2),
2161
+ var _splitResult2 = NodeChunkedStream_slicedToArray(splitResult, 2),
2004
2162
  consumed = _splitResult2[0],
2005
2163
  remaining = _splitResult2[1];
2006
2164
  this.buffer = remaining;
@@ -2024,13 +2182,9 @@ var NodeChunkedStream = /*#__PURE__*/function () {
2024
2182
  }]);
2025
2183
  return NodeChunkedStream;
2026
2184
  }();
2027
- ;// CONCATENATED MODULE: ./src/uploads/private/TypeUtils.ts
2028
- function assertUnreachable(x) {
2029
- throw new Error("Didn't expect to get here: ".concat(JSON.stringify(x)));
2030
- }
2031
2185
  ;// CONCATENATED MODULE: external "buffer"
2032
2186
  var external_buffer_namespaceObject = require("buffer");
2033
- ;// CONCATENATED MODULE: ./src/uploads/public/node/UploadManagerNode.ts
2187
+ ;// CONCATENATED MODULE: ./src/public/node/UploadManagerNode.ts
2034
2188
  function UploadManagerNode_typeof(obj) { "@babel/helpers - typeof"; return UploadManagerNode_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, UploadManagerNode_typeof(obj); }
2035
2189
  function UploadManagerNode_empty() {}
2036
2190
  function UploadManagerNode_awaitIgnored(value, direct) {
@@ -2409,14 +2563,79 @@ var UploadManager = /*#__PURE__*/function (_UploadManagerBase) {
2409
2563
  }]);
2410
2564
  return UploadManager;
2411
2565
  }(UploadManagerBase);
2412
- ;// CONCATENATED MODULE: ./src/uploads/public/node/index.ts
2566
+ ;// CONCATENATED MODULE: ./src/private/EnvChecker.ts
2567
+ function EnvChecker_typeof(obj) { "@babel/helpers - typeof"; return EnvChecker_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, EnvChecker_typeof(obj); }
2568
+ function EnvChecker_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2569
+ function EnvChecker_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, EnvChecker_toPropertyKey(descriptor.key), descriptor); } }
2570
+ function EnvChecker_createClass(Constructor, protoProps, staticProps) { if (protoProps) EnvChecker_defineProperties(Constructor.prototype, protoProps); if (staticProps) EnvChecker_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
2571
+ function EnvChecker_toPropertyKey(arg) { var key = EnvChecker_toPrimitive(arg, "string"); return EnvChecker_typeof(key) === "symbol" ? key : String(key); }
2572
+ function EnvChecker_toPrimitive(input, hint) { if (EnvChecker_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (EnvChecker_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
2573
+ var EnvChecker = /*#__PURE__*/function () {
2574
+ function EnvChecker() {
2575
+ EnvChecker_classCallCheck(this, EnvChecker);
2576
+ }
2577
+ EnvChecker_createClass(EnvChecker, null, [{
2578
+ key: "isNodeJs",
2579
+ value: function isNodeJs() {
2580
+ return typeof process !== "undefined" && process.versions !== undefined && process.versions.node !== undefined;
2581
+ }
2582
+ }, {
2583
+ key: "methodRequiresBrowser",
2584
+ value: function methodRequiresBrowser(methodName) {
2585
+ if (EnvChecker.isNodeJs()) {
2586
+ return new Error("You must call '".concat(methodName, "' in the browser. (You are currently in Node.js.)"));
2587
+ }
2588
+ return new Error("The '".concat(methodName, "' method cannot be called because you have bundled the Node.js implementation of the Bytescale JavaScript SDK into your client-side code. Please ensure your bundling tool (Webpack, Rollup, etc.) is honouring the \"browser\" field of the \"package.json\" file for this package, as this will allow the browser implementation of the Bytescale JavaScript SDK to be included in your client-side code."));
2589
+ }
2590
+ }]);
2591
+ return EnvChecker;
2592
+ }();
2593
+ ;// CONCATENATED MODULE: ./src/public/node/AuthManagerNode.ts
2594
+ function AuthManagerNode_typeof(obj) { "@babel/helpers - typeof"; return AuthManagerNode_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, AuthManagerNode_typeof(obj); }
2595
+ function AuthManagerNode_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2596
+ function AuthManagerNode_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, AuthManagerNode_toPropertyKey(descriptor.key), descriptor); } }
2597
+ function AuthManagerNode_createClass(Constructor, protoProps, staticProps) { if (protoProps) AuthManagerNode_defineProperties(Constructor.prototype, protoProps); if (staticProps) AuthManagerNode_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
2598
+ function AuthManagerNode_toPropertyKey(arg) { var key = AuthManagerNode_toPrimitive(arg, "string"); return AuthManagerNode_typeof(key) === "symbol" ? key : String(key); }
2599
+ 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); }
2600
+
2601
+ var AuthManager = /*#__PURE__*/function () {
2602
+ function AuthManager() {
2603
+ AuthManagerNode_classCallCheck(this, AuthManager);
2604
+ }
2605
+ AuthManagerNode_createClass(AuthManager, [{
2606
+ key: "beginAuthSession",
2607
+ value: function beginAuthSession(_authUrl, _authHeaders) {
2608
+ try {
2609
+ throw EnvChecker.methodRequiresBrowser("beginAuthSession");
2610
+ } catch (e) {
2611
+ return Promise.reject(e);
2612
+ }
2613
+ }
2614
+ }, {
2615
+ key: "endAuthSession",
2616
+ value: function endAuthSession() {
2617
+ try {
2618
+ throw EnvChecker.methodRequiresBrowser("endAuthSession");
2619
+ } catch (e) {
2620
+ return Promise.reject(e);
2621
+ }
2622
+ }
2623
+ }, {
2624
+ key: "isAuthSessionActive",
2625
+ value: function isAuthSessionActive() {
2626
+ return false;
2627
+ }
2628
+ }]);
2629
+ return AuthManager;
2630
+ }();
2631
+ ;// CONCATENATED MODULE: ./src/public/node/index.ts
2632
+
2413
2633
 
2414
2634
  ;// CONCATENATED MODULE: ./src/index.node.ts
2415
2635
  /* tslint:disable */
2416
2636
  /* eslint-disable */
2417
2637
 
2418
2638
 
2419
-
2420
2639
  module.exports = __lib_exports__;
2421
2640
  /******/ })()
2422
2641
  ;