Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -105,6 +107,7 @@ export class Openlayer extends Core.APIClient {
maxRetries: options.maxRetries,
fetch: options.fetch,
});

this._options = options;

this.apiKey = apiKey;
Expand Down
2 changes: 1 addition & 1 deletion src/resources/commits/test-results.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/resources/inference-pipelines/data.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/resources/inference-pipelines/test-results.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/resources/projects/commits.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/resources/projects/inference-pipelines.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/resources/projects/projects.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
9 changes: 6 additions & 3 deletions tests/stringifyQuery.test.ts
Original file line number Diff line number Diff line change
@@ -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'],
Expand All @@ -18,6 +20,7 @@ describe('APIClient.stringifyQuery', () => {
expect(stringifyQuery(input)).toEqual(expected);
});
}

for (const value of [[], {}, new Date()]) {
it(`${JSON.stringify(value)} -> <error>`, () => {
expect(() => stringifyQuery({ value })).toThrow(`Cannot stringify type ${typeof value}`);
Expand Down