From 3345b629c1904bfb2c2f9e05c86312c6c7b88b48 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 14:02:43 +0000 Subject: [PATCH 01/48] feat(api): api update --- .github/workflows/create-releases.yml | 41 +++++++++ .github/workflows/publish-npm.yml | 8 +- .github/workflows/release-doctor.yml | 1 + bin/check-release-environment | 4 + .../inference-pipelines.ts | 72 ++++++++++++++++ src/resources/projects/inference-pipelines.ts | 84 +++++++++++++++++++ 6 files changed, 204 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/create-releases.yml diff --git a/.github/workflows/create-releases.yml b/.github/workflows/create-releases.yml new file mode 100644 index 0000000..d820b50 --- /dev/null +++ b/.github/workflows/create-releases.yml @@ -0,0 +1,41 @@ +name: Create releases +on: + schedule: + - cron: '0 5 * * *' # every day at 5am UTC + push: + branches: + - main + +jobs: + release: + name: release + if: github.ref == 'refs/heads/main' && github.repository == 'openlayer-ai/openlayer-ts' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: stainless-api/trigger-release-please@v1 + id: release + with: + repo: ${{ github.event.repository.full_name }} + stainless-api-key: ${{ secrets.STAINLESS_API_KEY }} + + - name: Set up Node + if: ${{ steps.release.outputs.releases_created }} + uses: actions/setup-node@v3 + with: + node-version: '18' + + - name: Install dependencies + if: ${{ steps.release.outputs.releases_created }} + run: | + yarn install + + - name: Publish to NPM + if: ${{ steps.release.outputs.releases_created }} + run: | + bash ./bin/publish-npm + env: + NPM_TOKEN: ${{ secrets.OPENLAYER_NPM_TOKEN || secrets.NPM_TOKEN }} + diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 361a64a..405e769 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -1,13 +1,9 @@ -# 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/openlayer-ai/openlayer-ts/actions/workflows/publish-npm.yml +# workflow for re-running publishing to NPM in case it fails for some reason +# you can run this workflow by navigating to https://www.github.com/openlayer-ai/openlayer-ts/actions/workflows/publish-npm.yml name: Publish NPM on: workflow_dispatch: - release: - types: [published] - jobs: publish: name: publish diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index f021d93..fe63f8c 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -18,5 +18,6 @@ jobs: run: | bash ./bin/check-release-environment env: + STAINLESS_API_KEY: ${{ secrets.STAINLESS_API_KEY }} NPM_TOKEN: ${{ secrets.OPENLAYER_NPM_TOKEN || secrets.NPM_TOKEN }} diff --git a/bin/check-release-environment b/bin/check-release-environment index 0f4fafe..5da9dd7 100644 --- a/bin/check-release-environment +++ b/bin/check-release-environment @@ -2,6 +2,10 @@ errors=() +if [ -z "${STAINLESS_API_KEY}" ]; then + errors+=("The STAINLESS_API_KEY secret has not been set. Please contact Stainless for an API key & set it in your organization secrets on GitHub.") +fi + if [ -z "${NPM_TOKEN}" ]; then errors+=("The OPENLAYER_NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets") fi diff --git a/src/resources/inference-pipelines/inference-pipelines.ts b/src/resources/inference-pipelines/inference-pipelines.ts index efdb59b..4e5b1c8 100644 --- a/src/resources/inference-pipelines/inference-pipelines.ts +++ b/src/resources/inference-pipelines/inference-pipelines.ts @@ -275,26 +275,59 @@ export namespace InferencePipelineRetrieveResponse { } export interface Workspace { + /** + * The workspace id. + */ id: string; + /** + * The workspace creator id. + */ creatorId: string | null; + /** + * The workspace creation date. + */ dateCreated: string; + /** + * The workspace last updated date. + */ dateUpdated: string; + /** + * The number of invites in the workspace. + */ inviteCount: number; + /** + * The number of members in the workspace. + */ memberCount: number; + /** + * The workspace name. + */ name: string; + /** + * The end date of the current billing period. + */ periodEndDate: string | null; + /** + * The start date of the current billing period. + */ periodStartDate: string | null; + /** + * The number of projects in the workspace. + */ projectCount: number; + /** + * The workspace slug. + */ slug: string; status: @@ -309,6 +342,9 @@ export namespace InferencePipelineRetrieveResponse { monthlyUsage?: Array; + /** + * Whether the workspace only allows SAML authentication. + */ samlOnlyAccess?: boolean; wildcardDomains?: Array; @@ -528,26 +564,59 @@ export namespace InferencePipelineUpdateResponse { } export interface Workspace { + /** + * The workspace id. + */ id: string; + /** + * The workspace creator id. + */ creatorId: string | null; + /** + * The workspace creation date. + */ dateCreated: string; + /** + * The workspace last updated date. + */ dateUpdated: string; + /** + * The number of invites in the workspace. + */ inviteCount: number; + /** + * The number of members in the workspace. + */ memberCount: number; + /** + * The workspace name. + */ name: string; + /** + * The end date of the current billing period. + */ periodEndDate: string | null; + /** + * The start date of the current billing period. + */ periodStartDate: string | null; + /** + * The number of projects in the workspace. + */ projectCount: number; + /** + * The workspace slug. + */ slug: string; status: @@ -562,6 +631,9 @@ export namespace InferencePipelineUpdateResponse { monthlyUsage?: Array; + /** + * Whether the workspace only allows SAML authentication. + */ samlOnlyAccess?: boolean; wildcardDomains?: Array; diff --git a/src/resources/projects/inference-pipelines.ts b/src/resources/projects/inference-pipelines.ts index 7f91d92..eed6c61 100644 --- a/src/resources/projects/inference-pipelines.ts +++ b/src/resources/projects/inference-pipelines.ts @@ -240,26 +240,59 @@ export namespace InferencePipelineCreateResponse { } export interface Workspace { + /** + * The workspace id. + */ id: string; + /** + * The workspace creator id. + */ creatorId: string | null; + /** + * The workspace creation date. + */ dateCreated: string; + /** + * The workspace last updated date. + */ dateUpdated: string; + /** + * The number of invites in the workspace. + */ inviteCount: number; + /** + * The number of members in the workspace. + */ memberCount: number; + /** + * The workspace name. + */ name: string; + /** + * The end date of the current billing period. + */ periodEndDate: string | null; + /** + * The start date of the current billing period. + */ periodStartDate: string | null; + /** + * The number of projects in the workspace. + */ projectCount: number; + /** + * The workspace slug. + */ slug: string; status: @@ -274,6 +307,9 @@ export namespace InferencePipelineCreateResponse { monthlyUsage?: Array; + /** + * Whether the workspace only allows SAML authentication. + */ samlOnlyAccess?: boolean; wildcardDomains?: Array; @@ -498,26 +534,59 @@ export namespace InferencePipelineListResponse { } export interface Workspace { + /** + * The workspace id. + */ id: string; + /** + * The workspace creator id. + */ creatorId: string | null; + /** + * The workspace creation date. + */ dateCreated: string; + /** + * The workspace last updated date. + */ dateUpdated: string; + /** + * The number of invites in the workspace. + */ inviteCount: number; + /** + * The number of members in the workspace. + */ memberCount: number; + /** + * The workspace name. + */ name: string; + /** + * The end date of the current billing period. + */ periodEndDate: string | null; + /** + * The start date of the current billing period. + */ periodStartDate: string | null; + /** + * The number of projects in the workspace. + */ projectCount: number; + /** + * The workspace slug. + */ slug: string; status: @@ -532,6 +601,9 @@ export namespace InferencePipelineListResponse { monthlyUsage?: Array; + /** + * Whether the workspace only allows SAML authentication. + */ samlOnlyAccess?: boolean; wildcardDomains?: Array; @@ -584,12 +656,24 @@ export namespace InferencePipelineCreateParams { } export interface Workspace { + /** + * The workspace name. + */ name: string; + /** + * The workspace slug. + */ slug: string; + /** + * The workspace invite code. + */ inviteCode?: string; + /** + * Whether the workspace only allows SAML authentication. + */ samlOnlyAccess?: boolean; wildcardDomains?: Array; From fd5d0a9808b2abf8d1b88d3becf2350d9b25887e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 24 Jan 2025 12:05:42 +0000 Subject: [PATCH 02/48] chore(internal): codegen related update --- README.md | 2 +- src/index.ts | 10 +++++----- tests/index.test.ts | 9 +++++++++ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c0a8352..8244415 100644 --- a/README.md +++ b/README.md @@ -380,7 +380,7 @@ await client.inferencePipelines.data.stream( This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions: 1. Changes that only affect static types, without breaking runtime behavior. -2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_. +2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_ 3. Changes that we do not expect to impact the vast majority of users in practice. We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience. diff --git a/src/index.ts b/src/index.ts index e2cc2f8..96767aa 100644 --- a/src/index.ts +++ b/src/index.ts @@ -43,7 +43,7 @@ export interface ClientOptions { * Note that request timeouts are retried by default, so in a worst-case scenario you may wait * much longer than this timeout before the promise succeeds or fails. */ - timeout?: number; + timeout?: number | undefined; /** * An HTTP agent used to manage HTTP(S) connections. @@ -51,7 +51,7 @@ export interface ClientOptions { * If not provided, an agent will be constructed by default in the Node.js environment, * otherwise no agent is used. */ - httpAgent?: Agent; + httpAgent?: Agent | undefined; /** * Specify a custom `fetch` function implementation. @@ -67,7 +67,7 @@ export interface ClientOptions { * * @default 2 */ - maxRetries?: number; + maxRetries?: number | undefined; /** * Default headers to include with every request to the API. @@ -75,7 +75,7 @@ export interface ClientOptions { * These can be removed in individual requests by explicitly setting the * header to `undefined` or `null` in request options. */ - defaultHeaders?: Core.Headers; + defaultHeaders?: Core.Headers | undefined; /** * Default query parameters to include with every request to the API. @@ -83,7 +83,7 @@ export interface ClientOptions { * These can be removed in individual requests by explicitly setting the * param to `undefined` in request options. */ - defaultQuery?: Core.DefaultQuery; + defaultQuery?: Core.DefaultQuery | undefined; } /** diff --git a/tests/index.test.ts b/tests/index.test.ts index f45c1b0..86dc23a 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -96,6 +96,15 @@ describe('instantiate client', () => { expect(response).toEqual({ url: 'http://localhost:5000/foo', custom: true }); }); + test('explicit global fetch', async () => { + // make sure the global fetch type is assignable to our Fetch type + const client = new Openlayer({ + baseURL: 'http://localhost:5000/', + apiKey: 'My API Key', + fetch: defaultFetch, + }); + }); + test('custom signal', async () => { const client = new Openlayer({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', From ca173073bc522424d9d6a35b5a2af14ccd7b8c88 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 24 Jan 2025 12:07:38 +0000 Subject: [PATCH 03/48] chore(internal): codegen related update --- tests/api-resources/inference-pipelines/rows.test.ts | 1 - tests/api-resources/projects/inference-pipelines.test.ts | 8 +------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/tests/api-resources/inference-pipelines/rows.test.ts b/tests/api-resources/inference-pipelines/rows.test.ts index 6856457..9694c3b 100644 --- a/tests/api-resources/inference-pipelines/rows.test.ts +++ b/tests/api-resources/inference-pipelines/rows.test.ts @@ -30,7 +30,6 @@ describe('resource rows', () => { config: { groundTruthColumnName: 'ground_truth', humanFeedbackColumnName: 'human_feedback', - inferenceIdColumnName: 'id', latencyColumnName: 'latency', timestampColumnName: 'timestamp', }, diff --git a/tests/api-resources/projects/inference-pipelines.test.ts b/tests/api-resources/projects/inference-pipelines.test.ts index 80acc23..1be614c 100644 --- a/tests/api-resources/projects/inference-pipelines.test.ts +++ b/tests/api-resources/projects/inference-pipelines.test.ts @@ -28,13 +28,7 @@ describe('resource inferencePipelines', () => { description: 'This pipeline is used for production.', name: 'production', project: { name: 'My Project', taskType: 'llm-base', description: 'My project description.' }, - workspace: { - name: 'Openlayer', - slug: 'openlayer', - inviteCode: 'inviteCode', - samlOnlyAccess: true, - wildcardDomains: ['string'], - }, + workspace: { name: 'Openlayer', slug: 'openlayer', samlOnlyAccess: true, wildcardDomains: ['string'] }, }); }); From 1016df6f549fd3312c26f6ecfd15b3aac58c5d65 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 29 Jan 2025 03:52:21 +0000 Subject: [PATCH 04/48] chore(internal): codegen related update --- tests/api-resources/inference-pipelines/rows.test.ts | 1 + tests/api-resources/projects/inference-pipelines.test.ts | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/api-resources/inference-pipelines/rows.test.ts b/tests/api-resources/inference-pipelines/rows.test.ts index 9694c3b..6856457 100644 --- a/tests/api-resources/inference-pipelines/rows.test.ts +++ b/tests/api-resources/inference-pipelines/rows.test.ts @@ -30,6 +30,7 @@ describe('resource rows', () => { config: { groundTruthColumnName: 'ground_truth', humanFeedbackColumnName: 'human_feedback', + inferenceIdColumnName: 'id', latencyColumnName: 'latency', timestampColumnName: 'timestamp', }, diff --git a/tests/api-resources/projects/inference-pipelines.test.ts b/tests/api-resources/projects/inference-pipelines.test.ts index 1be614c..80acc23 100644 --- a/tests/api-resources/projects/inference-pipelines.test.ts +++ b/tests/api-resources/projects/inference-pipelines.test.ts @@ -28,7 +28,13 @@ describe('resource inferencePipelines', () => { description: 'This pipeline is used for production.', name: 'production', project: { name: 'My Project', taskType: 'llm-base', description: 'My project description.' }, - workspace: { name: 'Openlayer', slug: 'openlayer', samlOnlyAccess: true, wildcardDomains: ['string'] }, + workspace: { + name: 'Openlayer', + slug: 'openlayer', + inviteCode: 'inviteCode', + samlOnlyAccess: true, + wildcardDomains: ['string'], + }, }); }); From 333edef002f95acecdb29d3e6a698343c3361937 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 5 Feb 2025 03:36:17 +0000 Subject: [PATCH 05/48] feat(client): send `X-Stainless-Timeout` header --- src/core.ts | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/core.ts b/src/core.ts index 5981ff8..241cb76 100644 --- a/src/core.ts +++ b/src/core.ts @@ -280,6 +280,7 @@ export abstract class APIClient { options: FinalRequestOptions, { retryCount = 0 }: { retryCount?: number } = {}, ): { req: RequestInit; url: string; timeout: number } { + options = { ...options }; const { method, path, query, headers: headers = {} } = options; const body = @@ -292,9 +293,9 @@ export abstract class APIClient { const url = this.buildURL(path!, query); if ('timeout' in options) validatePositiveInteger('timeout', options.timeout); - const timeout = options.timeout ?? this.timeout; + options.timeout = options.timeout ?? this.timeout; const httpAgent = options.httpAgent ?? this.httpAgent ?? getDefaultAgent(url); - const minAgentTimeout = timeout + 1000; + const minAgentTimeout = options.timeout + 1000; if ( typeof (httpAgent as any)?.options?.timeout === 'number' && minAgentTimeout > ((httpAgent as any).options.timeout ?? 0) @@ -323,7 +324,7 @@ export abstract class APIClient { signal: options.signal ?? null, }; - return { req, url, timeout }; + return { req, url, timeout: options.timeout }; } private buildHeaders({ @@ -351,15 +352,22 @@ export abstract class APIClient { delete reqHeaders['content-type']; } - // Don't set the retry count header if it was already set or removed through default headers or by the - // caller. We check `defaultHeaders` and `headers`, which can contain nulls, instead of `reqHeaders` to - // account for the removal case. + // Don't set theses headers if they were already set or removed through default headers or by the caller. + // We check `defaultHeaders` and `headers`, which can contain nulls, instead of `reqHeaders` to account + // for the removal case. if ( getHeader(defaultHeaders, 'x-stainless-retry-count') === undefined && getHeader(headers, 'x-stainless-retry-count') === undefined ) { reqHeaders['x-stainless-retry-count'] = String(retryCount); } + if ( + getHeader(defaultHeaders, 'x-stainless-timeout') === undefined && + getHeader(headers, 'x-stainless-timeout') === undefined && + options.timeout + ) { + reqHeaders['x-stainless-timeout'] = String(options.timeout); + } this.validateHeaders(reqHeaders, headers); From ac3dffce4624d350d5cf73e3020067cb2f71ab59 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 05:17:23 +0000 Subject: [PATCH 06/48] fix(client): fix export map for index exports --- package.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 13eefa3..5c52731 100644 --- a/package.json +++ b/package.json @@ -113,17 +113,17 @@ "default": "./dist/index.mjs" }, "./*.mjs": { - "types": "./dist/*.d.ts", - "default": "./dist/*.mjs" + "types": ["./dist/*.d.ts", "./dist/*/index.d.ts"], + "default": ["./dist/*.mjs", "./dist/*/index.mjs"] }, "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" + "types": ["./dist/*.d.ts", "./dist/*/index.d.ts"], + "default": ["./dist/*.js", "./dist/*/index.js"] }, "./*": { - "types": "./dist/*.d.ts", - "require": "./dist/*.js", - "default": "./dist/*.mjs" + "types": ["./dist/*.d.ts", "./dist/*/index.d.ts"], + "require": ["./dist/*.js", "./dist/*/index.js"], + "default": ["./dist/*.mjs", "./dist/*/index.mjs"] } } } From 6a459de24ebec36ba38b751b6ab7143b3b9e16fd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 22 Feb 2025 05:55:51 +0000 Subject: [PATCH 07/48] chore(internal): fix devcontainers setup --- .devcontainer/Dockerfile | 23 ----------------------- .devcontainer/devcontainer.json | 27 ++++++++++++--------------- 2 files changed, 12 insertions(+), 38 deletions(-) delete mode 100644 .devcontainer/Dockerfile diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index 8ea34be..0000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -# syntax=docker/dockerfile:1 -FROM debian:bookworm-slim AS stainless - -RUN apt-get update && apt-get install -y \ - nodejs \ - npm \ - yarnpkg \ - && apt-get clean autoclean - -# Ensure UTF-8 encoding -ENV LANG=C.UTF-8 -ENV LC_ALL=C.UTF-8 - -# Yarn -RUN ln -sf /usr/bin/yarnpkg /usr/bin/yarn - -WORKDIR /workspace - -COPY package.json yarn.lock /workspace/ - -RUN yarn install - -COPY . /workspace diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index d55fc4d..763462f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -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" } From 3a317902d8bf523f3f54398cdb077a11a18d9995 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 27 Feb 2025 15:03:44 +0000 Subject: [PATCH 08/48] chore(internal): version bump From e56ef04346aa002b8481a8018ad540c678a9a21e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 28 Feb 2025 03:29:39 +0000 Subject: [PATCH 09/48] docs: update URLs from stainlessapi.com to stainless.com More details at https://www.stainless.com/changelog/stainless-com --- README.md | 2 +- SECURITY.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8244415..c58157a 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This library provides convenient access to the Openlayer REST API from server-si The REST API documentation can be found on [openlayer.com](https://openlayer.com/docs/api-reference/rest/overview). The full API of this library can be found in [api.md](api.md). -It is generated with [Stainless](https://www.stainlessapi.com/). +It is generated with [Stainless](https://www.stainless.com/). ## Installation diff --git a/SECURITY.md b/SECURITY.md index 6dfa13e..8614b05 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -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 From 59a7cb4439a344c0ed6b4adb9e6b113dbed0f940 Mon Sep 17 00:00:00 2001 From: meorphis Date: Fri, 14 Mar 2025 11:05:57 -0400 Subject: [PATCH 10/48] chore(internal): fix workflows --- .github/workflows/create-releases.yml | 41 --------------------------- .github/workflows/publish-npm.yml | 8 ++++-- .github/workflows/release-doctor.yml | 1 - 3 files changed, 6 insertions(+), 44 deletions(-) delete mode 100644 .github/workflows/create-releases.yml diff --git a/.github/workflows/create-releases.yml b/.github/workflows/create-releases.yml deleted file mode 100644 index d820b50..0000000 --- a/.github/workflows/create-releases.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Create releases -on: - schedule: - - cron: '0 5 * * *' # every day at 5am UTC - push: - branches: - - main - -jobs: - release: - name: release - if: github.ref == 'refs/heads/main' && github.repository == 'openlayer-ai/openlayer-ts' - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - uses: stainless-api/trigger-release-please@v1 - id: release - with: - repo: ${{ github.event.repository.full_name }} - stainless-api-key: ${{ secrets.STAINLESS_API_KEY }} - - - name: Set up Node - if: ${{ steps.release.outputs.releases_created }} - uses: actions/setup-node@v3 - with: - node-version: '18' - - - name: Install dependencies - if: ${{ steps.release.outputs.releases_created }} - run: | - yarn install - - - name: Publish to NPM - if: ${{ steps.release.outputs.releases_created }} - run: | - bash ./bin/publish-npm - env: - NPM_TOKEN: ${{ secrets.OPENLAYER_NPM_TOKEN || secrets.NPM_TOKEN }} - diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 405e769..361a64a 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -1,9 +1,13 @@ -# workflow for re-running publishing to NPM in case it fails for some reason -# you can run this workflow by navigating to https://www.github.com/openlayer-ai/openlayer-ts/actions/workflows/publish-npm.yml +# 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/openlayer-ai/openlayer-ts/actions/workflows/publish-npm.yml name: Publish NPM on: workflow_dispatch: + release: + types: [published] + jobs: publish: name: publish diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index fe63f8c..f021d93 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -18,6 +18,5 @@ jobs: run: | bash ./bin/check-release-environment env: - STAINLESS_API_KEY: ${{ secrets.STAINLESS_API_KEY }} NPM_TOKEN: ${{ secrets.OPENLAYER_NPM_TOKEN || secrets.NPM_TOKEN }} From 9ac318013fd2128e7f0a98db699534569c8e18a3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Mar 2025 05:11:31 +0000 Subject: [PATCH 11/48] chore(exports): cleaner resource index imports (#113) --- src/resources.ts | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/resources.ts diff --git a/src/resources.ts b/src/resources.ts new file mode 100644 index 0000000..b283d57 --- /dev/null +++ b/src/resources.ts @@ -0,0 +1 @@ +export * from './resources/index'; From fdcd6e2effcd89201604c545e0c3b8f0f0800032 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Mar 2025 05:12:49 +0000 Subject: [PATCH 12/48] chore(exports): stop using path fallbacks (#114) --- package.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 5c52731..13eefa3 100644 --- a/package.json +++ b/package.json @@ -113,17 +113,17 @@ "default": "./dist/index.mjs" }, "./*.mjs": { - "types": ["./dist/*.d.ts", "./dist/*/index.d.ts"], - "default": ["./dist/*.mjs", "./dist/*/index.mjs"] + "types": "./dist/*.d.ts", + "default": "./dist/*.mjs" }, "./*.js": { - "types": ["./dist/*.d.ts", "./dist/*/index.d.ts"], - "default": ["./dist/*.js", "./dist/*/index.js"] + "types": "./dist/*.d.ts", + "default": "./dist/*.js" }, "./*": { - "types": ["./dist/*.d.ts", "./dist/*/index.d.ts"], - "require": ["./dist/*.js", "./dist/*/index.js"], - "default": ["./dist/*.mjs", "./dist/*/index.mjs"] + "types": "./dist/*.d.ts", + "require": "./dist/*.js", + "default": "./dist/*.mjs" } } } From 701091ff829ca7b7f6ee3bf66af961b660eb3371 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 22 Mar 2025 04:38:16 +0000 Subject: [PATCH 13/48] fix: avoid type error in certain environments (#115) --- src/core.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core.ts b/src/core.ts index 241cb76..fbf6d3b 100644 --- a/src/core.ts +++ b/src/core.ts @@ -395,7 +395,7 @@ export abstract class APIClient { !headers ? {} : Symbol.iterator in headers ? Object.fromEntries(Array.from(headers as Iterable).map((header) => [...header])) - : { ...headers } + : { ...(headers as any as Record) } ); } From e08046b9925a5958cb628b2f7beff3cac8da02ca Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 27 Mar 2025 03:41:56 +0000 Subject: [PATCH 14/48] codegen metadata --- .stats.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.stats.yml b/.stats.yml index c254947..5fc516d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1 +1,3 @@ configured_endpoints: 15 +openapi_spec_hash: 9a0b363025305f6b086bcdfe43274830 +config_hash: 21fb9730d1cdc9e3fd38724c4774b894 From 2349019081867529df94ff1143716ce865a30007 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 28 Mar 2025 03:53:37 +0000 Subject: [PATCH 15/48] fix(internal): work around https://github.com/vercel/next.js/issues/76881 (#116) --- src/_shims/index-deno.ts | 2 ++ src/_shims/index.d.ts | 2 ++ src/_shims/index.js | 6 +++++- src/_shims/index.mjs | 6 +++++- src/core.ts | 5 +++++ 5 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/_shims/index-deno.ts b/src/_shims/index-deno.ts index f98dad2..e755878 100644 --- a/src/_shims/index-deno.ts +++ b/src/_shims/index-deno.ts @@ -108,3 +108,5 @@ export declare class FsReadStream extends Readable { const _ReadableStream = ReadableStream; type _ReadableStream = ReadableStream; export { _ReadableStream as ReadableStream }; + +export const init = () => {}; diff --git a/src/_shims/index.d.ts b/src/_shims/index.d.ts index 63ce99a..e3d9fc4 100644 --- a/src/_shims/index.d.ts +++ b/src/_shims/index.d.ts @@ -79,3 +79,5 @@ export function fileFromPath(path: string, options?: FileFromPathOptions): Promi export function fileFromPath(path: string, filename?: string, options?: FileFromPathOptions): Promise; export function isFsReadStream(value: any): value is FsReadStream; + +export const init: () => void; diff --git a/src/_shims/index.js b/src/_shims/index.js index 6b777dd..639ea48 100644 --- a/src/_shims/index.js +++ b/src/_shims/index.js @@ -3,7 +3,9 @@ */ const shims = require('./registry'); const auto = require('openlayer/_shims/auto/runtime'); -if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true }); +exports.init = () => { + if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true }); +}; for (const property of Object.keys(shims)) { Object.defineProperty(exports, property, { get() { @@ -11,3 +13,5 @@ for (const property of Object.keys(shims)) { }, }); } + +exports.init(); diff --git a/src/_shims/index.mjs b/src/_shims/index.mjs index 624fd3d..159fb36 100644 --- a/src/_shims/index.mjs +++ b/src/_shims/index.mjs @@ -3,5 +3,9 @@ */ import * as shims from './registry.mjs'; import * as auto from 'openlayer/_shims/auto/runtime'; -if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true }); +export const init = () => { + if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true }); +}; export * from './registry.mjs'; + +init(); diff --git a/src/core.ts b/src/core.ts index fbf6d3b..92333c6 100644 --- a/src/core.ts +++ b/src/core.ts @@ -16,7 +16,12 @@ import { type RequestInit, type Response, type HeadersInit, + init, } from './_shims/index'; + +// try running side effects outside of _shims/index to workaround https://github.com/vercel/next.js/issues/76881 +init(); + export { type Response }; import { BlobLike, isBlobLike, isMultipartBody } from './uploads'; export { From b8469f3c2fc46916d994fb20b6ff4550a1c2bed3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 3 Apr 2025 07:48:11 +0000 Subject: [PATCH 16/48] fix(client): send `X-Stainless-Timeout` in seconds (#117) --- src/core.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core.ts b/src/core.ts index 92333c6..4d690cc 100644 --- a/src/core.ts +++ b/src/core.ts @@ -371,7 +371,7 @@ export abstract class APIClient { getHeader(headers, 'x-stainless-timeout') === undefined && options.timeout ) { - reqHeaders['x-stainless-timeout'] = String(options.timeout); + reqHeaders['x-stainless-timeout'] = String(Math.trunc(options.timeout / 1000)); } this.validateHeaders(reqHeaders, headers); From da4702cab36298cc7278a3f0a797742c5e23a002 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 3 Apr 2025 08:13:19 +0000 Subject: [PATCH 17/48] chore(internal): add aliases for Record and Array (#118) --- src/core.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/core.ts b/src/core.ts index 4d690cc..9e82415 100644 --- a/src/core.ts +++ b/src/core.ts @@ -33,6 +33,20 @@ export { export type Fetch = (url: RequestInfo, init?: RequestInit) => Promise; +/** + * An alias to the builtin `Array` type so we can + * easily alias it in import statements if there are name clashes. + */ +type _Array = Array; + +/** + * An alias to the builtin `Record` type so we can + * easily alias it in import statements if there are name clashes. + */ +type _Record = Record; + +export type { _Array as Array, _Record as Record }; + type PromiseOrValue = T | Promise; type APIResponseProps = { From 669c259b9fa3ba40ace9901ba24fa80dbc205105 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 4 Apr 2025 09:41:03 +0000 Subject: [PATCH 18/48] fix(api): improve type resolution when importing as a package (#119) --- packages/mcp-server/src/tools.ts | 1 + 1 file changed, 1 insertion(+) create mode 100644 packages/mcp-server/src/tools.ts diff --git a/packages/mcp-server/src/tools.ts b/packages/mcp-server/src/tools.ts new file mode 100644 index 0000000..7e516de --- /dev/null +++ b/packages/mcp-server/src/tools.ts @@ -0,0 +1 @@ +export * from './tools/index'; From 9d9ab9bd791a42fc4269ad0fcd1dbb57f8616e67 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 5 Apr 2025 02:22:41 +0000 Subject: [PATCH 19/48] fix(mcp): remove unused tools.ts (#120) --- packages/mcp-server/src/tools.ts | 1 - 1 file changed, 1 deletion(-) delete mode 100644 packages/mcp-server/src/tools.ts diff --git a/packages/mcp-server/src/tools.ts b/packages/mcp-server/src/tools.ts deleted file mode 100644 index 7e516de..0000000 --- a/packages/mcp-server/src/tools.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './tools/index'; From f3a00ab15a42239fc71459feb324bd835f5d79e9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 9 Apr 2025 02:33:13 +0000 Subject: [PATCH 20/48] chore(tests): improve enum examples (#121) --- tests/api-resources/commits/test-results.test.ts | 2 +- tests/api-resources/inference-pipelines/test-results.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/api-resources/commits/test-results.test.ts b/tests/api-resources/commits/test-results.test.ts index 49a096a..9be61d7 100644 --- a/tests/api-resources/commits/test-results.test.ts +++ b/tests/api-resources/commits/test-results.test.ts @@ -34,7 +34,7 @@ describe('resource testResults', () => { await expect( client.commits.testResults.list( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - { includeArchived: true, page: 1, perPage: 1, status: 'running', type: 'integrity' }, + { includeArchived: true, page: 1, perPage: 1, status: 'passing', type: 'integrity' }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(Openlayer.NotFoundError); diff --git a/tests/api-resources/inference-pipelines/test-results.test.ts b/tests/api-resources/inference-pipelines/test-results.test.ts index 5b55a92..0bf1ad4 100644 --- a/tests/api-resources/inference-pipelines/test-results.test.ts +++ b/tests/api-resources/inference-pipelines/test-results.test.ts @@ -36,7 +36,7 @@ describe('resource testResults', () => { await expect( client.inferencePipelines.testResults.list( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - { page: 1, perPage: 1, status: 'running', type: 'integrity' }, + { page: 1, perPage: 1, status: 'passing', type: 'integrity' }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(Openlayer.NotFoundError); From 5d8ec66ad5ca7ba34da7b56b5f2aa1e9638107cd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 10 Apr 2025 02:50:25 +0000 Subject: [PATCH 21/48] chore(internal): upload builds and expand CI branch coverage --- .github/workflows/ci.yml | 35 +++++++++++++++++++++++--------- scripts/utils/upload-artifact.sh | 25 +++++++++++++++++++++++ 2 files changed, 50 insertions(+), 10 deletions(-) create mode 100755 scripts/utils/upload-artifact.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ddb531a..616cac4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,19 +1,18 @@ name: CI on: push: - branches: - - main - pull_request: - branches: - - main - - next + branches-ignore: + - 'generated' + - 'codegen/**' + - 'integrated/**' + - 'preview-head/**' + - 'preview-base/**' + - 'preview/**' jobs: lint: name: lint runs-on: ubuntu-latest - - steps: - uses: actions/checkout@v4 @@ -31,8 +30,9 @@ jobs: build: name: build runs-on: ubuntu-latest - - + permissions: + contents: read + id-token: write steps: - uses: actions/checkout@v4 @@ -46,3 +46,18 @@ jobs: - name: Check build run: ./scripts/build + + - name: Get GitHub OIDC Token + if: github.repository == 'stainless-sdks/openlayer-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/openlayer-node' + env: + URL: https://pkg.stainless.com/s + AUTH: ${{ steps.github-oidc.outputs.github_token }} + SHA: ${{ github.sha }} + run: ./scripts/utils/upload-artifact.sh diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh new file mode 100755 index 0000000..380c00e --- /dev/null +++ b/scripts/utils/upload-artifact.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +set -exuo pipefail + +RESPONSE=$(curl -X POST "$URL" \ + -H "Authorization: Bearer $AUTH" \ + -H "Content-Type: application/json") + +SIGNED_URL=$(echo "$RESPONSE" | jq -r '.url') + +if [[ "$SIGNED_URL" == "null" ]]; then + echo -e "\033[31mFailed to get signed URL.\033[0m" + exit 1 +fi + +UPLOAD_RESPONSE=$(tar -cz dist | curl -v -X PUT \ + -H "Content-Type: application/gzip" \ + --data-binary @- "$SIGNED_URL" 2>&1) + +if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then + echo -e "\033[32mUploaded build to Stainless storage.\033[0m" + echo -e "\033[32mInstallation: npm install 'https://pkg.stainless.com/s/openlayer-node/$SHA'\033[0m" +else + echo -e "\033[31mFailed to upload artifact.\033[0m" + exit 1 +fi From 71998ef9132f29569e40aa1310cf2b3611096865 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 10 Apr 2025 02:55:30 +0000 Subject: [PATCH 22/48] chore(internal): reduce CI branch coverage --- .github/workflows/ci.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 616cac4..b708356 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,13 +1,12 @@ name: CI on: push: - branches-ignore: - - 'generated' - - 'codegen/**' - - 'integrated/**' - - 'preview-head/**' - - 'preview-base/**' - - 'preview/**' + branches: + - main + pull_request: + branches: + - main + - next jobs: lint: From 344120f8eb82ea1e374aafadf6c7e90edec2cbce Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 15 Apr 2025 03:06:55 +0000 Subject: [PATCH 23/48] chore(client): minor internal fixes --- src/core.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core.ts b/src/core.ts index 9e82415..27031d0 100644 --- a/src/core.ts +++ b/src/core.ts @@ -296,10 +296,10 @@ export abstract class APIClient { } buildRequest( - options: FinalRequestOptions, + inputOptions: FinalRequestOptions, { retryCount = 0 }: { retryCount?: number } = {}, ): { req: RequestInit; url: string; timeout: number } { - options = { ...options }; + const options = { ...inputOptions }; const { method, path, query, headers: headers = {} } = options; const body = @@ -327,8 +327,8 @@ export abstract class APIClient { } if (this.idempotencyHeader && method !== 'get') { - if (!options.idempotencyKey) options.idempotencyKey = this.defaultIdempotencyKey(); - headers[this.idempotencyHeader] = options.idempotencyKey; + if (!inputOptions.idempotencyKey) inputOptions.idempotencyKey = this.defaultIdempotencyKey(); + headers[this.idempotencyHeader] = inputOptions.idempotencyKey; } const reqHeaders = this.buildHeaders({ options, headers, contentLength, retryCount }); From 28f40851950cfa354930fc8dfab69b4a39f3d13e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 18 Apr 2025 19:52:11 +0000 Subject: [PATCH 24/48] feat(api): api update --- .stats.yml | 2 +- src/resources/commits/test-results.ts | 23 +++++++++++++++++-- .../inference-pipelines/test-results.ts | 23 +++++++++++++++++-- 3 files changed, 43 insertions(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5fc516d..959df2a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,3 +1,3 @@ configured_endpoints: 15 -openapi_spec_hash: 9a0b363025305f6b086bcdfe43274830 +openapi_spec_hash: c01d40349b63e0d636eb3ae352a41341 config_hash: 21fb9730d1cdc9e3fd38724c4774b894 diff --git a/src/resources/commits/test-results.ts b/src/resources/commits/test-results.ts index ab1b977..007d1ab 100644 --- a/src/resources/commits/test-results.ts +++ b/src/resources/commits/test-results.ts @@ -203,7 +203,10 @@ export namespace TestResultListResponse { */ insightName?: string; - insightParameters?: Array; + /** + * The insight parameters. Required only for some test subtypes. + */ + insightParameters?: Array | null; /** * The measurement to be evaluated. @@ -213,13 +216,29 @@ export namespace TestResultListResponse { /** * The operator to be used for the evaluation. */ - operator?: string; + operator?: 'is' | '>' | '>=' | '<' | '<=' | '!='; + + /** + * Whether to use automatic anomaly detection or manual thresholds + */ + thresholdMode?: 'automatic' | 'manual'; /** * The value to be compared. */ value?: number | boolean | string | Array; } + + export namespace Threshold { + export interface InsightParameter { + /** + * The name of the insight filter. + */ + name: string; + + value: unknown; + } + } } } } diff --git a/src/resources/inference-pipelines/test-results.ts b/src/resources/inference-pipelines/test-results.ts index 17a72f9..e1c0717 100644 --- a/src/resources/inference-pipelines/test-results.ts +++ b/src/resources/inference-pipelines/test-results.ts @@ -203,7 +203,10 @@ export namespace TestResultListResponse { */ insightName?: string; - insightParameters?: Array; + /** + * The insight parameters. Required only for some test subtypes. + */ + insightParameters?: Array | null; /** * The measurement to be evaluated. @@ -213,13 +216,29 @@ export namespace TestResultListResponse { /** * The operator to be used for the evaluation. */ - operator?: string; + operator?: 'is' | '>' | '>=' | '<' | '<=' | '!='; + + /** + * Whether to use automatic anomaly detection or manual thresholds + */ + thresholdMode?: 'automatic' | 'manual'; /** * The value to be compared. */ value?: number | boolean | string | Array; } + + export namespace Threshold { + export interface InsightParameter { + /** + * The name of the insight filter. + */ + name: string; + + value: unknown; + } + } } } } From e5e84145d885089c7a0be4c5ffdbbbf5e8de98a4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 18 Apr 2025 20:08:58 +0000 Subject: [PATCH 25/48] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 959df2a..11f2aab 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,3 +1,3 @@ configured_endpoints: 15 -openapi_spec_hash: c01d40349b63e0d636eb3ae352a41341 +openapi_spec_hash: 7dd38774b534c352620bca63efa85b19 config_hash: 21fb9730d1cdc9e3fd38724c4774b894 From b7cc1b1ee12af1275addac7057d735fb02a43af1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Apr 2025 13:11:55 +0000 Subject: [PATCH 26/48] feat(api): add test creation endpoint --- .stats.yml | 4 +- api.md | 10 + src/resources/projects/index.ts | 1 + src/resources/projects/projects.ts | 10 + src/resources/projects/tests.ts | 286 +++++++++++++++++++++ tests/api-resources/projects/tests.test.ts | 55 ++++ 6 files changed, 364 insertions(+), 2 deletions(-) create mode 100644 src/resources/projects/tests.ts create mode 100644 tests/api-resources/projects/tests.test.ts diff --git a/.stats.yml b/.stats.yml index 11f2aab..81ceaeb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,3 +1,3 @@ -configured_endpoints: 15 +configured_endpoints: 16 openapi_spec_hash: 7dd38774b534c352620bca63efa85b19 -config_hash: 21fb9730d1cdc9e3fd38724c4774b894 +config_hash: 0383360784fc87d799bad2be203142b5 diff --git a/api.md b/api.md index 93b4252..23df563 100644 --- a/api.md +++ b/api.md @@ -34,6 +34,16 @@ Methods: - client.projects.inferencePipelines.create(projectId, { ...params }) -> InferencePipelineCreateResponse - client.projects.inferencePipelines.list(projectId, { ...params }) -> InferencePipelineListResponse +## Tests + +Types: + +- TestCreateResponse + +Methods: + +- client.projects.tests.create(projectId, { ...params }) -> TestCreateResponse + # Commits Types: diff --git a/src/resources/projects/index.ts b/src/resources/projects/index.ts index de97190..b713c21 100644 --- a/src/resources/projects/index.ts +++ b/src/resources/projects/index.ts @@ -21,3 +21,4 @@ export { type ProjectCreateParams, type ProjectListParams, } from './projects'; +export { Tests, type TestCreateResponse, type TestCreateParams } from './tests'; diff --git a/src/resources/projects/projects.ts b/src/resources/projects/projects.ts index dbf39e5..5bc884d 100644 --- a/src/resources/projects/projects.ts +++ b/src/resources/projects/projects.ts @@ -19,12 +19,15 @@ import { InferencePipelineListResponse, InferencePipelines, } from './inference-pipelines'; +import * as TestsAPI from './tests'; +import { TestCreateParams, TestCreateResponse, Tests } from './tests'; export class Projects extends APIResource { commits: CommitsAPI.Commits = new CommitsAPI.Commits(this._client); inferencePipelines: InferencePipelinesAPI.InferencePipelines = new InferencePipelinesAPI.InferencePipelines( this._client, ); + tests: TestsAPI.Tests = new TestsAPI.Tests(this._client); /** * Create a project in your workspace. @@ -324,6 +327,7 @@ export interface ProjectListParams { Projects.Commits = Commits; Projects.InferencePipelines = InferencePipelines; +Projects.Tests = Tests; export declare namespace Projects { export { @@ -348,4 +352,10 @@ export declare namespace Projects { type InferencePipelineCreateParams as InferencePipelineCreateParams, type InferencePipelineListParams as InferencePipelineListParams, }; + + export { + Tests as Tests, + type TestCreateResponse as TestCreateResponse, + type TestCreateParams as TestCreateParams, + }; } diff --git a/src/resources/projects/tests.ts b/src/resources/projects/tests.ts new file mode 100644 index 0000000..e2b9218 --- /dev/null +++ b/src/resources/projects/tests.ts @@ -0,0 +1,286 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; + +export class Tests extends APIResource { + /** + * Create a test. + */ + create( + projectId: string, + body: TestCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return this._client.post(`/projects/${projectId}/tests`, { body, ...options }); + } +} + +export interface TestCreateResponse { + /** + * The test id. + */ + id: string; + + /** + * The number of comments on the test. + */ + commentCount: number; + + /** + * The test creator id. + */ + creatorId: string | null; + + /** + * The date the test was archived. + */ + dateArchived: string | null; + + /** + * The creation date. + */ + dateCreated: string; + + /** + * The last updated date. + */ + dateUpdated: string; + + /** + * The test description. + */ + description: unknown | null; + + /** + * The test name. + */ + name: string; + + /** + * The test number. + */ + number: number; + + /** + * The project version (commit) id where the test was created. + */ + originProjectVersionId: string | null; + + /** + * The test subtype. + */ + subtype: string; + + /** + * Whether the test is suggested or user-created. + */ + suggested: boolean; + + thresholds: Array; + + /** + * The test type. + */ + type: string; + + /** + * Whether the test is archived. + */ + archived?: boolean; + + /** + * The delay window in seconds. Only applies to tests that use production data. + */ + delayWindow?: number | null; + + /** + * The evaluation window in seconds. Only applies to tests that use production + * data. + */ + evaluationWindow?: number | null; + + /** + * Whether the test uses an ML model. + */ + usesMlModel?: boolean; + + /** + * Whether the test uses production data (monitoring mode only). + */ + usesProductionData?: boolean; + + /** + * Whether the test uses a reference dataset (monitoring mode only). + */ + usesReferenceDataset?: boolean; + + /** + * Whether the test uses a training dataset. + */ + usesTrainingDataset?: boolean; + + /** + * Whether the test uses a validation dataset. + */ + usesValidationDataset?: boolean; +} + +export namespace TestCreateResponse { + export interface Threshold { + /** + * The insight name to be evaluated. + */ + insightName?: string; + + /** + * The insight parameters. Required only for some test subtypes. + */ + insightParameters?: Array | null; + + /** + * The measurement to be evaluated. + */ + measurement?: string; + + /** + * The operator to be used for the evaluation. + */ + operator?: 'is' | '>' | '>=' | '<' | '<=' | '!='; + + /** + * Whether to use automatic anomaly detection or manual thresholds + */ + thresholdMode?: 'automatic' | 'manual'; + + /** + * The value to be compared. + */ + value?: number | boolean | string | Array; + } + + export namespace Threshold { + export interface InsightParameter { + /** + * The name of the insight filter. + */ + name: string; + + value: unknown; + } + } +} + +export interface TestCreateParams { + /** + * The test description. + */ + description: unknown | null; + + /** + * The test name. + */ + name: string; + + /** + * The test subtype. + */ + subtype: string; + + thresholds: Array; + + /** + * The test type. + */ + type: string; + + /** + * Whether the test is archived. + */ + archived?: boolean; + + /** + * The delay window in seconds. Only applies to tests that use production data. + */ + delayWindow?: number | null; + + /** + * The evaluation window in seconds. Only applies to tests that use production + * data. + */ + evaluationWindow?: number | null; + + /** + * Whether the test uses an ML model. + */ + usesMlModel?: boolean; + + /** + * Whether the test uses production data (monitoring mode only). + */ + usesProductionData?: boolean; + + /** + * Whether the test uses a reference dataset (monitoring mode only). + */ + usesReferenceDataset?: boolean; + + /** + * Whether the test uses a training dataset. + */ + usesTrainingDataset?: boolean; + + /** + * Whether the test uses a validation dataset. + */ + usesValidationDataset?: boolean; +} + +export namespace TestCreateParams { + export interface Threshold { + /** + * The insight name to be evaluated. + */ + insightName?: string; + + /** + * The insight parameters. Required only for some test subtypes. + */ + insightParameters?: Array | null; + + /** + * The measurement to be evaluated. + */ + measurement?: string; + + /** + * The operator to be used for the evaluation. + */ + operator?: 'is' | '>' | '>=' | '<' | '<=' | '!='; + + /** + * Whether to use automatic anomaly detection or manual thresholds + */ + thresholdMode?: 'automatic' | 'manual'; + + /** + * The value to be compared. + */ + value?: number | boolean | string | Array; + } + + export namespace Threshold { + export interface InsightParameter { + /** + * The name of the insight filter. + */ + name: string; + + value: unknown; + } + } +} + +export declare namespace Tests { + export { type TestCreateResponse as TestCreateResponse, type TestCreateParams as TestCreateParams }; +} diff --git a/tests/api-resources/projects/tests.test.ts b/tests/api-resources/projects/tests.test.ts new file mode 100644 index 0000000..9d7c753 --- /dev/null +++ b/tests/api-resources/projects/tests.test.ts @@ -0,0 +1,55 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Openlayer from 'openlayer'; +import { Response } from 'node-fetch'; + +const client = new Openlayer({ + apiKey: 'My API Key', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource tests', () => { + test('create: only required params', async () => { + const responsePromise = client.projects.tests.create('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { + description: 'This test checks for duplicate rows in the dataset.', + name: 'No duplicate rows', + subtype: 'duplicateRowCount', + thresholds: [{}], + type: 'integrity', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('create: required and optional params', async () => { + const response = await client.projects.tests.create('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { + description: 'This test checks for duplicate rows in the dataset.', + name: 'No duplicate rows', + subtype: 'duplicateRowCount', + thresholds: [ + { + insightName: 'duplicateRowCount', + insightParameters: [{ name: 'column_name', value: 'Age' }], + measurement: 'duplicateRowCount', + operator: '<=', + thresholdMode: 'automatic', + value: 0, + }, + ], + type: 'integrity', + archived: false, + delayWindow: 0, + evaluationWindow: 3600, + usesMlModel: false, + usesProductionData: false, + usesReferenceDataset: false, + usesTrainingDataset: false, + usesValidationDataset: true, + }); + }); +}); From 64632ad55c30e27a0ca063c28b410d6b83b245b4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 02:30:00 +0000 Subject: [PATCH 27/48] chore(ci): add timeout thresholds for CI jobs --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b708356..ecde737 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,7 @@ on: jobs: lint: + timeout-minutes: 10 name: lint runs-on: ubuntu-latest steps: @@ -27,6 +28,7 @@ jobs: run: ./scripts/lint build: + timeout-minutes: 5 name: build runs-on: ubuntu-latest permissions: From 1128c8f19942ebfecc014626f859dfdadc5725d1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 02:15:36 +0000 Subject: [PATCH 28/48] chore(internal): codegen related update --- .github/workflows/ci.yml | 16 ++++++++-------- .github/workflows/publish-npm.yml | 2 +- .github/workflows/release-doctor.yml | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ecde737..629b914 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,18 +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: depot-ubuntu-24.04 steps: - uses: actions/checkout@v4 @@ -30,7 +30,7 @@ jobs: build: timeout-minutes: 5 name: build - runs-on: ubuntu-latest + runs-on: depot-ubuntu-24.04 permissions: contents: read id-token: write diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 361a64a..e9fd100 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -11,7 +11,7 @@ on: jobs: publish: name: publish - runs-on: ubuntu-latest + runs-on: depot-ubuntu-24.04 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index f021d93..7b9e6ef 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -8,7 +8,7 @@ on: jobs: release_doctor: name: release doctor - runs-on: ubuntu-latest + runs-on: depot-ubuntu-24.04 if: github.repository == 'openlayer-ai/openlayer-ts' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: From 9c8f4b9181f636898c5ff8365596b47c591575f1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 02:16:10 +0000 Subject: [PATCH 29/48] chore(ci): only use depot for staging repos --- .github/workflows/ci.yml | 4 ++-- .github/workflows/publish-npm.yml | 2 +- .github/workflows/release-doctor.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 629b914..d8b41c9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: lint: timeout-minutes: 10 name: lint - runs-on: depot-ubuntu-24.04 + runs-on: ${{ github.repository == 'stainless-sdks/openlayer-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} steps: - uses: actions/checkout@v4 @@ -30,7 +30,7 @@ jobs: build: timeout-minutes: 5 name: build - runs-on: depot-ubuntu-24.04 + runs-on: ${{ github.repository == 'stainless-sdks/openlayer-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} permissions: contents: read id-token: write diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index e9fd100..361a64a 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -11,7 +11,7 @@ on: jobs: publish: name: publish - runs-on: depot-ubuntu-24.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 7b9e6ef..f021d93 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -8,7 +8,7 @@ on: jobs: release_doctor: name: release doctor - runs-on: depot-ubuntu-24.04 + runs-on: ubuntu-latest if: github.repository == 'openlayer-ai/openlayer-ts' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: From e1f898948d963c963471a2265fb7fb8d1ee50ac6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 12:40:47 +0000 Subject: [PATCH 30/48] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 81ceaeb..a9edd5d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,3 +1,3 @@ configured_endpoints: 16 -openapi_spec_hash: 7dd38774b534c352620bca63efa85b19 +openapi_spec_hash: a3b4490f36a68f474989d080a436fe81 config_hash: 0383360784fc87d799bad2be203142b5 From 039040ae81369e6daee7ca02c5bbc682a881365d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 12:45:30 +0000 Subject: [PATCH 31/48] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index a9edd5d..94b4f83 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,3 +1,3 @@ configured_endpoints: 16 -openapi_spec_hash: a3b4490f36a68f474989d080a436fe81 +openapi_spec_hash: 7c835c55ec387350b647a302c48edb9d config_hash: 0383360784fc87d799bad2be203142b5 From 821a6926192dad0532029ea9c2b22a4d24f5e1c6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 21:05:45 +0000 Subject: [PATCH 32/48] feat(api): api update --- .stats.yml | 2 +- src/resources/commits/test-results.ts | 47 +++++++++- .../inference-pipelines/test-results.ts | 45 +++++++++- src/resources/projects/tests.ts | 90 ++++++++++++++++++- 4 files changed, 174 insertions(+), 10 deletions(-) diff --git a/.stats.yml b/.stats.yml index 94b4f83..00b73d5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,3 +1,3 @@ configured_endpoints: 16 -openapi_spec_hash: 7c835c55ec387350b647a302c48edb9d +openapi_spec_hash: 8827ead72aa0c635ccafac5e008fe247 config_hash: 0383360784fc87d799bad2be203142b5 diff --git a/src/resources/commits/test-results.ts b/src/resources/commits/test-results.ts index 007d1ab..642f027 100644 --- a/src/resources/commits/test-results.ts +++ b/src/resources/commits/test-results.ts @@ -140,7 +140,48 @@ export namespace TestResultListResponse { /** * The test subtype. */ - subtype: string; + subtype: + | 'anomalousColumnCount' + | 'characterLength' + | 'classImbalanceRatio' + | 'expectColumnAToBeInColumnB' + | 'columnAverage' + | 'columnDrift' + | 'columnStatistic' + | 'columnValuesMatch' + | 'conflictingLabelRowCount' + | 'containsPii' + | 'containsValidUrl' + | 'correlatedFeatureCount' + | 'customMetricThreshold' + | 'duplicateRowCount' + | 'emptyFeature' + | 'emptyFeatureCount' + | 'driftedFeatureCount' + | 'featureMissingValues' + | 'featureValueValidation' + | 'greatExpectations' + | 'groupByColumnStatsCheck' + | 'illFormedRowCount' + | 'isCode' + | 'isJson' + | 'llmRubricThresholdV2' + | 'labelDrift' + | 'metricThreshold' + | 'newCategoryCount' + | 'newLabelCount' + | 'nullRowCount' + | 'rowCount' + | 'ppScoreValueValidation' + | 'quasiConstantFeature' + | 'quasiConstantFeatureCount' + | 'sqlQuery' + | 'dtypeValidation' + | 'sentenceLength' + | 'sizeRatio' + | 'specialCharactersRatio' + | 'stringValidation' + | 'trainValLeakageRowCount'; /** * Whether the test is suggested or user-created. @@ -152,7 +193,7 @@ export namespace TestResultListResponse { /** * The test type. */ - type: string; + type: 'integrity' | 'consistency' | 'performance'; /** * Whether the test is archived. @@ -245,7 +286,7 @@ export namespace TestResultListResponse { export interface TestResultListParams { /** - * Include archived goals. + * Filter for archived tests. */ includeArchived?: boolean; diff --git a/src/resources/inference-pipelines/test-results.ts b/src/resources/inference-pipelines/test-results.ts index e1c0717..f23deba 100644 --- a/src/resources/inference-pipelines/test-results.ts +++ b/src/resources/inference-pipelines/test-results.ts @@ -140,7 +140,48 @@ export namespace TestResultListResponse { /** * The test subtype. */ - subtype: string; + subtype: + | 'anomalousColumnCount' + | 'characterLength' + | 'classImbalanceRatio' + | 'expectColumnAToBeInColumnB' + | 'columnAverage' + | 'columnDrift' + | 'columnStatistic' + | 'columnValuesMatch' + | 'conflictingLabelRowCount' + | 'containsPii' + | 'containsValidUrl' + | 'correlatedFeatureCount' + | 'customMetricThreshold' + | 'duplicateRowCount' + | 'emptyFeature' + | 'emptyFeatureCount' + | 'driftedFeatureCount' + | 'featureMissingValues' + | 'featureValueValidation' + | 'greatExpectations' + | 'groupByColumnStatsCheck' + | 'illFormedRowCount' + | 'isCode' + | 'isJson' + | 'llmRubricThresholdV2' + | 'labelDrift' + | 'metricThreshold' + | 'newCategoryCount' + | 'newLabelCount' + | 'nullRowCount' + | 'rowCount' + | 'ppScoreValueValidation' + | 'quasiConstantFeature' + | 'quasiConstantFeatureCount' + | 'sqlQuery' + | 'dtypeValidation' + | 'sentenceLength' + | 'sizeRatio' + | 'specialCharactersRatio' + | 'stringValidation' + | 'trainValLeakageRowCount'; /** * Whether the test is suggested or user-created. @@ -152,7 +193,7 @@ export namespace TestResultListResponse { /** * The test type. */ - type: string; + type: 'integrity' | 'consistency' | 'performance'; /** * Whether the test is archived. diff --git a/src/resources/projects/tests.ts b/src/resources/projects/tests.ts index e2b9218..c868bd4 100644 --- a/src/resources/projects/tests.ts +++ b/src/resources/projects/tests.ts @@ -70,7 +70,48 @@ export interface TestCreateResponse { /** * The test subtype. */ - subtype: string; + subtype: + | 'anomalousColumnCount' + | 'characterLength' + | 'classImbalanceRatio' + | 'expectColumnAToBeInColumnB' + | 'columnAverage' + | 'columnDrift' + | 'columnStatistic' + | 'columnValuesMatch' + | 'conflictingLabelRowCount' + | 'containsPii' + | 'containsValidUrl' + | 'correlatedFeatureCount' + | 'customMetricThreshold' + | 'duplicateRowCount' + | 'emptyFeature' + | 'emptyFeatureCount' + | 'driftedFeatureCount' + | 'featureMissingValues' + | 'featureValueValidation' + | 'greatExpectations' + | 'groupByColumnStatsCheck' + | 'illFormedRowCount' + | 'isCode' + | 'isJson' + | 'llmRubricThresholdV2' + | 'labelDrift' + | 'metricThreshold' + | 'newCategoryCount' + | 'newLabelCount' + | 'nullRowCount' + | 'rowCount' + | 'ppScoreValueValidation' + | 'quasiConstantFeature' + | 'quasiConstantFeatureCount' + | 'sqlQuery' + | 'dtypeValidation' + | 'sentenceLength' + | 'sizeRatio' + | 'specialCharactersRatio' + | 'stringValidation' + | 'trainValLeakageRowCount'; /** * Whether the test is suggested or user-created. @@ -82,7 +123,7 @@ export interface TestCreateResponse { /** * The test type. */ - type: string; + type: 'integrity' | 'consistency' | 'performance'; /** * Whether the test is archived. @@ -185,14 +226,55 @@ export interface TestCreateParams { /** * The test subtype. */ - subtype: string; + subtype: + | 'anomalousColumnCount' + | 'characterLength' + | 'classImbalanceRatio' + | 'expectColumnAToBeInColumnB' + | 'columnAverage' + | 'columnDrift' + | 'columnStatistic' + | 'columnValuesMatch' + | 'conflictingLabelRowCount' + | 'containsPii' + | 'containsValidUrl' + | 'correlatedFeatureCount' + | 'customMetricThreshold' + | 'duplicateRowCount' + | 'emptyFeature' + | 'emptyFeatureCount' + | 'driftedFeatureCount' + | 'featureMissingValues' + | 'featureValueValidation' + | 'greatExpectations' + | 'groupByColumnStatsCheck' + | 'illFormedRowCount' + | 'isCode' + | 'isJson' + | 'llmRubricThresholdV2' + | 'labelDrift' + | 'metricThreshold' + | 'newCategoryCount' + | 'newLabelCount' + | 'nullRowCount' + | 'rowCount' + | 'ppScoreValueValidation' + | 'quasiConstantFeature' + | 'quasiConstantFeatureCount' + | 'sqlQuery' + | 'dtypeValidation' + | 'sentenceLength' + | 'sizeRatio' + | 'specialCharactersRatio' + | 'stringValidation' + | 'trainValLeakageRowCount'; thresholds: Array; /** * The test type. */ - type: string; + type: 'integrity' | 'consistency' | 'performance'; /** * Whether the test is archived. From f3fd3fc296af8982eeb965c3427b89abdb7a4a6f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 21:11:11 +0000 Subject: [PATCH 33/48] feat(api): expose test retrieval endpoint --- .stats.yml | 4 +- api.md | 2 + src/resources/projects/index.ts | 8 +- src/resources/projects/projects.ts | 4 +- src/resources/projects/tests.ts | 292 ++++++++++++++++++++- tests/api-resources/projects/tests.test.ts | 39 +++ 6 files changed, 344 insertions(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index 00b73d5..1dee804 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,3 +1,3 @@ -configured_endpoints: 16 +configured_endpoints: 17 openapi_spec_hash: 8827ead72aa0c635ccafac5e008fe247 -config_hash: 0383360784fc87d799bad2be203142b5 +config_hash: 087e6b8013c398a6d24031d24594fdec diff --git a/api.md b/api.md index 23df563..53d1c3c 100644 --- a/api.md +++ b/api.md @@ -39,10 +39,12 @@ Methods: Types: - TestCreateResponse +- TestListResponse Methods: - client.projects.tests.create(projectId, { ...params }) -> TestCreateResponse +- client.projects.tests.list(projectId, { ...params }) -> TestListResponse # Commits diff --git a/src/resources/projects/index.ts b/src/resources/projects/index.ts index b713c21..2cef86c 100644 --- a/src/resources/projects/index.ts +++ b/src/resources/projects/index.ts @@ -21,4 +21,10 @@ export { type ProjectCreateParams, type ProjectListParams, } from './projects'; -export { Tests, type TestCreateResponse, type TestCreateParams } from './tests'; +export { + Tests, + type TestCreateResponse, + type TestListResponse, + type TestCreateParams, + type TestListParams, +} from './tests'; diff --git a/src/resources/projects/projects.ts b/src/resources/projects/projects.ts index 5bc884d..9cb79dd 100644 --- a/src/resources/projects/projects.ts +++ b/src/resources/projects/projects.ts @@ -20,7 +20,7 @@ import { InferencePipelines, } from './inference-pipelines'; import * as TestsAPI from './tests'; -import { TestCreateParams, TestCreateResponse, Tests } from './tests'; +import { TestCreateParams, TestCreateResponse, TestListParams, TestListResponse, Tests } from './tests'; export class Projects extends APIResource { commits: CommitsAPI.Commits = new CommitsAPI.Commits(this._client); @@ -356,6 +356,8 @@ export declare namespace Projects { export { Tests as Tests, type TestCreateResponse as TestCreateResponse, + type TestListResponse as TestListResponse, type TestCreateParams as TestCreateParams, + type TestListParams as TestListParams, }; } diff --git a/src/resources/projects/tests.ts b/src/resources/projects/tests.ts index c868bd4..47e58bb 100644 --- a/src/resources/projects/tests.ts +++ b/src/resources/projects/tests.ts @@ -1,6 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../resource'; +import { isRequestOptions } from '../../core'; import * as Core from '../../core'; export class Tests extends APIResource { @@ -14,6 +15,26 @@ export class Tests extends APIResource { ): Core.APIPromise { return this._client.post(`/projects/${projectId}/tests`, { body, ...options }); } + + /** + * List tests under a project. + */ + list( + projectId: string, + query?: TestListParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + list(projectId: string, options?: Core.RequestOptions): Core.APIPromise; + list( + projectId: string, + query: TestListParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.list(projectId, {}, query); + } + return this._client.get(`/projects/${projectId}/tests`, { query, ...options }); + } } export interface TestCreateResponse { @@ -212,6 +233,232 @@ export namespace TestCreateResponse { } } +export interface TestListResponse { + _meta: TestListResponse._Meta; + + items: Array; +} + +export namespace TestListResponse { + export interface _Meta { + /** + * The current page. + */ + page: number; + + /** + * The number of items per page. + */ + perPage: number; + + /** + * The total number of items. + */ + totalItems: number; + + /** + * The total number of pages. + */ + totalPages: number; + } + + export interface Item { + /** + * The test id. + */ + id: string; + + /** + * The number of comments on the test. + */ + commentCount: number; + + /** + * The test creator id. + */ + creatorId: string | null; + + /** + * The date the test was archived. + */ + dateArchived: string | null; + + /** + * The creation date. + */ + dateCreated: string; + + /** + * The last updated date. + */ + dateUpdated: string; + + /** + * The test description. + */ + description: unknown | null; + + /** + * The test name. + */ + name: string; + + /** + * The test number. + */ + number: number; + + /** + * The project version (commit) id where the test was created. + */ + originProjectVersionId: string | null; + + /** + * The test subtype. + */ + subtype: + | 'anomalousColumnCount' + | 'characterLength' + | 'classImbalanceRatio' + | 'expectColumnAToBeInColumnB' + | 'columnAverage' + | 'columnDrift' + | 'columnStatistic' + | 'columnValuesMatch' + | 'conflictingLabelRowCount' + | 'containsPii' + | 'containsValidUrl' + | 'correlatedFeatureCount' + | 'customMetricThreshold' + | 'duplicateRowCount' + | 'emptyFeature' + | 'emptyFeatureCount' + | 'driftedFeatureCount' + | 'featureMissingValues' + | 'featureValueValidation' + | 'greatExpectations' + | 'groupByColumnStatsCheck' + | 'illFormedRowCount' + | 'isCode' + | 'isJson' + | 'llmRubricThresholdV2' + | 'labelDrift' + | 'metricThreshold' + | 'newCategoryCount' + | 'newLabelCount' + | 'nullRowCount' + | 'rowCount' + | 'ppScoreValueValidation' + | 'quasiConstantFeature' + | 'quasiConstantFeatureCount' + | 'sqlQuery' + | 'dtypeValidation' + | 'sentenceLength' + | 'sizeRatio' + | 'specialCharactersRatio' + | 'stringValidation' + | 'trainValLeakageRowCount'; + + /** + * Whether the test is suggested or user-created. + */ + suggested: boolean; + + thresholds: Array; + + /** + * The test type. + */ + type: 'integrity' | 'consistency' | 'performance'; + + /** + * Whether the test is archived. + */ + archived?: boolean; + + /** + * The delay window in seconds. Only applies to tests that use production data. + */ + delayWindow?: number | null; + + /** + * The evaluation window in seconds. Only applies to tests that use production + * data. + */ + evaluationWindow?: number | null; + + /** + * Whether the test uses an ML model. + */ + usesMlModel?: boolean; + + /** + * Whether the test uses production data (monitoring mode only). + */ + usesProductionData?: boolean; + + /** + * Whether the test uses a reference dataset (monitoring mode only). + */ + usesReferenceDataset?: boolean; + + /** + * Whether the test uses a training dataset. + */ + usesTrainingDataset?: boolean; + + /** + * Whether the test uses a validation dataset. + */ + usesValidationDataset?: boolean; + } + + export namespace Item { + export interface Threshold { + /** + * The insight name to be evaluated. + */ + insightName?: string; + + /** + * The insight parameters. Required only for some test subtypes. + */ + insightParameters?: Array | null; + + /** + * The measurement to be evaluated. + */ + measurement?: string; + + /** + * The operator to be used for the evaluation. + */ + operator?: 'is' | '>' | '>=' | '<' | '<=' | '!='; + + /** + * Whether to use automatic anomaly detection or manual thresholds + */ + thresholdMode?: 'automatic' | 'manual'; + + /** + * The value to be compared. + */ + value?: number | boolean | string | Array; + } + + export namespace Threshold { + export interface InsightParameter { + /** + * The name of the insight filter. + */ + name: string; + + value: unknown; + } + } + } +} + export interface TestCreateParams { /** * The test description. @@ -363,6 +610,49 @@ export namespace TestCreateParams { } } +export interface TestListParams { + /** + * Filter for archived tests. + */ + includeArchived?: boolean; + + /** + * Retrive tests created by a specific project version. + */ + originVersionId?: string | null; + + /** + * The page to return in a paginated query. + */ + page?: number; + + /** + * Maximum number of items to return per page. + */ + perPage?: number; + + /** + * Filter for suggested tests. + */ + suggested?: boolean; + + /** + * Filter objects by test type. Available types are `integrity`, `consistency`, + * `performance`, `fairness`, and `robustness`. + */ + type?: 'integrity' | 'consistency' | 'performance' | 'fairness' | 'robustness'; + + /** + * Retrive tests with usesProductionData (monitoring). + */ + usesProductionData?: boolean | null; +} + export declare namespace Tests { - export { type TestCreateResponse as TestCreateResponse, type TestCreateParams as TestCreateParams }; + export { + type TestCreateResponse as TestCreateResponse, + type TestListResponse as TestListResponse, + type TestCreateParams as TestCreateParams, + type TestListParams as TestListParams, + }; } diff --git a/tests/api-resources/projects/tests.test.ts b/tests/api-resources/projects/tests.test.ts index 9d7c753..acdab7a 100644 --- a/tests/api-resources/projects/tests.test.ts +++ b/tests/api-resources/projects/tests.test.ts @@ -52,4 +52,43 @@ describe('resource tests', () => { usesValidationDataset: true, }); }); + + test('list', async () => { + const responsePromise = client.projects.tests.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('list: request options instead of 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( + client.projects.tests.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Openlayer.NotFoundError); + }); + + test('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( + client.projects.tests.list( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { + includeArchived: true, + originVersionId: '3fa85f64-5717-4562-b3fc-2c963f66afa6', + page: 1, + perPage: 1, + suggested: true, + type: 'integrity', + usesProductionData: true, + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Openlayer.NotFoundError); + }); }); From 2e0a6e1b6a5b3296a3ec905dfa11b5a8501e4583 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 21:17:30 +0000 Subject: [PATCH 34/48] feat(api): api update --- .stats.yml | 2 +- src/resources/projects/tests.ts | 24 ------------------------ 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1dee804..279dd7b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,3 +1,3 @@ configured_endpoints: 17 -openapi_spec_hash: 8827ead72aa0c635ccafac5e008fe247 +openapi_spec_hash: a9c2f380c41389904ec243caa6fd4cc8 config_hash: 087e6b8013c398a6d24031d24594fdec diff --git a/src/resources/projects/tests.ts b/src/resources/projects/tests.ts index 47e58bb..766b4ac 100644 --- a/src/resources/projects/tests.ts +++ b/src/resources/projects/tests.ts @@ -234,34 +234,10 @@ export namespace TestCreateResponse { } export interface TestListResponse { - _meta: TestListResponse._Meta; - items: Array; } export namespace TestListResponse { - export interface _Meta { - /** - * The current page. - */ - page: number; - - /** - * The number of items per page. - */ - perPage: number; - - /** - * The total number of items. - */ - totalItems: number; - - /** - * The total number of pages. - */ - totalPages: number; - } - export interface Item { /** * The test id. From 55a6bae1700d146a342356e35f238a3ac91dc38e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 21:24:02 +0000 Subject: [PATCH 35/48] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 279dd7b..69b1757 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,3 +1,3 @@ configured_endpoints: 17 -openapi_spec_hash: a9c2f380c41389904ec243caa6fd4cc8 +openapi_spec_hash: 17fb5502c19253c7c89785273e89b023 config_hash: 087e6b8013c398a6d24031d24594fdec From da2b9fb62bd0eeaebe1325abaee6e4854d2f987f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 21:24:41 +0000 Subject: [PATCH 36/48] feat(api): expose test retrieval endpoint --- .stats.yml | 2 +- src/resources/projects/tests.ts | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 69b1757..1dee804 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,3 +1,3 @@ configured_endpoints: 17 -openapi_spec_hash: 17fb5502c19253c7c89785273e89b023 +openapi_spec_hash: 8827ead72aa0c635ccafac5e008fe247 config_hash: 087e6b8013c398a6d24031d24594fdec diff --git a/src/resources/projects/tests.ts b/src/resources/projects/tests.ts index 766b4ac..47e58bb 100644 --- a/src/resources/projects/tests.ts +++ b/src/resources/projects/tests.ts @@ -234,10 +234,34 @@ export namespace TestCreateResponse { } export interface TestListResponse { + _meta: TestListResponse._Meta; + items: Array; } export namespace TestListResponse { + export interface _Meta { + /** + * The current page. + */ + page: number; + + /** + * The number of items per page. + */ + perPage: number; + + /** + * The total number of items. + */ + totalItems: number; + + /** + * The total number of pages. + */ + totalPages: number; + } + export interface Item { /** * The test id. From 8e2a33931654d6802087b6435a4beb2c6ed6d7e1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Apr 2025 10:21:58 +0000 Subject: [PATCH 37/48] feat(api): api update --- .stats.yml | 2 +- src/resources/commits/test-results.ts | 40 ++++- .../inference-pipelines/test-results.ts | 40 ++++- src/resources/projects/tests.ts | 144 ++++++++++++++---- 4 files changed, 191 insertions(+), 35 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1dee804..5c7a03f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,3 +1,3 @@ configured_endpoints: 17 -openapi_spec_hash: 8827ead72aa0c635ccafac5e008fe247 +openapi_spec_hash: 4f09f95fd31c148d1be80b7e643346ce config_hash: 087e6b8013c398a6d24031d24594fdec diff --git a/src/resources/commits/test-results.ts b/src/resources/commits/test-results.ts index 642f027..e8a5d7a 100644 --- a/src/resources/commits/test-results.ts +++ b/src/resources/commits/test-results.ts @@ -242,10 +242,46 @@ export namespace TestResultListResponse { /** * The insight name to be evaluated. */ - insightName?: string; + insightName?: + | 'characterLength' + | 'classImbalance' + | 'expectColumnAToBeInColumnB' + | 'columnAverage' + | 'columnDrift' + | 'columnValuesMatch' + | 'confidenceDistribution' + | 'conflictingLabelRowCount' + | 'containsPii' + | 'containsValidUrl' + | 'correlatedFeatures' + | 'customMetric' + | 'duplicateRowCount' + | 'emptyFeatures' + | 'featureDrift' + | 'featureProfile' + | 'greatExpectations' + | 'groupByColumnStatsCheck' + | 'illFormedRowCount' + | 'isCode' + | 'isJson' + | 'llmRubricV2' + | 'labelDrift' + | 'metrics' + | 'newCategories' + | 'newLabels' + | 'nullRowCount' + | 'ppScore' + | 'quasiConstantFeatures' + | 'sentenceLength' + | 'sizeRatio' + | 'specialCharacters' + | 'stringValidation' + | 'trainValLeakageRowCount'; /** - * The insight parameters. Required only for some test subtypes. + * The insight parameters. Required only for some test subtypes. For example, for + * tests that require a column name, the insight parameters will be [{'name': + * 'column_name', 'value': 'Age'}] */ insightParameters?: Array | null; diff --git a/src/resources/inference-pipelines/test-results.ts b/src/resources/inference-pipelines/test-results.ts index f23deba..2e852c6 100644 --- a/src/resources/inference-pipelines/test-results.ts +++ b/src/resources/inference-pipelines/test-results.ts @@ -242,10 +242,46 @@ export namespace TestResultListResponse { /** * The insight name to be evaluated. */ - insightName?: string; + insightName?: + | 'characterLength' + | 'classImbalance' + | 'expectColumnAToBeInColumnB' + | 'columnAverage' + | 'columnDrift' + | 'columnValuesMatch' + | 'confidenceDistribution' + | 'conflictingLabelRowCount' + | 'containsPii' + | 'containsValidUrl' + | 'correlatedFeatures' + | 'customMetric' + | 'duplicateRowCount' + | 'emptyFeatures' + | 'featureDrift' + | 'featureProfile' + | 'greatExpectations' + | 'groupByColumnStatsCheck' + | 'illFormedRowCount' + | 'isCode' + | 'isJson' + | 'llmRubricV2' + | 'labelDrift' + | 'metrics' + | 'newCategories' + | 'newLabels' + | 'nullRowCount' + | 'ppScore' + | 'quasiConstantFeatures' + | 'sentenceLength' + | 'sizeRatio' + | 'specialCharacters' + | 'stringValidation' + | 'trainValLeakageRowCount'; /** - * The insight parameters. Required only for some test subtypes. + * The insight parameters. Required only for some test subtypes. For example, for + * tests that require a column name, the insight parameters will be [{'name': + * 'column_name', 'value': 'Age'}] */ insightParameters?: Array | null; diff --git a/src/resources/projects/tests.ts b/src/resources/projects/tests.ts index 47e58bb..e50397e 100644 --- a/src/resources/projects/tests.ts +++ b/src/resources/projects/tests.ts @@ -193,10 +193,46 @@ export namespace TestCreateResponse { /** * The insight name to be evaluated. */ - insightName?: string; + insightName?: + | 'characterLength' + | 'classImbalance' + | 'expectColumnAToBeInColumnB' + | 'columnAverage' + | 'columnDrift' + | 'columnValuesMatch' + | 'confidenceDistribution' + | 'conflictingLabelRowCount' + | 'containsPii' + | 'containsValidUrl' + | 'correlatedFeatures' + | 'customMetric' + | 'duplicateRowCount' + | 'emptyFeatures' + | 'featureDrift' + | 'featureProfile' + | 'greatExpectations' + | 'groupByColumnStatsCheck' + | 'illFormedRowCount' + | 'isCode' + | 'isJson' + | 'llmRubricV2' + | 'labelDrift' + | 'metrics' + | 'newCategories' + | 'newLabels' + | 'nullRowCount' + | 'ppScore' + | 'quasiConstantFeatures' + | 'sentenceLength' + | 'sizeRatio' + | 'specialCharacters' + | 'stringValidation' + | 'trainValLeakageRowCount'; /** - * The insight parameters. Required only for some test subtypes. + * The insight parameters. Required only for some test subtypes. For example, for + * tests that require a column name, the insight parameters will be [{'name': + * 'column_name', 'value': 'Age'}] */ insightParameters?: Array | null; @@ -234,34 +270,10 @@ export namespace TestCreateResponse { } export interface TestListResponse { - _meta: TestListResponse._Meta; - items: Array; } export namespace TestListResponse { - export interface _Meta { - /** - * The current page. - */ - page: number; - - /** - * The number of items per page. - */ - perPage: number; - - /** - * The total number of items. - */ - totalItems: number; - - /** - * The total number of pages. - */ - totalPages: number; - } - export interface Item { /** * The test id. @@ -418,10 +430,46 @@ export namespace TestListResponse { /** * The insight name to be evaluated. */ - insightName?: string; + insightName?: + | 'characterLength' + | 'classImbalance' + | 'expectColumnAToBeInColumnB' + | 'columnAverage' + | 'columnDrift' + | 'columnValuesMatch' + | 'confidenceDistribution' + | 'conflictingLabelRowCount' + | 'containsPii' + | 'containsValidUrl' + | 'correlatedFeatures' + | 'customMetric' + | 'duplicateRowCount' + | 'emptyFeatures' + | 'featureDrift' + | 'featureProfile' + | 'greatExpectations' + | 'groupByColumnStatsCheck' + | 'illFormedRowCount' + | 'isCode' + | 'isJson' + | 'llmRubricV2' + | 'labelDrift' + | 'metrics' + | 'newCategories' + | 'newLabels' + | 'nullRowCount' + | 'ppScore' + | 'quasiConstantFeatures' + | 'sentenceLength' + | 'sizeRatio' + | 'specialCharacters' + | 'stringValidation' + | 'trainValLeakageRowCount'; /** - * The insight parameters. Required only for some test subtypes. + * The insight parameters. Required only for some test subtypes. For example, for + * tests that require a column name, the insight parameters will be [{'name': + * 'column_name', 'value': 'Age'}] */ insightParameters?: Array | null; @@ -570,10 +618,46 @@ export namespace TestCreateParams { /** * The insight name to be evaluated. */ - insightName?: string; + insightName?: + | 'characterLength' + | 'classImbalance' + | 'expectColumnAToBeInColumnB' + | 'columnAverage' + | 'columnDrift' + | 'columnValuesMatch' + | 'confidenceDistribution' + | 'conflictingLabelRowCount' + | 'containsPii' + | 'containsValidUrl' + | 'correlatedFeatures' + | 'customMetric' + | 'duplicateRowCount' + | 'emptyFeatures' + | 'featureDrift' + | 'featureProfile' + | 'greatExpectations' + | 'groupByColumnStatsCheck' + | 'illFormedRowCount' + | 'isCode' + | 'isJson' + | 'llmRubricV2' + | 'labelDrift' + | 'metrics' + | 'newCategories' + | 'newLabels' + | 'nullRowCount' + | 'ppScore' + | 'quasiConstantFeatures' + | 'sentenceLength' + | 'sizeRatio' + | 'specialCharacters' + | 'stringValidation' + | 'trainValLeakageRowCount'; /** - * The insight parameters. Required only for some test subtypes. + * The insight parameters. Required only for some test subtypes. For example, for + * tests that require a column name, the insight parameters will be [{'name': + * 'column_name', 'value': 'Age'}] */ insightParameters?: Array | null; From 785d3b4ba67f487b49c190d546ae4a7dc7eb333b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Apr 2025 10:22:33 +0000 Subject: [PATCH 38/48] feat(api): expose test update endpoint --- .stats.yml | 4 +- src/resources/commits/test-results.ts | 40 +---- .../inference-pipelines/test-results.ts | 40 +---- src/resources/projects/tests.ts | 144 ++++-------------- 4 files changed, 36 insertions(+), 192 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5c7a03f..4546c8a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,3 +1,3 @@ configured_endpoints: 17 -openapi_spec_hash: 4f09f95fd31c148d1be80b7e643346ce -config_hash: 087e6b8013c398a6d24031d24594fdec +openapi_spec_hash: 8827ead72aa0c635ccafac5e008fe247 +config_hash: 30422a4611d93ca69e4f1aff60b9ddb5 diff --git a/src/resources/commits/test-results.ts b/src/resources/commits/test-results.ts index e8a5d7a..642f027 100644 --- a/src/resources/commits/test-results.ts +++ b/src/resources/commits/test-results.ts @@ -242,46 +242,10 @@ export namespace TestResultListResponse { /** * The insight name to be evaluated. */ - insightName?: - | 'characterLength' - | 'classImbalance' - | 'expectColumnAToBeInColumnB' - | 'columnAverage' - | 'columnDrift' - | 'columnValuesMatch' - | 'confidenceDistribution' - | 'conflictingLabelRowCount' - | 'containsPii' - | 'containsValidUrl' - | 'correlatedFeatures' - | 'customMetric' - | 'duplicateRowCount' - | 'emptyFeatures' - | 'featureDrift' - | 'featureProfile' - | 'greatExpectations' - | 'groupByColumnStatsCheck' - | 'illFormedRowCount' - | 'isCode' - | 'isJson' - | 'llmRubricV2' - | 'labelDrift' - | 'metrics' - | 'newCategories' - | 'newLabels' - | 'nullRowCount' - | 'ppScore' - | 'quasiConstantFeatures' - | 'sentenceLength' - | 'sizeRatio' - | 'specialCharacters' - | 'stringValidation' - | 'trainValLeakageRowCount'; + insightName?: string; /** - * The insight parameters. Required only for some test subtypes. For example, for - * tests that require a column name, the insight parameters will be [{'name': - * 'column_name', 'value': 'Age'}] + * The insight parameters. Required only for some test subtypes. */ insightParameters?: Array | null; diff --git a/src/resources/inference-pipelines/test-results.ts b/src/resources/inference-pipelines/test-results.ts index 2e852c6..f23deba 100644 --- a/src/resources/inference-pipelines/test-results.ts +++ b/src/resources/inference-pipelines/test-results.ts @@ -242,46 +242,10 @@ export namespace TestResultListResponse { /** * The insight name to be evaluated. */ - insightName?: - | 'characterLength' - | 'classImbalance' - | 'expectColumnAToBeInColumnB' - | 'columnAverage' - | 'columnDrift' - | 'columnValuesMatch' - | 'confidenceDistribution' - | 'conflictingLabelRowCount' - | 'containsPii' - | 'containsValidUrl' - | 'correlatedFeatures' - | 'customMetric' - | 'duplicateRowCount' - | 'emptyFeatures' - | 'featureDrift' - | 'featureProfile' - | 'greatExpectations' - | 'groupByColumnStatsCheck' - | 'illFormedRowCount' - | 'isCode' - | 'isJson' - | 'llmRubricV2' - | 'labelDrift' - | 'metrics' - | 'newCategories' - | 'newLabels' - | 'nullRowCount' - | 'ppScore' - | 'quasiConstantFeatures' - | 'sentenceLength' - | 'sizeRatio' - | 'specialCharacters' - | 'stringValidation' - | 'trainValLeakageRowCount'; + insightName?: string; /** - * The insight parameters. Required only for some test subtypes. For example, for - * tests that require a column name, the insight parameters will be [{'name': - * 'column_name', 'value': 'Age'}] + * The insight parameters. Required only for some test subtypes. */ insightParameters?: Array | null; diff --git a/src/resources/projects/tests.ts b/src/resources/projects/tests.ts index e50397e..47e58bb 100644 --- a/src/resources/projects/tests.ts +++ b/src/resources/projects/tests.ts @@ -193,46 +193,10 @@ export namespace TestCreateResponse { /** * The insight name to be evaluated. */ - insightName?: - | 'characterLength' - | 'classImbalance' - | 'expectColumnAToBeInColumnB' - | 'columnAverage' - | 'columnDrift' - | 'columnValuesMatch' - | 'confidenceDistribution' - | 'conflictingLabelRowCount' - | 'containsPii' - | 'containsValidUrl' - | 'correlatedFeatures' - | 'customMetric' - | 'duplicateRowCount' - | 'emptyFeatures' - | 'featureDrift' - | 'featureProfile' - | 'greatExpectations' - | 'groupByColumnStatsCheck' - | 'illFormedRowCount' - | 'isCode' - | 'isJson' - | 'llmRubricV2' - | 'labelDrift' - | 'metrics' - | 'newCategories' - | 'newLabels' - | 'nullRowCount' - | 'ppScore' - | 'quasiConstantFeatures' - | 'sentenceLength' - | 'sizeRatio' - | 'specialCharacters' - | 'stringValidation' - | 'trainValLeakageRowCount'; + insightName?: string; /** - * The insight parameters. Required only for some test subtypes. For example, for - * tests that require a column name, the insight parameters will be [{'name': - * 'column_name', 'value': 'Age'}] + * The insight parameters. Required only for some test subtypes. */ insightParameters?: Array | null; @@ -270,10 +234,34 @@ export namespace TestCreateResponse { } export interface TestListResponse { + _meta: TestListResponse._Meta; + items: Array; } export namespace TestListResponse { + export interface _Meta { + /** + * The current page. + */ + page: number; + + /** + * The number of items per page. + */ + perPage: number; + + /** + * The total number of items. + */ + totalItems: number; + + /** + * The total number of pages. + */ + totalPages: number; + } + export interface Item { /** * The test id. @@ -430,46 +418,10 @@ export namespace TestListResponse { /** * The insight name to be evaluated. */ - insightName?: - | 'characterLength' - | 'classImbalance' - | 'expectColumnAToBeInColumnB' - | 'columnAverage' - | 'columnDrift' - | 'columnValuesMatch' - | 'confidenceDistribution' - | 'conflictingLabelRowCount' - | 'containsPii' - | 'containsValidUrl' - | 'correlatedFeatures' - | 'customMetric' - | 'duplicateRowCount' - | 'emptyFeatures' - | 'featureDrift' - | 'featureProfile' - | 'greatExpectations' - | 'groupByColumnStatsCheck' - | 'illFormedRowCount' - | 'isCode' - | 'isJson' - | 'llmRubricV2' - | 'labelDrift' - | 'metrics' - | 'newCategories' - | 'newLabels' - | 'nullRowCount' - | 'ppScore' - | 'quasiConstantFeatures' - | 'sentenceLength' - | 'sizeRatio' - | 'specialCharacters' - | 'stringValidation' - | 'trainValLeakageRowCount'; + insightName?: string; /** - * The insight parameters. Required only for some test subtypes. For example, for - * tests that require a column name, the insight parameters will be [{'name': - * 'column_name', 'value': 'Age'}] + * The insight parameters. Required only for some test subtypes. */ insightParameters?: Array | null; @@ -618,46 +570,10 @@ export namespace TestCreateParams { /** * The insight name to be evaluated. */ - insightName?: - | 'characterLength' - | 'classImbalance' - | 'expectColumnAToBeInColumnB' - | 'columnAverage' - | 'columnDrift' - | 'columnValuesMatch' - | 'confidenceDistribution' - | 'conflictingLabelRowCount' - | 'containsPii' - | 'containsValidUrl' - | 'correlatedFeatures' - | 'customMetric' - | 'duplicateRowCount' - | 'emptyFeatures' - | 'featureDrift' - | 'featureProfile' - | 'greatExpectations' - | 'groupByColumnStatsCheck' - | 'illFormedRowCount' - | 'isCode' - | 'isJson' - | 'llmRubricV2' - | 'labelDrift' - | 'metrics' - | 'newCategories' - | 'newLabels' - | 'nullRowCount' - | 'ppScore' - | 'quasiConstantFeatures' - | 'sentenceLength' - | 'sizeRatio' - | 'specialCharacters' - | 'stringValidation' - | 'trainValLeakageRowCount'; + insightName?: string; /** - * The insight parameters. Required only for some test subtypes. For example, for - * tests that require a column name, the insight parameters will be [{'name': - * 'column_name', 'value': 'Age'}] + * The insight parameters. Required only for some test subtypes. */ insightParameters?: Array | null; From 372b228b95947b7ccb8d6acc9a35eb7a20a31ef6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Apr 2025 10:38:11 +0000 Subject: [PATCH 39/48] feat(api): api update --- .stats.yml | 4 +- api.md | 2 + src/resources/commits/test-results.ts | 40 ++- .../inference-pipelines/test-results.ts | 40 ++- src/resources/projects/index.ts | 2 + src/resources/projects/projects.ts | 12 +- src/resources/projects/tests.ts | 273 ++++++++++++++++-- tests/api-resources/projects/tests.test.ts | 37 +++ 8 files changed, 373 insertions(+), 37 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4546c8a..0998013 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,3 +1,3 @@ -configured_endpoints: 17 -openapi_spec_hash: 8827ead72aa0c635ccafac5e008fe247 +configured_endpoints: 18 +openapi_spec_hash: 4f09f95fd31c148d1be80b7e643346ce config_hash: 30422a4611d93ca69e4f1aff60b9ddb5 diff --git a/api.md b/api.md index 53d1c3c..6de15d2 100644 --- a/api.md +++ b/api.md @@ -39,11 +39,13 @@ Methods: Types: - TestCreateResponse +- TestUpdateResponse - TestListResponse Methods: - client.projects.tests.create(projectId, { ...params }) -> TestCreateResponse +- client.projects.tests.update(projectId, { ...params }) -> TestUpdateResponse - client.projects.tests.list(projectId, { ...params }) -> TestListResponse # Commits diff --git a/src/resources/commits/test-results.ts b/src/resources/commits/test-results.ts index 642f027..e8a5d7a 100644 --- a/src/resources/commits/test-results.ts +++ b/src/resources/commits/test-results.ts @@ -242,10 +242,46 @@ export namespace TestResultListResponse { /** * The insight name to be evaluated. */ - insightName?: string; + insightName?: + | 'characterLength' + | 'classImbalance' + | 'expectColumnAToBeInColumnB' + | 'columnAverage' + | 'columnDrift' + | 'columnValuesMatch' + | 'confidenceDistribution' + | 'conflictingLabelRowCount' + | 'containsPii' + | 'containsValidUrl' + | 'correlatedFeatures' + | 'customMetric' + | 'duplicateRowCount' + | 'emptyFeatures' + | 'featureDrift' + | 'featureProfile' + | 'greatExpectations' + | 'groupByColumnStatsCheck' + | 'illFormedRowCount' + | 'isCode' + | 'isJson' + | 'llmRubricV2' + | 'labelDrift' + | 'metrics' + | 'newCategories' + | 'newLabels' + | 'nullRowCount' + | 'ppScore' + | 'quasiConstantFeatures' + | 'sentenceLength' + | 'sizeRatio' + | 'specialCharacters' + | 'stringValidation' + | 'trainValLeakageRowCount'; /** - * The insight parameters. Required only for some test subtypes. + * The insight parameters. Required only for some test subtypes. For example, for + * tests that require a column name, the insight parameters will be [{'name': + * 'column_name', 'value': 'Age'}] */ insightParameters?: Array | null; diff --git a/src/resources/inference-pipelines/test-results.ts b/src/resources/inference-pipelines/test-results.ts index f23deba..2e852c6 100644 --- a/src/resources/inference-pipelines/test-results.ts +++ b/src/resources/inference-pipelines/test-results.ts @@ -242,10 +242,46 @@ export namespace TestResultListResponse { /** * The insight name to be evaluated. */ - insightName?: string; + insightName?: + | 'characterLength' + | 'classImbalance' + | 'expectColumnAToBeInColumnB' + | 'columnAverage' + | 'columnDrift' + | 'columnValuesMatch' + | 'confidenceDistribution' + | 'conflictingLabelRowCount' + | 'containsPii' + | 'containsValidUrl' + | 'correlatedFeatures' + | 'customMetric' + | 'duplicateRowCount' + | 'emptyFeatures' + | 'featureDrift' + | 'featureProfile' + | 'greatExpectations' + | 'groupByColumnStatsCheck' + | 'illFormedRowCount' + | 'isCode' + | 'isJson' + | 'llmRubricV2' + | 'labelDrift' + | 'metrics' + | 'newCategories' + | 'newLabels' + | 'nullRowCount' + | 'ppScore' + | 'quasiConstantFeatures' + | 'sentenceLength' + | 'sizeRatio' + | 'specialCharacters' + | 'stringValidation' + | 'trainValLeakageRowCount'; /** - * The insight parameters. Required only for some test subtypes. + * The insight parameters. Required only for some test subtypes. For example, for + * tests that require a column name, the insight parameters will be [{'name': + * 'column_name', 'value': 'Age'}] */ insightParameters?: Array | null; diff --git a/src/resources/projects/index.ts b/src/resources/projects/index.ts index 2cef86c..c53d21e 100644 --- a/src/resources/projects/index.ts +++ b/src/resources/projects/index.ts @@ -24,7 +24,9 @@ export { export { Tests, type TestCreateResponse, + type TestUpdateResponse, type TestListResponse, type TestCreateParams, + type TestUpdateParams, type TestListParams, } from './tests'; diff --git a/src/resources/projects/projects.ts b/src/resources/projects/projects.ts index 9cb79dd..8591b63 100644 --- a/src/resources/projects/projects.ts +++ b/src/resources/projects/projects.ts @@ -20,7 +20,15 @@ import { InferencePipelines, } from './inference-pipelines'; import * as TestsAPI from './tests'; -import { TestCreateParams, TestCreateResponse, TestListParams, TestListResponse, Tests } from './tests'; +import { + TestCreateParams, + TestCreateResponse, + TestListParams, + TestListResponse, + TestUpdateParams, + TestUpdateResponse, + Tests, +} from './tests'; export class Projects extends APIResource { commits: CommitsAPI.Commits = new CommitsAPI.Commits(this._client); @@ -356,8 +364,10 @@ export declare namespace Projects { export { Tests as Tests, type TestCreateResponse as TestCreateResponse, + type TestUpdateResponse as TestUpdateResponse, type TestListResponse as TestListResponse, type TestCreateParams as TestCreateParams, + type TestUpdateParams as TestUpdateParams, type TestListParams as TestListParams, }; } diff --git a/src/resources/projects/tests.ts b/src/resources/projects/tests.ts index 47e58bb..c2caa83 100644 --- a/src/resources/projects/tests.ts +++ b/src/resources/projects/tests.ts @@ -16,6 +16,17 @@ export class Tests extends APIResource { return this._client.post(`/projects/${projectId}/tests`, { body, ...options }); } + /** + * Update tests. + */ + update( + projectId: string, + body: TestUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return this._client.put(`/projects/${projectId}/tests`, { body, ...options }); + } + /** * List tests under a project. */ @@ -193,10 +204,46 @@ export namespace TestCreateResponse { /** * The insight name to be evaluated. */ - insightName?: string; + insightName?: + | 'characterLength' + | 'classImbalance' + | 'expectColumnAToBeInColumnB' + | 'columnAverage' + | 'columnDrift' + | 'columnValuesMatch' + | 'confidenceDistribution' + | 'conflictingLabelRowCount' + | 'containsPii' + | 'containsValidUrl' + | 'correlatedFeatures' + | 'customMetric' + | 'duplicateRowCount' + | 'emptyFeatures' + | 'featureDrift' + | 'featureProfile' + | 'greatExpectations' + | 'groupByColumnStatsCheck' + | 'illFormedRowCount' + | 'isCode' + | 'isJson' + | 'llmRubricV2' + | 'labelDrift' + | 'metrics' + | 'newCategories' + | 'newLabels' + | 'nullRowCount' + | 'ppScore' + | 'quasiConstantFeatures' + | 'sentenceLength' + | 'sizeRatio' + | 'specialCharacters' + | 'stringValidation' + | 'trainValLeakageRowCount'; /** - * The insight parameters. Required only for some test subtypes. + * The insight parameters. Required only for some test subtypes. For example, for + * tests that require a column name, the insight parameters will be [{'name': + * 'column_name', 'value': 'Age'}] */ insightParameters?: Array | null; @@ -233,35 +280,17 @@ export namespace TestCreateResponse { } } -export interface TestListResponse { - _meta: TestListResponse._Meta; +export interface TestUpdateResponse { + taskResultId?: string; + + taskResultUrl?: string; +} +export interface TestListResponse { items: Array; } export namespace TestListResponse { - export interface _Meta { - /** - * The current page. - */ - page: number; - - /** - * The number of items per page. - */ - perPage: number; - - /** - * The total number of items. - */ - totalItems: number; - - /** - * The total number of pages. - */ - totalPages: number; - } - export interface Item { /** * The test id. @@ -418,10 +447,46 @@ export namespace TestListResponse { /** * The insight name to be evaluated. */ - insightName?: string; + insightName?: + | 'characterLength' + | 'classImbalance' + | 'expectColumnAToBeInColumnB' + | 'columnAverage' + | 'columnDrift' + | 'columnValuesMatch' + | 'confidenceDistribution' + | 'conflictingLabelRowCount' + | 'containsPii' + | 'containsValidUrl' + | 'correlatedFeatures' + | 'customMetric' + | 'duplicateRowCount' + | 'emptyFeatures' + | 'featureDrift' + | 'featureProfile' + | 'greatExpectations' + | 'groupByColumnStatsCheck' + | 'illFormedRowCount' + | 'isCode' + | 'isJson' + | 'llmRubricV2' + | 'labelDrift' + | 'metrics' + | 'newCategories' + | 'newLabels' + | 'nullRowCount' + | 'ppScore' + | 'quasiConstantFeatures' + | 'sentenceLength' + | 'sizeRatio' + | 'specialCharacters' + | 'stringValidation' + | 'trainValLeakageRowCount'; /** - * The insight parameters. Required only for some test subtypes. + * The insight parameters. Required only for some test subtypes. For example, for + * tests that require a column name, the insight parameters will be [{'name': + * 'column_name', 'value': 'Age'}] */ insightParameters?: Array | null; @@ -570,10 +635,46 @@ export namespace TestCreateParams { /** * The insight name to be evaluated. */ - insightName?: string; + insightName?: + | 'characterLength' + | 'classImbalance' + | 'expectColumnAToBeInColumnB' + | 'columnAverage' + | 'columnDrift' + | 'columnValuesMatch' + | 'confidenceDistribution' + | 'conflictingLabelRowCount' + | 'containsPii' + | 'containsValidUrl' + | 'correlatedFeatures' + | 'customMetric' + | 'duplicateRowCount' + | 'emptyFeatures' + | 'featureDrift' + | 'featureProfile' + | 'greatExpectations' + | 'groupByColumnStatsCheck' + | 'illFormedRowCount' + | 'isCode' + | 'isJson' + | 'llmRubricV2' + | 'labelDrift' + | 'metrics' + | 'newCategories' + | 'newLabels' + | 'nullRowCount' + | 'ppScore' + | 'quasiConstantFeatures' + | 'sentenceLength' + | 'sizeRatio' + | 'specialCharacters' + | 'stringValidation' + | 'trainValLeakageRowCount'; /** - * The insight parameters. Required only for some test subtypes. + * The insight parameters. Required only for some test subtypes. For example, for + * tests that require a column name, the insight parameters will be [{'name': + * 'column_name', 'value': 'Age'}] */ insightParameters?: Array | null; @@ -610,6 +711,116 @@ export namespace TestCreateParams { } } +export interface TestUpdateParams { + payloads: Array; +} + +export namespace TestUpdateParams { + export interface Payload { + id: string; + + /** + * Whether the test is archived. + */ + archived?: boolean; + + /** + * The test description. + */ + description?: unknown | null; + + /** + * The test name. + */ + name?: string; + + suggested?: false; + + thresholds?: Array; + } + + export namespace Payload { + export interface Threshold { + /** + * The insight name to be evaluated. + */ + insightName?: + | 'characterLength' + | 'classImbalance' + | 'expectColumnAToBeInColumnB' + | 'columnAverage' + | 'columnDrift' + | 'columnValuesMatch' + | 'confidenceDistribution' + | 'conflictingLabelRowCount' + | 'containsPii' + | 'containsValidUrl' + | 'correlatedFeatures' + | 'customMetric' + | 'duplicateRowCount' + | 'emptyFeatures' + | 'featureDrift' + | 'featureProfile' + | 'greatExpectations' + | 'groupByColumnStatsCheck' + | 'illFormedRowCount' + | 'isCode' + | 'isJson' + | 'llmRubricV2' + | 'labelDrift' + | 'metrics' + | 'newCategories' + | 'newLabels' + | 'nullRowCount' + | 'ppScore' + | 'quasiConstantFeatures' + | 'sentenceLength' + | 'sizeRatio' + | 'specialCharacters' + | 'stringValidation' + | 'trainValLeakageRowCount'; + + /** + * The insight parameters. Required only for some test subtypes. For example, for + * tests that require a column name, the insight parameters will be [{'name': + * 'column_name', 'value': 'Age'}] + */ + insightParameters?: Array | null; + + /** + * The measurement to be evaluated. + */ + measurement?: string; + + /** + * The operator to be used for the evaluation. + */ + operator?: 'is' | '>' | '>=' | '<' | '<=' | '!='; + + /** + * Whether to use automatic anomaly detection or manual thresholds + */ + thresholdMode?: 'automatic' | 'manual'; + + /** + * The value to be compared. + */ + value?: number | boolean | string | Array; + } + + export namespace Threshold { + export interface InsightParameter { + /** + * The name of the insight filter. + */ + name: string; + + value: unknown; + } + } + } +} + export interface TestListParams { /** * Filter for archived tests. @@ -651,8 +862,10 @@ export interface TestListParams { export declare namespace Tests { export { type TestCreateResponse as TestCreateResponse, + type TestUpdateResponse as TestUpdateResponse, type TestListResponse as TestListResponse, type TestCreateParams as TestCreateParams, + type TestUpdateParams as TestUpdateParams, type TestListParams as TestListParams, }; } diff --git a/tests/api-resources/projects/tests.test.ts b/tests/api-resources/projects/tests.test.ts index acdab7a..9a6c452 100644 --- a/tests/api-resources/projects/tests.test.ts +++ b/tests/api-resources/projects/tests.test.ts @@ -53,6 +53,43 @@ describe('resource tests', () => { }); }); + test('update: only required params', async () => { + const responsePromise = client.projects.tests.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { + payloads: [{ id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }], + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('update: required and optional params', async () => { + const response = await client.projects.tests.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { + payloads: [ + { + id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + archived: false, + description: 'This test checks for duplicate rows in the dataset.', + name: 'No duplicate rows', + suggested: false, + thresholds: [ + { + insightName: 'duplicateRowCount', + insightParameters: [{ name: 'column_name', value: 'Age' }], + measurement: 'duplicateRowCount', + operator: '<=', + thresholdMode: 'automatic', + value: 0, + }, + ], + }, + ], + }); + }); + test('list', async () => { const responsePromise = client.projects.tests.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); const rawResponse = await responsePromise.asResponse(); From 5cdece05db99ab1e97526c6b7590ce645746201b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Apr 2025 11:31:57 +0000 Subject: [PATCH 40/48] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 0998013..2b09528 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,3 +1,3 @@ configured_endpoints: 18 -openapi_spec_hash: 4f09f95fd31c148d1be80b7e643346ce +openapi_spec_hash: 20f058101a252f7500803d66aff58eb3 config_hash: 30422a4611d93ca69e4f1aff60b9ddb5 From 3461fd6e7a989064ef94b9e1d0c8d26374116aa4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 1 May 2025 02:41:26 +0000 Subject: [PATCH 41/48] docs(readme): fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c58157a..f6b1ed4 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,7 @@ async function main() { main(); ``` -Error codes are as followed: +Error codes are as follows: | Status Code | Error Type | | ----------- | -------------------------- | From e1c612061c9dceffc20cb78c03bcdea4e466c559 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 2 May 2025 02:28:57 +0000 Subject: [PATCH 42/48] chore(internal): codegen related update --- .github/workflows/create-releases.yml | 41 +++++++++++++++++++++++++++ .github/workflows/publish-npm.yml | 8 ++---- .github/workflows/release-doctor.yml | 1 + 3 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/create-releases.yml diff --git a/.github/workflows/create-releases.yml b/.github/workflows/create-releases.yml new file mode 100644 index 0000000..d820b50 --- /dev/null +++ b/.github/workflows/create-releases.yml @@ -0,0 +1,41 @@ +name: Create releases +on: + schedule: + - cron: '0 5 * * *' # every day at 5am UTC + push: + branches: + - main + +jobs: + release: + name: release + if: github.ref == 'refs/heads/main' && github.repository == 'openlayer-ai/openlayer-ts' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: stainless-api/trigger-release-please@v1 + id: release + with: + repo: ${{ github.event.repository.full_name }} + stainless-api-key: ${{ secrets.STAINLESS_API_KEY }} + + - name: Set up Node + if: ${{ steps.release.outputs.releases_created }} + uses: actions/setup-node@v3 + with: + node-version: '18' + + - name: Install dependencies + if: ${{ steps.release.outputs.releases_created }} + run: | + yarn install + + - name: Publish to NPM + if: ${{ steps.release.outputs.releases_created }} + run: | + bash ./bin/publish-npm + env: + NPM_TOKEN: ${{ secrets.OPENLAYER_NPM_TOKEN || secrets.NPM_TOKEN }} + diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 361a64a..405e769 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -1,13 +1,9 @@ -# 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/openlayer-ai/openlayer-ts/actions/workflows/publish-npm.yml +# workflow for re-running publishing to NPM in case it fails for some reason +# you can run this workflow by navigating to https://www.github.com/openlayer-ai/openlayer-ts/actions/workflows/publish-npm.yml name: Publish NPM on: workflow_dispatch: - release: - types: [published] - jobs: publish: name: publish diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index f021d93..fe63f8c 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -18,5 +18,6 @@ jobs: run: | bash ./bin/check-release-environment env: + STAINLESS_API_KEY: ${{ secrets.STAINLESS_API_KEY }} NPM_TOKEN: ${{ secrets.OPENLAYER_NPM_TOKEN || secrets.NPM_TOKEN }} From fc5eda10a988522c2304c3f7a8f1890db0f42a23 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 7 May 2025 03:16:57 +0000 Subject: [PATCH 43/48] chore(ci): bump node version for release workflows --- .github/workflows/create-releases.yml | 2 +- .github/workflows/publish-npm.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/create-releases.yml b/.github/workflows/create-releases.yml index d820b50..79e6b4d 100644 --- a/.github/workflows/create-releases.yml +++ b/.github/workflows/create-releases.yml @@ -25,7 +25,7 @@ jobs: if: ${{ steps.release.outputs.releases_created }} uses: actions/setup-node@v3 with: - node-version: '18' + node-version: '20' - name: Install dependencies if: ${{ steps.release.outputs.releases_created }} diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 405e769..ea1e82c 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -15,7 +15,7 @@ jobs: - name: Set up Node uses: actions/setup-node@v3 with: - node-version: '18' + node-version: '20' - name: Install dependencies run: | From 8b8c71e6186135f9ecef0fcb00518946b05ddf71 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 7 May 2025 03:20:09 +0000 Subject: [PATCH 44/48] docs: add examples to tsdocs --- src/resources/inference-pipelines/data.ts | 20 +++++++++++ .../inference-pipelines.ts | 23 +++++++++++++ src/resources/inference-pipelines/rows.ts | 8 +++++ .../inference-pipelines/test-results.ts | 8 +++++ src/resources/projects/commits.ts | 18 ++++++++++ src/resources/projects/inference-pipelines.ts | 20 +++++++++++ src/resources/projects/projects.ts | 13 +++++++ src/resources/projects/tests.ts | 34 +++++++++++++++++++ 8 files changed, 144 insertions(+) diff --git a/src/resources/inference-pipelines/data.ts b/src/resources/inference-pipelines/data.ts index d2009c3..0922eb3 100644 --- a/src/resources/inference-pipelines/data.ts +++ b/src/resources/inference-pipelines/data.ts @@ -6,6 +6,26 @@ import * as Core from '../../core'; export class Data extends APIResource { /** * Publish an inference data point to an inference pipeline. + * + * @example + * ```ts + * const response = + * await client.inferencePipelines.data.stream( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { + * config: { outputColumnName: 'output' }, + * rows: [ + * { + * user_query: 'bar', + * output: 'bar', + * tokens: 'bar', + * cost: 'bar', + * timestamp: 'bar', + * }, + * ], + * }, + * ); + * ``` */ stream( inferencePipelineId: string, diff --git a/src/resources/inference-pipelines/inference-pipelines.ts b/src/resources/inference-pipelines/inference-pipelines.ts index 4e5b1c8..d50a161 100644 --- a/src/resources/inference-pipelines/inference-pipelines.ts +++ b/src/resources/inference-pipelines/inference-pipelines.ts @@ -17,6 +17,14 @@ export class InferencePipelines extends APIResource { /** * Retrieve inference pipeline. + * + * @example + * ```ts + * const inferencePipeline = + * await client.inferencePipelines.retrieve( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * ); + * ``` */ retrieve( inferencePipelineId: string, @@ -40,6 +48,14 @@ export class InferencePipelines extends APIResource { /** * Update inference pipeline. + * + * @example + * ```ts + * const inferencePipeline = + * await client.inferencePipelines.update( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * ); + * ``` */ update( inferencePipelineId: string, @@ -63,6 +79,13 @@ export class InferencePipelines extends APIResource { /** * Delete inference pipeline. + * + * @example + * ```ts + * await client.inferencePipelines.delete( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * ); + * ``` */ delete(inferencePipelineId: string, options?: Core.RequestOptions): Core.APIPromise { return this._client.delete(`/inference-pipelines/${inferencePipelineId}`, { diff --git a/src/resources/inference-pipelines/rows.ts b/src/resources/inference-pipelines/rows.ts index b959d41..6aebd28 100644 --- a/src/resources/inference-pipelines/rows.ts +++ b/src/resources/inference-pipelines/rows.ts @@ -6,6 +6,14 @@ import * as Core from '../../core'; export class Rows extends APIResource { /** * Update an inference data point in an inference pipeline. + * + * @example + * ```ts + * const row = await client.inferencePipelines.rows.update( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { inferenceId: 'inferenceId', row: {} }, + * ); + * ``` */ update( inferencePipelineId: string, diff --git a/src/resources/inference-pipelines/test-results.ts b/src/resources/inference-pipelines/test-results.ts index 2e852c6..fad5c0f 100644 --- a/src/resources/inference-pipelines/test-results.ts +++ b/src/resources/inference-pipelines/test-results.ts @@ -7,6 +7,14 @@ import * as Core from '../../core'; export class TestResults extends APIResource { /** * List the latest test results for an inference pipeline. + * + * @example + * ```ts + * const testResults = + * await client.inferencePipelines.testResults.list( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * ); + * ``` */ list( inferencePipelineId: string, diff --git a/src/resources/projects/commits.ts b/src/resources/projects/commits.ts index 8736852..cacf749 100644 --- a/src/resources/projects/commits.ts +++ b/src/resources/projects/commits.ts @@ -7,6 +7,17 @@ import * as Core from '../../core'; export class Commits extends APIResource { /** * Create a new commit (project version) in a project. + * + * @example + * ```ts + * const commit = await client.projects.commits.create( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { + * commit: { message: 'Updated the prompt.' }, + * storageUri: 's3://...', + * }, + * ); + * ``` */ create( projectId: string, @@ -18,6 +29,13 @@ export class Commits extends APIResource { /** * List the commits (project versions) in a project. + * + * @example + * ```ts + * const commits = await client.projects.commits.list( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * ); + * ``` */ list( projectId: string, diff --git a/src/resources/projects/inference-pipelines.ts b/src/resources/projects/inference-pipelines.ts index eed6c61..b46c7af 100644 --- a/src/resources/projects/inference-pipelines.ts +++ b/src/resources/projects/inference-pipelines.ts @@ -7,6 +7,18 @@ import * as Core from '../../core'; export class InferencePipelines extends APIResource { /** * Create an inference pipeline in a project. + * + * @example + * ```ts + * const inferencePipeline = + * await client.projects.inferencePipelines.create( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { + * description: 'This pipeline is used for production.', + * name: 'production', + * }, + * ); + * ``` */ create( projectId: string, @@ -18,6 +30,14 @@ export class InferencePipelines extends APIResource { /** * List the inference pipelines in a project. + * + * @example + * ```ts + * const inferencePipelines = + * await client.projects.inferencePipelines.list( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * ); + * ``` */ list( projectId: string, diff --git a/src/resources/projects/projects.ts b/src/resources/projects/projects.ts index 8591b63..15428f6 100644 --- a/src/resources/projects/projects.ts +++ b/src/resources/projects/projects.ts @@ -39,6 +39,14 @@ export class Projects extends APIResource { /** * Create a project in your workspace. + * + * @example + * ```ts + * const project = await client.projects.create({ + * name: 'My Project', + * taskType: 'llm-base', + * }); + * ``` */ create(body: ProjectCreateParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post('/projects', { body, ...options }); @@ -46,6 +54,11 @@ export class Projects extends APIResource { /** * List your workspace's projects. + * + * @example + * ```ts + * const projects = await client.projects.list(); + * ``` */ list(query?: ProjectListParams, options?: Core.RequestOptions): Core.APIPromise; list(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/projects/tests.ts b/src/resources/projects/tests.ts index c2caa83..a50048b 100644 --- a/src/resources/projects/tests.ts +++ b/src/resources/projects/tests.ts @@ -7,6 +7,21 @@ import * as Core from '../../core'; export class Tests extends APIResource { /** * Create a test. + * + * @example + * ```ts + * const test = await client.projects.tests.create( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { + * description: + * 'This test checks for duplicate rows in the dataset.', + * name: 'No duplicate rows', + * subtype: 'duplicateRowCount', + * thresholds: [{}], + * type: 'integrity', + * }, + * ); + * ``` */ create( projectId: string, @@ -18,6 +33,18 @@ export class Tests extends APIResource { /** * Update tests. + * + * @example + * ```ts + * const test = await client.projects.tests.update( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { + * payloads: [ + * { id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }, + * ], + * }, + * ); + * ``` */ update( projectId: string, @@ -29,6 +56,13 @@ export class Tests extends APIResource { /** * List tests under a project. + * + * @example + * ```ts + * const tests = await client.projects.tests.list( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * ); + * ``` */ list( projectId: string, From 08863b80cb9f578fada7d596b0013f76f9d80f4e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 9 May 2025 03:00:20 +0000 Subject: [PATCH 45/48] chore(internal): codegen related update --- .github/workflows/create-releases.yml | 41 --------------------------- .github/workflows/publish-npm.yml | 8 ++++-- .github/workflows/release-doctor.yml | 1 - bin/check-release-environment | 4 --- 4 files changed, 6 insertions(+), 48 deletions(-) delete mode 100644 .github/workflows/create-releases.yml diff --git a/.github/workflows/create-releases.yml b/.github/workflows/create-releases.yml deleted file mode 100644 index 79e6b4d..0000000 --- a/.github/workflows/create-releases.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Create releases -on: - schedule: - - cron: '0 5 * * *' # every day at 5am UTC - push: - branches: - - main - -jobs: - release: - name: release - if: github.ref == 'refs/heads/main' && github.repository == 'openlayer-ai/openlayer-ts' - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - uses: stainless-api/trigger-release-please@v1 - id: release - with: - repo: ${{ github.event.repository.full_name }} - stainless-api-key: ${{ secrets.STAINLESS_API_KEY }} - - - name: Set up Node - if: ${{ steps.release.outputs.releases_created }} - uses: actions/setup-node@v3 - with: - node-version: '20' - - - name: Install dependencies - if: ${{ steps.release.outputs.releases_created }} - run: | - yarn install - - - name: Publish to NPM - if: ${{ steps.release.outputs.releases_created }} - run: | - bash ./bin/publish-npm - env: - NPM_TOKEN: ${{ secrets.OPENLAYER_NPM_TOKEN || secrets.NPM_TOKEN }} - diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index ea1e82c..85aedac 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -1,9 +1,13 @@ -# workflow for re-running publishing to NPM in case it fails for some reason -# you can run this workflow by navigating to https://www.github.com/openlayer-ai/openlayer-ts/actions/workflows/publish-npm.yml +# 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/openlayer-ai/openlayer-ts/actions/workflows/publish-npm.yml name: Publish NPM on: workflow_dispatch: + release: + types: [published] + jobs: publish: name: publish diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index fe63f8c..f021d93 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -18,6 +18,5 @@ jobs: run: | bash ./bin/check-release-environment env: - STAINLESS_API_KEY: ${{ secrets.STAINLESS_API_KEY }} NPM_TOKEN: ${{ secrets.OPENLAYER_NPM_TOKEN || secrets.NPM_TOKEN }} diff --git a/bin/check-release-environment b/bin/check-release-environment index 5da9dd7..0f4fafe 100644 --- a/bin/check-release-environment +++ b/bin/check-release-environment @@ -2,10 +2,6 @@ errors=() -if [ -z "${STAINLESS_API_KEY}" ]; then - errors+=("The STAINLESS_API_KEY secret has not been set. Please contact Stainless for an API key & set it in your organization secrets on GitHub.") -fi - if [ -z "${NPM_TOKEN}" ]; then errors+=("The OPENLAYER_NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets") fi From 1f62b551d8afd5b4fa17595b13df6765c8cc5c94 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 22 May 2025 02:31:27 +0000 Subject: [PATCH 46/48] chore(docs): grammar improvements --- SECURITY.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index 8614b05..dc108d0 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -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 Openlayer please follow the respective company's security reporting guidelines. +or products provided by Openlayer, please follow the respective company's security reporting guidelines. ### Openlayer Terms and Policies -Please contact support@openlayer.com for any questions or concerns regarding security of our services. +Please contact support@openlayer.com for any questions or concerns regarding the security of our services. --- From baabb5fbba3cf1f689dbadafc6cc027030603460 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 28 May 2025 03:39:39 +0000 Subject: [PATCH 47/48] chore: improve publish-npm script --latest tag logic --- bin/publish-npm | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/bin/publish-npm b/bin/publish-npm index 4c21181..2505dec 100644 --- a/bin/publish-npm +++ b/bin/publish-npm @@ -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 From 871c4ef3440374c134c9d934af3af2b23470271c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 28 May 2025 03:40:28 +0000 Subject: [PATCH 48/48] release: 0.13.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 60 +++++++++++++++++++++++++++++++++++ package.json | 2 +- src/version.ts | 2 +- 4 files changed, 63 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 8032c17..ed21d28 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.12.0" + ".": "0.13.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b97fbb..1b204ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,65 @@ # Changelog +## 0.13.0 (2025-05-28) + +Full Changelog: [v0.12.0...v0.13.0](https://github.com/openlayer-ai/openlayer-ts/compare/v0.12.0...v0.13.0) + +### Features + +* **api:** add test creation endpoint ([b7cc1b1](https://github.com/openlayer-ai/openlayer-ts/commit/b7cc1b1ee12af1275addac7057d735fb02a43af1)) +* **api:** api update ([372b228](https://github.com/openlayer-ai/openlayer-ts/commit/372b228b95947b7ccb8d6acc9a35eb7a20a31ef6)) +* **api:** api update ([8e2a339](https://github.com/openlayer-ai/openlayer-ts/commit/8e2a33931654d6802087b6435a4beb2c6ed6d7e1)) +* **api:** api update ([2e0a6e1](https://github.com/openlayer-ai/openlayer-ts/commit/2e0a6e1b6a5b3296a3ec905dfa11b5a8501e4583)) +* **api:** api update ([821a692](https://github.com/openlayer-ai/openlayer-ts/commit/821a6926192dad0532029ea9c2b22a4d24f5e1c6)) +* **api:** api update ([28f4085](https://github.com/openlayer-ai/openlayer-ts/commit/28f40851950cfa354930fc8dfab69b4a39f3d13e)) +* **api:** api update ([3345b62](https://github.com/openlayer-ai/openlayer-ts/commit/3345b629c1904bfb2c2f9e05c86312c6c7b88b48)) +* **api:** expose test retrieval endpoint ([da2b9fb](https://github.com/openlayer-ai/openlayer-ts/commit/da2b9fb62bd0eeaebe1325abaee6e4854d2f987f)) +* **api:** expose test retrieval endpoint ([f3fd3fc](https://github.com/openlayer-ai/openlayer-ts/commit/f3fd3fc296af8982eeb965c3427b89abdb7a4a6f)) +* **api:** expose test update endpoint ([785d3b4](https://github.com/openlayer-ai/openlayer-ts/commit/785d3b4ba67f487b49c190d546ae4a7dc7eb333b)) +* **client:** send `X-Stainless-Timeout` header ([333edef](https://github.com/openlayer-ai/openlayer-ts/commit/333edef002f95acecdb29d3e6a698343c3361937)) + + +### Bug Fixes + +* **api:** improve type resolution when importing as a package ([#119](https://github.com/openlayer-ai/openlayer-ts/issues/119)) ([669c259](https://github.com/openlayer-ai/openlayer-ts/commit/669c259b9fa3ba40ace9901ba24fa80dbc205105)) +* avoid type error in certain environments ([#115](https://github.com/openlayer-ai/openlayer-ts/issues/115)) ([701091f](https://github.com/openlayer-ai/openlayer-ts/commit/701091ff829ca7b7f6ee3bf66af961b660eb3371)) +* **client:** fix export map for index exports ([ac3dffc](https://github.com/openlayer-ai/openlayer-ts/commit/ac3dffce4624d350d5cf73e3020067cb2f71ab59)) +* **client:** send `X-Stainless-Timeout` in seconds ([#117](https://github.com/openlayer-ai/openlayer-ts/issues/117)) ([b8469f3](https://github.com/openlayer-ai/openlayer-ts/commit/b8469f3c2fc46916d994fb20b6ff4550a1c2bed3)) +* **internal:** work around https://github.com/vercel/next.js/issues/76881 ([#116](https://github.com/openlayer-ai/openlayer-ts/issues/116)) ([2349019](https://github.com/openlayer-ai/openlayer-ts/commit/2349019081867529df94ff1143716ce865a30007)) +* **mcp:** remove unused tools.ts ([#120](https://github.com/openlayer-ai/openlayer-ts/issues/120)) ([9d9ab9b](https://github.com/openlayer-ai/openlayer-ts/commit/9d9ab9bd791a42fc4269ad0fcd1dbb57f8616e67)) + + +### Chores + +* **ci:** add timeout thresholds for CI jobs ([64632ad](https://github.com/openlayer-ai/openlayer-ts/commit/64632ad55c30e27a0ca063c28b410d6b83b245b4)) +* **ci:** bump node version for release workflows ([fc5eda1](https://github.com/openlayer-ai/openlayer-ts/commit/fc5eda10a988522c2304c3f7a8f1890db0f42a23)) +* **ci:** only use depot for staging repos ([9c8f4b9](https://github.com/openlayer-ai/openlayer-ts/commit/9c8f4b9181f636898c5ff8365596b47c591575f1)) +* **client:** minor internal fixes ([344120f](https://github.com/openlayer-ai/openlayer-ts/commit/344120f8eb82ea1e374aafadf6c7e90edec2cbce)) +* **docs:** grammar improvements ([1f62b55](https://github.com/openlayer-ai/openlayer-ts/commit/1f62b551d8afd5b4fa17595b13df6765c8cc5c94)) +* **exports:** cleaner resource index imports ([#113](https://github.com/openlayer-ai/openlayer-ts/issues/113)) ([9ac3180](https://github.com/openlayer-ai/openlayer-ts/commit/9ac318013fd2128e7f0a98db699534569c8e18a3)) +* **exports:** stop using path fallbacks ([#114](https://github.com/openlayer-ai/openlayer-ts/issues/114)) ([fdcd6e2](https://github.com/openlayer-ai/openlayer-ts/commit/fdcd6e2effcd89201604c545e0c3b8f0f0800032)) +* improve publish-npm script --latest tag logic ([baabb5f](https://github.com/openlayer-ai/openlayer-ts/commit/baabb5fbba3cf1f689dbadafc6cc027030603460)) +* **internal:** add aliases for Record and Array ([#118](https://github.com/openlayer-ai/openlayer-ts/issues/118)) ([da4702c](https://github.com/openlayer-ai/openlayer-ts/commit/da4702cab36298cc7278a3f0a797742c5e23a002)) +* **internal:** codegen related update ([08863b8](https://github.com/openlayer-ai/openlayer-ts/commit/08863b80cb9f578fada7d596b0013f76f9d80f4e)) +* **internal:** codegen related update ([e1c6120](https://github.com/openlayer-ai/openlayer-ts/commit/e1c612061c9dceffc20cb78c03bcdea4e466c559)) +* **internal:** codegen related update ([1128c8f](https://github.com/openlayer-ai/openlayer-ts/commit/1128c8f19942ebfecc014626f859dfdadc5725d1)) +* **internal:** codegen related update ([1016df6](https://github.com/openlayer-ai/openlayer-ts/commit/1016df6f549fd3312c26f6ecfd15b3aac58c5d65)) +* **internal:** codegen related update ([ca17307](https://github.com/openlayer-ai/openlayer-ts/commit/ca173073bc522424d9d6a35b5a2af14ccd7b8c88)) +* **internal:** codegen related update ([fd5d0a9](https://github.com/openlayer-ai/openlayer-ts/commit/fd5d0a9808b2abf8d1b88d3becf2350d9b25887e)) +* **internal:** fix devcontainers setup ([6a459de](https://github.com/openlayer-ai/openlayer-ts/commit/6a459de24ebec36ba38b751b6ab7143b3b9e16fd)) +* **internal:** fix workflows ([59a7cb4](https://github.com/openlayer-ai/openlayer-ts/commit/59a7cb4439a344c0ed6b4adb9e6b113dbed0f940)) +* **internal:** reduce CI branch coverage ([71998ef](https://github.com/openlayer-ai/openlayer-ts/commit/71998ef9132f29569e40aa1310cf2b3611096865)) +* **internal:** upload builds and expand CI branch coverage ([5d8ec66](https://github.com/openlayer-ai/openlayer-ts/commit/5d8ec66ad5ca7ba34da7b56b5f2aa1e9638107cd)) +* **internal:** version bump ([3a31790](https://github.com/openlayer-ai/openlayer-ts/commit/3a317902d8bf523f3f54398cdb077a11a18d9995)) +* **tests:** improve enum examples ([#121](https://github.com/openlayer-ai/openlayer-ts/issues/121)) ([f3a00ab](https://github.com/openlayer-ai/openlayer-ts/commit/f3a00ab15a42239fc71459feb324bd835f5d79e9)) + + +### Documentation + +* add examples to tsdocs ([8b8c71e](https://github.com/openlayer-ai/openlayer-ts/commit/8b8c71e6186135f9ecef0fcb00518946b05ddf71)) +* **readme:** fix typo ([3461fd6](https://github.com/openlayer-ai/openlayer-ts/commit/3461fd6e7a989064ef94b9e1d0c8d26374116aa4)) +* update URLs from stainlessapi.com to stainless.com ([e56ef04](https://github.com/openlayer-ai/openlayer-ts/commit/e56ef04346aa002b8481a8018ad540c678a9a21e)) + ## 0.12.0 (2025-03-14) Full Changelog: [v0.11.0...v0.12.0](https://github.com/openlayer-ai/openlayer-ts/compare/v0.11.0...v0.12.0) diff --git a/package.json b/package.json index 13eefa3..b6df9a9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openlayer", - "version": "0.12.0", + "version": "0.13.0", "description": "The official TypeScript library for the Openlayer API", "author": "Openlayer ", "types": "dist/index.d.ts", diff --git a/src/version.ts b/src/version.ts index ce6b899..9d013cc 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.12.0'; // x-release-please-version +export const VERSION = '0.13.0'; // x-release-please-version