This commit is contained in:
Carl-Gerhard Lindesvärd
2026-03-06 09:00:10 +01:00
parent 765e4aa107
commit 90881e5ffb
68 changed files with 4092 additions and 1694 deletions

View File

@@ -63,6 +63,7 @@ async function main() {
imported_at: null,
sdk_name: 'test-script',
sdk_version: '1.0.0',
groups: [],
});
}

View File

@@ -341,13 +341,23 @@ async function handleGroup(
context: TrackContext
): Promise<void> {
const { id, type, name, properties = {} } = payload;
await upsertGroup({
id,
projectId: context.projectId,
type,
name,
properties,
});
const profileId = payload.profileId ?? context.deviceId;
await Promise.all([
upsertGroup({
id,
projectId: context.projectId,
type,
name,
properties,
}),
upsertProfile({
id: profileId,
projectId: context.projectId,
isExternal: !!(payload.profileId ?? context.identity?.profileId),
groups: [id],
}),
]);
}
export async function handler(