Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

orb-billing

Package Overview
Dependencies
Maintainers
2
Versions
94
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

orb-billing - npm Package Compare versions

Comparing version 1.27.0 to 1.28.0

14

CHANGELOG.md
# Changelog
## 1.28.0 (2023-11-16)
Full Changelog: [v1.27.0...v1.28.0](https://github.com/orbcorp/orb-node/compare/v1.27.0...v1.28.0)
### Features
* **api:** updates ([#33](https://github.com/orbcorp/orb-node/issues/33)) ([5e82f4c](https://github.com/orbcorp/orb-node/commit/5e82f4c7df7b492122884c590a3f0fc9c8572a37))
### Chores
* **internal:** update APIResource structure ([#32](https://github.com/orbcorp/orb-node/issues/32)) ([27b274a](https://github.com/orbcorp/orb-node/commit/27b274a8629933d77ec4ef1829f4f42c2a28617b))
* **internal:** update jest config ([#30](https://github.com/orbcorp/orb-node/issues/30)) ([bb4611b](https://github.com/orbcorp/orb-node/commit/bb4611bbf3f5f6ef18be0c080585de881f9354d3))
## 1.27.0 (2023-11-09)

@@ -4,0 +18,0 @@

10

core.d.ts

@@ -129,12 +129,2 @@

}
export declare class APIResource {
protected client: APIClient;
constructor(client: APIClient);
protected get: APIClient['get'];
protected post: APIClient['post'];
protected patch: APIClient['patch'];
protected put: APIClient['put'];
protected delete: APIClient['delete'];
protected getAPIList: APIClient['getAPIList'];
}
export type PageInfo = {

@@ -141,0 +131,0 @@ url: URL;

14

core.js

@@ -15,3 +15,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.toBase64 = exports.getRequiredHeader = exports.isHeadersProtocol = exports.isRunningInBrowser = exports.debug = exports.hasOwn = exports.isEmptyObj = exports.maybeCoerceBoolean = exports.maybeCoerceFloat = exports.maybeCoerceInteger = exports.coerceBoolean = exports.coerceFloat = exports.coerceInteger = exports.readEnv = exports.ensurePresent = exports.castToError = exports.sleep = exports.safeJSON = exports.isRequestOptions = exports.createResponseHeaders = exports.PagePromise = exports.AbstractPage = exports.APIResource = exports.APIClient = exports.APIPromise = exports.createForm = exports.multipartFormRequestOptions = exports.maybeMultipartFormRequestOptions = void 0;
exports.toBase64 = exports.getRequiredHeader = exports.isHeadersProtocol = exports.isRunningInBrowser = exports.debug = exports.hasOwn = exports.isEmptyObj = exports.maybeCoerceBoolean = exports.maybeCoerceFloat = exports.maybeCoerceInteger = exports.coerceBoolean = exports.coerceFloat = exports.coerceInteger = exports.readEnv = exports.ensurePresent = exports.castToError = exports.sleep = exports.safeJSON = exports.isRequestOptions = exports.createResponseHeaders = exports.PagePromise = exports.AbstractPage = exports.APIClient = exports.APIPromise = exports.createForm = exports.multipartFormRequestOptions = exports.maybeMultipartFormRequestOptions = void 0;
const version_1 = require("./version.js");

@@ -397,14 +397,2 @@ const error_1 = require("./error.js");

exports.APIClient = APIClient;
class APIResource {
constructor(client) {
this.client = client;
this.get = client.get.bind(client);
this.post = client.post.bind(client);
this.patch = client.patch.bind(client);
this.put = client.put.bind(client);
this.delete = client.delete.bind(client);
this.getAPIList = client.getAPIList.bind(client);
}
}
exports.APIResource = APIResource;
class AbstractPage {

@@ -411,0 +399,0 @@ constructor(client, response, body, options) {

{
"name": "orb-billing",
"version": "1.27.0",
"version": "1.28.0",
"description": "Client library for the Orb API",

@@ -5,0 +5,0 @@ "author": "Orb <team@withorb.com>",

import type { Orb } from "./index.js";
export declare class APIResource {
protected client: Orb;
protected _client: Orb;
constructor(client: Orb);
protected get: Orb['get'];
protected post: Orb['post'];
protected patch: Orb['patch'];
protected put: Orb['put'];
protected delete: Orb['delete'];
protected getAPIList: Orb['getAPIList'];
}
//# sourceMappingURL=resource.d.ts.map

@@ -7,9 +7,3 @@ "use strict";

constructor(client) {
this.client = client;
this.get = client.get.bind(client);
this.post = client.post.bind(client);
this.patch = client.patch.bind(client);
this.put = client.put.bind(client);
this.delete = client.delete.bind(client);
this.getAPIList = client.getAPIList.bind(client);
this._client = client;
}

@@ -16,0 +10,0 @@ }

@@ -36,3 +36,3 @@ "use strict";

super(...arguments);
this.subscriptions = new SubscriptionsAPI.Subscriptions(this.client);
this.subscriptions = new SubscriptionsAPI.Subscriptions(this._client);
}

@@ -44,3 +44,3 @@ /**

create(body, options) {
return this.post('/coupons', { body, ...options });
return this._client.post('/coupons', { body, ...options });
}

@@ -51,3 +51,3 @@ list(query = {}, options) {

}
return this.getAPIList('/coupons', CouponsPage, { query, ...options });
return this._client.getAPIList('/coupons', CouponsPage, { query, ...options });
}

@@ -60,3 +60,3 @@ /**

archive(couponId, options) {
return this.post(`/coupons/${couponId}/archive`, options);
return this._client.post(`/coupons/${couponId}/archive`, options);
}

@@ -69,3 +69,3 @@ /**

fetch(couponId, options) {
return this.get(`/coupons/${couponId}`, options);
return this._client.get(`/coupons/${couponId}`, options);
}

@@ -72,0 +72,0 @@ }

@@ -14,3 +14,6 @@ "use strict";

}
return this.getAPIList(`/coupons/${couponId}/subscriptions`, subscriptions_1.SubscriptionsPage, { query, ...options });
return this._client.getAPIList(`/coupons/${couponId}/subscriptions`, subscriptions_1.SubscriptionsPage, {
query,
...options,
});
}

@@ -17,0 +20,0 @@ }

@@ -37,3 +37,3 @@ "use strict";

}
return this.getAPIList('/credit_notes', CreditNotesPage, { query, ...options });
return this._client.getAPIList('/credit_notes', CreditNotesPage, { query, ...options });
}

@@ -45,3 +45,3 @@ /**

fetch(creditNoteId, options) {
return this.get(`/credit_notes/${creditNoteId}`, options);
return this._client.get(`/credit_notes/${creditNoteId}`, options);
}

@@ -48,0 +48,0 @@ }

@@ -38,3 +38,3 @@ "use strict";

create(customerId, body, options) {
return this.post(`/customers/${customerId}/balance_transactions`, { body, ...options });
return this._client.post(`/customers/${customerId}/balance_transactions`, { body, ...options });
}

@@ -45,3 +45,3 @@ list(customerId, query = {}, options) {

}
return this.getAPIList(`/customers/${customerId}/balance_transactions`, BalanceTransactionListResponsesPage, { query, ...options });
return this._client.getAPIList(`/customers/${customerId}/balance_transactions`, BalanceTransactionListResponsesPage, { query, ...options });
}

@@ -48,0 +48,0 @@ }

@@ -12,3 +12,3 @@ "use strict";

}
return this.get(`/customers/${customerId}/costs`, { query, ...options });
return this._client.get(`/customers/${customerId}/costs`, { query, ...options });
}

@@ -19,3 +19,6 @@ listByExternalId(externalCustomerId, query = {}, options) {

}
return this.get(`/customers/external_customer_id/${externalCustomerId}/costs`, { query, ...options });
return this._client.get(`/customers/external_customer_id/${externalCustomerId}/costs`, {
query,
...options,
});
}

@@ -22,0 +25,0 @@ }

@@ -36,3 +36,3 @@ "use strict";

super(...arguments);
this.ledger = new LedgerAPI.Ledger(this.client);
this.ledger = new LedgerAPI.Ledger(this._client);
}

@@ -43,3 +43,3 @@ list(customerId, query = {}, options) {

}
return this.getAPIList(`/customers/${customerId}/credits`, CreditListResponsesPage, {
return this._client.getAPIList(`/customers/${customerId}/credits`, CreditListResponsesPage, {
query,

@@ -53,3 +53,3 @@ ...options,

}
return this.getAPIList(`/customers/external_customer_id/${externalCustomerId}/credits`, CreditListByExternalIDResponsesPage, { query, ...options });
return this._client.getAPIList(`/customers/external_customer_id/${externalCustomerId}/credits`, CreditListByExternalIDResponsesPage, { query, ...options });
}

@@ -56,0 +56,0 @@ }

@@ -37,3 +37,3 @@ "use strict";

}
return this.getAPIList(`/customers/${customerId}/credits/ledger`, LedgerListResponsesPage, {
return this._client.getAPIList(`/customers/${customerId}/credits/ledger`, LedgerListResponsesPage, {
query,

@@ -155,3 +155,3 @@ ...options,

createEntry(customerId, body, options) {
return this.post(`/customers/${customerId}/credits/ledger_entry`, { body, ...options });
return this._client.post(`/customers/${customerId}/credits/ledger_entry`, { body, ...options });
}

@@ -270,3 +270,3 @@ /**

createEntryByExternalId(externalCustomerId, body, options) {
return this.post(`/customers/external_customer_id/${externalCustomerId}/credits/ledger_entry`, {
return this._client.post(`/customers/external_customer_id/${externalCustomerId}/credits/ledger_entry`, {
body,

@@ -280,3 +280,3 @@ ...options,

}
return this.getAPIList(`/customers/external_customer_id/${externalCustomerId}/credits/ledger`, LedgerListByExternalIDResponsesPage, { query, ...options });
return this._client.getAPIList(`/customers/external_customer_id/${externalCustomerId}/credits/ledger`, LedgerListByExternalIDResponsesPage, { query, ...options });
}

@@ -283,0 +283,0 @@ }

@@ -39,6 +39,6 @@ "use strict";

super(...arguments);
this.costs = new CostsAPI.Costs(this.client);
this.usage = new UsageAPI.Usage(this.client);
this.credits = new CreditsAPI.Credits(this.client);
this.balanceTransactions = new BalanceTransactionsAPI.BalanceTransactions(this.client);
this.costs = new CostsAPI.Costs(this._client);
this.usage = new UsageAPI.Usage(this._client);
this.credits = new CreditsAPI.Credits(this._client);
this.balanceTransactions = new BalanceTransactionsAPI.BalanceTransactions(this._client);
}

@@ -60,3 +60,3 @@ /**

create(body, options) {
return this.post('/customers', { body, ...options });
return this._client.post('/customers', { body, ...options });
}

@@ -67,3 +67,3 @@ update(customerId, body = {}, options) {

}
return this.put(`/customers/${customerId}`, { body, ...options });
return this._client.put(`/customers/${customerId}`, { body, ...options });
}

@@ -74,3 +74,3 @@ list(query = {}, options) {

}
return this.getAPIList('/customers', CustomersPage, { query, ...options });
return this._client.getAPIList('/customers', CustomersPage, { query, ...options });
}

@@ -91,4 +91,4 @@ /**

*/
del(customerId, options) {
return this.delete(`/customers/${customerId}`, {
delete(customerId, options) {
return this._client.delete(`/customers/${customerId}`, {
...options,

@@ -107,3 +107,3 @@ headers: { Accept: '', ...options?.headers },

fetch(customerId, options) {
return this.get(`/customers/${customerId}`, options);
return this._client.get(`/customers/${customerId}`, options);
}

@@ -118,3 +118,3 @@ /**

fetchByExternalId(externalCustomerId, options) {
return this.get(`/customers/external_customer_id/${externalCustomerId}`, options);
return this._client.get(`/customers/external_customer_id/${externalCustomerId}`, options);
}

@@ -125,3 +125,3 @@ updateByExternalId(id, body = {}, options) {

}
return this.put(`/customers/external_customer_id/${id}`, { body, ...options });
return this._client.put(`/customers/external_customer_id/${id}`, { body, ...options });
}

@@ -128,0 +128,0 @@ }

@@ -107,3 +107,3 @@ "use strict";

const { timeframe_end, timeframe_start, ...body } = params;
return this.patch(`/customers/${id}/usage`, {
return this._client.patch(`/customers/${id}/usage`, {
query: { timeframe_end, timeframe_start },

@@ -214,3 +214,3 @@ body,

const { timeframe_end, timeframe_start, ...body } = params;
return this.patch(`/customers/external_customer_id/${id}/usage`, {
return this._client.patch(`/customers/external_customer_id/${id}/usage`, {
query: { timeframe_end, timeframe_start },

@@ -217,0 +217,0 @@ body,

@@ -61,3 +61,3 @@ "use strict";

create(body, options) {
return this.post('/events/backfills', { body, ...options });
return this._client.post('/events/backfills', { body, ...options });
}

@@ -68,3 +68,3 @@ list(query = {}, options) {

}
return this.getAPIList('/events/backfills', BackfillListResponsesPage, { query, ...options });
return this._client.getAPIList('/events/backfills', BackfillListResponsesPage, { query, ...options });
}

@@ -78,3 +78,3 @@ /**

close(backfillId, options) {
return this.post(`/events/backfills/${backfillId}/close`, options);
return this._client.post(`/events/backfills/${backfillId}/close`, options);
}

@@ -85,3 +85,3 @@ /**

fetch(backfillId, options) {
return this.get(`/events/backfills/${backfillId}`, options);
return this._client.get(`/events/backfills/${backfillId}`, options);
}

@@ -98,3 +98,3 @@ /**

revert(backfillId, options) {
return this.post(`/events/backfills/${backfillId}/revert`, options);
return this._client.post(`/events/backfills/${backfillId}/revert`, options);
}

@@ -101,0 +101,0 @@ }

@@ -33,3 +33,3 @@ "use strict";

super(...arguments);
this.backfills = new BackfillsAPI.Backfills(this.client);
this.backfills = new BackfillsAPI.Backfills(this._client);
}

@@ -82,3 +82,3 @@ /**

update(eventId, body, options) {
return this.put(`/events/${eventId}`, { body, ...options });
return this._client.put(`/events/${eventId}`, { body, ...options });
}

@@ -125,3 +125,3 @@ /**

deprecate(eventId, options) {
return this.put(`/events/${eventId}/deprecate`, options);
return this._client.put(`/events/${eventId}/deprecate`, options);
}

@@ -330,3 +330,3 @@ /**

const { backfill_id, debug, ...body } = params;
return this.post('/ingest', { query: { backfill_id, debug }, body, ...options });
return this._client.post('/ingest', { query: { backfill_id, debug }, body, ...options });
}

@@ -353,3 +353,3 @@ /**

search(body, options) {
return this.post('/events/search', { body, ...options });
return this._client.post('/events/search', { body, ...options });
}

@@ -356,0 +356,0 @@ }

@@ -12,3 +12,3 @@ "use strict";

create(body, options) {
return this.post('/invoice_line_items', { body, ...options });
return this._client.post('/invoice_line_items', { body, ...options });
}

@@ -15,0 +15,0 @@ }

@@ -37,3 +37,3 @@ "use strict";

create(body, options) {
return this.post('/invoices', { body, ...options });
return this._client.post('/invoices', { body, ...options });
}

@@ -44,3 +44,3 @@ list(query = {}, options) {

}
return this.getAPIList('/invoices', InvoicesPage, { query, ...options });
return this._client.getAPIList('/invoices', InvoicesPage, { query, ...options });
}

@@ -52,3 +52,3 @@ /**

fetch(invoiceId, options) {
return this.get(`/invoices/${invoiceId}`, options);
return this._client.get(`/invoices/${invoiceId}`, options);
}

@@ -59,3 +59,3 @@ fetchUpcoming(query = {}, options) {

}
return this.get('/invoices/upcoming', { query, ...options });
return this._client.get('/invoices/upcoming', { query, ...options });
}

@@ -71,3 +71,3 @@ /**

issue(invoiceId, options) {
return this.post(`/invoices/${invoiceId}/issue`, options);
return this._client.post(`/invoices/${invoiceId}/issue`, options);
}

@@ -79,3 +79,3 @@ /**

markPaid(invoiceId, body, options) {
return this.post(`/invoices/${invoiceId}/mark_paid`, { body, ...options });
return this._client.post(`/invoices/${invoiceId}/mark_paid`, { body, ...options });
}

@@ -92,3 +92,3 @@ /**

void(invoiceId, options) {
return this.post(`/invoices/${invoiceId}/void`, options);
return this._client.post(`/invoices/${invoiceId}/void`, options);
}

@@ -95,0 +95,0 @@ }

@@ -37,3 +37,3 @@ "use strict";

create(body, options) {
return this.post('/items', { body, ...options });
return this._client.post('/items', { body, ...options });
}

@@ -44,3 +44,3 @@ list(query = {}, options) {

}
return this.getAPIList('/items', ItemsPage, { query, ...options });
return this._client.getAPIList('/items', ItemsPage, { query, ...options });
}

@@ -51,3 +51,3 @@ /**

fetch(itemId, options) {
return this.get(`/items/${itemId}`, options);
return this._client.get(`/items/${itemId}`, options);
}

@@ -54,0 +54,0 @@ }

@@ -43,2 +43,6 @@ import * as Core from 'orb-billing/core';

item: ItemsAPI.Item;
/**
* User specified key-value pairs. If not provided, this defaults to an empty
* dictionary.
*/
metadata: Record<string, string>;

@@ -62,2 +66,6 @@ name: string;

item: ItemsAPI.Item;
/**
* User specified key-value pairs. If not provided, this defaults to an empty
* dictionary.
*/
metadata: Record<string, string>;

@@ -81,2 +89,6 @@ name: string;

item: ItemsAPI.Item;
/**
* User specified key-value pairs. If not provided, this defaults to an empty
* dictionary.
*/
metadata: Record<string, string>;

@@ -104,6 +116,5 @@ name: string;

/**
* User-specified key value pairs, often useful for referencing internal resources
* or IDs. Returned as-is in the metric resource.
* User-specified key/value pairs for the resource.
*/
metadata?: unknown | null;
metadata?: Record<string, string | null> | null;
}

@@ -110,0 +121,0 @@ export interface MetricListParams extends PageParams {

@@ -40,3 +40,3 @@ "use strict";

create(body, options) {
return this.post('/metrics', { body, ...options });
return this._client.post('/metrics', { body, ...options });
}

@@ -47,3 +47,3 @@ list(query = {}, options) {

}
return this.getAPIList('/metrics', MetricListResponsesPage, { query, ...options });
return this._client.getAPIList('/metrics', MetricListResponsesPage, { query, ...options });
}

@@ -55,3 +55,3 @@ /**

fetch(metricId, options) {
return this.get(`/metrics/${metricId}`, options);
return this._client.get(`/metrics/${metricId}`, options);
}

@@ -58,0 +58,0 @@ }

@@ -45,3 +45,6 @@ import * as Core from 'orb-billing/core';

external_plan_id?: string | null;
metadata?: unknown | null;
/**
* User-specified key/value pairs for the resource.
*/
metadata?: Record<string, string | null> | null;
}

@@ -48,0 +51,0 @@ export declare namespace ExternalPlanID {

@@ -12,3 +12,3 @@ "use strict";

}
return this.put(`/plans/external_plan_id/${otherExternalPlanId}`, { body, ...options });
return this._client.put(`/plans/external_plan_id/${otherExternalPlanId}`, { body, ...options });
}

@@ -30,3 +30,3 @@ /**

fetch(externalPlanId, options) {
return this.get(`/plans/external_plan_id/${externalPlanId}`, options);
return this._client.get(`/plans/external_plan_id/${externalPlanId}`, options);
}

@@ -33,0 +33,0 @@ }

@@ -94,3 +94,7 @@ import * as Core from 'orb-billing/core';

maximum_amount: string | null;
metadata: unknown;
/**
* User specified key-value pairs. If not provided, this defaults to an empty
* dictionary.
*/
metadata: Record<string, string>;
minimum: Plan.Minimum | null;

@@ -221,4 +225,7 @@ minimum_amount: string | null;

external_plan_id?: string | null;
metadata?: unknown | null;
/**
* User-specified key/value pairs for the resource.
*/
metadata?: Record<string, string | null> | null;
/**
* The net terms determines the difference between the invoice date and the issue

@@ -881,3 +888,6 @@ * date for the invoice. If you intend the invoice to be due on issue, set this

external_plan_id?: string | null;
metadata?: unknown | null;
/**
* User-specified key/value pairs for the resource.
*/
metadata?: Record<string, string | null> | null;
}

@@ -884,0 +894,0 @@ export interface PlanListParams extends PageParams {

@@ -36,3 +36,3 @@ "use strict";

super(...arguments);
this.externalPlanId = new ExternalPlanIDAPI.ExternalPlanID(this.client);
this.externalPlanId = new ExternalPlanIDAPI.ExternalPlanID(this._client);
}

@@ -43,3 +43,3 @@ /**

create(body, options) {
return this.post('/plans', { body, ...options });
return this._client.post('/plans', { body, ...options });
}

@@ -50,3 +50,3 @@ update(planId, body = {}, options) {

}
return this.put(`/plans/${planId}`, { body, ...options });
return this._client.put(`/plans/${planId}`, { body, ...options });
}

@@ -57,3 +57,3 @@ list(query = {}, options) {

}
return this.getAPIList('/plans', PlansPage, { query, ...options });
return this._client.getAPIList('/plans', PlansPage, { query, ...options });
}

@@ -80,3 +80,3 @@ /**

fetch(planId, options) {
return this.get(`/plans/${planId}`, options);
return this._client.get(`/plans/${planId}`, options);
}

@@ -83,0 +83,0 @@ }

@@ -13,3 +13,3 @@ "use strict";

fetch(externalPriceId, options) {
return this.get(`/prices/external_price_id/${externalPriceId}`, options);
return this._client.get(`/prices/external_price_id/${externalPriceId}`, options);
}

@@ -16,0 +16,0 @@ }

@@ -36,3 +36,3 @@ "use strict";

super(...arguments);
this.externalPriceId = new ExternalPriceIDAPI.ExternalPriceID(this.client);
this.externalPriceId = new ExternalPriceIDAPI.ExternalPriceID(this._client);
}

@@ -52,3 +52,3 @@ /**

create(body, options) {
return this.post('/prices', { body, ...options });
return this._client.post('/prices', { body, ...options });
}

@@ -59,3 +59,3 @@ list(query = {}, options) {

}
return this.getAPIList('/prices', PricesPage, { query, ...options });
return this._client.getAPIList('/prices', PricesPage, { query, ...options });
}

@@ -66,3 +66,3 @@ /**

fetch(priceId, options) {
return this.get(`/prices/${priceId}`, options);
return this._client.get(`/prices/${priceId}`, options);
}

@@ -69,0 +69,0 @@ }

@@ -37,3 +37,3 @@ "use strict";

}
return this.post('/subscriptions', { body, ...options });
return this._client.post('/subscriptions', { body, ...options });
}

@@ -44,3 +44,3 @@ list(query = {}, options) {

}
return this.getAPIList('/subscriptions', SubscriptionsPage, { query, ...options });
return this._client.getAPIList('/subscriptions', SubscriptionsPage, { query, ...options });
}

@@ -111,3 +111,3 @@ /**

cancel(subscriptionId, body, options) {
return this.post(`/subscriptions/${subscriptionId}/cancel`, { body, ...options });
return this._client.post(`/subscriptions/${subscriptionId}/cancel`, { body, ...options });
}

@@ -119,3 +119,3 @@ /**

fetch(subscriptionId, options) {
return this.get(`/subscriptions/${subscriptionId}`, options);
return this._client.get(`/subscriptions/${subscriptionId}`, options);
}

@@ -126,3 +126,3 @@ fetchCosts(subscriptionId, query = {}, options) {

}
return this.get(`/subscriptions/${subscriptionId}/costs`, { query, ...options });
return this._client.get(`/subscriptions/${subscriptionId}/costs`, { query, ...options });
}

@@ -133,3 +133,3 @@ fetchSchedule(subscriptionId, query = {}, options) {

}
return this.getAPIList(`/subscriptions/${subscriptionId}/schedule`, SubscriptionFetchScheduleResponsesPage, { query, ...options });
return this._client.getAPIList(`/subscriptions/${subscriptionId}/schedule`, SubscriptionFetchScheduleResponsesPage, { query, ...options });
}

@@ -140,3 +140,3 @@ fetchUsage(subscriptionId, query = {}, options) {

}
return this.get(`/subscriptions/${subscriptionId}/usage`, { query, ...options });
return this._client.get(`/subscriptions/${subscriptionId}/usage`, { query, ...options });
}

@@ -147,3 +147,3 @@ priceIntervals(subscriptionId, body = {}, options) {

}
return this.post(`/subscriptions/${subscriptionId}/price_intervals`, { body, ...options });
return this._client.post(`/subscriptions/${subscriptionId}/price_intervals`, { body, ...options });
}

@@ -192,3 +192,3 @@ /**

schedulePlanChange(subscriptionId, body, options) {
return this.post(`/subscriptions/${subscriptionId}/schedule_plan_change`, { body, ...options });
return this._client.post(`/subscriptions/${subscriptionId}/schedule_plan_change`, { body, ...options });
}

@@ -199,3 +199,3 @@ triggerPhase(subscriptionId, body = {}, options) {

}
return this.post(`/subscriptions/${subscriptionId}/trigger_phase`, { body, ...options });
return this._client.post(`/subscriptions/${subscriptionId}/trigger_phase`, { body, ...options });
}

@@ -211,3 +211,3 @@ /**

unscheduleCancellation(subscriptionId, options) {
return this.post(`/subscriptions/${subscriptionId}/unschedule_cancellation`, options);
return this._client.post(`/subscriptions/${subscriptionId}/unschedule_cancellation`, options);
}

@@ -221,3 +221,3 @@ /**

unscheduleFixedFeeQuantityUpdates(subscriptionId, body, options) {
return this.post(`/subscriptions/${subscriptionId}/unschedule_fixed_fee_quantity_updates`, {
return this._client.post(`/subscriptions/${subscriptionId}/unschedule_fixed_fee_quantity_updates`, {
body,

@@ -232,3 +232,3 @@ ...options,

unschedulePendingPlanChanges(subscriptionId, options) {
return this.post(`/subscriptions/${subscriptionId}/unschedule_pending_plan_changes`, options);
return this._client.post(`/subscriptions/${subscriptionId}/unschedule_pending_plan_changes`, options);
}

@@ -252,3 +252,6 @@ /**

updateFixedFeeQuantity(subscriptionId, body, options) {
return this.post(`/subscriptions/${subscriptionId}/update_fixed_fee_quantity`, { body, ...options });
return this._client.post(`/subscriptions/${subscriptionId}/update_fixed_fee_quantity`, {
body,
...options,
});
}

@@ -255,0 +258,0 @@ }

@@ -16,3 +16,3 @@ "use strict";

ping(options) {
return this.get('/ping', options);
return this._client.get('/ping', options);
}

@@ -19,0 +19,0 @@ }

@@ -558,23 +558,2 @@ import { VERSION } from './version';

export class APIResource {
protected client: APIClient;
constructor(client: APIClient) {
this.client = client;
this.get = client.get.bind(client);
this.post = client.post.bind(client);
this.patch = client.patch.bind(client);
this.put = client.put.bind(client);
this.delete = client.delete.bind(client);
this.getAPIList = client.getAPIList.bind(client);
}
protected get: APIClient['get'];
protected post: APIClient['post'];
protected patch: APIClient['patch'];
protected put: APIClient['put'];
protected delete: APIClient['delete'];
protected getAPIList: APIClient['getAPIList'];
}
export type PageInfo = { url: URL } | { params: Record<string, unknown> | null };

@@ -581,0 +560,0 @@

@@ -6,20 +6,7 @@ // File generated from our OpenAPI spec by Stainless.

export class APIResource {
protected client: Orb;
protected _client: Orb;
constructor(client: Orb) {
this.client = client;
this.get = client.get.bind(client);
this.post = client.post.bind(client);
this.patch = client.patch.bind(client);
this.put = client.put.bind(client);
this.delete = client.delete.bind(client);
this.getAPIList = client.getAPIList.bind(client);
this._client = client;
}
protected get: Orb['get'];
protected post: Orb['post'];
protected patch: Orb['patch'];
protected put: Orb['put'];
protected delete: Orb['delete'];
protected getAPIList: Orb['getAPIList'];
}

@@ -11,3 +11,3 @@ // File generated from our OpenAPI spec by Stainless.

export class Coupons extends APIResource {
subscriptions: SubscriptionsAPI.Subscriptions = new SubscriptionsAPI.Subscriptions(this.client);
subscriptions: SubscriptionsAPI.Subscriptions = new SubscriptionsAPI.Subscriptions(this._client);

@@ -19,3 +19,3 @@ /**

create(body: CouponCreateParams, options?: Core.RequestOptions): Core.APIPromise<Coupon> {
return this.post('/coupons', { body, ...options });
return this._client.post('/coupons', { body, ...options });
}

@@ -40,3 +40,3 @@

}
return this.getAPIList('/coupons', CouponsPage, { query, ...options });
return this._client.getAPIList('/coupons', CouponsPage, { query, ...options });
}

@@ -50,3 +50,3 @@

archive(couponId: string, options?: Core.RequestOptions): Core.APIPromise<Coupon> {
return this.post(`/coupons/${couponId}/archive`, options);
return this._client.post(`/coupons/${couponId}/archive`, options);
}

@@ -60,3 +60,3 @@

fetch(couponId: string, options?: Core.RequestOptions): Core.APIPromise<Coupon> {
return this.get(`/coupons/${couponId}`, options);
return this._client.get(`/coupons/${couponId}`, options);
}

@@ -63,0 +63,0 @@ }

@@ -35,3 +35,6 @@ // File generated from our OpenAPI spec by Stainless.

}
return this.getAPIList(`/coupons/${couponId}/subscriptions`, SubscriptionsPage, { query, ...options });
return this._client.getAPIList(`/coupons/${couponId}/subscriptions`, SubscriptionsPage, {
query,
...options,
});
}

@@ -38,0 +41,0 @@ }

@@ -27,3 +27,3 @@ // File generated from our OpenAPI spec by Stainless.

}
return this.getAPIList('/credit_notes', CreditNotesPage, { query, ...options });
return this._client.getAPIList('/credit_notes', CreditNotesPage, { query, ...options });
}

@@ -36,3 +36,3 @@

fetch(creditNoteId: string, options?: Core.RequestOptions): Core.APIPromise<CreditNote> {
return this.get(`/credit_notes/${creditNoteId}`, options);
return this._client.get(`/credit_notes/${creditNoteId}`, options);
}

@@ -39,0 +39,0 @@ }

@@ -19,3 +19,3 @@ // File generated from our OpenAPI spec by Stainless.

): Core.APIPromise<BalanceTransactionCreateResponse> {
return this.post(`/customers/${customerId}/balance_transactions`, { body, ...options });
return this._client.post(`/customers/${customerId}/balance_transactions`, { body, ...options });
}

@@ -70,3 +70,3 @@

}
return this.getAPIList(
return this._client.getAPIList(
`/customers/${customerId}/balance_transactions`,

@@ -73,0 +73,0 @@ BalanceTransactionListResponsesPage,

@@ -160,3 +160,3 @@ // File generated from our OpenAPI spec by Stainless.

}
return this.get(`/customers/${customerId}/costs`, { query, ...options });
return this._client.get(`/customers/${customerId}/costs`, { query, ...options });
}

@@ -317,3 +317,6 @@

}
return this.get(`/customers/external_customer_id/${externalCustomerId}/costs`, { query, ...options });
return this._client.get(`/customers/external_customer_id/${externalCustomerId}/costs`, {
query,
...options,
});
}

@@ -320,0 +323,0 @@ }

@@ -11,3 +11,3 @@ // File generated from our OpenAPI spec by Stainless.

export class Credits extends APIResource {
ledger: LedgerAPI.Ledger = new LedgerAPI.Ledger(this.client);
ledger: LedgerAPI.Ledger = new LedgerAPI.Ledger(this._client);

@@ -34,3 +34,3 @@ /**

}
return this.getAPIList(`/customers/${customerId}/credits`, CreditListResponsesPage, {
return this._client.getAPIList(`/customers/${customerId}/credits`, CreditListResponsesPage, {
query,

@@ -61,3 +61,3 @@ ...options,

}
return this.getAPIList(
return this._client.getAPIList(
`/customers/external_customer_id/${externalCustomerId}/credits`,

@@ -64,0 +64,0 @@ CreditListByExternalIDResponsesPage,

@@ -112,3 +112,3 @@ // File generated from our OpenAPI spec by Stainless.

const { timeframe_end, timeframe_start, ...body } = params;
return this.patch(`/customers/${id}/usage`, {
return this._client.patch(`/customers/${id}/usage`, {
query: { timeframe_end, timeframe_start },

@@ -224,3 +224,3 @@ body,

const { timeframe_end, timeframe_start, ...body } = params;
return this.patch(`/customers/external_customer_id/${id}/usage`, {
return this._client.patch(`/customers/external_customer_id/${id}/usage`, {
query: { timeframe_end, timeframe_start },

@@ -227,0 +227,0 @@ body,

@@ -38,3 +38,3 @@ // File generated from our OpenAPI spec by Stainless.

create(body: BackfillCreateParams, options?: Core.RequestOptions): Core.APIPromise<BackfillCreateResponse> {
return this.post('/events/backfills', { body, ...options });
return this._client.post('/events/backfills', { body, ...options });
}

@@ -63,3 +63,3 @@

}
return this.getAPIList('/events/backfills', BackfillListResponsesPage, { query, ...options });
return this._client.getAPIList('/events/backfills', BackfillListResponsesPage, { query, ...options });
}

@@ -74,3 +74,3 @@

close(backfillId: string, options?: Core.RequestOptions): Core.APIPromise<BackfillCloseResponse> {
return this.post(`/events/backfills/${backfillId}/close`, options);
return this._client.post(`/events/backfills/${backfillId}/close`, options);
}

@@ -82,3 +82,3 @@

fetch(backfillId: string, options?: Core.RequestOptions): Core.APIPromise<BackfillFetchResponse> {
return this.get(`/events/backfills/${backfillId}`, options);
return this._client.get(`/events/backfills/${backfillId}`, options);
}

@@ -96,3 +96,3 @@

revert(backfillId: string, options?: Core.RequestOptions): Core.APIPromise<BackfillRevertResponse> {
return this.post(`/events/backfills/${backfillId}/revert`, options);
return this._client.post(`/events/backfills/${backfillId}/revert`, options);
}

@@ -99,0 +99,0 @@ }

@@ -9,3 +9,3 @@ // File generated from our OpenAPI spec by Stainless.

export class Events extends APIResource {
backfills: BackfillsAPI.Backfills = new BackfillsAPI.Backfills(this.client);
backfills: BackfillsAPI.Backfills = new BackfillsAPI.Backfills(this._client);

@@ -62,3 +62,3 @@ /**

): Core.APIPromise<EventUpdateResponse> {
return this.put(`/events/${eventId}`, { body, ...options });
return this._client.put(`/events/${eventId}`, { body, ...options });
}

@@ -106,3 +106,3 @@

deprecate(eventId: string, options?: Core.RequestOptions): Core.APIPromise<EventDeprecateResponse> {
return this.put(`/events/${eventId}/deprecate`, options);
return this._client.put(`/events/${eventId}/deprecate`, options);
}

@@ -312,3 +312,3 @@

const { backfill_id, debug, ...body } = params;
return this.post('/ingest', { query: { backfill_id, debug }, body, ...options });
return this._client.post('/ingest', { query: { backfill_id, debug }, body, ...options });
}

@@ -336,3 +336,3 @@

search(body: EventSearchParams, options?: Core.RequestOptions): Core.APIPromise<EventSearchResponse> {
return this.post('/events/search', { body, ...options });
return this._client.post('/events/search', { body, ...options });
}

@@ -339,0 +339,0 @@ }

@@ -18,3 +18,3 @@ // File generated from our OpenAPI spec by Stainless.

): Core.APIPromise<InvoiceLineItemCreateResponse> {
return this.post('/invoice_line_items', { body, ...options });
return this._client.post('/invoice_line_items', { body, ...options });
}

@@ -21,0 +21,0 @@ }

@@ -14,3 +14,3 @@ // File generated from our OpenAPI spec by Stainless.

create(body: ItemCreateParams, options?: Core.RequestOptions): Core.APIPromise<Item> {
return this.post('/items', { body, ...options });
return this._client.post('/items', { body, ...options });
}

@@ -31,3 +31,3 @@

}
return this.getAPIList('/items', ItemsPage, { query, ...options });
return this._client.getAPIList('/items', ItemsPage, { query, ...options });
}

@@ -39,3 +39,3 @@

fetch(itemId: string, options?: Core.RequestOptions): Core.APIPromise<Item> {
return this.get(`/items/${itemId}`, options);
return this._client.get(`/items/${itemId}`, options);
}

@@ -42,0 +42,0 @@ }

@@ -18,3 +18,3 @@ // File generated from our OpenAPI spec by Stainless.

create(body: MetricCreateParams, options?: Core.RequestOptions): Core.APIPromise<MetricCreateResponse> {
return this.post('/metrics', { body, ...options });
return this._client.post('/metrics', { body, ...options });
}

@@ -39,3 +39,3 @@

}
return this.getAPIList('/metrics', MetricListResponsesPage, { query, ...options });
return this._client.getAPIList('/metrics', MetricListResponsesPage, { query, ...options });
}

@@ -48,3 +48,3 @@

fetch(metricId: string, options?: Core.RequestOptions): Core.APIPromise<MetricFetchResponse> {
return this.get(`/metrics/${metricId}`, options);
return this._client.get(`/metrics/${metricId}`, options);
}

@@ -72,2 +72,6 @@ }

/**
* User specified key-value pairs. If not provided, this defaults to an empty
* dictionary.
*/
metadata: Record<string, string>;

@@ -97,2 +101,6 @@

/**
* User specified key-value pairs. If not provided, this defaults to an empty
* dictionary.
*/
metadata: Record<string, string>;

@@ -122,2 +130,6 @@

/**
* User specified key-value pairs. If not provided, this defaults to an empty
* dictionary.
*/
metadata: Record<string, string>;

@@ -152,6 +164,5 @@

/**
* User-specified key value pairs, often useful for referencing internal resources
* or IDs. Returned as-is in the metric resource.
* User-specified key/value pairs for the resource.
*/
metadata?: unknown | null;
metadata?: Record<string, string | null> | null;
}

@@ -158,0 +169,0 @@

@@ -38,3 +38,3 @@ // File generated from our OpenAPI spec by Stainless.

}
return this.put(`/plans/external_plan_id/${otherExternalPlanId}`, { body, ...options });
return this._client.put(`/plans/external_plan_id/${otherExternalPlanId}`, { body, ...options });
}

@@ -57,3 +57,3 @@

fetch(externalPlanId: string, options?: Core.RequestOptions): Core.APIPromise<PlansAPI.Plan> {
return this.get(`/plans/external_plan_id/${externalPlanId}`, options);
return this._client.get(`/plans/external_plan_id/${externalPlanId}`, options);
}

@@ -70,3 +70,6 @@ }

metadata?: unknown | null;
/**
* User-specified key/value pairs for the resource.
*/
metadata?: Record<string, string | null> | null;
}

@@ -73,0 +76,0 @@

@@ -13,3 +13,3 @@ // File generated from our OpenAPI spec by Stainless.

export class Plans extends APIResource {
externalPlanId: ExternalPlanIDAPI.ExternalPlanID = new ExternalPlanIDAPI.ExternalPlanID(this.client);
externalPlanId: ExternalPlanIDAPI.ExternalPlanID = new ExternalPlanIDAPI.ExternalPlanID(this._client);

@@ -20,3 +20,3 @@ /**

create(body: PlanCreateParams, options?: Core.RequestOptions): Core.APIPromise<Plan> {
return this.post('/plans', { body, ...options });
return this._client.post('/plans', { body, ...options });
}

@@ -40,3 +40,3 @@

}
return this.put(`/plans/${planId}`, { body, ...options });
return this._client.put(`/plans/${planId}`, { body, ...options });
}

@@ -60,3 +60,3 @@

}
return this.getAPIList('/plans', PlansPage, { query, ...options });
return this._client.getAPIList('/plans', PlansPage, { query, ...options });
}

@@ -84,3 +84,3 @@

fetch(planId: string, options?: Core.RequestOptions): Core.APIPromise<Plan> {
return this.get(`/plans/${planId}`, options);
return this._client.get(`/plans/${planId}`, options);
}

@@ -143,3 +143,7 @@ }

metadata: unknown;
/**
* User specified key-value pairs. If not provided, this defaults to an empty
* dictionary.
*/
metadata: Record<string, string>;

@@ -325,3 +329,6 @@ minimum: Plan.Minimum | null;

metadata?: unknown | null;
/**
* User-specified key/value pairs for the resource.
*/
metadata?: Record<string, string | null> | null;

@@ -1137,3 +1144,6 @@ /**

metadata?: unknown | null;
/**
* User-specified key/value pairs for the resource.
*/
metadata?: Record<string, string | null> | null;
}

@@ -1140,0 +1150,0 @@

@@ -14,4 +14,4 @@ // File generated from our OpenAPI spec by Stainless.

fetch(externalPriceId: string, options?: Core.RequestOptions): Core.APIPromise<PricesAPI.Price> {
return this.get(`/prices/external_price_id/${externalPriceId}`, options);
return this._client.get(`/prices/external_price_id/${externalPriceId}`, options);
}
}

@@ -12,3 +12,3 @@ // File generated from our OpenAPI spec by Stainless.

export class Prices extends APIResource {
externalPriceId: ExternalPriceIDAPI.ExternalPriceID = new ExternalPriceIDAPI.ExternalPriceID(this.client);
externalPriceId: ExternalPriceIDAPI.ExternalPriceID = new ExternalPriceIDAPI.ExternalPriceID(this._client);

@@ -28,3 +28,3 @@ /**

create(body: PriceCreateParams, options?: Core.RequestOptions): Core.APIPromise<Price> {
return this.post('/prices', { body, ...options });
return this._client.post('/prices', { body, ...options });
}

@@ -45,3 +45,3 @@

}
return this.getAPIList('/prices', PricesPage, { query, ...options });
return this._client.getAPIList('/prices', PricesPage, { query, ...options });
}

@@ -53,3 +53,3 @@

fetch(priceId: string, options?: Core.RequestOptions): Core.APIPromise<Price> {
return this.get(`/prices/${priceId}`, options);
return this._client.get(`/prices/${priceId}`, options);
}

@@ -56,0 +56,0 @@ }

@@ -17,3 +17,3 @@ // File generated from our OpenAPI spec by Stainless.

ping(options?: Core.RequestOptions): Core.APIPromise<TopLevelPingResponse> {
return this.get('/ping', options);
return this._client.get('/ping', options);
}

@@ -20,0 +20,0 @@ }

@@ -1,1 +0,1 @@

export const VERSION = '1.27.0'; // x-release-please-version
export const VERSION = '1.28.0'; // x-release-please-version

@@ -1,2 +0,2 @@

export declare const VERSION = "1.27.0";
export declare const VERSION = "1.28.0";
//# sourceMappingURL=version.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.VERSION = void 0;
exports.VERSION = '1.27.0'; // x-release-please-version
exports.VERSION = '1.28.0'; // x-release-please-version
//# sourceMappingURL=version.js.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc