@nocobase/plugin-users 1.3.39-beta → 1.4.0-alpha

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.
@@ -7,4 +7,8 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
- (function(t,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("@nocobase/client"),require("@nocobase/utils/client"),require("react/jsx-runtime"),require("react"),require("@formily/shared"),require("react-i18next"),require("antd"),require("@formily/react"),require("@formily/core"),require("@nocobase/plugin-acl/client")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client","@nocobase/utils/client","react/jsx-runtime","react","@formily/shared","react-i18next","antd","@formily/react","@formily/core","@nocobase/plugin-acl/client"],e):(t=typeof globalThis!="undefined"?globalThis:t||self,e(t["@nocobase/plugin-users"]={},t["@nocobase/client"],t["@nocobase/utils"],t.jsxRuntime,t.react,t["@formily/shared"],t["react-i18next"],t.antd,t["@formily/react"],t["@formily/core"],t["@nocobase/plugin-acl"]))})(this,function(t,e,s,m,a,h,b,d,x,v,C){"use strict";var z=Object.defineProperty,H=Object.defineProperties;var $=Object.getOwnPropertyDescriptors;var P=Object.getOwnPropertySymbols;var G=Object.prototype.hasOwnProperty,J=Object.prototype.propertyIsEnumerable;var S=(t,e,s)=>e in t?z(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,F=(t,e)=>{for(var s in e||(e={}))G.call(e,s)&&S(t,s,e[s]);if(P)for(var s of P(e))J.call(e,s)&&S(t,s,e[s]);return t},T=(t,e)=>H(t,$(e));var f=(t,e,s)=>new Promise((m,a)=>{var h=x=>{try{d(s.next(x))}catch(v){a(v)}},b=x=>{try{d(s.throw(x))}catch(v){a(v)}},d=x=>x.done?m(x.value):Promise.resolve(x.value).then(h,b);d((s=s.apply(t,e)).next())});const w={name:"users",fields:[{name:"id",type:"bigInt",autoIncrement:!0,primaryKey:!0,allowNull:!1,uiSchema:{type:"number",title:'{{t("ID")}}',"x-component":"InputNumber","x-read-pretty":!0},interface:"id"},{interface:"input",type:"string",name:"nickname",uiSchema:{type:"string",title:'{{t("Nickname")}}',"x-component":"Input"}},{interface:"input",type:"string",name:"username",unique:!0,uiSchema:{type:"string",title:'{{t("Username")}}',"x-component":"Input","x-validator":{username:!0},required:!0}},{interface:"email",type:"string",name:"email",unique:!0,uiSchema:{type:"string",title:'{{t("Email")}}',"x-component":"Input","x-validator":"email",required:!0}},{interface:"phone",type:"string",name:"phone",unique:!0,uiSchema:{type:"string",title:'{{t("Phone")}}',"x-component":"Input",required:!0}},{interface:"password",type:"password",name:"password",hidden:!0,uiSchema:{type:"string",title:'{{t("Password")}}',"x-component":"Password"}},{interface:"m2m",type:"belongsToMany",name:"roles",target:"roles",foreignKey:"userId",otherKey:"roleName",onDelete:"CASCADE",sourceKey:"id",targetKey:"name",through:"rolesUsers",uiSchema:{type:"array",title:'{{t("Roles")}}',"x-component":"AssociationField","x-component-props":{multiple:!0,fieldNames:{label:"title",value:"name"}}}}]},D={type:"object",properties:{block1:{type:"void","x-component":"CardItem","x-component-props":{heightMode:"fullHeight"},"x-decorator":"TableBlockProvider","x-decorator-props":{dataSource:"main",rowKey:"id",collection:"users",action:"list",params:{pageSize:20}},"x-use-decorator-props":"useTableBlockDecoratorProps",properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:"var(--nb-spacing)"}},properties:{filter:{type:"void",title:'{{ t("Filter") }}',"x-action":"filter","x-component":"Filter.Action","x-use-component-props":"useFilterActionProps","x-component-props":{icon:"FilterOutlined"},"x-align":"left"},refresh:{type:"void",title:'{{ t("Refresh") }}',"x-action":"refresh","x-component":"Action","x-component-props":{icon:"ReloadOutlined"},"x-use-component-props":"useRefreshActionProps"},delete:{type:"void",title:'{{ t("Delete") }}',"x-component":"Action","x-component-props":{confirm:{title:"{{t('Delete users')}}",content:"{{t('Are you sure you want to delete it?')}}"},icon:"DeleteOutlined"},"x-use-component-props":"useBulkDestroyActionProps"},create:{type:"void",title:'{{t("Add new")}}',"x-component":"Action","x-component-props":{type:"primary",icon:"PlusOutlined"},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"FormV2",title:'{{t("Add user")}}',properties:{nickname:{"x-component":"CollectionField","x-decorator":"FormItem"},username:{"x-component":"CollectionField","x-decorator":"FormItem"},email:{title:'{{t("Email")}}',"x-component":"Input","x-validator":"email","x-decorator":"FormItem",required:!1},phone:{title:'{{t("Phone")}}',"x-component":"Input","x-decorator":"FormItem",required:!1},password:{"x-component":"CollectionField","x-decorator":"FormItem",required:!0},roles:{"x-component":"CollectionField","x-collection-field":"users.roles","x-decorator":"FormItem"},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-use-component-props":"useCancelActionProps"},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary"},"x-use-component-props":"useSubmitActionProps"}}}}}}}}},table:{type:"array","x-uid":"input","x-component":"TableV2","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"}},"x-use-component-props":"useTableBlockProps",properties:{column1:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{nickname:{type:"number","x-component":"CollectionField","x-read-pretty":!0}}},column2:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{username:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},column3:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{email:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},column4:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",title:'{{t("Roles")}}',properties:{roles:{type:"array","x-component":"CollectionField","x-component-props":{mode:"Tag",enableLink:!1,ellipsis:!0},"x-read-pretty":!0,"x-collection-field":"users.roles"}}},column5:{type:"void",title:'{{t("Actions")}}',"x-component":"TableV2.Column","x-decorator":"TableV2.Column.ActionBar",properties:{actions:{type:"void","x-component":"Space","x-component-props":{split:"|"},properties:{update:{type:"void",title:'{{t("Edit profile")}}',"x-decorator":"ACLActionProvider","x-acl-action":"users:update","x-component":"Action.Link","x-component-props":{type:"primary"},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"FormV2","x-use-decorator-props":"useEditFormProps",title:'{{t("Edit profile")}}',properties:{nickname:{"x-component":"CollectionField","x-decorator":"FormItem"},username:{"x-component":"CollectionField","x-decorator":"FormItem"},email:{title:'{{t("Email")}}',"x-component":"Input","x-validator":"email","x-decorator":"FormItem",required:!1},phone:{title:'{{t("Phone")}}',"x-component":"Input","x-decorator":"FormItem",required:!1},roles:{"x-component":"CollectionField","x-decorator":"FormItem","x-collection-field":"users.roles"},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-use-component-props":"useCancelActionProps"},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary"},"x-use-component-props":"useSubmitActionProps"}}}}}}},changePassword:{type:"void",title:'{{t("Change password")}}',"x-decorator":"ACLActionProvider","x-acl-action":"users:update","x-component":"Action.Link","x-component-props":{type:"primary"},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"FormV2","x-use-decorator-props":"useEditFormProps",title:'{{t("Change password")}}',properties:{password:{"x-component":"CollectionField","x-component-props":{component:"PasswordField"},"x-decorator":"FormItem",required:!0},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-use-component-props":"useCancelActionProps"},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary"},"x-use-component-props":"useSubmitActionProps"}}}}}}},delete:{type:"void",title:'{{ t("Delete") }}',"x-acl-action":"users:destroy","x-action":"destroy","x-decorator":"ACLActionProvider","x-component":"Action.Link","x-component-props":{confirm:{title:"{{t('Delete')}}",content:"{{t('Are you sure you want to delete it?')}}"}},"x-use-component-props":"useDestroyActionProps"}}}}}}}}}}},k=()=>({type:"void",properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{[h.uid()]:{type:"void",title:'{{ t("Filter") }}',"x-action":"filter","x-component":"Filter.Action","x-use-component-props":"useFilterActionProps","x-component-props":{icon:"FilterOutlined"},"x-align":"left"},actions:{type:"void","x-component":"Space",properties:{remove:{type:"void",title:'{{t("Remove")}}',"x-component":"Action","x-component-props":{icon:"MinusOutlined",confirm:{title:"{{t('Remove')}}",content:"{{t('Are you sure you want to remove these users?')}}"},style:{marginRight:8},useAction:"{{ useBulkRemoveUsers }}"}},create:{type:"void",title:'{{t("Add users")}}',"x-component":"Action","x-component-props":{type:"primary",icon:"PlusOutlined"},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"FormV2",title:'{{t("Add users")}}',properties:{resource:{type:"void","x-decorator":"FormItem","x-component":"RoleUsersProvider",properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{filter:{type:"void",title:'{{ t("Filter") }}',default:{$and:[{username:{$includes:""}},{nickname:{$includes:""}}]},"x-action":"filter","x-component":"Filter.Action","x-use-component-props":"useFilterActionProps","x-component-props":{icon:"FilterOutlined"},"x-align":"left"}}},table:{type:"void","x-component":"Table.Void","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox",onChange:"{{ handleSelectRoleUsers }}"},useDataSource:"{{ cm.useDataSourceFromRAC }}"},properties:{username:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{username:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},nickname:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{nickname:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},phone:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{phone:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},email:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{email:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}}}}}},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{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:"{{ useAddRoleUsers }}"}}}}}}}}}}}},table:{type:"void","x-component":"Table.Void","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"},useDataSource:"{{ cm.useDataSourceFromRAC }}"},properties:{username:{type:"void",title:'{{t("Username")}}',"x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{username:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},nickname:{type:"void",title:'{{t("Nickname")}}',"x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{nickname:{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":{split:"|"},properties:{remove:{type:"void",title:'{{ t("Remove") }}',"x-component":"Action.Link","x-component-props":{confirm:{title:"{{t('Remove user')}}",content:"{{t('Are you sure you want to remove it?')}}"},useAction:"{{ useRemoveUser }}"}}}}}}}}}});function A(){return b.useTranslation(["users","client"],{nsMode:"fallback"})}const I=(r=10)=>{const o="ABCDEFGHIJKLMNOPQRSTUVWXYZ",i="abcdefghijklmnopqrstuvwxyz",n="0123456789",p="!#$%^&*-_+=",y=o+i+n+p,l=new Uint32Array(r);crypto.getRandomValues(l);let u="";u+=o.charAt(l[0]%o.length),u+=i.charAt(l[1]%i.length),u+=n.charAt(l[2]%n.length),u+=p.charAt(l[3]%p.length);for(let c=4;c<r;c++){const g=l[c]%y.length;u+=y.charAt(g)}return u=u[0]+u.slice(1).split("").sort(()=>Math.random()-.5).join(""),u},R=()=>{const{t:r}=A(),o=x.useField(),[i,n]=a.useState(!1),p=e.useActionContext();return a.useEffect(()=>{p.visible||o.reset()},[o,p.visible]),m.jsxs(d.Row,{gutter:10,children:[m.jsx(d.Col,{span:18,children:m.jsx(e.Password,{checkStrength:!0,visibilityToggle:{visible:i,onVisibleChange:n},value:o.value,onChange:y=>o.setValue(y.target.value),autoComplete:"off"})}),m.jsx(d.Col,{span:4,children:m.jsx(d.Button,{onClick:()=>{o.setValue(I()),n(!0)},children:r("Random password")})})]})},V=()=>{const{setVisible:r}=e.useActionContext();return{type:"default",onClick(){r(!1)}}},q=()=>{const{setVisible:r}=e.useActionContext(),{message:o}=d.App.useApp(),i=x.useForm(),n=e.useDataBlockResource(),{runAsync:p}=e.useDataBlockRequest(),{t:y}=A(),l=e.useCollection();return{type:"primary",onClick(){return f(this,null,function*(){yield i.submit();const c=i.values;console.log("values:",c),c[l.filterTargetKey]?yield n.update({values:c,filterByTk:c[l.filterTargetKey]}):yield n.create({values:c}),yield p(),o.success(y("Saved successfully")),r(!1)})}}},U=()=>{const r=e.useCollectionRecordData();return{form:a.useMemo(()=>v.createForm({initialValues:r}),[r])}},M=()=>{const{t:r}=A(),o=e.useSchemaComponentContext();return m.jsx(e.SchemaComponentContext.Provider,{value:T(F({},o),{designable:!1}),children:m.jsx(e.SchemaComponent,{schema:D,scope:{t:r,useCancelActionProps:V,useSubmitActionProps:q,useEditFormProps:U},components:{PasswordField:R}})})},B=()=>{var n,p;const r=a.useContext(e.CollectionContext),o=e.useFilterFieldOptions(r.fields),i=e.useResourceActionContext();return e.useFilterFieldProps({options:o,params:((p=(n=i.state)==null?void 0:n.params)==null?void 0:p[0])||i.params,service:i})},K=()=>{const r=e.useAPIClient(),{role:o}=a.useContext(C.RolesManagerContext),i=e.useRecord(),{refresh:n}=e.useResourceActionContext();return{run(){return f(this,null,function*(){yield r.resource("roles.users",o==null?void 0:o.name).remove({values:[i.id]}),n()})}}},O=()=>{const{t:r}=A(),{message:o}=d.App.useApp(),i=e.useAPIClient(),{state:n,setState:p,refresh:y}=e.useResourceActionContext(),{role:l}=a.useContext(C.RolesManagerContext);return{run(){return f(this,null,function*(){const c=n==null?void 0:n.selectedRowKeys;if(!(c!=null&&c.length)){o.warning(r("Please select users"));return}yield i.resource("roles.users",l==null?void 0:l.name).remove({values:c}),p==null||p({selectedRowKeys:[]}),y()})}}},E=r=>{const{role:o}=a.useContext(C.RolesManagerContext);return m.jsx(e.ResourceActionProvider,{collection:w,request:{resource:"users",action:"listExcludeRole",params:{roleName:o==null?void 0:o.name}},children:r.children})},j=()=>{const{t:r}=A(),{role:o}=a.useContext(C.RolesManagerContext),i=e.useRequest({resource:"roles.users",resourceOf:o==null?void 0:o.name,action:"list"},{ready:!!o});a.useEffect(()=>{i.run()},[o]);const n=a.useRef([]),p=(u,c)=>{n.current=c},y=()=>{const{role:u}=a.useContext(C.RolesManagerContext),c=e.useAPIClient(),{setVisible:g}=e.useActionContext(),{refresh:L}=e.useResourceActionContext();return{run(){return f(this,null,function*(){yield c.resource("roles.users",u==null?void 0:u.name).add({values:n.current.map(_=>_.id)}),n.current=[],g(!1),L()})}}},l=a.useMemo(()=>k(),[o]);return m.jsx(e.ResourceActionContext.Provider,{value:F({},i),children:m.jsx(e.CollectionProvider_deprecated,{collection:w,children:m.jsx(e.SchemaComponent,{schema:l,components:{RoleUsersProvider:E},scope:{useBulkRemoveUsers:O,useRemoveUser:K,handleSelectRoleUsers:p,useAddRoleUsers:y,useFilterActionProps:B,t:r}})})})};class N extends e.Plugin{load(){return f(this,null,function*(){this.app.pluginSettingsManager.add("users-permissions",{title:s.tval("Users & Permissions",{ns:"users"}),icon:"TeamOutlined"}),this.app.pluginSettingsManager.add("users-permissions.users",{title:s.tval("Users"),icon:"UserOutlined",Component:M,aclSnippet:"pm.users"}),this.app.pm.get(C).rolesManager.add("users",{title:s.tval("Users"),Component:j})})}}t.default=N,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
10
+ (function(r,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("@nocobase/client"),require("@nocobase/utils/client"),require("react/jsx-runtime"),require("react"),require("antd"),require("@formily/react"),require("@formily/core"),require("@emotion/css"),require("@formily/shared"),require("react-i18next"),require("@nocobase/plugin-acl/client")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client","@nocobase/utils/client","react/jsx-runtime","react","antd","@formily/react","@formily/core","@emotion/css","@formily/shared","react-i18next","@nocobase/plugin-acl/client"],e):(r=typeof globalThis!="undefined"?globalThis:r||self,e(r["@nocobase/plugin-users"]={},r["@nocobase/client"],r["@nocobase/utils"],r.jsxRuntime,r.react,r.antd,r["@formily/react"],r["@formily/core"],r["@emotion/css"],r["@formily/shared"],r["react-i18next"],r["@nocobase/plugin-acl"]))})(this,function(r,e,p,a,u,x,v,h,y,b,D,A){"use strict";var W=Object.defineProperty,X=Object.defineProperties;var Y=Object.getOwnPropertyDescriptors;var T=Object.getOwnPropertySymbols;var Z=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable;var k=(r,e,p)=>e in r?W(r,e,{enumerable:!0,configurable:!0,writable:!0,value:p}):r[e]=p,g=(r,e)=>{for(var p in e||(e={}))Z.call(e,p)&&k(r,p,e[p]);if(T)for(var p of T(e))ee.call(e,p)&&k(r,p,e[p]);return r},w=(r,e)=>X(r,Y(e));var f=(r,e,p)=>new Promise((a,u)=>{var x=y=>{try{h(p.next(y))}catch(b){u(b)}},v=y=>{try{h(p.throw(y))}catch(b){u(b)}},h=y=>y.done?a(y.value):Promise.resolve(y.value).then(x,v);h((p=p.apply(r,e)).next())});const P={name:"users",fields:[{name:"id",type:"bigInt",autoIncrement:!0,primaryKey:!0,allowNull:!1,uiSchema:{type:"number",title:'{{t("ID")}}',"x-component":"InputNumber","x-read-pretty":!0},interface:"id"},{interface:"input",type:"string",name:"nickname",uiSchema:{type:"string",title:'{{t("Nickname")}}',"x-component":"Input"}},{interface:"input",type:"string",name:"username",unique:!0,uiSchema:{type:"string",title:'{{t("Username")}}',"x-component":"Input","x-validator":{username:!0},required:!0}},{interface:"email",type:"string",name:"email",unique:!0,uiSchema:{type:"string",title:'{{t("Email")}}',"x-component":"Input","x-validator":"email",required:!0}},{interface:"phone",type:"string",name:"phone",unique:!0,uiSchema:{type:"string",title:'{{t("Phone")}}',"x-component":"Input",required:!0}},{interface:"password",type:"password",name:"password",hidden:!0,uiSchema:{type:"string",title:'{{t("Password")}}',"x-component":"Password"}},{interface:"m2m",type:"belongsToMany",name:"roles",target:"roles",foreignKey:"userId",otherKey:"roleName",onDelete:"CASCADE",sourceKey:"id",targetKey:"name",through:"rolesUsers",uiSchema:{type:"array",title:'{{t("Roles")}}',"x-component":"AssociationField","x-component-props":{multiple:!0,fieldNames:{label:"title",value:"name"}}}}]},I={type:"object",properties:{block1:{type:"void","x-component":"CardItem","x-component-props":{heightMode:"fullHeight"},"x-decorator":"TableBlockProvider","x-decorator-props":{dataSource:"main",rowKey:"id",collection:"users",action:"list",params:{pageSize:20}},"x-use-decorator-props":"useTableBlockDecoratorProps",properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:"var(--nb-spacing)"}},properties:{filter:{type:"void",title:'{{ t("Filter") }}',"x-action":"filter","x-component":"Filter.Action","x-use-component-props":"useFilterActionProps","x-component-props":{icon:"FilterOutlined"},"x-align":"left"},refresh:{type:"void",title:'{{ t("Refresh") }}',"x-action":"refresh","x-component":"Action","x-component-props":{icon:"ReloadOutlined"},"x-use-component-props":"useRefreshActionProps"},delete:{type:"void",title:'{{ t("Delete") }}',"x-component":"Action","x-component-props":{confirm:{title:"{{t('Delete users')}}",content:"{{t('Are you sure you want to delete it?')}}"},icon:"DeleteOutlined"},"x-use-component-props":"useBulkDestroyActionProps"},create:{type:"void",title:'{{t("Add new")}}',"x-component":"Action","x-component-props":{type:"primary",icon:"PlusOutlined"},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"FormV2",title:'{{t("Add user")}}',properties:{nickname:{"x-component":"CollectionField","x-decorator":"FormItem"},username:{"x-component":"CollectionField","x-decorator":"FormItem"},email:{title:'{{t("Email")}}',"x-component":"Input","x-validator":"email","x-decorator":"FormItem",required:!1},phone:{title:'{{t("Phone")}}',"x-component":"Input","x-decorator":"FormItem",required:!1},password:{"x-component":"CollectionField","x-decorator":"FormItem",required:!0},roles:{"x-component":"CollectionField","x-collection-field":"users.roles","x-decorator":"FormItem"},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-use-component-props":"useCancelActionProps"},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary"},"x-use-component-props":"useSubmitActionProps"}}}}}}}}},table:{type:"array","x-uid":"input","x-component":"TableV2","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"}},"x-use-component-props":"useTableBlockProps",properties:{column1:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{nickname:{type:"number","x-component":"CollectionField","x-read-pretty":!0}}},column2:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{username:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},column3:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{email:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},column4:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",title:'{{t("Roles")}}',properties:{roles:{type:"array","x-component":"CollectionField","x-component-props":{mode:"Tag",enableLink:!1,ellipsis:!0},"x-read-pretty":!0,"x-collection-field":"users.roles"}}},column5:{type:"void",title:'{{t("Actions")}}',"x-component":"TableV2.Column","x-decorator":"TableV2.Column.ActionBar",properties:{actions:{type:"void","x-component":"Space","x-component-props":{split:"|"},properties:{update:{type:"void",title:'{{t("Edit profile")}}',"x-decorator":"ACLActionProvider","x-acl-action":"users:update","x-component":"Action.Link","x-component-props":{type:"primary"},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"FormV2","x-use-decorator-props":"useEditFormProps",title:'{{t("Edit profile")}}',properties:{nickname:{"x-component":"CollectionField","x-decorator":"FormItem"},username:{"x-component":"CollectionField","x-decorator":"FormItem"},email:{title:'{{t("Email")}}',"x-component":"Input","x-validator":"email","x-decorator":"FormItem",required:!1},phone:{title:'{{t("Phone")}}',"x-component":"Input","x-decorator":"FormItem",required:!1},roles:{"x-component":"CollectionField","x-decorator":"FormItem","x-collection-field":"users.roles"},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-use-component-props":"useCancelActionProps"},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary"},"x-use-component-props":"useSubmitActionProps"}}}}}}},changePassword:{type:"void",title:'{{t("Change password")}}',"x-decorator":"ACLActionProvider","x-acl-action":"users:update","x-component":"Action.Link","x-component-props":{type:"primary"},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"FormV2","x-use-decorator-props":"useEditFormProps",title:'{{t("Change password")}}',properties:{password:{"x-component":"CollectionField","x-component-props":{component:"PasswordField"},"x-decorator":"FormItem",required:!0},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-use-component-props":"useCancelActionProps"},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary"},"x-use-component-props":"useSubmitActionProps"}}}}}}},delete:{type:"void",title:'{{ t("Delete") }}',"x-acl-action":"users:destroy","x-action":"destroy","x-decorator":"ACLActionProvider","x-component":"Action.Link","x-component-props":{confirm:{title:"{{t('Delete')}}",content:"{{t('Are you sure you want to delete it?')}}"}},"x-use-component-props":"useDestroyActionProps"}}}}}}}}}}},U={type:"object","x-decorator":"UsersSettingsProvider",properties:{usersSettings:{type:"void","x-component":"CardItem","x-decorator":"UsersSettingsProvider",properties:{form:{type:"void","x-component":"FormV2","x-use-component-props":"useFormBlockProps",properties:{enableEditProfile:{type:"string","x-component":"Checkbox","x-decorator":"FormItem",default:!0,"x-content":'{{t("Allow edit profile")}}'},enableChangePassword:{type:"string","x-component":"Checkbox","x-decorator":"FormItem",default:!0,"x-content":'{{t("Allow change password")}}'}}},footer:{type:"void","x-component":"div","x-component-props":{style:{float:"right"}},properties:{submit:{title:"Submit","x-component":"Action","x-use-component-props":"useSubmitActionProps"}}}}}}},q=()=>({type:"void",properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{[b.uid()]:{type:"void",title:'{{ t("Filter") }}',"x-action":"filter","x-component":"Filter.Action","x-use-component-props":"useFilterActionProps","x-component-props":{icon:"FilterOutlined"},"x-align":"left"},actions:{type:"void","x-component":"Space",properties:{remove:{type:"void",title:'{{t("Remove")}}',"x-component":"Action","x-component-props":{icon:"MinusOutlined",confirm:{title:"{{t('Remove')}}",content:"{{t('Are you sure you want to remove these users?')}}"},style:{marginRight:8},useAction:"{{ useBulkRemoveUsers }}"}},create:{type:"void",title:'{{t("Add users")}}',"x-component":"Action","x-component-props":{type:"primary",icon:"PlusOutlined"},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"FormV2",title:'{{t("Add users")}}',properties:{resource:{type:"void","x-decorator":"FormItem","x-component":"RoleUsersProvider",properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{filter:{type:"void",title:'{{ t("Filter") }}',default:{$and:[{username:{$includes:""}},{nickname:{$includes:""}}]},"x-action":"filter","x-component":"Filter.Action","x-use-component-props":"useFilterActionProps","x-component-props":{icon:"FilterOutlined"},"x-align":"left"}}},table:{type:"void","x-component":"Table.Void","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox",onChange:"{{ handleSelectRoleUsers }}"},useDataSource:"{{ cm.useDataSourceFromRAC }}"},properties:{username:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{username:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},nickname:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{nickname:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},phone:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{phone:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},email:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{email:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}}}}}},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{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:"{{ useAddRoleUsers }}"}}}}}}}}}}}},table:{type:"void","x-component":"Table.Void","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"},useDataSource:"{{ cm.useDataSourceFromRAC }}"},properties:{username:{type:"void",title:'{{t("Username")}}',"x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{username:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},nickname:{type:"void",title:'{{t("Nickname")}}',"x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{nickname:{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":{split:"|"},properties:{remove:{type:"void",title:'{{ t("Remove") }}',"x-component":"Action.Link","x-component-props":{confirm:{title:"{{t('Remove user')}}",content:"{{t('Are you sure you want to remove it?')}}"},useAction:"{{ useRemoveUser }}"}}}}}}}}}});function C(){return D.useTranslation(["users","client"],{nsMode:"fallback"})}const V=(t=10)=>{const o="ABCDEFGHIJKLMNOPQRSTUVWXYZ",n="abcdefghijklmnopqrstuvwxyz",s="0123456789",l="!#$%^&*-_+=",m=o+n+s+l,c=new Uint32Array(t);crypto.getRandomValues(c);let d="";d+=o.charAt(c[0]%o.length),d+=n.charAt(c[1]%n.length),d+=s.charAt(c[2]%s.length),d+=l.charAt(c[3]%l.length);for(let i=4;i<t;i++){const F=c[i]%m.length;d+=m.charAt(F)}return d=d[0]+d.slice(1).split("").sort(()=>Math.random()-.5).join(""),d},M=()=>{const{t}=C(),o=v.useField(),[n,s]=u.useState(!1),l=e.useActionContext();return u.useEffect(()=>{l.visible||o.reset()},[o,l.visible]),a.jsxs(x.Row,{gutter:10,children:[a.jsx(x.Col,{span:18,children:a.jsx(e.Password,{checkStrength:!0,visibilityToggle:{visible:n,onVisibleChange:s},value:o.value,onChange:m=>o.setValue(m.target.value),autoComplete:"off"})}),a.jsx(x.Col,{span:4,children:a.jsx(x.Button,{onClick:()=>{o.setValue(V()),s(!0)},children:t("Random password")})})]})},R=()=>{const{setVisible:t}=e.useActionContext();return{type:"default",onClick(){t(!1)}}},B=()=>{const{setVisible:t}=e.useActionContext(),{message:o}=x.App.useApp(),n=v.useForm(),s=e.useDataBlockResource(),{runAsync:l}=e.useDataBlockRequest(),{t:m}=C(),c=e.useCollection();return{type:"primary",onClick(){return f(this,null,function*(){yield n.submit();const i=n.values;i[c.filterTargetKey]?yield s.update({values:i,filterByTk:i[c.filterTargetKey]}):yield s.create({values:i}),yield l(),o.success(m("Saved successfully")),t(!1)})}}},E=()=>{const t=e.useCollectionRecordData();return{form:u.useMemo(()=>h.createForm({initialValues:t}),[t])}},K=()=>{const{t}=C(),o=e.useSchemaComponentContext();return a.jsx(e.SchemaComponentContext.Provider,{value:w(g({},o),{designable:!1}),children:a.jsx(e.SchemaComponent,{schema:I,scope:{t,useCancelActionProps:R,useSubmitActionProps:B,useEditFormProps:E},components:{PasswordField:M}})})},S=u.createContext({}),O=t=>{const o=e.useRequest({url:"systemSettings:get/1"});return a.jsx(S.Provider,{value:o,children:t.children})},j=()=>{const{t}=C(),o=e.useSchemaComponentContext(),n=v.useForm(),s=()=>{var i;const m=u.useContext(S),{enableChangePassword:c,enableEditProfile:d}=((i=m==null?void 0:m.data)==null?void 0:i.data)||{};return u.useEffect(()=>{n==null||n.setValues({enableChangePassword:c!==!1,enableEditProfile:d!==!1})},[m]),{form:n}},l=()=>{const m=e.useAPIClient(),c=v.useForm();return{type:"primary",onClick(){return f(this,null,function*(){yield c.submit();const i=c.values;yield m.request({url:"systemSettings:update/1",data:i,method:"POST"}),x.message.success(t("Saved successfully")),window.location.reload()})}}};return a.jsx(e.SchemaComponentContext.Provider,{value:w(g({},o),{designable:!1}),children:a.jsx(e.SchemaComponent,{schema:U,scope:{t,useFormBlockProps:s,useSubmitActionProps:l},components:{UsersSettingsProvider:O}})})},N=()=>{const{t}=C();return a.jsx(x.Tabs,{defaultActiveKey:"usersManager",type:"card",className:y.css`
11
+ .ant-tabs-nav {
12
+ margin-bottom: 0px;
13
+ }
14
+ `,items:[{label:t("Users manager"),key:"usersManager",children:a.jsx(K,{})},{label:t("Settings"),key:"usersSettings",children:a.jsx(j,{})}]})},L=()=>{var s,l;const t=u.useContext(e.CollectionContext),o=e.useFilterFieldOptions(t.fields),n=e.useResourceActionContext();return e.useFilterFieldProps({options:o,params:((l=(s=n.state)==null?void 0:s.params)==null?void 0:l[0])||n.params,service:n})},_=()=>{const t=e.useAPIClient(),{role:o}=u.useContext(A.RolesManagerContext),n=e.useRecord(),{refresh:s}=e.useResourceActionContext();return{run(){return f(this,null,function*(){yield t.resource("roles.users",o==null?void 0:o.name).remove({values:[n.id]}),s()})}}},z=()=>{const{t}=C(),{message:o}=x.App.useApp(),n=e.useAPIClient(),{state:s,setState:l,refresh:m}=e.useResourceActionContext(),{role:c}=u.useContext(A.RolesManagerContext);return{run(){return f(this,null,function*(){const i=s==null?void 0:s.selectedRowKeys;if(!(i!=null&&i.length)){o.warning(t("Please select users"));return}yield n.resource("roles.users",c==null?void 0:c.name).remove({values:i}),l==null||l({selectedRowKeys:[]}),m()})}}},H=t=>{const{role:o}=u.useContext(A.RolesManagerContext);return a.jsx(e.ResourceActionProvider,{collection:P,request:{resource:"users",action:"listExcludeRole",params:{roleName:o==null?void 0:o.name}},children:t.children})},$=()=>{const{t}=C(),{role:o}=u.useContext(A.RolesManagerContext),n=e.useRequest({resource:"roles.users",resourceOf:o==null?void 0:o.name,action:"list"},{ready:!!o});u.useEffect(()=>{n.run()},[o]);const s=u.useRef([]),l=(d,i)=>{s.current=i},m=()=>{const{role:d}=u.useContext(A.RolesManagerContext),i=e.useAPIClient(),{setVisible:F}=e.useActionContext(),{refresh:J}=e.useResourceActionContext();return{run(){return f(this,null,function*(){yield i.resource("roles.users",d==null?void 0:d.name).add({values:s.current.map(Q=>Q.id)}),s.current=[],F(!1),J()})}}},c=u.useMemo(()=>q(),[o]);return a.jsx(e.ResourceActionContext.Provider,{value:g({},n),children:a.jsx(e.CollectionProvider_deprecated,{collection:P,children:a.jsx(e.SchemaComponent,{schema:c,components:{RoleUsersProvider:H},scope:{useBulkRemoveUsers:z,useRemoveUser:_,handleSelectRoleUsers:l,useAddRoleUsers:m,useFilterActionProps:L,t}})})})};class G extends e.Plugin{load(){return f(this,null,function*(){this.app.pluginSettingsManager.add("users-permissions",{title:p.tval("Users & Permissions",{ns:"users"}),icon:"TeamOutlined"}),this.app.pluginSettingsManager.add("users-permissions.users",{title:p.tval("Users"),icon:"UserOutlined",Component:N,aclSnippet:"pm.users"}),this.app.pm.get(A).rolesManager.add("users",{title:p.tval("Users"),Component:$})})}}r.default=G,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -195,4 +195,5 @@ export declare const userCollection: {
195
195
  })[];
196
196
  };
197
197
  export declare const usersSchema: ISchema;
198
+ export declare const usersSettingsSchema: ISchema;
198
199
  export declare const getRoleUsersSchema: () => ISchema;
@@ -10,16 +10,17 @@
10
10
  module.exports = {
11
11
  "react": "18.2.0",
12
12
  "antd": "5.12.8",
13
- "@nocobase/client": "1.3.39-beta",
13
+ "@nocobase/client": "1.4.0-alpha",
14
14
  "@formily/react": "2.3.0",
15
15
  "@formily/core": "2.3.0",
16
- "@nocobase/plugin-acl": "1.3.39-beta",
17
- "@nocobase/utils": "1.3.39-beta",
16
+ "@nocobase/plugin-acl": "1.4.0-alpha",
17
+ "@emotion/css": "11.13.0",
18
+ "@nocobase/utils": "1.4.0-alpha",
18
19
  "react-i18next": "11.18.6",
19
- "@nocobase/database": "1.3.39-beta",
20
- "@nocobase/server": "1.3.39-beta",
21
- "@nocobase/cache": "1.3.39-beta",
20
+ "@nocobase/database": "1.4.0-alpha",
21
+ "@nocobase/server": "1.4.0-alpha",
22
+ "@nocobase/plugin-user-data-sync": "1.4.0-alpha",
23
+ "lodash": "4.17.21",
22
24
  "@formily/shared": "2.3.0",
23
- "@nocobase/actions": "1.3.39-beta",
24
- "lodash": "4.17.21"
25
+ "@nocobase/actions": "1.4.0-alpha"
25
26
  };
@@ -3,5 +3,8 @@
3
3
  "Add users": "添加用户",
4
4
  "Remove user": "移除用户",
5
5
  "Are you sure you want to remove it?": "你确定要移除吗?",
6
- "Random password": "随机密码"
6
+ "Random password": "随机密码",
7
+ "Users manager": "用户管理",
8
+ "Allow edit profile": "允许修改个人资料",
9
+ "Allow change password": "允许修改密码"
7
10
  }
@@ -7,7 +7,8 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  declare const _default: {
10
- 'Please fill in your email address': string;
11
- 'The password is incorrect, please re-enter': string;
10
+ collectionOptions: import("@nocobase/database").CollectionOptions;
11
+ mergeOptions: import("deepmerge").Options;
12
+ extend: boolean;
12
13
  };
13
14
  export default _default;
@@ -24,16 +24,36 @@ var __copyProps = (to, from, except, desc) => {
24
24
  return to;
25
25
  };
26
26
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
- var en_US_exports = {};
28
- __export(en_US_exports, {
29
- default: () => en_US_default
27
+ var systemSettings_exports = {};
28
+ __export(systemSettings_exports, {
29
+ default: () => systemSettings_default
30
+ });
31
+ module.exports = __toCommonJS(systemSettings_exports);
32
+ var import_database = require("@nocobase/database");
33
+ var systemSettings_default = (0, import_database.extendCollection)({
34
+ name: "systemSettings",
35
+ fields: [
36
+ {
37
+ interface: "checkbox",
38
+ type: "boolean",
39
+ name: "enableEditProfile",
40
+ uiSchema: {
41
+ type: "boolean",
42
+ "x-component": "Checkbox",
43
+ title: '{{t("Allow edit profile")}}',
44
+ default: true
45
+ }
46
+ },
47
+ {
48
+ interface: "checkbox",
49
+ type: "boolean",
50
+ name: "enableChangePassword",
51
+ uiSchema: {
52
+ type: "boolean",
53
+ "x-component": "Checkbox",
54
+ title: '{{t("Allow Change Password")}}',
55
+ default: true
56
+ }
57
+ }
58
+ ]
30
59
  });
31
- module.exports = __toCommonJS(en_US_exports);
32
- var en_US_default = {
33
- "The email is incorrect, please re-enter": "The email is incorrect, please re-enter",
34
- "Please fill in your email address": "Please fill in your email address",
35
- "The password is incorrect, please re-enter": "The password is incorrect, please re-enter",
36
- "Not a valid cellphone number, please re-enter": "Not a valid cellphone number, please re-enter",
37
- "The phone number has been registered, please login directly": "The phone number has been registered, please login directly",
38
- "The phone number is not registered, please register first": "The phone number is not registered, please register first"
39
- };
@@ -112,6 +112,10 @@ var users_default = (0, import_database.defineCollection)({
112
112
  "x-component": "Password"
113
113
  }
114
114
  },
115
+ {
116
+ name: "passwordChangeTz",
117
+ type: "bigInt"
118
+ },
115
119
  {
116
120
  type: "string",
117
121
  name: "appLang"
@@ -0,0 +1,8 @@
1
+ {
2
+ "The email is incorrect, please re-enter": "The email is incorrect, please re-enter",
3
+ "Please fill in your email address": "Please fill in your email address",
4
+ "The password is incorrect, please re-enter": "The password is incorrect, please re-enter",
5
+ "Not a valid cellphone number, please re-enter": "Not a valid cellphone number, please re-enter",
6
+ "The phone number has been registered, please login directly": "The phone number has been registered, please login directly",
7
+ "The phone number is not registered, please register first": "The phone number is not registered, please register first"
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "The email is incorrect, please re-enter": "El correo electrónico es incorrecto, por favor vuelva a introducirlo",
3
+ "Please fill in your email address": "Por favor, introduzca su dirección de correo electrónico",
4
+ "The password is incorrect, please re-enter": "La contraseña es incorrecta, por favor, vuelva a introducirla",
5
+ "Not a valid cellphone number, please re-enter": "No es un número de móvil válido, por favor, vuelva a introducirlo",
6
+ "The phone number has been registered, please login directly": "El número de teléfono ha sido registrado, por favor, inicie sesión directamente",
7
+ "The phone number is not registered, please register first": "El número de teléfono no está registrado, por favor regístrese primero"
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "The email is incorrect, please re-enter": "L'adresse e-mail est incorrecte, veuillez la saisir à nouveau",
3
+ "Please fill in your email address": "Veuillez remplir votre adresse e-mail",
4
+ "The password is incorrect, please re-enter": "Le mot de passe est incorrect, veuillez le saisir à nouveau",
5
+ "Not a valid cellphone number, please re-enter": "Numéro de téléphone portable invalide, veuillez le saisir à nouveau",
6
+ "The phone number has been registered, please login directly": "Le numéro de téléphone a été enregistré, veuillez vous connecter directement",
7
+ "The phone number is not registered, please register first": "Le numéro de téléphone n'est pas enregistré, veuillez vous inscrire d'abord"
8
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "Please fill in your email address": "メールアドレスを入力してください",
3
+ "The password is incorrect, please re-enter": "パスワードが正しくありません。再度入力してください。"
4
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "The email is incorrect, please re-enter": "O e-mail está incorreto, por favor, digite novamente",
3
+ "Please fill in your email address": "Por favor, preencha o seu endereço de e-mail",
4
+ "The password is incorrect, please re-enter": "A senha está incorreta, por favor, digite novamente",
5
+ "Not a valid cellphone number, please re-enter": "Número de celular inválido, por favor, digite novamente",
6
+ "The phone number has been registered, please login directly": "O número de celular já está registrado, por favor, faça login diretamente",
7
+ "The phone number is not registered, please register first": "O número de celular não está registrado, por favor, registre-se primeiro"
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "The email is incorrect, please re-enter": "邮箱有误,请重新输入",
3
+ "Please fill in your email address": "请填写邮箱",
4
+ "The password is incorrect, please re-enter": "密码有误,请重新输入",
5
+ "Not a valid cellphone number, please re-enter": "不是有效的手机号,请重新输入",
6
+ "The phone number has been registered, please login directly": "手机号已注册,请直接登录",
7
+ "The phone number is not registered, please register first": "手机号未注册,请先注册"
8
+ }
@@ -42,9 +42,9 @@ module.exports = __toCommonJS(server_exports);
42
42
  var import_database = require("@nocobase/database");
43
43
  var import_server = require("@nocobase/server");
44
44
  var import_utils = require("@nocobase/utils");
45
- var import_path = require("path");
46
45
  var actions = __toESM(require("./actions/users"));
47
46
  var import_UserModel = require("./models/UserModel");
47
+ var import_user_data_sync_resource = require("./user-data-sync-resource");
48
48
  class PluginUsersServer extends import_server.Plugin {
49
49
  async beforeLoad() {
50
50
  this.db.registerModels({
@@ -177,23 +177,24 @@ class PluginUsersServer extends import_server.Plugin {
177
177
  });
178
178
  }
179
179
  async load() {
180
- await this.importCollections((0, import_path.resolve)(__dirname, "collections"));
181
- this.db.addMigrations({
182
- namespace: "users",
183
- directory: (0, import_path.resolve)(__dirname, "migrations"),
184
- context: {
185
- plugin: this
186
- }
187
- });
188
- this.app.resourcer.use(async (ctx, next) => {
180
+ this.app.resourceManager.use(async (ctx, next) => {
189
181
  await next();
190
182
  const { associatedName, resourceName, actionName, values } = ctx.action.params;
191
- const cache = ctx.app.cache;
192
183
  if (associatedName === "roles" && resourceName === "users" && ["add", "remove", "set"].includes(actionName) && (values == null ? void 0 : values.length)) {
193
- for (const userId of values) {
194
- await cache.del(`roles:${userId}`);
195
- }
184
+ await Promise.all(values.map((userId) => this.app.emitAsync("cache:del:roles", { userId })));
185
+ }
186
+ });
187
+ const userDataSyncPlugin = this.app.pm.get("user-data-sync");
188
+ if (userDataSyncPlugin && userDataSyncPlugin.enabled) {
189
+ userDataSyncPlugin.resourceManager.registerResource(new import_user_data_sync_resource.UserDataSyncResource(this.db, this.app.logger));
190
+ }
191
+ this.app.db.on("users.beforeUpdate", async (model) => {
192
+ if (!model._changed.has("password")) {
193
+ return;
196
194
  }
195
+ model.set("passwordChangeTz", Date.now());
196
+ await this.app.emitAsync("cache:del:roles", { userId: model.get("id") });
197
+ await this.app.emitAsync("cache:del:auth", { userId: model.get("id") });
197
198
  });
198
199
  }
199
200
  getInstallingData(options = {}) {
@@ -0,0 +1,20 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { Model } from '@nocobase/database';
10
+ import lodash from 'lodash';
11
+ import { FormatUser, OriginRecord, PrimaryKey, RecordResourceChanged, SyncAccept, UserDataResource } from '@nocobase/plugin-user-data-sync';
12
+ export declare class UserDataSyncResource extends UserDataResource {
13
+ name: string;
14
+ accepts: SyncAccept[];
15
+ get userRepo(): import("@nocobase/database").Repository<any, any>;
16
+ getFlteredSourceUser(sourceUser: FormatUser): lodash.Omit<FormatUser, string>;
17
+ updateUser(user: Model, sourceUser: FormatUser): Promise<void>;
18
+ update(record: OriginRecord, resourcePks: PrimaryKey[], matchKey: string): Promise<RecordResourceChanged[]>;
19
+ create(record: OriginRecord, matchKey: string): Promise<RecordResourceChanged[]>;
20
+ }
@@ -0,0 +1,128 @@
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 __create = Object.create;
11
+ var __defProp = Object.defineProperty;
12
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
13
+ var __getOwnPropNames = Object.getOwnPropertyNames;
14
+ var __getProtoOf = Object.getPrototypeOf;
15
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
16
+ var __export = (target, all) => {
17
+ for (var name in all)
18
+ __defProp(target, name, { get: all[name], enumerable: true });
19
+ };
20
+ var __copyProps = (to, from, except, desc) => {
21
+ if (from && typeof from === "object" || typeof from === "function") {
22
+ for (let key of __getOwnPropNames(from))
23
+ if (!__hasOwnProp.call(to, key) && key !== except)
24
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
25
+ }
26
+ return to;
27
+ };
28
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
29
+ // If the importer is in node compatibility mode or this is not an ESM
30
+ // file that has been converted to a CommonJS file using a Babel-
31
+ // compatible transform (i.e. "__esModule" has not been set), then set
32
+ // "default" to the CommonJS "module.exports" for node compatibility.
33
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
34
+ mod
35
+ ));
36
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
+ var user_data_sync_resource_exports = {};
38
+ __export(user_data_sync_resource_exports, {
39
+ UserDataSyncResource: () => UserDataSyncResource
40
+ });
41
+ module.exports = __toCommonJS(user_data_sync_resource_exports);
42
+ var import_lodash = __toESM(require("lodash"));
43
+ var import_plugin_user_data_sync = require("@nocobase/plugin-user-data-sync");
44
+ class UserDataSyncResource extends import_plugin_user_data_sync.UserDataResource {
45
+ name = "users";
46
+ accepts = ["user"];
47
+ get userRepo() {
48
+ return this.db.getRepository("users");
49
+ }
50
+ getFlteredSourceUser(sourceUser) {
51
+ const deleteProps = [
52
+ "id",
53
+ "uid",
54
+ "createdAt",
55
+ "updatedAt",
56
+ "appLang",
57
+ "resetToken",
58
+ "systemSettings",
59
+ "password",
60
+ "sort",
61
+ "createdById",
62
+ "updatedById",
63
+ "isDeleted",
64
+ "departments"
65
+ ];
66
+ return import_lodash.default.omit(sourceUser, deleteProps);
67
+ }
68
+ async updateUser(user, sourceUser) {
69
+ if (sourceUser.isDeleted) {
70
+ const roles = await user.getRoles();
71
+ for (const role of roles) {
72
+ if (role.name === "root") {
73
+ return;
74
+ }
75
+ }
76
+ await user.destroy();
77
+ return;
78
+ }
79
+ let dataChanged = false;
80
+ const filteredSourceUser = this.getFlteredSourceUser(sourceUser);
81
+ import_lodash.default.forOwn(filteredSourceUser, (value, key) => {
82
+ if (user[key] !== value) {
83
+ user[key] = value;
84
+ dataChanged = true;
85
+ }
86
+ });
87
+ if (dataChanged) {
88
+ await user.save();
89
+ }
90
+ }
91
+ async update(record, resourcePks, matchKey) {
92
+ const { metaData: sourceUser } = record;
93
+ const resourcePk = resourcePks[0];
94
+ const user = await this.userRepo.findOne({
95
+ filterByTk: resourcePk
96
+ });
97
+ if (!user) {
98
+ const result = await this.create(record, matchKey);
99
+ return [...result, { resourcesPk: resourcePk, isDeleted: true }];
100
+ }
101
+ await this.updateUser(user, sourceUser);
102
+ return [];
103
+ }
104
+ async create(record, matchKey) {
105
+ const { metaData: sourceUser } = record;
106
+ const filter = {};
107
+ let user;
108
+ if (["phone", "email", "username"].includes(matchKey)) {
109
+ filter[matchKey] = sourceUser[matchKey];
110
+ user = await this.userRepo.findOne({
111
+ filter
112
+ });
113
+ }
114
+ if (user) {
115
+ await this.updateUser(user, sourceUser);
116
+ } else {
117
+ const filteredSourceUser = this.getFlteredSourceUser(sourceUser);
118
+ user = await this.userRepo.create({
119
+ values: filteredSourceUser
120
+ });
121
+ }
122
+ return [{ resourcesPk: user.id, isDeleted: false }];
123
+ }
124
+ }
125
+ // Annotate the CommonJS export names for ESM import in node:
126
+ 0 && (module.exports = {
127
+ UserDataSyncResource
128
+ });
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "displayName.zh-CN": "用户",
5
5
  "description": "Provides basic user model, as well as created by and updated by fields.",
6
6
  "description.zh-CN": "提供了基础的用户模型,以及创建人和最后更新人字段。",
7
- "version": "1.3.39-beta",
7
+ "version": "1.4.0-alpha",
8
8
  "license": "AGPL-3.0",
9
9
  "main": "./dist/server/index.js",
10
10
  "homepage": "https://docs.nocobase.com/handbook/users",
@@ -19,12 +19,13 @@
19
19
  "@nocobase/database": "1.x",
20
20
  "@nocobase/plugin-acl": "1.x",
21
21
  "@nocobase/plugin-auth": "1.x",
22
+ "@nocobase/plugin-user-data-sync": "1.x",
22
23
  "@nocobase/resourcer": "1.x",
23
24
  "@nocobase/server": "1.x",
24
25
  "@nocobase/test": "1.x",
25
26
  "@nocobase/utils": "1.x"
26
27
  },
27
- "gitHead": "68daadf8575cddf9eeb09a1a672f9baf7aabe67a",
28
+ "gitHead": "f097a2bddec152522b5645bd5d451f4c866d2060",
28
29
  "keywords": [
29
30
  "Users & permissions"
30
31
  ]
@@ -1,17 +0,0 @@
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
- 'The email is incorrect, please re-enter': string;
11
- 'Please fill in your email address': string;
12
- 'The password is incorrect, please re-enter': string;
13
- 'Not a valid cellphone number, please re-enter': string;
14
- 'The phone number has been registered, please login directly': string;
15
- 'The phone number is not registered, please register first': string;
16
- };
17
- export default _default;
@@ -1,17 +0,0 @@
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
- "The email is incorrect, please re-enter": string;
11
- "Please fill in your email address": string;
12
- "The password is incorrect, please re-enter": string;
13
- "Not a valid cellphone number, please re-enter": string;
14
- "The phone number has been registered, please login directly": string;
15
- "The phone number is not registered, please register first": string;
16
- };
17
- export default _default;
@@ -1,39 +0,0 @@
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 es_ES_exports = {};
28
- __export(es_ES_exports, {
29
- default: () => es_ES_default
30
- });
31
- module.exports = __toCommonJS(es_ES_exports);
32
- var es_ES_default = {
33
- "The email is incorrect, please re-enter": "El correo electr\xF3nico es incorrecto, por favor vuelva a introducirlo",
34
- "Please fill in your email address": "Por favor, introduzca su direcci\xF3n de correo electr\xF3nico",
35
- "The password is incorrect, please re-enter": "La contrase\xF1a es incorrecta, por favor, vuelva a introducirla",
36
- "Not a valid cellphone number, please re-enter": "No es un n\xFAmero de m\xF3vil v\xE1lido, por favor, vuelva a introducirlo",
37
- "The phone number has been registered, please login directly": "El n\xFAmero de tel\xE9fono ha sido registrado, por favor, inicie sesi\xF3n directamente",
38
- "The phone number is not registered, please register first": "El n\xFAmero de tel\xE9fono no est\xE1 registrado, por favor reg\xEDstrese primero"
39
- };
@@ -1,17 +0,0 @@
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
- 'The email is incorrect, please re-enter': string;
11
- 'Please fill in your email address': string;
12
- 'The password is incorrect, please re-enter': string;
13
- 'Not a valid cellphone number, please re-enter': string;
14
- 'The phone number has been registered, please login directly': string;
15
- 'The phone number is not registered, please register first': string;
16
- };
17
- export default _default;
@@ -1,39 +0,0 @@
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 fr_FR_exports = {};
28
- __export(fr_FR_exports, {
29
- default: () => fr_FR_default
30
- });
31
- module.exports = __toCommonJS(fr_FR_exports);
32
- var fr_FR_default = {
33
- "The email is incorrect, please re-enter": "L'adresse e-mail est incorrecte, veuillez la saisir \xE0 nouveau",
34
- "Please fill in your email address": "Veuillez remplir votre adresse e-mail",
35
- "The password is incorrect, please re-enter": "Le mot de passe est incorrect, veuillez le saisir \xE0 nouveau",
36
- "Not a valid cellphone number, please re-enter": "Num\xE9ro de t\xE9l\xE9phone portable invalide, veuillez le saisir \xE0 nouveau",
37
- "The phone number has been registered, please login directly": "Le num\xE9ro de t\xE9l\xE9phone a \xE9t\xE9 enregistr\xE9, veuillez vous connecter directement",
38
- "The phone number is not registered, please register first": "Le num\xE9ro de t\xE9l\xE9phone n'est pas enregistr\xE9, veuillez vous inscrire d'abord"
39
- };
@@ -1,11 +0,0 @@
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
- export { default as enUS } from './en-US';
10
- export { default as zhCN } from './zh-CN';
11
- export { default as ptBR } from './pt-BR';
@@ -1,52 +0,0 @@
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 __create = Object.create;
11
- var __defProp = Object.defineProperty;
12
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
13
- var __getOwnPropNames = Object.getOwnPropertyNames;
14
- var __getProtoOf = Object.getPrototypeOf;
15
- var __hasOwnProp = Object.prototype.hasOwnProperty;
16
- var __export = (target, all) => {
17
- for (var name in all)
18
- __defProp(target, name, { get: all[name], enumerable: true });
19
- };
20
- var __copyProps = (to, from, except, desc) => {
21
- if (from && typeof from === "object" || typeof from === "function") {
22
- for (let key of __getOwnPropNames(from))
23
- if (!__hasOwnProp.call(to, key) && key !== except)
24
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
25
- }
26
- return to;
27
- };
28
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
29
- // If the importer is in node compatibility mode or this is not an ESM
30
- // file that has been converted to a CommonJS file using a Babel-
31
- // compatible transform (i.e. "__esModule" has not been set), then set
32
- // "default" to the CommonJS "module.exports" for node compatibility.
33
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
34
- mod
35
- ));
36
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
- var locale_exports = {};
38
- __export(locale_exports, {
39
- enUS: () => import_en_US.default,
40
- ptBR: () => import_pt_BR.default,
41
- zhCN: () => import_zh_CN.default
42
- });
43
- module.exports = __toCommonJS(locale_exports);
44
- var import_en_US = __toESM(require("./en-US"));
45
- var import_zh_CN = __toESM(require("./zh-CN"));
46
- var import_pt_BR = __toESM(require("./pt-BR"));
47
- // Annotate the CommonJS export names for ESM import in node:
48
- 0 && (module.exports = {
49
- enUS,
50
- ptBR,
51
- zhCN
52
- });
@@ -1,35 +0,0 @@
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 ja_JP_exports = {};
28
- __export(ja_JP_exports, {
29
- default: () => ja_JP_default
30
- });
31
- module.exports = __toCommonJS(ja_JP_exports);
32
- var ja_JP_default = {
33
- "Please fill in your email address": "\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
34
- "The password is incorrect, please re-enter": "\u30D1\u30B9\u30EF\u30FC\u30C9\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093\u3002\u518D\u5EA6\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002"
35
- };
@@ -1,17 +0,0 @@
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
- 'The email is incorrect, please re-enter': string;
11
- 'Please fill in your email address': string;
12
- 'The password is incorrect, please re-enter': string;
13
- 'Not a valid cellphone number, please re-enter': string;
14
- 'The phone number has been registered, please login directly': string;
15
- 'The phone number is not registered, please register first': string;
16
- };
17
- export default _default;
@@ -1,39 +0,0 @@
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 pt_BR_exports = {};
28
- __export(pt_BR_exports, {
29
- default: () => pt_BR_default
30
- });
31
- module.exports = __toCommonJS(pt_BR_exports);
32
- var pt_BR_default = {
33
- "The email is incorrect, please re-enter": "O e-mail est\xE1 incorreto, por favor, digite novamente",
34
- "Please fill in your email address": "Por favor, preencha o seu endere\xE7o de e-mail",
35
- "The password is incorrect, please re-enter": "A senha est\xE1 incorreta, por favor, digite novamente",
36
- "Not a valid cellphone number, please re-enter": "N\xFAmero de celular inv\xE1lido, por favor, digite novamente",
37
- "The phone number has been registered, please login directly": "O n\xFAmero de celular j\xE1 est\xE1 registrado, por favor, fa\xE7a login diretamente",
38
- "The phone number is not registered, please register first": "O n\xFAmero de celular n\xE3o est\xE1 registrado, por favor, registre-se primeiro"
39
- };
@@ -1,17 +0,0 @@
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
- 'The email is incorrect, please re-enter': string;
11
- 'Please fill in your email address': string;
12
- 'The password is incorrect, please re-enter': string;
13
- 'Not a valid cellphone number, please re-enter': string;
14
- 'The phone number has been registered, please login directly': string;
15
- 'The phone number is not registered, please register first': string;
16
- };
17
- export default _default;
@@ -1,39 +0,0 @@
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 zh_CN_exports = {};
28
- __export(zh_CN_exports, {
29
- default: () => zh_CN_default
30
- });
31
- module.exports = __toCommonJS(zh_CN_exports);
32
- var zh_CN_default = {
33
- "The email is incorrect, please re-enter": "\u90AE\u7BB1\u6709\u8BEF\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165",
34
- "Please fill in your email address": "\u8BF7\u586B\u5199\u90AE\u7BB1",
35
- "The password is incorrect, please re-enter": "\u5BC6\u7801\u6709\u8BEF\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165",
36
- "Not a valid cellphone number, please re-enter": "\u4E0D\u662F\u6709\u6548\u7684\u624B\u673A\u53F7\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165",
37
- "The phone number has been registered, please login directly": "\u624B\u673A\u53F7\u5DF2\u6CE8\u518C\uFF0C\u8BF7\u76F4\u63A5\u767B\u5F55",
38
- "The phone number is not registered, please register first": "\u624B\u673A\u53F7\u672A\u6CE8\u518C\uFF0C\u8BF7\u5148\u6CE8\u518C"
39
- };
File without changes