go-mokapi 0.50.0 → 0.51.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "go-mokapi",
3
- "version": "0.50.0",
3
+ "version": "0.51.0",
4
4
  "description": "Easy and flexible API mocking",
5
5
  "homepage": "https://mokapi.io",
6
6
  "repository": {
package/types/index.d.ts CHANGED
@@ -227,7 +227,63 @@ export interface HttpResponse {
227
227
  * }
228
228
  * })
229
229
  */
230
- rebuild: (statusCode?: number, contentType?: string) => void;
230
+ rebuild(statusCode?: number, contentType?: string): void;
231
+
232
+ /**
233
+ * A request-scoped key-value store for passing data between handlers
234
+ * registered on the same route.
235
+ *
236
+ * Use `context` to share state between `use()` middleware and method handlers
237
+ * without relying on external variables. Values are only available for the
238
+ * lifetime of the current request.
239
+ *
240
+ * @example
241
+ * import { app } from 'mokapi'
242
+ * export default function() {
243
+ * app.api('Petstore').http()
244
+ * .route('/pets/{petId}')
245
+ * .use((req, res) => {
246
+ * res.context.user = parseToken(req.header['Authorization'])
247
+ * })
248
+ * .get((req, res) => {
249
+ * res.data = { id: req.path.petId, owner: res.context.user.name }
250
+ * })
251
+ * }
252
+ */
253
+ context: Record<string, any>
254
+
255
+ /**
256
+ * Stops the handler pipeline for the current route.
257
+ *
258
+ * By default, all handlers registered on a route run in order.
259
+ * Calling `stopPropagation()` prevents any subsequent handlers
260
+ * on the same route from being executed.
261
+ *
262
+ * This is useful for guard logic such as authentication checks,
263
+ * where further processing should be skipped if a condition is not met.
264
+ *
265
+ * @example
266
+ * import { app } from 'mokapi'
267
+ * export default function() {
268
+ * app.api('Petstore').http()
269
+ * .route('/pets/{petId}')
270
+ * .use((req, res) => {
271
+ * if (!req.header['Authorization']) {
272
+ * res.statusCode = 401
273
+ * res.stopPropagation() // get/delete will not run
274
+ * return
275
+ * }
276
+ * res.context.user = parseToken(req.header['Authorization'])
277
+ * })
278
+ * .get((req, res) => {
279
+ * res.data = { id: req.path.petId, owner: res.context.user.name }
280
+ * })
281
+ * .delete((req, res) => {
282
+ * res.statusCode = 204
283
+ * })
284
+ * }
285
+ */
286
+ stopPropagation(): void
231
287
  }
232
288
 
233
289
  /**
@@ -750,6 +806,18 @@ export interface WebsocketChannel {
750
806
  */
751
807
  readonly name: string;
752
808
 
809
+ /**
810
+ * The parameter values extracted from the channel address for this
811
+ * specific channel instance, keyed by parameter name.
812
+ *
813
+ * @example
814
+ * // channel address: /doc/{roomId}
815
+ * on('websocket', function(event) {
816
+ * console.log(event.channel.params['roomId']) // e.g. "room-1"
817
+ * })
818
+ */
819
+ readonly params: Record<string, string>;
820
+
753
821
  /**
754
822
  * All clients currently connected to this channel. Use this for
755
823
  * custom fan-out logic beyond what `broadcast` provides — for
@@ -1322,3 +1390,501 @@ export interface SharedMemory {
1322
1390
  * ```
1323
1391
  */
1324
1392
  export const shared: SharedMemory;
