tango-app-api-trax 1.0.0-alpha.98 → 1.0.0-task.118

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.
@@ -1,24 +1,24 @@
1
1
  import express from 'express';
2
- import { isAllowedSessionHandler, validate, accessVerification } from 'tango-app-api-middleware';
2
+ import { isAllowedSessionHandler, validate, accessVerification, isAllowedClient } from 'tango-app-api-middleware';
3
3
  import { checklistValidation, checklistDetailsValidation, runaiValidation, checklistPageSchema, duplicateValidation, updateChecklistValidation, uploadUserValidation, aichecklistValidation, publishValidation } from '../dtos/validation.dtos.js';
4
4
  import * as traxController from '../controllers/trax.controller.js';
5
5
 
6
6
  export const traxRouter = express.Router();
7
7
 
8
8
  traxRouter
9
- .get( '/checklist', isAllowedSessionHandler, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ), validate( checklistPageSchema ), traxController.checklist )
10
- .post( '/checklist/create', isAllowedSessionHandler, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isAdd' ] } ] } ), validate( checklistValidation ), traxController.create )
11
- .get( '/getConfigDetails', isAllowedSessionHandler, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ), validate( checklistDetailsValidation ), traxController.getConfigDetails )
12
- .post( '/upload', isAllowedSessionHandler, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isEdit' ] } ] } ), traxController.uploadImage )
13
- .post( '/runAIInsert', isAllowedSessionHandler, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isEdit' ] } ] } ), validate( runaiValidation ), traxController.runAIInsert )
14
- .get( '/duplicateChecklist/:checklistId', isAllowedSessionHandler, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isEdit' ] } ] } ), validate( duplicateValidation ), traxController.duplicateChecklist )
15
- .put( '/checklist/update/:checklistId', isAllowedSessionHandler, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isEdit' ] } ] } ), validate( updateChecklistValidation ), traxController.update )
16
- .post( '/validateUser', isAllowedSessionHandler, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isEdit' ] } ] } ), validate( uploadUserValidation ), traxController.validateUser )
17
- .get( '/userDetails/:checklistId', isAllowedSessionHandler, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ), validate( duplicateValidation ), traxController.assignedUserDetails )
18
- .post( '/checklistConfigure', isAllowedSessionHandler, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isEdit' ] } ] } ), traxController.updateConfigure )
19
- .delete( '/deleteChecklist/:checklistId', isAllowedSessionHandler, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isEdit' ] } ] } ), validate( duplicateValidation ), traxController.deleteChecklist )
20
- .put( '/publish', isAllowedSessionHandler, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isEdit' ] } ] } ), validate( publishValidation ), traxController.updatePublish )
21
- .get( '/userList', isAllowedSessionHandler, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ), traxController.userlist )
22
- .get( '/zoneList', isAllowedSessionHandler, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ), traxController.zoneList )
23
- .get( '/aichecklist', isAllowedSessionHandler, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ), validate( aichecklistValidation ), traxController.aiChecklist )
24
- .get( '/predefinedChecklist', isAllowedSessionHandler, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ), validate( aichecklistValidation ), traxController.preDefinedChecklist );
9
+ .get( '/checklist', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ), validate( checklistPageSchema ), traxController.checklist )
10
+ .post( '/checklist/create', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isAdd' ] } ] } ), validate( checklistValidation ), traxController.create )
11
+ .get( '/getConfigDetails', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ), validate( checklistDetailsValidation ), traxController.getConfigDetails )
12
+ .post( '/upload', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isEdit' ] } ] } ), traxController.uploadImage )
13
+ .post( '/runAIInsert', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isEdit' ] } ] } ), validate( runaiValidation ), traxController.runAIInsert )
14
+ .get( '/duplicateChecklist/:checklistId', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isEdit' ] } ] } ), validate( duplicateValidation ), traxController.duplicateChecklist )
15
+ .put( '/checklist/update/:checklistId', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isEdit' ] } ] } ), validate( updateChecklistValidation ), traxController.update )
16
+ .post( '/validateUser', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isEdit' ] } ] } ), validate( uploadUserValidation ), traxController.validateUser )
17
+ .get( '/userDetails/:checklistId', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ), validate( duplicateValidation ), traxController.assignedUserDetails )
18
+ .post( '/checklistConfigure', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isEdit' ] } ] } ), traxController.updateConfigure )
19
+ .delete( '/deleteChecklist/:checklistId', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isEdit' ] } ] } ), validate( duplicateValidation ), traxController.deleteChecklist )
20
+ .put( '/publish', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isEdit' ] } ] } ), validate( publishValidation ), traxController.updatePublish )
21
+ .get( '/userList', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ), traxController.userlist )
22
+ .get( '/zoneList', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ), traxController.zoneList )
23
+ .get( '/aichecklist', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ), validate( aichecklistValidation ), traxController.aiChecklist )
24
+ .get( '/predefinedChecklist', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ), validate( aichecklistValidation ), traxController.preDefinedChecklist );
@@ -0,0 +1,32 @@
1
+ import model from 'tango-api-schema';
2
+
3
+ export const find = async ( query = {}, field={} ) => {
4
+ return model.taskProcessedConfigModel.find( query, field );
5
+ };
6
+
7
+ export const findOne = async ( query = {}, field={} ) => {
8
+ return model.taskProcessedConfigModel.findOne( query, field );
9
+ };
10
+
11
+ export const updateMany = async ( query = {}, record={} ) => {
12
+ return model.taskProcessedConfigModel.updateMany( query, { $set: record } );
13
+ };
14
+ export const updateOne = async ( query = {}, record={} ) => {
15
+ return model.taskProcessedConfigModel.updateOne( query, { $set: record } );
16
+ };
17
+
18
+ export const insertMany = async ( data = [] ) => {
19
+ return model.taskProcessedConfigModel.insertMany( data );
20
+ };
21
+
22
+ export const deleteMany = async ( query = [] ) => {
23
+ return model.taskProcessedConfigModel.deleteMany( query );
24
+ };
25
+
26
+ export const aggregate = async ( query = [] ) => {
27
+ return model.taskProcessedConfigModel.aggregate( query );
28
+ };
29
+
30
+ export const insert = async ( data = [] ) => {
31
+ return model.taskProcessedConfigModel.create( data );
32
+ };
@@ -0,0 +1,30 @@
1
+ import model from 'tango-api-schema';
2
+
3
+ export const find = async ( query = {}, field={} ) => {
4
+ return model.taskProcessedModel.find( query, field );
5
+ };
6
+
7
+ export const findOne = async ( query = {}, field={} ) => {
8
+ return model.taskProcessedModel.findOne( query, field );
9
+ };
10
+
11
+ export const updateMany = async ( query = {}, record={} ) => {
12
+ return model.taskProcessedModel.updateMany( query, { $set: record } );
13
+ };
14
+
15
+ export const insertMany = async ( data = [] ) => {
16
+ return model.taskProcessedModel.insertMany( data );
17
+ };
18
+
19
+ export const deleteMany = async ( query = [] ) => {
20
+ return model.taskProcessedModel.deleteMany( query );
21
+ };
22
+
23
+ export const aggregate = async ( query = [] ) => {
24
+ return model.taskProcessedModel.aggregate( query );
25
+ };
26
+
27
+ export const updateOne = ( query = {}, record = {} ) => {
28
+ return model.taskProcessedModel.updateOne( query, { $set: record } );
29
+ };
30
+