@platfformx/proto-contracts 1.3.13 → 1.3.15
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/payment-service/payment.d.ts +64 -0
- package/dist/gen/ts/payment-service/payment.js +34 -0
- package/dist/gen/ts/payment-service/refund.d.ts +18 -0
- package/dist/gen/ts/payment-service/refund.js +28 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -1
- package/dist/paths/proto-paths.d.ts +2 -0
- package/dist/paths/proto-paths.js +2 -0
- package/package.json +1 -1
- package/proto/payment-service/payment.proto +67 -0
- package/proto/payment-service/refund.proto +16 -0
|
@@ -0,0 +1,64 @@
|
|
|
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 ConfirmPaymentRequest {
|
|
16
|
+
providerId: string;
|
|
17
|
+
status: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ConfirmPaymentResponse {
|
|
20
|
+
success: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface CreatePaymentMethodRequest {
|
|
23
|
+
userId: string;
|
|
24
|
+
}
|
|
25
|
+
export interface CreatePaymentMethodResponse {
|
|
26
|
+
stripeId: string;
|
|
27
|
+
clientSecret: string;
|
|
28
|
+
}
|
|
29
|
+
export interface GetUserPaymentMethodsRequest {
|
|
30
|
+
userId: string;
|
|
31
|
+
}
|
|
32
|
+
export interface GetUserPaymentMethodsResponse {
|
|
33
|
+
paymentInfo: PaymentInfo[];
|
|
34
|
+
}
|
|
35
|
+
export interface PaymentInfo {
|
|
36
|
+
id: string;
|
|
37
|
+
bank: string;
|
|
38
|
+
brand: string;
|
|
39
|
+
first6: string;
|
|
40
|
+
last4: string;
|
|
41
|
+
}
|
|
42
|
+
export interface DeletePaymentMethodRequest {
|
|
43
|
+
paymentMethodId: string;
|
|
44
|
+
}
|
|
45
|
+
export interface DeletePaymentMethodResponse {
|
|
46
|
+
success: boolean;
|
|
47
|
+
}
|
|
48
|
+
export declare const PAYMENT_V1_PACKAGE_NAME = "payment.v1";
|
|
49
|
+
export interface PaymentServiceClient {
|
|
50
|
+
createPayment(request: CreatePaymentRequest): Observable<CreatePaymentResponse>;
|
|
51
|
+
confirmPayment(request: ConfirmPaymentRequest): Observable<ConfirmPaymentResponse>;
|
|
52
|
+
createPaymentMethod(request: CreatePaymentMethodRequest): Observable<CreatePaymentMethodResponse>;
|
|
53
|
+
getUserPaymentMethods(request: GetUserPaymentMethodsRequest): Observable<GetUserPaymentMethodsResponse>;
|
|
54
|
+
deletePaymentMethod(request: DeletePaymentMethodRequest): Observable<DeletePaymentMethodResponse>;
|
|
55
|
+
}
|
|
56
|
+
export interface PaymentServiceController {
|
|
57
|
+
createPayment(request: CreatePaymentRequest): Promise<CreatePaymentResponse> | Observable<CreatePaymentResponse> | CreatePaymentResponse;
|
|
58
|
+
confirmPayment(request: ConfirmPaymentRequest): Promise<ConfirmPaymentResponse> | Observable<ConfirmPaymentResponse> | ConfirmPaymentResponse;
|
|
59
|
+
createPaymentMethod(request: CreatePaymentMethodRequest): Promise<CreatePaymentMethodResponse> | Observable<CreatePaymentMethodResponse> | CreatePaymentMethodResponse;
|
|
60
|
+
getUserPaymentMethods(request: GetUserPaymentMethodsRequest): Promise<GetUserPaymentMethodsResponse> | Observable<GetUserPaymentMethodsResponse> | GetUserPaymentMethodsResponse;
|
|
61
|
+
deletePaymentMethod(request: DeletePaymentMethodRequest): Promise<DeletePaymentMethodResponse> | Observable<DeletePaymentMethodResponse> | DeletePaymentMethodResponse;
|
|
62
|
+
}
|
|
63
|
+
export declare function PaymentServiceControllerMethods(): (constructor: Function) => void;
|
|
64
|
+
export declare const PAYMENT_SERVICE_NAME = "PaymentService";
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
"confirmPayment",
|
|
19
|
+
"createPaymentMethod",
|
|
20
|
+
"getUserPaymentMethods",
|
|
21
|
+
"deletePaymentMethod",
|
|
22
|
+
];
|
|
23
|
+
for (const method of grpcMethods) {
|
|
24
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
25
|
+
(0, microservices_1.GrpcMethod)("PaymentService", method)(constructor.prototype[method], method, descriptor);
|
|
26
|
+
}
|
|
27
|
+
const grpcStreamMethods = [];
|
|
28
|
+
for (const method of grpcStreamMethods) {
|
|
29
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
30
|
+
(0, microservices_1.GrpcStreamMethod)("PaymentService", method)(constructor.prototype[method], method, descriptor);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
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; } });
|
|
@@ -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
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package payment.v1;
|
|
4
|
+
|
|
5
|
+
service PaymentService {
|
|
6
|
+
rpc CreatePayment (CreatePaymentRequest) returns (CreatePaymentResponse);
|
|
7
|
+
rpc ConfirmPayment (ConfirmPaymentRequest) returns (ConfirmPaymentResponse);
|
|
8
|
+
|
|
9
|
+
rpc CreatePaymentMethod (CreatePaymentMethodRequest) returns (CreatePaymentMethodResponse);
|
|
10
|
+
rpc GetUserPaymentMethods (GetUserPaymentMethodsRequest) returns (GetUserPaymentMethodsResponse);
|
|
11
|
+
rpc DeletePaymentMethod (DeletePaymentMethodRequest) returns (DeletePaymentMethodResponse);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
message CreatePaymentRequest {
|
|
16
|
+
string user_id = 1;
|
|
17
|
+
string currency = 2;
|
|
18
|
+
double amount = 3;
|
|
19
|
+
string order_id = 4;
|
|
20
|
+
optional string payment_method_id = 5;
|
|
21
|
+
optional bool save_payment_method = 6;
|
|
22
|
+
|
|
23
|
+
}
|
|
24
|
+
message CreatePaymentResponse {
|
|
25
|
+
string payment_id = 1;
|
|
26
|
+
string client_secret = 2;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
message ConfirmPaymentRequest {
|
|
30
|
+
string provider_id = 1;
|
|
31
|
+
string status = 2;
|
|
32
|
+
}
|
|
33
|
+
message ConfirmPaymentResponse {
|
|
34
|
+
bool success = 1;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
message CreatePaymentMethodRequest {
|
|
38
|
+
string user_id = 1;
|
|
39
|
+
}
|
|
40
|
+
message CreatePaymentMethodResponse {
|
|
41
|
+
string stripe_id = 1;
|
|
42
|
+
string client_secret = 2;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
message GetUserPaymentMethodsRequest {
|
|
46
|
+
string user_id = 1;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
message GetUserPaymentMethodsResponse {
|
|
50
|
+
repeated PaymentInfo payment_info = 1;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
message PaymentInfo {
|
|
54
|
+
string id = 1;
|
|
55
|
+
string bank = 2;
|
|
56
|
+
string brand = 3;
|
|
57
|
+
string first6 = 4;
|
|
58
|
+
string last4 = 5;
|
|
59
|
+
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
message DeletePaymentMethodRequest {
|
|
63
|
+
string payment_method_id = 1;
|
|
64
|
+
}
|
|
65
|
+
message DeletePaymentMethodResponse {
|
|
66
|
+
bool success = 1;
|
|
67
|
+
}
|
|
@@ -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
|
+
}
|