tango-app-api-client 3.0.35-dev → 3.0.36-dev
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tango-app-api-client",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.36-dev",
|
|
4
4
|
"description": "client",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"nodemon": "^3.0.3",
|
|
27
27
|
"swagger-ui-express": "^5.0.0",
|
|
28
28
|
"tango-api-schema": "^2.0.89",
|
|
29
|
-
"tango-app-api-middleware": "^1.0.
|
|
29
|
+
"tango-app-api-middleware": "^1.0.60-dev",
|
|
30
30
|
"winston": "^3.11.0",
|
|
31
31
|
"winston-daily-rotate-file": "^5.0.0"
|
|
32
32
|
},
|
|
@@ -1258,7 +1258,7 @@ export async function detailedClientCount( req, res ) {
|
|
|
1258
1258
|
role: req?.user?.role,
|
|
1259
1259
|
};
|
|
1260
1260
|
result['totalStoreCount'] = await countDocumentsStore( { clientId: inputData.clientId } );
|
|
1261
|
-
result['totalGroupCount'] = await countDocumentsGroup( { clientId: inputData.clientId } );
|
|
1261
|
+
result['totalGroupCount'] = await countDocumentsGroup( { clientId: inputData.clientId, isActive: true } );
|
|
1262
1262
|
result['totalCameraCount'] = await countDocumentsCamera( { clientId: inputData.clientId } );
|
|
1263
1263
|
result['totalUserCount'] = await countDocumentsUser( { clientId: inputData.clientId, userType: 'client' } );
|
|
1264
1264
|
|
|
@@ -2,7 +2,7 @@ import clientModel from 'tango-api-schema/schema/client.model.js';
|
|
|
2
2
|
import leadModel from 'tango-api-schema/schema/lead.model.js';
|
|
3
3
|
import storeModel from 'tango-api-schema/schema/store.model.js';
|
|
4
4
|
import userModel from 'tango-api-schema/schema/user.model.js';
|
|
5
|
-
|
|
5
|
+
import { createQueue, getQueueUrl, appConfig, logger } from 'tango-app-api-middleware';
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
export function update( query, record ) {
|
|
@@ -27,20 +27,20 @@ export function findClient( query, field ) {
|
|
|
27
27
|
|
|
28
28
|
export async function createAuditQueue( queueName ) {
|
|
29
29
|
try {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
30
|
+
const isExist = await getQueueUrl( `${queueName}${appConfig.cloud.aws.sqs.queueType}` );
|
|
31
|
+
if ( isExist.statusCode ) {
|
|
32
|
+
const addQueue = await createQueue( `${queueName}${appConfig.cloud.aws.sqs.queueType}` );
|
|
33
|
+
if ( addQueue.QueueUrl ) {
|
|
34
|
+
logger.info(
|
|
35
|
+
'Queueue Created'
|
|
36
|
+
, { queueName: addQueue.QueueUrl, addQueue },
|
|
37
|
+
);
|
|
38
|
+
} else {
|
|
39
|
+
logger.error( { error: 'Queue creation failed', function: 'createAuditQueue' } );
|
|
40
|
+
}
|
|
41
|
+
} else {
|
|
42
|
+
logger.error( { error: 'Queue already exisit', message: queueName, function: 'createAuditQueue' } );
|
|
43
|
+
}
|
|
44
44
|
return true;
|
|
45
45
|
} catch ( error ) {
|
|
46
46
|
logger.error( { error: error, message: queueName, function: 'createAuditQueue' } );
|