@xylabs/express 5.0.83 → 5.0.84

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.
Files changed (62) hide show
  1. package/README.md +119 -2
  2. package/dist/node/Handler/RouteDefinition/RouteDefinition.d.ts +2 -0
  3. package/dist/node/Handler/RouteDefinition/RouteDefinition.d.ts.map +1 -1
  4. package/dist/node/Handler/RouteDefinition/addRouteDefinitions.d.ts +5 -0
  5. package/dist/node/Handler/RouteDefinition/addRouteDefinitions.d.ts.map +1 -1
  6. package/dist/node/Handler/StatusCodeHandlers/notImplemented.d.ts +1 -0
  7. package/dist/node/Handler/StatusCodeHandlers/notImplemented.d.ts.map +1 -1
  8. package/dist/node/Handler/asyncHandler.d.ts +11 -0
  9. package/dist/node/Handler/asyncHandler.d.ts.map +1 -1
  10. package/dist/node/Handler/errorToJsonHandler.d.ts +7 -0
  11. package/dist/node/Handler/errorToJsonHandler.d.ts.map +1 -1
  12. package/dist/node/Logger/LogFormats/LocalDev/logFormatLocalDev.d.ts +1 -0
  13. package/dist/node/Logger/LogFormats/LocalDev/logFormatLocalDev.d.ts.map +1 -1
  14. package/dist/node/Logger/LogFormats/Rollbar/logFormatRollbar.d.ts +1 -0
  15. package/dist/node/Logger/LogFormats/Rollbar/logFormatRollbar.d.ts.map +1 -1
  16. package/dist/node/Logger/LogFormats/Structured/logFormatStructured.d.ts +1 -0
  17. package/dist/node/Logger/LogFormats/Structured/logFormatStructured.d.ts.map +1 -1
  18. package/dist/node/Logger/LoggerMeta.d.ts +1 -0
  19. package/dist/node/Logger/LoggerMeta.d.ts.map +1 -1
  20. package/dist/node/Logger/LoggerOptions.d.ts +1 -0
  21. package/dist/node/Logger/LoggerOptions.d.ts.map +1 -1
  22. package/dist/node/Logger/LoggerVerbosity.d.ts +1 -0
  23. package/dist/node/Logger/LoggerVerbosity.d.ts.map +1 -1
  24. package/dist/node/Logger/Transports/Rollbar/RollbarTransport.d.ts +1 -0
  25. package/dist/node/Logger/Transports/Rollbar/RollbarTransport.d.ts.map +1 -1
  26. package/dist/node/Logger/Transports/Rollbar/canGetDefaultRollbarTransport.d.ts +5 -0
  27. package/dist/node/Logger/Transports/Rollbar/canGetDefaultRollbarTransport.d.ts.map +1 -1
  28. package/dist/node/Logger/Transports/Rollbar/getDefaultRollbarTransport.d.ts +5 -0
  29. package/dist/node/Logger/Transports/Rollbar/getDefaultRollbarTransport.d.ts.map +1 -1
  30. package/dist/node/Logger/getDefaultLogger.d.ts +4 -0
  31. package/dist/node/Logger/getDefaultLogger.d.ts.map +1 -1
  32. package/dist/node/Logger/getLogger.d.ts +5 -0
  33. package/dist/node/Logger/getLogger.d.ts.map +1 -1
  34. package/dist/node/Logger/toWinstonVerbosity.d.ts +5 -0
  35. package/dist/node/Logger/toWinstonVerbosity.d.ts.map +1 -1
  36. package/dist/node/Model/ExpressError.d.ts +1 -0
  37. package/dist/node/Model/ExpressError.d.ts.map +1 -1
  38. package/dist/node/Performance/Counters.d.ts +1 -0
  39. package/dist/node/Performance/Counters.d.ts.map +1 -1
  40. package/dist/node/Performance/Profiler.d.ts +1 -0
  41. package/dist/node/Performance/Profiler.d.ts.map +1 -1
  42. package/dist/node/Util/compactObject.d.ts +5 -0
  43. package/dist/node/Util/compactObject.d.ts.map +1 -1
  44. package/dist/node/Util/tryParse.d.ts +1 -0
  45. package/dist/node/Util/tryParse.d.ts.map +1 -1
  46. package/dist/node/index.mjs.map +1 -1
  47. package/dist/node/middleware/customPoweredByHeader/customPoweredByHeader.d.ts +1 -0
  48. package/dist/node/middleware/customPoweredByHeader/customPoweredByHeader.d.ts.map +1 -1
  49. package/dist/node/middleware/metrics/counters.d.ts +4 -0
  50. package/dist/node/middleware/metrics/counters.d.ts.map +1 -1
  51. package/dist/node/middleware/standardResponses/getResponseMetadata.d.ts +5 -0
  52. package/dist/node/middleware/standardResponses/getResponseMetadata.d.ts.map +1 -1
  53. package/dist/node/middleware/standardResponses/jsonApi/links.d.ts +3 -0
  54. package/dist/node/middleware/standardResponses/jsonApi/links.d.ts.map +1 -1
  55. package/dist/node/middleware/standardResponses/jsonApi/relationship.d.ts +5 -0
  56. package/dist/node/middleware/standardResponses/jsonApi/relationship.d.ts.map +1 -1
  57. package/dist/node/middleware/standardResponses/jsonApi/response.d.ts +6 -0
  58. package/dist/node/middleware/standardResponses/jsonApi/response.d.ts.map +1 -1
  59. package/dist/node/middleware/standardResponses/standardErrors.d.ts +7 -0
  60. package/dist/node/middleware/standardResponses/standardErrors.d.ts.map +1 -1
  61. package/dist/node/middleware/standardResponses/standardResponses.d.ts.map +1 -1
  62. package/package.json +7 -7
