@eluvio/elv-client-js 3.2.44 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ElvClient-min.js +17 -9
- package/dist/ElvClient-node-min.js +12 -25
- package/dist/ElvFrameClient-min.js +17 -9
- package/dist/ElvPermissionsClient-min.js +16 -8
- package/dist/ElvWalletClient-min.js +17 -9
- package/dist/ElvWalletClient-node-min.js +12 -25
- package/dist/src/AuthorizationClient.js +6 -6
- package/dist/src/ElvClient.js +3 -3
- package/dist/src/ElvWallet.js +1 -3
- package/dist/src/EthClient.js +21 -12
- package/dist/src/FrameClient.js +10 -7
- package/dist/src/HttpClient.js +3 -3
- package/dist/src/client/ABRPublishing.js +150 -103
- package/dist/src/client/ContentAccess.js +32 -15
- package/dist/src/client/ContentManagement.js +33 -24
- package/dist/src/client/Contracts.js +1 -1
- package/dist/src/walletClient/ClientMethods.js +573 -645
- package/dist/src/walletClient/index.js +47 -43
- package/package.json +2 -2
- package/src/AuthorizationClient.js +6 -6
- package/src/ElvClient.js +3 -2
- package/src/ElvWallet.js +1 -3
- package/src/EthClient.js +19 -10
- package/src/FrameClient.js +10 -2
- package/src/HttpClient.js +3 -3
- package/src/client/ABRPublishing.js +71 -32
- package/src/client/ContentAccess.js +19 -8
- package/src/client/ContentManagement.js +21 -14
- package/src/client/Contracts.js +1 -1
- package/testScripts/Test.js +7 -36
|
@@ -45,6 +45,8 @@ var _require = require("../Validation"),
|
|
|
45
45
|
* @param {boolean=} encrypt=true - (Local or copied files only) - Unless `false` is passed in explicitly, any uploaded/copied files will be stored encrypted
|
|
46
46
|
* @param {boolean=} copy=false - (S3) If specified, files will be copied from S3
|
|
47
47
|
* @param {function=} callback - Progress callback for file upload (See UploadFiles/UploadFilesFromS3 method)
|
|
48
|
+
* @param {("warn"|"info"|"debug")=} respLogLevel=warn - The level of logging to return in http response
|
|
49
|
+
* @param {("none"|"error"|"warn"|"info"|"debug")=} structLogLevel=none - The level of logging to save to object metadata
|
|
48
50
|
* @param {Array<Object>=} access=[] - Array of cloud credentials, along with path matching regex strings - Required if any files in the masters are cloud references (currently only AWS S3 is supported)
|
|
49
51
|
* - If this parameter is non-empty, all items in fileInfo are assumed to be items in cloud storage
|
|
50
52
|
* - Format: [
|
|
@@ -81,13 +83,13 @@ var _require = require("../Validation"),
|
|
|
81
83
|
|
|
82
84
|
exports.CreateProductionMaster = /*#__PURE__*/function () {
|
|
83
85
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
84
|
-
var libraryId, type, name, description, _ref$metadata, metadata, fileInfo, _ref$encrypt, encrypt, _ref$access, access, _ref$copy, copy, callback, _yield$this$CreateCon, id, write_token, s3prefixRegex, i, oneFileInfo, matched, j, credentialSet, credentialSetBucket, matchers, k, matcher, fileSourcePath, s3prefixMatch, bucketName, _i, _credentialSet, region, bucket, accessKey, secret, _yield$this$CallBitco, logs, errors, warnings, finalizeResponse;
|
|
86
|
+
var libraryId, type, name, description, _ref$metadata, metadata, fileInfo, _ref$encrypt, encrypt, _ref$access, access, _ref$copy, copy, callback, _ref$respLogLevel, respLogLevel, _ref$structLogLevel, structLogLevel, _yield$this$CreateCon, id, write_token, s3prefixRegex, i, oneFileInfo, matched, j, credentialSet, credentialSetBucket, matchers, k, matcher, fileSourcePath, s3prefixMatch, bucketName, _i, _credentialSet, region, bucket, accessKey, secret, _yield$this$CallBitco, logs, errors, warnings, finalizeResponse;
|
|
85
87
|
|
|
86
88
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
87
89
|
while (1) {
|
|
88
90
|
switch (_context.prev = _context.next) {
|
|
89
91
|
case 0:
|
|
90
|
-
libraryId = _ref.libraryId, type = _ref.type, name = _ref.name, description = _ref.description, _ref$metadata = _ref.metadata, metadata = _ref$metadata === void 0 ? {} : _ref$metadata, fileInfo = _ref.fileInfo, _ref$encrypt = _ref.encrypt, encrypt = _ref$encrypt === void 0 ? true : _ref$encrypt, _ref$access = _ref.access, access = _ref$access === void 0 ? [] : _ref$access, _ref$copy = _ref.copy, copy = _ref$copy === void 0 ? false : _ref$copy, callback = _ref.callback;
|
|
92
|
+
libraryId = _ref.libraryId, type = _ref.type, name = _ref.name, description = _ref.description, _ref$metadata = _ref.metadata, metadata = _ref$metadata === void 0 ? {} : _ref$metadata, fileInfo = _ref.fileInfo, _ref$encrypt = _ref.encrypt, encrypt = _ref$encrypt === void 0 ? true : _ref$encrypt, _ref$access = _ref.access, access = _ref$access === void 0 ? [] : _ref$access, _ref$copy = _ref.copy, copy = _ref$copy === void 0 ? false : _ref$copy, callback = _ref.callback, _ref$respLogLevel = _ref.respLogLevel, respLogLevel = _ref$respLogLevel === void 0 ? "warn" : _ref$respLogLevel, _ref$structLogLevel = _ref.structLogLevel, structLogLevel = _ref$structLogLevel === void 0 ? "none" : _ref$structLogLevel;
|
|
91
93
|
ValidateLibrary(libraryId);
|
|
92
94
|
_context.next = 4;
|
|
93
95
|
return this.CreateContentObject({
|
|
@@ -275,6 +277,10 @@ exports.CreateProductionMaster = /*#__PURE__*/function () {
|
|
|
275
277
|
objectId: id,
|
|
276
278
|
writeToken: write_token,
|
|
277
279
|
method: UrlJoin("media", "production_master", "init"),
|
|
280
|
+
queryParams: {
|
|
281
|
+
response_log_level: respLogLevel,
|
|
282
|
+
struct_log_level: structLogLevel
|
|
283
|
+
},
|
|
278
284
|
body: {
|
|
279
285
|
access: access
|
|
280
286
|
},
|
|
@@ -334,20 +340,25 @@ exports.CreateProductionMaster = /*#__PURE__*/function () {
|
|
|
334
340
|
};
|
|
335
341
|
}();
|
|
336
342
|
/**
|
|
337
|
-
* Create a mezzanine
|
|
343
|
+
* Create (or edit) a mezzanine offering based on the a given master content object version and variant key
|
|
338
344
|
*
|
|
339
345
|
* @methodGroup ABR Publishing
|
|
340
346
|
* @namedParams
|
|
347
|
+
* @param {Object=} abrProfile - Custom ABR profile. If not specified, the profile of the mezzanine library will be used
|
|
348
|
+
* @param {Object=} addlOfferingSpecs - Specs for additional offerings to create by patching the offering being created/edited
|
|
349
|
+
* @param {string=} description - Description for mezzanine content object
|
|
350
|
+
* @param {boolean=} keepOtherStreams=false - If objectId is specified, whether to preserve existing streams with keys other than the ones specified in production master
|
|
341
351
|
* @param {string} libraryId - ID of the mezzanine library
|
|
352
|
+
* @param {string} masterVersionHash - The version hash of the production master content object
|
|
353
|
+
* @param {Object=} metadata - Additional metadata for mezzanine content object
|
|
354
|
+
* @param {string} name - Name for mezzanine content object
|
|
342
355
|
* @param {string=} objectId - ID of existing object (if not specified, new object will be created)
|
|
356
|
+
* @param {string=} offeringKey=default - The key of the offering to create
|
|
357
|
+
* @param {("warn"|"info"|"debug")=} respLogLevel=warn - The level of logging to return in http response
|
|
358
|
+
* @param {("none"|"error"|"warn"|"info"|"debug")=} structLogLevel=none - The level of logging to save to object metadata
|
|
359
|
+
* @param {Array<string>} streamKeys - List of stream keys from variant to include. If not supplied all streams will be included.
|
|
343
360
|
* @param {string=} type - ID or version hash of the content type for the mezzanine
|
|
344
|
-
* @param {string} name - Name for mezzanine content object
|
|
345
|
-
* @param {string=} description - Description for mezzanine content object
|
|
346
|
-
* @param {Object=} metadata - Additional metadata for mezzanine content object
|
|
347
|
-
* @param {string} masterVersionHash - The version hash of the production master content object
|
|
348
361
|
* @param {string=} variant=default - What variant of the master content object to use
|
|
349
|
-
* @param {string=} offeringKey=default - The key of the offering to create
|
|
350
|
-
* @param {Object=} abrProfile - Custom ABR profile. If not specified, the profile of the mezzanine library will be used
|
|
351
362
|
*
|
|
352
363
|
* @return {Object} - The finalize response for the object, as well as logs, warnings and errors from the mezzanine initialization
|
|
353
364
|
*/
|
|
@@ -355,13 +366,13 @@ exports.CreateProductionMaster = /*#__PURE__*/function () {
|
|
|
355
366
|
|
|
356
367
|
exports.CreateABRMezzanine = /*#__PURE__*/function () {
|
|
357
368
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref3) {
|
|
358
|
-
var libraryId, objectId, type, name, description, metadata, masterVersionHash, abrProfile, _ref3$variant, variant, _ref3$offeringKey, offeringKey, existingMez, options, id, write_token, editResponse, createResponse, masterName, authorizationTokens, headers, body, storeClear, _yield$this$CallBitco2, logs, errors, warnings, existingMetadata, finalizeResponse;
|
|
369
|
+
var libraryId, objectId, type, name, description, metadata, masterVersionHash, abrProfile, addlOfferingSpecs, _ref3$variant, variant, _ref3$offeringKey, offeringKey, _ref3$keepOtherStream, keepOtherStreams, _ref3$respLogLevel, respLogLevel, _ref3$structLogLevel, structLogLevel, streamKeys, existingMez, options, id, write_token, editResponse, createResponse, masterName, authorizationTokens, headers, body, storeClear, _yield$this$CallBitco2, logs, errors, warnings, existingMetadata, finalizeResponse;
|
|
359
370
|
|
|
360
371
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
361
372
|
while (1) {
|
|
362
373
|
switch (_context2.prev = _context2.next) {
|
|
363
374
|
case 0:
|
|
364
|
-
libraryId = _ref3.libraryId, objectId = _ref3.objectId, type = _ref3.type, name = _ref3.name, description = _ref3.description, metadata = _ref3.metadata, masterVersionHash = _ref3.masterVersionHash, abrProfile = _ref3.abrProfile, _ref3$variant = _ref3.variant, variant = _ref3$variant === void 0 ? "default" : _ref3$variant, _ref3$offeringKey = _ref3.offeringKey, offeringKey = _ref3$offeringKey === void 0 ? "default" : _ref3$offeringKey;
|
|
375
|
+
libraryId = _ref3.libraryId, objectId = _ref3.objectId, type = _ref3.type, name = _ref3.name, description = _ref3.description, metadata = _ref3.metadata, masterVersionHash = _ref3.masterVersionHash, abrProfile = _ref3.abrProfile, addlOfferingSpecs = _ref3.addlOfferingSpecs, _ref3$variant = _ref3.variant, variant = _ref3$variant === void 0 ? "default" : _ref3$variant, _ref3$offeringKey = _ref3.offeringKey, offeringKey = _ref3$offeringKey === void 0 ? "default" : _ref3$offeringKey, _ref3$keepOtherStream = _ref3.keepOtherStreams, keepOtherStreams = _ref3$keepOtherStream === void 0 ? false : _ref3$keepOtherStream, _ref3$respLogLevel = _ref3.respLogLevel, respLogLevel = _ref3$respLogLevel === void 0 ? "warn" : _ref3$respLogLevel, _ref3$structLogLevel = _ref3.structLogLevel, structLogLevel = _ref3$structLogLevel === void 0 ? "none" : _ref3$structLogLevel, streamKeys = _ref3.streamKeys;
|
|
365
376
|
ValidateLibrary(libraryId);
|
|
366
377
|
ValidateVersion(masterVersionHash);
|
|
367
378
|
|
|
@@ -373,44 +384,60 @@ exports.CreateABRMezzanine = /*#__PURE__*/function () {
|
|
|
373
384
|
throw Error("Master version hash not specified");
|
|
374
385
|
|
|
375
386
|
case 5:
|
|
387
|
+
if (!(!objectId && keepOtherStreams)) {
|
|
388
|
+
_context2.next = 7;
|
|
389
|
+
break;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
throw Error("Existing mezzanine object ID required in order to use 'keepOtherStreams'");
|
|
393
|
+
|
|
394
|
+
case 7:
|
|
395
|
+
if (!(addlOfferingSpecs && !abrProfile)) {
|
|
396
|
+
_context2.next = 9;
|
|
397
|
+
break;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
throw Error("abrProfile required when using addlOfferingSpecs");
|
|
401
|
+
|
|
402
|
+
case 9:
|
|
376
403
|
existingMez = !!objectId;
|
|
377
404
|
options = type ? {
|
|
378
405
|
type: type
|
|
379
406
|
} : {};
|
|
380
407
|
|
|
381
408
|
if (!existingMez) {
|
|
382
|
-
_context2.next =
|
|
409
|
+
_context2.next = 19;
|
|
383
410
|
break;
|
|
384
411
|
}
|
|
385
412
|
|
|
386
|
-
_context2.next =
|
|
413
|
+
_context2.next = 14;
|
|
387
414
|
return this.EditContentObject({
|
|
388
415
|
libraryId: libraryId,
|
|
389
416
|
objectId: objectId,
|
|
390
417
|
options: options
|
|
391
418
|
});
|
|
392
419
|
|
|
393
|
-
case
|
|
420
|
+
case 14:
|
|
394
421
|
editResponse = _context2.sent;
|
|
395
422
|
id = editResponse.id;
|
|
396
423
|
write_token = editResponse.write_token;
|
|
397
|
-
_context2.next =
|
|
424
|
+
_context2.next = 24;
|
|
398
425
|
break;
|
|
399
426
|
|
|
400
|
-
case
|
|
401
|
-
_context2.next =
|
|
427
|
+
case 19:
|
|
428
|
+
_context2.next = 21;
|
|
402
429
|
return this.CreateContentObject({
|
|
403
430
|
libraryId: libraryId,
|
|
404
431
|
options: options
|
|
405
432
|
});
|
|
406
433
|
|
|
407
|
-
case
|
|
434
|
+
case 21:
|
|
408
435
|
createResponse = _context2.sent;
|
|
409
436
|
id = createResponse.id;
|
|
410
437
|
write_token = createResponse.write_token;
|
|
411
438
|
|
|
412
|
-
case
|
|
413
|
-
_context2.next =
|
|
439
|
+
case 24:
|
|
440
|
+
_context2.next = 26;
|
|
414
441
|
return this.CreateEncryptionConk({
|
|
415
442
|
libraryId: libraryId,
|
|
416
443
|
objectId: id,
|
|
@@ -418,48 +445,48 @@ exports.CreateABRMezzanine = /*#__PURE__*/function () {
|
|
|
418
445
|
createKMSConk: true
|
|
419
446
|
});
|
|
420
447
|
|
|
421
|
-
case
|
|
422
|
-
_context2.next =
|
|
448
|
+
case 26:
|
|
449
|
+
_context2.next = 28;
|
|
423
450
|
return this.ContentObjectMetadata({
|
|
424
451
|
versionHash: masterVersionHash,
|
|
425
452
|
metadataSubtree: "public/name"
|
|
426
453
|
});
|
|
427
454
|
|
|
428
|
-
case
|
|
455
|
+
case 28:
|
|
429
456
|
masterName = _context2.sent;
|
|
430
457
|
// Include authorization for library, master, and mezzanine
|
|
431
458
|
authorizationTokens = [];
|
|
432
459
|
_context2.t0 = authorizationTokens;
|
|
433
|
-
_context2.next =
|
|
460
|
+
_context2.next = 33;
|
|
434
461
|
return this.authClient.AuthorizationToken({
|
|
435
462
|
libraryId: libraryId,
|
|
436
463
|
objectId: id,
|
|
437
464
|
update: true
|
|
438
465
|
});
|
|
439
466
|
|
|
440
|
-
case
|
|
467
|
+
case 33:
|
|
441
468
|
_context2.t1 = _context2.sent;
|
|
442
469
|
|
|
443
470
|
_context2.t0.push.call(_context2.t0, _context2.t1);
|
|
444
471
|
|
|
445
472
|
_context2.t2 = authorizationTokens;
|
|
446
|
-
_context2.next =
|
|
473
|
+
_context2.next = 38;
|
|
447
474
|
return this.authClient.AuthorizationToken({
|
|
448
475
|
libraryId: libraryId
|
|
449
476
|
});
|
|
450
477
|
|
|
451
|
-
case
|
|
478
|
+
case 38:
|
|
452
479
|
_context2.t3 = _context2.sent;
|
|
453
480
|
|
|
454
481
|
_context2.t2.push.call(_context2.t2, _context2.t3);
|
|
455
482
|
|
|
456
483
|
_context2.t4 = authorizationTokens;
|
|
457
|
-
_context2.next =
|
|
484
|
+
_context2.next = 43;
|
|
458
485
|
return this.authClient.AuthorizationToken({
|
|
459
486
|
versionHash: masterVersionHash
|
|
460
487
|
});
|
|
461
488
|
|
|
462
|
-
case
|
|
489
|
+
case 43:
|
|
463
490
|
_context2.t5 = _context2.sent;
|
|
464
491
|
|
|
465
492
|
_context2.t4.push.call(_context2.t4, _context2.t5);
|
|
@@ -470,59 +497,66 @@ exports.CreateABRMezzanine = /*#__PURE__*/function () {
|
|
|
470
497
|
}).join(",")
|
|
471
498
|
};
|
|
472
499
|
body = {
|
|
500
|
+
additional_offering_specs: addlOfferingSpecs,
|
|
473
501
|
offering_key: offeringKey,
|
|
474
|
-
|
|
475
|
-
prod_master_hash: masterVersionHash
|
|
502
|
+
keep_other_streams: keepOtherStreams,
|
|
503
|
+
prod_master_hash: masterVersionHash,
|
|
504
|
+
stream_keys: streamKeys,
|
|
505
|
+
variant_key: variant
|
|
476
506
|
};
|
|
477
507
|
storeClear = false;
|
|
478
508
|
|
|
479
509
|
if (!abrProfile) {
|
|
480
|
-
_context2.next =
|
|
510
|
+
_context2.next = 53;
|
|
481
511
|
break;
|
|
482
512
|
}
|
|
483
513
|
|
|
484
514
|
body.abr_profile = abrProfile;
|
|
485
515
|
storeClear = abrProfile.store_clear;
|
|
486
|
-
_context2.next =
|
|
516
|
+
_context2.next = 56;
|
|
487
517
|
break;
|
|
488
518
|
|
|
489
|
-
case
|
|
490
|
-
_context2.next =
|
|
519
|
+
case 53:
|
|
520
|
+
_context2.next = 55;
|
|
491
521
|
return this.ContentObjectMetadata({
|
|
492
522
|
libraryId: libraryId,
|
|
493
523
|
objectId: this.utils.AddressToObjectId(this.utils.HashToAddress(libraryId)),
|
|
494
524
|
metadataSubtree: "abr_profile/store_clear"
|
|
495
525
|
});
|
|
496
526
|
|
|
497
|
-
case
|
|
527
|
+
case 55:
|
|
498
528
|
storeClear = _context2.sent;
|
|
499
529
|
|
|
500
|
-
case
|
|
530
|
+
case 56:
|
|
501
531
|
if (storeClear) {
|
|
502
|
-
_context2.next =
|
|
532
|
+
_context2.next = 59;
|
|
503
533
|
break;
|
|
504
534
|
}
|
|
505
535
|
|
|
506
|
-
_context2.next =
|
|
536
|
+
_context2.next = 59;
|
|
507
537
|
return this.EncryptionConk({
|
|
508
538
|
libraryId: libraryId,
|
|
509
539
|
objectId: id,
|
|
510
540
|
writeToken: write_token
|
|
511
541
|
});
|
|
512
542
|
|
|
513
|
-
case
|
|
514
|
-
_context2.next =
|
|
543
|
+
case 59:
|
|
544
|
+
_context2.next = 61;
|
|
515
545
|
return this.CallBitcodeMethod({
|
|
516
546
|
libraryId: libraryId,
|
|
517
547
|
objectId: id,
|
|
518
548
|
writeToken: write_token,
|
|
519
549
|
method: UrlJoin("media", "abr_mezzanine", "init"),
|
|
550
|
+
queryParams: {
|
|
551
|
+
response_log_level: respLogLevel,
|
|
552
|
+
struct_log_level: structLogLevel
|
|
553
|
+
},
|
|
520
554
|
headers: headers,
|
|
521
555
|
body: body,
|
|
522
556
|
constant: false
|
|
523
557
|
});
|
|
524
558
|
|
|
525
|
-
case
|
|
559
|
+
case 61:
|
|
526
560
|
_yield$this$CallBitco2 = _context2.sent;
|
|
527
561
|
logs = _yield$this$CallBitco2.logs;
|
|
528
562
|
errors = _yield$this$CallBitco2.errors;
|
|
@@ -564,14 +598,14 @@ exports.CreateABRMezzanine = /*#__PURE__*/function () {
|
|
|
564
598
|
} // retrieve existing metadata to merge with updated metadata
|
|
565
599
|
|
|
566
600
|
|
|
567
|
-
_context2.next =
|
|
601
|
+
_context2.next = 75;
|
|
568
602
|
return this.ContentObjectMetadata({
|
|
569
603
|
libraryId: libraryId,
|
|
570
604
|
objectId: id,
|
|
571
605
|
writeToken: write_token
|
|
572
606
|
});
|
|
573
607
|
|
|
574
|
-
case
|
|
608
|
+
case 75:
|
|
575
609
|
existingMetadata = _context2.sent;
|
|
576
610
|
// newer metadata values replace existing metadata, unless both new and old values are objects,
|
|
577
611
|
// in which case their keys are merged recursively
|
|
@@ -583,7 +617,7 @@ exports.CreateABRMezzanine = /*#__PURE__*/function () {
|
|
|
583
617
|
} // write metadata to mezzanine object
|
|
584
618
|
|
|
585
619
|
|
|
586
|
-
_context2.next =
|
|
620
|
+
_context2.next = 80;
|
|
587
621
|
return this.ReplaceMetadata({
|
|
588
622
|
libraryId: libraryId,
|
|
589
623
|
objectId: id,
|
|
@@ -591,8 +625,8 @@ exports.CreateABRMezzanine = /*#__PURE__*/function () {
|
|
|
591
625
|
metadata: metadata
|
|
592
626
|
});
|
|
593
627
|
|
|
594
|
-
case
|
|
595
|
-
_context2.next =
|
|
628
|
+
case 80:
|
|
629
|
+
_context2.next = 82;
|
|
596
630
|
return this.FinalizeContentObject({
|
|
597
631
|
libraryId: libraryId,
|
|
598
632
|
objectId: id,
|
|
@@ -600,7 +634,7 @@ exports.CreateABRMezzanine = /*#__PURE__*/function () {
|
|
|
600
634
|
commitMessage: "Create ABR mezzanine"
|
|
601
635
|
});
|
|
602
636
|
|
|
603
|
-
case
|
|
637
|
+
case 82:
|
|
604
638
|
finalizeResponse = _context2.sent;
|
|
605
639
|
return _context2.abrupt("return", _objectSpread({
|
|
606
640
|
logs: logs || [],
|
|
@@ -608,7 +642,7 @@ exports.CreateABRMezzanine = /*#__PURE__*/function () {
|
|
|
608
642
|
errors: errors || []
|
|
609
643
|
}, finalizeResponse));
|
|
610
644
|
|
|
611
|
-
case
|
|
645
|
+
case 84:
|
|
612
646
|
case "end":
|
|
613
647
|
return _context2.stop();
|
|
614
648
|
}
|
|
@@ -819,7 +853,7 @@ exports.StartABRMezzanineJobs = /*#__PURE__*/function () {
|
|
|
819
853
|
|
|
820
854
|
exports.LROStatus = /*#__PURE__*/function () {
|
|
821
855
|
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref8) {
|
|
822
|
-
var libraryId, objectId, _ref8$offeringKey, offeringKey, lroDraft, ready
|
|
856
|
+
var libraryId, objectId, _ref8$offeringKey, offeringKey, lroDraft, ready;
|
|
823
857
|
|
|
824
858
|
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
825
859
|
while (1) {
|
|
@@ -884,12 +918,8 @@ exports.LROStatus = /*#__PURE__*/function () {
|
|
|
884
918
|
throw Error("No LRO draft found for this mezzanine");
|
|
885
919
|
|
|
886
920
|
case 19:
|
|
887
|
-
|
|
888
|
-
_context5.
|
|
889
|
-
this.SetNodes({
|
|
890
|
-
fabricURIs: [lroDraft.node].concat(_toConsumableArray(fabricURIs))
|
|
891
|
-
});
|
|
892
|
-
_context5.next = 24;
|
|
921
|
+
this.HttpClient.RecordWriteToken(lroDraft.write_token, lroDraft.node);
|
|
922
|
+
_context5.next = 22;
|
|
893
923
|
return this.ContentObjectMetadata({
|
|
894
924
|
libraryId: libraryId,
|
|
895
925
|
objectId: objectId,
|
|
@@ -897,40 +927,15 @@ exports.LROStatus = /*#__PURE__*/function () {
|
|
|
897
927
|
metadataSubtree: "lro_status"
|
|
898
928
|
});
|
|
899
929
|
|
|
900
|
-
case
|
|
901
|
-
|
|
902
|
-
_context5.next = 30;
|
|
903
|
-
break;
|
|
904
|
-
|
|
905
|
-
case 27:
|
|
906
|
-
_context5.prev = 27;
|
|
907
|
-
_context5.t1 = _context5["catch"](20);
|
|
908
|
-
error = _context5.t1;
|
|
909
|
-
|
|
910
|
-
case 30:
|
|
911
|
-
_context5.prev = 30;
|
|
912
|
-
this.SetNodes({
|
|
913
|
-
fabricURIs: fabricURIs
|
|
914
|
-
});
|
|
915
|
-
return _context5.finish(30);
|
|
916
|
-
|
|
917
|
-
case 33:
|
|
918
|
-
if (!error) {
|
|
919
|
-
_context5.next = 35;
|
|
920
|
-
break;
|
|
921
|
-
}
|
|
922
|
-
|
|
923
|
-
throw error;
|
|
924
|
-
|
|
925
|
-
case 35:
|
|
926
|
-
return _context5.abrupt("return", result);
|
|
930
|
+
case 22:
|
|
931
|
+
return _context5.abrupt("return", _context5.sent);
|
|
927
932
|
|
|
928
|
-
case
|
|
933
|
+
case 23:
|
|
929
934
|
case "end":
|
|
930
935
|
return _context5.stop();
|
|
931
936
|
}
|
|
932
937
|
}
|
|
933
|
-
}, _callee5, this
|
|
938
|
+
}, _callee5, this);
|
|
934
939
|
}));
|
|
935
940
|
|
|
936
941
|
return function (_x5) {
|
|
@@ -946,6 +951,8 @@ exports.LROStatus = /*#__PURE__*/function () {
|
|
|
946
951
|
* @param {string} objectId - ID of the mezzanine object
|
|
947
952
|
* @param {string} writeToken - Write token for the mezzanine object
|
|
948
953
|
* @param {string=} offeringKey=default - The offering to process
|
|
954
|
+
* @param {function=} preFinalizeFn - A function to call before finalizing changes, to allow further modifications to offering. The function will be invoked with {elvClient, nodeUrl, writeToken} to allow access to the draft and MUST NOT finalize the draft.
|
|
955
|
+
* @param {boolean=} preFinalizeThrow - If set to `true` then any error thrown by preFinalizeFn will not be caught. Otherwise, any exception will be appended to the `warnings` array returned after finalization.
|
|
949
956
|
*
|
|
950
957
|
* @return {Promise<Object>} - The finalize response for the mezzanine object, as well as any logs, warnings and errors from the finalization
|
|
951
958
|
*/
|
|
@@ -953,13 +960,13 @@ exports.LROStatus = /*#__PURE__*/function () {
|
|
|
953
960
|
|
|
954
961
|
exports.FinalizeABRMezzanine = /*#__PURE__*/function () {
|
|
955
962
|
var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(_ref10) {
|
|
956
|
-
var libraryId, objectId, _ref10$offeringKey, offeringKey, lroDraft, httpClient, error, result, mezzanineMetadata, masterHash, authorizationTokens, headers, _yield$this$CallBitco4, data, errors, warnings, logs, finalizeResponse;
|
|
963
|
+
var libraryId, objectId, _ref10$offeringKey, offeringKey, preFinalizeFn, preFinalizeThrow, lroDraft, httpClient, error, result, mezzanineMetadata, masterHash, authorizationTokens, headers, _yield$this$CallBitco4, data, errors, warnings, logs, preFinalizeWarnings, params, finalizeResponse;
|
|
957
964
|
|
|
958
965
|
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
959
966
|
while (1) {
|
|
960
967
|
switch (_context6.prev = _context6.next) {
|
|
961
968
|
case 0:
|
|
962
|
-
libraryId = _ref10.libraryId, objectId = _ref10.objectId, _ref10$offeringKey = _ref10.offeringKey, offeringKey = _ref10$offeringKey === void 0 ? "default" : _ref10$offeringKey;
|
|
969
|
+
libraryId = _ref10.libraryId, objectId = _ref10.objectId, _ref10$offeringKey = _ref10.offeringKey, offeringKey = _ref10$offeringKey === void 0 ? "default" : _ref10$offeringKey, preFinalizeFn = _ref10.preFinalizeFn, preFinalizeThrow = _ref10.preFinalizeThrow;
|
|
963
970
|
ValidateParameters({
|
|
964
971
|
libraryId: libraryId,
|
|
965
972
|
objectId: objectId
|
|
@@ -1039,7 +1046,47 @@ exports.FinalizeABRMezzanine = /*#__PURE__*/function () {
|
|
|
1039
1046
|
errors = _yield$this$CallBitco4.errors;
|
|
1040
1047
|
warnings = _yield$this$CallBitco4.warnings;
|
|
1041
1048
|
logs = _yield$this$CallBitco4.logs;
|
|
1042
|
-
|
|
1049
|
+
preFinalizeWarnings = [];
|
|
1050
|
+
|
|
1051
|
+
if (!preFinalizeFn) {
|
|
1052
|
+
_context6.next = 45;
|
|
1053
|
+
break;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
params = {
|
|
1057
|
+
elvClient: this,
|
|
1058
|
+
nodeUrl: lroDraft.node,
|
|
1059
|
+
writeToken: lroDraft.write_token
|
|
1060
|
+
};
|
|
1061
|
+
|
|
1062
|
+
if (!preFinalizeThrow) {
|
|
1063
|
+
_context6.next = 37;
|
|
1064
|
+
break;
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
_context6.next = 35;
|
|
1068
|
+
return preFinalizeFn(params);
|
|
1069
|
+
|
|
1070
|
+
case 35:
|
|
1071
|
+
_context6.next = 45;
|
|
1072
|
+
break;
|
|
1073
|
+
|
|
1074
|
+
case 37:
|
|
1075
|
+
_context6.prev = 37;
|
|
1076
|
+
_context6.next = 40;
|
|
1077
|
+
return preFinalizeFn(params);
|
|
1078
|
+
|
|
1079
|
+
case 40:
|
|
1080
|
+
_context6.next = 45;
|
|
1081
|
+
break;
|
|
1082
|
+
|
|
1083
|
+
case 42:
|
|
1084
|
+
_context6.prev = 42;
|
|
1085
|
+
_context6.t2 = _context6["catch"](37);
|
|
1086
|
+
preFinalizeWarnings = "Error trying to set video stream codec descriptors: ".concat(_context6.t2);
|
|
1087
|
+
|
|
1088
|
+
case 45:
|
|
1089
|
+
_context6.next = 47;
|
|
1043
1090
|
return this.FinalizeContentObject({
|
|
1044
1091
|
libraryId: libraryId,
|
|
1045
1092
|
objectId: objectId,
|
|
@@ -1048,45 +1095,45 @@ exports.FinalizeABRMezzanine = /*#__PURE__*/function () {
|
|
|
1048
1095
|
awaitCommitConfirmation: false
|
|
1049
1096
|
});
|
|
1050
1097
|
|
|
1051
|
-
case
|
|
1098
|
+
case 47:
|
|
1052
1099
|
finalizeResponse = _context6.sent;
|
|
1053
1100
|
result = _objectSpread({
|
|
1054
1101
|
data: data,
|
|
1055
1102
|
logs: logs || [],
|
|
1056
|
-
warnings: warnings || [],
|
|
1103
|
+
warnings: (warnings || []).concat(preFinalizeWarnings),
|
|
1057
1104
|
errors: errors || []
|
|
1058
1105
|
}, finalizeResponse);
|
|
1059
|
-
_context6.next =
|
|
1106
|
+
_context6.next = 54;
|
|
1060
1107
|
break;
|
|
1061
1108
|
|
|
1062
|
-
case
|
|
1063
|
-
_context6.prev =
|
|
1064
|
-
_context6.
|
|
1065
|
-
error = _context6.
|
|
1109
|
+
case 51:
|
|
1110
|
+
_context6.prev = 51;
|
|
1111
|
+
_context6.t3 = _context6["catch"](8);
|
|
1112
|
+
error = _context6.t3;
|
|
1066
1113
|
|
|
1067
|
-
case
|
|
1068
|
-
_context6.prev =
|
|
1114
|
+
case 54:
|
|
1115
|
+
_context6.prev = 54;
|
|
1069
1116
|
// Ensure original http client is restored
|
|
1070
1117
|
this.HttpClient = httpClient;
|
|
1071
|
-
return _context6.finish(
|
|
1118
|
+
return _context6.finish(54);
|
|
1072
1119
|
|
|
1073
|
-
case
|
|
1120
|
+
case 57:
|
|
1074
1121
|
if (!error) {
|
|
1075
|
-
_context6.next =
|
|
1122
|
+
_context6.next = 59;
|
|
1076
1123
|
break;
|
|
1077
1124
|
}
|
|
1078
1125
|
|
|
1079
1126
|
throw error;
|
|
1080
1127
|
|
|
1081
|
-
case
|
|
1128
|
+
case 59:
|
|
1082
1129
|
return _context6.abrupt("return", result);
|
|
1083
1130
|
|
|
1084
|
-
case
|
|
1131
|
+
case 60:
|
|
1085
1132
|
case "end":
|
|
1086
1133
|
return _context6.stop();
|
|
1087
1134
|
}
|
|
1088
1135
|
}
|
|
1089
|
-
}, _callee6, this, [[8,
|
|
1136
|
+
}, _callee6, this, [[8, 51, 54, 57], [37, 42]]);
|
|
1090
1137
|
}));
|
|
1091
1138
|
|
|
1092
1139
|
return function (_x6) {
|