@3d-outlet/contracts 1.1.4 → 1.3.4

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,4 @@
1
+ export interface EmailChangedEvent {
2
+ email: string;
3
+ code: string;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from './email-changed.interface';
2
+ export * from './phone-changed.interface';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./email-changed.interface"), exports);
18
+ __exportStar(require("./phone-changed.interface"), exports);
@@ -0,0 +1,4 @@
1
+ export interface PhoneChangedEvent {
2
+ phone: string;
3
+ code: string;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +1,2 @@
1
+ export * from './account';
1
2
  export * from './auth';
@@ -14,4 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./account"), exports);
17
18
  __exportStar(require("./auth"), exports);
@@ -1,3 +1,6 @@
1
1
  export declare const PROTO_PATHS: {
2
2
  readonly AUTH: string;
3
+ readonly ACCOUNT: string;
4
+ readonly USERS: string;
5
+ readonly MEDIA: string;
3
6
  };
@@ -3,5 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PROTO_PATHS = void 0;
4
4
  const path_1 = require("path");
5
5
  exports.PROTO_PATHS = {
6
- AUTH: (0, path_1.join)(__dirname, '../../proto/auth.proto')
6
+ AUTH: (0, path_1.join)(__dirname, '../../proto/auth.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')
7
10
  };
@@ -0,0 +1,128 @@
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: account.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+
11
+ export const protobufPackage = "account.v1";
12
+
13
+ export enum Role {
14
+ USER = 0,
15
+ ADMIN = 1,
16
+ DESIGNER = 2,
17
+ UNRECOGNIZED = -1,
18
+ }
19
+
20
+ export interface GetAccountRequest {
21
+ id: string;
22
+ }
23
+
24
+ export interface GetAccountResponse {
25
+ id: string;
26
+ phone: string;
27
+ email: string;
28
+ isPhoneVerified: boolean;
29
+ isEmailVerified: boolean;
30
+ role: Role;
31
+ }
32
+
33
+ export interface InitEmailChangeRequest {
34
+ email: string;
35
+ userId: string;
36
+ }
37
+
38
+ export interface InitEmailChangeResponse {
39
+ ok: boolean;
40
+ }
41
+
42
+ export interface ConfirmEmailChangeRequest {
43
+ email: string;
44
+ code: string;
45
+ userId: string;
46
+ }
47
+
48
+ export interface ConfirmEmailChangeResponse {
49
+ ok: boolean;
50
+ }
51
+
52
+ export interface InitPhoneChangeRequest {
53
+ phone: string;
54
+ userId: string;
55
+ }
56
+
57
+ export interface InitPhoneChangeResponse {
58
+ ok: boolean;
59
+ }
60
+
61
+ export interface ConfirmPhoneChangeRequest {
62
+ phone: string;
63
+ code: string;
64
+ userId: string;
65
+ }
66
+
67
+ export interface ConfirmPhoneChangeResponse {
68
+ ok: boolean;
69
+ }
70
+
71
+ export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
72
+
73
+ export interface AccountServiceClient {
74
+ getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
75
+
76
+ initEmailChange(request: InitEmailChangeRequest): Observable<InitEmailChangeResponse>;
77
+
78
+ confirmEmailChange(request: ConfirmEmailChangeRequest): Observable<ConfirmEmailChangeResponse>;
79
+
80
+ initPhoneChange(request: InitPhoneChangeRequest): Observable<InitPhoneChangeResponse>;
81
+
82
+ confirmPhoneChange(request: ConfirmPhoneChangeRequest): Observable<ConfirmPhoneChangeResponse>;
83
+ }
84
+
85
+ export interface AccountServiceController {
86
+ getAccount(
87
+ request: GetAccountRequest,
88
+ ): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
89
+
90
+ initEmailChange(
91
+ request: InitEmailChangeRequest,
92
+ ): Promise<InitEmailChangeResponse> | Observable<InitEmailChangeResponse> | InitEmailChangeResponse;
93
+
94
+ confirmEmailChange(
95
+ request: ConfirmEmailChangeRequest,
96
+ ): Promise<ConfirmEmailChangeResponse> | Observable<ConfirmEmailChangeResponse> | ConfirmEmailChangeResponse;
97
+
98
+ initPhoneChange(
99
+ request: InitPhoneChangeRequest,
100
+ ): Promise<InitPhoneChangeResponse> | Observable<InitPhoneChangeResponse> | InitPhoneChangeResponse;
101
+
102
+ confirmPhoneChange(
103
+ request: ConfirmPhoneChangeRequest,
104
+ ): Promise<ConfirmPhoneChangeResponse> | Observable<ConfirmPhoneChangeResponse> | ConfirmPhoneChangeResponse;
105
+ }
106
+
107
+ export function AccountServiceControllerMethods() {
108
+ return function (constructor: Function) {
109
+ const grpcMethods: string[] = [
110
+ "getAccount",
111
+ "initEmailChange",
112
+ "confirmEmailChange",
113
+ "initPhoneChange",
114
+ "confirmPhoneChange",
115
+ ];
116
+ for (const method of grpcMethods) {
117
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
118
+ GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
119
+ }
120
+ const grpcStreamMethods: string[] = [];
121
+ for (const method of grpcStreamMethods) {
122
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
123
+ GrpcStreamMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
124
+ }
125
+ };
126
+ }
127
+
128
+ export const ACCOUNT_SERVICE_NAME = "AccountService";
@@ -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.1.4",
3
+ "version": "1.3.4",
4
4
  "description": "Protobuf definitions and generated TypeScript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -0,0 +1,70 @@
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
+ DESIGNER = 2;
70
+ }
@@ -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
+ }