@citec-spbu/contracts 1.0.7 → 1.0.8
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/dist/gen/ts/users.d.ts +31 -0
- package/dist/gen/ts/users.js +28 -0
- package/dist/proto/paths.d.ts +1 -0
- package/dist/proto/paths.js +1 -0
- package/gen/ts/users.ts +67 -0
- package/package.json +1 -1
- package/proto/users.proto +31 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
export declare const protobufPackage = "users.v1";
|
|
3
|
+
export interface GetMeRequest {
|
|
4
|
+
id: string;
|
|
5
|
+
}
|
|
6
|
+
export interface GetMeResponse {
|
|
7
|
+
user: User | undefined;
|
|
8
|
+
}
|
|
9
|
+
export interface CreateUserRequest {
|
|
10
|
+
user: User | undefined;
|
|
11
|
+
}
|
|
12
|
+
export interface CreateUserResponse {
|
|
13
|
+
ok: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface User {
|
|
16
|
+
id: string;
|
|
17
|
+
username: string;
|
|
18
|
+
profileUrl: string;
|
|
19
|
+
avatarUrl: string;
|
|
20
|
+
}
|
|
21
|
+
export declare const USERS_V1_PACKAGE_NAME = "users.v1";
|
|
22
|
+
export interface UsersServiceClient {
|
|
23
|
+
getMe(request: GetMeRequest): Observable<GetMeResponse>;
|
|
24
|
+
createUser(request: CreateUserRequest): Observable<CreateUserResponse>;
|
|
25
|
+
}
|
|
26
|
+
export interface UsersServiceController {
|
|
27
|
+
getMe(request: GetMeRequest): Promise<GetMeResponse> | Observable<GetMeResponse> | GetMeResponse;
|
|
28
|
+
createUser(request: CreateUserRequest): Promise<CreateUserResponse> | Observable<CreateUserResponse> | CreateUserResponse;
|
|
29
|
+
}
|
|
30
|
+
export declare function UsersServiceControllerMethods(): (constructor: Function) => void;
|
|
31
|
+
export declare const USERS_SERVICE_NAME = "UsersService";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.10.1
|
|
5
|
+
// protoc v3.21.12
|
|
6
|
+
// source: users.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.USERS_SERVICE_NAME = exports.USERS_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
9
|
+
exports.UsersServiceControllerMethods = UsersServiceControllerMethods;
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
+
exports.protobufPackage = "users.v1";
|
|
13
|
+
exports.USERS_V1_PACKAGE_NAME = "users.v1";
|
|
14
|
+
function UsersServiceControllerMethods() {
|
|
15
|
+
return function (constructor) {
|
|
16
|
+
const grpcMethods = ["getMe", "createUser"];
|
|
17
|
+
for (const method of grpcMethods) {
|
|
18
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
19
|
+
(0, microservices_1.GrpcMethod)("UsersService", method)(constructor.prototype[method], method, descriptor);
|
|
20
|
+
}
|
|
21
|
+
const grpcStreamMethods = [];
|
|
22
|
+
for (const method of grpcStreamMethods) {
|
|
23
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
24
|
+
(0, microservices_1.GrpcStreamMethod)("UsersService", method)(constructor.prototype[method], method, descriptor);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
exports.USERS_SERVICE_NAME = "UsersService";
|
package/dist/proto/paths.d.ts
CHANGED
package/dist/proto/paths.js
CHANGED
|
@@ -5,4 +5,5 @@ const node_path_1 = require("node:path");
|
|
|
5
5
|
exports.PROTO_PATHS = {
|
|
6
6
|
AUTH: (0, node_path_1.join)(__dirname, "../../proto/auth.proto"),
|
|
7
7
|
ACCOUNT: (0, node_path_1.join)(__dirname, "../../proto/account.proto"),
|
|
8
|
+
USERS: (0, node_path_1.join)(__dirname, "../../proto/auth.proto"),
|
|
8
9
|
};
|
package/gen/ts/users.ts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.10.1
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
// source: users.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "users.v1";
|
|
12
|
+
|
|
13
|
+
export interface GetMeRequest {
|
|
14
|
+
id: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface GetMeResponse {
|
|
18
|
+
user: User | undefined;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface CreateUserRequest {
|
|
22
|
+
user: User | undefined;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface CreateUserResponse {
|
|
26
|
+
ok: boolean;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface User {
|
|
30
|
+
id: string;
|
|
31
|
+
username: string;
|
|
32
|
+
profileUrl: string;
|
|
33
|
+
avatarUrl: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const USERS_V1_PACKAGE_NAME = "users.v1";
|
|
37
|
+
|
|
38
|
+
export interface UsersServiceClient {
|
|
39
|
+
getMe(request: GetMeRequest): Observable<GetMeResponse>;
|
|
40
|
+
|
|
41
|
+
createUser(request: CreateUserRequest): Observable<CreateUserResponse>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface UsersServiceController {
|
|
45
|
+
getMe(request: GetMeRequest): Promise<GetMeResponse> | Observable<GetMeResponse> | GetMeResponse;
|
|
46
|
+
|
|
47
|
+
createUser(
|
|
48
|
+
request: CreateUserRequest,
|
|
49
|
+
): Promise<CreateUserResponse> | Observable<CreateUserResponse> | CreateUserResponse;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function UsersServiceControllerMethods() {
|
|
53
|
+
return function (constructor: Function) {
|
|
54
|
+
const grpcMethods: string[] = ["getMe", "createUser"];
|
|
55
|
+
for (const method of grpcMethods) {
|
|
56
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
57
|
+
GrpcMethod("UsersService", method)(constructor.prototype[method], method, descriptor);
|
|
58
|
+
}
|
|
59
|
+
const grpcStreamMethods: string[] = [];
|
|
60
|
+
for (const method of grpcStreamMethods) {
|
|
61
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
62
|
+
GrpcStreamMethod("UsersService", method)(constructor.prototype[method], method, descriptor);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export const USERS_SERVICE_NAME = "UsersService";
|
package/package.json
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package users.v1;
|
|
4
|
+
|
|
5
|
+
service UsersService {
|
|
6
|
+
rpc GetMe(GetMeRequest) returns (GetMeResponse);
|
|
7
|
+
rpc CreateUser(CreateUserRequest) returns (CreateUserResponse);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
message GetMeRequest {
|
|
11
|
+
string id = 1;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
message GetMeResponse {
|
|
15
|
+
User user = 1;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
message CreateUserRequest {
|
|
19
|
+
User user = 1;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
message CreateUserResponse {
|
|
23
|
+
bool ok = 1;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
message User {
|
|
27
|
+
string id = 1;
|
|
28
|
+
string username = 2;
|
|
29
|
+
string profile_url = 3;
|
|
30
|
+
string avatar_url = 4;
|
|
31
|
+
}
|