1
0
mirror of https://github.com/sasjs/server.git synced 2026-01-06 22:20:06 +00:00

feat(deploy): new route added for deploy with build.json

This commit is contained in:
Saad Jutt
2022-04-02 05:23:25 +05:00
parent 7b7bc6b778
commit 18d0604bdd
10 changed files with 138 additions and 85 deletions

View File

@@ -14,7 +14,8 @@ import {
Patch,
UploadedFile,
FormField,
Delete
Delete,
Hidden
} from 'tsoa'
import {
fileExists,
@@ -22,14 +23,15 @@ import {
createFolder,
deleteFile as deleteFileOnSystem,
folderExists,
listFilesAndSubFoldersInFolder,
listFilesInFolder,
listSubFoldersInFolder,
isFolder
isFolder,
FileTree,
isFileTree
} from '@sasjs/utils'
import { createFileTree, ExecutionController, getTreeExample } from './internal'
import { FileTree, isFileTree, TreeNode } from '../types'
import { TreeNode } from '../types'
import { getTmpFilesFolderPath } from '../utils'
interface DeployPayload {
@@ -93,6 +95,21 @@ export class DriveController {
return deploy(body)
}
/**
* @summary Creates/updates files within SASjs Drive using uploaded JSON file.
*
*/
@Example<DeployResponse>(successDeployResponse)
@Response<DeployResponse>(400, 'Invalid Format', invalidDeployFormatResponse)
@Response<DeployResponse>(500, 'Execution Error', execDeployErrorResponse)
@Post('/deploy/upload')
public async deployUpload(
@UploadedFile() file: Express.Multer.File, // passing here for API docs
@Query() @Hidden() body?: DeployPayload // Hidden decorator has be optional
): Promise<DeployResponse> {
return deploy(body!)
}
/**
*
* @summary Get file from SASjs Drive