Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Oct 4, 2024
1 parent 65949f8 commit 483c186
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 2
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/find-ai%2Ffind-ai-703a90257c6ec20e6b67cbb97b6699e96ffef05e62249c4d98bd8fb5b197617d.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/find-ai%2Ffind-ai-f1e4b85be4f9018b4c912ee9907f0d1b78c9cbc338257edc23c784e3e4c86331.yml
41 changes: 14 additions & 27 deletions src/resources/searches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,30 +49,17 @@ export namespace SearchRetrieveResponse {

name: string;

photo_url: string;

reason: string;

short_description: string;

slug: string;

company?: SearchRetrieveResponseItem.Company;

/**
* Returned only for a company.
*/
company_size?: string;

/**
* Returned only for a person.
*/
inferred_email?: string;
company?: string;

criteria_and_reasons?: Array<SearchRetrieveResponseItem.CriteriaAndReason>;

/**
* Returned only for a company.
*/
locations?: Array<string>;
domain?: string;

/**
* Returned only for a person.
Expand All @@ -81,21 +68,21 @@ export namespace SearchRetrieveResponse {
}

export namespace SearchRetrieveResponseItem {
export interface Company {
export interface CriteriaAndReason {
/**
* Returned only for a person.
* Match criteria
*/
name: string;
criteria?: string;

/**
* Returned only for a person.
* Whether it's a match
*/
slug: string;
match?: boolean;

/**
* Returned only for a person.
* Reason for the match
*/
website: string;
reason?: string;
}
}
}
Expand All @@ -114,12 +101,12 @@ export interface SearchCreateParams {
/**
* The mode of the search. Valid values are 'exact' or 'best'.
*/
result_mode?: string;
result_mode?: 'exact' | 'best';

/**
* The scope of the search. Valid values are 'people' or 'companies'.
* The scope of the search. Valid values are 'person' or 'company'.
*/
scope?: string;
scope?: 'person' | 'company';
}

export namespace Searches {
Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/searches.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('resource searches', () => {
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
await expect(
client.searches.create(
{ max_matches: 0, query: 'query', result_mode: 'result_mode', scope: 'scope' },
{ max_matches: 0, query: 'query', result_mode: 'exact', scope: 'person' },
{ path: '/_stainless_unknown_path' },
),
).rejects.toThrow(FindAI.NotFoundError);
Expand Down

0 comments on commit 483c186

Please sign in to comment.