tango-app-api-trax 3.4.1-alpha-19 → 3.4.1-alpha-0
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/package.json +3 -3
- package/src/controllers/download.controller.js +117 -3
- package/src/controllers/internalTrax.controller.js +114 -6
- package/src/controllers/mobileTrax.controller.js +30 -931
- package/src/controllers/teaxFlag.controller.js +467 -2
- package/src/controllers/trax.controller.js +294 -155
- package/src/controllers/traxDashboard.controllers.js +1 -2
- package/src/dtos/downloadValidation.dtos.js +1 -1
- package/src/routes/download.router.js +4 -0
- package/src/routes/internalTraxApi.router.js +3 -1
- package/src/routes/mobileTrax.routes.js +0 -3
- package/src/routes/trax.routes.js +5 -3
- package/src/routes/traxFlag.router.js +13 -1
- package/src/services/processedchecklistconfig.services.js +1 -1
|
@@ -3809,8 +3809,7 @@ export async function sendAlert( req, res ) {
|
|
|
3809
3809
|
}
|
|
3810
3810
|
const fcmToken = item.token;
|
|
3811
3811
|
try {
|
|
3812
|
-
|
|
3813
|
-
console.log( response, 'response' );
|
|
3812
|
+
await sendPushNotification( title, description, fcmToken );
|
|
3814
3813
|
} catch ( e ) {
|
|
3815
3814
|
logger.error( { message: 'send alert', error: e, details: data } );
|
|
3816
3815
|
}
|
|
@@ -25,7 +25,7 @@ export const validateDownloadInsertSchema = joi.object( {
|
|
|
25
25
|
insertType: joi.string().optional().allow( '' ),
|
|
26
26
|
filter: joi.string().optional().allow( '' ),
|
|
27
27
|
filtertype: joi.string().optional().allow( '' ),
|
|
28
|
-
|
|
28
|
+
checkListType: joi.string().required(),
|
|
29
29
|
} );
|
|
30
30
|
|
|
31
31
|
export const validateDownloadInsertParams = {
|
|
@@ -11,13 +11,17 @@ import {
|
|
|
11
11
|
getChecklistFromZipId,
|
|
12
12
|
getPDFCSVChecklistDetails,
|
|
13
13
|
cancelDownload,
|
|
14
|
+
downloadInsertAI,
|
|
15
|
+
getAiChecklistDataFromZipId,
|
|
14
16
|
} from '../controllers/download.controller.js';
|
|
15
17
|
|
|
16
18
|
downloadRouter
|
|
17
19
|
.post( '/downloadInsert', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [] } ] } ), validate( downloadValidationDtos.validateDownloadInsertParams ), downloadInsert )
|
|
20
|
+
.post( '/downloadInsertAI', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [] } ] } ), validate( downloadValidationDtos.validateDownloadInsertParams ), downloadInsertAI )
|
|
18
21
|
.post( '/downloadList', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [] } ] } ), validate( downloadValidationDtos.validateDownloadListParams ), downloadList )
|
|
19
22
|
.post( '/downloadUpdate', downloadUpdate ) // isAllowedInternalAPIHandler,
|
|
20
23
|
.get( '/getChecklistFromZipId', getChecklistFromZipId ) // isAllowedInternalAPIHandler,
|
|
24
|
+
.get( '/getAiChecklistDataFromZipId', getAiChecklistDataFromZipId ) // isAllowedInternalAPIHandler,
|
|
21
25
|
.post( '/getChecklistDetails', getPDFCSVChecklistDetails )
|
|
22
26
|
.put( '/cancelDownload/:id', isAllowedSessionHandler, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [] } ] } ), cancelDownload );
|
|
23
27
|
|
|
@@ -16,10 +16,12 @@ internalTraxRouter
|
|
|
16
16
|
.get( '/profile', isAllowedMobileSessionHandler, internalController.getUserStoreList )
|
|
17
17
|
.post( '/pushNotification', isAllowedInternalAPIHandler, internalController.pushNotification )
|
|
18
18
|
.post( '/taskPushNotification', isAllowedInternalAPIHandler, internalController.taskPushNotification )
|
|
19
|
+
.post( '/AiPushNotificationAlert', isAllowedInternalAPIHandler, internalController.AiPushNotificationAlert )
|
|
19
20
|
.get( '/checklist', isAllowedInternalAPIHandler, internalController.internalAPIChecklist )
|
|
20
21
|
.post( '/getPDFCSVChecklistDetails', isAllowedInternalAPIHandler, internalController.getPDFCSVChecklistDetails )
|
|
21
22
|
.get( '/getOTP', isAllowedInternalAPIHandler, internalController.getOTP )
|
|
22
23
|
.get( '/getDownloads', isAllowedInternalAPIHandler, internalController.getDownloads )
|
|
23
|
-
.post( '/sendPushNotification', isAllowedInternalAPIHandler, internalController.internalSendPushNotification )
|
|
24
|
+
.post( '/sendPushNotification', isAllowedInternalAPIHandler, internalController.internalSendPushNotification )
|
|
25
|
+
.post( '/sendAiPushNotification', isAllowedInternalAPIHandler, internalController.internalAISendPushNotification );
|
|
24
26
|
|
|
25
27
|
|
|
@@ -9,18 +9,15 @@ mobileRouter
|
|
|
9
9
|
.get( '/storeList', isAllowedSessionHandler, mobileController.storeList )
|
|
10
10
|
.get( '/storeListv1', isAllowedSessionHandler, mobileController.storeListv1 )
|
|
11
11
|
.post( '/startCheckList', isAllowedSessionHandler, validate( startValidation ), mobileController.startChecklist )
|
|
12
|
-
.post( '/startCheckListv1', isAllowedSessionHandler, validate( startValidation ), mobileController.startChecklistv1 )
|
|
13
12
|
.post( '/startTask', isAllowedSessionHandler, validate( startValidation ), mobileController.startTask )
|
|
14
13
|
.post( '/submitCheckList', isAllowedSessionHandler, mobileController.sopMobilechecklistValidater, mobileController.sopMobilechecklistQuestionValidator, mobileController.sopMobilechecklistMultiSectionFormatter, mobileController.submitChecklist )
|
|
15
14
|
.post( '/submitCheckListv5', isAllowedSessionHandler, mobileController.sopMobilechecklistValidater, mobileController.sopMobilechecklistQuestionValidatorv1, mobileController.sopMobilechecklistMultiSectionFormatterv1, mobileController.submitChecklist )
|
|
16
|
-
.post( '/submitCheckListv6', isAllowedSessionHandler, mobileController.sopMobilechecklistValidater, mobileController.sopMobilechecklistQuestionValidatorv1, mobileController.sopMobilechecklistMultiSectionFormatterv2, mobileController.submitChecklist )
|
|
17
15
|
.post( '/submitTask', isAllowedSessionHandler, mobileController.sopMobilechecklistValidater, mobileController.sopMobileTaskQuestionValidator, mobileController.sopMobileTaskMultiSectionFormatter, mobileController.submitTask )
|
|
18
16
|
.get( '/dashboard', isAllowedSessionHandler, validate( dashboardValidation ), mobileController.dashboard )
|
|
19
17
|
.get( '/dashboardv1', isAllowedSessionHandler, validate( dashboardValidation ), mobileController.dashboardv1 )
|
|
20
18
|
.get( '/checklist', isAllowedSessionHandler, validate( mobileChecklistValidation ), mobileController.checklist )
|
|
21
19
|
.get( '/checklistv1', isAllowedSessionHandler, validate( mobileChecklistValidation ), mobileController.checklistv1 )
|
|
22
20
|
.get( '/checklistQuestionList', isAllowedSessionHandler, mobileController.questionList )
|
|
23
|
-
.get( '/checklistQuestionListv1', isAllowedSessionHandler, mobileController.questionListv1 )
|
|
24
21
|
.get( '/taskQuestionList', isAllowedSessionHandler, mobileController.taskQuestionList )
|
|
25
22
|
.post( '/uploadAnswerImage', isAllowedSessionHandler, mobileController.uploadAnswerImage )
|
|
26
23
|
.get( '/appVersion', mobileController.appVersion )
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
|
-
import { isAllowedSessionHandler, validate, accessVerification, isAllowedClient
|
|
2
|
+
import { isAllowedSessionHandler, validate, accessVerification, isAllowedClient } from 'tango-app-api-middleware';
|
|
3
3
|
import { checklistValidation, checklistDetailsValidation, runaiValidation, checklistPageSchema, duplicateValidation, updateChecklistValidation, uploadUserValidation, aichecklistValidation, publishValidation, selectAssign } from '../dtos/validation.dtos.js';
|
|
4
4
|
import * as traxController from '../controllers/trax.controller.js';
|
|
5
5
|
|
|
@@ -25,10 +25,12 @@ traxRouter
|
|
|
25
25
|
.get( '/zoneList', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ), traxController.zoneList )
|
|
26
26
|
.get( '/aichecklist', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ), validate( aichecklistValidation ), traxController.aiChecklist )
|
|
27
27
|
.get( '/predefinedChecklist', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ), validate( aichecklistValidation ), traxController.preDefinedChecklist )
|
|
28
|
-
.post( '/selectAssign',
|
|
28
|
+
.post( '/selectAssign', validate( selectAssign ), traxController.selectAssign )
|
|
29
29
|
.post( '/assign', isAllowedSessionHandler, traxController.checklistAssign )
|
|
30
30
|
// .post( '/assignUpload', isAllowedSessionHandler, traxController.assignChecklistUser )
|
|
31
|
-
.post( '/updateAssign', isAllowedSessionHandler, traxController.updateAssign )
|
|
31
|
+
.post( '/updateAssign', isAllowedSessionHandler, traxController.updateAssign )
|
|
32
|
+
.post( '/updateAiConfigure', isAllowedSessionHandler, traxController.updateAiConfigure )
|
|
33
|
+
.get( '/getAiDetails', isAllowedSessionHandler, traxController.getAiDetails );
|
|
32
34
|
;
|
|
33
35
|
|
|
34
36
|
// isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ),
|
|
@@ -18,6 +18,9 @@ import {
|
|
|
18
18
|
flagComparisonCardsV1,
|
|
19
19
|
flagTablesV1,
|
|
20
20
|
checklistDropdownV1,
|
|
21
|
+
flagTablesV2,
|
|
22
|
+
flagComparisonCardsV2,
|
|
23
|
+
checklistCountByType,
|
|
21
24
|
} from '../controllers/teaxFlag.controller.js';
|
|
22
25
|
import { isAllowedSessionHandler } from 'tango-app-api-middleware';
|
|
23
26
|
import { accessVerification } from 'tango-app-api-middleware';
|
|
@@ -68,7 +71,16 @@ traxFlagRouter
|
|
|
68
71
|
flagComparisonCardsV1 )
|
|
69
72
|
.post( '/flagTablesV1', isAllowedSessionHandler,
|
|
70
73
|
accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [] } ] } ),
|
|
71
|
-
flagTablesV1 )
|
|
74
|
+
flagTablesV1 )
|
|
75
|
+
.post( '/flagComparisonCardsV2', isAllowedSessionHandler,
|
|
76
|
+
accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [] } ] } ),
|
|
77
|
+
flagComparisonCardsV2 )
|
|
78
|
+
.post( '/flagTablesV2', isAllowedSessionHandler,
|
|
79
|
+
accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [] } ] } ),
|
|
80
|
+
flagTablesV2 )
|
|
81
|
+
.post( '/checklistCountByType', isAllowedSessionHandler,
|
|
82
|
+
accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [] } ] } ),
|
|
83
|
+
checklistCountByType );
|
|
72
84
|
|
|
73
85
|
|
|
74
86
|
export default traxFlagRouter;
|
|
@@ -9,7 +9,7 @@ export const findOne = ( query = {}, record = {} ) => {
|
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export const updateOne = ( query = {}, record = {} ) => {
|
|
12
|
-
return model.processedchecklistconfigModel.updateOne( query, { $set: record } );
|
|
12
|
+
return model.processedchecklistconfigModel.updateOne( query, { $set: record }, { upsert: true } );
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
export const updateMany = ( query = {}, record = {} ) => {
|