@aifabrix/miso-client 1.0.2 → 1.1.3
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/README.md +147 -97
- package/dist/examples/env-config-example.d.ts +2 -0
- package/dist/examples/env-config-example.d.ts.map +1 -0
- package/dist/examples/env-config-example.js +31 -0
- package/dist/examples/env-config-example.js.map +1 -0
- package/dist/examples/manual-config-example.d.ts +2 -0
- package/dist/examples/manual-config-example.d.ts.map +1 -0
- package/dist/examples/manual-config-example.js +36 -0
- package/dist/examples/manual-config-example.js.map +1 -0
- package/dist/examples/step-3-authentication.d.ts.map +1 -1
- package/dist/examples/step-3-authentication.js +4 -8
- package/dist/examples/step-3-authentication.js.map +1 -1
- package/dist/examples/step-4-rbac.d.ts.map +1 -1
- package/dist/examples/step-4-rbac.js +3 -11
- package/dist/examples/step-4-rbac.js.map +1 -1
- package/dist/examples/step-5-logging.d.ts.map +1 -1
- package/dist/examples/step-5-logging.js +4 -12
- package/dist/examples/step-5-logging.js.map +1 -1
- package/dist/examples/step-6-audit.d.ts.map +1 -1
- package/dist/examples/step-6-audit.js +3 -17
- package/dist/examples/step-6-audit.js.map +1 -1
- package/dist/examples/step-7-encryption-cache.d.ts +8 -0
- package/dist/examples/step-7-encryption-cache.d.ts.map +1 -0
- package/dist/examples/step-7-encryption-cache.js +131 -0
- package/dist/examples/step-7-encryption-cache.js.map +1 -0
- package/dist/examples/usage.js +3 -3
- package/dist/examples/usage.js.map +1 -1
- package/dist/src/index.d.ts +34 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +72 -7
- package/dist/src/index.js.map +1 -1
- package/dist/src/services/auth.service.d.ts +12 -2
- package/dist/src/services/auth.service.d.ts.map +1 -1
- package/dist/src/services/auth.service.js +84 -17
- package/dist/src/services/auth.service.js.map +1 -1
- package/dist/src/services/cache.service.d.ts +58 -0
- package/dist/src/services/cache.service.d.ts.map +1 -0
- package/dist/src/services/cache.service.js +171 -0
- package/dist/src/services/cache.service.js.map +1 -0
- package/dist/src/services/encryption.service.d.ts +32 -0
- package/dist/src/services/encryption.service.d.ts.map +1 -0
- package/dist/src/services/encryption.service.js +135 -0
- package/dist/src/services/encryption.service.js.map +1 -0
- package/dist/src/services/logger.service.d.ts +2 -2
- package/dist/src/services/logger.service.d.ts.map +1 -1
- package/dist/src/services/logger.service.js +18 -15
- package/dist/src/services/logger.service.js.map +1 -1
- package/dist/src/services/permission.service.d.ts +11 -6
- package/dist/src/services/permission.service.d.ts.map +1 -1
- package/dist/src/services/permission.service.js +57 -44
- package/dist/src/services/permission.service.js.map +1 -1
- package/dist/src/services/role.service.d.ts +10 -5
- package/dist/src/services/role.service.d.ts.map +1 -1
- package/dist/src/services/role.service.js +52 -37
- package/dist/src/services/role.service.js.map +1 -1
- package/dist/src/types/config.types.d.ts +9 -4
- package/dist/src/types/config.types.d.ts.map +1 -1
- package/dist/src/utils/config-loader.d.ts.map +1 -1
- package/dist/src/utils/config-loader.js +15 -6
- package/dist/src/utils/config-loader.js.map +1 -1
- package/dist/src/utils/http-client.d.ts +16 -2
- package/dist/src/utils/http-client.d.ts.map +1 -1
- package/dist/src/utils/http-client.js +90 -9
- package/dist/src/utils/http-client.js.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -26,6 +26,7 @@ The **AI Fabrix Miso Client SDK** provides authentication, authorization, and lo
|
|
|
26
26
|
- API key authentication
|
|
27
27
|
- Token revocation support
|
|
28
28
|
- Secure token storage
|
|
29
|
+
- Data encryption/decryption (AES-256-GCM)
|
|
29
30
|
|
|
30
31
|
### 📊 Compliance & Audit
|
|
31
32
|
|
|
@@ -51,6 +52,7 @@ The **AI Fabrix Miso Client SDK** provides authentication, authorization, and lo
|
|
|
51
52
|
|
|
52
53
|
**Intelligent Caching**
|
|
53
54
|
- Redis-based role and permission caching
|
|
55
|
+
- Generic cache service with Redis and in-memory fallback
|
|
54
56
|
- Configurable cache TTL (default: 15 minutes)
|
|
55
57
|
- Automatic cache invalidation
|
|
56
58
|
- Fallback to controller when Redis unavailable
|
|
@@ -91,15 +93,45 @@ The **AI Fabrix Miso Client SDK** provides authentication, authorization, and lo
|
|
|
91
93
|
|
|
92
94
|
## 🚀 Quick Start
|
|
93
95
|
|
|
94
|
-
Get your application secured in
|
|
96
|
+
Get your application secured in 30 seconds.
|
|
95
97
|
|
|
96
|
-
### Step 1:
|
|
98
|
+
### Step 1: Install
|
|
97
99
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
100
|
+
```bash
|
|
101
|
+
npm install @aifabrix/miso-client
|
|
102
|
+
```
|
|
101
103
|
|
|
102
|
-
|
|
104
|
+
### Step 2: Create `.env`
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
MISO_CLIENTID=ctrl-dev-my-app
|
|
108
|
+
MISO_CLIENTSECRET=your-secret
|
|
109
|
+
MISO_CONTROLLER_URL=http://localhost:3000
|
|
110
|
+
REDIS_HOST=localhost
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Step 3: Use It
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
import { MisoClient, loadConfig } from '@aifabrix/miso-client';
|
|
117
|
+
|
|
118
|
+
const client = new MisoClient(loadConfig());
|
|
119
|
+
await client.initialize();
|
|
120
|
+
|
|
121
|
+
const isValid = await client.auth.validateToken(token);
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**That's it!** You now have authentication, roles, and logging.
|
|
125
|
+
|
|
126
|
+
→ [Full Getting Started Guide](docs/getting-started.md)
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
### Infrastructure Setup
|
|
131
|
+
|
|
132
|
+
**First time?** You'll need Keycloak and Miso Controller running.
|
|
133
|
+
|
|
134
|
+
Use the [AI Fabrix Builder](https://github.com/esystemsdev/aifabrix-builder/blob/main/docs/QUICK-START.md):
|
|
103
135
|
|
|
104
136
|
```bash
|
|
105
137
|
# Start infrastructure (Postgres, Redis)
|
|
@@ -118,48 +150,30 @@ aifabrix run miso-controller
|
|
|
118
150
|
|
|
119
151
|
→ [Infrastructure Guide](https://github.com/esystemsdev/aifabrix-builder/blob/main/docs/INFRASTRUCTURE.md)
|
|
120
152
|
|
|
121
|
-
**Already have Keycloak and Controller?**
|
|
122
|
-
|
|
123
|
-
---
|
|
124
|
-
|
|
125
|
-
### Step 2: Install Miso Client
|
|
126
|
-
|
|
127
|
-
```bash
|
|
128
|
-
npm install @aifabrix/miso-client
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
**What you get:**
|
|
132
|
-
- Authentication with Keycloak
|
|
133
|
-
- Role-based access control (RBAC)
|
|
134
|
-
- Centralized logging
|
|
135
|
-
- Redis caching for performance
|
|
153
|
+
**Already have Keycloak and Controller?** Use the Quick Start above.
|
|
136
154
|
|
|
137
155
|
---
|
|
138
156
|
|
|
139
|
-
|
|
157
|
+
## 📚 Documentation
|
|
140
158
|
|
|
141
159
|
**What happens:** Your app validates user tokens from Keycloak.
|
|
142
160
|
|
|
143
161
|
```typescript
|
|
144
|
-
import { MisoClient } from '@aifabrix/miso-client';
|
|
145
|
-
|
|
146
|
-
// Create client
|
|
147
|
-
const client = new MisoClient({
|
|
148
|
-
controllerUrl: 'https://controller.aifabrix.ai',
|
|
149
|
-
environment: 'dev',
|
|
150
|
-
applicationKey: 'my-app',
|
|
151
|
-
applicationId: 'my-app-id-123',
|
|
152
|
-
});
|
|
162
|
+
import { MisoClient, loadConfig } from '@aifabrix/miso-client';
|
|
153
163
|
|
|
164
|
+
// Create client (loads from .env automatically)
|
|
165
|
+
const client = new MisoClient(loadConfig());
|
|
154
166
|
await client.initialize();
|
|
155
167
|
|
|
156
|
-
//
|
|
157
|
-
const token =
|
|
158
|
-
const isValid = await client.validateToken(token);
|
|
168
|
+
// Get token from request (helper method)
|
|
169
|
+
const token = client.getToken(req);
|
|
159
170
|
|
|
160
|
-
if (
|
|
161
|
-
const
|
|
162
|
-
|
|
171
|
+
if (token) {
|
|
172
|
+
const isValid = await client.validateToken(token);
|
|
173
|
+
if (isValid) {
|
|
174
|
+
const user = await client.getUser(token);
|
|
175
|
+
console.log('User:', user);
|
|
176
|
+
}
|
|
163
177
|
}
|
|
164
178
|
```
|
|
165
179
|
|
|
@@ -174,18 +188,13 @@ if (isValid) {
|
|
|
174
188
|
**What happens:** Check user roles to control access. Roles are cached in Redis for performance.
|
|
175
189
|
|
|
176
190
|
```typescript
|
|
177
|
-
|
|
178
|
-
const client = new MisoClient({
|
|
179
|
-
controllerUrl: 'https://controller.aifabrix.ai',
|
|
180
|
-
environment: 'dev',
|
|
181
|
-
applicationKey: 'my-app',
|
|
182
|
-
applicationId: 'my-app-id-123',
|
|
183
|
-
redis: { host: 'localhost', port: 6379 }, // Add Redis
|
|
184
|
-
});
|
|
191
|
+
import { MisoClient, loadConfig } from '@aifabrix/miso-client';
|
|
185
192
|
|
|
193
|
+
// Build on Step 3 - add Redis in .env file
|
|
194
|
+
const client = new MisoClient(loadConfig());
|
|
186
195
|
await client.initialize();
|
|
187
196
|
|
|
188
|
-
const token =
|
|
197
|
+
const token = client.getToken(req);
|
|
189
198
|
|
|
190
199
|
// Check if user has role
|
|
191
200
|
const isAdmin = await client.hasRole(token, 'admin');
|
|
@@ -200,28 +209,22 @@ if (isAdmin) {
|
|
|
200
209
|
**Pro tip:** Without Redis, checks go to the controller. Add Redis to cache role lookups (15-minute default TTL).
|
|
201
210
|
|
|
202
211
|
→ [Complete RBAC example](examples/step-4-rbac.ts)
|
|
203
|
-
→ [
|
|
212
|
+
→ [AI Fabrix Builder Quick Start](https://github.com/esystemsdev/aifabrix-builder/blob/main/docs/QUICK-START.md)
|
|
204
213
|
|
|
205
214
|
---
|
|
206
215
|
|
|
207
216
|
### Step 5: Activate Logging
|
|
208
217
|
|
|
209
|
-
**What happens:** Application logs are sent to the Miso Controller with
|
|
218
|
+
**What happens:** Application logs are sent to the Miso Controller with client token authentication.
|
|
210
219
|
|
|
211
220
|
```typescript
|
|
212
|
-
|
|
213
|
-
const client = new MisoClient({
|
|
214
|
-
controllerUrl: 'https://controller.aifabrix.ai',
|
|
215
|
-
environment: 'dev',
|
|
216
|
-
applicationKey: 'my-app',
|
|
217
|
-
applicationId: 'my-app-id-123',
|
|
218
|
-
apiKey: 'dev-my-app-my-app-id-123-a1b2c3d4e5f6', // NEW: API key
|
|
219
|
-
redis: { host: 'localhost', port: 6379 },
|
|
220
|
-
});
|
|
221
|
+
import { MisoClient, loadConfig } from '@aifabrix/miso-client';
|
|
221
222
|
|
|
223
|
+
// Client token is automatically managed - no API key needed
|
|
224
|
+
const client = new MisoClient(loadConfig());
|
|
222
225
|
await client.initialize();
|
|
223
226
|
|
|
224
|
-
const token =
|
|
227
|
+
const token = client.getToken(req);
|
|
225
228
|
const user = await client.getUser(token);
|
|
226
229
|
|
|
227
230
|
// Log messages
|
|
@@ -230,9 +233,7 @@ await client.log.error('Operation failed', { error: err.message });
|
|
|
230
233
|
await client.log.warn('Unusual activity', { details: '...' });
|
|
231
234
|
```
|
|
232
235
|
|
|
233
|
-
**
|
|
234
|
-
|
|
235
|
-
**What happens to logs?** They're sent to the Miso Controller for centralized monitoring and analysis.
|
|
236
|
+
**What happens to logs?** They're sent to the Miso Controller for centralized monitoring and analysis. Client token is automatically included.
|
|
236
237
|
|
|
237
238
|
→ [Complete logging example](examples/step-5-logging.ts)
|
|
238
239
|
→ [Logging Reference](docs/api-reference.md#logger-service)
|
|
@@ -244,23 +245,16 @@ await client.log.warn('Unusual activity', { details: '...' });
|
|
|
244
245
|
**What happens:** Create audit trails for compliance and security monitoring.
|
|
245
246
|
|
|
246
247
|
```typescript
|
|
247
|
-
|
|
248
|
-
const client = new MisoClient({
|
|
249
|
-
controllerUrl: 'https://controller.aifabrix.ai',
|
|
250
|
-
environment: 'dev',
|
|
251
|
-
applicationKey: 'my-app',
|
|
252
|
-
applicationId: 'my-app-id-123',
|
|
253
|
-
apiKey: 'dev-my-app-my-app-id-123-a1b2c3d4e5f6',
|
|
254
|
-
redis: { host: 'localhost', port: 6379, password: 'optional' },
|
|
255
|
-
logLevel: 'info',
|
|
256
|
-
cache: { roleTTL: 900, permissionTTL: 900 },
|
|
257
|
-
});
|
|
248
|
+
import { MisoClient, loadConfig } from '@aifabrix/miso-client';
|
|
258
249
|
|
|
250
|
+
// Complete configuration (all in .env)
|
|
251
|
+
const client = new MisoClient(loadConfig());
|
|
259
252
|
await client.initialize();
|
|
260
253
|
|
|
261
|
-
const token =
|
|
254
|
+
const token = client.getToken(req);
|
|
262
255
|
const isValid = await client.validateToken(token);
|
|
263
256
|
const canEdit = await client.hasPermission(token, 'edit:content');
|
|
257
|
+
const user = await client.getUser(token);
|
|
264
258
|
|
|
265
259
|
// Audit: User actions
|
|
266
260
|
await client.log.audit('user.login', 'authentication', {
|
|
@@ -291,17 +285,53 @@ await client.log.audit('access.denied', 'authorization', {
|
|
|
291
285
|
|
|
292
286
|
---
|
|
293
287
|
|
|
288
|
+
### Encryption and Caching
|
|
289
|
+
|
|
290
|
+
**What happens:** Use encryption for sensitive data and generic caching for improved performance.
|
|
291
|
+
|
|
292
|
+
```typescript
|
|
293
|
+
import { MisoClient, loadConfig } from '@aifabrix/miso-client';
|
|
294
|
+
|
|
295
|
+
const client = new MisoClient(loadConfig());
|
|
296
|
+
await client.initialize();
|
|
297
|
+
|
|
298
|
+
// Encryption (requires ENCRYPTION_KEY in .env or config.encryptionKey)
|
|
299
|
+
if (client.encryption) {
|
|
300
|
+
const encrypted = client.encryption.encrypt('sensitive-data');
|
|
301
|
+
const decrypted = client.encryption.decrypt(encrypted);
|
|
302
|
+
console.log('Decrypted:', decrypted);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
// Generic caching (automatically uses Redis if available, falls back to memory)
|
|
306
|
+
await client.cache.set('user:123', { name: 'John', age: 30 }, 600); // 10 minutes TTL
|
|
307
|
+
const user = await client.cache.get<{ name: string; age: number }>('user:123');
|
|
308
|
+
if (user) {
|
|
309
|
+
console.log('Cached user:', user);
|
|
310
|
+
}
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
**Configuration:**
|
|
314
|
+
|
|
315
|
+
```bash
|
|
316
|
+
# Add to .env
|
|
317
|
+
ENCRYPTION_KEY=your-32-byte-encryption-key
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
→ [API Reference](docs/api-reference.md#encryption-methods)
|
|
321
|
+
→ [Cache Methods](docs/api-reference.md#cache-methods)
|
|
322
|
+
|
|
323
|
+
---
|
|
324
|
+
|
|
294
325
|
## 🔧 Configuration
|
|
295
326
|
|
|
296
327
|
```typescript
|
|
297
328
|
interface MisoClientConfig {
|
|
298
329
|
controllerUrl: string; // Required: Controller URL
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
apiKey?: string; // Optional: For logging
|
|
303
|
-
redis?: RedisConfig; // Optional: For caching
|
|
330
|
+
clientId: string; // Required: Client ID (e.g., 'ctrl-dev-my-app')
|
|
331
|
+
clientSecret: string; // Required: Client secret
|
|
332
|
+
redis?: RedisConfig; // Optional: For caching
|
|
304
333
|
logLevel?: 'debug' | 'info' | 'warn' | 'error';
|
|
334
|
+
encryptionKey?: string; // Optional: Encryption key (or use ENCRYPTION_KEY env var)
|
|
305
335
|
cache?: {
|
|
306
336
|
roleTTL?: number; // Role cache TTL (default: 900s)
|
|
307
337
|
permissionTTL?: number; // Permission cache TTL (default: 900s)
|
|
@@ -309,6 +339,8 @@ interface MisoClientConfig {
|
|
|
309
339
|
}
|
|
310
340
|
```
|
|
311
341
|
|
|
342
|
+
**Recommended:** Use `loadConfig()` to load from `.env` file automatically.
|
|
343
|
+
|
|
312
344
|
→ [Complete Configuration Reference](docs/configuration.md)
|
|
313
345
|
|
|
314
346
|
---
|
|
@@ -337,15 +369,28 @@ The SDK consists of five core services:
|
|
|
337
369
|
|
|
338
370
|
---
|
|
339
371
|
|
|
340
|
-
## 🌐
|
|
372
|
+
## 🌐 Setup Your Application
|
|
373
|
+
|
|
374
|
+
**First time setup?** Use the AI Fabrix Builder:
|
|
341
375
|
|
|
342
|
-
|
|
376
|
+
1. **Create your app:**
|
|
377
|
+
```bash
|
|
378
|
+
aifabrix create myapp --port 3000 --database --language typescript
|
|
379
|
+
```
|
|
343
380
|
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
381
|
+
2. **Login to controller:**
|
|
382
|
+
```bash
|
|
383
|
+
aifabrix login
|
|
384
|
+
```
|
|
347
385
|
|
|
348
|
-
|
|
386
|
+
3. **Register your application:**
|
|
387
|
+
```bash
|
|
388
|
+
aifabrix app register myapp --environment dev
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
4. **Start development** and then deploy to Docker or Azure.
|
|
392
|
+
|
|
393
|
+
→ [Full Quick Start Guide](https://github.com/esystemsdev/aifabrix-builder/blob/main/docs/QUICK-START.md)
|
|
349
394
|
|
|
350
395
|
---
|
|
351
396
|
|
|
@@ -362,10 +407,12 @@ Each environment uses different controller endpoints and API keys.
|
|
|
362
407
|
**Add authentication middleware:**
|
|
363
408
|
```typescript
|
|
364
409
|
app.use(async (req, res, next) => {
|
|
365
|
-
const token =
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
410
|
+
const token = client.getToken(req);
|
|
411
|
+
if (token) {
|
|
412
|
+
const isValid = await client.validateToken(token);
|
|
413
|
+
if (isValid) {
|
|
414
|
+
req.user = await client.getUser(token);
|
|
415
|
+
}
|
|
369
416
|
}
|
|
370
417
|
next();
|
|
371
418
|
});
|
|
@@ -374,22 +421,25 @@ app.use(async (req, res, next) => {
|
|
|
374
421
|
**Protect routes by role:**
|
|
375
422
|
```typescript
|
|
376
423
|
app.get('/admin', async (req, res) => {
|
|
377
|
-
const token =
|
|
424
|
+
const token = client.getToken(req);
|
|
425
|
+
if (!token) return res.status(401).json({ error: 'Unauthorized' });
|
|
426
|
+
|
|
378
427
|
const isAdmin = await client.hasRole(token, 'admin');
|
|
379
428
|
if (!isAdmin) return res.status(403).json({ error: 'Forbidden' });
|
|
429
|
+
|
|
380
430
|
// Admin only code
|
|
431
|
+
res.json({ message: 'Admin panel' });
|
|
381
432
|
});
|
|
382
433
|
```
|
|
383
434
|
|
|
384
435
|
**Use environment variables:**
|
|
385
436
|
```bash
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
MISO_APPLICATION_ID=my-app-id-123
|
|
390
|
-
MISO_API_KEY=dev-my-app-my-app-id-123-a1b2c3d4e5f6
|
|
437
|
+
MISO_CLIENTID=ctrl-dev-my-app
|
|
438
|
+
MISO_CLIENTSECRET=your-secret
|
|
439
|
+
MISO_CONTROLLER_URL=http://localhost:3000
|
|
391
440
|
REDIS_HOST=localhost
|
|
392
441
|
REDIS_PORT=6379
|
|
442
|
+
MISO_LOG_LEVEL=info
|
|
393
443
|
```
|
|
394
444
|
|
|
395
445
|
---
|
|
@@ -404,9 +454,9 @@ REDIS_PORT=6379
|
|
|
404
454
|
→ SDK falls back to controller-only mode (slower but works)
|
|
405
455
|
→ Fix: `aifabrix up` to start Redis
|
|
406
456
|
|
|
407
|
-
**"
|
|
408
|
-
→ Check
|
|
409
|
-
→ Verify
|
|
457
|
+
**"Client token fetch failed"**
|
|
458
|
+
→ Check `MISO_CLIENTID` and `MISO_CLIENTSECRET` are correct
|
|
459
|
+
→ Verify credentials are configured in controller
|
|
410
460
|
|
|
411
461
|
**"Token validation fails"**
|
|
412
462
|
→ Ensure Keycloak is running and configured correctly
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env-config-example.d.ts","sourceRoot":"","sources":["../../examples/env-config-example.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* Example: Configuration from .env
|
|
5
|
+
* Shows how to use loadConfig() for automatic .env loading
|
|
6
|
+
*/
|
|
7
|
+
const index_1 = require("../src/index");
|
|
8
|
+
async function envConfigExample() {
|
|
9
|
+
// Auto-load from .env file - that's it!
|
|
10
|
+
const client = new index_1.MisoClient((0, index_1.loadConfig)());
|
|
11
|
+
try {
|
|
12
|
+
await client.initialize();
|
|
13
|
+
console.log('✅ Client initialized from .env');
|
|
14
|
+
const token = 'your-jwt-token';
|
|
15
|
+
const isValid = await client.validateToken(token);
|
|
16
|
+
if (isValid) {
|
|
17
|
+
const user = await client.getUser(token);
|
|
18
|
+
const roles = await client.getRoles(token);
|
|
19
|
+
console.log('👤 User:', user);
|
|
20
|
+
console.log('🔑 Roles:', roles);
|
|
21
|
+
await client.log.info('User accessed app', {
|
|
22
|
+
userId: user?.id,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
finally {
|
|
27
|
+
await client.disconnect();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
envConfigExample().catch(console.error);
|
|
31
|
+
//# sourceMappingURL=env-config-example.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env-config-example.js","sourceRoot":"","sources":["../../examples/env-config-example.ts"],"names":[],"mappings":";;AAAA;;;GAGG;AACH,wCAAsD;AAEtD,KAAK,UAAU,gBAAgB;IAC7B,wCAAwC;IACxC,MAAM,MAAM,GAAG,IAAI,kBAAU,CAAC,IAAA,kBAAU,GAAE,CAAC,CAAC;IAE5C,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC;QAC1B,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;QAE9C,MAAM,KAAK,GAAG,gBAAgB,CAAC;QAC/B,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAElD,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YACzC,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YAC3C,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;YAC9B,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;YAEhC,MAAM,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,mBAAmB,EAAE;gBACzC,MAAM,EAAE,IAAI,EAAE,EAAE;aACjB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;YAAS,CAAC;QACT,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC;IAC5B,CAAC;AACH,CAAC;AAED,gBAAgB,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manual-config-example.d.ts","sourceRoot":"","sources":["../../examples/manual-config-example.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* Example: Manual Configuration
|
|
5
|
+
* Shows how to configure client with explicit parameters
|
|
6
|
+
*/
|
|
7
|
+
const index_1 = require("../src/index");
|
|
8
|
+
async function manualConfigExample() {
|
|
9
|
+
const client = new index_1.MisoClient({
|
|
10
|
+
controllerUrl: 'http://localhost:3000',
|
|
11
|
+
clientId: 'ctrl-dev-my-app',
|
|
12
|
+
clientSecret: 'your-secret-here',
|
|
13
|
+
redis: {
|
|
14
|
+
host: 'localhost',
|
|
15
|
+
port: 6379,
|
|
16
|
+
},
|
|
17
|
+
logLevel: 'info',
|
|
18
|
+
// Optional: Encryption key (or set ENCRYPTION_KEY env var)
|
|
19
|
+
encryptionKey: 'your-encryption-key-here', // 32-byte key in hex/base64/raw string
|
|
20
|
+
});
|
|
21
|
+
try {
|
|
22
|
+
await client.initialize();
|
|
23
|
+
console.log('✅ Client initialized');
|
|
24
|
+
const token = 'your-jwt-token';
|
|
25
|
+
const isValid = await client.validateToken(token);
|
|
26
|
+
if (isValid) {
|
|
27
|
+
const user = await client.getUser(token);
|
|
28
|
+
console.log('👤 User:', user);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
finally {
|
|
32
|
+
await client.disconnect();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
manualConfigExample().catch(console.error);
|
|
36
|
+
//# sourceMappingURL=manual-config-example.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manual-config-example.js","sourceRoot":"","sources":["../../examples/manual-config-example.ts"],"names":[],"mappings":";;AAAA;;;GAGG;AACH,wCAA0C;AAE1C,KAAK,UAAU,mBAAmB;IAChC,MAAM,MAAM,GAAG,IAAI,kBAAU,CAAC;QAC5B,aAAa,EAAE,uBAAuB;QACtC,QAAQ,EAAE,iBAAiB;QAC3B,YAAY,EAAE,kBAAkB;QAChC,KAAK,EAAE;YACL,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,IAAI;SACX;QACD,QAAQ,EAAE,MAAM;QAChB,2DAA2D;QAC3D,aAAa,EAAE,0BAA0B,EAAE,uCAAuC;KACnF,CAAC,CAAC;IAEH,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC;QAC1B,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;QAEpC,MAAM,KAAK,GAAG,gBAAgB,CAAC;QAC/B,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAElD,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YACzC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QAChC,CAAC;IACH,CAAC;YAAS,CAAC;QACT,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC;IAC5B,CAAC;AACH,CAAC;AAED,mBAAmB,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-3-authentication.d.ts","sourceRoot":"","sources":["../../examples/step-3-authentication.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,iBAAe,qBAAqB,
|
|
1
|
+
{"version":3,"file":"step-3-authentication.d.ts","sourceRoot":"","sources":["../../examples/step-3-authentication.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,iBAAe,qBAAqB,kBAgCnC;AAED,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -8,19 +8,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
8
|
exports.authenticationExample = authenticationExample;
|
|
9
9
|
const index_1 = require("../src/index");
|
|
10
10
|
async function authenticationExample() {
|
|
11
|
-
// Create client
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
environment: 'dev',
|
|
15
|
-
applicationKey: 'my-app',
|
|
16
|
-
applicationId: 'my-app-id-123',
|
|
17
|
-
});
|
|
11
|
+
// Create client - loads from .env automatically
|
|
12
|
+
// Or manually: new MisoClient({ controllerUrl, clientId, clientSecret })
|
|
13
|
+
const client = new index_1.MisoClient((0, index_1.loadConfig)());
|
|
18
14
|
try {
|
|
19
15
|
// Initialize the client
|
|
20
16
|
await client.initialize();
|
|
21
17
|
console.log('✅ Client initialized successfully');
|
|
22
18
|
// Get token from your application (e.g., from HTTP request header)
|
|
23
|
-
// In real usage: const token =
|
|
19
|
+
// In real usage: const token = client.getToken(req);
|
|
24
20
|
const token = 'your-jwt-token-here';
|
|
25
21
|
// Validate the token
|
|
26
22
|
const isValid = await client.validateToken(token);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-3-authentication.js","sourceRoot":"","sources":["../../examples/step-3-authentication.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;
|
|
1
|
+
{"version":3,"file":"step-3-authentication.js","sourceRoot":"","sources":["../../examples/step-3-authentication.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAsCM,sDAAqB;AApC9B,wCAAsD;AAEtD,KAAK,UAAU,qBAAqB;IAClC,gDAAgD;IAChD,yEAAyE;IACzE,MAAM,MAAM,GAAG,IAAI,kBAAU,CAAC,IAAA,kBAAU,GAAE,CAAC,CAAC;IAE5C,IAAI,CAAC;QACH,wBAAwB;QACxB,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC;QAC1B,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;QAEjD,mEAAmE;QACnE,qDAAqD;QACrD,MAAM,KAAK,GAAG,qBAAqB,CAAC;QAEpC,qBAAqB;QACrB,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAElD,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;YAEhC,uBAAuB;YACvB,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YACzC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QAChC,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;QACpC,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;IAClD,CAAC;YAAS,CAAC;QACT,uBAAuB;QACvB,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC;IAC5B,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-4-rbac.d.ts","sourceRoot":"","sources":["../../examples/step-4-rbac.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,iBAAe,WAAW,
|
|
1
|
+
{"version":3,"file":"step-4-rbac.d.ts","sourceRoot":"","sources":["../../examples/step-4-rbac.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,iBAAe,WAAW,kBAyCzB;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -8,17 +8,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
8
|
exports.rbacExample = rbacExample;
|
|
9
9
|
const index_1 = require("../src/index");
|
|
10
10
|
async function rbacExample() {
|
|
11
|
-
// Create client
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
environment: 'dev',
|
|
15
|
-
applicationKey: 'my-app',
|
|
16
|
-
applicationId: 'my-app-id-123',
|
|
17
|
-
redis: {
|
|
18
|
-
host: 'localhost',
|
|
19
|
-
port: 6379,
|
|
20
|
-
},
|
|
21
|
-
});
|
|
11
|
+
// Create client - loads from .env automatically
|
|
12
|
+
// Redis config goes in .env: REDIS_HOST=localhost, REDIS_PORT=6379
|
|
13
|
+
const client = new index_1.MisoClient((0, index_1.loadConfig)());
|
|
22
14
|
try {
|
|
23
15
|
await client.initialize();
|
|
24
16
|
console.log('✅ Client initialized with Redis caching');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-4-rbac.js","sourceRoot":"","sources":["../../examples/step-4-rbac.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;
|
|
1
|
+
{"version":3,"file":"step-4-rbac.js","sourceRoot":"","sources":["../../examples/step-4-rbac.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AA+CM,kCAAW;AA7CpB,wCAAsD;AAEtD,KAAK,UAAU,WAAW;IACxB,gDAAgD;IAChD,mEAAmE;IACnE,MAAM,MAAM,GAAG,IAAI,kBAAU,CAAC,IAAA,kBAAU,GAAE,CAAC,CAAC;IAE5C,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC;QAC1B,OAAO,CAAC,GAAG,CAAC,yCAAyC,CAAC,CAAC;QAEvD,MAAM,KAAK,GAAG,qBAAqB,CAAC;QAEpC,+BAA+B;QAC/B,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAClD,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;YAClC,OAAO;QACT,CAAC;QAED,sBAAsB;QACtB,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC3C,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;QAErC,2BAA2B;QAC3B,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACrD,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;QAErC,sDAAsD;QACtD,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;QACvE,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;QAEzC,wCAAwC;QACxC,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;YACzC,6BAA6B;QAC/B,CAAC;IAEH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IACxC,CAAC;YAAS,CAAC;QACT,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC;IAC5B,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-5-logging.d.ts","sourceRoot":"","sources":["../../examples/step-5-logging.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,iBAAe,cAAc,
|
|
1
|
+
{"version":3,"file":"step-5-logging.d.ts","sourceRoot":"","sources":["../../examples/step-5-logging.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,iBAAe,cAAc,kBA8C5B;AAQD,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -8,17 +8,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
8
|
exports.loggingExample = loggingExample;
|
|
9
9
|
const index_1 = require("../src/index");
|
|
10
10
|
async function loggingExample() {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
environment: 'dev',
|
|
14
|
-
applicationKey: 'my-app',
|
|
15
|
-
applicationId: 'my-app-id-123',
|
|
16
|
-
apiKey: 'dev-my-app-my-app-id-123-a1b2c3d4e5f6', // Required for logging
|
|
17
|
-
redis: {
|
|
18
|
-
host: 'localhost',
|
|
19
|
-
port: 6379,
|
|
20
|
-
},
|
|
21
|
-
});
|
|
11
|
+
// Create client - loads from .env automatically
|
|
12
|
+
const client = new index_1.MisoClient((0, index_1.loadConfig)());
|
|
22
13
|
try {
|
|
23
14
|
await client.initialize();
|
|
24
15
|
const token = 'your-jwt-token-here';
|
|
@@ -61,6 +52,7 @@ async function loggingExample() {
|
|
|
61
52
|
}
|
|
62
53
|
async function performOperation() {
|
|
63
54
|
// Your application logic
|
|
55
|
+
// This is a placeholder for any operation that might fail
|
|
56
|
+
throw new Error('Operation failed');
|
|
64
57
|
}
|
|
65
|
-
let someCondition = false;
|
|
66
58
|
//# sourceMappingURL=step-5-logging.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-5-logging.js","sourceRoot":"","sources":["../../examples/step-5-logging.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;
|
|
1
|
+
{"version":3,"file":"step-5-logging.js","sourceRoot":"","sources":["../../examples/step-5-logging.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AA0DM,wCAAc;AAxDvB,wCAAsD;AAEtD,KAAK,UAAU,cAAc;IAC3B,gDAAgD;IAChD,MAAM,MAAM,GAAG,IAAI,kBAAU,CAAC,IAAA,kBAAU,GAAE,CAAC,CAAC;IAE5C,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC;QAC1B,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AC;QACT,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC;IAC5B,CAAC;AACH,CAAC;AAED,KAAK,UAAU,gBAAgB;IAC7B,yBAAyB;IACzB,0DAA0D;IAC1D,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;AACtC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-6-audit.d.ts","sourceRoot":"","sources":["../../examples/step-6-audit.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,iBAAe,eAAe,
|
|
1
|
+
{"version":3,"file":"step-6-audit.d.ts","sourceRoot":"","sources":["../../examples/step-6-audit.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,iBAAe,eAAe,kBAkF7B;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -8,23 +8,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
8
|
exports.completeExample = completeExample;
|
|
9
9
|
const index_1 = require("../src/index");
|
|
10
10
|
async function completeExample() {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
applicationKey: 'my-app',
|
|
15
|
-
applicationId: 'my-app-id-123',
|
|
16
|
-
apiKey: 'dev-my-app-my-app-id-123-a1b2c3d4e5f6',
|
|
17
|
-
redis: {
|
|
18
|
-
host: 'localhost',
|
|
19
|
-
port: 6379,
|
|
20
|
-
password: 'your-redis-password',
|
|
21
|
-
},
|
|
22
|
-
logLevel: 'info',
|
|
23
|
-
cache: {
|
|
24
|
-
roleTTL: 900, // 15 minutes
|
|
25
|
-
permissionTTL: 900, // 15 minutes
|
|
26
|
-
},
|
|
27
|
-
});
|
|
11
|
+
// Create client - loads from .env automatically
|
|
12
|
+
// All config (Redis, logLevel, cache) goes in .env file
|
|
13
|
+
const client = new index_1.MisoClient((0, index_1.loadConfig)());
|
|
28
14
|
try {
|
|
29
15
|
await client.initialize();
|
|
30
16
|
console.log('✅ Client fully configured');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-6-audit.js","sourceRoot":"","sources":["../../examples/step-6-audit.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;
|
|
1
|
+
{"version":3,"file":"step-6-audit.js","sourceRoot":"","sources":["../../examples/step-6-audit.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAwFM,0CAAe;AAtFxB,wCAAsD;AAEtD,KAAK,UAAU,eAAe;IAC5B,gDAAgD;IAChD,wDAAwD;IACxD,MAAM,MAAM,GAAG,IAAI,kBAAU,CAAC,IAAA,kBAAU,GAAE,CAAC,CAAC;IAE5C,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC;QAC1B,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;QAEzC,MAAM,KAAK,GAAG,qBAAqB,CAAC;QAEpC,yBAAyB;QACzB,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAClD,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,eAAe,EAAE,gBAAgB,EAAE;gBACxD,MAAM,EAAE,eAAe;gBACvB,EAAE,EAAE,aAAa;aAClB,CAAC,CAAC;YACH,OAAO;QACT,CAAC;QAED,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAEzC,eAAe;QACf,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;QAClE,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,eAAe,EAAE,eAAe,EAAE;gBACvD,MAAM,EAAE,IAAI,EAAE,EAAE;gBAChB,MAAM,EAAE,cAAc;gBACtB,QAAQ,EAAE,OAAO;aAClB,CAAC,CAAC;YACH,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;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