@nocobase/plugin-data-source-manager 2.1.0-alpha.13 → 2.1.0-alpha.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.js +1 -1
- package/dist/externalVersion.js +11 -11
- package/dist/node_modules/zod/package.json +1 -1
- package/dist/server/mcp-post-processors.d.ts +24 -0
- package/dist/server/mcp-post-processors.js +158 -0
- package/dist/server/models/data-source.js +1 -1
- package/dist/server/plugin.js +2 -0
- package/package.json +2 -2
package/dist/client/index.js
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("@emotion/css"),require("react-router-dom"),require("@formily/antd-v5"),require("@formily/reactive"),require("@formily/react"),require("@nocobase/plugin-acl/client"),require("@dnd-kit/core"),require("@ant-design/icons"),require("@nocobase/flow-engine"),require("@formily/core"),require("@formily/shared"),require("react"),require("antd"),require("@nocobase/client"),require("antd-style"),require("@nocobase/utils/client"),require("lodash")):"function"==typeof define&&define.amd?define("@nocobase/plugin-data-source-manager",["react-i18next","@emotion/css","react-router-dom","@formily/antd-v5","@formily/reactive","@formily/react","@nocobase/plugin-acl/client","@dnd-kit/core","@ant-design/icons","@nocobase/flow-engine","@formily/core","@formily/shared","react","antd","@nocobase/client","antd-style","@nocobase/utils/client","lodash"],t):"object"==typeof exports?exports["@nocobase/plugin-data-source-manager"]=t(require("react-i18next"),require("@emotion/css"),require("react-router-dom"),require("@formily/antd-v5"),require("@formily/reactive"),require("@formily/react"),require("@nocobase/plugin-acl/client"),require("@dnd-kit/core"),require("@ant-design/icons"),require("@nocobase/flow-engine"),require("@formily/core"),require("@formily/shared"),require("react"),require("antd"),require("@nocobase/client"),require("antd-style"),require("@nocobase/utils/client"),require("lodash")):e["@nocobase/plugin-data-source-manager"]=t(e["react-i18next"],e["@emotion/css"],e["react-router-dom"],e["@formily/antd-v5"],e["@formily/reactive"],e["@formily/react"],e["@nocobase/plugin-acl/client"],e["@dnd-kit/core"],e["@ant-design/icons"],e["@nocobase/flow-engine"],e["@formily/core"],e["@formily/shared"],e.react,e.antd,e["@nocobase/client"],e["antd-style"],e["@nocobase/utils/client"],e.lodash)}(self,function(e,t,n,r,o,a,i,c,u,l,s,f,p,d,b,y,g,h){return function(){"use strict";var m,v,w,O={719:function(e,t,n){n.r(t),n.d(t,{PluginDataSourceManagerClient:function(){return M}});var r=n(342),o=n(79),a=n.n(o),i=n(768),c=n(155),u=n.n(c),l=n(135),s=n(872);function f(e,t,n,r,o,a,i){try{var c=e[a](i),u=c.value}catch(e){n(e);return}c.done?t(u):Promise.resolve(u).then(r,o)}function p(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){f(a,r,o,i,c,"next",e)}function c(e){f(a,r,o,i,c,"throw",e)}i(void 0)})}}function d(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function b(e,t,n){return(b=O()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&v(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 g(e,t,n){return t&&y(e.prototype,t),n&&y(e,n),e}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function w(e){var t="function"==typeof Map?new Map:void 0;return(w=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return b(e,arguments,m(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),v(n,e)})(e)}function O(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(O=function(){return!!e})()}function P(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),c=Object.defineProperty;return c(i,"next",{value:u(0)}),c(i,"throw",{value:u(1)}),c(i,"return",{value:u(2)}),"function"==typeof Symbol&&c(i,Symbol.iterator,{value:function(){return this}}),i;function u(c){return function(u){var l=[c,u];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(a=0)),a;)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 a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}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}}}}var S=(0,r.lazy)(function(){return n.e("936").then(n.bind(n,35))},"DatabaseConnectionProvider").DatabaseConnectionProvider,C=(0,r.lazy)(function(){return Promise.all([n.e("936"),n.e("397")]).then(n.bind(n,620))},"BreadcumbTitle").BreadcumbTitle,j=(0,r.lazy)(function(){return Promise.all([n.e("936"),n.e("369"),n.e("420")]).then(n.bind(n,111))},"CollectionManagerPage").CollectionManagerPage,x=(0,r.lazy)(function(){return Promise.all([n.e("936"),n.e("271")]).then(n.bind(n,61))},"DatabaseConnectionManagerPane").DatabaseConnectionManagerPane,k=(0,r.lazy)(function(){return Promise.all([n.e("936"),n.e("369"),n.e("644")]).then(n.bind(n,687))},"MainDataSourceManager").MainDataSourceManager,q=(0,r.lazy)(function(){return n.e("603").then(n.bind(n,886))},"DataSourcePermissionManager").DataSourcePermissionManager,_=(0,r.lazy)(function(){return n.e("416").then(n.bind(n,819))},"CollectionMainProvider").CollectionMainProvider,T=function(){function e(t){d(this,e),h(this,"plugin",void 0),h(this,"componentRegistry",void 0),this.plugin=t,this.componentRegistry=new i.Registry}return g(e,[{key:"registerManagerAction",value:function(e){var t=e.order,n=e.component,r="managerAction";this.componentRegistry.get(r)||this.componentRegistry.register(r,[]),this.componentRegistry.get(r).push({order:null!=t?t:0,component:n})}},{key:"getManagerActions",value:function(){var e;return null!=(e=this.componentRegistry.get("managerAction"))?e:[]}}]),e}(),M=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function t(){var e,n,r;return d(this,t),n=t,r=arguments,n=m(n),h(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,O()?Reflect.construct(n,r||[],m(this).constructor):n.apply(this,r)),"types",new Map),h(e,"extensionManager",new T(e)),h(e,"extendedTabs",{}),e}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&v(t,e),g(t,[{key:"getExtendedTabs",value:function(){return this.extendedTabs}},{key:"registerPermissionTab",value:function(e){this.extendedTabs[(0,i.uid)()]=e}},{key:"load",value:function(){return p(function(){return P(this,function(e){return this.app.pm.get(a()).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(q,{role:r}))}}),this.app.use(S),this.app.pluginSettingsManager.add(s.CU,{title:'{{t("Data sources", { ns: "'.concat(s.CU,'" })}}'),icon:"ClusterOutlined",isPinned:!0,sort:100,showTabs:!1,aclSnippet:"pm.data-source-manager*"}),this.app.pluginSettingsManager.add("".concat(s.CU,".list"),{title:'{{t("Data sources", { ns: "'.concat(s.CU,'" })}}'),Component:x,sort:1,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager"}),this.app.pluginSettingsManager.add("".concat(s.CU,"/:name"),{title:u().createElement(C,null),icon:"ClusterOutlined",isTopLevel:!1,sort:100,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager"}),this.app.pluginSettingsManager.add("".concat(s.CU,"/main"),{title:u().createElement(C,null),icon:"ClusterOutlined",isTopLevel:!1,sort:100,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager.data-source-main",Component:_}),this.app.pluginSettingsManager.add("".concat(s.CU,"/main.collections"),{title:'{{t("Collections", { ns: "'.concat(s.CU,'" })}}'),Component:k,topLevelName:"".concat(s.CU,"/main"),pluginKey:s.CU,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager.data-source-main"}),this.app.pluginSettingsManager.add("".concat(s.CU,"/:name.collections"),{title:'{{t("Collections", { ns: "'.concat(s.CU,'" })}}'),Component:j,topLevelName:"".concat(s.CU,"/:name"),pluginKey:s.CU,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager.data-source-main"}),this.app.dataSourceManager.addDataSources(this.getThirdDataSource.bind(this),l.J),[2]})}).call(this)}},{key:"setDataSources",value:function(){return p(function(){var e,t;return P(this,function(n){switch(n.label){case 0:return[4,this.app.apiClient.request({resource:"dataSources",action:"listEnabled",params:{paginate:!1}})];case 1:return[2,null==(t=n.sent())||null==(e=t.data)?void 0:e.data]}})}).call(this)}},{key:"getThirdDataSource",value:function(){return p(function(){var e,t;return P(this,function(n){switch(n.label){case 0:return[4,this.app.apiClient.request({resource:"dataSources",action:"listEnabled",params:{paginate:!1,appends:["collections"]}})];case 1:return[2,null==(t=n.sent())||null==(e=t.data)?void 0:e.data]}})}).call(this)}},{key:"registerType",value:function(e,t){this.types.set(e,t)}}]),t}(w(r.Plugin));t.default=M},135:function(e,t,n){n.d(t,{J:function(){return u}});var r=n(342);function o(e,t,n,r,o,a,i){try{var c=e[a](i),u=c.value}catch(e){n(e);return}c.done?t(u):Promise.resolve(u).then(r,o)}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(c=function(){return!!e})()}var u=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=a(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,c()?Reflect.construct(e,t||[],a(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&i(n,e),t=[{key:"getDataSource",value:function(){var e;return(e=function(){return function(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),c=Object.defineProperty;return c(i,"next",{value:u(0)}),c(i,"throw",{value:u(1)}),c(i,"return",{value:u(2)}),"function"==typeof Symbol&&c(i,Symbol.iterator,{value:function(){return this}}),i;function u(c){return function(u){var l=[c,u];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(a=0)),a;)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 a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}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){switch(e.label){case 0:return[4,this.app.apiClient.request({url:"dataSources:get/".concat(this.key),params:{appends:["collections"]}})];case 1:return[2,e.sent().data.data]}})},function(){var t=this,n=arguments;return new Promise(function(r,a){var i=e.apply(t,n);function c(e){o(i,r,a,c,u,"next",e)}function u(e){o(i,r,a,c,u,"throw",e)}c(void 0)})}).call(this)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(r.DataSource)},872:function(e,t,n){n.d(t,{CU:function(){return a},VP:function(){return c},vV:function(){return i}});var r=n(342),o=n(953),a="data-source-manager";function i(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;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},o),n=n={ns:a},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))}function c(){return(0,o.useTranslation)([a,"client"],{nsMode:"fallback"})}},375:function(e){e.exports=u},799:function(e){e.exports=c},477:function(e){e.exports=t},418:function(e){e.exports=r},452:function(e){e.exports=s},230:function(e){e.exports=a},992:function(e){e.exports=o},166:function(e){e.exports=f},342:function(e){e.exports=b},694:function(e){e.exports=l},79:function(e){e.exports=i},768:function(e){e.exports=g},59:function(e){e.exports=d},235:function(e){e.exports=y},773:function(e){e.exports=h},155:function(e){e.exports=p},953:function(t){t.exports=e},442:function(e){e.exports=n},835:function(e,t,n){var r=window.__nocobase_public_path__||"";if(!r&&window.location&&window.location.pathname){var o=window.location.pathname||"/",a=o.indexOf("/v2/");r=a>=0?o.slice(0,a+1):"/"}r&&(r=r.replace(/\/v2\/?$/,"/")),r||(r="/"),"/"!==r.charAt(r.length-1)&&(r+="/"),n.p=r+"static/plugins/@nocobase/plugin-data-source-manager/dist/client/"}},P={};function S(e){var t=P[e];if(void 0!==t)return t.exports;var n=P[e]={exports:{}};return O[e](n,n.exports,S),n.exports}S.m=O,S.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return S.d(t,{a:t}),t},S.d=function(e,t){for(var n in t)S.o(t,n)&&!S.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},S.f={},S.e=function(e){return Promise.all(Object.keys(S.f).reduce(function(t,n){return S.f[n](e,t),t},[]))},S.u=function(e){return""+({271:"fa3e4378130aae67",369:"c6568af61b73d4ad",397:"acfbf29a3a591994",416:"bd5678ab7ccc4395",420:"1ee628ced380272f",603:"65f41527bfe3a32a",644:"6b850ca935afda51",936:"6052d2d233279406"})[e]+".js"},S.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),S.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},C={},S.l=function(e,t,n,r){if(C[e])return void C[e].push(t);if(void 0!==n)for(var o,a,i=document.getElementsByTagName("script"),c=0;c<i.length;c++){var u=i[c];if(u.getAttribute("src")==e||u.getAttribute("data-rspack")=="@nocobase/plugin-data-source-manager:"+n){o=u;break}}o||(a=!0,(o=document.createElement("script")).timeout=120,S.nc&&o.setAttribute("nonce",S.nc),o.setAttribute("data-rspack","@nocobase/plugin-data-source-manager:"+n),o.src=e),C[e]=[t];var l=function(t,n){o.onerror=o.onload=null,clearTimeout(s);var r=C[e];if(delete C[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),a&&document.head.appendChild(o)},S.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},S.g.importScripts&&(j=S.g.location+"");var C,j,x=S.g.document;if(!j&&x&&(x.currentScript&&"SCRIPT"===x.currentScript.tagName.toUpperCase()&&(j=x.currentScript.src),!j)){var k=x.getElementsByTagName("script");if(k.length)for(var q=k.length-1;q>-1&&(!j||!/^http(s?):/.test(j));)j=k[q--].src}if(!j)throw Error("Automatic publicPath is not supported in this browser");return S.p=j.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),m={889:0},S.f.j=function(e,t){var n=S.o(m,e)?m[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=m[e]=[t,r]});t.push(n[2]=r);var o=S.p+S.u(e),a=Error();S.l(o,function(t){if(S.o(m,e)&&(0!==(n=m[e])&&(m[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;a.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",a.name="ChunkLoadError",a.type=r,a.request=o,n[1](a)}},"chunk-"+e,e)}},v=function(e,t){var n,r,o=t[0],a=t[1],i=t[2],c=0;if(o.some(function(e){return 0!==m[e]})){for(n in a)S.o(a,n)&&(S.m[n]=a[n]);i&&i(S)}for(e&&e(t);c<o.length;c++)r=o[c],S.o(m,r)&&m[r]&&m[r][0](),m[r]=0},(w=self.webpackChunk_nocobase_plugin_data_source_manager=self.webpackChunk_nocobase_plugin_data_source_manager||[]).forEach(v.bind(null,0)),w.push=v.bind(null,w.push.bind(w)),S(835),S(719)}()});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("@emotion/css"),require("react-router-dom"),require("@formily/antd-v5"),require("@formily/reactive"),require("@formily/react"),require("@nocobase/plugin-acl/client"),require("@dnd-kit/core"),require("@nocobase/flow-engine"),require("@ant-design/icons"),require("@formily/core"),require("@formily/shared"),require("react"),require("antd"),require("@nocobase/client"),require("antd-style"),require("@nocobase/utils/client"),require("lodash")):"function"==typeof define&&define.amd?define("@nocobase/plugin-data-source-manager",["react-i18next","@emotion/css","react-router-dom","@formily/antd-v5","@formily/reactive","@formily/react","@nocobase/plugin-acl/client","@dnd-kit/core","@nocobase/flow-engine","@ant-design/icons","@formily/core","@formily/shared","react","antd","@nocobase/client","antd-style","@nocobase/utils/client","lodash"],t):"object"==typeof exports?exports["@nocobase/plugin-data-source-manager"]=t(require("react-i18next"),require("@emotion/css"),require("react-router-dom"),require("@formily/antd-v5"),require("@formily/reactive"),require("@formily/react"),require("@nocobase/plugin-acl/client"),require("@dnd-kit/core"),require("@nocobase/flow-engine"),require("@ant-design/icons"),require("@formily/core"),require("@formily/shared"),require("react"),require("antd"),require("@nocobase/client"),require("antd-style"),require("@nocobase/utils/client"),require("lodash")):e["@nocobase/plugin-data-source-manager"]=t(e["react-i18next"],e["@emotion/css"],e["react-router-dom"],e["@formily/antd-v5"],e["@formily/reactive"],e["@formily/react"],e["@nocobase/plugin-acl/client"],e["@dnd-kit/core"],e["@nocobase/flow-engine"],e["@ant-design/icons"],e["@formily/core"],e["@formily/shared"],e.react,e.antd,e["@nocobase/client"],e["antd-style"],e["@nocobase/utils/client"],e.lodash)}(self,function(e,t,n,r,o,a,i,c,u,l,s,p,f,d,b,y,g,h){return function(){"use strict";var m,v,w,O={719:function(e,t,n){n.r(t),n.d(t,{PluginDataSourceManagerClient:function(){return M}});var r=n(342),o=n(79),a=n.n(o),i=n(768),c=n(155),u=n.n(c),l=n(135),s=n(872);function p(e,t,n,r,o,a,i){try{var c=e[a](i),u=c.value}catch(e){n(e);return}c.done?t(u):Promise.resolve(u).then(r,o)}function f(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){p(a,r,o,i,c,"next",e)}function c(e){p(a,r,o,i,c,"throw",e)}i(void 0)})}}function d(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function b(e,t,n){return(b=O()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&v(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 g(e,t,n){return t&&y(e.prototype,t),n&&y(e,n),e}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function w(e){var t="function"==typeof Map?new Map:void 0;return(w=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return b(e,arguments,m(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),v(n,e)})(e)}function O(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(O=function(){return!!e})()}function P(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),c=Object.defineProperty;return c(i,"next",{value:u(0)}),c(i,"throw",{value:u(1)}),c(i,"return",{value:u(2)}),"function"==typeof Symbol&&c(i,Symbol.iterator,{value:function(){return this}}),i;function u(c){return function(u){var l=[c,u];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(a=0)),a;)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 a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}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}}}}var S=(0,r.lazy)(function(){return n.e("936").then(n.bind(n,35))},"DatabaseConnectionProvider").DatabaseConnectionProvider,C=(0,r.lazy)(function(){return Promise.all([n.e("936"),n.e("397")]).then(n.bind(n,620))},"BreadcumbTitle").BreadcumbTitle,j=(0,r.lazy)(function(){return Promise.all([n.e("936"),n.e("369"),n.e("420")]).then(n.bind(n,111))},"CollectionManagerPage").CollectionManagerPage,x=(0,r.lazy)(function(){return Promise.all([n.e("936"),n.e("271")]).then(n.bind(n,61))},"DatabaseConnectionManagerPane").DatabaseConnectionManagerPane,k=(0,r.lazy)(function(){return Promise.all([n.e("936"),n.e("369"),n.e("644")]).then(n.bind(n,687))},"MainDataSourceManager").MainDataSourceManager,_=(0,r.lazy)(function(){return n.e("603").then(n.bind(n,886))},"DataSourcePermissionManager").DataSourcePermissionManager,q=(0,r.lazy)(function(){return n.e("416").then(n.bind(n,819))},"CollectionMainProvider").CollectionMainProvider,T=function(){function e(t){d(this,e),h(this,"plugin",void 0),h(this,"componentRegistry",void 0),this.plugin=t,this.componentRegistry=new i.Registry}return g(e,[{key:"registerManagerAction",value:function(e){var t=e.order,n=e.component,r="managerAction";this.componentRegistry.get(r)||this.componentRegistry.register(r,[]),this.componentRegistry.get(r).push({order:null!=t?t:0,component:n})}},{key:"getManagerActions",value:function(){var e;return null!=(e=this.componentRegistry.get("managerAction"))?e:[]}}]),e}(),M=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function t(){var e,n,r;return d(this,t),n=t,r=arguments,n=m(n),h(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,O()?Reflect.construct(n,r||[],m(this).constructor):n.apply(this,r)),"types",new Map),h(e,"extensionManager",new T(e)),h(e,"extendedTabs",{}),e}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&v(t,e),g(t,[{key:"getExtendedTabs",value:function(){return this.extendedTabs}},{key:"registerPermissionTab",value:function(e){this.extendedTabs[(0,i.uid)()]=e}},{key:"load",value:function(){return f(function(){return P(this,function(e){return this.app.pm.get(a()).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(_,{role:r}))}}),this.app.use(S),this.app.pluginSettingsManager.add(s.CU,{title:'{{t("Data sources", { ns: "'.concat(s.CU,'" })}}'),icon:"ClusterOutlined",isPinned:!0,sort:100,showTabs:!1,aclSnippet:"pm.data-source-manager*"}),this.app.pluginSettingsManager.add("".concat(s.CU,".list"),{title:'{{t("Data sources", { ns: "'.concat(s.CU,'" })}}'),Component:x,sort:1,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager"}),this.app.pluginSettingsManager.add("".concat(s.CU,"/:name"),{title:u().createElement(C,null),icon:"ClusterOutlined",isTopLevel:!1,sort:100,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager"}),this.app.pluginSettingsManager.add("".concat(s.CU,"/main"),{title:u().createElement(C,null),icon:"ClusterOutlined",isTopLevel:!1,sort:100,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager.data-source-main",Component:q}),this.app.pluginSettingsManager.add("".concat(s.CU,"/main.collections"),{title:'{{t("Collections", { ns: "'.concat(s.CU,'" })}}'),Component:k,topLevelName:"".concat(s.CU,"/main"),pluginKey:s.CU,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager.data-source-main"}),this.app.pluginSettingsManager.add("".concat(s.CU,"/:name.collections"),{title:'{{t("Collections", { ns: "'.concat(s.CU,'" })}}'),Component:j,topLevelName:"".concat(s.CU,"/:name"),pluginKey:s.CU,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager.data-source-main"}),this.app.dataSourceManager.addDataSources(this.getThirdDataSource.bind(this),l.J),[2]})}).call(this)}},{key:"setDataSources",value:function(){return f(function(){var e,t;return P(this,function(n){switch(n.label){case 0:return[4,this.app.apiClient.request({resource:"dataSources",action:"listEnabled",params:{paginate:!1}})];case 1:return[2,null==(t=n.sent())||null==(e=t.data)?void 0:e.data]}})}).call(this)}},{key:"getThirdDataSource",value:function(){return f(function(){var e,t;return P(this,function(n){switch(n.label){case 0:return[4,this.app.apiClient.request({resource:"dataSources",action:"listEnabled",params:{paginate:!1,appends:["collections"]}})];case 1:return[2,null==(t=n.sent())||null==(e=t.data)?void 0:e.data]}})}).call(this)}},{key:"registerType",value:function(e,t){this.types.set(e,t)}}]),t}(w(r.Plugin));t.default=M},135:function(e,t,n){n.d(t,{J:function(){return u}});var r=n(342);function o(e,t,n,r,o,a,i){try{var c=e[a](i),u=c.value}catch(e){n(e);return}c.done?t(u):Promise.resolve(u).then(r,o)}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(c=function(){return!!e})()}var u=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=a(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,c()?Reflect.construct(e,t||[],a(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&i(n,e),t=[{key:"getDataSource",value:function(){var e;return(e=function(){return function(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),c=Object.defineProperty;return c(i,"next",{value:u(0)}),c(i,"throw",{value:u(1)}),c(i,"return",{value:u(2)}),"function"==typeof Symbol&&c(i,Symbol.iterator,{value:function(){return this}}),i;function u(c){return function(u){var l=[c,u];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(a=0)),a;)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 a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}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){switch(e.label){case 0:return[4,this.app.apiClient.request({url:"dataSources:get/".concat(this.key),params:{appends:["collections"]}})];case 1:return[2,e.sent().data.data]}})},function(){var t=this,n=arguments;return new Promise(function(r,a){var i=e.apply(t,n);function c(e){o(i,r,a,c,u,"next",e)}function u(e){o(i,r,a,c,u,"throw",e)}c(void 0)})}).call(this)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(r.DataSource)},872:function(e,t,n){n.d(t,{CU:function(){return a},VP:function(){return c},vV:function(){return i}});var r=n(342),o=n(953),a="data-source-manager";function i(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;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},o),n=n={ns:a},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))}function c(){return(0,o.useTranslation)([a,"client"],{nsMode:"fallback"})}},375:function(e){e.exports=l},799:function(e){e.exports=c},477:function(e){e.exports=t},418:function(e){e.exports=r},452:function(e){e.exports=s},230:function(e){e.exports=a},992:function(e){e.exports=o},166:function(e){e.exports=p},342:function(e){e.exports=b},694:function(e){e.exports=u},79:function(e){e.exports=i},768:function(e){e.exports=g},59:function(e){e.exports=d},235:function(e){e.exports=y},773:function(e){e.exports=h},155:function(e){e.exports=f},953:function(t){t.exports=e},442:function(e){e.exports=n},634:function(e,t,n){var r="",o="u">typeof document?document.currentScript:null;if(o&&o.src&&(r=o.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!r){var a=window.__webpack_public_path__||"";a&&("/"!==a.charAt(a.length-1)&&(a+="/"),r=a+"static/plugins/@nocobase/plugin-data-source-manager/dist/client/")}if(!r){if(!(r=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var i=window.location.pathname||"/",c=i.indexOf("/v2/");r=c>=0?i.slice(0,c+1):"/"}r&&(r=r.replace(/\/v2\/?$/,"/")),r||(r="/"),"/"!==r.charAt(r.length-1)&&(r+="/"),r+="static/plugins/@nocobase/plugin-data-source-manager/dist/client/"}n.p=r}},P={};function S(e){var t=P[e];if(void 0!==t)return t.exports;var n=P[e]={exports:{}};return O[e](n,n.exports,S),n.exports}S.m=O,S.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return S.d(t,{a:t}),t},S.d=function(e,t){for(var n in t)S.o(t,n)&&!S.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},S.f={},S.e=function(e){return Promise.all(Object.keys(S.f).reduce(function(t,n){return S.f[n](e,t),t},[]))},S.u=function(e){return""+({271:"fa3e4378130aae67",369:"c6568af61b73d4ad",397:"acfbf29a3a591994",416:"bd5678ab7ccc4395",420:"1ee628ced380272f",603:"65f41527bfe3a32a",644:"6b850ca935afda51",936:"6052d2d233279406"})[e]+".js"},S.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),S.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},C={},S.l=function(e,t,n,r){if(C[e])return void C[e].push(t);if(void 0!==n)for(var o,a,i=document.getElementsByTagName("script"),c=0;c<i.length;c++){var u=i[c];if(u.getAttribute("src")==e||u.getAttribute("data-rspack")=="@nocobase/plugin-data-source-manager:"+n){o=u;break}}o||(a=!0,(o=document.createElement("script")).timeout=120,S.nc&&o.setAttribute("nonce",S.nc),o.setAttribute("data-rspack","@nocobase/plugin-data-source-manager:"+n),o.src=e),C[e]=[t];var l=function(t,n){o.onerror=o.onload=null,clearTimeout(s);var r=C[e];if(delete C[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),a&&document.head.appendChild(o)},S.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},S.g.importScripts&&(j=S.g.location+"");var C,j,x=S.g.document;if(!j&&x&&(x.currentScript&&"SCRIPT"===x.currentScript.tagName.toUpperCase()&&(j=x.currentScript.src),!j)){var k=x.getElementsByTagName("script");if(k.length)for(var _=k.length-1;_>-1&&(!j||!/^http(s?):/.test(j));)j=k[_--].src}if(!j)throw Error("Automatic publicPath is not supported in this browser");return S.p=j.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),m={889:0},S.f.j=function(e,t){var n=S.o(m,e)?m[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=m[e]=[t,r]});t.push(n[2]=r);var o=S.p+S.u(e),a=Error();S.l(o,function(t){if(S.o(m,e)&&(0!==(n=m[e])&&(m[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;a.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",a.name="ChunkLoadError",a.type=r,a.request=o,n[1](a)}},"chunk-"+e,e)}},v=function(e,t){var n,r,o=t[0],a=t[1],i=t[2],c=0;if(o.some(function(e){return 0!==m[e]})){for(n in a)S.o(a,n)&&(S.m[n]=a[n]);i&&i(S)}for(e&&e(t);c<o.length;c++)r=o[c],S.o(m,r)&&m[r]&&m[r][0](),m[r]=0},(w=self.webpackChunk_nocobase_plugin_data_source_manager=self.webpackChunk_nocobase_plugin_data_source_manager||[]).forEach(v.bind(null,0)),w.push=v.bind(null,w.push.bind(w)),S(634),S(719)}()});
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,27 +8,27 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "2.1.0-alpha.
|
|
11
|
+
"@nocobase/client": "2.1.0-alpha.14",
|
|
12
12
|
"react": "18.2.0",
|
|
13
|
-
"@nocobase/plugin-acl": "2.1.0-alpha.
|
|
14
|
-
"@nocobase/utils": "2.1.0-alpha.
|
|
15
|
-
"@nocobase/
|
|
16
|
-
"@nocobase/
|
|
13
|
+
"@nocobase/plugin-acl": "2.1.0-alpha.14",
|
|
14
|
+
"@nocobase/utils": "2.1.0-alpha.14",
|
|
15
|
+
"@nocobase/ai": "2.1.0-alpha.14",
|
|
16
|
+
"@nocobase/server": "2.1.0-alpha.14",
|
|
17
|
+
"@nocobase/data-source-manager": "2.1.0-alpha.14",
|
|
17
18
|
"lodash": "4.17.21",
|
|
18
|
-
"@nocobase/acl": "2.1.0-alpha.
|
|
19
|
-
"@nocobase/database": "2.1.0-alpha.
|
|
19
|
+
"@nocobase/acl": "2.1.0-alpha.14",
|
|
20
|
+
"@nocobase/database": "2.1.0-alpha.14",
|
|
20
21
|
"@ant-design/icons": "5.6.1",
|
|
21
22
|
"antd": "5.24.2",
|
|
22
23
|
"react-router-dom": "6.30.1",
|
|
23
|
-
"@nocobase/flow-engine": "2.1.0-alpha.
|
|
24
|
+
"@nocobase/flow-engine": "2.1.0-alpha.14",
|
|
24
25
|
"@formily/shared": "2.3.7",
|
|
25
26
|
"@formily/react": "2.3.7",
|
|
26
27
|
"react-i18next": "11.18.6",
|
|
27
28
|
"@emotion/css": "11.13.0",
|
|
28
|
-
"@nocobase/actions": "2.1.0-alpha.
|
|
29
|
+
"@nocobase/actions": "2.1.0-alpha.14",
|
|
29
30
|
"sequelize": "6.35.2",
|
|
30
|
-
"@nocobase/
|
|
31
|
-
"@nocobase/test": "2.1.0-alpha.13",
|
|
31
|
+
"@nocobase/test": "2.1.0-alpha.14",
|
|
32
32
|
"@formily/antd-v5": "1.2.3",
|
|
33
33
|
"@formily/core": "2.3.7",
|
|
34
34
|
"@formily/reactive": "2.3.7",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"zod","version":"4.3.5","type":"module","license":"MIT","author":"Colin McDonnell <zod@colinhacks.com>","description":"TypeScript-first schema declaration and validation library with static type inference","homepage":"https://zod.dev","llms":"https://zod.dev/llms.txt","llmsFull":"https://zod.dev/llms-full.txt","mcpServer":"https://mcp.inkeep.com/zod/mcp","funding":"https://github.com/sponsors/colinhacks","sideEffects":false,"files":["src","**/*.js","**/*.mjs","**/*.cjs","**/*.d.ts","**/*.d.mts","**/*.d.cts","**/package.json"],"keywords":["typescript","schema","validation","type","inference"],"main":"./index.cjs","types":"./index.d.cts","module":"./index.js","zshy":{"exports":{"./package.json":"./package.json",".":"./src/index.ts","./mini":"./src/mini/index.ts","./locales":"./src/locales/index.ts","./v3":"./src/v3/index.ts","./v4":"./src/v4/index.ts","./v4-mini":"./src/v4-mini/index.ts","./v4/mini":"./src/v4/mini/index.ts","./v4/core":"./src/v4/core/index.ts","./v4/locales":"./src/v4/locales/index.ts","./v4/locales/*":"./src/v4/locales/*"},"conditions":{"@zod/source":"src"}},"exports":{"./package.json":"./package.json",".":{"@zod/source":"./src/index.ts","types":"./index.d.cts","import":"./index.js","require":"./index.cjs"},"./mini":{"@zod/source":"./src/mini/index.ts","types":"./mini/index.d.cts","import":"./mini/index.js","require":"./mini/index.cjs"},"./locales":{"@zod/source":"./src/locales/index.ts","types":"./locales/index.d.cts","import":"./locales/index.js","require":"./locales/index.cjs"},"./v3":{"@zod/source":"./src/v3/index.ts","types":"./v3/index.d.cts","import":"./v3/index.js","require":"./v3/index.cjs"},"./v4":{"@zod/source":"./src/v4/index.ts","types":"./v4/index.d.cts","import":"./v4/index.js","require":"./v4/index.cjs"},"./v4-mini":{"@zod/source":"./src/v4-mini/index.ts","types":"./v4-mini/index.d.cts","import":"./v4-mini/index.js","require":"./v4-mini/index.cjs"},"./v4/mini":{"@zod/source":"./src/v4/mini/index.ts","types":"./v4/mini/index.d.cts","import":"./v4/mini/index.js","require":"./v4/mini/index.cjs"},"./v4/core":{"@zod/source":"./src/v4/core/index.ts","types":"./v4/core/index.d.cts","import":"./v4/core/index.js","require":"./v4/core/index.cjs"},"./v4/locales":{"@zod/source":"./src/v4/locales/index.ts","types":"./v4/locales/index.d.cts","import":"./v4/locales/index.js","require":"./v4/locales/index.cjs"},"./v4/locales/*":{"@zod/source":"./src/v4/locales/*","types":"./v4/locales/*","import":"./v4/locales/*","require":"./v4/locales/*"}},"repository":{"type":"git","url":"git+https://github.com/colinhacks/zod.git"},"bugs":{"url":"https://github.com/colinhacks/zod/issues"},"support":{"backing":{"npm-funding":true}},"scripts":{"clean":"git clean -xdf . -e node_modules","build":"zshy --project tsconfig.build.json","postbuild":"tsx ../../scripts/write-stub-package-jsons.ts && pnpm biome check --write .","test:watch":"pnpm vitest","test":"pnpm vitest run","prepublishOnly":"tsx ../../scripts/check-versions.ts"},"_lastModified":"2026-
|
|
1
|
+
{"name":"zod","version":"4.3.5","type":"module","license":"MIT","author":"Colin McDonnell <zod@colinhacks.com>","description":"TypeScript-first schema declaration and validation library with static type inference","homepage":"https://zod.dev","llms":"https://zod.dev/llms.txt","llmsFull":"https://zod.dev/llms-full.txt","mcpServer":"https://mcp.inkeep.com/zod/mcp","funding":"https://github.com/sponsors/colinhacks","sideEffects":false,"files":["src","**/*.js","**/*.mjs","**/*.cjs","**/*.d.ts","**/*.d.mts","**/*.d.cts","**/package.json"],"keywords":["typescript","schema","validation","type","inference"],"main":"./index.cjs","types":"./index.d.cts","module":"./index.js","zshy":{"exports":{"./package.json":"./package.json",".":"./src/index.ts","./mini":"./src/mini/index.ts","./locales":"./src/locales/index.ts","./v3":"./src/v3/index.ts","./v4":"./src/v4/index.ts","./v4-mini":"./src/v4-mini/index.ts","./v4/mini":"./src/v4/mini/index.ts","./v4/core":"./src/v4/core/index.ts","./v4/locales":"./src/v4/locales/index.ts","./v4/locales/*":"./src/v4/locales/*"},"conditions":{"@zod/source":"src"}},"exports":{"./package.json":"./package.json",".":{"@zod/source":"./src/index.ts","types":"./index.d.cts","import":"./index.js","require":"./index.cjs"},"./mini":{"@zod/source":"./src/mini/index.ts","types":"./mini/index.d.cts","import":"./mini/index.js","require":"./mini/index.cjs"},"./locales":{"@zod/source":"./src/locales/index.ts","types":"./locales/index.d.cts","import":"./locales/index.js","require":"./locales/index.cjs"},"./v3":{"@zod/source":"./src/v3/index.ts","types":"./v3/index.d.cts","import":"./v3/index.js","require":"./v3/index.cjs"},"./v4":{"@zod/source":"./src/v4/index.ts","types":"./v4/index.d.cts","import":"./v4/index.js","require":"./v4/index.cjs"},"./v4-mini":{"@zod/source":"./src/v4-mini/index.ts","types":"./v4-mini/index.d.cts","import":"./v4-mini/index.js","require":"./v4-mini/index.cjs"},"./v4/mini":{"@zod/source":"./src/v4/mini/index.ts","types":"./v4/mini/index.d.cts","import":"./v4/mini/index.js","require":"./v4/mini/index.cjs"},"./v4/core":{"@zod/source":"./src/v4/core/index.ts","types":"./v4/core/index.d.cts","import":"./v4/core/index.js","require":"./v4/core/index.cjs"},"./v4/locales":{"@zod/source":"./src/v4/locales/index.ts","types":"./v4/locales/index.d.cts","import":"./v4/locales/index.js","require":"./v4/locales/index.cjs"},"./v4/locales/*":{"@zod/source":"./src/v4/locales/*","types":"./v4/locales/*","import":"./v4/locales/*","require":"./v4/locales/*"}},"repository":{"type":"git","url":"git+https://github.com/colinhacks/zod.git"},"bugs":{"url":"https://github.com/colinhacks/zod/issues"},"support":{"backing":{"npm-funding":true}},"scripts":{"clean":"git clean -xdf . -e node_modules","build":"zshy --project tsconfig.build.json","postbuild":"tsx ../../scripts/write-stub-package-jsons.ts && pnpm biome check --write .","test:watch":"pnpm vitest","test":"pnpm vitest run","prepublishOnly":"tsx ../../scripts/check-versions.ts"},"_lastModified":"2026-04-07T15:54:43.080Z"}
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
import type { McpToolsManager } from '@nocobase/ai';
|
|
10
|
+
export declare function simplifyDataSourceListResult(result: any): {
|
|
11
|
+
data: any;
|
|
12
|
+
meta: any;
|
|
13
|
+
};
|
|
14
|
+
export declare function simplifyDataSourceCollectionsListResult(result: any): {
|
|
15
|
+
data: any;
|
|
16
|
+
meta: any;
|
|
17
|
+
};
|
|
18
|
+
export declare function simplifyDataSourceFieldsListResult(result: any, options?: {
|
|
19
|
+
args?: Record<string, any>;
|
|
20
|
+
}): {
|
|
21
|
+
data: any;
|
|
22
|
+
meta: any;
|
|
23
|
+
};
|
|
24
|
+
export declare function registerDataSourceManagerMcpPostProcessors(manager: McpToolsManager): void;
|
|
@@ -0,0 +1,158 @@
|
|
|
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
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __export = (target, all) => {
|
|
15
|
+
for (var name in all)
|
|
16
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
+
};
|
|
18
|
+
var __copyProps = (to, from, except, desc) => {
|
|
19
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
+
for (let key of __getOwnPropNames(from))
|
|
21
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
+
var mcp_post_processors_exports = {};
|
|
28
|
+
__export(mcp_post_processors_exports, {
|
|
29
|
+
registerDataSourceManagerMcpPostProcessors: () => registerDataSourceManagerMcpPostProcessors,
|
|
30
|
+
simplifyDataSourceCollectionsListResult: () => simplifyDataSourceCollectionsListResult,
|
|
31
|
+
simplifyDataSourceFieldsListResult: () => simplifyDataSourceFieldsListResult,
|
|
32
|
+
simplifyDataSourceListResult: () => simplifyDataSourceListResult
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(mcp_post_processors_exports);
|
|
35
|
+
function toArray(value) {
|
|
36
|
+
if (Array.isArray(value)) {
|
|
37
|
+
return value;
|
|
38
|
+
}
|
|
39
|
+
if (Array.isArray(value == null ? void 0 : value.data)) {
|
|
40
|
+
return value.data;
|
|
41
|
+
}
|
|
42
|
+
return [];
|
|
43
|
+
}
|
|
44
|
+
function parseAssociatedIndex(value) {
|
|
45
|
+
if (typeof value !== "string") {
|
|
46
|
+
return {};
|
|
47
|
+
}
|
|
48
|
+
const separatorIndex = value.indexOf(".");
|
|
49
|
+
if (separatorIndex === -1) {
|
|
50
|
+
return {};
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
dataSourceKey: value.slice(0, separatorIndex),
|
|
54
|
+
collectionName: value.slice(separatorIndex + 1)
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function pickDataSourceSummary(item) {
|
|
58
|
+
const summary = {
|
|
59
|
+
displayName: item == null ? void 0 : item.displayName,
|
|
60
|
+
key: item == null ? void 0 : item.key,
|
|
61
|
+
type: item == null ? void 0 : item.type,
|
|
62
|
+
status: item == null ? void 0 : item.status
|
|
63
|
+
};
|
|
64
|
+
if (Array.isArray(item == null ? void 0 : item.collections)) {
|
|
65
|
+
summary.collections = item.collections.map((collection) => {
|
|
66
|
+
const nextCollection = pickCollectionSummary({
|
|
67
|
+
...collection,
|
|
68
|
+
dataSourceKey: (collection == null ? void 0 : collection.dataSourceKey) ?? (item == null ? void 0 : item.key)
|
|
69
|
+
});
|
|
70
|
+
if (Array.isArray(collection == null ? void 0 : collection.fields)) {
|
|
71
|
+
nextCollection.fields = collection.fields.map(
|
|
72
|
+
(field) => pickRemoteFieldSummary(field, {
|
|
73
|
+
dataSourceKey: (collection == null ? void 0 : collection.dataSourceKey) ?? (item == null ? void 0 : item.key),
|
|
74
|
+
collectionName: collection == null ? void 0 : collection.name
|
|
75
|
+
})
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
return nextCollection;
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
return summary;
|
|
82
|
+
}
|
|
83
|
+
function pickCollectionSummary(item) {
|
|
84
|
+
var _a, _b;
|
|
85
|
+
return {
|
|
86
|
+
name: item == null ? void 0 : item.name,
|
|
87
|
+
title: (item == null ? void 0 : item.title) ?? ((_a = item == null ? void 0 : item.options) == null ? void 0 : _a.title) ?? (item == null ? void 0 : item.displayName),
|
|
88
|
+
description: (item == null ? void 0 : item.description) ?? ((_b = item == null ? void 0 : item.options) == null ? void 0 : _b.description),
|
|
89
|
+
dataSourceKey: item == null ? void 0 : item.dataSourceKey
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
function pickFieldSummary(item) {
|
|
93
|
+
var _a;
|
|
94
|
+
return {
|
|
95
|
+
name: item == null ? void 0 : item.name,
|
|
96
|
+
type: item == null ? void 0 : item.type,
|
|
97
|
+
title: (_a = item == null ? void 0 : item.uiSchema) == null ? void 0 : _a.title,
|
|
98
|
+
description: item == null ? void 0 : item.description,
|
|
99
|
+
dataSourceKey: item == null ? void 0 : item.dataSourceKey,
|
|
100
|
+
collectionName: item == null ? void 0 : item.collectionName
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
function pickRemoteFieldSummary(item, defaults) {
|
|
104
|
+
var _a;
|
|
105
|
+
return {
|
|
106
|
+
name: item == null ? void 0 : item.name,
|
|
107
|
+
type: item == null ? void 0 : item.type,
|
|
108
|
+
title: (_a = item == null ? void 0 : item.uiSchema) == null ? void 0 : _a.title,
|
|
109
|
+
description: item == null ? void 0 : item.description,
|
|
110
|
+
dataSourceKey: item == null ? void 0 : item.dataSourceKey,
|
|
111
|
+
collectionName: item == null ? void 0 : item.collectionName,
|
|
112
|
+
...defaults
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
function simplifyDataSourceListResult(result) {
|
|
116
|
+
const items = toArray(result);
|
|
117
|
+
return {
|
|
118
|
+
data: items.map((item) => pickDataSourceSummary(item)),
|
|
119
|
+
meta: result == null ? void 0 : result.meta
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
function simplifyDataSourceCollectionsListResult(result) {
|
|
123
|
+
const items = toArray(result);
|
|
124
|
+
return {
|
|
125
|
+
data: items.map((item) => pickCollectionSummary(item)),
|
|
126
|
+
meta: result == null ? void 0 : result.meta
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
function simplifyDataSourceFieldsListResult(result, options) {
|
|
130
|
+
var _a;
|
|
131
|
+
const items = toArray(result);
|
|
132
|
+
const defaults = parseAssociatedIndex((_a = options == null ? void 0 : options.args) == null ? void 0 : _a.associatedIndex);
|
|
133
|
+
return {
|
|
134
|
+
data: items.map(
|
|
135
|
+
(item) => (item == null ? void 0 : item.dataSourceKey) || (item == null ? void 0 : item.collectionName) ? pickFieldSummary(item) : pickRemoteFieldSummary(item, defaults)
|
|
136
|
+
),
|
|
137
|
+
meta: result == null ? void 0 : result.meta
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
function registerDataSourceManagerMcpPostProcessors(manager) {
|
|
141
|
+
manager.registerToolResultPostProcessor("dataSources", "list", simplifyDataSourceListResult);
|
|
142
|
+
manager.registerToolResultPostProcessor("dataSources", "listEnabled", simplifyDataSourceListResult);
|
|
143
|
+
manager.registerToolResultPostProcessor("dataSources.collections", "list", simplifyDataSourceCollectionsListResult);
|
|
144
|
+
manager.registerToolResultPostProcessor(
|
|
145
|
+
"dataSourcesCollections.fields",
|
|
146
|
+
"list",
|
|
147
|
+
(result, context) => simplifyDataSourceFieldsListResult(result, {
|
|
148
|
+
args: context == null ? void 0 : context.args
|
|
149
|
+
})
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
153
|
+
0 && (module.exports = {
|
|
154
|
+
registerDataSourceManagerMcpPostProcessors,
|
|
155
|
+
simplifyDataSourceCollectionsListResult,
|
|
156
|
+
simplifyDataSourceFieldsListResult,
|
|
157
|
+
simplifyDataSourceListResult
|
|
158
|
+
});
|
package/dist/server/plugin.js
CHANGED
|
@@ -57,6 +57,7 @@ var import_data_source = require("./models/data-source");
|
|
|
57
57
|
var import_data_sources_roles_model = require("./models/data-sources-roles-model");
|
|
58
58
|
var import_acl = require("@nocobase/acl");
|
|
59
59
|
var import_load_tables = require("./middlewares/load-tables");
|
|
60
|
+
var import_mcp_post_processors = require("./mcp-post-processors");
|
|
60
61
|
class PluginDataSourceManagerServer extends import_server.Plugin {
|
|
61
62
|
dataSourceErrors = {};
|
|
62
63
|
dataSourceStatus = {};
|
|
@@ -313,6 +314,7 @@ class PluginDataSourceManagerServer extends import_server.Plugin {
|
|
|
313
314
|
await next();
|
|
314
315
|
});
|
|
315
316
|
this.app.resourceManager.use(import_load_tables.loadDataSourceTablesIntoCollections);
|
|
317
|
+
(0, import_mcp_post_processors.registerDataSourceManagerMcpPostProcessors)(this.ai.mcpToolsManager);
|
|
316
318
|
this.app.use(async function handleAppendDataSourceCollection(ctx, next) {
|
|
317
319
|
await next();
|
|
318
320
|
if (!ctx.action) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-data-source-manager",
|
|
3
|
-
"version": "2.1.0-alpha.
|
|
3
|
+
"version": "2.1.0-alpha.14",
|
|
4
4
|
"main": "dist/server/index.js",
|
|
5
5
|
"displayName": "Data source manager",
|
|
6
6
|
"displayName.ru-RU": "Менеджер управления источниками данных",
|
|
@@ -20,6 +20,6 @@
|
|
|
20
20
|
"keywords": [
|
|
21
21
|
"Data model tools"
|
|
22
22
|
],
|
|
23
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "d8735b541de0ff9557bba704de49c799b4962672",
|
|
24
24
|
"license": "Apache-2.0"
|
|
25
25
|
}
|