Skip to content

Commit

Permalink
release: 0.1.0-beta.2 (#81)
Browse files Browse the repository at this point in the history
Automated Release PR
---


## 0.1.0-beta.2 (2024-09-05)

Full Changelog:
[v0.1.0-beta.1...v0.1.0-beta.2](v0.1.0-beta.1...v0.1.0-beta.2)

### Features

* **api:** OpenAPI spec update via Stainless API
([#80](#80))
([64ca167](64ca167))
* **api:** OpenAPI spec update via Stainless API
([#83](#83))
([b9b40f8](b9b40f8))
* **api:** OpenAPI spec update via Stainless API
([#89](#89))
([2189fbb](2189fbb))


### Bug Fixes

* **client:** correct File construction from node-fetch Responses
([#86](#86))
([bd542df](bd542df))


### Chores

* **ci:** check for build errors
([#82](#82))
([40011a9](40011a9))
* **ci:** install deps via ./script/bootstrap
([#85](#85))
([14ee02d](14ee02d))
* **internal:** codegen related update
([#84](#84))
([f0753f2](f0753f2))
* **internal:** dependency updates
([#87](#87))
([1f4dd86](1f4dd86))
* **internal:** minor bump qs version
([#88](#88))
([603491f](603491f))

---
This pull request is managed by Stainless's [GitHub
App](https://github.com/apps/stainless-app).

The [semver version
number](https://semver.org/#semantic-versioning-specification-semver) is
based on included [commit
messages](https://www.conventionalcommits.org/en/v1.0.0/).
Alternatively, you can manually set the version number in the title of
this pull request.

For a better experience, it is recommended to use either rebase-merge or
squash-merge when merging this pull request.

🔗 Stainless [website](https://www.stainlessapi.com)
📚 Read the [docs](https://app.stainlessapi.com/docs)
🙋 [Reach out](mailto:[email protected]) for help or questions

---------

Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
  • Loading branch information
stainless-app[bot] authored Sep 5, 2024
1 parent e1d6663 commit 9678b75
Show file tree
Hide file tree
Showing 20 changed files with 585 additions and 57 deletions.
23 changes: 21 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,30 @@ jobs:
with:
node-version: '18'

- name: Install dependencies
run: yarn install
- name: Bootstrap
run: ./scripts/bootstrap

- name: Check types
run: ./scripts/lint

build:
name: build
runs-on: ubuntu-latest


steps:
- uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '18'

- name: Bootstrap
run: ./scripts/bootstrap

- name: Check build
run: ./scripts/build
test:
name: test
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0-beta.1"
".": "0.1.0-beta.2"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 88
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome%2Fmetronome-085bb8699d222fd7950750078c4ea00fb8728477809a8ebc74521a7ad5f32038.yml
configured_endpoints: 90
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome%2Fmetronome-c23134402bb47d1637feabf3d4058720571d9d5d90253a11e2ea818b3add064a.yml
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# Changelog

## 0.1.0-beta.2 (2024-09-05)

Full Changelog: [v0.1.0-beta.1...v0.1.0-beta.2](https://github.com/Metronome-Industries/metronome-node/compare/v0.1.0-beta.1...v0.1.0-beta.2)

### Features

* **api:** OpenAPI spec update via Stainless API ([#80](https://github.com/Metronome-Industries/metronome-node/issues/80)) ([64ca167](https://github.com/Metronome-Industries/metronome-node/commit/64ca167d1a58a2019335e66f6ce865eddd89a5e0))
* **api:** OpenAPI spec update via Stainless API ([#83](https://github.com/Metronome-Industries/metronome-node/issues/83)) ([b9b40f8](https://github.com/Metronome-Industries/metronome-node/commit/b9b40f8238a9df6b0a40e46484cf7dd2a37fdf29))
* **api:** OpenAPI spec update via Stainless API ([#89](https://github.com/Metronome-Industries/metronome-node/issues/89)) ([2189fbb](https://github.com/Metronome-Industries/metronome-node/commit/2189fbbacc85fba4dd92fff6a233fcbde4e2416a))


### Bug Fixes

* **client:** correct File construction from node-fetch Responses ([#86](https://github.com/Metronome-Industries/metronome-node/issues/86)) ([bd542df](https://github.com/Metronome-Industries/metronome-node/commit/bd542df2dd247dfaec1b7dfb69917bbb7e1eac54))


### Chores

* **ci:** check for build errors ([#82](https://github.com/Metronome-Industries/metronome-node/issues/82)) ([40011a9](https://github.com/Metronome-Industries/metronome-node/commit/40011a999f06ff27d38e2e854f68ae223249e51f))
* **ci:** install deps via ./script/bootstrap ([#85](https://github.com/Metronome-Industries/metronome-node/issues/85)) ([14ee02d](https://github.com/Metronome-Industries/metronome-node/commit/14ee02d3651d5038a640676be79dad9f22825140))
* **internal:** codegen related update ([#84](https://github.com/Metronome-Industries/metronome-node/issues/84)) ([f0753f2](https://github.com/Metronome-Industries/metronome-node/commit/f0753f272509d79b0b6d3be01393dd61c41ecbc2))
* **internal:** dependency updates ([#87](https://github.com/Metronome-Industries/metronome-node/issues/87)) ([1f4dd86](https://github.com/Metronome-Industries/metronome-node/commit/1f4dd860ab54c4a20eeb15018e6008c667a42dfc))
* **internal:** minor bump qs version ([#88](https://github.com/Metronome-Industries/metronome-node/issues/88)) ([603491f](https://github.com/Metronome-Industries/metronome-node/commit/603491fecaed5a8004e6ab19ea7d7fbf0f471c0b))

## 0.1.0-beta.1 (2024-08-23)

Full Changelog: [v0.1.0-beta.0...v0.1.0-beta.1](https://github.com/Metronome-Industries/metronome-node/compare/v0.1.0-beta.0...v0.1.0-beta.1)
Expand Down
4 changes: 3 additions & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ Methods:

- <code title="post /billable-metrics/create">client.billableMetrics.<a href="./src/resources/billable-metrics.ts">create</a>({ ...params }) -> BillableMetricCreateResponse</code>
- <code title="get /billable-metrics/{billable_metric_id}">client.billableMetrics.<a href="./src/resources/billable-metrics.ts">retrieve</a>(billableMetricId) -> BillableMetricRetrieveResponse</code>
- <code title="get /customers/{customer_id}/billable-metrics">client.billableMetrics.<a href="./src/resources/billable-metrics.ts">list</a>(customerId, { ...params }) -> BillableMetricListResponsesCursorPage</code>
- <code title="get /billable-metrics">client.billableMetrics.<a href="./src/resources/billable-metrics.ts">list</a>({ ...params }) -> BillableMetricListResponsesCursorPage</code>
- <code title="post /billable-metrics/archive">client.billableMetrics.<a href="./src/resources/billable-metrics.ts">archive</a>({ ...params }) -> BillableMetricArchiveResponse</code>

# Services
Expand Down Expand Up @@ -292,6 +292,7 @@ Types:
- <code><a href="./src/resources/contracts/contracts.ts">ContractListResponse</a></code>
- <code><a href="./src/resources/contracts/contracts.ts">ContractAmendResponse</a></code>
- <code><a href="./src/resources/contracts/contracts.ts">ContractArchiveResponse</a></code>
- <code><a href="./src/resources/contracts/contracts.ts">ContractCreateHistoricalInvoicesResponse</a></code>
- <code><a href="./src/resources/contracts/contracts.ts">ContractListBalancesResponse</a></code>
- <code><a href="./src/resources/contracts/contracts.ts">ContractRetrieveRateScheduleResponse</a></code>
- <code><a href="./src/resources/contracts/contracts.ts">ContractScheduleProServicesInvoiceResponse</a></code>
Expand All @@ -305,6 +306,7 @@ Methods:
- <code title="post /contracts/addManualBalanceLedgerEntry">client.contracts.<a href="./src/resources/contracts/contracts.ts">addManualBalanceEntry</a>({ ...params }) -> void</code>
- <code title="post /contracts/amend">client.contracts.<a href="./src/resources/contracts/contracts.ts">amend</a>({ ...params }) -> ContractAmendResponse</code>
- <code title="post /contracts/archive">client.contracts.<a href="./src/resources/contracts/contracts.ts">archive</a>({ ...params }) -> ContractArchiveResponse</code>
- <code title="post /contracts/createHistoricalInvoices">client.contracts.<a href="./src/resources/contracts/contracts.ts">createHistoricalInvoices</a>({ ...params }) -> ContractCreateHistoricalInvoicesResponse</code>
- <code title="post /contracts/customerBalances/list">client.contracts.<a href="./src/resources/contracts/contracts.ts">listBalances</a>({ ...params }) -> ContractListBalancesResponse</code>
- <code title="post /contracts/getContractRateSchedule">client.contracts.<a href="./src/resources/contracts/contracts.ts">retrieveRateSchedule</a>({ ...params }) -> ContractRetrieveRateScheduleResponse</code>
- <code title="post /contracts/scheduleProServicesInvoice">client.contracts.<a href="./src/resources/contracts/contracts.ts">scheduleProServicesInvoice</a>({ ...params }) -> ContractScheduleProServicesInvoiceResponse</code>
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metronome/sdk",
"version": "0.1.0-beta.1",
"version": "0.1.0-beta.2",
"description": "The official TypeScript library for the Metronome API",
"author": "Metronome <[email protected]>",
"types": "dist/index.d.ts",
Expand All @@ -26,7 +26,7 @@
"dependencies": {
"@types/node": "^18.11.18",
"@types/node-fetch": "^2.6.4",
"@types/qs": "^6.9.7",
"@types/qs": "^6.9.15",
"abort-controller": "^3.0.0",
"agentkeepalive": "^4.2.1",
"form-data-encoder": "1.7.2",
Expand Down
3 changes: 3 additions & 0 deletions scripts/lint
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ cd "$(dirname "$0")/.."

echo "==> Running eslint"
ESLINT_USE_FLAT_CONFIG="false" ./node_modules/.bin/eslint --ext ts,js .

echo "==> Running tsc"
./node_modules/.bin/tsc --noEmit
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ export namespace Metronome {
export import ContractListResponse = API.ContractListResponse;
export import ContractAmendResponse = API.ContractAmendResponse;
export import ContractArchiveResponse = API.ContractArchiveResponse;
export import ContractCreateHistoricalInvoicesResponse = API.ContractCreateHistoricalInvoicesResponse;
export import ContractListBalancesResponse = API.ContractListBalancesResponse;
export import ContractRetrieveRateScheduleResponse = API.ContractRetrieveRateScheduleResponse;
export import ContractScheduleProServicesInvoiceResponse = API.ContractScheduleProServicesInvoiceResponse;
Expand All @@ -332,6 +333,7 @@ export namespace Metronome {
export import ContractAddManualBalanceEntryParams = API.ContractAddManualBalanceEntryParams;
export import ContractAmendParams = API.ContractAmendParams;
export import ContractArchiveParams = API.ContractArchiveParams;
export import ContractCreateHistoricalInvoicesParams = API.ContractCreateHistoricalInvoicesParams;
export import ContractListBalancesParams = API.ContractListBalancesParams;
export import ContractRetrieveRateScheduleParams = API.ContractRetrieveRateScheduleParams;
export import ContractScheduleProServicesInvoiceParams = API.ContractScheduleProServicesInvoiceParams;
Expand Down
46 changes: 11 additions & 35 deletions src/resources/billable-metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,26 @@ export class BillableMetrics extends APIResource {
}

/**
* Get all billable metrics for a given customer.
* List all billable metrics.
*/
list(
customerId: string,
query?: BillableMetricListParams,
options?: Core.RequestOptions,
): Core.PagePromise<BillableMetricListResponsesCursorPage, BillableMetricListResponse>;
list(
customerId: string,
options?: Core.RequestOptions,
): Core.PagePromise<BillableMetricListResponsesCursorPage, BillableMetricListResponse>;
list(
customerId: string,
query: BillableMetricListParams | Core.RequestOptions = {},
options?: Core.RequestOptions,
): Core.PagePromise<BillableMetricListResponsesCursorPage, BillableMetricListResponse> {
if (isRequestOptions(query)) {
return this.list(customerId, {}, query);
return this.list({}, query);
}
return this._client.getAPIList(
`/customers/${customerId}/billable-metrics`,
BillableMetricListResponsesCursorPage,
{ query, ...options },
);
return this._client.getAPIList('/billable-metrics', BillableMetricListResponsesCursorPage, {
query,
...options,
});
}

/**
Expand Down Expand Up @@ -128,19 +124,15 @@ export namespace BillableMetricRetrieveResponse {
}

export interface BillableMetricListResponse {
id: string;

name: string;

/**
* (DEPRECATED) use aggregation_type instead
* ID of the billable metric
*/
aggregate?: string;
id: string;

/**
* (DEPRECATED) use aggregation_key instead
* The display name of the billable metric.
*/
aggregate_keys?: Array<string>;
name: string;

/**
* A key that specifies which property of the event is used to aggregate data. This
Expand All @@ -161,16 +153,6 @@ export interface BillableMetricListResponse {
*/
event_type_filter?: Shared.EventTypeFilter;

/**
* (DEPRECATED) use property_filters & event_type_filter instead
*/
filter?: Record<string, unknown>;

/**
* (DEPRECATED) use group_keys instead
*/
group_by?: Array<string>;

/**
* Property names that are used to group usage costs on an invoice. Each entry
* represents a set of properties used to slice events into distinct buckets.
Expand Down Expand Up @@ -236,13 +218,7 @@ export interface BillableMetricCreateParams {
property_filters?: Array<Shared.PropertyFilter>;
}

export interface BillableMetricListParams extends CursorPageParams {
/**
* If true, the list of metrics will be filtered to just ones that are on the
* customer's current plan
*/
on_current_plan?: boolean;
}
export interface BillableMetricListParams extends CursorPageParams {}

export interface BillableMetricArchiveParams {
id: string;
Expand Down
77 changes: 77 additions & 0 deletions src/resources/contracts/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,16 @@ export class Contracts extends APIResource {
return this._client.post('/contracts/archive', { body, ...options });
}

/**
* Creates historical usage invoices for a contract
*/
createHistoricalInvoices(
body: ContractCreateHistoricalInvoicesParams,
options?: Core.RequestOptions,
): Core.APIPromise<ContractCreateHistoricalInvoicesResponse> {
return this._client.post('/contracts/createHistoricalInvoices', { body, ...options });
}

/**
* List balances (commits and credits).
*/
Expand Down Expand Up @@ -379,6 +389,10 @@ export interface ContractArchiveResponse {
data: Shared.ID;
}

export interface ContractCreateHistoricalInvoicesResponse {
data: Array<InvoicesAPI.Invoice>;
}

export interface ContractListBalancesResponse {
data: Array<Shared.Commit | Shared.Credit>;

Expand Down Expand Up @@ -2120,6 +2134,67 @@ export interface ContractArchiveParams {
void_invoices: boolean;
}

export interface ContractCreateHistoricalInvoicesParams {
invoices: Array<ContractCreateHistoricalInvoicesParams.Invoice>;

preview: boolean;
}

export namespace ContractCreateHistoricalInvoicesParams {
export interface Invoice {
contract_id: string;

credit_type_id: string;

customer_id: string;

exclusive_end_date: string;

inclusive_start_date: string;

issue_date: string;

usage_line_items: Array<Invoice.UsageLineItem>;

/**
* This field's availability is dependent on your client's configuration.
*/
billable_status?: 'billable' | 'unbillable';

breakdown_granularity?: 'HOUR' | 'DAY';

custom_fields?: Record<string, string>;
}

export namespace Invoice {
export interface UsageLineItem {
exclusive_end_date: string;

inclusive_start_date: string;

product_id: string;

presentation_group_values?: Record<string, string>;

pricing_group_values?: Record<string, string>;

quantity?: number;

subtotals_with_quantity?: Array<UsageLineItem.SubtotalsWithQuantity>;
}

export namespace UsageLineItem {
export interface SubtotalsWithQuantity {
exclusive_end_date: string;

inclusive_start_date: string;

quantity: number;
}
}
}
}

export interface ContractListBalancesParams {
customer_id: string;

Expand Down Expand Up @@ -2332,6 +2407,7 @@ export namespace Contracts {
export import ContractListResponse = ContractsAPI.ContractListResponse;
export import ContractAmendResponse = ContractsAPI.ContractAmendResponse;
export import ContractArchiveResponse = ContractsAPI.ContractArchiveResponse;
export import ContractCreateHistoricalInvoicesResponse = ContractsAPI.ContractCreateHistoricalInvoicesResponse;
export import ContractListBalancesResponse = ContractsAPI.ContractListBalancesResponse;
export import ContractRetrieveRateScheduleResponse = ContractsAPI.ContractRetrieveRateScheduleResponse;
export import ContractScheduleProServicesInvoiceResponse = ContractsAPI.ContractScheduleProServicesInvoiceResponse;
Expand All @@ -2342,6 +2418,7 @@ export namespace Contracts {
export import ContractAddManualBalanceEntryParams = ContractsAPI.ContractAddManualBalanceEntryParams;
export import ContractAmendParams = ContractsAPI.ContractAmendParams;
export import ContractArchiveParams = ContractsAPI.ContractArchiveParams;
export import ContractCreateHistoricalInvoicesParams = ContractsAPI.ContractCreateHistoricalInvoicesParams;
export import ContractListBalancesParams = ContractsAPI.ContractListBalancesParams;
export import ContractRetrieveRateScheduleParams = ContractsAPI.ContractRetrieveRateScheduleParams;
export import ContractScheduleProServicesInvoiceParams = ContractsAPI.ContractScheduleProServicesInvoiceParams;
Expand Down
2 changes: 2 additions & 0 deletions src/resources/contracts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export {
ContractListResponse,
ContractAmendResponse,
ContractArchiveResponse,
ContractCreateHistoricalInvoicesResponse,
ContractListBalancesResponse,
ContractRetrieveRateScheduleResponse,
ContractScheduleProServicesInvoiceResponse,
Expand All @@ -16,6 +17,7 @@ export {
ContractAddManualBalanceEntryParams,
ContractAmendParams,
ContractArchiveParams,
ContractCreateHistoricalInvoicesParams,
ContractListBalancesParams,
ContractRetrieveRateScheduleParams,
ContractScheduleProServicesInvoiceParams,
Expand Down
7 changes: 7 additions & 0 deletions src/resources/customers/invoices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,13 @@ export namespace Invoice {
*/
is_prorated?: boolean;

/**
* only present for contract invoices and when the include_list_prices query
* parameter is set to true. This will include the list rate for the charge if
* applicable. Only present for usage and subscription line items.
*/
list_price?: Shared.Rate;

metadata?: string;

/**
Expand Down
Loading

0 comments on commit 9678b75

Please sign in to comment.