Skip to content

Commit b285874

Browse files
authored
Merge pull request #6 from zeroentropy-ai/release-please--branches--main--changes--next--components--zeroentropy
release: 0.1.0-alpha.2
2 parents 154c402 + bd06b58 commit b285874

28 files changed

+188
-164
lines changed

.github/workflows/publish-npm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This workflow is triggered when a GitHub release is created.
22
# It can also be run manually to re-publish to NPM in case it failed for some reason.
3-
# You can run this workflow by navigating to https://www.github.com/ZeroEntropy-AI/zeroentropy-node/actions/workflows/publish-npm.yml
3+
# You can run this workflow by navigating to https://www.github.com/zeroentropy-ai/zeroentropy-node/actions/workflows/publish-npm.yml
44
name: Publish NPM
55
on:
66
workflow_dispatch:

.github/workflows/release-doctor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
release_doctor:
1010
name: release doctor
1111
runs-on: ubuntu-latest
12-
if: github.repository == 'ZeroEntropy-AI/zeroentropy-node' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
12+
if: github.repository == 'zeroentropy-ai/zeroentropy-node' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
1313

1414
steps:
1515
- uses: actions/checkout@v4

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.1.0-alpha.1"
2+
".": "0.1.0-alpha.2"
33
}

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
# Changelog
22

