@barumetric/contracts 1.4.2 → 1.4.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.
package/gen/ts/images.ts CHANGED
@@ -25,8 +25,7 @@ export interface GetStatusImagesResponse {
25
25
  }
26
26
 
27
27
  export interface ImageProcessing {
28
- fileName: string;
29
- url?: string | undefined;
28
+ imageNumber: number;
30
29
  status: string;
31
30
  error: string;
32
31
  }
@@ -53,11 +53,37 @@ export interface CreateListingResponse {
53
53
  id: string;
54
54
  }
55
55
 
56
- /** Запросы для получения данных */
56
+ export interface UpdateListingRequest {
57
+ id: string;
58
+ userId: string;
59
+ title: string;
60
+ description?: string | undefined;
61
+ price?: number | undefined;
62
+ categoryId: string;
63
+ latitude?: number | undefined;
64
+ longitude?: number | undefined;
65
+ videoUrl?: string | undefined;
66
+ status?: string | undefined;
67
+ attributes?: { [key: string]: any } | undefined;
68
+ }
69
+
70
+ export interface UpdateListingResponse {
71
+ id: string;
72
+ }
73
+
57
74
  export interface GetListingRequest {
58
75
  id: string;
59
76
  }
60
77
 
78
+ export interface DeleteListingRequest {
79
+ id: string;
80
+ userId: string;
81
+ }
82
+
83
+ export interface DeleteListingResponse {
84
+ ok: boolean;
85
+ }
86
+
61
87
  export interface GetListingsByUserRequest {
62
88
  userId: string;
63
89
  status?: ListingStatus | undefined;
@@ -109,20 +135,20 @@ export const LISTINGS_V1_PACKAGE_NAME = "listings.v1";
109
135
  wrappers[".google.protobuf.Struct"] = { fromObject: Struct.wrap, toObject: Struct.unwrap } as any;
110
136
 
111
137
  export interface ListingsServiceClient {
112
- createListing(request: CreateListingRequest): Observable<CreateListingResponse>;
113
-
114
138
  getListing(request: GetListingRequest): Observable<GetListingResponse>;
115
139
 
116
140
  getListingsByUser(request: GetListingsByUserRequest): Observable<GetListingsByUserResponse>;
117
141
 
118
142
  getListingsByCategory(request: GetListingsByCategoryRequest): Observable<GetListingsByCategoryResponse>;
143
+
144
+ createListing(request: CreateListingRequest): Observable<CreateListingResponse>;
145
+
146
+ updateListing(request: CreateListingRequest): Observable<CreateListingResponse>;
147
+
148
+ deleteListing(request: DeleteListingRequest): Observable<DeleteListingResponse>;
119
149
  }
120
150
 
121
151
  export interface ListingsServiceController {
122
- createListing(
123
- request: CreateListingRequest,
124
- ): Promise<CreateListingResponse> | Observable<CreateListingResponse> | CreateListingResponse;
125
-
126
152
  getListing(
127
153
  request: GetListingRequest,
128
154
  ): Promise<GetListingResponse> | Observable<GetListingResponse> | GetListingResponse;
@@ -134,11 +160,30 @@ export interface ListingsServiceController {
134
160
  getListingsByCategory(
135
161
  request: GetListingsByCategoryRequest,
136
162
  ): Promise<GetListingsByCategoryResponse> | Observable<GetListingsByCategoryResponse> | GetListingsByCategoryResponse;
163
+
164
+ createListing(
165
+ request: CreateListingRequest,
166
+ ): Promise<CreateListingResponse> | Observable<CreateListingResponse> | CreateListingResponse;
167
+
168
+ updateListing(
169
+ request: CreateListingRequest,
170
+ ): Promise<CreateListingResponse> | Observable<CreateListingResponse> | CreateListingResponse;
171
+
172
+ deleteListing(
173
+ request: DeleteListingRequest,
174
+ ): Promise<DeleteListingResponse> | Observable<DeleteListingResponse> | DeleteListingResponse;
137
175
  }
138
176
 
139
177
  export function ListingsServiceControllerMethods() {
140
178
  return function (constructor: Function) {
141
- const grpcMethods: string[] = ["createListing", "getListing", "getListingsByUser", "getListingsByCategory"];
179
+ const grpcMethods: string[] = [
180
+ "getListing",
181
+ "getListingsByUser",
182
+ "getListingsByCategory",
183
+ "createListing",
184
+ "updateListing",
185
+ "deleteListing",
186
+ ];
142
187
  for (const method of grpcMethods) {
143
188
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
144
189
  GrpcMethod("ListingsService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barumetric/contracts",
3
- "version": "1.4.2",
3
+ "version": "1.4.4",
4
4
  "description": "Protobuf definitions and generated TypeScript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -23,8 +23,7 @@ message GetStatusImagesResponse {
23
23
  }
24
24
 
25
25
  message ImageProcessing {
26
- string file_name = 1;
27
- optional string url = 2;
28
- string status = 3;
29
- string error = 4;
26
+ int32 image_number = 1;
27
+ string status = 2;
28
+ string error = 3;
30
29
  }
@@ -6,10 +6,13 @@ import "google/protobuf/empty.proto";
6
6
  import "google/protobuf/struct.proto";
7
7
 
8
8
  service ListingsService {
9
- rpc CreateListing (CreateListingRequest) returns (CreateListingResponse);
10
9
  rpc GetListing (GetListingRequest) returns (GetListingResponse);
11
10
  rpc GetListingsByUser (GetListingsByUserRequest) returns (GetListingsByUserResponse);
12
11
  rpc GetListingsByCategory (GetListingsByCategoryRequest) returns (GetListingsByCategoryResponse);
12
+
13
+ rpc CreateListing (CreateListingRequest) returns (CreateListingResponse);
14
+ rpc UpdateListing (CreateListingRequest) returns (CreateListingResponse);
15
+ rpc DeleteListing (DeleteListingRequest) returns (DeleteListingResponse);
13
16
  }
14
17
 
15
18
  message CreateListingRequest {
@@ -29,11 +32,37 @@ message CreateListingResponse {
29
32
  string id = 1;
30
33
  }
31
34
 
32
- // Запросы для получения данных
35
+ message UpdateListingRequest {
36
+ string id = 1;
37
+ string user_id = 2;
38
+ string title = 3;
39
+ optional string description = 4;
40
+ optional float price = 5;
41
+ string category_id = 6;
42
+ optional float latitude = 7;
43
+ optional float longitude = 8;
44
+ optional string video_url = 9;
45
+ optional string status = 10;
46
+ optional google.protobuf.Struct attributes = 11;
47
+ }
48
+
49
+ message UpdateListingResponse {
50
+ string id = 1;
51
+ }
52
+
33
53
  message GetListingRequest {
34
54
  string id = 1;
35
55
  }
36
56
 
57
+ message DeleteListingRequest {
58
+ string id = 1;
59
+ string user_id = 2;
60
+ }
61
+
62
+ message DeleteListingResponse {
63
+ bool ok = 1;
64
+ }
65
+
37
66
  message GetListingsByUserRequest {
38
67
  string user_id = 1;
39
68
  optional ListingStatus status = 2;