@bytescale/sdk 1.0.0-alpha.2 → 1.0.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -132,75 +132,27 @@ __lib_require__.r(__lib_exports__);
132
132
 
133
133
  // EXPORTS
134
134
  __lib_require__.d(__lib_exports__, {
135
- "AccountJobStatus": function() { return /* reexport */ AccountJobStatus; },
136
- "AccountJobType": function() { return /* reexport */ AccountJobType; },
137
- "AsyncResponseJobDocsEnum": function() { return /* reexport */ AsyncResponseJobDocsEnum; },
138
- "AwsRegion": function() { return /* reexport */ AwsRegion; },
139
135
  "BASE_PATH": function() { return /* reexport */ BASE_PATH; },
140
136
  "BaseAPI": function() { return /* reexport */ BaseAPI; },
141
137
  "BinaryResult": function() { return /* reexport */ BinaryResult; },
142
- "COLLECTION_FORMATS": function() { return /* reexport */ COLLECTION_FORMATS; },
138
+ "BytescaleApiError": function() { return /* reexport */ BytescaleApiError; },
143
139
  "CancelledError": function() { return /* reexport */ CancelledError; },
144
140
  "ChunkedStream": function() { return /* reexport */ ChunkedStream; },
145
- "Configuration": function() { return /* reexport */ Configuration; },
146
- "DefaultConfig": function() { return /* reexport */ DefaultConfig; },
147
- "DigitalOceanStorageTypeEnum": function() { return /* reexport */ DigitalOceanStorageTypeEnum; },
148
141
  "FetchError": function() { return /* reexport */ FetchError; },
149
142
  "FileApi": function() { return /* reexport */ FileApi; },
150
- "FileCopyStatus": function() { return /* reexport */ FileCopyStatus; },
151
- "FileSummaryTypeEnum": function() { return /* reexport */ FileSummaryTypeEnum; },
152
143
  "FolderApi": function() { return /* reexport */ FolderApi; },
153
- "FolderDetailsTypeEnum": function() { return /* reexport */ FolderDetailsTypeEnum; },
154
- "FolderSettingsStorageLayerSummaryStorageLayerTypeEnum": function() { return /* reexport */ FolderSettingsStorageLayerSummaryStorageLayerTypeEnum; },
155
- "FolderSummaryTypeEnum": function() { return /* reexport */ FolderSummaryTypeEnum; },
156
- "GoogleStorageTypeEnum": function() { return /* reexport */ GoogleStorageTypeEnum; },
157
- "InternalStorageV1TypeEnum": function() { return /* reexport */ InternalStorageV1TypeEnum; },
158
- "InternalStorageV2TypeEnum": function() { return /* reexport */ InternalStorageV2TypeEnum; },
159
144
  "JSONApiResponse": function() { return /* reexport */ JSONApiResponse; },
160
145
  "JobApi": function() { return /* reexport */ JobApi; },
161
- "JobSummaryJobDocsEnum": function() { return /* reexport */ JobSummaryJobDocsEnum; },
162
- "MultipartUploadProtocol": function() { return /* reexport */ MultipartUploadProtocol; },
163
- "ObjectSummaryTypeEnum": function() { return /* reexport */ ObjectSummaryTypeEnum; },
164
- "PathPermissionScope": function() { return /* reexport */ PathPermissionScope; },
165
- "PickDigitalOceanStorageExcludeKeyofDigitalOceanStorageCredentialsTypeEnum": function() { return /* reexport */ PickDigitalOceanStorageExcludeKeyofDigitalOceanStorageCredentialsTypeEnum; },
166
- "PickGoogleStorageExcludeKeyofGoogleStorageCredentialsTypeEnum": function() { return /* reexport */ PickGoogleStorageExcludeKeyofGoogleStorageCredentialsTypeEnum; },
167
- "PickR2StorageExcludeKeyofR2StorageCredentialsTypeEnum": function() { return /* reexport */ PickR2StorageExcludeKeyofR2StorageCredentialsTypeEnum; },
168
- "PickS3StorageExcludeKeyofS3StorageCredentialsTypeEnum": function() { return /* reexport */ PickS3StorageExcludeKeyofS3StorageCredentialsTypeEnum; },
169
- "ProcessFileCachePermEnum": function() { return /* reexport */ ProcessFileCachePermEnum; },
170
- "R2StorageTypeEnum": function() { return /* reexport */ R2StorageTypeEnum; },
171
146
  "RequiredError": function() { return /* reexport */ RequiredError; },
172
147
  "ResponseError": function() { return /* reexport */ ResponseError; },
173
- "S3StorageTypeEnum": function() { return /* reexport */ S3StorageTypeEnum; },
174
- "SpecifiedFieldValueFolderDescriptionOrNullSetEnum": function() { return /* reexport */ SpecifiedFieldValueFolderDescriptionOrNullSetEnum; },
175
- "SpecifiedFieldValuePublicPermissionsArrayOrNullSetEnum": function() { return /* reexport */ SpecifiedFieldValuePublicPermissionsArrayOrNullSetEnum; },
176
- "SpecifiedFieldValueStorageLayerUpdateOrNullSetEnum": function() { return /* reexport */ SpecifiedFieldValueStorageLayerUpdateOrNullSetEnum; },
177
- "SpecifiedFieldValueStorageLayerUpdateOrNullValueTypeEnum": function() { return /* reexport */ SpecifiedFieldValueStorageLayerUpdateOrNullValueTypeEnum; },
178
- "StorageLayerSummaryTypeEnum": function() { return /* reexport */ StorageLayerSummaryTypeEnum; },
179
- "StorageLayerUpdateTypeEnum": function() { return /* reexport */ StorageLayerUpdateTypeEnum; },
180
- "TagConditionAllTypeEnum": function() { return /* reexport */ TagConditionAllTypeEnum; },
181
- "TagConditionAndTypeEnum": function() { return /* reexport */ TagConditionAndTypeEnum; },
182
- "TagConditionAnyTypeEnum": function() { return /* reexport */ TagConditionAnyTypeEnum; },
183
- "TagConditionEqualsTypeEnum": function() { return /* reexport */ TagConditionEqualsTypeEnum; },
184
- "TagConditionNotTypeEnum": function() { return /* reexport */ TagConditionNotTypeEnum; },
185
- "TagConditionOrTypeEnum": function() { return /* reexport */ TagConditionOrTypeEnum; },
186
- "TagConditionTypeEnum": function() { return /* reexport */ TagConditionTypeEnum; },
187
- "TextApiResponse": function() { return /* reexport */ TextApiResponse; },
188
- "UnspecifiedFieldValueSetEnum": function() { return /* reexport */ UnspecifiedFieldValueSetEnum; },
189
- "UpdatableFieldFolderDescriptionOrNullSetEnum": function() { return /* reexport */ UpdatableFieldFolderDescriptionOrNullSetEnum; },
190
- "UpdatableFieldPublicPermissionsArrayOrNullSetEnum": function() { return /* reexport */ UpdatableFieldPublicPermissionsArrayOrNullSetEnum; },
191
- "UpdatableFieldStorageLayerUpdateOrNullSetEnum": function() { return /* reexport */ UpdatableFieldStorageLayerUpdateOrNullSetEnum; },
192
148
  "UploadApi": function() { return /* reexport */ UploadApi; },
193
- "UploadApiError": function() { return /* reexport */ UploadApiError; },
194
149
  "UploadManager": function() { return /* reexport */ UploadManager; },
195
150
  "VoidApiResponse": function() { return /* reexport */ VoidApiResponse; },
196
- "WebStorageTypeEnum": function() { return /* reexport */ WebStorageTypeEnum; },
197
- "canConsumeForm": function() { return /* reexport */ canConsumeForm; },
198
151
  "querystring": function() { return /* reexport */ querystring; }
199
152
  });
200
153
 
201
- ;// CONCATENATED MODULE: ./src/gen/runtime.ts
154
+ ;// CONCATENATED MODULE: ./src/generated/runtime.ts
202
155
  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); }
203
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
204
156
  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); }
205
157
  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); }; }
206
158
  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); }
@@ -211,19 +163,6 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
211
163
  function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
212
164
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
213
165
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
214
- function _invoke(body, then) {
215
- var result = body();
216
- if (result && result.then) {
217
- return result.then(then);
218
- }
219
- return then(result);
220
- }
221
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
222
- 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."); }
223
- 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); }
224
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
225
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
226
- 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; }
227
166
  function _await(value, then, direct) {
228
167
  if (direct) {
229
168
  return then ? then(value) : value;
@@ -233,170 +172,6 @@ function _await(value, then, direct) {
233
172
  }
234
173
  return then ? value.then(then) : value;
235
174
  }
236
- function _empty() {}
237
- function _invokeIgnored(body) {
238
- var result = body();
239
- if (result && result.then) {
240
- return result.then(_empty);
241
- }
242
- }
243
- var _iteratorSymbol = /*#__PURE__*/typeof Symbol !== "undefined" ? Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator")) : "@@iterator";
244
- function _settle(pact, state, value) {
245
- if (!pact.s) {
246
- if (value instanceof _Pact) {
247
- if (value.s) {
248
- if (state & 1) {
249
- state = value.s;
250
- }
251
- value = value.v;
252
- } else {
253
- value.o = _settle.bind(null, pact, state);
254
- return;
255
- }
256
- }
257
- if (value && value.then) {
258
- value.then(_settle.bind(null, pact, state), _settle.bind(null, pact, 2));
259
- return;
260
- }
261
- pact.s = state;
262
- pact.v = value;
263
- var observer = pact.o;
264
- if (observer) {
265
- observer(pact);
266
- }
267
- }
268
- }
269
- var _Pact = /*#__PURE__*/function () {
270
- function _Pact() {}
271
- _Pact.prototype.then = function (onFulfilled, onRejected) {
272
- var result = new _Pact();
273
- var state = this.s;
274
- if (state) {
275
- var callback = state & 1 ? onFulfilled : onRejected;
276
- if (callback) {
277
- try {
278
- _settle(result, 1, callback(this.v));
279
- } catch (e) {
280
- _settle(result, 2, e);
281
- }
282
- return result;
283
- } else {
284
- return this;
285
- }
286
- }
287
- this.o = function (_this) {
288
- try {
289
- var value = _this.v;
290
- if (_this.s & 1) {
291
- _settle(result, 1, onFulfilled ? onFulfilled(value) : value);
292
- } else if (onRejected) {
293
- _settle(result, 1, onRejected(value));
294
- } else {
295
- _settle(result, 2, value);
296
- }
297
- } catch (e) {
298
- _settle(result, 2, e);
299
- }
300
- };
301
- return result;
302
- };
303
- return _Pact;
304
- }();
305
- function _isSettledPact(thenable) {
306
- return thenable instanceof _Pact && thenable.s & 1;
307
- }
308
- function _forTo(array, body, check) {
309
- var i = -1,
310
- pact,
311
- reject;
312
- function _cycle(result) {
313
- try {
314
- while (++i < array.length && (!check || !check())) {
315
- result = body(i);
316
- if (result && result.then) {
317
- if (_isSettledPact(result)) {
318
- result = result.v;
319
- } else {
320
- result.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));
321
- return;
322
- }
323
- }
324
- }
325
- if (pact) {
326
- _settle(pact, 1, result);
327
- } else {
328
- pact = result;
329
- }
330
- } catch (e) {
331
- _settle(pact || (pact = new _Pact()), 2, e);
332
- }
333
- }
334
- _cycle();
335
- return pact;
336
- }
337
- function _forOf(target, body, check) {
338
- if (typeof target[_iteratorSymbol] === "function") {
339
- var _cycle = function _cycle(result) {
340
- try {
341
- while (!(step = iterator.next()).done && (!check || !check())) {
342
- result = body(step.value);
343
- if (result && result.then) {
344
- if (_isSettledPact(result)) {
345
- result = result.v;
346
- } else {
347
- result.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));
348
- return;
349
- }
350
- }
351
- }
352
- if (pact) {
353
- _settle(pact, 1, result);
354
- } else {
355
- pact = result;
356
- }
357
- } catch (e) {
358
- _settle(pact || (pact = new _Pact()), 2, e);
359
- }
360
- };
361
- var iterator = target[_iteratorSymbol](),
362
- step,
363
- pact,
364
- reject;
365
- _cycle();
366
- if (iterator["return"]) {
367
- var _fixup = function _fixup(value) {
368
- try {
369
- if (!step.done) {
370
- iterator["return"]();
371
- }
372
- } catch (e) {}
373
- return value;
374
- };
375
- if (pact && pact.then) {
376
- return pact.then(_fixup, function (e) {
377
- throw _fixup(e);
378
- });
379
- }
380
- _fixup();
381
- }
382
- return pact;
383
- }
384
- // No support for Symbol.iterator
385
- if (!("length" in target)) {
386
- throw new TypeError("Object is not iterable");
387
- }
388
- // Handle live collections properly
389
- var values = [];
390
- for (var i = 0; i < target.length; i++) {
391
- values.push(target[i]);
392
- }
393
- return _forTo(values, function (i) {
394
- return body(values[i]);
395
- }, check);
396
- }
397
- function _continue(value, then) {
398
- return value && value.then ? value.then(then) : then(value);
399
- }
400
175
  function _catch(body, recover) {
401
176
  try {
402
177
  var result = body();
@@ -408,6 +183,9 @@ function _catch(body, recover) {
408
183
  }
409
184
  return result;
410
185
  }
186
+ function _continue(value, then) {
187
+ return value && value.then ? value.then(then) : then(value);
188
+ }
411
189
  function _async(f) {
412
190
  return function () {
413
191
  for (var args = [], i = 0; i < arguments.length; i++) {
@@ -420,13 +198,21 @@ function _async(f) {
420
198
  }
421
199
  };
422
200
  }
201
+ function _empty() {}
202
+ function _invoke(body, then) {
203
+ var result = body();
204
+ if (result && result.then) {
205
+ return result.then(then);
206
+ }
207
+ return then(result);
208
+ }
423
209
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
424
210
  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); } }
425
211
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
426
212
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
427
213
  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); }
428
214
  /**
429
- * @bytescale/bytescale-api
215
+ * @bytescale/api
430
216
  * Bytescale API
431
217
  *
432
218
  * The version of the OpenAPI document: 2.0.0
@@ -437,200 +223,46 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
437
223
  * Do not edit the class manually.
438
224
  */
439
225
  var BASE_PATH = "https://api.bytescale.com".replace(/\/+$/, "");
440
- var Configuration = /*#__PURE__*/function () {
441
- function Configuration() {
442
- var configuration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
443
- _classCallCheck(this, Configuration);
444
- this.configuration = configuration;
445
- }
446
- _createClass(Configuration, [{
447
- key: "config",
448
- set: function set(configuration) {
449
- this.configuration = configuration;
450
- }
451
- }, {
452
- key: "basePath",
453
- get: function get() {
454
- return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
455
- }
456
- }, {
457
- key: "fetchApi",
458
- get: function get() {
459
- return this.configuration.fetchApi;
460
- }
461
- }, {
462
- key: "middleware",
463
- get: function get() {
464
- return this.configuration.middleware || [];
465
- }
466
- }, {
467
- key: "queryParamsStringify",
468
- get: function get() {
469
- return this.configuration.queryParamsStringify || querystring;
470
- }
471
- }, {
472
- key: "username",
473
- get: function get() {
474
- return this.configuration.username;
475
- }
476
- }, {
477
- key: "password",
478
- get: function get() {
479
- return this.configuration.password;
480
- }
481
- }, {
482
- key: "apiKey",
483
- get: function get() {
484
- var apiKey = this.configuration.apiKey;
485
- if (apiKey) {
486
- return typeof apiKey === "function" ? apiKey : function (name) {
487
- return name === "Authorization" ? "Bearer ".concat(apiKey) : apiKey;
488
- };
489
- }
490
- return undefined;
491
- }
492
- }, {
493
- key: "accessToken",
494
- get: function get() {
495
- var accessToken = this.configuration.accessToken;
496
- if (accessToken) {
497
- return typeof accessToken === "function" ? accessToken : function () {
498
- return _await(accessToken);
499
- };
500
- }
501
- return undefined;
502
- }
503
- }, {
504
- key: "headers",
505
- get: function get() {
506
- return this.configuration.headers;
507
- }
508
- }, {
509
- key: "credentials",
510
- get: function get() {
511
- return this.configuration.credentials;
512
- }
513
- }]);
514
- return Configuration;
515
- }();
516
- var DefaultConfig = new Configuration();
517
226
  /**
518
227
  * This is the base class for all generated API classes.
519
228
  */
