@platfformx/proto-contracts 1.4.6 → 1.4.7

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.
@@ -0,0 +1,25 @@
1
+ import { Observable } from "rxjs";
2
+ export declare const protobufPackage = "order.v1";
3
+ export interface CreateOrderRequest {
4
+ userId: string;
5
+ items: OrderItem[];
6
+ }
7
+ export interface CreateOrderResponse {
8
+ orderId: string;
9
+ price: number;
10
+ status: string;
11
+ clientSecret: string;
12
+ }
13
+ export interface OrderItem {
14
+ productId: string;
15
+ quantity: number;
16
+ }
17
+ export declare const ORDER_V1_PACKAGE_NAME = "order.v1";
18
+ export interface OrderSeriveClient {
19
+ createOrder(request: CreateOrderRequest): Observable<CreateOrderResponse>;
20
+ }
21
+ export interface OrderSeriveController {
22
+ createOrder(request: CreateOrderRequest): Promise<CreateOrderResponse> | Observable<CreateOrderResponse> | CreateOrderResponse;
23
+ }
24
+ export declare function OrderSeriveControllerMethods(): (constructor: Function) => void;
25
+ export declare const ORDER_SERIVE_SERVICE_NAME = "OrderSerive";
@@ -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: order-service/order.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ORDER_SERIVE_SERVICE_NAME = exports.ORDER_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
9
+ exports.OrderSeriveControllerMethods = OrderSeriveControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ exports.protobufPackage = "order.v1";
13
+ exports.ORDER_V1_PACKAGE_NAME = "order.v1";
14
+ function OrderSeriveControllerMethods() {
15
+ return function (constructor) {
16
+ const grpcMethods = ["createOrder"];
17
+ for (const method of grpcMethods) {
18
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
19
+ (0, microservices_1.GrpcMethod)("OrderSerive", 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)("OrderSerive", method)(constructor.prototype[method], method, descriptor);
25
+ }
26
+ };
27
+ }
28
+ exports.ORDER_SERIVE_SERVICE_NAME = "OrderSerive";
package/dist/index.d.ts CHANGED
@@ -10,4 +10,5 @@ export * as Category from './gen/ts/products-service/category';
10
10
  export * as Search from './gen/ts/search-service/search';
11
11
  export * as Payment from './gen/ts/payment-service/payment';
12
12
  export * as Refund from './gen/ts/payment-service/refund';
13
+ export * as Order from './gen/ts/order-service/order';
13
14
  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.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.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");
@@ -50,5 +50,6 @@ exports.Category = __importStar(require("./gen/ts/products-service/category"));
50
50
  exports.Search = __importStar(require("./gen/ts/search-service/search"));
51
51
  exports.Payment = __importStar(require("./gen/ts/payment-service/payment"));
52
52
  exports.Refund = __importStar(require("./gen/ts/payment-service/refund"));
53
+ exports.Order = __importStar(require("./gen/ts/order-service/order"));
53
54
  var bulk_1 = require("./gen/ts/products-service/bulk");
54
55
  Object.defineProperty(exports, "BulkStatus", { enumerable: true, get: function () { return bulk_1.BulkStatus; } });
@@ -8,4 +8,5 @@ export declare const PROTO_PATHS: {
8
8
  readonly SEARCH: string;
9
9
  readonly PAYMENT: string;
10
10
  readonly REFUND: string;
11
+ readonly ORDER: string;
11
12
  };
@@ -12,4 +12,5 @@ exports.PROTO_PATHS = {
12
12
  SEARCH: (0, path_1.join)(__dirname, '../../proto/search-service/search.proto'),
13
13
  PAYMENT: (0, path_1.join)(__dirname, '../../proto/payment-service/payment.proto'),
14
14
  REFUND: (0, path_1.join)(__dirname, '../../proto/payment-service/refund.proto'),
15
+ ORDER: (0, path_1.join)(__dirname, '../../proto/order-service/order.proto'),
15
16
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platfformx/proto-contracts",
3
- "version": "1.4.6",
3
+ "version": "1.4.7",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -0,0 +1,25 @@
1
+ syntax = "proto3";
2
+
3
+ package order.v1;
4
+
5
+ service OrderSerive {
6
+ rpc CreateOrder (CreateOrderRequest) returns (CreateOrderResponse);
7
+ }
8
+
9
+ message CreateOrderRequest {
10
+ string user_id = 1;
11
+ repeated OrderItem items = 2;
12
+ }
13
+
14
+ message CreateOrderResponse {
15
+ string order_id = 1;
16
+ int32 price = 2;
17
+ string status = 3;
18
+ string client_secret = 4;
19
+ }
20
+
21
+ message OrderItem {
22
+ string product_id = 1;
23
+ int32 quantity = 2;
24
+
25
+ }