@jaypie/express 1.2.27 → 1.2.29

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 (51) hide show
  1. package/dist/cjs/index.cjs +28 -4
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/esm/index.js +29 -5
  4. package/dist/esm/index.js.map +1 -1
  5. package/package.json +1 -1
  6. package/dist/esm/src/index.d.ts +0 -13
  7. /package/dist/cjs/{src/adapter → adapter}/LambdaRequest.d.ts +0 -0
  8. /package/dist/cjs/{src/adapter → adapter}/LambdaResponseBuffered.d.ts +0 -0
  9. /package/dist/cjs/{src/adapter → adapter}/LambdaResponseStreaming.d.ts +0 -0
  10. /package/dist/cjs/{src/adapter → adapter}/__tests__/LambdaRequest.spec.d.ts +0 -0
  11. /package/dist/cjs/{src/adapter → adapter}/__tests__/LambdaResponseBuffered.spec.d.ts +0 -0
  12. /package/dist/cjs/{src/adapter → adapter}/__tests__/LambdaResponseStreaming.spec.d.ts +0 -0
  13. /package/dist/cjs/{src/adapter → adapter}/__tests__/debug-harness.d.ts +0 -0
  14. /package/dist/cjs/{src/adapter → adapter}/__tests__/integration.spec.d.ts +0 -0
  15. /package/dist/cjs/{src/adapter → adapter}/index.d.ts +0 -0
  16. /package/dist/cjs/{src/adapter → adapter}/types.d.ts +0 -0
  17. /package/dist/cjs/{src/constants.d.ts → constants.d.ts} +0 -0
  18. /package/dist/cjs/{src/cors.helper.d.ts → cors.helper.d.ts} +0 -0
  19. /package/dist/cjs/{src/decorateResponse.helper.d.ts → decorateResponse.helper.d.ts} +0 -0
  20. /package/dist/cjs/{src/echo.handler.d.ts → echo.handler.d.ts} +0 -0
  21. /package/dist/cjs/{src/expressHandler.d.ts → expressHandler.d.ts} +0 -0
  22. /package/dist/cjs/{src/expressStreamHandler.d.ts → expressStreamHandler.d.ts} +0 -0
  23. /package/dist/cjs/{src/fabricApiResponse.d.ts → fabricApiResponse.d.ts} +0 -0
  24. /package/dist/cjs/{src/getCurrentInvokeUuid.adapter.d.ts → getCurrentInvokeUuid.adapter.d.ts} +0 -0
  25. /package/dist/cjs/{src/http.handler.d.ts → http.handler.d.ts} +0 -0
  26. /package/dist/cjs/{src/index.d.ts → index.d.ts} +0 -0
  27. /package/dist/cjs/{src/routes.d.ts → routes.d.ts} +0 -0
  28. /package/dist/cjs/{src/summarizeRequest.helper.d.ts → summarizeRequest.helper.d.ts} +0 -0
  29. /package/dist/cjs/{src/summarizeResponse.helper.d.ts → summarizeResponse.helper.d.ts} +0 -0
  30. /package/dist/esm/{src/adapter → adapter}/LambdaRequest.d.ts +0 -0
  31. /package/dist/esm/{src/adapter → adapter}/LambdaResponseBuffered.d.ts +0 -0
  32. /package/dist/esm/{src/adapter → adapter}/LambdaResponseStreaming.d.ts +0 -0
  33. /package/dist/esm/{src/adapter → adapter}/__tests__/LambdaRequest.spec.d.ts +0 -0
  34. /package/dist/esm/{src/adapter → adapter}/__tests__/LambdaResponseBuffered.spec.d.ts +0 -0
  35. /package/dist/esm/{src/adapter → adapter}/__tests__/LambdaResponseStreaming.spec.d.ts +0 -0
  36. /package/dist/esm/{src/adapter → adapter}/__tests__/debug-harness.d.ts +0 -0
  37. /package/dist/esm/{src/adapter → adapter}/__tests__/integration.spec.d.ts +0 -0
  38. /package/dist/esm/{src/adapter → adapter}/index.d.ts +0 -0
  39. /package/dist/esm/{src/adapter → adapter}/types.d.ts +0 -0
  40. /package/dist/esm/{src/constants.d.ts → constants.d.ts} +0 -0
  41. /package/dist/esm/{src/cors.helper.d.ts → cors.helper.d.ts} +0 -0
  42. /package/dist/esm/{src/decorateResponse.helper.d.ts → decorateResponse.helper.d.ts} +0 -0
  43. /package/dist/esm/{src/echo.handler.d.ts → echo.handler.d.ts} +0 -0
  44. /package/dist/esm/{src/expressHandler.d.ts → expressHandler.d.ts} +0 -0
  45. /package/dist/esm/{src/expressStreamHandler.d.ts → expressStreamHandler.d.ts} +0 -0
  46. /package/dist/esm/{src/fabricApiResponse.d.ts → fabricApiResponse.d.ts} +0 -0
  47. /package/dist/esm/{src/getCurrentInvokeUuid.adapter.d.ts → getCurrentInvokeUuid.adapter.d.ts} +0 -0
  48. /package/dist/esm/{src/http.handler.d.ts → http.handler.d.ts} +0 -0
  49. /package/dist/esm/{src/routes.d.ts → routes.d.ts} +0 -0
  50. /package/dist/esm/{src/summarizeRequest.helper.d.ts → summarizeRequest.helper.d.ts} +0 -0
  51. /package/dist/esm/{src/summarizeResponse.helper.d.ts → summarizeResponse.helper.d.ts} +0 -0
