Skip to content

release: 0.1.0-alpha.7 #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
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
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.6"
".": "0.1.0-alpha.7"
}
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 0.1.0-alpha.7 (2025-08-16)

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

### Chores

* **deps:** update dependency node-fetch to v2.6.13 ([b514540](https://github.com/zeroentropy-ai/zeroentropy-node/commit/b514540dad74b0359060b3427407f53276f94209))
* **internal:** formatting change ([f08028e](https://github.com/zeroentropy-ai/zeroentropy-node/commit/f08028ecf081a78515aa37d5a8f31d89bcc5ec12))
* **internal:** move publish config ([0819835](https://github.com/zeroentropy-ai/zeroentropy-node/commit/0819835ac68f52cc71834e770bab910f9db38eb8))
* **internal:** remove redundant imports config ([8044b42](https://github.com/zeroentropy-ai/zeroentropy-node/commit/8044b42a7e1860b59633b1c1eea41aecd0761f1a))
* **internal:** update comment in script ([90782a4](https://github.com/zeroentropy-ai/zeroentropy-node/commit/90782a460c764624013f0cd0025c15c6ddc7a69f))
* make some internal functions async ([9722ec8](https://github.com/zeroentropy-ai/zeroentropy-node/commit/9722ec887e08667e0c2ffabe3b0e6e5390187da2))
* update @stainless-api/prism-cli to v5.15.0 ([16c797e](https://github.com/zeroentropy-ai/zeroentropy-node/commit/16c797edaf4fc82dad985a6b8363c26d99da934a))

## 0.1.0-alpha.6 (2025-07-08)

Full Changelog: [v0.1.0-alpha.5...v0.1.0-alpha.6](https://github.com/zeroentropy-ai/zeroentropy-node/compare/v0.1.0-alpha.5...v0.1.0-alpha.6)
Expand Down
2 changes: 1 addition & 1 deletion bin/publish-npm
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ else
fi

# Publish with the appropriate tag
yarn publish --access public --tag "$TAG"
yarn publish --tag "$TAG"
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zeroentropy",
"version": "0.1.0-alpha.6",
"version": "0.1.0-alpha.7",
"description": "The official TypeScript library for the ZeroEntropy API",
"author": "ZeroEntropy <[email protected]>",
"types": "dist/index.d.ts",
Expand All @@ -13,6 +13,9 @@
"**/*"
],
"private": false,
"publishConfig": {
"access": "public"
},
"scripts": {
"test": "./scripts/test",
"build": "./scripts/build",
Expand Down Expand Up @@ -58,10 +61,6 @@
"./shims/web.js",
"./shims/web.mjs"
],
"imports": {
"zeroentropy": ".",
"zeroentropy/*": "./src/*"
},
"exports": {
"./_shims/auto/*": {
"deno": {
Expand Down
4 changes: 2 additions & 2 deletions scripts/mock
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ echo "==> Starting mock server with URL ${URL}"

# Run prism mock on the given spec
if [ "$1" == "--daemon" ]; then
npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" &> .prism.log &
npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log &

# Wait for server to come online
echo -n "Waiting for server"
Expand All @@ -37,5 +37,5 @@ if [ "$1" == "--daemon" ]; then

echo
else
npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL"
npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL"
fi
2 changes: 1 addition & 1 deletion scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ elif ! prism_is_running ; then
echo -e "To run the server, pass in the path or url of your OpenAPI"
echo -e "spec to the prism command:"
echo
echo -e " \$ ${YELLOW}npm exec --package=@stoplight/prism-cli@~5.3.2 -- prism mock path/to/your.openapi.yml${NC}"
echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}"
echo

exit 1
Expand Down
8 changes: 5 additions & 3 deletions src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,10 @@ export abstract class APIClient {
return null;
}

buildRequest<Req>(
async buildRequest<Req>(
inputOptions: FinalRequestOptions<Req>,
{ retryCount = 0 }: { retryCount?: number } = {},
): { req: RequestInit; url: string; timeout: number } {
): Promise<{ req: RequestInit; url: string; timeout: number }> {
const options = { ...inputOptions };
const { method, path, query, defaultBaseURL, headers: headers = {} } = options;

Expand Down Expand Up @@ -450,7 +450,9 @@ export abstract class APIClient {

await this.prepareOptions(options);

const { req, url, timeout } = this.buildRequest(options, { retryCount: maxRetries - retriesRemaining });
const { req, url, timeout } = await this.buildRequest(options, {
retryCount: maxRetries - retriesRemaining,
});

await this.prepareRequest(req, { url, options });

Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ ZeroEntropy.DocumentGetInfoListResponsesGetDocumentInfoListCursor =
DocumentGetInfoListResponsesGetDocumentInfoListCursor;
ZeroEntropy.Queries = Queries;
ZeroEntropy.Models = Models;

export declare namespace ZeroEntropy {
export type RequestOptions = Core.RequestOptions;

Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '0.1.0-alpha.6'; // x-release-please-version
export const VERSION = '0.1.0-alpha.7'; // x-release-please-version
24 changes: 12 additions & 12 deletions tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,22 @@ describe('instantiate client', () => {
apiKey: 'My API Key',
});

test('they are used in the request', () => {
const { req } = client.buildRequest({ path: '/foo', method: 'post' });
test('they are used in the request', async () => {
const { req } = await client.buildRequest({ path: '/foo', method: 'post' });
expect((req.headers as Headers)['x-my-default-header']).toEqual('2');
});

test('can ignore `undefined` and leave the default', () => {
const { req } = client.buildRequest({
test('can ignore `undefined` and leave the default', async () => {
const { req } = await client.buildRequest({
path: '/foo',
method: 'post',
headers: { 'X-My-Default-Header': undefined },
});
expect((req.headers as Headers)['x-my-default-header']).toEqual('2');
});

test('can be removed with `null`', () => {
const { req } = client.buildRequest({
test('can be removed with `null`', async () => {
const { req } = await client.buildRequest({
path: '/foo',
method: 'post',
headers: { 'X-My-Default-Header': null },
Expand Down Expand Up @@ -237,20 +237,20 @@ describe('request building', () => {
const client = new ZeroEntropy({ apiKey: 'My API Key' });

describe('Content-Length', () => {
test('handles multi-byte characters', () => {
const { req } = client.buildRequest({ path: '/foo', method: 'post', body: { value: '—' } });
test('handles multi-byte characters', async () => {
const { req } = await client.buildRequest({ path: '/foo', method: 'post', body: { value: '—' } });
expect((req.headers as Record<string, string>)['content-length']).toEqual('20');
});

test('handles standard characters', () => {
const { req } = client.buildRequest({ path: '/foo', method: 'post', body: { value: 'hello' } });
test('handles standard characters', async () => {
const { req } = await client.buildRequest({ path: '/foo', method: 'post', body: { value: 'hello' } });
expect((req.headers as Record<string, string>)['content-length']).toEqual('22');
});
});

describe('custom headers', () => {
test('handles undefined', () => {
const { req } = client.buildRequest({
test('handles undefined', async () => {
const { req } = await client.buildRequest({
path: '/foo',
method: 'post',
body: { value: 'hello' },
Expand Down
Loading