Skip to content

Webhook and header types #294

@NatoBoram

Description

@NatoBoram

I realize this might be out of scope for this library, but I would like for this library to expose types for Jira's webhooks and the headers that come with it.

For example, here's a Jira headers, taken from https://developer.atlassian.com/cloud/jira/software/webhooks/

export interface JiraHeaders {
	/** Every webhook contains the `X-Atlassian-Webhook-Identifier` header that
	 * provides an identifier for a webhook. This identifier is unique within a
	 * Jira Cloud tenant and is the same across retries. After you have processed
	 * a webhook, you can use the identifier to filter out retries. */
	readonly "X-Atlassian-Webhook-Identifier": string
	/** The `X-Atlassian-Webhook-Retry` header with the current retry count is
	 * included with webhooks that have been retried. Monitor this header and
	 * cross-reference it with the callback server logs to stay on top of any
	 * unexpected reliability problems. */
	readonly "X-Atlassian-Webhook-Retry": number
	/** Each webhook contains `X-Atlassian-Webhook-Flow` header with `"Primary"`
	 * or `"Secondary"` value.
	 *
	 * All Primary webhooks should be delivered within 30 seconds.
	 *
	 * All Secondary webhooks are a result of long-lasting bulk or cascade
	 * operation (bulk issue update, project deletion, issue deletion etc.).
	 * those webhooks, the expected delivery time requirements are relaxed,
	 * the delivery should take no more than 15 minutes.
	 *
	 * Note, in those cases, the top level webhook is transferred via Primary
	 * flow, and all dependent webhooks are transferred using the Secondary flow.
	 * For example, when deleting an issue, the issue_deleted event is transferred
	 * as Primary but all dependent `commend_deleted`, `attachment_deleted`
	 * `issuelink_deleted` etc. are Secondary. */
	readonly "X-Atlassian-Webhook-Flow": "Primary" | "Secondary"
	/** To trace the origin of a webhook, Connect apps can attach the additional
	 * `X-Atlassian-Webhook-Trace` HTTP header with any value consisting of a
	 * string of up to 1024 printable ASCII characters to a REST API request.
	 *
	 * The header and its value are then attached to every webhook sent from Jira for the REST API request.
	 *
	 * The app can use the webhook trace header to, for example:
	 *
	 * * Differentiate between webhooks triggered by various REST API requests.
	 * * Track a webhook’s delivery.
	 * * Attach other data for use when a webhook arrives.
	 */
	readonly "X-Atlassian-Webhook-Trace": string
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions