mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-14 20:40:17 -05:00
Revert "Add an endpoint for rails to record salesforce mappings"
This reverts commit fcca974a69217dc885c458543a82b4dcc338d98b. GitOrigin-RevId: cc7e2561a5f6b4866e5f69f4fb41ffb1bad07bb1
This commit is contained in:
parent
2486f893eb
commit
6f3c371435
3 changed files with 0 additions and 42 deletions
|
@ -28,30 +28,8 @@ export function extractAccountMappingsFromSubscription(
|
||||||
}
|
}
|
||||||
return accountMappings
|
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) {
|
function generateSubscriptionToSalesforceMapping(subscriptionId, salesforceId) {
|
||||||
return {
|
return {
|
||||||
|
@ -67,5 +45,4 @@ function generateSubscriptionToSalesforceMapping(subscriptionId, salesforceId) {
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
extractAccountMappingsFromSubscription,
|
extractAccountMappingsFromSubscription,
|
||||||
generateV1Mapping,
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,18 +4,6 @@ import SessionManager from '../Authentication/SessionManager.js'
|
||||||
import GeoIpLookup from '../../infrastructure/GeoIpLookup.js'
|
import GeoIpLookup from '../../infrastructure/GeoIpLookup.js'
|
||||||
import Features from '../../infrastructure/Features.js'
|
import Features from '../../infrastructure/Features.js'
|
||||||
import { expressify } from '@overleaf/promise-utils'
|
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) {
|
async function updateEditingSession(req, res, next) {
|
||||||
if (!Features.hasFeature('analytics')) {
|
if (!Features.hasFeature('analytics')) {
|
||||||
|
@ -59,7 +47,6 @@ function recordEvent(req, res, next) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
registerSalesforceMapping: expressify(registerSalesforceMapping),
|
|
||||||
updateEditingSession: expressify(updateEditingSession),
|
updateEditingSession: expressify(updateEditingSession),
|
||||||
recordEvent,
|
recordEvent,
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,11 +41,5 @@ export default {
|
||||||
RateLimiterMiddleware.rateLimit(rateLimiters.uniExternalCollabProxy),
|
RateLimiterMiddleware.rateLimit(rateLimiters.uniExternalCollabProxy),
|
||||||
AnalyticsProxy.call('/uniExternalCollaboration')
|
AnalyticsProxy.call('/uniExternalCollaboration')
|
||||||
)
|
)
|
||||||
|
|
||||||
publicApiRouter.post(
|
|
||||||
'/analytics/register-v-1-salesforce-mapping',
|
|
||||||
AuthenticationController.requirePrivateApiAuth(),
|
|
||||||
AnalyticsController.registerSalesforceMapping
|
|
||||||
)
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue