feat(platform): extend moderation and automod span end metadata (Phase 535)
Add spanKind and activeChannelId on ban.member, kick.member, timeout.member, automod.setConfig, and automod.evaluate span completions. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -159,6 +159,8 @@ Expose a single `EventEmitter` API the UI drives over IPC (`apps/pearcord/index.
|
||||
|
||||
**v0.8.478 (Phase 515):** DM spans — `dm.open` (`spanKind`, `reusedChannel`, `peerDisplayNameLen`), `dm.send` (when `guildId === dm`), `dm.group.create` (`participantCount`, `nameLen`). UI `syncDmsPanelsDuringGuildLoading`, tightened **dm-errors**, clipboard DM meta. Bundle: `npm run test:phase515-dms`. See [DM.md](../../docs/DM.md).
|
||||
|
||||
**v0.8.498 (Phase 535):** Moderation/automod spans extend — `ban.member`/`kick.member`/`timeout.member`/`automod.*` end metadata (`spanKind`, `activeChannelId`). UI moderation panel compositor wrappers, ban/audit `aria-current=location`, clipboard moderation busy flags. Bundle: `npm run test:phase535-moderation`. See [MODERATION.md](../../docs/MODERATION.md).
|
||||
|
||||
**v0.8.497 (Phase 534):** Role/permission spans extend — `role.create`/`update`/`delete`/`reorder` and `permission.overwrite*` end metadata (`spanKind`, `activeChannelId`, `customRoleCount`). UI roles panel compositor wrappers, role/overwrite `aria-current=location`, clipboard roles busy flags. Bundle: `npm run test:phase534-roles`. See [ROLES.md](../../docs/ROLES.md).
|
||||
|
||||
**v0.8.496 (Phase 533):** Guild-admin spans extend — `channel.create`/`delete`/`reorder` end metadata (`spanKind`, `activeChannelId`, `createdChannelId`). UI panel compositor wrappers, channel row `aria-current=location`, clipboard guild-admin busy flags. Bundle: `npm run test:phase533-guild-admin`. See [CHANNELS.md](../../docs/CHANNELS.md).
|
||||
|
||||
@@ -8294,7 +8294,9 @@ class PearcordPlatform extends EventEmitter {
|
||||
hasReason: !!reason,
|
||||
reasonLen: String(reason || '').trim().length,
|
||||
until: row?.until || null,
|
||||
durationMs: Number(durationMinutes) > 0 ? Number(durationMinutes) * 60000 : 0
|
||||
durationMs: Number(durationMinutes) > 0 ? Number(durationMinutes) * 60000 : 0,
|
||||
spanKind: 'timeout.member',
|
||||
activeChannelId: this.activeChannelId
|
||||
})
|
||||
return row
|
||||
} catch (err) {
|
||||
@@ -9774,7 +9776,9 @@ class PearcordPlatform extends EventEmitter {
|
||||
guildId,
|
||||
enabled: !!config.enabled,
|
||||
enabledChanged: partial.enabled !== undefined,
|
||||
partialKeys: Object.keys(partial || {}).length
|
||||
partialKeys: Object.keys(partial || {}).length,
|
||||
spanKind: 'automod.setConfig',
|
||||
activeChannelId: this.activeChannelId
|
||||
})
|
||||
return config
|
||||
} catch (err) {
|
||||
@@ -10614,11 +10618,20 @@ class PearcordPlatform extends EventEmitter {
|
||||
blocked: true,
|
||||
reason: result.reason,
|
||||
guildId,
|
||||
channelId
|
||||
channelId,
|
||||
spanKind: 'automod.evaluate',
|
||||
activeChannelId: this.activeChannelId
|
||||
})
|
||||
throw new Error(`automod: ${result.reason}`)
|
||||
}
|
||||
span.end({ ok: true, blocked: false, guildId, channelId })
|
||||
span.end({
|
||||
ok: true,
|
||||
blocked: false,
|
||||
guildId,
|
||||
channelId,
|
||||
spanKind: 'automod.evaluate',
|
||||
activeChannelId: this.activeChannelId
|
||||
})
|
||||
} catch (err) {
|
||||
if (!String(err?.message || '').startsWith('automod:')) {
|
||||
this.log.error('automod.evaluate error', {
|
||||
@@ -12399,7 +12412,9 @@ class PearcordPlatform extends EventEmitter {
|
||||
guildId,
|
||||
hasReason: !!reason,
|
||||
reasonLen: String(reason || '').trim().length,
|
||||
removedMember: true
|
||||
removedMember: true,
|
||||
spanKind: 'kick.member',
|
||||
activeChannelId: this.activeChannelId
|
||||
})
|
||||
return payload
|
||||
} catch (err) {
|
||||
@@ -12448,7 +12463,9 @@ class PearcordPlatform extends EventEmitter {
|
||||
hasReason: !!reason,
|
||||
reasonLen: String(reason || '').trim().length,
|
||||
banCount: banRows.length,
|
||||
removedMember: true
|
||||
removedMember: true,
|
||||
spanKind: 'ban.member',
|
||||
activeChannelId: this.activeChannelId
|
||||
})
|
||||
return ban
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user