@stashfin/grpc 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stashfin/grpc",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "Grpc proto manger",
5
5
  "scripts": {
6
6
  "prebuild": "rimraf src/ts && mkdirp src/ts && mkdirp dist",
@@ -3,9 +3,10 @@ export declare const protobufPackage = "stashcash.debitsc";
3
3
  export interface request {
4
4
  customer_id: number;
5
5
  flag: number;
6
- campaign_id?: number | undefined;
7
- amount?: number | undefined;
6
+ campaign_id: number;
7
+ amount: number;
8
8
  sc_type?: string | undefined;
9
+ txn_id?: string | undefined;
9
10
  }
10
11
  export interface response {
11
12
  status: string;
@@ -14,7 +14,7 @@ const long_1 = __importDefault(require("long"));
14
14
  const minimal_1 = __importDefault(require("protobufjs/minimal"));
15
15
  exports.protobufPackage = "stashcash.debitsc";
16
16
  function createBaserequest() {
17
- return { customer_id: 0, flag: 0, campaign_id: undefined, amount: undefined, sc_type: undefined };
17
+ return { customer_id: 0, flag: 0, campaign_id: 0, amount: 0, sc_type: undefined, txn_id: undefined };
18
18
  }
19
19
  exports.request = {
20
20
  encode(message, writer = minimal_1.default.Writer.create()) {
@@ -24,15 +24,18 @@ exports.request = {
24
24
  if (message.flag !== 0) {
25
25
  writer.uint32(16).int32(message.flag);
26
26
  }
27
- if (message.campaign_id !== undefined) {
27
+ if (message.campaign_id !== 0) {
28
28
  writer.uint32(24).int64(message.campaign_id);
29
29
  }
30
- if (message.amount !== undefined) {
30
+ if (message.amount !== 0) {
31
31
  writer.uint32(37).float(message.amount);
32
32
  }
33
33
  if (message.sc_type !== undefined) {
34
34
  writer.uint32(42).string(message.sc_type);
35
35
  }
36
+ if (message.txn_id !== undefined) {
37
+ writer.uint32(50).string(message.txn_id);
38
+ }
36
39
  return writer;
37
40
  },
38
41
  decode(input, length) {
@@ -72,6 +75,12 @@ exports.request = {
72
75
  }
73
76
  message.sc_type = reader.string();
74
77
  continue;
78
+ case 6:
79
+ if (tag !== 50) {
80
+ break;
81
+ }
82
+ message.txn_id = reader.string();
83
+ continue;
75
84
  }
76
85
  if ((tag & 7) === 4 || tag === 0) {
77
86
  break;
@@ -84,9 +93,10 @@ exports.request = {
84
93
  return {
85
94
  customer_id: isSet(object.customer_id) ? globalThis.Number(object.customer_id) : 0,
86
95
  flag: isSet(object.flag) ? globalThis.Number(object.flag) : 0,
87
- campaign_id: isSet(object.campaign_id) ? globalThis.Number(object.campaign_id) : undefined,
88
- amount: isSet(object.amount) ? globalThis.Number(object.amount) : undefined,
96
+ campaign_id: isSet(object.campaign_id) ? globalThis.Number(object.campaign_id) : 0,
97
+ amount: isSet(object.amount) ? globalThis.Number(object.amount) : 0,
89
98
  sc_type: isSet(object.sc_type) ? globalThis.String(object.sc_type) : undefined,
99
+ txn_id: isSet(object.txn_id) ? globalThis.String(object.txn_id) : undefined,
90
100
  };
91
101
  },
92
102
  toJSON(message) {
@@ -97,15 +107,18 @@ exports.request = {
97
107
  if (message.flag !== 0) {
98
108
  obj.flag = Math.round(message.flag);
99
109
  }
100
- if (message.campaign_id !== undefined) {
110
+ if (message.campaign_id !== 0) {
101
111
  obj.campaign_id = Math.round(message.campaign_id);
102
112
  }
103
- if (message.amount !== undefined) {
113
+ if (message.amount !== 0) {
104
114
  obj.amount = message.amount;
105
115
  }
106
116
  if (message.sc_type !== undefined) {
107
117
  obj.sc_type = message.sc_type;
108
118
  }
119
+ if (message.txn_id !== undefined) {
120
+ obj.txn_id = message.txn_id;
121
+ }
109
122
  return obj;
110
123
  },
111
124
  create(base) {
@@ -115,9 +128,10 @@ exports.request = {
115
128
  const message = createBaserequest();
116
129
  message.customer_id = object.customer_id ?? 0;
117
130
  message.flag = object.flag ?? 0;
118
- message.campaign_id = object.campaign_id ?? undefined;
119
- message.amount = object.amount ?? undefined;
131
+ message.campaign_id = object.campaign_id ?? 0;
132
+ message.amount = object.amount ?? 0;
120
133
  message.sc_type = object.sc_type ?? undefined;
134
+ message.txn_id = object.txn_id ?? undefined;
121
135
  return message;
122
136
  },
123
137
  };