@nocobase/plugin-backup-restore 1.0.0-alpha.2 → 1.0.0-alpha.3

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.
Files changed (42) hide show
  1. package/dist/client/Configuration.d.ts +8 -0
  2. package/dist/client/DuplicatorProvider.d.ts +8 -0
  3. package/dist/client/index.d.ts +8 -0
  4. package/dist/client/index.js +9 -0
  5. package/dist/client/locale/index.d.ts +8 -0
  6. package/dist/externalVersion.js +14 -5
  7. package/dist/index.d.ts +8 -0
  8. package/dist/index.js +9 -0
  9. package/dist/locale/ja-JP.d.ts +8 -0
  10. package/dist/locale/ja-JP.js +9 -0
  11. package/dist/locale/pt-BR.d.ts +8 -0
  12. package/dist/locale/pt-BR.js +9 -0
  13. package/dist/node_modules/@hapi/topo/package.json +1 -1
  14. package/dist/node_modules/archiver/package.json +1 -1
  15. package/dist/node_modules/decompress/package.json +1 -1
  16. package/dist/node_modules/mkdirp/package.json +1 -1
  17. package/dist/node_modules/semver/package.json +1 -1
  18. package/dist/server/app-migrator.d.ts +8 -0
  19. package/dist/server/app-migrator.js +9 -0
  20. package/dist/server/commands/restore-command.d.ts +8 -0
  21. package/dist/server/commands/restore-command.js +9 -0
  22. package/dist/server/dumper.d.ts +8 -0
  23. package/dist/server/dumper.js +9 -0
  24. package/dist/server/errors/restore-check-error.d.ts +8 -0
  25. package/dist/server/errors/restore-check-error.js +9 -0
  26. package/dist/server/field-value-writer.d.ts +8 -0
  27. package/dist/server/field-value-writer.js +9 -0
  28. package/dist/server/index.d.ts +8 -0
  29. package/dist/server/index.js +9 -0
  30. package/dist/server/locale/zh-CN.d.ts +8 -0
  31. package/dist/server/locale/zh-CN.js +9 -0
  32. package/dist/server/resourcers/backup-files.d.ts +8 -0
  33. package/dist/server/resourcers/backup-files.js +9 -0
  34. package/dist/server/restorer.d.ts +8 -0
  35. package/dist/server/restorer.js +43 -2
  36. package/dist/server/server.d.ts +8 -0
  37. package/dist/server/server.js +9 -0
  38. package/dist/server/utils.d.ts +8 -0
  39. package/dist/server/utils.js +9 -0
  40. package/dist/swagger/index.d.ts +8 -0
  41. package/dist/swagger/index.js +9 -0
  42. package/package.json +2 -2
@@ -1,2 +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
+ */
1
9
  import React from 'react';
2
10
  export declare const BackupAndRestoreList: () => React.JSX.Element;
@@ -1,2 +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
+ */
1
9
  import { FC } from 'react';
2
10
  export declare const DuplicatorProvider: FC;
@@ -1,3 +1,11 @@
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
+ */
1
9
  import { Plugin } from '@nocobase/client';
