@kipicore/dbcore 1.1.659 → 1.1.661
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonValidator/commandValidator.d.ts +27 -0
- package/dist/commonValidator/commandValidator.js +225 -0
- package/dist/commonValidator/index.d.ts +2 -0
- package/dist/commonValidator/index.js +18 -0
- package/dist/commonValidator/joiCommonValidator.d.ts +12 -0
- package/dist/commonValidator/joiCommonValidator.js +47 -0
- package/dist/commonValidator/joiSchemaBuilder.d.ts +6 -0
- package/dist/commonValidator/joiSchemaBuilder.js +70 -0
- package/dist/constants/app.d.ts +15 -12
- package/dist/constants/app.js +20 -17
- package/dist/constants/errorMessages.d.ts +17 -0
- package/dist/constants/errorMessages.js +20 -1
- package/dist/constants/successMessages.d.ts +14 -0
- package/dist/constants/successMessages.js +17 -1
- package/dist/db/psql/migrations/20260714111425-change_status_enum_to_string_in_institutes.js +46 -0
- package/dist/db/psql/migrations/20260714131500-add_note_to_institutes.d.ts +2 -0
- package/dist/db/psql/migrations/20260714131500-add_note_to_institutes.js +20 -0
- package/dist/db/psql/migrations/20260715150000-create-ai-model-keys.d.ts +2 -0
- package/dist/db/psql/migrations/20260715150000-create-ai-model-keys.js +156 -0
- package/dist/db/psql/migrations/20260717071354-add_type_to_categories.d.ts +2 -0
- package/dist/db/psql/migrations/20260717071354-add_type_to_categories.js +19 -0
- package/dist/db/psql/migrations/20260717072745-add_type_to_sub_categories.d.ts +2 -0
- package/dist/db/psql/migrations/20260717072745-add_type_to_sub_categories.js +19 -0
- package/dist/db/psql/migrations/20260717095051-add_status_to_users.d.ts +2 -0
- package/dist/db/psql/migrations/20260717095051-add_status_to_users.js +19 -0
- package/dist/helpers/utils.d.ts +0 -3
- package/dist/helpers/utils.js +1 -28
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/interfaces/aiModelKeysInterface.d.ts +15 -0
- package/dist/interfaces/categoriesInterface.d.ts +2 -1
- package/dist/interfaces/index.d.ts +1 -12
- package/dist/interfaces/index.js +1 -13
- package/dist/interfaces/instituteInterface.d.ts +1 -0
- package/dist/interfaces/subCategoriesInterface.d.ts +2 -1
- package/dist/interfaces/userInterface.d.ts +2 -1
- package/dist/interfaces/vendorCompanyMetaInterface.d.ts +1 -1
- package/dist/models/mongodb/index.d.ts +0 -2
- package/dist/models/mongodb/index.js +1 -6
- package/dist/models/mongodb/productMetaModel.js +8 -0
- package/dist/models/mongodb/vendorCompanyMetaModel.js +1 -1
- package/dist/models/psql/SubCategoriesModel.d.ts +2 -1
- package/dist/models/psql/SubCategoriesModel.js +5 -0
- package/dist/models/psql/aiModelKeysModel.d.ts +20 -0
- package/dist/models/psql/aiModelKeysModel.js +70 -0
- package/dist/models/psql/categoriesModel.d.ts +2 -1
- package/dist/models/psql/categoriesModel.js +5 -0
- package/dist/models/psql/index.d.ts +1 -10
- package/dist/models/psql/index.js +4 -23
- package/dist/models/psql/instituteModel.d.ts +1 -0
- package/dist/models/psql/instituteModel.js +5 -2
- package/dist/models/psql/userModel.d.ts +2 -1
- package/dist/models/psql/userModel.js +1 -0
- package/dist/types/aiModelKeysType.d.ts +3 -0
- package/dist/types/commonType.d.ts +20 -1
- package/dist/types/index.d.ts +1 -12
- package/dist/types/index.js +1 -13
- package/package.json +3 -2
- package/dist/db/psql/migrations/20260714095754-create-arena-models.js +0 -642
- package/dist/db/psql/migrations/20260720092201-replace-facility-sports-with-sport-group-data.d.ts +0 -2
- package/dist/db/psql/migrations/20260720092201-replace-facility-sports-with-sport-group-data.js +0 -138
- package/dist/interfaces/ageGroupInterface.d.ts +0 -12
- package/dist/interfaces/assessmentTestInterface.d.ts +0 -24
- package/dist/interfaces/equipmentInterface.d.ts +0 -10
- package/dist/interfaces/equipmentInterface.js +0 -2
- package/dist/interfaces/facilityMasterInterface.d.ts +0 -9
- package/dist/interfaces/facilityMasterInterface.js +0 -2
- package/dist/interfaces/skillInterface.d.ts +0 -15
- package/dist/interfaces/skillInterface.js +0 -2
- package/dist/interfaces/sportCategoryInterface.d.ts +0 -9
- package/dist/interfaces/sportCategoryInterface.js +0 -2
- package/dist/interfaces/sportGroupDataInterface.d.ts +0 -7
- package/dist/interfaces/sportGroupDataInterface.js +0 -2
- package/dist/interfaces/sportInfoInterface.d.ts +0 -23
- package/dist/interfaces/sportInfoInterface.js +0 -2
- package/dist/interfaces/sportInterface.d.ts +0 -10
- package/dist/interfaces/sportInterface.js +0 -2
- package/dist/interfaces/sportRoleInterface.d.ts +0 -11
- package/dist/interfaces/sportRoleInterface.js +0 -2
- package/dist/interfaces/sportSubCategoryInterface.d.ts +0 -10
- package/dist/interfaces/sportSubCategoryInterface.js +0 -2
- package/dist/interfaces/unitInterface.d.ts +0 -10
- package/dist/interfaces/unitInterface.js +0 -2
- package/dist/models/mongodb/assessmentTestModel.d.ts +0 -4
- package/dist/models/mongodb/assessmentTestModel.js +0 -72
- package/dist/models/mongodb/sportInfoModel.d.ts +0 -4
- package/dist/models/mongodb/sportInfoModel.js +0 -71
- package/dist/models/psql/ageGroupModel.d.ts +0 -22
- package/dist/models/psql/ageGroupModel.js +0 -76
- package/dist/models/psql/equipmentModel.d.ts +0 -20
- package/dist/models/psql/equipmentModel.js +0 -57
- package/dist/models/psql/facilityMasterModel.d.ts +0 -18
- package/dist/models/psql/facilityMasterModel.js +0 -64
- package/dist/models/psql/skillModel.d.ts +0 -25
- package/dist/models/psql/skillModel.js +0 -99
- package/dist/models/psql/sportCategoryModel.d.ts +0 -19
- package/dist/models/psql/sportCategoryModel.js +0 -53
- package/dist/models/psql/sportGroupDataModel.d.ts +0 -13
- package/dist/models/psql/sportGroupDataModel.js +0 -64
- package/dist/models/psql/sportModel.d.ts +0 -20
- package/dist/models/psql/sportModel.js +0 -58
- package/dist/models/psql/sportRoleModel.d.ts +0 -21
- package/dist/models/psql/sportRoleModel.js +0 -71
- package/dist/models/psql/sportSubCategoryModel.d.ts +0 -20
- package/dist/models/psql/sportSubCategoryModel.js +0 -75
- package/dist/models/psql/unitModel.d.ts +0 -20
- package/dist/models/psql/unitModel.js +0 -57
- package/dist/types/ageGroupType.d.ts +0 -2
- package/dist/types/ageGroupType.js +0 -2
- package/dist/types/assessmentTestType.d.ts +0 -2
- package/dist/types/assessmentTestType.js +0 -2
- package/dist/types/equipmentType.d.ts +0 -2
- package/dist/types/equipmentType.js +0 -2
- package/dist/types/facilityMasterType.d.ts +0 -3
- package/dist/types/facilityMasterType.js +0 -2
- package/dist/types/skillType.d.ts +0 -2
- package/dist/types/skillType.js +0 -2
- package/dist/types/sportCategoryType.d.ts +0 -2
- package/dist/types/sportCategoryType.js +0 -2
- package/dist/types/sportGroupDataType.d.ts +0 -3
- package/dist/types/sportGroupDataType.js +0 -2
- package/dist/types/sportInfoType.d.ts +0 -2
- package/dist/types/sportInfoType.js +0 -2
- package/dist/types/sportRoleType.d.ts +0 -2
- package/dist/types/sportRoleType.js +0 -2
- package/dist/types/sportSubCategoryType.d.ts +0 -2
- package/dist/types/sportSubCategoryType.js +0 -2
- package/dist/types/sportType.d.ts +0 -2
- package/dist/types/sportType.js +0 -2
- package/dist/types/unitType.d.ts +0 -2
- package/dist/types/unitType.js +0 -2
- /package/dist/db/psql/migrations/{20260714095754-create-arena-models.d.ts → 20260714111425-change_status_enum_to_string_in_institutes.d.ts} +0 -0
- /package/dist/interfaces/{ageGroupInterface.js → aiModelKeysInterface.js} +0 -0
- /package/dist/{interfaces/assessmentTestInterface.js → types/aiModelKeysType.js} +0 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import Joi from 'joi';
|
|
2
|
+
import { Request, Response, NextFunction } from 'express';
|
|
3
|
+
import BaseValidator from './joiSchemaBuilder';
|
|
4
|
+
import { CrudValidatorRules } from '../types/commonType';
|
|
5
|
+
export default class BaseCrudValidator<TModel extends Record<string, any>, TKeys extends Extract<keyof TModel, string> = Extract<keyof TModel, string>> extends BaseValidator {
|
|
6
|
+
protected baseSchema: Joi.ObjectSchema<any>;
|
|
7
|
+
protected rules: CrudValidatorRules<TKeys>;
|
|
8
|
+
constructor(baseSchema: Joi.ObjectSchema<any>, rules?: CrudValidatorRules<TKeys>);
|
|
9
|
+
/** MERGE RULES */
|
|
10
|
+
private mergeRules;
|
|
11
|
+
/** APPLY DEFAULT ID RULE */
|
|
12
|
+
private applyDefaultIdRule;
|
|
13
|
+
/** Nested Required for */
|
|
14
|
+
private applyNestedRequired;
|
|
15
|
+
/** CREATE */
|
|
16
|
+
createValidator: (req: Request, res: Response, next: NextFunction) => void;
|
|
17
|
+
/** UPDATE */
|
|
18
|
+
updateValidator: (req: Request, res: Response, next: NextFunction) => void;
|
|
19
|
+
/** DELETE */
|
|
20
|
+
deleteValidator: (req: Request, res: Response, next: NextFunction) => void;
|
|
21
|
+
/** GET BY ID */
|
|
22
|
+
getByIdValidator: (req: Request, res: Response, next: NextFunction) => void;
|
|
23
|
+
/** GET ALL */
|
|
24
|
+
getAllValidator: (req: Request, res: Response, next: NextFunction) => void;
|
|
25
|
+
/** GET ALL WITH PAGINATION */
|
|
26
|
+
getAllWithPaginationValidator: (req: Request, res: Response, next: NextFunction) => void;
|
|
27
|
+
}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
const joi_1 = __importDefault(require("joi"));
|
|
40
|
+
const joiSchemaBuilder_1 = __importStar(require("./joiSchemaBuilder"));
|
|
41
|
+
const joiCommonValidator_1 = require("./joiCommonValidator");
|
|
42
|
+
class BaseCrudValidator extends joiSchemaBuilder_1.default {
|
|
43
|
+
constructor(baseSchema, rules = {}) {
|
|
44
|
+
super();
|
|
45
|
+
/** CREATE */
|
|
46
|
+
this.createValidator = (req, res, next) => {
|
|
47
|
+
try {
|
|
48
|
+
const mergedRules = this.mergeRules({}, this.rules.create);
|
|
49
|
+
let schema = (0, joiSchemaBuilder_1.buildSchema)(this.baseSchema, mergedRules);
|
|
50
|
+
if (mergedRules.nestedRequired?.length) {
|
|
51
|
+
schema = this.applyNestedRequired(schema, mergedRules.nestedRequired);
|
|
52
|
+
}
|
|
53
|
+
this.validate(schema, req);
|
|
54
|
+
next();
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
next(err);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
/** UPDATE */
|
|
61
|
+
this.updateValidator = (req, res, next) => {
|
|
62
|
+
try {
|
|
63
|
+
const idRules = this.applyDefaultIdRule(this.rules.update);
|
|
64
|
+
const mergedRules = this.mergeRules({}, idRules);
|
|
65
|
+
let schema = (0, joiSchemaBuilder_1.buildSchema)(this.baseSchema, mergedRules);
|
|
66
|
+
if (mergedRules.nestedRequired?.length) {
|
|
67
|
+
schema = this.applyNestedRequired(schema, mergedRules.nestedRequired);
|
|
68
|
+
}
|
|
69
|
+
this.validate(schema, req);
|
|
70
|
+
next();
|
|
71
|
+
}
|
|
72
|
+
catch (err) {
|
|
73
|
+
next(err);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
/** DELETE */
|
|
77
|
+
this.deleteValidator = (req, res, next) => {
|
|
78
|
+
try {
|
|
79
|
+
const idRules = this.applyDefaultIdRule(this.rules.delete);
|
|
80
|
+
const mergedRules = this.mergeRules({}, idRules);
|
|
81
|
+
const schema = (0, joiSchemaBuilder_1.buildSchema)(this.baseSchema, mergedRules);
|
|
82
|
+
this.validate(schema, req);
|
|
83
|
+
next();
|
|
84
|
+
}
|
|
85
|
+
catch (err) {
|
|
86
|
+
next(err);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
/** GET BY ID */
|
|
90
|
+
this.getByIdValidator = (req, res, next) => {
|
|
91
|
+
try {
|
|
92
|
+
const idRules = this.applyDefaultIdRule(this.rules.getById);
|
|
93
|
+
const mergedRules = this.mergeRules({}, idRules);
|
|
94
|
+
const schema = (0, joiSchemaBuilder_1.buildSchema)(this.baseSchema, mergedRules);
|
|
95
|
+
this.validate(schema, req);
|
|
96
|
+
next();
|
|
97
|
+
}
|
|
98
|
+
catch (err) {
|
|
99
|
+
next(err);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
/** GET ALL */
|
|
103
|
+
this.getAllValidator = (req, res, next) => {
|
|
104
|
+
try {
|
|
105
|
+
const mergedRules = this.mergeRules({}, this.rules.getAll);
|
|
106
|
+
const schema = (0, joiSchemaBuilder_1.buildSchema)(this.baseSchema, mergedRules);
|
|
107
|
+
this.validate(schema, req);
|
|
108
|
+
next();
|
|
109
|
+
}
|
|
110
|
+
catch (err) {
|
|
111
|
+
next(err);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
/** GET ALL WITH PAGINATION */
|
|
115
|
+
this.getAllWithPaginationValidator = (req, res, next) => {
|
|
116
|
+
try {
|
|
117
|
+
const mergedRules = this.mergeRules({ customFields: joiCommonValidator_1.paginationValidators }, this.rules.getAllWithPagination ?? this.rules.getAll);
|
|
118
|
+
const schema = (0, joiSchemaBuilder_1.buildSchema)(this.baseSchema, mergedRules);
|
|
119
|
+
this.validate(schema, req);
|
|
120
|
+
next();
|
|
121
|
+
}
|
|
122
|
+
catch (err) {
|
|
123
|
+
next(err);
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
this.baseSchema = baseSchema;
|
|
127
|
+
this.rules = rules;
|
|
128
|
+
}
|
|
129
|
+
/** MERGE RULES */
|
|
130
|
+
mergeRules(defaultRules, overrideRules) {
|
|
131
|
+
const defaultCustomFields = {
|
|
132
|
+
search: joi_1.default.string().optional().allow(null),
|
|
133
|
+
};
|
|
134
|
+
return {
|
|
135
|
+
...defaultRules,
|
|
136
|
+
...overrideRules,
|
|
137
|
+
required: [...(defaultRules.required || []), ...(overrideRules?.required || [])],
|
|
138
|
+
optional: [...(defaultRules.optional || []), ...(overrideRules?.optional || [])],
|
|
139
|
+
allowNull: [...(defaultRules.allowNull || []), ...(overrideRules?.allowNull || [])],
|
|
140
|
+
forbidden: [...(defaultRules.forbidden || []), ...(overrideRules?.forbidden || [])],
|
|
141
|
+
singleOrArray: [...(defaultRules.singleOrArray || []), ...(overrideRules?.singleOrArray || [])],
|
|
142
|
+
singleOrArrayOrNull: [...(defaultRules.singleOrArrayOrNull || []), ...(overrideRules?.singleOrArrayOrNull || [])],
|
|
143
|
+
nestedRequired: [...(defaultRules.nestedRequired || []), ...(overrideRules?.nestedRequired || [])],
|
|
144
|
+
customFields: {
|
|
145
|
+
...defaultCustomFields,
|
|
146
|
+
...(defaultRules.customFields || {}),
|
|
147
|
+
...(overrideRules?.customFields || {}),
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
/** APPLY DEFAULT ID RULE */
|
|
152
|
+
applyDefaultIdRule(override) {
|
|
153
|
+
const overrideHasId = override?.required?.includes('id') ||
|
|
154
|
+
override?.optional?.includes('id') ||
|
|
155
|
+
override?.forbidden?.includes('id');
|
|
156
|
+
if (override && overrideHasId)
|
|
157
|
+
return override;
|
|
158
|
+
if (override)
|
|
159
|
+
return override;
|
|
160
|
+
return { required: ['id'] };
|
|
161
|
+
}
|
|
162
|
+
/** Nested Required for */
|
|
163
|
+
// private applyNestedRequired(schema: Joi.ObjectSchema, paths: string[]): Joi.ObjectSchema {
|
|
164
|
+
// return schema.custom((value, helpers) => {
|
|
165
|
+
// for (const path of paths) {
|
|
166
|
+
// const keys = path.split('.');
|
|
167
|
+
// let current: any = value;
|
|
168
|
+
// let fullPath = '';
|
|
169
|
+
// for (const key of keys) {
|
|
170
|
+
// if (Array.isArray(current)) {
|
|
171
|
+
// if (!current.length) {
|
|
172
|
+
// return helpers.message(`"${fullPath || path}" is required`);
|
|
173
|
+
// }
|
|
174
|
+
// current = current[0];
|
|
175
|
+
// fullPath += '[0]';
|
|
176
|
+
// }
|
|
177
|
+
// fullPath = fullPath ? `${fullPath}.${key}` : key;
|
|
178
|
+
// if (current?.[key] === undefined) {
|
|
179
|
+
// return helpers.message(`"${fullPath}" is required`);
|
|
180
|
+
// }
|
|
181
|
+
// current = current[key];
|
|
182
|
+
// }
|
|
183
|
+
// }
|
|
184
|
+
// return value;
|
|
185
|
+
// });
|
|
186
|
+
// }
|
|
187
|
+
applyNestedRequired(schema, paths) {
|
|
188
|
+
return schema
|
|
189
|
+
.custom((value, helpers) => {
|
|
190
|
+
const checkPath = (current, keys, basePath = '') => {
|
|
191
|
+
if (!keys.length)
|
|
192
|
+
return null;
|
|
193
|
+
const [key, ...rest] = keys;
|
|
194
|
+
if (Array.isArray(current)) {
|
|
195
|
+
for (let i = 0; i < current.length; i++) {
|
|
196
|
+
const result = checkPath(current[i], keys, `${basePath}[${i}]`);
|
|
197
|
+
if (result)
|
|
198
|
+
return result;
|
|
199
|
+
}
|
|
200
|
+
return null;
|
|
201
|
+
}
|
|
202
|
+
const nextValue = current?.[key];
|
|
203
|
+
const currentPath = basePath ? `${basePath}.${key}` : key;
|
|
204
|
+
if (nextValue === undefined) {
|
|
205
|
+
return currentPath;
|
|
206
|
+
}
|
|
207
|
+
return checkPath(nextValue, rest, currentPath);
|
|
208
|
+
};
|
|
209
|
+
for (const path of paths) {
|
|
210
|
+
const keys = path.split('.');
|
|
211
|
+
const missingPath = checkPath(value, keys);
|
|
212
|
+
if (missingPath) {
|
|
213
|
+
return helpers.error('any.custom', {
|
|
214
|
+
path: missingPath,
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return value;
|
|
219
|
+
})
|
|
220
|
+
.messages({
|
|
221
|
+
'any.custom': '"{{#path}}" is required',
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
exports.default = BaseCrudValidator;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./joiSchemaBuilder"), exports);
|
|
18
|
+
__exportStar(require("./joiCommonValidator"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import Joi from 'joi';
|
|
2
|
+
export declare const paginationValidators: {
|
|
3
|
+
page: Joi.NumberSchema<number>;
|
|
4
|
+
limit: Joi.NumberSchema<number>;
|
|
5
|
+
search: Joi.StringSchema<string>;
|
|
6
|
+
isPaginate: Joi.BooleanSchema<boolean>;
|
|
7
|
+
order: Joi.ArraySchema<string[][]>;
|
|
8
|
+
sort: Joi.StringSchema<string>;
|
|
9
|
+
};
|
|
10
|
+
export declare const enumAlternatives: (enumObj: Record<string, string>, isRequired?: boolean, allowArray?: boolean) => Joi.AlternativesSchema<any> | Joi.StringSchema<string>;
|
|
11
|
+
export declare const objectIdAlternatives: (isRequired?: boolean, allowArray?: boolean) => Joi.AlternativesSchema<any> | undefined;
|
|
12
|
+
export declare const uuidIdAlternatives: (isRequired?: boolean, allowArray?: boolean) => Joi.AlternativesSchema<any> | undefined;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.uuidIdAlternatives = exports.objectIdAlternatives = exports.enumAlternatives = exports.paginationValidators = void 0;
|
|
7
|
+
const joi_1 = __importDefault(require("joi"));
|
|
8
|
+
exports.paginationValidators = {
|
|
9
|
+
page: joi_1.default.number().integer().min(1).default(1),
|
|
10
|
+
limit: joi_1.default.number().integer().min(1).default(10),
|
|
11
|
+
search: joi_1.default.string().trim(),
|
|
12
|
+
isPaginate: joi_1.default.boolean().default(true),
|
|
13
|
+
order: joi_1.default.array().items(joi_1.default.array().items(joi_1.default.string().trim(), joi_1.default.string().trim())),
|
|
14
|
+
sort: joi_1.default.string()
|
|
15
|
+
.pattern(/^(-?\\w+(,-?\\w+)*)?$/)
|
|
16
|
+
.optional()
|
|
17
|
+
.messages({
|
|
18
|
+
'string.pattern.base': `"sort" must be a comma-separated list of field names, optionally prefixed with '-' for descending`,
|
|
19
|
+
}),
|
|
20
|
+
};
|
|
21
|
+
const enumAlternatives = (enumObj, isRequired = false, allowArray = true) => {
|
|
22
|
+
const base = joi_1.default.string().valid(...Object.values(enumObj));
|
|
23
|
+
if (allowArray) {
|
|
24
|
+
const alt = joi_1.default.alternatives().try(base, joi_1.default.array().items(base));
|
|
25
|
+
return isRequired ? alt.required() : alt.optional();
|
|
26
|
+
}
|
|
27
|
+
return isRequired ? base.required() : base.optional();
|
|
28
|
+
};
|
|
29
|
+
exports.enumAlternatives = enumAlternatives;
|
|
30
|
+
const objectIdAlternatives = (isRequired = false, allowArray = true) => {
|
|
31
|
+
const base = joi_1.default.string()
|
|
32
|
+
.pattern(/^[0-9a-fA-F]{24}$/)
|
|
33
|
+
.message('Invalid ObjectId format');
|
|
34
|
+
if (allowArray) {
|
|
35
|
+
const alt = joi_1.default.alternatives().try(base, joi_1.default.array().items(base));
|
|
36
|
+
return isRequired ? alt.required() : alt.optional();
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
exports.objectIdAlternatives = objectIdAlternatives;
|
|
40
|
+
const uuidIdAlternatives = (isRequired = false, allowArray = true) => {
|
|
41
|
+
const base = joi_1.default.string().uuid().message('Invalid Uuid format');
|
|
42
|
+
if (allowArray) {
|
|
43
|
+
const alt = joi_1.default.alternatives().try(base, joi_1.default.array().items(base));
|
|
44
|
+
return isRequired ? alt.required() : alt.optional();
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
exports.uuidIdAlternatives = uuidIdAlternatives;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import Joi from 'joi';
|
|
2
|
+
import { SchemaRules } from '../types/commonType';
|
|
3
|
+
export declare const buildSchema: <TModel extends Record<string, any>, Keys extends keyof TModel & string = keyof TModel & string>(base: Joi.ObjectSchema<TModel>, rules?: SchemaRules<Keys>) => Joi.ObjectSchema<TModel>;
|
|
4
|
+
export default class BaseValidator {
|
|
5
|
+
protected validate(schema: Joi.ObjectSchema, req: any, options?: Joi.ValidationOptions): void;
|
|
6
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.buildSchema = void 0;
|
|
7
|
+
const joi_1 = __importDefault(require("joi"));
|
|
8
|
+
const httpStatusCode_1 = require("../constants/httpStatusCode");
|
|
9
|
+
class ApiError extends Error {
|
|
10
|
+
constructor(statusCode, message, isOperational = true, stack = '') {
|
|
11
|
+
super(message);
|
|
12
|
+
this.statusCode = statusCode;
|
|
13
|
+
this.isOperational = isOperational;
|
|
14
|
+
if (stack) {
|
|
15
|
+
this.stack = stack;
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
Error.captureStackTrace(this, this.constructor);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
// GENERIC BUILDER
|
|
23
|
+
const buildSchema = (base, rules = {}) => {
|
|
24
|
+
let schema = base;
|
|
25
|
+
// REQUIRED
|
|
26
|
+
if (rules.required) {
|
|
27
|
+
schema = schema.fork(rules.required, field => field.required());
|
|
28
|
+
}
|
|
29
|
+
// OPTIONAL
|
|
30
|
+
if (rules.optional) {
|
|
31
|
+
schema = schema.fork(rules.optional, field => field.optional());
|
|
32
|
+
}
|
|
33
|
+
// ALLOW NULL
|
|
34
|
+
if (rules.allowNull) {
|
|
35
|
+
schema = schema.fork(rules.allowNull, field => field.allow(null));
|
|
36
|
+
}
|
|
37
|
+
// FORBIDDEN
|
|
38
|
+
if (rules.forbidden) {
|
|
39
|
+
schema = schema.fork(rules.forbidden, field => field.forbidden());
|
|
40
|
+
}
|
|
41
|
+
// SINGLE OR ARRAY
|
|
42
|
+
if (rules.singleOrArray) {
|
|
43
|
+
schema = schema.fork(rules.singleOrArray, field => joi_1.default.alternatives().try(field, joi_1.default.array().items(field)));
|
|
44
|
+
}
|
|
45
|
+
// SINGLE OR ARRAY OR NULL
|
|
46
|
+
if (rules.singleOrArrayOrNull) {
|
|
47
|
+
schema = schema.fork(rules.singleOrArrayOrNull, field => joi_1.default.alternatives().try(field, joi_1.default.array().items(field), joi_1.default.valid(null)));
|
|
48
|
+
}
|
|
49
|
+
// CUSTOM FIELDS
|
|
50
|
+
if (rules.customFields) {
|
|
51
|
+
schema = schema.append(rules.customFields);
|
|
52
|
+
}
|
|
53
|
+
return schema;
|
|
54
|
+
};
|
|
55
|
+
exports.buildSchema = buildSchema;
|
|
56
|
+
const defaultOptions = {
|
|
57
|
+
abortEarly: false,
|
|
58
|
+
allowUnknown: false,
|
|
59
|
+
};
|
|
60
|
+
class BaseValidator {
|
|
61
|
+
validate(schema, req, options) {
|
|
62
|
+
const { error, value } = schema.validate({ ...req.body, ...req.query, ...req.params }, { ...defaultOptions, ...options });
|
|
63
|
+
if (error) {
|
|
64
|
+
const errorMessage = error.details.map(d => d.message).join(', ');
|
|
65
|
+
throw new ApiError(httpStatusCode_1.HTTP_STATUS_CODE.BAD_REQUEST, errorMessage);
|
|
66
|
+
}
|
|
67
|
+
req.body = value;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.default = BaseValidator;
|
package/dist/constants/app.d.ts
CHANGED
|
@@ -27,7 +27,8 @@ export declare enum PDF_MICRO_SERVICE_END_POINT {
|
|
|
27
27
|
export declare enum USER_STATUS {
|
|
28
28
|
OTP_VERIFICATION_PENDING = "OTP_VERIFICATION_PENDING",
|
|
29
29
|
ACTIVE = "ACTIVE",
|
|
30
|
-
INACTIVE = "INACTIVE"
|
|
30
|
+
INACTIVE = "INACTIVE",
|
|
31
|
+
BLOCKED = "BLOCKED"
|
|
31
32
|
}
|
|
32
33
|
export declare enum INVENTORY_TYPE {
|
|
33
34
|
INVENTORY = "INVENTORY",
|
|
@@ -223,7 +224,8 @@ export declare enum FEE_PAYMENT_STATUS {
|
|
|
223
224
|
}
|
|
224
225
|
export declare enum INSTITUTE_STATUS {
|
|
225
226
|
ACTIVE = "ACTIVE",
|
|
226
|
-
INACTIVE = "INACTIVE"
|
|
227
|
+
INACTIVE = "INACTIVE",
|
|
228
|
+
BLOCK = "BLOCK"
|
|
227
229
|
}
|
|
228
230
|
export declare enum OFFER_TYPE {
|
|
229
231
|
AMOUNT = "AMOUNT",
|
|
@@ -1836,16 +1838,17 @@ export declare enum APK_TYPE {
|
|
|
1836
1838
|
STUDENT_DEMO = "STUDENT_DEMO",
|
|
1837
1839
|
PLAYGROUP_DEMO = "PLAYGROUP_DEMO"
|
|
1838
1840
|
}
|
|
1839
|
-
export declare enum
|
|
1840
|
-
|
|
1841
|
-
|
|
1841
|
+
export declare enum CATEGORY_TYPE {
|
|
1842
|
+
INVENTORY = "INVENTORY",
|
|
1843
|
+
VENDOR = "VENDOR"
|
|
1842
1844
|
}
|
|
1843
|
-
export declare enum
|
|
1844
|
-
|
|
1845
|
-
LOWER = "LOWER"
|
|
1845
|
+
export declare enum AI_MODEL_KEYS {
|
|
1846
|
+
MASTER_PASSWORD = "MASTER_PASSWORD"
|
|
1846
1847
|
}
|
|
1847
|
-
export declare enum
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1848
|
+
export declare enum AI_MODEL_KEY_TYPES {
|
|
1849
|
+
STRING = "STRING",
|
|
1850
|
+
NUMBER = "NUMBER",
|
|
1851
|
+
BOOLEAN = "BOOLEAN",
|
|
1852
|
+
ARRAY = "ARRAY",
|
|
1853
|
+
OBJECT = "OBJECT"
|
|
1851
1854
|
}
|
package/dist/constants/app.js
CHANGED
|
@@ -5,7 +5,7 @@ exports.EXAM_ANSWER_SHEET_QUESTION_RESULT = exports.PAYMENT_TERMS_TYPE = exports
|
|
|
5
5
|
exports.PROJECT_ASSESSMENT_OPTION_STATUS = exports.USER_BOOK_ASSESSMENT_STATUS = exports.BOOK_ASSESSMENT_DATE_STATUS = exports.TASK_MANAGEMENT_STATUS = exports.USER_DETAILS_FILED = exports.DEVICE_TYPE = exports.templateKeyWord = exports.bankAccountRegexMap = exports.EMAIL_SUBJECTS = exports.PDF_TEMPLATES = exports.EMAIL_TEMPLATES = exports.PINCODE_API_URL = exports.APPLE_AUTH = exports.META_AUTH = exports.GOOGLE_AUTH = exports.API_URL = exports.DEFAULT_USER_LOGO = exports.DEFAULT_INSTITUTED_LOGO = exports.UPLOAD_PATH = exports.SVG_URL_PATH = exports.TO_DO_STATUS = exports.LECTURE_TITLE = exports.LECTURE_STATUS = exports.SCHOOL_INFORMATION_STEP = exports.CASTE = exports.RELIGION_CASTE = exports.NATIONALITY = exports.CATEGORY = exports.IS_PRINCIPAL = exports.FEE_TYPE = exports.BOOLEAN_STATUS = exports.PROPERTY_STATUS = exports.DESIGNATION_OF_PERSON = exports.TRUST_REGISTERED_UNDER = exports.TRUST_TYPE = exports.SVA_NAME = exports.QDC_NAME = exports.USER_PAYOUT_TYPE = exports.PARENTS_CHILDREN_CURRENT = exports.CHAPTER_INDEX_FILE_TYPE = exports.FEE_HISTORY_STATUS = exports.USER_CHAPTER_INDEX_STATUS = exports.CHAPTER_INDEX_TYPE = exports.IMAGE__NAME = exports.INQUIRY_STATUS = exports.INQUIRY_REFERRED_BY = exports.EXAM_GROUP_STANDARD_RESULT = exports.EXAM_GROUP_STATUS = exports.SUBJECT_INDEX_TYPE = exports.LECTURE_SLOT_DURATION = void 0;
|
|
6
6
|
exports.COMPETITION_EVENTS = exports.PAYMENT_STATUS = exports.INCOME_EXPENSE_SOURCE = exports.INCOME_EXPENSE_TYPE = exports.APPOINTMENT_STATUS = exports.MAINTENANCE_MODULE_NAME = exports.MAINTENANCE_TYPE = exports.MAINTENANCE_MODE = exports.ASSIGN_FILE_TYPE = exports.LOST_FOUND_ITEM_STATUS = exports.PAYMENT_PROCESSING_CALLBACK_URL = exports.PAYMENT_PROCESSING_PAGE_URL = exports.PAYMENT_PROCESSING_STATUS_URL = exports.WALLET_TRANSACTION_VALID_DATE_FOR_OTP_IN_MINUTES = exports.WALLET_TRANSACTION_VALID_DATE_IN_MINUTES = exports.PAYMENT_METHODS = exports.PAYMENT_GATEWAY_TYPES = exports.JOB_ACTION = exports.ONE_GB_BYTES = exports.CHARGE_PER_TRANSACTION_ITEM_UNIT = exports.INSTITUTE_SUBSCRIPTION_PLAN_STATUS = exports.WALLET_TRANSACTION_USERS_TYPE = exports.WALLET_HISTORY_STATUS = exports.WALLET_HISTORY_ACTION = exports.WALLET_HISTORY_ITEM_TYPE = exports.WALLET_HISTORY_TYPE = exports.REPLACE_TEACHER_STATUS = exports.TEACHER_TYPE = exports.INVOICE_TYPE = exports.PURCHASE_STATUS = exports.COLUMN_LIST_TITLE = exports.INVOICE_PAYMENT_TYPE = exports.PDF_CHEQUE_FREQUENCY = exports.PDF_CHEQUE_STATUS = exports.LANGUAGES = exports.HOME_WORK_STATUS = exports.SOCKET_EVENTS = exports.SUBSCRIPTION_PLAN_FILES_TYPE = exports.VALID_CURRENCY = exports.SUBSCRIPTION_PLAN_TYPE = exports.SUBSCRIPTION_PLAN_CHARGE_INTERVAL = exports.DISCOUNT_TYPE = exports.CONTACT_FEED_BACK_TYPE = exports.PLANNER_SYNC_STATUS = exports.RMS_NOTIFICATION_DAYS = exports.NOTIFICATION_ACTION = exports.ONLINE_EXAM_NOTIFICATION_TYPE = exports.NOTIFICATION_MODULE_TYPE = exports.NOTIFICATION_STATUS = exports.NOTIFICATION_TYPE = void 0;
|
|
7
7
|
exports.RMS_PRIORITY = exports.RMS_APPROVAL_STATUS = exports.RMS_TRANSACTION_TYPE = exports.RMS_RESOURCE_UNIT = exports.RMS_RESOURCE_TYPE = exports.RMS_ASSET_CONDITION = exports.CERTIFICATE_REQUEST_TYPE = exports.CERTIFICATE_REQUEST_STATUS = exports.FEE_SUBMISSION_STATUS = exports.VIDEO_DIRECTION_TYPE = exports.VIDEO_EVENT_TYPE = exports.USER_HAS_PENALTY_TITLE = exports.USER_HAS_PENALTY_TYPE = exports.PAYOUT_STATUS = exports.NOTICEBOARD_STATUS = exports.NOTICEBOARD_TYPE = exports.PERMISSION_TYPE = exports.NOTIFICATION_SEND_STATUS = exports.MEMBERSHIP_STATUS = exports.COMMUNITY_TYPE = exports.DESIGNATION_TYPE = exports.ADDITIONAL_PAYOUT_TYPE = exports.POSTAL_DISPATCH_STATUS = exports.CALL_TYPE = exports.SEARCH_TYPE = exports.REPORT_TYPE = exports.DEVICE_TYPE_APP_ANALYTICS = exports.APP_ANALYTICS_EVENT_TYPE = exports.EXPORT_SHEET_TYPE = exports.GRANT_AND_DONATION_TYPE = exports.TICKET_RAISE_PRIORITY = exports.TICKET_RAISE_STATUS = exports.TERM_AND_CONDITION_STATUS = exports.EDUCATION_OFFICER_TYPE = exports.HOME_WORK_TYPE = exports.STUDENT_FEE_PROCESS_STATUS = exports.FEE_COLLECTION_TYPE = exports.BANK_ACCOUNT_TYPE = exports.STUDENT_LEAVE_TYPE = exports.STUDENT_LEAVE_STATUS = exports.CERTIFICATE_TYPE = exports.CERTIFICATE_FOR = exports.SHEET_TYPE = exports.COMPETITION_USER_ROLE = exports.RESULT_STATUS = exports.COMPETITION_STATUS = exports.STATUS_BY_PARENTS = exports.COMPETITION_TYPE = exports.CAMPUS_CARNIVAL_STATUS = exports.COMPETITION_TYPE_CATEGORY = void 0;
|
|
8
|
-
exports.
|
|
8
|
+
exports.AI_MODEL_KEY_TYPES = exports.AI_MODEL_KEYS = exports.CATEGORY_TYPE = exports.APK_TYPE = exports.AccountAuditAction = exports.AccountBudgetType = exports.AccountTaxDirection = exports.AccountFundType = exports.AccountSyncAction = exports.AccountIntegrationProvider = exports.AccountApprovalActionType = exports.AccountDepreciationMethod = exports.AccountMatchStatus = exports.AccountExpensePaymentStatus = exports.AccountPaymentMode = exports.AccountVoucherTypeCode = exports.AccountCostCenterRefType = exports.AccountCostCenterType = exports.AccountPartyMode = exports.AccountPartyType = exports.AccountSourceModule = exports.AccountPostingEventStatus = exports.AccountBalanceType = exports.AccountApprovalStatus = exports.AccountVoucherStatus = exports.AccountLedgerType = exports.AccountNormalBalance = exports.AccountNature = exports.CONTACT_INTEREST_STATUS = exports.CONTACT_INTEREST_TYPE = exports.RMS_EXPENSE_TYPE = exports.RMS_DIGITAL_STATUS = exports.RMS_BOOKING_STATUS = exports.RMS_TICKET_PRIORITY = exports.RMS_TICKET_STATUS = exports.REFUND_ENTITY_TYPE = exports.REFUND_STATUS = exports.FINAL_RESULT_TYPE = exports.FINAL_RESULT = exports.GRADE = exports.RMS_STOCK_SCOPE = exports.RMS_AUDIT_ACTION = exports.RMS_ASSET_LIFECYCLE = exports.RMS_PO_FULFILLMENT_STATUS = exports.RMS_GRN_ACTION_TYPE = void 0;
|
|
9
9
|
const env_1 = require("../configs/env");
|
|
10
10
|
exports.SIXTY = 60;
|
|
11
11
|
exports.ONE_HUNDRED = 100;
|
|
@@ -41,6 +41,7 @@ var USER_STATUS;
|
|
|
41
41
|
USER_STATUS["OTP_VERIFICATION_PENDING"] = "OTP_VERIFICATION_PENDING";
|
|
42
42
|
USER_STATUS["ACTIVE"] = "ACTIVE";
|
|
43
43
|
USER_STATUS["INACTIVE"] = "INACTIVE";
|
|
44
|
+
USER_STATUS["BLOCKED"] = "BLOCKED";
|
|
44
45
|
})(USER_STATUS || (exports.USER_STATUS = USER_STATUS = {}));
|
|
45
46
|
var INVENTORY_TYPE;
|
|
46
47
|
(function (INVENTORY_TYPE) {
|
|
@@ -274,6 +275,7 @@ var INSTITUTE_STATUS;
|
|
|
274
275
|
(function (INSTITUTE_STATUS) {
|
|
275
276
|
INSTITUTE_STATUS["ACTIVE"] = "ACTIVE";
|
|
276
277
|
INSTITUTE_STATUS["INACTIVE"] = "INACTIVE";
|
|
278
|
+
INSTITUTE_STATUS["BLOCK"] = "BLOCK";
|
|
277
279
|
})(INSTITUTE_STATUS || (exports.INSTITUTE_STATUS = INSTITUTE_STATUS = {}));
|
|
278
280
|
var OFFER_TYPE;
|
|
279
281
|
(function (OFFER_TYPE) {
|
|
@@ -2194,19 +2196,20 @@ var APK_TYPE;
|
|
|
2194
2196
|
APK_TYPE["STUDENT_DEMO"] = "STUDENT_DEMO";
|
|
2195
2197
|
APK_TYPE["PLAYGROUP_DEMO"] = "PLAYGROUP_DEMO";
|
|
2196
2198
|
})(APK_TYPE || (exports.APK_TYPE = APK_TYPE = {}));
|
|
2197
|
-
var
|
|
2198
|
-
(function (
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
})(
|
|
2202
|
-
var
|
|
2203
|
-
(function (
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2199
|
+
var CATEGORY_TYPE;
|
|
2200
|
+
(function (CATEGORY_TYPE) {
|
|
2201
|
+
CATEGORY_TYPE["INVENTORY"] = "INVENTORY";
|
|
2202
|
+
CATEGORY_TYPE["VENDOR"] = "VENDOR";
|
|
2203
|
+
})(CATEGORY_TYPE || (exports.CATEGORY_TYPE = CATEGORY_TYPE = {}));
|
|
2204
|
+
var AI_MODEL_KEYS;
|
|
2205
|
+
(function (AI_MODEL_KEYS) {
|
|
2206
|
+
AI_MODEL_KEYS["MASTER_PASSWORD"] = "MASTER_PASSWORD";
|
|
2207
|
+
})(AI_MODEL_KEYS || (exports.AI_MODEL_KEYS = AI_MODEL_KEYS = {}));
|
|
2208
|
+
var AI_MODEL_KEY_TYPES;
|
|
2209
|
+
(function (AI_MODEL_KEY_TYPES) {
|
|
2210
|
+
AI_MODEL_KEY_TYPES["STRING"] = "STRING";
|
|
2211
|
+
AI_MODEL_KEY_TYPES["NUMBER"] = "NUMBER";
|
|
2212
|
+
AI_MODEL_KEY_TYPES["BOOLEAN"] = "BOOLEAN";
|
|
2213
|
+
AI_MODEL_KEY_TYPES["ARRAY"] = "ARRAY";
|
|
2214
|
+
AI_MODEL_KEY_TYPES["OBJECT"] = "OBJECT";
|
|
2215
|
+
})(AI_MODEL_KEY_TYPES || (exports.AI_MODEL_KEY_TYPES = AI_MODEL_KEY_TYPES = {}));
|
|
@@ -1510,6 +1510,15 @@ export declare enum RMS_ERROR_MESSAGES {
|
|
|
1510
1510
|
APPROVE_SUBMITTED_ONLY = "Request must be submitted to be approved",
|
|
1511
1511
|
REJECT_SUBMITTED_ONLY = "Request must be submitted to be rejected"
|
|
1512
1512
|
}
|
|
1513
|
+
export declare enum MODULE_DOCS_ERROR_MESSAGES {
|
|
1514
|
+
NOT_FOUND = "Module document not found",
|
|
1515
|
+
MODULE_CODE_EXISTS = "Module code already exists",
|
|
1516
|
+
MODULE_NAME_EXISTS = "Module name already exists",
|
|
1517
|
+
FILE_NOT_FOUND = "File not found",
|
|
1518
|
+
FILE_STORAGE_NOT_FOUND = "File storage not found",
|
|
1519
|
+
INVALID_USER_TYPE = "Invalid user type",
|
|
1520
|
+
INVALID_APP_TYPE = "Invalid app type"
|
|
1521
|
+
}
|
|
1513
1522
|
export declare enum REFUND_ERROR_MESSAGE {
|
|
1514
1523
|
REFUND_ERROR = "If not received please contact with authorized person"
|
|
1515
1524
|
}
|
|
@@ -1586,3 +1595,11 @@ export declare enum VENDOR_COMPANY_META_ERROR_MESSAGES {
|
|
|
1586
1595
|
NOT_FOUND = "Unable to find Vendor company meta!",
|
|
1587
1596
|
CAN_NOT_LEFT = "Vendor cannot be removed as they hold certain responsibilities."
|
|
1588
1597
|
}
|
|
1598
|
+
export declare enum AI_MODEL_KEYS_ERROR_MESSAGES {
|
|
1599
|
+
NOT_FOUND = "AI model key not found",
|
|
1600
|
+
KEY_ALREADY_EXISTS = "AI model key already exists",
|
|
1601
|
+
INVALID_KEY = "Invalid AI model key",
|
|
1602
|
+
VALUE_REQUIRED = "AI model key value is required",
|
|
1603
|
+
UPDATE_FAILED = "Failed to update AI model key",
|
|
1604
|
+
INVALID_SECRET_KEY = "Invalid secret key"
|
|
1605
|
+
}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.FILE_STORAGE_ERROR_MESSAGES = exports.EXAM_HAS_ANSWER_SHEET_ERROR_MESSAGES = exports.EXAM_ERROR_MESSAGES = exports.ANNOUCEMENT_ERROR_MESSAGES = exports.PARENTS_ERROR_MESSAGES = exports.USER_INSTITUTE_META_ERROR_MESSAGES = exports.INSTITUTE_ENTITY_ERROR_MESSAGES = exports.INSTITUTE_ENTITY_TYPE_ERROR_MESSAGES = exports.INSTITUTE_ERROR_MESSAGES = exports.MODULE_ERROR_MESSAGES = exports.ROLE_ERROR_MESSAGES = exports.TYPE_MANAGEMENT_ERROR_MESSAGES = exports.CLASSROOM_ERROR_MESSAGES = exports.BATCH_ERROR_MESSAGES = exports.ACADEMIC_CALENDAR_ERROR_MESSAGES = exports.EVENT_ERROR_MESSAGES = exports.HOLIDAY_ERROR_MESSAGES = exports.USER_HAS_ROLL_NUMBER_ERROR_MESSAGES = exports.USER_HAS_OFFER_ERROR_MESSAGES = exports.FEE_REMINDER_ERROR_MESSAGES = exports.FEE_REMINDER_SETTING_ERROR_MESSAGES = exports.FEEREMINDER_ERROR_MESSAGES = exports.FEESCOLLECTION_ERROR_MESSAGES = exports.USER_FEE_TYPE_ERROR_MESSAGES = exports.SCHOOL_FEE_ERROR_MESSAGES = exports.FEE_TYPE_ERROR_MESSAGES = exports.FACILITY_ERROR_MESSAGES = exports.OFFER_ERROR_MESSAGES = exports.INVENTORY_HISTORY_ERROR_MESSAGES = exports.PAYMENT_TERMS_ERROR_MESSAGES = exports.INVENTORY_ERROR_MESSAGES = exports.CATEGORY_ERROR_MESSAGES = exports.USER_HAS_INVENTORY_ERROR_MESSAGES = exports.SUBJECT_HAS_FEE_ERROR_MESSAGES = exports.FEE_HISTORY_ERROR_MESSAGES = exports.MASTER_LEAVE_ERROR_MESSAGES = exports.LEAVE_ERROR_MESSAGES = exports.SUBSCRIPTION_ERROR_MESSAGES = exports.FEEDBACK_ERROR_MESSAGES = exports.SCHOOL_FEES_COLLECTION_ERROR_MESSAGES = exports.ACCOUNT_RECEIPT_ERROR_MESSAGES = exports.SCHOOL_SHIFT_ERROR_MESSAGES = exports.BANK_ACCOUNT_DETAILS_ERROR_MESSAGES = exports.INFORMATION_SUPPORT_ERROR_MESSAGES = exports.INQUIRY_ERROR_MESSAGES = exports.APPROVE_REQUEST_ERROR_MESSAGES = exports.BANNER_ERROR_MESSAGES = exports.USER_FEE_TYPE_ACCOUNT_ERROR_MESSAGES = exports.USER_ERROR_MESSAGES = exports.ERROR_MESSAGES = void 0;
|
|
4
4
|
exports.WALLET_ERROR_MESSAGES = exports.REPLACE_TEACHER_ERROR_MESSAGES = exports.CERTIFICATES_HISTORY_ERROR_MESSAGES = exports.CERTIFICATES_MANAGEMENT_ERROR_MESSAGES = exports.DASHBOARD_MANAGEMENT_ERROR_MESSAGES = exports.PDC_HISTORY_ERROR_MESSAGES = exports.COLUMN_ERROR_MESSAGES = exports.INVOICE_ERROR_MESSAGES = exports.PRODUCT_ERROR_MESSAGES = exports.SUB_CATEGORY_ERROR_MESSAGES = exports.VENDOR_MANAGEMENT_ERROR_MESSAGES = exports.COIN_PURCHASE_OFFER_ERROR_MESSAGES = exports.SYLLABUS_ERROR_MESSAGES = exports.DAILY_BOOK_ERROR_MESSAGES = exports.USER_HAS_HOME_WORK_ERROR_MESSAGES = exports.HOME_WORK_ERROR_MESSAGES = exports.CLOUD_STORAGE_ERROR_MESSAGES = exports.SUBSCRIPTION_PLAN_ERROR_MESSAGES = exports.FLOOR_MANAGEMENT_ERROR_MESSAGES = exports.SIGNED_URL_ERROR_MESSAGES = exports.CAREER_ERROR_MESSAGES = exports.RULES_REGULATION_ERROR_MESSAGES = exports.NOTIFICATION_ERROR_MESSAGES = exports.PHOTO_GALLERY_ERROR_MESSAGES = exports.CONTACT_FEED_BACK_ERROR_MESSAGES = exports.GENERATE_ID_CARD_ERROR_MESSAGES = exports.VEHICLE_ERROR_MESSAGES = exports.BATCH_SUBJECT_PROJECT_ASSESSMENT_ERROR_MESSAGES = exports.USER_BOOK_ASSESSMENT_ERROR_MESSAGES = exports.BATCH_SUBJECT_BOOK_ASSESSMENT_ERROR_MESSAGES = exports.TASK_MANAGEMENT_ERROR_MESSAGES = exports.EXAM_GROUP_ERROR_MESSAGES = exports.USER_PAYOUT_HISTORY_ERROR_MESSAGES = exports.USER_PAYOUT_ERROR_MESSAGES = exports.SUBJECT_INDEX_ERROR_MESSAGES = exports.TESTIMONIAL_ERROR_MESSAGES = exports.DRIVER_ERROR_MESSAGES = exports.BLOG_ERROR_MESSAGES = exports.VIDEO_ANALYST_ERROR_MESSAGES = exports.PDC_CHEQUE_ERROR_MESSAGES = exports.GREETING_ERROR_MESSAGES = exports.USER_HAS_COURSE_ERROR_MESSAGES = exports.COURSE_ERROR_MESSAGES = exports.TO_DO_ERROR_MESSAGES = exports.SLOT_ERROR_MESSAGES = exports.TRIP_ERROR_MESSAGES = exports.LECTURE_ERROR_MESSAGES = exports.WORKING_DAYS_ERROR_MESSAGES = exports.USER_SCHOOL_METADATA_ERROR_MESSAGES = exports.ATTENDANCE_ERROR_MESSAGES = void 0;
|
|
5
5
|
exports.POSTAL_DISPATCH_ERROR_MESSAGES = exports.CALL_REGISTER_ERROR_MESSAGES = exports.VISITOR_BOOK_ERROR_MESSAGES = exports.PDC_CHEQUE_CONFIGURATION_ERROR_MESSAGES = exports.MARK_SHEET_CONFIGURATION_ERROR_MESSAGES = exports.INTERNAL_MARK_ERROR_MESSAGES = exports.APP_ANALYTICS_EVENT_ERROR_MESSAGES = exports.GRANT_AND_DONATION_ERROR_MESSAGES = exports.TICKET_RAISE_ERROR_MESSAGES = exports.TERM_AND_CONDITION_ERROR_MESSAGES = exports.EDUCATION_OFFICER_ERROR_MESSAGES = exports.USER_HAS_PENALTY_ERROR_MESSAGES = exports.PENALTY_ERROR_MESSAGES = exports.CLASS_ROOM_COLLECTION_ERROR_MESSAGES = exports.CLASS_ROOM_EVENT_ERROR_MESSAGES = exports.INSTITUTE_FEE_ERROR_MESSAGES = exports.USER_DIRECTORY_ERROR_MESSAGES = exports.STUDENT_LEAVE_REQUEST_ERROR_MESSAGES = exports.EVENT_TEMPLATES_ERROR_MESSAGES = exports.POLL_SELECTION_ERROR_MESSAGES = exports.POLL_CREATE_ERROR_MESSAGES = exports.SHEET_FIELD_ERROR_MESSAGES = exports.CLONE_LIST_ERROR_MESSAGES = exports.COMPETITION_USER_ERROR_MESSAGES = exports.COMPETITION_GROUP_ERROR_MESSAGES = exports.COMPETITION_ERROR_MESSAGES = exports.CAMPUS_CARNIVAL_ERROR_MESSAGES = exports.INCOME_EXPENSE_ERROR_MESSAGES = exports.APPOINTMENT_HISTORY_ERROR_MESSAGES = exports.APPOINTMENT_ERROR_MESSAGES = exports.MAINTENANCE_ERROR_MESSAGES = exports.SEATING_ARRANGEMENT_ERROR_MESSAGES = exports.ASSIGN_FILE_ERROR_MESSAGES = exports.THEME_ERROR_MESSAGES = exports.B_DAY_WISH_ERROR_MESSAGES = exports.ADDITIONAL_DETAIL_ERROR_MESSAGES = exports.ADVERTISEMENT_ERROR_MESSAGES = exports.WORK_OFF_DAYS_ERROR_MESSAGES = exports.ENTITY_WISE_CALENDAR_ERROR_MESSAGES = exports.CAMPUS_ERROR_MESSAGES = exports.CANTEEN_ERROR_MESSAGES = exports.LOST_FOUND_ITEM_ERROR_MESSAGES = exports.PAYMENT_TRANSACTION_ERROR_MESSAGES = exports.USER_REQUIRED_STEPS_ERROR_MESSAGES = exports.JOB_APPLY_ERROR_MESSAGES = exports.ENTITY_GROUP_ERROR_MESSAGES = exports.USER_HAS_STORAGE_ERROR_MESSAGES = exports.INSTITUTE_SUBSCRIPTION_PLAN_ERROR_MESSAGES = exports.WALLET_TRANSACTION_ERROR_MESSAGES = exports.WALLET_HISTORY_ERROR_MESSAGES = void 0;
|
|
6
|
-
exports.VENDOR_COMPANY_META_ERROR_MESSAGES = exports.PRODUCT_META_ERROR_MESSAGES = exports.ACCOUNT_VOUCHER_TYPE_ERROR_MESSAGES = exports.ACCOUNT_COST_CENTER_ERROR_MESSAGES = exports.ACCOUNT_LEDGER_OPENING_ERROR_MESSAGES = exports.ACCOUNT_LEDGER_ERROR_MESSAGES = exports.ACCOUNT_GROUP_ERROR_MESSAGES = exports.ACCOUNT_NUMBER_SEQUENCE_ERROR_MESSAGES = exports.ACCOUNT_PERIOD_LOCK_ERROR_MESSAGES = exports.ACCOUNT_FINANCIAL_YEAR_ERROR_MESSAGES = exports.KIPIVERSE_CONTACT_FORM_ERROR_MESSAGES = exports.REFUND_ERROR_MESSAGE = exports.RMS_ERROR_MESSAGES = exports.ONLINE_LECTURE_ERROR_MESSAGES = exports.CERTIFICATE_REQUEST_ERROR_MESSAGES = exports.USER_HAS_FEE_SUBMISSION_ERROR_MESSAGES = exports.ASSIGN_SUBJECT_ERROR_MESSAGES = exports.FEE_SUBMISSION_ERROR_MESSAGES = exports.USER_HAS_PENALTY_HISTORY_ERROR_MESSAGES = exports.PAST_YEAR_RECORD_ERROR_MESSAGES = exports.NOTICEBOARD_ERROR_MESSAGES = exports.USER_HAS_PERMISSION_ERROR_MESSAGES = exports.ROLE_MANAGEMENT_ERROR_MESSAGES = exports.ROLE_HAS_PERMISSION_ERROR_MESSAGES = exports.PERMISSION_ERROR_MESSAGES = exports.COMMUNITY_MESSAGE_ERROR_MESSAGES = exports.GROUP_MEMBER_ERROR_MESSAGES = exports.COMMUNITY_GROUP_ERROR_MESSAGES = exports.DESIGNATION_ERROR_MESSAGES = exports.USER_HAS_OFFER_AND_DISCOUNT_ERROR_MESSAGES = exports.OFFER_AND_DISCOUNT_ERROR_MESSAGES = void 0;
|
|
6
|
+
exports.AI_MODEL_KEYS_ERROR_MESSAGES = exports.VENDOR_COMPANY_META_ERROR_MESSAGES = exports.PRODUCT_META_ERROR_MESSAGES = exports.ACCOUNT_VOUCHER_TYPE_ERROR_MESSAGES = exports.ACCOUNT_COST_CENTER_ERROR_MESSAGES = exports.ACCOUNT_LEDGER_OPENING_ERROR_MESSAGES = exports.ACCOUNT_LEDGER_ERROR_MESSAGES = exports.ACCOUNT_GROUP_ERROR_MESSAGES = exports.ACCOUNT_NUMBER_SEQUENCE_ERROR_MESSAGES = exports.ACCOUNT_PERIOD_LOCK_ERROR_MESSAGES = exports.ACCOUNT_FINANCIAL_YEAR_ERROR_MESSAGES = exports.KIPIVERSE_CONTACT_FORM_ERROR_MESSAGES = exports.REFUND_ERROR_MESSAGE = exports.MODULE_DOCS_ERROR_MESSAGES = exports.RMS_ERROR_MESSAGES = exports.ONLINE_LECTURE_ERROR_MESSAGES = exports.CERTIFICATE_REQUEST_ERROR_MESSAGES = exports.USER_HAS_FEE_SUBMISSION_ERROR_MESSAGES = exports.ASSIGN_SUBJECT_ERROR_MESSAGES = exports.FEE_SUBMISSION_ERROR_MESSAGES = exports.USER_HAS_PENALTY_HISTORY_ERROR_MESSAGES = exports.PAST_YEAR_RECORD_ERROR_MESSAGES = exports.NOTICEBOARD_ERROR_MESSAGES = exports.USER_HAS_PERMISSION_ERROR_MESSAGES = exports.ROLE_MANAGEMENT_ERROR_MESSAGES = exports.ROLE_HAS_PERMISSION_ERROR_MESSAGES = exports.PERMISSION_ERROR_MESSAGES = exports.COMMUNITY_MESSAGE_ERROR_MESSAGES = exports.GROUP_MEMBER_ERROR_MESSAGES = exports.COMMUNITY_GROUP_ERROR_MESSAGES = exports.DESIGNATION_ERROR_MESSAGES = exports.USER_HAS_OFFER_AND_DISCOUNT_ERROR_MESSAGES = exports.OFFER_AND_DISCOUNT_ERROR_MESSAGES = void 0;
|
|
7
7
|
var ERROR_MESSAGES;
|
|
8
8
|
(function (ERROR_MESSAGES) {
|
|
9
9
|
ERROR_MESSAGES["CREATE_FAIL"] = "Unable to save data in DB!";
|
|
@@ -1683,6 +1683,16 @@ var RMS_ERROR_MESSAGES;
|
|
|
1683
1683
|
RMS_ERROR_MESSAGES["APPROVE_SUBMITTED_ONLY"] = "Request must be submitted to be approved";
|
|
1684
1684
|
RMS_ERROR_MESSAGES["REJECT_SUBMITTED_ONLY"] = "Request must be submitted to be rejected";
|
|
1685
1685
|
})(RMS_ERROR_MESSAGES || (exports.RMS_ERROR_MESSAGES = RMS_ERROR_MESSAGES = {}));
|
|
1686
|
+
var MODULE_DOCS_ERROR_MESSAGES;
|
|
1687
|
+
(function (MODULE_DOCS_ERROR_MESSAGES) {
|
|
1688
|
+
MODULE_DOCS_ERROR_MESSAGES["NOT_FOUND"] = "Module document not found";
|
|
1689
|
+
MODULE_DOCS_ERROR_MESSAGES["MODULE_CODE_EXISTS"] = "Module code already exists";
|
|
1690
|
+
MODULE_DOCS_ERROR_MESSAGES["MODULE_NAME_EXISTS"] = "Module name already exists";
|
|
1691
|
+
MODULE_DOCS_ERROR_MESSAGES["FILE_NOT_FOUND"] = "File not found";
|
|
1692
|
+
MODULE_DOCS_ERROR_MESSAGES["FILE_STORAGE_NOT_FOUND"] = "File storage not found";
|
|
1693
|
+
MODULE_DOCS_ERROR_MESSAGES["INVALID_USER_TYPE"] = "Invalid user type";
|
|
1694
|
+
MODULE_DOCS_ERROR_MESSAGES["INVALID_APP_TYPE"] = "Invalid app type";
|
|
1695
|
+
})(MODULE_DOCS_ERROR_MESSAGES || (exports.MODULE_DOCS_ERROR_MESSAGES = MODULE_DOCS_ERROR_MESSAGES = {}));
|
|
1686
1696
|
var REFUND_ERROR_MESSAGE;
|
|
1687
1697
|
(function (REFUND_ERROR_MESSAGE) {
|
|
1688
1698
|
REFUND_ERROR_MESSAGE["REFUND_ERROR"] = "If not received please contact with authorized person";
|
|
@@ -1771,3 +1781,12 @@ var VENDOR_COMPANY_META_ERROR_MESSAGES;
|
|
|
1771
1781
|
VENDOR_COMPANY_META_ERROR_MESSAGES["NOT_FOUND"] = "Unable to find Vendor company meta!";
|
|
1772
1782
|
VENDOR_COMPANY_META_ERROR_MESSAGES["CAN_NOT_LEFT"] = "Vendor cannot be removed as they hold certain responsibilities.";
|
|
1773
1783
|
})(VENDOR_COMPANY_META_ERROR_MESSAGES || (exports.VENDOR_COMPANY_META_ERROR_MESSAGES = VENDOR_COMPANY_META_ERROR_MESSAGES = {}));
|
|
1784
|
+
var AI_MODEL_KEYS_ERROR_MESSAGES;
|
|
1785
|
+
(function (AI_MODEL_KEYS_ERROR_MESSAGES) {
|
|
1786
|
+
AI_MODEL_KEYS_ERROR_MESSAGES["NOT_FOUND"] = "AI model key not found";
|
|
1787
|
+
AI_MODEL_KEYS_ERROR_MESSAGES["KEY_ALREADY_EXISTS"] = "AI model key already exists";
|
|
1788
|
+
AI_MODEL_KEYS_ERROR_MESSAGES["INVALID_KEY"] = "Invalid AI model key";
|
|
1789
|
+
AI_MODEL_KEYS_ERROR_MESSAGES["VALUE_REQUIRED"] = "AI model key value is required";
|
|
1790
|
+
AI_MODEL_KEYS_ERROR_MESSAGES["UPDATE_FAILED"] = "Failed to update AI model key";
|
|
1791
|
+
AI_MODEL_KEYS_ERROR_MESSAGES["INVALID_SECRET_KEY"] = "Invalid secret key";
|
|
1792
|
+
})(AI_MODEL_KEYS_ERROR_MESSAGES || (exports.AI_MODEL_KEYS_ERROR_MESSAGES = AI_MODEL_KEYS_ERROR_MESSAGES = {}));
|
|
@@ -1094,6 +1094,13 @@ export declare enum RMS_SUCCESS_MESSAGES {
|
|
|
1094
1094
|
PURCHASE_REQUEST_APPROVED = "Purchase request approved successfully",
|
|
1095
1095
|
PURCHASE_REQUEST_REJECTED = "Purchase request rejected successfully"
|
|
1096
1096
|
}
|
|
1097
|
+
export declare enum MODULE_DOCS_SUCCESS_MESSAGES {
|
|
1098
|
+
CREATE_SUCCESS = "Module document created successfully",
|
|
1099
|
+
UPDATE_SUCCESS = "Module document updated successfully",
|
|
1100
|
+
DELETE_SUCCESS = "Module document deleted successfully",
|
|
1101
|
+
GET_SUCCESS = "Module document fetched successfully",
|
|
1102
|
+
GET_ALL_SUCCESS = "Module documents fetched successfully"
|
|
1103
|
+
}
|
|
1097
1104
|
export declare enum REFUND_SUCCESS_MESSAGES {
|
|
1098
1105
|
REFUND_SUCCESS = "Refund has been initiated",
|
|
1099
1106
|
REFUND_PENDING = "Refund is in progress",
|
|
@@ -1171,3 +1178,10 @@ export declare enum VENDOR_COMPANY_META_SUCCESS_MESSAGES {
|
|
|
1171
1178
|
LEFT_SUCCESS = "Vendor has left the company successfully",
|
|
1172
1179
|
SEND_EMAIL_SUCCESS = "Email sent successfully"
|
|
1173
1180
|
}
|
|
1181
|
+
export declare enum AI_MODEL_KEYS_SUCCESS_MESSAGES {
|
|
1182
|
+
CREATE_SUCCESS = "AI model key created successfully",
|
|
1183
|
+
UPDATE_SUCCESS = "AI model key updated successfully",
|
|
1184
|
+
DELETE_SUCCESS = "AI model key deleted successfully",
|
|
1185
|
+
GET_SUCCESS = "AI model key fetched successfully",
|
|
1186
|
+
GET_ALL_SUCCESS = "AI model keys fetched successfully"
|
|
1187
|
+
}
|