Webhooks
toWebhookProjectionBase
Build a webhook projection base class from a per-generator config.
Sibling of toOasOperationProjectionBase. The returned class extends base - the generator's language snippet base - so the projection hierarchy is language-bound at its root while core stays language-blind. It exposes the generator's id, toIdentifierName, toIdentifierType, and toExportPath statics, inherits the static lang from the base, and injects the webhook generatorKey.
Defines NO register / registerInto - those live in the language package's projection-base veneer over this factory.
Signature
import { toWebhookProjectionBase } from '@skmtc/core'
toWebhookProjectionBase<EnrichmentType = undefined, IdType extends IdentifierType = IdentifierType, ProjectionOptions = undefined>(
base: LangSnippetConstructor,
config: WebhookProjectionBaseConfig<EnrichmentType, IdType, ProjectionOptions>
): WebhookProjectionBaseClass<EnrichmentType, IdType, ProjectionOptions>Parameters
Pure: the cache-key name (the cache-check path runs this).
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).
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).