Skip to content

Commit

Permalink
style: Fixed sessions docker
Browse files Browse the repository at this point in the history
  • Loading branch information
icleitoncosta committed Jun 1, 2023
1 parent cc9d912 commit 22013f6
Showing 1 changed file with 106 additions and 22 deletions.
128 changes: 106 additions & 22 deletions src/controller/sessionController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,22 @@ export async function startSession(req: Request, res: Response) {
#swagger.parameters["session"] = {
schema: 'NERDWHATS_AMERICA'
}
#swagger.parameters["obj"] = {
in: 'body',
schema: {
$waitQrCode: false,
#swagger.requestBody = {
required: true,
"@content": {
"application/json": {
schema: {
type: "object",
properties: {
webhook: { type: "string" },
waitQrCode: { type: "boolean" },
}
},
example: {
webhook: "https://webhook.site/7cc2944d-3967-4cea-988c-d57ea80bce5f",
waitQrCode: false,
}
}
}
}
*/
Expand All @@ -217,10 +229,20 @@ export async function closeSession(req: Request, res: Response) {
#swagger.parameters["session"] = {
schema: 'NERDWHATS_AMERICA'
}
#swagger.parameters["obj"] = {
in: 'body',
schema: {
$clearSession: false,
#swagger.requestBody = {
required: true,
"@content": {
"application/json": {
schema: {
type: "object",
properties: {
clearSession: { type: "boolean" },
}
},
example: {
clearSession: false,
}
}
}
}
*/
Expand Down Expand Up @@ -331,10 +353,20 @@ export async function downloadMediaByMessage(req: Request, res: Response) {
#swagger.parameters["session"] = {
schema: 'NERDWHATS_AMERICA'
}
#swagger.parameters["obj"] = {
in: 'body',
schema: {
$messageId: '<messageId>',
#swagger.requestBody = {
required: true,
"@content": {
"application/json": {
schema: {
type: "object",
properties: {
messageId: { type: "string" },
}
},
example: {
messageId: '<messageId>'
}
}
}
}
*/
Expand Down Expand Up @@ -434,10 +466,20 @@ export async function getSessionState(req: Request, res: Response) {
#swagger.parameters["session"] = {
schema: 'NERDWHATS_AMERICA'
}
#swagger.parameters["obj"] = {
in: 'body',
schema: {
$waitQrCode: false,
#swagger.requestBody = {
required: true,
"@content": {
"application/json": {
schema: {
type: "object",
properties: {
waitQrCode: { type: "boolean" },
}
},
example: {
waitQrCode: false
}
}
}
}
*/
Expand Down Expand Up @@ -575,12 +617,24 @@ export async function subscribePresence(req: Request, res: Response) {
#swagger.parameters["session"] = {
schema: 'NERDWHATS_AMERICA'
}
#swagger.parameters["obj"] = {
in: 'body',
schema: {
$phone: '5521999999999',
$isGroup: false,
$all: 'false',
#swagger.requestBody = {
required: true,
"@content": {
"application/json": {
schema: {
type: "object",
properties: {
phone: { type: "string" },
isGroup: { type: "boolean" },
all: { type: "boolean" },
}
},
example: {
phone: '5521999999999',
isGroup: false,
all: false,
}
}
}
}
*/
Expand Down Expand Up @@ -642,6 +696,36 @@ export async function editBusinessProfile(req: Request, res: Response) {
],
}
}
#swagger.requestBody = {
required: true,
"@content": {
"application/json": {
schema: {
type: "object",
properties: {
adress: { type: "string" },
email: { type: "string" },
categories: { type: "object" },
websites: { type: "array" },
}
},
example: {
adress: 'Av. Nossa Senhora de Copacabana, 315',
email: 'test@test.com.br',
categories: {
$id: "133436743388217",
$localized_display_name: "Artes e entretenimento",
$not_a_biz: false,
},
website: [
"https://www.wppconnect.io",
"https://www.teste2.com.br",
],
}
}
}
}
*/
try {
return res.status(200).json(await req.client.editBusinessProfile(req.body));
Expand Down

0 comments on commit 22013f6

Please sign in to comment.