@xylabs/express 4.13.13 → 4.13.15

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 (116) hide show
  1. package/build/node/Handler/StatusCodeHandlers/index.d.ts +2 -0
  2. package/build/node/Handler/StatusCodeHandlers/index.d.ts.map +1 -0
  3. package/build/node/Handler/StatusCodeHandlers/notImplemented.d.ts +3 -0
  4. package/build/node/Handler/StatusCodeHandlers/notImplemented.d.ts.map +1 -0
  5. package/build/node/Handler/asyncHandler.d.ts +11 -0
  6. package/build/node/Handler/asyncHandler.d.ts.map +1 -0
  7. package/build/node/Handler/errorToJsonHandler.d.ts +4 -0
  8. package/build/node/Handler/errorToJsonHandler.d.ts.map +1 -0
  9. package/build/node/Handler/index.d.ts +4 -0
  10. package/build/node/Handler/index.d.ts.map +1 -0
  11. package/build/node/HttpUtil/getHttpHeader.d.ts +12 -0
  12. package/build/node/HttpUtil/getHttpHeader.d.ts.map +1 -0
  13. package/build/node/HttpUtil/index.d.ts +2 -0
  14. package/build/node/HttpUtil/index.d.ts.map +1 -0
  15. package/build/node/Logger/LogFormats/LocalDev/index.d.ts +2 -0
  16. package/build/node/Logger/LogFormats/LocalDev/index.d.ts.map +1 -0
  17. package/build/node/Logger/LogFormats/LocalDev/logFormatLocalDev.d.ts +2 -0
  18. package/build/node/Logger/LogFormats/LocalDev/logFormatLocalDev.d.ts.map +1 -0
  19. package/build/node/Logger/LogFormats/Rollbar/index.d.ts +2 -0
  20. package/build/node/Logger/LogFormats/Rollbar/index.d.ts.map +1 -0
  21. package/build/node/Logger/LogFormats/Rollbar/logFormatRollbar.d.ts +2 -0
  22. package/build/node/Logger/LogFormats/Rollbar/logFormatRollbar.d.ts.map +1 -0
  23. package/build/node/Logger/LogFormats/Structured/index.d.ts +2 -0
  24. package/build/node/Logger/LogFormats/Structured/index.d.ts.map +1 -0
  25. package/build/node/Logger/LogFormats/Structured/logFormatStructured.d.ts +2 -0
  26. package/build/node/Logger/LogFormats/Structured/logFormatStructured.d.ts.map +1 -0
  27. package/build/node/Logger/LogFormats/index.d.ts +4 -0
  28. package/build/node/Logger/LogFormats/index.d.ts.map +1 -0
  29. package/build/node/Logger/LoggerMeta.d.ts +2 -0
  30. package/build/node/Logger/LoggerMeta.d.ts.map +1 -0
  31. package/build/node/Logger/LoggerOptions.d.ts +7 -0
  32. package/build/node/Logger/LoggerOptions.d.ts.map +1 -0
  33. package/build/node/Logger/LoggerVerbosity.d.ts +2 -0
  34. package/build/node/Logger/LoggerVerbosity.d.ts.map +1 -0
  35. package/build/node/Logger/Transports/Rollbar/RollbarTransport.d.ts +11 -0
  36. package/build/node/Logger/Transports/Rollbar/RollbarTransport.d.ts.map +1 -0
  37. package/build/node/Logger/Transports/Rollbar/canGetDefaultRollbarTransport.d.ts +4 -0
  38. package/build/node/Logger/Transports/Rollbar/canGetDefaultRollbarTransport.d.ts.map +1 -0
  39. package/build/node/Logger/Transports/Rollbar/getDefaultRollbarTransport.d.ts +5 -0
  40. package/build/node/Logger/Transports/Rollbar/getDefaultRollbarTransport.d.ts.map +1 -0
  41. package/build/node/Logger/Transports/Rollbar/index.d.ts +4 -0
  42. package/build/node/Logger/Transports/Rollbar/index.d.ts.map +1 -0
  43. package/build/node/Logger/Transports/index.d.ts +2 -0
  44. package/build/node/Logger/Transports/index.d.ts.map +1 -0
  45. package/build/node/Logger/WinstonVerbosity.d.ts +6 -0
  46. package/build/node/Logger/WinstonVerbosity.d.ts.map +1 -0
  47. package/build/node/Logger/WrappedWinstonLogger.d.ts +17 -0
  48. package/build/node/Logger/WrappedWinstonLogger.d.ts.map +1 -0
  49. package/build/node/Logger/getDefaultLogger.d.ts +13 -0
  50. package/build/node/Logger/getDefaultLogger.d.ts.map +1 -0
  51. package/build/node/Logger/getLogger.d.ts +4 -0
  52. package/build/node/Logger/getLogger.d.ts.map +1 -0
  53. package/build/node/Logger/index.d.ts +12 -0
  54. package/build/node/Logger/index.d.ts.map +1 -0
  55. package/build/node/Logger/toWinstonVerbosity.d.ts +4 -0
  56. package/build/node/Logger/toWinstonVerbosity.d.ts.map +1 -0
  57. package/build/node/Model/ExpressError.d.ts +4 -0
  58. package/build/node/Model/ExpressError.d.ts.map +1 -0
  59. package/build/node/Model/index.d.ts +2 -0
  60. package/build/node/Model/index.d.ts.map +1 -0
  61. package/build/node/Performance/Counters.d.ts +8 -0
  62. package/build/node/Performance/Counters.d.ts.map +1 -0
  63. package/build/node/Performance/Profiler.d.ts +5 -0
  64. package/build/node/Performance/Profiler.d.ts.map +1 -0
  65. package/build/node/Performance/index.d.ts +3 -0
  66. package/build/node/Performance/index.d.ts.map +1 -0
  67. package/build/node/Util/compactObject.d.ts +2 -0
  68. package/build/node/Util/compactObject.d.ts.map +1 -0
  69. package/build/node/Util/index.d.ts +3 -0
  70. package/build/node/Util/index.d.ts.map +1 -0
  71. package/build/node/Util/tryParse.d.ts +5 -0
  72. package/build/node/Util/tryParse.d.ts.map +1 -0
  73. package/build/node/index.d.ts +8 -0
  74. package/build/node/index.d.ts.map +1 -0
  75. package/build/node/middleware/caseInsensitiveRouting/caseInsensitiveRouting.d.ts +14 -0
  76. package/build/node/middleware/caseInsensitiveRouting/caseInsensitiveRouting.d.ts.map +1 -0
  77. package/build/node/middleware/caseInsensitiveRouting/index.d.ts +2 -0
  78. package/build/node/middleware/caseInsensitiveRouting/index.d.ts.map +1 -0
  79. package/build/node/middleware/customPoweredByHeader/customPoweredByHeader.d.ts +15 -0
  80. package/build/node/middleware/customPoweredByHeader/customPoweredByHeader.d.ts.map +1 -0
  81. package/build/node/middleware/customPoweredByHeader/index.d.ts +2 -0
  82. package/build/node/middleware/customPoweredByHeader/index.d.ts.map +1 -0
  83. package/build/node/middleware/index.d.ts +6 -0
  84. package/build/node/middleware/index.d.ts.map +1 -0
  85. package/build/node/middleware/jsonBodyParser/index.d.ts +2 -0
  86. package/build/node/middleware/jsonBodyParser/index.d.ts.map +1 -0
  87. package/build/node/middleware/jsonBodyParser/jsonBodyParser.d.ts +33 -0
  88. package/build/node/middleware/jsonBodyParser/jsonBodyParser.d.ts.map +1 -0
  89. package/build/node/middleware/metrics/counters.d.ts +3 -0
  90. package/build/node/middleware/metrics/counters.d.ts.map +1 -0
  91. package/build/node/middleware/metrics/index.d.ts +3 -0
  92. package/build/node/middleware/metrics/index.d.ts.map +1 -0
  93. package/build/node/middleware/metrics/responseProfiler.d.ts +15 -0
  94. package/build/node/middleware/metrics/responseProfiler.d.ts.map +1 -0
  95. package/build/node/middleware/standardResponses/getResponseMetadata.d.ts +3 -0
  96. package/build/node/middleware/standardResponses/getResponseMetadata.d.ts.map +1 -0
  97. package/build/node/middleware/standardResponses/index.d.ts +5 -0
  98. package/build/node/middleware/standardResponses/index.d.ts.map +1 -0
  99. package/build/node/middleware/standardResponses/jsonApi/error.d.ts +51 -0
  100. package/build/node/middleware/standardResponses/jsonApi/error.d.ts.map +1 -0
  101. package/build/node/middleware/standardResponses/jsonApi/index.d.ts +6 -0
  102. package/build/node/middleware/standardResponses/jsonApi/index.d.ts.map +1 -0
  103. package/build/node/middleware/standardResponses/jsonApi/links.d.ts +7 -0
  104. package/build/node/middleware/standardResponses/jsonApi/links.d.ts.map +1 -0
  105. package/build/node/middleware/standardResponses/jsonApi/relationship.d.ts +38 -0
  106. package/build/node/middleware/standardResponses/jsonApi/relationship.d.ts.map +1 -0
  107. package/build/node/middleware/standardResponses/jsonApi/resourceIdentifier.d.ts +16 -0
  108. package/build/node/middleware/standardResponses/jsonApi/resourceIdentifier.d.ts.map +1 -0
  109. package/build/node/middleware/standardResponses/jsonApi/response.d.ts +44 -0
  110. package/build/node/middleware/standardResponses/jsonApi/response.d.ts.map +1 -0
  111. package/build/node/middleware/standardResponses/standardErrors.d.ts +4 -0
  112. package/build/node/middleware/standardResponses/standardErrors.d.ts.map +1 -0
  113. package/build/node/middleware/standardResponses/standardResponses.d.ts +27 -0
  114. package/build/node/middleware/standardResponses/standardResponses.d.ts.map +1 -0
  115. package/dist/node/index.d.ts +1 -1
  116. package/package.json +7 -7
