@prisma/orm-extension-postgis 0.16.0-dev.36
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 +201 -0
- package/README.md +32 -0
- package/dist/codec-types-M7J4vkfS-DOzWmEmw.d.mts +49 -0
- package/dist/codec-types-M7J4vkfS-DOzWmEmw.d.mts.map +1 -0
- package/dist/codec-types.d.mts +2 -0
- package/dist/codec-types.mjs +1 -0
- package/dist/column-types.d.mts +27 -0
- package/dist/column-types.d.mts.map +1 -0
- package/dist/column-types.mjs +34 -0
- package/dist/column-types.mjs.map +1 -0
- package/dist/constants-CWW72xGt-hJye3Dua.mjs +6 -0
- package/dist/constants-CWW72xGt-hJye3Dua.mjs.map +1 -0
- package/dist/control.d.mts +7 -0
- package/dist/control.d.mts.map +1 -0
- package/dist/control.mjs +143 -0
- package/dist/control.mjs.map +1 -0
- package/dist/descriptor-meta-deM0Qc_b-FRxKhllA.mjs +604 -0
- package/dist/descriptor-meta-deM0Qc_b-FRxKhllA.mjs.map +1 -0
- package/dist/errors-Bg6kDFR--BUzKMn1A.mjs +9 -0
- package/dist/errors-Bg6kDFR--BUzKMn1A.mjs.map +1 -0
- package/dist/geojson-L3qRlIZY-DLhY3CUa.d.mts +62 -0
- package/dist/geojson-L3qRlIZY-DLhY3CUa.d.mts.map +1 -0
- package/dist/geojson.d.mts +2 -0
- package/dist/geojson.mjs +89 -0
- package/dist/geojson.mjs.map +1 -0
- package/dist/operation-types-_DWme6Gj-DddnbZus.d.mts +123 -0
- package/dist/operation-types-_DWme6Gj-DddnbZus.d.mts.map +1 -0
- package/dist/operation-types.d.mts +2 -0
- package/dist/operation-types.mjs +1 -0
- package/dist/pack.d.mts +75 -0
- package/dist/pack.d.mts.map +1 -0
- package/dist/pack.mjs +2 -0
- package/dist/runtime.d.mts +19 -0
- package/dist/runtime.d.mts.map +1 -0
- package/dist/runtime.mjs +22 -0
- package/dist/runtime.mjs.map +1 -0
- package/package.json +55 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
2
|
+
//#region ../../../3-extensions/postgis/dist/errors-Bg6kDFR-.mjs
|
|
3
|
+
function postgisError(code, message, options) {
|
|
4
|
+
return structuredError(code, message, options);
|
|
5
|
+
}
|
|
6
|
+
//#endregion
|
|
7
|
+
export { postgisError as t };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=errors-Bg6kDFR--BUzKMn1A.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors-Bg6kDFR--BUzKMn1A.mjs","names":[],"sources":["../../../../3-extensions/postgis/dist/errors-Bg6kDFR-.mjs"],"sourcesContent":["import { structuredError } from \"@internal/utils/structured-error\";\n//#region src/core/errors.ts\nfunction postgisError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n//#endregion\nexport { postgisError as t };\n\n//# sourceMappingURL=errors-Bg6kDFR-.mjs.map"],"mappings":";;AAEA,SAAS,aAAa,MAAM,SAAS,SAAS;CAC7C,OAAO,gBAAgB,MAAM,SAAS,OAAO;AAC9C"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
//#region ../../../3-extensions/postgis/dist/geojson-L3qRlIZY.d.mts
|
|
2
|
+
//#region src/core/geojson.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* GeoJSON-shaped value types used by the PostGIS codec.
|
|
5
|
+
*
|
|
6
|
+
* The codec speaks GeoJSON-style objects to JavaScript callers and
|
|
7
|
+
* EWKT/EWKB on the wire. This file is the single source of truth for the
|
|
8
|
+
* value shapes; the public type re-export lives in `exports/geojson.ts`.
|
|
9
|
+
*/
|
|
10
|
+
type Position = readonly [number, number];
|
|
11
|
+
type GeometryPoint = {
|
|
12
|
+
readonly type: 'Point';
|
|
13
|
+
readonly coordinates: Position;
|
|
14
|
+
readonly srid?: number;
|
|
15
|
+
};
|
|
16
|
+
type GeometryLineString = {
|
|
17
|
+
readonly type: 'LineString';
|
|
18
|
+
readonly coordinates: ReadonlyArray<Position>;
|
|
19
|
+
readonly srid?: number;
|
|
20
|
+
};
|
|
21
|
+
type GeometryPolygon = {
|
|
22
|
+
readonly type: 'Polygon';
|
|
23
|
+
readonly coordinates: ReadonlyArray<ReadonlyArray<Position>>;
|
|
24
|
+
readonly srid?: number;
|
|
25
|
+
};
|
|
26
|
+
type GeometryMultiPoint = {
|
|
27
|
+
readonly type: 'MultiPoint';
|
|
28
|
+
readonly coordinates: ReadonlyArray<Position>;
|
|
29
|
+
readonly srid?: number;
|
|
30
|
+
};
|
|
31
|
+
type GeometryMultiLineString = {
|
|
32
|
+
readonly type: 'MultiLineString';
|
|
33
|
+
readonly coordinates: ReadonlyArray<ReadonlyArray<Position>>;
|
|
34
|
+
readonly srid?: number;
|
|
35
|
+
};
|
|
36
|
+
type GeometryMultiPolygon = {
|
|
37
|
+
readonly type: 'MultiPolygon';
|
|
38
|
+
readonly coordinates: ReadonlyArray<ReadonlyArray<ReadonlyArray<Position>>>;
|
|
39
|
+
readonly srid?: number;
|
|
40
|
+
};
|
|
41
|
+
type Geometry = GeometryPoint | GeometryLineString | GeometryPolygon | GeometryMultiPoint | GeometryMultiLineString | GeometryMultiPolygon;
|
|
42
|
+
/**
|
|
43
|
+
* Construct a Point. Convenience for the common "lng/lat" case.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* point(-122.4194, 37.7749, 4326)
|
|
47
|
+
*/
|
|
48
|
+
declare function point(longitude: number, latitude: number, srid?: number): GeometryPoint;
|
|
49
|
+
/**
|
|
50
|
+
* Construct a Polygon from a single outer ring of `[lng, lat]` pairs.
|
|
51
|
+
* If the first and last positions differ, the ring is closed automatically.
|
|
52
|
+
*/
|
|
53
|
+
declare function polygon(ring: ReadonlyArray<Position>, srid?: number): GeometryPolygon;
|
|
54
|
+
/**
|
|
55
|
+
* Construct a rectangular Polygon from a bounding box.
|
|
56
|
+
*
|
|
57
|
+
* @param bbox - `[minLng, minLat, maxLng, maxLat]`
|
|
58
|
+
*/
|
|
59
|
+
declare function bboxPolygon(bbox: readonly [number, number, number, number], srid?: number): GeometryPolygon;
|
|
60
|
+
//#endregion
|
|
61
|
+
export { GeometryMultiPolygon as a, Position as c, polygon as d, GeometryMultiPoint as i, bboxPolygon as l, GeometryLineString as n, GeometryPoint as o, GeometryMultiLineString as r, GeometryPolygon as s, Geometry as t, point as u };
|
|
62
|
+
//# sourceMappingURL=geojson-L3qRlIZY-DLhY3CUa.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geojson-L3qRlIZY-DLhY3CUa.d.mts","names":[],"sources":["../../../../3-extensions/postgis/dist/geojson-L3qRlIZY.d.mts"],"mappings":";;;;;;;;;KAQK;KACA;WACM;WACA,aAAa;WACb;;KAEN;WACM;WACA,aAAa,cAAc;WAC3B;;KAEN;WACM;WACA,aAAa,cAAc,cAAc;WACzC;;KAEN;WACM;WACA,aAAa,cAAc;WAC3B;;KAEN;WACM;WACA,aAAa,cAAc,cAAc;WACzC;;KAEN;WACM;WACA,aAAa,cAAc,cAAc,cAAc;WACvD;;KAEN,WAAW,gBAAgB,qBAAqB,kBAAkB,qBAAqB,0BAA0B;;;;;;;iBAOrG,MAAM,mBAAmB,kBAAkB,gBAAgB;;;;;iBAK3D,QAAQ,MAAM,cAAc,WAAW,gBAAgB;;;;;;iBAMvD,YAAY,iDAAiD,gBAAgB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as GeometryMultiPolygon, c as Position, d as polygon, i as GeometryMultiPoint, l as bboxPolygon, n as GeometryLineString, o as GeometryPoint, r as GeometryMultiLineString, s as GeometryPolygon, t as Geometry, u as point } from "./geojson-L3qRlIZY-DLhY3CUa.mjs";
|
|
2
|
+
export { type Geometry, type GeometryLineString, type GeometryMultiLineString, type GeometryMultiPoint, type GeometryMultiPolygon, type GeometryPoint, type GeometryPolygon, type Position, bboxPolygon, point, polygon };
|
package/dist/geojson.mjs
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { t as postgisError } from "./errors-Bg6kDFR--BUzKMn1A.mjs";
|
|
2
|
+
//#region ../../../3-extensions/postgis/dist/geojson.mjs
|
|
3
|
+
/**
|
|
4
|
+
* GeoJSON-shaped value types used by the PostGIS codec.
|
|
5
|
+
*
|
|
6
|
+
* The codec speaks GeoJSON-style objects to JavaScript callers and
|
|
7
|
+
* EWKT/EWKB on the wire. This file is the single source of truth for the
|
|
8
|
+
* value shapes; the public type re-export lives in `exports/geojson.ts`.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Construct a Point. Convenience for the common "lng/lat" case.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* point(-122.4194, 37.7749, 4326)
|
|
15
|
+
*/
|
|
16
|
+
function point(longitude, latitude, srid) {
|
|
17
|
+
if (!Number.isFinite(longitude) || !Number.isFinite(latitude)) throw postgisError("POSTGIS.GEOMETRY_INVALID", "point: coordinates must be finite numbers", { meta: {
|
|
18
|
+
helper: "point",
|
|
19
|
+
reason: "non-finite coordinates"
|
|
20
|
+
} });
|
|
21
|
+
return srid !== void 0 ? {
|
|
22
|
+
type: "Point",
|
|
23
|
+
coordinates: [longitude, latitude],
|
|
24
|
+
srid
|
|
25
|
+
} : {
|
|
26
|
+
type: "Point",
|
|
27
|
+
coordinates: [longitude, latitude]
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Construct a Polygon from a single outer ring of `[lng, lat]` pairs.
|
|
32
|
+
* If the first and last positions differ, the ring is closed automatically.
|
|
33
|
+
*/
|
|
34
|
+
function polygon(ring, srid) {
|
|
35
|
+
if (ring.length < 3) throw postgisError("POSTGIS.GEOMETRY_INVALID", "polygon: ring must contain at least 3 positions", { meta: {
|
|
36
|
+
helper: "polygon",
|
|
37
|
+
reason: "ring under 3 positions"
|
|
38
|
+
} });
|
|
39
|
+
const first = ring[0];
|
|
40
|
+
const last = ring[ring.length - 1];
|
|
41
|
+
if (!first || !last) throw postgisError("POSTGIS.GEOMETRY_INVALID", "polygon: ring positions cannot be undefined", { meta: {
|
|
42
|
+
helper: "polygon",
|
|
43
|
+
reason: "undefined ring position"
|
|
44
|
+
} });
|
|
45
|
+
for (const position of ring) if (!Number.isFinite(position[0]) || !Number.isFinite(position[1])) throw postgisError("POSTGIS.GEOMETRY_INVALID", "polygon: coordinates must be finite numbers", { meta: {
|
|
46
|
+
helper: "polygon",
|
|
47
|
+
reason: "non-finite coordinates"
|
|
48
|
+
} });
|
|
49
|
+
const closed = first[0] === last[0] && first[1] === last[1] ? ring : [...ring, first];
|
|
50
|
+
if (new Set(closed.slice(0, -1).map(([x, y]) => `${x},${y}`)).size < 3) throw postgisError("POSTGIS.GEOMETRY_INVALID", "polygon: ring must contain at least 3 distinct positions", { meta: {
|
|
51
|
+
helper: "polygon",
|
|
52
|
+
reason: "ring under 3 distinct positions"
|
|
53
|
+
} });
|
|
54
|
+
return srid !== void 0 ? {
|
|
55
|
+
type: "Polygon",
|
|
56
|
+
coordinates: [closed],
|
|
57
|
+
srid
|
|
58
|
+
} : {
|
|
59
|
+
type: "Polygon",
|
|
60
|
+
coordinates: [closed]
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Construct a rectangular Polygon from a bounding box.
|
|
65
|
+
*
|
|
66
|
+
* @param bbox - `[minLng, minLat, maxLng, maxLat]`
|
|
67
|
+
*/
|
|
68
|
+
function bboxPolygon(bbox, srid) {
|
|
69
|
+
const [minX, minY, maxX, maxY] = bbox;
|
|
70
|
+
if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) throw postgisError("POSTGIS.GEOMETRY_INVALID", "bboxPolygon: coordinates must be finite numbers", { meta: {
|
|
71
|
+
helper: "bboxPolygon",
|
|
72
|
+
reason: "non-finite coordinates"
|
|
73
|
+
} });
|
|
74
|
+
if (minX > maxX || minY > maxY) throw postgisError("POSTGIS.GEOMETRY_INVALID", `bboxPolygon: inverted bbox [${minX}, ${minY}, ${maxX}, ${maxY}] (expected minX <= maxX and minY <= maxY)`, { meta: {
|
|
75
|
+
helper: "bboxPolygon",
|
|
76
|
+
reason: "inverted bbox"
|
|
77
|
+
} });
|
|
78
|
+
return polygon([
|
|
79
|
+
[minX, minY],
|
|
80
|
+
[maxX, minY],
|
|
81
|
+
[maxX, maxY],
|
|
82
|
+
[minX, maxY],
|
|
83
|
+
[minX, minY]
|
|
84
|
+
], srid);
|
|
85
|
+
}
|
|
86
|
+
//#endregion
|
|
87
|
+
export { bboxPolygon, point, polygon };
|
|
88
|
+
|
|
89
|
+
//# sourceMappingURL=geojson.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geojson.mjs","names":[],"sources":["../../../../3-extensions/postgis/dist/geojson.mjs"],"sourcesContent":["import { t as postgisError } from \"./errors-Bg6kDFR-.mjs\";\n//#region src/core/geojson.ts\n/**\n* GeoJSON-shaped value types used by the PostGIS codec.\n*\n* The codec speaks GeoJSON-style objects to JavaScript callers and\n* EWKT/EWKB on the wire. This file is the single source of truth for the\n* value shapes; the public type re-export lives in `exports/geojson.ts`.\n*/\n/**\n* Construct a Point. Convenience for the common \"lng/lat\" case.\n*\n* @example\n* point(-122.4194, 37.7749, 4326)\n*/\nfunction point(longitude, latitude, srid) {\n\tif (!Number.isFinite(longitude) || !Number.isFinite(latitude)) throw postgisError(\"POSTGIS.GEOMETRY_INVALID\", \"point: coordinates must be finite numbers\", { meta: {\n\t\thelper: \"point\",\n\t\treason: \"non-finite coordinates\"\n\t} });\n\treturn srid !== void 0 ? {\n\t\ttype: \"Point\",\n\t\tcoordinates: [longitude, latitude],\n\t\tsrid\n\t} : {\n\t\ttype: \"Point\",\n\t\tcoordinates: [longitude, latitude]\n\t};\n}\n/**\n* Construct a Polygon from a single outer ring of `[lng, lat]` pairs.\n* If the first and last positions differ, the ring is closed automatically.\n*/\nfunction polygon(ring, srid) {\n\tif (ring.length < 3) throw postgisError(\"POSTGIS.GEOMETRY_INVALID\", \"polygon: ring must contain at least 3 positions\", { meta: {\n\t\thelper: \"polygon\",\n\t\treason: \"ring under 3 positions\"\n\t} });\n\tconst first = ring[0];\n\tconst last = ring[ring.length - 1];\n\tif (!first || !last) throw postgisError(\"POSTGIS.GEOMETRY_INVALID\", \"polygon: ring positions cannot be undefined\", { meta: {\n\t\thelper: \"polygon\",\n\t\treason: \"undefined ring position\"\n\t} });\n\tfor (const position of ring) if (!Number.isFinite(position[0]) || !Number.isFinite(position[1])) throw postgisError(\"POSTGIS.GEOMETRY_INVALID\", \"polygon: coordinates must be finite numbers\", { meta: {\n\t\thelper: \"polygon\",\n\t\treason: \"non-finite coordinates\"\n\t} });\n\tconst closed = first[0] === last[0] && first[1] === last[1] ? ring : [...ring, first];\n\tif (new Set(closed.slice(0, -1).map(([x, y]) => `${x},${y}`)).size < 3) throw postgisError(\"POSTGIS.GEOMETRY_INVALID\", \"polygon: ring must contain at least 3 distinct positions\", { meta: {\n\t\thelper: \"polygon\",\n\t\treason: \"ring under 3 distinct positions\"\n\t} });\n\treturn srid !== void 0 ? {\n\t\ttype: \"Polygon\",\n\t\tcoordinates: [closed],\n\t\tsrid\n\t} : {\n\t\ttype: \"Polygon\",\n\t\tcoordinates: [closed]\n\t};\n}\n/**\n* Construct a rectangular Polygon from a bounding box.\n*\n* @param bbox - `[minLng, minLat, maxLng, maxLat]`\n*/\nfunction bboxPolygon(bbox, srid) {\n\tconst [minX, minY, maxX, maxY] = bbox;\n\tif (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) throw postgisError(\"POSTGIS.GEOMETRY_INVALID\", \"bboxPolygon: coordinates must be finite numbers\", { meta: {\n\t\thelper: \"bboxPolygon\",\n\t\treason: \"non-finite coordinates\"\n\t} });\n\tif (minX > maxX || minY > maxY) throw postgisError(\"POSTGIS.GEOMETRY_INVALID\", `bboxPolygon: inverted bbox [${minX}, ${minY}, ${maxX}, ${maxY}] (expected minX <= maxX and minY <= maxY)`, { meta: {\n\t\thelper: \"bboxPolygon\",\n\t\treason: \"inverted bbox\"\n\t} });\n\treturn polygon([\n\t\t[minX, minY],\n\t\t[maxX, minY],\n\t\t[maxX, maxY],\n\t\t[minX, maxY],\n\t\t[minX, minY]\n\t], srid);\n}\n//#endregion\nexport { bboxPolygon, point, polygon };\n\n//# sourceMappingURL=geojson.mjs.map"],"mappings":";;;;;;;;;;;;;;;AAeA,SAAS,MAAM,WAAW,UAAU,MAAM;CACzC,IAAI,CAAC,OAAO,SAAS,SAAS,KAAK,CAAC,OAAO,SAAS,QAAQ,GAAG,MAAM,aAAa,4BAA4B,6CAA6C,EAAE,MAAM;EAClK,QAAQ;EACR,QAAQ;CACT,EAAE,CAAC;CACH,OAAO,SAAS,KAAK,IAAI;EACxB,MAAM;EACN,aAAa,CAAC,WAAW,QAAQ;EACjC;CACD,IAAI;EACH,MAAM;EACN,aAAa,CAAC,WAAW,QAAQ;CAClC;AACD;;;;;AAKA,SAAS,QAAQ,MAAM,MAAM;CAC5B,IAAI,KAAK,SAAS,GAAG,MAAM,aAAa,4BAA4B,mDAAmD,EAAE,MAAM;EAC9H,QAAQ;EACR,QAAQ;CACT,EAAE,CAAC;CACH,MAAM,QAAQ,KAAK;CACnB,MAAM,OAAO,KAAK,KAAK,SAAS;CAChC,IAAI,CAAC,SAAS,CAAC,MAAM,MAAM,aAAa,4BAA4B,+CAA+C,EAAE,MAAM;EAC1H,QAAQ;EACR,QAAQ;CACT,EAAE,CAAC;CACH,KAAK,MAAM,YAAY,MAAM,IAAI,CAAC,OAAO,SAAS,SAAS,EAAE,KAAK,CAAC,OAAO,SAAS,SAAS,EAAE,GAAG,MAAM,aAAa,4BAA4B,+CAA+C,EAAE,MAAM;EACtM,QAAQ;EACR,QAAQ;CACT,EAAE,CAAC;CACH,MAAM,SAAS,MAAM,OAAO,KAAK,MAAM,MAAM,OAAO,KAAK,KAAK,OAAO,CAAC,GAAG,MAAM,KAAK;CACpF,IAAI,IAAI,IAAI,OAAO,MAAM,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,OAAO,GAAG,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,OAAO,GAAG,MAAM,aAAa,4BAA4B,4DAA4D,EAAE,MAAM;EAC1L,QAAQ;EACR,QAAQ;CACT,EAAE,CAAC;CACH,OAAO,SAAS,KAAK,IAAI;EACxB,MAAM;EACN,aAAa,CAAC,MAAM;EACpB;CACD,IAAI;EACH,MAAM;EACN,aAAa,CAAC,MAAM;CACrB;AACD;;;;;;AAMA,SAAS,YAAY,MAAM,MAAM;CAChC,MAAM,CAAC,MAAM,MAAM,MAAM,QAAQ;CACjC,IAAI,CAAC,OAAO,SAAS,IAAI,KAAK,CAAC,OAAO,SAAS,IAAI,KAAK,CAAC,OAAO,SAAS,IAAI,KAAK,CAAC,OAAO,SAAS,IAAI,GAAG,MAAM,aAAa,4BAA4B,mDAAmD,EAAE,MAAM;EACnN,QAAQ;EACR,QAAQ;CACT,EAAE,CAAC;CACH,IAAI,OAAO,QAAQ,OAAO,MAAM,MAAM,aAAa,4BAA4B,+BAA+B,KAAK,IAAI,KAAK,IAAI,KAAK,IAAI,KAAK,6CAA6C,EAAE,MAAM;EAClM,QAAQ;EACR,QAAQ;CACT,EAAE,CAAC;CACH,OAAO,QAAQ;EACd,CAAC,MAAM,IAAI;EACX,CAAC,MAAM,IAAI;EACX,CAAC,MAAM,IAAI;EACX,CAAC,MAAM,IAAI;EACX,CAAC,MAAM,IAAI;CACZ,GAAG,IAAI;AACR"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { CodecExpression, Expression } from "@prisma/orm-family-sql/relational-core/expression";
|
|
2
|
+
import { SqlQueryOperationTypes } from "@prisma/orm-family-sql/contract/types";
|
|
3
|
+
//#region ../../../3-extensions/postgis/dist/operation-types-_DWme6Gj.d.mts
|
|
4
|
+
//#region src/types/operation-types.d.ts
|
|
5
|
+
type CodecTypesBase = Record<string, {
|
|
6
|
+
readonly input: unknown;
|
|
7
|
+
readonly output: unknown;
|
|
8
|
+
}>;
|
|
9
|
+
/**
|
|
10
|
+
* Operation type definitions for the PostGIS extension.
|
|
11
|
+
*
|
|
12
|
+
* These are type-only signatures consumed by emitted `contract.d.ts`
|
|
13
|
+
* files so the query builder surfaces `.distance()`, `.dwithin()`,
|
|
14
|
+
* `.contains()`, `.within()`, `.intersects()`, and `.intersectsBbox()`
|
|
15
|
+
* on `geometry` columns.
|
|
16
|
+
*/
|
|
17
|
+
type OperationTypes = {
|
|
18
|
+
readonly 'pg/geometry@1': {
|
|
19
|
+
readonly distance: {
|
|
20
|
+
readonly self: {
|
|
21
|
+
readonly codecId: 'pg/geometry@1';
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
readonly distanceSphere: {
|
|
25
|
+
readonly self: {
|
|
26
|
+
readonly codecId: 'pg/geometry@1';
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
readonly dwithin: {
|
|
30
|
+
readonly self: {
|
|
31
|
+
readonly codecId: 'pg/geometry@1';
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
readonly contains: {
|
|
35
|
+
readonly self: {
|
|
36
|
+
readonly codecId: 'pg/geometry@1';
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
readonly within: {
|
|
40
|
+
readonly self: {
|
|
41
|
+
readonly codecId: 'pg/geometry@1';
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
readonly intersects: {
|
|
45
|
+
readonly self: {
|
|
46
|
+
readonly codecId: 'pg/geometry@1';
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
readonly intersectsBbox: {
|
|
50
|
+
readonly self: {
|
|
51
|
+
readonly codecId: 'pg/geometry@1';
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
type QueryOperationTypes<CT extends CodecTypesBase> = SqlQueryOperationTypes<CT, {
|
|
57
|
+
readonly distance: {
|
|
58
|
+
readonly self: {
|
|
59
|
+
readonly codecId: 'pg/geometry@1';
|
|
60
|
+
};
|
|
61
|
+
readonly impl: (self: CodecExpression<'pg/geometry@1', boolean, CT>, other: CodecExpression<'pg/geometry@1', boolean, CT>) => Expression<{
|
|
62
|
+
codecId: 'pg/float8@1';
|
|
63
|
+
nullable: false;
|
|
64
|
+
}>;
|
|
65
|
+
};
|
|
66
|
+
readonly distanceSphere: {
|
|
67
|
+
readonly self: {
|
|
68
|
+
readonly codecId: 'pg/geometry@1';
|
|
69
|
+
};
|
|
70
|
+
readonly impl: (self: CodecExpression<'pg/geometry@1', boolean, CT>, other: CodecExpression<'pg/geometry@1', boolean, CT>) => Expression<{
|
|
71
|
+
codecId: 'pg/float8@1';
|
|
72
|
+
nullable: false;
|
|
73
|
+
}>;
|
|
74
|
+
};
|
|
75
|
+
readonly dwithin: {
|
|
76
|
+
readonly self: {
|
|
77
|
+
readonly codecId: 'pg/geometry@1';
|
|
78
|
+
};
|
|
79
|
+
readonly impl: (self: CodecExpression<'pg/geometry@1', boolean, CT>, other: CodecExpression<'pg/geometry@1', boolean, CT>, distance: CodecExpression<'pg/float8@1', boolean, CT>) => Expression<{
|
|
80
|
+
codecId: 'pg/bool@1';
|
|
81
|
+
nullable: false;
|
|
82
|
+
}>;
|
|
83
|
+
};
|
|
84
|
+
readonly contains: {
|
|
85
|
+
readonly self: {
|
|
86
|
+
readonly codecId: 'pg/geometry@1';
|
|
87
|
+
};
|
|
88
|
+
readonly impl: (self: CodecExpression<'pg/geometry@1', boolean, CT>, other: CodecExpression<'pg/geometry@1', boolean, CT>) => Expression<{
|
|
89
|
+
codecId: 'pg/bool@1';
|
|
90
|
+
nullable: false;
|
|
91
|
+
}>;
|
|
92
|
+
};
|
|
93
|
+
readonly within: {
|
|
94
|
+
readonly self: {
|
|
95
|
+
readonly codecId: 'pg/geometry@1';
|
|
96
|
+
};
|
|
97
|
+
readonly impl: (self: CodecExpression<'pg/geometry@1', boolean, CT>, other: CodecExpression<'pg/geometry@1', boolean, CT>) => Expression<{
|
|
98
|
+
codecId: 'pg/bool@1';
|
|
99
|
+
nullable: false;
|
|
100
|
+
}>;
|
|
101
|
+
};
|
|
102
|
+
readonly intersects: {
|
|
103
|
+
readonly self: {
|
|
104
|
+
readonly codecId: 'pg/geometry@1';
|
|
105
|
+
};
|
|
106
|
+
readonly impl: (self: CodecExpression<'pg/geometry@1', boolean, CT>, other: CodecExpression<'pg/geometry@1', boolean, CT>) => Expression<{
|
|
107
|
+
codecId: 'pg/bool@1';
|
|
108
|
+
nullable: false;
|
|
109
|
+
}>;
|
|
110
|
+
};
|
|
111
|
+
readonly intersectsBbox: {
|
|
112
|
+
readonly self: {
|
|
113
|
+
readonly codecId: 'pg/geometry@1';
|
|
114
|
+
};
|
|
115
|
+
readonly impl: (self: CodecExpression<'pg/geometry@1', boolean, CT>, other: CodecExpression<'pg/geometry@1', boolean, CT>) => Expression<{
|
|
116
|
+
codecId: 'pg/bool@1';
|
|
117
|
+
nullable: false;
|
|
118
|
+
}>;
|
|
119
|
+
};
|
|
120
|
+
}>;
|
|
121
|
+
//#endregion
|
|
122
|
+
export { QueryOperationTypes as n, OperationTypes as t };
|
|
123
|
+
//# sourceMappingURL=operation-types-_DWme6Gj-DddnbZus.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-types-_DWme6Gj-DddnbZus.d.mts","names":[],"sources":["../../../../3-extensions/postgis/dist/operation-types-_DWme6Gj.d.mts"],"mappings":";;;;KAGK,iBAAiB;WACX;WACA;;;;;;;;;;KAUN;WACM;aACE;eACE;iBACE;;;aAGJ;eACE;iBACE;;;aAGJ;eACE;iBACE;;;aAGJ;eACE;iBACE;;;aAGJ;eACE;iBACE;;;aAGJ;eACE;iBACE;;;aAGJ;eACE;iBACE;;;;;KAKZ,oBAAoB,WAAW,kBAAkB,uBAAuB;WAClE;aACE;eACE;;aAEF,OAAO,MAAM,0CAA0C,KAAK,OAAO,0CAA0C,QAAQ;MAC5H;MACA;;;WAGK;aACE;eACE;;aAEF,OAAO,MAAM,0CAA0C,KAAK,OAAO,0CAA0C,QAAQ;MAC5H;MACA;;;WAGK;aACE;eACE;;aAEF,OAAO,MAAM,0CAA0C,KAAK,OAAO,0CAA0C,KAAK,UAAU,wCAAwC,QAAQ;MACnL;MACA;;;WAGK;aACE;eACE;;aAEF,OAAO,MAAM,0CAA0C,KAAK,OAAO,0CAA0C,QAAQ;MAC5H;MACA;;;WAGK;aACE;eACE;;aAEF,OAAO,MAAM,0CAA0C,KAAK,OAAO,0CAA0C,QAAQ;MAC5H;MACA;;;WAGK;aACE;eACE;;aAEF,OAAO,MAAM,0CAA0C,KAAK,OAAO,0CAA0C,QAAQ;MAC5H;MACA;;;WAGK;aACE;eACE;;aAEF,OAAO,MAAM,0CAA0C,KAAK,OAAO,0CAA0C,QAAQ;MAC5H;MACA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/pack.d.mts
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { t as CodecTypes } from "./codec-types-M7J4vkfS-DOzWmEmw.mjs";
|
|
2
|
+
import "./operation-types-_DWme6Gj-DddnbZus.mjs";
|
|
3
|
+
//#region ../../../3-extensions/postgis/dist/pack.d.mts
|
|
4
|
+
//#region src/core/descriptor-meta.d.ts
|
|
5
|
+
declare const postgisPackMetaBase: {
|
|
6
|
+
readonly kind: "extension";
|
|
7
|
+
readonly id: "postgis";
|
|
8
|
+
readonly familyId: "sql";
|
|
9
|
+
readonly targetId: "postgres";
|
|
10
|
+
readonly version: "0.0.1";
|
|
11
|
+
readonly capabilities: {
|
|
12
|
+
readonly postgres: {
|
|
13
|
+
readonly 'postgis.geometry': true;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
readonly authoring: {
|
|
17
|
+
readonly type: {
|
|
18
|
+
readonly postgis: {
|
|
19
|
+
readonly Geometry: {
|
|
20
|
+
readonly kind: "typeConstructor";
|
|
21
|
+
readonly args: readonly [{
|
|
22
|
+
readonly kind: "number";
|
|
23
|
+
readonly name: "srid";
|
|
24
|
+
readonly integer: true;
|
|
25
|
+
readonly minimum: 0;
|
|
26
|
+
}];
|
|
27
|
+
readonly output: {
|
|
28
|
+
readonly codecId: "pg/geometry@1";
|
|
29
|
+
readonly nativeType: "geometry";
|
|
30
|
+
readonly typeParams: {
|
|
31
|
+
readonly srid: {
|
|
32
|
+
readonly kind: "arg";
|
|
33
|
+
readonly index: 0;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
readonly types: {
|
|
42
|
+
readonly codecTypes: {
|
|
43
|
+
readonly codecDescriptors: import("@prisma/orm-framework/components/codec").CodecDescriptor<unknown>[];
|
|
44
|
+
readonly import: {
|
|
45
|
+
readonly package: "@internal/extension-postgis/codec-types";
|
|
46
|
+
readonly named: "CodecTypes";
|
|
47
|
+
readonly alias: "PostgisTypes";
|
|
48
|
+
};
|
|
49
|
+
readonly typeImports: readonly [{
|
|
50
|
+
readonly package: "@internal/extension-postgis/codec-types";
|
|
51
|
+
readonly named: "Geometry";
|
|
52
|
+
readonly alias: "Geometry";
|
|
53
|
+
}];
|
|
54
|
+
};
|
|
55
|
+
readonly queryOperationTypes: {
|
|
56
|
+
readonly import: {
|
|
57
|
+
readonly package: "@internal/extension-postgis/operation-types";
|
|
58
|
+
readonly named: "QueryOperationTypes";
|
|
59
|
+
readonly alias: "PostgisQueryOperationTypes";
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
readonly storage: readonly [{
|
|
63
|
+
readonly typeId: "pg/geometry@1";
|
|
64
|
+
readonly familyId: "sql";
|
|
65
|
+
readonly targetId: "postgres";
|
|
66
|
+
readonly nativeType: "geometry";
|
|
67
|
+
}];
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
declare const postgisPackMeta: typeof postgisPackMetaBase & {
|
|
71
|
+
readonly __codecTypes?: CodecTypes;
|
|
72
|
+
};
|
|
73
|
+
//#endregion
|
|
74
|
+
export { postgisPackMeta as default };
|
|
75
|
+
//# sourceMappingURL=pack.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pack.d.mts","names":[],"sources":["../../../../3-extensions/postgis/dist/pack.d.mts"],"mappings":";;;;cAGc;WACH;WACA;WACA;WACA;WACA;WACA;aACE;eACE;;;WAGJ;aACE;eACE;iBACE;mBACE;mBACA;qBACE;qBACA;qBACA;qBACA;;mBAEF;qBACE;qBACA;qBACA;uBACE;yBACE;yBACA;;;;;;;;WAQd;aACE;eACE,iEAAiE;eACjE;iBACE;iBACA;iBACA;;eAEF;iBACE;iBACA;iBACA;;;aAGJ;eACE;iBACE;iBACA;iBACA;;;aAGJ;eACE;eACA;eACA;eACA;;;;cAID,wBAAwB;WAC3B,eAAe"}
|
package/dist/pack.mjs
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SqlRuntimeExtensionDescriptor } from "@prisma/orm-family-sql/runtime";
|
|
2
|
+
import { CodecDescriptorRegistry } from "@prisma/orm-family-sql/relational-core/query-lane-context";
|
|
3
|
+
//#region ../../../3-extensions/postgis/dist/runtime.d.mts
|
|
4
|
+
//#region src/core/registry.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Registry of every codec descriptor shipped by `@internal/extension-postgis`.
|
|
7
|
+
*
|
|
8
|
+
* Public consumer surface for the postgis codec set. Currently a single
|
|
9
|
+
* entry (`pg/geometry@1`); the registry shape stays consistent with
|
|
10
|
+
* the other codec-shipping packages so consumers don't need to
|
|
11
|
+
* special-case extensions.
|
|
12
|
+
*/
|
|
13
|
+
declare const postgisCodecRegistry: CodecDescriptorRegistry;
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/exports/runtime.d.ts
|
|
16
|
+
declare const postgisRuntimeDescriptor: SqlRuntimeExtensionDescriptor<'postgres'>;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { postgisRuntimeDescriptor as default, postgisCodecRegistry };
|
|
19
|
+
//# sourceMappingURL=runtime.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.mts","names":[],"sources":["../../../../3-extensions/postgis/dist/runtime.d.mts"],"mappings":";;;;;;;;;;;;cAWc,sBAAsB;;;cAGtB,0BAA0B"}
|
package/dist/runtime.mjs
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { n as postgisPackMeta, r as postgisQueryOperations, t as postgisCodecRegistry } from "./descriptor-meta-deM0Qc_b-FRxKhllA.mjs";
|
|
2
|
+
//#region ../../../3-extensions/postgis/dist/runtime.mjs
|
|
3
|
+
const postgisRuntimeDescriptor = {
|
|
4
|
+
kind: "extension",
|
|
5
|
+
id: postgisPackMeta.id,
|
|
6
|
+
version: postgisPackMeta.version,
|
|
7
|
+
familyId: "sql",
|
|
8
|
+
targetId: "postgres",
|
|
9
|
+
types: { codecTypes: { codecDescriptors: Array.from(postgisCodecRegistry.values()) } },
|
|
10
|
+
codecs: () => Array.from(postgisCodecRegistry.values()),
|
|
11
|
+
queryOperations: () => postgisQueryOperations(),
|
|
12
|
+
create() {
|
|
13
|
+
return {
|
|
14
|
+
familyId: "sql",
|
|
15
|
+
targetId: "postgres"
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
export { postgisRuntimeDescriptor as default, postgisCodecRegistry };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=runtime.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.mjs","names":[],"sources":["../../../../3-extensions/postgis/dist/runtime.mjs"],"sourcesContent":["import { n as postgisQueryOperations, r as postgisCodecRegistry, t as postgisPackMeta } from \"./descriptor-meta-deM0Qc_b.mjs\";\n//#region src/exports/runtime.ts\nconst postgisRuntimeDescriptor = {\n\tkind: \"extension\",\n\tid: postgisPackMeta.id,\n\tversion: postgisPackMeta.version,\n\tfamilyId: \"sql\",\n\ttargetId: \"postgres\",\n\ttypes: { codecTypes: { codecDescriptors: Array.from(postgisCodecRegistry.values()) } },\n\tcodecs: () => Array.from(postgisCodecRegistry.values()),\n\tqueryOperations: () => postgisQueryOperations(),\n\tcreate() {\n\t\treturn {\n\t\t\tfamilyId: \"sql\",\n\t\t\ttargetId: \"postgres\"\n\t\t};\n\t}\n};\n//#endregion\nexport { postgisRuntimeDescriptor as default, postgisCodecRegistry };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;AAEA,MAAM,2BAA2B;CAChC,MAAM;CACN,IAAI,gBAAgB;CACpB,SAAS,gBAAgB;CACzB,UAAU;CACV,UAAU;CACV,OAAO,EAAE,YAAY,EAAE,kBAAkB,MAAM,KAAK,qBAAqB,OAAO,CAAC,EAAE,EAAE;CACrF,cAAc,MAAM,KAAK,qBAAqB,OAAO,CAAC;CACtD,uBAAuB,uBAAuB;CAC9C,SAAS;EACR,OAAO;GACN,UAAU;GACV,UAAU;EACX;CACD;AACD"}
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@prisma/orm-extension-postgis",
|
|
3
|
+
"version": "0.16.0-dev.36",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"description": "PostGIS geometry types, operators, and indexes for Prisma Next",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@prisma/orm-family-sql": "0.16.0-dev.36",
|
|
13
|
+
"@prisma/orm-framework": "0.16.0-dev.36",
|
|
14
|
+
"@prisma/orm-toolchain": "0.16.0-dev.36",
|
|
15
|
+
"@standard-schema/spec": "^1.1.0",
|
|
16
|
+
"arktype": "^2.2.2"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@internal/extension-postgis": "0.16.0-dev.36",
|
|
20
|
+
"@repo/tsconfig": "0.16.0-dev.36",
|
|
21
|
+
"@repo/tsdown": "0.16.0-dev.36",
|
|
22
|
+
"@prisma/orm-target-postgres": "0.16.0-dev.36",
|
|
23
|
+
"tsdown": "0.22.14",
|
|
24
|
+
"typescript": "5.9.3"
|
|
25
|
+
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"@prisma/orm-target-postgres": "0.16.0-dev.36",
|
|
28
|
+
"typescript": ">=5.9"
|
|
29
|
+
},
|
|
30
|
+
"peerDependenciesMeta": {
|
|
31
|
+
"typescript": {
|
|
32
|
+
"optional": true
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"exports": {
|
|
36
|
+
"./codec-types": "./dist/codec-types.mjs",
|
|
37
|
+
"./column-types": "./dist/column-types.mjs",
|
|
38
|
+
"./control": "./dist/control.mjs",
|
|
39
|
+
"./geojson": "./dist/geojson.mjs",
|
|
40
|
+
"./operation-types": "./dist/operation-types.mjs",
|
|
41
|
+
"./pack": "./dist/pack.mjs",
|
|
42
|
+
"./runtime": "./dist/runtime.mjs",
|
|
43
|
+
"./package.json": "./package.json"
|
|
44
|
+
},
|
|
45
|
+
"repository": {
|
|
46
|
+
"type": "git",
|
|
47
|
+
"url": "https://github.com/prisma/prisma.git",
|
|
48
|
+
"directory": "packages/9-public/@prisma/orm-extension-postgis"
|
|
49
|
+
},
|
|
50
|
+
"scripts": {
|
|
51
|
+
"build": "tsdown",
|
|
52
|
+
"lint": "biome check . --error-on-warnings",
|
|
53
|
+
"clean": "rm -rf dist src-gen"
|
|
54
|
+
}
|
|
55
|
+
}
|