Skip to content

Commit af7a124

Browse files
committed
docs: rereview jsdoc in light of new copilot instructions
1 parent c5d9ba9 commit af7a124

4 files changed

Lines changed: 17 additions & 0 deletions

File tree

packages/cdkConstructs/src/constructs/RestApiGateway/StateMachineEndpoint.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {stateMachineRequestTemplate} from "./templates/stateMachineRequest.js"
66
import {stateMachine200ResponseTemplate, stateMachineErrorResponseTemplate} from "./templates/stateMachineResponses.js"
77
import {ExpressStateMachine} from "../StateMachine.js"
88

9+
/** Parameters used to create an API endpoint backed by a Step Functions Express workflow. */
910
export interface StateMachineEndpointProps {
1011
/** Parent API resource under which the state machine endpoint is added. */
1112
parentResource: IResource
@@ -21,6 +22,7 @@ export interface StateMachineEndpointProps {
2122

2223
/** Adds an API Gateway resource/method that starts an Express Step Functions execution. */
2324
export class StateMachineEndpoint extends Construct {
25+
/** API resource created by this construct. */
2426
resource: IResource
2527

2628
/** Wires request and response mapping templates for JSON and FHIR payload flows. */

packages/cdkConstructs/src/constructs/RestApiGateway/templates/stateMachineRequest.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
/* eslint-disable max-len */
2+
/**
3+
* @returns API Gateway request mapping template for StartExecution payloads.
4+
*/
25
export const stateMachineRequestTemplate = (stateMachineArn: string) => {
36
return `## Velocity Template used for API Gateway request mapping template
47
## "@@" is used here as a placeholder for '"' to avoid using escape characters.

packages/cdkConstructs/src/constructs/RestApiGateway/templates/stateMachineResponses.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* eslint-disable max-len */
2+
/** VTL response template that unwraps successful workflow output and forwards status and headers. */
23
export const stateMachine200ResponseTemplate = `#set($payload = $util.parseJson($input.path('$.output')))
34
#set($context.responseOverride.status = $payload.Payload.statusCode)
45
#set($allHeaders = $payload.Payload.headers)
@@ -56,5 +57,8 @@ const getOperationOutcome = (status: string) => {
5657
})
5758
}
5859

60+
/**
61+
* @returns VTL response template that maps workflow failures to FHIR OperationOutcome payloads.
62+
*/
5963
export const stateMachineErrorResponseTemplate = (status: string) => `#set($context.responseOverride.header["Content-Type"] ="application/fhir+json")
6064
${getOperationOutcome(status)}`

packages/cdkConstructs/src/constructs/StateMachine.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ import {Construct} from "constructs"
2222
import {CfnDeliveryStream} from "aws-cdk-lib/aws-kinesisfirehose"
2323
import {ACCOUNT_RESOURCES, LAMBDA_RESOURCES} from "../constants"
2424

25+
/**
26+
* Configuration for provisioning an Express Step Functions state machine
27+
* with logging and optional Splunk forwarding.
28+
*/
2529
export interface StateMachineProps {
2630
/** Stack name, used as prefix for resource naming and DNS records. */
2731
readonly stackName: string
@@ -60,8 +64,12 @@ export interface StateMachineProps {
6064
readonly addSplunkSubscriptionFilter?: boolean
6165
}
6266

67+
/** Creates an Express Step Functions workflow with CloudWatch logging and invoke permissions. */
6368
export class ExpressStateMachine extends Construct {
69+
/** Managed policy that grants permission to start this workflow. */
6470
public readonly executionPolicy: ManagedPolicy
71+
72+
/** Created Step Functions state machine resource. */
6573
public readonly stateMachine: StateMachine
6674

6775
/**

0 commit comments

Comments
 (0)