@3d-outlet/contracts 1.2.4 → 1.3.5

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.
@@ -1,4 +1,6 @@
1
1
  export declare const PROTO_PATHS: {
2
2
  readonly AUTH: string;
3
3
  readonly ACCOUNT: string;
4
+ readonly USERS: string;
5
+ readonly MEDIA: string;
4
6
  };
@@ -4,5 +4,7 @@ exports.PROTO_PATHS = void 0;
4
4
  const path_1 = require("path");
5
5
  exports.PROTO_PATHS = {
6
6
  AUTH: (0, path_1.join)(__dirname, '../../proto/auth.proto'),
7
- ACCOUNT: (0, path_1.join)(__dirname, '../../proto/account.proto')
7
+ ACCOUNT: (0, path_1.join)(__dirname, '../../proto/account.proto'),
8
+ USERS: (0, path_1.join)(__dirname, '../../proto/users.proto'),
9
+ MEDIA: (0, path_1.join)(__dirname, '../../proto/media.proto')
8
10
  };
package/gen/ts/auth.ts CHANGED
@@ -7,6 +7,7 @@
7
7
  /* eslint-disable */
8
8
  import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
9
  import { Observable } from "rxjs";
10
+ import { Empty } from "./google/protobuf/empty";
10
11
 
11
12
  export const protobufPackage = "auth.v1";
12
13
 
@@ -39,6 +40,43 @@ export interface RefreshResponse {
39
40
  refreshToken: string;
40
41
  }
41
42
 
43
+ export interface TelegramInitResponse {
44
+ url: string;
45
+ }
46
+
47
+ export interface TelegramVerifyRequest {
48
+ query: { [key: string]: string };
49
+ }
50
+
51
+ export interface TelegramVerifyRequest_QueryEntry {
52
+ key: string;
53
+ value: string;
54
+ }
55
+
56
+ export interface TelegramVerifyResponse {
57
+ url?: string | undefined;
58
+ accessToken?: string | undefined;
59
+ refreshToken?: string | undefined;
60
+ }
61
+
62
+ export interface TelegramCompleteRequest {
63
+ sessionId: string;
64
+ phone: string;
65
+ }
66
+
67
+ export interface TelegramCompleteResponse {
68
+ sessionId: string;
69
+ }
70
+
71
+ export interface TelegramConsumeRequest {
72
+ sessionId: string;
73
+ }
74
+
75
+ export interface TelegramConsumeResponse {
76
+ accessToken: string;
77
+ refreshToken: string;
78
+ }
79
+
42
80
  export const AUTH_V1_PACKAGE_NAME = "auth.v1";
43
81
 
