apitally 0.13.0 → 0.15.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 +29 -10
- package/dist/adonisjs/index.cjs +6 -4
- package/dist/adonisjs/index.cjs.map +1 -1
- package/dist/adonisjs/index.d.cts +2 -2
- package/dist/adonisjs/index.d.ts +2 -2
- package/dist/adonisjs/index.js +6 -4
- package/dist/adonisjs/index.js.map +1 -1
- package/dist/adonisjs/middleware.cjs +19 -19
- package/dist/adonisjs/middleware.cjs.map +1 -1
- package/dist/adonisjs/middleware.js +19 -19
- package/dist/adonisjs/middleware.js.map +1 -1
- package/dist/adonisjs/provider.cjs +11 -4
- package/dist/adonisjs/provider.cjs.map +1 -1
- package/dist/adonisjs/provider.js +11 -4
- package/dist/adonisjs/provider.js.map +1 -1
- package/dist/common/client.cjs +5 -0
- package/dist/common/client.cjs.map +1 -1
- package/dist/common/client.js +5 -0
- package/dist/common/client.js.map +1 -1
- package/dist/common/consumerRegistry.cjs.map +1 -1
- package/dist/common/consumerRegistry.js.map +1 -1
- package/dist/common/{utils.cjs → headers.cjs} +14 -5
- package/dist/common/headers.cjs.map +1 -0
- package/dist/common/{utils.d.cts → headers.d.cts} +2 -1
- package/dist/common/{utils.d.ts → headers.d.ts} +2 -1
- package/dist/common/{utils.js → headers.js} +10 -2
- package/dist/common/headers.js.map +1 -0
- package/dist/common/requestCounter.cjs.map +1 -1
- package/dist/common/requestCounter.js.map +1 -1
- package/dist/common/requestLogger.cjs +5 -0
- package/dist/common/requestLogger.cjs.map +1 -1
- package/dist/common/requestLogger.d.cts +1 -0
- package/dist/common/requestLogger.d.ts +1 -0
- package/dist/common/requestLogger.js +5 -0
- package/dist/common/requestLogger.js.map +1 -1
- package/dist/common/response.cjs +106 -0
- package/dist/common/response.cjs.map +1 -0
- package/dist/common/response.d.cts +6 -0
- package/dist/common/response.d.ts +6 -0
- package/dist/common/response.js +80 -0
- package/dist/common/response.js.map +1 -0
- package/dist/common/serverErrorCounter.cjs.map +1 -1
- package/dist/common/serverErrorCounter.js.map +1 -1
- package/dist/common/tempGzipFile.cjs.map +1 -1
- package/dist/common/tempGzipFile.js.map +1 -1
- package/dist/common/types.cjs.map +1 -1
- package/dist/common/types.d.cts +0 -1
- package/dist/common/types.d.ts +0 -1
- package/dist/common/validationErrorCounter.cjs.map +1 -1
- package/dist/common/validationErrorCounter.js.map +1 -1
- package/dist/express/index.cjs +134 -62
- package/dist/express/index.cjs.map +1 -1
- package/dist/express/index.d.cts +2 -2
- package/dist/express/index.d.ts +2 -2
- package/dist/express/index.js +132 -61
- package/dist/express/index.js.map +1 -1
- package/dist/express/middleware.cjs +134 -62
- package/dist/express/middleware.cjs.map +1 -1
- package/dist/express/middleware.d.cts +5 -4
- package/dist/express/middleware.d.ts +5 -4
- package/dist/express/middleware.js +132 -61
- package/dist/express/middleware.js.map +1 -1
- package/dist/express/utils.cjs +59 -16
- package/dist/express/utils.cjs.map +1 -1
- package/dist/express/utils.d.cts +11 -2
- package/dist/express/utils.d.ts +11 -2
- package/dist/express/utils.js +56 -15
- package/dist/express/utils.js.map +1 -1
- package/dist/fastify/index.cjs +44 -29
- package/dist/fastify/index.cjs.map +1 -1
- package/dist/fastify/index.d.cts +2 -2
- package/dist/fastify/index.d.ts +2 -2
- package/dist/fastify/index.js +41 -27
- package/dist/fastify/index.js.map +1 -1
- package/dist/fastify/plugin.cjs +46 -28
- package/dist/fastify/plugin.cjs.map +1 -1
- package/dist/fastify/plugin.d.cts +3 -2
- package/dist/fastify/plugin.d.ts +3 -2
- package/dist/fastify/plugin.js +41 -27
- package/dist/fastify/plugin.js.map +1 -1
- package/dist/h3/index.cjs +1336 -0
- package/dist/h3/index.cjs.map +1 -0
- package/dist/h3/index.d.cts +9 -0
- package/dist/h3/index.d.ts +9 -0
- package/dist/h3/index.js +1305 -0
- package/dist/h3/index.js.map +1 -0
- package/dist/h3/plugin.cjs +1334 -0
- package/dist/h3/plugin.cjs.map +1 -0
- package/dist/h3/plugin.d.cts +21 -0
- package/dist/h3/plugin.d.ts +21 -0
- package/dist/h3/plugin.js +1305 -0
- package/dist/h3/plugin.js.map +1 -0
- package/dist/h3/utils.cjs +127 -0
- package/dist/h3/utils.cjs.map +1 -0
- package/dist/h3/utils.d.cts +14 -0
- package/dist/h3/utils.d.ts +14 -0
- package/dist/h3/utils.js +107 -0
- package/dist/h3/utils.js.map +1 -0
- package/dist/hono/index.cjs +177 -141
- package/dist/hono/index.cjs.map +1 -1
- package/dist/hono/index.d.cts +2 -2
- package/dist/hono/index.d.ts +2 -2
- package/dist/hono/index.js +175 -140
- package/dist/hono/index.js.map +1 -1
- package/dist/hono/middleware.cjs +177 -141
- package/dist/hono/middleware.cjs.map +1 -1
- package/dist/hono/middleware.d.cts +4 -3
- package/dist/hono/middleware.d.ts +4 -3
- package/dist/hono/middleware.js +175 -140
- package/dist/hono/middleware.js.map +1 -1
- package/dist/hono/utils.cjs +126 -0
- package/dist/hono/utils.cjs.map +1 -0
- package/dist/hono/utils.d.cts +14 -0
- package/dist/hono/utils.d.ts +14 -0
- package/dist/hono/utils.js +106 -0
- package/dist/hono/utils.js.map +1 -0
- package/dist/koa/index.cjs +41 -17
- package/dist/koa/index.cjs.map +1 -1
- package/dist/koa/index.d.cts +2 -2
- package/dist/koa/index.d.ts +2 -2
- package/dist/koa/index.js +40 -17
- package/dist/koa/index.js.map +1 -1
- package/dist/koa/middleware.cjs +41 -17
- package/dist/koa/middleware.cjs.map +1 -1
- package/dist/koa/middleware.d.cts +4 -3
- package/dist/koa/middleware.d.ts +4 -3
- package/dist/koa/middleware.js +40 -17
- package/dist/koa/middleware.js.map +1 -1
- package/dist/nestjs/index.cjs +131 -64
- package/dist/nestjs/index.cjs.map +1 -1
- package/dist/nestjs/index.d.cts +2 -2
- package/dist/nestjs/index.d.ts +2 -2
- package/dist/nestjs/index.js +130 -63
- package/dist/nestjs/index.js.map +1 -1
- package/package.json +46 -53
- package/dist/common/utils.cjs.map +0 -1
- package/dist/common/utils.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/common/serverErrorCounter.ts","../../src/common/sentry.ts"],"sourcesContent":["import { createHash } from \"crypto\";\n\nimport { getSentryEventId } from \"./sentry.js\";\nimport { ConsumerMethodPath, ServerError, ServerErrorsItem } from \"./types.js\";\n\nconst MAX_MSG_LENGTH = 2048;\nconst MAX_STACKTRACE_LENGTH = 65536;\n\nexport default class ServerErrorCounter {\n private errorCounts: Map<string, number>;\n private errorDetails: Map<string, ConsumerMethodPath & ServerError>;\n private sentryEventIds: Map<string, string>;\n\n constructor() {\n this.errorCounts = new Map();\n this.errorDetails = new Map();\n this.sentryEventIds = new Map();\n }\n\n public addServerError(serverError: ConsumerMethodPath & ServerError) {\n const key = this.getKey(serverError);\n if (!this.errorDetails.has(key)) {\n this.errorDetails.set(key, serverError);\n }\n this.errorCounts.set(key, (this.errorCounts.get(key) || 0) + 1);\n\n const sentryEventId = getSentryEventId();\n if (sentryEventId) {\n this.sentryEventIds.set(key, sentryEventId);\n }\n }\n\n public getAndResetServerErrors() {\n const data: Array<ServerErrorsItem> = [];\n this.errorCounts.forEach((count, key) => {\n const serverError = this.errorDetails.get(key);\n if (serverError) {\n data.push({\n consumer: serverError.consumer || null,\n method: serverError.method,\n path: serverError.path,\n type: serverError.type,\n msg: truncateExceptionMessage(serverError.msg),\n traceback: truncateExceptionStackTrace(serverError.traceback),\n sentry_event_id: this.sentryEventIds.get(key) || null,\n error_count: count,\n });\n }\n });\n this.errorCounts.clear();\n this.errorDetails.clear();\n return data;\n }\n\n private getKey(serverError: ConsumerMethodPath & ServerError) {\n const hashInput = [\n serverError.consumer || \"\",\n serverError.method.toUpperCase(),\n serverError.path,\n serverError.type,\n serverError.msg.trim(),\n serverError.traceback.trim(),\n ].join(\"|\");\n return createHash(\"md5\").update(hashInput).digest(\"hex\");\n }\n}\n\nexport function truncateExceptionMessage(msg: string) {\n if (msg.length <= MAX_MSG_LENGTH) {\n return msg;\n }\n const suffix = \"... (truncated)\";\n const cutoff = MAX_MSG_LENGTH - suffix.length;\n return msg.substring(0, cutoff) + suffix;\n}\n\nexport function truncateExceptionStackTrace(stack: string) {\n const suffix = \"... (truncated) ...\";\n const cutoff = MAX_STACKTRACE_LENGTH - suffix.length;\n const lines = stack.trim().split(\"\\n\");\n const truncatedLines: string[] = [];\n let length = 0;\n for (const line of lines) {\n if (length + line.length + 1 > cutoff) {\n truncatedLines.push(suffix);\n break;\n }\n truncatedLines.push(line);\n length += line.length + 1;\n }\n return truncatedLines.join(\"\\n\");\n}\n","import type * as Sentry from \"@sentry/node\";\n\nlet sentry: typeof Sentry | undefined;\n\n// Initialize Sentry when the module is loaded\n(async () => {\n try {\n sentry = await import(\"@sentry/node\");\n } catch (e) {\n // Sentry SDK is not installed, ignore\n }\n})();\n\n/**\n * Returns the last Sentry event ID if available\n */\nexport function getSentryEventId(): string | undefined {\n if (sentry && sentry.lastEventId) {\n return sentry.lastEventId();\n }\n return undefined;\n}\n"],"mappings":";;;;AAAA,SAASA,kBAAkB;;;ACE3B,IAAIC;CAGH,YAAA;AACC,MAAI;AACFA,aAAS,MAAM,OAAO,cAAA;EACxB,SAASC,GAAG;EAEZ;AACF,GAAA;AAKO,SAASC,mBAAAA;AACd,MAAIF,UAAUA,OAAOG,aAAa;AAChC,WAAOH,OAAOG,YAAW;EAC3B;AACA,SAAOC;AACT;AALgBF;;;ADXhB,IAAMG,iBAAiB;AACvB,IAAMC,wBAAwB;AAE9B,IAAqBC,sBAArB,MAAqBA,oBAAAA;EACXC;EACAC;EACAC;
|
|
1
|
+
{"version":3,"sources":["../../src/common/serverErrorCounter.ts","../../src/common/sentry.ts"],"sourcesContent":["import { createHash } from \"crypto\";\n\nimport { getSentryEventId } from \"./sentry.js\";\nimport { ConsumerMethodPath, ServerError, ServerErrorsItem } from \"./types.js\";\n\nconst MAX_MSG_LENGTH = 2048;\nconst MAX_STACKTRACE_LENGTH = 65536;\n\nexport default class ServerErrorCounter {\n private errorCounts: Map<string, number>;\n private errorDetails: Map<string, ConsumerMethodPath & ServerError>;\n private sentryEventIds: Map<string, string>;\n\n constructor() {\n this.errorCounts = new Map();\n this.errorDetails = new Map();\n this.sentryEventIds = new Map();\n }\n\n public addServerError(serverError: ConsumerMethodPath & ServerError) {\n const key = this.getKey(serverError);\n if (!this.errorDetails.has(key)) {\n this.errorDetails.set(key, serverError);\n }\n this.errorCounts.set(key, (this.errorCounts.get(key) || 0) + 1);\n\n const sentryEventId = getSentryEventId();\n if (sentryEventId) {\n this.sentryEventIds.set(key, sentryEventId);\n }\n }\n\n public getAndResetServerErrors() {\n const data: Array<ServerErrorsItem> = [];\n this.errorCounts.forEach((count, key) => {\n const serverError = this.errorDetails.get(key);\n if (serverError) {\n data.push({\n consumer: serverError.consumer || null,\n method: serverError.method,\n path: serverError.path,\n type: serverError.type,\n msg: truncateExceptionMessage(serverError.msg),\n traceback: truncateExceptionStackTrace(serverError.traceback),\n sentry_event_id: this.sentryEventIds.get(key) || null,\n error_count: count,\n });\n }\n });\n this.errorCounts.clear();\n this.errorDetails.clear();\n return data;\n }\n\n private getKey(serverError: ConsumerMethodPath & ServerError) {\n const hashInput = [\n serverError.consumer || \"\",\n serverError.method.toUpperCase(),\n serverError.path,\n serverError.type,\n serverError.msg.trim(),\n serverError.traceback.trim(),\n ].join(\"|\");\n return createHash(\"md5\").update(hashInput).digest(\"hex\");\n }\n}\n\nexport function truncateExceptionMessage(msg: string) {\n if (msg.length <= MAX_MSG_LENGTH) {\n return msg;\n }\n const suffix = \"... (truncated)\";\n const cutoff = MAX_MSG_LENGTH - suffix.length;\n return msg.substring(0, cutoff) + suffix;\n}\n\nexport function truncateExceptionStackTrace(stack: string) {\n const suffix = \"... (truncated) ...\";\n const cutoff = MAX_STACKTRACE_LENGTH - suffix.length;\n const lines = stack.trim().split(\"\\n\");\n const truncatedLines: string[] = [];\n let length = 0;\n for (const line of lines) {\n if (length + line.length + 1 > cutoff) {\n truncatedLines.push(suffix);\n break;\n }\n truncatedLines.push(line);\n length += line.length + 1;\n }\n return truncatedLines.join(\"\\n\");\n}\n","import type * as Sentry from \"@sentry/node\";\n\nlet sentry: typeof Sentry | undefined;\n\n// Initialize Sentry when the module is loaded\n(async () => {\n try {\n sentry = await import(\"@sentry/node\");\n } catch (e) {\n // Sentry SDK is not installed, ignore\n }\n})();\n\n/**\n * Returns the last Sentry event ID if available\n */\nexport function getSentryEventId(): string | undefined {\n if (sentry && sentry.lastEventId) {\n return sentry.lastEventId();\n }\n return undefined;\n}\n"],"mappings":";;;;AAAA,SAASA,kBAAkB;;;ACE3B,IAAIC;CAGH,YAAA;AACC,MAAI;AACFA,aAAS,MAAM,OAAO,cAAA;EACxB,SAASC,GAAG;EAEZ;AACF,GAAA;AAKO,SAASC,mBAAAA;AACd,MAAIF,UAAUA,OAAOG,aAAa;AAChC,WAAOH,OAAOG,YAAW;EAC3B;AACA,SAAOC;AACT;AALgBF;;;ADXhB,IAAMG,iBAAiB;AACvB,IAAMC,wBAAwB;AAE9B,IAAqBC,sBAArB,MAAqBA,oBAAAA;EACXC;EACAC;EACAC;EAER,cAAc;AACZ,SAAKF,cAAc,oBAAIG,IAAAA;AACvB,SAAKF,eAAe,oBAAIE,IAAAA;AACxB,SAAKD,iBAAiB,oBAAIC,IAAAA;EAC5B;EAEOC,eAAeC,aAA+C;AACnE,UAAMC,MAAM,KAAKC,OAAOF,WAAAA;AACxB,QAAI,CAAC,KAAKJ,aAAaO,IAAIF,GAAAA,GAAM;AAC/B,WAAKL,aAAaQ,IAAIH,KAAKD,WAAAA;IAC7B;AACA,SAAKL,YAAYS,IAAIH,MAAM,KAAKN,YAAYU,IAAIJ,GAAAA,KAAQ,KAAK,CAAA;AAE7D,UAAMK,gBAAgBC,iBAAAA;AACtB,QAAID,eAAe;AACjB,WAAKT,eAAeO,IAAIH,KAAKK,aAAAA;IAC/B;EACF;EAEOE,0BAA0B;AAC/B,UAAMC,OAAgC,CAAA;AACtC,SAAKd,YAAYe,QAAQ,CAACC,OAAOV,QAAAA;AAC/B,YAAMD,cAAc,KAAKJ,aAAaS,IAAIJ,GAAAA;AAC1C,UAAID,aAAa;AACfS,aAAKG,KAAK;UACRC,UAAUb,YAAYa,YAAY;UAClCC,QAAQd,YAAYc;UACpBC,MAAMf,YAAYe;UAClBC,MAAMhB,YAAYgB;UAClBC,KAAKC,yBAAyBlB,YAAYiB,GAAG;UAC7CE,WAAWC,4BAA4BpB,YAAYmB,SAAS;UAC5DE,iBAAiB,KAAKxB,eAAeQ,IAAIJ,GAAAA,KAAQ;UACjDqB,aAAaX;QACf,CAAA;MACF;IACF,CAAA;AACA,SAAKhB,YAAY4B,MAAK;AACtB,SAAK3B,aAAa2B,MAAK;AACvB,WAAOd;EACT;EAEQP,OAAOF,aAA+C;AAC5D,UAAMwB,YAAY;MAChBxB,YAAYa,YAAY;MACxBb,YAAYc,OAAOW,YAAW;MAC9BzB,YAAYe;MACZf,YAAYgB;MACZhB,YAAYiB,IAAIS,KAAI;MACpB1B,YAAYmB,UAAUO,KAAI;MAC1BC,KAAK,GAAA;AACP,WAAOC,WAAW,KAAA,EAAOC,OAAOL,SAAAA,EAAWM,OAAO,KAAA;EACpD;AACF;AAzDqBpC;AAArB,IAAqBA,qBAArB;AA2DO,SAASwB,yBAAyBD,KAAW;AAClD,MAAIA,IAAIc,UAAUvC,gBAAgB;AAChC,WAAOyB;EACT;AACA,QAAMe,SAAS;AACf,QAAMC,SAASzC,iBAAiBwC,OAAOD;AACvC,SAAOd,IAAIiB,UAAU,GAAGD,MAAAA,IAAUD;AACpC;AAPgBd;AAST,SAASE,4BAA4Be,OAAa;AACvD,QAAMH,SAAS;AACf,QAAMC,SAASxC,wBAAwBuC,OAAOD;AAC9C,QAAMK,QAAQD,MAAMT,KAAI,EAAGW,MAAM,IAAA;AACjC,QAAMC,iBAA2B,CAAA;AACjC,MAAIP,SAAS;AACb,aAAWQ,QAAQH,OAAO;AACxB,QAAIL,SAASQ,KAAKR,SAAS,IAAIE,QAAQ;AACrCK,qBAAe1B,KAAKoB,MAAAA;AACpB;IACF;AACAM,mBAAe1B,KAAK2B,IAAAA;AACpBR,cAAUQ,KAAKR,SAAS;EAC1B;AACA,SAAOO,eAAeX,KAAK,IAAA;AAC7B;AAfgBP;","names":["createHash","sentry","e","getSentryEventId","lastEventId","undefined","MAX_MSG_LENGTH","MAX_STACKTRACE_LENGTH","ServerErrorCounter","errorCounts","errorDetails","sentryEventIds","Map","addServerError","serverError","key","getKey","has","set","get","sentryEventId","getSentryEventId","getAndResetServerErrors","data","forEach","count","push","consumer","method","path","type","msg","truncateExceptionMessage","traceback","truncateExceptionStackTrace","sentry_event_id","error_count","clear","hashInput","toUpperCase","trim","join","createHash","update","digest","length","suffix","cutoff","substring","stack","lines","split","truncatedLines","line"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/common/tempGzipFile.ts"],"sourcesContent":["import { Buffer } from \"buffer\";\nimport { randomUUID } from \"crypto\";\nimport { createWriteStream, readFile, unlinkSync, WriteStream } from \"fs\";\nimport { tmpdir } from \"os\";\nimport { join } from \"path\";\nimport { createGzip, Gzip } from \"zlib\";\n\nexport default class TempGzipFile {\n public uuid: string;\n private filePath: string;\n private gzip: Gzip;\n private writeStream: WriteStream;\n private readyPromise: Promise<void>;\n private closedPromise: Promise<void>;\n\n constructor() {\n this.uuid = randomUUID();\n this.filePath = join(tmpdir(), `apitally-${this.uuid}.gz`);\n this.writeStream = createWriteStream(this.filePath);\n this.readyPromise = new Promise<void>((resolve, reject) => {\n this.writeStream.once(\"ready\", resolve);\n this.writeStream.once(\"error\", reject);\n });\n this.closedPromise = new Promise<void>((resolve, reject) => {\n this.writeStream.once(\"close\", resolve);\n this.writeStream.once(\"error\", reject);\n });\n this.gzip = createGzip();\n this.gzip.pipe(this.writeStream);\n }\n\n get size() {\n return this.writeStream.bytesWritten;\n }\n\n async writeLine(data: Buffer) {\n await this.readyPromise;\n return new Promise<void>((resolve, reject) => {\n this.gzip.write(Buffer.concat([data, Buffer.from(\"\\n\")]), (error) => {\n if (error) {\n reject(error);\n } else {\n resolve();\n }\n });\n });\n }\n\n async getContent() {\n return new Promise<Buffer>((resolve, reject) => {\n readFile(this.filePath, (error, data) => {\n if (error) {\n reject(error);\n } else {\n resolve(data);\n }\n });\n });\n }\n\n async close() {\n await new Promise<void>((resolve) => {\n this.gzip.end(() => {\n resolve();\n });\n });\n await this.closedPromise;\n }\n\n async delete() {\n await this.close();\n unlinkSync(this.filePath);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;oBAAuB;AACvB,oBAA2B;AAC3B,gBAAqE;AACrE,gBAAuB;AACvB,kBAAqB;AACrB,kBAAiC;AAEjC,IAAqBA,gBAArB,MAAqBA,cAAAA;EACZC;EACCC;EACAC;EACAC;EACAC;EACAC;
|
|
1
|
+
{"version":3,"sources":["../../src/common/tempGzipFile.ts"],"sourcesContent":["import { Buffer } from \"buffer\";\nimport { randomUUID } from \"crypto\";\nimport { createWriteStream, readFile, unlinkSync, WriteStream } from \"fs\";\nimport { tmpdir } from \"os\";\nimport { join } from \"path\";\nimport { createGzip, Gzip } from \"zlib\";\n\nexport default class TempGzipFile {\n public uuid: string;\n private filePath: string;\n private gzip: Gzip;\n private writeStream: WriteStream;\n private readyPromise: Promise<void>;\n private closedPromise: Promise<void>;\n\n constructor() {\n this.uuid = randomUUID();\n this.filePath = join(tmpdir(), `apitally-${this.uuid}.gz`);\n this.writeStream = createWriteStream(this.filePath);\n this.readyPromise = new Promise<void>((resolve, reject) => {\n this.writeStream.once(\"ready\", resolve);\n this.writeStream.once(\"error\", reject);\n });\n this.closedPromise = new Promise<void>((resolve, reject) => {\n this.writeStream.once(\"close\", resolve);\n this.writeStream.once(\"error\", reject);\n });\n this.gzip = createGzip();\n this.gzip.pipe(this.writeStream);\n }\n\n get size() {\n return this.writeStream.bytesWritten;\n }\n\n async writeLine(data: Buffer) {\n await this.readyPromise;\n return new Promise<void>((resolve, reject) => {\n this.gzip.write(Buffer.concat([data, Buffer.from(\"\\n\")]), (error) => {\n if (error) {\n reject(error);\n } else {\n resolve();\n }\n });\n });\n }\n\n async getContent() {\n return new Promise<Buffer>((resolve, reject) => {\n readFile(this.filePath, (error, data) => {\n if (error) {\n reject(error);\n } else {\n resolve(data);\n }\n });\n });\n }\n\n async close() {\n await new Promise<void>((resolve) => {\n this.gzip.end(() => {\n resolve();\n });\n });\n await this.closedPromise;\n }\n\n async delete() {\n await this.close();\n unlinkSync(this.filePath);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;oBAAuB;AACvB,oBAA2B;AAC3B,gBAAqE;AACrE,gBAAuB;AACvB,kBAAqB;AACrB,kBAAiC;AAEjC,IAAqBA,gBAArB,MAAqBA,cAAAA;EACZC;EACCC;EACAC;EACAC;EACAC;EACAC;EAER,cAAc;AACZ,SAAKL,WAAOM,0BAAAA;AACZ,SAAKL,eAAWM,sBAAKC,kBAAAA,GAAU,YAAY,KAAKR,IAAI,KAAK;AACzD,SAAKG,kBAAcM,6BAAkB,KAAKR,QAAQ;AAClD,SAAKG,eAAe,IAAIM,QAAc,CAACC,SAASC,WAAAA;AAC9C,WAAKT,YAAYU,KAAK,SAASF,OAAAA;AAC/B,WAAKR,YAAYU,KAAK,SAASD,MAAAA;IACjC,CAAA;AACA,SAAKP,gBAAgB,IAAIK,QAAc,CAACC,SAASC,WAAAA;AAC/C,WAAKT,YAAYU,KAAK,SAASF,OAAAA;AAC/B,WAAKR,YAAYU,KAAK,SAASD,MAAAA;IACjC,CAAA;AACA,SAAKV,WAAOY,wBAAAA;AACZ,SAAKZ,KAAKa,KAAK,KAAKZ,WAAW;EACjC;EAEA,IAAIa,OAAO;AACT,WAAO,KAAKb,YAAYc;EAC1B;EAEA,MAAMC,UAAUC,MAAc;AAC5B,UAAM,KAAKf;AACX,WAAO,IAAIM,QAAc,CAACC,SAASC,WAAAA;AACjC,WAAKV,KAAKkB,MAAMC,qBAAOC,OAAO;QAACH;QAAME,qBAAOE,KAAK,IAAA;OAAM,GAAG,CAACC,UAAAA;AACzD,YAAIA,OAAO;AACTZ,iBAAOY,KAAAA;QACT,OAAO;AACLb,kBAAAA;QACF;MACF,CAAA;IACF,CAAA;EACF;EAEA,MAAMc,aAAa;AACjB,WAAO,IAAIf,QAAgB,CAACC,SAASC,WAAAA;AACnCc,8BAAS,KAAKzB,UAAU,CAACuB,OAAOL,SAAAA;AAC9B,YAAIK,OAAO;AACTZ,iBAAOY,KAAAA;QACT,OAAO;AACLb,kBAAQQ,IAAAA;QACV;MACF,CAAA;IACF,CAAA;EACF;EAEA,MAAMQ,QAAQ;AACZ,UAAM,IAAIjB,QAAc,CAACC,YAAAA;AACvB,WAAKT,KAAK0B,IAAI,MAAA;AACZjB,gBAAAA;MACF,CAAA;IACF,CAAA;AACA,UAAM,KAAKN;EACb;EAEA,MAAMwB,SAAS;AACb,UAAM,KAAKF,MAAK;AAChBG,8BAAW,KAAK7B,QAAQ;EAC1B;AACF;AAlEqBF;AAArB,IAAqBA,eAArB;","names":["TempGzipFile","uuid","filePath","gzip","writeStream","readyPromise","closedPromise","randomUUID","join","tmpdir","createWriteStream","Promise","resolve","reject","once","createGzip","pipe","size","bytesWritten","writeLine","data","write","Buffer","concat","from","error","getContent","readFile","close","end","delete","unlinkSync"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/common/tempGzipFile.ts"],"sourcesContent":["import { Buffer } from \"buffer\";\nimport { randomUUID } from \"crypto\";\nimport { createWriteStream, readFile, unlinkSync, WriteStream } from \"fs\";\nimport { tmpdir } from \"os\";\nimport { join } from \"path\";\nimport { createGzip, Gzip } from \"zlib\";\n\nexport default class TempGzipFile {\n public uuid: string;\n private filePath: string;\n private gzip: Gzip;\n private writeStream: WriteStream;\n private readyPromise: Promise<void>;\n private closedPromise: Promise<void>;\n\n constructor() {\n this.uuid = randomUUID();\n this.filePath = join(tmpdir(), `apitally-${this.uuid}.gz`);\n this.writeStream = createWriteStream(this.filePath);\n this.readyPromise = new Promise<void>((resolve, reject) => {\n this.writeStream.once(\"ready\", resolve);\n this.writeStream.once(\"error\", reject);\n });\n this.closedPromise = new Promise<void>((resolve, reject) => {\n this.writeStream.once(\"close\", resolve);\n this.writeStream.once(\"error\", reject);\n });\n this.gzip = createGzip();\n this.gzip.pipe(this.writeStream);\n }\n\n get size() {\n return this.writeStream.bytesWritten;\n }\n\n async writeLine(data: Buffer) {\n await this.readyPromise;\n return new Promise<void>((resolve, reject) => {\n this.gzip.write(Buffer.concat([data, Buffer.from(\"\\n\")]), (error) => {\n if (error) {\n reject(error);\n } else {\n resolve();\n }\n });\n });\n }\n\n async getContent() {\n return new Promise<Buffer>((resolve, reject) => {\n readFile(this.filePath, (error, data) => {\n if (error) {\n reject(error);\n } else {\n resolve(data);\n }\n });\n });\n }\n\n async close() {\n await new Promise<void>((resolve) => {\n this.gzip.end(() => {\n resolve();\n });\n });\n await this.closedPromise;\n }\n\n async delete() {\n await this.close();\n unlinkSync(this.filePath);\n }\n}\n"],"mappings":";;;;AAAA,SAASA,UAAAA,eAAc;AACvB,SAASC,kBAAkB;AAC3B,SAASC,mBAAmBC,UAAUC,kBAA+B;AACrE,SAASC,cAAc;AACvB,SAASC,YAAY;AACrB,SAASC,kBAAwB;AAEjC,IAAqBC,gBAArB,MAAqBA,cAAAA;EACZC;EACCC;EACAC;EACAC;EACAC;EACAC;
|
|
1
|
+
{"version":3,"sources":["../../src/common/tempGzipFile.ts"],"sourcesContent":["import { Buffer } from \"buffer\";\nimport { randomUUID } from \"crypto\";\nimport { createWriteStream, readFile, unlinkSync, WriteStream } from \"fs\";\nimport { tmpdir } from \"os\";\nimport { join } from \"path\";\nimport { createGzip, Gzip } from \"zlib\";\n\nexport default class TempGzipFile {\n public uuid: string;\n private filePath: string;\n private gzip: Gzip;\n private writeStream: WriteStream;\n private readyPromise: Promise<void>;\n private closedPromise: Promise<void>;\n\n constructor() {\n this.uuid = randomUUID();\n this.filePath = join(tmpdir(), `apitally-${this.uuid}.gz`);\n this.writeStream = createWriteStream(this.filePath);\n this.readyPromise = new Promise<void>((resolve, reject) => {\n this.writeStream.once(\"ready\", resolve);\n this.writeStream.once(\"error\", reject);\n });\n this.closedPromise = new Promise<void>((resolve, reject) => {\n this.writeStream.once(\"close\", resolve);\n this.writeStream.once(\"error\", reject);\n });\n this.gzip = createGzip();\n this.gzip.pipe(this.writeStream);\n }\n\n get size() {\n return this.writeStream.bytesWritten;\n }\n\n async writeLine(data: Buffer) {\n await this.readyPromise;\n return new Promise<void>((resolve, reject) => {\n this.gzip.write(Buffer.concat([data, Buffer.from(\"\\n\")]), (error) => {\n if (error) {\n reject(error);\n } else {\n resolve();\n }\n });\n });\n }\n\n async getContent() {\n return new Promise<Buffer>((resolve, reject) => {\n readFile(this.filePath, (error, data) => {\n if (error) {\n reject(error);\n } else {\n resolve(data);\n }\n });\n });\n }\n\n async close() {\n await new Promise<void>((resolve) => {\n this.gzip.end(() => {\n resolve();\n });\n });\n await this.closedPromise;\n }\n\n async delete() {\n await this.close();\n unlinkSync(this.filePath);\n }\n}\n"],"mappings":";;;;AAAA,SAASA,UAAAA,eAAc;AACvB,SAASC,kBAAkB;AAC3B,SAASC,mBAAmBC,UAAUC,kBAA+B;AACrE,SAASC,cAAc;AACvB,SAASC,YAAY;AACrB,SAASC,kBAAwB;AAEjC,IAAqBC,gBAArB,MAAqBA,cAAAA;EACZC;EACCC;EACAC;EACAC;EACAC;EACAC;EAER,cAAc;AACZ,SAAKL,OAAOM,WAAAA;AACZ,SAAKL,WAAWM,KAAKC,OAAAA,GAAU,YAAY,KAAKR,IAAI,KAAK;AACzD,SAAKG,cAAcM,kBAAkB,KAAKR,QAAQ;AAClD,SAAKG,eAAe,IAAIM,QAAc,CAACC,SAASC,WAAAA;AAC9C,WAAKT,YAAYU,KAAK,SAASF,OAAAA;AAC/B,WAAKR,YAAYU,KAAK,SAASD,MAAAA;IACjC,CAAA;AACA,SAAKP,gBAAgB,IAAIK,QAAc,CAACC,SAASC,WAAAA;AAC/C,WAAKT,YAAYU,KAAK,SAASF,OAAAA;AAC/B,WAAKR,YAAYU,KAAK,SAASD,MAAAA;IACjC,CAAA;AACA,SAAKV,OAAOY,WAAAA;AACZ,SAAKZ,KAAKa,KAAK,KAAKZ,WAAW;EACjC;EAEA,IAAIa,OAAO;AACT,WAAO,KAAKb,YAAYc;EAC1B;EAEA,MAAMC,UAAUC,MAAc;AAC5B,UAAM,KAAKf;AACX,WAAO,IAAIM,QAAc,CAACC,SAASC,WAAAA;AACjC,WAAKV,KAAKkB,MAAMC,QAAOC,OAAO;QAACH;QAAME,QAAOE,KAAK,IAAA;OAAM,GAAG,CAACC,UAAAA;AACzD,YAAIA,OAAO;AACTZ,iBAAOY,KAAAA;QACT,OAAO;AACLb,kBAAAA;QACF;MACF,CAAA;IACF,CAAA;EACF;EAEA,MAAMc,aAAa;AACjB,WAAO,IAAIf,QAAgB,CAACC,SAASC,WAAAA;AACnCc,eAAS,KAAKzB,UAAU,CAACuB,OAAOL,SAAAA;AAC9B,YAAIK,OAAO;AACTZ,iBAAOY,KAAAA;QACT,OAAO;AACLb,kBAAQQ,IAAAA;QACV;MACF,CAAA;IACF,CAAA;EACF;EAEA,MAAMQ,QAAQ;AACZ,UAAM,IAAIjB,QAAc,CAACC,YAAAA;AACvB,WAAKT,KAAK0B,IAAI,MAAA;AACZjB,gBAAAA;MACF,CAAA;IACF,CAAA;AACA,UAAM,KAAKN;EACb;EAEA,MAAMwB,SAAS;AACb,UAAM,KAAKF,MAAK;AAChBG,eAAW,KAAK7B,QAAQ;EAC1B;AACF;AAlEqBF;AAArB,IAAqBA,eAArB;","names":["Buffer","randomUUID","createWriteStream","readFile","unlinkSync","tmpdir","join","createGzip","TempGzipFile","uuid","filePath","gzip","writeStream","readyPromise","closedPromise","randomUUID","join","tmpdir","createWriteStream","Promise","resolve","reject","once","createGzip","pipe","size","bytesWritten","writeLine","data","write","Buffer","concat","from","error","getContent","readFile","close","end","delete","unlinkSync"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/common/types.ts"],"sourcesContent":["import { Logger } from \"./logging.js\";\nimport { RequestLoggingConfig } from \"./requestLogger.js\";\n\nexport type ApitallyConfig = {\n clientId: string;\n env?: string;\n requestLoggingConfig?: Partial<RequestLoggingConfig>;\n
|
|
1
|
+
{"version":3,"sources":["../../src/common/types.ts"],"sourcesContent":["import { Logger } from \"./logging.js\";\nimport { RequestLoggingConfig } from \"./requestLogger.js\";\n\nexport type ApitallyConfig = {\n clientId: string;\n env?: string;\n requestLoggingConfig?: Partial<RequestLoggingConfig>;\n appVersion?: string;\n logger?: Logger;\n};\n\nexport type ApitallyConsumer = {\n identifier: string;\n name?: string | null;\n group?: string | null;\n};\n\nexport type PathInfo = {\n method: string;\n path: string;\n};\n\nexport type StartupData = {\n paths: PathInfo[];\n versions: Record<string, string>;\n client: string;\n};\n\nexport type StartupPayload = {\n instance_uuid: string;\n message_uuid: string;\n} & StartupData;\n\nexport type ConsumerMethodPath = {\n consumer?: string | null;\n method: string;\n path: string;\n};\n\nexport type RequestInfo = ConsumerMethodPath & {\n statusCode: number;\n responseTime: number;\n requestSize?: string | number | null;\n responseSize?: string | number | null;\n};\n\nexport type RequestsItem = ConsumerMethodPath & {\n status_code: number;\n request_count: number;\n request_size_sum: number;\n response_size_sum: number;\n response_times: Record<number, number>;\n request_sizes: Record<number, number>;\n response_sizes: Record<number, number>;\n};\n\nexport type ValidationError = {\n loc: string;\n msg: string;\n type: string;\n};\n\nexport type ValidationErrorsItem = ConsumerMethodPath & {\n loc: Array<string>;\n msg: string;\n type: string;\n error_count: number;\n};\n\nexport type ServerError = {\n type: string;\n msg: string;\n traceback: string;\n};\n\nexport type ServerErrorsItem = ConsumerMethodPath & {\n type: string;\n msg: string;\n traceback: string;\n sentry_event_id: string | null;\n error_count: number;\n};\n\nexport type ConsumerItem = ApitallyConsumer;\n\nexport type SyncPayload = {\n timestamp: number;\n instance_uuid: string;\n message_uuid: string;\n requests: Array<RequestsItem>;\n validation_errors: Array<ValidationErrorsItem>;\n server_errors: Array<ServerErrorsItem>;\n consumers: Array<ConsumerItem>;\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAqFA;;","names":[]}
|
package/dist/common/types.d.cts
CHANGED
package/dist/common/types.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/common/validationErrorCounter.ts"],"sourcesContent":["import { createHash } from \"crypto\";\n\nimport {\n ConsumerMethodPath,\n ValidationError,\n ValidationErrorsItem,\n} from \"./types.js\";\n\nexport default class ValidationErrorCounter {\n private errorCounts: Map<string, number>;\n private errorDetails: Map<string, ConsumerMethodPath & ValidationError>;\n\n constructor() {\n this.errorCounts = new Map();\n this.errorDetails = new Map();\n }\n\n public addValidationError(\n validationError: ConsumerMethodPath & ValidationError,\n ) {\n const key = this.getKey(validationError);\n if (!this.errorDetails.has(key)) {\n this.errorDetails.set(key, validationError);\n }\n this.errorCounts.set(key, (this.errorCounts.get(key) || 0) + 1);\n }\n\n public getAndResetValidationErrors() {\n const data: Array<ValidationErrorsItem> = [];\n this.errorCounts.forEach((count, key) => {\n const validationError = this.errorDetails.get(key);\n if (validationError) {\n data.push({\n consumer: validationError.consumer || null,\n method: validationError.method,\n path: validationError.path,\n loc: validationError.loc.split(\".\"),\n msg: validationError.msg,\n type: validationError.type,\n error_count: count,\n });\n }\n });\n this.errorCounts.clear();\n this.errorDetails.clear();\n return data;\n }\n\n private getKey(validationError: ConsumerMethodPath & ValidationError) {\n const hashInput = [\n validationError.consumer || \"\",\n validationError.method.toUpperCase(),\n validationError.path,\n validationError.loc,\n validationError.msg.trim(),\n validationError.type,\n ].join(\"|\");\n return createHash(\"md5\").update(hashInput).digest(\"hex\");\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;oBAA2B;AAQ3B,IAAqBA,0BAArB,MAAqBA,wBAAAA;EACXC;EACAC;
|
|
1
|
+
{"version":3,"sources":["../../src/common/validationErrorCounter.ts"],"sourcesContent":["import { createHash } from \"crypto\";\n\nimport {\n ConsumerMethodPath,\n ValidationError,\n ValidationErrorsItem,\n} from \"./types.js\";\n\nexport default class ValidationErrorCounter {\n private errorCounts: Map<string, number>;\n private errorDetails: Map<string, ConsumerMethodPath & ValidationError>;\n\n constructor() {\n this.errorCounts = new Map();\n this.errorDetails = new Map();\n }\n\n public addValidationError(\n validationError: ConsumerMethodPath & ValidationError,\n ) {\n const key = this.getKey(validationError);\n if (!this.errorDetails.has(key)) {\n this.errorDetails.set(key, validationError);\n }\n this.errorCounts.set(key, (this.errorCounts.get(key) || 0) + 1);\n }\n\n public getAndResetValidationErrors() {\n const data: Array<ValidationErrorsItem> = [];\n this.errorCounts.forEach((count, key) => {\n const validationError = this.errorDetails.get(key);\n if (validationError) {\n data.push({\n consumer: validationError.consumer || null,\n method: validationError.method,\n path: validationError.path,\n loc: validationError.loc.split(\".\"),\n msg: validationError.msg,\n type: validationError.type,\n error_count: count,\n });\n }\n });\n this.errorCounts.clear();\n this.errorDetails.clear();\n return data;\n }\n\n private getKey(validationError: ConsumerMethodPath & ValidationError) {\n const hashInput = [\n validationError.consumer || \"\",\n validationError.method.toUpperCase(),\n validationError.path,\n validationError.loc,\n validationError.msg.trim(),\n validationError.type,\n ].join(\"|\");\n return createHash(\"md5\").update(hashInput).digest(\"hex\");\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;oBAA2B;AAQ3B,IAAqBA,0BAArB,MAAqBA,wBAAAA;EACXC;EACAC;EAER,cAAc;AACZ,SAAKD,cAAc,oBAAIE,IAAAA;AACvB,SAAKD,eAAe,oBAAIC,IAAAA;EAC1B;EAEOC,mBACLC,iBACA;AACA,UAAMC,MAAM,KAAKC,OAAOF,eAAAA;AACxB,QAAI,CAAC,KAAKH,aAAaM,IAAIF,GAAAA,GAAM;AAC/B,WAAKJ,aAAaO,IAAIH,KAAKD,eAAAA;IAC7B;AACA,SAAKJ,YAAYQ,IAAIH,MAAM,KAAKL,YAAYS,IAAIJ,GAAAA,KAAQ,KAAK,CAAA;EAC/D;EAEOK,8BAA8B;AACnC,UAAMC,OAAoC,CAAA;AAC1C,SAAKX,YAAYY,QAAQ,CAACC,OAAOR,QAAAA;AAC/B,YAAMD,kBAAkB,KAAKH,aAAaQ,IAAIJ,GAAAA;AAC9C,UAAID,iBAAiB;AACnBO,aAAKG,KAAK;UACRC,UAAUX,gBAAgBW,YAAY;UACtCC,QAAQZ,gBAAgBY;UACxBC,MAAMb,gBAAgBa;UACtBC,KAAKd,gBAAgBc,IAAIC,MAAM,GAAA;UAC/BC,KAAKhB,gBAAgBgB;UACrBC,MAAMjB,gBAAgBiB;UACtBC,aAAaT;QACf,CAAA;MACF;IACF,CAAA;AACA,SAAKb,YAAYuB,MAAK;AACtB,SAAKtB,aAAasB,MAAK;AACvB,WAAOZ;EACT;EAEQL,OAAOF,iBAAuD;AACpE,UAAMoB,YAAY;MAChBpB,gBAAgBW,YAAY;MAC5BX,gBAAgBY,OAAOS,YAAW;MAClCrB,gBAAgBa;MAChBb,gBAAgBc;MAChBd,gBAAgBgB,IAAIM,KAAI;MACxBtB,gBAAgBiB;MAChBM,KAAK,GAAA;AACP,eAAOC,0BAAW,KAAA,EAAOC,OAAOL,SAAAA,EAAWM,OAAO,KAAA;EACpD;AACF;AAnDqB/B;AAArB,IAAqBA,yBAArB;","names":["ValidationErrorCounter","errorCounts","errorDetails","Map","addValidationError","validationError","key","getKey","has","set","get","getAndResetValidationErrors","data","forEach","count","push","consumer","method","path","loc","split","msg","type","error_count","clear","hashInput","toUpperCase","trim","join","createHash","update","digest"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/common/validationErrorCounter.ts"],"sourcesContent":["import { createHash } from \"crypto\";\n\nimport {\n ConsumerMethodPath,\n ValidationError,\n ValidationErrorsItem,\n} from \"./types.js\";\n\nexport default class ValidationErrorCounter {\n private errorCounts: Map<string, number>;\n private errorDetails: Map<string, ConsumerMethodPath & ValidationError>;\n\n constructor() {\n this.errorCounts = new Map();\n this.errorDetails = new Map();\n }\n\n public addValidationError(\n validationError: ConsumerMethodPath & ValidationError,\n ) {\n const key = this.getKey(validationError);\n if (!this.errorDetails.has(key)) {\n this.errorDetails.set(key, validationError);\n }\n this.errorCounts.set(key, (this.errorCounts.get(key) || 0) + 1);\n }\n\n public getAndResetValidationErrors() {\n const data: Array<ValidationErrorsItem> = [];\n this.errorCounts.forEach((count, key) => {\n const validationError = this.errorDetails.get(key);\n if (validationError) {\n data.push({\n consumer: validationError.consumer || null,\n method: validationError.method,\n path: validationError.path,\n loc: validationError.loc.split(\".\"),\n msg: validationError.msg,\n type: validationError.type,\n error_count: count,\n });\n }\n });\n this.errorCounts.clear();\n this.errorDetails.clear();\n return data;\n }\n\n private getKey(validationError: ConsumerMethodPath & ValidationError) {\n const hashInput = [\n validationError.consumer || \"\",\n validationError.method.toUpperCase(),\n validationError.path,\n validationError.loc,\n validationError.msg.trim(),\n validationError.type,\n ].join(\"|\");\n return createHash(\"md5\").update(hashInput).digest(\"hex\");\n }\n}\n"],"mappings":";;;;AAAA,SAASA,kBAAkB;AAQ3B,IAAqBC,0BAArB,MAAqBA,wBAAAA;EACXC;EACAC;
|
|
1
|
+
{"version":3,"sources":["../../src/common/validationErrorCounter.ts"],"sourcesContent":["import { createHash } from \"crypto\";\n\nimport {\n ConsumerMethodPath,\n ValidationError,\n ValidationErrorsItem,\n} from \"./types.js\";\n\nexport default class ValidationErrorCounter {\n private errorCounts: Map<string, number>;\n private errorDetails: Map<string, ConsumerMethodPath & ValidationError>;\n\n constructor() {\n this.errorCounts = new Map();\n this.errorDetails = new Map();\n }\n\n public addValidationError(\n validationError: ConsumerMethodPath & ValidationError,\n ) {\n const key = this.getKey(validationError);\n if (!this.errorDetails.has(key)) {\n this.errorDetails.set(key, validationError);\n }\n this.errorCounts.set(key, (this.errorCounts.get(key) || 0) + 1);\n }\n\n public getAndResetValidationErrors() {\n const data: Array<ValidationErrorsItem> = [];\n this.errorCounts.forEach((count, key) => {\n const validationError = this.errorDetails.get(key);\n if (validationError) {\n data.push({\n consumer: validationError.consumer || null,\n method: validationError.method,\n path: validationError.path,\n loc: validationError.loc.split(\".\"),\n msg: validationError.msg,\n type: validationError.type,\n error_count: count,\n });\n }\n });\n this.errorCounts.clear();\n this.errorDetails.clear();\n return data;\n }\n\n private getKey(validationError: ConsumerMethodPath & ValidationError) {\n const hashInput = [\n validationError.consumer || \"\",\n validationError.method.toUpperCase(),\n validationError.path,\n validationError.loc,\n validationError.msg.trim(),\n validationError.type,\n ].join(\"|\");\n return createHash(\"md5\").update(hashInput).digest(\"hex\");\n }\n}\n"],"mappings":";;;;AAAA,SAASA,kBAAkB;AAQ3B,IAAqBC,0BAArB,MAAqBA,wBAAAA;EACXC;EACAC;EAER,cAAc;AACZ,SAAKD,cAAc,oBAAIE,IAAAA;AACvB,SAAKD,eAAe,oBAAIC,IAAAA;EAC1B;EAEOC,mBACLC,iBACA;AACA,UAAMC,MAAM,KAAKC,OAAOF,eAAAA;AACxB,QAAI,CAAC,KAAKH,aAAaM,IAAIF,GAAAA,GAAM;AAC/B,WAAKJ,aAAaO,IAAIH,KAAKD,eAAAA;IAC7B;AACA,SAAKJ,YAAYQ,IAAIH,MAAM,KAAKL,YAAYS,IAAIJ,GAAAA,KAAQ,KAAK,CAAA;EAC/D;EAEOK,8BAA8B;AACnC,UAAMC,OAAoC,CAAA;AAC1C,SAAKX,YAAYY,QAAQ,CAACC,OAAOR,QAAAA;AAC/B,YAAMD,kBAAkB,KAAKH,aAAaQ,IAAIJ,GAAAA;AAC9C,UAAID,iBAAiB;AACnBO,aAAKG,KAAK;UACRC,UAAUX,gBAAgBW,YAAY;UACtCC,QAAQZ,gBAAgBY;UACxBC,MAAMb,gBAAgBa;UACtBC,KAAKd,gBAAgBc,IAAIC,MAAM,GAAA;UAC/BC,KAAKhB,gBAAgBgB;UACrBC,MAAMjB,gBAAgBiB;UACtBC,aAAaT;QACf,CAAA;MACF;IACF,CAAA;AACA,SAAKb,YAAYuB,MAAK;AACtB,SAAKtB,aAAasB,MAAK;AACvB,WAAOZ;EACT;EAEQL,OAAOF,iBAAuD;AACpE,UAAMoB,YAAY;MAChBpB,gBAAgBW,YAAY;MAC5BX,gBAAgBY,OAAOS,YAAW;MAClCrB,gBAAgBa;MAChBb,gBAAgBc;MAChBd,gBAAgBgB,IAAIM,KAAI;MACxBtB,gBAAgBiB;MAChBM,KAAK,GAAA;AACP,WAAOC,WAAW,KAAA,EAAOC,OAAOL,SAAAA,EAAWM,OAAO,KAAA;EACpD;AACF;AAnDqB/B;AAArB,IAAqBA,yBAArB;","names":["createHash","ValidationErrorCounter","errorCounts","errorDetails","Map","addValidationError","validationError","key","getKey","has","set","get","getAndResetValidationErrors","data","forEach","count","push","consumer","method","path","loc","split","msg","type","error_count","clear","hashInput","toUpperCase","trim","join","createHash","update","digest"]}
|
package/dist/express/index.cjs
CHANGED
|
@@ -33,6 +33,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
33
33
|
// src/express/index.ts
|
|
34
34
|
var express_exports = {};
|
|
35
35
|
__export(express_exports, {
|
|
36
|
+
setConsumer: () => setConsumer,
|
|
36
37
|
useApitally: () => useApitally
|
|
37
38
|
});
|
|
38
39
|
module.exports = __toCommonJS(express_exports);
|
|
@@ -404,6 +405,8 @@ var BODY_MASKED = import_buffer2.Buffer.from("<masked>");
|
|
|
404
405
|
var MASKED = "******";
|
|
405
406
|
var ALLOWED_CONTENT_TYPES = [
|
|
406
407
|
"application/json",
|
|
408
|
+
"application/problem+json",
|
|
409
|
+
"application/vnd.api+json",
|
|
407
410
|
"text/plain"
|
|
408
411
|
];
|
|
409
412
|
var EXCLUDE_PATH_PATTERNS = [
|
|
@@ -468,6 +471,9 @@ var _RequestLogger = class _RequestLogger {
|
|
|
468
471
|
}, 1e3);
|
|
469
472
|
}
|
|
470
473
|
}
|
|
474
|
+
get maxBodySize() {
|
|
475
|
+
return MAX_BODY_SIZE;
|
|
476
|
+
}
|
|
471
477
|
shouldExcludePath(urlPath) {
|
|
472
478
|
const patterns = [
|
|
473
479
|
...this.config.excludePaths,
|
|
@@ -1054,25 +1060,7 @@ __name(_ApitallyClient, "ApitallyClient");
|
|
|
1054
1060
|
__publicField(_ApitallyClient, "instance");
|
|
1055
1061
|
var ApitallyClient = _ApitallyClient;
|
|
1056
1062
|
|
|
1057
|
-
// src/common/
|
|
1058
|
-
var import_module = require("module");
|
|
1059
|
-
var import_meta = {};
|
|
1060
|
-
function getPackageVersion(name) {
|
|
1061
|
-
const packageJsonPath = `${name}/package.json`;
|
|
1062
|
-
try {
|
|
1063
|
-
return require(packageJsonPath).version || null;
|
|
1064
|
-
} catch (error) {
|
|
1065
|
-
try {
|
|
1066
|
-
const _require = (0, import_module.createRequire)(import_meta.url);
|
|
1067
|
-
return _require(packageJsonPath).version || null;
|
|
1068
|
-
} catch (error2) {
|
|
1069
|
-
return null;
|
|
1070
|
-
}
|
|
1071
|
-
}
|
|
1072
|
-
}
|
|
1073
|
-
__name(getPackageVersion, "getPackageVersion");
|
|
1074
|
-
|
|
1075
|
-
// src/common/utils.ts
|
|
1063
|
+
// src/common/headers.ts
|
|
1076
1064
|
function parseContentLength(contentLength) {
|
|
1077
1065
|
if (contentLength === void 0 || contentLength === null) {
|
|
1078
1066
|
return void 0;
|
|
@@ -1091,6 +1079,24 @@ function parseContentLength(contentLength) {
|
|
|
1091
1079
|
}
|
|
1092
1080
|
__name(parseContentLength, "parseContentLength");
|
|
1093
1081
|
|
|
1082
|
+
// src/common/packageVersions.ts
|
|
1083
|
+
var import_module = require("module");
|
|
1084
|
+
var import_meta = {};
|
|
1085
|
+
function getPackageVersion(name) {
|
|
1086
|
+
const packageJsonPath = `${name}/package.json`;
|
|
1087
|
+
try {
|
|
1088
|
+
return require(packageJsonPath).version || null;
|
|
1089
|
+
} catch (error) {
|
|
1090
|
+
try {
|
|
1091
|
+
const _require = (0, import_module.createRequire)(import_meta.url);
|
|
1092
|
+
return _require(packageJsonPath).version || null;
|
|
1093
|
+
} catch (error2) {
|
|
1094
|
+
return null;
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
__name(getPackageVersion, "getPackageVersion");
|
|
1099
|
+
|
|
1094
1100
|
// src/express/utils.js
|
|
1095
1101
|
var regExpToParseExpressPathRegExp = /^\/\^\\?\/?(?:(:?[\w\\.-]*(?:\\\/:?[\w\\.-]*)*)|(\(\?:\\?\/?\([^)]+\)\)))\\\/.*/;
|
|
1096
1102
|
var regExpToReplaceExpressPathRegExpParams = /\(\?:\\?\/?\([^)]+\)\)/;
|
|
@@ -1102,6 +1108,29 @@ var STACK_ITEM_VALID_NAMES = [
|
|
|
1102
1108
|
"bound dispatch",
|
|
1103
1109
|
"mounted_app"
|
|
1104
1110
|
];
|
|
1111
|
+
var getRouterInfo = /* @__PURE__ */ __name(function(app) {
|
|
1112
|
+
var _a2, _b;
|
|
1113
|
+
if (app.stack) {
|
|
1114
|
+
return {
|
|
1115
|
+
stack: app.stack,
|
|
1116
|
+
version: "v4"
|
|
1117
|
+
};
|
|
1118
|
+
} else if ((_a2 = app._router) == null ? void 0 : _a2.stack) {
|
|
1119
|
+
return {
|
|
1120
|
+
stack: app._router.stack,
|
|
1121
|
+
version: "v4"
|
|
1122
|
+
};
|
|
1123
|
+
} else if ((_b = app.router) == null ? void 0 : _b.stack) {
|
|
1124
|
+
return {
|
|
1125
|
+
stack: app.router.stack,
|
|
1126
|
+
version: "v5"
|
|
1127
|
+
};
|
|
1128
|
+
}
|
|
1129
|
+
return {
|
|
1130
|
+
stack: null,
|
|
1131
|
+
version: "v4"
|
|
1132
|
+
};
|
|
1133
|
+
}, "getRouterInfo");
|
|
1105
1134
|
var getRouteMethods = /* @__PURE__ */ __name(function(route) {
|
|
1106
1135
|
let methods = Object.keys(route.methods);
|
|
1107
1136
|
methods = methods.filter((method) => method !== "_all");
|
|
@@ -1134,12 +1163,12 @@ var parseExpressRoute = /* @__PURE__ */ __name(function(route, basePath) {
|
|
|
1134
1163
|
});
|
|
1135
1164
|
return endpoints;
|
|
1136
1165
|
}, "parseExpressRoute");
|
|
1137
|
-
var
|
|
1166
|
+
var parseExpressPathRegExp = /* @__PURE__ */ __name(function(expressPathRegExp, keys) {
|
|
1138
1167
|
let parsedRegExp = expressPathRegExp.toString();
|
|
1139
1168
|
let expressPathRegExpExec = regExpToParseExpressPathRegExp.exec(parsedRegExp);
|
|
1140
1169
|
let paramIndex = 0;
|
|
1141
1170
|
while (hasParams(parsedRegExp)) {
|
|
1142
|
-
const paramName =
|
|
1171
|
+
const paramName = keys[paramIndex].name;
|
|
1143
1172
|
const paramId = `:${paramName}`;
|
|
1144
1173
|
parsedRegExp = parsedRegExp.replace(regExpToReplaceExpressPathRegExpParams, (str) => {
|
|
1145
1174
|
if (str.startsWith("(?:\\/")) {
|
|
@@ -1152,11 +1181,19 @@ var parseExpressPath = /* @__PURE__ */ __name(function(expressPathRegExp, params
|
|
|
1152
1181
|
if (parsedRegExp !== expressPathRegExp.toString()) {
|
|
1153
1182
|
expressPathRegExpExec = regExpToParseExpressPathRegExp.exec(parsedRegExp);
|
|
1154
1183
|
}
|
|
1155
|
-
|
|
1156
|
-
|
|
1184
|
+
return expressPathRegExpExec[1].replace(/\\\//g, "/");
|
|
1185
|
+
}, "parseExpressPathRegExp");
|
|
1186
|
+
var parseExpressPath = /* @__PURE__ */ __name(function(expressPath, params) {
|
|
1187
|
+
let result = expressPath;
|
|
1188
|
+
for (const [paramName, paramValue] of Object.entries(params)) {
|
|
1189
|
+
result = result.replace(paramValue, `:${paramName}`);
|
|
1190
|
+
}
|
|
1191
|
+
return result;
|
|
1157
1192
|
}, "parseExpressPath");
|
|
1158
1193
|
var parseEndpoints = /* @__PURE__ */ __name(function(app, basePath, endpoints) {
|
|
1159
|
-
const
|
|
1194
|
+
const routerInfo = getRouterInfo(app);
|
|
1195
|
+
const stack = routerInfo.stack;
|
|
1196
|
+
const version = routerInfo.version;
|
|
1160
1197
|
endpoints = endpoints || [];
|
|
1161
1198
|
basePath = basePath || "";
|
|
1162
1199
|
if (!stack) {
|
|
@@ -1170,7 +1207,7 @@ var parseEndpoints = /* @__PURE__ */ __name(function(app, basePath, endpoints) {
|
|
|
1170
1207
|
]);
|
|
1171
1208
|
}
|
|
1172
1209
|
} else {
|
|
1173
|
-
endpoints = parseStack(stack, basePath, endpoints);
|
|
1210
|
+
endpoints = parseStack(stack, basePath, endpoints, version);
|
|
1174
1211
|
}
|
|
1175
1212
|
return endpoints;
|
|
1176
1213
|
}, "parseEndpoints");
|
|
@@ -1186,20 +1223,28 @@ var addEndpoints = /* @__PURE__ */ __name(function(currentEndpoints, endpointsTo
|
|
|
1186
1223
|
});
|
|
1187
1224
|
return currentEndpoints;
|
|
1188
1225
|
}, "addEndpoints");
|
|
1189
|
-
var parseStack = /* @__PURE__ */ __name(function(stack, basePath, endpoints) {
|
|
1226
|
+
var parseStack = /* @__PURE__ */ __name(function(stack, basePath, endpoints, version) {
|
|
1190
1227
|
stack.forEach((stackItem) => {
|
|
1191
1228
|
if (stackItem.route) {
|
|
1192
1229
|
const newEndpoints = parseExpressRoute(stackItem.route, basePath);
|
|
1193
1230
|
endpoints = addEndpoints(endpoints, newEndpoints);
|
|
1194
1231
|
} else if (STACK_ITEM_VALID_NAMES.includes(stackItem.name)) {
|
|
1195
|
-
const isExpressPathRegexp = regExpToParseExpressPathRegExp.test(stackItem.regexp);
|
|
1196
1232
|
let newBasePath = basePath;
|
|
1197
|
-
if (
|
|
1198
|
-
const
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1233
|
+
if (version === "v4") {
|
|
1234
|
+
const isExpressPathRegExp = regExpToParseExpressPathRegExp.test(stackItem.regexp);
|
|
1235
|
+
if (isExpressPathRegExp) {
|
|
1236
|
+
const parsedPath = parseExpressPathRegExp(stackItem.regexp, stackItem.keys);
|
|
1237
|
+
newBasePath += `/${parsedPath}`;
|
|
1238
|
+
} else if (!stackItem.path && stackItem.regexp && stackItem.regexp.toString() !== EXPRESS_ROOT_PATH_REGEXP_VALUE) {
|
|
1239
|
+
const regExpPath = `RegExp(${stackItem.regexp})`;
|
|
1240
|
+
newBasePath += `/${regExpPath}`;
|
|
1241
|
+
}
|
|
1242
|
+
} else if (version === "v5") {
|
|
1243
|
+
if (!stackItem.path) {
|
|
1244
|
+
return;
|
|
1245
|
+
} else if (stackItem.path !== "/") {
|
|
1246
|
+
newBasePath += stackItem.path.startsWith("/") ? stackItem.path : `/${stackItem.path}`;
|
|
1247
|
+
}
|
|
1203
1248
|
}
|
|
1204
1249
|
endpoints = parseEndpoints(stackItem.handle, newBasePath, endpoints);
|
|
1205
1250
|
}
|
|
@@ -1218,15 +1263,22 @@ var getEndpoints = /* @__PURE__ */ __name(function(app, basePath) {
|
|
|
1218
1263
|
}, "getEndpoints");
|
|
1219
1264
|
|
|
1220
1265
|
// src/express/middleware.ts
|
|
1221
|
-
|
|
1266
|
+
function useApitally(app, config) {
|
|
1222
1267
|
const client = new ApitallyClient(config);
|
|
1223
1268
|
const middleware = getMiddleware(app, client);
|
|
1224
1269
|
app.use(middleware);
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1270
|
+
const setStartupData = /* @__PURE__ */ __name((attempt = 1) => {
|
|
1271
|
+
const appInfo = getAppInfo(app, config.basePath, config.appVersion);
|
|
1272
|
+
if (appInfo.paths.length > 0 || attempt >= 10) {
|
|
1273
|
+
client.setStartupData(appInfo);
|
|
1274
|
+
} else {
|
|
1275
|
+
setTimeout(() => setStartupData(attempt + 1), 500);
|
|
1276
|
+
}
|
|
1277
|
+
}, "setStartupData");
|
|
1278
|
+
setTimeout(() => setStartupData(), 500);
|
|
1279
|
+
}
|
|
1280
|
+
__name(useApitally, "useApitally");
|
|
1281
|
+
function getMiddleware(app, client) {
|
|
1230
1282
|
let errorHandlerConfigured = false;
|
|
1231
1283
|
return (req, res, next) => {
|
|
1232
1284
|
if (!client.isEnabled()) {
|
|
@@ -1250,7 +1302,7 @@ var getMiddleware = /* @__PURE__ */ __name((app, client) => {
|
|
|
1250
1302
|
}
|
|
1251
1303
|
return originalSend.call(res, body);
|
|
1252
1304
|
};
|
|
1253
|
-
res.
|
|
1305
|
+
res.once("finish", () => {
|
|
1254
1306
|
try {
|
|
1255
1307
|
const responseTime = import_perf_hooks.performance.now() - startTime;
|
|
1256
1308
|
const path = getRoutePath(req);
|
|
@@ -1343,29 +1395,37 @@ var getMiddleware = /* @__PURE__ */ __name((app, client) => {
|
|
|
1343
1395
|
next();
|
|
1344
1396
|
}
|
|
1345
1397
|
};
|
|
1346
|
-
}
|
|
1347
|
-
|
|
1398
|
+
}
|
|
1399
|
+
__name(getMiddleware, "getMiddleware");
|
|
1400
|
+
function getRoutePath(req) {
|
|
1348
1401
|
if (!req.route) {
|
|
1349
1402
|
return;
|
|
1350
1403
|
}
|
|
1351
1404
|
if (req.baseUrl) {
|
|
1352
|
-
const
|
|
1353
|
-
|
|
1405
|
+
const routerInfo = getRouterInfo(req.app);
|
|
1406
|
+
if (routerInfo.stack) {
|
|
1407
|
+
const routerPath = getRouterPath(routerInfo.stack, req.baseUrl);
|
|
1408
|
+
return req.route.path === "/" ? routerPath : routerPath + req.route.path;
|
|
1409
|
+
}
|
|
1354
1410
|
}
|
|
1355
1411
|
return req.route.path;
|
|
1356
|
-
}
|
|
1357
|
-
|
|
1412
|
+
}
|
|
1413
|
+
__name(getRoutePath, "getRoutePath");
|
|
1414
|
+
function getRouterPath(stack, baseUrl) {
|
|
1358
1415
|
var _a2;
|
|
1359
1416
|
const routerPaths = [];
|
|
1360
1417
|
while (stack && stack.length > 0) {
|
|
1361
1418
|
const routerLayer = stack.find((layer) => {
|
|
1362
1419
|
var _a3;
|
|
1363
|
-
return layer.name === "router" && layer.path && ((_a3 = layer.regexp) == null ? void 0 : _a3.test(baseUrl));
|
|
1420
|
+
return layer.name === "router" && layer.path && (baseUrl.startsWith(layer.path) || ((_a3 = layer.regexp) == null ? void 0 : _a3.test(baseUrl)));
|
|
1364
1421
|
});
|
|
1365
1422
|
if (routerLayer) {
|
|
1366
|
-
if (routerLayer.keys.length > 0) {
|
|
1367
|
-
const parsedPath =
|
|
1423
|
+
if (routerLayer.regexp && routerLayer.keys && routerLayer.keys.length > 0) {
|
|
1424
|
+
const parsedPath = parseExpressPathRegExp(routerLayer.regexp, routerLayer.keys);
|
|
1368
1425
|
routerPaths.push("/" + parsedPath);
|
|
1426
|
+
} else if (routerLayer.params && Object.keys(routerLayer.params).length > 0) {
|
|
1427
|
+
const parsedPath = parseExpressPath(routerLayer.path, routerLayer.params);
|
|
1428
|
+
routerPaths.push(parsedPath);
|
|
1369
1429
|
} else {
|
|
1370
1430
|
routerPaths.push(routerLayer.path);
|
|
1371
1431
|
}
|
|
@@ -1376,8 +1436,13 @@ var getRouterPath = /* @__PURE__ */ __name((stack, baseUrl) => {
|
|
|
1376
1436
|
}
|
|
1377
1437
|
}
|
|
1378
1438
|
return routerPaths.filter((path) => path !== "/").join("");
|
|
1379
|
-
}
|
|
1380
|
-
|
|
1439
|
+
}
|
|
1440
|
+
__name(getRouterPath, "getRouterPath");
|
|
1441
|
+
function setConsumer(req, consumer) {
|
|
1442
|
+
req.apitallyConsumer = consumer || void 0;
|
|
1443
|
+
}
|
|
1444
|
+
__name(setConsumer, "setConsumer");
|
|
1445
|
+
function getConsumer(req) {
|
|
1381
1446
|
if (req.apitallyConsumer) {
|
|
1382
1447
|
return consumerFromStringOrObject(req.apitallyConsumer);
|
|
1383
1448
|
} else if (req.consumerIdentifier) {
|
|
@@ -1385,8 +1450,9 @@ var getConsumer = /* @__PURE__ */ __name((req) => {
|
|
|
1385
1450
|
return consumerFromStringOrObject(req.consumerIdentifier);
|
|
1386
1451
|
}
|
|
1387
1452
|
return null;
|
|
1388
|
-
}
|
|
1389
|
-
|
|
1453
|
+
}
|
|
1454
|
+
__name(getConsumer, "getConsumer");
|
|
1455
|
+
function extractExpressValidatorErrors(responseBody) {
|
|
1390
1456
|
try {
|
|
1391
1457
|
const errors = [];
|
|
1392
1458
|
if (responseBody && responseBody.errors && Array.isArray(responseBody.errors)) {
|
|
@@ -1404,8 +1470,9 @@ var extractExpressValidatorErrors = /* @__PURE__ */ __name((responseBody) => {
|
|
|
1404
1470
|
} catch (error) {
|
|
1405
1471
|
return [];
|
|
1406
1472
|
}
|
|
1407
|
-
}
|
|
1408
|
-
|
|
1473
|
+
}
|
|
1474
|
+
__name(extractExpressValidatorErrors, "extractExpressValidatorErrors");
|
|
1475
|
+
function extractCelebrateErrors(responseBody) {
|
|
1409
1476
|
try {
|
|
1410
1477
|
const errors = [];
|
|
1411
1478
|
if (responseBody && responseBody.validation) {
|
|
@@ -1425,8 +1492,9 @@ var extractCelebrateErrors = /* @__PURE__ */ __name((responseBody) => {
|
|
|
1425
1492
|
} catch (error) {
|
|
1426
1493
|
return [];
|
|
1427
1494
|
}
|
|
1428
|
-
}
|
|
1429
|
-
|
|
1495
|
+
}
|
|
1496
|
+
__name(extractCelebrateErrors, "extractCelebrateErrors");
|
|
1497
|
+
function extractNestValidationErrors(responseBody) {
|
|
1430
1498
|
try {
|
|
1431
1499
|
const errors = [];
|
|
1432
1500
|
if (responseBody && Array.isArray(responseBody.message)) {
|
|
@@ -1442,12 +1510,14 @@ var extractNestValidationErrors = /* @__PURE__ */ __name((responseBody) => {
|
|
|
1442
1510
|
} catch (error) {
|
|
1443
1511
|
return [];
|
|
1444
1512
|
}
|
|
1445
|
-
}
|
|
1446
|
-
|
|
1513
|
+
}
|
|
1514
|
+
__name(extractNestValidationErrors, "extractNestValidationErrors");
|
|
1515
|
+
function subsetJoiMessage(message, key) {
|
|
1447
1516
|
const messageWithKey = message.split(". ").find((message2) => message2.includes(`"${key}"`));
|
|
1448
1517
|
return messageWithKey ? messageWithKey : message;
|
|
1449
|
-
}
|
|
1450
|
-
|
|
1518
|
+
}
|
|
1519
|
+
__name(subsetJoiMessage, "subsetJoiMessage");
|
|
1520
|
+
function getAppInfo(app, basePath, appVersion) {
|
|
1451
1521
|
const versions = [
|
|
1452
1522
|
[
|
|
1453
1523
|
"nodejs",
|
|
@@ -1486,9 +1556,11 @@ var getAppInfo = /* @__PURE__ */ __name((app, basePath, appVersion) => {
|
|
|
1486
1556
|
versions: Object.fromEntries(versions),
|
|
1487
1557
|
client: "js:express"
|
|
1488
1558
|
};
|
|
1489
|
-
}
|
|
1559
|
+
}
|
|
1560
|
+
__name(getAppInfo, "getAppInfo");
|
|
1490
1561
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1491
1562
|
0 && (module.exports = {
|
|
1563
|
+
setConsumer,
|
|
1492
1564
|
useApitally
|
|
1493
1565
|
});
|
|
1494
1566
|
//# sourceMappingURL=index.cjs.map
|