Skip to content

Export QueryParam and QueryParams types#504

Open
Copilot wants to merge 4 commits intomainfrom
copilot/export-queryparam-queryparams-types
Open

Export QueryParam and QueryParams types#504
Copilot wants to merge 4 commits intomainfrom
copilot/export-queryparam-queryparams-types

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 27, 2026

The QueryParam and QueryParams types were internal to the library but are needed by consumers for type-safe query parameter construction.

Changes

  • Added export keyword to QueryParam and QueryParams in src/commands/index.ts
  • Re-exported from main index.ts along with related types QueryOptions and QueryOptionsBackwardCompatible

Usage

import type { QueryParams } from 'falkordb';

const params: QueryParams = {
    userId: 123,
    username: 'john_doe',
    isActive: true,
    tags: ['admin', 'user'],
    metadata: {
        lastLogin: null
    }
};

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • sentinel-1
    • Triggering command: /usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/falkordb-ts/falkordb-ts/node_modules/jest-worker/build/processChild.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>export types QueryParam & QueryParams</issue_title>
<issue_description>at the moment the following 2 types are not exported. It would be helpful to use them, too.

type QueryParam = null | string | number | boolean | QueryParams | Array<QueryParam>;
type QueryParams = {
    [key: string]: QueryParam;
};

in /index.ts#L55

Thank you!


This repo is using Opire - what does it mean? 👇
💵 Everyone can add rewards for this issue commenting /reward 100 (replace 100 with the amount).
🕵️‍♂️ If someone starts working on this issue to earn the rewards, they can comment /try to let everyone know!
🙌 And when they open the PR, they can comment /claim FalkorDB/falkordb-ts#437 either in the PR description or in a PR's comment.

🪙 Also, everyone can tip any user commenting /tip 20 @MR4online (replace 20 with the amount, and @MR4online with the user to tip).

📖 If you want to learn more, check out our documentation.

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Summary by CodeRabbit

  • New Features

    • Exported new public types for query parameters and query options, expanding the module's public API surface.
  • Tests

    • Added test coverage verifying the newly exported types function correctly and can be used in TypeScript projects.

Copilot AI and others added 2 commits January 27, 2026 07:14
Co-authored-by: gkorland <753206+gkorland@users.noreply.github.com>
Co-authored-by: gkorland <753206+gkorland@users.noreply.github.com>
Copilot AI changed the title [WIP] Export types QueryParam and QueryParams Export QueryParam and QueryParams types Jan 27, 2026
Copilot AI requested a review from gkorland January 27, 2026 07:20
@gkorland gkorland marked this pull request as ready for review February 27, 2026 19:43
@gkorland gkorland requested a review from Copilot February 27, 2026 19:43
@gkorland
Copy link
Copy Markdown
Contributor

@CodeRabbit review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 27, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 27, 2026

📝 Walkthrough

Walkthrough

The pull request exports previously internal type definitions (QueryParam, QueryParams, QueryOptions, QueryOptionsBackwardCompatible) from the module's public API, allowing consumers to import and use these types directly. Includes test coverage validating the exported types work correctly.

Changes

Cohort / File(s) Summary
Type Exports
index.ts, src/commands/index.ts
Explicitly exports QueryParam, QueryParams, QueryOptions, and QueryOptionsBackwardCompatible types from the public API surface, upgrading them from internal type aliases to exported declarations.
Type Validation Tests
tests/exportedTypes.spec.ts
Adds 39 lines of test cases verifying that exported QueryParams and QueryParam types are usable in TypeScript with expected field types and value assignments (string, number, boolean, null, array, object).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 Hop, hop, hooray!
Types now exposed for all to play,
QueryParam takes the stage today,
No longer hidden far away!
Tests confirm our types are A-OK!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Out of Scope Changes check ❓ Inconclusive The raw summary contains conflicting information about changes in src/commands/index.ts, mentioning both type exports and unrelated Python class modifications, making scope assessment unclear. Clarify whether changes to Calculator class methods and variable renaming in src/calculator.py are intentional or represent a data quality issue in the summary.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Export QueryParam and QueryParams types' clearly and concisely summarizes the primary change of exporting two previously internal TypeScript types.
Linked Issues check ✅ Passed The PR successfully fulfills all coding requirements from issue #437: exports QueryParam and QueryParams types from src/commands/index.ts and re-exports them from the package entry point.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch copilot/export-queryparam-queryparams-types

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
tests/exportedTypes.spec.ts (1)

