Skip to content

[CDX-390]: update VarioationsMap type#440

Merged
esezen merged 8 commits intomasterfrom
cdx-390-client-js-update-type-definitions-for-variationsmap
Mar 24, 2026
Merged

[CDX-390]: update VarioationsMap type#440
esezen merged 8 commits intomasterfrom
cdx-390-client-js-update-type-definitions-for-variationsmap

Conversation

@niizom
Copy link
Contributor

@niizom niizom commented Mar 20, 2026

This PR adds a new filter_by field for VariationsMap interface.

group_by and values fields are no longer valid and need to be updated

@niizom niizom requested review from esezen and jjl014 as code owners March 20, 2026 13:31
Copilot AI review requested due to automatic review settings March 20, 2026 13:31
constructor-claude-bedrock[bot]

This comment was marked as outdated.

Copy link
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

Updates the public VariationsMap TypeScript type to include a new filter_by field, and adjusts tsd fixtures for search/autocomplete responses accordingly.

Changes:

  • Added FilterNode / FilterBy types and introduced filter_by on VariationsMap.
  • Updated search.test-d.ts and autocomplete.test-d.ts fixtures to include filter_by.
  • Minor formatting changes in ResultSources and VariationsMap type declarations.

Reviewed changes

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

File Description
src/types/index.d.ts Adds filter_by typing (and supporting types) to VariationsMap; includes minor formatting edits.
src/types/tests/search.test-d.ts Updates the variations_map fixture to include filter_by.
src/types/tests/autocomplete.test-d.ts Updates the variations_map fixture to include filter_by.

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

field: 'data.VariationId',
},
],
filter_by: {},
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

The new filter_by field is only set to {} here, which doesn’t actually validate the intended filter_by shape (nested and/or/not with field/value). Consider adding at least one non-empty example so tsd will catch regressions in the FilterBy/FilterNode typing.

Suggested change
filter_by: {},
filter_by: {
and: [
{
field: 'data.availability',
value: 'in stock',
},
{
or: [
{
field: 'data.quantity',
value: '>=1',
},
{
field: 'data.backorderable',
value: 'true',
},
],
},
{
not: {
field: 'data.discontinued',
value: 'true',
},
},
],
},

Copilot uses AI. Check for mistakes.
field: 'data.VariationId',
},
],
filter_by: {},
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

The new filter_by field is only set to {} here, which doesn’t validate the FilterBy/FilterNode structure. Add a non-empty filter_by example (e.g. a nested and/or with field and value) so this test will fail if the filter_by typing regresses.

Suggested change
filter_by: {},
filter_by: {
and: [
{
field: 'data.availability',
value: 'in stock',
},
{
or: [
{
field: 'data.quantity',
value: '10',
},
],
},
],
},

Copilot uses AI. Check for mistakes.
@niizom niizom force-pushed the cdx-390-client-js-update-type-definitions-for-variationsmap branch from bbc4e74 to 3adb534 Compare March 20, 2026 13:36
constructor-claude-bedrock[bot]

This comment was marked as outdated.

Copy link
Contributor

@esezen esezen left a comment

Choose a reason for hiding this comment

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

@niizom thanks for working on this! I left some comments. Do you mind taking a look a the AI reviews as well?

constructor-claude-bedrock[bot]

This comment was marked as outdated.

constructor-claude-bedrock[bot]

This comment was marked as outdated.

@niizom niizom force-pushed the cdx-390-client-js-update-type-definitions-for-variationsmap branch from 157c1f1 to 15db7a8 Compare March 20, 2026 15:55
constructor-claude-bedrock[bot]

This comment was marked as outdated.

constructor-claude-bedrock[bot]

This comment was marked as outdated.

constructor-claude-bedrock[bot]

This comment was marked as outdated.

Copy link

@constructor-claude-bedrock constructor-claude-bedrock bot left a comment

Choose a reason for hiding this comment

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

Code Review

This PR updates VariationsMap with a new filter_by field, makes group_by optional, expands the Aggregation type, and properly types the response variations_map field — the changes are well-structured overall but have a few issues worth addressing.

Inline comments: 6 discussions added

Overall Assessment: ⚠️ Needs Work

@esezen esezen merged commit e47612a into master Mar 24, 2026
17 of 18 checks passed
@esezen esezen deleted the cdx-390-client-js-update-type-definitions-for-variationsmap branch March 24, 2026 14:04
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.

3 participants