1393
+
1394
+ /**
1395
+ * The central application object for registering HTTP (and future protocol) handlers
1396
+ * in a structured, route-oriented style.
1397
+ *
1398
+ * `app` is a singleton — the same instance is returned every time it is accessed.
1399
+ * Use `app.api()` to scope handlers to a specific API by its OpenAPI `info.title`,
1400
+ * which is required when multiple APIs share the same path.
1401
+ *
1402
+ * @example
1403
+ * // Without API scope — matches all APIs with this path
1404
+ * import { app } from 'mokapi'
1405
+ * export default function() {
1406
+ * app.http().get('/pets', (req, res) => {
1407
+ * res.data = [{ name: 'Bello' }]
1408
+ * })
1409
+ * }
1410
+ *
1411
+ * @example
1412
+ * // With API scope — only matches the 'Petstore' API
1413
+ * import { app } from 'mokapi'
1414
+ * export default function() {
1415
+ * app.api('Petstore').http().get('/pets', (req, res) => {
1416
+ * res.data = [{ name: 'Bello' }]
1417
+ * })
1418
+ * }
1419
+ */
1420
+ export const app: App
1421
+
1422
+ /**
1423
+ * The top-level application interface providing access to protocol routers
1424
+ * and API scoping.
1425
+ *
1426
+ * Use `api()` to narrow handlers to a specific API by its OpenAPI `info.title`.
1427
+ * Use `http()` directly for handlers that apply across all APIs.
1428
+ */
1429
+ export interface App {
1430
+ /**
1431
+ * Creates or returns a scoped context for the given API title.
1432
+ *
1433
+ * The title must match the `info.title` field in the OpenAPI specification.
1434
+ * Scoping is required when multiple APIs define the same path, to avoid
1435
+ * a handler running for unintended APIs.
1436
+ *
1437
+ * @param title The API title as defined in `info.title` of the OpenAPI spec.
1438
+ * @returns An `ApiScope` bound to the given API title.
1439
+ *
1440
+ * @example
1441
+ * import { app } from 'mokapi'
1442
+ * export default function() {
1443
+ * const petstore = app.api('Petstore')
1444
+ * petstore.http().get('/pets', (req, res) => {
1445
+ * res.data = [{ name: 'Bello' }]
1446
+ * })
1447
+ *
1448
+ * const zoo = app.api('Zoo API')
1449
+ * zoo.http().get('/pets', (req, res) => {
1450
+ * res.data = [{ name: 'Simba' }]
1451
+ * })
1452
+ * }
1453
+ */
1454
+ api(title: string): ApiScope
1455
+
1456
+ /**
1457
+ * Returns an `HttpRouter` not bound to any specific API.
1458
+ * Handlers registered here will run for all APIs that match
1459
+ * the given path and method.
1460
+ *
1461
+ * Use this for cross-cutting concerns such as logging, shared headers,
1462
+ * or common error responses.
1463
+ *
1464
+ * @returns An `HttpRouter` with no API scope.
1465
+ *
1466
+ * @example
1467
+ * import { app } from 'mokapi'
1468
+ * export default function() {
1469
+ * app.http().get('/pets', (req, res) => {
1470
+ * res.headers['X-Mock'] = 'true'
1471
+ * })
1472
+ * }
1473
+ */
1474
+ http(): HttpRouter
1475
+ }
1476
+
1477
+ /**
1478
+ * A scoped application context bound to a specific API by its `info.title`.
1479
+ *
1480
+ * Obtain an `ApiScope` via `app.api('My API')`. All handlers registered
1481
+ * through this scope will only run for requests matched to the named API.
1482
+ *
1483
+ * @example
1484
+ * import { app } from 'mokapi'
1485
+ * export default function() {
1486
+ * const petstore = app.api('Petstore')
1487
+ * petstore.http().route('/pets')
1488
+ * .get((req, res) => { res.data = [] })
1489
+ * .post((req, res) => { res.statusCode = 201 })
1490
+ * }
1491
+ */
1492
+ export interface ApiScope {
1493
+ /**
1494
+ * Returns an `HttpRouter` scoped to this API.
1495
+ *
1496
+ * Handlers registered on this router will only run for HTTP requests
1497
+ * that are matched to the API identified by this scope's title.
1498
+ *
1499
+ * @returns An `HttpRouter` bound to this API scope.
1500
+ *
1501
+ * @example
1502
+ * import { app } from 'mokapi'
1503
+ * export default function() {
1504
+ * app.api('Petstore').http().get('/pets', (req, res) => {
1505
+ * res.data = [{ name: 'Bello' }]
1506
+ * })
1507
+ * }
1508
+ */
1509
+ http(): HttpRouter
1510
+ }
1511
+
1512
+ /**
1513
+ * Registers and organizes HTTP event handlers by path, operation, and method.
1514
+ *
1515
+ * Obtain an `HttpRouter` via `app.http()` or `app.api('My API').http()`.
1516
+ *
1517
+ * Two styles are supported:
1518
+ * - **Shorthand**: `router.get(path, handler)` — registers a handler directly for a path and method.
1519
+ * - **Chained**: `router.route(path).get(handler).post(handler)` — groups multiple methods under one path.
1520
+ *
1521
+ * Paths must match the path template defined in the OpenAPI specification,
1522
+ * not the absolute server URL. For example, use `/pets/{petId}`, not `/v1/pets/123`.
1523
+ *
1524
+ * When multiple APIs share the same path, use `app.api()` to scope the router
1525
+ * to a specific API title to avoid unintended matches.
1526
+ *
1527
+ * All handlers registered on the same path and method run in registration order
1528
+ * (or by `priority` if specified). The last handler to write wins.
1529
+ *
1530
+ * @example
1531
+ * // Shorthand style
1532
+ * import { app } from 'mokapi'
1533
+ * export default function() {
1534
+ * const router = app.api('Petstore').http()
1535
+ * router.get('/pets', (req, res) => { res.data = [] })
1536
+ * router.post('/pets', (req, res) => { res.statusCode = 201 })
1537
+ * }
1538
+ *
1539
+ * @example
1540
+ * // Chained style
1541
+ * import { app } from 'mokapi'
1542
+ * export default function() {
1543
+ * app.api('Petstore').http()
1544
+ * .route('/pets')
1545
+ * .get((req, res) => { res.data = [] })
1546
+ * .post((req, res) => { res.statusCode = 201 })
1547
+ * }
1548
+ */
1549
+ export interface HttpRouter {
1550
+
1551
+ /**
1552
+ * Registers a middleware handler that runs for all methods.
1553
+ *
1554
+ * Middleware is useful for shared logic that should execute regardless
1555
+ * of the HTTP method — for example, authentication checks, setting up
1556
+ * `res.ctx`, or adding common response headers.
1557
+ *
1558
+ * Middleware handlers run in registration order relative to other handlers
1559
+ * on the same route. Use `opts.priority` to control ordering explicitly.
1560
+ *
1561
+ * @param handler The middleware handler to invoke.
1562
+ * @param opts Optional handler configuration such as priority and tracking.
1563
+ * @returns This `HttpRoute` instance for chaining.
1564
+ *
1565
+ * @example
1566
+ * router
1567
+ * .use((req, res) => {
1568
+ * const token = req.header['Authorization']
1569
+ * if (!token) {
1570
+ * res.statusCode = 401
1571
+ * return
1572
+ * }
1573
+ * res.ctx.user = parseToken(token)
1574
+ * })
1575
+ * .get((req, res) => {
1576
+ * res.data = { id: req.path.petId, owner: res.ctx.user.name }
1577
+ * })
1578
+ */
1579
+ use(handler: HttpEventHandler, opts?: HttpEventArgs): this
1580
+
1581
+ /**
1582
+ * Returns an `HttpRoute` for the given OpenAPI path template.
1583
+ *
1584
+ * Use this to register multiple method handlers under the same path
1585
+ * using method chaining, or to attach middleware via `.use()`.
1586
+ *
1587
+ * The path must match the path template in the OpenAPI specification,
1588
+ * e.g. `/pets/{petId}`, not the absolute URL.
1589
+ *
1590
+ * @param path The OpenAPI path template, e.g. `/pets/{petId}`.
1591
+ * @returns An `HttpRoute` for the given path.
1592
+ *
1593
+ * @example
1594
+ * router.route('/pets/{petId}')
1595
+ * .use((req, res) => {
1596
+ * if (!req.header['Authorization']) {
1597
+ * res.statusCode = 401
1598
+ * res.stopPropagation() // get/delete will not run
1599
+ * return
1600
+ * }
1601
+ * res.context.user = parseToken(req.header['Authorization'])
1602
+ * })
1603
+ * .get((req, res) => {
1604
+ * res.data = { id: req.path.petId, owner: res.context.user.name }
1605
+ * })
1606
+ * .delete((req, res) => {
1607
+ * res.statusCode = 204
1608
+ * })
1609
+ */
1610
+ route(path: string): HttpRoute
1611
+
1612
+ /**
1613
+ * Returns an `HttpRoute` matched by the given `operationId` as defined
1614
+ * in the OpenAPI specification.
1615
+ *
1616
+ * Use this as an alternative to `route()` when you prefer to reference
1617
+ * operations by name rather than by path template.
1618
+ *
1619
+ * @param operationId The `operationId` defined in the OpenAPI operation.
1620
+ * @returns An `HttpRoute` for the matching operation.
1621
+ *
1622
+ * @example
1623
+ * import { app } from 'mokapi'
1624
+ * export default function() {
1625
+ * app.api('Petstore').http()
1626
+ * .operation('listPets')
1627
+ * .get((req, res) => { res.data = [] })
1628
+ * }
1629
+ */
1630
+ operation(operationId: string): HttpRoute
1631
+
1632
+ /**
1633
+ * Narrows this router to a specific API by title.
1634
+ *
1635
+ * This is an alternative to `app.api(title).http()` for cases where
1636
+ * the router is already obtained and you want to further scope it.
1637
+ *
1638
+ * @param title The API title as defined in `info.title` of the OpenAPI spec.
1639
+ * @returns A new `HttpRouter` scoped to the given API title.
1640
+ *
1641
+ * @example
1642
+ * import { app } from 'mokapi'
1643
+ * export default function() {
1644
+ * app.http().api('Petstore').get('/pets', (req, res) => {
1645
+ * res.data = []
1646
+ * })
1647
+ * }
1648
+ */
1649
+ api(title: string): HttpRouter
1650
+
1651
+ /**
1652
+ * Registers a handler for `GET` requests to the given path.
1653
+ * @param path The OpenAPI path template, e.g. `/pets/{petId}`.
1654
+ * @param handler The event handler to invoke.
1655
+ * @param opts Optional handler configuration such as priority and tracking.
1656
+ *
1657
+ * @example
1658
+ * app.http().get('/pets', (req, res) => { res.data = [] })
1659
+ */
1660
+ get(path: string, handler: HttpEventHandler, opts?: HttpEventArgs): void
1661
+
1662
+ /**
1663
+ * Registers a handler for `POST` requests to the given path.
1664
+ * @param path The OpenAPI path template.
1665
+ * @param handler The event handler to invoke.
1666
+ * @param opts Optional handler configuration such as priority and tracking.
1667
+ *
1668
+ * @example
1669
+ * app.http().post('/pets', (req, res) => { res.statusCode = 201 })
1670
+ */
1671
+ post(path: string, handler: HttpEventHandler, opts?: HttpEventArgs): void
1672
+
1673
+ /**
1674
+ * Registers a handler for `PUT` requests to the given path.
1675
+ * @param path The OpenAPI path template.
1676
+ * @param handler The event handler to invoke.
1677
+ * @param opts Optional handler configuration such as priority and tracking.
1678
+ */
1679
+ put(path: string, handler: HttpEventHandler, opts?: HttpEventArgs): void
1680
+
1681
+ /**
1682
+ * Registers a handler for `PATCH` requests to the given path.
1683
+ * @param path The OpenAPI path template.
1684
+ * @param handler The event handler to invoke.
1685
+ * @param opts Optional handler configuration such as priority and tracking.
1686
+ */
1687
+ patch(path: string, handler: HttpEventHandler, opts?: HttpEventArgs): void
1688
+
1689
+ /**
1690
+ * Registers a handler for `DELETE` requests to the given path.
1691
+ * @param path The OpenAPI path template.
1692
+ * @param handler The event handler to invoke.
1693
+ * @param opts Optional handler configuration such as priority and tracking.
1694
+ */
1695
+ delete(path: string, handler: HttpEventHandler, opts?: HttpEventArgs): void
1696
+
1697
+ /**
1698
+ * Registers a handler for `HEAD` requests to the given path.
1699
+ * @param path The OpenAPI path template.
1700
+ * @param handler The event handler to invoke.
1701
+ * @param opts Optional handler configuration such as priority and tracking.
1702
+ */
1703
+ head(path: string, handler: HttpEventHandler, opts?: HttpEventArgs): void
1704
+
1705
+ /**
1706
+ * Registers a handler for `OPTIONS` requests to the given path.
1707
+ * @param path The OpenAPI path template.
1708
+ * @param handler The event handler to invoke.
1709
+ * @param opts Optional handler configuration such as priority and tracking.
1710
+ */
1711
+ options(path: string, handler: HttpEventHandler, opts?: HttpEventArgs): void
1712
+
1713
+ /**
1714
+ * Registers a handler for `TRACE` requests to the given path.
1715
+ * @param path The OpenAPI path template.
1716
+ * @param handler The event handler to invoke.
1717
+ * @param opts Optional handler configuration such as priority and tracking.
1718
+ */
1719
+ trace(path: string, handler: HttpEventHandler, opts?: HttpEventArgs): void
1720
+
1721
+ /**
1722
+ * Registers a handler for `QUERY` requests to the given path.
1723
+ * @param path The OpenAPI path template.
1724
+ * @param handler The event handler to invoke.
1725
+ * @param opts Optional handler configuration such as priority and tracking.
1726
+ */
1727
+ query(path: string, handler: HttpEventHandler, opts?: HttpEventArgs): void
1728
+
1729
+ /** Allows registering a handler for any HTTP method, including custom ones.
1730
+ * @example
1731
+ * app.http().purge('/cache', (req, res) => { res.statusCode = 200 })
1732
+ */
1733
+ [method: string]: any
1734
+ }
1735
+
1736
+ /**
1737
+ * Represents a single route (path or operation) within an `HttpRouter`,
1738
+ * allowing multiple method handlers and middleware to be registered
1739
+ * via method chaining.
1740
+ *
1741
+ * Obtain an `HttpRoute` via `router.route(path)` or `router.operation(operationId)`.
1742
+ *
1743
+ * All methods return `this`, enabling fluent chaining:
1744
+ * ```ts
1745
+ * router.route('/pets')
1746
+ * .use(authMiddleware)
1747
+ * .get(listHandler)
1748
+ * .post(createHandler)
1749
+ * ```
1750
+ *
1751
+ * Handlers registered on the same route run in registration order
1752
+ * (or by `priority`). The last handler to write a value wins.
1753
+ *
1754
+ * Middleware registered via `use()` runs for all methods on this route
1755
+ * and is well suited for shared logic such as authentication,
1756
+ * request context setup, or response enrichment.
1757
+ *
1758
+ * @example
1759
+ * import { app } from 'mokapi'
1760
+ * export default function() {
1761
+ * app.api('Petstore').http()
1762
+ * .route('/pets/{petId}')
1763
+ * .use((req, res) => {
1764
+ * // Runs before get and delete — set up shared context
1765
+ * res.ctx.requestedAt = Date.now()
1766
+ * })
1767
+ * .get((req, res) => {
1768
+ * res.data = { id: req.path.petId, requestedAt: res.ctx.requestedAt }
1769
+ * })
1770
+ * .delete((req, res) => {
1771
+ * res.statusCode = 204
1772
+ * })
1773
+ * }
1774
+ */
1775
+ export interface HttpRoute {
1776
+
1777
+ /**
1778
+ * Registers a middleware handler that runs for all methods on this route.
1779
+ *
1780
+ * Middleware is useful for shared logic that should execute regardless
1781
+ * of the HTTP method — for example, authentication checks, setting up
1782
+ * `res.ctx`, or adding common response headers.
1783
+ *
1784
+ * Middleware handlers run in registration order relative to other handlers
1785
+ * on the same route. Use `opts.priority` to control ordering explicitly.
1786
+ *
1787
+ * @param handler The middleware handler to invoke.
1788
+ * @param opts Optional handler configuration such as priority and tracking.
1789
+ * @returns This `HttpRoute` instance for chaining.
1790
+ *
1791
+ * @example
1792
+ * router.route('/pets/{petId}')
1793
+ * .use((req, res) => {
1794
+ * const token = req.header['Authorization']
1795
+ * if (!token) {
1796
+ * res.statusCode = 401
1797
+ * return
1798
+ * }
1799
+ * res.ctx.user = parseToken(token)
1800
+ * })
1801
+ * .get((req, res) => {
1802
+ * res.data = { id: req.path.petId, owner: res.ctx.user.name }
1803
+ * })
1804
+ */
1805
+ use(handler: HttpEventHandler, opts?: HttpEventArgs): this
1806
+
1807
+ /**
1808
+ * Registers a handler for `GET` requests on this route.
1809
+ * @param handler The event handler to invoke.
1810
+ * @param opts Optional handler configuration such as priority and tracking.
1811
+ * @returns This `HttpRoute` instance for chaining.
1812
+ *
1813
+ * @example
1814
+ * router.route('/pets').get((req, res) => { res.data = [] })
1815
+ */
1816
+ get(handler: HttpEventHandler, opts?: HttpEventArgs): this
1817
+
1818
+ /**
1819
+ * Registers a handler for `POST` requests on this route.
1820
+ * @param handler The event handler to invoke.
1821
+ * @param opts Optional handler configuration such as priority and tracking.
1822
+ * @returns This `HttpRoute` instance for chaining.
1823
+ *
1824
+ * @example
1825
+ * router.route('/pets').post((req, res) => { res.statusCode = 201 })
1826
+ */
1827
+ post(handler: HttpEventHandler, opts?: HttpEventArgs): this
1828
+
1829
+ /**
1830
+ * Registers a handler for `PUT` requests on this route.
1831
+ * @param handler The event handler to invoke.
1832
+ * @param opts Optional handler configuration such as priority and tracking.
1833
+ * @returns This `HttpRoute` instance for chaining.
1834
+ */
1835
+ put(handler: HttpEventHandler, opts?: HttpEventArgs): this
1836
+
1837
+ /**
1838
+ * Registers a handler for `PATCH` requests on this route.
1839
+ * @param handler The event handler to invoke.
1840
+ * @param opts Optional handler configuration such as priority and tracking.
1841
+ * @returns This `HttpRoute` instance for chaining.
1842
+ */
1843
+ patch(handler: HttpEventHandler, opts?: HttpEventArgs): this
1844
+
1845
+ /**
1846
+ * Registers a handler for `DELETE` requests on this route.
1847
+ * @param handler The event handler to invoke.
1848
+ * @param opts Optional handler configuration such as priority and tracking.
1849
+ * @returns This `HttpRoute` instance for chaining.
1850
+ */
1851
+ delete(handler: HttpEventHandler, opts?: HttpEventArgs): this
1852
+
1853
+ /**
1854
+ * Registers a handler for `HEAD` requests on this route.
1855
+ * @param handler The event handler to invoke.
1856
+ * @param opts Optional handler configuration such as priority and tracking.
1857
+ * @returns This `HttpRoute` instance for chaining.
1858
+ */
1859
+ head(handler: HttpEventHandler, opts?: HttpEventArgs): this
1860
+
1861
+ /**
1862
+ * Registers a handler for `OPTIONS` requests on this route.
1863
+ * @param handler The event handler to invoke.
1864
+ * @param opts Optional handler configuration such as priority and tracking.
1865
+ * @returns This `HttpRoute` instance for chaining.
1866
+ */
1867
+ options(handler: HttpEventHandler, opts?: HttpEventArgs): this
1868
+
1869
+ /**
1870
+ * Registers a handler for `TRACE` requests on this route.
1871
+ * @param handler The event handler to invoke.
1872
+ * @param opts Optional handler configuration such as priority and tracking.
1873
+ * @returns This `HttpRoute` instance for chaining.
1874
+ */
1875
+ trace(handler: HttpEventHandler, opts?: HttpEventArgs): this
1876
+
1877
+ /**
1878
+ * Registers a handler for `QUERY` requests on this route.
1879
+ * @param handler The event handler to invoke.
1880
+ * @param opts Optional handler configuration such as priority and tracking.
1881
+ * @returns This `HttpRoute` instance for chaining.
1882
+ */
1883
+ query(handler: HttpEventHandler, opts?: HttpEventArgs): this
1884
+
1885
+ /** Allows registering a handler for any HTTP method, including custom ones such as `PURGE` or `SEARCH`.
1886
+ * @example
1887
+ * router.route('/cache').purge((req, res) => { res.statusCode = 200 })
1888
+ */
1889
+ [method: string]: any
1890
+ }
package/types/kafka.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { JSONValue } from ".";
2
2
 
3
3
  /**
4
- * Sends a single message to a Kafka topic.
4
+ * Sends messages to a Kafka topic.
5
5
  * https://mokapi.io/docs/javascript-api/mokapi-kafka/produce
6
6
  * @param args - ProduceArgs object contains Kafka produce arguments.
7
7
  * @returns The produce result.
@@ -22,7 +22,7 @@ import { JSONValue } from ".";
22
22
  export function produce(args?: ProduceArgs): ProduceResult;
23
23
 
24
24
  /**
25
- * Sends a single message to a Kafka topic asynchronously.
25
+ * Sends messages to a Kafka topic asynchronously.
26
26
  * https://mokapi.io/docs/javascript-api/mokapi-kafka/produce
27
27
  * @param args - ProduceArgs object contains Kafka produce arguments.
28
28
  * @returns The produce result.