@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
@@ -48,26 +48,40 @@ var __lib_exports__ = {};
48
48
 
49
49
  // EXPORTS
50
50
  __lib_require__.d(__lib_exports__, {
51
- "BASE_PATH": function() { return /* reexport */ BASE_PATH; },
51
+ "AuthManager": function() { return /* reexport */ AuthManager; },
52
52
  "BaseAPI": function() { return /* reexport */ BaseAPI; },
53
53
  "BinaryResult": function() { return /* reexport */ BinaryResult; },
54
+ "BytescaleApiClientConfigResolver": function() { return /* reexport */ BytescaleApiClientConfigResolver; },
54
55
  "BytescaleApiError": function() { return /* reexport */ BytescaleApiError; },
55
56
  "CancelledError": function() { return /* reexport */ CancelledError; },
57
+ "CommonTypesNoOp": function() { return /* reexport */ CommonTypesNoOp; },
56
58
  "FileApi": function() { return /* reexport */ FileApi; },
57
59
  "FolderApi": function() { return /* reexport */ FolderApi; },
58
60
  "JSONApiResponse": function() { return /* reexport */ JSONApiResponse; },
59
61
  "JobApi": function() { return /* reexport */ JobApi; },
60
62
  "UploadApi": function() { return /* reexport */ UploadApi; },
61
63
  "UploadManager": function() { return /* reexport */ UploadManager; },
64
+ "UrlBuilder": function() { return /* reexport */ UrlBuilder; },
65
+ "UrlBuilderTypesNoOp": function() { return /* reexport */ UrlBuilderTypesNoOp; },
62
66
  "VoidApiResponse": function() { return /* reexport */ VoidApiResponse; },
63
67
  "querystring": function() { return /* reexport */ querystring; }
64
68
  });
65
69
 
66
- ;// CONCATENATED MODULE: ./src/generated/runtime.ts
70
+ ;// CONCATENATED MODULE: ./src/private/AuthSessionState.ts
67
71
  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); }
72
+ 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); } }
73
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
74
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
75
+ 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); }
76
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
77
+ var AuthSessionState = /*#__PURE__*/_createClass(function AuthSessionState() {
78
+ _classCallCheck(this, AuthSessionState);
79
+ });
80
+ ;// CONCATENATED MODULE: ./src/public/shared/generated/runtime.ts
81
+ 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); }
68
82
  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); }
69
83
  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); }; }
70
- 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); }
84
+ 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); }
71
85
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
72
86
  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); }
73
87
  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); }
@@ -75,15 +89,6 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
75
89
  function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
76
90
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
77
91
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
78
- function _await(value, then, direct) {
79
- if (direct) {
80
- return then ? then(value) : value;
81
- }
82
- if (!value || !value.then) {
83
- value = Promise.resolve(value);
84
- }
85
- return then ? value.then(then) : value;
86
- }
87
92
  function _catch(body, recover) {
88
93
  try {
89
94
  var result = body();
@@ -95,22 +100,10 @@ function _catch(body, recover) {
95
100
  }
96
101
  return result;
97
102
  }
103
+ function _empty() {}
98
104
  function _continue(value, then) {
99
105
  return value && value.then ? value.then(then) : then(value);
100
106
  }
101
- function _async(f) {
102
- return function () {
103
- for (var args = [], i = 0; i < arguments.length; i++) {
104
- args[i] = arguments[i];
105
- }
106
- try {
107
- return Promise.resolve(f.apply(this, args));
108
- } catch (e) {
109
- return Promise.reject(e);
110
- }
111
- };
112
- }
113
- function _empty() {}
114
107
  function _invoke(body, then) {
115
108
  var result = body();
116
109
  if (result && result.then) {
@@ -118,81 +111,122 @@ function _invoke(body, then) {
118
111
  }
119
112
  return then(result);
120
113
  }
121
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
122
- 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); } }
123
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
124
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
125
- 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); }
126
- /**
127
- * @bytescale/api
128
- * Bytescale API
129
- *
130
- * The version of the OpenAPI document: 2.0.0
131
- * Contact: hello@bytescale.com
132
- *
133
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
134
- * https://openapi-generator.tech
135
- * Do not edit the class manually.
136
- */
137
- var BASE_PATH = "https://api.bytescale.com".replace(/\/+$/, "");
114
+ 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; }
115
+ function _await(value, then, direct) {
116
+ if (direct) {
117
+ return then ? then(value) : value;
118
+ }
119
+ if (!value || !value.then) {
120
+ value = Promise.resolve(value);
121
+ }
122
+ return then ? value.then(then) : value;
123
+ }
124
+ function runtime_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
125
+ 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); } }
126
+ 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; }
127
+ function runtime_toPropertyKey(arg) { var key = runtime_toPrimitive(arg, "string"); return runtime_typeof(key) === "symbol" ? key : String(key); }
128
+ 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); }
129
+
130
+ var BytescaleApiClientConfigResolver = /*#__PURE__*/function () {
131
+ function BytescaleApiClientConfigResolver() {
132
+ runtime_classCallCheck(this, BytescaleApiClientConfigResolver);
133
+ }
134
+ runtime_createClass(BytescaleApiClientConfigResolver, null, [{
135
+ key: "getApiUrl",
136
+ value: function getApiUrl(config) {
137
+ var _a;
138
+ return (_a = config.apiUrl) !== null && _a !== void 0 ? _a : BytescaleApiClientConfigResolver.defaultApiUrl;
139
+ }
140
+ }, {
141
+ key: "getCdnUrl",
142
+ value: function getCdnUrl(config) {
143
+ var _a;
144
+ return (_a = config.cdnUrl) !== null && _a !== void 0 ? _a : BytescaleApiClientConfigResolver.defaultCdnUrl;
145
+ }
146
+ }, {
147
+ key: "getFetchApi",
148
+ value: function getFetchApi(config) {
149
+ var _a;
150
+ return (_a = config.fetchApi) !== null && _a !== void 0 ? _a : fetch;
151
+ }
152
+ }]);
153
+ return BytescaleApiClientConfigResolver;
154
+ }();
155
+ BytescaleApiClientConfigResolver.defaultApiUrl = "https://api.bytescale.com";
156
+ BytescaleApiClientConfigResolver.defaultCdnUrl = "https://upcdn.io";
138
157
  /**
139
158
  * This is the base class for all generated API classes.
140
159
  */
