@prodoctors/contracts 1.15.0 → 1.16.0

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/auth.ts CHANGED
@@ -54,6 +54,37 @@ export interface VerifyOtpResponse {
54
54
  refreshToken: string;
55
55
  }
56
56
 
57
+ /** Hamkor tizim foydalanuvchisini bizning akkauntga moslashtirish. */
58
+ export interface ResolveIntegrationAccountRequest {
59
+ /** Hamkor kodi — audit uchun (`INTEGRATION_CLIENT_CODE`). */
60
+ integrationCode: string;
61
+ phone: string;
62
+ /** Hamkor tizimidagi foydalanuvchi id si — audit uchun. */
63
+ externalUserId?:
64
+ | string
65
+ | undefined;
66
+ /** Yangi akkaunt yaratilsa ishlatiladi. */
67
+ name?:
68
+ | string
69
+ | undefined;
70
+ /** So'rov kelgan IP — audit uchun. */
71
+ clientIp?:
72
+ | string
73
+ | undefined;
74
+ /**
75
+ * `X-Forwarded-For` zanjiri — audit uchun. IP soxtalashtirish urinishini
76
+ * keyinchalik aniqlash imkonini beradi (`client_ip` shu zanjirdan olinadi).
77
+ */
78
+ forwardedFor?: string | undefined;
79
+ }
80
+
81
+ export interface ResolveIntegrationAccountResponse {
82
+ accountId: string;
83
+ role: string;
84
+ /** Shu chaqiruvda yangi akkaunt yaratildimi. */
85
+ created: boolean;
86
+ }
87
+
57
88
  export interface RefreshRequest {
58
89
  refreshToken: string;
59
90
  }
@@ -87,6 +118,14 @@ export interface AuthServiceClient {
87
118
  /** Refersh token */
88
119
 
89
120
  refresh(request: RefreshRequest): Observable<RefreshResponse>;
121
+
122
+ /**
123
+ * Hamkor tizim uchun: telefon bo'yicha mijoz akkauntini aniqlaydi
124
+ * (yo'q bo'lsa yaratadi). Token bermaydi — chaqiruvchi (gateway) kalitni
125
+ * o'zi tekshirgan bo'ladi.
126
+ */
127
+
128
+ resolveIntegrationAccount(request: ResolveIntegrationAccountRequest): Observable<ResolveIntegrationAccountResponse>;
90
129
  }
91
130
 
92
131
  /** Authentication service for sending and verifying OTPs */
@@ -111,11 +150,24 @@ export interface AuthServiceController {
111
150
  /** Refersh token */
112
151
 
113
152
  refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
153
+
154
+ /**
155
+ * Hamkor tizim uchun: telefon bo'yicha mijoz akkauntini aniqlaydi
156
+ * (yo'q bo'lsa yaratadi). Token bermaydi — chaqiruvchi (gateway) kalitni
157
+ * o'zi tekshirgan bo'ladi.
158
+ */
159
+
160
+ resolveIntegrationAccount(
161
+ request: ResolveIntegrationAccountRequest,
162
+ ):
163
+ | Promise<ResolveIntegrationAccountResponse>
164
+ | Observable<ResolveIntegrationAccountResponse>
165
+ | ResolveIntegrationAccountResponse;
114
166
  }
115
167
 
116
168
  export function AuthServiceControllerMethods() {
117
169
  return function (constructor: Function) {
118
- const grpcMethods: string[] = ["login", "register", "sendOtp", "verifyOtp", "refresh"];
170
+ const grpcMethods: string[] = ["login", "register", "sendOtp", "verifyOtp", "refresh", "resolveIntegrationAccount"];
119
171
  for (const method of grpcMethods) {
120
172
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
121
173
  GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,28 +1,28 @@
1
- {
2
- "name": "@prodoctors/contracts",
3
- "version": "1.15.0",
4
- "description": "Protobuf definitions and generated Typescript types for ProDoctors",
5
- "main": "./dist/index.js",
6
- "types": "./dist/index.d.ts",
7
- "scripts": {
8
- "build": "tsc -p tsconfig.build.json",
9
- "generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
10
- },
11
- "files": [
12
- "proto",
13
- "gen",
14
- "dist"
15
- ],
16
- "publishConfig": {
17
- "access": "public"
18
- },
19
- "dependencies": {
20
- "@nestjs/microservices": "^11.1.15",
21
- "rxjs": "^7.8.2",
22
- "ts-proto": "^2.11.4"
23
- },
24
- "devDependencies": {
25
- "@types/node": "^25.3.5",
26
- "typescript": "^5.9.3"
27
- }
28
- }
1
+ {
2
+ "name": "@prodoctors/contracts",
3
+ "version": "1.16.0",
4
+ "description": "Protobuf definitions and generated Typescript types for ProDoctors",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "scripts": {
8
+ "build": "tsc -p tsconfig.build.json",
9
+ "generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
10
+ },
11
+ "files": [
12
+ "proto",
13
+ "gen",
14
+ "dist"
15
+ ],
16
+ "publishConfig": {
17
+ "access": "public"
18
+ },
19
+ "dependencies": {
20
+ "@nestjs/microservices": "^11.1.15",
21
+ "rxjs": "^7.8.2",
22
+ "ts-proto": "^2.11.4"
23
+ },
24
+ "devDependencies": {
25
+ "@types/node": "^25.3.5",
26
+ "typescript": "^5.9.3"
27
+ }
28
+ }
package/proto/auth.proto CHANGED
@@ -18,6 +18,11 @@ service AuthService {
18
18
 
19
19
  // Refersh token
20
20
  rpc Refresh (RefreshRequest) returns (RefreshResponse);
21
+
22
+ // Hamkor tizim uchun: telefon bo'yicha mijoz akkauntini aniqlaydi
23
+ // (yo'q bo'lsa yaratadi). Token bermaydi — chaqiruvchi (gateway) kalitni
24
+ // o'zi tekshirgan bo'ladi.
25
+ rpc ResolveIntegrationAccount (ResolveIntegrationAccountRequest) returns (ResolveIntegrationAccountResponse);
21
26
  }
22
27
 
23
28
  message LoginRequest {
@@ -64,6 +69,29 @@ message VerifyOtpResponse {
64
69
  string refresh_token = 2;
65
70
  }
66
71
 
72
+ // Hamkor tizim foydalanuvchisini bizning akkauntga moslashtirish.
73
+ message ResolveIntegrationAccountRequest {
74
+ // Hamkor kodi — audit uchun (`INTEGRATION_CLIENT_CODE`).
75
+ string integration_code = 1;
76
+ string phone = 2;
77
+ // Hamkor tizimidagi foydalanuvchi id si — audit uchun.
78
+ optional string external_user_id = 3;
79
+ // Yangi akkaunt yaratilsa ishlatiladi.
80
+ optional string name = 4;
81
+ // So'rov kelgan IP — audit uchun.
82
+ optional string client_ip = 5;
83
+ // `X-Forwarded-For` zanjiri — audit uchun. IP soxtalashtirish urinishini
84
+ // keyinchalik aniqlash imkonini beradi (`client_ip` shu zanjirdan olinadi).
85
+ optional string forwarded_for = 6;
86
+ }
87
+
88
+ message ResolveIntegrationAccountResponse {
89
+ string account_id = 1;
90
+ string role = 2;
91
+ // Shu chaqiruvda yangi akkaunt yaratildimi.
92
+ bool created = 3;
93
+ }
94
+
67
95
  message RefreshRequest {
68
96
  string refresh_token = 1;
69
97
  }