asv-hlps 1.3.14 → 1.3.16

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.
@@ -0,0 +1,31 @@
1
+ import { AuthTag } from "../auth/AuthTag";
2
+ import { Address } from "./Address";
3
+ import { Gender } from "./Gender";
4
+ import { Ste } from "./Ste";
5
+ import { UserGrp } from "./UserGrp";
6
+ import { UserRole } from "./UserRole";
7
+ import { UserTitr } from "./UserTitr";
8
+ export interface UserBase extends Address {
9
+ id: number;
10
+ codeCompta?: string | number;
11
+ firstname: string;
12
+ lastname: string;
13
+ username?: string;
14
+ birthday?: Date | string;
15
+ password?: string;
16
+ ip?: string;
17
+ isActive: boolean;
18
+ isValided?: boolean;
19
+ disabled?: boolean;
20
+ isBadPayer?: boolean;
21
+ foto?: string;
22
+ clp?: string;
23
+ gender?: Gender;
24
+ titr?: UserTitr;
25
+ grp?: UserGrp;
26
+ tags?: AuthTag[];
27
+ role?: UserRole;
28
+ roles?: UserRole[];
29
+ ste?: Ste;
30
+ fullname?: string;
31
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -5,6 +5,7 @@ import { Leave } from "./Leave";
5
5
  import { Ste } from "./Ste";
6
6
  import { SteGrp } from "./SteGrp";
7
7
  import { User } from "./User";
8
+ import { UserBase } from "./UserBase";
8
9
  import { UserCredit } from "./UserCredit";
9
10
  import { UserGrp } from "./UserGrp";
10
11
  import { UserNotarial } from "./UserNotatial";
@@ -13,4 +14,4 @@ import { UserOnline } from "./UserOnline";
13
14
  import { UserRole } from "./UserRole";
14
15
  import { UserTitr } from "./UserTitr";
15
16
  import { Zone } from "./Zone";
16
- export { UserNotarial, Address, DutyPhcie, Gender, Leave, Ste, SteGrp, User, UserCredit, UserGrp, UserNote, UserOnline, UserRole, UserTitr, Zone, };
17
+ export { Address, DutyPhcie, Gender, Leave, Ste, SteGrp, User, UserCredit, UserGrp, UserNotarial, UserNote, UserOnline, UserRole, UserTitr, UserBase, Zone, };
package/lib/cjs/user.js CHANGED
@@ -93,7 +93,7 @@ const secureUser = (user, username, heads) => {
93
93
  };
94
94
  exports.secureUser = secureUser;
95
95
  const secureUserPassword = (user, heads) => {
96
- user.password = (0, randomatic_1.default)("Aa0", 8);
96
+ user.password = !user.password ? (0, randomatic_1.default)("Aa0", 8) : user.password;
97
97
  if (heads) {
98
98
  user.dns = heads.host;
99
99
  }
@@ -0,0 +1,31 @@
1
+ import { AuthTag } from "../auth/AuthTag";
2
+ import { Address } from "./Address";
3
+ import { Gender } from "./Gender";
4
+ import { Ste } from "./Ste";
5
+ import { UserGrp } from "./UserGrp";
6
+ import { UserRole } from "./UserRole";
7
+ import { UserTitr } from "./UserTitr";
8
+ export interface UserBase extends Address {
9
+ id: number;
10
+ codeCompta?: string | number;
11
+ firstname: string;
12
+ lastname: string;
13
+ username?: string;
14
+ birthday?: Date | string;
15
+ password?: string;
16
+ ip?: string;
17
+ isActive: boolean;
18
+ isValided?: boolean;
19
+ disabled?: boolean;
20
+ isBadPayer?: boolean;
21
+ foto?: string;
22
+ clp?: string;
23
+ gender?: Gender;
24
+ titr?: UserTitr;
25
+ grp?: UserGrp;
26
+ tags?: AuthTag[];
27
+ role?: UserRole;
28
+ roles?: UserRole[];
29
+ ste?: Ste;
30
+ fullname?: string;
31
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -5,6 +5,7 @@ import { Leave } from "./Leave";
5
5
  import { Ste } from "./Ste";
6
6
  import { SteGrp } from "./SteGrp";
7
7
  import { User } from "./User";
8
+ import { UserBase } from "./UserBase";
8
9
  import { UserCredit } from "./UserCredit";
9
10
  import { UserGrp } from "./UserGrp";
10
11
  import { UserNotarial } from "./UserNotatial";
@@ -13,4 +14,4 @@ import { UserOnline } from "./UserOnline";
13
14
  import { UserRole } from "./UserRole";
14
15
  import { UserTitr } from "./UserTitr";
15
16
  import { Zone } from "./Zone";
16
- export { UserNotarial, Address, DutyPhcie, Gender, Leave, Ste, SteGrp, User, UserCredit, UserGrp, UserNote, UserOnline, UserRole, UserTitr, Zone, };
17
+ export { Address, DutyPhcie, Gender, Leave, Ste, SteGrp, User, UserCredit, UserGrp, UserNotarial, UserNote, UserOnline, UserRole, UserTitr, UserBase, Zone, };
package/lib/esm/user.js CHANGED
@@ -56,7 +56,7 @@ export const secureUser = (user, username, heads) => {
56
56
  user.username = username;
57
57
  };
58
58
  export const secureUserPassword = (user, heads) => {
59
- user.password = randomatic("Aa0", 8);
59
+ user.password = !user.password ? randomatic("Aa0", 8) : user.password;
60
60
  if (heads) {
61
61
  user.dns = heads.host;
62
62
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asv-hlps",
3
- "version": "1.3.14",
3
+ "version": "1.3.16",
4
4
  "description": "helpers",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "module": "./lib/esm/index.js",