veryfront 0.1.319 → 0.1.320

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/esm/deno.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "veryfront",
3
- "version": "0.1.319",
3
+ "version": "0.1.320",
4
4
  "license": "Apache-2.0",
5
5
  "nodeModulesDir": "auto",
6
6
  "workspace": [
@@ -1,4 +1,4 @@
1
1
  export declare function isLikelyScannerProbePath(pathname: string): boolean;
2
- export type ProxyFailureLogLevel = "warn" | "error";
2
+ export type ProxyFailureLogLevel = "info" | "warn" | "error";
3
3
  export declare function getProxyFailureLogLevel(status: number, method: string, pathname: string): ProxyFailureLogLevel;
4
4
  //# sourceMappingURL=log-noise.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"log-noise.d.ts","sourceRoot":"","sources":["../../../src/src/proxy/log-noise.ts"],"names":[],"mappings":"AAcA,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAQlE;AAED,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,OAAO,CAAC;AAEpD,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GACf,oBAAoB,CAUtB"}
1
+ {"version":3,"file":"log-noise.d.ts","sourceRoot":"","sources":["../../../src/src/proxy/log-noise.ts"],"names":[],"mappings":"AAcA,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAQlE;AAED,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAE7D,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GACf,oBAAoB,CAWtB"}
@@ -25,5 +25,7 @@ export function getProxyFailureLogLevel(status, method, pathname) {
25
25
  isLikelyScannerProbePath(pathname)) {
26
26
  return "warn";
27
27
  }
28
+ if (status < 400)
29
+ return "info";
28
30
  return status < 500 ? "warn" : "error";
29
31
  }
@@ -246,7 +246,7 @@ function forwardToServer(req) {
246
246
  }, async () => {
247
247
  if (ctx.error) {
248
248
  const ms = Math.round(performance.now() - startTime);
249
- const logLevel = ctx.error.status < 500 ? "warn" : "error";
249
+ const logLevel = getProxyFailureLogLevel(ctx.error.status, req.method, url.pathname);
250
250
  proxyLogger[logLevel](`${ctx.error.status} ${req.method} ${url.pathname}`, { ms });
251
251
  endSpan(spanInfo?.span, ctx.error.status);
252
252
  return createProxyErrorResponse(ctx.error);
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.1.319";
1
+ export declare const VERSION = "0.1.320";
2
2
  //# sourceMappingURL=version-constant.d.ts.map
@@ -1,3 +1,3 @@
1
1
  // Keep in sync with deno.json version.
2
2
  // scripts/release.ts updates this constant during releases.
3
- export const VERSION = "0.1.319";
3
+ export const VERSION = "0.1.320";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "veryfront",
3
- "version": "0.1.319",
3
+ "version": "0.1.320",
4
4
  "description": "The simplest way to build AI-powered apps",
5
5
  "keywords": [
6
6
  "react",
package/src/deno.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "veryfront",
3
- "version": "0.1.319",
3
+ "version": "0.1.320",
4
4
  "license": "Apache-2.0",
5
5
  "nodeModulesDir": "auto",
6
6
  "workspace": [
@@ -22,7 +22,7 @@ export function isLikelyScannerProbePath(pathname: string): boolean {
22
22
  .some((segment) => SCANNER_PROBE_SEGMENTS.has(segment));
23
23
  }
24
24
 
25
- export type ProxyFailureLogLevel = "warn" | "error";
25
+ export type ProxyFailureLogLevel = "info" | "warn" | "error";
26
26
 
27
27
  export function getProxyFailureLogLevel(
28
28
  status: number,
@@ -37,5 +37,6 @@ export function getProxyFailureLogLevel(
37
37
  return "warn";
38
38
  }
39
39
 
40
+ if (status < 400) return "info";
40
41
  return status < 500 ? "warn" : "error";
41
42
  }
@@ -302,7 +302,7 @@ function forwardToServer(req: Request): Promise<Response> {
302
302
  async () => {
303
303
  if (ctx.error) {
304
304
  const ms = Math.round(performance.now() - startTime);
305
- const logLevel = ctx.error.status < 500 ? "warn" : "error";
305
+ const logLevel = getProxyFailureLogLevel(ctx.error.status, req.method, url.pathname);
306
306
  proxyLogger[logLevel](`${ctx.error.status} ${req.method} ${url.pathname}`, { ms });
307
307
  endSpan(spanInfo?.span, ctx.error.status);
308
308
  return createProxyErrorResponse(ctx.error);
@@ -1,3 +1,3 @@
1
1
  // Keep in sync with deno.json version.
2
2
  // scripts/release.ts updates this constant during releases.
3
- export const VERSION = "0.1.319";
3
+ export const VERSION = "0.1.320";