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/nestjs/index.cjs
CHANGED
|
@@ -11963,11 +11963,14 @@ var init_client = __esm({
|
|
|
11963
11963
|
if (_ApitallyClient.instance) {
|
|
11964
11964
|
throw new Error("Apitally client is already initialized");
|
|
11965
11965
|
}
|
|
11966
|
+
this.logger = logger ?? getLogger();
|
|
11966
11967
|
if (!isValidClientId(clientId)) {
|
|
11967
|
-
|
|
11968
|
+
this.logger.error(`Invalid Apitally client ID '${clientId}' (expecting hexadecimal UUID format)`);
|
|
11969
|
+
this.enabled = false;
|
|
11968
11970
|
}
|
|
11969
11971
|
if (!isValidEnv(env)) {
|
|
11970
|
-
|
|
11972
|
+
this.logger.error(`Invalid Apitally env '${env}' (expecting 1-32 alphanumeric characters and hyphens only)`);
|
|
11973
|
+
this.enabled = false;
|
|
11971
11974
|
}
|
|
11972
11975
|
if (requestLoggingConfig && !requestLogging) {
|
|
11973
11976
|
console.warn("requestLoggingConfig is deprecated, use requestLogging instead.");
|
|
@@ -11982,8 +11985,6 @@ var init_client = __esm({
|
|
|
11982
11985
|
this.validationErrorCounter = new ValidationErrorCounter();
|
|
11983
11986
|
this.serverErrorCounter = new ServerErrorCounter();
|
|
11984
11987
|
this.consumerRegistry = new ConsumerRegistry();
|
|
11985
|
-
this.logger = logger ?? getLogger();
|
|
11986
|
-
this.startSync();
|
|
11987
11988
|
this.handleShutdown = this.handleShutdown.bind(this);
|
|
11988
11989
|
}
|
|
11989
11990
|
static getInstance() {
|
|
@@ -12038,15 +12039,20 @@ var init_client = __esm({
|
|
|
12038
12039
|
}
|
|
12039
12040
|
}
|
|
12040
12041
|
startSync() {
|
|
12042
|
+
if (!this.enabled) {
|
|
12043
|
+
return;
|
|
12044
|
+
}
|
|
12041
12045
|
this.sync();
|
|
12042
12046
|
this.syncIntervalId = setInterval(() => {
|
|
12043
12047
|
this.sync();
|
|
12044
12048
|
}, INITIAL_SYNC_INTERVAL);
|
|
12045
12049
|
setTimeout(() => {
|
|
12046
|
-
|
|
12047
|
-
|
|
12048
|
-
this.
|
|
12049
|
-
|
|
12050
|
+
if (this.syncIntervalId) {
|
|
12051
|
+
clearInterval(this.syncIntervalId);
|
|
12052
|
+
this.syncIntervalId = setInterval(() => {
|
|
12053
|
+
this.sync();
|
|
12054
|
+
}, SYNC_INTERVAL);
|
|
12055
|
+
}
|
|
12050
12056
|
}, INITIAL_SYNC_INTERVAL_DURATION);
|
|
12051
12057
|
}
|
|
12052
12058
|
async sync() {
|
|
@@ -12074,7 +12080,6 @@ var init_client = __esm({
|
|
|
12074
12080
|
setStartupData(data) {
|
|
12075
12081
|
this.startupData = data;
|
|
12076
12082
|
this.startupDataSent = false;
|
|
12077
|
-
this.sendStartupData();
|
|
12078
12083
|
}
|
|
12079
12084
|
async sendStartupData() {
|
|
12080
12085
|
if (this.startupData) {
|
|
@@ -17175,6 +17180,7 @@ function useApitally(app, config) {
|
|
|
17175
17180
|
const appInfo = getAppInfo(app, config.basePath, config.appVersion);
|
|
17176
17181
|
if (appInfo.paths.length > 0 || attempt >= 10) {
|
|
17177
17182
|
client.setStartupData(appInfo);
|
|
17183
|
+
client.startSync();
|
|
17178
17184
|
} else {
|
|
17179
17185
|
setTimeout(() => setStartupData(attempt + 1), 500);
|
|
17180
17186
|
}
|
|
@@ -17654,6 +17660,7 @@ var init_plugin = __esm({
|
|
|
17654
17660
|
});
|
|
17655
17661
|
fastify.addHook("onReady", () => {
|
|
17656
17662
|
client.setStartupData(getAppInfo2(routes, config.appVersion));
|
|
17663
|
+
client.startSync();
|
|
17657
17664
|
});
|
|
17658
17665
|
fastify.addHook("onClose", async () => {
|
|
17659
17666
|
await client.handleShutdown();
|