Add basic boilerplate for new controller

This commit is contained in:
Maxi Redigonda 2023-01-02 20:44:03 -03:00
parent 20720ca4f9
commit b7dd9e88ac
3 changed files with 150 additions and 104 deletions

208
client/package-lock.json generated
View File

@ -14415,8 +14415,8 @@
"integrity": "sha1-gORw6VoIR5T+GJkmLFZnxuiN4bM=",
"optional": true,
"requires": {
"delegates": "1.0.0",
"readable-stream": "2.2.2"
"delegates": "^1.0.0",
"readable-stream": "^2.0.0 || ^1.1.13"
}
},
"asn1": {
@ -14461,7 +14461,7 @@
"integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=",
"optional": true,
"requires": {
"tweetnacl": "0.14.5"
"tweetnacl": "^0.14.3"
}
},
"block-stream": {
@ -14510,11 +14510,11 @@
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
"optional": true,
"requires": {
"ansi-styles": "2.2.1",
"escape-string-regexp": "1.0.5",
"has-ansi": "2.0.0",
"strip-ansi": "3.0.1",
"supports-color": "2.0.0"
"ansi-styles": "^2.2.1",
"escape-string-regexp": "^1.0.2",
"has-ansi": "^2.0.0",
"strip-ansi": "^3.0.0",
"supports-color": "^2.0.0"
}
},
"code-point-at": {
@ -14618,7 +14618,7 @@
"integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=",
"optional": true,
"requires": {
"jsbn": "0.1.1"
"jsbn": "~0.1.0"
}
},
"escape-string-regexp": {
@ -14651,9 +14651,9 @@
"integrity": "sha1-icNTQAi5fq2ky7FX1Y9vXfAl6uQ=",
"optional": true,
"requires": {
"asynckit": "0.4.0",
"combined-stream": "1.0.5",
"mime-types": "2.1.14"
"asynckit": "^0.4.0",
"combined-stream": "^1.0.5",
"mime-types": "^2.1.12"
}
},
"fs.realpath": {
@ -14668,10 +14668,10 @@
"integrity": "sha1-YE6Kkv4m/9n2+uMDmdSYThqyKCI=",
"optional": true,
"requires": {
"graceful-fs": "4.1.11",
"inherits": "2.0.3",
"mkdirp": "0.5.1",
"rimraf": "2.5.4"
"graceful-fs": "^4.1.2",
"inherits": "~2.0.0",
"mkdirp": ">=0.5 0",
"rimraf": "2"
}
},
"fstream-ignore": {
@ -14680,9 +14680,9 @@
"integrity": "sha1-nDHa40dnAY/h0kmyTa2mfQktoQU=",
"optional": true,
"requires": {
"fstream": "1.0.10",
"inherits": "2.0.3",
"minimatch": "3.0.3"
"fstream": "^1.0.0",
"inherits": "2",
"minimatch": "^3.0.0"
}
},
"gauge": {
@ -14691,14 +14691,14 @@
"integrity": "sha1-HCOFX5YvF7OtPQ3HRD8wRULt/gk=",
"optional": true,
"requires": {
"aproba": "1.1.1",
"console-control-strings": "1.1.0",
"has-unicode": "2.0.1",
"object-assign": "4.1.1",
"signal-exit": "3.0.2",
"string-width": "1.0.2",
"strip-ansi": "3.0.1",
"wide-align": "1.1.0"
"aproba": "^1.0.3",
"console-control-strings": "^1.0.0",
"has-unicode": "^2.0.0",
"object-assign": "^4.1.0",
"signal-exit": "^3.0.0",
"string-width": "^1.0.1",
"strip-ansi": "^3.0.1",
"wide-align": "^1.1.0"
}
},
"generate-function": {
@ -14739,12 +14739,12 @@
"integrity": "sha1-gFIR3wT6rxxjo2ADBs31reULLsg=",
"optional": true,
"requires": {
"fs.realpath": "1.0.0",
"inflight": "1.0.6",
"inherits": "2.0.3",
"minimatch": "3.0.3",
"once": "1.4.0",
"path-is-absolute": "1.0.1"
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.0.2",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
}
},
"graceful-fs": {
@ -14792,10 +14792,10 @@
"integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=",
"optional": true,
"requires": {
"boom": "2.10.1",
"cryptiles": "2.0.5",
"hoek": "2.16.3",
"sntp": "1.0.9"
"boom": "2.x.x",
"cryptiles": "2.x.x",
"hoek": "2.x.x",
"sntp": "1.x.x"
}
},
"hoek": {
@ -14810,9 +14810,9 @@
"integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=",
"optional": true,
"requires": {
"assert-plus": "0.2.0",
"jsprim": "1.3.1",
"sshpk": "1.10.2"
"assert-plus": "^0.2.0",
"jsprim": "^1.2.2",
"sshpk": "^1.7.0"
}
},
"inflight": {
@ -14821,8 +14821,8 @@
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"optional": true,
"requires": {
"once": "1.4.0",
"wrappy": "1.0.2"
"once": "^1.3.0",
"wrappy": "1"
}
},
"inherits": {
@ -14843,7 +14843,7 @@
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
"optional": true,
"requires": {
"number-is-nan": "1.0.1"
"number-is-nan": "^1.0.0"
}
},
"is-my-json-valid": {
@ -14852,10 +14852,10 @@
"integrity": "sha1-k27do8o8IR/ZjzstPgjaQ/eykVs=",
"optional": true,
"requires": {
"generate-function": "2.0.0",
"generate-object-property": "1.2.0",
"jsonpointer": "4.0.1",
"xtend": "4.0.1"
"generate-function": "^2.0.0",
"generate-object-property": "^1.1.0",
"jsonpointer": "^4.0.0",
"xtend": "^4.0.0"
}
},
"is-property": {
@ -14888,7 +14888,7 @@
"integrity": "sha1-BtSRIlUJNBlHfUJWM2BuDpB4KWc=",
"optional": true,
"requires": {
"jsbn": "0.1.1"
"jsbn": "~0.1.0"
}
},
"jsbn": {
@ -14938,7 +14938,7 @@
"integrity": "sha1-9+99l1g/yvO30oK2+LVnnaselO4=",
"optional": true,
"requires": {
"mime-db": "1.26.0"
"mime-db": "~1.26.0"
}
},
"minimatch": {
@ -14947,7 +14947,7 @@
"integrity": "sha1-Kk5AkLlrLbBqnX3wEFWmKnfJt3Q=",
"optional": true,
"requires": {
"brace-expansion": "1.1.6"
"brace-expansion": "^1.0.0"
}
},
"minimist": {
@ -14994,7 +14994,7 @@
"integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=",
"optional": true,
"requires": {
"abbrev": "1.1.0"
"abbrev": "1"
}
},
"npmlog": {
@ -15003,10 +15003,10 @@
"integrity": "sha1-0DlQ4OeM4VJ7om0qdZLpNIrD518=",
"optional": true,
"requires": {
"are-we-there-yet": "1.1.2",
"console-control-strings": "1.1.0",
"gauge": "2.7.3",
"set-blocking": "2.0.0"
"are-we-there-yet": "~1.1.2",
"console-control-strings": "~1.1.0",
"gauge": "~2.7.1",
"set-blocking": "~2.0.0"
}
},
"number-is-nan": {
@ -15033,7 +15033,7 @@
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"optional": true,
"requires": {
"wrappy": "1.0.2"
"wrappy": "1"
}
},
"path-is-absolute": {
@ -15054,7 +15054,7 @@
"integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=",
"optional": true,
"requires": {
"pinkie": "2.0.4"
"pinkie": "^2.0.0"
}
},
"process-nextick-args": {
@ -15081,10 +15081,10 @@
"integrity": "sha1-xepWS7B6/5/TpbMukGwdOmWUD+o=",
"optional": true,
"requires": {
"deep-extend": "0.4.1",
"ini": "1.3.4",
"minimist": "1.2.0",
"strip-json-comments": "2.0.1"
"deep-extend": "~0.4.0",
"ini": "~1.3.0",
"minimist": "^1.2.0",
"strip-json-comments": "~2.0.1"
},
"dependencies": {
"minimist": {
@ -15101,13 +15101,13 @@
"integrity": "sha1-qeb+w8fdqF+LsbO6cChgRVb8gl4=",
"optional": true,
"requires": {
"buffer-shims": "1.0.0",
"core-util-is": "1.0.2",
"inherits": "2.0.3",
"isarray": "1.0.0",
"process-nextick-args": "1.0.7",
"string_decoder": "0.10.31",
"util-deprecate": "1.0.2"
"buffer-shims": "^1.0.0",
"core-util-is": "~1.0.0",
"inherits": "~2.0.1",
"isarray": "~1.0.0",
"process-nextick-args": "~1.0.6",
"string_decoder": "~0.10.x",
"util-deprecate": "~1.0.1"
}
},
"request": {
@ -15144,7 +15144,7 @@
"integrity": "sha1-loAAk8vxoMhr2VtGJUZ1NcKd+gQ=",
"optional": true,
"requires": {
"glob": "7.1.1"
"glob": "^7.0.5"
}
},
"semver": {
@ -15171,7 +15171,7 @@
"integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=",
"optional": true,
"requires": {
"hoek": "2.16.3"
"hoek": "2.x.x"
}
},
"sshpk": {
@ -15180,15 +15180,15 @@
"integrity": "sha1-1agEziJpVRVjjnmNviMnPeBwpfo=",
"optional": true,
"requires": {
"asn1": "0.2.3",
"assert-plus": "1.0.0",
"bcrypt-pbkdf": "1.0.1",
"dashdash": "1.14.1",
"ecc-jsbn": "0.1.1",
"getpass": "0.1.6",
"jodid25519": "1.0.2",
"jsbn": "0.1.1",
"tweetnacl": "0.14.5"
"asn1": "~0.2.3",
"assert-plus": "^1.0.0",
"bcrypt-pbkdf": "^1.0.0",
"dashdash": "^1.12.0",
"ecc-jsbn": "~0.1.1",
"getpass": "^0.1.1",
"jodid25519": "^1.0.0",
"jsbn": "~0.1.0",
"tweetnacl": "~0.14.0"
},
"dependencies": {
"assert-plus": {
@ -15205,9 +15205,9 @@
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
"optional": true,
"requires": {
"code-point-at": "1.1.0",
"is-fullwidth-code-point": "1.0.0",
"strip-ansi": "3.0.1"
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
"strip-ansi": "^3.0.0"
}
},
"string_decoder": {
@ -15228,7 +15228,7 @@
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"optional": true,
"requires": {
"ansi-regex": "2.1.1"
"ansi-regex": "^2.0.0"
}
},
"strip-json-comments": {
@ -15249,9 +15249,9 @@
"integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=",
"optional": true,
"requires": {
"block-stream": "0.0.9",
"fstream": "1.0.10",
"inherits": "2.0.3"
"block-stream": "*",
"fstream": "^1.0.2",
"inherits": "2"
}
},
"tar-pack": {
@ -15260,14 +15260,14 @@
"integrity": "sha1-MJMYFkGPVa/E0hd1r91nIM7kXa4=",
"optional": true,
"requires": {
"debug": "2.2.0",
"fstream": "1.0.10",
"fstream-ignore": "1.0.5",
"once": "1.3.3",
"readable-stream": "2.1.5",
"rimraf": "2.5.4",
"tar": "2.2.1",
"uid-number": "0.0.6"
"debug": "~2.2.0",
"fstream": "~1.0.10",
"fstream-ignore": "~1.0.5",
"once": "~1.3.3",
"readable-stream": "~2.1.4",
"rimraf": "~2.5.1",
"tar": "~2.2.1",
"uid-number": "~0.0.6"
},
"dependencies": {
"once": {
@ -15276,7 +15276,7 @@
"integrity": "sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA=",
"optional": true,
"requires": {
"wrappy": "1.0.2"
"wrappy": "1"
}
},
"readable-stream": {
@ -15285,13 +15285,13 @@
"integrity": "sha1-ZvqLcg4UOLNkaB8q0aY8YYRIydA=",
"optional": true,
"requires": {
"buffer-shims": "1.0.0",
"core-util-is": "1.0.2",
"inherits": "2.0.3",
"isarray": "1.0.0",
"process-nextick-args": "1.0.7",
"string_decoder": "0.10.31",
"util-deprecate": "1.0.2"
"buffer-shims": "^1.0.0",
"core-util-is": "~1.0.0",
"inherits": "~2.0.1",
"isarray": "~1.0.0",
"process-nextick-args": "~1.0.6",
"string_decoder": "~0.10.x",
"util-deprecate": "~1.0.1"
}
}
}
@ -15302,7 +15302,7 @@
"integrity": "sha1-8IH3bkyFcg5sN6X6ztc3FQ2EByo=",
"optional": true,
"requires": {
"punycode": "1.4.1"
"punycode": "^1.4.1"
}
},
"tunnel-agent": {
@ -15350,7 +15350,7 @@
"integrity": "sha1-QO3egCpx/qHwcNo+YtzaLnrdlq0=",
"optional": true,
"requires": {
"string-width": "1.0.2"
"string-width": "^1.0.1"
}
},
"wrappy": {

View File

@ -25,6 +25,7 @@ $userControllers->addController(new EditCustomFieldsController);
$userControllers->addController(new EditSupervisedListController);
$userControllers->addController(new GetSupervisedTicketController);
$userControllers->addController(new ResendEmailTokenController);
$userControllers->addController(new GetLoginLinkController);
$userControllers->addController(new ResendInviteUserController);

View File

@ -0,0 +1,45 @@
<?php
use Respect\Validation\Validator as DataValidator;
/**
* @api {post} /user/get-login-link Get login link
* @apiVersion 4.11.0
*
* @apiName Get login link
*
* @apiGroup User
*
* @apiDescription Given a correct API key, this path generates a one-time link to automatically sign in as a certain user.
*
* @apiPermission staff1
*
* TODO: correct this part of the
*
* @apiParam {String} name The name of the user to log in.
*
* @apiUse INVALID_NAME
*
* @apiSuccess {Object} data Information about created user
* @apiSuccess {Number} data.userId Id of the new user
* @apiSuccess {String} data.userEmail Email of the new user
*
*/
class GetLoginLinkController extends Controller {
const PATH = '/get-login-link';
const METHOD = 'POST';
public function validations() {
return [
'permission' => 'staff_1',
'requestData' => [
]
];
}
public function handler() {
Response::respondSuccess([
'ok' => 'yes, ok'
]);
}
}