@vunk/form 1.1.74 → 1.1.75

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.
@@ -9541,7 +9541,7 @@ const verify = async (data) => {
9541
9541
  return res.datas ?? res.data;
9542
9542
  }).then((data2) => {
9543
9543
  return {
9544
- uploadedList: data2.chunkList.map((item) => item.identifier + "-" + item.chunkNumber),
9544
+ uploadedList: data2.chunkList.map((item) => item.identifier + "-" + (item.chunkNumber - 1)),
9545
9545
  uploaded: data2.alreadyUploaded,
9546
9546
  mergedFile: data2.mergedFile
9547
9547
  };
@@ -25,4 +25,4 @@ function print() { __p += __j.call(arguments, '') }
25
25
  * Released under MIT license <https://lodash.com/license>
26
26
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
27
27
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
28
- */var y$="4.17.21",x$=2,b$=1,w$=3,Kf=4294967295,T$=Array.prototype,m$=Object.prototype,zf=m$.hasOwnProperty,Xf=H?H.iterator:void 0,E$=Math.max,Zf=Math.min,vr=function(n){return function(e,t,r){if(r==null){var i=F(t),u=i&&D(t),a=u&&u.length&&Ke(t,u);(a?a.length:i)||(r=t,t=e,e=this)}return n(e,t,r)}}(df);f.after=B.after,f.ary=B.ary,f.assign=$.assign,f.assignIn=$.assignIn,f.assignInWith=$.assignInWith,f.assignWith=$.assignWith,f.at=$.at,f.before=B.before,f.bind=B.bind,f.bindAll=P.bindAll,f.bindKey=B.bindKey,f.castArray=_.castArray,f.chain=yn.chain,f.chunk=p.chunk,f.compact=p.compact,f.concat=p.concat,f.cond=P.cond,f.conforms=P.conforms,f.constant=P.constant,f.countBy=I.countBy,f.create=$.create,f.curry=B.curry,f.curryRight=B.curryRight,f.debounce=B.debounce,f.defaults=$.defaults,f.defaultsDeep=$.defaultsDeep,f.defer=B.defer,f.delay=B.delay,f.difference=p.difference,f.differenceBy=p.differenceBy,f.differenceWith=p.differenceWith,f.drop=p.drop,f.dropRight=p.dropRight,f.dropRightWhile=p.dropRightWhile,f.dropWhile=p.dropWhile,f.fill=p.fill,f.filter=I.filter,f.flatMap=I.flatMap,f.flatMapDeep=I.flatMapDeep,f.flatMapDepth=I.flatMapDepth,f.flatten=p.flatten,f.flattenDeep=p.flattenDeep,f.flattenDepth=p.flattenDepth,f.flip=B.flip,f.flow=P.flow,f.flowRight=P.flowRight,f.fromPairs=p.fromPairs,f.functions=$.functions,f.functionsIn=$.functionsIn,f.groupBy=I.groupBy,f.initial=p.initial,f.intersection=p.intersection,f.intersectionBy=p.intersectionBy,f.intersectionWith=p.intersectionWith,f.invert=$.invert,f.invertBy=$.invertBy,f.invokeMap=I.invokeMap,f.iteratee=P.iteratee,f.keyBy=I.keyBy,f.keys=D,f.keysIn=$.keysIn,f.map=I.map,f.mapKeys=$.mapKeys,f.mapValues=$.mapValues,f.matches=P.matches,f.matchesProperty=P.matchesProperty,f.memoize=B.memoize,f.merge=$.merge,f.mergeWith=$.mergeWith,f.method=P.method,f.methodOf=P.methodOf,f.mixin=vr,f.negate=$e,f.nthArg=P.nthArg,f.omit=$.omit,f.omitBy=$.omitBy,f.once=B.once,f.orderBy=I.orderBy,f.over=P.over,f.overArgs=B.overArgs,f.overEvery=P.overEvery,f.overSome=P.overSome,f.partial=B.partial,f.partialRight=B.partialRight,f.partition=I.partition,f.pick=$.pick,f.pickBy=$.pickBy,f.property=P.property,f.propertyOf=P.propertyOf,f.pull=p.pull,f.pullAll=p.pullAll,f.pullAllBy=p.pullAllBy,f.pullAllWith=p.pullAllWith,f.pullAt=p.pullAt,f.range=P.range,f.rangeRight=P.rangeRight,f.rearg=B.rearg,f.reject=I.reject,f.remove=p.remove,f.rest=B.rest,f.reverse=p.reverse,f.sampleSize=I.sampleSize,f.set=$.set,f.setWith=$.setWith,f.shuffle=I.shuffle,f.slice=p.slice,f.sortBy=I.sortBy,f.sortedUniq=p.sortedUniq,f.sortedUniqBy=p.sortedUniqBy,f.split=O.split,f.spread=B.spread,f.tail=p.tail,f.take=p.take,f.takeRight=p.takeRight,f.takeRightWhile=p.takeRightWhile,f.takeWhile=p.takeWhile,f.tap=yn.tap,f.throttle=B.throttle,f.thru=ye,f.toArray=_.toArray,f.toPairs=$.toPairs,f.toPairsIn=$.toPairsIn,f.toPath=P.toPath,f.toPlainObject=_.toPlainObject,f.transform=$.transform,f.unary=B.unary,f.union=p.union,f.unionBy=p.unionBy,f.unionWith=p.unionWith,f.uniq=p.uniq,f.uniqBy=p.uniqBy,f.uniqWith=p.uniqWith,f.unset=$.unset,f.unzip=p.unzip,f.unzipWith=p.unzipWith,f.update=$.update,f.updateWith=$.updateWith,f.values=$.values,f.valuesIn=$.valuesIn,f.without=p.without,f.words=O.words,f.wrap=B.wrap,f.xor=p.xor,f.xorBy=p.xorBy,f.xorWith=p.xorWith,f.zip=p.zip,f.zipObject=p.zipObject,f.zipObjectDeep=p.zipObjectDeep,f.zipWith=p.zipWith,f.entries=$.toPairs,f.entriesIn=$.toPairsIn,f.extend=$.assignIn,f.extendWith=$.assignInWith,vr(f,f),f.add=X.add,f.attempt=P.attempt,f.camelCase=O.camelCase,f.capitalize=O.capitalize,f.ceil=X.ceil,f.clamp=_r.clamp,f.clone=_.clone,f.cloneDeep=_.cloneDeep,f.cloneDeepWith=_.cloneDeepWith,f.cloneWith=_.cloneWith,f.conformsTo=_.conformsTo,f.deburr=O.deburr,f.defaultTo=P.defaultTo,f.divide=X.divide,f.endsWith=O.endsWith,f.eq=_.eq,f.escape=O.escape,f.escapeRegExp=O.escapeRegExp,f.every=I.every,f.find=I.find,f.findIndex=p.findIndex,f.findKey=$.findKey,f.findLast=I.findLast,f.findLastIndex=p.findLastIndex,f.findLastKey=$.findLastKey,f.floor=X.floor,f.forEach=I.forEach,f.forEachRight=I.forEachRight,f.forIn=$.forIn,f.forInRight=$.forInRight,f.forOwn=$.forOwn,f.forOwnRight=$.forOwnRight,f.get=$.get,f.gt=_.gt,f.gte=_.gte,f.has=$.has,f.hasIn=$.hasIn,f.head=p.head,f.identity=K,f.includes=I.includes,f.indexOf=p.indexOf,f.inRange=_r.inRange,f.invoke=$.invoke,f.isArguments=_.isArguments,f.isArray=y,f.isArrayBuffer=_.isArrayBuffer,f.isArrayLike=_.isArrayLike,f.isArrayLikeObject=_.isArrayLikeObject,f.isBoolean=_.isBoolean,f.isBuffer=_.isBuffer,f.isDate=_.isDate,f.isElement=_.isElement,f.isEmpty=_.isEmpty,f.isEqual=_.isEqual,f.isEqualWith=_.isEqualWith,f.isError=_.isError,f.isFinite=_.isFinite,f.isFunction=_.isFunction,f.isInteger=_.isInteger,f.isLength=_.isLength,f.isMap=_.isMap,f.isMatch=_.isMatch,f.isMatchWith=_.isMatchWith,f.isNaN=_.isNaN,f.isNative=_.isNative,f.isNil=_.isNil,f.isNull=_.isNull,f.isNumber=_.isNumber,f.isObject=F,f.isObjectLike=_.isObjectLike,f.isPlainObject=_.isPlainObject,f.isRegExp=_.isRegExp,f.isSafeInteger=_.isSafeInteger,f.isSet=_.isSet,f.isString=_.isString,f.isSymbol=_.isSymbol,f.isTypedArray=_.isTypedArray,f.isUndefined=_.isUndefined,f.isWeakMap=_.isWeakMap,f.isWeakSet=_.isWeakSet,f.join=p.join,f.kebabCase=O.kebabCase,f.last=un,f.lastIndexOf=p.lastIndexOf,f.lowerCase=O.lowerCase,f.lowerFirst=O.lowerFirst,f.lt=_.lt,f.lte=_.lte,f.max=X.max,f.maxBy=X.maxBy,f.mean=X.mean,f.meanBy=X.meanBy,f.min=X.min,f.minBy=X.minBy,f.stubArray=P.stubArray,f.stubFalse=P.stubFalse,f.stubObject=P.stubObject,f.stubString=P.stubString,f.stubTrue=P.stubTrue,f.multiply=X.multiply,f.nth=p.nth,f.noop=P.noop,f.now=c$.now,f.pad=O.pad,f.padEnd=O.padEnd,f.padStart=O.padStart,f.parseInt=O.parseInt,f.random=_r.random,f.reduce=I.reduce,f.reduceRight=I.reduceRight,f.repeat=O.repeat,f.replace=O.replace,f.result=$.result,f.round=X.round,f.sample=I.sample,f.size=I.size,f.snakeCase=O.snakeCase,f.some=I.some,f.sortedIndex=p.sortedIndex,f.sortedIndexBy=p.sortedIndexBy,f.sortedIndexOf=p.sortedIndexOf,f.sortedLastIndex=p.sortedLastIndex,f.sortedLastIndexBy=p.sortedLastIndexBy,f.sortedLastIndexOf=p.sortedLastIndexOf,f.startCase=O.startCase,f.startsWith=O.startsWith,f.subtract=X.subtract,f.sum=X.sum,f.sumBy=X.sumBy,f.template=O.template,f.times=P.times,f.toFinite=_.toFinite,f.toInteger=x,f.toLength=_.toLength,f.toLower=O.toLower,f.toNumber=_.toNumber,f.toSafeInteger=_.toSafeInteger,f.toString=_.toString,f.toUpper=O.toUpper,f.trim=O.trim,f.trimEnd=O.trimEnd,f.trimStart=O.trimStart,f.truncate=O.truncate,f.unescape=O.unescape,f.uniqueId=P.uniqueId,f.upperCase=O.upperCase,f.upperFirst=O.upperFirst,f.each=I.forEach,f.eachRight=I.forEachRight,f.first=p.head,vr(f,function(){var n={};return $n(f,function(e,t){zf.call(f.prototype,t)||(n[t]=e)}),n}(),{chain:!1}),f.VERSION=y$,(f.templateSettings=O.templateSettings).imports._=f,on(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){f[n].placeholder=f}),on(["drop","take"],function(n,e){m.prototype[n]=function(t){t=t===void 0?1:E$(x(t),0);var r=this.__filtered__&&!e?new m(this):this.clone();return r.__filtered__?r.__takeCount__=Zf(t,r.__takeCount__):r.__views__.push({size:Zf(t,Kf),type:n+(r.__dir__<0?"Right":"")}),r},m.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),on(["filter","map","takeWhile"],function(n,e){var t=e+1,r=t==b$||t==w$;m.prototype[n]=function(i){var u=this.clone();return u.__iteratees__.push({iteratee:R(i),type:t}),u.__filtered__=u.__filtered__||r,u}}),on(["head","last"],function(n,e){var t="take"+(e?"Right":"");m.prototype[n]=function(){return this[t](1).value()[0]}}),on(["initial","tail"],function(n,e){var t="drop"+(e?"":"Right");m.prototype[n]=function(){return this.__filtered__?new m(this):this[t](1)}}),m.prototype.compact=function(){return this.filter(K)},m.prototype.find=function(n){return this.filter(n).head()},m.prototype.findLast=function(n){return this.reverse().find(n)},m.prototype.invokeMap=w(function(n,e){return typeof n=="function"?new m(this):this.map(function(t){return Ae(t,n,e)})}),m.prototype.reject=function(n){return this.filter($e(R(n)))},m.prototype.slice=function(n,e){n=x(n);var t=this;return t.__filtered__&&(n>0||e<0)?new m(t):(n<0?t=t.takeRight(-n):n&&(t=t.drop(n)),e!==void 0&&(e=x(e),t=e<0?t.dropRight(-e):t.take(e-n)),t)},m.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},m.prototype.toArray=function(){return this.take(Kf)},$n(m.prototype,function(n,e){var t=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=f[r?"take"+(e=="last"?"Right":""):e],u=r||/^find/.test(e);i&&(f.prototype[e]=function(){var a=this.__wrapped__,o=r?[1]:arguments,s=a instanceof m,l=o[0],c=s||y(a),d=function(T){var E=i.apply(f,Mn([T],o));return r&&h?E[0]:E};c&&t&&typeof l=="function"&&l.length!=1&&(s=c=!1);var h=this.__chain__,g=!!this.__actions__.length,v=u&&!h,b=s&&!g;if(!u&&c){a=b?a:new m(this);var A=n.apply(a,o);return A.__actions__.push({func:ye,args:[d],thisArg:void 0}),new an(A,h)}return v&&b?n.apply(this,o):(A=this.thru(d),v?r?A.value()[0]:A.value():A)})}),on(["pop","push","shift","sort","splice","unshift"],function(n){var e=T$[n],t=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);f.prototype[n]=function(){var i=arguments;if(r&&!this.__chain__){var u=this.value();return e.apply(y(u)?u:[],i)}return this[t](function(a){return e.apply(y(a)?a:[],i)})}}),$n(m.prototype,function(n,e){var t=f[e];if(t){var r=t.name+"";zf.call(Xn,r)||(Xn[r]=[]),Xn[r].push({name:e,func:t})}}),Xn[Pe(void 0,x$).name]=[{name:"wrapper",func:void 0}],m.prototype.clone=d$,m.prototype.reverse=h$,m.prototype.value=R$,f.prototype.at=yn.at,f.prototype.chain=yn.wrapperChain,f.prototype.commit=yn.commit,f.prototype.next=yn.next,f.prototype.plant=yn.plant,f.prototype.reverse=yn.reverse,f.prototype.toJSON=f.prototype.valueOf=f.prototype.value=yn.value,f.prototype.first=f.prototype.head,Xf&&(f.prototype[Xf]=yn.toIterator),Bf(n=>{let e="\u7CFB\u7EDF\u9519\u8BEF";if(!(n instanceof Error&&(e={"Failed to fetch":"\u8BF7\u6C42\u5931\u8D25","The user aborted a request.":"\u8BF7\u6C42\u88AB\u7EC8\u6B62"}[n.message]||n.message,n.name==="AbortError"&&n.message.includes("user")))){if(typeof n=="string"&&(e=n),Vf(n)){const t=n?.msg;t&&(e=t)}Qf({type:"error",message:e})}},500,{trailing:!1});const Jf=n=>{const e=n.headers;return e.set("application","platform"),e.set("tenant","default"),n},et=new kf({baseURL:na.baseURL,presetRequestInit:n=>{const e=n.headers,t=$r();return t&&e.set("Token",t),n}}),O$=async n=>et.request({method:"POST",url:"/file/chunk/verify",data:n,setRequestInit(e){return Jf(e),e}}).then(e=>{if(e.code!==200)throw e;return e.datas??e.data}).then(e=>({uploadedList:e.chunkList.map(t=>t.identifier+"-"+t.chunkNumber),uploaded:e.alreadyUploaded,mergedFile:e.mergedFile})),L$=async(n,e,t)=>new Promise((r,i)=>{const u=new XMLHttpRequest;u.upload.onprogress=t?.onprogress||null,u.open("post",et.baseURL+"/file/chunk/upload"),u.setRequestHeader("Tenant","default"),u.setRequestHeader("Application","platform"),u.setRequestHeader("Token",$r());const a=new FormData;a.append("file",n.chunk),a.append("identifier",n.fileHash),a.append("filename",n.fileName),a.append("chunkNumber",n.index+1+""),a.append("chunkIdentifier",n.hash+""),a.append("totalChunk",n.chunksLength+""),a.append("chunkSize",n.sliceSize+""),a.append("currentChunkSize",n.chunk.size+""),a.append("totalSize",n.fileSize+""),e&&a.append("fileServiceType",e),u.onerror=o=>{i(o)},u.send(a),u.onreadystatechange=o=>{const s=o.target;if(u.readyState===4)if(u.status===200){if(t?.xhrs){const l=t.xhrs.findIndex(c=>c===u);t.xhrs.splice(l,1)}r({data:s.response})}else u.status===500&&i(s.response)},u.timeout=5*1e3,u.ontimeout=o=>{i(o)},t?.xhrs?.push(u)}),P$=async n=>et.request({method:"POST",url:"/file/chunk/merge",data:n,setRequestInit:Jf}).then(e=>{if(e.code!==200)throw new Error(e.message);return e.datas??e.data});export{P$ as merge,et as restFetch,L$ as upload,O$ as verify};
28
+ */var y$="4.17.21",x$=2,b$=1,w$=3,Kf=4294967295,T$=Array.prototype,m$=Object.prototype,zf=m$.hasOwnProperty,Xf=H?H.iterator:void 0,E$=Math.max,Zf=Math.min,vr=function(n){return function(e,t,r){if(r==null){var i=F(t),u=i&&D(t),a=u&&u.length&&Ke(t,u);(a?a.length:i)||(r=t,t=e,e=this)}return n(e,t,r)}}(df);f.after=B.after,f.ary=B.ary,f.assign=$.assign,f.assignIn=$.assignIn,f.assignInWith=$.assignInWith,f.assignWith=$.assignWith,f.at=$.at,f.before=B.before,f.bind=B.bind,f.bindAll=P.bindAll,f.bindKey=B.bindKey,f.castArray=_.castArray,f.chain=yn.chain,f.chunk=p.chunk,f.compact=p.compact,f.concat=p.concat,f.cond=P.cond,f.conforms=P.conforms,f.constant=P.constant,f.countBy=I.countBy,f.create=$.create,f.curry=B.curry,f.curryRight=B.curryRight,f.debounce=B.debounce,f.defaults=$.defaults,f.defaultsDeep=$.defaultsDeep,f.defer=B.defer,f.delay=B.delay,f.difference=p.difference,f.differenceBy=p.differenceBy,f.differenceWith=p.differenceWith,f.drop=p.drop,f.dropRight=p.dropRight,f.dropRightWhile=p.dropRightWhile,f.dropWhile=p.dropWhile,f.fill=p.fill,f.filter=I.filter,f.flatMap=I.flatMap,f.flatMapDeep=I.flatMapDeep,f.flatMapDepth=I.flatMapDepth,f.flatten=p.flatten,f.flattenDeep=p.flattenDeep,f.flattenDepth=p.flattenDepth,f.flip=B.flip,f.flow=P.flow,f.flowRight=P.flowRight,f.fromPairs=p.fromPairs,f.functions=$.functions,f.functionsIn=$.functionsIn,f.groupBy=I.groupBy,f.initial=p.initial,f.intersection=p.intersection,f.intersectionBy=p.intersectionBy,f.intersectionWith=p.intersectionWith,f.invert=$.invert,f.invertBy=$.invertBy,f.invokeMap=I.invokeMap,f.iteratee=P.iteratee,f.keyBy=I.keyBy,f.keys=D,f.keysIn=$.keysIn,f.map=I.map,f.mapKeys=$.mapKeys,f.mapValues=$.mapValues,f.matches=P.matches,f.matchesProperty=P.matchesProperty,f.memoize=B.memoize,f.merge=$.merge,f.mergeWith=$.mergeWith,f.method=P.method,f.methodOf=P.methodOf,f.mixin=vr,f.negate=$e,f.nthArg=P.nthArg,f.omit=$.omit,f.omitBy=$.omitBy,f.once=B.once,f.orderBy=I.orderBy,f.over=P.over,f.overArgs=B.overArgs,f.overEvery=P.overEvery,f.overSome=P.overSome,f.partial=B.partial,f.partialRight=B.partialRight,f.partition=I.partition,f.pick=$.pick,f.pickBy=$.pickBy,f.property=P.property,f.propertyOf=P.propertyOf,f.pull=p.pull,f.pullAll=p.pullAll,f.pullAllBy=p.pullAllBy,f.pullAllWith=p.pullAllWith,f.pullAt=p.pullAt,f.range=P.range,f.rangeRight=P.rangeRight,f.rearg=B.rearg,f.reject=I.reject,f.remove=p.remove,f.rest=B.rest,f.reverse=p.reverse,f.sampleSize=I.sampleSize,f.set=$.set,f.setWith=$.setWith,f.shuffle=I.shuffle,f.slice=p.slice,f.sortBy=I.sortBy,f.sortedUniq=p.sortedUniq,f.sortedUniqBy=p.sortedUniqBy,f.split=O.split,f.spread=B.spread,f.tail=p.tail,f.take=p.take,f.takeRight=p.takeRight,f.takeRightWhile=p.takeRightWhile,f.takeWhile=p.takeWhile,f.tap=yn.tap,f.throttle=B.throttle,f.thru=ye,f.toArray=_.toArray,f.toPairs=$.toPairs,f.toPairsIn=$.toPairsIn,f.toPath=P.toPath,f.toPlainObject=_.toPlainObject,f.transform=$.transform,f.unary=B.unary,f.union=p.union,f.unionBy=p.unionBy,f.unionWith=p.unionWith,f.uniq=p.uniq,f.uniqBy=p.uniqBy,f.uniqWith=p.uniqWith,f.unset=$.unset,f.unzip=p.unzip,f.unzipWith=p.unzipWith,f.update=$.update,f.updateWith=$.updateWith,f.values=$.values,f.valuesIn=$.valuesIn,f.without=p.without,f.words=O.words,f.wrap=B.wrap,f.xor=p.xor,f.xorBy=p.xorBy,f.xorWith=p.xorWith,f.zip=p.zip,f.zipObject=p.zipObject,f.zipObjectDeep=p.zipObjectDeep,f.zipWith=p.zipWith,f.entries=$.toPairs,f.entriesIn=$.toPairsIn,f.extend=$.assignIn,f.extendWith=$.assignInWith,vr(f,f),f.add=X.add,f.attempt=P.attempt,f.camelCase=O.camelCase,f.capitalize=O.capitalize,f.ceil=X.ceil,f.clamp=_r.clamp,f.clone=_.clone,f.cloneDeep=_.cloneDeep,f.cloneDeepWith=_.cloneDeepWith,f.cloneWith=_.cloneWith,f.conformsTo=_.conformsTo,f.deburr=O.deburr,f.defaultTo=P.defaultTo,f.divide=X.divide,f.endsWith=O.endsWith,f.eq=_.eq,f.escape=O.escape,f.escapeRegExp=O.escapeRegExp,f.every=I.every,f.find=I.find,f.findIndex=p.findIndex,f.findKey=$.findKey,f.findLast=I.findLast,f.findLastIndex=p.findLastIndex,f.findLastKey=$.findLastKey,f.floor=X.floor,f.forEach=I.forEach,f.forEachRight=I.forEachRight,f.forIn=$.forIn,f.forInRight=$.forInRight,f.forOwn=$.forOwn,f.forOwnRight=$.forOwnRight,f.get=$.get,f.gt=_.gt,f.gte=_.gte,f.has=$.has,f.hasIn=$.hasIn,f.head=p.head,f.identity=K,f.includes=I.includes,f.indexOf=p.indexOf,f.inRange=_r.inRange,f.invoke=$.invoke,f.isArguments=_.isArguments,f.isArray=y,f.isArrayBuffer=_.isArrayBuffer,f.isArrayLike=_.isArrayLike,f.isArrayLikeObject=_.isArrayLikeObject,f.isBoolean=_.isBoolean,f.isBuffer=_.isBuffer,f.isDate=_.isDate,f.isElement=_.isElement,f.isEmpty=_.isEmpty,f.isEqual=_.isEqual,f.isEqualWith=_.isEqualWith,f.isError=_.isError,f.isFinite=_.isFinite,f.isFunction=_.isFunction,f.isInteger=_.isInteger,f.isLength=_.isLength,f.isMap=_.isMap,f.isMatch=_.isMatch,f.isMatchWith=_.isMatchWith,f.isNaN=_.isNaN,f.isNative=_.isNative,f.isNil=_.isNil,f.isNull=_.isNull,f.isNumber=_.isNumber,f.isObject=F,f.isObjectLike=_.isObjectLike,f.isPlainObject=_.isPlainObject,f.isRegExp=_.isRegExp,f.isSafeInteger=_.isSafeInteger,f.isSet=_.isSet,f.isString=_.isString,f.isSymbol=_.isSymbol,f.isTypedArray=_.isTypedArray,f.isUndefined=_.isUndefined,f.isWeakMap=_.isWeakMap,f.isWeakSet=_.isWeakSet,f.join=p.join,f.kebabCase=O.kebabCase,f.last=un,f.lastIndexOf=p.lastIndexOf,f.lowerCase=O.lowerCase,f.lowerFirst=O.lowerFirst,f.lt=_.lt,f.lte=_.lte,f.max=X.max,f.maxBy=X.maxBy,f.mean=X.mean,f.meanBy=X.meanBy,f.min=X.min,f.minBy=X.minBy,f.stubArray=P.stubArray,f.stubFalse=P.stubFalse,f.stubObject=P.stubObject,f.stubString=P.stubString,f.stubTrue=P.stubTrue,f.multiply=X.multiply,f.nth=p.nth,f.noop=P.noop,f.now=c$.now,f.pad=O.pad,f.padEnd=O.padEnd,f.padStart=O.padStart,f.parseInt=O.parseInt,f.random=_r.random,f.reduce=I.reduce,f.reduceRight=I.reduceRight,f.repeat=O.repeat,f.replace=O.replace,f.result=$.result,f.round=X.round,f.sample=I.sample,f.size=I.size,f.snakeCase=O.snakeCase,f.some=I.some,f.sortedIndex=p.sortedIndex,f.sortedIndexBy=p.sortedIndexBy,f.sortedIndexOf=p.sortedIndexOf,f.sortedLastIndex=p.sortedLastIndex,f.sortedLastIndexBy=p.sortedLastIndexBy,f.sortedLastIndexOf=p.sortedLastIndexOf,f.startCase=O.startCase,f.startsWith=O.startsWith,f.subtract=X.subtract,f.sum=X.sum,f.sumBy=X.sumBy,f.template=O.template,f.times=P.times,f.toFinite=_.toFinite,f.toInteger=x,f.toLength=_.toLength,f.toLower=O.toLower,f.toNumber=_.toNumber,f.toSafeInteger=_.toSafeInteger,f.toString=_.toString,f.toUpper=O.toUpper,f.trim=O.trim,f.trimEnd=O.trimEnd,f.trimStart=O.trimStart,f.truncate=O.truncate,f.unescape=O.unescape,f.uniqueId=P.uniqueId,f.upperCase=O.upperCase,f.upperFirst=O.upperFirst,f.each=I.forEach,f.eachRight=I.forEachRight,f.first=p.head,vr(f,function(){var n={};return $n(f,function(e,t){zf.call(f.prototype,t)||(n[t]=e)}),n}(),{chain:!1}),f.VERSION=y$,(f.templateSettings=O.templateSettings).imports._=f,on(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){f[n].placeholder=f}),on(["drop","take"],function(n,e){m.prototype[n]=function(t){t=t===void 0?1:E$(x(t),0);var r=this.__filtered__&&!e?new m(this):this.clone();return r.__filtered__?r.__takeCount__=Zf(t,r.__takeCount__):r.__views__.push({size:Zf(t,Kf),type:n+(r.__dir__<0?"Right":"")}),r},m.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),on(["filter","map","takeWhile"],function(n,e){var t=e+1,r=t==b$||t==w$;m.prototype[n]=function(i){var u=this.clone();return u.__iteratees__.push({iteratee:R(i),type:t}),u.__filtered__=u.__filtered__||r,u}}),on(["head","last"],function(n,e){var t="take"+(e?"Right":"");m.prototype[n]=function(){return this[t](1).value()[0]}}),on(["initial","tail"],function(n,e){var t="drop"+(e?"":"Right");m.prototype[n]=function(){return this.__filtered__?new m(this):this[t](1)}}),m.prototype.compact=function(){return this.filter(K)},m.prototype.find=function(n){return this.filter(n).head()},m.prototype.findLast=function(n){return this.reverse().find(n)},m.prototype.invokeMap=w(function(n,e){return typeof n=="function"?new m(this):this.map(function(t){return Ae(t,n,e)})}),m.prototype.reject=function(n){return this.filter($e(R(n)))},m.prototype.slice=function(n,e){n=x(n);var t=this;return t.__filtered__&&(n>0||e<0)?new m(t):(n<0?t=t.takeRight(-n):n&&(t=t.drop(n)),e!==void 0&&(e=x(e),t=e<0?t.dropRight(-e):t.take(e-n)),t)},m.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},m.prototype.toArray=function(){return this.take(Kf)},$n(m.prototype,function(n,e){var t=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=f[r?"take"+(e=="last"?"Right":""):e],u=r||/^find/.test(e);i&&(f.prototype[e]=function(){var a=this.__wrapped__,o=r?[1]:arguments,s=a instanceof m,l=o[0],c=s||y(a),d=function(T){var E=i.apply(f,Mn([T],o));return r&&h?E[0]:E};c&&t&&typeof l=="function"&&l.length!=1&&(s=c=!1);var h=this.__chain__,g=!!this.__actions__.length,v=u&&!h,b=s&&!g;if(!u&&c){a=b?a:new m(this);var A=n.apply(a,o);return A.__actions__.push({func:ye,args:[d],thisArg:void 0}),new an(A,h)}return v&&b?n.apply(this,o):(A=this.thru(d),v?r?A.value()[0]:A.value():A)})}),on(["pop","push","shift","sort","splice","unshift"],function(n){var e=T$[n],t=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);f.prototype[n]=function(){var i=arguments;if(r&&!this.__chain__){var u=this.value();return e.apply(y(u)?u:[],i)}return this[t](function(a){return e.apply(y(a)?a:[],i)})}}),$n(m.prototype,function(n,e){var t=f[e];if(t){var r=t.name+"";zf.call(Xn,r)||(Xn[r]=[]),Xn[r].push({name:e,func:t})}}),Xn[Pe(void 0,x$).name]=[{name:"wrapper",func:void 0}],m.prototype.clone=d$,m.prototype.reverse=h$,m.prototype.value=R$,f.prototype.at=yn.at,f.prototype.chain=yn.wrapperChain,f.prototype.commit=yn.commit,f.prototype.next=yn.next,f.prototype.plant=yn.plant,f.prototype.reverse=yn.reverse,f.prototype.toJSON=f.prototype.valueOf=f.prototype.value=yn.value,f.prototype.first=f.prototype.head,Xf&&(f.prototype[Xf]=yn.toIterator),Bf(n=>{let e="\u7CFB\u7EDF\u9519\u8BEF";if(!(n instanceof Error&&(e={"Failed to fetch":"\u8BF7\u6C42\u5931\u8D25","The user aborted a request.":"\u8BF7\u6C42\u88AB\u7EC8\u6B62"}[n.message]||n.message,n.name==="AbortError"&&n.message.includes("user")))){if(typeof n=="string"&&(e=n),Vf(n)){const t=n?.msg;t&&(e=t)}Qf({type:"error",message:e})}},500,{trailing:!1});const Jf=n=>{const e=n.headers;return e.set("application","platform"),e.set("tenant","default"),n},et=new kf({baseURL:na.baseURL,presetRequestInit:n=>{const e=n.headers,t=$r();return t&&e.set("Token",t),n}}),O$=async n=>et.request({method:"POST",url:"/file/chunk/verify",data:n,setRequestInit(e){return Jf(e),e}}).then(e=>{if(e.code!==200)throw e;return e.datas??e.data}).then(e=>({uploadedList:e.chunkList.map(t=>t.identifier+"-"+(t.chunkNumber-1)),uploaded:e.alreadyUploaded,mergedFile:e.mergedFile})),L$=async(n,e,t)=>new Promise((r,i)=>{const u=new XMLHttpRequest;u.upload.onprogress=t?.onprogress||null,u.open("post",et.baseURL+"/file/chunk/upload"),u.setRequestHeader("Tenant","default"),u.setRequestHeader("Application","platform"),u.setRequestHeader("Token",$r());const a=new FormData;a.append("file",n.chunk),a.append("identifier",n.fileHash),a.append("filename",n.fileName),a.append("chunkNumber",n.index+1+""),a.append("chunkIdentifier",n.hash+""),a.append("totalChunk",n.chunksLength+""),a.append("chunkSize",n.sliceSize+""),a.append("currentChunkSize",n.chunk.size+""),a.append("totalSize",n.fileSize+""),e&&a.append("fileServiceType",e),u.onerror=o=>{i(o)},u.send(a),u.onreadystatechange=o=>{const s=o.target;if(u.readyState===4)if(u.status===200){if(t?.xhrs){const l=t.xhrs.findIndex(c=>c===u);t.xhrs.splice(l,1)}r({data:s.response})}else u.status===500&&i(s.response)},u.timeout=5*1e3,u.ontimeout=o=>{i(o)},t?.xhrs?.push(u)}),P$=async n=>et.request({method:"POST",url:"/file/chunk/merge",data:n,setRequestInit:Jf}).then(e=>{if(e.code!==200)throw new Error(e.message);return e.datas??e.data});export{P$ as merge,et as restFetch,L$ as upload,O$ as verify};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vunk/form",
3
- "version": "1.1.74",
3
+ "version": "1.1.75",
4
4
  "description": "",
5
5
  "main": "index.esm.js",
6
6
  "scripts": {