@alexochihua/protos 1.0.0

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 (94) hide show
  1. package/README.md +26 -0
  2. package/buf.gen.yaml +14 -0
  3. package/buf.yaml +9 -0
  4. package/dist/generated/kapital/accounts/v1/accounts.d.ts +145 -0
  5. package/dist/generated/kapital/accounts/v1/accounts.js +787 -0
  6. package/dist/generated/kapital/accounts/v1/accounts.js.map +1 -0
  7. package/dist/generated/kapital/accounts/v1/accounts_types.d.ts +39 -0
  8. package/dist/generated/kapital/accounts/v1/accounts_types.js +314 -0
  9. package/dist/generated/kapital/accounts/v1/accounts_types.js.map +1 -0
  10. package/dist/generated/kapital/accumulates/v1/accumulates_service.d.ts +145 -0
  11. package/dist/generated/kapital/accumulates/v1/accumulates_service.js +771 -0
  12. package/dist/generated/kapital/accumulates/v1/accumulates_service.js.map +1 -0
  13. package/dist/generated/kapital/accumulates/v1/accumulates_types.d.ts +37 -0
  14. package/dist/generated/kapital/accumulates/v1/accumulates_types.js +290 -0
  15. package/dist/generated/kapital/accumulates/v1/accumulates_types.js.map +1 -0
  16. package/dist/generated/kapital/cards/v1/cards.d.ts +507 -0
  17. package/dist/generated/kapital/cards/v1/cards.js +2996 -0
  18. package/dist/generated/kapital/cards/v1/cards.js.map +1 -0
  19. package/dist/generated/kapital/cards/v1/cards_types.d.ts +125 -0
  20. package/dist/generated/kapital/cards/v1/cards_types.js +1268 -0
  21. package/dist/generated/kapital/cards/v1/cards_types.js.map +1 -0
  22. package/dist/generated/kapital/common/v1/error.d.ts +24 -0
  23. package/dist/generated/kapital/common/v1/error.js +119 -0
  24. package/dist/generated/kapital/common/v1/error.js.map +1 -0
  25. package/dist/generated/kapital/common/v1/meta.d.ts +20 -0
  26. package/dist/generated/kapital/common/v1/meta.js +86 -0
  27. package/dist/generated/kapital/common/v1/meta.js.map +1 -0
  28. package/dist/generated/kapital/common/v1/pagination.d.ts +26 -0
  29. package/dist/generated/kapital/common/v1/pagination.js +149 -0
  30. package/dist/generated/kapital/common/v1/pagination.js.map +1 -0
  31. package/dist/generated/kapital/contracts/v1/contracts.d.ts +829 -0
  32. package/dist/generated/kapital/contracts/v1/contracts.js +5840 -0
  33. package/dist/generated/kapital/contracts/v1/contracts.js.map +1 -0
  34. package/dist/generated/kapital/contracts/v1/contracts_types.d.ts +293 -0
  35. package/dist/generated/kapital/contracts/v1/contracts_types.js +3101 -0
  36. package/dist/generated/kapital/contracts/v1/contracts_types.js.map +1 -0
  37. package/dist/generated/kapital/credit_accounts/v1/credit_accounts.d.ts +57 -0
  38. package/dist/generated/kapital/credit_accounts/v1/credit_accounts.js +193 -0
  39. package/dist/generated/kapital/credit_accounts/v1/credit_accounts.js.map +1 -0
  40. package/dist/generated/kapital/credit_accounts/v1/credit_accounts_types.d.ts +37 -0
  41. package/dist/generated/kapital/credit_accounts/v1/credit_accounts_types.js +283 -0
  42. package/dist/generated/kapital/credit_accounts/v1/credit_accounts_types.js.map +1 -0
  43. package/dist/generated/kapital/customers/v1/customers.d.ts +493 -0
  44. package/dist/generated/kapital/customers/v1/customers.js +2542 -0
  45. package/dist/generated/kapital/customers/v1/customers.js.map +1 -0
  46. package/dist/generated/kapital/customers/v1/customers_types.d.ts +95 -0
  47. package/dist/generated/kapital/customers/v1/customers_types.js +951 -0
  48. package/dist/generated/kapital/customers/v1/customers_types.js.map +1 -0
  49. package/dist/generated/kapital/payments/v1/payments.d.ts +145 -0
  50. package/dist/generated/kapital/payments/v1/payments.js +915 -0
  51. package/dist/generated/kapital/payments/v1/payments.js.map +1 -0
  52. package/dist/generated/kapital/payments/v1/payments_types.d.ts +26 -0
  53. package/dist/generated/kapital/payments/v1/payments_types.js +163 -0
  54. package/dist/generated/kapital/payments/v1/payments_types.js.map +1 -0
  55. package/dist/generated/kapital/products/v1/products.d.ts +234 -0
  56. package/dist/generated/kapital/products/v1/products.js +1369 -0
  57. package/dist/generated/kapital/products/v1/products.js.map +1 -0
  58. package/dist/generated/kapital/products/v1/products_types.d.ts +159 -0
  59. package/dist/generated/kapital/products/v1/products_types.js +1696 -0
  60. package/dist/generated/kapital/products/v1/products_types.js.map +1 -0
  61. package/dist/generated/kapital/transactions/v1/transactions.d.ts +122 -0
  62. package/dist/generated/kapital/transactions/v1/transactions.js +632 -0
  63. package/dist/generated/kapital/transactions/v1/transactions.js.map +1 -0
  64. package/dist/generated/kapital/transactions/v1/transactions_types.d.ts +99 -0
  65. package/dist/generated/kapital/transactions/v1/transactions_types.js +1023 -0
  66. package/dist/generated/kapital/transactions/v1/transactions_types.js.map +1 -0
  67. package/dist/index.d.ts +22 -0
  68. package/dist/index.js +59 -0
  69. package/dist/index.js.map +1 -0
  70. package/dist/runtime/grpc.d.ts +2 -0
  71. package/dist/runtime/grpc.js +9 -0
  72. package/dist/runtime/grpc.js.map +1 -0
  73. package/package.json +195 -0
  74. package/proto/kapital/accounts/v1/accounts.proto +80 -0
  75. package/proto/kapital/accounts/v1/accounts_types.proto +31 -0
  76. package/proto/kapital/accumulates/v1/accumulates_service.proto +81 -0
  77. package/proto/kapital/accumulates/v1/accumulates_types.proto +30 -0
  78. package/proto/kapital/cards/v1/cards.proto +298 -0
  79. package/proto/kapital/cards/v1/cards_types.proto +117 -0
  80. package/proto/kapital/common/v1/error.proto +18 -0
  81. package/proto/kapital/common/v1/meta.proto +13 -0
  82. package/proto/kapital/common/v1/pagination.proto +18 -0
  83. package/proto/kapital/contracts/v1/contracts.proto +629 -0
  84. package/proto/kapital/contracts/v1/contracts_types.proto +316 -0
  85. package/proto/kapital/credit_accounts/v1/credit_accounts.proto +28 -0
  86. package/proto/kapital/credit_accounts/v1/credit_accounts_types.proto +29 -0
  87. package/proto/kapital/customers/v1/customers.proto +235 -0
  88. package/proto/kapital/customers/v1/customers_types.proto +87 -0
  89. package/proto/kapital/payments/v1/payments.proto +94 -0
  90. package/proto/kapital/payments/v1/payments_types.proto +18 -0
  91. package/proto/kapital/products/v1/products.proto +139 -0
  92. package/proto/kapital/products/v1/products_types.proto +156 -0
  93. package/proto/kapital/transactions/v1/transactions.proto +70 -0
  94. package/proto/kapital/transactions/v1/transactions_types.proto +91 -0
