tango-app-api-client 3.0.22-dev → 3.0.24-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/app.js +41 -0
- package/package.json +4 -4
- package/src/dtos/client.dtos.js +8 -3
package/app.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
|
|
2
|
+
import express from 'express';
|
|
3
|
+
import { clientRouter } from './index.js';
|
|
4
|
+
|
|
5
|
+
import dotenv from 'dotenv';
|
|
6
|
+
import { logger } from 'tango-app-api-middleware';
|
|
7
|
+
import { connectdb } from './config/database/database.js';
|
|
8
|
+
import responseMiddleware from './config/response/response.js';
|
|
9
|
+
import errorMiddleware from './config/response/error.js';
|
|
10
|
+
import pkg from 'body-parser';
|
|
11
|
+
import swagger from 'swagger-ui-express';
|
|
12
|
+
import { swaggerConfig } from './config/swagger/swagger.js';
|
|
13
|
+
const { json, urlencoded } = pkg;
|
|
14
|
+
|
|
15
|
+
const env=dotenv.config();
|
|
16
|
+
|
|
17
|
+
const app = express();
|
|
18
|
+
const PORT = process.env.PORT || 3000;
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
if ( env.error ) {
|
|
22
|
+
logger.error( '.env not found' );
|
|
23
|
+
process.exit( 1 );
|
|
24
|
+
}
|
|
25
|
+
app.use( json( { limit: '500mb' } ) );
|
|
26
|
+
app.use(
|
|
27
|
+
urlencoded( {
|
|
28
|
+
extended: true,
|
|
29
|
+
} ),
|
|
30
|
+
);
|
|
31
|
+
app.use( responseMiddleware );
|
|
32
|
+
app.use( errorMiddleware );
|
|
33
|
+
|
|
34
|
+
app.use( '/api-docs', swagger.serve, swagger.setup( swaggerConfig ) );
|
|
35
|
+
app.use( '/v3/client', clientRouter );
|
|
36
|
+
|
|
37
|
+
app.listen( PORT, () => {
|
|
38
|
+
logger.info( `server is running on port= ${PORT} ` );
|
|
39
|
+
connectdb();
|
|
40
|
+
} );
|
|
41
|
+
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tango-app-api-client",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.24-dev",
|
|
4
4
|
"description": "client",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "app.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"start": "nodemon --exec \"eslint --fix . && node
|
|
8
|
+
"start": "nodemon --exec \"eslint --fix . && node app.js\""
|
|
9
9
|
},
|
|
10
10
|
"engines": {
|
|
11
11
|
"node": ">=18.10.0"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"mongodb": "^6.3.0",
|
|
26
26
|
"nodemon": "^3.0.3",
|
|
27
27
|
"swagger-ui-express": "^5.0.0",
|
|
28
|
-
"tango-api-schema": "^2.0.
|
|
28
|
+
"tango-api-schema": "^2.0.67",
|
|
29
29
|
"tango-app-api-middleware": "^1.0.53-dev",
|
|
30
30
|
"winston": "^3.11.0",
|
|
31
31
|
"winston-daily-rotate-file": "^5.0.0"
|
package/src/dtos/client.dtos.js
CHANGED
|
@@ -33,7 +33,7 @@ export const billingDetailsSchemaBody = joi.object( {
|
|
|
33
33
|
tradeName: joi.string().optional(),
|
|
34
34
|
gstNumber: joi.string().optional(),
|
|
35
35
|
authorityName: joi.string().optional(),
|
|
36
|
-
authorityEmail: joi.string().optional(),
|
|
36
|
+
authorityEmail: joi.string().email().optional(),
|
|
37
37
|
billingAddress: joi.string().optional(),
|
|
38
38
|
gstCertificate: joi.string().optional().allow( '' ),
|
|
39
39
|
} );
|
|
@@ -50,7 +50,10 @@ export const billingDetailsValid = {
|
|
|
50
50
|
export const signatoryDetailsSchemaBody = joi.object( {
|
|
51
51
|
name: joi.string().optional(),
|
|
52
52
|
email: joi.string().email().optional(),
|
|
53
|
-
number: joi.string()
|
|
53
|
+
number: joi.string()
|
|
54
|
+
.pattern( /^\d{4,12}$/ )
|
|
55
|
+
.message( 'Enter a valid mobile number' )
|
|
56
|
+
.optional(),
|
|
54
57
|
designation: joi.string().optional(),
|
|
55
58
|
} );
|
|
56
59
|
|
|
@@ -119,7 +122,9 @@ export const featureConfigurationValid = {
|
|
|
119
122
|
|
|
120
123
|
export const domainDetailsSchemaBody = joi.object(
|
|
121
124
|
{
|
|
122
|
-
domainName: joi.array().items( joi.string()
|
|
125
|
+
domainName: joi.array().items( joi.string()
|
|
126
|
+
.pattern( /\..*/ )
|
|
127
|
+
.message( 'Enter a valid domain' ) ).optional(),
|
|
123
128
|
isEnable: joi.boolean().optional(),
|
|
124
129
|
},
|
|
125
130
|
);
|