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
41 changes: 0 additions & 41 deletions .github/workflows/create-releases.yml

This file was deleted.

8 changes: 6 additions & 2 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# workflow for re-running publishing to NPM in case it fails for some reason
# you can run this workflow by navigating to https://www.github.com/hyperspell/node-sdk/actions/workflows/publish-npm.yml
# This workflow is triggered when a GitHub release is created.
# It can also be run manually to re-publish to NPM in case it failed for some reason.
# You can run this workflow by navigating to https://www.github.com/hyperspell/node-sdk/actions/workflows/publish-npm.yml
name: Publish NPM
on:
workflow_dispatch:

release:
types: [published]

jobs:
publish:
name: publish
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@ jobs:
run: |
bash ./bin/check-release-environment
env:
STAINLESS_API_KEY: ${{ secrets.STAINLESS_API_KEY }}
NPM_TOKEN: ${{ secrets.HYPERSPELL_NPM_TOKEN || secrets.NPM_TOKEN }}

8 changes: 8 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Shared

Types:

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

# Documents

Types:
Expand Down
4 changes: 0 additions & 4 deletions bin/check-release-environment
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

errors=()

if [ -z "${STAINLESS_API_KEY}" ]; then
errors+=("The STAINLESS_API_KEY secret has not been set. Please contact Stainless for an API key & set it in your organization secrets on GitHub.")
fi

if [ -z "${NPM_TOKEN}" ]; then
errors+=("The HYPERSPELL_NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets")
fi
Expand Down
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import * as Uploads from './uploads';
import * as API from './resources/index';
import { Auth, AuthUserTokenParams, Token } from './resources/auth';
import {
Collection,
CollectionCreateParams,
CollectionListParams,
CollectionListResponse,
Expand Down Expand Up @@ -235,6 +234,10 @@ export declare namespace Hyperspell {
};

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

export type Apikey = API.Apikey;
export type App = API.App;
export type Collection = API.Collection;
}

export { toFile, fileFromPath } from './uploads';
Expand Down
1 change: 1 addition & 0 deletions src/resources/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

export * from './shared';
export { Auth, type Token, type AuthUserTokenParams } from './auth';
export {
CollectionListResponsesCursorPage,
Expand Down
177 changes: 177 additions & 0 deletions src/resources/shared.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import * as DocumentsAPI from './documents';

/**
* ApiKeys Base Schema.
*/
export interface Apikey {
app_id: number;

scopes: Array<'all' | 'ingest' | 'query'>;

secret: string;

id?: number | null;

/**
* Apps Base Schema.
*/
app?: App | null;

created_at?: string;

label?: string | null;

revoked_at?: string | null;
}

/**
* Apps Base Schema.
*/
export interface App {
name: string;

slug: string;

user_id: string;

id?: number | null;

api_keys?: Array<Apikey> | null;

collections?: Array<Collection> | null;

created_at?: string;

integrations?: Array<unknown>;

jwt_secret?: string;

optional_integrations?: Array<unknown> | null;

public_key?: string;

settings?: unknown;
}

export interface Collection {
app_id: number;

name: string;

id?: number | null;

/**
* Apps Base Schema.
*/
app?: App | null;

created_at?: string;

documents?: Array<Collection.Document> | null;

documents_count?: number | null;

owner?: string | null;
}

export namespace Collection {
export interface Document {
collection_id: number;

/**
* Structured representation of the document
*/
data: unknown | Array<unknown>;

/**
* Summary of the document
*/
summary: string;

id?: number | null;

collection?: string;

created_at?: string | null;

events?: Array<Document.Event>;

ingested_at?: string | null;

metadata?: Record<string, unknown>;

/**
* Along with service, uniquely identifies the source document
*/
resource_id?: string;

sections?: Array<Document.Section>;

sections_count?: number | null;

source?: 'generic' | 'slack' | 's3' | 'gmail' | 'notion' | 'google_docs' | 'hubspot';

status?: 'pending' | 'processing' | 'completed' | 'failed';

title?: string | null;

type?:
| 'generic'
| 'markdown'
| 'chat'
| 'email'
| 'transcript'
| 'legal'
| 'website'
| 'image'
| 'pdf'
| 'audio'
| 'spreadsheet'
| 'archive'
| 'book'
| 'video'
| 'code'
| 'calendar'
| 'json'
| 'presentation'
| 'unsupported'
| 'person'
| 'company'
| 'crm_contact';
}

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<unknown>;

embedding_e5_large?: Array<number> | null;

embedding_ts?: string | null;

metadata?: Record<string, unknown>;

scores?: DocumentsAPI.Scores;
}
}
}