141
160
  var BaseAPI = /*#__PURE__*/function () {
142
161
  function BaseAPI(config) {
143
- var _this = this;
144
- _classCallCheck(this, BaseAPI);
162
+ runtime_classCallCheck(this, BaseAPI);
145
163
  this.config = config;
146
- this.fetchApi = _async(function (url, init) {
147
- var _exit = false;
148
- var fetchParams = {
149
- url: url,
150
- init: init
151
- };
152
- var response = undefined;
153
- return _continue(_catch(function () {
154
- return _await((_this.config.fetchApi || fetch)(fetchParams.url, fetchParams.init), function (_temp) {
155
- response = _temp;
156
- });
157
- }, function (e) {
158
- if (response === undefined) {
159
- throw e;
160
- }
161
- }), function (_result) {
162
- return _exit ? _result : response;
163
- });
164
- });
165
164
  }
166
- _createClass(BaseAPI, [{
165
+ runtime_createClass(BaseAPI, [{
167
166
  key: "request",
168
- value: function request(context, initOverrides, operationBasePathOverride) {
167
+ value: function request(context, initOverrides, baseUrlOverride) {
169
168
  try {
170
- var _this3 = this;
171
- var _a;
172
- var apiKey = _this3.config.apiKey;
169
+ var _this2 = this;
170
+ var _a, _b;
171
+ var apiKey = _this2.config.apiKey;
173
172
  context.headers["Authorization"] = "Bearer ".concat(apiKey); // authorization-header authentication
174
- return _await(_this3.createFetchParams(context, initOverrides, operationBasePathOverride), function (_ref) {
173
+ if (((_a = AuthSessionState.session) === null || _a === void 0 ? void 0 : _a.accessToken) !== undefined) {
174
+ context.headers["Authorization-Token"] = AuthSessionState.session.accessToken;
175
+ }
176
+ // Key: any possible value for 'baseUrlOverride'
177
+ // Value: user-overridden value for that base URL from the config.
178
+ var nonDefaultBasePaths = _defineProperty({}, BytescaleApiClientConfigResolver.defaultCdnUrl, BytescaleApiClientConfigResolver.getCdnUrl(_this2.config));
179
+ return _await(_this2.createFetchParams(context, initOverrides, baseUrlOverride === undefined ? undefined : (_b = nonDefaultBasePaths[baseUrlOverride]) !== null && _b !== void 0 ? _b : baseUrlOverride), function (_ref) {
175
180
  var url = _ref.url,
176
181
  init = _ref.init;
177
- return _await(_this3.fetchApi(url, init), function (response) {
178
- var _exit2 = false;
179
- return response && response.status >= 200 && response.status < 300 ? response : _invoke(function () {
180
- if (response !== undefined) {
181
- var jsonError = undefined;
182
- return _continue(_catch(function () {
183
- return _await(response.json(), function (_response$json) {
184
- jsonError = _response$json;
185
- });
186
- }, _empty), function () {
187
- if (typeof ((_a = jsonError === null || jsonError === void 0 ? void 0 : jsonError.error) === null || _a === void 0 ? void 0 : _a.code) === "string") {
188
- throw new BytescaleApiError(jsonError);
189
- }
182
+ return _this2.doFetch(url, init, true);
183
+ });
184
+ } catch (e) {
185
+ return Promise.reject(e);
186
+ }
187
+ }
188
+ /**
189
+ * Returns a successful response (2**) else throws an error.
190
+ */
191
+ }, {
192
+ key: "doFetch",
193
+ value: function doFetch(url, init, isBytescaleApi) {
194
+ try {
195
+ var _exit3 = false;
196
+ var _this4 = this;
197
+ var _a, _b;
198
+ var response;
199
+ return _continue(_catch(function () {
200
+ return _await(BytescaleApiClientConfigResolver.getFetchApi(_this4.config)(url, init), function (_BytescaleApiClientCo) {
201
+ response = _BytescaleApiClientCo;
202
+ });
203
+ }, function (e) {
204
+ // Network-level errors, CORS errors, or HTTP-level errors from intermediary services (e.g. AWS or the user's own infrastructure/proxies).
205
+ // 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.
206
+ 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));
207
+ }), function (_result) {
208
+ var _exit2 = false;
209
+ if (_exit3) return _result;
210
+ return response.status >= 200 && response.status < 300 ? response : _invoke(function () {
211
+ if (isBytescaleApi) {
212
+ var jsonError = undefined;
213
+ return _continue(_catch(function () {
214
+ return _await(response.json(), function (_response$json) {
215
+ jsonError = _response$json;
190
216
  });
191
- }
192
- }, function (_result2) {
193
- if (_exit2) return _result2;
194
- throw new Error("Unable to connect to the Bytescale API: please try again.");
195
- });
217
+ }, _empty), function () {
218
+ if (typeof ((_a = jsonError === null || jsonError === void 0 ? void 0 : jsonError.error) === null || _a === void 0 ? void 0 : _a.code) === "string") {
219
+ throw new BytescaleApiError(jsonError);
220
+ }
221
+ // HTTP-level errors from intermediary services (e.g. AWS or the user's own infrastructure/proxies). On the browser,
222
+ // this error is unlikely to be triggered since these errors will masqurade as CORS errors (see above) but in Node.js
223
+ // this error will appear from any intermediary service failure.
224
+ throw new Error("Unable to connect to the Bytescale API (".concat(response.status, "): please try again."));
225
+ });
226
+ }
227
+ }, function (_result2) {
228
+ if (_exit2) return _result2;
229
+ throw new Error("Failure status code (".concat(response.status, ") received for request: ").concat((_b = init.method) !== null && _b !== void 0 ? _b : "GET", " ").concat(url));
196
230
  });
197
231
  });
198
232
  } catch (e) {
@@ -214,17 +248,17 @@ var BaseAPI = /*#__PURE__*/function () {
214
248
  }
215
249
  }, {
216
250
  key: "createFetchParams",
217
- value: function createFetchParams(context, initOverrides, operationBasePathOverride) {
251
+ value: function createFetchParams(context, initOverrides, baseUrlOverride) {
218
252
  try {
219
- var _this5 = this;
220
- var url = (operationBasePathOverride !== null && operationBasePathOverride !== void 0 ? operationBasePathOverride : BASE_PATH) + context.path;
253
+ var _this6 = this;
254
+ var url = (baseUrlOverride !== null && baseUrlOverride !== void 0 ? baseUrlOverride : BytescaleApiClientConfigResolver.getApiUrl(_this6.config)) + context.path;
221
255
  if (context.query !== undefined && Object.keys(context.query).length !== 0) {
222
256
  // only add the querystring to the URL if there are query parameters.
223
257
  // this is done to avoid urls ending with a "?" character which buggy webservers
224
258
  // do not handle correctly sometimes.
225
259
  url += "?" + querystring(context.query);
226
260
  }
227
- var configHeaders = _this5.config.headers;
261
+ var configHeaders = _this6.config.headers;
228
262
  var _Object$assign3 = Object.assign({}, context.headers);
229
263
  return _await(configHeaders === undefined ? {} : configHeaders(), function (_configHeaders) {
230
264
  var headers = Object.assign(_Object$assign3, _configHeaders);
@@ -261,19 +295,34 @@ var BaseAPI = /*#__PURE__*/function () {
261
295
  }]);
262
296
  return BaseAPI;
263
297
  }();
264
- var BytescaleApiError = /*#__PURE__*/function (_Error) {
265
- _inherits(BytescaleApiError, _Error);
266
- var _super = _createSuper(BytescaleApiError);
298
+ BaseAPI.specialApiKeys = ["free", "demo"];
299
+ BaseAPI.specialApiKeyAccountId = "W142hJk";
300
+ BaseAPI.accountIdLength = 7; // Sync with: upload/shared/**/AccountIdUtils
301
+ var CancelledError = /*#__PURE__*/function (_Error) {
302
+ _inherits(CancelledError, _Error);
303
+ var _super = _createSuper(CancelledError);
304
+ function CancelledError() {
305
+ var _this7;
306
+ runtime_classCallCheck(this, CancelledError);
307
+ _this7 = _super.call(this, "Operation cancelled by caller.");
308
+ _this7.name = "CancelledError";
309
+ return _this7;
310
+ }
311
+ return runtime_createClass(CancelledError);
312
+ }( /*#__PURE__*/_wrapNativeSuper(Error));
313
+ var BytescaleApiError = /*#__PURE__*/function (_Error2) {
314
+ _inherits(BytescaleApiError, _Error2);
315
+ var _super2 = _createSuper(BytescaleApiError);
267
316
  function BytescaleApiError(response) {
268
- var _this6;
269
- _classCallCheck(this, BytescaleApiError);
270
- _this6 = _super.call(this, response.error.message);
271
- _this6.name = "BytescaleApiError";
272
- _this6.errorCode = response.error.code;
273
- _this6.details = response.error.details;
274
- return _this6;
317
+ var _this8;
318
+ runtime_classCallCheck(this, BytescaleApiError);
319
+ _this8 = _super2.call(this, response.error.message);
320
+ _this8.name = "BytescaleApiError";
321
+ _this8.errorCode = response.error.code;
322
+ _this8.details = response.error.details;
323
+ return _this8;
275
324
  }
276
- return _createClass(BytescaleApiError);
325
+ return runtime_createClass(BytescaleApiError);
277
326
  }( /*#__PURE__*/_wrapNativeSuper(Error));
278
327
  function querystring(params) {
279
328
  var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
@@ -306,22 +355,15 @@ function querystringSingleKey(key, value) {
306
355
  }
307
356
  var JSONApiResponse = /*#__PURE__*/function () {
308
357
  function JSONApiResponse(raw) {
309
- var transformer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (jsonValue) {
310
- return jsonValue;
311
- };
312
- _classCallCheck(this, JSONApiResponse);
358
+ runtime_classCallCheck(this, JSONApiResponse);
313
359
  this.raw = raw;
314
- this.transformer = transformer;
315
360
  }
316
- _createClass(JSONApiResponse, [{
361
+ runtime_createClass(JSONApiResponse, [{
317
362
  key: "value",
318
363
  value: function value() {
319
364
  try {
320
- var _this8 = this;
321
- var _transformer2 = _this8.transformer;
322
- return _await(_this8.raw.json(), function (_this7$raw$json) {
323
- return _transformer2.call(_this8, _this7$raw$json);
324
- });
365
+ var _this10 = this;
366
+ return _await(_this10.raw.json());
325
367
  } catch (e) {
326
368
  return Promise.reject(e);
327
369
  }
@@ -331,10 +373,10 @@ var JSONApiResponse = /*#__PURE__*/function () {
331
373
  }();
332
374
  var VoidApiResponse = /*#__PURE__*/function () {
333
375
  function VoidApiResponse(raw) {
334
- _classCallCheck(this, VoidApiResponse);
376
+ runtime_classCallCheck(this, VoidApiResponse);
335
377
  this.raw = raw;
336
378
  }
337
- _createClass(VoidApiResponse, [{
379
+ runtime_createClass(VoidApiResponse, [{
338
380
  key: "value",
339
381
  value: function value() {
340
382
  return _await(undefined);
@@ -344,10 +386,10 @@ var VoidApiResponse = /*#__PURE__*/function () {
344
386
  }();
345
387
  var BinaryResult = /*#__PURE__*/function () {
346
388
  function BinaryResult(raw) {
347
- _classCallCheck(this, BinaryResult);
389
+ runtime_classCallCheck(this, BinaryResult);
348
390
  this.raw = raw;
349
391
  }
350
- _createClass(BinaryResult, [{
392
+ runtime_createClass(BinaryResult, [{
351
393
  key: "stream",
352
394
  value: function stream() {
353
395
  if (this.raw.bodyUsed) {
@@ -362,8 +404,8 @@ var BinaryResult = /*#__PURE__*/function () {
362
404
  key: "text",
363
405
  value: function text() {
364
406
  try {
365
- var _this10 = this;
366
- return _await(_this10.raw.text());
407
+ var _this12 = this;
408
+ return _await(_this12.raw.text());
367
409
  } catch (e) {
368
410
  return Promise.reject(e);
369
411
  }
@@ -372,8 +414,8 @@ var BinaryResult = /*#__PURE__*/function () {
372
414
  key: "blob",
373
415
  value: function blob() {
374
416
  try {
375
- var _this12 = this;
376
- return _await(_this12.raw.blob());
417
+ var _this14 = this;
418
+ return _await(_this14.raw.blob());
377
419
  } catch (e) {
378
420
  return Promise.reject(e);
379
421
  }
@@ -382,8 +424,8 @@ var BinaryResult = /*#__PURE__*/function () {
382
424
  key: "json",
383
425
  value: function json() {
384
426
  try {
385
- var _this14 = this;
386
- return _await(_this14.raw.json());
427
+ var _this16 = this;
428
+ return _await(_this16.raw.json());
387
429
  } catch (e) {
388
430
  return Promise.reject(e);
389
431
  }
@@ -391,7 +433,7 @@ var BinaryResult = /*#__PURE__*/function () {
391
433
  }]);
392
434
  return BinaryResult;
393
435
  }();
394
- ;// CONCATENATED MODULE: ./src/generated/apis/FileApi.ts
436
+ ;// CONCATENATED MODULE: ./src/public/shared/generated/apis/FileApi.ts
395
437
  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); }
396
438
  function FileApi_await(value, then, direct) {
397
439
  if (direct) {
@@ -686,7 +728,7 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
686
728
  }]);
687
729
  return FileApi;
688
730
  }(BaseAPI);
689
- ;// CONCATENATED MODULE: ./src/generated/apis/FolderApi.ts
731
+ ;// CONCATENATED MODULE: ./src/public/shared/generated/apis/FolderApi.ts
690
732
  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); }
691
733
  function FolderApi_await(value, then, direct) {
692
734
  if (direct) {
@@ -946,7 +988,7 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
946
988
  }]);
947
989
  return FolderApi;
948
990
  }(BaseAPI);
949
- ;// CONCATENATED MODULE: ./src/generated/apis/JobApi.ts
991
+ ;// CONCATENATED MODULE: ./src/public/shared/generated/apis/JobApi.ts
950
992
  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); }
951
993
  function JobApi_await(value, then, direct) {
952
994
  if (direct) {
@@ -1081,7 +1123,7 @@ var JobApi = /*#__PURE__*/function (_runtime$BaseAPI) {
1081
1123
  }]);
1082
1124
  return JobApi;
1083
1125
  }(BaseAPI);
1084
- ;// CONCATENATED MODULE: ./src/generated/apis/UploadApi.ts
1126
+ ;// CONCATENATED MODULE: ./src/public/shared/generated/apis/UploadApi.ts
1085
1127
  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); }
1086
1128
  function UploadApi_await(value, then, direct) {
1087
1129
  if (direct) {
@@ -1269,53 +1311,170 @@ var UploadApi = /*#__PURE__*/function (_runtime$BaseAPI) {
1269
1311
  }]);
1270
1312
  return UploadApi;
1271
1313
  }(BaseAPI);
1272
- ;// CONCATENATED MODULE: ./src/generated/apis/index.ts
1314
+ ;// CONCATENATED MODULE: ./src/public/shared/generated/apis/index.ts
1273
1315
  /* tslint:disable */
1274
1316
  /* eslint-disable */
1275
1317
 
1276
1318
 
1277
1319
 
1278
1320
 
1279
- ;// CONCATENATED MODULE: ./src/generated/index.ts
1321
+ ;// CONCATENATED MODULE: ./src/public/shared/generated/index.ts
1280
1322
  /* tslint:disable */
1281
1323
  /* eslint-disable */
1282
1324
 
1283
1325
 
1284
1326
 
1285
- ;// CONCATENATED MODULE: ./src/uploads/public/shared/Model.ts
1286
- 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); }
1287
- 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); } }
1288
- 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; }
1289
- function Model_toPropertyKey(arg) { var key = Model_toPrimitive(arg, "string"); return Model_typeof(key) === "symbol" ? key : String(key); }
1290
- 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); }
1291
- function Model_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1292
- 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); }
1293
- 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); }; }
1294
- 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); }
1295
- function Model_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
1296
- 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); }
1297
- 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); }
1298
- 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; } }
1299
- function Model_isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
1300
- 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); }
1301
- function Model_getPrototypeOf(o) { Model_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Model_getPrototypeOf(o); }
1302
- var CancelledError = /*#__PURE__*/function (_Error) {
1303
- Model_inherits(CancelledError, _Error);
1304
- var _super = Model_createSuper(CancelledError);
1305
- function CancelledError() {
1306
- var _this;
1307
- Model_classCallCheck(this, CancelledError);
1308
- _this = _super.call(this, "Upload cancelled by user.");
1309
- _this.name = "CancelledError";
1310
- return _this;
1327
+ ;// CONCATENATED MODULE: ./src/public/shared/CommonTypes.ts
1328
+ /**
1329
+ * Workaround for tsc aliases, where we cannot export implementation-less libs in our dists.
1330
+ */
1331
+ var CommonTypesNoOp = false;
1332
+ ;// CONCATENATED MODULE: ./src/private/TypeUtils.ts
1333
+ function assertUnreachable(x) {
1334
+ throw new Error("Didn't expect to get here: ".concat(JSON.stringify(x)));
1335
+ }
1336
+ function isDefinedEntry(object) {
1337
+ return object[1] !== undefined && object[1] !== null;
1338
+ }
1339
+ ;// CONCATENATED MODULE: ./src/public/shared/UrlBuilder.ts
1340
+ 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); }
1341
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
1342
+ 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."); }
1343
+ 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; } }
1344
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
1345
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
1346
+ 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."); }
1347
+ 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); }
1348
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
1349
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
1350
+ 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; }
1351
+ function UrlBuilder_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1352
+ 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); } }
1353
+ 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; }
1354
+ function UrlBuilder_toPropertyKey(arg) { var key = UrlBuilder_toPrimitive(arg, "string"); return UrlBuilder_typeof(key) === "symbol" ? key : String(key); }
1355
+ 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); }
1356
+
1357
+
1358
+ var UrlBuilder = /*#__PURE__*/function () {
1359
+ function UrlBuilder(config) {
1360
+ UrlBuilder_classCallCheck(this, UrlBuilder);
1361
+ var _a;
1362
+ this.cdnUrl = (_a = config === null || config === void 0 ? void 0 : config.cdnUrl) !== null && _a !== void 0 ? _a : BytescaleApiClientConfigResolver.defaultCdnUrl;
1311
1363
  }
1312
- return Model_createClass(CancelledError);
1313
- }( /*#__PURE__*/Model_wrapNativeSuper(Error));
1314
- ;// CONCATENATED MODULE: ./src/uploads/public/shared/index.ts
1364
+ /**
1365
+ * Builds a URL to either a raw file or a transformed file.
1366
+ *
1367
+ * Example 1) Raw file:
1368
+ *
1369
+ * new UrlBuilder().url({ accountId: "1234abc", filePath: "/example.jpg" })
1370
+ *
1371
+ * Example 2) Image resized to 500x500:
1372
+ *
1373
+ * new UrlBuilder().url({ accountId: "1234abc", filePath: "/example.jpg", transformation: { type: "image", params: { w: 500, h: 500, fit: "crop" } } })
1374
+ *
1375
+ * Example 3) Image resized to 500x500, which is privately accessible (i.e. requires 'AuthManager.beginAuthSession' before it can be accessed):
1376
+ *
1377
+ * new UrlBuilder().url({ accountId: "1234abc", filePath: "/example.jpg", transformation: { type: "image", params: { w: 500, h: 500, fit: "crop" } }, auth: true })
1378
+ */
1379
+ UrlBuilder_createClass(UrlBuilder, [{
1380
+ key: "url",
1381
+ value: function url(params) {
1382
+ var _a;
1383
+ return ((_a = params.options) === null || _a === void 0 ? void 0 : _a.transformation) === undefined ? this.raw(params) : this.transformation(params, params.options.transformation);
1384
+ }
1385
+ }, {
1386
+ key: "raw",
1387
+ value: function raw(params) {
1388
+ var _a;
1389
+ var baseUrl = this.getBaseUrl(params, "raw");
1390
+ var commonParams = this.getCommonQueryParams((_a = params.options) !== null && _a !== void 0 ? _a : {});
1391
+ return this.addQueryParams(baseUrl, commonParams);
1392
+ }
1393
+ }, {
1394
+ key: "transformation",
1395
+ value: function transformation(params, trans) {
1396
+ var _a;
1397
+ var baseUrl = this.getBaseUrl(params, trans.type === "preset" ? trans.preset : trans.type);
1398
+ var transParams = this.getTransformationParams(trans, {
1399
+ cachePermanently: "cache_perm"
1400
+ });
1401
+ var commonParams = this.getCommonQueryParams((_a = params.options) !== null && _a !== void 0 ? _a : {});
1402
+ return this.addQueryParams(baseUrl, [].concat(_toConsumableArray(commonParams), _toConsumableArray(transParams)));
1403
+ }
1404
+ }, {
1405
+ key: "getBaseUrl",
1406
+ value: function getBaseUrl(params, prefix) {
1407
+ return "".concat(this.cdnUrl, "/").concat(params.accountId, "/").concat(prefix).concat(params.filePath);
1408
+ }
1409
+ }, {
1410
+ key: "getCommonQueryParams",
1411
+ value: function getCommonQueryParams(params) {
1412
+ return this.makeQueryParams(["auth", "cache", "cacheTtl", "version", "forceDownloadPrompt"], {
1413
+ cacheTtl: "cache_ttl",
1414
+ forceDownloadPrompt: "download"
1415
+ })(params);
1416
+ }
1417
+ }, {
1418
+ key: "makeQueryParams",
1419
+ value: function makeQueryParams(keys, keyOverrides) {
1420
+ return function (data) {
1421
+ var result = [];
1422
+ keys.forEach(function (key) {
1423
+ var _a;
1424
+ var value = data[key];
1425
+ if (value !== undefined) {
1426
+ result.push([(_a = keyOverrides[key]) !== null && _a !== void 0 ? _a : key, value.toString()]);
1427
+ }
1428
+ });
1429
+ return result;
1430
+ };
1431
+ }
1432
+ }, {
1433
+ key: "getTransformationParams",
1434
+ value: function getTransformationParams(trans, keyRewrites) {
1435
+ if (trans.params === undefined) {
1436
+ return [];
1437
+ }
1438
+ var serializeObj = function serializeObj(obj) {
1439
+ return Object.entries(obj).filter(isDefinedEntry).map(function (_ref) {
1440
+ var _ref2 = _slicedToArray(_ref, 2),
1441
+ key = _ref2[0],
1442
+ value = _ref2[1];
1443
+ var _a;
1444
+ return [(_a = keyRewrites[key]) !== null && _a !== void 0 ? _a : key, value.toString()];
1445
+ });
1446
+ };
1447
+ return Array.isArray(trans.params) ? trans.params.flatMap(serializeObj) : serializeObj(trans.params);
1448
+ }
1449
+ }, {
1450
+ key: "addQueryParams",
1451
+ value: function addQueryParams(baseUrl, params) {
1452
+ if (params.length === 0) {
1453
+ return baseUrl;
1454
+ }
1455
+ return "".concat(baseUrl, "?").concat(params.map(function (_ref3) {
1456
+ var _ref4 = _slicedToArray(_ref3, 2),
1457
+ key = _ref4[0],
1458
+ value = _ref4[1];
1459
+ return "".concat(encodeURIComponent(key), "=").concat(encodeURIComponent(value));
1460
+ }).join("&"));
1461
+ }
1462
+ }]);
1463
+ return UrlBuilder;
1464
+ }();
1465
+ ;// CONCATENATED MODULE: ./src/public/shared/UrlBuilderTypes.ts
1466
+ /**
1467
+ * Workaround for tsc aliases, where we cannot export implementation-less libs in our dists.
1468
+ */
1469
+ var UrlBuilderTypesNoOp = false;
1470
+ ;// CONCATENATED MODULE: ./src/public/shared/index.ts
1471
+
1315
1472
 
