Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
ecd0912
feat(client): send `X-Stainless-Timeout` header (#28)
stainless-app[bot] Feb 5, 2025
1518181
fix(client): fix export map for index exports (#30)
stainless-app[bot] Feb 14, 2025
0de15d2
chore(internal): fix devcontainers setup (#31)
stainless-app[bot] Feb 22, 2025
f8ec234
docs: update URLs from stainlessapi.com to stainless.com (#32)
stainless-app[bot] Jun 4, 2025
1db65f9
feat: add SKIP_BREW env var to ./scripts/bootstrap (#34)
stainless-app[bot] Mar 11, 2025
5175743
feat(client): accept RFC6838 JSON content types (#35)
stainless-app[bot] Mar 11, 2025
5b8b92f
chore(internal): remove extra empty newlines (#36)
stainless-app[bot] Mar 14, 2025
e447d3b
chore(exports): cleaner resource index imports (#37)
stainless-app[bot] Mar 20, 2025
f7460de
chore(exports): stop using path fallbacks (#38)
stainless-app[bot] Mar 20, 2025
5be66ff
fix: avoid type error in certain environments (#39)
stainless-app[bot] Mar 22, 2025
861f792
codegen metadata
stainless-app[bot] Mar 27, 2025
d60d321
chore(internal): codegen related update (#40)
stainless-app[bot] Mar 27, 2025
a78fd51
fix(internal): work around https://github.com/vercel/next.js/issues/7…
stainless-app[bot] Mar 28, 2025
6c6d3e1
feat(api): manual updates
stainless-app[bot] Jun 3, 2025
a9ac415
feat(api): manual updates
stainless-app[bot] Jun 3, 2025
d68a8eb
feat(api): manual updates
stainless-app[bot] Jun 3, 2025
4f364c5
feat(api): manual updates
stainless-app[bot] Jun 3, 2025
188e90a
feat(api): manual updates
stainless-app[bot] Jun 4, 2025
0e73167
release: 0.1.0-alpha.4
stainless-app[bot] Jun 4, 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
23 changes: 0 additions & 23 deletions .devcontainer/Dockerfile

This file was deleted.

27 changes: 12 additions & 15 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/debian
{
"name": "Debian",
"build": {
"dockerfile": "Dockerfile"
"name": "Development",
"image": "mcr.microsoft.com/devcontainers/typescript-node:latest",
"features": {
"ghcr.io/devcontainers/features/node:1": {}
},
"postCreateCommand": "yarn install",
"customizations": {
"vscode": {
"extensions": [
"esbenp.prettier-vscode"
]
}
}

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
47 changes: 31 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
- next
branches-ignore:
- 'generated'
- 'codegen/**'
- 'integrated/**'
- 'stl-preview-head/**'
- 'stl-preview-base/**'

jobs:
lint:
timeout-minutes: 10
name: lint
runs-on: ubuntu-latest


runs-on: ${{ github.repository == 'stainless-sdks/zeroentropy-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v4

Expand All @@ -29,10 +28,12 @@ jobs:
run: ./scripts/lint

build:
timeout-minutes: 5
name: build
runs-on: ubuntu-latest


runs-on: ${{ github.repository == 'stainless-sdks/zeroentropy-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4

Expand All @@ -46,21 +47,35 @@ jobs:

- name: Check build
run: ./scripts/build

- name: Get GitHub OIDC Token
if: github.repository == 'stainless-sdks/zeroentropy-node'
id: github-oidc
uses: actions/github-script@v6
with:
script: core.setOutput('github_token', await core.getIDToken());

- name: Upload tarball
if: github.repository == 'stainless-sdks/zeroentropy-node'
env:
URL: https://pkg.stainless.com/s
AUTH: ${{ steps.github-oidc.outputs.github_token }}
SHA: ${{ github.sha }}
run: ./scripts/utils/upload-artifact.sh
test:
timeout-minutes: 10
name: test
runs-on: ubuntu-latest

runs-on: ${{ github.repository == 'stainless-sdks/zeroentropy-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v4

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

- name: Bootstrap
run: ./scripts/bootstrap

- name: Run tests
run: ./scripts/test

2 changes: 1 addition & 1 deletion .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0-alpha.3"
".": "0.1.0-alpha.4"
}
4 changes: 3 additions & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
configured_endpoints: 15
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zeroentropy%2Fzeroentropy-99a41bb73e432cb47fe1937219b3c7b109ae534456e8dd019cc00cc1e6018a16.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zeroentropy%2Fzeroentropy-f06c49dfd4b38a4f9d5bcad56348156bbf641aa8b7968acfbf655ad6ceff2126.yml
openapi_spec_hash: cac52dd65fbcb65ffa7a183e764b7f06
config_hash: beba80a17ba64c5439712e85129ab5ad
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,41 @@
# Changelog

## 0.1.0-alpha.4 (2025-06-04)

Full Changelog: [v0.1.0-alpha.3...v0.1.0-alpha.4](https://github.com/zeroentropy-ai/zeroentropy-node/compare/v0.1.0-alpha.3...v0.1.0-alpha.4)

### Features

* add SKIP_BREW env var to ./scripts/bootstrap ([#34](https://github.com/zeroentropy-ai/zeroentropy-node/issues/34)) ([1db65f9](https://github.com/zeroentropy-ai/zeroentropy-node/commit/1db65f912a1a5f23668ea2519ac8e1f379f0a806))
* **api:** manual updates ([188e90a](https://github.com/zeroentropy-ai/zeroentropy-node/commit/188e90a6a7008044bd3a88baa76433b86e1bafa9))
* **api:** manual updates ([4f364c5](https://github.com/zeroentropy-ai/zeroentropy-node/commit/4f364c5925cf3203ec0cfefbd30f28280019ac13))
* **api:** manual updates ([d68a8eb](https://github.com/zeroentropy-ai/zeroentropy-node/commit/d68a8eb68f20f0e2735b0a74d74593f92265cd03))
* **api:** manual updates ([a9ac415](https://github.com/zeroentropy-ai/zeroentropy-node/commit/a9ac4152f59d0fabb2866c628a9d87155b2a471d))
* **api:** manual updates ([6c6d3e1](https://github.com/zeroentropy-ai/zeroentropy-node/commit/6c6d3e19561559312962e5b0e0d14c0127519418))
* **client:** accept RFC6838 JSON content types ([#35](https://github.com/zeroentropy-ai/zeroentropy-node/issues/35)) ([5175743](https://github.com/zeroentropy-ai/zeroentropy-node/commit/5175743984e1379e05c4baaa5dded94dc1ae6b85))
* **client:** send `X-Stainless-Timeout` header ([#28](https://github.com/zeroentropy-ai/zeroentropy-node/issues/28)) ([ecd0912](https://github.com/zeroentropy-ai/zeroentropy-node/commit/ecd0912273945a262c29c7520410d6ae927ff177))


### Bug Fixes

* avoid type error in certain environments ([#39](https://github.com/zeroentropy-ai/zeroentropy-node/issues/39)) ([5be66ff](https://github.com/zeroentropy-ai/zeroentropy-node/commit/5be66ffd2783b79bda15848632f46c1a2b0bd53c))
* **client:** fix export map for index exports ([#30](https://github.com/zeroentropy-ai/zeroentropy-node/issues/30)) ([1518181](https://github.com/zeroentropy-ai/zeroentropy-node/commit/1518181a12687feeb94e7634194f73f7c6d2a92b))
* **internal:** work around https://github.com/vercel/next.js/issues/76881 ([#41](https://github.com/zeroentropy-ai/zeroentropy-node/issues/41)) ([a78fd51](https://github.com/zeroentropy-ai/zeroentropy-node/commit/a78fd51e969d8ab08858b5871a86609c8067b8ce))


### Chores

* **exports:** cleaner resource index imports ([#37](https://github.com/zeroentropy-ai/zeroentropy-node/issues/37)) ([e447d3b](https://github.com/zeroentropy-ai/zeroentropy-node/commit/e447d3b306acdcd7460b8329dd31cc78fedc4388))
* **exports:** stop using path fallbacks ([#38](https://github.com/zeroentropy-ai/zeroentropy-node/issues/38)) ([f7460de](https://github.com/zeroentropy-ai/zeroentropy-node/commit/f7460de48f5deaead21c777199dfb6acacfdf4ff))
* **internal:** codegen related update ([#40](https://github.com/zeroentropy-ai/zeroentropy-node/issues/40)) ([d60d321](https://github.com/zeroentropy-ai/zeroentropy-node/commit/d60d3218f82dc4782cfddb2e164b1e3eb05835c7))
* **internal:** fix devcontainers setup ([#31](https://github.com/zeroentropy-ai/zeroentropy-node/issues/31)) ([0de15d2](https://github.com/zeroentropy-ai/zeroentropy-node/commit/0de15d2ba4cfc81f769646ade15a88c3f30fcaa9))
* **internal:** remove extra empty newlines ([#36](https://github.com/zeroentropy-ai/zeroentropy-node/issues/36)) ([5b8b92f](https://github.com/zeroentropy-ai/zeroentropy-node/commit/5b8b92f2a64634a3a792b705c066c01132368d3d))


### Documentation

* update URLs from stainlessapi.com to stainless.com ([#32](https://github.com/zeroentropy-ai/zeroentropy-node/issues/32)) ([f8ec234](https://github.com/zeroentropy-ai/zeroentropy-node/commit/f8ec2343b8ac63893220f698353a5e127899523f))

## 0.1.0-alpha.3 (2025-01-28)

Full Changelog: [v0.1.0-alpha.2...v0.1.0-alpha.3](https://github.com/zeroentropy-ai/zeroentropy-node/compare/v0.1.0-alpha.2...v0.1.0-alpha.3)
Expand Down
60 changes: 25 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# ZeroEntropy Node API Library
# ZeroEntropy Node SDK

[![NPM version](https://img.shields.io/npm/v/zeroentropy.svg)](https://npmjs.org/package/zeroentropy) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/zeroentropy)

This library provides convenient access to the ZeroEntropy REST API from server-side TypeScript or JavaScript.
The ZeroEntropy Node SDK provides convenient access to the [ZeroEntropy REST API](https://docs.zeroentropy.dev/api-reference/) from any TypeScript or JavaScript application.

The REST API documentation can be found on [docs.zeroentropy.dev](https://docs.zeroentropy.dev/api-reference). The full API of this library can be found in [api.md](api.md).

In order to get an API Key, you can visit our [dashboard](https://dashboard.zeroentropy.dev/).

## Installation

```sh
Expand All @@ -24,17 +26,13 @@ const client = new ZeroEntropy({
apiKey: process.env['ZEROENTROPY_API_KEY'], // This is the default and can be omitted
});

async function main() {
const response = await client.documents.add({
collection_name: 'example_collection',
content: { type: 'text', text: 'Example Content' },
path: 'my_document.txt',
});

console.log(response.message);
}
const response = await client.documents.add({
collection_name: 'example_collection',
content: { type: 'text', text: 'Example Content' },
path: 'my_document.txt',
});

main();
console.log(response.message);
```

### Request & Response types
Expand All @@ -49,11 +47,7 @@ const client = new ZeroEntropy({
apiKey: process.env['ZEROENTROPY_API_KEY'], // This is the default and can be omitted
});

async function main() {
const response: ZeroEntropy.StatusGetStatusResponse = await client.status.getStatus();
}

main();
const response: ZeroEntropy.StatusGetStatusResponse = await client.status.getStatus();
```

Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
Expand All @@ -66,22 +60,18 @@ a subclass of `APIError` will be thrown:

<!-- prettier-ignore -->
```ts
async function main() {
const response = await client.status.getStatus().catch(async (err) => {
if (err instanceof ZeroEntropy.APIError) {
console.log(err.status); // 400
console.log(err.name); // BadRequestError
console.log(err.headers); // {server: 'nginx', ...}
} else {
throw err;
}
});
}

main();
const response = await client.status.getStatus().catch(async (err) => {
if (err instanceof ZeroEntropy.APIError) {
console.log(err.status); // 400
console.log(err.name); // BadRequestError
console.log(err.headers); // {server: 'nginx', ...}
} else {
throw err;
}
});
```

Error codes are as followed:
Error codes are as follows:

| Status Code | Error Type |
| ----------- | -------------------------- |
Expand Down Expand Up @@ -142,15 +132,15 @@ List methods in the ZeroEntropy API are paginated.
You can use the `for await … of` syntax to iterate through items across all pages:

```ts
async function fetchAllDocuments(params) {
const allDocuments = [];
async function fetchAllDocumentGetInfoListResponses(params) {
const allDocumentGetInfoListResponses = [];
// Automatically fetches more pages as needed.
for await (const documentGetInfoListResponse of client.documents.getInfoList({
collection_name: 'example_collection',
})) {
allDocuments.push(documentGetInfoListResponse);
allDocumentGetInfoListResponses.push(documentGetInfoListResponse);
}
return allDocuments;
return allDocumentGetInfoListResponses;
}
```

Expand Down
8 changes: 4 additions & 4 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

## Reporting Security Issues

This SDK is generated by [Stainless Software Inc](http://stainlessapi.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken.
This SDK is generated by [Stainless Software Inc](http://stainless.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken.

To report a security issue, please contact the Stainless team at security@stainlessapi.com.
To report a security issue, please contact the Stainless team at security@stainless.com.

## Responsible Disclosure

Expand All @@ -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 ZeroEntropy please follow the respective company's security reporting guidelines.
or products provided by ZeroEntropy, please follow the respective company's security reporting guidelines.

### ZeroEntropy Terms and Policies

Please contact [email protected] for any questions or concerns regarding security of our services.
Please contact [email protected] for any questions or concerns regarding the security of our services.

---

Expand Down
30 changes: 23 additions & 7 deletions bin/publish-npm
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,35 @@ set -eux

npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN"

# Build the project
yarn build

# Navigate to the dist directory
cd dist

# Get the version from package.json
# Get latest version from npm
#
# If the package doesn't exist, yarn will return
# {"type":"error","data":"Received invalid response from npm."}
# where .data.version doesn't exist so LAST_VERSION will be an empty string.
LAST_VERSION="$(yarn info --json 2> /dev/null | jq -r '.data.version')"

# Get current version from package.json
VERSION="$(node -p "require('./package.json').version")"

# Extract the pre-release tag if it exists
# Check if current version is pre-release (e.g. alpha / beta / rc)
CURRENT_IS_PRERELEASE=false
if [[ "$VERSION" =~ -([a-zA-Z]+) ]]; then
# Extract the part before any dot in the pre-release identifier
TAG="${BASH_REMATCH[1]}"
CURRENT_IS_PRERELEASE=true
CURRENT_TAG="${BASH_REMATCH[1]}"
fi

# Check if last version is a stable release
LAST_IS_STABLE_RELEASE=true
if [[ -z "$LAST_VERSION" || "$LAST_VERSION" =~ -([a-zA-Z]+) ]]; then
LAST_IS_STABLE_RELEASE=false
fi

# Use a corresponding alpha/beta tag if there already is a stable release and we're publishing a prerelease.
if $CURRENT_IS_PRERELEASE && $LAST_IS_STABLE_RELEASE; then
TAG="$CURRENT_TAG"
else
TAG="latest"
fi
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zeroentropy",
"version": "0.1.0-alpha.3",
"version": "0.1.0-alpha.4",
"description": "The official TypeScript library for the ZeroEntropy API",
"author": "ZeroEntropy <[email protected]>",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion scripts/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

cd "$(dirname "$0")/.."

if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then
if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ]; then
brew bundle check >/dev/null 2>&1 || {
echo "==> Installing Homebrew dependencies…"
brew bundle
Expand Down
Loading