plugin-migration-manager 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/client-v2.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from './dist/client-v2';
2
+ export { default } from './dist/client-v2';
package/client-v2.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./dist/client-v2/index.js');
@@ -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
+ "use strict";(self.webpackChunkplugin_migration_manager_client_v2=self.webpackChunkplugin_migration_manager_client_v2||[]).push([["946"],{433:function(e,t,n){n.r(t),n.d(t,{default:function(){return T}});var r=n(155),l=n.n(r),o=n(59),a=n(375),i=n(694),c=n(625),u=JSON.parse('{"UU":"plugin-migration-manager"}');function s(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 m(e,t,n,r,l,o,a){try{var i=e[o](a),c=i.value}catch(e){n(e);return}i.done?t(c):Promise.resolve(c).then(r,l)}function d(e){return function(){var t=this,n=arguments;return new Promise(function(r,l){var o=e.apply(t,n);function a(e){m(o,r,l,a,i,"next",e)}function i(e){m(o,r,l,a,i,"throw",e)}a(void 0)})}}function p(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 f(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 g(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 o=[],a=!0,i=!1;try{for(l=l.call(e);!(a=(n=l.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){i=!0,r=e}finally{try{a||null==l.return||l.return()}finally{if(i)throw r}}return o}}(e,t)||h(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 y(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||h(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){if(e){if("string"==typeof e)return s(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 s(e,t)}}function w(e,t){var n,r,l,o={label:0,sent:function(){if(1&l[0])throw l[1];return l[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(a,"next",{value:c(0)}),i(a,"throw",{value:c(1)}),i(a,"return",{value:c(2)}),"function"==typeof Symbol&&i(a,Symbol.iterator,{value:function(){return this}}),a;function c(i){return function(c){var u=[i,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(o=0)),o;)try{if(n=1,r&&(l=2&u[0]?r.return:u[0]?r.throw||((l=r.return)&&l.call(r),0):r.next)&&!(l=l.call(r,u[1])).done)return l;switch(r=0,l&&(u=[2&u[0],l.value]),u[0]){case 0:case 1:l=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(l=(l=o.trys).length>0&&l[l.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!l||u[1]>l[0]&&u[1]<l[3])){o.label=u[1];break}if(6===u[0]&&o.label<l[1]){o.label=l[1],l=u;break}if(l&&o.label<l[2]){o.label=l[2],o.ops.push(u);break}l[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],r=0}finally{n=l=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}var v=o.Typography.Title,b=o.Typography.Text,S=o.Input.Search;function E(e){return(void 0===e?"undefined":e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)=="object"&&null!==e}function k(e){return E(e)&&E(e.data)?"data"in e.data?e.data.data:e.data:e}function O(e,t){var n;return(null!=(n=Error)&&"u">typeof Symbol&&n[Symbol.hasInstance]?!!n[Symbol.hasInstance](e):e instanceof n)?e.message:t}function C(e){return e?e.replace(/\{\{t\("(.+?)"\)\}\}/g,"$1").replace(/_/g," ").replace(/\b\w/g,function(e){return e.toUpperCase()}):""}function x(e){return new Promise(function(t){return setTimeout(t,e)})}function j(e){return null==e?"":String(e)}function I(e){var t,n,r,l;return{collections:(null==(t=e.collections)?void 0:t.length)||0,workflows:(null==(n=e.workflows)?void 0:n.length)||0,uiSchemas:(null==(r=e.uiSchemas)?void 0:r.length)||0,desktopRoutes:(null==(l=e.desktopRoutes)?void 0:l.length)||0}}function T(){var e,t=(0,i.useFlowContext)(),n=(e=(0,i.useFlowEngine)(),function(t,n){var r,l;return e.context.t(t,(r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},n),l=l={ns:[u.UU,"client"]},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(l)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(l)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(l,e))}),r))}),s=t.api,m=g((0,r.useState)("export"),2),h=m[0],T=m[1],z=g((0,r.useState)({collections:[],workflows:[],uiSchemas:[]}),2),P=z[0],U=z[1],A=g((0,r.useState)([]),2),R=A[0],D=A[1],M=g((0,r.useState)([]),2),L=M[0],N=M[1],q=g((0,r.useState)([]),2),W=q[0],K=q[1],B=g((0,r.useState)(!1),2),_=B[0],F=B[1],J=g((0,r.useState)(!1),2),G=J[0],V=J[1],$=g((0,r.useState)(null),2),H=$[0],Y=$[1],Q=g((0,r.useState)(!1),2),X=Q[0],Z=Q[1],ee=g((0,r.useState)(""),2),et=ee[0],en=ee[1],er=g((0,r.useState)(""),2),el=er[0],eo=er[1],ea=g((0,r.useState)(""),2),ei=ea[0],ec=ea[1],eu=g((0,r.useState)({current:1,pageSize:10}),2),es=eu[0],em=eu[1],ed=g((0,r.useState)({current:1,pageSize:10}),2),ep=ed[0],ef=ed[1],eg=g((0,r.useState)({current:1,pageSize:10}),2),ey=eg[0],eh=eg[1];(0,r.useEffect)(function(){var e=function(e){(_||G)&&(e.preventDefault(),e.returnValue="")};return window.addEventListener("beforeunload",e),function(){return window.removeEventListener("beforeunload",e)}},[_,G]);var ew=(0,c.useRequest)(function(){return s.request({url:"migration:list",method:"get"})},{onSuccess:function(e){var t,n,r,l=k(e);U({collections:null!=(t=null==l?void 0:l.collections)?t:[],workflows:null!=(n=null==l?void 0:l.workflows)?n:[],uiSchemas:null!=(r=null==l?void 0:l.uiSchemas)?r:[]})},onError:function(){return U({collections:[],workflows:[],uiSchemas:[]})}}),ev=ew.run,eb=ew.loading,eS=(0,c.useRequest)(function(e){return s.request({url:"migration:export",method:"post",data:{data:e}})},{manual:!0,onSuccess:function(e){var t=k(e),r=I(t||{});if(!(r.collections>0||r.workflows>0||r.uiSchemas>0||r.desktopRoutes>0))return void o.message.warning(n("Export succeeded but no data."));var l=new Blob([JSON.stringify(t,null,2)],{type:"application/json"}),a=URL.createObjectURL(l),i=document.createElement("a");i.href=a,i.download="nocobase-migration-".concat(Date.now(),".json"),i.click(),URL.revokeObjectURL(a),o.message.success(n("Export successful! {{collections}} collections, {{workflows}} workflows, {{uiSchemas}} UI schemas, {{routes}} routes",{collections:r.collections,workflows:r.workflows,uiSchemas:r.uiSchemas,routes:r.desktopRoutes}))},onError:function(e){return o.message.error(n("Export failed: {{message}}",{message:O(e,n("Unknown error"))}))}}),eE=eS.run,ek=eS.loading,eO=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e4,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2e3;return d(function(){return w(this,function(n){switch(n.label){case 0:F(!0),n.label=1;case 1:return n.trys.push([1,,5,6]),[4,s.request({url:"app:restart",method:"post",timeout:6e4})];case 2:return n.sent(),[4,x(e)];case 3:return n.sent(),[4,x(t)];case 4:return n.sent(),[3,6];case 5:return F(!1),[7];case 6:return[2]}})})()},eC=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1500;return d(function(){var l,o,a,i,c;return w(this,function(u){switch(u.label){case 0:l=null,o=0,u.label=1;case 1:if(!(o<t))return[3,8];u.label=2;case 2:return u.trys.push([2,4,,7]),[4,s.request({url:"migration:apply",method:"post",data:{data:{collections:e}},headers:{"Content-Type":"application/json"},timeout:6e5})];case 3:return[2,k(u.sent())];case 4:if(l=a=u.sent(),i=E(a)&&E(a.response)?a.response.status:void 0,c=O(a,""),!(503===i||c.includes("APP_COMMANDING")))return[3,6];return[4,x(r)];case 5:return u.sent(),[3,7];case 6:throw a;case 7:return o+=1,[3,1];case 8:throw l||Error(n("Apply failed after several attempts."))}})})()},ex=(0,c.useRequest)(function(e){return s.request({url:"migration:import",method:"post",data:{data:e},headers:{"Content-Type":"application/json"},timeout:6e5})},{manual:!0,onSuccess:function(e){return d(function(){var t,r,i,c,u,s,m,g,h,v,b,S,E,C,x;return w(this,function(I){return(b=(v=k(e)||{}).needsConfirmation,S=v.results,b)?(C=(null==S||null==(E=S.collections)?void 0:E.conflicts)||[],o.Modal.confirm({title:n("Confirm Potentially Data-Altering Changes"),icon:l().createElement(a.ExclamationCircleOutlined,null),width:760,okText:n("Proceed & Override"),cancelText:n("Cancel"),content:l().createElement("div",null,l().createElement(o.Alert,{type:"warning",showIcon:!0,message:n("Conflicts were found on existing fields."),style:{marginBottom:12}}),l().createElement("div",{style:{maxHeight:360,overflow:"auto"}},l().createElement(o.Table,{size:"small",pagination:!1,rowKey:function(e){return"".concat(e.collection,".").concat(e.field)},dataSource:C,columns:[{title:n("Collection"),dataIndex:"collection"},{title:n("Field"),dataIndex:"field"},{title:n("Current"),render:function(e,t){return"type=".concat(j(t.current.type),", interface=").concat(j(t.current.interface),", unique=").concat(j(t.current.unique),", allowNull=").concat(j(t.current.allowNull),", pk=").concat(j(t.current.primaryKey))}},{title:n("Incoming"),render:function(e,t){return"type=".concat(j(t.incoming.type),", interface=").concat(j(t.incoming.interface),", unique=").concat(j(t.incoming.unique),", allowNull=").concat(j(t.incoming.allowNull),", pk=").concat(j(t.incoming.primaryKey))}}]}))),onOk:function(){H&&(Z(!1),ej(f(p({},H),{options:{forceOverride:!0}})))}})):X&&H?(Z(!1),ej(H)):(x=y((null==S||null==(t=S.collections)?void 0:t.errors)||[]).concat(y((null==S||null==(r=S.workflows)?void 0:r.errors)||[]),y((null==S||null==(i=S.uiSchemas)?void 0:i.errors)||[])),o.Modal.success({title:n("Import Successful"),content:l().createElement("div",null,l().createElement("p",null,n("Collections"),": ",(null==S||null==(c=S.collections)?void 0:c.success)||0," ",n("succeeded"),","," ",(null==S||null==(u=S.collections)?void 0:u.failed)||0," ",n("failed")),l().createElement("p",null,n("Workflows"),": ",(null==S||null==(s=S.workflows)?void 0:s.success)||0," ",n("succeeded"),", ",(null==S||null==(m=S.workflows)?void 0:m.failed)||0," ",n("failed")),l().createElement("p",null,n("UI Schemas"),": ",(null==S||null==(g=S.uiSchemas)?void 0:g.success)||0," ",n("succeeded"),","," ",(null==S||null==(h=S.uiSchemas)?void 0:h.failed)||0," ",n("failed")),x.length>0&&l().createElement(o.Alert,{message:n("Some errors occurred"),description:l().createElement("ul",null,x.map(function(e,t){return l().createElement("li",{key:t},e.error||String(e))})),type:"warning",style:{marginTop:10}})),okText:n("Continue"),onOk:function(){return d(function(){var e,t,r,a,i;return w(this,function(c){switch(c.label){case 0:return c.trys.push([0,3,4,5]),V(!0),[4,eO(12e3,2e3)];case 1:return c.sent(),[4,eC(((null==H?void 0:H.collections)||[]).map(function(e){return"string"==typeof e?{name:e}:e}),15,1500)];case 2:return a=c.sent(),o.Modal.success({title:n("Apply Complete"),content:l().createElement("div",null,l().createElement("p",null,n("The changes have been successfully applied. Click Continue to refresh the page for the changes to take effect.")),((null==a||null==(t=a.results)||null==(e=t.errors)?void 0:e.length)||0)>0&&l().createElement(o.Alert,{type:"warning",message:n("Errors occurred during apply"),description:l().createElement("ul",{style:{marginBottom:0}},((null==a||null==(r=a.results)?void 0:r.errors)||[]).map(function(e,t){return l().createElement("li",{key:t},e.collection||e.route||e.schema||n("item"),": ",e.error)}))})),okText:n("Continue"),onOk:function(){window.location.reload()}}),[3,5];case 3:return i=c.sent(),o.message.error(O(i,n("Apply failed"))),[3,5];case 4:return V(!1),Y(null),ev(),[7];case 5:return[2]}})})()}}),ev()),[2]})})()},onError:function(e){return o.message.error(n("Import failed: {{message}}",{message:O(e,n("Unknown error"))}))}}),ej=ex.run,eI=ex.loading,eT=(0,r.useMemo)(function(){var e=et.trim().toLowerCase(),t=P.collections.filter(function(t){return(t.title||t.name||"").toLowerCase().includes(e)});return{total:t.length,data:t}},[P.collections,et]),ez=(0,r.useMemo)(function(){var e=(es.current-1)*es.pageSize;return eT.data.slice(e,e+es.pageSize)},[es,eT]),eP=(0,r.useMemo)(function(){var e=el.trim().toLowerCase(),t=P.workflows.filter(function(t){return(t.title||"").toLowerCase().includes(e)});return{total:t.length,data:t}},[P.workflows,el]),eU=(0,r.useMemo)(function(){var e=(ep.current-1)*ep.pageSize;return eP.data.slice(e,e+ep.pageSize)},[eP,ep]),eA=(0,r.useMemo)(function(){var e=ei.trim().toLowerCase(),t=P.uiSchemas.filter(function(t){return(t.displayTitle||t.title||t.name||"").toLowerCase().includes(e)});return{total:t.length,data:t}},[P.uiSchemas,ei]),eR=(0,r.useMemo)(function(){var e=(ey.current-1)*ey.pageSize;return eA.data.slice(e,e+ey.pageSize)},[eA,ey]),eD=_||G;return l().createElement("div",{style:{padding:24,position:"relative"}},l().createElement(o.Card,null,l().createElement(v,{level:2},n("Migration Manager")),l().createElement(b,{type:"secondary"},n("Export and import collections, workflows, and UI schemas across NocoBase instances")),l().createElement(o.Tabs,{activeKey:h,onChange:T,items:[{key:"export",label:n("Export"),children:l().createElement(o.Space,{direction:"vertical",size:"large",style:{width:"100%"}},l().createElement(o.Card,{title:l().createElement(o.Space,null,l().createElement(a.DatabaseOutlined,null),n("Collections")),size:"small"},l().createElement("div",{style:{marginBottom:12}},l().createElement(S,{allowClear:!0,placeholder:n("Filter by Title"),onSearch:function(e){en(e),em(f(p({},es),{current:1}))},onChange:function(e){en(e.target.value),em(f(p({},es),{current:1}))},value:et,style:{maxWidth:320}})),l().createElement(o.Table,{rowSelection:{selectedRowKeys:R,onChange:D},columns:[{title:n("Name"),dataIndex:"name",key:"name"},{title:n("Title"),dataIndex:"title",key:"title",render:C},{title:n("Fields"),dataIndex:"fields",key:"fields"}],dataSource:ez,rowKey:"name",loading:eb,pagination:{current:es.current,pageSize:es.pageSize,total:eT.total,showSizeChanger:!0,onChange:function(e,t){return em({current:e,pageSize:t})}},size:"small"})),l().createElement(o.Card,{title:l().createElement(o.Space,null,l().createElement(a.BranchesOutlined,null),n("Workflows")),size:"small"},l().createElement("div",{style:{marginBottom:12}},l().createElement(S,{allowClear:!0,placeholder:n("Filter by Title"),onSearch:function(e){eo(e),ef(f(p({},ep),{current:1}))},onChange:function(e){eo(e.target.value),ef(f(p({},ep),{current:1}))},value:el,style:{maxWidth:320}})),l().createElement(o.Table,{rowSelection:{selectedRowKeys:L,onChange:N},columns:[{title:n("Title"),dataIndex:"title",key:"title"},{title:n("Key"),dataIndex:"key",key:"key"},{title:n("Status"),dataIndex:"enabled",key:"enabled",render:function(e){return e?n("Enabled"):n("Disabled")}}],dataSource:eU,rowKey:"id",loading:eb,pagination:{current:ep.current,pageSize:ep.pageSize,total:eP.total,showSizeChanger:!0,onChange:function(e,t){return ef({current:e,pageSize:t})}},size:"small"})),l().createElement(o.Card,{title:l().createElement(o.Space,null,l().createElement(a.LayoutOutlined,null),n("UI Schemas")),size:"small"},l().createElement("div",{style:{marginBottom:12}},l().createElement(S,{allowClear:!0,placeholder:n("Filter by Title"),onSearch:function(e){ec(e),eh(f(p({},ey),{current:1}))},onChange:function(e){ec(e.target.value),eh(f(p({},ey),{current:1}))},value:ei,style:{maxWidth:320}})),l().createElement(o.Table,{rowSelection:{selectedRowKeys:W,onChange:K},columns:[{title:n("Menu / Page"),dataIndex:"displayTitle",key:"displayTitle",render:function(e,t){return l().createElement(o.Space,null,l().createElement(b,null,(null==t?void 0:t.displayTitle)||(null==t?void 0:t.title)||(null==t?void 0:t.name)||n("Untitled")),l().createElement(o.Tag,null,null==t?void 0:t.type))}},{title:n("UID"),dataIndex:"schemaUid",key:"schemaUid"}],dataSource:eR,rowKey:function(e){return e.schemaUid||e.uid||String(e.routeId||"")},loading:eb,pagination:{current:ey.current,pageSize:ey.pageSize,total:eA.total,showSizeChanger:!0,onChange:function(e,t){return eh({current:e,pageSize:t})}},size:"small"})),l().createElement(o.Button,{type:"primary",icon:l().createElement(a.DownloadOutlined,null),onClick:function(){R.length||L.length||W.length?o.Modal.confirm({title:n("Export Confirmation"),icon:l().createElement(a.ExclamationCircleOutlined,null),content:l().createElement("div",null,l().createElement("p",null,n("You will export:")),l().createElement("ul",null,l().createElement("li",null,R.length," ",n("Collections")),l().createElement("li",null,L.length," ",n("Workflows")),l().createElement("li",null,W.length," ",n("UI Schemas/Routes"))),l().createElement(o.Alert,{message:n("Note"),description:n("Export includes collection structure, workflow config, UI schema subtree, and desktop routes."),type:"info",style:{marginTop:10}})),onOk:function(){eE({collections:R.map(String),workflows:L,uiSchemas:[],desktopRoutes:W.map(String)})}}):o.message.warning(n("Select at least one item to export"))},loading:ek,size:"large",disabled:eD},n("Export Selected Items")))},{key:"import",label:n("Import"),children:l().createElement(o.Space,{direction:"vertical",size:"large",style:{width:"100%"}},l().createElement(o.Alert,{message:n("Import from Development to Production"),description:l().createElement("div",null,l().createElement("p",null,n("Upload the exported JSON file from the development server.")),l().createElement("p",null,l().createElement("strong",null,n("What will be imported:"))),l().createElement("ul",null,l().createElement("li",null,n("Collection structure (without data)")),l().createElement("li",null,n("Workflow configuration")),l().createElement("li",null,n("UI Schema/Page design"))),l().createElement("p",null,l().createElement("strong",null,n("What will NOT be affected:"))),l().createElement("ul",null,l().createElement("li",null,n("Data within collections")),l().createElement("li",null,n("Collections not present in the import file")))),type:"info"}),l().createElement(o.Upload,{accept:".json",beforeUpload:function(e){var t=new FileReader;return t.onload=function(e){try{var t,r=JSON.parse(String((null==(t=e.target)?void 0:t.result)||"{}")),i=I(r);Y(r),Z(!0),o.Modal.confirm({title:n("Import Confirmation"),icon:l().createElement(a.ExclamationCircleOutlined,null),content:l().createElement("div",null,l().createElement("p",null,n("The file will import:")),l().createElement("ul",null,l().createElement("li",null,i.collections," ",n("Collections")),l().createElement("li",null,i.workflows," ",n("Workflows")),l().createElement("li",null,i.uiSchemas," ",n("UI Schemas"))),l().createElement(o.Alert,{message:n("Warning"),description:n("The first step will run a PREVIEW. If safe, the process will proceed automatically."),type:"warning",style:{marginTop:10}})),onOk:function(){return ej(f(p({},r),{options:{preview:!0}}))}})}catch(e){o.message.error(n("Invalid or corrupt file"))}},t.readAsText(e),!1},showUploadList:!1,disabled:eD},l().createElement(o.Button,{type:"primary",icon:l().createElement(a.UploadOutlined,null),loading:eI,size:"large",disabled:eD},n("Upload Migration File (.json)"))))}]})),eD&&l().createElement("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(255,255,255,0.8)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999}},l().createElement(o.Spin,{size:"large",tip:_?n("Restarting..."):n("Applying...")})))}}}]);
@@ -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
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("ahooks"),require("@nocobase/client-v2"),require("react"),require("antd"),require("@ant-design/icons"),require("@nocobase/flow-engine")):"function"==typeof define&&define.amd?define("plugin-migration-manager/client-v2",["ahooks","@nocobase/client-v2","react","antd","@ant-design/icons","@nocobase/flow-engine"],t):"object"==typeof exports?exports["plugin-migration-manager/client-v2"]=t(require("ahooks"),require("@nocobase/client-v2"),require("react"),require("antd"),require("@ant-design/icons"),require("@nocobase/flow-engine")):e["plugin-migration-manager/client-v2"]=t(e.ahooks,e["@nocobase/client-v2"],e.react,e.antd,e["@ant-design/icons"],e["@nocobase/flow-engine"])}(self,function(e,t,n,r,o,i){return function(){"use strict";var a,u,c,l={375:function(e){e.exports=o},485:function(e){e.exports=t},694:function(e){e.exports=i},625:function(t){t.exports=e},59:function(e){e.exports=r},155:function(e){e.exports=n}},p={};function f(e){var t=p[e];if(void 0!==t)return t.exports;var n=p[e]={exports:{}};return l[e](n,n.exports,f),n.exports}f.m=l,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 n in t)f.o(t,n)&&!f.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},f.f={},f.e=function(e){return Promise.all(Object.keys(f.f).reduce(function(t,n){return f.f[n](e,t),t},[]))},f.u=function(e){return""+e+".4af90ac0c3eee699.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)},s={},f.l=function(e,t,n,r){if(s[e])return void s[e].push(t);if(void 0!==n)for(var o,i,a=document.getElementsByTagName("script"),u=0;u<a.length;u++){var c=a[u];if(c.getAttribute("src")==e||c.getAttribute("data-rspack")=="plugin-migration-manager/client-v2:"+n){o=c;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,f.nc&&o.setAttribute("nonce",f.nc),o.setAttribute("data-rspack","plugin-migration-manager/client-v2:"+n),o.src=e),s[e]=[t];var l=function(t,n){o.onerror=o.onload=null,clearTimeout(p);var r=s[e];if(delete s[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)},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&&(g=f.g.location+"");var s,g,d=f.g.document;if(!g&&d&&(d.currentScript&&"SCRIPT"===d.currentScript.tagName.toUpperCase()&&(g=d.currentScript.src),!g)){var b=d.getElementsByTagName("script");if(b.length)for(var v=b.length-1;v>-1&&(!g||!/^http(s?):/.test(g));)g=b[v--].src}if(!g)throw Error("Automatic publicPath is not supported in this browser");f.p=g.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a={889:0},f.f.j=function(e,t){var n=f.o(a,e)?a[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=a[e]=[t,r]});t.push(n[2]=r);var o=f.p+f.u(e),i=Error();f.l(o,function(t){if(f.o(a,e)&&(0!==(n=a[e])&&(a[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)}},u=function(e,t){var n,r,o=t[0],i=t[1],u=t[2],c=0;if(o.some(function(e){return 0!==a[e]})){for(n in i)f.o(i,n)&&(f.m[n]=i[n]);u&&u(f)}for(e&&e(t);c<o.length;c++)r=o[c],f.o(a,r)&&a[r]&&a[r][0](),a[r]=0},(c=self.webpackChunkplugin_migration_manager_client_v2=self.webpackChunkplugin_migration_manager_client_v2||[]).forEach(u.bind(null,0)),c.push=u.bind(null,c.push.bind(c));var m={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src){var n=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"");n.indexOf("/static/plugins/plugin-migration-manager/dist/client-v2/")>=0&&(e=n.replace(/\/[^\/]+$/,"/"))}if(!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/plugin-migration-manager/dist/client-v2/")}if(!e){var o=window.__nocobase_modern_client_prefix__||"v",i="/"+(o=String(o).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var a=window.location.pathname||"/",u=a.indexOf(i);e=u>=0?a.slice(0,u+1):"/"}e&&(e=e.replace(RegExp("/"+o+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/plugin-migration-manager/dist/client-v2/"}f.p=e}(),!function(){f.r(m),f.d(m,{default:function(){return u}});var e=f(485);function t(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,o)}function n(e,t,r){return(n=a()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&o(i,n.prototype),i}).apply(null,arguments)}function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(e){var t="function"==typeof Map?new Map:void 0;return(i=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,i)}function i(){return n(e,arguments,r(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),o(i,e)})(e)}function a(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(a=function(){return!!e})()}var u=function(e){var n;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function i(){var e,t;if(!(this instanceof i))throw TypeError("Cannot call a class as a function");return e=i,t=arguments,e=r(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,a()?Reflect.construct(e,t||[],r(this).constructor):e.apply(this,t))}return i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),e&&o(i,e),n=[{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:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){var l=[u,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=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.pluginSettingsManager.addMenuItem({key:"migration-manager",title:this.t("Migration Manager"),icon:"SwapOutlined",aclSnippet:"pm.plugin-migration-manager"}),this.pluginSettingsManager.addPageTabItem({menuKey:"migration-manager",key:"index",title:this.t("Migration Manager"),aclSnippet:"pm.plugin-migration-manager",componentLoader:function(){return f.e("946").then(f.bind(f,433))}}),[2]})},function(){var n=this,r=arguments;return new Promise(function(o,i){var a=e.apply(n,r);function u(e){t(a,o,i,u,c,"next",e)}function c(e){t(a,o,i,u,c,"throw",e)}u(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)}}(i.prototype,n),i}(i(e.Plugin))}(),m}()});
@@ -1,9 +1,19 @@
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
- "@nocobase/client": "2.0.32",
3
- "@nocobase/utils": "2.0.32",
4
- "@nocobase/server": "2.0.32",
11
+ "@nocobase/flow-engine": "2.1.10",
12
+ "@nocobase/client-v2": "2.1.10",
13
+ "@nocobase/server": "2.1.10",
5
14
  "react": "18.2.0",
6
15
  "antd": "5.24.2",
7
16
  "@ant-design/icons": "5.6.1",
8
- "@nocobase/actions": "2.0.32"
17
+ "ahooks": "3.7.8",
18
+ "@nocobase/actions": "2.1.10"
9
19
  };
@@ -1,8 +1,68 @@
1
- {
2
- "Migration Manager": "Migration Manager",
3
- "Export": "Export",
4
- "Import": "Import",
5
- "Collections": "Collections",
6
- "Workflows": "Workflows",
7
- "UI Schemas": "UI Schemas"
8
- }
1
+ {
2
+ "Migration Manager": "Migration Manager",
3
+ "Export and import collections, workflows, and UI schemas across NocoBase instances": "Export and import collections, workflows, and UI schemas across NocoBase instances",
4
+ "Export": "Export",
5
+ "Import": "Import",
6
+ "Collections": "Collections",
7
+ "Workflows": "Workflows",
8
+ "UI Schemas": "UI Schemas",
9
+ "UI Schemas/Routes": "UI Schemas/Routes",
10
+ "Filter by Title": "Filter by Title",
11
+ "Name": "Name",
12
+ "Title": "Title",
13
+ "Fields": "Fields",
14
+ "Key": "Key",
15
+ "Status": "Status",
16
+ "Enabled": "Enabled",
17
+ "Disabled": "Disabled",
18
+ "Menu / Page": "Menu / Page",
19
+ "UID": "UID",
20
+ "Untitled": "Untitled",
21
+ "Export Selected Items": "Export Selected Items",
22
+ "Import from Development to Production": "Import from Development to Production",
23
+ "Upload the exported JSON file from the development server.": "Upload the exported JSON file from the development server.",
24
+ "What will be imported:": "What will be imported:",
25
+ "Collection structure (without data)": "Collection structure (without data)",
26
+ "Workflow configuration": "Workflow configuration",
27
+ "UI Schema/Page design": "UI Schema/Page design",
28
+ "What will NOT be affected:": "What will NOT be affected:",
29
+ "Data within collections": "Data within collections",
30
+ "Collections not present in the import file": "Collections not present in the import file",
31
+ "Upload Migration File (.json)": "Upload Migration File (.json)",
32
+ "Export succeeded but no data.": "Export succeeded but no data.",
33
+ "Export successful! {{collections}} collections, {{workflows}} workflows, {{uiSchemas}} UI schemas, {{routes}} routes": "Export successful! {{collections}} collections, {{workflows}} workflows, {{uiSchemas}} UI schemas, {{routes}} routes",
34
+ "Export failed: {{message}}": "Export failed: {{message}}",
35
+ "Import failed: {{message}}": "Import failed: {{message}}",
36
+ "Unknown error": "Unknown error",
37
+ "Apply failed after several attempts.": "Apply failed after several attempts.",
38
+ "Confirm Potentially Data-Altering Changes": "Confirm Potentially Data-Altering Changes",
39
+ "Proceed & Override": "Proceed & Override",
40
+ "Cancel": "Cancel",
41
+ "Conflicts were found on existing fields.": "Conflicts were found on existing fields.",
42
+ "Collection": "Collection",
43
+ "Field": "Field",
44
+ "Current": "Current",
45
+ "Incoming": "Incoming",
46
+ "Import Successful": "Import Successful",
47
+ "succeeded": "succeeded",
48
+ "failed": "failed",
49
+ "Some errors occurred": "Some errors occurred",
50
+ "Continue": "Continue",
51
+ "Apply Complete": "Apply Complete",
52
+ "The changes have been successfully applied. Click Continue to refresh the page for the changes to take effect.": "The changes have been successfully applied. Click Continue to refresh the page for the changes to take effect.",
53
+ "Errors occurred during apply": "Errors occurred during apply",
54
+ "item": "item",
55
+ "Apply failed": "Apply failed",
56
+ "Select at least one item to export": "Select at least one item to export",
57
+ "Export Confirmation": "Export Confirmation",
58
+ "You will export:": "You will export:",
59
+ "Note": "Note",
60
+ "Export includes collection structure, workflow config, UI schema subtree, and desktop routes.": "Export includes collection structure, workflow config, UI schema subtree, and desktop routes.",
61
+ "Import Confirmation": "Import Confirmation",
62
+ "The file will import:": "The file will import:",
63
+ "Warning": "Warning",
64
+ "The first step will run a PREVIEW. If safe, the process will proceed automatically.": "The first step will run a PREVIEW. If safe, the process will proceed automatically.",
65
+ "Invalid or corrupt file": "Invalid or corrupt file",
66
+ "Restarting...": "Restarting...",
67
+ "Applying...": "Applying..."
68
+ }
@@ -1,8 +1,10 @@
1
- {
2
- "Migration Manager": "Manajer Migrasi",
3
- "Export": "Ekspor",
4
- "Import": "Impor",
5
- "Collections": "Koleksi",
6
- "Workflows": "Alur Kerja",
7
- "UI Schemas": "Skema UI"
8
- }
1
+ {
2
+ "Migration Manager": "Manajer Migrasi",
3
+ "Export": "Ekspor",
4
+ "Import": "Impor",
5
+ "Collections": "Koleksi",
6
+ "Workflows": "Alur Kerja",
7
+ "UI Schemas": "Skema UI",
8
+ "Export Selected Items": "Ekspor Item Terpilih",
9
+ "Upload Migration File (.json)": "Unggah File Migrasi (.json)"
10
+ }
@@ -0,0 +1,68 @@
1
+ {
2
+ "Migration Manager": "迁移管理器",
3
+ "Export and import collections, workflows, and UI schemas across NocoBase instances": "在 NocoBase 实例之间导出和导入数据表、工作流和 UI Schema",
4
+ "Export": "导出",
5
+ "Import": "导入",
6
+ "Collections": "数据表",
7
+ "Workflows": "工作流",
8
+ "UI Schemas": "UI Schema",
9
+ "UI Schemas/Routes": "UI Schema/路由",
10
+ "Filter by Title": "按标题筛选",
11
+ "Name": "名称",
12
+ "Title": "标题",
13
+ "Fields": "字段",
14
+ "Key": "标识",
15
+ "Status": "状态",
16
+ "Enabled": "已启用",
17
+ "Disabled": "已禁用",
18
+ "Menu / Page": "菜单/页面",
19
+ "UID": "UID",
20
+ "Untitled": "未命名",
21
+ "Export Selected Items": "导出所选项目",
22
+ "Import from Development to Production": "从开发环境导入到生产环境",
23
+ "Upload the exported JSON file from the development server.": "上传从开发服务器导出的 JSON 文件。",
24
+ "What will be imported:": "将导入:",
25
+ "Collection structure (without data)": "数据表结构(不含数据)",
26
+ "Workflow configuration": "工作流配置",
27
+ "UI Schema/Page design": "UI Schema/页面设计",
28
+ "What will NOT be affected:": "不会影响:",
29
+ "Data within collections": "数据表中的业务数据",
30
+ "Collections not present in the import file": "导入文件中不存在的数据表",
31
+ "Upload Migration File (.json)": "上传迁移文件(.json)",
32
+ "Export succeeded but no data.": "导出成功,但没有数据。",
33
+ "Export successful! {{collections}} collections, {{workflows}} workflows, {{uiSchemas}} UI schemas, {{routes}} routes": "导出成功:{{collections}} 个数据表、{{workflows}} 个工作流、{{uiSchemas}} 个 UI Schema、{{routes}} 个路由",
34
+ "Export failed: {{message}}": "导出失败:{{message}}",
35
+ "Import failed: {{message}}": "导入失败:{{message}}",
36
+ "Unknown error": "未知错误",
37
+ "Apply failed after several attempts.": "多次尝试后应用失败。",
38
+ "Confirm Potentially Data-Altering Changes": "确认可能影响数据的变更",
39
+ "Proceed & Override": "继续并覆盖",
40
+ "Cancel": "取消",
41
+ "Conflicts were found on existing fields.": "发现现有字段存在冲突。",
42
+ "Collection": "数据表",
43
+ "Field": "字段",
44
+ "Current": "当前",
45
+ "Incoming": "导入内容",
46
+ "Import Successful": "导入成功",
47
+ "succeeded": "成功",
48
+ "failed": "失败",
49
+ "Some errors occurred": "发生了一些错误",
50
+ "Continue": "继续",
51
+ "Apply Complete": "应用完成",
52
+ "The changes have been successfully applied. Click Continue to refresh the page for the changes to take effect.": "变更已成功应用。点击继续刷新页面以使变更生效。",
53
+ "Errors occurred during apply": "应用过程中发生错误",
54
+ "item": "项目",
55
+ "Apply failed": "应用失败",
56
+ "Select at least one item to export": "请至少选择一个要导出的项目",
57
+ "Export Confirmation": "导出确认",
58
+ "You will export:": "将导出:",
59
+ "Note": "提示",
60
+ "Export includes collection structure, workflow config, UI schema subtree, and desktop routes.": "导出包含数据表结构、工作流配置、UI Schema 子树和桌面路由。",
61
+ "Import Confirmation": "导入确认",
62
+ "The file will import:": "文件将导入:",
63
+ "Warning": "警告",
64
+ "The first step will run a PREVIEW. If safe, the process will proceed automatically.": "第一步将执行预览。确认安全后流程会自动继续。",
65
+ "Invalid or corrupt file": "文件无效或已损坏",
66
+ "Restarting...": "正在重启...",
67
+ "Applying...": "正在应用..."
68
+ }
@@ -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;
@@ -189,6 +198,22 @@ class MigrationController {
189
198
  }
190
199
  if (row) selectedRoots.push(row);
191
200
  }
201
+ const pickRouteFields2 = (r) => ({
202
+ title: r.title ?? null,
203
+ tooltip: r.tooltip ?? null,
204
+ icon: r.icon ?? null,
205
+ schemaUid: r.schemaUid ?? null,
206
+ menuSchemaUid: r.menuSchemaUid ?? null,
207
+ tabSchemaName: r.tabSchemaName ?? null,
208
+ type: r.type ?? null,
209
+ options: r.options ?? null,
210
+ sort: r.sort ?? null,
211
+ hideInMenu: r.hideInMenu ?? null,
212
+ enableTabs: r.enableTabs ?? null,
213
+ enableHeader: r.enableHeader ?? null,
214
+ displayTitle: r.displayTitle ?? null,
215
+ hidden: r.hidden ?? null
216
+ });
192
217
  const buildTree = async (node, parentType) => {
193
218
  const t = String(node.type || "").toLowerCase();
194
219
  if (t === "tabs") {
@@ -203,7 +228,7 @@ class MigrationController {
203
228
  }
204
229
  return null;
205
230
  }
206
- const entry = pickRouteFields(node);
231
+ const entry = pickRouteFields2(node);
207
232
  if (node.schemaUid) {
208
233
  await pushSchemaPayload(String(node.schemaUid), String(node.type || "route"));
209
234
  }
@@ -1,10 +1,19 @@
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;
4
13
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
14
  var __export = (target, all) => {
6
- for (var name2 in all)
7
- __defProp(target, name2, { get: all[name2], enumerable: true });
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
8
17
  };
9
18
  var __copyProps = (to, from, except, desc) => {
10
19
  if (from && typeof from === "object" || typeof from === "function") {
@@ -18,14 +27,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
18
27
  var server_exports = {};
19
28
  __export(server_exports, {
20
29
  PluginMigrationManagerServer: () => PluginMigrationManagerServer,
21
- default: () => server_default,
22
- namespace: () => namespace
30
+ default: () => server_default
23
31
  });
24
32
  module.exports = __toCommonJS(server_exports);
25
33
  var import_server = require("@nocobase/server");
26
- var import_package = require("../../package.json");
27
34
  var import_migration = require("./controllers/migration");
28
- const namespace = import_package.name;
29
35
  class PluginMigrationManagerServer extends import_server.Plugin {
30
36
  async afterAdd() {
31
37
  }
@@ -42,11 +48,11 @@ class PluginMigrationManagerServer extends import_server.Plugin {
42
48
  apply: import_migration.MigrationController.apply
43
49
  }
44
50
  });
45
- this.app.acl.allow("migration", "*", (ctx) => {
46
- var _a;
47
- const role = (_a = ctx.state) == null ? void 0 : _a.currentRole;
48
- return role === "root" || role === "admin";
51
+ this.app.acl.registerSnippet({
52
+ name: "pm.plugin-migration-manager",
53
+ actions: ["migration:*"]
49
54
  });
55
+ this.app.acl.allow("migration", "*", "admin");
50
56
  }
51
57
  async install() {
52
58
  }
@@ -60,6 +66,5 @@ class PluginMigrationManagerServer extends import_server.Plugin {
60
66
  var server_default = PluginMigrationManagerServer;
61
67
  // Annotate the CommonJS export names for ESM import in node:
62
68
  0 && (module.exports = {
63
- PluginMigrationManagerServer,
64
- namespace
69
+ PluginMigrationManagerServer
65
70
  });
package/package.json CHANGED
@@ -1,23 +1,40 @@
1
- {
2
- "name": "plugin-migration-manager",
3
- "version": "2.0.1",
4
- "displayName": "Migration Manager",
5
- "displayName.id-ID": "Migration Manager",
6
- "description": "Migrate collections, workflows, and UI schemas between Nocobase instances",
7
- "description.id-ID": "Migrate collections, workflows, and UI schemas between Nocobase instances",
8
- "main": "dist/server/index.js",
9
- "keywords": [
10
- "nocobase",
11
- "plugin",
12
- "migration",
13
- "export",
14
- "import"
15
- ],
16
- "license": "MIT",
17
- "peerDependencies": {
18
- "@nocobase/client": "2.x",
19
- "@nocobase/server": "2.x",
20
- "@nocobase/database": "2.x",
21
- "@nocobase/test": "2.x"
22
- }
23
- }
1
+ {
2
+ "name": "plugin-migration-manager",
3
+ "displayName": "Migration Manager",
4
+ "displayName.id-ID": "Migration Manager",
5
+ "displayName.zh-CN": "迁移管理器",
6
+ "description": "Migrate collections, workflows, and UI schemas between NocoBase instances.",
7
+ "description.id-ID": "Migrate collections, workflows, and UI schemas between NocoBase instances.",
8
+ "description.zh-CN": "在 NocoBase 实例之间迁移数据表、工作流和 UI Schema。",
9
+ "version": "2.0.2",
10
+ "license": "MIT",
11
+ "main": "dist/server/index.js",
12
+ "keywords": [
13
+ "nocobase",
14
+ "plugin",
15
+ "migration",
16
+ "export",
17
+ "import"
18
+ ],
19
+ "files": [
20
+ "dist",
21
+ "src",
22
+ "server.js",
23
+ "server.d.ts",
24
+ "client-v2.js",
25
+ "client-v2.d.ts"
26
+ ],
27
+ "nocobase": {
28
+ "supportedVersions": [
29
+ "2.x"
30
+ ],
31
+ "editionLevel": 0
32
+ },
33
+ "peerDependencies": {
34
+ "@nocobase/actions": "2.x",
35
+ "@nocobase/client-v2": "2.x",
36
+ "@nocobase/flow-engine": "2.x",
37
+ "@nocobase/server": "2.x",
38
+ "ahooks": "*"
39
+ }
40
+ }
package/server.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from './dist/server';
2
- export { default } from './dist/server';
1
+ export * from './dist/server';
2
+ export { default } from './dist/server';
package/server.js CHANGED
@@ -1 +1 @@
1
- module.exports = require('./dist/server/index.js');
1
+ module.exports = require('./dist/server/index.js');
@@ -0,0 +1 @@
1
+ export { default } from './plugin';
@@ -0,0 +1,13 @@
1
+ import { tExpr as _tExpr, useFlowEngine } from '@nocobase/flow-engine';
2
+ // @ts-ignore
3
+ import pkg from './../../package.json';
4
+
5
+ export function useT() {
6
+ const engine = useFlowEngine();
7
+ return (str: string, options?: Record<string, unknown>) =>
8
+ engine.context.t(str, { ...options, ns: [pkg.name, 'client'] });
9
+ }
10
+
11
+ export function tExpr(key: string) {
12
+ return _tExpr(key, { ns: [pkg.name, 'client'] });
13
+ }