@@ -0,0 +1,2 @@
1
+ export * from './notImplemented.ts';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Handler/StatusCodeHandlers/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { RequestHandler } from 'express';
2
+ export declare const notImplemented: RequestHandler;
3
+ //# sourceMappingURL=notImplemented.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notImplemented.d.ts","sourceRoot":"","sources":["../../../../src/Handler/StatusCodeHandlers/notImplemented.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAG7C,eAAO,MAAM,cAAc,EAAE,cAE5B,CAAA"}
@@ -0,0 +1,11 @@
1
+ import type { NextFunction, Request, RequestHandler, Response } from 'express';
2
+ import type { ParamsDictionary, Query } from 'express-serve-static-core';
3
+ 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<void>;
4
+ export interface Empty {
5
+ }
6
+ export type NoReqParams = ParamsDictionary;
7
+ export type NoResBody = Empty;
8
+ export type NoReqBody = Empty;
9
+ export type NoReqQuery = Query;
10
+ export type NoLocals = Record<string, any>;
11
+ //# sourceMappingURL=asyncHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asyncHandler.d.ts","sourceRoot":"","sources":["../../../src/Handler/asyncHandler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAChD,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAA;AAExE,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,mBAGhH;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"}
@@ -0,0 +1,4 @@
1
+ import type { NextFunction, Request, Response } from 'express';
2
+ import type { ExpressError } from '../Model/index.ts';
3
+ export declare const errorToJsonHandler: (error: ExpressError, req: Request, res: Response, next: NextFunction) => void;
4
+ //# sourceMappingURL=errorToJsonHandler.d.ts.map
@@ -0,0 +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,SAAS,CAAA;AAEhB,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"}
@@ -0,0 +1,4 @@
1
+ export * from './asyncHandler.ts';
2
+ export * from './errorToJsonHandler.ts';
3
+ export * from './StatusCodeHandlers/index.ts';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Handler/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,yBAAyB,CAAA;AACvC,cAAc,+BAA+B,CAAA"}
@@ -0,0 +1,12 @@
1
+ import type { Request } from 'express-serve-static-core';
2
+ /**
3
+ * Since there can be multiple of certain HTTP headers or
4
+ * to prevent ugliness if someone did send us multiple
5
+ * instances of a header we only expect one of, this
6
+ * method grabs the 1st/only one of the desired header
7
+ * @param header The header to find
8
+ * @param req The received HTTP request (with headers)
9
+ * @returns The first or only occurrence of the specified HTTP header
10
+ */
11
+ export declare const getHttpHeader: (header: string, req: Request) => string | undefined;
12
+ //# sourceMappingURL=getHttpHeader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getHttpHeader.d.ts","sourceRoot":"","sources":["../../../src/HttpUtil/getHttpHeader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAExD;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,GAAI,QAAQ,MAAM,EAAE,KAAK,OAAO,KAAG,MAAM,GAAG,SAcrE,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './getHttpHeader.ts';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/HttpUtil/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './logFormatLocalDev.ts';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/Logger/LogFormats/LocalDev/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const logFormatLocalDev: import(".store/logform-npm-2.7.0-7a34a0bd17/package").Format;
2
+ //# sourceMappingURL=logFormatLocalDev.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logFormatLocalDev.d.ts","sourceRoot":"","sources":["../../../../../src/Logger/LogFormats/LocalDev/logFormatLocalDev.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,iBAAiB,8DAI7B,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './logFormatRollbar.ts';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/Logger/LogFormats/Rollbar/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const logFormatRollbar: import(".store/logform-npm-2.7.0-7a34a0bd17/package").Format;
2
+ //# sourceMappingURL=logFormatRollbar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logFormatRollbar.d.ts","sourceRoot":"","sources":["../../../../../src/Logger/LogFormats/Rollbar/logFormatRollbar.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,gBAAgB,8DAAW,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './logFormatStructured.ts';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/Logger/LogFormats/Structured/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const logFormatStructured: import(".store/logform-npm-2.7.0-7a34a0bd17/package").Format;
2
+ //# sourceMappingURL=logFormatStructured.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,4 @@
1
+ export * from './LocalDev/index.ts';
2
+ export * from './Rollbar/index.ts';
3
+ export * from './Structured/index.ts';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Logger/LogFormats/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,uBAAuB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export type LoggerMeta = Record<string, string | number>;
2
+ //# sourceMappingURL=LoggerMeta.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,7 @@
1
+ import type { LoggerMeta } from './LoggerMeta.ts';
2
+ import type { LoggerVerbosity } from './LoggerVerbosity.ts';
3
+ export interface LoggerOptions {
4
+ defaultMeta?: LoggerMeta;
5
+ level?: LoggerVerbosity;
6
+ }
7
+ //# sourceMappingURL=LoggerOptions.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,2 @@
1
+ export type LoggerVerbosity = 'error' | 'warn' | 'info' | 'debug' | 'all';
2
+ //# sourceMappingURL=LoggerVerbosity.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,11 @@
1
+ import type Rollbar from 'rollbar';
2
+ import type { TransportStreamOptions } from 'winston-transport';
3
+ import Transport from 'winston-transport';
4
+ export declare class RollbarTransport extends Transport {
5
+ protected readonly rollbar?: Rollbar | undefined;
6
+ constructor(opts: TransportStreamOptions, rollbar?: Rollbar | undefined);
7
+ log(info: {
8
+ message?: string;
9
+ }, next: () => void): void;
10
+ }
11
+ //# sourceMappingURL=RollbarTransport.d.ts.map
@@ -0,0 +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;IAG3C,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO;gBADpC,IAAI,EAAE,sBAAsB,EACT,OAAO,CAAC,EAAE,OAAO,YAAA;IAO7B,GAAG,CAAC,IAAI,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,IAAI,EAAE,MAAM,IAAI;CAK1D"}
@@ -0,0 +1,4 @@
1
+ export declare const canGetDefaultRollbarTransport: (env: {
2
+ [key: string]: string | undefined;
3
+ }) => boolean;
4
+ //# sourceMappingURL=canGetDefaultRollbarTransport.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,5 @@
1
+ import { RollbarTransport } from './RollbarTransport.ts';
2
+ export declare const getDefaultRollbarTransport: (env: {
3
+ [key: string]: string | undefined;
4
+ }) => RollbarTransport;
5
+ //# sourceMappingURL=getDefaultRollbarTransport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getDefaultRollbarTransport.d.ts","sourceRoot":"","sources":["../../../../../src/Logger/Transports/Rollbar/getDefaultRollbarTransport.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAExD,eAAO,MAAM,0BAA0B,GAAI,KAAK;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;CAAE,KAAG,gBAIvF,CAAA"}
@@ -0,0 +1,4 @@
1
+ export * from './canGetDefaultRollbarTransport.ts';
2
+ export * from './getDefaultRollbarTransport.ts';
3
+ export * from './RollbarTransport.ts';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/Logger/Transports/Rollbar/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAA;AAClD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,uBAAuB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './Rollbar/index.ts';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Logger/Transports/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Follows NPM log levels
3
+ * https://docs.npmjs.com/cli/v8/using-npm/logging#loglevel
4
+ */
5
+ export type WinstonVerbosity = 'error' | 'warn' | 'info' | 'http' | 'verbose' | 'debug' | 'silly';
6
+ //# sourceMappingURL=WinstonVerbosity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WinstonVerbosity.d.ts","sourceRoot":"","sources":["../../../src/Logger/WinstonVerbosity.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAA"}
@@ -0,0 +1,17 @@
1
+ import type { LogFunction, Logger } from '@xylabs/logger';
2
+ import type { Logger as Winston } from 'winston';
3
+ /**
4
+ * Wrap Winston logger methods to adapt to familiar
5
+ * console logging methods
6
+ */
7
+ export declare class WrappedWinstonLogger implements Logger {
8
+ protected readonly winston: Winston;
9
+ constructor(winston: Winston);
10
+ debug: LogFunction;
11
+ error: LogFunction;
12
+ info: LogFunction;
13
+ log: LogFunction;
14
+ trace: LogFunction;
15
+ warn: LogFunction;
16
+ }
17
+ //# sourceMappingURL=WrappedWinstonLogger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WrappedWinstonLogger.d.ts","sourceRoot":"","sources":["../../../src/Logger/WrappedWinstonLogger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,KAAK,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,SAAS,CAAA;AAEhD;;;GAGG;AACH,qBAAa,oBAAqB,YAAW,MAAM;IACrC,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO;gBAAhB,OAAO,EAAE,OAAO;IAC/C,KAAK,EAAE,WAAW,CAAyC;IAC3D,KAAK,EAAE,WAAW,CAAyC;IAC3D,IAAI,EAAE,WAAW,CAAwC;IACzD,GAAG,EAAE,WAAW,CAAwC;IACxD,KAAK,EAAE,WAAW,CAAyC;IAC3D,IAAI,EAAE,WAAW,CAAwC;CAC1D"}
@@ -0,0 +1,13 @@
1
+ import type { Logger } from '@xylabs/logger';
2
+ import type { WrappedWinstonLogger } from './WrappedWinstonLogger.ts';
3
+ /**
4
+ * Static instance to prevent multiple instances of the same logger
5
+ * with the same config
6
+ */
7
+ declare global {
8
+ var xy: {
9
+ defaultLogger?: WrappedWinstonLogger;
10
+ };
11
+ }
12
+ export declare const getDefaultLogger: () => Logger;
13
+ //# sourceMappingURL=getDefaultLogger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getDefaultLogger.d.ts","sourceRoot":"","sources":["../../../src/Logger/getDefaultLogger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAG5C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAErE;;;GAGG;AAEH,OAAO,CAAC,MAAM,CAAC;IACb,IAAI,EAAE,EAAE;QACN,aAAa,CAAC,EAAE,oBAAoB,CAAA;KACrC,CAAA;CACF;AAED,eAAO,MAAM,gBAAgB,QAAO,MAInC,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { Logger } from '@xylabs/logger';
2
+ import type { LoggerVerbosity } from './LoggerVerbosity.ts';
3
+ export declare const getLogger: (minVerbosity?: LoggerVerbosity) => Logger;
4
+ //# sourceMappingURL=getLogger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getLogger.d.ts","sourceRoot":"","sources":["../../../src/Logger/getLogger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAK5C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAiC3D,eAAO,MAAM,SAAS,GAAI,eAAc,eAAwB,KAAG,MAgBlE,CAAA"}
@@ -0,0 +1,12 @@
1
+ export * from './getDefaultLogger.ts';
2
+ export * from './getLogger.ts';
3
+ export * from './LoggerMeta.ts';
4
+ export * from './LoggerOptions.ts';
5
+ export * from './LoggerVerbosity.ts';
6
+ export * from './WrappedWinstonLogger.ts';
7
+ import type { LogFunction as XyLabsLogFunction, Logger as XyLabsLogger } from '@xylabs/logger';
8
+ /** @deprecated use from @xylabs/logger instead */
9
+ export type LogFunction = XyLabsLogFunction;
10
+ /** @deprecated use from @xylabs/logger instead */
11
+ export type Logger = XyLabsLogger;
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Logger/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,2BAA2B,CAAA;AACzC,OAAO,KAAK,EAAE,WAAW,IAAI,iBAAiB,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE9F,kDAAkD;AAClD,MAAM,MAAM,WAAW,GAAG,iBAAiB,CAAA;AAE3C,kDAAkD;AAClD,MAAM,MAAM,MAAM,GAAG,YAAY,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { LoggerVerbosity } from './LoggerVerbosity.ts';
2
+ import type { WinstonVerbosity } from './WinstonVerbosity.ts';
3
+ export declare const toWinstonVerbosity: (loggerVerbosity: LoggerVerbosity) => WinstonVerbosity;
4
+ //# sourceMappingURL=toWinstonVerbosity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toWinstonVerbosity.d.ts","sourceRoot":"","sources":["../../../src/Logger/toWinstonVerbosity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAE7D,eAAO,MAAM,kBAAkB,GAAI,iBAAiB,eAAe,KAAG,gBAErE,CAAA"}
@@ -0,0 +1,4 @@
1
+ export interface ExpressError extends Error {
2
+ statusCode?: number;
3
+ }
4
+ //# sourceMappingURL=ExpressError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpressError.d.ts","sourceRoot":"","sources":["../../../src/Model/ExpressError.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAa,SAAQ,KAAK;IACzC,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB"}
@@ -0,0 +1,2 @@
1
+ export * from './ExpressError.ts';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Model/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA"}
@@ -0,0 +1,8 @@
1
+ export declare class Counters {
2
+ static counters: Record<string, number>;
3
+ static inc(name: string, count?: number): void;
4
+ static max(name: string, count: number): void;
5
+ static min(name: string, count: number): void;
6
+ private static catchError;
7
+ }
8
+ //# sourceMappingURL=Counters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Counters.d.ts","sourceRoot":"","sources":["../../../src/Performance/Counters.ts"],"names":[],"mappings":"AAAA,qBAAa,QAAQ;IACnB,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAK;IAE5C,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,SAAI;IAMlC,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAStC,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAStC,OAAO,CAAC,MAAM,CAAC,UAAU,CAOxB;CACF"}
@@ -0,0 +1,5 @@
1
+ export declare class Profiler {
2
+ stats: Record<string, number>;
3
+ profile<T>(name: string, promise: Promise<T>): Promise<T>;
4
+ }
5
+ //# sourceMappingURL=Profiler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Profiler.d.ts","sourceRoot":"","sources":["../../../src/Performance/Profiler.ts"],"names":[],"mappings":"AAAA,qBAAa,QAAQ;IACnB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAK;IAE5B,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;CAMnD"}
@@ -0,0 +1,3 @@
1
+ export * from './Counters.ts';
2
+ export * from './Profiler.ts';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Performance/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const compactObject: <T extends Record<string, unknown>>(obj: T) => T;
2
+ //# sourceMappingURL=compactObject.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compactObject.d.ts","sourceRoot":"","sources":["../../../src/Util/compactObject.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,CAAC,KAOpD,CAClB,CAAA"}
@@ -0,0 +1,3 @@
1
+ export * from './compactObject.ts';
2
+ export * from './tryParse.ts';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Util/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA"}
@@ -0,0 +1,5 @@
1
+ export type ParseFunc<T = number> = (value: string) => T;
2
+ export declare const tryParse: <T = number>(func: ParseFunc<T>, value?: string) => (T & {}) | undefined;
3
+ export declare const tryParseFloat: (value?: string) => number | undefined;
4
+ export declare const tryParseInt: (value?: string) => number | undefined;
5
+ //# sourceMappingURL=tryParse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tryParse.d.ts","sourceRoot":"","sources":["../../../src/Util/tryParse.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,SAAS,CAAC,CAAC,GAAG,MAAM,IAAI,CAAC,KAAK,EAAE,MAAM,KAAK,CAAC,CAAA;AAExD,eAAO,MAAM,QAAQ,GAAI,CAAC,GAAG,MAAM,EAAE,MAAM,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,MAAM,yBAStE,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,QAAQ,MAAM,uBAE3C,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,QAAQ,MAAM,uBAEzC,CAAA"}
@@ -0,0 +1,8 @@
1
+ export * from './Handler/index.ts';
2
+ export * from './HttpUtil/index.ts';
3
+ export * from './Logger/index.ts';
4
+ export * from './middleware/index.ts';
5
+ export * from './Model/index.ts';
6
+ export * from './Performance/index.ts';
7
+ export * from './Util/index.ts';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,cAAc,uBAAuB,CAAA;AACrC,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA"}
@@ -0,0 +1,14 @@
1
+ import type { Express } from 'express';
2
+ /**
3
+ * Enable case sensitivity. When enabled, "/Foo" and "/foo" are different
4
+ * routes. When disabled, "/Foo" and "/foo" are treated the same.
5
+ * @param app The Express app to disable the header on.
6
+ */
7
+ export declare const enableCaseSensitiveRouting: (app: Express) => void;
8
+ /**
9
+ * Disable case sensitivity. When enabled, "/Foo" and "/foo" are different
10
+ * routes. When disabled, "/Foo" and "/foo" are treated the same.
11
+ * @param app The Express app to disable the header on.
12
+ */
13
+ export declare const disableCaseSensitiveRouting: (app: Express) => void;
14
+ //# sourceMappingURL=caseInsensitiveRouting.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"caseInsensitiveRouting.d.ts","sourceRoot":"","sources":["../../../../src/middleware/caseInsensitiveRouting/caseInsensitiveRouting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAItC;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,GAAI,KAAK,OAAO,SAEtD,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,GAAI,KAAK,OAAO,SAEvD,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './caseInsensitiveRouting.ts';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/middleware/caseInsensitiveRouting/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAA"}
@@ -0,0 +1,15 @@
1
+ import type { Express, NextFunction, Request, Response } from 'express';
2
+ /**
3
+ * By default Express appends the `X-Powered-By: Express` header to
4
+ * all responses. Calling this method enables that behavior.
5
+ * @param app The Express app to disable the header on.
6
+ */
7
+ export declare const enableExpressDefaultPoweredByHeader: (app: Express) => void;
8
+ /**
9
+ * By default Express appends the `X-Powered-By: Express` header to
10
+ * all responses. Calling this method disables that behavior.
11
+ * @param app The Express app to disable the header on.
12
+ */
13
+ export declare const disableExpressDefaultPoweredByHeader: (app: Express) => void;
14
+ export declare const customPoweredByHeader: (req: Request, res: Response, next: NextFunction) => void;
15
+ //# sourceMappingURL=customPoweredByHeader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customPoweredByHeader.d.ts","sourceRoot":"","sources":["../../../../src/middleware/customPoweredByHeader/customPoweredByHeader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EACzC,MAAM,SAAS,CAAA;AAKhB;;;;GAIG;AACH,eAAO,MAAM,mCAAmC,GAAI,KAAK,OAAO,SAE/D,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,oCAAoC,GAAI,KAAK,OAAO,SAEhE,CAAA;AAED,eAAO,MAAM,qBAAqB,GAAI,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,SAGpF,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './customPoweredByHeader.ts';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/middleware/customPoweredByHeader/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA"}
@@ -0,0 +1,6 @@
1
+ export * from './caseInsensitiveRouting/index.ts';
2
+ export * from './customPoweredByHeader/index.ts';
3
+ export * from './jsonBodyParser/index.ts';
4
+ export * from './metrics/index.ts';
5
+ export * from './standardResponses/index.ts';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/middleware/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAA;AACjD,cAAc,kCAAkC,CAAA;AAChD,cAAc,2BAA2B,CAAA;AACzC,cAAc,oBAAoB,CAAA;AAClC,cAAc,8BAA8B,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './jsonBodyParser.ts';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/middleware/jsonBodyParser/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA"}
@@ -0,0 +1,33 @@
1
+ import type { OptionsJson } from 'body-parser';
2
+ import type { NextHandleFunction } from 'connect';
3
+ /**
4
+ * The default maximum request body size for the JSON Body Parser
5
+ */
6
+ export declare const DefaultJsonBodyParserOptionsLimit = "100kb";
7
+ /**
8
+ * The default MIME types for the JSON Body Parser
9
+ */
10
+ export declare const DefaultJsonBodyParserOptionsTypes: string[];
11
+ /**
12
+ * The default options for the JSON Body Parser
13
+ */
14
+ export declare const DefaultJsonBodyParserOptions: OptionsJson;
15
+ /**
16
+ * Gets the default JSON Body Parser options merged with the supplied options
17
+ * with the supplied options taking precedence
18
+ * @param options The options to override the default JSON Body Parser options with
19
+ * @returns The combined JSON Body Parser options with the supplied values taking
20
+ * precedence over the default
21
+ */
22
+ export declare const getJsonBodyParserOptions: (options?: Partial<OptionsJson>) => OptionsJson;
23
+ /**
24
+ * Get a JSON Body Parser connect middleware handler
25
+ * @param options The options for the JSON Body Parser
26
+ * @returns A middleware function that parses JSON bodies
27
+ */
28
+ export declare const getJsonBodyParser: (options?: OptionsJson) => NextHandleFunction;
29
+ /**
30
+ * A JSON Body Parser middleware handler initialized with the default options
31
+ */
32
+ export declare const jsonBodyParser: NextHandleFunction;
33
+ //# sourceMappingURL=jsonBodyParser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsonBodyParser.d.ts","sourceRoot":"","sources":["../../../../src/middleware/jsonBodyParser/jsonBodyParser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAEjD;;GAEG;AACH,eAAO,MAAM,iCAAiC,UAAU,CAAA;AAExD;;GAEG;AACH,eAAO,MAAM,iCAAiC,UAAoC,CAAA;AAElF;;GAEG;AACH,eAAO,MAAM,4BAA4B,EAAE,WAG1C,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,GAAI,UAAU,OAAO,CAAC,WAAW,CAAC,KAAG,WAEzE,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,UAAS,WAA0C,KAAG,kBAavF,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,oBAAsB,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { Application } from 'express';
2
+ export declare const useRequestCounters: (app: Application) => void;
3
+ //# sourceMappingURL=counters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"counters.d.ts","sourceRoot":"","sources":["../../../../src/middleware/metrics/counters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACZ,MAAM,SAAS,CAAA;AAIhB,eAAO,MAAM,kBAAkB,GAAI,KAAK,WAAW,KAAG,IAkBrD,CAAA"}
@@ -0,0 +1,3 @@
1
+ export * from './counters.ts';
2
+ export * from './responseProfiler.ts';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/middleware/metrics/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,uBAAuB,CAAA"}
@@ -0,0 +1,15 @@
1
+ import type { NextFunction, Request, Response } from 'express';
2
+ /**
3
+ * Connect middleware to enable profiling of response lifecycle timing. To effectively profile
4
+ * the response timing, this middleware needs to be called first when initializing your Express
5
+ * App
6
+ * @example
7
+ * const app = express()
8
+ * app.use(responseProfiler)
9
+ * // other initialization ...
10
+ * @param _req The request
11
+ * @param res The response
12
+ * @param next The next function
13
+ */
14
+ export declare const responseProfiler: (_req: Request, res: Response, next: NextFunction) => void;
15
+ //# sourceMappingURL=responseProfiler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"responseProfiler.d.ts","sourceRoot":"","sources":["../../../../src/middleware/metrics/responseProfiler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAAE,OAAO,EAAE,QAAQ,EAChC,MAAM,SAAS,CAAA;AAEhB;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB,GAAI,MAAM,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,SAMhF,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { Response } from 'express';
2
+ export declare const getResponseMetadata: (res: Response) => Record<string, unknown>;
3
+ //# sourceMappingURL=getResponseMetadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getResponseMetadata.d.ts","sourceRoot":"","sources":["../../../../src/middleware/standardResponses/getResponseMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEvC,eAAO,MAAM,mBAAmB,GAAI,KAAK,QAAQ,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAezE,CAAA"}
@@ -0,0 +1,5 @@
1
+ export * from './getResponseMetadata.ts';
2
+ export * from './jsonApi/index.ts';
3
+ export * from './standardErrors.ts';
4
+ export * from './standardResponses.ts';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/middleware/standardResponses/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAA;AACxC,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,wBAAwB,CAAA"}
@@ -0,0 +1,51 @@
1
+ import type { ApiLinks } from './links.ts';
2
+ /**
3
+ * An object containing references to the source of the error
4
+ */
5
+ export interface Source {
6
+ /**
7
+ * A string indicating which URI query parameter caused the error.
8
+ */
9
+ parameter?: string;
10
+ /**
11
+ * A JSON Pointer [RFC6901] to the associated entity in the request document [e.g. "/data" for a primary data object,
12
+ * or "/data/attributes/title" for a specific attribute].
13
+ */
14
+ pointer?: string;
15
+ }
16
+ export interface ApiError {
17
+ /**
18
+ * An application-specific error code, expressed as a string value.
19
+ */
20
+ code?: string;
21
+ /**
22
+ * A human-readable explanation specific to this occurrence of the problem. Like title, this field's value can be localized.
23
+ */
24
+ detail?: string;
25
+ /**
26
+ * A unique identifier for this particular occurrence of the problem.
27
+ */
28
+ id?: string;
29
+ /**
30
+ * A links object containing the following members:
31
+ * about: a link that leads to further details about this particular occurrence of the problem
32
+ */
33
+ links?: ApiLinks;
34
+ /**
35
+ * A meta object containing non-standard meta-information about the error.
36
+ */
37
+ meta?: Record<string, unknown>;
38
+ /**
39
+ * An object containing references to the source of the error, optionally including any of the following members:
40
+ */
41
+ source?: Source;
42
+ /**
43
+ * The HTTP status code applicable to this problem, expressed as a string value.
44
+ */
45
+ status?: string;
46
+ /**
47
+ * A short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization.
48
+ */
49
+ title?: string;
50
+ }
51
+ //# sourceMappingURL=error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../../../src/middleware/standardResponses/jsonApi/error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAE1C;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,QAAQ;IACvB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;IACX;;;OAGG;IACH,KAAK,CAAC,EAAE,QAAQ,CAAA;IAChB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC9B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf"}
@@ -0,0 +1,6 @@
1
+ export * from './error.ts';
2
+ export * from './links.ts';
3
+ export * from './relationship.ts';
4
+ export * from './resourceIdentifier.ts';
5
+ export * from './response.ts';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/middleware/standardResponses/jsonApi/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,mBAAmB,CAAA;AACjC,cAAc,yBAAyB,CAAA;AACvC,cAAc,eAAe,CAAA"}
@@ -0,0 +1,7 @@
1
+ export interface HrefWithMeta {
2
+ href: string;
3
+ meta: Record<string, unknown>;
4
+ }
5
+ export type ApiLink = string | HrefWithMeta;
6
+ export type ApiLinks = Record<string, ApiLink>;
7
+ //# sourceMappingURL=links.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../../../../../src/middleware/standardResponses/jsonApi/links.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC9B;AACD,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,YAAY,CAAA;AAC3C,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA"}
@@ -0,0 +1,38 @@
1
+ import type { ApiResourceIdentifierObject } from './resourceIdentifier.ts';
2
+ export interface IRelationshipSelfLink {
3
+ /**
4
+ * A link for the relationship itself (a "relationship link"). This link allows the client to directly manipulate the relationship.
5
+ * For example, removing an author through an article’s relationship URL would disconnect the person from the article without
6
+ * deleting the people resource itself. When fetched successfully, this link returns the linkage for the related resources as its primary data.
7
+ */
8
+ self: string;
9
+ }
10
+ export interface IRelationshipRelatedLink {
11
+ /**
12
+ * A related resource link
13
+ */
14
+ related: string;
15
+ }
16
+ export interface IRelationshipLinks {
17
+ links: IRelationshipRelatedLink | IRelationshipSelfLink;
18
+ }
19
+ /**
20
+ * Resource linkage in a compound document allows a client to link together all of the included resource objects without having to GET any URLs via links.
21
+ * Resource linkage MUST be represented as one of the following:
22
+ * • null for empty to-one relationships.
23
+ * • an empty array ([]) for empty to-many relationships.
24
+ * • a single resource identifier object for non-empty to-one relationships.
25
+ * • an array of resource identifier objects for non-empty to-many relationships.
26
+ */
27
+ export type ResourceLinkage = null | [] | ApiResourceIdentifierObject | ApiResourceIdentifierObject[];
28
+ export interface IRelationshipData {
29
+ data: ResourceLinkage;
30
+ }
31
+ export type RelationshipMeta = Record<string, unknown>;
32
+ /**
33
+ * The value of the relationships key MUST be an object (a "relationships object"). Members of the relationships object ("relationships")
34
+ * represent references from the resource object in which it’s defined to other resource objects.
35
+ * Relationships may be to-one or to-many.
36
+ */
37
+ export type Relationship = IRelationshipLinks | IRelationshipData | RelationshipMeta;
38
+ //# sourceMappingURL=relationship.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relationship.d.ts","sourceRoot":"","sources":["../../../../../src/middleware/standardResponses/jsonApi/relationship.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAA;AAE1E,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,wBAAwB,GAAG,qBAAqB,CAAA;CACxD;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,EAAE,GAAG,2BAA2B,GAAG,2BAA2B,EAAE,CAAA;AACrG,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,eAAe,CAAA;CACtB;AAED,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAEtD;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,kBAAkB,GAAG,iBAAiB,GAAG,gBAAgB,CAAA"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Within a given API, each resource object's type and id pair MUST identify a single, unique resource.
3
+ * (The set of URIs controlled by a server, or multiple servers acting as one, constitute an API.)
4
+ */
5
+ export interface ApiResourceIdentifierObject {
6
+ /**
7
+ * The id member is not required when the resource object originates at the client and represents a new resource to be created on the server.
8
+ */
9
+ id: string;
10
+ /**
11
+ * The type member is used to describe resource objects that share common attributes and relationships.
12
+ * The values of type members MUST adhere to the same constraints as member names.
13
+ */
14
+ type: string;
15
+ }
16
+ //# sourceMappingURL=resourceIdentifier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resourceIdentifier.d.ts","sourceRoot":"","sources":["../../../../../src/middleware/standardResponses/jsonApi/resourceIdentifier.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IACV;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAA;CACb"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Loosely following the JSON API 1.0 formats and conventions
3
+ * https://jsonapi.org/format/
4
+ */
5
+ import type { ApiError } from './error.ts';
6
+ import type { ApiLinks } from './links.ts';
7
+ import type { Relationship } from './relationship.ts';
8
+ import type { ApiResourceIdentifierObject } from './resourceIdentifier.ts';
9
+ export interface ApiResourceObject extends ApiResourceIdentifierObject {
10
+ /**
11
+ * An attributes object representing some of the resource's data.
12
+ */
13
+ attributes?: Record<string, unknown>;
14
+ /**
15
+ * A links object containing links related to the resource.
16
+ */
17
+ links?: ApiLinks;
18
+ /**
19
+ * A meta object containing non-standard meta-information about a resource that can not be represented as an attribute or relationship.
20
+ */
21
+ meta?: Record<string, unknown>;
22
+ /**
23
+ * A relationships object describing relationships between the resource and other JSON:API resources.
24
+ */
25
+ relationships?: Record<string, Relationship>;
26
+ }
27
+ export interface JsonApi {
28
+ meta?: Record<string, unknown>;
29
+ version?: '1.0' | '1.1';
30
+ }
31
+ export interface ApiResponseBase {
32
+ jsonapi?: JsonApi;
33
+ links?: ApiLinks;
34
+ meta?: Record<string, unknown>;
35
+ }
36
+ export interface ApiDataResponse<T extends ApiResourceIdentifierObject> extends ApiResponseBase {
37
+ data: T;
38
+ included?: ApiResourceObject[];
39
+ }
40
+ export interface ApiErrorResponse extends ApiResponseBase {
41
+ errors: ApiError[];
42
+ }
43
+ export type ApiResponse<T extends ApiResourceIdentifierObject> = ApiDataResponse<T> | ApiErrorResponse;
44
+ //# sourceMappingURL=response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../../../src/middleware/standardResponses/jsonApi/response.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAA;AAE1E,MAAM,WAAW,iBAAkB,SAAQ,2BAA2B;IACpE;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACpC;;OAEG;IACH,KAAK,CAAC,EAAE,QAAQ,CAAA;IAChB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC9B;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;CAC7C;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC9B,OAAO,CAAC,EAAE,KAAK,GAAG,KAAK,CAAA;CACxB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,QAAQ,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC/B;AAED,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,2BAA2B,CAAE,SAAQ,eAAe;IAC7F,IAAI,EAAE,CAAC,CAAA;IACP,QAAQ,CAAC,EAAE,iBAAiB,EAAE,CAAA;CAC/B;AACD,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,MAAM,EAAE,QAAQ,EAAE,CAAA;CACnB;AAED,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,2BAA2B,IAAI,eAAe,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { NextFunction, Request, Response } from 'express';
2
+ import type { ExpressError } from '../../Model/index.ts';
3
+ export declare const standardErrors: (err: ExpressError | undefined, req: Request, res: Response, next: NextFunction) => void;
4
+ //# sourceMappingURL=standardErrors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standardErrors.d.ts","sourceRoot":"","sources":["../../../../src/middleware/standardResponses/standardErrors.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,YAAY,EAAE,OAAO,EAAE,QAAQ,EAChC,MAAM,SAAS,CAAA;AAEhB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAGxD,eAAO,MAAM,cAAc,GAAI,KAAK,YAAY,GAAG,SAAS,EAAE,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,SAiB5G,CAAA"}
@@ -0,0 +1,27 @@
1
+ import type { RequestHandler, Response } from 'express';
2
+ /**
3
+ * Flags the response to forgo the standard response envelope
4
+ * and return the raw response body to the client
5
+ * @param res The response to disable the standard response format on
6
+ */
7
+ export declare const setRawResponseFormat: (res: Response) => void;
8
+ /**
9
+ * Clears any flags on the response, allowing the response to
10
+ * use the default standard response envelope
11
+ * @param res The response to set to the standard response format
12
+ */
13
+ export declare const clearRawResponseFormat: (res: Response) => void;
14
+ /**
15
+ * Checks if there are any flags on the response that would cause it
16
+ * to forgo the standard response envelope and return the raw response
17
+ * body to the client
18
+ * @param res
19
+ * @returns True if there are any flags on the response, false otherwise
20
+ */
21
+ export declare const isRawResponseFormatSet: (res: Response) => boolean;
22
+ /**
23
+ * Connect middleware to enable the transform of all responses to match
24
+ * the standard response format (compatible with JSON API)
25
+ */
26
+ export declare const standardResponses: RequestHandler;
27
+ //# sourceMappingURL=standardResponses.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standardResponses.d.ts","sourceRoot":"","sources":["../../../../src/middleware/standardResponses/standardResponses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACD,cAAc,EAAE,QAAQ,EAClC,MAAM,SAAS,CAAA;AAShB;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAAI,KAAK,QAAQ,KAAG,IAEpD,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GAAI,KAAK,QAAQ,KAAG,IAEtD,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,GAAI,KAAK,QAAQ,KAAG,OAEtD,CAAA;AAiBD;;;GAGG;AAEH,eAAO,MAAM,iBAAiB,EAAE,cAAkE,CAAA"}
@@ -5,7 +5,7 @@ import { Logger as Logger$2 } from 'winston';
5
5
  import { OptionsJson } from 'body-parser';
