- Changes to
task-factory
module:- Used
ignoreUnhandledRejection
to attach acatch
clause todonePromise
in case it's never used by caller - Changed logging level of
FinalisedError
fromWARN
toERROR
- Used
- Updated dependencies
- Added
.npmignore
- Renamed
release_notes.md
toCHANGES.md
- Updated dependencies
- Updated
core-functions
dependency to version 3.0.22
- Updated
core-functions
dependency to version 3.0.20
- Renamed dummy first exports (
exports._ = '_'; //IDE workaround
) of most modules to (exports._$_ = '_$_';
) to avoid potential future collisions withlodash
&underscore
- Updated
core-functions
dependency to version 3.0.19
- Minor tweak to reduce some unnecessary logging
- Changes to
core
module &StateType
enum:- Renamed
UNSTARTED
,STARTED
,COMPLETED
,TIMED_OUT
,FAILED
&REJECTED
properties to corresponding newUnstarted
,Started
,Completed
,TimedOut
,Failed
&Rejected
properties with values that match their correspondingTaskState
names - Replaced all usages of the original
StateType
properties with their corresponding newStateType
properties, e.g. replaced all usages ofStateType.TIMED_OUT
property withStateType.TimedOut
- For backward compatibility: Re-added deprecated versions of the original
StateType
property names with changed values that now also match their correspondingTaskState
names - Added a
cleanType
function as a static method toStateType
enum
- Renamed
- Changes to
task-states
module &TaskState
class:- Renamed
kind
property totype
- For backward compatibility: Re-added a
kind
getter - Added a more compact
toJSON
method that omits the task's "redundant"name
if it's the same as itstype
- Replaced all usages of the original
StateType
properties with their corresponding newStateType
properties, e.g. replaced all usages ofStateType.TIMED_OUT
property withStateType.TimedOut
- Changed
TaskState
constructor to use the newStateType.cleanType
function - Changed
fromStateLikeProperties
function to use the newStateType.cleanType
function & to treat a missing or blankname
argument as if it was set to the cleanedtype
argument (to handle changes toStateType
values & output from the newtoJSON
method) - Changed
toTaskStateFromStateLike
function to handle newtype
property & still survive a legacykind
property
- Renamed
- Changes to
task-defs
module &TaskDef
class:- Replaced the
executable
property with an optionalmanaged
property, which is ONLY set whentrue
- Added an
executable
getter for backward compatibility - Removed unused
isExecutable
,isNotExecutable
&isInternal
methods - Cleaned up comments to use 'managed' terminology instead of 'internal'
- Replaced the
- Changes to
tasks
module &Task
class:- Replaced
executable
property with an optionalmanaged
property, which is ONLY set whentrue
- Added an
executable
getter for backward compatibility - Removed unused
isExecutable
,isNotExecutable
&isInternal
methods - Changed the
toJSON
method to create more compact strings that: exclude theexecutable
property; ONLY include the newmanaged
property if it's true; and replace thetotalAttempts
property withtotal
- Patched
createSubTask
method to copy the giventaskDefSettings
to avoid mutating them - Cleaned up comments to use 'managed' terminology instead of 'internal'
- Replaced
- Changes to
task-factory
module &TaskFactory
class:- Added
isTaskLikeManaged
static method to handle a new optionalmanaged
property & still survive a legacyexecutable
property
- Added
- Changes to
tasks
module:- Added optional boolean
recursively
andskipSlaves
arguments to thebeganAt
&endedAt
methods & changed them to also update the task's sub-tasks ifrecursively
is true & its slave tasks ifskipSlaves
is false - Changed
start
method to invokebeganAt
withrecursively
false andskipSlaves
true to avoid multiple updates - Minor optimizations to
calculateEnded
&calculateTook
functions
- Added optional boolean
- Changes to
task-factory
module:- Added an optional
donePromiseFlattenOpts
property to theoptions
argument passed toTaskFactory
constructor - Added a
donePromiseFlattenOpts
property toTaskFactory
instances - Changed
executeAndUpdateTask
inner function to resolveoutcome.toPromise()
once & pass it toupdateTask
method - Changed
updateTask
method to:- Accept &
flatten
the passedpromise
to adonePromise
using the factory'slogger
&donePromiseFlattenOpts
properties - Invoke
endedAt
with explicitrecursively
false andskipSlaves
false - Log state & time taken at a trace-level to facilitate suppression of this logging
- Replaced more instances of logging of
error.stack
with logging of just the error
- Accept &
- Added an optional
- Updated
core-functions
dependency to version 3.0.17
- Replaced all logging of
error.stack
with logging of just the error - Updated
core-functions
dependency to version 3.0.15
- Added dummy first exports (
exports._ = '_'; //IDE workaround
) to most modules as a temporary workaround for IDE issue
- Changed almost all modules' exports to modifications of the default
exports
object instead of replacing the defaultmodule.exports
object - Updated
core-functions
dependency to 3.0.13
- Updated
core-functions
dependency to 3.0.11
- Updated
core-functions
dependency to 3.0.10 - Changes to
core
module:- Deleted
TimeoutError
& replaced it with newTimeoutError
incore-functions/errors
module - Changed
FrozenError
&FinalisedError
to better match standardError
contract
- Deleted
- Removed some console logging
- Updated
core-functions
dependency to 3.0.9
- Updated
core-functions
dependency to 3.0.8
- Moved test devDependencies to package.json & removed test/package.json
- Updated
core-functions
dependency to 3.0.7
- Changes to
task-utils.test.js
test module:- Switched test examples back to using prior & shorter
ones
&alls
properties instead ofprocessOneTasks
&processAllTasks
- Switched test examples back to using prior & shorter
- Changes to
tasks
module:- Added
revertAttempts
method to enable reversal of the current number of attempts back to the initial number of attempts that was cached just before the task was last started - Changed
timeout
&timeoutAs
methods to use newrevertAttempts
method instead of manual decrements
- Added
- Merged in changes from 4.0.8
- Changes to
task-defs
module:- Added new optional
skipAddToParent
option tosettings
parameter ofTaskDef
constructor
- Changed constructor behaviour to NOT check for distinct sub-task names & to NOT add the sub-task to its parent's
sub-tasks when the
settings.skipAddToParent
option is passed as true - Added new
unusable
property withget
&set
accessors and an underlying_unusable
property toTaskDef
class
- Added new optional
- Changes to
tasks
module:- Added new
detachSubTask
function to enable a sub-task to be detached from its parent task - Changed
getOrCreateSubTask
function to replace an existing unusable sub-task with a usable version by detaching the old unusable sub-task, creating the new sub-task viacreateSubTask
& updating the new from the old - & to create a new sub-task, both with new sub-task definitions created with defaulted to true if not explicitly set
- Changed
createSubTask
function to default newsettings.skipAddToParent
option to true if not explicitly set - Added new
isFullyFinalisedOrUnusable
function - Changed
updateFromPriorVersion
function to NOT mark missing sub-tasks asabandoned
and to instead rely on newunusable
properties - Added read-only
unusable
property withget
accessor that delegates to its task definition'sunusable
property
- Added new
- Changes to
task-factory
module:- Changed
reincarnateTasks
function to NOT mark missing sub-tasks asabandoned
and to instead recreate them as unusable tasks, first updated from their prior versions & then reset - Changed
reconstructTaskDefsFromRootTaskLike
function to properly generate placeholderdoNotExecute
functions (which are also now marked withplaceholder
properties set to true) using the new innergeneratePlaceholderFunction
function and to mark all reconstructed task definitions & sub-task definitions asunusable
- Changed
- Started integrating unusable task definition changes from 4.0.8
- Changes to
tasks
module &Task
class:- Fixed behaviour of
reject
,discard
,abandon
&rejectAs
methods to first recurse through sub-tasks, to ONLY allow the state change if the task is incomplete AND every one of it sub-task is fully finalised & to return the number of tasks & sub-tasks actually rejected. Rationale for change: Should NOT be able to reject a task with incomplete sub-tasks - Added new
discardIfOverAttempted
method, which is a variation of thediscard
method, that first recurses through the task's sub-tasks, ONLY allows the state change if the task is incomplete, OVER-ATTEMPTED AND every one of its sub-task is fully finalised & finally returns the number of tasks & sub-tasks actually rejected
- Fixed behaviour of
- Changes to
task-factory
module:- Changed the behaviour of the
updateTask
function to useTry.findFailure
to do a much deeper search for a Failure instead of only checking the top-level result for a Failure
- Changed the behaviour of the
- Changes to
task-utils
module:- Added new
isAnyTaskNotFullyFinalised
function
- Added new
- Changes to
core
module:- Added
compareStateTypes
function for sorting state types from "least advanced" to "most advanced"
- Added
- Changes to
task-states
module:- Added
compareStates
function for sorting states from "least advanced" to "most advanced"
- Added
- More changes to
tasks
module &Task
class:- Changed behaviour of
setSlaveTasks
method to:- Set the master task's began & ended date-times to those of its slave task with the most recent began date-time
- Set the master task's state to the "least advanced" state of all of its slave tasks (if its undefined or unstarted)
- Removed redundant dependency on
deep-equal
module
- Changed behaviour of
- Updated
core-functions
dependency to version 3.0.4 - Upgraded to Node 6.10.3
- Renamed
errors
module tocore
module:- Added
StateType
enum to represent the underlying types/kinds of states - Added
ReturnMode
enum to represent the different types of return modes that can be used to handle values returned and errors thrown by tasks'execute
methods
- Added
- Changes to
task-states
module:- Changes to
TaskState
class:- Renamed
_name
property toname
- Added a new StateType
kind
property (seeStateType
enum incore
module for valid values) - Removed
_completed
,_timedOut
&_rejected
properties, which were all replaced by the new StateTypekind
property - Renamed
_error
property toerror
- Renamed
_reason
property toreason
- Changed
TaskState
constructor to take a single StateTypekind
argument instead of the original threecompleted
,timedOut
&rejected
arguments - Removed
name
,error
&reason
getters, which were no longer needed after the rename of the_name
,_error
and_reason
properties - Re-implemented
unstarted
,started
,completed
,failed
,timedOut
,rejected
,incomplete
&finalised
getters to use the new StateTypekind
property - Removed
toJSON
method (redundant after rename & change of properties)
- Renamed
- Changed constructors of all
TaskState
subclasses to pass the appropriate StateTypekind
argument to their superclass constructor - Renamed the old
toTaskState
function tofromLegacyStateLikeProperties
- Added a new
fromStateLikeProperties
function that only accepts the new state properties:name
;kind
;error
; andreason
- Changed the
toTaskStateFromStateLike
function to use the new version of thefromStateLikeProperties
function if the given state-like has akind
property; otherwise to use thefromLegacyStateLikeProperties
function if the given state-like has a legacycompleted
,timedOut
orrejected
property; otherwise to return undefined
- Changes to
- Changes to
task-utils
module:- Renamed
replaceTasksWithNewTasksUpdatedFromOld
function toreviveTasks
- Added
onlyRecreateExisting
option toopts
argument ofreviveTasks
function - Removed
logger
argument fromconfigureTaskFactory
function, since now incorporated into itssettings
argument - Replaced
logger
argument ofconstructTaskFactory
function with newsettings
argument
- Renamed
- Changes to
task-factory
module &TaskFactory
class:- Changes to
TaskFactory
constructor:- Replaced first
logger
argument with more genericsettings
argument (non-backward compatible change), which enables configuration of thelogger
& a defaultdescribeItem
function - Renamed second
opts
argument tooptions
- Replaced first
- Added a new optional
describeItem
function property to theTaskFactory
class - Replaced boolean
returnSuccessOrFailure
property withreturnMode
property - Changed the
generateExecute
function to use the newreturnMode
properties of theTaskFactory
&Task
classes and to also support the newReturnMode.PROMISE
return mode, which wraps the value returned in a resolved Promise or the error thrown in a rejected Promise - Changed the
generateExecute
function to use the new optionaldescribeItem
function property to generate a short description of a task'sexecute
arguments to use for logging & to pass to theupdateTask
method - Changed the
updateTask
method to accept an extrastartTimeInMs
argument to use to calculateend
time - Changed the
updateTask
,completeTaskIfNecessary
&failTaskIfNecessary
methods to accept an extradescribeItem
argument to use for logging - Changed the
updateTask
method to trigger the newendedAt
method on its given task - Changed the
updateTask
method to use thecore-functions/promises
module's newflatten
function instead of theevery
function to resolve the execution done promise for the task - Removed dead
extractPotentialPromises
function - Renamed
createNewTasksUpdatedFromPriorVersions
method toreincarnateTasks
- Added
onlyRecreateExisting
option toopts
argument ofreincarnateTasks
method
- Added
- Renamed
copyStateAttemptsAndLastExecutedAt
method tocopyStateAttemptsAndExecutionTimes
- Updated
copyStateAttemptsAndExecutionTimes
method to set a task's_began
,_took
&_ended
properties
- Updated
- Changes to
- Changes to
tasks
module &Task
class:- Renamed
_lastExecutedAt
property ofTask
class to_began
- Renamed
lastExecutedAt
getter ofTask
class tobegan
- Added new
ended
getter and_ended
property toTask
class - Added new
took
getter and_took
property toTask
class - Added new static
calculateEnded
&calculateTook
utility functions toTask
class - Added new
beganAt
method toTask
class to set the new_began
&_took
properties - Changed
start
method to use newbeganAt
method - Added new
endedAt
method toTask
class to set the new_ended
&_took
properties - Replaced boolean
returnSuccessOrFailure
property withreturnMode
property - Added a convenience
stateType
method to return the StateTypekind
of a task'sstate
- Updated & optimised
toJSON
method to reflectbegan
,took
& optionallyended
properties & omit emptysubTasks
- Patched static
isTaskLike
&forEachTaskLike
methods to handle omittedsubTasks
properties
- Patched static
- Renamed
updateLastExecutedAt
method toupdateBegin
& then commented it out, since not currently used - Changed
updateFromPriorVersion
method to update new_began
,_took
&_ended
properties - Changes to
complete
andsucceed
methods:- Replaced 2nd
overrideTimedOut
boolean argument with a more generic objectopts
argument, which currently only accepts anoverrideTimedOut
property. For backward compatibility, any booleanopts
argument will be treated as a legacyoverrideTimedOut
argument
- Replaced 2nd
- Changes to
completeAs
method:- Replaced 3rd
overrideTimedOut
boolean argument with a more generic objectopts
argument, which currently only accepts anoverrideTimedOut
property. For backward compatibility, any booleanopts
argument will be treated as a legacyoverrideTimedOut
argument
- Replaced 3rd
- Changes to
timeout
method:- Replaced 2nd
overrideCompleted
boolean argument with a more generic objectopts
argument, which now acceptsoverrideCompleted
,overrideUnstarted
andreverseAttempt
properties. For backward compatibility, any booleanopts
argument will be treated as a legacyoverrideCompleted
argument
- Replaced 2nd
- Changes to
timeoutAs
method:- Replaced 3rd
overrideCompleted
boolean argument with a more generic objectopts
argument, which now acceptsoverrideCompleted
,overrideUnstarted
andreverseAttempt
properties. For backward compatibility, any booleanopts
argument will be treated as a legacyoverrideCompleted
argument
- Replaced 3rd
- Changes to
timeout
andtimeoutAs
methods:- When the new
overrideUnstarted
option is set to:false
(the default), then the timeout will actually be suppressed if the task is still unstarted; ortrue
, then the timeout will be applied (even if the task is still unstarted.
- When the new
reverseAttempt
option is set to:true
, then the timeout will "reverse the attempt" by decrementing the number of attempts, but ONLY if the task was started; orfalse
(the default), then the timeout will leave the number of attempts as is
- When the new
- Added new
taskDefSettings
arguments to thecreateSubTask
&getOrCreateSubTask
methods between theirexecute
&opts
arguments
- Renamed
- Changes to
task-defs
module:- Added new optional
settings
argument toTaskDef
constructor & to staticdefineTask
&defineSubTasks
methods to enable configuration of a customdescribeItem
function to be used for logging - Added new
describeItem
property toTaskDef
class
- Added new optional
- Updated
core-functions
dependency to version 3.0.2
- Updates to
README.md
- Changes to
task-utils
module:- Added new
configureTaskFactory
,isTaskFactoryConfigured
,constructTaskFactory
&getDefaultTaskFactoryOpts
functions - Re-exported
FrozenError
&FinalisedError
for convenience
- Added new
- Added new
errors
module:- Added new
FrozenError
subclass ofError
- Added new
FinalisedError
subclass ofError
- Added
TimeoutError
fromtask-states
module
- Added new
- Added new
task-factory
module:- Added a new
TaskFactory
class to eliminate use of statics and make it easier to override task factory functionality- Added
createTask
method (taken fromtasks
module), which now also accepts an optionalopts
argument - Added
createMasterTask
method (taken fromtasks
module), which now also accepts an optionalopts
argument
- Added
- Major changes and fixes to the original
executeAndUpdateTask
inner function fromTask
, which was moved from the deletedTask.defaultTaskExecuteFactory
function to the newgenerateExecute
method of theTaskFactory
class - Extracted & refactored some of the original
executeAndUpdateTask
inner function logic into a newupdateTask
method of theTaskFactory
class - Changed behaviour of new
executeAndUpdateState
inner function to throw aFrozenError
if the task is already frozen or throw aFinalisedError
if the task is already fully finalised (instead of returning undefined)
- Added a new
- Changes to
task-states
module:- Moved
TimeoutError
class to newerrors
module - Exported new
names
object property that contains the standard TaskState names & also exposed it viaTaskState.names
- Exported new
instances
object property that contains the singleton TaskState instances & also exposed it viaTaskState.instances
- Replaced all old name constants (e.g. UNSTARTED_NAME) with appropriate
names
properties (e.g. names.Unstarted) - Replaced all old singleton instance constants (e.g. UNSTARTED) with appropriate
instances
properties (e.g. instances.Unstarted) - Added new
Started
state & updatedtoTaskState
to also handle started states - Added new
started
method toTaskState
class - Modified definition of
unstarted
method onTaskState
class to enable differentiation betweenUnstarted
&Started
states - Added appropriate
toString
methods to the variousTaskState
subclasses
- Moved
- Changes to
task-defs
module:- NB: The
task-defs
module now exports ONLY theTaskDef
class (instead of an object with aTaskDef
property) - Removed export of
FOR_TESTING_ONLY.ensureAllTaskDefsDistinct
&FOR_TESTING_ONLY.areSubTaskNamesDistinct
functions - Changed
defineTask
function to be only a static method onTaskDef
class - Changed
getRootTaskDef
function to be only a static method onTaskDef
class - Changed
ensureAllTaskDefsDistinct
function to be only a static method onTaskDef
class - Changed
areSubTaskNamesDistinct
function to be only a static method onTaskDef
class
- NB: The
- Changes to
tasks
module:- NB: The
tasks
module now exports ONLY theTask
class (instead of an object with aTask
property) - Removed export of
FOR_TESTING_ONLY.ensureAllTasksDistinct
&FOR_TESTING_ONLY.reconstructTaskDefsFromRootTaskLike
functions - Changed
ensureAllTasksDistinct
function to be only a static method onTask
class - Changed
areSubTaskNamesDistinct
function to be only a static method onTask
class - Changed
isTaskLike
function to be only a static method onTask
class - Changed
getTasksAndSubTasks
function to be only a static method onTask
class - Changed
getRootTask
function to be only a static method onTask
class - Changed & renamed
forEach
function to be only a staticforEachTaskLike
method onTask
class (renamed to better reflect its functionality and to avoid confusion with existingforEach
method onTask
class) - Removed all task factory-related functions & migrated them to the new
TaskFactory
class- Removed
createTask
function & static method and added it as a method toTaskFactory
class - Removed
createMasterTask
function & static method and added it as a method toTaskFactory
class - Removed
reconstructTasksFromRootTaskLike
function & static method and added it as a method toTaskFactory
class - Removed
reconstructTaskDefsFromRootTaskLike
function & static method and added it as a method toTaskFactory
class - Removed
createNewTasksUpdatedFromPriorVersions
function & static method and added it as a method toTaskFactory
class
- Removed
- Removed all task execute factory-related functions & migrated them to the new
TaskFactory
class- Moved & renamed
defaultTaskExecuteFactory
function togenerateExecute
method ofTaskFactory
class - Moved & renamed
completeTaskIfStillUnstarted
function tocompleteTaskIfNecessary
method ofTaskFactory
class - Moved & renamed
failTaskIfNotRejectedNorFailed
function tofailTaskIfNecessary
method ofTaskFactory
class - Removed
Task.taskExecuteFactory
&Task.defaultTaskExecuteFactory
static properties
- Moved & renamed
- Changes to
Task
class:- Added new mandatory
factory
parameter and new optionalopts
parameter to theTask
constructor, which means that tasks must now be constructed with aTaskFactory
instance or, preferably, by callingcreateTask
on yourTaskFactory
instance - Changed
updateFromPriorVersion
method to also accept an optionalopts
parameter - Added new immutable
factory
,returnSuccessOrFailure
and_opts
properties - Added new writable
_outcome
and_donePromise
properties and newoutcome
&donePromise
getters - Added new
started
method - Changed
start
method to also change state to newStarted
state and to ONLY react if in an unstarted state - Added new
decrementAttempts
method - Added new
totalAttempts
property - Added a new
executed
method, which is used by the overhauledexecuteAndUpdateTask
inner function and newupdateTask
method ofTaskFactory
class to set the task's_outcome
and_donePromise
properties after execution of the task'sexecute
method - Added new
createSubTask
method - Renamed
getOrAddSubTask
method togetOrCreateSubTask
- Added new mandatory
- NB: The
- Changes to
task-utils
module:- Added re-export of new
Started
TaskState
subclass - Added re-export of new
TaskFactory
class - Removed duplicate
forEach
function & replaced usage withTask.forEachTaskLike
method - Added new mandatory
taskFactory
parameter and optionalopts
parameter toreplaceTasksWithNewTasksUpdatedFromOld
function
- Added re-export of new
- Updated
core-functions
dependency to version 3.0.0
- Changes to
task-defs
andtasks
modules:- Removed restrictions that prevented creation of executable sub-task definitions and sub-tasks
- Added
start
method toTask
class - Changed
defaultTaskExecuteFactory
function to NOT recursively increment & update last executed at date-times of sub-tasks - Moved all typedefs to
type-defs.js
- Updated
core-functions
dependency to version 2.0.14
- Updated
core-functions
dependency to version 2.0.12
- Changes to
task-utils.js
module to simplify usage and reduce the number of explicit imports required:- Re-exported
TaskState
class and all of its subclasses andTimeoutError
class fromtask-states.js
module - Re-exported
TaskDef
class fromtask-defs.js
module - Re-exported
Task
class fromtasks.js
module
- Re-exported
- Updated comments and README.md to improve/fix the definitions of each of the modules
- Changed
main
module fromtasks.js
totask-utils.js
inpackage.json
- Updated
core-functions
dependency to version 2.0.11
- Fixed 'ReferenceError: trim is not defined' defect in
TimeoutError
constructor intask-states.js
module
- Changes to
tasks.js
module:- Added an optional
overrideTimedOut
argument to thecomplete
,succeed
andcompleteAs
methods to enable the caller to decide whether these methods are allowed to override an existing timed out state or not - Added an optional
overrideCompleted
argument to thetimeout
andtimeoutAs
methods to enable the caller to decide whether these methods are allowed to override an existing completed state or not
- Added an optional
- Fixed defect in this
README.md
- Added support for timeouts to
TaskState
andTask
classes and cleaned-up their APIs - Changes to
task-states
module:- Added a new
TimeoutError
subclass ofError
- Changes to
TaskStateLike
andTaskState
typedefs:- Renamed
code
property toname
- Added new
timedOut
property
- Renamed
- Changes to
TaskState
class:- Renamed
code
property toname
- Changed all properties to private properties with underscore-prefixed names and with public
get
property accessors with their original names, e.g. oldcompleted
property was renamed to_completed
with aget completed()
accessor - Added a new private
_timedOut
property with a publicget timedOut()
accessor - Added a
toJSON
method to output the private, underscore-prefixed properties with their public property names - Removed
isSuccess
,isFailure
andisRejection
methods - Changed
TaskState
constructor to accept a newtimedOut
argument - Renamed
Success
subclass toCompletedState
- Added a new
Completed
subclass of theCompletedState
class - Added a new
TimedOutState
subclass - Added a new
TimedOut
subclass of theTimedOutState
class - Renamed
Failure
subclass toFailedState
- Renamed
Rejection
subclass toRejectedState
- Added a new singleton
Completed
state instance as staticCOMPLETED
property - Added new
COMPLETED_NAME
andTIMED_OUT_NAME
static constant properties for new state names
- Renamed
- Added a new
- Changes to
tasks
module:- Added new get
timedOut
property - Removed
isSuccess
andisFailure
methods - Added new
complete
,timeout
,timeoutAs
andrejectAs
methods - Renamed
success
method tocompleteAs
- Renamed
failure
method tofailAs
- Added new optional
recursively
argument tocomplete
,succeed
,completeAs
,timeout
,timeoutAs
,fail
,failAs
andrejectedAs
methods
- Added new get
- Updated
core-functions
dependency to version 2.0.10
- Updated
core-functions
dependency to version 2.0.9
- Updated
core-functions
dependency to version 2.0.8
- Updated
core-functions
dependency to version 2.0.7 - Updated
tape
dependency to 4.6.3
- Changes to
tasks.js
module:- Changed logic to support tracking the last executed at date-time on a task and task-like
- Added
_lastExecutedAt
property andlastExecutedAt
getter - Added
updateLastExecutedAt
function to update the last executed at date-time on a task and on its sub-tasks (if recursively is true) and on its slave tasks (if its a master task)
- Changes to
tasks.js
module:- Renamed
wrapExecuteTask
function todefaultTaskExecuteFactory
- Added
_frozen
and_error
properties to Task class - Added get
error
method to Task class - Added
getOrAddSubTask
method to Task class - Added optional
recursively
argument toincrementAttempts
method on Task class - Added optional
result
arguments tosucceed
andsuccess
methods on Task class - Changed
fail
andfailure
methods to set new_error
property - Added
freeze
andisFrozen
methods to Task class - Removed unused
copyStateToSlaveTasks
method from Task class - Changed static
createMasterTask
method to ensure that slave tasks have same definitions as master task - Changed
defaultTaskExecuteFactory
function:- To recursively increment the number of attempts on a task's sub-tasks
- To a static method on Task class
- Added a static
taskExecuteFactory
method to Task class that defaults todefaultTaskExecuteFactory
and can be changed to use an alternative task execute factory - Changed
completeTaskIfStillUnstarted
andfailTaskIfNotRejectedNorFailed
functions:- To static methods on Task class
- To accept an optional
logger
argument - To catch and log warnings & errors when state changes are attempted after a task is frozen
- Minor changes to unit tests to synchronize with code changes
- Added unit tests for static
createMasterTask
method on Task class
- Renamed
- Updated
core-functions
dependency to version 2.0.3
- Changes and fixes to
task-states
module- Fixed defect in
Rejected
subclass - Changes to TaskState API:
- Added
incomplete
read-only property - Changed
isFinalised
method tofinalisd
read-only property
- Added
- Fixed defect in
- Changes and fixes to
tasks
module- Fixed defects in
createNewTasksUpdatedFromPriorVersions
function - Changes to Task API in
tasks
module:- Removed unneeded
attemptIncrements
read-only property - Added
incomplete
read-only property - Changed
isUnstarted
method tounstarted
read-only property to match TaskState - Changed
isFinalised
method tofinalisd
read-only property to match TaskState - Added static
getTasksAndSubTasks
function to Task - Added static
forEach
function to Task
- Removed unneeded
- Added more unit tests
- Fixed defects in
- Changes and fixes to
task-utils
module- Fixed defect in
getTasksAndSubTasks
function blocking use of task-likes - Added
forEach
function - Added more unit tests
- Fixed defect in
- Added new
tasks
module - Added new
task-defs
module - Added rejection subclasses to
task-states
module - Substantial refactoring of
task-states
module - Major refactoring/rewrite of old
task-utils
code- 2.0.0 API is completely different to 1.0.x versions
- Fixed incorrect github link in README.md (no code changes)
- Initial commit
- Created README.md
- Added tasks and statuses and their unit tests