2
10
  export declare class PluginBackupRestoreClient extends Plugin {
3
11
  load(): Promise<void>;
@@ -1 +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
+
1
10
  (function(d,i){typeof exports=="object"&&typeof module!="undefined"?i(exports,require("@nocobase/client"),require("react/jsx-runtime"),require("@ant-design/icons"),require("@formily/antd-v5"),require("antd"),require("react"),require("react-i18next")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client","react/jsx-runtime","@ant-design/icons","@formily/antd-v5","antd","react","react-i18next"],i):(d=typeof globalThis!="undefined"?globalThis:d||self,i(d["@nocobase/plugin-backup-restore"]={},d["@nocobase/client"],d.jsxRuntime,d["@ant-design/icons"],d["@formily/antd-v5"],d.antd,d.react,d["react-i18next"]))})(this,function(d,i,e,x,q,h,g,E){"use strict";var Z=Object.defineProperty,R=Object.defineProperties;var ee=Object.getOwnPropertyDescriptors;var z=Object.getOwnPropertySymbols;var te=Object.prototype.hasOwnProperty,oe=Object.prototype.propertyIsEnumerable;var W=(d,i,e)=>i in d?Z(d,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):d[i]=e,L=(d,i)=>{for(var e in i||(i={}))te.call(i,e)&&W(d,e,i[e]);if(z)for(var e of z(i))oe.call(i,e)&&W(d,e,i[e]);return d},D=(d,i)=>R(d,ee(i));var S=(d,i,e)=>new Promise((x,q)=>{var h=m=>{try{E(e.next(m))}catch(M){q(M)}},g=m=>{try{E(e.throw(m))}catch(M){q(M)}},E=m=>m.done?x(m.value):Promise.resolve(m.value).then(h,g);E((e=e.apply(d,i)).next())});var m=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},M={exports:{}};(function(a,k){(function(p,l){l()})(m,function(){function p(t,o){return typeof o=="undefined"?o={autoBom:!1}:typeof o!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),o={autoBom:!o}),o.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\uFEFF",t],{type:t.type}):t}function l(t,o,b){var n=new XMLHttpRequest;n.open("GET",t),n.responseType="blob",n.onload=function(){v(n.response,o,b)},n.onerror=function(){console.error("could not download file")},n.send()}function c(t){var o=new XMLHttpRequest;o.open("HEAD",t,!1);try{o.send()}catch(b){}return 200<=o.status&&299>=o.status}function f(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(b){var o=document.createEvent("MouseEvents");o.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(o)}}var u=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof m=="object"&&m.global===m?m:void 0,w=u.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),v=u.saveAs||(typeof window!="object"||window!==u?function(){}:"download"in HTMLAnchorElement.prototype&&!w?function(t,o,b){var n=u.URL||u.webkitURL,r=document.createElement("a");o=o||t.name||"download",r.download=o,r.rel="noopener",typeof t=="string"?(r.href=t,r.origin===location.origin?f(r):c(r.href)?l(t,o,b):f(r,r.target="_blank")):(r.href=n.createObjectURL(t),setTimeout(function(){n.revokeObjectURL(r.href)},4e4),setTimeout(function(){f(r)},0))}:"msSaveOrOpenBlob"in navigator?function(t,o,b){if(o=o||t.name||"download",typeof t!="string")navigator.msSaveOrOpenBlob(p(t,b),o);else if(c(t))l(t,o,b);else{var n=document.createElement("a");n.href=t,n.target="_blank",setTimeout(function(){f(n)})}}:function(t,o,b,n){if(n=n||open("","_blank"),n&&(n.document.title=n.document.body.innerText="downloading..."),typeof t=="string")return l(t,o,b);var r=t.type==="application/octet-stream",s=/constructor/i.test(u.HTMLElement)||u.safari,y=/CriOS\/[\d]+/.test(navigator.userAgent);if((y||r&&s||w)&&typeof FileReader!="undefined"){var C=new FileReader;C.onloadend=function(){var T=C.result;T=y?T:T.replace(/^data:[^;]*;/,"data:attachment/file;"),n?n.location.href=T:location=T,n=null},C.readAsDataURL(t)}else{var B=u.URL||u.webkitURL,A=B.createObjectURL(t);n?n.location=A:location.href=A,n=null,setTimeout(function(){B.revokeObjectURL(A)},4e4)}});u.saveAs=v.saveAs=v,a.exports=v})})(M);var K=M.exports;const I="backup-restore";function P(){return E.useTranslation(I,{nsMode:"fallback"})}const{Dragger:X}=h.Upload;function J(a){const k=l=>{var c;(c=a.onChange)==null||c.call(a,l)},p=i.useAPIClient();return D(L({},a),{customRequest({action:l,data:c,file:f,filename:u,headers:w,onError:v,onProgress:t,onSuccess:o,withCredentials:b}){const n=new FormData;return c&&Object.keys(c).forEach(r=>{n.append(r,c[r])}),n.append(u,f),p.axios.post(l,n,{withCredentials:b,headers:w,onUploadProgress:({total:r,loaded:s})=>{t({percent:Math.round(s/r*100).toFixed(2)},f)}}).then(({data:r})=>{o(r,f)}).catch(v).finally(()=>{}),{abort(){console.log("upload progress is aborted.")}}},onChange:k})}const U=a=>{const{collectionsData:k}=a,{t:p}=P(),[l,c]=g.useState(!1),[f,u]=g.useState(k);g.useEffect(()=>{u(k)},[k]);const w=i.useAPIClient(),v=i.useCompile(),t=g.useMemo(()=>w.resource("backupFiles"),[w]),o=()=>S(this,null,function*(){if(a.isBackup){const y=yield t.dumpableCollections();u(y==null?void 0:y.data),c(!0)}c(!0)}),b=()=>{c(!1)},n=()=>{c(!1)},r=[{title:p("Collection"),dataIndex:"collection",key:"collection",render:(y,C)=>{const B=v(C.title);return C.name===B?B:e.jsxs("div",{children:[C.name," ",e.jsxs("span",{style:{color:"rgba(0, 0, 0, 0.3)",fontSize:"0.9em"},children:["(",v(C.title),")"]})]})}},{title:p("Origin"),dataIndex:"origin",key:"origin",width:"50%"}],s=Object.keys(f||{}).map(y=>({key:y,label:p(`${y}.title`),children:e.jsxs(e.Fragment,{children:[e.jsx(h.Alert,{style:{marginBottom:16},message:p(`${y}.description`)}),e.jsx(h.Table,{pagination:{pageSize:100},bordered:!0,size:"small",dataSource:f[y],columns:r,scroll:{y:400}})]})}));return e.jsxs(e.Fragment,{children:[e.jsx("a",{onClick:o,children:p("Learn more")}),e.jsx(h.Modal,{title:p("Backup instructions"),width:"80vw",open:l,footer:null,onOk:b,onCancel:n,children:e.jsx(h.Tabs,{defaultActiveKey:"required",items:s})})]})},G=({ButtonComponent:a=h.Button,title:k,upload:p=!1,fileData:l})=>{const{t:c}=P(),[f,u]=g.useState(["required"]),[w,v]=g.useState(!1),[t,o]=g.useState(null),[b,n]=g.useState(!1),r=i.useAPIClient(),s=g.useMemo(()=>r.resource("backupFiles"),[r]),[y,C]=g.useState([]);g.useEffect(()=>{C(Object.keys((t==null?void 0:t.dumpableCollectionsGroupByGroup)||[]).map(O=>({value:O,label:c(`${O}.title`),disabled:["required","skipped"].includes(O)})))},[t]);const B=()=>S(this,null,function*(){var O,N,$;if(v(!0),!p){n(!0);const{data:F}=yield s.get({filterByTk:l.name});C(Object.keys(((N=(O=F==null?void 0:F.data)==null?void 0:O.meta)==null?void 0:N.dumpableCollectionsGroupByGroup)||[]).map(j=>({value:j,label:c(`${j}.title`),disabled:["required","skipped"].includes(j)}))),o(($=F==null?void 0:F.data)==null?void 0:$.meta),n(!1)}}),A=()=>{s.restore({values:{dataTypes:f,filterByTk:l==null?void 0:l.name,key:t==null?void 0:t.key}}),v(!1)},T=()=>{v(!1),o(null),u(["required"])};return e.jsxs(e.Fragment,{children:[e.jsx(a,{onClick:B,children:k}),e.jsx(h.Modal,{title:c("Restore"),width:800,footer:p&&!t?null:void 0,open:w,onOk:A,onCancel:T,children:e.jsxs(h.Spin,{spinning:b,children:[p&&!t&&e.jsx(V,{setRestoreData:o}),(!p||t)&&[e.jsxs("strong",{style:{fontWeight:600,display:"block",margin:"16px 0 8px"},children:[c("Select the data to be restored")," (",e.jsx(U,{collectionsData:t==null?void 0:t.dumpableCollectionsGroupByGroup}),"):"]},"info"),e.jsx("div",{style:{lineHeight:2,marginBottom:8},children:e.jsx(q.FormItem,{children:e.jsx(i.Checkbox.Group,{options:y,style:{flexDirection:"column"},value:f,onChange:O=>u(O)})})},"dataType")]]})})]})},Q=({ButtonComponent:a=h.Button,refresh:k})=>{const{t:p}=P(),[l,c]=g.useState(!1),[f,u]=g.useState(["required"]),w=i.useAPIClient(),[v,t]=g.useState([]),o=()=>S(this,null,function*(){const{data:r}=yield w.resource("backupFiles").dumpableCollections();t(Object.keys(r||[]).map(s=>({value:s,label:p(`${s}.title`),disabled:["required","skipped"].includes(s)}))),c(!0)}),b=()=>{w.request({url:"backupFiles:create",method:"post",data:{dataTypes:f}}),c(!1),u(["required"]),setTimeout(()=>{k()},500)},n=()=>{c(!1),u(["required"])};return e.jsxs(e.Fragment,{children:[e.jsx(a,{icon:e.jsx(x.PlusOutlined,{}),type:"primary",onClick:o,children:p("New backup")}),e.jsxs(h.Modal,{title:p("New backup"),width:800,open:l,onOk:b,onCancel:n,children:[e.jsxs("strong",{style:{fontWeight:600,display:"block",margin:"16px 0 8px"},children:[p("Select the data to be backed up")," (",e.jsx(U,{isBackup:!0}),"):"]}),e.jsx("div",{style:{lineHeight:2,marginBottom:8},children:e.jsx(i.Checkbox.Group,{options:v,style:{flexDirection:"column"},onChange:r=>u(r),value:f})})]})]})},V=a=>{const{t:k}=P(),p={multiple:!1,action:"/backupFiles:upload",onChange(l){var f,u,w;l.fileList.length>1&&l.fileList.splice(0,l.fileList.length-1);const{status:c}=l.file;c==="done"?(h.message.success(`${l.file.name} `+k("file uploaded successfully")),a.setRestoreData(D(L({},(u=(f=l.file.response)==null?void 0:f.data)==null?void 0:u.meta),{key:(w=l.file.response)==null?void 0:w.data.key}))):c==="error"&&h.message.error(`${l.file.name} `+k("file upload failed"))},onDrop(l){console.log("Dropped files",l.dataTransfer.files)}};return e.jsxs(X,D(L({},J(p)),{children:[e.jsx("p",{className:"ant-upload-drag-icon",children:e.jsx(x.InboxOutlined,{})}),e.jsxs("p",{className:"ant-upload-text",children:[" ",k("Click or drag file to this area to upload")]})]}))},Y=()=>{const{t:a}=P(),k=i.useAPIClient(),[p,l]=g.useState([]),[c,f]=g.useState(!1),[u,w]=g.useState(!1),{modal:v}=h.App.useApp(),t=g.useMemo(()=>k.resource("backupFiles"),[k]);g.useEffect(()=>{o()},[]);const o=()=>S(this,null,function*(){f(!0);const{data:s}=yield t.list();l(s.data),f(!1)}),b=s=>S(this,null,function*(){w(s.name);const y=yield k.request({url:"backupFiles:download",method:"get",params:{filterByTk:s.name},responseType:"blob"});w(!1);const C=new Blob([y.data]);K.saveAs(C,s.name)}),n=()=>S(this,null,function*(){yield o()}),r=s=>{v.confirm({title:a("Delete record",{ns:"client"}),content:a("Are you sure you want to delete it?",{ns:"client"}),onOk:()=>S(this,null,function*(){yield t.destroy({filterByTk:s.name}),yield o(),h.message.success(a("Deleted successfully"))})})};return e.jsx("div",{children:e.jsxs(h.Card,{bordered:!1,children:[e.jsxs(h.Space,{style:{float:"right",marginBottom:16},children:[e.jsx(h.Button,{onClick:n,icon:e.jsx(x.ReloadOutlined,{}),children:a("Refresh")}),e.jsx(G,{upload:!0,title:e.jsxs(e.Fragment,{children:[e.jsx(x.UploadOutlined,{})," ",a("Restore backup from local")]})}),e.jsx(Q,{refresh:n})]}),e.jsx(h.Table,{dataSource:p,loading:c,columns:[{title:a("Backup file"),dataIndex:"name",width:400,onCell:s=>s.inProgress?{colSpan:4}:{},render:(s,y)=>y.inProgress?e.jsxs("div",{style:{color:"rgba(0, 0, 0, 0.88)"},children:[s,"(",a("Backing up"),"...)"]}):e.jsx("div",{children:s})},{title:a("File size"),dataIndex:"fileSize",onCell:s=>s.inProgress?{colSpan:0}:{}},{title:a("Created at",{ns:"client"}),dataIndex:"createdAt",onCell:s=>s.inProgress?{colSpan:0}:{},render:s=>e.jsx(i.DatePicker.ReadPretty,{value:s,showTime:!0})},{title:a("Actions",{ns:"client"}),dataIndex:"actions",onCell:s=>s.inProgress?{colSpan:0}:{},render:(s,y)=>e.jsxs(h.Space,{split:e.jsx(h.Divider,{type:"vertical"}),children:[e.jsx(G,{ButtonComponent:"a",title:a("Restore"),fileData:y}),e.jsx("a",{type:"link",onClick:()=>b(y),children:a("Download")}),e.jsx("a",{onClick:()=>r(y),children:a("Delete")})]})}]})]})})},_=function(a){return e.jsx(i.SchemaComponentOptions,{children:a.children})};_.displayName="DuplicatorProvider";class H extends i.Plugin{load(){return S(this,null,function*(){this.app.use(_),this.app.pluginSettingsManager.add(I,{title:this.t("Backup & Restore"),icon:"CloudServerOutlined",Component:Y,aclSnippet:"pm.backup.restore"})})}}d.PluginBackupRestoreClient=H,d.default=H,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1,3 +1,11 @@
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
+ */
1
9
  export declare const NAMESPACE = "backup-restore";
