Docs@skmtc/core

Operations

TYPE

OasOperationEntry

@skmtc/core 0.63.4

The entry of an operation generator, which toOasOperationEntry 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: OasOperationEntry<EnrichmentSchema> = toOasOperationEntry(...). Without it, TypeScript reports TS7022.

Signature

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

type OasOperationEntry<EnrichmentType = undefined> = { ... }
EnrichmentType

The enrichments that toEnrichmentSchema parses

Properties

id, string required
type, 'oasOperation' required
projections, readonly DeclaredProjection[]

The projection classes the entry declared; absent when it declared none. See DeclaredProjection.

transform, (args: TransformOasOperationArgs) => void required
toEnrichmentSchema, () => v.GenericSchema<EnrichmentType> required
toEnrichments, (args: ToOasOperationEnrichmentsArgs) => EnrichmentType required

The generator's enrichments for one operation and variant, parsed with toEnrichmentSchema. The factory makes it: it is not a config key.

isSupported, (args: IsSupportedOasOperationArgs) => boolean required
supportsVariant, () => boolean required
toPreviewModule, (args: ToOasOperationPreviewModuleArgs) => PreviewModule
toEnrichmentRequest, <RequestedEnrichment extends EnrichmentType>(operation: OasOperation) => EnrichmentRequest<RequestedEnrichment> | undefined
toEnrichmentDefaults, (args: ToOasOperationEnrichmentsArgs) => EnrichmentType | undefined