@stashfin/grpc 1.2.196 → 1.2.198

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,4 +1,5 @@
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";
@@ -13,6 +14,7 @@ import { getSummaryStaticFieldsRequest, getSummaryStaticFieldsResponse } from ".
13
14
  import { loanSummaryRequest, loanSummaryResponse } from "./loans/loansummary";
14
15
  import { paymentAllocationRequest, paymentAllocationResponse } from "./loans/paymentallocation";
15
16
  import { paymentHistoryRequest, paymentHistoryResponse } from "./loans/paymenthistory";
17
+ import { payNowRequest, payNowResponse } from "./loans/paynow";
16
18
  import { restructureLoanRequest, restructureLoanResponse } from "./loans/restructureloan";
17
19
  import { sendEmailRequest, sendEmailResponse } from "./loans/sendemail";
18
20
  import { sendNocEmailRequest, sendNocEmailResponse } from "./loans/sendnocemail";
@@ -202,6 +204,24 @@ export declare const loansService: {
202
204
  readonly responseSerialize: (value: getNextdueAmountResponse) => Buffer;
203
205
  readonly responseDeserialize: (value: Buffer) => getNextdueAmountResponse;
204
206
  };
207
+ readonly payNow: {
208
+ readonly path: "/service.loans/payNow";
209
+ readonly requestStream: false;
210
+ readonly responseStream: false;
211
+ readonly requestSerialize: (value: payNowRequest) => Buffer;
212
+ readonly requestDeserialize: (value: Buffer) => payNowRequest;
213
+ readonly responseSerialize: (value: payNowResponse) => Buffer;
214
+ readonly responseDeserialize: (value: Buffer) => payNowResponse;
215
+ };
216
+ readonly amortization: {
217
+ readonly path: "/service.loans/amortization";
218
+ readonly requestStream: false;
219
+ readonly responseStream: false;
220
+ readonly requestSerialize: (value: amortizationRequest) => Buffer;
221
+ readonly requestDeserialize: (value: Buffer) => amortizationRequest;
222
+ readonly responseSerialize: (value: amortizationResponse) => Buffer;
223
+ readonly responseDeserialize: (value: Buffer) => amortizationResponse;
224
+ };
205
225
  };
206
226
  export interface loansServer extends UntypedServiceImplementation {
207
227
  creditlimit: handleUnaryCall<creditLimitRequest, creditLimitResponse>;
@@ -224,6 +244,8 @@ export interface loansServer extends UntypedServiceImplementation {
224
244
  getLoanbyId: handleUnaryCall<getLoanByIdRequest, getLoanByIdResponse>;
225
245
  getBillDetails: handleUnaryCall<getBillDetailsRequest, getBillDetailsResponse>;
226
246
  getNextDueAmount: handleUnaryCall<getNextdueAmountRequest, getNextdueAmountResponse>;
247
+ payNow: handleUnaryCall<payNowRequest, payNowResponse>;
248
+ amortization: handleUnaryCall<amortizationRequest, amortizationResponse>;
227
249
  }
228
250
  export interface loansClient extends Client {
229
251
  creditlimit(request: creditLimitRequest, callback: (error: ServiceError | null, response: creditLimitResponse) => void): ClientUnaryCall;
@@ -286,6 +308,12 @@ export interface loansClient extends Client {
286
308
  getNextDueAmount(request: getNextdueAmountRequest, callback: (error: ServiceError | null, response: getNextdueAmountResponse) => void): ClientUnaryCall;
287
309
  getNextDueAmount(request: getNextdueAmountRequest, metadata: Metadata, callback: (error: ServiceError | null, response: getNextdueAmountResponse) => void): ClientUnaryCall;
288
310
  getNextDueAmount(request: getNextdueAmountRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: getNextdueAmountResponse) => void): ClientUnaryCall;
311
+ payNow(request: payNowRequest, callback: (error: ServiceError | null, response: payNowResponse) => void): ClientUnaryCall;
312
+ payNow(request: payNowRequest, metadata: Metadata, callback: (error: ServiceError | null, response: payNowResponse) => void): ClientUnaryCall;
313
+ payNow(request: payNowRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: payNowResponse) => void): ClientUnaryCall;
314
+ amortization(request: amortizationRequest, callback: (error: ServiceError | null, response: amortizationResponse) => void): ClientUnaryCall;
315
+ amortization(request: amortizationRequest, metadata: Metadata, callback: (error: ServiceError | null, response: amortizationResponse) => void): ClientUnaryCall;
316
+ amortization(request: amortizationRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: amortizationResponse) => void): ClientUnaryCall;
289
317
  }
290
318
  export declare const loansClient: {
291
319
  new (address: string, credentials: ChannelCredentials, options?: Partial<ClientOptions>): loansClient;
package/ts/loans.js CHANGED
@@ -8,6 +8,7 @@ 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");
@@ -22,6 +23,7 @@ const getsummarystaticfields_1 = require("./loans/getsummarystaticfields");
22
23
  const loansummary_1 = require("./loans/loansummary");
23
24
  const paymentallocation_1 = require("./loans/paymentallocation");
24
25
  const paymenthistory_1 = require("./loans/paymenthistory");
26
+ const paynow_1 = require("./loans/paynow");
25
27
  const restructureloan_1 = require("./loans/restructureloan");
26
28
  const sendemail_1 = require("./loans/sendemail");
27
29
  const sendnocemail_1 = require("./loans/sendnocemail");
@@ -210,5 +212,23 @@ exports.loansService = {
210
212
  responseSerialize: (value) => Buffer.from(getnextdueamount_1.getNextdueAmountResponse.encode(value).finish()),
211
213
  responseDeserialize: (value) => getnextdueamount_1.getNextdueAmountResponse.decode(value),
212
214
  },
215
+ payNow: {
216
+ path: "/service.loans/payNow",
217
+ requestStream: false,
218
+ responseStream: false,
219
+ requestSerialize: (value) => Buffer.from(paynow_1.payNowRequest.encode(value).finish()),
220
+ requestDeserialize: (value) => paynow_1.payNowRequest.decode(value),
221
+ responseSerialize: (value) => Buffer.from(paynow_1.payNowResponse.encode(value).finish()),
222
+ responseDeserialize: (value) => paynow_1.payNowResponse.decode(value),
223
+ },
224
+ amortization: {
225
+ path: "/service.loans/amortization",
226
+ requestStream: false,
227
+ responseStream: false,
228
+ requestSerialize: (value) => Buffer.from(amortization_1.amortizationRequest.encode(value).finish()),
229
+ requestDeserialize: (value) => amortization_1.amortizationRequest.decode(value),
230
+ responseSerialize: (value) => Buffer.from(amortization_1.amortizationResponse.encode(value).finish()),
231
+ responseDeserialize: (value) => amortization_1.amortizationResponse.decode(value),
232
+ },
213
233
  };
214
234
  exports.loansClient = (0, grpc_js_1.makeGenericClientConstructor)(exports.loansService, "service.loans");