apitally 0.21.2 → 0.21.3
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/dist/adonisjs/provider.cjs +15 -9
- package/dist/adonisjs/provider.cjs.map +1 -1
- package/dist/adonisjs/provider.js +15 -9
- package/dist/adonisjs/provider.js.map +1 -1
- package/dist/common/client.cjs +14 -9
- package/dist/common/client.cjs.map +1 -1
- package/dist/common/client.d.cts +1 -1
- package/dist/common/client.d.ts +1 -1
- package/dist/common/client.js +14 -9
- package/dist/common/client.js.map +1 -1
- package/dist/common/response.cjs +21 -2
- package/dist/common/response.cjs.map +1 -1
- package/dist/common/response.d.cts +2 -1
- package/dist/common/response.d.ts +2 -1
- package/dist/common/response.js +19 -1
- package/dist/common/response.js.map +1 -1
- package/dist/elysia/index.cjs +40 -16
- package/dist/elysia/index.cjs.map +1 -1
- package/dist/elysia/index.js +40 -16
- package/dist/elysia/index.js.map +1 -1
- package/dist/elysia/plugin.cjs +40 -16
- package/dist/elysia/plugin.cjs.map +1 -1
- package/dist/elysia/plugin.js +40 -16
- package/dist/elysia/plugin.js.map +1 -1
- package/dist/express/index.cjs +15 -9
- package/dist/express/index.cjs.map +1 -1
- package/dist/express/index.js +15 -9
- package/dist/express/index.js.map +1 -1
- package/dist/express/middleware.cjs +15 -9
- package/dist/express/middleware.cjs.map +1 -1
- package/dist/express/middleware.js +15 -9
- package/dist/express/middleware.js.map +1 -1
- package/dist/fastify/index.cjs +15 -9
- package/dist/fastify/index.cjs.map +1 -1
- package/dist/fastify/index.js +15 -9
- package/dist/fastify/index.js.map +1 -1
- package/dist/fastify/plugin.cjs +15 -9
- package/dist/fastify/plugin.cjs.map +1 -1
- package/dist/fastify/plugin.js +15 -9
- package/dist/fastify/plugin.js.map +1 -1
- package/dist/h3/index.cjs +15 -9
- package/dist/h3/index.cjs.map +1 -1
- package/dist/h3/index.js +15 -9
- package/dist/h3/index.js.map +1 -1
- package/dist/h3/plugin.cjs +15 -9
- package/dist/h3/plugin.cjs.map +1 -1
- package/dist/h3/plugin.js +15 -9
- package/dist/h3/plugin.js.map +1 -1
- package/dist/hapi/index.cjs +15 -9
- package/dist/hapi/index.cjs.map +1 -1
- package/dist/hapi/index.js +15 -9
- package/dist/hapi/index.js.map +1 -1
- package/dist/hapi/plugin.cjs +15 -9
- package/dist/hapi/plugin.cjs.map +1 -1
- package/dist/hapi/plugin.js +15 -9
- package/dist/hapi/plugin.js.map +1 -1
- package/dist/hono/index.cjs +15 -9
- package/dist/hono/index.cjs.map +1 -1
- package/dist/hono/index.js +15 -9
- package/dist/hono/index.js.map +1 -1
- package/dist/hono/middleware.cjs +15 -9
- package/dist/hono/middleware.cjs.map +1 -1
- package/dist/hono/middleware.js +15 -9
- package/dist/hono/middleware.js.map +1 -1
- package/dist/koa/index.cjs +15 -9
- package/dist/koa/index.cjs.map +1 -1
- package/dist/koa/index.js +15 -9
- package/dist/koa/index.js.map +1 -1
- package/dist/koa/middleware.cjs +15 -9
- package/dist/koa/middleware.cjs.map +1 -1
- package/dist/koa/middleware.js +15 -9
- package/dist/koa/middleware.js.map +1 -1
- package/dist/nestjs/index.cjs +16 -9
- package/dist/nestjs/index.cjs.map +1 -1
- package/dist/nestjs/index.js +16 -9
- package/dist/nestjs/index.js.map +1 -1
- package/package.json +1 -1
package/dist/hapi/index.cjs
CHANGED
|
@@ -5269,11 +5269,14 @@ var _ApitallyClient = class _ApitallyClient {
|
|
|
5269
5269
|
if (_ApitallyClient.instance) {
|
|
5270
5270
|
throw new Error("Apitally client is already initialized");
|
|
5271
5271
|
}
|
|
5272
|
+
this.logger = logger ?? getLogger();
|
|
5272
5273
|
if (!isValidClientId(clientId)) {
|
|
5273
|
-
|
|
5274
|
+
this.logger.error(`Invalid Apitally client ID '${clientId}' (expecting hexadecimal UUID format)`);
|
|
5275
|
+
this.enabled = false;
|
|
5274
5276
|
}
|
|
5275
5277
|
if (!isValidEnv(env)) {
|
|
5276
|
-
|
|
5278
|
+
this.logger.error(`Invalid Apitally env '${env}' (expecting 1-32 alphanumeric characters and hyphens only)`);
|
|
5279
|
+
this.enabled = false;
|
|
5277
5280
|
}
|
|
5278
5281
|
if (requestLoggingConfig && !requestLogging) {
|
|
5279
5282
|
console.warn("requestLoggingConfig is deprecated, use requestLogging instead.");
|
|
@@ -5288,8 +5291,6 @@ var _ApitallyClient = class _ApitallyClient {
|
|
|
5288
5291
|
this.validationErrorCounter = new ValidationErrorCounter();
|
|
5289
5292
|
this.serverErrorCounter = new ServerErrorCounter();
|
|
5290
5293
|
this.consumerRegistry = new ConsumerRegistry();
|
|
5291
|
-
this.logger = logger ?? getLogger();
|
|
5292
|
-
this.startSync();
|
|
5293
5294
|
this.handleShutdown = this.handleShutdown.bind(this);
|
|
5294
5295
|
}
|
|
5295
5296
|
static getInstance() {
|
|
@@ -5344,15 +5345,20 @@ var _ApitallyClient = class _ApitallyClient {
|
|
|
5344
5345
|
}
|
|
5345
5346
|
}
|
|
5346
5347
|
startSync() {
|
|
5348
|
+
if (!this.enabled) {
|
|
5349
|
+
return;
|
|
5350
|
+
}
|
|
5347
5351
|
this.sync();
|
|
5348
5352
|
this.syncIntervalId = setInterval(() => {
|
|
5349
5353
|
this.sync();
|
|
5350
5354
|
}, INITIAL_SYNC_INTERVAL);
|
|
5351
5355
|
setTimeout(() => {
|
|
5352
|
-
|
|
5353
|
-
|
|
5354
|
-
this.
|
|
5355
|
-
|
|
5356
|
+
if (this.syncIntervalId) {
|
|
5357
|
+
clearInterval(this.syncIntervalId);
|
|
5358
|
+
this.syncIntervalId = setInterval(() => {
|
|
5359
|
+
this.sync();
|
|
5360
|
+
}, SYNC_INTERVAL);
|
|
5361
|
+
}
|
|
5356
5362
|
}, INITIAL_SYNC_INTERVAL_DURATION);
|
|
5357
5363
|
}
|
|
5358
5364
|
async sync() {
|
|
@@ -5380,7 +5386,6 @@ var _ApitallyClient = class _ApitallyClient {
|
|
|
5380
5386
|
setStartupData(data) {
|
|
5381
5387
|
this.startupData = data;
|
|
5382
5388
|
this.startupDataSent = false;
|
|
5383
|
-
this.sendStartupData();
|
|
5384
5389
|
}
|
|
5385
5390
|
async sendStartupData() {
|
|
5386
5391
|
if (this.startupData) {
|
|
@@ -5872,6 +5877,7 @@ function apitallyPlugin(config) {
|
|
|
5872
5877
|
server.ext("onPostStart", () => {
|
|
5873
5878
|
const appInfo = getAppInfo(server, config.appVersion);
|
|
5874
5879
|
client.setStartupData(appInfo);
|
|
5880
|
+
client.startSync();
|
|
5875
5881
|
});
|
|
5876
5882
|
server.ext("onPreStop", async () => {
|
|
5877
5883
|
await client.handleShutdown();
|