Docs@skmtc/core

Webhooks

TYPE

WebhookProjectionBaseConfig

@skmtc/core 0.63.4

Configuration for toWebhookProjectionBase.

Sibling of OasOperationProjectionBaseConfig for the webhook subject. Generic over the identifier-type shape IdType: a language veneer parameterizes this config with its own XxIdentifierType (WebhookProjectionBaseConfig<E, KtIdentifierType>) so toIdentifierType's return tightens to that language's type vocabulary - no recast.

Signature

import type { WebhookProjectionBaseConfig } from '@skmtc/core'

type WebhookProjectionBaseConfig<EnrichmentType = undefined, IdType extends IdentifierType = IdentifierType, ProjectionOptions = undefined> = { ... }

Properties

id, string required
toIdentifierName, (args: ToWebhookIdentifierNameArgs<EnrichmentType, ProjectionOptions>) => string required

Pure: the cache-key name (the cache-check path runs this).

toIdentifierType, (webhook: OasWebhook, context: GenerateContextType) => IdType required

Context-aware, overridable: the non-name parts of the identifier, derived from the webhook. Runs only on cache-miss. Returns this language's XxIdentifierType (IdType; the loose type: string by default).

toExportPath, (args: ToWebhookExportPathArgs<EnrichmentType, ProjectionOptions>) => string required
toEnrichmentDefaults, (args: ToEnrichmentsArgs) => EnrichmentType | undefined

Optional: compute the DEFAULT enrichment values for a webhook from its schema - the seed the CMS persists and the user then edits (vs the entry's toEnrichments, which READS already-authored values).