@vectora/contracts 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 (61) hide show
  1. package/LICENSE.md +25 -0
  2. package/dist/events/auth/index.d.ts +1 -0
  3. package/dist/events/auth/index.js +17 -0
  4. package/dist/events/auth/verification-request.interface.d.ts +5 -0
  5. package/dist/events/auth/verification-request.interface.js +2 -0
  6. package/dist/events/index.d.ts +1 -0
  7. package/dist/events/index.js +17 -0
  8. package/dist/index.d.ts +3 -0
  9. package/dist/index.js +19 -0
  10. package/dist/proto/index.d.ts +1 -0
  11. package/dist/proto/index.js +17 -0
  12. package/dist/proto/paths.d.ts +18 -0
  13. package/dist/proto/paths.js +27 -0
  14. package/dist/utils/data-transformer.util.d.ts +55 -0
  15. package/dist/utils/data-transformer.util.js +141 -0
  16. package/dist/utils/index.d.ts +1 -0
  17. package/dist/utils/index.js +17 -0
  18. package/gen/go/mapbox-direction-v1.pb.go +621 -0
  19. package/gen/go/mapbox-geocode-v1.pb.go +473 -0
  20. package/gen/go/mapbox-matrix-v1.pb.go +337 -0
  21. package/gen/go/mapbox-optimization-v1.pb.go +422 -0
  22. package/gen/go/mapbox-search-v1.pb.go +699 -0
  23. package/gen/ts/common-geocode-v1.ts +368 -0
  24. package/gen/ts/common-pagination-v1.ts +713 -0
  25. package/gen/ts/fleet-truck-v1.ts +1102 -0
  26. package/gen/ts/fleet-unit-v1.ts +9 -0
  27. package/gen/ts/google/protobuf/field_mask.ts +295 -0
  28. package/gen/ts/google/protobuf/wrappers.ts +544 -0
  29. package/gen/ts/identify-account-v1.ts +9 -0
  30. package/gen/ts/identify-auth-v1.ts +9 -0
  31. package/gen/ts/identify-company-v1.ts +1025 -0
  32. package/gen/ts/identify-role-v1.ts +9 -0
  33. package/gen/ts/identify-user-v1.ts +9 -0
  34. package/gen/ts/mapbox-direction-v1.ts +718 -0
  35. package/gen/ts/mapbox-geocode-v1.ts +511 -0
  36. package/gen/ts/mapbox-matrix-v1.ts +369 -0
  37. package/gen/ts/mapbox-optimization-v1.ts +472 -0
  38. package/gen/ts/mapbox-search-v1.ts +803 -0
  39. package/gen/ts/shipments-freight-v1.ts +9 -0
  40. package/gen/ts/shipments-loads-v1.ts +9 -0
  41. package/gen/ts/shipments-rate-v1.ts +9 -0
  42. package/gen/ts/shipments-stop-v1.ts +9 -0
  43. package/package.json +40 -0
  44. package/proto/common-geocode-v1.proto +10 -0
  45. package/proto/common-pagination-v1.proto +39 -0
  46. package/proto/fleet-truck-v1.proto +145 -0
  47. package/proto/fleet-unit-v1.proto +3 -0
  48. package/proto/identify-account-v1.proto +3 -0
  49. package/proto/identify-auth-v1.proto +3 -0
  50. package/proto/identify-company-v1.proto +114 -0
  51. package/proto/identify-role-v1.proto +3 -0
  52. package/proto/identify-user-v1.proto +3 -0
  53. package/proto/mapbox-direction-v1.proto +61 -0
  54. package/proto/mapbox-geocode-v1.proto +47 -0
  55. package/proto/mapbox-matrix-v1.proto +34 -0
  56. package/proto/mapbox-optimization-v1.proto +43 -0
  57. package/proto/mapbox-search-v1.proto +68 -0
  58. package/proto/shipments-freight-v1.proto +3 -0
  59. package/proto/shipments-loads-v1.proto +3 -0
  60. package/proto/shipments-rate-v1.proto +3 -0
  61. package/proto/shipments-stop-v1.proto +3 -0
