@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
|
@@ -22,6 +22,16 @@ export interface CreateProductRequest {
|
|
|
22
22
|
mediaKeys: string[];
|
|
23
23
|
skus: ProductSkuInput[];
|
|
24
24
|
}
|
|
25
|
+
export interface UpdateSkuRequest {
|
|
26
|
+
id: string;
|
|
27
|
+
price?: number | undefined;
|
|
28
|
+
width?: number | undefined;
|
|
29
|
+
height?: number | undefined;
|
|
30
|
+
length?: number | undefined;
|
|
31
|
+
weight?: number | undefined;
|
|
32
|
+
mediaKeys: string[];
|
|
33
|
+
attributeValues: AttributeValueInput[];
|
|
34
|
+
}
|
|
25
35
|
/**
|
|
26
36
|
* ============================================
|
|
27
37
|
* Product Response Messages
|
|
@@ -34,6 +44,10 @@ export interface ProductResponse {
|
|
|
34
44
|
product: Product | undefined;
|
|
35
45
|
error: string;
|
|
36
46
|
}
|
|
47
|
+
export interface SkuResponse {
|
|
48
|
+
sku: Sku | undefined;
|
|
49
|
+
error: string;
|
|
50
|
+
}
|
|
37
51
|
/**
|
|
38
52
|
* ============================================
|
|
39
53
|
* Address Request Messages
|
|
@@ -81,6 +95,20 @@ export interface Product {
|
|
|
81
95
|
createdAt: string;
|
|
82
96
|
updatedAt: string;
|
|
83
97
|
}
|
|
98
|
+
export interface Sku {
|
|
99
|
+
id: string;
|
|
100
|
+
skuNo: string;
|
|
101
|
+
productId: string;
|
|
102
|
+
price: number;
|
|
103
|
+
width: number;
|
|
104
|
+
height: number;
|
|
105
|
+
length: number;
|
|
106
|
+
weight: number;
|
|
107
|
+
media: Media[];
|
|
108
|
+
inactive: boolean;
|
|
109
|
+
createdAt: string;
|
|
110
|
+
updatedAt: string;
|
|
111
|
+
}
|
|
84
112
|
export interface Media {
|
|
85
113
|
id: string;
|
|
86
114
|
key: string;
|
|
@@ -92,7 +120,11 @@ export interface Media {
|
|
|
92
120
|
export interface ProductSkuInput {
|
|
93
121
|
price: number;
|
|
94
122
|
quantity: number;
|
|
123
|
+
width: number;
|
|
124
|
+
height: number;
|
|
125
|
+
length: number;
|
|
95
126
|
warehouseId: string;
|
|
127
|
+
weight: number;
|
|
96
128
|
mediaKeys: string[];
|
|
97
129
|
attributeValues: AttributeValueInput[];
|
|
98
130
|
}
|
|
@@ -142,8 +174,10 @@ export declare const SAGEBOX_PACKAGE_NAME = "sagebox";
|
|
|
142
174
|
export declare const GetProductsByCategoryIdRequest: MessageFns<GetProductsByCategoryIdRequest>;
|
|
143
175
|
export declare const GetProductByIdRequest: MessageFns<GetProductByIdRequest>;
|
|
144
176
|
export declare const CreateProductRequest: MessageFns<CreateProductRequest>;
|
|
177
|
+
export declare const UpdateSkuRequest: MessageFns<UpdateSkuRequest>;
|
|
145
178
|
export declare const GetProductsResponse: MessageFns<GetProductsResponse>;
|
|
146
179
|
export declare const ProductResponse: MessageFns<ProductResponse>;
|
|
180
|
+
export declare const SkuResponse: MessageFns<SkuResponse>;
|
|
147
181
|
export declare const GetProvincesRequest: MessageFns<GetProvincesRequest>;
|
|
148
182
|
export declare const GetDistrictsRequest: MessageFns<GetDistrictsRequest>;
|
|
149
183
|
export declare const GetWardsRequest: MessageFns<GetWardsRequest>;
|
|
@@ -151,6 +185,7 @@ export declare const GetProvincesResponse: MessageFns<GetProvincesResponse>;
|
|
|
151
185
|
export declare const GetDistrictsResponse: MessageFns<GetDistrictsResponse>;
|
|
152
186
|
export declare const GetWardsResponse: MessageFns<GetWardsResponse>;
|
|
153
187
|
export declare const Product: MessageFns<Product>;
|
|
188
|
+
export declare const Sku: MessageFns<Sku>;
|
|
154
189
|
export declare const Media: MessageFns<Media>;
|
|
155
190
|
export declare const ProductSkuInput: MessageFns<ProductSkuInput>;
|
|
156
191
|
export declare const AttributeValueInput: MessageFns<AttributeValueInput>;
|
|
@@ -170,6 +205,7 @@ export interface ProductServiceClient {
|
|
|
170
205
|
getProductsByCategoryId(request: GetProductsByCategoryIdRequest, metadata?: Metadata): Observable<GetProductsResponse>;
|
|
171
206
|
getProductById(request: GetProductByIdRequest, metadata?: Metadata): Observable<ProductResponse>;
|
|
172
207
|
createProduct(request: CreateProductRequest, metadata?: Metadata): Observable<ProductResponse>;
|
|
208
|
+
updateSku(request: UpdateSkuRequest, metadata?: Metadata): Observable<SkuResponse>;
|
|
173
209
|
}
|
|
174
210
|
/**
|
|
175
211
|
* ============================================
|
|
@@ -180,6 +216,7 @@ export interface ProductServiceController {
|
|
|
180
216
|
getProductsByCategoryId(request: GetProductsByCategoryIdRequest, metadata?: Metadata): Promise<GetProductsResponse> | Observable<GetProductsResponse> | GetProductsResponse;
|
|
181
217
|
getProductById(request: GetProductByIdRequest, metadata?: Metadata): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
|
|
182
218
|
createProduct(request: CreateProductRequest, metadata?: Metadata): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
|
|
219
|
+
updateSku(request: UpdateSkuRequest, metadata?: Metadata): Promise<SkuResponse> | Observable<SkuResponse> | SkuResponse;
|
|
183
220
|
}
|
|
184
221
|
export declare function ProductServiceControllerMethods(): (constructor: Function) => void;
|
|
185
222
|
export declare const PRODUCT_SERVICE_NAME = "ProductService";
|
|
@@ -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.PRODUCT_OUTBOX_SERVICE_NAME = exports.ADDRESS_SERVICE_NAME = exports.PRODUCT_SERVICE_NAME = 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.SAGEBOX_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
8
|
+
exports.PRODUCT_OUTBOX_SERVICE_NAME = exports.ADDRESS_SERVICE_NAME = exports.PRODUCT_SERVICE_NAME = 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.SAGEBOX_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
9
9
|
exports.ProductServiceControllerMethods = ProductServiceControllerMethods;
|
|
10
10
|
exports.AddressServiceControllerMethods = AddressServiceControllerMethods;
|
|
11
11
|
exports.ProductOutboxServiceControllerMethods = ProductOutboxServiceControllerMethods;
|
|
@@ -180,6 +180,109 @@ exports.CreateProductRequest = {
|
|
|
180
180
|
return message;
|
|
181
181
|
},
|
|
182
182
|
};
|
|
183
|
+
function createBaseUpdateSkuRequest() {
|
|
184
|
+
return { id: '', mediaKeys: [], attributeValues: [] };
|
|
185
|
+
}
|
|
186
|
+
exports.UpdateSkuRequest = {
|
|
187
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
188
|
+
if (message.id !== '') {
|
|
189
|
+
writer.uint32(10).string(message.id);
|
|
190
|
+
}
|
|
191
|
+
if (message.price !== undefined) {
|
|
192
|
+
writer.uint32(16).int32(message.price);
|
|
193
|
+
}
|
|
194
|
+
if (message.width !== undefined) {
|
|
195
|
+
writer.uint32(24).int32(message.width);
|
|
196
|
+
}
|
|
197
|
+
if (message.height !== undefined) {
|
|
198
|
+
writer.uint32(32).int32(message.height);
|
|
199
|
+
}
|
|
200
|
+
if (message.length !== undefined) {
|
|
201
|
+
writer.uint32(40).int32(message.length);
|
|
202
|
+
}
|
|
203
|
+
if (message.weight !== undefined) {
|
|
204
|
+
writer.uint32(48).int32(message.weight);
|
|
205
|
+
}
|
|
206
|
+
for (const v of message.mediaKeys) {
|
|
207
|
+
writer.uint32(58).string(v);
|
|
208
|
+
}
|
|
209
|
+
for (const v of message.attributeValues) {
|
|
210
|
+
exports.AttributeValueInput.encode(v, writer.uint32(66).fork()).join();
|
|
211
|
+
}
|
|
212
|
+
return writer;
|
|
213
|
+
},
|
|
214
|
+
decode(input, length) {
|
|
215
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
216
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
217
|
+
const message = createBaseUpdateSkuRequest();
|
|
218
|
+
while (reader.pos < end) {
|
|
219
|
+
const tag = reader.uint32();
|
|
220
|
+
switch (tag >>> 3) {
|
|
221
|
+
case 1: {
|
|
222
|
+
if (tag !== 10) {
|
|
223
|
+
break;
|
|
224
|
+
}
|
|
225
|
+
message.id = reader.string();
|
|
226
|
+
continue;
|
|
227
|
+
}
|
|
228
|
+
case 2: {
|
|
229
|
+
if (tag !== 16) {
|
|
230
|
+
break;
|
|
231
|
+
}
|
|
232
|
+
message.price = reader.int32();
|
|
233
|
+
continue;
|
|
234
|
+
}
|
|
235
|
+
case 3: {
|
|
236
|
+
if (tag !== 24) {
|
|
237
|
+
break;
|
|
238
|
+
}
|
|
239
|
+
message.width = reader.int32();
|
|
240
|
+
continue;
|
|
241
|
+
}
|
|
242
|
+
case 4: {
|
|
243
|
+
if (tag !== 32) {
|
|
244
|
+
break;
|
|
245
|
+
}
|
|
246
|
+
message.height = reader.int32();
|
|
247
|
+
continue;
|
|
248
|
+
}
|
|
249
|
+
case 5: {
|
|
250
|
+
if (tag !== 40) {
|
|
251
|
+
break;
|
|
252
|
+
}
|
|
253
|
+
message.length = reader.int32();
|
|
254
|
+
continue;
|
|
255
|
+
}
|
|
256
|
+
case 6: {
|
|
257
|
+
if (tag !== 48) {
|
|
258
|
+
break;
|
|
259
|
+
}
|
|
260
|
+
message.weight = reader.int32();
|
|
261
|
+
continue;
|
|
262
|
+
}
|
|
263
|
+
case 7: {
|
|
264
|
+
if (tag !== 58) {
|
|
265
|
+
break;
|
|
266
|
+
}
|
|
267
|
+
message.mediaKeys.push(reader.string());
|
|
268
|
+
continue;
|
|
269
|
+
}
|
|
270
|
+
case 8: {
|
|
271
|
+
if (tag !== 66) {
|
|
272
|
+
break;
|
|
273
|
+
}
|
|
274
|
+
message.attributeValues.push(exports.AttributeValueInput.decode(reader, reader.uint32()));
|
|
275
|
+
continue;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
279
|
+
break;
|
|
280
|
+
}
|
|
281
|
+
reader.skip(tag & 7);
|
|
282
|
+
}
|
|
283
|
+
return message;
|
|
284
|
+
},
|
|
285
|
+
};
|
|
183
286
|
function createBaseGetProductsResponse() {
|
|
184
287
|
return { products: [] };
|
|
185
288
|
}
|
|
@@ -256,6 +359,49 @@ exports.ProductResponse = {
|
|
|
256
359
|
return message;
|
|
257
360
|
},
|
|
258
361
|
};
|
|
362
|
+
function createBaseSkuResponse() {
|
|
363
|
+
return { sku: undefined, error: '' };
|
|
364
|
+
}
|
|
365
|
+
exports.SkuResponse = {
|
|
366
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
367
|
+
if (message.sku !== undefined) {
|
|
368
|
+
exports.Sku.encode(message.sku, writer.uint32(10).fork()).join();
|
|
369
|
+
}
|
|
370
|
+
if (message.error !== '') {
|
|
371
|
+
writer.uint32(18).string(message.error);
|
|
372
|
+
}
|
|
373
|
+
return writer;
|
|
374
|
+
},
|
|
375
|
+
decode(input, length) {
|
|
376
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
377
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
378
|
+
const message = createBaseSkuResponse();
|
|
379
|
+
while (reader.pos < end) {
|
|
380
|
+
const tag = reader.uint32();
|
|
381
|
+
switch (tag >>> 3) {
|
|
382
|
+
case 1: {
|
|
383
|
+
if (tag !== 10) {
|
|
384
|
+
break;
|
|
385
|
+
}
|
|
386
|
+
message.sku = exports.Sku.decode(reader, reader.uint32());
|
|
387
|
+
continue;
|
|
388
|
+
}
|
|
389
|
+
case 2: {
|
|
390
|
+
if (tag !== 18) {
|
|
391
|
+
break;
|
|
392
|
+
}
|
|
393
|
+
message.error = reader.string();
|
|
394
|
+
continue;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
398
|
+
break;
|
|
399
|
+
}
|
|
400
|
+
reader.skip(tag & 7);
|
|
401
|
+
}
|
|
402
|
+
return message;
|
|
403
|
+
},
|
|
404
|
+
};
|
|
259
405
|
function createBaseGetProvincesRequest() {
|
|
260
406
|
return {};
|
|
261
407
|
}
|
|
@@ -609,6 +755,162 @@ exports.Product = {
|
|
|
609
755
|
return message;
|
|
610
756
|
},
|
|
611
757
|
};
|
|
758
|
+
function createBaseSku() {
|
|
759
|
+
return {
|
|
760
|
+
id: '',
|
|
761
|
+
skuNo: '',
|
|
762
|
+
productId: '',
|
|
763
|
+
price: 0,
|
|
764
|
+
width: 0,
|
|
765
|
+
height: 0,
|
|
766
|
+
length: 0,
|
|
767
|
+
weight: 0,
|
|
768
|
+
media: [],
|
|
769
|
+
inactive: false,
|
|
770
|
+
createdAt: '',
|
|
771
|
+
updatedAt: '',
|
|
772
|
+
};
|
|
773
|
+
}
|
|
774
|
+
exports.Sku = {
|
|
775
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
776
|
+
if (message.id !== '') {
|
|
777
|
+
writer.uint32(10).string(message.id);
|
|
778
|
+
}
|
|
779
|
+
if (message.skuNo !== '') {
|
|
780
|
+
writer.uint32(18).string(message.skuNo);
|
|
781
|
+
}
|
|
782
|
+
if (message.productId !== '') {
|
|
783
|
+
writer.uint32(26).string(message.productId);
|
|
784
|
+
}
|
|
785
|
+
if (message.price !== 0) {
|
|
786
|
+
writer.uint32(32).int64(message.price);
|
|
787
|
+
}
|
|
788
|
+
if (message.width !== 0) {
|
|
789
|
+
writer.uint32(40).int32(message.width);
|
|
790
|
+
}
|
|
791
|
+
if (message.height !== 0) {
|
|
792
|
+
writer.uint32(48).int32(message.height);
|
|
793
|
+
}
|
|
794
|
+
if (message.length !== 0) {
|
|
795
|
+
writer.uint32(56).int32(message.length);
|
|
796
|
+
}
|
|
797
|
+
if (message.weight !== 0) {
|
|
798
|
+
writer.uint32(64).int32(message.weight);
|
|
799
|
+
}
|
|
800
|
+
for (const v of message.media) {
|
|
801
|
+
exports.Media.encode(v, writer.uint32(74).fork()).join();
|
|
802
|
+
}
|
|
803
|
+
if (message.inactive !== false) {
|
|
804
|
+
writer.uint32(80).bool(message.inactive);
|
|
805
|
+
}
|
|
806
|
+
if (message.createdAt !== '') {
|
|
807
|
+
writer.uint32(90).string(message.createdAt);
|
|
808
|
+
}
|
|
809
|
+
if (message.updatedAt !== '') {
|
|
810
|
+
writer.uint32(98).string(message.updatedAt);
|
|
811
|
+
}
|
|
812
|
+
return writer;
|
|
813
|
+
},
|
|
814
|
+
decode(input, length) {
|
|
815
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
816
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
817
|
+
const message = createBaseSku();
|
|
818
|
+
while (reader.pos < end) {
|
|
819
|
+
const tag = reader.uint32();
|
|
820
|
+
switch (tag >>> 3) {
|
|
821
|
+
case 1: {
|
|
822
|
+
if (tag !== 10) {
|
|
823
|
+
break;
|
|
824
|
+
}
|
|
825
|
+
message.id = reader.string();
|
|
826
|
+
continue;
|
|
827
|
+
}
|
|
828
|
+
case 2: {
|
|
829
|
+
if (tag !== 18) {
|
|
830
|
+
break;
|
|
831
|
+
}
|
|
832
|
+
message.skuNo = reader.string();
|
|
833
|
+
continue;
|
|
834
|
+
}
|
|
835
|
+
case 3: {
|
|
836
|
+
if (tag !== 26) {
|
|
837
|
+
break;
|
|
838
|
+
}
|
|
839
|
+
message.productId = reader.string();
|
|
840
|
+
continue;
|
|
841
|
+
}
|
|
842
|
+
case 4: {
|
|
843
|
+
if (tag !== 32) {
|
|
844
|
+
break;
|
|
845
|
+
}
|
|
846
|
+
message.price = longToNumber(reader.int64());
|
|
847
|
+
continue;
|
|
848
|
+
}
|
|
849
|
+
case 5: {
|
|
850
|
+
if (tag !== 40) {
|
|
851
|
+
break;
|
|
852
|
+
}
|
|
853
|
+
message.width = reader.int32();
|
|
854
|
+
continue;
|
|
855
|
+
}
|
|
856
|
+
case 6: {
|
|
857
|
+
if (tag !== 48) {
|
|
858
|
+
break;
|
|
859
|
+
}
|
|
860
|
+
message.height = reader.int32();
|
|
861
|
+
continue;
|
|
862
|
+
}
|
|
863
|
+
case 7: {
|
|
864
|
+
if (tag !== 56) {
|
|
865
|
+
break;
|
|
866
|
+
}
|
|
867
|
+
message.length = reader.int32();
|
|
868
|
+
continue;
|
|
869
|
+
}
|
|
870
|
+
case 8: {
|
|
871
|
+
if (tag !== 64) {
|
|
872
|
+
break;
|
|
873
|
+
}
|
|
874
|
+
message.weight = reader.int32();
|
|
875
|
+
continue;
|
|
876
|
+
}
|
|
877
|
+
case 9: {
|
|
878
|
+
if (tag !== 74) {
|
|
879
|
+
break;
|
|
880
|
+
}
|
|
881
|
+
message.media.push(exports.Media.decode(reader, reader.uint32()));
|
|
882
|
+
continue;
|
|
883
|
+
}
|
|
884
|
+
case 10: {
|
|
885
|
+
if (tag !== 80) {
|
|
886
|
+
break;
|
|
887
|
+
}
|
|
888
|
+
message.inactive = reader.bool();
|
|
889
|
+
continue;
|
|
890
|
+
}
|
|
891
|
+
case 11: {
|
|
892
|
+
if (tag !== 90) {
|
|
893
|
+
break;
|
|
894
|
+
}
|
|
895
|
+
message.createdAt = reader.string();
|
|
896
|
+
continue;
|
|
897
|
+
}
|
|
898
|
+
case 12: {
|
|
899
|
+
if (tag !== 98) {
|
|
900
|
+
break;
|
|
901
|
+
}
|
|
902
|
+
message.updatedAt = reader.string();
|
|
903
|
+
continue;
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
907
|
+
break;
|
|
908
|
+
}
|
|
909
|
+
reader.skip(tag & 7);
|
|
910
|
+
}
|
|
911
|
+
return message;
|
|
912
|
+
},
|
|
913
|
+
};
|
|
612
914
|
function createBaseMedia() {
|
|
613
915
|
return { id: '', key: '', url: '', type: '', createdAt: '', updatedAt: '' };
|
|
614
916
|
}
|
|
@@ -696,7 +998,11 @@ function createBaseProductSkuInput() {
|
|
|
696
998
|
return {
|
|
697
999
|
price: 0,
|
|
698
1000
|
quantity: 0,
|
|
1001
|
+
width: 0,
|
|
1002
|
+
height: 0,
|
|
1003
|
+
length: 0,
|
|
699
1004
|
warehouseId: '',
|
|
1005
|
+
weight: 0,
|
|
700
1006
|
mediaKeys: [],
|
|
701
1007
|
attributeValues: [],
|
|
702
1008
|
};
|
|
@@ -709,14 +1015,26 @@ exports.ProductSkuInput = {
|
|
|
709
1015
|
if (message.quantity !== 0) {
|
|
710
1016
|
writer.uint32(16).int32(message.quantity);
|
|
711
1017
|
}
|
|
1018
|
+
if (message.width !== 0) {
|
|
1019
|
+
writer.uint32(24).int32(message.width);
|
|
1020
|
+
}
|
|
1021
|
+
if (message.height !== 0) {
|
|
1022
|
+
writer.uint32(32).int32(message.height);
|
|
1023
|
+
}
|
|
1024
|
+
if (message.length !== 0) {
|
|
1025
|
+
writer.uint32(40).int32(message.length);
|
|
1026
|
+
}
|
|
712
1027
|
if (message.warehouseId !== '') {
|
|
713
1028
|
writer.uint32(50).string(message.warehouseId);
|
|
714
1029
|
}
|
|
1030
|
+
if (message.weight !== 0) {
|
|
1031
|
+
writer.uint32(56).int32(message.weight);
|
|
1032
|
+
}
|
|
715
1033
|
for (const v of message.mediaKeys) {
|
|
716
|
-
writer.uint32(
|
|
1034
|
+
writer.uint32(66).string(v);
|
|
717
1035
|
}
|
|
718
1036
|
for (const v of message.attributeValues) {
|
|
719
|
-
exports.AttributeValueInput.encode(v, writer.uint32(
|
|
1037
|
+
exports.AttributeValueInput.encode(v, writer.uint32(74).fork()).join();
|
|
720
1038
|
}
|
|
721
1039
|
return writer;
|
|
722
1040
|
},
|
|
@@ -741,6 +1059,27 @@ exports.ProductSkuInput = {
|
|
|
741
1059
|
message.quantity = reader.int32();
|
|
742
1060
|
continue;
|
|
743
1061
|
}
|
|
1062
|
+
case 3: {
|
|
1063
|
+
if (tag !== 24) {
|
|
1064
|
+
break;
|
|
1065
|
+
}
|
|
1066
|
+
message.width = reader.int32();
|
|
1067
|
+
continue;
|
|
1068
|
+
}
|
|
1069
|
+
case 4: {
|
|
1070
|
+
if (tag !== 32) {
|
|
1071
|
+
break;
|
|
1072
|
+
}
|
|
1073
|
+
message.height = reader.int32();
|
|
1074
|
+
continue;
|
|
1075
|
+
}
|
|
1076
|
+
case 5: {
|
|
1077
|
+
if (tag !== 40) {
|
|
1078
|
+
break;
|
|
1079
|
+
}
|
|
1080
|
+
message.length = reader.int32();
|
|
1081
|
+
continue;
|
|
1082
|
+
}
|
|
744
1083
|
case 6: {
|
|
745
1084
|
if (tag !== 50) {
|
|
746
1085
|
break;
|
|
@@ -748,15 +1087,22 @@ exports.ProductSkuInput = {
|
|
|
748
1087
|
message.warehouseId = reader.string();
|
|
749
1088
|
continue;
|
|
750
1089
|
}
|
|
751
|
-
case
|
|
752
|
-
if (tag !==
|
|
1090
|
+
case 7: {
|
|
1091
|
+
if (tag !== 56) {
|
|
1092
|
+
break;
|
|
1093
|
+
}
|
|
1094
|
+
message.weight = reader.int32();
|
|
1095
|
+
continue;
|
|
1096
|
+
}
|
|
1097
|
+
case 8: {
|
|
1098
|
+
if (tag !== 66) {
|
|
753
1099
|
break;
|
|
754
1100
|
}
|
|
755
1101
|
message.mediaKeys.push(reader.string());
|
|
756
1102
|
continue;
|
|
757
1103
|
}
|
|
758
|
-
case
|
|
759
|
-
if (tag !==
|
|
1104
|
+
case 9: {
|
|
1105
|
+
if (tag !== 74) {
|
|
760
1106
|
break;
|
|
761
1107
|
}
|
|
762
1108
|
message.attributeValues.push(exports.AttributeValueInput.decode(reader, reader.uint32()));
|
|
@@ -1071,6 +1417,7 @@ function ProductServiceControllerMethods() {
|
|
|
1071
1417
|
'getProductsByCategoryId',
|
|
1072
1418
|
'getProductById',
|
|
1073
1419
|
'createProduct',
|
|
1420
|
+
'updateSku',
|
|
1074
1421
|
];
|
|
1075
1422
|
for (const method of grpcMethods) {
|
|
1076
1423
|
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
@@ -1120,3 +1467,13 @@ function ProductOutboxServiceControllerMethods() {
|
|
|
1120
1467
|
};
|
|
1121
1468
|
}
|
|
1122
1469
|
exports.PRODUCT_OUTBOX_SERVICE_NAME = 'ProductOutboxService';
|
|
1470
|
+
function longToNumber(int64) {
|
|
1471
|
+
const num = globalThis.Number(int64.toString());
|
|
1472
|
+
if (num > globalThis.Number.MAX_SAFE_INTEGER) {
|
|
1473
|
+
throw new globalThis.Error('Value is larger than Number.MAX_SAFE_INTEGER');
|
|
1474
|
+
}
|
|
1475
|
+
if (num < globalThis.Number.MIN_SAFE_INTEGER) {
|
|
1476
|
+
throw new globalThis.Error('Value is smaller than Number.MIN_SAFE_INTEGER');
|
|
1477
|
+
}
|
|
1478
|
+
return num;
|
|
1479
|
+
}
|
package/dist/types/sagebox.d.ts
CHANGED
|
@@ -21,6 +21,16 @@ export interface CreateProductRequest {
|
|
|
21
21
|
mediaKeys: string[];
|
|
22
22
|
skus: ProductSkuInput[];
|
|
23
23
|
}
|
|
24
|
+
export interface UpdateSkuRequest {
|
|
25
|
+
id: string;
|
|
26
|
+
price?: number | undefined;
|
|
27
|
+
width?: number | undefined;
|
|
28
|
+
height?: number | undefined;
|
|
29
|
+
length?: number | undefined;
|
|
30
|
+
weight?: number | undefined;
|
|
31
|
+
mediaKeys: string[];
|
|
32
|
+
attributeValues: AttributeValueInput[];
|
|
33
|
+
}
|
|
24
34
|
/**
|
|
25
35
|
* ============================================
|
|
26
36
|
* Product Response Messages
|
|
@@ -33,6 +43,10 @@ export interface ProductResponse {
|
|
|
33
43
|
product: Product | undefined;
|
|
34
44
|
error: string;
|
|
35
45
|
}
|
|
46
|
+
export interface SkuResponse {
|
|
47
|
+
sku: Sku | undefined;
|
|
48
|
+
error: string;
|
|
49
|
+
}
|
|
36
50
|
/**
|
|
37
51
|
* ============================================
|
|
38
52
|
* Address Request Messages
|
|
@@ -80,6 +94,20 @@ export interface Product {
|
|
|
80
94
|
createdAt: string;
|
|
81
95
|
updatedAt: string;
|
|
82
96
|
}
|
|
97
|
+
export interface Sku {
|
|
98
|
+
id: string;
|
|
99
|
+
skuNo: string;
|
|
100
|
+
productId: string;
|
|
101
|
+
price: number;
|
|
102
|
+
width: number;
|
|
103
|
+
height: number;
|
|
104
|
+
length: number;
|
|
105
|
+
weight: number;
|
|
106
|
+
media: Media[];
|
|
107
|
+
inactive: boolean;
|
|
108
|
+
createdAt: string;
|
|
109
|
+
updatedAt: string;
|
|
110
|
+
}
|
|
83
111
|
export interface Media {
|
|
84
112
|
id: string;
|
|
85
113
|
key: string;
|
|
@@ -91,7 +119,11 @@ export interface Media {
|
|
|
91
119
|
export interface ProductSkuInput {
|
|
92
120
|
price: number;
|
|
93
121
|
quantity: number;
|
|
122
|
+
width: number;
|
|
123
|
+
height: number;
|
|
124
|
+
length: number;
|
|
94
125
|
warehouseId: string;
|
|
126
|
+
weight: number;
|
|
95
127
|
mediaKeys: string[];
|
|
96
128
|
attributeValues: AttributeValueInput[];
|
|
97
129
|
}
|
|
@@ -140,8 +172,10 @@ export interface RetryEsResponse {
|
|
|
140
172
|
export declare const GetProductsByCategoryIdRequest: MessageFns<GetProductsByCategoryIdRequest>;
|
|
141
173
|
export declare const GetProductByIdRequest: MessageFns<GetProductByIdRequest>;
|
|
142
174
|
export declare const CreateProductRequest: MessageFns<CreateProductRequest>;
|
|
175
|
+
export declare const UpdateSkuRequest: MessageFns<UpdateSkuRequest>;
|
|
143
176
|
export declare const GetProductsResponse: MessageFns<GetProductsResponse>;
|
|
144
177
|
export declare const ProductResponse: MessageFns<ProductResponse>;
|
|
178
|
+
export declare const SkuResponse: MessageFns<SkuResponse>;
|
|
145
179
|
export declare const GetProvincesRequest: MessageFns<GetProvincesRequest>;
|
|
146
180
|
export declare const GetDistrictsRequest: MessageFns<GetDistrictsRequest>;
|
|
147
181
|
export declare const GetWardsRequest: MessageFns<GetWardsRequest>;
|
|
@@ -149,6 +183,7 @@ export declare const GetProvincesResponse: MessageFns<GetProvincesResponse>;
|
|
|
149
183
|
export declare const GetDistrictsResponse: MessageFns<GetDistrictsResponse>;
|
|
150
184
|
export declare const GetWardsResponse: MessageFns<GetWardsResponse>;
|
|
151
185
|
export declare const Product: MessageFns<Product>;
|
|
186
|
+
export declare const Sku: MessageFns<Sku>;
|
|
152
187
|
export declare const Media: MessageFns<Media>;
|
|
153
188
|
export declare const ProductSkuInput: MessageFns<ProductSkuInput>;
|
|
154
189
|
export declare const AttributeValueInput: MessageFns<AttributeValueInput>;
|
|
@@ -193,11 +228,21 @@ export declare const ProductServiceService: {
|
|
|
193
228
|
readonly responseSerialize: (value: ProductResponse) => Buffer;
|
|
194
229
|
readonly responseDeserialize: (value: Buffer) => ProductResponse;
|
|
195
230
|
};
|
|
231
|
+
readonly updateSku: {
|
|
232
|
+
readonly path: "/sagebox.ProductService/UpdateSku";
|
|
233
|
+
readonly requestStream: false;
|
|
234
|
+
readonly responseStream: false;
|
|
235
|
+
readonly requestSerialize: (value: UpdateSkuRequest) => Buffer;
|
|
236
|
+
readonly requestDeserialize: (value: Buffer) => UpdateSkuRequest;
|
|
237
|
+
readonly responseSerialize: (value: SkuResponse) => Buffer;
|
|
238
|
+
readonly responseDeserialize: (value: Buffer) => SkuResponse;
|
|
239
|
+
};
|
|
196
240
|
};
|
|
197
241
|
export interface ProductServiceServer extends UntypedServiceImplementation {
|
|
198
242
|
getProductsByCategoryId: handleUnaryCall<GetProductsByCategoryIdRequest, GetProductsResponse>;
|
|
199
243
|
getProductById: handleUnaryCall<GetProductByIdRequest, ProductResponse>;
|
|
200
244
|
createProduct: handleUnaryCall<CreateProductRequest, ProductResponse>;
|
|
245
|
+
updateSku: handleUnaryCall<UpdateSkuRequest, SkuResponse>;
|
|
201
246
|
}
|
|
202
247
|
export interface ProductServiceClient extends Client {
|
|
203
248
|
getProductsByCategoryId(request: GetProductsByCategoryIdRequest, callback: (error: ServiceError | null, response: GetProductsResponse) => void): ClientUnaryCall;
|
|
@@ -209,6 +254,9 @@ export interface ProductServiceClient extends Client {
|
|
|
209
254
|
createProduct(request: CreateProductRequest, callback: (error: ServiceError | null, response: ProductResponse) => void): ClientUnaryCall;
|
|
210
255
|
createProduct(request: CreateProductRequest, metadata: Metadata, callback: (error: ServiceError | null, response: ProductResponse) => void): ClientUnaryCall;
|
|
211
256
|
createProduct(request: CreateProductRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: ProductResponse) => void): ClientUnaryCall;
|
|
257
|
+
updateSku(request: UpdateSkuRequest, callback: (error: ServiceError | null, response: SkuResponse) => void): ClientUnaryCall;
|
|
258
|
+
updateSku(request: UpdateSkuRequest, metadata: Metadata, callback: (error: ServiceError | null, response: SkuResponse) => void): ClientUnaryCall;
|
|
259
|
+
updateSku(request: UpdateSkuRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: SkuResponse) => void): ClientUnaryCall;
|
|
212
260
|
}
|
|
213
261
|
export declare const ProductServiceClient: {
|
|
214
262
|
new (address: string, credentials: ChannelCredentials, options?: Partial<ClientOptions>): ProductServiceClient;
|