@sagebox-be/proto-contracts 1.0.12 → 1.0.13
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 +2 -2
- package/dist/interfaces/sagebox.d.ts +179 -0
- package/dist/interfaces/sagebox.js +920 -0
- package/dist/types/sagebox.d.ts +260 -0
- package/dist/types/sagebox.js +1486 -0
- package/dist/utils.d.ts +1 -8
- package/dist/utils.js +4 -13
- package/package.json +2 -4
- package/proto/sagebox.proto +134 -0
- package/proto/product.proto +0 -79
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './types/
|
|
1
|
+
export * from './types/sagebox';
|
|
2
2
|
export { getProtoPath } from './utils';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// // Export all gRPC interfaces and types
|
|
3
|
-
// export * from './interfaces/
|
|
3
|
+
// export * from './interfaces/sagebox';
|
|
4
4
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
5
|
if (k2 === undefined) k2 = k;
|
|
6
6
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -18,7 +18,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
19
|
exports.getProtoPath = void 0;
|
|
20
20
|
// Export all gRPC types for TypeScript
|
|
21
|
-
__exportStar(require("./types/
|
|
21
|
+
__exportStar(require("./types/sagebox"), exports);
|
|
22
22
|
// Export proto file path helper
|
|
23
23
|
var utils_1 = require("./utils");
|
|
24
24
|
Object.defineProperty(exports, "getProtoPath", { enumerable: true, get: function () { return utils_1.getProtoPath; } });
|
|
@@ -0,0 +1,179 @@
|
|
|
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 = "sagebox";
|
|
5
|
+
/**
|
|
6
|
+
* ============================================
|
|
7
|
+
* Product Request Messages
|
|
8
|
+
* ============================================
|
|
9
|
+
*/
|
|
10
|
+
export interface GetProductsByCategoryIdRequest {
|
|
11
|
+
categoryId: string;
|
|
12
|
+
}
|
|
13
|
+
export interface GetProductByIdRequest {
|
|
14
|
+
id: string;
|
|
15
|
+
}
|
|
16
|
+
export interface CreateProductRequest {
|
|
17
|
+
name: string;
|
|
18
|
+
title: string;
|
|
19
|
+
description: string;
|
|
20
|
+
categoryId: string;
|
|
21
|
+
storeId: string;
|
|
22
|
+
status: string;
|
|
23
|
+
mediaKeys: string[];
|
|
24
|
+
skus: ProductSkuInput[];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* ============================================
|
|
28
|
+
* Product Response Messages
|
|
29
|
+
* ============================================
|
|
30
|
+
*/
|
|
31
|
+
export interface GetProductsResponse {
|
|
32
|
+
products: Product[];
|
|
33
|
+
}
|
|
34
|
+
export interface ProductResponse {
|
|
35
|
+
product: Product | undefined;
|
|
36
|
+
error: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* ============================================
|
|
40
|
+
* Address Request Messages
|
|
41
|
+
* ============================================
|
|
42
|
+
*/
|
|
43
|
+
export interface GetProvincesRequest {
|
|
44
|
+
}
|
|
45
|
+
export interface GetDistrictsRequest {
|
|
46
|
+
provinceCode: string;
|
|
47
|
+
}
|
|
48
|
+
export interface GetWardsRequest {
|
|
49
|
+
provinceCode: string;
|
|
50
|
+
districtCode: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* ============================================
|
|
54
|
+
* Address Response Messages
|
|
55
|
+
* ============================================
|
|
56
|
+
*/
|
|
57
|
+
export interface GetProvincesResponse {
|
|
58
|
+
provinces: AddressUnit[];
|
|
59
|
+
}
|
|
60
|
+
export interface GetDistrictsResponse {
|
|
61
|
+
districts: AddressUnit[];
|
|
62
|
+
}
|
|
63
|
+
export interface GetWardsResponse {
|
|
64
|
+
wards: AddressUnit[];
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* ============================================
|
|
68
|
+
* Product Data Structures
|
|
69
|
+
* ============================================
|
|
70
|
+
*/
|
|
71
|
+
export interface Product {
|
|
72
|
+
id: string;
|
|
73
|
+
name: string;
|
|
74
|
+
title: string;
|
|
75
|
+
description: string;
|
|
76
|
+
keywords: string;
|
|
77
|
+
categoryId: string;
|
|
78
|
+
storeId: string;
|
|
79
|
+
viewedCount: number;
|
|
80
|
+
status: string;
|
|
81
|
+
url: string;
|
|
82
|
+
media: Media[];
|
|
83
|
+
createdAt: string;
|
|
84
|
+
updatedAt: string;
|
|
85
|
+
}
|
|
86
|
+
export interface Media {
|
|
87
|
+
id: string;
|
|
88
|
+
key: string;
|
|
89
|
+
url: string;
|
|
90
|
+
type: string;
|
|
91
|
+
createdAt: string;
|
|
92
|
+
updatedAt: string;
|
|
93
|
+
}
|
|
94
|
+
export interface ProductSkuInput {
|
|
95
|
+
price: number;
|
|
96
|
+
quantity: number;
|
|
97
|
+
brand?: string | undefined;
|
|
98
|
+
mediaKeys: string[];
|
|
99
|
+
attributeValues: AttributeValueInput[];
|
|
100
|
+
}
|
|
101
|
+
export interface AttributeValueInput {
|
|
102
|
+
attrId: string;
|
|
103
|
+
value: string;
|
|
104
|
+
name: string;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* ============================================
|
|
108
|
+
* Address Data Structures
|
|
109
|
+
* ============================================
|
|
110
|
+
*/
|
|
111
|
+
export interface AddressUnit {
|
|
112
|
+
code: string;
|
|
113
|
+
name: string;
|
|
114
|
+
}
|
|
115
|
+
export declare const SAGEBOX_PACKAGE_NAME = "sagebox";
|
|
116
|
+
export declare const GetProductsByCategoryIdRequest: MessageFns<GetProductsByCategoryIdRequest>;
|
|
117
|
+
export declare const GetProductByIdRequest: MessageFns<GetProductByIdRequest>;
|
|
118
|
+
export declare const CreateProductRequest: MessageFns<CreateProductRequest>;
|
|
119
|
+
export declare const GetProductsResponse: MessageFns<GetProductsResponse>;
|
|
120
|
+
export declare const ProductResponse: MessageFns<ProductResponse>;
|
|
121
|
+
export declare const GetProvincesRequest: MessageFns<GetProvincesRequest>;
|
|
122
|
+
export declare const GetDistrictsRequest: MessageFns<GetDistrictsRequest>;
|
|
123
|
+
export declare const GetWardsRequest: MessageFns<GetWardsRequest>;
|
|
124
|
+
export declare const GetProvincesResponse: MessageFns<GetProvincesResponse>;
|
|
125
|
+
export declare const GetDistrictsResponse: MessageFns<GetDistrictsResponse>;
|
|
126
|
+
export declare const GetWardsResponse: MessageFns<GetWardsResponse>;
|
|
127
|
+
export declare const Product: MessageFns<Product>;
|
|
128
|
+
export declare const Media: MessageFns<Media>;
|
|
129
|
+
export declare const ProductSkuInput: MessageFns<ProductSkuInput>;
|
|
130
|
+
export declare const AttributeValueInput: MessageFns<AttributeValueInput>;
|
|
131
|
+
export declare const AddressUnit: MessageFns<AddressUnit>;
|
|
132
|
+
/**
|
|
133
|
+
* ============================================
|
|
134
|
+
* Product Service
|
|
135
|
+
* ============================================
|
|
136
|
+
*/
|
|
137
|
+
export interface ProductServiceClient {
|
|
138
|
+
getProductsByCategoryId(request: GetProductsByCategoryIdRequest, metadata?: Metadata): Observable<GetProductsResponse>;
|
|
139
|
+
getProductById(request: GetProductByIdRequest, metadata?: Metadata): Observable<ProductResponse>;
|
|
140
|
+
createProduct(request: CreateProductRequest, metadata?: Metadata): Observable<ProductResponse>;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* ============================================
|
|
144
|
+
* Product Service
|
|
145
|
+
* ============================================
|
|
146
|
+
*/
|
|
147
|
+
export interface ProductServiceController {
|
|
148
|
+
getProductsByCategoryId(request: GetProductsByCategoryIdRequest, metadata?: Metadata): Promise<GetProductsResponse> | Observable<GetProductsResponse> | GetProductsResponse;
|
|
149
|
+
getProductById(request: GetProductByIdRequest, metadata?: Metadata): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
|
|
150
|
+
createProduct(request: CreateProductRequest, metadata?: Metadata): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
|
|
151
|
+
}
|
|
152
|
+
export declare function ProductServiceControllerMethods(): (constructor: Function) => void;
|
|
153
|
+
export declare const PRODUCT_SERVICE_NAME = "ProductService";
|
|
154
|
+
/**
|
|
155
|
+
* ============================================
|
|
156
|
+
* Address Service
|
|
157
|
+
* ============================================
|
|
158
|
+
*/
|
|
159
|
+
export interface AddressServiceClient {
|
|
160
|
+
getProvinces(request: GetProvincesRequest, metadata?: Metadata): Observable<GetProvincesResponse>;
|
|
161
|
+
getDistricts(request: GetDistrictsRequest, metadata?: Metadata): Observable<GetDistrictsResponse>;
|
|
162
|
+
getWards(request: GetWardsRequest, metadata?: Metadata): Observable<GetWardsResponse>;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* ============================================
|
|
166
|
+
* Address Service
|
|
167
|
+
* ============================================
|
|
168
|
+
*/
|
|
169
|
+
export interface AddressServiceController {
|
|
170
|
+
getProvinces(request: GetProvincesRequest, metadata?: Metadata): Promise<GetProvincesResponse> | Observable<GetProvincesResponse> | GetProvincesResponse;
|
|
171
|
+
getDistricts(request: GetDistrictsRequest, metadata?: Metadata): Promise<GetDistrictsResponse> | Observable<GetDistrictsResponse> | GetDistrictsResponse;
|
|
172
|
+
getWards(request: GetWardsRequest, metadata?: Metadata): Promise<GetWardsResponse> | Observable<GetWardsResponse> | GetWardsResponse;
|
|
173
|
+
}
|
|
174
|
+
export declare function AddressServiceControllerMethods(): (constructor: Function) => void;
|
|
175
|
+
export declare const ADDRESS_SERVICE_NAME = "AddressService";
|
|
176
|
+
export interface MessageFns<T> {
|
|
177
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
178
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
179
|
+
}
|