@stashfin/grpc 1.2.197 → 1.2.199

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,243 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v1.181.0
5
+ // protoc v5.28.0
6
+ // source: loans/paynow.proto
7
+ var __importDefault = (this && this.__importDefault) || function (mod) {
8
+ return (mod && mod.__esModule) ? mod : { "default": mod };
9
+ };
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.payNowResponse_Data = exports.payNowResponse = exports.payNowRequest = exports.protobufPackage = void 0;
12
+ /* eslint-disable */
13
+ const long_1 = __importDefault(require("long"));
14
+ const minimal_1 = __importDefault(require("protobufjs/minimal"));
15
+ exports.protobufPackage = "loans.paynow";
16
+ function createBasepayNowRequest() {
17
+ return { customer_id: 0, inst_id: "", mode: "" };
18
+ }
19
+ exports.payNowRequest = {
20
+ encode(message, writer = minimal_1.default.Writer.create()) {
21
+ if (message.customer_id !== 0) {
22
+ writer.uint32(8).int64(message.customer_id);
23
+ }
24
+ if (message.inst_id !== "") {
25
+ writer.uint32(18).string(message.inst_id);
26
+ }
27
+ if (message.mode !== "") {
28
+ writer.uint32(26).string(message.mode);
29
+ }
30
+ return writer;
31
+ },
32
+ decode(input, length) {
33
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
34
+ let end = length === undefined ? reader.len : reader.pos + length;
35
+ const message = createBasepayNowRequest();
36
+ while (reader.pos < end) {
37
+ const tag = reader.uint32();
38
+ switch (tag >>> 3) {
39
+ case 1:
40
+ if (tag !== 8) {
41
+ break;
42
+ }
43
+ message.customer_id = longToNumber(reader.int64());
44
+ continue;
45
+ case 2:
46
+ if (tag !== 18) {
47
+ break;
48
+ }
49
+ message.inst_id = reader.string();
50
+ continue;
51
+ case 3:
52
+ if (tag !== 26) {
53
+ break;
54
+ }
55
+ message.mode = reader.string();
56
+ continue;
57
+ }
58
+ if ((tag & 7) === 4 || tag === 0) {
59
+ break;
60
+ }
61
+ reader.skipType(tag & 7);
62
+ }
63
+ return message;
64
+ },
65
+ fromJSON(object) {
66
+ return {
67
+ customer_id: isSet(object.customer_id) ? globalThis.Number(object.customer_id) : 0,
68
+ inst_id: isSet(object.inst_id) ? globalThis.String(object.inst_id) : "",
69
+ mode: isSet(object.mode) ? globalThis.String(object.mode) : "",
70
+ };
71
+ },
72
+ toJSON(message) {
73
+ const obj = {};
74
+ if (message.customer_id !== 0) {
75
+ obj.customer_id = Math.round(message.customer_id);
76
+ }
77
+ if (message.inst_id !== "") {
78
+ obj.inst_id = message.inst_id;
79
+ }
80
+ if (message.mode !== "") {
81
+ obj.mode = message.mode;
82
+ }
83
+ return obj;
84
+ },
85
+ create(base) {
86
+ return exports.payNowRequest.fromPartial(base ?? {});
87
+ },
88
+ fromPartial(object) {
89
+ const message = createBasepayNowRequest();
90
+ message.customer_id = object.customer_id ?? 0;
91
+ message.inst_id = object.inst_id ?? "";
92
+ message.mode = object.mode ?? "";
93
+ return message;
94
+ },
95
+ };
96
+ function createBasepayNowResponse() {
97
+ return { status: "", status_code: 0, data: undefined };
98
+ }
99
+ exports.payNowResponse = {
100
+ encode(message, writer = minimal_1.default.Writer.create()) {
101
+ if (message.status !== "") {
102
+ writer.uint32(10).string(message.status);
103
+ }
104
+ if (message.status_code !== 0) {
105
+ writer.uint32(16).int32(message.status_code);
106
+ }
107
+ if (message.data !== undefined) {
108
+ exports.payNowResponse_Data.encode(message.data, writer.uint32(26).fork()).ldelim();
109
+ }
110
+ return writer;
111
+ },
112
+ decode(input, length) {
113
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
114
+ let end = length === undefined ? reader.len : reader.pos + length;
115
+ const message = createBasepayNowResponse();
116
+ while (reader.pos < end) {
117
+ const tag = reader.uint32();
118
+ switch (tag >>> 3) {
119
+ case 1:
120
+ if (tag !== 10) {
121
+ break;
122
+ }
123
+ message.status = reader.string();
124
+ continue;
125
+ case 2:
126
+ if (tag !== 16) {
127
+ break;
128
+ }
129
+ message.status_code = reader.int32();
130
+ continue;
131
+ case 3:
132
+ if (tag !== 26) {
133
+ break;
134
+ }
135
+ message.data = exports.payNowResponse_Data.decode(reader, reader.uint32());
136
+ continue;
137
+ }
138
+ if ((tag & 7) === 4 || tag === 0) {
139
+ break;
140
+ }
141
+ reader.skipType(tag & 7);
142
+ }
143
+ return message;
144
+ },
145
+ fromJSON(object) {
146
+ return {
147
+ status: isSet(object.status) ? globalThis.String(object.status) : "",
148
+ status_code: isSet(object.status_code) ? globalThis.Number(object.status_code) : 0,
149
+ data: isSet(object.data) ? exports.payNowResponse_Data.fromJSON(object.data) : undefined,
150
+ };
151
+ },
152
+ toJSON(message) {
153
+ const obj = {};
154
+ if (message.status !== "") {
155
+ obj.status = message.status;
156
+ }
157
+ if (message.status_code !== 0) {
158
+ obj.status_code = Math.round(message.status_code);
159
+ }
160
+ if (message.data !== undefined) {
161
+ obj.data = exports.payNowResponse_Data.toJSON(message.data);
162
+ }
163
+ return obj;
164
+ },
165
+ create(base) {
166
+ return exports.payNowResponse.fromPartial(base ?? {});
167
+ },
168
+ fromPartial(object) {
169
+ const message = createBasepayNowResponse();
170
+ message.status = object.status ?? "";
171
+ message.status_code = object.status_code ?? 0;
172
+ message.data = (object.data !== undefined && object.data !== null)
173
+ ? exports.payNowResponse_Data.fromPartial(object.data)
174
+ : undefined;
175
+ return message;
176
+ },
177
+ };
178
+ function createBasepayNowResponse_Data() {
179
+ return { redirect_url: "" };
180
+ }
181
+ exports.payNowResponse_Data = {
182
+ encode(message, writer = minimal_1.default.Writer.create()) {
183
+ if (message.redirect_url !== "") {
184
+ writer.uint32(10).string(message.redirect_url);
185
+ }
186
+ return writer;
187
+ },
188
+ decode(input, length) {
189
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
190
+ let end = length === undefined ? reader.len : reader.pos + length;
191
+ const message = createBasepayNowResponse_Data();
192
+ while (reader.pos < end) {
193
+ const tag = reader.uint32();
194
+ switch (tag >>> 3) {
195
+ case 1:
196
+ if (tag !== 10) {
197
+ break;
198
+ }
199
+ message.redirect_url = reader.string();
200
+ continue;
201
+ }
202
+ if ((tag & 7) === 4 || tag === 0) {
203
+ break;
204
+ }
205
+ reader.skipType(tag & 7);
206
+ }
207
+ return message;
208
+ },
209
+ fromJSON(object) {
210
+ return { redirect_url: isSet(object.redirect_url) ? globalThis.String(object.redirect_url) : "" };
211
+ },
212
+ toJSON(message) {
213
+ const obj = {};
214
+ if (message.redirect_url !== "") {
215
+ obj.redirect_url = message.redirect_url;
216
+ }
217
+ return obj;
218
+ },
219
+ create(base) {
220
+ return exports.payNowResponse_Data.fromPartial(base ?? {});
221
+ },
222
+ fromPartial(object) {
223
+ const message = createBasepayNowResponse_Data();
224
+ message.redirect_url = object.redirect_url ?? "";
225
+ return message;
226
+ },
227
+ };
228
+ function longToNumber(long) {
229
+ if (long.gt(globalThis.Number.MAX_SAFE_INTEGER)) {
230
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
231
+ }
232
+ if (long.lt(globalThis.Number.MIN_SAFE_INTEGER)) {
233
+ throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
234
+ }
235
+ return long.toNumber();
236
+ }
237
+ if (minimal_1.default.util.Long !== long_1.default) {
238
+ minimal_1.default.util.Long = long_1.default;
239
+ minimal_1.default.configure();
240
+ }
241
+ function isSet(value) {
242
+ return value !== null && value !== undefined;
243
+ }
package/ts/loans.d.ts CHANGED
@@ -1,8 +1,10 @@
1
1
  import { type CallOptions, ChannelCredentials, Client, type ClientOptions, type ClientUnaryCall, type handleUnaryCall, Metadata, type ServiceError, type UntypedServiceImplementation } from "@grpc/grpc-js";
