@nocobase/plugin-backup-restore 2.1.0-beta.32 → 2.1.0-beta.34

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.
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ (self.webpackChunk_nocobase_plugin_backup_restore=self.webpackChunk_nocobase_plugin_backup_restore||[]).push([["370"],{574:function(e,t,n){var r,o;void 0===(o="function"==typeof(r=function(){"use strict";function t(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){i(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function r(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function o(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n.g&&n.g.global===n.g?n.g:void 0,l=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),i=a.saveAs||("object"!=typeof window||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!l?function(e,n,l){var i=a.URL||a.webkitURL,c=document.createElement("a");c.download=n=n||e.name||"download",c.rel="noopener","string"==typeof e?(c.href=e,c.origin===location.origin?o(c):r(c.href)?t(e,n,l):o(c,c.target="_blank")):(c.href=i.createObjectURL(e),setTimeout(function(){i.revokeObjectURL(c.href)},4e4),setTimeout(function(){o(c)},0))}:"msSaveOrOpenBlob"in navigator?function(e,n,a){if(n=n||e.name||"download","string"!=typeof e){var l;navigator.msSaveOrOpenBlob((void 0===(l=a)?l={autoBom:!1}:"object"!=typeof l&&(console.warn("Deprecated: Expected third argument to be a object"),l={autoBom:!l}),l.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e),n)}else if(r(e))t(e,n,a);else{var i=document.createElement("a");i.href=e,i.target="_blank",setTimeout(function(){o(i)})}}:function(e,n,r,o){if((o=o||open("","_blank"))&&(o.document.title=o.document.body.innerText="downloading..."),"string"==typeof e)return t(e,n,r);var i="application/octet-stream"===e.type,c=/constructor/i.test(a.HTMLElement)||a.safari,u=/CriOS\/[\d]+/.test(navigator.userAgent);if((u||i&&c||l)&&"u">typeof FileReader){var s=new FileReader;s.onloadend=function(){var e=s.result;e=u?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=e:location=e,o=null},s.readAsDataURL(e)}else{var f=a.URL||a.webkitURL,d=f.createObjectURL(e);o?o.location=d:location.href=d,o=null,setTimeout(function(){f.revokeObjectURL(d)},4e4)}});a.saveAs=i.saveAs=i,e.exports=i})?r.apply(t,[]):r)||(e.exports=o)},761:function(e,t,n){"use strict";n.r(t),n.d(t,{BackupAndRestoreList:function(){return O}});var r=n(375),o=n(418),a=n(342),l=n(59),i=n(574),c=n(155),u=n.n(c),s=n(872);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 d(e,t,n,r,o,a,l){try{var i=e[a](l),c=i.value}catch(e){n(e);return}i.done?t(c):Promise.resolve(c).then(r,o)}function p(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function l(e){d(a,r,o,l,i,"next",e)}function i(e){d(a,r,o,l,i,"throw",e)}l(void 0)})}}function m(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}function b(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],l=!0,i=!1;try{for(o=o.call(e);!(l=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);l=!0);}catch(e){i=!0,r=e}finally{try{l||null==o.return||o.return()}finally{if(i)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 v(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(l,"next",{value:c(0)}),i(l,"throw",{value:c(1)}),i(l,"return",{value:c(2)}),"function"==typeof Symbol&&i(l,Symbol.iterator,{value:function(){return this}}),l;function c(i){return function(c){var u=[i,c];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}var g=l.Upload.Dragger,h=function(e){var t=e.collectionsData,n=(0,s.Wl)().t,r=y((0,c.useState)(!1),2),o=r[0],i=r[1],f=y((0,c.useState)(t),2),d=f[0],m=f[1];(0,c.useEffect)(function(){m(t)},[t]);var b=(0,a.useAPIClient)(),g=(0,a.useCompile)(),h=(0,c.useMemo)(function(){return b.resource("backupFiles")},[b]),k=[{title:n("Collection"),dataIndex:"collection",key:"collection",render:function(e,t){var n=g(t.title);return t.name===n?n:u().createElement("div",null,t.name," ",u().createElement("span",{style:{color:"rgba(0, 0, 0, 0.3)",fontSize:"0.9em"}},"(",g(t.title),")"))}},{title:n("Origin"),dataIndex:"origin",key:"origin",width:"50%"}],w=Object.keys(d||{}).map(function(e){return{key:e,label:n("".concat(e,".title")),children:u().createElement(u().Fragment,null,u().createElement(l.Alert,{style:{marginBottom:16},message:n("".concat(e,".description"))}),u().createElement(l.Table,{pagination:{pageSize:100},bordered:!0,size:"small",dataSource:d[e],columns:k,scroll:{y:400}}))}});return u().createElement(u().Fragment,null,u().createElement("a",{onClick:function(){return p(function(){var t;return v(this,function(n){switch(n.label){case 0:if(!e.isBackup)return[3,2];return[4,h.dumpableCollections()];case 1:m(null==(t=n.sent())?void 0:t.data),i(!0),n.label=2;case 2:return i(!0),[2]}})})()}},n("Learn more")),u().createElement(l.Modal,{title:n("Backup instructions"),width:"80vw",open:o,footer:null,onOk:function(){i(!1)},onCancel:function(){i(!1)}},u().createElement(l.Tabs,{defaultActiveKey:"required",items:w})))},k=function(e){var t=e.ButtonComponent,n=void 0===t?l.Button:t,r=e.title,i=e.upload,f=void 0!==i&&i,d=e.fileData,m=(0,s.Wl)().t,b=y((0,c.useState)(["required"]),2),g=b[0],k=b[1],w=y((0,c.useState)(!1),2),O=w[0],S=w[1],C=y((0,c.useState)(null),2),j=C[0],A=C[1],x=y((0,c.useState)(!1),2),B=x[0],P=x[1],D=(0,a.useAPIClient)(),T=(0,c.useMemo)(function(){return D.resource("backupFiles")},[D]),R=y((0,c.useState)([]),2),F=R[0],I=R[1];return(0,c.useEffect)(function(){I(Object.keys((null==j?void 0:j.dumpableCollectionsGroupByGroup)||[]).map(function(e){return{value:e,label:m("".concat(e,".title")),disabled:["required","skipped"].includes(e)}}))},[j]),u().createElement(u().Fragment,null,u().createElement(n,{onClick:function(){return p(function(){var e,t,n,r;return v(this,function(o){switch(o.label){case 0:if(S(!0),f)return[3,2];return P(!0),[4,T.get({filterByTk:d.name})];case 1:I(Object.keys((null==(r=o.sent().data)||null==(t=r.data)||null==(e=t.meta)?void 0:e.dumpableCollectionsGroupByGroup)||[]).map(function(e){return{value:e,label:m("".concat(e,".title")),disabled:["required","skipped"].includes(e)}})),A(null==r||null==(n=r.data)?void 0:n.meta),P(!1),o.label=2;case 2:return[2]}})})()}},r),u().createElement(l.Modal,{title:m("Restore"),width:800,footer:f&&!j?null:void 0,open:O,onOk:function(){T.restore({values:{dataTypes:g,filterByTk:null==d?void 0:d.name,key:null==j?void 0:j.key}}),S(!1)},onCancel:function(){S(!1),A(null),k(["required"])}},u().createElement(l.Spin,{spinning:B},f&&!j&&u().createElement(E,{setRestoreData:A}),(!f||j)&&[u().createElement("strong",{style:{fontWeight:600,display:"block",margin:"16px 0 8px"},key:"info"},m("Select the data to be restored")," (",u().createElement(h,{collectionsData:null==j?void 0:j.dumpableCollectionsGroupByGroup}),"):"),u().createElement("div",{style:{lineHeight:2,marginBottom:8},key:"dataType"},u().createElement(o.FormItem,null,u().createElement(a.Checkbox.Group,{options:F,style:{flexDirection:"column"},value:g,onChange:function(e){return k(e)}})))])))},w=function(e){var t=e.ButtonComponent,n=void 0===t?l.Button:t,o=e.refresh,i=(0,s.Wl)().t,f=y((0,c.useState)(!1),2),d=f[0],m=f[1],b=y((0,c.useState)(["required"]),2),g=b[0],k=b[1],w=(0,a.useAPIClient)(),E=y((0,c.useState)([]),2),O=E[0],S=E[1];return u().createElement(u().Fragment,null,u().createElement(n,{icon:u().createElement(r.PlusOutlined,null),type:"primary",onClick:function(){return p(function(){return v(this,function(e){switch(e.label){case 0:return[4,w.resource("backupFiles").dumpableCollections()];case 1:return S(Object.keys(e.sent().data||[]).map(function(e){return{value:e,label:i("".concat(e,".title")),disabled:["required","skipped"].includes(e)}})),m(!0),[2]}})})()}},i("New backup")),u().createElement(l.Modal,{title:i("New backup"),width:800,open:d,onOk:function(){w.request({url:"backupFiles:create",method:"post",data:{dataTypes:g}}),m(!1),k(["required"]),setTimeout(function(){o()},500)},onCancel:function(){m(!1),k(["required"])}},u().createElement("strong",{style:{fontWeight:600,display:"block",margin:"16px 0 8px"}},i("Select the data to be backed up")," (",u().createElement(h,{isBackup:!0}),"):"),u().createElement("div",{style:{lineHeight:2,marginBottom:8}},u().createElement(a.Checkbox.Group,{options:O,style:{flexDirection:"column"},onChange:function(e){return k(e)},value:g}))))},E=function(e){var t,n,o=(0,s.Wl)().t;return u().createElement(g,(t={multiple:!1,action:"/backupFiles:upload",onChange:function(t){t.fileList.length>1&&t.fileList.splice(0,t.fileList.length-1);var n,r,a,i=t.file.status;"done"===i?(l.message.success("".concat(t.file.name," ")+o("file uploaded successfully")),e.setRestoreData(b(m({},null==(r=t.file.response)||null==(n=r.data)?void 0:n.meta),{key:null==(a=t.file.response)?void 0:a.data.key}))):"error"===i&&l.message.error("".concat(t.file.name," ")+o("file upload failed"))},onDrop:function(e){console.log("Dropped files",e.dataTransfer.files)}},n=(0,a.useAPIClient)(),b(m({},t),{customRequest:function(e){var t=e.action,r=e.data,o=e.file,a=e.filename,l=e.headers,i=e.onError,c=e.onProgress,u=e.onSuccess,s=e.withCredentials,f=new FormData;return r&&Object.keys(r).forEach(function(e){f.append(e,r[e])}),f.append(a,o),n.axios.post(t,f,{withCredentials:s,headers:l,onUploadProgress:function(e){var t=e.total;c({percent:Math.round(e.loaded/t*100).toFixed(2)},o)}}).then(function(e){u(e.data,o)}).catch(i).finally(function(){}),{abort:function(){console.log("upload progress is aborted.")}}},onChange:function(e){var n;null==(n=t.onChange)||n.call(t,e)}})),u().createElement("p",{className:"ant-upload-drag-icon"},u().createElement(r.InboxOutlined,null)),u().createElement("p",{className:"ant-upload-text"}," ",o("Click or drag file to this area to upload")))},O=function(){var e=(0,s.Wl)().t,t=(0,a.useAPIClient)(),n=y((0,c.useState)([]),2),o=n[0],f=n[1],d=y((0,c.useState)(!1),2),m=d[0],b=d[1],g=y((0,c.useState)(!1),2),h=(g[0],g[1]),E=l.App.useApp().modal,O=(0,c.useMemo)(function(){return t.resource("backupFiles")},[t]);(0,c.useEffect)(function(){S()},[]);var S=function(){return p(function(){return v(this,function(e){switch(e.label){case 0:return b(!0),[4,O.list()];case 1:return f(e.sent().data.data),b(!1),[2]}})})()},C=function(){return p(function(){return v(this,function(e){switch(e.label){case 0:return[4,S()];case 1:return e.sent(),[2]}})})()},j=function(t){E.confirm({title:e("Delete record",{ns:"client"}),content:e("Are you sure you want to delete it?",{ns:"client"}),onOk:function(){return p(function(){return v(this,function(n){switch(n.label){case 0:return[4,O.destroy({filterByTk:t.name})];case 1:return n.sent(),[4,S()];case 2:return n.sent(),l.message.success(e("Deleted successfully")),[2]}})})()}})};return u().createElement("div",null,u().createElement(l.Card,{bordered:!1},u().createElement(l.Space,{style:{float:"right",marginBottom:16}},u().createElement(l.Button,{onClick:C,icon:u().createElement(r.ReloadOutlined,null)},e("Refresh")),u().createElement(k,{upload:!0,title:u().createElement(u().Fragment,null,u().createElement(r.UploadOutlined,null)," ",e("Restore backup from local"))}),u().createElement(w,{refresh:C})),u().createElement(l.Table,{dataSource:o,loading:m,columns:[{title:e("Backup file"),dataIndex:"name",width:400,onCell:function(e){return e.inProgress?{colSpan:4}:{}},render:function(t,n){return n.inProgress?u().createElement("div",{style:{color:"rgba(0, 0, 0, 0.88)"}},t,"(",e("Backing up"),"...)"):u().createElement("div",null,t)}},{title:e("File size"),dataIndex:"fileSize",onCell:function(e){return e.inProgress?{colSpan:0}:{}}},{title:e("Created at",{ns:"client"}),dataIndex:"createdAt",onCell:function(e){return e.inProgress?{colSpan:0}:{}},render:function(e){return u().createElement(a.DatePicker.ReadPretty,{value:e,showTime:!0})}},{title:e("Actions",{ns:"client"}),dataIndex:"actions",onCell:function(e){return e.inProgress?{colSpan:0}:{}},render:function(n,r){return u().createElement(l.Space,{split:u().createElement(l.Divider,{type:"vertical"})},u().createElement(k,{ButtonComponent:"a",title:e("Restore"),fileData:r}),u().createElement("a",{type:"link",onClick:function(){return p(function(){var e,n;return v(this,function(o){switch(o.label){case 0:return h(r.name),[4,t.request({url:"backupFiles:download",method:"get",params:{filterByTk:r.name},responseType:"blob"})];case 1:return e=o.sent(),h(!1),n=new Blob([e.data]),(0,i.saveAs)(n,r.name),[2]}})})()}},e("Download")),u().createElement("a",{onClick:function(){return j(r)}},e("Delete")))}}]})))}}}]);
@@ -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-i18next"),require("file-saver"),require("@formily/antd-v5"),require("react"),require("antd"),require("@nocobase/client"),require("@ant-design/icons")):"function"==typeof define&&define.amd?define("@nocobase/plugin-backup-restore",["react-i18next","file-saver","@formily/antd-v5","react","antd","@nocobase/client","@ant-design/icons"],t):"object"==typeof exports?exports["@nocobase/plugin-backup-restore"]=t(require("react-i18next"),require("file-saver"),require("@formily/antd-v5"),require("react"),require("antd"),require("@nocobase/client"),require("@ant-design/icons")):e["@nocobase/plugin-backup-restore"]=t(e["react-i18next"],e["file-saver"],e["@formily/antd-v5"],e.react,e.antd,e["@nocobase/client"],e["@ant-design/icons"])}(self,function(e,t,r,n,o,i,u){return function(){"use strict";var c,a,l,p={872:function(e,t,r){r.d(t,{CU:function(){return o},Wl:function(){return i}}),r(342);var n=r(953),o="backup-restore";function i(){return(0,n.useTranslation)(o,{nsMode:"fallback"})}},375:function(e){e.exports=u},418:function(e){e.exports=r},342:function(e){e.exports=i},59:function(e){e.exports=o},506:function(e){e.exports=t},155:function(e){e.exports=n},953:function(t){t.exports=e}},s={};function f(e){var t=s[e];if(void 0!==t)return t.exports;var r=s[e]={exports:{}};return p[e](r,r.exports,f),r.exports}f.m=p,f.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(t,{a:t}),t},f.d=function(e,t){for(var r in t)f.o(t,r)&&!f.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},f.f={},f.e=function(e){return Promise.all(Object.keys(f.f).reduce(function(t,r){return f.f[r](e,t),t},[]))},f.u=function(e){return""+e+".f951dd2ebca3bb32.js"},f.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),f.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},b={},f.l=function(e,t,r,n){if(b[e])return void b[e].push(t);if(void 0!==r)for(var o,i,u=document.getElementsByTagName("script"),c=0;c<u.length;c++){var a=u[c];if(a.getAttribute("src")==e||a.getAttribute("data-rspack")=="@nocobase/plugin-backup-restore:"+r){o=a;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,f.nc&&o.setAttribute("nonce",f.nc),o.setAttribute("data-rspack","@nocobase/plugin-backup-restore:"+r),o.src=e),b[e]=[t];var l=function(t,r){o.onerror=o.onload=null,clearTimeout(p);var n=b[e];if(delete b[e],o.parentNode&&o.parentNode.removeChild(o),n&&n.forEach(function(e){return e(r)}),t)return t(r)},p=setTimeout(l.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=l.bind(null,o.onerror),o.onload=l.bind(null,o.onload),i&&document.head.appendChild(o)},f.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.g.importScripts&&(d=f.g.location+"");var b,d,v=f.g.document;if(!d&&v&&(v.currentScript&&"SCRIPT"===v.currentScript.tagName.toUpperCase()&&(d=v.currentScript.src),!d)){var h=v.getElementsByTagName("script");if(h.length)for(var y=h.length-1;y>-1&&(!d||!/^http(s?):/.test(d));)d=h[y--].src}if(!d)throw Error("Automatic publicPath is not supported in this browser");f.p=d.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),c={889:0},f.f.j=function(e,t){var r=f.o(c,e)?c[e]:void 0;if(0!==r)if(r)t.push(r[2]);else{var n=new Promise(function(t,n){r=c[e]=[t,n]});t.push(r[2]=n);var o=f.p+f.u(e),i=Error();f.l(o,function(t){if(f.o(c,e)&&(0!==(r=c[e])&&(c[e]=void 0),r)){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+n+": "+o+")",i.name="ChunkLoadError",i.type=n,i.request=o,r[1](i)}},"chunk-"+e,e)}},a=function(e,t){var r,n,o=t[0],i=t[1],u=t[2],a=0;if(o.some(function(e){return 0!==c[e]})){for(r in i)f.o(i,r)&&(f.m[r]=i[r]);u&&u(f)}for(e&&e(t);a<o.length;a++)n=o[a],f.o(c,n)&&c[n]&&c[n][0](),c[n]=0},(l=self.webpackChunk_nocobase_plugin_backup_restore=self.webpackChunk_nocobase_plugin_backup_restore||[]).forEach(a.bind(null,0)),l.push=a.bind(null,l.push.bind(l));var g={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src&&(e=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/@nocobase/plugin-backup-restore/dist/client/")}if(!e){if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var n=window.location.pathname||"/",o=n.indexOf("/v2/");e=o>=0?n.slice(0,o+1):"/"}e&&(e=e.replace(/\/v2\/?$/,"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-backup-restore/dist/client/"}f.p=e}(),!function(){f.r(g),f.d(g,{default:function(){return d},PluginBackupRestoreClient:function(){return b}});var e=f(342),t=f(155),r=f.n(t),n=function(t){return r().createElement(e.SchemaComponentOptions,null,t.children)};n.displayName="DuplicatorProvider";var o=f(872);function i(e,t,r,n,o,i,u){try{var c=e[i](u),a=c.value}catch(e){r(e);return}c.done?t(a):Promise.resolve(a).then(n,o)}function u(e,t,r){return(u=p()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&a(o,r.prototype),o}).apply(null,arguments)}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e){var t="function"==typeof Map?new Map:void 0;return(l=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,r)}function r(){return u(e,arguments,c(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),a(r,e)})(e)}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(p=function(){return!!e})()}var s=(0,e.lazy)(function(){return f.e("370").then(f.bind(f,761))},"BackupAndRestoreList").BackupAndRestoreList,b=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return e=r,t=arguments,e=c(e),function(e,t){var r;if(t&&("object"==((r=t)&&"u">typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"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(e,t||[],c(this).constructor):e.apply(this,t))}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&a(r,e),t=[{key:"load",value:function(){var e;return(e=function(){return function(e,t){var r,n,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),c=Object.defineProperty;return c(u,"next",{value:a(0)}),c(u,"throw",{value:a(1)}),c(u,"return",{value:a(2)}),"function"==typeof Symbol&&c(u,Symbol.iterator,{value:function(){return this}}),u;function a(c){return function(a){var l=[c,a];if(r)throw TypeError("Generator is already executing.");for(;u&&(u=0,l[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&l[0]?n.return:l[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;switch(n=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,n=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],n=0}finally{r=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(e){return this.app.use(n),this.app.pluginSettingsManager.add(o.CU,{title:this.t("Backup & Restore"),icon:"CloudServerOutlined",Component:s,aclSnippet:"pm.backup-restore"}),[2]})},function(){var t=this,r=arguments;return new Promise(function(n,o){var u=e.apply(t,r);function c(e){i(u,n,o,c,a,"next",e)}function a(e){i(u,n,o,c,a,"throw",e)}c(void 0)})}).call(this)}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(r.prototype,t),r}(l(e.Plugin)),d=b}(),g}()});
10
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("@formily/antd-v5"),require("react"),require("antd"),require("@nocobase/client"),require("@ant-design/icons")):"function"==typeof define&&define.amd?define("@nocobase/plugin-backup-restore",["react-i18next","@formily/antd-v5","react","antd","@nocobase/client","@ant-design/icons"],t):"object"==typeof exports?exports["@nocobase/plugin-backup-restore"]=t(require("react-i18next"),require("@formily/antd-v5"),require("react"),require("antd"),require("@nocobase/client"),require("@ant-design/icons")):e["@nocobase/plugin-backup-restore"]=t(e["react-i18next"],e["@formily/antd-v5"],e.react,e.antd,e["@nocobase/client"],e["@ant-design/icons"])}(self,function(e,t,n,r,o,i){return function(){"use strict";var u,c,a,l={872:function(e,t,n){n.d(t,{CU:function(){return o},Wl:function(){return i}}),n(342);var r=n(953),o="backup-restore";function i(){return(0,r.useTranslation)(o,{nsMode:"fallback"})}},375:function(e){e.exports=i},418:function(e){e.exports=t},342:function(e){e.exports=o},59:function(e){e.exports=r},155:function(e){e.exports=n},953:function(t){t.exports=e}},p={};function s(e){var t=p[e];if(void 0!==t)return t.exports;var n=p[e]={exports:{}};return l[e].call(n.exports,n,n.exports,s),n.exports}s.m=l,s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,{a:t}),t},s.d=function(e,t){for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=function(e){return Promise.all(Object.keys(s.f).reduce(function(t,n){return s.f[n](e,t),t},[]))},s.u=function(e){return""+e+".5380e1f7204403c5.js"},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},f={},s.l=function(e,t,n,r){if(f[e])return void f[e].push(t);if(void 0!==n)for(var o,i,u=document.getElementsByTagName("script"),c=0;c<u.length;c++){var a=u[c];if(a.getAttribute("src")==e||a.getAttribute("data-rspack")=="@nocobase/plugin-backup-restore:"+n){o=a;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,s.nc&&o.setAttribute("nonce",s.nc),o.setAttribute("data-rspack","@nocobase/plugin-backup-restore:"+n),o.src=e),f[e]=[t];var l=function(t,n){o.onerror=o.onload=null,clearTimeout(p);var r=f[e];if(delete f[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},p=setTimeout(l.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=l.bind(null,o.onerror),o.onload=l.bind(null,o.onload),i&&document.head.appendChild(o)},s.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.g.importScripts&&(b=s.g.location+"");var f,b,d=s.g.document;if(!b&&d&&(d.currentScript&&"SCRIPT"===d.currentScript.tagName.toUpperCase()&&(b=d.currentScript.src),!b)){var h=d.getElementsByTagName("script");if(h.length)for(var v=h.length-1;v>-1&&(!b||!/^http(s?):/.test(b));)b=h[v--].src}if(!b)throw Error("Automatic publicPath is not supported in this browser");s.p=b.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),u={889:0},s.f.j=function(e,t){var n=s.o(u,e)?u[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=u[e]=[t,r]});t.push(n[2]=r);var o=s.p+s.u(e),i=Error();s.l(o,function(t){if(s.o(u,e)&&(0!==(n=u[e])&&(u[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}},c=function(e,t){var n,r,o=t[0],i=t[1],c=t[2],a=0;if(o.some(function(e){return 0!==u[e]})){for(n in i)s.o(i,n)&&(s.m[n]=i[n]);c&&c(s)}for(e&&e(t);a<o.length;a++)r=o[a],s.o(u,r)&&u[r]&&u[r][0](),u[r]=0},(a=self.webpackChunk_nocobase_plugin_backup_restore=self.webpackChunk_nocobase_plugin_backup_restore||[]).forEach(c.bind(null,0)),a.push=c.bind(null,a.push.bind(a));var y={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src&&(e=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!e){var n=window.__webpack_public_path__||"";n&&("/"!==n.charAt(n.length-1)&&(n+="/"),e=n+"static/plugins/@nocobase/plugin-backup-restore/dist/client/")}if(!e){if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var r=window.location.pathname||"/",o=r.indexOf("/v2/");e=o>=0?r.slice(0,o+1):"/"}e&&(e=e.replace(/\/v2\/?$/,"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-backup-restore/dist/client/"}s.p=e}(),!function(){s.r(y),s.d(y,{default:function(){return d},PluginBackupRestoreClient:function(){return b}});var e=s(342),t=s(155),n=s.n(t),r=function(t){return n().createElement(e.SchemaComponentOptions,null,t.children)};r.displayName="DuplicatorProvider";var o=s(872);function i(e,t,n,r,o,i,u){try{var c=e[i](u),a=c.value}catch(e){n(e);return}c.done?t(a):Promise.resolve(a).then(r,o)}function u(e,t,n){return(u=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&&a(o,n.prototype),o}).apply(null,arguments)}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e){var t="function"==typeof Map?new Map:void 0;return(l=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 u(e,arguments,c(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),a(n,e)})(e)}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(p=function(){return!!e})()}var f=(0,e.lazy)(function(){return s.e("370").then(s.bind(s,761))},"BackupAndRestoreList").BackupAndRestoreList,b=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;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=c(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">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(e,t||[],c(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&a(n,e),t=[{key:"load",value:function(){var e;return(e=function(){return function(e,t){var n,r,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),c=Object.defineProperty;return c(u,"next",{value:a(0)}),c(u,"throw",{value:a(1)}),c(u,"return",{value:a(2)}),"function"==typeof Symbol&&c(u,Symbol.iterator,{value:function(){return this}}),u;function a(c){return function(a){var l=[c,a];if(n)throw TypeError("Generator is already executing.");for(;u&&(u=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(e){return this.app.use(r),this.app.pluginSettingsManager.add(o.CU,{title:this.t("Backup & Restore"),icon:"CloudServerOutlined",Component:f,aclSnippet:"pm.backup-restore"}),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var u=e.apply(t,n);function c(e){i(u,r,o,c,a,"next",e)}function a(e){i(u,r,o,c,a,"throw",e)}c(void 0)})}).call(this)}}],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}(l(e.Plugin)),d=b}(),y}()});
@@ -10,15 +10,14 @@
10
10
  module.exports = {
11
11
  "@ant-design/icons": "5.6.1",
12
12
  "@formily/antd-v5": "1.2.3",
13
- "@nocobase/client": "2.1.0-beta.32",
13
+ "@nocobase/client": "2.1.0-beta.34",
14
14
  "antd": "5.24.2",
15
- "file-saver": "2.0.5",
16
15
  "react": "18.2.0",
17
- "@nocobase/server": "2.1.0-beta.32",
18
- "@nocobase/utils": "2.1.0-beta.32",
19
- "@nocobase/database": "2.1.0-beta.32",
16
+ "@nocobase/server": "2.1.0-beta.34",
17
+ "@nocobase/utils": "2.1.0-beta.34",
18
+ "@nocobase/database": "2.1.0-beta.34",
20
19
  "dayjs": "1.11.13",
21
20
  "lodash": "4.18.1",
22
21
  "react-i18next": "11.18.6",
23
- "@nocobase/actions": "2.1.0-beta.32"
22
+ "@nocobase/actions": "2.1.0-beta.34"
24
23
  };
@@ -1 +1 @@
1
- {"name":"@hapi/topo","description":"Topological sorting with grouping support","version":"6.0.2","repository":"git://github.com/hapijs/topo","main":"lib/index.js","types":"lib/index.d.ts","files":["lib"],"keywords":["topological","sort","toposort","topsort"],"eslintConfig":{"extends":["plugin:@hapi/module"]},"dependencies":{"@hapi/hoek":"^11.0.2"},"devDependencies":{"@hapi/code":"^9.0.3","@hapi/eslint-plugin":"*","@hapi/lab":"^25.1.2","@types/node":"^17.0.31","typescript":"~4.6.4"},"scripts":{"test":"lab -a @hapi/code -t 100 -L -Y","test-cov-html":"lab -a @hapi/code -t 100 -L -r html -o coverage.html"},"license":"BSD-3-Clause","_lastModified":"2026-05-13T05:24:35.889Z"}
1
+ {"name":"@hapi/topo","description":"Topological sorting with grouping support","version":"6.0.2","repository":"git://github.com/hapijs/topo","main":"lib/index.js","types":"lib/index.d.ts","files":["lib"],"keywords":["topological","sort","toposort","topsort"],"eslintConfig":{"extends":["plugin:@hapi/module"]},"dependencies":{"@hapi/hoek":"^11.0.2"},"devDependencies":{"@hapi/code":"^9.0.3","@hapi/eslint-plugin":"*","@hapi/lab":"^25.1.2","@types/node":"^17.0.31","typescript":"~4.6.4"},"scripts":{"test":"lab -a @hapi/code -t 100 -L -Y","test-cov-html":"lab -a @hapi/code -t 100 -L -r html -o coverage.html"},"license":"BSD-3-Clause","_lastModified":"2026-05-18T17:29:21.251Z"}
@@ -1 +1 @@
1
- {"name":"archiver","version":"5.3.2","description":"a streaming interface for archive generation","homepage":"https://github.com/archiverjs/node-archiver","author":{"name":"Chris Talkington","url":"http://christalkington.com/"},"repository":{"type":"git","url":"https://github.com/archiverjs/node-archiver.git"},"bugs":{"url":"https://github.com/archiverjs/node-archiver/issues"},"license":"MIT","main":"index.js","files":["index.js","lib"],"engines":{"node":">= 10"},"scripts":{"test":"mocha --reporter dot","bench":"node benchmark/simple/pack-zip.js"},"dependencies":{"archiver-utils":"^2.1.0","async":"^3.2.4","buffer-crc32":"^0.2.1","readable-stream":"^3.6.0","readdir-glob":"^1.1.2","tar-stream":"^2.2.0","zip-stream":"^4.1.0"},"devDependencies":{"archiver-jsdoc-theme":"^1.1.3","chai":"^4.3.7","jsdoc":"^3.6.4","mkdirp":"^2.1.5","mocha":"^9.0.2","rimraf":"^4.3.1","stream-bench":"^0.1.2","tar":"^6.1.13","yauzl":"^2.9.0"},"keywords":["archive","archiver","stream","zip","tar"],"publishConfig":{"registry":"https://registry.npmjs.org/"},"_lastModified":"2026-05-13T05:24:34.068Z"}
1
+ {"name":"archiver","version":"5.3.2","description":"a streaming interface for archive generation","homepage":"https://github.com/archiverjs/node-archiver","author":{"name":"Chris Talkington","url":"http://christalkington.com/"},"repository":{"type":"git","url":"https://github.com/archiverjs/node-archiver.git"},"bugs":{"url":"https://github.com/archiverjs/node-archiver/issues"},"license":"MIT","main":"index.js","files":["index.js","lib"],"engines":{"node":">= 10"},"scripts":{"test":"mocha --reporter dot","bench":"node benchmark/simple/pack-zip.js"},"dependencies":{"archiver-utils":"^2.1.0","async":"^3.2.4","buffer-crc32":"^0.2.1","readable-stream":"^3.6.0","readdir-glob":"^1.1.2","tar-stream":"^2.2.0","zip-stream":"^4.1.0"},"devDependencies":{"archiver-jsdoc-theme":"^1.1.3","chai":"^4.3.7","jsdoc":"^3.6.4","mkdirp":"^2.1.5","mocha":"^9.0.2","rimraf":"^4.3.1","stream-bench":"^0.1.2","tar":"^6.1.13","yauzl":"^2.9.0"},"keywords":["archive","archiver","stream","zip","tar"],"publishConfig":{"registry":"https://registry.npmjs.org/"},"_lastModified":"2026-05-18T17:29:19.526Z"}
@@ -1 +1 @@
1
- {"name":"decompress","version":"4.2.1","description":"Extracting archives made easy","license":"MIT","repository":"kevva/decompress","author":{"name":"Kevin Mårtensson","email":"kevinmartensson@gmail.com","url":"github.com/kevva"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["bz2","bzip2","decompress","extract","tar","tar.bz","tar.gz","zip","unzip"],"dependencies":{"decompress-tar":"^4.0.0","decompress-tarbz2":"^4.0.0","decompress-targz":"^4.0.0","decompress-unzip":"^4.0.1","graceful-fs":"^4.1.10","make-dir":"^1.0.0","pify":"^2.3.0","strip-dirs":"^2.0.0"},"devDependencies":{"ava":"*","esm":"^3.2.25","is-jpg":"^1.0.0","path-exists":"^3.0.0","pify":"^2.3.0","rimraf":"^3.0.2","xo":"*"},"ava":{"require":["esm"]},"xo":{"rules":{"promise/prefer-await-to-then":"off"}},"_lastModified":"2026-05-13T05:24:35.671Z"}
1
+ {"name":"decompress","version":"4.2.1","description":"Extracting archives made easy","license":"MIT","repository":"kevva/decompress","author":{"name":"Kevin Mårtensson","email":"kevinmartensson@gmail.com","url":"github.com/kevva"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["bz2","bzip2","decompress","extract","tar","tar.bz","tar.gz","zip","unzip"],"dependencies":{"decompress-tar":"^4.0.0","decompress-tarbz2":"^4.0.0","decompress-targz":"^4.0.0","decompress-unzip":"^4.0.1","graceful-fs":"^4.1.10","make-dir":"^1.0.0","pify":"^2.3.0","strip-dirs":"^2.0.0"},"devDependencies":{"ava":"*","esm":"^3.2.25","is-jpg":"^1.0.0","path-exists":"^3.0.0","pify":"^2.3.0","rimraf":"^3.0.2","xo":"*"},"ava":{"require":["esm"]},"xo":{"rules":{"promise/prefer-await-to-then":"off"}},"_lastModified":"2026-05-18T17:29:21.030Z"}
@@ -1 +1 @@
1
- {"name":"fs-extra","version":"9.1.0","description":"fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as recursive mkdir, copy, and remove.","engines":{"node":">=10"},"homepage":"https://github.com/jprichardson/node-fs-extra","repository":{"type":"git","url":"https://github.com/jprichardson/node-fs-extra"},"keywords":["fs","file","file system","copy","directory","extra","mkdirp","mkdir","mkdirs","recursive","json","read","write","extra","delete","remove","touch","create","text","output","move","promise"],"author":"JP Richardson <jprichardson@gmail.com>","license":"MIT","dependencies":{"at-least-node":"^1.0.0","graceful-fs":"^4.2.0","jsonfile":"^6.0.1","universalify":"^2.0.0"},"devDependencies":{"coveralls":"^3.0.0","klaw":"^2.1.1","klaw-sync":"^3.0.2","minimist":"^1.1.1","mocha":"^5.0.5","nyc":"^15.0.0","proxyquire":"^2.0.1","read-dir-files":"^0.1.1","standard":"^14.1.0"},"main":"./lib/index.js","files":["lib/","!lib/**/__tests__/"],"scripts":{"full-ci":"npm run lint && npm run coverage","coverage":"nyc -r lcovonly npm run unit","coveralls":"coveralls < coverage/lcov.info","lint":"standard","test-find":"find ./lib/**/__tests__ -name *.test.js | xargs mocha","test":"npm run lint && npm run unit","unit":"node test.js"},"_lastModified":"2026-05-13T05:24:34.392Z"}
1
+ {"name":"fs-extra","version":"9.1.0","description":"fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as recursive mkdir, copy, and remove.","engines":{"node":">=10"},"homepage":"https://github.com/jprichardson/node-fs-extra","repository":{"type":"git","url":"https://github.com/jprichardson/node-fs-extra"},"keywords":["fs","file","file system","copy","directory","extra","mkdirp","mkdir","mkdirs","recursive","json","read","write","extra","delete","remove","touch","create","text","output","move","promise"],"author":"JP Richardson <jprichardson@gmail.com>","license":"MIT","dependencies":{"at-least-node":"^1.0.0","graceful-fs":"^4.2.0","jsonfile":"^6.0.1","universalify":"^2.0.0"},"devDependencies":{"coveralls":"^3.0.0","klaw":"^2.1.1","klaw-sync":"^3.0.2","minimist":"^1.1.1","mocha":"^5.0.5","nyc":"^15.0.0","proxyquire":"^2.0.1","read-dir-files":"^0.1.1","standard":"^14.1.0"},"main":"./lib/index.js","files":["lib/","!lib/**/__tests__/"],"scripts":{"full-ci":"npm run lint && npm run coverage","coverage":"nyc -r lcovonly npm run unit","coveralls":"coveralls < coverage/lcov.info","lint":"standard","test-find":"find ./lib/**/__tests__ -name *.test.js | xargs mocha","test":"npm run lint && npm run unit","unit":"node test.js"},"_lastModified":"2026-05-18T17:29:19.820Z"}
@@ -1 +1 @@
1
- {"name":"moment","version":"2.29.4","description":"Parse, validate, manipulate, and display dates","homepage":"https://momentjs.com","author":"Iskren Ivov Chernev <iskren.chernev@gmail.com> (https://github.com/ichernev)","contributors":["Tim Wood <washwithcare@gmail.com> (http://timwoodcreates.com/)","Rocky Meza (http://rockymeza.com)","Matt Johnson <mj1856@hotmail.com> (http://codeofmatt.com)","Isaac Cambron <isaac@isaaccambron.com> (http://isaaccambron.com)","Andre Polykanine <andre@oire.org> (https://github.com/oire)"],"keywords":["moment","date","time","parse","format","validate","i18n","l10n","ender"],"main":"./moment.js","jsnext:main":"./dist/moment.js","typings":"./moment.d.ts","typesVersions":{">=3.1":{"*":["ts3.1-typings/*"]}},"engines":{"node":"*"},"repository":{"type":"git","url":"https://github.com/moment/moment.git"},"bugs":{"url":"https://github.com/moment/moment/issues"},"license":"MIT","devDependencies":{"benchmark":"latest","coveralls":"latest","cross-env":"^6.0.3","es6-promise":"latest","eslint":"~6","grunt":"latest","grunt-benchmark":"latest","grunt-cli":"latest","grunt-contrib-clean":"latest","grunt-contrib-concat":"latest","grunt-contrib-copy":"latest","grunt-contrib-uglify":"latest","grunt-contrib-watch":"latest","grunt-env":"latest","grunt-exec":"latest","grunt-karma":"latest","grunt-nuget":"latest","grunt-string-replace":"latest","karma":"latest","karma-chrome-launcher":"latest","karma-firefox-launcher":"latest","karma-qunit":"latest","karma-sauce-launcher":"4.1.4","load-grunt-tasks":"latest","lodash":">=4.17.19","node-qunit":"latest","nyc":"latest","prettier":"latest","qunit":"^2.10.0","rollup":"2.17.1","typescript":"^1.8.10","typescript3":"npm:typescript@^3.1.6","uglify-js":"latest"},"ender":"./ender.js","dojoBuild":"package.js","jspm":{"files":["moment.js","moment.d.ts","locale"],"map":{"moment":"./moment"},"buildConfig":{"uglify":true}},"scripts":{"ts3.1-typescript-test":"cross-env node_modules/typescript3/bin/tsc --project ts3.1-typing-tests","typescript-test":"cross-env node_modules/typescript/bin/tsc --project typing-tests","test":"grunt test","eslint":"eslint Gruntfile.js tasks src","prettier-check":"prettier --check Gruntfile.js tasks src","prettier-fmt":"prettier --write Gruntfile.js tasks src","coverage":"nyc npm test && nyc report","coveralls":"nyc npm test && nyc report --reporter=text-lcov | coveralls"},"spm":{"main":"moment.js","output":["locale/*.js"]},"_lastModified":"2026-05-13T05:24:34.923Z"}
1
+ {"name":"moment","version":"2.29.4","description":"Parse, validate, manipulate, and display dates","homepage":"https://momentjs.com","author":"Iskren Ivov Chernev <iskren.chernev@gmail.com> (https://github.com/ichernev)","contributors":["Tim Wood <washwithcare@gmail.com> (http://timwoodcreates.com/)","Rocky Meza (http://rockymeza.com)","Matt Johnson <mj1856@hotmail.com> (http://codeofmatt.com)","Isaac Cambron <isaac@isaaccambron.com> (http://isaaccambron.com)","Andre Polykanine <andre@oire.org> (https://github.com/oire)"],"keywords":["moment","date","time","parse","format","validate","i18n","l10n","ender"],"main":"./moment.js","jsnext:main":"./dist/moment.js","typings":"./moment.d.ts","typesVersions":{">=3.1":{"*":["ts3.1-typings/*"]}},"engines":{"node":"*"},"repository":{"type":"git","url":"https://github.com/moment/moment.git"},"bugs":{"url":"https://github.com/moment/moment/issues"},"license":"MIT","devDependencies":{"benchmark":"latest","coveralls":"latest","cross-env":"^6.0.3","es6-promise":"latest","eslint":"~6","grunt":"latest","grunt-benchmark":"latest","grunt-cli":"latest","grunt-contrib-clean":"latest","grunt-contrib-concat":"latest","grunt-contrib-copy":"latest","grunt-contrib-uglify":"latest","grunt-contrib-watch":"latest","grunt-env":"latest","grunt-exec":"latest","grunt-karma":"latest","grunt-nuget":"latest","grunt-string-replace":"latest","karma":"latest","karma-chrome-launcher":"latest","karma-firefox-launcher":"latest","karma-qunit":"latest","karma-sauce-launcher":"4.1.4","load-grunt-tasks":"latest","lodash":">=4.17.19","node-qunit":"latest","nyc":"latest","prettier":"latest","qunit":"^2.10.0","rollup":"2.17.1","typescript":"^1.8.10","typescript3":"npm:typescript@^3.1.6","uglify-js":"latest"},"ender":"./ender.js","dojoBuild":"package.js","jspm":{"files":["moment.js","moment.d.ts","locale"],"map":{"moment":"./moment"},"buildConfig":{"uglify":true}},"scripts":{"ts3.1-typescript-test":"cross-env node_modules/typescript3/bin/tsc --project ts3.1-typing-tests","typescript-test":"cross-env node_modules/typescript/bin/tsc --project typing-tests","test":"grunt test","eslint":"eslint Gruntfile.js tasks src","prettier-check":"prettier --check Gruntfile.js tasks src","prettier-fmt":"prettier --write Gruntfile.js tasks src","coverage":"nyc npm test && nyc report","coveralls":"nyc npm test && nyc report --reporter=text-lcov | coveralls"},"spm":{"main":"moment.js","output":["locale/*.js"]},"_lastModified":"2026-05-18T17:29:20.354Z"}
@@ -1 +1 @@
1
- {"name":"semver","version":"7.7.1","description":"The semantic version parser used by npm.","main":"index.js","scripts":{"test":"tap","snap":"tap","lint":"npm run eslint","postlint":"template-oss-check","lintfix":"npm run eslint -- --fix","posttest":"npm run lint","template-oss-apply":"template-oss-apply --force","eslint":"eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""},"devDependencies":{"@npmcli/eslint-config":"^5.0.0","@npmcli/template-oss":"4.23.4","benchmark":"^2.1.4","tap":"^16.0.0"},"license":"ISC","repository":{"type":"git","url":"git+https://github.com/npm/node-semver.git"},"bin":{"semver":"bin/semver.js"},"files":["bin/","lib/","classes/","functions/","internal/","ranges/","index.js","preload.js","range.bnf"],"tap":{"timeout":30,"coverage-map":"map.js","nyc-arg":["--exclude","tap-snapshots/**"]},"engines":{"node":">=10"},"author":"GitHub Inc.","templateOSS":{"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten.","version":"4.23.4","engines":">=10","distPaths":["classes/","functions/","internal/","ranges/","index.js","preload.js","range.bnf"],"allowPaths":["/classes/","/functions/","/internal/","/ranges/","/index.js","/preload.js","/range.bnf","/benchmarks"],"publish":"true"},"_lastModified":"2026-05-13T05:24:36.186Z"}
1
+ {"name":"semver","version":"7.7.1","description":"The semantic version parser used by npm.","main":"index.js","scripts":{"test":"tap","snap":"tap","lint":"npm run eslint","postlint":"template-oss-check","lintfix":"npm run eslint -- --fix","posttest":"npm run lint","template-oss-apply":"template-oss-apply --force","eslint":"eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""},"devDependencies":{"@npmcli/eslint-config":"^5.0.0","@npmcli/template-oss":"4.23.4","benchmark":"^2.1.4","tap":"^16.0.0"},"license":"ISC","repository":{"type":"git","url":"git+https://github.com/npm/node-semver.git"},"bin":{"semver":"bin/semver.js"},"files":["bin/","lib/","classes/","functions/","internal/","ranges/","index.js","preload.js","range.bnf"],"tap":{"timeout":30,"coverage-map":"map.js","nyc-arg":["--exclude","tap-snapshots/**"]},"engines":{"node":">=10"},"author":"GitHub Inc.","templateOSS":{"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten.","version":"4.23.4","engines":">=10","distPaths":["classes/","functions/","internal/","ranges/","index.js","preload.js","range.bnf"],"allowPaths":["/classes/","/functions/","/internal/","/ranges/","/index.js","/preload.js","/range.bnf","/benchmarks"],"publish":"true"},"_lastModified":"2026-05-18T17:29:21.513Z"}
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "description": "Backup and restore applications for scenarios such as application replication, migration, and upgrades.",
7
7
  "description.ru-RU": "Резервное копирование и восстановление приложений для задач репликации, миграции и обновления.",
8
8
  "description.zh-CN": "备份和还原应用,可用于应用的复制、迁移、升级等场景。",
9
- "version": "2.1.0-beta.32",
9
+ "version": "2.1.0-beta.34",
10
10
  "license": "Apache-2.0",
11
11
  "main": "./dist/server/index.js",
12
12
  "homepage": "https://docs.nocobase.com/handbook/backup-restore",
@@ -47,5 +47,5 @@
47
47
  "keywords": [
48
48
  "System management"
49
49
  ],
50
- "gitHead": "659c5efe992da7118d33c768bbd9e837a2c4716f"
50
+ "gitHead": "ca804833299c547f8d49f8d58f73273a4bfcd03c"
51
51
  }
@@ -1,10 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- "use strict";(self.webpackChunk_nocobase_plugin_backup_restore=self.webpackChunk_nocobase_plugin_backup_restore||[]).push([["370"],{761:function(e,t,n){n.r(t),n.d(t,{BackupAndRestoreList:function(){return C}});var r=n(375),l=n(418),a=n(342),o=n(59),i=n(506),u=n(155),c=n.n(u),s=n(872);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 d(e,t,n,r,l,a,o){try{var i=e[a](o),u=i.value}catch(e){n(e);return}i.done?t(u):Promise.resolve(u).then(r,l)}function p(e){return function(){var t=this,n=arguments;return new Promise(function(r,l){var a=e.apply(t,n);function o(e){d(a,r,l,o,i,"next",e)}function i(e){d(a,r,l,o,i,"throw",e)}o(void 0)})}}function m(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}function b(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,l=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=l){var a=[],o=!0,i=!1;try{for(l=l.call(e);!(o=(n=l.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){i=!0,r=e}finally{try{o||null==l.return||l.return()}finally{if(i)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 h(e,t){var n,r,l,a={label:0,sent:function(){if(1&l[0])throw l[1];return l[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(o,"next",{value:u(0)}),i(o,"throw",{value:u(1)}),i(o,"return",{value:u(2)}),"function"==typeof Symbol&&i(o,Symbol.iterator,{value:function(){return this}}),o;function u(i){return function(u){var c=[i,u];if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(l=2&c[0]?r.return:c[0]?r.throw||((l=r.return)&&l.call(r),0):r.next)&&!(l=l.call(r,c[1])).done)return l;switch(r=0,l&&(c=[2&c[0],l.value]),c[0]){case 0:case 1:l=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(l=(l=a.trys).length>0&&l[l.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!l||c[1]>l[0]&&c[1]<l[3])){a.label=c[1];break}if(6===c[0]&&a.label<l[1]){a.label=l[1],l=c;break}if(l&&a.label<l[2]){a.label=l[2],a.ops.push(c);break}l[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=l=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var v=o.Upload.Dragger,g=function(e){var t=e.collectionsData,n=(0,s.Wl)().t,r=y((0,u.useState)(!1),2),l=r[0],i=r[1],f=y((0,u.useState)(t),2),d=f[0],m=f[1];(0,u.useEffect)(function(){m(t)},[t]);var b=(0,a.useAPIClient)(),v=(0,a.useCompile)(),g=(0,u.useMemo)(function(){return b.resource("backupFiles")},[b]),k=[{title:n("Collection"),dataIndex:"collection",key:"collection",render:function(e,t){var n=v(t.title);return t.name===n?n:c().createElement("div",null,t.name," ",c().createElement("span",{style:{color:"rgba(0, 0, 0, 0.3)",fontSize:"0.9em"}},"(",v(t.title),")"))}},{title:n("Origin"),dataIndex:"origin",key:"origin",width:"50%"}],E=Object.keys(d||{}).map(function(e){return{key:e,label:n("".concat(e,".title")),children:c().createElement(c().Fragment,null,c().createElement(o.Alert,{style:{marginBottom:16},message:n("".concat(e,".description"))}),c().createElement(o.Table,{pagination:{pageSize:100},bordered:!0,size:"small",dataSource:d[e],columns:k,scroll:{y:400}}))}});return c().createElement(c().Fragment,null,c().createElement("a",{onClick:function(){return p(function(){var t;return h(this,function(n){switch(n.label){case 0:if(!e.isBackup)return[3,2];return[4,g.dumpableCollections()];case 1:m(null==(t=n.sent())?void 0:t.data),i(!0),n.label=2;case 2:return i(!0),[2]}})})()}},n("Learn more")),c().createElement(o.Modal,{title:n("Backup instructions"),width:"80vw",open:l,footer:null,onOk:function(){i(!1)},onCancel:function(){i(!1)}},c().createElement(o.Tabs,{defaultActiveKey:"required",items:E})))},k=function(e){var t=e.ButtonComponent,n=void 0===t?o.Button:t,r=e.title,i=e.upload,f=void 0!==i&&i,d=e.fileData,m=(0,s.Wl)().t,b=y((0,u.useState)(["required"]),2),v=b[0],k=b[1],E=y((0,u.useState)(!1),2),C=E[0],O=E[1],S=y((0,u.useState)(null),2),P=S[0],j=S[1],B=y((0,u.useState)(!1),2),x=B[0],D=B[1],A=(0,a.useAPIClient)(),I=(0,u.useMemo)(function(){return A.resource("backupFiles")},[A]),F=y((0,u.useState)([]),2),T=F[0],q=F[1];return(0,u.useEffect)(function(){q(Object.keys((null==P?void 0:P.dumpableCollectionsGroupByGroup)||[]).map(function(e){return{value:e,label:m("".concat(e,".title")),disabled:["required","skipped"].includes(e)}}))},[P]),c().createElement(c().Fragment,null,c().createElement(n,{onClick:function(){return p(function(){var e,t,n,r;return h(this,function(l){switch(l.label){case 0:if(O(!0),f)return[3,2];return D(!0),[4,I.get({filterByTk:d.name})];case 1:q(Object.keys((null==(r=l.sent().data)||null==(t=r.data)||null==(e=t.meta)?void 0:e.dumpableCollectionsGroupByGroup)||[]).map(function(e){return{value:e,label:m("".concat(e,".title")),disabled:["required","skipped"].includes(e)}})),j(null==r||null==(n=r.data)?void 0:n.meta),D(!1),l.label=2;case 2:return[2]}})})()}},r),c().createElement(o.Modal,{title:m("Restore"),width:800,footer:f&&!P?null:void 0,open:C,onOk:function(){I.restore({values:{dataTypes:v,filterByTk:null==d?void 0:d.name,key:null==P?void 0:P.key}}),O(!1)},onCancel:function(){O(!1),j(null),k(["required"])}},c().createElement(o.Spin,{spinning:x},f&&!P&&c().createElement(w,{setRestoreData:j}),(!f||P)&&[c().createElement("strong",{style:{fontWeight:600,display:"block",margin:"16px 0 8px"},key:"info"},m("Select the data to be restored")," (",c().createElement(g,{collectionsData:null==P?void 0:P.dumpableCollectionsGroupByGroup}),"):"),c().createElement("div",{style:{lineHeight:2,marginBottom:8},key:"dataType"},c().createElement(l.FormItem,null,c().createElement(a.Checkbox.Group,{options:T,style:{flexDirection:"column"},value:v,onChange:function(e){return k(e)}})))])))},E=function(e){var t=e.ButtonComponent,n=void 0===t?o.Button:t,l=e.refresh,i=(0,s.Wl)().t,f=y((0,u.useState)(!1),2),d=f[0],m=f[1],b=y((0,u.useState)(["required"]),2),v=b[0],k=b[1],E=(0,a.useAPIClient)(),w=y((0,u.useState)([]),2),C=w[0],O=w[1];return c().createElement(c().Fragment,null,c().createElement(n,{icon:c().createElement(r.PlusOutlined,null),type:"primary",onClick:function(){return p(function(){return h(this,function(e){switch(e.label){case 0:return[4,E.resource("backupFiles").dumpableCollections()];case 1:return O(Object.keys(e.sent().data||[]).map(function(e){return{value:e,label:i("".concat(e,".title")),disabled:["required","skipped"].includes(e)}})),m(!0),[2]}})})()}},i("New backup")),c().createElement(o.Modal,{title:i("New backup"),width:800,open:d,onOk:function(){E.request({url:"backupFiles:create",method:"post",data:{dataTypes:v}}),m(!1),k(["required"]),setTimeout(function(){l()},500)},onCancel:function(){m(!1),k(["required"])}},c().createElement("strong",{style:{fontWeight:600,display:"block",margin:"16px 0 8px"}},i("Select the data to be backed up")," (",c().createElement(g,{isBackup:!0}),"):"),c().createElement("div",{style:{lineHeight:2,marginBottom:8}},c().createElement(a.Checkbox.Group,{options:C,style:{flexDirection:"column"},onChange:function(e){return k(e)},value:v}))))},w=function(e){var t,n,l=(0,s.Wl)().t;return c().createElement(v,(t={multiple:!1,action:"/backupFiles:upload",onChange:function(t){t.fileList.length>1&&t.fileList.splice(0,t.fileList.length-1);var n,r,a,i=t.file.status;"done"===i?(o.message.success("".concat(t.file.name," ")+l("file uploaded successfully")),e.setRestoreData(b(m({},null==(r=t.file.response)||null==(n=r.data)?void 0:n.meta),{key:null==(a=t.file.response)?void 0:a.data.key}))):"error"===i&&o.message.error("".concat(t.file.name," ")+l("file upload failed"))},onDrop:function(e){console.log("Dropped files",e.dataTransfer.files)}},n=(0,a.useAPIClient)(),b(m({},t),{customRequest:function(e){var t=e.action,r=e.data,l=e.file,a=e.filename,o=e.headers,i=e.onError,u=e.onProgress,c=e.onSuccess,s=e.withCredentials,f=new FormData;return r&&Object.keys(r).forEach(function(e){f.append(e,r[e])}),f.append(a,l),n.axios.post(t,f,{withCredentials:s,headers:o,onUploadProgress:function(e){var t=e.total;u({percent:Math.round(e.loaded/t*100).toFixed(2)},l)}}).then(function(e){c(e.data,l)}).catch(i).finally(function(){}),{abort:function(){console.log("upload progress is aborted.")}}},onChange:function(e){var n;null==(n=t.onChange)||n.call(t,e)}})),c().createElement("p",{className:"ant-upload-drag-icon"},c().createElement(r.InboxOutlined,null)),c().createElement("p",{className:"ant-upload-text"}," ",l("Click or drag file to this area to upload")))},C=function(){var e=(0,s.Wl)().t,t=(0,a.useAPIClient)(),n=y((0,u.useState)([]),2),l=n[0],f=n[1],d=y((0,u.useState)(!1),2),m=d[0],b=d[1],v=y((0,u.useState)(!1),2),g=(v[0],v[1]),w=o.App.useApp().modal,C=(0,u.useMemo)(function(){return t.resource("backupFiles")},[t]);(0,u.useEffect)(function(){O()},[]);var O=function(){return p(function(){return h(this,function(e){switch(e.label){case 0:return b(!0),[4,C.list()];case 1:return f(e.sent().data.data),b(!1),[2]}})})()},S=function(){return p(function(){return h(this,function(e){switch(e.label){case 0:return[4,O()];case 1:return e.sent(),[2]}})})()},P=function(t){w.confirm({title:e("Delete record",{ns:"client"}),content:e("Are you sure you want to delete it?",{ns:"client"}),onOk:function(){return p(function(){return h(this,function(n){switch(n.label){case 0:return[4,C.destroy({filterByTk:t.name})];case 1:return n.sent(),[4,O()];case 2:return n.sent(),o.message.success(e("Deleted successfully")),[2]}})})()}})};return c().createElement("div",null,c().createElement(o.Card,{bordered:!1},c().createElement(o.Space,{style:{float:"right",marginBottom:16}},c().createElement(o.Button,{onClick:S,icon:c().createElement(r.ReloadOutlined,null)},e("Refresh")),c().createElement(k,{upload:!0,title:c().createElement(c().Fragment,null,c().createElement(r.UploadOutlined,null)," ",e("Restore backup from local"))}),c().createElement(E,{refresh:S})),c().createElement(o.Table,{dataSource:l,loading:m,columns:[{title:e("Backup file"),dataIndex:"name",width:400,onCell:function(e){return e.inProgress?{colSpan:4}:{}},render:function(t,n){return n.inProgress?c().createElement("div",{style:{color:"rgba(0, 0, 0, 0.88)"}},t,"(",e("Backing up"),"...)"):c().createElement("div",null,t)}},{title:e("File size"),dataIndex:"fileSize",onCell:function(e){return e.inProgress?{colSpan:0}:{}}},{title:e("Created at",{ns:"client"}),dataIndex:"createdAt",onCell:function(e){return e.inProgress?{colSpan:0}:{}},render:function(e){return c().createElement(a.DatePicker.ReadPretty,{value:e,showTime:!0})}},{title:e("Actions",{ns:"client"}),dataIndex:"actions",onCell:function(e){return e.inProgress?{colSpan:0}:{}},render:function(n,r){return c().createElement(o.Space,{split:c().createElement(o.Divider,{type:"vertical"})},c().createElement(k,{ButtonComponent:"a",title:e("Restore"),fileData:r}),c().createElement("a",{type:"link",onClick:function(){return p(function(){var e,n;return h(this,function(l){switch(l.label){case 0:return g(r.name),[4,t.request({url:"backupFiles:download",method:"get",params:{filterByTk:r.name},responseType:"blob"})];case 1:return e=l.sent(),g(!1),n=new Blob([e.data]),(0,i.saveAs)(n,r.name),[2]}})})()}},e("Download")),c().createElement("a",{onClick:function(){return P(r)}},e("Delete")))}}]})))}}}]);