44
82
  export interface AuthServiceClient {
@@ -47,6 +85,14 @@ export interface AuthServiceClient {
47
85
  verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
48
86
 
49
87
  refresh(request: RefreshRequest): Observable<RefreshResponse>;
88
+
89
+ telegramInit(request: Empty): Observable<TelegramInitResponse>;
90
+
91
+ telegramVerify(request: TelegramVerifyRequest): Observable<TelegramVerifyResponse>;
92
+
93
+ telegramComplete(request: TelegramCompleteRequest): Observable<TelegramCompleteResponse>;
94
+
95
+ telegramConsume(request: TelegramConsumeRequest): Observable<TelegramConsumeResponse>;
50
96
  }
51
97
 
52
98
  export interface AuthServiceController {
@@ -55,11 +101,33 @@ export interface AuthServiceController {
55
101
  verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
56
102
 
57
103
  refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
104
+
105
+ telegramInit(request: Empty): Promise<TelegramInitResponse> | Observable<TelegramInitResponse> | TelegramInitResponse;
106
+
107
+ telegramVerify(
108
+ request: TelegramVerifyRequest,
109
+ ): Promise<TelegramVerifyResponse> | Observable<TelegramVerifyResponse> | TelegramVerifyResponse;
110
+
111
+ telegramComplete(
112
+ request: TelegramCompleteRequest,
113
+ ): Promise<TelegramCompleteResponse> | Observable<TelegramCompleteResponse> | TelegramCompleteResponse;
114
+
115
+ telegramConsume(
116
+ request: TelegramConsumeRequest,
117
+ ): Promise<TelegramConsumeResponse> | Observable<TelegramConsumeResponse> | TelegramConsumeResponse;
58
118
  }
59
119
 
60
120
  export function AuthServiceControllerMethods() {
61
121
  return function (constructor: Function) {
62
- const grpcMethods: string[] = ["sendOtp", "verifyOtp", "refresh"];
122
+ const grpcMethods: string[] = [
123
+ "sendOtp",
124
+ "verifyOtp",
125
+ "refresh",
126
+ "telegramInit",
127
+ "telegramVerify",
128
+ "telegramComplete",
129
+ "telegramConsume",
130
+ ];
63
131
  for (const method of grpcMethods) {
64
132
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
65
133
  GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
@@ -1,6 +1,6 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.8.3
3
+ // protoc-gen-ts_proto v2.10.1
4
4
  // protoc v3.21.12
5
5
  // source: google/protobuf/empty.proto
6
6
 
@@ -0,0 +1,82 @@
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
+ id: string;
23
+ }
24
+
25
+ export interface CreateUserResponse {
26
+ ok: boolean;
27
+ }
28
+
29
+ export interface PatchUserRequest {
30
+ userId: string;
31
+ name?: string | undefined;
32
+ avatar?: string | undefined;
33
+ }
34
+
35
+ export interface PatchUserResponse {
36
+ ok: boolean;
37
+ }
38
+
39
+ export interface User {
40
+ id: string;
41
+ name?: string | undefined;
42
+ phone?: string | undefined;
43
+ email?: string | undefined;
44
+ avatar?: string | undefined;
45
+ }
46
+
47
+ export const USERS_V1_PACKAGE_NAME = "users.v1";
48
+
49
+ export interface UsersServiceClient {
50
+ getMe(request: GetMeRequest): Observable<GetMeResponse>;
51
+
52
+ createUser(request: CreateUserRequest): Observable<CreateUserResponse>;
53
+
54
+ patchUser(request: PatchUserRequest): Observable<PatchUserResponse>;
55
+ }
56
+
57
+ export interface UsersServiceController {
58
+ getMe(request: GetMeRequest): Promise<GetMeResponse> | Observable<GetMeResponse> | GetMeResponse;
59
+
60
+ createUser(
61
+ request: CreateUserRequest,
62
+ ): Promise<CreateUserResponse> | Observable<CreateUserResponse> | CreateUserResponse;
63
+
64
+ patchUser(request: PatchUserRequest): Promise<PatchUserResponse> | Observable<PatchUserResponse> | PatchUserResponse;
65
+ }
66
+
67
+ export function UsersServiceControllerMethods() {
68
+ return function (constructor: Function) {
69
+ const grpcMethods: string[] = ["getMe", "createUser", "patchUser"];
70
+ for (const method of grpcMethods) {
71
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
72
+ GrpcMethod("UsersService", method)(constructor.prototype[method], method, descriptor);
73
+ }
74
+ const grpcStreamMethods: string[] = [];
75
+ for (const method of grpcStreamMethods) {
76
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
77
+ GrpcStreamMethod("UsersService", method)(constructor.prototype[method], method, descriptor);
78
+ }
79
+ };
80
+ }
81
+
82
+ export const USERS_SERVICE_NAME = "UsersService";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@3d-outlet/contracts",
3
- "version": "1.2.4",
3
+ "version": "1.3.5",
4
4
  "description": "Protobuf definitions and generated TypeScript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
package/proto/auth.proto CHANGED
@@ -2,10 +2,17 @@ syntax = "proto3";
2
2
 
3
3
  package auth.v1;
4
4
 
5
+ import "google/protobuf/empty.proto";
6
+
5
7
  service AuthService {
6
8
  rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
7
9
  rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
8
10
  rpc Refresh (RefreshRequest) returns (RefreshResponse);
11
+
12
+ rpc TelegramInit (google.protobuf.Empty) returns (TelegramInitResponse);
13
+ rpc TelegramVerify (TelegramVerifyRequest) returns (TelegramVerifyResponse);
14
+ rpc TelegramComplete (TelegramCompleteRequest) returns (TelegramCompleteResponse);
15
+ rpc TelegramConsume (TelegramConsumeRequest) returns (TelegramConsumeResponse);
9
16
  }
10
17
 
11
18
  message SendOtpRequest {
@@ -35,4 +42,39 @@ message RefreshRequest {
35
42
  message RefreshResponse {
36
43
  string access_token = 1;
37
44
  string refresh_token = 2;
45
+ }
46
+
47
+
48
+ message TelegramInitResponse {
49
+ string url = 1;
50
+ }
51
+
52
+ message TelegramVerifyRequest {
53
+ map<string, string> query = 1;
54
+ }
55
+
56
+ message TelegramVerifyResponse {
57
+ oneof result {
58
+ string url = 1;
59
+ string access_token = 2;
60
+ string refresh_token = 3;
61
+ }
62
+ }
63
+
64
+ message TelegramCompleteRequest {
65
+ string session_id = 1;
66
+ string phone = 2;
67
+ }
68
+
69
+ message TelegramCompleteResponse {
70
+ string session_id = 1;
71
+ }
72
+
73
+ message TelegramConsumeRequest {
74
+ string session_id = 1;
75
+ }
76
+
77
+ message TelegramConsumeResponse {
78
+ string access_token = 1;
79
+ string refresh_token = 2;
38
80
  }
@@ -0,0 +1,45 @@
1
+ syntax = "proto3";
2
+
3
+ package users.v1;
4
+
5
+ service UsersService {
6
+ rpc GetMe (GetMeRequest) returns (GetMeResponse);
7
+
8
+ rpc CreateUser (CreateUserRequest) returns (CreateUserResponse);
9
+ rpc PatchUser (PatchUserRequest) returns (PatchUserResponse);
10
+ }
11
+
12
+ message GetMeRequest {
13
+ string id = 1;
14
+ }
15
+
16
+ message GetMeResponse {
17
+ User user = 1;
18
+ }
19
+
20
+ message CreateUserRequest {
21
+ string id = 1;
22
+ }
23
+
24
+ message CreateUserResponse {
25
+ bool ok = 1;
26
+ }
27
+
28
+ message PatchUserRequest {
29
+ string user_id = 1;
30
+
31
+ optional string name = 2;
32
+ optional string avatar = 3;
33
+ }
34
+
35
+ message PatchUserResponse {
36
+ bool ok = 1;
37
+ }
38
+
39
+ message User {
40
+ string id = 1;
41
+ optional string name = 2;
42
+ optional string phone = 3;
43
+ optional string email = 4;
44
+ optional string avatar = 5;
45
+ }