@sagebox-be/proto-contracts 1.0.14 → 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 +100 -5
- package/dist/interfaces/sagebox.js +598 -39
- package/dist/types/sagebox.d.ts +167 -5
- package/dist/types/sagebox.js +1019 -102
- package/package.json +1 -1
- package/proto/sagebox.proto +79 -7
package/dist/types/sagebox.d.ts
CHANGED
|
@@ -14,14 +14,23 @@ export interface GetProductByIdRequest {
|
|
|
14
14
|
}
|
|
15
15
|
export interface CreateProductRequest {
|
|
16
16
|
name: string;
|
|
17
|
-
|
|
17
|
+
brandId?: string | undefined;
|
|
18
18
|
description: string;
|
|
19
19
|
categoryId: string;
|
|
20
|
-
storeId: string;
|
|
21
20
|
status: string;
|
|
22
21
|
mediaKeys: string[];
|
|
23
22
|
skus: ProductSkuInput[];
|
|
24
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
|
+
}
|
|
25
34
|
/**
|
|
26
35
|
* ============================================
|
|
27
36
|
* Product Response Messages
|
|
@@ -34,6 +43,10 @@ export interface ProductResponse {
|
|
|
34
43
|
product: Product | undefined;
|
|
35
44
|
error: string;
|
|
36
45
|
}
|
|
46
|
+
export interface SkuResponse {
|
|
47
|
+
sku: Sku | undefined;
|
|
48
|
+
error: string;
|
|
49
|
+
}
|
|
37
50
|
/**
|
|
38
51
|
* ============================================
|
|
39
52
|
* Address Request Messages
|
|
@@ -70,11 +83,10 @@ export interface GetWardsResponse {
|
|
|
70
83
|
export interface Product {
|
|
71
84
|
id: string;
|
|
72
85
|
name: string;
|
|
73
|
-
|
|
86
|
+
brandId?: string | undefined;
|
|
74
87
|
description: string;
|
|
75
88
|
keywords: string;
|
|
76
89
|
categoryId: string;
|
|
77
|
-
storeId: string;
|
|
78
90
|
viewedCount: number;
|
|
79
91
|
status: string;
|
|
80
92
|
url: string;
|
|
@@ -82,6 +94,20 @@ export interface Product {
|
|
|
82
94
|
createdAt: string;
|
|
83
95
|
updatedAt: string;
|
|
84
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
|
+
}
|
|
85
111
|
export interface Media {
|
|
86
112
|
id: string;
|
|
87
113
|
key: string;
|
|
@@ -93,7 +119,11 @@ export interface Media {
|
|
|
93
119
|
export interface ProductSkuInput {
|
|
94
120
|
price: number;
|
|
95
121
|
quantity: number;
|
|
96
|
-
|
|
122
|
+
width: number;
|
|
123
|
+
height: number;
|
|
124
|
+
length: number;
|
|
125
|
+
warehouseId: string;
|
|
126
|
+
weight: number;
|
|
97
127
|
mediaKeys: string[];
|
|
98
128
|
attributeValues: AttributeValueInput[];
|
|
99
129
|
}
|
|
@@ -111,11 +141,41 @@ export interface AddressUnit {
|
|
|
111
141
|
code: string;
|
|
112
142
|
name: string;
|
|
113
143
|
}
|
|
144
|
+
/**
|
|
145
|
+
* ============================================
|
|
146
|
+
* Outbox Request Messages
|
|
147
|
+
* ============================================
|
|
148
|
+
*/
|
|
149
|
+
export interface PublishOutboxRequest {
|
|
150
|
+
}
|
|
151
|
+
export interface RetryOutboxRequest {
|
|
152
|
+
}
|
|
153
|
+
export interface RetryEsRequest {
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* ============================================
|
|
157
|
+
* Outbox Response Messages
|
|
158
|
+
* ============================================
|
|
159
|
+
*/
|
|
160
|
+
export interface PublishOutboxResponse {
|
|
161
|
+
success: boolean;
|
|
162
|
+
error: string;
|
|
163
|
+
}
|
|
164
|
+
export interface RetryOutboxResponse {
|
|
165
|
+
success: boolean;
|
|
166
|
+
error: string;
|
|
167
|
+
}
|
|
168
|
+
export interface RetryEsResponse {
|
|
169
|
+
success: boolean;
|
|
170
|
+
error: string;
|
|
171
|
+
}
|
|
114
172
|
export declare const GetProductsByCategoryIdRequest: MessageFns<GetProductsByCategoryIdRequest>;
|
|
115
173
|
export declare const GetProductByIdRequest: MessageFns<GetProductByIdRequest>;
|
|
116
174
|
export declare const CreateProductRequest: MessageFns<CreateProductRequest>;
|
|
175
|
+
export declare const UpdateSkuRequest: MessageFns<UpdateSkuRequest>;
|
|
117
176
|
export declare const GetProductsResponse: MessageFns<GetProductsResponse>;
|
|
118
177
|
export declare const ProductResponse: MessageFns<ProductResponse>;
|
|
178
|
+
export declare const SkuResponse: MessageFns<SkuResponse>;
|
|
119
179
|
export declare const GetProvincesRequest: MessageFns<GetProvincesRequest>;
|
|
120
180
|
export declare const GetDistrictsRequest: MessageFns<GetDistrictsRequest>;
|
|
121
181
|
export declare const GetWardsRequest: MessageFns<GetWardsRequest>;
|
|
@@ -123,10 +183,17 @@ export declare const GetProvincesResponse: MessageFns<GetProvincesResponse>;
|
|
|
123
183
|
export declare const GetDistrictsResponse: MessageFns<GetDistrictsResponse>;
|
|
124
184
|
export declare const GetWardsResponse: MessageFns<GetWardsResponse>;
|
|
125
185
|
export declare const Product: MessageFns<Product>;
|
|
186
|
+
export declare const Sku: MessageFns<Sku>;
|
|
126
187
|
export declare const Media: MessageFns<Media>;
|
|
127
188
|
export declare const ProductSkuInput: MessageFns<ProductSkuInput>;
|
|
128
189
|
export declare const AttributeValueInput: MessageFns<AttributeValueInput>;
|
|
129
190
|
export declare const AddressUnit: MessageFns<AddressUnit>;
|
|
191
|
+
export declare const PublishOutboxRequest: MessageFns<PublishOutboxRequest>;
|
|
192
|
+
export declare const RetryOutboxRequest: MessageFns<RetryOutboxRequest>;
|
|
193
|
+
export declare const RetryEsRequest: MessageFns<RetryEsRequest>;
|
|
194
|
+
export declare const PublishOutboxResponse: MessageFns<PublishOutboxResponse>;
|
|
195
|
+
export declare const RetryOutboxResponse: MessageFns<RetryOutboxResponse>;
|
|
196
|
+
export declare const RetryEsResponse: MessageFns<RetryEsResponse>;
|
|
130
197
|
/**
|
|
131
198
|
* ============================================
|
|
132
199
|
* Product Service
|
|
@@ -161,11 +228,21 @@ export declare const ProductServiceService: {
|
|
|
161
228
|
readonly responseSerialize: (value: ProductResponse) => Buffer;
|
|
162
229
|
readonly responseDeserialize: (value: Buffer) => ProductResponse;
|
|
163
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
|
+
};
|
|
164
240
|
};
|
|
165
241
|
export interface ProductServiceServer extends UntypedServiceImplementation {
|
|
166
242
|
getProductsByCategoryId: handleUnaryCall<GetProductsByCategoryIdRequest, GetProductsResponse>;
|
|
167
243
|
getProductById: handleUnaryCall<GetProductByIdRequest, ProductResponse>;
|
|
168
244
|
createProduct: handleUnaryCall<CreateProductRequest, ProductResponse>;
|
|
245
|
+
updateSku: handleUnaryCall<UpdateSkuRequest, SkuResponse>;
|
|
169
246
|
}
|
|
170
247
|
export interface ProductServiceClient extends Client {
|
|
171
248
|
getProductsByCategoryId(request: GetProductsByCategoryIdRequest, callback: (error: ServiceError | null, response: GetProductsResponse) => void): ClientUnaryCall;
|
|
@@ -177,6 +254,9 @@ export interface ProductServiceClient extends Client {
|
|
|
177
254
|
createProduct(request: CreateProductRequest, callback: (error: ServiceError | null, response: ProductResponse) => void): ClientUnaryCall;
|
|
178
255
|
createProduct(request: CreateProductRequest, metadata: Metadata, callback: (error: ServiceError | null, response: ProductResponse) => void): ClientUnaryCall;
|
|
179
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;
|
|
180
260
|
}
|
|
181
261
|
export declare const ProductServiceClient: {
|
|
182
262
|
new (address: string, credentials: ChannelCredentials, options?: Partial<ClientOptions>): ProductServiceClient;
|
|
@@ -239,6 +319,88 @@ export declare const AddressServiceClient: {
|
|
|
239
319
|
service: typeof AddressServiceService;
|
|
240
320
|
serviceName: string;
|
|
241
321
|
};
|
|
322
|
+
/**
|
|
323
|
+
* ============================================
|
|
324
|
+
* Outbox Service
|
|
325
|
+
* ============================================
|
|
326
|
+
*/
|
|
327
|
+
export type ProductOutboxServiceService = typeof ProductOutboxServiceService;
|
|
328
|
+
export declare const ProductOutboxServiceService: {
|
|
329
|
+
readonly publishProductOutbox: {
|
|
330
|
+
readonly path: "/sagebox.ProductOutboxService/PublishProductOutbox";
|
|
331
|
+
readonly requestStream: false;
|
|
332
|
+
readonly responseStream: false;
|
|
333
|
+
readonly requestSerialize: (value: PublishOutboxRequest) => Buffer;
|
|
334
|
+
readonly requestDeserialize: (value: Buffer) => PublishOutboxRequest;
|
|
335
|
+
readonly responseSerialize: (value: PublishOutboxResponse) => Buffer;
|
|
336
|
+
readonly responseDeserialize: (value: Buffer) => PublishOutboxResponse;
|
|
337
|
+
};
|
|
338
|
+
readonly retryProductOutbox: {
|
|
339
|
+
readonly path: "/sagebox.ProductOutboxService/RetryProductOutbox";
|
|
340
|
+
readonly requestStream: false;
|
|
341
|
+
readonly responseStream: false;
|
|
342
|
+
readonly requestSerialize: (value: RetryOutboxRequest) => Buffer;
|
|
343
|
+
readonly requestDeserialize: (value: Buffer) => RetryOutboxRequest;
|
|
344
|
+
readonly responseSerialize: (value: RetryOutboxResponse) => Buffer;
|
|
345
|
+
readonly responseDeserialize: (value: Buffer) => RetryOutboxResponse;
|
|
346
|
+
};
|
|
347
|
+
readonly publishInventoryOutbox: {
|
|
348
|
+
readonly path: "/sagebox.ProductOutboxService/PublishInventoryOutbox";
|
|
349
|
+
readonly requestStream: false;
|
|
350
|
+
readonly responseStream: false;
|
|
351
|
+
readonly requestSerialize: (value: PublishOutboxRequest) => Buffer;
|
|
352
|
+
readonly requestDeserialize: (value: Buffer) => PublishOutboxRequest;
|
|
353
|
+
readonly responseSerialize: (value: PublishOutboxResponse) => Buffer;
|
|
354
|
+
readonly responseDeserialize: (value: Buffer) => PublishOutboxResponse;
|
|
355
|
+
};
|
|
356
|
+
readonly retryInventoryOutbox: {
|
|
357
|
+
readonly path: "/sagebox.ProductOutboxService/RetryInventoryOutbox";
|
|
358
|
+
readonly requestStream: false;
|
|
359
|
+
readonly responseStream: false;
|
|
360
|
+
readonly requestSerialize: (value: RetryOutboxRequest) => Buffer;
|
|
361
|
+
readonly requestDeserialize: (value: Buffer) => RetryOutboxRequest;
|
|
362
|
+
readonly responseSerialize: (value: RetryOutboxResponse) => Buffer;
|
|
363
|
+
readonly responseDeserialize: (value: Buffer) => RetryOutboxResponse;
|
|
364
|
+
};
|
|
365
|
+
readonly retryElasticsearchSync: {
|
|
366
|
+
readonly path: "/sagebox.ProductOutboxService/RetryElasticsearchSync";
|
|
367
|
+
readonly requestStream: false;
|
|
368
|
+
readonly responseStream: false;
|
|
369
|
+
readonly requestSerialize: (value: RetryEsRequest) => Buffer;
|
|
370
|
+
readonly requestDeserialize: (value: Buffer) => RetryEsRequest;
|
|
371
|
+
readonly responseSerialize: (value: RetryEsResponse) => Buffer;
|
|
372
|
+
readonly responseDeserialize: (value: Buffer) => RetryEsResponse;
|
|
373
|
+
};
|
|
374
|
+
};
|
|
375
|
+
export interface ProductOutboxServiceServer extends UntypedServiceImplementation {
|
|
376
|
+
publishProductOutbox: handleUnaryCall<PublishOutboxRequest, PublishOutboxResponse>;
|
|
377
|
+
retryProductOutbox: handleUnaryCall<RetryOutboxRequest, RetryOutboxResponse>;
|
|
378
|
+
publishInventoryOutbox: handleUnaryCall<PublishOutboxRequest, PublishOutboxResponse>;
|
|
379
|
+
retryInventoryOutbox: handleUnaryCall<RetryOutboxRequest, RetryOutboxResponse>;
|
|
380
|
+
retryElasticsearchSync: handleUnaryCall<RetryEsRequest, RetryEsResponse>;
|
|
381
|
+
}
|
|
382
|
+
export interface ProductOutboxServiceClient extends Client {
|
|
383
|
+
publishProductOutbox(request: PublishOutboxRequest, callback: (error: ServiceError | null, response: PublishOutboxResponse) => void): ClientUnaryCall;
|
|
384
|
+
publishProductOutbox(request: PublishOutboxRequest, metadata: Metadata, callback: (error: ServiceError | null, response: PublishOutboxResponse) => void): ClientUnaryCall;
|
|
385
|
+
publishProductOutbox(request: PublishOutboxRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: PublishOutboxResponse) => void): ClientUnaryCall;
|
|
386
|
+
retryProductOutbox(request: RetryOutboxRequest, callback: (error: ServiceError | null, response: RetryOutboxResponse) => void): ClientUnaryCall;
|
|
387
|
+
retryProductOutbox(request: RetryOutboxRequest, metadata: Metadata, callback: (error: ServiceError | null, response: RetryOutboxResponse) => void): ClientUnaryCall;
|
|
388
|
+
retryProductOutbox(request: RetryOutboxRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: RetryOutboxResponse) => void): ClientUnaryCall;
|
|
389
|
+
publishInventoryOutbox(request: PublishOutboxRequest, callback: (error: ServiceError | null, response: PublishOutboxResponse) => void): ClientUnaryCall;
|
|
390
|
+
publishInventoryOutbox(request: PublishOutboxRequest, metadata: Metadata, callback: (error: ServiceError | null, response: PublishOutboxResponse) => void): ClientUnaryCall;
|
|
391
|
+
publishInventoryOutbox(request: PublishOutboxRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: PublishOutboxResponse) => void): ClientUnaryCall;
|
|
392
|
+
retryInventoryOutbox(request: RetryOutboxRequest, callback: (error: ServiceError | null, response: RetryOutboxResponse) => void): ClientUnaryCall;
|
|
393
|
+
retryInventoryOutbox(request: RetryOutboxRequest, metadata: Metadata, callback: (error: ServiceError | null, response: RetryOutboxResponse) => void): ClientUnaryCall;
|
|
394
|
+
retryInventoryOutbox(request: RetryOutboxRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: RetryOutboxResponse) => void): ClientUnaryCall;
|
|
395
|
+
retryElasticsearchSync(request: RetryEsRequest, callback: (error: ServiceError | null, response: RetryEsResponse) => void): ClientUnaryCall;
|
|
396
|
+
retryElasticsearchSync(request: RetryEsRequest, metadata: Metadata, callback: (error: ServiceError | null, response: RetryEsResponse) => void): ClientUnaryCall;
|
|
397
|
+
retryElasticsearchSync(request: RetryEsRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: RetryEsResponse) => void): ClientUnaryCall;
|
|
398
|
+
}
|
|
399
|
+
export declare const ProductOutboxServiceClient: {
|
|
400
|
+
new (address: string, credentials: ChannelCredentials, options?: Partial<ClientOptions>): ProductOutboxServiceClient;
|
|
401
|
+
service: typeof ProductOutboxServiceService;
|
|
402
|
+
serviceName: string;
|
|
403
|
+
};
|
|
242
404
|
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
243
405
|
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 {} ? {
|
|
244
406
|
[K in keyof T]?: DeepPartial<T[K]>;
|