From 6f3c3714357e1bfd53984855a545d0ec078478db Mon Sep 17 00:00:00 2001 From: Andrew Rumble Date: Tue, 22 Oct 2024 17:14:51 +0100 Subject: [PATCH] Revert "Add an endpoint for rails to record salesforce mappings" This reverts commit fcca974a69217dc885c458543a82b4dcc338d98b. GitOrigin-RevId: cc7e2561a5f6b4866e5f69f4fb41ffb1bad07bb1 --- .../Analytics/AccountMappingHelper.mjs | 23 ------------------- .../Analytics/AnalyticsController.mjs | 13 ----------- .../Features/Analytics/AnalyticsRouter.mjs | 6 ----- 3 files changed, 42 deletions(-) diff --git a/services/web/app/src/Features/Analytics/AccountMappingHelper.mjs b/services/web/app/src/Features/Analytics/AccountMappingHelper.mjs index 76e4bc51bc..c5525d3053 100644 --- a/services/web/app/src/Features/Analytics/AccountMappingHelper.mjs +++ b/services/web/app/src/Features/Analytics/AccountMappingHelper.mjs @@ -28,30 +28,8 @@ export function extractAccountMappingsFromSubscription( } return accountMappings } - -export function generateV1Mapping(v1Id, salesforceId, createdAt) { - return { - source: 'salesforce', - sourceEntity: 'account', - sourceEntityId: salesforceId, - target: 'v1', - targetEntity: 'university', - targetEntityId: v1Id, - createdAt, - } } -function generateSubscriptionToV1Mapping(subscriptionId, v1Id) { - return { - source: 'v1', - sourceEntity: 'university', - sourceEntityId: v1Id, - target: 'v2', - targetEntity: 'subscription', - targetEntityId: subscriptionId, - createdAt: new Date().toISOString(), - } -} function generateSubscriptionToSalesforceMapping(subscriptionId, salesforceId) { return { @@ -67,5 +45,4 @@ function generateSubscriptionToSalesforceMapping(subscriptionId, salesforceId) { export default { extractAccountMappingsFromSubscription, - generateV1Mapping, } diff --git a/services/web/app/src/Features/Analytics/AnalyticsController.mjs b/services/web/app/src/Features/Analytics/AnalyticsController.mjs index 8ae54518b9..7665e7ecd9 100644 --- a/services/web/app/src/Features/Analytics/AnalyticsController.mjs +++ b/services/web/app/src/Features/Analytics/AnalyticsController.mjs @@ -4,18 +4,6 @@ import SessionManager from '../Authentication/SessionManager.js' import GeoIpLookup from '../../infrastructure/GeoIpLookup.js' import Features from '../../infrastructure/Features.js' import { expressify } from '@overleaf/promise-utils' -import { generateV1Mapping } from './AccountMappingHelper.mjs' - -async function registerSalesforceMapping(req, res, next) { - if (!Features.hasFeature('analytics')) { - return res.sendStatus(202) - } - const { createdAt, salesforceId, v1Id } = req.body - AnalyticsManager.registerAccountMapping( - generateV1Mapping(v1Id, salesforceId, createdAt) - ) - res.sendStatus(202) -} async function updateEditingSession(req, res, next) { if (!Features.hasFeature('analytics')) { @@ -59,7 +47,6 @@ function recordEvent(req, res, next) { } export default { - registerSalesforceMapping: expressify(registerSalesforceMapping), updateEditingSession: expressify(updateEditingSession), recordEvent, } diff --git a/services/web/app/src/Features/Analytics/AnalyticsRouter.mjs b/services/web/app/src/Features/Analytics/AnalyticsRouter.mjs index 933d4b0c13..523bbcf146 100644 --- a/services/web/app/src/Features/Analytics/AnalyticsRouter.mjs +++ b/services/web/app/src/Features/Analytics/AnalyticsRouter.mjs @@ -41,11 +41,5 @@ export default { RateLimiterMiddleware.rateLimit(rateLimiters.uniExternalCollabProxy), AnalyticsProxy.call('/uniExternalCollaboration') ) - - publicApiRouter.post( - '/analytics/register-v-1-salesforce-mapping', - AuthenticationController.requirePrivateApiAuth(), - AnalyticsController.registerSalesforceMapping - ) }, }