1316
- ;// CONCATENATED MODULE: ./src/uploads/private/UploadManagerBase.ts
1473
+
1474
+
1475
+ ;// CONCATENATED MODULE: ./src/private/UploadManagerBase.ts
1317
1476
  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); }
1318
- function UploadManagerBase_async(f) {
1477
+ function _async(f) {
1319
1478
  return function () {
1320
1479
  for (var args = [], i = 0; i < arguments.length; i++) {
1321
1480
  args[i] = arguments[i];
@@ -1487,12 +1646,12 @@ function _continueIgnored(value) {
1487
1646
  return value.then(UploadManagerBase_empty);
1488
1647
  }
1489
1648
  }
1490
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
1491
- 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."); }
1492
- 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); }
1493
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
1494
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
1495
- 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; }
1649
+ function UploadManagerBase_toConsumableArray(arr) { return UploadManagerBase_arrayWithoutHoles(arr) || UploadManagerBase_iterableToArray(arr) || UploadManagerBase_unsupportedIterableToArray(arr) || UploadManagerBase_nonIterableSpread(); }
1650
+ 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."); }
1651
+ 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); }
1652
+ function UploadManagerBase_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
1653
+ function UploadManagerBase_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return UploadManagerBase_arrayLikeToArray(arr); }
1654
+ 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; }
1496
1655
  function UploadManagerBase_empty() {}
