@platfformx/proto-contracts 1.3.13 → 1.3.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.
@@ -0,0 +1,55 @@
1
+ import { Observable } from "rxjs";
2
+ export declare const protobufPackage = "payment.v1";
3
+ export interface CreatePaymentRequest {
4
+ userId: string;
5
+ currency: string;
6
+ amount: number;
7
+ orderId: string;
8
+ paymentMethodId?: string | undefined;
9
+ savePaymentMethod?: boolean | undefined;
10
+ }
11
+ export interface CreatePaymentResponse {
12
+ paymentId: string;
13
+ clientSecret: string;
14
+ }
15
+ export interface CreatePaymentMethodRequest {
16
+ userId: string;
17
+ }
18
+ export interface CreatePaymentMethodResponse {
19
+ stripeId: string;
20
+ clientSecret: string;
21
+ }
22
+ export interface GetUserPaymentMethodsRequest {
23
+ userId: string;
24
+ }
25
+ export interface GetUserPaymentMethodsResponse {
26
+ paymentInfo: PaymentInfo[];
27
+ }
28
+ export interface PaymentInfo {
29
+ id: string;
30
+ bank: string;
31
+ brand: string;
32
+ first6: string;
33
+ last4: string;
34
+ }
35
+ export interface DeletePaymentMethodRequest {
36
+ paymentMethodId: string;
37
+ }
38
+ export interface DeletePaymentMethodResponse {
39
+ ok: boolean;
40
+ }
41
+ export declare const PAYMENT_V1_PACKAGE_NAME = "payment.v1";
42
+ export interface PaymentServiceClient {
43
+ createPayment(request: CreatePaymentRequest): Observable<CreatePaymentResponse>;
44
+ createPaymentMethod(request: CreatePaymentMethodRequest): Observable<CreatePaymentMethodResponse>;
45
+ getUserPaymentMethods(request: GetUserPaymentMethodsRequest): Observable<GetUserPaymentMethodsResponse>;
46
+ deletePaymentMethod(request: DeletePaymentMethodRequest): Observable<DeletePaymentMethodResponse>;
47
+ }
48
+ export interface PaymentServiceController {
49
+ createPayment(request: CreatePaymentRequest): Promise<CreatePaymentResponse> | Observable<CreatePaymentResponse> | CreatePaymentResponse;
50
+ createPaymentMethod(request: CreatePaymentMethodRequest): Promise<CreatePaymentMethodResponse> | Observable<CreatePaymentMethodResponse> | CreatePaymentMethodResponse;
51
+ getUserPaymentMethods(request: GetUserPaymentMethodsRequest): Promise<GetUserPaymentMethodsResponse> | Observable<GetUserPaymentMethodsResponse> | GetUserPaymentMethodsResponse;
52
+ deletePaymentMethod(request: DeletePaymentMethodRequest): Promise<DeletePaymentMethodResponse> | Observable<DeletePaymentMethodResponse> | DeletePaymentMethodResponse;
53
+ }
54
+ export declare function PaymentServiceControllerMethods(): (constructor: Function) => void;
55
+ export declare const PAYMENT_SERVICE_NAME = "PaymentService";
@@ -0,0 +1,33 @@
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: payment-service/payment.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.PAYMENT_SERVICE_NAME = exports.PAYMENT_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
9
+ exports.PaymentServiceControllerMethods = PaymentServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ exports.protobufPackage = "payment.v1";
13
+ exports.PAYMENT_V1_PACKAGE_NAME = "payment.v1";
14
+ function PaymentServiceControllerMethods() {
15
+ return function (constructor) {
16
+ const grpcMethods = [
17
+ "createPayment",
18
+ "createPaymentMethod",
19
+ "getUserPaymentMethods",
20
+ "deletePaymentMethod",
21
+ ];
22
+ for (const method of grpcMethods) {
23
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
24
+ (0, microservices_1.GrpcMethod)("PaymentService", method)(constructor.prototype[method], method, descriptor);
25
+ }
26
+ const grpcStreamMethods = [];
27
+ for (const method of grpcStreamMethods) {
28
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
29
+ (0, microservices_1.GrpcStreamMethod)("PaymentService", method)(constructor.prototype[method], method, descriptor);
30
+ }
31
+ };
32
+ }
33
+ exports.PAYMENT_SERVICE_NAME = "PaymentService";
@@ -0,0 +1,18 @@
1
+ import { Observable } from "rxjs";
2
+ export declare const protobufPackage = "refund.v1";
3
+ export interface CreateRefundRequest {
4
+ paymentId: string;
5
+ amount: number;
6
+ }
7
+ export interface CreateRefundResponse {
8
+ ok: boolean;
9
+ }
10
+ export declare const REFUND_V1_PACKAGE_NAME = "refund.v1";
11
+ export interface RefundServiceClient {
12
+ createRefund(request: CreateRefundRequest): Observable<CreateRefundResponse>;
13
+ }
14
+ export interface RefundServiceController {
15
+ createRefund(request: CreateRefundRequest): Promise<CreateRefundResponse> | Observable<CreateRefundResponse> | CreateRefundResponse;
16
+ }
17
+ export declare function RefundServiceControllerMethods(): (constructor: Function) => void;
18
+ export declare const REFUND_SERVICE_NAME = "RefundService";
@@ -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: payment-service/refund.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.REFUND_SERVICE_NAME = exports.REFUND_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
9
+ exports.RefundServiceControllerMethods = RefundServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ exports.protobufPackage = "refund.v1";
13
+ exports.REFUND_V1_PACKAGE_NAME = "refund.v1";
14
+ function RefundServiceControllerMethods() {
15
+ return function (constructor) {
16
+ const grpcMethods = ["createRefund"];
17
+ for (const method of grpcMethods) {
18
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
19
+ (0, microservices_1.GrpcMethod)("RefundService", 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)("RefundService", method)(constructor.prototype[method], method, descriptor);
25
+ }
26
+ };
27
+ }
28
+ exports.REFUND_SERVICE_NAME = "RefundService";
package/dist/index.d.ts CHANGED
@@ -8,4 +8,6 @@ export * as Product from './gen/ts/products-service/product';
8
8
  export * as Bulk from './gen/ts/products-service/bulk';
