Webhooks
WebhookProjectionInstance
What a webhook projection gets from its base class, on this.
toWebhookProjectionBase returns the class. The types are named because deno doc and JSR cannot show the members of a class that a function returns.
Signature
import type { WebhookProjectionInstance } from '@skmtc/core'
interface WebhookProjectionInstance<EnrichmentType = undefined, ProjectionOptions = undefined> extends SnippetBase, ProjectionModelInserts, ProjectionOperationInsertsProperties
The projection's identifier, export path, variant and enrichments.
The webhook this projection is built for.
The caller's options.
The generation context providing access to OAS objects and utilities
Whether this generator has been skipped
Optional generator key - attribution input only
Position of the schema fragment this snippet was built from, as a StackTrail. Callers pass a stable snapshot (a clone taken at the call site - StackTrail is mutable, so an un-cloned reference would alias a trail that later append/remove calls could mutate). The empty trail (StackTrail.empty()) means "no single originating node", in which case the resolver uses the generator-key-derived pointer. Converted to a JSON Pointer string only at the resolver - never carried as a string here.
Insert a related model and return its Inserted reference. The model's name is imported into this projection's file when it is in another one.
Pass { variant } for a variant of the model other than 'main'. { options } is required when the peer declares options and refused when it does not.
{ noExport: true } makes a definition that is not exported. Use it only when the peer's export path is this projection's file and no other file uses the definition: imports are added without a check for it. It has no effect on a definition that exists already.
Insert a schema that can be a $ref or an inline schema, such as a request body. A $ref inserts its model. An inline schema becomes a definition named fallbackName in this projection's file.
{ variant } and { options } reach the $ref branch only. For an inline schema, put what distinguishes it into fallbackName.
{ noExport: true } reaches both branches, and makes a definition that is not exported. Use it only when no other file uses the definition. For a $ref, the peer's export path must also be this projection's file: imports are added without a check for noExport. It has no effect on a definition that exists already.
Insert a related operation and return its Inserted reference. The operation's name is imported into this projection's file when it is in another one.
Pass { variant } for a variant of the operation other than 'main'. { options } is required when the peer declares options and refused when it does not.
{ noExport: true } makes a definition that is not exported. Use it only when the peer's export path is this projection's file and no other file uses the definition: imports are added without a check for it. It has no effect on a definition that exists already.