@@ -0,0 +1,544 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.2
4
+ // protoc v3.21.12
5
+ // source: google/protobuf/wrappers.proto
6
+
7
+ /* eslint-disable */
8
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
9
+
10
+ export const protobufPackage = "google.protobuf";
11
+
12
+ /**
13
+ * Wrapper message for `double`.
14
+ *
15
+ * The JSON representation for `DoubleValue` is JSON number.
16
+ */
17
+ export interface DoubleValue {
18
+ /** The double value. */
19
+ value: number;
20
+ }
21
+
22
+ /**
23
+ * Wrapper message for `float`.
24
+ *
25
+ * The JSON representation for `FloatValue` is JSON number.
26
+ */
27
+ export interface FloatValue {
28
+ /** The float value. */
29
+ value: number;
30
+ }
31
+
32
+ /**
33
+ * Wrapper message for `int64`.
34
+ *
35
+ * The JSON representation for `Int64Value` is JSON string.
36
+ */
37
+ export interface Int64Value {
38
+ /** The int64 value. */
39
+ value: number;
40
+ }
41
+
42
+ /**
43
+ * Wrapper message for `uint64`.
44
+ *
45
+ * The JSON representation for `UInt64Value` is JSON string.
46
+ */
47
+ export interface UInt64Value {
48
+ /** The uint64 value. */
49
+ value: number;
50
+ }
51
+
52
+ /**
53
+ * Wrapper message for `int32`.
54
+ *
55
+ * The JSON representation for `Int32Value` is JSON number.
56
+ */
57
+ export interface Int32Value {
58
+ /** The int32 value. */
59
+ value: number;
60
+ }
61
+
62
+ /**
63
+ * Wrapper message for `uint32`.
64
+ *
65
+ * The JSON representation for `UInt32Value` is JSON number.
66
+ */
67
+ export interface UInt32Value {
68
+ /** The uint32 value. */
69
+ value: number;
70
+ }
71
+
72
+ /**
73
+ * Wrapper message for `bool`.
74
+ *
75
+ * The JSON representation for `BoolValue` is JSON `true` and `false`.
76
+ */
77
+ export interface BoolValue {
78
+ /** The bool value. */
79
+ value: boolean;
80
+ }
81
+
82
+ /**
83
+ * Wrapper message for `string`.
84
+ *
85
+ * The JSON representation for `StringValue` is JSON string.
86
+ */
87
+ export interface StringValue {
88
+ /** The string value. */
89
+ value: string;
90
+ }
91
+
92
+ /**
93
+ * Wrapper message for `bytes`.
94
+ *
95
+ * The JSON representation for `BytesValue` is JSON string.
96
+ */
97
+ export interface BytesValue {
98
+ /** The bytes value. */
99
+ value: Uint8Array;
100
+ }
101
+
102
+ function createBaseDoubleValue(): DoubleValue {
103
+ return { value: 0 };
104
+ }
105
+
106
+ export const DoubleValue: MessageFns<DoubleValue> = {
107
+ encode(message: DoubleValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
108
+ if (message.value !== 0) {
109
+ writer.uint32(9).double(message.value);
110
+ }
111
+ return writer;
112
+ },
113
+
114
+ decode(input: BinaryReader | Uint8Array, length?: number): DoubleValue {
115
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
116
+ const end = length === undefined ? reader.len : reader.pos + length;
117
+ const message = createBaseDoubleValue();
118
+ while (reader.pos < end) {
119
+ const tag = reader.uint32();
120
+ switch (tag >>> 3) {
121
+ case 1: {
122
+ if (tag !== 9) {
123
+ break;
124
+ }
125
+
126
+ message.value = reader.double();
127
+ continue;
128
+ }
129
+ }
130
+ if ((tag & 7) === 4 || tag === 0) {
131
+ break;
132
+ }
133
+ reader.skip(tag & 7);
134
+ }
135
+ return message;
136
+ },
137
+
138
+ create<I extends Exact<DeepPartial<DoubleValue>, I>>(base?: I): DoubleValue {
139
+ return DoubleValue.fromPartial(base ?? ({} as any));
140
+ },
141
+ fromPartial<I extends Exact<DeepPartial<DoubleValue>, I>>(object: I): DoubleValue {
142
+ const message = createBaseDoubleValue();
143
+ message.value = object.value ?? 0;
144
+ return message;
145
+ },
146
+ };
147
+
148
+ function createBaseFloatValue(): FloatValue {
149
+ return { value: 0 };
150
+ }
151
+
152
+ export const FloatValue: MessageFns<FloatValue> = {
153
+ encode(message: FloatValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
154
+ if (message.value !== 0) {
155
+ writer.uint32(13).float(message.value);
156
+ }
157
+ return writer;
158
+ },
159
+
160
+ decode(input: BinaryReader | Uint8Array, length?: number): FloatValue {
161
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
162
+ const end = length === undefined ? reader.len : reader.pos + length;
163
+ const message = createBaseFloatValue();
164
+ while (reader.pos < end) {
165
+ const tag = reader.uint32();
166
+ switch (tag >>> 3) {
167
+ case 1: {
168
+ if (tag !== 13) {
169
+ break;
170
+ }
171
+
172
+ message.value = reader.float();
173
+ continue;
174
+ }
175
+ }
176
+ if ((tag & 7) === 4 || tag === 0) {
177
+ break;
178
+ }
179
+ reader.skip(tag & 7);
180
+ }
181
+ return message;
182
+ },
183
+
184
+ create<I extends Exact<DeepPartial<FloatValue>, I>>(base?: I): FloatValue {
185
+ return FloatValue.fromPartial(base ?? ({} as any));
186
+ },
187
+ fromPartial<I extends Exact<DeepPartial<FloatValue>, I>>(object: I): FloatValue {
188
+ const message = createBaseFloatValue();
189
+ message.value = object.value ?? 0;
190
+ return message;
191
+ },
192
+ };
193
+
194
+ function createBaseInt64Value(): Int64Value {
195
+ return { value: 0 };
196
+ }
197
+
198
+ export const Int64Value: MessageFns<Int64Value> = {
199
+ encode(message: Int64Value, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
200
+ if (message.value !== 0) {
201
+ writer.uint32(8).int64(message.value);
202
+ }
203
+ return writer;
204
+ },
205
+
206
+ decode(input: BinaryReader | Uint8Array, length?: number): Int64Value {
207
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
208
+ const end = length === undefined ? reader.len : reader.pos + length;
209
+ const message = createBaseInt64Value();
210
+ while (reader.pos < end) {
211
+ const tag = reader.uint32();
212
+ switch (tag >>> 3) {
213
+ case 1: {
214
+ if (tag !== 8) {
215
+ break;
216
+ }
217
+
218
+ message.value = longToNumber(reader.int64());
219
+ continue;
220
+ }
221
+ }
222
+ if ((tag & 7) === 4 || tag === 0) {
223
+ break;
224
+ }
225
+ reader.skip(tag & 7);
226
+ }
227
+ return message;
228
+ },
229
+
230
+ create<I extends Exact<DeepPartial<Int64Value>, I>>(base?: I): Int64Value {
231
+ return Int64Value.fromPartial(base ?? ({} as any));
232
+ },
233
+ fromPartial<I extends Exact<DeepPartial<Int64Value>, I>>(object: I): Int64Value {
234
+ const message = createBaseInt64Value();
235
+ message.value = object.value ?? 0;
236
+ return message;
237
+ },
238
+ };
239
+
240
+ function createBaseUInt64Value(): UInt64Value {
241
+ return { value: 0 };
242
+ }
243
+
244
+ export const UInt64Value: MessageFns<UInt64Value> = {
245
+ encode(message: UInt64Value, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
246
+ if (message.value !== 0) {
247
+ writer.uint32(8).uint64(message.value);
248
+ }
249
+ return writer;
250
+ },
251
+
252
+ decode(input: BinaryReader | Uint8Array, length?: number): UInt64Value {
253
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
254
+ const end = length === undefined ? reader.len : reader.pos + length;
255
+ const message = createBaseUInt64Value();
256
+ while (reader.pos < end) {
257
+ const tag = reader.uint32();
258
+ switch (tag >>> 3) {
259
+ case 1: {
260
+ if (tag !== 8) {
261
+ break;
262
+ }
263
+
264
+ message.value = longToNumber(reader.uint64());
265
+ continue;
266
+ }
267
+ }
268
+ if ((tag & 7) === 4 || tag === 0) {
269
+ break;
270
+ }
271
+ reader.skip(tag & 7);
272
+ }
273
+ return message;
274
+ },
275
+
276
+ create<I extends Exact<DeepPartial<UInt64Value>, I>>(base?: I): UInt64Value {
277
+ return UInt64Value.fromPartial(base ?? ({} as any));
278
+ },
279
+ fromPartial<I extends Exact<DeepPartial<UInt64Value>, I>>(object: I): UInt64Value {
280
+ const message = createBaseUInt64Value();
281
+ message.value = object.value ?? 0;
282
+ return message;
283
+ },
284
+ };
285
+
286
+ function createBaseInt32Value(): Int32Value {
287
+ return { value: 0 };
288
+ }
289
+
290
+ export const Int32Value: MessageFns<Int32Value> = {
291
+ encode(message: Int32Value, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
292
+ if (message.value !== 0) {
293
+ writer.uint32(8).int32(message.value);
294
+ }
295
+ return writer;
296
+ },
297
+
298
+ decode(input: BinaryReader | Uint8Array, length?: number): Int32Value {
299
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
300
+ const end = length === undefined ? reader.len : reader.pos + length;
301
+ const message = createBaseInt32Value();
302
+ while (reader.pos < end) {
303
+ const tag = reader.uint32();
304
+ switch (tag >>> 3) {
305
+ case 1: {
306
+ if (tag !== 8) {
307
+ break;
308
+ }
309
+
310
+ message.value = reader.int32();
311
+ continue;
312
+ }
313
+ }
314
+ if ((tag & 7) === 4 || tag === 0) {
315
+ break;
316
+ }
317
+ reader.skip(tag & 7);
318
+ }
319
+ return message;
320
+ },
321
+
322
+ create<I extends Exact<DeepPartial<Int32Value>, I>>(base?: I): Int32Value {
323
+ return Int32Value.fromPartial(base ?? ({} as any));
324
+ },
325
+ fromPartial<I extends Exact<DeepPartial<Int32Value>, I>>(object: I): Int32Value {
326
+ const message = createBaseInt32Value();
327
+ message.value = object.value ?? 0;
328
+ return message;
329
+ },
330
+ };
331
+
332
+ function createBaseUInt32Value(): UInt32Value {
333
+ return { value: 0 };
334
+ }
335
+
336
+ export const UInt32Value: MessageFns<UInt32Value> = {
337
+ encode(message: UInt32Value, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
338
+ if (message.value !== 0) {
339
+ writer.uint32(8).uint32(message.value);
340
+ }
341
+ return writer;
342
+ },
343
+
344
+ decode(input: BinaryReader | Uint8Array, length?: number): UInt32Value {
345
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
346
+ const end = length === undefined ? reader.len : reader.pos + length;
347
+ const message = createBaseUInt32Value();
348
+ while (reader.pos < end) {
349
+ const tag = reader.uint32();
350
+ switch (tag >>> 3) {
351
+ case 1: {
352
+ if (tag !== 8) {
353
+ break;
354
+ }
355
+
356
+ message.value = reader.uint32();
357
+ continue;
358
+ }
359
+ }
360
+ if ((tag & 7) === 4 || tag === 0) {
361
+ break;
362
+ }
363
+ reader.skip(tag & 7);
364
+ }
365
+ return message;
366
+ },
367
+
368
+ create<I extends Exact<DeepPartial<UInt32Value>, I>>(base?: I): UInt32Value {
369
+ return UInt32Value.fromPartial(base ?? ({} as any));
370
+ },
371
+ fromPartial<I extends Exact<DeepPartial<UInt32Value>, I>>(object: I): UInt32Value {
372
+ const message = createBaseUInt32Value();
373
+ message.value = object.value ?? 0;
374
+ return message;
375
+ },
376
+ };
377
+
378
+ function createBaseBoolValue(): BoolValue {
379
+ return { value: false };
380
+ }
381
+
382
+ export const BoolValue: MessageFns<BoolValue> = {
383
+ encode(message: BoolValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
384
+ if (message.value !== false) {
385
+ writer.uint32(8).bool(message.value);
386
+ }
387
+ return writer;
388
+ },
389
+
390
+ decode(input: BinaryReader | Uint8Array, length?: number): BoolValue {
391
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
392
+ const end = length === undefined ? reader.len : reader.pos + length;
393
+ const message = createBaseBoolValue();
394
+ while (reader.pos < end) {
395
+ const tag = reader.uint32();
396
+ switch (tag >>> 3) {
397
+ case 1: {
398
+ if (tag !== 8) {
399
+ break;
400
+ }
401
+
402
+ message.value = reader.bool();
403
+ continue;
404
+ }
405
+ }
406
+ if ((tag & 7) === 4 || tag === 0) {
407
+ break;
408
+ }
409
+ reader.skip(tag & 7);
410
+ }
411
+ return message;
412
+ },
413
+
414
+ create<I extends Exact<DeepPartial<BoolValue>, I>>(base?: I): BoolValue {
415
+ return BoolValue.fromPartial(base ?? ({} as any));
416
+ },
417
+ fromPartial<I extends Exact<DeepPartial<BoolValue>, I>>(object: I): BoolValue {
418
+ const message = createBaseBoolValue();
419
+ message.value = object.value ?? false;
420
+ return message;
421
+ },
422
+ };
423
+
424
+ function createBaseStringValue(): StringValue {
425
+ return { value: "" };
426
+ }
427
+
428
+ export const StringValue: MessageFns<StringValue> = {
429
+ encode(message: StringValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
430
+ if (message.value !== "") {
431
+ writer.uint32(10).string(message.value);
432
+ }
433
+ return writer;
434
+ },
435
+
436
+ decode(input: BinaryReader | Uint8Array, length?: number): StringValue {
437
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
438
+ const end = length === undefined ? reader.len : reader.pos + length;
439
+ const message = createBaseStringValue();
440
+ while (reader.pos < end) {
441
+ const tag = reader.uint32();
442
+ switch (tag >>> 3) {
443
+ case 1: {
444
+ if (tag !== 10) {
445
+ break;
446
+ }
447
+
448
+ message.value = reader.string();
449
+ continue;
450
+ }
451
+ }
452
+ if ((tag & 7) === 4 || tag === 0) {
453
+ break;
454
+ }
455
+ reader.skip(tag & 7);
456
+ }
457
+ return message;
458
+ },
459
+
460
+ create<I extends Exact<DeepPartial<StringValue>, I>>(base?: I): StringValue {
461
+ return StringValue.fromPartial(base ?? ({} as any));
462
+ },
463
+ fromPartial<I extends Exact<DeepPartial<StringValue>, I>>(object: I): StringValue {
464
+ const message = createBaseStringValue();
465
+ message.value = object.value ?? "";
466
+ return message;
467
+ },
468
+ };
469
+
470
+ function createBaseBytesValue(): BytesValue {
471
+ return { value: new Uint8Array(0) };
472
+ }
473
+
474
+ export const BytesValue: MessageFns<BytesValue> = {
475
+ encode(message: BytesValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
476
+ if (message.value.length !== 0) {
477
+ writer.uint32(10).bytes(message.value);
478
+ }
479
+ return writer;
480
+ },
481
+
482
+ decode(input: BinaryReader | Uint8Array, length?: number): BytesValue {
483
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
484
+ const end = length === undefined ? reader.len : reader.pos + length;
485
+ const message = createBaseBytesValue();
486
+ while (reader.pos < end) {
487
+ const tag = reader.uint32();
488
+ switch (tag >>> 3) {
489
+ case 1: {
490
+ if (tag !== 10) {
491
+ break;
492
+ }
493
+
494
+ message.value = reader.bytes();
495
+ continue;
496
+ }
497
+ }
498
+ if ((tag & 7) === 4 || tag === 0) {
499
+ break;
500
+ }
501
+ reader.skip(tag & 7);
502
+ }
503
+ return message;
504
+ },
505
+
506
+ create<I extends Exact<DeepPartial<BytesValue>, I>>(base?: I): BytesValue {
507
+ return BytesValue.fromPartial(base ?? ({} as any));
508
+ },
509
+ fromPartial<I extends Exact<DeepPartial<BytesValue>, I>>(object: I): BytesValue {
510
+ const message = createBaseBytesValue();
511
+ message.value = object.value ?? new Uint8Array(0);
512
+ return message;
513
+ },
514
+ };
515
+
516
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
517
+
518
+ export type DeepPartial<T> = T extends Builtin ? T
519
+ : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
520
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
521
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
522
+ : Partial<T>;
523
+
524
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
525
+ export type Exact<P, I extends P> = P extends Builtin ? P
526
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
527
+
528
+ function longToNumber(int64: { toString(): string }): number {
529
+ const num = globalThis.Number(int64.toString());
530
+ if (num > globalThis.Number.MAX_SAFE_INTEGER) {
531
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
532
+ }
533
+ if (num < globalThis.Number.MIN_SAFE_INTEGER) {
534
+ throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
535
+ }
536
+ return num;
537
+ }
538
+
539
+ export interface MessageFns<T> {
540
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
541
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
542
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
543
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
544
+ }
@@ -0,0 +1,9 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.2
4
+ // protoc v3.21.12
5
+ // source: identify-account-v1.proto
6
+
7
+ /* eslint-disable */
8
+
9
+ export const protobufPackage = "account.v1";
@@ -0,0 +1,9 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.2
4
+ // protoc v3.21.12
5
+ // source: identify-auth-v1.proto
6
+
7
+ /* eslint-disable */
8
+
9
+ export const protobufPackage = "auth.v1";