From a0ddd828b55422d13b12abcb7e401c24aee90311 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 18:33:29 +0000 Subject: [PATCH 1/9] chore(internal): remove unnecessary getRequestClient function (#414) --- src/core.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/core.ts b/src/core.ts index 2f0a1617..84e42580 100644 --- a/src/core.ts +++ b/src/core.ts @@ -523,19 +523,13 @@ export abstract class APIClient { const timeout = setTimeout(() => controller.abort(), ms); return ( - this.getRequestClient() - // use undefined this binding; fetch errors if bound to something else in browser/cloudflare - .fetch.call(undefined, url, { signal: controller.signal as any, ...options }) - .finally(() => { - clearTimeout(timeout); - }) + // use undefined this binding; fetch errors if bound to something else in browser/cloudflare + this.fetch.call(undefined, url, { signal: controller.signal as any, ...options }).finally(() => { + clearTimeout(timeout); + }) ); } - protected getRequestClient(): RequestClient { - return { fetch: this.fetch }; - } - private shouldRetry(response: Response): boolean { // Note this is not a standard header. const shouldRetryHeader = response.headers.get('x-should-retry'); From 3424ec91cd4912493bc01d2924f51ebc002f64b9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 16:48:26 +0000 Subject: [PATCH 2/9] chore(internal): bump cross-spawn to v7.0.6 (#416) Note: it is a dev transitive dependency. --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 6ea24703..efd2a961 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1369,9 +1369,9 @@ create-require@^1.1.0: integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== cross-spawn@^7.0.2, cross-spawn@^7.0.3: - version "7.0.3" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + version "7.0.6" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" + integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== dependencies: path-key "^3.1.0" shebang-command "^2.0.0" From e564fdf4283c5cecfacaf050771bf2be826710cb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 21:43:31 +0000 Subject: [PATCH 3/9] chore(types): nicer error class types + jsdocs (#417) --- src/error.ts | 205 ++++++++++++++++++++------------------------------- 1 file changed, 81 insertions(+), 124 deletions(-) diff --git a/src/error.ts b/src/error.ts index 3e9e4c66..ddf2111f 100644 --- a/src/error.ts +++ b/src/error.ts @@ -4,17 +4,19 @@ import { castToError, Headers } from './core'; export class OrbError extends Error {} -export class APIError extends OrbError { - readonly status: number | undefined; - readonly headers: Headers | undefined; - readonly error: Object | undefined; - - constructor( - status: number | undefined, - error: Object | undefined, - message: string | undefined, - headers: Headers | undefined, - ) { +export class APIError< + TStatus extends number | undefined = number | undefined, + THeaders extends Headers | undefined = Headers | undefined, + TError extends Object | undefined = Object | undefined, +> extends OrbError { + /** HTTP status for the response that caused the error */ + readonly status: TStatus; + /** HTTP headers for the response that caused the error */ + readonly headers: THeaders; + /** JSON body of the response that caused the error */ + readonly error: TError; + + constructor(status: TStatus, error: TError, message: string | undefined, headers: THeaders) { super(`${APIError.makeMessage(status, error, message)}`); this.status = status; this.headers = headers; @@ -48,7 +50,7 @@ export class APIError extends OrbError { message: string | undefined, headers: Headers | undefined, ): APIError { - if (!status) { + if (!status || !headers) { return new APIConnectionError({ message, cause: castToError(errorResponse) }); } @@ -56,51 +58,84 @@ export class APIError extends OrbError { const type = error?.['type']; - if (type === 'https://docs.withorb.com/reference/error-responses#400-constraint-violation') { + if ( + type === 'https://docs.withorb.com/reference/error-responses#400-constraint-violation' && + status === 400 + ) { return new ConstraintViolation(status, error, message, headers); } - if (type === 'https://docs.withorb.com/reference/error-responses#400-duplicate-resource-creation') { + if ( + type === 'https://docs.withorb.com/reference/error-responses#400-duplicate-resource-creation' && + status === 400 + ) { return new DuplicateResourceCreation(status, error, message, headers); } - if (type === 'https://docs.withorb.com/reference/error-responses#404-feature-not-available') { + if ( + type === 'https://docs.withorb.com/reference/error-responses#404-feature-not-available' && + status === 400 + ) { return new FeatureNotAvailable(status, error, message, headers); } - if (type === 'https://docs.withorb.com/reference/error-responses#400-request-validation-errors') { + if ( + type === 'https://docs.withorb.com/reference/error-responses#400-request-validation-errors' && + status === 400 + ) { return new RequestValidationError(status, error, message, headers); } - if (type === 'https://docs.withorb.com/reference/error-responses#401-authentication-error') { + if ( + type === 'https://docs.withorb.com/reference/error-responses#401-authentication-error' && + status === 401 + ) { return new OrbAuthenticationError(status, error, message, headers); } - if (type === 'https://docs.withorb.com/reference/error-responses#404-resource-not-found') { + if ( + type === 'https://docs.withorb.com/reference/error-responses#404-resource-not-found' && + status === 404 + ) { return new ResourceNotFound(status, error, message, headers); } - if (type === 'https://docs.withorb.com/reference/error-responses#404-url-not-found') { + if (type === 'https://docs.withorb.com/reference/error-responses#404-url-not-found' && status === 404) { return new URLNotFound(status, error, message, headers); } - if (type === 'https://docs.withorb.com/reference/error-responses#409-resource-conflict') { + if ( + type === 'https://docs.withorb.com/reference/error-responses#409-resource-conflict' && + status === 409 + ) { return new ResourceConflict(status, error, message, headers); } - if (type === 'https://docs.withorb.com/reference/error-responses#413-request-too-large') { + if ( + type === 'https://docs.withorb.com/reference/error-responses#413-request-too-large' && + status === 413 + ) { return new RequestTooLarge(status, error, message, headers); } - if (type === 'https://docs.withorb.com/reference/error-responses#413-resource-too-large') { + if ( + type === 'https://docs.withorb.com/reference/error-responses#413-resource-too-large' && + status === 413 + ) { return new ResourceTooLarge(status, error, message, headers); } - if (type === 'https://docs.withorb.com/reference/error-responses#429-too-many-requests') { + if ( + type === 'https://docs.withorb.com/reference/error-responses#429-too-many-requests' && + status === 429 + ) { return new TooManyRequests(status, error, message, headers); } - if (type === 'https://docs.withorb.com/reference/error-responses#500-internal-server-error') { + if ( + type === 'https://docs.withorb.com/reference/error-responses#500-internal-server-error' && + status === 500 + ) { return new OrbInternalServerError(status, error, message, headers); } @@ -140,17 +175,13 @@ export class APIError extends OrbError { } } -export class APIUserAbortError extends APIError { - override readonly status: undefined = undefined; - +export class APIUserAbortError extends APIError { constructor({ message }: { message?: string } = {}) { super(undefined, undefined, message || 'Request was aborted.', undefined); } } -export class APIConnectionError extends APIError { - override readonly status: undefined = undefined; - +export class APIConnectionError extends APIError { constructor({ message, cause }: { message?: string | undefined; cause?: Error | undefined }) { super(undefined, undefined, message || 'Connection error.', undefined); // in some environments the 'cause' property is already declared @@ -165,35 +196,21 @@ export class APIConnectionTimeoutError extends APIConnectionError { } } -export class BadRequestError extends APIError { - override readonly status: 400 = 400; -} +export class BadRequestError extends APIError<400, Headers> {} -export class AuthenticationError extends APIError { - override readonly status: 401 = 401; -} +export class AuthenticationError extends APIError<401, Headers> {} -export class PermissionDeniedError extends APIError { - override readonly status: 403 = 403; -} +export class PermissionDeniedError extends APIError<403, Headers> {} -export class NotFoundError extends APIError { - override readonly status: 404 = 404; -} +export class NotFoundError extends APIError<404, Headers> {} -export class ConflictError extends APIError { - override readonly status: 409 = 409; -} +export class ConflictError extends APIError<409, Headers> {} -export class UnprocessableEntityError extends APIError { - override readonly status: 422 = 422; -} +export class UnprocessableEntityError extends APIError<422, Headers> {} -export class RateLimitError extends APIError { - override readonly status: 429 = 429; -} +export class RateLimitError extends APIError<429, Headers> {} -export class InternalServerError extends APIError {} +export class InternalServerError extends APIError {} export class ConstraintViolation extends BadRequestError { override status: 400; @@ -204,12 +221,7 @@ export class ConstraintViolation extends BadRequestError { title?: string | null; - constructor( - status: number | undefined, - error: Object | undefined, - message: string | undefined, - headers: Headers | undefined, - ) { + constructor(status: 400, error: Object, message: string | undefined, headers: Headers) { const data = error as Record; super(status, error, message, headers); @@ -229,12 +241,7 @@ export class DuplicateResourceCreation extends BadRequestError { title?: string | null; - constructor( - status: number | undefined, - error: Object | undefined, - message: string | undefined, - headers: Headers | undefined, - ) { + constructor(status: 400, error: Object, message: string | undefined, headers: Headers) { const data = error as Record; super(status, error, message, headers); @@ -254,12 +261,7 @@ export class FeatureNotAvailable extends BadRequestError { title?: string | null; - constructor( - status: number | undefined, - error: Object | undefined, - message: string | undefined, - headers: Headers | undefined, - ) { + constructor(status: 400, error: Object, message: string | undefined, headers: Headers) { const data = error as Record; super(status, error, message, headers); @@ -281,12 +283,7 @@ export class RequestValidationError extends BadRequestError { title?: string | null; - constructor( - status: number | undefined, - error: Object | undefined, - message: string | undefined, - headers: Headers | undefined, - ) { + constructor(status: 400, error: Object, message: string | undefined, headers: Headers) { const data = error as Record; super(status, error, message, headers); @@ -307,12 +304,7 @@ export class OrbAuthenticationError extends AuthenticationError { title?: string | null; - constructor( - status: number | undefined, - error: Object | undefined, - message: string | undefined, - headers: Headers | undefined, - ) { + constructor(status: 401, error: Object, message: string | undefined, headers: Headers) { const data = error as Record; super(status, error, message, headers); @@ -332,12 +324,7 @@ export class ResourceNotFound extends NotFoundError { detail?: string | null; - constructor( - status: number | undefined, - error: Object | undefined, - message: string | undefined, - headers: Headers | undefined, - ) { + constructor(status: 404, error: Object, message: string | undefined, headers: Headers) { const data = error as Record; super(status, error, message, headers); @@ -357,12 +344,7 @@ export class URLNotFound extends NotFoundError { title?: string | null; - constructor( - status: number | undefined, - error: Object | undefined, - message: string | undefined, - headers: Headers | undefined, - ) { + constructor(status: 404, error: Object, message: string | undefined, headers: Headers) { const data = error as Record; super(status, error, message, headers); @@ -382,12 +364,7 @@ export class ResourceConflict extends ConflictError { title?: string | null; - constructor( - status: number | undefined, - error: Object | undefined, - message: string | undefined, - headers: Headers | undefined, - ) { + constructor(status: 409, error: Object, message: string | undefined, headers: Headers) { const data = error as Record; super(status, error, message, headers); @@ -407,12 +384,7 @@ export class RequestTooLarge extends APIError { title?: string | null; - constructor( - status: number | undefined, - error: Object | undefined, - message: string | undefined, - headers: Headers | undefined, - ) { + constructor(status: 413, error: Object, message: string | undefined, headers: Headers) { const data = error as Record; super(status, error, message, headers); @@ -432,12 +404,7 @@ export class ResourceTooLarge extends APIError { title?: string | null; - constructor( - status: number | undefined, - error: Object | undefined, - message: string | undefined, - headers: Headers | undefined, - ) { + constructor(status: 413, error: Object, message: string | undefined, headers: Headers) { const data = error as Record; super(status, error, message, headers); @@ -457,12 +424,7 @@ export class TooManyRequests extends RateLimitError { title?: string | null; - constructor( - status: number | undefined, - error: Object | undefined, - message: string | undefined, - headers: Headers | undefined, - ) { + constructor(status: 429, error: Object, message: string | undefined, headers: Headers) { const data = error as Record; super(status, error, message, headers); @@ -482,12 +444,7 @@ export class OrbInternalServerError extends InternalServerError { title?: string | null; - constructor( - status: number | undefined, - error: Object | undefined, - message: string | undefined, - headers: Headers | undefined, - ) { + constructor(status: 500, error: Object, message: string | undefined, headers: Headers) { const data = error as Record; super(status, error, message, headers); From f4ce7da0a6e8545bc7d9bf32909bfd33566927de Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2024 00:10:44 +0000 Subject: [PATCH 4/9] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index fb63efe6..aaba5809 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 97 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-77e2e50c9fb438b08736da759f722f9d062ed3fad3183fb951eb1eee93fa93f5.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-16e9b5c2b884f624e9b1f3dddf584353822295512ead0b72ffb574e6b1780570.yml From 6249150672207a4691bb5a627daf3f635c52aa7e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2024 15:15:08 +0000 Subject: [PATCH 5/9] chore(internal): update isAbsoluteURL (#418) --- src/core.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core.ts b/src/core.ts index 84e42580..bbbd87ae 100644 --- a/src/core.ts +++ b/src/core.ts @@ -970,8 +970,8 @@ export const safeJSON = (text: string) => { } }; -// https://stackoverflow.com/a/19709846 -const startsWithSchemeRegexp = new RegExp('^(?:[a-z]+:)?//', 'i'); +// https://url.spec.whatwg.org/#url-scheme-string +const startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i; const isAbsoluteURL = (url: string): boolean => { return startsWithSchemeRegexp.test(url); }; From ba0946c30028d8ce6fda88871a9912e6ca67f246 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 02:14:24 +0000 Subject: [PATCH 6/9] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index aaba5809..fb63efe6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 97 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-16e9b5c2b884f624e9b1f3dddf584353822295512ead0b72ffb574e6b1780570.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-77e2e50c9fb438b08736da759f722f9d062ed3fad3183fb951eb1eee93fa93f5.yml From d198b37345c28c5d56e28de91913cfd81b9622f9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 02:15:22 +0000 Subject: [PATCH 7/9] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index fb63efe6..aaba5809 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 97 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-77e2e50c9fb438b08736da759f722f9d062ed3fad3183fb951eb1eee93fa93f5.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-16e9b5c2b884f624e9b1f3dddf584353822295512ead0b72ffb574e6b1780570.yml From 1f3a57f6a7c8de054c495ede973e9746fe1554bf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 20:46:49 +0000 Subject: [PATCH 8/9] feat(api): api update (#419) --- .stats.yml | 2 +- api.md | 4 +- src/index.ts | 4 ++ src/resources/alerts.ts | 66 +++++++++++++++++++++++++++--- src/resources/index.ts | 2 + tests/api-resources/alerts.test.ts | 22 ++++++++++ 6 files changed, 91 insertions(+), 9 deletions(-) diff --git a/.stats.yml b/.stats.yml index aaba5809..26721953 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 97 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-16e9b5c2b884f624e9b1f3dddf584353822295512ead0b72ffb574e6b1780570.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-908960f165205e2874dd29322cc974df5ab10c7634ab9a342ab22047013de1b4.yml diff --git a/api.md b/api.md index 301500a0..ee99bb46 100644 --- a/api.md +++ b/api.md @@ -332,5 +332,5 @@ Methods: - client.alerts.createForCustomer(customerId, { ...params }) -> Alert - client.alerts.createForExternalCustomer(externalCustomerId, { ...params }) -> Alert - client.alerts.createForSubscription(subscriptionId, { ...params }) -> Alert -- client.alerts.disable(alertConfigurationId) -> Alert -- client.alerts.enable(alertConfigurationId) -> Alert +- client.alerts.disable(alertConfigurationId, { ...params }) -> Alert +- client.alerts.enable(alertConfigurationId, { ...params }) -> Alert diff --git a/src/index.ts b/src/index.ts index 49104834..ce347b8f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -13,6 +13,8 @@ import { AlertCreateForCustomerParams, AlertCreateForExternalCustomerParams, AlertCreateForSubscriptionParams, + AlertDisableParams, + AlertEnableParams, AlertListParams, AlertUpdateParams, Alerts, @@ -496,6 +498,8 @@ export declare namespace Orb { type AlertCreateForCustomerParams as AlertCreateForCustomerParams, type AlertCreateForExternalCustomerParams as AlertCreateForExternalCustomerParams, type AlertCreateForSubscriptionParams as AlertCreateForSubscriptionParams, + type AlertDisableParams as AlertDisableParams, + type AlertEnableParams as AlertEnableParams, }; export type AmountDiscount = API.AmountDiscount; diff --git a/src/resources/alerts.ts b/src/resources/alerts.ts index 5429da0b..bd0a758a 100644 --- a/src/resources/alerts.ts +++ b/src/resources/alerts.ts @@ -109,17 +109,55 @@ export class Alerts extends APIResource { } /** - * This endpoint can be used to disable an alert. + * This endpoint allows you to disable an alert. To disable a plan-level alert for + * a specific subscription, you must include the `subscription_id`. The + * `subscription_id` is not required for customer or subscription level alerts. */ - disable(alertConfigurationId: string, options?: Core.RequestOptions): Core.APIPromise { - return this._client.post(`/alerts/${alertConfigurationId}/disable`, options); + disable( + alertConfigurationId: string, + params?: AlertDisableParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + disable(alertConfigurationId: string, options?: Core.RequestOptions): Core.APIPromise; + disable( + alertConfigurationId: string, + params: AlertDisableParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(params)) { + return this.disable(alertConfigurationId, {}, params); + } + const { subscription_id } = params; + return this._client.post(`/alerts/${alertConfigurationId}/disable`, { + query: { subscription_id }, + ...options, + }); } /** - * This endpoint can be used to enable an alert. + * This endpoint allows you to enable an alert. To enable a plan-level alert for a + * specific subscription, you must include the `subscription_id`. The + * `subscription_id` is not required for customer or subscription level alerts. */ - enable(alertConfigurationId: string, options?: Core.RequestOptions): Core.APIPromise { - return this._client.post(`/alerts/${alertConfigurationId}/enable`, options); + enable( + alertConfigurationId: string, + params?: AlertEnableParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + enable(alertConfigurationId: string, options?: Core.RequestOptions): Core.APIPromise; + enable( + alertConfigurationId: string, + params: AlertEnableParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(params)) { + return this.enable(alertConfigurationId, {}, params); + } + const { subscription_id } = params; + return this._client.post(`/alerts/${alertConfigurationId}/enable`, { + query: { subscription_id }, + ...options, + }); } } @@ -369,6 +407,20 @@ export namespace AlertCreateForSubscriptionParams { } } +export interface AlertDisableParams { + /** + * Used to update the status of a plan alert scoped to this subscription_id + */ + subscription_id?: string | null; +} + +export interface AlertEnableParams { + /** + * Used to update the status of a plan alert scoped to this subscription_id + */ + subscription_id?: string | null; +} + Alerts.AlertsPage = AlertsPage; export declare namespace Alerts { @@ -380,5 +432,7 @@ export declare namespace Alerts { type AlertCreateForCustomerParams as AlertCreateForCustomerParams, type AlertCreateForExternalCustomerParams as AlertCreateForExternalCustomerParams, type AlertCreateForSubscriptionParams as AlertCreateForSubscriptionParams, + type AlertDisableParams as AlertDisableParams, + type AlertEnableParams as AlertEnableParams, }; } diff --git a/src/resources/index.ts b/src/resources/index.ts index 987e7d53..bbc0a44e 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -10,6 +10,8 @@ export { type AlertCreateForCustomerParams, type AlertCreateForExternalCustomerParams, type AlertCreateForSubscriptionParams, + type AlertDisableParams, + type AlertEnableParams, } from './alerts'; export { BillableMetricsPage, diff --git a/tests/api-resources/alerts.test.ts b/tests/api-resources/alerts.test.ts index 1d82b2c8..1fd7f96f 100644 --- a/tests/api-resources/alerts.test.ts +++ b/tests/api-resources/alerts.test.ts @@ -165,6 +165,17 @@ describe('resource alerts', () => { ).rejects.toThrow(Orb.NotFoundError); }); + test('disable: 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( + client.alerts.disable( + 'alert_configuration_id', + { subscription_id: 'subscription_id' }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Orb.NotFoundError); + }); + test('enable', async () => { const responsePromise = client.alerts.enable('alert_configuration_id'); const rawResponse = await responsePromise.asResponse(); @@ -182,4 +193,15 @@ describe('resource alerts', () => { client.alerts.enable('alert_configuration_id', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(Orb.NotFoundError); }); + + test('enable: 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( + client.alerts.enable( + 'alert_configuration_id', + { subscription_id: 'subscription_id' }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Orb.NotFoundError); + }); }); From 5ae98036d46e51c10d990959e1eaafde332d719a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 20:47:16 +0000 Subject: [PATCH 9/9] release: 4.41.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 16 ++++++++++++++++ package.json | 2 +- src/version.ts | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index d645df0f..5f8b241b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.40.0" + ".": "4.41.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index ebdaf5f6..10006852 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## 4.41.0 (2024-12-12) + +Full Changelog: [v4.40.0...v4.41.0](https://github.com/orbcorp/orb-node/compare/v4.40.0...v4.41.0) + +### Features + +* **api:** api update ([#419](https://github.com/orbcorp/orb-node/issues/419)) ([1f3a57f](https://github.com/orbcorp/orb-node/commit/1f3a57f6a7c8de054c495ede973e9746fe1554bf)) + + +### Chores + +* **internal:** bump cross-spawn to v7.0.6 ([#416](https://github.com/orbcorp/orb-node/issues/416)) ([3424ec9](https://github.com/orbcorp/orb-node/commit/3424ec91cd4912493bc01d2924f51ebc002f64b9)) +* **internal:** remove unnecessary getRequestClient function ([#414](https://github.com/orbcorp/orb-node/issues/414)) ([a0ddd82](https://github.com/orbcorp/orb-node/commit/a0ddd828b55422d13b12abcb7e401c24aee90311)) +* **internal:** update isAbsoluteURL ([#418](https://github.com/orbcorp/orb-node/issues/418)) ([6249150](https://github.com/orbcorp/orb-node/commit/6249150672207a4691bb5a627daf3f635c52aa7e)) +* **types:** nicer error class types + jsdocs ([#417](https://github.com/orbcorp/orb-node/issues/417)) ([e564fdf](https://github.com/orbcorp/orb-node/commit/e564fdf4283c5cecfacaf050771bf2be826710cb)) + ## 4.40.0 (2024-12-03) Full Changelog: [v4.39.0...v4.40.0](https://github.com/orbcorp/orb-node/compare/v4.39.0...v4.40.0) diff --git a/package.json b/package.json index 12e53898..74590c78 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "orb-billing", - "version": "4.40.0", + "version": "4.41.0", "description": "The official TypeScript library for the Orb API", "author": "Orb ", "types": "dist/index.d.ts", diff --git a/src/version.ts b/src/version.ts index 7bb1bfd3..1ab18091 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '4.40.0'; // x-release-please-version +export const VERSION = '4.41.0'; // x-release-please-version