# WebhookEntry

TYPE in `@skmtc/core 0.63.4`

The entry of a webhook generator, which `toWebhookEntry` makes. It
represents the generator to core, and a generator has one.

When `isSupported` or `toPreviewModule` uses the result of `toEnrichments`
on its own entry, declare the type of the entry:
`const entry: WebhookEntry<EnrichmentSchema> = toWebhookEntry(...)`.
Without it, TypeScript reports TS7022.

## Signature

```ts
import type { WebhookEntry } from '@skmtc/core'

type WebhookEntry<EnrichmentType = undefined> = { ... }
```

- `EnrichmentType`: The enrichments that `toEnrichmentSchema` parses

## Properties

- `id` (string, required)
- `type` ('webhook', required)
- `projections` (readonly DeclaredProjection[]): The projection classes the entry declared; absent when it declared none. See `DeclaredProjection`.
- `transform` ((args: TransformWebhookArgs) => void, required)
- `toEnrichmentSchema` (() => v.GenericSchema<EnrichmentType>, required)
- `toEnrichments` ((args: ToWebhookEnrichmentsArgs) => EnrichmentType, required): The generator's enrichments for one webhook and variant, parsed with `toEnrichmentSchema`. The factory makes it: it is not a config key.
- `isSupported` ((args: IsSupportedWebhookArgs) => boolean, required)
- `supportsVariant` (() => boolean, required)
- `toPreviewModule` ((args: ToWebhookPreviewModuleArgs) => PreviewModule)
- `toEnrichmentRequest` (<RequestedEnrichment extends EnrichmentType>(webhook: OasWebhook) => EnrichmentRequest<RequestedEnrichment> | undefined)
- `toEnrichmentDefaults` ((args: ToWebhookEnrichmentsArgs) => EnrichmentType | undefined)