package/README.md CHANGED
@@ -113,6 +113,8 @@ SDK for base code for Api repos that use express and deploy on AWS ECS
113
113
 
114
114
  ***
115
115
 
116
+ Static counter registry for tracking named numeric metrics.
117
+
116
118
  ## Constructors
117
119
 
118
120
  ### Constructor
@@ -205,6 +207,8 @@ static min(name, count): void;
205
207
 
206
208
  ***
207
209
 
210
+ Measures and records the execution duration of async operations by name.
211
+
208
212
  ## Constructors
209
213
 
210
214
  ### Constructor
@@ -388,16 +392,22 @@ Logger.warn
388
392
  function addRouteDefinitions(app, routeDefinitions): void;
389
393
  ```
390
394
 
395
+ Registers an array of route definitions on an Express application.
396
+
391
397
  ## Parameters
392
398
 
393
399
  ### app
394
400
 
395
401
  `Express`
396
402
 
403
+ The Express application to register routes on.
404
+
397
405
  ### routeDefinitions
398
406
 
399
407
  [`RouteDefinition`](#../interfaces/RouteDefinition)\<`RequestHandler`\<`ParamsDictionary`, `any`, `any`, `ParsedQs`, `Record`\<`string`, `any`\>\>\>[]
400
408
 
409
+ The route definitions to register.
410
+
401
411
  ## Returns
402
412
 
403
413
  `void`
@@ -412,6 +422,8 @@ function addRouteDefinitions(app, routeDefinitions): void;
412
422
  function asyncHandler<P, ResBody, ReqBody, ReqQuery, Locals>(fn): (req, res, next) => Promise<unknown>;
413
423
  ```
414
424
 
425
+ Wraps an async Express request handler to forward rejected promises to the error handler.
426
+
415
427
  ## Type Parameters
416
428
 
417
429
  ### P
