@ubs-platform/users-common 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- package/.eslintrc.json +25 -0
- package/LICENSE +21 -0
- package/README.md +7 -0
- package/jest.config.ts +11 -0
- package/package.json +20 -0
- package/project.json +23 -0
- package/src/index.ts +1 -0
- package/src/lib/dto/error-consts.ts +7 -0
- package/src/lib/dto/error-informations.ts +3 -0
- package/src/lib/dto/index.ts +12 -0
- package/src/lib/dto/password-change-dto.ts +4 -0
- package/src/lib/dto/user-admin-dto.ts +11 -0
- package/src/lib/dto/user-auth-status.model.ts +16 -0
- package/src/lib/dto/user-auth.model.ts +4 -0
- package/src/lib/dto/user-create-dto.ts +13 -0
- package/src/lib/dto/user-dto.ts +10 -0
- package/src/lib/dto/user-full-dto.ts +35 -0
- package/src/lib/dto/user-general-info-dto.ts +12 -0
- package/src/lib/dto/user-minimalized.dto.ts +5 -0
- package/src/lib/dto/user-register.model.ts +7 -0
- package/tsconfig.json +26 -0
- package/tsconfig.lib.json +10 -0
- package/tsconfig.spec.json +14 -0
package/.eslintrc.json
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
{
|
2
|
+
"extends": ["../../.eslintrc.base.json"],
|
3
|
+
"ignorePatterns": ["!**/*"],
|
4
|
+
"overrides": [
|
5
|
+
{
|
6
|
+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
7
|
+
"rules": {}
|
8
|
+
},
|
9
|
+
{
|
10
|
+
"files": ["*.ts", "*.tsx"],
|
11
|
+
"rules": {}
|
12
|
+
},
|
13
|
+
{
|
14
|
+
"files": ["*.js", "*.jsx"],
|
15
|
+
"rules": {}
|
16
|
+
},
|
17
|
+
{
|
18
|
+
"files": ["*.json"],
|
19
|
+
"parser": "jsonc-eslint-parser",
|
20
|
+
"rules": {
|
21
|
+
"@nx/dependency-checks": "error"
|
22
|
+
}
|
23
|
+
}
|
24
|
+
]
|
25
|
+
}
|
package/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2024 UBS Platform
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
package/jest.config.ts
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
/* eslint-disable */
|
2
|
+
export default {
|
3
|
+
displayName: 'nest-microservice-setup-util',
|
4
|
+
preset: '../../jest.preset.js',
|
5
|
+
testEnvironment: 'node',
|
6
|
+
transform: {
|
7
|
+
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
|
8
|
+
},
|
9
|
+
moduleFileExtensions: ['ts', 'js', 'html'],
|
10
|
+
coverageDirectory: '../../coverage/libs/nest-microservice-setup-util',
|
11
|
+
};
|
package/package.json
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
{
|
2
|
+
"name": "@ubs-platform/users-common",
|
3
|
+
"version": "1.0.6",
|
4
|
+
"dependencies": {
|
5
|
+
"tslib": "^2.3.0"
|
6
|
+
},
|
7
|
+
"devDependencies": {
|
8
|
+
"typescript": "~5.3.2",
|
9
|
+
"@types/node": "~18.16.9"
|
10
|
+
},
|
11
|
+
"publishConfig": {
|
12
|
+
"access": "public"
|
13
|
+
},
|
14
|
+
"scripts": {
|
15
|
+
"build": "tsc",
|
16
|
+
"build-publish": "npm run build && npm publish"
|
17
|
+
},
|
18
|
+
"type": "commonjs",
|
19
|
+
"main": "./dist/index.js"
|
20
|
+
}
|
package/project.json
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
{
|
2
|
+
"name": "users-common",
|
3
|
+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
4
|
+
"sourceRoot": "libs/users-common/src",
|
5
|
+
"projectType": "library",
|
6
|
+
"targets": {
|
7
|
+
"build": {
|
8
|
+
"executor": "@nx/js:tsc",
|
9
|
+
"outputs": ["{options.outputPath}"],
|
10
|
+
"options": {
|
11
|
+
"outputPath": "dist/libs/users-common",
|
12
|
+
"main": "libs/users-common/src/index.ts",
|
13
|
+
"tsConfig": "libs/users-common/tsconfig.lib.json",
|
14
|
+
"assets": ["libs/users-common/*.md"]
|
15
|
+
}
|
16
|
+
},
|
17
|
+
"publish": {
|
18
|
+
"command": "node tools/scripts/publish.mjs users-common {args.ver} {args.tag}",
|
19
|
+
"dependsOn": ["build"]
|
20
|
+
}
|
21
|
+
},
|
22
|
+
"tags": []
|
23
|
+
}
|
package/src/index.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export * from './lib/dto';
|
@@ -0,0 +1,7 @@
|
|
1
|
+
export class UBSUsersErrorConsts {
|
2
|
+
static readonly EXIST_USERNAME = 'exist-username';
|
3
|
+
static readonly EXIST_PRIMARY_MAIL = 'exist-primary-mail';
|
4
|
+
static readonly EMPTY_DATA = 'empty-data';
|
5
|
+
static readonly AUTHENTICATION_FAIL = 'fail-authentication';
|
6
|
+
static readonly USER_NOTFOUND = 'notfound-user';
|
7
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
export * from './user-auth.model';
|
2
|
+
export * from './user-auth-status.model';
|
3
|
+
export * from './user-register.model';
|
4
|
+
export * from './error-consts';
|
5
|
+
export * from './user-general-info-dto';
|
6
|
+
export * from './user-dto';
|
7
|
+
export * from './user-admin-dto';
|
8
|
+
export * from './user-minimalized.dto';
|
9
|
+
export * from './user-create-dto';
|
10
|
+
export * from './password-change-dto';
|
11
|
+
export * from './user-full-dto';
|
12
|
+
export * from './error-informations';
|
@@ -0,0 +1,16 @@
|
|
1
|
+
export interface UserAuthStatus {
|
2
|
+
success: boolean;
|
3
|
+
message: string;
|
4
|
+
token?: string;
|
5
|
+
}
|
6
|
+
|
7
|
+
export class UserAuthSuccess implements UserAuthStatus {
|
8
|
+
constructor(public token?: string) {}
|
9
|
+
success = true;
|
10
|
+
message = 'User login is success';
|
11
|
+
}
|
12
|
+
|
13
|
+
export class UserAuthFail implements UserAuthStatus {
|
14
|
+
success = false;
|
15
|
+
message = 'Username or Password is wrong';
|
16
|
+
}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
export interface UserFullDto {
|
2
|
+
_id?: any;
|
3
|
+
|
4
|
+
username: string;
|
5
|
+
|
6
|
+
primaryEmail: string;
|
7
|
+
|
8
|
+
name: string;
|
9
|
+
|
10
|
+
surname: string;
|
11
|
+
|
12
|
+
country: string;
|
13
|
+
|
14
|
+
state: string;
|
15
|
+
|
16
|
+
city: string;
|
17
|
+
|
18
|
+
district: string;
|
19
|
+
|
20
|
+
gender: string;
|
21
|
+
|
22
|
+
pronounce: string;
|
23
|
+
|
24
|
+
roles: string[];
|
25
|
+
|
26
|
+
webSites: string[];
|
27
|
+
|
28
|
+
active: boolean;
|
29
|
+
|
30
|
+
suspended: boolean;
|
31
|
+
|
32
|
+
suspendReason: string;
|
33
|
+
|
34
|
+
password?: string;
|
35
|
+
}
|
package/tsconfig.json
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
{
|
2
|
+
"compileOnSave": false,
|
3
|
+
"compilerOptions": {
|
4
|
+
"rootDir": "./src",
|
5
|
+
"sourceMap": true,
|
6
|
+
"moduleResolution": "node",
|
7
|
+
"emitDecoratorMetadata": true,
|
8
|
+
"experimentalDecorators": true,
|
9
|
+
"importHelpers": true,
|
10
|
+
"target": "es2015",
|
11
|
+
"module": "commonjs",
|
12
|
+
"outDir": "./dist",
|
13
|
+
"lib": ["es2020", "dom"],
|
14
|
+
"skipLibCheck": true,
|
15
|
+
"skipDefaultLibCheck": true,
|
16
|
+
"declaration": true,
|
17
|
+
},
|
18
|
+
"exclude": [
|
19
|
+
"node_modules",
|
20
|
+
"tmp",
|
21
|
+
"jest.config.ts",
|
22
|
+
"src/**/*.spec.ts",
|
23
|
+
"src/**/*.test.ts"
|
24
|
+
],
|
25
|
+
"include": ["src/**/*.ts"]
|
26
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
{
|
2
|
+
"extends": "./tsconfig.json",
|
3
|
+
"compilerOptions": {
|
4
|
+
"outDir": "../../dist/out-tsc",
|
5
|
+
"module": "commonjs",
|
6
|
+
"types": ["jest", "node"]
|
7
|
+
},
|
8
|
+
"include": [
|
9
|
+
"jest.config.ts",
|
10
|
+
"src/**/*.test.ts",
|
11
|
+
"src/**/*.spec.ts",
|
12
|
+
"src/**/*.d.ts"
|
13
|
+
]
|
14
|
+
}
|