apitally 0.19.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +98 -43
- package/dist/adonisjs/middleware.cjs +3 -0
- package/dist/adonisjs/middleware.cjs.map +1 -1
- package/dist/adonisjs/middleware.js +3 -0
- package/dist/adonisjs/middleware.js.map +1 -1
- package/dist/adonisjs/provider.cjs +55 -25
- package/dist/adonisjs/provider.cjs.map +1 -1
- package/dist/adonisjs/provider.js +55 -25
- package/dist/adonisjs/provider.js.map +1 -1
- package/dist/common/client.cjs +4 -3
- package/dist/common/client.cjs.map +1 -1
- package/dist/common/client.js +4 -3
- package/dist/common/client.js.map +1 -1
- package/dist/common/requestLogger.cjs +5 -1
- package/dist/common/requestLogger.cjs.map +1 -1
- package/dist/common/requestLogger.d.cts +1 -1
- package/dist/common/requestLogger.d.ts +1 -1
- package/dist/common/requestLogger.js +5 -1
- package/dist/common/requestLogger.js.map +1 -1
- package/dist/common/response.cjs +12 -6
- package/dist/common/response.cjs.map +1 -1
- package/dist/common/response.d.cts +3 -3
- package/dist/common/response.d.ts +3 -3
- package/dist/common/response.js +12 -6
- package/dist/common/response.js.map +1 -1
- package/dist/common/validationErrorCounter.cjs +2 -2
- package/dist/common/validationErrorCounter.cjs.map +1 -1
- package/dist/common/validationErrorCounter.js +2 -2
- package/dist/common/validationErrorCounter.js.map +1 -1
- package/dist/elysia/index.cjs +1586 -0
- package/dist/elysia/index.cjs.map +1 -0
- package/dist/elysia/index.d.cts +9 -0
- package/dist/elysia/index.d.ts +9 -0
- package/dist/elysia/index.js +1556 -0
- package/dist/elysia/index.js.map +1 -0
- package/dist/elysia/plugin.cjs +1580 -0
- package/dist/elysia/plugin.cjs.map +1 -0
- package/dist/elysia/plugin.d.cts +53 -0
- package/dist/elysia/plugin.d.ts +53 -0
- package/dist/elysia/plugin.js +1556 -0
- package/dist/elysia/plugin.js.map +1 -0
- package/dist/elysia/utils.cjs +98 -0
- package/dist/elysia/utils.cjs.map +1 -0
- package/dist/elysia/utils.d.cts +12 -0
- package/dist/elysia/utils.d.ts +12 -0
- package/dist/elysia/utils.js +78 -0
- package/dist/elysia/utils.js.map +1 -0
- package/dist/express/index.cjs +58 -25
- package/dist/express/index.cjs.map +1 -1
- package/dist/express/index.js +58 -25
- package/dist/express/index.js.map +1 -1
- package/dist/express/middleware.cjs +58 -25
- package/dist/express/middleware.cjs.map +1 -1
- package/dist/express/middleware.js +58 -25
- package/dist/express/middleware.js.map +1 -1
- package/dist/fastify/index.cjs +58 -25
- package/dist/fastify/index.cjs.map +1 -1
- package/dist/fastify/index.js +58 -25
- package/dist/fastify/index.js.map +1 -1
- package/dist/fastify/plugin.cjs +58 -25
- package/dist/fastify/plugin.cjs.map +1 -1
- package/dist/fastify/plugin.js +58 -25
- package/dist/fastify/plugin.js.map +1 -1
- package/dist/h3/index.cjs +24 -11
- package/dist/h3/index.cjs.map +1 -1
- package/dist/h3/index.js +24 -11
- package/dist/h3/index.js.map +1 -1
- package/dist/h3/plugin.cjs +24 -11
- package/dist/h3/plugin.cjs.map +1 -1
- package/dist/h3/plugin.js +24 -11
- package/dist/h3/plugin.js.map +1 -1
- package/dist/hapi/index.cjs +6134 -0
- package/dist/hapi/index.cjs.map +1 -0
- package/dist/hapi/index.d.cts +9 -0
- package/dist/hapi/index.d.ts +9 -0
- package/dist/hapi/index.js +6124 -0
- package/dist/hapi/index.js.map +1 -0
- package/dist/hapi/plugin.cjs +6131 -0
- package/dist/hapi/plugin.cjs.map +1 -0
- package/dist/hapi/plugin.d.cts +36 -0
- package/dist/hapi/plugin.d.ts +36 -0
- package/dist/hapi/plugin.js +6124 -0
- package/dist/hapi/plugin.js.map +1 -0
- package/dist/hapi/utils.cjs +98 -0
- package/dist/hapi/utils.cjs.map +1 -0
- package/dist/hapi/utils.d.cts +14 -0
- package/dist/hapi/utils.d.ts +14 -0
- package/dist/hapi/utils.js +77 -0
- package/dist/hapi/utils.js.map +1 -0
- package/dist/hono/index.cjs +25 -12
- package/dist/hono/index.cjs.map +1 -1
- package/dist/hono/index.js +25 -12
- package/dist/hono/index.js.map +1 -1
- package/dist/hono/middleware.cjs +25 -12
- package/dist/hono/middleware.cjs.map +1 -1
- package/dist/hono/middleware.js +25 -12
- package/dist/hono/middleware.js.map +1 -1
- package/dist/koa/index.cjs +13 -6
- package/dist/koa/index.cjs.map +1 -1
- package/dist/koa/index.js +13 -6
- package/dist/koa/index.js.map +1 -1
- package/dist/koa/middleware.cjs +13 -6
- package/dist/koa/middleware.cjs.map +1 -1
- package/dist/koa/middleware.js +13 -6
- package/dist/koa/middleware.js.map +1 -1
- package/dist/loggers/hapi.cjs +54 -0
- package/dist/loggers/hapi.cjs.map +1 -0
- package/dist/loggers/hapi.d.cts +10 -0
- package/dist/loggers/hapi.d.ts +10 -0
- package/dist/loggers/hapi.js +31 -0
- package/dist/loggers/hapi.js.map +1 -0
- package/dist/loggers/index.cjs +81 -28
- package/dist/loggers/index.cjs.map +1 -1
- package/dist/loggers/index.d.cts +2 -0
- package/dist/loggers/index.d.ts +2 -0
- package/dist/loggers/index.js +80 -28
- package/dist/loggers/index.js.map +1 -1
- package/dist/loggers/pino.cjs +39 -13
- package/dist/loggers/pino.cjs.map +1 -1
- package/dist/loggers/pino.d.cts +1 -1
- package/dist/loggers/pino.d.ts +1 -1
- package/dist/loggers/pino.js +39 -13
- package/dist/loggers/pino.js.map +1 -1
- package/dist/nestjs/index.cjs +158 -118
- package/dist/nestjs/index.cjs.map +1 -1
- package/dist/nestjs/index.js +156 -117
- package/dist/nestjs/index.js.map +1 -1
- package/package.json +42 -2
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/hapi/utils.ts
|
|
22
|
+
var utils_exports = {};
|
|
23
|
+
__export(utils_exports, {
|
|
24
|
+
getAppInfo: () => getAppInfo,
|
|
25
|
+
isBoom: () => isBoom
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(utils_exports);
|
|
28
|
+
|
|
29
|
+
// src/common/packageVersions.ts
|
|
30
|
+
var import_node_module = require("module");
|
|
31
|
+
var import_meta = {};
|
|
32
|
+
function getPackageVersion(name) {
|
|
33
|
+
const packageJsonPath = `${name}/package.json`;
|
|
34
|
+
try {
|
|
35
|
+
return require(packageJsonPath).version || null;
|
|
36
|
+
} catch (error) {
|
|
37
|
+
try {
|
|
38
|
+
const _require = (0, import_node_module.createRequire)(import_meta.url);
|
|
39
|
+
return _require(packageJsonPath).version || null;
|
|
40
|
+
} catch (error2) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
__name(getPackageVersion, "getPackageVersion");
|
|
46
|
+
|
|
47
|
+
// src/hapi/utils.ts
|
|
48
|
+
function getAppInfo(server, appVersion) {
|
|
49
|
+
const versions = [];
|
|
50
|
+
if (process.versions.node) {
|
|
51
|
+
versions.push([
|
|
52
|
+
"nodejs",
|
|
53
|
+
process.versions.node
|
|
54
|
+
]);
|
|
55
|
+
}
|
|
56
|
+
const hapiVersion = getPackageVersion("@hapi/hapi");
|
|
57
|
+
const apitallyVersion = getPackageVersion("../..");
|
|
58
|
+
if (hapiVersion) {
|
|
59
|
+
versions.push([
|
|
60
|
+
"hapi",
|
|
61
|
+
hapiVersion
|
|
62
|
+
]);
|
|
63
|
+
}
|
|
64
|
+
if (apitallyVersion) {
|
|
65
|
+
versions.push([
|
|
66
|
+
"apitally",
|
|
67
|
+
apitallyVersion
|
|
68
|
+
]);
|
|
69
|
+
}
|
|
70
|
+
if (appVersion) {
|
|
71
|
+
versions.push([
|
|
72
|
+
"app",
|
|
73
|
+
appVersion
|
|
74
|
+
]);
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
paths: server.table().map((route) => ({
|
|
78
|
+
method: route.method.toUpperCase(),
|
|
79
|
+
path: route.path
|
|
80
|
+
})).filter((route) => route.method && route.path && ![
|
|
81
|
+
"HEAD",
|
|
82
|
+
"OPTIONS"
|
|
83
|
+
].includes(route.method)),
|
|
84
|
+
versions: Object.fromEntries(versions),
|
|
85
|
+
client: "js:hapi"
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
__name(getAppInfo, "getAppInfo");
|
|
89
|
+
function isBoom(response) {
|
|
90
|
+
return "isBoom" in response && response.isBoom === true;
|
|
91
|
+
}
|
|
92
|
+
__name(isBoom, "isBoom");
|
|
93
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
94
|
+
0 && (module.exports = {
|
|
95
|
+
getAppInfo,
|
|
96
|
+
isBoom
|
|
97
|
+
});
|
|
98
|
+
//# sourceMappingURL=utils.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/hapi/utils.ts","../../src/common/packageVersions.ts"],"sourcesContent":["import type { Boom } from \"@hapi/boom\";\nimport type { RequestRoute, ResponseObject, Server } from \"@hapi/hapi\";\n\nimport { getPackageVersion } from \"../common/packageVersions.js\";\nimport type { StartupData } from \"../common/types.js\";\n\nexport function getAppInfo(server: Server, appVersion?: string): StartupData {\n const versions: Array<[string, string]> = [];\n if (process.versions.node) {\n versions.push([\"nodejs\", process.versions.node]);\n }\n const hapiVersion = getPackageVersion(\"@hapi/hapi\");\n const apitallyVersion = getPackageVersion(\"../..\");\n if (hapiVersion) {\n versions.push([\"hapi\", hapiVersion]);\n }\n if (apitallyVersion) {\n versions.push([\"apitally\", apitallyVersion]);\n }\n if (appVersion) {\n versions.push([\"app\", appVersion]);\n }\n\n return {\n paths: server\n .table()\n .map((route: RequestRoute) => ({\n method: route.method.toUpperCase(),\n path: route.path,\n }))\n .filter(\n (route) =>\n route.method &&\n route.path &&\n ![\"HEAD\", \"OPTIONS\"].includes(route.method),\n ),\n versions: Object.fromEntries(versions),\n client: \"js:hapi\",\n };\n}\n\nexport function isBoom(response: ResponseObject | Boom): response is Boom {\n return \"isBoom\" in response && response.isBoom === true;\n}\n","import { createRequire } from \"node:module\";\n\nexport function getPackageVersion(name: string): string | null {\n const packageJsonPath = `${name}/package.json`;\n try {\n return require(packageJsonPath).version || null;\n } catch (error) {\n try {\n const _require = createRequire(import.meta.url);\n return _require(packageJsonPath).version || null;\n } catch (error) {\n return null;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAGA;;;;;;;;ACHA,yBAA8B;AAA9B;AAEO,SAASA,kBAAkBC,MAAY;AAC5C,QAAMC,kBAAkB,GAAGD,IAAAA;AAC3B,MAAI;AACF,WAAOE,QAAQD,eAAAA,EAAiBE,WAAW;EAC7C,SAASC,OAAO;AACd,QAAI;AACF,YAAMC,eAAWC,kCAAc,YAAYC,GAAG;AAC9C,aAAOF,SAASJ,eAAAA,EAAiBE,WAAW;IAC9C,SAASC,QAAO;AACd,aAAO;IACT;EACF;AACF;AAZgBL;;;ADIT,SAASS,WAAWC,QAAgBC,YAAmB;AAC5D,QAAMC,WAAoC,CAAA;AAC1C,MAAIC,QAAQD,SAASE,MAAM;AACzBF,aAASG,KAAK;MAAC;MAAUF,QAAQD,SAASE;KAAK;EACjD;AACA,QAAME,cAAcC,kBAAkB,YAAA;AACtC,QAAMC,kBAAkBD,kBAAkB,OAAA;AAC1C,MAAID,aAAa;AACfJ,aAASG,KAAK;MAAC;MAAQC;KAAY;EACrC;AACA,MAAIE,iBAAiB;AACnBN,aAASG,KAAK;MAAC;MAAYG;KAAgB;EAC7C;AACA,MAAIP,YAAY;AACdC,aAASG,KAAK;MAAC;MAAOJ;KAAW;EACnC;AAEA,SAAO;IACLQ,OAAOT,OACJU,MAAK,EACLC,IAAI,CAACC,WAAyB;MAC7BC,QAAQD,MAAMC,OAAOC,YAAW;MAChCC,MAAMH,MAAMG;IACd,EAAA,EACCC,OACC,CAACJ,UACCA,MAAMC,UACND,MAAMG,QACN,CAAC;MAAC;MAAQ;MAAWE,SAASL,MAAMC,MAAM,CAAA;IAEhDX,UAAUgB,OAAOC,YAAYjB,QAAAA;IAC7BkB,QAAQ;EACV;AACF;AAjCgBrB;AAmCT,SAASsB,OAAOC,UAA+B;AACpD,SAAO,YAAYA,YAAYA,SAASD,WAAW;AACrD;AAFgBA;","names":["getPackageVersion","name","packageJsonPath","require","version","error","_require","createRequire","url","getAppInfo","server","appVersion","versions","process","node","push","hapiVersion","getPackageVersion","apitallyVersion","paths","table","map","route","method","toUpperCase","path","filter","includes","Object","fromEntries","client","isBoom","response"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Boom } from '@hapi/boom';
|
|
2
|
+
import { Server, ResponseObject } from '@hapi/hapi';
|
|
3
|
+
import { StartupData } from '../common/types.cjs';
|
|
4
|
+
import '../common/logging.cjs';
|
|
5
|
+
import 'winston';
|
|
6
|
+
import '../common/requestLogger.cjs';
|
|
7
|
+
import 'node:buffer';
|
|
8
|
+
import 'node:http';
|
|
9
|
+
import '../common/tempGzipFile.cjs';
|
|
10
|
+
|
|
11
|
+
declare function getAppInfo(server: Server, appVersion?: string): StartupData;
|
|
12
|
+
declare function isBoom(response: ResponseObject | Boom): response is Boom;
|
|
13
|
+
|
|
14
|
+
export { getAppInfo, isBoom };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Boom } from '@hapi/boom';
|
|
2
|
+
import { Server, ResponseObject } from '@hapi/hapi';
|
|
3
|
+
import { StartupData } from '../common/types.js';
|
|
4
|
+
import '../common/logging.js';
|
|
5
|
+
import 'winston';
|
|
6
|
+
import '../common/requestLogger.js';
|
|
7
|
+
import 'node:buffer';
|
|
8
|
+
import 'node:http';
|
|
9
|
+
import '../common/tempGzipFile.js';
|
|
10
|
+
|
|
11
|
+
declare function getAppInfo(server: Server, appVersion?: string): StartupData;
|
|
12
|
+
declare function isBoom(response: ResponseObject | Boom): response is Boom;
|
|
13
|
+
|
|
14
|
+
export { getAppInfo, isBoom };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
4
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
5
|
+
}) : x)(function(x) {
|
|
6
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
7
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
// src/common/packageVersions.ts
|
|
11
|
+
import { createRequire } from "module";
|
|
12
|
+
function getPackageVersion(name) {
|
|
13
|
+
const packageJsonPath = `${name}/package.json`;
|
|
14
|
+
try {
|
|
15
|
+
return __require(packageJsonPath).version || null;
|
|
16
|
+
} catch (error) {
|
|
17
|
+
try {
|
|
18
|
+
const _require = createRequire(import.meta.url);
|
|
19
|
+
return _require(packageJsonPath).version || null;
|
|
20
|
+
} catch (error2) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
__name(getPackageVersion, "getPackageVersion");
|
|
26
|
+
|
|
27
|
+
// src/hapi/utils.ts
|
|
28
|
+
function getAppInfo(server, appVersion) {
|
|
29
|
+
const versions = [];
|
|
30
|
+
if (process.versions.node) {
|
|
31
|
+
versions.push([
|
|
32
|
+
"nodejs",
|
|
33
|
+
process.versions.node
|
|
34
|
+
]);
|
|
35
|
+
}
|
|
36
|
+
const hapiVersion = getPackageVersion("@hapi/hapi");
|
|
37
|
+
const apitallyVersion = getPackageVersion("../..");
|
|
38
|
+
if (hapiVersion) {
|
|
39
|
+
versions.push([
|
|
40
|
+
"hapi",
|
|
41
|
+
hapiVersion
|
|
42
|
+
]);
|
|
43
|
+
}
|
|
44
|
+
if (apitallyVersion) {
|
|
45
|
+
versions.push([
|
|
46
|
+
"apitally",
|
|
47
|
+
apitallyVersion
|
|
48
|
+
]);
|
|
49
|
+
}
|
|
50
|
+
if (appVersion) {
|
|
51
|
+
versions.push([
|
|
52
|
+
"app",
|
|
53
|
+
appVersion
|
|
54
|
+
]);
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
paths: server.table().map((route) => ({
|
|
58
|
+
method: route.method.toUpperCase(),
|
|
59
|
+
path: route.path
|
|
60
|
+
})).filter((route) => route.method && route.path && ![
|
|
61
|
+
"HEAD",
|
|
62
|
+
"OPTIONS"
|
|
63
|
+
].includes(route.method)),
|
|
64
|
+
versions: Object.fromEntries(versions),
|
|
65
|
+
client: "js:hapi"
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
__name(getAppInfo, "getAppInfo");
|
|
69
|
+
function isBoom(response) {
|
|
70
|
+
return "isBoom" in response && response.isBoom === true;
|
|
71
|
+
}
|
|
72
|
+
__name(isBoom, "isBoom");
|
|
73
|
+
export {
|
|
74
|
+
getAppInfo,
|
|
75
|
+
isBoom
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/common/packageVersions.ts","../../src/hapi/utils.ts"],"sourcesContent":["import { createRequire } from \"node:module\";\n\nexport function getPackageVersion(name: string): string | null {\n const packageJsonPath = `${name}/package.json`;\n try {\n return require(packageJsonPath).version || null;\n } catch (error) {\n try {\n const _require = createRequire(import.meta.url);\n return _require(packageJsonPath).version || null;\n } catch (error) {\n return null;\n }\n }\n}\n","import type { Boom } from \"@hapi/boom\";\nimport type { RequestRoute, ResponseObject, Server } from \"@hapi/hapi\";\n\nimport { getPackageVersion } from \"../common/packageVersions.js\";\nimport type { StartupData } from \"../common/types.js\";\n\nexport function getAppInfo(server: Server, appVersion?: string): StartupData {\n const versions: Array<[string, string]> = [];\n if (process.versions.node) {\n versions.push([\"nodejs\", process.versions.node]);\n }\n const hapiVersion = getPackageVersion(\"@hapi/hapi\");\n const apitallyVersion = getPackageVersion(\"../..\");\n if (hapiVersion) {\n versions.push([\"hapi\", hapiVersion]);\n }\n if (apitallyVersion) {\n versions.push([\"apitally\", apitallyVersion]);\n }\n if (appVersion) {\n versions.push([\"app\", appVersion]);\n }\n\n return {\n paths: server\n .table()\n .map((route: RequestRoute) => ({\n method: route.method.toUpperCase(),\n path: route.path,\n }))\n .filter(\n (route) =>\n route.method &&\n route.path &&\n ![\"HEAD\", \"OPTIONS\"].includes(route.method),\n ),\n versions: Object.fromEntries(versions),\n client: \"js:hapi\",\n };\n}\n\nexport function isBoom(response: ResponseObject | Boom): response is Boom {\n return \"isBoom\" in response && response.isBoom === true;\n}\n"],"mappings":";;;;;;;;;;AAAA,SAASA,qBAAqB;AAEvB,SAASC,kBAAkBC,MAAY;AAC5C,QAAMC,kBAAkB,GAAGD,IAAAA;AAC3B,MAAI;AACF,WAAOE,UAAQD,eAAAA,EAAiBE,WAAW;EAC7C,SAASC,OAAO;AACd,QAAI;AACF,YAAMC,WAAWC,cAAc,YAAYC,GAAG;AAC9C,aAAOF,SAASJ,eAAAA,EAAiBE,WAAW;IAC9C,SAASC,QAAO;AACd,aAAO;IACT;EACF;AACF;AAZgBL;;;ACIT,SAASS,WAAWC,QAAgBC,YAAmB;AAC5D,QAAMC,WAAoC,CAAA;AAC1C,MAAIC,QAAQD,SAASE,MAAM;AACzBF,aAASG,KAAK;MAAC;MAAUF,QAAQD,SAASE;KAAK;EACjD;AACA,QAAME,cAAcC,kBAAkB,YAAA;AACtC,QAAMC,kBAAkBD,kBAAkB,OAAA;AAC1C,MAAID,aAAa;AACfJ,aAASG,KAAK;MAAC;MAAQC;KAAY;EACrC;AACA,MAAIE,iBAAiB;AACnBN,aAASG,KAAK;MAAC;MAAYG;KAAgB;EAC7C;AACA,MAAIP,YAAY;AACdC,aAASG,KAAK;MAAC;MAAOJ;KAAW;EACnC;AAEA,SAAO;IACLQ,OAAOT,OACJU,MAAK,EACLC,IAAI,CAACC,WAAyB;MAC7BC,QAAQD,MAAMC,OAAOC,YAAW;MAChCC,MAAMH,MAAMG;IACd,EAAA,EACCC,OACC,CAACJ,UACCA,MAAMC,UACND,MAAMG,QACN,CAAC;MAAC;MAAQ;MAAWE,SAASL,MAAMC,MAAM,CAAA;IAEhDX,UAAUgB,OAAOC,YAAYjB,QAAAA;IAC7BkB,QAAQ;EACV;AACF;AAjCgBrB;AAmCT,SAASsB,OAAOC,UAA+B;AACpD,SAAO,YAAYA,YAAYA,SAASD,WAAW;AACrD;AAFgBA;","names":["createRequire","getPackageVersion","name","packageJsonPath","require","version","error","_require","createRequire","url","getAppInfo","server","appVersion","versions","process","node","push","hapiVersion","getPackageVersion","apitallyVersion","paths","table","map","route","method","toUpperCase","path","filter","includes","Object","fromEntries","client","isBoom","response"]}
|
package/dist/hono/index.cjs
CHANGED
|
@@ -412,7 +412,8 @@ var ALLOWED_CONTENT_TYPES = [
|
|
|
412
412
|
"application/json",
|
|
413
413
|
"application/problem+json",
|
|
414
414
|
"application/vnd.api+json",
|
|
415
|
-
"text/plain"
|
|
415
|
+
"text/plain",
|
|
416
|
+
"text/html"
|
|
416
417
|
];
|
|
417
418
|
var EXCLUDE_PATH_PATTERNS = [
|
|
418
419
|
/\/_?healthz?$/i,
|
|
@@ -742,6 +743,9 @@ var _RequestLogger = class _RequestLogger {
|
|
|
742
743
|
__name(_RequestLogger, "RequestLogger");
|
|
743
744
|
var RequestLogger = _RequestLogger;
|
|
744
745
|
function convertHeaders(headers) {
|
|
746
|
+
if (!headers) {
|
|
747
|
+
return [];
|
|
748
|
+
}
|
|
745
749
|
if (headers instanceof Headers) {
|
|
746
750
|
return Array.from(headers.entries());
|
|
747
751
|
}
|
|
@@ -825,7 +829,7 @@ var _ValidationErrorCounter = class _ValidationErrorCounter {
|
|
|
825
829
|
consumer: validationError.consumer || null,
|
|
826
830
|
method: validationError.method,
|
|
827
831
|
path: validationError.path,
|
|
828
|
-
loc: validationError.loc.split("."),
|
|
832
|
+
loc: validationError.loc.split(".").filter(Boolean),
|
|
829
833
|
msg: validationError.msg,
|
|
830
834
|
type: validationError.type,
|
|
831
835
|
error_count: count
|
|
@@ -841,7 +845,7 @@ var _ValidationErrorCounter = class _ValidationErrorCounter {
|
|
|
841
845
|
validationError.consumer || "",
|
|
842
846
|
validationError.method.toUpperCase(),
|
|
843
847
|
validationError.path,
|
|
844
|
-
validationError.loc,
|
|
848
|
+
validationError.loc.split(".").filter(Boolean),
|
|
845
849
|
validationError.msg.trim(),
|
|
846
850
|
validationError.type
|
|
847
851
|
].join("|");
|
|
@@ -1146,8 +1150,11 @@ function parseContentLength(contentLength) {
|
|
|
1146
1150
|
__name(parseContentLength, "parseContentLength");
|
|
1147
1151
|
|
|
1148
1152
|
// src/common/response.ts
|
|
1149
|
-
async function measureResponseSize(response) {
|
|
1150
|
-
const [newResponse1, newResponse2] =
|
|
1153
|
+
async function measureResponseSize(response, tee = true) {
|
|
1154
|
+
const [newResponse1, newResponse2] = tee ? teeResponse(response) : [
|
|
1155
|
+
response,
|
|
1156
|
+
response
|
|
1157
|
+
];
|
|
1151
1158
|
let size = 0;
|
|
1152
1159
|
if (newResponse2.body) {
|
|
1153
1160
|
let done = false;
|
|
@@ -1166,8 +1173,11 @@ async function measureResponseSize(response) {
|
|
|
1166
1173
|
];
|
|
1167
1174
|
}
|
|
1168
1175
|
__name(measureResponseSize, "measureResponseSize");
|
|
1169
|
-
async function getResponseBody(response) {
|
|
1170
|
-
const [newResponse1, newResponse2] =
|
|
1176
|
+
async function getResponseBody(response, tee = true) {
|
|
1177
|
+
const [newResponse1, newResponse2] = tee ? teeResponse(response) : [
|
|
1178
|
+
response,
|
|
1179
|
+
response
|
|
1180
|
+
];
|
|
1171
1181
|
const responseBuffer = Buffer.from(await newResponse2.arrayBuffer());
|
|
1172
1182
|
return [
|
|
1173
1183
|
responseBuffer,
|
|
@@ -1178,7 +1188,7 @@ __name(getResponseBody, "getResponseBody");
|
|
|
1178
1188
|
async function getResponseJson(response) {
|
|
1179
1189
|
const contentType = response.headers.get("content-type");
|
|
1180
1190
|
if (contentType == null ? void 0 : contentType.includes("application/json")) {
|
|
1181
|
-
const [newResponse1, newResponse2] =
|
|
1191
|
+
const [newResponse1, newResponse2] = teeResponse(response);
|
|
1182
1192
|
const responseJson = await newResponse2.json();
|
|
1183
1193
|
return [
|
|
1184
1194
|
responseJson,
|
|
@@ -1191,7 +1201,7 @@ async function getResponseJson(response) {
|
|
|
1191
1201
|
];
|
|
1192
1202
|
}
|
|
1193
1203
|
__name(getResponseJson, "getResponseJson");
|
|
1194
|
-
|
|
1204
|
+
function teeResponse(response) {
|
|
1195
1205
|
if (!response.body) {
|
|
1196
1206
|
return [
|
|
1197
1207
|
response,
|
|
@@ -1256,8 +1266,11 @@ function captureLog(level, args) {
|
|
|
1256
1266
|
}
|
|
1257
1267
|
__name(captureLog, "captureLog");
|
|
1258
1268
|
|
|
1259
|
-
// src/loggers/
|
|
1269
|
+
// src/loggers/hapi.ts
|
|
1260
1270
|
var import_node_util2 = require("util");
|
|
1271
|
+
|
|
1272
|
+
// src/loggers/utils.ts
|
|
1273
|
+
var import_node_util3 = require("util");
|
|
1261
1274
|
function formatMessage(message, ...args) {
|
|
1262
1275
|
return [
|
|
1263
1276
|
message,
|
|
@@ -1274,7 +1287,7 @@ function formatArg(arg) {
|
|
|
1274
1287
|
return arg.trim();
|
|
1275
1288
|
}
|
|
1276
1289
|
if (arg instanceof Error) {
|
|
1277
|
-
return (0,
|
|
1290
|
+
return (0, import_node_util3.format)(arg).trim();
|
|
1278
1291
|
}
|
|
1279
1292
|
if (arg === void 0 || arg === null || isEmptyObject(arg)) {
|
|
1280
1293
|
return "";
|
|
@@ -1282,7 +1295,7 @@ function formatArg(arg) {
|
|
|
1282
1295
|
try {
|
|
1283
1296
|
return JSON.stringify(arg);
|
|
1284
1297
|
} catch {
|
|
1285
|
-
return (0,
|
|
1298
|
+
return (0, import_node_util3.format)(arg).trim();
|
|
1286
1299
|
}
|
|
1287
1300
|
}
|
|
1288
1301
|
__name(formatArg, "formatArg");
|