@sagebox-be/proto-contracts 1.0.13 → 1.0.15
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.js +2 -2
- package/dist/interfaces/sagebox.d.ts +63 -5
- package/dist/interfaces/sagebox.js +239 -37
- package/dist/types/sagebox.d.ts +119 -5
- package/dist/types/sagebox.js +402 -59
- package/package.json +1 -1
- package/proto/sagebox.proto +41 -5
- package/dist/interfaces/product.d.ts +0 -91
- package/dist/interfaces/product.js +0 -663
- package/dist/types/product.d.ts +0 -143
- package/dist/types/product.js +0 -1057
package/proto/sagebox.proto
CHANGED
|
@@ -20,6 +20,17 @@ service AddressService {
|
|
|
20
20
|
rpc GetWards(GetWardsRequest) returns (GetWardsResponse);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
// ============================================
|
|
24
|
+
// Outbox Service
|
|
25
|
+
// ============================================
|
|
26
|
+
service ProductOutboxService {
|
|
27
|
+
rpc PublishProductOutbox(PublishOutboxRequest) returns (PublishOutboxResponse);
|
|
28
|
+
rpc RetryProductOutbox(RetryOutboxRequest) returns (RetryOutboxResponse);
|
|
29
|
+
rpc PublishInventoryOutbox(PublishOutboxRequest) returns (PublishOutboxResponse);
|
|
30
|
+
rpc RetryInventoryOutbox(RetryOutboxRequest) returns (RetryOutboxResponse);
|
|
31
|
+
rpc RetryElasticsearchSync(RetryEsRequest) returns (RetryEsResponse);
|
|
32
|
+
}
|
|
33
|
+
|
|
23
34
|
// ============================================
|
|
24
35
|
// Product Request Messages
|
|
25
36
|
// ============================================
|
|
@@ -33,10 +44,9 @@ message GetProductByIdRequest {
|
|
|
33
44
|
|
|
34
45
|
message CreateProductRequest {
|
|
35
46
|
string name = 1;
|
|
36
|
-
string
|
|
47
|
+
optional string brandId = 2;
|
|
37
48
|
string description = 3;
|
|
38
49
|
string categoryId = 4;
|
|
39
|
-
string storeId = 5;
|
|
40
50
|
string status = 6;
|
|
41
51
|
repeated string mediaKeys = 7;
|
|
42
52
|
repeated ProductSkuInput skus = 8;
|
|
@@ -89,11 +99,10 @@ message GetWardsResponse {
|
|
|
89
99
|
message Product {
|
|
90
100
|
string id = 1;
|
|
91
101
|
string name = 2;
|
|
92
|
-
string
|
|
102
|
+
optional string brandId = 3;
|
|
93
103
|
string description = 4;
|
|
94
104
|
string keywords = 5;
|
|
95
105
|
string categoryId = 6;
|
|
96
|
-
string storeId = 7;
|
|
97
106
|
int32 viewedCount = 8;
|
|
98
107
|
string status = 9;
|
|
99
108
|
string url = 10;
|
|
@@ -114,7 +123,7 @@ message Media {
|
|
|
114
123
|
message ProductSkuInput {
|
|
115
124
|
int32 price = 1;
|
|
116
125
|
int32 quantity = 2;
|
|
117
|
-
|
|
126
|
+
string warehouseId = 6;
|
|
118
127
|
repeated string mediaKeys = 4;
|
|
119
128
|
repeated AttributeValueInput attributeValues = 5;
|
|
120
129
|
}
|
|
@@ -132,3 +141,30 @@ message AddressUnit {
|
|
|
132
141
|
string code = 1;
|
|
133
142
|
string name = 2;
|
|
134
143
|
}
|
|
144
|
+
|
|
145
|
+
// ============================================
|
|
146
|
+
// Outbox Request Messages
|
|
147
|
+
// ============================================
|
|
148
|
+
message PublishOutboxRequest {}
|
|
149
|
+
|
|
150
|
+
message RetryOutboxRequest {}
|
|
151
|
+
|
|
152
|
+
message RetryEsRequest {}
|
|
153
|
+
|
|
154
|
+
// ============================================
|
|
155
|
+
// Outbox Response Messages
|
|
156
|
+
// ============================================
|
|
157
|
+
message PublishOutboxResponse {
|
|
158
|
+
bool success = 1;
|
|
159
|
+
string error = 2;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
message RetryOutboxResponse {
|
|
163
|
+
bool success = 1;
|
|
164
|
+
string error = 2;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
message RetryEsResponse {
|
|
168
|
+
bool success = 1;
|
|
169
|
+
string error = 2;
|
|
170
|
+
}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
|
|
2
|
-
import type { Metadata } from '@grpc/grpc-js';
|
|
3
|
-
import { Observable } from 'rxjs';
|
|
4
|
-
export declare const protobufPackage = "product";
|
|
5
|
-
/** Request messages */
|
|
6
|
-
export interface GetProductsByCategoryIdRequest {
|
|
7
|
-
categoryId: string;
|
|
8
|
-
}
|
|
9
|
-
export interface GetProductByIdRequest {
|
|
10
|
-
id: string;
|
|
11
|
-
}
|
|
12
|
-
export interface CreateProductRequest {
|
|
13
|
-
name: string;
|
|
14
|
-
title: string;
|
|
15
|
-
description: string;
|
|
16
|
-
categoryId: string;
|
|
17
|
-
storeId: string;
|
|
18
|
-
status: string;
|
|
19
|
-
mediaKeys: string[];
|
|
20
|
-
skus: ProductSkuInput[];
|
|
21
|
-
}
|
|
22
|
-
/** Response messages */
|
|
23
|
-
export interface GetProductsResponse {
|
|
24
|
-
products: Product[];
|
|
25
|
-
}
|
|
26
|
-
export interface ProductResponse {
|
|
27
|
-
product: Product | undefined;
|
|
28
|
-
error: string;
|
|
29
|
-
}
|
|
30
|
-
/** Data structures */
|
|
31
|
-
export interface Product {
|
|
32
|
-
id: string;
|
|
33
|
-
name: string;
|
|
34
|
-
title: string;
|
|
35
|
-
description: string;
|
|
36
|
-
keywords: string;
|
|
37
|
-
categoryId: string;
|
|
38
|
-
storeId: string;
|
|
39
|
-
viewedCount: number;
|
|
40
|
-
status: string;
|
|
41
|
-
url: string;
|
|
42
|
-
media: Media[];
|
|
43
|
-
createdAt: string;
|
|
44
|
-
updatedAt: string;
|
|
45
|
-
}
|
|
46
|
-
export interface Media {
|
|
47
|
-
id: string;
|
|
48
|
-
key: string;
|
|
49
|
-
url: string;
|
|
50
|
-
type: string;
|
|
51
|
-
createdAt: string;
|
|
52
|
-
updatedAt: string;
|
|
53
|
-
}
|
|
54
|
-
export interface ProductSkuInput {
|
|
55
|
-
price: number;
|
|
56
|
-
quantity: number;
|
|
57
|
-
brand?: string | undefined;
|
|
58
|
-
mediaKeys: string[];
|
|
59
|
-
attributeValues: AttributeValueInput[];
|
|
60
|
-
}
|
|
61
|
-
export interface AttributeValueInput {
|
|
62
|
-
attrId: string;
|
|
63
|
-
value: string;
|
|
64
|
-
name: string;
|
|
65
|
-
}
|
|
66
|
-
export declare const PRODUCT_PACKAGE_NAME = "product";
|
|
67
|
-
export declare const GetProductsByCategoryIdRequest: MessageFns<GetProductsByCategoryIdRequest>;
|
|
68
|
-
export declare const GetProductByIdRequest: MessageFns<GetProductByIdRequest>;
|
|
69
|
-
export declare const CreateProductRequest: MessageFns<CreateProductRequest>;
|
|
70
|
-
export declare const GetProductsResponse: MessageFns<GetProductsResponse>;
|
|
71
|
-
export declare const ProductResponse: MessageFns<ProductResponse>;
|
|
72
|
-
export declare const Product: MessageFns<Product>;
|
|
73
|
-
export declare const Media: MessageFns<Media>;
|
|
74
|
-
export declare const ProductSkuInput: MessageFns<ProductSkuInput>;
|
|
75
|
-
export declare const AttributeValueInput: MessageFns<AttributeValueInput>;
|
|
76
|
-
export interface ProductServiceClient {
|
|
77
|
-
getProductsByCategoryId(request: GetProductsByCategoryIdRequest, metadata?: Metadata): Observable<GetProductsResponse>;
|
|
78
|
-
getProductById(request: GetProductByIdRequest, metadata?: Metadata): Observable<ProductResponse>;
|
|
79
|
-
createProduct(request: CreateProductRequest, metadata?: Metadata): Observable<ProductResponse>;
|
|
80
|
-
}
|
|
81
|
-
export interface ProductServiceController {
|
|
82
|
-
getProductsByCategoryId(request: GetProductsByCategoryIdRequest, metadata?: Metadata): Promise<GetProductsResponse> | Observable<GetProductsResponse> | GetProductsResponse;
|
|
83
|
-
getProductById(request: GetProductByIdRequest, metadata?: Metadata): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
|
|
84
|
-
createProduct(request: CreateProductRequest, metadata?: Metadata): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
|
|
85
|
-
}
|
|
86
|
-
export declare function ProductServiceControllerMethods(): (constructor: Function) => void;
|
|
87
|
-
export declare const PRODUCT_SERVICE_NAME = "ProductService";
|
|
88
|
-
export interface MessageFns<T> {
|
|
89
|
-
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
90
|
-
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
91
|
-
}
|