From ec832be086586fdd36081ef92c8d05711b7aef96 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 7 May 2025 05:06:04 +0000 Subject: [PATCH 1/9] chore(ci): bump node version for release workflows --- .github/workflows/ci.yml | 2 +- .github/workflows/publish-npm.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b63c3fc0..ac9a8e7f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,7 +72,7 @@ jobs: - name: Set up Node uses: actions/setup-node@v4 with: - node-version: '18' + node-version: '20' - name: Bootstrap run: ./scripts/bootstrap diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 00dc207b..0735849e 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Node uses: actions/setup-node@v3 with: - node-version: '18' + node-version: '20' - name: Install dependencies run: | From 35758b5425045930db8766fe1fabc2cc80039766 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 7 May 2025 05:09:14 +0000 Subject: [PATCH 2/9] docs: add examples to tsdocs --- src/resources/documents.ts | 35 +++++++++++++++++++ src/resources/integrations/google-calendar.ts | 6 ++++ src/resources/integrations/integrations.ts | 7 ++++ src/resources/integrations/web-crawler.ts | 7 ++++ src/resources/query.ts | 7 ++++ 5 files changed, 62 insertions(+) diff --git a/src/resources/documents.ts b/src/resources/documents.ts index 00717add..c5280aa8 100644 --- a/src/resources/documents.ts +++ b/src/resources/documents.ts @@ -9,6 +9,14 @@ export class Documents extends APIResource { /** * This endpoint allows you to paginate through all documents in the index. You can * filter the documents by title, date, metadata, etc. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const documentListResponse of client.documents.list()) { + * // ... + * } + * ``` */ list( query?: DocumentListParams, @@ -31,6 +39,13 @@ export class Documents extends APIResource { * Adds an arbitrary document to the index. This can be any text, email, call * transcript, etc. The document will be processed and made available for querying * once the processing is complete. + * + * @example + * ```ts + * const documentStatus = await client.documents.add({ + * text: 'text', + * }); + * ``` */ add(body: DocumentAddParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post('/documents/add', { body, ...options }); @@ -40,6 +55,13 @@ export class Documents extends APIResource { * Adds an arbitrary document to the index. This can be any text, email, call * transcript, etc. The document will be processed and made available for querying * once the processing is complete. + * + * @example + * ```ts + * const documentStatus = await client.documents.addURL({ + * url: 'url', + * }); + * ``` */ addURL(body: DocumentAddURLParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post('/documents/scrape', { body, ...options }); @@ -47,6 +69,11 @@ export class Documents extends APIResource { /** * Retrieves a document by ID, including its collection name and sections. + * + * @example + * ```ts + * const document = await client.documents.get(0); + * ``` */ get(documentId: number, options?: Core.RequestOptions): Core.APIPromise { return this._client.get(`/documents/get/${documentId}`, options); @@ -57,6 +84,14 @@ export class Documents extends APIResource { * will be processed in the background and the document will be available for * querying once the processing is complete. You can use the `document_id` to query * the document later, and check the status of the document. + * + * @example + * ```ts + * const documentStatus = await client.documents.upload({ + * collection: 'collection', + * file: fs.createReadStream('path/to/file'), + * }); + * ``` */ upload(body: DocumentUploadParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post('/documents/upload', Core.multipartFormRequestOptions({ body, ...options })); diff --git a/src/resources/integrations/google-calendar.ts b/src/resources/integrations/google-calendar.ts index a9bf2e90..2f551c0e 100644 --- a/src/resources/integrations/google-calendar.ts +++ b/src/resources/integrations/google-calendar.ts @@ -7,6 +7,12 @@ export class GoogleCalendar extends APIResource { /** * List available calendars for a user. This can be used to ie. populate a dropdown * for the user to select a calendar. + * + * @example + * ```ts + * const calendar = + * await client.integrations.googleCalendar.list(); + * ``` */ list(options?: Core.RequestOptions): Core.APIPromise { return this._client.get('/integrations/google_calendar/list', options); diff --git a/src/resources/integrations/integrations.ts b/src/resources/integrations/integrations.ts index 3b99142b..d81e94ca 100644 --- a/src/resources/integrations/integrations.ts +++ b/src/resources/integrations/integrations.ts @@ -14,6 +14,13 @@ export class Integrations extends APIResource { /** * Revokes Hyperspell's access the given provider and deletes all stored * credentials. It does not delete any cached or synced data. + * + * @example + * ```ts + * const response = await client.integrations.revoke( + * 'provider', + * ); + * ``` */ revoke(provider: string, options?: Core.RequestOptions): Core.APIPromise { return this._client.get(`/integrations/${provider}/revoke`, options); diff --git a/src/resources/integrations/web-crawler.ts b/src/resources/integrations/web-crawler.ts index 1907e9e3..250e2134 100644 --- a/src/resources/integrations/web-crawler.ts +++ b/src/resources/integrations/web-crawler.ts @@ -6,6 +6,13 @@ import * as Core from '../../core'; export class WebCrawler extends APIResource { /** * Recursively crawl a website to make it available for indexed search. + * + * @example + * ```ts + * const response = await client.integrations.webCrawler.index( + * { url: 'url' }, + * ); + * ``` */ index( query: WebCrawlerIndexParams, diff --git a/src/resources/query.ts b/src/resources/query.ts index c69741ab..3ba0cad3 100644 --- a/src/resources/query.ts +++ b/src/resources/query.ts @@ -6,6 +6,13 @@ import * as Core from '../core'; export class Query extends APIResource { /** * Retrieves documents matching the query. + * + * @example + * ```ts + * const response = await client.query.search({ + * query: 'query', + * }); + * ``` */ search(body: QuerySearchParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post('/query', { body, ...options }); From b41112960489ea077a9656f80f4436fbbae006b6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 13 May 2025 20:43:22 +0000 Subject: [PATCH 3/9] feat(api): update via SDK Studio --- .stats.yml | 2 +- README.md | 4 ++-- src/index.ts | 6 +++--- tests/index.test.ts | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index 29aa71ec..f06db57c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 14 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-099cd79547bb459ecbd2442e4f93fc17f4f9a2dead413f06a0b39afb6541db07.yml openapi_spec_hash: 81afcb8056acd1af983d70f817911738 -config_hash: 85255d5a167e2f4bcf8a9314d653ec01 +config_hash: a39dfe90372d06d735dfb3d27b30409f diff --git a/README.md b/README.md index 3bef76f7..b53c2f60 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ The full API of this library can be found in [api.md](api.md). import Hyperspell from 'hyperspell'; const client = new Hyperspell({ - apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted + apiKey: process.env['HYPERSPELL_TOKEN'], // This is the default and can be omitted }); async function main() { @@ -44,7 +44,7 @@ This library includes TypeScript definitions for all request params and response import Hyperspell from 'hyperspell'; const client = new Hyperspell({ - apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted + apiKey: process.env['HYPERSPELL_TOKEN'], // This is the default and can be omitted }); async function main() { diff --git a/src/index.ts b/src/index.ts index 79982778..598da26f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -33,7 +33,7 @@ import { IntegrationRevokeResponse, Integrations } from './resources/integration export interface ClientOptions { /** - * API key used for authentication with the Hyperspell API + * Either an API Key or User Token to authenticate a specific user of your app. */ apiKey?: string | null | undefined; @@ -105,7 +105,7 @@ export class Hyperspell extends Core.APIClient { /** * API Client for interfacing with the Hyperspell API. * - * @param {string | null | undefined} [opts.apiKey=process.env['HYPERSPELL_API_KEY'] ?? null] + * @param {string | null | undefined} [opts.apiKey=process.env['HYPERSPELL_TOKEN'] ?? null] * @param {string} [opts.baseURL=process.env['HYPERSPELL_BASE_URL'] ?? https://api.hyperspell.com] - Override the default base URL for the API. * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out. * @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections. @@ -116,7 +116,7 @@ export class Hyperspell extends Core.APIClient { */ constructor({ baseURL = Core.readEnv('HYPERSPELL_BASE_URL'), - apiKey = Core.readEnv('HYPERSPELL_API_KEY') ?? null, + apiKey = Core.readEnv('HYPERSPELL_TOKEN') ?? null, ...opts }: ClientOptions = {}) { const options: ClientOptions = { diff --git a/tests/index.test.ts b/tests/index.test.ts index c4b17f7f..6f824ef0 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -198,14 +198,14 @@ describe('instantiate client', () => { test('with environment variable arguments', () => { // set options via env var - process.env['HYPERSPELL_API_KEY'] = 'My API Key'; + process.env['HYPERSPELL_TOKEN'] = 'My API Key'; const client = new Hyperspell(); expect(client.apiKey).toBe('My API Key'); }); test('with overridden environment variable arguments', () => { // set options via env var - process.env['HYPERSPELL_API_KEY'] = 'another My API Key'; + process.env['HYPERSPELL_TOKEN'] = 'another My API Key'; const client = new Hyperspell({ apiKey: 'My API Key' }); expect(client.apiKey).toBe('My API Key'); }); From dcc155132a0d130ff62a64de0847b612e7e477fc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 13 May 2025 23:28:24 +0000 Subject: [PATCH 4/9] feat(api): api update --- .stats.yml | 4 ++-- src/resources/documents.ts | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index f06db57c..426a7d19 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 14 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-099cd79547bb459ecbd2442e4f93fc17f4f9a2dead413f06a0b39afb6541db07.yml -openapi_spec_hash: 81afcb8056acd1af983d70f817911738 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-f07c2593d45160174921c9c5bff09de2687f8cdcf157bde08d5e3b0427431f92.yml +openapi_spec_hash: 64b83a6e3202e4fa676e26db3fcd8e78 config_hash: a39dfe90372d06d735dfb3d27b30409f diff --git a/src/resources/documents.ts b/src/resources/documents.ts index c5280aa8..c3634a41 100644 --- a/src/resources/documents.ts +++ b/src/resources/documents.ts @@ -207,9 +207,22 @@ export namespace Document { } export interface DocumentStatus { + /** + * @deprecated Deprecated: refer to documents by source and resource_id instead + */ id: number; - collection: string; + resource_id: string; + + source: + | 'collections' + | 'notion' + | 'slack' + | 'hubspot' + | 'google_calendar' + | 'reddit' + | 'web_crawler' + | 'box'; status: 'pending' | 'processing' | 'completed' | 'failed'; } From ace1ff15d2f1efffaf828ee8e48e4e06fb09091e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 15 May 2025 13:28:40 +0000 Subject: [PATCH 5/9] feat(api): api update --- .stats.yml | 4 ++-- src/resources/documents.ts | 9 ++++++--- src/resources/integrations/web-crawler.ts | 3 ++- src/resources/query.ts | 23 +++++++++++++++++++++-- tests/api-resources/query.test.ts | 2 ++ 5 files changed, 33 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index 426a7d19..9bcac01c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 14 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-f07c2593d45160174921c9c5bff09de2687f8cdcf157bde08d5e3b0427431f92.yml -openapi_spec_hash: 64b83a6e3202e4fa676e26db3fcd8e78 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-41cc2c9708dd44636519f09907b8945c8d7a8c0d2f9586f4ff6b54dc87529afd.yml +openapi_spec_hash: 13e20d1a1759b5a513d2441732a0851e config_hash: a39dfe90372d06d735dfb3d27b30409f diff --git a/src/resources/documents.ts b/src/resources/documents.ts index c3634a41..5baf9fc5 100644 --- a/src/resources/documents.ts +++ b/src/resources/documents.ts @@ -142,7 +142,8 @@ export interface Document { | 'google_calendar' | 'reddit' | 'web_crawler' - | 'box'; + | 'box' + | 'google_drive'; status?: 'pending' | 'processing' | 'completed' | 'failed'; @@ -222,7 +223,8 @@ export interface DocumentStatus { | 'google_calendar' | 'reddit' | 'web_crawler' - | 'box'; + | 'box' + | 'google_drive'; status: 'pending' | 'processing' | 'completed' | 'failed'; } @@ -267,7 +269,8 @@ export interface DocumentListResponse { | 'google_calendar' | 'reddit' | 'web_crawler' - | 'box'; + | 'box' + | 'google_drive'; status?: 'pending' | 'processing' | 'completed' | 'failed'; diff --git a/src/resources/integrations/web-crawler.ts b/src/resources/integrations/web-crawler.ts index 250e2134..65c985cf 100644 --- a/src/resources/integrations/web-crawler.ts +++ b/src/resources/integrations/web-crawler.ts @@ -33,7 +33,8 @@ export interface WebCrawlerIndexResponse { | 'google_calendar' | 'reddit' | 'web_crawler' - | 'box'; + | 'box' + | 'google_drive'; status: 'pending' | 'processing' | 'completed' | 'failed'; } diff --git a/src/resources/query.ts b/src/resources/query.ts index 3ba0cad3..bde49a25 100644 --- a/src/resources/query.ts +++ b/src/resources/query.ts @@ -46,7 +46,8 @@ export namespace QuerySearchResponse { | 'google_calendar' | 'reddit' | 'web_crawler' - | 'box'; + | 'box' + | 'google_drive'; metadata?: Document.Metadata; @@ -100,7 +101,15 @@ export interface QuerySearchParams { * Only query documents from these sources. */ sources?: Array< - 'collections' | 'notion' | 'slack' | 'hubspot' | 'google_calendar' | 'reddit' | 'web_crawler' | 'box' + | 'collections' + | 'notion' + | 'slack' + | 'hubspot' + | 'google_calendar' + | 'reddit' + | 'web_crawler' + | 'box' + | 'google_drive' >; } @@ -135,6 +144,11 @@ export namespace QuerySearchParams { */ google_calendar?: Filter.GoogleCalendar; + /** + * Search options for Google Drive + */ + google_drive?: unknown; + /** * Search options for Notion */ @@ -268,6 +282,11 @@ export namespace QuerySearchParams { */ google_calendar?: Options.GoogleCalendar; + /** + * Search options for Google Drive + */ + google_drive?: unknown; + /** * Search options for Notion */ diff --git a/tests/api-resources/query.test.ts b/tests/api-resources/query.test.ts index 4b3f5340..b0bf084a 100644 --- a/tests/api-resources/query.test.ts +++ b/tests/api-resources/query.test.ts @@ -30,6 +30,7 @@ describe('resource query', () => { box: {}, collections: { collections: ['string'] }, google_calendar: { calendar_id: 'calendar_id' }, + google_drive: {}, notion: { notion_page_ids: ['string'] }, reddit: { period: 'hour', sort: 'relevance', subreddit: 'subreddit' }, slack: { channels: ['string'] }, @@ -42,6 +43,7 @@ describe('resource query', () => { box: {}, collections: { collections: ['string'] }, google_calendar: { calendar_id: 'calendar_id' }, + google_drive: {}, notion: { notion_page_ids: ['string'] }, reddit: { period: 'hour', sort: 'relevance', subreddit: 'subreddit' }, slack: { channels: ['string'] }, From 66e2a3d1d316adea94ccf9ebf6658b81b0e0a7f3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 22 May 2025 02:37:17 +0000 Subject: [PATCH 6/9] chore(docs): grammar improvements --- SECURITY.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index 4b274355..8c498208 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -16,11 +16,11 @@ before making any information public. ## Reporting Non-SDK Related Security Issues If you encounter security issues that are not directly related to SDKs but pertain to the services -or products provided by Hyperspell please follow the respective company's security reporting guidelines. +or products provided by Hyperspell, please follow the respective company's security reporting guidelines. ### Hyperspell Terms and Policies -Please contact hello@hyperspell.com for any questions or concerns regarding security of our services. +Please contact hello@hyperspell.com for any questions or concerns regarding the security of our services. --- From 97abf798eb472aa7ad7c471651b149358385d6d1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 26 May 2025 15:28:26 +0000 Subject: [PATCH 7/9] feat(api): api update --- .stats.yml | 6 +- README.md | 16 +- api.md | 7 - src/index.ts | 10 - src/resources/auth.ts | 26 ++- src/resources/collections.ts | 47 +---- src/resources/documents.ts | 265 ++---------------------- src/resources/index.ts | 5 - src/resources/query.ts | 30 +-- tests/api-resources/collections.test.ts | 33 --- tests/api-resources/documents.test.ts | 36 +--- tests/api-resources/query.test.ts | 4 +- 12 files changed, 60 insertions(+), 425 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9bcac01c..72ffb0ba 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 14 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-41cc2c9708dd44636519f09907b8945c8d7a8c0d2f9586f4ff6b54dc87529afd.yml -openapi_spec_hash: 13e20d1a1759b5a513d2441732a0851e +configured_endpoints: 10 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-3798b2043988c1dba908d62df73c76dc771f2cda8a401ca34960c3303cfceaa2.yml +openapi_spec_hash: 1b2e464ea074f544ccd927283c992cef config_hash: a39dfe90372d06d735dfb3d27b30409f diff --git a/README.md b/README.md index b53c2f60..fb5323ee 100644 --- a/README.md +++ b/README.md @@ -74,23 +74,17 @@ import Hyperspell, { toFile } from 'hyperspell'; const client = new Hyperspell(); // If you have access to Node `fs` we recommend using `fs.createReadStream()`: -await client.documents.upload({ collection: 'collection', file: fs.createReadStream('/path/to/file') }); +await client.documents.upload({ file: fs.createReadStream('/path/to/file') }); // Or if you have the web `File` API you can pass a `File` instance: -await client.documents.upload({ collection: 'collection', file: new File(['my bytes'], 'file') }); +await client.documents.upload({ file: new File(['my bytes'], 'file') }); // You can also pass a `fetch` `Response`: -await client.documents.upload({ collection: 'collection', file: await fetch('https://somesite/file') }); +await client.documents.upload({ file: await fetch('https://somesite/file') }); // Finally, if none of the above are convenient, you can use our `toFile` helper: -await client.documents.upload({ - collection: 'collection', - file: await toFile(Buffer.from('my bytes'), 'file'), -}); -await client.documents.upload({ - collection: 'collection', - file: await toFile(new Uint8Array([0, 1, 2]), 'file'), -}); +await client.documents.upload({ file: await toFile(Buffer.from('my bytes'), 'file') }); +await client.documents.upload({ file: await toFile(new Uint8Array([0, 1, 2]), 'file') }); ``` ## Handling errors diff --git a/api.md b/api.md index 226968d2..332d28e4 100644 --- a/api.md +++ b/api.md @@ -32,31 +32,24 @@ Methods: Types: -- Document - DocumentStatus - DocumentListResponse -- DocumentGetResponse Methods: - client.documents.list({ ...params }) -> DocumentListResponsesCursorPage - client.documents.add({ ...params }) -> DocumentStatus -- client.documents.addURL({ ...params }) -> DocumentStatus -- client.documents.get(documentId) -> unknown - client.documents.upload({ ...params }) -> DocumentStatus # Collections Types: -- Collection - CollectionListResponse Methods: -- client.collections.create({ ...params }) -> Collection - client.collections.list({ ...params }) -> CollectionListResponsesCursorPage -- client.collections.get(name) -> Collection # Query diff --git a/src/index.ts b/src/index.ts index 598da26f..a6662e9f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -9,18 +9,13 @@ import * as Uploads from './uploads'; import * as API from './resources/index'; import { Auth, AuthMeResponse, AuthUserTokenParams, Token } from './resources/auth'; import { - Collection, - CollectionCreateParams, CollectionListParams, CollectionListResponse, CollectionListResponsesCursorPage, Collections, } from './resources/collections'; import { - Document, DocumentAddParams, - DocumentAddURLParams, - DocumentGetResponse, DocumentListParams, DocumentListResponse, DocumentListResponsesCursorPage, @@ -213,23 +208,18 @@ export declare namespace Hyperspell { export { Documents as Documents, - type Document as Document, type DocumentStatus as DocumentStatus, type DocumentListResponse as DocumentListResponse, - type DocumentGetResponse as DocumentGetResponse, DocumentListResponsesCursorPage as DocumentListResponsesCursorPage, type DocumentListParams as DocumentListParams, type DocumentAddParams as DocumentAddParams, - type DocumentAddURLParams as DocumentAddURLParams, type DocumentUploadParams as DocumentUploadParams, }; export { Collections as Collections, - type Collection as Collection, type CollectionListResponse as CollectionListResponse, CollectionListResponsesCursorPage as CollectionListResponsesCursorPage, - type CollectionCreateParams as CollectionCreateParams, type CollectionListParams as CollectionListParams, }; diff --git a/src/resources/auth.ts b/src/resources/auth.ts index 08b85c0d..41d70cb7 100644 --- a/src/resources/auth.ts +++ b/src/resources/auth.ts @@ -12,7 +12,7 @@ export class Auth extends APIResource { } /** - * Use this endpoing to create a user token for a specific user. This token can be + * Use this endpoint to create a user token for a specific user. This token can be * safely passed to your user-facing front-end. */ userToken(body: AuthUserTokenParams, options?: Core.RequestOptions): Core.APIPromise { @@ -40,12 +40,32 @@ export interface AuthMeResponse { /** * All integrations available for the app */ - available_integrations: Array; + available_integrations: Array< + | 'collections' + | 'notion' + | 'slack' + | 'hubspot' + | 'google_calendar' + | 'reddit' + | 'web_crawler' + | 'box' + | 'google_drive' + >; /** * All integrations installed for the user */ - installed_integrations: Array; + installed_integrations: Array< + | 'collections' + | 'notion' + | 'slack' + | 'hubspot' + | 'google_calendar' + | 'reddit' + | 'web_crawler' + | 'box' + | 'google_drive' + >; /** * The expiration time of the user token used to make the request diff --git a/src/resources/collections.ts b/src/resources/collections.ts index 10c517ac..49ee40eb 100644 --- a/src/resources/collections.ts +++ b/src/resources/collections.ts @@ -10,13 +10,6 @@ export class Collections extends APIResource { * This endpoint allows you to paginate through all documents in the index. You can * filter the documents by title, date, metadata, etc. */ - create(body: CollectionCreateParams, options?: Core.RequestOptions): Core.APIPromise { - return this._client.post('/collections/add', { body, ...options }); - } - - /** - * Lists all collections the user has access to. - */ list( query?: CollectionListParams, options?: Core.RequestOptions, @@ -36,48 +29,14 @@ export class Collections extends APIResource { ...options, }); } - - /** - * Retrieves a collection by name. - */ - get(name: string, options?: Core.RequestOptions): Core.APIPromise { - return this._client.get(`/collections/get/${name}`, options); - } } export class CollectionListResponsesCursorPage extends CursorPage {} -export interface Collection { - created_at: string; - - name: string; - - owner: string | null; -} - export interface CollectionListResponse { - name: string; - - id?: number | null; - - created_at?: string; - - documents_count?: number | null; - - owner?: string | null; -} + collection: string | null; -export interface CollectionCreateParams { - /** - * The name of the collection. - */ - name: string; - - /** - * The owner of the collection. If the request is made using a user token, this - * will be set to the user ID. - */ - owner?: string | null; + document_count: number; } export interface CollectionListParams extends CursorPageParams {} @@ -86,10 +45,8 @@ Collections.CollectionListResponsesCursorPage = CollectionListResponsesCursorPag export declare namespace Collections { export { - type Collection as Collection, type CollectionListResponse as CollectionListResponse, CollectionListResponsesCursorPage as CollectionListResponsesCursorPage, - type CollectionCreateParams as CollectionCreateParams, type CollectionListParams as CollectionListParams, }; } diff --git a/src/resources/documents.ts b/src/resources/documents.ts index 5baf9fc5..08eb8da7 100644 --- a/src/resources/documents.ts +++ b/src/resources/documents.ts @@ -51,34 +51,6 @@ export class Documents extends APIResource { return this._client.post('/documents/add', { body, ...options }); } - /** - * Adds an arbitrary document to the index. This can be any text, email, call - * transcript, etc. The document will be processed and made available for querying - * once the processing is complete. - * - * @example - * ```ts - * const documentStatus = await client.documents.addURL({ - * url: 'url', - * }); - * ``` - */ - addURL(body: DocumentAddURLParams, options?: Core.RequestOptions): Core.APIPromise { - return this._client.post('/documents/scrape', { body, ...options }); - } - - /** - * Retrieves a document by ID, including its collection name and sections. - * - * @example - * ```ts - * const document = await client.documents.get(0); - * ``` - */ - get(documentId: number, options?: Core.RequestOptions): Core.APIPromise { - return this._client.get(`/documents/get/${documentId}`, options); - } - /** * This endpoint will upload a file to the index and return a document ID. The file * will be processed in the background and the document will be available for @@ -88,7 +60,6 @@ export class Documents extends APIResource { * @example * ```ts * const documentStatus = await client.documents.upload({ - * collection: 'collection', * file: fs.createReadStream('path/to/file'), * }); * ``` @@ -100,113 +71,6 @@ export class Documents extends APIResource { export class DocumentListResponsesCursorPage extends CursorPage {} -export interface Document { - /** - * Summary of the document - */ - data: Array; - - /** - * Summary of the document - */ - summary: string; - - id?: number | null; - - collection?: string; - - collection_id?: number | null; - - created_at?: string | null; - - events?: Array; - - ingested_at?: string | null; - - metadata?: Record; - - /** - * Along with service, uniquely identifies the source document - */ - resource_id?: string; - - sections?: Array; - - sections_count?: number | null; - - source?: - | 'collections' - | 'notion' - | 'slack' - | 'hubspot' - | 'google_calendar' - | 'reddit' - | 'web_crawler' - | 'box' - | 'google_drive'; - - status?: 'pending' | 'processing' | 'completed' | 'failed'; - - title?: string | null; - - type?: - | 'generic' - | 'memory' - | 'markdown' - | 'chat' - | 'email' - | 'transcript' - | 'legal' - | 'website' - | 'image' - | 'pdf' - | 'audio' - | 'spreadsheet' - | 'archive' - | 'book' - | 'video' - | 'code' - | 'calendar' - | 'json' - | 'presentation' - | 'unsupported' - | 'person' - | 'company' - | 'crm_contact' - | 'event'; -} - -export namespace Document { - export interface Event { - message: string; - - type: 'error' | 'warning' | 'info'; - - time?: string; - } - - export interface Section { - document_id: number; - - /** - * Summary of the section - */ - text: string; - - id?: number | null; - - content?: string | null; - - elements?: Array; - - embedding_e5_large?: Array | null; - - embedding_ts?: string | null; - - metadata?: Record; - } -} - export interface DocumentStatus { /** * @deprecated Deprecated: refer to documents by source and resource_id instead @@ -230,38 +94,9 @@ export interface DocumentStatus { } export interface DocumentListResponse { - /** - * Summary of the document - */ - data: Array; - - /** - * Summary of the document - */ - summary: string; - - id?: number | null; - - collection?: string; - - created_at?: string | null; - - events?: Array; - - ingested_at?: string | null; - - metadata?: Record; - - /** - * Along with service, uniquely identifies the source document - */ - resource_id?: string; - - sections?: Array; - - sections_count?: number | null; + resource_id: string; - source?: + source: | 'collections' | 'notion' | 'slack' @@ -272,71 +107,30 @@ export interface DocumentListResponse { | 'box' | 'google_drive'; - status?: 'pending' | 'processing' | 'completed' | 'failed'; - - title?: string | null; + metadata?: DocumentListResponse.Metadata; - type?: - | 'generic' - | 'memory' - | 'markdown' - | 'chat' - | 'email' - | 'transcript' - | 'legal' - | 'website' - | 'image' - | 'pdf' - | 'audio' - | 'spreadsheet' - | 'archive' - | 'book' - | 'video' - | 'code' - | 'calendar' - | 'json' - | 'presentation' - | 'unsupported' - | 'person' - | 'company' - | 'crm_contact' - | 'event'; + /** + * The relevance of the resource to the query + */ + score?: number | null; } export namespace DocumentListResponse { - export interface Event { - message: string; - - type: 'error' | 'warning' | 'info'; - - time?: string; - } - - export interface Section { - document_id: number; - - /** - * Summary of the section - */ - text: string; + export interface Metadata { + created_at?: string | null; - id?: number | null; + last_modified?: string | null; - content?: string | null; + url?: string | null; - elements?: Array; - - embedding_e5_large?: Array | null; - - embedding_ts?: string | null; - - metadata?: Record; + [k: string]: unknown; } } -export type DocumentGetResponse = unknown; - export interface DocumentListParams extends CursorPageParams { + /** + * Filter documents by collection. + */ collection?: string | null; } @@ -347,9 +141,7 @@ export interface DocumentAddParams { text: string; /** - * Name of the collection to add the document to. If the collection does not exist, - * it will be created. If not given, the document will be added to the user's - * default collection. + * The collection to add the document to for easier retrieval. */ collection?: string | null; @@ -367,44 +159,27 @@ export interface DocumentAddParams { title?: string | null; } -export interface DocumentAddURLParams { - /** - * Source URL of the document. - */ - url: string; - - /** - * Name of the collection to add the document to. If the collection does not exist, - * it will be created. If not given, the document will be added to the user's - * default collection. - */ - collection?: string | null; -} - export interface DocumentUploadParams { /** - * The collection to add the document to. + * The file to ingest. */ - collection: string; + file: Core.Uploadable; /** - * The file to ingest. + * The collection to add the document to. */ - file: Core.Uploadable; + collection?: string | null; } Documents.DocumentListResponsesCursorPage = DocumentListResponsesCursorPage; export declare namespace Documents { export { - type Document as Document, type DocumentStatus as DocumentStatus, type DocumentListResponse as DocumentListResponse, - type DocumentGetResponse as DocumentGetResponse, DocumentListResponsesCursorPage as DocumentListResponsesCursorPage, type DocumentListParams as DocumentListParams, type DocumentAddParams as DocumentAddParams, - type DocumentAddURLParams as DocumentAddURLParams, type DocumentUploadParams as DocumentUploadParams, }; } diff --git a/src/resources/index.ts b/src/resources/index.ts index 7bb2c171..9216bc73 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -4,21 +4,16 @@ export { Auth, type Token, type AuthMeResponse, type AuthUserTokenParams } from export { CollectionListResponsesCursorPage, Collections, - type Collection, type CollectionListResponse, - type CollectionCreateParams, type CollectionListParams, } from './collections'; export { DocumentListResponsesCursorPage, Documents, - type Document, type DocumentStatus, type DocumentListResponse, - type DocumentGetResponse, type DocumentListParams, type DocumentAddParams, - type DocumentAddURLParams, type DocumentUploadParams, } from './documents'; export { Integrations, type IntegrationRevokeResponse } from './integrations/integrations'; diff --git a/src/resources/query.ts b/src/resources/query.ts index bde49a25..69734581 100644 --- a/src/resources/query.ts +++ b/src/resources/query.ts @@ -135,9 +135,9 @@ export namespace QuerySearchParams { box?: unknown; /** - * Search options for Collections + * Search options for Collection */ - collections?: Filter.Collections; + collections?: unknown; /** * Search options for Google Calendar @@ -171,17 +171,6 @@ export namespace QuerySearchParams { } export namespace Filter { - /** - * Search options for Collections - */ - export interface Collections { - /** - * List of collections to search. If not provided, only the user's default - * collection will be searched. - */ - collections?: Array | null; - } - /** * Search options for Google Calendar */ @@ -273,9 +262,9 @@ export namespace QuerySearchParams { box?: unknown; /** - * Search options for Collections + * Search options for Collection */ - collections?: Options.Collections; + collections?: unknown; /** * Search options for Google Calendar @@ -309,17 +298,6 @@ export namespace QuerySearchParams { } export namespace Options { - /** - * Search options for Collections - */ - export interface Collections { - /** - * List of collections to search. If not provided, only the user's default - * collection will be searched. - */ - collections?: Array | null; - } - /** * Search options for Google Calendar */ diff --git a/tests/api-resources/collections.test.ts b/tests/api-resources/collections.test.ts index 482457fb..14e4da83 100644 --- a/tests/api-resources/collections.test.ts +++ b/tests/api-resources/collections.test.ts @@ -9,21 +9,6 @@ const client = new Hyperspell({ }); describe('resource collections', () => { - test('create: only required params', async () => { - const responsePromise = client.collections.create({ name: 'name' }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('create: required and optional params', async () => { - const response = await client.collections.create({ name: 'name', owner: 'owner' }); - }); - test('list', async () => { const responsePromise = client.collections.list(); const rawResponse = await responsePromise.asResponse(); @@ -48,22 +33,4 @@ describe('resource collections', () => { client.collections.list({ cursor: 'cursor', size: 0 }, { path: '/_stainless_unknown_path' }), ).rejects.toThrow(Hyperspell.NotFoundError); }); - - test('get', async () => { - const responsePromise = client.collections.get('name'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(client.collections.get('name', { path: '/_stainless_unknown_path' })).rejects.toThrow( - Hyperspell.NotFoundError, - ); - }); }); diff --git a/tests/api-resources/documents.test.ts b/tests/api-resources/documents.test.ts index b41bc570..f6a2f0b0 100644 --- a/tests/api-resources/documents.test.ts +++ b/tests/api-resources/documents.test.ts @@ -57,42 +57,8 @@ describe('resource documents', () => { }); }); - test('addURL: only required params', async () => { - const responsePromise = client.documents.addURL({ url: 'url' }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('addURL: required and optional params', async () => { - const response = await client.documents.addURL({ url: 'url', collection: 'collection' }); - }); - - test('get', async () => { - const responsePromise = client.documents.get(0); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(client.documents.get(0, { path: '/_stainless_unknown_path' })).rejects.toThrow( - Hyperspell.NotFoundError, - ); - }); - test('upload: only required params', async () => { const responsePromise = client.documents.upload({ - collection: 'collection', file: await toFile(Buffer.from('# my file contents'), 'README.md'), }); const rawResponse = await responsePromise.asResponse(); @@ -106,8 +72,8 @@ describe('resource documents', () => { test('upload: required and optional params', async () => { const response = await client.documents.upload({ - collection: 'collection', file: await toFile(Buffer.from('# my file contents'), 'README.md'), + collection: 'collection', }); }); }); diff --git a/tests/api-resources/query.test.ts b/tests/api-resources/query.test.ts index b0bf084a..86c9945c 100644 --- a/tests/api-resources/query.test.ts +++ b/tests/api-resources/query.test.ts @@ -28,7 +28,7 @@ describe('resource query', () => { after: '2019-12-27T18:11:19.117Z', before: '2019-12-27T18:11:19.117Z', box: {}, - collections: { collections: ['string'] }, + collections: {}, google_calendar: { calendar_id: 'calendar_id' }, google_drive: {}, notion: { notion_page_ids: ['string'] }, @@ -41,7 +41,7 @@ describe('resource query', () => { after: '2019-12-27T18:11:19.117Z', before: '2019-12-27T18:11:19.117Z', box: {}, - collections: { collections: ['string'] }, + collections: {}, google_calendar: { calendar_id: 'calendar_id' }, google_drive: {}, notion: { notion_page_ids: ['string'] }, From b0c556a79a7c11b5f277f8b9f56a22f8aa591ca5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 26 May 2025 16:28:26 +0000 Subject: [PATCH 8/9] feat(api): api update --- .stats.yml | 4 +- src/resources/auth.ts | 80 +++++++++++++++++++-- src/resources/collections.ts | 5 +- src/resources/documents.ts | 84 +++++++++++++++++++++-- src/resources/integrations/web-crawler.ts | 42 +++++++++++- src/resources/query.ts | 82 ++++++++++++++++++++-- 6 files changed, 275 insertions(+), 22 deletions(-) diff --git a/.stats.yml b/.stats.yml index 72ffb0ba..fd6cf3f6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 10 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-3798b2043988c1dba908d62df73c76dc771f2cda8a401ca34960c3303cfceaa2.yml -openapi_spec_hash: 1b2e464ea074f544ccd927283c992cef +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-287b83fd66b657b044f4ab280ab0e72a2ed72c0da50e4a7d09ce98123982262f.yml +openapi_spec_hash: fcef51b5cf5e602a2d8025546e27e24a config_hash: a39dfe90372d06d735dfb3d27b30409f diff --git a/src/resources/auth.ts b/src/resources/auth.ts index 41d70cb7..d59da48b 100644 --- a/src/resources/auth.ts +++ b/src/resources/auth.ts @@ -42,14 +42,50 @@ export interface AuthMeResponse { */ available_integrations: Array< | 'collections' + | 'web_crawler' | 'notion' | 'slack' - | 'hubspot' | 'google_calendar' | 'reddit' - | 'web_crawler' | 'box' | 'google_drive' + | 'airtable' + | 'algolia' + | 'amplitude' + | 'asana' + | 'ashby' + | 'bamboohr' + | 'basecamp' + | 'bubbles' + | 'calendly' + | 'confluence' + | 'clickup' + | 'datadog' + | 'deel' + | 'discord' + | 'dropbox' + | 'exa' + | 'facebook' + | 'front' + | 'github' + | 'gitlab' + | 'google_docs' + | 'google_mail' + | 'google_sheet' + | 'hubspot' + | 'jira' + | 'linear' + | 'microsoft_teams' + | 'mixpanel' + | 'monday' + | 'outlook' + | 'perplexity' + | 'rippling' + | 'salesforce' + | 'segment' + | 'todoist' + | 'twitter' + | 'zoom' >; /** @@ -57,14 +93,50 @@ export interface AuthMeResponse { */ installed_integrations: Array< | 'collections' + | 'web_crawler' | 'notion' | 'slack' - | 'hubspot' | 'google_calendar' | 'reddit' - | 'web_crawler' | 'box' | 'google_drive' + | 'airtable' + | 'algolia' + | 'amplitude' + | 'asana' + | 'ashby' + | 'bamboohr' + | 'basecamp' + | 'bubbles' + | 'calendly' + | 'confluence' + | 'clickup' + | 'datadog' + | 'deel' + | 'discord' + | 'dropbox' + | 'exa' + | 'facebook' + | 'front' + | 'github' + | 'gitlab' + | 'google_docs' + | 'google_mail' + | 'google_sheet' + | 'hubspot' + | 'jira' + | 'linear' + | 'microsoft_teams' + | 'mixpanel' + | 'monday' + | 'outlook' + | 'perplexity' + | 'rippling' + | 'salesforce' + | 'segment' + | 'todoist' + | 'twitter' + | 'zoom' >; /** diff --git a/src/resources/collections.ts b/src/resources/collections.ts index 49ee40eb..335b1a82 100644 --- a/src/resources/collections.ts +++ b/src/resources/collections.ts @@ -7,8 +7,9 @@ import { CursorPage, type CursorPageParams } from '../pagination'; export class Collections extends APIResource { /** - * This endpoint allows you to paginate through all documents in the index. You can - * filter the documents by title, date, metadata, etc. + * This endpoint lists all collections, and how many documents are in each + * collection. All documents that do not have a collection assigned are in the + * `null` collection. */ list( query?: CollectionListParams, diff --git a/src/resources/documents.ts b/src/resources/documents.ts index 08eb8da7..b54338a5 100644 --- a/src/resources/documents.ts +++ b/src/resources/documents.ts @@ -81,14 +81,50 @@ export interface DocumentStatus { source: | 'collections' + | 'web_crawler' | 'notion' | 'slack' - | 'hubspot' | 'google_calendar' | 'reddit' - | 'web_crawler' | 'box' - | 'google_drive'; + | 'google_drive' + | 'airtable' + | 'algolia' + | 'amplitude' + | 'asana' + | 'ashby' + | 'bamboohr' + | 'basecamp' + | 'bubbles' + | 'calendly' + | 'confluence' + | 'clickup' + | 'datadog' + | 'deel' + | 'discord' + | 'dropbox' + | 'exa' + | 'facebook' + | 'front' + | 'github' + | 'gitlab' + | 'google_docs' + | 'google_mail' + | 'google_sheet' + | 'hubspot' + | 'jira' + | 'linear' + | 'microsoft_teams' + | 'mixpanel' + | 'monday' + | 'outlook' + | 'perplexity' + | 'rippling' + | 'salesforce' + | 'segment' + | 'todoist' + | 'twitter' + | 'zoom'; status: 'pending' | 'processing' | 'completed' | 'failed'; } @@ -98,14 +134,50 @@ export interface DocumentListResponse { source: | 'collections' + | 'web_crawler' | 'notion' | 'slack' - | 'hubspot' | 'google_calendar' | 'reddit' - | 'web_crawler' | 'box' - | 'google_drive'; + | 'google_drive' + | 'airtable' + | 'algolia' + | 'amplitude' + | 'asana' + | 'ashby' + | 'bamboohr' + | 'basecamp' + | 'bubbles' + | 'calendly' + | 'confluence' + | 'clickup' + | 'datadog' + | 'deel' + | 'discord' + | 'dropbox' + | 'exa' + | 'facebook' + | 'front' + | 'github' + | 'gitlab' + | 'google_docs' + | 'google_mail' + | 'google_sheet' + | 'hubspot' + | 'jira' + | 'linear' + | 'microsoft_teams' + | 'mixpanel' + | 'monday' + | 'outlook' + | 'perplexity' + | 'rippling' + | 'salesforce' + | 'segment' + | 'todoist' + | 'twitter' + | 'zoom'; metadata?: DocumentListResponse.Metadata; diff --git a/src/resources/integrations/web-crawler.ts b/src/resources/integrations/web-crawler.ts index 65c985cf..2fd54b76 100644 --- a/src/resources/integrations/web-crawler.ts +++ b/src/resources/integrations/web-crawler.ts @@ -27,14 +27,50 @@ export interface WebCrawlerIndexResponse { source: | 'collections' + | 'web_crawler' | 'notion' | 'slack' - | 'hubspot' | 'google_calendar' | 'reddit' - | 'web_crawler' | 'box' - | 'google_drive'; + | 'google_drive' + | 'airtable' + | 'algolia' + | 'amplitude' + | 'asana' + | 'ashby' + | 'bamboohr' + | 'basecamp' + | 'bubbles' + | 'calendly' + | 'confluence' + | 'clickup' + | 'datadog' + | 'deel' + | 'discord' + | 'dropbox' + | 'exa' + | 'facebook' + | 'front' + | 'github' + | 'gitlab' + | 'google_docs' + | 'google_mail' + | 'google_sheet' + | 'hubspot' + | 'jira' + | 'linear' + | 'microsoft_teams' + | 'mixpanel' + | 'monday' + | 'outlook' + | 'perplexity' + | 'rippling' + | 'salesforce' + | 'segment' + | 'todoist' + | 'twitter' + | 'zoom'; status: 'pending' | 'processing' | 'completed' | 'failed'; } diff --git a/src/resources/query.ts b/src/resources/query.ts index 69734581..a61d47ce 100644 --- a/src/resources/query.ts +++ b/src/resources/query.ts @@ -40,14 +40,50 @@ export namespace QuerySearchResponse { source: | 'collections' + | 'web_crawler' | 'notion' | 'slack' - | 'hubspot' | 'google_calendar' | 'reddit' - | 'web_crawler' | 'box' - | 'google_drive'; + | 'google_drive' + | 'airtable' + | 'algolia' + | 'amplitude' + | 'asana' + | 'ashby' + | 'bamboohr' + | 'basecamp' + | 'bubbles' + | 'calendly' + | 'confluence' + | 'clickup' + | 'datadog' + | 'deel' + | 'discord' + | 'dropbox' + | 'exa' + | 'facebook' + | 'front' + | 'github' + | 'gitlab' + | 'google_docs' + | 'google_mail' + | 'google_sheet' + | 'hubspot' + | 'jira' + | 'linear' + | 'microsoft_teams' + | 'mixpanel' + | 'monday' + | 'outlook' + | 'perplexity' + | 'rippling' + | 'salesforce' + | 'segment' + | 'todoist' + | 'twitter' + | 'zoom'; metadata?: Document.Metadata; @@ -102,14 +138,50 @@ export interface QuerySearchParams { */ sources?: Array< | 'collections' + | 'web_crawler' | 'notion' | 'slack' - | 'hubspot' | 'google_calendar' | 'reddit' - | 'web_crawler' | 'box' | 'google_drive' + | 'airtable' + | 'algolia' + | 'amplitude' + | 'asana' + | 'ashby' + | 'bamboohr' + | 'basecamp' + | 'bubbles' + | 'calendly' + | 'confluence' + | 'clickup' + | 'datadog' + | 'deel' + | 'discord' + | 'dropbox' + | 'exa' + | 'facebook' + | 'front' + | 'github' + | 'gitlab' + | 'google_docs' + | 'google_mail' + | 'google_sheet' + | 'hubspot' + | 'jira' + | 'linear' + | 'microsoft_teams' + | 'mixpanel' + | 'monday' + | 'outlook' + | 'perplexity' + | 'rippling' + | 'salesforce' + | 'segment' + | 'todoist' + | 'twitter' + | 'zoom' >; } From 65da760b311b0dc5d25c8f60e07969611282170d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 26 May 2025 16:28:59 +0000 Subject: [PATCH 9/9] release: 0.15.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 102 ++++++++++++++++++++++++++++++++++ package.json | 2 +- src/version.ts | 2 +- 4 files changed, 105 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 727e2bea..f87262aa 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.14.0" + ".": "0.15.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index bffc55ad..8fe6ddb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,107 @@ # Changelog +## 0.15.0 (2025-05-26) + +Full Changelog: [v0.14.0...v0.15.0](https://github.com/hyperspell/node-sdk/compare/v0.14.0...v0.15.0) + +### Features + +* add SKIP_BREW env var to ./scripts/bootstrap ([#32](https://github.com/hyperspell/node-sdk/issues/32)) ([ecdef89](https://github.com/hyperspell/node-sdk/commit/ecdef891f2210522efe31e5120d26ad572432f3b)) +* **api:** api update ([b0c556a](https://github.com/hyperspell/node-sdk/commit/b0c556a79a7c11b5f277f8b9f56a22f8aa591ca5)) +* **api:** api update ([97abf79](https://github.com/hyperspell/node-sdk/commit/97abf798eb472aa7ad7c471651b149358385d6d1)) +* **api:** api update ([ace1ff1](https://github.com/hyperspell/node-sdk/commit/ace1ff15d2f1efffaf828ee8e48e4e06fb09091e)) +* **api:** api update ([dcc1551](https://github.com/hyperspell/node-sdk/commit/dcc155132a0d130ff62a64de0847b612e7e477fc)) +* **api:** api update ([6f9c746](https://github.com/hyperspell/node-sdk/commit/6f9c74687f4e79cf83ed0d5b705064ab0b5d413e)) +* **api:** api update ([d297aa4](https://github.com/hyperspell/node-sdk/commit/d297aa4cbd7b2373713381cbbd8c15f64d240d8c)) +* **api:** api update ([8b34c9c](https://github.com/hyperspell/node-sdk/commit/8b34c9c53094a169859994230d3100dadb68fd92)) +* **api:** api update ([8e96b1d](https://github.com/hyperspell/node-sdk/commit/8e96b1d77f28d18a252a3a3eccaf5f4345a56159)) +* **api:** api update ([0cfb6ba](https://github.com/hyperspell/node-sdk/commit/0cfb6ba9bdac14f4c8c5fd6b6748940aab3c747b)) +* **api:** api update ([7fc15c1](https://github.com/hyperspell/node-sdk/commit/7fc15c1e157998bf4713f7008ad190e10cdb6931)) +* **api:** api update ([a9f4767](https://github.com/hyperspell/node-sdk/commit/a9f47673364b5e8f8b2fcfee54b2c7a22eca9d2b)) +* **api:** api update ([7a2bd69](https://github.com/hyperspell/node-sdk/commit/7a2bd691ceb933053e41ace833524fa7eb03f0fe)) +* **api:** api update ([18e40aa](https://github.com/hyperspell/node-sdk/commit/18e40aa3424efad169f6bb6f84b5e8a4c3b63780)) +* **api:** api update ([e9a6314](https://github.com/hyperspell/node-sdk/commit/e9a631469f5daf849bce2a0d4b3c18580a6ce208)) +* **api:** api update ([f304147](https://github.com/hyperspell/node-sdk/commit/f3041475263292a22094818a67808ce6bc18498f)) +* **api:** api update ([d493a36](https://github.com/hyperspell/node-sdk/commit/d493a36acac1df96fc4d4f0d2e7ed355b812531a)) +* **api:** api update ([#10](https://github.com/hyperspell/node-sdk/issues/10)) ([1ad272d](https://github.com/hyperspell/node-sdk/commit/1ad272d7bb37cdabb3936b78afdd173373b23f7c)) +* **api:** api update ([#11](https://github.com/hyperspell/node-sdk/issues/11)) ([ca3bf92](https://github.com/hyperspell/node-sdk/commit/ca3bf923a154883f28cd3218bd63f5ccd780ad78)) +* **api:** api update ([#12](https://github.com/hyperspell/node-sdk/issues/12)) ([34a173e](https://github.com/hyperspell/node-sdk/commit/34a173e58f1183862b936a8d5f76c6ed0f165fae)) +* **api:** api update ([#16](https://github.com/hyperspell/node-sdk/issues/16)) ([9e6e833](https://github.com/hyperspell/node-sdk/commit/9e6e8330a02da1d106f9e172ac634afc08130bd0)) +* **api:** api update ([#18](https://github.com/hyperspell/node-sdk/issues/18)) ([2cecbfd](https://github.com/hyperspell/node-sdk/commit/2cecbfda356a7588bdbc42f5ef41b0fbab41b553)) +* **api:** api update ([#23](https://github.com/hyperspell/node-sdk/issues/23)) ([c9aaf54](https://github.com/hyperspell/node-sdk/commit/c9aaf54d0505676b9cc6a75af87a9994cca2f5b3)) +* **api:** api update ([#24](https://github.com/hyperspell/node-sdk/issues/24)) ([5326693](https://github.com/hyperspell/node-sdk/commit/53266933ad271b9f2f00b7c7e3607eb91f65b7f4)) +* **api:** api update ([#25](https://github.com/hyperspell/node-sdk/issues/25)) ([fdc83d1](https://github.com/hyperspell/node-sdk/commit/fdc83d13e6e6d4de12378b219a3ed6b790c66466)) +* **api:** api update ([#26](https://github.com/hyperspell/node-sdk/issues/26)) ([eef40b4](https://github.com/hyperspell/node-sdk/commit/eef40b4f33a39ad5a7887669414a4efdd3303f80)) +* **api:** api update ([#42](https://github.com/hyperspell/node-sdk/issues/42)) ([9e25c59](https://github.com/hyperspell/node-sdk/commit/9e25c59176277df1cd2999ed875968d68137f93d)) +* **api:** api update ([#45](https://github.com/hyperspell/node-sdk/issues/45)) ([c3a3155](https://github.com/hyperspell/node-sdk/commit/c3a315587edbcb59c75c382d04139b2b11b6f0a8)) +* **api:** api update ([#5](https://github.com/hyperspell/node-sdk/issues/5)) ([49c1d73](https://github.com/hyperspell/node-sdk/commit/49c1d739eafe4518cffb8e60bc082d4be2144c5f)) +* **api:** api update ([#50](https://github.com/hyperspell/node-sdk/issues/50)) ([83c66fb](https://github.com/hyperspell/node-sdk/commit/83c66fb558a9aa88ddf82db79e32b4d77de40b44)) +* **api:** api update ([#53](https://github.com/hyperspell/node-sdk/issues/53)) ([32b52ca](https://github.com/hyperspell/node-sdk/commit/32b52ca847549a290c5fa607a81798b183fdee0c)) +* **api:** api update ([#54](https://github.com/hyperspell/node-sdk/issues/54)) ([90e3bd2](https://github.com/hyperspell/node-sdk/commit/90e3bd208b5710c52acd2ac01ae40f571f07b499)) +* **api:** api update ([#55](https://github.com/hyperspell/node-sdk/issues/55)) ([6ea3488](https://github.com/hyperspell/node-sdk/commit/6ea348848f1d22e9c9e4dc9bf9f4304d18b7e253)) +* **api:** api update ([#56](https://github.com/hyperspell/node-sdk/issues/56)) ([8206477](https://github.com/hyperspell/node-sdk/commit/8206477f03333625de9885a0856830911e065ff2)) +* **api:** api update ([#7](https://github.com/hyperspell/node-sdk/issues/7)) ([0291c15](https://github.com/hyperspell/node-sdk/commit/0291c15da339ddd03f7b96bfad251becacd21a56)) +* **api:** api update ([#8](https://github.com/hyperspell/node-sdk/issues/8)) ([a78d165](https://github.com/hyperspell/node-sdk/commit/a78d165d4dfb39eddaf3982980a4978aef3cd931)) +* **api:** api update ([#9](https://github.com/hyperspell/node-sdk/issues/9)) ([615224f](https://github.com/hyperspell/node-sdk/commit/615224fea9f9d26c0b4ea6bcb1f4dbebb41310f4)) +* **api:** update via SDK Studio ([b411129](https://github.com/hyperspell/node-sdk/commit/b41112960489ea077a9656f80f4436fbbae006b6)) +* **api:** update via SDK Studio ([d96b74c](https://github.com/hyperspell/node-sdk/commit/d96b74c0b31fc76e5ad3fb2382ad615c505b4b41)) +* **api:** update via SDK Studio ([bbb4650](https://github.com/hyperspell/node-sdk/commit/bbb4650d17f6ec312e2b51bca152881c96577775)) +* **api:** update via SDK Studio ([1fc55d0](https://github.com/hyperspell/node-sdk/commit/1fc55d011194539566ca8ec2f9cf6ff1e7aba952)) +* **api:** update via SDK Studio ([#13](https://github.com/hyperspell/node-sdk/issues/13)) ([924b6b0](https://github.com/hyperspell/node-sdk/commit/924b6b01ae650c00fd8baec3abd3e6927aa46519)) +* **api:** update via SDK Studio ([#14](https://github.com/hyperspell/node-sdk/issues/14)) ([1e4ebfe](https://github.com/hyperspell/node-sdk/commit/1e4ebfeb7e4fc24c9d2bf4267b006c91f96239a6)) +* **api:** update via SDK Studio ([#20](https://github.com/hyperspell/node-sdk/issues/20)) ([4a2c34a](https://github.com/hyperspell/node-sdk/commit/4a2c34a97b3e2131ac1c0f6f392d54962bc50f62)) +* **api:** update via SDK Studio ([#38](https://github.com/hyperspell/node-sdk/issues/38)) ([61373c8](https://github.com/hyperspell/node-sdk/commit/61373c843629c169d69c4dd133d5b3a9899a230f)) +* **api:** update via SDK Studio ([#39](https://github.com/hyperspell/node-sdk/issues/39)) ([a0ce99a](https://github.com/hyperspell/node-sdk/commit/a0ce99aae41fa41ad8bde420f00870ce647ff5d1)) +* **api:** update via SDK Studio ([#40](https://github.com/hyperspell/node-sdk/issues/40)) ([5614b84](https://github.com/hyperspell/node-sdk/commit/5614b84d9d2f34d59ba1b61dc43dd7ce4a143d3a)) +* **api:** update via SDK Studio ([#41](https://github.com/hyperspell/node-sdk/issues/41)) ([6f9da54](https://github.com/hyperspell/node-sdk/commit/6f9da54a9104bbaab340cfb230f4217fdc8ec4ed)) +* **api:** update via SDK Studio ([#43](https://github.com/hyperspell/node-sdk/issues/43)) ([588ad3b](https://github.com/hyperspell/node-sdk/commit/588ad3b6267ca1509e01babedaa2ff89c830bbc0)) +* **client:** accept RFC6838 JSON content types ([#33](https://github.com/hyperspell/node-sdk/issues/33)) ([ca38adc](https://github.com/hyperspell/node-sdk/commit/ca38adc6b3125f68d682462e42f7c79ac0d65da1)) +* **client:** send `X-Stainless-Timeout` header ([#22](https://github.com/hyperspell/node-sdk/issues/22)) ([4ad8147](https://github.com/hyperspell/node-sdk/commit/4ad814769ef6503eb9b5a51c14d1ea3f74c736c5)) + + +### Bug Fixes + +* **api:** improve type resolution when importing as a package ([#51](https://github.com/hyperspell/node-sdk/issues/51)) ([bd6cc31](https://github.com/hyperspell/node-sdk/commit/bd6cc31121c57380fca8088bd569f7c79b93164c)) +* avoid type error in certain environments ([#37](https://github.com/hyperspell/node-sdk/issues/37)) ([42542b9](https://github.com/hyperspell/node-sdk/commit/42542b91e05ae3543112c21eae0c110158b753e5)) +* **client:** fix export map for index exports ([#27](https://github.com/hyperspell/node-sdk/issues/27)) ([5543d8e](https://github.com/hyperspell/node-sdk/commit/5543d8ea3804070de726997e8474deb01318eb68)) +* **client:** send `X-Stainless-Timeout` in seconds ([#48](https://github.com/hyperspell/node-sdk/issues/48)) ([ed30b4c](https://github.com/hyperspell/node-sdk/commit/ed30b4c0c4c8802c1ecc999b8d628ab16b81ce82)) +* **internal:** work around https://github.com/vercel/next.js/issues/76881 ([#47](https://github.com/hyperspell/node-sdk/issues/47)) ([f4a35e1](https://github.com/hyperspell/node-sdk/commit/f4a35e10b5a6fd2ef6a092643a64a0ddbf485c2f)) +* **mcp:** remove unused tools.ts ([#52](https://github.com/hyperspell/node-sdk/issues/52)) ([81d6ccd](https://github.com/hyperspell/node-sdk/commit/81d6ccd257f8a29c226a8885fe5120c721ba2a66)) + + +### Chores + +* **ci:** add timeout thresholds for CI jobs ([b0a9540](https://github.com/hyperspell/node-sdk/commit/b0a95401a7cffc8b4a460926d68943e9f355c925)) +* **ci:** bump node version for release workflows ([ec832be](https://github.com/hyperspell/node-sdk/commit/ec832be086586fdd36081ef92c8d05711b7aef96)) +* **ci:** only use depot for staging repos ([a39159d](https://github.com/hyperspell/node-sdk/commit/a39159da3134e1b5cbd5e47d39b8ce24c0f0d1be)) +* **client:** minor internal fixes ([ad7b9c1](https://github.com/hyperspell/node-sdk/commit/ad7b9c1fe80a8c1e866bcc5fac0172f26b4d8330)) +* configure new SDK language ([6b1ea1e](https://github.com/hyperspell/node-sdk/commit/6b1ea1ee164cf9bad4273005a5ef22096c1a290c)) +* **docs:** add missing deprecation warnings ([32486cc](https://github.com/hyperspell/node-sdk/commit/32486ccb3b493dc7e68f7681c4c1ba5054a9cd63)) +* **docs:** grammar improvements ([66e2a3d](https://github.com/hyperspell/node-sdk/commit/66e2a3d1d316adea94ccf9ebf6658b81b0e0a7f3)) +* **exports:** cleaner resource index imports ([#35](https://github.com/hyperspell/node-sdk/issues/35)) ([641f5b3](https://github.com/hyperspell/node-sdk/commit/641f5b3a2311b4db0c16d4555e6073a502c94226)) +* **exports:** stop using path fallbacks ([#36](https://github.com/hyperspell/node-sdk/issues/36)) ([801d961](https://github.com/hyperspell/node-sdk/commit/801d961baa29194a1ecc3656305297e893fb2bb0)) +* go live ([#1](https://github.com/hyperspell/node-sdk/issues/1)) ([88cabb4](https://github.com/hyperspell/node-sdk/commit/88cabb40b7540aabd038ae209f129e05d0917a4e)) +* **internal:** add aliases for Record and Array ([#49](https://github.com/hyperspell/node-sdk/issues/49)) ([680264c](https://github.com/hyperspell/node-sdk/commit/680264c480dda059684bfcff5637f6402b49a278)) +* **internal:** codegen related update ([c044268](https://github.com/hyperspell/node-sdk/commit/c044268dcbd4cf5be42fa77a28731b5921847aa4)) +* **internal:** codegen related update ([96a6428](https://github.com/hyperspell/node-sdk/commit/96a642805334376da1691482c8de710cb30d8e54)) +* **internal:** codegen related update ([0f48c3c](https://github.com/hyperspell/node-sdk/commit/0f48c3c73e7a5f5bd2f5a21b58d5e42c369b5a7a)) +* **internal:** codegen related update ([7136be0](https://github.com/hyperspell/node-sdk/commit/7136be08b13c920d0255e19aa65135245fbb8ba6)) +* **internal:** codegen related update ([b4aec87](https://github.com/hyperspell/node-sdk/commit/b4aec87aec69128a7a2ff13a1f19a4104d0960f8)) +* **internal:** codegen related update ([#28](https://github.com/hyperspell/node-sdk/issues/28)) ([44c69e8](https://github.com/hyperspell/node-sdk/commit/44c69e887a6e32339a487e28e14e444e68ac32c5)) +* **internal:** codegen related update ([#31](https://github.com/hyperspell/node-sdk/issues/31)) ([2b286c1](https://github.com/hyperspell/node-sdk/commit/2b286c14f6545cfaf65259fabc051c40dbe336e7)) +* **internal:** fix devcontainers setup ([#29](https://github.com/hyperspell/node-sdk/issues/29)) ([26194ce](https://github.com/hyperspell/node-sdk/commit/26194ce3891b4f5e6bc89d13a7e8c85137dfe731)) +* **internal:** reduce CI branch coverage ([230a7e0](https://github.com/hyperspell/node-sdk/commit/230a7e040ced22028266e6caf812724fdd2818e3)) +* **internal:** remove extra empty newlines ([#34](https://github.com/hyperspell/node-sdk/issues/34)) ([3677c0c](https://github.com/hyperspell/node-sdk/commit/3677c0c5673c2f49e7f37072be45aad49f1ee5d6)) +* **internal:** upload builds and expand CI branch coverage ([9c9f933](https://github.com/hyperspell/node-sdk/commit/9c9f933f203a26408ce4b4ef0bedffe5cdce1ad6)) +* update SDK settings ([#3](https://github.com/hyperspell/node-sdk/issues/3)) ([99ef2f5](https://github.com/hyperspell/node-sdk/commit/99ef2f5de368ba55fa92f6678e44b94035f8bc9c)) + + +### Documentation + +* add examples to tsdocs ([35758b5](https://github.com/hyperspell/node-sdk/commit/35758b5425045930db8766fe1fabc2cc80039766)) +* **readme:** fix typo ([b3c1a53](https://github.com/hyperspell/node-sdk/commit/b3c1a539678787c6b7d6d89aa4d32dc2be0b6f87)) +* update URLs from stainlessapi.com to stainless.com ([#30](https://github.com/hyperspell/node-sdk/issues/30)) ([f9c0492](https://github.com/hyperspell/node-sdk/commit/f9c04926d82f1f863e6e111feb3b6e4ab33ff0bf)) + ## 0.14.0 (2025-05-01) Full Changelog: [v0.13.0...v0.14.0](https://github.com/hyperspell/node-sdk/compare/v0.13.0...v0.14.0) diff --git a/package.json b/package.json index 1ebd9891..7622a42b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hyperspell", - "version": "0.14.0", + "version": "0.15.0", "description": "The official TypeScript library for the Hyperspell API", "author": "Hyperspell ", "types": "dist/index.d.ts", diff --git a/src/version.ts b/src/version.ts index e2b0672c..b67001ee 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.14.0'; // x-release-please-version +export const VERSION = '0.15.0'; // x-release-please-version