14808 lines
503 KiB
JSON
14808 lines
503 KiB
JSON
[
|
|
{
|
|
"id": "379c65a27117b46c",
|
|
"type": "tab",
|
|
"label": "Home",
|
|
"disabled": false,
|
|
"info": "\n"
|
|
},
|
|
{
|
|
"id": "42b9663b67dbd983",
|
|
"type": "tab",
|
|
"label": "Files",
|
|
"disabled": false,
|
|
"info": ""
|
|
},
|
|
{
|
|
"id": "4b5e055cd6b1e387",
|
|
"type": "tab",
|
|
"label": "Form Processing",
|
|
"disabled": false,
|
|
"info": ""
|
|
},
|
|
{
|
|
"id": "8179bf22c4c31682",
|
|
"type": "tab",
|
|
"label": "Functions",
|
|
"disabled": false,
|
|
"info": "# Functions\n\nContained within are reusable functions.",
|
|
"env": [
|
|
{
|
|
"name": "oidc",
|
|
"value": "false",
|
|
"type": "bool"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "104f7938a23fe82f",
|
|
"type": "tab",
|
|
"label": "ITSM: GLPI",
|
|
"disabled": false,
|
|
"info": "",
|
|
"env": []
|
|
},
|
|
{
|
|
"id": "f6f2187d.f17ca8",
|
|
"type": "tab",
|
|
"label": "GLPI: FormCreator Automation",
|
|
"disabled": false,
|
|
"info": "# GLPI: FormCreator Automation\nThis flow search for the forms from the GLPI Plugin formcreator.\nOn finding a form, creates a ticket from that form."
|
|
},
|
|
{
|
|
"id": "24deed6b10f37f8f",
|
|
"type": "tab",
|
|
"label": "Cron",
|
|
"disabled": false,
|
|
"info": "# Cron\n\nThis flow contains any tasks that need to be run automagically",
|
|
"env": []
|
|
},
|
|
{
|
|
"id": "8ad5fe68ad170e2d",
|
|
"type": "group",
|
|
"z": "42b9663b67dbd983",
|
|
"name": "Form: Password Reset Questions",
|
|
"style": {
|
|
"stroke": "#0070c0",
|
|
"fill": "#bfdbef",
|
|
"label": true
|
|
},
|
|
"nodes": [
|
|
"02c4b9524d361ade",
|
|
"365ba07c1f4721ec",
|
|
"50339f503fd4878d",
|
|
"591e68e90f876dd1",
|
|
"7e95892f2f3454b7",
|
|
"9b89c2da58fccb8d",
|
|
"99a3fa75430c37f7",
|
|
"b2c917da9e845f7a",
|
|
"5798e39cbc3730ae",
|
|
"52dc13e1fdbf064d",
|
|
"d460346f6ae1673b"
|
|
],
|
|
"x": 154,
|
|
"y": 919,
|
|
"w": 1912,
|
|
"h": 122
|
|
},
|
|
{
|
|
"id": "ad0235dd3aa9eb7d",
|
|
"type": "group",
|
|
"z": "42b9663b67dbd983",
|
|
"name": "Form: Password Reset",
|
|
"style": {
|
|
"stroke": "#0070c0",
|
|
"fill": "#bfdbef",
|
|
"label": true
|
|
},
|
|
"nodes": [
|
|
"2dc375bf57ad8daa",
|
|
"1ce803b83ecf1593",
|
|
"f3b55ea2.f4d51",
|
|
"bf098463143ac8ad",
|
|
"457583335831f826",
|
|
"317930c679e833d1"
|
|
],
|
|
"x": 154,
|
|
"y": 779,
|
|
"w": 1092,
|
|
"h": 82
|
|
},
|
|
{
|
|
"id": "1c5c6c543ef047b6",
|
|
"type": "group",
|
|
"z": "42b9663b67dbd983",
|
|
"name": "Home Page",
|
|
"style": {
|
|
"stroke": "#0070c0",
|
|
"fill": "#bfdbef",
|
|
"label": true
|
|
},
|
|
"nodes": [
|
|
"0172c4a240b566fd",
|
|
"2106525aa2ebda7d",
|
|
"4ecc0631139b51e0",
|
|
"2f628eec7ca4b343"
|
|
],
|
|
"x": 154,
|
|
"y": 399,
|
|
"w": 812,
|
|
"h": 82
|
|
},
|
|
{
|
|
"id": "a64f4a2c837d5c3c",
|
|
"type": "group",
|
|
"z": "42b9663b67dbd983",
|
|
"name": "Error Page",
|
|
"style": {
|
|
"stroke": "#ffC000",
|
|
"fill": "#ffefbf",
|
|
"label": true
|
|
},
|
|
"nodes": [
|
|
"fd80fd11fc971e2c",
|
|
"50d19d3ce5cf88f2",
|
|
"e5ae19af5f6d6561",
|
|
"781d23c946457b30",
|
|
"9d93b8dfe83bf3ca",
|
|
"e551d77d5412aced",
|
|
"4ed718e1ae800bad"
|
|
],
|
|
"x": 1314,
|
|
"y": 19,
|
|
"w": 812,
|
|
"h": 127
|
|
},
|
|
{
|
|
"id": "a8e6ecf8ae37659e",
|
|
"type": "group",
|
|
"z": "42b9663b67dbd983",
|
|
"name": "HTML Page Template",
|
|
"style": {
|
|
"stroke": "#6f2fa0",
|
|
"fill": "#dbcbe7",
|
|
"label": true
|
|
},
|
|
"nodes": [
|
|
"3ec10e706b7bdc9d",
|
|
"8bdcaea510dbad1e",
|
|
"6fc3fe2eef3733b0"
|
|
],
|
|
"x": 154,
|
|
"y": 19,
|
|
"w": 692,
|
|
"h": 82
|
|
},
|
|
{
|
|
"id": "0abe2cea5975dcfd",
|
|
"type": "group",
|
|
"z": "42b9663b67dbd983",
|
|
"name": "Account Details",
|
|
"style": {
|
|
"stroke": "#0070c0",
|
|
"fill": "#bfdbef",
|
|
"label": true
|
|
},
|
|
"nodes": [
|
|
"e50f46892eabd2a5",
|
|
"46ef4f0739d6c1b8",
|
|
"1d661b2385de4b4a",
|
|
"c9323e9dc74c9203"
|
|
],
|
|
"x": 154,
|
|
"y": 519,
|
|
"w": 812,
|
|
"h": 82
|
|
},
|
|
{
|
|
"id": "07f2249ad4b7ccd0",
|
|
"type": "group",
|
|
"z": "42b9663b67dbd983",
|
|
"name": "Change Password",
|
|
"style": {
|
|
"stroke": "#0070c0",
|
|
"fill": "#bfdbef",
|
|
"label": true
|
|
},
|
|
"nodes": [
|
|
"b5cedc58894f707e",
|
|
"54b1149ed3d047fe",
|
|
"0c2e73371d4238a1",
|
|
"dcfa3cfba4eb1356"
|
|
],
|
|
"x": 154,
|
|
"y": 639,
|
|
"w": 812,
|
|
"h": 82
|
|
},
|
|
{
|
|
"id": "d3393ec35cb20a93",
|
|
"type": "group",
|
|
"z": "42b9663b67dbd983",
|
|
"name": "",
|
|
"style": {
|
|
"label": true,
|
|
"stroke": "#92d04f",
|
|
"fill": "#e3f3d3"
|
|
},
|
|
"nodes": [
|
|
"a702d39f0f3180de",
|
|
"3502d9cf69680b66",
|
|
"f1dcd5b6e32fb905"
|
|
],
|
|
"x": 164,
|
|
"y": 139,
|
|
"w": 462,
|
|
"h": 82
|
|
},
|
|
{
|
|
"id": "3e330505ea1e9cba",
|
|
"type": "group",
|
|
"z": "42b9663b67dbd983",
|
|
"name": "",
|
|
"style": {
|
|
"stroke": "#ff0000",
|
|
"fill": "#ffbfbf",
|
|
"label": true
|
|
},
|
|
"nodes": [
|
|
"c8c3f9c8f2ee35ee",
|
|
"602e7197835bba91",
|
|
"b664f0b9e6c17ad6"
|
|
],
|
|
"x": 694,
|
|
"y": 239,
|
|
"w": 492,
|
|
"h": 82
|
|
},
|
|
{
|
|
"id": "b447a1f691eb02df",
|
|
"type": "group",
|
|
"z": "42b9663b67dbd983",
|
|
"name": "Logout",
|
|
"style": {
|
|
"stroke": "#0070c0",
|
|
"fill": "#bfdbef",
|
|
"label": true
|
|
},
|
|
"nodes": [
|
|
"fb5301abffede979",
|
|
"988765ea19236af0",
|
|
"abcdd1bd3d9d1892",
|
|
"c17fe14224b2a367"
|
|
],
|
|
"x": 154,
|
|
"y": 1099,
|
|
"w": 752,
|
|
"h": 82,
|
|
"info": "# Logout\n\nThis group contains the `/logout` path.\nAs part of this groups glow, when navigated to. \nThe users cookie is set to expire and the user session is removed from the filesystem."
|
|
},
|
|
{
|
|
"id": "0d96945ec7d069cb",
|
|
"type": "group",
|
|
"z": "8179bf22c4c31682",
|
|
"name": "Returns: dict, msg.hash",
|
|
"style": {
|
|
"label": true
|
|
},
|
|
"nodes": [
|
|
"0eeaba70b043a226",
|
|
"9c9c7bbd71c78d8e",
|
|
"43eebf1623f29074",
|
|
"8fadd3c4294a6939",
|
|
"540882a95f65754c"
|
|
],
|
|
"x": 114,
|
|
"y": 79,
|
|
"w": 972,
|
|
"h": 109.5
|
|
},
|
|
{
|
|
"id": "bcd2727d77a80ce3",
|
|
"type": "group",
|
|
"z": "8179bf22c4c31682",
|
|
"name": "Returns: string, msg.filename",
|
|
"style": {
|
|
"label": true
|
|
},
|
|
"nodes": [
|
|
"8c13bbcc86d93be8",
|
|
"a35b8cc53c276d62",
|
|
"858268a5d48a4486",
|
|
"998b007182d85455",
|
|
"0f2ff2f433d17eef"
|
|
],
|
|
"x": 114,
|
|
"y": 239,
|
|
"w": 912,
|
|
"h": 82
|
|
},
|
|
{
|
|
"id": "3b96ab15b1a54e33",
|
|
"type": "group",
|
|
"z": "4b5e055cd6b1e387",
|
|
"name": "Save Password Reset Questions",
|
|
"style": {
|
|
"stroke": "#ff0000",
|
|
"fill": "#7fb7df",
|
|
"label": true,
|
|
"color": "#ffff00"
|
|
},
|
|
"nodes": [
|
|
"bb8102ee0c070ff2",
|
|
"629b7df0515c7d83",
|
|
"a712f5e2056bbb1b",
|
|
"e9f50265154e4b83",
|
|
"1e3c2b23420d6e40",
|
|
"cee76f9f914dd0fa",
|
|
"fba98a197970c6ee",
|
|
"edf62fa2ca3cd812",
|
|
"5210f540af1eb2e5",
|
|
"96836f5a4c7c756c",
|
|
"6ec9911b7ad7d042",
|
|
"3f128f23d72e0492",
|
|
"7ce13238fa87d636",
|
|
"8b70b96b1f62a785",
|
|
"05accf0d9a6f0aa8"
|
|
],
|
|
"x": 134,
|
|
"y": 119,
|
|
"w": 2312,
|
|
"h": 182
|
|
},
|
|
{
|
|
"id": "10a6c6b12749dda9",
|
|
"type": "group",
|
|
"z": "8179bf22c4c31682",
|
|
"name": "Returns: string msg.payload",
|
|
"style": {
|
|
"label": true
|
|
},
|
|
"nodes": [
|
|
"804feccd90b3276c",
|
|
"869469819396a632",
|
|
"c4e40d6f6678bb55",
|
|
"e62119d30db09cce",
|
|
"8e670403cf071aaf"
|
|
],
|
|
"x": 114,
|
|
"y": 359,
|
|
"w": 1012,
|
|
"h": 122
|
|
},
|
|
{
|
|
"id": "9b1493c4ae19a935",
|
|
"type": "group",
|
|
"z": "8179bf22c4c31682",
|
|
"name": "Workflow: ITSM Selection",
|
|
"style": {
|
|
"fill": "#e3f3d3",
|
|
"label": true
|
|
},
|
|
"nodes": [
|
|
"b8c9f1cf125efd2e",
|
|
"f5cae04225998e3b",
|
|
"002457f33834fc91",
|
|
"d4d1ce730aa1c15b",
|
|
"9858d84dc9d001be",
|
|
"6840ab77f76439db"
|
|
],
|
|
"x": 94,
|
|
"y": 639,
|
|
"w": 4744,
|
|
"h": 834,
|
|
"info": "# Input Format\n\n``` json\n{\n \"data\": {\n // contains the data for the action\n },\n \"action\": \"search\",\n \"action_for\": \"user\"\n}\n```"
|
|
},
|
|
{
|
|
"id": "a9d52eb951c5f037",
|
|
"type": "group",
|
|
"z": "4b5e055cd6b1e387",
|
|
"name": "Password Reset",
|
|
"style": {
|
|
"stroke": "#ff0000",
|
|
"fill": "#7fb7df",
|
|
"label": true,
|
|
"color": "#ffff00"
|
|
},
|
|
"nodes": [
|
|
"aea0a3398dafab4c",
|
|
"4cdbeaa8f5f3ddb7",
|
|
"82ccba0e0a13970a",
|
|
"d0dc259791aed430",
|
|
"d1b4f7ad9e8ea4f0",
|
|
"4cdebccc4a1f08ed",
|
|
"9926c0ba3f91aca8",
|
|
"02dc457b6549ba4e"
|
|
],
|
|
"x": 128,
|
|
"y": 333,
|
|
"w": 2798,
|
|
"h": 774,
|
|
"info": "# Password Reset Form Processing\n\nThis group is responsible for processing the data from the password reset form. the basic workflow is as follows:\n\n- Form validation\n\n- LDAP User Search\n\n- ITSM User Search: if enabled searches for user within itsm system\n\n- ITSM Ticket: if enabled, creates ticket within ITSM system\n\n- Response: User notification\n"
|
|
},
|
|
{
|
|
"id": "bbd929c437c592ea",
|
|
"type": "group",
|
|
"z": "8179bf22c4c31682",
|
|
"name": "Authentication",
|
|
"style": {
|
|
"stroke": "#6f2fa0",
|
|
"fill": "#ffbfbf",
|
|
"label": true,
|
|
"color": "#777777"
|
|
},
|
|
"nodes": [
|
|
"f17afdbfc8c07889",
|
|
"6c790a65bbdc61a5",
|
|
"bc039e4b516adf37",
|
|
"627a72eee1e26ae6",
|
|
"177a7aba70483ccb",
|
|
"7225c45ad941c14f",
|
|
"e80aabc47c664088",
|
|
"724a142f28c3b6e4",
|
|
"f9550cdd015b52ae",
|
|
"cc33365c2aa59e35",
|
|
"69f0d6271fe16536",
|
|
"1552576e6e79e172",
|
|
"3fa2f7ecc012d8c6",
|
|
"a67892bd64d2ded4"
|
|
],
|
|
"x": 94,
|
|
"y": 1527,
|
|
"w": 3012,
|
|
"h": 1334,
|
|
"info": "# Authentication\n\nThis group is responsible for ensuring the user is authorized to access the system. \nAny valid user account that authenticates to the system is authorized.\n\nFrom entry the next step in the process is cookie validation.\n\n## Input Data\n\nThis group has two paths for entry: \n\n1. Cookie Found - `msg.req.cookies.auth` key exists\n\n > Value is the session name.\n\n1. No Cookie Found - `msg.req.cookies.auth` key does not exist\n\n > User to be redirected to authentication method\n\n\n## Output Data\n\nThis group does not always not return data. \nData returned is only stored in `msg.session`.\n\n### Authenticated User\n\n`msg.session` is returned with the Authentication data contained. \n\nThis data will either be from a stored session (user authenticated previously) or be created via the authentication method.\nThere are two session types and they are `token` and `oauth2`. Session types are directly tied to the method of authentication.\n\n`msg.session` structure\n\n``` json\n{\n \"session\": {\n \"datetime\": \"{session expiry}\",\n \"type\": \"token\",\n \"user\"{\n \"username\": \"barny.gumble\",\n \"fname\": \"Barny\",\n \"lname\": \"Gumble\",\n \"mail\": \"barney.gumble@dinomail.com\"\n },\n \"oauth2\": {\n // Only if type=oauth2\n }\n }\n}\n\n```\n\n### Non-Authenticated User\n\nNo data is returned if the user is not authenticated. The absense of `msg.session` denotes an unauthenticated user.\n"
|
|
},
|
|
{
|
|
"id": "b994fe21efb223a9",
|
|
"type": "group",
|
|
"z": "379c65a27117b46c",
|
|
"name": "Automagic: Config to global",
|
|
"style": {
|
|
"stroke": "#6f2fa0",
|
|
"fill": "#92d04f",
|
|
"label": true,
|
|
"color": "#ffff00"
|
|
},
|
|
"nodes": [
|
|
"c7ca92d48206b4b2",
|
|
"de01a4559aecf1c4",
|
|
"842ade29052f7e66",
|
|
"957b63c9fc58a139",
|
|
"02812e8708980b09",
|
|
"e83ed4274d3959f3",
|
|
"06b5d27bbf1e5b16",
|
|
"32d8df5c0bb564cb",
|
|
"fb7fea44905cf7a4",
|
|
"2d4bed7c63632c6c"
|
|
],
|
|
"x": 154,
|
|
"y": 59,
|
|
"w": 1032,
|
|
"h": 182
|
|
},
|
|
{
|
|
"id": "3b247f5e5d90963e",
|
|
"type": "group",
|
|
"z": "4b5e055cd6b1e387",
|
|
"name": "Change Password",
|
|
"style": {
|
|
"stroke": "#ff0000",
|
|
"fill": "#7fb7df",
|
|
"label": true,
|
|
"color": "#ffff00"
|
|
},
|
|
"nodes": [
|
|
"f8ec4a6290dc7e20",
|
|
"b75415bd2541b6df",
|
|
"a6c8721721fc267e",
|
|
"dba3741d6cc275c9",
|
|
"1e614fa32322f125",
|
|
"0c16bf9634323276"
|
|
],
|
|
"x": 128,
|
|
"y": 1133,
|
|
"w": 4704,
|
|
"h": 228,
|
|
"info": "# Change User Password\n\nThis group contains the workflow to change a users password within LDAP.\n\nThe workflow has th following steps:\n\n1. Validate the form input\n\n1. Check that the new password fields match\n\n1. Confirm that the user entered \"Current Password\" matches what's in LDAP\n\n1. Change the users password within LDAP.\n"
|
|
},
|
|
{
|
|
"id": "9d9f0106c9ca9adf",
|
|
"type": "group",
|
|
"z": "379c65a27117b46c",
|
|
"name": "HTTP Server",
|
|
"style": {
|
|
"stroke": "#6f2fa0",
|
|
"fill": "#e3f3d3",
|
|
"label": true,
|
|
"color": "#000000"
|
|
},
|
|
"nodes": [
|
|
"cf2a3f84cb26a12c",
|
|
"755ff25cc29a08a1",
|
|
"ec8733df4e619869",
|
|
"8363d385051fc5c0",
|
|
"5706252b01492258",
|
|
"f3aa07300888f0a4",
|
|
"923268ee62c6a7db",
|
|
"f3aa07300888f0a4"
|
|
],
|
|
"x": 148,
|
|
"y": 313,
|
|
"w": 2964,
|
|
"h": 914,
|
|
"info": "# HTTP Server\n\nThis group provides the entrypoint for the application. it's broken down into further sub-groups that have their own individual responsibilities for processing a part of the HTTP servers workflow."
|
|
},
|
|
{
|
|
"id": "b5d607bb9a62875f",
|
|
"type": "group",
|
|
"z": "24deed6b10f37f8f",
|
|
"name": "Trigger",
|
|
"style": {
|
|
"stroke": "#92d04f",
|
|
"fill": "#bfdbef",
|
|
"label": true,
|
|
"color": "#777777"
|
|
},
|
|
"nodes": [
|
|
"8e0d9bd8043dd53b",
|
|
"79e414f65b0e157b",
|
|
"8f313772a6e82e96",
|
|
"7e6699ce0159226a",
|
|
"61115e9c6e619dae",
|
|
"2d78bd7d0f411721",
|
|
"47f68cd20a8a528b",
|
|
"348b594ba5acb470",
|
|
"2bcdbb78b4e9181f"
|
|
],
|
|
"x": 54,
|
|
"y": 99
|
|
},
|
|
{
|
|
"id": "f7c0a5bee0e0df33",
|
|
"type": "group",
|
|
"z": "24deed6b10f37f8f",
|
|
"name": "Task: Clean Expired Tokens",
|
|
"style": {
|
|
"stroke": "#6f2fa0",
|
|
"fill": "#e3f3d3",
|
|
"label": true,
|
|
"color": "#777777"
|
|
},
|
|
"nodes": [
|
|
"8c5bb81ae0b14703",
|
|
"b2e1cdc1778fd936",
|
|
"f4da55e70a4f8c2c",
|
|
"44c01ba9bfc47ee8",
|
|
"55d7ad6e4958f882",
|
|
"bb5ccb49f1aa1036",
|
|
"f5f9e14092781e29",
|
|
"e25b155a2a29f16d",
|
|
"0f30a271d9c71f74",
|
|
"966779cca7297dec",
|
|
"a3bd692422c0fcf5",
|
|
"291408859782056d"
|
|
],
|
|
"x": 1274,
|
|
"y": 99
|
|
},
|
|
{
|
|
"id": "e8558844b3710e7b",
|
|
"type": "group",
|
|
"z": "8179bf22c4c31682",
|
|
"name": "Returns: string, msg.filename (Session File)",
|
|
"style": {
|
|
"label": true
|
|
},
|
|
"nodes": [
|
|
"17276c106d99423c",
|
|
"dacd02c9aec07af9",
|
|
"745056010192e36a",
|
|
"aade2f705a555f31",
|
|
"1bc65c1f44b4a1ac",
|
|
"b595d8148f247f69"
|
|
],
|
|
"x": 114,
|
|
"y": 519,
|
|
"w": 992,
|
|
"h": 82
|
|
},
|
|
{
|
|
"id": "8f9d362a10096ca7",
|
|
"type": "group",
|
|
"z": "8179bf22c4c31682",
|
|
"style": {
|
|
"stroke": "#999999",
|
|
"stroke-opacity": "1",
|
|
"fill": "none",
|
|
"fill-opacity": "1",
|
|
"label": true,
|
|
"label-position": "nw",
|
|
"color": "#a4a4a4"
|
|
},
|
|
"nodes": [],
|
|
"x": 0,
|
|
"y": 0,
|
|
"w": 40,
|
|
"h": 40
|
|
},
|
|
{
|
|
"id": "aea0a3398dafab4c",
|
|
"type": "group",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "a9d52eb951c5f037",
|
|
"name": "Invalid User Response",
|
|
"style": {
|
|
"stroke": "#ff0000",
|
|
"fill": "#e3f3d3",
|
|
"label": true,
|
|
"color": "#777777"
|
|
},
|
|
"nodes": [
|
|
"72721ec69edf230f",
|
|
"8eca6e69b809790c"
|
|
],
|
|
"x": 2214,
|
|
"y": 999,
|
|
"w": 512,
|
|
"h": 82
|
|
},
|
|
{
|
|
"id": "9858d84dc9d001be",
|
|
"type": "group",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "9b1493c4ae19a935",
|
|
"name": "GLPI",
|
|
"style": {
|
|
"fill": "#d1d1d1",
|
|
"label": true
|
|
},
|
|
"nodes": [
|
|
"160bc27f7530e52d",
|
|
"4cdb1540cd4c8744",
|
|
"0676d69c05236349",
|
|
"edbb6827a8b33085",
|
|
"ed0645c12f7435b2",
|
|
"d7dbd3970c891c33"
|
|
],
|
|
"x": 234,
|
|
"y": 813,
|
|
"w": 4578,
|
|
"h": 634
|
|
},
|
|
{
|
|
"id": "82ccba0e0a13970a",
|
|
"type": "group",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "a9d52eb951c5f037",
|
|
"name": "Respond: Success",
|
|
"style": {
|
|
"stroke": "#6f2fa0",
|
|
"fill": "#e3f3d3",
|
|
"label": true
|
|
},
|
|
"nodes": [
|
|
"b1bc2e62654b04e2",
|
|
"f125e4c474dd2e5c"
|
|
],
|
|
"x": 2214,
|
|
"y": 899,
|
|
"w": 512,
|
|
"h": 82
|
|
},
|
|
{
|
|
"id": "d0dc259791aed430",
|
|
"type": "group",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "a9d52eb951c5f037",
|
|
"name": "",
|
|
"style": {
|
|
"stroke": "#ff0000",
|
|
"fill": "#dbcbe7",
|
|
"label": true
|
|
},
|
|
"nodes": [
|
|
"9090daaf8a5892b0",
|
|
"853e6c15b5317007",
|
|
"142f9ce43cb63dd7",
|
|
"c710ba5a1416cfd8",
|
|
"073709e754dd98a3",
|
|
"ec52cbc3aa0fec25",
|
|
"13711f1826f83198"
|
|
],
|
|
"x": 574,
|
|
"y": 959,
|
|
"w": 1432,
|
|
"h": 122
|
|
},
|
|
{
|
|
"id": "d1b4f7ad9e8ea4f0",
|
|
"type": "group",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "a9d52eb951c5f037",
|
|
"name": "ITSM: Create Ticket",
|
|
"style": {
|
|
"stroke": "#ff0000",
|
|
"fill": "#dbcbe7",
|
|
"label": true
|
|
},
|
|
"nodes": [
|
|
"8dd7c0779eac59f0",
|
|
"00066fdae59433b8",
|
|
"93434028042529b8",
|
|
"ad66e8c05ee9a664",
|
|
"dce8db9b841faf7f",
|
|
"1a29880acc851ff5"
|
|
],
|
|
"x": 834,
|
|
"y": 819,
|
|
"w": 912,
|
|
"h": 122
|
|
},
|
|
{
|
|
"id": "4cdebccc4a1f08ed",
|
|
"type": "group",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "a9d52eb951c5f037",
|
|
"name": "Search LDAP for user",
|
|
"style": {
|
|
"stroke": "#ff0000",
|
|
"fill": "#dbcbe7",
|
|
"label": true,
|
|
"color": "#777777"
|
|
},
|
|
"nodes": [
|
|
"c66c2a0c3817433c",
|
|
"c08e353c85cde934",
|
|
"311e184a2397eb19",
|
|
"faa5e7380a3092a2",
|
|
"fe1f0a50300d9224",
|
|
"b10e8a45ff44f80d",
|
|
"0308c42b587c3794",
|
|
"04818ddd8782b0a1",
|
|
"5cfc1e5277013397"
|
|
],
|
|
"x": 434,
|
|
"y": 519,
|
|
"w": 1752,
|
|
"h": 122
|
|
},
|
|
{
|
|
"id": "9926c0ba3f91aca8",
|
|
"type": "group",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "a9d52eb951c5f037",
|
|
"name": "ITSM Search",
|
|
"style": {
|
|
"stroke": "#ff0000",
|
|
"fill": "#dbcbe7",
|
|
"label": true
|
|
},
|
|
"nodes": [
|
|
"07ed8c85583c5a2e",
|
|
"4a4676456c27f256",
|
|
"a43bd1f944ef851c",
|
|
"eeb2b5a4e44d0c24",
|
|
"bc29c53d4ef04184",
|
|
"68628b6f32ec8b74",
|
|
"dbeedddce12963de",
|
|
"445623ba528e5df1",
|
|
"58d1108b52842808",
|
|
"f6fc2010d0af1e33"
|
|
],
|
|
"x": 574,
|
|
"y": 659,
|
|
"w": 1452,
|
|
"h": 142
|
|
},
|
|
{
|
|
"id": "f8ec4a6290dc7e20",
|
|
"type": "group",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "3b247f5e5d90963e",
|
|
"name": "Fetch Users Current Password",
|
|
"style": {
|
|
"stroke": "#ff0000",
|
|
"fill": "#dbcbe7",
|
|
"label": true,
|
|
"color": "#777777"
|
|
},
|
|
"nodes": [
|
|
"6ef14d9fb582d42e",
|
|
"30264cfad476079a",
|
|
"53fce6f461eec779",
|
|
"553d0da331015252",
|
|
"1619699cd34defb4",
|
|
"815ce9e0380e642f"
|
|
],
|
|
"x": 1074,
|
|
"y": 1159,
|
|
"w": 1072,
|
|
"h": 122
|
|
},
|
|
{
|
|
"id": "cf2a3f84cb26a12c",
|
|
"type": "group",
|
|
"z": "379c65a27117b46c",
|
|
"g": "9d9f0106c9ca9adf",
|
|
"name": "Methods",
|
|
"style": {
|
|
"stroke": "#001f60",
|
|
"fill": "#ffbfbf",
|
|
"label": true,
|
|
"color": "#000000"
|
|
},
|
|
"nodes": [
|
|
"c80657a01a03012d",
|
|
"482740e98dda9d35",
|
|
"1e0841f1.ac68fe",
|
|
"5de0bbd4.6c8574",
|
|
"28713941e03e2bf5",
|
|
"adbfd4257ea1c230",
|
|
"c6360f6028e1512c",
|
|
"b174f7bc1d398a56",
|
|
"3dc07bb0a7d4f647",
|
|
"c58cfa3fc57972d1"
|
|
],
|
|
"x": 174,
|
|
"y": 339,
|
|
"w": 572,
|
|
"h": 202,
|
|
"info": "# Methods\n\nThis sub-group is provides the http endpoints for the supported methods."
|
|
},
|
|
{
|
|
"id": "755ff25cc29a08a1",
|
|
"type": "group",
|
|
"z": "379c65a27117b46c",
|
|
"g": "9d9f0106c9ca9adf",
|
|
"name": "HTTP: Response",
|
|
"style": {
|
|
"stroke": "#ff0000",
|
|
"fill": "#dbcbe7",
|
|
"label": true,
|
|
"color": "#777777"
|
|
},
|
|
"nodes": [
|
|
"564400f9ec708521",
|
|
"e3043367c9a89a90",
|
|
"7db929503cf13635",
|
|
"3af3d2ae3286ffe0"
|
|
],
|
|
"x": 2494,
|
|
"y": 1079,
|
|
"w": 572,
|
|
"h": 122
|
|
},
|
|
{
|
|
"id": "ec8733df4e619869",
|
|
"type": "group",
|
|
"z": "379c65a27117b46c",
|
|
"g": "9d9f0106c9ca9adf",
|
|
"name": "Fetch Content",
|
|
"style": {
|
|
"stroke": "#0070c0",
|
|
"fill": "#bfdbef",
|
|
"label": true,
|
|
"color": "#000000"
|
|
},
|
|
"nodes": [
|
|
"5c05dcd676fcb02a",
|
|
"3ada862ebc07a99d",
|
|
"eae031f35d9a1e9e",
|
|
"4716d2916d6de31e",
|
|
"6e74b4a9a6b2dac8",
|
|
"6dc15589d8863139",
|
|
"1b121b9ecdf14084",
|
|
"ce290d371c7687b0",
|
|
"f2026962fb8dbb44",
|
|
"12a331c2a036a776",
|
|
"68f30ef53ebc2074",
|
|
"e2876b413d95adf9",
|
|
"cad86e4a717ecb58",
|
|
"333303604fa4ca01",
|
|
"52395c2abfc3c4f5",
|
|
"515f363d4f52f625",
|
|
"f4f56319a112fd86",
|
|
"1ee7757ab11df474",
|
|
"51a40870ef7d7eec",
|
|
"38b0e07a7e4cec42",
|
|
"7f4255c2cbe633a5",
|
|
"09cd31dda9fa3c50"
|
|
],
|
|
"x": 994,
|
|
"y": 559,
|
|
"w": 1292,
|
|
"h": 382,
|
|
"info": "# Fetch Content\n\nThis sub-group is the third step in the http workflow.\n\nOnce authorized, this workflow fetches the html content to be displayed within the browser.\n"
|
|
},
|
|
{
|
|
"id": "8363d385051fc5c0",
|
|
"type": "group",
|
|
"z": "379c65a27117b46c",
|
|
"g": "9d9f0106c9ca9adf",
|
|
"name": "Process Forms",
|
|
"style": {
|
|
"stroke": "#0070c0",
|
|
"fill": "#bfdbef",
|
|
"label": true,
|
|
"color": "#777777"
|
|
},
|
|
"nodes": [
|
|
"9cbf4027b4ab1c04",
|
|
"7c38c172df490c56",
|
|
"75913f37.78e6e",
|
|
"c0e5efefb8395690",
|
|
"7b62ec12651e478a",
|
|
"539d65720b0ff630",
|
|
"0eb8679ee25c4a34",
|
|
"3072b7c1fc0fd171",
|
|
"64c99b312f9c601c",
|
|
"9c92aaf02fee52b5",
|
|
"b7fde07e47cc852e",
|
|
"2189bf4e56868e51"
|
|
],
|
|
"x": 994,
|
|
"y": 979,
|
|
"w": 1292,
|
|
"h": 222,
|
|
"info": "# Process Forms\n\nThis sub-group is the third step in the http workflow.\n\nThis sub-group is responsible for processing any forms that are sent to the server.\n"
|
|
},
|
|
{
|
|
"id": "5706252b01492258",
|
|
"type": "group",
|
|
"z": "379c65a27117b46c",
|
|
"g": "9d9f0106c9ca9adf",
|
|
"name": "Fetch Styles/JS",
|
|
"style": {
|
|
"stroke": "#0070c0",
|
|
"fill": "#bfdbef",
|
|
"label": true,
|
|
"color": "#777777"
|
|
},
|
|
"nodes": [
|
|
"acd5690f3865f156",
|
|
"9f59194fecc0976a",
|
|
"15721605aaae8a86",
|
|
"eaeb9e2bfbe1dc95",
|
|
"1b1ca0bd7037ed0f",
|
|
"e72f08d8fc433bea",
|
|
"d81c931de5a63675",
|
|
"28ac8fd21056642c",
|
|
"195e7631e8660db0",
|
|
"e01b059fbd4cb54f",
|
|
"dce9621aba915bd4",
|
|
"31b86caaa955a0ee",
|
|
"dc075811536fafda",
|
|
"f5365376f49c255d"
|
|
],
|
|
"x": 2374,
|
|
"y": 559,
|
|
"w": 712,
|
|
"h": 422,
|
|
"info": "# Fetch CSS / JS Files\n\nThis sub-group is the forth step in the http workflow, and specifically for HTTP/Get methods only.\n\nThis sub-group is responsible for fetching the appropriate CSS Style or JS Script that is required to fulfill the page request.\n"
|
|
},
|
|
{
|
|
"id": "f3aa07300888f0a4",
|
|
"type": "group",
|
|
"z": "379c65a27117b46c",
|
|
"g": "9d9f0106c9ca9adf",
|
|
"name": "HTTP Status Codes",
|
|
"style": {
|
|
"stroke": "#ffC000",
|
|
"fill": "#ffffbf",
|
|
"label": true,
|
|
"color": "#777777"
|
|
},
|
|
"nodes": [
|
|
"434d74f494db7cfc",
|
|
"d17512b4de05ede1",
|
|
"0ec392291c3fda2f",
|
|
"c43678f82d52004f",
|
|
"43603c3760e7ae56",
|
|
"5ad10ea406e2d3a7",
|
|
"c058f11dfd8d01b2"
|
|
],
|
|
"x": 174,
|
|
"y": 576.5,
|
|
"w": 692,
|
|
"h": 244.5
|
|
},
|
|
{
|
|
"id": "923268ee62c6a7db",
|
|
"type": "group",
|
|
"z": "379c65a27117b46c",
|
|
"g": "9d9f0106c9ca9adf",
|
|
"name": "Authorization Check",
|
|
"style": {
|
|
"stroke": "#ff0000",
|
|
"fill": "#ffcf3f",
|
|
"label": true,
|
|
"color": "#000000"
|
|
},
|
|
"nodes": [
|
|
"2f1060b185e19215",
|
|
"6728a85f5b044738",
|
|
"46d8b11bdef459aa",
|
|
"1c16492a7fe8e77b",
|
|
"e282aea37a90acdc",
|
|
"5f2f87eeebd5bf6e"
|
|
],
|
|
"x": 994,
|
|
"y": 339,
|
|
"w": 932,
|
|
"h": 162,
|
|
"info": "# Authorization Check\n\nThis group is the second step within the http workflow. \n\nThis sub-group is responsible for ensuring that **ALL** requests to the http endpoint are authorized.\n"
|
|
},
|
|
{
|
|
"id": "02dc457b6549ba4e",
|
|
"type": "group",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "a9d52eb951c5f037",
|
|
"name": "Form Validation",
|
|
"style": {
|
|
"stroke": "#ff0000",
|
|
"fill": "#ffffbf",
|
|
"label": true,
|
|
"color": "#777777"
|
|
},
|
|
"nodes": [
|
|
"cdde8116fcac6e5d",
|
|
"0354e185d6df3087",
|
|
"c7b7522a20abbb47",
|
|
"3e44bc1a5e60ec3d"
|
|
],
|
|
"x": 154,
|
|
"y": 359,
|
|
"w": 972,
|
|
"h": 142,
|
|
"info": "# Password Reset Form Processing\n\nThis sub-group is the fist step in processing the password reset form.\n\nfor the form workflow to continue processing the form, the form user details entered, must match the authenticated users details. The details **must** match, as without this matching and by design this form can reset the password of any user where the details are correcct."
|
|
},
|
|
{
|
|
"id": "dba3741d6cc275c9",
|
|
"type": "group",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "3b247f5e5d90963e",
|
|
"name": "Form Validation",
|
|
"style": {
|
|
"label": true,
|
|
"stroke": "#ff0000",
|
|
"fill": "#ffffbf",
|
|
"color": "#777777"
|
|
},
|
|
"nodes": [
|
|
"98364b7271054017",
|
|
"1df8ab6bb55ff621",
|
|
"0239e19c34a9baaa",
|
|
"0efd3333091c9999"
|
|
],
|
|
"x": 154,
|
|
"y": 1159,
|
|
"w": 812,
|
|
"h": 122,
|
|
"info": "# Form Validation\n\nValidate the password change form."
|
|
},
|
|
{
|
|
"id": "1e614fa32322f125",
|
|
"type": "group",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "3b247f5e5d90963e",
|
|
"name": "Check Current Password",
|
|
"style": {
|
|
"stroke": "#ff0000",
|
|
"fill": "#dbcbe7",
|
|
"label": true,
|
|
"color": "#777777"
|
|
},
|
|
"nodes": [
|
|
"23292bc7d78b9d1d",
|
|
"ffaae19e230436cf",
|
|
"f17566766d0b5a53",
|
|
"abef97c0bb13b432",
|
|
"aab2d165deacdab6",
|
|
"c57cf198943aef16"
|
|
],
|
|
"x": 2214,
|
|
"y": 1159,
|
|
"w": 1152,
|
|
"h": 122,
|
|
"info": "# Check Current Password\n\nConfirm that the user entered \"current password\" matches the LDAP value"
|
|
},
|
|
{
|
|
"id": "0c16bf9634323276",
|
|
"type": "group",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "3b247f5e5d90963e",
|
|
"name": "Change User Password",
|
|
"style": {
|
|
"stroke": "#ff0000",
|
|
"fill": "#dbcbe7",
|
|
"label": true,
|
|
"color": "#777777"
|
|
},
|
|
"nodes": [
|
|
"f093762ba0afe7d2",
|
|
"53df7c8ab13e33de",
|
|
"7b9797b6bc354e56",
|
|
"e7fa19cf8785fd90",
|
|
"f16ae7601e3dce19",
|
|
"f8b9e1b1537129ec",
|
|
"5897178ac3448e41"
|
|
],
|
|
"x": 3394,
|
|
"y": 1159,
|
|
"w": 1412,
|
|
"h": 122,
|
|
"info": "# Change User Password\n\nChange the users password within LDAP"
|
|
},
|
|
{
|
|
"id": "177a7aba70483ccb",
|
|
"type": "group",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "bbd929c437c592ea",
|
|
"name": "Cookie Validation",
|
|
"style": {
|
|
"stroke": "#ffC000",
|
|
"fill": "#ffffbf",
|
|
"label": true,
|
|
"color": "#777777"
|
|
},
|
|
"nodes": [
|
|
"bcaed4334222c14a"
|
|
],
|
|
"x": 768,
|
|
"y": 1553,
|
|
"w": 1204,
|
|
"h": 234
|
|
},
|
|
{
|
|
"id": "cc33365c2aa59e35",
|
|
"type": "group",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "bbd929c437c592ea",
|
|
"name": "Token",
|
|
"style": {
|
|
"stroke": "#0070c0",
|
|
"fill": "#ffffbf",
|
|
"label": true
|
|
},
|
|
"nodes": [
|
|
"c10e09e4bfbddfd7",
|
|
"53a5ee55ee916cec",
|
|
"75c44e5f7f101beb",
|
|
"a4bc5830daf9801a",
|
|
"5851acefa1f1b5ff"
|
|
],
|
|
"x": 774,
|
|
"y": 1813,
|
|
"w": 2072,
|
|
"h": 334
|
|
},
|
|
{
|
|
"id": "7225c45ad941c14f",
|
|
"type": "group",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "bbd929c437c592ea",
|
|
"name": "Oauth2",
|
|
"style": {
|
|
"stroke": "#0070c0",
|
|
"fill": "#ffffbf",
|
|
"label": true,
|
|
"color": "#777777"
|
|
},
|
|
"nodes": [
|
|
"9f416bc258c1a60c",
|
|
"bc5ca736a6e324e5",
|
|
"8964a5bda9eb7113",
|
|
"60a97c78327c3a6a",
|
|
"8ad6190854001584",
|
|
"21ec376b58ac0c54",
|
|
"9f3711f96411e2cc",
|
|
"f5e65e1ae7e8b812",
|
|
"1e2dce9d25c567d6",
|
|
"261436c730a46051",
|
|
"97fb6e1471c0f7cd"
|
|
],
|
|
"x": 774,
|
|
"y": 2193,
|
|
"w": 2078,
|
|
"h": 394,
|
|
"info": "# Oauth2 Authentication\n\n"
|
|
},
|
|
{
|
|
"id": "69f0d6271fe16536",
|
|
"type": "group",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "bbd929c437c592ea",
|
|
"name": "Auth: Save Session",
|
|
"style": {
|
|
"stroke": "#0070c0",
|
|
"fill": "#e3f3d3",
|
|
"label": true,
|
|
"color": "#777777"
|
|
},
|
|
"nodes": [
|
|
"d24ebda198149601",
|
|
"1380f91c814b8e2f",
|
|
"c3a8957e4400e12f",
|
|
"05880bb4ed6cab41",
|
|
"10120b4cdade08c6",
|
|
"3629b0bb901c20a7",
|
|
"d43b2afbfaad2d31",
|
|
"bcab3f1c2966f5aa",
|
|
"150344ba8db2ceee",
|
|
"4ff84724b26afc75",
|
|
"3f5bfeb6ef2a9467",
|
|
"5eaba17d961e2efb",
|
|
"fb600cd457e87c43",
|
|
"431bb2a5b956dd2c",
|
|
"e2cbcdcc69e9ce21"
|
|
],
|
|
"x": 234,
|
|
"y": 2639,
|
|
"w": 2352,
|
|
"h": 182
|
|
},
|
|
{
|
|
"id": "ed0645c12f7435b2",
|
|
"type": "group",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "9858d84dc9d001be",
|
|
"name": "Create a Ticket",
|
|
"style": {
|
|
"fill": "#dbcbe7",
|
|
"label": true
|
|
},
|
|
"nodes": [
|
|
"d4de6eab89782579",
|
|
"d20869bcacd7b0fd",
|
|
"525cc01f4d41ae0b",
|
|
"45d7aa8b4b386bb7",
|
|
"2663cccd5d6ca575",
|
|
"6492bc8146326691",
|
|
"e363219f4309eedb",
|
|
"c6c64453fc61e50f",
|
|
"5eda003868c5e354",
|
|
"2545718f1853e084",
|
|
"1840577fd414a84d",
|
|
"ed5a0fab59b28faa",
|
|
"85fa24886e126df7",
|
|
"246331e1c052e1f8",
|
|
"e8f257b38aa4d749",
|
|
"f57f557a25d166b7",
|
|
"aa5626527a9df701",
|
|
"5a961504d7ca5be3"
|
|
],
|
|
"x": 754,
|
|
"y": 1051.5,
|
|
"w": 4032,
|
|
"h": 369.5
|
|
},
|
|
{
|
|
"id": "d7dbd3970c891c33",
|
|
"type": "group",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "9858d84dc9d001be",
|
|
"name": "Search for User",
|
|
"style": {
|
|
"fill": "#dbcbe7",
|
|
"label": true
|
|
},
|
|
"nodes": [
|
|
"669724fdc876385d",
|
|
"65c3e138bbcd8b3a",
|
|
"269cbacf5274d6d8",
|
|
"42f157ed01b737f4",
|
|
"33d710f97adb5298",
|
|
"6aac3151138c4af9",
|
|
"587b497ce06d683f",
|
|
"f76da20ac475cf64",
|
|
"a9cfd4c1413c7ec6",
|
|
"a888a2ed9a053acc"
|
|
],
|
|
"x": 754,
|
|
"y": 839,
|
|
"w": 1412,
|
|
"h": 182
|
|
},
|
|
{
|
|
"id": "75c44e5f7f101beb",
|
|
"type": "group",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "cc33365c2aa59e35",
|
|
"name": "Token Session",
|
|
"style": {
|
|
"label": true,
|
|
"stroke": "#6f2fa0",
|
|
"fill": "#bfdbef"
|
|
},
|
|
"nodes": [
|
|
"42a1e057dda56f95",
|
|
"366892fde876296f",
|
|
"8b1fef39c34f5513",
|
|
"95f44fbb0ddd39fc"
|
|
],
|
|
"x": 1014,
|
|
"y": 1839,
|
|
"w": 672,
|
|
"h": 122
|
|
},
|
|
{
|
|
"id": "bcaed4334222c14a",
|
|
"type": "group",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "177a7aba70483ccb",
|
|
"name": "Cookie Validation",
|
|
"style": {
|
|
"stroke": "#6f2fa0",
|
|
"fill": "#bfdbef",
|
|
"label": true,
|
|
"color": "#777777"
|
|
},
|
|
"nodes": [
|
|
"33f25da80ef87e72",
|
|
"73b63d7562fe9cce",
|
|
"e897aec8ea7c81c5",
|
|
"9c05ca2751f619a7",
|
|
"2dee51842e868755",
|
|
"2a858bd15a2d257e",
|
|
"f20711a44b43b7d4",
|
|
"9cbf4beaceba5255",
|
|
"da0811fbd7963934"
|
|
],
|
|
"x": 794,
|
|
"y": 1579,
|
|
"w": 1152,
|
|
"h": 182,
|
|
"info": "# Cookie Validation\n\nThis path is always executed and is the first step in the authentication workflow. \n\nThis groups workflow is as follows:\n\n1. fetch the value of `msg.req.cookies.auth`\n\n * if empty/null. User needs to logon\n\n * value found, goto step 2\n\n2. open the session file using the value of `msg.req.cookies.auth`\n\n3. set `msg.session` with the contents of the file\n\n4. Route for further validation based off of type `oauth2` or `token`.\n\nthe existance of path `msg.req.cookies.auth` alludes to a user that has authenticated previously. \nWhilst this value could be guessed, it is highly unlikely.\n"
|
|
},
|
|
{
|
|
"id": "9f3711f96411e2cc",
|
|
"type": "group",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "7225c45ad941c14f",
|
|
"name": "Oauth2: Fetch User Token",
|
|
"style": {
|
|
"stroke": "#ffC000",
|
|
"fill": "#dbcbe7",
|
|
"label": true,
|
|
"color": "#777777"
|
|
},
|
|
"nodes": [
|
|
"8b072412d6eea267",
|
|
"07ee83c8d9bdbcb2",
|
|
"a4a3bb52d2eaa071",
|
|
"9d0d1d9a6c596428",
|
|
"a49db4bcea29097d",
|
|
"444cde06405f24e3"
|
|
],
|
|
"x": 1294,
|
|
"y": 2439,
|
|
"w": 972,
|
|
"h": 122
|
|
},
|
|
{
|
|
"id": "f5e65e1ae7e8b812",
|
|
"type": "group",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "7225c45ad941c14f",
|
|
"name": "Oauth2: Session",
|
|
"style": {
|
|
"stroke": "#6f2fa0",
|
|
"fill": "#bfdbef",
|
|
"label": true,
|
|
"color": "#777777"
|
|
},
|
|
"nodes": [
|
|
"55efe159b8d86e8f",
|
|
"50e12d2b699abb59",
|
|
"3254bbe21538dc25",
|
|
"b371f5e8c32059f3",
|
|
"e6f37f07e9217707",
|
|
"68cdc18107b77029",
|
|
"412814a194fb2e27",
|
|
"a30dab395f333826",
|
|
"7873f07f92e9be20",
|
|
"36c7736ada06ef15",
|
|
"54e638b390e13c61"
|
|
],
|
|
"x": 1294,
|
|
"y": 2219,
|
|
"w": 1532,
|
|
"h": 202
|
|
},
|
|
{
|
|
"id": "5851acefa1f1b5ff",
|
|
"type": "group",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "cc33365c2aa59e35",
|
|
"name": "Token: Generate",
|
|
"style": {
|
|
"stroke": "#0070c0",
|
|
"fill": "#92d04f",
|
|
"label": true,
|
|
"color": "#000000"
|
|
},
|
|
"nodes": [
|
|
"f08e22fcc829d7b2",
|
|
"9bb0664a91ae9b97",
|
|
"99a20ee6c80595d1",
|
|
"0107c5fd18462084",
|
|
"2f7615b7afa603aa",
|
|
"e350059bd801a5ab",
|
|
"cb10034e64c15167",
|
|
"702a6efc7be81391",
|
|
"1dc714dfeaa9a42d",
|
|
"a68c08dfd9ce3d8c"
|
|
],
|
|
"x": 1014,
|
|
"y": 1999,
|
|
"w": 1302,
|
|
"h": 122,
|
|
"info": "# Token Generate\n\nThis sub-group contains the nodes required to generate an authentication token.\n\nThere are two entrypoints for this group:\n\n1. _(Development)_ Click on the generate token to create one for a abritary user\n\n1. `Token: Generate` Link-In node. This is used for other flows which may require a token to be generated for a user. Details must be provided.\n\nThe latter is useful if you create a user with a random password and they need a method to be able to reset it.\n\n## Input Data\n\nthis node requires an object at path `msg.auth.user`.\n\n``` json\n\nmsg.auth.user = {\n \"username\": \"barny.gumble\",\n \"fname\": \"Barny\",\n \"lname\": \"Gumble\",\n \"mail\": \"barney.gumble@dinomail.com\"\n };\n\n```\n\n**NOTE:** _Missing any of the `json` attributes will prevent the user from resetting their password as all of these fields are required._\n"
|
|
},
|
|
{
|
|
"id": "85fa24886e126df7",
|
|
"type": "group",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "ed0645c12f7435b2",
|
|
"name": "Ticket Solution",
|
|
"style": {
|
|
"stroke": "#6f2fa0",
|
|
"fill": "#bfdbef",
|
|
"label": true
|
|
},
|
|
"nodes": [
|
|
"40208ed719417cac",
|
|
"803a8b65fc7a5087",
|
|
"96766518a046855d",
|
|
"242b471ad711a4f1",
|
|
"1305e2f195ec5ede",
|
|
"285f57c0fee687a1"
|
|
],
|
|
"x": 2234,
|
|
"y": 1259,
|
|
"w": 1472,
|
|
"h": 82
|
|
},
|
|
{
|
|
"id": "aa5626527a9df701",
|
|
"type": "group",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "ed0645c12f7435b2",
|
|
"name": "Ticket Task",
|
|
"style": {
|
|
"stroke": "#6f2fa0",
|
|
"fill": "#bfdbef",
|
|
"label": true
|
|
},
|
|
"nodes": [
|
|
"351440700b3e2ecc",
|
|
"f17ccfa845461657"
|
|
],
|
|
"x": 2228,
|
|
"y": 1093,
|
|
"w": 2204,
|
|
"h": 134
|
|
},
|
|
{
|
|
"id": "351440700b3e2ecc",
|
|
"type": "group",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "aa5626527a9df701",
|
|
"name": "Create",
|
|
"style": {
|
|
"stroke": "#001f60",
|
|
"fill": "#e3f3d3",
|
|
"label": true,
|
|
"color": "#777777"
|
|
},
|
|
"nodes": [
|
|
"fb6750555645b873",
|
|
"e0660324da4581dd"
|
|
],
|
|
"x": 2254,
|
|
"y": 1119,
|
|
"w": 492,
|
|
"h": 82
|
|
},
|
|
{
|
|
"id": "f17ccfa845461657",
|
|
"type": "group",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "aa5626527a9df701",
|
|
"name": "Update",
|
|
"style": {
|
|
"stroke": "#001f60",
|
|
"fill": "#e3f3d3",
|
|
"label": true,
|
|
"color": "#777777"
|
|
},
|
|
"nodes": [
|
|
"eacbafc05d06b95a",
|
|
"76cd564b69443419",
|
|
"ca1b9c48c3c0c522",
|
|
"d64e9c631ee7ec87",
|
|
"cafa50da13d9e5d9",
|
|
"c2f8e99492223cfb",
|
|
"fdf014eff1962329"
|
|
],
|
|
"x": 2794,
|
|
"y": 1119,
|
|
"w": 1612,
|
|
"h": 82
|
|
},
|
|
{
|
|
"id": "cd68bc6f76082c33",
|
|
"type": "group",
|
|
"z": "42b9663b67dbd983",
|
|
"name": "",
|
|
"style": {
|
|
"stroke": "#ff0000",
|
|
"fill": "#ffbfbf",
|
|
"label": true
|
|
},
|
|
"nodes": [
|
|
"db9de7d9adf2c039",
|
|
"2e8883be19eb130d",
|
|
"65dc1dee26e42599"
|
|
],
|
|
"x": 694,
|
|
"y": 139,
|
|
"w": 492,
|
|
"h": 82
|
|
},
|
|
{
|
|
"id": "5798e39cbc3730ae",
|
|
"type": "junction",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "8ad5fe68ad170e2d",
|
|
"x": 1240,
|
|
"y": 960,
|
|
"wires": [
|
|
[
|
|
"365ba07c1f4721ec"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "4ab2787bb0227121",
|
|
"type": "junction",
|
|
"z": "104f7938a23fe82f",
|
|
"x": 820,
|
|
"y": 220,
|
|
"wires": [
|
|
[
|
|
"b3adfbc257af34d9"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "f48665a4a0c87ccf",
|
|
"type": "junction",
|
|
"z": "104f7938a23fe82f",
|
|
"x": 2220,
|
|
"y": 280,
|
|
"wires": [
|
|
[
|
|
"e65438fd63bf5834"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "e2fdc9ac8f0f5378",
|
|
"type": "junction",
|
|
"z": "104f7938a23fe82f",
|
|
"x": 1540,
|
|
"y": 280,
|
|
"wires": [
|
|
[
|
|
"f48665a4a0c87ccf"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "b365499ab7271965",
|
|
"type": "junction",
|
|
"z": "104f7938a23fe82f",
|
|
"x": 1900,
|
|
"y": 180,
|
|
"wires": [
|
|
[
|
|
"e6062222b53b3146"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "e6062222b53b3146",
|
|
"type": "junction",
|
|
"z": "104f7938a23fe82f",
|
|
"x": 2140,
|
|
"y": 180,
|
|
"wires": [
|
|
[
|
|
"f48665a4a0c87ccf"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "4c730b98279aaca6",
|
|
"type": "junction",
|
|
"z": "104f7938a23fe82f",
|
|
"x": 420,
|
|
"y": 220,
|
|
"wires": [
|
|
[
|
|
"4ab2787bb0227121",
|
|
"0097abc4a9b09076"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "a740ac24fa947f73",
|
|
"type": "junction",
|
|
"z": "104f7938a23fe82f",
|
|
"x": 240,
|
|
"y": 220,
|
|
"wires": [
|
|
[
|
|
"ab1b24f61ae7f3bf",
|
|
"4c730b98279aaca6"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "ce93ad07095d87d3",
|
|
"type": "junction",
|
|
"z": "f6f2187d.f17ca8",
|
|
"x": 1120,
|
|
"y": 1920,
|
|
"wires": [
|
|
[
|
|
"d4dcc73bbe878f42"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "bab95cf5ba3d6045",
|
|
"type": "junction",
|
|
"z": "f6f2187d.f17ca8",
|
|
"x": 820,
|
|
"y": 1840,
|
|
"wires": [
|
|
[
|
|
"d4dcc73bbe878f42",
|
|
"836dca1c83616f32"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "ce4de75bc712f124",
|
|
"type": "junction",
|
|
"z": "f6f2187d.f17ca8",
|
|
"x": 820,
|
|
"y": 1900,
|
|
"wires": [
|
|
[
|
|
"ebb2a01cac9a803d",
|
|
"607f24e3f91dff90"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "607f24e3f91dff90",
|
|
"type": "junction",
|
|
"z": "f6f2187d.f17ca8",
|
|
"x": 880,
|
|
"y": 1920,
|
|
"wires": [
|
|
[
|
|
"ce93ad07095d87d3"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "ad563b1612f320ce",
|
|
"type": "junction",
|
|
"z": "f6f2187d.f17ca8",
|
|
"x": 820,
|
|
"y": 1940,
|
|
"wires": [
|
|
[
|
|
"3944fbf533097cbb",
|
|
"607f24e3f91dff90"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "bf6a0883e2c6fa86",
|
|
"type": "junction",
|
|
"z": "f6f2187d.f17ca8",
|
|
"x": 3520,
|
|
"y": 700,
|
|
"wires": [
|
|
[
|
|
"9b78dc70ba04be52",
|
|
"7d597c9f95237aec"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "e0b3838ab709561b",
|
|
"type": "junction",
|
|
"z": "f6f2187d.f17ca8",
|
|
"x": 4720,
|
|
"y": 420,
|
|
"wires": [
|
|
[
|
|
"a06872fd8512eb8d",
|
|
"7cd8e1fefd5dd694"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "7d597c9f95237aec",
|
|
"type": "junction",
|
|
"z": "f6f2187d.f17ca8",
|
|
"x": 3800,
|
|
"y": 700,
|
|
"wires": [
|
|
[
|
|
"7cd8e1fefd5dd694"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "9b78dc70ba04be52",
|
|
"type": "junction",
|
|
"z": "f6f2187d.f17ca8",
|
|
"x": 3800,
|
|
"y": 740,
|
|
"wires": [
|
|
[
|
|
"405728494cdf7f87"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "7cd8e1fefd5dd694",
|
|
"type": "junction",
|
|
"z": "f6f2187d.f17ca8",
|
|
"x": 4780,
|
|
"y": 700,
|
|
"wires": [
|
|
[
|
|
"bcdb9f8a74cd2414"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "596b03adcd307cb4",
|
|
"type": "junction",
|
|
"z": "f6f2187d.f17ca8",
|
|
"x": 4560,
|
|
"y": 540,
|
|
"wires": [
|
|
[
|
|
"7cd8e1fefd5dd694"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "e5548020922347cc",
|
|
"type": "junction",
|
|
"z": "f6f2187d.f17ca8",
|
|
"x": 3300,
|
|
"y": 2120,
|
|
"wires": [
|
|
[
|
|
"7bb0fa06d2b81ebf"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "8fdb88fa979041c2",
|
|
"type": "junction",
|
|
"z": "f6f2187d.f17ca8",
|
|
"x": 180,
|
|
"y": 1620,
|
|
"wires": [
|
|
[
|
|
"e370037f2b9ae9a6",
|
|
"109cb443e3b18552"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "56d5a39010b82e94",
|
|
"type": "junction",
|
|
"z": "f6f2187d.f17ca8",
|
|
"x": 500,
|
|
"y": 1420,
|
|
"wires": [
|
|
[
|
|
"d5037ce5a29693fc"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "eb6eecd9d940aecb",
|
|
"type": "junction",
|
|
"z": "f6f2187d.f17ca8",
|
|
"x": 80,
|
|
"y": 1500,
|
|
"wires": [
|
|
[
|
|
"8fdb88fa979041c2"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "46dd694a18a599c9",
|
|
"type": "junction",
|
|
"z": "f6f2187d.f17ca8",
|
|
"x": 1040,
|
|
"y": 1460,
|
|
"wires": [
|
|
[
|
|
"eb6eecd9d940aecb"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "facaa6a7395e5d7f",
|
|
"type": "junction",
|
|
"z": "f6f2187d.f17ca8",
|
|
"x": 2600,
|
|
"y": 2140,
|
|
"wires": [
|
|
[
|
|
"f0b8ea2876129114",
|
|
"4b51a5788a45d420",
|
|
"f710a0c68b11ee76",
|
|
"04d760f9b1988f4b",
|
|
"baa846245c4d19de",
|
|
"432e2ad61476d045"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "e363219f4309eedb",
|
|
"type": "junction",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "ed0645c12f7435b2",
|
|
"x": 2160,
|
|
"y": 1240,
|
|
"wires": [
|
|
[
|
|
"803a8b65fc7a5087"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "2545718f1853e084",
|
|
"type": "junction",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "ed0645c12f7435b2",
|
|
"x": 2160,
|
|
"y": 1160,
|
|
"wires": [
|
|
[
|
|
"fb6750555645b873"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "53b1c5bbed90265f",
|
|
"type": "junction",
|
|
"z": "f6f2187d.f17ca8",
|
|
"x": 820,
|
|
"y": 1980,
|
|
"wires": [
|
|
[
|
|
"0bf3afb49b551d9c",
|
|
"ab69851f2d76cc5e"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "ab69851f2d76cc5e",
|
|
"type": "junction",
|
|
"z": "f6f2187d.f17ca8",
|
|
"x": 1060,
|
|
"y": 1980,
|
|
"wires": [
|
|
[
|
|
"ce93ad07095d87d3"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "f57f557a25d166b7",
|
|
"type": "junction",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "ed0645c12f7435b2",
|
|
"x": 4480,
|
|
"y": 1340,
|
|
"wires": [
|
|
[
|
|
"5eda003868c5e354",
|
|
"e8f257b38aa4d749"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "1840577fd414a84d",
|
|
"type": "junction",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "ed0645c12f7435b2",
|
|
"x": 2160,
|
|
"y": 1320,
|
|
"wires": [
|
|
[
|
|
"c6c64453fc61e50f"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "c6c64453fc61e50f",
|
|
"type": "junction",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "ed0645c12f7435b2",
|
|
"x": 2260,
|
|
"y": 1360,
|
|
"wires": [
|
|
[
|
|
"5a961504d7ca5be3"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "f4f56319a112fd86",
|
|
"type": "junction",
|
|
"z": "379c65a27117b46c",
|
|
"g": "ec8733df4e619869",
|
|
"x": 1980,
|
|
"y": 800,
|
|
"wires": [
|
|
[
|
|
"68f30ef53ebc2074"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "1ee7757ab11df474",
|
|
"type": "junction",
|
|
"z": "379c65a27117b46c",
|
|
"g": "ec8733df4e619869",
|
|
"x": 1980,
|
|
"y": 820,
|
|
"wires": [
|
|
[
|
|
"12a331c2a036a776",
|
|
"f2026962fb8dbb44"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "51a40870ef7d7eec",
|
|
"type": "junction",
|
|
"z": "379c65a27117b46c",
|
|
"g": "ec8733df4e619869",
|
|
"x": 1980,
|
|
"y": 720,
|
|
"wires": [
|
|
[
|
|
"cad86e4a717ecb58"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "38b0e07a7e4cec42",
|
|
"type": "junction",
|
|
"z": "379c65a27117b46c",
|
|
"g": "ec8733df4e619869",
|
|
"x": 1980,
|
|
"y": 680,
|
|
"wires": [
|
|
[
|
|
"333303604fa4ca01"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "7f4255c2cbe633a5",
|
|
"type": "junction",
|
|
"z": "379c65a27117b46c",
|
|
"g": "ec8733df4e619869",
|
|
"x": 1980,
|
|
"y": 640,
|
|
"wires": [
|
|
[
|
|
"52395c2abfc3c4f5"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "09cd31dda9fa3c50",
|
|
"type": "junction",
|
|
"z": "379c65a27117b46c",
|
|
"g": "ec8733df4e619869",
|
|
"x": 1980,
|
|
"y": 600,
|
|
"wires": [
|
|
[
|
|
"515f363d4f52f625"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "195e7631e8660db0",
|
|
"type": "junction",
|
|
"z": "379c65a27117b46c",
|
|
"g": "5706252b01492258",
|
|
"x": 2800,
|
|
"y": 680,
|
|
"wires": [
|
|
[
|
|
"eaeb9e2bfbe1dc95",
|
|
"15721605aaae8a86"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "e01b059fbd4cb54f",
|
|
"type": "junction",
|
|
"z": "379c65a27117b46c",
|
|
"g": "5706252b01492258",
|
|
"x": 2800,
|
|
"y": 720,
|
|
"wires": [
|
|
[
|
|
"1b1ca0bd7037ed0f",
|
|
"e72f08d8fc433bea"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "dce9621aba915bd4",
|
|
"type": "junction",
|
|
"z": "379c65a27117b46c",
|
|
"g": "5706252b01492258",
|
|
"x": 2800,
|
|
"y": 840,
|
|
"wires": [
|
|
[
|
|
"28ac8fd21056642c",
|
|
"d81c931de5a63675"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "adbfd4257ea1c230",
|
|
"type": "junction",
|
|
"z": "379c65a27117b46c",
|
|
"g": "cf2a3f84cb26a12c",
|
|
"x": 380,
|
|
"y": 440,
|
|
"wires": [
|
|
[
|
|
"c6360f6028e1512c"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "966779cca7297dec",
|
|
"type": "junction",
|
|
"z": "24deed6b10f37f8f",
|
|
"g": "f7c0a5bee0e0df33",
|
|
"x": 2780,
|
|
"y": 200,
|
|
"wires": [
|
|
[
|
|
"0f30a271d9c71f74"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "8d9762cb45d1a09d",
|
|
"type": "junction",
|
|
"z": "f6f2187d.f17ca8",
|
|
"x": 3020,
|
|
"y": 2040,
|
|
"wires": [
|
|
[
|
|
"e5548020922347cc"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "291408859782056d",
|
|
"type": "junction",
|
|
"z": "24deed6b10f37f8f",
|
|
"g": "f7c0a5bee0e0df33",
|
|
"x": 2280,
|
|
"y": 200,
|
|
"wires": [
|
|
[
|
|
"966779cca7297dec"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "e83ed4274d3959f3",
|
|
"type": "junction",
|
|
"z": "379c65a27117b46c",
|
|
"g": "b994fe21efb223a9",
|
|
"x": 940,
|
|
"y": 140,
|
|
"wires": [
|
|
[
|
|
"de01a4559aecf1c4"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "06b5d27bbf1e5b16",
|
|
"type": "junction",
|
|
"z": "379c65a27117b46c",
|
|
"g": "b994fe21efb223a9",
|
|
"x": 600,
|
|
"y": 140,
|
|
"wires": [
|
|
[
|
|
"957b63c9fc58a139",
|
|
"fb7fea44905cf7a4"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "e551d77d5412aced",
|
|
"type": "junction",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "a64f4a2c837d5c3c",
|
|
"x": 1720,
|
|
"y": 120,
|
|
"wires": [
|
|
[
|
|
"4ed718e1ae800bad"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "4ed718e1ae800bad",
|
|
"type": "junction",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "a64f4a2c837d5c3c",
|
|
"x": 1860,
|
|
"y": 120,
|
|
"wires": [
|
|
[
|
|
"e5ae19af5f6d6561"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "3f5bfeb6ef2a9467",
|
|
"type": "junction",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "69f0d6271fe16536",
|
|
"x": 1500,
|
|
"y": 2720,
|
|
"wires": [
|
|
[
|
|
"3629b0bb901c20a7",
|
|
"10120b4cdade08c6"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "a67892bd64d2ded4",
|
|
"type": "junction",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "bbd929c437c592ea",
|
|
"x": 500,
|
|
"y": 1620,
|
|
"wires": [
|
|
[
|
|
"3fa2f7ecc012d8c6"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "f5365376f49c255d",
|
|
"type": "junction",
|
|
"z": "379c65a27117b46c",
|
|
"g": "5706252b01492258",
|
|
"x": 2800,
|
|
"y": 800,
|
|
"wires": [
|
|
[
|
|
"31b86caaa955a0ee",
|
|
"dc075811536fafda"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "160d0b5ed597dc51",
|
|
"type": "ldap",
|
|
"host": "ldap://ldap",
|
|
"port": "389"
|
|
},
|
|
{
|
|
"id": "1e0841f1.ac68fe",
|
|
"type": "http in",
|
|
"z": "379c65a27117b46c",
|
|
"g": "cf2a3f84cb26a12c",
|
|
"name": "",
|
|
"url": "*",
|
|
"method": "get",
|
|
"upload": false,
|
|
"swaggerDoc": "",
|
|
"x": 250,
|
|
"y": 420,
|
|
"wires": [
|
|
[
|
|
"c80657a01a03012d",
|
|
"adbfd4257ea1c230"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "1b121b9ecdf14084",
|
|
"type": "switch",
|
|
"z": "379c65a27117b46c",
|
|
"g": "ec8733df4e619869",
|
|
"name": "Routing",
|
|
"property": " $split(req._parsedUrl.pathname, '/', limit)[1]",
|
|
"propertyType": "jsonata",
|
|
"rules": [
|
|
{
|
|
"t": "empty"
|
|
},
|
|
{
|
|
"t": "eq",
|
|
"v": "details",
|
|
"vt": "str"
|
|
},
|
|
{
|
|
"t": "eq",
|
|
"v": "changepassword",
|
|
"vt": "str"
|
|
},
|
|
{
|
|
"t": "eq",
|
|
"v": "passwordreset",
|
|
"vt": "str"
|
|
},
|
|
{
|
|
"t": "eq",
|
|
"v": "passwordquestions",
|
|
"vt": "str"
|
|
},
|
|
{
|
|
"t": "eq",
|
|
"v": "logout",
|
|
"vt": "str"
|
|
},
|
|
{
|
|
"t": "else"
|
|
}
|
|
],
|
|
"checkall": "false",
|
|
"repair": false,
|
|
"outputs": 7,
|
|
"x": 1740,
|
|
"y": 700,
|
|
"wires": [
|
|
[
|
|
"09cd31dda9fa3c50"
|
|
],
|
|
[
|
|
"7f4255c2cbe633a5"
|
|
],
|
|
[
|
|
"38b0e07a7e4cec42"
|
|
],
|
|
[
|
|
"51a40870ef7d7eec"
|
|
],
|
|
[
|
|
"e2876b413d95adf9"
|
|
],
|
|
[
|
|
"f4f56319a112fd86"
|
|
],
|
|
[
|
|
"1ee7757ab11df474"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "6dc15589d8863139",
|
|
"type": "debug",
|
|
"z": "379c65a27117b46c",
|
|
"g": "ec8733df4e619869",
|
|
"name": "HTTP / Get",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1750,
|
|
"y": 620,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "eae031f35d9a1e9e",
|
|
"type": "change",
|
|
"z": "379c65a27117b46c",
|
|
"g": "ec8733df4e619869",
|
|
"name": "",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "client",
|
|
"pt": "msg",
|
|
"to": "req.connection.remoteAddress",
|
|
"tot": "msg"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 1480,
|
|
"y": 700,
|
|
"wires": [
|
|
[
|
|
"6dc15589d8863139",
|
|
"1b121b9ecdf14084"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "e2876b413d95adf9",
|
|
"type": "link out",
|
|
"z": "379c65a27117b46c",
|
|
"g": "ec8733df4e619869",
|
|
"name": "Page: Password Reset Questions",
|
|
"mode": "link",
|
|
"links": [
|
|
"02c4b9524d361ade",
|
|
"b202e09db45b339a"
|
|
],
|
|
"x": 2120,
|
|
"y": 760,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "cad86e4a717ecb58",
|
|
"type": "link out",
|
|
"z": "379c65a27117b46c",
|
|
"g": "ec8733df4e619869",
|
|
"name": "Page: Password Reset",
|
|
"mode": "link",
|
|
"links": [
|
|
"2dc375bf57ad8daa",
|
|
"86d0cb173ed572b5"
|
|
],
|
|
"x": 2160,
|
|
"y": 720,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "5de0bbd4.6c8574",
|
|
"type": "http in",
|
|
"z": "379c65a27117b46c",
|
|
"g": "cf2a3f84cb26a12c",
|
|
"name": "",
|
|
"url": "*",
|
|
"method": "post",
|
|
"upload": false,
|
|
"swaggerDoc": "",
|
|
"x": 250,
|
|
"y": 460,
|
|
"wires": [
|
|
[
|
|
"482740e98dda9d35",
|
|
"adbfd4257ea1c230"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "75913f37.78e6e",
|
|
"type": "json",
|
|
"z": "379c65a27117b46c",
|
|
"g": "8363d385051fc5c0",
|
|
"name": "",
|
|
"property": "payload",
|
|
"action": "obj",
|
|
"pretty": false,
|
|
"x": 1490,
|
|
"y": 1080,
|
|
"wires": [
|
|
[
|
|
"539d65720b0ff630"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "482740e98dda9d35",
|
|
"type": "debug",
|
|
"z": "379c65a27117b46c",
|
|
"g": "cf2a3f84cb26a12c",
|
|
"name": "HTTP / Post",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 450,
|
|
"y": 500,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "3072b7c1fc0fd171",
|
|
"type": "debug",
|
|
"z": "379c65a27117b46c",
|
|
"g": "8363d385051fc5c0",
|
|
"name": "debug 69",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1900,
|
|
"y": 1140,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "539d65720b0ff630",
|
|
"type": "change",
|
|
"z": "379c65a27117b46c",
|
|
"g": "8363d385051fc5c0",
|
|
"name": "",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "http",
|
|
"pt": "msg",
|
|
"to": "{}",
|
|
"tot": "jsonata"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "http.client",
|
|
"pt": "msg",
|
|
"to": "req.connection.remoteAddress",
|
|
"tot": "msg"
|
|
},
|
|
{
|
|
"t": "move",
|
|
"p": "payload",
|
|
"pt": "msg",
|
|
"to": "http.form",
|
|
"tot": "msg"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 1640,
|
|
"y": 1080,
|
|
"wires": [
|
|
[
|
|
"0eb8679ee25c4a34",
|
|
"3072b7c1fc0fd171"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "0eb8679ee25c4a34",
|
|
"type": "switch",
|
|
"z": "379c65a27117b46c",
|
|
"g": "8363d385051fc5c0",
|
|
"name": "Routing",
|
|
"property": " $split(req._parsedUrl.pathname, '/')[1]",
|
|
"propertyType": "jsonata",
|
|
"rules": [
|
|
{
|
|
"t": "eq",
|
|
"v": "passwordreset",
|
|
"vt": "str"
|
|
},
|
|
{
|
|
"t": "eq",
|
|
"v": "passwordquestions",
|
|
"vt": "str"
|
|
},
|
|
{
|
|
"t": "eq",
|
|
"v": "passwordchange",
|
|
"vt": "str"
|
|
},
|
|
{
|
|
"t": "eq",
|
|
"v": "updatedetails",
|
|
"vt": "str"
|
|
},
|
|
{
|
|
"t": "else"
|
|
}
|
|
],
|
|
"checkall": "false",
|
|
"repair": false,
|
|
"outputs": 5,
|
|
"x": 1900,
|
|
"y": 1100,
|
|
"wires": [
|
|
[
|
|
"b7fde07e47cc852e",
|
|
"2189bf4e56868e51"
|
|
],
|
|
[
|
|
"9c92aaf02fee52b5"
|
|
],
|
|
[
|
|
"64c99b312f9c601c"
|
|
],
|
|
[],
|
|
[]
|
|
]
|
|
},
|
|
{
|
|
"id": "b7fde07e47cc852e",
|
|
"type": "link out",
|
|
"z": "379c65a27117b46c",
|
|
"g": "8363d385051fc5c0",
|
|
"name": "Password Reset",
|
|
"mode": "link",
|
|
"links": [
|
|
"cdde8116fcac6e5d"
|
|
],
|
|
"x": 2100,
|
|
"y": 1060,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "9c92aaf02fee52b5",
|
|
"type": "link out",
|
|
"z": "379c65a27117b46c",
|
|
"g": "8363d385051fc5c0",
|
|
"name": "Password Reset Questions",
|
|
"mode": "link",
|
|
"links": [
|
|
"bb8102ee0c070ff2"
|
|
],
|
|
"x": 2140,
|
|
"y": 1100,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "7db929503cf13635",
|
|
"type": "link in",
|
|
"z": "379c65a27117b46c",
|
|
"g": "755ff25cc29a08a1",
|
|
"name": "HTTP: Response",
|
|
"links": [
|
|
"0c2e73371d4238a1",
|
|
"1d661b2385de4b4a",
|
|
"4ecc0631139b51e0",
|
|
"50339f503fd4878d",
|
|
"96836f5a4c7c756c",
|
|
"988765ea19236af0",
|
|
"b664f0b9e6c17ad6",
|
|
"bf098463143ac8ad",
|
|
"e5ae19af5f6d6561",
|
|
"f1dcd5b6e32fb905",
|
|
"4cdbeaa8f5f3ddb7",
|
|
"b54c063d6519c463",
|
|
"a6c8721721fc267e",
|
|
"960bf96fa54c65c0"
|
|
],
|
|
"x": 2600,
|
|
"y": 1160,
|
|
"wires": [
|
|
[
|
|
"3af3d2ae3286ffe0"
|
|
]
|
|
],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "e3043367c9a89a90",
|
|
"type": "http response",
|
|
"z": "379c65a27117b46c",
|
|
"g": "755ff25cc29a08a1",
|
|
"name": "HTTP Response",
|
|
"statusCode": "",
|
|
"headers": {},
|
|
"x": 2940,
|
|
"y": 1160,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "564400f9ec708521",
|
|
"type": "debug",
|
|
"z": "379c65a27117b46c",
|
|
"g": "755ff25cc29a08a1",
|
|
"name": "HTTP / Response",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 2930,
|
|
"y": 1120,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "9f59194fecc0976a",
|
|
"type": "switch",
|
|
"z": "379c65a27117b46c",
|
|
"g": "5706252b01492258",
|
|
"name": "File Name",
|
|
"property": "$split(req.url, '/', limit)[$count($split(req.url, '/', limit)) + 1]\t\t",
|
|
"propertyType": "jsonata",
|
|
"rules": [
|
|
{
|
|
"t": "eq",
|
|
"v": "style.css",
|
|
"vt": "str"
|
|
},
|
|
{
|
|
"t": "eq",
|
|
"v": "common.js",
|
|
"vt": "str"
|
|
},
|
|
{
|
|
"t": "eq",
|
|
"v": "jquery.min.js",
|
|
"vt": "str"
|
|
},
|
|
{
|
|
"t": "else"
|
|
}
|
|
],
|
|
"checkall": "false",
|
|
"repair": false,
|
|
"outputs": 4,
|
|
"x": 2650,
|
|
"y": 740,
|
|
"wires": [
|
|
[
|
|
"195e7631e8660db0"
|
|
],
|
|
[
|
|
"e01b059fbd4cb54f"
|
|
],
|
|
[
|
|
"f5365376f49c255d"
|
|
],
|
|
[
|
|
"dce9621aba915bd4"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "eaeb9e2bfbe1dc95",
|
|
"type": "link out",
|
|
"z": "379c65a27117b46c",
|
|
"g": "5706252b01492258",
|
|
"name": "style.css",
|
|
"mode": "link",
|
|
"links": [
|
|
"3502d9cf69680b66"
|
|
],
|
|
"x": 2960,
|
|
"y": 640,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "d81c931de5a63675",
|
|
"type": "link out",
|
|
"z": "379c65a27117b46c",
|
|
"g": "5706252b01492258",
|
|
"name": "HTTP/404",
|
|
"mode": "link",
|
|
"links": [
|
|
"4d40709eea926ab1"
|
|
],
|
|
"x": 2970,
|
|
"y": 900,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "15721605aaae8a86",
|
|
"type": "debug",
|
|
"z": "379c65a27117b46c",
|
|
"g": "5706252b01492258",
|
|
"name": "CSS File",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 2960,
|
|
"y": 600,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "28ac8fd21056642c",
|
|
"type": "debug",
|
|
"z": "379c65a27117b46c",
|
|
"g": "5706252b01492258",
|
|
"name": "HTTP / 404",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 2970,
|
|
"y": 940,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "12a331c2a036a776",
|
|
"type": "link out",
|
|
"z": "379c65a27117b46c",
|
|
"g": "ec8733df4e619869",
|
|
"name": "Fetch Files",
|
|
"mode": "link",
|
|
"links": [
|
|
"acd5690f3865f156"
|
|
],
|
|
"x": 2190,
|
|
"y": 860,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "acd5690f3865f156",
|
|
"type": "link in",
|
|
"z": "379c65a27117b46c",
|
|
"g": "5706252b01492258",
|
|
"name": "Fetch File",
|
|
"links": [
|
|
"12a331c2a036a776"
|
|
],
|
|
"x": 2460,
|
|
"y": 860,
|
|
"wires": [
|
|
[
|
|
"9f59194fecc0976a"
|
|
]
|
|
],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "e72f08d8fc433bea",
|
|
"type": "link out",
|
|
"z": "379c65a27117b46c",
|
|
"g": "5706252b01492258",
|
|
"name": "common.js",
|
|
"mode": "link",
|
|
"links": [
|
|
"2e8883be19eb130d"
|
|
],
|
|
"x": 2970,
|
|
"y": 740,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "1b1ca0bd7037ed0f",
|
|
"type": "debug",
|
|
"z": "379c65a27117b46c",
|
|
"g": "5706252b01492258",
|
|
"name": "JS File",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 2950,
|
|
"y": 700,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "515f363d4f52f625",
|
|
"type": "link out",
|
|
"z": "379c65a27117b46c",
|
|
"g": "ec8733df4e619869",
|
|
"name": "Home",
|
|
"mode": "link",
|
|
"links": [
|
|
"0172c4a240b566fd",
|
|
"d810b86dc7c722cd"
|
|
],
|
|
"x": 2210,
|
|
"y": 600,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "333303604fa4ca01",
|
|
"type": "link out",
|
|
"z": "379c65a27117b46c",
|
|
"g": "ec8733df4e619869",
|
|
"name": "Page: Change Password",
|
|
"mode": "link",
|
|
"links": [
|
|
"b5cedc58894f707e",
|
|
"2ccbf2d475489da8"
|
|
],
|
|
"x": 2150,
|
|
"y": 680,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "52395c2abfc3c4f5",
|
|
"type": "link out",
|
|
"z": "379c65a27117b46c",
|
|
"g": "ec8733df4e619869",
|
|
"name": "Page: Account Details",
|
|
"mode": "link",
|
|
"links": [
|
|
"e50f46892eabd2a5",
|
|
"a28d15c7a8dfdc85"
|
|
],
|
|
"x": 2160,
|
|
"y": 640,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "68f30ef53ebc2074",
|
|
"type": "link out",
|
|
"z": "379c65a27117b46c",
|
|
"g": "ec8733df4e619869",
|
|
"name": "Page: Logout",
|
|
"mode": "link",
|
|
"links": [
|
|
"fb5301abffede979"
|
|
],
|
|
"x": 2190,
|
|
"y": 800,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "2189bf4e56868e51",
|
|
"type": "debug",
|
|
"z": "379c65a27117b46c",
|
|
"g": "8363d385051fc5c0",
|
|
"name": "debug 95",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 2080,
|
|
"y": 1020,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "f2026962fb8dbb44",
|
|
"type": "debug",
|
|
"z": "379c65a27117b46c",
|
|
"g": "ec8733df4e619869",
|
|
"name": "debug 99",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 2180,
|
|
"y": 900,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "ce290d371c7687b0",
|
|
"type": "debug",
|
|
"z": "379c65a27117b46c",
|
|
"g": "ec8733df4e619869",
|
|
"name": "Not-Authorized",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1760,
|
|
"y": 780,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "c7ca92d48206b4b2",
|
|
"type": "inject",
|
|
"z": "379c65a27117b46c",
|
|
"g": "b994fe21efb223a9",
|
|
"name": "Auto Read Config",
|
|
"props": [
|
|
{
|
|
"p": "filename",
|
|
"v": "/usr/src/node-red/config.json",
|
|
"vt": "str"
|
|
}
|
|
],
|
|
"repeat": "300",
|
|
"crontab": "",
|
|
"once": true,
|
|
"onceDelay": "2",
|
|
"topic": "",
|
|
"x": 290,
|
|
"y": 100,
|
|
"wires": [
|
|
[
|
|
"2d4bed7c63632c6c"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "de01a4559aecf1c4",
|
|
"type": "debug",
|
|
"z": "379c65a27117b46c",
|
|
"g": "b994fe21efb223a9",
|
|
"name": "Config read",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1070,
|
|
"y": 200,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "842ade29052f7e66",
|
|
"type": "change",
|
|
"z": "379c65a27117b46c",
|
|
"g": "b994fe21efb223a9",
|
|
"name": "global.config.glpi",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "CurrentGlobalConfig",
|
|
"pt": "msg",
|
|
"to": "config",
|
|
"tot": "global"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 850,
|
|
"y": 200,
|
|
"wires": [
|
|
[
|
|
"de01a4559aecf1c4"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "64c99b312f9c601c",
|
|
"type": "link out",
|
|
"z": "379c65a27117b46c",
|
|
"g": "8363d385051fc5c0",
|
|
"name": "Password: Change",
|
|
"mode": "link",
|
|
"links": [
|
|
"1df8ab6bb55ff621",
|
|
"a36e4f9e4921b12a"
|
|
],
|
|
"x": 2110,
|
|
"y": 1140,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "3ada862ebc07a99d",
|
|
"type": "function",
|
|
"z": "379c65a27117b46c",
|
|
"g": "ec8733df4e619869",
|
|
"name": "Valid Path?",
|
|
"func": "var validPath = null;\nvar http_404 = null;\n\nif ( String(msg.req.originalUrl).indexOf('?') > 0 ) {\n\n msg.http.path = String(msg.req.originalUrl).split('?')[0].split('/');\n\n}else{\n msg.http.path = String(msg.req.originalUrl).split('/');\n\n}\n\nif (\n msg.http.path[0] == global.get('config.http_path') ||\n msg.http.path[0] + '/' == global.get('config.http_path')\n) {\n\n validPath = msg;\n\n\n} else if (String(msg.req.originalUrl).indexOf('.') > 0 ) {\n\n validPath = msg;\n \n} else {\n\n http_404 = msg;\n\n}\n\nnode.send([validPath, http_404])\n",
|
|
"outputs": 2,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 1270,
|
|
"y": 720,
|
|
"wires": [
|
|
[
|
|
"eae031f35d9a1e9e"
|
|
],
|
|
[
|
|
"4716d2916d6de31e",
|
|
"6e74b4a9a6b2dac8"
|
|
]
|
|
],
|
|
"outputLabels": [
|
|
"SelfService",
|
|
"HTTP/404"
|
|
]
|
|
},
|
|
{
|
|
"id": "4716d2916d6de31e",
|
|
"type": "link out",
|
|
"z": "379c65a27117b46c",
|
|
"g": "ec8733df4e619869",
|
|
"name": "HTTP/404",
|
|
"mode": "link",
|
|
"links": [
|
|
"4d40709eea926ab1"
|
|
],
|
|
"x": 1470,
|
|
"y": 740,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "6e74b4a9a6b2dac8",
|
|
"type": "debug",
|
|
"z": "379c65a27117b46c",
|
|
"g": "ec8733df4e619869",
|
|
"name": "HTTP / 404",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1470,
|
|
"y": 780,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "c80657a01a03012d",
|
|
"type": "debug",
|
|
"z": "379c65a27117b46c",
|
|
"g": "cf2a3f84cb26a12c",
|
|
"name": "HTTP / Get",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 450,
|
|
"y": 380,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "7c38c172df490c56",
|
|
"type": "function",
|
|
"z": "379c65a27117b46c",
|
|
"g": "8363d385051fc5c0",
|
|
"name": "Valid Path?",
|
|
"func": "var validPath = null;\nvar http_404 = null;\n\nif (String(msg.req.originalUrl).indexOf('?') > 0) {\n\n msg.http.path = String(msg.req.originalUrl).split('?')[0].split('/');\n\n} else {\n msg.http.path = String(msg.req.originalUrl).split('/');\n\n}\n\nif (\n msg.http.path[0] == global.get('config.http_path') ||\n msg.http.path[0] + '/' == global.get('config.http_path')\n) {\n\n validPath = msg;\n\n\n} else if (String(msg.req.originalUrl).indexOf('.') > 0) {\n\n validPath = msg;\n\n} else {\n\n http_404 = msg;\n\n}\n\nnode.send([validPath, http_404])\n",
|
|
"outputs": 2,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 1310,
|
|
"y": 1100,
|
|
"wires": [
|
|
[
|
|
"75913f37.78e6e"
|
|
],
|
|
[
|
|
"c0e5efefb8395690",
|
|
"7b62ec12651e478a"
|
|
]
|
|
],
|
|
"outputLabels": [
|
|
"SelfService",
|
|
"HTTP/404"
|
|
]
|
|
},
|
|
{
|
|
"id": "c0e5efefb8395690",
|
|
"type": "link out",
|
|
"z": "379c65a27117b46c",
|
|
"g": "8363d385051fc5c0",
|
|
"name": "HTTP/404",
|
|
"mode": "link",
|
|
"links": [
|
|
"4d40709eea926ab1"
|
|
],
|
|
"x": 1510,
|
|
"y": 1120,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "7b62ec12651e478a",
|
|
"type": "debug",
|
|
"z": "379c65a27117b46c",
|
|
"g": "8363d385051fc5c0",
|
|
"name": "HTTP / 404",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1510,
|
|
"y": 1160,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "1c16492a7fe8e77b",
|
|
"type": "link out",
|
|
"z": "379c65a27117b46c",
|
|
"g": "923268ee62c6a7db",
|
|
"name": "HTTP/GET",
|
|
"mode": "link",
|
|
"links": [
|
|
"5c05dcd676fcb02a"
|
|
],
|
|
"x": 1810,
|
|
"y": 380,
|
|
"wires": [],
|
|
"icon": "font-awesome/fa-unlock",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "5c05dcd676fcb02a",
|
|
"type": "link in",
|
|
"z": "379c65a27117b46c",
|
|
"g": "ec8733df4e619869",
|
|
"name": "Process: HTTP/GET",
|
|
"links": [
|
|
"1c16492a7fe8e77b"
|
|
],
|
|
"x": 1110,
|
|
"y": 720,
|
|
"wires": [
|
|
[
|
|
"3ada862ebc07a99d"
|
|
]
|
|
],
|
|
"icon": "font-awesome/fa-unlock",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "e282aea37a90acdc",
|
|
"type": "link out",
|
|
"z": "379c65a27117b46c",
|
|
"g": "923268ee62c6a7db",
|
|
"name": "HTTP/POST",
|
|
"mode": "link",
|
|
"links": [
|
|
"9cbf4027b4ab1c04"
|
|
],
|
|
"x": 1810,
|
|
"y": 420,
|
|
"wires": [],
|
|
"icon": "font-awesome/fa-unlock",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "9cbf4027b4ab1c04",
|
|
"type": "link in",
|
|
"z": "379c65a27117b46c",
|
|
"g": "8363d385051fc5c0",
|
|
"name": "Process: HTTP/POST",
|
|
"links": [
|
|
"e282aea37a90acdc"
|
|
],
|
|
"x": 1120,
|
|
"y": 1100,
|
|
"wires": [
|
|
[
|
|
"7c38c172df490c56"
|
|
]
|
|
],
|
|
"icon": "font-awesome/fa-unlock",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "d17512b4de05ede1",
|
|
"type": "link out",
|
|
"z": "379c65a27117b46c",
|
|
"g": "f3aa07300888f0a4",
|
|
"name": "HTTP/401",
|
|
"mode": "link",
|
|
"links": [
|
|
"fd80fd11fc971e2c"
|
|
],
|
|
"x": 770,
|
|
"y": 740,
|
|
"wires": [],
|
|
"icon": "font-awesome/fa-lock",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "434d74f494db7cfc",
|
|
"type": "link out",
|
|
"z": "379c65a27117b46c",
|
|
"g": "f3aa07300888f0a4",
|
|
"name": "HTTP/404",
|
|
"mode": "link",
|
|
"links": [
|
|
"fd80fd11fc971e2c"
|
|
],
|
|
"x": 770,
|
|
"y": 780,
|
|
"wires": [],
|
|
"icon": "font-awesome/fa-question",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "6728a85f5b044738",
|
|
"type": "link call",
|
|
"z": "379c65a27117b46c",
|
|
"g": "923268ee62c6a7db",
|
|
"name": "Authentication",
|
|
"links": [
|
|
"f17afdbfc8c07889"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 1310,
|
|
"y": 420,
|
|
"wires": [
|
|
[
|
|
"46d8b11bdef459aa"
|
|
]
|
|
],
|
|
"icon": "font-awesome/fa-lock"
|
|
},
|
|
{
|
|
"id": "46d8b11bdef459aa",
|
|
"type": "function",
|
|
"z": "379c65a27117b46c",
|
|
"g": "923268ee62c6a7db",
|
|
"name": "HTTP Method Routing",
|
|
"func": "var http_get = null;\nvar http_post = null;\nvar statuscode = null;\n\nvar status = { fill: \"red\", shape: \"ring\", text: \"Incomplete\" };\n\nif (msg.hasOwnProperty('statusCode') ) {\n\n status.fill = \"yellow\";\n status.text = \"HTTP/\"+ msg.statusCode;\n\n statuscode = msg;\n\n \n} else {\n\n if (msg.hasOwnProperty('session')) {\n\n switch (String(msg.req.method).toLocaleLowerCase()) {\n\n case 'get':\n status.fill = \"green\";\n status.text = \"GET\";\n\n http_get = msg;\n break;\n\n case 'post':\n status.fill = \"green\";\n status.text = \"POST\";\n\n http_post = msg;\n break;\n\n default:\n status.fill = \"yellow\";\n status.text = \"unsupported\";\n\n msg.statusCode = 400;\n statuscode = msg;\n break;\n\n };\n\n } else { // no msg.session, force logon\n status.fill = \"yellow\";\n status.text = \"Not Authorized\";\n\n\n if (!msg.hasOwnProperty('statusCode')) {\n msg.statusCode = 401;\n // ToDo: add location header to auth method\n }\n\n statuscode = msg;\n\n }\n}\n\nnode.status(status);\n\nnode.send([\n http_get,\n http_post,\n statuscode\n]);\n",
|
|
"outputs": 3,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 1540,
|
|
"y": 420,
|
|
"wires": [
|
|
[
|
|
"1c16492a7fe8e77b"
|
|
],
|
|
[
|
|
"e282aea37a90acdc"
|
|
],
|
|
[
|
|
"5f2f87eeebd5bf6e"
|
|
]
|
|
],
|
|
"outputLabels": [
|
|
"Get",
|
|
"Post",
|
|
"Non HTTP/20x"
|
|
],
|
|
"icon": "node-red/arrow-in.svg"
|
|
},
|
|
{
|
|
"id": "2f1060b185e19215",
|
|
"type": "link in",
|
|
"z": "379c65a27117b46c",
|
|
"g": "923268ee62c6a7db",
|
|
"name": "Process: Authorized",
|
|
"links": [
|
|
"28713941e03e2bf5",
|
|
"2ed31116a1e83c99"
|
|
],
|
|
"x": 1110,
|
|
"y": 420,
|
|
"wires": [
|
|
[
|
|
"6728a85f5b044738"
|
|
]
|
|
],
|
|
"icon": "font-awesome/fa-lock",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "0ec392291c3fda2f",
|
|
"type": "link out",
|
|
"z": "379c65a27117b46c",
|
|
"g": "f3aa07300888f0a4",
|
|
"name": "HTTP/400",
|
|
"mode": "link",
|
|
"links": [
|
|
"fd80fd11fc971e2c"
|
|
],
|
|
"x": 770,
|
|
"y": 700,
|
|
"wires": [],
|
|
"icon": "font-awesome/fa-exclamation-triangle",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "5f2f87eeebd5bf6e",
|
|
"type": "link out",
|
|
"z": "379c65a27117b46c",
|
|
"g": "923268ee62c6a7db",
|
|
"name": "Non HTTP/20x",
|
|
"mode": "link",
|
|
"links": [
|
|
"5ad10ea406e2d3a7"
|
|
],
|
|
"x": 1820,
|
|
"y": 460,
|
|
"wires": [],
|
|
"icon": "font-awesome/fa-warning",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "28713941e03e2bf5",
|
|
"type": "link out",
|
|
"z": "379c65a27117b46c",
|
|
"g": "cf2a3f84cb26a12c",
|
|
"name": "Authorized?",
|
|
"mode": "link",
|
|
"links": [
|
|
"2f1060b185e19215"
|
|
],
|
|
"x": 650,
|
|
"y": 380,
|
|
"wires": [],
|
|
"icon": "font-awesome/fa-lock",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "3af3d2ae3286ffe0",
|
|
"type": "change",
|
|
"z": "379c65a27117b46c",
|
|
"g": "755ff25cc29a08a1",
|
|
"name": "",
|
|
"rules": [
|
|
{
|
|
"t": "delete",
|
|
"p": "_event",
|
|
"pt": "msg"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "http.response_size",
|
|
"pt": "msg",
|
|
"to": "$length(msg.payload)\t",
|
|
"tot": "jsonata"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 2760,
|
|
"y": 1160,
|
|
"wires": [
|
|
[
|
|
"e3043367c9a89a90",
|
|
"564400f9ec708521"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "c6360f6028e1512c",
|
|
"type": "function",
|
|
"z": "379c65a27117b46c",
|
|
"g": "cf2a3f84cb26a12c",
|
|
"name": "Details",
|
|
"func": "var cont = null;\nvar callback = null;\nvar not_configured = null;\nvar http_404 = null\nvar status = {fill:\"red\",shape:\"ring\",text:\"Err: Incomplete\"};\n\nif( msg.req._parsedUrl.path == '/favicon.ico' ) {\n \n status.text = 'HTTP/404';\n status.fill = 'grey';\n\n msg.statusCode = 404;\n msg.payload = {};\n\n http_404 = msg;\n\n} else if (\n global.get(\"config\") == undefined ||\n (\n global.get(\"config\") != undefined &&\n global.get(\"config.auth_method\") == undefined\n )\n) {\n\n status.text = 'No Config';\n\n msg.statusCode = 400;\n\n not_configured = msg;\n\n} else {\n\n if ( \n Array(global.get(\"config.auth_method\")).includes('oauth2') &&\n global.get(\"config.oauth2\") == undefined\n ) {\n\n status.text = 'No OAuth2 Config';\n\n msg.statusCode = 400;\n\n not_configured = msg;\n\n }else{\n\n msg.http = {\n \"client\": msg.req.connection.remoteAddress,\n \"headers\": msg.req.headers,\n \"timestamp\": Date.now()\n }\n\n if (msg.req.params[\"0\"] == 'callback' ){\n\n status.fill = 'blue';\n status.text = 'Oauth2 Callback';\n\n callback = msg;\n\n }else{\n\n status.fill = 'green';\n status.text = 'Continue';\n\n cont = msg;\n\n }\n }\n}\nnode.status( status );\n\nnode.send([\n cont,\n callback,\n not_configured,\n http_404\n]);\n",
|
|
"outputs": 4,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 470,
|
|
"y": 440,
|
|
"wires": [
|
|
[
|
|
"28713941e03e2bf5"
|
|
],
|
|
[
|
|
"b174f7bc1d398a56"
|
|
],
|
|
[
|
|
"3dc07bb0a7d4f647"
|
|
],
|
|
[
|
|
"c58cfa3fc57972d1"
|
|
]
|
|
],
|
|
"outputLabels": [
|
|
"Continue",
|
|
"Oauth2 Callback",
|
|
"Server Not Configured",
|
|
"HTTP/404"
|
|
],
|
|
"icon": "font-awesome/fa-info-circle",
|
|
"info": "# Details\n\nAdds the HTTP request details to object `msg.http`. Also checks for favicon.ico and returns HTTP/404."
|
|
},
|
|
{
|
|
"id": "c43678f82d52004f",
|
|
"type": "link out",
|
|
"z": "379c65a27117b46c",
|
|
"g": "f3aa07300888f0a4",
|
|
"name": "HTTP/302",
|
|
"mode": "link",
|
|
"links": [
|
|
"fd80fd11fc971e2c"
|
|
],
|
|
"x": 770,
|
|
"y": 620,
|
|
"wires": [],
|
|
"icon": "font-awesome/fa-refresh",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "43603c3760e7ae56",
|
|
"type": "link out",
|
|
"z": "379c65a27117b46c",
|
|
"g": "f3aa07300888f0a4",
|
|
"name": "HTTP/303",
|
|
"mode": "link",
|
|
"links": [
|
|
"fd80fd11fc971e2c"
|
|
],
|
|
"x": 770,
|
|
"y": 660,
|
|
"wires": [],
|
|
"icon": "font-awesome/fa-refresh",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "5ad10ea406e2d3a7",
|
|
"type": "link in",
|
|
"z": "379c65a27117b46c",
|
|
"g": "f3aa07300888f0a4",
|
|
"name": "HTTP/StatusCode",
|
|
"links": [
|
|
"5f2f87eeebd5bf6e",
|
|
"5b97592fe62125c7",
|
|
"3dc07bb0a7d4f647",
|
|
"c58cfa3fc57972d1"
|
|
],
|
|
"x": 290,
|
|
"y": 640,
|
|
"wires": [
|
|
[
|
|
"c058f11dfd8d01b2"
|
|
]
|
|
],
|
|
"icon": "node-red/arrow-in.svg",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "c058f11dfd8d01b2",
|
|
"type": "switch",
|
|
"z": "379c65a27117b46c",
|
|
"g": "f3aa07300888f0a4",
|
|
"name": "Route",
|
|
"property": "statusCode",
|
|
"propertyType": "msg",
|
|
"rules": [
|
|
{
|
|
"t": "eq",
|
|
"v": "302",
|
|
"vt": "num"
|
|
},
|
|
{
|
|
"t": "eq",
|
|
"v": "303",
|
|
"vt": "num"
|
|
},
|
|
{
|
|
"t": "eq",
|
|
"v": "400",
|
|
"vt": "num"
|
|
},
|
|
{
|
|
"t": "eq",
|
|
"v": "401",
|
|
"vt": "num"
|
|
},
|
|
{
|
|
"t": "eq",
|
|
"v": "404",
|
|
"vt": "num"
|
|
}
|
|
],
|
|
"checkall": "true",
|
|
"repair": false,
|
|
"outputs": 5,
|
|
"x": 490,
|
|
"y": 640,
|
|
"wires": [
|
|
[
|
|
"c43678f82d52004f"
|
|
],
|
|
[
|
|
"43603c3760e7ae56"
|
|
],
|
|
[
|
|
"0ec392291c3fda2f"
|
|
],
|
|
[
|
|
"d17512b4de05ede1"
|
|
],
|
|
[
|
|
"434d74f494db7cfc"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "b174f7bc1d398a56",
|
|
"type": "link out",
|
|
"z": "379c65a27117b46c",
|
|
"g": "cf2a3f84cb26a12c",
|
|
"name": "Oauth2 call",
|
|
"mode": "link",
|
|
"links": [
|
|
"9f416bc258c1a60c"
|
|
],
|
|
"x": 650,
|
|
"y": 420,
|
|
"wires": [],
|
|
"icon": "font-awesome/fa-lock",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "f57a5bd56ce68760",
|
|
"type": "inject",
|
|
"z": "379c65a27117b46c",
|
|
"name": "Trigger: Oauth2 Config",
|
|
"props": [
|
|
{
|
|
"p": "payload"
|
|
}
|
|
],
|
|
"repeat": "300",
|
|
"crontab": "",
|
|
"once": true,
|
|
"onceDelay": 0.1,
|
|
"topic": "",
|
|
"payload": "",
|
|
"payloadType": "date",
|
|
"x": 3630,
|
|
"y": 140,
|
|
"wires": [
|
|
[]
|
|
]
|
|
},
|
|
{
|
|
"id": "957b63c9fc58a139",
|
|
"type": "credentials",
|
|
"z": "379c65a27117b46c",
|
|
"g": "b994fe21efb223a9",
|
|
"name": "Oauth2",
|
|
"props": [
|
|
{
|
|
"value": "config.oauth.client_secret",
|
|
"type": "global"
|
|
},
|
|
{
|
|
"value": "config.oauth.client_id",
|
|
"type": "global"
|
|
},
|
|
{
|
|
"value": "config.oauth.url.token",
|
|
"type": "global"
|
|
},
|
|
{
|
|
"value": "config.oauth.url.auth",
|
|
"type": "global"
|
|
},
|
|
{
|
|
"value": "config.oauth.url.callback",
|
|
"type": "global"
|
|
}
|
|
],
|
|
"x": 700,
|
|
"y": 140,
|
|
"wires": [
|
|
[
|
|
"02812e8708980b09"
|
|
]
|
|
],
|
|
"info": "# Oauth2 Configuration\n\nThis node stores it's values within `flows_cred.json` and therefor takes advantage of encrypting the values.\n\n## Structure\n\n``` json\n\n{\n \"client_secret\": \"\",\n \"client_id\": \"\",\n \"url\": {\n \"token\": \"\",\n \"auth\": \"\",\n \"callback\": \"http://127.0.0.1:1881/callback\"\n }\n}\n\n```\n\n| item | type | description |\n|:---:|:---:|:---|\n| client_secret | `string` | client secret |\n| client_id | `string` | client id |\n| url.token | `string` | Token URL |\n| url.auth | `string` | Auth URL |\n| url.callback | `string` | Authentication Callback URL, this value must always be `{protocol}://{domain}/callback`. i.e. `http://127.0.0.1:1881/callback` |\n "
|
|
},
|
|
{
|
|
"id": "02812e8708980b09",
|
|
"type": "change",
|
|
"z": "379c65a27117b46c",
|
|
"g": "b994fe21efb223a9",
|
|
"name": "global.config",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "CurrentGlobalConfig",
|
|
"pt": "msg",
|
|
"to": "config",
|
|
"tot": "global"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 830,
|
|
"y": 140,
|
|
"wires": [
|
|
[
|
|
"e83ed4274d3959f3"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "3dc07bb0a7d4f647",
|
|
"type": "link out",
|
|
"z": "379c65a27117b46c",
|
|
"g": "cf2a3f84cb26a12c",
|
|
"name": "No Config",
|
|
"mode": "link",
|
|
"links": [
|
|
"5ad10ea406e2d3a7"
|
|
],
|
|
"x": 640,
|
|
"y": 460,
|
|
"wires": [],
|
|
"icon": "font-awesome/fa-hand-stop-o",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "fb7fea44905cf7a4",
|
|
"type": "credentials",
|
|
"z": "379c65a27117b46c",
|
|
"g": "b994fe21efb223a9",
|
|
"name": "GLPI",
|
|
"props": [
|
|
{
|
|
"value": "config.glpi.api_url",
|
|
"type": "global"
|
|
},
|
|
{
|
|
"value": "config.glpi.authorization",
|
|
"type": "global"
|
|
},
|
|
{
|
|
"value": "config.glpi.app_token",
|
|
"type": "global"
|
|
},
|
|
{
|
|
"value": "config.glpi.category_id_automation_task",
|
|
"type": "global"
|
|
},
|
|
{
|
|
"value": "config.glpi.debug_on",
|
|
"type": "global"
|
|
}
|
|
],
|
|
"x": 710,
|
|
"y": 200,
|
|
"wires": [
|
|
[
|
|
"842ade29052f7e66"
|
|
]
|
|
],
|
|
"info": "# GLPI Configuration\n\nThis node stores it's values within `flows_cred.json` and therefor takes advantage of encrypting the values.\n\n## Structure\n\n``` json\n\n{\n \"api_url\": \"http://glpi/apirest.php/\",\n \"authorization\": \"user_token ***\",\n \"app_token\": \"\",\n \"category_id_automation_task\": 0,\n \"debug_on\": false\n}\n\n```\n\n| item | type | description |\n|:---:|:---:|:---|\n| api_url | `string` | URL for the API `{protocol}://{domain}/apirest.php/` |\n| authorization | `string` | Auth token suffixed with `user_token` |\n| app_token | `string` | Application token |\n| category_id_automation_task | `int` | the category for this automation task to be applied to the ticket task |\n| debug_on | `bool` | Authentication Callback URL, this value must always be `{protocol}://{domain}/callback`. i.e. `http://127.0.0.1:1881/callback` |\n "
|
|
},
|
|
{
|
|
"id": "c58cfa3fc57972d1",
|
|
"type": "link out",
|
|
"z": "379c65a27117b46c",
|
|
"g": "cf2a3f84cb26a12c",
|
|
"name": "HTTP/404",
|
|
"mode": "link",
|
|
"links": [
|
|
"5ad10ea406e2d3a7"
|
|
],
|
|
"x": 650,
|
|
"y": 500,
|
|
"wires": [],
|
|
"icon": "font-awesome/fa-hand-stop-o",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "2d4bed7c63632c6c",
|
|
"type": "template",
|
|
"z": "379c65a27117b46c",
|
|
"g": "b994fe21efb223a9",
|
|
"name": "General Config",
|
|
"field": "config",
|
|
"fieldType": "global",
|
|
"format": "json",
|
|
"syntax": "mustache",
|
|
"template": "{\n \"auth_method\": [ \"oauth\", \"token\" ],\n \"developer_mode\": false,\n \"html\": {\n \"logo\": \"http://nofusscomputing.com/assets/nfc_revamp_dark.png\",\n \"logo_width\": 282,\n \"logo_height\": 90\n },\n \"http_path\": \"/\",\n \"itsm\": {\n \"api_url\": \"http://glpi/apirest.php/\",\n \"create_ticket\": true,\n \"create_ticket_task\": true,\n \"platform\": \"glpi\",\n \"search\": true,\n \"human_task_duration_time\": 300,\n \"ticket\": {\n \"approval_required\": 0,\n \"category_id\": 6,\n \"entity_id\": 1,\n \"requesttype_id\": 6,\n \"task_category_id\": 2\n }\n },\n \"paths\": {\n \"user_data\": \"data/users/\",\n \"token_sessions\": \"data/sessions/\"\n }\n}\n",
|
|
"output": "json",
|
|
"x": 480,
|
|
"y": 100,
|
|
"wires": [
|
|
[
|
|
"06b5d27bbf1e5b16"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "31b86caaa955a0ee",
|
|
"type": "debug",
|
|
"z": "379c65a27117b46c",
|
|
"g": "5706252b01492258",
|
|
"name": "JS File",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 2950,
|
|
"y": 780,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "dc075811536fafda",
|
|
"type": "link out",
|
|
"z": "379c65a27117b46c",
|
|
"g": "5706252b01492258",
|
|
"name": "jquery.min.js",
|
|
"mode": "link",
|
|
"links": [
|
|
"602e7197835bba91"
|
|
],
|
|
"x": 2970,
|
|
"y": 820,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "02c4b9524d361ade",
|
|
"type": "link in",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "8ad5fe68ad170e2d",
|
|
"name": "HTML: Password Reset Questions",
|
|
"links": [
|
|
"e2876b413d95adf9",
|
|
"28c74c7b39a06100"
|
|
],
|
|
"x": 320,
|
|
"y": 980,
|
|
"wires": [
|
|
[
|
|
"7e95892f2f3454b7"
|
|
]
|
|
],
|
|
"icon": "node-red/file.svg",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "365ba07c1f4721ec",
|
|
"type": "template",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "8ad5fe68ad170e2d",
|
|
"name": "HTML",
|
|
"field": "html.body",
|
|
"fieldType": "msg",
|
|
"format": "html",
|
|
"syntax": "mustache",
|
|
"template": " <fieldset id=\"form\" style=\"width: 800px;\">\n <legend style=\"text-align: left;\"><h2>Password reset Questions</h2></legend>\n\n <form method=\"post\" action=\"{{{ global.config.http_path }}}passwordquestions\" ajax=\"true\">\n <p>For ensuring that only you can reset your password, you are required to provide three questions and answers. These questions will then as part of the self-service password reset process to confirm that it's you who is requesting the password reset.</p>\n <p>When choosing your questions, it's important to ensure that the questions that you use, only you would know the answers. This is to ensure that no one could guess the answers as only you would know the answers.</p>\n <p>In the fields below type out your question and answer, don't include punctuation or the use of any special characters. Valid characters are A-Z, a-z and 0-9. Any character entered into the form that are not part of this list will be removed.</p>\n <div id=\"question_multicolumn\">\n <label for=\"q1\">Question One</label>\n <label for=\"a1\">Answer One</label>\n <input type=\"text\" id=\"q1\" name=\"q1\" value=\"{{{ payload.0.question }}}\" placeholder=\"Type Question one here\">\n <input type=\"text\" id=\"a1\" name=\"a1\">\n </div>\n\n <div id=\"question_multicolumn\">\n <label for=\"q2\">Question Two</label>\n <label for=\"a2\">Answer Two</label>\n <input type=\"text\" id=\"q2\" name=\"q2\" value=\"{{{ payload.1.question }}}\">\n <input type=\"text\" id=\"a2\" name=\"a2\">\n </div>\n\n <div id=\"question_multicolumn\">\n <label for=\"q3\">Question Three</label>\n <label for=\"a3\">Answer One</label>\n <input type=\"text\" id=\"q3\" name=\"q3\" value=\"{{{ payload.2.question }}}\">\n <input type=\"text\" id=\"a3\" name=\"a3\">\n </div>\n\n <p>On Form submission, your answers will be hashed before storage. As such, no one will be able to view the answers, this includes you. This method however, still enables us to confirm an answer to a question as would occur during the password reset process.</p>\n\n <input type=\"submit\" value=\"Submit\">\n </form>\n <button id=\"navigation\" onclick=\"window.location.href='/{{{ global.config.http_path }}}';\">Home</button>\n </fieldset>\n\n <fieldset id=\"response\">\n <legend style=\"text-align: left;\">Results</legend>\n <span id=\"result\"></span>\n </fieldset>\n <div >\n <span id=\"result\"></span>\n </div>\n",
|
|
"output": "str",
|
|
"x": 1670,
|
|
"y": 960,
|
|
"wires": [
|
|
[
|
|
"591e68e90f876dd1"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "50339f503fd4878d",
|
|
"type": "link out",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "8ad5fe68ad170e2d",
|
|
"name": "HTML Response",
|
|
"mode": "link",
|
|
"links": [
|
|
"7db929503cf13635"
|
|
],
|
|
"x": 1950,
|
|
"y": 960,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "2dc375bf57ad8daa",
|
|
"type": "link in",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "ad0235dd3aa9eb7d",
|
|
"name": "HTML: Password Reset",
|
|
"links": [
|
|
"cad86e4a717ecb58"
|
|
],
|
|
"x": 280,
|
|
"y": 820,
|
|
"wires": [
|
|
[
|
|
"317930c679e833d1"
|
|
]
|
|
],
|
|
"icon": "node-red/file.svg",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "1ce803b83ecf1593",
|
|
"type": "change",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "ad0235dd3aa9eb7d",
|
|
"name": "",
|
|
"rules": [
|
|
{
|
|
"t": "move",
|
|
"p": "payload",
|
|
"pt": "msg",
|
|
"to": "random",
|
|
"tot": "msg"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "client",
|
|
"pt": "msg",
|
|
"to": "req.connection.remoteAddress",
|
|
"tot": "msg"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 720,
|
|
"y": 820,
|
|
"wires": [
|
|
[
|
|
"f3b55ea2.f4d51"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "f3b55ea2.f4d51",
|
|
"type": "template",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "ad0235dd3aa9eb7d",
|
|
"name": "HTML",
|
|
"field": "html.body",
|
|
"fieldType": "msg",
|
|
"format": "handlebars",
|
|
"syntax": "mustache",
|
|
"template": "<fieldset id=\"form\" style=\"width: 400px;\">\n <legend style=\"text-align: left;\"><h2>Self-Service Password Reset</h2></legend>\n\n <form method=\"post\" action=\"{{{ global.config.http_path }}}passwordreset\" ajax=\"true\">\n <p style=\"padding: 15px;\">To reset your password, ALL fields are Mandatory. On completing this form click 'submit' below. Results will be posted in the results window underneath the submit button.</p>\n <label for=\"fname\">First Name</label>\n <input type=\"text\" id=\"givenName\" name=\"givenName\"{{#session.user}} value=\"{{session.user.fname}}\" readonly{{/session.user}}>\n\n <label for=\"lname\">Last Name</label>\n <input type=\"text\" id=\"sn\" name=\"sn\"{{#session.user}} value=\"{{session.user.lname}}\" readonly{{/session.user}}>\n\n <label for=\"lname\">E-Mail Address</label>\n <input type=\"text\" id=\"mail\" name=\"mail\"{{#session.user}} value=\"{{session.user.mail}}\" readonly{{/session.user}}>\n\n <label for=\"lname\">User Name</label>\n <input type=\"text\" id=\"uid\" name=\"uid\"{{#session.user}} value=\"{{session.user.username}}\" readonly{{/session.user}}>\n\n <label for=\"random\">First half</label><p id=\"labelDescription\">This is the first half of your password</p>\n <input style=\"font-size: 14pt\" type=\"text\" id=\"random\" name=\"random\" value=\"{{{random}}}\" readonly>\n\n <input type=\"submit\" value=\"Submit\">\n </form>\n <button id=\"navigation\" onclick=\"window.location.href='{{{ global.config.http_path }}}';\">Home</button>\n </fieldset>\n\n<fieldset id=\"response\">\n <legend style=\"text-align: left;\">Results</legend>\n <span id=\"result\"></span>\n</fieldset>\n<div >\n <span id=\"result\"></span>\n</div>\n",
|
|
"x": 850,
|
|
"y": 820,
|
|
"wires": [
|
|
[
|
|
"457583335831f826"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "bf098463143ac8ad",
|
|
"type": "link out",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "ad0235dd3aa9eb7d",
|
|
"name": "HTML Response",
|
|
"mode": "link",
|
|
"links": [
|
|
"7db929503cf13635"
|
|
],
|
|
"x": 1130,
|
|
"y": 820,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "a702d39f0f3180de",
|
|
"type": "template",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "d3393ec35cb20a93",
|
|
"name": "CSS",
|
|
"field": "payload",
|
|
"fieldType": "msg",
|
|
"format": "css",
|
|
"syntax": "mustache",
|
|
"template": "body {\n text-align: center;\n}\n\nfieldset {\n border-radius: 5px;\n /* background-color: #f2f2f2; */\n border-color: #ffffff;\n border-style: groove;\n /* padding: 20px; */\n}\n\nbody fieldset[id=form] {\n margin: 0 auto;\n background-color: #f2f2f2;\n}\n\nform {\n text-align: left;\n padding: 0px;\n}\n\nh2 {\n font-size: 20px;\n text-align: center;\n margin: 0;\n padding: 0;\n}\n\nform p {\n text-align: justify;\n margin: 0;\n padding: 10px;\n}\n\ninput[type=text], input[type=password], select {\n width: 100%;\n padding: 12px 20px;\n margin: 8px 0 20px 0;\n display: inline-block;\n border: 1px solid #ccc;\n border-radius: 4px;\n box-sizing: border-box;\n}\n\ninput[type=submit], button[id=navigation] {\n width: 100%;\n background-color: #4CAF50;\n color: white;\n padding: 14px 20px;\n margin: 8px 0;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n}\n\ninput[type=submit]:hover, button[id=navigation]:hover {\n background-color: #45a049;\n}\n\ninput[type=submit]:disabled {\n background-color: #455da0;\n pointer-events: none;\n}\n\nbody fieldset[id=response] {\n height: auto;\n min-height: 25px;\n width: 400px;\n margin: 0 auto;\n background-color: rgb(247, 240, 228);\n \n}\n\nlabel {\n font-size: 12pt;\n font-style: normal;\n font-weight: bold;\n color: #000000;\n text-align: left;\n}\n\n\n#labelDescription {\n color: #414141;\n\n}\n\ndiv[id=question_multicolumn] {\n margin: 0;\n padding: 0px;\n display: grid;\n grid-template-columns: 600px 200px;\n grid-template-rows: 25px;\n}",
|
|
"x": 410,
|
|
"y": 180,
|
|
"wires": [
|
|
[
|
|
"f1dcd5b6e32fb905"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "3502d9cf69680b66",
|
|
"type": "link in",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "d3393ec35cb20a93",
|
|
"name": "style.css",
|
|
"links": [
|
|
"eaeb9e2bfbe1dc95"
|
|
],
|
|
"x": 250,
|
|
"y": 180,
|
|
"wires": [
|
|
[
|
|
"a702d39f0f3180de"
|
|
]
|
|
],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "f1dcd5b6e32fb905",
|
|
"type": "link out",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "d3393ec35cb20a93",
|
|
"name": "Return",
|
|
"mode": "link",
|
|
"links": [
|
|
"7db929503cf13635"
|
|
],
|
|
"x": 550,
|
|
"y": 180,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "c8c3f9c8f2ee35ee",
|
|
"type": "template",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "3e330505ea1e9cba",
|
|
"name": "JavaScript",
|
|
"field": "payload",
|
|
"fieldType": "msg",
|
|
"format": "javascript",
|
|
"syntax": "plain",
|
|
"template": "/*! jQuery v2.1.0 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */\n!function (a, b) { \"object\" == typeof module && \"object\" == typeof module.exports ? module.exports = a.document ? b(a, !0) : function (a) { if (!a.document) throw new Error(\"jQuery requires a window with a document\"); return b(a) } : b(a) }(\"undefined\" != typeof window ? window : this, function (a, b) {\n var c = [], d = c.slice, e = c.concat, f = c.push, g = c.indexOf, h = {}, i = h.toString, j = h.hasOwnProperty, k = \"\".trim, l = {}, m = a.document, n = \"2.1.0\", o = function (a, b) { return new o.fn.init(a, b) }, p = /^-ms-/, q = /-([\\da-z])/gi, r = function (a, b) { return b.toUpperCase() }; o.fn = o.prototype = { jquery: n, constructor: o, selector: \"\", length: 0, toArray: function () { return d.call(this) }, get: function (a) { return null != a ? 0 > a ? this[a + this.length] : this[a] : d.call(this) }, pushStack: function (a) { var b = o.merge(this.constructor(), a); return b.prevObject = this, b.context = this.context, b }, each: function (a, b) { return o.each(this, a, b) }, map: function (a) { return this.pushStack(o.map(this, function (b, c) { return a.call(b, c, b) })) }, slice: function () { return this.pushStack(d.apply(this, arguments)) }, first: function () { return this.eq(0) }, last: function () { return this.eq(-1) }, eq: function (a) { var b = this.length, c = +a + (0 > a ? b : 0); return this.pushStack(c >= 0 && b > c ? [this[c]] : []) }, end: function () { return this.prevObject || this.constructor(null) }, push: f, sort: c.sort, splice: c.splice }, o.extend = o.fn.extend = function () { var a, b, c, d, e, f, g = arguments[0] || {}, h = 1, i = arguments.length, j = !1; for (\"boolean\" == typeof g && (j = g, g = arguments[h] || {}, h++), \"object\" == typeof g || o.isFunction(g) || (g = {}), h === i && (g = this, h--); i > h; h++)if (null != (a = arguments[h])) for (b in a) c = g[b], d = a[b], g !== d && (j && d && (o.isPlainObject(d) || (e = o.isArray(d))) ? (e ? (e = !1, f = c && o.isArray(c) ? c : []) : f = c && o.isPlainObject(c) ? c : {}, g[b] = o.extend(j, f, d)) : void 0 !== d && (g[b] = d)); return g }, o.extend({ expando: \"jQuery\" + (n + Math.random()).replace(/\\D/g, \"\"), isReady: !0, error: function (a) { throw new Error(a) }, noop: function () { }, isFunction: function (a) { return \"function\" === o.type(a) }, isArray: Array.isArray, isWindow: function (a) { return null != a && a === a.window }, isNumeric: function (a) { return a - parseFloat(a) >= 0 }, isPlainObject: function (a) { if (\"object\" !== o.type(a) || a.nodeType || o.isWindow(a)) return !1; try { if (a.constructor && !j.call(a.constructor.prototype, \"isPrototypeOf\")) return !1 } catch (b) { return !1 } return !0 }, isEmptyObject: function (a) { var b; for (b in a) return !1; return !0 }, type: function (a) { return null == a ? a + \"\" : \"object\" == typeof a || \"function\" == typeof a ? h[i.call(a)] || \"object\" : typeof a }, globalEval: function (a) { var b, c = eval; a = o.trim(a), a && (1 === a.indexOf(\"use strict\") ? (b = m.createElement(\"script\"), b.text = a, m.head.appendChild(b).parentNode.removeChild(b)) : c(a)) }, camelCase: function (a) { return a.replace(p, \"ms-\").replace(q, r) }, nodeName: function (a, b) { return a.nodeName && a.nodeName.toLowerCase() === b.toLowerCase() }, each: function (a, b, c) { var d, e = 0, f = a.length, g = s(a); if (c) { if (g) { for (; f > e; e++)if (d = b.apply(a[e], c), d === !1) break } else for (e in a) if (d = b.apply(a[e], c), d === !1) break } else if (g) { for (; f > e; e++)if (d = b.call(a[e], e, a[e]), d === !1) break } else for (e in a) if (d = b.call(a[e], e, a[e]), d === !1) break; return a }, trim: function (a) { return null == a ? \"\" : k.call(a) }, makeArray: function (a, b) { var c = b || []; return null != a && (s(Object(a)) ? o.merge(c, \"string\" == typeof a ? [a] : a) : f.call(c, a)), c }, inArray: function (a, b, c) { return null == b ? -1 : g.call(b, a, c) }, merge: function (a, b) { for (var c = +b.length, d = 0, e = a.length; c > d; d++)a[e++] = b[d]; return a.length = e, a }, grep: function (a, b, c) { for (var d, e = [], f = 0, g = a.length, h = !c; g > f; f++)d = !b(a[f], f), d !== h && e.push(a[f]); return e }, map: function (a, b, c) { var d, f = 0, g = a.length, h = s(a), i = []; if (h) for (; g > f; f++)d = b(a[f], f, c), null != d && i.push(d); else for (f in a) d = b(a[f], f, c), null != d && i.push(d); return e.apply([], i) }, guid: 1, proxy: function (a, b) { var c, e, f; return \"string\" == typeof b && (c = a[b], b = a, a = c), o.isFunction(a) ? (e = d.call(arguments, 2), f = function () { return a.apply(b || this, e.concat(d.call(arguments))) }, f.guid = a.guid = a.guid || o.guid++, f) : void 0 }, now: Date.now, support: l }), o.each(\"Boolean Number String Function Array Date RegExp Object Error\".split(\" \"), function (a, b) { h[\"[object \" + b + \"]\"] = b.toLowerCase() }); function s(a) { var b = a.length, c = o.type(a); return \"function\" === c || o.isWindow(a) ? !1 : 1 === a.nodeType && b ? !0 : \"array\" === c || 0 === b || \"number\" == typeof b && b > 0 && b - 1 in a } var t = function (a) { var b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s = \"sizzle\" + -new Date, t = a.document, u = 0, v = 0, w = eb(), x = eb(), y = eb(), z = function (a, b) { return a === b && (j = !0), 0 }, A = \"undefined\", B = 1 << 31, C = {}.hasOwnProperty, D = [], E = D.pop, F = D.push, G = D.push, H = D.slice, I = D.indexOf || function (a) { for (var b = 0, c = this.length; c > b; b++)if (this[b] === a) return b; return -1 }, J = \"checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped\", K = \"[\\\\x20\\\\t\\\\r\\\\n\\\\f]\", L = \"(?:\\\\\\\\.|[\\\\w-]|[^\\\\x00-\\\\xa0])+\", M = L.replace(\"w\", \"w#\"), N = \"\\\\[\" + K + \"*(\" + L + \")\" + K + \"*(?:([*^$|!~]?=)\" + K + \"*(?:(['\\\"])((?:\\\\\\\\.|[^\\\\\\\\])*?)\\\\3|(\" + M + \")|)|)\" + K + \"*\\\\]\", O = \":(\" + L + \")(?:\\\\(((['\\\"])((?:\\\\\\\\.|[^\\\\\\\\])*?)\\\\3|((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|\" + N.replace(3, 8) + \")*)|.*)\\\\)|)\", P = new RegExp(\"^\" + K + \"+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)\" + K + \"+$\", \"g\"), Q = new RegExp(\"^\" + K + \"*,\" + K + \"*\"), R = new RegExp(\"^\" + K + \"*([>+~]|\" + K + \")\" + K + \"*\"), S = new RegExp(\"=\" + K + \"*([^\\\\]'\\\"]*?)\" + K + \"*\\\\]\", \"g\"), T = new RegExp(O), U = new RegExp(\"^\" + M + \"$\"), V = { ID: new RegExp(\"^#(\" + L + \")\"), CLASS: new RegExp(\"^\\\\.(\" + L + \")\"), TAG: new RegExp(\"^(\" + L.replace(\"w\", \"w*\") + \")\"), ATTR: new RegExp(\"^\" + N), PSEUDO: new RegExp(\"^\" + O), CHILD: new RegExp(\"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\\\(\" + K + \"*(even|odd|(([+-]|)(\\\\d*)n|)\" + K + \"*(?:([+-]|)\" + K + \"*(\\\\d+)|))\" + K + \"*\\\\)|)\", \"i\"), bool: new RegExp(\"^(?:\" + J + \")$\", \"i\"), needsContext: new RegExp(\"^\" + K + \"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\\\(\" + K + \"*((?:-\\\\d)?\\\\d*)\" + K + \"*\\\\)|)(?=[^-]|$)\", \"i\") }, W = /^(?:input|select|textarea|button)$/i, X = /^h\\d$/i, Y = /^[^{]+\\{\\s*\\[native \\w/, Z = /^(?:#([\\w-]+)|(\\w+)|\\.([\\w-]+))$/, $ = /[+~]/, _ = /'|\\\\/g, ab = new RegExp(\"\\\\\\\\([\\\\da-f]{1,6}\" + K + \"?|(\" + K + \")|.)\", \"ig\"), bb = function (a, b, c) { var d = \"0x\" + b - 65536; return d !== d || c ? b : 0 > d ? String.fromCharCode(d + 65536) : String.fromCharCode(d >> 10 | 55296, 1023 & d | 56320) }; try { G.apply(D = H.call(t.childNodes), t.childNodes), D[t.childNodes.length].nodeType } catch (cb) { G = { apply: D.length ? function (a, b) { F.apply(a, H.call(b)) } : function (a, b) { var c = a.length, d = 0; while (a[c++] = b[d++]); a.length = c - 1 } } } function db(a, b, d, e) { var f, g, h, i, j, m, p, q, u, v; if ((b ? b.ownerDocument || b : t) !== l && k(b), b = b || l, d = d || [], !a || \"string\" != typeof a) return d; if (1 !== (i = b.nodeType) && 9 !== i) return []; if (n && !e) { if (f = Z.exec(a)) if (h = f[1]) { if (9 === i) { if (g = b.getElementById(h), !g || !g.parentNode) return d; if (g.id === h) return d.push(g), d } else if (b.ownerDocument && (g = b.ownerDocument.getElementById(h)) && r(b, g) && g.id === h) return d.push(g), d } else { if (f[2]) return G.apply(d, b.getElementsByTagName(a)), d; if ((h = f[3]) && c.getElementsByClassName && b.getElementsByClassName) return G.apply(d, b.getElementsByClassName(h)), d } if (c.qsa && (!o || !o.test(a))) { if (q = p = s, u = b, v = 9 === i && a, 1 === i && \"object\" !== b.nodeName.toLowerCase()) { m = ob(a), (p = b.getAttribute(\"id\")) ? q = p.replace(_, \"\\\\$&\") : b.setAttribute(\"id\", q), q = \"[id='\" + q + \"'] \", j = m.length; while (j--) m[j] = q + pb(m[j]); u = $.test(a) && mb(b.parentNode) || b, v = m.join(\",\") } if (v) try { return G.apply(d, u.querySelectorAll(v)), d } catch (w) { } finally { p || b.removeAttribute(\"id\") } } } return xb(a.replace(P, \"$1\"), b, d, e) } function eb() { var a = []; function b(c, e) { return a.push(c + \" \") > d.cacheLength && delete b[a.shift()], b[c + \" \"] = e } return b } function fb(a) { return a[s] = !0, a } function gb(a) { var b = l.createElement(\"div\"); try { return !!a(b) } catch (c) { return !1 } finally { b.parentNode && b.parentNode.removeChild(b), b = null } } function hb(a, b) { var c = a.split(\"|\"), e = a.length; while (e--) d.attrHandle[c[e]] = b } function ib(a, b) { var c = b && a, d = c && 1 === a.nodeType && 1 === b.nodeType && (~b.sourceIndex || B) - (~a.sourceIndex || B); if (d) return d; if (c) while (c = c.nextSibling) if (c === b) return -1; return a ? 1 : -1 } function jb(a) { return function (b) { var c = b.nodeName.toLowerCase(); return \"input\" === c && b.type === a } } function kb(a) { return function (b) { var c = b.nodeName.toLowerCase(); return (\"input\" === c || \"button\" === c) && b.type === a } } function lb(a) { return fb(function (b) { return b = +b, fb(function (c, d) { var e, f = a([], c.length, b), g = f.length; while (g--) c[e = f[g]] && (c[e] = !(d[e] = c[e])) }) }) } function mb(a) { return a && typeof a.getElementsByTagName !== A && a } c = db.support = {}, f = db.isXML = function (a) { var b = a && (a.ownerDocument || a).documentElement; return b ? \"HTML\" !== b.nodeName : !1 }, k = db.setDocument = function (a) { var b, e = a ? a.ownerDocument || a : t, g = e.defaultView; return e !== l && 9 === e.nodeType && e.documentElement ? (l = e, m = e.documentElement, n = !f(e), g && g !== g.top && (g.addEventListener ? g.addEventListener(\"unload\", function () { k() }, !1) : g.attachEvent && g.attachEvent(\"onunload\", function () { k() })), c.attributes = gb(function (a) { return a.className = \"i\", !a.getAttribute(\"className\") }), c.getElementsByTagName = gb(function (a) { return a.appendChild(e.createComment(\"\")), !a.getElementsByTagName(\"*\").length }), c.getElementsByClassName = Y.test(e.getElementsByClassName) && gb(function (a) { return a.innerHTML = \"<div class='a'></div><div class='a i'></div>\", a.firstChild.className = \"i\", 2 === a.getElementsByClassName(\"i\").length }), c.getById = gb(function (a) { return m.appendChild(a).id = s, !e.getElementsByName || !e.getElementsByName(s).length }), c.getById ? (d.find.ID = function (a, b) { if (typeof b.getElementById !== A && n) { var c = b.getElementById(a); return c && c.parentNode ? [c] : [] } }, d.filter.ID = function (a) { var b = a.replace(ab, bb); return function (a) { return a.getAttribute(\"id\") === b } }) : (delete d.find.ID, d.filter.ID = function (a) { var b = a.replace(ab, bb); return function (a) { var c = typeof a.getAttributeNode !== A && a.getAttributeNode(\"id\"); return c && c.value === b } }), d.find.TAG = c.getElementsByTagName ? function (a, b) { return typeof b.getElementsByTagName !== A ? b.getElementsByTagName(a) : void 0 } : function (a, b) { var c, d = [], e = 0, f = b.getElementsByTagName(a); if (\"*\" === a) { while (c = f[e++]) 1 === c.nodeType && d.push(c); return d } return f }, d.find.CLASS = c.getElementsByClassName && function (a, b) { return typeof b.getElementsByClassName !== A && n ? b.getElementsByClassName(a) : void 0 }, p = [], o = [], (c.qsa = Y.test(e.querySelectorAll)) && (gb(function (a) { a.innerHTML = \"<select t=''><option selected=''></option></select>\", a.querySelectorAll(\"[t^='']\").length && o.push(\"[*^$]=\" + K + \"*(?:''|\\\"\\\")\"), a.querySelectorAll(\"[selected]\").length || o.push(\"\\\\[\" + K + \"*(?:value|\" + J + \")\"), a.querySelectorAll(\":checked\").length || o.push(\":checked\") }), gb(function (a) { var b = e.createElement(\"input\"); b.setAttribute(\"type\", \"hidden\"), a.appendChild(b).setAttribute(\"name\", \"D\"), a.querySelectorAll(\"[name=d]\").length && o.push(\"name\" + K + \"*[*^$|!~]?=\"), a.querySelectorAll(\":enabled\").length || o.push(\":enabled\", \":disabled\"), a.querySelectorAll(\"*,:x\"), o.push(\",.*:\") })), (c.matchesSelector = Y.test(q = m.webkitMatchesSelector || m.mozMatchesSelector || m.oMatchesSelector || m.msMatchesSelector)) && gb(function (a) { c.disconnectedMatch = q.call(a, \"div\"), q.call(a, \"[s!='']:x\"), p.push(\"!=\", O) }), o = o.length && new RegExp(o.join(\"|\")), p = p.length && new RegExp(p.join(\"|\")), b = Y.test(m.compareDocumentPosition), r = b || Y.test(m.contains) ? function (a, b) { var c = 9 === a.nodeType ? a.documentElement : a, d = b && b.parentNode; return a === d || !(!d || 1 !== d.nodeType || !(c.contains ? c.contains(d) : a.compareDocumentPosition && 16 & a.compareDocumentPosition(d))) } : function (a, b) { if (b) while (b = b.parentNode) if (b === a) return !0; return !1 }, z = b ? function (a, b) { if (a === b) return j = !0, 0; var d = !a.compareDocumentPosition - !b.compareDocumentPosition; return d ? d : (d = (a.ownerDocument || a) === (b.ownerDocument || b) ? a.compareDocumentPosition(b) : 1, 1 & d || !c.sortDetached && b.compareDocumentPosition(a) === d ? a === e || a.ownerDocument === t && r(t, a) ? -1 : b === e || b.ownerDocument === t && r(t, b) ? 1 : i ? I.call(i, a) - I.call(i, b) : 0 : 4 & d ? -1 : 1) } : function (a, b) { if (a === b) return j = !0, 0; var c, d = 0, f = a.parentNode, g = b.parentNode, h = [a], k = [b]; if (!f || !g) return a === e ? -1 : b === e ? 1 : f ? -1 : g ? 1 : i ? I.call(i, a) - I.call(i, b) : 0; if (f === g) return ib(a, b); c = a; while (c = c.parentNode) h.unshift(c); c = b; while (c = c.parentNode) k.unshift(c); while (h[d] === k[d]) d++; return d ? ib(h[d], k[d]) : h[d] === t ? -1 : k[d] === t ? 1 : 0 }, e) : l }, db.matches = function (a, b) { return db(a, null, null, b) }, db.matchesSelector = function (a, b) { if ((a.ownerDocument || a) !== l && k(a), b = b.replace(S, \"='$1']\"), !(!c.matchesSelector || !n || p && p.test(b) || o && o.test(b))) try { var d = q.call(a, b); if (d || c.disconnectedMatch || a.document && 11 !== a.document.nodeType) return d } catch (e) { } return db(b, l, null, [a]).length > 0 }, db.contains = function (a, b) { return (a.ownerDocument || a) !== l && k(a), r(a, b) }, db.attr = function (a, b) { (a.ownerDocument || a) !== l && k(a); var e = d.attrHandle[b.toLowerCase()], f = e && C.call(d.attrHandle, b.toLowerCase()) ? e(a, b, !n) : void 0; return void 0 !== f ? f : c.attributes || !n ? a.getAttribute(b) : (f = a.getAttributeNode(b)) && f.specified ? f.value : null }, db.error = function (a) { throw new Error(\"Syntax error, unrecognized expression: \" + a) }, db.uniqueSort = function (a) { var b, d = [], e = 0, f = 0; if (j = !c.detectDuplicates, i = !c.sortStable && a.slice(0), a.sort(z), j) { while (b = a[f++]) b === a[f] && (e = d.push(f)); while (e--) a.splice(d[e], 1) } return i = null, a }, e = db.getText = function (a) { var b, c = \"\", d = 0, f = a.nodeType; if (f) { if (1 === f || 9 === f || 11 === f) { if (\"string\" == typeof a.textContent) return a.textContent; for (a = a.firstChild; a; a = a.nextSibling)c += e(a) } else if (3 === f || 4 === f) return a.nodeValue } else while (b = a[d++]) c += e(b); return c }, d = db.selectors = { cacheLength: 50, createPseudo: fb, match: V, attrHandle: {}, find: {}, relative: { \">\": { dir: \"parentNode\", first: !0 }, \" \": { dir: \"parentNode\" }, \"+\": { dir: \"previousSibling\", first: !0 }, \"~\": { dir: \"previousSibling\" } }, preFilter: { ATTR: function (a) { return a[1] = a[1].replace(ab, bb), a[3] = (a[4] || a[5] || \"\").replace(ab, bb), \"~=\" === a[2] && (a[3] = \" \" + a[3] + \" \"), a.slice(0, 4) }, CHILD: function (a) { return a[1] = a[1].toLowerCase(), \"nth\" === a[1].slice(0, 3) ? (a[3] || db.error(a[0]), a[4] = +(a[4] ? a[5] + (a[6] || 1) : 2 * (\"even\" === a[3] || \"odd\" === a[3])), a[5] = +(a[7] + a[8] || \"odd\" === a[3])) : a[3] && db.error(a[0]), a }, PSEUDO: function (a) { var b, c = !a[5] && a[2]; return V.CHILD.test(a[0]) ? null : (a[3] && void 0 !== a[4] ? a[2] = a[4] : c && T.test(c) && (b = ob(c, !0)) && (b = c.indexOf(\")\", c.length - b) - c.length) && (a[0] = a[0].slice(0, b), a[2] = c.slice(0, b)), a.slice(0, 3)) } }, filter: { TAG: function (a) { var b = a.replace(ab, bb).toLowerCase(); return \"*\" === a ? function () { return !0 } : function (a) { return a.nodeName && a.nodeName.toLowerCase() === b } }, CLASS: function (a) { var b = w[a + \" \"]; return b || (b = new RegExp(\"(^|\" + K + \")\" + a + \"(\" + K + \"|$)\")) && w(a, function (a) { return b.test(\"string\" == typeof a.className && a.className || typeof a.getAttribute !== A && a.getAttribute(\"class\") || \"\") }) }, ATTR: function (a, b, c) { return function (d) { var e = db.attr(d, a); return null == e ? \"!=\" === b : b ? (e += \"\", \"=\" === b ? e === c : \"!=\" === b ? e !== c : \"^=\" === b ? c && 0 === e.indexOf(c) : \"*=\" === b ? c && e.indexOf(c) > -1 : \"$=\" === b ? c && e.slice(-c.length) === c : \"~=\" === b ? (\" \" + e + \" \").indexOf(c) > -1 : \"|=\" === b ? e === c || e.slice(0, c.length + 1) === c + \"-\" : !1) : !0 } }, CHILD: function (a, b, c, d, e) { var f = \"nth\" !== a.slice(0, 3), g = \"last\" !== a.slice(-4), h = \"of-type\" === b; return 1 === d && 0 === e ? function (a) { return !!a.parentNode } : function (b, c, i) { var j, k, l, m, n, o, p = f !== g ? \"nextSibling\" : \"previousSibling\", q = b.parentNode, r = h && b.nodeName.toLowerCase(), t = !i && !h; if (q) { if (f) { while (p) { l = b; while (l = l[p]) if (h ? l.nodeName.toLowerCase() === r : 1 === l.nodeType) return !1; o = p = \"only\" === a && !o && \"nextSibling\" } return !0 } if (o = [g ? q.firstChild : q.lastChild], g && t) { k = q[s] || (q[s] = {}), j = k[a] || [], n = j[0] === u && j[1], m = j[0] === u && j[2], l = n && q.childNodes[n]; while (l = ++n && l && l[p] || (m = n = 0) || o.pop()) if (1 === l.nodeType && ++m && l === b) { k[a] = [u, n, m]; break } } else if (t && (j = (b[s] || (b[s] = {}))[a]) && j[0] === u) m = j[1]; else while (l = ++n && l && l[p] || (m = n = 0) || o.pop()) if ((h ? l.nodeName.toLowerCase() === r : 1 === l.nodeType) && ++m && (t && ((l[s] || (l[s] = {}))[a] = [u, m]), l === b)) break; return m -= e, m === d || m % d === 0 && m / d >= 0 } } }, PSEUDO: function (a, b) { var c, e = d.pseudos[a] || d.setFilters[a.toLowerCase()] || db.error(\"unsupported pseudo: \" + a); return e[s] ? e(b) : e.length > 1 ? (c = [a, a, \"\", b], d.setFilters.hasOwnProperty(a.toLowerCase()) ? fb(function (a, c) { var d, f = e(a, b), g = f.length; while (g--) d = I.call(a, f[g]), a[d] = !(c[d] = f[g]) }) : function (a) { return e(a, 0, c) }) : e } }, pseudos: { not: fb(function (a) { var b = [], c = [], d = g(a.replace(P, \"$1\")); return d[s] ? fb(function (a, b, c, e) { var f, g = d(a, null, e, []), h = a.length; while (h--) (f = g[h]) && (a[h] = !(b[h] = f)) }) : function (a, e, f) { return b[0] = a, d(b, null, f, c), !c.pop() } }), has: fb(function (a) { return function (b) { return db(a, b).length > 0 } }), contains: fb(function (a) { return function (b) { return (b.textContent || b.innerText || e(b)).indexOf(a) > -1 } }), lang: fb(function (a) { return U.test(a || \"\") || db.error(\"unsupported lang: \" + a), a = a.replace(ab, bb).toLowerCase(), function (b) { var c; do if (c = n ? b.lang : b.getAttribute(\"xml:lang\") || b.getAttribute(\"lang\")) return c = c.toLowerCase(), c === a || 0 === c.indexOf(a + \"-\"); while ((b = b.parentNode) && 1 === b.nodeType); return !1 } }), target: function (b) { var c = a.location && a.location.hash; return c && c.slice(1) === b.id }, root: function (a) { return a === m }, focus: function (a) { return a === l.activeElement && (!l.hasFocus || l.hasFocus()) && !!(a.type || a.href || ~a.tabIndex) }, enabled: function (a) { return a.disabled === !1 }, disabled: function (a) { return a.disabled === !0 }, checked: function (a) { var b = a.nodeName.toLowerCase(); return \"input\" === b && !!a.checked || \"option\" === b && !!a.selected }, selected: function (a) { return a.parentNode && a.parentNode.selectedIndex, a.selected === !0 }, empty: function (a) { for (a = a.firstChild; a; a = a.nextSibling)if (a.nodeType < 6) return !1; return !0 }, parent: function (a) { return !d.pseudos.empty(a) }, header: function (a) { return X.test(a.nodeName) }, input: function (a) { return W.test(a.nodeName) }, button: function (a) { var b = a.nodeName.toLowerCase(); return \"input\" === b && \"button\" === a.type || \"button\" === b }, text: function (a) { var b; return \"input\" === a.nodeName.toLowerCase() && \"text\" === a.type && (null == (b = a.getAttribute(\"type\")) || \"text\" === b.toLowerCase()) }, first: lb(function () { return [0] }), last: lb(function (a, b) { return [b - 1] }), eq: lb(function (a, b, c) { return [0 > c ? c + b : c] }), even: lb(function (a, b) { for (var c = 0; b > c; c += 2)a.push(c); return a }), odd: lb(function (a, b) { for (var c = 1; b > c; c += 2)a.push(c); return a }), lt: lb(function (a, b, c) { for (var d = 0 > c ? c + b : c; --d >= 0;)a.push(d); return a }), gt: lb(function (a, b, c) { for (var d = 0 > c ? c + b : c; ++d < b;)a.push(d); return a }) } }, d.pseudos.nth = d.pseudos.eq; for (b in { radio: !0, checkbox: !0, file: !0, password: !0, image: !0 }) d.pseudos[b] = jb(b); for (b in { submit: !0, reset: !0 }) d.pseudos[b] = kb(b); function nb() { } nb.prototype = d.filters = d.pseudos, d.setFilters = new nb; function ob(a, b) { var c, e, f, g, h, i, j, k = x[a + \" \"]; if (k) return b ? 0 : k.slice(0); h = a, i = [], j = d.preFilter; while (h) { (!c || (e = Q.exec(h))) && (e && (h = h.slice(e[0].length) || h), i.push(f = [])), c = !1, (e = R.exec(h)) && (c = e.shift(), f.push({ value: c, type: e[0].replace(P, \" \") }), h = h.slice(c.length)); for (g in d.filter) !(e = V[g].exec(h)) || j[g] && !(e = j[g](e)) || (c = e.shift(), f.push({ value: c, type: g, matches: e }), h = h.slice(c.length)); if (!c) break } return b ? h.length : h ? db.error(a) : x(a, i).slice(0) } function pb(a) { for (var b = 0, c = a.length, d = \"\"; c > b; b++)d += a[b].value; return d } function qb(a, b, c) { var d = b.dir, e = c && \"parentNode\" === d, f = v++; return b.first ? function (b, c, f) { while (b = b[d]) if (1 === b.nodeType || e) return a(b, c, f) } : function (b, c, g) { var h, i, j = [u, f]; if (g) { while (b = b[d]) if ((1 === b.nodeType || e) && a(b, c, g)) return !0 } else while (b = b[d]) if (1 === b.nodeType || e) { if (i = b[s] || (b[s] = {}), (h = i[d]) && h[0] === u && h[1] === f) return j[2] = h[2]; if (i[d] = j, j[2] = a(b, c, g)) return !0 } } } function rb(a) { return a.length > 1 ? function (b, c, d) { var e = a.length; while (e--) if (!a[e](b, c, d)) return !1; return !0 } : a[0] } function sb(a, b, c, d, e) { for (var f, g = [], h = 0, i = a.length, j = null != b; i > h; h++)(f = a[h]) && (!c || c(f, d, e)) && (g.push(f), j && b.push(h)); return g } function tb(a, b, c, d, e, f) { return d && !d[s] && (d = tb(d)), e && !e[s] && (e = tb(e, f)), fb(function (f, g, h, i) { var j, k, l, m = [], n = [], o = g.length, p = f || wb(b || \"*\", h.nodeType ? [h] : h, []), q = !a || !f && b ? p : sb(p, m, a, h, i), r = c ? e || (f ? a : o || d) ? [] : g : q; if (c && c(q, r, h, i), d) { j = sb(r, n), d(j, [], h, i), k = j.length; while (k--) (l = j[k]) && (r[n[k]] = !(q[n[k]] = l)) } if (f) { if (e || a) { if (e) { j = [], k = r.length; while (k--) (l = r[k]) && j.push(q[k] = l); e(null, r = [], j, i) } k = r.length; while (k--) (l = r[k]) && (j = e ? I.call(f, l) : m[k]) > -1 && (f[j] = !(g[j] = l)) } } else r = sb(r === g ? r.splice(o, r.length) : r), e ? e(null, g, r, i) : G.apply(g, r) }) } function ub(a) { for (var b, c, e, f = a.length, g = d.relative[a[0].type], i = g || d.relative[\" \"], j = g ? 1 : 0, k = qb(function (a) { return a === b }, i, !0), l = qb(function (a) { return I.call(b, a) > -1 }, i, !0), m = [function (a, c, d) { return !g && (d || c !== h) || ((b = c).nodeType ? k(a, c, d) : l(a, c, d)) }]; f > j; j++)if (c = d.relative[a[j].type]) m = [qb(rb(m), c)]; else { if (c = d.filter[a[j].type].apply(null, a[j].matches), c[s]) { for (e = ++j; f > e; e++)if (d.relative[a[e].type]) break; return tb(j > 1 && rb(m), j > 1 && pb(a.slice(0, j - 1).concat({ value: \" \" === a[j - 2].type ? \"*\" : \"\" })).replace(P, \"$1\"), c, e > j && ub(a.slice(j, e)), f > e && ub(a = a.slice(e)), f > e && pb(a)) } m.push(c) } return rb(m) } function vb(a, b) { var c = b.length > 0, e = a.length > 0, f = function (f, g, i, j, k) { var m, n, o, p = 0, q = \"0\", r = f && [], s = [], t = h, v = f || e && d.find.TAG(\"*\", k), w = u += null == t ? 1 : Math.random() || .1, x = v.length; for (k && (h = g !== l && g); q !== x && null != (m = v[q]); q++) { if (e && m) { n = 0; while (o = a[n++]) if (o(m, g, i)) { j.push(m); break } k && (u = w) } c && ((m = !o && m) && p--, f && r.push(m)) } if (p += q, c && q !== p) { n = 0; while (o = b[n++]) o(r, s, g, i); if (f) { if (p > 0) while (q--) r[q] || s[q] || (s[q] = E.call(j)); s = sb(s) } G.apply(j, s), k && !f && s.length > 0 && p + b.length > 1 && db.uniqueSort(j) } return k && (u = w, h = t), r }; return c ? fb(f) : f } g = db.compile = function (a, b) { var c, d = [], e = [], f = y[a + \" \"]; if (!f) { b || (b = ob(a)), c = b.length; while (c--) f = ub(b[c]), f[s] ? d.push(f) : e.push(f); f = y(a, vb(e, d)) } return f }; function wb(a, b, c) { for (var d = 0, e = b.length; e > d; d++)db(a, b[d], c); return c } function xb(a, b, e, f) { var h, i, j, k, l, m = ob(a); if (!f && 1 === m.length) { if (i = m[0] = m[0].slice(0), i.length > 2 && \"ID\" === (j = i[0]).type && c.getById && 9 === b.nodeType && n && d.relative[i[1].type]) { if (b = (d.find.ID(j.matches[0].replace(ab, bb), b) || [])[0], !b) return e; a = a.slice(i.shift().value.length) } h = V.needsContext.test(a) ? 0 : i.length; while (h--) { if (j = i[h], d.relative[k = j.type]) break; if ((l = d.find[k]) && (f = l(j.matches[0].replace(ab, bb), $.test(i[0].type) && mb(b.parentNode) || b))) { if (i.splice(h, 1), a = f.length && pb(i), !a) return G.apply(e, f), e; break } } } return g(a, m)(f, b, !n, e, $.test(a) && mb(b.parentNode) || b), e } return c.sortStable = s.split(\"\").sort(z).join(\"\") === s, c.detectDuplicates = !!j, k(), c.sortDetached = gb(function (a) { return 1 & a.compareDocumentPosition(l.createElement(\"div\")) }), gb(function (a) { return a.innerHTML = \"<a href='#'></a>\", \"#\" === a.firstChild.getAttribute(\"href\") }) || hb(\"type|href|height|width\", function (a, b, c) { return c ? void 0 : a.getAttribute(b, \"type\" === b.toLowerCase() ? 1 : 2) }), c.attributes && gb(function (a) { return a.innerHTML = \"<input/>\", a.firstChild.setAttribute(\"value\", \"\"), \"\" === a.firstChild.getAttribute(\"value\") }) || hb(\"value\", function (a, b, c) { return c || \"input\" !== a.nodeName.toLowerCase() ? void 0 : a.defaultValue }), gb(function (a) { return null == a.getAttribute(\"disabled\") }) || hb(J, function (a, b, c) { var d; return c ? void 0 : a[b] === !0 ? b.toLowerCase() : (d = a.getAttributeNode(b)) && d.specified ? d.value : null }), db }(a); o.find = t, o.expr = t.selectors, o.expr[\":\"] = o.expr.pseudos, o.unique = t.uniqueSort, o.text = t.getText, o.isXMLDoc = t.isXML, o.contains = t.contains; var u = o.expr.match.needsContext, v = /^<(\\w+)\\s*\\/?>(?:<\\/\\1>|)$/, w = /^.[^:#\\[\\.,]*$/; function x(a, b, c) { if (o.isFunction(b)) return o.grep(a, function (a, d) { return !!b.call(a, d, a) !== c }); if (b.nodeType) return o.grep(a, function (a) { return a === b !== c }); if (\"string\" == typeof b) { if (w.test(b)) return o.filter(b, a, c); b = o.filter(b, a) } return o.grep(a, function (a) { return g.call(b, a) >= 0 !== c }) } o.filter = function (a, b, c) { var d = b[0]; return c && (a = \":not(\" + a + \")\"), 1 === b.length && 1 === d.nodeType ? o.find.matchesSelector(d, a) ? [d] : [] : o.find.matches(a, o.grep(b, function (a) { return 1 === a.nodeType })) }, o.fn.extend({ find: function (a) { var b, c = this.length, d = [], e = this; if (\"string\" != typeof a) return this.pushStack(o(a).filter(function () { for (b = 0; c > b; b++)if (o.contains(e[b], this)) return !0 })); for (b = 0; c > b; b++)o.find(a, e[b], d); return d = this.pushStack(c > 1 ? o.unique(d) : d), d.selector = this.selector ? this.selector + \" \" + a : a, d }, filter: function (a) { return this.pushStack(x(this, a || [], !1)) }, not: function (a) { return this.pushStack(x(this, a || [], !0)) }, is: function (a) { return !!x(this, \"string\" == typeof a && u.test(a) ? o(a) : a || [], !1).length } }); var y, z = /^(?:\\s*(<[\\w\\W]+>)[^>]*|#([\\w-]*))$/, A = o.fn.init = function (a, b) { var c, d; if (!a) return this; if (\"string\" == typeof a) { if (c = \"<\" === a[0] && \">\" === a[a.length - 1] && a.length >= 3 ? [null, a, null] : z.exec(a), !c || !c[1] && b) return !b || b.jquery ? (b || y).find(a) : this.constructor(b).find(a); if (c[1]) { if (b = b instanceof o ? b[0] : b, o.merge(this, o.parseHTML(c[1], b && b.nodeType ? b.ownerDocument || b : m, !0)), v.test(c[1]) && o.isPlainObject(b)) for (c in b) o.isFunction(this[c]) ? this[c](b[c]) : this.attr(c, b[c]); return this } return d = m.getElementById(c[2]), d && d.parentNode && (this.length = 1, this[0] = d), this.context = m, this.selector = a, this } return a.nodeType ? (this.context = this[0] = a, this.length = 1, this) : o.isFunction(a) ? \"undefined\" != typeof y.ready ? y.ready(a) : a(o) : (void 0 !== a.selector && (this.selector = a.selector, this.context = a.context), o.makeArray(a, this)) }; A.prototype = o.fn, y = o(m); var B = /^(?:parents|prev(?:Until|All))/, C = { children: !0, contents: !0, next: !0, prev: !0 }; o.extend({ dir: function (a, b, c) { var d = [], e = void 0 !== c; while ((a = a[b]) && 9 !== a.nodeType) if (1 === a.nodeType) { if (e && o(a).is(c)) break; d.push(a) } return d }, sibling: function (a, b) { for (var c = []; a; a = a.nextSibling)1 === a.nodeType && a !== b && c.push(a); return c } }), o.fn.extend({ has: function (a) { var b = o(a, this), c = b.length; return this.filter(function () { for (var a = 0; c > a; a++)if (o.contains(this, b[a])) return !0 }) }, closest: function (a, b) { for (var c, d = 0, e = this.length, f = [], g = u.test(a) || \"string\" != typeof a ? o(a, b || this.context) : 0; e > d; d++)for (c = this[d]; c && c !== b; c = c.parentNode)if (c.nodeType < 11 && (g ? g.index(c) > -1 : 1 === c.nodeType && o.find.matchesSelector(c, a))) { f.push(c); break } return this.pushStack(f.length > 1 ? o.unique(f) : f) }, index: function (a) { return a ? \"string\" == typeof a ? g.call(o(a), this[0]) : g.call(this, a.jquery ? a[0] : a) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1 }, add: function (a, b) { return this.pushStack(o.unique(o.merge(this.get(), o(a, b)))) }, addBack: function (a) { return this.add(null == a ? this.prevObject : this.prevObject.filter(a)) } }); function D(a, b) { while ((a = a[b]) && 1 !== a.nodeType); return a } o.each({ parent: function (a) { var b = a.parentNode; return b && 11 !== b.nodeType ? b : null }, parents: function (a) { return o.dir(a, \"parentNode\") }, parentsUntil: function (a, b, c) { return o.dir(a, \"parentNode\", c) }, next: function (a) { return D(a, \"nextSibling\") }, prev: function (a) { return D(a, \"previousSibling\") }, nextAll: function (a) { return o.dir(a, \"nextSibling\") }, prevAll: function (a) { return o.dir(a, \"previousSibling\") }, nextUntil: function (a, b, c) { return o.dir(a, \"nextSibling\", c) }, prevUntil: function (a, b, c) { return o.dir(a, \"previousSibling\", c) }, siblings: function (a) { return o.sibling((a.parentNode || {}).firstChild, a) }, children: function (a) { return o.sibling(a.firstChild) }, contents: function (a) { return a.contentDocument || o.merge([], a.childNodes) } }, function (a, b) { o.fn[a] = function (c, d) { var e = o.map(this, b, c); return \"Until\" !== a.slice(-5) && (d = c), d && \"string\" == typeof d && (e = o.filter(d, e)), this.length > 1 && (C[a] || o.unique(e), B.test(a) && e.reverse()), this.pushStack(e) } }); var E = /\\S+/g, F = {}; function G(a) { var b = F[a] = {}; return o.each(a.match(E) || [], function (a, c) { b[c] = !0 }), b } o.Callbacks = function (a) { a = \"string\" == typeof a ? F[a] || G(a) : o.extend({}, a); var b, c, d, e, f, g, h = [], i = !a.once && [], j = function (l) { for (b = a.memory && l, c = !0, g = e || 0, e = 0, f = h.length, d = !0; h && f > g; g++)if (h[g].apply(l[0], l[1]) === !1 && a.stopOnFalse) { b = !1; break } d = !1, h && (i ? i.length && j(i.shift()) : b ? h = [] : k.disable()) }, k = { add: function () { if (h) { var c = h.length; !function g(b) { o.each(b, function (b, c) { var d = o.type(c); \"function\" === d ? a.unique && k.has(c) || h.push(c) : c && c.length && \"string\" !== d && g(c) }) }(arguments), d ? f = h.length : b && (e = c, j(b)) } return this }, remove: function () { return h && o.each(arguments, function (a, b) { var c; while ((c = o.inArray(b, h, c)) > -1) h.splice(c, 1), d && (f >= c && f--, g >= c && g--) }), this }, has: function (a) { return a ? o.inArray(a, h) > -1 : !(!h || !h.length) }, empty: function () { return h = [], f = 0, this }, disable: function () { return h = i = b = void 0, this }, disabled: function () { return !h }, lock: function () { return i = void 0, b || k.disable(), this }, locked: function () { return !i }, fireWith: function (a, b) { return !h || c && !i || (b = b || [], b = [a, b.slice ? b.slice() : b], d ? i.push(b) : j(b)), this }, fire: function () { return k.fireWith(this, arguments), this }, fired: function () { return !!c } }; return k }, o.extend({ Deferred: function (a) { var b = [[\"resolve\", \"done\", o.Callbacks(\"once memory\"), \"resolved\"], [\"reject\", \"fail\", o.Callbacks(\"once memory\"), \"rejected\"], [\"notify\", \"progress\", o.Callbacks(\"memory\")]], c = \"pending\", d = { state: function () { return c }, always: function () { return e.done(arguments).fail(arguments), this }, then: function () { var a = arguments; return o.Deferred(function (c) { o.each(b, function (b, f) { var g = o.isFunction(a[b]) && a[b]; e[f[1]](function () { var a = g && g.apply(this, arguments); a && o.isFunction(a.promise) ? a.promise().done(c.resolve).fail(c.reject).progress(c.notify) : c[f[0] + \"With\"](this === d ? c.promise() : this, g ? [a] : arguments) }) }), a = null }).promise() }, promise: function (a) { return null != a ? o.extend(a, d) : d } }, e = {}; return d.pipe = d.then, o.each(b, function (a, f) { var g = f[2], h = f[3]; d[f[1]] = g.add, h && g.add(function () { c = h }, b[1 ^ a][2].disable, b[2][2].lock), e[f[0]] = function () { return e[f[0] + \"With\"](this === e ? d : this, arguments), this }, e[f[0] + \"With\"] = g.fireWith }), d.promise(e), a && a.call(e, e), e }, when: function (a) { var b = 0, c = d.call(arguments), e = c.length, f = 1 !== e || a && o.isFunction(a.promise) ? e : 0, g = 1 === f ? a : o.Deferred(), h = function (a, b, c) { return function (e) { b[a] = this, c[a] = arguments.length > 1 ? d.call(arguments) : e, c === i ? g.notifyWith(b, c) : --f || g.resolveWith(b, c) } }, i, j, k; if (e > 1) for (i = new Array(e), j = new Array(e), k = new Array(e); e > b; b++)c[b] && o.isFunction(c[b].promise) ? c[b].promise().done(h(b, k, c)).fail(g.reject).progress(h(b, j, i)) : --f; return f || g.resolveWith(k, c), g.promise() } }); var H; o.fn.ready = function (a) { return o.ready.promise().done(a), this }, o.extend({ isReady: !1, readyWait: 1, holdReady: function (a) { a ? o.readyWait++ : o.ready(!0) }, ready: function (a) { (a === !0 ? --o.readyWait : o.isReady) || (o.isReady = !0, a !== !0 && --o.readyWait > 0 || (H.resolveWith(m, [o]), o.fn.trigger && o(m).trigger(\"ready\").off(\"ready\"))) } }); function I() { m.removeEventListener(\"DOMContentLoaded\", I, !1), a.removeEventListener(\"load\", I, !1), o.ready() } o.ready.promise = function (b) { return H || (H = o.Deferred(), \"complete\" === m.readyState ? setTimeout(o.ready) : (m.addEventListener(\"DOMContentLoaded\", I, !1), a.addEventListener(\"load\", I, !1))), H.promise(b) }, o.ready.promise(); var J = o.access = function (a, b, c, d, e, f, g) { var h = 0, i = a.length, j = null == c; if (\"object\" === o.type(c)) { e = !0; for (h in c) o.access(a, b, h, c[h], !0, f, g) } else if (void 0 !== d && (e = !0, o.isFunction(d) || (g = !0), j && (g ? (b.call(a, d), b = null) : (j = b, b = function (a, b, c) { return j.call(o(a), c) })), b)) for (; i > h; h++)b(a[h], c, g ? d : d.call(a[h], h, b(a[h], c))); return e ? a : j ? b.call(a) : i ? b(a[0], c) : f }; o.acceptData = function (a) { return 1 === a.nodeType || 9 === a.nodeType || !+a.nodeType }; function K() { Object.defineProperty(this.cache = {}, 0, { get: function () { return {} } }), this.expando = o.expando + Math.random() } K.uid = 1, K.accepts = o.acceptData, K.prototype = { key: function (a) { if (!K.accepts(a)) return 0; var b = {}, c = a[this.expando]; if (!c) { c = K.uid++; try { b[this.expando] = { value: c }, Object.defineProperties(a, b) } catch (d) { b[this.expando] = c, o.extend(a, b) } } return this.cache[c] || (this.cache[c] = {}), c }, set: function (a, b, c) { var d, e = this.key(a), f = this.cache[e]; if (\"string\" == typeof b) f[b] = c; else if (o.isEmptyObject(f)) o.extend(this.cache[e], b); else for (d in b) f[d] = b[d]; return f }, get: function (a, b) { var c = this.cache[this.key(a)]; return void 0 === b ? c : c[b] }, access: function (a, b, c) { var d; return void 0 === b || b && \"string\" == typeof b && void 0 === c ? (d = this.get(a, b), void 0 !== d ? d : this.get(a, o.camelCase(b))) : (this.set(a, b, c), void 0 !== c ? c : b) }, remove: function (a, b) { var c, d, e, f = this.key(a), g = this.cache[f]; if (void 0 === b) this.cache[f] = {}; else { o.isArray(b) ? d = b.concat(b.map(o.camelCase)) : (e = o.camelCase(b), b in g ? d = [b, e] : (d = e, d = d in g ? [d] : d.match(E) || [])), c = d.length; while (c--) delete g[d[c]] } }, hasData: function (a) { return !o.isEmptyObject(this.cache[a[this.expando]] || {}) }, discard: function (a) { a[this.expando] && delete this.cache[a[this.expando]] } }; var L = new K, M = new K, N = /^(?:\\{[\\w\\W]*\\}|\\[[\\w\\W]*\\])$/, O = /([A-Z])/g; function P(a, b, c) { var d; if (void 0 === c && 1 === a.nodeType) if (d = \"data-\" + b.replace(O, \"-$1\").toLowerCase(), c = a.getAttribute(d), \"string\" == typeof c) { try { c = \"true\" === c ? !0 : \"false\" === c ? !1 : \"null\" === c ? null : +c + \"\" === c ? +c : N.test(c) ? o.parseJSON(c) : c } catch (e) { } M.set(a, b, c) } else c = void 0; return c } o.extend({ hasData: function (a) { return M.hasData(a) || L.hasData(a) }, data: function (a, b, c) { return M.access(a, b, c) }, removeData: function (a, b) { M.remove(a, b) }, _data: function (a, b, c) { return L.access(a, b, c) }, _removeData: function (a, b) { L.remove(a, b) } }), o.fn.extend({\n data: function (a, b) {\n var c, d, e, f = this[0], g = f && f.attributes; if (void 0 === a) {\n if (this.length && (e = M.get(f), 1 === f.nodeType && !L.get(f, \"hasDataAttrs\"))) {\n c = g.length;\n while (c--) d = g[c].name, 0 === d.indexOf(\"data-\") && (d = o.camelCase(d.slice(5)), P(f, d, e[d])); L.set(f, \"hasDataAttrs\", !0)\n } return e\n } return \"object\" == typeof a ? this.each(function () { M.set(this, a) }) : J(this, function (b) { var c, d = o.camelCase(a); if (f && void 0 === b) { if (c = M.get(f, a), void 0 !== c) return c; if (c = M.get(f, d), void 0 !== c) return c; if (c = P(f, d, void 0), void 0 !== c) return c } else this.each(function () { var c = M.get(this, d); M.set(this, d, b), -1 !== a.indexOf(\"-\") && void 0 !== c && M.set(this, a, b) }) }, null, b, arguments.length > 1, null, !0)\n }, removeData: function (a) { return this.each(function () { M.remove(this, a) }) }\n }), o.extend({ queue: function (a, b, c) { var d; return a ? (b = (b || \"fx\") + \"queue\", d = L.get(a, b), c && (!d || o.isArray(c) ? d = L.access(a, b, o.makeArray(c)) : d.push(c)), d || []) : void 0 }, dequeue: function (a, b) { b = b || \"fx\"; var c = o.queue(a, b), d = c.length, e = c.shift(), f = o._queueHooks(a, b), g = function () { o.dequeue(a, b) }; \"inprogress\" === e && (e = c.shift(), d--), e && (\"fx\" === b && c.unshift(\"inprogress\"), delete f.stop, e.call(a, g, f)), !d && f && f.empty.fire() }, _queueHooks: function (a, b) { var c = b + \"queueHooks\"; return L.get(a, c) || L.access(a, c, { empty: o.Callbacks(\"once memory\").add(function () { L.remove(a, [b + \"queue\", c]) }) }) } }), o.fn.extend({ queue: function (a, b) { var c = 2; return \"string\" != typeof a && (b = a, a = \"fx\", c--), arguments.length < c ? o.queue(this[0], a) : void 0 === b ? this : this.each(function () { var c = o.queue(this, a, b); o._queueHooks(this, a), \"fx\" === a && \"inprogress\" !== c[0] && o.dequeue(this, a) }) }, dequeue: function (a) { return this.each(function () { o.dequeue(this, a) }) }, clearQueue: function (a) { return this.queue(a || \"fx\", []) }, promise: function (a, b) { var c, d = 1, e = o.Deferred(), f = this, g = this.length, h = function () { --d || e.resolveWith(f, [f]) }; \"string\" != typeof a && (b = a, a = void 0), a = a || \"fx\"; while (g--) c = L.get(f[g], a + \"queueHooks\"), c && c.empty && (d++, c.empty.add(h)); return h(), e.promise(b) } }); var Q = /[+-]?(?:\\d*\\.|)\\d+(?:[eE][+-]?\\d+|)/.source, R = [\"Top\", \"Right\", \"Bottom\", \"Left\"], S = function (a, b) { return a = b || a, \"none\" === o.css(a, \"display\") || !o.contains(a.ownerDocument, a) }, T = /^(?:checkbox|radio)$/i; !function () { var a = m.createDocumentFragment(), b = a.appendChild(m.createElement(\"div\")); b.innerHTML = \"<input type='radio' checked='checked' name='t'/>\", l.checkClone = b.cloneNode(!0).cloneNode(!0).lastChild.checked, b.innerHTML = \"<textarea>x</textarea>\", l.noCloneChecked = !!b.cloneNode(!0).lastChild.defaultValue }(); var U = \"undefined\"; l.focusinBubbles = \"onfocusin\" in a; var V = /^key/, W = /^(?:mouse|contextmenu)|click/, X = /^(?:focusinfocus|focusoutblur)$/, Y = /^([^.]*)(?:\\.(.+)|)$/; function Z() { return !0 } function $() { return !1 } function _() { try { return m.activeElement } catch (a) { } } o.event = { global: {}, add: function (a, b, c, d, e) { var f, g, h, i, j, k, l, m, n, p, q, r = L.get(a); if (r) { c.handler && (f = c, c = f.handler, e = f.selector), c.guid || (c.guid = o.guid++), (i = r.events) || (i = r.events = {}), (g = r.handle) || (g = r.handle = function (b) { return typeof o !== U && o.event.triggered !== b.type ? o.event.dispatch.apply(a, arguments) : void 0 }), b = (b || \"\").match(E) || [\"\"], j = b.length; while (j--) h = Y.exec(b[j]) || [], n = q = h[1], p = (h[2] || \"\").split(\".\").sort(), n && (l = o.event.special[n] || {}, n = (e ? l.delegateType : l.bindType) || n, l = o.event.special[n] || {}, k = o.extend({ type: n, origType: q, data: d, handler: c, guid: c.guid, selector: e, needsContext: e && o.expr.match.needsContext.test(e), namespace: p.join(\".\") }, f), (m = i[n]) || (m = i[n] = [], m.delegateCount = 0, l.setup && l.setup.call(a, d, p, g) !== !1 || a.addEventListener && a.addEventListener(n, g, !1)), l.add && (l.add.call(a, k), k.handler.guid || (k.handler.guid = c.guid)), e ? m.splice(m.delegateCount++, 0, k) : m.push(k), o.event.global[n] = !0) } }, remove: function (a, b, c, d, e) { var f, g, h, i, j, k, l, m, n, p, q, r = L.hasData(a) && L.get(a); if (r && (i = r.events)) { b = (b || \"\").match(E) || [\"\"], j = b.length; while (j--) if (h = Y.exec(b[j]) || [], n = q = h[1], p = (h[2] || \"\").split(\".\").sort(), n) { l = o.event.special[n] || {}, n = (d ? l.delegateType : l.bindType) || n, m = i[n] || [], h = h[2] && new RegExp(\"(^|\\\\.)\" + p.join(\"\\\\.(?:.*\\\\.|)\") + \"(\\\\.|$)\"), g = f = m.length; while (f--) k = m[f], !e && q !== k.origType || c && c.guid !== k.guid || h && !h.test(k.namespace) || d && d !== k.selector && (\"**\" !== d || !k.selector) || (m.splice(f, 1), k.selector && m.delegateCount--, l.remove && l.remove.call(a, k)); g && !m.length && (l.teardown && l.teardown.call(a, p, r.handle) !== !1 || o.removeEvent(a, n, r.handle), delete i[n]) } else for (n in i) o.event.remove(a, n + b[j], c, d, !0); o.isEmptyObject(i) && (delete r.handle, L.remove(a, \"events\")) } }, trigger: function (b, c, d, e) { var f, g, h, i, k, l, n, p = [d || m], q = j.call(b, \"type\") ? b.type : b, r = j.call(b, \"namespace\") ? b.namespace.split(\".\") : []; if (g = h = d = d || m, 3 !== d.nodeType && 8 !== d.nodeType && !X.test(q + o.event.triggered) && (q.indexOf(\".\") >= 0 && (r = q.split(\".\"), q = r.shift(), r.sort()), k = q.indexOf(\":\") < 0 && \"on\" + q, b = b[o.expando] ? b : new o.Event(q, \"object\" == typeof b && b), b.isTrigger = e ? 2 : 3, b.namespace = r.join(\".\"), b.namespace_re = b.namespace ? new RegExp(\"(^|\\\\.)\" + r.join(\"\\\\.(?:.*\\\\.|)\") + \"(\\\\.|$)\") : null, b.result = void 0, b.target || (b.target = d), c = null == c ? [b] : o.makeArray(c, [b]), n = o.event.special[q] || {}, e || !n.trigger || n.trigger.apply(d, c) !== !1)) { if (!e && !n.noBubble && !o.isWindow(d)) { for (i = n.delegateType || q, X.test(i + q) || (g = g.parentNode); g; g = g.parentNode)p.push(g), h = g; h === (d.ownerDocument || m) && p.push(h.defaultView || h.parentWindow || a) } f = 0; while ((g = p[f++]) && !b.isPropagationStopped()) b.type = f > 1 ? i : n.bindType || q, l = (L.get(g, \"events\") || {})[b.type] && L.get(g, \"handle\"), l && l.apply(g, c), l = k && g[k], l && l.apply && o.acceptData(g) && (b.result = l.apply(g, c), b.result === !1 && b.preventDefault()); return b.type = q, e || b.isDefaultPrevented() || n._default && n._default.apply(p.pop(), c) !== !1 || !o.acceptData(d) || k && o.isFunction(d[q]) && !o.isWindow(d) && (h = d[k], h && (d[k] = null), o.event.triggered = q, d[q](), o.event.triggered = void 0, h && (d[k] = h)), b.result } }, dispatch: function (a) { a = o.event.fix(a); var b, c, e, f, g, h = [], i = d.call(arguments), j = (L.get(this, \"events\") || {})[a.type] || [], k = o.event.special[a.type] || {}; if (i[0] = a, a.delegateTarget = this, !k.preDispatch || k.preDispatch.call(this, a) !== !1) { h = o.event.handlers.call(this, a, j), b = 0; while ((f = h[b++]) && !a.isPropagationStopped()) { a.currentTarget = f.elem, c = 0; while ((g = f.handlers[c++]) && !a.isImmediatePropagationStopped()) (!a.namespace_re || a.namespace_re.test(g.namespace)) && (a.handleObj = g, a.data = g.data, e = ((o.event.special[g.origType] || {}).handle || g.handler).apply(f.elem, i), void 0 !== e && (a.result = e) === !1 && (a.preventDefault(), a.stopPropagation())) } return k.postDispatch && k.postDispatch.call(this, a), a.result } }, handlers: function (a, b) { var c, d, e, f, g = [], h = b.delegateCount, i = a.target; if (h && i.nodeType && (!a.button || \"click\" !== a.type)) for (; i !== this; i = i.parentNode || this)if (i.disabled !== !0 || \"click\" !== a.type) { for (d = [], c = 0; h > c; c++)f = b[c], e = f.selector + \" \", void 0 === d[e] && (d[e] = f.needsContext ? o(e, this).index(i) >= 0 : o.find(e, this, null, [i]).length), d[e] && d.push(f); d.length && g.push({ elem: i, handlers: d }) } return h < b.length && g.push({ elem: this, handlers: b.slice(h) }), g }, props: \"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which\".split(\" \"), fixHooks: {}, keyHooks: { props: \"char charCode key keyCode\".split(\" \"), filter: function (a, b) { return null == a.which && (a.which = null != b.charCode ? b.charCode : b.keyCode), a } }, mouseHooks: { props: \"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement\".split(\" \"), filter: function (a, b) { var c, d, e, f = b.button; return null == a.pageX && null != b.clientX && (c = a.target.ownerDocument || m, d = c.documentElement, e = c.body, a.pageX = b.clientX + (d && d.scrollLeft || e && e.scrollLeft || 0) - (d && d.clientLeft || e && e.clientLeft || 0), a.pageY = b.clientY + (d && d.scrollTop || e && e.scrollTop || 0) - (d && d.clientTop || e && e.clientTop || 0)), a.which || void 0 === f || (a.which = 1 & f ? 1 : 2 & f ? 3 : 4 & f ? 2 : 0), a } }, fix: function (a) { if (a[o.expando]) return a; var b, c, d, e = a.type, f = a, g = this.fixHooks[e]; g || (this.fixHooks[e] = g = W.test(e) ? this.mouseHooks : V.test(e) ? this.keyHooks : {}), d = g.props ? this.props.concat(g.props) : this.props, a = new o.Event(f), b = d.length; while (b--) c = d[b], a[c] = f[c]; return a.target || (a.target = m), 3 === a.target.nodeType && (a.target = a.target.parentNode), g.filter ? g.filter(a, f) : a }, special: { load: { noBubble: !0 }, focus: { trigger: function () { return this !== _() && this.focus ? (this.focus(), !1) : void 0 }, delegateType: \"focusin\" }, blur: { trigger: function () { return this === _() && this.blur ? (this.blur(), !1) : void 0 }, delegateType: \"focusout\" }, click: { trigger: function () { return \"checkbox\" === this.type && this.click && o.nodeName(this, \"input\") ? (this.click(), !1) : void 0 }, _default: function (a) { return o.nodeName(a.target, \"a\") } }, beforeunload: { postDispatch: function (a) { void 0 !== a.result && (a.originalEvent.returnValue = a.result) } } }, simulate: function (a, b, c, d) { var e = o.extend(new o.Event, c, { type: a, isSimulated: !0, originalEvent: {} }); d ? o.event.trigger(e, null, b) : o.event.dispatch.call(b, e), e.isDefaultPrevented() && c.preventDefault() } }, o.removeEvent = function (a, b, c) { a.removeEventListener && a.removeEventListener(b, c, !1) }, o.Event = function (a, b) { return this instanceof o.Event ? (a && a.type ? (this.originalEvent = a, this.type = a.type, this.isDefaultPrevented = a.defaultPrevented || void 0 === a.defaultPrevented && a.getPreventDefault && a.getPreventDefault() ? Z : $) : this.type = a, b && o.extend(this, b), this.timeStamp = a && a.timeStamp || o.now(), void (this[o.expando] = !0)) : new o.Event(a, b) }, o.Event.prototype = { isDefaultPrevented: $, isPropagationStopped: $, isImmediatePropagationStopped: $, preventDefault: function () { var a = this.originalEvent; this.isDefaultPrevented = Z, a && a.preventDefault && a.preventDefault() }, stopPropagation: function () { var a = this.originalEvent; this.isPropagationStopped = Z, a && a.stopPropagation && a.stopPropagation() }, stopImmediatePropagation: function () { this.isImmediatePropagationStopped = Z, this.stopPropagation() } }, o.each({ mouseenter: \"mouseover\", mouseleave: \"mouseout\" }, function (a, b) { o.event.special[a] = { delegateType: b, bindType: b, handle: function (a) { var c, d = this, e = a.relatedTarget, f = a.handleObj; return (!e || e !== d && !o.contains(d, e)) && (a.type = f.origType, c = f.handler.apply(this, arguments), a.type = b), c } } }), l.focusinBubbles || o.each({ focus: \"focusin\", blur: \"focusout\" }, function (a, b) { var c = function (a) { o.event.simulate(b, a.target, o.event.fix(a), !0) }; o.event.special[b] = { setup: function () { var d = this.ownerDocument || this, e = L.access(d, b); e || d.addEventListener(a, c, !0), L.access(d, b, (e || 0) + 1) }, teardown: function () { var d = this.ownerDocument || this, e = L.access(d, b) - 1; e ? L.access(d, b, e) : (d.removeEventListener(a, c, !0), L.remove(d, b)) } } }), o.fn.extend({ on: function (a, b, c, d, e) { var f, g; if (\"object\" == typeof a) { \"string\" != typeof b && (c = c || b, b = void 0); for (g in a) this.on(g, b, c, a[g], e); return this } if (null == c && null == d ? (d = b, c = b = void 0) : null == d && (\"string\" == typeof b ? (d = c, c = void 0) : (d = c, c = b, b = void 0)), d === !1) d = $; else if (!d) return this; return 1 === e && (f = d, d = function (a) { return o().off(a), f.apply(this, arguments) }, d.guid = f.guid || (f.guid = o.guid++)), this.each(function () { o.event.add(this, a, d, c, b) }) }, one: function (a, b, c, d) { return this.on(a, b, c, d, 1) }, off: function (a, b, c) { var d, e; if (a && a.preventDefault && a.handleObj) return d = a.handleObj, o(a.delegateTarget).off(d.namespace ? d.origType + \".\" + d.namespace : d.origType, d.selector, d.handler), this; if (\"object\" == typeof a) { for (e in a) this.off(e, b, a[e]); return this } return (b === !1 || \"function\" == typeof b) && (c = b, b = void 0), c === !1 && (c = $), this.each(function () { o.event.remove(this, a, c, b) }) }, trigger: function (a, b) { return this.each(function () { o.event.trigger(a, b, this) }) }, triggerHandler: function (a, b) { var c = this[0]; return c ? o.event.trigger(a, b, c, !0) : void 0 } }); var ab = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\\w:]+)[^>]*)\\/>/gi, bb = /<([\\w:]+)/, cb = /<|&#?\\w+;/, db = /<(?:script|style|link)/i, eb = /checked\\s*(?:[^=]|=\\s*.checked.)/i, fb = /^$|\\/(?:java|ecma)script/i, gb = /^true\\/(.*)/, hb = /^\\s*<!(?:\\[CDATA\\[|--)|(?:\\]\\]|--)>\\s*$/g, ib = { option: [1, \"<select multiple='multiple'>\", \"</select>\"], thead: [1, \"<table>\", \"</table>\"], col: [2, \"<table><colgroup>\", \"</colgroup></table>\"], tr: [2, \"<table><tbody>\", \"</tbody></table>\"], td: [3, \"<table><tbody><tr>\", \"</tr></tbody></table>\"], _default: [0, \"\", \"\"] }; ib.optgroup = ib.option, ib.tbody = ib.tfoot = ib.colgroup = ib.caption = ib.thead, ib.th = ib.td; function jb(a, b) { return o.nodeName(a, \"table\") && o.nodeName(11 !== b.nodeType ? b : b.firstChild, \"tr\") ? a.getElementsByTagName(\"tbody\")[0] || a.appendChild(a.ownerDocument.createElement(\"tbody\")) : a } function kb(a) { return a.type = (null !== a.getAttribute(\"type\")) + \"/\" + a.type, a } function lb(a) { var b = gb.exec(a.type); return b ? a.type = b[1] : a.removeAttribute(\"type\"), a } function mb(a, b) { for (var c = 0, d = a.length; d > c; c++)L.set(a[c], \"globalEval\", !b || L.get(b[c], \"globalEval\")) } function nb(a, b) { var c, d, e, f, g, h, i, j; if (1 === b.nodeType) { if (L.hasData(a) && (f = L.access(a), g = L.set(b, f), j = f.events)) { delete g.handle, g.events = {}; for (e in j) for (c = 0, d = j[e].length; d > c; c++)o.event.add(b, e, j[e][c]) } M.hasData(a) && (h = M.access(a), i = o.extend({}, h), M.set(b, i)) } } function ob(a, b) { var c = a.getElementsByTagName ? a.getElementsByTagName(b || \"*\") : a.querySelectorAll ? a.querySelectorAll(b || \"*\") : []; return void 0 === b || b && o.nodeName(a, b) ? o.merge([a], c) : c } function pb(a, b) { var c = b.nodeName.toLowerCase(); \"input\" === c && T.test(a.type) ? b.checked = a.checked : (\"input\" === c || \"textarea\" === c) && (b.defaultValue = a.defaultValue) } o.extend({ clone: function (a, b, c) { var d, e, f, g, h = a.cloneNode(!0), i = o.contains(a.ownerDocument, a); if (!(l.noCloneChecked || 1 !== a.nodeType && 11 !== a.nodeType || o.isXMLDoc(a))) for (g = ob(h), f = ob(a), d = 0, e = f.length; e > d; d++)pb(f[d], g[d]); if (b) if (c) for (f = f || ob(a), g = g || ob(h), d = 0, e = f.length; e > d; d++)nb(f[d], g[d]); else nb(a, h); return g = ob(h, \"script\"), g.length > 0 && mb(g, !i && ob(a, \"script\")), h }, buildFragment: function (a, b, c, d) { for (var e, f, g, h, i, j, k = b.createDocumentFragment(), l = [], m = 0, n = a.length; n > m; m++)if (e = a[m], e || 0 === e) if (\"object\" === o.type(e)) o.merge(l, e.nodeType ? [e] : e); else if (cb.test(e)) { f = f || k.appendChild(b.createElement(\"div\")), g = (bb.exec(e) || [\"\", \"\"])[1].toLowerCase(), h = ib[g] || ib._default, f.innerHTML = h[1] + e.replace(ab, \"<$1></$2>\") + h[2], j = h[0]; while (j--) f = f.lastChild; o.merge(l, f.childNodes), f = k.firstChild, f.textContent = \"\" } else l.push(b.createTextNode(e)); k.textContent = \"\", m = 0; while (e = l[m++]) if ((!d || -1 === o.inArray(e, d)) && (i = o.contains(e.ownerDocument, e), f = ob(k.appendChild(e), \"script\"), i && mb(f), c)) { j = 0; while (e = f[j++]) fb.test(e.type || \"\") && c.push(e) } return k }, cleanData: function (a) { for (var b, c, d, e, f, g, h = o.event.special, i = 0; void 0 !== (c = a[i]); i++) { if (o.acceptData(c) && (f = c[L.expando], f && (b = L.cache[f]))) { if (d = Object.keys(b.events || {}), d.length) for (g = 0; void 0 !== (e = d[g]); g++)h[e] ? o.event.remove(c, e) : o.removeEvent(c, e, b.handle); L.cache[f] && delete L.cache[f] } delete M.cache[c[M.expando]] } } }), o.fn.extend({ text: function (a) { return J(this, function (a) { return void 0 === a ? o.text(this) : this.empty().each(function () { (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) && (this.textContent = a) }) }, null, a, arguments.length) }, append: function () { return this.domManip(arguments, function (a) { if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) { var b = jb(this, a); b.appendChild(a) } }) }, prepend: function () { return this.domManip(arguments, function (a) { if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) { var b = jb(this, a); b.insertBefore(a, b.firstChild) } }) }, before: function () { return this.domManip(arguments, function (a) { this.parentNode && this.parentNode.insertBefore(a, this) }) }, after: function () { return this.domManip(arguments, function (a) { this.parentNode && this.parentNode.insertBefore(a, this.nextSibling) }) }, remove: function (a, b) { for (var c, d = a ? o.filter(a, this) : this, e = 0; null != (c = d[e]); e++)b || 1 !== c.nodeType || o.cleanData(ob(c)), c.parentNode && (b && o.contains(c.ownerDocument, c) && mb(ob(c, \"script\")), c.parentNode.removeChild(c)); return this }, empty: function () { for (var a, b = 0; null != (a = this[b]); b++)1 === a.nodeType && (o.cleanData(ob(a, !1)), a.textContent = \"\"); return this }, clone: function (a, b) { return a = null == a ? !1 : a, b = null == b ? a : b, this.map(function () { return o.clone(this, a, b) }) }, html: function (a) { return J(this, function (a) { var b = this[0] || {}, c = 0, d = this.length; if (void 0 === a && 1 === b.nodeType) return b.innerHTML; if (\"string\" == typeof a && !db.test(a) && !ib[(bb.exec(a) || [\"\", \"\"])[1].toLowerCase()]) { a = a.replace(ab, \"<$1></$2>\"); try { for (; d > c; c++)b = this[c] || {}, 1 === b.nodeType && (o.cleanData(ob(b, !1)), b.innerHTML = a); b = 0 } catch (e) { } } b && this.empty().append(a) }, null, a, arguments.length) }, replaceWith: function () { var a = arguments[0]; return this.domManip(arguments, function (b) { a = this.parentNode, o.cleanData(ob(this)), a && a.replaceChild(b, this) }), a && (a.length || a.nodeType) ? this : this.remove() }, detach: function (a) { return this.remove(a, !0) }, domManip: function (a, b) { a = e.apply([], a); var c, d, f, g, h, i, j = 0, k = this.length, m = this, n = k - 1, p = a[0], q = o.isFunction(p); if (q || k > 1 && \"string\" == typeof p && !l.checkClone && eb.test(p)) return this.each(function (c) { var d = m.eq(c); q && (a[0] = p.call(this, c, d.html())), d.domManip(a, b) }); if (k && (c = o.buildFragment(a, this[0].ownerDocument, !1, this), d = c.firstChild, 1 === c.childNodes.length && (c = d), d)) { for (f = o.map(ob(c, \"script\"), kb), g = f.length; k > j; j++)h = c, j !== n && (h = o.clone(h, !0, !0), g && o.merge(f, ob(h, \"script\"))), b.call(this[j], h, j); if (g) for (i = f[f.length - 1].ownerDocument, o.map(f, lb), j = 0; g > j; j++)h = f[j], fb.test(h.type || \"\") && !L.access(h, \"globalEval\") && o.contains(i, h) && (h.src ? o._evalUrl && o._evalUrl(h.src) : o.globalEval(h.textContent.replace(hb, \"\"))) } return this } }), o.each({ appendTo: \"append\", prependTo: \"prepend\", insertBefore: \"before\", insertAfter: \"after\", replaceAll: \"replaceWith\" }, function (a, b) { o.fn[a] = function (a) { for (var c, d = [], e = o(a), g = e.length - 1, h = 0; g >= h; h++)c = h === g ? this : this.clone(!0), o(e[h])[b](c), f.apply(d, c.get()); return this.pushStack(d) } }); var qb, rb = {}; function sb(b, c) { var d = o(c.createElement(b)).appendTo(c.body), e = a.getDefaultComputedStyle ? a.getDefaultComputedStyle(d[0]).display : o.css(d[0], \"display\"); return d.detach(), e } function tb(a) { var b = m, c = rb[a]; return c || (c = sb(a, b), \"none\" !== c && c || (qb = (qb || o(\"<iframe frameborder='0' width='0' height='0'/>\")).appendTo(b.documentElement), b = qb[0].contentDocument, b.write(), b.close(), c = sb(a, b), qb.detach()), rb[a] = c), c } var ub = /^margin/, vb = new RegExp(\"^(\" + Q + \")(?!px)[a-z%]+$\", \"i\"), wb = function (a) { return a.ownerDocument.defaultView.getComputedStyle(a, null) }; function xb(a, b, c) { var d, e, f, g, h = a.style; return c = c || wb(a), c && (g = c.getPropertyValue(b) || c[b]), c && (\"\" !== g || o.contains(a.ownerDocument, a) || (g = o.style(a, b)), vb.test(g) && ub.test(b) && (d = h.width, e = h.minWidth, f = h.maxWidth, h.minWidth = h.maxWidth = h.width = g, g = c.width, h.width = d, h.minWidth = e, h.maxWidth = f)), void 0 !== g ? g + \"\" : g } function yb(a, b) { return { get: function () { return a() ? void delete this.get : (this.get = b).apply(this, arguments) } } } !function () { var b, c, d = \"padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box\", e = m.documentElement, f = m.createElement(\"div\"), g = m.createElement(\"div\"); g.style.backgroundClip = \"content-box\", g.cloneNode(!0).style.backgroundClip = \"\", l.clearCloneStyle = \"content-box\" === g.style.backgroundClip, f.style.cssText = \"border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px\", f.appendChild(g); function h() { g.style.cssText = \"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%\", e.appendChild(f); var d = a.getComputedStyle(g, null); b = \"1%\" !== d.top, c = \"4px\" === d.width, e.removeChild(f) } a.getComputedStyle && o.extend(l, { pixelPosition: function () { return h(), b }, boxSizingReliable: function () { return null == c && h(), c }, reliableMarginRight: function () { var b, c = g.appendChild(m.createElement(\"div\")); return c.style.cssText = g.style.cssText = d, c.style.marginRight = c.style.width = \"0\", g.style.width = \"1px\", e.appendChild(f), b = !parseFloat(a.getComputedStyle(c, null).marginRight), e.removeChild(f), g.innerHTML = \"\", b } }) }(), o.swap = function (a, b, c, d) { var e, f, g = {}; for (f in b) g[f] = a.style[f], a.style[f] = b[f]; e = c.apply(a, d || []); for (f in b) a.style[f] = g[f]; return e }; var zb = /^(none|table(?!-c[ea]).+)/, Ab = new RegExp(\"^(\" + Q + \")(.*)$\", \"i\"), Bb = new RegExp(\"^([+-])=(\" + Q + \")\", \"i\"), Cb = { position: \"absolute\", visibility: \"hidden\", display: \"block\" }, Db = { letterSpacing: 0, fontWeight: 400 }, Eb = [\"Webkit\", \"O\", \"Moz\", \"ms\"]; function Fb(a, b) { if (b in a) return b; var c = b[0].toUpperCase() + b.slice(1), d = b, e = Eb.length; while (e--) if (b = Eb[e] + c, b in a) return b; return d } function Gb(a, b, c) { var d = Ab.exec(b); return d ? Math.max(0, d[1] - (c || 0)) + (d[2] || \"px\") : b } function Hb(a, b, c, d, e) { for (var f = c === (d ? \"border\" : \"content\") ? 4 : \"width\" === b ? 1 : 0, g = 0; 4 > f; f += 2)\"margin\" === c && (g += o.css(a, c + R[f], !0, e)), d ? (\"content\" === c && (g -= o.css(a, \"padding\" + R[f], !0, e)), \"margin\" !== c && (g -= o.css(a, \"border\" + R[f] + \"Width\", !0, e))) : (g += o.css(a, \"padding\" + R[f], !0, e), \"padding\" !== c && (g += o.css(a, \"border\" + R[f] + \"Width\", !0, e))); return g } function Ib(a, b, c) { var d = !0, e = \"width\" === b ? a.offsetWidth : a.offsetHeight, f = wb(a), g = \"border-box\" === o.css(a, \"boxSizing\", !1, f); if (0 >= e || null == e) { if (e = xb(a, b, f), (0 > e || null == e) && (e = a.style[b]), vb.test(e)) return e; d = g && (l.boxSizingReliable() || e === a.style[b]), e = parseFloat(e) || 0 } return e + Hb(a, b, c || (g ? \"border\" : \"content\"), d, f) + \"px\" } function Jb(a, b) { for (var c, d, e, f = [], g = 0, h = a.length; h > g; g++)d = a[g], d.style && (f[g] = L.get(d, \"olddisplay\"), c = d.style.display, b ? (f[g] || \"none\" !== c || (d.style.display = \"\"), \"\" === d.style.display && S(d) && (f[g] = L.access(d, \"olddisplay\", tb(d.nodeName)))) : f[g] || (e = S(d), (c && \"none\" !== c || !e) && L.set(d, \"olddisplay\", e ? c : o.css(d, \"display\")))); for (g = 0; h > g; g++)d = a[g], d.style && (b && \"none\" !== d.style.display && \"\" !== d.style.display || (d.style.display = b ? f[g] || \"\" : \"none\")); return a } o.extend({ cssHooks: { opacity: { get: function (a, b) { if (b) { var c = xb(a, \"opacity\"); return \"\" === c ? \"1\" : c } } } }, cssNumber: { columnCount: !0, fillOpacity: !0, fontWeight: !0, lineHeight: !0, opacity: !0, order: !0, orphans: !0, widows: !0, zIndex: !0, zoom: !0 }, cssProps: { \"float\": \"cssFloat\" }, style: function (a, b, c, d) { if (a && 3 !== a.nodeType && 8 !== a.nodeType && a.style) { var e, f, g, h = o.camelCase(b), i = a.style; return b = o.cssProps[h] || (o.cssProps[h] = Fb(i, h)), g = o.cssHooks[b] || o.cssHooks[h], void 0 === c ? g && \"get\" in g && void 0 !== (e = g.get(a, !1, d)) ? e : i[b] : (f = typeof c, \"string\" === f && (e = Bb.exec(c)) && (c = (e[1] + 1) * e[2] + parseFloat(o.css(a, b)), f = \"number\"), null != c && c === c && (\"number\" !== f || o.cssNumber[h] || (c += \"px\"), l.clearCloneStyle || \"\" !== c || 0 !== b.indexOf(\"background\") || (i[b] = \"inherit\"), g && \"set\" in g && void 0 === (c = g.set(a, c, d)) || (i[b] = \"\", i[b] = c)), void 0) } }, css: function (a, b, c, d) { var e, f, g, h = o.camelCase(b); return b = o.cssProps[h] || (o.cssProps[h] = Fb(a.style, h)), g = o.cssHooks[b] || o.cssHooks[h], g && \"get\" in g && (e = g.get(a, !0, c)), void 0 === e && (e = xb(a, b, d)), \"normal\" === e && b in Db && (e = Db[b]), \"\" === c || c ? (f = parseFloat(e), c === !0 || o.isNumeric(f) ? f || 0 : e) : e } }), o.each([\"height\", \"width\"], function (a, b) { o.cssHooks[b] = { get: function (a, c, d) { return c ? 0 === a.offsetWidth && zb.test(o.css(a, \"display\")) ? o.swap(a, Cb, function () { return Ib(a, b, d) }) : Ib(a, b, d) : void 0 }, set: function (a, c, d) { var e = d && wb(a); return Gb(a, c, d ? Hb(a, b, d, \"border-box\" === o.css(a, \"boxSizing\", !1, e), e) : 0) } } }), o.cssHooks.marginRight = yb(l.reliableMarginRight, function (a, b) { return b ? o.swap(a, { display: \"inline-block\" }, xb, [a, \"marginRight\"]) : void 0 }), o.each({ margin: \"\", padding: \"\", border: \"Width\" }, function (a, b) { o.cssHooks[a + b] = { expand: function (c) { for (var d = 0, e = {}, f = \"string\" == typeof c ? c.split(\" \") : [c]; 4 > d; d++)e[a + R[d] + b] = f[d] || f[d - 2] || f[0]; return e } }, ub.test(a) || (o.cssHooks[a + b].set = Gb) }), o.fn.extend({ css: function (a, b) { return J(this, function (a, b, c) { var d, e, f = {}, g = 0; if (o.isArray(b)) { for (d = wb(a), e = b.length; e > g; g++)f[b[g]] = o.css(a, b[g], !1, d); return f } return void 0 !== c ? o.style(a, b, c) : o.css(a, b) }, a, b, arguments.length > 1) }, show: function () { return Jb(this, !0) }, hide: function () { return Jb(this) }, toggle: function (a) { return \"boolean\" == typeof a ? a ? this.show() : this.hide() : this.each(function () { S(this) ? o(this).show() : o(this).hide() }) } }); function Kb(a, b, c, d, e) { return new Kb.prototype.init(a, b, c, d, e) } o.Tween = Kb, Kb.prototype = { constructor: Kb, init: function (a, b, c, d, e, f) { this.elem = a, this.prop = c, this.easing = e || \"swing\", this.options = b, this.start = this.now = this.cur(), this.end = d, this.unit = f || (o.cssNumber[c] ? \"\" : \"px\") }, cur: function () { var a = Kb.propHooks[this.prop]; return a && a.get ? a.get(this) : Kb.propHooks._default.get(this) }, run: function (a) { var b, c = Kb.propHooks[this.prop]; return this.pos = b = this.options.duration ? o.easing[this.easing](a, this.options.duration * a, 0, 1, this.options.duration) : a, this.now = (this.end - this.start) * b + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), c && c.set ? c.set(this) : Kb.propHooks._default.set(this), this } }, Kb.prototype.init.prototype = Kb.prototype, Kb.propHooks = { _default: { get: function (a) { var b; return null == a.elem[a.prop] || a.elem.style && null != a.elem.style[a.prop] ? (b = o.css(a.elem, a.prop, \"\"), b && \"auto\" !== b ? b : 0) : a.elem[a.prop] }, set: function (a) { o.fx.step[a.prop] ? o.fx.step[a.prop](a) : a.elem.style && (null != a.elem.style[o.cssProps[a.prop]] || o.cssHooks[a.prop]) ? o.style(a.elem, a.prop, a.now + a.unit) : a.elem[a.prop] = a.now } } }, Kb.propHooks.scrollTop = Kb.propHooks.scrollLeft = { set: function (a) { a.elem.nodeType && a.elem.parentNode && (a.elem[a.prop] = a.now) } }, o.easing = { linear: function (a) { return a }, swing: function (a) { return .5 - Math.cos(a * Math.PI) / 2 } }, o.fx = Kb.prototype.init, o.fx.step = {}; var Lb, Mb, Nb = /^(?:toggle|show|hide)$/, Ob = new RegExp(\"^(?:([+-])=|)(\" + Q + \")([a-z%]*)$\", \"i\"), Pb = /queueHooks$/, Qb = [Vb], Rb = { \"*\": [function (a, b) { var c = this.createTween(a, b), d = c.cur(), e = Ob.exec(b), f = e && e[3] || (o.cssNumber[a] ? \"\" : \"px\"), g = (o.cssNumber[a] || \"px\" !== f && +d) && Ob.exec(o.css(c.elem, a)), h = 1, i = 20; if (g && g[3] !== f) { f = f || g[3], e = e || [], g = +d || 1; do h = h || \".5\", g /= h, o.style(c.elem, a, g + f); while (h !== (h = c.cur() / d) && 1 !== h && --i) } return e && (g = c.start = +g || +d || 0, c.unit = f, c.end = e[1] ? g + (e[1] + 1) * e[2] : +e[2]), c }] }; function Sb() { return setTimeout(function () { Lb = void 0 }), Lb = o.now() } function Tb(a, b) { var c, d = 0, e = { height: a }; for (b = b ? 1 : 0; 4 > d; d += 2 - b)c = R[d], e[\"margin\" + c] = e[\"padding\" + c] = a; return b && (e.opacity = e.width = a), e } function Ub(a, b, c) { for (var d, e = (Rb[b] || []).concat(Rb[\"*\"]), f = 0, g = e.length; g > f; f++)if (d = e[f].call(c, b, a)) return d } function Vb(a, b, c) { var d, e, f, g, h, i, j, k = this, l = {}, m = a.style, n = a.nodeType && S(a), p = L.get(a, \"fxshow\"); c.queue || (h = o._queueHooks(a, \"fx\"), null == h.unqueued && (h.unqueued = 0, i = h.empty.fire, h.empty.fire = function () { h.unqueued || i() }), h.unqueued++, k.always(function () { k.always(function () { h.unqueued--, o.queue(a, \"fx\").length || h.empty.fire() }) })), 1 === a.nodeType && (\"height\" in b || \"width\" in b) && (c.overflow = [m.overflow, m.overflowX, m.overflowY], j = o.css(a, \"display\"), \"none\" === j && (j = tb(a.nodeName)), \"inline\" === j && \"none\" === o.css(a, \"float\") && (m.display = \"inline-block\")), c.overflow && (m.overflow = \"hidden\", k.always(function () { m.overflow = c.overflow[0], m.overflowX = c.overflow[1], m.overflowY = c.overflow[2] })); for (d in b) if (e = b[d], Nb.exec(e)) { if (delete b[d], f = f || \"toggle\" === e, e === (n ? \"hide\" : \"show\")) { if (\"show\" !== e || !p || void 0 === p[d]) continue; n = !0 } l[d] = p && p[d] || o.style(a, d) } if (!o.isEmptyObject(l)) { p ? \"hidden\" in p && (n = p.hidden) : p = L.access(a, \"fxshow\", {}), f && (p.hidden = !n), n ? o(a).show() : k.done(function () { o(a).hide() }), k.done(function () { var b; L.remove(a, \"fxshow\"); for (b in l) o.style(a, b, l[b]) }); for (d in l) g = Ub(n ? p[d] : 0, d, k), d in p || (p[d] = g.start, n && (g.end = g.start, g.start = \"width\" === d || \"height\" === d ? 1 : 0)) } } function Wb(a, b) { var c, d, e, f, g; for (c in a) if (d = o.camelCase(c), e = b[d], f = a[c], o.isArray(f) && (e = f[1], f = a[c] = f[0]), c !== d && (a[d] = f, delete a[c]), g = o.cssHooks[d], g && \"expand\" in g) { f = g.expand(f), delete a[d]; for (c in f) c in a || (a[c] = f[c], b[c] = e) } else b[d] = e } function Xb(a, b, c) { var d, e, f = 0, g = Qb.length, h = o.Deferred().always(function () { delete i.elem }), i = function () { if (e) return !1; for (var b = Lb || Sb(), c = Math.max(0, j.startTime + j.duration - b), d = c / j.duration || 0, f = 1 - d, g = 0, i = j.tweens.length; i > g; g++)j.tweens[g].run(f); return h.notifyWith(a, [j, f, c]), 1 > f && i ? c : (h.resolveWith(a, [j]), !1) }, j = h.promise({ elem: a, props: o.extend({}, b), opts: o.extend(!0, { specialEasing: {} }, c), originalProperties: b, originalOptions: c, startTime: Lb || Sb(), duration: c.duration, tweens: [], createTween: function (b, c) { var d = o.Tween(a, j.opts, b, c, j.opts.specialEasing[b] || j.opts.easing); return j.tweens.push(d), d }, stop: function (b) { var c = 0, d = b ? j.tweens.length : 0; if (e) return this; for (e = !0; d > c; c++)j.tweens[c].run(1); return b ? h.resolveWith(a, [j, b]) : h.rejectWith(a, [j, b]), this } }), k = j.props; for (Wb(k, j.opts.specialEasing); g > f; f++)if (d = Qb[f].call(j, a, k, j.opts)) return d; return o.map(k, Ub, j), o.isFunction(j.opts.start) && j.opts.start.call(a, j), o.fx.timer(o.extend(i, { elem: a, anim: j, queue: j.opts.queue })), j.progress(j.opts.progress).done(j.opts.done, j.opts.complete).fail(j.opts.fail).always(j.opts.always) } o.Animation = o.extend(Xb, { tweener: function (a, b) { o.isFunction(a) ? (b = a, a = [\"*\"]) : a = a.split(\" \"); for (var c, d = 0, e = a.length; e > d; d++)c = a[d], Rb[c] = Rb[c] || [], Rb[c].unshift(b) }, prefilter: function (a, b) { b ? Qb.unshift(a) : Qb.push(a) } }), o.speed = function (a, b, c) { var d = a && \"object\" == typeof a ? o.extend({}, a) : { complete: c || !c && b || o.isFunction(a) && a, duration: a, easing: c && b || b && !o.isFunction(b) && b }; return d.duration = o.fx.off ? 0 : \"number\" == typeof d.duration ? d.duration : d.duration in o.fx.speeds ? o.fx.speeds[d.duration] : o.fx.speeds._default, (null == d.queue || d.queue === !0) && (d.queue = \"fx\"), d.old = d.complete, d.complete = function () { o.isFunction(d.old) && d.old.call(this), d.queue && o.dequeue(this, d.queue) }, d }, o.fn.extend({ fadeTo: function (a, b, c, d) { return this.filter(S).css(\"opacity\", 0).show().end().animate({ opacity: b }, a, c, d) }, animate: function (a, b, c, d) { var e = o.isEmptyObject(a), f = o.speed(b, c, d), g = function () { var b = Xb(this, o.extend({}, a), f); (e || L.get(this, \"finish\")) && b.stop(!0) }; return g.finish = g, e || f.queue === !1 ? this.each(g) : this.queue(f.queue, g) }, stop: function (a, b, c) { var d = function (a) { var b = a.stop; delete a.stop, b(c) }; return \"string\" != typeof a && (c = b, b = a, a = void 0), b && a !== !1 && this.queue(a || \"fx\", []), this.each(function () { var b = !0, e = null != a && a + \"queueHooks\", f = o.timers, g = L.get(this); if (e) g[e] && g[e].stop && d(g[e]); else for (e in g) g[e] && g[e].stop && Pb.test(e) && d(g[e]); for (e = f.length; e--;)f[e].elem !== this || null != a && f[e].queue !== a || (f[e].anim.stop(c), b = !1, f.splice(e, 1)); (b || !c) && o.dequeue(this, a) }) }, finish: function (a) { return a !== !1 && (a = a || \"fx\"), this.each(function () { var b, c = L.get(this), d = c[a + \"queue\"], e = c[a + \"queueHooks\"], f = o.timers, g = d ? d.length : 0; for (c.finish = !0, o.queue(this, a, []), e && e.stop && e.stop.call(this, !0), b = f.length; b--;)f[b].elem === this && f[b].queue === a && (f[b].anim.stop(!0), f.splice(b, 1)); for (b = 0; g > b; b++)d[b] && d[b].finish && d[b].finish.call(this); delete c.finish }) } }), o.each([\"toggle\", \"show\", \"hide\"], function (a, b) { var c = o.fn[b]; o.fn[b] = function (a, d, e) { return null == a || \"boolean\" == typeof a ? c.apply(this, arguments) : this.animate(Tb(b, !0), a, d, e) } }), o.each({ slideDown: Tb(\"show\"), slideUp: Tb(\"hide\"), slideToggle: Tb(\"toggle\"), fadeIn: { opacity: \"show\" }, fadeOut: { opacity: \"hide\" }, fadeToggle: { opacity: \"toggle\" } }, function (a, b) { o.fn[a] = function (a, c, d) { return this.animate(b, a, c, d) } }), o.timers = [], o.fx.tick = function () { var a, b = 0, c = o.timers; for (Lb = o.now(); b < c.length; b++)a = c[b], a() || c[b] !== a || c.splice(b--, 1); c.length || o.fx.stop(), Lb = void 0 }, o.fx.timer = function (a) { o.timers.push(a), a() ? o.fx.start() : o.timers.pop() }, o.fx.interval = 13, o.fx.start = function () { Mb || (Mb = setInterval(o.fx.tick, o.fx.interval)) }, o.fx.stop = function () { clearInterval(Mb), Mb = null }, o.fx.speeds = { slow: 600, fast: 200, _default: 400 }, o.fn.delay = function (a, b) { return a = o.fx ? o.fx.speeds[a] || a : a, b = b || \"fx\", this.queue(b, function (b, c) { var d = setTimeout(b, a); c.stop = function () { clearTimeout(d) } }) }, function () { var a = m.createElement(\"input\"), b = m.createElement(\"select\"), c = b.appendChild(m.createElement(\"option\")); a.type = \"checkbox\", l.checkOn = \"\" !== a.value, l.optSelected = c.selected, b.disabled = !0, l.optDisabled = !c.disabled, a = m.createElement(\"input\"), a.value = \"t\", a.type = \"radio\", l.radioValue = \"t\" === a.value }(); var Yb, Zb, $b = o.expr.attrHandle; o.fn.extend({ attr: function (a, b) { return J(this, o.attr, a, b, arguments.length > 1) }, removeAttr: function (a) { return this.each(function () { o.removeAttr(this, a) }) } }), o.extend({ attr: function (a, b, c) { var d, e, f = a.nodeType; if (a && 3 !== f && 8 !== f && 2 !== f) return typeof a.getAttribute === U ? o.prop(a, b, c) : (1 === f && o.isXMLDoc(a) || (b = b.toLowerCase(), d = o.attrHooks[b] || (o.expr.match.bool.test(b) ? Zb : Yb)), void 0 === c ? d && \"get\" in d && null !== (e = d.get(a, b)) ? e : (e = o.find.attr(a, b), null == e ? void 0 : e) : null !== c ? d && \"set\" in d && void 0 !== (e = d.set(a, c, b)) ? e : (a.setAttribute(b, c + \"\"), c) : void o.removeAttr(a, b)) }, removeAttr: function (a, b) { var c, d, e = 0, f = b && b.match(E); if (f && 1 === a.nodeType) while (c = f[e++]) d = o.propFix[c] || c, o.expr.match.bool.test(c) && (a[d] = !1), a.removeAttribute(c) }, attrHooks: { type: { set: function (a, b) { if (!l.radioValue && \"radio\" === b && o.nodeName(a, \"input\")) { var c = a.value; return a.setAttribute(\"type\", b), c && (a.value = c), b } } } } }), Zb = { set: function (a, b, c) { return b === !1 ? o.removeAttr(a, c) : a.setAttribute(c, c), c } }, o.each(o.expr.match.bool.source.match(/\\w+/g), function (a, b) {\n var c = $b[b] || o.find.attr; $b[b] = function (a, b, d) {\n var e, f;\n return d || (f = $b[b], $b[b] = e, e = null != c(a, b, d) ? b.toLowerCase() : null, $b[b] = f), e\n }\n }); var _b = /^(?:input|select|textarea|button)$/i; o.fn.extend({ prop: function (a, b) { return J(this, o.prop, a, b, arguments.length > 1) }, removeProp: function (a) { return this.each(function () { delete this[o.propFix[a] || a] }) } }), o.extend({ propFix: { \"for\": \"htmlFor\", \"class\": \"className\" }, prop: function (a, b, c) { var d, e, f, g = a.nodeType; if (a && 3 !== g && 8 !== g && 2 !== g) return f = 1 !== g || !o.isXMLDoc(a), f && (b = o.propFix[b] || b, e = o.propHooks[b]), void 0 !== c ? e && \"set\" in e && void 0 !== (d = e.set(a, c, b)) ? d : a[b] = c : e && \"get\" in e && null !== (d = e.get(a, b)) ? d : a[b] }, propHooks: { tabIndex: { get: function (a) { return a.hasAttribute(\"tabindex\") || _b.test(a.nodeName) || a.href ? a.tabIndex : -1 } } } }), l.optSelected || (o.propHooks.selected = { get: function (a) { var b = a.parentNode; return b && b.parentNode && b.parentNode.selectedIndex, null } }), o.each([\"tabIndex\", \"readOnly\", \"maxLength\", \"cellSpacing\", \"cellPadding\", \"rowSpan\", \"colSpan\", \"useMap\", \"frameBorder\", \"contentEditable\"], function () { o.propFix[this.toLowerCase()] = this }); var ac = /[\\t\\r\\n\\f]/g; o.fn.extend({ addClass: function (a) { var b, c, d, e, f, g, h = \"string\" == typeof a && a, i = 0, j = this.length; if (o.isFunction(a)) return this.each(function (b) { o(this).addClass(a.call(this, b, this.className)) }); if (h) for (b = (a || \"\").match(E) || []; j > i; i++)if (c = this[i], d = 1 === c.nodeType && (c.className ? (\" \" + c.className + \" \").replace(ac, \" \") : \" \")) { f = 0; while (e = b[f++]) d.indexOf(\" \" + e + \" \") < 0 && (d += e + \" \"); g = o.trim(d), c.className !== g && (c.className = g) } return this }, removeClass: function (a) { var b, c, d, e, f, g, h = 0 === arguments.length || \"string\" == typeof a && a, i = 0, j = this.length; if (o.isFunction(a)) return this.each(function (b) { o(this).removeClass(a.call(this, b, this.className)) }); if (h) for (b = (a || \"\").match(E) || []; j > i; i++)if (c = this[i], d = 1 === c.nodeType && (c.className ? (\" \" + c.className + \" \").replace(ac, \" \") : \"\")) { f = 0; while (e = b[f++]) while (d.indexOf(\" \" + e + \" \") >= 0) d = d.replace(\" \" + e + \" \", \" \"); g = a ? o.trim(d) : \"\", c.className !== g && (c.className = g) } return this }, toggleClass: function (a, b) { var c = typeof a; return \"boolean\" == typeof b && \"string\" === c ? b ? this.addClass(a) : this.removeClass(a) : this.each(o.isFunction(a) ? function (c) { o(this).toggleClass(a.call(this, c, this.className, b), b) } : function () { if (\"string\" === c) { var b, d = 0, e = o(this), f = a.match(E) || []; while (b = f[d++]) e.hasClass(b) ? e.removeClass(b) : e.addClass(b) } else (c === U || \"boolean\" === c) && (this.className && L.set(this, \"__className__\", this.className), this.className = this.className || a === !1 ? \"\" : L.get(this, \"__className__\") || \"\") }) }, hasClass: function (a) { for (var b = \" \" + a + \" \", c = 0, d = this.length; d > c; c++)if (1 === this[c].nodeType && (\" \" + this[c].className + \" \").replace(ac, \" \").indexOf(b) >= 0) return !0; return !1 } }); var bc = /\\r/g; o.fn.extend({ val: function (a) { var b, c, d, e = this[0]; { if (arguments.length) return d = o.isFunction(a), this.each(function (c) { var e; 1 === this.nodeType && (e = d ? a.call(this, c, o(this).val()) : a, null == e ? e = \"\" : \"number\" == typeof e ? e += \"\" : o.isArray(e) && (e = o.map(e, function (a) { return null == a ? \"\" : a + \"\" })), b = o.valHooks[this.type] || o.valHooks[this.nodeName.toLowerCase()], b && \"set\" in b && void 0 !== b.set(this, e, \"value\") || (this.value = e)) }); if (e) return b = o.valHooks[e.type] || o.valHooks[e.nodeName.toLowerCase()], b && \"get\" in b && void 0 !== (c = b.get(e, \"value\")) ? c : (c = e.value, \"string\" == typeof c ? c.replace(bc, \"\") : null == c ? \"\" : c) } } }), o.extend({ valHooks: { select: { get: function (a) { for (var b, c, d = a.options, e = a.selectedIndex, f = \"select-one\" === a.type || 0 > e, g = f ? null : [], h = f ? e + 1 : d.length, i = 0 > e ? h : f ? e : 0; h > i; i++)if (c = d[i], !(!c.selected && i !== e || (l.optDisabled ? c.disabled : null !== c.getAttribute(\"disabled\")) || c.parentNode.disabled && o.nodeName(c.parentNode, \"optgroup\"))) { if (b = o(c).val(), f) return b; g.push(b) } return g }, set: function (a, b) { var c, d, e = a.options, f = o.makeArray(b), g = e.length; while (g--) d = e[g], (d.selected = o.inArray(o(d).val(), f) >= 0) && (c = !0); return c || (a.selectedIndex = -1), f } } } }), o.each([\"radio\", \"checkbox\"], function () { o.valHooks[this] = { set: function (a, b) { return o.isArray(b) ? a.checked = o.inArray(o(a).val(), b) >= 0 : void 0 } }, l.checkOn || (o.valHooks[this].get = function (a) { return null === a.getAttribute(\"value\") ? \"on\" : a.value }) }), o.each(\"blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu\".split(\" \"), function (a, b) { o.fn[b] = function (a, c) { return arguments.length > 0 ? this.on(b, null, a, c) : this.trigger(b) } }), o.fn.extend({ hover: function (a, b) { return this.mouseenter(a).mouseleave(b || a) }, bind: function (a, b, c) { return this.on(a, null, b, c) }, unbind: function (a, b) { return this.off(a, null, b) }, delegate: function (a, b, c, d) { return this.on(b, a, c, d) }, undelegate: function (a, b, c) { return 1 === arguments.length ? this.off(a, \"**\") : this.off(b, a || \"**\", c) } }); var cc = o.now(), dc = /\\?/; o.parseJSON = function (a) { return JSON.parse(a + \"\") }, o.parseXML = function (a) { var b, c; if (!a || \"string\" != typeof a) return null; try { c = new DOMParser, b = c.parseFromString(a, \"text/xml\") } catch (d) { b = void 0 } return (!b || b.getElementsByTagName(\"parsererror\").length) && o.error(\"Invalid XML: \" + a), b }; var ec, fc, gc = /#.*$/, hc = /([?&])_=[^&]*/, ic = /^(.*?):[ \\t]*([^\\r\\n]*)$/gm, jc = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, kc = /^(?:GET|HEAD)$/, lc = /^\\/\\//, mc = /^([\\w.+-]+:)(?:\\/\\/(?:[^\\/?#]*@|)([^\\/?#:]*)(?::(\\d+)|)|)/, nc = {}, oc = {}, pc = \"*/\".concat(\"*\"); try { fc = location.href } catch (qc) { fc = m.createElement(\"a\"), fc.href = \"\", fc = fc.href } ec = mc.exec(fc.toLowerCase()) || []; function rc(a) { return function (b, c) { \"string\" != typeof b && (c = b, b = \"*\"); var d, e = 0, f = b.toLowerCase().match(E) || []; if (o.isFunction(c)) while (d = f[e++]) \"+\" === d[0] ? (d = d.slice(1) || \"*\", (a[d] = a[d] || []).unshift(c)) : (a[d] = a[d] || []).push(c) } } function sc(a, b, c, d) { var e = {}, f = a === oc; function g(h) { var i; return e[h] = !0, o.each(a[h] || [], function (a, h) { var j = h(b, c, d); return \"string\" != typeof j || f || e[j] ? f ? !(i = j) : void 0 : (b.dataTypes.unshift(j), g(j), !1) }), i } return g(b.dataTypes[0]) || !e[\"*\"] && g(\"*\") } function tc(a, b) { var c, d, e = o.ajaxSettings.flatOptions || {}; for (c in b) void 0 !== b[c] && ((e[c] ? a : d || (d = {}))[c] = b[c]); return d && o.extend(!0, a, d), a } function uc(a, b, c) { var d, e, f, g, h = a.contents, i = a.dataTypes; while (\"*\" === i[0]) i.shift(), void 0 === d && (d = a.mimeType || b.getResponseHeader(\"Content-Type\")); if (d) for (e in h) if (h[e] && h[e].test(d)) { i.unshift(e); break } if (i[0] in c) f = i[0]; else { for (e in c) { if (!i[0] || a.converters[e + \" \" + i[0]]) { f = e; break } g || (g = e) } f = f || g } return f ? (f !== i[0] && i.unshift(f), c[f]) : void 0 } function vc(a, b, c, d) { var e, f, g, h, i, j = {}, k = a.dataTypes.slice(); if (k[1]) for (g in a.converters) j[g.toLowerCase()] = a.converters[g]; f = k.shift(); while (f) if (a.responseFields[f] && (c[a.responseFields[f]] = b), !i && d && a.dataFilter && (b = a.dataFilter(b, a.dataType)), i = f, f = k.shift()) if (\"*\" === f) f = i; else if (\"*\" !== i && i !== f) { if (g = j[i + \" \" + f] || j[\"* \" + f], !g) for (e in j) if (h = e.split(\" \"), h[1] === f && (g = j[i + \" \" + h[0]] || j[\"* \" + h[0]])) { g === !0 ? g = j[e] : j[e] !== !0 && (f = h[0], k.unshift(h[1])); break } if (g !== !0) if (g && a[\"throws\"]) b = g(b); else try { b = g(b) } catch (l) { return { state: \"parsererror\", error: g ? l : \"No conversion from \" + i + \" to \" + f } } } return { state: \"success\", data: b } } o.extend({ active: 0, lastModified: {}, etag: {}, ajaxSettings: { url: fc, type: \"GET\", isLocal: jc.test(ec[1]), global: !0, processData: !0, async: !0, contentType: \"application/x-www-form-urlencoded; charset=UTF-8\", accepts: { \"*\": pc, text: \"text/plain\", html: \"text/html\", xml: \"application/xml, text/xml\", json: \"application/json, text/javascript\" }, contents: { xml: /xml/, html: /html/, json: /json/ }, responseFields: { xml: \"responseXML\", text: \"responseText\", json: \"responseJSON\" }, converters: { \"* text\": String, \"text html\": !0, \"text json\": o.parseJSON, \"text xml\": o.parseXML }, flatOptions: { url: !0, context: !0 } }, ajaxSetup: function (a, b) { return b ? tc(tc(a, o.ajaxSettings), b) : tc(o.ajaxSettings, a) }, ajaxPrefilter: rc(nc), ajaxTransport: rc(oc), ajax: function (a, b) { \"object\" == typeof a && (b = a, a = void 0), b = b || {}; var c, d, e, f, g, h, i, j, k = o.ajaxSetup({}, b), l = k.context || k, m = k.context && (l.nodeType || l.jquery) ? o(l) : o.event, n = o.Deferred(), p = o.Callbacks(\"once memory\"), q = k.statusCode || {}, r = {}, s = {}, t = 0, u = \"canceled\", v = { readyState: 0, getResponseHeader: function (a) { var b; if (2 === t) { if (!f) { f = {}; while (b = ic.exec(e)) f[b[1].toLowerCase()] = b[2] } b = f[a.toLowerCase()] } return null == b ? null : b }, getAllResponseHeaders: function () { return 2 === t ? e : null }, setRequestHeader: function (a, b) { var c = a.toLowerCase(); return t || (a = s[c] = s[c] || a, r[a] = b), this }, overrideMimeType: function (a) { return t || (k.mimeType = a), this }, statusCode: function (a) { var b; if (a) if (2 > t) for (b in a) q[b] = [q[b], a[b]]; else v.always(a[v.status]); return this }, abort: function (a) { var b = a || u; return c && c.abort(b), x(0, b), this } }; if (n.promise(v).complete = p.add, v.success = v.done, v.error = v.fail, k.url = ((a || k.url || fc) + \"\").replace(gc, \"\").replace(lc, ec[1] + \"//\"), k.type = b.method || b.type || k.method || k.type, k.dataTypes = o.trim(k.dataType || \"*\").toLowerCase().match(E) || [\"\"], null == k.crossDomain && (h = mc.exec(k.url.toLowerCase()), k.crossDomain = !(!h || h[1] === ec[1] && h[2] === ec[2] && (h[3] || (\"http:\" === h[1] ? \"80\" : \"443\")) === (ec[3] || (\"http:\" === ec[1] ? \"80\" : \"443\")))), k.data && k.processData && \"string\" != typeof k.data && (k.data = o.param(k.data, k.traditional)), sc(nc, k, b, v), 2 === t) return v; i = k.global, i && 0 === o.active++ && o.event.trigger(\"ajaxStart\"), k.type = k.type.toUpperCase(), k.hasContent = !kc.test(k.type), d = k.url, k.hasContent || (k.data && (d = k.url += (dc.test(d) ? \"&\" : \"?\") + k.data, delete k.data), k.cache === !1 && (k.url = hc.test(d) ? d.replace(hc, \"$1_=\" + cc++) : d + (dc.test(d) ? \"&\" : \"?\") + \"_=\" + cc++)), k.ifModified && (o.lastModified[d] && v.setRequestHeader(\"If-Modified-Since\", o.lastModified[d]), o.etag[d] && v.setRequestHeader(\"If-None-Match\", o.etag[d])), (k.data && k.hasContent && k.contentType !== !1 || b.contentType) && v.setRequestHeader(\"Content-Type\", k.contentType), v.setRequestHeader(\"Accept\", k.dataTypes[0] && k.accepts[k.dataTypes[0]] ? k.accepts[k.dataTypes[0]] + (\"*\" !== k.dataTypes[0] ? \", \" + pc + \"; q=0.01\" : \"\") : k.accepts[\"*\"]); for (j in k.headers) v.setRequestHeader(j, k.headers[j]); if (k.beforeSend && (k.beforeSend.call(l, v, k) === !1 || 2 === t)) return v.abort(); u = \"abort\"; for (j in { success: 1, error: 1, complete: 1 }) v[j](k[j]); if (c = sc(oc, k, b, v)) { v.readyState = 1, i && m.trigger(\"ajaxSend\", [v, k]), k.async && k.timeout > 0 && (g = setTimeout(function () { v.abort(\"timeout\") }, k.timeout)); try { t = 1, c.send(r, x) } catch (w) { if (!(2 > t)) throw w; x(-1, w) } } else x(-1, \"No Transport\"); function x(a, b, f, h) { var j, r, s, u, w, x = b; 2 !== t && (t = 2, g && clearTimeout(g), c = void 0, e = h || \"\", v.readyState = a > 0 ? 4 : 0, j = a >= 200 && 300 > a || 304 === a, f && (u = uc(k, v, f)), u = vc(k, u, v, j), j ? (k.ifModified && (w = v.getResponseHeader(\"Last-Modified\"), w && (o.lastModified[d] = w), w = v.getResponseHeader(\"etag\"), w && (o.etag[d] = w)), 204 === a || \"HEAD\" === k.type ? x = \"nocontent\" : 304 === a ? x = \"notmodified\" : (x = u.state, r = u.data, s = u.error, j = !s)) : (s = x, (a || !x) && (x = \"error\", 0 > a && (a = 0))), v.status = a, v.statusText = (b || x) + \"\", j ? n.resolveWith(l, [r, x, v]) : n.rejectWith(l, [v, x, s]), v.statusCode(q), q = void 0, i && m.trigger(j ? \"ajaxSuccess\" : \"ajaxError\", [v, k, j ? r : s]), p.fireWith(l, [v, x]), i && (m.trigger(\"ajaxComplete\", [v, k]), --o.active || o.event.trigger(\"ajaxStop\"))) } return v }, getJSON: function (a, b, c) { return o.get(a, b, c, \"json\") }, getScript: function (a, b) { return o.get(a, void 0, b, \"script\") } }), o.each([\"get\", \"post\"], function (a, b) { o[b] = function (a, c, d, e) { return o.isFunction(c) && (e = e || d, d = c, c = void 0), o.ajax({ url: a, type: b, dataType: e, data: c, success: d }) } }), o.each([\"ajaxStart\", \"ajaxStop\", \"ajaxComplete\", \"ajaxError\", \"ajaxSuccess\", \"ajaxSend\"], function (a, b) { o.fn[b] = function (a) { return this.on(b, a) } }), o._evalUrl = function (a) { return o.ajax({ url: a, type: \"GET\", dataType: \"script\", async: !1, global: !1, \"throws\": !0 }) }, o.fn.extend({ wrapAll: function (a) { var b; return o.isFunction(a) ? this.each(function (b) { o(this).wrapAll(a.call(this, b)) }) : (this[0] && (b = o(a, this[0].ownerDocument).eq(0).clone(!0), this[0].parentNode && b.insertBefore(this[0]), b.map(function () { var a = this; while (a.firstElementChild) a = a.firstElementChild; return a }).append(this)), this) }, wrapInner: function (a) { return this.each(o.isFunction(a) ? function (b) { o(this).wrapInner(a.call(this, b)) } : function () { var b = o(this), c = b.contents(); c.length ? c.wrapAll(a) : b.append(a) }) }, wrap: function (a) { var b = o.isFunction(a); return this.each(function (c) { o(this).wrapAll(b ? a.call(this, c) : a) }) }, unwrap: function () { return this.parent().each(function () { o.nodeName(this, \"body\") || o(this).replaceWith(this.childNodes) }).end() } }), o.expr.filters.hidden = function (a) { return a.offsetWidth <= 0 && a.offsetHeight <= 0 }, o.expr.filters.visible = function (a) { return !o.expr.filters.hidden(a) }; var wc = /%20/g, xc = /\\[\\]$/, yc = /\\r?\\n/g, zc = /^(?:submit|button|image|reset|file)$/i, Ac = /^(?:input|select|textarea|keygen)/i; function Bc(a, b, c, d) { var e; if (o.isArray(b)) o.each(b, function (b, e) { c || xc.test(a) ? d(a, e) : Bc(a + \"[\" + (\"object\" == typeof e ? b : \"\") + \"]\", e, c, d) }); else if (c || \"object\" !== o.type(b)) d(a, b); else for (e in b) Bc(a + \"[\" + e + \"]\", b[e], c, d) } o.param = function (a, b) { var c, d = [], e = function (a, b) { b = o.isFunction(b) ? b() : null == b ? \"\" : b, d[d.length] = encodeURIComponent(a) + \"=\" + encodeURIComponent(b) }; if (void 0 === b && (b = o.ajaxSettings && o.ajaxSettings.traditional), o.isArray(a) || a.jquery && !o.isPlainObject(a)) o.each(a, function () { e(this.name, this.value) }); else for (c in a) Bc(c, a[c], b, e); return d.join(\"&\").replace(wc, \"+\") }, o.fn.extend({ serialize: function () { return o.param(this.serializeArray()) }, serializeArray: function () { return this.map(function () { var a = o.prop(this, \"elements\"); return a ? o.makeArray(a) : this }).filter(function () { var a = this.type; return this.name && !o(this).is(\":disabled\") && Ac.test(this.nodeName) && !zc.test(a) && (this.checked || !T.test(a)) }).map(function (a, b) { var c = o(this).val(); return null == c ? null : o.isArray(c) ? o.map(c, function (a) { return { name: b.name, value: a.replace(yc, \"\\r\\n\") } }) : { name: b.name, value: c.replace(yc, \"\\r\\n\") } }).get() } }), o.ajaxSettings.xhr = function () { try { return new XMLHttpRequest } catch (a) { } }; var Cc = 0, Dc = {}, Ec = { 0: 200, 1223: 204 }, Fc = o.ajaxSettings.xhr(); a.ActiveXObject && o(a).on(\"unload\", function () { for (var a in Dc) Dc[a]() }), l.cors = !!Fc && \"withCredentials\" in Fc, l.ajax = Fc = !!Fc, o.ajaxTransport(function (a) { var b; return l.cors || Fc && !a.crossDomain ? { send: function (c, d) { var e, f = a.xhr(), g = ++Cc; if (f.open(a.type, a.url, a.async, a.username, a.password), a.xhrFields) for (e in a.xhrFields) f[e] = a.xhrFields[e]; a.mimeType && f.overrideMimeType && f.overrideMimeType(a.mimeType), a.crossDomain || c[\"X-Requested-With\"] || (c[\"X-Requested-With\"] = \"XMLHttpRequest\"); for (e in c) f.setRequestHeader(e, c[e]); b = function (a) { return function () { b && (delete Dc[g], b = f.onload = f.onerror = null, \"abort\" === a ? f.abort() : \"error\" === a ? d(f.status, f.statusText) : d(Ec[f.status] || f.status, f.statusText, \"string\" == typeof f.responseText ? { text: f.responseText } : void 0, f.getAllResponseHeaders())) } }, f.onload = b(), f.onerror = b(\"error\"), b = Dc[g] = b(\"abort\"), f.send(a.hasContent && a.data || null) }, abort: function () { b && b() } } : void 0 }), o.ajaxSetup({ accepts: { script: \"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript\" }, contents: { script: /(?:java|ecma)script/ }, converters: { \"text script\": function (a) { return o.globalEval(a), a } } }), o.ajaxPrefilter(\"script\", function (a) { void 0 === a.cache && (a.cache = !1), a.crossDomain && (a.type = \"GET\") }), o.ajaxTransport(\"script\", function (a) { if (a.crossDomain) { var b, c; return { send: function (d, e) { b = o(\"<script>\").prop({ async: !0, charset: a.scriptCharset, src: a.url }).on(\"load error\", c = function (a) { b.remove(), c = null, a && e(\"error\" === a.type ? 404 : 200, a.type) }), m.head.appendChild(b[0]) }, abort: function () { c && c() } } } }); var Gc = [], Hc = /(=)\\?(?=&|$)|\\?\\?/; o.ajaxSetup({ jsonp: \"callback\", jsonpCallback: function () { var a = Gc.pop() || o.expando + \"_\" + cc++; return this[a] = !0, a } }), o.ajaxPrefilter(\"json jsonp\", function (b, c, d) { var e, f, g, h = b.jsonp !== !1 && (Hc.test(b.url) ? \"url\" : \"string\" == typeof b.data && !(b.contentType || \"\").indexOf(\"application/x-www-form-urlencoded\") && Hc.test(b.data) && \"data\"); return h || \"jsonp\" === b.dataTypes[0] ? (e = b.jsonpCallback = o.isFunction(b.jsonpCallback) ? b.jsonpCallback() : b.jsonpCallback, h ? b[h] = b[h].replace(Hc, \"$1\" + e) : b.jsonp !== !1 && (b.url += (dc.test(b.url) ? \"&\" : \"?\") + b.jsonp + \"=\" + e), b.converters[\"script json\"] = function () { return g || o.error(e + \" was not called\"), g[0] }, b.dataTypes[0] = \"json\", f = a[e], a[e] = function () { g = arguments }, d.always(function () { a[e] = f, b[e] && (b.jsonpCallback = c.jsonpCallback, Gc.push(e)), g && o.isFunction(f) && f(g[0]), g = f = void 0 }), \"script\") : void 0 }), o.parseHTML = function (a, b, c) { if (!a || \"string\" != typeof a) return null; \"boolean\" == typeof b && (c = b, b = !1), b = b || m; var d = v.exec(a), e = !c && []; return d ? [b.createElement(d[1])] : (d = o.buildFragment([a], b, e), e && e.length && o(e).remove(), o.merge([], d.childNodes)) }; var Ic = o.fn.load; o.fn.load = function (a, b, c) { if (\"string\" != typeof a && Ic) return Ic.apply(this, arguments); var d, e, f, g = this, h = a.indexOf(\" \"); return h >= 0 && (d = a.slice(h), a = a.slice(0, h)), o.isFunction(b) ? (c = b, b = void 0) : b && \"object\" == typeof b && (e = \"POST\"), g.length > 0 && o.ajax({ url: a, type: e, dataType: \"html\", data: b }).done(function (a) { f = arguments, g.html(d ? o(\"<div>\").append(o.parseHTML(a)).find(d) : a) }).complete(c && function (a, b) { g.each(c, f || [a.responseText, b, a]) }), this }, o.expr.filters.animated = function (a) { return o.grep(o.timers, function (b) { return a === b.elem }).length }; var Jc = a.document.documentElement; function Kc(a) { return o.isWindow(a) ? a : 9 === a.nodeType && a.defaultView } o.offset = { setOffset: function (a, b, c) { var d, e, f, g, h, i, j, k = o.css(a, \"position\"), l = o(a), m = {}; \"static\" === k && (a.style.position = \"relative\"), h = l.offset(), f = o.css(a, \"top\"), i = o.css(a, \"left\"), j = (\"absolute\" === k || \"fixed\" === k) && (f + i).indexOf(\"auto\") > -1, j ? (d = l.position(), g = d.top, e = d.left) : (g = parseFloat(f) || 0, e = parseFloat(i) || 0), o.isFunction(b) && (b = b.call(a, c, h)), null != b.top && (m.top = b.top - h.top + g), null != b.left && (m.left = b.left - h.left + e), \"using\" in b ? b.using.call(a, m) : l.css(m) } }, o.fn.extend({ offset: function (a) { if (arguments.length) return void 0 === a ? this : this.each(function (b) { o.offset.setOffset(this, a, b) }); var b, c, d = this[0], e = { top: 0, left: 0 }, f = d && d.ownerDocument; if (f) return b = f.documentElement, o.contains(b, d) ? (typeof d.getBoundingClientRect !== U && (e = d.getBoundingClientRect()), c = Kc(f), { top: e.top + c.pageYOffset - b.clientTop, left: e.left + c.pageXOffset - b.clientLeft }) : e }, position: function () { if (this[0]) { var a, b, c = this[0], d = { top: 0, left: 0 }; return \"fixed\" === o.css(c, \"position\") ? b = c.getBoundingClientRect() : (a = this.offsetParent(), b = this.offset(), o.nodeName(a[0], \"html\") || (d = a.offset()), d.top += o.css(a[0], \"borderTopWidth\", !0), d.left += o.css(a[0], \"borderLeftWidth\", !0)), { top: b.top - d.top - o.css(c, \"marginTop\", !0), left: b.left - d.left - o.css(c, \"marginLeft\", !0) } } }, offsetParent: function () { return this.map(function () { var a = this.offsetParent || Jc; while (a && !o.nodeName(a, \"html\") && \"static\" === o.css(a, \"position\")) a = a.offsetParent; return a || Jc }) } }), o.each({ scrollLeft: \"pageXOffset\", scrollTop: \"pageYOffset\" }, function (b, c) { var d = \"pageYOffset\" === c; o.fn[b] = function (e) { return J(this, function (b, e, f) { var g = Kc(b); return void 0 === f ? g ? g[c] : b[e] : void (g ? g.scrollTo(d ? a.pageXOffset : f, d ? f : a.pageYOffset) : b[e] = f) }, b, e, arguments.length, null) } }), o.each([\"top\", \"left\"], function (a, b) { o.cssHooks[b] = yb(l.pixelPosition, function (a, c) { return c ? (c = xb(a, b), vb.test(c) ? o(a).position()[b] + \"px\" : c) : void 0 }) }), o.each({ Height: \"height\", Width: \"width\" }, function (a, b) { o.each({ padding: \"inner\" + a, content: b, \"\": \"outer\" + a }, function (c, d) { o.fn[d] = function (d, e) { var f = arguments.length && (c || \"boolean\" != typeof d), g = c || (d === !0 || e === !0 ? \"margin\" : \"border\"); return J(this, function (b, c, d) { var e; return o.isWindow(b) ? b.document.documentElement[\"client\" + a] : 9 === b.nodeType ? (e = b.documentElement, Math.max(b.body[\"scroll\" + a], e[\"scroll\" + a], b.body[\"offset\" + a], e[\"offset\" + a], e[\"client\" + a])) : void 0 === d ? o.css(b, c, g) : o.style(b, c, d, g) }, b, f ? d : void 0, f, null) } }) }), o.fn.size = function () { return this.length }, o.fn.andSelf = o.fn.addBack, \"function\" == typeof define && define.amd && define(\"jquery\", [], function () { return o }); var Lc = a.jQuery, Mc = a.$; return o.noConflict = function (b) { return a.$ === o && (a.$ = Mc), b && a.jQuery === o && (a.jQuery = Lc), o }, typeof b === U && (a.jQuery = a.$ = o), o\n});",
|
|
"x": 950,
|
|
"y": 280,
|
|
"wires": [
|
|
[
|
|
"b664f0b9e6c17ad6"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "602e7197835bba91",
|
|
"type": "link in",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "3e330505ea1e9cba",
|
|
"name": "jquery.min.js",
|
|
"links": [
|
|
"dc075811536fafda"
|
|
],
|
|
"x": 790,
|
|
"y": 280,
|
|
"wires": [
|
|
[
|
|
"c8c3f9c8f2ee35ee"
|
|
]
|
|
],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "b664f0b9e6c17ad6",
|
|
"type": "link out",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "3e330505ea1e9cba",
|
|
"name": "Return",
|
|
"mode": "link",
|
|
"links": [
|
|
"7db929503cf13635"
|
|
],
|
|
"x": 1110,
|
|
"y": 280,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "457583335831f826",
|
|
"type": "link call",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "ad0235dd3aa9eb7d",
|
|
"name": "Build HTML",
|
|
"links": [
|
|
"3ec10e706b7bdc9d"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 970,
|
|
"y": 820,
|
|
"wires": [
|
|
[
|
|
"bf098463143ac8ad"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "591e68e90f876dd1",
|
|
"type": "link call",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "8ad5fe68ad170e2d",
|
|
"name": "Build HTML",
|
|
"links": [
|
|
"3ec10e706b7bdc9d"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 1790,
|
|
"y": 960,
|
|
"wires": [
|
|
[
|
|
"50339f503fd4878d"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "0172c4a240b566fd",
|
|
"type": "link in",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "1c5c6c543ef047b6",
|
|
"name": "HTML: Home",
|
|
"links": [
|
|
"515f363d4f52f625"
|
|
],
|
|
"x": 250,
|
|
"y": 440,
|
|
"wires": [
|
|
[
|
|
"2106525aa2ebda7d"
|
|
]
|
|
],
|
|
"icon": "node-red/file.svg",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "2106525aa2ebda7d",
|
|
"type": "template",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "1c5c6c543ef047b6",
|
|
"name": "HTML",
|
|
"field": "html.body",
|
|
"fieldType": "msg",
|
|
"format": "handlebars",
|
|
"syntax": "mustache",
|
|
"template": "<fieldset id=\"form\" style=\"width: 400px;\">\n <legend style=\"text-align: left;\"><h2>Main Menu</h2></legend>\n\n <p style=\"text-align: left;\">G'Day {{{ session.user.fname}}}</p>\n\n <button id=\"navigation\" onclick=\"window.location.href='{{{ global.config.http_path }}}details';\">My Details</button>\n <button id=\"navigation\" onclick=\"window.location.href='{{{ global.config.http_path }}}changepassword';\">Change Password</button>\n <button id=\"navigation\" onclick=\"window.location.href='{{{ global.config.http_path }}}passwordreset';\">Password Reset</button>\n{{#global.config.developer_mode}}\n <button id=\"navigation\" onclick=\"window.location.href='{{{ global.config.http_path }}}passwordquestions';\">Password Reset Questions</button>\n{{/global.config.developer_mode}}\n <button id=\"navigation\" onclick=\"window.location.href='{{{ global.config.http_path }}}logout';\">Log Out</button>\n\n</fieldset>",
|
|
"x": 450,
|
|
"y": 440,
|
|
"wires": [
|
|
[
|
|
"2f628eec7ca4b343"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "4ecc0631139b51e0",
|
|
"type": "link out",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "1c5c6c543ef047b6",
|
|
"name": "HTML Response",
|
|
"mode": "link",
|
|
"links": [
|
|
"7db929503cf13635"
|
|
],
|
|
"x": 850,
|
|
"y": 440,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "2f628eec7ca4b343",
|
|
"type": "link call",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "1c5c6c543ef047b6",
|
|
"name": "Build HTML",
|
|
"links": [
|
|
"3ec10e706b7bdc9d"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 630,
|
|
"y": 440,
|
|
"wires": [
|
|
[
|
|
"4ecc0631139b51e0"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "fd80fd11fc971e2c",
|
|
"type": "link in",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "a64f4a2c837d5c3c",
|
|
"name": "HTML: Error",
|
|
"links": [
|
|
"d17512b4de05ede1",
|
|
"434d74f494db7cfc",
|
|
"0ec392291c3fda2f",
|
|
"c43678f82d52004f",
|
|
"43603c3760e7ae56"
|
|
],
|
|
"x": 1410,
|
|
"y": 100,
|
|
"wires": [
|
|
[
|
|
"9d93b8dfe83bf3ca"
|
|
]
|
|
],
|
|
"icon": "node-red/file.svg",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "50d19d3ce5cf88f2",
|
|
"type": "debug",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "a64f4a2c837d5c3c",
|
|
"name": "debug 82",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1980,
|
|
"y": 60,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "e5ae19af5f6d6561",
|
|
"type": "link out",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "a64f4a2c837d5c3c",
|
|
"name": "HTML Response",
|
|
"mode": "link",
|
|
"links": [
|
|
"7db929503cf13635"
|
|
],
|
|
"x": 2010,
|
|
"y": 100,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "781d23c946457b30",
|
|
"type": "link call",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "a64f4a2c837d5c3c",
|
|
"name": "Build HTML",
|
|
"links": [
|
|
"3ec10e706b7bdc9d"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 1790,
|
|
"y": 80,
|
|
"wires": [
|
|
[
|
|
"e5ae19af5f6d6561",
|
|
"50d19d3ce5cf88f2"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "3ec10e706b7bdc9d",
|
|
"type": "link in",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "a8e6ecf8ae37659e",
|
|
"name": "Page Template",
|
|
"links": [],
|
|
"x": 260,
|
|
"y": 60,
|
|
"wires": [
|
|
[
|
|
"6fc3fe2eef3733b0"
|
|
]
|
|
],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "8bdcaea510dbad1e",
|
|
"type": "link out",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "a8e6ecf8ae37659e",
|
|
"name": "Return Content",
|
|
"mode": "return",
|
|
"links": [],
|
|
"x": 740,
|
|
"y": 60,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "6fc3fe2eef3733b0",
|
|
"type": "template",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "a8e6ecf8ae37659e",
|
|
"name": "HTML",
|
|
"field": "payload",
|
|
"fieldType": "msg",
|
|
"format": "html",
|
|
"syntax": "mustache",
|
|
"template": "<html>\n <head>\n <title>No Fuss Computing</title>\n <meta name=\"viewport\" content=\"initial-scale=1.0, user-scalable=no\">\n <meta charset=\"utf-8\">\n <meta name=\"robots\" content=\"noindex,nofollow\">\n <script src=\"{{{ global.config.http_path }}}jquery.min.js\"></script>\n <script src=\"{{{ global.config.http_path }}}common.js\"></script>\n <link rel=\"stylesheet\" href=\"{{{ global.config.http_path }}}style.css\">\n </head>\n \n<body>\n <div>\n\n <div style=\"background: url({{{ global.config.html.logo }}}) no-repeat center top; background-size: {{ global.config.html.logo_width }}px {{ global.config.html.logo_height }}px; width: 100%; height: 120px; display: flex;\"></div>\n\n {{{ html.body }}}\n\n </div>\n</body>\n</html>\n",
|
|
"x": 510,
|
|
"y": 60,
|
|
"wires": [
|
|
[
|
|
"8bdcaea510dbad1e"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "e50f46892eabd2a5",
|
|
"type": "link in",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "0abe2cea5975dcfd",
|
|
"name": "HTML: Account Details",
|
|
"links": [
|
|
"52395c2abfc3c4f5"
|
|
],
|
|
"x": 280,
|
|
"y": 560,
|
|
"wires": [
|
|
[
|
|
"46ef4f0739d6c1b8"
|
|
]
|
|
],
|
|
"icon": "node-red/file.svg",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "46ef4f0739d6c1b8",
|
|
"type": "template",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "0abe2cea5975dcfd",
|
|
"name": "HTML",
|
|
"field": "html.body",
|
|
"fieldType": "msg",
|
|
"format": "html",
|
|
"syntax": "mustache",
|
|
"template": "\n <fieldset id=\"form\" style=\"width: 400px;\">\n <legend style=\"text-align: left;\"><h2>Account Details</h2></legend>\n\n <form method=\"post\" action=\"{{{ global.config.http_path }}}updatedetails\" ajax=\"true\">\n <p style=\"padding: 15px;\"></p>\n\n <label for=\"givenName\">First Name</label>\n <input type=\"text\" id=\"givenName\" name=\"givenName\" disabled value=\"{{{ session.user.fname }}}\">\n\n <label for=\"sn\">Last Name</label>\n <input type=\"text\" id=\"sn\" name=\"sn\" disabled value=\"{{{ session.user.lname }}}\">\n\n <label for=\"uid\">User Name</label>\n <input type=\"text\" id=\"uid\" name=\"uid\" disabled value=\"{{{ session.user.username }}}\">\n\n <label for=\"mail\">E-Mail</label>\n <input type=\"text\" id=\"mail\" name=\"mail\" disabled value=\"{{{ session.user.mail }}}\">\n\n <input type=\"submit\" value=\"Updating Not Available\" disabled>\n </form>\n <button id=\"navigation\" onclick=\"window.location.href='{{{ global.config.http_path }}}';\">Home</button>\n </fieldset>\n\n <fieldset id=\"response\">\n <legend style=\"text-align: left;\">Results</legend>\n <span id=\"result\"></span>\n </fieldset>\n <div >\n <span id=\"result\"></span>\n </div>\n",
|
|
"x": 450,
|
|
"y": 560,
|
|
"wires": [
|
|
[
|
|
"c9323e9dc74c9203"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "1d661b2385de4b4a",
|
|
"type": "link out",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "0abe2cea5975dcfd",
|
|
"name": "HTML Response",
|
|
"mode": "link",
|
|
"links": [
|
|
"7db929503cf13635"
|
|
],
|
|
"x": 850,
|
|
"y": 560,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "c9323e9dc74c9203",
|
|
"type": "link call",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "0abe2cea5975dcfd",
|
|
"name": "Build HTML",
|
|
"links": [
|
|
"3ec10e706b7bdc9d"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 630,
|
|
"y": 560,
|
|
"wires": [
|
|
[
|
|
"1d661b2385de4b4a"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "b5cedc58894f707e",
|
|
"type": "link in",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "07f2249ad4b7ccd0",
|
|
"name": "HTML: Change Password",
|
|
"links": [
|
|
"333303604fa4ca01"
|
|
],
|
|
"x": 290,
|
|
"y": 680,
|
|
"wires": [
|
|
[
|
|
"54b1149ed3d047fe"
|
|
]
|
|
],
|
|
"icon": "node-red/file.svg",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "54b1149ed3d047fe",
|
|
"type": "template",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "07f2249ad4b7ccd0",
|
|
"name": "HTML",
|
|
"field": "html.body",
|
|
"fieldType": "msg",
|
|
"format": "handlebars",
|
|
"syntax": "mustache",
|
|
"template": "\n <fieldset id=\"form\" style=\"width: 400px;\">\n <legend style=\"text-align: left;\"><h2>Change Password</h2></legend>\n \n <form method=\"post\" action=\"{{{ global.config.http_path }}}passwordchange\" ajax=\"true\">\n <p style=\"padding: 15px;\">To change your password, Complete the fields below. On completing this form click 'Change Password'. Results will be posted in the results window at the bottom of the page.</p>\n \n <label for=\"c_password\">Current Password</label>\n <input type=\"password\" id=\"c_password\" name=\"c_password\" placeholder=\"current password\">\n \n <label for=\"n_password_1\">New Password</label>\n <input type=\"password\" id=\"n_password_1\" name=\"n_password_1\" placeholder=\"new password\">\n \n <label for=\"n_password_2\">Confirm New Password</label>\n <input type=\"password\" id=\"n_password_2\" name=\"n_password_2\" placeholder=\"re-type new password\">\n \n <input type=\"submit\" value=\"Change Password\">\n </form>\n\n <button id=\"navigation\" onclick=\"window.location.href='{{{ global.config.http_path }}}';\">Home</button>\n \n </fieldset>\n \n <fieldset id=\"response\">\n <legend style=\"text-align: left;\">Results</legend>\n <span id=\"result\"></span>\n </fieldset>\n <div >\n <span id=\"result\"></span>\n </div>\n",
|
|
"x": 470,
|
|
"y": 680,
|
|
"wires": [
|
|
[
|
|
"dcfa3cfba4eb1356"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "0c2e73371d4238a1",
|
|
"type": "link out",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "07f2249ad4b7ccd0",
|
|
"name": "HTML Response",
|
|
"mode": "link",
|
|
"links": [
|
|
"7db929503cf13635"
|
|
],
|
|
"x": 850,
|
|
"y": 680,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "dcfa3cfba4eb1356",
|
|
"type": "link call",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "07f2249ad4b7ccd0",
|
|
"name": "Build HTML",
|
|
"links": [
|
|
"3ec10e706b7bdc9d"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 630,
|
|
"y": 680,
|
|
"wires": [
|
|
[
|
|
"0c2e73371d4238a1"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "fb5301abffede979",
|
|
"type": "link in",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "b447a1f691eb02df",
|
|
"name": "HTML: Logout",
|
|
"links": [
|
|
"68f30ef53ebc2074"
|
|
],
|
|
"x": 250,
|
|
"y": 1140,
|
|
"wires": [
|
|
[
|
|
"abcdd1bd3d9d1892"
|
|
]
|
|
],
|
|
"icon": "node-red/file.svg",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "988765ea19236af0",
|
|
"type": "link out",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "b447a1f691eb02df",
|
|
"name": "HTML Response",
|
|
"mode": "link",
|
|
"links": [
|
|
"7db929503cf13635"
|
|
],
|
|
"x": 790,
|
|
"y": 1140,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "52dc13e1fdbf064d",
|
|
"type": "file in",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "8ad5fe68ad170e2d",
|
|
"name": "Fetch Password Questions",
|
|
"filename": "filename",
|
|
"filenameType": "msg",
|
|
"format": "utf8",
|
|
"chunk": false,
|
|
"sendError": false,
|
|
"encoding": "none",
|
|
"allProps": false,
|
|
"x": 1360,
|
|
"y": 1000,
|
|
"wires": [
|
|
[
|
|
"d460346f6ae1673b"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "d460346f6ae1673b",
|
|
"type": "json",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "8ad5fe68ad170e2d",
|
|
"name": "",
|
|
"property": "payload",
|
|
"action": "obj",
|
|
"pretty": false,
|
|
"x": 1530,
|
|
"y": 1000,
|
|
"wires": [
|
|
[
|
|
"365ba07c1f4721ec"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "b2c917da9e845f7a",
|
|
"type": "switch",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "8ad5fe68ad170e2d",
|
|
"name": "No / Yes",
|
|
"property": "payload",
|
|
"propertyType": "msg",
|
|
"rules": [
|
|
{
|
|
"t": "eq",
|
|
"v": "0",
|
|
"vt": "num"
|
|
},
|
|
{
|
|
"t": "eq",
|
|
"v": "1",
|
|
"vt": "num"
|
|
}
|
|
],
|
|
"checkall": "false",
|
|
"repair": false,
|
|
"outputs": 2,
|
|
"x": 1120,
|
|
"y": 980,
|
|
"wires": [
|
|
[
|
|
"5798e39cbc3730ae"
|
|
],
|
|
[
|
|
"52dc13e1fdbf064d"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "99a3fa75430c37f7",
|
|
"type": "function",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "8ad5fe68ad170e2d",
|
|
"name": "Questions Exist",
|
|
"func": "\nfs.stat(msg.filename, function (err) {\n if (err) {\n msg.payload = 0\n } else {\n msg.payload = 1\n }\n});\n\nreturn msg;\n",
|
|
"outputs": 1,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [
|
|
{
|
|
"var": "fs",
|
|
"module": "fs"
|
|
}
|
|
],
|
|
"x": 980,
|
|
"y": 980,
|
|
"wires": [
|
|
[
|
|
"b2c917da9e845f7a"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "7e95892f2f3454b7",
|
|
"type": "function",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "8ad5fe68ad170e2d",
|
|
"name": "Fetch: User Name",
|
|
"func": "msg.user = 'john.smith';\n\n//msg.payload = 'echo -n $(echo -n ' + msg.user + '| sha256sum) | awk \\'{print $1 }\\'';\n\nreturn msg;",
|
|
"outputs": 1,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 550,
|
|
"y": 980,
|
|
"wires": [
|
|
[
|
|
"9b89c2da58fccb8d"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "9b89c2da58fccb8d",
|
|
"type": "link call",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "8ad5fe68ad170e2d",
|
|
"name": "",
|
|
"links": [
|
|
"8c13bbcc86d93be8"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 770,
|
|
"y": 980,
|
|
"wires": [
|
|
[
|
|
"99a3fa75430c37f7"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "317930c679e833d1",
|
|
"type": "link call",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "ad0235dd3aa9eb7d",
|
|
"name": "Fetch First Half of the password",
|
|
"links": [
|
|
"869469819396a632"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 510,
|
|
"y": 820,
|
|
"wires": [
|
|
[
|
|
"1ce803b83ecf1593"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "9d93b8dfe83bf3ca",
|
|
"type": "function",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "a64f4a2c837d5c3c",
|
|
"name": "HTML",
|
|
"func": "var content = null;\nvar redirect = null;\n\nif ( msg.statusCode > 399 && msg.statusCode < 300 ){\n msg.payload = \"<h1>{{ statusCode }}: {{ http.error }}<h1>\";\n content = msg;\n\n} else {\n // Redirect\n delete msg.payload;\n redirect = msg;\n}\n\nnode.send([\n content,\n redirect\n])\n",
|
|
"outputs": 2,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 1610,
|
|
"y": 100,
|
|
"wires": [
|
|
[
|
|
"781d23c946457b30"
|
|
],
|
|
[
|
|
"e551d77d5412aced"
|
|
]
|
|
],
|
|
"outputLabels": [
|
|
"Content",
|
|
"Redirect"
|
|
],
|
|
"icon": "font-awesome/fa-question"
|
|
},
|
|
{
|
|
"id": "abcdd1bd3d9d1892",
|
|
"type": "function",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "b447a1f691eb02df",
|
|
"name": "Clear Session",
|
|
"func": "\nmsg.payload = \"Logged Out\"\n\nmsg.filename = msg.req.cookies.auth + '.json';\n\nmsg.cookies = {\n\n \"auth\": {\n maxAge: 1000\n }\n\n};\n\nreturn msg;",
|
|
"outputs": 1,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 420,
|
|
"y": 1140,
|
|
"wires": [
|
|
[
|
|
"c17fe14224b2a367"
|
|
]
|
|
],
|
|
"info": "# Clear Session\n\nThis node is responsible for ensuring the cookie is expired."
|
|
},
|
|
{
|
|
"id": "c17fe14224b2a367",
|
|
"type": "fs-remove",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "b447a1f691eb02df",
|
|
"path": "config.paths.token_sessions",
|
|
"pathType": "global",
|
|
"filename": "filename",
|
|
"filenameType": "msg",
|
|
"recursive": false,
|
|
"exist": false,
|
|
"name": "Remove Token",
|
|
"x": 600,
|
|
"y": 1140,
|
|
"wires": [
|
|
[
|
|
"988765ea19236af0"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "db9de7d9adf2c039",
|
|
"type": "template",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "cd68bc6f76082c33",
|
|
"name": "JavaScript",
|
|
"field": "payload",
|
|
"fieldType": "msg",
|
|
"format": "javascript",
|
|
"syntax": "plain",
|
|
"template": "\n$(document).ready(function(e) {\n \n $(\"form[ajax=true]\").submit(function(e) {\n\n $(\"input[type=submit]\").attr(\"disabled\", true);\n $(\"input[type=submit]\").attr(\"value\", \"Sent\");\n\n e.preventDefault();\n \n var form_data = $(this).serialize();\n var form_url = $(this).attr(\"action\");\n var form_method = $(this).attr(\"method\").toUpperCase();\n \n $(\"#loadingimg\").show();\n\n $.ajax({\n url: form_url, \n type: form_method, \n data: form_data, \n cache: false,\n success: function(returnhtml){ \n \n $(\"#result\").html(returnhtml); \n $(\"#loadingimg\").hide(); \n } \n }); \n \n });\n \n});\n",
|
|
"x": 950,
|
|
"y": 180,
|
|
"wires": [
|
|
[
|
|
"65dc1dee26e42599"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "2e8883be19eb130d",
|
|
"type": "link in",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "cd68bc6f76082c33",
|
|
"name": "common.js",
|
|
"links": [
|
|
"e72f08d8fc433bea"
|
|
],
|
|
"x": 780,
|
|
"y": 180,
|
|
"wires": [
|
|
[
|
|
"db9de7d9adf2c039"
|
|
]
|
|
],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "65dc1dee26e42599",
|
|
"type": "link out",
|
|
"z": "42b9663b67dbd983",
|
|
"g": "cd68bc6f76082c33",
|
|
"name": "Return",
|
|
"mode": "link",
|
|
"links": [
|
|
"7db929503cf13635"
|
|
],
|
|
"x": 1110,
|
|
"y": 180,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "bb8102ee0c070ff2",
|
|
"type": "link in",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "3b96ab15b1a54e33",
|
|
"name": "Process: Password Reset Questions",
|
|
"links": [
|
|
"9c92aaf02fee52b5"
|
|
],
|
|
"x": 300,
|
|
"y": 240,
|
|
"wires": [
|
|
[
|
|
"a712f5e2056bbb1b"
|
|
]
|
|
],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "629b7df0515c7d83",
|
|
"type": "debug",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "3b96ab15b1a54e33",
|
|
"name": "STDERR",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 980,
|
|
"y": 260,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "a712f5e2056bbb1b",
|
|
"type": "function",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "3b96ab15b1a54e33",
|
|
"name": "Process Questions",
|
|
"func": "\nmsg.cleaned = \"cat <<EOF\\n\\n[\";\n\n// let keys = Object.keys(msg.http.form); \n// var values = msg.http.form\n\n// var exec = childProcess.exec;\n\n// function my_exec(command, callback) {\n// var proc = exec(command, { shell: \"/bin/bash\" });\n\n// var list = [];\n// proc.stdout.setEncoding('utf8');\n\n// proc.stdout.on('data', function (chunk) {\n// list.push(chunk);\n// });\n\n// proc.stdout.on('end', function () {\n// callback(list.join());\n// });\n\n// node.warn(`stderr: ${proc}`);\n// }\n\n\n// function sha256( value ) {\n// var hash;\n// //my_exec(\"echo - n '\" + value + \"' | openssl dgst - sha256 | awk '{print $2}'\", function (stdout) {\n// //my_exec(\"echo - n 88\" + value + \"\", function (stdout) {\n// my_exec(\"openssl --help\", function (stdout) {\n// node.warn(`stdout: ${stdout}`);\n// return String(stdout).replace(/\\s/g, '');\n// })\n\n// //return String(hash);\n// }\n\nfunction Sanitize( value ) {\n\n value = String(value).toLowerCase();\n\n var keep = \"abcdefghijklmnopqrstuvwxyz0123456789 \";\n const allowed = new Set(keep.split(\"\"));\n\n value = value\n .split(\"\")\n .filter(char => allowed.has(char))\n .join(\"\");\n\n\n return String(value);\n}\n\n\nfor (var i = 1; i < 4; i++) {\n\n //let key = keys[i];\n\n msg.cleaned += String(\n '{\"question\": \"' + Sanitize(msg.http.form['q' + String(i)]) + \n '\", \"answer\": \"$(echo -n ' + Sanitize(msg.http.form['a' + String(i)]).replace(' ', '') + ' | openssl dgst -sha256 | awk \\'{print $2}\\')\" }');\n\n if( i < 3) {\n msg.cleaned += String(',')\n }\n\n}\n\nmsg.payload = msg.cleaned + \"]\\n\\nEOF\";\n\ndelete msg.cleaned;\n\nreturn msg;",
|
|
"outputs": 1,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [
|
|
{
|
|
"var": "childProcess",
|
|
"module": "child_process"
|
|
}
|
|
],
|
|
"x": 530,
|
|
"y": 240,
|
|
"wires": [
|
|
[
|
|
"e9f50265154e4b83"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "e9f50265154e4b83",
|
|
"type": "exec",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "3b96ab15b1a54e33",
|
|
"command": "",
|
|
"addpay": "payload",
|
|
"append": "",
|
|
"useSpawn": "false",
|
|
"timer": "",
|
|
"winHide": false,
|
|
"oldrc": false,
|
|
"name": "Expand bash variables",
|
|
"x": 760,
|
|
"y": 240,
|
|
"wires": [
|
|
[
|
|
"1e3c2b23420d6e40"
|
|
],
|
|
[],
|
|
[
|
|
"629b7df0515c7d83"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "1e3c2b23420d6e40",
|
|
"type": "json",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "3b96ab15b1a54e33",
|
|
"name": "",
|
|
"property": "payload",
|
|
"action": "obj",
|
|
"pretty": false,
|
|
"x": 970,
|
|
"y": 200,
|
|
"wires": [
|
|
[
|
|
"fba98a197970c6ee"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "cee76f9f914dd0fa",
|
|
"type": "function",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "3b96ab15b1a54e33",
|
|
"name": "Response message",
|
|
"func": "msg.payload = 'Your Password Questions have been saved';\n\nreturn msg;",
|
|
"outputs": 1,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 2140,
|
|
"y": 200,
|
|
"wires": [
|
|
[
|
|
"96836f5a4c7c756c",
|
|
"8b70b96b1f62a785"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "fba98a197970c6ee",
|
|
"type": "json",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "3b96ab15b1a54e33",
|
|
"name": "",
|
|
"property": "payload",
|
|
"action": "str",
|
|
"pretty": false,
|
|
"x": 1070,
|
|
"y": 200,
|
|
"wires": [
|
|
[
|
|
"6ec9911b7ad7d042"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "edf62fa2ca3cd812",
|
|
"type": "file",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "3b96ab15b1a54e33",
|
|
"name": "Save Questions",
|
|
"filename": "filename",
|
|
"filenameType": "msg",
|
|
"appendNewline": true,
|
|
"createDir": false,
|
|
"overwriteFile": "true",
|
|
"encoding": "utf8",
|
|
"x": 1840,
|
|
"y": 200,
|
|
"wires": [
|
|
[
|
|
"5210f540af1eb2e5"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "5210f540af1eb2e5",
|
|
"type": "change",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "3b96ab15b1a54e33",
|
|
"name": "Cleanup",
|
|
"rules": [
|
|
{
|
|
"t": "delete",
|
|
"p": "rc",
|
|
"pt": "msg"
|
|
},
|
|
{
|
|
"t": "delete",
|
|
"p": "payload",
|
|
"pt": "msg"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 1980,
|
|
"y": 200,
|
|
"wires": [
|
|
[
|
|
"cee76f9f914dd0fa"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "96836f5a4c7c756c",
|
|
"type": "link out",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "3b96ab15b1a54e33",
|
|
"name": "HTTP Response",
|
|
"mode": "link",
|
|
"links": [
|
|
"7db929503cf13635"
|
|
],
|
|
"x": 2320,
|
|
"y": 200,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "6ec9911b7ad7d042",
|
|
"type": "function",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "3b96ab15b1a54e33",
|
|
"name": "Fetch: User Name",
|
|
"func": "msg.user = 'john.smith';\nmsg.file_contents = msg.payload;\n\n//msg.payload = 'echo -n $(echo -n ' + msg.user + '| sha256sum) | awk \\'{print $1 }\\'';\n\nreturn msg;",
|
|
"outputs": 1,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 1210,
|
|
"y": 200,
|
|
"wires": [
|
|
[
|
|
"3f128f23d72e0492",
|
|
"7ce13238fa87d636"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "3f128f23d72e0492",
|
|
"type": "link call",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "3b96ab15b1a54e33",
|
|
"name": "",
|
|
"links": [
|
|
"8c13bbcc86d93be8"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 1430,
|
|
"y": 200,
|
|
"wires": [
|
|
[
|
|
"05accf0d9a6f0aa8"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "7ce13238fa87d636",
|
|
"type": "debug",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "3b96ab15b1a54e33",
|
|
"name": "Fetch: UserName",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1450,
|
|
"y": 160,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "8b70b96b1f62a785",
|
|
"type": "debug",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "3b96ab15b1a54e33",
|
|
"name": "debug 94",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 2340,
|
|
"y": 160,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "311e184a2397eb19",
|
|
"type": "ldap-search in",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "4cdebccc4a1f08ed",
|
|
"name": "Find LDAP User",
|
|
"ldap": "160d0b5ed597dc51",
|
|
"baseDn": "dc=nww",
|
|
"searchScope": "sub",
|
|
"filter": "",
|
|
"attributes": "dn,cn,givenName,sn,uid,mail",
|
|
"x": 980,
|
|
"y": 580,
|
|
"wires": [
|
|
[
|
|
"fe1f0a50300d9224"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "faa5e7380a3092a2",
|
|
"type": "template",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "4cdebccc4a1f08ed",
|
|
"name": "Create LDAP Search Filter",
|
|
"field": "filter",
|
|
"fieldType": "msg",
|
|
"format": "handlebars",
|
|
"syntax": "mustache",
|
|
"template": "(&(objectclass=*)(givenName={{ session.user.fname }})(sn={{ session.user.lname }})(uid={{ session.user.username }})(mail={{ session.user.mail }}))",
|
|
"output": "str",
|
|
"x": 760,
|
|
"y": 580,
|
|
"wires": [
|
|
[
|
|
"311e184a2397eb19"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "fe1f0a50300d9224",
|
|
"type": "switch",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "4cdebccc4a1f08ed",
|
|
"name": "User Found",
|
|
"property": "$count(msg.payload)",
|
|
"propertyType": "jsonata",
|
|
"rules": [
|
|
{
|
|
"t": "eq",
|
|
"v": "1\t",
|
|
"vt": "num"
|
|
},
|
|
{
|
|
"t": "else"
|
|
}
|
|
],
|
|
"checkall": "false",
|
|
"repair": false,
|
|
"outputs": 2,
|
|
"x": 1130,
|
|
"y": 580,
|
|
"wires": [
|
|
[
|
|
"04818ddd8782b0a1"
|
|
],
|
|
[
|
|
"0308c42b587c3794"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "b10e8a45ff44f80d",
|
|
"type": "link out",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "4cdebccc4a1f08ed",
|
|
"name": "LDAP: User Found",
|
|
"mode": "link",
|
|
"links": [
|
|
"4a4676456c27f256"
|
|
],
|
|
"x": 2070,
|
|
"y": 560,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "0308c42b587c3794",
|
|
"type": "link out",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "4cdebccc4a1f08ed",
|
|
"name": "Response: Invalid User",
|
|
"mode": "link",
|
|
"links": [
|
|
"72721ec69edf230f"
|
|
],
|
|
"x": 1350,
|
|
"y": 600,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "cdde8116fcac6e5d",
|
|
"type": "link in",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "02dc457b6549ba4e",
|
|
"name": "Process: Password Reset",
|
|
"links": [
|
|
"b7fde07e47cc852e"
|
|
],
|
|
"x": 290,
|
|
"y": 420,
|
|
"wires": [
|
|
[
|
|
"f0a7ae298ec9e423",
|
|
"0354e185d6df3087"
|
|
]
|
|
],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "72721ec69edf230f",
|
|
"type": "link in",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "aea0a3398dafab4c",
|
|
"name": "Respond: Invalid User",
|
|
"links": [
|
|
"0308c42b587c3794",
|
|
"58d1108b52842808",
|
|
"c7b7522a20abbb47"
|
|
],
|
|
"x": 2340,
|
|
"y": 1040,
|
|
"wires": [
|
|
[
|
|
"8eca6e69b809790c"
|
|
]
|
|
],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "8eca6e69b809790c",
|
|
"type": "function",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "aea0a3398dafab4c",
|
|
"name": "Give impression of success",
|
|
"func": "msg.payload = 'Your Password has been reset';\n\nreturn msg;",
|
|
"outputs": 1,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 2580,
|
|
"y": 1040,
|
|
"wires": [
|
|
[
|
|
"4cdbeaa8f5f3ddb7",
|
|
"23439ba609bdc6d9"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "4cdbeaa8f5f3ddb7",
|
|
"type": "link out",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "a9d52eb951c5f037",
|
|
"name": "Response",
|
|
"mode": "link",
|
|
"links": [
|
|
"7db929503cf13635"
|
|
],
|
|
"x": 2840,
|
|
"y": 940,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "4a4676456c27f256",
|
|
"type": "link in",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "9926c0ba3f91aca8",
|
|
"name": "ITSM: Search for User",
|
|
"links": [
|
|
"b10e8a45ff44f80d"
|
|
],
|
|
"x": 700,
|
|
"y": 740,
|
|
"wires": [
|
|
[
|
|
"a43bd1f944ef851c"
|
|
]
|
|
],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "a43bd1f944ef851c",
|
|
"type": "switch",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "9926c0ba3f91aca8",
|
|
"name": "Conduct ITSM Search?",
|
|
"property": "config.itsm.search",
|
|
"propertyType": "global",
|
|
"rules": [
|
|
{
|
|
"t": "true"
|
|
},
|
|
{
|
|
"t": "false"
|
|
}
|
|
],
|
|
"checkall": "false",
|
|
"repair": false,
|
|
"outputs": 2,
|
|
"x": 910,
|
|
"y": 740,
|
|
"wires": [
|
|
[
|
|
"bc29c53d4ef04184"
|
|
],
|
|
[
|
|
"dbeedddce12963de"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "eeb2b5a4e44d0c24",
|
|
"type": "link call",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "9926c0ba3f91aca8",
|
|
"name": "",
|
|
"links": [
|
|
"b8c9f1cf125efd2e"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 1350,
|
|
"y": 720,
|
|
"wires": [
|
|
[
|
|
"445623ba528e5df1"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "04818ddd8782b0a1",
|
|
"type": "change",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "4cdebccc4a1f08ed",
|
|
"name": "",
|
|
"rules": [
|
|
{
|
|
"t": "move",
|
|
"p": "payload[0]",
|
|
"pt": "msg",
|
|
"to": "ldap",
|
|
"tot": "msg"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 1340,
|
|
"y": 560,
|
|
"wires": [
|
|
[
|
|
"c66c2a0c3817433c"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "bc29c53d4ef04184",
|
|
"type": "template",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "9926c0ba3f91aca8",
|
|
"name": "ITSM User SearchData",
|
|
"field": "payload",
|
|
"fieldType": "msg",
|
|
"format": "json",
|
|
"syntax": "mustache",
|
|
"template": "{\n \"data\": {\n \"givenName\": \"{{ ldap.givenName }}\",\n \"sn\": \"{{ ldap.sn }}\",\n \"uid\": \"{{ ldap.uid }}\"\n },\n \"action\": \"search\",\n \"action_for\": \"user\"\n}",
|
|
"output": "json",
|
|
"x": 1190,
|
|
"y": 720,
|
|
"wires": [
|
|
[
|
|
"eeb2b5a4e44d0c24"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "b1bc2e62654b04e2",
|
|
"type": "function",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "82ccba0e0a13970a",
|
|
"name": "return msg.payload to client",
|
|
"func": "msg.payload = msg.payload = 'Your Password has been reset, dont forget to take note of the first half of your password!!';\nreturn msg;\n",
|
|
"outputs": 1,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 2580,
|
|
"y": 940,
|
|
"wires": [
|
|
[
|
|
"4cdbeaa8f5f3ddb7",
|
|
"23439ba609bdc6d9"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "f125e4c474dd2e5c",
|
|
"type": "link in",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "82ccba0e0a13970a",
|
|
"name": "Respond: Success",
|
|
"links": [
|
|
"07ed8c85583c5a2e"
|
|
],
|
|
"x": 2330,
|
|
"y": 940,
|
|
"wires": [
|
|
[
|
|
"b1bc2e62654b04e2"
|
|
]
|
|
],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "68628b6f32ec8b74",
|
|
"type": "link out",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "9926c0ba3f91aca8",
|
|
"name": "LDAP: User Found",
|
|
"mode": "link",
|
|
"links": [
|
|
"1a29880acc851ff5"
|
|
],
|
|
"x": 1910,
|
|
"y": 740,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "dbeedddce12963de",
|
|
"type": "link out",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "9926c0ba3f91aca8",
|
|
"name": "Continue",
|
|
"mode": "link",
|
|
"links": [
|
|
"073709e754dd98a3"
|
|
],
|
|
"x": 1140,
|
|
"y": 760,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "1a29880acc851ff5",
|
|
"type": "link in",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "d1b4f7ad9e8ea4f0",
|
|
"name": "ITSM: Create Ticket",
|
|
"links": [
|
|
"68628b6f32ec8b74"
|
|
],
|
|
"x": 950,
|
|
"y": 880,
|
|
"wires": [
|
|
[
|
|
"dce8db9b841faf7f"
|
|
]
|
|
],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "dce8db9b841faf7f",
|
|
"type": "switch",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "d1b4f7ad9e8ea4f0",
|
|
"name": "Create Ticket?",
|
|
"property": "config.itsm.create_ticket",
|
|
"propertyType": "global",
|
|
"rules": [
|
|
{
|
|
"t": "true"
|
|
},
|
|
{
|
|
"t": "false"
|
|
}
|
|
],
|
|
"checkall": "false",
|
|
"repair": false,
|
|
"outputs": 2,
|
|
"x": 1120,
|
|
"y": 880,
|
|
"wires": [
|
|
[
|
|
"93434028042529b8"
|
|
],
|
|
[
|
|
"ad66e8c05ee9a664"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "ad66e8c05ee9a664",
|
|
"type": "link out",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "d1b4f7ad9e8ea4f0",
|
|
"name": "Continue",
|
|
"mode": "link",
|
|
"links": [
|
|
"073709e754dd98a3"
|
|
],
|
|
"x": 1300,
|
|
"y": 900,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "93434028042529b8",
|
|
"type": "template",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "d1b4f7ad9e8ea4f0",
|
|
"name": "ITSM Ticket Data",
|
|
"field": "payload",
|
|
"fieldType": "msg",
|
|
"format": "json",
|
|
"syntax": "mustache",
|
|
"template": "{\n \"data\": {\n \"task\": {\n \"body\": {\n \"name\": \"LDAP Password Reset\",\n \"human_task_duration\": {{ global.config.itsm.human_task_duration_time }},\n \"platform\": \"NodeRed\",\n \"details\": {\n \"url\": \"{{{ req.url }}}\",\n \"client_address\": \"{{{ req.connection.remoteAddress }}}\",\n \"request_method\": \"{{{ req.method }}}\"\n },\n \"form\": {\n \"fname\": \"{{{ http.form.givenName }}}\",\n \"lname\": \"{{{ http.form.sn }}}\",\n \"mail\": \"{{{ http.form.mail }}}\",\n \"username\": \"{{{ http.form.uid }}}\"\n }\n },\n \"category\": 6\n },\n \"ticket\": {\n \"approval_required\": {{ global.config.itsm.ticket.approval_required }},\n \"category_id\": {{ global.config.itsm.ticket.category_id }},\n \"entity_id\": {{ global.config.itsm.ticket.entity_id }},\n \"requester_id\": {{ itsm.user.id }},\n \"requesttype_id\":{{ global.config.itsm.ticket.requesttype_id }},\n \"task_category_id\": {{ global.config.itsm.ticket.task_category_id }}\n }\n \n },\n \"platform\": \"{{ global.config.itsm.platform }}\",\n \"action\": \"create\",\n \"action_for\": \"ticket\"\n}\n",
|
|
"output": "json",
|
|
"x": 1330,
|
|
"y": 860,
|
|
"wires": [
|
|
[
|
|
"00066fdae59433b8"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "8dd7c0779eac59f0",
|
|
"type": "link out",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "d1b4f7ad9e8ea4f0",
|
|
"name": "Ticket Created",
|
|
"mode": "link",
|
|
"links": [
|
|
"073709e754dd98a3"
|
|
],
|
|
"x": 1640,
|
|
"y": 860,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "00066fdae59433b8",
|
|
"type": "link call",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "d1b4f7ad9e8ea4f0",
|
|
"name": "",
|
|
"links": [
|
|
"b8c9f1cf125efd2e"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 1510,
|
|
"y": 860,
|
|
"wires": [
|
|
[
|
|
"8dd7c0779eac59f0"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "445623ba528e5df1",
|
|
"type": "switch",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "9926c0ba3f91aca8",
|
|
"name": "Found User",
|
|
"property": "payload",
|
|
"propertyType": "msg",
|
|
"rules": [
|
|
{
|
|
"t": "hask",
|
|
"v": "id",
|
|
"vt": "str"
|
|
},
|
|
{
|
|
"t": "else"
|
|
}
|
|
],
|
|
"checkall": "false",
|
|
"repair": false,
|
|
"outputs": 2,
|
|
"x": 1470,
|
|
"y": 720,
|
|
"wires": [
|
|
[
|
|
"f6fc2010d0af1e33"
|
|
],
|
|
[
|
|
"58d1108b52842808"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "58d1108b52842808",
|
|
"type": "link out",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "9926c0ba3f91aca8",
|
|
"name": "Response: Invalid User",
|
|
"mode": "link",
|
|
"links": [
|
|
"72721ec69edf230f"
|
|
],
|
|
"x": 1690,
|
|
"y": 760,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "f6fc2010d0af1e33",
|
|
"type": "change",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "9926c0ba3f91aca8",
|
|
"name": "Store User Data",
|
|
"rules": [
|
|
{
|
|
"t": "move",
|
|
"p": "payload",
|
|
"pt": "msg",
|
|
"to": "itsm.user",
|
|
"tot": "msg"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 1660,
|
|
"y": 700,
|
|
"wires": [
|
|
[
|
|
"68628b6f32ec8b74",
|
|
"07ed8c85583c5a2e"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "853e6c15b5317007",
|
|
"type": "ldap-update in",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "d0dc259791aed430",
|
|
"name": "Update Password",
|
|
"ldap": "160d0b5ed597dc51",
|
|
"operation": "replace",
|
|
"dn": "",
|
|
"attribute": "userPassword",
|
|
"value": "",
|
|
"x": 1450,
|
|
"y": 1020,
|
|
"wires": [
|
|
[
|
|
"9090daaf8a5892b0"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "073709e754dd98a3",
|
|
"type": "link in",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "d0dc259791aed430",
|
|
"name": "LDAP: Update Password",
|
|
"links": [
|
|
"8dd7c0779eac59f0",
|
|
"ad66e8c05ee9a664",
|
|
"dbeedddce12963de"
|
|
],
|
|
"x": 710,
|
|
"y": 1020,
|
|
"wires": [
|
|
[
|
|
"c710ba5a1416cfd8"
|
|
]
|
|
],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "142f9ce43cb63dd7",
|
|
"type": "link call",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "d0dc259791aed430",
|
|
"name": "Convert Password to LDAP Hashed Password",
|
|
"links": [
|
|
"c19ba5f86ea40757"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 1180,
|
|
"y": 1020,
|
|
"wires": [
|
|
[
|
|
"853e6c15b5317007"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "c66c2a0c3817433c",
|
|
"type": "link call",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "4cdebccc4a1f08ed",
|
|
"name": "Fetch Second half of password",
|
|
"links": [
|
|
"869469819396a632"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 1610,
|
|
"y": 560,
|
|
"wires": [
|
|
[
|
|
"c08e353c85cde934"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "c710ba5a1416cfd8",
|
|
"type": "change",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "d0dc259791aed430",
|
|
"name": "Prepare LDAP data",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "payload",
|
|
"pt": "msg",
|
|
"to": "$string(msg.req.body.random & msg.password_second_half)",
|
|
"tot": "jsonata"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "dn",
|
|
"pt": "msg",
|
|
"to": "ldap.dn",
|
|
"tot": "msg"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 910,
|
|
"y": 1020,
|
|
"wires": [
|
|
[
|
|
"142f9ce43cb63dd7"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "ec52cbc3aa0fec25",
|
|
"type": "debug",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "d0dc259791aed430",
|
|
"name": "LDAP Error",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1870,
|
|
"y": 1040,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "9090daaf8a5892b0",
|
|
"type": "switch",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "d0dc259791aed430",
|
|
"name": "LDAP: Changed?",
|
|
"property": "ldapStatus.success",
|
|
"propertyType": "msg",
|
|
"rules": [
|
|
{
|
|
"t": "true"
|
|
},
|
|
{
|
|
"t": "false"
|
|
}
|
|
],
|
|
"checkall": "false",
|
|
"repair": false,
|
|
"outputs": 2,
|
|
"x": 1630,
|
|
"y": 1020,
|
|
"wires": [
|
|
[
|
|
"13711f1826f83198"
|
|
],
|
|
[
|
|
"ec52cbc3aa0fec25"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "07ed8c85583c5a2e",
|
|
"type": "link out",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "9926c0ba3f91aca8",
|
|
"name": "Respond to User",
|
|
"mode": "link",
|
|
"links": [
|
|
"f125e4c474dd2e5c"
|
|
],
|
|
"x": 1910,
|
|
"y": 700,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "c08e353c85cde934",
|
|
"type": "change",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "4cdebccc4a1f08ed",
|
|
"name": "msg.password_second_half",
|
|
"rules": [
|
|
{
|
|
"t": "move",
|
|
"p": "payload",
|
|
"pt": "msg",
|
|
"to": "password_second_half",
|
|
"tot": "msg"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 1860,
|
|
"y": 560,
|
|
"wires": [
|
|
[
|
|
"b10e8a45ff44f80d"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "13711f1826f83198",
|
|
"type": "debug",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "d0dc259791aed430",
|
|
"name": "LDAP Success",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1880,
|
|
"y": 1000,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "05accf0d9a6f0aa8",
|
|
"type": "function",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "3b96ab15b1a54e33",
|
|
"name": "Flow Data",
|
|
"func": "\nmsg.payload = msg.file_contents;\n\ndelete msg.file_contents;\n\nreturn msg;",
|
|
"outputs": 1,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 1660,
|
|
"y": 200,
|
|
"wires": [
|
|
[
|
|
"edf62fa2ca3cd812"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "1df8ab6bb55ff621",
|
|
"type": "link in",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "dba3741d6cc275c9",
|
|
"name": "Process: Password Change",
|
|
"links": [
|
|
"64c99b312f9c601c"
|
|
],
|
|
"x": 300,
|
|
"y": 1220,
|
|
"wires": [
|
|
[
|
|
"98364b7271054017"
|
|
]
|
|
],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "6ef14d9fb582d42e",
|
|
"type": "template",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "f8ec4a6290dc7e20",
|
|
"name": "Create LDAP Search Filter",
|
|
"field": "filter",
|
|
"fieldType": "msg",
|
|
"format": "handlebars",
|
|
"syntax": "mustache",
|
|
"template": "(&(objectclass=*)(cn={{ session.user.fname }} {{ session.user.lname }})(givenName={{ session.user.fname }})(sn={{ session.user.lname }})(uid={{ session.user.username }})(mail={{ session.user.mail }}))",
|
|
"output": "str",
|
|
"x": 1460,
|
|
"y": 1220,
|
|
"wires": [
|
|
[
|
|
"30264cfad476079a"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "30264cfad476079a",
|
|
"type": "ldap-search in",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "f8ec4a6290dc7e20",
|
|
"name": "Find LDAP User",
|
|
"ldap": "160d0b5ed597dc51",
|
|
"baseDn": "dc=nww",
|
|
"searchScope": "sub",
|
|
"filter": "",
|
|
"attributes": "dn,cn,givenName,sn,uid,mail,userpassword",
|
|
"x": 1680,
|
|
"y": 1220,
|
|
"wires": [
|
|
[
|
|
"53fce6f461eec779"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "f0a7ae298ec9e423",
|
|
"type": "debug",
|
|
"z": "4b5e055cd6b1e387",
|
|
"name": "debug 115",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 690,
|
|
"y": 340,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "0354e185d6df3087",
|
|
"type": "function",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "02dc457b6549ba4e",
|
|
"name": "Form and user details must match",
|
|
"func": "var success = null;\nvar failure = null;\n\nnode.status({fill:\"yellow\",shape:\"ring\",text:\"User Details Dont match\"});\n\nif(\n msg.session.user.username == msg.req.body.uid &&\n msg.session.user.fname == msg.req.body.givenName &&\n msg.session.user.lname == msg.req.body.sn &&\n msg.session.user.mail == msg.req.body.mail\n) {\n node.status({ fill: \"green\", shape: \"dot\", text: \"User Details match\" });\n\n success = msg;\n}\n\nnode.send([\n success,\n failure\n]);",
|
|
"outputs": 2,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 560,
|
|
"y": 420,
|
|
"wires": [
|
|
[
|
|
"3e44bc1a5e60ec3d"
|
|
],
|
|
[
|
|
"c7b7522a20abbb47"
|
|
]
|
|
],
|
|
"outputLabels": [
|
|
"Success",
|
|
"Failure"
|
|
],
|
|
"icon": "font-awesome/fa-question"
|
|
},
|
|
{
|
|
"id": "c7b7522a20abbb47",
|
|
"type": "link out",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "02dc457b6549ba4e",
|
|
"name": "User details don't match",
|
|
"mode": "link",
|
|
"links": [
|
|
"72721ec69edf230f"
|
|
],
|
|
"x": 890,
|
|
"y": 460,
|
|
"wires": [],
|
|
"icon": "font-awesome/fa-hand-stop-o",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "3e44bc1a5e60ec3d",
|
|
"type": "link out",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "02dc457b6549ba4e",
|
|
"name": "Process Form: Password Reset",
|
|
"mode": "link",
|
|
"links": [
|
|
"5cfc1e5277013397"
|
|
],
|
|
"x": 970,
|
|
"y": 400,
|
|
"wires": [],
|
|
"icon": "font-awesome/fa-check",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "5cfc1e5277013397",
|
|
"type": "link in",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "4cdebccc4a1f08ed",
|
|
"name": "LDAP: User Search",
|
|
"links": [
|
|
"3e44bc1a5e60ec3d"
|
|
],
|
|
"x": 550,
|
|
"y": 580,
|
|
"wires": [
|
|
[
|
|
"faa5e7380a3092a2"
|
|
]
|
|
],
|
|
"icon": "node-red/arrow-in.svg",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "23439ba609bdc6d9",
|
|
"type": "debug",
|
|
"z": "4b5e055cd6b1e387",
|
|
"name": "debug 116",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 3170,
|
|
"y": 980,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "53fce6f461eec779",
|
|
"type": "function",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "f8ec4a6290dc7e20",
|
|
"name": "Process LDAP Search",
|
|
"func": "var found = null;\nvar not_found = null;\n\ndelete msg.filter;\ndelete msg._event;\n\nnode.status({fill:\"red\",shape:\"ring\",text:\"No User Found\"});\n\n\nif( Array(msg.payload).length > 0 ) {\n\n msg.ldap = msg.payload[0];\n found = msg;\n node.status({ fill: \"green\", shape: \"ring\", text: \"User Found\" });\n\n}\n\n\nnode.send([\n found,\n not_found,\n]);",
|
|
"outputs": 2,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 1880,
|
|
"y": 1220,
|
|
"wires": [
|
|
[
|
|
"1619699cd34defb4"
|
|
],
|
|
[
|
|
"815ce9e0380e642f"
|
|
]
|
|
],
|
|
"outputLabels": [
|
|
"Found User",
|
|
"No User Found"
|
|
],
|
|
"icon": "font-awesome/fa-question"
|
|
},
|
|
{
|
|
"id": "98364b7271054017",
|
|
"type": "function",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "dba3741d6cc275c9",
|
|
"name": "Form and user details must match",
|
|
"func": "var success = null;\nvar failure = null;\n\nvar status_colour = 'red';\nvar status_text = 'Validation did not complete';\n\n\nif( msg.req.body.c_password == '' ) {\n\n status_colour = 'yellow';\n status_text =\"Missing current password\";\n\n failure = msg;\n}\n\nif( msg.req.body.n_password_1 != msg.req.body.n_password_2 ) {\n\n status_colour = 'yellow';\n status_text = \"New password doesn't match\";\n\n failure = msg;\n\n}\n\nif( status_colour == 'red' ) {\n\n status_colour = 'green';\n status_text = \"form validation OK\";\n success = msg;\n\n}\n\nif (status_colour == 'yellow') {\n\n msg.payload = status_text;\n\n}\n\nnode.status({ fill: status_colour, shape: \"ring\", text: status_text });\n\nnode.send([\n success,\n failure\n]);",
|
|
"outputs": 2,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 640,
|
|
"y": 1220,
|
|
"wires": [
|
|
[
|
|
"0239e19c34a9baaa"
|
|
],
|
|
[
|
|
"0efd3333091c9999"
|
|
]
|
|
],
|
|
"outputLabels": [
|
|
"Success",
|
|
"Failure"
|
|
],
|
|
"icon": "font-awesome/fa-question"
|
|
},
|
|
{
|
|
"id": "a6c8721721fc267e",
|
|
"type": "link out",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "3b247f5e5d90963e",
|
|
"name": "Response",
|
|
"mode": "link",
|
|
"links": [
|
|
"7db929503cf13635"
|
|
],
|
|
"x": 4740,
|
|
"y": 1320,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "b75415bd2541b6df",
|
|
"type": "link in",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "3b247f5e5d90963e",
|
|
"name": "Complete: Password Change",
|
|
"links": [
|
|
"0efd3333091c9999",
|
|
"815ce9e0380e642f",
|
|
"f17566766d0b5a53",
|
|
"53df7c8ab13e33de",
|
|
"f093762ba0afe7d2"
|
|
],
|
|
"x": 4560,
|
|
"y": 1320,
|
|
"wires": [
|
|
[
|
|
"a6c8721721fc267e"
|
|
]
|
|
],
|
|
"icon": "font-awesome/fa-flag-checkered",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "0efd3333091c9999",
|
|
"type": "link out",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "dba3741d6cc275c9",
|
|
"name": "Failed",
|
|
"mode": "link",
|
|
"links": [
|
|
"b75415bd2541b6df"
|
|
],
|
|
"x": 890,
|
|
"y": 1240,
|
|
"wires": [],
|
|
"icon": "font-awesome/fa-exclamation-circle",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "553d0da331015252",
|
|
"type": "link in",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "f8ec4a6290dc7e20",
|
|
"name": "Process: Password Change",
|
|
"links": [
|
|
"0239e19c34a9baaa"
|
|
],
|
|
"x": 1220,
|
|
"y": 1220,
|
|
"wires": [
|
|
[
|
|
"6ef14d9fb582d42e"
|
|
]
|
|
],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "0239e19c34a9baaa",
|
|
"type": "link out",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "dba3741d6cc275c9",
|
|
"name": "Success",
|
|
"mode": "link",
|
|
"links": [
|
|
"553d0da331015252"
|
|
],
|
|
"x": 880,
|
|
"y": 1200,
|
|
"wires": [],
|
|
"icon": "font-awesome/fa-check-circle",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "c57cf198943aef16",
|
|
"type": "link in",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "1e614fa32322f125",
|
|
"name": "Continue: Check Passwords",
|
|
"links": [
|
|
"1619699cd34defb4"
|
|
],
|
|
"x": 2360,
|
|
"y": 1220,
|
|
"wires": [
|
|
[
|
|
"aab2d165deacdab6"
|
|
]
|
|
],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "abef97c0bb13b432",
|
|
"type": "link call",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "1e614fa32322f125",
|
|
"name": "",
|
|
"links": [
|
|
"c19ba5f86ea40757"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 2830,
|
|
"y": 1220,
|
|
"wires": [
|
|
[
|
|
"23292bc7d78b9d1d"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "aab2d165deacdab6",
|
|
"type": "change",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "1e614fa32322f125",
|
|
"name": "Convert current password",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "payload",
|
|
"pt": "msg",
|
|
"to": "req.body.c_password",
|
|
"tot": "msg"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "item",
|
|
"pt": "msg",
|
|
"to": "c_password",
|
|
"tot": "str"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 2590,
|
|
"y": 1220,
|
|
"wires": [
|
|
[
|
|
"abef97c0bb13b432"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "1619699cd34defb4",
|
|
"type": "link out",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "f8ec4a6290dc7e20",
|
|
"name": "Success",
|
|
"mode": "link",
|
|
"links": [
|
|
"c57cf198943aef16"
|
|
],
|
|
"x": 2060,
|
|
"y": 1200,
|
|
"wires": [],
|
|
"icon": "font-awesome/fa-check-circle",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "815ce9e0380e642f",
|
|
"type": "link out",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "f8ec4a6290dc7e20",
|
|
"name": "Failed",
|
|
"mode": "link",
|
|
"links": [
|
|
"b75415bd2541b6df"
|
|
],
|
|
"x": 2070,
|
|
"y": 1240,
|
|
"wires": [],
|
|
"icon": "font-awesome/fa-exclamation-circle",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "23292bc7d78b9d1d",
|
|
"type": "function",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "1e614fa32322f125",
|
|
"name": "Check Current Password",
|
|
"func": "var success = null;\nvar failure = null;\n\n// delete msg.payload.n_password_1.item;\n// delete msg.payload.n_password_1.ldap;\n// delete msg.payload.n_password_1.rc;\n// delete msg.payload.n_password_1._event;\n\n//var new_msg = msg.payload.n_password_1;\n// var new_msg = {};\n\n// new_msg.req = msg.payload.c_password.req;\n// new_msg.res = msg.payload.c_password.res;\n// new_msg._msgid = msg.payload.c_password._msgid;\n// new_msg.ldap = msg.payload.c_password.ldap;\n// new_msg.cookies = msg.payload.c_password.cookies;\n\nif ( msg.payload == msg.ldap.userPassword ) {\n\n node.status({fill:\"green\",shape:\"ring\",text:\"Current Password Matches\"});\n\n success = msg;\n\n} else {\n\n msg.payload = String(\"Current Password Incorrect\");\n\n node.status({ fill: \"yellow\", shape: \"ring\", text: msg.payload });\n\n failure = msg;\n\n}\n\nnode.send([\n success,\n failure\n]);\n",
|
|
"outputs": 2,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 3090,
|
|
"y": 1220,
|
|
"wires": [
|
|
[
|
|
"ffaae19e230436cf"
|
|
],
|
|
[
|
|
"f17566766d0b5a53"
|
|
]
|
|
],
|
|
"outputLabels": [
|
|
"Success",
|
|
"Failure"
|
|
],
|
|
"icon": "font-awesome/fa-lock",
|
|
"info": "# Check Current Password\n\nConfirm that the user entered password matches the current password store within LDAP.\n\nOutputs are:\n\n- success, password matches\n\n- failure, password does not matches\n"
|
|
},
|
|
{
|
|
"id": "f17566766d0b5a53",
|
|
"type": "link out",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "1e614fa32322f125",
|
|
"name": "Failed",
|
|
"mode": "link",
|
|
"links": [
|
|
"b75415bd2541b6df"
|
|
],
|
|
"x": 3290,
|
|
"y": 1240,
|
|
"wires": [],
|
|
"icon": "font-awesome/fa-exclamation-circle",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "ffaae19e230436cf",
|
|
"type": "link out",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "1e614fa32322f125",
|
|
"name": "Success",
|
|
"mode": "link",
|
|
"links": [
|
|
"5897178ac3448e41"
|
|
],
|
|
"x": 3280,
|
|
"y": 1200,
|
|
"wires": [],
|
|
"icon": "font-awesome/fa-unlock",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "5897178ac3448e41",
|
|
"type": "link in",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "0c16bf9634323276",
|
|
"name": "Change Users Password",
|
|
"links": [
|
|
"ffaae19e230436cf"
|
|
],
|
|
"x": 3530,
|
|
"y": 1220,
|
|
"wires": [
|
|
[
|
|
"f8b9e1b1537129ec"
|
|
]
|
|
],
|
|
"icon": "font-awesome/fa-rotate-right",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "e7fa19cf8785fd90",
|
|
"type": "ldap-update in",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "0c16bf9634323276",
|
|
"name": "Update Password",
|
|
"ldap": "160d0b5ed597dc51",
|
|
"operation": "replace",
|
|
"dn": "",
|
|
"attribute": "userPassword",
|
|
"value": "",
|
|
"x": 4290,
|
|
"y": 1220,
|
|
"wires": [
|
|
[
|
|
"7b9797b6bc354e56"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "f16ae7601e3dce19",
|
|
"type": "link call",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "0c16bf9634323276",
|
|
"name": "Convert Password to LDAP Hashed Password",
|
|
"links": [
|
|
"c19ba5f86ea40757"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 4000,
|
|
"y": 1220,
|
|
"wires": [
|
|
[
|
|
"e7fa19cf8785fd90"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "f8b9e1b1537129ec",
|
|
"type": "change",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "0c16bf9634323276",
|
|
"name": "Prepare LDAP data",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "payload",
|
|
"pt": "msg",
|
|
"to": "$string(msg.req.body.n_password_1)",
|
|
"tot": "jsonata"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "dn",
|
|
"pt": "msg",
|
|
"to": "ldap.dn",
|
|
"tot": "msg"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 3730,
|
|
"y": 1220,
|
|
"wires": [
|
|
[
|
|
"f16ae7601e3dce19"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "7b9797b6bc354e56",
|
|
"type": "function",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "0c16bf9634323276",
|
|
"name": "Check Current Password",
|
|
"func": "var success = null;\nvar failure = msg;\n\nvar status_colour = 'yellow';\nvar status_text = 'Failure, password not changed';\n\nmsg.payload = status_text;\n\nif (msg.ldapStatus.success ) {\n\n status_colour = 'green';\n status_text = \"Password Changed\";\n\n msg.payload = status_text;\n\n success = msg;\n failure = null;\n\n}\n\nnode.status({ fill: status_colour, shape: \"ring\", text: status_text });\n\nnode.send([\n success,\n failure\n]);\n",
|
|
"outputs": 2,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 4510,
|
|
"y": 1220,
|
|
"wires": [
|
|
[
|
|
"f093762ba0afe7d2"
|
|
],
|
|
[
|
|
"53df7c8ab13e33de"
|
|
]
|
|
],
|
|
"outputLabels": [
|
|
"Success",
|
|
"Failure"
|
|
],
|
|
"icon": "font-awesome/fa-question",
|
|
"info": "# Check Current Password\n\nConfirm that the user entered password matches the current password store within LDAP.\n\nOutputs are:\n\n- success, password matches\n\n- failure, password does not matches\n"
|
|
},
|
|
{
|
|
"id": "53df7c8ab13e33de",
|
|
"type": "link out",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "0c16bf9634323276",
|
|
"name": "Failed",
|
|
"mode": "link",
|
|
"links": [
|
|
"b75415bd2541b6df"
|
|
],
|
|
"x": 4730,
|
|
"y": 1240,
|
|
"wires": [],
|
|
"icon": "font-awesome/fa-exclamation-circle",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "f093762ba0afe7d2",
|
|
"type": "link out",
|
|
"z": "4b5e055cd6b1e387",
|
|
"g": "0c16bf9634323276",
|
|
"name": "Success",
|
|
"mode": "link",
|
|
"links": [
|
|
"b75415bd2541b6df"
|
|
],
|
|
"x": 4720,
|
|
"y": 1200,
|
|
"wires": [],
|
|
"icon": "font-awesome/fa-check-circle",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "0eeaba70b043a226",
|
|
"type": "exec",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "0d96945ec7d069cb",
|
|
"command": "",
|
|
"addpay": "payload",
|
|
"append": "",
|
|
"useSpawn": "false",
|
|
"timer": "1",
|
|
"winHide": false,
|
|
"oldrc": false,
|
|
"name": "Run Hash Command",
|
|
"x": 640,
|
|
"y": 140,
|
|
"wires": [
|
|
[
|
|
"540882a95f65754c"
|
|
],
|
|
[],
|
|
[]
|
|
]
|
|
},
|
|
{
|
|
"id": "9c9c7bbd71c78d8e",
|
|
"type": "function",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "0d96945ec7d069cb",
|
|
"name": "Create Hash Command",
|
|
"func": "\nmsg.payload = 'echo -n $(echo -n ' + msg.hash.string + '| ' + msg.hash.type + 'sum) | awk \\'{print $1 }\\' | tr -dc \\'A-Fa-f0-9\\'';\n\nreturn msg;",
|
|
"outputs": 1,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 390,
|
|
"y": 140,
|
|
"wires": [
|
|
[
|
|
"0eeaba70b043a226"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "43eebf1623f29074",
|
|
"type": "link in",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "0d96945ec7d069cb",
|
|
"name": "Hash String",
|
|
"links": [],
|
|
"x": 210,
|
|
"y": 140,
|
|
"wires": [
|
|
[
|
|
"9c9c7bbd71c78d8e"
|
|
]
|
|
],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "8fadd3c4294a6939",
|
|
"type": "link out",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "0d96945ec7d069cb",
|
|
"name": "Return",
|
|
"mode": "return",
|
|
"links": [],
|
|
"x": 1010,
|
|
"y": 120,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "540882a95f65754c",
|
|
"type": "function",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "0d96945ec7d069cb",
|
|
"name": "Save Hash Value",
|
|
"func": "msg.hash.value = msg.payload;\n\ndelete msg.payload;\n\nreturn msg;",
|
|
"outputs": 1,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 870,
|
|
"y": 120,
|
|
"wires": [
|
|
[
|
|
"8fadd3c4294a6939"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "8c13bbcc86d93be8",
|
|
"type": "link in",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "bcd2727d77a80ce3",
|
|
"name": "Hash: User-Questions-Filename",
|
|
"links": [],
|
|
"x": 270,
|
|
"y": 280,
|
|
"wires": [
|
|
[
|
|
"858268a5d48a4486"
|
|
]
|
|
],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "a35b8cc53c276d62",
|
|
"type": "link call",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "bcd2727d77a80ce3",
|
|
"name": "",
|
|
"links": [
|
|
"43eebf1623f29074"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 650,
|
|
"y": 280,
|
|
"wires": [
|
|
[
|
|
"0f2ff2f433d17eef"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "858268a5d48a4486",
|
|
"type": "function",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "bcd2727d77a80ce3",
|
|
"name": "Build: Hash Details",
|
|
"func": "msg.hash = {};\nmsg.hash.string = msg.user;\nmsg.hash.type = 'sha256';\n\nreturn msg;",
|
|
"outputs": 1,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 490,
|
|
"y": 280,
|
|
"wires": [
|
|
[
|
|
"a35b8cc53c276d62"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "998b007182d85455",
|
|
"type": "link out",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "bcd2727d77a80ce3",
|
|
"name": "Return",
|
|
"mode": "return",
|
|
"links": [],
|
|
"x": 950,
|
|
"y": 280,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "0f2ff2f433d17eef",
|
|
"type": "function",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "bcd2727d77a80ce3",
|
|
"name": "Build: Hash Details",
|
|
"func": "msg.filename = global.get('config.paths.user_data') + msg.hash.value + '.json'\n\nreturn msg;",
|
|
"outputs": 1,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 810,
|
|
"y": 280,
|
|
"wires": [
|
|
[
|
|
"998b007182d85455"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "804feccd90b3276c",
|
|
"type": "exec",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "10a6c6b12749dda9",
|
|
"command": "",
|
|
"addpay": "command",
|
|
"append": "",
|
|
"useSpawn": "false",
|
|
"timer": "1",
|
|
"winHide": false,
|
|
"oldrc": false,
|
|
"name": "Generate random xx char string",
|
|
"x": 750,
|
|
"y": 420,
|
|
"wires": [
|
|
[
|
|
"c4e40d6f6678bb55"
|
|
],
|
|
[
|
|
"c4e40d6f6678bb55",
|
|
"e62119d30db09cce"
|
|
],
|
|
[]
|
|
]
|
|
},
|
|
{
|
|
"id": "869469819396a632",
|
|
"type": "link in",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "10a6c6b12749dda9",
|
|
"name": "Generate random 6 char string",
|
|
"links": [],
|
|
"x": 270,
|
|
"y": 420,
|
|
"wires": [
|
|
[
|
|
"8e670403cf071aaf"
|
|
]
|
|
],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "c4e40d6f6678bb55",
|
|
"type": "link out",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "10a6c6b12749dda9",
|
|
"name": "Return",
|
|
"mode": "return",
|
|
"links": [],
|
|
"x": 1010,
|
|
"y": 400,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "e62119d30db09cce",
|
|
"type": "debug",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "10a6c6b12749dda9",
|
|
"name": "STDERR",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1020,
|
|
"y": 440,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "33d710f97adb5298",
|
|
"type": "http request",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "d7dbd3970c891c33",
|
|
"name": "User ITSM Search",
|
|
"method": "GET",
|
|
"ret": "txt",
|
|
"paytoqs": "body",
|
|
"url": "",
|
|
"tls": "",
|
|
"persist": false,
|
|
"proxy": "",
|
|
"insecureHTTPParser": false,
|
|
"authType": "",
|
|
"senderr": false,
|
|
"headers": [
|
|
{
|
|
"keyType": "Content-Type",
|
|
"keyValue": "",
|
|
"valueType": "application/json",
|
|
"valueValue": ""
|
|
}
|
|
],
|
|
"x": 990,
|
|
"y": 880,
|
|
"wires": [
|
|
[]
|
|
]
|
|
},
|
|
{
|
|
"id": "6aac3151138c4af9",
|
|
"type": "json",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "d7dbd3970c891c33",
|
|
"name": "",
|
|
"property": "payload",
|
|
"action": "obj",
|
|
"pretty": false,
|
|
"x": 1750,
|
|
"y": 980,
|
|
"wires": [
|
|
[
|
|
"a888a2ed9a053acc"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "b8c9f1cf125efd2e",
|
|
"type": "link in",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "9b1493c4ae19a935",
|
|
"name": "ITSM",
|
|
"links": [],
|
|
"x": 170,
|
|
"y": 700,
|
|
"wires": [
|
|
[
|
|
"f5cae04225998e3b"
|
|
]
|
|
],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "f5cae04225998e3b",
|
|
"type": "switch",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "9b1493c4ae19a935",
|
|
"name": "ITSM Platform",
|
|
"property": "config.itsm.platform",
|
|
"propertyType": "global",
|
|
"rules": [
|
|
{
|
|
"t": "eq",
|
|
"v": "glpi",
|
|
"vt": "str"
|
|
},
|
|
{
|
|
"t": "else"
|
|
}
|
|
],
|
|
"checkall": "false",
|
|
"repair": false,
|
|
"outputs": 2,
|
|
"x": 360,
|
|
"y": 700,
|
|
"wires": [
|
|
[
|
|
"002457f33834fc91"
|
|
],
|
|
[
|
|
"6840ab77f76439db"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "002457f33834fc91",
|
|
"type": "link call",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "9b1493c4ae19a935",
|
|
"name": "GLPI",
|
|
"links": [
|
|
"160bc27f7530e52d"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 590,
|
|
"y": 680,
|
|
"wires": [
|
|
[
|
|
"d4d1ce730aa1c15b"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "d4d1ce730aa1c15b",
|
|
"type": "link out",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "9b1493c4ae19a935",
|
|
"name": "Return",
|
|
"mode": "return",
|
|
"links": [],
|
|
"x": 730,
|
|
"y": 680,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "160bc27f7530e52d",
|
|
"type": "link in",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "9858d84dc9d001be",
|
|
"name": "GLPI",
|
|
"links": [],
|
|
"x": 310,
|
|
"y": 960,
|
|
"wires": [
|
|
[
|
|
"4cdb1540cd4c8744"
|
|
]
|
|
],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "269cbacf5274d6d8",
|
|
"type": "link out",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "d7dbd3970c891c33",
|
|
"name": "Return",
|
|
"mode": "return",
|
|
"links": [],
|
|
"x": 2090,
|
|
"y": 980,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "6840ab77f76439db",
|
|
"type": "debug",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "9b1493c4ae19a935",
|
|
"name": "ITSM Platform Doesn't exist",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 660,
|
|
"y": 720,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "42f157ed01b737f4",
|
|
"type": "change",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "d7dbd3970c891c33",
|
|
"name": "User",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "payload",
|
|
"pt": "msg",
|
|
"to": "payload.data",
|
|
"tot": "msg"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "url",
|
|
"pt": "msg",
|
|
"to": "http://nodered:1880/api/user",
|
|
"tot": "str"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 830,
|
|
"y": 980,
|
|
"wires": [
|
|
[
|
|
"a9cfd4c1413c7ec6"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "4cdb1540cd4c8744",
|
|
"type": "switch",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "9858d84dc9d001be",
|
|
"name": "Action",
|
|
"property": "payload.action",
|
|
"propertyType": "msg",
|
|
"rules": [
|
|
{
|
|
"t": "eq",
|
|
"v": "search",
|
|
"vt": "str"
|
|
},
|
|
{
|
|
"t": "eq",
|
|
"v": "create",
|
|
"vt": "str"
|
|
},
|
|
{
|
|
"t": "else"
|
|
}
|
|
],
|
|
"checkall": "false",
|
|
"repair": false,
|
|
"outputs": 3,
|
|
"x": 430,
|
|
"y": 960,
|
|
"wires": [
|
|
[
|
|
"0676d69c05236349"
|
|
],
|
|
[
|
|
"edbb6827a8b33085"
|
|
],
|
|
[]
|
|
]
|
|
},
|
|
{
|
|
"id": "0676d69c05236349",
|
|
"type": "switch",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "9858d84dc9d001be",
|
|
"name": "Search",
|
|
"property": "payload.action_for",
|
|
"propertyType": "msg",
|
|
"rules": [
|
|
{
|
|
"t": "eq",
|
|
"v": "user",
|
|
"vt": "str"
|
|
},
|
|
{
|
|
"t": "else"
|
|
}
|
|
],
|
|
"checkall": "false",
|
|
"repair": false,
|
|
"outputs": 2,
|
|
"x": 640,
|
|
"y": 940,
|
|
"wires": [
|
|
[
|
|
"42f157ed01b737f4"
|
|
],
|
|
[]
|
|
]
|
|
},
|
|
{
|
|
"id": "edbb6827a8b33085",
|
|
"type": "switch",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "9858d84dc9d001be",
|
|
"name": "Create",
|
|
"property": "payload.action_for",
|
|
"propertyType": "msg",
|
|
"rules": [
|
|
{
|
|
"t": "eq",
|
|
"v": "ticket",
|
|
"vt": "str"
|
|
},
|
|
{
|
|
"t": "else"
|
|
}
|
|
],
|
|
"checkall": "false",
|
|
"repair": false,
|
|
"outputs": 2,
|
|
"x": 630,
|
|
"y": 1040,
|
|
"wires": [
|
|
[
|
|
"d4de6eab89782579"
|
|
],
|
|
[]
|
|
]
|
|
},
|
|
{
|
|
"id": "d4de6eab89782579",
|
|
"type": "change",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "ed0645c12f7435b2",
|
|
"name": "Ticket",
|
|
"rules": [],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 830,
|
|
"y": 1100,
|
|
"wires": [
|
|
[
|
|
"246331e1c052e1f8"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "c6c63174053774b7",
|
|
"type": "change",
|
|
"z": "8179bf22c4c31682",
|
|
"name": "Build Command",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "payload",
|
|
"pt": "msg",
|
|
"to": "'echo -n \"{SHA512}$(echo -n \"$(echo -n ' & msg.payload &'| sha512sum)\" | xxd -r -p | openssl enc -base64 | tr -dc \"A-Za-z0-9+\\\\/=\")\"'",
|
|
"tot": "jsonata"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 1620,
|
|
"y": 360,
|
|
"wires": [
|
|
[
|
|
"0a8a08fff2cf8bc6",
|
|
"38ef027aea02e3b9"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "0a8a08fff2cf8bc6",
|
|
"type": "debug",
|
|
"z": "8179bf22c4c31682",
|
|
"name": "debug 51",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1800,
|
|
"y": 320,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "38ef027aea02e3b9",
|
|
"type": "exec",
|
|
"z": "8179bf22c4c31682",
|
|
"command": "",
|
|
"addpay": "payload",
|
|
"append": "",
|
|
"useSpawn": "false",
|
|
"timer": "",
|
|
"winHide": false,
|
|
"oldrc": false,
|
|
"name": "Generate LDAP Password String",
|
|
"x": 1880,
|
|
"y": 360,
|
|
"wires": [
|
|
[
|
|
"0041766d05e6184c",
|
|
"55a05bb281e1f7a8"
|
|
],
|
|
[
|
|
"f284a3ecbe8cdbe6",
|
|
"55a05bb281e1f7a8"
|
|
],
|
|
[
|
|
"00064453b16cedac"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "0041766d05e6184c",
|
|
"type": "debug",
|
|
"z": "8179bf22c4c31682",
|
|
"name": "debug 53",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 2160,
|
|
"y": 280,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "f284a3ecbe8cdbe6",
|
|
"type": "debug",
|
|
"z": "8179bf22c4c31682",
|
|
"name": "debug 54",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 2160,
|
|
"y": 400,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "00064453b16cedac",
|
|
"type": "debug",
|
|
"z": "8179bf22c4c31682",
|
|
"name": "debug 55",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 2160,
|
|
"y": 440,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "c19ba5f86ea40757",
|
|
"type": "link in",
|
|
"z": "8179bf22c4c31682",
|
|
"name": "LDAP Password String {sha256}",
|
|
"links": [],
|
|
"x": 1410,
|
|
"y": 360,
|
|
"wires": [
|
|
[
|
|
"c6c63174053774b7"
|
|
]
|
|
],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "55a05bb281e1f7a8",
|
|
"type": "link out",
|
|
"z": "8179bf22c4c31682",
|
|
"name": "Return",
|
|
"mode": "return",
|
|
"links": [],
|
|
"x": 2150,
|
|
"y": 340,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "f17afdbfc8c07889",
|
|
"type": "link in",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "bbd929c437c592ea",
|
|
"name": "Authentication Begin",
|
|
"links": [],
|
|
"x": 210,
|
|
"y": 1600,
|
|
"wires": [
|
|
[
|
|
"1552576e6e79e172"
|
|
]
|
|
],
|
|
"icon": "node-red/arrow-in.svg",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "6c790a65bbdc61a5",
|
|
"type": "function",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "bbd929c437c592ea",
|
|
"name": "Auth Type",
|
|
"func": "var token = null;\nvar auth = null;\n\nvar use_cookie = false;\nvar use_token = false;\n\nmsg.auth = {\n \"access\": false\n};\n\n//node.warn(Object.keys(msg.req.cookies || {}).length);\n\nif (Object.keys(msg.req.query || {}).length > 0) {\n node.status({ fill: \"yellow\", shape: \"ring\", text: \"Incomplete, use cookie token\" });\n\n if (msg.req.query.hasOwnProperty(\"token\")) {\n node.status({ fill: \"yellow\", shape: \"ring\", text: \"Incomplete, use cookie has token\" });\n\n use_token = true;\n\n }\n} else if( Object.keys(msg.req.cookies || {}).length > 0 ) {\n \n if (msg.req.cookies.hasOwnProperty(\"token\")) {\n\n node.status({ fill: \"yellow\", shape: \"ring\", text: \"Incomplete, use cookie token\" });\n\n use_cookie = true;\n\n}\n}\n\nif (use_cookie) {\n node.status({ fill: \"green\", shape: \"ring\", text: \"Use cookie token\" });\n\n msg.filename = global.get('config.paths.token_sessions') + msg.req.cookies.token + '.json';\n msg.cookie_exists = true;\n msg.token = msg.req.cookies.token;\n token = msg;\n\n} else if (use_token) {\n node.status({ fill: \"green\", shape: \"ring\", text: \"Use query string token\" });\n\n msg.filename = global.get('config.paths.token_sessions') + msg.req.query.token + '.json';\n msg.cookie_exists = false;\n msg.token = msg.req.query.token;\n token = msg;\n\n} else {\n node.status({ fill: \"blue\", shape: \"ring\", text: \"Use other auth method\" });\n\n auth = msg;\n}\n\nnode.send([token, auth]);\n",
|
|
"outputs": 2,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 200,
|
|
"y": 1880,
|
|
"wires": [
|
|
[
|
|
"bc039e4b516adf37"
|
|
],
|
|
[
|
|
"627a72eee1e26ae6"
|
|
]
|
|
],
|
|
"outputLabels": [
|
|
"Token",
|
|
"Auth"
|
|
]
|
|
},
|
|
{
|
|
"id": "bc039e4b516adf37",
|
|
"type": "link out",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "bbd929c437c592ea",
|
|
"name": "Token",
|
|
"mode": "link",
|
|
"links": [],
|
|
"x": 350,
|
|
"y": 1860,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "627a72eee1e26ae6",
|
|
"type": "link out",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "bbd929c437c592ea",
|
|
"name": "OpenID",
|
|
"mode": "link",
|
|
"links": [
|
|
"9f416bc258c1a60c",
|
|
"566184a95b7ad334"
|
|
],
|
|
"x": 360,
|
|
"y": 1900,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "9f416bc258c1a60c",
|
|
"type": "link in",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "7225c45ad941c14f",
|
|
"name": "Oauth2: Begin",
|
|
"links": [
|
|
"627a72eee1e26ae6",
|
|
"b174f7bc1d398a56"
|
|
],
|
|
"x": 870,
|
|
"y": 2240,
|
|
"wires": [
|
|
[
|
|
"bc5ca736a6e324e5"
|
|
]
|
|
],
|
|
"icon": "node-red/arrow-in.svg",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "d20869bcacd7b0fd",
|
|
"type": "link call",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "ed0645c12f7435b2",
|
|
"name": "",
|
|
"links": [
|
|
"aa3f79a3aae107ec"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 1510,
|
|
"y": 1100,
|
|
"wires": [
|
|
[
|
|
"6492bc8146326691"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "525cc01f4d41ae0b",
|
|
"type": "template",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "ed0645c12f7435b2",
|
|
"name": "GLPI: Build Data",
|
|
"field": "form",
|
|
"fieldType": "msg",
|
|
"format": "json",
|
|
"syntax": "mustache",
|
|
"template": "{\n \"approval_required\": {{ payload.data.ticket.approval_required }},\n \"data\": {\n {{ payload.data }}\n },\n \"name\": \"\",\n \"requester_id\": {{ itsm.user.id }},\n \"requesttypes_id\": {{ payload.data.ticket.requesttype_id }},\n \"ticket_category\": {{ payload.data.ticket.category_id }},\n \"ticket_entity\": {{ payload.data.ticket.entity_id }}\n}\n",
|
|
"output": "str",
|
|
"x": 910,
|
|
"y": 1240,
|
|
"wires": [
|
|
[
|
|
"2663cccd5d6ca575"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "45d7aa8b4b386bb7",
|
|
"type": "json",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "ed0645c12f7435b2",
|
|
"name": "",
|
|
"property": "form",
|
|
"action": "obj",
|
|
"pretty": false,
|
|
"x": 1110,
|
|
"y": 1220,
|
|
"wires": [
|
|
[
|
|
"2663cccd5d6ca575"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "6492bc8146326691",
|
|
"type": "switch",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "ed0645c12f7435b2",
|
|
"name": "Route Ticket Packets",
|
|
"property": "glpi.msg_routing",
|
|
"propertyType": "msg",
|
|
"rules": [
|
|
{
|
|
"t": "eq",
|
|
"v": "ticket_task_creation_automation",
|
|
"vt": "str"
|
|
},
|
|
{
|
|
"t": "eq",
|
|
"v": "ticket_creation",
|
|
"vt": "str"
|
|
},
|
|
{
|
|
"t": "else"
|
|
}
|
|
],
|
|
"checkall": "false",
|
|
"repair": false,
|
|
"outputs": 3,
|
|
"x": 1960,
|
|
"y": 1100,
|
|
"wires": [
|
|
[
|
|
"2545718f1853e084"
|
|
],
|
|
[
|
|
"e363219f4309eedb"
|
|
],
|
|
[
|
|
"1840577fd414a84d"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "803a8b65fc7a5087",
|
|
"type": "change",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "85fa24886e126df7",
|
|
"name": "",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "itsm_ticket",
|
|
"pt": "msg",
|
|
"to": "payload",
|
|
"tot": "msg"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "parts.index",
|
|
"pt": "msg",
|
|
"to": "0",
|
|
"tot": "num"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "method",
|
|
"pt": "msg",
|
|
"to": "POST",
|
|
"tot": "str"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 2340,
|
|
"y": 1300,
|
|
"wires": [
|
|
[
|
|
"96766518a046855d"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "2663cccd5d6ca575",
|
|
"type": "function",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "ed0645c12f7435b2",
|
|
"name": "Multi-Message Check",
|
|
"func": "\nmsg.config = global.get('config');\n\nif ( global.get('config.itsm.create_ticket_task') ) {\n\n msg.parts = String('{ \"id\": \"ticket_creation\", \"count\": 2 }');\n msg.parts = JSON.parse(msg.parts);\n\n}else{\n\n msg.parts = String('{ \"id\": \"ticket_creation\", \"count\": 1 }');\n msg.parts = JSON.parse(msg.parts);\n\n}\n\n\n\nreturn msg;",
|
|
"outputs": 1,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 1260,
|
|
"y": 1100,
|
|
"wires": [
|
|
[
|
|
"d20869bcacd7b0fd"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "96766518a046855d",
|
|
"type": "template",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "85fa24886e126df7",
|
|
"name": "Ticket Solution JSON Body",
|
|
"field": "payload",
|
|
"fieldType": "msg",
|
|
"format": "json",
|
|
"syntax": "mustache",
|
|
"template": "{\n \"input\": {\n \"itemtype\": \"Ticket\",\n \"items_id\": {{ itsm_ticket.id }},\n \"content\": \"Your Password has been reset.\\n\\n the second half of your password is: {{ password_second_half }}\",\n \"status\": 2\n }\n}\n ",
|
|
"output": "json",
|
|
"x": 2540,
|
|
"y": 1300,
|
|
"wires": [
|
|
[
|
|
"242b471ad711a4f1"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "1305e2f195ec5ede",
|
|
"type": "link call",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "85fa24886e126df7",
|
|
"name": "GLPI Ticket Solution",
|
|
"links": [
|
|
"eb5f283400263c25"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 3100,
|
|
"y": 1300,
|
|
"wires": [
|
|
[
|
|
"40208ed719417cac"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "242b471ad711a4f1",
|
|
"type": "template",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "85fa24886e126df7",
|
|
"name": "Create GLPI Solution URL",
|
|
"field": "url",
|
|
"fieldType": "msg",
|
|
"format": "handlebars",
|
|
"syntax": "mustache",
|
|
"template": "{{{ global.config.itsm.api_url }}}Ticket/{{ itsm_ticket.id }}/ITILSolution/",
|
|
"output": "str",
|
|
"x": 2880,
|
|
"y": 1300,
|
|
"wires": [
|
|
[
|
|
"1305e2f195ec5ede"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "285f57c0fee687a1",
|
|
"type": "link out",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "85fa24886e126df7",
|
|
"name": "Update Ticket Task Part 2/2",
|
|
"mode": "link",
|
|
"links": [
|
|
"c2f8e99492223cfb"
|
|
],
|
|
"x": 3560,
|
|
"y": 1300,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "5eda003868c5e354",
|
|
"type": "debug",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "ed0645c12f7435b2",
|
|
"name": "GLPI: Ticket Complete",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 4640,
|
|
"y": 1380,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "ed5a0fab59b28faa",
|
|
"type": "comment",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "ed0645c12f7435b2",
|
|
"name": "ToDo: On error Update ticket",
|
|
"info": "",
|
|
"x": 4600,
|
|
"y": 1300,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "40208ed719417cac",
|
|
"type": "change",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "85fa24886e126df7",
|
|
"name": "Save Ticket Solution",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "itsm_solution",
|
|
"pt": "msg",
|
|
"to": "payload",
|
|
"tot": "msg"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 3340,
|
|
"y": 1300,
|
|
"wires": [
|
|
[
|
|
"285f57c0fee687a1"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "246331e1c052e1f8",
|
|
"type": "function",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "ed0645c12f7435b2",
|
|
"name": "msg.form",
|
|
"func": "\n\nmsg.form = {\n \"approval_required\": msg.payload.data.ticket.approval_required,\n \"data\": msg.payload.data,\n \"name\": \"\",\n \"requester_id\": msg.itsm.user.id,\n \"requesttypes_id\": msg.payload.data.ticket.requesttype_id,\n \"ticket_category\": msg.payload.data.ticket.category_id,\n \"ticket_entity\": msg.payload.data.ticket.entity_id,\n \"auto_assign\": true\n}\n\nmsg.task_category = global.get('config.itsm.ticket.task_category_id');\n\nreturn msg;\n",
|
|
"outputs": 1,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 940,
|
|
"y": 1100,
|
|
"wires": [
|
|
[
|
|
"2663cccd5d6ca575"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "587b497ce06d683f",
|
|
"type": "link call",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "d7dbd3970c891c33",
|
|
"name": "GLPI User Search",
|
|
"links": [
|
|
"eb5f283400263c25"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 1610,
|
|
"y": 980,
|
|
"wires": [
|
|
[
|
|
"6aac3151138c4af9"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "f76da20ac475cf64",
|
|
"type": "function",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "d7dbd3970c891c33",
|
|
"name": "function 1",
|
|
"func": "msg.ldap = msg.payload[0];\ndelete msg.payload;\n\nreturn msg;",
|
|
"outputs": 1,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 980,
|
|
"y": 920,
|
|
"wires": [
|
|
[]
|
|
]
|
|
},
|
|
{
|
|
"id": "a9cfd4c1413c7ec6",
|
|
"type": "change",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "d7dbd3970c891c33",
|
|
"name": "Globals",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "authorization",
|
|
"pt": "msg",
|
|
"to": "glpi.authorization",
|
|
"tot": "global"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "app_token",
|
|
"pt": "msg",
|
|
"to": "glpi.app_token",
|
|
"tot": "global"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "api_url",
|
|
"pt": "msg",
|
|
"to": "config.itsm.api_url",
|
|
"tot": "global"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 1040,
|
|
"y": 980,
|
|
"wires": [
|
|
[
|
|
"669724fdc876385d"
|
|
]
|
|
],
|
|
"icon": "font-awesome/fa-cogs"
|
|
},
|
|
{
|
|
"id": "669724fdc876385d",
|
|
"type": "link call",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "d7dbd3970c891c33",
|
|
"name": "Fetch GLPI Session",
|
|
"links": [
|
|
"e930fc18412ba052"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 1200,
|
|
"y": 980,
|
|
"wires": [
|
|
[
|
|
"65c3e138bbcd8b3a"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "65c3e138bbcd8b3a",
|
|
"type": "template",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "d7dbd3970c891c33",
|
|
"name": "Create GLPI Search URL",
|
|
"field": "url",
|
|
"fieldType": "msg",
|
|
"format": "handlebars",
|
|
"syntax": "mustache",
|
|
"template": "{{{ global.config.itsm.api_url }}}/User?searchText[name]={{ ldap.uid }}&searchText[firstname]={{ ldap.givenName }}&searchText[realname]={{ ldap.sn }}&searchText[sync_field]={{ ldap.uid }}",
|
|
"output": "str",
|
|
"x": 1410,
|
|
"y": 980,
|
|
"wires": [
|
|
[
|
|
"587b497ce06d683f"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "a888a2ed9a053acc",
|
|
"type": "function",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "d7dbd3970c891c33",
|
|
"name": "Search GLPI Results for user",
|
|
"func": "for( var i = 0; i < msg.payload.length; i++ ) {\n\n if (\n msg.payload[i].name == msg.ldap.uid\n &&\n msg.payload[i].firstname == msg.ldap.givenName\n &&\n msg.payload[i].realname == msg.ldap.sn\n &&\n msg.payload[i].user_dn == msg.ldap.dn\n &&\n msg.payload[i].sync_field == msg.ldap.uid\n &&\n Number(msg.payload[i].is_deleted) == 0\n &&\n Number(msg.payload[i].is_deleted_ldap) == 0\n ){\n \n msg.user = msg.payload[i];\n \n }\n}\n\ndelete msg.payload;\n\nmsg.payload = msg.user;\ndelete msg.user;\n\nreturn msg;",
|
|
"outputs": 1,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 1920,
|
|
"y": 980,
|
|
"wires": [
|
|
[
|
|
"269cbacf5274d6d8"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "e8f257b38aa4d749",
|
|
"type": "link out",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "ed0645c12f7435b2",
|
|
"name": "Return",
|
|
"mode": "return",
|
|
"links": [],
|
|
"x": 4590,
|
|
"y": 1340,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "fb6750555645b873",
|
|
"type": "change",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "351440700b3e2ecc",
|
|
"name": "",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "itsm_task",
|
|
"pt": "msg",
|
|
"to": "payload",
|
|
"tot": "msg"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "parts.index",
|
|
"pt": "msg",
|
|
"to": "1",
|
|
"tot": "num"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 2360,
|
|
"y": 1160,
|
|
"wires": [
|
|
[
|
|
"e0660324da4581dd"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "e0660324da4581dd",
|
|
"type": "link out",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "351440700b3e2ecc",
|
|
"name": "Update Ticket Task Part 1/2",
|
|
"mode": "link",
|
|
"links": [
|
|
"c2f8e99492223cfb"
|
|
],
|
|
"x": 2600,
|
|
"y": 1160,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "eacbafc05d06b95a",
|
|
"type": "link call",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "f17ccfa845461657",
|
|
"name": "GLPI: Automation Task Duration",
|
|
"links": [
|
|
"eb5f283400263c25"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 4250,
|
|
"y": 1160,
|
|
"wires": [
|
|
[
|
|
"f57f557a25d166b7"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "76cd564b69443419",
|
|
"type": "change",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "f17ccfa845461657",
|
|
"name": "msg.method",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "method",
|
|
"pt": "msg",
|
|
"to": "PUT",
|
|
"tot": "str"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 4030,
|
|
"y": 1160,
|
|
"wires": [
|
|
[
|
|
"eacbafc05d06b95a"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "ca1b9c48c3c0c522",
|
|
"type": "template",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "f17ccfa845461657",
|
|
"name": "GLPI: Ticket Task URL",
|
|
"field": "url",
|
|
"fieldType": "msg",
|
|
"format": "handlebars",
|
|
"syntax": "mustache",
|
|
"template": "{{{ global.config.itsm.api_url }}}Ticket/{{ itsm.ticket.id }}/TicketTask/{{ itsm.ticket_task.id }}",
|
|
"output": "str",
|
|
"x": 3800,
|
|
"y": 1160,
|
|
"wires": [
|
|
[
|
|
"76cd564b69443419"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "d64e9c631ee7ec87",
|
|
"type": "template",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "f17ccfa845461657",
|
|
"name": "Task time JSON Body",
|
|
"field": "payload",
|
|
"fieldType": "msg",
|
|
"format": "json",
|
|
"syntax": "mustache",
|
|
"template": "{\n \"input\": {\n \"id\": \"{{ itsm.ticket_task.id }}\",\n \"actiontime\": 5,\n \"state\": 2\n }\n}\n",
|
|
"output": "json",
|
|
"x": 3600,
|
|
"y": 1160,
|
|
"wires": [
|
|
[
|
|
"ca1b9c48c3c0c522"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "cafa50da13d9e5d9",
|
|
"type": "join",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "f17ccfa845461657",
|
|
"name": "Combine Ticket and Ticket Task Packets",
|
|
"mode": "custom",
|
|
"build": "merged",
|
|
"property": "",
|
|
"propertyType": "full",
|
|
"key": "topic",
|
|
"joiner": "\\n",
|
|
"joinerType": "str",
|
|
"accumulate": true,
|
|
"timeout": "1",
|
|
"count": "2",
|
|
"reduceRight": false,
|
|
"reduceExp": "",
|
|
"reduceInit": "",
|
|
"reduceInitType": "num",
|
|
"reduceFixup": "",
|
|
"x": 3220,
|
|
"y": 1160,
|
|
"wires": [
|
|
[
|
|
"fdf014eff1962329"
|
|
]
|
|
],
|
|
"info": "after two messages, the password has been changed"
|
|
},
|
|
{
|
|
"id": "c2f8e99492223cfb",
|
|
"type": "link in",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "f17ccfa845461657",
|
|
"name": "Process: Update Ticket Task",
|
|
"links": [
|
|
"e0660324da4581dd",
|
|
"285f57c0fee687a1"
|
|
],
|
|
"x": 2940,
|
|
"y": 1160,
|
|
"wires": [
|
|
[
|
|
"cafa50da13d9e5d9"
|
|
]
|
|
],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "fdf014eff1962329",
|
|
"type": "function",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "f17ccfa845461657",
|
|
"name": "function 2",
|
|
"func": "\nmsg.itsm = {\n \"ticket\": msg.itsm_ticket,\n \"ticket_task\": msg.itsm_task,\n \"solution\": msg.itsm_solution,\n \"user\": msg.itsm.user\n}\ndelete msg.itsm_ticket;\ndelete msg.itsm_task;\ndelete msg.itsm_solution;\n\nreturn msg;",
|
|
"outputs": 1,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 3440,
|
|
"y": 1160,
|
|
"wires": [
|
|
[
|
|
"d64e9c631ee7ec87"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "5a961504d7ca5be3",
|
|
"type": "debug",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "ed0645c12f7435b2",
|
|
"name": "debug 67",
|
|
"active": false,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 2580,
|
|
"y": 1360,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "9cbf4beaceba5255",
|
|
"type": "link out",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "bcaed4334222c14a",
|
|
"name": "Session: Oauth2",
|
|
"mode": "link",
|
|
"links": [
|
|
"b4a253cb29efc244",
|
|
"20aae4d90a07f156",
|
|
"54e638b390e13c61"
|
|
],
|
|
"x": 1830,
|
|
"y": 1620,
|
|
"wires": [],
|
|
"icon": "node-red/arrow-in.svg",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "f20711a44b43b7d4",
|
|
"type": "debug",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "bcaed4334222c14a",
|
|
"name": "debug 149",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1630,
|
|
"y": 1700,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "2a858bd15a2d257e",
|
|
"type": "function",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "bcaed4334222c14a",
|
|
"name": "Session Type",
|
|
"func": "var oauth2 = null;\nvar token = null;\n\nvar status = {fill:\"red\",shape:\"ring\",text:\"ERR: Incomplete\"};\n\nmsg.session = JSON.parse(msg.payload);\n\ndelete msg.payload;\ndelete msg.filename;\n\nif( msg.session.type == 'oauth2' ) {\n\n status.text = \"Oauth2\";\n status.fill = 'blue';\n oauth2 = msg;\n\n} else if( msg.session.type == 'token' ) {\n\n status.text = \"Token\";\n status.fill = 'green';\n token = msg;\n\n}\n\nnode.status(status);\n\nnode.send([\n oauth2,\n token\n]);",
|
|
"outputs": 2,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 1640,
|
|
"y": 1640,
|
|
"wires": [
|
|
[
|
|
"9cbf4beaceba5255"
|
|
],
|
|
[
|
|
"da0811fbd7963934"
|
|
]
|
|
],
|
|
"outputLabels": [
|
|
"Oauth2",
|
|
"Token"
|
|
],
|
|
"icon": "font-awesome/fa-question",
|
|
"info": "ToDo: add date check of session file"
|
|
},
|
|
{
|
|
"id": "e897aec8ea7c81c5",
|
|
"type": "file in",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "bcaed4334222c14a",
|
|
"name": "Fetch Saved session",
|
|
"filename": "filename",
|
|
"filenameType": "msg",
|
|
"format": "utf8",
|
|
"chunk": false,
|
|
"sendError": false,
|
|
"encoding": "none",
|
|
"allProps": false,
|
|
"x": 1440,
|
|
"y": 1640,
|
|
"wires": [
|
|
[
|
|
"f20711a44b43b7d4",
|
|
"2a858bd15a2d257e"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "9c05ca2751f619a7",
|
|
"type": "link out",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "bcaed4334222c14a",
|
|
"name": "No Saved Session",
|
|
"mode": "link",
|
|
"links": [
|
|
"e80aabc47c664088"
|
|
],
|
|
"x": 1430,
|
|
"y": 1680,
|
|
"wires": [],
|
|
"icon": "font-awesome/fa-lock",
|
|
"l": true,
|
|
"info": "# No Saved Session\n\n> No Session could be found with the cookie value\n\nThis path has set HTTP/303 with the location set to the oauth2 provider authentication url."
|
|
},
|
|
{
|
|
"id": "2dee51842e868755",
|
|
"type": "debug",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "bcaed4334222c14a",
|
|
"name": "debug 148",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1410,
|
|
"y": 1720,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "73b63d7562fe9cce",
|
|
"type": "function",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "bcaed4334222c14a",
|
|
"name": "Session: Load and Check",
|
|
"func": "var have_session = null;\nvar no_session = msg;\n\nvar cookie = false;\nvar token = false;\n\nvar filename = null;\nvar status = { fill: \"red\", shape: \"ring\", text: \"incomplete\"};\n\nvar auth_url = global.get('config.oauth.url.auth') + \"?response_type=code&client_id=\" + global.get('config.oauth.client_id') + \"&redirect_uri=\" + encodeURIComponent(global.get('config.oauth.url.callback')) + \"&scope=openid&state=\" + String(Date.now());\n\nnode.warn('here');\n\n\nif (Object.keys(msg.req.cookies || {}).length > 0) {\n node.warn('cookie');\n\n if ( msg.req.cookies.hasOwnProperty('auth')) {\n node.warn('cookie1');\n\n filename = String(env.get('HOME') + '/' + global.get('config.paths.token_sessions')) + msg.req.cookies.auth + '.json';\n \n cookie = fs.existsSync(filename)\n\n }\n\n} \n\n\nif (Object.keys(msg.req.query || {}).length > 0 ) {\n node.warn('token');\n if (msg.req.query.hasOwnProperty('token')) {\n node.warn('token1');\n\n filename = String(env.get('HOME') + '/' + global.get('config.paths.token_sessions')) + msg.req.query.token + '.json';\n node.warn('token1.5' + filename );\n \n token = fs.existsSync(filename);\n\n }\n\n} \n\nif( cookie ) {\n node.warn('cookie3');\n status.text = \"Saved Session Exists\";\n status.fill = \"green\";\n\n msg.filename = filename;\n msg.token = msg.req.cookies.auth;\n\n \n have_session = msg;\n no_session = null;\n \n} else if( token ) {\n node.warn('token3');\n status.text = \"Saved Token Exists\";\n status.fill = \"green\";\n \n msg.filename = filename;\n msg.token = msg.req.query.token;\n\n have_session = msg;\n no_session = null;\n\n} else {\n \n node.warn('here3');\n status.text = \"No Saved Sessions\";\n status.fill = \"yellow\";\n\n msg.statusCode = 303;\n\n msg.headers = {\n Location: auth_url\n }\n\n}\n\nnode.status(status);\n\nnode.send([\n have_session,\n no_session\n]);\n",
|
|
"outputs": 2,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [
|
|
{
|
|
"var": "fs",
|
|
"module": "fs"
|
|
}
|
|
],
|
|
"x": 1170,
|
|
"y": 1660,
|
|
"wires": [
|
|
[
|
|
"e897aec8ea7c81c5"
|
|
],
|
|
[
|
|
"2dee51842e868755",
|
|
"9c05ca2751f619a7"
|
|
]
|
|
],
|
|
"outputLabels": [
|
|
"Session Found",
|
|
"Session Not Found"
|
|
],
|
|
"icon": "font-awesome/fa-question",
|
|
"info": "\nsuccess = session found from cookie value\nfailure = need to logon, redirect"
|
|
},
|
|
{
|
|
"id": "33f25da80ef87e72",
|
|
"type": "link in",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "bcaed4334222c14a",
|
|
"name": "Cookie: Begin Validation",
|
|
"links": [
|
|
"f9550cdd015b52ae"
|
|
],
|
|
"x": 930,
|
|
"y": 1660,
|
|
"wires": [
|
|
[
|
|
"73b63d7562fe9cce"
|
|
]
|
|
],
|
|
"icon": "font-awesome/fa-unlock-alt",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "da0811fbd7963934",
|
|
"type": "link out",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "bcaed4334222c14a",
|
|
"name": "Session: Token",
|
|
"mode": "link",
|
|
"links": [
|
|
"8b1fef39c34f5513"
|
|
],
|
|
"x": 1820,
|
|
"y": 1660,
|
|
"wires": [],
|
|
"icon": "node-red/arrow-in.svg",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "c10e09e4bfbddfd7",
|
|
"type": "link in",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "cc33365c2aa59e35",
|
|
"name": "Token: Finish",
|
|
"links": [
|
|
"366892fde876296f",
|
|
"9c55bf6229fa740c",
|
|
"95f44fbb0ddd39fc"
|
|
],
|
|
"x": 2590,
|
|
"y": 2100,
|
|
"wires": [
|
|
[
|
|
"53a5ee55ee916cec"
|
|
]
|
|
],
|
|
"icon": "font-awesome/fa-flag-checkered",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "53a5ee55ee916cec",
|
|
"type": "link out",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "cc33365c2aa59e35",
|
|
"name": "Token: Return",
|
|
"mode": "link",
|
|
"links": [
|
|
"e80aabc47c664088"
|
|
],
|
|
"x": 2740,
|
|
"y": 2100,
|
|
"wires": [],
|
|
"icon": "node-red/arrow-in.svg",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "366892fde876296f",
|
|
"type": "link out",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "75c44e5f7f101beb",
|
|
"name": "Fail: Token Check",
|
|
"mode": "link",
|
|
"links": [
|
|
"c10e09e4bfbddfd7"
|
|
],
|
|
"x": 1550,
|
|
"y": 1920,
|
|
"wires": [],
|
|
"icon": "font-awesome/fa-refresh",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "42a1e057dda56f95",
|
|
"type": "function",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "75c44e5f7f101beb",
|
|
"name": "Validate Token File",
|
|
"func": "var success = null;\nvar failure = null;\n\nif( msg.session.datetime > Date.now() ) {\n\n if( msg.session.hasOwnProperty(\"user\") ) {\n\n if (\n msg.session.user.hasOwnProperty(\"fname\") &&\n msg.session.user.hasOwnProperty(\"lname\") &&\n msg.session.user.hasOwnProperty(\"username\") &&\n msg.session.user.hasOwnProperty(\"mail\")\n ) {\n\n node.status({ fill: \"green\", shape: \"ring\", text: \"Authorized\" });\n //msg.auth.access = true;\n //msg.auth.user = msg.session.user;\n\n msg.cookies = {\n auth: {\n value: String(msg.token),\n maxAge: msg.session.datetime - Date.now()\n }\n };\n\n delete msg.token;\n delete msg.payload;\n success = msg\n\n } else {\n\n node.status({ fill: \"grey\", shape: \"ring\", text: \"Missing User details, not Authorized\" });\n \n delete msg.token;\n delete msg.payload;\n failure = msg;\n\n }\n } else{\n\n node.status({ fill: \"grey\", shape: \"ring\", text: \"Missing User, not Authorized\" });\n\n delete msg.token;\n delete msg.payload;\n failure = msg;\n\n }\n \n\n} else {\n\n node.status({ fill: \"yellow\", shape: \"ring\", text: \"Not Authorized\" });\n delete msg.token;\n delete msg.payload;\n failure = msg;\n}\n\n\nnode.send([success, failure]);",
|
|
"outputs": 2,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [
|
|
{
|
|
"var": "fs",
|
|
"module": "fs"
|
|
}
|
|
],
|
|
"x": 1330,
|
|
"y": 1900,
|
|
"wires": [
|
|
[
|
|
"95f44fbb0ddd39fc"
|
|
],
|
|
[
|
|
"366892fde876296f"
|
|
]
|
|
],
|
|
"outputLabels": [
|
|
"True",
|
|
"False"
|
|
]
|
|
},
|
|
{
|
|
"id": "8b1fef39c34f5513",
|
|
"type": "link in",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "75c44e5f7f101beb",
|
|
"name": "Session: Token",
|
|
"links": [
|
|
"da0811fbd7963934"
|
|
],
|
|
"x": 1120,
|
|
"y": 1900,
|
|
"wires": [
|
|
[
|
|
"42a1e057dda56f95"
|
|
]
|
|
],
|
|
"icon": "node-red/arrow-in.svg",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "95f44fbb0ddd39fc",
|
|
"type": "link out",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "75c44e5f7f101beb",
|
|
"name": "Success: Token Check",
|
|
"mode": "link",
|
|
"links": [
|
|
"c10e09e4bfbddfd7"
|
|
],
|
|
"x": 1560,
|
|
"y": 1880,
|
|
"wires": [],
|
|
"icon": "font-awesome/fa-unlock",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "e80aabc47c664088",
|
|
"type": "link in",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "bbd929c437c592ea",
|
|
"name": "Auth: Finish",
|
|
"links": [
|
|
"53a5ee55ee916cec",
|
|
"9c05ca2751f619a7",
|
|
"8ad6190854001584",
|
|
"413dbeb6f2d0d2d0",
|
|
"d24ebda198149601",
|
|
"3fa2f7ecc012d8c6"
|
|
],
|
|
"x": 2870,
|
|
"y": 2820,
|
|
"wires": [
|
|
[
|
|
"724a142f28c3b6e4"
|
|
]
|
|
],
|
|
"icon": "font-awesome/fa-flag-checkered",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "724a142f28c3b6e4",
|
|
"type": "link out",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "bbd929c437c592ea",
|
|
"name": "Auth: Return",
|
|
"mode": "return",
|
|
"links": [],
|
|
"x": 3010,
|
|
"y": 2820,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "f9550cdd015b52ae",
|
|
"type": "link out",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "bbd929c437c592ea",
|
|
"name": "Cookie Check",
|
|
"mode": "link",
|
|
"links": [
|
|
"33f25da80ef87e72"
|
|
],
|
|
"x": 580,
|
|
"y": 1580,
|
|
"wires": [],
|
|
"icon": "node-red/arrow-in.svg",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "a4bc5830daf9801a",
|
|
"type": "link in",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "cc33365c2aa59e35",
|
|
"name": "Token: Begin",
|
|
"links": [],
|
|
"x": 870,
|
|
"y": 1860,
|
|
"wires": [
|
|
[]
|
|
],
|
|
"icon": "node-red/arrow-in.svg",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "bc5ca736a6e324e5",
|
|
"type": "function",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "7225c45ad941c14f",
|
|
"name": "Valid",
|
|
"func": "msg.token_refresh = false;\n\nvar callback = null;\nvar request = msg;\n\nvar status = { fill: \"red\", shape: \"ring\", text: \"Incomplete\" }\n\n\nif( Object.keys(msg.req.query || {}).length > 0 ){\n\n if (\n msg.req.query.hasOwnProperty('state') &&\n msg.req.query.hasOwnProperty('session_state') &&\n msg.req.query.hasOwnProperty('code')\n ){\n\n status.text = \"Callback\";\n msg.oauth2 = msg.payload;\n delete msg.payload;\n \n callback = msg;\n request = null;\n\n }\n\n} else {\n\n status.text = \"Request\";\n callback = null;\n request = msg;\n\n msg.statusCode = 400;\n\n}\n\nnode.status(status);\n\nnode.send([\n callback,\n request\n]);\n",
|
|
"outputs": 2,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 1010,
|
|
"y": 2240,
|
|
"wires": [
|
|
[
|
|
"60a97c78327c3a6a"
|
|
],
|
|
[
|
|
"8964a5bda9eb7113"
|
|
]
|
|
],
|
|
"outputLabels": [
|
|
"Callback",
|
|
"Request"
|
|
],
|
|
"icon": "font-awesome/fa-question",
|
|
"info": "# Query Type\n\nThere are two types of query:\n\n- callback\n\n- request\n\n## Callback\n\nA user has authenticated with the oauth2 provider, with the details of the authentication contained in the request. \nFurther processing is required for the user to be granted access.\n\nDuring the processing, a auth cookie must be set so that authentication confirmation can occur in subsequent non-callback requests.\n\n## Request\n\nA Normal non-callback `GET` request that is assumed to be the users web browser. This path must confirm if the users cookie is present and load the user details using the value of a cookie from the session cache.\n"
|
|
},
|
|
{
|
|
"id": "60a97c78327c3a6a",
|
|
"type": "link out",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "7225c45ad941c14f",
|
|
"name": "Callback Valid",
|
|
"mode": "link",
|
|
"links": [
|
|
"de76019e24c52ae0",
|
|
"9d0d1d9a6c596428"
|
|
],
|
|
"x": 1180,
|
|
"y": 2240,
|
|
"wires": [],
|
|
"icon": "node-red/arrow-in.svg",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "8964a5bda9eb7113",
|
|
"type": "link out",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "7225c45ad941c14f",
|
|
"name": "HTTP/400",
|
|
"mode": "link",
|
|
"links": [
|
|
"21ec376b58ac0c54"
|
|
],
|
|
"x": 1170,
|
|
"y": 2280,
|
|
"wires": [],
|
|
"icon": "font-awesome/fa-exclamation-triangle",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "21ec376b58ac0c54",
|
|
"type": "link in",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "7225c45ad941c14f",
|
|
"name": "Oauth2: Finish",
|
|
"links": [
|
|
"7873f07f92e9be20",
|
|
"8964a5bda9eb7113",
|
|
"a30dab395f333826"
|
|
],
|
|
"x": 2500,
|
|
"y": 2540,
|
|
"wires": [
|
|
[
|
|
"8ad6190854001584"
|
|
]
|
|
],
|
|
"icon": "font-awesome/fa-flag-checkered",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "8ad6190854001584",
|
|
"type": "link out",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "7225c45ad941c14f",
|
|
"name": "Oauth2: Return",
|
|
"mode": "link",
|
|
"links": [
|
|
"e80aabc47c664088"
|
|
],
|
|
"x": 2720,
|
|
"y": 2540,
|
|
"wires": [],
|
|
"icon": "node-red/arrow-in.svg",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "54e638b390e13c61",
|
|
"type": "link in",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "f5e65e1ae7e8b812",
|
|
"name": "Oauth2: Validate Current Session",
|
|
"links": [
|
|
"9cbf4beaceba5255"
|
|
],
|
|
"x": 1450,
|
|
"y": 2320,
|
|
"wires": [
|
|
[
|
|
"36c7736ada06ef15"
|
|
]
|
|
],
|
|
"icon": "node-red/arrow-in.svg",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "36c7736ada06ef15",
|
|
"type": "function",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "f5e65e1ae7e8b812",
|
|
"name": "Session Valid?",
|
|
"func": "// confirm status code return.\n// - does a non http/200 mean not authed?\n\nvar session_valid = null;\nvar refresh_token = null;\nvar must_auth = msg;\n\nvar status = { fill: \"red\", shape: \"ring\", text: \"ERR: Incomplete\" };\n\ndelete msg.payload;\ndelete msg.retry;\ndelete msg.headers;\ndelete msg.url;\ndelete msg.responseUrl;\n\nvar idToken = [];\n\nif ( Object.keys(msg.session.oauth2 || {}).length > 0 ){\n\n if (\n msg.session.oauth2.hasOwnProperty('access_token') &&\n msg.session.oauth2.hasOwnProperty('refresh_token') &&\n msg.session.oauth2.hasOwnProperty('id_token')\n ){\n\n\n var iToken = String(msg.session.oauth2.id_token).split('.');\n\n for (var i = 1; i < iToken.length; i++) {\n\n var base64 = Buffer.from(iToken[i - 1], 'base64');\n\n //decoded[(i - 1)] = Buffer.from(aToken[i - 1]).toString(decoded);\n //idToken[(i - 1)] = iToken[i - 1];\n idToken[(i - 1)] = base64.toString('ascii');\n\n }\n\n idToken[1] = JSON.parse(idToken[1]);\n\n //msg.idToken = idToken; // temp, remove post dev\n\n \n msg.refresh_expires = msg.session.datetime;\n msg.token_expires = idToken[1].exp;\n msg.now = Math.floor(Date.now() / 1000);\n\n if(\n msg.refresh_expires > msg.now &&\n msg.token_expires <= msg.now\n ) {\n \n status.text = \"Refresh Token\";\n\n refresh_token = msg;\n must_auth = null;\n\n } else if (\n msg.refresh_expires > msg.now &&\n msg.token_expires > msg.now\n ) {\n\n session_valid = msg;\n must_auth = null;\n status.text = \"Session Valid\";\n status.fill = \"green\";\n\n }\n\n } else {\n\n status.text = \"Failure: missing properties\";\n status.fill = \"yellow\";\n\n msg.statusCode = 303;\n\n msg.headers = {\n\n Location: global.get('config.oauth.url.auth') + \"?response_type=code&client_id=\" + global.get('config.oauth.client_id') + \"&redirect_uri=\" + encodeURIComponent(global.get('config.oauth.url.callback')) + \"&scope=openid&state=\" + String(Date.now())\n\n }\n\n }\n\n}\n\n\nnode.status(status);\n\nnode.send([\n session_valid,\n refresh_token,\n must_auth\n]);",
|
|
"outputs": 3,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 1700,
|
|
"y": 2320,
|
|
"wires": [
|
|
[
|
|
"7873f07f92e9be20"
|
|
],
|
|
[
|
|
"1e2dce9d25c567d6",
|
|
"55efe159b8d86e8f"
|
|
],
|
|
[
|
|
"412814a194fb2e27",
|
|
"a30dab395f333826"
|
|
]
|
|
],
|
|
"outputLabels": [
|
|
"Authenticated",
|
|
"Refresh Token",
|
|
"Needs to Authenticate (redirect)"
|
|
],
|
|
"icon": "font-awesome/fa-unlock-alt"
|
|
},
|
|
{
|
|
"id": "7873f07f92e9be20",
|
|
"type": "link out",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "f5e65e1ae7e8b812",
|
|
"name": "Session Valid",
|
|
"mode": "link",
|
|
"links": [
|
|
"21ec376b58ac0c54"
|
|
],
|
|
"x": 1900,
|
|
"y": 2300,
|
|
"wires": [],
|
|
"icon": "font-awesome/fa-unlock",
|
|
"l": true,
|
|
"info": "# Session Valid\n\nThe saved session has not yet expired.\nThe flow can continue as the user is considered authenticated."
|
|
},
|
|
{
|
|
"id": "a30dab395f333826",
|
|
"type": "link out",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "f5e65e1ae7e8b812",
|
|
"name": "Session not Valid",
|
|
"mode": "link",
|
|
"links": [
|
|
"21ec376b58ac0c54"
|
|
],
|
|
"x": 1910,
|
|
"y": 2340,
|
|
"wires": [],
|
|
"icon": "font-awesome/fa-lock",
|
|
"l": true,
|
|
"info": "# Session not Valid\n\n> Missing details from saved session.\n\nThis path has set HTTP/303 with the location set to the oauth2 provider authentication url."
|
|
},
|
|
{
|
|
"id": "412814a194fb2e27",
|
|
"type": "debug",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "f5e65e1ae7e8b812",
|
|
"name": "debug 152",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1890,
|
|
"y": 2380,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "1e2dce9d25c567d6",
|
|
"type": "debug",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "7225c45ad941c14f",
|
|
"name": "debug 151",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 2150,
|
|
"y": 2280,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "55efe159b8d86e8f",
|
|
"type": "function",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "f5e65e1ae7e8b812",
|
|
"name": "Build: Token Request",
|
|
"func": "msg.method = \"POST\"\n\nmsg.url = global.get('config.oauth.url.token') + \"?grant_type=refresh_token\";\n\nmsg.headers = {}\n\nmsg.headers[\"content-type\"] = \"application/x-www-form-urlencoded\"\nmsg.headers[\"Authorization\"] = 'Basic ' + Buffer.from(global.get('config.oauth.client_id') + ':' + global.get('config.oauth.client_secret')).toString('base64');\n\nmsg.payload = \"grant_type=refresh_token&scope=openid&client_id=\" + global.get('config.oauth.client_id') + \"&client_secret=\" + global.get('config.oauth.client_secret') + \"&refresh_token=\" + msg.session.oauth2.refresh_token;\n\nmsg.token_refresh = true;\n\nreturn msg",
|
|
"outputs": 1,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 2180,
|
|
"y": 2320,
|
|
"wires": [
|
|
[
|
|
"50e12d2b699abb59"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "50e12d2b699abb59",
|
|
"type": "http request",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "f5e65e1ae7e8b812",
|
|
"name": "Refresh Token",
|
|
"method": "use",
|
|
"ret": "obj",
|
|
"paytoqs": "ignore",
|
|
"url": "",
|
|
"tls": "",
|
|
"persist": false,
|
|
"proxy": "",
|
|
"insecureHTTPParser": false,
|
|
"authType": "",
|
|
"senderr": false,
|
|
"headers": [],
|
|
"x": 2360,
|
|
"y": 2320,
|
|
"wires": [
|
|
[
|
|
"3254bbe21538dc25"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "3254bbe21538dc25",
|
|
"type": "switch",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "f5e65e1ae7e8b812",
|
|
"name": "",
|
|
"property": "statusCode",
|
|
"propertyType": "msg",
|
|
"rules": [
|
|
{
|
|
"t": "eq",
|
|
"v": "200",
|
|
"vt": "num"
|
|
},
|
|
{
|
|
"t": "else"
|
|
}
|
|
],
|
|
"checkall": "true",
|
|
"repair": false,
|
|
"outputs": 2,
|
|
"x": 2490,
|
|
"y": 2320,
|
|
"wires": [
|
|
[
|
|
"b371f5e8c32059f3",
|
|
"e6f37f07e9217707"
|
|
],
|
|
[
|
|
"68cdc18107b77029"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "b371f5e8c32059f3",
|
|
"type": "debug",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "f5e65e1ae7e8b812",
|
|
"name": "refresh",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 2640,
|
|
"y": 2260,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "e6f37f07e9217707",
|
|
"type": "link out",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "f5e65e1ae7e8b812",
|
|
"name": "Oauth2: Token Refresh",
|
|
"mode": "link",
|
|
"links": [
|
|
"97fb6e1471c0f7cd"
|
|
],
|
|
"x": 2690,
|
|
"y": 2300,
|
|
"wires": [],
|
|
"icon": "node-red/arrow-in.svg",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "68cdc18107b77029",
|
|
"type": "debug",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "f5e65e1ae7e8b812",
|
|
"name": "debug 153",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 2650,
|
|
"y": 2360,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "3629b0bb901c20a7",
|
|
"type": "debug",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "69f0d6271fe16536",
|
|
"name": "debug 141",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1610,
|
|
"y": 2680,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "d43b2afbfaad2d31",
|
|
"type": "debug",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "69f0d6271fe16536",
|
|
"name": "debug 144",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 770,
|
|
"y": 2780,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "150344ba8db2ceee",
|
|
"type": "link in",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "69f0d6271fe16536",
|
|
"name": "Session: Save Token",
|
|
"links": [
|
|
"261436c730a46051"
|
|
],
|
|
"x": 360,
|
|
"y": 2740,
|
|
"wires": [
|
|
[
|
|
"bcab3f1c2966f5aa"
|
|
]
|
|
],
|
|
"icon": "node-red/arrow-in.svg",
|
|
"l": true,
|
|
"info": "# Oauth2 Process\n\nThis node processes the Oauth2 Packet received from the provider.\nIt is expected to be passed to this node as part of `msg.payload`"
|
|
},
|
|
{
|
|
"id": "bcab3f1c2966f5aa",
|
|
"type": "function",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "69f0d6271fe16536",
|
|
"name": "Set User Details",
|
|
"func": "// confirm status code return.\n// - does a non http/200 mean not authed?\n\nvar success = null;\nvar failure = msg;\n\nvar status = { fill: \"red\", shape: \"ring\", text: \"ERR: Incomplete\" };\n\nmsg.oauth2 = msg.payload;\ndelete msg.payload;\ndelete msg.retry;\ndelete msg.headers;\ndelete msg.url;\ndelete msg.responseUrl;\ndelete msg.statusCode;\n\nvar idToken = [];\n\n\n//msg.oauth2.expires = Math.floor(Date.now() / 1000) + msg.oauth2.expires_in;\n\n//msg.oauth2.refresh_expires = Math.floor(Date.now() / 1000) + msg.oauth2.refresh_expires_in;\n\n\nif ( Object.keys(msg.oauth2 || {}).length > 0 ){\n\n if (\n msg.oauth2.hasOwnProperty('access_token') &&\n msg.oauth2.hasOwnProperty('refresh_token') &&\n msg.oauth2.hasOwnProperty('id_token')\n ){\n\n\n var iToken = String(msg.oauth2.id_token).split('.');\n\n for (var i = 1; i < iToken.length; i++) {\n\n var base64 = Buffer.from(iToken[i - 1], 'base64');\n\n //decoded[(i - 1)] = Buffer.from(aToken[i - 1]).toString(decoded);\n //idToken[(i - 1)] = iToken[i - 1];\n idToken[(i - 1)] = base64.toString('ascii');\n\n }\n\n idToken[1] = JSON.parse(idToken[1]);\n\n\n msg.session = {\n \"datetime\": Math.floor(Date.now() / 1000) + msg.oauth2.refresh_expires_in,\n \"user\": {\n \"username\": idToken[1].preferred_username,\n \"mail\": idToken[1].email\n },\n \"oauth2\": msg.oauth2,\n \"type\": \"oauth2\"\n };\n\n msg.cookies = {\n \"auth\": {\n maxAge: msg.oauth2.refresh_expires_in * 1000\n }\n };\n\n msg.length = 60;\n\n success = msg;\n failure = null;\n status.text = \"Success\";\n status.fill = \"green\";\n\n } else {\n\n // success = null;\n // failure = msg;\n status.text = \"Failure: missing properties\";\n status.fill = \"yellow\";\n\n }\n\n}\n\n//msg.idToken = idToken;\n\n\n\nnode.status(status);\n\nnode.send([\n success,\n failure\n]);",
|
|
"outputs": 2,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 580,
|
|
"y": 2760,
|
|
"wires": [
|
|
[
|
|
"5eaba17d961e2efb"
|
|
],
|
|
[
|
|
"d43b2afbfaad2d31"
|
|
]
|
|
],
|
|
"outputLabels": [
|
|
"Success",
|
|
"Failure"
|
|
],
|
|
"icon": "font-awesome/fa-question"
|
|
},
|
|
{
|
|
"id": "10120b4cdade08c6",
|
|
"type": "link call",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "69f0d6271fe16536",
|
|
"name": "Get Session Filename",
|
|
"links": [
|
|
"17276c106d99423c"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 1640,
|
|
"y": 2720,
|
|
"wires": [
|
|
[
|
|
"05880bb4ed6cab41"
|
|
]
|
|
],
|
|
"icon": "font-awesome/fa-info-circle"
|
|
},
|
|
{
|
|
"id": "05880bb4ed6cab41",
|
|
"type": "function",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "69f0d6271fe16536",
|
|
"name": "",
|
|
"func": "var save_path = String(env.get('HOME') + '/' + global.get('config.paths.token_sessions'));\n\nvar status = {fill:\"red\",shape:\"ring\",text:\"message\"};\n\nif( msg.token_refresh ) {\n\n msg.filename = save_path + msg.filename;\n\n status.fill = 'green';\n status.text = 'Token Refresh';\n\n} else {\n\n msg.filename = save_path + msg.filename;\n\n status.fill = 'yellow';\n status.text = 'New Auth';\n\n}\n\nmsg.payload = msg.session;\n\nnode.status(status);\n\nreturn msg;",
|
|
"outputs": 1,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 1840,
|
|
"y": 2720,
|
|
"wires": [
|
|
[
|
|
"c3a8957e4400e12f"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "c3a8957e4400e12f",
|
|
"type": "file",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "69f0d6271fe16536",
|
|
"name": "Save session",
|
|
"filename": "filename",
|
|
"filenameType": "msg",
|
|
"appendNewline": true,
|
|
"createDir": false,
|
|
"overwriteFile": "true",
|
|
"encoding": "none",
|
|
"x": 1990,
|
|
"y": 2720,
|
|
"wires": [
|
|
[
|
|
"1380f91c814b8e2f"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "1380f91c814b8e2f",
|
|
"type": "function",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "69f0d6271fe16536",
|
|
"name": "Confirm session saved",
|
|
"func": "var success = null;\nvar callback = null;\nvar failure = msg;\n\nvar status = { fill: \"red\", shape: \"ring\", text: \"incomplete\"};\n\nvar url = '/auth';\n\nfs.stat(msg.filename, function (err) {\n\n if (err) {\n status.text = \"false\";\n status.fill = \"yellow\";\n\n } else {\n status.text = \"true\";\n status.fill = \"green\";\n\n if (! msg.token_refresh ) {\n\n msg.cookies.auth.value = msg.hash.value;\n msg.headers = {\n Location: \"/\"\n }\n\n msg.statusCode = 302;\n\n callback = msg;\n failure = null;\n\n }else {\n msg.payload = 'Token refresh';\n \n success = msg;\n failure = null;\n }\n \n\n \n\n \n delete msg.hash;\n delete msg.filename;\n delete msg.retry\n delete msg.payload;\n }\n\n node.status(status);\n\n node.send([\n success,\n callback,\n failure\n ]);\n\n})\n\n\n\n",
|
|
"outputs": 3,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [
|
|
{
|
|
"var": "fs",
|
|
"module": "fs"
|
|
}
|
|
],
|
|
"x": 2180,
|
|
"y": 2720,
|
|
"wires": [
|
|
[
|
|
"d24ebda198149601"
|
|
],
|
|
[
|
|
"4ff84724b26afc75"
|
|
],
|
|
[
|
|
"54179a47b3037bcb"
|
|
]
|
|
],
|
|
"outputLabels": [
|
|
"Success",
|
|
"Callback",
|
|
"Failure"
|
|
],
|
|
"icon": "font-awesome/fa-question"
|
|
},
|
|
{
|
|
"id": "d24ebda198149601",
|
|
"type": "link out",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "69f0d6271fe16536",
|
|
"name": "Session Saved",
|
|
"mode": "link",
|
|
"links": [
|
|
"e80aabc47c664088"
|
|
],
|
|
"x": 2400,
|
|
"y": 2680,
|
|
"wires": [],
|
|
"icon": "node-red/arrow-in.svg",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "a49db4bcea29097d",
|
|
"type": "debug",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "9f3711f96411e2cc",
|
|
"name": "debug 133",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 2150,
|
|
"y": 2520,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "9d0d1d9a6c596428",
|
|
"type": "link in",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "9f3711f96411e2cc",
|
|
"name": "Oauth2: Code to Token",
|
|
"links": [
|
|
"60a97c78327c3a6a"
|
|
],
|
|
"x": 1420,
|
|
"y": 2520,
|
|
"wires": [
|
|
[
|
|
"a4a3bb52d2eaa071"
|
|
]
|
|
],
|
|
"icon": "font-awesome/fa-lock",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "a4a3bb52d2eaa071",
|
|
"type": "function",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "9f3711f96411e2cc",
|
|
"name": "create token packet",
|
|
"func": "\n\nmsg.url = global.get('config.oauth.url.token');\n\nmsg.method = \"POST\";\nmsg.headers = {}\nmsg.headers[\"content-type\"] = \"application/x-www-form-urlencoded\"\n\nmsg.payload = \"grant_type=authorization_code&scope=openid&client_id=\" + global.get('config.oauth.client_id') + \"&client_secret=\" + global.get('config.oauth.client_secret') + \"&redirect_uri=\" + global.get('config.oauth.url.callback') + \"&code=\" + msg.oauth2.code\n\n\n//delete msg.oauth2Request;\n//delete msg.req;\n//delete msg.res;\ndelete msg.retry;\ndelete msg.oauth2;\n\nreturn msg;",
|
|
"outputs": 1,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 1610,
|
|
"y": 2520,
|
|
"wires": [
|
|
[
|
|
"07ee83c8d9bdbcb2"
|
|
]
|
|
],
|
|
"icon": "node-red-contrib-filesystem/fs-stats.svg"
|
|
},
|
|
{
|
|
"id": "07ee83c8d9bdbcb2",
|
|
"type": "http request",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "9f3711f96411e2cc",
|
|
"name": "Fetch Access Token",
|
|
"method": "use",
|
|
"ret": "obj",
|
|
"paytoqs": "ignore",
|
|
"url": "",
|
|
"tls": "",
|
|
"persist": false,
|
|
"proxy": "",
|
|
"insecureHTTPParser": false,
|
|
"authType": "",
|
|
"senderr": false,
|
|
"headers": [],
|
|
"x": 1800,
|
|
"y": 2520,
|
|
"wires": [
|
|
[
|
|
"a49db4bcea29097d",
|
|
"8b072412d6eea267"
|
|
]
|
|
],
|
|
"icon": "font-awesome/fa-arrow-down"
|
|
},
|
|
{
|
|
"id": "8b072412d6eea267",
|
|
"type": "link out",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "9f3711f96411e2cc",
|
|
"name": "Process Token",
|
|
"mode": "link",
|
|
"links": [
|
|
"97fb6e1471c0f7cd"
|
|
],
|
|
"x": 1980,
|
|
"y": 2520,
|
|
"wires": [],
|
|
"icon": "font-awesome/fa-unlock",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "444cde06405f24e3",
|
|
"type": "comment",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "9f3711f96411e2cc",
|
|
"name": "ToDo",
|
|
"info": "check for http 400, and return error on screen",
|
|
"x": 1990,
|
|
"y": 2480,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "8e670403cf071aaf",
|
|
"type": "function",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "10a6c6b12749dda9",
|
|
"name": "Build: Command",
|
|
"func": "msg.command = 'bash -c \"tr -dc \\'A-Za-z0-9\\' </dev/urandom | head -c ' + String(msg.length || 6) + ' ; echo -n\"'\n\nreturn msg;",
|
|
"outputs": 1,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 510,
|
|
"y": 420,
|
|
"wires": [
|
|
[
|
|
"804feccd90b3276c"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "17276c106d99423c",
|
|
"type": "link in",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "e8558844b3710e7b",
|
|
"name": "Filename: Session",
|
|
"links": [],
|
|
"x": 230,
|
|
"y": 560,
|
|
"wires": [
|
|
[
|
|
"745056010192e36a"
|
|
]
|
|
],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "dacd02c9aec07af9",
|
|
"type": "link call",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "e8558844b3710e7b",
|
|
"name": "",
|
|
"links": [
|
|
"43eebf1623f29074"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 730,
|
|
"y": 560,
|
|
"wires": [
|
|
[
|
|
"1bc65c1f44b4a1ac"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "745056010192e36a",
|
|
"type": "function",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "e8558844b3710e7b",
|
|
"name": "Build: Hash Details",
|
|
"func": "msg.hash = {};\nmsg.hash.type = 'sha256';\n\nmsg.length = 60;\n\nreturn msg;",
|
|
"outputs": 1,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 410,
|
|
"y": 560,
|
|
"wires": [
|
|
[
|
|
"b595d8148f247f69"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "aade2f705a555f31",
|
|
"type": "link out",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "e8558844b3710e7b",
|
|
"name": "Return",
|
|
"mode": "return",
|
|
"links": [],
|
|
"x": 1030,
|
|
"y": 560,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "1bc65c1f44b4a1ac",
|
|
"type": "function",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "e8558844b3710e7b",
|
|
"name": "Build: Hash Details",
|
|
"func": "\nmsg.filename = msg.hash.value + '.json'\n\ndelete msg.length;\n\nreturn msg;",
|
|
"outputs": 1,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 890,
|
|
"y": 560,
|
|
"wires": [
|
|
[
|
|
"aade2f705a555f31"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "b595d8148f247f69",
|
|
"type": "link call",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "e8558844b3710e7b",
|
|
"name": "Random String",
|
|
"links": [
|
|
"869469819396a632"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 580,
|
|
"y": 560,
|
|
"wires": [
|
|
[
|
|
"dacd02c9aec07af9"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "4ff84724b26afc75",
|
|
"type": "http response",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "69f0d6271fe16536",
|
|
"name": "",
|
|
"statusCode": "",
|
|
"headers": {},
|
|
"x": 2510,
|
|
"y": 2720,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "e2cbcdcc69e9ce21",
|
|
"type": "change",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "69f0d6271fe16536",
|
|
"name": "",
|
|
"rules": [
|
|
{
|
|
"t": "move",
|
|
"p": "payload[0]",
|
|
"pt": "msg",
|
|
"to": "ldap",
|
|
"tot": "msg"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "session.user.fname",
|
|
"pt": "msg",
|
|
"to": "ldap.givenName",
|
|
"tot": "msg"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "session.user.lname",
|
|
"pt": "msg",
|
|
"to": "ldap.sn",
|
|
"tot": "msg"
|
|
},
|
|
{
|
|
"t": "delete",
|
|
"p": "payload",
|
|
"pt": "msg"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 1380,
|
|
"y": 2720,
|
|
"wires": [
|
|
[
|
|
"3f5bfeb6ef2a9467"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "431bb2a5b956dd2c",
|
|
"type": "switch",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "69f0d6271fe16536",
|
|
"name": "User Found",
|
|
"property": "$count(msg.payload)",
|
|
"propertyType": "jsonata",
|
|
"rules": [
|
|
{
|
|
"t": "eq",
|
|
"v": "1\t",
|
|
"vt": "num"
|
|
},
|
|
{
|
|
"t": "else"
|
|
}
|
|
],
|
|
"checkall": "false",
|
|
"repair": false,
|
|
"outputs": 2,
|
|
"x": 1190,
|
|
"y": 2740,
|
|
"wires": [
|
|
[
|
|
"e2cbcdcc69e9ce21"
|
|
],
|
|
[]
|
|
]
|
|
},
|
|
{
|
|
"id": "fb600cd457e87c43",
|
|
"type": "ldap-search in",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "69f0d6271fe16536",
|
|
"name": "Find LDAP User",
|
|
"ldap": "160d0b5ed597dc51",
|
|
"baseDn": "dc=nww",
|
|
"searchScope": "sub",
|
|
"filter": "",
|
|
"attributes": "dn,cn,givenName,sn,uid,mail",
|
|
"x": 1040,
|
|
"y": 2740,
|
|
"wires": [
|
|
[
|
|
"431bb2a5b956dd2c"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "5eaba17d961e2efb",
|
|
"type": "template",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "69f0d6271fe16536",
|
|
"name": "Create LDAP Search Filter",
|
|
"field": "filter",
|
|
"fieldType": "msg",
|
|
"format": "handlebars",
|
|
"syntax": "mustache",
|
|
"template": "(&(objectclass=*)(uid={{ session.user.username }})(mail={{ session.user.mail }}))",
|
|
"output": "str",
|
|
"x": 820,
|
|
"y": 2740,
|
|
"wires": [
|
|
[
|
|
"fb600cd457e87c43"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "54179a47b3037bcb",
|
|
"type": "debug",
|
|
"z": "8179bf22c4c31682",
|
|
"name": "debug 163",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 2530,
|
|
"y": 2900,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "97fb6e1471c0f7cd",
|
|
"type": "link in",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "7225c45ad941c14f",
|
|
"name": "Oauth2: Success",
|
|
"links": [
|
|
"8b072412d6eea267",
|
|
"e6f37f07e9217707"
|
|
],
|
|
"x": 2500,
|
|
"y": 2480,
|
|
"wires": [
|
|
[
|
|
"261436c730a46051"
|
|
]
|
|
],
|
|
"icon": "font-awesome/fa-unlock",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "261436c730a46051",
|
|
"type": "link out",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "7225c45ad941c14f",
|
|
"name": "Oauth2: Process Token",
|
|
"mode": "link",
|
|
"links": [
|
|
"150344ba8db2ceee"
|
|
],
|
|
"x": 2690,
|
|
"y": 2480,
|
|
"wires": [],
|
|
"icon": "node-red/arrow-in.svg",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "cb10034e64c15167",
|
|
"type": "inject",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "5851acefa1f1b5ff",
|
|
"name": "Create Auth Token",
|
|
"props": [
|
|
{
|
|
"p": "auth",
|
|
"v": "true",
|
|
"vt": "bool"
|
|
},
|
|
{
|
|
"p": "datetime",
|
|
"v": "",
|
|
"vt": "date"
|
|
}
|
|
],
|
|
"repeat": "",
|
|
"crontab": "",
|
|
"once": false,
|
|
"onceDelay": 0.1,
|
|
"topic": "",
|
|
"x": 1150,
|
|
"y": 2040,
|
|
"wires": [
|
|
[
|
|
"e350059bd801a5ab"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "2f7615b7afa603aa",
|
|
"type": "function",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "5851acefa1f1b5ff",
|
|
"name": "Build: Hash Details",
|
|
"func": "msg.hash = {};\nmsg.hash.string = msg.datetime;\nmsg.hash.type = 'sha256';\n\nreturn msg;",
|
|
"outputs": 1,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 1630,
|
|
"y": 2080,
|
|
"wires": [
|
|
[
|
|
"0107c5fd18462084"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "0107c5fd18462084",
|
|
"type": "link call",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "5851acefa1f1b5ff",
|
|
"name": "",
|
|
"links": [
|
|
"43eebf1623f29074"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 1790,
|
|
"y": 2080,
|
|
"wires": [
|
|
[
|
|
"99a20ee6c80595d1"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "99a20ee6c80595d1",
|
|
"type": "function",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "5851acefa1f1b5ff",
|
|
"name": "Data",
|
|
"func": "\nvar date = new Date();\nvar timestamp = date.getTime();\nmsg.timestamp = timestamp;\n\nmsg.expires = timestamp + (86400 * 1000);\n\nmsg.payload = { \n \"datetime\": msg.expires,\n \"type\": \"token\",\n \"user\": msg.auth.user\n };\nmsg.filename = global.get('config.paths.token_sessions') + msg.hash.value + '.json';\n\nreturn msg;\n",
|
|
"outputs": 1,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 1910,
|
|
"y": 2080,
|
|
"wires": [
|
|
[
|
|
"9bb0664a91ae9b97"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "9bb0664a91ae9b97",
|
|
"type": "file",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "5851acefa1f1b5ff",
|
|
"name": "",
|
|
"filename": "filename",
|
|
"filenameType": "msg",
|
|
"appendNewline": true,
|
|
"createDir": true,
|
|
"overwriteFile": "true",
|
|
"encoding": "none",
|
|
"x": 2020,
|
|
"y": 2080,
|
|
"wires": [
|
|
[
|
|
"f08e22fcc829d7b2",
|
|
"a68c08dfd9ce3d8c"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "f08e22fcc829d7b2",
|
|
"type": "debug",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "5851acefa1f1b5ff",
|
|
"name": "Auth Token",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 2190,
|
|
"y": 2040,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "e350059bd801a5ab",
|
|
"type": "function",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "5851acefa1f1b5ff",
|
|
"name": "Development: User Details",
|
|
"func": "msg.auth = {};\n\nmsg.auth.user = {\n \"username\": \"barny.gumble\",\n \"fname\": \"Barny\",\n \"lname\": \"Gumble\",\n \"mail\": \"barney.gumble@dinomail.com\"\n };\n\nreturn msg;\n",
|
|
"outputs": 1,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 1380,
|
|
"y": 2040,
|
|
"wires": [
|
|
[
|
|
"2f7615b7afa603aa"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "702a6efc7be81391",
|
|
"type": "comment",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "5851acefa1f1b5ff",
|
|
"name": "ToDo: add random salt to hash generation",
|
|
"info": "",
|
|
"x": 1720,
|
|
"y": 2040,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "1dc714dfeaa9a42d",
|
|
"type": "link call",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "5851acefa1f1b5ff",
|
|
"name": "Token: Generate",
|
|
"links": [],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 1130,
|
|
"y": 2080,
|
|
"wires": [
|
|
[
|
|
"2f7615b7afa603aa"
|
|
]
|
|
],
|
|
"icon": "node-red/arrow-in.svg"
|
|
},
|
|
{
|
|
"id": "a68c08dfd9ce3d8c",
|
|
"type": "link out",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "5851acefa1f1b5ff",
|
|
"name": "Return",
|
|
"mode": "return",
|
|
"links": [],
|
|
"x": 2240,
|
|
"y": 2080,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "1552576e6e79e172",
|
|
"type": "function",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "bbd929c437c592ea",
|
|
"name": "Logout check",
|
|
"func": "var authenticate = msg;\nvar logout = null;\n\nvar status = {fill:\"red\",shape:\"ring\",text:\"Err: Incomplete\"};\n\nif (msg.req._parsedUrl.path == '/logout' ){\n\n msg.session = {};\n status.fill = 'green';\n status.text = 'logout';\n\n authenticate = null;\n logout = msg;\n\n}else{\n status.fill = 'blue';\n status.text = 'authenticate';\n}\n\nnode.status( status );\n\nnode.send([\n authenticate,\n logout\n]);",
|
|
"outputs": 2,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 390,
|
|
"y": 1600,
|
|
"wires": [
|
|
[
|
|
"f9550cdd015b52ae"
|
|
],
|
|
[
|
|
"a67892bd64d2ded4"
|
|
]
|
|
],
|
|
"outputLabels": [
|
|
"Authenticate",
|
|
"Logout"
|
|
],
|
|
"icon": "font-awesome/fa-question"
|
|
},
|
|
{
|
|
"id": "3fa2f7ecc012d8c6",
|
|
"type": "link out",
|
|
"z": "8179bf22c4c31682",
|
|
"g": "bbd929c437c592ea",
|
|
"name": "Logout",
|
|
"mode": "link",
|
|
"links": [
|
|
"e80aabc47c664088"
|
|
],
|
|
"x": 610,
|
|
"y": 1620,
|
|
"wires": [],
|
|
"icon": "font-awesome/fa-sign-out",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "17f893c2bb347668",
|
|
"type": "inject",
|
|
"z": "104f7938a23fe82f",
|
|
"name": "Start",
|
|
"props": [
|
|
{
|
|
"p": "payload"
|
|
}
|
|
],
|
|
"repeat": "300",
|
|
"crontab": "",
|
|
"once": true,
|
|
"onceDelay": 0.1,
|
|
"topic": "",
|
|
"payload": "3",
|
|
"payloadType": "num",
|
|
"x": 110,
|
|
"y": 220,
|
|
"wires": [
|
|
[
|
|
"a740ac24fa947f73"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "6dc681185dff1d75",
|
|
"type": "comment",
|
|
"z": "104f7938a23fe82f",
|
|
"name": "Flow Start",
|
|
"info": "Flow Start",
|
|
"x": 100,
|
|
"y": 140,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "9587918c59375270",
|
|
"type": "inject",
|
|
"z": "104f7938a23fe82f",
|
|
"name": "Start: Manual Failsafe",
|
|
"props": [
|
|
{
|
|
"p": "payload"
|
|
},
|
|
{
|
|
"p": "topic",
|
|
"vt": "str"
|
|
}
|
|
],
|
|
"repeat": "",
|
|
"crontab": "",
|
|
"once": false,
|
|
"onceDelay": 0.1,
|
|
"topic": "",
|
|
"payload": "2",
|
|
"payloadType": "num",
|
|
"x": 580,
|
|
"y": 180,
|
|
"wires": [
|
|
[
|
|
"4ab2787bb0227121"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "ab1b24f61ae7f3bf",
|
|
"type": "debug",
|
|
"z": "104f7938a23fe82f",
|
|
"name": "Start",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 370,
|
|
"y": 260,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "0097abc4a9b09076",
|
|
"type": "trigger",
|
|
"z": "104f7938a23fe82f",
|
|
"name": "fail safe: start flow",
|
|
"op1": "",
|
|
"op2": "4",
|
|
"op1type": "nul",
|
|
"op2type": "num",
|
|
"duration": "303",
|
|
"extend": true,
|
|
"overrideDelay": false,
|
|
"units": "s",
|
|
"reset": "",
|
|
"bytopic": "all",
|
|
"topic": "topic",
|
|
"outputs": 1,
|
|
"x": 590,
|
|
"y": 260,
|
|
"wires": [
|
|
[
|
|
"a493231bd5231b91",
|
|
"4ab2787bb0227121"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "a493231bd5231b91",
|
|
"type": "debug",
|
|
"z": "104f7938a23fe82f",
|
|
"name": "FailSafe: Session Start",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 820,
|
|
"y": 280,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "cd999564657880cc",
|
|
"type": "switch",
|
|
"z": "104f7938a23fe82f",
|
|
"name": "Debug No Auto-run",
|
|
"property": "config.glpi.debug_on",
|
|
"propertyType": "global",
|
|
"rules": [
|
|
{
|
|
"t": "eq",
|
|
"v": "true",
|
|
"vt": "str"
|
|
},
|
|
{
|
|
"t": "eq",
|
|
"v": "false",
|
|
"vt": "str"
|
|
}
|
|
],
|
|
"checkall": "true",
|
|
"repair": false,
|
|
"outputs": 2,
|
|
"x": 1410,
|
|
"y": 220,
|
|
"wires": [
|
|
[
|
|
"271a0053b235aad2"
|
|
],
|
|
[
|
|
"c2d23a114d11726f",
|
|
"e2fdc9ac8f0f5378"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "271a0053b235aad2",
|
|
"type": "switch",
|
|
"z": "104f7938a23fe82f",
|
|
"name": "Manual Run Only",
|
|
"property": "payload",
|
|
"propertyType": "msg",
|
|
"rules": [
|
|
{
|
|
"t": "lt",
|
|
"v": "3",
|
|
"vt": "str"
|
|
},
|
|
{
|
|
"t": "else"
|
|
}
|
|
],
|
|
"checkall": "true",
|
|
"repair": false,
|
|
"outputs": 2,
|
|
"x": 1650,
|
|
"y": 180,
|
|
"wires": [
|
|
[
|
|
"d3ee1ecc22c74264",
|
|
"b365499ab7271965"
|
|
],
|
|
[
|
|
"0c185358cc65059b"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "d3ee1ecc22c74264",
|
|
"type": "debug",
|
|
"z": "104f7938a23fe82f",
|
|
"name": "Debug on: Manual run only",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1980,
|
|
"y": 140,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "0c185358cc65059b",
|
|
"type": "debug",
|
|
"z": "104f7938a23fe82f",
|
|
"name": "Debug: On, no autorun",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1960,
|
|
"y": 220,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "c2d23a114d11726f",
|
|
"type": "debug",
|
|
"z": "104f7938a23fe82f",
|
|
"name": "Debug: Off, Autorun Enabled",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1680,
|
|
"y": 240,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "935f35904a0d89bf",
|
|
"type": "link in",
|
|
"z": "104f7938a23fe82f",
|
|
"name": "Manual Start",
|
|
"links": [
|
|
"2f0dd5172e907730",
|
|
"0e97a47512b3c7ef",
|
|
"d6e72db598c850a0",
|
|
"610fb43bda07b3c3",
|
|
"e852bc3458923688"
|
|
],
|
|
"x": 145,
|
|
"y": 180,
|
|
"wires": [
|
|
[
|
|
"a740ac24fa947f73"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "e65438fd63bf5834",
|
|
"type": "link out",
|
|
"z": "104f7938a23fe82f",
|
|
"name": "GLPI: FormCreator",
|
|
"mode": "link",
|
|
"links": [
|
|
"3c3f4ccfbc0ec4e7"
|
|
],
|
|
"x": 2350,
|
|
"y": 280,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "4146b052670fb819",
|
|
"type": "change",
|
|
"z": "104f7938a23fe82f",
|
|
"name": "Globals",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "authorization",
|
|
"pt": "msg",
|
|
"to": "config.glpi.authorization",
|
|
"tot": "global"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "app_token",
|
|
"pt": "msg",
|
|
"to": "config.glpi.app_token",
|
|
"tot": "global"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "api_url",
|
|
"pt": "msg",
|
|
"to": "config.glpi.api_url",
|
|
"tot": "global"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 1160,
|
|
"y": 220,
|
|
"wires": [
|
|
[
|
|
"a9472349e8102352",
|
|
"cd999564657880cc"
|
|
]
|
|
],
|
|
"icon": "font-awesome/fa-cogs"
|
|
},
|
|
{
|
|
"id": "a9472349e8102352",
|
|
"type": "debug",
|
|
"z": "104f7938a23fe82f",
|
|
"name": "debug 56",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1600,
|
|
"y": 120,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "b3adfbc257af34d9",
|
|
"type": "function",
|
|
"z": "104f7938a23fe82f",
|
|
"name": "Config Exists",
|
|
"func": "var exists = null;\nvar absent = msg;\n\n\n// fs.stat('config.glpi.json', function (err) {\n// if (err) {\n// absent = msg;\n// node.warn('here1');\n// } else {\n// if( global.get('config') != null ) {\n// exists = msg;\n// node.warn('here2');\n// }else{\n// config_not_loaded = msg;\n// node.warn('here3');\n// }\n// }\n// node.warn('here4');\n// });\n\n// config.glpi\n//for( var key in Array(global.get('config')).keys()) {\n// for (var key in Object.keys(global.get('config') || {}).keys()) {\n\n// node.warn('key: ' + key)\n// if(key == 'glpi') {\n\n// exists = msg;\n// absent = null;\n\n// }\n// }\n\nif( Object.keys(global.get('config.glpi') || {}).length > 0 ) {\n\n exists = msg\n absent = null;\n\n}\n\nnode.send([exists, absent]);\n",
|
|
"outputs": 3,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [
|
|
{
|
|
"var": "fs",
|
|
"module": "fs"
|
|
}
|
|
],
|
|
"x": 930,
|
|
"y": 220,
|
|
"wires": [
|
|
[
|
|
"4146b052670fb819"
|
|
],
|
|
[
|
|
"e4ec88859fe76e54"
|
|
],
|
|
[
|
|
"59a9bd1194a20f9f"
|
|
]
|
|
],
|
|
"outputLabels": [
|
|
"Exists",
|
|
"Absent",
|
|
"NoConfigLoaded"
|
|
]
|
|
},
|
|
{
|
|
"id": "e4ec88859fe76e54",
|
|
"type": "debug",
|
|
"z": "104f7938a23fe82f",
|
|
"name": "No GLPI Config File",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1180,
|
|
"y": 260,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "59a9bd1194a20f9f",
|
|
"type": "debug",
|
|
"z": "104f7938a23fe82f",
|
|
"name": "No Global Config Loaded",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1190,
|
|
"y": 300,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "e852bc3458923688",
|
|
"type": "link out",
|
|
"z": "104f7938a23fe82f",
|
|
"name": "link out 5",
|
|
"mode": "link",
|
|
"links": [
|
|
"f2259793983f70a6",
|
|
"935f35904a0d89bf"
|
|
],
|
|
"x": 1235,
|
|
"y": 440,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "2b9dec0acc865c80",
|
|
"type": "inject",
|
|
"z": "104f7938a23fe82f",
|
|
"name": "Manual Start",
|
|
"props": [
|
|
{
|
|
"p": "payload"
|
|
},
|
|
{
|
|
"p": "topic",
|
|
"vt": "str"
|
|
}
|
|
],
|
|
"repeat": "",
|
|
"crontab": "",
|
|
"once": false,
|
|
"onceDelay": 0.1,
|
|
"topic": "",
|
|
"payload": "1",
|
|
"payloadType": "num",
|
|
"x": 1080,
|
|
"y": 440,
|
|
"wires": [
|
|
[
|
|
"e852bc3458923688"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "8de5bc665bc27215",
|
|
"type": "http request",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "",
|
|
"method": "GET",
|
|
"ret": "obj",
|
|
"paytoqs": "ignore",
|
|
"url": "",
|
|
"tls": "",
|
|
"persist": false,
|
|
"proxy": "",
|
|
"insecureHTTPParser": false,
|
|
"authType": "",
|
|
"senderr": false,
|
|
"headers": [
|
|
{
|
|
"keyType": "other",
|
|
"keyValue": "App-Token",
|
|
"valueType": "msg",
|
|
"valueValue": "app_token"
|
|
},
|
|
{
|
|
"keyType": "other",
|
|
"keyValue": "Content-Type",
|
|
"valueType": "other",
|
|
"valueValue": "application/json"
|
|
},
|
|
{
|
|
"keyType": "other",
|
|
"keyValue": "Authorization",
|
|
"valueType": "msg",
|
|
"valueValue": "authorization"
|
|
}
|
|
],
|
|
"x": 750,
|
|
"y": 260,
|
|
"wires": [
|
|
[
|
|
"4faa229d7128337c",
|
|
"0ca59c59c589aa9a"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "4faa229d7128337c",
|
|
"type": "switch",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "",
|
|
"property": "statusCode",
|
|
"propertyType": "msg",
|
|
"rules": [
|
|
{
|
|
"t": "eq",
|
|
"v": "200",
|
|
"vt": "num"
|
|
},
|
|
{
|
|
"t": "else"
|
|
}
|
|
],
|
|
"checkall": "true",
|
|
"repair": false,
|
|
"outputs": 2,
|
|
"x": 870,
|
|
"y": 260,
|
|
"wires": [
|
|
[
|
|
"60ce45a4be8c49f5"
|
|
],
|
|
[
|
|
"b1928b4dfdebf45a"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "60ce45a4be8c49f5",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "session_details.session.valid_id",
|
|
"pt": "msg",
|
|
"to": "payload.session_token",
|
|
"tot": "msg"
|
|
},
|
|
{
|
|
"t": "delete",
|
|
"p": "payload",
|
|
"pt": "msg"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "app_token",
|
|
"pt": "flow",
|
|
"to": "app_token",
|
|
"tot": "msg"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "bot_account",
|
|
"pt": "flow",
|
|
"to": "bot_account",
|
|
"tot": "msg"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "authorization",
|
|
"pt": "msg",
|
|
"to": "authorization",
|
|
"tot": "flow"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "authorisation",
|
|
"pt": "msg",
|
|
"to": "authorisation",
|
|
"tot": "flow"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 1040,
|
|
"y": 240,
|
|
"wires": [
|
|
[
|
|
"2138ec0147a36c71",
|
|
"6856e12e77f0102f"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "4974c57bfe4fabf9",
|
|
"type": "inject",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "",
|
|
"props": [
|
|
{
|
|
"p": "payload"
|
|
},
|
|
{
|
|
"p": "topic",
|
|
"vt": "str"
|
|
}
|
|
],
|
|
"repeat": "",
|
|
"crontab": "",
|
|
"once": false,
|
|
"onceDelay": 0.1,
|
|
"topic": "",
|
|
"payload": "",
|
|
"payloadType": "date",
|
|
"x": 300,
|
|
"y": 1020,
|
|
"wires": [
|
|
[
|
|
"04a413764f4af078"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "454c179e9999918e",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Set session-token + URL",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "url",
|
|
"pt": "msg",
|
|
"to": "msg.api_url & \"/PluginFormcreatorFormAnswer\"",
|
|
"tot": "jsonata"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "app_token",
|
|
"pt": "msg",
|
|
"to": "app_token",
|
|
"tot": "flow"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "bot_account",
|
|
"pt": "msg",
|
|
"to": "bot_account",
|
|
"tot": "flow"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 710,
|
|
"y": 960,
|
|
"wires": [
|
|
[
|
|
"8a3fd2b2125c14fb"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "84f26b16f40f482b",
|
|
"type": "comment",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "From 'GLPI' Flow\\n Start",
|
|
"info": "From 'GLPI' Flow\\n\nStart",
|
|
"x": 220,
|
|
"y": 200,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "dfc6e804866badfa",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Form Answers",
|
|
"active": false,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1980,
|
|
"y": 880,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "d6ead9ea953d172e",
|
|
"type": "split",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "List of forms to form",
|
|
"splt": "\\n",
|
|
"spltType": "str",
|
|
"arraySplt": 1,
|
|
"arraySpltType": "len",
|
|
"stream": false,
|
|
"addname": "",
|
|
"x": 1340,
|
|
"y": 940,
|
|
"wires": [
|
|
[
|
|
"883ef304b2dec6bc"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "883ef304b2dec6bc",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Build Answer URL",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "url",
|
|
"pt": "msg",
|
|
"to": "msg.api_url & '/PluginFormcreatorFormAnswer/' & msg.payload.id & '/PluginFormcreatorAnswer?range=0-150'",
|
|
"tot": "jsonata"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "form_details.id",
|
|
"pt": "msg",
|
|
"to": "payload.plugin_formcreator_forms_id",
|
|
"tot": "msg"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "form_details.answer_id",
|
|
"pt": "msg",
|
|
"to": "payload.id",
|
|
"tot": "msg"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "form_details.requester_id",
|
|
"pt": "msg",
|
|
"to": "payload.requester_id",
|
|
"tot": "msg"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "form_details.name",
|
|
"pt": "msg",
|
|
"to": "payload.name",
|
|
"tot": "msg"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "form_details.ticket_entity",
|
|
"pt": "msg",
|
|
"to": "payload.entities_id",
|
|
"tot": "msg"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "form_details.entity_id",
|
|
"pt": "msg",
|
|
"to": "payload.entities_id",
|
|
"tot": "msg"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "method",
|
|
"pt": "msg",
|
|
"to": "GET",
|
|
"tot": "str"
|
|
},
|
|
{
|
|
"t": "move",
|
|
"p": "parts",
|
|
"pt": "msg",
|
|
"to": "form_parts",
|
|
"tot": "msg"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 1530,
|
|
"y": 940,
|
|
"wires": [
|
|
[
|
|
"ae6d3ff335b65b3d",
|
|
"048e10e4b5f175c8"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "ab66728b85b18a91",
|
|
"type": "comment",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Get the forms",
|
|
"info": "",
|
|
"x": 210,
|
|
"y": 960,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "1d89ecbaf2f03503",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "msg.form",
|
|
"rules": [
|
|
{
|
|
"t": "delete",
|
|
"p": "payload",
|
|
"pt": "msg"
|
|
},
|
|
{
|
|
"t": "delete",
|
|
"p": "topic",
|
|
"pt": "msg"
|
|
},
|
|
{
|
|
"t": "delete",
|
|
"p": "url",
|
|
"pt": "msg"
|
|
},
|
|
{
|
|
"t": "delete",
|
|
"p": "responseUrl",
|
|
"pt": "msg"
|
|
},
|
|
{
|
|
"t": "delete",
|
|
"p": "redirectList",
|
|
"pt": "msg"
|
|
},
|
|
{
|
|
"t": "delete",
|
|
"p": "retry",
|
|
"pt": "msg"
|
|
},
|
|
{
|
|
"t": "delete",
|
|
"p": "headers",
|
|
"pt": "msg"
|
|
},
|
|
{
|
|
"t": "delete",
|
|
"p": "parts",
|
|
"pt": "msg"
|
|
},
|
|
{
|
|
"t": "delete",
|
|
"p": "statusCode",
|
|
"pt": "msg"
|
|
},
|
|
{
|
|
"t": "move",
|
|
"p": "form",
|
|
"pt": "msg",
|
|
"to": "questions",
|
|
"tot": "msg"
|
|
},
|
|
{
|
|
"t": "move",
|
|
"p": "form_details",
|
|
"pt": "msg",
|
|
"to": "form",
|
|
"tot": "msg"
|
|
},
|
|
{
|
|
"t": "move",
|
|
"p": "questions",
|
|
"pt": "msg",
|
|
"to": "form.questions",
|
|
"tot": "msg"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 620,
|
|
"y": 1620,
|
|
"wires": [
|
|
[
|
|
"7ec7fc9e20c4a7e8",
|
|
"2a779072acca3f67"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "34a93eb2fba21d96",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Ticket Prepare",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 2260,
|
|
"y": 2220,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "d690fb9681f9829e",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Prepare",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "url",
|
|
"pt": "msg",
|
|
"to": "msg.api_url & \"/Ticket\"",
|
|
"tot": "jsonata"
|
|
},
|
|
{
|
|
"t": "move",
|
|
"p": "generated_template",
|
|
"pt": "msg",
|
|
"to": "payload",
|
|
"tot": "msg"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "session_token",
|
|
"pt": "msg",
|
|
"to": "session_token",
|
|
"tot": "flow"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "method",
|
|
"pt": "msg",
|
|
"to": "POST",
|
|
"tot": "str"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "glpi",
|
|
"pt": "msg",
|
|
"to": "{}",
|
|
"tot": "jsonata"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 2060,
|
|
"y": 2160,
|
|
"wires": [
|
|
[
|
|
"34a93eb2fba21d96",
|
|
"7641a0ba9012b0c4"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "d081be6d1e4379b5",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Create Ticket",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 2410,
|
|
"y": 2120,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "d4cbdb80c6de1a0c",
|
|
"type": "switch",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "HTTP Status",
|
|
"property": "statusCode",
|
|
"propertyType": "msg",
|
|
"rules": [
|
|
{
|
|
"t": "eq",
|
|
"v": "201",
|
|
"vt": "num"
|
|
},
|
|
{
|
|
"t": "else"
|
|
}
|
|
],
|
|
"checkall": "false",
|
|
"repair": false,
|
|
"outputs": 2,
|
|
"x": 2370,
|
|
"y": 2160,
|
|
"wires": [
|
|
[
|
|
"30eb92e619af0e99",
|
|
"facaa6a7395e5d7f"
|
|
],
|
|
[]
|
|
]
|
|
},
|
|
{
|
|
"id": "40bba4658693fcf0",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Amend Ticket",
|
|
"active": false,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 3940,
|
|
"y": 2080,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "baa846245c4d19de",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Upload json to ticket",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "url",
|
|
"pt": "msg",
|
|
"to": "msg.api_url & '/Ticket/' & msg.payload.id &'/TicketTask/'",
|
|
"tot": "jsonata"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "payload",
|
|
"pt": "msg",
|
|
"to": "{\t \"input\": {\t \"tickets_id\": msg.payload.id,\t \"taskcategories_id\": msg.task_category,\t \"users_id\": msg.session_details.session.glpiID,\t \"users_id_editor\": 0,\t \"content\": $string(msg.form),\t \"is_private\": 1,\t \"actiontime\": 0,\t \"begin\": null,\t \"end\": null,\t \"state\": 1,\t \"users_id_tech\": msg.session_details.session.glpiID,\t \"groups_id_tech\": 0,\t\t \"tasktemplates_id\": 0,\t\t \"sourceitems_id\": 0,\t \"sourceof_items_id\": 0,\t \"links\": [\t {\t \"rel\": \"Ticket\",\t \"href\": \"http://127.0.0.1/apirest.php/Ticket/msg.payload.id\"\t },\t {\t \"rel\": \"User\",\t \"href\": $string(\"http://127.0.0.1/apirest.php/User/\" & msg.session_details.session.glpiID)\t },\t {\t \"rel\": \"User\",\t \"href\": $string(\"http://127.0.0.1/apirest.php/User/\" & msg.session_details.session.glpiID)\t }\t ]\t }\t\t}\t",
|
|
"tot": "jsonata"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "method",
|
|
"pt": "msg",
|
|
"to": "post",
|
|
"tot": "str"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 2860,
|
|
"y": 2260,
|
|
"wires": [
|
|
[
|
|
"a1830195f3d24676",
|
|
"3a6a6d119c434dce",
|
|
"f44d85f3dd843e24"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "7af4f7c4d5054119",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Remove Form Answer",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "url",
|
|
"pt": "msg",
|
|
"to": "$string(msg.api_url & '/PluginFormcreatorFormAnswer/' & msg.form.answer_id)",
|
|
"tot": "jsonata"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "method",
|
|
"pt": "msg",
|
|
"to": "DELETE",
|
|
"tot": "str"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 3460,
|
|
"y": 2300,
|
|
"wires": [
|
|
[
|
|
"94e9c3f821a62eed",
|
|
"7bb0fa06d2b81ebf"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "8e8b0cd0b13c0c61",
|
|
"type": "split",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "",
|
|
"splt": "\\n",
|
|
"spltType": "str",
|
|
"arraySplt": 1,
|
|
"arraySpltType": "len",
|
|
"stream": true,
|
|
"addname": "payload",
|
|
"x": 1890,
|
|
"y": 940,
|
|
"wires": [
|
|
[
|
|
"254033ce6df92ac2"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "254033ce6df92ac2",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "form",
|
|
"pt": "msg",
|
|
"to": "{\t \"question_id\": msg.payload.plugin_formcreator_questions_id,\t \"answer\": msg.payload.answer\t}",
|
|
"tot": "jsonata"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "url",
|
|
"pt": "msg",
|
|
"to": "msg.api_url & '/PluginFormcreatorQuestion/' & msg.payload.plugin_formcreator_questions_id & '?range=0-150'",
|
|
"tot": "jsonata"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "method",
|
|
"pt": "msg",
|
|
"to": "GET",
|
|
"tot": "str"
|
|
},
|
|
{
|
|
"t": "move",
|
|
"p": "parts",
|
|
"pt": "msg",
|
|
"to": "answer_parts",
|
|
"tot": "msg"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 2020,
|
|
"y": 940,
|
|
"wires": [
|
|
[
|
|
"7a564f89bd59c747",
|
|
"92f06ed116476f53"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "109cb443e3b18552",
|
|
"type": "join",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Combine Questions",
|
|
"mode": "auto",
|
|
"build": "object",
|
|
"property": "form",
|
|
"propertyType": "msg",
|
|
"key": "form",
|
|
"joiner": "\\n",
|
|
"joinerType": "str",
|
|
"accumulate": true,
|
|
"timeout": "5",
|
|
"count": "3",
|
|
"reduceRight": false,
|
|
"reduceExp": "",
|
|
"reduceInit": "",
|
|
"reduceInitType": "num",
|
|
"reduceFixup": "",
|
|
"x": 250,
|
|
"y": 1620,
|
|
"wires": [
|
|
[
|
|
"32337fc19b0c6c53",
|
|
"6abd782f33f6aa9f"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "14ec463e022ba2e6",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Add Form fields",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "form.question",
|
|
"pt": "msg",
|
|
"to": "payload.name",
|
|
"tot": "msg"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "form.field_type",
|
|
"pt": "msg",
|
|
"to": "payload.fieldtype",
|
|
"tot": "msg"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 2780,
|
|
"y": 660,
|
|
"wires": [
|
|
[
|
|
"77a912d5ef7737c9",
|
|
"32c5dc82712e4b12"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "77a912d5ef7737c9",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Form Fields",
|
|
"active": false,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 3030,
|
|
"y": 560,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "d50561ffddac19e4",
|
|
"type": "comment",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Split messages and build form json",
|
|
"info": "",
|
|
"x": 1980,
|
|
"y": 1000,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "159ed95d7807ebf4",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Fetch Question Details",
|
|
"active": false,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 2500,
|
|
"y": 980,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "cf4fe833c9fe8b07",
|
|
"type": "comment",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Form Details",
|
|
"info": "",
|
|
"x": 3230,
|
|
"y": 540,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "38ea96d6c95ce24a",
|
|
"type": "comment",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Ticket Creation",
|
|
"info": "",
|
|
"x": 1860,
|
|
"y": 2120,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "4cbac34d37797cc9",
|
|
"type": "comment",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Ticket Details",
|
|
"info": "",
|
|
"x": 2890,
|
|
"y": 1960,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "9a5db65742117413",
|
|
"type": "comment",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "ToDo",
|
|
"info": "",
|
|
"x": 210,
|
|
"y": 620,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "92f06ed116476f53",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Split Form Answer",
|
|
"active": false,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 2230,
|
|
"y": 900,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "63ed9783b1185337",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Session Details",
|
|
"active": false,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1760,
|
|
"y": 220,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "0ca59c59c589aa9a",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Session Init",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 970,
|
|
"y": 340,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "31641a423aec4269",
|
|
"type": "inject",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "",
|
|
"props": [
|
|
{
|
|
"p": "payload"
|
|
},
|
|
{
|
|
"p": "topic",
|
|
"vt": "str"
|
|
}
|
|
],
|
|
"repeat": "",
|
|
"crontab": "",
|
|
"once": false,
|
|
"onceDelay": 0.1,
|
|
"topic": "",
|
|
"payload": "",
|
|
"payloadType": "date",
|
|
"x": 400,
|
|
"y": 3940,
|
|
"wires": [
|
|
[
|
|
"35d95d641dd4fa34"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "35d95d641dd4fa34",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Set session-token + URL",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "session_token",
|
|
"pt": "msg",
|
|
"to": "session_token",
|
|
"tot": "flow"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "url",
|
|
"pt": "msg",
|
|
"to": "http://glpi/apirest.php/TicketTask/?searchText[users_id_tech]=11&searchText[state]=1",
|
|
"tot": "str"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "app_token",
|
|
"pt": "msg",
|
|
"to": "app_token",
|
|
"tot": "flow"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "bot_account",
|
|
"pt": "msg",
|
|
"to": "bot_account",
|
|
"tot": "flow"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 410,
|
|
"y": 3820,
|
|
"wires": [
|
|
[
|
|
"fa23ae9590ce975a"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "fa23ae9590ce975a",
|
|
"type": "http request",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Get All form Answers",
|
|
"method": "GET",
|
|
"ret": "obj",
|
|
"paytoqs": "ignore",
|
|
"url": "",
|
|
"tls": "",
|
|
"persist": false,
|
|
"proxy": "",
|
|
"insecureHTTPParser": false,
|
|
"authType": "",
|
|
"senderr": false,
|
|
"headers": [
|
|
{
|
|
"keyType": "other",
|
|
"keyValue": "App-Token",
|
|
"valueType": "msg",
|
|
"valueValue": "app_token"
|
|
},
|
|
{
|
|
"keyType": "Content-Type",
|
|
"keyValue": "",
|
|
"valueType": "other",
|
|
"valueValue": "application/json"
|
|
},
|
|
{
|
|
"keyType": "other",
|
|
"keyValue": "Session-Token",
|
|
"valueType": "msg",
|
|
"valueValue": "session_token"
|
|
}
|
|
],
|
|
"x": 520,
|
|
"y": 3780,
|
|
"wires": [
|
|
[
|
|
"be9730be497c0a0a",
|
|
"e07e2c386f4dd6a2"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "be9730be497c0a0a",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "debug 17",
|
|
"active": false,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 680,
|
|
"y": 3720,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "e369c19f7af0f81f",
|
|
"type": "comment",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "TEST Get ticket tasks",
|
|
"info": "",
|
|
"x": 240,
|
|
"y": 3740,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "7f220be9b68fe3c9",
|
|
"type": "json",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "",
|
|
"property": "task",
|
|
"action": "obj",
|
|
"pretty": false,
|
|
"x": 930,
|
|
"y": 3820,
|
|
"wires": [
|
|
[
|
|
"9c5bfdbf78f8ce86"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "e07e2c386f4dd6a2",
|
|
"type": "split",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "List of forms to form",
|
|
"splt": "\\n",
|
|
"spltType": "str",
|
|
"arraySplt": 1,
|
|
"arraySpltType": "len",
|
|
"stream": false,
|
|
"addname": "",
|
|
"x": 700,
|
|
"y": 3820,
|
|
"wires": [
|
|
[
|
|
"903ae9214c328d8b",
|
|
"42a4a8bd6fc637b8"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "9c5bfdbf78f8ce86",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "debug 18",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1080,
|
|
"y": 3760,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "903ae9214c328d8b",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Set session-token + URL",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "task",
|
|
"pt": "msg",
|
|
"to": "$string($replace(msg.payload.content, /(\\&\\#\\d{2}\\;\\/?[a-z]+\\&\\#\\d{2}\\;)/, ''))\t",
|
|
"tot": "jsonata"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 970,
|
|
"y": 3880,
|
|
"wires": [
|
|
[
|
|
"7f220be9b68fe3c9",
|
|
"d26d506004500f22"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "42a4a8bd6fc637b8",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "debug 19",
|
|
"active": false,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 920,
|
|
"y": 3720,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "d26d506004500f22",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "debug 20",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1220,
|
|
"y": 3940,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "b92b33f2ae2ee405",
|
|
"type": "switch",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "",
|
|
"property": "statusCode",
|
|
"propertyType": "msg",
|
|
"rules": [
|
|
{
|
|
"t": "eq",
|
|
"v": "200",
|
|
"vt": "num"
|
|
},
|
|
{
|
|
"t": "else"
|
|
}
|
|
],
|
|
"checkall": "true",
|
|
"repair": false,
|
|
"outputs": 2,
|
|
"x": 990,
|
|
"y": 2300,
|
|
"wires": [
|
|
[
|
|
"15760c44e52dc96e"
|
|
],
|
|
[
|
|
"15760c44e52dc96e"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "15760c44e52dc96e",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "session_token",
|
|
"pt": "flow",
|
|
"to": "",
|
|
"tot": "str"
|
|
},
|
|
{
|
|
"t": "delete",
|
|
"p": "payload",
|
|
"pt": "msg"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 1160,
|
|
"y": 2280,
|
|
"wires": [
|
|
[
|
|
"58412e238946fb86"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "c1b719a6a47b9bdc",
|
|
"type": "comment",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Kill the API session",
|
|
"info": "",
|
|
"x": 170,
|
|
"y": 2240,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "58412e238946fb86",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Session End",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1370,
|
|
"y": 2280,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "348d59445d4c260c",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Form Answers Returned",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1410,
|
|
"y": 980,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "adc6e4883443806f",
|
|
"type": "http request",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "HTTP Request: Kill user session",
|
|
"method": "GET",
|
|
"ret": "obj",
|
|
"paytoqs": "ignore",
|
|
"url": "",
|
|
"tls": "",
|
|
"persist": false,
|
|
"proxy": "",
|
|
"insecureHTTPParser": false,
|
|
"authType": "",
|
|
"senderr": false,
|
|
"headers": [
|
|
{
|
|
"keyType": "other",
|
|
"keyValue": "App-Token",
|
|
"valueType": "msg",
|
|
"valueValue": "app_token"
|
|
},
|
|
{
|
|
"keyType": "Content-Type",
|
|
"keyValue": "",
|
|
"valueType": "other",
|
|
"valueValue": "application/json"
|
|
},
|
|
{
|
|
"keyType": "other",
|
|
"keyValue": "Session-Token",
|
|
"valueType": "msg",
|
|
"valueValue": "session_details.session.valid_id"
|
|
}
|
|
],
|
|
"x": 810,
|
|
"y": 2300,
|
|
"wires": [
|
|
[
|
|
"b92b33f2ae2ee405"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "1e03a208414a3bf0",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Set session-token + URL",
|
|
"rules": [
|
|
{
|
|
"t": "delete",
|
|
"p": "payload",
|
|
"pt": "msg"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "url",
|
|
"pt": "msg",
|
|
"to": "msg.api_url & \"/killSession\"",
|
|
"tot": "jsonata"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "app_token",
|
|
"pt": "msg",
|
|
"to": "app_token",
|
|
"tot": "flow"
|
|
},
|
|
{
|
|
"t": "delete",
|
|
"p": "responseUrl",
|
|
"pt": "msg"
|
|
},
|
|
{
|
|
"t": "delete",
|
|
"p": "method",
|
|
"pt": "msg"
|
|
},
|
|
{
|
|
"t": "delete",
|
|
"p": "statusCode",
|
|
"pt": "msg"
|
|
},
|
|
{
|
|
"t": "delete",
|
|
"p": "headers",
|
|
"pt": "msg"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 530,
|
|
"y": 2300,
|
|
"wires": [
|
|
[
|
|
"adc6e4883443806f",
|
|
"557310b9928fc001"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "04a413764f4af078",
|
|
"type": "switch",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Session Check",
|
|
"property": "session_token",
|
|
"propertyType": "flow",
|
|
"rules": [
|
|
{
|
|
"t": "nempty"
|
|
}
|
|
],
|
|
"checkall": "true",
|
|
"repair": false,
|
|
"outputs": 1,
|
|
"x": 480,
|
|
"y": 1020,
|
|
"wires": [
|
|
[
|
|
"454c179e9999918e"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "c6318878d6c4173e",
|
|
"type": "switch",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Results returned",
|
|
"property": "msg.payload.length",
|
|
"propertyType": "msg",
|
|
"rules": [
|
|
{
|
|
"t": "gt",
|
|
"v": "0",
|
|
"vt": "num"
|
|
},
|
|
{
|
|
"t": "eq",
|
|
"v": "0",
|
|
"vt": "num"
|
|
}
|
|
],
|
|
"checkall": "false",
|
|
"repair": false,
|
|
"outputs": 2,
|
|
"x": 1100,
|
|
"y": 960,
|
|
"wires": [
|
|
[
|
|
"d6ead9ea953d172e",
|
|
"348d59445d4c260c"
|
|
],
|
|
[
|
|
"815974a44d365161",
|
|
"951a8a267481cfe6"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "951a8a267481cfe6",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "No Form Answers Returned",
|
|
"active": false,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1380,
|
|
"y": 1140,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "4350bb1697165898",
|
|
"type": "link in",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "GLPI: End Session",
|
|
"links": [
|
|
"815974a44d365161",
|
|
"94c316c3e6192a53",
|
|
"84ac2b5e6df44243"
|
|
],
|
|
"x": 330,
|
|
"y": 2300,
|
|
"wires": [
|
|
[
|
|
"1e03a208414a3bf0"
|
|
]
|
|
],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "815974a44d365161",
|
|
"type": "link out",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "End GLPI Session",
|
|
"mode": "link",
|
|
"links": [
|
|
"4350bb1697165898"
|
|
],
|
|
"x": 1350,
|
|
"y": 1100,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "94c316c3e6192a53",
|
|
"type": "link out",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "End GLPI Session",
|
|
"mode": "link",
|
|
"links": [
|
|
"4350bb1697165898"
|
|
],
|
|
"x": 4010,
|
|
"y": 2120,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "51124c8c0b7142dd",
|
|
"type": "link out",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "GLPI: Session Fetch end",
|
|
"mode": "return",
|
|
"links": [],
|
|
"x": 1790,
|
|
"y": 260,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "3c3f4ccfbc0ec4e7",
|
|
"type": "link in",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "GLPI: Fetch Forms",
|
|
"links": [
|
|
"e65438fd63bf5834"
|
|
],
|
|
"x": 170,
|
|
"y": 880,
|
|
"wires": [
|
|
[
|
|
"e3b230d99d4bf90e",
|
|
"87d33fd4cc09e27f"
|
|
]
|
|
],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "557310b9928fc001",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "debug 25",
|
|
"active": false,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 720,
|
|
"y": 2240,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "fb18f6154f0c0465",
|
|
"type": "link out",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Dynamic Fields Check",
|
|
"mode": "link",
|
|
"links": [
|
|
"2e2491c09565868d"
|
|
],
|
|
"x": 2500,
|
|
"y": 940,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "2e2491c09565868d",
|
|
"type": "link in",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Form: Dynamic fields",
|
|
"links": [
|
|
"fb18f6154f0c0465"
|
|
],
|
|
"x": 2600,
|
|
"y": 660,
|
|
"wires": [
|
|
[
|
|
"14ec463e022ba2e6"
|
|
]
|
|
],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "e2fd3bd854073749",
|
|
"type": "link in",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Process Form",
|
|
"links": [
|
|
"bcdb9f8a74cd2414"
|
|
],
|
|
"x": 90,
|
|
"y": 1400,
|
|
"wires": [
|
|
[
|
|
"5c7a23d16f3799de"
|
|
]
|
|
],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "bcdb9f8a74cd2414",
|
|
"type": "link out",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Continue",
|
|
"mode": "link",
|
|
"links": [
|
|
"e2fd3bd854073749"
|
|
],
|
|
"x": 4900,
|
|
"y": 700,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "3dee9addd0ed8cd6",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "ticket_category",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "ticket_category",
|
|
"pt": "msg",
|
|
"to": "$number(msg.payload.default_values)\t",
|
|
"tot": "jsonata"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 3480,
|
|
"y": 540,
|
|
"wires": [
|
|
[
|
|
"b1524bd812745460",
|
|
"7d597c9f95237aec"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "32c5dc82712e4b12",
|
|
"type": "switch",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Route fields for processing",
|
|
"property": "$lowercase( msg.payload.name )\t",
|
|
"propertyType": "jsonata",
|
|
"rules": [
|
|
{
|
|
"t": "eq",
|
|
"v": "approval_required",
|
|
"vt": "str"
|
|
},
|
|
{
|
|
"t": "eq",
|
|
"v": "entity_approval",
|
|
"vt": "str"
|
|
},
|
|
{
|
|
"t": "eq",
|
|
"v": "ticket_category",
|
|
"vt": "str"
|
|
},
|
|
{
|
|
"t": "eq",
|
|
"v": "ticket_title",
|
|
"vt": "str"
|
|
},
|
|
{
|
|
"t": "eq",
|
|
"v": "ticket_type",
|
|
"vt": "str"
|
|
},
|
|
{
|
|
"t": "eq",
|
|
"v": "task_category",
|
|
"vt": "str"
|
|
},
|
|
{
|
|
"t": "eq",
|
|
"v": "automation_account_id",
|
|
"vt": "str"
|
|
},
|
|
{
|
|
"t": "eq",
|
|
"v": "approver_id",
|
|
"vt": "str"
|
|
},
|
|
{
|
|
"t": "eq",
|
|
"v": "entity",
|
|
"vt": "str"
|
|
},
|
|
{
|
|
"t": "else"
|
|
}
|
|
],
|
|
"checkall": "false",
|
|
"repair": false,
|
|
"outputs": 10,
|
|
"x": 3080,
|
|
"y": 660,
|
|
"wires": [
|
|
[
|
|
"56cdb59cb181c6f4"
|
|
],
|
|
[
|
|
"ec869fcde783d888"
|
|
],
|
|
[
|
|
"3dee9addd0ed8cd6"
|
|
],
|
|
[
|
|
"0d4ff1f5a09fe7c6"
|
|
],
|
|
[
|
|
"b56ed66c5684c193"
|
|
],
|
|
[
|
|
"738079e881bd7c2c"
|
|
],
|
|
[
|
|
"bf6a0883e2c6fa86"
|
|
],
|
|
[
|
|
"bf6a0883e2c6fa86"
|
|
],
|
|
[
|
|
"8ff8495c24d48ef7"
|
|
],
|
|
[
|
|
"bf6a0883e2c6fa86"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "b1524bd812745460",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "debug 27",
|
|
"active": false,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 4060,
|
|
"y": 540,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "b56ed66c5684c193",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "ticket_type",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "ticket_type",
|
|
"pt": "msg",
|
|
"to": "$number(msg.payload.default_values)",
|
|
"tot": "jsonata"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 3490,
|
|
"y": 620,
|
|
"wires": [
|
|
[
|
|
"83eb1d86b52defce",
|
|
"7d597c9f95237aec"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "83eb1d86b52defce",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "debug 29",
|
|
"active": false,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 4060,
|
|
"y": 620,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "32337fc19b0c6c53",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "msg.form_details",
|
|
"rules": [
|
|
{
|
|
"t": "move",
|
|
"p": "automation_account_id",
|
|
"pt": "msg",
|
|
"to": "form_details.automation_account_id",
|
|
"tot": "msg"
|
|
},
|
|
{
|
|
"t": "move",
|
|
"p": "ticket_category",
|
|
"pt": "msg",
|
|
"to": "form_details.ticket_category",
|
|
"tot": "msg"
|
|
},
|
|
{
|
|
"t": "move",
|
|
"p": "ticket_title",
|
|
"pt": "msg",
|
|
"to": "form_details.ticket_title",
|
|
"tot": "msg"
|
|
},
|
|
{
|
|
"t": "move",
|
|
"p": "ticket_type",
|
|
"pt": "msg",
|
|
"to": "form_details.ticket_type",
|
|
"tot": "msg"
|
|
},
|
|
{
|
|
"t": "move",
|
|
"p": "approval_required",
|
|
"pt": "msg",
|
|
"to": "form_details.approval_required",
|
|
"tot": "msg"
|
|
},
|
|
{
|
|
"t": "move",
|
|
"p": "approver_id",
|
|
"pt": "msg",
|
|
"to": "form_details.approver_id",
|
|
"tot": "msg"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 470,
|
|
"y": 1620,
|
|
"wires": [
|
|
[
|
|
"1d89ecbaf2f03503"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "0d4ff1f5a09fe7c6",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "ticket_title",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "ticket_title",
|
|
"pt": "msg",
|
|
"to": "$string(msg.payload.default_values)",
|
|
"tot": "jsonata"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 3500,
|
|
"y": 580,
|
|
"wires": [
|
|
[
|
|
"06aa9b576afd2be5",
|
|
"7d597c9f95237aec"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "06aa9b576afd2be5",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "debug 32",
|
|
"active": false,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 4060,
|
|
"y": 580,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "9d874e042a1954f0",
|
|
"type": "comment",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "[Done] Add approval to ticket if specified",
|
|
"info": "",
|
|
"x": 310,
|
|
"y": 680,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "b1928b4dfdebf45a",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "HTTP ERROR",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1040,
|
|
"y": 300,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "94e9c3f821a62eed",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Remove Form Answers",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 3470,
|
|
"y": 2340,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "58d7f582867e25b9",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Approver Packet",
|
|
"active": false,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 3430,
|
|
"y": 2100,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "3988dff78ba97852",
|
|
"type": "comment",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Adjust form fields so that multiple approvers for different parts can have differnet approvers",
|
|
"info": "",
|
|
"x": 530,
|
|
"y": 720,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "8c254f92f72ca43b",
|
|
"type": "comment",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "ITILCategory Checks Including building Ticket request from category Template",
|
|
"info": "",
|
|
"x": 350,
|
|
"y": 1540,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "c5055cdaaf932dbc",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Fetch Details",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "url",
|
|
"pt": "msg",
|
|
"to": "msg.api_url & \"/ITILCategory/\" & msg.form.ticket_category",
|
|
"tot": "jsonata"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "method",
|
|
"pt": "msg",
|
|
"to": "GET",
|
|
"tot": "str"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 1050,
|
|
"y": 1600,
|
|
"wires": [
|
|
[
|
|
"5225cbd0ed0d0ee3"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "7ec7fc9e20c4a7e8",
|
|
"type": "switch",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Category Exists",
|
|
"property": "form.ticket_category",
|
|
"propertyType": "msg",
|
|
"rules": [
|
|
{
|
|
"t": "istype",
|
|
"v": "number",
|
|
"vt": "number"
|
|
},
|
|
{
|
|
"t": "else"
|
|
}
|
|
],
|
|
"checkall": "false",
|
|
"repair": false,
|
|
"outputs": 2,
|
|
"x": 860,
|
|
"y": 1620,
|
|
"wires": [
|
|
[
|
|
"c5055cdaaf932dbc"
|
|
],
|
|
[
|
|
"8d453aaee35aa375",
|
|
"fd37bced67415bb7"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "67dd1c6bb33f2633",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "debug 39",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1480,
|
|
"y": 1540,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "77366d1c8a178421",
|
|
"type": "switch",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Incident <> Request",
|
|
"property": "form.ticket_type",
|
|
"propertyType": "msg",
|
|
"rules": [
|
|
{
|
|
"t": "eq",
|
|
"v": "1",
|
|
"vt": "num"
|
|
},
|
|
{
|
|
"t": "eq",
|
|
"v": "2",
|
|
"vt": "num"
|
|
},
|
|
{
|
|
"t": "else"
|
|
}
|
|
],
|
|
"checkall": "false",
|
|
"repair": false,
|
|
"outputs": 3,
|
|
"x": 1660,
|
|
"y": 1600,
|
|
"wires": [
|
|
[
|
|
"1ffc637c2378703d"
|
|
],
|
|
[
|
|
"858c1aaae498389e"
|
|
],
|
|
[
|
|
"858c1aaae498389e"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "24cc9ac0380bd505",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "",
|
|
"rules": [
|
|
{
|
|
"t": "move",
|
|
"p": "payload",
|
|
"pt": "msg",
|
|
"to": "ticket_category",
|
|
"tot": "msg"
|
|
},
|
|
{
|
|
"t": "delete",
|
|
"p": "statusCode",
|
|
"pt": "msg"
|
|
},
|
|
{
|
|
"t": "delete",
|
|
"p": "headers",
|
|
"pt": "msg"
|
|
},
|
|
{
|
|
"t": "delete",
|
|
"p": "redirectList",
|
|
"pt": "msg"
|
|
},
|
|
{
|
|
"t": "delete",
|
|
"p": "retry",
|
|
"pt": "msg"
|
|
},
|
|
{
|
|
"t": "delete",
|
|
"p": "responseUrl",
|
|
"pt": "msg"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 1420,
|
|
"y": 1600,
|
|
"wires": [
|
|
[
|
|
"77366d1c8a178421"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "1ffc637c2378703d",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Incident",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "ticket_template",
|
|
"pt": "msg",
|
|
"to": "ticket_category.tickettemplates_id_incident",
|
|
"tot": "msg"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "ticket_template_applicable",
|
|
"pt": "msg",
|
|
"to": "ticket_category.is_incident",
|
|
"tot": "msg"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 1860,
|
|
"y": 1580,
|
|
"wires": [
|
|
[
|
|
"9c91ead347397f0d"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "858c1aaae498389e",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Request",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "ticket_template",
|
|
"pt": "msg",
|
|
"to": "ticket_category.tickettemplates_id_demand",
|
|
"tot": "msg"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "ticket_template_applicable",
|
|
"pt": "msg",
|
|
"to": "ticket_category.is_request",
|
|
"tot": "msg"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 1860,
|
|
"y": 1620,
|
|
"wires": [
|
|
[
|
|
"9c91ead347397f0d"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "9c91ead347397f0d",
|
|
"type": "switch",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Template Applicable",
|
|
"property": "ticket_template_applicable",
|
|
"propertyType": "msg",
|
|
"rules": [
|
|
{
|
|
"t": "eq",
|
|
"v": "1",
|
|
"vt": "num"
|
|
},
|
|
{
|
|
"t": "eq",
|
|
"v": "0",
|
|
"vt": "num"
|
|
}
|
|
],
|
|
"checkall": "false",
|
|
"repair": false,
|
|
"outputs": 2,
|
|
"x": 2100,
|
|
"y": 1600,
|
|
"wires": [
|
|
[
|
|
"219fbaa53aa78d28"
|
|
],
|
|
[
|
|
"3af87a18632ad1be"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "a672f214ea959fc4",
|
|
"type": "link in",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "GLPI: Ticket Creation",
|
|
"links": [
|
|
"46377a801e0c95c7",
|
|
"8d453aaee35aa375",
|
|
"8dafd33b57416c3f"
|
|
],
|
|
"x": 1880,
|
|
"y": 2160,
|
|
"wires": [
|
|
[
|
|
"d690fb9681f9829e"
|
|
]
|
|
],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "8dafd33b57416c3f",
|
|
"type": "link out",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Continue",
|
|
"mode": "link",
|
|
"links": [
|
|
"a672f214ea959fc4"
|
|
],
|
|
"x": 2460,
|
|
"y": 1680,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "8d453aaee35aa375",
|
|
"type": "link out",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Continue",
|
|
"mode": "link",
|
|
"links": [
|
|
"a672f214ea959fc4"
|
|
],
|
|
"x": 1100,
|
|
"y": 1700,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "3af87a18632ad1be",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Cleanup",
|
|
"rules": [
|
|
{
|
|
"t": "delete",
|
|
"p": "ticket_template_applicable",
|
|
"pt": "msg"
|
|
},
|
|
{
|
|
"t": "delete",
|
|
"p": "ticket_template",
|
|
"pt": "msg"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 2300,
|
|
"y": 1640,
|
|
"wires": [
|
|
[
|
|
"8dafd33b57416c3f",
|
|
"a3b3c181797c094a"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "bbba2b34fa078dc7",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "debug 40",
|
|
"active": false,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 3180,
|
|
"y": 1540,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "219fbaa53aa78d28",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "URL Build",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "url",
|
|
"pt": "msg",
|
|
"to": "msg.api_url & \"/TicketTemplate/\" & msg.ticket_template &\"/TicketTemplatePredefinedField\"",
|
|
"tot": "jsonata"
|
|
},
|
|
{
|
|
"t": "delete",
|
|
"p": "ticket_template_applicable",
|
|
"pt": "msg"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "method",
|
|
"pt": "msg",
|
|
"to": "GET",
|
|
"tot": "str"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 2300,
|
|
"y": 1580,
|
|
"wires": [
|
|
[
|
|
"04a5b3d6d2bb5609"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "389e918ab0b455df",
|
|
"type": "function",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Build Ticket from Template",
|
|
"func": "// \"msg.ticket_fields[String(msg.template_fields[i].num)].field\"\nmsg.generated_template = '{ \"input\": {'\nmsg.items_ticket = \"[\"\nfor (var i = 0; i < msg.template_fields.length; i++) {\n\n // var TicketField = String(msg.template_fields[i].num);\n //var TheField = String(msg.template_fields[i].num); // msg.template_fields[0].num\n\n msg.template_fields[i].name = msg.ticket_fields[String(msg.template_fields[i].num)].field; // msg.ticket_fields[\"1\"].field\n\n var key = msg.template_fields[i].name;\n \n if (key == 'name') {\n msg.template_fields[i].value = msg.template_fields[i].value + msg.form.name;\n }\n if (key == 'content') {\n // msg.template_fields[i].value = String(msg.template_fields[i].value + msg.form.content).replace(\"\\n\", '\\\\r\\\\n').replace(\"\\r\", '');\n if (msg.form.hasOwnProperty(\"content\") ){\n\n msg.template_fields[i].value = String(msg.template_fields[i].value + msg.form.content).replace(/\\n/g, '\\\\r\\\\n').replace(/\\r/g, '').replace(/(\\\")/g, '"');\n \n }else{\n \n msg.template_fields[i].value = String(msg.template_fields[i].value).replace(/\\n/g, '\\\\r\\\\n').replace(/\\r/g, '').replace(/(\\\")/g, '"');\n \n }\n }\n\n \n // var value = String(msg.template_fields[i].value).replace(\"\\n\", '\\\\r\\\\n').replace(\"\\r\", '').replace(/(\\&\\#\\d{2}\\;\\/?[a-z]+\\&\\#\\d{2}\\;)/g, '');\n var value = String(msg.template_fields[i].value).replace(/\\n/g, '\\\\r\\\\n').replace(/\\r/g, '').replace(/(\\\")/g, '"'); // Test to see if html can stay\n\n if( key != 'items_id' ) {\n \n msg.generated_template = msg.generated_template + String(\n '\"' + key + '\": ' +\n '\"' + value + '\",'\n );\n\n } else if (key == 'items_id') {\n\n var item_details = value.split('_')\n\n msg.items_ticket = msg.items_ticket + String(\n \"{\" +\n '\"' + key + '\": ' +\n '\"' + item_details[1] + '\",' \n +\n '\"itemtype\": ' +\n '\"' + item_details[0] + '\"' +\n \"},\"\n );\n\n\n }\n}\n\nif (msg.ticket_category.users_id != 0 && msg.form.approval_required == 1 ) {\n\n msg.form.user_id_approver = msg.ticket_category.users_id;\n msg.generated_template = msg.generated_template + String('\"validation_percent\": ' + 100 + ',');\n\n}\n\nif (msg.ticket_category.groups_id != 0 && msg.form.approval_required == 1 ) {\n\n msg.form.group_id_approver = msg.ticket_category.groups_id;\n msg.generated_template = msg.generated_template + String('\"validation_percent\": ' + 25 + ',');\n}\n\nmsg.generated_template = msg.generated_template + String('\"itilcategories_id\": ' + msg.form.ticket_category + ',' );\nmsg.generated_template = msg.generated_template + String('\"requesttypes_id\": ' + 7 + ',');\nmsg.generated_template = msg.generated_template + String('\"entities_id\": ' + msg.form.ticket_entity);\nmsg.generated_template = msg.generated_template + \"}}\";\nmsg.generated_template = JSON.parse(msg.generated_template);\n\nif(msg.items_ticket != \"[\" ) {\n msg.items_ticket = String(msg.items_ticket).substring(0, msg.items_ticket.length-1) + \"]\";\n msg.items_ticket = JSON.parse(msg.items_ticket);\n}else{\n delete (msg.items_ticket);\n}\n\nif ( ! msg.generated_template.hasOwnProperty(\"name\") ) {\n\n msg.generated_template.name = msg.form.name;\n\n}\n\nreturn msg;",
|
|
"outputs": 1,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 3180,
|
|
"y": 1580,
|
|
"wires": [
|
|
[
|
|
"531c943af7341755",
|
|
"46377a801e0c95c7"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "5d11f290abca4992",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Clean-up / Prep",
|
|
"rules": [
|
|
{
|
|
"t": "move",
|
|
"p": "payload",
|
|
"pt": "msg",
|
|
"to": "template_fields",
|
|
"tot": "msg"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "url",
|
|
"pt": "msg",
|
|
"to": "msg.api_url & \"/listSearchOptions/Ticket\"",
|
|
"tot": "jsonata"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "method",
|
|
"pt": "msg",
|
|
"to": "GET",
|
|
"tot": "str"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 2680,
|
|
"y": 1580,
|
|
"wires": [
|
|
[
|
|
"2cf4482e5aa3d454"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "531c943af7341755",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "debug 41",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 3400,
|
|
"y": 1540,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "13d2fe736f955b77",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Clean-up",
|
|
"rules": [
|
|
{
|
|
"t": "move",
|
|
"p": "payload",
|
|
"pt": "msg",
|
|
"to": "ticket_fields",
|
|
"tot": "msg"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 3000,
|
|
"y": 1580,
|
|
"wires": [
|
|
[
|
|
"389e918ab0b455df",
|
|
"bbba2b34fa078dc7"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "46377a801e0c95c7",
|
|
"type": "link out",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Continue",
|
|
"mode": "link",
|
|
"links": [
|
|
"a672f214ea959fc4"
|
|
],
|
|
"x": 3360,
|
|
"y": 1580,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "f0b8ea2876129114",
|
|
"type": "function",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Approver Packet",
|
|
"func": "//{\n// \"input\": {\n// \"tickets_id\": msg.payload.id,\n// \"users_id_validate\": msg.form.approver_id,\n// \"comment_submission\": $string(\"A request for '\" & msg.form.name & \"' has been made that requires your approval.\"),\n// \"status\": 2\n// }\n//}\n\nif (\n msg.form.hasOwnProperty(\"user_id_approver\")\n ||\n msg.form.hasOwnProperty(\"group_id_approver\")\n ) {\n\n msg.input = {};\n \n msg.input.tickets_id = msg.payload.id;\n msg.input.comment_submission = String(\"As the person listed as responsible, this request requires your approval.\");\n msg.input.status = 2;\n\n if( msg.form.user_id_approver != 0 ) {\n msg.input.users_id_validate = msg.form.user_id_approver;\n }\n if( msg.form.group_id_approver != 0) {\n msg.input.groups_id_validate = msg.form.group_id_approver;\n }\n\n msg.url = String(msg.api_url + '/Ticket/' + msg.payload.id + '/TicketValidation');\n msg.method = \"POST\";\n\n msg.payload = {};\n msg.payload.input = msg.input;\n\n return msg;\n\n}\n",
|
|
"outputs": 1,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 2870,
|
|
"y": 2100,
|
|
"wires": [
|
|
[
|
|
"58d7f582867e25b9",
|
|
"e5548020922347cc"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "f710a0c68b11ee76",
|
|
"type": "function",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Build Ticket Items Packet",
|
|
"func": "\nif( msg.hasOwnProperty(\"items_ticket\") ) {\n\n for (var i = 0; i < msg.items_ticket.length; i++ ) {\n\n msg.items_ticket[i].tickets_id = msg.payload.id\n\n }\n \n msg.payload = {};\n msg.payload.input = msg.items_ticket;\n\n msg.url = msg.api_url + \"/Item_Ticket\"\n msg.method = \"POST\";\n\n return msg;\n\n}\n",
|
|
"outputs": 1,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 2850,
|
|
"y": 2180,
|
|
"wires": [
|
|
[
|
|
"314b414628960c36",
|
|
"e5548020922347cc"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "314b414628960c36",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Ticket Item Packet",
|
|
"active": false,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 3430,
|
|
"y": 2180,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "a7f816f627d2deb8",
|
|
"type": "delay",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "",
|
|
"pauseType": "delay",
|
|
"timeout": "5",
|
|
"timeoutUnits": "seconds",
|
|
"rate": "1",
|
|
"nbRateUnits": "1",
|
|
"rateUnits": "second",
|
|
"randomFirst": "1",
|
|
"randomLast": "5",
|
|
"randomUnits": "seconds",
|
|
"drop": false,
|
|
"allowrate": false,
|
|
"outputs": 1,
|
|
"x": 3860,
|
|
"y": 2120,
|
|
"wires": [
|
|
[
|
|
"94c316c3e6192a53"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "04a5b3d6d2bb5609",
|
|
"type": "link call",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Fetch Ticket Template Fields",
|
|
"links": [
|
|
"eb5f283400263c25"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 2480,
|
|
"y": 1580,
|
|
"wires": [
|
|
[
|
|
"5d11f290abca4992"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "7bb0fa06d2b81ebf",
|
|
"type": "link call",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Amend Ticket",
|
|
"links": [
|
|
"eb5f283400263c25"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 3720,
|
|
"y": 2120,
|
|
"wires": [
|
|
[
|
|
"a7f816f627d2deb8",
|
|
"40bba4658693fcf0",
|
|
"34d02c8cfe43bbe6"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "2cf4482e5aa3d454",
|
|
"type": "link call",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Fetch Field Details",
|
|
"links": [
|
|
"eb5f283400263c25"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 2850,
|
|
"y": 1580,
|
|
"wires": [
|
|
[
|
|
"13d2fe736f955b77"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "7641a0ba9012b0c4",
|
|
"type": "link call",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Create Ticket",
|
|
"links": [
|
|
"eb5f283400263c25"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 2230,
|
|
"y": 2160,
|
|
"wires": [
|
|
[
|
|
"d4cbdb80c6de1a0c",
|
|
"d081be6d1e4379b5"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "fcbf307dae461acb",
|
|
"type": "http request",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "HTTP",
|
|
"method": "use",
|
|
"ret": "obj",
|
|
"paytoqs": "ignore",
|
|
"url": "",
|
|
"tls": "",
|
|
"persist": false,
|
|
"proxy": "",
|
|
"insecureHTTPParser": false,
|
|
"authType": "",
|
|
"senderr": false,
|
|
"headers": [
|
|
{
|
|
"keyType": "other",
|
|
"keyValue": "App-Token",
|
|
"valueType": "msg",
|
|
"valueValue": "app_token"
|
|
},
|
|
{
|
|
"keyType": "Content-Type",
|
|
"keyValue": "",
|
|
"valueType": "other",
|
|
"valueValue": "application/json"
|
|
},
|
|
{
|
|
"keyType": "other",
|
|
"keyValue": "Session-Token",
|
|
"valueType": "msg",
|
|
"valueValue": "session_details.session.valid_id"
|
|
}
|
|
],
|
|
"x": 250,
|
|
"y": 1900,
|
|
"wires": [
|
|
[
|
|
"8dc03813b42d41cb",
|
|
"72eeacf15e359fec"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "eb5f283400263c25",
|
|
"type": "link in",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "GLPI API",
|
|
"links": [],
|
|
"x": 140,
|
|
"y": 1900,
|
|
"wires": [
|
|
[
|
|
"fcbf307dae461acb",
|
|
"e5c1f581fdc90543"
|
|
]
|
|
],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "a1557288d6c101e4",
|
|
"type": "link out",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Return to flow",
|
|
"mode": "return",
|
|
"links": [],
|
|
"x": 1460,
|
|
"y": 1840,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "5225cbd0ed0d0ee3",
|
|
"type": "link call",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Fetch ITILCategory",
|
|
"links": [
|
|
"eb5f283400263c25"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 1210,
|
|
"y": 1600,
|
|
"wires": [
|
|
[
|
|
"24cc9ac0380bd505",
|
|
"67dd1c6bb33f2633"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "e57ec269ddceda7d",
|
|
"type": "comment",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "GLPI API Request",
|
|
"info": "",
|
|
"x": 170,
|
|
"y": 1840,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "2138ec0147a36c71",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Defaults",
|
|
"rules": [
|
|
{
|
|
"t": "delete",
|
|
"p": "payload",
|
|
"pt": "msg"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "automation_account_id",
|
|
"pt": "msg",
|
|
"to": "11",
|
|
"tot": "num"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "url",
|
|
"pt": "msg",
|
|
"to": "msg.api_url & \"/getFullSession\"",
|
|
"tot": "jsonata"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "method",
|
|
"pt": "msg",
|
|
"to": "GET",
|
|
"tot": "str"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 1180,
|
|
"y": 240,
|
|
"wires": [
|
|
[
|
|
"09a9ef3efab61351"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "09a9ef3efab61351",
|
|
"type": "link call",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Get My User ID",
|
|
"links": [
|
|
"eb5f283400263c25"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 1320,
|
|
"y": 240,
|
|
"wires": [
|
|
[
|
|
"0d8fdbae0c5bc0ad"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "d4dcc73bbe878f42",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Clean Up Response",
|
|
"rules": [
|
|
{
|
|
"t": "delete",
|
|
"p": "headers",
|
|
"pt": "msg"
|
|
},
|
|
{
|
|
"t": "delete",
|
|
"p": "redirectList",
|
|
"pt": "msg"
|
|
},
|
|
{
|
|
"t": "delete",
|
|
"p": "retry",
|
|
"pt": "msg"
|
|
},
|
|
{
|
|
"t": "delete",
|
|
"p": "method",
|
|
"pt": "msg"
|
|
},
|
|
{
|
|
"t": "delete",
|
|
"p": "responseUrl",
|
|
"pt": "msg"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 1280,
|
|
"y": 1840,
|
|
"wires": [
|
|
[
|
|
"a1557288d6c101e4"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "8dc03813b42d41cb",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Web Response",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 420,
|
|
"y": 1920,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "0d8fdbae0c5bc0ad",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Session Details",
|
|
"rules": [
|
|
{
|
|
"t": "move",
|
|
"p": "payload",
|
|
"pt": "msg",
|
|
"to": "session_details",
|
|
"tot": "msg"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 1480,
|
|
"y": 240,
|
|
"wires": [
|
|
[
|
|
"63ed9783b1185337",
|
|
"51124c8c0b7142dd"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "6856e12e77f0102f",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "debug 43",
|
|
"active": false,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1320,
|
|
"y": 300,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "8a3fd2b2125c14fb",
|
|
"type": "link call",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Get All form Answers",
|
|
"links": [
|
|
"eb5f283400263c25"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 920,
|
|
"y": 960,
|
|
"wires": [
|
|
[
|
|
"c6318878d6c4173e"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "ae6d3ff335b65b3d",
|
|
"type": "link call",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Get Each Answered Form",
|
|
"links": [
|
|
"eb5f283400263c25"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 1730,
|
|
"y": 940,
|
|
"wires": [
|
|
[
|
|
"8e8b0cd0b13c0c61",
|
|
"dfc6e804866badfa"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "72eeacf15e359fec",
|
|
"type": "switch",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "HTTP StatusCode",
|
|
"property": "statusCode",
|
|
"propertyType": "msg",
|
|
"rules": [
|
|
{
|
|
"t": "eq",
|
|
"v": "200",
|
|
"vt": "num"
|
|
},
|
|
{
|
|
"t": "eq",
|
|
"v": "201",
|
|
"vt": "num"
|
|
},
|
|
{
|
|
"t": "eq",
|
|
"v": "206",
|
|
"vt": "num"
|
|
},
|
|
{
|
|
"t": "else"
|
|
}
|
|
],
|
|
"checkall": "false",
|
|
"repair": false,
|
|
"outputs": 4,
|
|
"x": 630,
|
|
"y": 1900,
|
|
"wires": [
|
|
[
|
|
"bab95cf5ba3d6045"
|
|
],
|
|
[
|
|
"ce4de75bc712f124"
|
|
],
|
|
[
|
|
"ad563b1612f320ce"
|
|
],
|
|
[
|
|
"53b1c5bbed90265f"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "0bf3afb49b551d9c",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Web Error",
|
|
"active": false,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 950,
|
|
"y": 2020,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "7a564f89bd59c747",
|
|
"type": "link call",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Get Question Details",
|
|
"links": [
|
|
"eb5f283400263c25"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 2200,
|
|
"y": 940,
|
|
"wires": [
|
|
[
|
|
"fb18f6154f0c0465",
|
|
"159ed95d7807ebf4"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "29882bec61111349",
|
|
"type": "switch",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Only Remove Form Answer, on success",
|
|
"property": "statusCode",
|
|
"propertyType": "msg",
|
|
"rules": [
|
|
{
|
|
"t": "eq",
|
|
"v": "201",
|
|
"vt": "num"
|
|
},
|
|
{
|
|
"t": "else"
|
|
}
|
|
],
|
|
"checkall": "false",
|
|
"repair": false,
|
|
"outputs": 2,
|
|
"x": 3160,
|
|
"y": 2300,
|
|
"wires": [
|
|
[
|
|
"7af4f7c4d5054119"
|
|
],
|
|
[]
|
|
]
|
|
},
|
|
{
|
|
"id": "a1830195f3d24676",
|
|
"type": "switch",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Debug Don't Delete",
|
|
"property": "debug_on",
|
|
"propertyType": "msg",
|
|
"rules": [
|
|
{
|
|
"t": "false"
|
|
},
|
|
{
|
|
"t": "true"
|
|
}
|
|
],
|
|
"checkall": "false",
|
|
"repair": false,
|
|
"outputs": 2,
|
|
"x": 2870,
|
|
"y": 2300,
|
|
"wires": [
|
|
[
|
|
"29882bec61111349"
|
|
],
|
|
[]
|
|
]
|
|
},
|
|
{
|
|
"id": "e3b230d99d4bf90e",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Fetch Forms",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 670,
|
|
"y": 800,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "ebb2a01cac9a803d",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "HTTP/201",
|
|
"active": false,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 950,
|
|
"y": 1900,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "836dca1c83616f32",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "HTTP/200",
|
|
"active": false,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 950,
|
|
"y": 1860,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "3944fbf533097cbb",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "HTTP/206",
|
|
"active": false,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 950,
|
|
"y": 1940,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "a3b3c181797c094a",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Template N/A",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 2480,
|
|
"y": 1640,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "fd37bced67415bb7",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "No Category",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1110,
|
|
"y": 1660,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "be126901c3d26d5d",
|
|
"type": "comment",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "ToDo: Build ticket packet\\n as no category exists",
|
|
"info": "ToDo: Build ticket packet\\n\nas no category exists",
|
|
"x": 1330,
|
|
"y": 1700,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "405728494cdf7f87",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Un-Processed Field",
|
|
"active": false,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 4090,
|
|
"y": 740,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "2a779072acca3f67",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Pre-Category Exists",
|
|
"active": false,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 900,
|
|
"y": 1560,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "6abd782f33f6aa9f",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Combined Questions",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 700,
|
|
"y": 1680,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "e370037f2b9ae9a6",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Process Form",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 380,
|
|
"y": 1660,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "e97bbbbac1bab270",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "No Payload Required",
|
|
"rules": [
|
|
{
|
|
"t": "delete",
|
|
"p": "payload",
|
|
"pt": "msg"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "url",
|
|
"pt": "msg",
|
|
"to": "msg.api_url & \"/initSession\"",
|
|
"tot": "jsonata"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 580,
|
|
"y": 260,
|
|
"wires": [
|
|
[
|
|
"8de5bc665bc27215"
|
|
]
|
|
],
|
|
"icon": "font-awesome/fa-cogs"
|
|
},
|
|
{
|
|
"id": "8ff8495c24d48ef7",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "flow.entity_id",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "entity_id",
|
|
"pt": "flow",
|
|
"to": "$number(msg.form.answer)\t",
|
|
"tot": "jsonata"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 3490,
|
|
"y": 760,
|
|
"wires": [
|
|
[
|
|
"13b00547bd61210c",
|
|
"7d597c9f95237aec"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "56cdb59cb181c6f4",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "approval_required",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "approval_required",
|
|
"pt": "msg",
|
|
"to": "payload.default_values",
|
|
"tot": "msg"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 3470,
|
|
"y": 420,
|
|
"wires": [
|
|
[
|
|
"e0b3838ab709561b"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "a06872fd8512eb8d",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Approval required",
|
|
"active": false,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 4850,
|
|
"y": 420,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "ec869fcde783d888",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "entity_approval",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "entity_approval",
|
|
"pt": "msg",
|
|
"to": "$number(msg.payload.default_values)",
|
|
"tot": "jsonata"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 3480,
|
|
"y": 460,
|
|
"wires": [
|
|
[
|
|
"0ab23bd954321b9c"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "c0f28e1a21ee46d1",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Entity Approvers",
|
|
"active": false,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 4420,
|
|
"y": 460,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "4b51a5788a45d420",
|
|
"type": "function",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Entity Owner Approver Packet",
|
|
"func": "//{\n// \"input\": {\n// \"tickets_id\": msg.payload.id,\n// \"users_id_validate\": msg.form.approver_id,\n// \"comment_submission\": $string(\"A request for '\" & msg.form.name & \"' has been made that requires your approval.\"),\n// \"status\": 2\n// }\n//}\n\nif (msg.hasOwnProperty(\"entity_approvers\") ) {\n\n msg.input = [];\n msg.url = String(msg.api_url + '/Ticket/' + msg.payload.id + '/TicketValidation');\n\n\n for(var i = 0; i < msg.entity_approvers.length; i++ ) {\n\n var approver = {};\n \n approver.tickets_id = msg.payload.id;\n approver.comment_submission = String(\"As the person listed as responsible, this request requires your approval.\");\n approver.status = 2;\n approver.users_id_validate = msg.entity_approvers[i];\n\n\n \n msg.input[i] = approver;\n \n\n }\n\n msg.payload = {};\n msg.payload.input = msg.input;\n\n msg.method = \"POST\";\n\n return msg;\n}\n",
|
|
"outputs": 1,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 2830,
|
|
"y": 2140,
|
|
"wires": [
|
|
[
|
|
"7926c9939779dd37",
|
|
"e5548020922347cc"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "f5462f2891c454ec",
|
|
"type": "switch",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Approval Type Routing",
|
|
"property": "approval_type",
|
|
"propertyType": "msg",
|
|
"rules": [
|
|
{
|
|
"t": "eq",
|
|
"v": "entity",
|
|
"vt": "str"
|
|
},
|
|
{
|
|
"t": "else"
|
|
}
|
|
],
|
|
"checkall": "true",
|
|
"repair": false,
|
|
"outputs": 2,
|
|
"x": 3940,
|
|
"y": 320,
|
|
"wires": [
|
|
[],
|
|
[]
|
|
]
|
|
},
|
|
{
|
|
"id": "20a4cf95c10a2a5c",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "msg.entity_id",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "entity_id",
|
|
"pt": "msg",
|
|
"to": "entity_id",
|
|
"tot": "flow"
|
|
},
|
|
{
|
|
"t": "delete",
|
|
"p": "entity_id",
|
|
"pt": "flow"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "url",
|
|
"pt": "msg",
|
|
"to": "msg.api_url & \"/Profile_User?searchText[profiles_id]=\" & msg.entity_approval &\"&searchText[entities_id]=\" & msg.entity_id",
|
|
"tot": "jsonata"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "mehod",
|
|
"pt": "msg",
|
|
"to": "GET",
|
|
"tot": "str"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 3950,
|
|
"y": 460,
|
|
"wires": [
|
|
[
|
|
"3d1e72dfd4b897dc"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "3d1e72dfd4b897dc",
|
|
"type": "link call",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Fetch Entity Approvers",
|
|
"links": [
|
|
"eb5f283400263c25"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 4180,
|
|
"y": 460,
|
|
"wires": [
|
|
[
|
|
"c0f28e1a21ee46d1",
|
|
"2535b188f77fe631"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "13b00547bd61210c",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Entity ID",
|
|
"active": false,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 3860,
|
|
"y": 800,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "0ab23bd954321b9c",
|
|
"type": "delay",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "wait for flow.entity_id",
|
|
"pauseType": "delay",
|
|
"timeout": "2",
|
|
"timeoutUnits": "seconds",
|
|
"rate": "1",
|
|
"nbRateUnits": "1",
|
|
"rateUnits": "second",
|
|
"randomFirst": "1",
|
|
"randomLast": "5",
|
|
"randomUnits": "seconds",
|
|
"drop": false,
|
|
"allowrate": false,
|
|
"outputs": 1,
|
|
"x": 3740,
|
|
"y": 460,
|
|
"wires": [
|
|
[
|
|
"20a4cf95c10a2a5c",
|
|
"d665febefbcb0731"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "d665febefbcb0731",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Entity Approval: post wait",
|
|
"active": false,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 4010,
|
|
"y": 380,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "efc41ed6a8dcc29b",
|
|
"type": "inject",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Manual Start",
|
|
"props": [
|
|
{
|
|
"p": "payload"
|
|
},
|
|
{
|
|
"p": "topic",
|
|
"vt": "str"
|
|
}
|
|
],
|
|
"repeat": "",
|
|
"crontab": "",
|
|
"once": false,
|
|
"onceDelay": 0.1,
|
|
"topic": "",
|
|
"payload": "1",
|
|
"payloadType": "num",
|
|
"x": 190,
|
|
"y": 320,
|
|
"wires": [
|
|
[
|
|
"2f0dd5172e907730"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "2f0dd5172e907730",
|
|
"type": "link out",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "link out 1",
|
|
"mode": "link",
|
|
"links": [
|
|
"f2259793983f70a6",
|
|
"935f35904a0d89bf"
|
|
],
|
|
"x": 345,
|
|
"y": 320,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "8cbff9c661802fc8",
|
|
"type": "inject",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Manual Start",
|
|
"props": [
|
|
{
|
|
"p": "payload"
|
|
},
|
|
{
|
|
"p": "topic",
|
|
"vt": "str"
|
|
}
|
|
],
|
|
"repeat": "",
|
|
"crontab": "",
|
|
"once": false,
|
|
"onceDelay": 0.1,
|
|
"topic": "",
|
|
"payload": "1",
|
|
"payloadType": "num",
|
|
"x": 3190,
|
|
"y": 2000,
|
|
"wires": [
|
|
[
|
|
"0e97a47512b3c7ef"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "0e97a47512b3c7ef",
|
|
"type": "link out",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "link out 2",
|
|
"mode": "link",
|
|
"links": [
|
|
"f2259793983f70a6",
|
|
"935f35904a0d89bf"
|
|
],
|
|
"x": 3345,
|
|
"y": 2000,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "2535b188f77fe631",
|
|
"type": "function",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Add Approvers",
|
|
"func": "if(msg.payload.length > 0){\n\n msg.entity_approvers = \"[\";\n\n for(var i = 0; i < msg.payload.length; i++ ) {\n\n msg.entity_approvers = msg.entity_approvers + msg.payload[i].users_id + ',';\n }\n\n\n if (msg.entity_approvers != \"[\") {\n msg.entity_approvers = String(msg.entity_approvers).substring(0, msg.entity_approvers.length - 1) + \"]\";\n msg.entity_approvers = JSON.parse(msg.entity_approvers);\n } else {\n delete (msg.entity_approvers);\n }\n\n}\n\nreturn msg;",
|
|
"outputs": 1,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 4420,
|
|
"y": 500,
|
|
"wires": [
|
|
[
|
|
"fef2e3d863dd3b14",
|
|
"596b03adcd307cb4"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "7926c9939779dd37",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Entity Owner Approval",
|
|
"active": false,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 3440,
|
|
"y": 2140,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "84ac2b5e6df44243",
|
|
"type": "link out",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "End GLPI Session",
|
|
"mode": "link",
|
|
"links": [
|
|
"4350bb1697165898"
|
|
],
|
|
"x": 570,
|
|
"y": 1960,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "e5c1f581fdc90543",
|
|
"type": "trigger",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "fail safe: End Session",
|
|
"op1": "",
|
|
"op2": "",
|
|
"op1type": "nul",
|
|
"op2type": "date",
|
|
"duration": "8",
|
|
"extend": true,
|
|
"overrideDelay": false,
|
|
"units": "s",
|
|
"reset": "1",
|
|
"bytopic": "all",
|
|
"topic": "topic",
|
|
"outputs": 1,
|
|
"x": 360,
|
|
"y": 1960,
|
|
"wires": [
|
|
[
|
|
"84ac2b5e6df44243",
|
|
"e86ff2dd49db8a79"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "fef2e3d863dd3b14",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Add Approvers",
|
|
"active": false,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 4600,
|
|
"y": 500,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "e86ff2dd49db8a79",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "FailSafe: End Session",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 360,
|
|
"y": 2000,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "fa52923d181b861e",
|
|
"type": "inject",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Manual Start",
|
|
"props": [
|
|
{
|
|
"p": "payload"
|
|
},
|
|
{
|
|
"p": "topic",
|
|
"vt": "str"
|
|
}
|
|
],
|
|
"repeat": "",
|
|
"crontab": "",
|
|
"once": false,
|
|
"onceDelay": 0.1,
|
|
"topic": "",
|
|
"payload": "1",
|
|
"payloadType": "num",
|
|
"x": 3990,
|
|
"y": 260,
|
|
"wires": [
|
|
[
|
|
"d6e72db598c850a0"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "d6e72db598c850a0",
|
|
"type": "link out",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "link out 3",
|
|
"mode": "link",
|
|
"links": [
|
|
"f2259793983f70a6",
|
|
"935f35904a0d89bf"
|
|
],
|
|
"x": 4145,
|
|
"y": 260,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "04d760f9b1988f4b",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Add task to ticket for time tracking",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "url",
|
|
"pt": "msg",
|
|
"to": "msg.api_url & '/Ticket/' & msg.payload.id &'/TicketTask/'",
|
|
"tot": "jsonata"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "payload",
|
|
"pt": "msg",
|
|
"to": "{\t \"input\": {\t \"tickets_id\": msg.payload.id,\t \"taskcategories_id\": msg.category_id_automation_task,\t \"users_id\": msg.session_details.session.glpiID,\t \"content\": \"Created Ticket via NodeRed\",\t \"is_private\": 1,\t \"actiontime\": 10,\t \"state\": 2,\t \"users_id_tech\": msg.session_details.session.glpiID\t }\t\t}\t",
|
|
"tot": "jsonata"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "method",
|
|
"pt": "msg",
|
|
"to": "post",
|
|
"tot": "str"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 2900,
|
|
"y": 2220,
|
|
"wires": [
|
|
[
|
|
"e5548020922347cc"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "e930fc18412ba052",
|
|
"type": "link in",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "GLPI: Fetch Session",
|
|
"links": [],
|
|
"x": 270,
|
|
"y": 260,
|
|
"wires": [
|
|
[
|
|
"865a5c31c2d4529c",
|
|
"24ee7dc3b08f78a1"
|
|
]
|
|
],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "048e10e4b5f175c8",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Individulal Forms",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1730,
|
|
"y": 900,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "400a61dcdf038b1d",
|
|
"type": "inject",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Manual Start",
|
|
"props": [
|
|
{
|
|
"p": "payload"
|
|
},
|
|
{
|
|
"p": "topic",
|
|
"vt": "str"
|
|
}
|
|
],
|
|
"repeat": "",
|
|
"crontab": "",
|
|
"once": false,
|
|
"onceDelay": 0.1,
|
|
"topic": "",
|
|
"payload": "1",
|
|
"payloadType": "num",
|
|
"x": 1170,
|
|
"y": 1320,
|
|
"wires": [
|
|
[
|
|
"610fb43bda07b3c3"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "610fb43bda07b3c3",
|
|
"type": "link out",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "link out 4",
|
|
"mode": "link",
|
|
"links": [
|
|
"f2259793983f70a6",
|
|
"935f35904a0d89bf"
|
|
],
|
|
"x": 1325,
|
|
"y": 1320,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "5c7a23d16f3799de",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "",
|
|
"rules": [
|
|
{
|
|
"t": "move",
|
|
"p": "answer_parts",
|
|
"pt": "msg",
|
|
"to": "parts",
|
|
"tot": "msg"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "form_parts.id",
|
|
"pt": "msg",
|
|
"to": "parts.id",
|
|
"tot": "msg"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 240,
|
|
"y": 1400,
|
|
"wires": [
|
|
[
|
|
"706486ceadc2bee7"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "731ac452a4471480",
|
|
"type": "join",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Combine Questions",
|
|
"mode": "custom",
|
|
"build": "array",
|
|
"property": "form",
|
|
"propertyType": "msg",
|
|
"key": "parts",
|
|
"joiner": "\\n",
|
|
"joinerType": "str",
|
|
"accumulate": false,
|
|
"timeout": "",
|
|
"count": "",
|
|
"reduceRight": false,
|
|
"reduceExp": "",
|
|
"reduceInit": "",
|
|
"reduceInitType": "num",
|
|
"reduceFixup": "",
|
|
"x": 390,
|
|
"y": 1740,
|
|
"wires": [
|
|
[
|
|
"32337fc19b0c6c53",
|
|
"6abd782f33f6aa9f"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "738079e881bd7c2c",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "task_category",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "task_category",
|
|
"pt": "msg",
|
|
"to": "$number(msg.payload.default_values)",
|
|
"tot": "jsonata"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 3500,
|
|
"y": 660,
|
|
"wires": [
|
|
[
|
|
"675eebaa2b29490e",
|
|
"7d597c9f95237aec"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "675eebaa2b29490e",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "debug 45",
|
|
"active": false,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 4060,
|
|
"y": 660,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "706486ceadc2bee7",
|
|
"type": "switch",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "",
|
|
"property": "form.field_type",
|
|
"propertyType": "msg",
|
|
"rules": [
|
|
{
|
|
"t": "eq",
|
|
"v": "description",
|
|
"vt": "str"
|
|
},
|
|
{
|
|
"t": "else"
|
|
}
|
|
],
|
|
"checkall": "false",
|
|
"repair": false,
|
|
"outputs": 2,
|
|
"x": 370,
|
|
"y": 1400,
|
|
"wires": [
|
|
[
|
|
"88a41fa724a24518"
|
|
],
|
|
[
|
|
"56d5a39010b82e94"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "88a41fa724a24518",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "form.answer",
|
|
"pt": "msg",
|
|
"to": "$replace( msg.payload.description, /(\\&\\#\\d{2}\\;\\/?[a-z]+\\&\\#\\d{2}\\;|\\r\\n)/, '')\t",
|
|
"tot": "jsonata"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 600,
|
|
"y": 1380,
|
|
"wires": [
|
|
[
|
|
"d5037ce5a29693fc"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "3a6a6d119c434dce",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Upload JSON to ticket",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 3420,
|
|
"y": 2260,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "d5037ce5a29693fc",
|
|
"type": "function",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Description Field as Value",
|
|
"func": "if(\n msg.form.field_type == 'hidden'\n &&\n msg.form.answer == '-description-'\n) {\n\n // msg.form.answer = msg.payload.description.replace(\"\\r)\", '').replace(\"\\n)\", '\\\\r\\\\n')\n msg.form.answer = msg.payload.description.replace(/\\r/g, '').replace(/\\n/g, '').replace(/\\\"/g, '"')\n // msg.form.answer = msg.payload.description\n\n}\nreturn msg;",
|
|
"outputs": 1,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 870,
|
|
"y": 1420,
|
|
"wires": [
|
|
[
|
|
"46dd694a18a599c9"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "87d33fd4cc09e27f",
|
|
"type": "link call",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "GLPI: Get Session",
|
|
"links": [
|
|
"e930fc18412ba052"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 470,
|
|
"y": 920,
|
|
"wires": [
|
|
[
|
|
"454c179e9999918e"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "865a5c31c2d4529c",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Session Init begin",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 570,
|
|
"y": 300,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "aa3f79a3aae107ec",
|
|
"type": "link in",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "GLPI: Ticket Creation (ITIL Template)",
|
|
"links": [],
|
|
"x": 540,
|
|
"y": 1580,
|
|
"wires": [
|
|
[
|
|
"7ec7fc9e20c4a7e8",
|
|
"aecf1787ccb37139"
|
|
]
|
|
],
|
|
"l": true,
|
|
"info": "# Create Ticket using Ticket Template\n\nThis node is an entrypoint for the start of a workflow that uses the provided category to fetch the ticket template and use it to build the ticket.\n\nthe input object is `msg.form` with the following structure\n\n```json\n{\n \"approval_required\": msg.payload.data.ticket.approval_required,\n \"data\": msg.payload.data,\n \"name\": \"\",\n \"requester_id\": msg.itsm.user.id,\n \"requesttypes_id\": msg.payload.data.ticket.requesttype_id,\n \"ticket_category\": msg.payload.data.ticket.category_id,\n \"ticket_entity\": msg.payload.data.ticket.entity_id,\n \"auto_assign\": true\n \"technician\": 0 //Optional, int\n}\n```\n\n| Property | Type | Description |\n|:---|:---:|:---|\n| technician | `int` | _Optional_ Set to the GLPI User id of the user to assign as the technician |\n"
|
|
},
|
|
{
|
|
"id": "34d02c8cfe43bbe6",
|
|
"type": "link out",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Return to calling node",
|
|
"mode": "return",
|
|
"links": [],
|
|
"x": 4020,
|
|
"y": 1940,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "aecf1787ccb37139",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Ticket Creation - Template",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 910,
|
|
"y": 1520,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "30eb92e619af0e99",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "glpi.msg_routing",
|
|
"pt": "msg",
|
|
"to": "ticket_creation",
|
|
"tot": "str"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 2590,
|
|
"y": 1940,
|
|
"wires": [
|
|
[
|
|
"34d02c8cfe43bbe6"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "f44d85f3dd843e24",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "glpi.msg_routing",
|
|
"pt": "msg",
|
|
"to": "ticket_task_creation_automation",
|
|
"tot": "str"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 3170,
|
|
"y": 2240,
|
|
"wires": [
|
|
[
|
|
"e5548020922347cc"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "24ee7dc3b08f78a1",
|
|
"type": "change",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Defaults",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "authorization",
|
|
"pt": "msg",
|
|
"to": "config.glpi.authorization",
|
|
"tot": "global"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "app_token",
|
|
"pt": "msg",
|
|
"to": "config.glpi.app_token",
|
|
"tot": "global"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "api_url",
|
|
"pt": "msg",
|
|
"to": "config.glpi.api_url",
|
|
"tot": "global"
|
|
},
|
|
{
|
|
"t": "set",
|
|
"p": "category_id_automation_task",
|
|
"pt": "global",
|
|
"to": "config.glpi.category_id_automation_task",
|
|
"tot": "global"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 420,
|
|
"y": 260,
|
|
"wires": [
|
|
[
|
|
"e97bbbbac1bab270"
|
|
]
|
|
],
|
|
"icon": "font-awesome/fa-cogs"
|
|
},
|
|
{
|
|
"id": "432e2ad61476d045",
|
|
"type": "function",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Assign Ticket",
|
|
"func": "msg.url = global.get('config.glpi.api_url') + 'Ticket/' + msg.payload.id + '/Ticket_User';\nmsg.method = \"POST\";\n\nvar statusMessage = \"Added: \";\nvar ticketID = msg.payload.id;\n\n\nif (msg.form.hasOwnProperty(\"requester_id\") ) {\n\n msg.payload = {\n \"input\": {\n \"users_id\": msg.form.requester_id,\n \"tickets_id\": ticketID,\n \"type\": 1,\n \"use_notification\": 1\n }\n }\n\n node.send([\n msg,\n null,\n null\n ]);\n\n statusMessage += \"requester \" + msg.form.requester_id + \" \";\n\n}\n\nif ( msg.form.auto_assign || false ) {\n \n msg.payload = {\n \"input\": {\n \"users_id\": msg.session_details.session.glpiID,\n \"tickets_id\": ticketID,\n \"type\": 2,\n \"use_notification\": 0\n }\n };\n\n node.send([\n null,\n null,\n msg\n ]);\n\n statusMessage += \"technician \" + msg.session_details.session.glpiID + \" \";\n\n}\n\nif (msg.form.hasOwnProperty('technician_id') ) {\n\n msg.payload = {\n \"input\": {\n \"users_id\": msg.form.technician_id,\n \"tickets_id\": ticketID,\n \"type\": 2,\n \"use_notification\": 1\n }\n };\n\n node.send([\n null,\n null,\n msg\n ]);\n\n statusMessage += \"technician \" + msg.form.technician_id + \" \";\n\n}\n\n// always assign the API account as a watcher\nmsg.payload = {\n \"input\": {\n \"users_id\": msg.session_details.session.glpiID,\n \"tickets_id\": ticketID,\n \"type\": 3,\n \"use_notification\": 0\n }\n};\n\nnode.send([\n null,\n msg,\n null\n]);\n\nstatusMessage += \"watcher[Always] \" + msg.session_details.session.glpiID + \" \";\n\nnode.status({fill:\"blue\",shape:\"dot\",text:statusMessage});\n",
|
|
"outputs": 3,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 2890,
|
|
"y": 2040,
|
|
"wires": [
|
|
[
|
|
"8d9762cb45d1a09d"
|
|
],
|
|
[
|
|
"8d9762cb45d1a09d"
|
|
],
|
|
[
|
|
"8d9762cb45d1a09d"
|
|
]
|
|
],
|
|
"outputLabels": [
|
|
"Requester",
|
|
"Watcher",
|
|
"Technician"
|
|
],
|
|
"icon": "font-awesome/fa-exchange",
|
|
"info": "# Assign the Ticket\n\nThis node generates the json body to assign the ticket. Currenty supports setting watcher and technician.\n\nTo assign the ticket set the following properties:\n\n- watcher is assigned automagically and is the user who is accessing the api.\n\n- Technician:\n\n - set the property `msg.form.auto_assign` to assign to the API user as the technician\n\n - set the property `msg.form.technician` to the id of the user to assign that user\n"
|
|
},
|
|
{
|
|
"id": "8e0d9bd8043dd53b",
|
|
"type": "inject",
|
|
"z": "24deed6b10f37f8f",
|
|
"g": "b5d607bb9a62875f",
|
|
"name": "Cron Trigger",
|
|
"props": [
|
|
{
|
|
"p": "cron.start",
|
|
"v": "",
|
|
"vt": "date"
|
|
}
|
|
],
|
|
"repeat": "60",
|
|
"crontab": "",
|
|
"once": true,
|
|
"onceDelay": "5",
|
|
"topic": "",
|
|
"x": 180,
|
|
"y": 160,
|
|
"wires": [
|
|
[
|
|
"79e414f65b0e157b"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "79e414f65b0e157b",
|
|
"type": "function",
|
|
"z": "24deed6b10f37f8f",
|
|
"g": "b5d607bb9a62875f",
|
|
"name": "Route: Time based",
|
|
"func": "var minute = msg;\nvar hour = null;\nvar day = null;\nvar week = null;\nvar month = null;\n\nvar date;\ndate = new Date(msg.cron.start);\n\n// node.warn(msg.start);\n// node.warn(String(\"minute: \" + date.getMinutes()))\n// node.warn(String(\"seconds: \" + String(date.getSeconds()).padStart(2, \"0\")))\n// node.warn(String(\"hour: \" + String(date.getHours()).padStart(2, \"0\")))\n// node.warn(String(\"day: \" + String(date.getDay()).padStart(2, \"0\")))\n// node.warn(String(\"date: \" + String(date.getDate()).padStart(2, \"0\")))\n\nmsg.cron.trigger = 'minute';\n\n\n\nif(\n String(date.getMinutes()).padStart(2, \"0\") == \"00\" \n) { // Hour\n\n msg.cron.trigger = \"hour\";\n\n}\n\nif (\n String(date.getHours()).padStart(2, \"0\") == \"00\" &&\n String(date.getMinutes()).padStart(2, \"0\") == \"00\"\n) { // Daily\n\n msg.cron.trigger = \"day\";\n\n}\n\nif (\n String(date.getDay()).padStart(2, \"0\") == \"00\" &&\n String(date.getHours()).padStart(2, \"0\") == \"00\" &&\n String(date.getMinutes()).padStart(2, \"0\") == \"00\"\n) { // Weekly\n\n msg.cron.trigger = \"week\";\n\n}\n\nif (\n String(date.getDate()).padStart(2, \"0\") == \"01\" &&\n String(date.getDay()).padStart(2, \"0\") == \"00\" &&\n String(date.getHours()).padStart(2, \"0\") == \"00\" &&\n String(date.getMinutes()).padStart(2, \"0\") == \"00\"\n) { // Weekly\n\n msg.cron.trigger = \"month\";\n\n}\n\nnode.send([\n minute,\n hour,\n day,\n week,\n month\n]);",
|
|
"outputs": 5,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 430,
|
|
"y": 240,
|
|
"wires": [
|
|
[
|
|
"7e6699ce0159226a",
|
|
"8f313772a6e82e96"
|
|
],
|
|
[
|
|
"61115e9c6e619dae"
|
|
],
|
|
[
|
|
"2d78bd7d0f411721"
|
|
],
|
|
[
|
|
"47f68cd20a8a528b"
|
|
],
|
|
[
|
|
"348b594ba5acb470"
|
|
]
|
|
],
|
|
"outputLabels": [
|
|
"minute",
|
|
"hour",
|
|
"day",
|
|
"week",
|
|
"month"
|
|
],
|
|
"icon": "node-red/timer.svg"
|
|
},
|
|
{
|
|
"id": "8f313772a6e82e96",
|
|
"type": "debug",
|
|
"z": "24deed6b10f37f8f",
|
|
"g": "b5d607bb9a62875f",
|
|
"name": "Minute",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 810,
|
|
"y": 180,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "7e6699ce0159226a",
|
|
"type": "link call",
|
|
"z": "24deed6b10f37f8f",
|
|
"g": "b5d607bb9a62875f",
|
|
"name": "Clean Expired Tokens",
|
|
"links": [
|
|
"e25b155a2a29f16d"
|
|
],
|
|
"linkType": "static",
|
|
"timeout": "30",
|
|
"x": 860,
|
|
"y": 140,
|
|
"wires": [
|
|
[
|
|
"2bcdbb78b4e9181f"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "61115e9c6e619dae",
|
|
"type": "debug",
|
|
"z": "24deed6b10f37f8f",
|
|
"g": "b5d607bb9a62875f",
|
|
"name": "Hourly",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 810,
|
|
"y": 220,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "2d78bd7d0f411721",
|
|
"type": "debug",
|
|
"z": "24deed6b10f37f8f",
|
|
"g": "b5d607bb9a62875f",
|
|
"name": "Daily",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 810,
|
|
"y": 260,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "47f68cd20a8a528b",
|
|
"type": "debug",
|
|
"z": "24deed6b10f37f8f",
|
|
"g": "b5d607bb9a62875f",
|
|
"name": "Weekly",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 820,
|
|
"y": 300,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "348b594ba5acb470",
|
|
"type": "debug",
|
|
"z": "24deed6b10f37f8f",
|
|
"g": "b5d607bb9a62875f",
|
|
"name": "Monthly",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 820,
|
|
"y": 340,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "2bcdbb78b4e9181f",
|
|
"type": "debug",
|
|
"z": "24deed6b10f37f8f",
|
|
"g": "b5d607bb9a62875f",
|
|
"name": "Cron Complete",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "true",
|
|
"targetType": "full",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1120,
|
|
"y": 260,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "8c5bb81ae0b14703",
|
|
"type": "fs-list",
|
|
"z": "24deed6b10f37f8f",
|
|
"g": "f7c0a5bee0e0df33",
|
|
"name": "fetch token files",
|
|
"path": "path",
|
|
"pathType": "msg",
|
|
"pattern": "*.json",
|
|
"patternType": "str",
|
|
"filter": "files",
|
|
"recursive": false,
|
|
"follow": false,
|
|
"property": "files",
|
|
"propertyType": "msg",
|
|
"x": 1960,
|
|
"y": 160,
|
|
"wires": [
|
|
[
|
|
"f4da55e70a4f8c2c"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "b2e1cdc1778fd936",
|
|
"type": "function",
|
|
"z": "24deed6b10f37f8f",
|
|
"g": "f7c0a5bee0e0df33",
|
|
"name": "Build Path",
|
|
"func": "msg.cron.name = 'Remove expired token'\nmsg.path = String(env.get('HOME') + '/' + global.get('config.paths.token_sessions'));\n\nreturn msg;",
|
|
"outputs": 1,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 1570,
|
|
"y": 160,
|
|
"wires": [
|
|
[
|
|
"a3bd692422c0fcf5"
|
|
]
|
|
],
|
|
"icon": "node-red-contrib-filesystem/fs-mkdir.svg"
|
|
},
|
|
{
|
|
"id": "f4da55e70a4f8c2c",
|
|
"type": "function",
|
|
"z": "24deed6b10f37f8f",
|
|
"g": "f7c0a5bee0e0df33",
|
|
"name": "Build Path",
|
|
"func": "\nvar files = msg.files;\nvar filesfound = files.length;\n\nvar new_msg = {\n \"cron\": msg.cron,\n \"_linkSource\": msg._linkSource\n};\n\nnode.status({fill:\"blue\",shape:\"dot\",text:String( filesfound + \" found\")});\n\n\nfor (var i = 0; i < filesfound; i++ ) {\n\n new_msg.path = msg.path;\n new_msg.file = String(msg.files[i]);\n new_msg.filename = String(msg.path + msg.files[i]);\n new_msg._linkSource = msg._linkSource;\n\n node.send([new_msg, null]);\n\n}\n\nif (filesfound == 0 ) {\n\n new_msg.cron.task = 'No Tokens Found';\n new_msg._linkSource = msg._linkSource;\n\n node.send([null, new_msg]);\n\n}",
|
|
"outputs": 2,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 2150,
|
|
"y": 160,
|
|
"wires": [
|
|
[
|
|
"44c01ba9bfc47ee8"
|
|
],
|
|
[
|
|
"291408859782056d"
|
|
]
|
|
],
|
|
"outputLabels": [
|
|
"Continue",
|
|
"No Action Required"
|
|
]
|
|
},
|
|
{
|
|
"id": "44c01ba9bfc47ee8",
|
|
"type": "file in",
|
|
"z": "24deed6b10f37f8f",
|
|
"g": "f7c0a5bee0e0df33",
|
|
"name": "Read Token File",
|
|
"filename": "filename",
|
|
"filenameType": "msg",
|
|
"format": "utf8",
|
|
"chunk": false,
|
|
"sendError": false,
|
|
"encoding": "none",
|
|
"allProps": false,
|
|
"x": 2360,
|
|
"y": 160,
|
|
"wires": [
|
|
[
|
|
"55d7ad6e4958f882"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "55d7ad6e4958f882",
|
|
"type": "json",
|
|
"z": "24deed6b10f37f8f",
|
|
"g": "f7c0a5bee0e0df33",
|
|
"name": "",
|
|
"property": "payload",
|
|
"action": "obj",
|
|
"pretty": false,
|
|
"x": 2490,
|
|
"y": 160,
|
|
"wires": [
|
|
[
|
|
"bb5ccb49f1aa1036"
|
|
]
|
|
],
|
|
"icon": "font-awesome/fa-exchange"
|
|
},
|
|
{
|
|
"id": "bb5ccb49f1aa1036",
|
|
"type": "function",
|
|
"z": "24deed6b10f37f8f",
|
|
"g": "f7c0a5bee0e0df33",
|
|
"name": "Process Token File",
|
|
"func": "var file_delete = msg;\nvar file_keep = null;\n\nnode.status({ fill: \"red\", shape: \"dot\", text: \"function did not complete\" });\n\nmsg.cron.task = 'delete'\nmsg.cron.data = {\n \"filename\": msg.filename\n}\n\nif( msg.payload.hasOwnProperty('datetime') ) {\n\n if( msg.payload.datetime > Date.now() ) {\n\n if ( msg.payload.hasOwnProperty('user') ){\n\n if(\n msg.payload.user.hasOwnProperty('username') &&\n msg.payload.user.hasOwnProperty('fname') &&\n msg.payload.user.hasOwnProperty('lname') &&\n msg.payload.user.hasOwnProperty('mail')\n ){\n\n file_delete = null;\n msg.cron.task = 'do nothing'\n file_keep = msg;\n\n } else {\n\n node.status({ fill: \"yellow\", shape: \"dot\", text: \"missing a required user field\" });\n\n }\n\n } else {\n\n node.status({ fill: \"yellow\", shape: \"dot\", text: \"user field\" });\n\n }\n\n } else {\n\n node.status({ fill: \"yellow\", shape: \"dot\", text: \"expired\" });\n\n }\n\n} else {\n\n node.status({fill:\"yellow\",shape:\"dot\",text:\"missing datetime\"});\n\n}\n\n//delete msg.path;\ndelete msg.filename;\ndelete msg.payload;\n\nnode.send([\n file_delete,\n file_keep\n]);",
|
|
"outputs": 2,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 2650,
|
|
"y": 160,
|
|
"wires": [
|
|
[
|
|
"f5f9e14092781e29"
|
|
],
|
|
[
|
|
"966779cca7297dec"
|
|
]
|
|
],
|
|
"outputLabels": [
|
|
"Delete",
|
|
"Keep"
|
|
],
|
|
"icon": "font-awesome/fa-repeat"
|
|
},
|
|
{
|
|
"id": "f5f9e14092781e29",
|
|
"type": "fs-remove",
|
|
"z": "24deed6b10f37f8f",
|
|
"g": "f7c0a5bee0e0df33",
|
|
"path": "path",
|
|
"pathType": "msg",
|
|
"filename": "file",
|
|
"filenameType": "msg",
|
|
"recursive": false,
|
|
"exist": true,
|
|
"name": "Delete Token File",
|
|
"x": 2870,
|
|
"y": 140,
|
|
"wires": [
|
|
[
|
|
"0f30a271d9c71f74"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "e25b155a2a29f16d",
|
|
"type": "link in",
|
|
"z": "24deed6b10f37f8f",
|
|
"g": "f7c0a5bee0e0df33",
|
|
"name": "Clean expired Tokens",
|
|
"links": [],
|
|
"x": 1400,
|
|
"y": 160,
|
|
"wires": [
|
|
[
|
|
"b2e1cdc1778fd936"
|
|
]
|
|
],
|
|
"icon": "font-awesome/fa-paint-brush",
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "0f30a271d9c71f74",
|
|
"type": "link out",
|
|
"z": "24deed6b10f37f8f",
|
|
"g": "f7c0a5bee0e0df33",
|
|
"name": "Return",
|
|
"mode": "return",
|
|
"links": [],
|
|
"x": 3070,
|
|
"y": 200,
|
|
"wires": [],
|
|
"l": true
|
|
},
|
|
{
|
|
"id": "a3bd692422c0fcf5",
|
|
"type": "fs-mkdir",
|
|
"z": "24deed6b10f37f8f",
|
|
"g": "f7c0a5bee0e0df33",
|
|
"name": "Create Dirs if not exist",
|
|
"purpose": "reg",
|
|
"path": "",
|
|
"pathType": "msg",
|
|
"foldername": "path",
|
|
"foldernameType": "msg",
|
|
"recursive": true,
|
|
"exists": false,
|
|
"prefix": "",
|
|
"prefixType": "str",
|
|
"mode": "777",
|
|
"property": "payload",
|
|
"propertyType": "msg",
|
|
"x": 1760,
|
|
"y": 160,
|
|
"wires": [
|
|
[
|
|
"8c5bb81ae0b14703"
|
|
]
|
|
]
|
|
}
|
|
] |