4-4: Consider adding test coverage for QueryOptions and QueryOptionsBackwardCompatible.

The package entry also exports QueryOptions and QueryOptionsBackwardCompatible types. While these build on QueryParams, adding a simple type usage test for them would ensure complete coverage of all newly exported types.

💡 Optional: Add tests for other exported types
-import type { QueryParam, QueryParams } from '../index';
+import type { QueryParam, QueryParams, QueryOptions, QueryOptionsBackwardCompatible } from '../index';
 
 describe('Exported Types', () => {
     // ... existing tests ...
+
+    test('QueryOptions type can be used', () => {
+        const options: QueryOptions = {
+            params: { name: 'test' },
+            TIMEOUT: 5000
+        };
+        expect(options.params).toBeDefined();
+        expect(options.TIMEOUT).toBe(5000);
+    });
+
+    test('QueryOptionsBackwardCompatible type can be used', () => {
+        const optionsAsNumber: QueryOptionsBackwardCompatible = 5000;
+        const optionsAsObject: QueryOptionsBackwardCompatible = { TIMEOUT: 5000 };
+        expect(optionsAsNumber).toBe(5000);
+        expect(optionsAsObject.TIMEOUT).toBe(5000);
+    });
 });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/exportedTypes.spec.ts` at line 4, Add compile-time tests that import
the exported types QueryOptions and QueryOptionsBackwardCompatible (in
tests/exportedTypes.spec.ts alongside existing QueryParam/QueryParams import)
and declare minimal example values or type assertions using those types (e.g., a
const typed as QueryOptions and one as QueryOptionsBackwardCompatible) to ensure
they are exported and usable; keep the imports as type-only and the tests empty
runtime-wise so they only validate TypeScript type compatibility.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@tests/exportedTypes.spec.ts`:
- Line 4: Add compile-time tests that import the exported types QueryOptions and
QueryOptionsBackwardCompatible (in tests/exportedTypes.spec.ts alongside
existing QueryParam/QueryParams import) and declare minimal example values or
type assertions using those types (e.g., a const typed as QueryOptions and one
as QueryOptionsBackwardCompatible) to ensure they are exported and usable; keep
the imports as type-only and the tests empty runtime-wise so they only validate
TypeScript type compatibility.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 343e2ed and c1379e6.

📒 Files selected for processing (3)
  • index.ts
  • src/commands/index.ts
  • tests/exportedTypes.spec.ts

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Exports the previously-internal QueryParam and QueryParams types so library consumers can construct query parameter objects with type safety via the main package entrypoint.

Changes:

  • Exported QueryParam and QueryParams from src/commands/index.ts.
  • Re-exported QueryParam, QueryParams, QueryOptions, and QueryOptionsBackwardCompatible from the package root index.ts.
  • Added a Jest spec covering usage of the newly exported types.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tests/exportedTypes.spec.ts Adds a regression test ensuring the new exported types can be referenced/used from the public entrypoint.
src/commands/index.ts Makes QueryParam and QueryParams public exports from the commands module.
index.ts Re-exports the query parameter and options types from the package root for consumer access.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.11%. Comparing base (343e2ed) to head (c1379e6).

Additional details and impacted files
@@           Coverage Diff            @@
##             main     #504    +/-   ##
========================================
  Coverage   97.11%   97.11%            
========================================
  Files          27       27            
  Lines        2113     2113            
  Branches      303      124   -179     
========================================
  Hits         2052     2052            
- Misses         60       61     +1     
+ Partials        1        0     -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

export types QueryParam & QueryParams

3 participants