2
+ import { amortizationRequest, amortizationResponse } from "./loans/amortization";
2
3
  import { approveLoanRequest, approveLoanResponse } from "./loans/approveloan";
3
4
  import { bankListRequest, bankListResponse } from "./loans/banklist";
4
5
  import { calculateEmiRequest, calculateEmiResponse } from "./loans/calculateemi";
5
6
  import { creditLimitRequest, creditLimitResponse } from "./loans/creditlimit";
7
+ import { fcpPaymentRequest, fcpPaymentResponse } from "./loans/fcppayment";
6
8
  import { futurePaymentMoreDetailsRequest, futurePaymentMoreDetailsResponse } from "./loans/futurepaymentmoredetails";
7
9
  import { getBillDetailsRequest, getBillDetailsResponse } from "./loans/getbilldetails";
8
10
  import { getCustomerLoanStatusRequest, getCustomerLoanStatusResponse } from "./loans/getcustomerloanstatus";
@@ -13,6 +15,7 @@ import { getSummaryStaticFieldsRequest, getSummaryStaticFieldsResponse } from ".
13
15
  import { loanSummaryRequest, loanSummaryResponse } from "./loans/loansummary";
14
16
  import { paymentAllocationRequest, paymentAllocationResponse } from "./loans/paymentallocation";
