@cloudnux/core-cloud-provider 0.2.0 → 0.5.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/dist/index.d.ts +94 -66
- package/package.json +1 -3
package/dist/index.d.ts
CHANGED
|
@@ -131,77 +131,105 @@ interface EventMessage {
|
|
|
131
131
|
publishedAt: Date;
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
interface
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Get detailed information about a specific place
|
|
144
|
-
* @param placeId ID of the place to get details for
|
|
145
|
-
* @returns Promise containing place details
|
|
146
|
-
*/
|
|
147
|
-
getPlaceDetails(placeId: string): Promise<PlaceDetails>;
|
|
134
|
+
interface LocationProviderConfig {
|
|
135
|
+
apiKey?: string;
|
|
136
|
+
region?: string;
|
|
137
|
+
language?: string;
|
|
138
|
+
countries?: string[];
|
|
139
|
+
timeout?: number;
|
|
140
|
+
retryAttempts?: number;
|
|
141
|
+
metadata?: Record<string, any>;
|
|
148
142
|
}
|
|
149
|
-
interface
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
143
|
+
interface Coordinates {
|
|
144
|
+
lat: number;
|
|
145
|
+
lng: number;
|
|
146
|
+
}
|
|
147
|
+
interface RoutePoint {
|
|
148
|
+
lat: number;
|
|
149
|
+
lng: number;
|
|
150
|
+
distanceFromStartKm: number;
|
|
151
|
+
}
|
|
152
|
+
interface SuggestionParams {
|
|
153
|
+
query: string;
|
|
158
154
|
maxResults?: number;
|
|
159
|
-
/** Filter results by category */
|
|
160
|
-
categories?: string[];
|
|
161
|
-
/** Language code for results */
|
|
162
155
|
language?: string;
|
|
156
|
+
countries?: string[];
|
|
157
|
+
biasPosition?: Coordinates;
|
|
158
|
+
placeTypes?: string[];
|
|
163
159
|
}
|
|
164
|
-
interface
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
text: string;
|
|
160
|
+
interface ReverseGeocodeParams {
|
|
161
|
+
coordinates: Coordinates;
|
|
162
|
+
language?: string;
|
|
163
|
+
maxResults?: number;
|
|
169
164
|
}
|
|
170
|
-
interface
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
};
|
|
178
|
-
/** Distance from search center if applicable */
|
|
165
|
+
interface LocationSuggestion {
|
|
166
|
+
title: string;
|
|
167
|
+
subtitle?: string;
|
|
168
|
+
coordinates?: Coordinates;
|
|
169
|
+
placeId?: string;
|
|
170
|
+
queryId?: string;
|
|
171
|
+
placeType?: string;
|
|
179
172
|
distance?: number;
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
|
|
173
|
+
provider: string;
|
|
174
|
+
rawData?: any;
|
|
175
|
+
}
|
|
176
|
+
interface LocationAddress {
|
|
177
|
+
fullAddress: string;
|
|
178
|
+
street?: string;
|
|
179
|
+
streetNumber?: string;
|
|
180
|
+
city?: string;
|
|
181
|
+
district?: string;
|
|
182
|
+
region?: string;
|
|
183
|
+
postalCode?: string;
|
|
184
|
+
country?: string;
|
|
185
|
+
countryCode?: string;
|
|
186
|
+
coordinates: Coordinates;
|
|
187
|
+
placeType?: string;
|
|
188
|
+
accuracy?: number;
|
|
189
|
+
provider: string;
|
|
190
|
+
rawData?: any;
|
|
191
|
+
}
|
|
192
|
+
interface RouteResult {
|
|
193
|
+
totalDistanceKm: number;
|
|
194
|
+
totalDurationMinutes: number;
|
|
195
|
+
/** Route coordinates as [lng, lat] pairs for GeoJSON */
|
|
196
|
+
/** TODO: convert array to coordinates */
|
|
197
|
+
coordinates: Coordinates[];
|
|
198
|
+
/** Sampled points along route for corridor search */
|
|
199
|
+
sampledPoints: RoutePoint[];
|
|
200
|
+
/** Bounding box [minLng, minLat, maxLng, maxLat] */
|
|
201
|
+
bbox: [number, number, number, number];
|
|
202
|
+
/** Individual leg data */
|
|
203
|
+
legs: Array<{
|
|
204
|
+
distanceKm: number;
|
|
205
|
+
durationMinutes: number;
|
|
206
|
+
/** TODO: convert array to coordinates */
|
|
207
|
+
coordinates: Coordinates[];
|
|
208
|
+
startPosition: Coordinates;
|
|
209
|
+
endPosition: Coordinates;
|
|
210
|
+
}>;
|
|
211
|
+
}
|
|
212
|
+
interface LocationService {
|
|
213
|
+
/**
|
|
214
|
+
* Get autocomplete suggestions for search box
|
|
215
|
+
* Use case: User types "Stock..." → Show ["Stockholm", "Stockton", ...]
|
|
216
|
+
*/
|
|
217
|
+
getSuggestions(params: SuggestionParams): Promise<LocationSuggestion[]>;
|
|
218
|
+
/**
|
|
219
|
+
* Get address from coordinates (reverse geocoding)
|
|
220
|
+
* Use case: User clicks "Get my location" → Show "Drottninggatan 10, Stockholm"
|
|
221
|
+
*/
|
|
222
|
+
reverseGeocode(params: ReverseGeocodeParams): Promise<LocationAddress>;
|
|
223
|
+
/**
|
|
224
|
+
* Calculate route between origin and destination with optional waypoints
|
|
225
|
+
* Use case: User plans trip → Show route on map + details
|
|
226
|
+
*/
|
|
227
|
+
calculateRoute(origin: Coordinates, destination: Coordinates, waypoints?: Coordinates[], avoidTolls?: boolean): Promise<RouteResult>;
|
|
228
|
+
/**
|
|
229
|
+
* Optional: Get detailed location info if suggestion doesn't have coordinates
|
|
230
|
+
* Use case: User selects suggestion → Need full coordinates
|
|
231
|
+
*/
|
|
232
|
+
getLocationDetails?(placeId: string): Promise<LocationAddress>;
|
|
205
233
|
}
|
|
206
234
|
|
|
207
235
|
interface StorageService {
|
|
@@ -381,4 +409,4 @@ interface CloudProvider {
|
|
|
381
409
|
createFunctionsService(): FunctionsService;
|
|
382
410
|
}
|
|
383
411
|
|
|
384
|
-
export { type BaseEntry, type CloudProvider, type Entry, type Entrypoint, ErrorCode, type EventBrokerService, type EventEntry, type EventFunctionContext, type EventMessage, type EventRequest, type EventResponse, type EventTrigger, type FunctionContext, type FunctionsService, type HTTPAuth, type HTTPRequest, type HTTPResponse, type HandlerType, type HttpEntry, type HttpFunctionContext, type HttpMethod, type HttpTrigger, type LocationService, type MessageFilter, type PeekOptions, type
|
|
412
|
+
export { type BaseEntry, type CloudProvider, type Coordinates, type Entry, type Entrypoint, ErrorCode, type EventBrokerService, type EventEntry, type EventFunctionContext, type EventMessage, type EventRequest, type EventResponse, type EventTrigger, type FunctionContext, type FunctionsService, type HTTPAuth, type HTTPRequest, type HTTPResponse, type HandlerType, type HttpEntry, type HttpFunctionContext, type HttpMethod, type HttpTrigger, type LocationAddress, type LocationProviderConfig, type LocationService, type LocationSuggestion, type MessageFilter, type PeekOptions, type PublishOptions, type ReadOptions, type ReverseGeocodeParams, type RoutePoint, type RouteResult, type ScheduleEntry, type ScheduleFunctionContext, type ScheduleRequest, type ScheduleResponse, type ScheduleTrigger, type StorageService, type StorageWriteOptions, type StorageWriteResult, type SuggestionParams };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudnux/core-cloud-provider",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "CloudNux core interfaces and types for multi-cloud abstraction",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -37,8 +37,6 @@
|
|
|
37
37
|
"lint": "eslint . --max-warnings 0",
|
|
38
38
|
"lint:fix": "eslint . --fix",
|
|
39
39
|
"type-check": "tsc --noEmit",
|
|
40
|
-
"test": "vitest run",
|
|
41
|
-
"test:watch": "vitest",
|
|
42
40
|
"clean": "rm -rf dist"
|
|
43
41
|
},
|
|
44
42
|
"dependencies": {},
|