1497
1656
  function _awaitIgnored(value, direct) {
1498
1657
  if (!direct) {
@@ -1532,7 +1691,6 @@ function UploadManagerBase_createClass(Constructor, protoProps, staticProps) { i
1532
1691
  function UploadManagerBase_toPropertyKey(arg) { var key = UploadManagerBase_toPrimitive(arg, "string"); return UploadManagerBase_typeof(key) === "symbol" ? key : String(key); }
1533
1692
  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); }
1534
1693
 
1535
-
1536
1694
  /**
1537
1695
  * Methods common to UploadManagerNode and UploadManagerBrowser.
1538
1696
  */
@@ -1559,13 +1717,13 @@ var UploadManagerBase = /*#__PURE__*/function () {
1559
1717
  onProgress(0);
1560
1718
  return UploadManagerBase_await(_this2.beginUpload(request, preUploadInfo), function (uploadInfo) {
1561
1719
  var partCount = uploadInfo.uploadParts.count;
1562
- var parts = _toConsumableArray(Array(partCount).keys());
1720
+ var parts = UploadManagerBase_toConsumableArray(Array(partCount).keys());
1563
1721
  var _this2$makeCancellati = _this2.makeCancellationMethods(),
1564
1722
  cancel = _this2$makeCancellati.cancel,
1565
1723
  addCancellationHandler = _this2$makeCancellati.addCancellationHandler;
1566
1724
  var intervalHandle = setInterval(_this2.onIntervalTick(request, cancel), _this2.intervalMs);
1567
1725
  return UploadManagerBase_continue(_finallyRethrows(function () {
1568
- return UploadManagerBase_await(_this2.mapAsync(parts, preUploadInfo.maxConcurrentUploadParts, UploadManagerBase_async(function (part) {
1726
+ return UploadManagerBase_await(_this2.mapAsync(parts, preUploadInfo.maxConcurrentUploadParts, _async(function (part) {
1569
1727
  return _this2.uploadPart(request, source, part, uploadInfo, onProgress, addCancellationHandler);
1570
1728
  })), function () {
1571
1729
  return _awaitIgnored(_this2.postUpload(init));
@@ -1757,8 +1915,8 @@ var UploadManagerBase = /*#__PURE__*/function () {
1757
1915
  key: "mapAsync",
1758
1916
  value: function mapAsync(items, concurrency, callback) {
1759
1917
  try {
1760
- var workQueue = _toConsumableArray(items);
1761
- return _awaitIgnored(Promise.all(_toConsumableArray(Array(concurrency).keys()).map(UploadManagerBase_async(function () {
1918
+ var workQueue = UploadManagerBase_toConsumableArray(items);
1919
+ return _awaitIgnored(Promise.all(UploadManagerBase_toConsumableArray(Array(concurrency).keys()).map(_async(function () {
1762
1920
  return _continueIgnored(_for(function () {
1763
1921
  return workQueue.length > 0;
1764
1922
  }, void 0, function () {
@@ -1781,7 +1939,7 @@ var UploadManagerBase = /*#__PURE__*/function () {
1781
1939
  var x = y => { var x = {}; __lib_require__.d(x, y); return x; }
1782
1940
  var y = x => () => x
1783
1941
  var external_stream_namespaceObject = x({ ["Readable"]: () => __WEBPACK_EXTERNAL_MODULE_stream__.Readable });
1784
- ;// CONCATENATED MODULE: ./src/uploads/private/StreamUtils.ts
1942
+ ;// CONCATENATED MODULE: ./src/private/StreamUtils.ts
1785
1943
  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); }
1786
1944
  function StreamUtils_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1787
1945
  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); } }
@@ -1823,14 +1981,14 @@ var StreamUtils = /*#__PURE__*/function () {
1823
1981
  }]);
1824
1982
  return StreamUtils;
1825
1983
  }();
1826
- ;// CONCATENATED MODULE: ./src/uploads/private/NodeChunkedStream.ts
1984
+ ;// CONCATENATED MODULE: ./src/private/NodeChunkedStream.ts
1827
1985
  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); }
1828
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || NodeChunkedStream_unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
1829
- 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."); }
1986
+ function NodeChunkedStream_slicedToArray(arr, i) { return NodeChunkedStream_arrayWithHoles(arr) || NodeChunkedStream_iterableToArrayLimit(arr, i) || NodeChunkedStream_unsupportedIterableToArray(arr, i) || NodeChunkedStream_nonIterableRest(); }
1987
+ 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."); }
1830
1988
  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); }
1831
1989
  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; }
1832
- 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; } }
1833
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
1990
+ 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; } }
1991
+ function NodeChunkedStream_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
1834
1992
  function NodeChunkedStream_await(value, then, direct) {
1835
1993
  if (direct) {
1836
1994
  return then ? then(value) : value;
@@ -1918,7 +2076,7 @@ var NodeChunkedStream = /*#__PURE__*/function () {
1918
2076
  return; // Received empty data.
1919
2077
  }
1920
2078
 
1921
- var _splitResult = _slicedToArray(splitResult, 2),
2079
+ var _splitResult = NodeChunkedStream_slicedToArray(splitResult, 2),
1922
2080
  consumed = _splitResult[0],
1923
2081
  remaining = _splitResult[1];
1924
2082
  _this2.buffer = remaining;
@@ -1989,7 +2147,7 @@ var NodeChunkedStream = /*#__PURE__*/function () {
1989
2147
  if (splitResult === undefined) {
1990
2148
  return undefined;
1991
2149
  }
1992
- var _splitResult2 = _slicedToArray(splitResult, 2),
2150
+ var _splitResult2 = NodeChunkedStream_slicedToArray(splitResult, 2),
1993
2151
  consumed = _splitResult2[0],
1994
2152
  remaining = _splitResult2[1];
1995
2153
  this.buffer = remaining;
@@ -2013,15 +2171,11 @@ var NodeChunkedStream = /*#__PURE__*/function () {
2013
2171
  }]);
2014
2172
  return NodeChunkedStream;
2015
2173
  }();
2016
- ;// CONCATENATED MODULE: ./src/uploads/private/TypeUtils.ts
2017
- function assertUnreachable(x) {
2018
- throw new Error("Didn't expect to get here: ".concat(JSON.stringify(x)));
2019
- }
2020
2174
  ;// CONCATENATED MODULE: external "buffer"
2021
2175
  var external_buffer_x = y => { var x = {}; __lib_require__.d(x, y); return x; }
2022
2176
  var external_buffer_y = x => () => x
2023
2177
  var external_buffer_namespaceObject = external_buffer_x({ ["Blob"]: () => __WEBPACK_EXTERNAL_MODULE_buffer__.Blob });
2024
- ;// CONCATENATED MODULE: ./src/uploads/public/node/UploadManagerNode.ts
2178
+ ;// CONCATENATED MODULE: ./src/public/node/UploadManagerNode.ts
2025
2179
  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); }
2026
2180
  function UploadManagerNode_empty() {}
2027
2181
  function UploadManagerNode_awaitIgnored(value, direct) {
@@ -2400,25 +2554,94 @@ var UploadManager = /*#__PURE__*/function (_UploadManagerBase) {
2400
2554
  }]);
2401
2555
  return UploadManager;
2402
2556
  }(UploadManagerBase);
2403
- ;// CONCATENATED MODULE: ./src/uploads/public/node/index.ts
2557
+ ;// CONCATENATED MODULE: ./src/private/EnvChecker.ts
2558
+ 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); }
2559
+ function EnvChecker_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2560
+ 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); } }
2561
+ 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; }
2562
+ function EnvChecker_toPropertyKey(arg) { var key = EnvChecker_toPrimitive(arg, "string"); return EnvChecker_typeof(key) === "symbol" ? key : String(key); }
2563
+ 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); }
2564
+ var EnvChecker = /*#__PURE__*/function () {
2565
+ function EnvChecker() {
2566
+ EnvChecker_classCallCheck(this, EnvChecker);
2567
+ }
2568
+ EnvChecker_createClass(EnvChecker, null, [{
2569
+ key: "isNodeJs",
2570
+ value: function isNodeJs() {
2571
+ return typeof process !== "undefined" && process.versions !== undefined && process.versions.node !== undefined;
2572
+ }
2573
+ }, {
2574
+ key: "methodRequiresBrowser",
2575
+ value: function methodRequiresBrowser(methodName) {
2576
+ if (EnvChecker.isNodeJs()) {
2577
+ return new Error("You must call '".concat(methodName, "' in the browser. (You are currently in Node.js.)"));
2578
+ }
2579
+ 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."));
2580
+ }
2581
+ }]);
2582
+ return EnvChecker;
2583
+ }();
2584
+ ;// CONCATENATED MODULE: ./src/public/node/AuthManagerNode.ts
2585
+ 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); }
2586
+ function AuthManagerNode_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2587
+ 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); } }
2588
+ 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; }
2589
+ function AuthManagerNode_toPropertyKey(arg) { var key = AuthManagerNode_toPrimitive(arg, "string"); return AuthManagerNode_typeof(key) === "symbol" ? key : String(key); }
2590
+ 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); }
2591
+
2592
+ var AuthManager = /*#__PURE__*/function () {
2593
+ function AuthManager() {
2594
+ AuthManagerNode_classCallCheck(this, AuthManager);
2595
+ }
2596
+ AuthManagerNode_createClass(AuthManager, [{
2597
+ key: "beginAuthSession",
2598
+ value: function beginAuthSession(_authUrl, _authHeaders) {
2599
+ try {
2600
+ throw EnvChecker.methodRequiresBrowser("beginAuthSession");
2601
+ } catch (e) {
2602
+ return Promise.reject(e);
2603
+ }
2604
+ }
2605
+ }, {
2606
+ key: "endAuthSession",
2607
+ value: function endAuthSession() {
2608
+ try {
2609
+ throw EnvChecker.methodRequiresBrowser("endAuthSession");
2610
+ } catch (e) {
2611
+ return Promise.reject(e);
2612
+ }
2613
+ }
2614
+ }, {
2615
+ key: "isAuthSessionActive",
2616
+ value: function isAuthSessionActive() {
2617
+ return false;
2618
+ }
2619
+ }]);
2620
+ return AuthManager;
2621
+ }();
2622
+ ;// CONCATENATED MODULE: ./src/public/node/index.ts
2623
+
2404
2624
 
