@nocobase/plugin-data-source-manager 1.6.0-beta.1 → 1.6.0-beta.11

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/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Updated Date: October 15, 2024
1
+ Updated Date: February 20, 2025
2
2
 
3
3
  NocoBase License Agreement
4
4
 
@@ -78,7 +78,7 @@ Except for Third-Party Open Source Software, the Company owns all copyrights, tr
78
78
 
79
79
  6.1 Obtain a permanent commercial license of the Software.
80
80
 
81
- 6.2 Get 12 months of upgrade and exclusive technical support.
81
+ 6.2 Get software upgrades and exclusive technical support during the upgrade validity period.
82
82
 
83
83
  6.3 The licensed Software can be used for commercial purposes with no restrictions on the number of applications and users.
84
84
 
@@ -88,7 +88,7 @@ Except for Third-Party Open Source Software, the Company owns all copyrights, tr
88
88
 
89
89
  6.6 Can sell plugins developed for Software in the Marketplace.
90
90
 
91
- 6.7 The User with a Professional or Enterprise Edition License can sell Upper Layer Application to their clients.
91
+ 6.7 The User with an Enterprise Edition License can sell Upper Layer Application to their clients.
92
92
 
93
93
  6.8 Not restricted by the AGPL-3.0 agreement.
94
94
 
@@ -106,13 +106,15 @@ Except for Third-Party Open Source Software, the Company owns all copyrights, tr
106
106
 
107
107
  7.4 It is not allowed to provide any form of no-code, zero-code, low-code platform SaaS products to the public using the original or modified Software.
108
108
 
109
- 7.5 It is not allowed for the User with a Standard Edition license to sell Upper Layer Application to clients without a Commercial license.
109
+ 7.5 It is not allowed for the User withot an Enterprise Edition license to sell Upper Layer Application to clients without a Commercial license.
110
110
 
111
- 7.6 It is not allowed to publicly sell plugins developed for Software outside of the Marketplace.
111
+ 7.6 It is not allowed for the User with an Enterprise Edition license to sell Upper Layer Application to clients without a Commercial license with access to further development and configuration.
112
112
 
113
- 7.7 If there is a violation of the above obligations or the terms of this Agreement, the rights owned by the User will be immediately terminated, the paid fees will not be refunded, and the Company reserves the right to pursue the User's legal responsibility.
113
+ 7.7 It is not allowed to publicly sell plugins developed for Software outside of the Marketplace.
114
114
 
115
- 7.8 If there are other agreements in the contract for the above obligations, the contract agreement shall prevail.
115
+ 7.8 If there is a violation of the above obligations or the terms of this Agreement, the rights owned by the User will be immediately terminated, the paid fees will not be refunded, and the Company reserves the right to pursue the User's legal responsibility.
116
+
117
+ 7.9 If there are other agreements in the contract for the above obligations, the contract agreement shall prevail.
116
118
 
117
119
  ======================================
118
120
  8. Rights of Commercial Plugin License
@@ -120,11 +122,11 @@ Except for Third-Party Open Source Software, the Company owns all copyrights, tr
120
122
 
121
123
  8.1 Obtain a permanent Commercial Plugin License for the Commercial Plugin.
122
124
 
123
- 8.2 Receive 12 months of upgrades and exclusive technical support.
125
+ 8.2 Get plugins upgrades and exclusive technical support during the upgrade validity period.
124
126
 
125
127
  8.3 Can be used for commercial purposes without restrictions on the number of applications or users.
126
128
 
127
- 8.4 The User with a Professional or Enterprise Edition License can use the Commercial Plugin in Upper Layer Applications sold to their customers.
129
+ 8.4 The User with an Enterprise Edition License can use the Commercial Plugin in Upper Layer Applications sold to their customers.
128
130
 
129
131
  8.5 Not restricted by the AGPL-3.0 agreement.
130
132
 
