{"_id":"@avatao/tfwsdk","_rev":"4-8b760bb2f9b23d73ad6c0d619a5a4340","name":"@avatao/tfwsdk","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.1":{"name":"@avatao/tfwsdk","version":"1.0.1","description":"This package is part of our next-gen Tutorial Framework (which just an additional abstraction layer). The purpose of the project is to decrease the learning curve of creating tutorial exercises.","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"lint":"eslint './src/**/*.{js,ts,tsx}'","test":"jest","test:watch":"jest --watchAll","build":"tsc","watch":"tsc -w","start":"npm link","semantic-release":"semantic-release","prettier-format":"prettier --config .prettierrc 'src/**/*.ts' --write"},"repository":{"url":"git+https://github.com/avatao-content/sdk-tfw-node.git"},"publishConfig":{"access":"public"},"keywords":["TFW","SDK"],"author":{"name":"Ákos Hajba","email":"hajbodev@gmail.com"},"license":"Apache-2.0","bugs":{"url":"https://github.com/avatao-content/sdk-tfw-node/issues"},"homepage":"https://github.com/avatao-content/sdk-tfw-node#readme","husky":{"hooks":{"pre-commit":"npm run lint && npm test","commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-push":"npm run lint && npm test"}},"devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@semantic-release/changelog":"^5.0.1","@semantic-release/commit-analyzer":"^8.0.1","@semantic-release/git":"^9.0.0","@semantic-release/github":"^7.2.0","@semantic-release/npm":"^7.0.9","@semantic-release/release-notes-generator":"^9.0.1","@types/jest":"^26.0.19","@types/node":"^14.14.13","@typescript-eslint/eslint-plugin":"^4.9.1","@typescript-eslint/parser":"^4.9.1","eslint":"^7.15.0","eslint-config-prettier":"^6.15.0","eslint-plugin-prettier":"^3.3.0","husky":"^4.3.6","jest":"^26.6.3","prettier":"^2.2.1","semantic-release":"^17.3.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"dependencies":{"zeromq":"^6.0.0-beta.5"},"gitHead":"3561f61ec508de974a16369d63ece81913c33982","_id":"@avatao/tfwsdk@1.0.1","_nodeVersion":"12.20.0","_npmVersion":"6.14.10","dist":{"integrity":"sha512-UPqquZFLy8HGYvdcdeAjqqWGqpP3Rb2W8liWqutBCXLQWZAc4YAbwZLGBSueUlhe6Wf3F/p/rPgXpdWdvW6tZg==","shasum":"1b5096e79819604b5a48d3be6891a10625886401","tarball":"https://registry.npmjs.org/@avatao/tfwsdk/-/tfwsdk-1.0.1.tgz","fileCount":62,"unpackedSize":129252,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf3/rACRA9TVsSAnZWagAAltYP/2e+di4JWLMNqzs+dTAm\nyoPge0DeZ4Pw+EG4vbr1suJDhHX3iHKBbAGv8tFKOg/9DzgVhnPzS+LvV3eP\nDEMKbW1vz+4DORvEYhQ0bf2lSw0wNiZV29WASo5BzxRnJJX8CxK2tJ9okbr7\noWwpsjIX/MkAcN55Hfft8iIXM1XIoTWTbdPw37imQr+Qs+h0WvLedRvulhJd\nBbbqUh/9eegw2p1fnvGTIGX0HMYyRK72QABKd0bJJtT/CGddxVMzC+4sp8qb\nDZ91l7mlFysOYDZAowhTLAmNBEglLUnrphFMjBfG9YQc1s+AetrLvvxdG2fZ\nd32GPNwgDMYSi6e6wp2O37KF2caYkC6cZI9Cx0EZZWxfYbl2EpzVmErR2qSu\nYP+OVuiXTD5Q49g09Pn9+YksBukDLKMq5JueprQhsi8BmNd8jy3xmD9A2M+h\n8V+p6w6n2E4n16ufUhwIVs+y7lBYDZRYbmYIxkbyLb+BHDr3SD1MXdBeGP6g\nLJJDlNo+sfd+In30djYKWhy10YB2RDu4zL4Cm0++c7ces1qJyepCPnGrKZgV\nEJKuIXX+cT+gFwYbnK9h+wUa9nFb/YFgbSPTY4LxjQMhzyLAGUrbR1Jl3TSs\n+I4C0s2mmiKP1mMfTw7DFFgA1nPMekPF5nmHzhsoVDONmfqElX0aaju3UFrQ\n9JND\r\n=hT13\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDC78G+5EOA6iD0Rpg/vkBoYVazqcuXibmxcj31TgP1jwIhANroUzbAU7a8x4iM8tIxO/rU/Bz6OjeuPUJvPCja8lFH"}]},"_npmUser":{"name":"akoshajba","email":"akos.hajba@avatao.com"},"directories":{},"maintainers":[{"name":"akoshajba","email":"akos.hajba@avatao.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tfwsdk_1.0.1_1608514239608_0.48478092129111583"},"_hasShrinkwrap":false},"1.0.2":{"name":"@avatao/tfwsdk","version":"1.0.2","description":"This package is part of our next-gen Tutorial Framework (which just an additional abstraction layer). The purpose of the project is to decrease the learning curve of creating tutorial exercises.","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"lint":"eslint './src/**/*.{js,ts,tsx}'","test":"jest","test:watch":"jest --watchAll","build":"tsc","watch":"tsc -w","start":"npm link","semantic-release":"semantic-release","prettier-format":"prettier --config .prettierrc 'src/**/*.ts' --write"},"repository":{"url":"git+https://github.com/avatao-content/sdk-tfw-node.git"},"publishConfig":{"access":"public"},"keywords":["TFW","SDK"],"author":{"name":"Ákos Hajba","email":"hajbodev@gmail.com"},"license":"Apache-2.0","bugs":{"url":"https://github.com/avatao-content/sdk-tfw-node/issues"},"homepage":"https://github.com/avatao-content/sdk-tfw-node#readme","husky":{"hooks":{"pre-commit":"npm run lint && npm test","commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-push":"npm run lint && npm test"}},"devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@semantic-release/changelog":"^5.0.1","@semantic-release/commit-analyzer":"^8.0.1","@semantic-release/git":"^9.0.0","@semantic-release/github":"^7.2.0","@semantic-release/npm":"^7.0.9","@semantic-release/release-notes-generator":"^9.0.1","@types/jest":"^26.0.19","@types/node":"^14.14.13","@typescript-eslint/eslint-plugin":"^4.9.1","@typescript-eslint/parser":"^4.9.1","eslint":"^7.15.0","eslint-config-prettier":"^6.15.0","eslint-plugin-prettier":"^3.3.0","husky":"^4.3.6","jest":"^26.6.3","prettier":"^2.2.1","semantic-release":"^17.3.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"dependencies":{"zeromq":"^6.0.0-beta.5"},"gitHead":"69ac2d6f0cc0b1ee2f166036b3c89a986b444aee","_id":"@avatao/tfwsdk@1.0.2","_nodeVersion":"12.20.0","_npmVersion":"6.14.10","dist":{"integrity":"sha512-hCMwdJk/nffU8jf9AUKwkd/G9D6XKJKxf27anDsfBxDq8zsoMyQ0Gv2j8tcchVOQm+IJ15opAahHzdMl48VZrQ==","shasum":"f644a90286b5e79dc4c94a3ed1d3ba78bbc23ba4","tarball":"https://registry.npmjs.org/@avatao/tfwsdk/-/tfwsdk-1.0.2.tgz","fileCount":65,"unpackedSize":135626,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf4JWACRA9TVsSAnZWagAAsasP/RxosIIXESPjC2UtBm7v\nODoBLIumW+HCgweVqC1dx9vIn9p5Za5nrl+vEcalYZwz9XmDR2bIQU0q0ibK\nVHR6SfMNW7q5MX8TgrhbHogWiz8Zz4T/CXHc/Hig81rGL5xNZWWcPAALAt//\noB5SF1sVzXFxNAP6kHKsGdoKijs5qgZxjEzCY5Xljzuj6KFceRlDT5ikDK14\nSo5XdojjJRpc+phSe/vV81mjJEpI2WgGgCaiedfT+MjpSB33degTfVXKSeiy\nfk++gm6p5TM9NJ0UvmdGbP6Ts3FRlcw5tltl2PlI1PzINFRnmGtwTLsD58uR\nqux7jNkDPSk0luZZ3xuCorn6dZlnhIk1xQkbcuXecrdhWX+fmmcrHJRWxE8N\nCPqafggG0jZQD7x4zb5yxWsCN3wi+YIw/dthmJ1TsIVYJOSRY8kfZGwH8VaC\nCNGilWqz8AlekVmZe7IzifRezAcVAVymmRzXo+0fT81uzx6zknLnuH+G8coV\nsWqXQn37KtQP0sn2Abuf05X2f/LJLUSxirvSOd2PNVNJtlibvhAdBF5+8150\nlAo3U72FZw3IM7rbPyMgL/+PY5G0kGaihfEPRTq6dT0nsyo1s+2hmGMydawB\n9lKeidMhn95K5IIILSXbFJRo4bMNWtjXSjqFl8JyAVPzR/NmwDDpFFgpCm9X\nvPUP\r\n=iIho\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFUz/zqmE800jxn+hJ6KFA1Ww2JSyDHsebvAM5AC27HNAiEAqxlw/eezBtFI9LZPZZbYAPB6jYPWu6JTJHuw22/Yo/k="}]},"_npmUser":{"name":"akoshajba","email":"akos.hajba@avatao.com"},"directories":{},"maintainers":[{"name":"akoshajba","email":"akos.hajba@avatao.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tfwsdk_1.0.2_1608553855731_0.07356629907926315"},"_hasShrinkwrap":false},"1.0.3":{"name":"@avatao/tfwsdk","version":"1.0.3","description":"This package is part of our next-gen Tutorial Framework (which just an additional abstraction layer). The purpose of the project is to decrease the learning curve of creating tutorial exercises.","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"lint":"eslint './src/**/*.{js,ts,tsx}'","test":"jest","test:watch":"jest --watchAll","build":"tsc","watch":"tsc -w","start":"npm link","semantic-release":"semantic-release","prettier-format":"prettier --config .prettierrc 'src/**/*.ts' --write"},"repository":{"url":"git+https://github.com/avatao-content/sdk-tfw-node.git"},"publishConfig":{"access":"public"},"keywords":["TFW","SDK"],"author":{"name":"Ákos Hajba","email":"hajbodev@gmail.com"},"license":"Apache-2.0","bugs":{"url":"https://github.com/avatao-content/sdk-tfw-node/issues"},"homepage":"https://github.com/avatao-content/sdk-tfw-node#readme","husky":{"hooks":{"pre-commit":"npm run lint && npm test","commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-push":"npm run lint && npm test"}},"devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@semantic-release/changelog":"^5.0.1","@semantic-release/commit-analyzer":"^8.0.1","@semantic-release/git":"^9.0.0","@semantic-release/github":"^7.2.0","@semantic-release/npm":"^7.0.9","@semantic-release/release-notes-generator":"^9.0.1","@types/jest":"^26.0.19","@types/node":"^14.14.13","@typescript-eslint/eslint-plugin":"^4.9.1","@typescript-eslint/parser":"^4.9.1","eslint":"^7.15.0","eslint-config-prettier":"^6.15.0","eslint-plugin-prettier":"^3.3.0","husky":"^4.3.6","jest":"^26.6.3","prettier":"^2.2.1","semantic-release":"^17.3.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"dependencies":{"zeromq":"^6.0.0-beta.5"},"gitHead":"ecd852a5eacba8527c7d722a5e34f07a5add5b85","_id":"@avatao/tfwsdk@1.0.3","_nodeVersion":"12.20.0","_npmVersion":"6.14.10","dist":{"integrity":"sha512-6fWcIVWtujDWP+P+ypAxGeJjYDjm0B4/lWtuJ3473WwK2EV1JyCgvO0yaYrZevJkWNeCUC0+pL9WyK6gbG3k1A==","shasum":"c90510fd64cee113268a38e6ad3dbb50d9080257","tarball":"https://registry.npmjs.org/@avatao/tfwsdk/-/tfwsdk-1.0.3.tgz","fileCount":65,"unpackedSize":132594,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf4zjACRA9TVsSAnZWagAAoycP/jLpNF6lMpmKEQRBrjPv\nKeyQFZpl5CF/h4ly0dVvNDvSck9D8cVMcNWD08Hl6uzMAZlwdsn9AXEk567y\n61mO+B3j62g7oxoPHrTJ/z7U9itmW+R4J1mvo4OXVAnVj/Tv55KSKQyTFUaF\nfk4RlgJah/ISQGwRL5LO0qpzX43QZ9zUI1xmWla7Fh/E9zocTvRMy9DMu2YS\npmzVj75p8BR8bUc2ucLkEE5UUXXS4DbtqfWKRn71UmZnfWMec9Kv5XcEp6lb\njTXFedklI6hjptzlWw7b8pa5Odxd1gGnZhwlJ8MsPfJt0UHsjVcfRd6TkEHo\npk09cvJNmTpzbasCXGIbQBC0yzNwSubg//0V4ani+STISIbbIsUdutO3+k1r\nHPWRwqjnEstw4fYlOqg5Sd5TX9r67AFeaHXH77MW9irRnn0vwyR5INbsyVEY\nQYCMVG8teYu8fP70JJgx+ejnV2j8G6W4xBR4vdxv4UZ8XZ6eKpSHjWBlBUoh\nP6O/gGsF3hq90HkULnnjCV1OBvaCay7zcWIeNc3gG9D5kb8vcmgRz5NaAvpt\nMpFtodXFgfb/xgTtqYt4YIZALw0dqwBVycTJ1bflmNKoQJgE8uuX5RNzWtaO\nBWE7t6TTS0ua/vy84zbZNCAYaQy7o9d5AFKDLREMBXHBSJeItbl5AR/UctFX\nuOSs\r\n=JRiU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDGyXNuVitCoNRRFI+cPTSrwmO7F9dMuQ1fHhX6IDgo+gIgMwGOIRt4/srVpyQOsaDXaPi40jJrwrfFvy7DJ1S/jCo="}]},"_npmUser":{"name":"akoshajba","email":"akos.hajba@avatao.com"},"directories":{},"maintainers":[{"name":"avatao-content","email":"content@avatao.com"},{"name":"akoshajba","email":"akos.hajba@avatao.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tfwsdk_1.0.3_1608726719917_0.6464986738883842"},"_hasShrinkwrap":false}},"time":{"created":"2020-12-21T01:30:39.354Z","1.0.1":"2020-12-21T01:30:39.735Z","modified":"2022-04-04T16:44:57.939Z","1.0.2":"2020-12-21T12:30:55.916Z","1.0.3":"2020-12-23T12:32:00.107Z"},"maintainers":[{"name":"avatao-content","email":"content@avatao.com"},{"name":"akoshajba","email":"akos.hajba@avatao.com"}],"description":"This package is part of our next-gen Tutorial Framework (which just an additional abstraction layer). The purpose of the project is to decrease the learning curve of creating tutorial exercises.","homepage":"https://github.com/avatao-content/sdk-tfw-node#readme","keywords":["TFW","SDK"],"repository":{"url":"git+https://github.com/avatao-content/sdk-tfw-node.git"},"author":{"name":"Ákos Hajba","email":"hajbodev@gmail.com"},"bugs":{"url":"https://github.com/avatao-content/sdk-tfw-node/issues"},"license":"Apache-2.0","readme":"#### TFW SDK for JavaScript developers ####\n\n![GitHub](https://img.shields.io/github/license/avatao-content/sdk-tfw-node)\n![GitHub package.json version](https://img.shields.io/github/package-json/v/avatao-content/sdk-tfw-node)\n\nThis package is part of our next-gen Tutorial Framework (which just an additional abstraction layer). The purpose of the project is to decrease the learning curve of creating tutorial exercises.\n\n#### Installation ####\n\nInstall the SDK:\n\n```\nnpm i @avatao/tfwsdk\n```\n#### Usage ####\n\nIn your solvable container you should prepare an `eventHandlers.js` like this:\n```javascript\n// The SDK object\nconst { sdk } = require(\"@avatao/tfwsdk\");\n// The base class for more complex event handler creation\nconst { EventHandlerBase } = require(\"@avatao/tfwsdk\");\n\nfunction onDeployStart(currentState, completeMessage) {\n  sdk.sendChatMessage(`Deploy clicked in state ${currentState}`);\n  sdk.restartProcess(\"webservice\");\n  // Do some tests, etc...\n  sdk.finishDeploy(); // Call with an error message to signal a failed deploy\n}\n\nfunction onMessageButtonClick(currentState, btnValue, completeMessage) {\n  sdk.sendChatMessage(`Clicked: ${btnValue} in state ${currentState}`);\n  btnValue === \"yes\"\n    ? sdk.stepFsm(2) // Step if possible\n    : sdk.stepFsm(1, {force: true}); // Force the step\n}\n\nfunction onIdeWrite(currentState, fileName, content, completeMessage) {\n  sdk.queueChatMessages([\n    `File ${fileName} was written in state ${currentState}`,\n    `Content:<br>${content}`,\n  ]);\n}\n\nfunction onTerminalCommand(currentState, command, completeMessage) {\n  sdk.sendChatMessage(\n    `Command \\`${command}\\` executed in state ${currentState}`\n  );\n}\n\n// Set callbacks for the desired event key\nconst callbacks = {\n  \"deploy.start\": onDeployStart,\n  \"message.button.click\": onMessageButtonClick,\n  \"ide.write\": onIdeWrite,\n  \"history.bash\": onTerminalCommand,\n};\nsdk.start(callbacks); // Start sdk event handling\n\nclass FsmUpdateHandler extends EventHandlerBase {\n  constructor() {\n    super([\"fsm.update\"]); // Call super with the list of the keys\n  }\n\n  handleMessage(message) {\n    // Implement the abstract message handler function\n    if (message.key == \"fsm.update\" && \"current_state\" in message) {\n      sdk.sendChatMessage(`The FSM stepped to state ${message.current_state}`);\n    }\n  }\n}\nsdk.subscribeEventHandler(new FsmUpdateHandler()); // Subscribe the eventhandler\n```\n\nThe SDK is running in the background (with supervisor) and executes the above functions on corresponding events. Also, it provides some really useful functions to communicate with the TFW. \n## Contributing\n\nCreate a fork, implement your changes and open a PR for review.\n\nPlease use the [conventional commit formats](https://www.conventionalcommits.org/en/v1.0.0/) while contributing. We are using the Angular preset.\n","readmeFilename":"README.md"}