@common-stack/store-mongo 7.2.1-alpha.31 → 7.2.1-alpha.32

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.
@@ -1,656 +0,0 @@
1
- import {Moleculer}from'./moleculerEventHandler.js';import {getAllMethodNames}from'./serviceGenerationUtils.js';// from package: store-mongo
2
- /**
3
- * @file typed-moleculer-service.ts
4
- * @description Provides type-safe base class for Moleculer services with ENFORCED
5
- * compile-time verification AND automatic action generation from service methods.
6
- */
7
- /**
8
- * Split parameters by comma, respecting nested structures
9
- */
10
- function splitParams(paramsStr) {
11
- const params = [];
12
- let current = '';
13
- let depth = 0;
14
- for (let i = 0; i < paramsStr.length; i++) {
15
- const char = paramsStr[i];
16
- if (char === '<' || char === '{' || char === '[' || char === '(') {
17
- depth++;
18
- current += char;
19
- }
20
- else if (char === '>' || char === '}' || char === ']' || char === ')') {
21
- depth--;
22
- current += char;
23
- }
24
- else if (char === ',' && depth === 0) {
25
- params.push(current);
26
- current = '';
27
- }
28
- else {
29
- current += char;
30
- }
31
- }
32
- if (current) {
33
- params.push(current);
34
- }
35
- return params;
36
- }
37
- /**
38
- * Infer Moleculer validator type from TypeScript type annotation
39
- */
40
- function inferMoleculerType(typeAnnotation) {
41
- const type = typeAnnotation.trim();
42
- // Check for array types
43
- if (type.endsWith('[]') || type.startsWith('Array<') || type.startsWith('ReadonlyArray<')) {
44
- return 'array';
45
- }
46
- // Check for primitive types
47
- if (type === 'string' || type === 'String')
48
- return 'string';
49
- if (type === 'number' || type === 'Number')
50
- return 'number';
51
- if (type === 'boolean' || type === 'Boolean')
52
- return 'boolean';
53
- // Check for common built-in types
54
- if (type === 'Date')
55
- return 'date';
56
- if (type === 'RegExp')
57
- return 'object';
58
- // Check for union types with primitive
59
- if (type.includes('|')) {
60
- const types = type.split('|').map(t => t.trim());
61
- // If all types are same primitive, return that
62
- const nonNullTypes = types.filter(t => t !== 'null' && t !== 'undefined');
63
- if (nonNullTypes.length === 1) {
64
- return inferMoleculerType(nonNullTypes[0]);
65
- }
66
- // If contains string, number, or boolean, try to infer
67
- if (nonNullTypes.some(t => t === 'string'))
68
- return 'string';
69
- if (nonNullTypes.some(t => t === 'number'))
70
- return 'number';
71
- if (nonNullTypes.some(t => t === 'boolean'))
72
- return 'boolean';
73
- }
74
- // Check for enum types (assume string enum)
75
- if (type.includes('Enum') || type.includes('Type')) {
76
- return 'string';
77
- }
78
- // Default to object for interfaces, types, classes, etc.
79
- return 'object';
80
- }
81
- /**
82
- * Infer type from default value
83
- */
84
- function inferTypeFromDefault(defaultValue) {
85
- // String defaults
86
- if (defaultValue.startsWith("'") || defaultValue.startsWith('"') || defaultValue.startsWith('`')) {
87
- return 'string';
88
- }
89
- // Number defaults
90
- if (/^-?\d+(\.\d+)?$/.test(defaultValue)) {
91
- return 'number';
92
- }
93
- // Boolean defaults
94
- if (defaultValue === 'true' || defaultValue === 'false') {
95
- return 'boolean';
96
- }
97
- // Array defaults
98
- if (defaultValue.startsWith('[')) {
99
- return 'array';
100
- }
101
- // Object defaults
102
- if (defaultValue.startsWith('{')) {
103
- return 'object';
104
- }
105
- return 'object';
106
- }
107
- /**
108
- * Extract parameter names and infer types from a function's string representation
109
- * Returns array of { name, type } where type is the inferred Moleculer validator
110
- */
111
- function extractParamsWithTypes(funcStr) {
112
- // Match function parameters: function(a, b) or (a, b) => or async (a, b) =>
113
- const match = funcStr.match(/(?:function\s*)?(?:\w+\s*)?\(([^)]*)\)/);
114
- if (!match || !match[1])
115
- return [];
116
- const paramsStr = match[1].trim();
117
- if (!paramsStr)
118
- return [];
119
- const params = [];
120
- // Split by comma, but handle nested objects/arrays
121
- const paramParts = splitParams(paramsStr);
122
- paramParts.forEach(param => {
123
- const trimmed = param.trim();
124
- if (!trimmed)
125
- return;
126
- // Check if optional (has ?)
127
- const optional = trimmed.includes('?');
128
- // Extract parameter name and type annotation
129
- // Patterns: "name", "name?", "name: Type", "name?: Type", "name = default"
130
- const paramMatch = trimmed.match(/^(\w+)\??(?:\s*:\s*([^=]+))?(?:\s*=\s*(.+))?/);
131
- if (!paramMatch)
132
- return;
133
- const name = paramMatch[1];
134
- const typeAnnotation = paramMatch[2]?.trim();
135
- const defaultValue = paramMatch[3]?.trim();
136
- // Infer Moleculer type from TypeScript annotation or default value
137
- let moleculerType = 'object'; // Safe default
138
- if (typeAnnotation) {
139
- moleculerType = inferMoleculerType(typeAnnotation);
140
- }
141
- else if (defaultValue) {
142
- moleculerType = inferTypeFromDefault(defaultValue);
143
- }
144
- params.push({
145
- name,
146
- type: moleculerType,
147
- optional: optional || !!defaultValue,
148
- });
149
- });
150
- return params;
151
- }
152
- // getAllMethodNames is now imported from serviceGenerationUtils.ts for consistency
153
- /**
154
- * ADVANCED AUTO-GENERATED: Generate actions with full control over inclusion, exclusion, and overrides.
155
- * Params are inferred from TypeScript function signatures with optional fine-grained control.
156
- *
157
- * @param service - The service instance to wrap
158
- * @param config - Advanced configuration for fine-grained control
159
- * @returns Actions object with handlers for selected service methods
160
- *
161
- * @example
162
- * ```typescript
163
- * // Basic: Auto-generate all methods
164
- * const actions = generateAutoInferredServiceActions<IAccountService>(accountService);
165
- *
166
- * // Advanced: Include only specific methods
167
- * const actions = generateAutoInferredServiceActions<IAccountService>(accountService, {
168
- * include: ['findAccountById', 'createAccount', 'updateAccount']
169
- * });
170
- *
171
- * // Advanced: Exclude specific methods
172
- * const actions = generateAutoInferredServiceActions<IAccountService>(accountService, {
173
- * exclude: ['deleteAccount', 'internalMethod']
174
- * });
175
- *
176
- * // Advanced: Override param schemas for specific methods
177
- * const actions = generateAutoInferredServiceActions<IAccountService>(accountService, {
178
- * paramOverrides: {
179
- * findAccountById: { id: 'string' },
180
- * getUsers: { where: { type: 'object', optional: true } }
181
- * }
182
- * });
183
- *
184
- * // Advanced: Add custom action configuration
185
- * const actions = generateAutoInferredServiceActions<IAccountService>(accountService, {
186
- * actionConfig: {
187
- * findAccountById: { cache: true, visibility: 'public' },
188
- * deleteAccount: { visibility: 'protected' }
189
- * }
190
- * });
191
- *
192
- * // Advanced: Combine multiple options
193
- * const actions = generateAutoInferredServiceActions<IAccountService>(accountService, {
194
- * include: ['findAccountById', 'createAccount'],
195
- * paramOverrides: {
196
- * findAccountById: { id: 'string' }
197
- * },
198
- * actionConfig: {
199
- * findAccountById: { cache: true }
200
- * }
201
- * });
202
- * ```
203
- */
204
- function generateAutoInferredServiceActions(service, config = {}) {
205
- const { paramOverrides = {}, include, exclude = [], actionToMethodMap = {}, actionConfig = {} } = config;
206
- const actions = {};
207
- // Get all methods from the service, including inherited methods from parent classes
208
- const allKeys = getAllMethodNames(service);
209
- allKeys.forEach((key) => {
210
- // Skip constructor and private methods
211
- if (key === 'constructor' || key.startsWith('_')) {
212
- return;
213
- }
214
- // Apply include filter (whitelist) - takes precedence
215
- if (include && include.length > 0) {
216
- if (!include.includes(key)) {
217
- return;
218
- }
219
- }
220
- // Apply exclude filter (blacklist) - only if include is not specified
221
- else if (exclude.includes(key)) {
222
- return;
223
- }
224
- const method = service[key];
225
- if (typeof method !== 'function') {
226
- return;
227
- }
228
- const methodName = actionToMethodMap[key] || key;
229
- const serviceMethod = service[methodName];
230
- if (typeof serviceMethod !== 'function') {
231
- return;
232
- }
233
- // Use runtime reflection to infer params and types from function signature
234
- const funcStr = serviceMethod.toString();
235
- const paramsWithTypes = extractParamsWithTypes(funcStr);
236
- // Build param schema
237
- let paramSchema;
238
- // Use override if provided
239
- if (paramOverrides[key]) {
240
- paramSchema = paramOverrides[key];
241
- }
242
- else if (paramsWithTypes.length > 0) {
243
- // Auto-generate schema from inferred types
244
- paramSchema = paramsWithTypes.reduce((acc, param) => {
245
- if (param.optional) {
246
- acc[param.name] = { type: param.type, optional: true };
247
- }
248
- else {
249
- acc[param.name] = param.type;
250
- }
251
- return acc;
252
- }, {});
253
- }
254
- // Get custom action configuration if provided
255
- const customActionConfig = actionConfig[key];
256
- // Build the action object
257
- const action = {
258
- ...(paramSchema ? { params: paramSchema } : {}),
259
- handler: (ctx) => {
260
- const method = service[methodName];
261
- const paramsObj = ctx.params || {};
262
- const values = Object.values(paramsObj);
263
- return method.apply(service, values.length > 0 ? values : [paramsObj]);
264
- },
265
- };
266
- // Merge custom action config if provided (cache, visibility, etc.)
267
- if (customActionConfig) {
268
- Object.assign(action, customActionConfig);
269
- }
270
- actions[key] = action;
271
- });
272
- return actions;
273
- }
274
- /**
275
- * Generate both actions AND events from a service instance
276
- * - Actions: Generated from regular service methods
277
- * - Events: Generated from methods marked with @MoleculerEventHandler decorator
278
- *
279
- * @param service - The service instance to wrap
280
- * @param config - Configuration for actions and events
281
- * @returns Object with both actions and events
282
- *
283
- * @example
284
- * ```typescript
285
- * // Service with decorator
286
- * class OrganizationService {
287
- * // Regular method becomes action
288
- * async createOrganization(org: Org): Promise<Org> { }
289
- *
290
- * // Decorated method becomes event handler
291
- * @MoleculerEventHandler(UserBroadcasterAction.OnUserCreated)
292
- * async onUserCreated(event: UserEvent): Promise<void> { }
293
- * }
294
- *
295
- * // Generate both
296
- * const { actions, events } = generateServiceActionsAndEvents(service);
297
- * ```
298
- */
299
- function generateServiceActionsAndEvents(service, config = {}) {
300
- // Get event handlers from decorator metadata
301
- const eventHandlers = Moleculer.getEventHandlers(service);
302
- const eventHandlerMethods = new Set(eventHandlers.map(h => h.methodName));
303
- // Generate actions (excluding event handler methods)
304
- const actionsConfig = {
305
- ...config,
306
- exclude: [
307
- ...(config.exclude || []),
308
- ...Array.from(eventHandlerMethods),
309
- ],
310
- };
311
- const actions = generateAutoInferredServiceActions(service, actionsConfig);
312
- // Generate events from decorated methods
313
- const events = {};
314
- eventHandlers.forEach((metadata) => {
315
- const method = service[metadata.methodName];
316
- if (typeof method === 'function') {
317
- events[metadata.eventName] = {
318
- handler: async (ctx) => {
319
- // Event payload is typically wrapped in ctx.params.event
320
- const eventData = ctx.params.event || ctx.params;
321
- return method.call(service, eventData);
322
- },
323
- ...(metadata.group ? { group: metadata.group } : {}),
324
- };
325
- }
326
- });
327
- return { actions, events };
328
- }
329
- /**
330
- * Automatically generate Moleculer actions from a service instance.
331
- *
332
- * This eliminates the need to write repetitive action handlers - just pass your service
333
- * and it will create handlers that forward all calls automatically.
334
- *
335
- * @param service - The service instance to wrap
336
- * @param config - Optional configuration for customizing actions
337
- * @returns Actions object with handlers for all service methods
338
- *
339
- * @example
340
- * ```typescript
341
- * const actions = generateServiceActions(accountService, {
342
- * params: {
343
- * findAccountById: { id: 'string' },
344
- * createAccount: { account: 'object' }
345
- * },
346
- * exclude: ['get', 'getAll'] // Handle these manually
347
- * });
348
- * ```
349
- */
350
- function generateServiceActions(service, config = {}) {
351
- const { params = {}, exclude = [], actionToMethodMap = {} } = config;
352
- const actions = {};
353
- // Get all methods from the service
354
- const allKeys = Object.getOwnPropertyNames(Object.getPrototypeOf(service));
355
- const generatedMethods = [];
356
- allKeys.forEach((key) => {
357
- // Skip excluded methods, constructors, and private methods
358
- if (exclude.includes(key) || key === 'constructor' || key.startsWith('_')) {
359
- return;
360
- }
361
- const method = service[key];
362
- // Only process functions
363
- if (typeof method !== 'function') {
364
- return;
365
- }
366
- // Determine the method name to call (in case of mapping)
367
- const methodName = actionToMethodMap[key] || key;
368
- const serviceMethod = service[methodName];
369
- if (typeof serviceMethod !== 'function') {
370
- return;
371
- }
372
- generatedMethods.push(key);
373
- // Create the action handler
374
- actions[key] = {
375
- ...(params[key] ? { params: params[key] } : {}),
376
- handler: (ctx) => {
377
- // Call the service method with ctx.params spread as arguments
378
- const method = service[methodName];
379
- // If params is an object with known keys, extract them in order
380
- // Otherwise, pass the whole params object
381
- const paramsObj = ctx.params || {};
382
- const values = Object.values(paramsObj);
383
- return method.apply(service, values.length > 0 ? values : [paramsObj]);
384
- },
385
- };
386
- });
387
- // In development, log methods that don't have param validation
388
- if (process.env.NODE_ENV !== 'production') {
389
- const methodsWithoutParams = generatedMethods.filter(method => !params[method]);
390
- if (methodsWithoutParams.length > 0) {
391
- console.warn(`⚠️ [generateServiceActions] The following methods don't have param validation defined:`, methodsWithoutParams);
392
- }
393
- }
394
- return actions;
395
- }
396
- /**
397
- * TYPE-SAFE version: Generate Moleculer actions with COMPILE-TIME verification.
398
- * TypeScript will error if any service method is missing from params.
399
- *
400
- * @param service - The service instance to wrap
401
- * @param config - Type-safe configuration requiring ALL methods to have params
402
- * @returns Actions object with handlers for all service methods
403
- *
404
- * @example
405
- * ```typescript
406
- * const actions = generateTypeSafeServiceActions<IAccountService>(accountService, {
407
- * params: {
408
- * // TypeScript enforces ALL IAccountService methods are here!
409
- * findAccountById: { id: 'string' },
410
- * createAccount: { account: 'object' },
411
- * // ... if you forget any method, TypeScript will error
412
- * }
413
- * });
414
- * ```
415
- */
416
- function generateTypeSafeServiceActions(service, config) {
417
- // Delegate to the regular function - type checking happens at compile time
418
- return generateServiceActions(service, config);
419
- }
420
- /**
421
- * Verify that all service methods have param validation defined.
422
- * Throws an error if any methods are missing params.
423
- *
424
- * Use this in development to ensure you haven't forgotten any param schemas.
425
- *
426
- * @param service - The service instance
427
- * @param config - The config used for generateServiceActions
428
- * @throws Error if any methods are missing param validation
429
- *
430
- * @example
431
- * ```typescript
432
- * const config = { params: { ... }, exclude: [...] };
433
- * verifyAllParamsDefined(accountService, config); // Throws if params missing
434
- * const actions = generateServiceActions(accountService, config);
435
- * ```
436
- */
437
- function verifyAllParamsDefined(service, config = {}) {
438
- const { params = {}, exclude = [] } = config;
439
- const allKeys = Object.getOwnPropertyNames(Object.getPrototypeOf(service));
440
- const missingParams = [];
441
- allKeys.forEach((key) => {
442
- // Skip excluded methods, constructors, and private methods
443
- if (exclude.includes(key) || key === 'constructor' || key.startsWith('_')) {
444
- return;
445
- }
446
- const method = service[key];
447
- // Only check functions
448
- if (typeof method !== 'function') {
449
- return;
450
- }
451
- // Check if params defined
452
- if (!params[key]) {
453
- missingParams.push(key);
454
- }
455
- });
456
- if (missingParams.length > 0) {
457
- const errorMessage = [
458
- `Missing param validation for methods: ${missingParams.join(', ')}`,
459
- '',
460
- 'Add these to your params config:',
461
- ...missingParams.map(method => ` ${method}: { /* your params */ },`),
462
- ].join('\n');
463
- throw new Error(errorMessage);
464
- }
465
- }
466
- /**
467
- * Helper to create a typed action handler
468
- */
469
- function createTypedAction(action) {
470
- return action;
471
- }
472
- /**
473
- * DEBUG UTILITY: Dumps parameter information for all service methods
474
- *
475
- * This function extracts and logs parameter names, types, and inferred schemas
476
- * for debugging auto-generation issues. Use during development to understand
477
- * what the auto-generation sees and optimize paramOverrides.
478
- *
479
- * @param service - The service instance to analyze
480
- * @param config - Optional configuration to see what would be generated
481
- * @returns Object with detailed parameter information for each method
482
- *
483
- * @example
484
- * ```typescript
485
- * // In development/debug mode
486
- * const paramInfo = Moleculer.debugServiceParams(accountService);
487
- * console.log(JSON.stringify(paramInfo, null, 2));
488
- *
489
- * // With config to see filtered results
490
- * const paramInfo = Moleculer.debugServiceParams(accountService, {
491
- * exclude: ['dispose', 'createUserToken']
492
- * });
493
- * ```
494
- */
495
- function debugServiceParams(service, config = {}) {
496
- const { paramOverrides = {}, include, exclude = [], } = config;
497
- const result = {};
498
- // Get all methods from the service, including inherited methods
499
- const allKeys = getAllMethodNames(service);
500
- // Get event handler methods
501
- const eventHandlers = Moleculer.getEventHandlers(service);
502
- const eventHandlerMethods = new Set(eventHandlers.map(h => h.methodName));
503
- allKeys.forEach((key) => {
504
- // Skip constructor and private methods
505
- if (key === 'constructor' || key.startsWith('_')) {
506
- return;
507
- }
508
- const method = service[key];
509
- if (typeof method !== 'function') {
510
- return;
511
- }
512
- // Determine if this method would be excluded
513
- const isEventHandler = eventHandlerMethods.has(key);
514
- let isExcluded = false;
515
- if (include && include.length > 0) {
516
- isExcluded = !include.includes(key);
517
- }
518
- else {
519
- isExcluded = exclude.includes(key) || isEventHandler;
520
- }
521
- // Get function signature
522
- const funcStr = method.toString();
523
- const paramsWithTypes = extractParamsWithTypes(funcStr);
524
- // Extract just the function signature (first line with params)
525
- const signatureMatch = funcStr.match(/^(?:async\s+)?(?:function\s+)?(?:\w+\s*)?\(([^)]*)\)/);
526
- const signature = signatureMatch ? signatureMatch[0] : funcStr.split('{')[0].trim();
527
- // Build inferred schema using new type inference
528
- let inferredSchema;
529
- if (paramsWithTypes.length > 0) {
530
- inferredSchema = paramsWithTypes.reduce((acc, param) => {
531
- if (param.optional) {
532
- acc[param.name] = { type: param.type, optional: true };
533
- }
534
- else {
535
- acc[param.name] = param.type;
536
- }
537
- return acc;
538
- }, {});
539
- }
540
- // Get override schema if provided
541
- const overrideSchema = paramOverrides[key];
542
- result[key] = {
543
- methodName: key,
544
- paramNames: paramsWithTypes.map(p => p.name),
545
- functionSignature: signature,
546
- inferredSchema,
547
- overrideSchema,
548
- isExcluded,
549
- isEventHandler,
550
- };
551
- });
552
- return result;
553
- }
554
- /**
555
- * DEBUG UTILITY: Pretty prints service parameter information to console
556
- *
557
- * Formats and logs the output of debugServiceParams() in a readable way.
558
- * Shows which methods need paramOverrides and what types are inferred.
559
- *
560
- * @param service - The service instance to analyze
561
- * @param config - Optional configuration
562
- * @param options - Display options
563
- *
564
- * @example
565
- * ```typescript
566
- * // Print all methods
567
- * Moleculer.printServiceParams(accountService);
568
- *
569
- * // Print only methods without overrides
570
- * Moleculer.printServiceParams(accountService, config, { onlyMissingOverrides: true });
571
- *
572
- * // Print only included methods
573
- * Moleculer.printServiceParams(accountService, config, { onlyIncluded: true });
574
- * ```
575
- */
576
- function printServiceParams(service, config = {}, options = {}) {
577
- const paramInfo = debugServiceParams(service, config);
578
- const methods = Object.values(paramInfo);
579
- const separator = '='.repeat(80);
580
- const dashedLine = '-'.repeat(80);
581
- console.log(`\n${separator}`);
582
- console.log('SERVICE PARAMETER DEBUG INFORMATION');
583
- console.log(`${separator}\n`);
584
- // Summary statistics
585
- const totalMethods = methods.length;
586
- const includedMethods = methods.filter(m => !m.isExcluded);
587
- const eventHandlers = methods.filter(m => m.isEventHandler);
588
- const withOverrides = methods.filter(m => m.overrideSchema);
589
- const withoutOverrides = includedMethods.filter(m => !m.overrideSchema && !m.isExcluded);
590
- console.log('📊 SUMMARY:');
591
- console.log(` Total methods found: ${totalMethods}`);
592
- console.log(` Included in actions: ${includedMethods.length}`);
593
- console.log(` Event handlers (excluded from actions): ${eventHandlers.length}`);
594
- console.log(` With param overrides: ${withOverrides.length}`);
595
- console.log(` Without param overrides: ${withoutOverrides.length}`);
596
- console.log(`\n${dashedLine}\n`);
597
- // Filter methods based on options
598
- let displayMethods = methods;
599
- if (options.onlyMissingOverrides) {
600
- displayMethods = displayMethods.filter(m => !m.overrideSchema && !m.isExcluded);
601
- }
602
- if (options.onlyIncluded) {
603
- displayMethods = displayMethods.filter(m => !m.isExcluded);
604
- }
605
- if (!options.showExcluded) {
606
- displayMethods = displayMethods.filter(m => !m.isExcluded);
607
- }
608
- // Print each method
609
- displayMethods.forEach((info, index) => {
610
- let status;
611
- if (info.isExcluded) {
612
- status = '❌ EXCLUDED';
613
- }
614
- else if (info.isEventHandler) {
615
- status = '📡 EVENT HANDLER';
616
- }
617
- else if (info.overrideSchema) {
618
- status = '✅ HAS OVERRIDE';
619
- }
620
- else {
621
- status = '⚠️ NEEDS OVERRIDE';
622
- }
623
- console.log(`${index + 1}. ${info.methodName} ${status}`);
624
- console.log(` Signature: ${info.functionSignature}`);
625
- console.log(` Parameters: [${info.paramNames.join(', ')}]`);
626
- if (info.inferredSchema) {
627
- console.log(` Inferred: ${JSON.stringify(info.inferredSchema)}`);
628
- }
629
- if (info.overrideSchema) {
630
- console.log(` Override: ${JSON.stringify(info.overrideSchema)}`);
631
- }
632
- console.log('');
633
- });
634
- // Suggestions
635
- if (withoutOverrides.length > 0 && !options.onlyMissingOverrides) {
636
- console.log(`\n${separator}`);
637
- console.log('💡 SUGGESTIONS:');
638
- console.log(`${separator}\n`);
639
- console.log('The following methods use default "object" validation:');
640
- console.log('Consider adding paramOverrides for better type safety:\n');
641
- const suggestions = [];
642
- withoutOverrides.forEach(info => {
643
- const params = info.paramNames.map(p => `${p}: 'string'`).join(', ');
644
- suggestions.push(` ${info.methodName}: { ${params} },`);
645
- });
646
- console.log('paramOverrides: {');
647
- console.log(suggestions.join('\n'));
648
- console.log('}');
649
- }
650
- console.log(`\n${separator}\n`);
651
- }
652
- // Implement the namespace extensions
653
- Moleculer.generateAutoInferredActions = generateAutoInferredServiceActions;
654
- Moleculer.generateActionsAndEvents = generateServiceActionsAndEvents;
655
- Moleculer.debugServiceParams = debugServiceParams;
656
- Moleculer.printServiceParams = printServiceParams;export{createTypedAction,debugServiceParams,generateAutoInferredServiceActions,generateServiceActions,generateServiceActionsAndEvents,generateTypeSafeServiceActions,printServiceParams,verifyAllParamsDefined};//# sourceMappingURL=typedMoleculerService.js.map