@@ -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("@nocobase/client"),require("@ant-design/icons"),require("@formily/react"),require("react"),require("@emotion/css"),require("react-i18next"),require("@formily/shared"),require("@formily/antd-v5"),require("@nocobase/plugin-acl/client"),require("@nocobase/utils/client"),require("@formily/core"),require("lodash"),require("antd"),require("@dnd-kit/core"),require("antd-style"),require("react-router-dom"),require("@formily/reactive")):"function"==typeof define&&define.amd?define("@nocobase/plugin-data-source-manager",["@nocobase/client","@ant-design/icons","@formily/react","react","@emotion/css","react-i18next","@formily/shared","@formily/antd-v5","@nocobase/plugin-acl/client","@nocobase/utils/client","@formily/core","lodash","antd","@dnd-kit/core","antd-style","react-router-dom","@formily/reactive"],t):"object"==typeof exports?exports["@nocobase/plugin-data-source-manager"]=t(require("@nocobase/client"),require("@ant-design/icons"),require("@formily/react"),require("react"),require("@emotion/css"),require("react-i18next"),require("@formily/shared"),require("@formily/antd-v5"),require("@nocobase/plugin-acl/client"),require("@nocobase/utils/client"),require("@formily/core"),require("lodash"),require("antd"),require("@dnd-kit/core"),require("antd-style"),require("react-router-dom"),require("@formily/reactive")):e["@nocobase/plugin-data-source-manager"]=t(e["@nocobase/client"],e["@ant-design/icons"],e["@formily/react"],e.react,e["@emotion/css"],e["react-i18next"],e["@formily/shared"],e["@formily/antd-v5"],e["@nocobase/plugin-acl/client"],e["@nocobase/utils/client"],e["@formily/core"],e.lodash,e.antd,e["@dnd-kit/core"],e["antd-style"],e["react-router-dom"],e["@formily/reactive"])}(self,function(e,t,n,r,o,i,a,c,u,l,s,f,p,d,b,y,m){return function(){var g,h,v,_,w,O,S={60:function(e,t,n){"use strict";n.r(t),n.d(t,{PluginDataSourceManagerClient:function(){return C}});var r=n(772),o=n(465),i=n.n(o),a=n(584),c=n(156),u=n.n(c),l=n(382),s=n(573),f=n(581);function p(e,t,n,r,o,i,a){try{var c=e[i](a),u=c.value}catch(e){n(e);return}c.done?t(u):Promise.resolve(u).then(r,o)}function d(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){p(i,r,o,a,c,"next",e)}function c(e){p(i,r,o,a,c,"throw",e)}a(void 0)})}}function b(e,t,n){return(b=_()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&h(o,n.prototype),o}).apply(null,arguments)}function y(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)}}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function h(e,t){return(h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function v(e){var t="function"==typeof Map?new Map:void 0;return(v=function(e){var n;if(null===e||(n=e,-1===Function.toString.call(n).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 b(e,arguments,g(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),h(r,e)})(e)}function _(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(_=function(){return!!e})()}function w(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}var O=(0,r.lazy)(function(){return f("imported_174m4o3_component",n.e("721").then(n.bind(n,947)))},"DatabaseConnectionProvider").DatabaseConnectionProvider,S=(0,r.lazy)(function(){return f("imported_-1bdhn46_component",n.e("927").then(n.bind(n,580)))},"BreadcumbTitle").BreadcumbTitle,P=(0,r.lazy)(function(){return f("imported_l1a36j_component",Promise.all([n.e("833"),n.e("481")]).then(n.bind(n,791)))},"CollectionManagerPage").CollectionManagerPage,x=(0,r.lazy)(function(){return f("imported_k8ts4l_component",n.e("210").then(n.bind(n,186)))},"DatabaseConnectionManagerPane").DatabaseConnectionManagerPane,j=(0,r.lazy)(function(){return f("imported_1cub3nb_component",Promise.all([n.e("833"),n.e("542")]).then(n.bind(n,185)))},"MainDataSourceManager").MainDataSourceManager,k=(0,r.lazy)(function(){return f("imported_-1b29440_component",n.e("630").then(n.bind(n,994)))},"DataSourcePermissionManager").DataSourcePermissionManager,q=(0,r.lazy)(function(){return f("imported_cef22q_component",n.e("518").then(n.bind(n,865)))},"CollectionMainProvider").CollectionMainProvider,C=function(e){var t,n,r;function o(){var e,t,n,r;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,o),t=this,n=o,r=arguments,n=g(n),m(e=function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(t,_()?Reflect.construct(n,r||[],g(t).constructor):n.apply(t,r)),"types",new Map),m(e,"extendedTabs",{}),e}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(o,e),t=o,n=[{key:"getExtendedTabs",value:function(){return this.extendedTabs}},{key:"registerPermissionTab",value:function(e){this.extendedTabs[(0,a.uid)()]=e}},{key:"load",value:function(){var e=this;return d(function(){return w(this,function(t){return e.app.pm.get(i()).settingsUI.addPermissionsTab(function(e){var t=e.t,n=e.TabLayout,r=e.activeRole;return{key:"dataSource",label:t("Data sources"),children:u().createElement(n,null,u().createElement(k,{role:r}))}}),e.app.use(O),e.app.pluginSettingsManager.add(s.A7,{title:'{{t("Data sources", { ns: "'.concat(s.A7,'" })}}'),icon:"ClusterOutlined",showTabs:!1,aclSnippet:"pm.data-source-manager*"}),e.app.pluginSettingsManager.add("".concat(s.A7,".list"),{title:'{{t("Data sources", { ns: "'.concat(s.A7,'" })}}'),Component:x,sort:1,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager"}),e.app.pluginSettingsManager.add("".concat(s.A7,"/:name"),{title:u().createElement(S,null),icon:"ClusterOutlined",isTopLevel:!1,sort:100,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager"}),e.app.pluginSettingsManager.add("".concat(s.A7,"/main"),{title:u().createElement(S,null),icon:"ClusterOutlined",isTopLevel:!1,sort:100,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager.data-source-main",Component:q}),e.app.pluginSettingsManager.add("".concat(s.A7,"/main.collections"),{title:'{{t("Collections", { ns: "'.concat(s.A7,'" })}}'),Component:j,topLevelName:"".concat(s.A7,"/main"),pluginKey:s.A7,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager.data-source-main"}),e.app.pluginSettingsManager.add("".concat(s.A7,"/:name.collections"),{title:'{{t("Collections", { ns: "'.concat(s.A7,'" })}}'),Component:P,topLevelName:"".concat(s.A7,"/:name"),pluginKey:s.A7,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager.data-source-main"}),e.app.dataSourceManager.addDataSources(e.getThirdDataSource.bind(e),l.F),[2]})})()}},{key:"setDataSources",value:function(){var e=this;return d(function(){var t,n;return w(this,function(r){switch(r.label){case 0:return[4,e.app.apiClient.request({resource:"dataSources",action:"listEnabled",params:{paginate:!1}})];case 1:return[2,null==(n=r.sent())?void 0:null===(t=n.data)||void 0===t?void 0:t.data]}})})()}},{key:"getThirdDataSource",value:function(){var e=this;return d(function(){var t,n;return w(this,function(r){switch(r.label){case 0:return[4,e.app.apiClient.request({resource:"dataSources",action:"listEnabled",params:{paginate:!1,appends:["collections"]}})];case 1:return[2,null==(n=r.sent())?void 0:null===(t=n.data)||void 0===t?void 0:t.data]}})})()}},{key:"registerType",value:function(e,t){this.types.set(e,t)}}],y(t.prototype,n),o}(v(r.Plugin));t.default=C},382:function(e,t,n){"use strict";n.d(t,{F:function(){return l}});var r=n(772);function o(e,t,n,r,o,i,a){try{var c=e[i](a),u=c.value}catch(e){n(e);return}c.done?t(u):Promise.resolve(u).then(r,o)}function i(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)}}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(u=function(){return!!e})()}var l=function(e){var t,n,r;function l(){var e,t,n;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,l),e=this,t=l,n=arguments,t=a(t),function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,n||[],a(e).constructor):t.apply(e,n))}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(l,e),t=l,n=[{key:"getDataSource",value:function(){var e,t=this;return(e=function(){return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}(this,function(e){switch(e.label){case 0:return[4,t.app.apiClient.request({url:"dataSources:get/".concat(t.key),params:{appends:["collections"]}})];case 1:return[2,e.sent().data.data]}})},function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function c(e){o(a,r,i,c,u,"next",e)}function u(e){o(a,r,i,c,u,"throw",e)}c(void 0)})})()}}],i(t.prototype,n),l}(r.DataSource)},573:function(e,t,n){"use strict";n.d(t,{A7:function(){return i},EL:function(){return c},KQ:function(){return a}});var r=n(772),o=n(238),i="data-source-manager";function a(e){var t,n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r.i18n.t(e,(t=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,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}({},o),n=(n={ns:i},n),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))}function c(){return(0,o.useTranslation)([i,"client"],{nsMode:"fallback"})}},581:function(e){e.exports=function(e,t){return"undefined"!=typeof __deoptimization_sideEffect__&&__deoptimization_sideEffect__(e,t),t}},482:function(e){"use strict";e.exports=t},948:function(e){"use strict";e.exports=d},964:function(e){"use strict";e.exports=o},632:function(e){"use strict";e.exports=c},563:function(e){"use strict";e.exports=s},505:function(e){"use strict";e.exports=n},229:function(e){"use strict";e.exports=m},875:function(e){"use strict";e.exports=a},772:function(t){"use strict";t.exports=e},465:function(e){"use strict";e.exports=u},584:function(e){"use strict";e.exports=l},721:function(e){"use strict";e.exports=p},202:function(e){"use strict";e.exports=b},467:function(e){"use strict";e.exports=f},156:function(e){"use strict";e.exports=r},238:function(e){"use strict";e.exports=i},128:function(e){"use strict";e.exports=y}},P={};function x(e){var t=P[e];if(void 0!==t)return t.exports;var n=P[e]={exports:{}};return S[e](n,n.exports,x),n.exports}return x.m=S,x.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return x.d(t,{a:t}),t},x.d=function(e,t){for(var n in t)x.o(t,n)&&!x.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},x.f={},x.e=function(e){return Promise.all(Object.keys(x.f).reduce(function(t,n){return x.f[n](e,t),t},[]))},x.u=function(e){return""+({210:"05fd9bbff4351687",481:"730406514d9b8503",518:"93d7762d5a5ead48",542:"0920f4a14af0406f",630:"260ea8a867c3a069",721:"7948d6c08bf3359d",833:"4351378ca49a3620",927:"435a0c316fa76b6f"})[e]+".js"},x.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),x.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},g={},h="@nocobase/plugin-data-source-manager:",x.l=function(e,t,n,r){if(g[e]){g[e].push(t);return}if(void 0!==n){for(var o,i,a=document.getElementsByTagName("script"),c=0;c<a.length;c++){var u=a[c];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==h+n){o=u;break}}}!o&&(i=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,x.nc&&o.setAttribute("nonce",x.nc),o.setAttribute("data-webpack",h+n),o.src=e),g[e]=[t];var l=function(t,n){o.onerror=o.onload=null,clearTimeout(s);var r=g[e];if(delete g[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},s=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)},x.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},x.p=(!(v=window.__nocobase_public_path__||"/").endsWith("/")&&(v+="/"),v+"static/plugins/@nocobase/plugin-data-source-manager/dist/client/"),_={909:0},x.f.j=function(e,t){var n=x.o(_,e)?_[e]:void 0;if(0!==n){if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=_[e]=[t,r]});t.push(n[2]=r);var o=x.p+x.u(e),i=Error();x.l(o,function(t){if(x.o(_,e)&&(0!==(n=_[e])&&(_[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)}}},w=function(e,t){var n=t[0],r=t[1],o=t[2],i,a,c=0;if(n.some(function(e){return 0!==_[e]})){for(i in r)x.o(r,i)&&(x.m[i]=r[i]);o&&o(x)}for(e&&e(t);c<n.length;c++)a=n[c],x.o(_,a)&&_[a]&&_[a][0](),_[a]=0},(O=self.webpackChunk_nocobase_plugin_data_source_manager=self.webpackChunk_nocobase_plugin_data_source_manager||[]).forEach(w.bind(null,0)),O.push=w.bind(null,O.push.bind(O)),x("60")}()});
10
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@nocobase/client"),require("@ant-design/icons"),require("@formily/react"),require("react"),require("@emotion/css"),require("react-i18next"),require("@formily/shared"),require("@formily/antd-v5"),require("@nocobase/plugin-acl/client"),require("@nocobase/utils/client"),require("@formily/core"),require("lodash"),require("antd"),require("@dnd-kit/core"),require("antd-style"),require("react-router-dom"),require("@formily/reactive")):"function"==typeof define&&define.amd?define("@nocobase/plugin-data-source-manager",["@nocobase/client","@ant-design/icons","@formily/react","react","@emotion/css","react-i18next","@formily/shared","@formily/antd-v5","@nocobase/plugin-acl/client","@nocobase/utils/client","@formily/core","lodash","antd","@dnd-kit/core","antd-style","react-router-dom","@formily/reactive"],t):"object"==typeof exports?exports["@nocobase/plugin-data-source-manager"]=t(require("@nocobase/client"),require("@ant-design/icons"),require("@formily/react"),require("react"),require("@emotion/css"),require("react-i18next"),require("@formily/shared"),require("@formily/antd-v5"),require("@nocobase/plugin-acl/client"),require("@nocobase/utils/client"),require("@formily/core"),require("lodash"),require("antd"),require("@dnd-kit/core"),require("antd-style"),require("react-router-dom"),require("@formily/reactive")):e["@nocobase/plugin-data-source-manager"]=t(e["@nocobase/client"],e["@ant-design/icons"],e["@formily/react"],e.react,e["@emotion/css"],e["react-i18next"],e["@formily/shared"],e["@formily/antd-v5"],e["@nocobase/plugin-acl/client"],e["@nocobase/utils/client"],e["@formily/core"],e.lodash,e.antd,e["@dnd-kit/core"],e["antd-style"],e["react-router-dom"],e["@formily/reactive"])}(self,function(e,t,n,r,o,i,a,c,u,l,s,f,p,d,b,y,m){return function(){var g,h,v,_,w,O,S={60:function(e,t,n){"use strict";n.r(t),n.d(t,{PluginDataSourceManagerClient:function(){return C}});var r=n(772),o=n(465),i=n.n(o),a=n(584),c=n(156),u=n.n(c),l=n(382),s=n(573),f=n(581);function p(e,t,n,r,o,i,a){try{var c=e[i](a),u=c.value}catch(e){n(e);return}c.done?t(u):Promise.resolve(u).then(r,o)}function d(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){p(i,r,o,a,c,"next",e)}function c(e){p(i,r,o,a,c,"throw",e)}a(void 0)})}}function b(e,t,n){return(b=_()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&h(o,n.prototype),o}).apply(null,arguments)}function y(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)}}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function h(e,t){return(h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function v(e){var t="function"==typeof Map?new Map:void 0;return(v=function(e){var n;if(null===e||(n=e,-1===Function.toString.call(n).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 b(e,arguments,g(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),h(r,e)})(e)}function _(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(_=function(){return!!e})()}function w(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}var O=(0,r.lazy)(function(){return f("imported_174m4o3_component",n.e("721").then(n.bind(n,947)))},"DatabaseConnectionProvider").DatabaseConnectionProvider,S=(0,r.lazy)(function(){return f("imported_-1bdhn46_component",n.e("927").then(n.bind(n,580)))},"BreadcumbTitle").BreadcumbTitle,P=(0,r.lazy)(function(){return f("imported_l1a36j_component",Promise.all([n.e("833"),n.e("481")]).then(n.bind(n,791)))},"CollectionManagerPage").CollectionManagerPage,x=(0,r.lazy)(function(){return f("imported_k8ts4l_component",n.e("210").then(n.bind(n,186)))},"DatabaseConnectionManagerPane").DatabaseConnectionManagerPane,j=(0,r.lazy)(function(){return f("imported_1cub3nb_component",Promise.all([n.e("833"),n.e("542")]).then(n.bind(n,185)))},"MainDataSourceManager").MainDataSourceManager,k=(0,r.lazy)(function(){return f("imported_-1b29440_component",n.e("630").then(n.bind(n,994)))},"DataSourcePermissionManager").DataSourcePermissionManager,q=(0,r.lazy)(function(){return f("imported_cef22q_component",n.e("518").then(n.bind(n,865)))},"CollectionMainProvider").CollectionMainProvider,C=function(e){var t,n,r;function o(){var e,t,n,r;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,o),t=this,n=o,r=arguments,n=g(n),m(e=function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(t,_()?Reflect.construct(n,r||[],g(t).constructor):n.apply(t,r)),"types",new Map),m(e,"extendedTabs",{}),e}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(o,e),t=o,n=[{key:"getExtendedTabs",value:function(){return this.extendedTabs}},{key:"registerPermissionTab",value:function(e){this.extendedTabs[(0,a.uid)()]=e}},{key:"load",value:function(){var e=this;return d(function(){return w(this,function(t){return e.app.pm.get(i()).settingsUI.addPermissionsTab(function(e){var t=e.t,n=e.TabLayout,r=e.activeRole;return{key:"dataSource",label:t("Data sources"),sort:15,children:u().createElement(n,null,u().createElement(k,{role:r}))}}),e.app.use(O),e.app.pluginSettingsManager.add(s.A7,{title:'{{t("Data sources", { ns: "'.concat(s.A7,'" })}}'),icon:"ClusterOutlined",showTabs:!1,aclSnippet:"pm.data-source-manager*"}),e.app.pluginSettingsManager.add("".concat(s.A7,".list"),{title:'{{t("Data sources", { ns: "'.concat(s.A7,'" })}}'),Component:x,sort:1,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager"}),e.app.pluginSettingsManager.add("".concat(s.A7,"/:name"),{title:u().createElement(S,null),icon:"ClusterOutlined",isTopLevel:!1,sort:100,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager"}),e.app.pluginSettingsManager.add("".concat(s.A7,"/main"),{title:u().createElement(S,null),icon:"ClusterOutlined",isTopLevel:!1,sort:100,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager.data-source-main",Component:q}),e.app.pluginSettingsManager.add("".concat(s.A7,"/main.collections"),{title:'{{t("Collections", { ns: "'.concat(s.A7,'" })}}'),Component:j,topLevelName:"".concat(s.A7,"/main"),pluginKey:s.A7,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager.data-source-main"}),e.app.pluginSettingsManager.add("".concat(s.A7,"/:name.collections"),{title:'{{t("Collections", { ns: "'.concat(s.A7,'" })}}'),Component:P,topLevelName:"".concat(s.A7,"/:name"),pluginKey:s.A7,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager.data-source-main"}),e.app.dataSourceManager.addDataSources(e.getThirdDataSource.bind(e),l.F),[2]})})()}},{key:"setDataSources",value:function(){var e=this;return d(function(){var t,n;return w(this,function(r){switch(r.label){case 0:return[4,e.app.apiClient.request({resource:"dataSources",action:"listEnabled",params:{paginate:!1}})];case 1:return[2,null==(n=r.sent())?void 0:null===(t=n.data)||void 0===t?void 0:t.data]}})})()}},{key:"getThirdDataSource",value:function(){var e=this;return d(function(){var t,n;return w(this,function(r){switch(r.label){case 0:return[4,e.app.apiClient.request({resource:"dataSources",action:"listEnabled",params:{paginate:!1,appends:["collections"]}})];case 1:return[2,null==(n=r.sent())?void 0:null===(t=n.data)||void 0===t?void 0:t.data]}})})()}},{key:"registerType",value:function(e,t){this.types.set(e,t)}}],y(t.prototype,n),o}(v(r.Plugin));t.default=C},382:function(e,t,n){"use strict";n.d(t,{F:function(){return l}});var r=n(772);function o(e,t,n,r,o,i,a){try{var c=e[i](a),u=c.value}catch(e){n(e);return}c.done?t(u):Promise.resolve(u).then(r,o)}function i(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)}}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(u=function(){return!!e})()}var l=function(e){var t,n,r;function l(){var e,t,n;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,l),e=this,t=l,n=arguments,t=a(t),function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,n||[],a(e).constructor):t.apply(e,n))}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(l,e),t=l,n=[{key:"getDataSource",value:function(){var e,t=this;return(e=function(){return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}(this,function(e){switch(e.label){case 0:return[4,t.app.apiClient.request({url:"dataSources:get/".concat(t.key),params:{appends:["collections"]}})];case 1:return[2,e.sent().data.data]}})},function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function c(e){o(a,r,i,c,u,"next",e)}function u(e){o(a,r,i,c,u,"throw",e)}c(void 0)})})()}}],i(t.prototype,n),l}(r.DataSource)},573:function(e,t,n){"use strict";n.d(t,{A7:function(){return i},EL:function(){return c},KQ:function(){return a}});var r=n(772),o=n(238),i="data-source-manager";function a(e){var t,n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r.i18n.t(e,(t=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,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}({},o),n=(n={ns:i},n),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))}function c(){return(0,o.useTranslation)([i,"client"],{nsMode:"fallback"})}},581:function(e){e.exports=function(e,t){return"undefined"!=typeof __deoptimization_sideEffect__&&__deoptimization_sideEffect__(e,t),t}},482:function(e){"use strict";e.exports=t},948:function(e){"use strict";e.exports=d},964:function(e){"use strict";e.exports=o},632:function(e){"use strict";e.exports=c},563:function(e){"use strict";e.exports=s},505:function(e){"use strict";e.exports=n},229:function(e){"use strict";e.exports=m},875:function(e){"use strict";e.exports=a},772:function(t){"use strict";t.exports=e},465:function(e){"use strict";e.exports=u},584:function(e){"use strict";e.exports=l},721:function(e){"use strict";e.exports=p},202:function(e){"use strict";e.exports=b},467:function(e){"use strict";e.exports=f},156:function(e){"use strict";e.exports=r},238:function(e){"use strict";e.exports=i},128:function(e){"use strict";e.exports=y}},P={};function x(e){var t=P[e];if(void 0!==t)return t.exports;var n=P[e]={exports:{}};return S[e](n,n.exports,x),n.exports}return x.m=S,x.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return x.d(t,{a:t}),t},x.d=function(e,t){for(var n in t)x.o(t,n)&&!x.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},x.f={},x.e=function(e){return Promise.all(Object.keys(x.f).reduce(function(t,n){return x.f[n](e,t),t},[]))},x.u=function(e){return""+({210:"05fd9bbff4351687",481:"730406514d9b8503",518:"93d7762d5a5ead48",542:"0920f4a14af0406f",630:"260ea8a867c3a069",721:"7948d6c08bf3359d",833:"4351378ca49a3620",927:"435a0c316fa76b6f"})[e]+".js"},x.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),x.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},g={},h="@nocobase/plugin-data-source-manager:",x.l=function(e,t,n,r){if(g[e]){g[e].push(t);return}if(void 0!==n){for(var o,i,a=document.getElementsByTagName("script"),c=0;c<a.length;c++){var u=a[c];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==h+n){o=u;break}}}!o&&(i=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,x.nc&&o.setAttribute("nonce",x.nc),o.setAttribute("data-webpack",h+n),o.src=e),g[e]=[t];var l=function(t,n){o.onerror=o.onload=null,clearTimeout(s);var r=g[e];if(delete g[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},s=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)},x.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},x.p=(!(v=window.__nocobase_public_path__||"/").endsWith("/")&&(v+="/"),v+"static/plugins/@nocobase/plugin-data-source-manager/dist/client/"),_={909:0},x.f.j=function(e,t){var n=x.o(_,e)?_[e]:void 0;if(0!==n){if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=_[e]=[t,r]});t.push(n[2]=r);var o=x.p+x.u(e),i=Error();x.l(o,function(t){if(x.o(_,e)&&(0!==(n=_[e])&&(_[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)}}},w=function(e,t){var n=t[0],r=t[1],o=t[2],i,a,c=0;if(n.some(function(e){return 0!==_[e]})){for(i in r)x.o(r,i)&&(x.m[i]=r[i]);o&&o(x)}for(e&&e(t);c<n.length;c++)a=n[c],x.o(_,a)&&_[a]&&_[a][0](),_[a]=0},(O=self.webpackChunk_nocobase_plugin_data_source_manager=self.webpackChunk_nocobase_plugin_data_source_manager||[]).forEach(w.bind(null,0)),O.push=w.bind(null,O.push.bind(O)),x("60")}()});
@@ -8,13 +8,13 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "1.6.0-beta.1",
11
+ "@nocobase/client": "1.6.0-beta.11",
12
12
  "react": "18.2.0",
