@nomad-media/full 1.1.7 → 1.1.8
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.
|
@@ -10513,7 +10513,7 @@ async function _updateContent(AUTH_TOKEN, URL, CONTENT_ID, CONTENT_DEFINITION_ID
|
|
|
10513
10513
|
|
|
10514
10514
|
if (body.contentDefinitionId !== CONTENT_DEFINITION_ID) body.contentDefinitionId = CONTENT_DEFINITION_ID;
|
|
10515
10515
|
if (body.contentId !== CONTENT_ID) body.contentId = CONTENT_ID;
|
|
10516
|
-
if (body.
|
|
10516
|
+
if (body.language !== LANGUAGE_ID) body.language = LANGUAGE_ID;
|
|
10517
10517
|
|
|
10518
10518
|
_updateProperties(body, PROPERTIES);
|
|
10519
10519
|
}
|
|
@@ -20,7 +20,7 @@ METHOD: POST`);try{var s=await fetch(t,{method:"POST",headers:n});if(!s.ok)throw
|
|
|
20
20
|
METHOD: DELETE`);var r=await fetch(t,{method:"DELETE",headers:i});if(!r.ok)throw await r.json()}catch(e){_apiExceptionHandler(e,"Delete Content Failed")}}async function _getContentUserTrackTouch(e,t,i,a,n){t+=`/api/content/${a}/user-track/${i}/touch`,a=new Headers;a.append("Content-Type","application/json"),a.append("Authorization","Bearer "+e),n&&console.log(`URL: ${t}
|
|
21
21
|
METHOD: GET`);try{var r=await fetch(t,{method:"GET",headers:a});if(r.ok)return await r.json();throw await r.json()}catch(e){_apiExceptionHandler(e,"Get Content User Track Touch Failed")}}async function _getContentUserTrack(e,t,i,a,n,r,o,s,l){t=new URL(t+`/content/${a}/user-track/`+i),a=new URLSearchParams,a.append("sortColumn",n),a.append("isDesc",r),a.append("pageIndex",o),a.append("sizeIndex",s),t.search=a.toString(),i=new Headers;i.append("Content-Type","application/json"),i.append("Authorization","Bearer "+e),l&&console.log(`URL: ${t}
|
|
22
22
|
METHOD: GET`);try{var d=await fetch(t,{method:"GET",headers:i});if(d.ok)return await d.json();throw await d.json()}catch(e){_apiExceptionHandler(e,"Get Content User Track Failed")}}async function _getContent(e,t,i,a,n,r){let o=t+`/api/content/${i}?contentDefinitionId=`+a;null!=n&&(o+="&isRevision="+n);t=new Headers;t.append("Authorization","Bearer "+e),t.append("Content-Type","application/json"),r&&console.log(`URL: ${o}
|
|
23
|
-
METHOD: GET`);try{var s=await fetch(o,{method:"GET",headers:t});if(s.ok)return await s.json();throw await s.json()}catch(e){_apiExceptionHandler(e,"Get Content Failed")}}import deepEqual from"deep-equal";async function _updateContent(e,t,i,a,n,r,o){var s=t+"/api/content/"+i,l=new Headers;l.append("Content-Type","application/json"),l.append("Authorization","Bearer "+e);let d=null;try{(d=await _getContent(e,t,i,a,null,o)).contentDefinitionId!==a&&(d.contentDefinitionId=a),d.contentId!==i&&(d.contentId=i),d.
|
|
23
|
+
METHOD: GET`);try{var s=await fetch(o,{method:"GET",headers:t});if(s.ok)return await s.json();throw await s.json()}catch(e){_apiExceptionHandler(e,"Get Content Failed")}}import deepEqual from"deep-equal";async function _updateContent(e,t,i,a,n,r,o){var s=t+"/api/content/"+i,l=new Headers;l.append("Content-Type","application/json"),l.append("Authorization","Bearer "+e);let d=null;try{(d=await _getContent(e,t,i,a,null,o)).contentDefinitionId!==a&&(d.contentDefinitionId=a),d.contentId!==i&&(d.contentId=i),d.language!==r&&(d.language=r),_updateProperties(d,n)}catch(e){d={contentDefinitionId:a,contentId:i,languageId:r,properties:n}}o&&console.log(`URL: ${s}
|
|
24
24
|
METHOD: PUT
|
|
25
25
|
BODY: `+JSON.stringify(d,null,4));try{var p=await fetch(s,{method:"PUT",headers:l,body:JSON.stringify(d)});if(p.ok)return await p.json();throw await p.json()}catch(e){_apiExceptionHandler(e,"Update Content Failed")}}function _updateProperties(t,i){for(const a in i)if(Array.isArray(i[a]))for(let e=0;e<i[a].length;++e)deepEqual(t.properties[a][e],i[a][e])||(t.properties[a][e]=i[a][e]);else"object"==typeof i[a]?deepEqual(t.properties[a],i[a])||(t.properties[a]=i[a]):t.properties[a]!==i[a]&&(t.properties[a]=i[a])}async function _addLiveScheduleToEvent(e,t,i,a,n,r,o,s,l,d,p,c,h,u){var t=t+"/api/admin/liveSchedule",f=new Headers,e=(f.append("Content-Type","application/json"),f.append("Authorization","Bearer "+e),{contentId:i,slateVideo:null!==a?a:"",prerollVideo:null!==n?n:"",postrollVideo:null!==r?r:"",isSecureOutput:null!==o?o:"",archiveFolderAsset:null!==s?s:"",primaryLiveInput:null!==l?l:"",backupLiveInput:null!==d?d:"",primaryLivestreamInputUrl:null!==p?p:"",backupLivestreamInputUrl:null!==c?c:"",externalOutputProfiles:null!==h?h:""});u&&console.log(`URL: ${t}
|
|
26
26
|
METHOD: POST
|