@sagebox-be/proto-contracts 1.0.10 → 1.0.12
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/types/product.d.ts +50 -9
- package/dist/types/product.js +32 -1
- package/dist/utils.js +2 -6
- package/package.json +3 -5
package/dist/types/product.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
|
|
2
|
-
import type
|
|
2
|
+
import { type CallOptions, type ChannelCredentials, Client, type ClientOptions, type ClientUnaryCall, type handleUnaryCall, type Metadata, type ServiceError, type UntypedServiceImplementation } from '@grpc/grpc-js';
|
|
3
3
|
export declare const protobufPackage = "product";
|
|
4
4
|
/** Request messages */
|
|
5
5
|
export interface GetProductsByCategoryIdRequest {
|
|
@@ -71,16 +71,57 @@ export declare const Product: MessageFns<Product>;
|
|
|
71
71
|
export declare const Media: MessageFns<Media>;
|
|
72
72
|
export declare const ProductSkuInput: MessageFns<ProductSkuInput>;
|
|
73
73
|
export declare const AttributeValueInput: MessageFns<AttributeValueInput>;
|
|
74
|
-
export
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
export type ProductServiceService = typeof ProductServiceService;
|
|
75
|
+
export declare const ProductServiceService: {
|
|
76
|
+
readonly getProductsByCategoryId: {
|
|
77
|
+
readonly path: "/product.ProductService/GetProductsByCategoryId";
|
|
78
|
+
readonly requestStream: false;
|
|
79
|
+
readonly responseStream: false;
|
|
80
|
+
readonly requestSerialize: (value: GetProductsByCategoryIdRequest) => Buffer;
|
|
81
|
+
readonly requestDeserialize: (value: Buffer) => GetProductsByCategoryIdRequest;
|
|
82
|
+
readonly responseSerialize: (value: GetProductsResponse) => Buffer;
|
|
83
|
+
readonly responseDeserialize: (value: Buffer) => GetProductsResponse;
|
|
84
|
+
};
|
|
85
|
+
readonly getProductById: {
|
|
86
|
+
readonly path: "/product.ProductService/GetProductById";
|
|
87
|
+
readonly requestStream: false;
|
|
88
|
+
readonly responseStream: false;
|
|
89
|
+
readonly requestSerialize: (value: GetProductByIdRequest) => Buffer;
|
|
90
|
+
readonly requestDeserialize: (value: Buffer) => GetProductByIdRequest;
|
|
91
|
+
readonly responseSerialize: (value: ProductResponse) => Buffer;
|
|
92
|
+
readonly responseDeserialize: (value: Buffer) => ProductResponse;
|
|
93
|
+
};
|
|
94
|
+
readonly createProduct: {
|
|
95
|
+
readonly path: "/product.ProductService/CreateProduct";
|
|
96
|
+
readonly requestStream: false;
|
|
97
|
+
readonly responseStream: false;
|
|
98
|
+
readonly requestSerialize: (value: CreateProductRequest) => Buffer;
|
|
99
|
+
readonly requestDeserialize: (value: Buffer) => CreateProductRequest;
|
|
100
|
+
readonly responseSerialize: (value: ProductResponse) => Buffer;
|
|
101
|
+
readonly responseDeserialize: (value: Buffer) => ProductResponse;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
export interface ProductServiceServer extends UntypedServiceImplementation {
|
|
105
|
+
getProductsByCategoryId: handleUnaryCall<GetProductsByCategoryIdRequest, GetProductsResponse>;
|
|
106
|
+
getProductById: handleUnaryCall<GetProductByIdRequest, ProductResponse>;
|
|
107
|
+
createProduct: handleUnaryCall<CreateProductRequest, ProductResponse>;
|
|
78
108
|
}
|
|
79
|
-
export interface ProductServiceClient
|
|
80
|
-
getProductsByCategoryId(request:
|
|
81
|
-
|
|
82
|
-
|
|
109
|
+
export interface ProductServiceClient extends Client {
|
|
110
|
+
getProductsByCategoryId(request: GetProductsByCategoryIdRequest, callback: (error: ServiceError | null, response: GetProductsResponse) => void): ClientUnaryCall;
|
|
111
|
+
getProductsByCategoryId(request: GetProductsByCategoryIdRequest, metadata: Metadata, callback: (error: ServiceError | null, response: GetProductsResponse) => void): ClientUnaryCall;
|
|
112
|
+
getProductsByCategoryId(request: GetProductsByCategoryIdRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: GetProductsResponse) => void): ClientUnaryCall;
|
|
113
|
+
getProductById(request: GetProductByIdRequest, callback: (error: ServiceError | null, response: ProductResponse) => void): ClientUnaryCall;
|
|
114
|
+
getProductById(request: GetProductByIdRequest, metadata: Metadata, callback: (error: ServiceError | null, response: ProductResponse) => void): ClientUnaryCall;
|
|
115
|
+
getProductById(request: GetProductByIdRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: ProductResponse) => void): ClientUnaryCall;
|
|
116
|
+
createProduct(request: CreateProductRequest, callback: (error: ServiceError | null, response: ProductResponse) => void): ClientUnaryCall;
|
|
117
|
+
createProduct(request: CreateProductRequest, metadata: Metadata, callback: (error: ServiceError | null, response: ProductResponse) => void): ClientUnaryCall;
|
|
118
|
+
createProduct(request: CreateProductRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: ProductResponse) => void): ClientUnaryCall;
|
|
83
119
|
}
|
|
120
|
+
export declare const ProductServiceClient: {
|
|
121
|
+
new (address: string, credentials: ChannelCredentials, options?: Partial<ClientOptions>): ProductServiceClient;
|
|
122
|
+
service: typeof ProductServiceService;
|
|
123
|
+
serviceName: string;
|
|
124
|
+
};
|
|
84
125
|
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
85
126
|
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 {} ? {
|
|
86
127
|
[K in keyof T]?: DeepPartial<T[K]>;
|
package/dist/types/product.js
CHANGED
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
// protoc v6.33.2
|
|
6
6
|
// source: product.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.AttributeValueInput = exports.ProductSkuInput = exports.Media = exports.Product = exports.ProductResponse = exports.GetProductsResponse = exports.CreateProductRequest = exports.GetProductByIdRequest = exports.GetProductsByCategoryIdRequest = exports.protobufPackage = void 0;
|
|
8
|
+
exports.ProductServiceClient = exports.ProductServiceService = exports.AttributeValueInput = exports.ProductSkuInput = exports.Media = exports.Product = exports.ProductResponse = exports.GetProductsResponse = exports.CreateProductRequest = exports.GetProductByIdRequest = exports.GetProductsByCategoryIdRequest = exports.protobufPackage = void 0;
|
|
9
9
|
/* eslint-disable */
|
|
10
10
|
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
11
|
+
const grpc_js_1 = require("@grpc/grpc-js");
|
|
11
12
|
exports.protobufPackage = 'product';
|
|
12
13
|
function createBaseGetProductsByCategoryIdRequest() {
|
|
13
14
|
return { categoryId: '' };
|
|
@@ -1021,6 +1022,36 @@ exports.AttributeValueInput = {
|
|
|
1021
1022
|
return message;
|
|
1022
1023
|
},
|
|
1023
1024
|
};
|
|
1025
|
+
exports.ProductServiceService = {
|
|
1026
|
+
getProductsByCategoryId: {
|
|
1027
|
+
path: '/product.ProductService/GetProductsByCategoryId',
|
|
1028
|
+
requestStream: false,
|
|
1029
|
+
responseStream: false,
|
|
1030
|
+
requestSerialize: (value) => Buffer.from(exports.GetProductsByCategoryIdRequest.encode(value).finish()),
|
|
1031
|
+
requestDeserialize: (value) => exports.GetProductsByCategoryIdRequest.decode(value),
|
|
1032
|
+
responseSerialize: (value) => Buffer.from(exports.GetProductsResponse.encode(value).finish()),
|
|
1033
|
+
responseDeserialize: (value) => exports.GetProductsResponse.decode(value),
|
|
1034
|
+
},
|
|
1035
|
+
getProductById: {
|
|
1036
|
+
path: '/product.ProductService/GetProductById',
|
|
1037
|
+
requestStream: false,
|
|
1038
|
+
responseStream: false,
|
|
1039
|
+
requestSerialize: (value) => Buffer.from(exports.GetProductByIdRequest.encode(value).finish()),
|
|
1040
|
+
requestDeserialize: (value) => exports.GetProductByIdRequest.decode(value),
|
|
1041
|
+
responseSerialize: (value) => Buffer.from(exports.ProductResponse.encode(value).finish()),
|
|
1042
|
+
responseDeserialize: (value) => exports.ProductResponse.decode(value),
|
|
1043
|
+
},
|
|
1044
|
+
createProduct: {
|
|
1045
|
+
path: '/product.ProductService/CreateProduct',
|
|
1046
|
+
requestStream: false,
|
|
1047
|
+
responseStream: false,
|
|
1048
|
+
requestSerialize: (value) => Buffer.from(exports.CreateProductRequest.encode(value).finish()),
|
|
1049
|
+
requestDeserialize: (value) => exports.CreateProductRequest.decode(value),
|
|
1050
|
+
responseSerialize: (value) => Buffer.from(exports.ProductResponse.encode(value).finish()),
|
|
1051
|
+
responseDeserialize: (value) => exports.ProductResponse.decode(value),
|
|
1052
|
+
},
|
|
1053
|
+
};
|
|
1054
|
+
exports.ProductServiceClient = (0, grpc_js_1.makeGenericClientConstructor)(exports.ProductServiceService, 'product.ProductService');
|
|
1024
1055
|
function isSet(value) {
|
|
1025
1056
|
return value !== null && value !== undefined;
|
|
1026
1057
|
}
|
package/dist/utils.js
CHANGED
|
@@ -10,12 +10,8 @@ const path_1 = require("path");
|
|
|
10
10
|
*/
|
|
11
11
|
function getProtoPath(protoFileName) {
|
|
12
12
|
// Use absolute path from workspace root to avoid dist folder issues
|
|
13
|
-
return
|
|
14
|
-
|
|
15
|
-
// process.cwd(),
|
|
16
|
-
// 'node_modules/@sagebox-be/proto-contracts/proto',
|
|
17
|
-
// protoFileName
|
|
18
|
-
// );
|
|
13
|
+
// return join(process.cwd(), 'libs/proto-contracts/proto', protoFileName);
|
|
14
|
+
return (0, path_1.join)(process.cwd(), 'node_modules/@sagebox-be/proto-contracts/proto', protoFileName);
|
|
19
15
|
}
|
|
20
16
|
/**
|
|
21
17
|
* Get all proto file paths
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sagebox-be/proto-contracts",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"description": "Sagebox gRPC Protocol Buffer contracts and TypeScript definitions",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -27,8 +27,7 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@bufbuild/protobuf": "^2.2.2",
|
|
29
29
|
"@grpc/grpc-js": "^1.14.3",
|
|
30
|
-
"@grpc/proto-loader": "^0.8.0"
|
|
31
|
-
"nice-grpc-common": "^2.0.2"
|
|
30
|
+
"@grpc/proto-loader": "^0.8.0"
|
|
32
31
|
},
|
|
33
32
|
"devDependencies": {
|
|
34
33
|
"typescript": "^5.0.0"
|
|
@@ -36,8 +35,7 @@
|
|
|
36
35
|
"peerDependencies": {
|
|
37
36
|
"@bufbuild/protobuf": "^2.2.2",
|
|
38
37
|
"@grpc/grpc-js": "^1.14.0",
|
|
39
|
-
"@grpc/proto-loader": "^0.8.0"
|
|
40
|
-
"nice-grpc-common": "^2.0.2"
|
|
38
|
+
"@grpc/proto-loader": "^0.8.0"
|
|
41
39
|
},
|
|
42
40
|
"publishConfig": {
|
|
43
41
|
"access": "public"
|