Skip to content

Commit

Permalink
feat: deprecate webhook retry policy methods
Browse files Browse the repository at this point in the history
  • Loading branch information
t-col committed Mar 19, 2024
1 parent 69bc48b commit ff67e58
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 32 deletions.
9 changes: 9 additions & 0 deletions lib/adapters/REST/endpoints/webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ export const getSigningSecret: RestEndpoint<'Webhook', 'getSigningSecret'> = (
return raw.get(http, getWebhookSigningSecretUrl(params))
}

/**
* @deprecated The EAP for this feature has ended. This method will be removed in the next major version.
*/
export const getRetryPolicy: RestEndpoint<'Webhook', 'getRetryPolicy'> = (
http: AxiosInstance,
params: GetSpaceParams
Expand Down Expand Up @@ -148,6 +151,9 @@ export const upsertSigningSecret: RestEndpoint<'Webhook', 'upsertSigningSecret'>
return raw.put<WebhookSigningSecretProps>(http, getWebhookSigningSecretUrl(params), data)
}

/**
* @deprecated The EAP for this feature has ended. This method will be removed in the next major version.
*/
export const upsertRetryPolicy: RestEndpoint<'Webhook', 'upsertRetryPolicy'> = async (
http: AxiosInstance,
params: GetSpaceParams,
Expand All @@ -172,6 +178,9 @@ export const deleteSigningSecret: RestEndpoint<'Webhook', 'deleteSigningSecret'>
return raw.del<void>(http, getWebhookSigningSecretUrl(params))
}

/**
* @deprecated The EAP for this feature has ended. This method will be removed in the next major version.
*/
export const deleteRetryPolicy: RestEndpoint<'Webhook', 'deleteRetryPolicy'> = async (
http: AxiosInstance,
params: GetSpaceParams
Expand Down
35 changes: 3 additions & 32 deletions lib/plain/entities/webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,47 +164,18 @@ export type WebhookPlainClientAPI = {

// Webhook Retry Policies
/**
* Fetch the webhook retry policy for a given Space
* @param params entity IDs to identify the Space which the retry policy belongs to
* @returns the maxRetries value configured in the Retry Policy
* @throws if the request fails, the Space is not found, or the retry policy does not exist
* @example
* ```javascript
* const retryPolicy = await client.webhook.getRetryPolicy({
* spaceId: '<space_id>',
* });
* @deprecated The EAP for this feature has ended. This method will be removed in the next major version.
*/
getRetryPolicy(params: OptionalDefaults<GetSpaceParams>): Promise<WebhookRetryPolicyProps>
/**
* Creates or updates the webhook retry policy for a given Space
* @param params entity IDs to identify the Space which the retry policy belongs to
* @param rawData the maxRetries with integer value >= 2 and <= 99 value to set in the Retry Policy
* @returns the webhook retry policy
* @throws if the request fails, the Space is not found, or the payload is malformed
* @example
* ```javascript
* const retryPolicy = await client.webhook.upsertRetryPolicy({
* spaceId: '<space_id>',
* },
* {
* maxRetries: 15,
* });
* ```
* @deprecated The EAP for this feature has ended. This method will be removed in the next major version.
*/
upsertRetryPolicy(
params: OptionalDefaults<GetSpaceParams>,
rawData: WebhookRetryPolicyPayload
): Promise<WebhookRetryPolicyProps>
/**
* Removes the webhook retry policy for a given Space
* @param params entity IDs to identify the Space which the retry policy belongs to
* @throws if the request fails, the Space is not found, or the retry policy does not exist
* @example
* ```javascript
* await client.webhook.deleteRetryPolicy({
* spaceId: '<space_id>',
* });
* ```
* @deprecated The EAP for this feature has ended. This method will be removed in the next major version.
*/
deleteRetryPolicy(params: OptionalDefaults<GetSpaceParams>): Promise<void>

Expand Down

0 comments on commit ff67e58

Please sign in to comment.