15
17
  import { paymentHistoryRequest, paymentHistoryResponse } from "./loans/paymenthistory";
18
+ import { payNowRequest, payNowResponse } from "./loans/paynow";
16
19
  import { restructureLoanRequest, restructureLoanResponse } from "./loans/restructureloan";
17
20
  import { sendEmailRequest, sendEmailResponse } from "./loans/sendemail";
18
21
  import { sendNocEmailRequest, sendNocEmailResponse } from "./loans/sendnocemail";
@@ -202,6 +205,33 @@ export declare const loansService: {
202
205
  readonly responseSerialize: (value: getNextdueAmountResponse) => Buffer;
203
206
  readonly responseDeserialize: (value: Buffer) => getNextdueAmountResponse;
204
207
  };
208
+ readonly payNow: {
209
+ readonly path: "/service.loans/payNow";
210
+ readonly requestStream: false;
211
+ readonly responseStream: false;
212
+ readonly requestSerialize: (value: payNowRequest) => Buffer;
213
+ readonly requestDeserialize: (value: Buffer) => payNowRequest;
214
+ readonly responseSerialize: (value: payNowResponse) => Buffer;
215
+ readonly responseDeserialize: (value: Buffer) => payNowResponse;
216
+ };
217
+ readonly amortization: {
218
+ readonly path: "/service.loans/amortization";
219
+ readonly requestStream: false;
220
+ readonly responseStream: false;
221
+ readonly requestSerialize: (value: amortizationRequest) => Buffer;
222
+ readonly requestDeserialize: (value: Buffer) => amortizationRequest;
223
+ readonly responseSerialize: (value: amortizationResponse) => Buffer;
224
+ readonly responseDeserialize: (value: Buffer) => amortizationResponse;
225
+ };
226
+ readonly fcpPayment: {
227
+ readonly path: "/service.loans/fcpPayment";
228
+ readonly requestStream: false;
229
+ readonly responseStream: false;
230
+ readonly requestSerialize: (value: fcpPaymentRequest) => Buffer;
231
+ readonly requestDeserialize: (value: Buffer) => fcpPaymentRequest;
232
+ readonly responseSerialize: (value: fcpPaymentResponse) => Buffer;
233
+ readonly responseDeserialize: (value: Buffer) => fcpPaymentResponse;
234
+ };
205
235
  };
