fix(Search, Typescript): Allow creating GSearchRequest without 'q' (but requiring 'filters')#777
Conversation
…ut requiring 'filters')
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #777 +/- ##
=======================================
Coverage 95.79% 95.79%
=======================================
Files 86 86
Lines 1759 1759
Branches 294 294
=======================================
Hits 1685 1685
Misses 73 73
Partials 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| // @ts-expect-error `filters` should require at least one element | ||
| const requireOneFilter: query.GSearchRequest = { | ||
| filters: [], | ||
| }; | ||
| expect(requireOneFilter).toBeDefined(); |
There was a problem hiding this comment.
I don't understand what this is supposed to be testing. When is requireOneFilter expected to be undefined? Is this to produce a typescript error if GSearchRequest is changed in a way that's incompatible with having an empty filters array?
There was a problem hiding this comment.
Yes, this is only a Typescript assertion, the // @ts-expect-error is ensuring that filters: [] is not acceptable.
The expect(requireOneFilter).toBeDefined() is to avoid the unused variable error.
There was a problem hiding this comment.
Ohhhh, I see now, thanks!
🤖 I have created a release *beep* *boop* --- ## [6.3.0](v6.2.0...v6.3.0) (2026-06-02) ### Features * **Auth:** Adds `next` exports for auth.identities ([#767](#767)) ([92c02f8](92c02f8)) * Adds remaining `next` export for `transfer` and `auth.developers` ([#770](#770)) ([1f05298](1f05298)) * **Auth:** adds `next` exports to Developers resources ([#769](#769)) ([8376d22](8376d22)) * **Compute:** Adds `next` exports to Compute resources ([#760](#760)) ([ab6b2ab](ab6b2ab)) * **Developers:** Add support for Globus Auth Developer Resource API (https://docs.globus.org/api/auth/reference/#clients_and_scopes_api) ([#698](#698)) ([9181bc2](9181bc2)) * **Flows:** Adds `next` exports to Flows resources ([#759](#759)) ([6686ec1](6686ec1)) * **Groups:** Adds `next` exports to Groups resources ([#757](#757)) ([89c16c3](89c16c3)) * provides implementation for allowing `next` signatures with GCS ([#772](#772)) ([52863ec](52863ec)) * **Search:** adds (Search Index) Task-related methods ([#780](#780)) ([a176bff](a176bff)) * **Search:** Adds `next` exports to Search resources ([#756](#756)) ([ae9d4a2](ae9d4a2)) * **Timers:** Adds `next` exports to Timers resources ([#758](#758)) ([d4a7773](d4a7773)) * **Transfer:** adds 'next' export for Stream Access Points ([#764](#764)) ([8a8429d](8a8429d)) * **Transfer:** adds 'next' export for Task and Task Submission ([#765](#765)) ([1444707](1444707)) * **Transfer:** Adds 'next' export to transfer.fileOperations ([#762](#762)) ([848eb37](848eb37)) * **Transfer:** Adds 'next' exports to collection bookmarks, endpoints, and endpoint search ([#763](#763)) ([366d354](366d354)) * **Transfer:** Adds `transfer.v2.bookmarks` integration ([#835](#835)) ([36d33f3](36d33f3)) ### Bug Fixes * **Auth, Identities:** Update the 'next' return type key name for ([78c6781](78c6781)) * **Flows:** update service export paths ([#848](#848)) ([c6fcbf9](c6fcbf9)) * Move token-related methods in auth to an separate file to avoid circular references in `src/services/shared.ts` ([#768](#768)) ([78c6781](78c6781)) * **Search, Typescript:** addresses issues with GFilter and GBucket types ([#779](#779)) ([0feb7d7](0feb7d7)) * **Search, Typescript:** Allow creating GSearchRequest without 'q' (but requiring 'filters') ([#777](#777)) ([79beaba](79beaba)) * **Search:** Updates `query.next` methods to Generics ([#766](#766)) ([e0e7959](e0e7959)) * **Streams:** Ensures `payload` wrapper is not included in Tunnel RPC methods payload processing. ([#721](#721)) ([8eef7eb](8eef7eb)) * **Transfer, Typescript:** Mark `fileOperations.stat` `query` parameter as required. ([#737](#737)) ([c051957](c051957)) * **Transfer:** Updates Transfer API host to transfer.api.globus.org ([#732](#732)) ([2afde47](2afde47)) * **Typescript, Search:** `q_settings`,`advanced` mutual exclusivity ([#820](#820)) ([2af5e30](2af5e30)) * **Typescript, Transfer:** fix marker pagination response ([#807](#807)) ([35f51e3](35f51e3)) * **Typescript,Transfer:** getSuccessfulTransfers return type ([#819](#819)) ([a324049](a324049)) * **Typescript:** fix and export IdentityResponse type ([5fa1dee](5fa1dee)) * **Typescript:** use BaseServiceMethodOptions in ServiceMethodDynamicSegments ([#713](#713)) ([0fb2315](0fb2315)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
https://docs.globus.org/api/search/reference/post_query/#gsearchrequest