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