@tc-libs/user 0.9.0

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.
Files changed (59) hide show
  1. package/README.md +11 -0
  2. package/package.json +11 -0
  3. package/src/constants/index.d.ts +2 -0
  4. package/src/constants/index.js +6 -0
  5. package/src/constants/index.js.map +1 -0
  6. package/src/constants/user.constant.d.ts +2 -0
  7. package/src/constants/user.constant.js +6 -0
  8. package/src/constants/user.constant.js.map +1 -0
  9. package/src/constants/user.email.d.ts +6 -0
  10. package/src/constants/user.email.js +11 -0
  11. package/src/constants/user.email.js.map +1 -0
  12. package/src/index.d.ts +2 -0
  13. package/src/index.js +6 -0
  14. package/src/index.js.map +1 -0
  15. package/src/interfaces/dtos/index.d.ts +1 -0
  16. package/src/interfaces/dtos/index.js +5 -0
  17. package/src/interfaces/dtos/index.js.map +1 -0
  18. package/src/interfaces/dtos/user.reset-password.dto.interface.d.ts +4 -0
  19. package/src/interfaces/dtos/user.reset-password.dto.interface.js +3 -0
  20. package/src/interfaces/dtos/user.reset-password.dto.interface.js.map +1 -0
  21. package/src/interfaces/index.d.ts +4 -0
  22. package/src/interfaces/index.js +8 -0
  23. package/src/interfaces/index.js.map +1 -0
  24. package/src/interfaces/serializations/index.d.ts +4 -0
  25. package/src/interfaces/serializations/index.js +8 -0
  26. package/src/interfaces/serializations/index.js.map +1 -0
  27. package/src/interfaces/serializations/user.confirm.serialization.interface.d.ts +7 -0
  28. package/src/interfaces/serializations/user.confirm.serialization.interface.js +3 -0
  29. package/src/interfaces/serializations/user.confirm.serialization.interface.js.map +1 -0
  30. package/src/interfaces/serializations/user.get.serialization.interface.d.ts +12 -0
  31. package/src/interfaces/serializations/user.get.serialization.interface.js +3 -0
  32. package/src/interfaces/serializations/user.get.serialization.interface.js.map +1 -0
  33. package/src/interfaces/serializations/user.payload.serialization.interface.d.ts +6 -0
  34. package/src/interfaces/serializations/user.payload.serialization.interface.js +3 -0
  35. package/src/interfaces/serializations/user.payload.serialization.interface.js.map +1 -0
  36. package/src/interfaces/serializations/user.reset-password.serialization.interface.d.ts +5 -0
  37. package/src/interfaces/serializations/user.reset-password.serialization.interface.js +3 -0
  38. package/src/interfaces/serializations/user.reset-password.serialization.interface.js.map +1 -0
  39. package/src/interfaces/services/index.d.ts +5 -0
  40. package/src/interfaces/services/index.js +9 -0
  41. package/src/interfaces/services/index.js.map +1 -0
  42. package/src/interfaces/services/user.admin.service.interface.d.ts +6 -0
  43. package/src/interfaces/services/user.admin.service.interface.js +3 -0
  44. package/src/interfaces/services/user.admin.service.interface.js.map +1 -0
  45. package/src/interfaces/services/user.auth.service.interface.d.ts +21 -0
  46. package/src/interfaces/services/user.auth.service.interface.js +3 -0
  47. package/src/interfaces/services/user.auth.service.interface.js.map +1 -0
  48. package/src/interfaces/services/user.base.service.interface.d.ts +11 -0
  49. package/src/interfaces/services/user.base.service.interface.js +3 -0
  50. package/src/interfaces/services/user.base.service.interface.js.map +1 -0
  51. package/src/interfaces/services/user.confirm.service.interface.d.ts +9 -0
  52. package/src/interfaces/services/user.confirm.service.interface.js +3 -0
  53. package/src/interfaces/services/user.confirm.service.interface.js.map +1 -0
  54. package/src/interfaces/services/user.reset-password.service.interface.d.ts +9 -0
  55. package/src/interfaces/services/user.reset-password.service.interface.js +3 -0
  56. package/src/interfaces/services/user.reset-password.service.interface.js.map +1 -0
  57. package/src/interfaces/user.base.interface.d.ts +86 -0
  58. package/src/interfaces/user.base.interface.js +17 -0
  59. package/src/interfaces/user.base.interface.js.map +1 -0
