Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

chore(internal): minor reformatting #435

Merged
merged 1 commit into from
Jun 25, 2024
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,10 +1,10 @@
// 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 qs from 'qs';
import * as Core from '@mux/mux-node/core';
import * as Pagination from '@mux/mux-node/pagination';
import * as API from '@mux/mux-node/resources/index';

Expand Down Expand Up @@ -91,7 +91,9 @@ export interface ClientOptions {
defaultQuery?: Core.DefaultQuery;
}

/** API Client for interfacing with the Mux API. */
/**
* API Client for interfacing with the Mux API.
*/
export class Mux extends Core.APIClient {
tokenId: string;
tokenSecret: string;
Expand Down Expand Up @@ -154,6 +156,7 @@ export class Mux extends Core.APIClient {
maxRetries: options.maxRetries,
fetch: options.fetch,
});

this._options = options;

this.tokenId = tokenId;
Expand Down
2 changes: 1 addition & 1 deletion src/resources/data/dimensions.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 '@mux/mux-node/core';
import { APIResource } from '@mux/mux-node/resource';
import { isRequestOptions } from '@mux/mux-node/core';
import * as Core from '@mux/mux-node/core';
import * as DimensionsAPI from '@mux/mux-node/resources/data/dimensions';
import { BasePage, type BasePageParams } from '@mux/mux-node/pagination';

Expand Down
2 changes: 1 addition & 1 deletion src/resources/data/errors.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 '@mux/mux-node/core';
import { APIResource } from '@mux/mux-node/resource';
import { isRequestOptions } from '@mux/mux-node/core';
import * as Core from '@mux/mux-node/core';
import * as ErrorsAPI from '@mux/mux-node/resources/data/errors';

