@tileflow/search 0.1.0-alpha.3 → 0.1.0-alpha.4
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/README.md +79 -11
- package/dist/{chunk-FEWG4I4E.js → chunk-QDEMNVJD.js} +25 -7
- package/dist/{chunk-R7KE2IN7.js → chunk-W66J2DAS.js} +69 -7
- package/dist/client.js +2 -2
- package/dist/contract.d.ts +502 -9
- package/dist/contract.js +23 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +24 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -110,9 +110,77 @@ export const suggestPlaces = (query: string) => autocomplete({query, language: '
|
|
|
110
110
|
export const resolveSelection = (token: string) => resolveSuggestion({token}, options);
|
|
111
111
|
```
|
|
112
112
|
|
|
113
|
-
Text search and Nearby are distinct operations.
|
|
114
|
-
|
|
115
|
-
|
|
113
|
+
Text search and Nearby are distinct operations. A suggestion has a title, an optional one-line
|
|
114
|
+
`addressLabel` that tells same-named places apart, and no position. Resolve only the selected
|
|
115
|
+
suggestion. Reverse results are candidates in provider order, without containment, entrance
|
|
116
|
+
precision, routability, deliverability or address-validation guarantees.
|
|
117
|
+
|
|
118
|
+
To show positions, distances and categories while someone types, ask for each suggestion's place.
|
|
119
|
+
A completed request then uses 25 units instead of 10, and choosing a suggestion needs no further
|
|
120
|
+
resolution:
|
|
121
|
+
|
|
122
|
+
<!-- docs:check -->
|
|
123
|
+
|
|
124
|
+
```ts
|
|
125
|
+
import {autocomplete} from '@tileflow/search';
|
|
126
|
+
|
|
127
|
+
const apiKey = process.env.TILEFLOW_API_KEY;
|
|
128
|
+
if (!apiKey) throw new Error('Set TILEFLOW_API_KEY on the server.');
|
|
129
|
+
const options = {apiKey};
|
|
130
|
+
|
|
131
|
+
export async function suggestNearbyPlaces(query: string, proximity: [number, number]) {
|
|
132
|
+
const {suggestions} = await autocomplete({query, proximity, include: ['place']}, options);
|
|
133
|
+
return suggestions.map(({label, addressLabel, place}) => ({
|
|
134
|
+
label,
|
|
135
|
+
addressLabel,
|
|
136
|
+
position: place?.position,
|
|
137
|
+
distanceMeters: place?.distanceMeters,
|
|
138
|
+
}));
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Place details
|
|
143
|
+
|
|
144
|
+
Results carry an optional `distanceMeters` when the provider reports one: from `proximity`, from
|
|
145
|
+
the centre of `bounds`, or from the reverse or Nearby position. Places can also carry `foodTypes`.
|
|
146
|
+
Other details are requested with `include` and make the operation an extended one:
|
|
147
|
+
|
|
148
|
+
| Detail | Returns | Available from |
|
|
149
|
+
| -------------- | ----------------------------------------------------------- | -------------------------------------------------------- |
|
|
150
|
+
| `contacts` | `phones`, `websites` and `emails`, each a `value` and label | Text search inside `bounds`, Nearby, explicit resolution |
|
|
151
|
+
| `openingHours` | Display lines per schedule and `openNow` at request time | Text search inside `bounds`, Nearby, explicit resolution |
|
|
152
|
+
| `timeZone` | IANA `name` and `utcOffsetSeconds` | Every place operation |
|
|
153
|
+
| `accessPoints` | Entrance or access positions, separate from `position` | Every place operation |
|
|
154
|
+
|
|
155
|
+
Asking geocoding without `bounds`, or reverse geocoding, for contacts or opening hours fails with
|
|
156
|
+
`GEOCODING_FILTER_UNSUPPORTED` before any request is sent. Each detail is optional in a response:
|
|
157
|
+
a place whose hours the provider does not supply has no `openingHours`.
|
|
158
|
+
|
|
159
|
+
<!-- docs:check -->
|
|
160
|
+
|
|
161
|
+
```ts
|
|
162
|
+
import {resolvePlace} from '@tileflow/search';
|
|
163
|
+
|
|
164
|
+
const apiKey = process.env.TILEFLOW_API_KEY;
|
|
165
|
+
if (!apiKey) throw new Error('Set TILEFLOW_API_KEY on the server.');
|
|
166
|
+
const options = {apiKey};
|
|
167
|
+
|
|
168
|
+
export async function placeCard(token: string) {
|
|
169
|
+
const {result} = await resolvePlace({token, include: ['contacts', 'openingHours']}, options);
|
|
170
|
+
const website = result.contacts?.websites?.find(({value}) => /^https?:\/\//iu.test(value));
|
|
171
|
+
return {
|
|
172
|
+
name: result.name ?? result.label,
|
|
173
|
+
openNow: result.openingHours?.some(({openNow}) => openNow) ?? false,
|
|
174
|
+
hours: result.openingHours?.flatMap(({display}) => display ?? []) ?? [],
|
|
175
|
+
phone: result.contacts?.phones?.[0]?.value,
|
|
176
|
+
website: website?.value,
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Contact values are provider text, not validated links: check the scheme before rendering one as
|
|
182
|
+
a link, and expect several phones or websites for a place, not all equally relevant. `openNow`
|
|
183
|
+
describes the moment of the request. Like every result, details are for temporary display.
|
|
116
184
|
|
|
117
185
|
## Limits and temporary use
|
|
118
186
|
|
|
@@ -140,15 +208,15 @@ retention, Advanced features and caller-selected provider options are rejected b
|
|
|
140
208
|
|
|
141
209
|
## Usage and errors
|
|
142
210
|
|
|
143
|
-
| Completed operation | Shared API units |
|
|
144
|
-
| ------------------------------------- | ---------------: |
|
|
145
|
-
| Category discovery | 0 |
|
|
146
|
-
| Autocomplete | 10 |
|
|
147
|
-
| Forward, reverse, explicit resolution | 25 |
|
|
148
|
-
| Each Nearby page | 25 |
|
|
211
|
+
| Completed operation | Shared API units | With `include` |
|
|
212
|
+
| ------------------------------------- | ---------------: | -------------: |
|
|
213
|
+
| Category discovery | 0 | — |
|
|
214
|
+
| Autocomplete | 10 | 25 |
|
|
215
|
+
| Forward, reverse, explicit resolution | 25 | 75 |
|
|
216
|
+
| Each Nearby page | 25 | 75 |
|
|
149
217
|
|
|
150
|
-
|
|
151
|
-
55 units. These are part of Starter's shared API allowance, with no separate Search credits or
|
|
218
|
+
`searchOperationUnits(operation, include)` returns the same weights. Valid empty responses consume
|
|
219
|
+
the same units. Three autocomplete calls and one resolution consume 55 units. These are part of Starter's shared API allowance, with no separate Search credits or
|
|
152
220
|
commercial search session. Hovering, displaying results and moving a map do not call Search.
|
|
153
221
|
|
|
154
222
|
`GeocodingError` exposes `status`, nullable `code`, nullable `requestId` and nullable bounded
|
|
@@ -10,8 +10,10 @@ import {
|
|
|
10
10
|
nearbyResponseSchema,
|
|
11
11
|
resolveSuggestionRequestSchema,
|
|
12
12
|
resolveSuggestionResponseSchema,
|
|
13
|
-
searchCategoriesResponseSchema
|
|
14
|
-
|
|
13
|
+
searchCategoriesResponseSchema,
|
|
14
|
+
searchContactDetails,
|
|
15
|
+
searchOperationUnits
|
|
16
|
+
} from "./chunk-W66J2DAS.js";
|
|
15
17
|
|
|
16
18
|
// src/client.ts
|
|
17
19
|
import { z } from "zod";
|
|
@@ -91,12 +93,14 @@ async function geocode(request, options) {
|
|
|
91
93
|
if (!parsedRequest.success) {
|
|
92
94
|
throw new Error("Invalid Tileflow geocoding request");
|
|
93
95
|
}
|
|
96
|
+
if (!parsedRequest.data.bounds) rejectContactDetails(parsedRequest.data.include);
|
|
97
|
+
const units = searchOperationUnits("forward", parsedRequest.data.include);
|
|
94
98
|
return requestGeocoding(
|
|
95
99
|
"/v1/geocoding/forward",
|
|
96
100
|
parsedRequest.data,
|
|
97
101
|
options,
|
|
98
102
|
geocodingForwardResponseSchema,
|
|
99
|
-
(response) => response.results.length <= (parsedRequest.data.limit ?? geocodingLimits.defaultLimit)
|
|
103
|
+
(response) => response.usage.units === units && response.results.length <= (parsedRequest.data.limit ?? geocodingLimits.defaultLimit)
|
|
100
104
|
);
|
|
101
105
|
}
|
|
102
106
|
async function geocodeReverse(request, options) {
|
|
@@ -104,12 +108,14 @@ async function geocodeReverse(request, options) {
|
|
|
104
108
|
if (!parsedRequest.success) {
|
|
105
109
|
throw new Error("Invalid Tileflow geocoding request");
|
|
106
110
|
}
|
|
111
|
+
rejectContactDetails(parsedRequest.data.include);
|
|
112
|
+
const units = searchOperationUnits("reverse", parsedRequest.data.include);
|
|
107
113
|
return requestGeocoding(
|
|
108
114
|
"/v1/geocoding/reverse",
|
|
109
115
|
parsedRequest.data,
|
|
110
116
|
options,
|
|
111
117
|
geocodingForwardResponseSchema,
|
|
112
|
-
(response) => response.results.length <= parsedRequest.data.limit && containsOnlyKinds(response, parsedRequest.data.kinds)
|
|
118
|
+
(response) => response.usage.units === units && response.results.length <= parsedRequest.data.limit && containsOnlyKinds(response, parsedRequest.data.kinds)
|
|
113
119
|
);
|
|
114
120
|
}
|
|
115
121
|
async function autocomplete(request, options) {
|
|
@@ -117,12 +123,13 @@ async function autocomplete(request, options) {
|
|
|
117
123
|
if (!parsedRequest.success) {
|
|
118
124
|
throw new Error("Invalid Tileflow geocoding request");
|
|
119
125
|
}
|
|
126
|
+
const withPlaces = parsedRequest.data.include !== void 0;
|
|
120
127
|
return requestGeocoding(
|
|
121
128
|
"/v1/geocoding/autocomplete",
|
|
122
129
|
parsedRequest.data,
|
|
123
130
|
options,
|
|
124
131
|
autocompleteResponseSchema,
|
|
125
|
-
(response) => response.suggestions.length <= parsedRequest.data.limit
|
|
132
|
+
(response) => response.usage.units === searchOperationUnits("autocomplete", parsedRequest.data.include) && response.suggestions.length <= parsedRequest.data.limit && response.suggestions.every((suggestion) => suggestion.place !== void 0 === withPlaces)
|
|
126
133
|
);
|
|
127
134
|
}
|
|
128
135
|
async function resolveSuggestion(request, options) {
|
|
@@ -130,11 +137,13 @@ async function resolveSuggestion(request, options) {
|
|
|
130
137
|
if (!parsedRequest.success) {
|
|
131
138
|
throw new Error("Invalid Tileflow geocoding request");
|
|
132
139
|
}
|
|
140
|
+
const units = searchOperationUnits("resolve", parsedRequest.data.include);
|
|
133
141
|
return requestGeocoding(
|
|
134
142
|
"/v1/geocoding/resolve",
|
|
135
143
|
parsedRequest.data,
|
|
136
144
|
options,
|
|
137
|
-
resolveSuggestionResponseSchema
|
|
145
|
+
resolveSuggestionResponseSchema,
|
|
146
|
+
(response) => response.usage.units === units
|
|
138
147
|
);
|
|
139
148
|
}
|
|
140
149
|
var resolvePlace = resolveSuggestion;
|
|
@@ -148,12 +157,13 @@ async function searchNearby(request, options) {
|
|
|
148
157
|
status: 422
|
|
149
158
|
});
|
|
150
159
|
}
|
|
160
|
+
const units = searchOperationUnits("nearby", query.include);
|
|
151
161
|
return requestGeocoding(
|
|
152
162
|
"/v1/geocoding/nearby",
|
|
153
163
|
query,
|
|
154
164
|
options,
|
|
155
165
|
nearbyResponseSchema,
|
|
156
|
-
(response) => response.results.length <= query.limit,
|
|
166
|
+
(response) => response.usage.units === units && response.results.length <= query.limit,
|
|
157
167
|
nearbyLimits.maximumResponseBytes
|
|
158
168
|
);
|
|
159
169
|
}
|
|
@@ -216,6 +226,14 @@ async function requestGeocoding(path, request, options, responseSchema, isExpect
|
|
|
216
226
|
}
|
|
217
227
|
return parsedResponse.data;
|
|
218
228
|
}
|
|
229
|
+
function rejectContactDetails(include) {
|
|
230
|
+
if (include?.some((detail) => searchContactDetails.includes(detail))) {
|
|
231
|
+
throw new GeocodingError("Unsupported geocoding filters", {
|
|
232
|
+
code: "GEOCODING_FILTER_UNSUPPORTED",
|
|
233
|
+
status: 422
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
}
|
|
219
237
|
function containsOnlyKinds(response, allowedKinds) {
|
|
220
238
|
if (!allowedKinds) return true;
|
|
221
239
|
const kindFilter = new Set(allowedKinds);
|
|
@@ -16,7 +16,10 @@ var geocodingLimits = Object.freeze({
|
|
|
16
16
|
maximumResponseBytes: 64 * 1024,
|
|
17
17
|
maximumSafeErrorBytes: 8 * 1024,
|
|
18
18
|
maximumSourceCharacters: 128,
|
|
19
|
-
maximumSuggestionTokenCharacters: 2048
|
|
19
|
+
maximumSuggestionTokenCharacters: 2048,
|
|
20
|
+
maximumDetailEntries: 100,
|
|
21
|
+
maximumOpeningHoursEntries: 20,
|
|
22
|
+
maximumOpeningHoursLines: 50
|
|
20
23
|
});
|
|
21
24
|
var boundedText = (maximum) => z.string().trim().min(1).max(maximum).refine((value) => !controlCharacterPattern.test(value), {
|
|
22
25
|
message: "Control characters are not allowed"
|
|
@@ -28,8 +31,14 @@ var geocodingRetentionModes = ["temporary"];
|
|
|
28
31
|
var geocodingBoundsSchema = z.tuple([longitude, latitude, longitude, latitude]).refine(([west, , east]) => west < east, { message: "West must be less than east" }).refine(([, south, , north]) => south < north, {
|
|
29
32
|
message: "South must be less than north"
|
|
30
33
|
});
|
|
34
|
+
var searchPlaceDetails = ["contacts", "openingHours", "timeZone", "accessPoints"];
|
|
35
|
+
var searchPlaceDetailSchema = z.enum(searchPlaceDetails);
|
|
36
|
+
var searchPlaceDetailsSchema = z.array(searchPlaceDetailSchema).min(1).max(searchPlaceDetails.length).refine((values) => new Set(values).size === values.length, {
|
|
37
|
+
message: "Place details must be unique"
|
|
38
|
+
});
|
|
31
39
|
var geocodingForwardRequestSchema = z.object({
|
|
32
40
|
bounds: geocodingBoundsSchema.optional(),
|
|
41
|
+
include: searchPlaceDetailsSchema.optional(),
|
|
33
42
|
language: z.string().max(geocodingLimits.maximumLanguageCharacters).regex(languagePattern).optional(),
|
|
34
43
|
limit: z.number().int().min(1).max(geocodingLimits.maximumLimit).optional(),
|
|
35
44
|
proximity: geocodingPositionSchema.optional(),
|
|
@@ -39,8 +48,10 @@ var geocodingForwardRequestSchema = z.object({
|
|
|
39
48
|
message: "Bounds and proximity are mutually exclusive",
|
|
40
49
|
path: ["proximity"]
|
|
41
50
|
});
|
|
51
|
+
var autocompleteIncludeSchema = z.tuple([z.literal("place")]);
|
|
42
52
|
var autocompleteRequestSchema = z.object({
|
|
43
53
|
bounds: geocodingBoundsSchema.optional(),
|
|
54
|
+
include: autocompleteIncludeSchema.optional(),
|
|
44
55
|
language: z.string().max(geocodingLimits.maximumLanguageCharacters).regex(languagePattern).optional(),
|
|
45
56
|
limit: z.number().int().min(1).max(geocodingLimits.maximumLimit).default(geocodingLimits.defaultLimit),
|
|
46
57
|
proximity: geocodingPositionSchema.optional(),
|
|
@@ -51,6 +62,7 @@ var autocompleteRequestSchema = z.object({
|
|
|
51
62
|
});
|
|
52
63
|
var reverseGeocodingKindSchema = z.enum(["address", "street", "locality", "place"]);
|
|
53
64
|
var geocodingReverseRequestSchema = z.object({
|
|
65
|
+
include: searchPlaceDetailsSchema.optional(),
|
|
54
66
|
kinds: z.array(reverseGeocodingKindSchema).min(1).max(4).optional(),
|
|
55
67
|
language: z.string().max(geocodingLimits.maximumLanguageCharacters).regex(languagePattern).optional(),
|
|
56
68
|
limit: z.number().int().min(1).max(geocodingLimits.maximumLimit).default(geocodingLimits.defaultReverseLimit),
|
|
@@ -93,10 +105,40 @@ var searchCategorySchema = z.object({
|
|
|
93
105
|
var searchPlaceMetadata = {
|
|
94
106
|
name: searchLiteralText(200).optional(),
|
|
95
107
|
categories: z.array(searchCategorySchema).min(1).max(100).optional(),
|
|
108
|
+
foodTypes: z.array(searchCategorySchema).min(1).max(100).optional(),
|
|
96
109
|
businessChains: z.array(z.object({ id: searchLiteralText(100), name: searchLiteralText(100) }).strict()).min(1).max(100).optional()
|
|
97
110
|
};
|
|
111
|
+
var contactListSchema = z.array(
|
|
112
|
+
z.object({
|
|
113
|
+
value: searchLiteralText(2048),
|
|
114
|
+
label: searchLiteralText(256).optional()
|
|
115
|
+
}).strict()
|
|
116
|
+
).min(1).max(geocodingLimits.maximumDetailEntries);
|
|
117
|
+
var searchContactsSchema = z.object({
|
|
118
|
+
phones: contactListSchema.optional(),
|
|
119
|
+
websites: contactListSchema.optional(),
|
|
120
|
+
emails: contactListSchema.optional()
|
|
121
|
+
}).strict();
|
|
122
|
+
var searchOpeningHoursSchema = z.array(
|
|
123
|
+
z.object({
|
|
124
|
+
display: z.array(searchLiteralText(256)).min(1).max(geocodingLimits.maximumOpeningHoursLines).optional(),
|
|
125
|
+
openNow: z.boolean().optional()
|
|
126
|
+
}).strict()
|
|
127
|
+
).min(1).max(geocodingLimits.maximumOpeningHoursEntries);
|
|
128
|
+
var searchTimeZoneSchema = z.object({
|
|
129
|
+
name: searchLiteralText(64),
|
|
130
|
+
utcOffsetSeconds: z.number().int().min(-86400).max(86400).optional()
|
|
131
|
+
}).strict();
|
|
132
|
+
var searchPlaceDetailFields = {
|
|
133
|
+
distanceMeters: z.number().finite().nonnegative().optional(),
|
|
134
|
+
contacts: searchContactsSchema.optional(),
|
|
135
|
+
openingHours: searchOpeningHoursSchema.optional(),
|
|
136
|
+
timeZone: searchTimeZoneSchema.optional(),
|
|
137
|
+
accessPoints: z.array(z.object({ position: geocodingPositionSchema }).strict()).min(1).max(geocodingLimits.maximumDetailEntries).optional()
|
|
138
|
+
};
|
|
98
139
|
var geocodingResultSchema = z.object({
|
|
99
140
|
...searchPlaceMetadata,
|
|
141
|
+
...searchPlaceDetailFields,
|
|
100
142
|
address: geocodingAddressSchema,
|
|
101
143
|
bounds: geocodingBoundsSchema.optional(),
|
|
102
144
|
kind: z.enum(geocodingResultKinds),
|
|
@@ -116,18 +158,21 @@ var geocodingAttributionSchema = z.object({
|
|
|
116
158
|
message: "Expected an HTTPS URL without credentials"
|
|
117
159
|
}).optional()
|
|
118
160
|
}).strict();
|
|
161
|
+
var placeOperationUnitsSchema = z.union([z.literal(25), z.literal(75)]);
|
|
119
162
|
var geocodingForwardResponseSchema = z.object({
|
|
120
163
|
attribution: z.array(geocodingAttributionSchema).min(1).max(geocodingLimits.maximumAttributionEntries),
|
|
121
164
|
queryId: z.string().regex(queryIdPattern),
|
|
122
165
|
results: z.array(geocodingResultSchema).max(geocodingLimits.maximumLimit),
|
|
123
166
|
schemaVersion: z.literal(1),
|
|
124
167
|
source: geocodingSourceSchema,
|
|
125
|
-
usage: z.object({ units:
|
|
168
|
+
usage: z.object({ units: placeOperationUnitsSchema }).strict()
|
|
126
169
|
}).strict();
|
|
127
170
|
var geocodingReverseResponseSchema = geocodingForwardResponseSchema;
|
|
128
171
|
var geocodingSuggestionSchema = z.object({
|
|
129
172
|
kind: z.enum(geocodingResultKinds),
|
|
130
173
|
label: boundedText(512),
|
|
174
|
+
addressLabel: boundedText(512).optional(),
|
|
175
|
+
place: geocodingResultSchema.optional(),
|
|
131
176
|
token: z.string().min(1).max(geocodingLimits.maximumSuggestionTokenCharacters).regex(/^[\x21-\x7e]+$/u)
|
|
132
177
|
}).strict();
|
|
133
178
|
var autocompleteResponseSchema = z.object({
|
|
@@ -135,9 +180,10 @@ var autocompleteResponseSchema = z.object({
|
|
|
135
180
|
schemaVersion: z.literal(1),
|
|
136
181
|
source: geocodingSourceSchema,
|
|
137
182
|
suggestions: z.array(geocodingSuggestionSchema).max(geocodingLimits.maximumLimit),
|
|
138
|
-
usage: z.object({ units: z.literal(10) }).strict()
|
|
183
|
+
usage: z.object({ units: z.union([z.literal(10), z.literal(25)]) }).strict()
|
|
139
184
|
}).strict();
|
|
140
185
|
var resolveSuggestionRequestSchema = z.object({
|
|
186
|
+
include: searchPlaceDetailsSchema.optional(),
|
|
141
187
|
retention: z.enum(geocodingRetentionModes).default("temporary"),
|
|
142
188
|
token: z.string().min(1).max(geocodingLimits.maximumSuggestionTokenCharacters).regex(/^[\x21-\x7e]+$/u)
|
|
143
189
|
}).strict();
|
|
@@ -146,7 +192,7 @@ var resolveSuggestionResponseSchema = z.object({
|
|
|
146
192
|
result: geocodingResultSchema,
|
|
147
193
|
schemaVersion: z.literal(1),
|
|
148
194
|
source: geocodingSourceSchema,
|
|
149
|
-
usage: z.object({ units:
|
|
195
|
+
usage: z.object({ units: placeOperationUnitsSchema }).strict()
|
|
150
196
|
}).strict();
|
|
151
197
|
function isCredentialFreeHttpsUrl(value) {
|
|
152
198
|
try {
|
|
@@ -177,12 +223,12 @@ var nearbyRequestSchema = z.object({
|
|
|
177
223
|
excludeCategories: categoryFilter.optional(),
|
|
178
224
|
countries: z.array(z.string().regex(/^(?:[A-Z]{2}|[A-Z]{3})$/u)).min(1).max(nearbyLimits.maximumCountries).optional(),
|
|
179
225
|
language: geocodingForwardRequestSchema.shape.language,
|
|
226
|
+
include: searchPlaceDetailsSchema.optional(),
|
|
180
227
|
limit: z.number().int().min(1).max(nearbyLimits.maximumLimit).default(nearbyLimits.defaultLimit),
|
|
181
228
|
cursor: nearbyCursorSchema.optional()
|
|
182
229
|
}).strict();
|
|
183
230
|
var nearbyPlaceSchema = geocodingResultSchema.omit({ sourceRef: true }).extend({
|
|
184
231
|
kind: z.literal("place"),
|
|
185
|
-
distanceMeters: z.number().finite().nonnegative().optional(),
|
|
186
232
|
token: geocodingSuggestionSchema.shape.token.optional()
|
|
187
233
|
}).strict();
|
|
188
234
|
var nearbyResponseSchema = z.object({
|
|
@@ -192,7 +238,7 @@ var nearbyResponseSchema = z.object({
|
|
|
192
238
|
nextCursor: nearbyCursorSchema.optional(),
|
|
193
239
|
source: geocodingSourceSchema,
|
|
194
240
|
attribution: geocodingForwardResponseSchema.shape.attribution,
|
|
195
|
-
usage: z.object({ units:
|
|
241
|
+
usage: z.object({ units: placeOperationUnitsSchema }).strict()
|
|
196
242
|
}).strict().refine(
|
|
197
243
|
(value) => new TextEncoder().encode(JSON.stringify(value)).byteLength <= nearbyLimits.maximumResponseBytes,
|
|
198
244
|
{ message: "Nearby response exceeds the encoded byte limit" }
|
|
@@ -207,13 +253,23 @@ var searchCategoriesResponseSchema = z.object({
|
|
|
207
253
|
}).strict();
|
|
208
254
|
var resolvePlaceRequestSchema = resolveSuggestionRequestSchema;
|
|
209
255
|
var resolvePlaceResponseSchema = resolveSuggestionResponseSchema;
|
|
256
|
+
var searchContactDetails = ["contacts", "openingHours"];
|
|
257
|
+
function searchOperationUnits(operation, include) {
|
|
258
|
+
if (operation === "categories") return 0;
|
|
259
|
+
if (operation === "autocomplete") return include?.length ? 25 : 10;
|
|
260
|
+
return include?.length ? 75 : 25;
|
|
261
|
+
}
|
|
210
262
|
|
|
211
263
|
export {
|
|
212
264
|
geocodingLimits,
|
|
213
265
|
geocodingPositionSchema,
|
|
214
266
|
geocodingRetentionModes,
|
|
215
267
|
geocodingBoundsSchema,
|
|
268
|
+
searchPlaceDetails,
|
|
269
|
+
searchPlaceDetailSchema,
|
|
270
|
+
searchPlaceDetailsSchema,
|
|
216
271
|
geocodingForwardRequestSchema,
|
|
272
|
+
autocompleteIncludeSchema,
|
|
217
273
|
autocompleteRequestSchema,
|
|
218
274
|
reverseGeocodingKindSchema,
|
|
219
275
|
geocodingReverseRequestSchema,
|
|
@@ -223,6 +279,10 @@ export {
|
|
|
223
279
|
searchCategoryIdSchema,
|
|
224
280
|
searchCategorySchema,
|
|
225
281
|
searchPlaceMetadata,
|
|
282
|
+
searchContactsSchema,
|
|
283
|
+
searchOpeningHoursSchema,
|
|
284
|
+
searchTimeZoneSchema,
|
|
285
|
+
searchPlaceDetailFields,
|
|
226
286
|
geocodingResultSchema,
|
|
227
287
|
geocodingSourceSchema,
|
|
228
288
|
geocodingAttributionSchema,
|
|
@@ -239,5 +299,7 @@ export {
|
|
|
239
299
|
nearbyResponseSchema,
|
|
240
300
|
searchCategoriesResponseSchema,
|
|
241
301
|
resolvePlaceRequestSchema,
|
|
242
|
-
resolvePlaceResponseSchema
|
|
302
|
+
resolvePlaceResponseSchema,
|
|
303
|
+
searchContactDetails,
|
|
304
|
+
searchOperationUnits
|
|
243
305
|
};
|
package/dist/client.js
CHANGED
package/dist/contract.d.ts
CHANGED
|
@@ -13,12 +13,39 @@ declare const geocodingLimits: Readonly<{
|
|
|
13
13
|
maximumSafeErrorBytes: number;
|
|
14
14
|
maximumSourceCharacters: 128;
|
|
15
15
|
maximumSuggestionTokenCharacters: 2048;
|
|
16
|
+
maximumDetailEntries: 100;
|
|
17
|
+
maximumOpeningHoursEntries: 20;
|
|
18
|
+
maximumOpeningHoursLines: 50;
|
|
16
19
|
}>;
|
|
17
20
|
declare const geocodingPositionSchema: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
18
21
|
declare const geocodingRetentionModes: readonly ["temporary"];
|
|
19
22
|
declare const geocodingBoundsSchema: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
|
|
23
|
+
/**
|
|
24
|
+
* Optional place details. Requesting any of them makes the operation an extended one with a
|
|
25
|
+
* higher unit weight. Contacts and opening hours need a text search inside bounds, Nearby or an
|
|
26
|
+
* explicit resolution; time zones and access points are available to every place operation.
|
|
27
|
+
*/
|
|
28
|
+
declare const searchPlaceDetails: readonly ["contacts", "openingHours", "timeZone", "accessPoints"];
|
|
29
|
+
declare const searchPlaceDetailSchema: z.ZodEnum<{
|
|
30
|
+
accessPoints: "accessPoints";
|
|
31
|
+
contacts: "contacts";
|
|
32
|
+
openingHours: "openingHours";
|
|
33
|
+
timeZone: "timeZone";
|
|
34
|
+
}>;
|
|
35
|
+
declare const searchPlaceDetailsSchema: z.ZodArray<z.ZodEnum<{
|
|
36
|
+
accessPoints: "accessPoints";
|
|
37
|
+
contacts: "contacts";
|
|
38
|
+
openingHours: "openingHours";
|
|
39
|
+
timeZone: "timeZone";
|
|
40
|
+
}>>;
|
|
20
41
|
declare const geocodingForwardRequestSchema: z.ZodObject<{
|
|
21
42
|
bounds: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
|
|
43
|
+
include: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
44
|
+
accessPoints: "accessPoints";
|
|
45
|
+
contacts: "contacts";
|
|
46
|
+
openingHours: "openingHours";
|
|
47
|
+
timeZone: "timeZone";
|
|
48
|
+
}>>>;
|
|
22
49
|
language: z.ZodOptional<z.ZodString>;
|
|
23
50
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
24
51
|
proximity: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
@@ -27,8 +54,11 @@ declare const geocodingForwardRequestSchema: z.ZodObject<{
|
|
|
27
54
|
temporary: "temporary";
|
|
28
55
|
}>>;
|
|
29
56
|
}, z.core.$strict>;
|
|
57
|
+
/** Autocomplete returns each suggestion's place, with its position, when `place` is included. */
|
|
58
|
+
declare const autocompleteIncludeSchema: z.ZodTuple<[z.ZodLiteral<"place">], null>;
|
|
30
59
|
declare const autocompleteRequestSchema: z.ZodObject<{
|
|
31
60
|
bounds: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
|
|
61
|
+
include: z.ZodOptional<z.ZodTuple<[z.ZodLiteral<"place">], null>>;
|
|
32
62
|
language: z.ZodOptional<z.ZodString>;
|
|
33
63
|
limit: z.ZodDefault<z.ZodNumber>;
|
|
34
64
|
proximity: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
@@ -41,6 +71,12 @@ declare const reverseGeocodingKindSchema: z.ZodEnum<{
|
|
|
41
71
|
street: "street";
|
|
42
72
|
}>;
|
|
43
73
|
declare const geocodingReverseRequestSchema: z.ZodObject<{
|
|
74
|
+
include: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
75
|
+
accessPoints: "accessPoints";
|
|
76
|
+
contacts: "contacts";
|
|
77
|
+
openingHours: "openingHours";
|
|
78
|
+
timeZone: "timeZone";
|
|
79
|
+
}>>>;
|
|
44
80
|
kinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
45
81
|
address: "address";
|
|
46
82
|
locality: "locality";
|
|
@@ -84,11 +120,68 @@ declare const searchPlaceMetadata: {
|
|
|
84
120
|
localizedName: z.ZodOptional<z.ZodString>;
|
|
85
121
|
primary: z.ZodOptional<z.ZodBoolean>;
|
|
86
122
|
}, z.core.$strict>>>;
|
|
123
|
+
foodTypes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
124
|
+
id: z.ZodString;
|
|
125
|
+
name: z.ZodString;
|
|
126
|
+
localizedName: z.ZodOptional<z.ZodString>;
|
|
127
|
+
primary: z.ZodOptional<z.ZodBoolean>;
|
|
128
|
+
}, z.core.$strict>>>;
|
|
87
129
|
businessChains: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
88
130
|
id: z.ZodString;
|
|
89
131
|
name: z.ZodString;
|
|
90
132
|
}, z.core.$strict>>>;
|
|
91
133
|
};
|
|
134
|
+
/** Contact values are provider text, not validated links: check a scheme before linking one. */
|
|
135
|
+
declare const searchContactsSchema: z.ZodObject<{
|
|
136
|
+
phones: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
137
|
+
value: z.ZodString;
|
|
138
|
+
label: z.ZodOptional<z.ZodString>;
|
|
139
|
+
}, z.core.$strict>>>;
|
|
140
|
+
websites: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
141
|
+
value: z.ZodString;
|
|
142
|
+
label: z.ZodOptional<z.ZodString>;
|
|
143
|
+
}, z.core.$strict>>>;
|
|
144
|
+
emails: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
145
|
+
value: z.ZodString;
|
|
146
|
+
label: z.ZodOptional<z.ZodString>;
|
|
147
|
+
}, z.core.$strict>>>;
|
|
148
|
+
}, z.core.$strict>;
|
|
149
|
+
declare const searchOpeningHoursSchema: z.ZodArray<z.ZodObject<{
|
|
150
|
+
display: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
151
|
+
openNow: z.ZodOptional<z.ZodBoolean>;
|
|
152
|
+
}, z.core.$strict>>;
|
|
153
|
+
declare const searchTimeZoneSchema: z.ZodObject<{
|
|
154
|
+
name: z.ZodString;
|
|
155
|
+
utcOffsetSeconds: z.ZodOptional<z.ZodNumber>;
|
|
156
|
+
}, z.core.$strict>;
|
|
157
|
+
declare const searchPlaceDetailFields: {
|
|
158
|
+
distanceMeters: z.ZodOptional<z.ZodNumber>;
|
|
159
|
+
contacts: z.ZodOptional<z.ZodObject<{
|
|
160
|
+
phones: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
161
|
+
value: z.ZodString;
|
|
162
|
+
label: z.ZodOptional<z.ZodString>;
|
|
163
|
+
}, z.core.$strict>>>;
|
|
164
|
+
websites: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
165
|
+
value: z.ZodString;
|
|
166
|
+
label: z.ZodOptional<z.ZodString>;
|
|
167
|
+
}, z.core.$strict>>>;
|
|
168
|
+
emails: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
169
|
+
value: z.ZodString;
|
|
170
|
+
label: z.ZodOptional<z.ZodString>;
|
|
171
|
+
}, z.core.$strict>>>;
|
|
172
|
+
}, z.core.$strict>>;
|
|
173
|
+
openingHours: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
174
|
+
display: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
175
|
+
openNow: z.ZodOptional<z.ZodBoolean>;
|
|
176
|
+
}, z.core.$strict>>>;
|
|
177
|
+
timeZone: z.ZodOptional<z.ZodObject<{
|
|
178
|
+
name: z.ZodString;
|
|
179
|
+
utcOffsetSeconds: z.ZodOptional<z.ZodNumber>;
|
|
180
|
+
}, z.core.$strict>>;
|
|
181
|
+
accessPoints: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
182
|
+
position: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
183
|
+
}, z.core.$strict>>>;
|
|
184
|
+
};
|
|
92
185
|
declare const geocodingResultSchema: z.ZodObject<{
|
|
93
186
|
address: z.ZodObject<{
|
|
94
187
|
city: z.ZodOptional<z.ZodString>;
|
|
@@ -118,6 +211,32 @@ declare const geocodingResultSchema: z.ZodObject<{
|
|
|
118
211
|
label: z.ZodString;
|
|
119
212
|
position: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
120
213
|
sourceRef: z.ZodOptional<z.ZodString>;
|
|
214
|
+
distanceMeters: z.ZodOptional<z.ZodNumber>;
|
|
215
|
+
contacts: z.ZodOptional<z.ZodObject<{
|
|
216
|
+
phones: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
217
|
+
value: z.ZodString;
|
|
218
|
+
label: z.ZodOptional<z.ZodString>;
|
|
219
|
+
}, z.core.$strict>>>;
|
|
220
|
+
websites: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
221
|
+
value: z.ZodString;
|
|
222
|
+
label: z.ZodOptional<z.ZodString>;
|
|
223
|
+
}, z.core.$strict>>>;
|
|
224
|
+
emails: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
225
|
+
value: z.ZodString;
|
|
226
|
+
label: z.ZodOptional<z.ZodString>;
|
|
227
|
+
}, z.core.$strict>>>;
|
|
228
|
+
}, z.core.$strict>>;
|
|
229
|
+
openingHours: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
230
|
+
display: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
231
|
+
openNow: z.ZodOptional<z.ZodBoolean>;
|
|
232
|
+
}, z.core.$strict>>>;
|
|
233
|
+
timeZone: z.ZodOptional<z.ZodObject<{
|
|
234
|
+
name: z.ZodString;
|
|
235
|
+
utcOffsetSeconds: z.ZodOptional<z.ZodNumber>;
|
|
236
|
+
}, z.core.$strict>>;
|
|
237
|
+
accessPoints: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
238
|
+
position: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
239
|
+
}, z.core.$strict>>>;
|
|
121
240
|
name: z.ZodOptional<z.ZodString>;
|
|
122
241
|
categories: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
123
242
|
id: z.ZodString;
|
|
@@ -125,6 +244,12 @@ declare const geocodingResultSchema: z.ZodObject<{
|
|
|
125
244
|
localizedName: z.ZodOptional<z.ZodString>;
|
|
126
245
|
primary: z.ZodOptional<z.ZodBoolean>;
|
|
127
246
|
}, z.core.$strict>>>;
|
|
247
|
+
foodTypes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
248
|
+
id: z.ZodString;
|
|
249
|
+
name: z.ZodString;
|
|
250
|
+
localizedName: z.ZodOptional<z.ZodString>;
|
|
251
|
+
primary: z.ZodOptional<z.ZodBoolean>;
|
|
252
|
+
}, z.core.$strict>>>;
|
|
128
253
|
businessChains: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
129
254
|
id: z.ZodString;
|
|
130
255
|
name: z.ZodString;
|
|
@@ -173,6 +298,32 @@ declare const geocodingForwardResponseSchema: z.ZodObject<{
|
|
|
173
298
|
label: z.ZodString;
|
|
174
299
|
position: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
175
300
|
sourceRef: z.ZodOptional<z.ZodString>;
|
|
301
|
+
distanceMeters: z.ZodOptional<z.ZodNumber>;
|
|
302
|
+
contacts: z.ZodOptional<z.ZodObject<{
|
|
303
|
+
phones: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
304
|
+
value: z.ZodString;
|
|
305
|
+
label: z.ZodOptional<z.ZodString>;
|
|
306
|
+
}, z.core.$strict>>>;
|
|
307
|
+
websites: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
308
|
+
value: z.ZodString;
|
|
309
|
+
label: z.ZodOptional<z.ZodString>;
|
|
310
|
+
}, z.core.$strict>>>;
|
|
311
|
+
emails: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
312
|
+
value: z.ZodString;
|
|
313
|
+
label: z.ZodOptional<z.ZodString>;
|
|
314
|
+
}, z.core.$strict>>>;
|
|
315
|
+
}, z.core.$strict>>;
|
|
316
|
+
openingHours: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
317
|
+
display: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
318
|
+
openNow: z.ZodOptional<z.ZodBoolean>;
|
|
319
|
+
}, z.core.$strict>>>;
|
|
320
|
+
timeZone: z.ZodOptional<z.ZodObject<{
|
|
321
|
+
name: z.ZodString;
|
|
322
|
+
utcOffsetSeconds: z.ZodOptional<z.ZodNumber>;
|
|
323
|
+
}, z.core.$strict>>;
|
|
324
|
+
accessPoints: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
325
|
+
position: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
326
|
+
}, z.core.$strict>>>;
|
|
176
327
|
name: z.ZodOptional<z.ZodString>;
|
|
177
328
|
categories: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
178
329
|
id: z.ZodString;
|
|
@@ -180,6 +331,12 @@ declare const geocodingForwardResponseSchema: z.ZodObject<{
|
|
|
180
331
|
localizedName: z.ZodOptional<z.ZodString>;
|
|
181
332
|
primary: z.ZodOptional<z.ZodBoolean>;
|
|
182
333
|
}, z.core.$strict>>>;
|
|
334
|
+
foodTypes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
335
|
+
id: z.ZodString;
|
|
336
|
+
name: z.ZodString;
|
|
337
|
+
localizedName: z.ZodOptional<z.ZodString>;
|
|
338
|
+
primary: z.ZodOptional<z.ZodBoolean>;
|
|
339
|
+
}, z.core.$strict>>>;
|
|
183
340
|
businessChains: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
184
341
|
id: z.ZodString;
|
|
185
342
|
name: z.ZodString;
|
|
@@ -191,7 +348,7 @@ declare const geocodingForwardResponseSchema: z.ZodObject<{
|
|
|
191
348
|
revision: z.ZodNullable<z.ZodString>;
|
|
192
349
|
}, z.core.$strict>;
|
|
193
350
|
usage: z.ZodObject<{
|
|
194
|
-
units: z.ZodLiteral<25>;
|
|
351
|
+
units: z.ZodUnion<readonly [z.ZodLiteral<25>, z.ZodLiteral<75>]>;
|
|
195
352
|
}, z.core.$strict>;
|
|
196
353
|
}, z.core.$strict>;
|
|
197
354
|
declare const geocodingReverseResponseSchema: z.ZodObject<{
|
|
@@ -229,6 +386,32 @@ declare const geocodingReverseResponseSchema: z.ZodObject<{
|
|
|
229
386
|
label: z.ZodString;
|
|
230
387
|
position: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
231
388
|
sourceRef: z.ZodOptional<z.ZodString>;
|
|
389
|
+
distanceMeters: z.ZodOptional<z.ZodNumber>;
|
|
390
|
+
contacts: z.ZodOptional<z.ZodObject<{
|
|
391
|
+
phones: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
392
|
+
value: z.ZodString;
|
|
393
|
+
label: z.ZodOptional<z.ZodString>;
|
|
394
|
+
}, z.core.$strict>>>;
|
|
395
|
+
websites: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
396
|
+
value: z.ZodString;
|
|
397
|
+
label: z.ZodOptional<z.ZodString>;
|
|
398
|
+
}, z.core.$strict>>>;
|
|
399
|
+
emails: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
400
|
+
value: z.ZodString;
|
|
401
|
+
label: z.ZodOptional<z.ZodString>;
|
|
402
|
+
}, z.core.$strict>>>;
|
|
403
|
+
}, z.core.$strict>>;
|
|
404
|
+
openingHours: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
405
|
+
display: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
406
|
+
openNow: z.ZodOptional<z.ZodBoolean>;
|
|
407
|
+
}, z.core.$strict>>>;
|
|
408
|
+
timeZone: z.ZodOptional<z.ZodObject<{
|
|
409
|
+
name: z.ZodString;
|
|
410
|
+
utcOffsetSeconds: z.ZodOptional<z.ZodNumber>;
|
|
411
|
+
}, z.core.$strict>>;
|
|
412
|
+
accessPoints: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
413
|
+
position: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
414
|
+
}, z.core.$strict>>>;
|
|
232
415
|
name: z.ZodOptional<z.ZodString>;
|
|
233
416
|
categories: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
234
417
|
id: z.ZodString;
|
|
@@ -236,6 +419,12 @@ declare const geocodingReverseResponseSchema: z.ZodObject<{
|
|
|
236
419
|
localizedName: z.ZodOptional<z.ZodString>;
|
|
237
420
|
primary: z.ZodOptional<z.ZodBoolean>;
|
|
238
421
|
}, z.core.$strict>>>;
|
|
422
|
+
foodTypes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
423
|
+
id: z.ZodString;
|
|
424
|
+
name: z.ZodString;
|
|
425
|
+
localizedName: z.ZodOptional<z.ZodString>;
|
|
426
|
+
primary: z.ZodOptional<z.ZodBoolean>;
|
|
427
|
+
}, z.core.$strict>>>;
|
|
239
428
|
businessChains: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
240
429
|
id: z.ZodString;
|
|
241
430
|
name: z.ZodString;
|
|
@@ -247,7 +436,7 @@ declare const geocodingReverseResponseSchema: z.ZodObject<{
|
|
|
247
436
|
revision: z.ZodNullable<z.ZodString>;
|
|
248
437
|
}, z.core.$strict>;
|
|
249
438
|
usage: z.ZodObject<{
|
|
250
|
-
units: z.ZodLiteral<25>;
|
|
439
|
+
units: z.ZodUnion<readonly [z.ZodLiteral<25>, z.ZodLiteral<75>]>;
|
|
251
440
|
}, z.core.$strict>;
|
|
252
441
|
}, z.core.$strict>;
|
|
253
442
|
declare const geocodingSuggestionSchema: z.ZodObject<{
|
|
@@ -263,6 +452,80 @@ declare const geocodingSuggestionSchema: z.ZodObject<{
|
|
|
263
452
|
unknown: "unknown";
|
|
264
453
|
}>;
|
|
265
454
|
label: z.ZodString;
|
|
455
|
+
addressLabel: z.ZodOptional<z.ZodString>;
|
|
456
|
+
place: z.ZodOptional<z.ZodObject<{
|
|
457
|
+
address: z.ZodObject<{
|
|
458
|
+
city: z.ZodOptional<z.ZodString>;
|
|
459
|
+
country: z.ZodOptional<z.ZodString>;
|
|
460
|
+
countryCode: z.ZodOptional<z.ZodString>;
|
|
461
|
+
county: z.ZodOptional<z.ZodString>;
|
|
462
|
+
district: z.ZodOptional<z.ZodString>;
|
|
463
|
+
houseNumber: z.ZodOptional<z.ZodString>;
|
|
464
|
+
locality: z.ZodOptional<z.ZodString>;
|
|
465
|
+
name: z.ZodOptional<z.ZodString>;
|
|
466
|
+
postalCode: z.ZodOptional<z.ZodString>;
|
|
467
|
+
region: z.ZodOptional<z.ZodString>;
|
|
468
|
+
street: z.ZodOptional<z.ZodString>;
|
|
469
|
+
}, z.core.$strict>;
|
|
470
|
+
bounds: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
|
|
471
|
+
kind: z.ZodEnum<{
|
|
472
|
+
address: "address";
|
|
473
|
+
country: "country";
|
|
474
|
+
county: "county";
|
|
475
|
+
district: "district";
|
|
476
|
+
locality: "locality";
|
|
477
|
+
place: "place";
|
|
478
|
+
region: "region";
|
|
479
|
+
street: "street";
|
|
480
|
+
unknown: "unknown";
|
|
481
|
+
}>;
|
|
482
|
+
label: z.ZodString;
|
|
483
|
+
position: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
484
|
+
sourceRef: z.ZodOptional<z.ZodString>;
|
|
485
|
+
distanceMeters: z.ZodOptional<z.ZodNumber>;
|
|
486
|
+
contacts: z.ZodOptional<z.ZodObject<{
|
|
487
|
+
phones: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
488
|
+
value: z.ZodString;
|
|
489
|
+
label: z.ZodOptional<z.ZodString>;
|
|
490
|
+
}, z.core.$strict>>>;
|
|
491
|
+
websites: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
492
|
+
value: z.ZodString;
|
|
493
|
+
label: z.ZodOptional<z.ZodString>;
|
|
494
|
+
}, z.core.$strict>>>;
|
|
495
|
+
emails: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
496
|
+
value: z.ZodString;
|
|
497
|
+
label: z.ZodOptional<z.ZodString>;
|
|
498
|
+
}, z.core.$strict>>>;
|
|
499
|
+
}, z.core.$strict>>;
|
|
500
|
+
openingHours: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
501
|
+
display: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
502
|
+
openNow: z.ZodOptional<z.ZodBoolean>;
|
|
503
|
+
}, z.core.$strict>>>;
|
|
504
|
+
timeZone: z.ZodOptional<z.ZodObject<{
|
|
505
|
+
name: z.ZodString;
|
|
506
|
+
utcOffsetSeconds: z.ZodOptional<z.ZodNumber>;
|
|
507
|
+
}, z.core.$strict>>;
|
|
508
|
+
accessPoints: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
509
|
+
position: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
510
|
+
}, z.core.$strict>>>;
|
|
511
|
+
name: z.ZodOptional<z.ZodString>;
|
|
512
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
513
|
+
id: z.ZodString;
|
|
514
|
+
name: z.ZodString;
|
|
515
|
+
localizedName: z.ZodOptional<z.ZodString>;
|
|
516
|
+
primary: z.ZodOptional<z.ZodBoolean>;
|
|
517
|
+
}, z.core.$strict>>>;
|
|
518
|
+
foodTypes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
519
|
+
id: z.ZodString;
|
|
520
|
+
name: z.ZodString;
|
|
521
|
+
localizedName: z.ZodOptional<z.ZodString>;
|
|
522
|
+
primary: z.ZodOptional<z.ZodBoolean>;
|
|
523
|
+
}, z.core.$strict>>>;
|
|
524
|
+
businessChains: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
525
|
+
id: z.ZodString;
|
|
526
|
+
name: z.ZodString;
|
|
527
|
+
}, z.core.$strict>>>;
|
|
528
|
+
}, z.core.$strict>>;
|
|
266
529
|
token: z.ZodString;
|
|
267
530
|
}, z.core.$strict>;
|
|
268
531
|
declare const autocompleteResponseSchema: z.ZodObject<{
|
|
@@ -288,13 +551,93 @@ declare const autocompleteResponseSchema: z.ZodObject<{
|
|
|
288
551
|
unknown: "unknown";
|
|
289
552
|
}>;
|
|
290
553
|
label: z.ZodString;
|
|
554
|
+
addressLabel: z.ZodOptional<z.ZodString>;
|
|
555
|
+
place: z.ZodOptional<z.ZodObject<{
|
|
556
|
+
address: z.ZodObject<{
|
|
557
|
+
city: z.ZodOptional<z.ZodString>;
|
|
558
|
+
country: z.ZodOptional<z.ZodString>;
|
|
559
|
+
countryCode: z.ZodOptional<z.ZodString>;
|
|
560
|
+
county: z.ZodOptional<z.ZodString>;
|
|
561
|
+
district: z.ZodOptional<z.ZodString>;
|
|
562
|
+
houseNumber: z.ZodOptional<z.ZodString>;
|
|
563
|
+
locality: z.ZodOptional<z.ZodString>;
|
|
564
|
+
name: z.ZodOptional<z.ZodString>;
|
|
565
|
+
postalCode: z.ZodOptional<z.ZodString>;
|
|
566
|
+
region: z.ZodOptional<z.ZodString>;
|
|
567
|
+
street: z.ZodOptional<z.ZodString>;
|
|
568
|
+
}, z.core.$strict>;
|
|
569
|
+
bounds: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
|
|
570
|
+
kind: z.ZodEnum<{
|
|
571
|
+
address: "address";
|
|
572
|
+
country: "country";
|
|
573
|
+
county: "county";
|
|
574
|
+
district: "district";
|
|
575
|
+
locality: "locality";
|
|
576
|
+
place: "place";
|
|
577
|
+
region: "region";
|
|
578
|
+
street: "street";
|
|
579
|
+
unknown: "unknown";
|
|
580
|
+
}>;
|
|
581
|
+
label: z.ZodString;
|
|
582
|
+
position: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
583
|
+
sourceRef: z.ZodOptional<z.ZodString>;
|
|
584
|
+
distanceMeters: z.ZodOptional<z.ZodNumber>;
|
|
585
|
+
contacts: z.ZodOptional<z.ZodObject<{
|
|
586
|
+
phones: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
587
|
+
value: z.ZodString;
|
|
588
|
+
label: z.ZodOptional<z.ZodString>;
|
|
589
|
+
}, z.core.$strict>>>;
|
|
590
|
+
websites: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
591
|
+
value: z.ZodString;
|
|
592
|
+
label: z.ZodOptional<z.ZodString>;
|
|
593
|
+
}, z.core.$strict>>>;
|
|
594
|
+
emails: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
595
|
+
value: z.ZodString;
|
|
596
|
+
label: z.ZodOptional<z.ZodString>;
|
|
597
|
+
}, z.core.$strict>>>;
|
|
598
|
+
}, z.core.$strict>>;
|
|
599
|
+
openingHours: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
600
|
+
display: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
601
|
+
openNow: z.ZodOptional<z.ZodBoolean>;
|
|
602
|
+
}, z.core.$strict>>>;
|
|
603
|
+
timeZone: z.ZodOptional<z.ZodObject<{
|
|
604
|
+
name: z.ZodString;
|
|
605
|
+
utcOffsetSeconds: z.ZodOptional<z.ZodNumber>;
|
|
606
|
+
}, z.core.$strict>>;
|
|
607
|
+
accessPoints: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
608
|
+
position: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
609
|
+
}, z.core.$strict>>>;
|
|
610
|
+
name: z.ZodOptional<z.ZodString>;
|
|
611
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
612
|
+
id: z.ZodString;
|
|
613
|
+
name: z.ZodString;
|
|
614
|
+
localizedName: z.ZodOptional<z.ZodString>;
|
|
615
|
+
primary: z.ZodOptional<z.ZodBoolean>;
|
|
616
|
+
}, z.core.$strict>>>;
|
|
617
|
+
foodTypes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
618
|
+
id: z.ZodString;
|
|
619
|
+
name: z.ZodString;
|
|
620
|
+
localizedName: z.ZodOptional<z.ZodString>;
|
|
621
|
+
primary: z.ZodOptional<z.ZodBoolean>;
|
|
622
|
+
}, z.core.$strict>>>;
|
|
623
|
+
businessChains: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
624
|
+
id: z.ZodString;
|
|
625
|
+
name: z.ZodString;
|
|
626
|
+
}, z.core.$strict>>>;
|
|
627
|
+
}, z.core.$strict>>;
|
|
291
628
|
token: z.ZodString;
|
|
292
629
|
}, z.core.$strict>>;
|
|
293
630
|
usage: z.ZodObject<{
|
|
294
|
-
units: z.ZodLiteral<10>;
|
|
631
|
+
units: z.ZodUnion<readonly [z.ZodLiteral<10>, z.ZodLiteral<25>]>;
|
|
295
632
|
}, z.core.$strict>;
|
|
296
633
|
}, z.core.$strict>;
|
|
297
634
|
declare const resolveSuggestionRequestSchema: z.ZodObject<{
|
|
635
|
+
include: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
636
|
+
accessPoints: "accessPoints";
|
|
637
|
+
contacts: "contacts";
|
|
638
|
+
openingHours: "openingHours";
|
|
639
|
+
timeZone: "timeZone";
|
|
640
|
+
}>>>;
|
|
298
641
|
retention: z.ZodDefault<z.ZodEnum<{
|
|
299
642
|
temporary: "temporary";
|
|
300
643
|
}>>;
|
|
@@ -334,6 +677,32 @@ declare const resolveSuggestionResponseSchema: z.ZodObject<{
|
|
|
334
677
|
label: z.ZodString;
|
|
335
678
|
position: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
336
679
|
sourceRef: z.ZodOptional<z.ZodString>;
|
|
680
|
+
distanceMeters: z.ZodOptional<z.ZodNumber>;
|
|
681
|
+
contacts: z.ZodOptional<z.ZodObject<{
|
|
682
|
+
phones: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
683
|
+
value: z.ZodString;
|
|
684
|
+
label: z.ZodOptional<z.ZodString>;
|
|
685
|
+
}, z.core.$strict>>>;
|
|
686
|
+
websites: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
687
|
+
value: z.ZodString;
|
|
688
|
+
label: z.ZodOptional<z.ZodString>;
|
|
689
|
+
}, z.core.$strict>>>;
|
|
690
|
+
emails: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
691
|
+
value: z.ZodString;
|
|
692
|
+
label: z.ZodOptional<z.ZodString>;
|
|
693
|
+
}, z.core.$strict>>>;
|
|
694
|
+
}, z.core.$strict>>;
|
|
695
|
+
openingHours: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
696
|
+
display: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
697
|
+
openNow: z.ZodOptional<z.ZodBoolean>;
|
|
698
|
+
}, z.core.$strict>>>;
|
|
699
|
+
timeZone: z.ZodOptional<z.ZodObject<{
|
|
700
|
+
name: z.ZodString;
|
|
701
|
+
utcOffsetSeconds: z.ZodOptional<z.ZodNumber>;
|
|
702
|
+
}, z.core.$strict>>;
|
|
703
|
+
accessPoints: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
704
|
+
position: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
705
|
+
}, z.core.$strict>>>;
|
|
337
706
|
name: z.ZodOptional<z.ZodString>;
|
|
338
707
|
categories: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
339
708
|
id: z.ZodString;
|
|
@@ -341,6 +710,12 @@ declare const resolveSuggestionResponseSchema: z.ZodObject<{
|
|
|
341
710
|
localizedName: z.ZodOptional<z.ZodString>;
|
|
342
711
|
primary: z.ZodOptional<z.ZodBoolean>;
|
|
343
712
|
}, z.core.$strict>>>;
|
|
713
|
+
foodTypes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
714
|
+
id: z.ZodString;
|
|
715
|
+
name: z.ZodString;
|
|
716
|
+
localizedName: z.ZodOptional<z.ZodString>;
|
|
717
|
+
primary: z.ZodOptional<z.ZodBoolean>;
|
|
718
|
+
}, z.core.$strict>>>;
|
|
344
719
|
businessChains: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
345
720
|
id: z.ZodString;
|
|
346
721
|
name: z.ZodString;
|
|
@@ -352,7 +727,7 @@ declare const resolveSuggestionResponseSchema: z.ZodObject<{
|
|
|
352
727
|
revision: z.ZodNullable<z.ZodString>;
|
|
353
728
|
}, z.core.$strict>;
|
|
354
729
|
usage: z.ZodObject<{
|
|
355
|
-
units: z.ZodLiteral<25>;
|
|
730
|
+
units: z.ZodUnion<readonly [z.ZodLiteral<25>, z.ZodLiteral<75>]>;
|
|
356
731
|
}, z.core.$strict>;
|
|
357
732
|
}, z.core.$strict>;
|
|
358
733
|
type GeocodingForwardRequest = z.input<typeof geocodingForwardRequestSchema>;
|
|
@@ -361,6 +736,10 @@ type ReverseGeocodingKind = z.infer<typeof reverseGeocodingKindSchema>;
|
|
|
361
736
|
type GeocodingReverseRequest = z.input<typeof geocodingReverseRequestSchema>;
|
|
362
737
|
type NormalizedGeocodingReverseRequest = z.output<typeof geocodingReverseRequestSchema>;
|
|
363
738
|
type GeocodingResult = z.infer<typeof geocodingResultSchema>;
|
|
739
|
+
type SearchPlaceDetail = z.infer<typeof searchPlaceDetailSchema>;
|
|
740
|
+
type SearchContacts = z.infer<typeof searchContactsSchema>;
|
|
741
|
+
type SearchOpeningHours = z.infer<typeof searchOpeningHoursSchema>;
|
|
742
|
+
type SearchTimeZone = z.infer<typeof searchTimeZoneSchema>;
|
|
364
743
|
type GeocodingForwardResponse = z.infer<typeof geocodingForwardResponseSchema>;
|
|
365
744
|
type GeocodingReverseResponse = GeocodingForwardResponse;
|
|
366
745
|
type AutocompleteRequest = z.input<typeof autocompleteRequestSchema>;
|
|
@@ -390,11 +769,42 @@ declare const nearbyRequestSchema: z.ZodObject<{
|
|
|
390
769
|
excludeCategories: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
391
770
|
countries: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
392
771
|
language: z.ZodOptional<z.ZodString>;
|
|
772
|
+
include: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
773
|
+
accessPoints: "accessPoints";
|
|
774
|
+
contacts: "contacts";
|
|
775
|
+
openingHours: "openingHours";
|
|
776
|
+
timeZone: "timeZone";
|
|
777
|
+
}>>>;
|
|
393
778
|
limit: z.ZodDefault<z.ZodNumber>;
|
|
394
779
|
cursor: z.ZodOptional<z.ZodString>;
|
|
395
780
|
}, z.core.$strict>;
|
|
396
781
|
declare const nearbyPlaceSchema: z.ZodObject<{
|
|
397
782
|
bounds: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
|
|
783
|
+
contacts: z.ZodOptional<z.ZodObject<{
|
|
784
|
+
phones: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
785
|
+
value: z.ZodString;
|
|
786
|
+
label: z.ZodOptional<z.ZodString>;
|
|
787
|
+
}, z.core.$strict>>>;
|
|
788
|
+
websites: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
789
|
+
value: z.ZodString;
|
|
790
|
+
label: z.ZodOptional<z.ZodString>;
|
|
791
|
+
}, z.core.$strict>>>;
|
|
792
|
+
emails: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
793
|
+
value: z.ZodString;
|
|
794
|
+
label: z.ZodOptional<z.ZodString>;
|
|
795
|
+
}, z.core.$strict>>>;
|
|
796
|
+
}, z.core.$strict>>;
|
|
797
|
+
openingHours: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
798
|
+
display: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
799
|
+
openNow: z.ZodOptional<z.ZodBoolean>;
|
|
800
|
+
}, z.core.$strict>>>;
|
|
801
|
+
timeZone: z.ZodOptional<z.ZodObject<{
|
|
802
|
+
name: z.ZodString;
|
|
803
|
+
utcOffsetSeconds: z.ZodOptional<z.ZodNumber>;
|
|
804
|
+
}, z.core.$strict>>;
|
|
805
|
+
accessPoints: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
806
|
+
position: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
807
|
+
}, z.core.$strict>>>;
|
|
398
808
|
address: z.ZodObject<{
|
|
399
809
|
city: z.ZodOptional<z.ZodString>;
|
|
400
810
|
country: z.ZodOptional<z.ZodString>;
|
|
@@ -417,12 +827,18 @@ declare const nearbyPlaceSchema: z.ZodObject<{
|
|
|
417
827
|
localizedName: z.ZodOptional<z.ZodString>;
|
|
418
828
|
primary: z.ZodOptional<z.ZodBoolean>;
|
|
419
829
|
}, z.core.$strict>>>;
|
|
830
|
+
distanceMeters: z.ZodOptional<z.ZodNumber>;
|
|
831
|
+
foodTypes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
832
|
+
id: z.ZodString;
|
|
833
|
+
name: z.ZodString;
|
|
834
|
+
localizedName: z.ZodOptional<z.ZodString>;
|
|
835
|
+
primary: z.ZodOptional<z.ZodBoolean>;
|
|
836
|
+
}, z.core.$strict>>>;
|
|
420
837
|
businessChains: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
421
838
|
id: z.ZodString;
|
|
422
839
|
name: z.ZodString;
|
|
423
840
|
}, z.core.$strict>>>;
|
|
424
841
|
kind: z.ZodLiteral<"place">;
|
|
425
|
-
distanceMeters: z.ZodOptional<z.ZodNumber>;
|
|
426
842
|
token: z.ZodOptional<z.ZodString>;
|
|
427
843
|
}, z.core.$strict>;
|
|
428
844
|
declare const nearbyResponseSchema: z.ZodObject<{
|
|
@@ -430,6 +846,31 @@ declare const nearbyResponseSchema: z.ZodObject<{
|
|
|
430
846
|
provider: z.ZodLiteral<"aws">;
|
|
431
847
|
results: z.ZodArray<z.ZodObject<{
|
|
432
848
|
bounds: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
|
|
849
|
+
contacts: z.ZodOptional<z.ZodObject<{
|
|
850
|
+
phones: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
851
|
+
value: z.ZodString;
|
|
852
|
+
label: z.ZodOptional<z.ZodString>;
|
|
853
|
+
}, z.core.$strict>>>;
|
|
854
|
+
websites: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
855
|
+
value: z.ZodString;
|
|
856
|
+
label: z.ZodOptional<z.ZodString>;
|
|
857
|
+
}, z.core.$strict>>>;
|
|
858
|
+
emails: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
859
|
+
value: z.ZodString;
|
|
860
|
+
label: z.ZodOptional<z.ZodString>;
|
|
861
|
+
}, z.core.$strict>>>;
|
|
862
|
+
}, z.core.$strict>>;
|
|
863
|
+
openingHours: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
864
|
+
display: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
865
|
+
openNow: z.ZodOptional<z.ZodBoolean>;
|
|
866
|
+
}, z.core.$strict>>>;
|
|
867
|
+
timeZone: z.ZodOptional<z.ZodObject<{
|
|
868
|
+
name: z.ZodString;
|
|
869
|
+
utcOffsetSeconds: z.ZodOptional<z.ZodNumber>;
|
|
870
|
+
}, z.core.$strict>>;
|
|
871
|
+
accessPoints: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
872
|
+
position: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
873
|
+
}, z.core.$strict>>>;
|
|
433
874
|
address: z.ZodObject<{
|
|
434
875
|
city: z.ZodOptional<z.ZodString>;
|
|
435
876
|
country: z.ZodOptional<z.ZodString>;
|
|
@@ -452,12 +893,18 @@ declare const nearbyResponseSchema: z.ZodObject<{
|
|
|
452
893
|
localizedName: z.ZodOptional<z.ZodString>;
|
|
453
894
|
primary: z.ZodOptional<z.ZodBoolean>;
|
|
454
895
|
}, z.core.$strict>>>;
|
|
896
|
+
distanceMeters: z.ZodOptional<z.ZodNumber>;
|
|
897
|
+
foodTypes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
898
|
+
id: z.ZodString;
|
|
899
|
+
name: z.ZodString;
|
|
900
|
+
localizedName: z.ZodOptional<z.ZodString>;
|
|
901
|
+
primary: z.ZodOptional<z.ZodBoolean>;
|
|
902
|
+
}, z.core.$strict>>>;
|
|
455
903
|
businessChains: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
456
904
|
id: z.ZodString;
|
|
457
905
|
name: z.ZodString;
|
|
458
906
|
}, z.core.$strict>>>;
|
|
459
907
|
kind: z.ZodLiteral<"place">;
|
|
460
|
-
distanceMeters: z.ZodOptional<z.ZodNumber>;
|
|
461
908
|
token: z.ZodOptional<z.ZodString>;
|
|
462
909
|
}, z.core.$strict>>;
|
|
463
910
|
nextCursor: z.ZodOptional<z.ZodString>;
|
|
@@ -470,7 +917,7 @@ declare const nearbyResponseSchema: z.ZodObject<{
|
|
|
470
917
|
url: z.ZodOptional<z.ZodString>;
|
|
471
918
|
}, z.core.$strict>>;
|
|
472
919
|
usage: z.ZodObject<{
|
|
473
|
-
units: z.ZodLiteral<25>;
|
|
920
|
+
units: z.ZodUnion<readonly [z.ZodLiteral<25>, z.ZodLiteral<75>]>;
|
|
474
921
|
}, z.core.$strict>;
|
|
475
922
|
}, z.core.$strict>;
|
|
476
923
|
declare const searchCategoriesResponseSchema: z.ZodObject<{
|
|
@@ -495,6 +942,12 @@ declare const searchCategoriesResponseSchema: z.ZodObject<{
|
|
|
495
942
|
}, z.core.$strict>;
|
|
496
943
|
}, z.core.$strict>;
|
|
497
944
|
declare const resolvePlaceRequestSchema: z.ZodObject<{
|
|
945
|
+
include: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
946
|
+
accessPoints: "accessPoints";
|
|
947
|
+
contacts: "contacts";
|
|
948
|
+
openingHours: "openingHours";
|
|
949
|
+
timeZone: "timeZone";
|
|
950
|
+
}>>>;
|
|
498
951
|
retention: z.ZodDefault<z.ZodEnum<{
|
|
499
952
|
temporary: "temporary";
|
|
500
953
|
}>>;
|
|
@@ -534,6 +987,32 @@ declare const resolvePlaceResponseSchema: z.ZodObject<{
|
|
|
534
987
|
label: z.ZodString;
|
|
535
988
|
position: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
536
989
|
sourceRef: z.ZodOptional<z.ZodString>;
|
|
990
|
+
distanceMeters: z.ZodOptional<z.ZodNumber>;
|
|
991
|
+
contacts: z.ZodOptional<z.ZodObject<{
|
|
992
|
+
phones: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
993
|
+
value: z.ZodString;
|
|
994
|
+
label: z.ZodOptional<z.ZodString>;
|
|
995
|
+
}, z.core.$strict>>>;
|
|
996
|
+
websites: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
997
|
+
value: z.ZodString;
|
|
998
|
+
label: z.ZodOptional<z.ZodString>;
|
|
999
|
+
}, z.core.$strict>>>;
|
|
1000
|
+
emails: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1001
|
+
value: z.ZodString;
|
|
1002
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1003
|
+
}, z.core.$strict>>>;
|
|
1004
|
+
}, z.core.$strict>>;
|
|
1005
|
+
openingHours: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1006
|
+
display: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1007
|
+
openNow: z.ZodOptional<z.ZodBoolean>;
|
|
1008
|
+
}, z.core.$strict>>>;
|
|
1009
|
+
timeZone: z.ZodOptional<z.ZodObject<{
|
|
1010
|
+
name: z.ZodString;
|
|
1011
|
+
utcOffsetSeconds: z.ZodOptional<z.ZodNumber>;
|
|
1012
|
+
}, z.core.$strict>>;
|
|
1013
|
+
accessPoints: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1014
|
+
position: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
1015
|
+
}, z.core.$strict>>>;
|
|
537
1016
|
name: z.ZodOptional<z.ZodString>;
|
|
538
1017
|
categories: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
539
1018
|
id: z.ZodString;
|
|
@@ -541,6 +1020,12 @@ declare const resolvePlaceResponseSchema: z.ZodObject<{
|
|
|
541
1020
|
localizedName: z.ZodOptional<z.ZodString>;
|
|
542
1021
|
primary: z.ZodOptional<z.ZodBoolean>;
|
|
543
1022
|
}, z.core.$strict>>>;
|
|
1023
|
+
foodTypes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1024
|
+
id: z.ZodString;
|
|
1025
|
+
name: z.ZodString;
|
|
1026
|
+
localizedName: z.ZodOptional<z.ZodString>;
|
|
1027
|
+
primary: z.ZodOptional<z.ZodBoolean>;
|
|
1028
|
+
}, z.core.$strict>>>;
|
|
544
1029
|
businessChains: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
545
1030
|
id: z.ZodString;
|
|
546
1031
|
name: z.ZodString;
|
|
@@ -552,7 +1037,7 @@ declare const resolvePlaceResponseSchema: z.ZodObject<{
|
|
|
552
1037
|
revision: z.ZodNullable<z.ZodString>;
|
|
553
1038
|
}, z.core.$strict>;
|
|
554
1039
|
usage: z.ZodObject<{
|
|
555
|
-
units: z.ZodLiteral<25>;
|
|
1040
|
+
units: z.ZodUnion<readonly [z.ZodLiteral<25>, z.ZodLiteral<75>]>;
|
|
556
1041
|
}, z.core.$strict>;
|
|
557
1042
|
}, z.core.$strict>;
|
|
558
1043
|
type NearbyRequest = z.input<typeof nearbyRequestSchema>;
|
|
@@ -563,5 +1048,13 @@ type SearchCategory = z.infer<typeof searchCategorySchema>;
|
|
|
563
1048
|
type SearchCategoriesResponse = z.infer<typeof searchCategoriesResponseSchema>;
|
|
564
1049
|
type ResolvePlaceRequest = ResolveSuggestionRequest;
|
|
565
1050
|
type ResolvePlaceResponse = ResolveSuggestionResponse;
|
|
1051
|
+
/** Place details that need a provider text search or a selected place: not geocoding. */
|
|
1052
|
+
declare const searchContactDetails: readonly SearchPlaceDetail[];
|
|
1053
|
+
/**
|
|
1054
|
+
* The shared API units a completed Search operation consumes. Autocomplete uses 10, or 25 with
|
|
1055
|
+
* its places; every other place operation uses 25, or 75 with any place detail. Category
|
|
1056
|
+
* discovery uses none.
|
|
1057
|
+
*/
|
|
1058
|
+
declare function searchOperationUnits(operation: 'autocomplete' | 'forward' | 'reverse' | 'resolve' | 'nearby' | 'categories', include?: readonly string[]): 0 | 10 | 25 | 75;
|
|
566
1059
|
|
|
567
|
-
export { type AutocompleteRequest, type AutocompleteResponse, type GeocodingForwardRequest, type GeocodingForwardResponse, type GeocodingResult, type GeocodingReverseRequest, type GeocodingReverseResponse, type GeocodingSuggestion, type NearbyPlace, type NearbyRequest, type NearbyResponse, type NormalizedAutocompleteRequest, type NormalizedGeocodingForwardRequest, type NormalizedGeocodingReverseRequest, type NormalizedNearbyRequest, type NormalizedResolveSuggestionRequest, type ResolvePlaceRequest, type ResolvePlaceResponse, type ResolveSuggestionRequest, type ResolveSuggestionResponse, type ReverseGeocodingKind, type SearchCategoriesResponse, type SearchCategory, autocompleteRequestSchema, autocompleteResponseSchema, geocodingAddressSchema, geocodingAttributionSchema, geocodingBoundsSchema, geocodingForwardRequestSchema, geocodingForwardResponseSchema, geocodingLimits, geocodingPositionSchema, geocodingResultKinds, geocodingResultSchema, geocodingRetentionModes, geocodingReverseRequestSchema, geocodingReverseResponseSchema, geocodingSourceSchema, geocodingSuggestionSchema, nearbyCursorSchema, nearbyLimits, nearbyPlaceSchema, nearbyRequestSchema, nearbyResponseSchema, resolvePlaceRequestSchema, resolvePlaceResponseSchema, resolveSuggestionRequestSchema, resolveSuggestionResponseSchema, reverseGeocodingKindSchema, searchCategoriesResponseSchema, searchCategoryIdSchema, searchCategorySchema, searchLiteralText, searchPlaceMetadata };
|
|
1060
|
+
export { type AutocompleteRequest, type AutocompleteResponse, type GeocodingForwardRequest, type GeocodingForwardResponse, type GeocodingResult, type GeocodingReverseRequest, type GeocodingReverseResponse, type GeocodingSuggestion, type NearbyPlace, type NearbyRequest, type NearbyResponse, type NormalizedAutocompleteRequest, type NormalizedGeocodingForwardRequest, type NormalizedGeocodingReverseRequest, type NormalizedNearbyRequest, type NormalizedResolveSuggestionRequest, type ResolvePlaceRequest, type ResolvePlaceResponse, type ResolveSuggestionRequest, type ResolveSuggestionResponse, type ReverseGeocodingKind, type SearchCategoriesResponse, type SearchCategory, type SearchContacts, type SearchOpeningHours, type SearchPlaceDetail, type SearchTimeZone, autocompleteIncludeSchema, autocompleteRequestSchema, autocompleteResponseSchema, geocodingAddressSchema, geocodingAttributionSchema, geocodingBoundsSchema, geocodingForwardRequestSchema, geocodingForwardResponseSchema, geocodingLimits, geocodingPositionSchema, geocodingResultKinds, geocodingResultSchema, geocodingRetentionModes, geocodingReverseRequestSchema, geocodingReverseResponseSchema, geocodingSourceSchema, geocodingSuggestionSchema, nearbyCursorSchema, nearbyLimits, nearbyPlaceSchema, nearbyRequestSchema, nearbyResponseSchema, resolvePlaceRequestSchema, resolvePlaceResponseSchema, resolveSuggestionRequestSchema, resolveSuggestionResponseSchema, reverseGeocodingKindSchema, searchCategoriesResponseSchema, searchCategoryIdSchema, searchCategorySchema, searchContactDetails, searchContactsSchema, searchLiteralText, searchOpeningHoursSchema, searchOperationUnits, searchPlaceDetailFields, searchPlaceDetailSchema, searchPlaceDetails, searchPlaceDetailsSchema, searchPlaceMetadata, searchTimeZoneSchema };
|
package/dist/contract.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
autocompleteIncludeSchema,
|
|
2
3
|
autocompleteRequestSchema,
|
|
3
4
|
autocompleteResponseSchema,
|
|
4
5
|
geocodingAddressSchema,
|
|
@@ -28,10 +29,20 @@ import {
|
|
|
28
29
|
searchCategoriesResponseSchema,
|
|
29
30
|
searchCategoryIdSchema,
|
|
30
31
|
searchCategorySchema,
|
|
32
|
+
searchContactDetails,
|
|
33
|
+
searchContactsSchema,
|
|
31
34
|
searchLiteralText,
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
searchOpeningHoursSchema,
|
|
36
|
+
searchOperationUnits,
|
|
37
|
+
searchPlaceDetailFields,
|
|
38
|
+
searchPlaceDetailSchema,
|
|
39
|
+
searchPlaceDetails,
|
|
40
|
+
searchPlaceDetailsSchema,
|
|
41
|
+
searchPlaceMetadata,
|
|
42
|
+
searchTimeZoneSchema
|
|
43
|
+
} from "./chunk-W66J2DAS.js";
|
|
34
44
|
export {
|
|
45
|
+
autocompleteIncludeSchema,
|
|
35
46
|
autocompleteRequestSchema,
|
|
36
47
|
autocompleteResponseSchema,
|
|
37
48
|
geocodingAddressSchema,
|
|
@@ -61,6 +72,15 @@ export {
|
|
|
61
72
|
searchCategoriesResponseSchema,
|
|
62
73
|
searchCategoryIdSchema,
|
|
63
74
|
searchCategorySchema,
|
|
75
|
+
searchContactDetails,
|
|
76
|
+
searchContactsSchema,
|
|
64
77
|
searchLiteralText,
|
|
65
|
-
|
|
78
|
+
searchOpeningHoursSchema,
|
|
79
|
+
searchOperationUnits,
|
|
80
|
+
searchPlaceDetailFields,
|
|
81
|
+
searchPlaceDetailSchema,
|
|
82
|
+
searchPlaceDetails,
|
|
83
|
+
searchPlaceDetailsSchema,
|
|
84
|
+
searchPlaceMetadata,
|
|
85
|
+
searchTimeZoneSchema
|
|
66
86
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { GEOCODING_ERROR_CODES, GeocodeOptions, GeocodingError, GeocodingErrorCode, autocomplete, geocode, geocodeReverse, listCategories, resolvePlace, resolveSuggestion, searchNearby } from './client.js';
|
|
2
|
-
export { AutocompleteRequest, AutocompleteResponse, GeocodingForwardRequest, GeocodingForwardResponse, GeocodingResult, GeocodingReverseRequest, GeocodingReverseResponse, GeocodingSuggestion, NearbyPlace, NearbyRequest, NearbyResponse, NormalizedAutocompleteRequest, NormalizedGeocodingForwardRequest, NormalizedGeocodingReverseRequest, NormalizedNearbyRequest, NormalizedResolveSuggestionRequest, ResolvePlaceRequest, ResolvePlaceResponse, ResolveSuggestionRequest, ResolveSuggestionResponse, ReverseGeocodingKind, SearchCategoriesResponse, SearchCategory, autocompleteRequestSchema, autocompleteResponseSchema, geocodingAddressSchema, geocodingAttributionSchema, geocodingBoundsSchema, geocodingForwardRequestSchema, geocodingForwardResponseSchema, geocodingLimits, geocodingPositionSchema, geocodingResultKinds, geocodingResultSchema, geocodingRetentionModes, geocodingReverseRequestSchema, geocodingReverseResponseSchema, geocodingSourceSchema, geocodingSuggestionSchema, nearbyCursorSchema, nearbyLimits, nearbyPlaceSchema, nearbyRequestSchema, nearbyResponseSchema, resolvePlaceRequestSchema, resolvePlaceResponseSchema, resolveSuggestionRequestSchema, resolveSuggestionResponseSchema, reverseGeocodingKindSchema, searchCategoriesResponseSchema, searchCategoryIdSchema, searchCategorySchema, searchLiteralText, searchPlaceMetadata } from './contract.js';
|
|
2
|
+
export { AutocompleteRequest, AutocompleteResponse, GeocodingForwardRequest, GeocodingForwardResponse, GeocodingResult, GeocodingReverseRequest, GeocodingReverseResponse, GeocodingSuggestion, NearbyPlace, NearbyRequest, NearbyResponse, NormalizedAutocompleteRequest, NormalizedGeocodingForwardRequest, NormalizedGeocodingReverseRequest, NormalizedNearbyRequest, NormalizedResolveSuggestionRequest, ResolvePlaceRequest, ResolvePlaceResponse, ResolveSuggestionRequest, ResolveSuggestionResponse, ReverseGeocodingKind, SearchCategoriesResponse, SearchCategory, SearchContacts, SearchOpeningHours, SearchPlaceDetail, SearchTimeZone, autocompleteIncludeSchema, autocompleteRequestSchema, autocompleteResponseSchema, geocodingAddressSchema, geocodingAttributionSchema, geocodingBoundsSchema, geocodingForwardRequestSchema, geocodingForwardResponseSchema, geocodingLimits, geocodingPositionSchema, geocodingResultKinds, geocodingResultSchema, geocodingRetentionModes, geocodingReverseRequestSchema, geocodingReverseResponseSchema, geocodingSourceSchema, geocodingSuggestionSchema, nearbyCursorSchema, nearbyLimits, nearbyPlaceSchema, nearbyRequestSchema, nearbyResponseSchema, resolvePlaceRequestSchema, resolvePlaceResponseSchema, resolveSuggestionRequestSchema, resolveSuggestionResponseSchema, reverseGeocodingKindSchema, searchCategoriesResponseSchema, searchCategoryIdSchema, searchCategorySchema, searchContactDetails, searchContactsSchema, searchLiteralText, searchOpeningHoursSchema, searchOperationUnits, searchPlaceDetailFields, searchPlaceDetailSchema, searchPlaceDetails, searchPlaceDetailsSchema, searchPlaceMetadata, searchTimeZoneSchema } from './contract.js';
|
|
3
3
|
import 'zod';
|
package/dist/index.js
CHANGED
|
@@ -8,8 +8,9 @@ import {
|
|
|
8
8
|
resolvePlace,
|
|
9
9
|
resolveSuggestion,
|
|
10
10
|
searchNearby
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-QDEMNVJD.js";
|
|
12
12
|
import {
|
|
13
|
+
autocompleteIncludeSchema,
|
|
13
14
|
autocompleteRequestSchema,
|
|
14
15
|
autocompleteResponseSchema,
|
|
15
16
|
geocodingAddressSchema,
|
|
@@ -39,13 +40,23 @@ import {
|
|
|
39
40
|
searchCategoriesResponseSchema,
|
|
40
41
|
searchCategoryIdSchema,
|
|
41
42
|
searchCategorySchema,
|
|
43
|
+
searchContactDetails,
|
|
44
|
+
searchContactsSchema,
|
|
42
45
|
searchLiteralText,
|
|
43
|
-
|
|
44
|
-
|
|
46
|
+
searchOpeningHoursSchema,
|
|
47
|
+
searchOperationUnits,
|
|
48
|
+
searchPlaceDetailFields,
|
|
49
|
+
searchPlaceDetailSchema,
|
|
50
|
+
searchPlaceDetails,
|
|
51
|
+
searchPlaceDetailsSchema,
|
|
52
|
+
searchPlaceMetadata,
|
|
53
|
+
searchTimeZoneSchema
|
|
54
|
+
} from "./chunk-W66J2DAS.js";
|
|
45
55
|
export {
|
|
46
56
|
GEOCODING_ERROR_CODES,
|
|
47
57
|
GeocodingError,
|
|
48
58
|
autocomplete,
|
|
59
|
+
autocompleteIncludeSchema,
|
|
49
60
|
autocompleteRequestSchema,
|
|
50
61
|
autocompleteResponseSchema,
|
|
51
62
|
geocode,
|
|
@@ -80,7 +91,16 @@ export {
|
|
|
80
91
|
searchCategoriesResponseSchema,
|
|
81
92
|
searchCategoryIdSchema,
|
|
82
93
|
searchCategorySchema,
|
|
94
|
+
searchContactDetails,
|
|
95
|
+
searchContactsSchema,
|
|
83
96
|
searchLiteralText,
|
|
84
97
|
searchNearby,
|
|
85
|
-
|
|
98
|
+
searchOpeningHoursSchema,
|
|
99
|
+
searchOperationUnits,
|
|
100
|
+
searchPlaceDetailFields,
|
|
101
|
+
searchPlaceDetailSchema,
|
|
102
|
+
searchPlaceDetails,
|
|
103
|
+
searchPlaceDetailsSchema,
|
|
104
|
+
searchPlaceMetadata,
|
|
105
|
+
searchTimeZoneSchema
|
|
86
106
|
};
|
package/package.json
CHANGED