@atscript/db-client 0.1.103 → 0.1.104
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.cjs +32 -0
- package/dist/index.d.cts +18 -0
- package/dist/index.d.mts +18 -0
- package/dist/index.mjs +32 -0
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -162,6 +162,38 @@ var Client = class {
|
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
164
|
/**
|
|
165
|
+
* `GET /geo` — distance-ranked geospatial search (tables with `@db.index.geo`).
|
|
166
|
+
*
|
|
167
|
+
* `point` is `[lng, lat]` (GeoJSON order). Rows come back ordered by distance
|
|
168
|
+
* ascending, each carrying a computed `$distance` (meters from `point`).
|
|
169
|
+
* `$maxDistance` / `$minDistance` (meters) and `$index` (geo index name) ride
|
|
170
|
+
* in `query.controls`; filter / `$select` / `$with` / `$skip` / `$limit`
|
|
171
|
+
* compose as usual.
|
|
172
|
+
*/
|
|
173
|
+
async geoSearch(point, query) {
|
|
174
|
+
return this._get("geo", {
|
|
175
|
+
...query,
|
|
176
|
+
controls: {
|
|
177
|
+
...query?.controls,
|
|
178
|
+
$center: point.join(",")
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* `GET /geo` with `$page` / `$size` — paginated distance-ranked search.
|
|
184
|
+
*/
|
|
185
|
+
async geoPages(point, query, page = 1, size = 10) {
|
|
186
|
+
return this._get("geo", {
|
|
187
|
+
...query,
|
|
188
|
+
controls: {
|
|
189
|
+
...query?.controls,
|
|
190
|
+
$center: point.join(","),
|
|
191
|
+
$page: page,
|
|
192
|
+
$size: size
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
165
197
|
* `GET /one/:id` or `GET /one?k1=v1&k2=v2` — single record by primary key.
|
|
166
198
|
*
|
|
167
199
|
* Returns `null` on 404. Response narrows by the literal `$with` array in
|
package/dist/index.d.cts
CHANGED
|
@@ -68,6 +68,24 @@ declare class Client<T extends AtscriptClientShape = AtscriptClientShape> {
|
|
|
68
68
|
* {@link query}.
|
|
69
69
|
*/
|
|
70
70
|
pages<Q extends Uniquery$1<Own<T>, Nav<T>> = Uniquery$1<Own<T>, Nav<T>>>(query?: Q, page?: number, size?: number): Promise<PageResult<Response<T, Q>>>;
|
|
71
|
+
/**
|
|
72
|
+
* `GET /geo` — distance-ranked geospatial search (tables with `@db.index.geo`).
|
|
73
|
+
*
|
|
74
|
+
* `point` is `[lng, lat]` (GeoJSON order). Rows come back ordered by distance
|
|
75
|
+
* ascending, each carrying a computed `$distance` (meters from `point`).
|
|
76
|
+
* `$maxDistance` / `$minDistance` (meters) and `$index` (geo index name) ride
|
|
77
|
+
* in `query.controls`; filter / `$select` / `$with` / `$skip` / `$limit`
|
|
78
|
+
* compose as usual.
|
|
79
|
+
*/
|
|
80
|
+
geoSearch<Q extends Uniquery$1<Own<T>, Nav<T>> = Uniquery$1<Own<T>, Nav<T>>>(point: [number, number], query?: Q): Promise<Array<Response<T, Q> & {
|
|
81
|
+
$distance: number;
|
|
82
|
+
}>>;
|
|
83
|
+
/**
|
|
84
|
+
* `GET /geo` with `$page` / `$size` — paginated distance-ranked search.
|
|
85
|
+
*/
|
|
86
|
+
geoPages<Q extends Uniquery$1<Own<T>, Nav<T>> = Uniquery$1<Own<T>, Nav<T>>>(point: [number, number], query?: Q, page?: number, size?: number): Promise<PageResult<Response<T, Q> & {
|
|
87
|
+
$distance: number;
|
|
88
|
+
}>>;
|
|
71
89
|
/**
|
|
72
90
|
* `GET /one/:id` or `GET /one?k1=v1&k2=v2` — single record by primary key.
|
|
73
91
|
*
|
package/dist/index.d.mts
CHANGED
|
@@ -68,6 +68,24 @@ declare class Client<T extends AtscriptClientShape = AtscriptClientShape> {
|
|
|
68
68
|
* {@link query}.
|
|
69
69
|
*/
|
|
70
70
|
pages<Q extends Uniquery$1<Own<T>, Nav<T>> = Uniquery$1<Own<T>, Nav<T>>>(query?: Q, page?: number, size?: number): Promise<PageResult<Response<T, Q>>>;
|
|
71
|
+
/**
|
|
72
|
+
* `GET /geo` — distance-ranked geospatial search (tables with `@db.index.geo`).
|
|
73
|
+
*
|
|
74
|
+
* `point` is `[lng, lat]` (GeoJSON order). Rows come back ordered by distance
|
|
75
|
+
* ascending, each carrying a computed `$distance` (meters from `point`).
|
|
76
|
+
* `$maxDistance` / `$minDistance` (meters) and `$index` (geo index name) ride
|
|
77
|
+
* in `query.controls`; filter / `$select` / `$with` / `$skip` / `$limit`
|
|
78
|
+
* compose as usual.
|
|
79
|
+
*/
|
|
80
|
+
geoSearch<Q extends Uniquery$1<Own<T>, Nav<T>> = Uniquery$1<Own<T>, Nav<T>>>(point: [number, number], query?: Q): Promise<Array<Response<T, Q> & {
|
|
81
|
+
$distance: number;
|
|
82
|
+
}>>;
|
|
83
|
+
/**
|
|
84
|
+
* `GET /geo` with `$page` / `$size` — paginated distance-ranked search.
|
|
85
|
+
*/
|
|
86
|
+
geoPages<Q extends Uniquery$1<Own<T>, Nav<T>> = Uniquery$1<Own<T>, Nav<T>>>(point: [number, number], query?: Q, page?: number, size?: number): Promise<PageResult<Response<T, Q> & {
|
|
87
|
+
$distance: number;
|
|
88
|
+
}>>;
|
|
71
89
|
/**
|
|
72
90
|
* `GET /one/:id` or `GET /one?k1=v1&k2=v2` — single record by primary key.
|
|
73
91
|
*
|
package/dist/index.mjs
CHANGED
|
@@ -161,6 +161,38 @@ var Client = class {
|
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
163
|
/**
|
|
164
|
+
* `GET /geo` — distance-ranked geospatial search (tables with `@db.index.geo`).
|
|
165
|
+
*
|
|
166
|
+
* `point` is `[lng, lat]` (GeoJSON order). Rows come back ordered by distance
|
|
167
|
+
* ascending, each carrying a computed `$distance` (meters from `point`).
|
|
168
|
+
* `$maxDistance` / `$minDistance` (meters) and `$index` (geo index name) ride
|
|
169
|
+
* in `query.controls`; filter / `$select` / `$with` / `$skip` / `$limit`
|
|
170
|
+
* compose as usual.
|
|
171
|
+
*/
|
|
172
|
+
async geoSearch(point, query) {
|
|
173
|
+
return this._get("geo", {
|
|
174
|
+
...query,
|
|
175
|
+
controls: {
|
|
176
|
+
...query?.controls,
|
|
177
|
+
$center: point.join(",")
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* `GET /geo` with `$page` / `$size` — paginated distance-ranked search.
|
|
183
|
+
*/
|
|
184
|
+
async geoPages(point, query, page = 1, size = 10) {
|
|
185
|
+
return this._get("geo", {
|
|
186
|
+
...query,
|
|
187
|
+
controls: {
|
|
188
|
+
...query?.controls,
|
|
189
|
+
$center: point.join(","),
|
|
190
|
+
$page: page,
|
|
191
|
+
$size: size
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
164
196
|
* `GET /one/:id` or `GET /one?k1=v1&k2=v2` — single record by primary key.
|
|
165
197
|
*
|
|
166
198
|
* Returns `null` on 404. Response narrows by the literal `$with` array in
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atscript/db-client",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.104",
|
|
4
4
|
"description": "Browser-compatible HTTP client for @atscript/moost-db REST endpoints.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"atscript",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@atscript/typescript": "^0.1.75",
|
|
51
51
|
"@uniqu/core": "^0.1.6",
|
|
52
52
|
"unplugin-atscript": "^0.1.75",
|
|
53
|
-
"@atscript/db": "0.1.
|
|
53
|
+
"@atscript/db": "0.1.104"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"@atscript/db": "^0.1.44",
|