Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
5a724bc
chore: update SDK settings
stainless-app[bot] Oct 14, 2025
ad426ca
codegen metadata
stainless-app[bot] Oct 14, 2025
00b1c15
chore: update SDK settings
stainless-app[bot] Oct 14, 2025
ba76c1b
feat(api): api update
stainless-app[bot] Oct 14, 2025
7ae061e
feat(api): api update
stainless-app[bot] Oct 15, 2025
35e5675
codegen metadata
stainless-app[bot] Oct 15, 2025
c0a94aa
feat(api): api update
stainless-app[bot] Oct 15, 2025
775857d
chore: configure new SDK language
stainless-app[bot] Oct 15, 2025
431189b
codegen metadata
stainless-app[bot] Oct 15, 2025
0adf6b0
feat(api): manual updates
stainless-app[bot] Oct 15, 2025
449272c
codegen metadata
stainless-app[bot] Oct 15, 2025
ed45521
feat(api): manual updates
stainless-app[bot] Oct 15, 2025
1de1069
chore: configure new SDK language
stainless-app[bot] Oct 15, 2025
a86176a
codegen metadata
stainless-app[bot] Oct 15, 2025
90c79c2
feat(api): api update
stainless-app[bot] Oct 15, 2025
658bc53
feat(api): api update
stainless-app[bot] Oct 15, 2025
dda2e8d
feat(api): api update
stainless-app[bot] Oct 16, 2025
9ead242
feat(api): api update
stainless-app[bot] Oct 16, 2025
fc0ed65
codegen metadata
stainless-app[bot] Oct 17, 2025
a7300c2
codegen metadata
stainless-app[bot] Oct 17, 2025
8f016e7
feat(api): api update
stainless-app[bot] Oct 18, 2025
4cfa52a
codegen metadata
stainless-app[bot] Oct 19, 2025
1930098
codegen metadata
stainless-app[bot] Oct 21, 2025
8f01f66
codegen metadata
stainless-app[bot] Oct 22, 2025
097e169
feat(api): api update
stainless-app[bot] Oct 23, 2025
e098ea4
codegen metadata
stainless-app[bot] Oct 23, 2025
9336ccb
feat(api): manual updates
stainless-app[bot] Oct 23, 2025
e71d085
codegen metadata
stainless-app[bot] Oct 23, 2025
1c4f467
chore: update SDK settings
stainless-app[bot] Oct 23, 2025
0c2676a
codegen metadata
stainless-app[bot] Oct 23, 2025
e3ae36f
feat(api): api update
stainless-app[bot] Oct 23, 2025
ca291ea
feat(api): manual updates
stainless-app[bot] Oct 23, 2025
912fbef
codegen metadata
stainless-app[bot] Oct 23, 2025
0126a8c
chore: update SDK settings
stainless-app[bot] Oct 23, 2025
9040d22
codegen metadata
stainless-app[bot] Oct 23, 2025
536ac09
chore: update SDK settings
stainless-app[bot] Oct 23, 2025
ccc6bf8
feat(api): api update
stainless-app[bot] Oct 24, 2025
a9ee901
feat(api): api update
stainless-app[bot] Oct 24, 2025
c4d7db7
feat(api): api update
stainless-app[bot] Oct 30, 2025
56cda2d
codegen metadata
stainless-app[bot] Oct 31, 2025
5a544ff
codegen metadata
stainless-app[bot] Nov 1, 2025
dc9ac24
feat(api): api update
stainless-app[bot] Nov 3, 2025
a5ae6d9
codegen metadata
stainless-app[bot] Nov 4, 2025
39e42e3
feat(api): api update
stainless-app[bot] Nov 7, 2025
c7637c6
codegen metadata
stainless-app[bot] Nov 7, 2025
01d4868
release: 0.1.0
stainless-app[bot] Nov 7, 2025
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
32 changes: 32 additions & 0 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 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/uselemma/sdk-typescript/actions/workflows/publish-npm.yml
name: Publish NPM
on:
workflow_dispatch:

release:
types: [published]

jobs:
publish:
name: publish
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Install dependencies
run: |
yarn install

- name: Publish to NPM
run: |
bash ./bin/publish-npm
env:
NPM_TOKEN: ${{ secrets.LEMMA_NPM_TOKEN || secrets.NPM_TOKEN }}
22 changes: 22 additions & 0 deletions .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Release Doctor
on:
pull_request:
branches:
- main
workflow_dispatch:

jobs:
release_doctor:
name: release doctor
runs-on: ubuntu-latest
if: github.repository == 'uselemma/sdk-typescript' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')

steps:
- uses: actions/checkout@v4

- name: Check release environment
run: |
bash ./bin/check-release-environment
env:
NPM_TOKEN: ${{ secrets.LEMMA_NPM_TOKEN || secrets.NPM_TOKEN }}

3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.1.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 18
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lemma%2Flemma-584f07ea035720c85ecac56802077189e3ef8e2970d3a7f9ffb75a605df61fef.yml
openapi_spec_hash: 941d7b54bafb4c217116dc8fea329900
config_hash: 9b31b57de762bba601e624c9104ca492
configured_endpoints: 34
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lemma%2Flemma-79b845b81edffab326e7c93caa8e183d4c9161acd384b253373ed25940e8d1a8.yml
openapi_spec_hash: 8e8c78bfe2061e89bee63c5dac6be23e
config_hash: 3ccc0e50f28be581a8cc4501a5758970
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Changelog

## 0.1.0 (2025-11-07)

