Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: revisiting CRUD APIs for beta release #25

Merged
merged 1 commit into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions src/configs/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ export const config = {
"table_names": { // Names of all tables available for CRUD operations
"datasets": "datasets",
"datasources": "datasources",
"datasetSourceConfig": "dataset_source_config",
"datasetTransformations": "dataset_transformations"
"datasetSourceConfig": "dataset_source_config"
},
"table_config": { // This object defines the configuration for each table.
"datasets": {
Expand All @@ -76,10 +75,6 @@ export const config = {
"dataset_source_config": {
"primary_key": "id",
"references": []
},
"dataset_transformations": {
"primary_key": "id",
"references": []
}
}
}
22 changes: 0 additions & 22 deletions src/configs/RoutesConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,28 +90,6 @@ export const routesConfig = {
method: "post",
path: "/obsrv/v1/datasets/source/config/list"
}
},
dataset_transformation: {
save: {
api_id: "obsrv.config.dataset.transformation.create",
method: "post",
path: "/obsrv/v1/datasets/transformation"
},
read: {
api_id: "obsrv.config.dataset.transformation.read",
method: "get",
path: "/obsrv/v1/datasets/transformation/:datasetId"
},
update: {
api_id: "obsrv.config.dataset.transformation.update",
method: "patch",
path: "/obsrv/v1/datasets/transformation"
},
list: {
api_id: "obsrv.config.dataset.transformation.list",
method: "post",
path: "/obsrv/v1/datasets/transformation/list"
}
}

},
Expand Down
48 changes: 0 additions & 48 deletions src/helpers/DatasetTransformations.ts

This file was deleted.

7 changes: 0 additions & 7 deletions src/resources/schemas/DatasetConfigDefault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,5 @@ export const defaultConfig = {
"connector_stats": {},
"created_by": 'SYSTEM',
"updated_by": 'SYSTEM'
},
"transformations": {
"field_key": "",
"transformation_function": { "type": "", "condition": { "type": "", "expr": "" }, "expr": "" },
"status": 'ACTIVE',
"created_by": 'SYSTEM',
"updated_by": 'SYSTEM'
}
}
30 changes: 0 additions & 30 deletions src/resources/schemas/DatasetTransformationSaveReq.json

This file was deleted.

30 changes: 0 additions & 30 deletions src/resources/schemas/DatasetTransformationUpdateReq.json

This file was deleted.

8 changes: 0 additions & 8 deletions src/routes/Router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { DatasetService } from "../services/DatasetService";
import { KafkaConnector } from "../connectors/KafkaConnector";
import { DataSourceService } from "../services/DataSourceService";
import { DatasetSourceConfigService } from "../services/DatasetSourceConfigService";
import { DatasetTransformationService } from "../services/DatasetTransformationService";
import { DbConnector } from "../connectors/DbConnector";
import { routesConfig } from "../configs/RoutesConfig";
import { IngestorService } from "../services/IngestorService";
Expand All @@ -26,7 +25,6 @@ export const dbConnector = new DbConnector(config.db_connector_config);
export const datasourceService = new DataSourceService(dbConnector, config.table_names.datasources);
export const datasetService = new DatasetService(dbConnector, config.table_names.datasets);
export const datasetSourceConfigService = new DatasetSourceConfigService(dbConnector, config.table_names.datasetSourceConfig);
export const datasetTransformationService = new DatasetTransformationService(dbConnector, config.table_names.datasetTransformations);
export const ingestorService = new IngestorService(kafkaConnector);
export const globalCache: any = new Map()
const router = express.Router()
Expand All @@ -50,12 +48,6 @@ router.patch(`${routesConfig.config.dataset_source_config.update.path}`, Respons
router.get(`${routesConfig.config.dataset_source_config.read.path}`, ResponseHandler.setApiId(routesConfig.config.dataset_source_config.read.api_id), datasetSourceConfigService.read);
router.post(`${routesConfig.config.dataset_source_config.list.path}`, ResponseHandler.setApiId(routesConfig.config.dataset_source_config.list.api_id), validationService.validateRequestBody, datasetSourceConfigService.list);

/**Dataset Transformation APIs*/
router.post(`${routesConfig.config.dataset_transformation.save.path}`, ResponseHandler.setApiId(routesConfig.config.dataset_transformation.save.api_id), validationService.validateRequestBody, telemetryAuditStart({ action: telemetryActions.createTransformation, operationType: OperationType.CREATE }), datasetTransformationService.save);
router.patch(`${routesConfig.config.dataset_transformation.update.path}`, ResponseHandler.setApiId(routesConfig.config.dataset_transformation.update.api_id), validationService.validateRequestBody, telemetryAuditStart({ action: telemetryActions.updateTransformation, operationType: OperationType.UPDATE }), datasetTransformationService.update);
router.get(`${routesConfig.config.dataset_transformation.read.path}`, ResponseHandler.setApiId(routesConfig.config.dataset_transformation.read.api_id), datasetTransformationService.read);
router.post(`${routesConfig.config.dataset_transformation.list.path}`, ResponseHandler.setApiId(routesConfig.config.dataset_transformation.list.api_id), validationService.validateRequestBody, datasetTransformationService.list);

/** DataSource API(s) */
router.post(`${routesConfig.config.datasource.save.path}`, ResponseHandler.setApiId(routesConfig.config.datasource.save.api_id), validationService.validateRequestBody, telemetryAuditStart({ action: telemetryActions.createDatasource, operationType: OperationType.CREATE }), datasourceService.save);
router.patch(`${routesConfig.config.datasource.update.path}`, ResponseHandler.setApiId(routesConfig.config.datasource.update.api_id), validationService.validateRequestBody, telemetryAuditStart({ action: telemetryActions.updateDatasource, operationType: OperationType.UPDATE }), datasourceService.update);
Expand Down
64 changes: 0 additions & 64 deletions src/services/DatasetTransformationService.ts

This file was deleted.

5 changes: 0 additions & 5 deletions src/test/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ const config = {
apiDatasetSourceConfigUpdateEndPoint: `${routesConfig.config.dataset_source_config.update.path}`,
apiDatasetSourceConfigReadEndPoint: `${routesConfig.config.dataset_source_config.read.path}`,
apiDatasetSourceConfigListEndPoint: `${routesConfig.config.dataset_source_config.list.path}`,
apiDatasetTransformationSaveEndPoint: `${routesConfig.config.dataset_transformation.save.path}`,
apiDatasetTransformationUpdateEndPoint: `${routesConfig.config.dataset_transformation.update.path}`,
apiDatasetTransformationReadEndPoint: `${routesConfig.config.dataset_transformation.read.path}`,
apiDatasetTransformationListEndPoint: `${routesConfig.config.dataset_transformation.list.path}`,

druidHost: "http://localhost",
druidPort: 8888,
druidEndPoint: "/druid/v2",
Expand Down
Loading