first commit
This commit is contained in:
206
app/Docs/auth.php
Normal file
206
app/Docs/auth.php
Normal file
@@ -0,0 +1,206 @@
|
||||
<?php
|
||||
/**
|
||||
* @apiDeprecated since 1.0.0 use now (#Password_Reset:Process)
|
||||
* @api {post} /api/auth/reset Reset
|
||||
* @apiDescription Get user JWT
|
||||
*
|
||||
*
|
||||
* @apiVersion 1.0.0
|
||||
* @apiName Reset
|
||||
* @apiGroup Auth
|
||||
*/
|
||||
|
||||
/**
|
||||
* @apiDeprecated since 1.0.0 use now (#Password_Reset:Request)
|
||||
* @api {post} /api/auth/send-reset Send reset e-mail
|
||||
* @apiDescription Get user JWT
|
||||
*
|
||||
*
|
||||
* @apiVersion 1.0.0
|
||||
* @apiName Send reset
|
||||
* @apiGroup Auth
|
||||
*/
|
||||
|
||||
/**
|
||||
* @apiDeprecated since 4.0.0
|
||||
* @api {post} /auth/refresh Refresh
|
||||
* @apiDescription Refreshes JWT
|
||||
*
|
||||
* @apiVersion 1.0.0
|
||||
* @apiName Refresh
|
||||
* @apiGroup Auth
|
||||
*
|
||||
* @apiUse AuthHeader
|
||||
*
|
||||
* @apiSuccess {String} access_token Token
|
||||
* @apiSuccess {String} token_type Token Type
|
||||
* @apiSuccess {String} expires_in Token TTL 8601String Date
|
||||
*
|
||||
* @apiUse 400Error
|
||||
* @apiUse UnauthorizedError
|
||||
*/
|
||||
|
||||
/**
|
||||
* @apiDeprecated since 4.0.0
|
||||
* @apiDefine ParamsValidationError
|
||||
* @apiErrorExample {json} Params validation
|
||||
* HTTP/1.1 400 Bad Request
|
||||
* {
|
||||
* "message": "Invalid params",
|
||||
* "error_type": "authorization.wrong_params"
|
||||
* }
|
||||
*
|
||||
* @apiVersion 1.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @api {post} /auth/logout Logout
|
||||
* @apiDescription Invalidate JWT
|
||||
*
|
||||
* @apiVersion 1.0.0
|
||||
* @apiName Logout
|
||||
* @apiGroup Auth
|
||||
*
|
||||
* @apiUse AuthHeader
|
||||
*
|
||||
* @apiSuccess {String} message Message from server
|
||||
*
|
||||
* @apiSuccessExample {json} Response Example
|
||||
* HTTP/1.1 200 OK
|
||||
* {
|
||||
* "message": "Successfully logged out"
|
||||
* }
|
||||
*
|
||||
* @apiUse 400Error
|
||||
* @apiUse UnauthorizedError
|
||||
*/
|
||||
|
||||
/**
|
||||
* @api {post} /auth/logout-from-all Logout from all
|
||||
* @apiDescription Invalidate all user JWT
|
||||
*
|
||||
* @apiVersion 1.0.0
|
||||
* @apiName Logout all
|
||||
* @apiGroup Auth
|
||||
*
|
||||
* @apiUse AuthHeader
|
||||
*
|
||||
* @apiSuccess {String} message Message from server
|
||||
*
|
||||
* @apiSuccessExample {json} Response Example
|
||||
* HTTP/1.1 200 OK
|
||||
* {
|
||||
* "message": "Successfully logged out from all sessions"
|
||||
* }
|
||||
*
|
||||
* @apiUse 400Error
|
||||
* @apiUse UnauthorizedError
|
||||
*/
|
||||
|
||||
/**
|
||||
* @api {get} /auth/me Me
|
||||
* @apiDescription Get authenticated User Entity
|
||||
*
|
||||
* @apiVersion 1.0.0
|
||||
* @apiName Me
|
||||
* @apiGroup Auth
|
||||
*
|
||||
* @apiUse AuthHeader
|
||||
*
|
||||
* @apiSuccess {Object} user User Entity
|
||||
*
|
||||
* @apiUse UserObject
|
||||
*
|
||||
* @apiSuccessExample {json} Response Example
|
||||
* HTTP/1.1 200 OK
|
||||
* {
|
||||
* "user": {
|
||||
* "id": 1,
|
||||
* "full_name": "Admin",
|
||||
* "email": "admin@example.com",
|
||||
* "url": "",
|
||||
* "company_id": 1,
|
||||
* "avatar": "",
|
||||
* "screenshots_state": 1,
|
||||
* "manual_time": 0,
|
||||
* "computer_time_popup": 300,
|
||||
* "blur_screenshots": 0,
|
||||
* "web_and_app_monitoring": 1,
|
||||
* "screenshots_interval": 9,
|
||||
* "active": "active",
|
||||
* "deleted_at": null,
|
||||
* "created_at": "2018-09-25 06:15:08",
|
||||
* "updated_at": "2018-09-25 06:15:08",
|
||||
* "timezone": null
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* @apiUse 400Error
|
||||
* @apiUse UnauthorizedError
|
||||
*/
|
||||
/**
|
||||
* @api {get} /auth/desktop-key Issue key
|
||||
* @apiDescription Issues key for desktop auth
|
||||
*
|
||||
* @apiVersion 1.0.0
|
||||
* @apiName Issue key
|
||||
* @apiGroup Auth
|
||||
*
|
||||
* @apiUse AuthHeader
|
||||
*
|
||||
* @apiSuccess {String} access_token Token
|
||||
* @apiSuccess {String} token_type Token Type
|
||||
* @apiSuccess {String} expires_in Token TTL 8601String Date
|
||||
*
|
||||
* @apiSuccessExample {json} Response Example
|
||||
* HTTP/1.1 200 OK
|
||||
* {
|
||||
* "access_token": "r6nPiGocAWdD5ZF60dTkUboVAWSXsUScpp7m9x9R",
|
||||
* "token_type": "desktop",
|
||||
* "expires_in": "2020-12-26T14:18:32+00:00"
|
||||
* }
|
||||
*
|
||||
* @apiUse UnauthorizedError
|
||||
*/
|
||||
/**
|
||||
* @api {post} /auth/login Login
|
||||
* @apiDescription Get user JWT
|
||||
*
|
||||
* @apiVersion 1.0.0
|
||||
* @apiName Login
|
||||
* @apiGroup Auth
|
||||
*
|
||||
* @apiParam {String} email User email
|
||||
* @apiParam {String} password User password
|
||||
* @apiParam {String} [recaptcha] Recaptcha token
|
||||
*
|
||||
* @apiParamExample {json} Request Example
|
||||
* {
|
||||
* "email": "johndoe@example.com",
|
||||
* "password": "amazingpassword",
|
||||
* "recaptcha": "03AOLTBLR5UtIoenazYWjaZ4AFZiv1OWegWV..."
|
||||
* }
|
||||
*
|
||||
* @apiSuccess {String} access_token Token
|
||||
* @apiSuccess {String} token_type Token Type
|
||||
* @apiSuccess {ISO8601} expires_in Token TTL
|
||||
* @apiSuccess {Object} user User Entity
|
||||
*
|
||||
* @apiUse UserObject
|
||||
*
|
||||
* @apiSuccessExample {json} Response Example
|
||||
* HTTP/1.1 200 OK
|
||||
* {
|
||||
* "access_token": "16184cf3b2510464a53c0e573c75740540fe...",
|
||||
* "token_type": "bearer",
|
||||
* "expires_in": "2020-12-26T14:18:32+00:00",
|
||||
* "user": {}
|
||||
* }
|
||||
*
|
||||
* @apiUse 400Error
|
||||
* @apiUse ParamsValidationError
|
||||
* @apiUse UnauthorizedError
|
||||
* @apiUse UserDeactivatedError
|
||||
* @apiUse CaptchaError
|
||||
* @apiUse LimiterError
|
||||
*/
|
||||
272
app/Docs/screenshots.php
Normal file
272
app/Docs/screenshots.php
Normal file
@@ -0,0 +1,272 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @apiDeprecated since 4.0.0
|
||||
* @api {get} /screenshot/:id Screenshot
|
||||
* @apiDescription Get Screenshot
|
||||
*
|
||||
* @apiVersion 3.5.0
|
||||
* @apiName Show
|
||||
* @apiGroup Screenshot
|
||||
*
|
||||
* @apiUse AuthHeader
|
||||
*
|
||||
* @apiPermission time_intervals_show
|
||||
* @apiPermission time_intervals_full_access
|
||||
*
|
||||
* @apiParam {Integer} id ID of the target Time interval
|
||||
*
|
||||
* @apiSuccess {Raw} data Screenshot data
|
||||
*
|
||||
* @apiUse 400Error
|
||||
* @apiUse ItemNotFoundError
|
||||
* @apiUse ForbiddenError
|
||||
* @apiUse UnauthorizedError
|
||||
*/
|
||||
|
||||
/**
|
||||
* @apiDeprecated since 4.0.0
|
||||
* @api {get} /screenshot/:id Thumb
|
||||
* @apiDescription Get Screenshot Thumbnail
|
||||
*
|
||||
* @apiVersion 3.5.0
|
||||
* @apiName ShowThumb
|
||||
* @apiGroup Screenshot
|
||||
*
|
||||
* @apiUse AuthHeader
|
||||
*
|
||||
* @apiPermission time_intervals_show
|
||||
* @apiPermission time_intervals_full_access
|
||||
*
|
||||
* @apiParam {Integer} id ID of the target Time interval
|
||||
*
|
||||
* @apiSuccess {Raw} data Screenshot data
|
||||
*
|
||||
* @apiUse 400Error
|
||||
* @apiUse ItemNotFoundError
|
||||
* @apiUse ForbiddenError
|
||||
* @apiUse UnauthorizedError
|
||||
*/
|
||||
|
||||
/**
|
||||
* @apiDeprecated since 4.0.0
|
||||
* @api {get,post} /screenshots/list List
|
||||
* @apiDescription Get list of Screenshots
|
||||
*
|
||||
* @apiVersion 1.0.0
|
||||
* @apiName List
|
||||
* @apiGroup Screenshot
|
||||
*
|
||||
* @apiUse AuthHeader
|
||||
*
|
||||
* @apiPermission screenshots_list
|
||||
* @apiPermission screenshots_full_access
|
||||
*
|
||||
* @apiUse UserParams
|
||||
*
|
||||
* @apiParamExample {json} Request Example
|
||||
* {
|
||||
* "id": [">", 1],
|
||||
* "time_interval_id": ["=", [1,2,3]],
|
||||
* "user_id": ["=", [1,2,3]],
|
||||
* "project_id": ["=", [1,2,3]],
|
||||
* "path": ["like", "%lorem%"],
|
||||
* "created_at": [">", "2019-01-01 00:00:00"],
|
||||
* "updated_at": ["<", "2019-01-01 00:00:00"]
|
||||
* }
|
||||
*
|
||||
* @apiUse UserObject
|
||||
*
|
||||
* @apiSuccessExample {json} Response Example
|
||||
* HTTP/1.1 200 OK
|
||||
* [
|
||||
* {
|
||||
* "id": 1,
|
||||
* "time_interval_id": 1,
|
||||
* "path": "uploads\/screenshots\/1_1_1.png",
|
||||
* "created_at": "2020-01-23T09:42:26+00:00",
|
||||
* "updated_at": "2020-01-23T09:42:26+00:00",
|
||||
* "deleted_at": null,
|
||||
* "thumbnail_path": null,
|
||||
* "important": false,
|
||||
* "is_removed": false
|
||||
* },
|
||||
* {
|
||||
* "id": 2,
|
||||
* "time_interval_id": 2,
|
||||
* "path": "uploads\/screenshots\/1_1_2.png",
|
||||
* "created_at": "2020-01-23T09:42:26+00:00",
|
||||
* "updated_at": "2020-01-23T09:42:26+00:00",
|
||||
* "deleted_at": null,
|
||||
* "thumbnail_path": null,
|
||||
* "important": false,
|
||||
* "is_removed": false
|
||||
* }
|
||||
* ]
|
||||
*
|
||||
* @apiUse 400Error
|
||||
* @apiUse UnauthorizedError
|
||||
* @apiUse ForbiddenError
|
||||
*/
|
||||
/**
|
||||
* @apiDeprecated since 4.0.0
|
||||
* @api {post} /screenshots/create Create
|
||||
* @apiDescription Create Screenshot
|
||||
*
|
||||
* @apiVersion 1.0.0
|
||||
* @apiName Create
|
||||
* @apiGroup Screenshot
|
||||
*
|
||||
* @apiParam {Integer} time_interval_id Time Interval ID
|
||||
* @apiParam {Binary} screenshot File
|
||||
*
|
||||
* @apiParamExample {json} Simple-Request Example
|
||||
* {
|
||||
* "time_interval_id": 1,
|
||||
* "screenshot": <binary data>
|
||||
* }
|
||||
*
|
||||
* @apiSuccess {Object} res User
|
||||
*
|
||||
* @apiUse ScreenshotObject
|
||||
*
|
||||
* @apiSuccessExample {json} Response Example
|
||||
* HTTP/1.1 200 OK
|
||||
* {
|
||||
* "res": {
|
||||
* "id": 1,
|
||||
* "time_interval_id": 1,
|
||||
* "path": "uploads\/screenshots\/1_1_1.png",
|
||||
* "created_at": "2020-01-23T09:42:26+00:00",
|
||||
* "updated_at": "2020-01-23T09:42:26+00:00",
|
||||
* "deleted_at": null,
|
||||
* "thumbnail_path": null,
|
||||
* "important": false,
|
||||
* "is_removed": false
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* @apiUse 400Error
|
||||
* @apiUse ValidationError
|
||||
* @apiUse UnauthorizedError
|
||||
* @apiUse ForbiddenError
|
||||
*/
|
||||
/**
|
||||
* @apiDeprecated since 4.0.0
|
||||
* @api {post} /screenshots/remove Destroy
|
||||
* @apiDescription Destroy Screenshot
|
||||
*
|
||||
* @apiVersion 1.0.0
|
||||
* @apiName Destroy
|
||||
* @apiGroup Screenshot
|
||||
*
|
||||
* @apiUse AuthHeader
|
||||
*
|
||||
* @apiPermission screenshots_remove
|
||||
* @apiPermission screenshots_full_access
|
||||
*
|
||||
* @apiParam {Integer} id ID of the target screenshot
|
||||
*
|
||||
* @apiParamExample {json} Request Example
|
||||
* {
|
||||
* "id": 1
|
||||
* }
|
||||
*
|
||||
* @apiSuccess {String} message Destroy status
|
||||
*
|
||||
* @apiSuccessExample {json} Response Example
|
||||
* HTTP/1.1 200 OK
|
||||
* {
|
||||
* "message": "Item has been removed"
|
||||
* }
|
||||
*
|
||||
* @apiUse 400Error
|
||||
* @apiUse ValidationError
|
||||
* @apiUse ForbiddenError
|
||||
* @apiUse UnauthorizedError
|
||||
*/
|
||||
|
||||
/**
|
||||
* @apiDeprecated since 1.0.0
|
||||
* @api {post} /screenshots/bulk-create Bulk Create
|
||||
* @apiDescription Create Screenshot
|
||||
*
|
||||
* @apiVersion 1.0.0
|
||||
* @apiName Bulk Create
|
||||
* @apiGroup Screenshot
|
||||
*
|
||||
* @apiPermission screenshots_bulk_create
|
||||
* @apiPermission screenshots_full_access
|
||||
*/
|
||||
|
||||
/**
|
||||
* @apiDeprecated since 4.0.0
|
||||
* @api {get,post} /screenshot/count Count
|
||||
* @apiDescription Count Screenshots
|
||||
*
|
||||
* @apiVersion 1.0.0
|
||||
* @apiName Count
|
||||
* @apiGroup Screenshot
|
||||
*
|
||||
* @apiUse AuthHeader
|
||||
*
|
||||
* @apiSuccess {String} total Amount of projects that we have
|
||||
*
|
||||
* @apiSuccessExample {json} Response Example
|
||||
* HTTP/1.1 200 OK
|
||||
* {
|
||||
* "total": 2
|
||||
* }
|
||||
*
|
||||
* @apiUse 400Error
|
||||
* @apiUse ForbiddenError
|
||||
* @apiUse UnauthorizedError
|
||||
*/
|
||||
/**
|
||||
* @apiDeprecated since 4.0.0
|
||||
* @api {post} /screenshots/show Show
|
||||
* @apiDescription Show Screenshot
|
||||
*
|
||||
* @apiVersion 1.0.0
|
||||
* @apiName Show
|
||||
* @apiGroup Screenshot
|
||||
*
|
||||
* @apiUse AuthHeader
|
||||
*
|
||||
* @apiPermission screenshots_show
|
||||
* @apiPermission screenshots_full_access
|
||||
*
|
||||
* @apiParam {Integer} id ID
|
||||
*
|
||||
* @apiUse ScreenshotParams
|
||||
*
|
||||
* @apiParamExample {json} Request Example
|
||||
* {
|
||||
* "id": 1,
|
||||
* "time_interval_id": ["=", [1,2,3]],
|
||||
* "path": ["like", "%lorem%"],
|
||||
* "created_at": [">", "2019-01-01 00:00:00"],
|
||||
* "updated_at": ["<", "2019-01-01 00:00:00"]
|
||||
* }
|
||||
*
|
||||
* @apiUse ScreenshotObject
|
||||
*
|
||||
* @apiSuccessExample {json} Response Example
|
||||
* HTTP/1.1 200 OK
|
||||
* {
|
||||
* "id": 1,
|
||||
* "time_interval_id": 1,
|
||||
* "path": "uploads\/screenshots\/1_1_1.png",
|
||||
* "created_at": "2020-01-23T09:42:26+00:00",
|
||||
* "updated_at": "2020-01-23T09:42:26+00:00",
|
||||
* "deleted_at": null,
|
||||
* "thumbnail_path": null,
|
||||
* "important": false,
|
||||
* "is_removed": false
|
||||
* }
|
||||
*
|
||||
* @apiUse 400Error
|
||||
* @apiUse ValidationError
|
||||
* @apiUse UnauthorizedError
|
||||
* @apiUse ItemNotFoundError
|
||||
*/
|
||||
Reference in New Issue
Block a user