@thiscargo/contracts 0.0.10 → 0.0.12
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/gen/account.ts +12 -12
- package/gen/company.ts +30 -0
- package/gen/role.ts +39 -0
- package/gen/server.ts +33 -0
- package/package.json +1 -1
- package/proto/account.proto +19 -16
- package/proto/company.proto +24 -0
- package/proto/role.proto +34 -0
- package/proto/server.proto +25 -0
package/gen/account.ts
CHANGED
|
@@ -8,37 +8,37 @@
|
|
|
8
8
|
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
9
|
import { Observable } from "rxjs";
|
|
10
10
|
import { Timestamp } from "./google/protobuf/timestamp";
|
|
11
|
+
import { RoleResponse } from "./role";
|
|
11
12
|
|
|
12
13
|
export const protobufPackage = "account.v1";
|
|
13
14
|
|
|
14
|
-
export interface
|
|
15
|
-
id: string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface GetAccountResponse {
|
|
15
|
+
export interface AccountResponse {
|
|
19
16
|
id: string;
|
|
20
|
-
companyId?: string | undefined;
|
|
21
17
|
tId?: number | undefined;
|
|
18
|
+
companyId?: string | undefined;
|
|
19
|
+
roleId?: string | undefined;
|
|
20
|
+
phone: string;
|
|
22
21
|
firstName: string;
|
|
23
22
|
lastName: string;
|
|
24
23
|
middleName?: string | undefined;
|
|
25
|
-
phone: string;
|
|
26
|
-
roleId: string;
|
|
27
24
|
isActive: boolean;
|
|
28
25
|
createdAt: Timestamp | undefined;
|
|
29
26
|
updatedAt: Timestamp | undefined;
|
|
27
|
+
role?: RoleResponse | undefined;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface GetAccountRequest {
|
|
31
|
+
id: string;
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
|
|
33
35
|
|
|
34
36
|
export interface AccountServiceClient {
|
|
35
|
-
getAccount(request: GetAccountRequest): Observable<
|
|
37
|
+
getAccount(request: GetAccountRequest): Observable<AccountResponse>;
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
export interface AccountServiceController {
|
|
39
|
-
getAccount(
|
|
40
|
-
request: GetAccountRequest,
|
|
41
|
-
): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
|
|
41
|
+
getAccount(request: GetAccountRequest): Promise<AccountResponse> | Observable<AccountResponse> | AccountResponse;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
export function AccountServiceControllerMethods() {
|
package/gen/company.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.2
|
|
4
|
+
// protoc v6.33.5
|
|
5
|
+
// source: company.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { AccountResponse } from "./account";
|
|
9
|
+
import { Timestamp } from "./google/protobuf/timestamp";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "company.v1";
|
|
12
|
+
|
|
13
|
+
export interface CompanyResponse {
|
|
14
|
+
id: string;
|
|
15
|
+
serverId: string;
|
|
16
|
+
name: string;
|
|
17
|
+
phone: string;
|
|
18
|
+
address: string;
|
|
19
|
+
botToken: string;
|
|
20
|
+
createdAt: Timestamp | undefined;
|
|
21
|
+
updatedAt: Timestamp | undefined;
|
|
22
|
+
accounts: AccountResponse[];
|
|
23
|
+
Count?: CompanyResponse_CompanyCount | undefined;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface CompanyResponse_CompanyCount {
|
|
27
|
+
accounts: number;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const COMPANY_V1_PACKAGE_NAME = "company.v1";
|
package/gen/role.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.2
|
|
4
|
+
// protoc v6.33.5
|
|
5
|
+
// source: role.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { Timestamp } from "./google/protobuf/timestamp";
|
|
9
|
+
|
|
10
|
+
export const protobufPackage = "role.v1";
|
|
11
|
+
|
|
12
|
+
export interface RoleResponse {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
createdAt: Timestamp | undefined;
|
|
16
|
+
updatedAt: Timestamp | undefined;
|
|
17
|
+
permissions: PermissionResponse[];
|
|
18
|
+
Count?: RoleResponse_RoleCount | undefined;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface RoleResponse_RoleCount {
|
|
22
|
+
accounts: number;
|
|
23
|
+
permissions: number;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface PermissionResponse {
|
|
27
|
+
id: string;
|
|
28
|
+
name: string;
|
|
29
|
+
createdAt: Timestamp | undefined;
|
|
30
|
+
updatedAt: Timestamp | undefined;
|
|
31
|
+
roles: RoleResponse[];
|
|
32
|
+
Count?: PermissionResponse_PermissionCount | undefined;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface PermissionResponse_PermissionCount {
|
|
36
|
+
roles: number;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const ROLE_V1_PACKAGE_NAME = "role.v1";
|
package/gen/server.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.2
|
|
4
|
+
// protoc v6.33.5
|
|
5
|
+
// source: server.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { CompanyResponse } from "./company";
|
|
9
|
+
import { Timestamp } from "./google/protobuf/timestamp";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "server.v1";
|
|
12
|
+
|
|
13
|
+
export interface Server {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
host: string;
|
|
17
|
+
port: number;
|
|
18
|
+
isActive: boolean;
|
|
19
|
+
createdAt: Timestamp | undefined;
|
|
20
|
+
updatedAt:
|
|
21
|
+
| Timestamp
|
|
22
|
+
| undefined;
|
|
23
|
+
/** Связи */
|
|
24
|
+
companies: CompanyResponse[];
|
|
25
|
+
Count?: Server_ServerCount | undefined;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Метаданные Prisma _count */
|
|
29
|
+
export interface Server_ServerCount {
|
|
30
|
+
companies: number;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const SERVER_V1_PACKAGE_NAME = "server.v1";
|
package/package.json
CHANGED
package/proto/account.proto
CHANGED
|
@@ -2,26 +2,29 @@ syntax = "proto3";
|
|
|
2
2
|
|
|
3
3
|
package account.v1;
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import "google/protobuf/timestamp.proto";
|
|
6
|
+
import "role.proto";
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
message AccountResponse {
|
|
9
|
+
string id = 1;
|
|
10
|
+
optional int64 t_id = 2;
|
|
11
|
+
optional string company_id = 3;
|
|
12
|
+
optional string role_id = 4;
|
|
13
|
+
string phone = 5;
|
|
14
|
+
string first_name = 6;
|
|
15
|
+
string last_name = 7;
|
|
16
|
+
optional string middle_name = 8;
|
|
17
|
+
bool is_active = 9;
|
|
18
|
+
google.protobuf.Timestamp created_at = 10;
|
|
19
|
+
google.protobuf.Timestamp updated_at = 11;
|
|
20
|
+
|
|
21
|
+
optional role.v1.RoleResponse role = 13;
|
|
9
22
|
}
|
|
10
23
|
|
|
11
|
-
|
|
12
|
-
|
|
24
|
+
service AccountService {
|
|
25
|
+
rpc GetAccount(GetAccountRequest) returns (AccountResponse);
|
|
13
26
|
}
|
|
14
27
|
|
|
15
|
-
message
|
|
28
|
+
message GetAccountRequest {
|
|
16
29
|
string id = 1;
|
|
17
|
-
optional string company_id = 2;
|
|
18
|
-
optional int64 t_id = 3;
|
|
19
|
-
string first_name = 4;
|
|
20
|
-
string last_name = 5;
|
|
21
|
-
optional string middle_name = 6;
|
|
22
|
-
string phone = 7;
|
|
23
|
-
string role_id = 8;
|
|
24
|
-
bool is_active = 9;
|
|
25
|
-
google.protobuf.Timestamp created_at = 10;
|
|
26
|
-
google.protobuf.Timestamp updated_at = 11;
|
|
27
30
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package company.v1;
|
|
4
|
+
|
|
5
|
+
import "google/protobuf/timestamp.proto";
|
|
6
|
+
import "account.proto";
|
|
7
|
+
|
|
8
|
+
message CompanyResponse {
|
|
9
|
+
string id = 1;
|
|
10
|
+
string server_id = 2;
|
|
11
|
+
string name = 3;
|
|
12
|
+
string phone = 4;
|
|
13
|
+
string address = 5;
|
|
14
|
+
string bot_token = 6;
|
|
15
|
+
google.protobuf.Timestamp created_at = 7;
|
|
16
|
+
google.protobuf.Timestamp updated_at = 8;
|
|
17
|
+
|
|
18
|
+
repeated account.v1.AccountResponse accounts = 10;
|
|
19
|
+
|
|
20
|
+
message CompanyCount {
|
|
21
|
+
int32 accounts = 1;
|
|
22
|
+
}
|
|
23
|
+
optional CompanyCount _count = 11;
|
|
24
|
+
}
|
package/proto/role.proto
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package role.v1;
|
|
4
|
+
|
|
5
|
+
import "google/protobuf/timestamp.proto";
|
|
6
|
+
|
|
7
|
+
message RoleResponse {
|
|
8
|
+
string id = 1;
|
|
9
|
+
string name = 2;
|
|
10
|
+
google.protobuf.Timestamp created_at = 3;
|
|
11
|
+
google.protobuf.Timestamp updated_at = 4;
|
|
12
|
+
|
|
13
|
+
repeated PermissionResponse permissions = 5;
|
|
14
|
+
|
|
15
|
+
message RoleCount {
|
|
16
|
+
int32 accounts = 1;
|
|
17
|
+
int32 permissions = 2;
|
|
18
|
+
}
|
|
19
|
+
optional RoleCount _count = 6;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
message PermissionResponse {
|
|
23
|
+
string id = 1;
|
|
24
|
+
string name = 2;
|
|
25
|
+
google.protobuf.Timestamp created_at = 3;
|
|
26
|
+
google.protobuf.Timestamp updated_at = 4;
|
|
27
|
+
|
|
28
|
+
repeated RoleResponse roles = 6;
|
|
29
|
+
|
|
30
|
+
message PermissionCount {
|
|
31
|
+
int32 roles = 1;
|
|
32
|
+
}
|
|
33
|
+
optional PermissionCount _count = 7;
|
|
34
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package server.v1;
|
|
4
|
+
|
|
5
|
+
import "google/protobuf/timestamp.proto";
|
|
6
|
+
import "company.proto"; // Импорт для связи
|
|
7
|
+
|
|
8
|
+
message Server {
|
|
9
|
+
string id = 1;
|
|
10
|
+
string name = 2;
|
|
11
|
+
string host = 3;
|
|
12
|
+
int32 port = 4;
|
|
13
|
+
bool is_active = 5;
|
|
14
|
+
google.protobuf.Timestamp created_at = 6;
|
|
15
|
+
google.protobuf.Timestamp updated_at = 7;
|
|
16
|
+
|
|
17
|
+
// Связи
|
|
18
|
+
repeated company.v1.CompanyResponse companies = 9;
|
|
19
|
+
|
|
20
|
+
// Метаданные Prisma _count
|
|
21
|
+
message ServerCount {
|
|
22
|
+
int32 companies = 1;
|
|
23
|
+
}
|
|
24
|
+
optional ServerCount _count = 10;
|
|
25
|
+
}
|