export class Errors extends APIResource {
Expand Down
2 changes: 1 addition & 1 deletion src/resources/data/exports.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 '@mux/mux-node/core';
import { APIResource } from '@mux/mux-node/resource';
import * as Core from '@mux/mux-node/core';
import * as ExportsAPI from '@mux/mux-node/resources/data/exports';

export class Exports extends APIResource {
Expand Down
2 changes: 1 addition & 1 deletion src/resources/data/filters.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 '@mux/mux-node/core';
import { APIResource } from '@mux/mux-node/resource';
import { isRequestOptions } from '@mux/mux-node/core';
import * as Core from '@mux/mux-node/core';
import * as FiltersAPI from '@mux/mux-node/resources/data/filters';
import { BasePage, type BasePageParams } from '@mux/mux-node/pagination';

Expand Down
2 changes: 1 addition & 1 deletion src/resources/data/incidents.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 '@mux/mux-node/core';
import { APIResource } from '@mux/mux-node/resource';
import { isRequestOptions } from '@mux/mux-node/core';
import * as Core from '@mux/mux-node/core';
import * as IncidentsAPI from '@mux/mux-node/resources/data/incidents';
import { BasePage, type BasePageParams } from '@mux/mux-node/pagination';

Expand Down
2 changes: 1 addition & 1 deletion src/resources/data/metrics.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 '@mux/mux-node/core';
import { APIResource } from '@mux/mux-node/resource';
import { isRequestOptions } from '@mux/mux-node/core';
import * as Core from '@mux/mux-node/core';
import * as MetricsAPI from '@mux/mux-node/resources/data/metrics';
import { BasePage, type BasePageParams } from '@mux/mux-node/pagination';

Expand Down
2 changes: 1 addition & 1 deletion src/resources/data/monitoring/metrics.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 '@mux/mux-node/core';
import { APIResource } from '@mux/mux-node/resource';
import { isRequestOptions } from '@mux/mux-node/core';
import * as Core from '@mux/mux-node/core';
import * as MetricsAPI from '@mux/mux-node/resources/data/monitoring/metrics';

export class Metrics extends APIResource {
Expand Down
2 changes: 1 addition & 1 deletion src/resources/data/monitoring/monitoring.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 '@mux/mux-node/core';
import { APIResource } from '@mux/mux-node/resource';
import * as Core from '@mux/mux-node/core';
import * as MonitoringAPI from '@mux/mux-node/resources/data/monitoring/monitoring';
import * as MetricsAPI from '@mux/mux-node/resources/data/monitoring/metrics';

Expand Down
2 changes: 1 addition & 1 deletion src/resources/data/real-time.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 '@mux/mux-node/core';
import { APIResource } from '@mux/mux-node/resource';
import { isRequestOptions } from '@mux/mux-node/core';
import * as Core from '@mux/mux-node/core';
import * as RealTimeAPI from '@mux/mux-node/resources/data/real-time';

export class RealTime extends APIResource {
Expand Down
2 changes: 1 addition & 1 deletion src/resources/data/video-views.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 '@mux/mux-node/core';
import { APIResource } from '@mux/mux-node/resource';
import { isRequestOptions } from '@mux/mux-node/core';
import * as Core from '@mux/mux-node/core';
import * as VideoViewsAPI from '@mux/mux-node/resources/data/video-views';
import { BasePage, type BasePageParams } from '@mux/mux-node/pagination';

Expand Down
2 changes: 1 addition & 1 deletion src/resources/system/signing-keys.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 '@mux/mux-node/core';
import { APIResource } from '@mux/mux-node/resource';
import { isRequestOptions } from '@mux/mux-node/core';
import * as Core from '@mux/mux-node/core';
import * as SigningKeysAPI from '@mux/mux-node/resources/system/signing-keys';
import { BasePage, type BasePageParams } from '@mux/mux-node/pagination';

Expand Down
2 changes: 1 addition & 1 deletion src/resources/video/assets.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 '@mux/mux-node/core';
import { APIResource } from '@mux/mux-node/resource';
import { isRequestOptions } from '@mux/mux-node/core';
import * as Core from '@mux/mux-node/core';
import * as AssetsAPI from '@mux/mux-node/resources/video/assets';
import * as Shared from '@mux/mux-node/resources/shared';
import { BasePage, type BasePageParams } from '@mux/mux-node/pagination';
Expand Down
2 changes: 1 addition & 1 deletion src/resources/video/delivery-usage.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 '@mux/mux-node/core';
import { APIResource } from '@mux/mux-node/resource';
import { isRequestOptions } from '@mux/mux-node/core';
import * as Core from '@mux/mux-node/core';
import * as DeliveryUsageAPI from '@mux/mux-node/resources/video/delivery-usage';
import { PageWithTotal, type PageWithTotalParams } from '@mux/mux-node/pagination';

Expand Down
2 changes: 1 addition & 1 deletion src/resources/video/drm-configurations.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 '@mux/mux-node/core';
import { APIResource } from '@mux/mux-node/resource';
import { isRequestOptions } from '@mux/mux-node/core';
import * as Core from '@mux/mux-node/core';
import * as DRMConfigurationsAPI from '@mux/mux-node/resources/video/drm-configurations';
import { BasePage, type BasePageParams } from '@mux/mux-node/pagination';

Expand Down
2 changes: 1 addition & 1 deletion src/resources/video/live-streams.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 '@mux/mux-node/core';
import { APIResource } from '@mux/mux-node/resource';
import { isRequestOptions } from '@mux/mux-node/core';
import * as Core from '@mux/mux-node/core';
import * as LiveStreamsAPI from '@mux/mux-node/resources/video/live-streams';
import * as Shared from '@mux/mux-node/resources/shared';
import * as AssetsAPI from '@mux/mux-node/resources/video/assets';
Expand Down
2 changes: 1 addition & 1 deletion src/resources/video/playback-ids.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 '@mux/mux-node/core';
import { APIResource } from '@mux/mux-node/resource';
import * as Core from '@mux/mux-node/core';
import * as PlaybackIDsAPI from '@mux/mux-node/resources/video/playback-ids';
import * as Shared from '@mux/mux-node/resources/shared';

Expand Down
2 changes: 1 addition & 1 deletion src/resources/video/playback-restrictions.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 '@mux/mux-node/core';
import { APIResource } from '@mux/mux-node/resource';
import { isRequestOptions } from '@mux/mux-node/core';
import * as Core from '@mux/mux-node/core';
import * as PlaybackRestrictionsAPI from '@mux/mux-node/resources/video/playback-restrictions';
import { BasePage, type BasePageParams } from '@mux/mux-node/pagination';

Expand Down
2 changes: 1 addition & 1 deletion src/resources/video/spaces.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 '@mux/mux-node/core';
import { APIResource } from '@mux/mux-node/resource';
import { isRequestOptions } from '@mux/mux-node/core';
import * as Core from '@mux/mux-node/core';
import * as SpacesAPI from '@mux/mux-node/resources/video/spaces';
import { BasePage, type BasePageParams } from '@mux/mux-node/pagination';

Expand Down
2 changes: 1 addition & 1 deletion src/resources/video/transcription-vocabularies.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 '@mux/mux-node/core';
import { APIResource } from '@mux/mux-node/resource';
import { isRequestOptions } from '@mux/mux-node/core';
import * as Core from '@mux/mux-node/core';
import * as TranscriptionVocabulariesAPI from '@mux/mux-node/resources/video/transcription-vocabularies';
import { BasePage, type BasePageParams } from '@mux/mux-node/pagination';

Expand Down
2 changes: 1 addition & 1 deletion src/resources/video/uploads.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 '@mux/mux-node/core';
import { APIResource } from '@mux/mux-node/resource';
import { isRequestOptions } from '@mux/mux-node/core';
import * as Core from '@mux/mux-node/core';
import * as UploadsAPI from '@mux/mux-node/resources/video/uploads';
import * as AssetsAPI from '@mux/mux-node/resources/video/assets';
import { BasePage, type BasePageParams } from '@mux/mux-node/pagination';
Expand Down
2 changes: 1 addition & 1 deletion src/resources/video/web-inputs.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 '@mux/mux-node/core';
import { APIResource } from '@mux/mux-node/resource';
import { isRequestOptions } from '@mux/mux-node/core';
import * as Core from '@mux/mux-node/core';
import * as WebInputsAPI from '@mux/mux-node/resources/video/web-inputs';
import { BasePage, type BasePageParams } from '@mux/mux-node/pagination';

Expand Down
13 changes: 5 additions & 8 deletions tests/stringifyQuery.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { APIClient } from '@mux/mux-node/core';
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

const { stringifyQuery } = APIClient.prototype as any;
import { Mux } from '@mux/mux-node';

describe('APIClient.stringifyQuery', () => {
const { stringifyQuery } = Mux.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,9 +20,4 @@ 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}`);
});
}
});