@eluvio/elv-client-js 3.1.84 → 3.1.85

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.
@@ -2389,19 +2389,20 @@ exports.AvailableOfferings = function _callee30(_ref22) {
2389
2389
  * @param {Object=} context - Additional audience data to include in the authorization request.
2390
2390
  * - Note: Context must be a map of string->string
2391
2391
  * @param {Object=} authorizationToken - Additional authorization token for authorizing this request
2392
+ * @param {Object=} options - Additional query parameters to pass when requesting available playout options, such as clipping parameters.
2392
2393
  */
2393
2394
 
2394
2395
 
2395
2396
  exports.PlayoutOptions = function _callee33(_ref24) {
2396
2397
  var _this9 = this;
2397
2398
 
2398
- var offeringURI, objectId, versionHash, writeToken, linkPath, _ref24$signedLink, signedLink, _ref24$protocols, protocols, _ref24$handler, handler, _ref24$offering, offering, playoutType, _ref24$drms, drms, context, _ref24$hlsjsProfile, hlsjsProfile, authorizationToken, uriInfo, libraryId, offeringPath, link, _ref25, path, linkTarget, audienceData, authorization, queryParams, playoutOptions, playoutMap, sessionId, multiview, i, option, protocol, drm, playoutPath, licenseServers, cert, method, certUrl, protocolMatch, drmMatch;
2399
+ var offeringURI, objectId, versionHash, writeToken, linkPath, _ref24$signedLink, signedLink, _ref24$protocols, protocols, _ref24$handler, handler, _ref24$offering, offering, playoutType, _ref24$drms, drms, context, _ref24$hlsjsProfile, hlsjsProfile, authorizationToken, _ref24$options, options, uriInfo, libraryId, offeringPath, link, _ref25, path, linkTarget, audienceData, authorization, queryParams, playoutOptions, playoutMap, sessionId, multiview, i, option, protocol, drm, playoutPath, licenseServers, cert, method, certUrl, protocolMatch, drmMatch;
2399
2400
 
2400
2401
  return _regeneratorRuntime.async(function _callee33$(_context33) {
2401
2402
  while (1) {
2402
2403
  switch (_context33.prev = _context33.next) {
2403
2404
  case 0:
2404
- offeringURI = _ref24.offeringURI, objectId = _ref24.objectId, versionHash = _ref24.versionHash, writeToken = _ref24.writeToken, linkPath = _ref24.linkPath, _ref24$signedLink = _ref24.signedLink, signedLink = _ref24$signedLink === void 0 ? false : _ref24$signedLink, _ref24$protocols = _ref24.protocols, protocols = _ref24$protocols === void 0 ? ["dash", "hls"] : _ref24$protocols, _ref24$handler = _ref24.handler, handler = _ref24$handler === void 0 ? "playout" : _ref24$handler, _ref24$offering = _ref24.offering, offering = _ref24$offering === void 0 ? "default" : _ref24$offering, playoutType = _ref24.playoutType, _ref24$drms = _ref24.drms, drms = _ref24$drms === void 0 ? [] : _ref24$drms, context = _ref24.context, _ref24$hlsjsProfile = _ref24.hlsjsProfile, hlsjsProfile = _ref24$hlsjsProfile === void 0 ? true : _ref24$hlsjsProfile, authorizationToken = _ref24.authorizationToken;
2405
+ offeringURI = _ref24.offeringURI, objectId = _ref24.objectId, versionHash = _ref24.versionHash, writeToken = _ref24.writeToken, linkPath = _ref24.linkPath, _ref24$signedLink = _ref24.signedLink, signedLink = _ref24$signedLink === void 0 ? false : _ref24$signedLink, _ref24$protocols = _ref24.protocols, protocols = _ref24$protocols === void 0 ? ["dash", "hls"] : _ref24$protocols, _ref24$handler = _ref24.handler, handler = _ref24$handler === void 0 ? "playout" : _ref24$handler, _ref24$offering = _ref24.offering, offering = _ref24$offering === void 0 ? "default" : _ref24$offering, playoutType = _ref24.playoutType, _ref24$drms = _ref24.drms, drms = _ref24$drms === void 0 ? [] : _ref24$drms, context = _ref24.context, _ref24$hlsjsProfile = _ref24.hlsjsProfile, hlsjsProfile = _ref24$hlsjsProfile === void 0 ? true : _ref24$hlsjsProfile, authorizationToken = _ref24.authorizationToken, _ref24$options = _ref24.options, options = _ref24$options === void 0 ? {} : _ref24$options;
2405
2406
 
2406
2407
  if (!offeringURI) {
2407
2408
  _context33.next = 8;
@@ -2558,10 +2559,10 @@ exports.PlayoutOptions = function _callee33(_ref24) {
2558
2559
  };
2559
2560
 
2560
2561
  authorization = [_context33.t9, _context33.t10].flat().filter(_context33.t11);
2561
- queryParams = {
2562
+ queryParams = _objectSpread({
2562
2563
  authorization: authorization,
2563
2564
  resolve: !!linkPath
2564
- };
2565
+ }, options);
2565
2566
  _context33.t12 = Object;
2566
2567
  _context33.next = 61;
2567
2568
  return _regeneratorRuntime.awrap(this.utils.ResponseToJson(this.HttpClient.Request({
@@ -2825,17 +2826,18 @@ exports.PlayoutOptions = function _callee33(_ref24) {
2825
2826
  * @param {Object=} context - Additional audience data to include in the authorization request
2826
2827
  * - Note: Context must be a map of string->string
2827
2828
  * @param {Object=} authorizationToken - Additional authorization token for authorizing this request
2829
+ * @param {Object=} options - Additional query parameters to pass when requesting available playout options, such as clipping parameters.
2828
2830
  */
2829
2831
 
2830
2832
 
2831
2833
  exports.BitmovinPlayoutOptions = function _callee34(_ref27) {
2832
- var objectId, versionHash, writeToken, linkPath, _ref27$signedLink, signedLink, _ref27$protocols, protocols, _ref27$drms, drms, _ref27$handler, handler, _ref27$offering, offering, playoutType, context, authorizationToken, playoutOptions, _ref28, linkTarget, authorization, config;
2834
+ var objectId, versionHash, writeToken, linkPath, _ref27$signedLink, signedLink, _ref27$protocols, protocols, _ref27$drms, drms, _ref27$handler, handler, _ref27$offering, offering, playoutType, context, authorizationToken, _ref27$options, options, playoutOptions, _ref28, linkTarget, authorization, config;
2833
2835
 
2834
2836
  return _regeneratorRuntime.async(function _callee34$(_context34) {
2835
2837
  while (1) {
2836
2838
  switch (_context34.prev = _context34.next) {
2837
2839
  case 0:
2838
- objectId = _ref27.objectId, versionHash = _ref27.versionHash, writeToken = _ref27.writeToken, linkPath = _ref27.linkPath, _ref27$signedLink = _ref27.signedLink, signedLink = _ref27$signedLink === void 0 ? false : _ref27$signedLink, _ref27$protocols = _ref27.protocols, protocols = _ref27$protocols === void 0 ? ["dash", "hls"] : _ref27$protocols, _ref27$drms = _ref27.drms, drms = _ref27$drms === void 0 ? [] : _ref27$drms, _ref27$handler = _ref27.handler, handler = _ref27$handler === void 0 ? "playout" : _ref27$handler, _ref27$offering = _ref27.offering, offering = _ref27$offering === void 0 ? "default" : _ref27$offering, playoutType = _ref27.playoutType, context = _ref27.context, authorizationToken = _ref27.authorizationToken;
2840
+ objectId = _ref27.objectId, versionHash = _ref27.versionHash, writeToken = _ref27.writeToken, linkPath = _ref27.linkPath, _ref27$signedLink = _ref27.signedLink, signedLink = _ref27$signedLink === void 0 ? false : _ref27$signedLink, _ref27$protocols = _ref27.protocols, protocols = _ref27$protocols === void 0 ? ["dash", "hls"] : _ref27$protocols, _ref27$drms = _ref27.drms, drms = _ref27$drms === void 0 ? [] : _ref27$drms, _ref27$handler = _ref27.handler, handler = _ref27$handler === void 0 ? "playout" : _ref27$handler, _ref27$offering = _ref27.offering, offering = _ref27$offering === void 0 ? "default" : _ref27$offering, playoutType = _ref27.playoutType, context = _ref27.context, authorizationToken = _ref27.authorizationToken, _ref27$options = _ref27.options, options = _ref27$options === void 0 ? {} : _ref27$options;
2839
2841
  versionHash ? ValidateVersion(versionHash) : ValidateObject(objectId);
2840
2842
 
2841
2843
  if (!objectId) {
@@ -2856,7 +2858,8 @@ exports.BitmovinPlayoutOptions = function _callee34(_ref27) {
2856
2858
  playoutType: playoutType,
2857
2859
  hlsjsProfile: false,
2858
2860
  context: context,
2859
- authorizationToken: authorizationToken
2861
+ authorizationToken: authorizationToken,
2862
+ options: options
2860
2863
  }));
2861
2864
 
2862
2865
  case 5:
@@ -447,19 +447,20 @@ exports.CreateContentType = function _callee3(_ref4) {
447
447
  * @param {Object=} metadata - Metadata of library object
448
448
  * @param {string=} kmsId - ID of the KMS to use for content in this library. If not specified,
449
449
  * the default KMS will be used.
450
+ * @param {string=} tenantId - ID of the tenant to use for this library
450
451
  *
451
452
  * @returns {Promise<string>} - Library ID of created library
452
453
  */
453
454
 
454
455
 
455
456
  exports.CreateContentLibrary = function _callee4(_ref6) {
456
- var name, description, image, imageName, _ref6$metadata, metadata, kmsId, _ref7, contractAddress, tenantId, libraryId, objectId, editResponse;
457
+ var name, description, image, imageName, _ref6$metadata, metadata, kmsId, tenantId, _ref7, contractAddress, libraryId, objectId, editResponse;
457
458
 
458
459
  return _regeneratorRuntime.async(function _callee4$(_context5) {
459
460
  while (1) {
460
461
  switch (_context5.prev = _context5.next) {
461
462
  case 0:
462
- name = _ref6.name, description = _ref6.description, image = _ref6.image, imageName = _ref6.imageName, _ref6$metadata = _ref6.metadata, metadata = _ref6$metadata === void 0 ? {} : _ref6$metadata, kmsId = _ref6.kmsId;
463
+ name = _ref6.name, description = _ref6.description, image = _ref6.image, imageName = _ref6.imageName, _ref6$metadata = _ref6.metadata, metadata = _ref6$metadata === void 0 ? {} : _ref6$metadata, kmsId = _ref6.kmsId, tenantId = _ref6.tenantId;
463
464
 
464
465
  if (kmsId) {
465
466
  _context5.next = 9;
@@ -487,25 +488,32 @@ exports.CreateContentLibrary = function _callee4(_ref6) {
487
488
  case 13:
488
489
  _ref7 = _context5.sent;
489
490
  contractAddress = _ref7.contractAddress;
490
- _context5.next = 17;
491
+
492
+ if (tenantId) {
493
+ _context5.next = 19;
494
+ break;
495
+ }
496
+
497
+ _context5.next = 18;
491
498
  return _regeneratorRuntime.awrap(this.userProfileClient.TenantId());
492
499
 
493
- case 17:
500
+ case 18:
494
501
  tenantId = _context5.sent;
495
502
 
503
+ case 19:
496
504
  if (!tenantId) {
497
- _context5.next = 21;
505
+ _context5.next = 22;
498
506
  break;
499
507
  }
500
508
 
501
- _context5.next = 21;
509
+ _context5.next = 22;
502
510
  return _regeneratorRuntime.awrap(this.CallContractMethod({
503
511
  contractAddress: contractAddress,
504
512
  methodName: "putMeta",
505
513
  methodArgs: ["_tenantId", tenantId]
506
514
  }));
507
515
 
508
- case 21:
516
+ case 22:
509
517
  metadata = _objectSpread({}, metadata, {
510
518
  name: name,
511
519
  description: description,
@@ -519,15 +527,15 @@ exports.CreateContentLibrary = function _callee4(_ref6) {
519
527
  this.Log("Contract address: ".concat(contractAddress)); // Set library content object type and metadata on automatically created library object
520
528
 
521
529
  objectId = libraryId.replace("ilib", "iq__");
522
- _context5.next = 28;
530
+ _context5.next = 29;
523
531
  return _regeneratorRuntime.awrap(this.EditContentObject({
524
532
  libraryId: libraryId,
525
533
  objectId: objectId
526
534
  }));
527
535
 
528
- case 28:
536
+ case 29:
529
537
  editResponse = _context5.sent;
530
- _context5.next = 31;
538
+ _context5.next = 32;
531
539
  return _regeneratorRuntime.awrap(this.ReplaceMetadata({
532
540
  libraryId: libraryId,
533
541
  objectId: objectId,
@@ -535,8 +543,8 @@ exports.CreateContentLibrary = function _callee4(_ref6) {
535
543
  writeToken: editResponse.write_token
536
544
  }));
537
545
 
538
- case 31:
539
- _context5.next = 33;
546
+ case 32:
547
+ _context5.next = 34;
540
548
  return _regeneratorRuntime.awrap(this.FinalizeContentObject({
541
549
  libraryId: libraryId,
542
550
  objectId: objectId,
@@ -544,24 +552,24 @@ exports.CreateContentLibrary = function _callee4(_ref6) {
544
552
  commitMessage: "Create library"
545
553
  }));
546
554
 
547
- case 33:
555
+ case 34:
548
556
  if (!image) {
549
- _context5.next = 36;
557
+ _context5.next = 37;
550
558
  break;
551
559
  }
552
560
 
553
- _context5.next = 36;
561
+ _context5.next = 37;
554
562
  return _regeneratorRuntime.awrap(this.SetContentLibraryImage({
555
563
  libraryId: libraryId,
556
564
  image: image,
557
565
  imageName: imageName
558
566
  }));
559
567
 
560
- case 36:
568
+ case 37:
561
569
  this.Log("Library ".concat(libraryId, " created"));
562
570
  return _context5.abrupt("return", libraryId);
563
571
 
564
- case 38:
572
+ case 39:
565
573
  case "end":
566
574
  return _context5.stop();
567
575
  }
package/package-lock.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eluvio/elv-client-js",
3
- "version": "3.1.84",
3
+ "version": "3.1.85",
4
4
  "lockfileVersion": 1,
5
5
  "requires": true,
6
6
  "dependencies": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eluvio/elv-client-js",
3
- "version": "3.1.84",
3
+ "version": "3.1.85",
4
4
  "description": "Javascript client for the Eluvio Content Fabric",
5
5
  "main": "src/ElvClient.js",
6
6
  "author": "Kevin Talmadge",
@@ -1325,6 +1325,7 @@ exports.AvailableOfferings = async function({
1325
1325
  * @param {Object=} context - Additional audience data to include in the authorization request.
1326
1326
  * - Note: Context must be a map of string->string
1327
1327
  * @param {Object=} authorizationToken - Additional authorization token for authorizing this request
1328
+ * @param {Object=} options - Additional query parameters to pass when requesting available playout options, such as clipping parameters.
1328
1329
  */
1329
1330
  exports.PlayoutOptions = async function({
1330
1331
  offeringURI,
@@ -1340,7 +1341,8 @@ exports.PlayoutOptions = async function({
1340
1341
  drms=[],
1341
1342
  context,
1342
1343
  hlsjsProfile=true,
1343
- authorizationToken
1344
+ authorizationToken,
1345
+ options={}
1344
1346
  }) {
1345
1347
  if(offeringURI) {
1346
1348
  const uriInfo = offeringURI.match(/(hq__[^/]+)\/rep\/([^/]+)\/([^/]+)\/options.json/);
@@ -1421,7 +1423,8 @@ exports.PlayoutOptions = async function({
1421
1423
 
1422
1424
  let queryParams = {
1423
1425
  authorization,
1424
- resolve: !!linkPath
1426
+ resolve: !!linkPath,
1427
+ ...options
1425
1428
  };
1426
1429
 
1427
1430
  const playoutOptions = Object.values(
@@ -1590,6 +1593,7 @@ exports.PlayoutOptions = async function({
1590
1593
  * @param {Object=} context - Additional audience data to include in the authorization request
1591
1594
  * - Note: Context must be a map of string->string
1592
1595
  * @param {Object=} authorizationToken - Additional authorization token for authorizing this request
1596
+ * @param {Object=} options - Additional query parameters to pass when requesting available playout options, such as clipping parameters.
1593
1597
  */
1594
1598
  exports.BitmovinPlayoutOptions = async function({
1595
1599
  objectId,
@@ -1603,7 +1607,8 @@ exports.BitmovinPlayoutOptions = async function({
1603
1607
  offering="default",
1604
1608
  playoutType,
1605
1609
  context,
1606
- authorizationToken
1610
+ authorizationToken,
1611
+ options={}
1607
1612
  }) {
1608
1613
  versionHash ? ValidateVersion(versionHash) : ValidateObject(objectId);
1609
1614
 
@@ -1624,7 +1629,8 @@ exports.BitmovinPlayoutOptions = async function({
1624
1629
  playoutType,
1625
1630
  hlsjsProfile: false,
1626
1631
  context,
1627
- authorizationToken
1632
+ authorizationToken,
1633
+ options
1628
1634
  });
1629
1635
 
1630
1636
  delete playoutOptions.playoutMethods;
@@ -242,6 +242,7 @@ exports.CreateContentType = async function({name, metadata={}, bitcode}) {
242
242
  * @param {Object=} metadata - Metadata of library object
243
243
  * @param {string=} kmsId - ID of the KMS to use for content in this library. If not specified,
244
244
  * the default KMS will be used.
245
+ * @param {string=} tenantId - ID of the tenant to use for this library
245
246
  *
246
247
  * @returns {Promise<string>} - Library ID of created library
247
248
  */
@@ -252,6 +253,7 @@ exports.CreateContentLibrary = async function({
252
253
  imageName,
253
254
  metadata={},
254
255
  kmsId,
256
+ tenantId
255
257
  }) {
256
258
  if(!kmsId) {
257
259
  kmsId = `ikms${this.utils.AddressToHash(await this.DefaultKMSAddress())}`;
@@ -264,7 +266,10 @@ exports.CreateContentLibrary = async function({
264
266
 
265
267
 
266
268
  // Set tenant ID on the library if the user is associated with a tenant
267
- const tenantId = await this.userProfileClient.TenantId();
269
+ if(!tenantId) {
270
+ tenantId = await this.userProfileClient.TenantId();
271
+ }
272
+
268
273
  if(tenantId) {
269
274
  await this.CallContractMethod({
270
275
  contractAddress,