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
|
@@ -5220,11 +5220,14 @@ var _ApitallyClient = class _ApitallyClient {
|
|
|
5220
5220
|
if (_ApitallyClient.instance) {
|
|
5221
5221
|
throw new Error("Apitally client is already initialized");
|
|
5222
5222
|
}
|
|
5223
|
+
this.logger = logger ?? getLogger();
|
|
5223
5224
|
if (!isValidClientId(clientId)) {
|
|
5224
|
-
|
|
5225
|
+
this.logger.error(`Invalid Apitally client ID '${clientId}' (expecting hexadecimal UUID format)`);
|
|
5226
|
+
this.enabled = false;
|
|
5225
5227
|
}
|
|
5226
5228
|
if (!isValidEnv(env)) {
|
|
5227
|
-
|
|
5229
|
+
this.logger.error(`Invalid Apitally env '${env}' (expecting 1-32 alphanumeric characters and hyphens only)`);
|
|
5230
|
+
this.enabled = false;
|
|
5228
5231
|
}
|
|
5229
5232
|
if (requestLoggingConfig && !requestLogging) {
|
|
5230
5233
|
console.warn("requestLoggingConfig is deprecated, use requestLogging instead.");
|
|
@@ -5239,8 +5242,6 @@ var _ApitallyClient = class _ApitallyClient {
|
|
|
5239
5242
|
this.validationErrorCounter = new ValidationErrorCounter();
|
|
5240
5243
|
this.serverErrorCounter = new ServerErrorCounter();
|
|
5241
5244
|
this.consumerRegistry = new ConsumerRegistry();
|
|
5242
|
-
this.logger = logger ?? getLogger();
|
|
5243
|
-
this.startSync();
|
|
5244
5245
|
this.handleShutdown = this.handleShutdown.bind(this);
|
|
5245
5246
|
}
|
|
5246
5247
|
static getInstance() {
|
|
@@ -5295,15 +5296,20 @@ var _ApitallyClient = class _ApitallyClient {
|
|
|
5295
5296
|
}
|
|
5296
5297
|
}
|
|
5297
5298
|
startSync() {
|
|
5299
|
+
if (!this.enabled) {
|
|
5300
|
+
return;
|
|
5301
|
+
}
|
|
5298
5302
|
this.sync();
|
|
5299
5303
|
this.syncIntervalId = setInterval(() => {
|
|
5300
5304
|
this.sync();
|
|
5301
5305
|
}, INITIAL_SYNC_INTERVAL);
|
|
5302
5306
|
setTimeout(() => {
|
|
5303
|
-
|
|
5304
|
-
|
|
5305
|
-
this.
|
|
5306
|
-
|
|
5307
|
+
if (this.syncIntervalId) {
|
|
5308
|
+
clearInterval(this.syncIntervalId);
|
|
5309
|
+
this.syncIntervalId = setInterval(() => {
|
|
5310
|
+
this.sync();
|
|
5311
|
+
}, SYNC_INTERVAL);
|
|
5312
|
+
}
|
|
5307
5313
|
}, INITIAL_SYNC_INTERVAL_DURATION);
|
|
5308
5314
|
}
|
|
5309
5315
|
async sync() {
|
|
@@ -5331,7 +5337,6 @@ var _ApitallyClient = class _ApitallyClient {
|
|
|
5331
5337
|
setStartupData(data) {
|
|
5332
5338
|
this.startupData = data;
|
|
5333
5339
|
this.startupDataSent = false;
|
|
5334
|
-
this.sendStartupData();
|
|
5335
5340
|
}
|
|
5336
5341
|
async sendStartupData() {
|
|
5337
5342
|
if (this.startupData) {
|
|
@@ -5703,6 +5708,7 @@ var _ApitallyProvider = class _ApitallyProvider {
|
|
|
5703
5708
|
client: "js:adonisjs"
|
|
5704
5709
|
};
|
|
5705
5710
|
client.setStartupData(startupData);
|
|
5711
|
+
client.startSync();
|
|
5706
5712
|
}
|
|
5707
5713
|
async shutdown() {
|
|
5708
5714
|
const client = await this.app.container.make("apitallyClient");
|