@easyweb/rabbitmq-utils 1.0.17 → 1.0.18

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 CHANGED
@@ -1,426 +1,426 @@
1
- # @myfoto/easyweb-common
2
-
3
- A shared utility library for Easyweb microservices built with TypeScript. This package provides common functionality including a type-safe RabbitMQ event system (publishers, subscribers, exchanges, and routing keys).
4
-
5
- ## Installation
6
-
7
- ```bash
8
- npm install @myfoto/easyweb-common
9
- ```
10
-
11
- ## Features
12
-
13
- - 🚨 **Error Handling** - Custom error classes with consistent serialization
14
- - ✅ **Validation** - Zod-based request/response validation with common patterns
15
- - 🗃️ **Database Utilities** - Prisma helpers, transactions, and health checks
16
- - 🔐 **Password Management** - Hashing, validation, and secure token generation
17
- - 📄 **Response Formatting** - Standardized API responses with pagination
18
- - 📊 **Pagination** - Cursor and offset-based pagination utilities
19
- - 📝 **Logging** - Structured logging with performance monitoring
20
- - 🛡️ **Middleware** - Rate limiting, error handling, and more
21
- - 🐰 **RabbitMQ Event System** - Type-safe event-driven architecture with publishers and subscribers
22
-
23
- ## Quick Start
24
-
25
- ```typescript
26
- import {
27
- // Error classes
28
- BadRequestError,
29
- NotFoundError,
30
- ValidationPatterns,
31
-
32
- // Utilities
33
- PasswordService,
34
- ResponseFormatter,
35
- PaginationService,
36
- Logger,
37
- DatabaseService,
38
-
39
- // Middleware
40
- errorHandler,
41
- validateRequest,
42
- responseFormatter,
43
- } from '@glow-up/common-shared';
44
-
45
- // Use in your Express app
46
- import express from 'express';
47
-
48
- const app = express();
49
-
50
- // Add response formatter middleware
51
- app.use(responseFormatter);
52
-
53
- // Add error handler (should be last)
54
- app.use(errorHandler);
55
- ```
56
-
57
- ## Error Handling
58
-
59
- ### Custom Error Classes
60
-
61
- ```typescript
62
- import {
63
- BadRequestError,
64
- NotFoundError,
65
- ValidationError,
66
- } from '@glow-up/common-shared';
67
-
68
- // Throw errors that will be automatically handled
69
- throw new BadRequestError('Invalid input data');
70
- throw new NotFoundError('User not found');
71
- throw new ValidationError([
72
- { field: 'email', message: 'Invalid email format' },
73
- ]);
74
- ```
75
-
76
- ### Error Handler Middleware
77
-
78
- ```typescript
79
- import { errorHandler } from '@glow-up/common-shared';
80
-
81
- // Add as the last middleware
82
- app.use(errorHandler);
83
- ```
84
-
85
- ## Validation
86
-
87
- ### Request Validation with Zod
88
-
89
- ```typescript
90
- import { validateRequest, ValidationPatterns } from '@glow-up/common-shared';
91
- import { z } from 'zod';
92
-
93
- // Use predefined patterns
94
- const loginSchema = {
95
- body: z.object({
96
- email: ValidationPatterns.email(),
97
- password: z.string().min(1),
98
- }),
99
- };
100
-
101
- app.post('/login', validateRequest(loginSchema), (req, res) => {
102
- // req.body is now validated and typed
103
- const { email, password } = req.body;
104
- res.success({ message: 'Login successful' });
105
- });
106
-
107
- // Common validation middleware
108
- import { ValidationMiddleware } from '@glow-up/common-shared';
109
-
110
- app.post(
111
- '/register',
112
- ValidationMiddleware.validateRegistration(),
113
- (req, res) => {
114
- // Handles email, password, name validation
115
- },
116
- );
117
- ```
118
-
119
- ## Response Formatting
120
-
121
- ### Standardized API Responses
122
-
123
- ```typescript
124
- import { ResponseFormatter } from '@glow-up/common-shared';
125
-
126
- // Success response
127
- ResponseFormatter.success(res, { user: userData }, 'User created');
128
- // { success: true, message: 'User created', data: { user: userData }, metadata: { timestamp: ... } }
129
-
130
- // Error response
131
- ResponseFormatter.error(res, 'Invalid credentials', 'Login failed', 401);
132
-
133
- // Paginated response
134
- ResponseFormatter.paginated(res, users, { page: 1, limit: 10, total: 100 });
135
-
136
- // Using middleware (adds methods to res object)
137
- app.use(responseFormatter);
138
-
139
- app.get('/users', (req, res) => {
140
- res.success(users, 'Users retrieved');
141
- res.paginated(users, paginationInfo);
142
- res.notFound('User not found');
143
- });
144
- ```
145
-
146
- ## Pagination
147
-
148
- ```typescript
149
- import { PaginationService, parseSort } from '@glow-up/common-shared';
150
-
151
- // Parse pagination params
152
- const pagination = PaginationService.parsePagination({
153
- page: req.query.page,
154
- limit: req.query.limit,
155
- });
156
-
157
- // For Prisma
158
- const prismaOptions = PaginationService.toPrisma(pagination, sort);
159
- const users = await prisma.user.findMany(prismaOptions);
160
-
161
- // Generate metadata
162
- const metadata = PaginationService.generateMetadata(
163
- pagination.page,
164
- pagination.limit,
165
- totalUsers,
166
- );
167
-
168
- res.paginated(users, metadata);
169
- ```
170
-
171
- ## Database Utilities
172
-
173
- ```typescript
174
- import { DatabaseService } from '@glow-up/common-shared';
175
- import { PrismaClient } from '@prisma/client';
176
-
177
- const prisma = new PrismaClient();
178
- const dbService = new DatabaseService(prisma);
179
-
180
- // Health check
181
- const health = await dbService.healthCheck();
182
-
183
- // Transactions
184
- const result = await dbService.withTransaction(async tx => {
185
- const user = await tx.user.create({ data: userData });
186
- const profile = await tx.profile.create({
187
- data: { userId: user.id, ...profileData },
188
- });
189
- return { user, profile };
190
- });
191
-
192
- // Batch operations
193
- await dbService.batchCreate('user', userDataArray, 50);
194
-
195
- // Soft delete
196
- await dbService.softDelete('user', { id: userId });
197
- ```
198
-
199
- ## Password Management
200
-
201
- ```typescript
202
- import { PasswordService } from '@glow-up/common-shared';
203
-
204
- // Hash password
205
- const hashedPassword = await PasswordService.hashPassword('mypassword');
206
-
207
- // Compare password
208
- const isValid = await PasswordService.comparePassword(
209
- 'mypassword',
210
- hashedPassword,
211
- );
212
-
213
- // Generate secure tokens
214
- const token = PasswordService.generateSecureToken(32);
215
- const resetToken = PasswordService.generatePasswordResetToken();
216
-
217
- // Check password strength
218
- const strength = PasswordService.checkPasswordStrength('mypassword');
219
- console.log(strength.isStrong); // boolean
220
- console.log(strength.feedback); // array of suggestions
221
- ```
222
-
223
- ## RabbitMQ Event System
224
-
225
- ### Quick Start
226
-
227
- ```typescript
228
- import {
229
- Publisher,
230
- Subscriber,
231
- Exchanges,
232
- RoutingKeys,
233
- UserProfileCreatedEvent,
234
- } from '@myfoto/common-shared';
235
- import { Channel } from 'amqplib';
236
-
237
- // Create a publisher
238
- export class UserProfileCreatedPublisher extends Publisher<UserProfileCreatedEvent> {
239
- exchange = Exchanges.UserProfile;
240
- routingKey = RoutingKeys.UserProfileCreated;
241
- }
242
-
243
- // Publish an event
244
- const publisher = new UserProfileCreatedPublisher(channel);
245
- await publisher.publish({
246
- userId: '123',
247
- name: 'John Doe',
248
- email: 'john@example.com',
249
- });
250
-
251
- // Create a subscriber
252
- export class UserProfileCreatedSubscriber extends Subscriber<UserProfileCreatedEvent> {
253
- exchange = Exchanges.UserProfile;
254
- routingKey = RoutingKeys.UserProfileCreated;
255
-
256
- async onMessage(
257
- data: UserProfileCreatedEvent['data'],
258
- msg: ConsumeMessage,
259
- ): Promise<void> {
260
- console.log('User created:', data);
261
- // Your business logic here
262
- }
263
- }
264
-
265
- // Subscribe to events
266
- const subscriber = new UserProfileCreatedSubscriber(channel);
267
- await subscriber.subscribe();
268
- ```
269
-
270
- ### Features
271
-
272
- - ✅ **Type-safe events** - Full TypeScript support with autocomplete
273
- - ✅ **Centralized definitions** - All events defined in one package
274
- - ✅ **Consistent naming** - Clear routing key conventions
275
- - ✅ **Durable queues** - Messages persist across restarts
276
- - ✅ **Error handling** - Automatic message requeuing on failures
277
- - ✅ **Documentation** - Comprehensive guides and examples
278
-
279
- ### Available Events
280
-
281
- **User Profile**: `UserProfileCreatedEvent`, `UserProfileUpdatedEvent`, `UserProfileDeletedEvent`
282
-
283
- **Product**: `ProductCreatedEvent`, `ProductUpdatedEvent`, `ProductDeletedEvent`, `ProductStockChangedEvent`
284
-
285
- **Order**: `OrderCreatedEvent`, `OrderUpdatedEvent`, `OrderCompletedEvent`, `OrderCancelledEvent`
286
-
287
- ### Routing Key Convention
288
-
289
- Format: `<service>.<entity>.<action>`
290
-
291
- Examples:
292
-
293
- - `user_profile.profile.created`
294
- - `product.product.updated`
295
- - `order.order.completed`
296
-
297
- ### Documentation
298
-
299
- - 📚 [Full Event System Documentation](src/events/README.md)
300
- - 📋 [Event Guidelines](EVENT_GUIDELINES.md)
301
- - 🚀 [Quick Reference](QUICK_REFERENCE.md)
302
- - 🔄 [Migration Guide](MIGRATION.md)
303
-
304
- ## Logging
305
-
306
- ```typescript
307
- import { Logger, createLogger, requestLogger } from '@myfoto/common-shared';
308
-
309
- // Use default logger
310
- import { log } from '@glow-up/common-shared';
311
-
312
- log.info('Application started');
313
- log.error('Something went wrong', error, { userId: '123' });
314
-
315
- // Create custom logger
316
- const logger = createLogger({
317
- level: 'debug',
318
- enableFile: true,
319
- filePath: './logs/app.log',
320
- });
321
-
322
- // Add request logging middleware
323
- app.use(requestLogger(logger));
324
-
325
- // Performance logging
326
- import { timeOperation } from '@glow-up/common-shared';
327
-
328
- const result = await timeOperation(
329
- 'database-query',
330
- () => prisma.user.findMany(),
331
- logger,
332
- );
333
- ```
334
-
335
- ## Validation Patterns
336
-
337
- ```typescript
338
- import { ValidationPatterns } from '@glow-up/common-shared';
339
-
340
- // Email with normalization
341
- ValidationPatterns.email();
342
-
343
- // Strong password requirements
344
- ValidationPatterns.password();
345
-
346
- // UUID validation
347
- ValidationPatterns.uuid();
348
-
349
- // Pagination parameters
350
- ValidationPatterns.pagination();
351
-
352
- // Phone number
353
- ValidationPatterns.phoneNumber();
354
-
355
- // Custom enum with case insensitive matching
356
- ValidationPatterns.enumCaseInsensitive(['ACTIVE', 'INACTIVE']);
357
- ```
358
-
359
- ## TypeScript Support
360
-
361
- This package is built with TypeScript and provides full type definitions. All utilities are properly typed for the best development experience.
362
-
363
- ```typescript
364
- // Types are automatically inferred
365
- import {
366
- ApiResponse,
367
- PaginatedResponse,
368
- LogLevel,
369
- } from '@glow-up/common-shared';
370
-
371
- // Extend Express types (automatically included)
372
- declare global {
373
- namespace Express {
374
- interface Request {
375
- user?: {
376
- id: string;
377
- email: string;
378
- roles?: string[];
379
- };
380
- }
381
- interface Response {
382
- success: (data?: any, message?: string) => void;
383
- error: (errors: any, message?: string, statusCode?: number) => void;
384
- // ... other response methods
385
- }
386
- }
387
- }
388
- ```
389
-
390
- ## Peer Dependencies
391
-
392
- Make sure to install peer dependencies if you're using related features:
393
-
394
- ```bash
395
- # For database utilities
396
- npm install @prisma/client
397
-
398
- # For logging to files (if using file logging)
399
- npm install winston
400
- ```
401
-
402
- ## Contributing
403
-
404
- This package is part of the Glow Up microservices ecosystem. When adding new utilities:
405
-
406
- 1. Follow the existing patterns and TypeScript conventions
407
- 2. Add proper JSDoc documentation
408
- 3. Include unit tests
409
- 4. Update this README with usage examples
410
-
411
- ## License
412
-
413
- MIT License - see LICENSE file for details.
414
-
415
- ## Changelog
416
-
417
- ### 1.0.0
418
-
419
- - Initial release with core utilities
420
- - Error handling system
421
- - Validation middleware
422
- - Database utilities
423
- - Response formatting
424
- - Pagination helpers
425
- - Logging system
426
- - Password management
1
+ # @myfoto/easyweb-common
2
+
3
+ A shared utility library for Easyweb microservices built with TypeScript. This package provides common functionality including a type-safe RabbitMQ event system (publishers, subscribers, exchanges, and routing keys).
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @myfoto/easyweb-common
9
+ ```
10
+
11
+ ## Features
12
+
13
+ - 🚨 **Error Handling** - Custom error classes with consistent serialization
14
+ - ✅ **Validation** - Zod-based request/response validation with common patterns
15
+ - 🗃️ **Database Utilities** - Prisma helpers, transactions, and health checks
16
+ - 🔐 **Password Management** - Hashing, validation, and secure token generation
17
+ - 📄 **Response Formatting** - Standardized API responses with pagination
18
+ - 📊 **Pagination** - Cursor and offset-based pagination utilities
19
+ - 📝 **Logging** - Structured logging with performance monitoring
20
+ - 🛡️ **Middleware** - Rate limiting, error handling, and more
21
+ - 🐰 **RabbitMQ Event System** - Type-safe event-driven architecture with publishers and subscribers
22
+
23
+ ## Quick Start
24
+
25
+ ```typescript
26
+ import {
27
+ // Error classes
28
+ BadRequestError,
29
+ NotFoundError,
30
+ ValidationPatterns,
31
+
32
+ // Utilities
33
+ PasswordService,
34
+ ResponseFormatter,
35
+ PaginationService,
36
+ Logger,
37
+ DatabaseService,
38
+
39
+ // Middleware
40
+ errorHandler,
41
+ validateRequest,
42
+ responseFormatter,
43
+ } from '@glow-up/common-shared';
44
+
45
+ // Use in your Express app
46
+ import express from 'express';
47
+
48
+ const app = express();
49
+
50
+ // Add response formatter middleware
51
+ app.use(responseFormatter);
52
+
53
+ // Add error handler (should be last)
54
+ app.use(errorHandler);
55
+ ```
56
+
57
+ ## Error Handling
58
+
59
+ ### Custom Error Classes
60
+
61
+ ```typescript
62
+ import {
63
+ BadRequestError,
64
+ NotFoundError,
65
+ ValidationError,
66
+ } from '@glow-up/common-shared';
67
+
68
+ // Throw errors that will be automatically handled
69
+ throw new BadRequestError('Invalid input data');
70
+ throw new NotFoundError('User not found');
71
+ throw new ValidationError([
72
+ { field: 'email', message: 'Invalid email format' },
73
+ ]);
74
+ ```
75
+
76
+ ### Error Handler Middleware
77
+
78
+ ```typescript
79
+ import { errorHandler } from '@glow-up/common-shared';
80
+
81
+ // Add as the last middleware
82
+ app.use(errorHandler);
83
+ ```
84
+
85
+ ## Validation
86
+
87
+ ### Request Validation with Zod
88
+
89
+ ```typescript
90
+ import { validateRequest, ValidationPatterns } from '@glow-up/common-shared';
91
+ import { z } from 'zod';
92
+
93
+ // Use predefined patterns
94
+ const loginSchema = {
95
+ body: z.object({
96
+ email: ValidationPatterns.email(),
97
+ password: z.string().min(1),
98
+ }),
99
+ };
100
+
101
+ app.post('/login', validateRequest(loginSchema), (req, res) => {
102
+ // req.body is now validated and typed
103
+ const { email, password } = req.body;
104
+ res.success({ message: 'Login successful' });
105
+ });
106
+
107
+ // Common validation middleware
108
+ import { ValidationMiddleware } from '@glow-up/common-shared';
109
+
110
+ app.post(
111
+ '/register',
112
+ ValidationMiddleware.validateRegistration(),
113
+ (req, res) => {
114
+ // Handles email, password, name validation
115
+ },
116
+ );
117
+ ```
118
+
119
+ ## Response Formatting
120
+
121
+ ### Standardized API Responses
122
+
123
+ ```typescript
124
+ import { ResponseFormatter } from '@glow-up/common-shared';
125
+
126
+ // Success response
127
+ ResponseFormatter.success(res, { user: userData }, 'User created');
128
+ // { success: true, message: 'User created', data: { user: userData }, metadata: { timestamp: ... } }
129
+
130
+ // Error response
131
+ ResponseFormatter.error(res, 'Invalid credentials', 'Login failed', 401);
132
+
133
+ // Paginated response
134
+ ResponseFormatter.paginated(res, users, { page: 1, limit: 10, total: 100 });
135
+
136
+ // Using middleware (adds methods to res object)
137
+ app.use(responseFormatter);
138
+
139
+ app.get('/users', (req, res) => {
140
+ res.success(users, 'Users retrieved');
141
+ res.paginated(users, paginationInfo);
142
+ res.notFound('User not found');
143
+ });
144
+ ```
145
+
146
+ ## Pagination
147
+
148
+ ```typescript
149
+ import { PaginationService, parseSort } from '@glow-up/common-shared';
150
+
151
+ // Parse pagination params
152
+ const pagination = PaginationService.parsePagination({
153
+ page: req.query.page,
154
+ limit: req.query.limit,
155
+ });
156
+
157
+ // For Prisma
158
+ const prismaOptions = PaginationService.toPrisma(pagination, sort);
159
+ const users = await prisma.user.findMany(prismaOptions);
160
+
161
+ // Generate metadata
162
+ const metadata = PaginationService.generateMetadata(
163
+ pagination.page,
164
+ pagination.limit,
165
+ totalUsers,
166
+ );
167
+
168
+ res.paginated(users, metadata);
169
+ ```
170
+
171
+ ## Database Utilities
172
+
173
+ ```typescript
174
+ import { DatabaseService } from '@glow-up/common-shared';
175
+ import { PrismaClient } from '@prisma/client';
176
+
177
+ const prisma = new PrismaClient();
178
+ const dbService = new DatabaseService(prisma);
179
+
180
+ // Health check
181
+ const health = await dbService.healthCheck();
182
+
183
+ // Transactions
184
+ const result = await dbService.withTransaction(async tx => {
185
+ const user = await tx.user.create({ data: userData });
186
+ const profile = await tx.profile.create({
187
+ data: { userId: user.id, ...profileData },
188
+ });
189
+ return { user, profile };
190
+ });
191
+
192
+ // Batch operations
193
+ await dbService.batchCreate('user', userDataArray, 50);
194
+
195
+ // Soft delete
196
+ await dbService.softDelete('user', { id: userId });
197
+ ```
198
+
199
+ ## Password Management
200
+
201
+ ```typescript
202
+ import { PasswordService } from '@glow-up/common-shared';
203
+
204
+ // Hash password
205
+ const hashedPassword = await PasswordService.hashPassword('mypassword');
206
+
207
+ // Compare password
208
+ const isValid = await PasswordService.comparePassword(
209
+ 'mypassword',
210
+ hashedPassword,
211
+ );
212
+
213
+ // Generate secure tokens
214
+ const token = PasswordService.generateSecureToken(32);
215
+ const resetToken = PasswordService.generatePasswordResetToken();
216
+
217
+ // Check password strength
218
+ const strength = PasswordService.checkPasswordStrength('mypassword');
219
+ console.log(strength.isStrong); // boolean
220
+ console.log(strength.feedback); // array of suggestions
221
+ ```
222
+
223
+ ## RabbitMQ Event System
224
+
225
+ ### Quick Start
226
+
227
+ ```typescript
228
+ import {
229
+ Publisher,
230
+ Subscriber,
231
+ Exchanges,
232
+ RoutingKeys,
233
+ UserProfileCreatedEvent,
234
+ } from '@myfoto/common-shared';
235
+ import { Channel } from 'amqplib';
236
+
237
+ // Create a publisher
238
+ export class UserProfileCreatedPublisher extends Publisher<UserProfileCreatedEvent> {
239
+ exchange = Exchanges.UserProfile;
240
+ routingKey = RoutingKeys.UserProfileCreated;
241
+ }
242
+
243
+ // Publish an event
244
+ const publisher = new UserProfileCreatedPublisher(channel);
245
+ await publisher.publish({
246
+ userId: '123',
247
+ name: 'John Doe',
248
+ email: 'john@example.com',
249
+ });
250
+
251
+ // Create a subscriber
252
+ export class UserProfileCreatedSubscriber extends Subscriber<UserProfileCreatedEvent> {
253
+ exchange = Exchanges.UserProfile;
254
+ routingKey = RoutingKeys.UserProfileCreated;
255
+
256
+ async onMessage(
257
+ data: UserProfileCreatedEvent['data'],
258
+ msg: ConsumeMessage,
259
+ ): Promise<void> {
260
+ console.log('User created:', data);
261
+ // Your business logic here
262
+ }
263
+ }
264
+
265
+ // Subscribe to events
266
+ const subscriber = new UserProfileCreatedSubscriber(channel);
267
+ await subscriber.subscribe();
268
+ ```
269
+
270
+ ### Features
271
+
272
+ - ✅ **Type-safe events** - Full TypeScript support with autocomplete
273
+ - ✅ **Centralized definitions** - All events defined in one package
274
+ - ✅ **Consistent naming** - Clear routing key conventions
275
+ - ✅ **Durable queues** - Messages persist across restarts
276
+ - ✅ **Error handling** - Automatic message requeuing on failures
277
+ - ✅ **Documentation** - Comprehensive guides and examples
278
+
279
+ ### Available Events
280
+
281
+ **User Profile**: `UserProfileCreatedEvent`, `UserProfileUpdatedEvent`, `UserProfileDeletedEvent`
282
+
283
+ **Product**: `ProductCreatedEvent`, `ProductUpdatedEvent`, `ProductDeletedEvent`, `ProductStockChangedEvent`
284
+
285
+ **Order**: `OrderCreatedEvent`, `OrderUpdatedEvent`, `OrderCompletedEvent`, `OrderCancelledEvent`
286
+
287
+ ### Routing Key Convention
288
+
289
+ Format: `<service>.<entity>.<action>`
290
+
291
+ Examples:
292
+
293
+ - `user_profile.profile.created`
294
+ - `product.product.updated`
295
+ - `order.order.completed`
296
+
297
+ ### Documentation
298
+
299
+ - 📚 [Full Event System Documentation](src/events/README.md)
300
+ - 📋 [Event Guidelines](EVENT_GUIDELINES.md)
301
+ - 🚀 [Quick Reference](QUICK_REFERENCE.md)
302
+ - 🔄 [Migration Guide](MIGRATION.md)
303
+
304
+ ## Logging
305
+
306
+ ```typescript
307
+ import { Logger, createLogger, requestLogger } from '@myfoto/common-shared';
308
+
309
+ // Use default logger
310
+ import { log } from '@glow-up/common-shared';
311
+
312
+ log.info('Application started');
313
+ log.error('Something went wrong', error, { userId: '123' });
314
+
315
+ // Create custom logger
316
+ const logger = createLogger({
317
+ level: 'debug',
318
+ enableFile: true,
319
+ filePath: './logs/app.log',
320
+ });
321
+
322
+ // Add request logging middleware
323
+ app.use(requestLogger(logger));
324
+
325
+ // Performance logging
326
+ import { timeOperation } from '@glow-up/common-shared';
327
+
328
+ const result = await timeOperation(
329
+ 'database-query',
330
+ () => prisma.user.findMany(),
331
+ logger,
332
+ );
333
+ ```
334
+
335
+ ## Validation Patterns
336
+
337
+ ```typescript
338
+ import { ValidationPatterns } from '@glow-up/common-shared';
339
+
340
+ // Email with normalization
341
+ ValidationPatterns.email();
342
+
343
+ // Strong password requirements
344
+ ValidationPatterns.password();
345
+
346
+ // UUID validation
347
+ ValidationPatterns.uuid();
348
+
349
+ // Pagination parameters
350
+ ValidationPatterns.pagination();
351
+
352
+ // Phone number
353
+ ValidationPatterns.phoneNumber();
354
+
355
+ // Custom enum with case insensitive matching
356
+ ValidationPatterns.enumCaseInsensitive(['ACTIVE', 'INACTIVE']);
357
+ ```
358
+
359
+ ## TypeScript Support
360
+
361
+ This package is built with TypeScript and provides full type definitions. All utilities are properly typed for the best development experience.
362
+
363
+ ```typescript
364
+ // Types are automatically inferred
365
+ import {
366
+ ApiResponse,
367
+ PaginatedResponse,
368
+ LogLevel,
369
+ } from '@glow-up/common-shared';
370
+
371
+ // Extend Express types (automatically included)
372
+ declare global {
373
+ namespace Express {
374
+ interface Request {
375
+ user?: {
376
+ id: string;
377
+ email: string;
378
+ roles?: string[];
379
+ };
380
+ }
381
+ interface Response {
382
+ success: (data?: any, message?: string) => void;
383
+ error: (errors: any, message?: string, statusCode?: number) => void;
384
+ // ... other response methods
385
+ }
386
+ }
387
+ }
388
+ ```
389
+
390
+ ## Peer Dependencies
391
+
392
+ Make sure to install peer dependencies if you're using related features:
393
+
394
+ ```bash
395
+ # For database utilities
396
+ npm install @prisma/client
397
+
398
+ # For logging to files (if using file logging)
399
+ npm install winston
400
+ ```
401
+
402
+ ## Contributing
403
+
404
+ This package is part of the Glow Up microservices ecosystem. When adding new utilities:
405
+
406
+ 1. Follow the existing patterns and TypeScript conventions
407
+ 2. Add proper JSDoc documentation
408
+ 3. Include unit tests
409
+ 4. Update this README with usage examples
410
+
411
+ ## License
412
+
413
+ MIT License - see LICENSE file for details.
414
+
415
+ ## Changelog
416
+
417
+ ### 1.0.0
418
+
419
+ - Initial release with core utilities
420
+ - Error handling system
421
+ - Validation middleware
422
+ - Database utilities
423
+ - Response formatting
424
+ - Pagination helpers
425
+ - Logging system
426
+ - Password management
@@ -28,9 +28,11 @@ export declare enum RoutingKeys {
28
28
  PAYMENT_FAILED = "billing.payment.failed",
29
29
  DOMAIN_PROCESS = "billing.domain.process",// worker: register/transfer/renew
30
30
  DOMAIN_ACTIVATED = "billing.domain.activated",
31
+ DOMAIN_SUBSCRIPTION_CYCLE = "billing.domain.subscription.cycle",// worker: renew domain on annual cycle
31
32
  ORDER_CREATED = "billing.order.created",
32
33
  ORDER_PAID = "billing.order.paid",// worker: kirim email konfirmasi
33
34
  DOMAIN_BYOD_CREATED = "billing.domain.byod.created",
35
+ EMAIL_PROVISION = "billing.email.provision",// worker: provision/renew mailboxes on OpenProvider
34
36
  PROJECT_CREATED = "website.project.created",
35
37
  PROJECT_APPROVED = "website.project.approved",
36
38
  PROJECT_DEPLOYED = "website.project.deployed",
@@ -1 +1 @@
1
- {"version":3,"file":"routing-keys.d.ts","sourceRoot":"","sources":["../../src/events/routing-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,oBAAY,WAAW;IACrB,cAAc,wBAAwB;IACtC,cAAc,wBAAwB;IAEtC,sBAAsB,gCAAgC;IACtD,sBAAsB,gCAAgC;IAEtD,uBAAuB,iCAAiC;IAExD,eAAe,yBAAyB;IAExC,gBAAgB,0BAA0B;IAC1C,gBAAgB,0BAA0B;IAE1C,YAAY,sBAAsB;IAClC,cAAc,wBAAwB;IAEtC,gBAAgB,6BAA6B;IAC7C,mBAAmB,gCAAgC,CAAE,8BAA8B;IACnF,oBAAoB,iCAAiC;IACrD,sBAAsB,mCAAmC;IACzD,qBAAqB,kCAAkC;IACvD,qBAAqB,kCAAkC;IACvD,YAAY,yBAAyB;IACrC,cAAc,2BAA2B;IAEzC,cAAc,2BAA2B,CAAE,kCAAkC;IAC7E,gBAAgB,6BAA6B;IAC7C,aAAa,0BAA0B;IACvC,UAAU,uBAAuB,CAAE,iCAAiC;IACpE,mBAAmB,gCAAgC;IAEnD,eAAe,4BAA4B;IAC3C,gBAAgB,6BAA6B;IAC7C,gBAAgB,6BAA6B;IAC7C,cAAc,2BAA2B;IACzC,gBAAgB,6BAA6B;IAE7C,wBAAwB,qCAAqC;CAC9D"}
1
+ {"version":3,"file":"routing-keys.d.ts","sourceRoot":"","sources":["../../src/events/routing-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,oBAAY,WAAW;IACrB,cAAc,wBAAwB;IACtC,cAAc,wBAAwB;IAEtC,sBAAsB,gCAAgC;IACtD,sBAAsB,gCAAgC;IAEtD,uBAAuB,iCAAiC;IAExD,eAAe,yBAAyB;IAExC,gBAAgB,0BAA0B;IAC1C,gBAAgB,0BAA0B;IAE1C,YAAY,sBAAsB;IAClC,cAAc,wBAAwB;IAEtC,gBAAgB,6BAA6B;IAC7C,mBAAmB,gCAAgC,CAAE,8BAA8B;IACnF,oBAAoB,iCAAiC;IACrD,sBAAsB,mCAAmC;IACzD,qBAAqB,kCAAkC;IACvD,qBAAqB,kCAAkC;IACvD,YAAY,yBAAyB;IACrC,cAAc,2BAA2B;IAEzC,cAAc,2BAA2B,CAAE,kCAAkC;IAC7E,gBAAgB,6BAA6B;IAC7C,yBAAyB,sCAAsC,CAAE,uCAAuC;IACxG,aAAa,0BAA0B;IACvC,UAAU,uBAAuB,CAAE,iCAAiC;IACpE,mBAAmB,gCAAgC;IACnD,eAAe,4BAA4B,CAAE,oDAAoD;IAEjG,eAAe,4BAA4B;IAC3C,gBAAgB,6BAA6B;IAC7C,gBAAgB,6BAA6B;IAC7C,cAAc,2BAA2B;IACzC,gBAAgB,6BAA6B;IAE7C,wBAAwB,qCAAqC;CAC9D"}
@@ -32,9 +32,11 @@ var RoutingKeys;
32
32
  RoutingKeys["PAYMENT_FAILED"] = "billing.payment.failed";
33
33
  RoutingKeys["DOMAIN_PROCESS"] = "billing.domain.process";
34
34
  RoutingKeys["DOMAIN_ACTIVATED"] = "billing.domain.activated";
35
+ RoutingKeys["DOMAIN_SUBSCRIPTION_CYCLE"] = "billing.domain.subscription.cycle";
35
36
  RoutingKeys["ORDER_CREATED"] = "billing.order.created";
36
37
  RoutingKeys["ORDER_PAID"] = "billing.order.paid";
37
38
  RoutingKeys["DOMAIN_BYOD_CREATED"] = "billing.domain.byod.created";
39
+ RoutingKeys["EMAIL_PROVISION"] = "billing.email.provision";
38
40
  RoutingKeys["PROJECT_CREATED"] = "website.project.created";
39
41
  RoutingKeys["PROJECT_APPROVED"] = "website.project.approved";
40
42
  RoutingKeys["PROJECT_DEPLOYED"] = "website.project.deployed";
@@ -1 +1 @@
1
- {"version":3,"file":"routing-keys.js","sourceRoot":"","sources":["../../src/events/routing-keys.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;GAQG;AACH,IAAY,WAuCX;AAvCD,WAAY,WAAW;IACrB,qDAAsC,CAAA;IACtC,qDAAsC,CAAA;IAEtC,qEAAsD,CAAA;IACtD,qEAAsD,CAAA;IAEtD,uEAAwD,CAAA;IAExD,uDAAwC,CAAA;IAExC,yDAA0C,CAAA;IAC1C,yDAA0C,CAAA;IAE1C,iDAAkC,CAAA;IAClC,qDAAsC,CAAA;IAEtC,4DAA6C,CAAA;IAC7C,kEAAmD,CAAA;IACnD,oEAAqD,CAAA;IACrD,wEAAyD,CAAA;IACzD,sEAAuD,CAAA;IACvD,sEAAuD,CAAA;IACvD,oDAAqC,CAAA;IACrC,wDAAyC,CAAA;IAEzC,wDAAyC,CAAA;IACzC,4DAA6C,CAAA;IAC7C,sDAAuC,CAAA;IACvC,gDAAiC,CAAA;IACjC,kEAAmD,CAAA;IAEnD,0DAA2C,CAAA;IAC3C,4DAA6C,CAAA;IAC7C,4DAA6C,CAAA;IAC7C,wDAAyC,CAAA;IACzC,4DAA6C,CAAA;IAE7C,4EAA6D,CAAA;AAC/D,CAAC,EAvCW,WAAW,2BAAX,WAAW,QAuCtB"}
1
+ {"version":3,"file":"routing-keys.js","sourceRoot":"","sources":["../../src/events/routing-keys.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;GAQG;AACH,IAAY,WAyCX;AAzCD,WAAY,WAAW;IACrB,qDAAsC,CAAA;IACtC,qDAAsC,CAAA;IAEtC,qEAAsD,CAAA;IACtD,qEAAsD,CAAA;IAEtD,uEAAwD,CAAA;IAExD,uDAAwC,CAAA;IAExC,yDAA0C,CAAA;IAC1C,yDAA0C,CAAA;IAE1C,iDAAkC,CAAA;IAClC,qDAAsC,CAAA;IAEtC,4DAA6C,CAAA;IAC7C,kEAAmD,CAAA;IACnD,oEAAqD,CAAA;IACrD,wEAAyD,CAAA;IACzD,sEAAuD,CAAA;IACvD,sEAAuD,CAAA;IACvD,oDAAqC,CAAA;IACrC,wDAAyC,CAAA;IAEzC,wDAAyC,CAAA;IACzC,4DAA6C,CAAA;IAC7C,8EAA+D,CAAA;IAC/D,sDAAuC,CAAA;IACvC,gDAAiC,CAAA;IACjC,kEAAmD,CAAA;IACnD,0DAA2C,CAAA;IAE3C,0DAA2C,CAAA;IAC3C,4DAA6C,CAAA;IAC7C,4DAA6C,CAAA;IAC7C,wDAAyC,CAAA;IACzC,4DAA6C,CAAA;IAE7C,4EAA6D,CAAA;AAC/D,CAAC,EAzCW,WAAW,2BAAX,WAAW,QAyCtB"}
@@ -114,7 +114,6 @@ export type SurveyResponseCreatedEvent = {
114
114
  prospectPhone?: string;
115
115
  answers: any;
116
116
  status: string;
117
- source: string;
118
117
  createdAt: Date;
119
118
  updatedAt: Date;
120
119
  };
@@ -1 +1 @@
1
- {"version":3,"file":"auth-events.d.ts","sourceRoot":"","sources":["../../../src/events/types/auth-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C;;GAEG;AAEH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,SAAS,CAAC,WAAW,CAAC;IAChC,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC;IACrC,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,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EAAE,WAAW,CAAC,uBAAuB,CAAC;IAChD,IAAI,EAAE;QACJ,UAAU,EAAE,MAAM,CAAC;QACnB,eAAe,EAAE,MAAM,CAAC;QACxB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,aAAa,EAAE,MAAM,CAAC;QACtB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,OAAO,EAAE,GAAG,CAAC;QAEb,MAAM,EAAE,MAAM,CAAC;QAEf,SAAS,EAAE,IAAI,CAAC;QAChB,SAAS,EAAE,IAAI,CAAC;KACjB,CAAC;CACH,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { Exchanges } from "../exchanges";
2
2
  import { RoutingKeys } from "../routing-keys";
3
3
  export type PlanType = "MONTHLY" | "ANNUAL";
4
+ export type SubscriptionType = "WEBSITE" | "DOMAIN" | "EMAIL";
4
5
  export type DomainMode = "REGISTER" | "TRANSFER" | "RENEW" | "BYOD";
5
6
  export type DomainStatus = "CREATED" | "PENDING_REGISTRATION" | "REGISTERING" | "ACTIVE" | "TRANSFERRING" | "FAILED" | "PENDING_NAMESERVER_UPDATE";
6
7
  export type AddonCode = "PROFESSIONAL_EMAIL" | "INITIAL_DESIGN_FEE";
@@ -22,7 +23,9 @@ export interface SubscriptionCreatedEvent {
22
23
  data: {
23
24
  externalUserId: string;
24
25
  subscriptionId: string;
25
- projectId: string;
26
+ projectId?: string | null;
27
+ subscriptionType?: SubscriptionType;
28
+ domainName?: string;
26
29
  };
27
30
  }
28
31
  export interface SubscriptionActivatedEvent {
@@ -31,7 +34,8 @@ export interface SubscriptionActivatedEvent {
31
34
  data: {
32
35
  externalUserId: string;
33
36
  subscriptionId: string;
34
- projectId: string;
37
+ projectId?: string | null;
38
+ subscriptionType?: SubscriptionType;
35
39
  activatedAt: Date;
36
40
  addons?: AddonItem[];
37
41
  };
@@ -42,7 +46,8 @@ export interface SubscriptionCanceledEvent {
42
46
  data: {
43
47
  externalUserId: string;
44
48
  subscriptionId: string;
45
- projectId: string;
49
+ projectId?: string | null;
50
+ subscriptionType?: SubscriptionType;
46
51
  canceledAt: Date;
47
52
  };
48
53
  }
@@ -57,8 +62,12 @@ export interface InvoicePaidEvent {
57
62
  };
58
63
  }
59
64
  /**
60
- * Dipublish oleh XenditWebhookService saat invoice.paid untuk item WEBSITE_SUBSCRIPTION.
65
+ * Dipublish oleh XenditWebhookService saat invoice.paid untuk item *_SUBSCRIPTION.
61
66
  * Dikonsumsi oleh SubscriptionCreateSubscriber → buat Xendit recurring plan.
67
+ * subscriptionType menentukan branch logic di createPlan():
68
+ * WEBSITE → website plan (projectId required)
69
+ * DOMAIN → annual domain plan (projectId optional, domainName required)
70
+ * EMAIL → email mailbox plan (projectId null, domainName + emailQuantity required)
62
71
  */
63
72
  export interface SubscriptionCreateEvent {
64
73
  exchange: Exchanges.PaymentService;
@@ -66,12 +75,45 @@ export interface SubscriptionCreateEvent {
66
75
  data: {
67
76
  orderId: string;
68
77
  externalUserId: string;
69
- projectId: string;
78
+ projectId?: string | null;
70
79
  planType: PlanType;
71
80
  email: string;
72
81
  name?: string;
73
82
  paymentTokenId?: string | null;
74
83
  addons?: AddonItem[];
84
+ subscriptionType?: SubscriptionType;
85
+ domainName?: string;
86
+ emailQuantity?: number;
87
+ };
88
+ }
89
+ /**
90
+ * Dipublish setelah EMAIL subscription berhasil dibuat di Xendit.
91
+ * Dikonsumsi oleh EmailProvisionSubscriber → provision mailbox di OpenProvider.
92
+ */
93
+ export interface EmailProvisionEvent {
94
+ exchange: Exchanges.PaymentService;
95
+ routingKey: RoutingKeys.EMAIL_PROVISION;
96
+ data: {
97
+ subscriptionId: string;
98
+ externalUserId: string;
99
+ domainName: string;
100
+ quantity: number;
101
+ planType: PlanType;
102
+ orderId?: string;
103
+ };
104
+ }
105
+ /**
106
+ * Dipublish oleh XenditWebhookService saat recurring cycle DOMAIN subscription berhasil dibayar.
107
+ * Dikonsumsi oleh DomainSubscriptionCycleSubscriber → renew domain di RNA.
108
+ */
109
+ export interface DomainSubscriptionCycleEvent {
110
+ exchange: Exchanges.PaymentService;
111
+ routingKey: RoutingKeys.DOMAIN_SUBSCRIPTION_CYCLE;
112
+ data: {
113
+ subscriptionId: string;
114
+ domainName: string;
115
+ rnaCustomerId: number;
116
+ years: number;
75
117
  };
76
118
  }
77
119
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"billing-events.d.ts","sourceRoot":"","sources":["../../../src/events/types/billing-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;AAC5C,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,CAAC;AACpE,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,sBAAsB,GACtB,aAAa,GACb,QAAQ,GACR,cAAc,GACd,QAAQ,GACR,2BAA2B,CAAC;AAChC,MAAM,MAAM,SAAS,GAAG,oBAAoB,GAAG,oBAAoB,CAAC;AAEpE,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AACD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,SAAS,CAAC,cAAc,CAAC;IACnC,UAAU,EAAE,WAAW,CAAC,gBAAgB,CAAC;IACzC,IAAI,EAAE;QACJ,UAAU,EAAE,MAAM,CAAC;QACnB,cAAc,EAAE,MAAM,CAAC;KACxB,CAAC;CACH;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,SAAS,CAAC,cAAc,CAAC;IACnC,UAAU,EAAE,WAAW,CAAC,oBAAoB,CAAC;IAC7C,IAAI,EAAE;QACJ,cAAc,EAAE,MAAM,CAAC;QACvB,cAAc,EAAE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,QAAQ,EAAE,SAAS,CAAC,cAAc,CAAC;IACnC,UAAU,EAAE,WAAW,CAAC,aAAa,CAAC;IACtC,IAAI,EAAE;QACJ,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE,MAAM,CAAC;QACpB,cAAc,EAAE,MAAM,CAAC;QACvB,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH"}
package/package.json CHANGED
@@ -1,68 +1,68 @@
1
- {
2
- "name": "@easyweb/rabbitmq-utils",
3
- "version": "1.0.17",
4
- "description": "Common utilities and middleware for Easyweb microservices architecture",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "exports": {
8
- ".": {
9
- "require": "./dist/index.js",
10
- "import": "./dist/index.js",
11
- "types": "./dist/index.d.ts"
12
- }
13
- },
14
- "files": [
15
- "dist",
16
- "README.md"
17
- ],
18
- "scripts": {
19
- "build": "tsc",
20
- "build:watch": "tsc --watch",
21
- "prepublishOnly": "npm run build",
22
- "clean": "rimraf dist",
23
- "test": "jest",
24
- "test:watch": "jest --watch",
25
- "test:coverage": "jest --coverage",
26
- "lint": "eslint src/**/*.ts",
27
- "lint:fix": "eslint src/**/*.ts --fix"
28
- },
29
- "keywords": [
30
- "microservices",
31
- "express",
32
- "middleware",
33
- "validation",
34
- "authentication",
35
- "error-handling",
36
- "utilities"
37
- ],
38
- "author": "Easy Web Team",
39
- "license": "MIT",
40
- "repository": {
41
- "type": "git",
42
- "url": "https://github.com/Alpine-Solusi/website-builder.git",
43
- "directory": "server/common-shared"
44
- },
45
- "dependencies": {
46
- "amqplib": "^0.10.9",
47
- "pino": "^10.3.1"
48
- },
49
- "devDependencies": {
50
- "@types/amqplib": "^0.10.8",
51
- "@types/express": "^5.0.6",
52
- "@types/jest": "^29.5.14",
53
- "@types/node": "^25.2.3",
54
- "@typescript-eslint/eslint-plugin": "^8.56.1",
55
- "@typescript-eslint/parser": "^8.56.1",
56
- "eslint": "^8.50.0",
57
- "jest": "^29.7.0",
58
- "rimraf": "^5.0.5",
59
- "ts-jest": "^29.1.1",
60
- "typescript": "^5.9.3"
61
- },
62
- "engines": {
63
- "node": ">=18.0.0"
64
- },
65
- "publishConfig": {
66
- "access": "public"
67
- }
68
- }
1
+ {
2
+ "name": "@easyweb/rabbitmq-utils",
3
+ "version": "1.0.18",
4
+ "description": "Common utilities and middleware for Easyweb microservices architecture",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "require": "./dist/index.js",
10
+ "import": "./dist/index.js",
11
+ "types": "./dist/index.d.ts"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "README.md"
17
+ ],
18
+ "scripts": {
19
+ "build": "tsc",
20
+ "build:watch": "tsc --watch",
21
+ "prepublishOnly": "npm run build",
22
+ "clean": "rimraf dist",
23
+ "test": "jest",
24
+ "test:watch": "jest --watch",
25
+ "test:coverage": "jest --coverage",
26
+ "lint": "eslint src/**/*.ts",
27
+ "lint:fix": "eslint src/**/*.ts --fix"
28
+ },
29
+ "keywords": [
30
+ "microservices",
31
+ "express",
32
+ "middleware",
33
+ "validation",
34
+ "authentication",
35
+ "error-handling",
36
+ "utilities"
37
+ ],
38
+ "author": "Easy Web Team",
39
+ "license": "MIT",
40
+ "repository": {
41
+ "type": "git",
42
+ "url": "https://github.com/ibad-myfoto/glow-up.git",
43
+ "directory": "main-app/common-shared"
44
+ },
45
+ "dependencies": {
46
+ "amqplib": "^0.10.9",
47
+ "pino": "^10.3.1"
48
+ },
49
+ "devDependencies": {
50
+ "@types/amqplib": "^0.10.8",
51
+ "@types/express": "^5.0.6",
52
+ "@types/jest": "^29.5.14",
53
+ "@types/node": "^25.2.3",
54
+ "@typescript-eslint/eslint-plugin": "^8.56.1",
55
+ "@typescript-eslint/parser": "^8.56.1",
56
+ "eslint": "^8.50.0",
57
+ "jest": "^29.7.0",
58
+ "rimraf": "^5.0.5",
59
+ "ts-jest": "^29.1.1",
60
+ "typescript": "^5.9.3"
61
+ },
62
+ "engines": {
63
+ "node": ">=18.0.0"
64
+ },
65
+ "publishConfig": {
66
+ "access": "public"
67
+ }
68
+ }