Commit Graph

135 Commits

Author SHA1 Message Date
dal f8f9f4b0e0
few tweaks from greptile comments 2025-08-14 10:19:40 -06:00
dal 35623ad987
Integrate access controls with metric file downloads
- Added permission checks to metric file download handler
- Added permission checks to export-metric-data trigger task
- Created comprehensive tests for access control integration
- Updated AssetType enums to include report_file
- Resolved export conflicts in server-shared package
- Fixed AI package imports for new getPermissionedDatasets API
2025-08-13 14:25:41 -06:00
dal ebe496df87
Merge access-controls branch and resolve conflicts
- Combined asset type enums from both branches
- Merged all database query exports
- Integrated access-controls package into server-shared
- Resolved conflicts in AI package instructions
2025-08-13 14:15:20 -06:00
dal 594f08202b
Refactor metric file handling and improve error handling
- Updated type definitions for better clarity and type safety in metric file download and export tasks.
- Enhanced error handling in the metric files API to utilize HTTPException for more consistent error responses.
- Added environment variable validation in export tasks to ensure necessary credentials are present before execution.
- Improved type assertions for content in metric export queries to ensure proper handling of JSONB data.
2025-08-13 14:01:46 -06:00
dal a3c4238da1
lint fix 2025-08-13 13:48:28 -06:00
dal 3eb80ae630
Add metric file export functionality with Cloudflare R2 support
- Introduced new API endpoint for downloading metric files as CSV.
- Implemented export logic to handle large datasets (up to 1 million rows) and generate presigned URLs for secure downloads.
- Added cleanup task to remove exported files from R2 storage after 60 seconds.
- Updated environment configuration to include Cloudflare R2 credentials.
- Enhanced error handling for various export scenarios.
- Refactored related database queries and schemas for better integration.
- Updated documentation for new features and usage instructions.
2025-08-13 13:36:42 -06:00
Nate Kelley 438bec4ce4
Fix caption parser 2025-08-11 15:01:08 -06:00
Nate Kelley 23411f25c6
report editor updates 2025-08-11 13:40:01 -06:00
Nate Kelley 51f896d19e
Add title skeletons 2025-08-07 23:24:28 -06:00
Nate Kelley 0969a1cbd3
Merge branch 'staging' into cursor/add-report-menu-options-and-stub-functions-e636 2025-08-07 17:22:18 -06:00
Nate Kelley 216e610aa8
Added some additional safe parse element stuff 2025-08-07 17:21:38 -06:00
Nate Kelley 75950ae108
super nested list items 2025-08-07 17:01:45 -06:00
dal 8e624a2c50
fixing migrations 2025-08-07 15:57:01 -06:00
Nate Kelley 4006852efa
Add comment to content 2025-08-07 14:12:32 -06:00
Nate Kelley 40a44cf1f9
Merge branch 'staging' into dallin-bus-1589-create-and-modify-report-tools 2025-08-07 14:05:44 -06:00
Nate Kelley 9ba4750a65
Adjust add metric modal 2025-08-05 17:05:27 -06:00
dal ba1da07473
Add new report content manipulation functions
Introduce 'replace-report-content' and 'append-report-content' exports to enhance report content management capabilities, allowing for more flexible report updates and modifications.
2025-08-05 14:30:22 -06:00
dal a26242c46d
Enhance report handling by integrating markdown to PlateJS conversion in the report retrieval process, improving content formatting and error handling. Update report update schema to accept string content for markdown streaming. 2025-08-05 12:02:40 -06:00
dal b8ad52cf28
change the schema content to be text for markdown streaming 2025-08-05 11:38:43 -06:00
Nate Kelley 1ef0d18c61
Report playground updates for fixed toolbar 2025-08-05 10:15:22 -06:00
Nate Kelley 44787f5478
Add additional asset queries 2025-08-04 22:13:09 -06:00
Nate Kelley 124523ade9
add a version number to reports 2025-08-04 21:37:23 -06:00
Nate Kelley 4a6c36c4b0
update report version logic 2025-08-04 21:10:03 -06:00
Nate Kelley 43af5fdb4d
add a fix for broken migrate 2025-08-04 20:45:30 -06:00
Nate Kelley c6834bdfeb
update 2025-08-04 18:20:06 -06:00
Nate Kelley 87ea87e963
collection and assets queries 2025-08-04 16:45:49 -06:00
Nate Kelley 1a955d786b
Get report 2025-08-04 15:25:22 -06:00
Nate Kelley b3b759bd26
addded collection query 2025-08-04 15:20:15 -06:00
Nate Kelley ddff671040
Update get report 2025-08-04 15:13:21 -06:00
Nate Kelley a3198003a3
get report 2025-08-04 15:05:18 -06:00
Nate Kelley 5f6524581b
created list database query 2025-08-04 14:21:49 -06:00
Nate Kelley aae819e151
create new schema for reports 2025-08-04 14:03:52 -06:00
Nate Kelley fad6670e83
fix type assertion
added safe guards around report_fule

pass generics through

fix list pass throughs
2025-08-04 10:06:59 -06:00
dal 273fbc36c4
fix: address non-critical PR review comments
- Optimized N+1 query in get-permissioned-datasets.ts using inArray for batch lookup
- Removed unused bulkRemoveAssetPermissions import
- Fixed import organization in find-user-by-email.ts
- Updated CLAUDE.md to reflect tests are written and fixed API example
- Clarified TODO comment in lookup.ts to prevent potential infinite recursion