6
6
  import { NextHandleFunction } from 'connect';
7
7
 
8
- 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
+ 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<void>;
9
9
  interface Empty {
10
10
  }
11
11
  type NoReqParams = ParamsDictionary;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xylabs/express",
3
- "version": "4.13.13",
3
+ "version": "4.13.15",
4
4
  "description": "SDK for base code for Api repos that use express and deploy on AWS ECS",
5
5
  "keywords": [
6
6
  "xylabs",
@@ -47,9 +47,9 @@
47
47
  "dependencies": {
48
48
  "@types/connect": "^3.4.38",
49
49
  "@types/express-serve-static-core": "^5.0.7",
50
- "@xylabs/assert": "^4.13.13",
51
- "@xylabs/logger": "^4.13.13",
52
- "@xylabs/typeof": "^4.13.13",
50
+ "@xylabs/assert": "^4.13.15",
51
+ "@xylabs/logger": "^4.13.15",
52
+ "@xylabs/typeof": "^4.13.15",
53
53
  "body-parser": "^2.2.0",
54
54
  "express-mung": "^0.5.1",
55
55
  "http-status-codes": "^2.3.0",
@@ -62,9 +62,9 @@
62
62
  "@types/express": "^5.0.3",
63
63
  "@types/express-mung": "^0.5.5",
64
64
  "@types/node": "^24.0.13",
65
- "@xylabs/ts-scripts-yarn3": "^7.0.0-rc.9",
66
- "@xylabs/tsconfig": "^7.0.0-rc.9",
67
- "@xylabs/vitest-extended": "^4.13.13",
65
+ "@xylabs/ts-scripts-yarn3": "^7.0.0-rc.20",
66
+ "@xylabs/tsconfig": "^7.0.0-rc.20",
67
+ "@xylabs/vitest-extended": "^4.13.15",
68
68
  "body-parser": "^2.2.0",
69
69
  "express": "^5.1.0",
70
70
  "express-mung": "^0.5.1",