@barumetric/contracts 1.4.2 → 1.4.3

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,19 @@ export interface CreateListingResponse {
53
53
  id: string;
54
54
  }
55
55
 
56
- /** Запросы для получения данных */
57
56
  export interface GetListingRequest {
58
57
  id: string;
59
58
  }
60
59
 
60
+ export interface DeleteListingRequest {
61
+ id: string;
62
+ userId: string;
63
+ }
64
+
65
+ export interface DeleteListingResponse {
66
+ ok: boolean;
67
+ }
68
+
61
69
  export interface GetListingsByUserRequest {
62
70
  userId: string;
63
71
  status?: ListingStatus | undefined;
@@ -109,20 +117,20 @@ export const LISTINGS_V1_PACKAGE_NAME = "listings.v1";
109
117
  wrappers[".google.protobuf.Struct"] = { fromObject: Struct.wrap, toObject: Struct.unwrap } as any;
110
118
 
111
119
  export interface ListingsServiceClient {
112
- createListing(request: CreateListingRequest): Observable<CreateListingResponse>;
113
-
114
120
  getListing(request: GetListingRequest): Observable<GetListingResponse>;
115
121
 
116
122
  getListingsByUser(request: GetListingsByUserRequest): Observable<GetListingsByUserResponse>;
117
123
 
118
124
  getListingsByCategory(request: GetListingsByCategoryRequest): Observable<GetListingsByCategoryResponse>;
125
+
126
+ createListing(request: CreateListingRequest): Observable<CreateListingResponse>;
127
+
128
+ updateListing(request: CreateListingRequest): Observable<CreateListingResponse>;
129
+
130
+ deleteListing(request: DeleteListingRequest): Observable<DeleteListingResponse>;
119
131
  }
120
132
 
121
133
  export interface ListingsServiceController {
122
- createListing(
123
- request: CreateListingRequest,
124
- ): Promise<CreateListingResponse> | Observable<CreateListingResponse> | CreateListingResponse;
125
-
126
134
  getListing(
127
135
  request: GetListingRequest,
128
136
  ): Promise<GetListingResponse> | Observable<GetListingResponse> | GetListingResponse;
@@ -134,11 +142,30 @@ export interface ListingsServiceController {
134
142
  getListingsByCategory(
135
143
  request: GetListingsByCategoryRequest,
136
144
  ): Promise<GetListingsByCategoryResponse> | Observable<GetListingsByCategoryResponse> | GetListingsByCategoryResponse;
145
+
146
+ createListing(
147
+ request: CreateListingRequest,
148
+ ): Promise<CreateListingResponse> | Observable<CreateListingResponse> | CreateListingResponse;
149
+
150
+ updateListing(
151
+ request: CreateListingRequest,
152
+ ): Promise<CreateListingResponse> | Observable<CreateListingResponse> | CreateListingResponse;
153
+
154
+ deleteListing(
155
+ request: DeleteListingRequest,
156
+ ): Promise<DeleteListingResponse> | Observable<DeleteListingResponse> | DeleteListingResponse;
137
157
  }
138
158
 
139
159
  export function ListingsServiceControllerMethods() {
140
160
  return function (constructor: Function) {
141
- const grpcMethods: string[] = ["createListing", "getListing", "getListingsByUser", "getListingsByCategory"];
161
+ const grpcMethods: string[] = [
162
+ "getListing",
163
+ "getListingsByUser",
164
+ "getListingsByCategory",
165
+ "createListing",
166
+ "updateListing",
167
+ "deleteListing",
168
+ ];
142
169
  for (const method of grpcMethods) {
143
170
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
144
171
  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.3",
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,19 @@ message CreateListingResponse {
29
32
  string id = 1;
30
33
  }
31
34
 
32
- // Запросы для получения данных
33
35
  message GetListingRequest {
34
36
  string id = 1;
35
37
  }
36
38
 
39
+ message DeleteListingRequest {
40
+ string id = 1;
41
+ string user_id = 2;
42
+ }
43
+
44
+ message DeleteListingResponse {
45
+ bool ok = 1;
46
+ }
47
+
37
48
  message GetListingsByUserRequest {
38
49
  string user_id = 1;
39
50
  optional ListingStatus status = 2;