@sagebox-be/proto-contracts 1.0.12 → 1.0.14
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 +4 -4
- package/dist/interfaces/sagebox.d.ts +179 -0
- package/dist/interfaces/{product.js → sagebox.js} +261 -4
- package/dist/types/{product.d.ts → sagebox.d.ts} +124 -7
- package/dist/types/{product.js → sagebox.js} +436 -7
- 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/dist/interfaces/product.d.ts +0 -91
- package/proto/product.proto +0 -79
|
@@ -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
|
-
}
|
package/proto/product.proto
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package product;
|
|
4
|
-
|
|
5
|
-
service ProductService {
|
|
6
|
-
rpc GetProductsByCategoryId(GetProductsByCategoryIdRequest) returns (GetProductsResponse);
|
|
7
|
-
rpc GetProductById(GetProductByIdRequest) returns (ProductResponse);
|
|
8
|
-
rpc CreateProduct(CreateProductRequest) returns (ProductResponse);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
// Request messages
|
|
12
|
-
message GetProductsByCategoryIdRequest {
|
|
13
|
-
string categoryId = 1;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
message GetProductByIdRequest {
|
|
17
|
-
string id = 1;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
message CreateProductRequest {
|
|
21
|
-
string name = 1;
|
|
22
|
-
string title = 2;
|
|
23
|
-
string description = 3;
|
|
24
|
-
string categoryId = 4;
|
|
25
|
-
string storeId = 5;
|
|
26
|
-
string status = 6;
|
|
27
|
-
repeated string mediaKeys = 7;
|
|
28
|
-
repeated ProductSkuInput skus = 8;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// Response messages
|
|
32
|
-
message GetProductsResponse {
|
|
33
|
-
repeated Product products = 1;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
message ProductResponse {
|
|
37
|
-
Product product = 1;
|
|
38
|
-
string error = 2;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// Data structures
|
|
42
|
-
message Product {
|
|
43
|
-
string id = 1;
|
|
44
|
-
string name = 2;
|
|
45
|
-
string title = 3;
|
|
46
|
-
string description = 4;
|
|
47
|
-
string keywords = 5;
|
|
48
|
-
string categoryId = 6;
|
|
49
|
-
string storeId = 7;
|
|
50
|
-
int32 viewedCount = 8;
|
|
51
|
-
string status = 9;
|
|
52
|
-
string url = 10;
|
|
53
|
-
repeated Media media = 11;
|
|
54
|
-
string createdAt = 12;
|
|
55
|
-
string updatedAt = 13;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
message Media {
|
|
59
|
-
string id = 1;
|
|
60
|
-
string key = 2;
|
|
61
|
-
string url = 3;
|
|
62
|
-
string type = 4;
|
|
63
|
-
string createdAt = 5;
|
|
64
|
-
string updatedAt = 6;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
message ProductSkuInput {
|
|
68
|
-
int32 price = 1;
|
|
69
|
-
int32 quantity = 2;
|
|
70
|
-
optional string brand = 3;
|
|
71
|
-
repeated string mediaKeys = 4;
|
|
72
|
-
repeated AttributeValueInput attributeValues = 5;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
message AttributeValueInput {
|
|
76
|
-
string attrId = 1;
|
|
77
|
-
string value = 2;
|
|
78
|
-
string name = 3;
|
|
79
|
-
}
|