Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Types:

- <code><a href="./src/resources/shared.ts">Apikey</a></code>
- <code><a href="./src/resources/shared.ts">APIKkey</a></code>
- <code><a href="./src/resources/shared.ts">App</a></code>
- <code><a href="./src/resources/shared.ts">Collection</a></code>

Expand All @@ -27,14 +27,14 @@ Methods:

Types:

- <code><a href="./src/resources/collections.ts">Collection</a></code>
- <code><a href="./src/resources/collections.ts">CollectionResponse</a></code>
- <code><a href="./src/resources/collections.ts">CollectionListResponse</a></code>

Methods:

- <code title="post /collections/add">client.collections.<a href="./src/resources/collections.ts">create</a>({ ...params }) -> Collection</code>
- <code title="post /collections/add">client.collections.<a href="./src/resources/collections.ts">create</a>({ ...params }) -> CollectionResponse</code>
- <code title="get /collections/list">client.collections.<a href="./src/resources/collections.ts">list</a>({ ...params }) -> CollectionListResponsesCursorPage</code>
- <code title="get /collections/get/{name}">client.collections.<a href="./src/resources/collections.ts">get</a>(name) -> Collection</code>
- <code title="get /collections/get/{name}">client.collections.<a href="./src/resources/collections.ts">get</a>(name) -> CollectionResponse</code>

# Query

Expand Down
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
CollectionListParams,
CollectionListResponse,
CollectionListResponsesCursorPage,
CollectionResponse,
Collections,
} from './resources/collections';
import {
Expand Down Expand Up @@ -220,7 +221,7 @@ export declare namespace Hyperspell {

export {
Collections as Collections,
type Collection as Collection,
type CollectionResponse as CollectionResponse,
type CollectionListResponse as CollectionListResponse,
CollectionListResponsesCursorPage as CollectionListResponsesCursorPage,
type CollectionCreateParams as CollectionCreateParams,
Expand All @@ -235,7 +236,7 @@ export declare namespace Hyperspell {

export { Auth as Auth, type Token as Token, type AuthUserTokenParams as AuthUserTokenParams };

export type Apikey = API.Apikey;
export type APIKkey = API.APIKkey;
export type App = API.App;
export type Collection = API.Collection;
}
Expand Down
8 changes: 4 additions & 4 deletions src/resources/collections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ 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<Collection> {
create(body: CollectionCreateParams, options?: Core.RequestOptions): Core.APIPromise<CollectionResponse> {
return this._client.post('/collections/add', { body, ...options });
}

Expand Down Expand Up @@ -40,14 +40,14 @@ export class Collections extends APIResource {
/**
* Retrieves a collection by name.
*/
get(name: string, options?: Core.RequestOptions): Core.APIPromise<Collection> {
get(name: string, options?: Core.RequestOptions): Core.APIPromise<CollectionResponse> {
return this._client.get(`/collections/get/${name}`, options);
}
}

export class CollectionListResponsesCursorPage extends CursorPage<CollectionListResponse> {}

export interface Collection {
export interface CollectionResponse {
created_at: string;

name: string;
Expand Down Expand Up @@ -86,7 +86,7 @@ Collections.CollectionListResponsesCursorPage = CollectionListResponsesCursorPag

export declare namespace Collections {
export {
type Collection as Collection,
type CollectionResponse as CollectionResponse,
type CollectionListResponse as CollectionListResponse,
CollectionListResponsesCursorPage as CollectionListResponsesCursorPage,
type CollectionCreateParams as CollectionCreateParams,
Expand Down
2 changes: 1 addition & 1 deletion src/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export { Auth, type Token, type AuthUserTokenParams } from './auth';
export {
CollectionListResponsesCursorPage,
Collections,
type Collection,
type CollectionResponse,
type CollectionListResponse,
type CollectionCreateParams,
type CollectionListParams,
Expand Down
4 changes: 2 additions & 2 deletions src/resources/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as DocumentsAPI from './documents';
/**
* ApiKeys Base Schema.
*/
export interface Apikey {
export interface APIKkey {
app_id: number;

scopes: Array<'all' | 'ingest' | 'query'>;
Expand Down Expand Up @@ -38,7 +38,7 @@ export interface App {

id?: number | null;

api_keys?: Array<Apikey> | null;
api_keys?: Array<APIKkey> | null;

collections?: Array<Collection> | null;

Expand Down