@nocobase/plugin-async-task-manager 1.8.0-beta.9 → 1.8.1
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.
package/dist/client/index.js
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("dayjs"),require("@nocobase/client"),require("antd")):"function"==typeof define&&define.amd?define("@nocobase/plugin-async-task-manager",["react","dayjs","@nocobase/client","antd"],t):"object"==typeof exports?exports["@nocobase/plugin-async-task-manager"]=t(require("react"),require("dayjs"),require("@nocobase/client"),require("antd")):e["@nocobase/plugin-async-task-manager"]=t(e.react,e.dayjs,e["@nocobase/client"],e.antd)}(self,function(e,t,n,r){var o={379:function(e,t,n){e.exports=function(e){"use strict";var t={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(e,t){return"W"===t?e+"周":e+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(e,t){var n=100*e+t;return n<600?"凌晨":n<900?"早上":n<1100?"上午":n<1300?"中午":n<1800?"下午":"晚上"}};return(e&&"object"==typeof e&&"default"in e?e:{default:e}).default.locale(t,null,!0),t}(n(760))},809:function(e){e.exports=function(e,t,n){e=e||{};var r=t.prototype,o={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function a(e,t,n,o){return r.fromToBase(e,t,n,o)}n.en.relativeTime=o,r.fromToBase=function(t,r,a,i,l){for(var s,c,u,f=a.$locale().relativeTime||o,p=e.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],d=p.length,y=0;y<d;y+=1){var m=p[y];m.d&&(s=i?n(t).diff(a,m.d,!0):a.diff(t,m.d,!0));var v=(e.rounding||Math.round)(Math.abs(s));if(u=s>0,v<=m.r||!m.r){v<=1&&y>0&&(m=p[y-1]);var h=f[m.l];l&&(v=l(""+v)),c="string"==typeof h?h.replace("%d",v):h(v,r,m.l,u);break}}if(r)return c;var b=u?f.future:f.past;return"function"==typeof b?b(c):b.replace("%s",c)},r.to=function(e,t){return a(e,t,this,!0)},r.from=function(e,t){return a(e,t,this)};var i=function(e){return e.$u?n.utc():n()};r.toNow=function(e){return this.to(i(this),e)},r.fromNow=function(e){return this.from(i(this),e)}}},772:function(e){"use strict";e.exports=n},721:function(e){"use strict";e.exports=r},760:function(e){"use strict";e.exports=t},156:function(t){"use strict";t.exports=e}},a={};function i(e){var t=a[e];if(void 0!==t)return t.exports;var n=a[e]={exports:{}};return o[e].call(n.exports,n,n.exports,i),n.exports}i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};return!function(){"use strict";i.r(l),i.d(l,{PluginAsyncExportClient:function(){return C},default:function(){return M}});var e=i(772),t=i(156),n=i.n(t),r=i(721),o=i(760),a=i.n(o);i(379);var s=i(809),c=i.n(s),u=JSON.parse('{"u2":"@nocobase/plugin-async-task-manager"}');function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function p(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function d(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){p(a,r,o,i,l,"next",e)}function l(e){p(a,r,o,i,l,"throw",e)}i(void 0)})}}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){var s=[a,l];if(n)throw TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}}var v=(0,e.createStyles)(function(e){return{button:{color:e.token.colorTextHeaderMenu+" !important"}}});a().extend(c());var h=function(e,t){if("success"!==e.type||!(null==(a=e.payload)||null==(o=a.message)?void 0:o.messageId))return null;var o,a,i=e.payload.message,l=i.messageId,s=i.messageValues;return n().createElement("div",{style:{marginLeft:8}},n().createElement(r.Tag,{color:"success"},t(l,s)))},b=function(){var t=(0,e.useRequest)({url:"asyncTasks:list"}),n=t.data,r=t.refreshAsync;return{loading:t.loading,tasks:(null==n?void 0:n.data)||[],refresh:r}},g=function(t){var o,i=t.popoverVisible,l=t.setPopoverVisible,s=t.tasks,c=t.refresh,f=t.loading,p=t.hasProcessingTasks,y=(0,e.useApp)(),b=(0,e.useAPIClient)(),g=(0,e.useCurrentAppInfo)(),k=(o=(0,e.useApp)(),function(e){return o.i18n.t(e,{ns:[u.u2,"client"]})}),w=v().styles,E=(0,e.usePlugin)("async-task-manager"),x=(0,e.useCollectionManager)(),_=(0,e.useCompile)(),O=function(e){l(!1)},T=[{title:k("Created at"),dataIndex:"createdAt",key:"createdAt",width:180,render:function(e){return n().createElement(r.Tooltip,{title:a()(e).format("YYYY-MM-DD HH:mm:ss")},a()(e).fromNow())}},{title:k("Task"),dataIndex:"title",key:"title",render:function(e,t){var n=t.title;if(!n)return"-";var r=x.getCollection(n.collection),o={export:k("Export"),import:k("Import"),"export-attachments":k("Export attachments")}[n.actionType]||n.actionType;return(({"export-attachments":k("Export {collection} attachments"),export:k("Export {collection} data"),import:k("Import {collection} data")})[n.actionType]||"".concat(o)).replace("{collection}",_((null==r?void 0:r.title)||n.collection))}},{title:k("Status"),dataIndex:"status",key:"status",width:160,render:function(t,o){var a,i={pending:{color:"default",text:k("Waiting"),icon:"ClockCircleOutlined"},running:{color:"processing",text:k("Processing"),icon:"LoadingOutlined"},success:{color:"success",text:k("Completed"),icon:"CheckCircleOutlined"},failed:{color:"error",text:k("Failed"),icon:"CloseCircleOutlined"},cancelled:{color:"warning",text:k("Cancelled"),icon:"StopOutlined"}},l=i[t.type]||{},s=l.color,c=l.text;return n().createElement("div",{style:{display:"flex",alignItems:"center",gap:8}},n().createElement("div",{style:{flex:1}},function(){var e,a,i={width:100,margin:0};switch(t.indicator){case"spinner":return n().createElement(r.Alert,{showIcon:!1,message:c,banner:!0});case"progress":return n().createElement(r.Progress,{type:"line",size:"small",strokeWidth:4,percent:Number(((null==(e=o.progress)?void 0:e.current)/(null==(a=o.progress)?void 0:a.total)*100).toFixed(2)),status:"active",style:i,format:function(e){return"".concat(e.toFixed(1),"%")}});case"success":return n().createElement(r.Progress,{type:"line",size:"small",strokeWidth:4,percent:100,status:"success",style:i,format:function(){return""}});case"error":return n().createElement(r.Progress,{type:"line",size:"small",strokeWidth:4,percent:100,status:"exception",style:i,format:function(){return""}});default:return null}}()),n().createElement(r.Tag,{color:s,icon:(null==(a=i[t.type])?void 0:a.icon)?n().createElement(e.Icon,{type:i[t.type].icon}):null,style:{margin:0,padding:"0 4px",height:22,width:22}}),h(t,k))}},{title:k("Actions"),key:"actions",width:180,render:function(t,o){var a=[];return("running"===o.status.type||"pending"===o.status.type)&&o.cancelable&&a.push(n().createElement(r.Popconfirm,{key:"cancel",title:k("Confirm cancel"),description:k("Confirm cancel description"),onConfirm:d(function(){return m(this,function(e){switch(e.label){case 0:return[4,b.request({url:"asyncTasks:cancel",params:{filterByTk:o.taskId}})];case 1:return e.sent(),c(),[2]}})}),okText:k("Confirm"),cancelText:k("Cancel"),disabled:!1},n().createElement(r.Button,{type:"link",size:"small",icon:n().createElement(e.Icon,{type:"StopOutlined"}),disabled:!1},k("Cancel")))),"success"===o.status.type&&("file"===o.status.resultType?a.push(n().createElement(r.Button,{key:"download",type:"link",size:"small",icon:n().createElement(e.Icon,{type:"DownloadOutlined"}),onClick:function(){var e,t,n,r=y.apiClient.auth.token,a=x.getCollection(o.title.collection),i=_(null==a?void 0:a.title),l=(null==o||null==(e=o.title)?void 0:e.actionType)==="export-attachments"?"-attachments.zip":".xlsx",s="".concat(i).concat(l),c=(null==o||null==(t=o.title)?void 0:t.actionType)!=="create migration"?encodeURIComponent(s):null,u=y.getApiUrl("asyncTasks:fetchFile/".concat(o.taskId,"?token=").concat(r,"&__appName=").concat(encodeURIComponent((null==g||null==(n=g.data)?void 0:n.name)||y.name)).concat(c?"&filename=".concat(c):""));window.open(u)}},k("Download"))):o.status.payload&&a.push(n().createElement(r.Button,{key:"view",type:"link",size:"small",icon:n().createElement(e.Icon,{type:"EyeOutlined"}),onClick:function(){O(o);var e=o.status.payload,t=E.taskResultRendererManager.get(o.title.actionType);r.Modal.info({title:k("Task result"),content:t?n().createElement(t,{payload:e,task:o}):n().createElement("div",null,k("No renderer available for this task type, payload: ".concat(e)))})}},k("View result")))),"failed"===o.status.type&&a.push(n().createElement(r.Button,{key:"error",type:"link",size:"small",icon:n().createElement(e.Icon,{type:"ExclamationCircleOutlined"}),onClick:function(){var e;l(!1),r.Modal.info({title:k("Error Details"),content:null==(e=o.status.errors)?void 0:e.map(function(e,t){return n().createElement("div",{key:t,style:{marginBottom:16}},n().createElement("div",{style:{color:"#ff4d4f",marginBottom:8}},e.message),e.code&&n().createElement("div",{style:{color:"#999",fontSize:12}},k("Error code"),": ",e.code))}),closable:!0,width:400})}},k("Error details"))),n().createElement(r.Space,{size:"middle"},a)}}],S=n().createElement("div",{style:{maxHeight:"70vh",overflow:"auto",width:s.length>0?800:200}},s.length>0?n().createElement(r.Table,{loading:f,columns:T,dataSource:s,size:"small",pagination:!1,rowKey:"taskId"}):n().createElement("div",{style:{padding:"24px 0",display:"flex",justifyContent:"center"}},n().createElement(r.Empty,{description:k("No tasks"),image:r.Empty.PRESENTED_IMAGE_SIMPLE})));return n().createElement(n().Fragment,null,n().createElement(r.Popover,{content:S,trigger:"hover",placement:"bottom",open:i,onOpenChange:l},n().createElement(r.Button,{className:["sync-task-button",w.button].join(" "),icon:n().createElement(e.Icon,{type:"SyncOutlined",spin:p}),onClick:function(){return l(!i)}})))},k=function(){var r=b(),o=r.tasks,a=r.refresh,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(r,["tasks","refresh"]),l=(0,e.useApp)(),s=y((0,t.useState)(!1),2),c=s[0],u=s[1],f=y((0,t.useState)(!1),2),p=f[0],v=f[1];(0,t.useEffect)(function(){v(o.some(function(e){return"success"!==e.status.type&&"failed"!==e.status.type}))},[o]);var h=(0,t.useCallback)(d(function(){return m(this,function(e){return u(!0),[2]})}),[]),k=(0,t.useCallback)(function(){a(),console.log("handleTaskProgress")},[]),w=(0,t.useCallback)(function(){a(),console.log("handleTaskStatus")},[]),E=(0,t.useCallback)(function(){a(),console.log("handleTaskCancelled")},[]);return(0,t.useEffect)(function(){return l.eventBus.addEventListener("ws:message:async-tasks:created",h),l.eventBus.addEventListener("ws:message:async-tasks:progress",k),l.eventBus.addEventListener("ws:message:async-tasks:status",w),l.eventBus.addEventListener("ws:message:async-tasks:cancelled",E),function(){l.eventBus.removeEventListener("ws:message:async-tasks:created",h),l.eventBus.removeEventListener("ws:message:async-tasks:progress",k),l.eventBus.removeEventListener("ws:message:async-tasks:status",w),l.eventBus.removeEventListener("ws:message:async-tasks:cancelled",E)}},[l,E,h,k,w]),(null==o?void 0:o.length)>0&&n().createElement(g,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({tasks:o,refresh:a,popoverVisible:c,setPopoverVisible:u,hasProcessingTasks:p},i))},w=function(t){return n().createElement(e.PinnedPluginListProvider,{items:{asyncTasks:{order:300,component:"AsyncTasks",pin:!0,snippet:"*"}}},n().createElement(e.SchemaComponentOptions,{components:{AsyncTasks:k}},t.children))},E=function(){var e;function t(){var e,n;if(!(this instanceof t))throw TypeError("Cannot call a class as a function");e="renderers",n=new Map,e in this?Object.defineProperty(this,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):this[e]=n}return e=[{key:"register",value:function(e,t){this.renderers.set(e,t)}},{key:"get",value:function(e){return this.renderers.get(e)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(t.prototype,e),t}();function x(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function _(e,t,n){return(_=P()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&T(o,n.prototype),o}).apply(null,arguments)}function O(e){return(O=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function T(e,t){return(T=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function S(e){var t="function"==typeof Map?new Map:void 0;return(S=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return _(e,arguments,O(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),T(n,e)})(e)}function P(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(P=function(){return!!e})()}var C=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t,r,o,a,i;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,r=arguments,t=O(t),o=e=function(e,t){var n;if(t&&("object"==((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,P()?Reflect.construct(t,r||[],O(this).constructor):t.apply(this,r)),a="taskResultRendererManager",i=new E,a in o?Object.defineProperty(o,a,{value:i,enumerable:!0,configurable:!0,writable:!0}):o[a]=i,e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&T(n,e),t=[{key:"load",value:function(){var e,t=this;return(e=function(){return function(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){var s=[a,l];if(n)throw TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}}(this,function(e){return t.app.use(w),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){x(a,r,o,i,l,"next",e)}function l(e){x(a,r,o,i,l,"throw",e)}i(void 0)})})()}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(S(e.Plugin)),M=C}(),l});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("dayjs"),require("@nocobase/client"),require("antd")):"function"==typeof define&&define.amd?define("@nocobase/plugin-async-task-manager",["react","dayjs","@nocobase/client","antd"],t):"object"==typeof exports?exports["@nocobase/plugin-async-task-manager"]=t(require("react"),require("dayjs"),require("@nocobase/client"),require("antd")):e["@nocobase/plugin-async-task-manager"]=t(e.react,e.dayjs,e["@nocobase/client"],e.antd)}(self,function(e,t,n,r){var o={379:function(e,t,n){e.exports=function(e){"use strict";var t={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(e,t){return"W"===t?e+"周":e+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(e,t){var n=100*e+t;return n<600?"凌晨":n<900?"早上":n<1100?"上午":n<1300?"中午":n<1800?"下午":"晚上"}};return(e&&"object"==typeof e&&"default"in e?e:{default:e}).default.locale(t,null,!0),t}(n(760))},809:function(e){e.exports=function(e,t,n){e=e||{};var r=t.prototype,o={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function a(e,t,n,o){return r.fromToBase(e,t,n,o)}n.en.relativeTime=o,r.fromToBase=function(t,r,a,i,l){for(var s,c,u,f=a.$locale().relativeTime||o,p=e.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],d=p.length,y=0;y<d;y+=1){var m=p[y];m.d&&(s=i?n(t).diff(a,m.d,!0):a.diff(t,m.d,!0));var v=(e.rounding||Math.round)(Math.abs(s));if(u=s>0,v<=m.r||!m.r){v<=1&&y>0&&(m=p[y-1]);var h=f[m.l];l&&(v=l(""+v)),c="string"==typeof h?h.replace("%d",v):h(v,r,m.l,u);break}}if(r)return c;var b=u?f.future:f.past;return"function"==typeof b?b(c):b.replace("%s",c)},r.to=function(e,t){return a(e,t,this,!0)},r.from=function(e,t){return a(e,t,this)};var i=function(e){return e.$u?n.utc():n()};r.toNow=function(e){return this.to(i(this),e)},r.fromNow=function(e){return this.from(i(this),e)}}},772:function(e){"use strict";e.exports=n},721:function(e){"use strict";e.exports=r},760:function(e){"use strict";e.exports=t},156:function(t){"use strict";t.exports=e}},a={};function i(e){var t=a[e];if(void 0!==t)return t.exports;var n=a[e]={exports:{}};return o[e].call(n.exports,n,n.exports,i),n.exports}i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};return!function(){"use strict";i.r(l),i.d(l,{PluginAsyncExportClient:function(){return P},default:function(){return M}});var e=i(772),t=i(156),n=i.n(t),r=i(721),o=i(760),a=i.n(o);i(379);var s=i(809),c=i.n(s),u=JSON.parse('{"u2":"@nocobase/plugin-async-task-manager"}');function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function p(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function d(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){p(a,r,o,i,l,"next",e)}function l(e){p(a,r,o,i,l,"throw",e)}i(void 0)})}}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){var s=[a,l];if(n)throw TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}}var v=(0,e.createStyles)(function(e){return{button:{color:e.token.colorTextHeaderMenu+" !important"}}});a().extend(c());var h=function(e,t){if("success"!==e.type||!(null==(a=e.payload)||null==(o=a.message)?void 0:o.messageId))return null;var o,a,i=e.payload.message,l=i.messageId,s=i.messageValues;return n().createElement("div",{style:{marginLeft:8}},n().createElement(r.Tag,{color:"success"},t(l,s)))},b=function(){var t=(0,e.useRequest)({url:"asyncTasks:list"}),n=t.data,r=t.refreshAsync;return{loading:t.loading,tasks:(null==n?void 0:n.data)||[],refresh:r}},g=function(t){var o,i=t.popoverVisible,l=t.setPopoverVisible,s=t.tasks,c=t.refresh,f=t.loading,p=t.hasProcessingTasks,y=(0,e.useApp)(),b=(0,e.useAPIClient)(),g=(0,e.useCurrentAppInfo)(),k=(o=(0,e.useApp)(),function(e){return o.i18n.t(e,{ns:[u.u2,"client"]})}),w=v().styles,E=(0,e.usePlugin)("async-task-manager"),x=(0,e.useCollectionManager)(),_=(0,e.useCompile)(),O=function(e){l(!1)},T=[{title:k("Created at"),dataIndex:"createdAt",key:"createdAt",width:180,render:function(e){return n().createElement(r.Tooltip,{title:a()(e).format("YYYY-MM-DD HH:mm:ss")},a()(e).fromNow())}},{title:k("Task"),dataIndex:"title",key:"title",render:function(e,t){var n=t.title;if(!n)return"-";var r=x.getCollection(n.collection),o={export:k("Export"),import:k("Import"),"export-attachments":k("Export attachments")}[n.actionType]||n.actionType;return(({"export-attachments":k("Export {collection} attachments"),export:k("Export {collection} data"),import:k("Import {collection} data")})[n.actionType]||"".concat(o)).replace("{collection}",_((null==r?void 0:r.title)||n.collection))}},{title:k("Status"),dataIndex:"status",key:"status",width:160,render:function(t,o){var a,i={pending:{color:"default",text:k("Waiting"),icon:"ClockCircleOutlined"},running:{color:"processing",text:k("Processing"),icon:"LoadingOutlined"},success:{color:"success",text:k("Completed"),icon:"CheckCircleOutlined"},failed:{color:"error",text:k("Failed"),icon:"CloseCircleOutlined"},cancelled:{color:"warning",text:k("Cancelled"),icon:"StopOutlined"}},l=i[t.type]||{},s=l.color,c=l.text;return n().createElement("div",{style:{display:"flex",alignItems:"center",gap:8}},n().createElement("div",{style:{flex:1}},function(){var e,a,i={width:100,margin:0};switch(t.indicator){case"spinner":return n().createElement(r.Alert,{showIcon:!1,message:c,banner:!0});case"progress":return n().createElement(r.Progress,{type:"line",size:"small",strokeWidth:4,percent:Number(((null==(e=o.progress)?void 0:e.current)/(null==(a=o.progress)?void 0:a.total)*100).toFixed(2)),status:"active",style:i,format:function(e){return"".concat(e.toFixed(1),"%")}});case"success":return n().createElement(r.Progress,{type:"line",size:"small",strokeWidth:4,percent:100,status:"success",style:i,format:function(){return""}});case"error":return n().createElement(r.Progress,{type:"line",size:"small",strokeWidth:4,percent:100,status:"exception",style:i,format:function(){return""}});default:return null}}()),n().createElement(r.Tag,{color:s,icon:(null==(a=i[t.type])?void 0:a.icon)?n().createElement(e.Icon,{type:i[t.type].icon}):null,style:{margin:0,padding:"0 4px",height:22,width:22}}),h(t,k))}},{title:k("Actions"),key:"actions",width:180,render:function(t,o){var a=[];return("running"===o.status.type||"pending"===o.status.type)&&o.cancelable&&a.push(n().createElement(r.Popconfirm,{key:"cancel",title:k("Confirm cancel"),description:k("Confirm cancel description"),onConfirm:d(function(){return m(this,function(e){switch(e.label){case 0:return[4,b.request({url:"asyncTasks:cancel",params:{filterByTk:o.taskId}})];case 1:return e.sent(),c(),[2]}})}),okText:k("Confirm"),cancelText:k("Cancel"),disabled:!1},n().createElement(r.Button,{type:"link",size:"small",icon:n().createElement(e.Icon,{type:"StopOutlined"}),disabled:!1},k("Cancel")))),"success"===o.status.type&&("file"===o.status.resultType?a.push(n().createElement(r.Button,{key:"download",type:"link",size:"small",icon:n().createElement(e.Icon,{type:"DownloadOutlined"}),onClick:function(){var e,t,n,r=y.apiClient.auth.token,a=x.getCollection(o.title.collection),i=_(null==a?void 0:a.title),l=(null==o||null==(e=o.title)?void 0:e.actionType)==="export-attachments"?"-attachments.zip":".xlsx",s="".concat(i).concat(l),c=(null==o||null==(t=o.title)?void 0:t.actionType)!=="create migration"?encodeURIComponent(s):null,u=y.getApiUrl("asyncTasks:fetchFile/".concat(o.taskId,"?token=").concat(r,"&__appName=").concat(encodeURIComponent((null==g||null==(n=g.data)?void 0:n.name)||y.name)).concat(c?"&filename=".concat(c):""));window.open(u)}},k("Download"))):o.status.payload&&a.push(n().createElement(r.Button,{key:"view",type:"link",size:"small",icon:n().createElement(e.Icon,{type:"EyeOutlined"}),onClick:function(){O(o);var e=o.status.payload,t=E.taskResultRendererManager.get(o.title.actionType);r.Modal.info({title:k("Task result"),content:t?n().createElement(t,{payload:e,task:o}):n().createElement("div",null,k("No renderer available for this task type, payload: ".concat(e)))})}},k("View result")))),"failed"===o.status.type&&a.push(n().createElement(r.Button,{key:"error",type:"link",size:"small",icon:n().createElement(e.Icon,{type:"ExclamationCircleOutlined"}),onClick:function(){var e;l(!1),r.Modal.info({title:k("Error Details"),content:null==(e=o.status.errors)?void 0:e.map(function(e,t){return n().createElement("div",{key:t,style:{marginBottom:16}},n().createElement("div",{style:{color:"#ff4d4f",marginBottom:8}},e.message),e.code&&n().createElement("div",{style:{color:"#999",fontSize:12}},k("Error code"),": ",e.code))}),closable:!0,width:400})}},k("Error details"))),n().createElement(r.Space,{size:"middle"},a)}}],S=n().createElement("div",{style:{maxHeight:"70vh",overflow:"auto",width:s.length>0?800:200}},s.length>0?n().createElement(r.Table,{loading:f,columns:T,dataSource:s,size:"small",pagination:!1,rowKey:"taskId"}):n().createElement("div",{style:{padding:"24px 0",display:"flex",justifyContent:"center"}},n().createElement(r.Empty,{description:k("No tasks"),image:r.Empty.PRESENTED_IMAGE_SIMPLE})));return n().createElement(n().Fragment,null,n().createElement(r.Popover,{content:S,trigger:"hover",placement:"bottom",open:i,onOpenChange:l},n().createElement(r.Button,{className:["sync-task-button",w.button].join(" "),icon:n().createElement(e.Icon,{type:"SyncOutlined",spin:p}),onClick:function(){return l(!i)}})))},k=function(){var r=b(),o=r.tasks,a=r.refresh,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(r,["tasks","refresh"]),l=(0,e.useApp)(),s=y((0,t.useState)(!1),2),c=s[0],u=s[1],f=y((0,t.useState)(!1),2),p=f[0],v=f[1];(0,t.useEffect)(function(){v(o.some(function(e){return"success"!==e.status.type&&"failed"!==e.status.type}))},[o]);var h=(0,t.useCallback)(d(function(){return m(this,function(e){return u(!0),a(),console.log("handleTaskCreated"),[2]})}),[]),k=(0,t.useCallback)(function(){a(),console.log("handleTaskProgress")},[]),w=(0,t.useCallback)(function(){a(),console.log("handleTaskStatus")},[]),E=(0,t.useCallback)(function(){a(),console.log("handleTaskCancelled")},[]);return(0,t.useEffect)(function(){return l.eventBus.addEventListener("ws:message:async-tasks:created",h),l.eventBus.addEventListener("ws:message:async-tasks:progress",k),l.eventBus.addEventListener("ws:message:async-tasks:status",w),l.eventBus.addEventListener("ws:message:async-tasks:cancelled",E),function(){l.eventBus.removeEventListener("ws:message:async-tasks:created",h),l.eventBus.removeEventListener("ws:message:async-tasks:progress",k),l.eventBus.removeEventListener("ws:message:async-tasks:status",w),l.eventBus.removeEventListener("ws:message:async-tasks:cancelled",E)}},[l,E,h,k,w]),(null==o?void 0:o.length)>0&&n().createElement(g,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({tasks:o,refresh:a,popoverVisible:c,setPopoverVisible:u,hasProcessingTasks:p},i))},w=function(t){return n().createElement(e.PinnedPluginListProvider,{items:{asyncTasks:{order:300,component:"AsyncTasks",pin:!0,snippet:"*"}}},n().createElement(e.SchemaComponentOptions,{components:{AsyncTasks:k}},t.children))},E=function(){var e;function t(){var e,n;if(!(this instanceof t))throw TypeError("Cannot call a class as a function");e="renderers",n=new Map,e in this?Object.defineProperty(this,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):this[e]=n}return e=[{key:"register",value:function(e,t){this.renderers.set(e,t)}},{key:"get",value:function(e){return this.renderers.get(e)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(t.prototype,e),t}();function x(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function _(e,t,n){return(_=C()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&T(o,n.prototype),o}).apply(null,arguments)}function O(e){return(O=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function T(e,t){return(T=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function S(e){var t="function"==typeof Map?new Map:void 0;return(S=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return _(e,arguments,O(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),T(n,e)})(e)}function C(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(C=function(){return!!e})()}var P=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t,r,o,a,i;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,r=arguments,t=O(t),o=e=function(e,t){var n;if(t&&("object"==((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,C()?Reflect.construct(t,r||[],O(this).constructor):t.apply(this,r)),a="taskResultRendererManager",i=new E,a in o?Object.defineProperty(o,a,{value:i,enumerable:!0,configurable:!0,writable:!0}):o[a]=i,e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&T(n,e),t=[{key:"load",value:function(){var e,t=this;return(e=function(){return function(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){var s=[a,l];if(n)throw TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}}(this,function(e){return t.app.use(w),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){x(a,r,o,i,l,"next",e)}function l(e){x(a,r,o,i,l,"throw",e)}i(void 0)})})()}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(S(e.Plugin)),M=P}(),l});
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "1.8.
|
|
11
|
+
"@nocobase/client": "1.8.1",
|
|
12
12
|
"react": "18.2.0",
|
|
13
|
-
"@nocobase/logger": "1.8.
|
|
14
|
-
"@nocobase/server": "1.8.
|
|
13
|
+
"@nocobase/logger": "1.8.1",
|
|
14
|
+
"@nocobase/server": "1.8.1",
|
|
15
15
|
"lodash": "4.17.21",
|
|
16
|
-
"@nocobase/plugin-error-handler": "1.8.
|
|
16
|
+
"@nocobase/plugin-error-handler": "1.8.1",
|
|
17
17
|
"antd": "5.24.2",
|
|
18
18
|
"dayjs": "1.11.13"
|
|
19
19
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"p-queue","version":"6.6.2","description":"Promise queue with concurrency control","license":"MIT","repository":"sindresorhus/p-queue","funding":"https://github.com/sponsors/sindresorhus","main":"dist/index.js","engines":{"node":">=8"},"scripts":{"build":"del dist && tsc","test":"xo && npm run build && nyc ava","bench":"ts-node bench.ts","prepublishOnly":"npm run build"},"files":["dist"],"types":"dist/index.d.ts","keywords":["promise","queue","enqueue","limit","limited","concurrency","throttle","throat","rate","batch","ratelimit","priority","priorityqueue","fifo","job","task","async","await","promises","bluebird"],"dependencies":{"eventemitter3":"^4.0.4","p-timeout":"^3.2.0"},"devDependencies":{"@sindresorhus/tsconfig":"^0.7.0","@types/benchmark":"^1.0.33","@types/node":"^14.6.0","ava":"^2.0.0","benchmark":"^2.1.4","codecov":"^3.7.2","del-cli":"^3.0.1","delay":"^4.4.0","in-range":"^2.0.0","nyc":"^15.1.0","random-int":"^2.0.1","time-span":"^4.0.0","ts-node":"^9.0.0","typescript":"^4.0.2","xo":"^0.33.0"},"ava":{"babel":false,"compileEnhancements":false,"extensions":["ts"],"require":["ts-node/register"],"files":["test/**"]},"xo":{"rules":{"@typescript-eslint/member-ordering":"off","node/no-unsupported-features/es-syntax":"off","@typescript-eslint/no-floating-promises":"off","import/no-named-default":"off","@typescript-eslint/no-invalid-void-type":"off"}},"nyc":{"extension":[".ts"]},"_lastModified":"2025-
|
|
1
|
+
{"name":"p-queue","version":"6.6.2","description":"Promise queue with concurrency control","license":"MIT","repository":"sindresorhus/p-queue","funding":"https://github.com/sponsors/sindresorhus","main":"dist/index.js","engines":{"node":">=8"},"scripts":{"build":"del dist && tsc","test":"xo && npm run build && nyc ava","bench":"ts-node bench.ts","prepublishOnly":"npm run build"},"files":["dist"],"types":"dist/index.d.ts","keywords":["promise","queue","enqueue","limit","limited","concurrency","throttle","throat","rate","batch","ratelimit","priority","priorityqueue","fifo","job","task","async","await","promises","bluebird"],"dependencies":{"eventemitter3":"^4.0.4","p-timeout":"^3.2.0"},"devDependencies":{"@sindresorhus/tsconfig":"^0.7.0","@types/benchmark":"^1.0.33","@types/node":"^14.6.0","ava":"^2.0.0","benchmark":"^2.1.4","codecov":"^3.7.2","del-cli":"^3.0.1","delay":"^4.4.0","in-range":"^2.0.0","nyc":"^15.1.0","random-int":"^2.0.1","time-span":"^4.0.0","ts-node":"^9.0.0","typescript":"^4.0.2","xo":"^0.33.0"},"ava":{"babel":false,"compileEnhancements":false,"extensions":["ts"],"require":["ts-node/register"],"files":["test/**"]},"xo":{"rules":{"@typescript-eslint/member-ordering":"off","node/no-unsupported-features/es-syntax":"off","@typescript-eslint/no-floating-promises":"off","import/no-named-default":"off","@typescript-eslint/no-invalid-void-type":"off"}},"nyc":{"extension":[".ts"]},"_lastModified":"2025-07-09T08:38:11.434Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"uuid","version":"9.0.1","description":"RFC4122 (v1, v4, and v5) UUIDs","funding":["https://github.com/sponsors/broofa","https://github.com/sponsors/ctavan"],"commitlint":{"extends":["@commitlint/config-conventional"]},"keywords":["uuid","guid","rfc4122"],"license":"MIT","bin":{"uuid":"./dist/bin/uuid"},"sideEffects":false,"main":"./dist/index.js","exports":{".":{"node":{"module":"./dist/esm-node/index.js","require":"./dist/index.js","import":"./wrapper.mjs"},"browser":{"import":"./dist/esm-browser/index.js","require":"./dist/commonjs-browser/index.js"},"default":"./dist/esm-browser/index.js"},"./package.json":"./package.json"},"module":"./dist/esm-node/index.js","browser":{"./dist/md5.js":"./dist/md5-browser.js","./dist/native.js":"./dist/native-browser.js","./dist/rng.js":"./dist/rng-browser.js","./dist/sha1.js":"./dist/sha1-browser.js","./dist/esm-node/index.js":"./dist/esm-browser/index.js"},"files":["CHANGELOG.md","CONTRIBUTING.md","LICENSE.md","README.md","dist","wrapper.mjs"],"devDependencies":{"@babel/cli":"7.18.10","@babel/core":"7.18.10","@babel/eslint-parser":"7.18.9","@babel/preset-env":"7.18.10","@commitlint/cli":"17.0.3","@commitlint/config-conventional":"17.0.3","bundlewatch":"0.3.3","eslint":"8.21.0","eslint-config-prettier":"8.5.0","eslint-config-standard":"17.0.0","eslint-plugin-import":"2.26.0","eslint-plugin-node":"11.1.0","eslint-plugin-prettier":"4.2.1","eslint-plugin-promise":"6.0.0","husky":"8.0.1","jest":"28.1.3","lint-staged":"13.0.3","npm-run-all":"4.1.5","optional-dev-dependency":"2.0.1","prettier":"2.7.1","random-seed":"0.3.0","runmd":"1.3.9","standard-version":"9.5.0"},"optionalDevDependencies":{"@wdio/browserstack-service":"7.16.10","@wdio/cli":"7.16.10","@wdio/jasmine-framework":"7.16.6","@wdio/local-runner":"7.16.10","@wdio/spec-reporter":"7.16.9","@wdio/static-server-service":"7.16.6"},"scripts":{"examples:browser:webpack:build":"cd examples/browser-webpack && npm install && npm run build","examples:browser:rollup:build":"cd examples/browser-rollup && npm install && npm run build","examples:node:commonjs:test":"cd examples/node-commonjs && npm install && npm test","examples:node:esmodules:test":"cd examples/node-esmodules && npm install && npm test","examples:node:jest:test":"cd examples/node-jest && npm install && npm test","prepare":"cd $( git rev-parse --show-toplevel ) && husky install","lint":"npm run eslint:check && npm run prettier:check","eslint:check":"eslint src/ test/ examples/ *.js","eslint:fix":"eslint --fix src/ test/ examples/ *.js","pretest":"[ -n $CI ] || npm run build","test":"BABEL_ENV=commonjsNode node --throw-deprecation node_modules/.bin/jest test/unit/","pretest:browser":"optional-dev-dependency && npm run build && npm-run-all --parallel examples:browser:**","test:browser":"wdio run ./wdio.conf.js","pretest:node":"npm run build","test:node":"npm-run-all --parallel examples:node:**","test:pack":"./scripts/testpack.sh","pretest:benchmark":"npm run build","test:benchmark":"cd examples/benchmark && npm install && npm test","prettier:check":"prettier --check '**/*.{js,jsx,json,md}'","prettier:fix":"prettier --write '**/*.{js,jsx,json,md}'","bundlewatch":"npm run pretest:browser && bundlewatch --config bundlewatch.config.json","md":"runmd --watch --output=README.md README_js.md","docs":"( node --version | grep -q 'v18' ) && ( npm run build && npx runmd --output=README.md README_js.md )","docs:diff":"npm run docs && git diff --quiet README.md","build":"./scripts/build.sh","prepack":"npm run build","release":"standard-version --no-verify"},"repository":{"type":"git","url":"https://github.com/uuidjs/uuid.git"},"lint-staged":{"*.{js,jsx,json,md}":["prettier --write"],"*.{js,jsx}":["eslint --fix"]},"standard-version":{"scripts":{"postchangelog":"prettier --write CHANGELOG.md"}},"_lastModified":"2025-
|
|
1
|
+
{"name":"uuid","version":"9.0.1","description":"RFC4122 (v1, v4, and v5) UUIDs","funding":["https://github.com/sponsors/broofa","https://github.com/sponsors/ctavan"],"commitlint":{"extends":["@commitlint/config-conventional"]},"keywords":["uuid","guid","rfc4122"],"license":"MIT","bin":{"uuid":"./dist/bin/uuid"},"sideEffects":false,"main":"./dist/index.js","exports":{".":{"node":{"module":"./dist/esm-node/index.js","require":"./dist/index.js","import":"./wrapper.mjs"},"browser":{"import":"./dist/esm-browser/index.js","require":"./dist/commonjs-browser/index.js"},"default":"./dist/esm-browser/index.js"},"./package.json":"./package.json"},"module":"./dist/esm-node/index.js","browser":{"./dist/md5.js":"./dist/md5-browser.js","./dist/native.js":"./dist/native-browser.js","./dist/rng.js":"./dist/rng-browser.js","./dist/sha1.js":"./dist/sha1-browser.js","./dist/esm-node/index.js":"./dist/esm-browser/index.js"},"files":["CHANGELOG.md","CONTRIBUTING.md","LICENSE.md","README.md","dist","wrapper.mjs"],"devDependencies":{"@babel/cli":"7.18.10","@babel/core":"7.18.10","@babel/eslint-parser":"7.18.9","@babel/preset-env":"7.18.10","@commitlint/cli":"17.0.3","@commitlint/config-conventional":"17.0.3","bundlewatch":"0.3.3","eslint":"8.21.0","eslint-config-prettier":"8.5.0","eslint-config-standard":"17.0.0","eslint-plugin-import":"2.26.0","eslint-plugin-node":"11.1.0","eslint-plugin-prettier":"4.2.1","eslint-plugin-promise":"6.0.0","husky":"8.0.1","jest":"28.1.3","lint-staged":"13.0.3","npm-run-all":"4.1.5","optional-dev-dependency":"2.0.1","prettier":"2.7.1","random-seed":"0.3.0","runmd":"1.3.9","standard-version":"9.5.0"},"optionalDevDependencies":{"@wdio/browserstack-service":"7.16.10","@wdio/cli":"7.16.10","@wdio/jasmine-framework":"7.16.6","@wdio/local-runner":"7.16.10","@wdio/spec-reporter":"7.16.9","@wdio/static-server-service":"7.16.6"},"scripts":{"examples:browser:webpack:build":"cd examples/browser-webpack && npm install && npm run build","examples:browser:rollup:build":"cd examples/browser-rollup && npm install && npm run build","examples:node:commonjs:test":"cd examples/node-commonjs && npm install && npm test","examples:node:esmodules:test":"cd examples/node-esmodules && npm install && npm test","examples:node:jest:test":"cd examples/node-jest && npm install && npm test","prepare":"cd $( git rev-parse --show-toplevel ) && husky install","lint":"npm run eslint:check && npm run prettier:check","eslint:check":"eslint src/ test/ examples/ *.js","eslint:fix":"eslint --fix src/ test/ examples/ *.js","pretest":"[ -n $CI ] || npm run build","test":"BABEL_ENV=commonjsNode node --throw-deprecation node_modules/.bin/jest test/unit/","pretest:browser":"optional-dev-dependency && npm run build && npm-run-all --parallel examples:browser:**","test:browser":"wdio run ./wdio.conf.js","pretest:node":"npm run build","test:node":"npm-run-all --parallel examples:node:**","test:pack":"./scripts/testpack.sh","pretest:benchmark":"npm run build","test:benchmark":"cd examples/benchmark && npm install && npm test","prettier:check":"prettier --check '**/*.{js,jsx,json,md}'","prettier:fix":"prettier --write '**/*.{js,jsx,json,md}'","bundlewatch":"npm run pretest:browser && bundlewatch --config bundlewatch.config.json","md":"runmd --watch --output=README.md README_js.md","docs":"( node --version | grep -q 'v18' ) && ( npm run build && npx runmd --output=README.md README_js.md )","docs:diff":"npm run docs && git diff --quiet README.md","build":"./scripts/build.sh","prepack":"npm run build","release":"standard-version --no-verify"},"repository":{"type":"git","url":"https://github.com/uuidjs/uuid.git"},"lint-staged":{"*.{js,jsx,json,md}":["prettier --write"],"*.{js,jsx}":["eslint --fix"]},"standard-version":{"scripts":{"postchangelog":"prettier --write CHANGELOG.md"}},"_lastModified":"2025-07-09T08:38:11.598Z"}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "异步任务管理器",
|
|
5
5
|
"description": "Manage and monitor asynchronous tasks such as data import/export. Support task progress tracking and notification.",
|
|
6
6
|
"description.zh-CN": "管理和监控数据导入导出等异步任务。支持任务进度跟踪和通知。",
|
|
7
|
-
"version": "1.8.
|
|
7
|
+
"version": "1.8.1",
|
|
8
8
|
"main": "dist/server/index.js",
|
|
9
9
|
"peerDependencies": {
|
|
10
10
|
"@nocobase/client": "1.x",
|
|
@@ -15,5 +15,5 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"p-queue": "^6.6.2"
|
|
17
17
|
},
|
|
18
|
-
"gitHead": "
|
|
18
|
+
"gitHead": "85bbe64895160a66603856c6ff0c05e4ebb5fbc2"
|
|
19
19
|
}
|