|
3 | 3 | * @module api/utils/requestProcessor |
4 | 4 | */ |
5 | 5 |
|
| 6 | +/** |
| 7 | + * @typedef {import('../../types/requestProcessor').Params} Params |
| 8 | + * @typedef {import('../../types/common').TimeObject} TimeObject |
| 9 | + */ |
| 10 | + |
6 | 11 | const Promise = require('bluebird'); |
7 | 12 | const url = require('url'); |
8 | 13 | const common = require('./common.js'); |
@@ -65,7 +70,7 @@ const reloadConfig = function() { |
65 | 70 | /** |
66 | 71 | * Default request processing handler, which requires request context to operate. Check tcp_example.js |
67 | 72 | * @static |
68 | | - * @param {params} params - for request context. Minimum needed properties listed |
| 73 | + * @param {Params} params - for request context. Minimum needed properties listed |
69 | 74 | * @param {object} params.req - Request object, should not be empty and should contain listed params |
70 | 75 | * @param {string} params.req.url - Endpoint URL that you are calling. May contain query string. |
71 | 76 | * @param {object} params.req.body - Parsed JSON object with data (same name params will overwrite query string if anything provided there) |
@@ -103,9 +108,9 @@ const processRequest = (params) => { |
103 | 108 | paths = urlParts.pathname.split("/"); |
104 | 109 | /** |
105 | 110 | * Main request processing object containing all information shared through all the parts of the same request |
106 | | - * @typedef params |
107 | | - * @type {object} |
108 | | - * @global |
| 111 | + * typedef params |
| 112 | + * type {object} |
| 113 | + * global |
109 | 114 | * @property {string} href - full URL href |
110 | 115 | * @property {http.ServerResponse} res - The HTTP response object |
111 | 116 | * @property {http.IncomingMessage} req - The HTTP request object |
@@ -182,7 +187,7 @@ const processRequest = (params) => { |
182 | 187 | * @property {Object} [member.permission.d[app_id].allowed] - Object containing allowed delete permissions for the app |
183 | 188 | * @property {Object} member.eventList - Object containing event collections with replaced app names |
184 | 189 | * @property {Object} member.viewList - Object containing view collections with replaced app names |
185 | | - * @property {timeObject} time - Time object for the request |
| 190 | + * @property {TimeObject} time - Time object for the request |
186 | 191 | * @property {string} request_hash - Hash of the request data |
187 | 192 | * @property {string} [previous_session] - ID of the user's previous session |
188 | 193 | * @property {number} [previous_session_start] - Start timestamp of the user's previous session |
@@ -3747,7 +3752,7 @@ function processUser(params, initiator, done, try_times) { |
3747 | 3752 | /** |
3748 | 3753 | * Function to fetch app user from db |
3749 | 3754 | * @param {object} params - params object |
3750 | | - * @returns {promise} - user |
| 3755 | + * @returns {Promise} - user |
3751 | 3756 | */ |
3752 | 3757 | const fetchAppUser = (params) => { |
3753 | 3758 | return new Promise((resolve) => { |
|
0 commit comments