Phase 890: registry split + delivery receipt responder helper (v0.8.857)
Non-breaking refactor — split gossip-rpc-registry into entries/lookup/validate modules; buildGuildRpcTargetedDeliveryReceiptResponse() shared by audit/digest responders; platform-search-rpc-pull-mixin for search mesh config pulls. test:ci-phase890 passes (46/50, cutover deferred).
This commit is contained in:
@@ -1,20 +1,19 @@
|
||||
'use strict'
|
||||
|
||||
const {
|
||||
assertGuildRpcTargetResponder,
|
||||
buildGuildRpcDeliveryResponseEnvelope,
|
||||
buildGuildRpcTargetedDeliveryReceiptResponse,
|
||||
markRpcResponse
|
||||
} = require('../../../gossip-rpc-pull')
|
||||
|
||||
/** Audit export archive protomux-rpc responders (Phase 885 extract). */
|
||||
const platformAuditArchiveRpcRespondersMixin = {
|
||||
async _buildAuditExportArchiveResponsePayload (payload) {
|
||||
if (!payload?.archiveId) return null
|
||||
if (!assertGuildRpcTargetResponder(payload, this)) return null
|
||||
await this._initDeliveryReceipts(payload.guildId)
|
||||
const row = await this.deliveryReceipts.getAuditExportArchive(payload.archiveId)
|
||||
if (!row?.entries?.length) return null
|
||||
return buildGuildRpcDeliveryResponseEnvelope(row, this, payload)
|
||||
return buildGuildRpcTargetedDeliveryReceiptResponse(this, payload, {
|
||||
resourceIdKey: 'archiveId',
|
||||
fetchRow: (platform, p) =>
|
||||
platform.deliveryReceipts.getAuditExportArchive(p.archiveId),
|
||||
validateRow: (row) => Boolean(row?.entries?.length)
|
||||
})
|
||||
},
|
||||
|
||||
async _handleAuditExportArchiveRequestRpc (payload) {
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
'use strict'
|
||||
|
||||
const {
|
||||
assertGuildRpcTargetResponder,
|
||||
buildGuildRpcDeliveryResponseEnvelope,
|
||||
buildGuildRpcTargetedDeliveryReceiptResponse,
|
||||
markRpcResponse
|
||||
} = require('../../../gossip-rpc-pull')
|
||||
|
||||
/** Automation digest snapshot protomux-rpc responders (Phase 885 extract). */
|
||||
const platformAutomationDigestSnapshotRpcRespondersMixin = {
|
||||
async _buildAutomationDigestExportSnapshotResponsePayload (payload) {
|
||||
if (!payload?.snapshotId) return null
|
||||
if (!assertGuildRpcTargetResponder(payload, this)) return null
|
||||
await this._initDeliveryReceipts(payload.guildId)
|
||||
const row = await this.deliveryReceipts.getAutomationDigestExportSnapshot(payload.snapshotId)
|
||||
if (!row?.body?.length) return null
|
||||
return buildGuildRpcDeliveryResponseEnvelope(row, this, payload)
|
||||
return buildGuildRpcTargetedDeliveryReceiptResponse(this, payload, {
|
||||
resourceIdKey: 'snapshotId',
|
||||
fetchRow: (platform, p) =>
|
||||
platform.deliveryReceipts.getAutomationDigestExportSnapshot(p.snapshotId),
|
||||
validateRow: (row) => Boolean(row?.body?.length)
|
||||
})
|
||||
},
|
||||
|
||||
async _handleAutomationDigestExportSnapshotRequestRpc (payload) {
|
||||
|
||||
Reference in New Issue
Block a user