@shmidko61/cinema-contracts 1.0.4 → 1.0.6
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/auth.d.ts +18 -0
- package/dist/gen/auth.js +28 -0
- package/dist/{proto → src/proto}/paths.d.ts +1 -0
- package/dist/{proto → src/proto}/paths.js +1 -0
- package/package.json +3 -3
- package/proto/account.proto +68 -0
- package/gen/auth.ts +0 -75
- /package/dist/{index.d.ts → src/index.d.ts} +0 -0
- /package/dist/{index.js → src/index.js} +0 -0
- /package/dist/{proto → src/proto}/index.d.ts +0 -0
- /package/dist/{proto → src/proto}/index.js +0 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
export declare const protobufPackage = "auth.v1";
|
|
3
|
+
export interface SendOtpRequest {
|
|
4
|
+
identifier: string;
|
|
5
|
+
type: string;
|
|
6
|
+
}
|
|
7
|
+
export interface SendOtpResponse {
|
|
8
|
+
ok: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
11
|
+
export interface AuthServiceClient {
|
|
12
|
+
sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
|
|
13
|
+
}
|
|
14
|
+
export interface AuthServiceController {
|
|
15
|
+
sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
|
|
16
|
+
}
|
|
17
|
+
export declare function AuthServiceControllerMethods(): (constructor: Function) => void;
|
|
18
|
+
export declare const AUTH_SERVICE_NAME = "AuthService";
|
package/dist/gen/auth.js
ADDED
|
@@ -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 v6.33.2
|
|
6
|
+
// source: auth.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.AUTH_SERVICE_NAME = exports.AUTH_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
9
|
+
exports.AuthServiceControllerMethods = AuthServiceControllerMethods;
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
+
exports.protobufPackage = "auth.v1";
|
|
13
|
+
exports.AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
14
|
+
function AuthServiceControllerMethods() {
|
|
15
|
+
return function (constructor) {
|
|
16
|
+
const grpcMethods = ["sendOtp"];
|
|
17
|
+
for (const method of grpcMethods) {
|
|
18
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
19
|
+
(0, microservices_1.GrpcMethod)("AuthService", 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)("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
exports.AUTH_SERVICE_NAME = "AuthService";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shmidko61/cinema-contracts",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "Protobuf definitions and generated TS files",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
"build": "tsc -p tsconfig.build.json",
|
|
9
9
|
"generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
|
|
10
10
|
},
|
|
11
|
+
|
|
11
12
|
"files": [
|
|
12
13
|
"dist",
|
|
13
|
-
"proto"
|
|
14
|
-
"gen"
|
|
14
|
+
"proto"
|
|
15
15
|
],
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@types/node": "^25.0.3",
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package account.v1;
|
|
4
|
+
|
|
5
|
+
service AccountService {
|
|
6
|
+
rpc GetAccount (GetAccountRequest) returns (GetAccountResponse);
|
|
7
|
+
|
|
8
|
+
rpc InitEmailChange (InitEmailChangeRequest) returns (InitEmailChangeResponse);
|
|
9
|
+
rpc ConfirmEmailChange (ConfirmEmailChangeRequest) returns (ConfirmEmailChangeResponse);
|
|
10
|
+
|
|
11
|
+
rpc InitPhoneChange (InitPhoneChangeRequest) returns (InitPhoneChangeResponse);
|
|
12
|
+
rpc ConfirmPhoneChange (ConfirmPhoneChangeRequest) returns (ConfirmPhoneChangeResponse);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
message GetAccountRequest {
|
|
16
|
+
string id = 1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
message GetAccountResponse {
|
|
20
|
+
string id = 1;
|
|
21
|
+
string phone = 2;
|
|
22
|
+
string email = 3;
|
|
23
|
+
bool is_phone_verified = 4;
|
|
24
|
+
bool is_email_verified = 5;
|
|
25
|
+
Role role = 6;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
message InitEmailChangeRequest {
|
|
29
|
+
string email = 1;
|
|
30
|
+
string user_id = 2;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
message InitEmailChangeResponse {
|
|
34
|
+
bool ok = 1;
|
|
35
|
+
}
|
|
36
|
+
message ConfirmEmailChangeRequest {
|
|
37
|
+
string email = 1;
|
|
38
|
+
string code = 2;
|
|
39
|
+
string user_id = 3;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
message ConfirmEmailChangeResponse {
|
|
43
|
+
bool ok = 1;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
message InitPhoneChangeRequest {
|
|
47
|
+
string phone = 1;
|
|
48
|
+
string user_id = 2;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
message InitPhoneChangeResponse {
|
|
52
|
+
bool ok = 1;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
message ConfirmPhoneChangeRequest {
|
|
56
|
+
string phone = 1;
|
|
57
|
+
string code = 2;
|
|
58
|
+
string user_id = 3;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
message ConfirmPhoneChangeResponse {
|
|
62
|
+
bool ok = 1;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
enum Role {
|
|
66
|
+
USER = 0;
|
|
67
|
+
ADMIN =1;
|
|
68
|
+
}
|
package/gen/auth.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
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: auth.proto
|
|
6
|
-
|
|
7
|
-
/* eslint-disable */
|
|
8
|
-
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
-
import { Observable } from "rxjs";
|
|
10
|
-
|
|
11
|
-
export const protobufPackage = "auth.v1";
|
|
12
|
-
|
|
13
|
-
export interface SendOtpRequest {
|
|
14
|
-
identifier: string;
|
|
15
|
-
type: string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface SendOtpResponse {
|
|
19
|
-
ok: boolean;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface VerifyOtpRequest {
|
|
23
|
-
identifier: string;
|
|
24
|
-
type: string;
|
|
25
|
-
code: string;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface VerifyOtpResponse {
|
|
29
|
-
accessToken: string;
|
|
30
|
-
refreshToken: string;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export interface RefreshRequest {
|
|
34
|
-
refreshToken: string;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export interface RefreshResponse {
|
|
38
|
-
accessToken: string;
|
|
39
|
-
refreshToken: string;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
43
|
-
|
|
44
|
-
export interface AuthServiceClient {
|
|
45
|
-
sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
|
|
46
|
-
|
|
47
|
-
verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
|
|
48
|
-
|
|
49
|
-
refresh(request: RefreshRequest): Observable<RefreshResponse>;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export interface AuthServiceController {
|
|
53
|
-
sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
|
|
54
|
-
|
|
55
|
-
verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
|
|
56
|
-
|
|
57
|
-
refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export function AuthServiceControllerMethods() {
|
|
61
|
-
return function (constructor: Function) {
|
|
62
|
-
const grpcMethods: string[] = ["sendOtp", "verifyOtp", "refresh"];
|
|
63
|
-
for (const method of grpcMethods) {
|
|
64
|
-
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
65
|
-
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
66
|
-
}
|
|
67
|
-
const grpcStreamMethods: string[] = [];
|
|
68
|
-
for (const method of grpcStreamMethods) {
|
|
69
|
-
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
70
|
-
GrpcStreamMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export const AUTH_SERVICE_NAME = "AuthService";
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|