@nocobase/plugin-data-source-manager 2.1.0-alpha.10 → 2.1.0-alpha.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/ai/ai-employees/orin/index.d.ts +10 -0
  2. package/dist/ai/ai-employees/orin/index.js +58 -0
  3. package/dist/ai/ai-employees/orin/skills/data-modeling/SKILLS.md +245 -0
  4. package/dist/ai/{tools → ai-employees/orin/skills/data-modeling/tools}/defineCollections.js +1 -1
  5. package/dist/ai/{tools → ai-employees/orin/skills/data-modeling/tools}/intentRouter.js +1 -1
  6. package/dist/ai/{tools/data-query → common}/common.js +1 -1
  7. package/dist/ai/skills/data-metadata/SKILLS.md +103 -0
  8. package/dist/ai/{tools → skills/data-metadata/tools}/getCollectionMetadata.js +2 -2
  9. package/dist/ai/{tools → skills/data-metadata/tools}/getCollectionNames.js +2 -2
  10. package/dist/ai/{tools → skills/data-metadata/tools}/getDataSources.js +2 -2
  11. package/dist/ai/{tools → skills/data-metadata/tools}/searchFieldMetadata.js +2 -2
  12. package/dist/ai/skills/data-query/SKILLS.md +192 -0
  13. package/dist/ai/{tools/data-query → skills/data-query/tools}/dataSourceCounting.js +3 -3
  14. package/dist/ai/{tools/data-query → skills/data-query/tools}/dataSourceQuery.js +4 -4
  15. package/dist/client/1ee628ced380272f.js +10 -0
  16. package/dist/client/6052d2d233279406.js +10 -0
  17. package/dist/client/{548d1ad2c4dcb4ab.js → 65f41527bfe3a32a.js} +1 -1
  18. package/dist/client/{9eb557741d278421.js → 6b850ca935afda51.js} +1 -1
  19. package/dist/client/{742f8239c656158e.js → acfbf29a3a591994.js} +1 -1
  20. package/dist/client/{fda01baf97978ee3.js → bd5678ab7ccc4395.js} +1 -1
  21. package/dist/client/c6568af61b73d4ad.js +10 -0
  22. package/dist/client/fa3e4378130aae67.js +10 -0
  23. package/dist/client/index.js +1 -1
  24. package/dist/externalVersion.js +11 -11
  25. package/dist/locale/en-US.json +7 -1
  26. package/dist/locale/zh-CN.json +7 -1
  27. package/dist/node_modules/zod/package.json +1 -1
  28. package/dist/swagger/index.d.ts +122 -0
  29. package/dist/swagger/index.js +146 -0
  30. package/package.json +2 -2
  31. package/dist/client/015f545e0166ca31.js +0 -10
  32. package/dist/client/4efac009b1b9ce6a.js +0 -10
  33. package/dist/client/a66fb4a5aeb902b7.js +0 -10
  34. package/dist/client/afe2c8a775c95c10.js +0 -10
  35. /package/dist/ai/{tools → ai-employees/orin/skills/data-modeling/tools}/defineCollections.d.ts +0 -0
  36. /package/dist/ai/{tools → ai-employees/orin/skills/data-modeling/tools}/intentRouter.d.ts +0 -0
  37. /package/dist/ai/{tools/data-query → common}/common.d.ts +0 -0
  38. /package/dist/ai/{tools/data-query → common}/utils.d.ts +0 -0
  39. /package/dist/ai/{tools/data-query → common}/utils.js +0 -0
  40. /package/dist/ai/{tools → skills/data-metadata/tools}/getCollectionMetadata.d.ts +0 -0
  41. /package/dist/ai/{tools → skills/data-metadata/tools}/getCollectionNames.d.ts +0 -0
  42. /package/dist/ai/{tools → skills/data-metadata/tools}/getDataSources.d.ts +0 -0
  43. /package/dist/ai/{tools → skills/data-metadata/tools}/searchFieldMetadata.d.ts +0 -0
  44. /package/dist/ai/{tools/data-query → skills/data-query/tools}/dataSourceCounting.d.ts +0 -0
  45. /package/dist/ai/{tools/data-query → skills/data-query/tools}/dataSourceQuery.d.ts +0 -0
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ "use strict";(self.webpackChunk_nocobase_plugin_data_source_manager=self.webpackChunk_nocobase_plugin_data_source_manager||[]).push([["271"],{61:function(e,t,n){n.r(t),n.d(t,{DatabaseConnectionManagerPane:function(){return J}});var r=n(166),o=n(342),a=n(59),l=n(155),i=n.n(l),c=n(953),u=n(719),s=n(221),p=n(135),f=n(375),d=n(230),m=n(691),y=n(872),b=n(694);function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t,n,r,o,a,l){try{var i=e[a](l),c=i.value}catch(e){n(e);return}i.done?t(c):Promise.resolve(c).then(r,o)}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function C(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function x(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],l=!0,i=!1;try{for(o=o.call(e);!(l=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);l=!0);}catch(e){i=!0,r=e}finally{try{l||null==o.return||o.return()}finally{if(i)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return v(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var S=(0,b.observer)(function(e){var t,n,r,c,u,s,p,d,m,y,b=(0,o.useAPIClient)(),v=x((0,l.useState)(!1),2),S=v[0],w=v[1],A=x((0,l.useState)(""),2),k=A[0],O=A[1],P=x((0,l.useState)([]),2),E=P[0],j=P[1],D=x((0,l.useState)(new Map),2),T=D[0],I=D[1],M=x((0,l.useState)(!1),2),q=M[0],R=M[1],V=(0,l.useRef)(),_=e.NAMESPACE,F=e.t,U=(null==(n=e.formValues)||null==(t=n.options)?void 0:t.addAllCollections)===void 0||(null==(c=e.formValues)||null==(r=c.options)?void 0:r.addAllCollections),$=x((0,l.useState)(U),2),L=$[0],N=$[1],z=(0,l.useMemo)(function(){var t=e.value&&e.value.length>0?e.value:E;return k.trim()&&(t=t.filter(function(e){var t;return null==(t=e.name)?void 0:t.toLowerCase().includes(k.toLowerCase())})),t},[e.value,E,k]),B=(0,l.useMemo)(function(){return e.value&&e.value.length>0?e.value:E},[e.value,E]),W=(0,l.useMemo)(function(){var t,n=null==(t=e.options)?void 0:t.tablePrefix;return z.map(function(e){var t,r=!1;return e.required||q?r=!0:T.get(e.name)&&(!n||!n.trim()||(null==(t=e.name)?void 0:t.startsWith(n.trim())))&&(r=!0),C(g({},e),{selected:r})})},[z,T,q,null==(u=e.options)?void 0:u.tablePrefix]),K=(0,l.useRef)(null==(s=e.options)?void 0:s.tablePrefix);(0,l.useEffect)(function(){var t=null==(n=e.options)?void 0:n.tablePrefix;if(K.current!==t&&E.length>0){K.current=t;var n,r,o=E.map(function(e){var n,r=!1;return e.required?r=!0:T.get(e.name)&&(!t||!t.trim()||(null==(n=e.name)?void 0:n.startsWith(t.trim())))&&(r=!0),C(g({},e),{selected:r})});null==(r=e.onChange)||r.call(e,o)}},[null==(p=e.options)?void 0:p.tablePrefix,E.length,T]),(0,l.useEffect)(function(){if(B.length>0){var e=new Map;B.forEach(function(t){t.selected&&e.set(t.name,!0)}),I(e),R(!1)}},[B.length]);var G=(0,l.useCallback)(function(t){N(t),e.formSetValues&&e.formSetValues("options.addAllCollections",t)},[e.formSetValues]),H=(0,l.useCallback)(function(){var t;return(t=function(){var t,n,r,o,l,i,c,u,s,p,f,d,m;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:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(l,"next",{value:c(0)}),i(l,"throw",{value:c(1)}),i(l,"return",{value:c(2)}),"function"==typeof Symbol&&i(l,Symbol.iterator,{value:function(){return this}}),l;function c(i){return function(c){var u=[i,c];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(y){switch(y.label){case 0:if(t=e.dataSourceKey,n=e.formValues,r=e.onChange,o=e.from,l=(null==n?void 0:n.options)||{},i=F("is required"),"oracle"!==n.type){if(!t)return a.message.error(F("Data source name",{ns:_})+i),[2];if(!l.host)return a.message.error(F("Host",{ns:_})+i),[2];if(!l.port)return a.message.error(F("Port",{ns:_})+i),[2];if(!l.database)return a.message.error(F("Database",{ns:_})+i),[2];if(!l.username)return a.message.error(F("Username",{ns:_})+i),[2]}w(!0),y.label=1;case 1:return y.trys.push([1,3,4,5]),[4,b.resource("dataSources").readTables({values:g({dataSourceKey:t},"create"===o?{dbOptions:C(g({},l),{type:n.type||"mysql"})}:{})})];case 2:return j(u=((null==(c=y.sent())?void 0:c.data)||{}).data||[]),s=0===T.size&&e.value&&e.value.length>0,p=T,s&&(f=new Map,e.value.forEach(function(e){e.selected&&f.set(e.name,!0)}),I(f),p=f),d=l.tablePrefix,m=u.map(function(e){var t,n=!1;return e.required?n=!0:p.get(e.name)&&(!d||!d.trim()||(null==(t=e.name)?void 0:t.startsWith(d.trim())))&&(n=!0),C(g({},e),{selected:n})}),r&&r(m),[3,5];case 3:return console.error("Error loading collections:",y.sent()),a.message.error(F("Failed to load collections",{ns:_})),[3,5];case 4:return w(!1),[7];case 5:return[2]}})},function(){var e=this,n=arguments;return new Promise(function(r,o){var a=t.apply(e,n);function l(e){h(a,r,o,l,i,"next",e)}function i(e){h(a,r,o,l,i,"throw",e)}l(void 0)})})()},[e.dataSourceKey,e.formValues,e.options,e.from,e.tablePrefix,b,F,_]),J=(0,l.useCallback)(function(e){V.current&&clearTimeout(V.current),V.current=setTimeout(function(){O(e)},300)},[]);(0,l.useEffect)(function(){return function(){V.current&&clearTimeout(V.current)}},[]);var Q=(0,l.useMemo)(function(){var t,n=null==(t=e.options)?void 0:t.tablePrefix,r=B.filter(function(e){var t;return!!e.required||!!T.get(e.name)&&!!(!n||!n.trim()||(null==(t=e.name)?void 0:t.startsWith(n.trim())))}).length,o=W.filter(function(e){return!e.required}),a=W.filter(function(e){return e.selected||e.required}).length;return{isAllSelected:o.length>0&&a===W.length,isIndeterminate:a>0&&a<W.length,selectedCount:r,isAtLimit:r>=500}},[W,B,T,null==(d=e.options)?void 0:d.tablePrefix]),X=Q.isAllSelected,Y=Q.isIndeterminate,Z=Q.selectedCount,ee=Q.isAtLimit,et=(0,l.useCallback)(function(t){var n,r=null==(n=e.options)?void 0:n.tablePrefix;if(t){var o=B.filter(function(e){var t;return!!e.required||!!T.get(e.name)&&!!(!r||!r.trim()||(null==(t=e.name)?void 0:t.startsWith(r.trim())))}).length,l=z.filter(function(e){return!e.required&&!T.get(e.name)}).length;if(o>=500)return;l>500-o&&a.message.warning(F("Maximum selection limit exceeded. To ensure system performance, you can select up to {{limit}} collections.",{ns:_,limit:500}))}R(t);var i=function(){var n,o=new Map(T),a=0,l=500-B.filter(function(e){var t;return!!e.required||!!T.get(e.name)&&!!(!r||!r.trim()||(null==(t=e.name)?void 0:t.startsWith(r.trim())))}).length;z.forEach(function(e){!e.required&&(t?a<l&&!T.get(e.name)&&(o.set(e.name,!0),a++):o.delete(e.name))}),I(o);var i=B.map(function(e){var t,n=!1;return e.required?n=!0:o.get(e.name)&&(!r||!r.trim()||(null==(t=e.name)?void 0:t.startsWith(r.trim())))&&(n=!0),C(g({},e),{selected:n})});null==(n=e.onChange)||n.call(e,i),R(!1)};if("u">typeof MessageChannel){var c=new MessageChannel;c.port2.onmessage=function(){return i()},c.port1.postMessage(null)}else setTimeout(i,0)},[z,B,T,e.onChange,null==(m=e.options)?void 0:m.tablePrefix,F,_]),en=(0,l.useCallback)(function(t,n){var r=W[t];if(r&&r.selected!==n){if(n){var o,l=null==(o=e.options)?void 0:o.tablePrefix,i=B.filter(function(e){var t;return!!e.required||!!T.get(e.name)&&!!(!l||!l.trim()||(null==(t=e.name)?void 0:t.startsWith(l.trim())))}).length;if(i>=500)return;i+1===500&&a.message.warning(F("Maximum selection limit reached. To ensure system performance, you can select up to {{limit}} collections at once.",{ns:_,limit:500}))}var c=new Map(T);n?c.set(r.name,!0):(c.delete(r.name),R(!1)),I(c),setTimeout(function(){var t,n,r=null==(t=e.options)?void 0:t.tablePrefix,o=B.map(function(e){var t,n=!1;return e.required?n=!0:c.get(e.name)&&(!r||!r.trim()||(null==(t=e.name)?void 0:t.startsWith(r.trim())))&&(n=!0),C(g({},e),{selected:n})});null==(n=e.onChange)||n.call(e,o)},0)}},[W,B,T,e.onChange,null==(y=e.options)?void 0:y.tablePrefix,F,_]),er=(0,l.useCallback)(function(e){J(e)},[J]),eo=(0,l.useCallback)(function(){O(""),V.current&&clearTimeout(V.current)},[]),ea=(0,l.useCallback)(function(){I(new Map),R(!1);var t,n=B.map(function(e){return C(g({},e),{selected:e.required||!1})});null==(t=e.onChange)||t.call(e,n)},[B,e.onChange]),el=(0,l.useMemo)(function(){var e=i().memo(function(e){var t=e.selected,n=e.required,r=e.index,o=e.onChange,l=(e.name,e.disabled);return i().createElement(a.Checkbox,{checked:n||t,disabled:n||l,onChange:function(e){return o(r,e.target.checked)}})}),t=i().memo(function(e){var t=e.text;return i().createElement("span",{style:{paddingLeft:"40px"}},t)}),n=[{title:i().createElement("div",{style:{textAlign:"center"}},F("Display name",{ns:_})),dataIndex:"name",key:"name",align:"left",width:"50%",render:function(e){return i().createElement(t,{text:e})}}];if(!L){var r=Z>=450,o=B.filter(function(e){return T.get(e.name)||e.required}).length,l=W.filter(function(e){return!e.selected&&!e.required}).length;n.push({title:i().createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:4}},i().createElement(a.Checkbox,{checked:X,indeterminate:Y,disabled:ee&&!X&&!(o+l<=500),onChange:function(e){return et(e.target.checked)}}),i().createElement("span",{style:r?{color:"#ff7a00"}:{}},F("Add",{ns:_})," (",Z,"/",B.length,")"),Z>0&&i().createElement(a.Tooltip,{title:F("Reset selection",{ns:_})},i().createElement(a.Button,{type:"text",size:"small",icon:i().createElement(f.ClearOutlined,null),onClick:ea,style:{padding:"0 4px",height:"16px",minWidth:"16px",fontSize:"12px",color:"#666"}}))),dataIndex:"selected",key:"selected",align:"center",width:"30%",render:function(t,n,r){var o=ee&&!t&&!n.required;return i().createElement(e,{selected:t,required:n.required,index:r,name:n.name,disabled:o,onChange:en})}})}return n},[F,X,Y,et,en,L,_,Z,B.length,ee,T,W,ea]);return i().createElement("div",null,i().createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",margin:"8px 0"}},i().createElement("div",null,i().createElement(a.Checkbox,{checked:L,onChange:function(e){return G(e.target.checked)}},F("Add all collections",{ns:_}))),i().createElement(a.Input.Search,{placeholder:F("Search collection name",{ns:_}),allowClear:!0,style:{width:250},onSearch:er,onChange:function(e){return er(e.target.value)},onClear:eo}),i().createElement(a.Button,{icon:i().createElement(f.ReloadOutlined,null),onClick:function(){return H()},loading:S},F("Load Collections",{ns:_}))),i().createElement(a.Table,{columns:el,dataSource:W,loading:S,pagination:!1,scroll:{x:L?300:550,y:400},virtual:!0,bordered:!0,rowKey:"name",size:"small"}))}),w=function(e){var t=e.NAMESPACE,n=e.t;return{CollectionsTable:function(e){return i().createElement(S,C(g({},e),{NAMESPACE:t,t:n}))},createCollectionsSchema:function(e,n){return{type:"array",title:'{{t("Collections",{ ns: "'.concat(t,'" })}}'),"x-decorator":"FormItem","x-component":"CollectionsTable","x-component-props":{from:e,loadCollections:n,formValues:"{{$form.values}}",options:"{{$form.values.options}}",formSetValues:"{{$form.setValuesIn}}"},"x-reactions":[{dependencies:["..key","..options","..addAllCollections"],fulfill:{schema:{"x-component-props.dataSourceKey":"{{$deps[0]}}","x-component-props.options":"{{$deps[1]}}","x-component-props.addAllCollectionsValue":"{{$deps[2]}}"}}},{dependencies:["..options.tablePrefix"],fulfill:{run:"\n $self.forceUpdate && $self.forceUpdate();\n "}},{dependencies:["..key"],fulfill:{run:"\n if ($deps[0] && from === 'edit' && loadCollections) {\n (async () => {\n const {data} = await loadCollections($deps[0]);\n $self.value = data || [];\n $form.setValuesIn('collections', data || []);\n })();\n }\n "}}]}},Text:(0,b.observer)(function(e){return i().createElement("span",null,e.value)}),addAllCollectionsSchema:{type:"boolean","x-component":"Checkbox","x-display":"hidden",default:!0}}};function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function k(e,t,n,r,o,a,l){try{var i=e[a](l),c=i.value}catch(e){n(e);return}i.done?t(c):Promise.resolve(c).then(r,o)}function O(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],l=!0,i=!1;try{for(o=o.call(e);!(l=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);l=!0);}catch(e){i=!0,r=e}finally{try{l||null==o.return||o.return()}finally{if(i)throw r}}return a}}(e,t)||j(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function E(e){return function(e){if(Array.isArray(e))return A(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||j(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(e,t){if(e){if("string"==typeof e)return A(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return A(e,t)}}var D=function(e){var t=(0,d.useForm)(),n=(0,d.useField)(),r=(0,o.useActionContext)(),a=(0,o.useResourceActionContext)().refresh,l=(0,o.useResourceContext)().resource;return{run:function(){var o;return(o=function(){var o,i,c;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:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(l,"next",{value:c(0)}),i(l,"throw",{value:c(1)}),i(l,"return",{value:c(2)}),"function"==typeof Symbol&&i(l,Symbol.iterator,{value:function(){return this}}),l;function c(i){return function(c){var u=[i,c];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(u){switch(u.label){case 0:return u.trys.push([0,4,,5]),[4,t.submit()];case 1:var s,p;return u.sent(),n.data=n.data||{},n.data.loading=!0,i=t.values.collections||[],[4,l.create({values:(s=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){O(e,t,n[t])})}return e}({},t.values),p=p={collections:i.filter(function(e){return e.selected}).map(function(e){return e.name})},Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(p)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(p)).forEach(function(e){Object.defineProperty(s,e,Object.getOwnPropertyDescriptor(p,e))}),s)})];case 2:return c=u.sent(),r.setVisible(!1),null==e||e(null==c||null==(o=c.data)?void 0:o.data),[4,t.reset()];case 3:return u.sent(),n.data.loading=!1,a(),[3,5];case 4:return u.sent(),n.data&&(n.data.loading=!1),[3,5];case 5:return[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,r){var a=o.apply(e,t);function l(e){k(a,n,r,l,i,"next",e)}function i(e){k(a,n,r,l,i,"throw",e)}l(void 0)})})()}}},T=function(){var e=P((0,l.useState)({}),2),t=e[0],n=e[1],s=(0,o.usePlugin)(u.default),p=(0,o.useCompile)(),d=P((0,l.useState)(!1),2),b=d[0],v=d[1],h=(0,c.useTranslation)().t,g=P((0,l.useState)(null),2),C=g[0],x=g[1],S=(0,o.useAPIClient)(),A=(0,m.useLoadCollections)();return i().createElement("div",null,i().createElement(o.ActionContext.Provider,{value:{visible:b,setVisible:v}},i().createElement(a.Dropdown,{menu:{onClick:function(e){if("__empty__"!==e.key){var t=s.types.get(e.key);x(e.key),v(!0),n({type:"object",properties:O({},(0,r.uid)(),{type:"void","x-component":"Action.Drawer","x-component-props":{width:650},"x-decorator":"Form","x-decorator-props":{initialValue:{type:e.key,key:"d_".concat((0,r.uid)())}},title:p("{{t('Add new')}}")+" - "+p(t.label),properties:{body:{type:"void","x-component":t.DataSourceSettingsForm.bind(null,{CollectionsTableField:w,loadCollections:A,from:"create"})},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{testConnection:{title:'{{ t("Test Connection",{ ns: "'.concat(y.CU,'" }) }}'),"x-component":"Action","x-component-props":{useAction:"{{ useTestConnectionAction }}"},"x-hidden":null==t?void 0:t.disableTestConnection},cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ useCreateAction }}",actionCallback:"{{ dataSourceCreateCallback }}"}}}}}})})}},items:[s.types.size?null:{key:"__empty__",label:i().createElement(a.Empty,{image:a.Empty.PRESENTED_IMAGE_SIMPLE,description:i().createElement(i().Fragment,null,h("No external data source plugin installed",{ns:y.CU}),i().createElement("br",null)," ",i().createElement("a",{target:"_blank",href:"zh-CN"===S.auth.locale?"https://docs-cn.nocobase.com/handbook/data-source-manager":"https://docs.nocobase.com/handbook/data-source-manager",rel:"noreferrer"},h("View documentation",{ns:y.CU})))})}].filter(Boolean).concat(E(s.types.keys()).map(function(e){var t=s.types.get(e);return{key:e,label:p(null==t?void 0:t.label)}}))}},i().createElement(a.Button,{type:"primary",icon:i().createElement(f.PlusOutlined,null)},h("Add new")," ",i().createElement(f.DownOutlined,null))),i().createElement(o.SchemaComponent,{scope:{createOnly:!1,useTestConnectionAction:m.useTestConnectionAction,dialect:C,useDialectDataSource:function(e){e.dataSource=E(s.types.keys()).map(function(e){var t=s.types.get(e);return{value:t.name,label:p(t.label)}})},useCreateAction:D},schema:t})))},I=n(773),M=n.n(I);function q(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function R(e,t,n,r,o,a,l){try{var i=e[a](l),c=i.value}catch(e){n(e);return}i.done?t(c):Promise.resolve(c).then(r,o)}function V(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],l=!0,i=!1;try{for(o=o.call(e);!(l=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);l=!0);}catch(e){i=!0,r=e}finally{try{l||null==o.return||o.return()}finally{if(i)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return q(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return q(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var F=function(){var e=(0,o.useRecord)(),t=_((0,l.useState)({}),2),n=t[0],a=t[1],s=(0,o.usePlugin)(u.default),p=(0,o.useCompile)(),f=_((0,l.useState)(!1),2),b=f[0],v=f[1],h=(0,c.useTranslation)().t,g=(0,o.useDataSourceManager)(),C=(0,m.useLoadCollections)();return(0,o.useAPIClient)(),i().createElement("div",null,i().createElement(o.ActionContext.Provider,{value:{visible:b,setVisible:v}},"main"!==e.key&&i().createElement("a",{onClick:function(){v(!0);var t=s.types.get(e.type);a({type:"object",properties:V({},(0,r.uid)(),{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{initialValue:e},"x-component-props":{width:650},title:p("{{t('Edit')}}")+" - "+p(e.displayName),properties:{body:{type:"void","x-component":t.DataSourceSettingsForm.bind(null,{CollectionsTableField:w,loadCollections:C,from:"edit"})},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},testConnectiion:{title:'{{ t("Test Connection",{ ns: "'.concat(y.CU,'" }) }}'),"x-component":"Action","x-component-props":{useAction:"{{ useTestConnectionAction }}"},"x-hidden":null==t?void 0:t.disableTestConnection},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ useUpdateAction }}"}}}}}})})}},h("Edit")),i().createElement(o.SchemaComponent,{scope:{createOnly:!0,useUpdateAction:function(){var e=(0,d.useField)(),t=(0,d.useForm)(),n=(0,o.useActionContext)(),r=(0,o.useResourceActionContext)().refresh,a=(0,o.useResourceContext)().resource,l=(0,o.useRecord)().key;return{run:function(){var o;return(o=function(){var o;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:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(l,"next",{value:c(0)}),i(l,"throw",{value:c(1)}),i(l,"return",{value:c(2)}),"function"==typeof Symbol&&i(l,Symbol.iterator,{value:function(){return this}}),l;function c(i){return function(c){var u=[i,c];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(i){switch(i.label){case 0:return[4,t.submit()];case 1:i.sent(),e.data=e.data||{},e.data.loading=!0,o=t.values.collections||[],i.label=2;case 2:var c,u;return i.trys.push([2,5,6,7]),[4,a.update({filterByTk:l,values:(c=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){V(e,t,n[t])})}return e}({},t.values),u=u={collections:o.filter(function(e){return e.selected}).map(function(e){return e.name})},Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(u)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(u)).forEach(function(e){Object.defineProperty(c,e,Object.getOwnPropertyDescriptor(u,e))}),c)})];case 3:return i.sent(),n.setVisible(!1),g.getDataSource(l).setOptions(M().omit(t.values,"collections")),g.getDataSource(l).reload(),[4,t.reset()];case 4:return i.sent(),r(),[3,7];case 5:return console.log(i.sent()),[3,7];case 6:return e.data.loading=!1,[7];case 7:return[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,r){var a=o.apply(e,t);function l(e){R(a,n,r,l,i,"next",e)}function i(e){R(a,n,r,l,i,"throw",e)}l(void 0)})})()}}},loadCollections:C},schema:n})))},U=n(477),$=n(442),L=function(e){var t=e.key,n=e.type;return"/admin/settings/data-source-manager/".concat(t,"/collections?type=").concat(n)};function N(){var e,t,n=(e=["\n .ant-btn-link {\n &:hover {\n color: rgba(0, 0, 0, 0.25) !important;\n }\n }\n "],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return N=function(){return n},n}var z=function(){var e=(0,o.useRecord)(),t=(0,$.useNavigate)(),n=(0,c.useTranslation)().t;return i().createElement("div",{className:e.enabled?void 0:(0,U.css)(N())},i().createElement(a.Button,{type:"link",style:{padding:"0px"},disabled:!e.enabled,onClick:function(){t(L(e))},role:"button","aria-label":"".concat(null==e?void 0:e.key,"-Configure")},n("Configure")))};function B(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function W(e,t,n,r,o,a,l){try{var i=e[a](l),c=i.value}catch(e){n(e);return}i.done?t(c):Promise.resolve(c).then(r,o)}function K(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function l(e){W(a,r,o,l,i,"next",e)}function i(e){W(a,r,o,l,i,"throw",e)}l(void 0)})}}function G(e){return function(e){if(Array.isArray(e))return B(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return B(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return B(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function H(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(l,"next",{value:c(0)}),i(l,"throw",{value:c(1)}),i(l,"return",{value:c(2)}),"function"==typeof Symbol&&i(l,Symbol.iterator,{value:function(){return this}}),l;function c(i){return function(c){var u=[i,c];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}var J=function(){var e=(0,c.useTranslation)().t,t=(0,o.usePlugin)(u.default),n=(0,o.useDataSourceManager)();(0,o.useAPIClient)();var f=(0,l.useCallback)(function(e){n.setDataSources((null==e?void 0:e.data)||[]),n.reload()},[n]),d=G(t.types.keys()).map(function(n){var r=t.types.get(n);return{value:n,label:e(null==r?void 0:r.label)}}).concat([{value:"main",label:e("Main")}]),m=i().useRef([]);(0,l.useEffect)(function(){return function(){n.getDataSources().forEach(function(e){m.current.includes(e.key)&&e.reload()})}},[m]);var y=(0,l.useCallback)(function(e){n.removeDataSources(e)},[n]),b=(0,l.useCallback)(function(e){return K(function(){return H(this,function(t){return n.addDataSource(p.J,e),m.current=G(m.current).concat([e.key]),[2]})})()},[n]);return i().createElement(a.Card,{bordered:!1},i().createElement(o.SchemaComponent,{components:{CreateDatabaseConnectAction:T,EditDatabaseConnectionAction:F,ViewDatabaseConnectionAction:z},scope:{useNewId:function(e){return"".concat(e).concat((0,r.uid)())},types:d,useRefreshActionProps:function(){var e=(0,o.useResourceActionContext)();return{onClick:function(){return K(function(){var t,r,o,a,l;return H(this,function(i){switch(i.label){case 0:if(!(null==(o=null==e||null==(t=e.data)?void 0:t.data.filter(function(e){return"loaded"!==e.status}))?void 0:o.length))return[3,2];return a=n.getDataSources(),l=o.map(function(e){return e.key}),[4,Promise.all(a.filter(function(e){return l.includes(e.key)}).map(function(e){return e.reload()}))];case 1:i.sent(),i.label=2;case 2:return null==e||null==(r=e.refresh)||r.call(e),[2]}})})()}}},useDestroyAction:function(){var e=(0,o.useResourceActionContext)().refresh,t=(0,o.useResourceContext)().resource,n=(0,o.useRecord)().key;return{run:function(){return K(function(){return H(this,function(r){switch(r.label){case 0:return[4,t.destroy({filterByTk:n})];case 1:return r.sent(),y([n]),e(),[2]}})})()}}},dataSourceDeleteCallback:y,dataSourceCreateCallback:b,dataSourceListCallback:f,useIsAbleDelete:function(e){e.visible="main"!==(0,o.useRecord)().key}},schema:s.z}))}},221:function(e,t,n){n.d(t,{m:function(){return c},z:function(){return s}});var r,o,a,l=n(166),i=n(872),c=[{value:"loading",label:'{{t("Loading",{ns:"'.concat(i.CU,'"})}}'),color:"orange"},{value:"loading-failed",label:'{{t("Failed",{ns:"'.concat(i.CU,'"})}}'),color:"red"},{value:"loaded",label:'{{t("Loaded",{ns:"'.concat(i.CU,'"})}}'),color:"green"},{value:"reloading",label:'{{t("Reloading",{ns:"'.concat(i.CU,'"})}}'),color:"orange"}],u={name:"collections-"+(0,l.uid)(),disableTranslation:!0,fields:[{type:"string",name:"key",interface:"input",uiSchema:{title:'{{t("Data source name",{ ns: "'.concat(i.CU,'" })}}'),type:"string","x-component":"Input",required:!0}},{type:"string",name:"displayName",interface:"input",uiSchema:{title:'{{t("Data source display name",{ ns: "'.concat(i.CU,'" })}}'),type:"string","x-component":"Input",required:!0}},{type:"string",name:"type",interface:"select",uiSchema:{title:'{{t("Type", { ns: "'.concat(i.CU,'" })}}'),type:"string","x-component":"Select",enum:"{{types}}"}},{type:"string",name:"status",interface:"select",uiSchema:{title:'{{t("Status", { ns: "'.concat(i.CU,'" })}}'),type:"string","x-component":"Select",enum:c}},{type:"boolean",name:"enabled",uiSchema:{type:"boolean",title:'{{t("Enabled")}}',"x-component":"Checkbox"}}]},s={type:"object",properties:(r={},o=(0,l.uid)(),a={type:"void","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:u,resourceName:"dataSources",request:{resource:"dataSources",action:"list",params:{pageSize:50,appends:[]}}},"x-component":"CollectionProvider_deprecated","x-component-props":{collection:u},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{refresh:{type:"void",title:'{{ t("Refresh") }}',"x-component":"Action","x-use-component-props":"useRefreshActionProps","x-component-props":{icon:"ReloadOutlined"}},delete:{type:"void",title:'{{ t("Delete") }}',"x-component":"Action","x-component-props":{icon:"DeleteOutlined",useAction:"{{ cm.useBulkDestroyAction }}",confirm:{title:"{{t('Delete')}}",content:"{{t('Are you sure you want to delete it?')}}"},actionCallback:"{{ dataSourceDeleteCallback }}"}},create:{type:"void",title:'{{t("Add new")}}',"x-component":"CreateDatabaseConnectAction","x-component-props":{type:"primary"}}}},table:{type:"void","x-uid":"input","x-component":"Table.Void","x-component-props":{rowKey:"key",rowSelection:{type:"checkbox"},useDataSource:"{{ cm.useDataSourceFromRAC }}",onSuccess:"{{ dataSourceListCallback }}"},properties:{key:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{key:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},displayName:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{displayName:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},type:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{type:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},status:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{status:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},enabled:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{enabled:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},actions:{type:"void",title:'{{t("Actions")}}',"x-component":"Table.Column",properties:{actions:{type:"void","x-component":"Space","x-component-props":{},properties:{view:{type:"void",title:'{{t("View")}}',"x-component":"ViewDatabaseConnectionAction","x-component-props":{type:"primary"}},update:{type:"void",title:'{{t("Edit")}}',"x-component":"EditDatabaseConnectionAction","x-component-props":{type:"primary"},"x-reactions":["{{useIsAbleDelete($self)}}"]},delete:{type:"void",title:'{{ t("Delete") }}',"x-component":"Action.Link","x-component-props":{confirm:{title:'{{t("Delete")}}',content:'{{t("Are you sure you want to delete it?")}}'},useAction:"{{useDestroyAction}}"},"x-reactions":["{{useIsAbleDelete($self)}}"]}}}}}}}}},o in r?Object.defineProperty(r,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[o]=a,r)}}}]);
@@ -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("@nocobase/plugin-acl/client"),require("@dnd-kit/core"),require("@ant-design/icons"),require("@formily/react"),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","@nocobase/plugin-acl/client","@dnd-kit/core","@ant-design/icons","@formily/react","@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("@nocobase/plugin-acl/client"),require("@dnd-kit/core"),require("@ant-design/icons"),require("@formily/react"),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["@nocobase/plugin-acl/client"],e["@dnd-kit/core"],e["@ant-design/icons"],e["@formily/react"],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,i,a,c,u,s,l,p,f,d,b,y,m,g){return function(){var h,v,w,O={671:function(e,t,n){"use strict";n.r(t),n.d(t,{PluginDataSourceManagerClient:function(){return E}});var r=n(342),o=n(79),i=n.n(o),a=n(768),c=n(155),u=n.n(c),s=n(379),l=n(404),p=n(631);function f(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){f(i,r,o,a,c,"next",e)}function c(e){f(i,r,o,a,c,"throw",e)}a(void 0)})}}function b(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function y(e,t,n){return(y=_()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&w(o,n.prototype),o}).apply(null,arguments)}function m(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&&m(e.prototype,t),n&&m(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 v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function w(e,t){return(w=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function O(e){var t="function"==typeof Map?new Map:void 0;return(O=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 y(e,arguments,v(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),w(n,e)})(e)}function _(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(_=function(){return!!e})()}function P(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),c=Object.defineProperty;return c(a,"next",{value:u(0)}),c(a,"throw",{value:u(1)}),c(a,"return",{value:u(2)}),"function"==typeof Symbol&&c(a,Symbol.iterator,{value:function(){return this}}),a;function u(c){return function(u){var s=[c,u];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}}var S=(0,r.lazy)(function(){return p("imported_174m4o3_component",n.e("820").then(n.bind(n,459)))},"DatabaseConnectionProvider").DatabaseConnectionProvider,C=(0,r.lazy)(function(){return p("imported_-1bdhn46_component",Promise.all([n.e("820"),n.e("901")]).then(n.bind(n,12)))},"BreadcumbTitle").BreadcumbTitle,j=(0,r.lazy)(function(){return p("imported_l1a36j_component",Promise.all([n.e("820"),n.e("937"),n.e("500")]).then(n.bind(n,727)))},"CollectionManagerPage").CollectionManagerPage,x=(0,r.lazy)(function(){return p("imported_k8ts4l_component",Promise.all([n.e("820"),n.e("439")]).then(n.bind(n,522)))},"DatabaseConnectionManagerPane").DatabaseConnectionManagerPane,k=(0,r.lazy)(function(){return p("imported_1cub3nb_component",Promise.all([n.e("820"),n.e("937"),n.e("484")]).then(n.bind(n,687)))},"MainDataSourceManager").MainDataSourceManager,q=(0,r.lazy)(function(){return p("imported_-1b29440_component",n.e("867").then(n.bind(n,566)))},"DataSourcePermissionManager").DataSourcePermissionManager,T=(0,r.lazy)(function(){return p("imported_cef22q_component",n.e("384").then(n.bind(n,451)))},"CollectionMainProvider").CollectionMainProvider,M=function(){function e(t){b(this,e),h(this,"plugin",void 0),h(this,"componentRegistry",void 0),this.plugin=t,this.componentRegistry=new a.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}(),E=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 b(this,t),n=t,r=arguments,n=v(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,_()?Reflect.construct(n,r||[],v(this).constructor):n.apply(this,r)),"types",new Map),h(e,"extensionManager",new M(e)),h(e,"extendedTabs",{}),e}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&w(t,e),g(t,[{key:"getExtendedTabs",value:function(){return this.extendedTabs}},{key:"registerPermissionTab",value:function(e){this.extendedTabs[(0,a.uid)()]=e}},{key:"load",value:function(){return d(function(){return P(this,function(e){return this.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(q,{role:r}))}}),this.app.use(S),this.app.pluginSettingsManager.add(l.CU,{title:'{{t("Data sources", { ns: "'.concat(l.CU,'" })}}'),icon:"ClusterOutlined",isPinned:!0,sort:100,showTabs:!1,aclSnippet:"pm.data-source-manager*"}),this.app.pluginSettingsManager.add("".concat(l.CU,".list"),{title:'{{t("Data sources", { ns: "'.concat(l.CU,'" })}}'),Component:x,sort:1,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager"}),this.app.pluginSettingsManager.add("".concat(l.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(l.CU,"/main"),{title:u().createElement(C,null),icon:"ClusterOutlined",isTopLevel:!1,sort:100,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager.data-source-main",Component:T}),this.app.pluginSettingsManager.add("".concat(l.CU,"/main.collections"),{title:'{{t("Collections", { ns: "'.concat(l.CU,'" })}}'),Component:k,topLevelName:"".concat(l.CU,"/main"),pluginKey:l.CU,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager.data-source-main"}),this.app.pluginSettingsManager.add("".concat(l.CU,"/:name.collections"),{title:'{{t("Collections", { ns: "'.concat(l.CU,'" })}}'),Component:j,topLevelName:"".concat(l.CU,"/:name"),pluginKey:l.CU,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager.data-source-main"}),this.app.dataSourceManager.addDataSources(this.getThirdDataSource.bind(this),s.J),[2]})}).call(this)}},{key:"setDataSources",value:function(){return d(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 d(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}(O(r.Plugin));t.default=E},379:function(e,t,n){"use strict";n.d(t,{J:function(){return u}});var r=n(342);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){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function 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=i(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||[],i(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&a(n,e),t=[{key:"getDataSource",value:function(){var e;return(e=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),c=Object.defineProperty;return c(a,"next",{value:u(0)}),c(a,"throw",{value:u(1)}),c(a,"return",{value:u(2)}),"function"==typeof Symbol&&c(a,Symbol.iterator,{value:function(){return this}}),a;function u(c){return function(u){var s=[c,u];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[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,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)})}).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)},404:function(e,t,n){"use strict";n.d(t,{CU:function(){return i},VP:function(){return c},vV:function(){return a}});var r=n(342),o=n(953),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;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:i},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)([i,"client"],{nsMode:"fallback"})}},631:function(e){e.exports=function(e,t){return"u">typeof __deoptimization_sideEffect__&&__deoptimization_sideEffect__(e,t),t}},375:function(e){"use strict";e.exports=c},799:function(e){"use strict";e.exports=a},477:function(e){"use strict";e.exports=t},418:function(e){"use strict";e.exports=r},452:function(e){"use strict";e.exports=l},230:function(e){"use strict";e.exports=u},992:function(e){"use strict";e.exports=o},166:function(e){"use strict";e.exports=p},342:function(e){"use strict";e.exports=b},694:function(e){"use strict";e.exports=s},79:function(e){"use strict";e.exports=i},768:function(e){"use strict";e.exports=m},59:function(e){"use strict";e.exports=d},235:function(e){"use strict";e.exports=y},773:function(e){"use strict";e.exports=g},155:function(e){"use strict";e.exports=f},953:function(t){"use strict";t.exports=e},442:function(e){"use strict";e.exports=n},21:function(e,t,n){"use strict";var r=window.__webpack_public_path__||"/";"/"!==r.charAt(r.length-1)&&(r+="/"),n.p=r+"static/plugins/@nocobase/plugin-data-source-manager/dist/client/"}},_={};function P(e){var t=_[e];if(void 0!==t)return t.exports;var n=_[e]={exports:{}};return O[e](n,n.exports,P),n.exports}P.m=O,P.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return P.d(t,{a:t}),t},P.d=function(e,t){for(var n in t)P.o(t,n)&&!P.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},P.f={},P.e=function(e){return Promise.all(Object.keys(P.f).reduce(function(t,n){return P.f[n](e,t),t},[]))},P.u=function(e){return""+({384:"fda01baf97978ee3",439:"a66fb4a5aeb902b7",484:"9eb557741d278421",500:"015f545e0166ca31",820:"afe2c8a775c95c10",867:"548d1ad2c4dcb4ab",901:"742f8239c656158e",937:"4efac009b1b9ce6a"})[e]+".js"},P.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),P.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},S={},P.l=function(e,t,n,r){if(S[e])return void S[e].push(t);if(void 0!==n)for(var o,i,a=document.getElementsByTagName("script"),c=0;c<a.length;c++){var u=a[c];if(u.getAttribute("src")==e||u.getAttribute("data-rspack")=="@nocobase/plugin-data-source-manager:"+n){o=u;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,P.nc&&o.setAttribute("nonce",P.nc),o.setAttribute("data-rspack","@nocobase/plugin-data-source-manager:"+n),o.src=e),S[e]=[t];var s=function(t,n){o.onerror=o.onload=null,clearTimeout(l);var r=S[e];if(delete S[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},l=setTimeout(s.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=s.bind(null,o.onerror),o.onload=s.bind(null,o.onload),i&&document.head.appendChild(o)},P.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},P.g.importScripts&&(C=P.g.location+"");var S,C,j=P.g.document;if(!C&&j&&(j.currentScript&&"SCRIPT"===j.currentScript.tagName.toUpperCase()&&(C=j.currentScript.src),!C)){var x=j.getElementsByTagName("script");if(x.length)for(var k=x.length-1;k>-1&&(!C||!/^http(s?):/.test(C));)C=x[k--].src}if(!C)throw Error("Automatic publicPath is not supported in this browser");return P.p=C.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),h={889:0},P.f.j=function(e,t){var n=P.o(h,e)?h[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=h[e]=[t,r]});t.push(n[2]=r);var o=P.p+P.u(e),i=Error();P.l(o,function(t){if(P.o(h,e)&&(0!==(n=h[e])&&(h[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)}},v=function(e,t){var n,r,o=t[0],i=t[1],a=t[2],c=0;if(o.some(function(e){return 0!==h[e]})){for(n in i)P.o(i,n)&&(P.m[n]=i[n]);a&&a(P)}for(e&&e(t);c<o.length;c++)r=o[c],P.o(h,r)&&h[r]&&h[r][0](),h[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)),P(21),P(671)}()});
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)}()});
@@ -8,27 +8,27 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "2.1.0-alpha.10",
11
+ "@nocobase/client": "2.1.0-alpha.12",
12
12
  "react": "18.2.0",