2
10
  export declare function lang(key: string): string;
3
11
  export declare function generateNTemplate(key: string): string;
@@ -1,14 +1,23 @@
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
+
1
10
  module.exports = {
2
11
  "@ant-design/icons": "5.2.6",
3
12
  "@formily/antd-v5": "1.1.9",
4
- "@nocobase/client": "1.0.0-alpha.2",
13
+ "@nocobase/client": "1.0.0-alpha.3",
5
14
  "antd": "5.12.8",
6
15
  "react": "18.2.0",
7
- "@nocobase/server": "1.0.0-alpha.2",
8
- "@nocobase/utils": "1.0.0-alpha.2",
9
- "@nocobase/database": "1.0.0-alpha.2",
16
+ "@nocobase/server": "1.0.0-alpha.3",
17
+ "@nocobase/utils": "1.0.0-alpha.3",
18
+ "@nocobase/database": "1.0.0-alpha.3",
10
19
  "dayjs": "1.11.10",
11
20
  "lodash": "4.17.21",
12
21
  "react-i18next": "11.18.6",
13
- "@nocobase/actions": "1.0.0-alpha.2"
22
+ "@nocobase/actions": "1.0.0-alpha.3"
14
23
  };
package/dist/index.d.ts CHANGED
@@ -1,2 +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
+ */
1
9
  export * from './server';
