@stashfin/grpc 1.3.7 → 1.3.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stashfin/grpc",
3
- "version": "1.3.7",
3
+ "version": "1.3.8",
4
4
  "description": "Grpc proto manger",
5
5
  "scripts": {
6
6
  "prebuild": "rimraf src/ts && mkdirp src/ts && mkdirp dist",
@@ -2,15 +2,23 @@ import _m0 from "protobufjs/minimal";
2
2
  export declare const protobufPackage = "eqxpayments.createorderv2";
3
3
  export interface request {
4
4
  subscriber_id: string;
5
- status_page_url: string;
6
- redirect_url: string;
7
- checkout_token: string;
5
+ order_ref: string;
6
+ amount_minor: number;
7
+ currency: string;
8
+ return_url: string;
9
+ /** JSON string for customer context */
10
+ customer_ctx_json: string;
11
+ /** JSON string for metadata */
12
+ metadata_json: string;
8
13
  }
9
14
  export interface response {
10
15
  transaction_id: string;
11
16
  order_ref: string;
12
17
  subscriber_id: string;
13
18
  status: string;
19
+ status_page_url: string;
20
+ redirect_url: string;
21
+ checkout_token: string;
14
22
  created_at: string;
15
23
  }
16
24
  export declare const request: {
@@ -10,24 +10,42 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
11
  exports.response = exports.request = exports.protobufPackage = void 0;
12
12
  /* eslint-disable */
13
+ const long_1 = __importDefault(require("long"));
13
14
  const minimal_1 = __importDefault(require("protobufjs/minimal"));
14
15
  exports.protobufPackage = "eqxpayments.createorderv2";
15
16
  function createBaserequest() {
16
- return { subscriber_id: "", status_page_url: "", redirect_url: "", checkout_token: "" };
17
+ return {
18
+ subscriber_id: "",
19
+ order_ref: "",
20
+ amount_minor: 0,
21
+ currency: "",
22
+ return_url: "",
23
+ customer_ctx_json: "",
24
+ metadata_json: "",
25
+ };
17
26
  }
18
27
  exports.request = {
19
28
  encode(message, writer = minimal_1.default.Writer.create()) {
20
29
  if (message.subscriber_id !== "") {
21
30
  writer.uint32(10).string(message.subscriber_id);
22
31
  }
23
- if (message.status_page_url !== "") {
24
- writer.uint32(18).string(message.status_page_url);
32
+ if (message.order_ref !== "") {
33
+ writer.uint32(18).string(message.order_ref);
25
34
  }
26
- if (message.redirect_url !== "") {
27
- writer.uint32(26).string(message.redirect_url);
35
+ if (message.amount_minor !== 0) {
36
+ writer.uint32(24).int64(message.amount_minor);
28
37
  }
29
- if (message.checkout_token !== "") {
30
- writer.uint32(34).string(message.checkout_token);
38
+ if (message.currency !== "") {
39
+ writer.uint32(34).string(message.currency);
40
+ }
41
+ if (message.return_url !== "") {
42
+ writer.uint32(42).string(message.return_url);
43
+ }
44
+ if (message.customer_ctx_json !== "") {
45
+ writer.uint32(50).string(message.customer_ctx_json);
46
+ }
47
+ if (message.metadata_json !== "") {
48
+ writer.uint32(58).string(message.metadata_json);
31
49
  }
32
50
  return writer;
33
51
  },
@@ -48,19 +66,37 @@ exports.request = {
48
66
  if (tag !== 18) {
49
67
  break;
50
68
  }
51
- message.status_page_url = reader.string();
69
+ message.order_ref = reader.string();
52
70
  continue;
53
71
  case 3:
54
- if (tag !== 26) {
72
+ if (tag !== 24) {
55
73
  break;
56
74
  }
57
- message.redirect_url = reader.string();
75
+ message.amount_minor = longToNumber(reader.int64());
58
76
  continue;
59
77
  case 4:
60
78
  if (tag !== 34) {
61
79
  break;
62
80
  }
63
- message.checkout_token = reader.string();
81
+ message.currency = reader.string();
82
+ continue;
83
+ case 5:
84
+ if (tag !== 42) {
85
+ break;
86
+ }
87
+ message.return_url = reader.string();
88
+ continue;
89
+ case 6:
90
+ if (tag !== 50) {
91
+ break;
92
+ }
93
+ message.customer_ctx_json = reader.string();
94
+ continue;
95
+ case 7:
96
+ if (tag !== 58) {
97
+ break;
98
+ }
99
+ message.metadata_json = reader.string();
64
100
  continue;
65
101
  }
66
102
  if ((tag & 7) === 4 || tag === 0) {
@@ -73,9 +109,12 @@ exports.request = {
73
109
  fromJSON(object) {
74
110
  return {
75
111
  subscriber_id: isSet(object.subscriber_id) ? globalThis.String(object.subscriber_id) : "",
76
- status_page_url: isSet(object.status_page_url) ? globalThis.String(object.status_page_url) : "",
77
- redirect_url: isSet(object.redirect_url) ? globalThis.String(object.redirect_url) : "",
78
- checkout_token: isSet(object.checkout_token) ? globalThis.String(object.checkout_token) : "",
112
+ order_ref: isSet(object.order_ref) ? globalThis.String(object.order_ref) : "",
113
+ amount_minor: isSet(object.amount_minor) ? globalThis.Number(object.amount_minor) : 0,
114
+ currency: isSet(object.currency) ? globalThis.String(object.currency) : "",
115
+ return_url: isSet(object.return_url) ? globalThis.String(object.return_url) : "",
116
+ customer_ctx_json: isSet(object.customer_ctx_json) ? globalThis.String(object.customer_ctx_json) : "",
117
+ metadata_json: isSet(object.metadata_json) ? globalThis.String(object.metadata_json) : "",
79
118
  };
80
119
  },
81
120
  toJSON(message) {
@@ -83,14 +122,23 @@ exports.request = {
83
122
  if (message.subscriber_id !== "") {
84
123
  obj.subscriber_id = message.subscriber_id;
85
124
  }
86
- if (message.status_page_url !== "") {
87
- obj.status_page_url = message.status_page_url;
125
+ if (message.order_ref !== "") {
126
+ obj.order_ref = message.order_ref;
88
127
  }
89
- if (message.redirect_url !== "") {
90
- obj.redirect_url = message.redirect_url;
128
+ if (message.amount_minor !== 0) {
129
+ obj.amount_minor = Math.round(message.amount_minor);
91
130
  }
92
- if (message.checkout_token !== "") {
93
- obj.checkout_token = message.checkout_token;
131
+ if (message.currency !== "") {
132
+ obj.currency = message.currency;
133
+ }
134
+ if (message.return_url !== "") {
135
+ obj.return_url = message.return_url;
136
+ }
137
+ if (message.customer_ctx_json !== "") {
138
+ obj.customer_ctx_json = message.customer_ctx_json;
139
+ }
140
+ if (message.metadata_json !== "") {
141
+ obj.metadata_json = message.metadata_json;
94
142
  }
95
143
  return obj;
96
144
  },
@@ -100,14 +148,26 @@ exports.request = {
100
148
  fromPartial(object) {
101
149
  const message = createBaserequest();
102
150
  message.subscriber_id = object.subscriber_id ?? "";
103
- message.status_page_url = object.status_page_url ?? "";
104
- message.redirect_url = object.redirect_url ?? "";
105
- message.checkout_token = object.checkout_token ?? "";
151
+ message.order_ref = object.order_ref ?? "";
152
+ message.amount_minor = object.amount_minor ?? 0;
153
+ message.currency = object.currency ?? "";
154
+ message.return_url = object.return_url ?? "";
155
+ message.customer_ctx_json = object.customer_ctx_json ?? "";
156
+ message.metadata_json = object.metadata_json ?? "";
106
157
  return message;
107
158
  },
108
159
  };
109
160
  function createBaseresponse() {
110
- return { transaction_id: "", order_ref: "", subscriber_id: "", status: "", created_at: "" };
161
+ return {
162
+ transaction_id: "",
163
+ order_ref: "",
164
+ subscriber_id: "",
165
+ status: "",
166
+ status_page_url: "",
167
+ redirect_url: "",
168
+ checkout_token: "",
169
+ created_at: "",
170
+ };
111
171
  }
112
172
  exports.response = {
113
173
  encode(message, writer = minimal_1.default.Writer.create()) {
@@ -123,8 +183,17 @@ exports.response = {
123
183
  if (message.status !== "") {
124
184
  writer.uint32(34).string(message.status);
125
185
  }
186
+ if (message.status_page_url !== "") {
187
+ writer.uint32(42).string(message.status_page_url);
188
+ }
189
+ if (message.redirect_url !== "") {
190
+ writer.uint32(50).string(message.redirect_url);
191
+ }
192
+ if (message.checkout_token !== "") {
193
+ writer.uint32(58).string(message.checkout_token);
194
+ }
126
195
  if (message.created_at !== "") {
127
- writer.uint32(42).string(message.created_at);
196
+ writer.uint32(66).string(message.created_at);
128
197
  }
129
198
  return writer;
130
199
  },
@@ -163,6 +232,24 @@ exports.response = {
163
232
  if (tag !== 42) {
164
233
  break;
165
234
  }
235
+ message.status_page_url = reader.string();
236
+ continue;
237
+ case 6:
238
+ if (tag !== 50) {
239
+ break;
240
+ }
241
+ message.redirect_url = reader.string();
242
+ continue;
243
+ case 7:
244
+ if (tag !== 58) {
245
+ break;
246
+ }
247
+ message.checkout_token = reader.string();
248
+ continue;
249
+ case 8:
250
+ if (tag !== 66) {
251
+ break;
252
+ }
166
253
  message.created_at = reader.string();
167
254
  continue;
168
255
  }
@@ -179,6 +266,9 @@ exports.response = {
179
266
  order_ref: isSet(object.order_ref) ? globalThis.String(object.order_ref) : "",
180
267
  subscriber_id: isSet(object.subscriber_id) ? globalThis.String(object.subscriber_id) : "",
181
268
  status: isSet(object.status) ? globalThis.String(object.status) : "",
269
+ status_page_url: isSet(object.status_page_url) ? globalThis.String(object.status_page_url) : "",
270
+ redirect_url: isSet(object.redirect_url) ? globalThis.String(object.redirect_url) : "",
271
+ checkout_token: isSet(object.checkout_token) ? globalThis.String(object.checkout_token) : "",
182
272
  created_at: isSet(object.created_at) ? globalThis.String(object.created_at) : "",
183
273
  };
184
274
  },
@@ -196,6 +286,15 @@ exports.response = {
196
286
  if (message.status !== "") {
197
287
  obj.status = message.status;
198
288
  }
289
+ if (message.status_page_url !== "") {
290
+ obj.status_page_url = message.status_page_url;
291
+ }
292
+ if (message.redirect_url !== "") {
293
+ obj.redirect_url = message.redirect_url;
294
+ }
295
+ if (message.checkout_token !== "") {
296
+ obj.checkout_token = message.checkout_token;
297
+ }
199
298
  if (message.created_at !== "") {
200
299
  obj.created_at = message.created_at;
201
300
  }
@@ -210,10 +309,26 @@ exports.response = {
210
309
  message.order_ref = object.order_ref ?? "";
211
310
  message.subscriber_id = object.subscriber_id ?? "";
212
311
  message.status = object.status ?? "";
312
+ message.status_page_url = object.status_page_url ?? "";
313
+ message.redirect_url = object.redirect_url ?? "";
314
+ message.checkout_token = object.checkout_token ?? "";
213
315
  message.created_at = object.created_at ?? "";
214
316
  return message;
215
317
  },
216
318
  };
319
+ function longToNumber(long) {
320
+ if (long.gt(globalThis.Number.MAX_SAFE_INTEGER)) {
321
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
322
+ }
323
+ if (long.lt(globalThis.Number.MIN_SAFE_INTEGER)) {
324
+ throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
325
+ }
326
+ return long.toNumber();
327
+ }
328
+ if (minimal_1.default.util.Long !== long_1.default) {
329
+ minimal_1.default.util.Long = long_1.default;
330
+ minimal_1.default.configure();
331
+ }
217
332
  function isSet(value) {
218
333
  return value !== null && value !== undefined;
219
334
  }