13
- "@nocobase/plugin-acl": "2.1.0-alpha.10",
14
- "@nocobase/utils": "2.1.0-alpha.10",
15
- "@nocobase/server": "2.1.0-alpha.10",
16
- "@nocobase/data-source-manager": "2.1.0-alpha.10",
13
+ "@nocobase/plugin-acl": "2.1.0-alpha.12",
14
+ "@nocobase/utils": "2.1.0-alpha.12",
15
+ "@nocobase/server": "2.1.0-alpha.12",
16
+ "@nocobase/data-source-manager": "2.1.0-alpha.12",
17
17
  "lodash": "4.17.21",
18
- "@nocobase/acl": "2.1.0-alpha.10",
19
- "@nocobase/database": "2.1.0-alpha.10",
20
- "@nocobase/actions": "2.1.0-alpha.10",
21
- "@nocobase/ai": "2.1.0-alpha.10",
18
+ "@nocobase/acl": "2.1.0-alpha.12",
19
+ "@nocobase/database": "2.1.0-alpha.12",
22
20
  "@ant-design/icons": "5.6.1",
23
21
  "antd": "5.24.2",
24
22
  "react-router-dom": "6.30.1",
25
- "@nocobase/flow-engine": "2.1.0-alpha.10",
23
+ "@nocobase/flow-engine": "2.1.0-alpha.12",
26
24
  "@formily/shared": "2.3.7",
