Skip to content

Commit

Permalink
feat: REST Compliances
Browse files Browse the repository at this point in the history
  • Loading branch information
Rachid Flih authored and Rachid Flih committed Aug 1, 2024
1 parent f4fcb5d commit 2202f74
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import {
WebhookResponse,
} from './dto/webhook.dto';
import { WebhookService } from './webhook.service';
@ApiTags('webhook')
@Controller('webhook')
@ApiTags('webhooks')
@Controller('webhooks')
export class WebhookController {
constructor(
private webhookService: WebhookService,
Expand All @@ -41,7 +41,7 @@ export class WebhookController {

@ApiOperation({
operationId: 'listWebhooks',
summary: 'List webhooks ',
summary: 'List webhooks',
})
@ApiGetArrayCustomResponse(WebhookResponse)
@UseGuards(ApiKeyAuthGuard)
Expand Down
10 changes: 5 additions & 5 deletions packages/api/src/@core/field-mapping/field-mapping.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
import { JwtAuthGuard } from '@@core/auth/guards/jwt-auth.guard';

@ApiTags('fieldMappings')
@Controller('field-mappings')
@Controller('field_mappings')
export class FieldMappingController {
constructor(
private readonly fieldMappingService: FieldMappingService,
Expand All @@ -51,7 +51,7 @@ export class FieldMappingController {
})
@ApiResponse({ status: 200 })
@ApiExcludeEndpoint()
@Get('attribute')
@Get('attributes')
@UseGuards(JwtAuthGuard)
getAttributes(@Request() req: any) {
const { id_project } = req.user;
Expand All @@ -64,14 +64,14 @@ export class FieldMappingController {
})
@ApiResponse({ status: 200 })
@ApiExcludeEndpoint()
@Get('value')
@Get('values')
@UseGuards(JwtAuthGuard)
getValues() {
return this.fieldMappingService.getValues();
}

@ApiOperation({
operationId: 'define',
operationId: 'definitions',
summary: 'Define target Field',
})
@ApiBody({ type: DefineTargetFieldDto })
Expand All @@ -91,7 +91,7 @@ export class FieldMappingController {
}

@ApiOperation({
operationId: 'create',
operationId: 'createCustomField',
summary: 'Create Custom Field',
})
@ApiBody({ type: CustomFieldCreateDto })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { JwtAuthGuard } from '@@core/auth/guards/jwt-auth.guard';
import { ApiKeyAuthGuard } from '@@core/auth/guards/api-key.guard';

@ApiTags('linkedUsers')
@Controller('linked-users')
@Controller('linked_users')
export class LinkedUsersController {
constructor(
private readonly linkedUsersService: LinkedUsersService,
Expand All @@ -34,7 +34,7 @@ export class LinkedUsersController {
this.logger.setContext(LinkedUsersController.name);
}

@ApiOperation({ operationId: 'createLinkedUser', summary: 'Add Linked User' })
@ApiOperation({ operationId: 'createLinkedUser', summary: 'Create Linked Users' })
@ApiBody({ type: CreateLinkedUserDto })
@ApiResponse({ status: 201 })
@UseGuards(ApiKeyAuthGuard)
Expand Down Expand Up @@ -68,7 +68,7 @@ export class LinkedUsersController {

@ApiOperation({
operationId: 'listLinkedUsers',
summary: 'Retrieve Linked Users',
summary: 'List Linked Users',
})
@ApiResponse({ status: 200 })
@UseGuards(ApiKeyAuthGuard)
Expand All @@ -80,7 +80,7 @@ export class LinkedUsersController {

@ApiOperation({
operationId: 'retrieveLinkedUser',
summary: 'Retrieve a Linked User',
summary: 'Retrieve Linked Users',
})
@ApiQuery({ name: 'id', required: true, type: String })
@ApiResponse({ status: 200 })
Expand Down
10 changes: 5 additions & 5 deletions packages/api/src/@core/magic-link/magic-link.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import {
ApiTags,
} from '@nestjs/swagger';
import { JwtAuthGuard } from '@@core/auth/guards/jwt-auth.guard';
@ApiTags('magic-links')
@ApiTags('magic_links')
@ApiExcludeController()
@Controller('magic-links')
@Controller('magic_links')
export class MagicLinkController {
constructor(
private readonly magicLinkService: MagicLinkService,
Expand All @@ -24,7 +24,7 @@ export class MagicLinkController {

@ApiOperation({
operationId: 'createMagicLink',
summary: 'Create a Magic Link',
summary: 'Create Magic Links',
})
@ApiBody({ type: CreateMagicLinkDto })
@ApiResponse({ status: 201 })
Expand All @@ -36,7 +36,7 @@ export class MagicLinkController {

@ApiOperation({
operationId: 'getMagicLinks',
summary: 'Retrieve Magic Links',
summary: 'List Magic Links',
})
@ApiResponse({ status: 200 })
@Get()
Expand All @@ -46,7 +46,7 @@ export class MagicLinkController {

@ApiOperation({
operationId: 'getMagicLink',
summary: 'Retrieve a Magic Link',
summary: 'Retrieve Magic Links',
})
@ApiQuery({ name: 'id', required: true, type: String })
@ApiResponse({ status: 200 })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class OrganisationsController {
})
@Get()
getOragnisations() {
return; //this.organizationsService.getOrganisations();
return;
}

@ApiOperation({
Expand All @@ -36,8 +36,8 @@ export class OrganisationsController {
})
@ApiBody({ type: CreateOrganizationDto })
@ApiResponse({ status: 201 })
@Post('create')
@Post()
createOrg(@Body() orgCreateDto: CreateOrganizationDto) {
return; //this.organizationsService.createOrganization(orgCreateDto);
return;
}
}
31 changes: 14 additions & 17 deletions packages/api/swagger/swagger-spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ paths:
responses:
'200':
description: ''
/webhook:
/webhooks:
get:
operationId: listWebhooks
summary: 'List webhooks '
summary: List webhooks
parameters: []
responses:
'200':
Expand All @@ -31,8 +31,7 @@ paths:
items:
$ref: '#/components/schemas/WebhookResponse'
tags: &ref_0
- webhook
x-speakeasy-group: webhook
- webhooks
post:
operationId: createWebhook
summary: Add webhook metadata
Expand All @@ -51,8 +50,7 @@ paths:
schema:
$ref: '#/components/schemas/WebhookResponse'
tags: *ref_0
x-speakeasy-group: webhook
/webhook/{id}:
/webhooks/{id}:
delete:
operationId: delete
summary: Delete Webhook
Expand All @@ -70,7 +68,7 @@ paths:
schema:
$ref: '#/components/schemas/WebhookResponse'
tags: *ref_0
x-speakeasy-group: webhook
x-speakeasy-group: webhooks.{id}
put:
operationId: updateStatus
summary: Update webhook status
Expand All @@ -88,8 +86,8 @@ paths:
schema:
$ref: '#/components/schemas/WebhookResponse'
tags: *ref_0
x-speakeasy-group: webhook
/webhook/verifyEvent:
x-speakeasy-group: webhooks.{id}
/webhooks/verifyEvent:
post:
operationId: verifyEvent
summary: Verify payload signature of the webhook
Expand All @@ -108,7 +106,7 @@ paths:
schema:
$ref: '#/components/schemas/EventPayload'
tags: *ref_0
x-speakeasy-group: webhook
x-speakeasy-group: webhooks.verifyevent
/ticketing/tickets:
get:
operationId: listTicketingTicket
Expand Down Expand Up @@ -1796,7 +1794,7 @@ paths:
description: ''
tags: *ref_34
x-speakeasy-group: linkedUsers
/field-mappings/define:
/field_mappings/define:
post:
operationId: define
summary: Define target Field
Expand All @@ -1812,10 +1810,10 @@ paths:
description: ''
tags: &ref_35
- fieldMappings
x-speakeasy-group: fieldMappings
/field-mappings:
x-speakeasy-group: field_mappings.define
/field_mappings:
post:
operationId: create
operationId: createCustomField
summary: Create Custom Field
parameters: []
requestBody:
Expand All @@ -1828,8 +1826,7 @@ paths:
'201':
description: ''
tags: *ref_35
x-speakeasy-group: fieldMappings
/field-mappings/map:
/field_mappings/map:
post:
operationId: map
summary: Map Custom Field
Expand All @@ -1844,7 +1841,7 @@ paths:
'201':
description: ''
tags: *ref_35
x-speakeasy-group: fieldMappings
x-speakeasy-group: field_mappings.map
/passthrough:
post:
operationId: request
Expand Down

0 comments on commit 2202f74

Please sign in to comment.