3+
## 0.1.0-alpha.2 (2025-01-18)
4+
5+
Full Changelog: [v0.1.0-alpha.1...v0.1.0-alpha.2](https://github.com/zeroentropy-ai/zeroentropy-node/compare/v0.1.0-alpha.1...v0.1.0-alpha.2)
6+
7+
### Features
8+
9+
* **api:** update via SDK Studio ([#10](https://github.com/zeroentropy-ai/zeroentropy-node/issues/10)) ([d599038](https://github.com/zeroentropy-ai/zeroentropy-node/commit/d599038d57c2ead625286aff71f945ddc1c3cfc0))
10+
* **api:** update via SDK Studio ([#11](https://github.com/zeroentropy-ai/zeroentropy-node/issues/11)) ([3eb5960](https://github.com/zeroentropy-ai/zeroentropy-node/commit/3eb59606d1c17fc5b8a0b461ffa95c4090f9498f))
11+
* **api:** update via SDK Studio ([#12](https://github.com/zeroentropy-ai/zeroentropy-node/issues/12)) ([eb87919](https://github.com/zeroentropy-ai/zeroentropy-node/commit/eb87919bd3f57a64ad0082be215c6a66438efbe9))
12+
* **api:** update via SDK Studio ([#13](https://github.com/zeroentropy-ai/zeroentropy-node/issues/13)) ([f104a26](https://github.com/zeroentropy-ai/zeroentropy-node/commit/f104a26939736b3ce81d90c09d204ba7b2309c43))
13+
* **api:** update via SDK Studio ([#14](https://github.com/zeroentropy-ai/zeroentropy-node/issues/14)) ([bb9467f](https://github.com/zeroentropy-ai/zeroentropy-node/commit/bb9467fa8e150520b8a5a41d6640e30accf6d292))
14+
* **api:** update via SDK Studio ([#5](https://github.com/zeroentropy-ai/zeroentropy-node/issues/5)) ([4cbe77d](https://github.com/zeroentropy-ai/zeroentropy-node/commit/4cbe77d77029907ed8e7cae27eaf02d85bad91a3))
15+
* **api:** update via SDK Studio ([#7](https://github.com/zeroentropy-ai/zeroentropy-node/issues/7)) ([8c2a250](https://github.com/zeroentropy-ai/zeroentropy-node/commit/8c2a250f8284daae8ec2b43b347f5b85d12c9507))
16+
* **api:** update via SDK Studio ([#8](https://github.com/zeroentropy-ai/zeroentropy-node/issues/8)) ([5b114e6](https://github.com/zeroentropy-ai/zeroentropy-node/commit/5b114e64b6a7e7367af7ff68e5a7326720933da1))
17+
* **api:** update via SDK Studio ([#9](https://github.com/zeroentropy-ai/zeroentropy-node/issues/9)) ([113b9a4](https://github.com/zeroentropy-ai/zeroentropy-node/commit/113b9a4778439d91c0031240d051ff18fc489a5a))
18+
19+
20+
### Documentation
21+
22+
* remove stainless citation ([154c402](https://github.com/zeroentropy-ai/zeroentropy-node/commit/154c402c11bb09b38bb27ae3df9e5d0e78d06cd0))
23+
324
## 0.1.0-alpha.1 (2025-01-18)
425

526
Full Changelog: [v0.0.1-alpha.0...v0.1.0-alpha.1](https://github.com/ZeroEntropy-AI/zeroentropy-node/compare/v0.0.1-alpha.0...v0.1.0-alpha.1)

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ If you’d like to use the repository from source, you can either install from g
4242
To install via git:
4343

4444
```sh
45-
$ npm install git+ssh://[email protected]:ZeroEntropy-AI/zeroentropy-node.git
45+
$ npm install git+ssh://[email protected]:zeroentropy-ai/zeroentropy-node.git
4646
```
4747

4848
Alternatively, to link a local copy of the repo:
4949

5050
```sh
5151
# Clone
52-
$ git clone https://www.github.com/ZeroEntropy-AI/zeroentropy-node
52+
$ git clone https://www.github.com/zeroentropy-ai/zeroentropy-node
5353
$ cd zeroentropy-node
5454

5555
# With yarn
@@ -99,7 +99,7 @@ the changes aren't made through the automated pipeline, you may want to make rel
9999

100100
### Publish with a GitHub workflow
101101

102-
You can release to package managers by using [the `Publish NPM` GitHub action](https://www.github.com/ZeroEntropy-AI/zeroentropy-node/actions/workflows/publish-npm.yml). This requires a setup organization or repository secret to be set up.
102+
You can release to package managers by using [the `Publish NPM` GitHub action](https://www.github.com/zeroentropy-ai/zeroentropy-node/actions/workflows/publish-npm.yml). This requires a setup organization or repository secret to be set up.
103103

104104
### Publish manually
105105

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2025 Zeroentropy
189+
Copyright 2025 ZeroEntropy
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 74 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Zeroentropy Node API Library
1+
# ZeroEntropy Node API Library
22

33
[![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)
44

5-
This library provides convenient access to the Zeroentropy REST API from server-side TypeScript or JavaScript.
5+
This library provides convenient access to the ZeroEntropy REST API from server-side TypeScript or JavaScript.
66

7-
The REST API documentation can be found on [docs.zeroentropy.com](https://docs.zeroentropy.com). The full API of this library can be found in [api.md](api.md).
7+
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).
88

99
## Installation
1010

@@ -18,16 +18,20 @@ The full API of this library can be found in [api.md](api.md).
1818

1919
<!-- prettier-ignore -->
2020
```js
21-
import Zeroentropy from 'zeroentropy';
21+
import ZeroEntropy from 'zeroentropy';
2222

23-
const client = new Zeroentropy({
23+
const client = new ZeroEntropy({
2424
apiKey: process.env['ZEROENTROPY_API_KEY'], // This is the default and can be omitted
2525
});
2626

2727
async function main() {
28-
const response = await client.documents.getInfo({ collection_name: 'collection_name', path: 'path' });
28+
const response = await client.documents.add({
29+
collection_name: 'example_collection',
30+
content: { type: 'text', text: 'Example Content' },
31+
path: 'my_document.txt',
32+
});
2933

30-
console.log(response.document);
34+
console.log(response.message);
3135
}
3236

3337
main();
@@ -39,15 +43,14 @@ This library includes TypeScript definitions for all request params and response
3943

4044
<!-- prettier-ignore -->
4145
```ts
42-
import Zeroentropy from 'zeroentropy';
46+
import ZeroEntropy from 'zeroentropy';
4347

44-
const client = new Zeroentropy({
48+
const client = new ZeroEntropy({
4549
apiKey: process.env['ZEROENTROPY_API_KEY'], // This is the default and can be omitted
4650
});
4751

4852
async function main() {
49-
const params: Zeroentropy.DocumentGetInfoParams = { collection_name: 'collection_name', path: 'path' };
50-
const response: Zeroentropy.DocumentGetInfoResponse = await client.documents.getInfo(params);
53+
const response: ZeroEntropy.StatusGetStatusResponse = await client.status.getStatus();
5154
}
5255

5356
main();
@@ -64,17 +67,15 @@ a subclass of `APIError` will be thrown:
6467
<!-- prettier-ignore -->
6568
```ts
6669
async function main() {
67-
const response = await client.documents
68-
.getInfo({ collection_name: 'collection_name', path: 'path' })
69-
.catch(async (err) => {
70-
if (err instanceof Zeroentropy.APIError) {
71-
console.log(err.status); // 400
72-
console.log(err.name); // BadRequestError
73-
console.log(err.headers); // {server: 'nginx', ...}
74-
} else {
75-
throw err;
76-
}
77-
});
70+
const response = await client.status.getStatus().catch(async (err) => {
71+
if (err instanceof ZeroEntropy.APIError) {
72+
console.log(err.status); // 400
73+
console.log(err.name); // BadRequestError
74+
console.log(err.headers); // {server: 'nginx', ...}
75+
} else {
76+
throw err;
77+
}
78+
});
7879
}
7980

8081
main();
@@ -104,12 +105,12 @@ You can use the `maxRetries` option to configure or disable this:
104105
<!-- prettier-ignore -->
105106
```js
106107
// Configure the default for all requests:
107-
const client = new Zeroentropy({
108+
const client = new ZeroEntropy({
108109
maxRetries: 0, // default is 2
109110
});
110111

111112
// Or, configure per-request:
112-
await client.documents.getInfo({ collection_name: 'collection_name', path: 'path' }, {
113+
await client.status.getStatus({
113114
maxRetries: 5,
114115
});
115116
```
@@ -121,12 +122,12 @@ Requests time out after 1 minute by default. You can configure this with a `time
121122
<!-- prettier-ignore -->
122123
```ts
123124
// Configure the default for all requests:
124-
const client = new Zeroentropy({
125+
const client = new ZeroEntropy({
125126
timeout: 20 * 1000, // 20 seconds (default is 1 minute)
126127
});
127128

128129
// Override per-request:
129-
await client.documents.getInfo({ collection_name: 'collection_name', path: 'path' }, {
130+
await client.status.getStatus({
130131
timeout: 5 * 1000,
131132
});
132133
```
@@ -135,6 +136,39 @@ On timeout, an `APIConnectionTimeoutError` is thrown.
135136

136137
Note that requests which time out will be [retried twice by default](#retries).
137138

139+
## Auto-pagination
140+
141+
List methods in the ZeroEntropy API are paginated.
142+
You can use the `for await … of` syntax to iterate through items across all pages:
143+
144+
```ts
145+
async function fetchAllDocuments(params) {
146+
const allDocuments = [];
147+
// Automatically fetches more pages as needed.
148+
for await (const documentGetInfoListResponse of client.documents.getInfoList({
149+
collection_name: 'example_collection',
150+
})) {
151+
allDocuments.push(documentGetInfoListResponse);
152+
}
153+
return allDocuments;
154+
}
155+
```
156+
157+
Alternatively, you can request a single page at a time:
158+
159+
```ts
160+
let page = await client.documents.getInfoList({ collection_name: 'example_collection' });
161+
for (const documentGetInfoListResponse of page.documents) {
162+
console.log(documentGetInfoListResponse);
163+
}
164+
165+
// Convenience methods are provided for manually paginating:
166+
while (page.hasNextPage()) {
167+
page = await page.getNextPage();
168+
// ...
169+
}
170+
```
171+
138172
## Advanced Usage
139173

140174
### Accessing raw Response data (e.g., headers)
@@ -145,19 +179,15 @@ You can also use the `.withResponse()` method to get the raw `Response` along wi
145179

146180
<!-- prettier-ignore -->
147181
```ts
148-
const client = new Zeroentropy();
182+
const client = new ZeroEntropy();
149183

150-
const response = await client.documents
151-
.getInfo({ collection_name: 'collection_name', path: 'path' })
152-
.asResponse();
184+
const response = await client.status.getStatus().asResponse();
153185
console.log(response.headers.get('X-My-Header'));
154186
console.log(response.statusText); // access the underlying Response object
155187

156-
const { data: response, response: raw } = await client.documents
157-
.getInfo({ collection_name: 'collection_name', path: 'path' })
158-
.withResponse();
188+
const { data: response, response: raw } = await client.status.getStatus().withResponse();
159189
console.log(raw.headers.get('X-My-Header'));
160-
console.log(response.document);
190+
console.log(response.num_documents);
161191
```
162192

163193
### Making custom/undocumented requests
@@ -210,17 +240,17 @@ By default, this library uses `node-fetch` in Node, and expects a global `fetch`
210240

211241
If you would prefer to use a global, web-standards-compliant `fetch` function even in a Node environment,
212242
(for example, if you are running Node with `--experimental-fetch` or using NextJS which polyfills with `undici`),
213-
add the following import before your first import `from "Zeroentropy"`:
243+
add the following import before your first import `from "ZeroEntropy"`:
214244

215245
```ts
216246
// Tell TypeScript and the package to use the global web fetch instead of node-fetch.
217247
// Note, despite the name, this does not add any polyfills, but expects them to be provided if needed.
218248
import 'zeroentropy/shims/web';
219-
import Zeroentropy from 'zeroentropy';
249+
import ZeroEntropy from 'zeroentropy';
220250
```
221251

222252
To do the inverse, add `import "zeroentropy/shims/node"` (which does import polyfills).
223-
This can also be useful if you are getting the wrong TypeScript types for `Response` ([more details](https://github.com/ZeroEntropy-AI/zeroentropy-node/tree/main/src/_shims#readme)).
253+
This can also be useful if you are getting the wrong TypeScript types for `Response` ([more details](https://github.com/zeroentropy-ai/zeroentropy-node/tree/main/src/_shims#readme)).
224254

225255
### Logging and middleware
226256

@@ -229,9 +259,9 @@ which can be used to inspect or alter the `Request` or `Response` before/after e
229259

230260
```ts
231261
import { fetch } from 'undici'; // as one example
232-
import Zeroentropy from 'zeroentropy';
262+
import ZeroEntropy from 'zeroentropy';
233263

234-
const client = new Zeroentropy({
264+
const client = new ZeroEntropy({
235265
fetch: async (url: RequestInfo, init?: RequestInit): Promise<Response> => {
236266
console.log('About to make a request', url, init);
237267
const response = await fetch(url, init);
@@ -256,17 +286,14 @@ import http from 'http';
256286
import { HttpsProxyAgent } from 'https-proxy-agent';
257287

258288
// Configure the default for all requests:
259-
const client = new Zeroentropy({
289+
const client = new ZeroEntropy({
260290
httpAgent: new HttpsProxyAgent(process.env.PROXY_URL),
261291
});
262292

263293
// Override per-request:
264-
await client.documents.getInfo(
265-
{ collection_name: 'collection_name', path: 'path' },
266-
{
267-
httpAgent: new http.Agent({ keepAlive: false }),
268-
},
269-
);
294+
await client.status.getStatus({
295+
httpAgent: new http.Agent({ keepAlive: false }),
296+
});
270297
```
271298

272299
## Semantic versioning
@@ -279,7 +306,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con
279306

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

282-
We are keen for your feedback; please open an [issue](https://www.github.com/ZeroEntropy-AI/zeroentropy-node/issues) with questions, bugs, or suggestions.
309+
We are keen for your feedback; please open an [issue](https://www.github.com/zeroentropy-ai/zeroentropy-node/issues) with questions, bugs, or suggestions.
283310

284311
## Requirements
285312

SECURITY.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ before making any information public.
1616
## Reporting Non-SDK Related Security Issues
1717

1818
If you encounter security issues that are not directly related to SDKs but pertain to the services
19-
or products provided by Zeroentropy please follow the respective company's security reporting guidelines.
19+
or products provided by ZeroEntropy please follow the respective company's security reporting guidelines.
2020

21-
### Zeroentropy Terms and Policies
21+
### ZeroEntropy Terms and Policies
2222

23-
Please contact founders@zeroentropy.com for any questions or concerns regarding security of our services.
23+
Please contact founders@zeroentropy.dev for any questions or concerns regarding security of our services.
2424

2525
---
2626

api.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,3 @@ Types:
6363
Methods:
6464

6565
- <code title="post /parsers/parse-document">client.parsers.<a href="./src/resources/parsers.ts">parseDocument</a>({ ...params }) -> ParserParseDocumentResponse</code>
66-
67-
# Models
68-
69-
Types:
70-
71-
- <code><a href="./src/resources/models.ts">StrJson</a></code>

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "zeroentropy",
3-
"version": "0.1.0-alpha.1",
4-
"description": "The official TypeScript library for the Zeroentropy API",
5-
"author": "Zeroentropy <founders@zeroentropy.com>",
3+
"version": "0.1.0-alpha.2",
4+
"description": "The official TypeScript library for the ZeroEntropy API",
5+
"author": "ZeroEntropy <founders@zeroentropy.dev>",
66
"types": "dist/index.d.ts",
77
"main": "dist/index.js",
88
"type": "commonjs",
9-
"repository": "github:ZeroEntropy-AI/zeroentropy-node",
9+
"repository": "github:zeroentropy-ai/zeroentropy-node",
1010
"license": "Apache-2.0",
1111
"packageManager": "[email protected]",
1212
"files": [

0 commit comments

Comments
 (0)