@bytescale/sdk 1.0.0-alpha.2 → 1.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/cjs/{_96d8.main.js → _70b2.main.js} +2 -2
- package/dist/browser/cjs/{_9d47.main.js → _7392.main.js} +2 -2
- package/dist/browser/cjs/main.js +499 -1863
- package/dist/node/cjs/main.js +497 -1861
- package/dist/node/esm/main.mjs +499 -1910
- package/dist/types/generated/apis/FileApi.d.ts +98 -0
- package/dist/types/{gen → generated}/apis/FolderApi.d.ts +8 -36
- package/dist/types/{gen → generated}/apis/JobApi.d.ts +4 -16
- package/dist/types/{gen → generated}/apis/UploadApi.d.ts +6 -26
- package/dist/types/{gen → generated}/models/index.d.ts +41 -201
- package/dist/types/{gen → generated}/runtime.d.ts +8 -78
- package/dist/types/index.d.ts +2 -2
- package/dist/types/{utils → uploads}/NodeUtils.d.ts +1 -1
- package/dist/types/{utils → uploads}/UploadManager.d.ts +4 -4
- package/dist/types/{utils/Model.d.ts → uploads/UploadModel.d.ts} +1 -1
- package/dist/types/{utils → uploads}/index.d.ts +1 -1
- package/package.json +1 -1
- package/tests/ChunkedStream.test.ts +1 -1
- package/tests/UploadManager.test.ts +3 -3
- package/dist/types/gen/apis/FileApi.d.ts +0 -135
- /package/dist/types/{gen → generated}/apis/index.d.ts +0 -0
- /package/dist/types/{gen → generated}/index.d.ts +0 -0
- /package/dist/types/{utils → uploads}/ChunkedStream.d.ts +0 -0
package/dist/browser/cjs/main.js
CHANGED
|
@@ -286,75 +286,27 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
286
286
|
|
|
287
287
|
// EXPORTS
|
|
288
288
|
__webpack_require__.d(__webpack_exports__, {
|
|
289
|
-
"AccountJobStatus": function() { return /* reexport */ AccountJobStatus; },
|
|
290
|
-
"AccountJobType": function() { return /* reexport */ AccountJobType; },
|
|
291
|
-
"AsyncResponseJobDocsEnum": function() { return /* reexport */ AsyncResponseJobDocsEnum; },
|
|
292
|
-
"AwsRegion": function() { return /* reexport */ AwsRegion; },
|
|
293
289
|
"BASE_PATH": function() { return /* reexport */ BASE_PATH; },
|
|
294
290
|
"BaseAPI": function() { return /* reexport */ BaseAPI; },
|
|
295
291
|
"BinaryResult": function() { return /* reexport */ BinaryResult; },
|
|
296
|
-
"
|
|
292
|
+
"BytescaleApiError": function() { return /* reexport */ BytescaleApiError; },
|
|
297
293
|
"CancelledError": function() { return /* reexport */ CancelledError; },
|
|
298
294
|
"ChunkedStream": function() { return /* reexport */ ChunkedStream; },
|
|
299
|
-
"Configuration": function() { return /* reexport */ Configuration; },
|
|
300
|
-
"DefaultConfig": function() { return /* reexport */ DefaultConfig; },
|
|
301
|
-
"DigitalOceanStorageTypeEnum": function() { return /* reexport */ DigitalOceanStorageTypeEnum; },
|
|
302
295
|
"FetchError": function() { return /* reexport */ FetchError; },
|
|
303
296
|
"FileApi": function() { return /* reexport */ FileApi; },
|
|
304
|
-
"FileCopyStatus": function() { return /* reexport */ FileCopyStatus; },
|
|
305
|
-
"FileSummaryTypeEnum": function() { return /* reexport */ FileSummaryTypeEnum; },
|
|
306
297
|
"FolderApi": function() { return /* reexport */ FolderApi; },
|
|
307
|
-
"FolderDetailsTypeEnum": function() { return /* reexport */ FolderDetailsTypeEnum; },
|
|
308
|
-
"FolderSettingsStorageLayerSummaryStorageLayerTypeEnum": function() { return /* reexport */ FolderSettingsStorageLayerSummaryStorageLayerTypeEnum; },
|
|
309
|
-
"FolderSummaryTypeEnum": function() { return /* reexport */ FolderSummaryTypeEnum; },
|
|
310
|
-
"GoogleStorageTypeEnum": function() { return /* reexport */ GoogleStorageTypeEnum; },
|
|
311
|
-
"InternalStorageV1TypeEnum": function() { return /* reexport */ InternalStorageV1TypeEnum; },
|
|
312
|
-
"InternalStorageV2TypeEnum": function() { return /* reexport */ InternalStorageV2TypeEnum; },
|
|
313
298
|
"JSONApiResponse": function() { return /* reexport */ JSONApiResponse; },
|
|
314
299
|
"JobApi": function() { return /* reexport */ JobApi; },
|
|
315
|
-
"JobSummaryJobDocsEnum": function() { return /* reexport */ JobSummaryJobDocsEnum; },
|
|
316
|
-
"MultipartUploadProtocol": function() { return /* reexport */ MultipartUploadProtocol; },
|
|
317
|
-
"ObjectSummaryTypeEnum": function() { return /* reexport */ ObjectSummaryTypeEnum; },
|
|
318
|
-
"PathPermissionScope": function() { return /* reexport */ PathPermissionScope; },
|
|
319
|
-
"PickDigitalOceanStorageExcludeKeyofDigitalOceanStorageCredentialsTypeEnum": function() { return /* reexport */ PickDigitalOceanStorageExcludeKeyofDigitalOceanStorageCredentialsTypeEnum; },
|
|
320
|
-
"PickGoogleStorageExcludeKeyofGoogleStorageCredentialsTypeEnum": function() { return /* reexport */ PickGoogleStorageExcludeKeyofGoogleStorageCredentialsTypeEnum; },
|
|
321
|
-
"PickR2StorageExcludeKeyofR2StorageCredentialsTypeEnum": function() { return /* reexport */ PickR2StorageExcludeKeyofR2StorageCredentialsTypeEnum; },
|
|
322
|
-
"PickS3StorageExcludeKeyofS3StorageCredentialsTypeEnum": function() { return /* reexport */ PickS3StorageExcludeKeyofS3StorageCredentialsTypeEnum; },
|
|
323
|
-
"ProcessFileCachePermEnum": function() { return /* reexport */ ProcessFileCachePermEnum; },
|
|
324
|
-
"R2StorageTypeEnum": function() { return /* reexport */ R2StorageTypeEnum; },
|
|
325
300
|
"RequiredError": function() { return /* reexport */ RequiredError; },
|
|
326
301
|
"ResponseError": function() { return /* reexport */ ResponseError; },
|
|
327
|
-
"S3StorageTypeEnum": function() { return /* reexport */ S3StorageTypeEnum; },
|
|
328
|
-
"SpecifiedFieldValueFolderDescriptionOrNullSetEnum": function() { return /* reexport */ SpecifiedFieldValueFolderDescriptionOrNullSetEnum; },
|
|
329
|
-
"SpecifiedFieldValuePublicPermissionsArrayOrNullSetEnum": function() { return /* reexport */ SpecifiedFieldValuePublicPermissionsArrayOrNullSetEnum; },
|
|
330
|
-
"SpecifiedFieldValueStorageLayerUpdateOrNullSetEnum": function() { return /* reexport */ SpecifiedFieldValueStorageLayerUpdateOrNullSetEnum; },
|
|
331
|
-
"SpecifiedFieldValueStorageLayerUpdateOrNullValueTypeEnum": function() { return /* reexport */ SpecifiedFieldValueStorageLayerUpdateOrNullValueTypeEnum; },
|
|
332
|
-
"StorageLayerSummaryTypeEnum": function() { return /* reexport */ StorageLayerSummaryTypeEnum; },
|
|
333
|
-
"StorageLayerUpdateTypeEnum": function() { return /* reexport */ StorageLayerUpdateTypeEnum; },
|
|
334
|
-
"TagConditionAllTypeEnum": function() { return /* reexport */ TagConditionAllTypeEnum; },
|
|
335
|
-
"TagConditionAndTypeEnum": function() { return /* reexport */ TagConditionAndTypeEnum; },
|
|
336
|
-
"TagConditionAnyTypeEnum": function() { return /* reexport */ TagConditionAnyTypeEnum; },
|
|
337
|
-
"TagConditionEqualsTypeEnum": function() { return /* reexport */ TagConditionEqualsTypeEnum; },
|
|
338
|
-
"TagConditionNotTypeEnum": function() { return /* reexport */ TagConditionNotTypeEnum; },
|
|
339
|
-
"TagConditionOrTypeEnum": function() { return /* reexport */ TagConditionOrTypeEnum; },
|
|
340
|
-
"TagConditionTypeEnum": function() { return /* reexport */ TagConditionTypeEnum; },
|
|
341
|
-
"TextApiResponse": function() { return /* reexport */ TextApiResponse; },
|
|
342
|
-
"UnspecifiedFieldValueSetEnum": function() { return /* reexport */ UnspecifiedFieldValueSetEnum; },
|
|
343
|
-
"UpdatableFieldFolderDescriptionOrNullSetEnum": function() { return /* reexport */ UpdatableFieldFolderDescriptionOrNullSetEnum; },
|
|
344
|
-
"UpdatableFieldPublicPermissionsArrayOrNullSetEnum": function() { return /* reexport */ UpdatableFieldPublicPermissionsArrayOrNullSetEnum; },
|
|
345
|
-
"UpdatableFieldStorageLayerUpdateOrNullSetEnum": function() { return /* reexport */ UpdatableFieldStorageLayerUpdateOrNullSetEnum; },
|
|
346
302
|
"UploadApi": function() { return /* reexport */ UploadApi; },
|
|
347
|
-
"UploadApiError": function() { return /* reexport */ UploadApiError; },
|
|
348
303
|
"UploadManager": function() { return /* reexport */ UploadManager; },
|
|
349
304
|
"VoidApiResponse": function() { return /* reexport */ VoidApiResponse; },
|
|
350
|
-
"WebStorageTypeEnum": function() { return /* reexport */ WebStorageTypeEnum; },
|
|
351
|
-
"canConsumeForm": function() { return /* reexport */ canConsumeForm; },
|
|
352
305
|
"querystring": function() { return /* reexport */ querystring; }
|
|
353
306
|
});
|
|
354
307
|
|
|
355
|
-
;// CONCATENATED MODULE: ./src/
|
|
308
|
+
;// CONCATENATED MODULE: ./src/generated/runtime.ts
|
|
356
309
|
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); }
|
|
357
|
-
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; } } }; }
|
|
358
310
|
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); }
|
|
359
311
|
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); }; }
|
|
360
312
|
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); }
|
|
@@ -365,19 +317,6 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
365
317
|
function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
|
|
366
318
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
367
319
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
368
|
-
function _invoke(body, then) {
|
|
369
|
-
var result = body();
|
|
370
|
-
if (result && result.then) {
|
|
371
|
-
return result.then(then);
|
|
372
|
-
}
|
|
373
|
-
return then(result);
|
|
374
|
-
}
|
|
375
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
376
|
-
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."); }
|
|
377
|
-
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); }
|
|
378
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
379
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
380
|
-
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; }
|
|
381
320
|
function _await(value, then, direct) {
|
|
382
321
|
if (direct) {
|
|
383
322
|
return then ? then(value) : value;
|
|
@@ -387,170 +326,6 @@ function _await(value, then, direct) {
|
|
|
387
326
|
}
|
|
388
327
|
return then ? value.then(then) : value;
|
|
389
328
|
}
|
|
390
|
-
function _empty() {}
|
|
391
|
-
function _invokeIgnored(body) {
|
|
392
|
-
var result = body();
|
|
393
|
-
if (result && result.then) {
|
|
394
|
-
return result.then(_empty);
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
var _iteratorSymbol = /*#__PURE__*/typeof Symbol !== "undefined" ? Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator")) : "@@iterator";
|
|
398
|
-
function _settle(pact, state, value) {
|
|
399
|
-
if (!pact.s) {
|
|
400
|
-
if (value instanceof _Pact) {
|
|
401
|
-
if (value.s) {
|
|
402
|
-
if (state & 1) {
|
|
403
|
-
state = value.s;
|
|
404
|
-
}
|
|
405
|
-
value = value.v;
|
|
406
|
-
} else {
|
|
407
|
-
value.o = _settle.bind(null, pact, state);
|
|
408
|
-
return;
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
if (value && value.then) {
|
|
412
|
-
value.then(_settle.bind(null, pact, state), _settle.bind(null, pact, 2));
|
|
413
|
-
return;
|
|
414
|
-
}
|
|
415
|
-
pact.s = state;
|
|
416
|
-
pact.v = value;
|
|
417
|
-
var observer = pact.o;
|
|
418
|
-
if (observer) {
|
|
419
|
-
observer(pact);
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
var _Pact = /*#__PURE__*/function () {
|
|
424
|
-
function _Pact() {}
|
|
425
|
-
_Pact.prototype.then = function (onFulfilled, onRejected) {
|
|
426
|
-
var result = new _Pact();
|
|
427
|
-
var state = this.s;
|
|
428
|
-
if (state) {
|
|
429
|
-
var callback = state & 1 ? onFulfilled : onRejected;
|
|
430
|
-
if (callback) {
|
|
431
|
-
try {
|
|
432
|
-
_settle(result, 1, callback(this.v));
|
|
433
|
-
} catch (e) {
|
|
434
|
-
_settle(result, 2, e);
|
|
435
|
-
}
|
|
436
|
-
return result;
|
|
437
|
-
} else {
|
|
438
|
-
return this;
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
this.o = function (_this) {
|
|
442
|
-
try {
|
|
443
|
-
var value = _this.v;
|
|
444
|
-
if (_this.s & 1) {
|
|
445
|
-
_settle(result, 1, onFulfilled ? onFulfilled(value) : value);
|
|
446
|
-
} else if (onRejected) {
|
|
447
|
-
_settle(result, 1, onRejected(value));
|
|
448
|
-
} else {
|
|
449
|
-
_settle(result, 2, value);
|
|
450
|
-
}
|
|
451
|
-
} catch (e) {
|
|
452
|
-
_settle(result, 2, e);
|
|
453
|
-
}
|
|
454
|
-
};
|
|
455
|
-
return result;
|
|
456
|
-
};
|
|
457
|
-
return _Pact;
|
|
458
|
-
}();
|
|
459
|
-
function _isSettledPact(thenable) {
|
|
460
|
-
return thenable instanceof _Pact && thenable.s & 1;
|
|
461
|
-
}
|
|
462
|
-
function _forTo(array, body, check) {
|
|
463
|
-
var i = -1,
|
|
464
|
-
pact,
|
|
465
|
-
reject;
|
|
466
|
-
function _cycle(result) {
|
|
467
|
-
try {
|
|
468
|
-
while (++i < array.length && (!check || !check())) {
|
|
469
|
-
result = body(i);
|
|
470
|
-
if (result && result.then) {
|
|
471
|
-
if (_isSettledPact(result)) {
|
|
472
|
-
result = result.v;
|
|
473
|
-
} else {
|
|
474
|
-
result.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));
|
|
475
|
-
return;
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
if (pact) {
|
|
480
|
-
_settle(pact, 1, result);
|
|
481
|
-
} else {
|
|
482
|
-
pact = result;
|
|
483
|
-
}
|
|
484
|
-
} catch (e) {
|
|
485
|
-
_settle(pact || (pact = new _Pact()), 2, e);
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
_cycle();
|
|
489
|
-
return pact;
|
|
490
|
-
}
|
|
491
|
-
function _forOf(target, body, check) {
|
|
492
|
-
if (typeof target[_iteratorSymbol] === "function") {
|
|
493
|
-
var _cycle = function _cycle(result) {
|
|
494
|
-
try {
|
|
495
|
-
while (!(step = iterator.next()).done && (!check || !check())) {
|
|
496
|
-
result = body(step.value);
|
|
497
|
-
if (result && result.then) {
|
|
498
|
-
if (_isSettledPact(result)) {
|
|
499
|
-
result = result.v;
|
|
500
|
-
} else {
|
|
501
|
-
result.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));
|
|
502
|
-
return;
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
if (pact) {
|
|
507
|
-
_settle(pact, 1, result);
|
|
508
|
-
} else {
|
|
509
|
-
pact = result;
|
|
510
|
-
}
|
|
511
|
-
} catch (e) {
|
|
512
|
-
_settle(pact || (pact = new _Pact()), 2, e);
|
|
513
|
-
}
|
|
514
|
-
};
|
|
515
|
-
var iterator = target[_iteratorSymbol](),
|
|
516
|
-
step,
|
|
517
|
-
pact,
|
|
518
|
-
reject;
|
|
519
|
-
_cycle();
|
|
520
|
-
if (iterator["return"]) {
|
|
521
|
-
var _fixup = function _fixup(value) {
|
|
522
|
-
try {
|
|
523
|
-
if (!step.done) {
|
|
524
|
-
iterator["return"]();
|
|
525
|
-
}
|
|
526
|
-
} catch (e) {}
|
|
527
|
-
return value;
|
|
528
|
-
};
|
|
529
|
-
if (pact && pact.then) {
|
|
530
|
-
return pact.then(_fixup, function (e) {
|
|
531
|
-
throw _fixup(e);
|
|
532
|
-
});
|
|
533
|
-
}
|
|
534
|
-
_fixup();
|
|
535
|
-
}
|
|
536
|
-
return pact;
|
|
537
|
-
}
|
|
538
|
-
// No support for Symbol.iterator
|
|
539
|
-
if (!("length" in target)) {
|
|
540
|
-
throw new TypeError("Object is not iterable");
|
|
541
|
-
}
|
|
542
|
-
// Handle live collections properly
|
|
543
|
-
var values = [];
|
|
544
|
-
for (var i = 0; i < target.length; i++) {
|
|
545
|
-
values.push(target[i]);
|
|
546
|
-
}
|
|
547
|
-
return _forTo(values, function (i) {
|
|
548
|
-
return body(values[i]);
|
|
549
|
-
}, check);
|
|
550
|
-
}
|
|
551
|
-
function _continue(value, then) {
|
|
552
|
-
return value && value.then ? value.then(then) : then(value);
|
|
553
|
-
}
|
|
554
329
|
function _catch(body, recover) {
|
|
555
330
|
try {
|
|
556
331
|
var result = body();
|
|
@@ -562,6 +337,9 @@ function _catch(body, recover) {
|
|
|
562
337
|
}
|
|
563
338
|
return result;
|
|
564
339
|
}
|
|
340
|
+
function _continue(value, then) {
|
|
341
|
+
return value && value.then ? value.then(then) : then(value);
|
|
342
|
+
}
|
|
565
343
|
function _async(f) {
|
|
566
344
|
return function () {
|
|
567
345
|
for (var args = [], i = 0; i < arguments.length; i++) {
|
|
@@ -574,13 +352,21 @@ function _async(f) {
|
|
|
574
352
|
}
|
|
575
353
|
};
|
|
576
354
|
}
|
|
355
|
+
function _empty() {}
|
|
356
|
+
function _invoke(body, then) {
|
|
357
|
+
var result = body();
|
|
358
|
+
if (result && result.then) {
|
|
359
|
+
return result.then(then);
|
|
360
|
+
}
|
|
361
|
+
return then(result);
|
|
362
|
+
}
|
|
577
363
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
578
364
|
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); } }
|
|
579
365
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
580
366
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
581
367
|
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); }
|
|
582
368
|
/**
|
|
583
|
-
* @bytescale/
|
|
369
|
+
* @bytescale/api
|
|
584
370
|
* Bytescale API
|
|
585
371
|
*
|
|
586
372
|
* The version of the OpenAPI document: 2.0.0
|
|
@@ -591,200 +377,46 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
591
377
|
* Do not edit the class manually.
|
|
592
378
|
*/
|
|
593
379
|
var BASE_PATH = "https://api.bytescale.com".replace(/\/+$/, "");
|
|
594
|
-
var Configuration = /*#__PURE__*/function () {
|
|
595
|
-
function Configuration() {
|
|
596
|
-
var configuration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
597
|
-
_classCallCheck(this, Configuration);
|
|
598
|
-
this.configuration = configuration;
|
|
599
|
-
}
|
|
600
|
-
_createClass(Configuration, [{
|
|
601
|
-
key: "config",
|
|
602
|
-
set: function set(configuration) {
|
|
603
|
-
this.configuration = configuration;
|
|
604
|
-
}
|
|
605
|
-
}, {
|
|
606
|
-
key: "basePath",
|
|
607
|
-
get: function get() {
|
|
608
|
-
return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
|
|
609
|
-
}
|
|
610
|
-
}, {
|
|
611
|
-
key: "fetchApi",
|
|
612
|
-
get: function get() {
|
|
613
|
-
return this.configuration.fetchApi;
|
|
614
|
-
}
|
|
615
|
-
}, {
|
|
616
|
-
key: "middleware",
|
|
617
|
-
get: function get() {
|
|
618
|
-
return this.configuration.middleware || [];
|
|
619
|
-
}
|
|
620
|
-
}, {
|
|
621
|
-
key: "queryParamsStringify",
|
|
622
|
-
get: function get() {
|
|
623
|
-
return this.configuration.queryParamsStringify || querystring;
|
|
624
|
-
}
|
|
625
|
-
}, {
|
|
626
|
-
key: "username",
|
|
627
|
-
get: function get() {
|
|
628
|
-
return this.configuration.username;
|
|
629
|
-
}
|
|
630
|
-
}, {
|
|
631
|
-
key: "password",
|
|
632
|
-
get: function get() {
|
|
633
|
-
return this.configuration.password;
|
|
634
|
-
}
|
|
635
|
-
}, {
|
|
636
|
-
key: "apiKey",
|
|
637
|
-
get: function get() {
|
|
638
|
-
var apiKey = this.configuration.apiKey;
|
|
639
|
-
if (apiKey) {
|
|
640
|
-
return typeof apiKey === "function" ? apiKey : function (name) {
|
|
641
|
-
return name === "Authorization" ? "Bearer ".concat(apiKey) : apiKey;
|
|
642
|
-
};
|
|
643
|
-
}
|
|
644
|
-
return undefined;
|
|
645
|
-
}
|
|
646
|
-
}, {
|
|
647
|
-
key: "accessToken",
|
|
648
|
-
get: function get() {
|
|
649
|
-
var accessToken = this.configuration.accessToken;
|
|
650
|
-
if (accessToken) {
|
|
651
|
-
return typeof accessToken === "function" ? accessToken : function () {
|
|
652
|
-
return _await(accessToken);
|
|
653
|
-
};
|
|
654
|
-
}
|
|
655
|
-
return undefined;
|
|
656
|
-
}
|
|
657
|
-
}, {
|
|
658
|
-
key: "headers",
|
|
659
|
-
get: function get() {
|
|
660
|
-
return this.configuration.headers;
|
|
661
|
-
}
|
|
662
|
-
}, {
|
|
663
|
-
key: "credentials",
|
|
664
|
-
get: function get() {
|
|
665
|
-
return this.configuration.credentials;
|
|
666
|
-
}
|
|
667
|
-
}]);
|
|
668
|
-
return Configuration;
|
|
669
|
-
}();
|
|
670
|
-
var DefaultConfig = new Configuration();
|
|
671
380
|
/**
|
|
672
381
|
* This is the base class for all generated API classes.
|
|
673
382
|
*/
|
|
674
383
|
var BaseAPI = /*#__PURE__*/function () {
|
|
675
|
-
function BaseAPI() {
|
|
384
|
+
function BaseAPI(config) {
|
|
676
385
|
var _this = this;
|
|
677
|
-
var configuration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DefaultConfig;
|
|
678
386
|
_classCallCheck(this, BaseAPI);
|
|
679
|
-
this.
|
|
387
|
+
this.config = config;
|
|
680
388
|
this.fetchApi = _async(function (url, init) {
|
|
389
|
+
var _exit = false;
|
|
681
390
|
var fetchParams = {
|
|
682
391
|
url: url,
|
|
683
392
|
init: init
|
|
684
393
|
};
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
fetch: _this.fetchApi
|
|
690
|
-
}, fetchParams)), function (_middleware$pre) {
|
|
691
|
-
fetchParams = _middleware$pre || fetchParams;
|
|
692
|
-
});
|
|
693
|
-
}
|
|
694
|
-
});
|
|
695
|
-
}), function () {
|
|
696
|
-
var _exit = false;
|
|
697
|
-
var response = undefined;
|
|
698
|
-
return _continue(_catch(function () {
|
|
699
|
-
return _await((_this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init), function (_temp) {
|
|
700
|
-
response = _temp;
|
|
701
|
-
});
|
|
702
|
-
}, function (e) {
|
|
703
|
-
return _continue(_forOf(_this.middleware, function (middleware) {
|
|
704
|
-
return _invokeIgnored(function () {
|
|
705
|
-
if (middleware.onError) {
|
|
706
|
-
return _await(middleware.onError({
|
|
707
|
-
fetch: _this.fetchApi,
|
|
708
|
-
url: fetchParams.url,
|
|
709
|
-
init: fetchParams.init,
|
|
710
|
-
error: e,
|
|
711
|
-
response: response ? response.clone() : undefined
|
|
712
|
-
}), function (_middleware$onError) {
|
|
713
|
-
response = _middleware$onError || response;
|
|
714
|
-
});
|
|
715
|
-
}
|
|
716
|
-
});
|
|
717
|
-
}), function () {
|
|
718
|
-
if (response === undefined) {
|
|
719
|
-
if (e instanceof Error) {
|
|
720
|
-
throw new FetchError(e, "The request failed and the interceptors did not return an alternative response");
|
|
721
|
-
} else {
|
|
722
|
-
throw e;
|
|
723
|
-
}
|
|
724
|
-
}
|
|
725
|
-
});
|
|
726
|
-
}), function (_result) {
|
|
727
|
-
return _exit ? _result : _continue(_forOf(_this.middleware, function (middleware) {
|
|
728
|
-
return _invokeIgnored(function () {
|
|
729
|
-
if (middleware.post) {
|
|
730
|
-
return _await(middleware.post({
|
|
731
|
-
fetch: _this.fetchApi,
|
|
732
|
-
url: fetchParams.url,
|
|
733
|
-
init: fetchParams.init,
|
|
734
|
-
response: response.clone()
|
|
735
|
-
}), function (_middleware$post) {
|
|
736
|
-
response = _middleware$post || response;
|
|
737
|
-
});
|
|
738
|
-
}
|
|
739
|
-
});
|
|
740
|
-
}), function () {
|
|
741
|
-
return response;
|
|
742
|
-
});
|
|
394
|
+
var response = undefined;
|
|
395
|
+
return _continue(_catch(function () {
|
|
396
|
+
return _await((_this.config.fetchApi || fetch)(fetchParams.url, fetchParams.init), function (_temp) {
|
|
397
|
+
response = _temp;
|
|
743
398
|
});
|
|
399
|
+
}, function (e) {
|
|
400
|
+
if (response === undefined) {
|
|
401
|
+
if (e instanceof Error) {
|
|
402
|
+
throw new FetchError(e, "The request failed and the interceptors did not return an alternative response");
|
|
403
|
+
} else {
|
|
404
|
+
throw e;
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
}), function (_result) {
|
|
408
|
+
return _exit ? _result : response;
|
|
744
409
|
});
|
|
745
410
|
});
|
|
746
|
-
this.middleware = configuration.middleware;
|
|
747
411
|
}
|
|
748
412
|
_createClass(BaseAPI, [{
|
|
749
|
-
key: "withMiddleware",
|
|
750
|
-
value: function withMiddleware() {
|
|
751
|
-
var _next$middleware;
|
|
752
|
-
var next = this.clone();
|
|
753
|
-
next.middleware = (_next$middleware = next.middleware).concat.apply(_next$middleware, arguments);
|
|
754
|
-
return next;
|
|
755
|
-
}
|
|
756
|
-
}, {
|
|
757
|
-
key: "withPreMiddleware",
|
|
758
|
-
value: function withPreMiddleware() {
|
|
759
|
-
for (var _len = arguments.length, preMiddlewares = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
760
|
-
preMiddlewares[_key] = arguments[_key];
|
|
761
|
-
}
|
|
762
|
-
var middlewares = preMiddlewares.map(function (pre) {
|
|
763
|
-
return {
|
|
764
|
-
pre: pre
|
|
765
|
-
};
|
|
766
|
-
});
|
|
767
|
-
return this.withMiddleware.apply(this, _toConsumableArray(middlewares));
|
|
768
|
-
}
|
|
769
|
-
}, {
|
|
770
|
-
key: "withPostMiddleware",
|
|
771
|
-
value: function withPostMiddleware() {
|
|
772
|
-
for (var _len2 = arguments.length, postMiddlewares = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
773
|
-
postMiddlewares[_key2] = arguments[_key2];
|
|
774
|
-
}
|
|
775
|
-
var middlewares = postMiddlewares.map(function (post) {
|
|
776
|
-
return {
|
|
777
|
-
post: post
|
|
778
|
-
};
|
|
779
|
-
});
|
|
780
|
-
return this.withMiddleware.apply(this, _toConsumableArray(middlewares));
|
|
781
|
-
}
|
|
782
|
-
}, {
|
|
783
413
|
key: "request",
|
|
784
414
|
value: function request(context, initOverrides, operationBasePathOverride) {
|
|
785
415
|
try {
|
|
786
416
|
var _this3 = this;
|
|
787
417
|
var _a;
|
|
418
|
+
var apiKey = _this3.config.apiKey;
|
|
419
|
+
context.headers["Authorization"] = "Bearer ".concat(apiKey); // authorization-header authentication
|
|
788
420
|
return _await(_this3.createFetchParams(context, initOverrides, operationBasePathOverride), function (_ref) {
|
|
789
421
|
var url = _ref.url,
|
|
790
422
|
init = _ref.init;
|
|
@@ -799,7 +431,7 @@ var BaseAPI = /*#__PURE__*/function () {
|
|
|
799
431
|
});
|
|
800
432
|
}, _empty), function () {
|
|
801
433
|
if (typeof ((_a = jsonError === null || jsonError === void 0 ? void 0 : jsonError.error) === null || _a === void 0 ? void 0 : _a.code) === "string") {
|
|
802
|
-
throw new
|
|
434
|
+
throw new BytescaleApiError(jsonError);
|
|
803
435
|
}
|
|
804
436
|
});
|
|
805
437
|
}
|
|
@@ -813,61 +445,57 @@ var BaseAPI = /*#__PURE__*/function () {
|
|
|
813
445
|
return Promise.reject(e);
|
|
814
446
|
}
|
|
815
447
|
}
|
|
448
|
+
}, {
|
|
449
|
+
key: "encodeParam",
|
|
450
|
+
value: function encodeParam(paramName, paramValue) {
|
|
451
|
+
return paramName === "filePath" ? paramValue : encodeURIComponent(paramValue);
|
|
452
|
+
}
|
|
816
453
|
}, {
|
|
817
454
|
key: "createFetchParams",
|
|
818
455
|
value: function createFetchParams(context, initOverrides, operationBasePathOverride) {
|
|
819
456
|
try {
|
|
820
457
|
var _this5 = this;
|
|
821
|
-
var url = (operationBasePathOverride !== null && operationBasePathOverride !== void 0 ? operationBasePathOverride :
|
|
458
|
+
var url = (operationBasePathOverride !== null && operationBasePathOverride !== void 0 ? operationBasePathOverride : BASE_PATH) + context.path;
|
|
822
459
|
if (context.query !== undefined && Object.keys(context.query).length !== 0) {
|
|
823
460
|
// only add the querystring to the URL if there are query parameters.
|
|
824
461
|
// this is done to avoid urls ending with a "?" character which buggy webservers
|
|
825
462
|
// do not handle correctly sometimes.
|
|
826
|
-
url += "?" +
|
|
827
|
-
}
|
|
828
|
-
var
|
|
829
|
-
Object.
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
};
|
|
835
|
-
var initParams = {
|
|
836
|
-
method: context.method,
|
|
837
|
-
headers: headers,
|
|
838
|
-
body: context.body,
|
|
839
|
-
credentials: _this5.configuration.credentials
|
|
840
|
-
};
|
|
841
|
-
var _Object$assign2 = Object.assign({}, initParams);
|
|
842
|
-
return _await(initOverrideFn({
|
|
843
|
-
init: initParams,
|
|
844
|
-
context: context
|
|
845
|
-
}), function (_initOverrideFn) {
|
|
846
|
-
var overriddenInit = Object.assign(_Object$assign2, _initOverrideFn);
|
|
847
|
-
var init = Object.assign(Object.assign({}, overriddenInit), {
|
|
848
|
-
body: isFormData(overriddenInit.body) || overriddenInit.body instanceof URLSearchParams || isBlob(overriddenInit.body) ? overriddenInit.body : JSON.stringify(overriddenInit.body)
|
|
463
|
+
url += "?" + querystring(context.query);
|
|
464
|
+
}
|
|
465
|
+
var configHeaders = _this5.config.headers;
|
|
466
|
+
var _Object$assign3 = Object.assign({}, context.headers);
|
|
467
|
+
return _await(configHeaders === undefined ? {} : configHeaders(), function (_configHeaders) {
|
|
468
|
+
var headers = Object.assign(_Object$assign3, _configHeaders);
|
|
469
|
+
Object.keys(headers).forEach(function (key) {
|
|
470
|
+
return headers[key] === undefined ? delete headers[key] : {};
|
|
849
471
|
});
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
init: init
|
|
472
|
+
var initOverrideFn = typeof initOverrides === "function" ? initOverrides : function () {
|
|
473
|
+
return _await(initOverrides);
|
|
853
474
|
};
|
|
854
|
-
|
|
475
|
+
var initParams = {
|
|
476
|
+
method: context.method,
|
|
477
|
+
headers: headers,
|
|
478
|
+
body: context.body
|
|
479
|
+
};
|
|
480
|
+
var _Object$assign2 = Object.assign({}, initParams);
|
|
481
|
+
return _await(initOverrideFn({
|
|
482
|
+
init: initParams,
|
|
483
|
+
context: context
|
|
484
|
+
}), function (_initOverrideFn) {
|
|
485
|
+
var overriddenInit = Object.assign(_Object$assign2, _initOverrideFn);
|
|
486
|
+
var init = Object.assign(Object.assign({}, overriddenInit), {
|
|
487
|
+
body: isFormData(overriddenInit.body) || overriddenInit.body instanceof URLSearchParams || isBlob(overriddenInit.body) ? overriddenInit.body : JSON.stringify(overriddenInit.body)
|
|
488
|
+
});
|
|
489
|
+
return {
|
|
490
|
+
url: url,
|
|
491
|
+
init: init
|
|
492
|
+
};
|
|
493
|
+
});
|
|
494
|
+
}, configHeaders === undefined);
|
|
855
495
|
} catch (e) {
|
|
856
496
|
return Promise.reject(e);
|
|
857
497
|
}
|
|
858
498
|
}
|
|
859
|
-
/**
|
|
860
|
-
* Create a shallow clone of `this` by constructing a new instance
|
|
861
|
-
* and then shallow cloning data members.
|
|
862
|
-
*/
|
|
863
|
-
}, {
|
|
864
|
-
key: "clone",
|
|
865
|
-
value: function clone() {
|
|
866
|
-
var constructor = this.constructor;
|
|
867
|
-
var next = new constructor(this.configuration);
|
|
868
|
-
next.middleware = this.middleware.slice();
|
|
869
|
-
return next;
|
|
870
|
-
}
|
|
871
499
|
}]);
|
|
872
500
|
return BaseAPI;
|
|
873
501
|
}();
|
|
@@ -877,19 +505,19 @@ function isBlob(value) {
|
|
|
877
505
|
function isFormData(value) {
|
|
878
506
|
return typeof FormData !== "undefined" && value instanceof FormData;
|
|
879
507
|
}
|
|
880
|
-
var
|
|
881
|
-
_inherits(
|
|
882
|
-
var _super = _createSuper(
|
|
883
|
-
function
|
|
508
|
+
var BytescaleApiError = /*#__PURE__*/function (_Error) {
|
|
509
|
+
_inherits(BytescaleApiError, _Error);
|
|
510
|
+
var _super = _createSuper(BytescaleApiError);
|
|
511
|
+
function BytescaleApiError(response) {
|
|
884
512
|
var _this6;
|
|
885
|
-
_classCallCheck(this,
|
|
513
|
+
_classCallCheck(this, BytescaleApiError);
|
|
886
514
|
_this6 = _super.call(this, response.error.message);
|
|
887
|
-
_this6.name = "
|
|
515
|
+
_this6.name = "BytescaleApiError";
|
|
888
516
|
_this6.errorCode = response.error.code;
|
|
889
517
|
_this6.details = response.error.details;
|
|
890
518
|
return _this6;
|
|
891
519
|
}
|
|
892
|
-
return _createClass(
|
|
520
|
+
return _createClass(BytescaleApiError);
|
|
893
521
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
894
522
|
var ResponseError = /*#__PURE__*/function (_Error2) {
|
|
895
523
|
_inherits(ResponseError, _Error2);
|
|
@@ -930,12 +558,6 @@ var RequiredError = /*#__PURE__*/function (_Error4) {
|
|
|
930
558
|
}
|
|
931
559
|
return _createClass(RequiredError);
|
|
932
560
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
933
|
-
var COLLECTION_FORMATS = {
|
|
934
|
-
csv: ",",
|
|
935
|
-
ssv: " ",
|
|
936
|
-
tsv: "\t",
|
|
937
|
-
pipes: "|"
|
|
938
|
-
};
|
|
939
561
|
function querystring(params) {
|
|
940
562
|
var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
941
563
|
return Object.keys(params).map(function (key) {
|
|
@@ -965,23 +587,6 @@ function querystringSingleKey(key, value) {
|
|
|
965
587
|
}
|
|
966
588
|
return "".concat(encodeURIComponent(fullKey), "=").concat(encodeURIComponent(String(value)));
|
|
967
589
|
}
|
|
968
|
-
function canConsumeForm(consumes) {
|
|
969
|
-
var _iterator = _createForOfIteratorHelper(consumes),
|
|
970
|
-
_step;
|
|
971
|
-
try {
|
|
972
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
973
|
-
var consume = _step.value;
|
|
974
|
-
if ("multipart/form-data" === consume.contentType) {
|
|
975
|
-
return true;
|
|
976
|
-
}
|
|
977
|
-
}
|
|
978
|
-
} catch (err) {
|
|
979
|
-
_iterator.e(err);
|
|
980
|
-
} finally {
|
|
981
|
-
_iterator.f();
|
|
982
|
-
}
|
|
983
|
-
return false;
|
|
984
|
-
}
|
|
985
590
|
var JSONApiResponse = /*#__PURE__*/function () {
|
|
986
591
|
function JSONApiResponse(raw) {
|
|
987
592
|
var transformer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (jsonValue) {
|
|
@@ -1069,25 +674,7 @@ var BinaryResult = /*#__PURE__*/function () {
|
|
|
1069
674
|
}]);
|
|
1070
675
|
return BinaryResult;
|
|
1071
676
|
}();
|
|
1072
|
-
|
|
1073
|
-
function TextApiResponse(raw) {
|
|
1074
|
-
_classCallCheck(this, TextApiResponse);
|
|
1075
|
-
this.raw = raw;
|
|
1076
|
-
}
|
|
1077
|
-
_createClass(TextApiResponse, [{
|
|
1078
|
-
key: "value",
|
|
1079
|
-
value: function value() {
|
|
1080
|
-
try {
|
|
1081
|
-
var _this19 = this;
|
|
1082
|
-
return _await(_this19.raw.text());
|
|
1083
|
-
} catch (e) {
|
|
1084
|
-
return Promise.reject(e);
|
|
1085
|
-
}
|
|
1086
|
-
}
|
|
1087
|
-
}]);
|
|
1088
|
-
return TextApiResponse;
|
|
1089
|
-
}();
|
|
1090
|
-
;// CONCATENATED MODULE: ./src/gen/apis/FileApi.ts
|
|
677
|
+
;// CONCATENATED MODULE: ./src/generated/apis/FileApi.ts
|
|
1091
678
|
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); }
|
|
1092
679
|
function FileApi_await(value, then, direct) {
|
|
1093
680
|
if (direct) {
|
|
@@ -1098,12 +685,6 @@ function FileApi_await(value, then, direct) {
|
|
|
1098
685
|
}
|
|
1099
686
|
return then ? value.then(then) : value;
|
|
1100
687
|
}
|
|
1101
|
-
function FileApi_empty() {}
|
|
1102
|
-
function _awaitIgnored(value, direct) {
|
|
1103
|
-
if (!direct) {
|
|
1104
|
-
return value && value.then ? value.then(FileApi_empty) : Promise.resolve();
|
|
1105
|
-
}
|
|
1106
|
-
}
|
|
1107
688
|
function FileApi_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
1108
689
|
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); } }
|
|
1109
690
|
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; }
|
|
@@ -1119,7 +700,7 @@ function FileApi_getPrototypeOf(o) { FileApi_getPrototypeOf = Object.setPrototyp
|
|
|
1119
700
|
/* tslint:disable */
|
|
1120
701
|
/* eslint-disable */
|
|
1121
702
|
/**
|
|
1122
|
-
* @bytescale/
|
|
703
|
+
* @bytescale/api
|
|
1123
704
|
* Bytescale API
|
|
1124
705
|
*
|
|
1125
706
|
* The version of the OpenAPI document: 2.0.0
|
|
@@ -1142,320 +723,168 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1142
723
|
return _super.apply(this, arguments);
|
|
1143
724
|
}
|
|
1144
725
|
FileApi_createClass(FileApi, [{
|
|
1145
|
-
key: "
|
|
726
|
+
key: "copyFile",
|
|
1146
727
|
value:
|
|
1147
728
|
/**
|
|
1148
729
|
* Copies a file synchronously.
|
|
1149
730
|
*/
|
|
1150
|
-
function
|
|
731
|
+
function copyFile(params) {
|
|
1151
732
|
try {
|
|
1152
733
|
var _this2 = this;
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
if (requestParameters.copyFileRequest === null || requestParameters.copyFileRequest === undefined) {
|
|
1157
|
-
throw new RequiredError("copyFileRequest", "Required parameter requestParameters.copyFileRequest was null or undefined when calling copyFile.");
|
|
1158
|
-
}
|
|
1159
|
-
var queryParameters = {};
|
|
1160
|
-
var headerParameters = {};
|
|
1161
|
-
headerParameters["Content-Type"] = "application/json";
|
|
1162
|
-
if (_this2.configuration && _this2.configuration.apiKey) {
|
|
1163
|
-
headerParameters["Authorization"] = _this2.configuration.apiKey("Authorization"); // authorization-header authentication
|
|
1164
|
-
}
|
|
1165
|
-
|
|
1166
|
-
var operationBasePathOverride = [][0];
|
|
734
|
+
var query = {};
|
|
735
|
+
var headers = {};
|
|
736
|
+
headers["Content-Type"] = "application/json";
|
|
1167
737
|
return FileApi_await(_this2.request({
|
|
1168
738
|
path: "/v2/accounts/{accountId}/files/copy".replace("{".concat("accountId", "}"),
|
|
1169
739
|
// @ts-ignore
|
|
1170
|
-
|
|
740
|
+
_this2.encodeParam("accountId", params.accountId)),
|
|
1171
741
|
method: "POST",
|
|
1172
|
-
headers:
|
|
1173
|
-
query:
|
|
1174
|
-
body:
|
|
1175
|
-
},
|
|
1176
|
-
return new JSONApiResponse(response);
|
|
742
|
+
headers: headers,
|
|
743
|
+
query: query,
|
|
744
|
+
body: params.copyFileRequest
|
|
745
|
+
}, undefined, [][0]), function (response) {
|
|
746
|
+
return FileApi_await(new JSONApiResponse(response).value());
|
|
1177
747
|
});
|
|
1178
748
|
} catch (e) {
|
|
1179
749
|
return Promise.reject(e);
|
|
1180
750
|
}
|
|
1181
751
|
}
|
|
1182
752
|
/**
|
|
1183
|
-
* Copies
|
|
753
|
+
* Copies multiple files asynchronously.
|
|
1184
754
|
*/
|
|
1185
755
|
}, {
|
|
1186
|
-
key: "
|
|
1187
|
-
value: function
|
|
756
|
+
key: "copyFileBatch",
|
|
757
|
+
value: function copyFileBatch(params) {
|
|
1188
758
|
try {
|
|
1189
759
|
var _this4 = this;
|
|
1190
|
-
|
|
1191
|
-
|
|
760
|
+
var query = {};
|
|
761
|
+
var headers = {};
|
|
762
|
+
headers["Content-Type"] = "application/json";
|
|
763
|
+
return FileApi_await(_this4.request({
|
|
764
|
+
path: "/v2/accounts/{accountId}/files/copy/batch".replace("{".concat("accountId", "}"),
|
|
765
|
+
// @ts-ignore
|
|
766
|
+
_this4.encodeParam("accountId", params.accountId)),
|
|
767
|
+
method: "POST",
|
|
768
|
+
headers: headers,
|
|
769
|
+
query: query,
|
|
770
|
+
body: params.copyFileBatchRequest
|
|
771
|
+
}, undefined, [][0]), function (response) {
|
|
772
|
+
return FileApi_await(new JSONApiResponse(response).value());
|
|
1192
773
|
});
|
|
1193
774
|
} catch (e) {
|
|
1194
775
|
return Promise.reject(e);
|
|
1195
776
|
}
|
|
1196
777
|
}
|
|
1197
778
|
/**
|
|
1198
|
-
*
|
|
779
|
+
* Deletes a file synchronously.
|
|
1199
780
|
*/
|
|
1200
781
|
}, {
|
|
1201
|
-
key: "
|
|
1202
|
-
value: function
|
|
782
|
+
key: "deleteFile",
|
|
783
|
+
value: function deleteFile(params) {
|
|
1203
784
|
try {
|
|
1204
785
|
var _this6 = this;
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
if (requestParameters.copyFileBatchRequest === null || requestParameters.copyFileBatchRequest === undefined) {
|
|
1209
|
-
throw new RequiredError("copyFileBatchRequest", "Required parameter requestParameters.copyFileBatchRequest was null or undefined when calling copyFileBatch.");
|
|
1210
|
-
}
|
|
1211
|
-
var queryParameters = {};
|
|
1212
|
-
var headerParameters = {};
|
|
1213
|
-
headerParameters["Content-Type"] = "application/json";
|
|
1214
|
-
if (_this6.configuration && _this6.configuration.apiKey) {
|
|
1215
|
-
headerParameters["Authorization"] = _this6.configuration.apiKey("Authorization"); // authorization-header authentication
|
|
786
|
+
var query = {};
|
|
787
|
+
if (params.filePath !== undefined) {
|
|
788
|
+
query["filePath"] = params.filePath;
|
|
1216
789
|
}
|
|
1217
|
-
|
|
1218
|
-
var operationBasePathOverride = [][0];
|
|
790
|
+
var headers = {};
|
|
1219
791
|
return FileApi_await(_this6.request({
|
|
1220
|
-
path: "/v2/accounts/{accountId}/files
|
|
792
|
+
path: "/v2/accounts/{accountId}/files".replace("{".concat("accountId", "}"),
|
|
1221
793
|
// @ts-ignore
|
|
1222
|
-
|
|
1223
|
-
method: "
|
|
1224
|
-
headers:
|
|
1225
|
-
query:
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
return new JSONApiResponse(response);
|
|
794
|
+
_this6.encodeParam("accountId", params.accountId)),
|
|
795
|
+
method: "DELETE",
|
|
796
|
+
headers: headers,
|
|
797
|
+
query: query
|
|
798
|
+
}, undefined, [][0]), function (response) {
|
|
799
|
+
return FileApi_await(new VoidApiResponse(response).value());
|
|
1229
800
|
});
|
|
1230
801
|
} catch (e) {
|
|
1231
802
|
return Promise.reject(e);
|
|
1232
803
|
}
|
|
1233
804
|
}
|
|
1234
805
|
/**
|
|
1235
|
-
*
|
|
806
|
+
* Deletes multiple files asynchronously.
|
|
1236
807
|
*/
|
|
1237
808
|
}, {
|
|
1238
|
-
key: "
|
|
1239
|
-
value: function
|
|
809
|
+
key: "deleteFileBatch",
|
|
810
|
+
value: function deleteFileBatch(params) {
|
|
1240
811
|
try {
|
|
1241
812
|
var _this8 = this;
|
|
1242
|
-
|
|
1243
|
-
|
|
813
|
+
var query = {};
|
|
814
|
+
var headers = {};
|
|
815
|
+
headers["Content-Type"] = "application/json";
|
|
816
|
+
return FileApi_await(_this8.request({
|
|
817
|
+
path: "/v2/accounts/{accountId}/files/batch".replace("{".concat("accountId", "}"),
|
|
818
|
+
// @ts-ignore
|
|
819
|
+
_this8.encodeParam("accountId", params.accountId)),
|
|
820
|
+
method: "DELETE",
|
|
821
|
+
headers: headers,
|
|
822
|
+
query: query,
|
|
823
|
+
body: params.deleteFileBatchRequest
|
|
824
|
+
}, undefined, [][0]), function (response) {
|
|
825
|
+
return FileApi_await(new JSONApiResponse(response).value());
|
|
1244
826
|
});
|
|
1245
827
|
} catch (e) {
|
|
1246
828
|
return Promise.reject(e);
|
|
1247
829
|
}
|
|
1248
830
|
}
|
|
1249
831
|
/**
|
|
1250
|
-
*
|
|
832
|
+
* Downloads a file in its original/unprocessed state.
|
|
1251
833
|
*/
|
|
1252
834
|
}, {
|
|
1253
|
-
key: "
|
|
1254
|
-
value: function
|
|
835
|
+
key: "downloadFile",
|
|
836
|
+
value: function downloadFile(params) {
|
|
1255
837
|
try {
|
|
1256
838
|
var _this10 = this;
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
if (requestParameters.filePath === null || requestParameters.filePath === undefined) {
|
|
1261
|
-
throw new RequiredError("filePath", "Required parameter requestParameters.filePath was null or undefined when calling deleteFile.");
|
|
839
|
+
var query = {};
|
|
840
|
+
if (params.cache !== undefined) {
|
|
841
|
+
query["cache"] = params.cache;
|
|
1262
842
|
}
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
queryParameters["filePath"] = requestParameters.filePath;
|
|
843
|
+
if (params.cacheTtl !== undefined) {
|
|
844
|
+
query["cache_ttl"] = params.cacheTtl;
|
|
1266
845
|
}
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
headerParameters["Authorization"] = _this10.configuration.apiKey("Authorization"); // authorization-header authentication
|
|
846
|
+
if (params.version !== undefined) {
|
|
847
|
+
query["version"] = params.version;
|
|
1270
848
|
}
|
|
1271
|
-
|
|
1272
|
-
var operationBasePathOverride = [][0];
|
|
849
|
+
var headers = {};
|
|
1273
850
|
return FileApi_await(_this10.request({
|
|
1274
|
-
path: "/v2/accounts/{accountId}/files".replace("{".concat("accountId", "}"),
|
|
1275
|
-
// @ts-ignore
|
|
1276
|
-
false ? 0 : encodeURIComponent(String(requestParameters.accountId))),
|
|
1277
|
-
method: "DELETE",
|
|
1278
|
-
headers: headerParameters,
|
|
1279
|
-
query: queryParameters
|
|
1280
|
-
}, initOverrides, operationBasePathOverride), function (response) {
|
|
1281
|
-
return new VoidApiResponse(response);
|
|
1282
|
-
});
|
|
1283
|
-
} catch (e) {
|
|
1284
|
-
return Promise.reject(e);
|
|
1285
|
-
}
|
|
1286
|
-
}
|
|
1287
|
-
/**
|
|
1288
|
-
* Deletes a file synchronously.
|
|
1289
|
-
*/
|
|
1290
|
-
}, {
|
|
1291
|
-
key: "deleteFile",
|
|
1292
|
-
value: function deleteFile(requestParameters, initOverrides) {
|
|
1293
|
-
try {
|
|
1294
|
-
var _this12 = this;
|
|
1295
|
-
return _awaitIgnored(_this12.deleteFileWithHttpInfo(requestParameters, initOverrides));
|
|
1296
|
-
} catch (e) {
|
|
1297
|
-
return Promise.reject(e);
|
|
1298
|
-
}
|
|
1299
|
-
}
|
|
1300
|
-
/**
|
|
1301
|
-
* Deletes multiple files asynchronously.
|
|
1302
|
-
*/
|
|
1303
|
-
}, {
|
|
1304
|
-
key: "deleteFileBatchWithHttpInfo",
|
|
1305
|
-
value: function deleteFileBatchWithHttpInfo(requestParameters, initOverrides) {
|
|
1306
|
-
try {
|
|
1307
|
-
var _this14 = this;
|
|
1308
|
-
if (requestParameters.accountId === null || requestParameters.accountId === undefined) {
|
|
1309
|
-
throw new RequiredError("accountId", "Required parameter requestParameters.accountId was null or undefined when calling deleteFileBatch.");
|
|
1310
|
-
}
|
|
1311
|
-
if (requestParameters.deleteFileBatchRequest === null || requestParameters.deleteFileBatchRequest === undefined) {
|
|
1312
|
-
throw new RequiredError("deleteFileBatchRequest", "Required parameter requestParameters.deleteFileBatchRequest was null or undefined when calling deleteFileBatch.");
|
|
1313
|
-
}
|
|
1314
|
-
var queryParameters = {};
|
|
1315
|
-
var headerParameters = {};
|
|
1316
|
-
headerParameters["Content-Type"] = "application/json";
|
|
1317
|
-
if (_this14.configuration && _this14.configuration.apiKey) {
|
|
1318
|
-
headerParameters["Authorization"] = _this14.configuration.apiKey("Authorization"); // authorization-header authentication
|
|
1319
|
-
}
|
|
1320
|
-
|
|
1321
|
-
var operationBasePathOverride = [][0];
|
|
1322
|
-
return FileApi_await(_this14.request({
|
|
1323
|
-
path: "/v2/accounts/{accountId}/files/batch".replace("{".concat("accountId", "}"),
|
|
1324
|
-
// @ts-ignore
|
|
1325
|
-
false ? 0 : encodeURIComponent(String(requestParameters.accountId))),
|
|
1326
|
-
method: "DELETE",
|
|
1327
|
-
headers: headerParameters,
|
|
1328
|
-
query: queryParameters,
|
|
1329
|
-
body: requestParameters.deleteFileBatchRequest
|
|
1330
|
-
}, initOverrides, operationBasePathOverride), function (response) {
|
|
1331
|
-
return new JSONApiResponse(response);
|
|
1332
|
-
});
|
|
1333
|
-
} catch (e) {
|
|
1334
|
-
return Promise.reject(e);
|
|
1335
|
-
}
|
|
1336
|
-
}
|
|
1337
|
-
/**
|
|
1338
|
-
* Deletes multiple files asynchronously.
|
|
1339
|
-
*/
|
|
1340
|
-
}, {
|
|
1341
|
-
key: "deleteFileBatch",
|
|
1342
|
-
value: function deleteFileBatch(requestParameters, initOverrides) {
|
|
1343
|
-
try {
|
|
1344
|
-
var _this16 = this;
|
|
1345
|
-
return FileApi_await(_this16.deleteFileBatchWithHttpInfo(requestParameters, initOverrides), function (response) {
|
|
1346
|
-
return FileApi_await(response.value());
|
|
1347
|
-
});
|
|
1348
|
-
} catch (e) {
|
|
1349
|
-
return Promise.reject(e);
|
|
1350
|
-
}
|
|
1351
|
-
}
|
|
1352
|
-
/**
|
|
1353
|
-
* Downloads a file in its original/unprocessed state.
|
|
1354
|
-
*/
|
|
1355
|
-
}, {
|
|
1356
|
-
key: "downloadFileWithHttpInfo",
|
|
1357
|
-
value: function downloadFileWithHttpInfo(requestParameters, initOverrides) {
|
|
1358
|
-
try {
|
|
1359
|
-
var _this18 = this;
|
|
1360
|
-
if (requestParameters.accountId === null || requestParameters.accountId === undefined) {
|
|
1361
|
-
throw new RequiredError("accountId", "Required parameter requestParameters.accountId was null or undefined when calling downloadFile.");
|
|
1362
|
-
}
|
|
1363
|
-
if (requestParameters.filePath === null || requestParameters.filePath === undefined) {
|
|
1364
|
-
throw new RequiredError("filePath", "Required parameter requestParameters.filePath was null or undefined when calling downloadFile.");
|
|
1365
|
-
}
|
|
1366
|
-
var queryParameters = {};
|
|
1367
|
-
if (requestParameters.cache !== undefined) {
|
|
1368
|
-
queryParameters["cache"] = requestParameters.cache;
|
|
1369
|
-
}
|
|
1370
|
-
if (requestParameters.cacheTtl !== undefined) {
|
|
1371
|
-
queryParameters["cache_ttl"] = requestParameters.cacheTtl;
|
|
1372
|
-
}
|
|
1373
|
-
if (requestParameters.version !== undefined) {
|
|
1374
|
-
queryParameters["version"] = requestParameters.version;
|
|
1375
|
-
}
|
|
1376
|
-
var headerParameters = {};
|
|
1377
|
-
if (_this18.configuration && _this18.configuration.apiKey) {
|
|
1378
|
-
headerParameters["Authorization"] = _this18.configuration.apiKey("Authorization"); // authorization-header authentication
|
|
1379
|
-
}
|
|
1380
|
-
|
|
1381
|
-
var operationBasePathOverride = ["https://upcdn.io"][0];
|
|
1382
|
-
return FileApi_await(_this18.request({
|
|
1383
851
|
path: "/{accountId}/raw{filePath}".replace("{".concat("accountId", "}"),
|
|
1384
852
|
// @ts-ignore
|
|
1385
|
-
|
|
853
|
+
_this10.encodeParam("accountId", params.accountId)).replace("{".concat("filePath", "}"),
|
|
1386
854
|
// @ts-ignore
|
|
1387
|
-
|
|
855
|
+
_this10.encodeParam("filePath", params.filePath)),
|
|
1388
856
|
method: "GET",
|
|
1389
|
-
headers:
|
|
1390
|
-
query:
|
|
1391
|
-
},
|
|
857
|
+
headers: headers,
|
|
858
|
+
query: query
|
|
859
|
+
}, undefined, ["https://upcdn.io"][0]), function (response) {
|
|
1392
860
|
return new BinaryResult(response);
|
|
1393
861
|
});
|
|
1394
862
|
} catch (e) {
|
|
1395
863
|
return Promise.reject(e);
|
|
1396
864
|
}
|
|
1397
865
|
}
|
|
1398
|
-
/**
|
|
1399
|
-
* Downloads a file in its original/unprocessed state.
|
|
1400
|
-
*/
|
|
1401
|
-
}, {
|
|
1402
|
-
key: "downloadFile",
|
|
1403
|
-
value: function downloadFile(requestParameters, initOverrides) {
|
|
1404
|
-
try {
|
|
1405
|
-
var _this20 = this;
|
|
1406
|
-
return FileApi_await(_this20.downloadFileWithHttpInfo(requestParameters, initOverrides));
|
|
1407
|
-
} catch (e) {
|
|
1408
|
-
return Promise.reject(e);
|
|
1409
|
-
}
|
|
1410
|
-
}
|
|
1411
866
|
/**
|
|
1412
867
|
* Gets the full details (e.g. metadata, tags, etc.) for a file.
|
|
1413
868
|
*/
|
|
1414
869
|
}, {
|
|
1415
|
-
key: "
|
|
1416
|
-
value: function
|
|
870
|
+
key: "getFileDetails",
|
|
871
|
+
value: function getFileDetails(params) {
|
|
1417
872
|
try {
|
|
1418
|
-
var
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
if (requestParameters.filePath === null || requestParameters.filePath === undefined) {
|
|
1423
|
-
throw new RequiredError("filePath", "Required parameter requestParameters.filePath was null or undefined when calling getFileDetails.");
|
|
1424
|
-
}
|
|
1425
|
-
var queryParameters = {};
|
|
1426
|
-
if (requestParameters.filePath !== undefined) {
|
|
1427
|
-
queryParameters["filePath"] = requestParameters.filePath;
|
|
1428
|
-
}
|
|
1429
|
-
var headerParameters = {};
|
|
1430
|
-
if (_this22.configuration && _this22.configuration.apiKey) {
|
|
1431
|
-
headerParameters["Authorization"] = _this22.configuration.apiKey("Authorization"); // authorization-header authentication
|
|
873
|
+
var _this12 = this;
|
|
874
|
+
var query = {};
|
|
875
|
+
if (params.filePath !== undefined) {
|
|
876
|
+
query["filePath"] = params.filePath;
|
|
1432
877
|
}
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
return FileApi_await(_this22.request({
|
|
878
|
+
var headers = {};
|
|
879
|
+
return FileApi_await(_this12.request({
|
|
1436
880
|
path: "/v2/accounts/{accountId}/files/details".replace("{".concat("accountId", "}"),
|
|
1437
881
|
// @ts-ignore
|
|
1438
|
-
|
|
882
|
+
_this12.encodeParam("accountId", params.accountId)),
|
|
1439
883
|
method: "GET",
|
|
1440
|
-
headers:
|
|
1441
|
-
query:
|
|
1442
|
-
},
|
|
1443
|
-
return new JSONApiResponse(response);
|
|
1444
|
-
});
|
|
1445
|
-
} catch (e) {
|
|
1446
|
-
return Promise.reject(e);
|
|
1447
|
-
}
|
|
1448
|
-
}
|
|
1449
|
-
/**
|
|
1450
|
-
* Gets the full details (e.g. metadata, tags, etc.) for a file.
|
|
1451
|
-
*/
|
|
1452
|
-
}, {
|
|
1453
|
-
key: "getFileDetails",
|
|
1454
|
-
value: function getFileDetails(requestParameters, initOverrides) {
|
|
1455
|
-
try {
|
|
1456
|
-
var _this24 = this;
|
|
1457
|
-
return FileApi_await(_this24.getFileDetailsWithHttpInfo(requestParameters, initOverrides), function (response) {
|
|
1458
|
-
return FileApi_await(response.value());
|
|
884
|
+
headers: headers,
|
|
885
|
+
query: query
|
|
886
|
+
}, undefined, [][0]), function (response) {
|
|
887
|
+
return FileApi_await(new JSONApiResponse(response).value());
|
|
1459
888
|
});
|
|
1460
889
|
} catch (e) {
|
|
1461
890
|
return Promise.reject(e);
|
|
@@ -1465,132 +894,73 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1465
894
|
* Processes a file and returns the result.
|
|
1466
895
|
*/
|
|
1467
896
|
}, {
|
|
1468
|
-
key: "
|
|
1469
|
-
value: function
|
|
897
|
+
key: "processFile",
|
|
898
|
+
value: function processFile(params) {
|
|
1470
899
|
try {
|
|
1471
|
-
var
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
if (requestParameters.filePath === null || requestParameters.filePath === undefined) {
|
|
1476
|
-
throw new RequiredError("filePath", "Required parameter requestParameters.filePath was null or undefined when calling processFile.");
|
|
1477
|
-
}
|
|
1478
|
-
if (requestParameters.transformation === null || requestParameters.transformation === undefined) {
|
|
1479
|
-
throw new RequiredError("transformation", "Required parameter requestParameters.transformation was null or undefined when calling processFile.");
|
|
1480
|
-
}
|
|
1481
|
-
var queryParameters = {};
|
|
1482
|
-
if (requestParameters.artifact !== undefined) {
|
|
1483
|
-
queryParameters["artifact"] = requestParameters.artifact;
|
|
1484
|
-
}
|
|
1485
|
-
if (requestParameters.cache !== undefined) {
|
|
1486
|
-
queryParameters["cache"] = requestParameters.cache;
|
|
900
|
+
var _this14 = this;
|
|
901
|
+
var query = {};
|
|
902
|
+
if (params.artifact !== undefined) {
|
|
903
|
+
query["artifact"] = params.artifact;
|
|
1487
904
|
}
|
|
1488
|
-
if (
|
|
1489
|
-
|
|
905
|
+
if (params.cache !== undefined) {
|
|
906
|
+
query["cache"] = params.cache;
|
|
1490
907
|
}
|
|
1491
|
-
if (
|
|
1492
|
-
|
|
908
|
+
if (params.cachePerm !== undefined) {
|
|
909
|
+
query["cache_perm"] = params.cachePerm;
|
|
1493
910
|
}
|
|
1494
|
-
if (
|
|
1495
|
-
|
|
911
|
+
if (params.cacheTtl !== undefined) {
|
|
912
|
+
query["cache_ttl"] = params.cacheTtl;
|
|
1496
913
|
}
|
|
1497
|
-
if (
|
|
1498
|
-
|
|
914
|
+
if (params.large !== undefined) {
|
|
915
|
+
query["large"] = params.large;
|
|
1499
916
|
}
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
headerParameters["Authorization"] = _this26.configuration.apiKey("Authorization"); // authorization-header authentication
|
|
917
|
+
if (params.version !== undefined) {
|
|
918
|
+
query["version"] = params.version;
|
|
1503
919
|
}
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
return FileApi_await(_this26.request({
|
|
920
|
+
var headers = {};
|
|
921
|
+
return FileApi_await(_this14.request({
|
|
1507
922
|
path: "/{accountId}/{transformation}{filePath}".replace("{".concat("accountId", "}"),
|
|
1508
923
|
// @ts-ignore
|
|
1509
|
-
|
|
924
|
+
_this14.encodeParam("accountId", params.accountId)).replace("{".concat("filePath", "}"),
|
|
1510
925
|
// @ts-ignore
|
|
1511
|
-
|
|
926
|
+
_this14.encodeParam("filePath", params.filePath)).replace("{".concat("transformation", "}"),
|
|
1512
927
|
// @ts-ignore
|
|
1513
|
-
|
|
928
|
+
_this14.encodeParam("transformation", params.transformation)),
|
|
1514
929
|
method: "GET",
|
|
1515
|
-
headers:
|
|
1516
|
-
query:
|
|
1517
|
-
},
|
|
930
|
+
headers: headers,
|
|
931
|
+
query: query
|
|
932
|
+
}, undefined, ["https://upcdn.io"][0]), function (response) {
|
|
1518
933
|
return new BinaryResult(response);
|
|
1519
934
|
});
|
|
1520
935
|
} catch (e) {
|
|
1521
936
|
return Promise.reject(e);
|
|
1522
937
|
}
|
|
1523
938
|
}
|
|
1524
|
-
/**
|
|
1525
|
-
* Processes a file and returns the result.
|
|
1526
|
-
*/
|
|
1527
|
-
}, {
|
|
1528
|
-
key: "processFile",
|
|
1529
|
-
value: function processFile(requestParameters, initOverrides) {
|
|
1530
|
-
try {
|
|
1531
|
-
var _this28 = this;
|
|
1532
|
-
return FileApi_await(_this28.processFileWithHttpInfo(requestParameters, initOverrides));
|
|
1533
|
-
} catch (e) {
|
|
1534
|
-
return Promise.reject(e);
|
|
1535
|
-
}
|
|
1536
|
-
}
|
|
1537
939
|
/**
|
|
1538
940
|
* Processes a file and saves the result.
|
|
1539
941
|
*/
|
|
1540
942
|
}, {
|
|
1541
|
-
key: "
|
|
1542
|
-
value: function
|
|
943
|
+
key: "processFileAndSave",
|
|
944
|
+
value: function processFileAndSave(params) {
|
|
1543
945
|
try {
|
|
1544
|
-
var
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
throw new RequiredError("filePath", "Required parameter requestParameters.filePath was null or undefined when calling processFileAndSave.");
|
|
1550
|
-
}
|
|
1551
|
-
if (requestParameters.transformation === null || requestParameters.transformation === undefined) {
|
|
1552
|
-
throw new RequiredError("transformation", "Required parameter requestParameters.transformation was null or undefined when calling processFileAndSave.");
|
|
1553
|
-
}
|
|
1554
|
-
if (requestParameters.processFileAndSaveRequest === null || requestParameters.processFileAndSaveRequest === undefined) {
|
|
1555
|
-
throw new RequiredError("processFileAndSaveRequest", "Required parameter requestParameters.processFileAndSaveRequest was null or undefined when calling processFileAndSave.");
|
|
1556
|
-
}
|
|
1557
|
-
var queryParameters = {};
|
|
1558
|
-
var headerParameters = {};
|
|
1559
|
-
headerParameters["Content-Type"] = "application/json";
|
|
1560
|
-
if (_this30.configuration && _this30.configuration.apiKey) {
|
|
1561
|
-
headerParameters["Authorization"] = _this30.configuration.apiKey("Authorization"); // authorization-header authentication
|
|
1562
|
-
}
|
|
1563
|
-
|
|
1564
|
-
var operationBasePathOverride = ["https://upcdn.io"][0];
|
|
1565
|
-
return FileApi_await(_this30.request({
|
|
946
|
+
var _this16 = this;
|
|
947
|
+
var query = {};
|
|
948
|
+
var headers = {};
|
|
949
|
+
headers["Content-Type"] = "application/json";
|
|
950
|
+
return FileApi_await(_this16.request({
|
|
1566
951
|
path: "/{accountId}/save/{transformation}{filePath}".replace("{".concat("accountId", "}"),
|
|
1567
952
|
// @ts-ignore
|
|
1568
|
-
|
|
953
|
+
_this16.encodeParam("accountId", params.accountId)).replace("{".concat("filePath", "}"),
|
|
1569
954
|
// @ts-ignore
|
|
1570
|
-
|
|
955
|
+
_this16.encodeParam("filePath", params.filePath)).replace("{".concat("transformation", "}"),
|
|
1571
956
|
// @ts-ignore
|
|
1572
|
-
|
|
957
|
+
_this16.encodeParam("transformation", params.transformation)),
|
|
1573
958
|
method: "POST",
|
|
1574
|
-
headers:
|
|
1575
|
-
query:
|
|
1576
|
-
body:
|
|
1577
|
-
},
|
|
1578
|
-
return new JSONApiResponse(response);
|
|
1579
|
-
});
|
|
1580
|
-
} catch (e) {
|
|
1581
|
-
return Promise.reject(e);
|
|
1582
|
-
}
|
|
1583
|
-
}
|
|
1584
|
-
/**
|
|
1585
|
-
* Processes a file and saves the result.
|
|
1586
|
-
*/
|
|
1587
|
-
}, {
|
|
1588
|
-
key: "processFileAndSave",
|
|
1589
|
-
value: function processFileAndSave(requestParameters, initOverrides) {
|
|
1590
|
-
try {
|
|
1591
|
-
var _this32 = this;
|
|
1592
|
-
return FileApi_await(_this32.processFileAndSaveWithHttpInfo(requestParameters, initOverrides), function (response) {
|
|
1593
|
-
return FileApi_await(response.value());
|
|
959
|
+
headers: headers,
|
|
960
|
+
query: query,
|
|
961
|
+
body: params.processFileAndSaveRequest
|
|
962
|
+
}, undefined, ["https://upcdn.io"][0]), function (response) {
|
|
963
|
+
return FileApi_await(new JSONApiResponse(response).value());
|
|
1594
964
|
});
|
|
1595
965
|
} catch (e) {
|
|
1596
966
|
return Promise.reject(e);
|
|
@@ -1599,15 +969,7 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1599
969
|
}]);
|
|
1600
970
|
return FileApi;
|
|
1601
971
|
}(BaseAPI);
|
|
1602
|
-
|
|
1603
|
-
* @export
|
|
1604
|
-
*/
|
|
1605
|
-
var ProcessFileCachePermEnum = {
|
|
1606
|
-
Auto: "auto",
|
|
1607
|
-
False: "false",
|
|
1608
|
-
True: "true"
|
|
1609
|
-
};
|
|
1610
|
-
;// CONCATENATED MODULE: ./src/gen/apis/FolderApi.ts
|
|
972
|
+
;// CONCATENATED MODULE: ./src/generated/apis/FolderApi.ts
|
|
1611
973
|
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); }
|
|
1612
974
|
function FolderApi_await(value, then, direct) {
|
|
1613
975
|
if (direct) {
|
|
@@ -1633,7 +995,7 @@ function FolderApi_getPrototypeOf(o) { FolderApi_getPrototypeOf = Object.setProt
|
|
|
1633
995
|
/* tslint:disable */
|
|
1634
996
|
/* eslint-disable */
|
|
1635
997
|
/**
|
|
1636
|
-
* @bytescale/
|
|
998
|
+
* @bytescale/api
|
|
1637
999
|
* Bytescale API
|
|
1638
1000
|
*
|
|
1639
1001
|
* The version of the OpenAPI document: 2.0.0
|
|
@@ -1656,53 +1018,27 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1656
1018
|
return _super.apply(this, arguments);
|
|
1657
1019
|
}
|
|
1658
1020
|
FolderApi_createClass(FolderApi, [{
|
|
1659
|
-
key: "
|
|
1021
|
+
key: "copyFolder",
|
|
1660
1022
|
value:
|
|
1661
1023
|
/**
|
|
1662
1024
|
* 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.
|
|
1663
1025
|
*/
|
|
1664
|
-
function
|
|
1026
|
+
function copyFolder(params) {
|
|
1665
1027
|
try {
|
|
1666
1028
|
var _this2 = this;
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
if (requestParameters.copyFolderRequest === null || requestParameters.copyFolderRequest === undefined) {
|
|
1671
|
-
throw new RequiredError("copyFolderRequest", "Required parameter requestParameters.copyFolderRequest was null or undefined when calling copyFolder.");
|
|
1672
|
-
}
|
|
1673
|
-
var queryParameters = {};
|
|
1674
|
-
var headerParameters = {};
|
|
1675
|
-
headerParameters["Content-Type"] = "application/json";
|
|
1676
|
-
if (_this2.configuration && _this2.configuration.apiKey) {
|
|
1677
|
-
headerParameters["Authorization"] = _this2.configuration.apiKey("Authorization"); // authorization-header authentication
|
|
1678
|
-
}
|
|
1679
|
-
|
|
1680
|
-
var operationBasePathOverride = [][0];
|
|
1029
|
+
var query = {};
|
|
1030
|
+
var headers = {};
|
|
1031
|
+
headers["Content-Type"] = "application/json";
|
|
1681
1032
|
return FolderApi_await(_this2.request({
|
|
1682
1033
|
path: "/v2/accounts/{accountId}/folders/copy".replace("{".concat("accountId", "}"),
|
|
1683
1034
|
// @ts-ignore
|
|
1684
|
-
|
|
1035
|
+
_this2.encodeParam("accountId", params.accountId)),
|
|
1685
1036
|
method: "POST",
|
|
1686
|
-
headers:
|
|
1687
|
-
query:
|
|
1688
|
-
body:
|
|
1689
|
-
},
|
|
1690
|
-
return new JSONApiResponse(response);
|
|
1691
|
-
});
|
|
1692
|
-
} catch (e) {
|
|
1693
|
-
return Promise.reject(e);
|
|
1694
|
-
}
|
|
1695
|
-
}
|
|
1696
|
-
/**
|
|
1697
|
-
* 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.
|
|
1698
|
-
*/
|
|
1699
|
-
}, {
|
|
1700
|
-
key: "copyFolder",
|
|
1701
|
-
value: function copyFolder(requestParameters, initOverrides) {
|
|
1702
|
-
try {
|
|
1703
|
-
var _this4 = this;
|
|
1704
|
-
return FolderApi_await(_this4.copyFolderWithHttpInfo(requestParameters, initOverrides), function (response) {
|
|
1705
|
-
return FolderApi_await(response.value());
|
|
1037
|
+
headers: headers,
|
|
1038
|
+
query: query,
|
|
1039
|
+
body: params.copyFolderRequest
|
|
1040
|
+
}, undefined, [][0]), function (response) {
|
|
1041
|
+
return FolderApi_await(new JSONApiResponse(response).value());
|
|
1706
1042
|
});
|
|
1707
1043
|
} catch (e) {
|
|
1708
1044
|
return Promise.reject(e);
|
|
@@ -1712,49 +1048,23 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1712
1048
|
* 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.
|
|
1713
1049
|
*/
|
|
1714
1050
|
}, {
|
|
1715
|
-
key: "
|
|
1716
|
-
value: function
|
|
1051
|
+
key: "copyFolderBatch",
|
|
1052
|
+
value: function copyFolderBatch(params) {
|
|
1717
1053
|
try {
|
|
1718
|
-
var
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
throw new RequiredError("copyFolderBatchRequest", "Required parameter requestParameters.copyFolderBatchRequest was null or undefined when calling copyFolderBatch.");
|
|
1724
|
-
}
|
|
1725
|
-
var queryParameters = {};
|
|
1726
|
-
var headerParameters = {};
|
|
1727
|
-
headerParameters["Content-Type"] = "application/json";
|
|
1728
|
-
if (_this6.configuration && _this6.configuration.apiKey) {
|
|
1729
|
-
headerParameters["Authorization"] = _this6.configuration.apiKey("Authorization"); // authorization-header authentication
|
|
1730
|
-
}
|
|
1731
|
-
|
|
1732
|
-
var operationBasePathOverride = [][0];
|
|
1733
|
-
return FolderApi_await(_this6.request({
|
|
1054
|
+
var _this4 = this;
|
|
1055
|
+
var query = {};
|
|
1056
|
+
var headers = {};
|
|
1057
|
+
headers["Content-Type"] = "application/json";
|
|
1058
|
+
return FolderApi_await(_this4.request({
|
|
1734
1059
|
path: "/v2/accounts/{accountId}/folders/copy/batch".replace("{".concat("accountId", "}"),
|
|
1735
1060
|
// @ts-ignore
|
|
1736
|
-
|
|
1061
|
+
_this4.encodeParam("accountId", params.accountId)),
|
|
1737
1062
|
method: "POST",
|
|
1738
|
-
headers:
|
|
1739
|
-
query:
|
|
1740
|
-
body:
|
|
1741
|
-
},
|
|
1742
|
-
return new JSONApiResponse(response);
|
|
1743
|
-
});
|
|
1744
|
-
} catch (e) {
|
|
1745
|
-
return Promise.reject(e);
|
|
1746
|
-
}
|
|
1747
|
-
}
|
|
1748
|
-
/**
|
|
1749
|
-
* 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.
|
|
1750
|
-
*/
|
|
1751
|
-
}, {
|
|
1752
|
-
key: "copyFolderBatch",
|
|
1753
|
-
value: function copyFolderBatch(requestParameters, initOverrides) {
|
|
1754
|
-
try {
|
|
1755
|
-
var _this8 = this;
|
|
1756
|
-
return FolderApi_await(_this8.copyFolderBatchWithHttpInfo(requestParameters, initOverrides), function (response) {
|
|
1757
|
-
return FolderApi_await(response.value());
|
|
1063
|
+
headers: headers,
|
|
1064
|
+
query: query,
|
|
1065
|
+
body: params.copyFolderBatchRequest
|
|
1066
|
+
}, undefined, [][0]), function (response) {
|
|
1067
|
+
return FolderApi_await(new JSONApiResponse(response).value());
|
|
1758
1068
|
});
|
|
1759
1069
|
} catch (e) {
|
|
1760
1070
|
return Promise.reject(e);
|
|
@@ -1764,49 +1074,23 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1764
1074
|
* 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.
|
|
1765
1075
|
*/
|
|
1766
1076
|
}, {
|
|
1767
|
-
key: "
|
|
1768
|
-
value: function
|
|
1077
|
+
key: "deleteFolder",
|
|
1078
|
+
value: function deleteFolder(params) {
|
|
1769
1079
|
try {
|
|
1770
|
-
var
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
throw new RequiredError("deleteFolderRequest", "Required parameter requestParameters.deleteFolderRequest was null or undefined when calling deleteFolder.");
|
|
1776
|
-
}
|
|
1777
|
-
var queryParameters = {};
|
|
1778
|
-
var headerParameters = {};
|
|
1779
|
-
headerParameters["Content-Type"] = "application/json";
|
|
1780
|
-
if (_this10.configuration && _this10.configuration.apiKey) {
|
|
1781
|
-
headerParameters["Authorization"] = _this10.configuration.apiKey("Authorization"); // authorization-header authentication
|
|
1782
|
-
}
|
|
1783
|
-
|
|
1784
|
-
var operationBasePathOverride = [][0];
|
|
1785
|
-
return FolderApi_await(_this10.request({
|
|
1080
|
+
var _this6 = this;
|
|
1081
|
+
var query = {};
|
|
1082
|
+
var headers = {};
|
|
1083
|
+
headers["Content-Type"] = "application/json";
|
|
1084
|
+
return FolderApi_await(_this6.request({
|
|
1786
1085
|
path: "/v2/accounts/{accountId}/folders".replace("{".concat("accountId", "}"),
|
|
1787
1086
|
// @ts-ignore
|
|
1788
|
-
|
|
1087
|
+
_this6.encodeParam("accountId", params.accountId)),
|
|
1789
1088
|
method: "DELETE",
|
|
1790
|
-
headers:
|
|
1791
|
-
query:
|
|
1792
|
-
body:
|
|
1793
|
-
},
|
|
1794
|
-
return new JSONApiResponse(response);
|
|
1795
|
-
});
|
|
1796
|
-
} catch (e) {
|
|
1797
|
-
return Promise.reject(e);
|
|
1798
|
-
}
|
|
1799
|
-
}
|
|
1800
|
-
/**
|
|
1801
|
-
* 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.
|
|
1802
|
-
*/
|
|
1803
|
-
}, {
|
|
1804
|
-
key: "deleteFolder",
|
|
1805
|
-
value: function deleteFolder(requestParameters, initOverrides) {
|
|
1806
|
-
try {
|
|
1807
|
-
var _this12 = this;
|
|
1808
|
-
return FolderApi_await(_this12.deleteFolderWithHttpInfo(requestParameters, initOverrides), function (response) {
|
|
1809
|
-
return FolderApi_await(response.value());
|
|
1089
|
+
headers: headers,
|
|
1090
|
+
query: query,
|
|
1091
|
+
body: params.deleteFolderRequest
|
|
1092
|
+
}, undefined, [][0]), function (response) {
|
|
1093
|
+
return FolderApi_await(new JSONApiResponse(response).value());
|
|
1810
1094
|
});
|
|
1811
1095
|
} catch (e) {
|
|
1812
1096
|
return Promise.reject(e);
|
|
@@ -1816,49 +1100,23 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1816
1100
|
* 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.
|
|
1817
1101
|
*/
|
|
1818
1102
|
}, {
|
|
1819
|
-
key: "
|
|
1820
|
-
value: function
|
|
1103
|
+
key: "deleteFolderBatch",
|
|
1104
|
+
value: function deleteFolderBatch(params) {
|
|
1821
1105
|
try {
|
|
1822
|
-
var
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
throw new RequiredError("deleteFolderBatchRequest", "Required parameter requestParameters.deleteFolderBatchRequest was null or undefined when calling deleteFolderBatch.");
|
|
1828
|
-
}
|
|
1829
|
-
var queryParameters = {};
|
|
1830
|
-
var headerParameters = {};
|
|
1831
|
-
headerParameters["Content-Type"] = "application/json";
|
|
1832
|
-
if (_this14.configuration && _this14.configuration.apiKey) {
|
|
1833
|
-
headerParameters["Authorization"] = _this14.configuration.apiKey("Authorization"); // authorization-header authentication
|
|
1834
|
-
}
|
|
1835
|
-
|
|
1836
|
-
var operationBasePathOverride = [][0];
|
|
1837
|
-
return FolderApi_await(_this14.request({
|
|
1106
|
+
var _this8 = this;
|
|
1107
|
+
var query = {};
|
|
1108
|
+
var headers = {};
|
|
1109
|
+
headers["Content-Type"] = "application/json";
|
|
1110
|
+
return FolderApi_await(_this8.request({
|
|
1838
1111
|
path: "/v2/accounts/{accountId}/folders/batch".replace("{".concat("accountId", "}"),
|
|
1839
1112
|
// @ts-ignore
|
|
1840
|
-
|
|
1113
|
+
_this8.encodeParam("accountId", params.accountId)),
|
|
1841
1114
|
method: "DELETE",
|
|
1842
|
-
headers:
|
|
1843
|
-
query:
|
|
1844
|
-
body:
|
|
1845
|
-
},
|
|
1846
|
-
return new JSONApiResponse(response);
|
|
1847
|
-
});
|
|
1848
|
-
} catch (e) {
|
|
1849
|
-
return Promise.reject(e);
|
|
1850
|
-
}
|
|
1851
|
-
}
|
|
1852
|
-
/**
|
|
1853
|
-
* 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.
|
|
1854
|
-
*/
|
|
1855
|
-
}, {
|
|
1856
|
-
key: "deleteFolderBatch",
|
|
1857
|
-
value: function deleteFolderBatch(requestParameters, initOverrides) {
|
|
1858
|
-
try {
|
|
1859
|
-
var _this16 = this;
|
|
1860
|
-
return FolderApi_await(_this16.deleteFolderBatchWithHttpInfo(requestParameters, initOverrides), function (response) {
|
|
1861
|
-
return FolderApi_await(response.value());
|
|
1115
|
+
headers: headers,
|
|
1116
|
+
query: query,
|
|
1117
|
+
body: params.deleteFolderBatchRequest
|
|
1118
|
+
}, undefined, [][0]), function (response) {
|
|
1119
|
+
return FolderApi_await(new JSONApiResponse(response).value());
|
|
1862
1120
|
});
|
|
1863
1121
|
} catch (e) {
|
|
1864
1122
|
return Promise.reject(e);
|
|
@@ -1868,50 +1126,24 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1868
1126
|
* 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.
|
|
1869
1127
|
*/
|
|
1870
1128
|
}, {
|
|
1871
|
-
key: "
|
|
1872
|
-
value: function
|
|
1129
|
+
key: "getFolderDetails",
|
|
1130
|
+
value: function getFolderDetails(params) {
|
|
1873
1131
|
try {
|
|
1874
|
-
var
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
if (requestParameters.folderPath === null || requestParameters.folderPath === undefined) {
|
|
1879
|
-
throw new RequiredError("folderPath", "Required parameter requestParameters.folderPath was null or undefined when calling getFolderDetails.");
|
|
1880
|
-
}
|
|
1881
|
-
var queryParameters = {};
|
|
1882
|
-
if (requestParameters.folderPath !== undefined) {
|
|
1883
|
-
queryParameters["folderPath"] = requestParameters.folderPath;
|
|
1884
|
-
}
|
|
1885
|
-
var headerParameters = {};
|
|
1886
|
-
if (_this18.configuration && _this18.configuration.apiKey) {
|
|
1887
|
-
headerParameters["Authorization"] = _this18.configuration.apiKey("Authorization"); // authorization-header authentication
|
|
1132
|
+
var _this10 = this;
|
|
1133
|
+
var query = {};
|
|
1134
|
+
if (params.folderPath !== undefined) {
|
|
1135
|
+
query["folderPath"] = params.folderPath;
|
|
1888
1136
|
}
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
return FolderApi_await(_this18.request({
|
|
1137
|
+
var headers = {};
|
|
1138
|
+
return FolderApi_await(_this10.request({
|
|
1892
1139
|
path: "/v2/accounts/{accountId}/folders".replace("{".concat("accountId", "}"),
|
|
1893
1140
|
// @ts-ignore
|
|
1894
|
-
|
|
1141
|
+
_this10.encodeParam("accountId", params.accountId)),
|
|
1895
1142
|
method: "GET",
|
|
1896
|
-
headers:
|
|
1897
|
-
query:
|
|
1898
|
-
},
|
|
1899
|
-
return new JSONApiResponse(response);
|
|
1900
|
-
});
|
|
1901
|
-
} catch (e) {
|
|
1902
|
-
return Promise.reject(e);
|
|
1903
|
-
}
|
|
1904
|
-
}
|
|
1905
|
-
/**
|
|
1906
|
-
* 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.
|
|
1907
|
-
*/
|
|
1908
|
-
}, {
|
|
1909
|
-
key: "getFolderDetails",
|
|
1910
|
-
value: function getFolderDetails(requestParameters, initOverrides) {
|
|
1911
|
-
try {
|
|
1912
|
-
var _this20 = this;
|
|
1913
|
-
return FolderApi_await(_this20.getFolderDetailsWithHttpInfo(requestParameters, initOverrides), function (response) {
|
|
1914
|
-
return FolderApi_await(response.value());
|
|
1143
|
+
headers: headers,
|
|
1144
|
+
query: query
|
|
1145
|
+
}, undefined, [][0]), function (response) {
|
|
1146
|
+
return FolderApi_await(new JSONApiResponse(response).value());
|
|
1915
1147
|
});
|
|
1916
1148
|
} catch (e) {
|
|
1917
1149
|
return Promise.reject(e);
|
|
@@ -1921,74 +1153,48 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1921
1153
|
* 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`.
|
|
1922
1154
|
*/
|
|
1923
1155
|
}, {
|
|
1924
|
-
key: "
|
|
1925
|
-
value: function
|
|
1156
|
+
key: "listFolder",
|
|
1157
|
+
value: function listFolder(params) {
|
|
1926
1158
|
try {
|
|
1927
|
-
var
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
if (requestParameters.folderPath === null || requestParameters.folderPath === undefined) {
|
|
1932
|
-
throw new RequiredError("folderPath", "Required parameter requestParameters.folderPath was null or undefined when calling listFolder.");
|
|
1933
|
-
}
|
|
1934
|
-
var queryParameters = {};
|
|
1935
|
-
if (requestParameters.cursor !== undefined) {
|
|
1936
|
-
queryParameters["cursor"] = requestParameters.cursor;
|
|
1937
|
-
}
|
|
1938
|
-
if (requestParameters.dryRun !== undefined) {
|
|
1939
|
-
queryParameters["dryRun"] = requestParameters.dryRun;
|
|
1159
|
+
var _this12 = this;
|
|
1160
|
+
var query = {};
|
|
1161
|
+
if (params.cursor !== undefined) {
|
|
1162
|
+
query["cursor"] = params.cursor;
|
|
1940
1163
|
}
|
|
1941
|
-
if (
|
|
1942
|
-
|
|
1164
|
+
if (params.dryRun !== undefined) {
|
|
1165
|
+
query["dryRun"] = params.dryRun;
|
|
1943
1166
|
}
|
|
1944
|
-
if (
|
|
1945
|
-
|
|
1167
|
+
if (params.folderPath !== undefined) {
|
|
1168
|
+
query["folderPath"] = params.folderPath;
|
|
1946
1169
|
}
|
|
1947
|
-
if (
|
|
1948
|
-
|
|
1170
|
+
if (params.includeFiles !== undefined) {
|
|
1171
|
+
query["includeFiles"] = params.includeFiles;
|
|
1949
1172
|
}
|
|
1950
|
-
if (
|
|
1951
|
-
|
|
1173
|
+
if (params.includeOverriddenStorage !== undefined) {
|
|
1174
|
+
query["includeOverriddenStorage"] = params.includeOverriddenStorage;
|
|
1952
1175
|
}
|
|
1953
|
-
if (
|
|
1954
|
-
|
|
1176
|
+
if (params.includePhysicalFolders !== undefined) {
|
|
1177
|
+
query["includePhysicalFolders"] = params.includePhysicalFolders;
|
|
1955
1178
|
}
|
|
1956
|
-
if (
|
|
1957
|
-
|
|
1179
|
+
if (params.includeVirtualFolders !== undefined) {
|
|
1180
|
+
query["includeVirtualFolders"] = params.includeVirtualFolders;
|
|
1958
1181
|
}
|
|
1959
|
-
if (
|
|
1960
|
-
|
|
1182
|
+
if (params.limit !== undefined) {
|
|
1183
|
+
query["limit"] = params.limit;
|
|
1961
1184
|
}
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
headerParameters["Authorization"] = _this22.configuration.apiKey("Authorization"); // authorization-header authentication
|
|
1185
|
+
if (params.recursive !== undefined) {
|
|
1186
|
+
query["recursive"] = params.recursive;
|
|
1965
1187
|
}
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
return FolderApi_await(_this22.request({
|
|
1188
|
+
var headers = {};
|
|
1189
|
+
return FolderApi_await(_this12.request({
|
|
1969
1190
|
path: "/v2/accounts/{accountId}/folders/list".replace("{".concat("accountId", "}"),
|
|
1970
1191
|
// @ts-ignore
|
|
1971
|
-
|
|
1192
|
+
_this12.encodeParam("accountId", params.accountId)),
|
|
1972
1193
|
method: "GET",
|
|
1973
|
-
headers:
|
|
1974
|
-
query:
|
|
1975
|
-
},
|
|
1976
|
-
return new JSONApiResponse(response);
|
|
1977
|
-
});
|
|
1978
|
-
} catch (e) {
|
|
1979
|
-
return Promise.reject(e);
|
|
1980
|
-
}
|
|
1981
|
-
}
|
|
1982
|
-
/**
|
|
1983
|
-
* 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`.
|
|
1984
|
-
*/
|
|
1985
|
-
}, {
|
|
1986
|
-
key: "listFolder",
|
|
1987
|
-
value: function listFolder(requestParameters, initOverrides) {
|
|
1988
|
-
try {
|
|
1989
|
-
var _this24 = this;
|
|
1990
|
-
return FolderApi_await(_this24.listFolderWithHttpInfo(requestParameters, initOverrides), function (response) {
|
|
1991
|
-
return FolderApi_await(response.value());
|
|
1194
|
+
headers: headers,
|
|
1195
|
+
query: query
|
|
1196
|
+
}, undefined, [][0]), function (response) {
|
|
1197
|
+
return FolderApi_await(new JSONApiResponse(response).value());
|
|
1992
1198
|
});
|
|
1993
1199
|
} catch (e) {
|
|
1994
1200
|
return Promise.reject(e);
|
|
@@ -1998,49 +1204,23 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1998
1204
|
* 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.
|
|
1999
1205
|
*/
|
|
2000
1206
|
}, {
|
|
2001
|
-
key: "
|
|
2002
|
-
value: function
|
|
1207
|
+
key: "putFolder",
|
|
1208
|
+
value: function putFolder(params) {
|
|
2003
1209
|
try {
|
|
2004
|
-
var
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
throw new RequiredError("putFolderRequest", "Required parameter requestParameters.putFolderRequest was null or undefined when calling putFolder.");
|
|
2010
|
-
}
|
|
2011
|
-
var queryParameters = {};
|
|
2012
|
-
var headerParameters = {};
|
|
2013
|
-
headerParameters["Content-Type"] = "application/json";
|
|
2014
|
-
if (_this26.configuration && _this26.configuration.apiKey) {
|
|
2015
|
-
headerParameters["Authorization"] = _this26.configuration.apiKey("Authorization"); // authorization-header authentication
|
|
2016
|
-
}
|
|
2017
|
-
|
|
2018
|
-
var operationBasePathOverride = [][0];
|
|
2019
|
-
return FolderApi_await(_this26.request({
|
|
1210
|
+
var _this14 = this;
|
|
1211
|
+
var query = {};
|
|
1212
|
+
var headers = {};
|
|
1213
|
+
headers["Content-Type"] = "application/json";
|
|
1214
|
+
return FolderApi_await(_this14.request({
|
|
2020
1215
|
path: "/v2/accounts/{accountId}/folders".replace("{".concat("accountId", "}"),
|
|
2021
1216
|
// @ts-ignore
|
|
2022
|
-
|
|
1217
|
+
_this14.encodeParam("accountId", params.accountId)),
|
|
2023
1218
|
method: "PUT",
|
|
2024
|
-
headers:
|
|
2025
|
-
query:
|
|
2026
|
-
body:
|
|
2027
|
-
},
|
|
2028
|
-
return new JSONApiResponse(response);
|
|
2029
|
-
});
|
|
2030
|
-
} catch (e) {
|
|
2031
|
-
return Promise.reject(e);
|
|
2032
|
-
}
|
|
2033
|
-
}
|
|
2034
|
-
/**
|
|
2035
|
-
* 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.
|
|
2036
|
-
*/
|
|
2037
|
-
}, {
|
|
2038
|
-
key: "putFolder",
|
|
2039
|
-
value: function putFolder(requestParameters, initOverrides) {
|
|
2040
|
-
try {
|
|
2041
|
-
var _this28 = this;
|
|
2042
|
-
return FolderApi_await(_this28.putFolderWithHttpInfo(requestParameters, initOverrides), function (response) {
|
|
2043
|
-
return FolderApi_await(response.value());
|
|
1219
|
+
headers: headers,
|
|
1220
|
+
query: query,
|
|
1221
|
+
body: params.putFolderRequest
|
|
1222
|
+
}, undefined, [][0]), function (response) {
|
|
1223
|
+
return FolderApi_await(new JSONApiResponse(response).value());
|
|
2044
1224
|
});
|
|
2045
1225
|
} catch (e) {
|
|
2046
1226
|
return Promise.reject(e);
|
|
@@ -2049,7 +1229,7 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
2049
1229
|
}]);
|
|
2050
1230
|
return FolderApi;
|
|
2051
1231
|
}(BaseAPI);
|
|
2052
|
-
;// CONCATENATED MODULE: ./src/
|
|
1232
|
+
;// CONCATENATED MODULE: ./src/generated/apis/JobApi.ts
|
|
2053
1233
|
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); }
|
|
2054
1234
|
function JobApi_await(value, then, direct) {
|
|
2055
1235
|
if (direct) {
|
|
@@ -2060,12 +1240,6 @@ function JobApi_await(value, then, direct) {
|
|
|
2060
1240
|
}
|
|
2061
1241
|
return then ? value.then(then) : value;
|
|
2062
1242
|
}
|
|
2063
|
-
function JobApi_empty() {}
|
|
2064
|
-
function JobApi_awaitIgnored(value, direct) {
|
|
2065
|
-
if (!direct) {
|
|
2066
|
-
return value && value.then ? value.then(JobApi_empty) : Promise.resolve();
|
|
2067
|
-
}
|
|
2068
|
-
}
|
|
2069
1243
|
function JobApi_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2070
1244
|
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); } }
|
|
2071
1245
|
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; }
|
|
@@ -2081,7 +1255,7 @@ function JobApi_getPrototypeOf(o) { JobApi_getPrototypeOf = Object.setPrototypeO
|
|
|
2081
1255
|
/* tslint:disable */
|
|
2082
1256
|
/* eslint-disable */
|
|
2083
1257
|
/**
|
|
2084
|
-
* @bytescale/
|
|
1258
|
+
* @bytescale/api
|
|
2085
1259
|
* Bytescale API
|
|
2086
1260
|
*
|
|
2087
1261
|
* The version of the OpenAPI document: 2.0.0
|
|
@@ -2104,98 +1278,29 @@ var JobApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
2104
1278
|
return _super.apply(this, arguments);
|
|
2105
1279
|
}
|
|
2106
1280
|
JobApi_createClass(JobApi, [{
|
|
2107
|
-
key: "cancelJobWithHttpInfo",
|
|
2108
|
-
value:
|
|
2109
|
-
/**
|
|
2110
|
-
* Cancels an in-progress background job. Requires a `secret_*` API key.
|
|
2111
|
-
*/
|
|
2112
|
-
function cancelJobWithHttpInfo(requestParameters, initOverrides) {
|
|
2113
|
-
try {
|
|
2114
|
-
var _this2 = this;
|
|
2115
|
-
if (requestParameters.accountId === null || requestParameters.accountId === undefined) {
|
|
2116
|
-
throw new RequiredError("accountId", "Required parameter requestParameters.accountId was null or undefined when calling cancelJob.");
|
|
2117
|
-
}
|
|
2118
|
-
if (requestParameters.jobId === null || requestParameters.jobId === undefined) {
|
|
2119
|
-
throw new RequiredError("jobId", "Required parameter requestParameters.jobId was null or undefined when calling cancelJob.");
|
|
2120
|
-
}
|
|
2121
|
-
if (requestParameters.jobType === null || requestParameters.jobType === undefined) {
|
|
2122
|
-
throw new RequiredError("jobType", "Required parameter requestParameters.jobType was null or undefined when calling cancelJob.");
|
|
2123
|
-
}
|
|
2124
|
-
var queryParameters = {};
|
|
2125
|
-
var headerParameters = {};
|
|
2126
|
-
if (_this2.configuration && _this2.configuration.apiKey) {
|
|
2127
|
-
headerParameters["Authorization"] = _this2.configuration.apiKey("Authorization"); // authorization-header authentication
|
|
2128
|
-
}
|
|
2129
|
-
|
|
2130
|
-
var operationBasePathOverride = [][0];
|
|
2131
|
-
return JobApi_await(_this2.request({
|
|
2132
|
-
path: "/v2/accounts/{accountId}/jobs/{jobType}/{jobId}".replace("{".concat("accountId", "}"),
|
|
2133
|
-
// @ts-ignore
|
|
2134
|
-
false ? 0 : encodeURIComponent(String(requestParameters.accountId))).replace("{".concat("jobId", "}"),
|
|
2135
|
-
// @ts-ignore
|
|
2136
|
-
false ? 0 : encodeURIComponent(String(requestParameters.jobId))).replace("{".concat("jobType", "}"),
|
|
2137
|
-
// @ts-ignore
|
|
2138
|
-
false ? 0 : encodeURIComponent(String(requestParameters.jobType))),
|
|
2139
|
-
method: "DELETE",
|
|
2140
|
-
headers: headerParameters,
|
|
2141
|
-
query: queryParameters
|
|
2142
|
-
}, initOverrides, operationBasePathOverride), function (response) {
|
|
2143
|
-
return new VoidApiResponse(response);
|
|
2144
|
-
});
|
|
2145
|
-
} catch (e) {
|
|
2146
|
-
return Promise.reject(e);
|
|
2147
|
-
}
|
|
2148
|
-
}
|
|
2149
|
-
/**
|
|
2150
|
-
* Cancels an in-progress background job. Requires a `secret_*` API key.
|
|
2151
|
-
*/
|
|
2152
|
-
}, {
|
|
2153
1281
|
key: "cancelJob",
|
|
2154
|
-
value:
|
|
2155
|
-
try {
|
|
2156
|
-
var _this4 = this;
|
|
2157
|
-
return JobApi_awaitIgnored(_this4.cancelJobWithHttpInfo(requestParameters, initOverrides));
|
|
2158
|
-
} catch (e) {
|
|
2159
|
-
return Promise.reject(e);
|
|
2160
|
-
}
|
|
2161
|
-
}
|
|
1282
|
+
value:
|
|
2162
1283
|
/**
|
|
2163
|
-
*
|
|
2164
|
-
*/
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
var
|
|
2170
|
-
|
|
2171
|
-
throw new RequiredError("accountId", "Required parameter requestParameters.accountId was null or undefined when calling getJob.");
|
|
2172
|
-
}
|
|
2173
|
-
if (requestParameters.jobId === null || requestParameters.jobId === undefined) {
|
|
2174
|
-
throw new RequiredError("jobId", "Required parameter requestParameters.jobId was null or undefined when calling getJob.");
|
|
2175
|
-
}
|
|
2176
|
-
if (requestParameters.jobType === null || requestParameters.jobType === undefined) {
|
|
2177
|
-
throw new RequiredError("jobType", "Required parameter requestParameters.jobType was null or undefined when calling getJob.");
|
|
2178
|
-
}
|
|
2179
|
-
var queryParameters = {};
|
|
2180
|
-
var headerParameters = {};
|
|
2181
|
-
if (_this6.configuration && _this6.configuration.apiKey) {
|
|
2182
|
-
headerParameters["Authorization"] = _this6.configuration.apiKey("Authorization"); // authorization-header authentication
|
|
2183
|
-
}
|
|
2184
|
-
|
|
2185
|
-
var operationBasePathOverride = [][0];
|
|
2186
|
-
return JobApi_await(_this6.request({
|
|
1284
|
+
* Cancels an in-progress background job. Requires a `secret_*` API key.
|
|
1285
|
+
*/
|
|
1286
|
+
function cancelJob(params) {
|
|
1287
|
+
try {
|
|
1288
|
+
var _this2 = this;
|
|
1289
|
+
var query = {};
|
|
1290
|
+
var headers = {};
|
|
1291
|
+
return JobApi_await(_this2.request({
|
|
2187
1292
|
path: "/v2/accounts/{accountId}/jobs/{jobType}/{jobId}".replace("{".concat("accountId", "}"),
|
|
2188
1293
|
// @ts-ignore
|
|
2189
|
-
|
|
1294
|
+
_this2.encodeParam("accountId", params.accountId)).replace("{".concat("jobId", "}"),
|
|
2190
1295
|
// @ts-ignore
|
|
2191
|
-
|
|
1296
|
+
_this2.encodeParam("jobId", params.jobId)).replace("{".concat("jobType", "}"),
|
|
2192
1297
|
// @ts-ignore
|
|
2193
|
-
|
|
2194
|
-
method: "
|
|
2195
|
-
headers:
|
|
2196
|
-
query:
|
|
2197
|
-
},
|
|
2198
|
-
return new
|
|
1298
|
+
_this2.encodeParam("jobType", params.jobType)),
|
|
1299
|
+
method: "DELETE",
|
|
1300
|
+
headers: headers,
|
|
1301
|
+
query: query
|
|
1302
|
+
}, undefined, [][0]), function (response) {
|
|
1303
|
+
return JobApi_await(new VoidApiResponse(response).value());
|
|
2199
1304
|
});
|
|
2200
1305
|
} catch (e) {
|
|
2201
1306
|
return Promise.reject(e);
|
|
@@ -2206,11 +1311,24 @@ var JobApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
2206
1311
|
*/
|
|
2207
1312
|
}, {
|
|
2208
1313
|
key: "getJob",
|
|
2209
|
-
value: function getJob(
|
|
1314
|
+
value: function getJob(params) {
|
|
2210
1315
|
try {
|
|
2211
|
-
var
|
|
2212
|
-
|
|
2213
|
-
|
|
1316
|
+
var _this4 = this;
|
|
1317
|
+
var query = {};
|
|
1318
|
+
var headers = {};
|
|
1319
|
+
return JobApi_await(_this4.request({
|
|
1320
|
+
path: "/v2/accounts/{accountId}/jobs/{jobType}/{jobId}".replace("{".concat("accountId", "}"),
|
|
1321
|
+
// @ts-ignore
|
|
1322
|
+
_this4.encodeParam("accountId", params.accountId)).replace("{".concat("jobId", "}"),
|
|
1323
|
+
// @ts-ignore
|
|
1324
|
+
_this4.encodeParam("jobId", params.jobId)).replace("{".concat("jobType", "}"),
|
|
1325
|
+
// @ts-ignore
|
|
1326
|
+
_this4.encodeParam("jobType", params.jobType)),
|
|
1327
|
+
method: "GET",
|
|
1328
|
+
headers: headers,
|
|
1329
|
+
query: query
|
|
1330
|
+
}, undefined, [][0]), function (response) {
|
|
1331
|
+
return JobApi_await(new JSONApiResponse(response).value());
|
|
2214
1332
|
});
|
|
2215
1333
|
} catch (e) {
|
|
2216
1334
|
return Promise.reject(e);
|
|
@@ -2220,50 +1338,24 @@ var JobApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
2220
1338
|
* Lists the most recently issued background jobs. Requires a `secret_*` API key.
|
|
2221
1339
|
*/
|
|
2222
1340
|
}, {
|
|
2223
|
-
key: "
|
|
2224
|
-
value: function
|
|
1341
|
+
key: "listRecentJobs",
|
|
1342
|
+
value: function listRecentJobs(params) {
|
|
2225
1343
|
try {
|
|
2226
|
-
var
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
if (requestParameters.jobType === null || requestParameters.jobType === undefined) {
|
|
2231
|
-
throw new RequiredError("jobType", "Required parameter requestParameters.jobType was null or undefined when calling listRecentJobs.");
|
|
2232
|
-
}
|
|
2233
|
-
var queryParameters = {};
|
|
2234
|
-
if (requestParameters.jobType) {
|
|
2235
|
-
queryParameters["jobType"] = requestParameters.jobType;
|
|
2236
|
-
}
|
|
2237
|
-
var headerParameters = {};
|
|
2238
|
-
if (_this10.configuration && _this10.configuration.apiKey) {
|
|
2239
|
-
headerParameters["Authorization"] = _this10.configuration.apiKey("Authorization"); // authorization-header authentication
|
|
1344
|
+
var _this6 = this;
|
|
1345
|
+
var query = {};
|
|
1346
|
+
if (params.jobType) {
|
|
1347
|
+
query["jobType"] = params.jobType;
|
|
2240
1348
|
}
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
return JobApi_await(_this10.request({
|
|
1349
|
+
var headers = {};
|
|
1350
|
+
return JobApi_await(_this6.request({
|
|
2244
1351
|
path: "/v2/accounts/{accountId}/jobs".replace("{".concat("accountId", "}"),
|
|
2245
1352
|
// @ts-ignore
|
|
2246
|
-
|
|
1353
|
+
_this6.encodeParam("accountId", params.accountId)),
|
|
2247
1354
|
method: "GET",
|
|
2248
|
-
headers:
|
|
2249
|
-
query:
|
|
2250
|
-
},
|
|
2251
|
-
return new JSONApiResponse(response);
|
|
2252
|
-
});
|
|
2253
|
-
} catch (e) {
|
|
2254
|
-
return Promise.reject(e);
|
|
2255
|
-
}
|
|
2256
|
-
}
|
|
2257
|
-
/**
|
|
2258
|
-
* Lists the most recently issued background jobs. Requires a `secret_*` API key.
|
|
2259
|
-
*/
|
|
2260
|
-
}, {
|
|
2261
|
-
key: "listRecentJobs",
|
|
2262
|
-
value: function listRecentJobs(requestParameters, initOverrides) {
|
|
2263
|
-
try {
|
|
2264
|
-
var _this12 = this;
|
|
2265
|
-
return JobApi_await(_this12.listRecentJobsWithHttpInfo(requestParameters, initOverrides), function (response) {
|
|
2266
|
-
return JobApi_await(response.value());
|
|
1355
|
+
headers: headers,
|
|
1356
|
+
query: query
|
|
1357
|
+
}, undefined, [][0]), function (response) {
|
|
1358
|
+
return JobApi_await(new JSONApiResponse(response).value());
|
|
2267
1359
|
});
|
|
2268
1360
|
} catch (e) {
|
|
2269
1361
|
return Promise.reject(e);
|
|
@@ -2272,7 +1364,7 @@ var JobApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
2272
1364
|
}]);
|
|
2273
1365
|
return JobApi;
|
|
2274
1366
|
}(BaseAPI);
|
|
2275
|
-
;// CONCATENATED MODULE: ./src/
|
|
1367
|
+
;// CONCATENATED MODULE: ./src/generated/apis/UploadApi.ts
|
|
2276
1368
|
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); }
|
|
2277
1369
|
function UploadApi_await(value, then, direct) {
|
|
2278
1370
|
if (direct) {
|
|
@@ -2283,12 +1375,6 @@ function UploadApi_await(value, then, direct) {
|
|
|
2283
1375
|
}
|
|
2284
1376
|
return then ? value.then(then) : value;
|
|
2285
1377
|
}
|
|
2286
|
-
function UploadApi_empty() {}
|
|
2287
|
-
function UploadApi_awaitIgnored(value, direct) {
|
|
2288
|
-
if (!direct) {
|
|
2289
|
-
return value && value.then ? value.then(UploadApi_empty) : Promise.resolve();
|
|
2290
|
-
}
|
|
2291
|
-
}
|
|
2292
1378
|
function UploadApi_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2293
1379
|
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); } }
|
|
2294
1380
|
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; }
|
|
@@ -2304,7 +1390,7 @@ function UploadApi_getPrototypeOf(o) { UploadApi_getPrototypeOf = Object.setProt
|
|
|
2304
1390
|
/* tslint:disable */
|
|
2305
1391
|
/* eslint-disable */
|
|
2306
1392
|
/**
|
|
2307
|
-
* @bytescale/
|
|
1393
|
+
* @bytescale/api
|
|
2308
1394
|
* Bytescale API
|
|
2309
1395
|
*
|
|
2310
1396
|
* The version of the OpenAPI document: 2.0.0
|
|
@@ -2327,53 +1413,27 @@ var UploadApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
2327
1413
|
return _super.apply(this, arguments);
|
|
2328
1414
|
}
|
|
2329
1415
|
UploadApi_createClass(UploadApi, [{
|
|
2330
|
-
key: "
|
|
1416
|
+
key: "beginMultipartUpload",
|
|
2331
1417
|
value:
|
|
2332
1418
|
/**
|
|
2333
1419
|
* Begins a new multipart file upload process.
|
|
2334
1420
|
*/
|
|
2335
|
-
function
|
|
1421
|
+
function beginMultipartUpload(params) {
|
|
2336
1422
|
try {
|
|
2337
1423
|
var _this2 = this;
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
if (requestParameters.beginMultipartUploadRequest === null || requestParameters.beginMultipartUploadRequest === undefined) {
|
|
2342
|
-
throw new RequiredError("beginMultipartUploadRequest", "Required parameter requestParameters.beginMultipartUploadRequest was null or undefined when calling beginMultipartUpload.");
|
|
2343
|
-
}
|
|
2344
|
-
var queryParameters = {};
|
|
2345
|
-
var headerParameters = {};
|
|
2346
|
-
headerParameters["Content-Type"] = "application/json";
|
|
2347
|
-
if (_this2.configuration && _this2.configuration.apiKey) {
|
|
2348
|
-
headerParameters["Authorization"] = _this2.configuration.apiKey("Authorization"); // authorization-header authentication
|
|
2349
|
-
}
|
|
2350
|
-
|
|
2351
|
-
var operationBasePathOverride = [][0];
|
|
1424
|
+
var query = {};
|
|
1425
|
+
var headers = {};
|
|
1426
|
+
headers["Content-Type"] = "application/json";
|
|
2352
1427
|
return UploadApi_await(_this2.request({
|
|
2353
1428
|
path: "/v2/accounts/{accountId}/uploads".replace("{".concat("accountId", "}"),
|
|
2354
1429
|
// @ts-ignore
|
|
2355
|
-
|
|
1430
|
+
_this2.encodeParam("accountId", params.accountId)),
|
|
2356
1431
|
method: "POST",
|
|
2357
|
-
headers:
|
|
2358
|
-
query:
|
|
2359
|
-
body:
|
|
2360
|
-
},
|
|
2361
|
-
return new JSONApiResponse(response);
|
|
2362
|
-
});
|
|
2363
|
-
} catch (e) {
|
|
2364
|
-
return Promise.reject(e);
|
|
2365
|
-
}
|
|
2366
|
-
}
|
|
2367
|
-
/**
|
|
2368
|
-
* Begins a new multipart file upload process.
|
|
2369
|
-
*/
|
|
2370
|
-
}, {
|
|
2371
|
-
key: "beginMultipartUpload",
|
|
2372
|
-
value: function beginMultipartUpload(requestParameters, initOverrides) {
|
|
2373
|
-
try {
|
|
2374
|
-
var _this4 = this;
|
|
2375
|
-
return UploadApi_await(_this4.beginMultipartUploadWithHttpInfo(requestParameters, initOverrides), function (response) {
|
|
2376
|
-
return UploadApi_await(response.value());
|
|
1432
|
+
headers: headers,
|
|
1433
|
+
query: query,
|
|
1434
|
+
body: params.beginMultipartUploadRequest
|
|
1435
|
+
}, undefined, [][0]), function (response) {
|
|
1436
|
+
return UploadApi_await(new JSONApiResponse(response).value());
|
|
2377
1437
|
});
|
|
2378
1438
|
} catch (e) {
|
|
2379
1439
|
return Promise.reject(e);
|
|
@@ -2383,114 +1443,55 @@ var UploadApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
2383
1443
|
* 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.
|
|
2384
1444
|
*/
|
|
2385
1445
|
}, {
|
|
2386
|
-
key: "
|
|
2387
|
-
value: function
|
|
1446
|
+
key: "completeUploadPart",
|
|
1447
|
+
value: function completeUploadPart(params) {
|
|
2388
1448
|
try {
|
|
2389
|
-
var
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
throw new RequiredError("uploadId", "Required parameter requestParameters.uploadId was null or undefined when calling completeUploadPart.");
|
|
2395
|
-
}
|
|
2396
|
-
if (requestParameters.uploadPartIndex === null || requestParameters.uploadPartIndex === undefined) {
|
|
2397
|
-
throw new RequiredError("uploadPartIndex", "Required parameter requestParameters.uploadPartIndex was null or undefined when calling completeUploadPart.");
|
|
2398
|
-
}
|
|
2399
|
-
if (requestParameters.completeUploadPartRequest === null || requestParameters.completeUploadPartRequest === undefined) {
|
|
2400
|
-
throw new RequiredError("completeUploadPartRequest", "Required parameter requestParameters.completeUploadPartRequest was null or undefined when calling completeUploadPart.");
|
|
2401
|
-
}
|
|
2402
|
-
var queryParameters = {};
|
|
2403
|
-
var headerParameters = {};
|
|
2404
|
-
headerParameters["Content-Type"] = "application/json";
|
|
2405
|
-
if (_this6.configuration && _this6.configuration.apiKey) {
|
|
2406
|
-
headerParameters["Authorization"] = _this6.configuration.apiKey("Authorization"); // authorization-header authentication
|
|
2407
|
-
}
|
|
2408
|
-
|
|
2409
|
-
var operationBasePathOverride = [][0];
|
|
2410
|
-
return UploadApi_await(_this6.request({
|
|
1449
|
+
var _this4 = this;
|
|
1450
|
+
var query = {};
|
|
1451
|
+
var headers = {};
|
|
1452
|
+
headers["Content-Type"] = "application/json";
|
|
1453
|
+
return UploadApi_await(_this4.request({
|
|
2411
1454
|
path: "/v2/accounts/{accountId}/uploads/{uploadId}/parts/{uploadPartIndex}".replace("{".concat("accountId", "}"),
|
|
2412
1455
|
// @ts-ignore
|
|
2413
|
-
|
|
1456
|
+
_this4.encodeParam("accountId", params.accountId)).replace("{".concat("uploadId", "}"),
|
|
2414
1457
|
// @ts-ignore
|
|
2415
|
-
|
|
1458
|
+
_this4.encodeParam("uploadId", params.uploadId)).replace("{".concat("uploadPartIndex", "}"),
|
|
2416
1459
|
// @ts-ignore
|
|
2417
|
-
|
|
1460
|
+
_this4.encodeParam("uploadPartIndex", params.uploadPartIndex)),
|
|
2418
1461
|
method: "PUT",
|
|
2419
|
-
headers:
|
|
2420
|
-
query:
|
|
2421
|
-
body:
|
|
2422
|
-
},
|
|
2423
|
-
return new VoidApiResponse(response);
|
|
1462
|
+
headers: headers,
|
|
1463
|
+
query: query,
|
|
1464
|
+
body: params.completeUploadPartRequest
|
|
1465
|
+
}, undefined, [][0]), function (response) {
|
|
1466
|
+
return UploadApi_await(new VoidApiResponse(response).value());
|
|
2424
1467
|
});
|
|
2425
1468
|
} catch (e) {
|
|
2426
1469
|
return Promise.reject(e);
|
|
2427
1470
|
}
|
|
2428
1471
|
}
|
|
2429
|
-
/**
|
|
2430
|
-
* 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.
|
|
2431
|
-
*/
|
|
2432
|
-
}, {
|
|
2433
|
-
key: "completeUploadPart",
|
|
2434
|
-
value: function completeUploadPart(requestParameters, initOverrides) {
|
|
2435
|
-
try {
|
|
2436
|
-
var _this8 = this;
|
|
2437
|
-
return UploadApi_awaitIgnored(_this8.completeUploadPartWithHttpInfo(requestParameters, initOverrides));
|
|
2438
|
-
} catch (e) {
|
|
2439
|
-
return Promise.reject(e);
|
|
2440
|
-
}
|
|
2441
|
-
}
|
|
2442
1472
|
/**
|
|
2443
1473
|
* Gets a remaining upload part for a multipart file upload.
|
|
2444
1474
|
*/
|
|
2445
1475
|
}, {
|
|
2446
|
-
key: "
|
|
2447
|
-
value: function
|
|
1476
|
+
key: "getUploadPart",
|
|
1477
|
+
value: function getUploadPart(params) {
|
|
2448
1478
|
try {
|
|
2449
|
-
var
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
if (requestParameters.uploadId === null || requestParameters.uploadId === undefined) {
|
|
2454
|
-
throw new RequiredError("uploadId", "Required parameter requestParameters.uploadId was null or undefined when calling getUploadPart.");
|
|
2455
|
-
}
|
|
2456
|
-
if (requestParameters.uploadPartIndex === null || requestParameters.uploadPartIndex === undefined) {
|
|
2457
|
-
throw new RequiredError("uploadPartIndex", "Required parameter requestParameters.uploadPartIndex was null or undefined when calling getUploadPart.");
|
|
2458
|
-
}
|
|
2459
|
-
var queryParameters = {};
|
|
2460
|
-
var headerParameters = {};
|
|
2461
|
-
if (_this10.configuration && _this10.configuration.apiKey) {
|
|
2462
|
-
headerParameters["Authorization"] = _this10.configuration.apiKey("Authorization"); // authorization-header authentication
|
|
2463
|
-
}
|
|
2464
|
-
|
|
2465
|
-
var operationBasePathOverride = [][0];
|
|
2466
|
-
return UploadApi_await(_this10.request({
|
|
1479
|
+
var _this6 = this;
|
|
1480
|
+
var query = {};
|
|
1481
|
+
var headers = {};
|
|
1482
|
+
return UploadApi_await(_this6.request({
|
|
2467
1483
|
path: "/v2/accounts/{accountId}/uploads/{uploadId}/parts/{uploadPartIndex}".replace("{".concat("accountId", "}"),
|
|
2468
1484
|
// @ts-ignore
|
|
2469
|
-
|
|
1485
|
+
_this6.encodeParam("accountId", params.accountId)).replace("{".concat("uploadId", "}"),
|
|
2470
1486
|
// @ts-ignore
|
|
2471
|
-
|
|
1487
|
+
_this6.encodeParam("uploadId", params.uploadId)).replace("{".concat("uploadPartIndex", "}"),
|
|
2472
1488
|
// @ts-ignore
|
|
2473
|
-
|
|
1489
|
+
_this6.encodeParam("uploadPartIndex", params.uploadPartIndex)),
|
|
2474
1490
|
method: "GET",
|
|
2475
|
-
headers:
|
|
2476
|
-
query:
|
|
2477
|
-
},
|
|
2478
|
-
return new JSONApiResponse(response);
|
|
2479
|
-
});
|
|
2480
|
-
} catch (e) {
|
|
2481
|
-
return Promise.reject(e);
|
|
2482
|
-
}
|
|
2483
|
-
}
|
|
2484
|
-
/**
|
|
2485
|
-
* Gets a remaining upload part for a multipart file upload.
|
|
2486
|
-
*/
|
|
2487
|
-
}, {
|
|
2488
|
-
key: "getUploadPart",
|
|
2489
|
-
value: function getUploadPart(requestParameters, initOverrides) {
|
|
2490
|
-
try {
|
|
2491
|
-
var _this12 = this;
|
|
2492
|
-
return UploadApi_await(_this12.getUploadPartWithHttpInfo(requestParameters, initOverrides), function (response) {
|
|
2493
|
-
return UploadApi_await(response.value());
|
|
1491
|
+
headers: headers,
|
|
1492
|
+
query: query
|
|
1493
|
+
}, undefined, [][0]), function (response) {
|
|
1494
|
+
return UploadApi_await(new JSONApiResponse(response).value());
|
|
2494
1495
|
});
|
|
2495
1496
|
} catch (e) {
|
|
2496
1497
|
return Promise.reject(e);
|
|
@@ -2500,49 +1501,23 @@ var UploadApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
2500
1501
|
* Lists the remaining upload parts for a multipart file upload. An empty array is returned when the upload is complete.
|
|
2501
1502
|
*/
|
|
2502
1503
|
}, {
|
|
2503
|
-
key: "
|
|
2504
|
-
value: function
|
|
1504
|
+
key: "listUploadParts",
|
|
1505
|
+
value: function listUploadParts(params) {
|
|
2505
1506
|
try {
|
|
2506
|
-
var
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
if (requestParameters.uploadId === null || requestParameters.uploadId === undefined) {
|
|
2511
|
-
throw new RequiredError("uploadId", "Required parameter requestParameters.uploadId was null or undefined when calling listUploadParts.");
|
|
2512
|
-
}
|
|
2513
|
-
var queryParameters = {};
|
|
2514
|
-
var headerParameters = {};
|
|
2515
|
-
if (_this14.configuration && _this14.configuration.apiKey) {
|
|
2516
|
-
headerParameters["Authorization"] = _this14.configuration.apiKey("Authorization"); // authorization-header authentication
|
|
2517
|
-
}
|
|
2518
|
-
|
|
2519
|
-
var operationBasePathOverride = [][0];
|
|
2520
|
-
return UploadApi_await(_this14.request({
|
|
1507
|
+
var _this8 = this;
|
|
1508
|
+
var query = {};
|
|
1509
|
+
var headers = {};
|
|
1510
|
+
return UploadApi_await(_this8.request({
|
|
2521
1511
|
path: "/v2/accounts/{accountId}/uploads/{uploadId}/parts".replace("{".concat("accountId", "}"),
|
|
2522
1512
|
// @ts-ignore
|
|
2523
|
-
|
|
1513
|
+
_this8.encodeParam("accountId", params.accountId)).replace("{".concat("uploadId", "}"),
|
|
2524
1514
|
// @ts-ignore
|
|
2525
|
-
|
|
1515
|
+
_this8.encodeParam("uploadId", params.uploadId)),
|
|
2526
1516
|
method: "GET",
|
|
2527
|
-
headers:
|
|
2528
|
-
query:
|
|
2529
|
-
},
|
|
2530
|
-
return new JSONApiResponse(response);
|
|
2531
|
-
});
|
|
2532
|
-
} catch (e) {
|
|
2533
|
-
return Promise.reject(e);
|
|
2534
|
-
}
|
|
2535
|
-
}
|
|
2536
|
-
/**
|
|
2537
|
-
* Lists the remaining upload parts for a multipart file upload. An empty array is returned when the upload is complete.
|
|
2538
|
-
*/
|
|
2539
|
-
}, {
|
|
2540
|
-
key: "listUploadParts",
|
|
2541
|
-
value: function listUploadParts(requestParameters, initOverrides) {
|
|
2542
|
-
try {
|
|
2543
|
-
var _this16 = this;
|
|
2544
|
-
return UploadApi_await(_this16.listUploadPartsWithHttpInfo(requestParameters, initOverrides), function (response) {
|
|
2545
|
-
return UploadApi_await(response.value());
|
|
1517
|
+
headers: headers,
|
|
1518
|
+
query: query
|
|
1519
|
+
}, undefined, [][0]), function (response) {
|
|
1520
|
+
return UploadApi_await(new JSONApiResponse(response).value());
|
|
2546
1521
|
});
|
|
2547
1522
|
} catch (e) {
|
|
2548
1523
|
return Promise.reject(e);
|
|
@@ -2552,49 +1527,23 @@ var UploadApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
2552
1527
|
* Upload from a URL with a single HTTP request:
|
|
2553
1528
|
*/
|
|
2554
1529
|
}, {
|
|
2555
|
-
key: "
|
|
2556
|
-
value: function
|
|
1530
|
+
key: "uploadFromUrl",
|
|
1531
|
+
value: function uploadFromUrl(params) {
|
|
2557
1532
|
try {
|
|
2558
|
-
var
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
throw new RequiredError("uploadFromUrlRequest", "Required parameter requestParameters.uploadFromUrlRequest was null or undefined when calling uploadFromUrl.");
|
|
2564
|
-
}
|
|
2565
|
-
var queryParameters = {};
|
|
2566
|
-
var headerParameters = {};
|
|
2567
|
-
headerParameters["Content-Type"] = "application/json";
|
|
2568
|
-
if (_this18.configuration && _this18.configuration.apiKey) {
|
|
2569
|
-
headerParameters["Authorization"] = _this18.configuration.apiKey("Authorization"); // authorization-header authentication
|
|
2570
|
-
}
|
|
2571
|
-
|
|
2572
|
-
var operationBasePathOverride = [][0];
|
|
2573
|
-
return UploadApi_await(_this18.request({
|
|
1533
|
+
var _this10 = this;
|
|
1534
|
+
var query = {};
|
|
1535
|
+
var headers = {};
|
|
1536
|
+
headers["Content-Type"] = "application/json";
|
|
1537
|
+
return UploadApi_await(_this10.request({
|
|
2574
1538
|
path: "/v2/accounts/{accountId}/uploads/url".replace("{".concat("accountId", "}"),
|
|
2575
1539
|
// @ts-ignore
|
|
2576
|
-
|
|
1540
|
+
_this10.encodeParam("accountId", params.accountId)),
|
|
2577
1541
|
method: "POST",
|
|
2578
|
-
headers:
|
|
2579
|
-
query:
|
|
2580
|
-
body:
|
|
2581
|
-
},
|
|
2582
|
-
return new JSONApiResponse(response);
|
|
2583
|
-
});
|
|
2584
|
-
} catch (e) {
|
|
2585
|
-
return Promise.reject(e);
|
|
2586
|
-
}
|
|
2587
|
-
}
|
|
2588
|
-
/**
|
|
2589
|
-
* Upload from a URL with a single HTTP request:
|
|
2590
|
-
*/
|
|
2591
|
-
}, {
|
|
2592
|
-
key: "uploadFromUrl",
|
|
2593
|
-
value: function uploadFromUrl(requestParameters, initOverrides) {
|
|
2594
|
-
try {
|
|
2595
|
-
var _this20 = this;
|
|
2596
|
-
return UploadApi_await(_this20.uploadFromUrlWithHttpInfo(requestParameters, initOverrides), function (response) {
|
|
2597
|
-
return UploadApi_await(response.value());
|
|
1542
|
+
headers: headers,
|
|
1543
|
+
query: query,
|
|
1544
|
+
body: params.uploadFromUrlRequest
|
|
1545
|
+
}, undefined, [][0]), function (response) {
|
|
1546
|
+
return UploadApi_await(new JSONApiResponse(response).value());
|
|
2598
1547
|
});
|
|
2599
1548
|
} catch (e) {
|
|
2600
1549
|
return Promise.reject(e);
|
|
@@ -2603,332 +1552,20 @@ var UploadApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
2603
1552
|
}]);
|
|
2604
1553
|
return UploadApi;
|
|
2605
1554
|
}(BaseAPI);
|
|
2606
|
-
;// CONCATENATED MODULE: ./src/
|
|
1555
|
+
;// CONCATENATED MODULE: ./src/generated/apis/index.ts
|
|
2607
1556
|
/* tslint:disable */
|
|
2608
1557
|
/* eslint-disable */
|
|
2609
1558
|
|
|
2610
1559
|
|
|
2611
1560
|
|
|
2612
1561
|
|
|
2613
|
-
;// CONCATENATED MODULE: ./src/
|
|
2614
|
-
/* tslint:disable */
|
|
2615
|
-
/* eslint-disable */
|
|
2616
|
-
/**
|
|
2617
|
-
* "Created" is only used when issuing jobs non-transactionally (which we do if we want the job to be picked up sooner).
|
|
2618
|
-
* In this case, a two-phase transaction is performed.
|
|
2619
|
-
*
|
|
2620
|
-
* T=0) "Created" job tracker created.
|
|
2621
|
-
* T=1) SQS job enqueued.
|
|
2622
|
-
* T=2) "Pending" is set into job tracker.
|
|
2623
|
-
* T=3) Response returned to use
|
|
2624
|
-
* 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.
|
|
2625
|
-
* T=5) SQS processes the job as normal.
|
|
2626
|
-
*
|
|
2627
|
-
* As such, the "Created" state is an internal detail, and we never expose jobs in this state to the user.
|
|
2628
|
-
* @export
|
|
2629
|
-
*/
|
|
2630
|
-
var AccountJobStatus = {
|
|
2631
|
-
Created: "Created",
|
|
2632
|
-
Pending: "Pending",
|
|
2633
|
-
Running: "Running",
|
|
2634
|
-
Rollback: "Rollback",
|
|
2635
|
-
Failed: "Failed",
|
|
2636
|
-
Succeeded: "Succeeded",
|
|
2637
|
-
Cancelling: "Cancelling",
|
|
2638
|
-
Cancelled: "Cancelled"
|
|
2639
|
-
};
|
|
2640
|
-
/**
|
|
2641
|
-
* Job type.
|
|
2642
|
-
* @export
|
|
2643
|
-
*/
|
|
2644
|
-
var AccountJobType = {
|
|
2645
|
-
ProcessFileJob: "ProcessFileJob",
|
|
2646
|
-
DeleteFolderBatchJob: "DeleteFolderBatchJob",
|
|
2647
|
-
DeleteFileBatchJob: "DeleteFileBatchJob",
|
|
2648
|
-
CopyFolderBatchJob: "CopyFolderBatchJob",
|
|
2649
|
-
CopyFileBatchJob: "CopyFileBatchJob"
|
|
2650
|
-
};
|
|
2651
|
-
/**
|
|
2652
|
-
* @export
|
|
2653
|
-
*/
|
|
2654
|
-
var AsyncResponseJobDocsEnum = {
|
|
2655
|
-
HttpsWwwBytescaleComDocsJobApiGetJob: "https://www.bytescale.com/docs/job-api/GetJob"
|
|
2656
|
-
};
|
|
2657
|
-
/**
|
|
2658
|
-
* AWS Region.
|
|
2659
|
-
* @export
|
|
2660
|
-
*/
|
|
2661
|
-
var AwsRegion = {
|
|
2662
|
-
UsEast2: "us-east-2",
|
|
2663
|
-
UsEast1: "us-east-1",
|
|
2664
|
-
UsWest1: "us-west-1",
|
|
2665
|
-
UsWest2: "us-west-2",
|
|
2666
|
-
AfSouth1: "af-south-1",
|
|
2667
|
-
ApEast1: "ap-east-1",
|
|
2668
|
-
ApSoutheast3: "ap-southeast-3",
|
|
2669
|
-
ApSouth1: "ap-south-1",
|
|
2670
|
-
ApNortheast3: "ap-northeast-3",
|
|
2671
|
-
ApNortheast2: "ap-northeast-2",
|
|
2672
|
-
ApSoutheast1: "ap-southeast-1",
|
|
2673
|
-
ApSoutheast2: "ap-southeast-2",
|
|
2674
|
-
ApNortheast1: "ap-northeast-1",
|
|
2675
|
-
CaCentral1: "ca-central-1",
|
|
2676
|
-
EuCentral1: "eu-central-1",
|
|
2677
|
-
EuWest1: "eu-west-1",
|
|
2678
|
-
EuWest2: "eu-west-2",
|
|
2679
|
-
EuSouth1: "eu-south-1",
|
|
2680
|
-
EuWest3: "eu-west-3",
|
|
2681
|
-
EuNorth1: "eu-north-1",
|
|
2682
|
-
MeSouth1: "me-south-1",
|
|
2683
|
-
SaEast1: "sa-east-1"
|
|
2684
|
-
};
|
|
2685
|
-
/**
|
|
2686
|
-
* @export
|
|
2687
|
-
*/
|
|
2688
|
-
var DigitalOceanStorageTypeEnum = {
|
|
2689
|
-
DigitalOceanSpace: "DigitalOceanSpace"
|
|
2690
|
-
};
|
|
2691
|
-
/**
|
|
2692
|
-
* The result of the CopyFile operation.
|
|
2693
|
-
* @export
|
|
2694
|
-
*/
|
|
2695
|
-
var FileCopyStatus = {
|
|
2696
|
-
Copied: "Copied",
|
|
2697
|
-
FileNotFound: "FileNotFound",
|
|
2698
|
-
SkippedDueToCondition: "SkippedDueToCondition"
|
|
2699
|
-
};
|
|
2700
|
-
/**
|
|
2701
|
-
* @export
|
|
2702
|
-
*/
|
|
2703
|
-
var FileSummaryTypeEnum = {
|
|
2704
|
-
File: "File"
|
|
2705
|
-
};
|
|
2706
|
-
/**
|
|
2707
|
-
* @export
|
|
2708
|
-
*/
|
|
2709
|
-
var FolderDetailsTypeEnum = {
|
|
2710
|
-
Folder: "Folder"
|
|
2711
|
-
};
|
|
2712
|
-
/**
|
|
2713
|
-
* @export
|
|
2714
|
-
*/
|
|
2715
|
-
var FolderSettingsStorageLayerSummaryStorageLayerTypeEnum = {
|
|
2716
|
-
GoogleStorage: "GoogleStorage"
|
|
2717
|
-
};
|
|
2718
|
-
/**
|
|
2719
|
-
* @export
|
|
2720
|
-
*/
|
|
2721
|
-
var FolderSummaryTypeEnum = {
|
|
2722
|
-
Folder: "Folder"
|
|
2723
|
-
};
|
|
2724
|
-
/**
|
|
2725
|
-
* @export
|
|
2726
|
-
*/
|
|
2727
|
-
var GoogleStorageTypeEnum = {
|
|
2728
|
-
GoogleStorage: "GoogleStorage"
|
|
2729
|
-
};
|
|
2730
|
-
/**
|
|
2731
|
-
* @export
|
|
2732
|
-
*/
|
|
2733
|
-
var InternalStorageV1TypeEnum = {
|
|
2734
|
-
InternalStorageV1: "InternalStorageV1"
|
|
2735
|
-
};
|
|
2736
|
-
/**
|
|
2737
|
-
* @export
|
|
2738
|
-
*/
|
|
2739
|
-
var InternalStorageV2TypeEnum = {
|
|
2740
|
-
InternalStorageV2: "InternalStorageV2"
|
|
2741
|
-
};
|
|
2742
|
-
/**
|
|
2743
|
-
* @export
|
|
2744
|
-
*/
|
|
2745
|
-
var JobSummaryJobDocsEnum = {
|
|
2746
|
-
HttpsWwwBytescaleComDocsJobApiGetJob: "https://www.bytescale.com/docs/job-api/GetJob"
|
|
2747
|
-
};
|
|
2748
|
-
/**
|
|
2749
|
-
* Multipart file upload protocol version.
|
|
2750
|
-
*
|
|
2751
|
-
* - `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.
|
|
2752
|
-
*
|
|
2753
|
-
* - `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).
|
|
2754
|
-
* @export
|
|
2755
|
-
*/
|
|
2756
|
-
var MultipartUploadProtocol = {
|
|
2757
|
-
_0: "1.0",
|
|
2758
|
-
_1: "1.1"
|
|
2759
|
-
};
|
|
2760
|
-
/**
|
|
2761
|
-
* @export
|
|
2762
|
-
*/
|
|
2763
|
-
var ObjectSummaryTypeEnum = {
|
|
2764
|
-
File: "File"
|
|
2765
|
-
};
|
|
2766
|
-
/**
|
|
2767
|
-
* Specifies the level in the file tree, relative to the path, that these permissions apply.
|
|
2768
|
-
*
|
|
2769
|
-
* - `"This"`: Permissions apply to the current path only.
|
|
2770
|
-
*
|
|
2771
|
-
* - `"Children"`: Permissions apply to the children (files and folders) of this path only.
|
|
2772
|
-
*
|
|
2773
|
-
* - `"Grandchildren+"`: Permissions apply to the grandchildren (files and folders) of this path and their descendants only.
|
|
2774
|
-
* @export
|
|
2775
|
-
*/
|
|
2776
|
-
var PathPermissionScope = {
|
|
2777
|
-
Children: "Children",
|
|
2778
|
-
Grandchildren: "Grandchildren+",
|
|
2779
|
-
This: "This"
|
|
2780
|
-
};
|
|
2781
|
-
/**
|
|
2782
|
-
* @export
|
|
2783
|
-
*/
|
|
2784
|
-
var PickDigitalOceanStorageExcludeKeyofDigitalOceanStorageCredentialsTypeEnum = {
|
|
2785
|
-
DigitalOceanSpace: "DigitalOceanSpace"
|
|
2786
|
-
};
|
|
2787
|
-
/**
|
|
2788
|
-
* @export
|
|
2789
|
-
*/
|
|
2790
|
-
var PickGoogleStorageExcludeKeyofGoogleStorageCredentialsTypeEnum = {
|
|
2791
|
-
GoogleStorage: "GoogleStorage"
|
|
2792
|
-
};
|
|
2793
|
-
/**
|
|
2794
|
-
* @export
|
|
2795
|
-
*/
|
|
2796
|
-
var PickR2StorageExcludeKeyofR2StorageCredentialsTypeEnum = {
|
|
2797
|
-
R2: "R2"
|
|
2798
|
-
};
|
|
2799
|
-
/**
|
|
2800
|
-
* @export
|
|
2801
|
-
*/
|
|
2802
|
-
var PickS3StorageExcludeKeyofS3StorageCredentialsTypeEnum = {
|
|
2803
|
-
S3: "S3"
|
|
2804
|
-
};
|
|
2805
|
-
/**
|
|
2806
|
-
* @export
|
|
2807
|
-
*/
|
|
2808
|
-
var R2StorageTypeEnum = {
|
|
2809
|
-
R2: "R2"
|
|
2810
|
-
};
|
|
2811
|
-
/**
|
|
2812
|
-
* @export
|
|
2813
|
-
*/
|
|
2814
|
-
var S3StorageTypeEnum = {
|
|
2815
|
-
S3: "S3"
|
|
2816
|
-
};
|
|
2817
|
-
/**
|
|
2818
|
-
* @export
|
|
2819
|
-
*/
|
|
2820
|
-
var SpecifiedFieldValueFolderDescriptionOrNullSetEnum = {
|
|
2821
|
-
True: true
|
|
2822
|
-
};
|
|
2823
|
-
/**
|
|
2824
|
-
* @export
|
|
2825
|
-
*/
|
|
2826
|
-
var SpecifiedFieldValuePublicPermissionsArrayOrNullSetEnum = {
|
|
2827
|
-
True: true
|
|
2828
|
-
};
|
|
2829
|
-
/**
|
|
2830
|
-
* @export
|
|
2831
|
-
*/
|
|
2832
|
-
var SpecifiedFieldValueStorageLayerUpdateOrNullSetEnum = {
|
|
2833
|
-
True: true
|
|
2834
|
-
};
|
|
2835
|
-
/**
|
|
2836
|
-
* @export
|
|
2837
|
-
*/
|
|
2838
|
-
var SpecifiedFieldValueStorageLayerUpdateOrNullValueTypeEnum = {
|
|
2839
|
-
GoogleStorage: "GoogleStorage"
|
|
2840
|
-
};
|
|
2841
|
-
/**
|
|
2842
|
-
* @export
|
|
2843
|
-
*/
|
|
2844
|
-
var StorageLayerSummaryTypeEnum = {
|
|
2845
|
-
GoogleStorage: "GoogleStorage"
|
|
2846
|
-
};
|
|
2847
|
-
/**
|
|
2848
|
-
* @export
|
|
2849
|
-
*/
|
|
2850
|
-
var StorageLayerUpdateTypeEnum = {
|
|
2851
|
-
GoogleStorage: "GoogleStorage"
|
|
2852
|
-
};
|
|
2853
|
-
/**
|
|
2854
|
-
* @export
|
|
2855
|
-
*/
|
|
2856
|
-
var TagConditionTypeEnum = {
|
|
2857
|
-
All: "All"
|
|
2858
|
-
};
|
|
2859
|
-
/**
|
|
2860
|
-
* @export
|
|
2861
|
-
*/
|
|
2862
|
-
var TagConditionAllTypeEnum = {
|
|
2863
|
-
All: "All"
|
|
2864
|
-
};
|
|
2865
|
-
/**
|
|
2866
|
-
* @export
|
|
2867
|
-
*/
|
|
2868
|
-
var TagConditionAndTypeEnum = {
|
|
2869
|
-
And: "And"
|
|
2870
|
-
};
|
|
2871
|
-
/**
|
|
2872
|
-
* @export
|
|
2873
|
-
*/
|
|
2874
|
-
var TagConditionAnyTypeEnum = {
|
|
2875
|
-
Any: "Any"
|
|
2876
|
-
};
|
|
2877
|
-
/**
|
|
2878
|
-
* @export
|
|
2879
|
-
*/
|
|
2880
|
-
var TagConditionEqualsTypeEnum = {
|
|
2881
|
-
Equals: "Equals"
|
|
2882
|
-
};
|
|
2883
|
-
/**
|
|
2884
|
-
* @export
|
|
2885
|
-
*/
|
|
2886
|
-
var TagConditionNotTypeEnum = {
|
|
2887
|
-
Not: "Not"
|
|
2888
|
-
};
|
|
2889
|
-
/**
|
|
2890
|
-
* @export
|
|
2891
|
-
*/
|
|
2892
|
-
var TagConditionOrTypeEnum = {
|
|
2893
|
-
Or: "Or"
|
|
2894
|
-
};
|
|
2895
|
-
/**
|
|
2896
|
-
* @export
|
|
2897
|
-
*/
|
|
2898
|
-
var UnspecifiedFieldValueSetEnum = {
|
|
2899
|
-
False: false
|
|
2900
|
-
};
|
|
2901
|
-
/**
|
|
2902
|
-
* @export
|
|
2903
|
-
*/
|
|
2904
|
-
var UpdatableFieldFolderDescriptionOrNullSetEnum = {
|
|
2905
|
-
True: true
|
|
2906
|
-
};
|
|
2907
|
-
/**
|
|
2908
|
-
* @export
|
|
2909
|
-
*/
|
|
2910
|
-
var UpdatableFieldPublicPermissionsArrayOrNullSetEnum = {
|
|
2911
|
-
True: true
|
|
2912
|
-
};
|
|
2913
|
-
/**
|
|
2914
|
-
* @export
|
|
2915
|
-
*/
|
|
2916
|
-
var UpdatableFieldStorageLayerUpdateOrNullSetEnum = {
|
|
2917
|
-
True: true
|
|
2918
|
-
};
|
|
2919
|
-
/**
|
|
2920
|
-
* @export
|
|
2921
|
-
*/
|
|
2922
|
-
var WebStorageTypeEnum = {
|
|
2923
|
-
Web: "Web"
|
|
2924
|
-
};
|
|
2925
|
-
;// CONCATENATED MODULE: ./src/gen/index.ts
|
|
1562
|
+
;// CONCATENATED MODULE: ./src/generated/index.ts
|
|
2926
1563
|
/* tslint:disable */
|
|
2927
1564
|
/* eslint-disable */
|
|
2928
1565
|
|
|
2929
1566
|
|
|
2930
1567
|
|
|
2931
|
-
;// CONCATENATED MODULE: ./src/
|
|
1568
|
+
;// CONCATENATED MODULE: ./src/uploads/NodeUtils.ts
|
|
2932
1569
|
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); }
|
|
2933
1570
|
function NodeUtils_await(value, then, direct) {
|
|
2934
1571
|
if (direct) {
|
|
@@ -2957,7 +1594,7 @@ var NodeUtils = /*#__PURE__*/function () {
|
|
|
2957
1594
|
key: "createStream",
|
|
2958
1595
|
value: function createStream() {
|
|
2959
1596
|
try {
|
|
2960
|
-
return NodeUtils_await(__webpack_require__.e(/* import() */ "
|
|
1597
|
+
return NodeUtils_await(__webpack_require__.e(/* import() */ "_70b2").then(__webpack_require__.t.bind(__webpack_require__, "?70b2", 23)), function (_import) {
|
|
2961
1598
|
var streamModule = _import["default"];
|
|
2962
1599
|
var Readable = streamModule.Readable;
|
|
2963
1600
|
var readable = new Readable();
|
|
@@ -2972,7 +1609,7 @@ var NodeUtils = /*#__PURE__*/function () {
|
|
|
2972
1609
|
key: "createBlob",
|
|
2973
1610
|
value: function createBlob(sources, options) {
|
|
2974
1611
|
try {
|
|
2975
|
-
return NodeUtils_await(__webpack_require__.e(/* import() */ "
|
|
1612
|
+
return NodeUtils_await(__webpack_require__.e(/* import() */ "_7392").then(__webpack_require__.t.bind(__webpack_require__, "?7392", 23)), function (_import2) {
|
|
2976
1613
|
var bufferModule = _import2["default"];
|
|
2977
1614
|
var B = bufferModule.Blob;
|
|
2978
1615
|
return new B(sources, options);
|
|
@@ -2984,7 +1621,7 @@ var NodeUtils = /*#__PURE__*/function () {
|
|
|
2984
1621
|
}]);
|
|
2985
1622
|
return NodeUtils;
|
|
2986
1623
|
}();
|
|
2987
|
-
;// CONCATENATED MODULE: ./src/
|
|
1624
|
+
;// CONCATENATED MODULE: ./src/uploads/ChunkedStream.ts
|
|
2988
1625
|
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); }
|
|
2989
1626
|
function ChunkedStream_invoke(body, then) {
|
|
2990
1627
|
var result = body();
|
|
@@ -2993,10 +1630,10 @@ function ChunkedStream_invoke(body, then) {
|
|
|
2993
1630
|
}
|
|
2994
1631
|
return then(result);
|
|
2995
1632
|
}
|
|
2996
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) ||
|
|
1633
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2997
1634
|
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."); }
|
|
2998
|
-
function
|
|
2999
|
-
function
|
|
1635
|
+
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); }
|
|
1636
|
+
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; }
|
|
3000
1637
|
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; } }
|
|
3001
1638
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
3002
1639
|
function ChunkedStream_await(value, then, direct) {
|
|
@@ -3201,37 +1838,37 @@ var ChunkedStream = /*#__PURE__*/function () {
|
|
|
3201
1838
|
}]);
|
|
3202
1839
|
return ChunkedStream;
|
|
3203
1840
|
}();
|
|
3204
|
-
;// CONCATENATED MODULE: ./src/
|
|
3205
|
-
function
|
|
3206
|
-
function
|
|
3207
|
-
function
|
|
3208
|
-
function
|
|
3209
|
-
function
|
|
3210
|
-
function
|
|
3211
|
-
function
|
|
3212
|
-
function
|
|
3213
|
-
function
|
|
3214
|
-
function
|
|
3215
|
-
function
|
|
3216
|
-
function
|
|
3217
|
-
function
|
|
3218
|
-
function
|
|
3219
|
-
function
|
|
3220
|
-
function
|
|
1841
|
+
;// CONCATENATED MODULE: ./src/uploads/UploadModel.ts
|
|
1842
|
+
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); }
|
|
1843
|
+
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); } }
|
|
1844
|
+
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; }
|
|
1845
|
+
function UploadModel_toPropertyKey(arg) { var key = UploadModel_toPrimitive(arg, "string"); return UploadModel_typeof(key) === "symbol" ? key : String(key); }
|
|
1846
|
+
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); }
|
|
1847
|
+
function UploadModel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
1848
|
+
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); }
|
|
1849
|
+
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); }; }
|
|
1850
|
+
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); }
|
|
1851
|
+
function UploadModel_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
1852
|
+
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); }
|
|
1853
|
+
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); }
|
|
1854
|
+
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; } }
|
|
1855
|
+
function UploadModel_isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
|
|
1856
|
+
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); }
|
|
1857
|
+
function UploadModel_getPrototypeOf(o) { UploadModel_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return UploadModel_getPrototypeOf(o); }
|
|
3221
1858
|
var CancelledError = /*#__PURE__*/function (_Error) {
|
|
3222
|
-
|
|
3223
|
-
var _super =
|
|
1859
|
+
UploadModel_inherits(CancelledError, _Error);
|
|
1860
|
+
var _super = UploadModel_createSuper(CancelledError);
|
|
3224
1861
|
function CancelledError(msg) {
|
|
3225
1862
|
var _this;
|
|
3226
|
-
|
|
1863
|
+
UploadModel_classCallCheck(this, CancelledError);
|
|
3227
1864
|
_this = _super.call(this, msg);
|
|
3228
1865
|
_this.msg = msg;
|
|
3229
1866
|
_this.name = "CancelledError";
|
|
3230
1867
|
return _this;
|
|
3231
1868
|
}
|
|
3232
|
-
return
|
|
3233
|
-
}( /*#__PURE__*/
|
|
3234
|
-
;// CONCATENATED MODULE: ./src/
|
|
1869
|
+
return UploadModel_createClass(CancelledError);
|
|
1870
|
+
}( /*#__PURE__*/UploadModel_wrapNativeSuper(Error));
|
|
1871
|
+
;// CONCATENATED MODULE: ./src/uploads/UploadManager.ts
|
|
3235
1872
|
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); }
|
|
3236
1873
|
function UploadManager_async(f) {
|
|
3237
1874
|
return function () {
|
|
@@ -3246,7 +1883,7 @@ function UploadManager_async(f) {
|
|
|
3246
1883
|
};
|
|
3247
1884
|
}
|
|
3248
1885
|
function UploadManager_empty() {}
|
|
3249
|
-
function
|
|
1886
|
+
function _awaitIgnored(value, direct) {
|
|
3250
1887
|
if (!direct) {
|
|
3251
1888
|
return value && value.then ? value.then(UploadManager_empty) : Promise.resolve();
|
|
3252
1889
|
}
|
|
@@ -3258,27 +1895,27 @@ function UploadManager_invoke(body, then) {
|
|
|
3258
1895
|
}
|
|
3259
1896
|
return then(result);
|
|
3260
1897
|
}
|
|
3261
|
-
function
|
|
1898
|
+
function _invokeIgnored(body) {
|
|
3262
1899
|
var result = body();
|
|
3263
1900
|
if (result && result.then) {
|
|
3264
1901
|
return result.then(UploadManager_empty);
|
|
3265
1902
|
}
|
|
3266
1903
|
}
|
|
3267
|
-
function
|
|
1904
|
+
function _settle(pact, state, value) {
|
|
3268
1905
|
if (!pact.s) {
|
|
3269
|
-
if (value instanceof
|
|
1906
|
+
if (value instanceof _Pact) {
|
|
3270
1907
|
if (value.s) {
|
|
3271
1908
|
if (state & 1) {
|
|
3272
1909
|
state = value.s;
|
|
3273
1910
|
}
|
|
3274
1911
|
value = value.v;
|
|
3275
1912
|
} else {
|
|
3276
|
-
value.o =
|
|
1913
|
+
value.o = _settle.bind(null, pact, state);
|
|
3277
1914
|
return;
|
|
3278
1915
|
}
|
|
3279
1916
|
}
|
|
3280
1917
|
if (value && value.then) {
|
|
3281
|
-
value.then(
|
|
1918
|
+
value.then(_settle.bind(null, pact, state), _settle.bind(null, pact, 2));
|
|
3282
1919
|
return;
|
|
3283
1920
|
}
|
|
3284
1921
|
pact.s = state;
|
|
@@ -3289,7 +1926,7 @@ function UploadManager_settle(pact, state, value) {
|
|
|
3289
1926
|
}
|
|
3290
1927
|
}
|
|
3291
1928
|
}
|
|
3292
|
-
var
|
|
1929
|
+
var _Pact = /*#__PURE__*/function () {
|
|
3293
1930
|
function _Pact() {}
|
|
3294
1931
|
_Pact.prototype.then = function (onFulfilled, onRejected) {
|
|
3295
1932
|
var result = new _Pact();
|
|
@@ -3298,9 +1935,9 @@ var UploadManager_Pact = /*#__PURE__*/function () {
|
|
|
3298
1935
|
var callback = state & 1 ? onFulfilled : onRejected;
|
|
3299
1936
|
if (callback) {
|
|
3300
1937
|
try {
|
|
3301
|
-
|
|
1938
|
+
_settle(result, 1, callback(this.v));
|
|
3302
1939
|
} catch (e) {
|
|
3303
|
-
|
|
1940
|
+
_settle(result, 2, e);
|
|
3304
1941
|
}
|
|
3305
1942
|
return result;
|
|
3306
1943
|
} else {
|
|
@@ -3311,28 +1948,28 @@ var UploadManager_Pact = /*#__PURE__*/function () {
|
|
|
3311
1948
|
try {
|
|
3312
1949
|
var value = _this.v;
|
|
3313
1950
|
if (_this.s & 1) {
|
|
3314
|
-
|
|
1951
|
+
_settle(result, 1, onFulfilled ? onFulfilled(value) : value);
|
|
3315
1952
|
} else if (onRejected) {
|
|
3316
|
-
|
|
1953
|
+
_settle(result, 1, onRejected(value));
|
|
3317
1954
|
} else {
|
|
3318
|
-
|
|
1955
|
+
_settle(result, 2, value);
|
|
3319
1956
|
}
|
|
3320
1957
|
} catch (e) {
|
|
3321
|
-
|
|
1958
|
+
_settle(result, 2, e);
|
|
3322
1959
|
}
|
|
3323
1960
|
};
|
|
3324
1961
|
return result;
|
|
3325
1962
|
};
|
|
3326
1963
|
return _Pact;
|
|
3327
1964
|
}();
|
|
3328
|
-
function
|
|
3329
|
-
return thenable instanceof
|
|
1965
|
+
function _isSettledPact(thenable) {
|
|
1966
|
+
return thenable instanceof _Pact && thenable.s & 1;
|
|
3330
1967
|
}
|
|
3331
1968
|
function _for(test, update, body) {
|
|
3332
1969
|
var stage;
|
|
3333
1970
|
for (;;) {
|
|
3334
1971
|
var shouldContinue = test();
|
|
3335
|
-
if (
|
|
1972
|
+
if (_isSettledPact(shouldContinue)) {
|
|
3336
1973
|
shouldContinue = shouldContinue.v;
|
|
3337
1974
|
}
|
|
3338
1975
|
if (!shouldContinue) {
|
|
@@ -3344,7 +1981,7 @@ function _for(test, update, body) {
|
|
|
3344
1981
|
}
|
|
3345
1982
|
var result = body();
|
|
3346
1983
|
if (result && result.then) {
|
|
3347
|
-
if (
|
|
1984
|
+
if (_isSettledPact(result)) {
|
|
3348
1985
|
result = result.s;
|
|
3349
1986
|
} else {
|
|
3350
1987
|
stage = 1;
|
|
@@ -3353,14 +1990,14 @@ function _for(test, update, body) {
|
|
|
3353
1990
|
}
|
|
3354
1991
|
if (update) {
|
|
3355
1992
|
var updateValue = update();
|
|
3356
|
-
if (updateValue && updateValue.then && !
|
|
1993
|
+
if (updateValue && updateValue.then && !_isSettledPact(updateValue)) {
|
|
3357
1994
|
stage = 2;
|
|
3358
1995
|
break;
|
|
3359
1996
|
}
|
|
3360
1997
|
}
|
|
3361
1998
|
}
|
|
3362
|
-
var pact = new
|
|
3363
|
-
var reject =
|
|
1999
|
+
var pact = new _Pact();
|
|
2000
|
+
var reject = _settle.bind(null, pact, 2);
|
|
3364
2001
|
(stage === 0 ? shouldContinue.then(_resumeAfterTest) : stage === 1 ? result.then(_resumeAfterBody) : updateValue.then(_resumeAfterUpdate)).then(void 0, reject);
|
|
3365
2002
|
return pact;
|
|
3366
2003
|
function _resumeAfterBody(value) {
|
|
@@ -3368,14 +2005,14 @@ function _for(test, update, body) {
|
|
|
3368
2005
|
do {
|
|
3369
2006
|
if (update) {
|
|
3370
2007
|
updateValue = update();
|
|
3371
|
-
if (updateValue && updateValue.then && !
|
|
2008
|
+
if (updateValue && updateValue.then && !_isSettledPact(updateValue)) {
|
|
3372
2009
|
updateValue.then(_resumeAfterUpdate).then(void 0, reject);
|
|
3373
2010
|
return;
|
|
3374
2011
|
}
|
|
3375
2012
|
}
|
|
3376
2013
|
shouldContinue = test();
|
|
3377
|
-
if (!shouldContinue ||
|
|
3378
|
-
|
|
2014
|
+
if (!shouldContinue || _isSettledPact(shouldContinue) && !shouldContinue.v) {
|
|
2015
|
+
_settle(pact, 1, result);
|
|
3379
2016
|
return;
|
|
3380
2017
|
}
|
|
3381
2018
|
if (shouldContinue.then) {
|
|
@@ -3383,7 +2020,7 @@ function _for(test, update, body) {
|
|
|
3383
2020
|
return;
|
|
3384
2021
|
}
|
|
3385
2022
|
result = body();
|
|
3386
|
-
if (
|
|
2023
|
+
if (_isSettledPact(result)) {
|
|
3387
2024
|
result = result.v;
|
|
3388
2025
|
}
|
|
3389
2026
|
} while (!result || !result.then);
|
|
@@ -3398,7 +2035,7 @@ function _for(test, update, body) {
|
|
|
3398
2035
|
_resumeAfterBody(result);
|
|
3399
2036
|
}
|
|
3400
2037
|
} else {
|
|
3401
|
-
|
|
2038
|
+
_settle(pact, 1, result);
|
|
3402
2039
|
}
|
|
3403
2040
|
}
|
|
3404
2041
|
function _resumeAfterUpdate() {
|
|
@@ -3409,7 +2046,7 @@ function _for(test, update, body) {
|
|
|
3409
2046
|
_resumeAfterTest(shouldContinue);
|
|
3410
2047
|
}
|
|
3411
2048
|
} else {
|
|
3412
|
-
|
|
2049
|
+
_settle(pact, 1, result);
|
|
3413
2050
|
}
|
|
3414
2051
|
}
|
|
3415
2052
|
}
|
|
@@ -3418,11 +2055,11 @@ function _continueIgnored(value) {
|
|
|
3418
2055
|
return value.then(UploadManager_empty);
|
|
3419
2056
|
}
|
|
3420
2057
|
}
|
|
3421
|
-
function
|
|
3422
|
-
function
|
|
2058
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || UploadManager_unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2059
|
+
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."); }
|
|
3423
2060
|
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); }
|
|
3424
|
-
function
|
|
3425
|
-
function
|
|
2061
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
2062
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return UploadManager_arrayLikeToArray(arr); }
|
|
3426
2063
|
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; }
|
|
3427
2064
|
function UploadManager_await(value, then, direct) {
|
|
3428
2065
|
if (direct) {
|
|
@@ -3443,13 +2080,12 @@ function UploadManager_toPrimitive(input, hint) { if (UploadManager_typeof(input
|
|
|
3443
2080
|
|
|
3444
2081
|
|
|
3445
2082
|
var UploadManager = /*#__PURE__*/function () {
|
|
3446
|
-
function UploadManager() {
|
|
3447
|
-
var configuration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DefaultConfig;
|
|
2083
|
+
function UploadManager(config) {
|
|
3448
2084
|
UploadManager_classCallCheck(this, UploadManager);
|
|
3449
|
-
this.
|
|
2085
|
+
this.config = config;
|
|
3450
2086
|
this.stringMimeType = "text/plain";
|
|
3451
2087
|
this.defaultMaxConcurrentUploadParts = 4;
|
|
3452
|
-
this.uploadApi = new UploadApi(
|
|
2088
|
+
this.uploadApi = new UploadApi(config);
|
|
3453
2089
|
}
|
|
3454
2090
|
UploadManager_createClass(UploadManager, [{
|
|
3455
2091
|
key: "upload",
|
|
@@ -3462,7 +2098,7 @@ var UploadManager = /*#__PURE__*/function () {
|
|
|
3462
2098
|
_this2.checkIfCancelled(request);
|
|
3463
2099
|
var maxConcurrency = _this2.calculateMaxConcurrency(request, data);
|
|
3464
2100
|
var partCount = uploadInfo.uploadParts.count;
|
|
3465
|
-
var parts =
|
|
2101
|
+
var parts = _toConsumableArray(Array(partCount).keys());
|
|
3466
2102
|
var runSourceStreamPump = chunkedStream === null || chunkedStream === void 0 ? void 0 : chunkedStream.runChunkPipeline();
|
|
3467
2103
|
return UploadManager_await(_this2.mapAsync(parts, maxConcurrency, UploadManager_async(function (part) {
|
|
3468
2104
|
return _this2.uploadPart(request, data, part, uploadInfo);
|
|
@@ -3522,7 +2158,7 @@ var UploadManager = /*#__PURE__*/function () {
|
|
|
3522
2158
|
_this6.checkIfCancelled(request);
|
|
3523
2159
|
return UploadManager_await(_this6.putUploadPart(part, data), function (etag) {
|
|
3524
2160
|
_this6.checkIfCancelled(request);
|
|
3525
|
-
return
|
|
2161
|
+
return _awaitIgnored(_this6.uploadApi.completeUploadPart({
|
|
3526
2162
|
accountId: request.accountId,
|
|
3527
2163
|
uploadId: uploadInfo.uploadId,
|
|
3528
2164
|
uploadPartIndex: partIndex,
|
|
@@ -3545,7 +2181,7 @@ var UploadManager = /*#__PURE__*/function () {
|
|
|
3545
2181
|
try {
|
|
3546
2182
|
var _this8 = this;
|
|
3547
2183
|
var _a, _b;
|
|
3548
|
-
var fetchApi = (_a = _this8.
|
|
2184
|
+
var fetchApi = (_a = _this8.config.fetchApi) !== null && _a !== void 0 ? _a : fetch;
|
|
3549
2185
|
var headers = {
|
|
3550
2186
|
// Required to prevent fetch using "Transfer-Encoding: Chunked" when body is a stream.
|
|
3551
2187
|
"content-length": (part.range.inclusiveEnd + 1 - part.range.inclusiveStart).toString()
|
|
@@ -3912,15 +2548,15 @@ var UploadManager = /*#__PURE__*/function () {
|
|
|
3912
2548
|
key: "mapAsync",
|
|
3913
2549
|
value: function mapAsync(items, concurrency, callback) {
|
|
3914
2550
|
try {
|
|
3915
|
-
var workQueue =
|
|
3916
|
-
return
|
|
2551
|
+
var workQueue = _toConsumableArray(items);
|
|
2552
|
+
return _awaitIgnored(Promise.all(_toConsumableArray(Array(concurrency).keys()).map(UploadManager_async(function () {
|
|
3917
2553
|
return _continueIgnored(_for(function () {
|
|
3918
2554
|
return workQueue.length > 0;
|
|
3919
2555
|
}, void 0, function () {
|
|
3920
2556
|
var work = workQueue.shift(); // IMPORTANT: use 'shift' instead of 'pop' to ensure 'items' are processed in order when 'concurrency = 1'.
|
|
3921
|
-
return
|
|
2557
|
+
return _invokeIgnored(function () {
|
|
3922
2558
|
if (work !== undefined) {
|
|
3923
|
-
return
|
|
2559
|
+
return _awaitIgnored(callback(work));
|
|
3924
2560
|
}
|
|
3925
2561
|
});
|
|
3926
2562
|
}));
|
|
@@ -3932,7 +2568,7 @@ var UploadManager = /*#__PURE__*/function () {
|
|
|
3932
2568
|
}]);
|
|
3933
2569
|
return UploadManager;
|
|
3934
2570
|
}();
|
|
3935
|
-
;// CONCATENATED MODULE: ./src/
|
|
2571
|
+
;// CONCATENATED MODULE: ./src/uploads/index.ts
|
|
3936
2572
|
|
|
3937
2573
|
|
|
3938
2574
|
|