@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 ADDED
@@ -0,0 +1,7 @@
1
+ # shared-contracts
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Building
6
+
7
+ Run `nx build shared-contracts` to build the library.
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,5 @@
1
+ /**
2
+ * @file Automatically generated by barrelsby.
3
+ */
4
+ export * from './login.dto';
5
+ export * from './register.dto';
@@ -0,0 +1,7 @@
1
+ import { LoginRequest } from '../requests';
2
+ export declare class LoginDto {
3
+ readonly email: string;
4
+ readonly password: string;
5
+ private constructor();
6
+ static fromRequest(request: LoginRequest): LoginDto;
7
+ }
@@ -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,3 @@
1
+ export * from './action.enum';
2
+ export * from './microservice.enum';
3
+ export * from './route.enum';
@@ -0,0 +1,4 @@
1
+ export declare enum Microservice {
2
+ AUTHENTICATION = "authentication",
3
+ SCORE = "score"
4
+ }
@@ -0,0 +1,5 @@
1
+ export declare enum Route {
2
+ AUTH = "auth",
3
+ USERS = "users",
4
+ SCORES = "scores"
5
+ }
@@ -0,0 +1 @@
1
+ export * from './rpc-error.interface';
@@ -0,0 +1,5 @@
1
+ export interface RpcError {
2
+ statusCode: number;
3
+ message: string;
4
+ details?: unknown;
5
+ }
@@ -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,5 @@
1
+ /**
2
+ * @file Automatically generated by barrelsby.
3
+ */
4
+ export * from './login.request';
5
+ export * from './register.request';
@@ -0,0 +1,4 @@
1
+ export declare class LoginRequest {
2
+ email: string;
3
+ password: string;
4
+ }
@@ -0,0 +1,6 @@
1
+ export declare class RegisterRequest {
2
+ name: string;
3
+ surname: string;
4
+ email: string;
5
+ password: string;
6
+ }
@@ -0,0 +1,3 @@
1
+ export * from './user.response';
2
+ export * from './register.response';
3
+ export * from './login.response';
@@ -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,8 @@
1
+ import { UserResponse } from './user.response';
2
+ export declare class RegisterResponse {
3
+ readonly user: UserResponse;
4
+ private constructor();
5
+ static fromRto(rto: {
6
+ user: Parameters<typeof UserResponse.fromRto>[0];
7
+ }): RegisterResponse;
8
+ }
@@ -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,3 @@
1
+ export * from './login.rto';
2
+ export * from './user.rto';
3
+ export * from './register.rto';
@@ -0,0 +1,7 @@
1
+ import { UserRto } from './user.rto';
2
+ export declare class LoginRto {
3
+ readonly token: string;
4
+ readonly user: UserRto;
5
+ private constructor();
6
+ static fromToken(token: string, user: UserRto): LoginRto;
7
+ }
@@ -0,0 +1,6 @@
1
+ import { UserRto } from './user.rto';
2
+ export declare class RegisterRto {
3
+ readonly user: UserRto;
4
+ private constructor();
5
+ static fromSignUp(user: UserRto): RegisterRto;
6
+ }
@@ -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
+ }
@@ -0,0 +1,2 @@
1
+ export declare class SharedContractsModule {
2
+ }