diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 491db96..d791adb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,7 @@ on: pull_request: branches: - main + - next jobs: lint: diff --git a/.stats.yml b/.stats.yml index 5f2504d..b7ff294 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 48 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome%2Fmetronome-640c4d54c542cc7c00227b484ed677e88fc79dcdf17c526a49615c9ae0500432.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome%2Fmetronome-860ef8a22818c70f942949a6d8b3e9be3673d005539ed310dc90ca3dbf0261fb.yml diff --git a/README.md b/README.md index 1f7df7e..3e16e05 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This library provides convenient access to the Metronome REST API from server-side TypeScript or JavaScript. -The REST API documentation can be found [on docs.metronome.com](https://docs.metronome.com). The full API of this library can be found in [api.md](api.md). +The REST API documentation can be found on [docs.metronome.com](https://docs.metronome.com). The full API of this library can be found in [api.md](api.md). ## Installation diff --git a/tests/api-resources/alerts.test.ts b/tests/api-resources/alerts.test.ts index a8c2bdc..3310426 100644 --- a/tests/api-resources/alerts.test.ts +++ b/tests/api-resources/alerts.test.ts @@ -33,13 +33,13 @@ describe('resource alerts', () => { credit_grant_type_filters: ['enterprise'], credit_type_id: '2714e483-4ff1-48e4-9e25-ac732e8f24f2', custom_field_filters: [ - { entity: 'Contract', key: 'string', value: 'string' }, - { entity: 'Contract', key: 'string', value: 'string' }, - { entity: 'Contract', key: 'string', value: 'string' }, + { entity: 'Contract', key: 'key', value: 'value' }, + { entity: 'Contract', key: 'key', value: 'value' }, + { entity: 'Contract', key: 'key', value: 'value' }, ], customer_id: '4db51251-61de-4bfe-b9ce-495e244f3491', evaluate_on_create: true, - group_key_filter: { key: 'string', value: 'string' }, + group_key_filter: { key: 'key', value: 'value' }, invoice_types_filter: [ 'PLAN_ARREARS, SCHEDULED, USAGE, CORRECTION, CREDIT_PURCHASE, or SEAT_PURCHASE', 'PLAN_ARREARS, SCHEDULED, USAGE, CORRECTION, CREDIT_PURCHASE, or SEAT_PURCHASE', diff --git a/tests/api-resources/audit-logs.test.ts b/tests/api-resources/audit-logs.test.ts index 7f57b30..f99edb5 100644 --- a/tests/api-resources/audit-logs.test.ts +++ b/tests/api-resources/audit-logs.test.ts @@ -34,9 +34,9 @@ describe('resource auditLogs', () => { { ending_before: '2019-12-27T18:11:19.117Z', limit: 1, - next_page: 'string', - resource_id: 'string', - resource_type: 'string', + next_page: 'next_page', + resource_id: 'resource_id', + resource_type: 'resource_type', sort: 'date_asc', starting_on: '2019-12-27T18:11:19.117Z', }, diff --git a/tests/api-resources/billable-metrics.test.ts b/tests/api-resources/billable-metrics.test.ts index 265f10f..ec5b2b1 100644 --- a/tests/api-resources/billable-metrics.test.ts +++ b/tests/api-resources/billable-metrics.test.ts @@ -96,7 +96,7 @@ describe('resource billableMetrics', () => { await expect( metronome.billableMetrics.list( 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc', - { limit: 1, next_page: 'string', on_current_plan: true }, + { limit: 1, next_page: 'next_page', on_current_plan: true }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(Metronome.NotFoundError); diff --git a/tests/api-resources/credit-grants.test.ts b/tests/api-resources/credit-grants.test.ts index dd8d03e..24eef5e 100644 --- a/tests/api-resources/credit-grants.test.ts +++ b/tests/api-resources/credit-grants.test.ts @@ -78,7 +78,7 @@ describe('resource creditGrants', () => { metronome.creditGrants.list( { limit: 1, - next_page: 'string', + next_page: 'next_page', credit_grant_ids: [ '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', @@ -135,7 +135,7 @@ describe('resource creditGrants', () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( metronome.creditGrants.listCreditTypes( - { limit: 1, next_page: 'string' }, + { limit: 1, next_page: 'next_page' }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(Metronome.NotFoundError); @@ -164,7 +164,7 @@ describe('resource creditGrants', () => { await expect( metronome.creditGrants.listEntries( { - next_page: 'string', + next_page: 'next_page', credit_type_ids: ['2714e483-4ff1-48e4-9e25-ac732e8f24f2'], customer_ids: ['6a37bb88-8538-48c5-b37b-a41c836328bd'], ending_before: '2021-02-01T00:00:00Z', diff --git a/tests/api-resources/custom-fields.test.ts b/tests/api-resources/custom-fields.test.ts index 068dc37..e2d0945 100644 --- a/tests/api-resources/custom-fields.test.ts +++ b/tests/api-resources/custom-fields.test.ts @@ -77,7 +77,7 @@ describe('resource customFields', () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( metronome.customFields.listKeys( - { next_page: 'string', entities: ['customer', 'credit_grant'] }, + { next_page: 'next_page', entities: ['customer', 'credit_grant'] }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(Metronome.NotFoundError); diff --git a/tests/api-resources/customers/alerts.test.ts b/tests/api-resources/customers/alerts.test.ts index f99d844..a241228 100644 --- a/tests/api-resources/customers/alerts.test.ts +++ b/tests/api-resources/customers/alerts.test.ts @@ -46,7 +46,7 @@ describe('resource alerts', () => { test('list: required and optional params', async () => { const response = await metronome.customers.alerts.list({ customer_id: '9b85c1c1-5238-4f2a-a409-61412905e1e1', - next_page: 'string', + next_page: 'next_page', alert_statuses: ['enabled'], }); }); diff --git a/tests/api-resources/customers/billing-config.test.ts b/tests/api-resources/customers/billing-config.test.ts index bc8563d..243ae2b 100644 --- a/tests/api-resources/customers/billing-config.test.ts +++ b/tests/api-resources/customers/billing-config.test.ts @@ -30,7 +30,7 @@ describe('resource billingConfig', () => { 'stripe', { billing_provider_customer_id: 'cus_AJ6y20bjkOOayM', - aws_product_code: 'string', + aws_product_code: 'aws_product_code', aws_region: 'af-south-1', stripe_collection_method: 'charge_automatically', }, diff --git a/tests/api-resources/customers/customers.test.ts b/tests/api-resources/customers/customers.test.ts index 8bd3b07..03f8b2f 100644 --- a/tests/api-resources/customers/customers.test.ts +++ b/tests/api-resources/customers/customers.test.ts @@ -25,9 +25,9 @@ describe('resource customers', () => { name: 'Example, Inc.', billing_config: { billing_provider_type: 'aws_marketplace', - billing_provider_customer_id: 'string', + billing_provider_customer_id: 'billing_provider_customer_id', stripe_collection_method: 'charge_automatically', - aws_product_code: 'string', + aws_product_code: 'aws_product_code', aws_region: 'af-south-1', }, custom_fields: { foo: 'string' }, @@ -80,9 +80,9 @@ describe('resource customers', () => { metronome.customers.list( { customer_ids: ['string', 'string', 'string'], - ingest_alias: 'string', + ingest_alias: 'ingest_alias', limit: 1, - next_page: 'string', + next_page: 'next_page', only_archived: true, salesforce_account_ids: ['string', 'string', 'string'], }, @@ -131,7 +131,7 @@ describe('resource customers', () => { await expect( metronome.customers.listBillableMetrics( 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc', - { limit: 1, next_page: 'string', on_current_plan: true }, + { limit: 1, next_page: 'next_page', on_current_plan: true }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(Metronome.NotFoundError); @@ -156,7 +156,7 @@ describe('resource customers', () => { ending_before: '2019-12-27T18:11:19.117Z', starting_on: '2019-12-27T18:11:19.117Z', limit: 1, - next_page: 'string', + next_page: 'next_page', }); }); diff --git a/tests/api-resources/customers/invoices.test.ts b/tests/api-resources/customers/invoices.test.ts index 2ad5933..aeda3c8 100644 --- a/tests/api-resources/customers/invoices.test.ts +++ b/tests/api-resources/customers/invoices.test.ts @@ -72,14 +72,14 @@ describe('resource invoices', () => { metronome.customers.invoices.list( 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc', { - credit_type_id: 'string', + credit_type_id: 'credit_type_id', ending_before: '2019-12-27T18:11:19.117Z', limit: 1, - next_page: 'string', + next_page: 'next_page', skip_zero_qty_line_items: true, sort: 'date_asc', starting_on: '2019-12-27T18:11:19.117Z', - status: 'string', + status: 'status', }, { path: '/_stainless_unknown_path' }, ), diff --git a/tests/api-resources/customers/plans.test.ts b/tests/api-resources/customers/plans.test.ts index 72079d6..37d15d8 100644 --- a/tests/api-resources/customers/plans.test.ts +++ b/tests/api-resources/customers/plans.test.ts @@ -34,7 +34,7 @@ describe('resource plans', () => { await expect( metronome.customers.plans.list( 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc', - { limit: 1, next_page: 'string' }, + { limit: 1, next_page: 'next_page' }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(Metronome.NotFoundError); @@ -103,7 +103,7 @@ describe('resource plans', () => { start_period: 0, }, ], - trial_spec: { length_in_days: 0, spending_cap: { credit_type_id: 'string', amount: 0 } }, + trial_spec: { length_in_days: 0, spending_cap: { credit_type_id: 'credit_type_id', amount: 0 } }, }); }); @@ -175,7 +175,7 @@ describe('resource plans', () => { metronome.customers.plans.listPriceAdjustments( 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc', '7aa11640-0703-4600-8eb9-293f535a6b74', - { limit: 1, next_page: 'string' }, + { limit: 1, next_page: 'next_page' }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(Metronome.NotFoundError); diff --git a/tests/api-resources/dashboards.test.ts b/tests/api-resources/dashboards.test.ts index e24e479..4731db2 100644 --- a/tests/api-resources/dashboards.test.ts +++ b/tests/api-resources/dashboards.test.ts @@ -29,9 +29,9 @@ describe('resource dashboards', () => { dashboard: 'invoices', color_overrides: [{ name: 'Gray_dark', value: '#ff0000' }], dashboard_options: [ - { key: 'string', value: 'string' }, - { key: 'string', value: 'string' }, - { key: 'string', value: 'string' }, + { key: 'key', value: 'value' }, + { key: 'key', value: 'value' }, + { key: 'key', value: 'value' }, ], }); }); diff --git a/tests/api-resources/plans.test.ts b/tests/api-resources/plans.test.ts index e874fdb..874c969 100644 --- a/tests/api-resources/plans.test.ts +++ b/tests/api-resources/plans.test.ts @@ -30,7 +30,7 @@ describe('resource plans', () => { test('list: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - metronome.plans.list({ limit: 1, next_page: 'string' }, { path: '/_stainless_unknown_path' }), + metronome.plans.list({ limit: 1, next_page: 'next_page' }, { path: '/_stainless_unknown_path' }), ).rejects.toThrow(Metronome.NotFoundError); }); @@ -79,7 +79,7 @@ describe('resource plans', () => { await expect( metronome.plans.listCharges( 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc', - { limit: 1, next_page: 'string' }, + { limit: 1, next_page: 'next_page' }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(Metronome.NotFoundError); @@ -110,7 +110,7 @@ describe('resource plans', () => { await expect( metronome.plans.listCustomers( 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc', - { limit: 1, next_page: 'string', status: 'all' }, + { limit: 1, next_page: 'next_page', status: 'all' }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(Metronome.NotFoundError); diff --git a/tests/api-resources/usage.test.ts b/tests/api-resources/usage.test.ts index 75ee435..0cd32f1 100644 --- a/tests/api-resources/usage.test.ts +++ b/tests/api-resources/usage.test.ts @@ -29,11 +29,11 @@ describe('resource usage', () => { ending_before: '2021-01-03T00:00:00Z', starting_on: '2021-01-01T00:00:00Z', window_size: 'day', - next_page: 'string', + next_page: 'next_page', billable_metrics: [ - { id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', group_by: { key: 'string', values: ['x'] } }, - { id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', group_by: { key: 'string', values: ['x'] } }, - { id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', group_by: { key: 'string', values: ['x'] } }, + { id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', group_by: { key: 'key', values: ['x'] } }, + { id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', group_by: { key: 'key', values: ['x'] } }, + { id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', group_by: { key: 'key', values: ['x'] } }, ], customer_ids: [ '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', @@ -94,7 +94,7 @@ describe('resource usage', () => { customer_id: '04ca7e72-4229-4a6e-ab11-9f7376fccbcb', window_size: 'day', limit: 1, - next_page: 'string', + next_page: 'next_page', current_period: true, ending_before: '2021-01-03T00:00:00Z', group_by: { key: 'region', values: ['US-East', 'US-West', 'EU-Central'] },