@platfformx/proto-contracts 1.5.12 → 1.6.0
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/gen/ts/inventory-service/inventory.d.ts +1 -1
- package/dist/gen/ts/shipping-service/shipping.d.ts +29 -0
- package/dist/gen/ts/shipping-service/shipping.js +28 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/dist/paths/proto-paths.d.ts +1 -0
- package/dist/paths/proto-paths.js +1 -0
- package/package.json +1 -1
- package/proto/inventory-service/inventory.proto +3 -1
- package/proto/shipping-service/shipping.proto +27 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
export declare const protobufPackage = "shipping.v1";
|
|
3
|
+
export interface CalculateShipRequest {
|
|
4
|
+
street: string;
|
|
5
|
+
state: string;
|
|
6
|
+
zip: string;
|
|
7
|
+
city: string;
|
|
8
|
+
country: string;
|
|
9
|
+
totalWeight: number;
|
|
10
|
+
}
|
|
11
|
+
export interface CalculateShipResponse {
|
|
12
|
+
rates: Rate[];
|
|
13
|
+
}
|
|
14
|
+
export interface Rate {
|
|
15
|
+
provider: string;
|
|
16
|
+
amount: string;
|
|
17
|
+
currency: string;
|
|
18
|
+
days: number;
|
|
19
|
+
serviceName: string;
|
|
20
|
+
}
|
|
21
|
+
export declare const SHIPPING_V1_PACKAGE_NAME = "shipping.v1";
|
|
22
|
+
export interface ShippingServiceClient {
|
|
23
|
+
calculateShip(request: CalculateShipRequest): Observable<CalculateShipResponse>;
|
|
24
|
+
}
|
|
25
|
+
export interface ShippingServiceController {
|
|
26
|
+
calculateShip(request: CalculateShipRequest): Promise<CalculateShipResponse> | Observable<CalculateShipResponse> | CalculateShipResponse;
|
|
27
|
+
}
|
|
28
|
+
export declare function ShippingServiceControllerMethods(): (constructor: Function) => void;
|
|
29
|
+
export declare const SHIPPING_SERVICE_NAME = "ShippingService";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.11.8
|
|
5
|
+
// protoc v7.34.0
|
|
6
|
+
// source: shipping-service/shipping.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.SHIPPING_SERVICE_NAME = exports.SHIPPING_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
9
|
+
exports.ShippingServiceControllerMethods = ShippingServiceControllerMethods;
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
+
exports.protobufPackage = "shipping.v1";
|
|
13
|
+
exports.SHIPPING_V1_PACKAGE_NAME = "shipping.v1";
|
|
14
|
+
function ShippingServiceControllerMethods() {
|
|
15
|
+
return function (constructor) {
|
|
16
|
+
const grpcMethods = ["calculateShip"];
|
|
17
|
+
for (const method of grpcMethods) {
|
|
18
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
19
|
+
(0, microservices_1.GrpcMethod)("ShippingService", method)(constructor.prototype[method], method, descriptor);
|
|
20
|
+
}
|
|
21
|
+
const grpcStreamMethods = [];
|
|
22
|
+
for (const method of grpcStreamMethods) {
|
|
23
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
24
|
+
(0, microservices_1.GrpcStreamMethod)("ShippingService", method)(constructor.prototype[method], method, descriptor);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
exports.SHIPPING_SERVICE_NAME = "ShippingService";
|
package/dist/index.d.ts
CHANGED
|
@@ -14,4 +14,5 @@ export * as Order from './gen/ts/order-service/order';
|
|
|
14
14
|
export * as AI from './gen/ts/ai-service/ai';
|
|
15
15
|
export * as Review from './gen/ts/review-service/review';
|
|
16
16
|
export * as Inventory from './gen/ts/inventory-service/inventory';
|
|
17
|
+
export * as Shipping from './gen/ts/shipping-service/shipping';
|
|
17
18
|
export { BulkStatus } from './gen/ts/products-service/bulk';
|
package/dist/index.js
CHANGED
|
@@ -36,7 +36,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.BulkStatus = exports.Inventory = exports.Review = exports.AI = exports.Order = exports.Refund = exports.Payment = exports.Search = exports.Category = exports.Bulk = exports.Product = exports.Account = exports.S3 = exports.Auth = exports.OAuthProvider = void 0;
|
|
39
|
+
exports.BulkStatus = exports.Shipping = exports.Inventory = exports.Review = exports.AI = exports.Order = exports.Refund = exports.Payment = exports.Search = exports.Category = exports.Bulk = exports.Product = exports.Account = exports.S3 = exports.Auth = exports.OAuthProvider = void 0;
|
|
40
40
|
__exportStar(require("./paths/index"), exports);
|
|
41
41
|
__exportStar(require("./paths/proto-paths"), exports);
|
|
42
42
|
var auth_1 = require("./gen/ts/auth-service/auth");
|
|
@@ -54,5 +54,6 @@ exports.Order = __importStar(require("./gen/ts/order-service/order"));
|
|
|
54
54
|
exports.AI = __importStar(require("./gen/ts/ai-service/ai"));
|
|
55
55
|
exports.Review = __importStar(require("./gen/ts/review-service/review"));
|
|
56
56
|
exports.Inventory = __importStar(require("./gen/ts/inventory-service/inventory"));
|
|
57
|
+
exports.Shipping = __importStar(require("./gen/ts/shipping-service/shipping"));
|
|
57
58
|
var bulk_1 = require("./gen/ts/products-service/bulk");
|
|
58
59
|
Object.defineProperty(exports, "BulkStatus", { enumerable: true, get: function () { return bulk_1.BulkStatus; } });
|
|
@@ -16,4 +16,5 @@ exports.PROTO_PATHS = {
|
|
|
16
16
|
AI: (0, path_1.join)(__dirname, '../../proto/ai-service/ai.proto'),
|
|
17
17
|
REVIEW: (0, path_1.join)(__dirname, '../../proto/review-service/review.proto'),
|
|
18
18
|
STOCK: (0, path_1.join)(__dirname, '../../proto/inventory-service/inventory.proto'),
|
|
19
|
+
SHIPPING: (0, path_1.join)(__dirname, '../../proto/shipping-service/shipping.proto'),
|
|
19
20
|
};
|
package/package.json
CHANGED
|
@@ -50,7 +50,7 @@ message CancelReservationResponse {
|
|
|
50
50
|
|
|
51
51
|
message RefundStockRequest {
|
|
52
52
|
string order_id = 1;
|
|
53
|
-
repeated
|
|
53
|
+
repeated string product_ids = 2;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
message RefundStockResponse {
|
|
@@ -69,6 +69,8 @@ message StockItem {
|
|
|
69
69
|
int32 quantity = 2;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
|
|
73
|
+
|
|
72
74
|
message StockAvailability {
|
|
73
75
|
string product_id = 1;
|
|
74
76
|
int32 available = 2;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package shipping.v1;
|
|
4
|
+
|
|
5
|
+
service ShippingService {
|
|
6
|
+
rpc CalculateShip (CalculateShipRequest) returns (CalculateShipResponse);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
message CalculateShipRequest {
|
|
10
|
+
string street = 1;
|
|
11
|
+
string state = 2;
|
|
12
|
+
string zip = 4;
|
|
13
|
+
string city = 5;
|
|
14
|
+
string country = 6;
|
|
15
|
+
double total_weight = 7;
|
|
16
|
+
}
|
|
17
|
+
message CalculateShipResponse {
|
|
18
|
+
repeated Rate rates = 1;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
message Rate {
|
|
22
|
+
string provider = 1;
|
|
23
|
+
string amount = 2;
|
|
24
|
+
string currency = 3;
|
|
25
|
+
int32 days = 4;
|
|
26
|
+
string service_name = 5;
|
|
27
|
+
}
|