13
- "@nocobase/plugin-acl": "1.6.0-beta.1",
14
- "@nocobase/utils": "1.6.0-beta.1",
15
- "@nocobase/server": "1.6.0-beta.1",
13
+ "@nocobase/plugin-acl": "1.6.0-beta.11",
14
+ "@nocobase/utils": "1.6.0-beta.11",
15
+ "@nocobase/server": "1.6.0-beta.11",
16
+ "@nocobase/data-source-manager": "1.6.0-beta.11",
16
17
  "lodash": "4.17.21",
17
- "@nocobase/data-source-manager": "1.6.0-beta.1",
18
18
  "@ant-design/icons": "5.2.6",
19
19
  "antd": "5.12.8",
20
20
  "react-router-dom": "6.21.0",
@@ -22,10 +22,10 @@ module.exports = {
22
22
  "react-i18next": "11.18.6",
23
23
  "@formily/react": "2.3.0",
24
24
  "@emotion/css": "11.13.0",
25
- "@nocobase/database": "1.6.0-beta.1",
26
- "@nocobase/acl": "1.6.0-beta.1",
25
+ "@nocobase/database": "1.6.0-beta.11",
26
+ "@nocobase/acl": "1.6.0-beta.11",
27
27
  "sequelize": "6.35.2",
28
- "@nocobase/test": "1.6.0-beta.1",
28
+ "@nocobase/test": "1.6.0-beta.11",
29
29
  "@formily/antd-v5": "1.1.9",
30
30
  "@formily/core": "2.3.0",
31
31
  "@formily/reactive": "2.3.0",
@@ -34,6 +34,7 @@ var data_sources_collections_default = (0, import_database.defineCollection)({
34
34
  name: "dataSourcesCollections",
35
35
  model: "DataSourcesCollectionModel",
36
36
  dumpRules: "required",
37
+ migrationRules: ["overwrite", "schema-only"],
37
38
  shared: true,
38
39
  autoGenId: false,
39
40
  timestamps: false,
@@ -34,6 +34,7 @@ var data_sources_fields_default = (0, import_database.defineCollection)({
34
34
  name: "dataSourcesFields",
35
35
  model: "DataSourcesFieldModel",
36
36
  dumpRules: "required",
37
+ migrationRules: ["overwrite", "schema-only"],
37
38
  shared: true,
38
39
  autoGenId: false,
39
40
  timestamps: false,
@@ -32,6 +32,7 @@ module.exports = __toCommonJS(data_sources_roles_resources_actions_exports);
32
32
  var import_database = require("@nocobase/database");
33
33
  var data_sources_roles_resources_actions_default = (0, import_database.defineCollection)({
34
34
  dumpRules: "required",
35
+ migrationRules: ["overwrite", "schema-only"],
35
36
  name: "dataSourcesRolesResourcesActions",
36
37
  model: "DataSourcesRolesResourcesActionModel",
37
38
  fields: [
@@ -32,6 +32,7 @@ module.exports = __toCommonJS(data_sources_roles_resources_scopes_exports);
32
32
  var import_database = require("@nocobase/database");
33
33
  var data_sources_roles_resources_scopes_default = (0, import_database.defineCollection)({
34
34
  dumpRules: "required",
35
+ migrationRules: ["overwrite", "schema-only"],
35
36
  name: "dataSourcesRolesResourcesScopes",
36
37
  fields: [
37
38
  {
@@ -32,6 +32,7 @@ module.exports = __toCommonJS(data_sources_roles_resources_exports);
32
32
  var import_database = require("@nocobase/database");
33
33
  var data_sources_roles_resources_default = (0, import_database.defineCollection)({
34
34
  dumpRules: "required",
35
+ migrationRules: ["overwrite", "schema-only"],
35
36
  name: "dataSourcesRolesResources",
36
37
  model: "DataSourcesRolesResourcesModel",
37
38
  fields: [
@@ -33,6 +33,7 @@ var import_database = require("@nocobase/database");
33
33
  var data_sources_roles_default = (0, import_database.defineCollection)({
34
34
  name: "dataSourcesRoles",
35
35
  dumpRules: "required",
36
+ migrationRules: ["overwrite", "schema-only"],
36
37
  autoGenId: false,
37
38
  timestamps: false,
38
39
  model: "DataSourcesRolesModel",
@@ -36,6 +36,7 @@ var data_sources_default = (0, import_database.defineCollection)({
36
36
  autoGenId: false,
37
37
  shared: true,
38
38
  dumpRules: "required",
39
+ migrationRules: ["overwrite", "schema-only"],
39
40
  fields: [
40
41
  {
41
42
  type: "string",
@@ -6,9 +6,9 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
+ import { ACL } from '@nocobase/acl';
9
10
  import { Model, Transaction } from '@nocobase/database';
10
11
  import { Application } from '@nocobase/server';
11
- import { ACL } from '@nocobase/acl';
12
12
  export declare class DataSourceModel extends Model {
13
13
  isMainRecord(): boolean;
14
14
  loadIntoACL(options: {
@@ -41,7 +41,7 @@ __export(data_source_exports, {
41
41
  module.exports = __toCommonJS(data_source_exports);
42
42
  var import_database = require("@nocobase/database");
43
43
  var import_plugin_acl = require("@nocobase/plugin-acl");
44
- var path = __toESM(require("path"));
44
+ var import_path = __toESM(require("path"));
45
45
  const availableActions = {
46
46
  create: {
47
47
  displayName: '{{t("Add new")}}',
@@ -115,7 +115,7 @@ class DataSourceModel extends import_database.Model {
115
115
  logger: app.logger.child({ dataSourceKey }),
116
116
  sqlLogger: app.sqlLogger.child({ dataSourceKey }),
117
117
  cache: app.cache,
118
- storagePath: path.join(process.cwd(), "storage", "cache", "apps", app.name)
118
+ storagePath: import_path.default.join(process.cwd(), "storage", "cache", "apps", app.name)
119
119
  });
120
120
  dataSource.on("loadingProgress", (progress) => {
121
121
  pluginDataSourceManagerServer.dataSourceLoadingProgress[dataSourceKey] = progress;
@@ -20,6 +20,7 @@ export declare class PluginDataSourceManagerServer extends Plugin {
20
20
  dataSourceLoadingProgress: {
21
21
  [dataSourceKey: string]: LoadingProgress;
22
22
  };
23
+ renderJsonTemplate(template: any): any;
23
24
  beforeLoad(): Promise<void>;
24
25
  load(): Promise<void>;
25
26
  }
@@ -134,6 +134,9 @@ class PluginDataSourceManagerServer extends import_server.Plugin {
134
134
  }
135
135
  }
136
136
  dataSourceLoadingProgress = {};
137
+ renderJsonTemplate(template) {
138
+ return this.app.environment.renderJsonTemplate(template);
139
+ }
137
140
  async beforeLoad() {
138
141
  this.app.db.registerModels({
139
142
  DataSourcesCollectionModel: import_data_sources_collection_model.DataSourcesCollectionModel,
@@ -178,7 +181,7 @@ class PluginDataSourceManagerServer extends import_server.Plugin {
178
181
  throw new Error(`Data source type "${type}" is not registered`);
179
182
  }
180
183
  try {
181
- await klass.testConnection(dataSourceOptions);
184
+ await klass.testConnection(this.renderJsonTemplate(dataSourceOptions || {}));
182
185
  } catch (error) {
183
186
  throw new Error(`Test connection failed: ${error.message}`);
184
187
  }
@@ -344,7 +347,7 @@ class PluginDataSourceManagerServer extends import_server.Plugin {
344
347
  const { options, type } = values;
345
348
  const klass = ctx.app.dataSourceManager.factory.getClass(type);
346
349
  try {
347
- await klass.testConnection(options);
350
+ await klass.testConnection(self.renderJsonTemplate(options));
348
351
  } catch (error) {
349
352
  throw new Error(`Test connection failed: ${error.message}`);
350
353
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-data-source-manager",
3
- "version": "1.6.0-beta.1",
3
+ "version": "1.6.0-beta.11",
4
4
  "main": "dist/server/index.js",
5
5
  "displayName": "Data source manager",
6
6
  "displayName.zh-CN": "数据源管理",
@@ -17,5 +17,5 @@
17
17
  "keywords": [
18
18
  "Data model tools"
19
19
  ],
20
- "gitHead": "69a79d1ed9660beb14ee956ec634f0c6d142acfa"
20
+ "gitHead": "6cff97cdc31b9f191aaecb0f0d358c29e87ebde0"
21
21
  }