@nocobase/plugin-data-source-manager 1.0.0-alpha.16 → 1.0.0-alpha.17

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.
@@ -56,4 +56,4 @@
56
56
  }
57
57
  }
58
58
  }
59
- `),Mf=(e="main")=>({name:`dataSources/${e}/rolesResourcesScopes`,fields:[{type:"string",name:"name",interface:"input",uiSchema:{title:'{{t("Scope name")}}',type:"string","x-component":"Input",required:!0}}]}),Ef=()=>{const{name:e}=d.useContext(me),t=r.useFormBlockContext();return d.useEffect(()=>{t.form.setInitialValues({resourceName:e})},[e]),{form:t.form}},jf=e=>{const t=Mf(e);return{type:"object",properties:{scope:{"x-component":"RecordPicker","x-component-props":{size:"small",fieldNames:{label:"name",value:"id"},multiple:!1,association:{target:"rolesResourcesScopes"},onChange:"{{ onChange }}"},properties:{selector:{type:"void",title:'{{ t("Select record") }}',"x-component":"RecordPicker.Selector","x-component-props":{className:"nb-record-picker-selector"},properties:{tableBlock:{type:"void","x-decorator":"TableSelectorProvider","x-decorator-props":{collection:t,resource:`dataSources/${e}/rolesResourcesScopes`,action:"list",params:{pageSize:20},useParams(){return{filter:{$or:[{resourceName:d.useContext(me).name},{resourceName:null}]}}},rowKey:"id"},"x-component":"BlockItem",properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{create:{type:"void",title:'{{ t("Add new") }}',"x-action":"create","x-component":"Action","x-component-props":{icon:"PlusOutlined",openMode:"drawer",type:"primary"},properties:{drawer:{type:"void",title:'{{ t("Add record") }}',"x-component":"Action.Container","x-component-props":{className:"nb-action-popup"},properties:{formBlock:{type:"void","x-decorator":"FormBlockProvider","x-decorator-props":{resource:`dataSources/${e}/rolesResourcesScopes`,collection:t},"x-component":"CardItem",properties:{form:{type:"void","x-component":"FormV2","x-use-component-props":Ef,properties:{name:{type:"string","x-component":"CollectionField","x-decorator":"FormItem"},scope:{type:"object",title:'{{t("Data scope")}}',name:"filter","x-decorator":"FormItem","x-component":"Filter","x-use-component-props":()=>{const o=d.useContext(me);return{options:r.useFilterFieldOptions(o.fields)}},"x-component-props":{dynamicComponent:r.VariableInput}},actions:{type:"void","x-component":"ActionBar","x-component-props":{layout:"one-column",style:{marginTop:24}},properties:{create:{title:'{{ t("Submit") }}',"x-action":"submit","x-component":"Action","x-use-component-props":"useCreateActionProps","x-component-props":{type:"primary",htmlType:"submit"}}}}}}}}}}}}}},value:{type:"array","x-component":"TableV2.Selector","x-use-component-props":"useTableSelectorProps","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"}},properties:{column1:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{name:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},actions:{type:"void",title:'{{ t("Actions") }}',"x-action-column":"actions","x-component":"TableV2.Column",properties:{actions:{type:"void","x-decorator":"DndContext","x-component":"Space","x-component-props":{split:"|"},properties:{edit:{type:"void",title:'{{ t("Edit") }}',"x-action":"update","x-decorator":"ACLActionProvider","x-component":"Action.Link","x-component-props":{openMode:"drawer",icon:"EditOutlined"},properties:{drawer:{type:"void",title:'{{ t("Edit record") }}',"x-component":"Action.Container","x-component-props":{className:"nb-action-popup"},properties:{formBlock:{type:"void","x-decorator":"FormBlockProvider","x-decorator-props":{resource:`dataSources/${e}/rolesResourcesScopes`,collection:t,action:"get",useParams:"{{ useParamsFromRecord }}"},"x-component":"CardItem",properties:{form:{type:"void","x-component":"FormV2","x-use-component-props":"useFormBlockProps",properties:{name:{type:"string","x-component":"CollectionField","x-decorator":"FormItem"},scope:{type:"object",title:'{{t("Data scope")}}',name:"filter","x-decorator":"FormItem","x-component":"Filter","x-use-component-props":()=>{const o=d.useContext(me);return{options:r.useFilterFieldOptions(o.fields)}},"x-component-props":{dynamicComponent:r.VariableInput}},actions:{type:"void","x-component":"ActionBar","x-component-props":{layout:"one-column",style:{marginTop:24}},properties:{update:{title:'{{ t("Submit") }}',"x-action":"submit","x-component":"Action","x-use-component-props":"useUpdateActionProps","x-component-props":{type:"primary",htmlType:"submit"}}}}}}}}}}}},destroy:{title:'{{ t("Delete") }}',"x-action":"destroy","x-decorator":"ACLActionProvider","x-component":"Action.Link","x-use-component-props":"useDestroyActionProps","x-component-props":{icon:"DeleteOutlined",confirm:{title:"{{t('Delete record')}}",content:"{{t('Are you sure you want to delete it?')}}"}}}}}}}}}}},footer:{"x-component":"Action.Container.Footer","x-component-props":{},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{},properties:{submit:{title:'{{ t("Submit") }}',"x-action":"submit","x-component":"Action","x-use-component-props":"usePickActionProps","x-component-props":{type:"primary",htmlType:"submit"}}}}}}}}}}}}},Uo=d.createContext(null);Uo.displayName="RolesResourcesScopesSelectedRowKeysContext";const kf=e=>{const[t,o]=d.useState([]);return s.jsx(Uo.Provider,{value:[t,o],children:e.children})},Kf=e=>{const t=d.useMemo(()=>ye.createForm({values:{scope:e.value}}),[]),{key:o}=r.useRecord(),n=jf(o);return s.jsx(r.FormProvider,{form:t,children:s.jsx(r.SchemaComponent,{components:{RolesResourcesScopesSelectedRowKeysProvider:kf},scope:{onChange(i){var a;(a=e==null?void 0:e.onChange)==null||a.call(e,i)}},schema:n})})},Nf=e=>{var o;const t={};return(o=e==null?void 0:e.forEach)==null||o.call(e,n=>{n.name&&(t[n.name]=n,t[n.name].scope=Y.isEmpty(n.scope)?null:n.scope)}),t},me=d.createContext({});me.displayName="RoleResourceCollectionContext";const Bf=w.connect(e=>{var b,m;const{styles:t}=Of(),o=h=>{const g=h.map(C=>K(T({},C),{scope:Y.isEmpty(C.scope)?null:C.scope}));e.onChange(g)},n=r.useRecord(),i=qo(),a=n.fields,c=r.useCompile(),{t:l}=B.useTranslation(),p=w.useField(),u=Nf(p.value||[]),f=(h,g)=>{var F;const C=u==null?void 0:u[h];return C?(F=C==null?void 0:C.fields)==null?void 0:F.includes(g):!1},y=i.filter(h=>h.allowConfigureFields),x=a==null?void 0:a.map(h=>{const g=T({},h);for(const C of y)g[C.name]=f(C.name,h.name);return g}),_=h=>{var g;u[h]?delete u[h]:u[h]={name:h,fields:(g=a==null?void 0:a.map)==null?void 0:g.call(a,C=>C.name)},o(Object.values(u))},A=(h,g)=>{u[h]?(u[h].scope=g,o(Object.values(u))):(_(h),u[h].scope=g,o(Object.values(u)))},v={};for(const h of y)v[h.name]=(a==null?void 0:a.length)===((m=(b=u==null?void 0:u[h.name])==null?void 0:b.fields)==null?void 0:m.length);return s.jsx("div",{children:s.jsx(me.Provider,{value:n,children:s.jsxs(ae.FormLayout,{layout:"vertical",children:[s.jsx(ae.FormItem,{label:l("Action permission"),children:s.jsx(S.Table,{className:t,size:"small",pagination:!1,columns:[{dataIndex:"displayName",title:l("Action display name"),render:h=>c(h)},{dataIndex:"onNewRecord",title:l("Action type"),render:h=>h?s.jsx(S.Tag,{color:"green",children:l("Action on new records")}):s.jsx(S.Tag,{color:"geekblue",children:l("Action on existing records")})},{dataIndex:"enabled",title:l("Allow"),render:(h,g)=>s.jsx(S.Checkbox,{checked:h,onChange:()=>{_(g.name)}})},{dataIndex:"scope",title:l("Data scope"),render:(h,g)=>!g.onNewRecord&&s.jsx(Kf,{value:h,onChange:C=>{A(g.name,C)}})}],dataSource:i==null?void 0:i.map(h=>{let g=!1,C=null;return u[h.name]&&(g=!0,h.onNewRecord||(C=u[h.name].scope)),K(T({},h),{enabled:g,scope:C})})})}),s.jsx(ae.FormItem,{label:l("Field permission"),children:s.jsx(S.Table,{className:t,pagination:!1,dataSource:x,columns:[{dataIndex:["uiSchema","title"],title:l("Field display name"),render:(h,g)=>c(h)||g.name},...y.map(h=>{const g=v==null?void 0:v[h.name];return{dataIndex:h.name,title:s.jsxs(s.Fragment,{children:[s.jsx(S.Checkbox,{checked:g,onChange:()=>{var F;const C=u[h.name]||{name:h.name};g?C.fields=[]:C.fields=(F=a==null?void 0:a.map)==null?void 0:F.call(a,N=>N.name),u[h.name]=C,o(Object.values(u))}}),c(h.displayName)]}),render:(C,F)=>s.jsx(S.Checkbox,{checked:C,onChange:()=>{const N=u[h.name]||{name:h.name},j=N.fields||[];if(C){const D=j.indexOf(F.name);j.splice(D,1)}else j.push(F.name);N.fields=j,u[h.name]=N,o(Object.values(u))}})}})]})})]})})})}),Vf={type:"object",properties:{[V.uid()]:{"x-component":"DataSourceTable"}}},be=d.createContext({});be.displayName="CurrentRolesContext";const Lf=({role:e})=>s.jsx(S.Card,{"data-testid":"acl-pane-card",bordered:!1,children:s.jsx(be.Provider,{value:e,children:s.jsx(r.SchemaComponent,{components:{MenuConfigure:r.MenuConfigure,RoleConfigure:Pf,RolesResourcesActions:Bf,DataSourceTable:_f,StrategyActions:If,SettingsCenterConfigure:r.SettingsCenterConfigure,SettingCenterProvider:r.SettingCenterProvider,ResourceActionProvider:r.ResourceActionProvider,RoleRecordProvider:Sf},schema:Vf})})});class xe extends r.Plugin{constructor(){super(...arguments);Yo(this,"types",new Map)}load(){return P(this,null,function*(){this.app.addComponents({DataSourcePermissionManager:Lf}),this.app.use(en),this.app.pluginSettingsManager.add(k,{title:`{{t("Data sources", { ns: "${k}" })}}`,icon:"ClusterOutlined",showTabs:!1,aclSnippet:"pm.data-source-manager*"}),this.app.pluginSettingsManager.add(`${k}.list`,{title:`{{t("Data sources", { ns: "${k}" })}}`,Component:Uy,sort:1,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager"}),this.app.pluginSettingsManager.add(`${k}/:name`,{title:s.jsx(ht,{}),icon:"ClusterOutlined",isTopLevel:!1,sort:100,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager"}),this.app.pluginSettingsManager.add(`${k}/main`,{title:s.jsx(ht,{}),icon:"ClusterOutlined",isTopLevel:!1,sort:100,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager.data-source-main"}),this.app.pluginSettingsManager.add(`${k}/main.collections`,{title:`{{t("Collections", { ns: "${k}" })}}`,Component:bf,topLevelName:`${k}/main`,pluginKey:k,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager.data-source-main"}),this.app.pluginSettingsManager.add(`${k}/:name.collections`,{title:`{{t("Collections", { ns: "${k}" })}}`,Component:By,topLevelName:`${k}/:name`,pluginKey:k,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager.data-source-main"}),this.app.dataSourceManager.addDataSources(this.getThirdDataSource.bind(this),yt)})}setDataSources(){return P(this,null,function*(){var n;const o=yield this.app.apiClient.request({resource:"dataSources",action:"listEnabled",params:{paginate:!1}});return(n=o==null?void 0:o.data)==null?void 0:n.data})}getThirdDataSource(){return P(this,null,function*(){var n;const o=yield this.app.apiClient.request({resource:"dataSources",action:"listEnabled",params:{paginate:!1,appends:["collections"]}});return(n=o==null?void 0:o.data)==null?void 0:n.data})}registerType(o,n){this.types.set(o,n)}}M.PluginDataSourceManagerClient=xe,M.default=xe,Object.defineProperties(M,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
59
+ `),Mf=(e="main")=>({name:`dataSources/${e}/rolesResourcesScopes`,fields:[{type:"string",name:"name",interface:"input",uiSchema:{title:'{{t("Scope name")}}',type:"string","x-component":"Input",required:!0}}]}),Ef=()=>{const{name:e}=d.useContext(me),t=r.useFormBlockContext();return d.useEffect(()=>{t.form.setInitialValues({resourceName:e})},[e]),{form:t.form}},jf=e=>{const t=Mf(e);return{type:"object",properties:{scope:{"x-component":"RecordPicker","x-component-props":{size:"small",fieldNames:{label:"name",value:"id"},multiple:!1,association:{target:"rolesResourcesScopes"},onChange:"{{ onChange }}"},properties:{selector:{type:"void",title:'{{ t("Select record") }}',"x-component":"RecordPicker.Selector","x-component-props":{className:"nb-record-picker-selector"},properties:{tableBlock:{type:"void","x-decorator":"TableSelectorProvider","x-decorator-props":{collection:t,resource:`dataSources/${e}/rolesResourcesScopes`,action:"list",params:{pageSize:20},useParams(){return{filter:{$or:[{resourceName:d.useContext(me).name},{resourceName:null}]}}},rowKey:"id"},"x-component":"BlockItem",properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{create:{type:"void",title:'{{ t("Add new") }}',"x-action":"create","x-component":"Action","x-component-props":{icon:"PlusOutlined",openMode:"drawer",type:"primary"},properties:{drawer:{type:"void",title:'{{ t("Add record") }}',"x-component":"Action.Container","x-component-props":{className:"nb-action-popup"},properties:{formBlock:{type:"void","x-decorator":"FormBlockProvider","x-decorator-props":{resource:`dataSources/${e}/rolesResourcesScopes`,collection:t},"x-component":"CardItem",properties:{form:{type:"void","x-component":"FormV2","x-use-component-props":Ef,properties:{name:{type:"string","x-component":"CollectionField","x-decorator":"FormItem"},scope:{type:"object",title:'{{t("Data scope")}}',name:"filter","x-decorator":"FormItem","x-component":o=>s.jsx(r.FlagProvider,{isVariableParsedInOtherContext:!0,children:s.jsx(r.Filter,T({},o))}),"x-use-component-props":()=>{const o=d.useContext(me);return{options:r.useFilterFieldOptions(o.fields)}},"x-component-props":{dynamicComponent:r.VariableInput}},actions:{type:"void","x-component":"ActionBar","x-component-props":{layout:"one-column",style:{marginTop:24}},properties:{create:{title:'{{ t("Submit") }}',"x-action":"submit","x-component":"Action","x-use-component-props":"useCreateActionProps","x-component-props":{type:"primary",htmlType:"submit"}}}}}}}}}}}}}},value:{type:"array","x-component":"TableV2.Selector","x-use-component-props":"useTableSelectorProps","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"}},properties:{column1:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{name:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},actions:{type:"void",title:'{{ t("Actions") }}',"x-action-column":"actions","x-component":"TableV2.Column",properties:{actions:{type:"void","x-decorator":"DndContext","x-component":"Space","x-component-props":{split:"|"},properties:{edit:{type:"void",title:'{{ t("Edit") }}',"x-action":"update","x-decorator":"ACLActionProvider","x-component":"Action.Link","x-component-props":{openMode:"drawer",icon:"EditOutlined"},properties:{drawer:{type:"void",title:'{{ t("Edit record") }}',"x-component":"Action.Container","x-component-props":{className:"nb-action-popup"},properties:{formBlock:{type:"void","x-decorator":"FormBlockProvider","x-decorator-props":{resource:`dataSources/${e}/rolesResourcesScopes`,collection:t,action:"get",useParams:"{{ useParamsFromRecord }}"},"x-component":"CardItem",properties:{form:{type:"void","x-component":"FormV2","x-use-component-props":"useFormBlockProps",properties:{name:{type:"string","x-component":"CollectionField","x-decorator":"FormItem"},scope:{type:"object",title:'{{t("Data scope")}}',name:"filter","x-decorator":"FormItem","x-component":o=>s.jsx(r.FlagProvider,{isVariableParsedInOtherContext:!0,children:s.jsx(r.Filter,T({},o))}),"x-use-component-props":()=>{const o=d.useContext(me);return{options:r.useFilterFieldOptions(o.fields)}},"x-component-props":{dynamicComponent:r.VariableInput}},actions:{type:"void","x-component":"ActionBar","x-component-props":{layout:"one-column",style:{marginTop:24}},properties:{update:{title:'{{ t("Submit") }}',"x-action":"submit","x-component":"Action","x-use-component-props":"useUpdateActionProps","x-component-props":{type:"primary",htmlType:"submit"}}}}}}}}}}}},destroy:{title:'{{ t("Delete") }}',"x-action":"destroy","x-decorator":"ACLActionProvider","x-component":"Action.Link","x-use-component-props":"useDestroyActionProps","x-component-props":{icon:"DeleteOutlined",confirm:{title:"{{t('Delete record')}}",content:"{{t('Are you sure you want to delete it?')}}"}}}}}}}}}}},footer:{"x-component":"Action.Container.Footer","x-component-props":{},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{},properties:{submit:{title:'{{ t("Submit") }}',"x-action":"submit","x-component":"Action","x-use-component-props":"usePickActionProps","x-component-props":{type:"primary",htmlType:"submit"}}}}}}}}}}}}},Uo=d.createContext(null);Uo.displayName="RolesResourcesScopesSelectedRowKeysContext";const kf=e=>{const[t,o]=d.useState([]);return s.jsx(Uo.Provider,{value:[t,o],children:e.children})},Kf=e=>{const t=d.useMemo(()=>ye.createForm({values:{scope:e.value}}),[]),{key:o}=r.useRecord(),n=jf(o);return s.jsx(r.FormProvider,{form:t,children:s.jsx(r.SchemaComponent,{components:{RolesResourcesScopesSelectedRowKeysProvider:kf},scope:{onChange(i){var a;(a=e==null?void 0:e.onChange)==null||a.call(e,i)}},schema:n})})},Nf=e=>{var o;const t={};return(o=e==null?void 0:e.forEach)==null||o.call(e,n=>{n.name&&(t[n.name]=n,t[n.name].scope=Y.isEmpty(n.scope)?null:n.scope)}),t},me=d.createContext({});me.displayName="RoleResourceCollectionContext";const Bf=w.connect(e=>{var b,m;const{styles:t}=Of(),o=h=>{const g=h.map(C=>K(T({},C),{scope:Y.isEmpty(C.scope)?null:C.scope}));e.onChange(g)},n=r.useRecord(),i=qo(),a=n.fields,c=r.useCompile(),{t:l}=B.useTranslation(),p=w.useField(),u=Nf(p.value||[]),f=(h,g)=>{var F;const C=u==null?void 0:u[h];return C?(F=C==null?void 0:C.fields)==null?void 0:F.includes(g):!1},y=i.filter(h=>h.allowConfigureFields),x=a==null?void 0:a.map(h=>{const g=T({},h);for(const C of y)g[C.name]=f(C.name,h.name);return g}),_=h=>{var g;u[h]?delete u[h]:u[h]={name:h,fields:(g=a==null?void 0:a.map)==null?void 0:g.call(a,C=>C.name)},o(Object.values(u))},A=(h,g)=>{u[h]?(u[h].scope=g,o(Object.values(u))):(_(h),u[h].scope=g,o(Object.values(u)))},v={};for(const h of y)v[h.name]=(a==null?void 0:a.length)===((m=(b=u==null?void 0:u[h.name])==null?void 0:b.fields)==null?void 0:m.length);return s.jsx("div",{children:s.jsx(me.Provider,{value:n,children:s.jsxs(ae.FormLayout,{layout:"vertical",children:[s.jsx(ae.FormItem,{label:l("Action permission"),children:s.jsx(S.Table,{className:t,size:"small",pagination:!1,columns:[{dataIndex:"displayName",title:l("Action display name"),render:h=>c(h)},{dataIndex:"onNewRecord",title:l("Action type"),render:h=>h?s.jsx(S.Tag,{color:"green",children:l("Action on new records")}):s.jsx(S.Tag,{color:"geekblue",children:l("Action on existing records")})},{dataIndex:"enabled",title:l("Allow"),render:(h,g)=>s.jsx(S.Checkbox,{checked:h,onChange:()=>{_(g.name)}})},{dataIndex:"scope",title:l("Data scope"),render:(h,g)=>!g.onNewRecord&&s.jsx(Kf,{value:h,onChange:C=>{A(g.name,C)}})}],dataSource:i==null?void 0:i.map(h=>{let g=!1,C=null;return u[h.name]&&(g=!0,h.onNewRecord||(C=u[h.name].scope)),K(T({},h),{enabled:g,scope:C})})})}),s.jsx(ae.FormItem,{label:l("Field permission"),children:s.jsx(S.Table,{className:t,pagination:!1,dataSource:x,columns:[{dataIndex:["uiSchema","title"],title:l("Field display name"),render:(h,g)=>c(h)||g.name},...y.map(h=>{const g=v==null?void 0:v[h.name];return{dataIndex:h.name,title:s.jsxs(s.Fragment,{children:[s.jsx(S.Checkbox,{checked:g,onChange:()=>{var F;const C=u[h.name]||{name:h.name};g?C.fields=[]:C.fields=(F=a==null?void 0:a.map)==null?void 0:F.call(a,N=>N.name),u[h.name]=C,o(Object.values(u))}}),c(h.displayName)]}),render:(C,F)=>s.jsx(S.Checkbox,{checked:C,onChange:()=>{const N=u[h.name]||{name:h.name},j=N.fields||[];if(C){const D=j.indexOf(F.name);j.splice(D,1)}else j.push(F.name);N.fields=j,u[h.name]=N,o(Object.values(u))}})}})]})})]})})})}),Vf={type:"object",properties:{[V.uid()]:{"x-component":"DataSourceTable"}}},be=d.createContext({});be.displayName="CurrentRolesContext";const Lf=({role:e})=>s.jsx(S.Card,{"data-testid":"acl-pane-card",bordered:!1,children:s.jsx(be.Provider,{value:e,children:s.jsx(r.SchemaComponent,{components:{MenuConfigure:r.MenuConfigure,RoleConfigure:Pf,RolesResourcesActions:Bf,DataSourceTable:_f,StrategyActions:If,SettingsCenterConfigure:r.SettingsCenterConfigure,SettingCenterProvider:r.SettingCenterProvider,ResourceActionProvider:r.ResourceActionProvider,RoleRecordProvider:Sf},schema:Vf})})});class xe extends r.Plugin{constructor(){super(...arguments);Yo(this,"types",new Map)}load(){return P(this,null,function*(){this.app.addComponents({DataSourcePermissionManager:Lf}),this.app.use(en),this.app.pluginSettingsManager.add(k,{title:`{{t("Data sources", { ns: "${k}" })}}`,icon:"ClusterOutlined",showTabs:!1,aclSnippet:"pm.data-source-manager*"}),this.app.pluginSettingsManager.add(`${k}.list`,{title:`{{t("Data sources", { ns: "${k}" })}}`,Component:Uy,sort:1,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager"}),this.app.pluginSettingsManager.add(`${k}/:name`,{title:s.jsx(ht,{}),icon:"ClusterOutlined",isTopLevel:!1,sort:100,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager"}),this.app.pluginSettingsManager.add(`${k}/main`,{title:s.jsx(ht,{}),icon:"ClusterOutlined",isTopLevel:!1,sort:100,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager.data-source-main"}),this.app.pluginSettingsManager.add(`${k}/main.collections`,{title:`{{t("Collections", { ns: "${k}" })}}`,Component:bf,topLevelName:`${k}/main`,pluginKey:k,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager.data-source-main"}),this.app.pluginSettingsManager.add(`${k}/:name.collections`,{title:`{{t("Collections", { ns: "${k}" })}}`,Component:By,topLevelName:`${k}/:name`,pluginKey:k,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager.data-source-main"}),this.app.dataSourceManager.addDataSources(this.getThirdDataSource.bind(this),yt)})}setDataSources(){return P(this,null,function*(){var n;const o=yield this.app.apiClient.request({resource:"dataSources",action:"listEnabled",params:{paginate:!1}});return(n=o==null?void 0:o.data)==null?void 0:n.data})}getThirdDataSource(){return P(this,null,function*(){var n;const o=yield this.app.apiClient.request({resource:"dataSources",action:"listEnabled",params:{paginate:!1,appends:["collections"]}});return(n=o==null?void 0:o.data)==null?void 0:n.data})}registerType(o,n){this.types.set(o,n)}}M.PluginDataSourceManagerClient=xe,M.default=xe,Object.defineProperties(M,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -8,9 +8,9 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "1.0.0-alpha.16",
11
+ "@nocobase/client": "1.0.0-alpha.17",
12
12
  "react": "18.2.0",
13
- "@nocobase/server": "1.0.0-alpha.16",
13
+ "@nocobase/server": "1.0.0-alpha.17",
14
14
  "lodash": "4.17.21",
15
15
  "@ant-design/icons": "5.2.6",
16
16
  "antd": "5.12.8",
@@ -19,11 +19,12 @@ module.exports = {
19
19
  "react-i18next": "11.18.6",
20
20
  "@formily/react": "2.3.0",
21
21
  "@emotion/css": "11.11.2",
22
- "@nocobase/database": "1.0.0-alpha.16",
23
- "@nocobase/utils": "1.0.0-alpha.16",
24
- "@nocobase/plugin-acl": "1.0.0-alpha.16",
25
- "@nocobase/acl": "1.0.0-alpha.16",
22
+ "@nocobase/database": "1.0.0-alpha.17",
23
+ "@nocobase/utils": "1.0.0-alpha.17",
24
+ "@nocobase/plugin-acl": "1.0.0-alpha.17",
25
+ "@nocobase/acl": "1.0.0-alpha.17",
26
26
  "sequelize": "6.35.2",
27
+ "@nocobase/test": "1.0.0-alpha.17",
27
28
  "@formily/antd-v5": "1.1.9",
28
29
  "@formily/core": "2.3.0",
29
30
  "@formily/reactive": "2.3.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-data-source-manager",
3
- "version": "1.0.0-alpha.16",
3
+ "version": "1.0.0-alpha.17",
4
4
  "main": "dist/server/index.js",
5
5
  "displayName": "Data source manager",
6
6
  "displayName.zh-CN": "数据源管理",
@@ -16,5 +16,5 @@
16
16
  "keywords": [
17
17
  "Data model tools"
18
18
  ],
19
- "gitHead": "2a80f1804e0f0972d40e1a201310b192914849d0"
19
+ "gitHead": "a38719a9d25efc14e06e979209ff5085e049aca7"
20
20
  }