27
25
  "@formily/react": "2.3.7",
28
26
  "react-i18next": "11.18.6",
29
27
  "@emotion/css": "11.13.0",
28
+ "@nocobase/actions": "2.1.0-alpha.12",
30
29
  "sequelize": "6.35.2",
31
- "@nocobase/test": "2.1.0-alpha.10",
30
+ "@nocobase/ai": "2.1.0-alpha.12",
31
+ "@nocobase/test": "2.1.0-alpha.12",
32
32
  "@formily/antd-v5": "1.2.3",
33
33
  "@formily/core": "2.3.7",
34
34
  "@formily/reactive": "2.3.7",
@@ -67,5 +67,11 @@
67
67
  "ai.tools.dataQuery.args.appends": "Related collection to be queried",
68
68
  "ai.tools.dataQuery.args.sort": "Sort field names. By default, they are in ascending order. A minus sign before the field name indicates descending order",
69
69
  "ai.tools.dataQuery.args.offset": "Offset of records to be queried",
70
- "ai.tools.dataQuery.args.limit": "Maximum number of records to be queried"
70
+ "ai.tools.dataQuery.args.limit": "Maximum number of records to be queried",
71
+ "ai.skills.dataQuery.title": "Data query",
72
+ "ai.skills.dataQuery.about": "Using tools to query data or counting data from specified datasource",
73
+ "ai.skills.dataModeling.title": "Data modeling",
74
+ "ai.skills.dataModeling.about": "helps translate business scenarios into normalized database schemas with table declarations and relationship diagrams.",
75
+ "ai.skills.dataMetadata.title": "Data metadata",
76
+ "ai.skills.dataMetadata.about": "helps get collection metadata (data model, like database table definition, RESTful API definition), like collection definition, field metadata"
71
77
  }