package/README.md ADDED
@@ -0,0 +1,11 @@
1
+ # user
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Building
6
+
7
+ Run `nx build user` to build the library.
8
+
9
+ ## Running unit tests
10
+
11
+ Run `nx test user` to execute the unit tests via [Jest](https://jestjs.io).
package/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "@tc-libs/user",
3
+ "version": "0.9.0",
4
+ "dependencies": {
5
+ "tslib": "^2.3.0"
6
+ },
7
+ "type": "commonjs",
8
+ "main": "./src/index.js",
9
+ "typings": "./src/index.d.ts",
10
+ "types": "./src/index.d.ts"
11
+ }
@@ -0,0 +1,2 @@
1
+ export * from './user.constant';
2
+ export * from './user.email';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./user.constant"), exports);
5
+ tslib_1.__exportStar(require("./user.email"), exports);
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/user/src/constants/index.ts"],"names":[],"mappings":";;;AAAA,0DAAgC;AAChC,uDAA6B"}
@@ -0,0 +1,2 @@
1
+ export declare const USER_ACTIVE_META_KEY = "UserActiveMetaKey";
2
+ export declare const USER_BLOCKED_META_KEY = "UserBlockedMetaKey";
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.USER_BLOCKED_META_KEY = exports.USER_ACTIVE_META_KEY = void 0;
4
+ exports.USER_ACTIVE_META_KEY = 'UserActiveMetaKey';
5
+ exports.USER_BLOCKED_META_KEY = 'UserBlockedMetaKey';
6
+ //# sourceMappingURL=user.constant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.constant.js","sourceRoot":"","sources":["../../../../../packages/user/src/constants/user.constant.ts"],"names":[],"mappings":";;;AAAa,QAAA,oBAAoB,GAAG,mBAAmB,CAAC;AAC3C,QAAA,qBAAqB,GAAG,oBAAoB,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare enum USER_EMAIL_TEMPLATES {
2
+ RESET_PASSWORD_CONFIRM = "reset-password-confirm",
3
+ REGISTER = "register",
4
+ REGISTER_CONFIRM = "register-confirm",
5
+ RESET_PASSWORD = "reset-password"
6
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.USER_EMAIL_TEMPLATES = void 0;
4
+ var USER_EMAIL_TEMPLATES;
5
+ (function (USER_EMAIL_TEMPLATES) {
6
+ USER_EMAIL_TEMPLATES["RESET_PASSWORD_CONFIRM"] = "reset-password-confirm";
7
+ USER_EMAIL_TEMPLATES["REGISTER"] = "register";
8
+ USER_EMAIL_TEMPLATES["REGISTER_CONFIRM"] = "register-confirm";
9
+ USER_EMAIL_TEMPLATES["RESET_PASSWORD"] = "reset-password";
10
+ })(USER_EMAIL_TEMPLATES || (exports.USER_EMAIL_TEMPLATES = USER_EMAIL_TEMPLATES = {}));
11
+ //# sourceMappingURL=user.email.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.email.js","sourceRoot":"","sources":["../../../../../packages/user/src/constants/user.email.ts"],"names":[],"mappings":";;;AAAA,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,yEAAiD,CAAA;IACjD,6CAAqB,CAAA;IACrB,6DAAqC,CAAA;IACrC,yDAAiC,CAAA;AACnC,CAAC,EALW,oBAAoB,oCAApB,oBAAoB,QAK/B"}
package/src/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from './constants';
2
+ export * from './interfaces';
package/src/index.js ADDED
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./constants"), exports);
5
+ tslib_1.__exportStar(require("./interfaces"), exports);
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/user/src/index.ts"],"names":[],"mappings":";;;AAAA,sDAA4B;AAC5B,uDAA6B"}
@@ -0,0 +1 @@
1
+ export * from './user.reset-password.dto.interface';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./user.reset-password.dto.interface"), exports);
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/user/src/interfaces/dtos/index.ts"],"names":[],"mappings":";;;AAAA,8EAAoD"}
@@ -0,0 +1,4 @@
1
+ export interface IUserResetPasswordDto {
2
+ email: string;
3
+ password: string;
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=user.reset-password.dto.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.reset-password.dto.interface.js","sourceRoot":"","sources":["../../../../../../packages/user/src/interfaces/dtos/user.reset-password.dto.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ export * from './user.base.interface';
2
+ export * from './dtos';
3
+ export * from './serializations';
4
+ export * from './services';
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./user.base.interface"), exports);
5
+ tslib_1.__exportStar(require("./dtos"), exports);
6
+ tslib_1.__exportStar(require("./serializations"), exports);
7
+ tslib_1.__exportStar(require("./services"), exports);
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/user/src/interfaces/index.ts"],"names":[],"mappings":";;;AAAA,gEAAsC;AACtC,iDAAuB;AACvB,2DAAiC;AACjC,qDAA2B"}
@@ -0,0 +1,4 @@
1
+ export * from './user.confirm.serialization.interface';
2
+ export * from './user.get.serialization.interface';
3
+ export * from './user.payload.serialization.interface';
4
+ export * from './user.reset-password.serialization.interface';
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./user.confirm.serialization.interface"), exports);
5
+ tslib_1.__exportStar(require("./user.get.serialization.interface"), exports);
6
+ tslib_1.__exportStar(require("./user.payload.serialization.interface"), exports);
7
+ tslib_1.__exportStar(require("./user.reset-password.serialization.interface"), exports);
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/user/src/interfaces/serializations/index.ts"],"names":[],"mappings":";;;AAAA,iFAAuD;AACvD,6EAAmD;AACnD,iFAAuD;AACvD,wFAA8D"}
@@ -0,0 +1,7 @@
1
+ export interface IUserConfirmSerialization {
2
+ success: boolean;
3
+ redirectUrl: string;
4
+ }
5
+ export interface IUserConfirmResendSerialization {
6
+ success: boolean;
7
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=user.confirm.serialization.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.confirm.serialization.interface.js","sourceRoot":"","sources":["../../../../../../packages/user/src/interfaces/serializations/user.confirm.serialization.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ import { IBaseUser } from '../user.base.interface';
2
+ import { ENUM_AUTH_ACCESS_FOR } from '@tc-libs/authentication';
3
+ export interface IUserGetSerialization extends Omit<IBaseUser, 'password' | 'resetPassword' | 'passwordHistory' | 'social'> {
4
+ Role: {
5
+ active: boolean;
6
+ name: string;
7
+ accessFor: ENUM_AUTH_ACCESS_FOR;
8
+ permissions: any[];
9
+ createdAt: Date;
10
+ updatedAt: Date;
11
+ };
12
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=user.get.serialization.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.get.serialization.interface.js","sourceRoot":"","sources":["../../../../../../packages/user/src/interfaces/serializations/user.get.serialization.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import { ENUM_AUTH_ACCESS_FOR } from '@tc-libs/authentication';
2
+ import { IUserGetSerialization } from './user.get.serialization.interface';
3
+ export interface IUserPayloadSerialization extends Omit<IUserGetSerialization, 'Role' | 'role' | 'confirmation' | 'confirmed' | 'agreements' | 'notifications' | 'authProvidersts' | 'active' | 'authProviders' | 'inactiveDate' | 'blocked' | 'createdAt' | 'updatedAt'> {
4
+ rememberMe: boolean;
5
+ accessFor: ENUM_AUTH_ACCESS_FOR;
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=user.payload.serialization.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.payload.serialization.interface.js","sourceRoot":"","sources":["../../../../../../packages/user/src/interfaces/serializations/user.payload.serialization.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ export interface IUserResetPasswordSerialization {
2
+ success: boolean;
3
+ redirectUrl?: string;
4
+ }
5
+ export type IUserResetPasswordConfirmSerialization = IUserResetPasswordSerialization;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=user.reset-password.serialization.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.reset-password.serialization.interface.js","sourceRoot":"","sources":["../../../../../../packages/user/src/interfaces/serializations/user.reset-password.serialization.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ export * from './user.admin.service.interface';
2
+ export * from './user.auth.service.interface';
3
+ export * from './user.base.service.interface';
4
+ export * from './user.confirm.service.interface';
5
+ export * from './user.reset-password.service.interface';
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./user.admin.service.interface"), exports);
5
+ tslib_1.__exportStar(require("./user.auth.service.interface"), exports);
6
+ tslib_1.__exportStar(require("./user.base.service.interface"), exports);
7
+ tslib_1.__exportStar(require("./user.confirm.service.interface"), exports);
8
+ tslib_1.__exportStar(require("./user.reset-password.service.interface"), exports);
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/user/src/interfaces/services/index.ts"],"names":[],"mappings":";;;AAAA,yEAA+C;AAC/C,wEAA8C;AAC9C,wEAA8C;AAC9C,2EAAiD;AACjD,kFAAwD"}
@@ -0,0 +1,6 @@
1
+ import { IBaseUser } from '../user.base.interface';
2
+ import { IUserService } from './user.base.service.interface';
3
+ export interface IUserAdminService extends IUserService {
4
+ toggleConfirm(user: IBaseUser): Promise<boolean>;
5
+ toggleBlocked(user: IBaseUser): Promise<boolean>;
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=user.admin.service.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.admin.service.interface.js","sourceRoot":"","sources":["../../../../../../packages/user/src/interfaces/services/user.admin.service.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,21 @@
1
+ import { IBaseUser } from '../user.base.interface';
2
+ import { IUserPayloadSerialization } from '../serializations/user.payload.serialization.interface';
3
+ import { IUserService } from './user.base.service.interface';
4
+ export interface IUserAuthService extends IUserService {
5
+ payloadSerialization(data: any): IUserPayloadSerialization;
6
+ signin(email: string, password: string, rememberMe: boolean, ip: string, ua: string): Promise<{
7
+ tokenType: string;
8
+ expiresIn: number;
9
+ accessToken: string;
10
+ refreshToken: string;
11
+ }>;
12
+ refreshToken(user: IBaseUser, refreshToken: string, rememberMe: boolean, loginDate: Date): Promise<{
13
+ tokenType: string;
14
+ expiresIn: number;
15
+ accessToken: string;
16
+ refreshToken: string;
17
+ }>;
18
+ signup(body: any, forceConfirmed: boolean, forceRole: string | null): Promise<any>;
19
+ increasePasswordAttempt(userId: string): Promise<void>;
20
+ updateLoginDataAfterSignin(userId: string, ip: string, ua: string): Promise<void>;
21
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=user.auth.service.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.auth.service.interface.js","sourceRoot":"","sources":["../../../../../../packages/user/src/interfaces/services/user.auth.service.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ import { IService } from '@tc-libs/service';
2
+ import { IBaseUser, IUserBirthday } from '../user.base.interface';
3
+ export interface IUserService extends IService<IBaseUser> {
4
+ findByEmail(email: string): Promise<IBaseUser>;
5
+ computeBDay(day: number, month: number, year: number): IUserBirthday;
6
+ active(repository: IBaseUser): Promise<IBaseUser>;
7
+ inactive(repository: IBaseUser): Promise<IBaseUser>;
8
+ blocked(repository: IBaseUser): Promise<IBaseUser>;
9
+ unblocked(repository: IBaseUser): Promise<IBaseUser>;
10
+ joinWithRole(repository: IBaseUser): Promise<IBaseUser>;
11
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=user.base.service.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.base.service.interface.js","sourceRoot":"","sources":["../../../../../../packages/user/src/interfaces/services/user.base.service.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import { IUserConfirmResendSerialization, IUserConfirmSerialization } from '../serializations/user.confirm.serialization.interface';
2
+ import { IBaseUser } from '../user.base.interface';
3
+ import { IUserService } from './user.base.service.interface';
4
+ export interface IUserConfirmService extends IUserService {
5
+ resetConfirmCode(email: string): Promise<string>;
6
+ resendConfirm(user: IBaseUser): Promise<IUserConfirmResendSerialization>;
7
+ getUserByEmailAndConfirmCode(email: string, uuid: string): Promise<IBaseUser>;
8
+ confirm(user: IBaseUser): Promise<IUserConfirmSerialization>;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=user.confirm.service.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.confirm.service.interface.js","sourceRoot":"","sources":["../../../../../../packages/user/src/interfaces/services/user.confirm.service.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import { IUserResetPasswordDto } from '../dtos/user.reset-password.dto.interface';
2
+ import { IUserResetPasswordConfirmSerialization, IUserResetPasswordSerialization } from '../serializations/user.reset-password.serialization.interface';
3
+ import { IBaseUser } from '../user.base.interface';
4
+ import { IUserService } from './user.base.service.interface';
5
+ export interface IUserResetPasswordService extends IUserService {
6
+ getUserByEmailAndResetConfirmCode(email: string, uuid: string): Promise<IBaseUser>;
7
+ resetPassword(resetPasswordDto: IUserResetPasswordDto): Promise<IUserResetPasswordSerialization>;
8
+ confirmResetPassword(user: IBaseUser): Promise<IUserResetPasswordConfirmSerialization>;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=user.reset-password.service.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.reset-password.service.interface.js","sourceRoot":"","sources":["../../../../../../packages/user/src/interfaces/services/user.reset-password.service.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,86 @@
1
+ import { IDatabaseMongoBaseEntityAbstract } from '@tc-libs/database';
2
+ export declare enum AUTH_PROVIDERS {
3
+ LOCAL = "local",
4
+ FB = "facebook",
5
+ TW = "twitter",
6
+ GH = "github",
7
+ LI = "linkedin",
8
+ AM = "amazon",
9
+ GO = "google",
10
+ BB = "bitbucket",
11
+ MI = "microsoft",
12
+ PP = "paypal"
13
+ }
14
+ export interface IFlagAcceptance {
15
+ enabled: boolean;
16
+ ts: Date;
17
+ version: string;
18
+ }
19
+ export interface IUserNotifications {
20
+ newsletter: IFlagAcceptance;
21
+ }
22
+ export interface IUserAgreements {
23
+ terms: IFlagAcceptance;
24
+ privacy: IFlagAcceptance;
25
+ commercial: IFlagAcceptance;
26
+ }
27
+ export interface IUserBirthday {
28
+ day: number;
29
+ month: number;
30
+ year: number;
31
+ date: Date;
32
+ }
33
+ export interface IUserResetPassword {
34
+ code: string;
35
+ tmpPassword: string;
36
+ ts: Date;
37
+ }
38
+ export interface IUserPasswordHistory {
39
+ password: string;
40
+ ts: Date;
41
+ }
42
+ export interface IUserEmailConfirmation {
43
+ code: string;
44
+ ts: Date;
45
+ }
46
+ export interface IUserLoginInfo {
47
+ attempt: number;
48
+ count: number;
49
+ ip: string;
50
+ ua: string;
51
+ lastLogin: Date;
52
+ }
53
+ export interface IUserSocialInfo {
54
+ facebookId: string;
55
+ twitterId: string;
56
+ githubId: string;
57
+ linkedinId: string;
58
+ amazonId: string;
59
+ googleId: string;
60
+ bitbucketId: string;
61
+ microsoftId: string;
62
+ paypalId: string;
63
+ }
64
+ export interface IBaseUser extends IDatabaseMongoBaseEntityAbstract {
65
+ email: string;
66
+ password: string;
67
+ role: string;
68
+ firstName?: string;
69
+ lastName?: string;
70
+ lang?: string;
71
+ iddqd?: boolean;
72
+ confirmed: boolean;
73
+ blocked: boolean;
74
+ blockedDate?: Date;
75
+ active: boolean;
76
+ inactiveDate?: Date;
77
+ resetPassword?: IUserResetPassword;
78
+ confirmation: IUserEmailConfirmation;
79
+ passwordHistory?: IUserPasswordHistory[];
80
+ login?: IUserLoginInfo;
81
+ social?: IUserSocialInfo;
82
+ agreements: IUserAgreements;
83
+ notifications: IUserNotifications;
84
+ birthday?: IUserBirthday;
85
+ authProviders: string[];
86
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AUTH_PROVIDERS = void 0;
4
+ var AUTH_PROVIDERS;
5
+ (function (AUTH_PROVIDERS) {
6
+ AUTH_PROVIDERS["LOCAL"] = "local";
7
+ AUTH_PROVIDERS["FB"] = "facebook";
8
+ AUTH_PROVIDERS["TW"] = "twitter";
9
+ AUTH_PROVIDERS["GH"] = "github";
10
+ AUTH_PROVIDERS["LI"] = "linkedin";
11
+ AUTH_PROVIDERS["AM"] = "amazon";
12
+ AUTH_PROVIDERS["GO"] = "google";
13
+ AUTH_PROVIDERS["BB"] = "bitbucket";
14
+ AUTH_PROVIDERS["MI"] = "microsoft";
15
+ AUTH_PROVIDERS["PP"] = "paypal";
16
+ })(AUTH_PROVIDERS || (exports.AUTH_PROVIDERS = AUTH_PROVIDERS = {}));
17
+ //# sourceMappingURL=user.base.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.base.interface.js","sourceRoot":"","sources":["../../../../../packages/user/src/interfaces/user.base.interface.ts"],"names":[],"mappings":";;;AAEA,IAAY,cAWX;AAXD,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,iCAAe,CAAA;IACf,gCAAc,CAAA;IACd,+BAAa,CAAA;IACb,iCAAe,CAAA;IACf,+BAAa,CAAA;IACb,+BAAa,CAAA;IACb,kCAAgB,CAAA;IAChB,kCAAgB,CAAA;IAChB,+BAAa,CAAA;AACf,CAAC,EAXW,cAAc,8BAAd,cAAc,QAWzB"}