@eluvio/elv-client-js 4.2.17 → 4.2.19

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.
@@ -1775,8 +1775,7 @@ var AuthorizationClient = /*#__PURE__*/function () {
1775
1775
  throw Error("No KMS info set for ".concat(versionHash || objectId || "default KMS"));
1776
1776
  case 15:
1777
1777
  kmsHttpClient = new HttpClient({
1778
- uris: kmsUrls,
1779
- networkName: this.client.networkName
1778
+ uris: kmsUrls
1780
1779
  });
1781
1780
  _context24.next = 18;
1782
1781
  return kmsHttpClient.Request({
@@ -69,8 +69,7 @@ var ContentObjectAudit = {
69
69
  return s.indexOf(v) === i;
70
70
  });
71
71
  httpClient = new HttpClient({
72
- uris: uris,
73
- networkName: client.networkName
72
+ uris: uris
74
73
  });
75
74
  path = UrlJoin("qlibs", libraryId, "q", versionHash || objectId, live ? "call/live/audit" : "audit");
76
75
  _context.t4 = httpClient;
@@ -20,7 +20,6 @@ var HttpClient = require("./HttpClient");
20
20
  var RemoteSigner = require("./RemoteSigner");
21
21
  var Utils = require("./Utils");
22
22
  var Crypto = require("./Crypto");
23
- var NetworkUrls = require("./NetworkUrls");
24
23
  var _require = require("./LogMessage"),
25
24
  LogMessage = _require.LogMessage;
26
25
  var Pako = require("pako");
@@ -28,6 +27,13 @@ var _require2 = require("./Validation"),
28
27
  ValidatePresence = _require2.ValidatePresence,
29
28
  ValidateWriteToken = _require2.ValidateWriteToken;
30
29
  var UrlJoin = require("url-join");
30
+ var networks = {
31
+ "main": "https://main.net955305.contentfabric.io",
32
+ "demo": "https://demov3.net955210.contentfabric.io",
33
+ "demov3": "https://demov3.net955210.contentfabric.io",
34
+ "local": "http://127.0.0.1:8008/config?qspace=dev&self",
35
+ "test": "https://test.net955203.contentfabric.io"
36
+ };
31
37
  if (Utils.Platform() === Utils.PLATFORM_NODE) {
32
38
  // Define Response in node
33
39
  // eslint-disable-next-line no-global-assign
@@ -254,22 +260,18 @@ var ElvClient = /*#__PURE__*/function () {
254
260
  uris = this.service === "search" ? this.searchURIs : this.fabricURIs;
255
261
  this.HttpClient = new HttpClient({
256
262
  uris: uris,
257
- networkName: this.networkName,
258
263
  debug: this.debug
259
264
  });
260
265
  this.AuthHttpClient = new HttpClient({
261
266
  uris: this.authServiceURIs,
262
- networkName: this.networkName,
263
267
  debug: this.debug
264
268
  });
265
269
  this.FileServiceHttpClient = new HttpClient({
266
270
  uris: this.fileServiceURIs,
267
- networkName: this.networkName,
268
271
  debug: this.debug
269
272
  });
270
273
  this.SearchHttpClient = new HttpClient({
271
274
  uris: this.searchURIs || [],
272
- networkName: this.networkName,
273
275
  debug: this.debug
274
276
  });
275
277
  this.ethClient = new EthClient({
@@ -1487,7 +1489,6 @@ var ElvClient = /*#__PURE__*/function () {
1487
1489
  path = "/ks/jwt/wlt";
1488
1490
  httpClient = new HttpClient({
1489
1491
  uris: this.kmsURIs,
1490
- networkName: this.networkName,
1491
1492
  debug: this.debug
1492
1493
  });
1493
1494
  _context19.next = 22;
@@ -2018,7 +2019,7 @@ var ElvClient = /*#__PURE__*/function () {
2018
2019
  }, {
2019
2020
  key: "Networks",
2020
2021
  value: function Networks() {
2021
- return Object.assign({}, NetworkUrls);
2022
+ return Object.assign({}, networks);
2022
2023
  }
2023
2024
 
2024
2025
  /**
@@ -2046,7 +2047,7 @@ var ElvClient = /*#__PURE__*/function () {
2046
2047
  while (1) switch (_context28.prev = _context28.next) {
2047
2048
  case 0:
2048
2049
  networkName = _ref31.networkName, region = _ref31.region, clientIP = _ref31.clientIP, trustAuthorityId = _ref31.trustAuthorityId, staticToken = _ref31.staticToken, _ref31$ethereumContra = _ref31.ethereumContractTimeout, ethereumContractTimeout = _ref31$ethereumContra === void 0 ? 10 : _ref31$ethereumContra, _ref31$noCache = _ref31.noCache, noCache = _ref31$noCache === void 0 ? false : _ref31$noCache, _ref31$noAuth = _ref31.noAuth, noAuth = _ref31$noAuth === void 0 ? false : _ref31$noAuth, assumeV3 = _ref31.assumeV3;
2049
- configUrl = this.Networks()[networkName];
2050
+ configUrl = networks[networkName];
2050
2051
  if (configUrl) {
2051
2052
  _context28.next = 4;
2052
2053
  break;
@@ -449,7 +449,7 @@ var FrameClient = /*#__PURE__*/function () {
449
449
  }, {
450
450
  key: "AllowedMethods",
451
451
  value: function AllowedMethods() {
452
- return ["AccessGroupManagers", "AccessGroupMembers", "AccessGroupOwner", "AccessInfo", "AccessRequest", "AccessType", "AddAccessGroupManager", "AddAccessGroupMember", "AddContentLibraryGroup", "AddContentObjectGroupPermission", "AddLibraryContentType", "AssetMetadata", "AuditContentObject", "AuditStream", "AvailableDRMs", "AvailableOfferings", "AwaitPending", "BitmovinPlayoutOptions", "BlockNumber", "CallBitcodeMethod", "CallContractMethod", "CallContractMethodAndWait", "ClearCache", "ClearStaticToken", "Collection", "CollectionTransactions", "ConfigUrl", "ContentLibraries", "ContentLibrary", "ContentLibraryGroupPermissions", "ContentLibraryOwner", "ContentObject", "ContentObjectAccessComplete", "ContentObjectGraph", "ContentObjectGroupPermissions", "ContentObjectImageUrl", "ContentObjectLibraryId", "ContentObjectMetadata", "ContentObjectOwner", "ContentObjectTenantId", "ContentObjectVersions", "ContentObjects", "ContentPart", "ContentParts", "ContentSpaceId", "ContentType", "ContentTypeOwner", "ContentTypes", "ContractAbi", "ContractEvents", "ContractInfo", "ContractMetadata", "ContractName", "CopyContentObject", "CreateABRMezzanine", "CreateAccessGroup", "CreateAndFinalizeContentObject", "CreateAuthorizationToken", "CreateContentLibrary", "CreateContentObject", "CreateContentType", "CreateEncryptionConk", "CreateFabricToken", "CreateFileDirectories", "CreateFileUploadJob", "CreateLinks", "CreateNTPInstance", "CreateNonOwnerCap", "CreatePart", "CreateProductionMaster", "CreateShare", "CreateSignedMessageJSON", "CreateSignedToken", "CreateStaticToken", "CurrentAccountAddress", "CustomContractAddress", "DecodeSignedMessageJSON", "Decrypt", "DecryptECIES", "DefaultKMSAddress", "DeleteAccessGroup", "DeleteContentLibrary", "DeleteContentObject", "DeleteContentVersion", "DeleteFiles", "DeleteMetadata", "DeleteNTPInstance", "DeletePart", "DeleteWriteToken", "DeployContract", "Download", "DownloadEncrypted", "DownloadFile", "DownloadPart", "EditAndFinalizeContentObject", "EditContentObject", "EmbedUrl", "Encrypt", "EncryptECIES", "EncryptionConk", "Events", "ExtractEventFromLogs", "ExtractValueFromEvent", "FabricUrl", "FileUrl", "FinalizeABRMezzanine", "FinalizeContentObject", "FinalizePart", "FinalizeStateChannelAccess", "FinalizeUploadJob", "FormatContractArguments", "GenerateStateChannelToken", "GenerateSignedLinkToken", "GetBalance", "GlobalUrl", "InitializeAuthPolicy", "IssueNTPCode", "IssueSignedNTPCode", "LatestVersionHash", "LibraryContentTypes", "LinkAccessGroupToOauth", "LinkData", "LinkTarget", "LinkUrl", "ListAccessGroups", "ListFiles", "ListNTPInstances", "LRODraftInfo", "LROStatus", "MakeAuthServiceRequest", "MakeFileServiceRequest", "MergeContractMetadata", "MergeMetadata", "MetadataAuth", "MintNFT", "MoveFiles", "NetworkInfo", "NodeId", "Nodes", "NTPInstance", "ObjectCleanup", "OutputsCreate", "OutputsDelete", "OutputsList", "OutputsListItem", "OutputsModify", "OutputsModifyBatch", "OutputsResolveSrtPullUrls", "OutputsState", "OutputsStop", "Permission", "PlayoutOptions", "PlayoutPathResolution", "ProduceMetadataLinks", "Proofs", "PublicRep", "PublishContentVersion", "QParts", "RecordWriteToken", "RedeemCode", "RedeemShareToken", "RemoveAccessGroupManager", "RemoveAccessGroupMember", "RemoveContentObjectGroupPermission", "RemoveContentLibraryGroup", "RemoveLibraryContentType", "Rep", "ReplaceContractMetadata", "ReplaceMetadata", "Request", "ResetRegion", "ResetTenantId", "RevokeShare", "SendFunds", "SetAccessCharge", "StreamApplyProfile", "SetAuth", "SetAuthContext", "SetAuthPolicy", "SetContentLibraryImage", "SetContentObjectImage", "SetCustomContentContract", "SetGroupPermission", "SetNodes", "SetOauthToken", "SetPolicyAuthorization", "SetSignerFromOauthToken", "SetStaticToken", "SetTenantContractId", "SetTenantId", "TenantAdminGroup", "ContentAdminGroup", "TenantUsersGroup", "SetVisibility", "SetPermission", "ShareInfo", "Shares", "SpaceNodes", "StartABRMezzanineJobs", "StreamAddWatermark", "StreamApplyProfile", "StreamAssignProfile", "StreamConfig", "StreamConfigProfile", "StreamConfigProfiles", "StreamCopyToVod", "StreamCreate", "StreamInitialize", "StreamInsertion", "StreamLinkToSite", "StreamListUrls", "StreamRemoveLinkToSite", "StreamRemoveWatermark", "StreamSaveConfigProfile", "StreamSetOfferingAndDRM", "StreamSiteSettings", "StreamStartRecording", "StreamStartOrStopOrReset", "StreamStatus", "StreamStopRecording", "StreamUnassignProfile", "StreamUpdateConfig", "SuspendNTPInstance", "TenantContractId", "TenantId", "UnlinkAccessGroupFromOauth", "UpdateContentObjectGraph", "UpdateNTPInstance", "UpdateShare", "UploadFileData", "UploadFilesFromS3", "UploadJobStatus", "UploadPart", "UploadPartChunk", "UploadStatus", "UseRegion", "Visibility", "WriteTokenNodeUrlLocal", "WriteTokenNodeUrlNetwork"];
452
+ return ["AccessGroupManagers", "AccessGroupMembers", "AccessGroupOwner", "AccessInfo", "AccessRequest", "AccessType", "AddAccessGroupManager", "AddAccessGroupMember", "AddContentLibraryGroup", "AddContentObjectGroupPermission", "AddLibraryContentType", "AssetMetadata", "AuditContentObject", "AuditStream", "AvailableDRMs", "AvailableOfferings", "AwaitPending", "BitmovinPlayoutOptions", "BlockNumber", "CallBitcodeMethod", "CallContractMethod", "CallContractMethodAndWait", "ClearCache", "ClearStaticToken", "Collection", "CollectionTransactions", "ConfigUrl", "ContentLibraries", "ContentLibrary", "ContentLibraryGroupPermissions", "ContentLibraryOwner", "ContentObject", "ContentObjectAccessComplete", "ContentObjectGraph", "ContentObjectGroupPermissions", "ContentObjectImageUrl", "ContentObjectLibraryId", "ContentObjectMetadata", "ContentObjectOwner", "ContentObjectTenantId", "ContentObjectVersions", "ContentObjects", "ContentPart", "ContentParts", "ContentSpaceId", "ContentType", "ContentTypeOwner", "ContentTypes", "ContractAbi", "ContractEvents", "ContractInfo", "ContractMetadata", "ContractName", "CopyContentObject", "CreateABRMezzanine", "CreateAccessGroup", "CreateAndFinalizeContentObject", "CreateAuthorizationToken", "CreateContentLibrary", "CreateContentObject", "CreateContentType", "CreateEncryptionConk", "CreateFabricToken", "CreateFileDirectories", "CreateFileUploadJob", "CreateLinks", "CreateNTPInstance", "CreateNonOwnerCap", "CreatePart", "CreateProductionMaster", "CreateShare", "CreateSignedMessageJSON", "CreateSignedToken", "CreateStaticToken", "CurrentAccountAddress", "CustomContractAddress", "DecodeSignedMessageJSON", "Decrypt", "DecryptECIES", "DefaultKMSAddress", "DeleteAccessGroup", "DeleteContentLibrary", "DeleteContentObject", "DeleteContentVersion", "DeleteFiles", "DeleteMetadata", "DeleteNTPInstance", "DeletePart", "DeleteWriteToken", "DeployContract", "Download", "DownloadEncrypted", "DownloadFile", "DownloadPart", "EditAndFinalizeContentObject", "EditContentObject", "EmbedUrl", "Encrypt", "EncryptECIES", "EncryptionConk", "Events", "ExtractEventFromLogs", "ExtractValueFromEvent", "FabricUrl", "FileUrl", "FinalizeABRMezzanine", "FinalizeContentObject", "FinalizePart", "FinalizeStateChannelAccess", "FinalizeUploadJob", "FormatContractArguments", "GenerateStateChannelToken", "GenerateSignedLinkToken", "GetBalance", "GlobalUrl", "InitializeAuthPolicy", "IssueNTPCode", "IssueSignedNTPCode", "LatestVersionHash", "LibraryContentTypes", "LinkAccessGroupToOauth", "LinkData", "LinkTarget", "LinkUrl", "ListAccessGroups", "ListFiles", "ListNTPInstances", "LRODraftInfo", "LROStatus", "MakeAuthServiceRequest", "MakeFileServiceRequest", "MergeContractMetadata", "MergeMetadata", "MetadataAuth", "MintNFT", "MoveFiles", "NetworkInfo", "NodeId", "Nodes", "NTPInstance", "ObjectCleanup", "Permission", "PlayoutOptions", "PlayoutPathResolution", "ProduceMetadataLinks", "Proofs", "PublicRep", "PublishContentVersion", "QParts", "RecordWriteToken", "RedeemCode", "RedeemShareToken", "RemoveAccessGroupManager", "RemoveAccessGroupMember", "RemoveContentObjectGroupPermission", "RemoveContentLibraryGroup", "RemoveLibraryContentType", "Rep", "ReplaceContractMetadata", "ReplaceMetadata", "Request", "ResetRegion", "ResetTenantId", "RevokeShare", "SendFunds", "SetAccessCharge", "SetAuth", "SetAuthContext", "SetAuthPolicy", "SetContentLibraryImage", "SetContentObjectImage", "SetCustomContentContract", "SetGroupPermission", "SetNodes", "SetOauthToken", "SetPolicyAuthorization", "SetSignerFromOauthToken", "SetStaticToken", "SetTenantContractId", "SetTenantId", "TenantAdminGroup", "ContentAdminGroup", "TenantUsersGroup", "SetVisibility", "SetPermission", "ShareInfo", "Shares", "SpaceNodes", "StartABRMezzanineJobs", "StreamAddWatermark", "StreamConfig", "StreamCopyToVod", "StreamCreate", "StreamInitialize", "StreamInsertion", "StreamListUrls", "StreamRemoveWatermark", "StreamSetOfferingAndDRM", "StreamStatus", "StreamStartOrStopOrReset", "StreamStopSession", "SuspendNTPInstance", "TenantContractId", "TenantId", "UnlinkAccessGroupFromOauth", "UpdateContentObjectGraph", "UpdateNTPInstance", "UpdateShare", "UploadFileData", "UploadFilesFromS3", "UploadJobStatus", "UploadPart", "UploadPartChunk", "UploadStatus", "UseRegion", "Visibility", "WriteTokenNodeUrlLocal", "WriteTokenNodeUrlNetwork"];
453
453
  }
454
454
  }, {
455
455
  key: "AllowedUserProfileMethods",
@@ -7,21 +7,17 @@ var _Fetch = typeof fetch !== "undefined" ? fetch : require("node-fetch")["defau
7
7
  var _require = require("./LogMessage"),
8
8
  LogMessage = _require.LogMessage;
9
9
  var Utils = require("./Utils");
10
- var UrlJoin = require("url-join");
11
- var NetworkUrls = require("./NetworkUrls");
12
10
  var HttpClient = /*#__PURE__*/function () {
13
11
  "use strict";
14
12
 
15
13
  function HttpClient(_ref) {
16
14
  var uris = _ref.uris,
17
- networkName = _ref.networkName,
18
15
  debug = _ref.debug;
19
16
  _classCallCheck(this, HttpClient);
20
17
  this.uris = uris;
21
18
  this.uriIndex = 0;
22
19
  this.debug = debug;
23
20
  this.draftURIs = {};
24
- this.networkName = networkName;
25
21
  this.retries = Math.max(3, uris.length);
26
22
  }
27
23
  _createClass(HttpClient, [{
@@ -71,7 +67,7 @@ var HttpClient = /*#__PURE__*/function () {
71
67
  key: "Request",
72
68
  value: function () {
73
69
  var _Request = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref3) {
74
- var method, path, _ref3$queryParams, queryParams, body, _ref3$bodyType, bodyType, _ref3$headers, headers, _ref3$attempts, attempts, _ref3$allowFailover, allowFailover, _ref3$forceFailover, forceFailover, _ref3$allowRetry, allowRetry, uriIndex, baseURI, writeTokenMatch, writeToken, configUrl, uri, fetchParameters, response, responseType, errorBody, error;
70
+ var method, path, _ref3$queryParams, queryParams, body, _ref3$bodyType, bodyType, _ref3$headers, headers, _ref3$attempts, attempts, _ref3$allowFailover, allowFailover, _ref3$forceFailover, forceFailover, _ref3$allowRetry, allowRetry, uriIndex, baseURI, writeTokenMatch, writeToken, uri, fetchParameters, response, responseType, errorBody, error;
75
71
  return _regeneratorRuntime.wrap(function _callee$(_context) {
76
72
  while (1) switch (_context.prev = _context.next) {
77
73
  case 0:
@@ -79,48 +75,16 @@ var HttpClient = /*#__PURE__*/function () {
79
75
  baseURI = this.BaseURI(uriIndex); // If URL contains a write token, it must go to the correct server and can not fail over
80
76
  writeTokenMatch = path.replace(/^\//, "").match(/(qlibs\/ilib[a-zA-Z0-9]+|q|qid)\/(tqw__[a-zA-Z0-9]+)/);
81
77
  writeToken = writeTokenMatch ? writeTokenMatch[2] : undefined;
82
- if (!writeToken) {
83
- _context.next = 29;
84
- break;
85
- }
86
- allowFailover = false;
87
- if (!this.draftURIs[writeToken]) {
88
- _context.next = 10;
89
- break;
90
- }
91
- // Use saved write token URI
92
- baseURI = this.draftURIs[writeToken];
93
- _context.next = 29;
94
- break;
95
- case 10:
96
- if (!this.networkName) {
97
- _context.next = 28;
98
- break;
78
+ if (writeToken) {
79
+ allowFailover = false;
80
+ if (this.draftURIs[writeToken]) {
81
+ // Use saved write token URI
82
+ baseURI = this.draftURIs[writeToken];
83
+ } else {
84
+ // Save current URI for all future requests involving this write token
85
+ this.draftURIs[writeToken] = baseURI;
86
+ }
99
87
  }
100
- _context.prev = 11;
101
- configUrl = new URL(NetworkUrls[this.networkName]);
102
- configUrl.pathname = UrlJoin("/s", this.networkName, "nodes");
103
- configUrl.searchParams.set("token", writeToken);
104
- _context.t0 = URI;
105
- _context.next = 18;
106
- return fetch(configUrl);
107
- case 18:
108
- _context.next = 20;
109
- return _context.sent.json();
110
- case 20:
111
- _context.t1 = _context.sent.nodes[0].services.fabric_api.urls[0];
112
- baseURI = new _context.t0(_context.t1);
113
- _context.next = 28;
114
- break;
115
- case 24:
116
- _context.prev = 24;
117
- _context.t2 = _context["catch"](11);
118
- this.Log("Failed to retrieve write token node for " + writeToken);
119
- this.Log(_context.t2);
120
- case 28:
121
- // Save current URI for all future requests involving this write token
122
- this.draftURIs[writeToken] = baseURI;
123
- case 29:
124
88
  uri = baseURI.path(path).query(queryParams).hash("");
125
89
  fetchParameters = {
126
90
  method: method,
@@ -137,50 +101,50 @@ var HttpClient = /*#__PURE__*/function () {
137
101
  this.Log("".concat(method, " - ").concat(uri.toString()));
138
102
  this.Log("fetchParameters: ".concat(JSON.stringify(fetchParameters, null, 2)));
139
103
  }
140
- _context.prev = 33;
141
- _context.next = 36;
104
+ _context.prev = 9;
105
+ _context.next = 12;
142
106
  return HttpClient.Fetch(uri.toString(), fetchParameters);
143
- case 36:
107
+ case 12:
144
108
  response = _context.sent;
145
- _context.next = 42;
109
+ _context.next = 18;
146
110
  break;
147
- case 39:
148
- _context.prev = 39;
149
- _context.t3 = _context["catch"](33);
111
+ case 15:
112
+ _context.prev = 15;
113
+ _context.t0 = _context["catch"](9);
150
114
  response = {
151
115
  ok: false,
152
- status: _context.t3 && _context.t3.status || 500,
153
- statusText: "ElvClient Error: " + _context.t3.message,
116
+ status: _context.t0 && _context.t0.status || 500,
117
+ statusText: "ElvClient Error: " + _context.t0.message,
154
118
  url: uri.toString(),
155
- error: _context.t3
119
+ error: _context.t0
156
120
  };
157
- case 42:
121
+ case 18:
158
122
  if (response.ok) {
159
- _context.next = 71;
123
+ _context.next = 47;
160
124
  break;
161
125
  }
162
126
  if (!((parseInt(response.status) >= 500 || forceFailover) && allowRetry && attempts < this.retries)) {
163
- _context.next = 55;
127
+ _context.next = 31;
164
128
  break;
165
129
  }
166
130
  if (!allowFailover) {
167
- _context.next = 49;
131
+ _context.next = 25;
168
132
  break;
169
133
  }
170
134
  // Fail over to alternate node
171
135
  this.uriIndex = (this.uriIndex + 1) % this.uris.length;
172
136
  this.Log("HttpClient failing over from ".concat(baseURI.toString(), ": ").concat(attempts + 1, " attempts"), true);
173
- _context.next = 52;
137
+ _context.next = 28;
174
138
  break;
175
- case 49:
139
+ case 25:
176
140
  // Wait and retry
177
141
  this.Log("HttpClient retrying request from ".concat(baseURI.toString(), ": ").concat(attempts + 1, " attempts"), true);
178
- _context.next = 52;
142
+ _context.next = 28;
179
143
  return new Promise(function (resolve) {
180
144
  return setTimeout(resolve, 1000);
181
145
  });
182
- case 52:
183
- _context.next = 54;
146
+ case 28:
147
+ _context.next = 30;
184
148
  return this.Request({
185
149
  method: method,
186
150
  path: path,
@@ -192,34 +156,34 @@ var HttpClient = /*#__PURE__*/function () {
192
156
  uriIndex: uriIndex,
193
157
  forceFailover: forceFailover
194
158
  });
195
- case 54:
159
+ case 30:
196
160
  return _context.abrupt("return", _context.sent);
197
- case 55:
161
+ case 31:
198
162
  // Parse JSON error if headers indicate JSON
199
163
  responseType = response.headers ? response.headers.get("content-type") || "" : "";
200
164
  errorBody = "";
201
165
  if (!(response.text && response.json)) {
202
- _context.next = 68;
166
+ _context.next = 44;
203
167
  break;
204
168
  }
205
169
  if (!responseType.includes("application/json")) {
206
- _context.next = 64;
170
+ _context.next = 40;
207
171
  break;
208
172
  }
209
- _context.next = 61;
173
+ _context.next = 37;
210
174
  return response.json();
211
- case 61:
212
- _context.t4 = _context.sent;
213
- _context.next = 67;
175
+ case 37:
176
+ _context.t1 = _context.sent;
177
+ _context.next = 43;
214
178
  break;
215
- case 64:
216
- _context.next = 66;
179
+ case 40:
180
+ _context.next = 42;
217
181
  return response.text();
218
- case 66:
219
- _context.t4 = _context.sent;
220
- case 67:
221
- errorBody = _context.t4;
222
- case 68:
182
+ case 42:
183
+ _context.t1 = _context.sent;
184
+ case 43:
185
+ errorBody = _context.t1;
186
+ case 44:
223
187
  error = {
224
188
  name: "ElvHttpClientError",
225
189
  status: response.status,
@@ -232,14 +196,14 @@ var HttpClient = /*#__PURE__*/function () {
232
196
  };
233
197
  if (this.debug) this.Log(JSON.stringify(error, null, 2), true);
234
198
  throw error;
235
- case 71:
199
+ case 47:
236
200
  this.Log("".concat(response.status, " - ").concat(method, " ").concat(uri.toString()));
237
201
  return _context.abrupt("return", response);
238
- case 73:
202
+ case 49:
239
203
  case "end":
240
204
  return _context.stop();
241
205
  }
242
- }, _callee, this, [[11, 24], [33, 39]]);
206
+ }, _callee, this, [[9, 15]]);
243
207
  }));
244
208
  function Request(_x) {
245
209
  return _Request.apply(this, arguments);
@@ -1578,6 +1578,16 @@ var AbrProfileLiveDrm = {
1578
1578
  }
1579
1579
  },
1580
1580
  "playout_formats": {
1581
+ "dash-playready-cenc": {
1582
+ "drm": {
1583
+ "enc_scheme_name": "cenc",
1584
+ "type": "DrmPlayReady"
1585
+ },
1586
+ "protocol": {
1587
+ "min_buffer_length": 2,
1588
+ "type": "ProtoDash"
1589
+ }
1590
+ },
1581
1591
  "dash-widevine": {
1582
1592
  "drm": {
1583
1593
  "content_id": "",
@@ -2375,7 +2375,7 @@ exports.PlayoutOptions = /*#__PURE__*/function () {
2375
2375
  i = 0;
2376
2376
  case 70:
2377
2377
  if (!(i < playoutOptions.length)) {
2378
- _context32.next = 136;
2378
+ _context32.next = 135;
2379
2379
  break;
2380
2380
  }
2381
2381
  option = playoutOptions[i];
@@ -2409,12 +2409,11 @@ exports.PlayoutOptions = /*#__PURE__*/function () {
2409
2409
  _context32.t21 = _defineProperty;
2410
2410
  _context32.t22 = {};
2411
2411
  _context32.t23 = drm || "clear";
2412
- _context32.t24 = option.properties || {};
2413
2412
  if (!signedLink) {
2414
- _context32.next = 99;
2413
+ _context32.next = 98;
2415
2414
  break;
2416
2415
  }
2417
- _context32.next = 96;
2416
+ _context32.next = 95;
2418
2417
  return this.LinkUrl({
2419
2418
  versionHash: versionHash,
2420
2419
  writeToken: writeToken,
@@ -2422,12 +2421,12 @@ exports.PlayoutOptions = /*#__PURE__*/function () {
2422
2421
  queryParams: queryParams,
2423
2422
  noAuth: true
2424
2423
  });
2425
- case 96:
2426
- _context32.t25 = _context32.sent;
2427
- _context32.next = 102;
2428
- break;
2429
- case 99:
2424
+ case 95:
2425
+ _context32.t24 = _context32.sent;
2430
2426
  _context32.next = 101;
2427
+ break;
2428
+ case 98:
2429
+ _context32.next = 100;
2431
2430
  return this.Rep({
2432
2431
  libraryId: linkTarget.libraryId || libraryId,
2433
2432
  objectId: linkTarget.objectId || objectId,
@@ -2437,26 +2436,26 @@ exports.PlayoutOptions = /*#__PURE__*/function () {
2437
2436
  noAuth: true,
2438
2437
  queryParams: queryParams
2439
2438
  });
2439
+ case 100:
2440
+ _context32.t24 = _context32.sent;
2440
2441
  case 101:
2441
- _context32.t25 = _context32.sent;
2442
- case 102:
2443
- _context32.t26 = _context32.t25;
2442
+ _context32.t25 = _context32.t24;
2444
2443
  if (!signedLink) {
2445
- _context32.next = 109;
2444
+ _context32.next = 108;
2446
2445
  break;
2447
2446
  }
2448
- _context32.next = 106;
2447
+ _context32.next = 105;
2449
2448
  return this.GlobalUrl({
2450
2449
  versionHash: versionHash,
2451
2450
  path: UrlJoin(linkPath, offering, playoutPath),
2452
2451
  queryParams: queryParams
2453
2452
  });
2454
- case 106:
2455
- _context32.t27 = _context32.sent;
2456
- _context32.next = 112;
2457
- break;
2458
- case 109:
2453
+ case 105:
2454
+ _context32.t26 = _context32.sent;
2459
2455
  _context32.next = 111;
2456
+ break;
2457
+ case 108:
2458
+ _context32.next = 110;
2460
2459
  return this.GlobalUrl({
2461
2460
  libraryId: linkTarget.libraryId || libraryId,
2462
2461
  objectId: linkTarget.objectId || objectId,
@@ -2464,23 +2463,23 @@ exports.PlayoutOptions = /*#__PURE__*/function () {
2464
2463
  path: UrlJoin("rep", handler, offering, playoutPath),
2465
2464
  queryParams: queryParams
2466
2465
  });
2466
+ case 110:
2467
+ _context32.t26 = _context32.sent;
2467
2468
  case 111:
2468
- _context32.t27 = _context32.sent;
2469
- case 112:
2470
- _context32.t28 = _context32.t27;
2471
- _context32.t29 = drm ? _defineProperty({}, drm, {
2469
+ _context32.t27 = _context32.t26;
2470
+ _context32.t28 = drm ? _defineProperty({}, drm, {
2472
2471
  licenseServers: licenseServers,
2473
2472
  cert: cert
2474
2473
  }) : undefined;
2475
2474
  if (thumbnailTrackUri) {
2476
- _context32.next = 118;
2475
+ _context32.next = 117;
2477
2476
  break;
2478
2477
  }
2479
- _context32.t30 = undefined;
2480
- _context32.next = 121;
2481
- break;
2482
- case 118:
2478
+ _context32.t29 = undefined;
2483
2479
  _context32.next = 120;
2480
+ break;
2481
+ case 117:
2482
+ _context32.next = 119;
2484
2483
  return this.Rep({
2485
2484
  libraryId: linkTarget.libraryId || libraryId,
2486
2485
  objectId: linkTarget.objectId || objectId,
@@ -2488,23 +2487,22 @@ exports.PlayoutOptions = /*#__PURE__*/function () {
2488
2487
  rep: UrlJoin(handler, offering, thumbnailTrackUri),
2489
2488
  queryParams: queryParams
2490
2489
  });
2490
+ case 119:
2491
+ _context32.t29 = _context32.sent;
2491
2492
  case 120:
2492
- _context32.t30 = _context32.sent;
2493
- case 121:
2494
- _context32.t31 = _context32.t30;
2495
- _context32.t32 = {
2496
- properties: _context32.t24,
2497
- playoutUrl: _context32.t26,
2498
- globalPlayoutUrl: _context32.t28,
2499
- drms: _context32.t29,
2500
- thumbnailTrack: _context32.t31
2493
+ _context32.t30 = _context32.t29;
2494
+ _context32.t31 = {
2495
+ playoutUrl: _context32.t25,
2496
+ globalPlayoutUrl: _context32.t27,
2497
+ drms: _context32.t28,
2498
+ thumbnailTrack: _context32.t30
2501
2499
  };
2502
- _context32.t33 = (0, _context32.t21)(_context32.t22, _context32.t23, _context32.t32);
2503
- _context32.t34 = (0, _context32.t18)(_context32.t19, _context32.t20, _context32.t33);
2504
- _context32.t35 = {
2505
- playoutMethods: _context32.t34
2500
+ _context32.t32 = (0, _context32.t21)(_context32.t22, _context32.t23, _context32.t31);
2501
+ _context32.t33 = (0, _context32.t18)(_context32.t19, _context32.t20, _context32.t32);
2502
+ _context32.t34 = {
2503
+ playoutMethods: _context32.t33
2506
2504
  };
2507
- playoutMap[protocol] = (0, _context32.t15)(_context32.t16, _context32.t17, _context32.t35);
2505
+ playoutMap[protocol] = (0, _context32.t15)(_context32.t16, _context32.t17, _context32.t34);
2508
2506
  // Add .cert_url if playoutMap[protocol].playoutMethods[].drms[].cert is present
2509
2507
  // (for clients that need cert supplied as a URL reference rather than as a string literal)
2510
2508
  for (method in playoutMap[protocol].playoutMethods) {
@@ -2520,21 +2518,21 @@ exports.PlayoutOptions = /*#__PURE__*/function () {
2520
2518
  protocolMatch = protocols.includes(protocol);
2521
2519
  drmMatch = drms.includes(drm || "clear") || drms.length === 0 && !drm;
2522
2520
  if (!(!protocolMatch || !drmMatch)) {
2523
- _context32.next = 132;
2521
+ _context32.next = 131;
2524
2522
  break;
2525
2523
  }
2526
- return _context32.abrupt("continue", 133);
2527
- case 132:
2524
+ return _context32.abrupt("continue", 132);
2525
+ case 131:
2528
2526
  // This protocol / DRM satisfies the specifications (prefer DRM over clear, if available)
2529
2527
  if (!playoutMap[protocol].playoutUrl || drm && drm !== "clear") {
2530
2528
  playoutMap[protocol].playoutUrl = playoutMap[protocol].playoutMethods[drm || "clear"].playoutUrl;
2531
2529
  playoutMap[protocol].drms = playoutMap[protocol].playoutMethods[drm || "clear"].drms;
2532
2530
  }
2533
- case 133:
2531
+ case 132:
2534
2532
  i++;
2535
2533
  _context32.next = 70;
2536
2534
  break;
2537
- case 136:
2535
+ case 135:
2538
2536
  // Callbacks for retrieving and setting multiview views
2539
2537
  if (multiview && sessionId) {
2540
2538
  playoutMap.sessionId = sessionId;
@@ -2590,7 +2588,7 @@ exports.PlayoutOptions = /*#__PURE__*/function () {
2590
2588
  }
2591
2589
  this.Log(playoutMap);
2592
2590
  return _context32.abrupt("return", playoutMap);
2593
- case 139:
2591
+ case 138:
2594
2592
  case "end":
2595
2593
  return _context32.stop();
2596
2594
  }
@@ -2782,21 +2780,10 @@ exports.GlobalUrl = /*#__PURE__*/function () {
2782
2780
  libraryId = _ref59.libraryId, objectId = _ref59.objectId, writeToken = _ref59.writeToken, versionHash = _ref59.versionHash, _ref59$path = _ref59.path, path = _ref59$path === void 0 ? "/" : _ref59$path, authorizationToken = _ref59.authorizationToken, _ref59$noAuth = _ref59.noAuth, noAuth = _ref59$noAuth === void 0 ? false : _ref59$noAuth, _ref59$resolve = _ref59.resolve, resolve = _ref59$resolve === void 0 ? true : _ref59$resolve, _ref59$queryParams = _ref59.queryParams, queryParams = _ref59$queryParams === void 0 ? {} : _ref59$queryParams;
2783
2781
  network = this.NetworkInfo().name;
2784
2782
  url = new URL(network === "main" ? "https://main.net955305.contentfabric.io" : "https://demov3.net955210.contentfabric.io"); // Pull auth out of query params
2785
- if (queryParams.authorization) {
2786
- _context34.next = 8;
2787
- break;
2783
+ if (queryParams.authorization && (typeof queryParams.authorization === "string" || Array.isArray(queryParams.authorization) && queryParams.authorization.length === 1)) {
2784
+ queryParams = _objectSpread({}, queryParams);
2785
+ authorizationToken = typeof queryParams.authorization === "string" ? queryParams.authorization : queryParams.authorization[0];
2788
2786
  }
2789
- queryParams = _objectSpread({}, queryParams);
2790
- _context34.next = 7;
2791
- return this.authClient.AuthorizationToken({
2792
- libraryId: libraryId,
2793
- objectId: objectId,
2794
- versionHash: versionHash,
2795
- noAuth: noAuth
2796
- });
2797
- case 7:
2798
- queryParams.authorization = _context34.sent;
2799
- case 8:
2800
2787
  if (writeToken) {
2801
2788
  fabricNodeUrl = this.HttpClient.draftURIs[writeToken];
2802
2789
  if (fabricNodeUrl) {
@@ -2804,28 +2791,51 @@ exports.GlobalUrl = /*#__PURE__*/function () {
2804
2791
  }
2805
2792
  }
2806
2793
  urlPath = UrlJoin("s", network);
2794
+ if (!(!noAuth || authorizationToken)) {
2795
+ _context34.next = 15;
2796
+ break;
2797
+ }
2798
+ _context34.t0 = UrlJoin;
2799
+ _context34.t1 = authorizationToken;
2800
+ if (_context34.t1) {
2801
+ _context34.next = 13;
2802
+ break;
2803
+ }
2804
+ _context34.next = 12;
2805
+ return this.authClient.AuthorizationToken({
2806
+ libraryId: libraryId,
2807
+ objectId: objectId,
2808
+ versionHash: versionHash,
2809
+ noAuth: noAuth
2810
+ });
2811
+ case 12:
2812
+ _context34.t1 = _context34.sent;
2813
+ case 13:
2814
+ _context34.t2 = _context34.t1;
2815
+ urlPath = (0, _context34.t0)("t", _context34.t2);
2816
+ case 15:
2807
2817
  if (!versionHash) {
2808
- _context34.next = 14;
2818
+ _context34.next = 19;
2809
2819
  break;
2810
2820
  }
2811
2821
  objectId = this.utils.DecodeVersionHash(versionHash).objectId;
2812
- _context34.next = 20;
2822
+ _context34.next = 25;
2813
2823
  break;
2814
- case 14:
2815
- _context34.t0 = libraryId;
2816
- if (_context34.t0) {
2817
- _context34.next = 19;
2824
+ case 19:
2825
+ _context34.t3 = libraryId;
2826
+ if (_context34.t3) {
2827
+ _context34.next = 24;
2818
2828
  break;
2819
2829
  }
2820
- _context34.next = 18;
2830
+ _context34.next = 23;
2821
2831
  return this.ContentObjectLibraryId({
2822
2832
  objectId: objectId
2823
2833
  });
2824
- case 18:
2825
- _context34.t0 = _context34.sent;
2826
- case 19:
2827
- libraryId = _context34.t0;
2828
- case 20:
2834
+ case 23:
2835
+ _context34.t3 = _context34.sent;
2836
+ case 24:
2837
+ libraryId = _context34.t3;
2838
+ case 25:
2829
2839
  if (path.startsWith("/qfab")) {
2830
2840
  urlPath = UrlJoin(urlPath, path.replace(/^\/qfab/, "q"));
2831
2841
  } else if (versionHash) {
@@ -2841,7 +2851,7 @@ exports.GlobalUrl = /*#__PURE__*/function () {
2841
2851
  return url.searchParams.set(key, queryParams[key]);
2842
2852
  });
2843
2853
  return _context34.abrupt("return", url.toString());
2844
- case 25:
2854
+ case 30:
2845
2855
  case "end":
2846
2856
  return _context34.stop();
2847
2857
  }
@@ -4329,7 +4339,6 @@ exports.EncryptionConk = /*#__PURE__*/function () {
4329
4339
  libraryId: libraryId,
4330
4340
  objectId: objectId,
4331
4341
  versionHash: versionHash,
4332
- writeToken: writeToken,
4333
4342
  metadataSubtree: ownerCapKey
4334
4343
  });
4335
4344
  case 10: