@prodoctors/contracts 1.4.0 → 1.5.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/account.ts +67 -0
- package/package.json +28 -28
- package/proto/account.proto +31 -0
package/gen/account.ts
CHANGED
|
@@ -65,6 +65,30 @@ export interface ListAccountsResponse {
|
|
|
65
65
|
meta: PaginationMeta | undefined;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
+
/** Web storefront: foydalanuvchining sevimli mahsulotlari (wishlist). */
|
|
69
|
+
export interface Favorite {
|
|
70
|
+
productId: string;
|
|
71
|
+
createdAt: Timestamp | undefined;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface AddFavoriteRequest {
|
|
75
|
+
accountId: string;
|
|
76
|
+
productId: string;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface RemoveFavoriteRequest {
|
|
80
|
+
accountId: string;
|
|
81
|
+
productId: string;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface ListFavoritesRequest {
|
|
85
|
+
accountId: string;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface FavoriteListResponse {
|
|
89
|
+
items: Favorite[];
|
|
90
|
+
}
|
|
91
|
+
|
|
68
92
|
export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
|
|
69
93
|
|
|
70
94
|
export interface AccountServiceClient {
|
|
@@ -120,3 +144,46 @@ export function AccountServiceControllerMethods() {
|
|
|
120
144
|
}
|
|
121
145
|
|
|
122
146
|
export const ACCOUNT_SERVICE_NAME = "AccountService";
|
|
147
|
+
|
|
148
|
+
export interface FavoriteServiceClient {
|
|
149
|
+
/** Add/Remove yangilangan to'liq ro'yxatni qaytaradi (klient bitta so'rovda sinxronlansin). */
|
|
150
|
+
|
|
151
|
+
addFavorite(request: AddFavoriteRequest): Observable<FavoriteListResponse>;
|
|
152
|
+
|
|
153
|
+
removeFavorite(request: RemoveFavoriteRequest): Observable<FavoriteListResponse>;
|
|
154
|
+
|
|
155
|
+
listFavorites(request: ListFavoritesRequest): Observable<FavoriteListResponse>;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export interface FavoriteServiceController {
|
|
159
|
+
/** Add/Remove yangilangan to'liq ro'yxatni qaytaradi (klient bitta so'rovda sinxronlansin). */
|
|
160
|
+
|
|
161
|
+
addFavorite(
|
|
162
|
+
request: AddFavoriteRequest,
|
|
163
|
+
): Promise<FavoriteListResponse> | Observable<FavoriteListResponse> | FavoriteListResponse;
|
|
164
|
+
|
|
165
|
+
removeFavorite(
|
|
166
|
+
request: RemoveFavoriteRequest,
|
|
167
|
+
): Promise<FavoriteListResponse> | Observable<FavoriteListResponse> | FavoriteListResponse;
|
|
168
|
+
|
|
169
|
+
listFavorites(
|
|
170
|
+
request: ListFavoritesRequest,
|
|
171
|
+
): Promise<FavoriteListResponse> | Observable<FavoriteListResponse> | FavoriteListResponse;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export function FavoriteServiceControllerMethods() {
|
|
175
|
+
return function (constructor: Function) {
|
|
176
|
+
const grpcMethods: string[] = ["addFavorite", "removeFavorite", "listFavorites"];
|
|
177
|
+
for (const method of grpcMethods) {
|
|
178
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
179
|
+
GrpcMethod("FavoriteService", method)(constructor.prototype[method], method, descriptor);
|
|
180
|
+
}
|
|
181
|
+
const grpcStreamMethods: string[] = [];
|
|
182
|
+
for (const method of grpcStreamMethods) {
|
|
183
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
184
|
+
GrpcStreamMethod("FavoriteService", method)(constructor.prototype[method], method, descriptor);
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export const FAVORITE_SERVICE_NAME = "FavoriteService";
|
package/package.json
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@prodoctors/contracts",
|
|
3
|
-
"version": "1.
|
|
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.5.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/account.proto
CHANGED
|
@@ -66,3 +66,34 @@ service AccountService {
|
|
|
66
66
|
rpc ListAccounts(ListAccountsRequest) returns (ListAccountsResponse);
|
|
67
67
|
rpc DeleteAccount(common.v1.IdRequest) returns (common.v1.BoolResponse);
|
|
68
68
|
}
|
|
69
|
+
|
|
70
|
+
// Web storefront: foydalanuvchining sevimli mahsulotlari (wishlist).
|
|
71
|
+
message Favorite {
|
|
72
|
+
string product_id = 1;
|
|
73
|
+
google.protobuf.Timestamp created_at = 2;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
message AddFavoriteRequest {
|
|
77
|
+
string account_id = 1;
|
|
78
|
+
string product_id = 2;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
message RemoveFavoriteRequest {
|
|
82
|
+
string account_id = 1;
|
|
83
|
+
string product_id = 2;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
message ListFavoritesRequest {
|
|
87
|
+
string account_id = 1;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
message FavoriteListResponse {
|
|
91
|
+
repeated Favorite items = 1;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
service FavoriteService {
|
|
95
|
+
// Add/Remove yangilangan to'liq ro'yxatni qaytaradi (klient bitta so'rovda sinxronlansin).
|
|
96
|
+
rpc AddFavorite(AddFavoriteRequest) returns (FavoriteListResponse);
|
|
97
|
+
rpc RemoveFavorite(RemoveFavoriteRequest) returns (FavoriteListResponse);
|
|
98
|
+
rpc ListFavorites(ListFavoritesRequest) returns (FavoriteListResponse);
|
|
99
|
+
}
|