2405
2625
  ;// CONCATENATED MODULE: ./src/index.node.ts
2406
2626
  /* tslint:disable */
2407
2627
  /* eslint-disable */
2408
2628
 
2409
2629
 
2410
-
2411
- var __lib_exports__BASE_PATH = __lib_exports__.BASE_PATH;
2630
+ var __lib_exports__AuthManager = __lib_exports__.AuthManager;
2412
2631
  var __lib_exports__BaseAPI = __lib_exports__.BaseAPI;
2413
2632
  var __lib_exports__BinaryResult = __lib_exports__.BinaryResult;
2633
+ var __lib_exports__BytescaleApiClientConfigResolver = __lib_exports__.BytescaleApiClientConfigResolver;
2414
2634
  var __lib_exports__BytescaleApiError = __lib_exports__.BytescaleApiError;
2415
2635
  var __lib_exports__CancelledError = __lib_exports__.CancelledError;
2636
+ var __lib_exports__CommonTypesNoOp = __lib_exports__.CommonTypesNoOp;
2416
2637
  var __lib_exports__FileApi = __lib_exports__.FileApi;
2417
2638
  var __lib_exports__FolderApi = __lib_exports__.FolderApi;
2418
2639
  var __lib_exports__JSONApiResponse = __lib_exports__.JSONApiResponse;
