ToolJet/server/src/modules/git-sync/controller.ts
Rudhra Deep Biswas b426993253
Moving Git Module to Pre-Release (#12852)
* init

* ee git-sync

* dependancies

* added octokit depedencies to server directory

* module fixes

* fixes

* fixes

* pull app changes fix

* ability factory fixes

* code restructuring changes

* added gitlab backend changes

* app git module fixes

* module file changes

* added logo images

* migration

* migration

* migration changes

* added migration to remove enabledflag from parent table

* provider and migration fixes

* removed comments

* revert appimport export changes

* Revert "revert appimport export changes"

This reverts commit b139db811e.

* fixed version rename api calls

* app/version rename commit fixes

* added builder permissions

* review comment changes

* module file and service fixes

* module fixes

* fixes

* fixed module file changes

* added git-sync repository

* fixed app-git imports

* removed injected ssh,https, gitlab repositories

* added app git sync repository (dev testing pending)

* removed more modules

* removed type orm completley (dev testing pending)

* fixed module file

* removed unused dto's

* working

* fixes

* removed comments

* migration changes

* removed node git package

* changed default branch to main

* ssh

* removed apps ability factory dependencies

* minor changes

* migration fixes

* fixes

* added events for app and version rename

* removed comments

* added license checks

* listener fixes

* removed unused files

* fixed db:reset and server issues

* fixed ce and ee migration

* submoudle commits

* minor changes

* reverts

* reverts

* fixes

* fixed imports

---------

Co-authored-by: rohanlahori <rohanlahori99@gmail.com>
Co-authored-by: Rohan Lahori <64496391+rohanlahori@users.noreply.github.com>
Co-authored-by: rohan <rohan@gmail.com>
2025-06-11 17:03:58 +05:30

77 lines
2.3 KiB
TypeScript

import { Controller, Get, Post, Put, Param, Body, Delete, Query, NotFoundException } from '@nestjs/common';
import { User } from '@modules/app/decorators/user.decorator';
import {
OrganizationGitCreateDto,
OrganizationGitStatusUpdateDto,
OrganizationGitUpdateDto,
} from '@dto/organization_git.dto';
import { User as UserEntity } from 'src/entities/user.entity';
import { IGitSyncController } from './Interfaces/IController';
import { ProviderConfigDTO } from './dto/provider-config.dto';
@Controller('git-sync')
export class GitSyncController implements IGitSyncController {
constructor() {}
@Get(':id/status')
async getOrgGitStatusByOrgId(@User() user: UserEntity, @Param('id') organizationId: string): Promise<any> {
throw new NotFoundException();
}
@Post()
async create(
@User() user: UserEntity,
@Body() orgGitCreateDto: OrganizationGitCreateDto,
@Query('gitType') gitType: string
) {
throw new NotFoundException();
}
@Put(':id')
async update(
@User() user: UserEntity,
@Param('id') organizationGitId: string,
@Body() orgGitUpdateDto: OrganizationGitUpdateDto,
@Query('gitType') gitType: string
) {
throw new NotFoundException();
}
@Put('finalize/:id')
async setFinalizeConfig(
@User() user: UserEntity,
@Param('id') organizationGitId: string,
@Body() configDto: ProviderConfigDTO,
@Query('gitType') gitType: string
) {
throw new NotFoundException();
}
@Put('status/:id')
async changeStatus(
@User() user: UserEntity,
@Param('id') organizationGitId: string,
@Body() organizationGitStatusUpdateDto: OrganizationGitStatusUpdateDto
) {
throw new NotFoundException();
}
@Delete(':id')
async deleteConfig(
@User() user: UserEntity,
@Param('id') organizationGitId: string,
@Query('gitType') gitType: string
) {
throw new NotFoundException();
}
// IMPORTANT : Don't modify this caution : Keep this endpoint last until refactored to avoid conflict with routes using ':id', which may lead to misinterpretation of parameters (e.g., 'gitpull').
@Get(':id')
async getOrgGitByOrgId(
@User() user: UserEntity,
@Param('id') organizationId: string,
@Query('gitType') gitType: string
): Promise<any> {
throw new NotFoundException();
}
}