@venizia/ignis-docs 0.2.0 → 0.2.1-1
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 +14 -14
- package/content/best-practices/api-usage-examples.md +39 -19
- package/content/best-practices/architectural-patterns.md +24 -13
- package/content/best-practices/architecture-decisions.md +29 -16
- package/content/best-practices/code-style-standards/advanced-patterns.md +43 -31
- package/content/best-practices/code-style-standards/constants-configuration.md +19 -4
- package/content/best-practices/code-style-standards/control-flow.md +33 -1
- package/content/best-practices/code-style-standards/documentation.md +28 -8
- package/content/best-practices/code-style-standards/function-patterns.md +15 -4
- package/content/best-practices/code-style-standards/index.md +7 -2
- package/content/best-practices/code-style-standards/naming-conventions.md +27 -3
- package/content/best-practices/code-style-standards/route-definitions.md +9 -5
- package/content/best-practices/code-style-standards/tooling.md +14 -1
- package/content/best-practices/code-style-standards/type-safety.md +39 -6
- package/content/best-practices/common-pitfalls.md +59 -35
- package/content/best-practices/contribution-workflow.md +8 -4
- package/content/best-practices/data-modeling.md +78 -62
- package/content/best-practices/deployment-strategies.md +56 -19
- package/content/best-practices/error-handling.md +247 -153
- package/content/best-practices/index.md +6 -0
- package/content/best-practices/performance-optimization.md +26 -13
- package/content/best-practices/security-guidelines.md +35 -9
- package/content/best-practices/testing-strategies.md +7 -2
- package/content/best-practices/troubleshooting-tips.md +27 -17
- package/content/extensions/components/api-reference.md +109 -323
- package/content/extensions/components/authentication/api.md +489 -602
- package/content/extensions/components/authentication/errors.md +135 -498
- package/content/extensions/components/authentication/index.md +89 -801
- package/content/extensions/components/authentication/usage.md +231 -955
- package/content/extensions/components/authorization/api.md +991 -644
- package/content/extensions/components/authorization/errors.md +204 -208
- package/content/extensions/components/authorization/getting-started.md +227 -0
- package/content/extensions/components/authorization/index.md +88 -795
- package/content/extensions/components/authorization/usage.md +219 -528
- package/content/extensions/components/health-check.md +77 -243
- package/content/extensions/components/index.md +24 -90
- package/content/extensions/components/mail/api.md +553 -285
- package/content/extensions/components/mail/errors.md +76 -62
- package/content/extensions/components/mail/index.md +111 -463
- package/content/extensions/components/mail/usage.md +139 -173
- package/content/extensions/components/request-tracker.md +70 -173
- package/content/extensions/components/socket-io/api.md +462 -785
- package/content/extensions/components/socket-io/errors.md +49 -51
- package/content/extensions/components/socket-io/index.md +69 -372
- package/content/extensions/components/socket-io/usage.md +212 -105
- package/content/extensions/components/static-asset/api.md +461 -141
- package/content/extensions/components/static-asset/errors.md +121 -53
- package/content/extensions/components/static-asset/index.md +84 -606
- package/content/extensions/components/static-asset/usage.md +184 -299
- package/content/extensions/components/template/index.md +3 -3
- package/content/extensions/components/websocket/api.md +311 -404
- package/content/extensions/components/websocket/errors.md +47 -56
- package/content/extensions/components/websocket/index.md +75 -407
- package/content/extensions/components/websocket/usage.md +120 -338
- package/content/extensions/helpers/cron/index.md +52 -160
- package/content/extensions/helpers/crypto/index.md +67 -480
- package/content/extensions/helpers/crypto/reference.md +528 -0
- package/content/extensions/helpers/env/index.md +64 -178
- package/content/extensions/helpers/error/index.md +286 -196
- package/content/extensions/helpers/index.md +61 -47
- package/content/extensions/helpers/inversion/index.md +76 -550
- package/content/extensions/helpers/inversion/reference.md +530 -0
- package/content/extensions/helpers/kafka/admin.md +23 -3
- package/content/extensions/helpers/kafka/compile-binary.md +83 -52
- package/content/extensions/helpers/kafka/consumer.md +65 -28
- package/content/extensions/helpers/kafka/examples.md +46 -253
- package/content/extensions/helpers/kafka/index.md +55 -617
- package/content/extensions/helpers/kafka/producer.md +156 -22
- package/content/extensions/helpers/kafka/schema-registry.md +59 -79
- package/content/extensions/helpers/logger/hf-logger.md +220 -0
- package/content/extensions/helpers/logger/index.md +78 -552
- package/content/extensions/helpers/logger/pino.md +105 -0
- package/content/extensions/helpers/logger/reference.md +937 -0
- package/content/extensions/helpers/network/api.md +276 -195
- package/content/extensions/helpers/network/index.md +87 -524
- package/content/extensions/helpers/queue/index.md +80 -897
- package/content/extensions/helpers/queue/reference.md +494 -0
- package/content/extensions/helpers/redis/index.md +86 -640
- package/content/extensions/helpers/redis/reference.md +784 -0
- package/content/extensions/helpers/secrets/index.md +136 -0
- package/content/extensions/helpers/socket-io/api.md +325 -204
- package/content/extensions/helpers/socket-io/index.md +79 -429
- package/content/extensions/helpers/storage/api.md +584 -464
- package/content/extensions/helpers/storage/index.md +80 -573
- package/content/extensions/helpers/types/index.md +75 -495
- package/content/extensions/helpers/types/reference.md +689 -0
- package/content/extensions/helpers/uid/index.md +176 -189
- package/content/extensions/helpers/websocket/api.md +366 -214
- package/content/extensions/helpers/websocket/index.md +68 -503
- package/content/extensions/helpers/worker-thread/index.md +62 -396
- package/content/extensions/helpers/worker-thread/reference.md +428 -0
- package/content/extensions/index.md +38 -39
- package/content/extensions/src-details/mcp-server.md +96 -548
- package/content/guides/core-concepts/persistent/datasources.md +2 -2
- package/content/guides/core-concepts/persistent/index.md +5 -1
- package/content/guides/core-concepts/persistent/models.md +1 -1
- package/content/guides/core-concepts/persistent/pglite.md +218 -0
- package/content/guides/core-concepts/persistent/postgres-drivers.md +21 -15
- package/content/guides/core-concepts/persistent/search-meilisearch.md +22 -12
- package/content/guides/core-concepts/persistent/search-typesense.md +28 -16
- package/content/guides/core-concepts/persistent/sqlite.md +296 -0
- package/content/guides/core-concepts/persistent/transactions.md +12 -11
- package/content/guides/core-concepts/secrets-vault.md +177 -0
- package/content/guides/core-concepts/services.md +1 -1
- package/content/guides/get-started/5-minute-quickstart.md +59 -206
- package/content/guides/get-started/philosophy.md +135 -670
- package/content/guides/get-started/setup.md +53 -74
- package/content/guides/migrations/redis-helpers-migration.md +5 -4
- package/content/guides/migrations/scoped-rbac-migration.md +5 -5
- package/content/guides/migrations/unified-connectors-migration.md +8 -7
- package/content/guides/tutorials/ecommerce-api.md +3 -8
- package/content/guides/tutorials/realtime-chat.md +1 -1
- package/content/references/base/application.md +64 -22
- package/content/references/base/components.md +3 -3
- package/content/references/base/connectors.md +79 -136
- package/content/references/base/controllers.md +12 -12
- package/content/references/base/datasources-reference.md +600 -0
- package/content/references/base/datasources.md +84 -444
- package/content/references/base/dependency-injection.md +25 -46
- package/content/references/base/filter-system/application-usage.md +95 -123
- package/content/references/base/filter-system/array-operators.md +33 -43
- package/content/references/base/filter-system/comparison-operators.md +55 -63
- package/content/references/base/filter-system/default-filter.md +144 -350
- package/content/references/base/filter-system/fields-order-pagination.md +116 -148
- package/content/references/base/filter-system/index.md +114 -253
- package/content/references/base/filter-system/json-filtering.md +52 -181
- package/content/references/base/filter-system/list-operators.md +28 -44
- package/content/references/base/filter-system/logical-operators.md +69 -114
- package/content/references/base/filter-system/null-operators.md +41 -98
- package/content/references/base/filter-system/pattern-matching.md +48 -51
- package/content/references/base/filter-system/quick-reference.md +93 -196
- package/content/references/base/filter-system/range-operators.md +22 -38
- package/content/references/base/filter-system/tips.md +70 -133
- package/content/references/base/filter-system/use-cases.md +173 -232
- package/content/references/base/grpc-controllers.md +53 -17
- package/content/references/base/index.md +5 -3
- package/content/references/base/middlewares.md +43 -28
- package/content/references/base/models-reference.md +886 -0
- package/content/references/base/models.md +81 -1452
- package/content/references/base/providers.md +8 -8
- package/content/references/base/repositories/advanced.md +281 -419
- package/content/references/base/repositories/index.md +84 -644
- package/content/references/base/repositories/mixins.md +25 -21
- package/content/references/base/repositories/relations.md +194 -375
- package/content/references/base/repositories/soft-deletable.md +67 -55
- package/content/references/base/secrets.md +267 -0
- package/content/references/base/services.md +8 -6
- package/content/references/configuration/environment-variables.md +73 -21
- package/content/references/configuration/index.md +51 -31
- package/content/references/index.md +1 -1
- package/content/references/quick-reference.md +3 -16
- package/content/references/utilities/crypto.md +35 -76
- package/content/references/utilities/date.md +33 -73
- package/content/references/utilities/duration.md +85 -0
- package/content/references/utilities/index.md +6 -2
- package/content/references/utilities/jsx-reference.md +298 -0
- package/content/references/utilities/jsx.md +82 -525
- package/content/references/utilities/module.md +81 -61
- package/content/references/utilities/parse.md +34 -64
- package/content/references/utilities/performance.md +33 -58
- package/content/references/utilities/promise.md +28 -62
- package/content/references/utilities/request.md +58 -218
- package/content/references/utilities/retry.md +139 -0
- package/content/references/utilities/schema.md +43 -137
- package/content/references/utilities/statuses-reference.md +361 -0
- package/content/references/utilities/statuses.md +63 -667
- package/dist/mcp-server/index.js +0 -0
- package/dist/mcp-server/tools/github/list-project-files.tool.d.ts +1 -1
- package/dist/mcp-server/tools/github/list-project-files.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/github/list-project-files.tool.js +3 -3
- package/dist/mcp-server/tools/github/search-code.tool.js +1 -1
- package/dist/mcp-server/tools/github/verify-dependencies.tool.js +1 -1
- package/dist/mcp-server/tools/github/view-source-file.tool.js +1 -1
- package/package.json +24 -23
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
# Mail
|
|
1
|
+
# Mail - Error Reference & Troubleshooting
|
|
2
2
|
|
|
3
3
|
> Complete error code reference and troubleshooting guide for the Mail component.
|
|
4
4
|
|
|
5
|
-
## Error
|
|
5
|
+
## Error reference
|
|
6
6
|
|
|
7
|
-
All errors are created via `getError()
|
|
7
|
+
All errors are created via `getError()`. Only errors that carry a status and a code reach you as an `ApplicationError` with those fields; the rows marked `--` throw a plain error with only a `message`. Read an error's code at `error.normalized.code` - there is no flat `error.messageCode`.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
The 4xx rows below come from the `MailErrors` catalog, which holds the status and the code together so two throw sites cannot disagree. The 5xx rows stay codeless by design - a delivery failure is not something a caller can act on.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
### `MailService` errors
|
|
12
|
+
|
|
13
|
+
| Condition | Status | Error code | Message |
|
|
12
14
|
|-----------|--------|-----------|---------|
|
|
13
|
-
| `to` is missing or empty array | 400 | `core.mail.invalid_recipient` | `Recipient email address is required` |
|
|
15
|
+
| `to` is missing or an empty array | 400 | `core.mail.invalid_recipient` | `Recipient email address is required` |
|
|
14
16
|
| `subject` is falsy | 400 | `core.mail.invalid_configuration` | `Email subject is required` |
|
|
15
17
|
| Both `text` and `html` are falsy | 400 | `core.mail.invalid_configuration` | `Email must have either text or html content` |
|
|
16
18
|
| Transport throws during `send()` | 500 | `core.mail.send_failed` | `Failed to send email: <error>` |
|
|
@@ -18,71 +20,89 @@ All errors are created via `getError()` and include `statusCode`, `messageCode`,
|
|
|
18
20
|
| Template engine not configured for `sendTemplate()` | 500 | `core.mail.invalid_configuration` | `Template engine not configured` |
|
|
19
21
|
| Transport throws during `verify()` | 500 | `core.mail.verification_failed` | `Mail transport verification failed: <error>` |
|
|
20
22
|
|
|
21
|
-
|
|
23
|
+
> [!NOTE]
|
|
24
|
+
> "Transport throws during `send()`/`verify()`" only fires for a **custom** transport. The built-in `NodemailerTransportHelper` and `MailgunTransportHelper` never throw from `send()` or `verify()`. They catch internally and return `{ success: false, error }` (or `false` for `verify()`). A 400 validation error raised by `validateMessage()` is re-thrown unchanged, not wrapped as `SEND_FAILED`.
|
|
25
|
+
|
|
26
|
+
### `MailComponent` errors
|
|
22
27
|
|
|
23
|
-
| Condition | Status | Error
|
|
28
|
+
| Condition | Status | Error code | Message |
|
|
24
29
|
|-----------|--------|-----------|---------|
|
|
25
|
-
| `MAIL_OPTIONS` not bound | -- | -- | `Mail options not configured` |
|
|
30
|
+
| `MAIL_OPTIONS` not bound before `component(MailComponent)` | -- | -- | `Mail options not configured` |
|
|
26
31
|
|
|
27
|
-
### MailTransportProvider
|
|
32
|
+
### `MailTransportProvider` errors
|
|
28
33
|
|
|
29
|
-
| Condition | Status | Error
|
|
34
|
+
| Condition | Status | Error code | Message |
|
|
30
35
|
|-----------|--------|-----------|---------|
|
|
31
36
|
| Unsupported provider string | 500 | `core.mail.invalid_configuration` | `Unsupported mail provider: <provider>` |
|
|
32
|
-
| Nodemailer options fail type guard | 500 | `core.mail.invalid_configuration` | `Invalid Nodemailer configuration` |
|
|
33
|
-
| Mailgun options fail type guard | 500 | `core.mail.invalid_configuration` | `Invalid Mailgun configuration` |
|
|
34
|
-
| Custom options fail type guard | 500 | `core.mail.invalid_configuration` | `Invalid custom mail provider configuration` |
|
|
37
|
+
| Nodemailer options fail the type guard | 500 | `core.mail.invalid_configuration` | `Invalid Nodemailer configuration` |
|
|
38
|
+
| Mailgun options fail the type guard | 500 | `core.mail.invalid_configuration` | `Invalid Mailgun configuration` |
|
|
39
|
+
| Custom options fail the type guard | 500 | `core.mail.invalid_configuration` | `Invalid custom mail provider configuration` |
|
|
35
40
|
| Custom config missing `send`/`verify` | 500 | `core.mail.invalid_configuration` | `Custom mail provider must implement IMailTransport interface. Missing methods: <methods>` |
|
|
36
41
|
|
|
37
|
-
###
|
|
42
|
+
### `MailgunTransportHelper` errors
|
|
38
43
|
|
|
39
|
-
| Condition | Status | Error
|
|
44
|
+
| Condition | Status | Error code | Message |
|
|
45
|
+
|-----------|--------|-----------|---------|
|
|
46
|
+
| `config` is missing `username`, `key`, or `domain` | 500 | `core.mail.invalid_configuration` | `Invalid Mailgun configuration \| Missing required keys: <keys>` |
|
|
47
|
+
|
|
48
|
+
This check runs on `configure()`, one layer deeper than `MailTransportProvider`'s type guard. A `config` object that passes the provider's guard - it merely has *a* `config` property - can still fail this one if it is missing the specific keys Mailgun's client needs.
|
|
49
|
+
|
|
50
|
+
### `MailQueueExecutorProvider` errors
|
|
51
|
+
|
|
52
|
+
| Condition | Status | Error code | Message |
|
|
40
53
|
|-----------|--------|-----------|---------|
|
|
41
54
|
| `config.internalQueue` missing for `internal-queue` type | -- | -- | `Internal queue configuration is missing` |
|
|
42
55
|
| `config.bullmq` missing for `bullmq` type | -- | -- | `BullMQ configuration is missing` |
|
|
43
56
|
| Unknown executor type | -- | -- | `Unknown mail queue executor type: <type>` |
|
|
44
57
|
|
|
45
|
-
### TemplateEngineService
|
|
58
|
+
### `TemplateEngineService` errors
|
|
46
59
|
|
|
47
|
-
| Condition | Status | Error
|
|
60
|
+
| Condition | Status | Error code | Message |
|
|
48
61
|
|-----------|--------|-----------|---------|
|
|
49
62
|
| Neither `templateName` nor `templateData` provided | -- | -- | `Either templateName or templateData must be provided` |
|
|
50
63
|
| Template name not found in registry | 404 | `core.mail.template_not_found` | `Template not found: <name>` |
|
|
51
64
|
| Missing template data keys (with `requireValidate: true`) | 400 | `core.mail.invalid_configuration` | `Missing template data for keys: <keys>` |
|
|
52
65
|
|
|
53
|
-
### Queue
|
|
66
|
+
### Queue executor errors
|
|
54
67
|
|
|
55
68
|
| Condition | Executor | Message |
|
|
56
69
|
|-----------|----------|---------|
|
|
57
|
-
| Processor not set before enqueue | Direct, Internal Queue
|
|
58
|
-
| Processor not set before
|
|
59
|
-
|
|
|
60
|
-
|
|
|
70
|
+
| Processor not set before enqueue | Direct, Internal Queue -- always | `Processor not set. Call setProcessor() first.` |
|
|
71
|
+
| Processor not set before enqueue | BullMQ -- only outside `'queue-only'` mode | `Processor not set. Call setProcessor() first.` |
|
|
72
|
+
| Processor not set before adding a worker | BullMQ | `Processor not set. Call setProcessor() first.` |
|
|
73
|
+
| Enqueue attempted in `worker-only` mode | BullMQ | `Cannot enqueue jobs in worker-only mode. Set mode to "queue-only" or "both".` |
|
|
74
|
+
| Queue helper unexpectedly `null` | BullMQ | `Queue helper not initialized. This should not happen in queue-enabled mode.` |
|
|
61
75
|
|
|
62
76
|
## Troubleshooting
|
|
63
77
|
|
|
64
78
|
### "Mail options not configured"
|
|
65
79
|
|
|
66
|
-
**Cause
|
|
67
|
-
|
|
68
|
-
**Fix:** Ensure the options binding exists before calling `this.application.component(MailComponent)`:
|
|
80
|
+
- **Cause.** `MailKeys.MAIL_OPTIONS` was not bound before `MailComponent` was registered. `binding()` checks `isBound()` and throws immediately.
|
|
81
|
+
- **Fix.** Bind the options before calling `this.component(MailComponent)`:
|
|
69
82
|
|
|
70
83
|
```typescript
|
|
71
|
-
this.
|
|
84
|
+
this.bind({ key: MailKeys.MAIL_OPTIONS }).toValue({
|
|
72
85
|
provider: MailProviders.NODEMAILER,
|
|
73
86
|
from: 'noreply@example.com',
|
|
74
87
|
config: { host: 'smtp.example.com', port: 587, secure: false, auth: { user: '...', pass: '...' } },
|
|
75
88
|
});
|
|
76
89
|
|
|
77
|
-
|
|
78
|
-
this.application.component(MailComponent);
|
|
90
|
+
this.component(MailComponent);
|
|
79
91
|
```
|
|
80
92
|
|
|
81
|
-
### "
|
|
93
|
+
### "Invalid Mailgun configuration | Missing required keys: ..."
|
|
82
94
|
|
|
83
|
-
**Cause
|
|
95
|
+
- **Cause.** The Mailgun `config` object is missing `username`, `key`, or `domain`. A common mistake is naming the field `apiKey` instead of `key`.
|
|
96
|
+
- **Fix.** Use the exact field names `mailgun.js` expects:
|
|
84
97
|
|
|
85
|
-
|
|
98
|
+
```typescript
|
|
99
|
+
config: { username: 'api', key: process.env.MAILGUN_API_KEY, domain: 'mg.example.com' }
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### `core.mail.template_not_found` from `sendTemplate()`
|
|
103
|
+
|
|
104
|
+
- **Cause.** The template name was never registered via `templateEngine.registerTemplate()`. This often happens because a database-backed sync runs after the first `sendTemplate()` call, not before it.
|
|
105
|
+
- **Fix.** Register the template first:
|
|
86
106
|
|
|
87
107
|
```typescript
|
|
88
108
|
this.templateEngine.registerTemplate({
|
|
@@ -93,9 +113,8 @@ this.templateEngine.registerTemplate({
|
|
|
93
113
|
|
|
94
114
|
### Emails silently fail with `success: false`
|
|
95
115
|
|
|
96
|
-
**Cause
|
|
97
|
-
|
|
98
|
-
**Fix:** Check `result.error` for the specific transport error. Verify transport on startup:
|
|
116
|
+
- **Cause.** The transport connection is misconfigured: wrong credentials, a blocked port, or an expired OAuth2 token. `MailService.send()` never throws for a built-in transport's connection failure - it returns `{ success: false, error }`.
|
|
117
|
+
- **Fix.** Check `result.error` for the underlying transport error, and verify the connection at startup:
|
|
99
118
|
|
|
100
119
|
```typescript
|
|
101
120
|
const isConnected = await this.mailService.verify();
|
|
@@ -104,28 +123,26 @@ if (!isConnected) {
|
|
|
104
123
|
}
|
|
105
124
|
```
|
|
106
125
|
|
|
107
|
-
### BullMQ executor not processing jobs
|
|
108
|
-
|
|
109
|
-
**Cause:** The `mode` is set to `'queue-only'` which only enqueues jobs without starting a worker, or the Redis connection is unreachable.
|
|
126
|
+
### BullMQ executor is not processing jobs
|
|
110
127
|
|
|
111
|
-
**
|
|
128
|
+
- **Cause.** Either `mode` is `'queue-only'` (enqueues but never starts a worker), or the Redis connection is unreachable.
|
|
129
|
+
- **Fix.** Run `mode: 'both'` or `'worker-only'` on the instance meant to process jobs, and confirm Redis connectivity:
|
|
112
130
|
|
|
113
131
|
```typescript
|
|
114
132
|
{
|
|
115
133
|
type: 'bullmq',
|
|
116
134
|
bullmq: {
|
|
117
|
-
redis: { host: 'localhost', port: 6379
|
|
135
|
+
redis: { host: 'localhost', port: 6379 /* ... */ },
|
|
118
136
|
queue: { identifier: 'mail-queue', name: 'mail-queue' },
|
|
119
|
-
mode: 'both', //
|
|
137
|
+
mode: 'both', // must be 'both' or 'worker-only' to process
|
|
120
138
|
},
|
|
121
139
|
}
|
|
122
140
|
```
|
|
123
141
|
|
|
124
|
-
### Template
|
|
142
|
+
### Template placeholders show up literally in the output
|
|
125
143
|
|
|
126
|
-
**Cause
|
|
127
|
-
|
|
128
|
-
**Fix:** Use `validateTemplateData()` to check which keys are missing before rendering:
|
|
144
|
+
- **Cause.** The `data` object passed to `render()`/`sendTemplate()` is missing a <code v-pre>{{key}}</code> the template uses. Without `requireValidate: true`, the engine preserves the original placeholder text. It does **not** replace a missing value with an empty string.
|
|
145
|
+
- **Fix.** Check what is missing before rendering, or fail loudly instead:
|
|
129
146
|
|
|
130
147
|
```typescript
|
|
131
148
|
const validation = this.templateEngine.validateTemplateData({ template, data });
|
|
@@ -134,43 +151,40 @@ if (!validation.isValid) {
|
|
|
134
151
|
}
|
|
135
152
|
```
|
|
136
153
|
|
|
137
|
-
Or set `requireValidate: true` to throw an error when keys are missing:
|
|
138
|
-
|
|
139
154
|
```typescript
|
|
140
155
|
const html = this.templateEngine.render({
|
|
141
156
|
templateName: 'welcome-email',
|
|
142
157
|
data,
|
|
143
|
-
requireValidate: true, //
|
|
158
|
+
requireValidate: true, // throws instead of leaving placeholders in the output
|
|
144
159
|
});
|
|
145
160
|
```
|
|
146
161
|
|
|
147
162
|
### "Processor not set. Call setProcessor() first."
|
|
148
163
|
|
|
149
|
-
**Cause
|
|
150
|
-
|
|
151
|
-
**Fix:** Call `setProcessor()` before enqueuing any jobs:
|
|
164
|
+
- **Cause.** `enqueueVerificationEmail()` was called before `setProcessor()`. Direct and Internal Queue always require a processor first. BullMQ requires one too, except in `'queue-only'` mode, where enqueueing does not need a processor.
|
|
165
|
+
- **Fix.** Register a processor before enqueuing:
|
|
152
166
|
|
|
153
167
|
```typescript
|
|
154
168
|
executor.setProcessor(async (email: string) => {
|
|
155
|
-
// Your email
|
|
169
|
+
// Your email-sending logic, typically wrapping mailService.send()
|
|
156
170
|
return { success: true, message: 'Verification email sent', expiresInMinutes: 10 };
|
|
157
171
|
});
|
|
158
172
|
```
|
|
159
173
|
|
|
160
174
|
### "Cannot enqueue jobs in worker-only mode"
|
|
161
175
|
|
|
162
|
-
**Cause
|
|
163
|
-
|
|
164
|
-
**Fix:** Use `mode: 'both'` or `mode: 'queue-only'` on instances that need to enqueue jobs. Use `mode: 'worker-only'` only on dedicated worker processes.
|
|
176
|
+
- **Cause.** The BullMQ executor is running with `mode: 'worker-only'`, which never creates a queue and therefore cannot accept new jobs.
|
|
177
|
+
- **Fix.** Use `'both'` or `'queue-only'` on any instance that needs to enqueue. Reserve `'worker-only'` for dedicated worker processes that only consume.
|
|
165
178
|
|
|
166
|
-
###
|
|
179
|
+
### Startup logs and credentials
|
|
167
180
|
|
|
168
|
-
|
|
181
|
+
`MailComponent.createAndBindInstances()` logs only `mailOptions.provider` and `queueExecutorConfig.type`, at `info` level. It never logs the full config object, by design. That keeps SMTP passwords, OAuth2 secrets, Mailgun API keys, and Redis passwords out of the log - at least through the component itself.
|
|
169
182
|
|
|
170
|
-
|
|
183
|
+
> [!WARNING]
|
|
184
|
+
> That guarantee is scoped to `MailComponent`'s own logging. If your wrapper component or any other code logs the `TMailOptions`/`IMailQueueExecutorConfig` object directly - for example, `logger.info('%j', mailOptions)` while debugging - you reintroduce the leak yourself. Log individual safe fields instead of the whole object.
|
|
171
185
|
|
|
172
|
-
## See
|
|
186
|
+
## See also
|
|
173
187
|
|
|
174
|
-
- [
|
|
175
|
-
- [Usage & Examples](./usage) --
|
|
176
|
-
- [API Reference](./api) --
|
|
188
|
+
- [Overview](./) -- quick start, imports, common configuration tasks
|
|
189
|
+
- [Usage & Examples](./usage) -- sending emails, templates, queue executors, verification generators
|
|
190
|
+
- [API Reference](./api) -- architecture, binding keys, interfaces, and internals
|