@latlng/sdk 0.1.2 → 0.2.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/README.md +2 -0
- package/dist/client.d.ts +6 -1
- package/dist/errors/index.d.ts +12 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +277 -269
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -287,6 +287,8 @@ The SDK exports typed error classes:
|
|
|
287
287
|
| `LatLngError` | Base SDK error. |
|
|
288
288
|
| `TimeoutError` | Request exceeded `timeoutMs`. |
|
|
289
289
|
| `HttpError` | Non-success HTTP response with status and payload context. |
|
|
290
|
+
| `BadRequestError` | `400` response: invalid geometry, coordinates, filter, or request field. Subclass of `HttpError`. |
|
|
291
|
+
| `NotFoundError` | `404` response: missing collection, object, hook, or channel. Subclass of `HttpError`. `get()` and `getCollection()` return `null` instead of throwing. |
|
|
290
292
|
| `AuthError` | Authentication or authorization failure. |
|
|
291
293
|
| `ServerUnavailableError` | Server unavailable response. |
|
|
292
294
|
|
package/dist/client.d.ts
CHANGED
|
@@ -99,6 +99,10 @@ export declare class LatLngClient {
|
|
|
99
99
|
/**
|
|
100
100
|
* Stores or updates a single object in a collection.
|
|
101
101
|
*
|
|
102
|
+
* The geometry is replaced and fields are merged: fields given here are
|
|
103
|
+
* added or overwritten, other existing fields are kept, and a numeric `0`
|
|
104
|
+
* deletes a field. Omitting `expireSeconds` clears any existing TTL.
|
|
105
|
+
*
|
|
102
106
|
* @param collection Collection name.
|
|
103
107
|
* @param id Object identifier.
|
|
104
108
|
* @param object Object payload.
|
|
@@ -147,7 +151,8 @@ export declare class LatLngClient {
|
|
|
147
151
|
*/
|
|
148
152
|
deleteMatching(collection: string, options?: DeleteMatchingOptions): Promise<number>;
|
|
149
153
|
/**
|
|
150
|
-
* Updates one or more fields on an existing object
|
|
154
|
+
* Updates one or more fields on an existing object, keeping its geometry
|
|
155
|
+
* and TTL. A numeric `0` deletes the field.
|
|
151
156
|
*
|
|
152
157
|
* @param collection Collection name.
|
|
153
158
|
* @param id Object identifier.
|
package/dist/errors/index.d.ts
CHANGED
|
@@ -58,6 +58,18 @@ export declare class HttpError extends LatLngError {
|
|
|
58
58
|
*/
|
|
59
59
|
export declare class AuthError extends HttpError {
|
|
60
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* HTTP error raised when the request is invalid (status 400), for example
|
|
63
|
+
* malformed geometry, an invalid filter, or an unknown request field.
|
|
64
|
+
*/
|
|
65
|
+
export declare class BadRequestError extends HttpError {
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* HTTP error raised when a collection, object, hook, or channel does not exist
|
|
69
|
+
* (status 404).
|
|
70
|
+
*/
|
|
71
|
+
export declare class NotFoundError extends HttpError {
|
|
72
|
+
}
|
|
61
73
|
/**
|
|
62
74
|
* HTTP error raised when the server is temporarily unavailable.
|
|
63
75
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { LatLngClient } from "./client.js";
|
|
2
|
-
export { AuthError, HttpError, LatLngError, ServerUnavailableError, TimeoutError, } from "./errors/index.js";
|
|
2
|
+
export { AuthError, BadRequestError, HttpError, LatLngError, NotFoundError, ServerUnavailableError, TimeoutError, } from "./errors/index.js";
|
|
3
3
|
export { LatLngWebSocketClient, type LatLngWebSocketConfig } from "./ws/socket.js";
|
|
4
4
|
export { LatLngSubscription } from "./ws/subscriptions.js";
|
|
5
5
|
export type { JsonPrimitive, JsonValue } from "./types/json.js";
|