Skip to content

Commit

Permalink
Added SF context object docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jormaechea committed Feb 1, 2024
1 parent a944647 commit 1c92aec
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions lib/lambda-bases/lambda.js
Expand Up @@ -7,6 +7,13 @@ const lodashPick = require('lodash/pick');
const NANOID_LENGTH = 10;
const nanoid = customAlphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789', NANOID_LENGTH);

/**
* @typedef {object} StepFunctionContext
* @property {string} EnteredTime ISO 8601 Date string
* @property {string} Name The name of the State Machine
* @property {number} RetryCount The current number of retry attempts of a task
*/

module.exports = class Lambda {

/**
Expand Down Expand Up @@ -40,30 +47,30 @@ module.exports = class Lambda {
}

/**
* @param {*} taskToken The task token. Only present for async invoked tasks of state machines
* @param {string?} [] The task token. Only present for async invoked tasks of state machines
*/
set taskToken(taskToken) {
/** @private */
this._taskToken = taskToken;
}

/**
* @returns {*} The task token. Only present for async invoked tasks of state machines
* @returns {string?} The task token. Only present for async invoked tasks of state machines
*/
get taskToken() {
return this._taskToken;
}

/**
* @param {*} state The invocation state. Only present for async invoked tasks of state machines
* @param {StepFunctionContext?} state The invocation state. Only present for async invoked tasks of state machines
*/
set state(state) {
/** @private */
this._state = state;
}

/**
* @returns {*} The invocation state. Only present for async invoked tasks of state machines
* @returns {StepFunctionContext?} The invocation state. Only present for async invoked tasks of state machines
*/
get state() {
return this._state;
Expand Down

0 comments on commit 1c92aec

Please sign in to comment.