@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,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: fleet-unit-v1.proto
6
+
7
+ /* eslint-disable */
8
+
9
+ export const protobufPackage = "unit.v1";
@@ -0,0 +1,295 @@
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/field_mask.proto
6
+
7
+ /* eslint-disable */
8
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
9
+
10
+ export const protobufPackage = "google.protobuf";
11
+
12
+ /**
13
+ * `FieldMask` represents a set of symbolic field paths, for example:
14
+ *
15
+ * paths: "f.a"
16
+ * paths: "f.b.d"
17
+ *
18
+ * Here `f` represents a field in some root message, `a` and `b`
19
+ * fields in the message found in `f`, and `d` a field found in the
20
+ * message in `f.b`.
21
+ *
22
+ * Field masks are used to specify a subset of fields that should be
23
+ * returned by a get operation or modified by an update operation.
24
+ * Field masks also have a custom JSON encoding (see below).
25
+ *
26
+ * # Field Masks in Projections
27
+ *
28
+ * When used in the context of a projection, a response message or
29
+ * sub-message is filtered by the API to only contain those fields as
30
+ * specified in the mask. For example, if the mask in the previous
31
+ * example is applied to a response message as follows:
32
+ *
33
+ * f {
34
+ * a : 22
35
+ * b {
36
+ * d : 1
37
+ * x : 2
38
+ * }
39
+ * y : 13
40
+ * }
41
+ * z: 8
42
+ *
43
+ * The result will not contain specific values for fields x,y and z
44
+ * (their value will be set to the default, and omitted in proto text
45
+ * output):
46
+ *
47
+ * f {
48
+ * a : 22
49
+ * b {
50
+ * d : 1
51
+ * }
52
+ * }
53
+ *
54
+ * A repeated field is not allowed except at the last position of a
55
+ * paths string.
56
+ *
57
+ * If a FieldMask object is not present in a get operation, the
58
+ * operation applies to all fields (as if a FieldMask of all fields
59
+ * had been specified).
60
+ *
61
+ * Note that a field mask does not necessarily apply to the
62
+ * top-level response message. In case of a REST get operation, the
63
+ * field mask applies directly to the response, but in case of a REST
64
+ * list operation, the mask instead applies to each individual message
65
+ * in the returned resource list. In case of a REST custom method,
66
+ * other definitions may be used. Where the mask applies will be
67
+ * clearly documented together with its declaration in the API. In
68
+ * any case, the effect on the returned resource/resources is required
69
+ * behavior for APIs.
70
+ *
71
+ * # Field Masks in Update Operations
72
+ *
73
+ * A field mask in update operations specifies which fields of the
74
+ * targeted resource are going to be updated. The API is required
75
+ * to only change the values of the fields as specified in the mask
76
+ * and leave the others untouched. If a resource is passed in to
77
+ * describe the updated values, the API ignores the values of all
78
+ * fields not covered by the mask.
79
+ *
80
+ * If a repeated field is specified for an update operation, new values will
81
+ * be appended to the existing repeated field in the target resource. Note that
82
+ * a repeated field is only allowed in the last position of a `paths` string.
83
+ *
84
+ * If a sub-message is specified in the last position of the field mask for an
85
+ * update operation, then new value will be merged into the existing sub-message
86
+ * in the target resource.
87
+ *
88
+ * For example, given the target message:
89
+ *
90
+ * f {
91
+ * b {
92
+ * d: 1
93
+ * x: 2
94
+ * }
95
+ * c: [1]
96
+ * }
97
+ *
98
+ * And an update message:
99
+ *
100
+ * f {
101
+ * b {
102
+ * d: 10
103
+ * }
104
+ * c: [2]
105
+ * }
106
+ *
107
+ * then if the field mask is:
108
+ *
109
+ * paths: ["f.b", "f.c"]
110
+ *
111
+ * then the result will be:
112
+ *
113
+ * f {
114
+ * b {
115
+ * d: 10
116
+ * x: 2
117
+ * }
118
+ * c: [1, 2]
119
+ * }
120
+ *
121
+ * An implementation may provide options to override this default behavior for
122
+ * repeated and message fields.
123
+ *
124
+ * In order to reset a field's value to the default, the field must
125
+ * be in the mask and set to the default value in the provided resource.
126
+ * Hence, in order to reset all fields of a resource, provide a default
127
+ * instance of the resource and set all fields in the mask, or do
128
+ * not provide a mask as described below.
129
+ *
130
+ * If a field mask is not present on update, the operation applies to
131
+ * all fields (as if a field mask of all fields has been specified).
132
+ * Note that in the presence of schema evolution, this may mean that
133
+ * fields the client does not know and has therefore not filled into
134
+ * the request will be reset to their default. If this is unwanted
135
+ * behavior, a specific service may require a client to always specify
136
+ * a field mask, producing an error if not.
137
+ *
138
+ * As with get operations, the location of the resource which
139
+ * describes the updated values in the request message depends on the
140
+ * operation kind. In any case, the effect of the field mask is
141
+ * required to be honored by the API.
142
+ *
143
+ * ## Considerations for HTTP REST
144
+ *
145
+ * The HTTP kind of an update operation which uses a field mask must
146
+ * be set to PATCH instead of PUT in order to satisfy HTTP semantics
147
+ * (PUT must only be used for full updates).
148
+ *
149
+ * # JSON Encoding of Field Masks
150
+ *
151
+ * In JSON, a field mask is encoded as a single string where paths are
152
+ * separated by a comma. Fields name in each path are converted
153
+ * to/from lower-camel naming conventions.
154
+ *
155
+ * As an example, consider the following message declarations:
156
+ *
157
+ * message Profile {
158
+ * User user = 1;
159
+ * Photo photo = 2;
160
+ * }
161
+ * message User {
162
+ * string display_name = 1;
163
+ * string address = 2;
164
+ * }
165
+ *
166
+ * In proto a field mask for `Profile` may look as such:
167
+ *
168
+ * mask {
169
+ * paths: "user.display_name"
170
+ * paths: "photo"
171
+ * }
172
+ *
173
+ * In JSON, the same mask is represented as below:
174
+ *
175
+ * {
176
+ * mask: "user.displayName,photo"
177
+ * }
178
+ *
179
+ * # Field Masks and Oneof Fields
180
+ *
181
+ * Field masks treat fields in oneofs just as regular fields. Consider the
182
+ * following message:
183
+ *
184
+ * message SampleMessage {
185
+ * oneof test_oneof {
186
+ * string name = 4;
187
+ * SubMessage sub_message = 9;
188
+ * }
189
+ * }
190
+ *
191
+ * The field mask can be:
192
+ *
193
+ * mask {
194
+ * paths: "name"
195
+ * }
196
+ *
197
+ * Or:
198
+ *
199
+ * mask {
200
+ * paths: "sub_message"
201
+ * }
202
+ *
203
+ * Note that oneof type names ("test_oneof" in this case) cannot be used in
204
+ * paths.
205
+ *
206
+ * ## Field Mask Verification
207
+ *
208
+ * The implementation of any API method which has a FieldMask type field in the
209
+ * request should verify the included field paths, and return an
210
+ * `INVALID_ARGUMENT` error if any path is unmappable.
211
+ */
212
+ export interface FieldMask {
213
+ /** The set of field mask paths. */
214
+ paths: string[];
215
+ }
216
+
217
+ function createBaseFieldMask(): FieldMask {
218
+ return { paths: [] };
219
+ }
220
+
221
+ export const FieldMask: MessageFns<FieldMask> & FieldMaskWrapperFns = {
222
+ encode(message: FieldMask, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
223
+ for (const v of message.paths) {
224
+ writer.uint32(10).string(v!);
225
+ }
226
+ return writer;
227
+ },
228
+
229
+ decode(input: BinaryReader | Uint8Array, length?: number): FieldMask {
230
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
231
+ const end = length === undefined ? reader.len : reader.pos + length;
232
+ const message = createBaseFieldMask();
233
+ while (reader.pos < end) {
234
+ const tag = reader.uint32();
235
+ switch (tag >>> 3) {
236
+ case 1: {
237
+ if (tag !== 10) {
238
+ break;
239
+ }
240
+
241
+ message.paths.push(reader.string());
242
+ continue;
243
+ }
244
+ }
245
+ if ((tag & 7) === 4 || tag === 0) {
246
+ break;
247
+ }
248
+ reader.skip(tag & 7);
249
+ }
250
+ return message;
251
+ },
252
+
253
+ create<I extends Exact<DeepPartial<FieldMask>, I>>(base?: I): FieldMask {
254
+ return FieldMask.fromPartial(base ?? ({} as any));
255
+ },
256
+ fromPartial<I extends Exact<DeepPartial<FieldMask>, I>>(object: I): FieldMask {
257
+ const message = createBaseFieldMask();
258
+ message.paths = object.paths?.map((e) => e) || [];
259
+ return message;
260
+ },
261
+
262
+ wrap(paths: string[]): FieldMask {
263
+ const result = createBaseFieldMask();
264
+ result.paths = paths;
265
+ return result;
266
+ },
267
+
268
+ unwrap(message: FieldMask): string[] {
269
+ return message.paths;
270
+ },
271
+ };
272
+
273
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
274
+
275
+ export type DeepPartial<T> = T extends Builtin ? T
276
+ : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
277
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
278
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
279
+ : Partial<T>;
280
+
281
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
282
+ export type Exact<P, I extends P> = P extends Builtin ? P
283
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
284
+
285
+ export interface MessageFns<T> {
286
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
287
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
288
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
289
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
290
+ }
291
+
292
+ export interface FieldMaskWrapperFns {
293
+ wrap(paths: string[]): FieldMask;
294
+ unwrap(message: FieldMask): string[];
295
+ }