Fix self host application (#18292)
- Fixes self host application - add new telemetry information - add serverId to identify a server instance - remove .twenty from git tracking - tree-shake "twenty-sdk" usage in built logic functions and front components - fix "twenty-sdk" version usage - fix twenty-zapier cli --------- Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
This commit is contained in:
+7
-16
@@ -1,13 +1,12 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
import { type ObjectRecordCreateEvent } from 'twenty-shared/database-events';
|
||||
|
||||
import { OnCustomBatchEvent } from 'src/engine/api/graphql/graphql-query-runner/decorators/on-custom-batch-event.decorator';
|
||||
import { USER_SIGNUP_EVENT_NAME } from 'src/engine/api/graphql/workspace-query-runner/constants/user-signup-event-name.constants';
|
||||
import { AuditService } from 'src/engine/core-modules/audit/services/audit.service';
|
||||
import { USER_SIGNUP_EVENT } from 'src/engine/core-modules/audit/utils/events/workspace-event/user/user-signup';
|
||||
import { TelemetryService } from 'src/engine/core-modules/telemetry/telemetry.service';
|
||||
import { CustomWorkspaceEventBatch } from 'src/engine/workspace-event-emitter/types/custom-workspace-batch-event.type';
|
||||
import { TelemetryEventType } from 'src/engine/core-modules/telemetry/telemetry-event.type';
|
||||
|
||||
@Injectable()
|
||||
export class TelemetryListener {
|
||||
@@ -18,7 +17,7 @@ export class TelemetryListener {
|
||||
|
||||
@OnCustomBatchEvent(USER_SIGNUP_EVENT_NAME)
|
||||
async handleUserSignup(
|
||||
payload: CustomWorkspaceEventBatch<ObjectRecordCreateEvent>,
|
||||
payload: CustomWorkspaceEventBatch<TelemetryEventType>,
|
||||
) {
|
||||
await Promise.all(
|
||||
payload.events.map(async (eventPayload) => {
|
||||
@@ -28,20 +27,12 @@ export class TelemetryListener {
|
||||
workspaceId: payload.workspaceId,
|
||||
})
|
||||
.insertWorkspaceEvent(USER_SIGNUP_EVENT, {});
|
||||
|
||||
this.telemetryService.create(
|
||||
{
|
||||
action: USER_SIGNUP_EVENT_NAME,
|
||||
payload: {
|
||||
payload,
|
||||
userId: undefined,
|
||||
workspaceId: undefined,
|
||||
},
|
||||
},
|
||||
eventPayload.userId,
|
||||
payload.workspaceId,
|
||||
);
|
||||
}),
|
||||
);
|
||||
|
||||
await this.telemetryService.publish({
|
||||
action: USER_SIGNUP_EVENT_NAME,
|
||||
events: payload.events,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user