@barumetric/contracts 1.4.19 → 1.4.20
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/account.ts +133 -0
- package/gen/ts/auth.ts +236 -0
- package/gen/ts/balance.ts +67 -0
- package/gen/ts/categories.ts +354 -0
- package/gen/ts/google/protobuf/empty.ts +1 -1
- package/gen/ts/google/protobuf/struct.ts +197 -0
- package/gen/ts/google/protobuf/timestamp.ts +1 -1
- package/gen/ts/images.ts +60 -0
- package/gen/ts/listings.ts +202 -0
- package/gen/ts/media.ts +77 -0
- package/gen/ts/messages.ts +211 -0
- package/gen/ts/payment.ts +190 -0
- package/gen/ts/presence.ts +127 -0
- package/gen/ts/session.ts +110 -0
- package/gen/ts/users.ts +277 -0
- package/package.json +1 -1
- package/proto/presence.proto +1 -1
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.0
|
|
4
|
+
// protoc v6.33.2
|
|
5
|
+
// source: categories.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
import { Empty } from "./google/protobuf/empty";
|
|
11
|
+
|
|
12
|
+
export const protobufPackage = "categories.v1";
|
|
13
|
+
|
|
14
|
+
export enum AttributeType {
|
|
15
|
+
UNSPECIFIED = 0,
|
|
16
|
+
STRING = 1,
|
|
17
|
+
TEXT = 2,
|
|
18
|
+
INTEGER = 3,
|
|
19
|
+
FLOAT = 4,
|
|
20
|
+
BOOLEAN = 5,
|
|
21
|
+
ENUM = 6,
|
|
22
|
+
MULTI_ENUM = 7,
|
|
23
|
+
RANGE = 8,
|
|
24
|
+
DATE = 9,
|
|
25
|
+
UNRECOGNIZED = -1,
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface GetCategoryRequest {
|
|
29
|
+
id: string;
|
|
30
|
+
includeAttributes: boolean;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface GetCategoryAttributesRequest {
|
|
34
|
+
id: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface GetAllCategoriesResponse {
|
|
38
|
+
categories: Category[];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface GetCategoryResponse {
|
|
42
|
+
category: Category | undefined;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface GetCategoryAttributesResponse {
|
|
46
|
+
attributes: CategoryAttribute[];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface Category {
|
|
50
|
+
id: string;
|
|
51
|
+
name: string;
|
|
52
|
+
slug: string;
|
|
53
|
+
description?: string | undefined;
|
|
54
|
+
iconUrl?: string | undefined;
|
|
55
|
+
bannerUrl?: string | undefined;
|
|
56
|
+
isLeaf: boolean;
|
|
57
|
+
isActive: boolean;
|
|
58
|
+
sortOrder: number;
|
|
59
|
+
parentId?: string | undefined;
|
|
60
|
+
path: string;
|
|
61
|
+
depth: number;
|
|
62
|
+
adsCount: number;
|
|
63
|
+
children: Category[];
|
|
64
|
+
attributes: CategoryAttribute[];
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface CategoryAttribute {
|
|
68
|
+
id: string;
|
|
69
|
+
categoryId: string;
|
|
70
|
+
name: string;
|
|
71
|
+
key: string;
|
|
72
|
+
type: AttributeType;
|
|
73
|
+
isRequired: boolean;
|
|
74
|
+
isFilterable: boolean;
|
|
75
|
+
inherited: boolean;
|
|
76
|
+
unit?: string | undefined;
|
|
77
|
+
minValue?: number | undefined;
|
|
78
|
+
maxValue?: number | undefined;
|
|
79
|
+
sortOrder: number;
|
|
80
|
+
enumValues: EnumValue[];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface CreateCategoryRequest {
|
|
84
|
+
name: string;
|
|
85
|
+
slug: string;
|
|
86
|
+
description?: string | undefined;
|
|
87
|
+
parentId?: string | undefined;
|
|
88
|
+
sortOrder: number;
|
|
89
|
+
isActive: boolean;
|
|
90
|
+
iconUrl?: string | undefined;
|
|
91
|
+
bannerUrl?: string | undefined;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface CreateCategoryResponse {
|
|
95
|
+
ok: boolean;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface UpdateCategoryRequest {
|
|
99
|
+
id: string;
|
|
100
|
+
name: string;
|
|
101
|
+
slug: string;
|
|
102
|
+
description?: string | undefined;
|
|
103
|
+
parentId?: string | undefined;
|
|
104
|
+
sortOrder: number;
|
|
105
|
+
isActive: boolean;
|
|
106
|
+
iconUrl?: string | undefined;
|
|
107
|
+
bannerUrl?: string | undefined;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface UpdateCategoryResponse {
|
|
111
|
+
ok: boolean;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export interface DeleteCategoryRequest {
|
|
115
|
+
id: string;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export interface DeleteCategoryResponse {
|
|
119
|
+
ok: boolean;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export interface EnumValue {
|
|
123
|
+
id: string;
|
|
124
|
+
value: string;
|
|
125
|
+
label: string;
|
|
126
|
+
sortOrder: number;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export interface EnumValueInput {
|
|
130
|
+
value: string;
|
|
131
|
+
label: string;
|
|
132
|
+
sortOrder: number;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/** Attribute management messages */
|
|
136
|
+
export interface GetAttributeRequest {
|
|
137
|
+
id: string;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export interface GetAllAttributesResponse {
|
|
141
|
+
attributes: Attribute[];
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export interface GetAttributeResponse {
|
|
145
|
+
attribute: Attribute | undefined;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export interface Attribute {
|
|
149
|
+
id: string;
|
|
150
|
+
name: string;
|
|
151
|
+
key: string;
|
|
152
|
+
type: AttributeType;
|
|
153
|
+
defaultIsRequired: boolean;
|
|
154
|
+
defaultIsFilterable: boolean;
|
|
155
|
+
unit?: string | undefined;
|
|
156
|
+
minValue?: number | undefined;
|
|
157
|
+
maxValue?: number | undefined;
|
|
158
|
+
enumValues: EnumValue[];
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export interface CreateAttributeRequest {
|
|
162
|
+
name: string;
|
|
163
|
+
key: string;
|
|
164
|
+
type: AttributeType;
|
|
165
|
+
defaultIsRequired: boolean;
|
|
166
|
+
defaultIsFilterable: boolean;
|
|
167
|
+
unit?: string | undefined;
|
|
168
|
+
minValue?: number | undefined;
|
|
169
|
+
maxValue?: number | undefined;
|
|
170
|
+
enumValues: EnumValueInput[];
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export interface CreateAttributeResponse {
|
|
174
|
+
ok: boolean;
|
|
175
|
+
id: string;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export interface UpdateAttributeRequest {
|
|
179
|
+
id: string;
|
|
180
|
+
name?: string | undefined;
|
|
181
|
+
key?: string | undefined;
|
|
182
|
+
type?: AttributeType | undefined;
|
|
183
|
+
defaultIsRequired?: boolean | undefined;
|
|
184
|
+
defaultIsFilterable?: boolean | undefined;
|
|
185
|
+
unit?: string | undefined;
|
|
186
|
+
minValue?: number | undefined;
|
|
187
|
+
maxValue?: number | undefined;
|
|
188
|
+
enumValues: EnumValueInput[];
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export interface UpdateAttributeResponse {
|
|
192
|
+
ok: boolean;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export interface DeleteAttributeRequest {
|
|
196
|
+
id: string;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export interface DeleteAttributeResponse {
|
|
200
|
+
ok: boolean;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/** Category-Attribute relationship messages */
|
|
204
|
+
export interface AssignAttributeToCategoryRequest {
|
|
205
|
+
categoryId: string;
|
|
206
|
+
attributeId: string;
|
|
207
|
+
isRequired?: boolean | undefined;
|
|
208
|
+
isFilterable?: boolean | undefined;
|
|
209
|
+
sortOrder?: number | undefined;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export interface AssignAttributeToCategoryResponse {
|
|
213
|
+
ok: boolean;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export interface UnassignAttributeFromCategoryRequest {
|
|
217
|
+
categoryId: string;
|
|
218
|
+
attributeId: string;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export interface UnassignAttributeFromCategoryResponse {
|
|
222
|
+
ok: boolean;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export const CATEGORIES_V1_PACKAGE_NAME = "categories.v1";
|
|
226
|
+
|
|
227
|
+
export interface CategoriesServiceClient {
|
|
228
|
+
getAllCategories(request: Empty): Observable<GetAllCategoriesResponse>;
|
|
229
|
+
|
|
230
|
+
getCategory(request: GetCategoryRequest): Observable<GetCategoryResponse>;
|
|
231
|
+
|
|
232
|
+
getCategoryAttributes(request: GetCategoryAttributesRequest): Observable<GetCategoryAttributesResponse>;
|
|
233
|
+
|
|
234
|
+
createCategory(request: CreateCategoryRequest): Observable<CreateCategoryResponse>;
|
|
235
|
+
|
|
236
|
+
updateCategory(request: UpdateCategoryRequest): Observable<UpdateCategoryResponse>;
|
|
237
|
+
|
|
238
|
+
deleteCategory(request: DeleteCategoryRequest): Observable<DeleteCategoryResponse>;
|
|
239
|
+
|
|
240
|
+
/** Attribute management */
|
|
241
|
+
|
|
242
|
+
getAllAttributes(request: Empty): Observable<GetAllAttributesResponse>;
|
|
243
|
+
|
|
244
|
+
getAttribute(request: GetAttributeRequest): Observable<GetAttributeResponse>;
|
|
245
|
+
|
|
246
|
+
createAttribute(request: CreateAttributeRequest): Observable<CreateAttributeResponse>;
|
|
247
|
+
|
|
248
|
+
updateAttribute(request: UpdateAttributeRequest): Observable<UpdateAttributeResponse>;
|
|
249
|
+
|
|
250
|
+
deleteAttribute(request: DeleteAttributeRequest): Observable<DeleteAttributeResponse>;
|
|
251
|
+
|
|
252
|
+
/** Category-Attribute relationship management */
|
|
253
|
+
|
|
254
|
+
assignAttributeToCategory(request: AssignAttributeToCategoryRequest): Observable<AssignAttributeToCategoryResponse>;
|
|
255
|
+
|
|
256
|
+
unassignAttributeFromCategory(
|
|
257
|
+
request: UnassignAttributeFromCategoryRequest,
|
|
258
|
+
): Observable<UnassignAttributeFromCategoryResponse>;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export interface CategoriesServiceController {
|
|
262
|
+
getAllCategories(
|
|
263
|
+
request: Empty,
|
|
264
|
+
): Promise<GetAllCategoriesResponse> | Observable<GetAllCategoriesResponse> | GetAllCategoriesResponse;
|
|
265
|
+
|
|
266
|
+
getCategory(
|
|
267
|
+
request: GetCategoryRequest,
|
|
268
|
+
): Promise<GetCategoryResponse> | Observable<GetCategoryResponse> | GetCategoryResponse;
|
|
269
|
+
|
|
270
|
+
getCategoryAttributes(
|
|
271
|
+
request: GetCategoryAttributesRequest,
|
|
272
|
+
): Promise<GetCategoryAttributesResponse> | Observable<GetCategoryAttributesResponse> | GetCategoryAttributesResponse;
|
|
273
|
+
|
|
274
|
+
createCategory(
|
|
275
|
+
request: CreateCategoryRequest,
|
|
276
|
+
): Promise<CreateCategoryResponse> | Observable<CreateCategoryResponse> | CreateCategoryResponse;
|
|
277
|
+
|
|
278
|
+
updateCategory(
|
|
279
|
+
request: UpdateCategoryRequest,
|
|
280
|
+
): Promise<UpdateCategoryResponse> | Observable<UpdateCategoryResponse> | UpdateCategoryResponse;
|
|
281
|
+
|
|
282
|
+
deleteCategory(
|
|
283
|
+
request: DeleteCategoryRequest,
|
|
284
|
+
): Promise<DeleteCategoryResponse> | Observable<DeleteCategoryResponse> | DeleteCategoryResponse;
|
|
285
|
+
|
|
286
|
+
/** Attribute management */
|
|
287
|
+
|
|
288
|
+
getAllAttributes(
|
|
289
|
+
request: Empty,
|
|
290
|
+
): Promise<GetAllAttributesResponse> | Observable<GetAllAttributesResponse> | GetAllAttributesResponse;
|
|
291
|
+
|
|
292
|
+
getAttribute(
|
|
293
|
+
request: GetAttributeRequest,
|
|
294
|
+
): Promise<GetAttributeResponse> | Observable<GetAttributeResponse> | GetAttributeResponse;
|
|
295
|
+
|
|
296
|
+
createAttribute(
|
|
297
|
+
request: CreateAttributeRequest,
|
|
298
|
+
): Promise<CreateAttributeResponse> | Observable<CreateAttributeResponse> | CreateAttributeResponse;
|
|
299
|
+
|
|
300
|
+
updateAttribute(
|
|
301
|
+
request: UpdateAttributeRequest,
|
|
302
|
+
): Promise<UpdateAttributeResponse> | Observable<UpdateAttributeResponse> | UpdateAttributeResponse;
|
|
303
|
+
|
|
304
|
+
deleteAttribute(
|
|
305
|
+
request: DeleteAttributeRequest,
|
|
306
|
+
): Promise<DeleteAttributeResponse> | Observable<DeleteAttributeResponse> | DeleteAttributeResponse;
|
|
307
|
+
|
|
308
|
+
/** Category-Attribute relationship management */
|
|
309
|
+
|
|
310
|
+
assignAttributeToCategory(
|
|
311
|
+
request: AssignAttributeToCategoryRequest,
|
|
312
|
+
):
|
|
313
|
+
| Promise<AssignAttributeToCategoryResponse>
|
|
314
|
+
| Observable<AssignAttributeToCategoryResponse>
|
|
315
|
+
| AssignAttributeToCategoryResponse;
|
|
316
|
+
|
|
317
|
+
unassignAttributeFromCategory(
|
|
318
|
+
request: UnassignAttributeFromCategoryRequest,
|
|
319
|
+
):
|
|
320
|
+
| Promise<UnassignAttributeFromCategoryResponse>
|
|
321
|
+
| Observable<UnassignAttributeFromCategoryResponse>
|
|
322
|
+
| UnassignAttributeFromCategoryResponse;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
export function CategoriesServiceControllerMethods() {
|
|
326
|
+
return function (constructor: Function) {
|
|
327
|
+
const grpcMethods: string[] = [
|
|
328
|
+
"getAllCategories",
|
|
329
|
+
"getCategory",
|
|
330
|
+
"getCategoryAttributes",
|
|
331
|
+
"createCategory",
|
|
332
|
+
"updateCategory",
|
|
333
|
+
"deleteCategory",
|
|
334
|
+
"getAllAttributes",
|
|
335
|
+
"getAttribute",
|
|
336
|
+
"createAttribute",
|
|
337
|
+
"updateAttribute",
|
|
338
|
+
"deleteAttribute",
|
|
339
|
+
"assignAttributeToCategory",
|
|
340
|
+
"unassignAttributeFromCategory",
|
|
341
|
+
];
|
|
342
|
+
for (const method of grpcMethods) {
|
|
343
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
344
|
+
GrpcMethod("CategoriesService", method)(constructor.prototype[method], method, descriptor);
|
|
345
|
+
}
|
|
346
|
+
const grpcStreamMethods: string[] = [];
|
|
347
|
+
for (const method of grpcStreamMethods) {
|
|
348
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
349
|
+
GrpcStreamMethod("CategoriesService", method)(constructor.prototype[method], method, descriptor);
|
|
350
|
+
}
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
export const CATEGORIES_SERVICE_NAME = "CategoriesService";
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.0
|
|
4
|
+
// protoc v6.33.2
|
|
5
|
+
// source: google/protobuf/struct.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { wrappers } from "protobufjs";
|
|
9
|
+
|
|
10
|
+
export const protobufPackage = "google.protobuf";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* `NullValue` is a singleton enumeration to represent the null value for the
|
|
14
|
+
* `Value` type union.
|
|
15
|
+
*
|
|
16
|
+
* The JSON representation for `NullValue` is JSON `null`.
|
|
17
|
+
*/
|
|
18
|
+
export enum NullValue {
|
|
19
|
+
/** NULL_VALUE - Null value. */
|
|
20
|
+
NULL_VALUE = 0,
|
|
21
|
+
UNRECOGNIZED = -1,
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* `Struct` represents a structured data value, consisting of fields
|
|
26
|
+
* which map to dynamically typed values. In some languages, `Struct`
|
|
27
|
+
* might be supported by a native representation. For example, in
|
|
28
|
+
* scripting languages like JS a struct is represented as an
|
|
29
|
+
* object. The details of that representation are described together
|
|
30
|
+
* with the proto support for the language.
|
|
31
|
+
*
|
|
32
|
+
* The JSON representation for `Struct` is JSON object.
|
|
33
|
+
*/
|
|
34
|
+
export interface Struct {
|
|
35
|
+
/** Unordered map of dynamically typed values. */
|
|
36
|
+
fields: { [key: string]: any | undefined };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface Struct_FieldsEntry {
|
|
40
|
+
key: string;
|
|
41
|
+
value: any | undefined;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* `Value` represents a dynamically typed value which can be either
|
|
46
|
+
* null, a number, a string, a boolean, a recursive struct value, or a
|
|
47
|
+
* list of values. A producer of value is expected to set one of these
|
|
48
|
+
* variants. Absence of any variant indicates an error.
|
|
49
|
+
*
|
|
50
|
+
* The JSON representation for `Value` is JSON value.
|
|
51
|
+
*/
|
|
52
|
+
export interface Value {
|
|
53
|
+
/** Represents a null value. */
|
|
54
|
+
nullValue?:
|
|
55
|
+
| NullValue
|
|
56
|
+
| undefined;
|
|
57
|
+
/** Represents a double value. */
|
|
58
|
+
numberValue?:
|
|
59
|
+
| number
|
|
60
|
+
| undefined;
|
|
61
|
+
/** Represents a string value. */
|
|
62
|
+
stringValue?:
|
|
63
|
+
| string
|
|
64
|
+
| undefined;
|
|
65
|
+
/** Represents a boolean value. */
|
|
66
|
+
boolValue?:
|
|
67
|
+
| boolean
|
|
68
|
+
| undefined;
|
|
69
|
+
/** Represents a structured value. */
|
|
70
|
+
structValue?:
|
|
71
|
+
| { [key: string]: any }
|
|
72
|
+
| undefined;
|
|
73
|
+
/** Represents a repeated `Value`. */
|
|
74
|
+
listValue?: Array<any> | undefined;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* `ListValue` is a wrapper around a repeated field of values.
|
|
79
|
+
*
|
|
80
|
+
* The JSON representation for `ListValue` is JSON array.
|
|
81
|
+
*/
|
|
82
|
+
export interface ListValue {
|
|
83
|
+
/** Repeated field of dynamically typed values. */
|
|
84
|
+
values: any[];
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
|
|
88
|
+
|
|
89
|
+
function createBaseStruct(): Struct {
|
|
90
|
+
return { fields: {} };
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export const Struct: MessageFns<Struct> & StructWrapperFns = {
|
|
94
|
+
wrap(object: { [key: string]: any } | undefined): Struct {
|
|
95
|
+
const struct = createBaseStruct();
|
|
96
|
+
|
|
97
|
+
if (object !== undefined) {
|
|
98
|
+
for (const key of globalThis.Object.keys(object)) {
|
|
99
|
+
struct.fields[key] = Value.wrap(object[key]);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return struct;
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
unwrap(message: Struct): { [key: string]: any } {
|
|
106
|
+
const object: { [key: string]: any } = {};
|
|
107
|
+
if (message.fields) {
|
|
108
|
+
for (const key of globalThis.Object.keys(message.fields)) {
|
|
109
|
+
object[key] = Value.unwrap(message.fields[key]);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return object;
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
function createBaseValue(): Value {
|
|
117
|
+
return {};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export const Value: MessageFns<Value> & AnyValueWrapperFns = {
|
|
121
|
+
wrap(value: any): Value {
|
|
122
|
+
const result = {} as any;
|
|
123
|
+
if (value === null) {
|
|
124
|
+
result.nullValue = NullValue.NULL_VALUE;
|
|
125
|
+
} else if (typeof value === "boolean") {
|
|
126
|
+
result.boolValue = value;
|
|
127
|
+
} else if (typeof value === "number") {
|
|
128
|
+
result.numberValue = value;
|
|
129
|
+
} else if (typeof value === "string") {
|
|
130
|
+
result.stringValue = value;
|
|
131
|
+
} else if (globalThis.Array.isArray(value)) {
|
|
132
|
+
result.listValue = ListValue.wrap(value);
|
|
133
|
+
} else if (typeof value === "object") {
|
|
134
|
+
result.structValue = Struct.wrap(value);
|
|
135
|
+
} else if (typeof value !== "undefined") {
|
|
136
|
+
throw new globalThis.Error("Unsupported any value type: " + typeof value);
|
|
137
|
+
}
|
|
138
|
+
return result;
|
|
139
|
+
},
|
|
140
|
+
|
|
141
|
+
unwrap(message: any): string | number | boolean | Object | null | Array<any> | undefined {
|
|
142
|
+
if (message?.hasOwnProperty("stringValue") && message.stringValue !== undefined) {
|
|
143
|
+
return message.stringValue;
|
|
144
|
+
} else if (message?.hasOwnProperty("numberValue") && message?.numberValue !== undefined) {
|
|
145
|
+
return message.numberValue;
|
|
146
|
+
} else if (message?.hasOwnProperty("boolValue") && message?.boolValue !== undefined) {
|
|
147
|
+
return message.boolValue;
|
|
148
|
+
} else if (message?.hasOwnProperty("structValue") && message?.structValue !== undefined) {
|
|
149
|
+
return Struct.unwrap(message.structValue as any);
|
|
150
|
+
} else if (message?.hasOwnProperty("listValue") && message?.listValue !== undefined) {
|
|
151
|
+
return ListValue.unwrap(message.listValue);
|
|
152
|
+
} else if (message?.hasOwnProperty("nullValue") && message?.nullValue !== undefined) {
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
return undefined;
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
function createBaseListValue(): ListValue {
|
|
160
|
+
return { values: [] };
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export const ListValue: MessageFns<ListValue> & ListValueWrapperFns = {
|
|
164
|
+
wrap(array: Array<any> | undefined): ListValue {
|
|
165
|
+
const result = createBaseListValue();
|
|
166
|
+
result.values = (array ?? []).map(Value.wrap);
|
|
167
|
+
return result;
|
|
168
|
+
},
|
|
169
|
+
|
|
170
|
+
unwrap(message: ListValue): Array<any> {
|
|
171
|
+
if (message?.hasOwnProperty("values") && globalThis.Array.isArray(message.values)) {
|
|
172
|
+
return message.values.map(Value.unwrap);
|
|
173
|
+
} else {
|
|
174
|
+
return message as any;
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
wrappers[".google.protobuf.Struct"] = { fromObject: Struct.wrap, toObject: Struct.unwrap } as any;
|
|
180
|
+
|
|
181
|
+
export interface MessageFns<T> {
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export interface StructWrapperFns {
|
|
185
|
+
wrap(object: { [key: string]: any } | undefined): Struct;
|
|
186
|
+
unwrap(message: Struct): { [key: string]: any };
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export interface AnyValueWrapperFns {
|
|
190
|
+
wrap(value: any): Value;
|
|
191
|
+
unwrap(message: any): string | number | boolean | Object | null | Array<any> | undefined;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export interface ListValueWrapperFns {
|
|
195
|
+
wrap(array: Array<any> | undefined): ListValue;
|
|
196
|
+
unwrap(message: ListValue): Array<any>;
|
|
197
|
+
}
|
package/gen/ts/images.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.0
|
|
4
|
+
// protoc v6.33.2
|
|
5
|
+
// source: images.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
import { Timestamp } from "./google/protobuf/timestamp";
|
|
11
|
+
|
|
12
|
+
export const protobufPackage = "images.v1";
|
|
13
|
+
|
|
14
|
+
export interface GetStatusImagesRequest {
|
|
15
|
+
listingId: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface GetStatusImagesResponse {
|
|
19
|
+
listingId: string;
|
|
20
|
+
status: string;
|
|
21
|
+
imageCount: number;
|
|
22
|
+
results: ImageProcessing[];
|
|
23
|
+
createdAt: Timestamp | undefined;
|
|
24
|
+
completedAt: Timestamp | undefined;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface ImageProcessing {
|
|
28
|
+
imageNumber: number;
|
|
29
|
+
status: string;
|
|
30
|
+
error: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const IMAGES_V1_PACKAGE_NAME = "images.v1";
|
|
34
|
+
|
|
35
|
+
export interface ImagesServiceClient {
|
|
36
|
+
getStatusImages(request: GetStatusImagesRequest): Observable<GetStatusImagesResponse>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface ImagesServiceController {
|
|
40
|
+
getStatusImages(
|
|
41
|
+
request: GetStatusImagesRequest,
|
|
42
|
+
): Promise<GetStatusImagesResponse> | Observable<GetStatusImagesResponse> | GetStatusImagesResponse;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function ImagesServiceControllerMethods() {
|
|
46
|
+
return function (constructor: Function) {
|
|
47
|
+
const grpcMethods: string[] = ["getStatusImages"];
|
|
48
|
+
for (const method of grpcMethods) {
|
|
49
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
50
|
+
GrpcMethod("ImagesService", method)(constructor.prototype[method], method, descriptor);
|
|
51
|
+
}
|
|
52
|
+
const grpcStreamMethods: string[] = [];
|
|
53
|
+
for (const method of grpcStreamMethods) {
|
|
54
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
55
|
+
GrpcStreamMethod("ImagesService", method)(constructor.prototype[method], method, descriptor);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export const IMAGES_SERVICE_NAME = "ImagesService";
|