@nomad-media/full 1.1.4 → 1.1.5
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.
|
@@ -17349,7 +17349,7 @@ async function _search(AUTH_TOKEN, URL, QUERY, OFFSET, SIZE , FILTERS, SORT_FIEL
|
|
|
17349
17349
|
if (SEARCH_RESULT_FIELDS) BODY["searchResultFields"] = SEARCH_RESULT_FIELDS;
|
|
17350
17350
|
if (SIMILAR_ASSET_ID) BODY["similarAssetId"] = SIMILAR_ASSET_ID;
|
|
17351
17351
|
if (MIN_SCORE) BODY["minScore"] = MIN_SCORE;
|
|
17352
|
-
if (EXCLUDE_TOTAL_RECORD_COUNT) BODY["excludeTotalRecordCount"] = EXCLUDE_TOTAL_RECORD_COUNT;
|
|
17352
|
+
if (EXCLUDE_TOTAL_RECORD_COUNT !== null) BODY["excludeTotalRecordCount"] = EXCLUDE_TOTAL_RECORD_COUNT;
|
|
17353
17353
|
if (FILTER_BINDER) BODY["filterBinder"] = FILTER_BINDER;
|
|
17354
17354
|
|
|
17355
17355
|
if (DEBUG_MODE) console.log(`URL: ${API_URL}\nMETHOD: POST\nBODY: ${JSON.stringify(BODY, null, 4 )}`);
|
|
@@ -257,7 +257,7 @@ BODY: `+JSON.stringify(e,null,4));try{var l=await fetch(o,{method:"POST",headers
|
|
|
257
257
|
METHOD: POST
|
|
258
258
|
BODY: `+JSON.stringify(e,null,4));try{var o=await fetch(t,{method:"POST",headers:r,body:JSON.stringify(e)});if(o.ok)return await o.json();throw await o.json()}catch(e){_apiExceptionHandler(e,"Ping user failed")}}async function _pingAuth(e,t,i,a,n){var t=t+"/api/account/ping/auth",r=new Headers,e=(r.append("Content-Type","application/json"),r.append("Authorization","Bearer "+e),{userId:a});i&&(e.applicationId=i),n&&console.log(`URL: ${t}
|
|
259
259
|
METHOD: POST
|
|
260
|
-
BODY: `+JSON.stringify(e,null,4));try{var o=await fetch(t,{method:"POST",headers:r,body:JSON.stringify(e)});if(o.ok)return await o.json();throw await o.json()}catch(e){_apiExceptionHandler(e,"Ping user failed")}}async function _search(e,t,i,a,n,r,o,s,l,d,p,c,h,u){t+=`/api/${h}/search`,h=new Headers,h.append("Content-Type","application/json"),h.append("Authorization","Bearer "+e),e={};i&&(e.searchQuery=i),e.pageOffset=a||0,e.pageSize=n||100,r&&(e.filters=r),o&&(e.sortFields=o),s&&(e.searchResultFields=s),l&&(e.similarAssetId=l),d&&(e.minScore=d),p&&(e.excludeTotalRecordCount=p),c&&(e.filterBinder=c),u&&console.log(`URL: ${t}
|
|
260
|
+
BODY: `+JSON.stringify(e,null,4));try{var o=await fetch(t,{method:"POST",headers:r,body:JSON.stringify(e)});if(o.ok)return await o.json();throw await o.json()}catch(e){_apiExceptionHandler(e,"Ping user failed")}}async function _search(e,t,i,a,n,r,o,s,l,d,p,c,h,u){t+=`/api/${h}/search`,h=new Headers,h.append("Content-Type","application/json"),h.append("Authorization","Bearer "+e),e={};i&&(e.searchQuery=i),e.pageOffset=a||0,e.pageSize=n||100,r&&(e.filters=r),o&&(e.sortFields=o),s&&(e.searchResultFields=s),l&&(e.similarAssetId=l),d&&(e.minScore=d),null!==p&&(e.excludeTotalRecordCount=p),c&&(e.filterBinder=c),u&&console.log(`URL: ${t}
|
|
261
261
|
METHOD: POST
|
|
262
262
|
BODY: `+JSON.stringify(e,null,4));try{var f=await fetch(t,{method:"POST",headers:h,body:JSON.stringify(e)});if(f.ok)return await f.json();throw await f.json()}catch(e){_apiExceptionHandler(e,"Search Failed")}}function _apiExceptionHandler(i,a){if(!i)throw new Error(a);if("string"==typeof i)throw new Error(a+": "+i);if(!i.errors)throw new Error(a+": "+i.message);if(Array.isArray(i.errors)){let t="";for(let e=0;e<i.errors.length;e++)t+=`${i.errors[e].code}: ${i.errors[e].field}: ${i.errors[e].message}\n`;throw new Error(a+": "+t)}if("object"==typeof i.errors){let e="";for(var t in i.errors)Object.prototype.hasOwnProperty.call(i.errors,t)&&(e+=`${t}: ${i.errors[t]}\n`);throw new Error(a+": "+e)}}import{getRandomValues}from"crypto";function _newGuid(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))}function _printDatetime(e){var t=(new Date).toLocaleTimeString();console.log(t+": "+e)}async function _sleep(t){if(t&&0!==t)return new Promise(e=>{setTimeout(()=>{e()},1e3*t)})}function _slugify(e){return e&&0!==e.trim().length?e.toString().normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim().replace(/\s+/g,"-").replace(/[^\w-]+/g,"").replace(/--+/g,"-"):""}async function _changeEmail(e,t,i,a,n){var t=t+"/api/account/change-email",r=new Headers,e=(r.append("Content-Type","application/json"),r.append("Authorization","Bearer "+e),{password:a,newEmail:i});n&&console.log(`URL: ${t}
|
|
263
263
|
METHOD: POST
|