exguard-backend 1.0.38 → 1.0.39

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": "exguard-backend",
3
- "version": "1.0.38",
3
+ "version": "1.0.39",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -121,20 +121,32 @@ import { Guard } from 'exguard-backend';
121
121
  providers: [
122
122
  {
123
123
  provide: Guard,
124
- useFactory: () => new Guard({
125
- apiUrl: process.env.EXGUARD_API_URL || 'http://localhost:3000',
126
- cache: {
127
- enabled: process.env.EXGUARD_CACHE_ENABLED !== 'false',
128
- ttl: parseInt(process.env.EXGUARD_CACHE_TTL || '300000'),
129
- },
130
- timeout: parseInt(process.env.EXGUARD_TIMEOUT || '10000'),
131
- realtime: {
132
- // Auto-enable if URL is provided (uses API_URL if REALTIME_URL not set)
133
- enabled: process.env.EXGUARD_REALTIME_ENABLED !== 'false' && !!process.env.EXGUARD_API_URL,
134
- url: process.env.EXGUARD_REALTIME_URL || process.env.EXGUARD_API_URL || undefined,
135
- accessToken: process.env.EXGUARD_SERVICE_TOKEN || process.env.EXGUARD_API_KEY || undefined,
136
- },
137
- }),
124
+ useFactory: () => {
125
+ const config = {
126
+ apiUrl: process.env.EXGUARD_API_URL || 'http://localhost:3000',
127
+ cache: {
128
+ enabled: process.env.EXGUARD_CACHE_ENABLED !== 'false',
129
+ ttl: parseInt(process.env.EXGUARD_CACHE_TTL || '300000'),
130
+ },
131
+ timeout: parseInt(process.env.EXGUARD_TIMEOUT || '10000'),
132
+ realtime: {
133
+ enabled: process.env.EXGUARD_REALTIME_ENABLED !== 'false',
134
+ url: process.env.EXGUARD_REALTIME_URL || process.env.EXGUARD_API_URL || undefined,
135
+ accessToken: process.env.EXGUARD_SERVICE_TOKEN || process.env.EXGUARD_API_KEY || undefined,
136
+ },
137
+ };
138
+
139
+ console.log('[ExGuard] Configuration:', JSON.stringify({
140
+ apiUrl: config.apiUrl,
141
+ cacheEnabled: config.cache.enabled,
142
+ cacheTtl: config.cache.ttl,
143
+ realtimeEnabled: config.realtime.enabled,
144
+ realtimeUrl: config.realtime.url,
145
+ hasRealtimeToken: !!config.realtime.accessToken,
146
+ }, null, 2));
147
+
148
+ return new Guard(config);
149
+ },
138
150
  },
139
151
  ],
140
152
  exports: [Guard],