@hypermedialabs/uploader
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -1,2 +0,2 @@ | ||
!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useHypermediaUploader=void 0;const e=require("tslib"),o=e.__importDefault(require("@uppy/core")),i=require("tus-js-client"),r=require("./apiRequest");exports.useHypermediaUploader=(t,n)=>{const{onError:s,onProgress:l,onSuccess:a,autoProceed:d=!0,allowMultipleUploadBatches:u=!0,debug:c,maxFileSize:p,minFileSize:m,maxTotalFileSize:f,minNumberOfFiles:w=1,maxNumberOfFiles:g=1}=n,F=new o.default({autoProceed:d,allowMultipleUploadBatches:u,debug:c,restrictions:{maxFileSize:p,minFileSize:m,maxTotalFileSize:f,maxNumberOfFiles:g,minNumberOfFiles:w,allowedFileTypes:["video/*"]},infoTimeout:1e4});return F.on("file-added",(o=>e.__awaiter(void 0,void 0,void 0,(function*(){const e=yield(0,r.apiRequest)(t,"POST",{title:o.name,size:o.size});if(!e.ok)throw console.error("ERROR:",e),new Error("Something went wrong getting upload information");{const r=yield e.json();if(!r.success)throw console.error("ERROR:",r),new Error("Something went wrong before start uploading");{const{data:e}=r,t=new i.Upload(o.data,{endpoint:e.endpoint,retryDelays:[0,3e3,5e3,1e4],removeFingerprintOnSuccess:!0,chunkSize:3145728,headers:e.headers,metadata:{filetype:o.data.type,collection:e.collection,title:o.name},onError:e=>{console.error(e),s&&s(e)},onProgress:(e,o)=>{l&&l(e/o*100,e,o)},onSuccess:()=>{a&&a(t)}});t.findPreviousUploads().then((e=>{e.length&&t.resumeFromPreviousUpload(e[0]),t.start()}))}}})))),F}})); | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useHypermediaUploader=void 0;const e=require("tslib"),o=e.__importDefault(require("@uppy/core")),r=require("tus-js-client"),i=require("./apiRequest");exports.useHypermediaUploader=(t,n)=>{const{onError:s,onProgress:l,onSuccess:a,autoProceed:d=!0,allowMultipleUploadBatches:u=!0,debug:c,maxFileSize:p,minFileSize:m,maxTotalFileSize:f,minNumberOfFiles:w=1,maxNumberOfFiles:g=1}=n,F=new o.default({autoProceed:d,allowMultipleUploadBatches:u,debug:c,restrictions:{maxFileSize:p,minFileSize:m,maxTotalFileSize:f,maxNumberOfFiles:g,minNumberOfFiles:w,allowedFileTypes:["video/*"]},infoTimeout:1e4});return F.on("file-added",(o=>e.__awaiter(void 0,void 0,void 0,(function*(){const e=yield(0,i.apiRequest)(t,"POST",{title:o.name,size:o.size});if(!e.ok)throw console.error("ERROR:",e),new Error("Something went wrong getting upload information");{const i=yield e.json();if(!i.success)throw console.error("ERROR:",i),new Error("Something went wrong before start uploading");{const{data:e}=i,t=new r.Upload(o.data,{endpoint:e.endpoint,retryDelays:[0,3e3,5e3,1e4],removeFingerprintOnSuccess:!0,chunkSize:3145728,headers:e.headers,metadata:{filetype:o.data.type,collection:e.collection,title:o.name},onError:e=>{console.error(e),s&&s(e)},onProgress:(e,o)=>{l&&l(e/o*100,e,o)},onSuccess:()=>{a&&a(t)}});t.findPreviousUploads().then((e=>{e.length&&t.resumeFromPreviousUpload(e[0]),t.start()}))}}})))),F}; | ||
//# sourceMappingURL=bundle.js.map |
{ | ||
"name": "@hypermedialabs/uploader", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Client Uploader is a powerful, flexible TypeScript library designed to streamline the process of uploading videos to your hypermedia account.", | ||
@@ -5,0 +5,0 @@ "main": "src/index.ts", |
@@ -0,1 +1,2 @@ | ||
import babel from '@rollup/plugin-babel'; | ||
import commonjs from '@rollup/plugin-commonjs'; | ||
@@ -10,3 +11,3 @@ import resolve from '@rollup/plugin-node-resolve'; | ||
file: 'dist/bundle.js', | ||
format: 'umd', | ||
format: 'cjs', | ||
name: '@hypermedialabs/uploader', | ||
@@ -16,2 +17,6 @@ sourcemap: true, | ||
plugins: [ | ||
babel({ | ||
exclude: 'node_modules/**', | ||
babelHelpers: 'bundled', | ||
}), | ||
resolve(), | ||
@@ -18,0 +23,0 @@ commonjs(), |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25873
212