@technova-tech/olive-proto-lib 2.5.6 → 2.5.8

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.
Files changed (44) hide show
  1. package/package.json +1 -1
  2. package/types/index.d.ts +19 -38
  3. package/accounts/accounts.js +0 -13207
  4. package/admin/admin.js +0 -6902
  5. package/audit/audit.js +0 -1024
  6. package/bills/bills.js +0 -2363
  7. package/business/business.js +0 -17668
  8. package/image/recognition.js +0 -456
  9. package/pos/transactions.js +0 -2084
  10. package/pos.v1/auth.js +0 -1179
  11. package/pos.v1/card-transactions.js +0 -2503
  12. package/pos.v1/eod.js +0 -2416
  13. package/pos.v1/merchants.js +0 -1552
  14. package/pos.v1/terminal-transactions.js +0 -4367
  15. package/pos.v1/terminal-types.js +0 -3888
  16. package/pos.v1/terminals.js +0 -33405
  17. package/pos.v1/transactions.js +0 -2918
  18. package/shared/response.js +0 -233
  19. package/storage/storage.js +0 -476
  20. package/terminal/terminal.js +0 -12583
  21. package/transfer/transfer.js +0 -3649
  22. package/types/accounts/accounts.d.ts +0 -4419
  23. package/types/admin/admin.d.ts +0 -2348
  24. package/types/audit/audit.d.ts +0 -333
  25. package/types/bills/bills.d.ts +0 -731
  26. package/types/business/business.d.ts +0 -8011
  27. package/types/image/recognition.d.ts +0 -147
  28. package/types/pos/transactions.d.ts +0 -667
  29. package/types/pos.v1/auth.d.ts +0 -374
  30. package/types/pos.v1/card-transactions.d.ts +0 -816
  31. package/types/pos.v1/eod.d.ts +0 -819
  32. package/types/pos.v1/merchants.d.ts +0 -566
  33. package/types/pos.v1/terminal-transactions.d.ts +0 -1543
  34. package/types/pos.v1/terminal-types.d.ts +0 -1215
  35. package/types/pos.v1/terminals.d.ts +0 -11376
  36. package/types/pos.v1/transactions.d.ts +0 -1057
  37. package/types/shared/response.d.ts +0 -65
  38. package/types/storage/storage.d.ts +0 -153
  39. package/types/terminal/terminal.d.ts +0 -5482
  40. package/types/transfer/transfer.d.ts +0 -1160
  41. package/types/users/users.d.ts +0 -4526
  42. package/types/verifications/verifications.d.ts +0 -3056
  43. package/users/users.js +0 -13303
  44. package/verifications/verifications.js +0 -8524