These are style and performance improvements that don't affect functionality.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-29 12:29:02 -06:00
dal 2e04af1785
fix: address additional critical PR review comments
- Fixed permission hierarchy: full_access (5) now correctly ranks higher than viewer (3)
- Removed 'querier' role from admin permission check as it was too permissive
- Added organizationId parameter to dashboard access checks to prevent unauthorized access
- Fixed public dashboard expiry date check to verify dates are in the future
- Added cycle detection for collection permissions to prevent infinite recursion
- Fixed bulk remove permissions to correctly filter by identityIds array
- Updated date comparison to use ISO string format for PostgreSQL timestamp columns

These fixes address critical security and logic issues identified in the PR review.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-29 12:28:58 -06:00
dal d078830a18
fix: address PR review comments for access control migration
- Fixed AssetTypeSchema to include all active asset types (excluding deprecated 'metric' and 'dashboard')
- Added missing 'restricted_querier' role to UserOrganizationRole type
- Fixed dataset access caching to store full result object including accessPath and userRole
- Updated count query to use SQL COUNT for better performance
- Fixed IdentityType consistency across dataset permissions
- Removed unused 'ne' import from list-asset-permissions.ts
- Updated comments to correctly reference 6 access paths instead of 5

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-29 12:28:52 -06:00
dal 4bef4205f3
feat(access-controls): migrate Rust access control libraries to TypeScript
This PR migrates the Rust  and  libraries to TypeScript in the new  package.

## Changes

### New Access Controls Package
- Implemented complete asset permissions system with CRUD operations
- Added dataset permissions with all 5 access paths (admin, direct user, user→group, team→direct, team→group, org→default)
- Implemented cascading permissions (metrics inherit from dashboards/chats/collections)
- Added LRU caching to replace Redis (30-second TTL)
- Comprehensive test coverage (148 tests passing, 3 skipped pending createUser)

### Database Package Updates
- Fixed AssetType enum to include all 14 asset types
- Added missing database queries for permissions
- Fixed timestamp fields to use ISO strings
- Added getUserOrganizationsByUserId function
- Created organized query structure by table

### AI Package Updates
- Updated getPermissionedDatasets API calls to new format
- Changed property references from ymlFile to ymlContent
- Fixed all test mocks to match new API structure

### Trigger App Updates
- Updated to use new access controls API
- Fixed test mocks to match DatasetListResult structure
- Added proper type imports

### Server Shared Updates
- Added request/response types for access control endpoints
- Exported types for API consistency

## Testing
- All packages build successfully with turbo build:dry-run
- All tests pass with turbo test:unit
- Full type safety maintained throughout

## Migration Notes
- Drop-in replacement for Rust libraries
- Same permission model and roles
- Cache invalidation strategies implemented
- Soft delete pattern maintained

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-28 10:17:35 -06:00
dal 2833c6bb0c
dry run 2025-07-25 18:29:35 -06:00
dal 1f52bd9b69
Enhance asset chat handling by introducing `handleAssetChatWithPrompt` for processing user prompts alongside asset imports. Update `createChatHandler` to manage asset-only and asset+prompt scenarios, ensuring correct message order and preventing unnecessary analyst task triggers. Add tests for new functionality and refactor related services for improved clarity and maintainability. 2025-07-25 12:47:01 -06:00
Nate Kelley 5e6eb76f5b
move get asset types around 2025-07-24 17:41:36 -06:00
Nate Kelley b2cf1725fc
Merge branch 'staging' into devin/BUS-1494-1753276227 2025-07-24 17:21:04 -06:00
Nate Kelley e6d4062847
Merge branch 'staging' into big-nate/bus-1483-quick-win-for-filter-dashboard-drill-downexplore-metric 2025-07-23 22:45:54 -06:00
Nate Kelley df3533ffc7
pass in better props 2025-07-23 17:18:45 -06:00
dal 482564528a
lint fixes 2025-07-23 16:56:32 -06:00
dal 42d1da5389
context fixes on messages 2025-07-23 16:56:06 -06:00
Devin AI 5b40205275 Implement /api/v2/title endpoint for BUS-1494
- Add server-shared types for GetTitleRequest and GetTitleResponse with Zod validation
- Create database query functions for each asset type (chat, metric, collection, dashboard)
- Implement GET endpoint with zValidator middleware and exhaustive switch statement
- Add proper permission checks (publiclyAccessible OR organizationId match)
- Export new functions from database query index files
- Add title route to v2 API index
- Follow existing Hono API patterns with standardErrorHandler

Co-Authored-By: nate@buster.so <nate@buster.so>
2025-07-23 13:14:58 +00:00
Nate Kelley 8ee892bf2a
Use tsx and .ts files for validation 2025-07-21 16:07:14 -06:00
Cursor Agent c1c7b37942 Add centralized environment variable management with env-utils package
Co-authored-by: natemkelley <natemkelley@gmail.com>
2025-07-21 21:14:50 +00:00
dal 254e7fc462
default db conn to local when none present 2025-07-21 01:51:33 -06:00
dal ec4262b87c
ci and a random lint 2025-07-21 00:28:39 -06:00