Skip to content

Commit

Permalink
Move environment from header to query
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentaTomas committed Jul 30, 2023
1 parent 6bd6c76 commit 233917a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ paths:
schema:
type: string
- description: Environment to run the command in
in: header
in: query
name: env
required: false
schema:
Expand All @@ -72,7 +72,7 @@ paths:
operationId: ReadFile
parameters:
- description: Environment where to read the file from
in: header
in: query
name: env
required: false
schema:
Expand All @@ -95,7 +95,7 @@ paths:
operationId: WriteFile
parameters:
- description: Environment where to write the file
in: header
in: query
name: env
required: false
schema:
Expand Down
6 changes: 3 additions & 3 deletions src/generated/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function RegisterRoutes(app: Router) {
const args = {
command: {"in":"body","name":"command","required":true,"dataType":"string"},
workDir: {"in":"query","name":"workDir","required":true,"dataType":"string"},
envID: {"default":"Nodejs","in":"header","name":"env","ref":"Environment"},
envID: {"default":"Nodejs","in":"query","name":"env","ref":"Environment"},
conversationID: {"in":"header","name":"openai-conversation-id","dataType":"string"},
};

Expand All @@ -69,7 +69,7 @@ export function RegisterRoutes(app: Router) {

function FilesystemController_readFile(request: any, response: any, next: any) {
const args = {
envID: {"default":"Nodejs","in":"header","name":"env","ref":"Environment"},
envID: {"default":"Nodejs","in":"query","name":"env","ref":"Environment"},
path: {"in":"query","name":"path","required":true,"dataType":"string"},
conversationID: {"in":"header","name":"openai-conversation-id","dataType":"string"},
};
Expand All @@ -96,7 +96,7 @@ export function RegisterRoutes(app: Router) {

function FilesystemController_writeFile(request: any, response: any, next: any) {
const args = {
envID: {"default":"Nodejs","in":"header","name":"env","ref":"Environment"},
envID: {"default":"Nodejs","in":"query","name":"env","ref":"Environment"},
path: {"in":"query","name":"path","required":true,"dataType":"string"},
content: {"in":"body","name":"content","required":true,"dataType":"string"},
conversationID: {"in":"header","name":"openai-conversation-id","dataType":"string"},
Expand Down
2 changes: 1 addition & 1 deletion src/plugin/commandController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class commandController extends Controller {
public async runCommand(
@Body() command: string,
@Query() workDir: string,
@Header('env') envID: Environment = defaultEnvironment,
@Query('env') envID: Environment = defaultEnvironment,
@Header(openAIConversationIDHeader) conversationID?: string,
): Promise<CommandResponse> {
const sessionID = getUserSessionID(conversationID, envID)
Expand Down
4 changes: 2 additions & 2 deletions src/plugin/filesController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class FilesystemController extends Controller {
@Get()
@Produces(textPlainMIME)
public async readFile(
@Header('env') envID: Environment = defaultEnvironment,
@Query('env') envID: Environment = defaultEnvironment,
@Query() path: string,
@Header(openAIConversationIDHeader) conversationID?: string,
): Promise<string> {
Expand All @@ -52,7 +52,7 @@ export class FilesystemController extends Controller {
@Put()
@Consumes(textPlainMIME)
public async writeFile(
@Header('env') envID: Environment = defaultEnvironment,
@Query('env') envID: Environment = defaultEnvironment,
@Query() path: string,
@Body() content: string,
@Header(openAIConversationIDHeader) conversationID?: string,
Expand Down

0 comments on commit 233917a

Please sign in to comment.