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.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.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).
|
**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,
|
hasReason: !!reason,
|
||||||
reasonLen: String(reason || '').trim().length,
|
reasonLen: String(reason || '').trim().length,
|
||||||
until: row?.until || null,
|
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
|
return row
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@@ -9774,7 +9776,9 @@ class PearcordPlatform extends EventEmitter {
|
|||||||
guildId,
|
guildId,
|
||||||
enabled: !!config.enabled,
|
enabled: !!config.enabled,
|
||||||
enabledChanged: partial.enabled !== undefined,
|
enabledChanged: partial.enabled !== undefined,
|
||||||
partialKeys: Object.keys(partial || {}).length
|
partialKeys: Object.keys(partial || {}).length,
|
||||||
|
spanKind: 'automod.setConfig',
|
||||||
|
activeChannelId: this.activeChannelId
|
||||||
})
|
})
|
||||||
return config
|
return config
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@@ -10614,11 +10618,20 @@ class PearcordPlatform extends EventEmitter {
|
|||||||
blocked: true,
|
blocked: true,
|
||||||
reason: result.reason,
|
reason: result.reason,
|
||||||
guildId,
|
guildId,
|
||||||
channelId
|
channelId,
|
||||||
|
spanKind: 'automod.evaluate',
|
||||||
|
activeChannelId: this.activeChannelId
|
||||||
})
|
})
|
||||||
throw new Error(`automod: ${result.reason}`)
|
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) {
|
} catch (err) {
|
||||||
if (!String(err?.message || '').startsWith('automod:')) {
|
if (!String(err?.message || '').startsWith('automod:')) {
|
||||||
this.log.error('automod.evaluate error', {
|
this.log.error('automod.evaluate error', {
|
||||||
@@ -12399,7 +12412,9 @@ class PearcordPlatform extends EventEmitter {
|
|||||||
guildId,
|
guildId,
|
||||||
hasReason: !!reason,
|
hasReason: !!reason,
|
||||||
reasonLen: String(reason || '').trim().length,
|
reasonLen: String(reason || '').trim().length,
|
||||||
removedMember: true
|
removedMember: true,
|
||||||
|
spanKind: 'kick.member',
|
||||||
|
activeChannelId: this.activeChannelId
|
||||||
})
|
})
|
||||||
return payload
|
return payload
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@@ -12448,7 +12463,9 @@ class PearcordPlatform extends EventEmitter {
|
|||||||
hasReason: !!reason,
|
hasReason: !!reason,
|
||||||
reasonLen: String(reason || '').trim().length,
|
reasonLen: String(reason || '').trim().length,
|
||||||
banCount: banRows.length,
|
banCount: banRows.length,
|
||||||
removedMember: true
|
removedMember: true,
|
||||||
|
spanKind: 'ban.member',
|
||||||
|
activeChannelId: this.activeChannelId
|
||||||
})
|
})
|
||||||
return ban
|
return ban
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
Reference in New Issue
Block a user