diff --git a/ChangeLog.md b/ChangeLog.md index 6f12d0129..921a2cf0b 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -7,12 +7,15 @@ * Libs/JavaScript **(Breaking)**: Add more precise type annotations for `options` parameters on `MessageAttempt.list`, `MessageAttempt.listByMsg`, `MessageAttempt.listAttemptedMessages` and `MessageAttempt.listAttemptedDestinations` ([#1571]) +* Libs/JavaScript **(Breaking)**: Rename `EndpointStatsOptions` interface to + `EndpointGetStatsOptions` ([#1585]) * Libs/Rust: Add `api::Authentication::expire_all` ([#1584]) * Libs/Rust: Rename some `Options` types. The old names remain as deprecated type aliases ([#1584]) [#1568]: https://github.com/svix/svix-webhooks/pull/1568 [#1571]: https://github.com/svix/svix-webhooks/pull/1571 [#1584]: https://github.com/svix/svix-webhooks/pull/1584 +[#1585]: https://github.com/svix/svix-webhooks/pull/1585 ## Version 1.44.0 * Libs/JavaScript: Revert packaging-related change because it broke for some users ([#1556]) diff --git a/javascript/src/api/application.ts b/javascript/src/api/application.ts index 548bc2041..289c59d53 100644 --- a/javascript/src/api/application.ts +++ b/javascript/src/api/application.ts @@ -11,11 +11,11 @@ import { import { PostOptions } from "../util"; export interface ApplicationListOptions { - /// Limit the number of returned items + /** Limit the number of returned items */ limit?: number; - /// The iterator returned from a prior invocation + /** The iterator returned from a prior invocation */ iterator?: string | null; - /// The sorting order of the returned items + /** The sorting order of the returned items */ order?: Ordering; } @@ -26,7 +26,7 @@ export class Application { this.api = new ApplicationApi(config); } - /// List of all the organization's applications. + /** List of all the organization's applications. */ public list(options?: ApplicationListOptions): Promise { return this.api.v1ApplicationList({ ...options, @@ -34,7 +34,7 @@ export class Application { }); } - /// Create a new application. + /** Create a new application. */ public create( applicationIn: ApplicationIn, options?: PostOptions @@ -45,7 +45,7 @@ export class Application { }); } - /// Get the application with the UID from `applicationIn`, or create it if it doesn't exist yet. + /** Get the application with the UID from `applicationIn`, or create it if it doesn't exist yet. */ public getOrCreate( applicationIn: ApplicationIn, options?: PostOptions @@ -57,14 +57,14 @@ export class Application { }); } - /// Get an application. + /** Get an application. */ public get(appId: string): Promise { return this.api.v1ApplicationGet({ appId, }); } - /// Update an application. + /** Update an application. */ public update(appId: string, applicationIn: ApplicationIn): Promise { return this.api.v1ApplicationUpdate({ appId, @@ -72,14 +72,14 @@ export class Application { }); } - /// Delete an application. + /** Delete an application. */ public delete(appId: string): Promise { return this.api.v1ApplicationDelete({ appId, }); } - /// Partially update an application. + /** Partially update an application. */ public patch( appId: string, applicationPatch: ApplicationPatch diff --git a/javascript/src/api/authentication.ts b/javascript/src/api/authentication.ts index cedc04485..edbde10c6 100644 --- a/javascript/src/api/authentication.ts +++ b/javascript/src/api/authentication.ts @@ -16,7 +16,7 @@ export class Authentication { this.api = new AuthenticationApi(config); } - /// Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal. + /** Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal. */ public appPortalAccess( appId: string, appPortalAccessIn: AppPortalAccessIn, @@ -39,7 +39,7 @@ export class Authentication { }); } - /// Expire all of the tokens associated with a specific Application + /** Expire all of the tokens associated with a specific application. */ public expireAll( appId: string, applicationTokenExpireIn: ApplicationTokenExpireIn, @@ -52,9 +52,11 @@ export class Authentication { }); } - /// Logout an app token. - /// - /// Trying to log out other tokens will fail. + /** + * Logout an app token. + * + * Trying to log out other tokens will fail. + */ public logout(options?: PostOptions): Promise { return this.api.v1AuthenticationLogout({ ...options, diff --git a/javascript/src/api/endpoint.ts b/javascript/src/api/endpoint.ts index 74ef27c7c..41f33f391 100644 --- a/javascript/src/api/endpoint.ts +++ b/javascript/src/api/endpoint.ts @@ -27,18 +27,18 @@ import { import { PostOptions } from "../util"; export interface EndpointListOptions { - /// Limit the number of returned items + /** Limit the number of returned items */ limit?: number; - /// The iterator returned from a prior invocation + /** The iterator returned from a prior invocation */ iterator?: string | null; - /// The sorting order of the returned items + /** The sorting order of the returned items */ order?: Ordering; } -export interface EndpointStatsOptions { - /// Filter the range to data starting from this date +export interface EndpointGetStatsOptions { + /** Filter the range to data starting from this date. */ since?: Date | null; - /// Filter the range to data ending by this date + /** Filter the range to data ending by this date. */ until?: Date | null; } @@ -49,7 +49,7 @@ export class Endpoint { this.api = new EndpointApi(config); } - /// List the application's endpoints. + /** List the application's endpoints. */ public list( appId: string, options?: EndpointListOptions @@ -61,9 +61,11 @@ export class Endpoint { }); } - /// Create a new endpoint for the application. - /// - /// When `secret` is `null` the secret is automatically generated (recommended) + /** + * Create a new endpoint for the application. + * + * When `secret` is `null` the secret is automatically generated (recommended). + */ public create( appId: string, endpointIn: EndpointIn, @@ -76,7 +78,7 @@ export class Endpoint { }); } - /// Get an endpoint. + /** Get an endpoint. */ public get(appId: string, endpointId: string): Promise { return this.api.v1EndpointGet({ appId, @@ -84,7 +86,7 @@ export class Endpoint { }); } - /// Update an endpoint. + /** Update an endpoint. */ public update( appId: string, endpointId: string, @@ -97,7 +99,7 @@ export class Endpoint { }); } - /// Delete an endpoint. + /** Delete an endpoint. */ public delete(appId: string, endpointId: string): Promise { return this.api.v1EndpointDelete({ appId, @@ -105,7 +107,7 @@ export class Endpoint { }); } - /// Partially update an endpoint. + /** Partially update an endpoint. */ public patch( appId: string, endpointId: string, @@ -118,7 +120,7 @@ export class Endpoint { }); } - /// Get the additional headers to be sent with the webhook + /** Get the additional headers to be sent with the webhook. */ public getHeaders(appId: string, endpointId: string): Promise { return this.api.v1EndpointGetHeaders({ appId, @@ -126,9 +128,7 @@ export class Endpoint { }); } - /** - * @deprecated Since version 1.30.0. Use `headersUpdate` instead. - */ + /** Set the additional headers to be sent with the webhook. */ public updateHeaders( appId: string, endpointId: string, @@ -180,9 +180,11 @@ export class Endpoint { }); } - /// Resend all failed messages since a given time. - /// - /// Messages that were sent successfully, even if failed initially, are not resent. + /** + * Resend all failed messages since a given time. + * + * Messages that were sent successfully, even if failed initially, are not resent. + */ public recover( appId: string, endpointId: string, @@ -197,10 +199,12 @@ export class Endpoint { }); } - /// Replays messages to the endpoint. - /// - /// Only messages that were created after `since` will be sent. - /// Messages that were previously sent to the endpoint are not resent. + /** + * Replays messages to the endpoint. + * + * Only messages that were created after `since` will be sent. + * Messages that were previously sent to the endpoint are not resent. + */ public replayMissing( appId: string, endpointId: string, @@ -215,10 +219,12 @@ export class Endpoint { }); } - /// Get the endpoint's signing secret. - /// - /// This is used to verify the authenticity of the webhook. - /// For more information please refer to [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/). + /** + * Get the endpoint's signing secret. + * + * This is used to verify the authenticity of the webhook. + * For more information please refer to [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/). + */ public getSecret(appId: string, endpointId: string): Promise { return this.api.v1EndpointGetSecret({ appId, @@ -226,9 +232,11 @@ export class Endpoint { }); } - /// Rotates the endpoint's signing secret. - /// - /// The previous secret will remain valid for the next 24 hours. + /** + * Rotates the endpoint's signing secret. + * + * The previous secret will remain valid for the next 24 hours. + */ public rotateSecret( appId: string, endpointId: string, @@ -243,7 +251,7 @@ export class Endpoint { }); } - /// Send an example message for an event + /** Send an example message for an event. */ public sendExample( appId: string, endpointId: string, @@ -258,11 +266,11 @@ export class Endpoint { }); } - /// Get basic statistics for the endpoint. + /** Get basic statistics for the endpoint. */ public getStats( appId: string, endpointId: string, - options?: EndpointStatsOptions + options?: EndpointGetStatsOptions ): Promise { return this.api.v1EndpointGetStats({ appId, @@ -273,7 +281,7 @@ export class Endpoint { }); } - /// Get the transformation code associated with this endpoint + /** Get the transformation code associated with this endpoint. */ public transformationGet( appId: string, endpointId: string @@ -284,7 +292,7 @@ export class Endpoint { }); } - /// Set or unset the transformation code associated with this endpoint + /** Set or unset the transformation code associated with this endpoint. */ public transformationPartialUpdate( appId: string, endpointId: string, diff --git a/javascript/src/api/event_type.ts b/javascript/src/api/event_type.ts index e2ac7d072..132103ac1 100644 --- a/javascript/src/api/event_type.ts +++ b/javascript/src/api/event_type.ts @@ -14,15 +14,15 @@ import { import { PostOptions } from "../util"; export interface EventTypeListOptions { - /// Limit the number of returned items + /** Limit the number of returned items */ limit?: number; - /// The iterator returned from a prior invocation + /** The iterator returned from a prior invocation */ iterator?: string | null; - /// The sorting order of the returned items + /** The sorting order of the returned items */ order?: Ordering; - /// When `true` archived (deleted but not expunged) items are included in the response + /** When `true` archived (deleted but not expunged) items are included in the response. */ includeArchived?: boolean; - /// When `true` the full item (including the schema) is included in the response + /** When `true` the full item (including the schema) is included in the response. */ withContent?: boolean; } @@ -33,7 +33,7 @@ export class EventType { this.api = new EventTypeApi(config); } - /// Return the list of event types. + /** Return the list of event types. */ public list(options?: EventTypeListOptions): Promise { return this.api.v1EventTypeList({ ...options, @@ -41,11 +41,13 @@ export class EventType { }); } - /// Create new or unarchive existing event type. - /// - /// Unarchiving an event type will allow endpoints to filter on it and messages to be sent with it. - /// Endpoints filtering on the event type before archival will continue to filter on it. - /// This operation does not preserve the description and schemas. + /** + * Create new or unarchive existing event type. + * + * Unarchiving an event type will allow endpoints to filter on it and messages to be sent with it. + * Endpoints filtering on the event type before archival will continue to filter on it. + * This operation does not preserve the description and schemas. + */ public create(eventTypeIn: EventTypeIn, options?: PostOptions): Promise { return this.api.v1EventTypeCreate({ eventTypeIn, @@ -53,11 +55,13 @@ export class EventType { }); } - /// Given an OpenAPI spec, create new or update existing event types. - /// If an existing `archived` event type is updated, it will be unarchived. - /// - /// The importer will convert all webhooks found in the either the `webhooks` or `x-webhooks` - /// top-level. + /** + * Given an OpenAPI spec, create new or update existing event types. + * If an existing `archived` event type is updated, it will be unarchived. + * + * The importer will convert all webhooks found in the either the `webhooks` or `x-webhooks` + * top-level. + */ public importOpenapi( eventTypeImportOpenApiIn: EventTypeImportOpenApiIn, options?: PostOptions @@ -68,14 +72,14 @@ export class EventType { }); } - /// Get an event type. + /** Get an event type. */ public get(eventTypeName: string): Promise { return this.api.v1EventTypeGet({ eventTypeName, }); } - /// Update an event type. + /** Update an event type. */ public update( eventTypeName: string, eventTypeUpdate: EventTypeUpdate @@ -86,19 +90,21 @@ export class EventType { }); } - /// Archive an event type. - /// - /// Endpoints already configured to filter on an event type will continue to do so after archival. - /// However, new messages can not be sent with it and endpoints can not filter on it. - /// An event type can be unarchived with the - /// [create operation](#operation/create_event_type_api_v1_event_type__post). + /** + * Archive an event type. + * + * Endpoints already configured to filter on an event type will continue to do so after archival. + * However, new messages can not be sent with it and endpoints can not filter on it. + * An event type can be unarchived with the + * [create operation](#operation/create_event_type_api_v1_event_type__post). + */ public delete(eventTypeName: string): Promise { return this.api.v1EventTypeDelete({ eventTypeName, }); } - /// Partially update an event type. + /** Partially update an event type. */ public patch( eventTypeName: string, eventTypePatch: EventTypePatch diff --git a/javascript/src/api/integration.ts b/javascript/src/api/integration.ts index ba5764d81..22e81937e 100644 --- a/javascript/src/api/integration.ts +++ b/javascript/src/api/integration.ts @@ -12,11 +12,11 @@ import { import { PostOptions } from "../util"; export interface IntegrationListOptions { - /// Limit the number of returned items + /** Limit the number of returned items */ limit?: number; - /// The iterator returned from a prior invocation + /** The iterator returned from a prior invocation */ iterator?: string | null; - /// The sorting order of the returned items + /** The sorting order of the returned items */ order?: Ordering; } @@ -27,7 +27,7 @@ export class Integration { this.api = new IntegrationApi(config); } - /// List the application's integrations. + /** List the application's integrations. */ public list( appId: string, options?: IntegrationListOptions @@ -39,7 +39,7 @@ export class Integration { }); } - /// Create an integration. + /** Create an integration. */ public create( appId: string, integrationIn: IntegrationIn, @@ -52,7 +52,7 @@ export class Integration { }); } - /// Get an integration. + /** Get an integration. */ public get(appId: string, integId: string): Promise { return this.api.v1IntegrationGet({ appId, @@ -60,7 +60,7 @@ export class Integration { }); } - /// Update an integration. + /** Update an integration. */ public update( appId: string, integId: string, @@ -73,7 +73,7 @@ export class Integration { }); } - /// Delete an integration. + /** Delete an integration. */ public delete(appId: string, integId: string): Promise { return this.api.v1IntegrationDelete({ appId, @@ -88,7 +88,7 @@ export class Integration { }); } - /// Rotate the integration's key. The previous key will be immediately revoked. + /** Rotate the integration's key. The previous key will be immediately revoked. */ public rotateKey( appId: string, integId: string, diff --git a/javascript/src/api/message.ts b/javascript/src/api/message.ts index a36ee5f48..74b873bed 100644 --- a/javascript/src/api/message.ts +++ b/javascript/src/api/message.ts @@ -9,21 +9,21 @@ import { import { PostOptions } from "../util"; export interface MessageListOptions { - /// Limit the number of returned items + /** Limit the number of returned items */ limit?: number; - /// The iterator returned from a prior invocation + /** The iterator returned from a prior invocation */ iterator?: string | null; - /// Filter response based on the channel + /** Filter response based on the channel. */ channel?: string; - /// Only include items created before a certain date + /** Only include items created before a certain date. */ before?: Date | null; - /// Only include items created after a certain date + /** Only include items created after a certain date. */ after?: Date | null; - /// When `true` message payloads are included in the response + /** When `true` message payloads are included in the response. */ withContent?: boolean; - /// Filter messages matching the provided tag + /** Filter messages matching the provided tag. */ tag?: string; - /// Filter response based on the event type + /** Filter response based on the event type */ eventTypes?: string[]; } @@ -34,15 +34,17 @@ export class Message { this.api = new MessageApi(config); } - /// List all of the application's messages. - /// - /// The `before` and `after` parameters let you filter all items created before or after a certain date. These can be used alongside an iterator to paginate over results - /// within a certain window. - /// - /// Note that by default this endpoint is limited to retrieving 90 days' worth of data - /// relative to now or, if an iterator is provided, 90 days before/after the time indicated - /// by the iterator ID. If you require data beyond those time ranges, you will need to explicitly - /// set the `before` or `after` parameter as appropriate. + /** + * List all of the application's messages. + * + * The `before` and `after` parameters let you filter all items created before or after a certain date. These can be used alongside an iterator to paginate over results + * within a certain window. + * + * Note that by default this endpoint is limited to retrieving 90 days' worth of data + * relative to now or, if an iterator is provided, 90 days before/after the time indicated + * by the iterator ID. If you require data beyond those time ranges, you will need to explicitly + * set the `before` or `after` parameter as appropriate. + */ public list( appId: string, options?: MessageListOptions @@ -56,15 +58,17 @@ export class Message { }); } - /// Creates a new message and dispatches it to all of the application's endpoints. - /// - /// The `eventId` is an optional custom unique ID. It's verified to be unique only up to a day, after that no verification will be made. - /// If a message with the same `eventId` already exists for the application, a 409 conflict error will be returned. - /// - /// The `eventType` indicates the type and schema of the event. All messages of a certain `eventType` are expected to have the same schema. Endpoints can choose to only listen to specific event types. - /// Messages can also have `channels`, which similar to event types let endpoints filter by them. Unlike event types, messages can have multiple channels, and channels don't imply a specific message content or schema. - /// - /// The `payload` property is the webhook's body (the actual webhook message). Svix supports payload sizes of up to ~350kb, though it's generally a good idea to keep webhook payloads small, probably no larger than 40kb. + /** + * Creates a new message and dispatches it to all of the application's endpoints. + * + * The `eventId` is an optional custom unique ID. It's verified to be unique only up to a day, after that no verification will be made. + * If a message with the same `eventId` already exists for the application, a 409 conflict error will be returned. + * + * The `eventType` indicates the type and schema of the event. All messages of a certain `eventType` are expected to have the same schema. Endpoints can choose to only listen to specific event types. + * Messages can also have `channels`, which similar to event types let endpoints filter by them. Unlike event types, messages can have multiple channels, and channels don't imply a specific message content or schema. + * + * The `payload` property is the webhook's body (the actual webhook message). Svix supports payload sizes of up to ~350kb, though it's generally a good idea to keep webhook payloads small, probably no larger than 40kb. + */ public create( appId: string, messageIn: MessageIn, @@ -77,7 +81,7 @@ export class Message { }); } - /// Get a message by its ID or eventID. + /** Get a message by its ID or eventID. */ public get(appId: string, msgId: string): Promise { return this.api.v1MessageGet({ appId, @@ -85,9 +89,12 @@ export class Message { }); } - /// Delete the given message's payload. Useful in cases when a message was accidentally sent with sensitive content. - /// - /// The message can't be replayed or resent once its payload has been deleted or expired. + /** + * Delete the given message's payload. + * + * Useful in cases when a message was accidentally sent with sensitive content. + * The message can't be replayed or resent once its payload has been deleted or expired. + */ public expungeContent(appId: string, msgId: string): Promise { return this.api.v1MessageExpungeContent({ appId, diff --git a/javascript/src/api/message_attempt.ts b/javascript/src/api/message_attempt.ts index fb3c7ab15..a82d56139 100644 --- a/javascript/src/api/message_attempt.ts +++ b/javascript/src/api/message_attempt.ts @@ -24,80 +24,80 @@ export interface MessageAttemptListOptions { } export interface MessageAttemptListByEndpointOptions { - /// Limit the number of returned items + /** Limit the number of returned items */ limit?: number; - /// The iterator returned from a prior invocation + /** The iterator returned from a prior invocation */ iterator?: string | null; - /// Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3) + /** Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3) */ status?: MessageStatus; - /// Filter response based on the HTTP status code + /** Filter response based on the HTTP status code */ statusCodeClass?: StatusCodeClass; - /// Filter response based on the channel + /** Filter response based on the channel */ channel?: string; - /// Filter response based on the tag + /** Filter response based on the tag */ tag?: string; - /// Only include items created before a certain date + /** Only include items created before a certain date */ before?: Date | null; - /// Only include items created after a certain date + /** Only include items created after a certain date */ after?: Date | null; - /// When `true` attempt content is included in the response + /** When `true` attempt content is included in the response */ withContent?: boolean; - /// When `true`, the message information is included in the response + /** When `true`, the message information is included in the response */ withMsg?: boolean; - /// Filter response based on the event type + /** Filter response based on the event type */ eventTypes?: string[]; } export interface MessageAttemptListByMsgOptions { - /// Limit the number of returned items + /** Limit the number of returned items */ limit?: number; - /// The iterator returned from a prior invocation + /** The iterator returned from a prior invocation */ iterator?: string | null; - /// Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3) + /** Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3) */ status?: MessageStatus; - /// Filter response based on the HTTP status code + /** Filter response based on the HTTP status code */ statusCodeClass?: StatusCodeClass; - /// Filter response based on the channel + /** Filter response based on the channel */ channel?: string; - /// Filter response based on the tag + /** Filter response based on the tag */ tag?: string; - /// Filter the attempts based on the attempted endpoint + /** Filter the attempts based on the attempted endpoint */ endpointId?: string; - /// Only include items created before a certain date + /** Only include items created before a certain date */ before?: Date | null; - /// Only include items created after a certain date + /** Only include items created after a certain date */ after?: Date | null; - /// When `true` attempt content is included in the response + /** When `true` attempt content is included in the response */ withContent?: boolean; - /// Filter response based on the event type + /** Filter response based on the event type */ eventTypes?: string[]; } export interface MessageAttemptListAttemptedMessagesOptions { - /// Limit the number of returned items + /** Limit the number of returned items */ limit?: number; - /// The iterator returned from a prior invocation + /** The iterator returned from a prior invocation */ iterator?: string | null; - /// Filter response based on the channel + /** Filter response based on the channel */ channel?: string; - /// Filter response based on the message tags + /** Filter response based on the message tags */ tag?: string; - /// Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3) + /** Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3) */ status?: MessageStatus; - /// Only include items created before a certain date + /** Only include items created before a certain date */ before?: Date | null; - /// Only include items created after a certain date + /** Only include items created after a certain date */ after?: Date | null; - /// When `true` message payloads are included in the response + /** When `true` message payloads are included in the response */ withContent?: boolean; - /// Filter response based on the event type + /** Filter response based on the event type */ eventTypes?: string[]; } export interface MessageAttemptListAttemptedDestinationsOptions { - /// Limit the number of returned items + /** Limit the number of returned items */ limit?: number; - /// The iterator returned from a prior invocation + /** The iterator returned from a prior invocation */ iterator?: string | null; } @@ -119,12 +119,14 @@ export class MessageAttempt { return this.listByMsg(appId, msgId, options); } - /// List attempts by endpoint id - /// - /// Note that by default this endpoint is limited to retrieving 90 days' worth of data - /// relative to now or, if an iterator is provided, 90 days before/after the time indicated - /// by the iterator ID. If you require data beyond those time ranges, you will need to explicitly - /// set the `before` or `after` parameter as appropriate. + /** + * List attempts by endpoint id + * + * Note that by default this endpoint is limited to retrieving 90 days' worth of data + * relative to now or, if an iterator is provided, 90 days before/after the time indicated + * by the iterator ID. If you require data beyond those time ranges, you will need to explicitly + * set the `before` or `after` parameter as appropriate. + */ public listByEndpoint( appId: string, endpointId: string, @@ -140,12 +142,14 @@ export class MessageAttempt { }); } - /// List attempts by message id - /// - /// Note that by default this endpoint is limited to retrieving 90 days' worth of data - /// relative to now or, if an iterator is provided, 90 days before/after the time indicated - /// by the iterator ID. If you require data beyond those time ranges, you will need to explicitly - /// set the `before` or `after` parameter as appropriate. + /** + * List attempts by message ID. + * + * Note that by default this endpoint is limited to retrieving 90 days' worth of data + * relative to now or, if an iterator is provided, 90 days before/after the time indicated + * by the iterator ID. If you require data beyond those time ranges, you will need to explicitly + * set the `before` or `after` parameter as appropriate. + */ public listByMsg( appId: string, msgId: string, @@ -161,14 +165,16 @@ export class MessageAttempt { }); } - /// List messages for a particular endpoint. Additionally includes metadata about the latest message attempt. - /// - /// The `before` parameter lets you filter all items created before a certain date and is ignored if an iterator is passed. - /// - /// Note that by default this endpoint is limited to retrieving 90 days' worth of data - /// relative to now or, if an iterator is provided, 90 days before/after the time indicated - /// by the iterator ID. If you require data beyond those time ranges, you will need to explicitly - /// set the `before` or `after` parameter as appropriate. + /** + * List messages for a particular endpoint. Additionally includes metadata about the latest message attempt. + * + * The `before` parameter lets you filter all items created before a certain date and is ignored if an iterator is passed. + * + * Note that by default this endpoint is limited to retrieving 90 days' worth of data + * relative to now or, if an iterator is provided, 90 days before/after the time indicated + * by the iterator ID. If you require data beyond those time ranges, you will need to explicitly + * set the `before` or `after` parameter as appropriate. + */ public listAttemptedMessages( appId: string, endpointId: string, @@ -184,7 +190,7 @@ export class MessageAttempt { }); } - /// `msg_id`: Use a message id or a message `eventId` + /** `msg_id`: Use a message id or a message `eventId` */ public get( appId: string, msgId: string, @@ -197,7 +203,12 @@ export class MessageAttempt { }); } - /// Deletes the given attempt's response body. Useful when an endpoint accidentally returned sensitive content. + /** + * Deletes the given attempt's response body. + * + * Useful when an endpoint accidentally returned sensitive content. + * The message can't be replayed or resent once its payload has been deleted or expired. + */ public expungeContent(appId: string, msgId: string, attemptId: string): Promise { return this.api.v1MessageAttemptExpungeContent({ appId, @@ -206,8 +217,12 @@ export class MessageAttempt { }); } - /// List endpoints attempted by a given message. Additionally includes metadata about the latest message attempt. - /// By default, endpoints are listed in ascending order by ID. + /** + * List endpoints attempted by a given message. + * + * Additionally includes metadata about the latest message attempt. + * By default, endpoints are listed in ascending order by ID. + */ public listAttemptedDestinations( appId: string, msgId: string, @@ -221,7 +236,7 @@ export class MessageAttempt { }); } - /// Resend a message to the specified endpoint. + /** Resend a message to the specified endpoint. */ public resend( appId: string, msgId: string, diff --git a/javascript/src/api/statistics.ts b/javascript/src/api/statistics.ts index f7cc65015..853da686d 100644 --- a/javascript/src/api/statistics.ts +++ b/javascript/src/api/statistics.ts @@ -15,10 +15,12 @@ export class Statistics { this.api = new StatisticsApi(config); } - /// Creates a background task to calculate the message destinations for all applications in the environment. - /// - /// Note that this endpoint is asynchronous. You will need to poll the `Get Background Task` endpoint to - /// retrieve the results of the operation. + /** + * Creates a background task to calculate the message destinations for all applications in the environment. + * + * Note that this endpoint is asynchronous. You will need to poll the `Get Background Task` endpoint to + * retrieve the results of the operation. + */ public aggregateAppStats( appUsageStatsIn: AppUsageStatsIn, options?: PostOptions @@ -29,10 +31,12 @@ export class Statistics { }); } - /// Creates a background task to calculate the listed event types for all apps in the organization. - /// - /// Note that this endpoint is asynchronous. You will need to poll the `Get Background Task` endpoint to - /// retrieve the results of the operation. + /** + * Creates a background task to calculate the listed event types for all apps in the organization. + * + * Note that this endpoint is asynchronous. You will need to poll the `Get Background Task` endpoint to + * retrieve the results of the operation. + */ public aggregateEventTypes(): Promise { return this.api.v1StatisticsAggregateEventTypes({}); } diff --git a/javascript/src/index.ts b/javascript/src/index.ts index 31121a1c3..dbb4dce9a 100644 --- a/javascript/src/index.ts +++ b/javascript/src/index.ts @@ -26,7 +26,7 @@ export * from "./webhook"; export { ApplicationListOptions } from "./api/application"; export { BackgroundTaskListOptions } from "./api/background_task"; -export { EndpointListOptions, EndpointStatsOptions } from "./api/endpoint"; +export { EndpointListOptions, EndpointGetStatsOptions } from "./api/endpoint"; export { EventTypeListOptions } from "./api/event_type"; export { IntegrationListOptions } from "./api/integration"; export { MessageListOptions, messageInRaw } from "./api/message";