@sagebox-be/proto-contracts 1.0.8 → 1.0.9
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/types/product.d.ts +11 -0
- package/dist/utils.js +6 -2
- package/package.json +6 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './interfaces/product';
|
|
2
2
|
export { getProtoPath } from './utils';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// // Export all gRPC interfaces and types
|
|
3
|
-
// export * from './interfaces/product';
|
|
4
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
3
|
if (k2 === undefined) k2 = k;
|
|
6
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -17,8 +15,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
17
15
|
};
|
|
18
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
17
|
exports.getProtoPath = void 0;
|
|
20
|
-
// Export all gRPC
|
|
21
|
-
__exportStar(require("./
|
|
18
|
+
// Export all gRPC interfaces and types
|
|
19
|
+
__exportStar(require("./interfaces/product"), exports);
|
|
20
|
+
// // Export all gRPC types for TypeScript
|
|
21
|
+
// export * from './types/product';
|
|
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; } });
|
package/dist/types/product.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
|
|
2
|
+
import type { CallContext, CallOptions } from 'nice-grpc-common';
|
|
2
3
|
export declare const protobufPackage = "product";
|
|
3
4
|
/** Request messages */
|
|
4
5
|
export interface GetProductsByCategoryIdRequest {
|
|
@@ -70,6 +71,16 @@ export declare const Product: MessageFns<Product>;
|
|
|
70
71
|
export declare const Media: MessageFns<Media>;
|
|
71
72
|
export declare const ProductSkuInput: MessageFns<ProductSkuInput>;
|
|
72
73
|
export declare const AttributeValueInput: MessageFns<AttributeValueInput>;
|
|
74
|
+
export interface ProductServiceImplementation<CallContextExt = {}> {
|
|
75
|
+
getProductsByCategoryId(request: GetProductsByCategoryIdRequest, context: CallContext & CallContextExt): Promise<DeepPartial<GetProductsResponse>>;
|
|
76
|
+
getProductById(request: GetProductByIdRequest, context: CallContext & CallContextExt): Promise<DeepPartial<ProductResponse>>;
|
|
77
|
+
createProduct(request: CreateProductRequest, context: CallContext & CallContextExt): Promise<DeepPartial<ProductResponse>>;
|
|
78
|
+
}
|
|
79
|
+
export interface ProductServiceClient<CallOptionsExt = {}> {
|
|
80
|
+
getProductsByCategoryId(request: DeepPartial<GetProductsByCategoryIdRequest>, options?: CallOptions & CallOptionsExt): Promise<GetProductsResponse>;
|
|
81
|
+
getProductById(request: DeepPartial<GetProductByIdRequest>, options?: CallOptions & CallOptionsExt): Promise<ProductResponse>;
|
|
82
|
+
createProduct(request: DeepPartial<CreateProductRequest>, options?: CallOptions & CallOptionsExt): Promise<ProductResponse>;
|
|
83
|
+
}
|
|
73
84
|
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
74
85
|
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 {} ? {
|
|
75
86
|
[K in keyof T]?: DeepPartial<T[K]>;
|
package/dist/utils.js
CHANGED
|
@@ -10,8 +10,12 @@ 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
|
-
|
|
14
|
-
return
|
|
13
|
+
return (0, path_1.join)(process.cwd(), 'libs/proto-contracts/proto', protoFileName);
|
|
14
|
+
// return join(
|
|
15
|
+
// process.cwd(),
|
|
16
|
+
// 'node_modules/@sagebox-be/proto-contracts/proto',
|
|
17
|
+
// protoFileName
|
|
18
|
+
// );
|
|
15
19
|
}
|
|
16
20
|
/**
|
|
17
21
|
* 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.9",
|
|
4
4
|
"description": "Sagebox gRPC Protocol Buffer contracts and TypeScript definitions",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"build": "tsc",
|
|
14
14
|
"prepublishOnly": "npm run build",
|
|
15
15
|
"proto:copy": "cp -r ../common/src/grpc/proto ./proto",
|
|
16
|
-
"proto:generate": "../../bin/proto-generate.sh"
|
|
16
|
+
"proto:generate": "../../bin/proto-generate.sh typescript"
|
|
17
17
|
},
|
|
18
18
|
"keywords": [
|
|
19
19
|
"grpc",
|
|
@@ -27,7 +27,8 @@
|
|
|
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"
|
|
30
|
+
"@grpc/proto-loader": "^0.8.0",
|
|
31
|
+
"nice-grpc-common": "^2.0.2"
|
|
31
32
|
},
|
|
32
33
|
"devDependencies": {
|
|
33
34
|
"typescript": "^5.0.0"
|
|
@@ -35,7 +36,8 @@
|
|
|
35
36
|
"peerDependencies": {
|
|
36
37
|
"@bufbuild/protobuf": "^2.2.2",
|
|
37
38
|
"@grpc/grpc-js": "^1.14.0",
|
|
38
|
-
"@grpc/proto-loader": "^0.8.0"
|
|
39
|
+
"@grpc/proto-loader": "^0.8.0",
|
|
40
|
+
"nice-grpc-common": "^2.0.2"
|
|
39
41
|
},
|
|
40
42
|
"publishConfig": {
|
|
41
43
|
"access": "public"
|