Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@nocobase/plugin-users

Package Overview
Dependencies
Maintainers
2
Versions
1064
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nocobase/plugin-users - npm Package Compare versions

Comparing version
2.1.0-beta.35
to
2.1.0-beta.36
+28
dist/client-v2/user-center/ChangePasswordItemModel.d.ts
/**
* This file is part of the NocoBase (R) project.
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
* Authors: NocoBase Team.
*
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
* For more information, please refer to: https://www.nocobase.com/agreement.
*/
import { UserCenterActionItemModel } from '@nocobase/client-v2';
/**
* "Change password" entry in the User Center dropdown. Section `profile`
* with sort 100 puts it between `CurrentUserSummaryItemModel` (sort 0)
* and `SignOutItemModel` (sort 1000) — same neighborhood as v1.
*
* `prepare()` reads `systemSettings.enableChangePassword`; when the
* admin has explicitly disabled it, `ready = false` removes the entry
* from the dropdown. Undefined / true both leave the entry visible
* (matches v1: only an explicit `=== false` hides it).
*/
export declare class ChangePasswordItemModel extends UserCenterActionItemModel {
static itemId: string;
section: "profile";
sort: number;
label: string;
prepare(): Promise<void>;
onClick(): Promise<void>;
}
export default ChangePasswordItemModel;
+1
-1

