diff --git a/src/index.ts b/src/index.ts index 251c9dca..337bc83a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from './core'; import * as Errors from './error'; -import { type Agent } from './_shims/index'; import * as Uploads from './uploads'; +import { type Agent } from './_shims/index'; +import * as Core from './core'; import * as API from './resources/index'; export interface ClientOptions { @@ -69,7 +69,9 @@ export interface ClientOptions { defaultQuery?: Core.DefaultQuery; } -/** API Client for interfacing with the Openlayer API. */ +/** + * API Client for interfacing with the Openlayer API. + */ export class Openlayer extends Core.APIClient { apiKey: string | null; @@ -105,6 +107,7 @@ export class Openlayer extends Core.APIClient { maxRetries: options.maxRetries, fetch: options.fetch, }); + this._options = options; this.apiKey = apiKey; diff --git a/src/resources/commits/test-results.ts b/src/resources/commits/test-results.ts index 3916a459..d2b57740 100644 --- a/src/resources/commits/test-results.ts +++ b/src/resources/commits/test-results.ts @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from '../../core'; import { APIResource } from '../../resource'; import { isRequestOptions } from '../../core'; +import * as Core from '../../core'; import * as TestResultsAPI from './test-results'; export class TestResults extends APIResource { diff --git a/src/resources/inference-pipelines/data.ts b/src/resources/inference-pipelines/data.ts index 841215cf..ffcb6e7d 100644 --- a/src/resources/inference-pipelines/data.ts +++ b/src/resources/inference-pipelines/data.ts @@ -1,7 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from '../../core'; import { APIResource } from '../../resource'; +import * as Core from '../../core'; import * as DataAPI from './data'; export class Data extends APIResource { diff --git a/src/resources/inference-pipelines/test-results.ts b/src/resources/inference-pipelines/test-results.ts index 0a612bf9..a8dd505a 100644 --- a/src/resources/inference-pipelines/test-results.ts +++ b/src/resources/inference-pipelines/test-results.ts @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from '../../core'; import { APIResource } from '../../resource'; import { isRequestOptions } from '../../core'; +import * as Core from '../../core'; import * as TestResultsAPI from './test-results'; export class TestResults extends APIResource { diff --git a/src/resources/projects/commits.ts b/src/resources/projects/commits.ts index 3761b1af..fa18df33 100644 --- a/src/resources/projects/commits.ts +++ b/src/resources/projects/commits.ts @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from '../../core'; import { APIResource } from '../../resource'; import { isRequestOptions } from '../../core'; +import * as Core from '../../core'; import * as CommitsAPI from './commits'; export class Commits extends APIResource { diff --git a/src/resources/projects/inference-pipelines.ts b/src/resources/projects/inference-pipelines.ts index 88c73173..1fa533f4 100644 --- a/src/resources/projects/inference-pipelines.ts +++ b/src/resources/projects/inference-pipelines.ts @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from '../../core'; import { APIResource } from '../../resource'; import { isRequestOptions } from '../../core'; +import * as Core from '../../core'; import * as InferencePipelinesAPI from './inference-pipelines'; export class InferencePipelines extends APIResource { diff --git a/src/resources/projects/projects.ts b/src/resources/projects/projects.ts index bca37062..95e43d75 100644 --- a/src/resources/projects/projects.ts +++ b/src/resources/projects/projects.ts @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from '../../core'; import { APIResource } from '../../resource'; import { isRequestOptions } from '../../core'; +import * as Core from '../../core'; import * as ProjectsAPI from './projects'; import * as CommitsAPI from './commits'; import * as InferencePipelinesAPI from './inference-pipelines'; diff --git a/tests/stringifyQuery.test.ts b/tests/stringifyQuery.test.ts index df367be6..ad216be2 100644 --- a/tests/stringifyQuery.test.ts +++ b/tests/stringifyQuery.test.ts @@ -1,8 +1,10 @@ -import { APIClient } from 'openlayer/core'; +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -const { stringifyQuery } = APIClient.prototype as any; +import { Openlayer } from 'openlayer'; -describe('APIClient.stringifyQuery', () => { +const { stringifyQuery } = Openlayer.prototype as any; + +describe(stringifyQuery, () => { for (const [input, expected] of [ [{ a: '1', b: 2, c: true }, 'a=1&b=2&c=true'], [{ a: null, b: false, c: undefined }, 'a=&b=false'], @@ -18,6 +20,7 @@ describe('APIClient.stringifyQuery', () => { expect(stringifyQuery(input)).toEqual(expected); }); } + for (const value of [[], {}, new Date()]) { it(`${JSON.stringify(value)} -> `, () => { expect(() => stringifyQuery({ value })).toThrow(`Cannot stringify type ${typeof value}`);