import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { methodDeprecationLogger } from '../../../lib/deprecationWarningLogger'; import { replayOutgoingIntegrationMethod } from '../../../lib/integrations/functions/clearIntegrationHistory'; declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { replayOutgoingIntegration(params: { integrationId: string; historyId: string }): Promise; } } Meteor.methods({ async replayOutgoingIntegration({ integrationId, historyId }) { methodDeprecationLogger.method('replayOutgoingIntegration', '9.0.0', '/v1/integrations.replayOutgoing'); if (!this.userId) { throw new Meteor.Error('not_authorized', 'Unauthorized', { method: 'replayOutgoingIntegration' }); } await replayOutgoingIntegrationMethod(this.userId, { integrationId, historyId }); return true; }, });