@@ -0,0 +1,1369 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.11.6
5
+ // protoc unknown
6
+ // source: kapital/products/v1/products.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ProductsServiceClient = exports.ProductsServiceService = exports.SaveStatementConfigResponse = exports.SaveStatementConfigRequest = exports.GetStatementConfigResponse = exports.GetStatementConfigRequest = exports.ValidateBinSubBinResponse = exports.ValidateBinSubBinRequest = exports.UpdateProductResponse = exports.UpdateProductRequest = exports.CreateProductResponse = exports.CreateProductRequest = exports.GetProductByIdResponse = exports.GetProductByIdRequest = exports.GetProductsResponse = exports.GetProductsRequest = exports.protobufPackage = void 0;
9
+ /* eslint-disable */
10
+ const wire_1 = require("@bufbuild/protobuf/wire");
11
+ const grpc_js_1 = require("@grpc/grpc-js");
12
+ const meta_1 = require("../../common/v1/meta");
13
+ const pagination_1 = require("../../common/v1/pagination");
14
+ const products_types_1 = require("./products_types");
15
+ exports.protobufPackage = "kapital.products.v1";
16
+ function createBaseGetProductsRequest() {
17
+ return { page_request: undefined, q: "", status: "", name: "", product_type: "", brand: "", bin: "", sub_bin: "" };
18
+ }
19
+ exports.GetProductsRequest = {
20
+ encode(message, writer = new wire_1.BinaryWriter()) {
21
+ if (message.page_request !== undefined) {
22
+ pagination_1.PageRequest.encode(message.page_request, writer.uint32(10).fork()).join();
23
+ }
24
+ if (message.q !== "") {
25
+ writer.uint32(18).string(message.q);
26
+ }
27
+ if (message.status !== "") {
28
+ writer.uint32(26).string(message.status);
29
+ }
30
+ if (message.name !== "") {
31
+ writer.uint32(34).string(message.name);
32
+ }
33
+ if (message.product_type !== "") {
34
+ writer.uint32(42).string(message.product_type);
35
+ }
36
+ if (message.brand !== "") {
37
+ writer.uint32(50).string(message.brand);
38
+ }
39
+ if (message.bin !== "") {
40
+ writer.uint32(58).string(message.bin);
41
+ }
42
+ if (message.sub_bin !== "") {
43
+ writer.uint32(66).string(message.sub_bin);
44
+ }
45
+ return writer;
46
+ },
47
+ decode(input, length) {
48
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
49
+ const end = length === undefined ? reader.len : reader.pos + length;
50
+ const message = createBaseGetProductsRequest();
51
+ while (reader.pos < end) {
52
+ const tag = reader.uint32();
53
+ switch (tag >>> 3) {
54
+ case 1: {
55
+ if (tag !== 10) {
56
+ break;
57
+ }
58
+ message.page_request = pagination_1.PageRequest.decode(reader, reader.uint32());
59
+ continue;
60
+ }
61
+ case 2: {
62
+ if (tag !== 18) {
63
+ break;
64
+ }
65
+ message.q = reader.string();
66
+ continue;
67
+ }
68
+ case 3: {
69
+ if (tag !== 26) {
70
+ break;
71
+ }
72
+ message.status = reader.string();
73
+ continue;
74
+ }
75
+ case 4: {
76
+ if (tag !== 34) {
77
+ break;
78
+ }
79
+ message.name = reader.string();
80
+ continue;
81
+ }
82
+ case 5: {
83
+ if (tag !== 42) {
84
+ break;
85
+ }
86
+ message.product_type = reader.string();
87
+ continue;
88
+ }
89
+ case 6: {
90
+ if (tag !== 50) {
91
+ break;
92
+ }
93
+ message.brand = reader.string();
94
+ continue;
95
+ }
96
+ case 7: {
97
+ if (tag !== 58) {
98
+ break;
99
+ }
100
+ message.bin = reader.string();
101
+ continue;
102
+ }
103
+ case 8: {
104
+ if (tag !== 66) {
105
+ break;
106
+ }
107
+ message.sub_bin = reader.string();
108
+ continue;
109
+ }
110
+ }
111
+ if ((tag & 7) === 4 || tag === 0) {
112
+ break;
113
+ }
114
+ reader.skip(tag & 7);
115
+ }
116
+ return message;
117
+ },
118
+ create(base) {
119
+ return exports.GetProductsRequest.fromPartial(base ?? {});
120
+ },
121
+ fromPartial(object) {
122
+ const message = createBaseGetProductsRequest();
123
+ message.page_request = (object.page_request !== undefined && object.page_request !== null)
124
+ ? pagination_1.PageRequest.fromPartial(object.page_request)
125
+ : undefined;
126
+ message.q = object.q ?? "";
127
+ message.status = object.status ?? "";
128
+ message.name = object.name ?? "";
129
+ message.product_type = object.product_type ?? "";
130
+ message.brand = object.brand ?? "";
131
+ message.bin = object.bin ?? "";
132
+ message.sub_bin = object.sub_bin ?? "";
133
+ return message;
134
+ },
135
+ };
136
+ function createBaseGetProductsResponse() {
137
+ return { meta: undefined, page_response: undefined, products: [] };
138
+ }
139
+ exports.GetProductsResponse = {
140
+ encode(message, writer = new wire_1.BinaryWriter()) {
141
+ if (message.meta !== undefined) {
142
+ meta_1.ResponseMeta.encode(message.meta, writer.uint32(10).fork()).join();
143
+ }
144
+ if (message.page_response !== undefined) {
145
+ pagination_1.PageResponse.encode(message.page_response, writer.uint32(18).fork()).join();
146
+ }
147
+ for (const v of message.products) {
148
+ products_types_1.Product.encode(v, writer.uint32(26).fork()).join();
149
+ }
150
+ return writer;
151
+ },
152
+ decode(input, length) {
153
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
154
+ const end = length === undefined ? reader.len : reader.pos + length;
155
+ const message = createBaseGetProductsResponse();
156
+ while (reader.pos < end) {
157
+ const tag = reader.uint32();
158
+ switch (tag >>> 3) {
159
+ case 1: {
160
+ if (tag !== 10) {
161
+ break;
162
+ }
163
+ message.meta = meta_1.ResponseMeta.decode(reader, reader.uint32());
164
+ continue;
165
+ }
166
+ case 2: {
167
+ if (tag !== 18) {
168
+ break;
169
+ }
170
+ message.page_response = pagination_1.PageResponse.decode(reader, reader.uint32());
171
+ continue;
172
+ }
173
+ case 3: {
174
+ if (tag !== 26) {
175
+ break;
176
+ }
177
+ message.products.push(products_types_1.Product.decode(reader, reader.uint32()));
178
+ continue;
179
+ }
180
+ }
181
+ if ((tag & 7) === 4 || tag === 0) {
182
+ break;
183
+ }
184
+ reader.skip(tag & 7);
185
+ }
186
+ return message;
187
+ },
188
+ create(base) {
189
+ return exports.GetProductsResponse.fromPartial(base ?? {});
190
+ },
191
+ fromPartial(object) {
192
+ const message = createBaseGetProductsResponse();
193
+ message.meta = (object.meta !== undefined && object.meta !== null)
194
+ ? meta_1.ResponseMeta.fromPartial(object.meta)
195
+ : undefined;
196
+ message.page_response = (object.page_response !== undefined && object.page_response !== null)
197
+ ? pagination_1.PageResponse.fromPartial(object.page_response)
198
+ : undefined;
199
+ message.products = object.products?.map((e) => products_types_1.Product.fromPartial(e)) || [];
200
+ return message;
201
+ },
202
+ };
203
+ function createBaseGetProductByIdRequest() {
204
+ return { product_id: "" };
205
+ }
206
+ exports.GetProductByIdRequest = {
207
+ encode(message, writer = new wire_1.BinaryWriter()) {
208
+ if (message.product_id !== "") {
209
+ writer.uint32(10).string(message.product_id);
210
+ }
211
+ return writer;
212
+ },
213
+ decode(input, length) {
214
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
215
+ const end = length === undefined ? reader.len : reader.pos + length;
216
+ const message = createBaseGetProductByIdRequest();
217
+ while (reader.pos < end) {
218
+ const tag = reader.uint32();
219
+ switch (tag >>> 3) {
220
+ case 1: {
221
+ if (tag !== 10) {
222
+ break;
223
+ }
224
+ message.product_id = reader.string();
225
+ continue;
226
+ }
227
+ }
228
+ if ((tag & 7) === 4 || tag === 0) {
229
+ break;
230
+ }
231
+ reader.skip(tag & 7);
232
+ }
233
+ return message;
234
+ },
235
+ create(base) {
236
+ return exports.GetProductByIdRequest.fromPartial(base ?? {});
237
+ },
238
+ fromPartial(object) {
239
+ const message = createBaseGetProductByIdRequest();
240
+ message.product_id = object.product_id ?? "";
241
+ return message;
242
+ },
243
+ };
244
+ function createBaseGetProductByIdResponse() {
245
+ return { meta: undefined, product: undefined };
246
+ }
247
+ exports.GetProductByIdResponse = {
248
+ encode(message, writer = new wire_1.BinaryWriter()) {
249
+ if (message.meta !== undefined) {
250
+ meta_1.ResponseMeta.encode(message.meta, writer.uint32(10).fork()).join();
251
+ }
252
+ if (message.product !== undefined) {
253
+ products_types_1.Product.encode(message.product, writer.uint32(18).fork()).join();
254
+ }
255
+ return writer;
256
+ },
257
+ decode(input, length) {
258
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
259
+ const end = length === undefined ? reader.len : reader.pos + length;
260
+ const message = createBaseGetProductByIdResponse();
261
+ while (reader.pos < end) {
262
+ const tag = reader.uint32();
263
+ switch (tag >>> 3) {
264
+ case 1: {
265
+ if (tag !== 10) {
266
+ break;
267
+ }
268
+ message.meta = meta_1.ResponseMeta.decode(reader, reader.uint32());
269
+ continue;
270
+ }
271
+ case 2: {
272
+ if (tag !== 18) {
273
+ break;
274
+ }
275
+ message.product = products_types_1.Product.decode(reader, reader.uint32());
276
+ continue;
277
+ }
278
+ }
279
+ if ((tag & 7) === 4 || tag === 0) {
280
+ break;
281
+ }
282
+ reader.skip(tag & 7);
283
+ }
284
+ return message;
285
+ },
286
+ create(base) {
287
+ return exports.GetProductByIdResponse.fromPartial(base ?? {});
288
+ },
289
+ fromPartial(object) {
290
+ const message = createBaseGetProductByIdResponse();
291
+ message.meta = (object.meta !== undefined && object.meta !== null)
292
+ ? meta_1.ResponseMeta.fromPartial(object.meta)
293
+ : undefined;
294
+ message.product = (object.product !== undefined && object.product !== null)
295
+ ? products_types_1.Product.fromPartial(object.product)
296
+ : undefined;
297
+ return message;
298
+ },
299
+ };
300
+ function createBaseCreateProductRequest() {
301
+ return {
302
+ name: "",
303
+ description: "",
304
+ effective_at: "",
305
+ product_type: "",
306
+ person_type: "",
307
+ brand: "",
308
+ bin: "",
309
+ sub_bin: "",
310
+ country: "",
311
+ city: "",
312
+ multi_currency: false,
313
+ currencies: [],
314
+ main_currency: "",
315
+ product_key: "",
316
+ currency_allocations: [],
317
+ rules: [],
318
+ configurations: undefined,
319
+ commissions: [],
320
+ created_by: "",
321
+ offers: [],
322
+ };
323
+ }
324
+ exports.CreateProductRequest = {
325
+ encode(message, writer = new wire_1.BinaryWriter()) {
326
+ if (message.name !== "") {
327
+ writer.uint32(10).string(message.name);
328
+ }
329
+ if (message.description !== "") {
330
+ writer.uint32(18).string(message.description);
331
+ }
332
+ if (message.effective_at !== "") {
333
+ writer.uint32(26).string(message.effective_at);
334
+ }
335
+ if (message.product_type !== "") {
336
+ writer.uint32(34).string(message.product_type);
337
+ }
338
+ if (message.person_type !== "") {
339
+ writer.uint32(42).string(message.person_type);
340
+ }
341
+ if (message.brand !== "") {
342
+ writer.uint32(50).string(message.brand);
343
+ }
344
+ if (message.bin !== "") {
345
+ writer.uint32(58).string(message.bin);
346
+ }
347
+ if (message.sub_bin !== "") {
348
+ writer.uint32(66).string(message.sub_bin);
349
+ }
350
+ if (message.country !== "") {
351
+ writer.uint32(74).string(message.country);
352
+ }
353
+ if (message.city !== "") {
354
+ writer.uint32(82).string(message.city);
355
+ }
356
+ if (message.multi_currency !== false) {
357
+ writer.uint32(88).bool(message.multi_currency);
358
+ }
359
+ for (const v of message.currencies) {
360
+ writer.uint32(98).string(v);
361
+ }
362
+ if (message.main_currency !== "") {
363
+ writer.uint32(106).string(message.main_currency);
364
+ }
365
+ if (message.product_key !== "") {
366
+ writer.uint32(114).string(message.product_key);
367
+ }
368
+ for (const v of message.currency_allocations) {
369
+ products_types_1.CurrencyAllocation.encode(v, writer.uint32(122).fork()).join();
370
+ }
371
+ for (const v of message.rules) {
372
+ products_types_1.ProductRule.encode(v, writer.uint32(130).fork()).join();
373
+ }
374
+ if (message.configurations !== undefined) {
375
+ products_types_1.ProductConfigurations.encode(message.configurations, writer.uint32(138).fork()).join();
376
+ }
377
+ for (const v of message.commissions) {
378
+ writer.uint32(146).string(v);
379
+ }
380
+ if (message.created_by !== "") {
381
+ writer.uint32(154).string(message.created_by);
382
+ }
383
+ for (const v of message.offers) {
384
+ writer.uint32(162).string(v);
385
+ }
386
+ return writer;
387
+ },
388
+ decode(input, length) {
389
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
390
+ const end = length === undefined ? reader.len : reader.pos + length;
391
+ const message = createBaseCreateProductRequest();
392
+ while (reader.pos < end) {
393
+ const tag = reader.uint32();
394
+ switch (tag >>> 3) {
395
+ case 1: {
396
+ if (tag !== 10) {
397
+ break;
398
+ }
399
+ message.name = reader.string();
400
+ continue;
401
+ }
402
+ case 2: {
403
+ if (tag !== 18) {
404
+ break;
405
+ }
406
+ message.description = reader.string();
407
+ continue;
408
+ }
409
+ case 3: {
410
+ if (tag !== 26) {
411
+ break;
412
+ }
413
+ message.effective_at = reader.string();
414
+ continue;
415
+ }
416
+ case 4: {
417
+ if (tag !== 34) {
418
+ break;
419
+ }
420
+ message.product_type = reader.string();
421
+ continue;
422
+ }
423
+ case 5: {
424
+ if (tag !== 42) {
425
+ break;
426
+ }
427
+ message.person_type = reader.string();
428
+ continue;
429
+ }
430
+ case 6: {
431
+ if (tag !== 50) {
432
+ break;
433
+ }
434
+ message.brand = reader.string();
435
+ continue;
436
+ }
437
+ case 7: {
438
+ if (tag !== 58) {
439
+ break;
440
+ }
441
+ message.bin = reader.string();
442
+ continue;
443
+ }
444
+ case 8: {
445
+ if (tag !== 66) {
446
+ break;
447
+ }
448
+ message.sub_bin = reader.string();
449
+ continue;
450
+ }
451
+ case 9: {
452
+ if (tag !== 74) {
453
+ break;
454
+ }
455
+ message.country = reader.string();
456
+ continue;
457
+ }
458
+ case 10: {
459
+ if (tag !== 82) {
460
+ break;
461
+ }
462
+ message.city = reader.string();
463
+ continue;
464
+ }
465
+ case 11: {
466
+ if (tag !== 88) {
467
+ break;
468
+ }
469
+ message.multi_currency = reader.bool();
470
+ continue;
471
+ }
472
+ case 12: {
473
+ if (tag !== 98) {
474
+ break;
475
+ }
476
+ message.currencies.push(reader.string());
477
+ continue;
478
+ }
479
+ case 13: {
480
+ if (tag !== 106) {
481
+ break;
482
+ }
483
+ message.main_currency = reader.string();
484
+ continue;
485
+ }
486
+ case 14: {
487
+ if (tag !== 114) {
488
+ break;
489
+ }
490
+ message.product_key = reader.string();
491
+ continue;
492
+ }
493
+ case 15: {
494
+ if (tag !== 122) {
495
+ break;
496
+ }
497
+ message.currency_allocations.push(products_types_1.CurrencyAllocation.decode(reader, reader.uint32()));
498
+ continue;
499
+ }
500
+ case 16: {
501
+ if (tag !== 130) {
502
+ break;
503
+ }
504
+ message.rules.push(products_types_1.ProductRule.decode(reader, reader.uint32()));
505
+ continue;
506
+ }
507
+ case 17: {
508
+ if (tag !== 138) {
509
+ break;
510
+ }
511
+ message.configurations = products_types_1.ProductConfigurations.decode(reader, reader.uint32());
512
+ continue;
513
+ }
514
+ case 18: {
515
+ if (tag !== 146) {
516
+ break;
517
+ }
518
+ message.commissions.push(reader.string());
519
+ continue;
520
+ }
521
+ case 19: {
522
+ if (tag !== 154) {
523
+ break;
524
+ }
525
+ message.created_by = reader.string();
526
+ continue;
527
+ }
528
+ case 20: {
529
+ if (tag !== 162) {
530
+ break;
531
+ }
532
+ message.offers.push(reader.string());
533
+ continue;
534
+ }
535
+ }
536
+ if ((tag & 7) === 4 || tag === 0) {
537
+ break;
538
+ }
539
+ reader.skip(tag & 7);
540
+ }
541
+ return message;
542
+ },
543
+ create(base) {
544
+ return exports.CreateProductRequest.fromPartial(base ?? {});
545
+ },
546
+ fromPartial(object) {
547
+ const message = createBaseCreateProductRequest();
548
+ message.name = object.name ?? "";
549
+ message.description = object.description ?? "";
550
+ message.effective_at = object.effective_at ?? "";
551
+ message.product_type = object.product_type ?? "";
552
+ message.person_type = object.person_type ?? "";
553
+ message.brand = object.brand ?? "";
554
+ message.bin = object.bin ?? "";
555
+ message.sub_bin = object.sub_bin ?? "";
556
+ message.country = object.country ?? "";
557
+ message.city = object.city ?? "";
558
+ message.multi_currency = object.multi_currency ?? false;
559
+ message.currencies = object.currencies?.map((e) => e) || [];
560
+ message.main_currency = object.main_currency ?? "";
561
+ message.product_key = object.product_key ?? "";
562
+ message.currency_allocations = object.currency_allocations?.map((e) => products_types_1.CurrencyAllocation.fromPartial(e)) || [];
563
+ message.rules = object.rules?.map((e) => products_types_1.ProductRule.fromPartial(e)) || [];
564
+ message.configurations = (object.configurations !== undefined && object.configurations !== null)
565
+ ? products_types_1.ProductConfigurations.fromPartial(object.configurations)
566
+ : undefined;
567
+ message.commissions = object.commissions?.map((e) => e) || [];
568
+ message.created_by = object.created_by ?? "";
569
+ message.offers = object.offers?.map((e) => e) || [];
570
+ return message;
571
+ },
572
+ };
573
+ function createBaseCreateProductResponse() {
574
+ return { meta: undefined, product: undefined };
575
+ }
576
+ exports.CreateProductResponse = {
577
+ encode(message, writer = new wire_1.BinaryWriter()) {
578
+ if (message.meta !== undefined) {
579
+ meta_1.ResponseMeta.encode(message.meta, writer.uint32(10).fork()).join();
580
+ }
581
+ if (message.product !== undefined) {
582
+ products_types_1.Product.encode(message.product, writer.uint32(18).fork()).join();
583
+ }
584
+ return writer;
585
+ },
586
+ decode(input, length) {
587
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
588
+ const end = length === undefined ? reader.len : reader.pos + length;
589
+ const message = createBaseCreateProductResponse();
590
+ while (reader.pos < end) {
591
+ const tag = reader.uint32();
592
+ switch (tag >>> 3) {
593
+ case 1: {
594
+ if (tag !== 10) {
595
+ break;
596
+ }
597
+ message.meta = meta_1.ResponseMeta.decode(reader, reader.uint32());
598
+ continue;
599
+ }
600
+ case 2: {
601
+ if (tag !== 18) {
602
+ break;
603
+ }
604
+ message.product = products_types_1.Product.decode(reader, reader.uint32());
605
+ continue;
606
+ }
607
+ }
608
+ if ((tag & 7) === 4 || tag === 0) {
609
+ break;
610
+ }
611
+ reader.skip(tag & 7);
612
+ }
613
+ return message;
614
+ },
615
+ create(base) {
616
+ return exports.CreateProductResponse.fromPartial(base ?? {});
617
+ },
618
+ fromPartial(object) {
619
+ const message = createBaseCreateProductResponse();
620
+ message.meta = (object.meta !== undefined && object.meta !== null)
621
+ ? meta_1.ResponseMeta.fromPartial(object.meta)
622
+ : undefined;
623
+ message.product = (object.product !== undefined && object.product !== null)
624
+ ? products_types_1.Product.fromPartial(object.product)
625
+ : undefined;
626
+ return message;
627
+ },
628
+ };
629
+ function createBaseUpdateProductRequest() {
630
+ return {
631
+ product_id: "",
632
+ name: "",
633
+ description: "",
634
+ effective_at: "",
635
+ product_type: "",
636
+ person_type: "",
637
+ brand: "",
638
+ bin: "",
639
+ sub_bin: "",
640
+ country: "",
641
+ city: "",
642
+ multi_currency: false,
643
+ currencies: [],
644
+ main_currency: "",
645
+ currency_allocations: [],
646
+ rules: [],
647
+ commissions: [],
648
+ active: false,
649
+ deleted: false,
650
+ updated_by: "",
651
+ offers: [],
652
+ };
653
+ }
654
+ exports.UpdateProductRequest = {
655
+ encode(message, writer = new wire_1.BinaryWriter()) {
656
+ if (message.product_id !== "") {
657
+ writer.uint32(10).string(message.product_id);
658
+ }
659
+ if (message.name !== "") {
660
+ writer.uint32(18).string(message.name);
661
+ }
662
+ if (message.description !== "") {
663
+ writer.uint32(26).string(message.description);
664
+ }
665
+ if (message.effective_at !== "") {
666
+ writer.uint32(34).string(message.effective_at);
667
+ }
668
+ if (message.product_type !== "") {
669
+ writer.uint32(42).string(message.product_type);
670
+ }
671
+ if (message.person_type !== "") {
672
+ writer.uint32(50).string(message.person_type);
673
+ }
674
+ if (message.brand !== "") {
675
+ writer.uint32(58).string(message.brand);
676
+ }
677
+ if (message.bin !== "") {
678
+ writer.uint32(66).string(message.bin);
679
+ }
680
+ if (message.sub_bin !== "") {
681
+ writer.uint32(74).string(message.sub_bin);
682
+ }
683
+ if (message.country !== "") {
684
+ writer.uint32(82).string(message.country);
685
+ }
686
+ if (message.city !== "") {
687
+ writer.uint32(90).string(message.city);
688
+ }
689
+ if (message.multi_currency !== false) {
690
+ writer.uint32(96).bool(message.multi_currency);
691
+ }
692
+ for (const v of message.currencies) {
693
+ writer.uint32(106).string(v);
694
+ }
695
+ if (message.main_currency !== "") {
696
+ writer.uint32(114).string(message.main_currency);
697
+ }
698
+ for (const v of message.currency_allocations) {
699
+ products_types_1.CurrencyAllocation.encode(v, writer.uint32(122).fork()).join();
700
+ }
701
+ for (const v of message.rules) {
702
+ products_types_1.ProductRule.encode(v, writer.uint32(130).fork()).join();
703
+ }
704
+ for (const v of message.commissions) {
705
+ writer.uint32(146).string(v);
706
+ }
707
+ if (message.active !== false) {
708
+ writer.uint32(152).bool(message.active);
709
+ }
710
+ if (message.deleted !== false) {
711
+ writer.uint32(160).bool(message.deleted);
712
+ }
713
+ if (message.updated_by !== "") {
714
+ writer.uint32(170).string(message.updated_by);
715
+ }
716
+ for (const v of message.offers) {
717
+ writer.uint32(178).string(v);
718
+ }
719
+ return writer;
720
+ },
721
+ decode(input, length) {
722
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
723
+ const end = length === undefined ? reader.len : reader.pos + length;
724
+ const message = createBaseUpdateProductRequest();
725
+ while (reader.pos < end) {
726
+ const tag = reader.uint32();
727
+ switch (tag >>> 3) {
728
+ case 1: {
729
+ if (tag !== 10) {
730
+ break;
731
+ }
732
+ message.product_id = reader.string();
733
+ continue;
734
+ }
735
+ case 2: {
736
+ if (tag !== 18) {
737
+ break;
738
+ }
739
+ message.name = reader.string();
740
+ continue;
741
+ }
742
+ case 3: {
743
+ if (tag !== 26) {
744
+ break;
745
+ }
746
+ message.description = reader.string();
747
+ continue;
748
+ }
749
+ case 4: {
750
+ if (tag !== 34) {
751
+ break;
752
+ }
753
+ message.effective_at = reader.string();
754
+ continue;
755
+ }
756
+ case 5: {
757
+ if (tag !== 42) {
758
+ break;
759
+ }
760
+ message.product_type = reader.string();
761
+ continue;
762
+ }
763
+ case 6: {
764
+ if (tag !== 50) {
765
+ break;
766
+ }
767
+ message.person_type = reader.string();
768
+ continue;
769
+ }
770
+ case 7: {
771
+ if (tag !== 58) {
772
+ break;
773
+ }
774
+ message.brand = reader.string();
775
+ continue;
776
+ }
777
+ case 8: {
778
+ if (tag !== 66) {
779
+ break;
780
+ }
781
+ message.bin = reader.string();
782
+ continue;
783
+ }
784
+ case 9: {
785
+ if (tag !== 74) {
786
+ break;
787
+ }
788
+ message.sub_bin = reader.string();
789
+ continue;
790
+ }
791
+ case 10: {
792
+ if (tag !== 82) {
793
+ break;
794
+ }
795
+ message.country = reader.string();
796
+ continue;
797
+ }
798
+ case 11: {
799
+ if (tag !== 90) {
800
+ break;
801
+ }
802
+ message.city = reader.string();
803
+ continue;
804
+ }
805
+ case 12: {
806
+ if (tag !== 96) {
807
+ break;
808
+ }
809
+ message.multi_currency = reader.bool();
810
+ continue;
811
+ }
812
+ case 13: {
813
+ if (tag !== 106) {
814
+ break;
815
+ }
816
+ message.currencies.push(reader.string());
817
+ continue;
818
+ }
819
+ case 14: {
820
+ if (tag !== 114) {
821
+ break;
822
+ }
823
+ message.main_currency = reader.string();
824
+ continue;
825
+ }
826
+ case 15: {
827
+ if (tag !== 122) {
828
+ break;
829
+ }
830
+ message.currency_allocations.push(products_types_1.CurrencyAllocation.decode(reader, reader.uint32()));
831
+ continue;
832
+ }
833
+ case 16: {
834
+ if (tag !== 130) {
835
+ break;
836
+ }
837
+ message.rules.push(products_types_1.ProductRule.decode(reader, reader.uint32()));
838
+ continue;
839
+ }
840
+ case 18: {
841
+ if (tag !== 146) {
842
+ break;
843
+ }
844
+ message.commissions.push(reader.string());
845
+ continue;
846
+ }
847
+ case 19: {
848
+ if (tag !== 152) {
849
+ break;
850
+ }
851
+ message.active = reader.bool();
852
+ continue;
853
+ }
854
+ case 20: {
855
+ if (tag !== 160) {
856
+ break;
857
+ }
858
+ message.deleted = reader.bool();
859
+ continue;
860
+ }
861
+ case 21: {
862
+ if (tag !== 170) {
863
+ break;
864
+ }
865
+ message.updated_by = reader.string();
866
+ continue;
867
+ }
868
+ case 22: {
869
+ if (tag !== 178) {
870
+ break;
871
+ }
872
+ message.offers.push(reader.string());
873
+ continue;
874
+ }
875
+ }
876
+ if ((tag & 7) === 4 || tag === 0) {
877
+ break;
878
+ }
879
+ reader.skip(tag & 7);
880
+ }
881
+ return message;
882
+ },
883
+ create(base) {
884
+ return exports.UpdateProductRequest.fromPartial(base ?? {});
885
+ },
886
+ fromPartial(object) {
887
+ const message = createBaseUpdateProductRequest();
888
+ message.product_id = object.product_id ?? "";
889
+ message.name = object.name ?? "";
890
+ message.description = object.description ?? "";
891
+ message.effective_at = object.effective_at ?? "";
892
+ message.product_type = object.product_type ?? "";
893
+ message.person_type = object.person_type ?? "";
894
+ message.brand = object.brand ?? "";
895
+ message.bin = object.bin ?? "";
896
+ message.sub_bin = object.sub_bin ?? "";
897
+ message.country = object.country ?? "";
898
+ message.city = object.city ?? "";
899
+ message.multi_currency = object.multi_currency ?? false;
900
+ message.currencies = object.currencies?.map((e) => e) || [];
901
+ message.main_currency = object.main_currency ?? "";
902
+ message.currency_allocations = object.currency_allocations?.map((e) => products_types_1.CurrencyAllocation.fromPartial(e)) || [];
903
+ message.rules = object.rules?.map((e) => products_types_1.ProductRule.fromPartial(e)) || [];
904
+ message.commissions = object.commissions?.map((e) => e) || [];
905
+ message.active = object.active ?? false;
906
+ message.deleted = object.deleted ?? false;
907
+ message.updated_by = object.updated_by ?? "";
908
+ message.offers = object.offers?.map((e) => e) || [];
909
+ return message;
910
+ },
911
+ };
912
+ function createBaseUpdateProductResponse() {
913
+ return { meta: undefined, product: undefined };
914
+ }
915
+ exports.UpdateProductResponse = {
916
+ encode(message, writer = new wire_1.BinaryWriter()) {
917
+ if (message.meta !== undefined) {
918
+ meta_1.ResponseMeta.encode(message.meta, writer.uint32(10).fork()).join();
919
+ }
920
+ if (message.product !== undefined) {
921
+ products_types_1.Product.encode(message.product, writer.uint32(18).fork()).join();
922
+ }
923
+ return writer;
924
+ },
925
+ decode(input, length) {
926
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
927
+ const end = length === undefined ? reader.len : reader.pos + length;
928
+ const message = createBaseUpdateProductResponse();
929
+ while (reader.pos < end) {
930
+ const tag = reader.uint32();
931
+ switch (tag >>> 3) {
932
+ case 1: {
933
+ if (tag !== 10) {
934
+ break;
935
+ }
936
+ message.meta = meta_1.ResponseMeta.decode(reader, reader.uint32());
937
+ continue;
938
+ }
939
+ case 2: {
940
+ if (tag !== 18) {
941
+ break;
942
+ }
943
+ message.product = products_types_1.Product.decode(reader, reader.uint32());
944
+ continue;
945
+ }
946
+ }
947
+ if ((tag & 7) === 4 || tag === 0) {
948
+ break;
949
+ }
950
+ reader.skip(tag & 7);
951
+ }
952
+ return message;
953
+ },
954
+ create(base) {
955
+ return exports.UpdateProductResponse.fromPartial(base ?? {});
956
+ },
957
+ fromPartial(object) {
958
+ const message = createBaseUpdateProductResponse();
959
+ message.meta = (object.meta !== undefined && object.meta !== null)
960
+ ? meta_1.ResponseMeta.fromPartial(object.meta)
961
+ : undefined;
962
+ message.product = (object.product !== undefined && object.product !== null)
963
+ ? products_types_1.Product.fromPartial(object.product)
964
+ : undefined;
965
+ return message;
966
+ },
967
+ };
968
+ function createBaseValidateBinSubBinRequest() {
969
+ return { bin: "", sub_bin: "", exclude_product_id: "" };
970
+ }
971
+ exports.ValidateBinSubBinRequest = {
972
+ encode(message, writer = new wire_1.BinaryWriter()) {
973
+ if (message.bin !== "") {
974
+ writer.uint32(10).string(message.bin);
975
+ }
976
+ if (message.sub_bin !== "") {
977
+ writer.uint32(18).string(message.sub_bin);
978
+ }
979
+ if (message.exclude_product_id !== "") {
980
+ writer.uint32(26).string(message.exclude_product_id);
981
+ }
982
+ return writer;
983
+ },
984
+ decode(input, length) {
985
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
986
+ const end = length === undefined ? reader.len : reader.pos + length;
987
+ const message = createBaseValidateBinSubBinRequest();
988
+ while (reader.pos < end) {
989
+ const tag = reader.uint32();
990
+ switch (tag >>> 3) {
991
+ case 1: {
992
+ if (tag !== 10) {
993
+ break;
994
+ }
995
+ message.bin = reader.string();
996
+ continue;
997
+ }
998
+ case 2: {
999
+ if (tag !== 18) {
1000
+ break;
1001
+ }
1002
+ message.sub_bin = reader.string();
1003
+ continue;
1004
+ }
1005
+ case 3: {
1006
+ if (tag !== 26) {
1007
+ break;
1008
+ }
1009
+ message.exclude_product_id = reader.string();
1010
+ continue;
1011
+ }
1012
+ }
1013
+ if ((tag & 7) === 4 || tag === 0) {
1014
+ break;
1015
+ }
1016
+ reader.skip(tag & 7);
1017
+ }
1018
+ return message;
1019
+ },
1020
+ create(base) {
1021
+ return exports.ValidateBinSubBinRequest.fromPartial(base ?? {});
1022
+ },
1023
+ fromPartial(object) {
1024
+ const message = createBaseValidateBinSubBinRequest();
1025
+ message.bin = object.bin ?? "";
1026
+ message.sub_bin = object.sub_bin ?? "";
1027
+ message.exclude_product_id = object.exclude_product_id ?? "";
1028
+ return message;
1029
+ },
1030
+ };
1031
+ function createBaseValidateBinSubBinResponse() {
1032
+ return { meta: undefined, is_valid: false, message: "" };
1033
+ }
1034
+ exports.ValidateBinSubBinResponse = {
1035
+ encode(message, writer = new wire_1.BinaryWriter()) {
1036
+ if (message.meta !== undefined) {
1037
+ meta_1.ResponseMeta.encode(message.meta, writer.uint32(10).fork()).join();
1038
+ }
1039
+ if (message.is_valid !== false) {
1040
+ writer.uint32(16).bool(message.is_valid);
1041
+ }
1042
+ if (message.message !== "") {
1043
+ writer.uint32(26).string(message.message);
1044
+ }
1045
+ return writer;
1046
+ },
1047
+ decode(input, length) {
1048
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1049
+ const end = length === undefined ? reader.len : reader.pos + length;
1050
+ const message = createBaseValidateBinSubBinResponse();
1051
+ while (reader.pos < end) {
1052
+ const tag = reader.uint32();
1053
+ switch (tag >>> 3) {
1054
+ case 1: {
1055
+ if (tag !== 10) {
1056
+ break;
1057
+ }
1058
+ message.meta = meta_1.ResponseMeta.decode(reader, reader.uint32());
1059
+ continue;
1060
+ }
1061
+ case 2: {
1062
+ if (tag !== 16) {
1063
+ break;
1064
+ }
1065
+ message.is_valid = reader.bool();
1066
+ continue;
1067
+ }
1068
+ case 3: {
1069
+ if (tag !== 26) {
1070
+ break;
1071
+ }
1072
+ message.message = reader.string();
1073
+ continue;
1074
+ }
1075
+ }
1076
+ if ((tag & 7) === 4 || tag === 0) {
1077
+ break;
1078
+ }
1079
+ reader.skip(tag & 7);
1080
+ }
1081
+ return message;
1082
+ },
1083
+ create(base) {
1084
+ return exports.ValidateBinSubBinResponse.fromPartial(base ?? {});
1085
+ },
1086
+ fromPartial(object) {
1087
+ const message = createBaseValidateBinSubBinResponse();
1088
+ message.meta = (object.meta !== undefined && object.meta !== null)
1089
+ ? meta_1.ResponseMeta.fromPartial(object.meta)
1090
+ : undefined;
1091
+ message.is_valid = object.is_valid ?? false;
1092
+ message.message = object.message ?? "";
1093
+ return message;
1094
+ },
1095
+ };
1096
+ function createBaseGetStatementConfigRequest() {
1097
+ return { product_id: "" };
1098
+ }
1099
+ exports.GetStatementConfigRequest = {
1100
+ encode(message, writer = new wire_1.BinaryWriter()) {
1101
+ if (message.product_id !== "") {
1102
+ writer.uint32(10).string(message.product_id);
1103
+ }
1104
+ return writer;
1105
+ },
1106
+ decode(input, length) {
1107
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1108
+ const end = length === undefined ? reader.len : reader.pos + length;
1109
+ const message = createBaseGetStatementConfigRequest();
1110
+ while (reader.pos < end) {
1111
+ const tag = reader.uint32();
1112
+ switch (tag >>> 3) {
1113
+ case 1: {
1114
+ if (tag !== 10) {
1115
+ break;
1116
+ }
1117
+ message.product_id = reader.string();
1118
+ continue;
1119
+ }
1120
+ }
1121
+ if ((tag & 7) === 4 || tag === 0) {
1122
+ break;
1123
+ }
1124
+ reader.skip(tag & 7);
1125
+ }
1126
+ return message;
1127
+ },
1128
+ create(base) {
1129
+ return exports.GetStatementConfigRequest.fromPartial(base ?? {});
1130
+ },
1131
+ fromPartial(object) {
1132
+ const message = createBaseGetStatementConfigRequest();
1133
+ message.product_id = object.product_id ?? "";
1134
+ return message;
1135
+ },
1136
+ };
1137
+ function createBaseGetStatementConfigResponse() {
1138
+ return { meta: undefined, statement: undefined };
1139
+ }
1140
+ exports.GetStatementConfigResponse = {
1141
+ encode(message, writer = new wire_1.BinaryWriter()) {
1142
+ if (message.meta !== undefined) {
1143
+ meta_1.ResponseMeta.encode(message.meta, writer.uint32(10).fork()).join();
1144
+ }
1145
+ if (message.statement !== undefined) {
1146
+ products_types_1.ProductStatement.encode(message.statement, writer.uint32(18).fork()).join();
1147
+ }
1148
+ return writer;
1149
+ },
1150
+ decode(input, length) {
1151
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1152
+ const end = length === undefined ? reader.len : reader.pos + length;
1153
+ const message = createBaseGetStatementConfigResponse();
1154
+ while (reader.pos < end) {
1155
+ const tag = reader.uint32();
1156
+ switch (tag >>> 3) {
1157
+ case 1: {
1158
+ if (tag !== 10) {
1159
+ break;
1160
+ }
1161
+ message.meta = meta_1.ResponseMeta.decode(reader, reader.uint32());
1162
+ continue;
1163
+ }
1164
+ case 2: {
1165
+ if (tag !== 18) {
1166
+ break;
1167
+ }
1168
+ message.statement = products_types_1.ProductStatement.decode(reader, reader.uint32());
1169
+ continue;
1170
+ }
1171
+ }
1172
+ if ((tag & 7) === 4 || tag === 0) {
1173
+ break;
1174
+ }
1175
+ reader.skip(tag & 7);
1176
+ }
1177
+ return message;
1178
+ },
1179
+ create(base) {
1180
+ return exports.GetStatementConfigResponse.fromPartial(base ?? {});
1181
+ },
1182
+ fromPartial(object) {
1183
+ const message = createBaseGetStatementConfigResponse();
1184
+ message.meta = (object.meta !== undefined && object.meta !== null)
1185
+ ? meta_1.ResponseMeta.fromPartial(object.meta)
1186
+ : undefined;
1187
+ message.statement = (object.statement !== undefined && object.statement !== null)
1188
+ ? products_types_1.ProductStatement.fromPartial(object.statement)
1189
+ : undefined;
1190
+ return message;
1191
+ },
1192
+ };
1193
+ function createBaseSaveStatementConfigRequest() {
1194
+ return { product_id: "", statement: undefined };
1195
+ }
1196
+ exports.SaveStatementConfigRequest = {
1197
+ encode(message, writer = new wire_1.BinaryWriter()) {
1198
+ if (message.product_id !== "") {
1199
+ writer.uint32(10).string(message.product_id);
1200
+ }
1201
+ if (message.statement !== undefined) {
1202
+ products_types_1.ProductStatement.encode(message.statement, writer.uint32(18).fork()).join();
1203
+ }
1204
+ return writer;
1205
+ },
1206
+ decode(input, length) {
1207
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1208
+ const end = length === undefined ? reader.len : reader.pos + length;
1209
+ const message = createBaseSaveStatementConfigRequest();
1210
+ while (reader.pos < end) {
1211
+ const tag = reader.uint32();
1212
+ switch (tag >>> 3) {
1213
+ case 1: {
1214
+ if (tag !== 10) {
1215
+ break;
1216
+ }
1217
+ message.product_id = reader.string();
1218
+ continue;
1219
+ }
1220
+ case 2: {
1221
+ if (tag !== 18) {
1222
+ break;
1223
+ }
1224
+ message.statement = products_types_1.ProductStatement.decode(reader, reader.uint32());
1225
+ continue;
1226
+ }
1227
+ }
1228
+ if ((tag & 7) === 4 || tag === 0) {
1229
+ break;
1230
+ }
1231
+ reader.skip(tag & 7);
1232
+ }
1233
+ return message;
1234
+ },
1235
+ create(base) {
1236
+ return exports.SaveStatementConfigRequest.fromPartial(base ?? {});
1237
+ },
1238
+ fromPartial(object) {
1239
+ const message = createBaseSaveStatementConfigRequest();
1240
+ message.product_id = object.product_id ?? "";
1241
+ message.statement = (object.statement !== undefined && object.statement !== null)
1242
+ ? products_types_1.ProductStatement.fromPartial(object.statement)
1243
+ : undefined;
1244
+ return message;
1245
+ },
1246
+ };
1247
+ function createBaseSaveStatementConfigResponse() {
1248
+ return { meta: undefined, statement: undefined };
1249
+ }
1250
+ exports.SaveStatementConfigResponse = {
1251
+ encode(message, writer = new wire_1.BinaryWriter()) {
1252
+ if (message.meta !== undefined) {
1253
+ meta_1.ResponseMeta.encode(message.meta, writer.uint32(10).fork()).join();
1254
+ }
1255
+ if (message.statement !== undefined) {
1256
+ products_types_1.ProductStatement.encode(message.statement, writer.uint32(18).fork()).join();
1257
+ }
1258
+ return writer;
1259
+ },
1260
+ decode(input, length) {
1261
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1262
+ const end = length === undefined ? reader.len : reader.pos + length;
1263
+ const message = createBaseSaveStatementConfigResponse();
1264
+ while (reader.pos < end) {
1265
+ const tag = reader.uint32();
1266
+ switch (tag >>> 3) {
1267
+ case 1: {
1268
+ if (tag !== 10) {
1269
+ break;
1270
+ }
1271
+ message.meta = meta_1.ResponseMeta.decode(reader, reader.uint32());
1272
+ continue;
1273
+ }
1274
+ case 2: {
1275
+ if (tag !== 18) {
1276
+ break;
1277
+ }
1278
+ message.statement = products_types_1.ProductStatement.decode(reader, reader.uint32());
1279
+ continue;
1280
+ }
1281
+ }
1282
+ if ((tag & 7) === 4 || tag === 0) {
1283
+ break;
1284
+ }
1285
+ reader.skip(tag & 7);
1286
+ }
1287
+ return message;
1288
+ },
1289
+ create(base) {
1290
+ return exports.SaveStatementConfigResponse.fromPartial(base ?? {});
1291
+ },
1292
+ fromPartial(object) {
1293
+ const message = createBaseSaveStatementConfigResponse();
1294
+ message.meta = (object.meta !== undefined && object.meta !== null)
1295
+ ? meta_1.ResponseMeta.fromPartial(object.meta)
1296
+ : undefined;
1297
+ message.statement = (object.statement !== undefined && object.statement !== null)
1298
+ ? products_types_1.ProductStatement.fromPartial(object.statement)
1299
+ : undefined;
1300
+ return message;
1301
+ },
1302
+ };
1303
+ exports.ProductsServiceService = {
1304
+ getProducts: {
1305
+ path: "/kapital.products.v1.ProductsService/GetProducts",
1306
+ requestStream: false,
1307
+ responseStream: false,
1308
+ requestSerialize: (value) => Buffer.from(exports.GetProductsRequest.encode(value).finish()),
1309
+ requestDeserialize: (value) => exports.GetProductsRequest.decode(value),
1310
+ responseSerialize: (value) => Buffer.from(exports.GetProductsResponse.encode(value).finish()),
1311
+ responseDeserialize: (value) => exports.GetProductsResponse.decode(value),
1312
+ },
1313
+ getProductById: {
1314
+ path: "/kapital.products.v1.ProductsService/GetProductById",
1315
+ requestStream: false,
1316
+ responseStream: false,
1317
+ requestSerialize: (value) => Buffer.from(exports.GetProductByIdRequest.encode(value).finish()),
1318
+ requestDeserialize: (value) => exports.GetProductByIdRequest.decode(value),
1319
+ responseSerialize: (value) => Buffer.from(exports.GetProductByIdResponse.encode(value).finish()),
1320
+ responseDeserialize: (value) => exports.GetProductByIdResponse.decode(value),
1321
+ },
1322
+ createProduct: {
1323
+ path: "/kapital.products.v1.ProductsService/CreateProduct",
1324
+ requestStream: false,
1325
+ responseStream: false,
1326
+ requestSerialize: (value) => Buffer.from(exports.CreateProductRequest.encode(value).finish()),
1327
+ requestDeserialize: (value) => exports.CreateProductRequest.decode(value),
1328
+ responseSerialize: (value) => Buffer.from(exports.CreateProductResponse.encode(value).finish()),
1329
+ responseDeserialize: (value) => exports.CreateProductResponse.decode(value),
1330
+ },
1331
+ updateProduct: {
1332
+ path: "/kapital.products.v1.ProductsService/UpdateProduct",
1333
+ requestStream: false,
1334
+ responseStream: false,
1335
+ requestSerialize: (value) => Buffer.from(exports.UpdateProductRequest.encode(value).finish()),
1336
+ requestDeserialize: (value) => exports.UpdateProductRequest.decode(value),
1337
+ responseSerialize: (value) => Buffer.from(exports.UpdateProductResponse.encode(value).finish()),
1338
+ responseDeserialize: (value) => exports.UpdateProductResponse.decode(value),
1339
+ },
1340
+ validateBinSubBin: {
1341
+ path: "/kapital.products.v1.ProductsService/ValidateBinSubBin",
1342
+ requestStream: false,
1343
+ responseStream: false,
1344
+ requestSerialize: (value) => Buffer.from(exports.ValidateBinSubBinRequest.encode(value).finish()),
1345
+ requestDeserialize: (value) => exports.ValidateBinSubBinRequest.decode(value),
1346
+ responseSerialize: (value) => Buffer.from(exports.ValidateBinSubBinResponse.encode(value).finish()),
1347
+ responseDeserialize: (value) => exports.ValidateBinSubBinResponse.decode(value),
1348
+ },
1349
+ getStatementConfig: {
1350
+ path: "/kapital.products.v1.ProductsService/GetStatementConfig",
1351
+ requestStream: false,
1352
+ responseStream: false,
1353
+ requestSerialize: (value) => Buffer.from(exports.GetStatementConfigRequest.encode(value).finish()),
1354
+ requestDeserialize: (value) => exports.GetStatementConfigRequest.decode(value),
1355
+ responseSerialize: (value) => Buffer.from(exports.GetStatementConfigResponse.encode(value).finish()),
1356
+ responseDeserialize: (value) => exports.GetStatementConfigResponse.decode(value),
1357
+ },
1358
+ saveStatementConfig: {
1359
+ path: "/kapital.products.v1.ProductsService/SaveStatementConfig",
1360
+ requestStream: false,
1361
+ responseStream: false,
1362
+ requestSerialize: (value) => Buffer.from(exports.SaveStatementConfigRequest.encode(value).finish()),
1363
+ requestDeserialize: (value) => exports.SaveStatementConfigRequest.decode(value),
1364
+ responseSerialize: (value) => Buffer.from(exports.SaveStatementConfigResponse.encode(value).finish()),
1365
+ responseDeserialize: (value) => exports.SaveStatementConfigResponse.decode(value),
1366
+ },
1367
+ };
1368
+ exports.ProductsServiceClient = (0, grpc_js_1.makeGenericClientConstructor)(exports.ProductsServiceService, "kapital.products.v1.ProductsService");
1369
+ //# sourceMappingURL=products.js.map