Skip to content

Commit

Permalink
chore(internal): minor reformatting (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Jun 25, 2024
1 parent 1fada3b commit 1a7b1c3
Show file tree
Hide file tree
Showing 25 changed files with 34 additions and 34 deletions.
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 './core';
import * as Pagination from './pagination';
import * as API from './resources/index';

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

/** API Client for interfacing with the Orb API. */
/**
* API Client for interfacing with the Orb API.
*/
export class Orb extends Core.APIClient {
apiKey: string;
webhookSecret: string | null;
Expand Down Expand Up @@ -122,6 +124,7 @@ export class Orb extends Core.APIClient {
maxRetries: options.maxRetries,
fetch: options.fetch,
});

this._options = options;
this.idempotencyHeader = 'Idempotency-Key';

Expand Down
2 changes: 1 addition & 1 deletion src/resources/alerts.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 AlertsAPI from './alerts';
import { Page, type PageParams } from '../pagination';

Expand Down
2 changes: 1 addition & 1 deletion src/resources/coupons/coupons.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 CouponsAPI from './coupons';
import * as SubscriptionsAPI from './subscriptions';
import { Page, type PageParams } from '../../pagination';
Expand Down
2 changes: 1 addition & 1 deletion src/resources/coupons/subscriptions.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 CouponsSubscriptionsAPI from './subscriptions';
import * as SubscriptionsAPI from '../subscriptions';
import { SubscriptionsPage } from '../subscriptions';
Expand Down
2 changes: 1 addition & 1 deletion src/resources/credit-notes.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 CreditNotesAPI from './credit-notes';
import { Page, type PageParams } from '../pagination';

Expand Down
2 changes: 1 addition & 1 deletion src/resources/customers/balance-transactions.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 BalanceTransactionsAPI from './balance-transactions';
import { Page, type PageParams } from '../../pagination';

Expand Down
2 changes: 1 addition & 1 deletion src/resources/customers/costs.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 CostsAPI from './costs';
import * as PricesAPI from '../prices/prices';

Expand Down
2 changes: 1 addition & 1 deletion src/resources/customers/credits/credits.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 CreditsAPI from './credits';
import * as LedgerAPI from './ledger';
import * as TopUpsAPI from './top-ups';
Expand Down
2 changes: 1 addition & 1 deletion src/resources/customers/credits/ledger.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 LedgerAPI from './ledger';
import { Page, type PageParams } from '../../../pagination';

Expand Down
2 changes: 1 addition & 1 deletion src/resources/customers/credits/top-ups.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 TopUpsAPI from './top-ups';
import { Page, type PageParams } from '../../../pagination';

Expand Down
2 changes: 1 addition & 1 deletion src/resources/customers/customers.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 CustomersAPI from './customers';
import * as BalanceTransactionsAPI from './balance-transactions';
import * as CostsAPI from './costs';
Expand Down
2 changes: 1 addition & 1 deletion src/resources/customers/usage.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 UsageAPI from './usage';

export class Usage extends APIResource {
Expand Down
2 changes: 1 addition & 1 deletion src/resources/events/backfills.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 BackfillsAPI from './backfills';
import { Page, type PageParams } from '../../pagination';

Expand Down
2 changes: 1 addition & 1 deletion src/resources/events/events.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 EventsAPI from './events';
import * as BackfillsAPI from './backfills';

Expand Down
2 changes: 1 addition & 1 deletion src/resources/invoice-line-items.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 InvoiceLineItemsAPI from './invoice-line-items';
import * as Shared from './shared';
import * as PricesAPI from './prices/prices';
Expand Down
2 changes: 1 addition & 1 deletion src/resources/invoices.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 InvoicesAPI from './invoices';
import * as Shared from './shared';
import * as PricesAPI from './prices/prices';
Expand Down
2 changes: 1 addition & 1 deletion src/resources/items.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 ItemsAPI from './items';
import { Page, type PageParams } from '../pagination';

Expand Down
2 changes: 1 addition & 1 deletion src/resources/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 '../core';
import { APIResource } from '../resource';
import { isRequestOptions } from '../core';
import * as Core from '../core';
import * as MetricsAPI from './metrics';
import * as ItemsAPI from './items';
import { Page, type PageParams } from '../pagination';
Expand Down
2 changes: 1 addition & 1 deletion src/resources/plans/external-plan-id.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 ExternalPlanIDAPI from './external-plan-id';
import * as PlansAPI from './plans';

Expand Down
2 changes: 1 addition & 1 deletion src/resources/plans/plans.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 PlansAPI from './plans';
import * as Shared from '../shared';
import * as ExternalPlanIDAPI from './external-plan-id';
Expand Down
2 changes: 1 addition & 1 deletion src/resources/prices/external-price-id.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 PricesAPI from './prices';

export class ExternalPriceID extends APIResource {
Expand Down
2 changes: 1 addition & 1 deletion src/resources/prices/prices.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 PricesAPI from './prices';
import * as Shared from '../shared';
import * as ExternalPriceIDAPI from './external-price-id';
Expand Down
2 changes: 1 addition & 1 deletion src/resources/subscriptions.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 SubscriptionsAPI from './subscriptions';
import * as Shared from './shared';
import * as CustomersAPI from './customers/customers';
Expand Down
2 changes: 1 addition & 1 deletion src/resources/top-level.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 TopLevelAPI from './top-level';

export class TopLevel extends APIResource {
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 'orb-billing/core';
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

const { stringifyQuery } = APIClient.prototype as any;
import { Orb } from 'orb-billing';

describe('APIClient.stringifyQuery', () => {
const { stringifyQuery } = Orb.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}`);
});
}
});

0 comments on commit 1a7b1c3

Please sign in to comment.