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