From 6060a4f2ef6f7c335db93d84f25298e9ddc607f3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 5 Feb 2025 21:27:39 +0000 Subject: [PATCH] feat(api): api update --- .stats.yml | 2 +- src/resources/query.ts | 8 ++++---- tests/api-resources/query.test.ts | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.stats.yml b/.stats.yml index 56c998df..baec5548 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 10 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-ba6c4db7ea12bd505fe5cfe650ef7372c17dbe083875afea40d5de959dbba9e1.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-e2730102bf18b9b31baab9d5f3a0545acdcaec16f74b2b64831c5a99230ab847.yml diff --git a/src/resources/query.ts b/src/resources/query.ts index 9397ed5f..0e1502f3 100644 --- a/src/resources/query.ts +++ b/src/resources/query.ts @@ -21,14 +21,14 @@ export interface QuerySearchResponse { export interface QuerySearchParams { /** - * Query to run. + * Only query documents in these collections. */ - query: string; + collections: string | Array; /** - * Only query documents in these collections. + * Query to run. */ - collections?: Array; + query: string; /** * Filter the query results. diff --git a/tests/api-resources/query.test.ts b/tests/api-resources/query.test.ts index cad0704a..ec97cca8 100644 --- a/tests/api-resources/query.test.ts +++ b/tests/api-resources/query.test.ts @@ -10,7 +10,7 @@ const client = new Hyperspell({ describe('resource query', () => { test('search: only required params', async () => { - const responsePromise = client.query.search({ query: 'query' }); + const responsePromise = client.query.search({ collections: 'string', query: 'query' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -22,8 +22,8 @@ describe('resource query', () => { test('search: required and optional params', async () => { const response = await client.query.search({ + collections: 'string', query: 'query', - collections: ['string'], filter: { end_date: '2019-12-27T18:11:19.117Z', source: ['generic'],