@@ -440,8 +452,12 @@ function asyncHandler<P, ResBody, ReqBody, ReqQuery, Locals>(fn): (req, res, nex
440
452
 
441
453
  `RequestHandler`\<`P`, `ResBody`, `ReqBody`, `ReqQuery`, `Locals`\>
442
454
 
455
+ The async request handler to wrap.
456
+
443
457
  ## Returns
444
458
 
459
+ A request handler that catches async errors and passes them to next().
460
+
445
461
  ```ts
446
462
  (
447
463
  req,
@@ -502,6 +518,8 @@ The response to set to the standard response format
502
518
  function compactObject<T>(obj): T;
503
519
  ```
504
520
 
521
+ Returns a shallow copy of the object with all null and undefined values removed.
522
+
505
523
  ## Type Parameters
506
524
 
507
525
  ### T
@@ -514,10 +532,14 @@ function compactObject<T>(obj): T;
514
532
 
515
533
  `T`
516
534
 
535
+ The object to compact.
536
+
517
537
  ## Returns
518
538
 
519
539
  `T`
520
540
 
541
+ A new object with only defined, non-null properties.
542
+
521
543
  ### <a id="customPoweredByHeader"></a>customPoweredByHeader
522
544
 
523
545
  [**@xylabs/express**](#../README)
@@ -531,6 +553,8 @@ function customPoweredByHeader(
531
553
  next): void;
532
554
  ```
533
555
 
556
+ Express middleware that sets the X-Powered-By header to 'XYO'.
557
+
534
558
  ## Parameters
535
559
 
536
560
  ### req
@@ -663,24 +687,34 @@ function errorToJsonHandler(
663
687
  next): void;
664
688
  ```
665
689
 
690
+ Express error handler that logs the error and sends a JSON response with the error message and status code.
691
+
666
692
  ## Parameters
667
693
 
668
694
  ### error
669
695
 
670
696
  [`ExpressError`](#../interfaces/ExpressError)
671
697
 
698
+ The Express error to handle.
699
+
672
700
  ### req
673
701
 
674
702
  `Request`
675
703
 
704
+ The incoming request.
705
+
676
706
  ### res
677
707
 
678
708
  `Response`
679
709
 
710
+ The outgoing response.
711
+
680
712
  ### next
681
713
 
682
714
  `NextFunction`
683
715
 
716
+ The next middleware function.
717
+
684
718
  ## Returns
685
719
 
686
720
  `void`
@@ -695,10 +729,14 @@ function errorToJsonHandler(
695
729
  function getDefaultLogger(): Logger;
696
730
  ```
697
731
 
732
+ Returns the singleton default logger instance, creating one if it does not exist.
733
+
698
734
  ## Returns
699
735
 
700
736
  `Logger`
701
737
 
738
+ The default logger.
739
+
702
740
  ### <a id="getHttpHeader"></a>getHttpHeader
703
741
 
704
742
  [**@xylabs/express**](#../README)
@@ -798,16 +836,22 @@ precedence over the default
798
836
  function getLogger(minVerbosity?): Logger;
799
837
  ```
800
838
 
839
+ Returns a cached Winston-backed logger at the specified verbosity level.
840
+
801
841
  ## Parameters
802
842
 
803
843
  ### minVerbosity?
804
844
 
805
845
  [`LoggerVerbosity`](#../type-aliases/LoggerVerbosity) = `'info'`
806
846
 
847
+ The minimum log level to output. Defaults to 'info'.
848
+
807
849
  ## Returns
808
850
 
809
851
  `Logger`
810
852
 
853
+ A logger instance configured for the given verbosity.
854
+
811
855
  ### <a id="getResponseMetadata"></a>getResponseMetadata
812
856
 
813
857
  [**@xylabs/express**](#../README)
@@ -818,16 +862,22 @@ function getLogger(minVerbosity?): Logger;
818
862
  function getResponseMetadata(res): Record<string, unknown>;
819
863
  ```
820
864
 
865
+ Extracts response metadata from res.locals, computing profile duration if profiling was started.
866
+
821
867
  ## Parameters
822
868
 
823
869
  ### res
824
870
 
825
871
  `Response`
826
872
 
873
+ The Express response to extract metadata from.
874
+
827
875
  ## Returns
828
876
 
829
877
  `Record`\<`string`, `unknown`\>
830
878
 
879
+ The metadata record including any profiling information.
880
+
831
881
  ### <a id="isRawResponseFormatSet"></a>isRawResponseFormatSet
832
882
 
833
883
  [**@xylabs/express**](#../README)
@@ -1011,24 +1061,34 @@ function standardErrors(
1011
1061
  next): void;
1012
1062
  ```
1013
1063
 
1064
+ Express error handler that logs the error and sends a JSON:API-compliant error response.
1065
+
1014
1066
  ## Parameters
1015
1067
 
1016
1068
  ### err
1017
1069
 
1070
+ The error to handle, or undefined if no error.
1071
+
1018
1072
  [`ExpressError`](#../interfaces/ExpressError) | `undefined`
1019
1073
 
1020
1074
  ### req
1021
1075
 
1022
1076
  `Request`
1023
1077
 
1078
+ The incoming request.
1079
+
1024
1080
  ### res
1025
1081
 
1026
1082
  `Response`
1027
1083
 
1084
+ The outgoing response.
1085
+
1028
1086
  ### next
1029
1087
 
1030
1088
  `NextFunction`
1031
1089
 
1090
+ The next middleware function.
1091
+
1032
1092
  ## Returns
1033
1093
 
1034
1094
  `void`
@@ -1077,12 +1137,16 @@ use zod instead
1077
1137
  function useRequestCounters(app): void;
1078
1138
  ```
1079
1139
 
1140
+ Registers middleware that increments per-path request counters and exposes a /stats endpoint.
1141
+
1080
1142
  ## Parameters
1081
1143
 
1082
1144
  ### app
1083
1145
 
1084
1146
  `Application`
1085
1147
 
1148
+ The Express application to attach counters to.
1149
+
1086
1150
  ## Returns
1087
1151
 
1088
1152
  `void`
@@ -1095,6 +1159,8 @@ function useRequestCounters(app): void;
1095
1159
 
1096
1160
  ***
1097
1161
 
1162
+ A successful JSON:API response containing primary data and optional included resources.
1163
+
1098
1164
  ## Extends
1099
1165
 
1100
1166
  - [`ApiResponseBase`](#ApiResponseBase)
@@ -1250,6 +1316,8 @@ A short, human-readable summary of the problem that SHOULD NOT change from occur
1250
1316
 
1251
1317
  ***
1252
1318
 
1319
+ A JSON:API error response containing one or more error objects.
1320
+
1253
1321
  ## Extends
1254
1322
 
1255
1323
  - [`ApiResponseBase`](#ApiResponseBase)
@@ -1338,8 +1406,7 @@ The values of type members MUST adhere to the same constraints as member names.
1338
1406
 
1339
1407
  ***
1340
1408
 
1341
- Within a given API, each resource object's type and id pair MUST identify a single, unique resource.
1342
- (The set of URIs controlled by a server, or multiple servers acting as one, constitute an API.)
1409
+ A JSON:API resource object with optional attributes, links, meta, and relationships.
1343
1410
 
1344
1411
  ## Extends
1345
1412
 
@@ -1420,6 +1487,8 @@ A relationships object describing relationships between the resource and other J
1420
1487
 
1421
1488
  ***
1422
1489
 
1490
+ Base interface for all JSON:API responses, including optional links and metadata.
1491
+
1423
1492
  ## Extended by
1424
1493
 
1425
1494
  - [`ApiDataResponse`](#ApiDataResponse)
@@ -1455,12 +1524,16 @@ optional meta: Record<string, unknown>;
1455
1524
 
1456
1525
  ***
1457
1526
 
1527
+ Empty object type used as a default for request/response body generics.
1528
+
1458
1529
  ### <a id="ExpressError"></a>ExpressError
1459
1530
 
1460
1531
  [**@xylabs/express**](#../README)
1461
1532
 
1462
1533
  ***
1463
1534
 
1535
+ An Error with an optional HTTP status code for Express error handling.
1536
+
1464
1537
  ## Extends
1465
1538
 
1466
1539
  - `Error`
@@ -1479,6 +1552,8 @@ optional statusCode: number;
1479
1552
 
1480
1553
  ***
1481
1554
 
1555
+ A link with an href and associated metadata.
1556
+
1482
1557
  ## Properties
1483
1558
 
1484
1559
  ### href
@@ -1501,6 +1576,8 @@ meta: Record<string, unknown>;
1501
1576
 
1502
1577
  ***
1503
1578
 
1579
+ Contains the resource linkage data for a JSON:API relationship.
1580
+
1504
1581
  ## Properties
1505
1582
 
1506
1583
  ### data
@@ -1515,6 +1592,8 @@ data: ResourceLinkage;
1515
1592
 
1516
1593
  ***
1517
1594
 
1595
+ Contains the links for a JSON:API relationship.
1596
+
1518
1597
  ## Properties
1519
1598
 
1520
1599
  ### links
@@ -1531,6 +1610,8 @@ links:
1531
1610
 
1532
1611
  ***
1533
1612
 
1613
+ A relationship link pointing to a related resource.
1614
+
1534
1615
  ## Properties
1535
1616
 
1536
1617
  ### related
@@ -1547,6 +1628,8 @@ A related resource link
1547
1628
 
1548
1629
  ***
1549
1630
 
1631
+ A relationship link pointing to the relationship itself.
1632
+
1550
1633
  ## Properties
1551
1634
 
1552
1635
  ### self
@@ -1565,6 +1648,8 @@ deleting the people resource itself. When fetched successfully, this link return
1565
1648
 
1566
1649
  ***
1567
1650
 
1651
+ JSON:API version and metadata descriptor.
1652
+
1568
1653
  ## Properties
1569
1654
 
1570
1655
  ### meta?
@@ -1587,6 +1672,8 @@ optional version: "1.0" | "1.1";
1587
1672
 
1588
1673
  ***
1589
1674
 
1675
+ Configuration options for creating a logger instance.
1676
+
1590
1677
  ## Properties
1591
1678
 
1592
1679
  ### defaultMeta?
@@ -1609,6 +1696,8 @@ optional level: LoggerVerbosity;
1609
1696
 
1610
1697
  ***
1611
1698
 
1699
+ Defines an Express route with its HTTP method, path, and handler(s).
1700
+
1612
1701
  ## Type Parameters
1613
1702
 
1614
1703
  ### H
@@ -1680,6 +1769,8 @@ or "/data/attributes/title" for a specific attribute].
1680
1769
  type ApiLink = string | HrefWithMeta;
1681
1770
  ```
1682
1771
 
1772
+ A JSON:API link, either a simple URL string or an object with href and metadata.
1773
+
1683
1774
  ### <a id="ApiLinks"></a>ApiLinks
1684
1775
 
1685
1776
  [**@xylabs/express**](#../README)
@@ -1690,6 +1781,8 @@ type ApiLink = string | HrefWithMeta;
1690
1781
  type ApiLinks = Record<string, ApiLink>;
1691
1782
  ```
1692
1783
 
1784
+ A collection of named JSON:API links.
1785
+
1693
1786
  ### <a id="ApiResponse"></a>ApiResponse
1694
1787
 
1695
1788
  [**@xylabs/express**](#../README)
@@ -1702,6 +1795,8 @@ type ApiResponse<T> =
1702
1795
  | ApiErrorResponse;
1703
1796
  ```
1704
1797
 
1798
+ A JSON:API response, either a data response or an error response.
1799
+
1705
1800
  ## Type Parameters
1706
1801
 
1707
1802
  ### T
@@ -1718,6 +1813,8 @@ type ApiResponse<T> =
1718
1813
  type HttpMethod = "get" | "post" | "put" | "patch" | "delete" | "options" | "head";
1719
1814
  ```
1720
1815
 
1816
+ Supported HTTP methods for route definitions.
1817
+
1721
1818
  ### <a id="LogFunction"></a>LogFunction
1722
1819
 
1723
1820
  [**@xylabs/express**](#../README)
@@ -1756,6 +1853,8 @@ use from @xylabs/logger instead
1756
1853
  type LoggerMeta = Record<string, string | number>;
1757
1854
  ```
1758
1855
 
1856
+ Metadata key-value pairs attached to log entries.
1857
+
1759
1858
  ### <a id="LoggerVerbosity"></a>LoggerVerbosity
1760
1859
 
1761
1860
  [**@xylabs/express**](#../README)
@@ -1766,6 +1865,8 @@ type LoggerMeta = Record<string, string | number>;
1766
1865
  type LoggerVerbosity = "error" | "warn" | "info" | "debug" | "all";
1767
1866
  ```
1768
1867
 
1868
+ Application-level log verbosity levels.
1869
+
1769
1870
  ### <a id="NoLocals"></a>NoLocals
1770
1871
 
1771
1872
  [**@xylabs/express**](#../README)
@@ -1776,6 +1877,8 @@ type LoggerVerbosity = "error" | "warn" | "info" | "debug" | "all";
1776
1877
  type NoLocals = Record<string, any>;
1777
1878
  ```
1778
1879
 
1880
+ Default type for response locals.
1881
+
1779
1882
  ### <a id="NoReqBody"></a>NoReqBody
1780
1883
 
1781
1884
  [**@xylabs/express**](#../README)
@@ -1786,6 +1889,8 @@ type NoLocals = Record<string, any>;
1786
1889
  type NoReqBody = Empty;
1787
1890
  ```
1788
1891
 
1892
+ Default type for request body when none is specified.
1893
+
1789
1894
  ### <a id="NoReqParams"></a>NoReqParams
1790
1895
 
1791
1896
  [**@xylabs/express**](#../README)
@@ -1796,6 +1901,8 @@ type NoReqBody = Empty;
1796
1901
  type NoReqParams = ParamsDictionary;
1797
1902
  ```
1798
1903
 
1904
+ Default type for request route parameters.
1905
+
1799
1906
  ### <a id="NoReqQuery"></a>NoReqQuery
1800
1907
 
1801
1908
  [**@xylabs/express**](#../README)
@@ -1806,6 +1913,8 @@ type NoReqParams = ParamsDictionary;
1806
1913
  type NoReqQuery = Query;
1807
1914
  ```
1808
1915
 
1916
+ Default type for request query parameters.
1917
+
1809
1918
  ### <a id="NoResBody"></a>NoResBody
1810
1919
 
1811
1920
  [**@xylabs/express**](#../README)
@@ -1816,6 +1925,8 @@ type NoReqQuery = Query;
1816
1925
  type NoResBody = Empty;
1817
1926
  ```
1818
1927
 
1928
+ Default type for response body when none is specified.
1929
+
1819
1930
  ### <a id="ParseFunc"></a>ParseFunc
1820
1931
 
1821
1932
  [**@xylabs/express**](#../README)
@@ -1826,6 +1937,8 @@ type NoResBody = Empty;
1826
1937
  type ParseFunc<T> = (value) => T;
1827
1938
  ```
1828
1939
 
1940
+ A function that parses a string value into the target type.
1941
+
1829
1942
  ## Type Parameters
1830
1943
 
1831
1944
  ### T
@@ -1869,6 +1982,8 @@ Relationships may be to-one or to-many.
1869
1982
  type RelationshipMeta = Record<string, unknown>;
1870
1983
  ```
1871
1984
 
1985
+ Non-standard metadata associated with a JSON:API relationship.
1986
+
1872
1987
  ### <a id="ResourceLinkage"></a>ResourceLinkage
1873
1988
 
1874
1989
  [**@xylabs/express**](#../README)
@@ -2016,6 +2131,8 @@ A JSON Body Parser middleware handler initialized with the default options
2016
2131
  const notImplemented: RequestHandler;
2017
2132
  ```
2018
2133
 
2134
+ Express request handler that responds with a 501 Not Implemented error.
2135
+
2019
2136
  ### <a id="standardResponses"></a>standardResponses
2020
2137
 
2021
2138
  [**@xylabs/express**](#../README)
@@ -1,5 +1,7 @@
1
1
  import type { RequestHandler } from 'express-serve-static-core';
2
+ /** Supported HTTP methods for route definitions. */
2
3
  export type HttpMethod = 'get' | 'post' | 'put' | 'patch' | 'delete' | 'options' | 'head';
4
+ /** Defines an Express route with its HTTP method, path, and handler(s). */
3
5
  export interface RouteDefinition<H extends RequestHandler = RequestHandler> {
4
6
  handlers: H[] | H;
5
7
  method: HttpMethod;
@@ -1 +1 @@
1
- {"version":3,"file":"RouteDefinition.d.ts","sourceRoot":"","sources":["../../../../src/Handler/RouteDefinition/RouteDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE/D,MAAM,MAAM,UAAU,GAChB,KAAK,GACL,MAAM,GACN,KAAK,GACL,OAAO,GACP,QAAQ,GACR,SAAS,GACT,MAAM,CAAA;AAEZ,MAAM,WAAW,eAAe,CAC9B,CAAC,SAAS,cAAc,GAAG,cAAc;IAEzC,QAAQ,EAAE,CAAC,EAAE,GAAG,CAAC,CAAA;IACjB,MAAM,EAAE,UAAU,CAAA;IAClB,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;CACtB"}
1
+ {"version":3,"file":"RouteDefinition.d.ts","sourceRoot":"","sources":["../../../../src/Handler/RouteDefinition/RouteDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE/D,oDAAoD;AACpD,MAAM,MAAM,UAAU,GAChB,KAAK,GACL,MAAM,GACN,KAAK,GACL,OAAO,GACP,QAAQ,GACR,SAAS,GACT,MAAM,CAAA;AAEZ,2EAA2E;AAC3E,MAAM,WAAW,eAAe,CAC9B,CAAC,SAAS,cAAc,GAAG,cAAc;IAEzC,QAAQ,EAAE,CAAC,EAAE,GAAG,CAAC,CAAA;IACjB,MAAM,EAAE,UAAU,CAAA;IAClB,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;CACtB"}
@@ -1,4 +1,9 @@
1
1
  import type { Express } from 'express-serve-static-core';
2
2
  import type { RouteDefinition } from './RouteDefinition.ts';
3
+ /**
4
+ * Registers an array of route definitions on an Express application.
5
+ * @param app The Express application to register routes on.
6
+ * @param routeDefinitions The route definitions to register.
7
+ */
3
8
  export declare const addRouteDefinitions: (app: Express, routeDefinitions: RouteDefinition[]) => void;
4
9
  //# sourceMappingURL=addRouteDefinitions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"addRouteDefinitions.d.ts","sourceRoot":"","sources":["../../../../src/Handler/RouteDefinition/addRouteDefinitions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAExD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAE3D,eAAO,MAAM,mBAAmB,GAAI,KAAK,OAAO,EAAE,kBAAkB,eAAe,EAAE,SAIpF,CAAA"}
1
+ {"version":3,"file":"addRouteDefinitions.d.ts","sourceRoot":"","sources":["../../../../src/Handler/RouteDefinition/addRouteDefinitions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAExD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAE3D;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,KAAK,OAAO,EAAE,kBAAkB,eAAe,EAAE,SAIpF,CAAA"}
@@ -1,3 +1,4 @@
1
1
  import type { RequestHandler } from 'express-serve-static-core';
2
+ /** Express request handler that responds with a 501 Not Implemented error. */
2
3
  export declare const notImplemented: RequestHandler;
3
4
  //# sourceMappingURL=notImplemented.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"notImplemented.d.ts","sourceRoot":"","sources":["../../../../src/Handler/StatusCodeHandlers/notImplemented.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAG/D,eAAO,MAAM,cAAc,EAAE,cAE5B,CAAA"}
1
+ {"version":3,"file":"notImplemented.d.ts","sourceRoot":"","sources":["../../../../src/Handler/StatusCodeHandlers/notImplemented.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAG/D,8EAA8E;AAC9E,eAAO,MAAM,cAAc,EAAE,cAE5B,CAAA"}
@@ -1,10 +1,21 @@
1
1
  import type { NextFunction, ParamsDictionary, Query, Request, RequestHandler, Response } from 'express-serve-static-core';
2
+ /**
3
+ * Wraps an async Express request handler to forward rejected promises to the error handler.
4
+ * @param fn The async request handler to wrap.
5
+ * @returns A request handler that catches async errors and passes them to next().
6
+ */
2
7
  export declare function asyncHandler<P = NoReqParams, ResBody = NoResBody, ReqBody = NoReqBody, ReqQuery = NoReqQuery, Locals extends NoLocals = NoLocals>(fn: RequestHandler<P, ResBody, ReqBody, ReqQuery, Locals>): (req: Request<P, ResBody, ReqBody, ReqQuery, Locals>, res: Response<ResBody, Locals>, next: NextFunction) => Promise<unknown>;
8
+ /** Empty object type used as a default for request/response body generics. */
3
9
  export interface Empty {
4
10
  }
11
+ /** Default type for request route parameters. */
5
12
  export type NoReqParams = ParamsDictionary;
13
+ /** Default type for response body when none is specified. */
6
14
  export type NoResBody = Empty;
15
+ /** Default type for request body when none is specified. */
7
16
  export type NoReqBody = Empty;
17
+ /** Default type for request query parameters. */
8
18
  export type NoReqQuery = Query;
19
+ /** Default type for response locals. */
9
20
  export type NoLocals = Record<string, any>;
10
21
  //# sourceMappingURL=asyncHandler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"asyncHandler.d.ts","sourceRoot":"","sources":["../../../src/Handler/asyncHandler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAAE,gBAAgB,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EACzE,MAAM,2BAA2B,CAAA;AAElC,wBAAgB,YAAY,CAAC,CAAC,GAAG,WAAW,EAAE,OAAO,GAAG,SAAS,EAAE,OAAO,GAAG,SAAS,EAAE,QAAQ,GAAG,UAAU,EAAE,MAAM,SAAS,QAAQ,GAAG,QAAQ,EAC/I,EAAE,EAAE,cAAc,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,IAEjD,KAAK,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,KAAK,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,YAAY,sBAGhH;AAED,MAAM,WAAW,KAAK;CAAG;AAEzB,MAAM,MAAM,WAAW,GAAG,gBAAgB,CAAA;AAC1C,MAAM,MAAM,SAAS,GAAG,KAAK,CAAA;AAC7B,MAAM,MAAM,SAAS,GAAG,KAAK,CAAA;AAC7B,MAAM,MAAM,UAAU,GAAG,KAAK,CAAA;AAE9B,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA"}
1
+ {"version":3,"file":"asyncHandler.d.ts","sourceRoot":"","sources":["../../../src/Handler/asyncHandler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAAE,gBAAgB,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EACzE,MAAM,2BAA2B,CAAA;AAElC;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,CAAC,GAAG,WAAW,EAAE,OAAO,GAAG,SAAS,EAAE,OAAO,GAAG,SAAS,EAAE,QAAQ,GAAG,UAAU,EAAE,MAAM,SAAS,QAAQ,GAAG,QAAQ,EAC/I,EAAE,EAAE,cAAc,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,IAEjD,KAAK,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,KAAK,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,YAAY,sBAGhH;AAED,8EAA8E;AAC9E,MAAM,WAAW,KAAK;CAAG;AAEzB,iDAAiD;AACjD,MAAM,MAAM,WAAW,GAAG,gBAAgB,CAAA;AAC1C,6DAA6D;AAC7D,MAAM,MAAM,SAAS,GAAG,KAAK,CAAA;AAC7B,4DAA4D;AAC5D,MAAM,MAAM,SAAS,GAAG,KAAK,CAAA;AAC7B,iDAAiD;AACjD,MAAM,MAAM,UAAU,GAAG,KAAK,CAAA;AAC9B,wCAAwC;AAExC,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA"}
@@ -1,4 +1,11 @@
1
1
  import type { NextFunction, Request, Response } from 'express-serve-static-core';
2
2
  import type { ExpressError } from '../Model/index.ts';
3
+ /**
4
+ * Express error handler that logs the error and sends a JSON response with the error message and status code.
5
+ * @param error The Express error to handle.
6
+ * @param req The incoming request.
7
+ * @param res The outgoing response.
8
+ * @param next The next middleware function.
9
+ */
3
10
  export declare const errorToJsonHandler: (error: ExpressError, req: Request, res: Response, next: NextFunction) => void;
4
11
  //# sourceMappingURL=errorToJsonHandler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errorToJsonHandler.d.ts","sourceRoot":"","sources":["../../../src/Handler/errorToJsonHandler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,YAAY,EAAE,OAAO,EAAE,QAAQ,EAChC,MAAM,2BAA2B,CAAA;AAGlC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,eAAO,MAAM,kBAAkB,GAAI,OAAO,YAAY,EAAE,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,SAOtG,CAAA"}
1
+ {"version":3,"file":"errorToJsonHandler.d.ts","sourceRoot":"","sources":["../../../src/Handler/errorToJsonHandler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,YAAY,EAAE,OAAO,EAAE,QAAQ,EAChC,MAAM,2BAA2B,CAAA;AAGlC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAAI,OAAO,YAAY,EAAE,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,SAOtG,CAAA"}
@@ -1,2 +1,3 @@
1
+ /** Winston log format for local development with colorized output and timestamps. */
1
2
  export declare const logFormatLocalDev: import(".store/logform-npm-2.7.0-7a34a0bd17/package").Format;
2
3
  //# sourceMappingURL=logFormatLocalDev.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"logFormatLocalDev.d.ts","sourceRoot":"","sources":["../../../../../src/Logger/LogFormats/LocalDev/logFormatLocalDev.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,iBAAiB,8DAI7B,CAAA"}
1
+ {"version":3,"file":"logFormatLocalDev.d.ts","sourceRoot":"","sources":["../../../../../src/Logger/LogFormats/LocalDev/logFormatLocalDev.ts"],"names":[],"mappings":"AAMA,qFAAqF;AACrF,eAAO,MAAM,iBAAiB,8DAI7B,CAAA"}
@@ -1,2 +1,3 @@
1
+ /** Winston log format for Rollbar using simple text output. */
1
2
  export declare const logFormatRollbar: import(".store/logform-npm-2.7.0-7a34a0bd17/package").Format;
2
3
  //# sourceMappingURL=logFormatRollbar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"logFormatRollbar.d.ts","sourceRoot":"","sources":["../../../../../src/Logger/LogFormats/Rollbar/logFormatRollbar.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,gBAAgB,8DAAW,CAAA"}
1
+ {"version":3,"file":"logFormatRollbar.d.ts","sourceRoot":"","sources":["../../../../../src/Logger/LogFormats/Rollbar/logFormatRollbar.ts"],"names":[],"mappings":"AAIA,+DAA+D;AAC/D,eAAO,MAAM,gBAAgB,8DAAW,CAAA"}
@@ -1,2 +1,3 @@
1
+ /** Winston log format for production with structured JSON output and timestamps. */
1
2
  export declare const logFormatStructured: import(".store/logform-npm-2.7.0-7a34a0bd17/package").Format;
2
3
  //# sourceMappingURL=logFormatStructured.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"logFormatStructured.d.ts","sourceRoot":"","sources":["../../../../../src/Logger/LogFormats/Structured/logFormatStructured.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,mBAAmB,8DAA+B,CAAA"}
1
+ {"version":3,"file":"logFormatStructured.d.ts","sourceRoot":"","sources":["../../../../../src/Logger/LogFormats/Structured/logFormatStructured.ts"],"names":[],"mappings":"AAMA,oFAAoF;AACpF,eAAO,MAAM,mBAAmB,8DAA+B,CAAA"}
@@ -1,2 +1,3 @@
1
+ /** Metadata key-value pairs attached to log entries. */
1
2
  export type LoggerMeta = Record<string, string | number>;
2
3
  //# sourceMappingURL=LoggerMeta.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"LoggerMeta.d.ts","sourceRoot":"","sources":["../../../src/Logger/LoggerMeta.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAA"}
1
+ {"version":3,"file":"LoggerMeta.d.ts","sourceRoot":"","sources":["../../../src/Logger/LoggerMeta.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAA"}
@@ -1,5 +1,6 @@
1
1
  import type { LoggerMeta } from './LoggerMeta.ts';
2
2
  import type { LoggerVerbosity } from './LoggerVerbosity.ts';
3
+ /** Configuration options for creating a logger instance. */
3
4
  export interface LoggerOptions {
4
5
  defaultMeta?: LoggerMeta;
5
6
  level?: LoggerVerbosity;
@@ -1 +1 @@
1
- {"version":3,"file":"LoggerOptions.d.ts","sourceRoot":"","sources":["../../../src/Logger/LoggerOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAE3D,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,EAAE,UAAU,CAAA;IACxB,KAAK,CAAC,EAAE,eAAe,CAAA;CACxB"}
1
+ {"version":3,"file":"LoggerOptions.d.ts","sourceRoot":"","sources":["../../../src/Logger/LoggerOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAE3D,4DAA4D;AAC5D,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,EAAE,UAAU,CAAA;IACxB,KAAK,CAAC,EAAE,eAAe,CAAA;CACxB"}
@@ -1,2 +1,3 @@
1
+ /** Application-level log verbosity levels. */
1
2
  export type LoggerVerbosity = 'error' | 'warn' | 'info' | 'debug' | 'all';
2
3
  //# sourceMappingURL=LoggerVerbosity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"LoggerVerbosity.d.ts","sourceRoot":"","sources":["../../../src/Logger/LoggerVerbosity.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAA"}
1
+ {"version":3,"file":"LoggerVerbosity.d.ts","sourceRoot":"","sources":["../../../src/Logger/LoggerVerbosity.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAA"}
@@ -1,6 +1,7 @@
1
1
  import type Rollbar from 'rollbar';
2
2
  import type { TransportStreamOptions } from 'winston-transport';
3
3
  import Transport from 'winston-transport';
4
+ /** Winston transport that forwards error-level log messages to Rollbar. */
4
5
  export declare class RollbarTransport extends Transport {
5
6
  protected readonly rollbar?: Rollbar;
6
7
  constructor(opts: TransportStreamOptions, rollbar?: Rollbar);
@@ -1 +1 @@
1
- {"version":3,"file":"RollbarTransport.d.ts","sourceRoot":"","sources":["../../../../../src/Logger/Transports/Rollbar/RollbarTransport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA;AAClC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAC/D,OAAO,SAAS,MAAM,mBAAmB,CAAA;AAIzC,qBAAa,gBAAiB,SAAQ,SAAS;IAC7C,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;gBAElC,IAAI,EAAE,sBAAsB,EAC5B,OAAO,CAAC,EAAE,OAAO;IAQV,GAAG,CAAC,IAAI,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,IAAI,EAAE,MAAM,IAAI;CAK1D"}
1
+ {"version":3,"file":"RollbarTransport.d.ts","sourceRoot":"","sources":["../../../../../src/Logger/Transports/Rollbar/RollbarTransport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA;AAClC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAC/D,OAAO,SAAS,MAAM,mBAAmB,CAAA;AAIzC,2EAA2E;AAC3E,qBAAa,gBAAiB,SAAQ,SAAS;IAC7C,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;gBAElC,IAAI,EAAE,sBAAsB,EAC5B,OAAO,CAAC,EAAE,OAAO;IAQV,GAAG,CAAC,IAAI,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,IAAI,EAAE,MAAM,IAAI;CAK1D"}
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Checks whether the ROLLBAR_ACCESS_TOKEN environment variable is set.
3
+ * @param env The environment variables to check.
4
+ * @returns True if the Rollbar access token is available.
5
+ */
1
6
  export declare const canGetDefaultRollbarTransport: (env: {
2
7
  [key: string]: string | undefined;
3
8
  }) => boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"canGetDefaultRollbarTransport.d.ts","sourceRoot":"","sources":["../../../../../src/Logger/Transports/Rollbar/canGetDefaultRollbarTransport.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B,GAAI,KAAK;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;CAAE,KAAG,OAE1F,CAAA"}
1
+ {"version":3,"file":"canGetDefaultRollbarTransport.d.ts","sourceRoot":"","sources":["../../../../../src/Logger/Transports/Rollbar/canGetDefaultRollbarTransport.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,GAAI,KAAK;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;CAAE,KAAG,OAE1F,CAAA"}