@zezosoft/zezo-transcoder-api-client
Version:
The official TypeScript SDK for Zezo Transcoder API. Easily integrate Zezo Transcoder into your applications with a powerful, developer-friendly package for video transcoding.
3 lines (2 loc) • 4.29 kB
JavaScript
;var t=require("axios"),r=require("qs"),n=function(t,r){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])},n(t,r)};function e(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function e(){this.constructor=t}n(t,r),t.prototype=null===r?Object.create(r):(e.prototype=r.prototype,new e)}var o=function(){return o=Object.assign||function(t){for(var r,n=1,e=arguments.length;n<e;n++)for(var o in r=arguments[n])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t},o.apply(this,arguments)};function i(t,r,n,e){return new(n||(n=Promise))((function(o,i){function u(t){try{a(e.next(t))}catch(t){i(t)}}function c(t){try{a(e.throw(t))}catch(t){i(t)}}function a(t){var r;t.done?o(t.value):(r=t.value,r instanceof n?r:new n((function(t){t(r)}))).then(u,c)}a((e=e.apply(t,r||[])).next())}))}function u(t,r){var n,e,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=c(0),u.throw=c(1),u.return=c(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function c(c){return function(a){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;u&&(u=0,c[0]&&(i=0)),i;)try{if(n=1,e&&(o=2&c[0]?e.return:c[0]?e.throw||((o=e.return)&&o.call(e),0):e.next)&&!(o=o.call(e,c[1])).done)return o;switch(e=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,e=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=r.call(t,i)}catch(t){c=[6,t],e=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,a])}}}"function"==typeof SuppressedError&&SuppressedError;var c=function(){function r(r){this.client=t.create({baseURL:"https://api-v1.zezo.in",headers:o({"Content-Type":"application/json",Accept:"application/json","x-api-key":r.apiKey},r.headers||{})})}return r.prototype.request=function(t){return i(this,void 0,void 0,(function(){return u(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.client.request(t)];case 1:return[2,r.sent()];case 2:throw r.sent();case 3:return[2]}}))}))},r}();function a(t){return Object.fromEntries(Object.entries(t).filter((function(t){return t[0],t[1]})))}var s=function(t){function n(r){return t.call(this,r)||this}return e(n,t),n.prototype.create=function(t){return i(this,void 0,void 0,(function(){return u(this,(function(r){return[2,this.request({method:"POST",url:"/api/v1/transcoder/storage",data:t})]}))}))},n.prototype.getList=function(t){return i(this,void 0,void 0,(function(){return u(this,(function(n){return[2,this.request({method:"GET",url:"/api/v1/transcoder/storage",params:a(t||{}),paramsSerializer:function(t){return r.stringify(t)}})]}))}))},n.prototype.delete=function(t){return i(this,void 0,void 0,(function(){return u(this,(function(r){return[2,this.request({method:"DELETE",url:"/api/v1/transcoder/storage/".concat(t)})]}))}))},n.prototype.update=function(t,r){return i(this,void 0,void 0,(function(){return u(this,(function(n){return[2,this.request({method:"PUT",url:"/api/v1/transcoder/storage/".concat(t),data:r})]}))}))},n}(c),f=function(t){function n(r){return t.call(this,r)||this}return e(n,t),n.prototype.create=function(t){return i(this,void 0,void 0,(function(){return u(this,(function(r){return[2,this.request({method:"POST",url:"/api/v1/transcoder/jobs",data:t})]}))}))},n.prototype.getList=function(t){return i(this,void 0,void 0,(function(){return u(this,(function(n){return[2,this.request({method:"GET",url:"/api/v1/transcoder/jobs",params:a(t||{}),paramsSerializer:function(t){return r.stringify(t)}})]}))}))},n}(c),p=function(t){this.storage=new s(t),this.transcoding=new f(t)};exports.ZezoTranscoder=p;
//# sourceMappingURL=index.cjs.map