@nocobase/plugin-users 2.1.0-beta.22 → 2.1.0-beta.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/client-v2.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from './dist/client-v2';
2
+ export { default } from './dist/client-v2';
package/client-v2.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./dist/client-v2/index.js');
@@ -0,0 +1,11 @@
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 } from './plugin';
10
+ export * from './plugin';
11
+ export * from './locale';
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ !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",["react-i18next","@nocobase/client-v2"],t):"object"==typeof exports?exports["@nocobase/plugin-users"]=t(require("react-i18next"),require("@nocobase/client-v2")):e["@nocobase/plugin-users"]=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.resolveLegacySigninRedirect)(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.redirectToLegacySignin)(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}()});
@@ -0,0 +1,36 @@
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 declare const NAMESPACE = "users";
10
+ export declare const usersLocaleResources: {
11
+ 'en-US': {
12
+ "Add user": string;
13
+ "Add users": string;
14
+ "Allow change password": string;
15
+ "Allow edit profile": string;
16
+ "Are you sure you want to remove it?": string;
17
+ "Random password": string;
18
+ "Remove user": string;
19
+ "User profile is not allowed to be edited": string;
20
+ "Users & Permissions": string;
21
+ "Users manager": string;
22
+ };
23
+ 'zh-CN': {
24
+ "Add user": string;
25
+ "Add users": string;
26
+ "Allow change password": string;
27
+ "Allow edit profile": string;
28
+ "Are you sure you want to remove it?": string;
29
+ "Random password": string;
30
+ "Remove user": string;
31
+ "User profile is not allowed to be edited": string;
32
+ "Users & Permissions": string;
33
+ "Users manager": string;
34
+ };
35
+ };
36
+ export declare function useUsersTranslation(): import("react-i18next").UseTranslationResponse<("users" | "client")[], undefined>;
@@ -0,0 +1,13 @@
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 { Plugin } from '@nocobase/client-v2';
10
+ export declare class PluginUsersClientV2 extends Plugin {
11
+ load(): Promise<void>;
12
+ }
13
+ export default PluginUsersClientV2;
@@ -13,17 +13,18 @@ module.exports = {
13
13
  "react-i18next": "11.18.6",
14
14
  "react-router-dom": "6.30.1",
15
15
  "react": "18.2.0",
16
- "@nocobase/client": "2.1.0-beta.22",
16
+ "@nocobase/client": "2.1.0-beta.23",
17
17
  "antd": "5.24.2",
18
18
  "@formily/core": "2.3.7",
19
- "@nocobase/plugin-acl": "2.1.0-beta.22",
19
+ "@nocobase/plugin-acl": "2.1.0-beta.23",
20
20
  "@emotion/css": "11.13.0",
21
- "@nocobase/utils": "2.1.0-beta.22",
22
- "@nocobase/database": "2.1.0-beta.22",
23
- "@nocobase/server": "2.1.0-beta.22",
24
- "@nocobase/plugin-user-data-sync": "2.1.0-beta.22",
25
- "@nocobase/plugin-ui-schema-storage": "2.1.0-beta.22",
21
+ "@nocobase/utils": "2.1.0-beta.23",
22
+ "@nocobase/client-v2": "2.1.0-beta.23",
23
+ "@nocobase/database": "2.1.0-beta.23",
24
+ "@nocobase/server": "2.1.0-beta.23",
25
+ "@nocobase/plugin-user-data-sync": "2.1.0-beta.23",
26
+ "@nocobase/plugin-ui-schema-storage": "2.1.0-beta.23",
26
27
  "lodash": "4.18.1",
27
- "@nocobase/actions": "2.1.0-beta.22",
28
+ "@nocobase/actions": "2.1.0-beta.23",
28
29
  "sequelize": "6.35.2"
29
30
  };
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "description": "Provides basic user model, as well as created by and updated by fields.",
7
7
  "description.ru-RU": "Предоставляет базовую модель пользователя, а также поля кем, когда «создано» и «обновлено».",
8
8
  "description.zh-CN": "提供了基础的用户模型,以及创建人和最后更新人字段。",
9
- "version": "2.1.0-beta.22",
9
+ "version": "2.1.0-beta.23",
10
10
  "license": "Apache-2.0",
11
11
  "main": "./dist/server/index.js",
12
12
  "homepage": "https://docs.nocobase.com/handbook/users",
@@ -19,6 +19,7 @@
19
19
  "peerDependencies": {
20
20
  "@nocobase/actions": "2.x",
21
21
  "@nocobase/client": "2.x",
22
+ "@nocobase/client-v2": "2.x",
22
23
  "@nocobase/database": "2.x",
23
24
  "@nocobase/plugin-acl": "2.x",
24
25
  "@nocobase/plugin-auth": "2.x",
@@ -30,7 +31,7 @@
30
31
  "@nocobase/test": "2.x",
31
32
  "@nocobase/utils": "2.x"
32
33
  },
33
- "gitHead": "53ad02861ed8e813103f59659804417118c85b4c",
34
+ "gitHead": "bb4c0d3551bf9eff505b63756dd24a0813231f16",
34
35
  "keywords": [
35
36
  "Users & permissions"
36
37
  ]