Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,8 @@ These are the target patterns for adapting Synmetrix and client-v2:
- In-memory Map caches only (no DB changes) (008-hasura-proxy)
- JavaScript (ES modules), Node.js 22+ + Express 4.18.2 (CubeJS routes), `@cubejs-backend/clickhouse-driver` (wraps `@clickhouse/client` ^1.12.0), `smartdataHQ/toolkit` (jsonstat-toolkit fork, zero deps), React 18 + Vite + Ant Design 5 (client-v2) (009-query-output)
- N/A — no database schema changes. Query results are transient. (009-query-output)
- JavaScript (ES modules), Node.js 22+ + Cube.js v1.6.x (CubeJS service), Express 4.18.2, `openai` npm v6.x (NEW), React 18 + Vite + Ant Design 5 (client-v2), URQL (GraphQL client) (010-dynamic-models-ii)
- PostgreSQL via Hasura (versions, dataschemas), ClickHouse (profiling target — read-only) (010-dynamic-models-ii)

## Recent Changes
- 001-dev-environment: Added TypeScript (ES2022, Node16 modules) — matches + oclif (CLI framework), zx (shell execution)
10 changes: 10 additions & 0 deletions services/actions/src/rpc/smartGenSchemas.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ export default async (session, input, headers) => {
merge_strategy: mergeStrategy,
profile_data: profileData,
dry_run: dryRun,
filters,
file_name: fileName,
cube_name: cubeName,
selected_ai_metrics: selectedAIMetrics,
selected_columns: selectedColumns,
} = input || {};

const userId = session?.["x-hasura-user-id"];
Expand All @@ -32,6 +37,11 @@ export default async (session, input, headers) => {
mergeStrategy,
profileData,
dryRun,
filters,
file_name: fileName,
cube_name: cubeName,
selected_ai_metrics: selectedAIMetrics,
selected_columns: selectedColumns,
});

return result;
Expand Down
22 changes: 21 additions & 1 deletion services/actions/src/rpc/updateTeamSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ import { invalidateAllUserCaches } from "../utils/cubeCache.js";
import { fetchGraphQL } from "../utils/graphql.js";
import { isPortalAdmin } from "../utils/portalAdmin.js";

const getTeamQuery = `
query GetTeamSettings($team_id: uuid!) {
teams_by_pk(id: $team_id) {
settings
}
}
`;

const updateTeamSettingsMutation = `
mutation ($team_id: uuid!, $settings: jsonb!) {
update_teams_by_pk(pk_columns: {id: $team_id}, _set: {settings: $settings}) {
Expand Down Expand Up @@ -94,10 +102,22 @@ export default async (session, input, headers) => {
};
}

// Read current settings and merge to avoid overwriting existing keys
const currentRes = await fetchGraphQL(getTeamQuery, { team_id: teamId });
const currentSettings = currentRes?.data?.teams_by_pk?.settings || {};
const merged = { ...currentSettings };
for (const [key, value] of Object.entries(settings)) {
if (value === null) {
delete merged[key];
} else {
merged[key] = value;
}
}

// Update team settings
const res = await fetchGraphQL(
updateTeamSettingsMutation,
{ team_id: teamId, settings },
{ team_id: teamId, settings: merged },
headers?.authorization
);

Expand Down
104 changes: 91 additions & 13 deletions services/cubejs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions services/cubejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"jsum": "^2.0.0-alpha.3",
"node-gyp": "^9.3.1",
"nodemon": "^2.0.2",
"openai": "^6.29.0",
"pg": "^8.7.1",
"pg-connection-string": "^2.2.0",
"ramda": "^0.29.0",
Expand Down
Loading
Loading