Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions api/utils/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @typedef {import('../../types/requestProcessor').Params} Params
* @typedef {import('../../types/common').TimeObject} TimeObject
* @typedef {import('mongodb').ObjectId} ObjectId
* typedef {import('moment-timezone').Moment} MomentTimezone
* @typedef {import('moment-timezone').Moment} MomentTimezone
*/

/** @lends module:api/utils/common **/
Expand Down Expand Up @@ -3466,4 +3466,4 @@ common.trimWhitespaceStartEnd = function(value) {
};

/** @type(import('../../types/common').Common) */
module.exports = common;
module.exports = common;
14 changes: 14 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
},
"devDependencies": {
"@stylistic/eslint-plugin": "^2.11.0",
"@types/mocha": "^10.0.10",
"@types/underscore": "^1.13.0",
"docdash": "^2.0.1",
"eslint-plugin-vue": "^9.31.0",
"grunt-contrib-watch": "1.1.0",
Expand Down
2 changes: 2 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"include": [
//"plugins/push/**/*.ts",
//"plugins/push/**/*.js"
"plugins/ai-assistants/**/*.ts",
"plugins/ai-assistants/**/*.js",
"api/utils/common.js",
"api/utils/localization.js",
"api/lib/countly.common.js",
Expand Down
27 changes: 14 additions & 13 deletions types/common.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,25 +107,25 @@ export interface ValidationArgProperties {
//array: boolean;
//discriminator: (value: any) => any;
/** property should not be longer than provided value */
'max-length': string;//number;
'max-length'?: string;//number;
/** property should not be shorter than provided value */
'min-length': string;//number;
max: string;// number;
min: string;// number;
'min-length'?: string;//number;
max?: string;// number;
min?: string;// number;
/** should string property has any number in it */
'has-number': string;//boolean;
'has-number'?: string;//boolean;
/** should string property has any latin character in it */
'has-char': string;//boolean;
'has-char'?: string;//boolean;
/** should string property has any upper cased latin character in it */
'has-upchar': string;//boolean;
'has-upchar'?: string;//boolean;
/** should string property has any none latin character in it */
'has-special': string;//boolean;
'has-special'?: string;//boolean;
//in?: string[] | (() => string[]);
//nonempty: boolean;
//custom: (value: any) => string | undefined;
//regex: string;
/** should property be present in returned validated args object */
'exclude-from-ret-obj': string;//boolean;
'exclude-from-ret-obj'?: string;//boolean;
//trim: boolean;
//mods: string;
//multiple: boolean;
Expand Down Expand Up @@ -293,6 +293,7 @@ export interface Common {

/** Database reference */
db: Db;
drillDb: Db;

/**
* Fetches nested property values from an obj.
Expand Down Expand Up @@ -508,11 +509,11 @@ export interface Common {
/**
* Output message as request response with provided http code
* @param {Params} params - params object
* @param {output} output - object to stringify and output
* @param {string} noescape - prevent escaping HTML entities
* @param {object} heads - headers to add to the output
* @param {any} output - object to stringify and output
* @param {string?} noescape - prevent escaping HTML entities
* @param {object?} heads - headers to add to the output
*/
returnOutput: (params: Params, output: output, noescape: string, heads: object) => void;
returnOutput: (params: Params, output: any, noescape?: string, heads?: object) => void;

/**
* Get IP address from request object
Expand Down
Loading