@copernico/shared-contracts 0.0.1
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/README.md +7 -0
- package/package.json +15 -0
- package/src/index.d.ts +1 -0
- package/src/lib/dtos/index.d.ts +5 -0
- package/src/lib/dtos/login.dto.d.ts +7 -0
- package/src/lib/dtos/register.dto.d.ts +9 -0
- package/src/lib/entities/index.d.ts +1 -0
- package/src/lib/entities/user.entity.d.ts +13 -0
- package/src/lib/enums/action.enum.d.ts +15 -0
- package/src/lib/enums/index.d.ts +3 -0
- package/src/lib/enums/microservice.enum.d.ts +4 -0
- package/src/lib/enums/route.enum.d.ts +5 -0
- package/src/lib/errors/index.d.ts +1 -0
- package/src/lib/errors/rpc-error.interface.d.ts +5 -0
- package/src/lib/index.d.ts +12 -0
- package/src/lib/models/index.d.ts +1 -0
- package/src/lib/models/user.model.d.ts +13 -0
- package/src/lib/requests/index.d.ts +5 -0
- package/src/lib/requests/login.request.d.ts +4 -0
- package/src/lib/requests/register.request.d.ts +6 -0
- package/src/lib/responses/index.d.ts +3 -0
- package/src/lib/responses/login.response.d.ts +10 -0
- package/src/lib/responses/register.response.d.ts +8 -0
- package/src/lib/responses/user.response.d.ts +21 -0
- package/src/lib/rtos/index.d.ts +3 -0
- package/src/lib/rtos/login.rto.d.ts +7 -0
- package/src/lib/rtos/register.rto.d.ts +6 -0
- package/src/lib/rtos/user.rto.d.ts +13 -0
- package/src/lib/shared-contracts.module.d.ts +2 -0
package/README.md
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@copernico/shared-contracts",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"type": "commonjs",
|
|
5
|
+
"main": "./index.js",
|
|
6
|
+
"types": "./index.d.ts",
|
|
7
|
+
"peerDependencies": {
|
|
8
|
+
"@nestjs/common": "^11",
|
|
9
|
+
"typeorm": "^0.3",
|
|
10
|
+
"class-validator": "^0.14"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"tslib": "^2.3.0"
|
|
14
|
+
}
|
|
15
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './lib/index';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RegisterRequest } from '../requests';
|
|
2
|
+
export declare class RegisterDto {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly surname: string;
|
|
5
|
+
readonly email: string;
|
|
6
|
+
readonly password: string;
|
|
7
|
+
private constructor();
|
|
8
|
+
static fromRequest(request: RegisterRequest): RegisterDto;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './user.entity';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { UserModel } from '../models';
|
|
2
|
+
export declare class User {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly surname: string;
|
|
6
|
+
readonly email: string;
|
|
7
|
+
readonly organization: string | null;
|
|
8
|
+
readonly profile_image_url: string | null;
|
|
9
|
+
readonly subscription_id: string | null;
|
|
10
|
+
readonly monthlyAnalysisRequests: number;
|
|
11
|
+
private constructor();
|
|
12
|
+
static fromPersistence(model: UserModel): User;
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare enum Action {
|
|
2
|
+
REGISTER = "register",
|
|
3
|
+
LOGIN = "login",
|
|
4
|
+
LOGOUT = "logout",
|
|
5
|
+
CHECK_TOKEN = "check-token",
|
|
6
|
+
CREATE = "create",
|
|
7
|
+
FIND = "find",
|
|
8
|
+
FIND_ALL = "find-all",
|
|
9
|
+
UPDATE = "update",
|
|
10
|
+
DELETE = "delete",
|
|
11
|
+
UPLOAD = "upload",
|
|
12
|
+
PROCESS = "process",
|
|
13
|
+
GENERATE_REPORT = "generate-report",
|
|
14
|
+
DOWNLOAD_REPORT = "download-report"
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './rpc-error.interface';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Automatically generated by barrelsby.
|
|
3
|
+
*/
|
|
4
|
+
export * from './dtos/index';
|
|
5
|
+
export * from './entities/index';
|
|
6
|
+
export * from './enums/index';
|
|
7
|
+
export * from './errors/index';
|
|
8
|
+
export * from './models/index';
|
|
9
|
+
export * from './requests/index';
|
|
10
|
+
export * from './responses/index';
|
|
11
|
+
export * from './rtos/index';
|
|
12
|
+
export * from './shared-contracts.module';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './user.model';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { RegisterDto } from '..';
|
|
2
|
+
export declare class UserModel {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
surname: string;
|
|
6
|
+
email: string;
|
|
7
|
+
password: string;
|
|
8
|
+
organization: string | null;
|
|
9
|
+
profile_image_url: string | null;
|
|
10
|
+
subscription_id: string | null;
|
|
11
|
+
monthlyAnalysisRequests: number;
|
|
12
|
+
static createFromDto(dto: RegisterDto): UserModel;
|
|
13
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { UserResponse } from './user.response';
|
|
2
|
+
export declare class LoginResponse {
|
|
3
|
+
readonly token: string;
|
|
4
|
+
readonly user: UserResponse;
|
|
5
|
+
private constructor();
|
|
6
|
+
static fromRto(rto: {
|
|
7
|
+
token: string;
|
|
8
|
+
user: Parameters<typeof UserResponse.fromRto>[0];
|
|
9
|
+
}): LoginResponse;
|
|
10
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare class UserResponse {
|
|
2
|
+
readonly id: string;
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly surname: string;
|
|
5
|
+
readonly email: string;
|
|
6
|
+
readonly organization: string | null;
|
|
7
|
+
readonly profileImageUrl: string | null;
|
|
8
|
+
readonly subscriptionId: string | null;
|
|
9
|
+
readonly monthlyAnalysisRequests: number;
|
|
10
|
+
private constructor();
|
|
11
|
+
static fromRto(rto: {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
surname: string;
|
|
15
|
+
email: string;
|
|
16
|
+
organization: string | null;
|
|
17
|
+
profileImageUrl: string | null;
|
|
18
|
+
subscriptionId: string | null;
|
|
19
|
+
monthlyAnalysisRequests: number;
|
|
20
|
+
}): UserResponse;
|
|
21
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { User } from '../entities/user.entity';
|
|
2
|
+
export declare class UserRto {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly surname: string;
|
|
6
|
+
readonly email: string;
|
|
7
|
+
readonly organization: string | null;
|
|
8
|
+
readonly profileImageUrl: string | null;
|
|
9
|
+
readonly subscriptionId: string | null;
|
|
10
|
+
readonly monthlyAnalysisRequests: number;
|
|
11
|
+
private constructor();
|
|
12
|
+
static fromEntity(entity: User): UserRto;
|
|
13
|
+
}
|