Skip to content

Commit

Permalink
chore: removed code injections in legacy folder
Browse files Browse the repository at this point in the history
  • Loading branch information
sandeepdsvs committed Apr 1, 2024
1 parent 1e34e08 commit 2225fad
Show file tree
Hide file tree
Showing 2 changed files with 345 additions and 19 deletions.
22 changes: 9 additions & 13 deletions src/legacy/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ const lodash = require('lodash');
const fs = require('fs');
const path = require('path');
const { PlatformError, getErrorRespEvents } = require('@rudderstack/integrations-lib');
const {
getDestTransformHandler,
getDestFileUploadHandler,
getJobStatusHandler,
getPollStatusHandler,
getDeletionUserHandler,
} = require('../util/fetchDestinationHandlers');
const logger = require('../logger');
const stats = require('../util/stats');
const { SUPPORTED_VERSIONS, API_VERSION } = require('../routes/utils/constants');
Expand Down Expand Up @@ -61,22 +68,11 @@ const PAYLOAD_PROC_ERR_MSG = 'Error occurred while processing payload';
*/
const getDestHandler = (version, dest) => {
if (Object.prototype.hasOwnProperty.call(DestHandlerMap, dest)) {
return require(`../${version}/destinations/${DestHandlerMap[dest]}/transform`);
return getDestTransformHandler(version, DestHandlerMap[dest]);
}
return require(`../${version}/destinations/${dest}/transform`);
return getDestTransformHandler(version, dest);
};

const getDestFileUploadHandler = (version, dest) =>
require(`../${version}/destinations/${dest}/fileUpload`);

const getPollStatusHandler = (version, dest) => require(`../${version}/destinations/${dest}/poll`);

const getJobStatusHandler = (version, dest) =>
require(`../${version}/destinations/${dest}/fetchJobStatus`);

const getDeletionUserHandler = (version, dest) =>
require(`../${version}/destinations/${dest}/deleteUsers`);

const getSourceHandler = (version, source) => require(`../${version}/sources/${source}/transform`);

let areFunctionsEnabled = -1;
Expand Down
Loading

0 comments on commit 2225fad

Please sign in to comment.