
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
An activity workflow player that sequentially runs action, condition, fork, merge and prompt input actions.
This library has the following features.
Convenient and rich definition API to define and configure Workflow activities and actions. It helps developers to focus on overall activity logic before detailing them with their implementations.
Flexible definition API allows splitting of Worfklow activity definition with their implementation, keeping files and directories of Workflow modules organized.
Workflow activities and actions are more predictable as they each publish an immutable state object containing unique state name, action name, request data, and response data per completed run of Activity action.
Activity action supports asynchronous runs by supplying a callback function that returns Promise Object when defining Action implementations using handler(callback:Function) or guard(callback:Function) methods.
Workflows' internal Finite State Machine can be exported into any custom JSON schema using workflow.trasform(workflowName:String).
This little library is packaged by npm. Source can be found in github repository
npm install apptivity --save
Create a Workflow activity and chain-configure actions with definition API.
var workflow = require('./index.js');
workflow.create("createUser").
// create action
action("fetchFromBackend").
describe("fetch something from the backend",
"or find something to populate the initial input data",
"Remember: [describe], [guard] and [handler] is optional").
guard(function (input) {
return Promise.resolve(input);
}).
handler(function (input) {
return Ajax.requestAndReturnPromise(input);
}).
// your last action
action("renderAndExit").
describe("Nothing special if no [handler]").
handler(function (data) {
return { name: "whatever! this will be your last data" };
});
Run the newly created Workflow activity and monitor state changes.
workflow("createUser").
// register event listener
on("state-change",
function (session, data) {
console.log("state: ", session.state === data);
console.log("yes! do something about this immutable [data]");
}).
// run the workflow
run({ name: "first input" });
Listen to other running Workflow activity sessions' state-change event.
var stopListening = workflow.subscribe("createUser", "state-change",
function (session, data) {
console.log("what should I do with this?");
});
// I change my mind, I don't have to listen to "createUser" workflow's "state-change" events
stopListening();
Note: You can subscribe to a workflow event anytime even if the workflow does not exist.
Export the workflow into Finite State Machine configuration to create an instance of javascript-state-machine.
var StateMachine = require("javascript-state-machine");
var createUserStateMachine = StateMachine.create(
workflow.transform('createUser'));
API Documentation is now hosted in a separate page. You can explore it from Apptivity Project page.
FAQs
Stateful Activities as Improvement in Software Development
We found that apptivity demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.