@@ -67,5 +67,11 @@
67
67
  "ai.tools.dataQuery.args.appends": "需要查询的关联数据表",
68
68
  "ai.tools.dataQuery.args.sort": "排序字段名称,默认升序。字段名前加减号表示降序",
69
69
  "ai.tools.dataQuery.args.offset": "查询记录的偏移量",
70
- "ai.tools.dataQuery.args.limit": "查询记录的最大数量"
70
+ "ai.tools.dataQuery.args.limit": "查询记录的最大数量",
71
+ "ai.skills.dataQuery.title": "数据查询",
72
+ "ai.skills.dataQuery.about": "使用工具从指定的数据源查询数据",
73
+ "ai.skills.dataModeling.title": "数据建模",
74
+ "ai.skills.dataModeling.about": "帮助将业务场景转换为带有表声明和关系图的规范化数据库模式。",
75
+ "ai.skills.dataMetadata.title": "获取数据模型元信息",
76
+ "ai.skills.dataMetadata.about": "帮助获取数据模型元数据(如数据库表定义,RESTful API 定义),如数据表定义,字段元数据"
71
77
  }
@@ -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-03-20T09:03:43.015Z"}
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-03-25T14:06:30.609Z"}
@@ -0,0 +1,122 @@
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
+ declare const _default: {
10
+ openapi: string;
11
+ info: {
12
+ title: string;
13
+ };
14
+ paths: {
15
+ '/dataSources:listEnabled': {
16
+ get: {
17
+ tags: string[];
18
+ summary: string;
19
+ description: string;
20
+ parameters: {
21
+ name: string;
22
+ in: string;
23
+ description: string;
24
+ required: boolean;
25
+ schema: {
26
+ type: string;
27
+ };
28
+ }[];
29
+ responses: {
30
+ 200: {
31
+ description: string;
32
+ content: {
33
+ 'application/json': {
34
+ schema: {
35
+ type: string;
36
+ properties: {
37
+ data: {
38
+ type: string;
39
+ items: {
40
+ $ref: string;
41
+ };
42
+ };
43
+ meta: {
44
+ type: string;
45
+ additionalProperties: boolean;
46
+ };
47
+ };
48
+ };
49
+ };
50
+ };
51
+ };
52
+ };
53
+ };
54
+ };
55
+ };
56
+ components: {
57
+ schemas: {
58
+ DataSourceInfo: {
59
+ type: string;
60
+ properties: {
61
+ key: {
62
+ type: string;
63
+ };
64
+ displayName: {
65
+ type: string;
66
+ };
67
+ status: {
68
+ type: string;
69
+ };
70
+ type: {
71
+ type: string;
72
+ };
73
+ isDBInstance: {
74
+ type: string;
75
+ };
76
+ options: {
77
+ type: string;
78
+ additionalProperties: boolean;
79
+ };
80
+ errorMessage: {
81
+ type: string;
82
+ };
83
+ collections: {
84
+ type: string;
85
+ items: {
86
+ $ref: string;
87
+ };
88
+ };
89
+ };
90
+ additionalProperties: boolean;
91
+ };
92
+ DataSourceCollectionInfo: {
93
+ type: string;
94
+ properties: {
95
+ name: {
96
+ type: string;
97
+ };
98
+ title: {
99
+ type: string;
100
+ };
101
+ fields: {
102
+ type: string;
103
+ items: {
104
+ type: string;
105
+ additionalProperties: boolean;
106
+ };
107
+ };
108
+ availableActions: {
109
+ type: string;
110
+ additionalProperties: boolean;
111
+ };
112
+ unavailableActions: {
113
+ type: string;
114
+ additionalProperties: boolean;
115
+ };
116
+ };
117
+ additionalProperties: boolean;
118
+ };
119
+ };
120
+ };
121
+ };
122
+ export default _default;
@@ -0,0 +1,146 @@
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 swagger_exports = {};
28
+ __export(swagger_exports, {
29
+ default: () => swagger_default
30
+ });
31
+ module.exports = __toCommonJS(swagger_exports);
32
+ var swagger_default = {
33
+ openapi: "3.0.2",
34
+ info: {
35
+ title: "NocoBase API - Data source manager plugin"
36
+ },
37
+ paths: {
38
+ "/dataSources:listEnabled": {
39
+ get: {
40
+ tags: ["dataSources"],
41
+ summary: "List enabled external data sources",
42
+ description: "Return enabled non-main data sources, optionally including loaded collections.",
43
+ parameters: [
44
+ {
45
+ name: "appends",
46
+ in: "query",
47
+ description: "Append related data, for example `collections`.",
48
+ required: false,
49
+ schema: {
50
+ type: "string"
51
+ }
52
+ }
53
+ ],
54
+ responses: {
55
+ 200: {
56
+ description: "OK",
57
+ content: {
58
+ "application/json": {
59
+ schema: {
60
+ type: "object",
61
+ properties: {
62
+ data: {
63
+ type: "array",
64
+ items: {
65
+ $ref: "#/components/schemas/DataSourceInfo"
66
+ }
67
+ },
68
+ meta: {
69
+ type: "object",
70
+ additionalProperties: true
71
+ }
72
+ }
73
+ }
74
+ }
75
+ }
76
+ }
77
+ }
78
+ }
79
+ }
80
+ },
81
+ components: {
82
+ schemas: {
83
+ DataSourceInfo: {
84
+ type: "object",
85
+ properties: {
86
+ key: {
87
+ type: "string"
88
+ },
89
+ displayName: {
90
+ type: "string"
91
+ },
92
+ status: {
93
+ type: "string"
94
+ },
95
+ type: {
96
+ type: "string"
97
+ },
98
+ isDBInstance: {
99
+ type: "boolean"
100
+ },
101
+ options: {
102
+ type: "object",
103
+ additionalProperties: true
104
+ },
105
+ errorMessage: {
106
+ type: "string"
107
+ },
108
+ collections: {
109
+ type: "array",
110
+ items: {
111
+ $ref: "#/components/schemas/DataSourceCollectionInfo"
112
+ }
113
+ }
114
+ },
115
+ additionalProperties: true
116
+ },
117
+ DataSourceCollectionInfo: {
118
+ type: "object",
119
+ properties: {
120
+ name: {
121
+ type: "string"
122
+ },
123
+ title: {
124
+ type: "string"
125
+ },
126
+ fields: {
127
+ type: "array",
128
+ items: {
129
+ type: "object",
130
+ additionalProperties: true
131
+ }
132
+ },
133
+ availableActions: {
134
+ type: "object",
135
+ additionalProperties: true
136
+ },
137
+ unavailableActions: {
138
+ type: "object",
139
+ additionalProperties: true
140
+ }
141
+ },
142
+ additionalProperties: true
143
+ }
144
+ }
145
+ }
146
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-data-source-manager",
3
- "version": "2.1.0-alpha.10",
3
+ "version": "2.1.0-alpha.12",
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": "ce790d46c0a5768ca9618c7d0d77ab8300de75c8",
23
+ "gitHead": "f12c4a75470590b1670ce54510b96ef94c2cd7a2",
24
24
  "license": "Apache-2.0"
25
25
  }