@sagebox-be/proto-contracts 1.0.5 → 1.0.6
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/dist/index.d.ts +1 -1
- package/dist/index.js +4 -2
- package/dist/types/product.d.ts +91 -0
- package/dist/types/product.js +1026 -0
- package/package.json +4 -23
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from '
|
|
1
|
+
export * from '../src/types/product';
|
|
2
2
|
export { getProtoPath } from './utils';
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
// // Export all gRPC interfaces and types
|
|
3
|
+
// export * from './interfaces/product';
|
|
2
4
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
5
|
if (k2 === undefined) k2 = k;
|
|
4
6
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -15,8 +17,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
17
|
};
|
|
16
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
19
|
exports.getProtoPath = void 0;
|
|
18
|
-
// Export all gRPC
|
|
19
|
-
__exportStar(require("
|
|
20
|
+
// // Export all gRPC types for TypeScript
|
|
21
|
+
__exportStar(require("../src/types/product"), exports);
|
|
20
22
|
// Export proto file path helper
|
|
21
23
|
var utils_1 = require("./utils");
|
|
22
24
|
Object.defineProperty(exports, "getProtoPath", { enumerable: true, get: function () { return utils_1.getProtoPath; } });
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
|
|
2
|
+
export declare const protobufPackage = "product";
|
|
3
|
+
/** Request messages */
|
|
4
|
+
export interface GetProductsByCategoryIdRequest {
|
|
5
|
+
categoryId: string;
|
|
6
|
+
}
|
|
7
|
+
export interface GetProductByIdRequest {
|
|
8
|
+
id: string;
|
|
9
|
+
}
|
|
10
|
+
export interface CreateProductRequest {
|
|
11
|
+
name: string;
|
|
12
|
+
title: string;
|
|
13
|
+
description: string;
|
|
14
|
+
categoryId: string;
|
|
15
|
+
storeId: string;
|
|
16
|
+
status: string;
|
|
17
|
+
mediaKeys: string[];
|
|
18
|
+
skus: ProductSkuInput[];
|
|
19
|
+
}
|
|
20
|
+
/** Response messages */
|
|
21
|
+
export interface GetProductsResponse {
|
|
22
|
+
products: Product[];
|
|
23
|
+
}
|
|
24
|
+
export interface ProductResponse {
|
|
25
|
+
product: Product | undefined;
|
|
26
|
+
error: string;
|
|
27
|
+
}
|
|
28
|
+
/** Data structures */
|
|
29
|
+
export interface Product {
|
|
30
|
+
id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
title: string;
|
|
33
|
+
description: string;
|
|
34
|
+
keywords: string;
|
|
35
|
+
categoryId: string;
|
|
36
|
+
storeId: string;
|
|
37
|
+
viewedCount: number;
|
|
38
|
+
status: string;
|
|
39
|
+
url: string;
|
|
40
|
+
media: Media[];
|
|
41
|
+
createdAt: string;
|
|
42
|
+
updatedAt: string;
|
|
43
|
+
}
|
|
44
|
+
export interface Media {
|
|
45
|
+
id: string;
|
|
46
|
+
key: string;
|
|
47
|
+
url: string;
|
|
48
|
+
type: string;
|
|
49
|
+
createdAt: string;
|
|
50
|
+
updatedAt: string;
|
|
51
|
+
}
|
|
52
|
+
export interface ProductSkuInput {
|
|
53
|
+
price: number;
|
|
54
|
+
quantity: number;
|
|
55
|
+
brand?: string | undefined;
|
|
56
|
+
mediaKeys: string[];
|
|
57
|
+
attributeValues: AttributeValueInput[];
|
|
58
|
+
}
|
|
59
|
+
export interface AttributeValueInput {
|
|
60
|
+
attrId: string;
|
|
61
|
+
value: string;
|
|
62
|
+
name: string;
|
|
63
|
+
}
|
|
64
|
+
export declare const GetProductsByCategoryIdRequest: MessageFns<GetProductsByCategoryIdRequest>;
|
|
65
|
+
export declare const GetProductByIdRequest: MessageFns<GetProductByIdRequest>;
|
|
66
|
+
export declare const CreateProductRequest: MessageFns<CreateProductRequest>;
|
|
67
|
+
export declare const GetProductsResponse: MessageFns<GetProductsResponse>;
|
|
68
|
+
export declare const ProductResponse: MessageFns<ProductResponse>;
|
|
69
|
+
export declare const Product: MessageFns<Product>;
|
|
70
|
+
export declare const Media: MessageFns<Media>;
|
|
71
|
+
export declare const ProductSkuInput: MessageFns<ProductSkuInput>;
|
|
72
|
+
export declare const AttributeValueInput: MessageFns<AttributeValueInput>;
|
|
73
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
74
|
+
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
75
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
76
|
+
} : Partial<T>;
|
|
77
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
78
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
79
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
80
|
+
} & {
|
|
81
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
82
|
+
};
|
|
83
|
+
export interface MessageFns<T> {
|
|
84
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
85
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
86
|
+
fromJSON(object: any): T;
|
|
87
|
+
toJSON(message: T): unknown;
|
|
88
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
89
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
90
|
+
}
|
|
91
|
+
export {};
|
|
@@ -0,0 +1,1026 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.8.3
|
|
5
|
+
// protoc v6.33.2
|
|
6
|
+
// source: product.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.AttributeValueInput = exports.ProductSkuInput = exports.Media = exports.Product = exports.ProductResponse = exports.GetProductsResponse = exports.CreateProductRequest = exports.GetProductByIdRequest = exports.GetProductsByCategoryIdRequest = exports.protobufPackage = void 0;
|
|
9
|
+
/* eslint-disable */
|
|
10
|
+
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
11
|
+
exports.protobufPackage = 'product';
|
|
12
|
+
function createBaseGetProductsByCategoryIdRequest() {
|
|
13
|
+
return { categoryId: '' };
|
|
14
|
+
}
|
|
15
|
+
exports.GetProductsByCategoryIdRequest = {
|
|
16
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
17
|
+
if (message.categoryId !== '') {
|
|
18
|
+
writer.uint32(10).string(message.categoryId);
|
|
19
|
+
}
|
|
20
|
+
return writer;
|
|
21
|
+
},
|
|
22
|
+
decode(input, length) {
|
|
23
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
24
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
25
|
+
const message = createBaseGetProductsByCategoryIdRequest();
|
|
26
|
+
while (reader.pos < end) {
|
|
27
|
+
const tag = reader.uint32();
|
|
28
|
+
switch (tag >>> 3) {
|
|
29
|
+
case 1: {
|
|
30
|
+
if (tag !== 10) {
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
message.categoryId = reader.string();
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
reader.skip(tag & 7);
|
|
41
|
+
}
|
|
42
|
+
return message;
|
|
43
|
+
},
|
|
44
|
+
fromJSON(object) {
|
|
45
|
+
return {
|
|
46
|
+
categoryId: isSet(object.categoryId)
|
|
47
|
+
? globalThis.String(object.categoryId)
|
|
48
|
+
: '',
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
toJSON(message) {
|
|
52
|
+
const obj = {};
|
|
53
|
+
if (message.categoryId !== '') {
|
|
54
|
+
obj.categoryId = message.categoryId;
|
|
55
|
+
}
|
|
56
|
+
return obj;
|
|
57
|
+
},
|
|
58
|
+
create(base) {
|
|
59
|
+
return exports.GetProductsByCategoryIdRequest.fromPartial(base ?? {});
|
|
60
|
+
},
|
|
61
|
+
fromPartial(object) {
|
|
62
|
+
const message = createBaseGetProductsByCategoryIdRequest();
|
|
63
|
+
message.categoryId = object.categoryId ?? '';
|
|
64
|
+
return message;
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
function createBaseGetProductByIdRequest() {
|
|
68
|
+
return { id: '' };
|
|
69
|
+
}
|
|
70
|
+
exports.GetProductByIdRequest = {
|
|
71
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
72
|
+
if (message.id !== '') {
|
|
73
|
+
writer.uint32(10).string(message.id);
|
|
74
|
+
}
|
|
75
|
+
return writer;
|
|
76
|
+
},
|
|
77
|
+
decode(input, length) {
|
|
78
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
79
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
80
|
+
const message = createBaseGetProductByIdRequest();
|
|
81
|
+
while (reader.pos < end) {
|
|
82
|
+
const tag = reader.uint32();
|
|
83
|
+
switch (tag >>> 3) {
|
|
84
|
+
case 1: {
|
|
85
|
+
if (tag !== 10) {
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
message.id = reader.string();
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
reader.skip(tag & 7);
|
|
96
|
+
}
|
|
97
|
+
return message;
|
|
98
|
+
},
|
|
99
|
+
fromJSON(object) {
|
|
100
|
+
return { id: isSet(object.id) ? globalThis.String(object.id) : '' };
|
|
101
|
+
},
|
|
102
|
+
toJSON(message) {
|
|
103
|
+
const obj = {};
|
|
104
|
+
if (message.id !== '') {
|
|
105
|
+
obj.id = message.id;
|
|
106
|
+
}
|
|
107
|
+
return obj;
|
|
108
|
+
},
|
|
109
|
+
create(base) {
|
|
110
|
+
return exports.GetProductByIdRequest.fromPartial(base ?? {});
|
|
111
|
+
},
|
|
112
|
+
fromPartial(object) {
|
|
113
|
+
const message = createBaseGetProductByIdRequest();
|
|
114
|
+
message.id = object.id ?? '';
|
|
115
|
+
return message;
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
function createBaseCreateProductRequest() {
|
|
119
|
+
return {
|
|
120
|
+
name: '',
|
|
121
|
+
title: '',
|
|
122
|
+
description: '',
|
|
123
|
+
categoryId: '',
|
|
124
|
+
storeId: '',
|
|
125
|
+
status: '',
|
|
126
|
+
mediaKeys: [],
|
|
127
|
+
skus: [],
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
exports.CreateProductRequest = {
|
|
131
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
132
|
+
if (message.name !== '') {
|
|
133
|
+
writer.uint32(10).string(message.name);
|
|
134
|
+
}
|
|
135
|
+
if (message.title !== '') {
|
|
136
|
+
writer.uint32(18).string(message.title);
|
|
137
|
+
}
|
|
138
|
+
if (message.description !== '') {
|
|
139
|
+
writer.uint32(26).string(message.description);
|
|
140
|
+
}
|
|
141
|
+
if (message.categoryId !== '') {
|
|
142
|
+
writer.uint32(34).string(message.categoryId);
|
|
143
|
+
}
|
|
144
|
+
if (message.storeId !== '') {
|
|
145
|
+
writer.uint32(42).string(message.storeId);
|
|
146
|
+
}
|
|
147
|
+
if (message.status !== '') {
|
|
148
|
+
writer.uint32(50).string(message.status);
|
|
149
|
+
}
|
|
150
|
+
for (const v of message.mediaKeys) {
|
|
151
|
+
writer.uint32(58).string(v);
|
|
152
|
+
}
|
|
153
|
+
for (const v of message.skus) {
|
|
154
|
+
exports.ProductSkuInput.encode(v, writer.uint32(66).fork()).join();
|
|
155
|
+
}
|
|
156
|
+
return writer;
|
|
157
|
+
},
|
|
158
|
+
decode(input, length) {
|
|
159
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
160
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
161
|
+
const message = createBaseCreateProductRequest();
|
|
162
|
+
while (reader.pos < end) {
|
|
163
|
+
const tag = reader.uint32();
|
|
164
|
+
switch (tag >>> 3) {
|
|
165
|
+
case 1: {
|
|
166
|
+
if (tag !== 10) {
|
|
167
|
+
break;
|
|
168
|
+
}
|
|
169
|
+
message.name = reader.string();
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
case 2: {
|
|
173
|
+
if (tag !== 18) {
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
message.title = reader.string();
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
case 3: {
|
|
180
|
+
if (tag !== 26) {
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
message.description = reader.string();
|
|
184
|
+
continue;
|
|
185
|
+
}
|
|
186
|
+
case 4: {
|
|
187
|
+
if (tag !== 34) {
|
|
188
|
+
break;
|
|
189
|
+
}
|
|
190
|
+
message.categoryId = reader.string();
|
|
191
|
+
continue;
|
|
192
|
+
}
|
|
193
|
+
case 5: {
|
|
194
|
+
if (tag !== 42) {
|
|
195
|
+
break;
|
|
196
|
+
}
|
|
197
|
+
message.storeId = reader.string();
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
case 6: {
|
|
201
|
+
if (tag !== 50) {
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
204
|
+
message.status = reader.string();
|
|
205
|
+
continue;
|
|
206
|
+
}
|
|
207
|
+
case 7: {
|
|
208
|
+
if (tag !== 58) {
|
|
209
|
+
break;
|
|
210
|
+
}
|
|
211
|
+
message.mediaKeys.push(reader.string());
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
214
|
+
case 8: {
|
|
215
|
+
if (tag !== 66) {
|
|
216
|
+
break;
|
|
217
|
+
}
|
|
218
|
+
message.skus.push(exports.ProductSkuInput.decode(reader, reader.uint32()));
|
|
219
|
+
continue;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
223
|
+
break;
|
|
224
|
+
}
|
|
225
|
+
reader.skip(tag & 7);
|
|
226
|
+
}
|
|
227
|
+
return message;
|
|
228
|
+
},
|
|
229
|
+
fromJSON(object) {
|
|
230
|
+
return {
|
|
231
|
+
name: isSet(object.name) ? globalThis.String(object.name) : '',
|
|
232
|
+
title: isSet(object.title) ? globalThis.String(object.title) : '',
|
|
233
|
+
description: isSet(object.description)
|
|
234
|
+
? globalThis.String(object.description)
|
|
235
|
+
: '',
|
|
236
|
+
categoryId: isSet(object.categoryId)
|
|
237
|
+
? globalThis.String(object.categoryId)
|
|
238
|
+
: '',
|
|
239
|
+
storeId: isSet(object.storeId) ? globalThis.String(object.storeId) : '',
|
|
240
|
+
status: isSet(object.status) ? globalThis.String(object.status) : '',
|
|
241
|
+
mediaKeys: globalThis.Array.isArray(object?.mediaKeys)
|
|
242
|
+
? object.mediaKeys.map((e) => globalThis.String(e))
|
|
243
|
+
: [],
|
|
244
|
+
skus: globalThis.Array.isArray(object?.skus)
|
|
245
|
+
? object.skus.map((e) => exports.ProductSkuInput.fromJSON(e))
|
|
246
|
+
: [],
|
|
247
|
+
};
|
|
248
|
+
},
|
|
249
|
+
toJSON(message) {
|
|
250
|
+
const obj = {};
|
|
251
|
+
if (message.name !== '') {
|
|
252
|
+
obj.name = message.name;
|
|
253
|
+
}
|
|
254
|
+
if (message.title !== '') {
|
|
255
|
+
obj.title = message.title;
|
|
256
|
+
}
|
|
257
|
+
if (message.description !== '') {
|
|
258
|
+
obj.description = message.description;
|
|
259
|
+
}
|
|
260
|
+
if (message.categoryId !== '') {
|
|
261
|
+
obj.categoryId = message.categoryId;
|
|
262
|
+
}
|
|
263
|
+
if (message.storeId !== '') {
|
|
264
|
+
obj.storeId = message.storeId;
|
|
265
|
+
}
|
|
266
|
+
if (message.status !== '') {
|
|
267
|
+
obj.status = message.status;
|
|
268
|
+
}
|
|
269
|
+
if (message.mediaKeys?.length) {
|
|
270
|
+
obj.mediaKeys = message.mediaKeys;
|
|
271
|
+
}
|
|
272
|
+
if (message.skus?.length) {
|
|
273
|
+
obj.skus = message.skus.map((e) => exports.ProductSkuInput.toJSON(e));
|
|
274
|
+
}
|
|
275
|
+
return obj;
|
|
276
|
+
},
|
|
277
|
+
create(base) {
|
|
278
|
+
return exports.CreateProductRequest.fromPartial(base ?? {});
|
|
279
|
+
},
|
|
280
|
+
fromPartial(object) {
|
|
281
|
+
const message = createBaseCreateProductRequest();
|
|
282
|
+
message.name = object.name ?? '';
|
|
283
|
+
message.title = object.title ?? '';
|
|
284
|
+
message.description = object.description ?? '';
|
|
285
|
+
message.categoryId = object.categoryId ?? '';
|
|
286
|
+
message.storeId = object.storeId ?? '';
|
|
287
|
+
message.status = object.status ?? '';
|
|
288
|
+
message.mediaKeys = object.mediaKeys?.map((e) => e) || [];
|
|
289
|
+
message.skus =
|
|
290
|
+
object.skus?.map((e) => exports.ProductSkuInput.fromPartial(e)) || [];
|
|
291
|
+
return message;
|
|
292
|
+
},
|
|
293
|
+
};
|
|
294
|
+
function createBaseGetProductsResponse() {
|
|
295
|
+
return { products: [] };
|
|
296
|
+
}
|
|
297
|
+
exports.GetProductsResponse = {
|
|
298
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
299
|
+
for (const v of message.products) {
|
|
300
|
+
exports.Product.encode(v, writer.uint32(10).fork()).join();
|
|
301
|
+
}
|
|
302
|
+
return writer;
|
|
303
|
+
},
|
|
304
|
+
decode(input, length) {
|
|
305
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
306
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
307
|
+
const message = createBaseGetProductsResponse();
|
|
308
|
+
while (reader.pos < end) {
|
|
309
|
+
const tag = reader.uint32();
|
|
310
|
+
switch (tag >>> 3) {
|
|
311
|
+
case 1: {
|
|
312
|
+
if (tag !== 10) {
|
|
313
|
+
break;
|
|
314
|
+
}
|
|
315
|
+
message.products.push(exports.Product.decode(reader, reader.uint32()));
|
|
316
|
+
continue;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
320
|
+
break;
|
|
321
|
+
}
|
|
322
|
+
reader.skip(tag & 7);
|
|
323
|
+
}
|
|
324
|
+
return message;
|
|
325
|
+
},
|
|
326
|
+
fromJSON(object) {
|
|
327
|
+
return {
|
|
328
|
+
products: globalThis.Array.isArray(object?.products)
|
|
329
|
+
? object.products.map((e) => exports.Product.fromJSON(e))
|
|
330
|
+
: [],
|
|
331
|
+
};
|
|
332
|
+
},
|
|
333
|
+
toJSON(message) {
|
|
334
|
+
const obj = {};
|
|
335
|
+
if (message.products?.length) {
|
|
336
|
+
obj.products = message.products.map((e) => exports.Product.toJSON(e));
|
|
337
|
+
}
|
|
338
|
+
return obj;
|
|
339
|
+
},
|
|
340
|
+
create(base) {
|
|
341
|
+
return exports.GetProductsResponse.fromPartial(base ?? {});
|
|
342
|
+
},
|
|
343
|
+
fromPartial(object) {
|
|
344
|
+
const message = createBaseGetProductsResponse();
|
|
345
|
+
message.products =
|
|
346
|
+
object.products?.map((e) => exports.Product.fromPartial(e)) || [];
|
|
347
|
+
return message;
|
|
348
|
+
},
|
|
349
|
+
};
|
|
350
|
+
function createBaseProductResponse() {
|
|
351
|
+
return { product: undefined, error: '' };
|
|
352
|
+
}
|
|
353
|
+
exports.ProductResponse = {
|
|
354
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
355
|
+
if (message.product !== undefined) {
|
|
356
|
+
exports.Product.encode(message.product, writer.uint32(10).fork()).join();
|
|
357
|
+
}
|
|
358
|
+
if (message.error !== '') {
|
|
359
|
+
writer.uint32(18).string(message.error);
|
|
360
|
+
}
|
|
361
|
+
return writer;
|
|
362
|
+
},
|
|
363
|
+
decode(input, length) {
|
|
364
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
365
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
366
|
+
const message = createBaseProductResponse();
|
|
367
|
+
while (reader.pos < end) {
|
|
368
|
+
const tag = reader.uint32();
|
|
369
|
+
switch (tag >>> 3) {
|
|
370
|
+
case 1: {
|
|
371
|
+
if (tag !== 10) {
|
|
372
|
+
break;
|
|
373
|
+
}
|
|
374
|
+
message.product = exports.Product.decode(reader, reader.uint32());
|
|
375
|
+
continue;
|
|
376
|
+
}
|
|
377
|
+
case 2: {
|
|
378
|
+
if (tag !== 18) {
|
|
379
|
+
break;
|
|
380
|
+
}
|
|
381
|
+
message.error = reader.string();
|
|
382
|
+
continue;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
386
|
+
break;
|
|
387
|
+
}
|
|
388
|
+
reader.skip(tag & 7);
|
|
389
|
+
}
|
|
390
|
+
return message;
|
|
391
|
+
},
|
|
392
|
+
fromJSON(object) {
|
|
393
|
+
return {
|
|
394
|
+
product: isSet(object.product)
|
|
395
|
+
? exports.Product.fromJSON(object.product)
|
|
396
|
+
: undefined,
|
|
397
|
+
error: isSet(object.error) ? globalThis.String(object.error) : '',
|
|
398
|
+
};
|
|
399
|
+
},
|
|
400
|
+
toJSON(message) {
|
|
401
|
+
const obj = {};
|
|
402
|
+
if (message.product !== undefined) {
|
|
403
|
+
obj.product = exports.Product.toJSON(message.product);
|
|
404
|
+
}
|
|
405
|
+
if (message.error !== '') {
|
|
406
|
+
obj.error = message.error;
|
|
407
|
+
}
|
|
408
|
+
return obj;
|
|
409
|
+
},
|
|
410
|
+
create(base) {
|
|
411
|
+
return exports.ProductResponse.fromPartial(base ?? {});
|
|
412
|
+
},
|
|
413
|
+
fromPartial(object) {
|
|
414
|
+
const message = createBaseProductResponse();
|
|
415
|
+
message.product =
|
|
416
|
+
object.product !== undefined && object.product !== null
|
|
417
|
+
? exports.Product.fromPartial(object.product)
|
|
418
|
+
: undefined;
|
|
419
|
+
message.error = object.error ?? '';
|
|
420
|
+
return message;
|
|
421
|
+
},
|
|
422
|
+
};
|
|
423
|
+
function createBaseProduct() {
|
|
424
|
+
return {
|
|
425
|
+
id: '',
|
|
426
|
+
name: '',
|
|
427
|
+
title: '',
|
|
428
|
+
description: '',
|
|
429
|
+
keywords: '',
|
|
430
|
+
categoryId: '',
|
|
431
|
+
storeId: '',
|
|
432
|
+
viewedCount: 0,
|
|
433
|
+
status: '',
|
|
434
|
+
url: '',
|
|
435
|
+
media: [],
|
|
436
|
+
createdAt: '',
|
|
437
|
+
updatedAt: '',
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
exports.Product = {
|
|
441
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
442
|
+
if (message.id !== '') {
|
|
443
|
+
writer.uint32(10).string(message.id);
|
|
444
|
+
}
|
|
445
|
+
if (message.name !== '') {
|
|
446
|
+
writer.uint32(18).string(message.name);
|
|
447
|
+
}
|
|
448
|
+
if (message.title !== '') {
|
|
449
|
+
writer.uint32(26).string(message.title);
|
|
450
|
+
}
|
|
451
|
+
if (message.description !== '') {
|
|
452
|
+
writer.uint32(34).string(message.description);
|
|
453
|
+
}
|
|
454
|
+
if (message.keywords !== '') {
|
|
455
|
+
writer.uint32(42).string(message.keywords);
|
|
456
|
+
}
|
|
457
|
+
if (message.categoryId !== '') {
|
|
458
|
+
writer.uint32(50).string(message.categoryId);
|
|
459
|
+
}
|
|
460
|
+
if (message.storeId !== '') {
|
|
461
|
+
writer.uint32(58).string(message.storeId);
|
|
462
|
+
}
|
|
463
|
+
if (message.viewedCount !== 0) {
|
|
464
|
+
writer.uint32(64).int32(message.viewedCount);
|
|
465
|
+
}
|
|
466
|
+
if (message.status !== '') {
|
|
467
|
+
writer.uint32(74).string(message.status);
|
|
468
|
+
}
|
|
469
|
+
if (message.url !== '') {
|
|
470
|
+
writer.uint32(82).string(message.url);
|
|
471
|
+
}
|
|
472
|
+
for (const v of message.media) {
|
|
473
|
+
exports.Media.encode(v, writer.uint32(90).fork()).join();
|
|
474
|
+
}
|
|
475
|
+
if (message.createdAt !== '') {
|
|
476
|
+
writer.uint32(98).string(message.createdAt);
|
|
477
|
+
}
|
|
478
|
+
if (message.updatedAt !== '') {
|
|
479
|
+
writer.uint32(106).string(message.updatedAt);
|
|
480
|
+
}
|
|
481
|
+
return writer;
|
|
482
|
+
},
|
|
483
|
+
decode(input, length) {
|
|
484
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
485
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
486
|
+
const message = createBaseProduct();
|
|
487
|
+
while (reader.pos < end) {
|
|
488
|
+
const tag = reader.uint32();
|
|
489
|
+
switch (tag >>> 3) {
|
|
490
|
+
case 1: {
|
|
491
|
+
if (tag !== 10) {
|
|
492
|
+
break;
|
|
493
|
+
}
|
|
494
|
+
message.id = reader.string();
|
|
495
|
+
continue;
|
|
496
|
+
}
|
|
497
|
+
case 2: {
|
|
498
|
+
if (tag !== 18) {
|
|
499
|
+
break;
|
|
500
|
+
}
|
|
501
|
+
message.name = reader.string();
|
|
502
|
+
continue;
|
|
503
|
+
}
|
|
504
|
+
case 3: {
|
|
505
|
+
if (tag !== 26) {
|
|
506
|
+
break;
|
|
507
|
+
}
|
|
508
|
+
message.title = reader.string();
|
|
509
|
+
continue;
|
|
510
|
+
}
|
|
511
|
+
case 4: {
|
|
512
|
+
if (tag !== 34) {
|
|
513
|
+
break;
|
|
514
|
+
}
|
|
515
|
+
message.description = reader.string();
|
|
516
|
+
continue;
|
|
517
|
+
}
|
|
518
|
+
case 5: {
|
|
519
|
+
if (tag !== 42) {
|
|
520
|
+
break;
|
|
521
|
+
}
|
|
522
|
+
message.keywords = reader.string();
|
|
523
|
+
continue;
|
|
524
|
+
}
|
|
525
|
+
case 6: {
|
|
526
|
+
if (tag !== 50) {
|
|
527
|
+
break;
|
|
528
|
+
}
|
|
529
|
+
message.categoryId = reader.string();
|
|
530
|
+
continue;
|
|
531
|
+
}
|
|
532
|
+
case 7: {
|
|
533
|
+
if (tag !== 58) {
|
|
534
|
+
break;
|
|
535
|
+
}
|
|
536
|
+
message.storeId = reader.string();
|
|
537
|
+
continue;
|
|
538
|
+
}
|
|
539
|
+
case 8: {
|
|
540
|
+
if (tag !== 64) {
|
|
541
|
+
break;
|
|
542
|
+
}
|
|
543
|
+
message.viewedCount = reader.int32();
|
|
544
|
+
continue;
|
|
545
|
+
}
|
|
546
|
+
case 9: {
|
|
547
|
+
if (tag !== 74) {
|
|
548
|
+
break;
|
|
549
|
+
}
|
|
550
|
+
message.status = reader.string();
|
|
551
|
+
continue;
|
|
552
|
+
}
|
|
553
|
+
case 10: {
|
|
554
|
+
if (tag !== 82) {
|
|
555
|
+
break;
|
|
556
|
+
}
|
|
557
|
+
message.url = reader.string();
|
|
558
|
+
continue;
|
|
559
|
+
}
|
|
560
|
+
case 11: {
|
|
561
|
+
if (tag !== 90) {
|
|
562
|
+
break;
|
|
563
|
+
}
|
|
564
|
+
message.media.push(exports.Media.decode(reader, reader.uint32()));
|
|
565
|
+
continue;
|
|
566
|
+
}
|
|
567
|
+
case 12: {
|
|
568
|
+
if (tag !== 98) {
|
|
569
|
+
break;
|
|
570
|
+
}
|
|
571
|
+
message.createdAt = reader.string();
|
|
572
|
+
continue;
|
|
573
|
+
}
|
|
574
|
+
case 13: {
|
|
575
|
+
if (tag !== 106) {
|
|
576
|
+
break;
|
|
577
|
+
}
|
|
578
|
+
message.updatedAt = reader.string();
|
|
579
|
+
continue;
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
583
|
+
break;
|
|
584
|
+
}
|
|
585
|
+
reader.skip(tag & 7);
|
|
586
|
+
}
|
|
587
|
+
return message;
|
|
588
|
+
},
|
|
589
|
+
fromJSON(object) {
|
|
590
|
+
return {
|
|
591
|
+
id: isSet(object.id) ? globalThis.String(object.id) : '',
|
|
592
|
+
name: isSet(object.name) ? globalThis.String(object.name) : '',
|
|
593
|
+
title: isSet(object.title) ? globalThis.String(object.title) : '',
|
|
594
|
+
description: isSet(object.description)
|
|
595
|
+
? globalThis.String(object.description)
|
|
596
|
+
: '',
|
|
597
|
+
keywords: isSet(object.keywords)
|
|
598
|
+
? globalThis.String(object.keywords)
|
|
599
|
+
: '',
|
|
600
|
+
categoryId: isSet(object.categoryId)
|
|
601
|
+
? globalThis.String(object.categoryId)
|
|
602
|
+
: '',
|
|
603
|
+
storeId: isSet(object.storeId) ? globalThis.String(object.storeId) : '',
|
|
604
|
+
viewedCount: isSet(object.viewedCount)
|
|
605
|
+
? globalThis.Number(object.viewedCount)
|
|
606
|
+
: 0,
|
|
607
|
+
status: isSet(object.status) ? globalThis.String(object.status) : '',
|
|
608
|
+
url: isSet(object.url) ? globalThis.String(object.url) : '',
|
|
609
|
+
media: globalThis.Array.isArray(object?.media)
|
|
610
|
+
? object.media.map((e) => exports.Media.fromJSON(e))
|
|
611
|
+
: [],
|
|
612
|
+
createdAt: isSet(object.createdAt)
|
|
613
|
+
? globalThis.String(object.createdAt)
|
|
614
|
+
: '',
|
|
615
|
+
updatedAt: isSet(object.updatedAt)
|
|
616
|
+
? globalThis.String(object.updatedAt)
|
|
617
|
+
: '',
|
|
618
|
+
};
|
|
619
|
+
},
|
|
620
|
+
toJSON(message) {
|
|
621
|
+
const obj = {};
|
|
622
|
+
if (message.id !== '') {
|
|
623
|
+
obj.id = message.id;
|
|
624
|
+
}
|
|
625
|
+
if (message.name !== '') {
|
|
626
|
+
obj.name = message.name;
|
|
627
|
+
}
|
|
628
|
+
if (message.title !== '') {
|
|
629
|
+
obj.title = message.title;
|
|
630
|
+
}
|
|
631
|
+
if (message.description !== '') {
|
|
632
|
+
obj.description = message.description;
|
|
633
|
+
}
|
|
634
|
+
if (message.keywords !== '') {
|
|
635
|
+
obj.keywords = message.keywords;
|
|
636
|
+
}
|
|
637
|
+
if (message.categoryId !== '') {
|
|
638
|
+
obj.categoryId = message.categoryId;
|
|
639
|
+
}
|
|
640
|
+
if (message.storeId !== '') {
|
|
641
|
+
obj.storeId = message.storeId;
|
|
642
|
+
}
|
|
643
|
+
if (message.viewedCount !== 0) {
|
|
644
|
+
obj.viewedCount = Math.round(message.viewedCount);
|
|
645
|
+
}
|
|
646
|
+
if (message.status !== '') {
|
|
647
|
+
obj.status = message.status;
|
|
648
|
+
}
|
|
649
|
+
if (message.url !== '') {
|
|
650
|
+
obj.url = message.url;
|
|
651
|
+
}
|
|
652
|
+
if (message.media?.length) {
|
|
653
|
+
obj.media = message.media.map((e) => exports.Media.toJSON(e));
|
|
654
|
+
}
|
|
655
|
+
if (message.createdAt !== '') {
|
|
656
|
+
obj.createdAt = message.createdAt;
|
|
657
|
+
}
|
|
658
|
+
if (message.updatedAt !== '') {
|
|
659
|
+
obj.updatedAt = message.updatedAt;
|
|
660
|
+
}
|
|
661
|
+
return obj;
|
|
662
|
+
},
|
|
663
|
+
create(base) {
|
|
664
|
+
return exports.Product.fromPartial(base ?? {});
|
|
665
|
+
},
|
|
666
|
+
fromPartial(object) {
|
|
667
|
+
const message = createBaseProduct();
|
|
668
|
+
message.id = object.id ?? '';
|
|
669
|
+
message.name = object.name ?? '';
|
|
670
|
+
message.title = object.title ?? '';
|
|
671
|
+
message.description = object.description ?? '';
|
|
672
|
+
message.keywords = object.keywords ?? '';
|
|
673
|
+
message.categoryId = object.categoryId ?? '';
|
|
674
|
+
message.storeId = object.storeId ?? '';
|
|
675
|
+
message.viewedCount = object.viewedCount ?? 0;
|
|
676
|
+
message.status = object.status ?? '';
|
|
677
|
+
message.url = object.url ?? '';
|
|
678
|
+
message.media = object.media?.map((e) => exports.Media.fromPartial(e)) || [];
|
|
679
|
+
message.createdAt = object.createdAt ?? '';
|
|
680
|
+
message.updatedAt = object.updatedAt ?? '';
|
|
681
|
+
return message;
|
|
682
|
+
},
|
|
683
|
+
};
|
|
684
|
+
function createBaseMedia() {
|
|
685
|
+
return { id: '', key: '', url: '', type: '', createdAt: '', updatedAt: '' };
|
|
686
|
+
}
|
|
687
|
+
exports.Media = {
|
|
688
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
689
|
+
if (message.id !== '') {
|
|
690
|
+
writer.uint32(10).string(message.id);
|
|
691
|
+
}
|
|
692
|
+
if (message.key !== '') {
|
|
693
|
+
writer.uint32(18).string(message.key);
|
|
694
|
+
}
|
|
695
|
+
if (message.url !== '') {
|
|
696
|
+
writer.uint32(26).string(message.url);
|
|
697
|
+
}
|
|
698
|
+
if (message.type !== '') {
|
|
699
|
+
writer.uint32(34).string(message.type);
|
|
700
|
+
}
|
|
701
|
+
if (message.createdAt !== '') {
|
|
702
|
+
writer.uint32(42).string(message.createdAt);
|
|
703
|
+
}
|
|
704
|
+
if (message.updatedAt !== '') {
|
|
705
|
+
writer.uint32(50).string(message.updatedAt);
|
|
706
|
+
}
|
|
707
|
+
return writer;
|
|
708
|
+
},
|
|
709
|
+
decode(input, length) {
|
|
710
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
711
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
712
|
+
const message = createBaseMedia();
|
|
713
|
+
while (reader.pos < end) {
|
|
714
|
+
const tag = reader.uint32();
|
|
715
|
+
switch (tag >>> 3) {
|
|
716
|
+
case 1: {
|
|
717
|
+
if (tag !== 10) {
|
|
718
|
+
break;
|
|
719
|
+
}
|
|
720
|
+
message.id = reader.string();
|
|
721
|
+
continue;
|
|
722
|
+
}
|
|
723
|
+
case 2: {
|
|
724
|
+
if (tag !== 18) {
|
|
725
|
+
break;
|
|
726
|
+
}
|
|
727
|
+
message.key = reader.string();
|
|
728
|
+
continue;
|
|
729
|
+
}
|
|
730
|
+
case 3: {
|
|
731
|
+
if (tag !== 26) {
|
|
732
|
+
break;
|
|
733
|
+
}
|
|
734
|
+
message.url = reader.string();
|
|
735
|
+
continue;
|
|
736
|
+
}
|
|
737
|
+
case 4: {
|
|
738
|
+
if (tag !== 34) {
|
|
739
|
+
break;
|
|
740
|
+
}
|
|
741
|
+
message.type = reader.string();
|
|
742
|
+
continue;
|
|
743
|
+
}
|
|
744
|
+
case 5: {
|
|
745
|
+
if (tag !== 42) {
|
|
746
|
+
break;
|
|
747
|
+
}
|
|
748
|
+
message.createdAt = reader.string();
|
|
749
|
+
continue;
|
|
750
|
+
}
|
|
751
|
+
case 6: {
|
|
752
|
+
if (tag !== 50) {
|
|
753
|
+
break;
|
|
754
|
+
}
|
|
755
|
+
message.updatedAt = reader.string();
|
|
756
|
+
continue;
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
760
|
+
break;
|
|
761
|
+
}
|
|
762
|
+
reader.skip(tag & 7);
|
|
763
|
+
}
|
|
764
|
+
return message;
|
|
765
|
+
},
|
|
766
|
+
fromJSON(object) {
|
|
767
|
+
return {
|
|
768
|
+
id: isSet(object.id) ? globalThis.String(object.id) : '',
|
|
769
|
+
key: isSet(object.key) ? globalThis.String(object.key) : '',
|
|
770
|
+
url: isSet(object.url) ? globalThis.String(object.url) : '',
|
|
771
|
+
type: isSet(object.type) ? globalThis.String(object.type) : '',
|
|
772
|
+
createdAt: isSet(object.createdAt)
|
|
773
|
+
? globalThis.String(object.createdAt)
|
|
774
|
+
: '',
|
|
775
|
+
updatedAt: isSet(object.updatedAt)
|
|
776
|
+
? globalThis.String(object.updatedAt)
|
|
777
|
+
: '',
|
|
778
|
+
};
|
|
779
|
+
},
|
|
780
|
+
toJSON(message) {
|
|
781
|
+
const obj = {};
|
|
782
|
+
if (message.id !== '') {
|
|
783
|
+
obj.id = message.id;
|
|
784
|
+
}
|
|
785
|
+
if (message.key !== '') {
|
|
786
|
+
obj.key = message.key;
|
|
787
|
+
}
|
|
788
|
+
if (message.url !== '') {
|
|
789
|
+
obj.url = message.url;
|
|
790
|
+
}
|
|
791
|
+
if (message.type !== '') {
|
|
792
|
+
obj.type = message.type;
|
|
793
|
+
}
|
|
794
|
+
if (message.createdAt !== '') {
|
|
795
|
+
obj.createdAt = message.createdAt;
|
|
796
|
+
}
|
|
797
|
+
if (message.updatedAt !== '') {
|
|
798
|
+
obj.updatedAt = message.updatedAt;
|
|
799
|
+
}
|
|
800
|
+
return obj;
|
|
801
|
+
},
|
|
802
|
+
create(base) {
|
|
803
|
+
return exports.Media.fromPartial(base ?? {});
|
|
804
|
+
},
|
|
805
|
+
fromPartial(object) {
|
|
806
|
+
const message = createBaseMedia();
|
|
807
|
+
message.id = object.id ?? '';
|
|
808
|
+
message.key = object.key ?? '';
|
|
809
|
+
message.url = object.url ?? '';
|
|
810
|
+
message.type = object.type ?? '';
|
|
811
|
+
message.createdAt = object.createdAt ?? '';
|
|
812
|
+
message.updatedAt = object.updatedAt ?? '';
|
|
813
|
+
return message;
|
|
814
|
+
},
|
|
815
|
+
};
|
|
816
|
+
function createBaseProductSkuInput() {
|
|
817
|
+
return {
|
|
818
|
+
price: 0,
|
|
819
|
+
quantity: 0,
|
|
820
|
+
brand: undefined,
|
|
821
|
+
mediaKeys: [],
|
|
822
|
+
attributeValues: [],
|
|
823
|
+
};
|
|
824
|
+
}
|
|
825
|
+
exports.ProductSkuInput = {
|
|
826
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
827
|
+
if (message.price !== 0) {
|
|
828
|
+
writer.uint32(8).int32(message.price);
|
|
829
|
+
}
|
|
830
|
+
if (message.quantity !== 0) {
|
|
831
|
+
writer.uint32(16).int32(message.quantity);
|
|
832
|
+
}
|
|
833
|
+
if (message.brand !== undefined) {
|
|
834
|
+
writer.uint32(26).string(message.brand);
|
|
835
|
+
}
|
|
836
|
+
for (const v of message.mediaKeys) {
|
|
837
|
+
writer.uint32(34).string(v);
|
|
838
|
+
}
|
|
839
|
+
for (const v of message.attributeValues) {
|
|
840
|
+
exports.AttributeValueInput.encode(v, writer.uint32(42).fork()).join();
|
|
841
|
+
}
|
|
842
|
+
return writer;
|
|
843
|
+
},
|
|
844
|
+
decode(input, length) {
|
|
845
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
846
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
847
|
+
const message = createBaseProductSkuInput();
|
|
848
|
+
while (reader.pos < end) {
|
|
849
|
+
const tag = reader.uint32();
|
|
850
|
+
switch (tag >>> 3) {
|
|
851
|
+
case 1: {
|
|
852
|
+
if (tag !== 8) {
|
|
853
|
+
break;
|
|
854
|
+
}
|
|
855
|
+
message.price = reader.int32();
|
|
856
|
+
continue;
|
|
857
|
+
}
|
|
858
|
+
case 2: {
|
|
859
|
+
if (tag !== 16) {
|
|
860
|
+
break;
|
|
861
|
+
}
|
|
862
|
+
message.quantity = reader.int32();
|
|
863
|
+
continue;
|
|
864
|
+
}
|
|
865
|
+
case 3: {
|
|
866
|
+
if (tag !== 26) {
|
|
867
|
+
break;
|
|
868
|
+
}
|
|
869
|
+
message.brand = reader.string();
|
|
870
|
+
continue;
|
|
871
|
+
}
|
|
872
|
+
case 4: {
|
|
873
|
+
if (tag !== 34) {
|
|
874
|
+
break;
|
|
875
|
+
}
|
|
876
|
+
message.mediaKeys.push(reader.string());
|
|
877
|
+
continue;
|
|
878
|
+
}
|
|
879
|
+
case 5: {
|
|
880
|
+
if (tag !== 42) {
|
|
881
|
+
break;
|
|
882
|
+
}
|
|
883
|
+
message.attributeValues.push(exports.AttributeValueInput.decode(reader, reader.uint32()));
|
|
884
|
+
continue;
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
888
|
+
break;
|
|
889
|
+
}
|
|
890
|
+
reader.skip(tag & 7);
|
|
891
|
+
}
|
|
892
|
+
return message;
|
|
893
|
+
},
|
|
894
|
+
fromJSON(object) {
|
|
895
|
+
return {
|
|
896
|
+
price: isSet(object.price) ? globalThis.Number(object.price) : 0,
|
|
897
|
+
quantity: isSet(object.quantity) ? globalThis.Number(object.quantity) : 0,
|
|
898
|
+
brand: isSet(object.brand) ? globalThis.String(object.brand) : undefined,
|
|
899
|
+
mediaKeys: globalThis.Array.isArray(object?.mediaKeys)
|
|
900
|
+
? object.mediaKeys.map((e) => globalThis.String(e))
|
|
901
|
+
: [],
|
|
902
|
+
attributeValues: globalThis.Array.isArray(object?.attributeValues)
|
|
903
|
+
? object.attributeValues.map((e) => exports.AttributeValueInput.fromJSON(e))
|
|
904
|
+
: [],
|
|
905
|
+
};
|
|
906
|
+
},
|
|
907
|
+
toJSON(message) {
|
|
908
|
+
const obj = {};
|
|
909
|
+
if (message.price !== 0) {
|
|
910
|
+
obj.price = Math.round(message.price);
|
|
911
|
+
}
|
|
912
|
+
if (message.quantity !== 0) {
|
|
913
|
+
obj.quantity = Math.round(message.quantity);
|
|
914
|
+
}
|
|
915
|
+
if (message.brand !== undefined) {
|
|
916
|
+
obj.brand = message.brand;
|
|
917
|
+
}
|
|
918
|
+
if (message.mediaKeys?.length) {
|
|
919
|
+
obj.mediaKeys = message.mediaKeys;
|
|
920
|
+
}
|
|
921
|
+
if (message.attributeValues?.length) {
|
|
922
|
+
obj.attributeValues = message.attributeValues.map((e) => exports.AttributeValueInput.toJSON(e));
|
|
923
|
+
}
|
|
924
|
+
return obj;
|
|
925
|
+
},
|
|
926
|
+
create(base) {
|
|
927
|
+
return exports.ProductSkuInput.fromPartial(base ?? {});
|
|
928
|
+
},
|
|
929
|
+
fromPartial(object) {
|
|
930
|
+
const message = createBaseProductSkuInput();
|
|
931
|
+
message.price = object.price ?? 0;
|
|
932
|
+
message.quantity = object.quantity ?? 0;
|
|
933
|
+
message.brand = object.brand ?? undefined;
|
|
934
|
+
message.mediaKeys = object.mediaKeys?.map((e) => e) || [];
|
|
935
|
+
message.attributeValues =
|
|
936
|
+
object.attributeValues?.map((e) => exports.AttributeValueInput.fromPartial(e)) ||
|
|
937
|
+
[];
|
|
938
|
+
return message;
|
|
939
|
+
},
|
|
940
|
+
};
|
|
941
|
+
function createBaseAttributeValueInput() {
|
|
942
|
+
return { attrId: '', value: '', name: '' };
|
|
943
|
+
}
|
|
944
|
+
exports.AttributeValueInput = {
|
|
945
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
946
|
+
if (message.attrId !== '') {
|
|
947
|
+
writer.uint32(10).string(message.attrId);
|
|
948
|
+
}
|
|
949
|
+
if (message.value !== '') {
|
|
950
|
+
writer.uint32(18).string(message.value);
|
|
951
|
+
}
|
|
952
|
+
if (message.name !== '') {
|
|
953
|
+
writer.uint32(26).string(message.name);
|
|
954
|
+
}
|
|
955
|
+
return writer;
|
|
956
|
+
},
|
|
957
|
+
decode(input, length) {
|
|
958
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
959
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
960
|
+
const message = createBaseAttributeValueInput();
|
|
961
|
+
while (reader.pos < end) {
|
|
962
|
+
const tag = reader.uint32();
|
|
963
|
+
switch (tag >>> 3) {
|
|
964
|
+
case 1: {
|
|
965
|
+
if (tag !== 10) {
|
|
966
|
+
break;
|
|
967
|
+
}
|
|
968
|
+
message.attrId = reader.string();
|
|
969
|
+
continue;
|
|
970
|
+
}
|
|
971
|
+
case 2: {
|
|
972
|
+
if (tag !== 18) {
|
|
973
|
+
break;
|
|
974
|
+
}
|
|
975
|
+
message.value = reader.string();
|
|
976
|
+
continue;
|
|
977
|
+
}
|
|
978
|
+
case 3: {
|
|
979
|
+
if (tag !== 26) {
|
|
980
|
+
break;
|
|
981
|
+
}
|
|
982
|
+
message.name = reader.string();
|
|
983
|
+
continue;
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
987
|
+
break;
|
|
988
|
+
}
|
|
989
|
+
reader.skip(tag & 7);
|
|
990
|
+
}
|
|
991
|
+
return message;
|
|
992
|
+
},
|
|
993
|
+
fromJSON(object) {
|
|
994
|
+
return {
|
|
995
|
+
attrId: isSet(object.attrId) ? globalThis.String(object.attrId) : '',
|
|
996
|
+
value: isSet(object.value) ? globalThis.String(object.value) : '',
|
|
997
|
+
name: isSet(object.name) ? globalThis.String(object.name) : '',
|
|
998
|
+
};
|
|
999
|
+
},
|
|
1000
|
+
toJSON(message) {
|
|
1001
|
+
const obj = {};
|
|
1002
|
+
if (message.attrId !== '') {
|
|
1003
|
+
obj.attrId = message.attrId;
|
|
1004
|
+
}
|
|
1005
|
+
if (message.value !== '') {
|
|
1006
|
+
obj.value = message.value;
|
|
1007
|
+
}
|
|
1008
|
+
if (message.name !== '') {
|
|
1009
|
+
obj.name = message.name;
|
|
1010
|
+
}
|
|
1011
|
+
return obj;
|
|
1012
|
+
},
|
|
1013
|
+
create(base) {
|
|
1014
|
+
return exports.AttributeValueInput.fromPartial(base ?? {});
|
|
1015
|
+
},
|
|
1016
|
+
fromPartial(object) {
|
|
1017
|
+
const message = createBaseAttributeValueInput();
|
|
1018
|
+
message.attrId = object.attrId ?? '';
|
|
1019
|
+
message.value = object.value ?? '';
|
|
1020
|
+
message.name = object.name ?? '';
|
|
1021
|
+
return message;
|
|
1022
|
+
},
|
|
1023
|
+
};
|
|
1024
|
+
function isSet(value) {
|
|
1025
|
+
return value !== null && value !== undefined;
|
|
1026
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sagebox-be/proto-contracts",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "Sagebox gRPC Protocol Buffer contracts and TypeScript definitions",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -27,34 +27,15 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@bufbuild/protobuf": "^2.2.2",
|
|
29
29
|
"@grpc/grpc-js": "^1.14.3",
|
|
30
|
-
"@grpc/proto-loader": "^0.8.0"
|
|
31
|
-
"rxjs": "^7.8.1"
|
|
30
|
+
"@grpc/proto-loader": "^0.8.0"
|
|
32
31
|
},
|
|
33
32
|
"devDependencies": {
|
|
34
|
-
"@nestjs/microservices": "^11.1.9",
|
|
35
33
|
"typescript": "^5.0.0"
|
|
36
34
|
},
|
|
37
35
|
"peerDependencies": {
|
|
36
|
+
"@bufbuild/protobuf": "^2.2.2",
|
|
38
37
|
"@grpc/grpc-js": "^1.14.0",
|
|
39
|
-
"@grpc/proto-loader": "^0.8.0"
|
|
40
|
-
"@nestjs/common": "^11.0.0",
|
|
41
|
-
"@nestjs/core": "^11.0.0",
|
|
42
|
-
"@nestjs/microservices": "^11.0.0",
|
|
43
|
-
"@nestjs/platform-express": "^11.0.0"
|
|
44
|
-
},
|
|
45
|
-
"peerDependenciesMeta": {
|
|
46
|
-
"@nestjs/common": {
|
|
47
|
-
"optional": true
|
|
48
|
-
},
|
|
49
|
-
"@nestjs/core": {
|
|
50
|
-
"optional": true
|
|
51
|
-
},
|
|
52
|
-
"@nestjs/microservices": {
|
|
53
|
-
"optional": true
|
|
54
|
-
},
|
|
55
|
-
"@nestjs/platform-express": {
|
|
56
|
-
"optional": true
|
|
57
|
-
}
|
|
38
|
+
"@grpc/proto-loader": "^0.8.0"
|
|
58
39
|
},
|
|
59
40
|
"publishConfig": {
|
|
60
41
|
"access": "public"
|