206
236
  export interface loansServer extends UntypedServiceImplementation {
207
237
  creditlimit: handleUnaryCall<creditLimitRequest, creditLimitResponse>;
@@ -224,6 +254,9 @@ export interface loansServer extends UntypedServiceImplementation {
224
254
  getLoanbyId: handleUnaryCall<getLoanByIdRequest, getLoanByIdResponse>;
225
255
  getBillDetails: handleUnaryCall<getBillDetailsRequest, getBillDetailsResponse>;
226
256
  getNextDueAmount: handleUnaryCall<getNextdueAmountRequest, getNextdueAmountResponse>;
257
+ payNow: handleUnaryCall<payNowRequest, payNowResponse>;
258
+ amortization: handleUnaryCall<amortizationRequest, amortizationResponse>;
259
+ fcpPayment: handleUnaryCall<fcpPaymentRequest, fcpPaymentResponse>;
227
260
  }
228
261
  export interface loansClient extends Client {
229
262
  creditlimit(request: creditLimitRequest, callback: (error: ServiceError | null, response: creditLimitResponse) => void): ClientUnaryCall;
@@ -286,6 +319,15 @@ export interface loansClient extends Client {
286
319
  getNextDueAmount(request: getNextdueAmountRequest, callback: (error: ServiceError | null, response: getNextdueAmountResponse) => void): ClientUnaryCall;
287
320
  getNextDueAmount(request: getNextdueAmountRequest, metadata: Metadata, callback: (error: ServiceError | null, response: getNextdueAmountResponse) => void): ClientUnaryCall;
288
321
  getNextDueAmount(request: getNextdueAmountRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: getNextdueAmountResponse) => void): ClientUnaryCall;
322
+ payNow(request: payNowRequest, callback: (error: ServiceError | null, response: payNowResponse) => void): ClientUnaryCall;
323
+ payNow(request: payNowRequest, metadata: Metadata, callback: (error: ServiceError | null, response: payNowResponse) => void): ClientUnaryCall;
324
+ payNow(request: payNowRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: payNowResponse) => void): ClientUnaryCall;
325
+ amortization(request: amortizationRequest, callback: (error: ServiceError | null, response: amortizationResponse) => void): ClientUnaryCall;
326
+ amortization(request: amortizationRequest, metadata: Metadata, callback: (error: ServiceError | null, response: amortizationResponse) => void): ClientUnaryCall;
327
+ amortization(request: amortizationRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: amortizationResponse) => void): ClientUnaryCall;
328
+ fcpPayment(request: fcpPaymentRequest, callback: (error: ServiceError | null, response: fcpPaymentResponse) => void): ClientUnaryCall;
329
+ fcpPayment(request: fcpPaymentRequest, metadata: Metadata, callback: (error: ServiceError | null, response: fcpPaymentResponse) => void): ClientUnaryCall;
330
+ fcpPayment(request: fcpPaymentRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: fcpPaymentResponse) => void): ClientUnaryCall;
289
331
  }