2
10
  export { default } from './server';
package/dist/index.js CHANGED
@@ -1,3 +1,12 @@
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
+
1
10
  var __create = Object.create;
2
11
  var __defProp = Object.defineProperty;
3
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,3 +1,11 @@
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
+ */
1
9
  declare const _default: {
2
10
  'System metadata': string;
3
11
  'System config': string;
@@ -1,3 +1,12 @@
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
+
1
10
  var __defProp = Object.defineProperty;
2
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -1,3 +1,11 @@
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
+ */
1
9
  declare const locale: {
2
10
  'System metadata': string;
3
11
  'System config': string;
@@ -1,3 +1,12 @@
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
+
1
10
  var __defProp = Object.defineProperty;
2
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -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":"2024-04-29T05:07:56.343Z"}
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":"2024-04-30T08:27:24.169Z"}
@@ -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":"2024-04-29T05:07:55.178Z"}
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":"2024-04-30T08:27:23.052Z"}
@@ -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":"2024-04-29T05:07:56.126Z"}
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":"2024-04-30T08:27:23.961Z"}
@@ -1 +1 @@
1
- {"name":"mkdirp","description":"Recursively mkdir, like `mkdir -p`","version":"1.0.4","main":"index.js","keywords":["mkdir","directory","make dir","make","dir","recursive","native"],"repository":{"type":"git","url":"https://github.com/isaacs/node-mkdirp.git"},"scripts":{"test":"tap","snap":"tap","preversion":"npm test","postversion":"npm publish","postpublish":"git push origin --follow-tags"},"tap":{"check-coverage":true,"coverage-map":"map.js"},"devDependencies":{"require-inject":"^1.4.4","tap":"^14.10.7"},"bin":"bin/cmd.js","license":"MIT","engines":{"node":">=10"},"files":["bin","lib","index.js"],"_lastModified":"2024-04-29T05:07:55.318Z"}
1
+ {"name":"mkdirp","description":"Recursively mkdir, like `mkdir -p`","version":"1.0.4","main":"index.js","keywords":["mkdir","directory","make dir","make","dir","recursive","native"],"repository":{"type":"git","url":"https://github.com/isaacs/node-mkdirp.git"},"scripts":{"test":"tap","snap":"tap","preversion":"npm test","postversion":"npm publish","postpublish":"git push origin --follow-tags"},"tap":{"check-coverage":true,"coverage-map":"map.js"},"devDependencies":{"require-inject":"^1.4.4","tap":"^14.10.7"},"bin":"bin/cmd.js","license":"MIT","engines":{"node":">=10"},"files":["bin","lib","index.js"],"_lastModified":"2024-04-30T08:27:23.160Z"}
@@ -1 +1 @@
1
- {"name":"semver","version":"7.5.4","description":"The semantic version parser used by npm.","main":"index.js","scripts":{"test":"tap","snap":"tap","lint":"eslint \"**/*.js\"","postlint":"template-oss-check","lintfix":"npm run lint -- --fix","posttest":"npm run lint","template-oss-apply":"template-oss-apply --force"},"devDependencies":{"@npmcli/eslint-config":"^4.0.0","@npmcli/template-oss":"4.17.0","tap":"^16.0.0"},"license":"ISC","repository":{"type":"git","url":"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"},"dependencies":{"lru-cache":"^6.0.0"},"author":"GitHub Inc.","templateOSS":{"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten.","version":"4.17.0","engines":">=10","ciVersions":["10.0.0","10.x","12.x","14.x","16.x","18.x"],"npmSpec":"8","distPaths":["classes/","functions/","internal/","ranges/","index.js","preload.js","range.bnf"],"allowPaths":["/classes/","/functions/","/internal/","/ranges/","/index.js","/preload.js","/range.bnf"],"publish":"true"},"_lastModified":"2024-04-29T05:07:56.710Z"}
1
+ {"name":"semver","version":"7.5.4","description":"The semantic version parser used by npm.","main":"index.js","scripts":{"test":"tap","snap":"tap","lint":"eslint \"**/*.js\"","postlint":"template-oss-check","lintfix":"npm run lint -- --fix","posttest":"npm run lint","template-oss-apply":"template-oss-apply --force"},"devDependencies":{"@npmcli/eslint-config":"^4.0.0","@npmcli/template-oss":"4.17.0","tap":"^16.0.0"},"license":"ISC","repository":{"type":"git","url":"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"},"dependencies":{"lru-cache":"^6.0.0"},"author":"GitHub Inc.","templateOSS":{"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten.","version":"4.17.0","engines":">=10","ciVersions":["10.0.0","10.x","12.x","14.x","16.x","18.x"],"npmSpec":"8","distPaths":["classes/","functions/","internal/","ranges/","index.js","preload.js","range.bnf"],"allowPaths":["/classes/","/functions/","/internal/","/ranges/","/index.js","/preload.js","/range.bnf"],"publish":"true"},"_lastModified":"2024-04-30T08:27:24.518Z"}
@@ -1,3 +1,11 @@
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
+ */
1
9
  /// <reference types="node" />
2
10
  import { Application } from '@nocobase/server';
3
11
  import EventEmitter from 'events';
@@ -1,3 +1,12 @@
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
+
1
10
  var __create = Object.create;
2
11
  var __defProp = Object.defineProperty;
3
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,2 +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
+ */
1
9
  import { Application } from '@nocobase/server';
2
10
  export default function addRestoreCommand(app: Application): void;
@@ -1,3 +1,12 @@
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
+
1
10
  var __defProp = Object.defineProperty;
2
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -1,3 +1,11 @@
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
+ */
1
9
  import { DumpRulesGroupType } from '@nocobase/database';
2
10
  import { AppMigrator } from './app-migrator';
3
11
  type DumpOptions = {
@@ -1,3 +1,12 @@
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
+
1
10
  var __create = Object.create;
2
11
  var __defProp = Object.defineProperty;
3
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,3 +1,11 @@
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
+ */
1
9
  export declare class RestoreCheckError extends Error {
2
10
  constructor(message: any);
3
11
  }
@@ -1,3 +1,12 @@
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
+
1
10
  var __defProp = Object.defineProperty;
2
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -1,3 +1,11 @@
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
+ */
1
9
  import { Field } from '@nocobase/database';
2
10
  type WriterFunc = (val: any) => any;
3
11
  export declare class FieldValueWriter {
@@ -1,3 +1,12 @@
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
+
1
10
  var __create = Object.create;
2
11
  var __defProp = Object.defineProperty;
3
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1 +1,9 @@
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
+ */
1
9
  export { default } from './server';
@@ -1,3 +1,12 @@
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
+
1
10
  var __create = Object.create;
2
11
  var __defProp = Object.defineProperty;
3
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,3 +1,11 @@
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
+ */
1
9
  declare const _default: {
2
10
  'Select Import data': string;
3
11
  'Select Import Plugins': string;
@@ -1,3 +1,12 @@
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
+
1
10
  var __defProp = Object.defineProperty;
2
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -1,3 +1,11 @@
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
+ */
1
9
  declare const _default: {
2
10
  name: string;
3
11
  middleware: (ctx: any, next: any) => Promise<any>;
@@ -1,3 +1,12 @@
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
+
1
10
  var __create = Object.create;
2
11
  var __defProp = Object.defineProperty;
3
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,3 +1,11 @@
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
+ */
1
9
  import { AppMigrator, AppMigratorOptions } from './app-migrator';
2
10
  import { Application } from '@nocobase/server';
3
11
  import { DumpRulesGroupType } from '@nocobase/database';
@@ -1,3 +1,12 @@
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
+
1
10
  var __create = Object.create;
2
11
  var __defProp = Object.defineProperty;
3
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -42,6 +51,34 @@ var import_field_value_writer = require("./field-value-writer");
42
51
  var Topo = __toESM(require("@hapi/topo"));
43
52
  var import_restore_check_error = require("./errors/restore-check-error");
44
53
  var import_semver = __toESM(require("semver"));
54
+ const renamePlugins = async (app) => {
55
+ const names = {
56
+ oidc: "@nocobase/plugin-auth-oidc",
57
+ cas: "@nocobase/plugin-auth-cas",
58
+ saml: "@nocobase/plugin-auth-saml",
59
+ "collection-manager": "@nocobase/plugin-data-source-main",
60
+ "china-region": "@nocobase/plugin-field-china-region",
61
+ "custom-request": "@nocobase/plugin-action-custom-request",
62
+ export: "@nocobase/plugin-action-export",
63
+ import: "@nocobase/plugin-action-import",
64
+ "formula-field": "@nocobase/plugin-field-formula",
65
+ "iframe-block": "@nocobase/plugin-block-iframe",
66
+ "localization-management": "@nocobase/plugin-localization",
67
+ "sequence-field": "@nocobase/plugin-field-sequence",
68
+ "sms-auth": "@nocobase/plugin-auth-sms"
69
+ };
70
+ for (const original of Object.keys(names)) {
71
+ await app.pm.repository.update({
72
+ filter: {
73
+ name: original
74
+ },
75
+ values: {
76
+ name: names[original].replace("@nocobase/plugin-", ""),
77
+ packageName: names[original]
78
+ }
79
+ });
80
+ }
81
+ };
45
82
  class Restorer extends import_app_migrator.AppMigrator {
46
83
  direction = "restore";
47
84
  backUpFilePath;
@@ -119,12 +156,16 @@ class Restorer extends import_app_migrator.AppMigrator {
119
156
  name: collectionName
120
157
  });
121
158
  };
159
+ const preImportCollections = ["applicationPlugins"];
122
160
  const { dumpableCollectionsGroupByGroup, delayCollections } = await this.parseBackupFile();
123
- await importCollection("applicationPlugins");
161
+ for (const collectionName of preImportCollections) {
162
+ await importCollection(collectionName);
163
+ }
164
+ await renamePlugins(this.app);
124
165
  await this.app.reload();
125
166
  const metaCollections = dumpableCollectionsGroupByGroup.required;
126
167
  for (const collection of metaCollections) {
127
- if (collection.name === "applicationPlugins") {
168
+ if (preImportCollections.includes(collection.name)) {
128
169
  continue;
129
170
  }
130
171
  if (delayCollections.includes(collection.name)) {
@@ -1,3 +1,11 @@
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
+ */
1
9
  import { Plugin } from '@nocobase/server';
2
10
  export default class PluginBackupRestoreServer extends Plugin {
3
11
  beforeLoad(): void;
@@ -1,3 +1,12 @@
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
+
1
10
  var __create = Object.create;
2
11
  var __defProp = Object.defineProperty;
3
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,3 +1,11 @@
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
+ */
1
9
  import { Database } from '@nocobase/database';
2
10
  export declare const DUMPED_EXTENSION = "nbdump";
3
11
  export declare function sqlAdapter(database: Database, sql: string): string;
@@ -1,3 +1,12 @@
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
+
1
10
  var __create = Object.create;
2
11
  var __defProp = Object.defineProperty;
3
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,3 +1,11 @@
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
+ */
1
9
  declare const _default: {
2
10
  info: {
3
11
  title: string;
@@ -1,3 +1,12 @@
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
+
1
10
  var __defProp = Object.defineProperty;
2
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "displayName.zh-CN": "应用的备份与还原",
5
5
  "description": "Backup and restore applications for scenarios such as application replication, migration, and upgrades.",
6
6
  "description.zh-CN": "备份和还原应用,可用于应用的复制、迁移、升级等场景。",
7
- "version": "1.0.0-alpha.2",
7
+ "version": "1.0.0-alpha.3",
8
8
  "license": "AGPL-3.0",
9
9
  "main": "./dist/server/index.js",
10
10
  "homepage": "https://docs.nocobase.com/handbook/backup-restore",
@@ -41,5 +41,5 @@
41
41
  "keywords": [
42
42
  "System management"
43
43
  ],
44
- "gitHead": "f89dbc9e67d58404a2e484a5e124f739f340dcf8"
44
+ "gitHead": "7ccb137c7616cba5d238f87368239640e1d9ace1"
45
45
  }