drizzle-cube 0.4.15 → 0.4.16
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/adapters/express/index.cjs +1 -1
- package/dist/adapters/express/index.js +1 -1
- package/dist/adapters/fastify/index.cjs +1 -1
- package/dist/adapters/fastify/index.js +1 -1
- package/dist/adapters/{handler-ZDYlokiM.cjs → handler-B6yAJw_O.cjs} +12 -12
- package/dist/adapters/{handler-DZnCbydH.js → handler-BmTtVoRu.js} +203 -194
- package/dist/adapters/hono/index.cjs +1 -1
- package/dist/adapters/hono/index.js +1 -1
- package/dist/adapters/nextjs/index.cjs +1 -1
- package/dist/adapters/nextjs/index.js +1 -1
- package/dist/server/index.cjs +40 -40
- package/dist/server/index.js +19 -10
- package/package.json +1 -1
package/dist/server/index.js
CHANGED
|
@@ -32591,13 +32591,13 @@ function vT() {
|
|
|
32591
32591
|
properties: {
|
|
32592
32592
|
measures: {
|
|
32593
32593
|
type: "array",
|
|
32594
|
-
items: { type: "string" },
|
|
32595
|
-
description: 'Aggregation measures (e.g., ["
|
|
32594
|
+
items: { type: "string", pattern: "^[A-Z][a-zA-Z0-9]*\\.[a-zA-Z][a-zA-Z0-9]*$" },
|
|
32595
|
+
description: 'Aggregation measures — MUST be "CubeName.measureName" format (e.g., ["PullRequests.count", "Issues.openCount"]). NEVER use just the cube name.'
|
|
32596
32596
|
},
|
|
32597
32597
|
dimensions: {
|
|
32598
32598
|
type: "array",
|
|
32599
|
-
items: { type: "string" },
|
|
32600
|
-
description: 'Grouping dimensions (e.g., ["
|
|
32599
|
+
items: { type: "string", pattern: "^[A-Z][a-zA-Z0-9]*\\.[a-zA-Z][a-zA-Z0-9]*$" },
|
|
32600
|
+
description: 'Grouping dimensions — MUST be "CubeName.dimensionName" format (e.g., ["Teams.name", "Employees.department"]). NEVER use just the cube name.'
|
|
32601
32601
|
},
|
|
32602
32602
|
filters: {
|
|
32603
32603
|
type: "array",
|
|
@@ -32867,8 +32867,17 @@ function $T(r) {
|
|
|
32867
32867
|
return { result: JSON.stringify(n, null, 2) };
|
|
32868
32868
|
}), s.set("execute_query", async (n) => {
|
|
32869
32869
|
try {
|
|
32870
|
-
|
|
32871
|
-
|
|
32870
|
+
const i = (A, o) => {
|
|
32871
|
+
if (!Array.isArray(A)) return;
|
|
32872
|
+
const R = A.filter((S) => typeof S == "string" && !S.includes("."));
|
|
32873
|
+
if (R.length > 0)
|
|
32874
|
+
throw new Error(
|
|
32875
|
+
`Invalid ${o}: ${R.map((S) => `"${S}"`).join(", ")}. All ${o} must use "CubeName.fieldName" format (e.g., "PullRequests.count", "Teams.name"). Use discover_cubes or get_cube_metadata to find valid field names.`
|
|
32876
|
+
);
|
|
32877
|
+
};
|
|
32878
|
+
i(n.measures, "measures"), i(n.dimensions, "dimensions");
|
|
32879
|
+
let E;
|
|
32880
|
+
n.funnel ? E = { funnel: n.funnel } : n.flow ? E = { flow: n.flow } : n.retention ? E = { retention: n.retention } : E = {
|
|
32872
32881
|
measures: n.measures,
|
|
32873
32882
|
dimensions: n.dimensions,
|
|
32874
32883
|
filters: n.filters,
|
|
@@ -32876,12 +32885,12 @@ function $T(r) {
|
|
|
32876
32885
|
order: n.order,
|
|
32877
32886
|
limit: n.limit
|
|
32878
32887
|
};
|
|
32879
|
-
const
|
|
32888
|
+
const a = await jo(e, t, { query: E });
|
|
32880
32889
|
return {
|
|
32881
32890
|
result: JSON.stringify({
|
|
32882
|
-
rowCount:
|
|
32883
|
-
data:
|
|
32884
|
-
annotation:
|
|
32891
|
+
rowCount: a.data.length,
|
|
32892
|
+
data: a.data,
|
|
32893
|
+
annotation: a.annotation
|
|
32885
32894
|
}, null, 2)
|
|
32886
32895
|
};
|
|
32887
32896
|
} catch (i) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "drizzle-cube",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.16",
|
|
4
4
|
"description": "Drizzle ORM-first semantic layer with Cube.js compatibility. Type-safe analytics and dashboards with SQL injection protection.",
|
|
5
5
|
"main": "./dist/server/index.js",
|
|
6
6
|
"types": "./dist/server/index.d.ts",
|