@nocobase/plugin-users 0.19.0-alpha.6 → 0.19.0-alpha.8

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.
@@ -1,5 +1,5 @@
1
1
  import { Plugin } from '@nocobase/client';
2
- declare class UsersPlugin extends Plugin {
2
+ export declare class PluginUsersClient extends Plugin {
3
3
  load(): Promise<void>;
4
4
  }
5
- export default UsersPlugin;
5
+ export default PluginUsersClient;
@@ -1 +1 @@
1
- (function(e,n){typeof exports=="object"&&typeof module!="undefined"?n(exports,require("@nocobase/client")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client"],n):(e=typeof globalThis!="undefined"?globalThis:e||self,n(e["@nocobase/plugin-users"]={},e["@nocobase/client"]))})(this,function(e,n){"use strict";var l=(e,n,o)=>new Promise((u,d)=>{var c=i=>{try{s(o.next(i))}catch(t){d(t)}},f=i=>{try{s(o.throw(i))}catch(t){d(t)}},s=i=>i.done?u(i.value):Promise.resolve(i.value).then(c,f);s((o=o.apply(e,n)).next())});class o extends n.Plugin{load(){return l(this,null,function*(){})}}e.default=o,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(e,n){typeof exports=="object"&&typeof module!="undefined"?n(exports,require("@nocobase/client")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client"],n):(e=typeof globalThis!="undefined"?globalThis:e||self,n(e["@nocobase/plugin-users"]={},e["@nocobase/client"]))})(this,function(e,n){"use strict";var d=(e,n,i)=>new Promise((u,l)=>{var c=s=>{try{t(i.next(s))}catch(o){l(o)}},f=s=>{try{t(i.throw(s))}catch(o){l(o)}},t=s=>s.done?u(s.value):Promise.resolve(s.value).then(c,f);t((i=i.apply(e,n)).next())});class i extends n.Plugin{load(){return d(this,null,function*(){})}}e.PluginUsersClient=i,e.default=i,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1,7 +1,7 @@
1
1
  module.exports = {
2
- "@nocobase/client": "0.19.0-alpha.6",
3
- "@nocobase/database": "0.19.0-alpha.6",
4
- "@nocobase/server": "0.19.0-alpha.6",
5
- "@nocobase/utils": "0.19.0-alpha.6",
6
- "@nocobase/actions": "0.19.0-alpha.6"
2
+ "@nocobase/client": "0.19.0-alpha.8",
3
+ "@nocobase/database": "0.19.0-alpha.8",
4
+ "@nocobase/server": "0.19.0-alpha.8",
5
+ "@nocobase/utils": "0.19.0-alpha.8",
6
+ "@nocobase/actions": "0.19.0-alpha.8"
7
7
  };
@@ -1,9 +1,5 @@
1
1
  import { Plugin } from '@nocobase/server';
2
- export interface UserPluginConfig {
3
- name?: string;
4
- }
5
- export default class UsersPlugin extends Plugin<UserPluginConfig> {
6
- constructor(app: any, options: any);
2
+ export default class PluginUsersServer extends Plugin {
7
3
  beforeLoad(): Promise<void>;
8
4
  load(): Promise<void>;
9
5
  getInstallingData(options?: any): {
@@ -27,30 +27,16 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
27
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
28
  var server_exports = {};
29
29
  __export(server_exports, {
30
- default: () => UsersPlugin
30
+ default: () => PluginUsersServer
31
31
  });
32
32
  module.exports = __toCommonJS(server_exports);
33
33
  var import_database = require("@nocobase/database");
34
34
  var import_server = require("@nocobase/server");
35
35
  var import_utils = require("@nocobase/utils");
36
36
  var import_path = require("path");
37
- var import__ = require("./");
38
37
  var actions = __toESM(require("./actions/users"));
39
- var import_locale = require("./locale");
40
- class UsersPlugin extends import_server.Plugin {
41
- constructor(app, options) {
42
- super(app, options);
43
- }
38
+ class PluginUsersServer extends import_server.Plugin {
44
39
  async beforeLoad() {
45
- this.app.i18n.addResources("zh-CN", import__.namespace, import_locale.zhCN);
46
- this.app.i18n.addResources("en-US", import__.namespace, import_locale.enUS);
47
- const cmd = this.app.findCommand("install");
48
- if (cmd) {
49
- cmd.requiredOption("-u, --root-username <rootUsername>", "", process.env.INIT_ROOT_USERNAME);
50
- cmd.requiredOption("-e, --root-email <rootEmail>", "", process.env.INIT_ROOT_EMAIL);
51
- cmd.requiredOption("-p, --root-password <rootPassword>", "", process.env.INIT_ROOT_PASSWORD);
52
- cmd.option("-n, --root-nickname <rootNickname>");
53
- }
54
40
  this.db.registerOperators({
55
41
  $isCurrentUser(_, ctx) {
56
42
  var _a, _b, _c, _d;
@@ -140,8 +126,8 @@ class UsersPlugin extends import_server.Plugin {
140
126
  var _a;
141
127
  const { INIT_ROOT_NICKNAME, INIT_ROOT_PASSWORD, INIT_ROOT_EMAIL, INIT_ROOT_USERNAME } = process.env;
142
128
  const {
143
- rootEmail = INIT_ROOT_EMAIL,
144
- rootPassword = INIT_ROOT_PASSWORD,
129
+ rootEmail = INIT_ROOT_EMAIL || "admin@nocobase.com",
130
+ rootPassword = INIT_ROOT_PASSWORD || "admin123",
145
131
  rootNickname = INIT_ROOT_NICKNAME || "Super Admin",
146
132
  rootUsername = INIT_ROOT_USERNAME || "nocobase"
147
133
  } = options.users || ((_a = options == null ? void 0 : options.cliArgs) == null ? void 0 : _a[0]) || {};
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "displayName.zh-CN": "用户",
5
5
  "description": "Provides a basic user model and a password-based user authentication type, and extended the createdBy and updatedBy field types",
6
6
  "description.zh-CN": "提供了基础的用户模型和基于密码的用户认证方式,并拓展了创建人和最后更新人字段类型",
7
- "version": "0.19.0-alpha.6",
7
+ "version": "0.19.0-alpha.8",
8
8
  "license": "AGPL-3.0",
9
9
  "main": "./dist/server/index.js",
10
10
  "homepage": "https://docs.nocobase.com/plugins/users",
@@ -24,7 +24,7 @@
24
24
  "@nocobase/test": "0.x",
25
25
  "@nocobase/utils": "0.x"
26
26
  },
27
- "gitHead": "2eb524db98c7f4136fe1a9a1b1259cd72cf6635f",
27
+ "gitHead": "b8fbe613e320e40ebf2da1bf64907eab0197b589",
28
28
  "keywords": [
29
29
  "Users & permissions"
30
30
  ]