Full Changelog: [v0.0.1...v0.1.0](https://github.com/uselemma/sdk-typescript/compare/v0.0.1...v0.1.0)

### Features

* **api:** api update ([39e42e3](https://github.com/uselemma/sdk-typescript/commit/39e42e3cfea74703e1b227a82e9c11e749170f73))
* **api:** api update ([dc9ac24](https://github.com/uselemma/sdk-typescript/commit/dc9ac241ffbcfdeae12f5ff384355f2d08dee1b9))
* **api:** api update ([c4d7db7](https://github.com/uselemma/sdk-typescript/commit/c4d7db7dcc6b0a822e9c522948906cc8c23129dd))
* **api:** api update ([a9ee901](https://github.com/uselemma/sdk-typescript/commit/a9ee901901e8e3510d091372eff35c3e8594914c))
* **api:** api update ([ccc6bf8](https://github.com/uselemma/sdk-typescript/commit/ccc6bf818028cfc316e0f2e196473255a8b41901))
* **api:** api update ([e3ae36f](https://github.com/uselemma/sdk-typescript/commit/e3ae36f149da8616ae2bf3f0aa6029554b1fa573))
* **api:** api update ([097e169](https://github.com/uselemma/sdk-typescript/commit/097e1691d1af606de49b96035e6fcec0b4da6653))
* **api:** api update ([8f016e7](https://github.com/uselemma/sdk-typescript/commit/8f016e7b624a8b61946c22c544aaf8632d6f524e))
* **api:** api update ([9ead242](https://github.com/uselemma/sdk-typescript/commit/9ead242afb24c736e027a01d4dc3e55882d45959))
* **api:** api update ([dda2e8d](https://github.com/uselemma/sdk-typescript/commit/dda2e8df85e63753d6a055b3ac780178030880c4))
* **api:** api update ([658bc53](https://github.com/uselemma/sdk-typescript/commit/658bc53090278fbe5c83758fd62ef55acaa45c29))
* **api:** api update ([90c79c2](https://github.com/uselemma/sdk-typescript/commit/90c79c2c7aa8e6c9c1ab67ff67c3e727ccd37f58))
* **api:** api update ([c0a94aa](https://github.com/uselemma/sdk-typescript/commit/c0a94aae772f10b6c6bccf4baaf41006674d4a0c))
* **api:** api update ([7ae061e](https://github.com/uselemma/sdk-typescript/commit/7ae061edf8e8abc13a5df884d208a347cabe698c))
* **api:** api update ([ba76c1b](https://github.com/uselemma/sdk-typescript/commit/ba76c1b97254be6a84deb637770966db9a005309))
* **api:** manual updates ([ca291ea](https://github.com/uselemma/sdk-typescript/commit/ca291ea7ab9e0d778986cfe82ffeb6867490826c))
* **api:** manual updates ([9336ccb](https://github.com/uselemma/sdk-typescript/commit/9336ccb94df5cb1415ac9c6f3962954470c6de20))
* **api:** manual updates ([ed45521](https://github.com/uselemma/sdk-typescript/commit/ed45521203625adcb99c142442ac6b551c31a5cc))
* **api:** manual updates ([0adf6b0](https://github.com/uselemma/sdk-typescript/commit/0adf6b0dbed5213e4de4ac6cbd5202e70836a892))
* **api:** manual updates ([570b183](https://github.com/uselemma/sdk-typescript/commit/570b1839922e7ac9ba3dc50b93f0770f0bc6ce3e))
* **api:** manual updates ([7ca24c5](https://github.com/uselemma/sdk-typescript/commit/7ca24c5d2a4fec9349c8e944d42a80ea833d588a))


### Chores

* configure new SDK language ([1de1069](https://github.com/uselemma/sdk-typescript/commit/1de1069cf2dd27e4bab327c7a0448df6ed4fe370))
* configure new SDK language ([775857d](https://github.com/uselemma/sdk-typescript/commit/775857d571f525812e5f93023daaa896c749d200))
* update SDK settings ([536ac09](https://github.com/uselemma/sdk-typescript/commit/536ac096ad23d239293ae67948331fd16ad30864))
* update SDK settings ([0126a8c](https://github.com/uselemma/sdk-typescript/commit/0126a8cf20e16bf3c86f7dabd1f2ee3d4f15d367))
* update SDK settings ([1c4f467](https://github.com/uselemma/sdk-typescript/commit/1c4f467803036eb9f60a3d996fbf93417ca8d92f))
* update SDK settings ([00b1c15](https://github.com/uselemma/sdk-typescript/commit/00b1c15d7a1b581babf4cce1b1da4f0c0aabbc3f))
* update SDK settings ([5a724bc](https://github.com/uselemma/sdk-typescript/commit/5a724bc82ce67530b1b908b4b6c44485f3d0af33))
24 changes: 19 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,25 +42,25 @@ If you’d like to use the repository from source, you can either install from g
To install via git:

```sh
$ npm install git+ssh://git@github.com:stainless-sdks/lemma-typescript.git
$ npm install git+ssh://git@github.com:uselemma/sdk-typescript.git
```

Alternatively, to link a local copy of the repo:

```sh
# Clone
$ git clone https://www.github.com/stainless-sdks/lemma-typescript
$ cd lemma-typescript
$ git clone https://www.github.com/uselemma/sdk-typescript
$ cd sdk-typescript

# With yarn
$ yarn link
$ cd ../my-package
$ yarn link lemma
$ yarn link lemma-node

# With pnpm
$ pnpm link --global
$ cd ../my-package
$ pnpm link -—global lemma
$ pnpm link -—global lemma-node
```

## Running tests
Expand Down Expand Up @@ -91,3 +91,17 @@ To format and fix all lint issues automatically:
```sh
$ yarn fix
```

## Publishing and releases

Changes made to this repository via the automated release PR pipeline should publish to npm automatically. If
the changes aren't made through the automated pipeline, you may want to make releases manually.

### Publish with a GitHub workflow

You can release to package managers by using [the `Publish NPM` GitHub action](https://www.github.com/uselemma/sdk-typescript/actions/workflows/publish-npm.yml). This requires a setup organization or repository secret to be set up.

### Publish manually

If you need to manually release a package, you can run the `bin/publish-npm` script with an `NPM_TOKEN` set on
the environment.
64 changes: 32 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Lemma TypeScript API Library

[![NPM version](<https://img.shields.io/npm/v/lemma.svg?label=npm%20(stable)>)](https://npmjs.org/package/lemma) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/lemma)
[![NPM version](<https://img.shields.io/npm/v/lemma-node.svg?label=npm%20(stable)>)](https://npmjs.org/package/lemma-node) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/lemma-node)

This library provides convenient access to the Lemma REST API from server-side TypeScript or JavaScript.

Expand All @@ -11,25 +11,24 @@ It is generated with [Stainless](https://www.stainless.com/).
## Installation

```sh
npm install git+ssh://git@github.com:stainless-sdks/lemma-typescript.git
npm install lemma-node
```

> [!NOTE]
> Once this package is [published to npm](https://www.stainless.com/docs/guides/publish), this will become: `npm install lemma`

## Usage

The full API of this library can be found in [api.md](api.md).

<!-- prettier-ignore -->
```js
import Lemma from 'lemma';
import Lemma from 'lemma-node';

const client = new Lemma({
apiKey: process.env['LEMMA_API_KEY'], // This is the default and can be omitted
bearerToken: process.env['LEMMA_BEARER_TOKEN'], // This is the default and can be omitted
});

const datasets = await client.datasets.list();
const project = await client.projects.create({ name: 'name' });

console.log(project.id);
```

### Request & Response types
Expand All @@ -38,13 +37,14 @@ This library includes TypeScript definitions for all request params and response

<!-- prettier-ignore -->
```ts
import Lemma from 'lemma';
import Lemma from 'lemma-node';

const client = new Lemma({
apiKey: process.env['LEMMA_API_KEY'], // This is the default and can be omitted
bearerToken: process.env['LEMMA_BEARER_TOKEN'], // This is the default and can be omitted
});

const datasets: Lemma.DatasetListResponse = await client.datasets.list();
const params: Lemma.ProjectCreateParams = { name: 'name' };
const project: Lemma.Project = await client.projects.create(params);
```

Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
Expand All @@ -60,22 +60,22 @@ Request parameters that correspond to file uploads can be passed in many differe

```ts
import fs from 'fs';
import Lemma, { toFile } from 'lemma';
import Lemma, { toFile } from 'lemma-node';

const client = new Lemma();

// If you have access to Node `fs` we recommend using `fs.createReadStream()`:
await client.datasets.generateSchema({ seed_file: fs.createReadStream('/path/to/file') });
await client.datasets.bulkUpload('dataset_id', { file: fs.createReadStream('/path/to/file') });

// Or if you have the web `File` API you can pass a `File` instance:
await client.datasets.generateSchema({ seed_file: new File(['my bytes'], 'file') });
await client.datasets.bulkUpload('dataset_id', { file: new File(['my bytes'], 'file') });

// You can also pass a `fetch` `Response`:
await client.datasets.generateSchema({ seed_file: await fetch('https://somesite/file') });
await client.datasets.bulkUpload('dataset_id', { file: await fetch('https://somesite/file') });

// Finally, if none of the above are convenient, you can use our `toFile` helper:
await client.datasets.generateSchema({ seed_file: await toFile(Buffer.from('my bytes'), 'file') });
await client.datasets.generateSchema({ seed_file: await toFile(new Uint8Array([0, 1, 2]), 'file') });
await client.datasets.bulkUpload('dataset_id', { file: await toFile(Buffer.from('my bytes'), 'file') });
await client.datasets.bulkUpload('dataset_id', { file: await toFile(new Uint8Array([0, 1, 2]), 'file') });
```

## Handling errors
Expand All @@ -86,7 +86,7 @@ a subclass of `APIError` will be thrown:

<!-- prettier-ignore -->
```ts
const datasets = await client.datasets.list().catch(async (err) => {
const project = await client.projects.create({ name: 'name' }).catch(async (err) => {
if (err instanceof Lemma.APIError) {
console.log(err.status); // 400
console.log(err.name); // BadRequestError
Expand Down Expand Up @@ -126,7 +126,7 @@ const client = new Lemma({
});

// Or, configure per-request:
await client.datasets.list({
await client.projects.create({ name: 'name' }, {
maxRetries: 5,
});
```
Expand All @@ -143,7 +143,7 @@ const client = new Lemma({
});

// Override per-request:
await client.datasets.list({
await client.projects.create({ name: 'name' }, {
timeout: 5 * 1000,
});
```
Expand All @@ -166,13 +166,13 @@ Unlike `.asResponse()` this method consumes the body, returning once it is parse
```ts
const client = new Lemma();

const response = await client.datasets.list().asResponse();
const response = await client.projects.create({ name: 'name' }).asResponse();
console.log(response.headers.get('X-My-Header'));
console.log(response.statusText); // access the underlying Response object

const { data: datasets, response: raw } = await client.datasets.list().withResponse();
const { data: project, response: raw } = await client.projects.create({ name: 'name' }).withResponse();
console.log(raw.headers.get('X-My-Header'));
console.log(datasets);
console.log(project.id);
```

### Logging
Expand All @@ -189,7 +189,7 @@ The log level can be configured in two ways:
2. Using the `logLevel` client option (overrides the environment variable if set)

```ts
import Lemma from 'lemma';
import Lemma from 'lemma-node';

const client = new Lemma({
logLevel: 'debug', // Show all log messages
Expand Down Expand Up @@ -217,7 +217,7 @@ When providing a custom logger, the `logLevel` option still controls which messa
below the configured level will not be sent to your logger.

```ts
import Lemma from 'lemma';
import Lemma from 'lemma-node';
import pino from 'pino';

const logger = pino();
Expand Down Expand Up @@ -252,7 +252,7 @@ parameter. This library doesn't validate at runtime that the request matches the
send will be sent as-is.

```ts
client.datasets.list({
client.projects.create({
// ...
// @ts-expect-error baz is not yet public
baz: 'undocumented option',
Expand Down Expand Up @@ -286,7 +286,7 @@ globalThis.fetch = fetch;
Or pass it to the client:

```ts
import Lemma from 'lemma';
import Lemma from 'lemma-node';
import fetch from 'my-fetch';

const client = new Lemma({ fetch });
Expand All @@ -297,7 +297,7 @@ const client = new Lemma({ fetch });
If you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)

```ts
import Lemma from 'lemma';
import Lemma from 'lemma-node';

const client = new Lemma({
fetchOptions: {
Expand All @@ -314,7 +314,7 @@ options to requests:
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg" align="top" width="18" height="21"> **Node** <sup>[[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]</sup>

```ts
import Lemma from 'lemma';
import Lemma from 'lemma-node';
import * as undici from 'undici';

const proxyAgent = new undici.ProxyAgent('http://localhost:8888');
Expand All @@ -328,7 +328,7 @@ const client = new Lemma({
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg" align="top" width="18" height="21"> **Bun** <sup>[[docs](https://bun.sh/guides/http/proxy)]</sup>

```ts
import Lemma from 'lemma';
import Lemma from 'lemma-node';

const client = new Lemma({
fetchOptions: {
Expand All @@ -340,7 +340,7 @@ const client = new Lemma({
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg" align="top" width="18" height="21"> **Deno** <sup>[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]</sup>

```ts
import Lemma from 'npm:lemma';
import Lemma from 'npm:lemma-node';

const httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });
const client = new Lemma({
Expand All @@ -362,7 +362,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

We are keen for your feedback; please open an [issue](https://www.github.com/stainless-sdks/lemma-typescript/issues) with questions, bugs, or suggestions.
We are keen for your feedback; please open an [issue](https://www.github.com/uselemma/sdk-typescript/issues) with questions, bugs, or suggestions.

## Requirements

Expand Down
Loading
Loading