@sagebox-be/proto-contracts 1.0.15 → 1.0.16
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/interfaces/sagebox.d.ts +37 -0
- package/dist/interfaces/sagebox.js +364 -7
- package/dist/types/sagebox.d.ts +48 -0
- package/dist/types/sagebox.js +581 -7
- package/package.json +1 -1
- package/proto/sagebox.proto +38 -2
package/dist/types/sagebox.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// protoc v6.33.2
|
|
6
6
|
// source: sagebox.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.ProductOutboxServiceClient = exports.ProductOutboxServiceService = exports.AddressServiceClient = exports.AddressServiceService = exports.ProductServiceClient = exports.ProductServiceService = exports.RetryEsResponse = exports.RetryOutboxResponse = exports.PublishOutboxResponse = exports.RetryEsRequest = exports.RetryOutboxRequest = exports.PublishOutboxRequest = exports.AddressUnit = exports.AttributeValueInput = exports.ProductSkuInput = exports.Media = exports.Product = exports.GetWardsResponse = exports.GetDistrictsResponse = exports.GetProvincesResponse = exports.GetWardsRequest = exports.GetDistrictsRequest = exports.GetProvincesRequest = exports.ProductResponse = exports.GetProductsResponse = exports.CreateProductRequest = exports.GetProductByIdRequest = exports.GetProductsByCategoryIdRequest = exports.protobufPackage = void 0;
|
|
8
|
+
exports.ProductOutboxServiceClient = exports.ProductOutboxServiceService = exports.AddressServiceClient = exports.AddressServiceService = exports.ProductServiceClient = exports.ProductServiceService = exports.RetryEsResponse = exports.RetryOutboxResponse = exports.PublishOutboxResponse = exports.RetryEsRequest = exports.RetryOutboxRequest = exports.PublishOutboxRequest = exports.AddressUnit = exports.AttributeValueInput = exports.ProductSkuInput = exports.Media = exports.Sku = exports.Product = exports.GetWardsResponse = exports.GetDistrictsResponse = exports.GetProvincesResponse = exports.GetWardsRequest = exports.GetDistrictsRequest = exports.GetProvincesRequest = exports.SkuResponse = exports.ProductResponse = exports.GetProductsResponse = exports.UpdateSkuRequest = exports.CreateProductRequest = exports.GetProductByIdRequest = exports.GetProductsByCategoryIdRequest = exports.protobufPackage = void 0;
|
|
9
9
|
/* eslint-disable */
|
|
10
10
|
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
11
11
|
const grpc_js_1 = require("@grpc/grpc-js");
|
|
@@ -278,6 +278,185 @@ exports.CreateProductRequest = {
|
|
|
278
278
|
return message;
|
|
279
279
|
},
|
|
280
280
|
};
|
|
281
|
+
function createBaseUpdateSkuRequest() {
|
|
282
|
+
return {
|
|
283
|
+
id: '',
|
|
284
|
+
price: undefined,
|
|
285
|
+
width: undefined,
|
|
286
|
+
height: undefined,
|
|
287
|
+
length: undefined,
|
|
288
|
+
weight: undefined,
|
|
289
|
+
mediaKeys: [],
|
|
290
|
+
attributeValues: [],
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
exports.UpdateSkuRequest = {
|
|
294
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
295
|
+
if (message.id !== '') {
|
|
296
|
+
writer.uint32(10).string(message.id);
|
|
297
|
+
}
|
|
298
|
+
if (message.price !== undefined) {
|
|
299
|
+
writer.uint32(16).int32(message.price);
|
|
300
|
+
}
|
|
301
|
+
if (message.width !== undefined) {
|
|
302
|
+
writer.uint32(24).int32(message.width);
|
|
303
|
+
}
|
|
304
|
+
if (message.height !== undefined) {
|
|
305
|
+
writer.uint32(32).int32(message.height);
|
|
306
|
+
}
|
|
307
|
+
if (message.length !== undefined) {
|
|
308
|
+
writer.uint32(40).int32(message.length);
|
|
309
|
+
}
|
|
310
|
+
if (message.weight !== undefined) {
|
|
311
|
+
writer.uint32(48).int32(message.weight);
|
|
312
|
+
}
|
|
313
|
+
for (const v of message.mediaKeys) {
|
|
314
|
+
writer.uint32(58).string(v);
|
|
315
|
+
}
|
|
316
|
+
for (const v of message.attributeValues) {
|
|
317
|
+
exports.AttributeValueInput.encode(v, writer.uint32(66).fork()).join();
|
|
318
|
+
}
|
|
319
|
+
return writer;
|
|
320
|
+
},
|
|
321
|
+
decode(input, length) {
|
|
322
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
323
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
324
|
+
const message = createBaseUpdateSkuRequest();
|
|
325
|
+
while (reader.pos < end) {
|
|
326
|
+
const tag = reader.uint32();
|
|
327
|
+
switch (tag >>> 3) {
|
|
328
|
+
case 1: {
|
|
329
|
+
if (tag !== 10) {
|
|
330
|
+
break;
|
|
331
|
+
}
|
|
332
|
+
message.id = reader.string();
|
|
333
|
+
continue;
|
|
334
|
+
}
|
|
335
|
+
case 2: {
|
|
336
|
+
if (tag !== 16) {
|
|
337
|
+
break;
|
|
338
|
+
}
|
|
339
|
+
message.price = reader.int32();
|
|
340
|
+
continue;
|
|
341
|
+
}
|
|
342
|
+
case 3: {
|
|
343
|
+
if (tag !== 24) {
|
|
344
|
+
break;
|
|
345
|
+
}
|
|
346
|
+
message.width = reader.int32();
|
|
347
|
+
continue;
|
|
348
|
+
}
|
|
349
|
+
case 4: {
|
|
350
|
+
if (tag !== 32) {
|
|
351
|
+
break;
|
|
352
|
+
}
|
|
353
|
+
message.height = reader.int32();
|
|
354
|
+
continue;
|
|
355
|
+
}
|
|
356
|
+
case 5: {
|
|
357
|
+
if (tag !== 40) {
|
|
358
|
+
break;
|
|
359
|
+
}
|
|
360
|
+
message.length = reader.int32();
|
|
361
|
+
continue;
|
|
362
|
+
}
|
|
363
|
+
case 6: {
|
|
364
|
+
if (tag !== 48) {
|
|
365
|
+
break;
|
|
366
|
+
}
|
|
367
|
+
message.weight = reader.int32();
|
|
368
|
+
continue;
|
|
369
|
+
}
|
|
370
|
+
case 7: {
|
|
371
|
+
if (tag !== 58) {
|
|
372
|
+
break;
|
|
373
|
+
}
|
|
374
|
+
message.mediaKeys.push(reader.string());
|
|
375
|
+
continue;
|
|
376
|
+
}
|
|
377
|
+
case 8: {
|
|
378
|
+
if (tag !== 66) {
|
|
379
|
+
break;
|
|
380
|
+
}
|
|
381
|
+
message.attributeValues.push(exports.AttributeValueInput.decode(reader, reader.uint32()));
|
|
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
|
+
id: isSet(object.id) ? globalThis.String(object.id) : '',
|
|
395
|
+
price: isSet(object.price) ? globalThis.Number(object.price) : undefined,
|
|
396
|
+
width: isSet(object.width) ? globalThis.Number(object.width) : undefined,
|
|
397
|
+
height: isSet(object.height)
|
|
398
|
+
? globalThis.Number(object.height)
|
|
399
|
+
: undefined,
|
|
400
|
+
length: isSet(object.length)
|
|
401
|
+
? globalThis.Number(object.length)
|
|
402
|
+
: undefined,
|
|
403
|
+
weight: isSet(object.weight)
|
|
404
|
+
? globalThis.Number(object.weight)
|
|
405
|
+
: undefined,
|
|
406
|
+
mediaKeys: globalThis.Array.isArray(object?.mediaKeys)
|
|
407
|
+
? object.mediaKeys.map((e) => globalThis.String(e))
|
|
408
|
+
: [],
|
|
409
|
+
attributeValues: globalThis.Array.isArray(object?.attributeValues)
|
|
410
|
+
? object.attributeValues.map((e) => exports.AttributeValueInput.fromJSON(e))
|
|
411
|
+
: [],
|
|
412
|
+
};
|
|
413
|
+
},
|
|
414
|
+
toJSON(message) {
|
|
415
|
+
const obj = {};
|
|
416
|
+
if (message.id !== '') {
|
|
417
|
+
obj.id = message.id;
|
|
418
|
+
}
|
|
419
|
+
if (message.price !== undefined) {
|
|
420
|
+
obj.price = Math.round(message.price);
|
|
421
|
+
}
|
|
422
|
+
if (message.width !== undefined) {
|
|
423
|
+
obj.width = Math.round(message.width);
|
|
424
|
+
}
|
|
425
|
+
if (message.height !== undefined) {
|
|
426
|
+
obj.height = Math.round(message.height);
|
|
427
|
+
}
|
|
428
|
+
if (message.length !== undefined) {
|
|
429
|
+
obj.length = Math.round(message.length);
|
|
430
|
+
}
|
|
431
|
+
if (message.weight !== undefined) {
|
|
432
|
+
obj.weight = Math.round(message.weight);
|
|
433
|
+
}
|
|
434
|
+
if (message.mediaKeys?.length) {
|
|
435
|
+
obj.mediaKeys = message.mediaKeys;
|
|
436
|
+
}
|
|
437
|
+
if (message.attributeValues?.length) {
|
|
438
|
+
obj.attributeValues = message.attributeValues.map((e) => exports.AttributeValueInput.toJSON(e));
|
|
439
|
+
}
|
|
440
|
+
return obj;
|
|
441
|
+
},
|
|
442
|
+
create(base) {
|
|
443
|
+
return exports.UpdateSkuRequest.fromPartial(base ?? {});
|
|
444
|
+
},
|
|
445
|
+
fromPartial(object) {
|
|
446
|
+
const message = createBaseUpdateSkuRequest();
|
|
447
|
+
message.id = object.id ?? '';
|
|
448
|
+
message.price = object.price ?? undefined;
|
|
449
|
+
message.width = object.width ?? undefined;
|
|
450
|
+
message.height = object.height ?? undefined;
|
|
451
|
+
message.length = object.length ?? undefined;
|
|
452
|
+
message.weight = object.weight ?? undefined;
|
|
453
|
+
message.mediaKeys = object.mediaKeys?.map((e) => e) || [];
|
|
454
|
+
message.attributeValues =
|
|
455
|
+
object.attributeValues?.map((e) => exports.AttributeValueInput.fromPartial(e)) ||
|
|
456
|
+
[];
|
|
457
|
+
return message;
|
|
458
|
+
},
|
|
459
|
+
};
|
|
281
460
|
function createBaseGetProductsResponse() {
|
|
282
461
|
return { products: [] };
|
|
283
462
|
}
|
|
@@ -407,6 +586,77 @@ exports.ProductResponse = {
|
|
|
407
586
|
return message;
|
|
408
587
|
},
|
|
409
588
|
};
|
|
589
|
+
function createBaseSkuResponse() {
|
|
590
|
+
return { sku: undefined, error: '' };
|
|
591
|
+
}
|
|
592
|
+
exports.SkuResponse = {
|
|
593
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
594
|
+
if (message.sku !== undefined) {
|
|
595
|
+
exports.Sku.encode(message.sku, writer.uint32(10).fork()).join();
|
|
596
|
+
}
|
|
597
|
+
if (message.error !== '') {
|
|
598
|
+
writer.uint32(18).string(message.error);
|
|
599
|
+
}
|
|
600
|
+
return writer;
|
|
601
|
+
},
|
|
602
|
+
decode(input, length) {
|
|
603
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
604
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
605
|
+
const message = createBaseSkuResponse();
|
|
606
|
+
while (reader.pos < end) {
|
|
607
|
+
const tag = reader.uint32();
|
|
608
|
+
switch (tag >>> 3) {
|
|
609
|
+
case 1: {
|
|
610
|
+
if (tag !== 10) {
|
|
611
|
+
break;
|
|
612
|
+
}
|
|
613
|
+
message.sku = exports.Sku.decode(reader, reader.uint32());
|
|
614
|
+
continue;
|
|
615
|
+
}
|
|
616
|
+
case 2: {
|
|
617
|
+
if (tag !== 18) {
|
|
618
|
+
break;
|
|
619
|
+
}
|
|
620
|
+
message.error = reader.string();
|
|
621
|
+
continue;
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
625
|
+
break;
|
|
626
|
+
}
|
|
627
|
+
reader.skip(tag & 7);
|
|
628
|
+
}
|
|
629
|
+
return message;
|
|
630
|
+
},
|
|
631
|
+
fromJSON(object) {
|
|
632
|
+
return {
|
|
633
|
+
sku: isSet(object.sku) ? exports.Sku.fromJSON(object.sku) : undefined,
|
|
634
|
+
error: isSet(object.error) ? globalThis.String(object.error) : '',
|
|
635
|
+
};
|
|
636
|
+
},
|
|
637
|
+
toJSON(message) {
|
|
638
|
+
const obj = {};
|
|
639
|
+
if (message.sku !== undefined) {
|
|
640
|
+
obj.sku = exports.Sku.toJSON(message.sku);
|
|
641
|
+
}
|
|
642
|
+
if (message.error !== '') {
|
|
643
|
+
obj.error = message.error;
|
|
644
|
+
}
|
|
645
|
+
return obj;
|
|
646
|
+
},
|
|
647
|
+
create(base) {
|
|
648
|
+
return exports.SkuResponse.fromPartial(base ?? {});
|
|
649
|
+
},
|
|
650
|
+
fromPartial(object) {
|
|
651
|
+
const message = createBaseSkuResponse();
|
|
652
|
+
message.sku =
|
|
653
|
+
object.sku !== undefined && object.sku !== null
|
|
654
|
+
? exports.Sku.fromPartial(object.sku)
|
|
655
|
+
: undefined;
|
|
656
|
+
message.error = object.error ?? '';
|
|
657
|
+
return message;
|
|
658
|
+
},
|
|
659
|
+
};
|
|
410
660
|
function createBaseGetProvincesRequest() {
|
|
411
661
|
return {};
|
|
412
662
|
}
|
|
@@ -985,6 +1235,247 @@ exports.Product = {
|
|
|
985
1235
|
return message;
|
|
986
1236
|
},
|
|
987
1237
|
};
|
|
1238
|
+
function createBaseSku() {
|
|
1239
|
+
return {
|
|
1240
|
+
id: '',
|
|
1241
|
+
skuNo: '',
|
|
1242
|
+
productId: '',
|
|
1243
|
+
price: 0,
|
|
1244
|
+
width: 0,
|
|
1245
|
+
height: 0,
|
|
1246
|
+
length: 0,
|
|
1247
|
+
weight: 0,
|
|
1248
|
+
media: [],
|
|
1249
|
+
inactive: false,
|
|
1250
|
+
createdAt: '',
|
|
1251
|
+
updatedAt: '',
|
|
1252
|
+
};
|
|
1253
|
+
}
|
|
1254
|
+
exports.Sku = {
|
|
1255
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
1256
|
+
if (message.id !== '') {
|
|
1257
|
+
writer.uint32(10).string(message.id);
|
|
1258
|
+
}
|
|
1259
|
+
if (message.skuNo !== '') {
|
|
1260
|
+
writer.uint32(18).string(message.skuNo);
|
|
1261
|
+
}
|
|
1262
|
+
if (message.productId !== '') {
|
|
1263
|
+
writer.uint32(26).string(message.productId);
|
|
1264
|
+
}
|
|
1265
|
+
if (message.price !== 0) {
|
|
1266
|
+
writer.uint32(32).int64(message.price);
|
|
1267
|
+
}
|
|
1268
|
+
if (message.width !== 0) {
|
|
1269
|
+
writer.uint32(40).int32(message.width);
|
|
1270
|
+
}
|
|
1271
|
+
if (message.height !== 0) {
|
|
1272
|
+
writer.uint32(48).int32(message.height);
|
|
1273
|
+
}
|
|
1274
|
+
if (message.length !== 0) {
|
|
1275
|
+
writer.uint32(56).int32(message.length);
|
|
1276
|
+
}
|
|
1277
|
+
if (message.weight !== 0) {
|
|
1278
|
+
writer.uint32(64).int32(message.weight);
|
|
1279
|
+
}
|
|
1280
|
+
for (const v of message.media) {
|
|
1281
|
+
exports.Media.encode(v, writer.uint32(74).fork()).join();
|
|
1282
|
+
}
|
|
1283
|
+
if (message.inactive !== false) {
|
|
1284
|
+
writer.uint32(80).bool(message.inactive);
|
|
1285
|
+
}
|
|
1286
|
+
if (message.createdAt !== '') {
|
|
1287
|
+
writer.uint32(90).string(message.createdAt);
|
|
1288
|
+
}
|
|
1289
|
+
if (message.updatedAt !== '') {
|
|
1290
|
+
writer.uint32(98).string(message.updatedAt);
|
|
1291
|
+
}
|
|
1292
|
+
return writer;
|
|
1293
|
+
},
|
|
1294
|
+
decode(input, length) {
|
|
1295
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
1296
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1297
|
+
const message = createBaseSku();
|
|
1298
|
+
while (reader.pos < end) {
|
|
1299
|
+
const tag = reader.uint32();
|
|
1300
|
+
switch (tag >>> 3) {
|
|
1301
|
+
case 1: {
|
|
1302
|
+
if (tag !== 10) {
|
|
1303
|
+
break;
|
|
1304
|
+
}
|
|
1305
|
+
message.id = reader.string();
|
|
1306
|
+
continue;
|
|
1307
|
+
}
|
|
1308
|
+
case 2: {
|
|
1309
|
+
if (tag !== 18) {
|
|
1310
|
+
break;
|
|
1311
|
+
}
|
|
1312
|
+
message.skuNo = reader.string();
|
|
1313
|
+
continue;
|
|
1314
|
+
}
|
|
1315
|
+
case 3: {
|
|
1316
|
+
if (tag !== 26) {
|
|
1317
|
+
break;
|
|
1318
|
+
}
|
|
1319
|
+
message.productId = reader.string();
|
|
1320
|
+
continue;
|
|
1321
|
+
}
|
|
1322
|
+
case 4: {
|
|
1323
|
+
if (tag !== 32) {
|
|
1324
|
+
break;
|
|
1325
|
+
}
|
|
1326
|
+
message.price = longToNumber(reader.int64());
|
|
1327
|
+
continue;
|
|
1328
|
+
}
|
|
1329
|
+
case 5: {
|
|
1330
|
+
if (tag !== 40) {
|
|
1331
|
+
break;
|
|
1332
|
+
}
|
|
1333
|
+
message.width = reader.int32();
|
|
1334
|
+
continue;
|
|
1335
|
+
}
|
|
1336
|
+
case 6: {
|
|
1337
|
+
if (tag !== 48) {
|
|
1338
|
+
break;
|
|
1339
|
+
}
|
|
1340
|
+
message.height = reader.int32();
|
|
1341
|
+
continue;
|
|
1342
|
+
}
|
|
1343
|
+
case 7: {
|
|
1344
|
+
if (tag !== 56) {
|
|
1345
|
+
break;
|
|
1346
|
+
}
|
|
1347
|
+
message.length = reader.int32();
|
|
1348
|
+
continue;
|
|
1349
|
+
}
|
|
1350
|
+
case 8: {
|
|
1351
|
+
if (tag !== 64) {
|
|
1352
|
+
break;
|
|
1353
|
+
}
|
|
1354
|
+
message.weight = reader.int32();
|
|
1355
|
+
continue;
|
|
1356
|
+
}
|
|
1357
|
+
case 9: {
|
|
1358
|
+
if (tag !== 74) {
|
|
1359
|
+
break;
|
|
1360
|
+
}
|
|
1361
|
+
message.media.push(exports.Media.decode(reader, reader.uint32()));
|
|
1362
|
+
continue;
|
|
1363
|
+
}
|
|
1364
|
+
case 10: {
|
|
1365
|
+
if (tag !== 80) {
|
|
1366
|
+
break;
|
|
1367
|
+
}
|
|
1368
|
+
message.inactive = reader.bool();
|
|
1369
|
+
continue;
|
|
1370
|
+
}
|
|
1371
|
+
case 11: {
|
|
1372
|
+
if (tag !== 90) {
|
|
1373
|
+
break;
|
|
1374
|
+
}
|
|
1375
|
+
message.createdAt = reader.string();
|
|
1376
|
+
continue;
|
|
1377
|
+
}
|
|
1378
|
+
case 12: {
|
|
1379
|
+
if (tag !== 98) {
|
|
1380
|
+
break;
|
|
1381
|
+
}
|
|
1382
|
+
message.updatedAt = reader.string();
|
|
1383
|
+
continue;
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1387
|
+
break;
|
|
1388
|
+
}
|
|
1389
|
+
reader.skip(tag & 7);
|
|
1390
|
+
}
|
|
1391
|
+
return message;
|
|
1392
|
+
},
|
|
1393
|
+
fromJSON(object) {
|
|
1394
|
+
return {
|
|
1395
|
+
id: isSet(object.id) ? globalThis.String(object.id) : '',
|
|
1396
|
+
skuNo: isSet(object.skuNo) ? globalThis.String(object.skuNo) : '',
|
|
1397
|
+
productId: isSet(object.productId)
|
|
1398
|
+
? globalThis.String(object.productId)
|
|
1399
|
+
: '',
|
|
1400
|
+
price: isSet(object.price) ? globalThis.Number(object.price) : 0,
|
|
1401
|
+
width: isSet(object.width) ? globalThis.Number(object.width) : 0,
|
|
1402
|
+
height: isSet(object.height) ? globalThis.Number(object.height) : 0,
|
|
1403
|
+
length: isSet(object.length) ? globalThis.Number(object.length) : 0,
|
|
1404
|
+
weight: isSet(object.weight) ? globalThis.Number(object.weight) : 0,
|
|
1405
|
+
media: globalThis.Array.isArray(object?.media)
|
|
1406
|
+
? object.media.map((e) => exports.Media.fromJSON(e))
|
|
1407
|
+
: [],
|
|
1408
|
+
inactive: isSet(object.inactive)
|
|
1409
|
+
? globalThis.Boolean(object.inactive)
|
|
1410
|
+
: false,
|
|
1411
|
+
createdAt: isSet(object.createdAt)
|
|
1412
|
+
? globalThis.String(object.createdAt)
|
|
1413
|
+
: '',
|
|
1414
|
+
updatedAt: isSet(object.updatedAt)
|
|
1415
|
+
? globalThis.String(object.updatedAt)
|
|
1416
|
+
: '',
|
|
1417
|
+
};
|
|
1418
|
+
},
|
|
1419
|
+
toJSON(message) {
|
|
1420
|
+
const obj = {};
|
|
1421
|
+
if (message.id !== '') {
|
|
1422
|
+
obj.id = message.id;
|
|
1423
|
+
}
|
|
1424
|
+
if (message.skuNo !== '') {
|
|
1425
|
+
obj.skuNo = message.skuNo;
|
|
1426
|
+
}
|
|
1427
|
+
if (message.productId !== '') {
|
|
1428
|
+
obj.productId = message.productId;
|
|
1429
|
+
}
|
|
1430
|
+
if (message.price !== 0) {
|
|
1431
|
+
obj.price = Math.round(message.price);
|
|
1432
|
+
}
|
|
1433
|
+
if (message.width !== 0) {
|
|
1434
|
+
obj.width = Math.round(message.width);
|
|
1435
|
+
}
|
|
1436
|
+
if (message.height !== 0) {
|
|
1437
|
+
obj.height = Math.round(message.height);
|
|
1438
|
+
}
|
|
1439
|
+
if (message.length !== 0) {
|
|
1440
|
+
obj.length = Math.round(message.length);
|
|
1441
|
+
}
|
|
1442
|
+
if (message.weight !== 0) {
|
|
1443
|
+
obj.weight = Math.round(message.weight);
|
|
1444
|
+
}
|
|
1445
|
+
if (message.media?.length) {
|
|
1446
|
+
obj.media = message.media.map((e) => exports.Media.toJSON(e));
|
|
1447
|
+
}
|
|
1448
|
+
if (message.inactive !== false) {
|
|
1449
|
+
obj.inactive = message.inactive;
|
|
1450
|
+
}
|
|
1451
|
+
if (message.createdAt !== '') {
|
|
1452
|
+
obj.createdAt = message.createdAt;
|
|
1453
|
+
}
|
|
1454
|
+
if (message.updatedAt !== '') {
|
|
1455
|
+
obj.updatedAt = message.updatedAt;
|
|
1456
|
+
}
|
|
1457
|
+
return obj;
|
|
1458
|
+
},
|
|
1459
|
+
create(base) {
|
|
1460
|
+
return exports.Sku.fromPartial(base ?? {});
|
|
1461
|
+
},
|
|
1462
|
+
fromPartial(object) {
|
|
1463
|
+
const message = createBaseSku();
|
|
1464
|
+
message.id = object.id ?? '';
|
|
1465
|
+
message.skuNo = object.skuNo ?? '';
|
|
1466
|
+
message.productId = object.productId ?? '';
|
|
1467
|
+
message.price = object.price ?? 0;
|
|
1468
|
+
message.width = object.width ?? 0;
|
|
1469
|
+
message.height = object.height ?? 0;
|
|
1470
|
+
message.length = object.length ?? 0;
|
|
1471
|
+
message.weight = object.weight ?? 0;
|
|
1472
|
+
message.media = object.media?.map((e) => exports.Media.fromPartial(e)) || [];
|
|
1473
|
+
message.inactive = object.inactive ?? false;
|
|
1474
|
+
message.createdAt = object.createdAt ?? '';
|
|
1475
|
+
message.updatedAt = object.updatedAt ?? '';
|
|
1476
|
+
return message;
|
|
1477
|
+
},
|
|
1478
|
+
};
|
|
988
1479
|
function createBaseMedia() {
|
|
989
1480
|
return { id: '', key: '', url: '', type: '', createdAt: '', updatedAt: '' };
|
|
990
1481
|
}
|
|
@@ -1121,7 +1612,11 @@ function createBaseProductSkuInput() {
|
|
|
1121
1612
|
return {
|
|
1122
1613
|
price: 0,
|
|
1123
1614
|
quantity: 0,
|
|
1615
|
+
width: 0,
|
|
1616
|
+
height: 0,
|
|
1617
|
+
length: 0,
|
|
1124
1618
|
warehouseId: '',
|
|
1619
|
+
weight: 0,
|
|
1125
1620
|
mediaKeys: [],
|
|
1126
1621
|
attributeValues: [],
|
|
1127
1622
|
};
|
|
@@ -1134,14 +1629,26 @@ exports.ProductSkuInput = {
|
|
|
1134
1629
|
if (message.quantity !== 0) {
|
|
1135
1630
|
writer.uint32(16).int32(message.quantity);
|
|
1136
1631
|
}
|
|
1632
|
+
if (message.width !== 0) {
|
|
1633
|
+
writer.uint32(24).int32(message.width);
|
|
1634
|
+
}
|
|
1635
|
+
if (message.height !== 0) {
|
|
1636
|
+
writer.uint32(32).int32(message.height);
|
|
1637
|
+
}
|
|
1638
|
+
if (message.length !== 0) {
|
|
1639
|
+
writer.uint32(40).int32(message.length);
|
|
1640
|
+
}
|
|
1137
1641
|
if (message.warehouseId !== '') {
|
|
1138
1642
|
writer.uint32(50).string(message.warehouseId);
|
|
1139
1643
|
}
|
|
1644
|
+
if (message.weight !== 0) {
|
|
1645
|
+
writer.uint32(56).int32(message.weight);
|
|
1646
|
+
}
|
|
1140
1647
|
for (const v of message.mediaKeys) {
|
|
1141
|
-
writer.uint32(
|
|
1648
|
+
writer.uint32(66).string(v);
|
|
1142
1649
|
}
|
|
1143
1650
|
for (const v of message.attributeValues) {
|
|
1144
|
-
exports.AttributeValueInput.encode(v, writer.uint32(
|
|
1651
|
+
exports.AttributeValueInput.encode(v, writer.uint32(74).fork()).join();
|
|
1145
1652
|
}
|
|
1146
1653
|
return writer;
|
|
1147
1654
|
},
|
|
@@ -1166,6 +1673,27 @@ exports.ProductSkuInput = {
|
|
|
1166
1673
|
message.quantity = reader.int32();
|
|
1167
1674
|
continue;
|
|
1168
1675
|
}
|
|
1676
|
+
case 3: {
|
|
1677
|
+
if (tag !== 24) {
|
|
1678
|
+
break;
|
|
1679
|
+
}
|
|
1680
|
+
message.width = reader.int32();
|
|
1681
|
+
continue;
|
|
1682
|
+
}
|
|
1683
|
+
case 4: {
|
|
1684
|
+
if (tag !== 32) {
|
|
1685
|
+
break;
|
|
1686
|
+
}
|
|
1687
|
+
message.height = reader.int32();
|
|
1688
|
+
continue;
|
|
1689
|
+
}
|
|
1690
|
+
case 5: {
|
|
1691
|
+
if (tag !== 40) {
|
|
1692
|
+
break;
|
|
1693
|
+
}
|
|
1694
|
+
message.length = reader.int32();
|
|
1695
|
+
continue;
|
|
1696
|
+
}
|
|
1169
1697
|
case 6: {
|
|
1170
1698
|
if (tag !== 50) {
|
|
1171
1699
|
break;
|
|
@@ -1173,15 +1701,22 @@ exports.ProductSkuInput = {
|
|
|
1173
1701
|
message.warehouseId = reader.string();
|
|
1174
1702
|
continue;
|
|
1175
1703
|
}
|
|
1176
|
-
case
|
|
1177
|
-
if (tag !==
|
|
1704
|
+
case 7: {
|
|
1705
|
+
if (tag !== 56) {
|
|
1706
|
+
break;
|
|
1707
|
+
}
|
|
1708
|
+
message.weight = reader.int32();
|
|
1709
|
+
continue;
|
|
1710
|
+
}
|
|
1711
|
+
case 8: {
|
|
1712
|
+
if (tag !== 66) {
|
|
1178
1713
|
break;
|
|
1179
1714
|
}
|
|
1180
1715
|
message.mediaKeys.push(reader.string());
|
|
1181
1716
|
continue;
|
|
1182
1717
|
}
|
|
1183
|
-
case
|
|
1184
|
-
if (tag !==
|
|
1718
|
+
case 9: {
|
|
1719
|
+
if (tag !== 74) {
|
|
1185
1720
|
break;
|
|
1186
1721
|
}
|
|
1187
1722
|
message.attributeValues.push(exports.AttributeValueInput.decode(reader, reader.uint32()));
|
|
@@ -1199,9 +1734,13 @@ exports.ProductSkuInput = {
|
|
|
1199
1734
|
return {
|
|
1200
1735
|
price: isSet(object.price) ? globalThis.Number(object.price) : 0,
|
|
1201
1736
|
quantity: isSet(object.quantity) ? globalThis.Number(object.quantity) : 0,
|
|
1737
|
+
width: isSet(object.width) ? globalThis.Number(object.width) : 0,
|
|
1738
|
+
height: isSet(object.height) ? globalThis.Number(object.height) : 0,
|
|
1739
|
+
length: isSet(object.length) ? globalThis.Number(object.length) : 0,
|
|
1202
1740
|
warehouseId: isSet(object.warehouseId)
|
|
1203
1741
|
? globalThis.String(object.warehouseId)
|
|
1204
1742
|
: '',
|
|
1743
|
+
weight: isSet(object.weight) ? globalThis.Number(object.weight) : 0,
|
|
1205
1744
|
mediaKeys: globalThis.Array.isArray(object?.mediaKeys)
|
|
1206
1745
|
? object.mediaKeys.map((e) => globalThis.String(e))
|
|
1207
1746
|
: [],
|
|
@@ -1218,9 +1757,21 @@ exports.ProductSkuInput = {
|
|
|
1218
1757
|
if (message.quantity !== 0) {
|
|
1219
1758
|
obj.quantity = Math.round(message.quantity);
|
|
1220
1759
|
}
|
|
1760
|
+
if (message.width !== 0) {
|
|
1761
|
+
obj.width = Math.round(message.width);
|
|
1762
|
+
}
|
|
1763
|
+
if (message.height !== 0) {
|
|
1764
|
+
obj.height = Math.round(message.height);
|
|
1765
|
+
}
|
|
1766
|
+
if (message.length !== 0) {
|
|
1767
|
+
obj.length = Math.round(message.length);
|
|
1768
|
+
}
|
|
1221
1769
|
if (message.warehouseId !== '') {
|
|
1222
1770
|
obj.warehouseId = message.warehouseId;
|
|
1223
1771
|
}
|
|
1772
|
+
if (message.weight !== 0) {
|
|
1773
|
+
obj.weight = Math.round(message.weight);
|
|
1774
|
+
}
|
|
1224
1775
|
if (message.mediaKeys?.length) {
|
|
1225
1776
|
obj.mediaKeys = message.mediaKeys;
|
|
1226
1777
|
}
|
|
@@ -1236,7 +1787,11 @@ exports.ProductSkuInput = {
|
|
|
1236
1787
|
const message = createBaseProductSkuInput();
|
|
1237
1788
|
message.price = object.price ?? 0;
|
|
1238
1789
|
message.quantity = object.quantity ?? 0;
|
|
1790
|
+
message.width = object.width ?? 0;
|
|
1791
|
+
message.height = object.height ?? 0;
|
|
1792
|
+
message.length = object.length ?? 0;
|
|
1239
1793
|
message.warehouseId = object.warehouseId ?? '';
|
|
1794
|
+
message.weight = object.weight ?? 0;
|
|
1240
1795
|
message.mediaKeys = object.mediaKeys?.map((e) => e) || [];
|
|
1241
1796
|
message.attributeValues =
|
|
1242
1797
|
object.attributeValues?.map((e) => exports.AttributeValueInput.fromPartial(e)) ||
|
|
@@ -1744,6 +2299,15 @@ exports.ProductServiceService = {
|
|
|
1744
2299
|
responseSerialize: (value) => Buffer.from(exports.ProductResponse.encode(value).finish()),
|
|
1745
2300
|
responseDeserialize: (value) => exports.ProductResponse.decode(value),
|
|
1746
2301
|
},
|
|
2302
|
+
updateSku: {
|
|
2303
|
+
path: '/sagebox.ProductService/UpdateSku',
|
|
2304
|
+
requestStream: false,
|
|
2305
|
+
responseStream: false,
|
|
2306
|
+
requestSerialize: (value) => Buffer.from(exports.UpdateSkuRequest.encode(value).finish()),
|
|
2307
|
+
requestDeserialize: (value) => exports.UpdateSkuRequest.decode(value),
|
|
2308
|
+
responseSerialize: (value) => Buffer.from(exports.SkuResponse.encode(value).finish()),
|
|
2309
|
+
responseDeserialize: (value) => exports.SkuResponse.decode(value),
|
|
2310
|
+
},
|
|
1747
2311
|
};
|
|
1748
2312
|
exports.ProductServiceClient = (0, grpc_js_1.makeGenericClientConstructor)(exports.ProductServiceService, 'sagebox.ProductService');
|
|
1749
2313
|
exports.AddressServiceService = {
|
|
@@ -1824,6 +2388,16 @@ exports.ProductOutboxServiceService = {
|
|
|
1824
2388
|
},
|
|
1825
2389
|
};
|
|
1826
2390
|
exports.ProductOutboxServiceClient = (0, grpc_js_1.makeGenericClientConstructor)(exports.ProductOutboxServiceService, 'sagebox.ProductOutboxService');
|
|
2391
|
+
function longToNumber(int64) {
|
|
2392
|
+
const num = globalThis.Number(int64.toString());
|
|
2393
|
+
if (num > globalThis.Number.MAX_SAFE_INTEGER) {
|
|
2394
|
+
throw new globalThis.Error('Value is larger than Number.MAX_SAFE_INTEGER');
|
|
2395
|
+
}
|
|
2396
|
+
if (num < globalThis.Number.MIN_SAFE_INTEGER) {
|
|
2397
|
+
throw new globalThis.Error('Value is smaller than Number.MIN_SAFE_INTEGER');
|
|
2398
|
+
}
|
|
2399
|
+
return num;
|
|
2400
|
+
}
|
|
1827
2401
|
function isSet(value) {
|
|
1828
2402
|
return value !== null && value !== undefined;
|
|
1829
2403
|
}
|