290
332
  export declare const loansClient: {
291
333
  new (address: string, credentials: ChannelCredentials, options?: Partial<ClientOptions>): loansClient;
package/ts/loans.js CHANGED
@@ -8,10 +8,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.loansClient = exports.loansService = exports.protobufPackage = void 0;
9
9
  /* eslint-disable */
10
10
  const grpc_js_1 = require("@grpc/grpc-js");
11
+ const amortization_1 = require("./loans/amortization");
11
12
  const approveloan_1 = require("./loans/approveloan");
12
13
  const banklist_1 = require("./loans/banklist");
13
14
  const calculateemi_1 = require("./loans/calculateemi");
14
15
  const creditlimit_1 = require("./loans/creditlimit");
16
+ const fcppayment_1 = require("./loans/fcppayment");
15
17
  const futurepaymentmoredetails_1 = require("./loans/futurepaymentmoredetails");
16
18
  const getbilldetails_1 = require("./loans/getbilldetails");
17
19
  const getcustomerloanstatus_1 = require("./loans/getcustomerloanstatus");
@@ -22,6 +24,7 @@ const getsummarystaticfields_1 = require("./loans/getsummarystaticfields");
22
24
  const loansummary_1 = require("./loans/loansummary");
23
25
  const paymentallocation_1 = require("./loans/paymentallocation");
24
26
  const paymenthistory_1 = require("./loans/paymenthistory");
27
+ const paynow_1 = require("./loans/paynow");
25
28
  const restructureloan_1 = require("./loans/restructureloan");
26
29
  const sendemail_1 = require("./loans/sendemail");
27
30
  const sendnocemail_1 = require("./loans/sendnocemail");
@@ -210,5 +213,32 @@ exports.loansService = {
210
213
  responseSerialize: (value) => Buffer.from(getnextdueamount_1.getNextdueAmountResponse.encode(value).finish()),
211
214
  responseDeserialize: (value) => getnextdueamount_1.getNextdueAmountResponse.decode(value),
212
215
  },
216
+ payNow: {
217
+ path: "/service.loans/payNow",
218
+ requestStream: false,
219
+ responseStream: false,
220
+ requestSerialize: (value) => Buffer.from(paynow_1.payNowRequest.encode(value).finish()),
221
+ requestDeserialize: (value) => paynow_1.payNowRequest.decode(value),
222
+ responseSerialize: (value) => Buffer.from(paynow_1.payNowResponse.encode(value).finish()),
223
+ responseDeserialize: (value) => paynow_1.payNowResponse.decode(value),
224
+ },
225
+ amortization: {
226
+ path: "/service.loans/amortization",
227
+ requestStream: false,
228
+ responseStream: false,
229
+ requestSerialize: (value) => Buffer.from(amortization_1.amortizationRequest.encode(value).finish()),
230
+ requestDeserialize: (value) => amortization_1.amortizationRequest.decode(value),
231
+ responseSerialize: (value) => Buffer.from(amortization_1.amortizationResponse.encode(value).finish()),
232
+ responseDeserialize: (value) => amortization_1.amortizationResponse.decode(value),
233
+ },
234
+ fcpPayment: {
235
+ path: "/service.loans/fcpPayment",
236
+ requestStream: false,
237
+ responseStream: false,
238
+ requestSerialize: (value) => Buffer.from(fcppayment_1.fcpPaymentRequest.encode(value).finish()),
239
+ requestDeserialize: (value) => fcppayment_1.fcpPaymentRequest.decode(value),
240
+ responseSerialize: (value) => Buffer.from(fcppayment_1.fcpPaymentResponse.encode(value).finish()),
241
+ responseDeserialize: (value) => fcppayment_1.fcpPaymentResponse.decode(value),
242
+ },
213
243
  };
214
244
  exports.loansClient = (0, grpc_js_1.makeGenericClientConstructor)(exports.loansService, "service.loans");