@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,803 @@
|
|
|
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-search-v1.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
9
|
+
import { ContextItem, Coordinates, Geometry } from "./common-geocode-v1";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "search.v1";
|
|
12
|
+
|
|
13
|
+
export interface SearchSuggestRequest {
|
|
14
|
+
q: string;
|
|
15
|
+
sessionToken?: string | undefined;
|
|
16
|
+
limit?: number | undefined;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface SearchSuggestResponse {
|
|
20
|
+
suggestions: SearchSuggestion[];
|
|
21
|
+
attribution: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface SearchSuggestion {
|
|
25
|
+
name: string;
|
|
26
|
+
mapboxId: string;
|
|
27
|
+
featureType: string;
|
|
28
|
+
placeName: string;
|
|
29
|
+
context: SearchContext | undefined;
|
|
30
|
+
language: string;
|
|
31
|
+
maki?: string | undefined;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface SearchRetrieveResponse {
|
|
35
|
+
type: string;
|
|
36
|
+
features: SearchFeature[];
|
|
37
|
+
attribution: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface SearchFeature {
|
|
41
|
+
id: string;
|
|
42
|
+
type: string;
|
|
43
|
+
geometry: Geometry | undefined;
|
|
44
|
+
properties: FeatureProperties | undefined;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface FeatureProperties {
|
|
48
|
+
name: string;
|
|
49
|
+
mapboxId: string;
|
|
50
|
+
fullAddress: string;
|
|
51
|
+
context: SearchContext | undefined;
|
|
52
|
+
coordinates: Coordinates | undefined;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface SearchContext {
|
|
56
|
+
country: ContextItem | undefined;
|
|
57
|
+
region: ContextItem | undefined;
|
|
58
|
+
postcode: ContextItem | undefined;
|
|
59
|
+
place: ContextItem | undefined;
|
|
60
|
+
neighborhood: ContextItem | undefined;
|
|
61
|
+
street: ContextItem | undefined;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface SearchRetrieveRequest {
|
|
65
|
+
mapboxId: string;
|
|
66
|
+
sessionToken: string;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function createBaseSearchSuggestRequest(): SearchSuggestRequest {
|
|
70
|
+
return { q: "", sessionToken: undefined, limit: undefined };
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export const SearchSuggestRequest: MessageFns<SearchSuggestRequest> = {
|
|
74
|
+
encode(message: SearchSuggestRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
75
|
+
if (message.q !== "") {
|
|
76
|
+
writer.uint32(10).string(message.q);
|
|
77
|
+
}
|
|
78
|
+
if (message.sessionToken !== undefined) {
|
|
79
|
+
writer.uint32(18).string(message.sessionToken);
|
|
80
|
+
}
|
|
81
|
+
if (message.limit !== undefined) {
|
|
82
|
+
writer.uint32(24).int32(message.limit);
|
|
83
|
+
}
|
|
84
|
+
return writer;
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
decode(input: BinaryReader | Uint8Array, length?: number): SearchSuggestRequest {
|
|
88
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
89
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
90
|
+
const message = createBaseSearchSuggestRequest();
|
|
91
|
+
while (reader.pos < end) {
|
|
92
|
+
const tag = reader.uint32();
|
|
93
|
+
switch (tag >>> 3) {
|
|
94
|
+
case 1: {
|
|
95
|
+
if (tag !== 10) {
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
message.q = reader.string();
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
case 2: {
|
|
103
|
+
if (tag !== 18) {
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
message.sessionToken = reader.string();
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
case 3: {
|
|
111
|
+
if (tag !== 24) {
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
message.limit = reader.int32();
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
reader.skip(tag & 7);
|
|
123
|
+
}
|
|
124
|
+
return message;
|
|
125
|
+
},
|
|
126
|
+
|
|
127
|
+
create<I extends Exact<DeepPartial<SearchSuggestRequest>, I>>(base?: I): SearchSuggestRequest {
|
|
128
|
+
return SearchSuggestRequest.fromPartial(base ?? ({} as any));
|
|
129
|
+
},
|
|
130
|
+
fromPartial<I extends Exact<DeepPartial<SearchSuggestRequest>, I>>(object: I): SearchSuggestRequest {
|
|
131
|
+
const message = createBaseSearchSuggestRequest();
|
|
132
|
+
message.q = object.q ?? "";
|
|
133
|
+
message.sessionToken = object.sessionToken ?? undefined;
|
|
134
|
+
message.limit = object.limit ?? undefined;
|
|
135
|
+
return message;
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
function createBaseSearchSuggestResponse(): SearchSuggestResponse {
|
|
140
|
+
return { suggestions: [], attribution: "" };
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export const SearchSuggestResponse: MessageFns<SearchSuggestResponse> = {
|
|
144
|
+
encode(message: SearchSuggestResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
145
|
+
for (const v of message.suggestions) {
|
|
146
|
+
SearchSuggestion.encode(v!, writer.uint32(10).fork()).join();
|
|
147
|
+
}
|
|
148
|
+
if (message.attribution !== "") {
|
|
149
|
+
writer.uint32(18).string(message.attribution);
|
|
150
|
+
}
|
|
151
|
+
return writer;
|
|
152
|
+
},
|
|
153
|
+
|
|
154
|
+
decode(input: BinaryReader | Uint8Array, length?: number): SearchSuggestResponse {
|
|
155
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
156
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
157
|
+
const message = createBaseSearchSuggestResponse();
|
|
158
|
+
while (reader.pos < end) {
|
|
159
|
+
const tag = reader.uint32();
|
|
160
|
+
switch (tag >>> 3) {
|
|
161
|
+
case 1: {
|
|
162
|
+
if (tag !== 10) {
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
message.suggestions.push(SearchSuggestion.decode(reader, reader.uint32()));
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
169
|
+
case 2: {
|
|
170
|
+
if (tag !== 18) {
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
message.attribution = reader.string();
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
179
|
+
break;
|
|
180
|
+
}
|
|
181
|
+
reader.skip(tag & 7);
|
|
182
|
+
}
|
|
183
|
+
return message;
|
|
184
|
+
},
|
|
185
|
+
|
|
186
|
+
create<I extends Exact<DeepPartial<SearchSuggestResponse>, I>>(base?: I): SearchSuggestResponse {
|
|
187
|
+
return SearchSuggestResponse.fromPartial(base ?? ({} as any));
|
|
188
|
+
},
|
|
189
|
+
fromPartial<I extends Exact<DeepPartial<SearchSuggestResponse>, I>>(object: I): SearchSuggestResponse {
|
|
190
|
+
const message = createBaseSearchSuggestResponse();
|
|
191
|
+
message.suggestions = object.suggestions?.map((e) => SearchSuggestion.fromPartial(e)) || [];
|
|
192
|
+
message.attribution = object.attribution ?? "";
|
|
193
|
+
return message;
|
|
194
|
+
},
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
function createBaseSearchSuggestion(): SearchSuggestion {
|
|
198
|
+
return { name: "", mapboxId: "", featureType: "", placeName: "", context: undefined, language: "", maki: undefined };
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export const SearchSuggestion: MessageFns<SearchSuggestion> = {
|
|
202
|
+
encode(message: SearchSuggestion, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
203
|
+
if (message.name !== "") {
|
|
204
|
+
writer.uint32(10).string(message.name);
|
|
205
|
+
}
|
|
206
|
+
if (message.mapboxId !== "") {
|
|
207
|
+
writer.uint32(18).string(message.mapboxId);
|
|
208
|
+
}
|
|
209
|
+
if (message.featureType !== "") {
|
|
210
|
+
writer.uint32(26).string(message.featureType);
|
|
211
|
+
}
|
|
212
|
+
if (message.placeName !== "") {
|
|
213
|
+
writer.uint32(34).string(message.placeName);
|
|
214
|
+
}
|
|
215
|
+
if (message.context !== undefined) {
|
|
216
|
+
SearchContext.encode(message.context, writer.uint32(42).fork()).join();
|
|
217
|
+
}
|
|
218
|
+
if (message.language !== "") {
|
|
219
|
+
writer.uint32(50).string(message.language);
|
|
220
|
+
}
|
|
221
|
+
if (message.maki !== undefined) {
|
|
222
|
+
writer.uint32(58).string(message.maki);
|
|
223
|
+
}
|
|
224
|
+
return writer;
|
|
225
|
+
},
|
|
226
|
+
|
|
227
|
+
decode(input: BinaryReader | Uint8Array, length?: number): SearchSuggestion {
|
|
228
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
229
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
230
|
+
const message = createBaseSearchSuggestion();
|
|
231
|
+
while (reader.pos < end) {
|
|
232
|
+
const tag = reader.uint32();
|
|
233
|
+
switch (tag >>> 3) {
|
|
234
|
+
case 1: {
|
|
235
|
+
if (tag !== 10) {
|
|
236
|
+
break;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
message.name = reader.string();
|
|
240
|
+
continue;
|
|
241
|
+
}
|
|
242
|
+
case 2: {
|
|
243
|
+
if (tag !== 18) {
|
|
244
|
+
break;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
message.mapboxId = reader.string();
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
case 3: {
|
|
251
|
+
if (tag !== 26) {
|
|
252
|
+
break;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
message.featureType = reader.string();
|
|
256
|
+
continue;
|
|
257
|
+
}
|
|
258
|
+
case 4: {
|
|
259
|
+
if (tag !== 34) {
|
|
260
|
+
break;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
message.placeName = reader.string();
|
|
264
|
+
continue;
|
|
265
|
+
}
|
|
266
|
+
case 5: {
|
|
267
|
+
if (tag !== 42) {
|
|
268
|
+
break;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
message.context = SearchContext.decode(reader, reader.uint32());
|
|
272
|
+
continue;
|
|
273
|
+
}
|
|
274
|
+
case 6: {
|
|
275
|
+
if (tag !== 50) {
|
|
276
|
+
break;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
message.language = reader.string();
|
|
280
|
+
continue;
|
|
281
|
+
}
|
|
282
|
+
case 7: {
|
|
283
|
+
if (tag !== 58) {
|
|
284
|
+
break;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
message.maki = reader.string();
|
|
288
|
+
continue;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
292
|
+
break;
|
|
293
|
+
}
|
|
294
|
+
reader.skip(tag & 7);
|
|
295
|
+
}
|
|
296
|
+
return message;
|
|
297
|
+
},
|
|
298
|
+
|
|
299
|
+
create<I extends Exact<DeepPartial<SearchSuggestion>, I>>(base?: I): SearchSuggestion {
|
|
300
|
+
return SearchSuggestion.fromPartial(base ?? ({} as any));
|
|
301
|
+
},
|
|
302
|
+
fromPartial<I extends Exact<DeepPartial<SearchSuggestion>, I>>(object: I): SearchSuggestion {
|
|
303
|
+
const message = createBaseSearchSuggestion();
|
|
304
|
+
message.name = object.name ?? "";
|
|
305
|
+
message.mapboxId = object.mapboxId ?? "";
|
|
306
|
+
message.featureType = object.featureType ?? "";
|
|
307
|
+
message.placeName = object.placeName ?? "";
|
|
308
|
+
message.context = (object.context !== undefined && object.context !== null)
|
|
309
|
+
? SearchContext.fromPartial(object.context)
|
|
310
|
+
: undefined;
|
|
311
|
+
message.language = object.language ?? "";
|
|
312
|
+
message.maki = object.maki ?? undefined;
|
|
313
|
+
return message;
|
|
314
|
+
},
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
function createBaseSearchRetrieveResponse(): SearchRetrieveResponse {
|
|
318
|
+
return { type: "", features: [], attribution: "" };
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
export const SearchRetrieveResponse: MessageFns<SearchRetrieveResponse> = {
|
|
322
|
+
encode(message: SearchRetrieveResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
323
|
+
if (message.type !== "") {
|
|
324
|
+
writer.uint32(10).string(message.type);
|
|
325
|
+
}
|
|
326
|
+
for (const v of message.features) {
|
|
327
|
+
SearchFeature.encode(v!, writer.uint32(18).fork()).join();
|
|
328
|
+
}
|
|
329
|
+
if (message.attribution !== "") {
|
|
330
|
+
writer.uint32(26).string(message.attribution);
|
|
331
|
+
}
|
|
332
|
+
return writer;
|
|
333
|
+
},
|
|
334
|
+
|
|
335
|
+
decode(input: BinaryReader | Uint8Array, length?: number): SearchRetrieveResponse {
|
|
336
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
337
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
338
|
+
const message = createBaseSearchRetrieveResponse();
|
|
339
|
+
while (reader.pos < end) {
|
|
340
|
+
const tag = reader.uint32();
|
|
341
|
+
switch (tag >>> 3) {
|
|
342
|
+
case 1: {
|
|
343
|
+
if (tag !== 10) {
|
|
344
|
+
break;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
message.type = reader.string();
|
|
348
|
+
continue;
|
|
349
|
+
}
|
|
350
|
+
case 2: {
|
|
351
|
+
if (tag !== 18) {
|
|
352
|
+
break;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
message.features.push(SearchFeature.decode(reader, reader.uint32()));
|
|
356
|
+
continue;
|
|
357
|
+
}
|
|
358
|
+
case 3: {
|
|
359
|
+
if (tag !== 26) {
|
|
360
|
+
break;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
message.attribution = reader.string();
|
|
364
|
+
continue;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
368
|
+
break;
|
|
369
|
+
}
|
|
370
|
+
reader.skip(tag & 7);
|
|
371
|
+
}
|
|
372
|
+
return message;
|
|
373
|
+
},
|
|
374
|
+
|
|
375
|
+
create<I extends Exact<DeepPartial<SearchRetrieveResponse>, I>>(base?: I): SearchRetrieveResponse {
|
|
376
|
+
return SearchRetrieveResponse.fromPartial(base ?? ({} as any));
|
|
377
|
+
},
|
|
378
|
+
fromPartial<I extends Exact<DeepPartial<SearchRetrieveResponse>, I>>(object: I): SearchRetrieveResponse {
|
|
379
|
+
const message = createBaseSearchRetrieveResponse();
|
|
380
|
+
message.type = object.type ?? "";
|
|
381
|
+
message.features = object.features?.map((e) => SearchFeature.fromPartial(e)) || [];
|
|
382
|
+
message.attribution = object.attribution ?? "";
|
|
383
|
+
return message;
|
|
384
|
+
},
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
function createBaseSearchFeature(): SearchFeature {
|
|
388
|
+
return { id: "", type: "", geometry: undefined, properties: undefined };
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
export const SearchFeature: MessageFns<SearchFeature> = {
|
|
392
|
+
encode(message: SearchFeature, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
393
|
+
if (message.id !== "") {
|
|
394
|
+
writer.uint32(10).string(message.id);
|
|
395
|
+
}
|
|
396
|
+
if (message.type !== "") {
|
|
397
|
+
writer.uint32(18).string(message.type);
|
|
398
|
+
}
|
|
399
|
+
if (message.geometry !== undefined) {
|
|
400
|
+
Geometry.encode(message.geometry, writer.uint32(26).fork()).join();
|
|
401
|
+
}
|
|
402
|
+
if (message.properties !== undefined) {
|
|
403
|
+
FeatureProperties.encode(message.properties, writer.uint32(34).fork()).join();
|
|
404
|
+
}
|
|
405
|
+
return writer;
|
|
406
|
+
},
|
|
407
|
+
|
|
408
|
+
decode(input: BinaryReader | Uint8Array, length?: number): SearchFeature {
|
|
409
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
410
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
411
|
+
const message = createBaseSearchFeature();
|
|
412
|
+
while (reader.pos < end) {
|
|
413
|
+
const tag = reader.uint32();
|
|
414
|
+
switch (tag >>> 3) {
|
|
415
|
+
case 1: {
|
|
416
|
+
if (tag !== 10) {
|
|
417
|
+
break;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
message.id = reader.string();
|
|
421
|
+
continue;
|
|
422
|
+
}
|
|
423
|
+
case 2: {
|
|
424
|
+
if (tag !== 18) {
|
|
425
|
+
break;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
message.type = reader.string();
|
|
429
|
+
continue;
|
|
430
|
+
}
|
|
431
|
+
case 3: {
|
|
432
|
+
if (tag !== 26) {
|
|
433
|
+
break;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
message.geometry = Geometry.decode(reader, reader.uint32());
|
|
437
|
+
continue;
|
|
438
|
+
}
|
|
439
|
+
case 4: {
|
|
440
|
+
if (tag !== 34) {
|
|
441
|
+
break;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
message.properties = FeatureProperties.decode(reader, reader.uint32());
|
|
445
|
+
continue;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
449
|
+
break;
|
|
450
|
+
}
|
|
451
|
+
reader.skip(tag & 7);
|
|
452
|
+
}
|
|
453
|
+
return message;
|
|
454
|
+
},
|
|
455
|
+
|
|
456
|
+
create<I extends Exact<DeepPartial<SearchFeature>, I>>(base?: I): SearchFeature {
|
|
457
|
+
return SearchFeature.fromPartial(base ?? ({} as any));
|
|
458
|
+
},
|
|
459
|
+
fromPartial<I extends Exact<DeepPartial<SearchFeature>, I>>(object: I): SearchFeature {
|
|
460
|
+
const message = createBaseSearchFeature();
|
|
461
|
+
message.id = object.id ?? "";
|
|
462
|
+
message.type = object.type ?? "";
|
|
463
|
+
message.geometry = (object.geometry !== undefined && object.geometry !== null)
|
|
464
|
+
? Geometry.fromPartial(object.geometry)
|
|
465
|
+
: undefined;
|
|
466
|
+
message.properties = (object.properties !== undefined && object.properties !== null)
|
|
467
|
+
? FeatureProperties.fromPartial(object.properties)
|
|
468
|
+
: undefined;
|
|
469
|
+
return message;
|
|
470
|
+
},
|
|
471
|
+
};
|
|
472
|
+
|
|
473
|
+
function createBaseFeatureProperties(): FeatureProperties {
|
|
474
|
+
return { name: "", mapboxId: "", fullAddress: "", context: undefined, coordinates: undefined };
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
export const FeatureProperties: MessageFns<FeatureProperties> = {
|
|
478
|
+
encode(message: FeatureProperties, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
479
|
+
if (message.name !== "") {
|
|
480
|
+
writer.uint32(10).string(message.name);
|
|
481
|
+
}
|
|
482
|
+
if (message.mapboxId !== "") {
|
|
483
|
+
writer.uint32(18).string(message.mapboxId);
|
|
484
|
+
}
|
|
485
|
+
if (message.fullAddress !== "") {
|
|
486
|
+
writer.uint32(26).string(message.fullAddress);
|
|
487
|
+
}
|
|
488
|
+
if (message.context !== undefined) {
|
|
489
|
+
SearchContext.encode(message.context, writer.uint32(34).fork()).join();
|
|
490
|
+
}
|
|
491
|
+
if (message.coordinates !== undefined) {
|
|
492
|
+
Coordinates.encode(message.coordinates, writer.uint32(42).fork()).join();
|
|
493
|
+
}
|
|
494
|
+
return writer;
|
|
495
|
+
},
|
|
496
|
+
|
|
497
|
+
decode(input: BinaryReader | Uint8Array, length?: number): FeatureProperties {
|
|
498
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
499
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
500
|
+
const message = createBaseFeatureProperties();
|
|
501
|
+
while (reader.pos < end) {
|
|
502
|
+
const tag = reader.uint32();
|
|
503
|
+
switch (tag >>> 3) {
|
|
504
|
+
case 1: {
|
|
505
|
+
if (tag !== 10) {
|
|
506
|
+
break;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
message.name = reader.string();
|
|
510
|
+
continue;
|
|
511
|
+
}
|
|
512
|
+
case 2: {
|
|
513
|
+
if (tag !== 18) {
|
|
514
|
+
break;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
message.mapboxId = reader.string();
|
|
518
|
+
continue;
|
|
519
|
+
}
|
|
520
|
+
case 3: {
|
|
521
|
+
if (tag !== 26) {
|
|
522
|
+
break;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
message.fullAddress = reader.string();
|
|
526
|
+
continue;
|
|
527
|
+
}
|
|
528
|
+
case 4: {
|
|
529
|
+
if (tag !== 34) {
|
|
530
|
+
break;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
message.context = SearchContext.decode(reader, reader.uint32());
|
|
534
|
+
continue;
|
|
535
|
+
}
|
|
536
|
+
case 5: {
|
|
537
|
+
if (tag !== 42) {
|
|
538
|
+
break;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
message.coordinates = Coordinates.decode(reader, reader.uint32());
|
|
542
|
+
continue;
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
546
|
+
break;
|
|
547
|
+
}
|
|
548
|
+
reader.skip(tag & 7);
|
|
549
|
+
}
|
|
550
|
+
return message;
|
|
551
|
+
},
|
|
552
|
+
|
|
553
|
+
create<I extends Exact<DeepPartial<FeatureProperties>, I>>(base?: I): FeatureProperties {
|
|
554
|
+
return FeatureProperties.fromPartial(base ?? ({} as any));
|
|
555
|
+
},
|
|
556
|
+
fromPartial<I extends Exact<DeepPartial<FeatureProperties>, I>>(object: I): FeatureProperties {
|
|
557
|
+
const message = createBaseFeatureProperties();
|
|
558
|
+
message.name = object.name ?? "";
|
|
559
|
+
message.mapboxId = object.mapboxId ?? "";
|
|
560
|
+
message.fullAddress = object.fullAddress ?? "";
|
|
561
|
+
message.context = (object.context !== undefined && object.context !== null)
|
|
562
|
+
? SearchContext.fromPartial(object.context)
|
|
563
|
+
: undefined;
|
|
564
|
+
message.coordinates = (object.coordinates !== undefined && object.coordinates !== null)
|
|
565
|
+
? Coordinates.fromPartial(object.coordinates)
|
|
566
|
+
: undefined;
|
|
567
|
+
return message;
|
|
568
|
+
},
|
|
569
|
+
};
|
|
570
|
+
|
|
571
|
+
function createBaseSearchContext(): SearchContext {
|
|
572
|
+
return {
|
|
573
|
+
country: undefined,
|
|
574
|
+
region: undefined,
|
|
575
|
+
postcode: undefined,
|
|
576
|
+
place: undefined,
|
|
577
|
+
neighborhood: undefined,
|
|
578
|
+
street: undefined,
|
|
579
|
+
};
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
export const SearchContext: MessageFns<SearchContext> = {
|
|
583
|
+
encode(message: SearchContext, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
584
|
+
if (message.country !== undefined) {
|
|
585
|
+
ContextItem.encode(message.country, writer.uint32(10).fork()).join();
|
|
586
|
+
}
|
|
587
|
+
if (message.region !== undefined) {
|
|
588
|
+
ContextItem.encode(message.region, writer.uint32(18).fork()).join();
|
|
589
|
+
}
|
|
590
|
+
if (message.postcode !== undefined) {
|
|
591
|
+
ContextItem.encode(message.postcode, writer.uint32(26).fork()).join();
|
|
592
|
+
}
|
|
593
|
+
if (message.place !== undefined) {
|
|
594
|
+
ContextItem.encode(message.place, writer.uint32(34).fork()).join();
|
|
595
|
+
}
|
|
596
|
+
if (message.neighborhood !== undefined) {
|
|
597
|
+
ContextItem.encode(message.neighborhood, writer.uint32(42).fork()).join();
|
|
598
|
+
}
|
|
599
|
+
if (message.street !== undefined) {
|
|
600
|
+
ContextItem.encode(message.street, writer.uint32(50).fork()).join();
|
|
601
|
+
}
|
|
602
|
+
return writer;
|
|
603
|
+
},
|
|
604
|
+
|
|
605
|
+
decode(input: BinaryReader | Uint8Array, length?: number): SearchContext {
|
|
606
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
607
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
608
|
+
const message = createBaseSearchContext();
|
|
609
|
+
while (reader.pos < end) {
|
|
610
|
+
const tag = reader.uint32();
|
|
611
|
+
switch (tag >>> 3) {
|
|
612
|
+
case 1: {
|
|
613
|
+
if (tag !== 10) {
|
|
614
|
+
break;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
message.country = ContextItem.decode(reader, reader.uint32());
|
|
618
|
+
continue;
|
|
619
|
+
}
|
|
620
|
+
case 2: {
|
|
621
|
+
if (tag !== 18) {
|
|
622
|
+
break;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
message.region = ContextItem.decode(reader, reader.uint32());
|
|
626
|
+
continue;
|
|
627
|
+
}
|
|
628
|
+
case 3: {
|
|
629
|
+
if (tag !== 26) {
|
|
630
|
+
break;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
message.postcode = ContextItem.decode(reader, reader.uint32());
|
|
634
|
+
continue;
|
|
635
|
+
}
|
|
636
|
+
case 4: {
|
|
637
|
+
if (tag !== 34) {
|
|
638
|
+
break;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
message.place = ContextItem.decode(reader, reader.uint32());
|
|
642
|
+
continue;
|
|
643
|
+
}
|
|
644
|
+
case 5: {
|
|
645
|
+
if (tag !== 42) {
|
|
646
|
+
break;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
message.neighborhood = ContextItem.decode(reader, reader.uint32());
|
|
650
|
+
continue;
|
|
651
|
+
}
|
|
652
|
+
case 6: {
|
|
653
|
+
if (tag !== 50) {
|
|
654
|
+
break;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
message.street = ContextItem.decode(reader, reader.uint32());
|
|
658
|
+
continue;
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
662
|
+
break;
|
|
663
|
+
}
|
|
664
|
+
reader.skip(tag & 7);
|
|
665
|
+
}
|
|
666
|
+
return message;
|
|
667
|
+
},
|
|
668
|
+
|
|
669
|
+
create<I extends Exact<DeepPartial<SearchContext>, I>>(base?: I): SearchContext {
|
|
670
|
+
return SearchContext.fromPartial(base ?? ({} as any));
|
|
671
|
+
},
|
|
672
|
+
fromPartial<I extends Exact<DeepPartial<SearchContext>, I>>(object: I): SearchContext {
|
|
673
|
+
const message = createBaseSearchContext();
|
|
674
|
+
message.country = (object.country !== undefined && object.country !== null)
|
|
675
|
+
? ContextItem.fromPartial(object.country)
|
|
676
|
+
: undefined;
|
|
677
|
+
message.region = (object.region !== undefined && object.region !== null)
|
|
678
|
+
? ContextItem.fromPartial(object.region)
|
|
679
|
+
: undefined;
|
|
680
|
+
message.postcode = (object.postcode !== undefined && object.postcode !== null)
|
|
681
|
+
? ContextItem.fromPartial(object.postcode)
|
|
682
|
+
: undefined;
|
|
683
|
+
message.place = (object.place !== undefined && object.place !== null)
|
|
684
|
+
? ContextItem.fromPartial(object.place)
|
|
685
|
+
: undefined;
|
|
686
|
+
message.neighborhood = (object.neighborhood !== undefined && object.neighborhood !== null)
|
|
687
|
+
? ContextItem.fromPartial(object.neighborhood)
|
|
688
|
+
: undefined;
|
|
689
|
+
message.street = (object.street !== undefined && object.street !== null)
|
|
690
|
+
? ContextItem.fromPartial(object.street)
|
|
691
|
+
: undefined;
|
|
692
|
+
return message;
|
|
693
|
+
},
|
|
694
|
+
};
|
|
695
|
+
|
|
696
|
+
function createBaseSearchRetrieveRequest(): SearchRetrieveRequest {
|
|
697
|
+
return { mapboxId: "", sessionToken: "" };
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
export const SearchRetrieveRequest: MessageFns<SearchRetrieveRequest> = {
|
|
701
|
+
encode(message: SearchRetrieveRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
702
|
+
if (message.mapboxId !== "") {
|
|
703
|
+
writer.uint32(10).string(message.mapboxId);
|
|
704
|
+
}
|
|
705
|
+
if (message.sessionToken !== "") {
|
|
706
|
+
writer.uint32(18).string(message.sessionToken);
|
|
707
|
+
}
|
|
708
|
+
return writer;
|
|
709
|
+
},
|
|
710
|
+
|
|
711
|
+
decode(input: BinaryReader | Uint8Array, length?: number): SearchRetrieveRequest {
|
|
712
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
713
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
714
|
+
const message = createBaseSearchRetrieveRequest();
|
|
715
|
+
while (reader.pos < end) {
|
|
716
|
+
const tag = reader.uint32();
|
|
717
|
+
switch (tag >>> 3) {
|
|
718
|
+
case 1: {
|
|
719
|
+
if (tag !== 10) {
|
|
720
|
+
break;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
message.mapboxId = reader.string();
|
|
724
|
+
continue;
|
|
725
|
+
}
|
|
726
|
+
case 2: {
|
|
727
|
+
if (tag !== 18) {
|
|
728
|
+
break;
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
message.sessionToken = reader.string();
|
|
732
|
+
continue;
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
736
|
+
break;
|
|
737
|
+
}
|
|
738
|
+
reader.skip(tag & 7);
|
|
739
|
+
}
|
|
740
|
+
return message;
|
|
741
|
+
},
|
|
742
|
+
|
|
743
|
+
create<I extends Exact<DeepPartial<SearchRetrieveRequest>, I>>(base?: I): SearchRetrieveRequest {
|
|
744
|
+
return SearchRetrieveRequest.fromPartial(base ?? ({} as any));
|
|
745
|
+
},
|
|
746
|
+
fromPartial<I extends Exact<DeepPartial<SearchRetrieveRequest>, I>>(object: I): SearchRetrieveRequest {
|
|
747
|
+
const message = createBaseSearchRetrieveRequest();
|
|
748
|
+
message.mapboxId = object.mapboxId ?? "";
|
|
749
|
+
message.sessionToken = object.sessionToken ?? "";
|
|
750
|
+
return message;
|
|
751
|
+
},
|
|
752
|
+
};
|
|
753
|
+
|
|
754
|
+
export interface SearchService {
|
|
755
|
+
Suggest(request: SearchSuggestRequest): Promise<SearchSuggestResponse>;
|
|
756
|
+
Retrieve(request: SearchRetrieveRequest): Promise<SearchRetrieveResponse>;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
export const SearchServiceServiceName = "search.v1.SearchService";
|
|
760
|
+
export class SearchServiceClientImpl implements SearchService {
|
|
761
|
+
private readonly rpc: Rpc;
|
|
762
|
+
private readonly service: string;
|
|
763
|
+
constructor(rpc: Rpc, opts?: { service?: string }) {
|
|
764
|
+
this.service = opts?.service || SearchServiceServiceName;
|
|
765
|
+
this.rpc = rpc;
|
|
766
|
+
this.Suggest = this.Suggest.bind(this);
|
|
767
|
+
this.Retrieve = this.Retrieve.bind(this);
|
|
768
|
+
}
|
|
769
|
+
Suggest(request: SearchSuggestRequest): Promise<SearchSuggestResponse> {
|
|
770
|
+
const data = SearchSuggestRequest.encode(request).finish();
|
|
771
|
+
const promise = this.rpc.request(this.service, "Suggest", data);
|
|
772
|
+
return promise.then((data) => SearchSuggestResponse.decode(new BinaryReader(data)));
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
Retrieve(request: SearchRetrieveRequest): Promise<SearchRetrieveResponse> {
|
|
776
|
+
const data = SearchRetrieveRequest.encode(request).finish();
|
|
777
|
+
const promise = this.rpc.request(this.service, "Retrieve", data);
|
|
778
|
+
return promise.then((data) => SearchRetrieveResponse.decode(new BinaryReader(data)));
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
interface Rpc {
|
|
783
|
+
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
787
|
+
|
|
788
|
+
export type DeepPartial<T> = T extends Builtin ? T
|
|
789
|
+
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
|
790
|
+
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
791
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
792
|
+
: Partial<T>;
|
|
793
|
+
|
|
794
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
795
|
+
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
796
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
797
|
+
|
|
798
|
+
export interface MessageFns<T> {
|
|
799
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
800
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
801
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
802
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
803
|
+
}
|