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
|
@@ -5225,11 +5225,14 @@ var _ApitallyClient = class _ApitallyClient {
|
|
|
5225
5225
|
if (_ApitallyClient.instance) {
|
|
5226
5226
|
throw new Error("Apitally client is already initialized");
|
|
5227
5227
|
}
|
|
5228
|
+
this.logger = logger ?? getLogger();
|
|
5228
5229
|
if (!isValidClientId(clientId)) {
|
|
5229
|
-
|
|
5230
|
+
this.logger.error(`Invalid Apitally client ID '${clientId}' (expecting hexadecimal UUID format)`);
|
|
5231
|
+
this.enabled = false;
|
|
5230
5232
|
}
|
|
5231
5233
|
if (!isValidEnv(env)) {
|
|
5232
|
-
|
|
5234
|
+
this.logger.error(`Invalid Apitally env '${env}' (expecting 1-32 alphanumeric characters and hyphens only)`);
|
|
5235
|
+
this.enabled = false;
|
|
5233
5236
|
}
|
|
5234
5237
|
if (requestLoggingConfig && !requestLogging) {
|
|
5235
5238
|
console.warn("requestLoggingConfig is deprecated, use requestLogging instead.");
|
|
@@ -5244,8 +5247,6 @@ var _ApitallyClient = class _ApitallyClient {
|
|
|
5244
5247
|
this.validationErrorCounter = new ValidationErrorCounter();
|
|
5245
5248
|
this.serverErrorCounter = new ServerErrorCounter();
|
|
5246
5249
|
this.consumerRegistry = new ConsumerRegistry();
|
|
5247
|
-
this.logger = logger ?? getLogger();
|
|
5248
|
-
this.startSync();
|
|
5249
5250
|
this.handleShutdown = this.handleShutdown.bind(this);
|
|
5250
5251
|
}
|
|
5251
5252
|
static getInstance() {
|
|
@@ -5300,15 +5301,20 @@ var _ApitallyClient = class _ApitallyClient {
|
|
|
5300
5301
|
}
|
|
5301
5302
|
}
|
|
5302
5303
|
startSync() {
|
|
5304
|
+
if (!this.enabled) {
|
|
5305
|
+
return;
|
|
5306
|
+
}
|
|
5303
5307
|
this.sync();
|
|
5304
5308
|
this.syncIntervalId = setInterval(() => {
|
|
5305
5309
|
this.sync();
|
|
5306
5310
|
}, INITIAL_SYNC_INTERVAL);
|
|
5307
5311
|
setTimeout(() => {
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
this.
|
|
5311
|
-
|
|
5312
|
+
if (this.syncIntervalId) {
|
|
5313
|
+
clearInterval(this.syncIntervalId);
|
|
5314
|
+
this.syncIntervalId = setInterval(() => {
|
|
5315
|
+
this.sync();
|
|
5316
|
+
}, SYNC_INTERVAL);
|
|
5317
|
+
}
|
|
5312
5318
|
}, INITIAL_SYNC_INTERVAL_DURATION);
|
|
5313
5319
|
}
|
|
5314
5320
|
async sync() {
|
|
@@ -5336,7 +5342,6 @@ var _ApitallyClient = class _ApitallyClient {
|
|
|
5336
5342
|
setStartupData(data) {
|
|
5337
5343
|
this.startupData = data;
|
|
5338
5344
|
this.startupDataSent = false;
|
|
5339
|
-
this.sendStartupData();
|
|
5340
5345
|
}
|
|
5341
5346
|
async sendStartupData() {
|
|
5342
5347
|
if (this.startupData) {
|
|
@@ -5709,6 +5714,7 @@ var _ApitallyProvider = class _ApitallyProvider {
|
|
|
5709
5714
|
client: "js:adonisjs"
|
|
5710
5715
|
};
|
|
5711
5716
|
client.setStartupData(startupData);
|
|
5717
|
+
client.startSync();
|
|
5712
5718
|
}
|
|
5713
5719
|
async shutdown() {
|
|
5714
5720
|
const client = await this.app.container.make("apitallyClient");
|