The Node SDK browse types diverge from the JavaScript SDK:
-
Node BrowseParameters is missing filterMatchTypes?: Record<string, 'all' | 'any' | 'none'>, which exists in JS IBrowseParameters.
-
Node VariationsMap differs from the JS VariationsMap:
group_by is required in Node but optional in JS.
- JS supports
filter_by, which is missing in Node.
- Node only supports
first | min | max | all aggregations.
- JS additionally supports
count | field_count | value_count.
- JS
value_count entries support a value: string | number | boolean field.
-
Node GetBrowseResultsResponse differs from the JS GetBrowseResultsResponse:
- Node makes
request and response optional and wraps them in Partial<>; JS requires both and uses complete response data types.
- Node makes
result_id optional; JS requires it.
- Node response collections are partial:
result_sources: Partial<ResultSources>
facets: Partial<Facet>[]
groups: Partial<Group>[]
results: Partial<BrowseResultData>[]
sort_options: Partial<SortOption>[]
features: Partial<Feature>[]
collection: Partial<Collection>
- The JS type makes those collections complete, while
collection is optional.
- JS additionally exposes optional
related_searches and related_browse_pages.
- Node requires
BrowseResultData.variations and variations_map; JS makes both optional and uses VariationsMapResponse for variations_map.
-
The nested Node BrowseRequestType also differs from the JS BrowseRequestType: Node requires fields such as filter_match_types, filters, and query, while JS makes filter_match_types, filters, and query optional and includes facet_name.
This prevents sharing browse models between server and client without type assertions. It would be great to align them, thanks!
🤖 I used a clanker to write this but have verified myself that it's all correct
The Node SDK browse types diverge from the JavaScript SDK:
Node
BrowseParametersis missingfilterMatchTypes?: Record<string, 'all' | 'any' | 'none'>, which exists in JSIBrowseParameters.Node
VariationsMapdiffers from the JSVariationsMap:group_byis required in Node but optional in JS.filter_by, which is missing in Node.first | min | max | allaggregations.count | field_count | value_count.value_countentries support avalue: string | number | booleanfield.Node
GetBrowseResultsResponsediffers from the JSGetBrowseResultsResponse:requestandresponseoptional and wraps them inPartial<>; JS requires both and uses complete response data types.result_idoptional; JS requires it.result_sources: Partial<ResultSources>facets: Partial<Facet>[]groups: Partial<Group>[]results: Partial<BrowseResultData>[]sort_options: Partial<SortOption>[]features: Partial<Feature>[]collection: Partial<Collection>collectionis optional.related_searchesandrelated_browse_pages.BrowseResultData.variationsandvariations_map; JS makes both optional and usesVariationsMapResponseforvariations_map.The nested Node
BrowseRequestTypealso differs from the JSBrowseRequestType: Node requires fields such asfilter_match_types,filters, andquery, while JS makesfilter_match_types,filters, andqueryoptional and includesfacet_name.This prevents sharing browse models between server and client without type assertions. It would be great to align them, thanks!