@prodoctors/contracts 1.0.1 → 1.0.2

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/gen/account.ts CHANGED
@@ -1,57 +1,61 @@
1
- // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
- // versions:
3
- // protoc-gen-ts_proto v2.11.5
4
- // protoc v7.34.0
5
- // source: account.proto
6
-
7
- /* eslint-disable */
8
- import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
- import { Observable } from "rxjs";
10
- import { Role } from "./auth";
11
-
12
- export const protobufPackage = "account.v1";
13
-
14
- export interface GetAccountRequest {
15
- id: string;
16
- }
17
-
18
- export interface GetAccountResponse {
19
- id: string;
20
- name: string;
21
- username: string;
22
- role: Role;
23
- branchId: string;
24
- }
25
-
26
- export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
27
-
28
- export interface AccountServiceClient {
29
- /** Get user profile information */
30
-
31
- getProfile(request: GetAccountRequest): Observable<GetAccountResponse>;
32
- }
33
-
34
- export interface AccountServiceController {
35
- /** Get user profile information */
36
-
37
- getProfile(
38
- request: GetAccountRequest,
39
- ): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
40
- }
41
-
42
- export function AccountServiceControllerMethods() {
43
- return function (constructor: Function) {
44
- const grpcMethods: string[] = ["getProfile"];
45
- for (const method of grpcMethods) {
46
- const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
47
- GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
48
- }
49
- const grpcStreamMethods: string[] = [];
50
- for (const method of grpcStreamMethods) {
51
- const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
52
- GrpcStreamMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
53
- }
54
- };
55
- }
56
-
57
- export const ACCOUNT_SERVICE_NAME = "AccountService";
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.5
4
+ // protoc v7.34.0
5
+ // source: account.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+ import { Role } from "./auth";
11
+
12
+ export const protobufPackage = "account.v1";
13
+
14
+ export interface GetAccountRequest {
15
+ id: string;
16
+ }
17
+
18
+ export interface GetAccountResponse {
19
+ id: string;
20
+ name: string;
21
+ username: string;
22
+ role: Role;
23
+ branchId: string;
24
+ }
25
+
26
+ export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
27
+
28
+ /** Account service for managing user profiles */
29
+
30
+ export interface AccountServiceClient {
31
+ /** Get user profile information */
32
+
33
+ getProfile(request: GetAccountRequest): Observable<GetAccountResponse>;
34
+ }
35
+
36
+ /** Account service for managing user profiles */
37
+
38
+ export interface AccountServiceController {
39
+ /** Get user profile information */
40
+
41
+ getProfile(
42
+ request: GetAccountRequest,
43
+ ): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
44
+ }
45
+
46
+ export function AccountServiceControllerMethods() {
47
+ return function (constructor: Function) {
48
+ const grpcMethods: string[] = ["getProfile"];
49
+ for (const method of grpcMethods) {
50
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
51
+ GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
52
+ }
53
+ const grpcStreamMethods: string[] = [];
54
+ for (const method of grpcStreamMethods) {
55
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
56
+ GrpcStreamMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
57
+ }
58
+ };
59
+ }
60
+
61
+ export const ACCOUNT_SERVICE_NAME = "AccountService";
package/gen/auth.ts CHANGED
@@ -1,140 +1,140 @@
1
- // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
- // versions:
3
- // protoc-gen-ts_proto v2.11.5
4
- // protoc v7.34.0
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 enum Role {
14
- USER = 0,
15
- SUPER_ADMIN = 1,
16
- MANAGER = 2,
17
- PHARMACIST = 3,
18
- CASHIER = 4,
19
- INVENTORY_MANAGER = 5,
20
- AUDITOR = 6,
21
- UNRECOGNIZED = -1,
22
- }
23
-
24
- export interface LoginRequest {
25
- username: string;
26
- password: string;
27
- }
28
-
29
- export interface LoginResponse {
30
- accessToken: string;
31
- refreshToken: string;
32
- }
33
-
34
- export interface RegisterRequest {
35
- name: string;
36
- username: string;
37
- password: string;
38
- role: Role;
39
- branchId: string;
40
- }
41
-
42
- export interface RegisterResponse {
43
- ok: boolean;
44
- }
45
-
46
- export interface SendOtpRequest {
47
- identifier: string;
48
- type: string;
49
- }
50
-
51
- export interface SendOtpResponse {
52
- ok: boolean;
53
- }
54
-
55
- export interface VerifyOtpRequest {
56
- identifier: string;
57
- type: string;
58
- code: string;
59
- }
60
-
61
- export interface VerifyOtpResponse {
62
- accessToken: string;
63
- refreshToken: string;
64
- }
65
-
66
- export interface RefreshRequest {
67
- refreshToken: string;
68
- }
69
-
70
- export interface RefreshResponse {
71
- accessToken: string;
72
- refreshToken: string;
73
- }
74
-
75
- export const AUTH_V1_PACKAGE_NAME = "auth.v1";
76
-
77
- /** Authentication service for sending and verifying OTPs */
78
-
79
- export interface AuthServiceClient {
80
- /** Authoriration user */
81
-
82
- login(request: LoginRequest): Observable<LoginResponse>;
83
-
84
- /** Registration user */
85
-
86
- register(request: RegisterRequest): Observable<RegisterResponse>;
87
-
88
- /** Send OTP to the user */
89
-
90
- sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
91
-
92
- /** Verify the OTP sent to the user */
93
-
94
- verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
95
-
96
- /** Refersh token */
97
-
98
- refresh(request: RefreshRequest): Observable<RefreshResponse>;
99
- }
100
-
101
- /** Authentication service for sending and verifying OTPs */
102
-
103
- export interface AuthServiceController {
104
- /** Authoriration user */
105
-
106
- login(request: LoginRequest): Promise<LoginResponse> | Observable<LoginResponse> | LoginResponse;
107
-
108
- /** Registration user */
109
-
110
- register(request: RegisterRequest): Promise<RegisterResponse> | Observable<RegisterResponse> | RegisterResponse;
111
-
112
- /** Send OTP to the user */
113
-
114
- sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
115
-
116
- /** Verify the OTP sent to the user */
117
-
118
- verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
119
-
120
- /** Refersh token */
121
-
122
- refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
123
- }
124
-
125
- export function AuthServiceControllerMethods() {
126
- return function (constructor: Function) {
127
- const grpcMethods: string[] = ["login", "register", "sendOtp", "verifyOtp", "refresh"];
128
- for (const method of grpcMethods) {
129
- const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
130
- GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
131
- }
132
- const grpcStreamMethods: string[] = [];
133
- for (const method of grpcStreamMethods) {
134
- const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
135
- GrpcStreamMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
136
- }
137
- };
138
- }
139
-
140
- export const AUTH_SERVICE_NAME = "AuthService";
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.5
4
+ // protoc v7.34.0
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 enum Role {
14
+ USER = 0,
15
+ SUPER_ADMIN = 1,
16
+ MANAGER = 2,
17
+ PHARMACIST = 3,
18
+ CASHIER = 4,
19
+ INVENTORY_MANAGER = 5,
20
+ AUDITOR = 6,
21
+ UNRECOGNIZED = -1,
22
+ }
23
+
24
+ export interface LoginRequest {
25
+ username: string;
26
+ password: string;
27
+ }
28
+
29
+ export interface LoginResponse {
30
+ accessToken: string;
31
+ refreshToken: string;
32
+ }
33
+
34
+ export interface RegisterRequest {
35
+ name: string;
36
+ username: string;
37
+ password: string;
38
+ role?: Role | undefined;
39
+ branchId?: string | undefined;
40
+ }
41
+
42
+ export interface RegisterResponse {
43
+ ok: boolean;
44
+ }
45
+
46
+ export interface SendOtpRequest {
47
+ identifier: string;
48
+ type: string;
49
+ }
50
+
51
+ export interface SendOtpResponse {
52
+ ok: boolean;
53
+ }
54
+
55
+ export interface VerifyOtpRequest {
56
+ identifier: string;
57
+ type: string;
58
+ code: string;
59
+ }
60
+
61
+ export interface VerifyOtpResponse {
62
+ accessToken: string;
63
+ refreshToken: string;
64
+ }
65
+
66
+ export interface RefreshRequest {
67
+ refreshToken: string;
68
+ }
69
+
70
+ export interface RefreshResponse {
71
+ accessToken: string;
72
+ refreshToken: string;
73
+ }
74
+
75
+ export const AUTH_V1_PACKAGE_NAME = "auth.v1";
76
+
77
+ /** Authentication service for sending and verifying OTPs */
78
+
79
+ export interface AuthServiceClient {
80
+ /** Authoriration user */
81
+
82
+ login(request: LoginRequest): Observable<LoginResponse>;
83
+
84
+ /** Registration user */
85
+
86
+ register(request: RegisterRequest): Observable<RegisterResponse>;
87
+
88
+ /** Send OTP to the user */
89
+
90
+ sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
91
+
92
+ /** Verify the OTP sent to the user */
93
+
94
+ verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
95
+
96
+ /** Refersh token */
97
+
98
+ refresh(request: RefreshRequest): Observable<RefreshResponse>;
99
+ }
100
+
101
+ /** Authentication service for sending and verifying OTPs */
102
+
103
+ export interface AuthServiceController {
104
+ /** Authoriration user */
105
+
106
+ login(request: LoginRequest): Promise<LoginResponse> | Observable<LoginResponse> | LoginResponse;
107
+
108
+ /** Registration user */
109
+
110
+ register(request: RegisterRequest): Promise<RegisterResponse> | Observable<RegisterResponse> | RegisterResponse;
111
+
112
+ /** Send OTP to the user */
113
+
114
+ sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
115
+
116
+ /** Verify the OTP sent to the user */
117
+
118
+ verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
119
+
120
+ /** Refersh token */
121
+
122
+ refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
123
+ }
124
+
125
+ export function AuthServiceControllerMethods() {
126
+ return function (constructor: Function) {
127
+ const grpcMethods: string[] = ["login", "register", "sendOtp", "verifyOtp", "refresh"];
128
+ for (const method of grpcMethods) {
129
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
130
+ GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
131
+ }
132
+ const grpcStreamMethods: string[] = [];
133
+ for (const method of grpcStreamMethods) {
134
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
135
+ GrpcStreamMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
136
+ }
137
+ };
138
+ }
139
+
140
+ export const AUTH_SERVICE_NAME = "AuthService";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prodoctors/contracts",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Protobuf definitions and generated Typescript types for ProDoctors",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -5,6 +5,7 @@ package account.v1;
5
5
 
6
6
  import "auth.proto";
7
7
 
8
+ // Account service for managing user profiles
8
9
  service AccountService {
9
10
  // Get user profile information
10
11
  rpc GetProfile (GetAccountRequest) returns (GetAccountResponse);
package/proto/auth.proto CHANGED
@@ -34,8 +34,8 @@ message RegisterRequest {
34
34
  string name = 1;
35
35
  string username = 2;
36
36
  string password = 3;
37
- Role role = 4;
38
- string branch_id = 5;
37
+ optional Role role = 4;
38
+ optional string branch_id = 5;
39
39
  }
40
40
 
41
41
  message RegisterResponse {