feat: data connector source metadata for all providers (spec v0.7.9) - #142
Conversation
Regenerated from spec v0.7.9 (cloudglue/cloudglue-api-spec#103) and bumped to 0.7.19. Generated: - New ZoomSourceMetadata, RecallSourceMetadata, GoogleDriveSourceMetadata, DropboxSourceMetadata, and GongSourceMetadata schemas; SourceMetadata is now a discriminated union on source_type across all six connectors, with required fields loosened to source_type + the provider's primary id - Updated data-connector endpoint descriptions (per-connector filter support, filtered-pagination contract, 501 only for s3/gcs, 502 on unvalidatable upstream responses) Wrapper: - Export the SourceMetadata family and SourceMetadataResponse from types.ts - Refresh EnhancedDataConnectorsApi docs: per-connector from/to and title_search support matrix, per-file provider metadata on listFiles, filtered-pagination guidance, source-metadata support for all six connectors Verified against the live API: list + per-file metadata + source-metadata lookups pass for grain, zoom, recall, google-drive, dropbox, and gong; title_search verified on google-drive (native, folders exempt) and gong (matched while listing).
📝 WalkthroughWalkthrough
ChangesSchema and API contract updates
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 653500e. Configure here.
The nullish/nullable transform in generate.js collected nullable field NAMES per file and widened every same-named field in the file's TS types. Nullability leaked across unrelated types: RecallSourceMetadata.created_at and DropboxSourceMetadata.media_info (new in spec v0.7.9, nullable) made File.created_at, File.media_info, and Describe.created_at emit '| null' even though their Zod schemas and the spec say they are never null (flagged by Bugbot on this PR). Older leaks from the same bug: File/Describe thumbnail_url, Describe.duration_seconds, CreateResponseRequest.instructions, DeepSearchKBCollections.filter, NewCollection.face_detection_config, and nested thumbnail_url in Segmentation/FrameExtraction. Detection and widening now pair each 'const <Name>' Zod schema with its 'type <Name>' declaration via the TypeScript AST and only widen fields within the paired type. Regenerated output removes every stale '| null'; all removals verified non-nullable against the spec. Zod schemas are unchanged (they were always correct). deep-search.api.ts drops the '| null' its filter param had inherited from the leaked generated type.
|
Bugbot's finding was real but the root cause was in Fixed in 77db625: detection/widening are now scoped to matching Verified: |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@generate.js`:
- Around line 210-211: Increase both schema backward-search limits in
generate.js: update the rawStart calculation near lines 210-211 to look back
10000 characters, and update the corresponding lookback near line 386 to search
200 lines. Preserve the existing search and widening behavior otherwise.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 3adf4254-443d-4bbe-bd53-1dedf5e97636
⛔ Files ignored due to path filters (7)
generated/Collections.tsis excluded by!**/generated/**generated/Data_Connectors.tsis excluded by!**/generated/**generated/Deep_Search.tsis excluded by!**/generated/**generated/Files.tsis excluded by!**/generated/**generated/Response.tsis excluded by!**/generated/**generated/common.tsis excluded by!**/generated/**package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (6)
generate.jspackage.jsonspecsrc/api/data-connectors.api.tssrc/api/deep-search.api.tssrc/types.ts
…sh calls Addresses CodeRabbit feedback on the backward-search heuristics: instead of enlarging the arbitrary lookback limits (1000 chars / 20 lines), drop them — detection now runs within a single schema declaration slice, so searching to the start of the slice is bounded by construction and can't silently miss the owning field of a large inline nullable object. Regenerated output is byte-identical; build clean, 106/106 unit tests, live six-connector battery 20/20.
|
Addressed the generate.js lookback finding in d663cee — went one step further than the suggested larger limits: since detection is now scoped to a single schema declaration slice, the arbitrary windows are dropped entirely and the search runs to the start of the slice, which is bounded by construction. Regenerated output is byte-identical; build clean, 106/106 unit tests, live six-connector battery re-run 20/20. |

Summary
Syncs the SDK to spec v0.7.9 (cloudglue/cloudglue-api-spec#103) and bumps the package to 0.7.19.
Generated
ZoomSourceMetadata,RecallSourceMetadata,GoogleDriveSourceMetadata,DropboxSourceMetadata, andGongSourceMetadataschemas;SourceMetadatais now a discriminated union onsource_typeacross all six connectors, with required fields loosened tosource_type+ the provider's primary id (everything else nullable)from/to+title_searchsupport, filtered-pagination contract, 501 now only for s3/gcs, 502 on unvalidatable upstream responsesWrapper (src/)
types.tsexports theSourceMetadatafamily (all six variants) andSourceMetadataResponse, so consumers can narrowfile.source_metadata/getSourceMetadata()results onsource_typeEnhancedDataConnectorsApidocs refreshed: accurate per-connector filter support matrix onListDataConnectorFilesParams, per-file provider metadata onlistFiles, filtered-pagination guidance (keep paging untilnext_page_tokenis null), source-metadata support for all six connectorsTest plan
npm run buildclean,npm test106/106listFilesreturns per-file provider metadata with matchingsource_type;getSourceMetadata200s and narrows to the right variant for grain/zoom/recall/google-drive/dropbox/gong; Dropbox folder drill viapath;title_searchverified on google-drive (native, folders exempt) and gong (matched while listing) — 20/20 checks passedNote
Medium Risk
Grain
SourceMetadatafield optionality and broader union typing can break consumers that assumed required fields; the generator pairing change affects all regenerated types but reduces prior nullability bugs.Overview
Syncs the client to OpenAPI spec v0.7.9 and releases 0.7.19, centered on provider source metadata for data connectors and safer post-generation TypeScript fixes.
Source metadata & connectors:
SourceMetadatais now asource_typediscriminated union across Grain, Zoom, Recall, Google Drive, Dropbox, and Gong, with new Zod/TS shapes for each provider. Grain metadata is relaxed so onlysource_typeandgrain_recording_idstay required; other fields are optional/nullable. Generated data-connector docs describe per-filemetadataonlistFiles, sync/source_metadatafor all six providers, expandedgetSourceMetadatasupport (501 only for S3/GCS), and filtered-pagination behavior.generate.js: Nullish/nullable TS widening is scoped to matchingconstZod schema /typealias pairs (via the TypeScript AST) instead of file-wide field names, fixing incorrect| nullon unrelated types (e.g.File.created_atvsRecallSourceMetadata.created_at).Public API surface:
types.tsre-exports the fullSourceMetadatafamily andSourceMetadataResponse.EnhancedDataConnectorsApiandListDataConnectorFilesParamsdocument per-connectorfrom/to/title_searchsupport and pagination. Deep search collectionfilterisSearchFilteronly (nonull); Responseinstructionsinput typing drops explicitnullwhere the schema is optional-only.Reviewed by Cursor Bugbot for commit d663cee. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit
nullvalues.