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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: '10.27.0'
version: '10.30.1'

- name: Bootstrap
run: ./scripts/bootstrap
Expand All @@ -56,7 +56,7 @@ jobs:
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: '10.27.0'
version: '10.30.1'

- name: Bootstrap
run: ./scripts/bootstrap
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: '10.27.0'
version: '10.30.1'

- name: Bootstrap
run: ./scripts/bootstrap
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 @@
{
".": "1.0.0-alpha.8"
".": "1.0.0-alpha.9"
}
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

## 1.0.0-alpha.9 (2026-02-23)

Full Changelog: [v1.0.0-alpha.8...v1.0.0-alpha.9](https://github.com/warpdotdev/oz-sdk-typescript/compare/v1.0.0-alpha.8...v1.0.0-alpha.9)

### Bug Fixes

* **docs/contributing:** correct pnpm link command ([7de7a5b](https://github.com/warpdotdev/oz-sdk-typescript/commit/7de7a5bba2bb7ed232bd7bed6bb10a47aa838678))


### Chores

* **internal/client:** fix form-urlencoded requests ([8193077](https://github.com/warpdotdev/oz-sdk-typescript/commit/8193077e420b7c6c8bf1cd17bfcd283ac0c7860b))
* **internal:** avoid type checking errors with ts-reset ([be80828](https://github.com/warpdotdev/oz-sdk-typescript/commit/be80828361a15d93dafc3063e90f5c1723e312f4))
* **internal:** remove mock server code ([7f8bc16](https://github.com/warpdotdev/oz-sdk-typescript/commit/7f8bc16fa7c3186906067ef3b4494e08a32a4c6d))
* **internal:** upgrade pnpm version ([b8d239e](https://github.com/warpdotdev/oz-sdk-typescript/commit/b8d239eed2092ca12b758ece537c54cba4c00815))
* update mock server docs ([b6d0ab3](https://github.com/warpdotdev/oz-sdk-typescript/commit/b6d0ab3a27db6f7e2ee50a0e62952981feff5199))

## 1.0.0-alpha.8 (2026-02-08)

Full Changelog: [v1.0.0-alpha.7...v1.0.0-alpha.8](https://github.com/warpdotdev/oz-sdk-typescript/compare/v1.0.0-alpha.7...v1.0.0-alpha.8)
Expand Down
8 changes: 1 addition & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,11 @@ $ yarn link oz-agent-sdk
# With pnpm
$ pnpm link --global
$ cd ../my-package
$ pnpm link -global oz-agent-sdk
$ pnpm link --global oz-agent-sdk
```

## Running tests

Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.

```sh
$ npx prism mock path/to/your/openapi.yml
```

```sh
$ pnpm run test
```
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "oz-agent-sdk",
"version": "1.0.0-alpha.8",
"version": "1.0.0-alpha.9",
"description": "The official TypeScript library for the Oz API API",
"author": "Oz API <>",
"types": "dist/index.d.ts",
"main": "dist/index.js",
"type": "commonjs",
"repository": "github:warpdotdev/oz-sdk-typescript",
"license": "Apache-2.0",
"packageManager": "pnpm@10.27.0",
"packageManager": "pnpm@10.30.1",
"files": [
"**/*"
],
Expand Down
41 changes: 0 additions & 41 deletions scripts/mock

This file was deleted.

46 changes: 0 additions & 46 deletions scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,7 @@ set -e

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

RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
NC='\033[0m' # No Color

function prism_is_running() {
curl --silent "http://localhost:4010" >/dev/null 2>&1
}

kill_server_on_port() {
pids=$(lsof -t -i tcp:"$1" || echo "")
if [ "$pids" != "" ]; then
kill "$pids"
echo "Stopped $pids."
fi
}

function is_overriding_api_base_url() {
[ -n "$TEST_API_BASE_URL" ]
}

if ! is_overriding_api_base_url && ! prism_is_running ; then
# When we exit this script, make sure to kill the background mock server process
trap 'kill_server_on_port 4010' EXIT

# Start the dev server
./scripts/mock --daemon
fi

if is_overriding_api_base_url ; then
echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}"
echo
elif ! prism_is_running ; then
echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server"
echo -e "running against your OpenAPI spec."
echo
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=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}"
echo

exit 1
else
echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}"
echo
fi

echo "==> Running tests"
./node_modules/.bin/jest "$@"
10 changes: 9 additions & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ export class OzAPI {
loggerFor(this).info(`${responseInfo} - ${retryMessage}`);

const errText = await response.text().catch((err: any) => castToError(err).message);
const errJSON = safeJSON(errText);
const errJSON = safeJSON(errText) as any;
const errMessage = errJSON ? undefined : errText;

loggerFor(this).debug(
Expand Down Expand Up @@ -694,6 +694,14 @@ export class OzAPI {
(Symbol.iterator in body && 'next' in body && typeof body.next === 'function'))
) {
return { bodyHeaders: undefined, body: Shims.ReadableStreamFrom(body as AsyncIterable<Uint8Array>) };
} else if (
typeof body === 'object' &&
headers.values.get('content-type') === 'application/x-www-form-urlencoded'
) {
return {
bodyHeaders: { 'content-type': 'application/x-www-form-urlencoded' },
body: this.stringifyQuery(body as Record<string, unknown>),
};
} else {
return this.#encoder({ body, headers });
}
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 = '1.0.0-alpha.8'; // x-release-please-version
export const VERSION = '1.0.0-alpha.9'; // x-release-please-version
6 changes: 3 additions & 3 deletions tests/api-resources/agent/agent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const client = new OzAPI({
});

describe('resource agent', () => {
// Prism tests are disabled
// Mock server tests are disabled
test.skip('list', async () => {
const responsePromise = client.agent.list();
const rawResponse = await responsePromise.asResponse();
Expand All @@ -20,7 +20,7 @@ describe('resource agent', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});

// Prism tests are disabled
// Mock server tests are disabled
test.skip('list: request options and params are passed correctly', async () => {
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
await expect(
Expand All @@ -35,7 +35,7 @@ describe('resource agent', () => {
).rejects.toThrow(OzAPI.NotFoundError);
});

// Prism tests are disabled
// Mock server tests are disabled
test.skip('run', async () => {
const responsePromise = client.agent.run({});
const rawResponse = await responsePromise.asResponse();
Expand Down
8 changes: 4 additions & 4 deletions tests/api-resources/agent/runs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const client = new OzAPI({
});

describe('resource runs', () => {
// Prism tests are disabled
// Mock server tests are disabled
test.skip('retrieve', async () => {
const responsePromise = client.agent.runs.retrieve('runId');
const rawResponse = await responsePromise.asResponse();
Expand All @@ -20,7 +20,7 @@ describe('resource runs', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});

// Prism tests are disabled
// Mock server tests are disabled
test.skip('list', async () => {
const responsePromise = client.agent.runs.list();
const rawResponse = await responsePromise.asResponse();
Expand All @@ -32,7 +32,7 @@ describe('resource runs', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});

// Prism tests are disabled
// Mock server tests are disabled
test.skip('list: request options and params are passed correctly', async () => {
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
await expect(
Expand Down Expand Up @@ -60,7 +60,7 @@ describe('resource runs', () => {
).rejects.toThrow(OzAPI.NotFoundError);
});

// Prism tests are disabled
// Mock server tests are disabled
test.skip('cancel', async () => {
const responsePromise = client.agent.runs.cancel('runId');
const rawResponse = await responsePromise.asResponse();
Expand Down
18 changes: 9 additions & 9 deletions tests/api-resources/agent/schedules.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const client = new OzAPI({
});

describe('resource schedules', () => {
// Prism tests are disabled
// Mock server tests are disabled
test.skip('create: only required params', async () => {
const responsePromise = client.agent.schedules.create({
cron_schedule: '0 9 * * *',
Expand All @@ -24,7 +24,7 @@ describe('resource schedules', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});

// Prism tests are disabled
// Mock server tests are disabled
test.skip('create: required and optional params', async () => {
const response = await client.agent.schedules.create({
cron_schedule: '0 9 * * *',
Expand Down Expand Up @@ -54,7 +54,7 @@ describe('resource schedules', () => {
});
});

// Prism tests are disabled
// Mock server tests are disabled
test.skip('retrieve', async () => {
const responsePromise = client.agent.schedules.retrieve('scheduleId');
const rawResponse = await responsePromise.asResponse();
Expand All @@ -66,7 +66,7 @@ describe('resource schedules', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});

// Prism tests are disabled
// Mock server tests are disabled
test.skip('update: only required params', async () => {
const responsePromise = client.agent.schedules.update('scheduleId', {
cron_schedule: 'cron_schedule',
Expand All @@ -83,7 +83,7 @@ describe('resource schedules', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});

// Prism tests are disabled
// Mock server tests are disabled
test.skip('update: required and optional params', async () => {
const response = await client.agent.schedules.update('scheduleId', {
cron_schedule: 'cron_schedule',
Expand Down Expand Up @@ -112,7 +112,7 @@ describe('resource schedules', () => {
});
});

// Prism tests are disabled
// Mock server tests are disabled
test.skip('list', async () => {
const responsePromise = client.agent.schedules.list();
const rawResponse = await responsePromise.asResponse();
Expand All @@ -124,7 +124,7 @@ describe('resource schedules', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});

// Prism tests are disabled
// Mock server tests are disabled
test.skip('delete', async () => {
const responsePromise = client.agent.schedules.delete('scheduleId');
const rawResponse = await responsePromise.asResponse();
Expand All @@ -136,7 +136,7 @@ describe('resource schedules', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});

// Prism tests are disabled
// Mock server tests are disabled
test.skip('pause', async () => {
const responsePromise = client.agent.schedules.pause('scheduleId');
const rawResponse = await responsePromise.asResponse();
Expand All @@ -148,7 +148,7 @@ describe('resource schedules', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});

// Prism tests are disabled
// Mock server tests are disabled
test.skip('resume', async () => {
const responsePromise = client.agent.schedules.resume('scheduleId');
const rawResponse = await responsePromise.asResponse();
Expand Down