@@ -1788,6 +1788,9 @@ function expressHandler(handlerOrOptions, optionsOrHandler) {
1788
1788
  //
1789
1789
  // Setup
1790
1790
  //
1791
+ // Start the variables fetch at cold start; request setup awaits the cached
1792
+ // promise. No-op without the pointer.
1793
+ void aws.loadEnvVariables().catch(() => { });
1791
1794
  let jaypieFunction;
1792
1795
  return async (req, res, ...params) => {
1793
1796
  // * This is the first line of code that runs when a request is received
@@ -1878,6 +1881,11 @@ function expressHandler(handlerOrOptions, optionsOrHandler) {
1878
1881
  //
1879
1882
  // Build a request-local setup list to avoid mutating the shared array
1880
1883
  const requestSetup = [];
1884
+ // Hydrate non-secret variables first so everything after, including Datadog
1885
+ // and secrets, can be configured from the bundle. No-op without the pointer.
1886
+ requestSetup.push(async () => {
1887
+ await aws.loadEnvVariables();
1888
+ });
1881
1889
  // Load the Datadog LLM Observability API key into the environment when enabled
1882
1890
  requestSetup.push(async () => {
1883
1891
  await datadog.loadDatadogApiKey();
@@ -2067,14 +2075,18 @@ function expressHandler(handlerOrOptions, optionsOrHandler) {
2067
2075
  const contentLengthHeader = headers["content-length"];
2068
2076
  const contentLength = contentLengthHeader ? Number(contentLengthHeader) : 0;
2069
2077
  // Add request data to session report
2070
- logger$1.report({
2078
+ const reportData = {
2071
2079
  method: req.method,
2072
2080
  path,
2073
2081
  query,
2074
2082
  contentType,
2075
2083
  contentLength,
2076
2084
  status: String(res.statusCode),
2077
- });
2085
+ };
2086
+ if (req.params && Object.keys(req.params).length > 0) {
2087
+ reportData.parameters = { ...req.params };
2088
+ }
2089
+ logger$1.report(reportData);
2078
2090
  // Submit metric if Datadog is configured
2079
2091
  if (datadog.hasDatadogEnv()) {
2080
2092
  let metricPrefix = "project";
@@ -2193,6 +2205,9 @@ function expressStreamHandler(handlerOrOptions, optionsOrHandler) {
2193
2205
  //
2194
2206
  // Setup
2195
2207
  //
2208
+ // Start the variables fetch at cold start; request setup awaits the cached
2209
+ // promise. No-op without the pointer.
2210
+ void aws.loadEnvVariables().catch(() => { });
2196
2211
  let jaypieFunction;
2197
2212
  return async (req, res, ...params) => {
2198
2213
  const extReq = req;
@@ -2257,6 +2272,11 @@ function expressStreamHandler(handlerOrOptions, optionsOrHandler) {
2257
2272
  //
2258
2273
  // Build a request-local setup list to avoid mutating the shared array
2259
2274
  const requestSetup = [];
2275
+ // Hydrate non-secret variables before secrets so both can be configured
2276
+ // from the bundle. No-op without the pointer.
2277
+ requestSetup.push(async () => {
2278
+ await aws.loadEnvVariables();
2279
+ });
2260
2280
  // Load secrets into process.env if configured
2261
2281
  if (secrets && secrets.length > 0) {
2262
2282
  const secretsToLoad = secrets;
@@ -2355,11 +2375,15 @@ function expressStreamHandler(handlerOrOptions, optionsOrHandler) {
2355
2375
  }
2356
2376
  path = path.replace(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi, ":id");
2357
2377
  // Add request data to session report
2358
- logger.report({
2378
+ const reportData = {
2359
2379
  method: req.method,
2360
2380
  path,
2361
2381
  status: String(res.statusCode),
2362
- });
2382
+ };
2383
+ if (req.params && Object.keys(req.params).length > 0) {
2384
+ reportData.parameters = { ...req.params };
2385
+ }
2386
+ logger.report(reportData);
2363
2387
  // Submit metric if Datadog is configured
2364
2388
  if (datadog.hasDatadogEnv()) {
2365
2389
  let metricPrefix = "project";