({ type, payload, channel, priority, refId, expiresAt })
| 330 | // --- Public API: send / writeInbound --- |
| 331 | |
| 332 | send({ type, payload, channel, priority, refId, expiresAt }) { |
| 333 | const id = generateUUIDv7(); |
| 334 | const now = Date.now(); |
| 335 | const msg = { |
| 336 | id, |
| 337 | channel: channel || DEFAULT_CHANNEL, |
| 338 | direction: 'outbound', |
| 339 | type, |
| 340 | status: 'pending', |
| 341 | payload: safeParse(payload), |
| 342 | priority: priority || 'normal', |
| 343 | ref_id: refId || null, |
| 344 | created_at: now, |
| 345 | synced_at: null, |
| 346 | expires_at: expiresAt || null, |
| 347 | retry_count: 0, |
| 348 | next_retry_at: null, |
| 349 | error: null, |
| 350 | }; |
| 351 | this._appendMessage(msg); |
| 352 | return { message_id: id, status: 'pending' }; |
| 353 | } |
| 354 | |
| 355 | writeInbound({ id, type, payload, channel, priority, refId, expiresAt }) { |
| 356 | const msgId = id || generateUUIDv7(); |
no test coverage detected