quiver-protobuf-typescript 1.0.1692192575 → 1.0.1692199638

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.
@@ -12,6 +12,7 @@ export interface CourierJobConsignment {
12
12
  merchantName: string;
13
13
  lineItems: CourierJobLineItem[];
14
14
  qrCodeUrls: string[];
15
+ courierId?: number | undefined;
15
16
  }
16
17
 
17
18
  export interface CourierJobLineItem {
@@ -48,6 +49,7 @@ function createBaseCourierJobConsignment(): CourierJobConsignment {
48
49
  merchantName: "",
49
50
  lineItems: [],
50
51
  qrCodeUrls: [],
52
+ courierId: undefined,
51
53
  };
52
54
  }
53
55
 
@@ -77,6 +79,9 @@ export const CourierJobConsignment = {
77
79
  for (const v of message.qrCodeUrls) {
78
80
  writer.uint32(66).string(v!);
79
81
  }
82
+ if (message.courierId !== undefined) {
83
+ writer.uint32(72).int32(message.courierId);
84
+ }
80
85
  return writer;
81
86
  },
82
87
 
@@ -143,6 +148,13 @@ export const CourierJobConsignment = {
143
148
 
144
149
  message.qrCodeUrls.push(reader.string());
145
150
  continue;
151
+ case 9:
152
+ if (tag !== 72) {
153
+ break;
154
+ }
155
+
156
+ message.courierId = reader.int32();
157
+ continue;
146
158
  }
147
159
  if ((tag & 7) === 4 || tag === 0) {
148
160
  break;
@@ -164,6 +176,7 @@ export const CourierJobConsignment = {
164
176
  ? object.lineItems.map((e: any) => CourierJobLineItem.fromJSON(e))
165
177
  : [],
166
178
  qrCodeUrls: Array.isArray(object?.qrCodeUrls) ? object.qrCodeUrls.map((e: any) => String(e)) : [],
179
+ courierId: isSet(object.courierId) ? Number(object.courierId) : undefined,
167
180
  };
168
181
  },
169
182
 
@@ -193,6 +206,9 @@ export const CourierJobConsignment = {
193
206
  if (message.qrCodeUrls?.length) {
194
207
  obj.qrCodeUrls = message.qrCodeUrls;
195
208
  }
209
+ if (message.courierId !== undefined) {
210
+ obj.courierId = Math.round(message.courierId);
211
+ }
196
212
  return obj;
197
213
  },
198
214
 
@@ -209,6 +225,7 @@ export const CourierJobConsignment = {
209
225
  message.merchantName = object.merchantName ?? "";
210
226
  message.lineItems = object.lineItems?.map((e) => CourierJobLineItem.fromPartial(e)) || [];
211
227
  message.qrCodeUrls = object.qrCodeUrls?.map((e) => e) || [];
228
+ message.courierId = object.courierId ?? undefined;
212
229
  return message;
213
230
  },
214
231
  };
@@ -20,7 +20,7 @@ export interface CreateCourierConsignmentRequest {
20
20
  }
21
21
 
22
22
  export interface QueryCourierConsignmentsRequest {
23
- courierId: number;
23
+ courierIds: number[];
24
24
  }
25
25
 
26
26
  export interface QueryCourierConsignmentsResponse {
@@ -256,14 +256,16 @@ export const CreateCourierConsignmentRequest = {
256
256
  };
257
257
 
258
258
  function createBaseQueryCourierConsignmentsRequest(): QueryCourierConsignmentsRequest {
259
- return { courierId: 0 };
259
+ return { courierIds: [] };
260
260
  }
261
261
 
262
262
  export const QueryCourierConsignmentsRequest = {
263
263
  encode(message: QueryCourierConsignmentsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
264
- if (message.courierId !== 0) {
265
- writer.uint32(8).int32(message.courierId);
264
+ writer.uint32(10).fork();
265
+ for (const v of message.courierIds) {
266
+ writer.int32(v);
266
267
  }
268
+ writer.ldelim();
267
269
  return writer;
268
270
  },
269
271
 
@@ -275,12 +277,22 @@ export const QueryCourierConsignmentsRequest = {
275
277
  const tag = reader.uint32();
276
278
  switch (tag >>> 3) {
277
279
  case 1:
278
- if (tag !== 8) {
279
- break;
280
+ if (tag === 8) {
281
+ message.courierIds.push(reader.int32());
282
+
283
+ continue;
280
284
  }
281
285
 
282
- message.courierId = reader.int32();
283
- continue;
286
+ if (tag === 10) {
287
+ const end2 = reader.uint32() + reader.pos;
288
+ while (reader.pos < end2) {
289
+ message.courierIds.push(reader.int32());
290
+ }
291
+
292
+ continue;
293
+ }
294
+
295
+ break;
284
296
  }
285
297
  if ((tag & 7) === 4 || tag === 0) {
286
298
  break;
@@ -291,13 +303,13 @@ export const QueryCourierConsignmentsRequest = {
291
303
  },
292
304
 
293
305
  fromJSON(object: any): QueryCourierConsignmentsRequest {
294
- return { courierId: isSet(object.courierId) ? Number(object.courierId) : 0 };
306
+ return { courierIds: Array.isArray(object?.courierIds) ? object.courierIds.map((e: any) => Number(e)) : [] };
295
307
  },
296
308
 
297
309
  toJSON(message: QueryCourierConsignmentsRequest): unknown {
298
310
  const obj: any = {};
299
- if (message.courierId !== 0) {
300
- obj.courierId = Math.round(message.courierId);
311
+ if (message.courierIds?.length) {
312
+ obj.courierIds = message.courierIds.map((e) => Math.round(e));
301
313
  }
302
314
  return obj;
303
315
  },
@@ -309,7 +321,7 @@ export const QueryCourierConsignmentsRequest = {
309
321
  object: I,
310
322
  ): QueryCourierConsignmentsRequest {
311
323
  const message = createBaseQueryCourierConsignmentsRequest();
312
- message.courierId = object.courierId ?? 0;
324
+ message.courierIds = object.courierIds?.map((e) => e) || [];
313
325
  return message;
314
326
  },
315
327
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quiver-protobuf-typescript",
3
- "version": "1.0.1692192575",
3
+ "version": "1.0.1692199638",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",