2419
2640
  var __lib_exports__JobApi = __lib_exports__.JobApi;
2420
2641
  var __lib_exports__UploadApi = __lib_exports__.UploadApi;
2421
2642
  var __lib_exports__UploadManager = __lib_exports__.UploadManager;
2643
+ var __lib_exports__UrlBuilder = __lib_exports__.UrlBuilder;
2644
+ var __lib_exports__UrlBuilderTypesNoOp = __lib_exports__.UrlBuilderTypesNoOp;
2422
2645
  var __lib_exports__VoidApiResponse = __lib_exports__.VoidApiResponse;
2423
2646
  var __lib_exports__querystring = __lib_exports__.querystring;
2424
- export { __lib_exports__BASE_PATH as BASE_PATH, __lib_exports__BaseAPI as BaseAPI, __lib_exports__BinaryResult as BinaryResult, __lib_exports__BytescaleApiError as BytescaleApiError, __lib_exports__CancelledError as CancelledError, __lib_exports__FileApi as FileApi, __lib_exports__FolderApi as FolderApi, __lib_exports__JSONApiResponse as JSONApiResponse, __lib_exports__JobApi as JobApi, __lib_exports__UploadApi as UploadApi, __lib_exports__UploadManager as UploadManager, __lib_exports__VoidApiResponse as VoidApiResponse, __lib_exports__querystring as querystring };
2647
+ export { __lib_exports__AuthManager as AuthManager, __lib_exports__BaseAPI as BaseAPI, __lib_exports__BinaryResult as BinaryResult, __lib_exports__BytescaleApiClientConfigResolver as BytescaleApiClientConfigResolver, __lib_exports__BytescaleApiError as BytescaleApiError, __lib_exports__CancelledError as CancelledError, __lib_exports__CommonTypesNoOp as CommonTypesNoOp, __lib_exports__FileApi as FileApi, __lib_exports__FolderApi as FolderApi, __lib_exports__JSONApiResponse as JSONApiResponse, __lib_exports__JobApi as JobApi, __lib_exports__UploadApi as UploadApi, __lib_exports__UploadManager as UploadManager, __lib_exports__UrlBuilder as UrlBuilder, __lib_exports__UrlBuilderTypesNoOp as UrlBuilderTypesNoOp, __lib_exports__VoidApiResponse as VoidApiResponse, __lib_exports__querystring as querystring };