520
229
  var BaseAPI = /*#__PURE__*/function () {
521
- function BaseAPI() {
230
+ function BaseAPI(config) {
522
231
  var _this = this;
523
- var configuration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DefaultConfig;
524
232
  _classCallCheck(this, BaseAPI);
525
- this.configuration = configuration;
233
+ this.config = config;
526
234
  this.fetchApi = _async(function (url, init) {
235
+ var _exit = false;
527
236
  var fetchParams = {
528
237
  url: url,
529
238
  init: init
530
239
  };
531
- return _continue(_forOf(_this.middleware, function (middleware) {
532
- return _invokeIgnored(function () {
533
- if (middleware.pre) {
534
- return _await(middleware.pre(Object.assign({
535
- fetch: _this.fetchApi
536
- }, fetchParams)), function (_middleware$pre) {
537
- fetchParams = _middleware$pre || fetchParams;
538
- });
539
- }
540
- });
541
- }), function () {
542
- var _exit = false;
543
- var response = undefined;
544
- return _continue(_catch(function () {
545
- return _await((_this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init), function (_temp) {
546
- response = _temp;
547
- });
548
- }, function (e) {
549
- return _continue(_forOf(_this.middleware, function (middleware) {
550
- return _invokeIgnored(function () {
551
- if (middleware.onError) {
552
- return _await(middleware.onError({
553
- fetch: _this.fetchApi,
554
- url: fetchParams.url,
555
- init: fetchParams.init,
556
- error: e,
557
- response: response ? response.clone() : undefined
558
- }), function (_middleware$onError) {
559
- response = _middleware$onError || response;
560
- });
561
- }
562
- });
563
- }), function () {
564
- if (response === undefined) {
565
- if (e instanceof Error) {
566
- throw new FetchError(e, "The request failed and the interceptors did not return an alternative response");
567
- } else {
568
- throw e;
569
- }
570
- }
571
- });
572
- }), function (_result) {
573
- return _exit ? _result : _continue(_forOf(_this.middleware, function (middleware) {
574
- return _invokeIgnored(function () {
575
- if (middleware.post) {
576
- return _await(middleware.post({
577
- fetch: _this.fetchApi,
578
- url: fetchParams.url,
579
- init: fetchParams.init,
580
- response: response.clone()
581
- }), function (_middleware$post) {
582
- response = _middleware$post || response;
583
- });
584
- }
585
- });
586
- }), function () {
587
- return response;
588
- });
240
+ var response = undefined;
241
+ return _continue(_catch(function () {
242
+ return _await((_this.config.fetchApi || fetch)(fetchParams.url, fetchParams.init), function (_temp) {
243
+ response = _temp;
589
244
  });
245
+ }, function (e) {
246
+ if (response === undefined) {
247
+ if (e instanceof Error) {
248
+ throw new FetchError(e, "The request failed and the interceptors did not return an alternative response");
249
+ } else {
250
+ throw e;
251
+ }
252
+ }
253
+ }), function (_result) {
254
+ return _exit ? _result : response;
590
255
  });
591
256
  });
592
- this.middleware = configuration.middleware;
593
257
  }
594
258
  _createClass(BaseAPI, [{
595
- key: "withMiddleware",
596
- value: function withMiddleware() {
597
- var _next$middleware;
598
- var next = this.clone();
599
- next.middleware = (_next$middleware = next.middleware).concat.apply(_next$middleware, arguments);
600
- return next;
601
- }
602
- }, {
603
- key: "withPreMiddleware",
604
- value: function withPreMiddleware() {
605
- for (var _len = arguments.length, preMiddlewares = new Array(_len), _key = 0; _key < _len; _key++) {
606
- preMiddlewares[_key] = arguments[_key];
607
- }
608
- var middlewares = preMiddlewares.map(function (pre) {
609
- return {
610
- pre: pre
611
- };
612
- });
613
- return this.withMiddleware.apply(this, _toConsumableArray(middlewares));
614
- }
615
- }, {
616
- key: "withPostMiddleware",
617
- value: function withPostMiddleware() {
618
- for (var _len2 = arguments.length, postMiddlewares = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
619
- postMiddlewares[_key2] = arguments[_key2];
620
- }
621
- var middlewares = postMiddlewares.map(function (post) {
622
- return {
623
- post: post
624
- };
625
- });
626
- return this.withMiddleware.apply(this, _toConsumableArray(middlewares));
627
- }
628
- }, {
629
259
  key: "request",
630
260
  value: function request(context, initOverrides, operationBasePathOverride) {
631
261
  try {
632
262
  var _this3 = this;
633
263
  var _a;
264
+ var apiKey = _this3.config.apiKey;
265
+ context.headers["Authorization"] = "Bearer ".concat(apiKey); // authorization-header authentication
634
266
  return _await(_this3.createFetchParams(context, initOverrides, operationBasePathOverride), function (_ref) {
635
267
  var url = _ref.url,
636
268
  init = _ref.init;
@@ -645,7 +277,7 @@ var BaseAPI = /*#__PURE__*/function () {
645
277
  });
646
278
  }, _empty), function () {
647
279
  if (typeof ((_a = jsonError === null || jsonError === void 0 ? void 0 : jsonError.error) === null || _a === void 0 ? void 0 : _a.code) === "string") {
648
- throw new UploadApiError(jsonError);
280
+ throw new BytescaleApiError(jsonError);
649
281
  }
650
282
  });
651
283
  }
@@ -659,61 +291,57 @@ var BaseAPI = /*#__PURE__*/function () {
659
291
  return Promise.reject(e);
660
292
  }
661
293
  }
294
+ }, {
295
+ key: "encodeParam",
296
+ value: function encodeParam(paramName, paramValue) {
297
+ return paramName === "filePath" ? paramValue : encodeURIComponent(paramValue);
298
+ }
662
299
  }, {
663
300
  key: "createFetchParams",
664
301
  value: function createFetchParams(context, initOverrides, operationBasePathOverride) {
665
302
  try {
666
303
  var _this5 = this;
667
- var url = (operationBasePathOverride !== null && operationBasePathOverride !== void 0 ? operationBasePathOverride : _this5.configuration.basePath) + context.path;
304
+ var url = (operationBasePathOverride !== null && operationBasePathOverride !== void 0 ? operationBasePathOverride : BASE_PATH) + context.path;
668
305
  if (context.query !== undefined && Object.keys(context.query).length !== 0) {
669
306
  // only add the querystring to the URL if there are query parameters.
670
307
  // this is done to avoid urls ending with a "?" character which buggy webservers
671
308
  // do not handle correctly sometimes.
672
- url += "?" + _this5.configuration.queryParamsStringify(context.query);
673
- }
674
- var headers = Object.assign({}, _this5.configuration.headers, context.headers);
675
- Object.keys(headers).forEach(function (key) {
676
- return headers[key] === undefined ? delete headers[key] : {};
677
- });
678
- var initOverrideFn = typeof initOverrides === "function" ? initOverrides : function () {
679
- return _await(initOverrides);
680
- };
681
- var initParams = {
682
- method: context.method,
683
- headers: headers,
684
- body: context.body,
685
- credentials: _this5.configuration.credentials
686
- };
687
- var _Object$assign2 = Object.assign({}, initParams);
688
- return _await(initOverrideFn({
689
- init: initParams,
690
- context: context
691
- }), function (_initOverrideFn) {
692
- var overriddenInit = Object.assign(_Object$assign2, _initOverrideFn);
693
- var init = Object.assign(Object.assign({}, overriddenInit), {
694
- body: isFormData(overriddenInit.body) || overriddenInit.body instanceof URLSearchParams || isBlob(overriddenInit.body) ? overriddenInit.body : JSON.stringify(overriddenInit.body)
309
+ url += "?" + querystring(context.query);
310
+ }
311
+ var configHeaders = _this5.config.headers;
312
+ var _Object$assign3 = Object.assign({}, context.headers);
313
+ return _await(configHeaders === undefined ? {} : configHeaders(), function (_configHeaders) {
314
+ var headers = Object.assign(_Object$assign3, _configHeaders);
315
+ Object.keys(headers).forEach(function (key) {
316
+ return headers[key] === undefined ? delete headers[key] : {};
695
317
  });
696
- return {
697
- url: url,
698
- init: init
318
+ var initOverrideFn = typeof initOverrides === "function" ? initOverrides : function () {
319
+ return _await(initOverrides);
699
320
  };
700
- });
321
+ var initParams = {
322
+ method: context.method,
323
+ headers: headers,
324
+ body: context.body
325
+ };
326
+ var _Object$assign2 = Object.assign({}, initParams);
327
+ return _await(initOverrideFn({
328
+ init: initParams,
329
+ context: context
330
+ }), function (_initOverrideFn) {
331
+ var overriddenInit = Object.assign(_Object$assign2, _initOverrideFn);
332
+ var init = Object.assign(Object.assign({}, overriddenInit), {
333
+ body: isFormData(overriddenInit.body) || overriddenInit.body instanceof URLSearchParams || isBlob(overriddenInit.body) ? overriddenInit.body : JSON.stringify(overriddenInit.body)
334
+ });
335
+ return {
336
+ url: url,
337
+ init: init
338
+ };
339
+ });
340
+ }, configHeaders === undefined);
701
341
  } catch (e) {
702
342
  return Promise.reject(e);
703
343
  }
704
344
  }
705
- /**
706
- * Create a shallow clone of `this` by constructing a new instance
707
- * and then shallow cloning data members.
708
- */
709
- }, {
710
- key: "clone",
711
- value: function clone() {
712
- var constructor = this.constructor;
713
- var next = new constructor(this.configuration);
714
- next.middleware = this.middleware.slice();
715
- return next;
716
- }
717
345
  }]);
718
346
  return BaseAPI;
719
347
  }();
@@ -723,19 +351,19 @@ function isBlob(value) {
723
351
  function isFormData(value) {
724
352
  return typeof FormData !== "undefined" && value instanceof FormData;
725
353
  }
726
- var UploadApiError = /*#__PURE__*/function (_Error) {
727
- _inherits(UploadApiError, _Error);
728
- var _super = _createSuper(UploadApiError);
729
- function UploadApiError(response) {
354
+ var BytescaleApiError = /*#__PURE__*/function (_Error) {
355
+ _inherits(BytescaleApiError, _Error);
356
+ var _super = _createSuper(BytescaleApiError);
357
+ function BytescaleApiError(response) {
730
358
  var _this6;
731
- _classCallCheck(this, UploadApiError);
359
+ _classCallCheck(this, BytescaleApiError);
732
360
  _this6 = _super.call(this, response.error.message);
733
- _this6.name = "UploadApiError";
361
+ _this6.name = "BytescaleApiError";
734
362
  _this6.errorCode = response.error.code;
735
363
  _this6.details = response.error.details;
736
364
  return _this6;
737
365
  }
738
- return _createClass(UploadApiError);
366
+ return _createClass(BytescaleApiError);
739
367
  }( /*#__PURE__*/_wrapNativeSuper(Error));
740
368
  var ResponseError = /*#__PURE__*/function (_Error2) {
741
369
  _inherits(ResponseError, _Error2);
@@ -776,12 +404,6 @@ var RequiredError = /*#__PURE__*/function (_Error4) {
776
404
  }
777
405
  return _createClass(RequiredError);
778
406
  }( /*#__PURE__*/_wrapNativeSuper(Error));
779
- var COLLECTION_FORMATS = {
780
- csv: ",",
781
- ssv: " ",
782
- tsv: "\t",
783
- pipes: "|"
784
- };
785
407
  function querystring(params) {
786
408
  var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
787
409
  return Object.keys(params).map(function (key) {
@@ -811,23 +433,6 @@ function querystringSingleKey(key, value) {
811
433
  }
812
434
  return "".concat(encodeURIComponent(fullKey), "=").concat(encodeURIComponent(String(value)));
813
435
  }
814
- function canConsumeForm(consumes) {
815
- var _iterator = _createForOfIteratorHelper(consumes),
816
- _step;
817
- try {
818
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
819
- var consume = _step.value;
820
- if ("multipart/form-data" === consume.contentType) {
821
- return true;
822
- }
823
- }
824
- } catch (err) {
825
- _iterator.e(err);
826
- } finally {
827
- _iterator.f();
828
- }
829
- return false;
830
- }
831
436
  var JSONApiResponse = /*#__PURE__*/function () {
832
437
  function JSONApiResponse(raw) {
833
438
  var transformer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (jsonValue) {
@@ -915,25 +520,7 @@ var BinaryResult = /*#__PURE__*/function () {
915
520
  }]);
916
521
  return BinaryResult;
917
522
  }();
918
- var TextApiResponse = /*#__PURE__*/function () {
919
- function TextApiResponse(raw) {
920
- _classCallCheck(this, TextApiResponse);
921
- this.raw = raw;
922
- }
923
- _createClass(TextApiResponse, [{
924
- key: "value",
925
- value: function value() {
926
- try {
927
- var _this19 = this;
928
- return _await(_this19.raw.text());
929
- } catch (e) {
930
- return Promise.reject(e);
931
- }
932
- }
933
- }]);
934
- return TextApiResponse;
935
- }();
936
- ;// CONCATENATED MODULE: ./src/gen/apis/FileApi.ts
523
+ ;// CONCATENATED MODULE: ./src/generated/apis/FileApi.ts
937
524
  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); }
938
525
  function FileApi_await(value, then, direct) {
939
526
  if (direct) {
@@ -944,12 +531,6 @@ function FileApi_await(value, then, direct) {
944
531
  }
945
532
  return then ? value.then(then) : value;
946
533
  }
947
- function FileApi_empty() {}
948
- function _awaitIgnored(value, direct) {
949
- if (!direct) {
950
- return value && value.then ? value.then(FileApi_empty) : Promise.resolve();
951
- }
952
- }
953
534
  function FileApi_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
954
535
  function FileApi_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, FileApi_toPropertyKey(descriptor.key), descriptor); } }
955
536
  function FileApi_createClass(Constructor, protoProps, staticProps) { if (protoProps) FileApi_defineProperties(Constructor.prototype, protoProps); if (staticProps) FileApi_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
@@ -965,7 +546,7 @@ function FileApi_getPrototypeOf(o) { FileApi_getPrototypeOf = Object.setPrototyp
965
546
  /* tslint:disable */
966
547
  /* eslint-disable */
967
548
  /**
968
- * @bytescale/bytescale-api
549
+ * @bytescale/api
969
550
  * Bytescale API
970
551
  *
971
552
  * The version of the OpenAPI document: 2.0.0
@@ -988,320 +569,168 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
988
569
  return _super.apply(this, arguments);
989
570
  }
990
571
  FileApi_createClass(FileApi, [{
991
- key: "copyFileWithHttpInfo",
572
+ key: "copyFile",
992
573
  value:
993
574
  /**
994
575
  * Copies a file synchronously.
995
576
  */
996
- function copyFileWithHttpInfo(requestParameters, initOverrides) {
577
+ function copyFile(params) {
997
578
  try {
998
579
  var _this2 = this;
999
- if (requestParameters.accountId === null || requestParameters.accountId === undefined) {
1000
- throw new RequiredError("accountId", "Required parameter requestParameters.accountId was null or undefined when calling copyFile.");
1001
- }
1002
- if (requestParameters.copyFileRequest === null || requestParameters.copyFileRequest === undefined) {
1003
- throw new RequiredError("copyFileRequest", "Required parameter requestParameters.copyFileRequest was null or undefined when calling copyFile.");
1004
- }
1005
- var queryParameters = {};
1006
- var headerParameters = {};
1007
- headerParameters["Content-Type"] = "application/json";
1008
- if (_this2.configuration && _this2.configuration.apiKey) {
1009
- headerParameters["Authorization"] = _this2.configuration.apiKey("Authorization"); // authorization-header authentication
1010
- }
1011
-
1012
- var operationBasePathOverride = [][0];
580
+ var query = {};
581
+ var headers = {};
582
+ headers["Content-Type"] = "application/json";
1013
583
  return FileApi_await(_this2.request({
1014
584
  path: "/v2/accounts/{accountId}/files/copy".replace("{".concat("accountId", "}"),
1015
585
  // @ts-ignore
1016
- false ? 0 : encodeURIComponent(String(requestParameters.accountId))),
586
+ _this2.encodeParam("accountId", params.accountId)),
1017
587
  method: "POST",
1018
- headers: headerParameters,
1019
- query: queryParameters,
1020
- body: requestParameters.copyFileRequest
1021
- }, initOverrides, operationBasePathOverride), function (response) {
1022
- return new JSONApiResponse(response);
588
+ headers: headers,
589
+ query: query,
590
+ body: params.copyFileRequest
591
+ }, undefined, [][0]), function (response) {
592
+ return FileApi_await(new JSONApiResponse(response).value());
1023
593
  });
1024
594
  } catch (e) {
1025
595
  return Promise.reject(e);
1026
596
  }
1027
597
  }
1028
598
  /**
1029
- * Copies a file synchronously.
599
+ * Copies multiple files asynchronously.
1030
600
  */
1031
601
  }, {
1032
- key: "copyFile",
1033
- value: function copyFile(requestParameters, initOverrides) {
602
+ key: "copyFileBatch",
603
+ value: function copyFileBatch(params) {
1034
604
  try {
1035
605
  var _this4 = this;
1036
- return FileApi_await(_this4.copyFileWithHttpInfo(requestParameters, initOverrides), function (response) {
1037
- return FileApi_await(response.value());
606
+ var query = {};
607
+ var headers = {};
608
+ headers["Content-Type"] = "application/json";
609
+ return FileApi_await(_this4.request({
610
+ path: "/v2/accounts/{accountId}/files/copy/batch".replace("{".concat("accountId", "}"),
611
+ // @ts-ignore
612
+ _this4.encodeParam("accountId", params.accountId)),
613
+ method: "POST",
614
+ headers: headers,
615
+ query: query,
616
+ body: params.copyFileBatchRequest
617
+ }, undefined, [][0]), function (response) {
618
+ return FileApi_await(new JSONApiResponse(response).value());
1038
619
  });
1039
620
  } catch (e) {
1040
621
  return Promise.reject(e);
1041
622
  }
1042
623
  }
1043
624
  /**
1044
- * Copies multiple files asynchronously.
625
+ * Deletes a file synchronously.
1045
626
  */
1046
627
  }, {
1047
- key: "copyFileBatchWithHttpInfo",
1048
- value: function copyFileBatchWithHttpInfo(requestParameters, initOverrides) {
628
+ key: "deleteFile",
629
+ value: function deleteFile(params) {
1049
630
  try {
1050
631
  var _this6 = this;
1051
- if (requestParameters.accountId === null || requestParameters.accountId === undefined) {
1052
- throw new RequiredError("accountId", "Required parameter requestParameters.accountId was null or undefined when calling copyFileBatch.");
1053
- }
1054
- if (requestParameters.copyFileBatchRequest === null || requestParameters.copyFileBatchRequest === undefined) {
1055
- throw new RequiredError("copyFileBatchRequest", "Required parameter requestParameters.copyFileBatchRequest was null or undefined when calling copyFileBatch.");
1056
- }
1057
- var queryParameters = {};
1058
- var headerParameters = {};
1059
- headerParameters["Content-Type"] = "application/json";
1060
- if (_this6.configuration && _this6.configuration.apiKey) {
1061
- headerParameters["Authorization"] = _this6.configuration.apiKey("Authorization"); // authorization-header authentication
632
+ var query = {};
633
+ if (params.filePath !== undefined) {
634
+ query["filePath"] = params.filePath;
1062
635
  }
1063
-
1064
- var operationBasePathOverride = [][0];
636
+ var headers = {};
1065
637
  return FileApi_await(_this6.request({
1066
- path: "/v2/accounts/{accountId}/files/copy/batch".replace("{".concat("accountId", "}"),
638
+ path: "/v2/accounts/{accountId}/files".replace("{".concat("accountId", "}"),
1067
639
  // @ts-ignore
1068
- false ? 0 : encodeURIComponent(String(requestParameters.accountId))),
1069
- method: "POST",
1070
- headers: headerParameters,
1071
- query: queryParameters,
1072
- body: requestParameters.copyFileBatchRequest
1073
- }, initOverrides, operationBasePathOverride), function (response) {
1074
- return new JSONApiResponse(response);
640
+ _this6.encodeParam("accountId", params.accountId)),
641
+ method: "DELETE",
642
+ headers: headers,
643
+ query: query
644
+ }, undefined, [][0]), function (response) {
645
+ return FileApi_await(new VoidApiResponse(response).value());
1075
646
  });
1076
647
  } catch (e) {
1077
648
  return Promise.reject(e);
1078
649
  }
1079
650
  }
1080
651
  /**
1081
- * Copies multiple files asynchronously.
652
+ * Deletes multiple files asynchronously.
1082
653
  */
1083
654
  }, {
1084
- key: "copyFileBatch",
1085
- value: function copyFileBatch(requestParameters, initOverrides) {
655
+ key: "deleteFileBatch",
656
+ value: function deleteFileBatch(params) {
1086
657
  try {
1087
658
  var _this8 = this;
1088
- return FileApi_await(_this8.copyFileBatchWithHttpInfo(requestParameters, initOverrides), function (response) {
1089
- return FileApi_await(response.value());
659
+ var query = {};
660
+ var headers = {};
661
+ headers["Content-Type"] = "application/json";
662
+ return FileApi_await(_this8.request({
663
+ path: "/v2/accounts/{accountId}/files/batch".replace("{".concat("accountId", "}"),
664
+ // @ts-ignore
665
+ _this8.encodeParam("accountId", params.accountId)),
666
+ method: "DELETE",
667
+ headers: headers,
668
+ query: query,
669
+ body: params.deleteFileBatchRequest
670
+ }, undefined, [][0]), function (response) {
671
+ return FileApi_await(new JSONApiResponse(response).value());
1090
672
  });
1091
673
  } catch (e) {
1092
674
  return Promise.reject(e);
1093
675
  }
1094
676
  }
1095
677
  /**
1096
- * Deletes a file synchronously.
678
+ * Downloads a file in its original/unprocessed state.
1097
679
  */
1098
680
  }, {
1099
- key: "deleteFileWithHttpInfo",
1100
- value: function deleteFileWithHttpInfo(requestParameters, initOverrides) {
681
+ key: "downloadFile",
682
+ value: function downloadFile(params) {
1101
683
  try {
1102
684
  var _this10 = this;
1103
- if (requestParameters.accountId === null || requestParameters.accountId === undefined) {
1104
- throw new RequiredError("accountId", "Required parameter requestParameters.accountId was null or undefined when calling deleteFile.");
1105
- }
1106
- if (requestParameters.filePath === null || requestParameters.filePath === undefined) {
1107
- throw new RequiredError("filePath", "Required parameter requestParameters.filePath was null or undefined when calling deleteFile.");
685
+ var query = {};
686
+ if (params.cache !== undefined) {
687
+ query["cache"] = params.cache;
1108
688
  }
1109
- var queryParameters = {};
1110
- if (requestParameters.filePath !== undefined) {
1111
- queryParameters["filePath"] = requestParameters.filePath;
689
+ if (params.cacheTtl !== undefined) {
690
+ query["cache_ttl"] = params.cacheTtl;
1112
691
  }
1113
- var headerParameters = {};
1114
- if (_this10.configuration && _this10.configuration.apiKey) {
1115
- headerParameters["Authorization"] = _this10.configuration.apiKey("Authorization"); // authorization-header authentication
692
+ if (params.version !== undefined) {
693
+ query["version"] = params.version;
1116
694
  }
1117
-
1118
- var operationBasePathOverride = [][0];
695
+ var headers = {};
1119
696
  return FileApi_await(_this10.request({
1120
- path: "/v2/accounts/{accountId}/files".replace("{".concat("accountId", "}"),
1121
- // @ts-ignore
1122
- false ? 0 : encodeURIComponent(String(requestParameters.accountId))),
1123
- method: "DELETE",
1124
- headers: headerParameters,
1125
- query: queryParameters
1126
- }, initOverrides, operationBasePathOverride), function (response) {
1127
- return new VoidApiResponse(response);
1128
- });
1129
- } catch (e) {
1130
- return Promise.reject(e);
1131
- }
1132
- }
1133
- /**
1134
- * Deletes a file synchronously.
1135
- */
1136
- }, {
1137
- key: "deleteFile",
1138
- value: function deleteFile(requestParameters, initOverrides) {
1139
- try {
1140
- var _this12 = this;
1141
- return _awaitIgnored(_this12.deleteFileWithHttpInfo(requestParameters, initOverrides));
1142
- } catch (e) {
1143
- return Promise.reject(e);
1144
- }
1145
- }
1146
- /**
1147
- * Deletes multiple files asynchronously.
1148
- */
1149
- }, {
1150
- key: "deleteFileBatchWithHttpInfo",
1151
- value: function deleteFileBatchWithHttpInfo(requestParameters, initOverrides) {
1152
- try {
1153
- var _this14 = this;
1154
- if (requestParameters.accountId === null || requestParameters.accountId === undefined) {
1155
- throw new RequiredError("accountId", "Required parameter requestParameters.accountId was null or undefined when calling deleteFileBatch.");
1156
- }
1157
- if (requestParameters.deleteFileBatchRequest === null || requestParameters.deleteFileBatchRequest === undefined) {
1158
- throw new RequiredError("deleteFileBatchRequest", "Required parameter requestParameters.deleteFileBatchRequest was null or undefined when calling deleteFileBatch.");
1159
- }
1160
- var queryParameters = {};
1161
- var headerParameters = {};
1162
- headerParameters["Content-Type"] = "application/json";
1163
- if (_this14.configuration && _this14.configuration.apiKey) {
1164
- headerParameters["Authorization"] = _this14.configuration.apiKey("Authorization"); // authorization-header authentication
1165
- }
1166
-
1167
- var operationBasePathOverride = [][0];
1168
- return FileApi_await(_this14.request({
1169
- path: "/v2/accounts/{accountId}/files/batch".replace("{".concat("accountId", "}"),
1170
- // @ts-ignore
1171
- false ? 0 : encodeURIComponent(String(requestParameters.accountId))),
1172
- method: "DELETE",
1173
- headers: headerParameters,
1174
- query: queryParameters,
1175
- body: requestParameters.deleteFileBatchRequest
1176
- }, initOverrides, operationBasePathOverride), function (response) {
1177
- return new JSONApiResponse(response);
1178
- });
1179
- } catch (e) {
1180
- return Promise.reject(e);
1181
- }
1182
- }
1183
- /**
1184
- * Deletes multiple files asynchronously.
1185
- */
1186
- }, {
1187
- key: "deleteFileBatch",
1188
- value: function deleteFileBatch(requestParameters, initOverrides) {
1189
- try {
1190
- var _this16 = this;
1191
- return FileApi_await(_this16.deleteFileBatchWithHttpInfo(requestParameters, initOverrides), function (response) {
1192
- return FileApi_await(response.value());
1193
- });
1194
- } catch (e) {
1195
- return Promise.reject(e);
1196
- }
1197
- }
1198
- /**
1199
- * Downloads a file in its original/unprocessed state.
1200
- */
1201
- }, {
1202
- key: "downloadFileWithHttpInfo",
1203
- value: function downloadFileWithHttpInfo(requestParameters, initOverrides) {
1204
- try {
1205
- var _this18 = this;
1206
- if (requestParameters.accountId === null || requestParameters.accountId === undefined) {
1207
- throw new RequiredError("accountId", "Required parameter requestParameters.accountId was null or undefined when calling downloadFile.");
1208
- }
1209
- if (requestParameters.filePath === null || requestParameters.filePath === undefined) {
1210
- throw new RequiredError("filePath", "Required parameter requestParameters.filePath was null or undefined when calling downloadFile.");
1211
- }
1212
- var queryParameters = {};
1213
- if (requestParameters.cache !== undefined) {
1214
- queryParameters["cache"] = requestParameters.cache;
1215
- }
1216
- if (requestParameters.cacheTtl !== undefined) {
1217
- queryParameters["cache_ttl"] = requestParameters.cacheTtl;
1218
- }
1219
- if (requestParameters.version !== undefined) {
1220
- queryParameters["version"] = requestParameters.version;
1221
- }
1222
- var headerParameters = {};
1223
- if (_this18.configuration && _this18.configuration.apiKey) {
1224
- headerParameters["Authorization"] = _this18.configuration.apiKey("Authorization"); // authorization-header authentication
1225
- }
1226
-
1227
- var operationBasePathOverride = ["https://upcdn.io"][0];
1228
- return FileApi_await(_this18.request({
1229
697
  path: "/{accountId}/raw{filePath}".replace("{".concat("accountId", "}"),
1230
698
  // @ts-ignore
1231
- false ? 0 : encodeURIComponent(String(requestParameters.accountId))).replace("{".concat("filePath", "}"),
699
+ _this10.encodeParam("accountId", params.accountId)).replace("{".concat("filePath", "}"),
1232
700
  // @ts-ignore
1233
- true ? String(requestParameters.filePath) : 0),
701
+ _this10.encodeParam("filePath", params.filePath)),
1234
702
  method: "GET",
1235
- headers: headerParameters,
1236
- query: queryParameters
1237
- }, initOverrides, operationBasePathOverride), function (response) {
703
+ headers: headers,
704
+ query: query
705
+ }, undefined, ["https://upcdn.io"][0]), function (response) {
1238
706
  return new BinaryResult(response);
1239
707
  });
1240
708
  } catch (e) {
1241
709
  return Promise.reject(e);
1242
710
  }
1243
711
  }
1244
- /**
1245
- * Downloads a file in its original/unprocessed state.
1246
- */
1247
- }, {
1248
- key: "downloadFile",
1249
- value: function downloadFile(requestParameters, initOverrides) {
1250
- try {
1251
- var _this20 = this;
1252
- return FileApi_await(_this20.downloadFileWithHttpInfo(requestParameters, initOverrides));
1253
- } catch (e) {
1254
- return Promise.reject(e);
1255
- }
1256
- }
1257
712
  /**
1258
713
  * Gets the full details (e.g. metadata, tags, etc.) for a file.
1259
714
  */
1260
715
  }, {
1261
- key: "getFileDetailsWithHttpInfo",
1262
- value: function getFileDetailsWithHttpInfo(requestParameters, initOverrides) {
716
+ key: "getFileDetails",
717
+ value: function getFileDetails(params) {
1263
718
  try {
1264
- var _this22 = this;
1265
- if (requestParameters.accountId === null || requestParameters.accountId === undefined) {
1266
- throw new RequiredError("accountId", "Required parameter requestParameters.accountId was null or undefined when calling getFileDetails.");
1267
- }
1268
- if (requestParameters.filePath === null || requestParameters.filePath === undefined) {
1269
- throw new RequiredError("filePath", "Required parameter requestParameters.filePath was null or undefined when calling getFileDetails.");
1270
- }
1271
- var queryParameters = {};
1272
- if (requestParameters.filePath !== undefined) {
1273
- queryParameters["filePath"] = requestParameters.filePath;
1274
- }
1275
- var headerParameters = {};
1276
- if (_this22.configuration && _this22.configuration.apiKey) {
1277
- headerParameters["Authorization"] = _this22.configuration.apiKey("Authorization"); // authorization-header authentication
719
+ var _this12 = this;
720
+ var query = {};
721
+ if (params.filePath !== undefined) {
722
+ query["filePath"] = params.filePath;
1278
723
  }
1279
-
1280
- var operationBasePathOverride = [][0];
1281
- return FileApi_await(_this22.request({
724
+ var headers = {};
725
+ return FileApi_await(_this12.request({
1282
726
  path: "/v2/accounts/{accountId}/files/details".replace("{".concat("accountId", "}"),
1283
727
  // @ts-ignore
1284
- false ? 0 : encodeURIComponent(String(requestParameters.accountId))),
728
+ _this12.encodeParam("accountId", params.accountId)),
1285
729
  method: "GET",
1286
- headers: headerParameters,
1287
- query: queryParameters
1288
- }, initOverrides, operationBasePathOverride), function (response) {
1289
- return new JSONApiResponse(response);
1290
- });
1291
- } catch (e) {
1292
- return Promise.reject(e);
1293
- }
1294
- }
1295
- /**
1296
- * Gets the full details (e.g. metadata, tags, etc.) for a file.
1297
- */
1298
- }, {
1299
- key: "getFileDetails",
1300
- value: function getFileDetails(requestParameters, initOverrides) {
1301
- try {
1302
- var _this24 = this;
1303
- return FileApi_await(_this24.getFileDetailsWithHttpInfo(requestParameters, initOverrides), function (response) {
1304
- return FileApi_await(response.value());
730
+ headers: headers,
731
+ query: query
732
+ }, undefined, [][0]), function (response) {
733
+ return FileApi_await(new JSONApiResponse(response).value());
1305
734
  });
1306
735
  } catch (e) {
1307
736
  return Promise.reject(e);
@@ -1311,132 +740,73 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
1311
740
  * Processes a file and returns the result.
1312
741
  */
1313
742
  }, {
1314
- key: "processFileWithHttpInfo",
1315
- value: function processFileWithHttpInfo(requestParameters, initOverrides) {
743
+ key: "processFile",
744
+ value: function processFile(params) {
1316
745
  try {
1317
- var _this26 = this;
1318
- if (requestParameters.accountId === null || requestParameters.accountId === undefined) {
1319
- throw new RequiredError("accountId", "Required parameter requestParameters.accountId was null or undefined when calling processFile.");
1320
- }
1321
- if (requestParameters.filePath === null || requestParameters.filePath === undefined) {
1322
- throw new RequiredError("filePath", "Required parameter requestParameters.filePath was null or undefined when calling processFile.");
1323
- }
1324
- if (requestParameters.transformation === null || requestParameters.transformation === undefined) {
1325
- throw new RequiredError("transformation", "Required parameter requestParameters.transformation was null or undefined when calling processFile.");
1326
- }
1327
- var queryParameters = {};
1328
- if (requestParameters.artifact !== undefined) {
1329
- queryParameters["artifact"] = requestParameters.artifact;
1330
- }
1331
- if (requestParameters.cache !== undefined) {
1332
- queryParameters["cache"] = requestParameters.cache;
746
+ var _this14 = this;
747
+ var query = {};
748
+ if (params.artifact !== undefined) {
749
+ query["artifact"] = params.artifact;
1333
750
  }
1334
- if (requestParameters.cachePerm !== undefined) {
1335
- queryParameters["cache_perm"] = requestParameters.cachePerm;
751
+ if (params.cache !== undefined) {
752
+ query["cache"] = params.cache;
1336
753
  }
1337
- if (requestParameters.cacheTtl !== undefined) {
1338
- queryParameters["cache_ttl"] = requestParameters.cacheTtl;
754
+ if (params.cachePerm !== undefined) {
755
+ query["cache_perm"] = params.cachePerm;
1339
756
  }
1340
- if (requestParameters.large !== undefined) {
1341
- queryParameters["large"] = requestParameters.large;
757
+ if (params.cacheTtl !== undefined) {
758
+ query["cache_ttl"] = params.cacheTtl;
1342
759
  }
1343
- if (requestParameters.version !== undefined) {
1344
- queryParameters["version"] = requestParameters.version;
760
+ if (params.large !== undefined) {
761
+ query["large"] = params.large;
1345
762
  }
1346
- var headerParameters = {};
1347
- if (_this26.configuration && _this26.configuration.apiKey) {
1348
- headerParameters["Authorization"] = _this26.configuration.apiKey("Authorization"); // authorization-header authentication
763
+ if (params.version !== undefined) {
764
+ query["version"] = params.version;
1349
765
  }
1350
-
1351
- var operationBasePathOverride = ["https://upcdn.io"][0];
1352
- return FileApi_await(_this26.request({
766
+ var headers = {};
767
+ return FileApi_await(_this14.request({
1353
768
  path: "/{accountId}/{transformation}{filePath}".replace("{".concat("accountId", "}"),
1354
769
  // @ts-ignore
1355
- false ? 0 : encodeURIComponent(String(requestParameters.accountId))).replace("{".concat("filePath", "}"),
770
+ _this14.encodeParam("accountId", params.accountId)).replace("{".concat("filePath", "}"),
1356
771
  // @ts-ignore
1357
- true ? String(requestParameters.filePath) : 0).replace("{".concat("transformation", "}"),
772
+ _this14.encodeParam("filePath", params.filePath)).replace("{".concat("transformation", "}"),
1358
773
  // @ts-ignore
1359
- false ? 0 : encodeURIComponent(String(requestParameters.transformation))),
774
+ _this14.encodeParam("transformation", params.transformation)),
1360
775
  method: "GET",
1361
- headers: headerParameters,
1362
- query: queryParameters
1363
- }, initOverrides, operationBasePathOverride), function (response) {
776
+ headers: headers,
777
+ query: query
778
+ }, undefined, ["https://upcdn.io"][0]), function (response) {
1364
779
  return new BinaryResult(response);
1365
780
  });
1366
781
  } catch (e) {
1367
782
  return Promise.reject(e);
1368
783
  }
1369
784
  }
1370
- /**
1371
- * Processes a file and returns the result.
1372
- */
1373
- }, {
1374
- key: "processFile",
1375
- value: function processFile(requestParameters, initOverrides) {
1376
- try {
1377
- var _this28 = this;
1378
- return FileApi_await(_this28.processFileWithHttpInfo(requestParameters, initOverrides));
1379
- } catch (e) {
1380
- return Promise.reject(e);
1381
- }
1382
- }
1383
785
  /**
1384
786
  * Processes a file and saves the result.
1385
787
  */
1386
788
  }, {
1387
- key: "processFileAndSaveWithHttpInfo",
1388
- value: function processFileAndSaveWithHttpInfo(requestParameters, initOverrides) {
789
+ key: "processFileAndSave",
790
+ value: function processFileAndSave(params) {
1389
791
  try {
1390
- var _this30 = this;
1391
- if (requestParameters.accountId === null || requestParameters.accountId === undefined) {
1392
- throw new RequiredError("accountId", "Required parameter requestParameters.accountId was null or undefined when calling processFileAndSave.");
1393
- }
1394
- if (requestParameters.filePath === null || requestParameters.filePath === undefined) {
1395
- throw new RequiredError("filePath", "Required parameter requestParameters.filePath was null or undefined when calling processFileAndSave.");
1396
- }
1397
- if (requestParameters.transformation === null || requestParameters.transformation === undefined) {
1398
- throw new RequiredError("transformation", "Required parameter requestParameters.transformation was null or undefined when calling processFileAndSave.");
1399
- }
1400
- if (requestParameters.processFileAndSaveRequest === null || requestParameters.processFileAndSaveRequest === undefined) {
1401
- throw new RequiredError("processFileAndSaveRequest", "Required parameter requestParameters.processFileAndSaveRequest was null or undefined when calling processFileAndSave.");
1402
- }
1403
- var queryParameters = {};
1404
- var headerParameters = {};
1405
- headerParameters["Content-Type"] = "application/json";
1406
- if (_this30.configuration && _this30.configuration.apiKey) {
1407
- headerParameters["Authorization"] = _this30.configuration.apiKey("Authorization"); // authorization-header authentication
1408
- }
1409
-
1410
- var operationBasePathOverride = ["https://upcdn.io"][0];
1411
- return FileApi_await(_this30.request({
792
+ var _this16 = this;
793
+ var query = {};
794
+ var headers = {};
795
+ headers["Content-Type"] = "application/json";
796
+ return FileApi_await(_this16.request({
1412
797
  path: "/{accountId}/save/{transformation}{filePath}".replace("{".concat("accountId", "}"),
1413
798
  // @ts-ignore
1414
- false ? 0 : encodeURIComponent(String(requestParameters.accountId))).replace("{".concat("filePath", "}"),
799
+ _this16.encodeParam("accountId", params.accountId)).replace("{".concat("filePath", "}"),
1415
800
  // @ts-ignore
1416
- true ? String(requestParameters.filePath) : 0).replace("{".concat("transformation", "}"),
801
+ _this16.encodeParam("filePath", params.filePath)).replace("{".concat("transformation", "}"),
1417
802
  // @ts-ignore
1418
- false ? 0 : encodeURIComponent(String(requestParameters.transformation))),
803
+ _this16.encodeParam("transformation", params.transformation)),
1419
804
  method: "POST",
1420
- headers: headerParameters,
1421
- query: queryParameters,
1422
- body: requestParameters.processFileAndSaveRequest
1423
- }, initOverrides, operationBasePathOverride), function (response) {
1424
- return new JSONApiResponse(response);
1425
- });
1426
- } catch (e) {
1427
- return Promise.reject(e);
1428
- }
1429
- }
1430
- /**
1431
- * Processes a file and saves the result.
1432
- */
1433
- }, {
1434
- key: "processFileAndSave",
1435
- value: function processFileAndSave(requestParameters, initOverrides) {
1436
- try {
1437
- var _this32 = this;
1438
- return FileApi_await(_this32.processFileAndSaveWithHttpInfo(requestParameters, initOverrides), function (response) {
1439
- return FileApi_await(response.value());
805
+ headers: headers,
806
+ query: query,
807
+ body: params.processFileAndSaveRequest
808
+ }, undefined, ["https://upcdn.io"][0]), function (response) {
809
+ return FileApi_await(new JSONApiResponse(response).value());
1440
810
  });
1441
811
  } catch (e) {
1442
812
  return Promise.reject(e);
@@ -1445,15 +815,7 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
1445
815
  }]);
1446
816
  return FileApi;
1447
817
  }(BaseAPI);
1448
- /**
1449
- * @export
1450
- */
1451
- var ProcessFileCachePermEnum = {
1452
- Auto: "auto",
1453
- False: "false",
1454
- True: "true"
1455
- };
1456
- ;// CONCATENATED MODULE: ./src/gen/apis/FolderApi.ts
818
+ ;// CONCATENATED MODULE: ./src/generated/apis/FolderApi.ts
1457
819
  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); }
1458
820
  function FolderApi_await(value, then, direct) {
1459
821
  if (direct) {
@@ -1479,7 +841,7 @@ function FolderApi_getPrototypeOf(o) { FolderApi_getPrototypeOf = Object.setProt
1479
841
  /* tslint:disable */
1480
842
  /* eslint-disable */
1481
843
  /**
1482
- * @bytescale/bytescale-api
844
+ * @bytescale/api
1483
845
  * Bytescale API
1484
846
  *
1485
847
  * The version of the OpenAPI document: 2.0.0
@@ -1502,53 +864,27 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
1502
864
  return _super.apply(this, arguments);
1503
865
  }
1504
866
  FolderApi_createClass(FolderApi, [{
1505
- key: "copyFolderWithHttpInfo",
867
+ key: "copyFolder",
1506
868
  value:
1507
869
  /**
1508
870
  * Copies a folder asynchronously. You can use ListFolder to preview the operation: set `dryRun=true` with ```recursive```, ```includeFiles```, ```includeOverriddenStorage``` and ```includeVirtualFolders``` set to match the values you\'re using here. Leave all other flags unset.
1509
871
  */
1510
- function copyFolderWithHttpInfo(requestParameters, initOverrides) {
872
+ function copyFolder(params) {
1511
873
  try {
1512
874
  var _this2 = this;
1513
- if (requestParameters.accountId === null || requestParameters.accountId === undefined) {
1514
- throw new RequiredError("accountId", "Required parameter requestParameters.accountId was null or undefined when calling copyFolder.");
1515
- }
1516
- if (requestParameters.copyFolderRequest === null || requestParameters.copyFolderRequest === undefined) {
1517
- throw new RequiredError("copyFolderRequest", "Required parameter requestParameters.copyFolderRequest was null or undefined when calling copyFolder.");
1518
- }
1519
- var queryParameters = {};
1520
- var headerParameters = {};
1521
- headerParameters["Content-Type"] = "application/json";
1522
- if (_this2.configuration && _this2.configuration.apiKey) {
1523
- headerParameters["Authorization"] = _this2.configuration.apiKey("Authorization"); // authorization-header authentication
1524
- }
1525
-
1526
- var operationBasePathOverride = [][0];
875
+ var query = {};
876
+ var headers = {};
877
+ headers["Content-Type"] = "application/json";
1527
878
  return FolderApi_await(_this2.request({
1528
879
  path: "/v2/accounts/{accountId}/folders/copy".replace("{".concat("accountId", "}"),
1529
880
  // @ts-ignore
1530
- false ? 0 : encodeURIComponent(String(requestParameters.accountId))),
881
+ _this2.encodeParam("accountId", params.accountId)),
1531
882
  method: "POST",
1532
- headers: headerParameters,
1533
- query: queryParameters,
1534
- body: requestParameters.copyFolderRequest
1535
- }, initOverrides, operationBasePathOverride), function (response) {
1536
- return new JSONApiResponse(response);
1537
- });
1538
- } catch (e) {
1539
- return Promise.reject(e);
1540
- }
1541
- }
1542
- /**
1543
- * Copies a folder asynchronously. You can use ListFolder to preview the operation: set `dryRun=true` with ```recursive```, ```includeFiles```, ```includeOverriddenStorage``` and ```includeVirtualFolders``` set to match the values you\'re using here. Leave all other flags unset.
1544
- */
1545
- }, {
1546
- key: "copyFolder",
1547
- value: function copyFolder(requestParameters, initOverrides) {
1548
- try {
1549
- var _this4 = this;
1550
- return FolderApi_await(_this4.copyFolderWithHttpInfo(requestParameters, initOverrides), function (response) {
1551
- return FolderApi_await(response.value());
883
+ headers: headers,
884
+ query: query,
885
+ body: params.copyFolderRequest
886
+ }, undefined, [][0]), function (response) {
887
+ return FolderApi_await(new JSONApiResponse(response).value());
1552
888
  });
1553
889
  } catch (e) {
1554
890
  return Promise.reject(e);
@@ -1558,49 +894,23 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
1558
894
  * Copies multiple folders asynchronously. You can use ListFolder to preview the operation: set `dryRun=true` with ```recursive```, ```includeFiles```, ```includeOverriddenStorage``` and ```includeVirtualFolders``` set to match the values you\'re using here. Leave all other flags unset.
1559
895
  */
1560
896
  }, {
1561
- key: "copyFolderBatchWithHttpInfo",
1562
- value: function copyFolderBatchWithHttpInfo(requestParameters, initOverrides) {
897
+ key: "copyFolderBatch",
898
+ value: function copyFolderBatch(params) {
1563
899
  try {
1564
- var _this6 = this;
1565
- if (requestParameters.accountId === null || requestParameters.accountId === undefined) {
1566
- throw new RequiredError("accountId", "Required parameter requestParameters.accountId was null or undefined when calling copyFolderBatch.");
1567
- }
1568
- if (requestParameters.copyFolderBatchRequest === null || requestParameters.copyFolderBatchRequest === undefined) {
1569
- throw new RequiredError("copyFolderBatchRequest", "Required parameter requestParameters.copyFolderBatchRequest was null or undefined when calling copyFolderBatch.");
1570
- }
1571
- var queryParameters = {};
1572
- var headerParameters = {};
1573
- headerParameters["Content-Type"] = "application/json";
1574
- if (_this6.configuration && _this6.configuration.apiKey) {
1575
- headerParameters["Authorization"] = _this6.configuration.apiKey("Authorization"); // authorization-header authentication
1576
- }
1577
-
1578
- var operationBasePathOverride = [][0];
1579
- return FolderApi_await(_this6.request({
900
+ var _this4 = this;
901
+ var query = {};
902
+ var headers = {};
903
+ headers["Content-Type"] = "application/json";
904
+ return FolderApi_await(_this4.request({
1580
905
  path: "/v2/accounts/{accountId}/folders/copy/batch".replace("{".concat("accountId", "}"),
1581
906
  // @ts-ignore
1582
- false ? 0 : encodeURIComponent(String(requestParameters.accountId))),
907
+ _this4.encodeParam("accountId", params.accountId)),
1583
908
  method: "POST",
1584
- headers: headerParameters,
1585
- query: queryParameters,
1586
- body: requestParameters.copyFolderBatchRequest
1587
- }, initOverrides, operationBasePathOverride), function (response) {
1588
- return new JSONApiResponse(response);
1589
- });
1590
- } catch (e) {
1591
- return Promise.reject(e);
1592
- }
1593
- }
1594
- /**
1595
- * Copies multiple folders asynchronously. You can use ListFolder to preview the operation: set `dryRun=true` with ```recursive```, ```includeFiles```, ```includeOverriddenStorage``` and ```includeVirtualFolders``` set to match the values you\'re using here. Leave all other flags unset.
1596
- */
1597
- }, {
1598
- key: "copyFolderBatch",
1599
- value: function copyFolderBatch(requestParameters, initOverrides) {
1600
- try {
1601
- var _this8 = this;
1602
- return FolderApi_await(_this8.copyFolderBatchWithHttpInfo(requestParameters, initOverrides), function (response) {
1603
- return FolderApi_await(response.value());
909
+ headers: headers,
910
+ query: query,
911
+ body: params.copyFolderBatchRequest
912
+ }, undefined, [][0]), function (response) {
913
+ return FolderApi_await(new JSONApiResponse(response).value());
1604
914
  });
1605
915
  } catch (e) {
1606
916
  return Promise.reject(e);
@@ -1610,49 +920,23 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
1610
920
  * Deletes a folder asynchronously. If the folder has overridden storage settings, then no files will be deleted. You can use ListFolder to preview the operation: set `dryRun=true` with ```recursive```, ```includeFiles``` and ```includeVirtualFolders``` set to match the values you\'re using here. Leave all other flags unset.
1611
921
  */
1612
922
  }, {
1613
- key: "deleteFolderWithHttpInfo",
1614
- value: function deleteFolderWithHttpInfo(requestParameters, initOverrides) {
923
+ key: "deleteFolder",
924
+ value: function deleteFolder(params) {
1615
925
  try {
1616
- var _this10 = this;
1617
- if (requestParameters.accountId === null || requestParameters.accountId === undefined) {
1618
- throw new RequiredError("accountId", "Required parameter requestParameters.accountId was null or undefined when calling deleteFolder.");
1619
- }
1620
- if (requestParameters.deleteFolderRequest === null || requestParameters.deleteFolderRequest === undefined) {
1621
- throw new RequiredError("deleteFolderRequest", "Required parameter requestParameters.deleteFolderRequest was null or undefined when calling deleteFolder.");
1622
- }
1623
- var queryParameters = {};
1624
- var headerParameters = {};
1625
- headerParameters["Content-Type"] = "application/json";
1626
- if (_this10.configuration && _this10.configuration.apiKey) {
1627
- headerParameters["Authorization"] = _this10.configuration.apiKey("Authorization"); // authorization-header authentication
1628
- }
1629
-
1630
- var operationBasePathOverride = [][0];
1631
- return FolderApi_await(_this10.request({
926
+ var _this6 = this;
927
+ var query = {};
928
+ var headers = {};
929
+ headers["Content-Type"] = "application/json";
930
+ return FolderApi_await(_this6.request({
1632
931
  path: "/v2/accounts/{accountId}/folders".replace("{".concat("accountId", "}"),
1633
932
  // @ts-ignore
1634
- false ? 0 : encodeURIComponent(String(requestParameters.accountId))),
933
+ _this6.encodeParam("accountId", params.accountId)),
1635
934
  method: "DELETE",
1636
- headers: headerParameters,
1637
- query: queryParameters,
1638
- body: requestParameters.deleteFolderRequest
1639
- }, initOverrides, operationBasePathOverride), function (response) {
1640
- return new JSONApiResponse(response);
1641
- });
1642
- } catch (e) {
1643
- return Promise.reject(e);
1644
- }
1645
- }
1646
- /**
1647
- * Deletes a folder asynchronously. If the folder has overridden storage settings, then no files will be deleted. You can use ListFolder to preview the operation: set `dryRun=true` with ```recursive```, ```includeFiles``` and ```includeVirtualFolders``` set to match the values you\'re using here. Leave all other flags unset.
1648
- */
1649
- }, {
1650
- key: "deleteFolder",
1651
- value: function deleteFolder(requestParameters, initOverrides) {
1652
- try {
1653
- var _this12 = this;
1654
- return FolderApi_await(_this12.deleteFolderWithHttpInfo(requestParameters, initOverrides), function (response) {
1655
- return FolderApi_await(response.value());
935
+ headers: headers,
936
+ query: query,
937
+ body: params.deleteFolderRequest
938
+ }, undefined, [][0]), function (response) {
939
+ return FolderApi_await(new JSONApiResponse(response).value());
1656
940
  });
1657
941
  } catch (e) {
1658
942
  return Promise.reject(e);
@@ -1662,49 +946,23 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
1662
946
  * Deletes multiple folders asynchronously. If the folder has overridden storage settings, then no files will be deleted. You can use ListFolder to preview the operation: set `dryRun=true` with ```recursive```, ```includeFiles``` and ```includeVirtualFolders``` set to match the values you\'re using here. Leave all other flags unset.
1663
947
  */
1664
948
  }, {
1665
- key: "deleteFolderBatchWithHttpInfo",
1666
- value: function deleteFolderBatchWithHttpInfo(requestParameters, initOverrides) {
949
+ key: "deleteFolderBatch",
950
+ value: function deleteFolderBatch(params) {
1667
951
  try {
1668
- var _this14 = this;
1669
- if (requestParameters.accountId === null || requestParameters.accountId === undefined) {
1670
- throw new RequiredError("accountId", "Required parameter requestParameters.accountId was null or undefined when calling deleteFolderBatch.");
1671
- }
1672
- if (requestParameters.deleteFolderBatchRequest === null || requestParameters.deleteFolderBatchRequest === undefined) {
1673
- throw new RequiredError("deleteFolderBatchRequest", "Required parameter requestParameters.deleteFolderBatchRequest was null or undefined when calling deleteFolderBatch.");
1674
- }
1675
- var queryParameters = {};
1676
- var headerParameters = {};
1677
- headerParameters["Content-Type"] = "application/json";
1678
- if (_this14.configuration && _this14.configuration.apiKey) {
1679
- headerParameters["Authorization"] = _this14.configuration.apiKey("Authorization"); // authorization-header authentication
1680
- }
1681
-
1682
- var operationBasePathOverride = [][0];
1683
- return FolderApi_await(_this14.request({
952
+ var _this8 = this;
953
+ var query = {};
954
+ var headers = {};
955
+ headers["Content-Type"] = "application/json";
956
+ return FolderApi_await(_this8.request({
1684
957
  path: "/v2/accounts/{accountId}/folders/batch".replace("{".concat("accountId", "}"),
1685
958
  // @ts-ignore
1686
- false ? 0 : encodeURIComponent(String(requestParameters.accountId))),
959
+ _this8.encodeParam("accountId", params.accountId)),
1687
960
  method: "DELETE",
1688
- headers: headerParameters,
1689
- query: queryParameters,
1690
- body: requestParameters.deleteFolderBatchRequest
1691
- }, initOverrides, operationBasePathOverride), function (response) {
1692
- return new JSONApiResponse(response);
1693
- });
1694
- } catch (e) {
1695
- return Promise.reject(e);
1696
- }
1697
- }
1698
- /**
1699
- * Deletes multiple folders asynchronously. If the folder has overridden storage settings, then no files will be deleted. You can use ListFolder to preview the operation: set `dryRun=true` with ```recursive```, ```includeFiles``` and ```includeVirtualFolders``` set to match the values you\'re using here. Leave all other flags unset.
1700
- */
1701
- }, {
1702
- key: "deleteFolderBatch",
1703
- value: function deleteFolderBatch(requestParameters, initOverrides) {
1704
- try {
1705
- var _this16 = this;
1706
- return FolderApi_await(_this16.deleteFolderBatchWithHttpInfo(requestParameters, initOverrides), function (response) {
1707
- return FolderApi_await(response.value());
961
+ headers: headers,
962
+ query: query,
963
+ body: params.deleteFolderBatchRequest
964
+ }, undefined, [][0]), function (response) {
965
+ return FolderApi_await(new JSONApiResponse(response).value());
1708
966
  });
1709
967
  } catch (e) {
1710
968
  return Promise.reject(e);
@@ -1714,50 +972,24 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
1714
972
  * Gets the full details (e.g. permission, storage layer, etc.) for a folder. Returns an empty object if no settings have been configured for this folder.
1715
973
  */
1716
974
  }, {
1717
- key: "getFolderDetailsWithHttpInfo",
1718
- value: function getFolderDetailsWithHttpInfo(requestParameters, initOverrides) {
975
+ key: "getFolderDetails",
976
+ value: function getFolderDetails(params) {
1719
977
  try {
1720
- var _this18 = this;
1721
- if (requestParameters.accountId === null || requestParameters.accountId === undefined) {
1722
- throw new RequiredError("accountId", "Required parameter requestParameters.accountId was null or undefined when calling getFolderDetails.");
1723
- }
1724
- if (requestParameters.folderPath === null || requestParameters.folderPath === undefined) {
1725
- throw new RequiredError("folderPath", "Required parameter requestParameters.folderPath was null or undefined when calling getFolderDetails.");
1726
- }
1727
- var queryParameters = {};
1728
- if (requestParameters.folderPath !== undefined) {
1729
- queryParameters["folderPath"] = requestParameters.folderPath;
1730
- }
1731
- var headerParameters = {};
1732
- if (_this18.configuration && _this18.configuration.apiKey) {
1733
- headerParameters["Authorization"] = _this18.configuration.apiKey("Authorization"); // authorization-header authentication
978
+ var _this10 = this;
979
+ var query = {};
980
+ if (params.folderPath !== undefined) {
981
+ query["folderPath"] = params.folderPath;
1734
982
  }
1735
-
1736
- var operationBasePathOverride = [][0];
1737
- return FolderApi_await(_this18.request({
983
+ var headers = {};
984
+ return FolderApi_await(_this10.request({
1738
985
  path: "/v2/accounts/{accountId}/folders".replace("{".concat("accountId", "}"),
1739
986
  // @ts-ignore
1740
- false ? 0 : encodeURIComponent(String(requestParameters.accountId))),
987
+ _this10.encodeParam("accountId", params.accountId)),
1741
988
  method: "GET",
1742
- headers: headerParameters,
1743
- query: queryParameters
1744
- }, initOverrides, operationBasePathOverride), function (response) {
1745
- return new JSONApiResponse(response);
1746
- });
1747
- } catch (e) {
1748
- return Promise.reject(e);
1749
- }
1750
- }
1751
- /**
1752
- * Gets the full details (e.g. permission, storage layer, etc.) for a folder. Returns an empty object if no settings have been configured for this folder.
1753
- */
1754
- }, {
1755
- key: "getFolderDetails",
1756
- value: function getFolderDetails(requestParameters, initOverrides) {
1757
- try {
1758
- var _this20 = this;
1759
- return FolderApi_await(_this20.getFolderDetailsWithHttpInfo(requestParameters, initOverrides), function (response) {
1760
- return FolderApi_await(response.value());
989
+ headers: headers,
990
+ query: query
991
+ }, undefined, [][0]), function (response) {
992
+ return FolderApi_await(new JSONApiResponse(response).value());
1761
993
  });
1762
994
  } catch (e) {
1763
995
  return Promise.reject(e);
@@ -1767,74 +999,48 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
1767
999
  * Lists the folder\'s contents. The result may be paginated: subsequent pages can be requested by passing the ```cursor``` from the response into the ```cursor``` request parameter. Pagination is complete when the response includes `isPaginationComplete=true`.
1768
1000
  */
1769
1001
  }, {
1770
- key: "listFolderWithHttpInfo",
1771
- value: function listFolderWithHttpInfo(requestParameters, initOverrides) {
1002
+ key: "listFolder",
1003
+ value: function listFolder(params) {
1772
1004
  try {
1773
- var _this22 = this;
1774
- if (requestParameters.accountId === null || requestParameters.accountId === undefined) {
1775
- throw new RequiredError("accountId", "Required parameter requestParameters.accountId was null or undefined when calling listFolder.");
1776
- }
1777
- if (requestParameters.folderPath === null || requestParameters.folderPath === undefined) {
1778
- throw new RequiredError("folderPath", "Required parameter requestParameters.folderPath was null or undefined when calling listFolder.");
1779
- }
1780
- var queryParameters = {};
1781
- if (requestParameters.cursor !== undefined) {
1782
- queryParameters["cursor"] = requestParameters.cursor;
1783
- }
1784
- if (requestParameters.dryRun !== undefined) {
1785
- queryParameters["dryRun"] = requestParameters.dryRun;
1005
+ var _this12 = this;
1006
+ var query = {};
1007
+ if (params.cursor !== undefined) {
1008
+ query["cursor"] = params.cursor;
1786
1009
  }
1787
- if (requestParameters.folderPath !== undefined) {
1788
- queryParameters["folderPath"] = requestParameters.folderPath;
1010
+ if (params.dryRun !== undefined) {
1011
+ query["dryRun"] = params.dryRun;
1789
1012
  }
1790
- if (requestParameters.includeFiles !== undefined) {
1791
- queryParameters["includeFiles"] = requestParameters.includeFiles;
1013
+ if (params.folderPath !== undefined) {
1014
+ query["folderPath"] = params.folderPath;
1792
1015
  }
1793
- if (requestParameters.includeOverriddenStorage !== undefined) {
1794
- queryParameters["includeOverriddenStorage"] = requestParameters.includeOverriddenStorage;
1016
+ if (params.includeFiles !== undefined) {
1017
+ query["includeFiles"] = params.includeFiles;
1795
1018
  }
1796
- if (requestParameters.includePhysicalFolders !== undefined) {
1797
- queryParameters["includePhysicalFolders"] = requestParameters.includePhysicalFolders;
1019
+ if (params.includeOverriddenStorage !== undefined) {
1020
+ query["includeOverriddenStorage"] = params.includeOverriddenStorage;
1798
1021
  }
1799
- if (requestParameters.includeVirtualFolders !== undefined) {
1800
- queryParameters["includeVirtualFolders"] = requestParameters.includeVirtualFolders;
1022
+ if (params.includePhysicalFolders !== undefined) {
1023
+ query["includePhysicalFolders"] = params.includePhysicalFolders;
1801
1024
  }
1802
- if (requestParameters.limit !== undefined) {
1803
- queryParameters["limit"] = requestParameters.limit;
1025
+ if (params.includeVirtualFolders !== undefined) {
1026
+ query["includeVirtualFolders"] = params.includeVirtualFolders;
1804
1027
  }
1805
- if (requestParameters.recursive !== undefined) {
1806
- queryParameters["recursive"] = requestParameters.recursive;
1028
+ if (params.limit !== undefined) {
1029
+ query["limit"] = params.limit;
1807
1030
  }
1808
- var headerParameters = {};
1809
- if (_this22.configuration && _this22.configuration.apiKey) {
1810
- headerParameters["Authorization"] = _this22.configuration.apiKey("Authorization"); // authorization-header authentication
1031
+ if (params.recursive !== undefined) {
1032
+ query["recursive"] = params.recursive;
1811
1033
  }
1812
-
1813
- var operationBasePathOverride = [][0];
1814
- return FolderApi_await(_this22.request({
1034
+ var headers = {};
1035
+ return FolderApi_await(_this12.request({
1815
1036
  path: "/v2/accounts/{accountId}/folders/list".replace("{".concat("accountId", "}"),
1816
1037
  // @ts-ignore
1817
- false ? 0 : encodeURIComponent(String(requestParameters.accountId))),
1038
+ _this12.encodeParam("accountId", params.accountId)),
1818
1039
  method: "GET",
1819
- headers: headerParameters,
1820
- query: queryParameters
1821
- }, initOverrides, operationBasePathOverride), function (response) {
1822
- return new JSONApiResponse(response);
1823
- });
1824
- } catch (e) {
1825
- return Promise.reject(e);
1826
- }
1827
- }
1828
- /**
1829
- * Lists the folder\'s contents. The result may be paginated: subsequent pages can be requested by passing the ```cursor``` from the response into the ```cursor``` request parameter. Pagination is complete when the response includes `isPaginationComplete=true`.
1830
- */
1831
- }, {
1832
- key: "listFolder",
1833
- value: function listFolder(requestParameters, initOverrides) {
1834
- try {
1835
- var _this24 = this;
1836
- return FolderApi_await(_this24.listFolderWithHttpInfo(requestParameters, initOverrides), function (response) {
1837
- return FolderApi_await(response.value());
1040
+ headers: headers,
1041
+ query: query
1042
+ }, undefined, [][0]), function (response) {
1043
+ return FolderApi_await(new JSONApiResponse(response).value());
1838
1044
  });
1839
1045
  } catch (e) {
1840
1046
  return Promise.reject(e);
@@ -1844,49 +1050,23 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
1844
1050
  * Creates or updates the folder specified by the `folderPath`. If the folder\'s ancestors do not exist, they will be created automatically (with empty FolderSettings). Note: you don\'t need to create folders before uploading files to them.
1845
1051
  */
1846
1052
  }, {
1847
- key: "putFolderWithHttpInfo",
1848
- value: function putFolderWithHttpInfo(requestParameters, initOverrides) {
1053
+ key: "putFolder",
1054
+ value: function putFolder(params) {
1849
1055
  try {
1850
- var _this26 = this;
1851
- if (requestParameters.accountId === null || requestParameters.accountId === undefined) {
1852
- throw new RequiredError("accountId", "Required parameter requestParameters.accountId was null or undefined when calling putFolder.");
1853
- }
1854
- if (requestParameters.putFolderRequest === null || requestParameters.putFolderRequest === undefined) {
1855
- throw new RequiredError("putFolderRequest", "Required parameter requestParameters.putFolderRequest was null or undefined when calling putFolder.");
1856
- }
1857
- var queryParameters = {};
1858
- var headerParameters = {};
1859
- headerParameters["Content-Type"] = "application/json";
1860
- if (_this26.configuration && _this26.configuration.apiKey) {
1861
- headerParameters["Authorization"] = _this26.configuration.apiKey("Authorization"); // authorization-header authentication
1862
- }
1863
-
1864
- var operationBasePathOverride = [][0];
1865
- return FolderApi_await(_this26.request({
1056
+ var _this14 = this;
1057
+ var query = {};
1058
+ var headers = {};
1059
+ headers["Content-Type"] = "application/json";
1060
+ return FolderApi_await(_this14.request({
1866
1061
  path: "/v2/accounts/{accountId}/folders".replace("{".concat("accountId", "}"),
1867
1062
  // @ts-ignore
1868
- false ? 0 : encodeURIComponent(String(requestParameters.accountId))),
1063
+ _this14.encodeParam("accountId", params.accountId)),
1869
1064
  method: "PUT",
1870
- headers: headerParameters,
1871
- query: queryParameters,
1872
- body: requestParameters.putFolderRequest
1873
- }, initOverrides, operationBasePathOverride), function (response) {
1874
- return new JSONApiResponse(response);
1875
- });
1876
- } catch (e) {
1877
- return Promise.reject(e);
1878
- }
1879
- }
1880
- /**
1881
- * Creates or updates the folder specified by the `folderPath`. If the folder\'s ancestors do not exist, they will be created automatically (with empty FolderSettings). Note: you don\'t need to create folders before uploading files to them.
1882
- */
1883
- }, {
1884
- key: "putFolder",
1885
- value: function putFolder(requestParameters, initOverrides) {
1886
- try {
1887
- var _this28 = this;
1888
- return FolderApi_await(_this28.putFolderWithHttpInfo(requestParameters, initOverrides), function (response) {
1889
- return FolderApi_await(response.value());
1065
+ headers: headers,
1066
+ query: query,
1067
+ body: params.putFolderRequest
1068
+ }, undefined, [][0]), function (response) {
1069
+ return FolderApi_await(new JSONApiResponse(response).value());
1890
1070
  });
1891
1071
  } catch (e) {
1892
1072
  return Promise.reject(e);
@@ -1895,7 +1075,7 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
1895
1075
  }]);
1896
1076
  return FolderApi;
1897
1077
  }(BaseAPI);
1898
- ;// CONCATENATED MODULE: ./src/gen/apis/JobApi.ts
1078
+ ;// CONCATENATED MODULE: ./src/generated/apis/JobApi.ts
1899
1079
  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); }
1900
1080
  function JobApi_await(value, then, direct) {
1901
1081
  if (direct) {
@@ -1906,12 +1086,6 @@ function JobApi_await(value, then, direct) {
1906
1086
  }
1907
1087
  return then ? value.then(then) : value;
1908
1088
  }
1909
- function JobApi_empty() {}
1910
- function JobApi_awaitIgnored(value, direct) {
1911
- if (!direct) {
1912
- return value && value.then ? value.then(JobApi_empty) : Promise.resolve();
1913
- }
1914
- }
1915
1089
  function JobApi_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1916
1090
  function JobApi_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, JobApi_toPropertyKey(descriptor.key), descriptor); } }
1917
1091
  function JobApi_createClass(Constructor, protoProps, staticProps) { if (protoProps) JobApi_defineProperties(Constructor.prototype, protoProps); if (staticProps) JobApi_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
@@ -1927,7 +1101,7 @@ function JobApi_getPrototypeOf(o) { JobApi_getPrototypeOf = Object.setPrototypeO
1927
1101
  /* tslint:disable */
1928
1102
  /* eslint-disable */
1929
1103
  /**
1930
- * @bytescale/bytescale-api
1104
+ * @bytescale/api
1931
1105
  * Bytescale API
1932
1106
  *
1933
1107
  * The version of the OpenAPI document: 2.0.0
@@ -1950,98 +1124,29 @@ var JobApi = /*#__PURE__*/function (_runtime$BaseAPI) {
1950
1124
  return _super.apply(this, arguments);
1951
1125
  }
1952
1126
  JobApi_createClass(JobApi, [{
1953
- key: "cancelJobWithHttpInfo",
1954
- value:
1955
- /**
1956
- * Cancels an in-progress background job. Requires a `secret_*` API key.
1957
- */
1958
- function cancelJobWithHttpInfo(requestParameters, initOverrides) {
1959
- try {
1960
- var _this2 = this;
1961
- if (requestParameters.accountId === null || requestParameters.accountId === undefined) {
1962
- throw new RequiredError("accountId", "Required parameter requestParameters.accountId was null or undefined when calling cancelJob.");
1963
- }
1964
- if (requestParameters.jobId === null || requestParameters.jobId === undefined) {
1965
- throw new RequiredError("jobId", "Required parameter requestParameters.jobId was null or undefined when calling cancelJob.");
1966
- }
1967
- if (requestParameters.jobType === null || requestParameters.jobType === undefined) {
1968
- throw new RequiredError("jobType", "Required parameter requestParameters.jobType was null or undefined when calling cancelJob.");
1969
- }
1970
- var queryParameters = {};
1971
- var headerParameters = {};
1972
- if (_this2.configuration && _this2.configuration.apiKey) {
1973
- headerParameters["Authorization"] = _this2.configuration.apiKey("Authorization"); // authorization-header authentication
1974
- }
1975
-
1976
- var operationBasePathOverride = [][0];
1977
- return JobApi_await(_this2.request({
1978
- path: "/v2/accounts/{accountId}/jobs/{jobType}/{jobId}".replace("{".concat("accountId", "}"),
1979
- // @ts-ignore
1980
- false ? 0 : encodeURIComponent(String(requestParameters.accountId))).replace("{".concat("jobId", "}"),
1981
- // @ts-ignore
1982
- false ? 0 : encodeURIComponent(String(requestParameters.jobId))).replace("{".concat("jobType", "}"),
1983
- // @ts-ignore
1984
- false ? 0 : encodeURIComponent(String(requestParameters.jobType))),
1985
- method: "DELETE",
1986
- headers: headerParameters,
1987
- query: queryParameters
1988
- }, initOverrides, operationBasePathOverride), function (response) {
1989
- return new VoidApiResponse(response);
1990
- });
1991
- } catch (e) {
1992
- return Promise.reject(e);
1993
- }
1994
- }
1995
- /**
1996
- * Cancels an in-progress background job. Requires a `secret_*` API key.
1997
- */
1998
- }, {
1999
1127
  key: "cancelJob",
2000
- value: function cancelJob(requestParameters, initOverrides) {
2001
- try {
2002
- var _this4 = this;
2003
- return JobApi_awaitIgnored(_this4.cancelJobWithHttpInfo(requestParameters, initOverrides));
2004
- } catch (e) {
2005
- return Promise.reject(e);
2006
- }
2007
- }
1128
+ value:
2008
1129
  /**
2009
- * Gets information on a background job. Requires a `secret_*` API key.
2010
- */
2011
- }, {
2012
- key: "getJobWithHttpInfo",
2013
- value: function getJobWithHttpInfo(requestParameters, initOverrides) {
2014
- try {
2015
- var _this6 = this;
2016
- if (requestParameters.accountId === null || requestParameters.accountId === undefined) {
2017
- throw new RequiredError("accountId", "Required parameter requestParameters.accountId was null or undefined when calling getJob.");
2018
- }
2019
- if (requestParameters.jobId === null || requestParameters.jobId === undefined) {
2020
- throw new RequiredError("jobId", "Required parameter requestParameters.jobId was null or undefined when calling getJob.");
2021
- }
2022
- if (requestParameters.jobType === null || requestParameters.jobType === undefined) {
2023
- throw new RequiredError("jobType", "Required parameter requestParameters.jobType was null or undefined when calling getJob.");
2024
- }
2025
- var queryParameters = {};
2026
- var headerParameters = {};
2027
- if (_this6.configuration && _this6.configuration.apiKey) {
2028
- headerParameters["Authorization"] = _this6.configuration.apiKey("Authorization"); // authorization-header authentication
2029
- }
2030
-
2031
- var operationBasePathOverride = [][0];
2032
- return JobApi_await(_this6.request({
1130
+ * Cancels an in-progress background job. Requires a `secret_*` API key.
1131
+ */
1132
+ function cancelJob(params) {
1133
+ try {
1134
+ var _this2 = this;
1135
+ var query = {};
1136
+ var headers = {};
1137
+ return JobApi_await(_this2.request({
2033
1138
  path: "/v2/accounts/{accountId}/jobs/{jobType}/{jobId}".replace("{".concat("accountId", "}"),
2034
1139
  // @ts-ignore
2035
- false ? 0 : encodeURIComponent(String(requestParameters.accountId))).replace("{".concat("jobId", "}"),
1140
+ _this2.encodeParam("accountId", params.accountId)).replace("{".concat("jobId", "}"),
2036
1141
  // @ts-ignore
2037
- false ? 0 : encodeURIComponent(String(requestParameters.jobId))).replace("{".concat("jobType", "}"),
1142
+ _this2.encodeParam("jobId", params.jobId)).replace("{".concat("jobType", "}"),
2038
1143
  // @ts-ignore
2039
- false ? 0 : encodeURIComponent(String(requestParameters.jobType))),
2040
- method: "GET",
2041
- headers: headerParameters,
2042
- query: queryParameters
2043
- }, initOverrides, operationBasePathOverride), function (response) {
2044
- return new JSONApiResponse(response);
1144
+ _this2.encodeParam("jobType", params.jobType)),
1145
+ method: "DELETE",
1146
+ headers: headers,
1147
+ query: query
1148
+ }, undefined, [][0]), function (response) {
1149
+ return JobApi_await(new VoidApiResponse(response).value());
2045
1150
  });
2046
1151
  } catch (e) {
2047
1152
  return Promise.reject(e);
@@ -2052,11 +1157,24 @@ var JobApi = /*#__PURE__*/function (_runtime$BaseAPI) {
2052
1157
  */
2053
1158
  }, {
2054
1159
  key: "getJob",
2055
- value: function getJob(requestParameters, initOverrides) {
1160
+ value: function getJob(params) {
2056
1161
  try {
2057
- var _this8 = this;
2058
- return JobApi_await(_this8.getJobWithHttpInfo(requestParameters, initOverrides), function (response) {
2059
- return JobApi_await(response.value());
1162
+ var _this4 = this;
1163
+ var query = {};
1164
+ var headers = {};
1165
+ return JobApi_await(_this4.request({
1166
+ path: "/v2/accounts/{accountId}/jobs/{jobType}/{jobId}".replace("{".concat("accountId", "}"),
1167
+ // @ts-ignore
1168
+ _this4.encodeParam("accountId", params.accountId)).replace("{".concat("jobId", "}"),
1169
+ // @ts-ignore
1170
+ _this4.encodeParam("jobId", params.jobId)).replace("{".concat("jobType", "}"),
1171
+ // @ts-ignore
1172
+ _this4.encodeParam("jobType", params.jobType)),
1173
+ method: "GET",
1174
+ headers: headers,
1175
+ query: query
1176
+ }, undefined, [][0]), function (response) {
1177
+ return JobApi_await(new JSONApiResponse(response).value());
2060
1178
  });
2061
1179
  } catch (e) {
2062
1180
  return Promise.reject(e);
@@ -2066,50 +1184,24 @@ var JobApi = /*#__PURE__*/function (_runtime$BaseAPI) {
2066
1184
  * Lists the most recently issued background jobs. Requires a `secret_*` API key.
2067
1185
  */
2068
1186
  }, {
2069
- key: "listRecentJobsWithHttpInfo",
2070
- value: function listRecentJobsWithHttpInfo(requestParameters, initOverrides) {
1187
+ key: "listRecentJobs",
1188
+ value: function listRecentJobs(params) {
2071
1189
  try {
2072
- var _this10 = this;
2073
- if (requestParameters.accountId === null || requestParameters.accountId === undefined) {
2074
- throw new RequiredError("accountId", "Required parameter requestParameters.accountId was null or undefined when calling listRecentJobs.");
2075
- }
2076
- if (requestParameters.jobType === null || requestParameters.jobType === undefined) {
2077
- throw new RequiredError("jobType", "Required parameter requestParameters.jobType was null or undefined when calling listRecentJobs.");
2078
- }
2079
- var queryParameters = {};
2080
- if (requestParameters.jobType) {
2081
- queryParameters["jobType"] = requestParameters.jobType;
2082
- }
2083
- var headerParameters = {};
2084
- if (_this10.configuration && _this10.configuration.apiKey) {
2085
- headerParameters["Authorization"] = _this10.configuration.apiKey("Authorization"); // authorization-header authentication
1190
+ var _this6 = this;
1191
+ var query = {};
1192
+ if (params.jobType) {
1193
+ query["jobType"] = params.jobType;
2086
1194
  }
2087
-
2088
- var operationBasePathOverride = [][0];
2089
- return JobApi_await(_this10.request({
1195
+ var headers = {};
1196
+ return JobApi_await(_this6.request({
2090
1197
  path: "/v2/accounts/{accountId}/jobs".replace("{".concat("accountId", "}"),
2091
1198
  // @ts-ignore
2092
- false ? 0 : encodeURIComponent(String(requestParameters.accountId))),
1199
+ _this6.encodeParam("accountId", params.accountId)),
2093
1200
  method: "GET",
2094
- headers: headerParameters,
2095
- query: queryParameters
2096
- }, initOverrides, operationBasePathOverride), function (response) {
2097
- return new JSONApiResponse(response);
2098
- });
2099
- } catch (e) {
2100
- return Promise.reject(e);
2101
- }
2102
- }
2103
- /**
2104
- * Lists the most recently issued background jobs. Requires a `secret_*` API key.
2105
- */
2106
- }, {
2107
- key: "listRecentJobs",
2108
- value: function listRecentJobs(requestParameters, initOverrides) {
2109
- try {
2110
- var _this12 = this;
2111
- return JobApi_await(_this12.listRecentJobsWithHttpInfo(requestParameters, initOverrides), function (response) {
2112
- return JobApi_await(response.value());
1201
+ headers: headers,
1202
+ query: query
1203
+ }, undefined, [][0]), function (response) {
1204
+ return JobApi_await(new JSONApiResponse(response).value());
2113
1205
  });
2114
1206
  } catch (e) {
2115
1207
  return Promise.reject(e);
@@ -2118,7 +1210,7 @@ var JobApi = /*#__PURE__*/function (_runtime$BaseAPI) {
2118
1210
  }]);
2119
1211
  return JobApi;
2120
1212
  }(BaseAPI);
2121
- ;// CONCATENATED MODULE: ./src/gen/apis/UploadApi.ts
1213
+ ;// CONCATENATED MODULE: ./src/generated/apis/UploadApi.ts
2122
1214
  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); }
2123
1215
  function UploadApi_await(value, then, direct) {
2124
1216
  if (direct) {
@@ -2129,12 +1221,6 @@ function UploadApi_await(value, then, direct) {
2129
1221
  }
2130
1222
  return then ? value.then(then) : value;
2131
1223
  }
2132
- function UploadApi_empty() {}
2133
- function UploadApi_awaitIgnored(value, direct) {
2134
- if (!direct) {
2135
- return value && value.then ? value.then(UploadApi_empty) : Promise.resolve();
2136
- }
2137
- }
2138
1224
  function UploadApi_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2139
1225
  function UploadApi_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, UploadApi_toPropertyKey(descriptor.key), descriptor); } }
2140
1226
  function UploadApi_createClass(Constructor, protoProps, staticProps) { if (protoProps) UploadApi_defineProperties(Constructor.prototype, protoProps); if (staticProps) UploadApi_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
@@ -2150,7 +1236,7 @@ function UploadApi_getPrototypeOf(o) { UploadApi_getPrototypeOf = Object.setProt
2150
1236
  /* tslint:disable */
2151
1237
  /* eslint-disable */
2152
1238
  /**
2153
- * @bytescale/bytescale-api
1239
+ * @bytescale/api
2154
1240
  * Bytescale API
2155
1241
  *
2156
1242
  * The version of the OpenAPI document: 2.0.0
@@ -2173,53 +1259,27 @@ var UploadApi = /*#__PURE__*/function (_runtime$BaseAPI) {
2173
1259
  return _super.apply(this, arguments);
2174
1260
  }
2175
1261
  UploadApi_createClass(UploadApi, [{
2176
- key: "beginMultipartUploadWithHttpInfo",
1262
+ key: "beginMultipartUpload",
2177
1263
  value:
2178
1264
  /**
2179
1265
  * Begins a new multipart file upload process.
2180
1266
  */
2181
- function beginMultipartUploadWithHttpInfo(requestParameters, initOverrides) {
1267
+ function beginMultipartUpload(params) {
2182
1268
  try {
2183
1269
  var _this2 = this;
2184
- if (requestParameters.accountId === null || requestParameters.accountId === undefined) {
2185
- throw new RequiredError("accountId", "Required parameter requestParameters.accountId was null or undefined when calling beginMultipartUpload.");
2186
- }
2187
- if (requestParameters.beginMultipartUploadRequest === null || requestParameters.beginMultipartUploadRequest === undefined) {
2188
- throw new RequiredError("beginMultipartUploadRequest", "Required parameter requestParameters.beginMultipartUploadRequest was null or undefined when calling beginMultipartUpload.");
2189
- }
2190
- var queryParameters = {};
2191
- var headerParameters = {};
2192
- headerParameters["Content-Type"] = "application/json";
2193
- if (_this2.configuration && _this2.configuration.apiKey) {
2194
- headerParameters["Authorization"] = _this2.configuration.apiKey("Authorization"); // authorization-header authentication
2195
- }
2196
-
2197
- var operationBasePathOverride = [][0];
1270
+ var query = {};
1271
+ var headers = {};
1272
+ headers["Content-Type"] = "application/json";
2198
1273
  return UploadApi_await(_this2.request({
2199
1274
  path: "/v2/accounts/{accountId}/uploads".replace("{".concat("accountId", "}"),
2200
1275
  // @ts-ignore
2201
- false ? 0 : encodeURIComponent(String(requestParameters.accountId))),
1276
+ _this2.encodeParam("accountId", params.accountId)),
2202
1277
  method: "POST",
2203
- headers: headerParameters,
2204
- query: queryParameters,
2205
- body: requestParameters.beginMultipartUploadRequest
2206
- }, initOverrides, operationBasePathOverride), function (response) {
2207
- return new JSONApiResponse(response);
2208
- });
2209
- } catch (e) {
2210
- return Promise.reject(e);
2211
- }
2212
- }
2213
- /**
2214
- * Begins a new multipart file upload process.
2215
- */
2216
- }, {
2217
- key: "beginMultipartUpload",
2218
- value: function beginMultipartUpload(requestParameters, initOverrides) {
2219
- try {
2220
- var _this4 = this;
2221
- return UploadApi_await(_this4.beginMultipartUploadWithHttpInfo(requestParameters, initOverrides), function (response) {
2222
- return UploadApi_await(response.value());
1278
+ headers: headers,
1279
+ query: query,
1280
+ body: params.beginMultipartUploadRequest
1281
+ }, undefined, [][0]), function (response) {
1282
+ return UploadApi_await(new JSONApiResponse(response).value());
2223
1283
  });
2224
1284
  } catch (e) {
2225
1285
  return Promise.reject(e);
@@ -2229,114 +1289,55 @@ var UploadApi = /*#__PURE__*/function (_runtime$BaseAPI) {
2229
1289
  * Marks an upload part as uploaded. You must call this endpoint after you have successfully issued a `PUT` request to the `uploadUrl` on the corresponding UploadPart.
2230
1290
  */
2231
1291
  }, {
2232
- key: "completeUploadPartWithHttpInfo",
2233
- value: function completeUploadPartWithHttpInfo(requestParameters, initOverrides) {
1292
+ key: "completeUploadPart",
1293
+ value: function completeUploadPart(params) {
2234
1294
  try {
2235
- var _this6 = this;
2236
- if (requestParameters.accountId === null || requestParameters.accountId === undefined) {
2237
- throw new RequiredError("accountId", "Required parameter requestParameters.accountId was null or undefined when calling completeUploadPart.");
2238
- }
2239
- if (requestParameters.uploadId === null || requestParameters.uploadId === undefined) {
2240
- throw new RequiredError("uploadId", "Required parameter requestParameters.uploadId was null or undefined when calling completeUploadPart.");
2241
- }
2242
- if (requestParameters.uploadPartIndex === null || requestParameters.uploadPartIndex === undefined) {
2243
- throw new RequiredError("uploadPartIndex", "Required parameter requestParameters.uploadPartIndex was null or undefined when calling completeUploadPart.");
2244
- }
2245
- if (requestParameters.completeUploadPartRequest === null || requestParameters.completeUploadPartRequest === undefined) {
2246
- throw new RequiredError("completeUploadPartRequest", "Required parameter requestParameters.completeUploadPartRequest was null or undefined when calling completeUploadPart.");
2247
- }
2248
- var queryParameters = {};
2249
- var headerParameters = {};
2250
- headerParameters["Content-Type"] = "application/json";
2251
- if (_this6.configuration && _this6.configuration.apiKey) {
2252
- headerParameters["Authorization"] = _this6.configuration.apiKey("Authorization"); // authorization-header authentication
2253
- }
2254
-
2255
- var operationBasePathOverride = [][0];
2256
- return UploadApi_await(_this6.request({
1295
+ var _this4 = this;
1296
+ var query = {};
1297
+ var headers = {};
1298
+ headers["Content-Type"] = "application/json";
1299
+ return UploadApi_await(_this4.request({
2257
1300
  path: "/v2/accounts/{accountId}/uploads/{uploadId}/parts/{uploadPartIndex}".replace("{".concat("accountId", "}"),
2258
1301
  // @ts-ignore
2259
- false ? 0 : encodeURIComponent(String(requestParameters.accountId))).replace("{".concat("uploadId", "}"),
1302
+ _this4.encodeParam("accountId", params.accountId)).replace("{".concat("uploadId", "}"),
2260
1303
  // @ts-ignore
2261
- false ? 0 : encodeURIComponent(String(requestParameters.uploadId))).replace("{".concat("uploadPartIndex", "}"),
1304
+ _this4.encodeParam("uploadId", params.uploadId)).replace("{".concat("uploadPartIndex", "}"),
2262
1305
  // @ts-ignore
2263
- false ? 0 : encodeURIComponent(String(requestParameters.uploadPartIndex))),
1306
+ _this4.encodeParam("uploadPartIndex", params.uploadPartIndex)),
2264
1307
  method: "PUT",
2265
- headers: headerParameters,
2266
- query: queryParameters,
2267
- body: requestParameters.completeUploadPartRequest
2268
- }, initOverrides, operationBasePathOverride), function (response) {
2269
- return new VoidApiResponse(response);
1308
+ headers: headers,
1309
+ query: query,
1310
+ body: params.completeUploadPartRequest
1311
+ }, undefined, [][0]), function (response) {
1312
+ return UploadApi_await(new VoidApiResponse(response).value());
2270
1313
  });
2271
1314
  } catch (e) {
2272
1315
  return Promise.reject(e);
2273
1316
  }
2274
1317
  }
2275
- /**
2276
- * Marks an upload part as uploaded. You must call this endpoint after you have successfully issued a `PUT` request to the `uploadUrl` on the corresponding UploadPart.
2277
- */
2278
- }, {
2279
- key: "completeUploadPart",
2280
- value: function completeUploadPart(requestParameters, initOverrides) {
2281
- try {
2282
- var _this8 = this;
2283
- return UploadApi_awaitIgnored(_this8.completeUploadPartWithHttpInfo(requestParameters, initOverrides));
2284
- } catch (e) {
2285
- return Promise.reject(e);
2286
- }
2287
- }
2288
1318
  /**
2289
1319
  * Gets a remaining upload part for a multipart file upload.
2290
1320
  */
2291
1321
  }, {
2292
- key: "getUploadPartWithHttpInfo",
2293
- value: function getUploadPartWithHttpInfo(requestParameters, initOverrides) {
1322
+ key: "getUploadPart",
1323
+ value: function getUploadPart(params) {
2294
1324
  try {
2295
- var _this10 = this;
2296
- if (requestParameters.accountId === null || requestParameters.accountId === undefined) {
2297
- throw new RequiredError("accountId", "Required parameter requestParameters.accountId was null or undefined when calling getUploadPart.");
2298
- }
2299
- if (requestParameters.uploadId === null || requestParameters.uploadId === undefined) {
2300
- throw new RequiredError("uploadId", "Required parameter requestParameters.uploadId was null or undefined when calling getUploadPart.");
2301
- }
2302
- if (requestParameters.uploadPartIndex === null || requestParameters.uploadPartIndex === undefined) {
2303
- throw new RequiredError("uploadPartIndex", "Required parameter requestParameters.uploadPartIndex was null or undefined when calling getUploadPart.");
2304
- }
2305
- var queryParameters = {};
2306
- var headerParameters = {};
2307
- if (_this10.configuration && _this10.configuration.apiKey) {
2308
- headerParameters["Authorization"] = _this10.configuration.apiKey("Authorization"); // authorization-header authentication
2309
- }
2310
-
2311
- var operationBasePathOverride = [][0];
2312
- return UploadApi_await(_this10.request({
1325
+ var _this6 = this;
1326
+ var query = {};
1327
+ var headers = {};
1328
+ return UploadApi_await(_this6.request({
2313
1329
  path: "/v2/accounts/{accountId}/uploads/{uploadId}/parts/{uploadPartIndex}".replace("{".concat("accountId", "}"),
2314
1330
  // @ts-ignore
2315
- false ? 0 : encodeURIComponent(String(requestParameters.accountId))).replace("{".concat("uploadId", "}"),
1331
+ _this6.encodeParam("accountId", params.accountId)).replace("{".concat("uploadId", "}"),
2316
1332
  // @ts-ignore
2317
- false ? 0 : encodeURIComponent(String(requestParameters.uploadId))).replace("{".concat("uploadPartIndex", "}"),
1333
+ _this6.encodeParam("uploadId", params.uploadId)).replace("{".concat("uploadPartIndex", "}"),
2318
1334
  // @ts-ignore
2319
- false ? 0 : encodeURIComponent(String(requestParameters.uploadPartIndex))),
1335
+ _this6.encodeParam("uploadPartIndex", params.uploadPartIndex)),
2320
1336
  method: "GET",
2321
- headers: headerParameters,
2322
- query: queryParameters
2323
- }, initOverrides, operationBasePathOverride), function (response) {
2324
- return new JSONApiResponse(response);
2325
- });
2326
- } catch (e) {
2327
- return Promise.reject(e);
2328
- }
2329
- }
2330
- /**
2331
- * Gets a remaining upload part for a multipart file upload.
2332
- */
2333
- }, {
2334
- key: "getUploadPart",
2335
- value: function getUploadPart(requestParameters, initOverrides) {
2336
- try {
2337
- var _this12 = this;
2338
- return UploadApi_await(_this12.getUploadPartWithHttpInfo(requestParameters, initOverrides), function (response) {
2339
- return UploadApi_await(response.value());
1337
+ headers: headers,
1338
+ query: query
1339
+ }, undefined, [][0]), function (response) {
1340
+ return UploadApi_await(new JSONApiResponse(response).value());
2340
1341
  });
2341
1342
  } catch (e) {
2342
1343
  return Promise.reject(e);
@@ -2346,49 +1347,23 @@ var UploadApi = /*#__PURE__*/function (_runtime$BaseAPI) {
2346
1347
  * Lists the remaining upload parts for a multipart file upload. An empty array is returned when the upload is complete.
2347
1348
  */
2348
1349
  }, {
2349
- key: "listUploadPartsWithHttpInfo",
2350
- value: function listUploadPartsWithHttpInfo(requestParameters, initOverrides) {
1350
+ key: "listUploadParts",
1351
+ value: function listUploadParts(params) {
2351
1352
  try {
2352
- var _this14 = this;
2353
- if (requestParameters.accountId === null || requestParameters.accountId === undefined) {
2354
- throw new RequiredError("accountId", "Required parameter requestParameters.accountId was null or undefined when calling listUploadParts.");
2355
- }
2356
- if (requestParameters.uploadId === null || requestParameters.uploadId === undefined) {
2357
- throw new RequiredError("uploadId", "Required parameter requestParameters.uploadId was null or undefined when calling listUploadParts.");
2358
- }
2359
- var queryParameters = {};
2360
- var headerParameters = {};
2361
- if (_this14.configuration && _this14.configuration.apiKey) {
2362
- headerParameters["Authorization"] = _this14.configuration.apiKey("Authorization"); // authorization-header authentication
2363
- }
2364
-
2365
- var operationBasePathOverride = [][0];
2366
- return UploadApi_await(_this14.request({
1353
+ var _this8 = this;
1354
+ var query = {};
1355
+ var headers = {};
1356
+ return UploadApi_await(_this8.request({
2367
1357
  path: "/v2/accounts/{accountId}/uploads/{uploadId}/parts".replace("{".concat("accountId", "}"),
2368
1358
  // @ts-ignore
2369
- false ? 0 : encodeURIComponent(String(requestParameters.accountId))).replace("{".concat("uploadId", "}"),
1359
+ _this8.encodeParam("accountId", params.accountId)).replace("{".concat("uploadId", "}"),
2370
1360
  // @ts-ignore
2371
- false ? 0 : encodeURIComponent(String(requestParameters.uploadId))),
1361
+ _this8.encodeParam("uploadId", params.uploadId)),
2372
1362
  method: "GET",
2373
- headers: headerParameters,
2374
- query: queryParameters
2375
- }, initOverrides, operationBasePathOverride), function (response) {
2376
- return new JSONApiResponse(response);
2377
- });
2378
- } catch (e) {
2379
- return Promise.reject(e);
2380
- }
2381
- }
2382
- /**
2383
- * Lists the remaining upload parts for a multipart file upload. An empty array is returned when the upload is complete.
2384
- */
2385
- }, {
2386
- key: "listUploadParts",
2387
- value: function listUploadParts(requestParameters, initOverrides) {
2388
- try {
2389
- var _this16 = this;
2390
- return UploadApi_await(_this16.listUploadPartsWithHttpInfo(requestParameters, initOverrides), function (response) {
2391
- return UploadApi_await(response.value());
1363
+ headers: headers,
1364
+ query: query
1365
+ }, undefined, [][0]), function (response) {
1366
+ return UploadApi_await(new JSONApiResponse(response).value());
2392
1367
  });
2393
1368
  } catch (e) {
2394
1369
  return Promise.reject(e);
@@ -2398,49 +1373,23 @@ var UploadApi = /*#__PURE__*/function (_runtime$BaseAPI) {
2398
1373
  * Upload from a URL with a single HTTP request:
2399
1374
  */
2400
1375
  }, {
2401
- key: "uploadFromUrlWithHttpInfo",
2402
- value: function uploadFromUrlWithHttpInfo(requestParameters, initOverrides) {
1376
+ key: "uploadFromUrl",
1377
+ value: function uploadFromUrl(params) {
2403
1378
  try {
2404
- var _this18 = this;
2405
- if (requestParameters.accountId === null || requestParameters.accountId === undefined) {
2406
- throw new RequiredError("accountId", "Required parameter requestParameters.accountId was null or undefined when calling uploadFromUrl.");
2407
- }
2408
- if (requestParameters.uploadFromUrlRequest === null || requestParameters.uploadFromUrlRequest === undefined) {
2409
- throw new RequiredError("uploadFromUrlRequest", "Required parameter requestParameters.uploadFromUrlRequest was null or undefined when calling uploadFromUrl.");
2410
- }
2411
- var queryParameters = {};
2412
- var headerParameters = {};
2413
- headerParameters["Content-Type"] = "application/json";
2414
- if (_this18.configuration && _this18.configuration.apiKey) {
2415
- headerParameters["Authorization"] = _this18.configuration.apiKey("Authorization"); // authorization-header authentication
2416
- }
2417
-
2418
- var operationBasePathOverride = [][0];
2419
- return UploadApi_await(_this18.request({
1379
+ var _this10 = this;
1380
+ var query = {};
1381
+ var headers = {};
1382
+ headers["Content-Type"] = "application/json";
1383
+ return UploadApi_await(_this10.request({
2420
1384
  path: "/v2/accounts/{accountId}/uploads/url".replace("{".concat("accountId", "}"),
2421
1385
  // @ts-ignore
2422
- false ? 0 : encodeURIComponent(String(requestParameters.accountId))),
1386
+ _this10.encodeParam("accountId", params.accountId)),
2423
1387
  method: "POST",
2424
- headers: headerParameters,
2425
- query: queryParameters,
2426
- body: requestParameters.uploadFromUrlRequest
2427
- }, initOverrides, operationBasePathOverride), function (response) {
2428
- return new JSONApiResponse(response);
2429
- });
2430
- } catch (e) {
2431
- return Promise.reject(e);
2432
- }
2433
- }
2434
- /**
2435
- * Upload from a URL with a single HTTP request:
2436
- */
2437
- }, {
2438
- key: "uploadFromUrl",
2439
- value: function uploadFromUrl(requestParameters, initOverrides) {
2440
- try {
2441
- var _this20 = this;
2442
- return UploadApi_await(_this20.uploadFromUrlWithHttpInfo(requestParameters, initOverrides), function (response) {
2443
- return UploadApi_await(response.value());
1388
+ headers: headers,
1389
+ query: query,
1390
+ body: params.uploadFromUrlRequest
1391
+ }, undefined, [][0]), function (response) {
1392
+ return UploadApi_await(new JSONApiResponse(response).value());
2444
1393
  });
2445
1394
  } catch (e) {
2446
1395
  return Promise.reject(e);
@@ -2449,332 +1398,20 @@ var UploadApi = /*#__PURE__*/function (_runtime$BaseAPI) {
2449
1398
  }]);
2450
1399
  return UploadApi;
2451
1400
  }(BaseAPI);
2452
- ;// CONCATENATED MODULE: ./src/gen/apis/index.ts
1401
+ ;// CONCATENATED MODULE: ./src/generated/apis/index.ts
2453
1402
  /* tslint:disable */
2454
1403
  /* eslint-disable */
2455
1404
 
2456
1405
 
2457
1406
 
2458
1407
 
2459
- ;// CONCATENATED MODULE: ./src/gen/models/index.ts
2460
- /* tslint:disable */
2461
- /* eslint-disable */
2462
- /**
2463
- * "Created" is only used when issuing jobs non-transactionally (which we do if we want the job to be picked up sooner).
2464
- * In this case, a two-phase transaction is performed.
2465
- *
2466
- * T=0) "Created" job tracker created.
2467
- * T=1) SQS job enqueued.
2468
- * T=2) "Pending" is set into job tracker.
2469
- * T=3) Response returned to use
2470
- * T=4) SQS picks up job. If status is "Created" it fails the job attempt. This keeps going until eventually the job perm-fails, or it sees "Pending". It should typically (always?) see "Pending" on the first attempt, if T=2 succeeded.
2471
- * T=5) SQS processes the job as normal.
2472
- *
2473
- * As such, the "Created" state is an internal detail, and we never expose jobs in this state to the user.
2474
- * @export
2475
- */
2476
- var AccountJobStatus = {
2477
- Created: "Created",
2478
- Pending: "Pending",
2479
- Running: "Running",
2480
- Rollback: "Rollback",
2481
- Failed: "Failed",
2482
- Succeeded: "Succeeded",
2483
- Cancelling: "Cancelling",
2484
- Cancelled: "Cancelled"
2485
- };
2486
- /**
2487
- * Job type.
2488
- * @export
2489
- */
2490
- var AccountJobType = {
2491
- ProcessFileJob: "ProcessFileJob",
2492
- DeleteFolderBatchJob: "DeleteFolderBatchJob",
2493
- DeleteFileBatchJob: "DeleteFileBatchJob",
2494
- CopyFolderBatchJob: "CopyFolderBatchJob",
2495
- CopyFileBatchJob: "CopyFileBatchJob"
2496
- };
2497
- /**
2498
- * @export
2499
- */
2500
- var AsyncResponseJobDocsEnum = {
2501
- HttpsWwwBytescaleComDocsJobApiGetJob: "https://www.bytescale.com/docs/job-api/GetJob"
2502
- };
2503
- /**
2504
- * AWS Region.
2505
- * @export
2506
- */
2507
- var AwsRegion = {
2508
- UsEast2: "us-east-2",
2509
- UsEast1: "us-east-1",
2510
- UsWest1: "us-west-1",
2511
- UsWest2: "us-west-2",
2512
- AfSouth1: "af-south-1",
2513
- ApEast1: "ap-east-1",
2514
- ApSoutheast3: "ap-southeast-3",
2515
- ApSouth1: "ap-south-1",
2516
- ApNortheast3: "ap-northeast-3",
2517
- ApNortheast2: "ap-northeast-2",
2518
- ApSoutheast1: "ap-southeast-1",
2519
- ApSoutheast2: "ap-southeast-2",
2520
- ApNortheast1: "ap-northeast-1",
2521
- CaCentral1: "ca-central-1",
2522
- EuCentral1: "eu-central-1",
2523
- EuWest1: "eu-west-1",
2524
- EuWest2: "eu-west-2",
2525
- EuSouth1: "eu-south-1",
2526
- EuWest3: "eu-west-3",
2527
- EuNorth1: "eu-north-1",
2528
- MeSouth1: "me-south-1",
2529
- SaEast1: "sa-east-1"
2530
- };
2531
- /**
2532
- * @export
2533
- */
2534
- var DigitalOceanStorageTypeEnum = {
2535
- DigitalOceanSpace: "DigitalOceanSpace"
2536
- };
2537
- /**
2538
- * The result of the CopyFile operation.
2539
- * @export
2540
- */
2541
- var FileCopyStatus = {
2542
- Copied: "Copied",
2543
- FileNotFound: "FileNotFound",
2544
- SkippedDueToCondition: "SkippedDueToCondition"
2545
- };
2546
- /**
2547
- * @export
2548
- */
2549
- var FileSummaryTypeEnum = {
2550
- File: "File"
2551
- };
2552
- /**
2553
- * @export
2554
- */
2555
- var FolderDetailsTypeEnum = {
2556
- Folder: "Folder"
2557
- };
2558
- /**
2559
- * @export
2560
- */
2561
- var FolderSettingsStorageLayerSummaryStorageLayerTypeEnum = {
2562
- GoogleStorage: "GoogleStorage"
2563
- };
2564
- /**
2565
- * @export
2566
- */
2567
- var FolderSummaryTypeEnum = {
2568
- Folder: "Folder"
2569
- };
2570
- /**
2571
- * @export
2572
- */
2573
- var GoogleStorageTypeEnum = {
2574
- GoogleStorage: "GoogleStorage"
2575
- };
2576
- /**
2577
- * @export
2578
- */
2579
- var InternalStorageV1TypeEnum = {
2580
- InternalStorageV1: "InternalStorageV1"
2581
- };
2582
- /**
2583
- * @export
2584
- */
2585
- var InternalStorageV2TypeEnum = {
2586
- InternalStorageV2: "InternalStorageV2"
2587
- };
2588
- /**
2589
- * @export
2590
- */
2591
- var JobSummaryJobDocsEnum = {
2592
- HttpsWwwBytescaleComDocsJobApiGetJob: "https://www.bytescale.com/docs/job-api/GetJob"
2593
- };
2594
- /**
2595
- * Multipart file upload protocol version.
2596
- *
2597
- * - `1.0`: this protocol version automatically downgrades to single part uploads when files are below a certain size. When this protocol is used for small files, the file exists immediately after the `PUT` request to the `uploadUrl` completes. This protocol requires more client-side code to implement, and has a known issue whereby file TTLs are ignored if the client code fails to call CompleteUploadPart.
2598
- *
2599
- * - `1.1`: this protocol version uses multipart uploads for all files. When this protocol is used, files only exist after the last CompleteUploadPart request is made. This protocol simplifies client code, and fixes a known issue in the `2.0` protocol for file TTLs (described above).
2600
- * @export
2601
- */
2602
- var MultipartUploadProtocol = {
2603
- _0: "1.0",
2604
- _1: "1.1"
2605
- };
2606
- /**
2607
- * @export
2608
- */
2609
- var ObjectSummaryTypeEnum = {
2610
- File: "File"
2611
- };
2612
- /**
2613
- * Specifies the level in the file tree, relative to the path, that these permissions apply.
2614
- *
2615
- * - `"This"`: Permissions apply to the current path only.
2616
- *
2617
- * - `"Children"`: Permissions apply to the children (files and folders) of this path only.
2618
- *
2619
- * - `"Grandchildren+"`: Permissions apply to the grandchildren (files and folders) of this path and their descendants only.
2620
- * @export
2621
- */
2622
- var PathPermissionScope = {
2623
- Children: "Children",
2624
- Grandchildren: "Grandchildren+",
2625
- This: "This"
2626
- };
2627
- /**
2628
- * @export
2629
- */
2630
- var PickDigitalOceanStorageExcludeKeyofDigitalOceanStorageCredentialsTypeEnum = {
2631
- DigitalOceanSpace: "DigitalOceanSpace"
2632
- };
2633
- /**
2634
- * @export
2635
- */
2636
- var PickGoogleStorageExcludeKeyofGoogleStorageCredentialsTypeEnum = {
2637
- GoogleStorage: "GoogleStorage"
2638
- };
2639
- /**
2640
- * @export
2641
- */
2642
- var PickR2StorageExcludeKeyofR2StorageCredentialsTypeEnum = {
2643
- R2: "R2"
2644
- };
2645
- /**
2646
- * @export
2647
- */
2648
- var PickS3StorageExcludeKeyofS3StorageCredentialsTypeEnum = {
2649
- S3: "S3"
2650
- };
2651
- /**
2652
- * @export
2653
- */
2654
- var R2StorageTypeEnum = {
2655
- R2: "R2"
2656
- };
2657
- /**
2658
- * @export
2659
- */
2660
- var S3StorageTypeEnum = {
2661
- S3: "S3"
2662
- };
2663
- /**
2664
- * @export
2665
- */
2666
- var SpecifiedFieldValueFolderDescriptionOrNullSetEnum = {
2667
- True: true
2668
- };
2669
- /**
2670
- * @export
2671
- */
2672
- var SpecifiedFieldValuePublicPermissionsArrayOrNullSetEnum = {
2673
- True: true
2674
- };
2675
- /**
2676
- * @export
2677
- */
2678
- var SpecifiedFieldValueStorageLayerUpdateOrNullSetEnum = {
2679
- True: true
2680
- };
2681
- /**
2682
- * @export
2683
- */
2684
- var SpecifiedFieldValueStorageLayerUpdateOrNullValueTypeEnum = {
2685
- GoogleStorage: "GoogleStorage"
2686
- };
2687
- /**
2688
- * @export
2689
- */
2690
- var StorageLayerSummaryTypeEnum = {
2691
- GoogleStorage: "GoogleStorage"
2692
- };
2693
- /**
2694
- * @export
2695
- */
2696
- var StorageLayerUpdateTypeEnum = {
2697
- GoogleStorage: "GoogleStorage"
2698
- };
2699
- /**
2700
- * @export
2701
- */
2702
- var TagConditionTypeEnum = {
2703
- All: "All"
2704
- };
2705
- /**
2706
- * @export
2707
- */
2708
- var TagConditionAllTypeEnum = {
2709
- All: "All"
2710
- };
2711
- /**
2712
- * @export
2713
- */
2714
- var TagConditionAndTypeEnum = {
2715
- And: "And"
2716
- };
2717
- /**
2718
- * @export
2719
- */
2720
- var TagConditionAnyTypeEnum = {
2721
- Any: "Any"
2722
- };
2723
- /**
2724
- * @export
2725
- */
2726
- var TagConditionEqualsTypeEnum = {
2727
- Equals: "Equals"
2728
- };
2729
- /**
2730
- * @export
2731
- */
2732
- var TagConditionNotTypeEnum = {
2733
- Not: "Not"
2734
- };
2735
- /**
2736
- * @export
2737
- */
2738
- var TagConditionOrTypeEnum = {
2739
- Or: "Or"
2740
- };
2741
- /**
2742
- * @export
2743
- */
2744
- var UnspecifiedFieldValueSetEnum = {
2745
- False: false
2746
- };
2747
- /**
2748
- * @export
2749
- */
2750
- var UpdatableFieldFolderDescriptionOrNullSetEnum = {
2751
- True: true
2752
- };
2753
- /**
2754
- * @export
2755
- */
2756
- var UpdatableFieldPublicPermissionsArrayOrNullSetEnum = {
2757
- True: true
2758
- };
2759
- /**
2760
- * @export
2761
- */
2762
- var UpdatableFieldStorageLayerUpdateOrNullSetEnum = {
2763
- True: true
2764
- };
2765
- /**
2766
- * @export
2767
- */
2768
- var WebStorageTypeEnum = {
2769
- Web: "Web"
2770
- };
2771
- ;// CONCATENATED MODULE: ./src/gen/index.ts
1408
+ ;// CONCATENATED MODULE: ./src/generated/index.ts
2772
1409
  /* tslint:disable */
2773
1410
  /* eslint-disable */
2774
1411
 
2775
1412
 
2776
1413
 
2777
- ;// CONCATENATED MODULE: ./src/utils/NodeUtils.ts
1414
+ ;// CONCATENATED MODULE: ./src/uploads/NodeUtils.ts
2778
1415
  function NodeUtils_typeof(obj) { "@babel/helpers - typeof"; return NodeUtils_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; }, NodeUtils_typeof(obj); }
2779
1416
  function NodeUtils_await(value, then, direct) {
2780
1417
  if (direct) {
@@ -2830,7 +1467,7 @@ var NodeUtils = /*#__PURE__*/function () {
2830
1467
  }]);
2831
1468
  return NodeUtils;
2832
1469
  }();
2833
- ;// CONCATENATED MODULE: ./src/utils/ChunkedStream.ts
1470
+ ;// CONCATENATED MODULE: ./src/uploads/ChunkedStream.ts
2834
1471
  function ChunkedStream_typeof(obj) { "@babel/helpers - typeof"; return ChunkedStream_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; }, ChunkedStream_typeof(obj); }
2835
1472
  function ChunkedStream_invoke(body, then) {
2836
1473
  var result = body();
@@ -2839,10 +1476,10 @@ function ChunkedStream_invoke(body, then) {
2839
1476
  }
2840
1477
  return then(result);
2841
1478
  }
2842
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || ChunkedStream_unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
1479
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2843
1480
  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."); }
2844
- function ChunkedStream_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return ChunkedStream_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 ChunkedStream_arrayLikeToArray(o, minLen); }
2845
- function ChunkedStream_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; }
1481
+ 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); }
1482
+ 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; }
2846
1483
  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; } }
2847
1484
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
2848
1485
  function ChunkedStream_await(value, then, direct) {
@@ -3047,37 +1684,37 @@ var ChunkedStream = /*#__PURE__*/function () {
3047
1684
  }]);
3048
1685
  return ChunkedStream;
3049
1686
  }();
3050
- ;// CONCATENATED MODULE: ./src/utils/Model.ts
3051
- 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); }
3052
- 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); } }
3053
- 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; }
3054
- function Model_toPropertyKey(arg) { var key = Model_toPrimitive(arg, "string"); return Model_typeof(key) === "symbol" ? key : String(key); }
3055
- 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); }
3056
- function Model_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3057
- 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); }
3058
- 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); }; }
3059
- 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); }
3060
- function Model_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
3061
- 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); }
3062
- 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); }
3063
- 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; } }
3064
- function Model_isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
3065
- 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); }
3066
- function Model_getPrototypeOf(o) { Model_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Model_getPrototypeOf(o); }
1687
+ ;// CONCATENATED MODULE: ./src/uploads/UploadModel.ts
1688
+ function UploadModel_typeof(obj) { "@babel/helpers - typeof"; return UploadModel_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; }, UploadModel_typeof(obj); }
1689
+ function UploadModel_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, UploadModel_toPropertyKey(descriptor.key), descriptor); } }
1690
+ function UploadModel_createClass(Constructor, protoProps, staticProps) { if (protoProps) UploadModel_defineProperties(Constructor.prototype, protoProps); if (staticProps) UploadModel_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
1691
+ function UploadModel_toPropertyKey(arg) { var key = UploadModel_toPrimitive(arg, "string"); return UploadModel_typeof(key) === "symbol" ? key : String(key); }
1692
+ function UploadModel_toPrimitive(input, hint) { if (UploadModel_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (UploadModel_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
1693
+ function UploadModel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1694
+ function UploadModel_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) UploadModel_setPrototypeOf(subClass, superClass); }
1695
+ function UploadModel_createSuper(Derived) { var hasNativeReflectConstruct = UploadModel_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = UploadModel_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = UploadModel_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return UploadModel_possibleConstructorReturn(this, result); }; }
1696
+ function UploadModel_possibleConstructorReturn(self, call) { if (call && (UploadModel_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 UploadModel_assertThisInitialized(self); }
1697
+ function UploadModel_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
1698
+ function UploadModel_wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; UploadModel_wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !UploadModel_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 UploadModel_construct(Class, arguments, UploadModel_getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return UploadModel_setPrototypeOf(Wrapper, Class); }; return UploadModel_wrapNativeSuper(Class); }
1699
+ function UploadModel_construct(Parent, args, Class) { if (UploadModel_isNativeReflectConstruct()) { UploadModel_construct = Reflect.construct.bind(); } else { UploadModel_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) UploadModel_setPrototypeOf(instance, Class.prototype); return instance; }; } return UploadModel_construct.apply(null, arguments); }
1700
+ function UploadModel_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; } }
1701
+ function UploadModel_isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
1702
+ function UploadModel_setPrototypeOf(o, p) { UploadModel_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return UploadModel_setPrototypeOf(o, p); }
1703
+ function UploadModel_getPrototypeOf(o) { UploadModel_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return UploadModel_getPrototypeOf(o); }
3067
1704
  var CancelledError = /*#__PURE__*/function (_Error) {
3068
- Model_inherits(CancelledError, _Error);
3069
- var _super = Model_createSuper(CancelledError);
1705
+ UploadModel_inherits(CancelledError, _Error);
1706
+ var _super = UploadModel_createSuper(CancelledError);
3070
1707
  function CancelledError(msg) {
3071
1708
  var _this;
3072
- Model_classCallCheck(this, CancelledError);
1709
+ UploadModel_classCallCheck(this, CancelledError);
3073
1710
  _this = _super.call(this, msg);
3074
1711
  _this.msg = msg;
3075
1712
  _this.name = "CancelledError";
3076
1713
  return _this;
3077
1714
  }
3078
- return Model_createClass(CancelledError);
3079
- }( /*#__PURE__*/Model_wrapNativeSuper(Error));
3080
- ;// CONCATENATED MODULE: ./src/utils/UploadManager.ts
1715
+ return UploadModel_createClass(CancelledError);
1716
+ }( /*#__PURE__*/UploadModel_wrapNativeSuper(Error));
1717
+ ;// CONCATENATED MODULE: ./src/uploads/UploadManager.ts
3081
1718
  function UploadManager_typeof(obj) { "@babel/helpers - typeof"; return UploadManager_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; }, UploadManager_typeof(obj); }
3082
1719
  function UploadManager_async(f) {
3083
1720
  return function () {
@@ -3092,7 +1729,7 @@ function UploadManager_async(f) {
3092
1729
  };
3093
1730
  }
3094
1731
  function UploadManager_empty() {}
3095
- function UploadManager_awaitIgnored(value, direct) {
1732
+ function _awaitIgnored(value, direct) {
3096
1733
  if (!direct) {
3097
1734
  return value && value.then ? value.then(UploadManager_empty) : Promise.resolve();
3098
1735
  }
@@ -3104,27 +1741,27 @@ function UploadManager_invoke(body, then) {
3104
1741
  }
3105
1742
  return then(result);
3106
1743
  }
3107
- function UploadManager_invokeIgnored(body) {
1744
+ function _invokeIgnored(body) {
3108
1745
  var result = body();
3109
1746
  if (result && result.then) {
3110
1747
  return result.then(UploadManager_empty);
3111
1748
  }
3112
1749
  }
3113
- function UploadManager_settle(pact, state, value) {
1750
+ function _settle(pact, state, value) {
3114
1751
  if (!pact.s) {
3115
- if (value instanceof UploadManager_Pact) {
1752
+ if (value instanceof _Pact) {
3116
1753
  if (value.s) {
3117
1754
  if (state & 1) {
3118
1755
  state = value.s;
3119
1756
  }
3120
1757
  value = value.v;
3121
1758
  } else {
3122
- value.o = UploadManager_settle.bind(null, pact, state);
1759
+ value.o = _settle.bind(null, pact, state);
3123
1760
  return;
3124
1761
  }
3125
1762
  }
3126
1763
  if (value && value.then) {
3127
- value.then(UploadManager_settle.bind(null, pact, state), UploadManager_settle.bind(null, pact, 2));
1764
+ value.then(_settle.bind(null, pact, state), _settle.bind(null, pact, 2));
3128
1765
  return;
3129
1766
  }
3130
1767
  pact.s = state;
@@ -3135,7 +1772,7 @@ function UploadManager_settle(pact, state, value) {
3135
1772
  }
3136
1773
  }
3137
1774
  }
3138
- var UploadManager_Pact = /*#__PURE__*/function () {
1775
+ var _Pact = /*#__PURE__*/function () {
3139
1776
  function _Pact() {}
3140
1777
  _Pact.prototype.then = function (onFulfilled, onRejected) {
3141
1778
  var result = new _Pact();
@@ -3144,9 +1781,9 @@ var UploadManager_Pact = /*#__PURE__*/function () {
3144
1781
  var callback = state & 1 ? onFulfilled : onRejected;
3145
1782
  if (callback) {
3146
1783
  try {
3147
- UploadManager_settle(result, 1, callback(this.v));
1784
+ _settle(result, 1, callback(this.v));
3148
1785
  } catch (e) {
3149
- UploadManager_settle(result, 2, e);
1786
+ _settle(result, 2, e);
3150
1787
  }
3151
1788
  return result;
3152
1789
  } else {
@@ -3157,28 +1794,28 @@ var UploadManager_Pact = /*#__PURE__*/function () {
3157
1794
  try {
3158
1795
  var value = _this.v;
3159
1796
  if (_this.s & 1) {
3160
- UploadManager_settle(result, 1, onFulfilled ? onFulfilled(value) : value);
1797
+ _settle(result, 1, onFulfilled ? onFulfilled(value) : value);
3161
1798
  } else if (onRejected) {
3162
- UploadManager_settle(result, 1, onRejected(value));
1799
+ _settle(result, 1, onRejected(value));
3163
1800
  } else {
3164
- UploadManager_settle(result, 2, value);
1801
+ _settle(result, 2, value);
3165
1802
  }
3166
1803
  } catch (e) {
3167
- UploadManager_settle(result, 2, e);
1804
+ _settle(result, 2, e);
3168
1805
  }
3169
1806
  };
3170
1807
  return result;
3171
1808
  };
3172
1809
  return _Pact;
3173
1810
  }();
3174
- function UploadManager_isSettledPact(thenable) {
3175
- return thenable instanceof UploadManager_Pact && thenable.s & 1;
1811
+ function _isSettledPact(thenable) {
1812
+ return thenable instanceof _Pact && thenable.s & 1;
3176
1813
  }
3177
1814
  function _for(test, update, body) {
3178
1815
  var stage;
3179
1816
  for (;;) {
3180
1817
  var shouldContinue = test();
3181
- if (UploadManager_isSettledPact(shouldContinue)) {
1818
+ if (_isSettledPact(shouldContinue)) {
3182
1819
  shouldContinue = shouldContinue.v;
3183
1820
  }
3184
1821
  if (!shouldContinue) {
@@ -3190,7 +1827,7 @@ function _for(test, update, body) {
3190
1827
  }
3191
1828
  var result = body();
3192
1829
  if (result && result.then) {
3193
- if (UploadManager_isSettledPact(result)) {
1830
+ if (_isSettledPact(result)) {
3194
1831
  result = result.s;
3195
1832
  } else {
3196
1833
  stage = 1;
@@ -3199,14 +1836,14 @@ function _for(test, update, body) {
3199
1836
  }
3200
1837
  if (update) {
3201
1838
  var updateValue = update();
3202
- if (updateValue && updateValue.then && !UploadManager_isSettledPact(updateValue)) {
1839
+ if (updateValue && updateValue.then && !_isSettledPact(updateValue)) {
3203
1840
  stage = 2;
3204
1841
  break;
3205
1842
  }
3206
1843
  }
3207
1844
  }
3208
- var pact = new UploadManager_Pact();
3209
- var reject = UploadManager_settle.bind(null, pact, 2);
1845
+ var pact = new _Pact();
1846
+ var reject = _settle.bind(null, pact, 2);
3210
1847
  (stage === 0 ? shouldContinue.then(_resumeAfterTest) : stage === 1 ? result.then(_resumeAfterBody) : updateValue.then(_resumeAfterUpdate)).then(void 0, reject);
3211
1848
  return pact;
3212
1849
  function _resumeAfterBody(value) {
@@ -3214,14 +1851,14 @@ function _for(test, update, body) {
3214
1851
  do {
3215
1852
  if (update) {
3216
1853
  updateValue = update();
3217
- if (updateValue && updateValue.then && !UploadManager_isSettledPact(updateValue)) {
1854
+ if (updateValue && updateValue.then && !_isSettledPact(updateValue)) {
3218
1855
  updateValue.then(_resumeAfterUpdate).then(void 0, reject);
3219
1856
  return;
3220
1857
  }
3221
1858
  }
3222
1859
  shouldContinue = test();
3223
- if (!shouldContinue || UploadManager_isSettledPact(shouldContinue) && !shouldContinue.v) {
3224
- UploadManager_settle(pact, 1, result);
1860
+ if (!shouldContinue || _isSettledPact(shouldContinue) && !shouldContinue.v) {
1861
+ _settle(pact, 1, result);
3225
1862
  return;
3226
1863
  }
3227
1864
  if (shouldContinue.then) {
@@ -3229,7 +1866,7 @@ function _for(test, update, body) {
3229
1866
  return;
3230
1867
  }
3231
1868
  result = body();
3232
- if (UploadManager_isSettledPact(result)) {
1869
+ if (_isSettledPact(result)) {
3233
1870
  result = result.v;
3234
1871
  }
3235
1872
  } while (!result || !result.then);
@@ -3244,7 +1881,7 @@ function _for(test, update, body) {
3244
1881
  _resumeAfterBody(result);
3245
1882
  }
3246
1883
  } else {
3247
- UploadManager_settle(pact, 1, result);
1884
+ _settle(pact, 1, result);
3248
1885
  }
3249
1886
  }
3250
1887
  function _resumeAfterUpdate() {
@@ -3255,7 +1892,7 @@ function _for(test, update, body) {
3255
1892
  _resumeAfterTest(shouldContinue);
3256
1893
  }
3257
1894
  } else {
3258
- UploadManager_settle(pact, 1, result);
1895
+ _settle(pact, 1, result);
3259
1896
  }
3260
1897
  }
3261
1898
  }
@@ -3264,11 +1901,11 @@ function _continueIgnored(value) {
3264
1901
  return value.then(UploadManager_empty);
3265
1902
  }
3266
1903
  }
3267
- function UploadManager_toConsumableArray(arr) { return UploadManager_arrayWithoutHoles(arr) || UploadManager_iterableToArray(arr) || UploadManager_unsupportedIterableToArray(arr) || UploadManager_nonIterableSpread(); }
3268
- function UploadManager_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."); }
1904
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || UploadManager_unsupportedIterableToArray(arr) || _nonIterableSpread(); }
1905
+ 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."); }
3269
1906
  function UploadManager_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return UploadManager_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 UploadManager_arrayLikeToArray(o, minLen); }
3270
- function UploadManager_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
3271
- function UploadManager_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return UploadManager_arrayLikeToArray(arr); }
1907
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
1908
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return UploadManager_arrayLikeToArray(arr); }
3272
1909
  function UploadManager_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; }
3273
1910
  function UploadManager_await(value, then, direct) {
3274
1911
  if (direct) {
@@ -3289,13 +1926,12 @@ function UploadManager_toPrimitive(input, hint) { if (UploadManager_typeof(input
3289
1926
 
3290
1927
 
3291
1928
  var UploadManager = /*#__PURE__*/function () {
3292
- function UploadManager() {
3293
- var configuration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DefaultConfig;
1929
+ function UploadManager(config) {
3294
1930
  UploadManager_classCallCheck(this, UploadManager);
3295
- this.configuration = configuration;
1931
+ this.config = config;
3296
1932
  this.stringMimeType = "text/plain";
3297
1933
  this.defaultMaxConcurrentUploadParts = 4;
3298
- this.uploadApi = new UploadApi(configuration);
1934
+ this.uploadApi = new UploadApi(config);
3299
1935
  }
3300
1936
  UploadManager_createClass(UploadManager, [{
3301
1937
  key: "upload",
@@ -3308,7 +1944,7 @@ var UploadManager = /*#__PURE__*/function () {
3308
1944
  _this2.checkIfCancelled(request);
3309
1945
  var maxConcurrency = _this2.calculateMaxConcurrency(request, data);
3310
1946
  var partCount = uploadInfo.uploadParts.count;
3311
- var parts = UploadManager_toConsumableArray(Array(partCount).keys());
1947
+ var parts = _toConsumableArray(Array(partCount).keys());
3312
1948
  var runSourceStreamPump = chunkedStream === null || chunkedStream === void 0 ? void 0 : chunkedStream.runChunkPipeline();
3313
1949
  return UploadManager_await(_this2.mapAsync(parts, maxConcurrency, UploadManager_async(function (part) {
3314
1950
  return _this2.uploadPart(request, data, part, uploadInfo);
@@ -3368,7 +2004,7 @@ var UploadManager = /*#__PURE__*/function () {
3368
2004
  _this6.checkIfCancelled(request);
3369
2005
  return UploadManager_await(_this6.putUploadPart(part, data), function (etag) {
3370
2006
  _this6.checkIfCancelled(request);
3371
- return UploadManager_awaitIgnored(_this6.uploadApi.completeUploadPart({
2007
+ return _awaitIgnored(_this6.uploadApi.completeUploadPart({
3372
2008
  accountId: request.accountId,
3373
2009
  uploadId: uploadInfo.uploadId,
3374
2010
  uploadPartIndex: partIndex,
@@ -3391,7 +2027,7 @@ var UploadManager = /*#__PURE__*/function () {
3391
2027
  try {
3392
2028
  var _this8 = this;
3393
2029
  var _a, _b;
3394
- var fetchApi = (_a = _this8.configuration.fetchApi) !== null && _a !== void 0 ? _a : fetch;
2030
+ var fetchApi = (_a = _this8.config.fetchApi) !== null && _a !== void 0 ? _a : fetch;
3395
2031
  var headers = {
3396
2032
  // Required to prevent fetch using "Transfer-Encoding: Chunked" when body is a stream.
3397
2033
  "content-length": (part.range.inclusiveEnd + 1 - part.range.inclusiveStart).toString()
@@ -3758,15 +2394,15 @@ var UploadManager = /*#__PURE__*/function () {
3758
2394
  key: "mapAsync",
3759
2395
  value: function mapAsync(items, concurrency, callback) {
3760
2396
  try {
3761
- var workQueue = UploadManager_toConsumableArray(items);
3762
- return UploadManager_awaitIgnored(Promise.all(UploadManager_toConsumableArray(Array(concurrency).keys()).map(UploadManager_async(function () {
2397
+ var workQueue = _toConsumableArray(items);
2398
+ return _awaitIgnored(Promise.all(_toConsumableArray(Array(concurrency).keys()).map(UploadManager_async(function () {
3763
2399
  return _continueIgnored(_for(function () {
3764
2400
  return workQueue.length > 0;
3765
2401
  }, void 0, function () {
3766
2402
  var work = workQueue.shift(); // IMPORTANT: use 'shift' instead of 'pop' to ensure 'items' are processed in order when 'concurrency = 1'.
3767
- return UploadManager_invokeIgnored(function () {
2403
+ return _invokeIgnored(function () {
3768
2404
  if (work !== undefined) {
3769
- return UploadManager_awaitIgnored(callback(work));
2405
+ return _awaitIgnored(callback(work));
3770
2406
  }
3771
2407
  });
3772
2408
  }));
@@ -3778,7 +2414,7 @@ var UploadManager = /*#__PURE__*/function () {
3778
2414
  }]);
3779
2415
  return UploadManager;
3780
2416
  }();
3781
- ;// CONCATENATED MODULE: ./src/utils/index.ts
2417
+ ;// CONCATENATED MODULE: ./src/uploads/index.ts
3782
2418
 
3783
2419
 
3784
2420