@@ -10,2 +10,2 @@ /**

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("@nocobase/client-v2")):"function"==typeof define&&define.amd?define("@nocobase/plugin-users/client-v2",["react-i18next","@nocobase/client-v2"],t):"object"==typeof exports?exports["@nocobase/plugin-users/client-v2"]=t(require("react-i18next"),require("@nocobase/client-v2")):e["@nocobase/plugin-users/client-v2"]=t(e["react-i18next"],e["@nocobase/client-v2"])}(self,function(e,t){return function(){"use strict";var r={485:function(e){e.exports=t},953:function(t){t.exports=e}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.d=function(e,t){for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.g.importScripts&&(i=o.g.location+"");var i,u=o.g.document;if(!i&&u&&(u.currentScript&&"SCRIPT"===u.currentScript.tagName.toUpperCase()&&(i=u.currentScript.src),!i)){var a=u.getElementsByTagName("script");if(a.length)for(var c=a.length-1;c>-1&&(!i||!/^http(s?):/.test(i));)i=a[c--].src}if(!i)throw Error("Automatic publicPath is not supported in this browser");o.p=i.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var l={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src&&(e=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/@nocobase/plugin-users/dist/client-v2/")}if(!e){if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var n=window.location.pathname||"/",i=n.indexOf("/v2/");e=i>=0?n.slice(0,i+1):"/"}e&&(e=e.replace(/\/v2\/?$/,"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-users/dist/client-v2/"}o.p=e}(),!function(){o.r(l),o.d(l,{PluginUsersClientV2:function(){return _},NAMESPACE:function(){return i},default:function(){return P},useUsersTranslation:function(){return a},usersLocaleResources:function(){return u}});var e=o(485),t=o(953),r=JSON.parse('{"Add user":"Add user","Add users":"Add users","Allow change password":"Allow change password","Allow edit profile":"Allow edit profile","Are you sure you want to remove it?":"Are you sure you want to remove it?","Random password":"Random password","Remove user":"Remove user","User profile is not allowed to be edited":"User profile is not allowed to be edited","Users & Permissions":"Users & Permissions","Users manager":"Users manager"}'),n=JSON.parse('{"Add user":"添加用户","Add users":"添加用户","Allow change password":"允许修改密码","Allow edit profile":"允许修改个人资料","Are you sure you want to remove it?":"你确定要移除吗?","Random password":"随机密码","Remove user":"移除用户","User profile is not allowed to be edited":"用户资料不允许修改","Users & Permissions":"用户和权限","Users manager":"用户管理"}'),i="users",u={"en-US":r,"zh-CN":n};function a(){return(0,t.useTranslation)([i,"client"],{nsMode:"fallback"})}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function s(e,t,r,n,o,i,u){try{var a=e[i](u),c=a.value}catch(e){r(e);return}a.done?t(c):Promise.resolve(c).then(n,o)}function f(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function u(e){s(i,n,o,u,a,"next",e)}function a(e){s(i,n,o,u,a,"throw",e)}u(void 0)})}}function p(e,t,r){return t=m(t),function(e,t){var r;if(t&&("object"==((r=t)&&"u">typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e,O()?Reflect.construct(t,r||[],m(e).constructor):t.apply(e,r))}function d(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function b(e,t,r){return(b=O()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&w(o,r.prototype),o}).apply(null,arguments)}function y(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function h(e,t,r){return t&&y(e.prototype,t),r&&y(e,r),e}function v(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&w(e,t)}function w(e,t){return(w=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function S(e){var t="function"==typeof Map?new Map:void 0;return(S=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return b(e,arguments,m(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),w(r,e)})(e)}function O(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(O=function(){return!!e})()}function x(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(u,"next",{value:c(0)}),a(u,"throw",{value:c(1)}),a(u,"return",{value:c(2)}),"function"==typeof Symbol&&a(u,Symbol.iterator,{value:function(){return this}}),u;function c(a){return function(c){var l=[a,c];if(r)throw TypeError("Generator is already executing.");for(;u&&(u=0,l[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&l[0]?n.return:l[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;switch(n=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,n=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],n=0}finally{r=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}var A=function(e){function t(){var e;return d(this,t),e=p(this,t,arguments),v(e,"section","profile"),v(e,"sort",0),e}return g(t,e),h(t,[{key:"prepare",value:function(){return f(function(){var e;return x(this,function(t){return e=this.context.user||{},this.label=e.nickname||e.username||e.email||"",this.value=void 0,this.description=void 0,this.ready=!!this.label,[2]})}).call(this)}}]),t}(e.UserCenterTextItemModel);v(A,"itemId","current-user-summary");var j=function(t){function r(){var e;return d(this,r),e=p(this,r,arguments),v(e,"section","danger"),v(e,"sort",1e3),v(e,"label","Sign out"),e}return g(r,t),h(r,[{key:"onClick",value:function(){return f(function(){var t,r,n,o;return x(this,function(i){switch(i.label){case 0:return[4,this.context.api.auth.signOut()];case 1:if(n=i.sent(),o=(0,e.resolveV2SigninRedirect)(null==n||null==(r=n.data)||null==(t=r.data)?void 0:t.redirect,this.context.app))return window.location.replace(o),[2];return(0,e.redirectToV2Signin)(this.context.app,(0,e.getCurrentV2RedirectPath)(this.context.app,window.location),{replace:!0}),[2]}})}).call(this)}}]),r}(e.UserCenterActionItemModel);v(j,"itemId","sign-out");var _=function(e){function t(){return d(this,t),p(this,t,arguments)}return g(t,e),h(t,[{key:"load",value:function(){return f(function(){var e;return x(this,function(t){return e=this,Object.entries(u).forEach(function(t){var r,n=function(e){if(Array.isArray(e))return e}(t)||function(e){var t,r,n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o=[],i=!0,u=!1;try{for(n=n.call(e);!(i=(t=n.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){u=!0,r=e}finally{try{i||null==n.return||n.return()}finally{if(u)throw r}}return o}}(t)||function(e){if(e){if("string"==typeof e)return c(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return c(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=n[0],i=n[1];e.app.i18n.addResources(o,(null==(r=e.options)?void 0:r.packageName)||"@nocobase/plugin-users",i)}),this.app.flowEngine.registerModels({CurrentUserSummaryItemModel:A,SignOutItemModel:j}),[2]})}).call(this)}}]),t}(S(e.Plugin)),P=_}(),l}()});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("ahooks"),require("react-i18next"),require("@nocobase/client-v2"),require("react-router-dom"),require("react"),require("antd"),require("@nocobase/flow-engine")):"function"==typeof define&&define.amd?define("@nocobase/plugin-users/client-v2",["ahooks","react-i18next","@nocobase/client-v2","react-router-dom","react","antd","@nocobase/flow-engine"],t):"object"==typeof exports?exports["@nocobase/plugin-users/client-v2"]=t(require("ahooks"),require("react-i18next"),require("@nocobase/client-v2"),require("react-router-dom"),require("react"),require("antd"),require("@nocobase/flow-engine")):e["@nocobase/plugin-users/client-v2"]=t(e.ahooks,e["react-i18next"],e["@nocobase/client-v2"],e["react-router-dom"],e.react,e.antd,e["@nocobase/flow-engine"])}(self,function(e,t,r,n,o,i,a){return function(){"use strict";var u={485:function(e){e.exports=r},694:function(e){e.exports=a},625:function(t){t.exports=e},59:function(e){e.exports=i},155:function(e){e.exports=o},953:function(e){e.exports=t},442:function(e){e.exports=n}},c={};function l(e){var t=c[e];if(void 0!==t)return t.exports;var r=c[e]={exports:{}};return u[e](r,r.exports,l),r.exports}l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,{a:t}),t},l.d=function(e,t){for(var r in t)l.o(t,r)&&!l.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},l.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.g.importScripts&&(s=l.g.location+"");var s,f=l.g.document;if(!s&&f&&(f.currentScript&&"SCRIPT"===f.currentScript.tagName.toUpperCase()&&(s=f.currentScript.src),!s)){var p=f.getElementsByTagName("script");if(p.length)for(var d=p.length-1;d>-1&&(!s||!/^http(s?):/.test(s));)s=p[d--].src}if(!s)throw Error("Automatic publicPath is not supported in this browser");l.p=s.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var b={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src&&(e=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/@nocobase/plugin-users/dist/client-v2/")}if(!e){if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var n=window.location.pathname||"/",o=n.indexOf("/v2/");e=o>=0?n.slice(0,o+1):"/"}e&&(e=e.replace(/\/v2\/?$/,"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-users/dist/client-v2/"}l.p=e}(),!function(){l.r(b),l.d(b,{PluginUsersClientV2:function(){return G},NAMESPACE:function(){return o},default:function(){return J},useUsersTranslation:function(){return a},usersLocaleResources:function(){return i}});var e=l(485),t=l(953),r=JSON.parse('{"Add user":"Add user","Add users":"Add users","Allow change password":"Allow change password","Allow edit profile":"Allow edit profile","Are you sure you want to remove it?":"Are you sure you want to remove it?","Random password":"Random password","Remove user":"Remove user","User profile is not allowed to be edited":"User profile is not allowed to be edited","Users & Permissions":"Users & Permissions","Users manager":"Users manager"}'),n=JSON.parse('{"Add user":"添加用户","Add users":"添加用户","Allow change password":"允许修改密码","Allow edit profile":"允许修改个人资料","Are you sure you want to remove it?":"你确定要移除吗?","Random password":"随机密码","Remove user":"移除用户","User profile is not allowed to be edited":"用户资料不允许修改","Users & Permissions":"用户和权限","Users manager":"用户管理"}'),o="users",i={"en-US":r,"zh-CN":n};function a(){return(0,t.useTranslation)([o,"client"],{nsMode:"fallback"})}var u=l(694),c=l(625),s=l(59),f=l(155),p=l.n(f),d=l(442);function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function y(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){r(e);return}u.done?t(c):Promise.resolve(c).then(n,o)}function m(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){y(i,n,o,a,u,"next",e)}function u(e){y(i,n,o,a,u,"throw",e)}a(void 0)})}}function v(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function w(e){return(w=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function S(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return h(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return h(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(O=function(){return!!e})()}function P(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){var l=[u,c];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&l[0]?n.return:l[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;switch(n=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,n=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],n=0}finally{r=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}function x(){var t=a().t,r=(0,u.useFlowContext)(),n=(0,d.useNavigate)(),o=S(s.Form.useForm(),1)[0],i=S((0,f.useState)(!1),2),l=i[0],b=i[1],h=S((0,f.useState)(""),2),y=h[0],v=h[1],w=(0,c.useMemoizedFn)(function(){return m(function(){var e,t,i,a,u,c;return P(this,function(l){switch(l.label){case 0:return[4,o.validateFields()];case 1:e=l.sent(),v(""),b(!0),l.label=2;case 2:return l.trys.push([2,4,5,6]),[4,r.api.resource("auth").changePassword({values:e})];case 3:return l.sent(),o.resetFields(),n("/signin"),[3,6];case 4:throw v((null==(t=l.sent())||null==(c=t.response)||null==(u=c.data)||null==(a=u.errors)||null==(i=a[0])?void 0:i.message)||(null==t?void 0:t.message)||String(t)),t;case 5:return b(!1),[7];case 6:return[2]}})})()});return p().createElement(e.DrawerFormLayout,{title:t("Change password"),onSubmit:w,submitting:l,submitText:t("Submit"),cancelText:t("Cancel")},p().createElement(s.Form,{form:o,layout:"vertical"},y?p().createElement(s.Alert,{type:"error",showIcon:!0,message:y,style:{marginBottom:16}}):null,p().createElement(s.Form.Item,{name:"oldPassword",label:t("Old password"),rules:[{required:!0,message:t("Please enter the old password")}]},p().createElement(e.PasswordInput,{autoComplete:"current-password"})),p().createElement(s.Form.Item,{name:"newPassword",label:t("New password"),rules:[{required:!0,message:t("Please enter the new password")}]},p().createElement(e.PasswordInput,{autoComplete:"new-password",checkStrength:!0})),p().createElement(s.Form.Item,{name:"confirmPassword",label:t("Confirm password"),dependencies:["newPassword"],rules:[{required:!0,message:t("Please confirm the new password")},function(e){var r=e.getFieldValue;return{validator:function(e,n){return n&&r("newPassword")!==n?Promise.reject(Error(t("Password mismatch"))):Promise.resolve()}}}]},p().createElement(e.PasswordInput,{autoComplete:"new-password",checkStrength:!0}))))}var j=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t,n;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return t=r,n=arguments,t=w(t),v(e=function(e,t){var r;if(t&&("object"==((r=t)&&"u">typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,O()?Reflect.construct(t,n||[],w(this).constructor):t.apply(this,n)),"section","profile"),v(e,"sort",100),v(e,"label","Change password"),e}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&g(r,e),t=[{key:"prepare",value:function(){return m(function(){var e,t,r;return P(this,function(n){switch(n.label){case 0:return[4,this.context.systemSettings.load()];case 1:return r=null==(t=n.sent())||null==(e=t.data)?void 0:e.enableChangePassword,this.ready=!1!==r,[2]}})}).call(this)}},{key:"onClick",value:function(){return m(function(){return P(this,function(e){return this.context.viewer.drawer({width:"50%",closable:!0,content:function(){return p().createElement(x,null)}}),[2]})}).call(this)}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(r.prototype,t),r}(e.UserCenterActionItemModel);function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function _(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){r(e);return}u.done?t(c):Promise.resolve(c).then(n,o)}function E(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){_(i,n,o,a,u,"next",e)}function u(e){_(i,n,o,a,u,"throw",e)}a(void 0)})}}function k(e,t,r){return t=q(t),function(e,t){var r;if(t&&("object"==((r=t)&&"u">typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e,$()?Reflect.construct(t,r||[],q(e).constructor):t.apply(e,r))}function I(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function C(e,t,r){return(C=$()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&F(o,r.prototype),o}).apply(null,arguments)}function T(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function U(e,t,r){return t&&T(e.prototype,t),r&&T(e,r),e}function R(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function q(e){return(q=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function M(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&F(e,t)}function F(e,t){return(F=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function N(e){var t="function"==typeof Map?new Map:void 0;return(N=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return C(e,arguments,q(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),F(r,e)})(e)}function $(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return($=function(){return!!e})()}function B(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){var l=[u,c];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&l[0]?n.return:l[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;switch(n=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,n=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],n=0}finally{r=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}v(j,"itemId","change-password");var V=function(e){function t(){var e;return I(this,t),e=k(this,t,arguments),R(e,"section","profile"),R(e,"sort",0),e}return M(t,e),U(t,[{key:"prepare",value:function(){return E(function(){var e;return B(this,function(t){return e=this.context.user||{},this.label=e.nickname||e.username||e.email||"",this.value=void 0,this.description=void 0,this.ready=!!this.label,[2]})}).call(this)}}]),t}(e.UserCenterTextItemModel);R(V,"itemId","current-user-summary");var z=function(t){function r(){var e;return I(this,r),e=k(this,r,arguments),R(e,"section","danger"),R(e,"sort",1e3),R(e,"label","Sign out"),e}return M(r,t),U(r,[{key:"onClick",value:function(){return E(function(){var t,r,n,o;return B(this,function(i){switch(i.label){case 0:return[4,this.context.api.auth.signOut()];case 1:if(n=i.sent(),o=(0,e.resolveV2SigninRedirect)(null==n||null==(r=n.data)||null==(t=r.data)?void 0:t.redirect,this.context.app))return window.location.replace(o),[2];return(0,e.redirectToV2Signin)(this.context.app,(0,e.getCurrentV2RedirectPath)(this.context.app,window.location),{replace:!0}),[2]}})}).call(this)}}]),r}(e.UserCenterActionItemModel);R(z,"itemId","sign-out");var G=function(e){function t(){return I(this,t),k(this,t,arguments)}return M(t,e),U(t,[{key:"load",value:function(){return E(function(){var e;return B(this,function(t){return e=this,Object.entries(i).forEach(function(t){var r,n=function(e){if(Array.isArray(e))return e}(t)||function(e){var t,r,n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o=[],i=!0,a=!1;try{for(n=n.call(e);!(i=(t=n.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,r=e}finally{try{i||null==n.return||n.return()}finally{if(a)throw r}}return o}}(t)||function(e){if(e){if("string"==typeof e)return A(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return A(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=n[0],i=n[1];e.app.i18n.addResources(o,(null==(r=e.options)?void 0:r.packageName)||"@nocobase/plugin-users",i)}),this.app.flowEngine.registerModels({ChangePasswordItemModel:j,CurrentUserSummaryItemModel:V,SignOutItemModel:z}),[2]})}).call(this)}}]),t}(N(e.Plugin)),J=G}(),b}()});

@@ -16,16 +16,18 @@ /**

"react": "18.2.0",
"@nocobase/client": "2.1.0-beta.35",
"@nocobase/client": "2.1.0-beta.36",
"antd": "5.24.2",
"@formily/core": "2.3.7",
"@nocobase/plugin-acl": "2.1.0-beta.35",
"@nocobase/plugin-acl": "2.1.0-beta.36",
"@emotion/css": "11.13.0",
"@nocobase/utils": "2.1.0-beta.35",
"@nocobase/client-v2": "2.1.0-beta.35",
"@nocobase/database": "2.1.0-beta.35",
"@nocobase/server": "2.1.0-beta.35",
"@nocobase/plugin-user-data-sync": "2.1.0-beta.35",
"@nocobase/plugin-ui-schema-storage": "2.1.0-beta.35",
"@nocobase/utils": "2.1.0-beta.36",
"@nocobase/client-v2": "2.1.0-beta.36",
"@nocobase/database": "2.1.0-beta.36",
"@nocobase/server": "2.1.0-beta.36",
"@nocobase/plugin-user-data-sync": "2.1.0-beta.36",
"@nocobase/plugin-ui-schema-storage": "2.1.0-beta.36",
"lodash": "4.18.1",
"@nocobase/actions": "2.1.0-beta.35",
"@nocobase/flow-engine": "2.1.0-beta.36",
"ahooks": "3.7.8",
"@nocobase/actions": "2.1.0-beta.36",
"sequelize": "6.35.2"
};

@@ -9,3 +9,3 @@ {

"description.zh-CN": "提供了基础的用户模型,以及创建人和最后更新人字段。",
"version": "2.1.0-beta.35",
"version": "2.1.0-beta.36",
"license": "Apache-2.0",

@@ -35,3 +35,3 @@ "main": "./dist/server/index.js",

},
"gitHead": "74310d8b9e9581fcde14b5a93d12b41ddb5bb325",
"gitHead": "397d45c744f6eb48b3a0cd785c87cbf1257c3513",
"keywords": [

@@ -38,0 +38,0 @@ "Users & permissions"