-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
100 lines (91 loc) · 2.48 KB
/
Copy pathindex.js
File metadata and controls
100 lines (91 loc) · 2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/**
* Configuration file for the Xero Accounting & CFO Assistant Agent
*/
module.exports = {
// Application settings
app: {
name: 'Xero CFO Assistant Agent',
version: '1.0.0',
environment: process.env.NODE_ENV || 'development',
port: process.env.PORT || 3000,
apiPrefix: '/api'
},
// JWT configuration
jwt: {
secret: process.env.JWT_SECRET || 'your-jwt-secret-key-change-in-production',
expiresIn: process.env.JWT_EXPIRES_IN || '1h',
refreshExpiresIn: process.env.JWT_REFRESH_EXPIRES_IN || '7d'
},
// Database configuration
database: {
development: {
dialect: 'sqlite',
storage: './database.sqlite',
logging: console.log
},
test: {
dialect: 'sqlite',
storage: ':memory:',
logging: false
},
production: {
dialect: 'postgres',
host: process.env.DB_HOST,
port: process.env.DB_PORT,
username: process.env.DB_USERNAME,
password: process.env.DB_PASSWORD,
database: process.env.DB_NAME,
dialectOptions: {
ssl: {
require: true,
rejectUnauthorized: false
}
},
logging: false
}
},
// Xero API configuration
xero: {
clientId: process.env.XERO_CLIENT_ID,
clientSecret: process.env.XERO_CLIENT_SECRET,
redirectUri: process.env.XERO_REDIRECT_URI,
scopes: 'openid profile email accounting.transactions accounting.settings accounting.contacts accounting.attachments offline_access',
},
// Encryption configuration for sensitive data
encryption: {
key: process.env.ENCRYPTION_KEY || 'your-encryption-key-change-in-production',
algorithm: 'aes-256-cbc'
},
// Logging configuration
logging: {
level: process.env.LOG_LEVEL || 'info',
format: winston.format.combine(
winston.format.timestamp(),
winston.format.json()
),
transports: [
new winston.transports.Console({
format: winston.format.combine(
winston.format.colorize(),
winston.format.simple()
)
})
]
},
// CORS configuration
cors: {
origin: process.env.CORS_ORIGIN || '*',
methods: ['GET', 'POST', 'PUT', 'DELETE'],
allowedHeaders: ['Content-Type', 'Authorization']
},
// Rate limiting configuration
rateLimit: {
windowMs: 15 * 60 * 1000, // 15 minutes
max: 100 // limit each IP to 100 requests per windowMs
},
// n8n integration configuration
n8n: {
webhookUrl: process.env.N8N_WEBHOOK_URL,
apiKey: process.env.N8N_API_KEY
}
};