hunk.code_window:       const datasourceResponse: GenericApiResponse<Datasource> = yield DatasourcesApi.createDatasource(
           datasourceConfig,
         );
         yield validateResponse(datasourceResponse);
         yield put({
           type: ReduxActionTypes.CREATE_DATASOURCE_SUCCESS,
           payload: datasourceResponse.data,
  
hunk.labels: keep keep keep add keep keep keep
hunk.after_edit:       yield checkAndGetPluginFormConfigsSaga(postgresPlugin.id);
  
hunk.file_path: app/client/src/sagas/OnboardingSagas.ts
hunk.type: add
file: type Tree = {
    children?: Tree[];
    [key: string]: any;
  };
  
  export const traverseTree = (tree: Tree, callback: (tree: Tree) => void) => {
    callback(tree);
    if (tree.children) {
      tree.children.forEach((b) => traverseTree(b, callback));
    }
  };
  
  export const mapTree = (tree: Tree, callback: (tree: Tree) => Tree) => {
    const mapped = callback(tree);
    if (tree.children && tree.children.length) {
      const children: Tree[] = tree.children.map((branch) =>
        mapTree(branch, callback),
      );
      return { ...mapped, children };
    }
    return { ...mapped };
  };
  