@aleshacinema/contracts 1.0.22 → 1.1.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.
@@ -0,0 +1 @@
1
+ export * from './otp-requested.interface.js';
@@ -0,0 +1 @@
1
+ export * from './otp-requested.interface.js';
@@ -0,0 +1,5 @@
1
+ export interface OtpRequestedInterface {
2
+ identifier: string;
3
+ type: string;
4
+ code: string;
5
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from './auth/index.js';
@@ -0,0 +1 @@
1
+ export * from './auth/index.js';
@@ -40,12 +40,28 @@ export interface TelegramVerifyResponse {
40
40
  accessToken?: string | undefined;
41
41
  refreshToken?: string | undefined;
42
42
  }
43
+ export interface TelegramCompleteRequest {
44
+ sessionId: string;
45
+ phone: string;
46
+ }
47
+ export interface TelegramCompleteResponse {
48
+ sessionId: string;
49
+ }
50
+ export interface TelegramConsumeRequest {
51
+ sessionId: string;
52
+ }
53
+ export interface TelegramConsumeResponse {
54
+ accessToken: string;
55
+ refreshToken: string;
56
+ }
43
57
  export interface AuthServiceClient {
44
58
  sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
45
59
  verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
46
60
  refresh(request: RefreshRequest): Observable<RefreshResponse>;
47
61
  telegramInit(request: Empty): Observable<TelegramInitResponse>;
48
62
  telegramVerify(request: TelegramVerifyRequest): Observable<TelegramVerifyResponse>;
63
+ telegramComplete(request: TelegramCompleteRequest): Observable<TelegramCompleteResponse>;
64
+ telegramConsume(request: TelegramConsumeRequest): Observable<TelegramConsumeResponse>;
49
65
  }
50
66
  export interface AuthServiceController {
51
67
  sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
@@ -53,6 +69,8 @@ export interface AuthServiceController {
53
69
  refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
54
70
  telegramInit(request: Empty): Promise<TelegramInitResponse> | Observable<TelegramInitResponse> | TelegramInitResponse;
55
71
  telegramVerify(request: TelegramVerifyRequest): Promise<TelegramVerifyResponse> | Observable<TelegramVerifyResponse> | TelegramVerifyResponse;
72
+ telegramComplete(request: TelegramCompleteRequest): Promise<TelegramCompleteResponse> | Observable<TelegramCompleteResponse> | TelegramCompleteResponse;
73
+ telegramConsume(request: TelegramConsumeRequest): Promise<TelegramConsumeResponse> | Observable<TelegramConsumeResponse> | TelegramConsumeResponse;
56
74
  }
57
75
  export declare function AuthServiceControllerMethods(): (constructor: Function) => void;
58
76
  export declare const AUTH_SERVICE_NAME = "AuthService";
package/dist/gen/auth.js CHANGED
@@ -7,7 +7,15 @@
7
7
  import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
8
8
  export function AuthServiceControllerMethods() {
9
9
  return function (constructor) {
10
- const grpcMethods = ["sendOtp", "verifyOtp", "refresh", "telegramInit", "telegramVerify"];
10
+ const grpcMethods = [
11
+ "sendOtp",
12
+ "verifyOtp",
13
+ "refresh",
14
+ "telegramInit",
15
+ "telegramVerify",
16
+ "telegramComplete",
17
+ "telegramConsume",
18
+ ];
11
19
  for (const method of grpcMethods) {
12
20
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
13
21
  GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export { PROTO_PATHS } from './proto/index.js';
2
2
  export type * from './gen/auth.js';
3
3
  export type * from './gen/account.js';
4
+ export type * from './events/index.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aleshacinema/contracts",
3
- "version": "1.0.22",
3
+ "version": "1.1.1",
4
4
  "description": "Protobuf definitions and generated TypeSript types",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -17,9 +17,7 @@
17
17
  "build": "yarn run generate && tsc -p tsconfig.build.json"
18
18
  },
19
19
  "files": [
20
- "dist",
21
- "proto",
22
- "gen"
20
+ "dist"
23
21
  ],
24
22
  "publishConfig": {
25
23
  "access": "public"
@@ -1,69 +0,0 @@
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
-
37
- message ConfirmEmailChangeRequest {
38
- string email = 1;
39
- string code = 2;
40
- string user_id = 3;
41
- }
42
-
43
- message ConfirmEmailChangeResponse {
44
- bool ok = 1;
45
- }
46
-
47
- message InitPhoneChangeRequest {
48
- string phone = 1;
49
- string user_id = 2;
50
- }
51
-
52
- message InitPhoneChangeResponse {
53
- bool ok = 1;
54
- }
55
-
56
- message ConfirmPhoneChangeRequest {
57
- string phone = 1;
58
- string code = 2;
59
- string user_id = 3;
60
- }
61
-
62
- message ConfirmPhoneChangeResponse {
63
- bool ok = 1;
64
- }
65
-
66
- enum Role {
67
- USER = 0;
68
- ADMIN = 1;
69
- }
package/proto/auth.proto DELETED
@@ -1,59 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package auth.v1;
4
-
5
- import "google/protobuf/empty.proto";
6
-
7
- service AuthService {
8
- rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
9
- rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
10
- rpc Refresh (RefreshRequest) returns (RefreshResponse);
11
-
12
- rpc TelegramInit (google.protobuf.Empty) returns (TelegramInitResponse);
13
- rpc TelegramVerify (TelegramVerifyRequest) returns (TelegramVerifyResponse);
14
- }
15
-
16
- message SendOtpRequest {
17
- string identifier = 1;
18
- string type = 2;
19
- }
20
-
21
- message SendOtpResponse {
22
- bool ok = 1;
23
- }
24
-
25
- message VerifyOtpRequest {
26
- string identifier = 1;
27
- string type = 2;
28
- string code = 3;
29
- }
30
-
31
- message VerifyOtpResponse {
32
- string access_token = 1;
33
- string refresh_token = 2;
34
- }
35
-
36
- message RefreshRequest {
37
- string refresh_token = 1;
38
- }
39
-
40
- message RefreshResponse {
41
- string access_token = 1;
42
- string refresh_token = 2;
43
- }
44
-
45
- message TelegramInitResponse {
46
- string url = 1;
47
- }
48
-
49
- message TelegramVerifyRequest {
50
- map<string, string> query = 1;
51
- }
52
-
53
- message TelegramVerifyResponse {
54
- oneof result {
55
- string url = 1;
56
- string access_token = 2;
57
- string refresh_token = 3;
58
- }
59
- }