@@ -1,1552 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.com = void 0;
27
- const pb_1 = __importStar(require("google-protobuf"));
28
- const grpc_1 = __importStar(require("@grpc/grpc-js"));
29
- var com;
30
- (function (com) {
31
- var pkg;
32
- (function (pkg) {
33
- var posv1;
34
- (function (posv1) {
35
- var merchants;
36
- (function (merchants) {
37
- class CreateMerchantRequest extends pb_1.Message {
38
- #one_of_decls = [];
39
- constructor(data) {
40
- super();
41
- pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
42
- if (!Array.isArray(data) && typeof data == "object") {
43
- if ("merchantId" in data && data.merchantId != undefined) {
44
- this.merchantId = data.merchantId;
45
- }
46
- if ("businessName" in data && data.businessName != undefined) {
47
- this.businessName = data.businessName;
48
- }
49
- if ("contactName" in data && data.contactName != undefined) {
50
- this.contactName = data.contactName;
51
- }
52
- if ("email" in data && data.email != undefined) {
53
- this.email = data.email;
54
- }
55
- if ("phone" in data && data.phone != undefined) {
56
- this.phone = data.phone;
57
- }
58
- if ("address" in data && data.address != undefined) {
59
- this.address = data.address;
60
- }
61
- if ("settlementInfo" in data && data.settlementInfo != undefined) {
62
- this.settlementInfo = data.settlementInfo;
63
- }
64
- }
65
- }
66
- get merchantId() {
67
- return pb_1.Message.getFieldWithDefault(this, 1, "");
68
- }
69
- set merchantId(value) {
70
- pb_1.Message.setField(this, 1, value);
71
- }
72
- get businessName() {
73
- return pb_1.Message.getFieldWithDefault(this, 2, "");
74
- }
75
- set businessName(value) {
76
- pb_1.Message.setField(this, 2, value);
77
- }
78
- get contactName() {
79
- return pb_1.Message.getFieldWithDefault(this, 3, "");
80
- }
81
- set contactName(value) {
82
- pb_1.Message.setField(this, 3, value);
83
- }
84
- get email() {
85
- return pb_1.Message.getFieldWithDefault(this, 4, "");
86
- }
87
- set email(value) {
88
- pb_1.Message.setField(this, 4, value);
89
- }
90
- get phone() {
91
- return pb_1.Message.getFieldWithDefault(this, 5, "");
92
- }
93
- set phone(value) {
94
- pb_1.Message.setField(this, 5, value);
95
- }
96
- get address() {
97
- return pb_1.Message.getWrapperField(this, Address, 6);
98
- }
99
- set address(value) {
100
- pb_1.Message.setWrapperField(this, 6, value);
101
- }
102
- get hasAddress() {
103
- return pb_1.Message.getField(this, 6) != null;
104
- }
105
- get settlementInfo() {
106
- return pb_1.Message.getWrapperField(this, SettlementInfo, 7);
107
- }
108
- set settlementInfo(value) {
109
- pb_1.Message.setWrapperField(this, 7, value);
110
- }
111
- get hasSettlementInfo() {
112
- return pb_1.Message.getField(this, 7) != null;
113
- }
114
- static fromObject(data) {
115
- const message = new CreateMerchantRequest({});
116
- if (data.merchantId != null) {
117
- message.merchantId = data.merchantId;
118
- }
119
- if (data.businessName != null) {
120
- message.businessName = data.businessName;
121
- }
122
- if (data.contactName != null) {
123
- message.contactName = data.contactName;
124
- }
125
- if (data.email != null) {
126
- message.email = data.email;
127
- }
128
- if (data.phone != null) {
129
- message.phone = data.phone;
130
- }
131
- if (data.address != null) {
132
- message.address = Address.fromObject(data.address);
133
- }
134
- if (data.settlementInfo != null) {
135
- message.settlementInfo = SettlementInfo.fromObject(data.settlementInfo);
136
- }
137
- return message;
138
- }
139
- toObject() {
140
- const data = {};
141
- if (this.merchantId != null) {
142
- data.merchantId = this.merchantId;
143
- }
144
- if (this.businessName != null) {
145
- data.businessName = this.businessName;
146
- }
147
- if (this.contactName != null) {
148
- data.contactName = this.contactName;
149
- }
150
- if (this.email != null) {
151
- data.email = this.email;
152
- }
153
- if (this.phone != null) {
154
- data.phone = this.phone;
155
- }
156
- if (this.address != null) {
157
- data.address = this.address.toObject();
158
- }
159
- if (this.settlementInfo != null) {
160
- data.settlementInfo = this.settlementInfo.toObject();
161
- }
162
- return data;
163
- }
164
- serialize(w) {
165
- const writer = w || new pb_1.BinaryWriter();
166
- if (this.merchantId.length)
167
- writer.writeString(1, this.merchantId);
168
- if (this.businessName.length)
169
- writer.writeString(2, this.businessName);
170
- if (this.contactName.length)
171
- writer.writeString(3, this.contactName);
172
- if (this.email.length)
173
- writer.writeString(4, this.email);
174
- if (this.phone.length)
175
- writer.writeString(5, this.phone);
176
- if (this.hasAddress)
177
- writer.writeMessage(6, this.address, () => this.address.serialize(writer));
178
- if (this.hasSettlementInfo)
179
- writer.writeMessage(7, this.settlementInfo, () => this.settlementInfo.serialize(writer));
180
- if (!w)
181
- return writer.getResultBuffer();
182
- }
183
- static deserialize(bytes) {
184
- const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new CreateMerchantRequest();
185
- while (reader.nextField()) {
186
- if (reader.isEndGroup())
187
- break;
188
- switch (reader.getFieldNumber()) {
189
- case 1:
190
- message.merchantId = reader.readString();
191
- break;
192
- case 2:
193
- message.businessName = reader.readString();
194
- break;
195
- case 3:
196
- message.contactName = reader.readString();
197
- break;
198
- case 4:
199
- message.email = reader.readString();
200
- break;
201
- case 5:
202
- message.phone = reader.readString();
203
- break;
204
- case 6:
205
- reader.readMessage(message.address, () => message.address = Address.deserialize(reader));
206
- break;
207
- case 7:
208
- reader.readMessage(message.settlementInfo, () => message.settlementInfo = SettlementInfo.deserialize(reader));
209
- break;
210
- default: reader.skipField();
211
- }
212
- }
213
- return message;
214
- }
215
- serializeBinary() {
216
- return this.serialize();
217
- }
218
- static deserializeBinary(bytes) {
219
- return CreateMerchantRequest.deserialize(bytes);
220
- }
221
- }
222
- merchants.CreateMerchantRequest = CreateMerchantRequest;
223
- class UpdateMerchantRequest extends pb_1.Message {
224
- #one_of_decls = [[2], [3], [4], [5], [6], [7]];
225
- constructor(data) {
226
- super();
227
- pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
228
- if (!Array.isArray(data) && typeof data == "object") {
229
- if ("merchantId" in data && data.merchantId != undefined) {
230
- this.merchantId = data.merchantId;
231
- }
232
- if ("businessName" in data && data.businessName != undefined) {
233
- this.businessName = data.businessName;
234
- }
235
- if ("contactName" in data && data.contactName != undefined) {
236
- this.contactName = data.contactName;
237
- }
238
- if ("email" in data && data.email != undefined) {
239
- this.email = data.email;
240
- }
241
- if ("phone" in data && data.phone != undefined) {
242
- this.phone = data.phone;
243
- }
244
- if ("address" in data && data.address != undefined) {
245
- this.address = data.address;
246
- }
247
- if ("settlementInfo" in data && data.settlementInfo != undefined) {
248
- this.settlementInfo = data.settlementInfo;
249
- }
250
- }
251
- }
252
- get merchantId() {
253
- return pb_1.Message.getFieldWithDefault(this, 1, "");
254
- }
255
- set merchantId(value) {
256
- pb_1.Message.setField(this, 1, value);
257
- }
258
- get businessName() {
259
- return pb_1.Message.getFieldWithDefault(this, 2, "");
260
- }
261
- set businessName(value) {
262
- pb_1.Message.setOneofField(this, 2, this.#one_of_decls[0], value);
263
- }
264
- get hasBusinessName() {
265
- return pb_1.Message.getField(this, 2) != null;
266
- }
267
- get contactName() {
268
- return pb_1.Message.getFieldWithDefault(this, 3, "");
269
- }
270
- set contactName(value) {
271
- pb_1.Message.setOneofField(this, 3, this.#one_of_decls[1], value);
272
- }
273
- get hasContactName() {
274
- return pb_1.Message.getField(this, 3) != null;
275
- }
276
- get email() {
277
- return pb_1.Message.getFieldWithDefault(this, 4, "");
278
- }
279
- set email(value) {
280
- pb_1.Message.setOneofField(this, 4, this.#one_of_decls[2], value);
281
- }
282
- get hasEmail() {
283
- return pb_1.Message.getField(this, 4) != null;
284
- }
285
- get phone() {
286
- return pb_1.Message.getFieldWithDefault(this, 5, "");
287
- }
288
- set phone(value) {
289
- pb_1.Message.setOneofField(this, 5, this.#one_of_decls[3], value);
290
- }
291
- get hasPhone() {
292
- return pb_1.Message.getField(this, 5) != null;
293
- }
294
- get address() {
295
- return pb_1.Message.getWrapperField(this, Address, 6);
296
- }
297
- set address(value) {
298
- pb_1.Message.setOneofWrapperField(this, 6, this.#one_of_decls[4], value);
299
- }
300
- get hasAddress() {
301
- return pb_1.Message.getField(this, 6) != null;
302
- }
303
- get settlementInfo() {
304
- return pb_1.Message.getWrapperField(this, SettlementInfo, 7);
305
- }
306
- set settlementInfo(value) {
307
- pb_1.Message.setOneofWrapperField(this, 7, this.#one_of_decls[5], value);
308
- }
309
- get hasSettlementInfo() {
310
- return pb_1.Message.getField(this, 7) != null;
311
- }
312
- get _business_name() {
313
- const cases = {
314
- 0: "none",
315
- 2: "businessName"
316
- };
317
- return cases[pb_1.Message.computeOneofCase(this, [2])];
318
- }
319
- get _contact_name() {
320
- const cases = {
321
- 0: "none",
322
- 3: "contactName"
323
- };
324
- return cases[pb_1.Message.computeOneofCase(this, [3])];
325
- }
326
- get _email() {
327
- const cases = {
328
- 0: "none",
329
- 4: "email"
330
- };
331
- return cases[pb_1.Message.computeOneofCase(this, [4])];
332
- }
333
- get _phone() {
334
- const cases = {
335
- 0: "none",
336
- 5: "phone"
337
- };
338
- return cases[pb_1.Message.computeOneofCase(this, [5])];
339
- }
340
- get _address() {
341
- const cases = {
342
- 0: "none",
343
- 6: "address"
344
- };
345
- return cases[pb_1.Message.computeOneofCase(this, [6])];
346
- }
347
- get _settlement_info() {
348
- const cases = {
349
- 0: "none",
350
- 7: "settlementInfo"
351
- };
352
- return cases[pb_1.Message.computeOneofCase(this, [7])];
353
- }
354
- static fromObject(data) {
355
- const message = new UpdateMerchantRequest({});
356
- if (data.merchantId != null) {
357
- message.merchantId = data.merchantId;
358
- }
359
- if (data.businessName != null) {
360
- message.businessName = data.businessName;
361
- }
362
- if (data.contactName != null) {
363
- message.contactName = data.contactName;
364
- }
365
- if (data.email != null) {
366
- message.email = data.email;
367
- }
368
- if (data.phone != null) {
369
- message.phone = data.phone;
370
- }
371
- if (data.address != null) {
372
- message.address = Address.fromObject(data.address);
373
- }
374
- if (data.settlementInfo != null) {
375
- message.settlementInfo = SettlementInfo.fromObject(data.settlementInfo);
376
- }
377
- return message;
378
- }
379
- toObject() {
380
- const data = {};
381
- if (this.merchantId != null) {
382
- data.merchantId = this.merchantId;
383
- }
384
- if (this.businessName != null) {
385
- data.businessName = this.businessName;
386
- }
387
- if (this.contactName != null) {
388
- data.contactName = this.contactName;
389
- }
390
- if (this.email != null) {
391
- data.email = this.email;
392
- }
393
- if (this.phone != null) {
394
- data.phone = this.phone;
395
- }
396
- if (this.address != null) {
397
- data.address = this.address.toObject();
398
- }
399
- if (this.settlementInfo != null) {
400
- data.settlementInfo = this.settlementInfo.toObject();
401
- }
402
- return data;
403
- }
404
- serialize(w) {
405
- const writer = w || new pb_1.BinaryWriter();
406
- if (this.merchantId.length)
407
- writer.writeString(1, this.merchantId);
408
- if (this.hasBusinessName)
409
- writer.writeString(2, this.businessName);
410
- if (this.hasContactName)
411
- writer.writeString(3, this.contactName);
412
- if (this.hasEmail)
413
- writer.writeString(4, this.email);
414
- if (this.hasPhone)
415
- writer.writeString(5, this.phone);
416
- if (this.hasAddress)
417
- writer.writeMessage(6, this.address, () => this.address.serialize(writer));
418
- if (this.hasSettlementInfo)
419
- writer.writeMessage(7, this.settlementInfo, () => this.settlementInfo.serialize(writer));
420
- if (!w)
421
- return writer.getResultBuffer();
422
- }
423
- static deserialize(bytes) {
424
- const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new UpdateMerchantRequest();
425
- while (reader.nextField()) {
426
- if (reader.isEndGroup())
427
- break;
428
- switch (reader.getFieldNumber()) {
429
- case 1:
430
- message.merchantId = reader.readString();
431
- break;
432
- case 2:
433
- message.businessName = reader.readString();
434
- break;
435
- case 3:
436
- message.contactName = reader.readString();
437
- break;
438
- case 4:
439
- message.email = reader.readString();
440
- break;
441
- case 5:
442
- message.phone = reader.readString();
443
- break;
444
- case 6:
445
- reader.readMessage(message.address, () => message.address = Address.deserialize(reader));
446
- break;
447
- case 7:
448
- reader.readMessage(message.settlementInfo, () => message.settlementInfo = SettlementInfo.deserialize(reader));
449
- break;
450
- default: reader.skipField();
451
- }
452
- }
453
- return message;
454
- }
455
- serializeBinary() {
456
- return this.serialize();
457
- }
458
- static deserializeBinary(bytes) {
459
- return UpdateMerchantRequest.deserialize(bytes);
460
- }
461
- }
462
- merchants.UpdateMerchantRequest = UpdateMerchantRequest;
463
- class GetMerchantRequest extends pb_1.Message {
464
- #one_of_decls = [];
465
- constructor(data) {
466
- super();
467
- pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
468
- if (!Array.isArray(data) && typeof data == "object") {
469
- if ("merchantId" in data && data.merchantId != undefined) {
470
- this.merchantId = data.merchantId;
471
- }
472
- }
473
- }
474
- get merchantId() {
475
- return pb_1.Message.getFieldWithDefault(this, 1, "");
476
- }
477
- set merchantId(value) {
478
- pb_1.Message.setField(this, 1, value);
479
- }
480
- static fromObject(data) {
481
- const message = new GetMerchantRequest({});
482
- if (data.merchantId != null) {
483
- message.merchantId = data.merchantId;
484
- }
485
- return message;
486
- }
487
- toObject() {
488
- const data = {};
489
- if (this.merchantId != null) {
490
- data.merchantId = this.merchantId;
491
- }
492
- return data;
493
- }
494
- serialize(w) {
495
- const writer = w || new pb_1.BinaryWriter();
496
- if (this.merchantId.length)
497
- writer.writeString(1, this.merchantId);
498
- if (!w)
499
- return writer.getResultBuffer();
500
- }
501
- static deserialize(bytes) {
502
- const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetMerchantRequest();
503
- while (reader.nextField()) {
504
- if (reader.isEndGroup())
505
- break;
506
- switch (reader.getFieldNumber()) {
507
- case 1:
508
- message.merchantId = reader.readString();
509
- break;
510
- default: reader.skipField();
511
- }
512
- }
513
- return message;
514
- }
515
- serializeBinary() {
516
- return this.serialize();
517
- }
518
- static deserializeBinary(bytes) {
519
- return GetMerchantRequest.deserialize(bytes);
520
- }
521
- }
522
- merchants.GetMerchantRequest = GetMerchantRequest;
523
- class GetMerchantByTerminalIdRequest extends pb_1.Message {
524
- #one_of_decls = [];
525
- constructor(data) {
526
- super();
527
- pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
528
- if (!Array.isArray(data) && typeof data == "object") {
529
- if ("terminalId" in data && data.terminalId != undefined) {
530
- this.terminalId = data.terminalId;
531
- }
532
- }
533
- }
534
- get terminalId() {
535
- return pb_1.Message.getFieldWithDefault(this, 1, "");
536
- }
537
- set terminalId(value) {
538
- pb_1.Message.setField(this, 1, value);
539
- }
540
- static fromObject(data) {
541
- const message = new GetMerchantByTerminalIdRequest({});
542
- if (data.terminalId != null) {
543
- message.terminalId = data.terminalId;
544
- }
545
- return message;
546
- }
547
- toObject() {
548
- const data = {};
549
- if (this.terminalId != null) {
550
- data.terminalId = this.terminalId;
551
- }
552
- return data;
553
- }
554
- serialize(w) {
555
- const writer = w || new pb_1.BinaryWriter();
556
- if (this.terminalId.length)
557
- writer.writeString(1, this.terminalId);
558
- if (!w)
559
- return writer.getResultBuffer();
560
- }
561
- static deserialize(bytes) {
562
- const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetMerchantByTerminalIdRequest();
563
- while (reader.nextField()) {
564
- if (reader.isEndGroup())
565
- break;
566
- switch (reader.getFieldNumber()) {
567
- case 1:
568
- message.terminalId = reader.readString();
569
- break;
570
- default: reader.skipField();
571
- }
572
- }
573
- return message;
574
- }
575
- serializeBinary() {
576
- return this.serialize();
577
- }
578
- static deserializeBinary(bytes) {
579
- return GetMerchantByTerminalIdRequest.deserialize(bytes);
580
- }
581
- }
582
- merchants.GetMerchantByTerminalIdRequest = GetMerchantByTerminalIdRequest;
583
- class CreateMerchantResponse extends pb_1.Message {
584
- #one_of_decls = [];
585
- constructor(data) {
586
- super();
587
- pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
588
- if (!Array.isArray(data) && typeof data == "object") {
589
- if ("success" in data && data.success != undefined) {
590
- this.success = data.success;
591
- }
592
- if ("message" in data && data.message != undefined) {
593
- this.message = data.message;
594
- }
595
- if ("data" in data && data.data != undefined) {
596
- this.data = data.data;
597
- }
598
- }
599
- }
600
- get success() {
601
- return pb_1.Message.getFieldWithDefault(this, 1, false);
602
- }
603
- set success(value) {
604
- pb_1.Message.setField(this, 1, value);
605
- }
606
- get message() {
607
- return pb_1.Message.getFieldWithDefault(this, 2, "");
608
- }
609
- set message(value) {
610
- pb_1.Message.setField(this, 2, value);
611
- }
612
- get data() {
613
- return pb_1.Message.getWrapperField(this, MerchantData, 3);
614
- }
615
- set data(value) {
616
- pb_1.Message.setWrapperField(this, 3, value);
617
- }
618
- get hasData() {
619
- return pb_1.Message.getField(this, 3) != null;
620
- }
621
- static fromObject(data) {
622
- const message = new CreateMerchantResponse({});
623
- if (data.success != null) {
624
- message.success = data.success;
625
- }
626
- if (data.message != null) {
627
- message.message = data.message;
628
- }
629
- if (data.data != null) {
630
- message.data = MerchantData.fromObject(data.data);
631
- }
632
- return message;
633
- }
634
- toObject() {
635
- const data = {};
636
- if (this.success != null) {
637
- data.success = this.success;
638
- }
639
- if (this.message != null) {
640
- data.message = this.message;
641
- }
642
- if (this.data != null) {
643
- data.data = this.data.toObject();
644
- }
645
- return data;
646
- }
647
- serialize(w) {
648
- const writer = w || new pb_1.BinaryWriter();
649
- if (this.success != false)
650
- writer.writeBool(1, this.success);
651
- if (this.message.length)
652
- writer.writeString(2, this.message);
653
- if (this.hasData)
654
- writer.writeMessage(3, this.data, () => this.data.serialize(writer));
655
- if (!w)
656
- return writer.getResultBuffer();
657
- }
658
- static deserialize(bytes) {
659
- const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new CreateMerchantResponse();
660
- while (reader.nextField()) {
661
- if (reader.isEndGroup())
662
- break;
663
- switch (reader.getFieldNumber()) {
664
- case 1:
665
- message.success = reader.readBool();
666
- break;
667
- case 2:
668
- message.message = reader.readString();
669
- break;
670
- case 3:
671
- reader.readMessage(message.data, () => message.data = MerchantData.deserialize(reader));
672
- break;
673
- default: reader.skipField();
674
- }
675
- }
676
- return message;
677
- }
678
- serializeBinary() {
679
- return this.serialize();
680
- }
681
- static deserializeBinary(bytes) {
682
- return CreateMerchantResponse.deserialize(bytes);
683
- }
684
- }
685
- merchants.CreateMerchantResponse = CreateMerchantResponse;
686
- class UpdateMerchantResponse extends pb_1.Message {
687
- #one_of_decls = [];
688
- constructor(data) {
689
- super();
690
- pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
691
- if (!Array.isArray(data) && typeof data == "object") {
692
- if ("success" in data && data.success != undefined) {
693
- this.success = data.success;
694
- }
695
- if ("message" in data && data.message != undefined) {
696
- this.message = data.message;
697
- }
698
- if ("data" in data && data.data != undefined) {
699
- this.data = data.data;
700
- }
701
- }
702
- }
703
- get success() {
704
- return pb_1.Message.getFieldWithDefault(this, 1, false);
705
- }
706
- set success(value) {
707
- pb_1.Message.setField(this, 1, value);
708
- }
709
- get message() {
710
- return pb_1.Message.getFieldWithDefault(this, 2, "");
711
- }
712
- set message(value) {
713
- pb_1.Message.setField(this, 2, value);
714
- }
715
- get data() {
716
- return pb_1.Message.getWrapperField(this, MerchantData, 3);
717
- }
718
- set data(value) {
719
- pb_1.Message.setWrapperField(this, 3, value);
720
- }
721
- get hasData() {
722
- return pb_1.Message.getField(this, 3) != null;
723
- }
724
- static fromObject(data) {
725
- const message = new UpdateMerchantResponse({});
726
- if (data.success != null) {
727
- message.success = data.success;
728
- }
729
- if (data.message != null) {
730
- message.message = data.message;
731
- }
732
- if (data.data != null) {
733
- message.data = MerchantData.fromObject(data.data);
734
- }
735
- return message;
736
- }
737
- toObject() {
738
- const data = {};
739
- if (this.success != null) {
740
- data.success = this.success;
741
- }
742
- if (this.message != null) {
743
- data.message = this.message;
744
- }
745
- if (this.data != null) {
746
- data.data = this.data.toObject();
747
- }
748
- return data;
749
- }
750
- serialize(w) {
751
- const writer = w || new pb_1.BinaryWriter();
752
- if (this.success != false)
753
- writer.writeBool(1, this.success);
754
- if (this.message.length)
755
- writer.writeString(2, this.message);
756
- if (this.hasData)
757
- writer.writeMessage(3, this.data, () => this.data.serialize(writer));
758
- if (!w)
759
- return writer.getResultBuffer();
760
- }
761
- static deserialize(bytes) {
762
- const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new UpdateMerchantResponse();
763
- while (reader.nextField()) {
764
- if (reader.isEndGroup())
765
- break;
766
- switch (reader.getFieldNumber()) {
767
- case 1:
768
- message.success = reader.readBool();
769
- break;
770
- case 2:
771
- message.message = reader.readString();
772
- break;
773
- case 3:
774
- reader.readMessage(message.data, () => message.data = MerchantData.deserialize(reader));
775
- break;
776
- default: reader.skipField();
777
- }
778
- }
779
- return message;
780
- }
781
- serializeBinary() {
782
- return this.serialize();
783
- }
784
- static deserializeBinary(bytes) {
785
- return UpdateMerchantResponse.deserialize(bytes);
786
- }
787
- }
788
- merchants.UpdateMerchantResponse = UpdateMerchantResponse;
789
- class GetMerchantResponse extends pb_1.Message {
790
- #one_of_decls = [];
791
- constructor(data) {
792
- super();
793
- pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
794
- if (!Array.isArray(data) && typeof data == "object") {
795
- if ("success" in data && data.success != undefined) {
796
- this.success = data.success;
797
- }
798
- if ("message" in data && data.message != undefined) {
799
- this.message = data.message;
800
- }
801
- if ("data" in data && data.data != undefined) {
802
- this.data = data.data;
803
- }
804
- }
805
- }
806
- get success() {
807
- return pb_1.Message.getFieldWithDefault(this, 1, false);
808
- }
809
- set success(value) {
810
- pb_1.Message.setField(this, 1, value);
811
- }
812
- get message() {
813
- return pb_1.Message.getFieldWithDefault(this, 2, "");
814
- }
815
- set message(value) {
816
- pb_1.Message.setField(this, 2, value);
817
- }
818
- get data() {
819
- return pb_1.Message.getWrapperField(this, MerchantData, 3);
820
- }
821
- set data(value) {
822
- pb_1.Message.setWrapperField(this, 3, value);
823
- }
824
- get hasData() {
825
- return pb_1.Message.getField(this, 3) != null;
826
- }
827
- static fromObject(data) {
828
- const message = new GetMerchantResponse({});
829
- if (data.success != null) {
830
- message.success = data.success;
831
- }
832
- if (data.message != null) {
833
- message.message = data.message;
834
- }
835
- if (data.data != null) {
836
- message.data = MerchantData.fromObject(data.data);
837
- }
838
- return message;
839
- }
840
- toObject() {
841
- const data = {};
842
- if (this.success != null) {
843
- data.success = this.success;
844
- }
845
- if (this.message != null) {
846
- data.message = this.message;
847
- }
848
- if (this.data != null) {
849
- data.data = this.data.toObject();
850
- }
851
- return data;
852
- }
853
- serialize(w) {
854
- const writer = w || new pb_1.BinaryWriter();
855
- if (this.success != false)
856
- writer.writeBool(1, this.success);
857
- if (this.message.length)
858
- writer.writeString(2, this.message);
859
- if (this.hasData)
860
- writer.writeMessage(3, this.data, () => this.data.serialize(writer));
861
- if (!w)
862
- return writer.getResultBuffer();
863
- }
864
- static deserialize(bytes) {
865
- const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetMerchantResponse();
866
- while (reader.nextField()) {
867
- if (reader.isEndGroup())
868
- break;
869
- switch (reader.getFieldNumber()) {
870
- case 1:
871
- message.success = reader.readBool();
872
- break;
873
- case 2:
874
- message.message = reader.readString();
875
- break;
876
- case 3:
877
- reader.readMessage(message.data, () => message.data = MerchantData.deserialize(reader));
878
- break;
879
- default: reader.skipField();
880
- }
881
- }
882
- return message;
883
- }
884
- serializeBinary() {
885
- return this.serialize();
886
- }
887
- static deserializeBinary(bytes) {
888
- return GetMerchantResponse.deserialize(bytes);
889
- }
890
- }
891
- merchants.GetMerchantResponse = GetMerchantResponse;
892
- class MerchantData extends pb_1.Message {
893
- #one_of_decls = [];
894
- constructor(data) {
895
- super();
896
- pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
897
- if (!Array.isArray(data) && typeof data == "object") {
898
- if ("id" in data && data.id != undefined) {
899
- this.id = data.id;
900
- }
901
- if ("merchantId" in data && data.merchantId != undefined) {
902
- this.merchantId = data.merchantId;
903
- }
904
- if ("businessName" in data && data.businessName != undefined) {
905
- this.businessName = data.businessName;
906
- }
907
- if ("contactName" in data && data.contactName != undefined) {
908
- this.contactName = data.contactName;
909
- }
910
- if ("email" in data && data.email != undefined) {
911
- this.email = data.email;
912
- }
913
- if ("phone" in data && data.phone != undefined) {
914
- this.phone = data.phone;
915
- }
916
- if ("address" in data && data.address != undefined) {
917
- this.address = data.address;
918
- }
919
- if ("settlementInfo" in data && data.settlementInfo != undefined) {
920
- this.settlementInfo = data.settlementInfo;
921
- }
922
- if ("isActive" in data && data.isActive != undefined) {
923
- this.isActive = data.isActive;
924
- }
925
- if ("createdAt" in data && data.createdAt != undefined) {
926
- this.createdAt = data.createdAt;
927
- }
928
- if ("updatedAt" in data && data.updatedAt != undefined) {
929
- this.updatedAt = data.updatedAt;
930
- }
931
- }
932
- }
933
- get id() {
934
- return pb_1.Message.getFieldWithDefault(this, 1, "");
935
- }
936
- set id(value) {
937
- pb_1.Message.setField(this, 1, value);
938
- }
939
- get merchantId() {
940
- return pb_1.Message.getFieldWithDefault(this, 2, "");
941
- }
942
- set merchantId(value) {
943
- pb_1.Message.setField(this, 2, value);
944
- }
945
- get businessName() {
946
- return pb_1.Message.getFieldWithDefault(this, 3, "");
947
- }
948
- set businessName(value) {
949
- pb_1.Message.setField(this, 3, value);
950
- }
951
- get contactName() {
952
- return pb_1.Message.getFieldWithDefault(this, 4, "");
953
- }
954
- set contactName(value) {
955
- pb_1.Message.setField(this, 4, value);
956
- }
957
- get email() {
958
- return pb_1.Message.getFieldWithDefault(this, 5, "");
959
- }
960
- set email(value) {
961
- pb_1.Message.setField(this, 5, value);
962
- }
963
- get phone() {
964
- return pb_1.Message.getFieldWithDefault(this, 6, "");
965
- }
966
- set phone(value) {
967
- pb_1.Message.setField(this, 6, value);
968
- }
969
- get address() {
970
- return pb_1.Message.getWrapperField(this, Address, 7);
971
- }
972
- set address(value) {
973
- pb_1.Message.setWrapperField(this, 7, value);
974
- }
975
- get hasAddress() {
976
- return pb_1.Message.getField(this, 7) != null;
977
- }
978
- get settlementInfo() {
979
- return pb_1.Message.getWrapperField(this, SettlementInfo, 8);
980
- }
981
- set settlementInfo(value) {
982
- pb_1.Message.setWrapperField(this, 8, value);
983
- }
984
- get hasSettlementInfo() {
985
- return pb_1.Message.getField(this, 8) != null;
986
- }
987
- get isActive() {
988
- return pb_1.Message.getFieldWithDefault(this, 9, false);
989
- }
990
- set isActive(value) {
991
- pb_1.Message.setField(this, 9, value);
992
- }
993
- get createdAt() {
994
- return pb_1.Message.getFieldWithDefault(this, 10, 0);
995
- }
996
- set createdAt(value) {
997
- pb_1.Message.setField(this, 10, value);
998
- }
999
- get updatedAt() {
1000
- return pb_1.Message.getFieldWithDefault(this, 11, 0);
1001
- }
1002
- set updatedAt(value) {
1003
- pb_1.Message.setField(this, 11, value);
1004
- }
1005
- static fromObject(data) {
1006
- const message = new MerchantData({});
1007
- if (data.id != null) {
1008
- message.id = data.id;
1009
- }
1010
- if (data.merchantId != null) {
1011
- message.merchantId = data.merchantId;
1012
- }
1013
- if (data.businessName != null) {
1014
- message.businessName = data.businessName;
1015
- }
1016
- if (data.contactName != null) {
1017
- message.contactName = data.contactName;
1018
- }
1019
- if (data.email != null) {
1020
- message.email = data.email;
1021
- }
1022
- if (data.phone != null) {
1023
- message.phone = data.phone;
1024
- }
1025
- if (data.address != null) {
1026
- message.address = Address.fromObject(data.address);
1027
- }
1028
- if (data.settlementInfo != null) {
1029
- message.settlementInfo = SettlementInfo.fromObject(data.settlementInfo);
1030
- }
1031
- if (data.isActive != null) {
1032
- message.isActive = data.isActive;
1033
- }
1034
- if (data.createdAt != null) {
1035
- message.createdAt = data.createdAt;
1036
- }
1037
- if (data.updatedAt != null) {
1038
- message.updatedAt = data.updatedAt;
1039
- }
1040
- return message;
1041
- }
1042
- toObject() {
1043
- const data = {};
1044
- if (this.id != null) {
1045
- data.id = this.id;
1046
- }
1047
- if (this.merchantId != null) {
1048
- data.merchantId = this.merchantId;
1049
- }
1050
- if (this.businessName != null) {
1051
- data.businessName = this.businessName;
1052
- }
1053
- if (this.contactName != null) {
1054
- data.contactName = this.contactName;
1055
- }
1056
- if (this.email != null) {
1057
- data.email = this.email;
1058
- }
1059
- if (this.phone != null) {
1060
- data.phone = this.phone;
1061
- }
1062
- if (this.address != null) {
1063
- data.address = this.address.toObject();
1064
- }
1065
- if (this.settlementInfo != null) {
1066
- data.settlementInfo = this.settlementInfo.toObject();
1067
- }
1068
- if (this.isActive != null) {
1069
- data.isActive = this.isActive;
1070
- }
1071
- if (this.createdAt != null) {
1072
- data.createdAt = this.createdAt;
1073
- }
1074
- if (this.updatedAt != null) {
1075
- data.updatedAt = this.updatedAt;
1076
- }
1077
- return data;
1078
- }
1079
- serialize(w) {
1080
- const writer = w || new pb_1.BinaryWriter();
1081
- if (this.id.length)
1082
- writer.writeString(1, this.id);
1083
- if (this.merchantId.length)
1084
- writer.writeString(2, this.merchantId);
1085
- if (this.businessName.length)
1086
- writer.writeString(3, this.businessName);
1087
- if (this.contactName.length)
1088
- writer.writeString(4, this.contactName);
1089
- if (this.email.length)
1090
- writer.writeString(5, this.email);
1091
- if (this.phone.length)
1092
- writer.writeString(6, this.phone);
1093
- if (this.hasAddress)
1094
- writer.writeMessage(7, this.address, () => this.address.serialize(writer));
1095
- if (this.hasSettlementInfo)
1096
- writer.writeMessage(8, this.settlementInfo, () => this.settlementInfo.serialize(writer));
1097
- if (this.isActive != false)
1098
- writer.writeBool(9, this.isActive);
1099
- if (this.createdAt != 0)
1100
- writer.writeInt64(10, this.createdAt);
1101
- if (this.updatedAt != 0)
1102
- writer.writeInt64(11, this.updatedAt);
1103
- if (!w)
1104
- return writer.getResultBuffer();
1105
- }
1106
- static deserialize(bytes) {
1107
- const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MerchantData();
1108
- while (reader.nextField()) {
1109
- if (reader.isEndGroup())
1110
- break;
1111
- switch (reader.getFieldNumber()) {
1112
- case 1:
1113
- message.id = reader.readString();
1114
- break;
1115
- case 2:
1116
- message.merchantId = reader.readString();
1117
- break;
1118
- case 3:
1119
- message.businessName = reader.readString();
1120
- break;
1121
- case 4:
1122
- message.contactName = reader.readString();
1123
- break;
1124
- case 5:
1125
- message.email = reader.readString();
1126
- break;
1127
- case 6:
1128
- message.phone = reader.readString();
1129
- break;
1130
- case 7:
1131
- reader.readMessage(message.address, () => message.address = Address.deserialize(reader));
1132
- break;
1133
- case 8:
1134
- reader.readMessage(message.settlementInfo, () => message.settlementInfo = SettlementInfo.deserialize(reader));
1135
- break;
1136
- case 9:
1137
- message.isActive = reader.readBool();
1138
- break;
1139
- case 10:
1140
- message.createdAt = reader.readInt64();
1141
- break;
1142
- case 11:
1143
- message.updatedAt = reader.readInt64();
1144
- break;
1145
- default: reader.skipField();
1146
- }
1147
- }
1148
- return message;
1149
- }
1150
- serializeBinary() {
1151
- return this.serialize();
1152
- }
1153
- static deserializeBinary(bytes) {
1154
- return MerchantData.deserialize(bytes);
1155
- }
1156
- }
1157
- merchants.MerchantData = MerchantData;
1158
- class Address extends pb_1.Message {
1159
- #one_of_decls = [];
1160
- constructor(data) {
1161
- super();
1162
- pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
1163
- if (!Array.isArray(data) && typeof data == "object") {
1164
- if ("street" in data && data.street != undefined) {
1165
- this.street = data.street;
1166
- }
1167
- if ("city" in data && data.city != undefined) {
1168
- this.city = data.city;
1169
- }
1170
- if ("state" in data && data.state != undefined) {
1171
- this.state = data.state;
1172
- }
1173
- if ("postalCode" in data && data.postalCode != undefined) {
1174
- this.postalCode = data.postalCode;
1175
- }
1176
- if ("country" in data && data.country != undefined) {
1177
- this.country = data.country;
1178
- }
1179
- }
1180
- }
1181
- get street() {
1182
- return pb_1.Message.getFieldWithDefault(this, 1, "");
1183
- }
1184
- set street(value) {
1185
- pb_1.Message.setField(this, 1, value);
1186
- }
1187
- get city() {
1188
- return pb_1.Message.getFieldWithDefault(this, 2, "");
1189
- }
1190
- set city(value) {
1191
- pb_1.Message.setField(this, 2, value);
1192
- }
1193
- get state() {
1194
- return pb_1.Message.getFieldWithDefault(this, 3, "");
1195
- }
1196
- set state(value) {
1197
- pb_1.Message.setField(this, 3, value);
1198
- }
1199
- get postalCode() {
1200
- return pb_1.Message.getFieldWithDefault(this, 4, "");
1201
- }
1202
- set postalCode(value) {
1203
- pb_1.Message.setField(this, 4, value);
1204
- }
1205
- get country() {
1206
- return pb_1.Message.getFieldWithDefault(this, 5, "");
1207
- }
1208
- set country(value) {
1209
- pb_1.Message.setField(this, 5, value);
1210
- }
1211
- static fromObject(data) {
1212
- const message = new Address({});
1213
- if (data.street != null) {
1214
- message.street = data.street;
1215
- }
1216
- if (data.city != null) {
1217
- message.city = data.city;
1218
- }
1219
- if (data.state != null) {
1220
- message.state = data.state;
1221
- }
1222
- if (data.postalCode != null) {
1223
- message.postalCode = data.postalCode;
1224
- }
1225
- if (data.country != null) {
1226
- message.country = data.country;
1227
- }
1228
- return message;
1229
- }
1230
- toObject() {
1231
- const data = {};
1232
- if (this.street != null) {
1233
- data.street = this.street;
1234
- }
1235
- if (this.city != null) {
1236
- data.city = this.city;
1237
- }
1238
- if (this.state != null) {
1239
- data.state = this.state;
1240
- }
1241
- if (this.postalCode != null) {
1242
- data.postalCode = this.postalCode;
1243
- }
1244
- if (this.country != null) {
1245
- data.country = this.country;
1246
- }
1247
- return data;
1248
- }
1249
- serialize(w) {
1250
- const writer = w || new pb_1.BinaryWriter();
1251
- if (this.street.length)
1252
- writer.writeString(1, this.street);
1253
- if (this.city.length)
1254
- writer.writeString(2, this.city);
1255
- if (this.state.length)
1256
- writer.writeString(3, this.state);
1257
- if (this.postalCode.length)
1258
- writer.writeString(4, this.postalCode);
1259
- if (this.country.length)
1260
- writer.writeString(5, this.country);
1261
- if (!w)
1262
- return writer.getResultBuffer();
1263
- }
1264
- static deserialize(bytes) {
1265
- const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Address();
1266
- while (reader.nextField()) {
1267
- if (reader.isEndGroup())
1268
- break;
1269
- switch (reader.getFieldNumber()) {
1270
- case 1:
1271
- message.street = reader.readString();
1272
- break;
1273
- case 2:
1274
- message.city = reader.readString();
1275
- break;
1276
- case 3:
1277
- message.state = reader.readString();
1278
- break;
1279
- case 4:
1280
- message.postalCode = reader.readString();
1281
- break;
1282
- case 5:
1283
- message.country = reader.readString();
1284
- break;
1285
- default: reader.skipField();
1286
- }
1287
- }
1288
- return message;
1289
- }
1290
- serializeBinary() {
1291
- return this.serialize();
1292
- }
1293
- static deserializeBinary(bytes) {
1294
- return Address.deserialize(bytes);
1295
- }
1296
- }
1297
- merchants.Address = Address;
1298
- class SettlementInfo extends pb_1.Message {
1299
- #one_of_decls = [];
1300
- constructor(data) {
1301
- super();
1302
- pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
1303
- if (!Array.isArray(data) && typeof data == "object") {
1304
- if ("bankName" in data && data.bankName != undefined) {
1305
- this.bankName = data.bankName;
1306
- }
1307
- if ("accountNumber" in data && data.accountNumber != undefined) {
1308
- this.accountNumber = data.accountNumber;
1309
- }
1310
- if ("accountName" in data && data.accountName != undefined) {
1311
- this.accountName = data.accountName;
1312
- }
1313
- if ("bankCode" in data && data.bankCode != undefined) {
1314
- this.bankCode = data.bankCode;
1315
- }
1316
- if ("settlementType" in data && data.settlementType != undefined) {
1317
- this.settlementType = data.settlementType;
1318
- }
1319
- }
1320
- }
1321
- get bankName() {
1322
- return pb_1.Message.getFieldWithDefault(this, 1, "");
1323
- }
1324
- set bankName(value) {
1325
- pb_1.Message.setField(this, 1, value);
1326
- }
1327
- get accountNumber() {
1328
- return pb_1.Message.getFieldWithDefault(this, 2, "");
1329
- }
1330
- set accountNumber(value) {
1331
- pb_1.Message.setField(this, 2, value);
1332
- }
1333
- get accountName() {
1334
- return pb_1.Message.getFieldWithDefault(this, 3, "");
1335
- }
1336
- set accountName(value) {
1337
- pb_1.Message.setField(this, 3, value);
1338
- }
1339
- get bankCode() {
1340
- return pb_1.Message.getFieldWithDefault(this, 4, "");
1341
- }
1342
- set bankCode(value) {
1343
- pb_1.Message.setField(this, 4, value);
1344
- }
1345
- get settlementType() {
1346
- return pb_1.Message.getFieldWithDefault(this, 5, "");
1347
- }
1348
- set settlementType(value) {
1349
- pb_1.Message.setField(this, 5, value);
1350
- }
1351
- static fromObject(data) {
1352
- const message = new SettlementInfo({});
1353
- if (data.bankName != null) {
1354
- message.bankName = data.bankName;
1355
- }
1356
- if (data.accountNumber != null) {
1357
- message.accountNumber = data.accountNumber;
1358
- }
1359
- if (data.accountName != null) {
1360
- message.accountName = data.accountName;
1361
- }
1362
- if (data.bankCode != null) {
1363
- message.bankCode = data.bankCode;
1364
- }
1365
- if (data.settlementType != null) {
1366
- message.settlementType = data.settlementType;
1367
- }
1368
- return message;
1369
- }
1370
- toObject() {
1371
- const data = {};
1372
- if (this.bankName != null) {
1373
- data.bankName = this.bankName;
1374
- }
1375
- if (this.accountNumber != null) {
1376
- data.accountNumber = this.accountNumber;
1377
- }
1378
- if (this.accountName != null) {
1379
- data.accountName = this.accountName;
1380
- }
1381
- if (this.bankCode != null) {
1382
- data.bankCode = this.bankCode;
1383
- }
1384
- if (this.settlementType != null) {
1385
- data.settlementType = this.settlementType;
1386
- }
1387
- return data;
1388
- }
1389
- serialize(w) {
1390
- const writer = w || new pb_1.BinaryWriter();
1391
- if (this.bankName.length)
1392
- writer.writeString(1, this.bankName);
1393
- if (this.accountNumber.length)
1394
- writer.writeString(2, this.accountNumber);
1395
- if (this.accountName.length)
1396
- writer.writeString(3, this.accountName);
1397
- if (this.bankCode.length)
1398
- writer.writeString(4, this.bankCode);
1399
- if (this.settlementType.length)
1400
- writer.writeString(5, this.settlementType);
1401
- if (!w)
1402
- return writer.getResultBuffer();
1403
- }
1404
- static deserialize(bytes) {
1405
- const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new SettlementInfo();
1406
- while (reader.nextField()) {
1407
- if (reader.isEndGroup())
1408
- break;
1409
- switch (reader.getFieldNumber()) {
1410
- case 1:
1411
- message.bankName = reader.readString();
1412
- break;
1413
- case 2:
1414
- message.accountNumber = reader.readString();
1415
- break;
1416
- case 3:
1417
- message.accountName = reader.readString();
1418
- break;
1419
- case 4:
1420
- message.bankCode = reader.readString();
1421
- break;
1422
- case 5:
1423
- message.settlementType = reader.readString();
1424
- break;
1425
- default: reader.skipField();
1426
- }
1427
- }
1428
- return message;
1429
- }
1430
- serializeBinary() {
1431
- return this.serialize();
1432
- }
1433
- static deserializeBinary(bytes) {
1434
- return SettlementInfo.deserialize(bytes);
1435
- }
1436
- }
1437
- merchants.SettlementInfo = SettlementInfo;
1438
- class UnimplementedMerchantServiceService {
1439
- static definition = {
1440
- CreateMerchant: {
1441
- path: "/com.pkg.posv1.merchants.MerchantService/CreateMerchant",
1442
- requestStream: false,
1443
- responseStream: false,
1444
- requestSerialize: (message) => Buffer.from(message.serialize()),
1445
- requestDeserialize: (bytes) => CreateMerchantRequest.deserialize(new Uint8Array(bytes)),
1446
- responseSerialize: (message) => Buffer.from(message.serialize()),
1447
- responseDeserialize: (bytes) => CreateMerchantResponse.deserialize(new Uint8Array(bytes))
1448
- },
1449
- UpdateMerchant: {
1450
- path: "/com.pkg.posv1.merchants.MerchantService/UpdateMerchant",
1451
- requestStream: false,
1452
- responseStream: false,
1453
- requestSerialize: (message) => Buffer.from(message.serialize()),
1454
- requestDeserialize: (bytes) => UpdateMerchantRequest.deserialize(new Uint8Array(bytes)),
1455
- responseSerialize: (message) => Buffer.from(message.serialize()),
1456
- responseDeserialize: (bytes) => UpdateMerchantResponse.deserialize(new Uint8Array(bytes))
1457
- },
1458
- GetMerchant: {
1459
- path: "/com.pkg.posv1.merchants.MerchantService/GetMerchant",
1460
- requestStream: false,
1461
- responseStream: false,
1462
- requestSerialize: (message) => Buffer.from(message.serialize()),
1463
- requestDeserialize: (bytes) => GetMerchantRequest.deserialize(new Uint8Array(bytes)),
1464
- responseSerialize: (message) => Buffer.from(message.serialize()),
1465
- responseDeserialize: (bytes) => GetMerchantResponse.deserialize(new Uint8Array(bytes))
1466
- },
1467
- GetMerchantByTerminalId: {
1468
- path: "/com.pkg.posv1.merchants.MerchantService/GetMerchantByTerminalId",
1469
- requestStream: false,
1470
- responseStream: false,
1471
- requestSerialize: (message) => Buffer.from(message.serialize()),
1472
- requestDeserialize: (bytes) => GetMerchantByTerminalIdRequest.deserialize(new Uint8Array(bytes)),
1473
- responseSerialize: (message) => Buffer.from(message.serialize()),
1474
- responseDeserialize: (bytes) => GetMerchantResponse.deserialize(new Uint8Array(bytes))
1475
- }
1476
- };
1477
- }
1478
- merchants.UnimplementedMerchantServiceService = UnimplementedMerchantServiceService;
1479
- class MerchantServiceClient extends grpc_1.makeGenericClientConstructor(UnimplementedMerchantServiceService.definition, "MerchantService", {}) {
1480
- constructor(address, credentials, options) {
1481
- super(address, credentials, options);
1482
- }
1483
- CreateMerchant = (message, metadata, options) => {
1484
- if (!metadata) {
1485
- metadata = new grpc_1.Metadata;
1486
- }
1487
- if (!options) {
1488
- options = {};
1489
- }
1490
- return new Promise((resolve, reject) => super.CreateMerchant(message, metadata, options, (error, response) => {
1491
- if (error) {
1492
- reject(error);
1493
- }
1494
- else {
1495
- resolve(response);
1496
- }
1497
- }));
1498
- };
1499
- UpdateMerchant = (message, metadata, options) => {
1500
- if (!metadata) {
1501
- metadata = new grpc_1.Metadata;
1502
- }
1503
- if (!options) {
1504
- options = {};
1505
- }
1506
- return new Promise((resolve, reject) => super.UpdateMerchant(message, metadata, options, (error, response) => {
1507
- if (error) {
1508
- reject(error);
1509
- }
1510
- else {
1511
- resolve(response);
1512
- }
1513
- }));
1514
- };
1515
- GetMerchant = (message, metadata, options) => {
1516
- if (!metadata) {
1517
- metadata = new grpc_1.Metadata;
1518
- }
1519
- if (!options) {
1520
- options = {};
1521
- }
1522
- return new Promise((resolve, reject) => super.GetMerchant(message, metadata, options, (error, response) => {
1523
- if (error) {
1524
- reject(error);
1525
- }
1526
- else {
1527
- resolve(response);
1528
- }
1529
- }));
1530
- };
1531
- GetMerchantByTerminalId = (message, metadata, options) => {
1532
- if (!metadata) {
1533
- metadata = new grpc_1.Metadata;
1534
- }
1535
- if (!options) {
1536
- options = {};
1537
- }
1538
- return new Promise((resolve, reject) => super.GetMerchantByTerminalId(message, metadata, options, (error, response) => {
1539
- if (error) {
1540
- reject(error);
1541
- }
1542
- else {
1543
- resolve(response);
1544
- }
1545
- }));
1546
- };
1547
- }
1548
- merchants.MerchantServiceClient = MerchantServiceClient;
1549
- })(merchants = posv1.merchants || (posv1.merchants = {}));
1550
- })(posv1 = pkg.posv1 || (pkg.posv1 = {}));
1551
- })(pkg = com.pkg || (com.pkg = {}));
1552
- })(com || (exports.com = com = {}));