9
9
  export * as Category from './gen/ts/products-service/category';
10
10
  export * as Search from './gen/ts/search-service/search';
11
+ export * as Payment from './gen/ts/payment-service/payment';
12
+ export * as Refund from './gen/ts/payment-service/refund';
11
13
  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.Search = exports.Category = exports.Bulk = exports.Product = exports.Account = exports.S3 = exports.Auth = exports.OAuthProvider = void 0;
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;
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");
@@ -48,5 +48,7 @@ exports.Product = __importStar(require("./gen/ts/products-service/product"));
48
48
  exports.Bulk = __importStar(require("./gen/ts/products-service/bulk"));
49
49
  exports.Category = __importStar(require("./gen/ts/products-service/category"));
50
50
  exports.Search = __importStar(require("./gen/ts/search-service/search"));
51
+ exports.Payment = __importStar(require("./gen/ts/payment-service/payment"));
52
+ exports.Refund = __importStar(require("./gen/ts/payment-service/refund"));
51
53
  var bulk_1 = require("./gen/ts/products-service/bulk");
52
54
  Object.defineProperty(exports, "BulkStatus", { enumerable: true, get: function () { return bulk_1.BulkStatus; } });
@@ -6,4 +6,6 @@ export declare const PROTO_PATHS: {
6
6
  readonly BULK: string;
7
7
  readonly S3: string;
8
8
  readonly SEARCH: string;
9
+ readonly PAYMENT: string;
10
+ readonly REFUND: string;
9
11
  };
@@ -10,4 +10,6 @@ exports.PROTO_PATHS = {
10
10
  BULK: (0, path_1.join)(__dirname, '../../proto/products-service/bulk.proto'),
11
11
  S3: (0, path_1.join)(__dirname, '../../proto/s3-service/s3.proto'),
12
12
  SEARCH: (0, path_1.join)(__dirname, '../../proto/search-service/search.proto'),
13
+ PAYMENT: (0, path_1.join)(__dirname, '../../proto/payment-service/payment.proto'),
14
+ REFUND: (0, path_1.join)(__dirname, '../../proto/payment-service/refund.proto'),
13
15
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platfformx/proto-contracts",
3
- "version": "1.3.13",
3
+ "version": "1.3.14",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -0,0 +1,59 @@
1
+ syntax = "proto3";
2
+
3
+ package payment.v1;
4
+
5
+ service PaymentService {
6
+ rpc CreatePayment (CreatePaymentRequest) returns (CreatePaymentResponse);
7
+
8
+ rpc CreatePaymentMethod (CreatePaymentMethodRequest) returns (CreatePaymentMethodResponse);
9
+ rpc GetUserPaymentMethods (GetUserPaymentMethodsRequest) returns (GetUserPaymentMethodsResponse);
10
+ rpc DeletePaymentMethod (DeletePaymentMethodRequest) returns (DeletePaymentMethodResponse);
11
+ }
12
+
13
+
14
+ message CreatePaymentRequest {
15
+ string user_id = 1;
16
+ string currency = 2;
17
+ double amount = 3;
18
+ string order_id = 4;
19
+ optional string payment_method_id = 5;
20
+ optional bool save_payment_method = 6;
21
+
22
+ }
23
+ message CreatePaymentResponse {
24
+ string payment_id = 1;
25
+ string client_secret = 2;
26
+ }
27
+
28
+
29
+ message CreatePaymentMethodRequest {
30
+ string user_id = 1;
31
+ }
32
+ message CreatePaymentMethodResponse {
33
+ string stripe_id = 1;
34
+ string client_secret = 2;
35
+ }
36
+
37
+ message GetUserPaymentMethodsRequest {
38
+ string user_id = 1;
39
+ }
40
+
41
+ message GetUserPaymentMethodsResponse {
42
+ repeated PaymentInfo payment_info = 1;
43
+ }
44
+
45
+ message PaymentInfo {
46
+ string id = 1;
47
+ string bank = 2;
48
+ string brand = 3;
49
+ string first6 = 4;
50
+ string last4 = 5;
51
+
52
+ }
53
+
54
+ message DeletePaymentMethodRequest {
55
+ string payment_method_id = 1;
56
+ }
57
+ message DeletePaymentMethodResponse {
58
+ bool ok = 1;
59
+ }
@@ -0,0 +1,16 @@
1
+ syntax = "proto3";
2
+
3
+ package refund.v1;
4
+
5
+ service RefundService {
6
+ rpc CreateRefund (CreateRefundRequest) returns (CreateRefundResponse);
7
+ }
8
+
9
+
10
+ message CreateRefundRequest {
11
+ string payment_id = 1;
12
+ double amount = 2;
13
+ }
14
+ message CreateRefundResponse {
15
+ bool ok = 1;
16
+ }