Skip to content

Commit

Permalink
Add missing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pheyvaer committed Mar 29, 2023
1 parent 8d887cc commit db245ec
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion lib/handlers/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ module.exports = class Handler {
handle() {
}

/**
* This function fills in all path and query parameters in the GraphQL-LD and SPARQL queries.
* @param queryInfo - The query info object.
* @param pathParams - The path parameters.
* @param queryParams - The query parameters.
* @param prefix - The prefix that is used for substituting variables in the query with the parameter values.
* @param errorPrefix - The text that is added in front of error messages.
* @returns {{}} - The updates queries.
*/
fillInParameters(queryInfo, pathParams, queryParams, prefix, errorPrefix) {
return Object.keys(queryInfo.queries).reduce((acc, val) => {
const missingRequiredParameter = this._areRequiredParametersMissing(queryInfo.parameters, pathParams, queryParams);
Expand Down Expand Up @@ -125,6 +134,14 @@ module.exports = class Handler {
}
};

/**
* This function return the required parameters for which no value is provided.
* @param definedParams - The defined parameters.
* @param actualPathParams - The actual path parameters.
* @param actualQueryParams - The actual query parameters.
* @returns {{[p: string]: *}|boolean} - The required parameters for which no value is provided or false.
* @private
*/
_areRequiredParametersMissing(definedParams = {}, actualPathParams, actualQueryParams) {
const definedParamNames = Object.keys(definedParams);

Expand Down Expand Up @@ -158,6 +175,10 @@ module.exports = class Handler {
}
}

encodeIntegerAsParameterValue() {
/**
* This function returns an encoded version of an integer that can be used in a query.
* @param val - The original integer value.
*/
encodeIntegerAsParameterValue(val) {
}
};

0 comments on commit db245ec

Please sign in to comment.