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
|
@@ -5299,11 +5299,14 @@ var _ApitallyClient = class _ApitallyClient {
|
|
|
5299
5299
|
if (_ApitallyClient.instance) {
|
|
5300
5300
|
throw new Error("Apitally client is already initialized");
|
|
5301
5301
|
}
|
|
5302
|
+
this.logger = logger ?? getLogger();
|
|
5302
5303
|
if (!isValidClientId(clientId)) {
|
|
5303
|
-
|
|
5304
|
+
this.logger.error(`Invalid Apitally client ID '${clientId}' (expecting hexadecimal UUID format)`);
|
|
5305
|
+
this.enabled = false;
|
|
5304
5306
|
}
|
|
5305
5307
|
if (!isValidEnv(env)) {
|
|
5306
|
-
|
|
5308
|
+
this.logger.error(`Invalid Apitally env '${env}' (expecting 1-32 alphanumeric characters and hyphens only)`);
|
|
5309
|
+
this.enabled = false;
|
|
5307
5310
|
}
|
|
5308
5311
|
if (requestLoggingConfig && !requestLogging) {
|
|
5309
5312
|
console.warn("requestLoggingConfig is deprecated, use requestLogging instead.");
|
|
@@ -5318,8 +5321,6 @@ var _ApitallyClient = class _ApitallyClient {
|
|
|
5318
5321
|
this.validationErrorCounter = new ValidationErrorCounter();
|
|
5319
5322
|
this.serverErrorCounter = new ServerErrorCounter();
|
|
5320
5323
|
this.consumerRegistry = new ConsumerRegistry();
|
|
5321
|
-
this.logger = logger ?? getLogger();
|
|
5322
|
-
this.startSync();
|
|
5323
5324
|
this.handleShutdown = this.handleShutdown.bind(this);
|
|
5324
5325
|
}
|
|
5325
5326
|
static getInstance() {
|
|
@@ -5374,15 +5375,20 @@ var _ApitallyClient = class _ApitallyClient {
|
|
|
5374
5375
|
}
|
|
5375
5376
|
}
|
|
5376
5377
|
startSync() {
|
|
5378
|
+
if (!this.enabled) {
|
|
5379
|
+
return;
|
|
5380
|
+
}
|
|
5377
5381
|
this.sync();
|
|
5378
5382
|
this.syncIntervalId = setInterval(() => {
|
|
5379
5383
|
this.sync();
|
|
5380
5384
|
}, INITIAL_SYNC_INTERVAL);
|
|
5381
5385
|
setTimeout(() => {
|
|
5382
|
-
|
|
5383
|
-
|
|
5384
|
-
this.
|
|
5385
|
-
|
|
5386
|
+
if (this.syncIntervalId) {
|
|
5387
|
+
clearInterval(this.syncIntervalId);
|
|
5388
|
+
this.syncIntervalId = setInterval(() => {
|
|
5389
|
+
this.sync();
|
|
5390
|
+
}, SYNC_INTERVAL);
|
|
5391
|
+
}
|
|
5386
5392
|
}, INITIAL_SYNC_INTERVAL_DURATION);
|
|
5387
5393
|
}
|
|
5388
5394
|
async sync() {
|
|
@@ -5410,7 +5416,6 @@ var _ApitallyClient = class _ApitallyClient {
|
|
|
5410
5416
|
setStartupData(data) {
|
|
5411
5417
|
this.startupData = data;
|
|
5412
5418
|
this.startupDataSent = false;
|
|
5413
|
-
this.sendStartupData();
|
|
5414
5419
|
}
|
|
5415
5420
|
async sendStartupData() {
|
|
5416
5421
|
if (this.startupData) {
|
|
@@ -6067,6 +6072,7 @@ function useApitally(app, config) {
|
|
|
6067
6072
|
const appInfo = getAppInfo(app, config.basePath, config.appVersion);
|
|
6068
6073
|
if (appInfo.paths.length > 0 || attempt >= 10) {
|
|
6069
6074
|
client.setStartupData(appInfo);
|
|
6075
|
+
client.startSync();
|
|
6070
6076
|
} else {
|
|
6071
6077
|
setTimeout(() => setStartupData(attempt + 1), 500);
|
|
6072
6078
|
}
|