From a0bb0a08537a9da029416399bb8464c658dc6849 Mon Sep 17 00:00:00 2001 From: nael Date: Tue, 6 Aug 2024 05:49:06 +0200 Subject: [PATCH] :ambulance: Added openapi spec updates --- .../ticketing/services/jira/jira.service.ts | 6 +- .../ats/activity/services/activity.service.ts | 6 +- .../candidate/services/candidate.service.ts | 6 +- .../src/ats/candidate/types/model.unified.ts | 27 +- .../interview/services/interview.service.ts | 6 +- .../crm/company/services/company.service.ts | 6 +- .../api/src/crm/contact/contact.controller.ts | 1 - .../crm/contact/services/contact.service.ts | 6 +- .../api/src/crm/deal/services/deal.service.ts | 6 +- .../api/src/crm/note/services/note.service.ts | 6 +- .../src/crm/stage/services/stage.service.ts | 6 +- .../api/src/crm/task/services/task.service.ts | 6 +- .../api/src/crm/user/services/user.service.ts | 6 +- .../filestorage/file/services/file.service.ts | 6 +- .../filestorage/group/types/model.unified.ts | 14 +- .../permission/types/model.unified.ts | 3 +- .../comment/services/comment.service.ts | 6 +- .../ticketing/comment/types/model.unified.ts | 14 +- .../contact/services/contact.service.ts | 6 +- .../src/ticketing/tag/services/tag.service.ts | 35 ++- .../api/src/ticketing/tag/tag.controller.ts | 1 - .../ticketing/team/services/team.service.ts | 6 +- .../ticket/services/ticket.service.ts | 6 +- .../ticketing/ticket/types/model.unified.ts | 30 +- .../ticketing/user/services/user.service.ts | 6 +- packages/api/swagger/swagger-spec.yaml | 287 +++++++++--------- packages/shared/src/authUrl.ts | 2 +- 27 files changed, 276 insertions(+), 240 deletions(-) diff --git a/packages/api/src/@core/connections/ticketing/services/jira/jira.service.ts b/packages/api/src/@core/connections/ticketing/services/jira/jira.service.ts index e248439a9..4000b0ddf 100644 --- a/packages/api/src/@core/connections/ticketing/services/jira/jira.service.ts +++ b/packages/api/src/@core/connections/ticketing/services/jira/jira.service.ts @@ -66,7 +66,11 @@ export class JiraConnectionService implements ITicketingConnectionService { }); //reconstruct the redirect URI that was passed in the githubend it must be the same - const REDIRECT_URI = `${this.env.getPanoraBaseUrl()}/connections/oauth/callback`; + const REDIRECT_URI = `${ + this.env.getDistributionMode() == 'selfhost' + ? this.env.getTunnelIngress() + : this.env.getPanoraBaseUrl() + }/connections/oauth/callback`; const CREDENTIALS = (await this.cService.getCredentials( projectId, this.type, diff --git a/packages/api/src/ats/activity/services/activity.service.ts b/packages/api/src/ats/activity/services/activity.service.ts index 92ce74809..cf2dae6fe 100644 --- a/packages/api/src/ats/activity/services/activity.service.ts +++ b/packages/api/src/ats/activity/services/activity.service.ts @@ -314,10 +314,8 @@ export class ActivityService { fieldMappingsMap.set(value.attribute.slug, value.data); }); - const field_mappings = Array.from( - fieldMappingsMap, - ([key, value]) => ({ [key]: value }), - ); + // Convert the map to an object +const field_mappings = Object.fromEntries(fieldMappingsMap); return { id: activity.id_ats_activity, diff --git a/packages/api/src/ats/candidate/services/candidate.service.ts b/packages/api/src/ats/candidate/services/candidate.service.ts index 0a7aead42..f9f265e47 100644 --- a/packages/api/src/ats/candidate/services/candidate.service.ts +++ b/packages/api/src/ats/candidate/services/candidate.service.ts @@ -670,10 +670,8 @@ export class CandidateService { fieldMappingsMap.set(value.attribute.slug, value.data); }); - const field_mappings = Array.from( - fieldMappingsMap, - ([key, value]) => ({ [key]: value }), - ); + // Convert the map to an object +const field_mappings = Object.fromEntries(fieldMappingsMap); return { id: candidate.id_ats_candidate, diff --git a/packages/api/src/ats/candidate/types/model.unified.ts b/packages/api/src/ats/candidate/types/model.unified.ts index 4790169f5..528c3a60b 100644 --- a/packages/api/src/ats/candidate/types/model.unified.ts +++ b/packages/api/src/ats/candidate/types/model.unified.ts @@ -2,7 +2,11 @@ import { Email, Phone, Url } from '@ats/@lib/@types'; import { UnifiedAtsApplicationOutput } from '@ats/application/types/model.unified'; import { UnifiedAtsAttachmentOutput } from '@ats/attachment/types/model.unified'; import { UnifiedAtsTagOutput } from '@ats/tag/types/model.unified'; -import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; +import { + ApiProperty, + ApiPropertyOptional, + getSchemaPath, +} from '@nestjs/swagger'; import { IsUUID, IsOptional, @@ -116,7 +120,13 @@ export class UnifiedAtsCandidateInput { last_interaction_at?: string; @ApiPropertyOptional({ - type: [String], + type: 'array', + items: { + oneOf: [ + { type: 'string' }, + { $ref: getSchemaPath(UnifiedAtsAttachmentOutput) }, + ], + }, example: ['801f9ede-c698-4e66-a7fc-48d19eebaa4f'], nullable: true, description: 'The attachments UUIDs of the candidate', @@ -126,7 +136,13 @@ export class UnifiedAtsCandidateInput { attachments?: (string | UnifiedAtsAttachmentOutput)[]; @ApiPropertyOptional({ - type: [String], + type: 'array', + items: { + oneOf: [ + { type: 'string' }, + { $ref: getSchemaPath(UnifiedAtsApplicationOutput) }, + ], + }, example: ['801f9ede-c698-4e66-a7fc-48d19eebaa4f'], nullable: true, description: 'The applications UUIDs of the candidate', @@ -136,7 +152,10 @@ export class UnifiedAtsCandidateInput { applications?: (string | UnifiedAtsApplicationOutput)[]; @ApiPropertyOptional({ - type: [String], + type: 'array', + items: { + oneOf: [{ type: 'string' }, { $ref: getSchemaPath(UnifiedAtsTagOutput) }], + }, example: ['tag_1', 'tag_2'], nullable: true, description: 'The tags of the candidate', diff --git a/packages/api/src/ats/interview/services/interview.service.ts b/packages/api/src/ats/interview/services/interview.service.ts index 2f9cc79c2..374c984bb 100644 --- a/packages/api/src/ats/interview/services/interview.service.ts +++ b/packages/api/src/ats/interview/services/interview.service.ts @@ -357,10 +357,8 @@ export class InterviewService { }); // Convert the map to an array of objects - const field_mappings = Array.from( - fieldMappingsMap, - ([key, value]) => ({ [key]: value }), - ); + // Convert the map to an object +const field_mappings = Object.fromEntries(fieldMappingsMap); // Transform to UnifiedAtsInterviewOutput format return { diff --git a/packages/api/src/crm/company/services/company.service.ts b/packages/api/src/crm/company/services/company.service.ts index 8d31fb5db..f89fcf614 100644 --- a/packages/api/src/crm/company/services/company.service.ts +++ b/packages/api/src/crm/company/services/company.service.ts @@ -527,10 +527,8 @@ export class CompanyService { }); // Convert the map to an array of objects - const field_mappings = Array.from( - fieldMappingsMap, - ([key, value]) => ({ [key]: value }), - ); + // Convert the map to an object +const field_mappings = Object.fromEntries(fieldMappingsMap); // Transform to UnifiedCrmCompanyOutput format return { diff --git a/packages/api/src/crm/contact/contact.controller.ts b/packages/api/src/crm/contact/contact.controller.ts index 96a9d56ae..18fc6e3b8 100644 --- a/packages/api/src/crm/contact/contact.controller.ts +++ b/packages/api/src/crm/contact/contact.controller.ts @@ -37,7 +37,6 @@ import { PaginatedDto, } from '@@core/utils/dtos/openapi.respone.dto'; - @ApiTags('crm/contacts') @Controller('crm/contacts') @ApiExtraModels(PaginatedDto, UnifiedCrmContactOutput) diff --git a/packages/api/src/crm/contact/services/contact.service.ts b/packages/api/src/crm/contact/services/contact.service.ts index c9561dc92..502ffefcb 100644 --- a/packages/api/src/crm/contact/services/contact.service.ts +++ b/packages/api/src/crm/contact/services/contact.service.ts @@ -534,10 +534,8 @@ export class ContactService { }); // Convert the map to an array of objects - const field_mappings = Array.from( - fieldMappingsMap, - ([key, value]) => ({ [key]: value }), - ); + // Convert the map to an object + const field_mappings = Object.fromEntries(fieldMappingsMap); // Transform to UnifiedCrmContactInput format return { diff --git a/packages/api/src/crm/deal/services/deal.service.ts b/packages/api/src/crm/deal/services/deal.service.ts index 39cdda036..d9e99bfd6 100644 --- a/packages/api/src/crm/deal/services/deal.service.ts +++ b/packages/api/src/crm/deal/services/deal.service.ts @@ -357,10 +357,8 @@ export class DealService { }); // Convert the map to an array of objects - const field_mappings = Array.from( - fieldMappingsMap, - ([key, value]) => ({ [key]: value }), - ); + // Convert the map to an object +const field_mappings = Object.fromEntries(fieldMappingsMap); // Transform to UnifiedCrmDealOutput format return { diff --git a/packages/api/src/crm/note/services/note.service.ts b/packages/api/src/crm/note/services/note.service.ts index 1456144cb..7fb80c65a 100644 --- a/packages/api/src/crm/note/services/note.service.ts +++ b/packages/api/src/crm/note/services/note.service.ts @@ -390,10 +390,8 @@ export class NoteService { }); // Convert the map to an array of objects - const field_mappings = Array.from( - fieldMappingsMap, - ([key, value]) => ({ [key]: value }), - ); + // Convert the map to an object +const field_mappings = Object.fromEntries(fieldMappingsMap); // Transform to UnifiedCrmNoteOutput format return { diff --git a/packages/api/src/crm/stage/services/stage.service.ts b/packages/api/src/crm/stage/services/stage.service.ts index fb460d03c..3c99b2717 100644 --- a/packages/api/src/crm/stage/services/stage.service.ts +++ b/packages/api/src/crm/stage/services/stage.service.ts @@ -173,10 +173,8 @@ export class StageService { }); // Convert the map to an array of objects - const field_mappings = Array.from( - fieldMappingsMap, - ([key, value]) => ({ [key]: value }), - ); + // Convert the map to an object +const field_mappings = Object.fromEntries(fieldMappingsMap); // Transform to UnifiedCrmStageOutput format return { diff --git a/packages/api/src/crm/task/services/task.service.ts b/packages/api/src/crm/task/services/task.service.ts index 64cf130fc..f8ee29466 100644 --- a/packages/api/src/crm/task/services/task.service.ts +++ b/packages/api/src/crm/task/services/task.service.ts @@ -376,10 +376,8 @@ export class TaskService { }); // Convert the map to an array of objects - const field_mappings = Array.from( - fieldMappingsMap, - ([key, value]) => ({ [key]: value }), - ); + // Convert the map to an object +const field_mappings = Object.fromEntries(fieldMappingsMap); // Transform to UnifiedCrmTaskOutput format return { diff --git a/packages/api/src/crm/user/services/user.service.ts b/packages/api/src/crm/user/services/user.service.ts index ec8e29fe7..8219d027b 100644 --- a/packages/api/src/crm/user/services/user.service.ts +++ b/packages/api/src/crm/user/services/user.service.ts @@ -183,10 +183,8 @@ export class UserService { }); // Convert the map to an array of objects - const field_mappings = Array.from( - fieldMappingsMap, - ([key, value]) => ({ [key]: value }), - ); + // Convert the map to an object +const field_mappings = Object.fromEntries(fieldMappingsMap); // Transform to UnifiedCrmUserOutput format return { diff --git a/packages/api/src/filestorage/file/services/file.service.ts b/packages/api/src/filestorage/file/services/file.service.ts index 5405db84a..0c5b130b6 100644 --- a/packages/api/src/filestorage/file/services/file.service.ts +++ b/packages/api/src/filestorage/file/services/file.service.ts @@ -363,10 +363,8 @@ export class FileService { }); // Convert the map to an array of objects - const field_mappings = Array.from( - fieldMappingsMap, - ([key, value]) => ({ [key]: value }), - ); + // Convert the map to an object +const field_mappings = Object.fromEntries(fieldMappingsMap); let permission; if (file.id_fs_permission) { diff --git a/packages/api/src/filestorage/group/types/model.unified.ts b/packages/api/src/filestorage/group/types/model.unified.ts index 1762b209a..25ec87aa7 100644 --- a/packages/api/src/filestorage/group/types/model.unified.ts +++ b/packages/api/src/filestorage/group/types/model.unified.ts @@ -1,5 +1,9 @@ import { UnifiedFilestorageUserOutput } from '@filestorage/user/types/model.unified'; -import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; +import { + ApiProperty, + ApiPropertyOptional, + getSchemaPath, +} from '@nestjs/swagger'; import { IsUUID, IsOptional, IsString } from 'class-validator'; export class UnifiedFilestorageGroupInput { @@ -13,7 +17,13 @@ export class UnifiedFilestorageGroupInput { name: string; @ApiProperty({ - type: [String], + type: 'array', + items: { + oneOf: [ + { type: 'string' }, + { $ref: getSchemaPath(UnifiedFilestorageUserOutput) }, + ], + }, example: ['801f9ede-c698-4e66-a7fc-48d19eebaa4f'], description: 'Uuids of users of the group', }) diff --git a/packages/api/src/filestorage/permission/types/model.unified.ts b/packages/api/src/filestorage/permission/types/model.unified.ts index 397ad5afc..6cc360379 100644 --- a/packages/api/src/filestorage/permission/types/model.unified.ts +++ b/packages/api/src/filestorage/permission/types/model.unified.ts @@ -7,7 +7,8 @@ export type PermissionRole = 'READ' | 'WRITE' | 'OWNER'; export class UnifiedFilestoragePermissionInput { @ApiProperty({ type: [String], - example: ['can_create'], //todo + example: ['READ'], + enum: ['READ', 'WRITE', 'OWNER'], nullable: true, description: 'The roles of the permission', }) diff --git a/packages/api/src/ticketing/comment/services/comment.service.ts b/packages/api/src/ticketing/comment/services/comment.service.ts index 9681f85d6..b1bd4d613 100644 --- a/packages/api/src/ticketing/comment/services/comment.service.ts +++ b/packages/api/src/ticketing/comment/services/comment.service.ts @@ -456,10 +456,8 @@ export class CommentService { }); // Convert the map to an array of objects - const field_mappings = Array.from( - fieldMappingsMap, - ([key, value]) => ({ [key]: value }), - );*/ + // Convert the map to an object +const field_mappings = Object.fromEntries(fieldMappingsMap);*/ const attachments = await this.prisma.tcg_attachments.findMany({ where: { id_tcg_ticket: comment.id_tcg_ticket, diff --git a/packages/api/src/ticketing/comment/types/model.unified.ts b/packages/api/src/ticketing/comment/types/model.unified.ts index 0d18d035b..753c6e1b2 100644 --- a/packages/api/src/ticketing/comment/types/model.unified.ts +++ b/packages/api/src/ticketing/comment/types/model.unified.ts @@ -1,4 +1,8 @@ -import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; +import { + ApiProperty, + ApiPropertyOptional, + getSchemaPath, +} from '@nestjs/swagger'; import { UnifiedTicketingAttachmentOutput } from '@ticketing/attachment/types/model.unified'; import { IsBoolean, IsIn, IsOptional, IsString, IsUUID } from 'class-validator'; @@ -81,7 +85,13 @@ export class UnifiedTicketingCommentInput { user_id?: string; // UUID of User object @ApiPropertyOptional({ - type: [String], + type: 'array', + items: { + oneOf: [ + { type: 'string' }, + { $ref: getSchemaPath(UnifiedTicketingAttachmentOutput) }, + ], + }, nullable: true, example: ['801f9ede-c698-4e66-a7fc-48d19eebaa4f'], description: 'The attachements UUIDs tied to the comment', diff --git a/packages/api/src/ticketing/contact/services/contact.service.ts b/packages/api/src/ticketing/contact/services/contact.service.ts index e3e86b451..baa06c4dc 100644 --- a/packages/api/src/ticketing/contact/services/contact.service.ts +++ b/packages/api/src/ticketing/contact/services/contact.service.ts @@ -171,10 +171,8 @@ export class ContactService { }); // Convert the map to an array of objects - const field_mappings = Array.from( - fieldMappingsMap, - ([key, value]) => ({ [key]: value }), - ); + // Convert the map to an object +const field_mappings = Object.fromEntries(fieldMappingsMap); // Transform to UnifiedTicketingContactOutput format return { diff --git a/packages/api/src/ticketing/tag/services/tag.service.ts b/packages/api/src/ticketing/tag/services/tag.service.ts index 8af1ba07a..06d8e4db7 100644 --- a/packages/api/src/ticketing/tag/services/tag.service.ts +++ b/packages/api/src/ticketing/tag/services/tag.service.ts @@ -72,7 +72,7 @@ export class TagService { await this.prisma.events.create({ data: { id_connection: connection_id, - id_project: project_id, + id_project: project_id, id_event: uuidv4(), status: 'success', type: 'ticketing.tag.pull', @@ -92,7 +92,7 @@ export class TagService { } async getTags( - connection_id: string, + connection_id: string, project_id: string, integrationId: string, linkedUserId: string, @@ -169,10 +169,8 @@ export class TagService { }); // Convert the map to an array of objects - const field_mappings = Array.from( - fieldMappingsMap, - ([key, value]) => ({ [key]: value }), - ); + // Convert the map to an object + const field_mappings = Object.fromEntries(fieldMappingsMap); // Transform to UnifiedTicketingTagOutput format return { @@ -189,24 +187,25 @@ export class TagService { let res: UnifiedTicketingTagOutput[] = unifiedTags; if (remote_data) { - const remote_array_data: UnifiedTicketingTagOutput[] = await Promise.all( - res.map(async (tag) => { - const resp = await this.prisma.remote_data.findFirst({ - where: { - ressource_owner_id: tag.id, - }, - }); - const remote_data = JSON.parse(resp.data); - return { ...tag, remote_data }; - }), - ); + const remote_array_data: UnifiedTicketingTagOutput[] = + await Promise.all( + res.map(async (tag) => { + const resp = await this.prisma.remote_data.findFirst({ + where: { + ressource_owner_id: tag.id, + }, + }); + const remote_data = JSON.parse(resp.data); + return { ...tag, remote_data }; + }), + ); res = remote_array_data; } await this.prisma.events.create({ data: { id_connection: connection_id, - id_project: project_id, + id_project: project_id, id_event: uuidv4(), status: 'success', type: 'ticketing.tag.pull', diff --git a/packages/api/src/ticketing/tag/tag.controller.ts b/packages/api/src/ticketing/tag/tag.controller.ts index 895aad60d..dc320cedf 100644 --- a/packages/api/src/ticketing/tag/tag.controller.ts +++ b/packages/api/src/ticketing/tag/tag.controller.ts @@ -28,7 +28,6 @@ import { ApiPaginatedResponse, } from '@@core/utils/dtos/openapi.respone.dto'; - @ApiTags('ticketing/tags') @Controller('ticketing/tags') export class TagController { diff --git a/packages/api/src/ticketing/team/services/team.service.ts b/packages/api/src/ticketing/team/services/team.service.ts index 32c8e13da..a2388290b 100644 --- a/packages/api/src/ticketing/team/services/team.service.ts +++ b/packages/api/src/ticketing/team/services/team.service.ts @@ -169,10 +169,8 @@ export class TeamService { }); // Convert the map to an array of objects - const field_mappings = Array.from( - fieldMappingsMap, - ([key, value]) => ({ [key]: value }), - ); + // Convert the map to an object +const field_mappings = Object.fromEntries(fieldMappingsMap); // Transform to UnifiedTicketingTeamOutput format return { diff --git a/packages/api/src/ticketing/ticket/services/ticket.service.ts b/packages/api/src/ticketing/ticket/services/ticket.service.ts index f0f5652ef..9fa976c3b 100644 --- a/packages/api/src/ticketing/ticket/services/ticket.service.ts +++ b/packages/api/src/ticketing/ticket/services/ticket.service.ts @@ -488,10 +488,8 @@ export class TicketService { }); // Convert the map to an array of objects - const field_mappings = Array.from( - fieldMappingsMap, - ([key, value]) => ({ [key]: value }), - ); + // Convert the map to an object + const field_mappings = Object.fromEntries(fieldMappingsMap); let tagsArray; if (ticket.tags) { diff --git a/packages/api/src/ticketing/ticket/types/model.unified.ts b/packages/api/src/ticketing/ticket/types/model.unified.ts index 9e4fb2b46..80da04fa3 100644 --- a/packages/api/src/ticketing/ticket/types/model.unified.ts +++ b/packages/api/src/ticketing/ticket/types/model.unified.ts @@ -1,4 +1,8 @@ -import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; +import { + ApiProperty, + ApiPropertyOptional, + getSchemaPath, +} from '@nestjs/swagger'; import { UnifiedTicketingAttachmentInput } from '@ticketing/attachment/types/model.unified'; import { UnifiedTicketingCollectionOutput } from '@ticketing/collection/types/model.unified'; import { UnifiedTicketingCommentInput } from '@ticketing/comment/types/model.unified'; @@ -76,7 +80,13 @@ export class UnifiedTicketingTicketInput { parent_ticket?: string; @ApiPropertyOptional({ - type: String, + type: 'array', + items: { + oneOf: [ + { type: 'string' }, + { $ref: getSchemaPath(UnifiedTicketingCollectionOutput) }, + ], + }, example: ['801f9ede-c698-4e66-a7fc-48d19eebaa4f'], nullable: true, description: 'The collection UUIDs the ticket belongs to', @@ -86,7 +96,13 @@ export class UnifiedTicketingTicketInput { collections?: (string | UnifiedTicketingCollectionOutput)[]; @ApiPropertyOptional({ - type: [String], + type: 'array', + items: { + oneOf: [ + { type: 'string' }, + { $ref: getSchemaPath(UnifiedTicketingTagOutput) }, + ], + }, example: ['my_tag', 'urgent_tag'], nullable: true, description: 'The tags names of the ticket', @@ -158,7 +174,13 @@ export class UnifiedTicketingTicketInput { contact_id?: string; @ApiPropertyOptional({ - type: [String], + type: 'array', + items: { + oneOf: [ + { type: 'string' }, + { $ref: getSchemaPath(UnifiedTicketingAttachmentInput) }, + ], + }, example: ['801f9ede-c698-4e66-a7fc-48d19eebaa4f'], description: 'The attachements UUIDs tied to the ticket', nullable: true, diff --git a/packages/api/src/ticketing/user/services/user.service.ts b/packages/api/src/ticketing/user/services/user.service.ts index 26664cf9a..c7a51df2e 100644 --- a/packages/api/src/ticketing/user/services/user.service.ts +++ b/packages/api/src/ticketing/user/services/user.service.ts @@ -172,10 +172,8 @@ export class UserService { }); // Convert the map to an array of objects - const field_mappings = Array.from( - fieldMappingsMap, - ([key, value]) => ({ [key]: value }), - ); + // Convert the map to an object +const field_mappings = Object.fromEntries(fieldMappingsMap); // Transform to UnifiedTicketingUserOutput format return { diff --git a/packages/api/swagger/swagger-spec.yaml b/packages/api/swagger/swagger-spec.yaml index ce5ff8976..af16d8fbb 100644 --- a/packages/api/swagger/swagger-spec.yaml +++ b/packages/api/swagger/swagger-spec.yaml @@ -207,14 +207,6 @@ paths: tags: &ref_1 - ticketing/tickets x-speakeasy-group: ticketing.tickets - x-speakeasy-pagination: - type: cursor - inputs: - - name: cursor - in: parameters - type: cursor - outputs: - nextCursor: $.next_cursor post: operationId: createTicketingTicket summary: Create Tickets @@ -8547,7 +8539,7 @@ components: type: string nullable: true example: USER - enum: &ref_112 + enum: &ref_115 - USER - CONTACT description: >- @@ -8573,13 +8565,15 @@ components: The UUID of the user which the comment belongs to (if no contact_id specified) attachments: + type: array + items: &ref_116 + oneOf: + - type: string + - $ref: '#/components/schemas/UnifiedTicketingAttachmentOutput' nullable: true - example: &ref_113 + example: &ref_117 - 801f9ede-c698-4e66-a7fc-48d19eebaa4f description: The attachements UUIDs tied to the comment - type: array - items: - type: string required: - body UnifiedTicketingTicketOutput: @@ -8627,20 +8621,26 @@ components: nullable: true description: The UUID of the parent ticket collections: - type: string - example: &ref_88 + type: array + items: &ref_88 + oneOf: + - type: string + - $ref: '#/components/schemas/UnifiedTicketingCollectionOutput' + example: &ref_89 - 801f9ede-c698-4e66-a7fc-48d19eebaa4f nullable: true description: The collection UUIDs the ticket belongs to tags: - example: &ref_89 + type: array + items: &ref_90 + oneOf: + - type: string + - $ref: '#/components/schemas/UnifiedTicketingTagOutput' + example: &ref_91 - my_tag - urgent_tag nullable: true description: The tags names of the ticket - type: array - items: - type: string completed_at: format: date-time type: string @@ -8650,7 +8650,7 @@ components: priority: type: string example: HIGH - enum: &ref_90 + enum: &ref_92 - HIGH - MEDIUM - LOW @@ -8659,7 +8659,7 @@ components: The priority of the ticket. Authorized values are HIGH, MEDIUM or LOW. assigned_to: - example: &ref_91 + example: &ref_93 - 801f9ede-c698-4e66-a7fc-48d19eebaa4f nullable: true description: The users UUIDs the ticket is assigned to @@ -8667,7 +8667,7 @@ components: items: type: string comment: - example: &ref_92 + example: &ref_94 content: Assigned the issue ! nullable: true description: The comment of the ticket @@ -8684,16 +8684,18 @@ components: nullable: true description: The UUID of the contact which the ticket belongs to attachments: - example: &ref_93 + type: array + items: &ref_95 + oneOf: + - type: string + - $ref: '#/components/schemas/UnifiedTicketingAttachmentInput' + example: &ref_96 - 801f9ede-c698-4e66-a7fc-48d19eebaa4f description: The attachements UUIDs tied to the ticket nullable: true - type: array - items: - type: string field_mappings: type: object - example: &ref_94 + example: &ref_97 fav_dish: broccoli fav_color: red nullable: true @@ -8774,17 +8776,17 @@ components: nullable: true description: The UUID of the parent ticket collections: - type: string - example: *ref_88 + type: array + items: *ref_88 + example: *ref_89 nullable: true description: The collection UUIDs the ticket belongs to tags: - example: *ref_89 + type: array + items: *ref_90 + example: *ref_91 nullable: true description: The tags names of the ticket - type: array - items: - type: string completed_at: format: date-time type: string @@ -8794,20 +8796,20 @@ components: priority: type: string example: HIGH - enum: *ref_90 + enum: *ref_92 nullable: true description: >- The priority of the ticket. Authorized values are HIGH, MEDIUM or LOW. assigned_to: - example: *ref_91 + example: *ref_93 nullable: true description: The users UUIDs the ticket is assigned to type: array items: type: string comment: - example: *ref_92 + example: *ref_94 nullable: true description: The comment of the ticket allOf: @@ -8823,15 +8825,14 @@ components: nullable: true description: The UUID of the contact which the ticket belongs to attachments: - example: *ref_93 + type: array + items: *ref_95 + example: *ref_96 description: The attachements UUIDs tied to the ticket nullable: true - type: array - items: - type: string field_mappings: type: object - example: *ref_94 + example: *ref_97 nullable: true description: >- The custom field mappings of the ticket between the remote 3rd party @@ -9179,7 +9180,7 @@ components: industry: type: string example: ACCOUNTING - enum: &ref_95 + enum: &ref_98 - ACCOUNTING - AIRLINES_AVIATION - ALTERNATIVE_DISPUTE_RESOLUTION @@ -9343,7 +9344,7 @@ components: nullable: true email_addresses: description: The email addresses of the company - example: &ref_96 + example: &ref_99 - email_address: acme@gmail.com email_address_type: WORK nullable: true @@ -9352,7 +9353,7 @@ components: $ref: '#/components/schemas/Email' addresses: description: The addresses of the company - example: &ref_97 + example: &ref_100 - street_1: 5th Avenue city: New York state: NY @@ -9364,7 +9365,7 @@ components: $ref: '#/components/schemas/Address' phone_numbers: description: The phone numbers of the company - example: &ref_98 + example: &ref_101 - phone_number: '+33660606067' phone_type: WORK nullable: true @@ -9373,7 +9374,7 @@ components: $ref: '#/components/schemas/Phone' field_mappings: type: object - example: &ref_99 + example: &ref_102 fav_dish: broccoli fav_color: red description: >- @@ -9422,7 +9423,7 @@ components: industry: type: string example: ACCOUNTING - enum: *ref_95 + enum: *ref_98 description: >- The industry of the company. Authorized values can be found in the Industry enum. @@ -9439,28 +9440,28 @@ components: nullable: true email_addresses: description: The email addresses of the company - example: *ref_96 + example: *ref_99 nullable: true type: array items: $ref: '#/components/schemas/Email' addresses: description: The addresses of the company - example: *ref_97 + example: *ref_100 nullable: true type: array items: $ref: '#/components/schemas/Address' phone_numbers: description: The phone numbers of the company - example: *ref_98 + example: *ref_101 nullable: true type: array items: $ref: '#/components/schemas/Phone' field_mappings: type: object - example: *ref_99 + example: *ref_102 description: >- The custom field mappings of the company between the remote 3rd party & Panora @@ -9484,7 +9485,7 @@ components: email_addresses: nullable: true description: The email addresses of the contact - example: &ref_100 + example: &ref_103 - email: john.doe@example.com type: WORK type: array @@ -9493,7 +9494,7 @@ components: phone_numbers: nullable: true description: The phone numbers of the contact - example: &ref_101 + example: &ref_104 - phone: '1234567890' type: WORK type: array @@ -9502,7 +9503,7 @@ components: addresses: nullable: true description: The addresses of the contact - example: &ref_102 + example: &ref_105 - street: 123 Main St city: Anytown state: CA @@ -9519,7 +9520,7 @@ components: example: 801f9ede-c698-4e66-a7fc-48d19eebaa4f field_mappings: type: object - example: &ref_103 + example: &ref_106 fav_dish: broccoli fav_color: red nullable: true @@ -9576,21 +9577,21 @@ components: email_addresses: nullable: true description: The email addresses of the contact - example: *ref_100 + example: *ref_103 type: array items: $ref: '#/components/schemas/Email' phone_numbers: nullable: true description: The phone numbers of the contact - example: *ref_101 + example: *ref_104 type: array items: $ref: '#/components/schemas/Phone' addresses: nullable: true description: The addresses of the contact - example: *ref_102 + example: *ref_105 type: array items: $ref: '#/components/schemas/Address' @@ -9601,7 +9602,7 @@ components: example: 801f9ede-c698-4e66-a7fc-48d19eebaa4f field_mappings: type: object - example: *ref_103 + example: *ref_106 nullable: true description: >- The custom field mappings of the contact between the remote 3rd @@ -9646,7 +9647,7 @@ components: field_mappings: type: object nullable: true - example: &ref_104 + example: &ref_107 fav_dish: broccoli fav_color: red description: >- @@ -9723,7 +9724,7 @@ components: field_mappings: type: object nullable: true - example: *ref_104 + example: *ref_107 description: >- The custom field mappings of the company between the remote 3rd party & Panora @@ -9744,7 +9745,7 @@ components: type: string nullable: true example: INBOUND - enum: &ref_105 + enum: &ref_108 - INBOUND - OUTBOUND description: >- @@ -9771,7 +9772,7 @@ components: type: string nullable: true example: MEETING - enum: &ref_106 + enum: &ref_109 - EMAIL - CALL - MEETING @@ -9790,7 +9791,7 @@ components: description: The UUID of the company tied to the engagement contacts: nullable: true - example: &ref_107 + example: &ref_110 - 801f9ede-c698-4e66-a7fc-48d19eebaa4f description: The UUIDs of contacts tied to the engagement object type: array @@ -9799,7 +9800,7 @@ components: field_mappings: type: object nullable: true - example: &ref_108 + example: &ref_111 fav_dish: broccoli fav_color: red description: >- @@ -9852,7 +9853,7 @@ components: type: string nullable: true example: INBOUND - enum: *ref_105 + enum: *ref_108 description: >- The direction of the engagement. Authorized values are INBOUND or OUTBOUND @@ -9877,7 +9878,7 @@ components: type: string nullable: true example: MEETING - enum: *ref_106 + enum: *ref_109 description: >- The type of the engagement. Authorized values are EMAIL, CALL or MEETING @@ -9893,7 +9894,7 @@ components: description: The UUID of the company tied to the engagement contacts: nullable: true - example: *ref_107 + example: *ref_110 description: The UUIDs of contacts tied to the engagement object type: array items: @@ -9901,7 +9902,7 @@ components: field_mappings: type: object nullable: true - example: *ref_108 + example: *ref_111 description: >- The custom field mappings of the engagement between the remote 3rd party & Panora @@ -9938,7 +9939,7 @@ components: description: The UUID of the deal tied to the note field_mappings: type: object - example: &ref_109 + example: &ref_112 fav_dish: broccoli fav_color: red nullable: true @@ -10008,7 +10009,7 @@ components: description: The UUID of the deal tied to the note field_mappings: type: object - example: *ref_109 + example: *ref_112 nullable: true description: >- The custom field mappings of the note between the remote 3rd party & @@ -10080,7 +10081,7 @@ components: status: type: string example: PENDING - enum: &ref_110 + enum: &ref_113 - PENDING - COMPLETED description: The status of the task. Authorized values are PENDING, COMPLETED. @@ -10112,7 +10113,7 @@ components: nullable: true field_mappings: type: object - example: &ref_111 + example: &ref_114 fav_dish: broccoli fav_color: red description: >- @@ -10171,7 +10172,7 @@ components: status: type: string example: PENDING - enum: *ref_110 + enum: *ref_113 description: The status of the task. Authorized values are PENDING, COMPLETED. nullable: true due_date: @@ -10201,7 +10202,7 @@ components: nullable: true field_mappings: type: object - example: *ref_111 + example: *ref_114 description: >- The custom field mappings of the task between the remote 3rd party & Panora @@ -10344,7 +10345,7 @@ components: type: string nullable: true example: USER - enum: *ref_112 + enum: *ref_115 description: >- The creator type of the comment. Authorized values are either USER or CONTACT @@ -10368,12 +10369,11 @@ components: The UUID of the user which the comment belongs to (if no contact_id specified) attachments: + type: array + items: *ref_116 nullable: true - example: *ref_113 + example: *ref_117 description: The attachements UUIDs tied to the comment - type: array - items: - type: string id: type: string nullable: true @@ -11119,7 +11119,7 @@ components: properties: activity_type: type: string - enum: &ref_114 + enum: &ref_118 - NOTE - EMAIL - OTHER @@ -11138,7 +11138,7 @@ components: description: The body of the activity visibility: type: string - enum: &ref_115 + enum: &ref_119 - ADMIN_ONLY - PUBLIC - PRIVATE @@ -11158,7 +11158,7 @@ components: description: The remote creation date of the activity field_mappings: type: object - example: &ref_116 + example: &ref_120 fav_dish: broccoli fav_color: red additionalProperties: true @@ -11201,7 +11201,7 @@ components: properties: activity_type: type: string - enum: *ref_114 + enum: *ref_118 example: NOTE nullable: true description: The type of activity @@ -11217,7 +11217,7 @@ components: description: The body of the activity visibility: type: string - enum: *ref_115 + enum: *ref_119 example: PUBLIC nullable: true description: The visibility of the activity @@ -11234,7 +11234,7 @@ components: description: The remote creation date of the activity field_mappings: type: object - example: *ref_116 + example: *ref_120 additionalProperties: true nullable: true description: >- @@ -11258,7 +11258,7 @@ components: offers: nullable: true description: The offers UUIDs for the application - example: &ref_117 + example: &ref_121 - 801f9ede-c698-4e66-a7fc-48d19eebaa4f - 12345678-1234-1234-1234-123456789012 type: array @@ -11295,7 +11295,7 @@ components: example: 801f9ede-c698-4e66-a7fc-48d19eebaa4f field_mappings: type: object - example: &ref_118 + example: &ref_122 fav_dish: broccoli fav_color: red additionalProperties: true @@ -11361,7 +11361,7 @@ components: offers: nullable: true description: The offers UUIDs for the application - example: *ref_117 + example: *ref_121 type: array items: type: string @@ -11396,7 +11396,7 @@ components: example: 801f9ede-c698-4e66-a7fc-48d19eebaa4f field_mappings: type: object - example: *ref_118 + example: *ref_122 additionalProperties: true nullable: true description: >- @@ -11418,7 +11418,7 @@ components: attachment_type: type: string example: RESUME - enum: &ref_119 + enum: &ref_123 - RESUME - COVER_LETTER - OFFER_LETTER @@ -11444,7 +11444,7 @@ components: description: The UUID of the candidate field_mappings: type: object - example: &ref_120 + example: &ref_124 fav_dish: broccoli fav_color: red additionalProperties: true @@ -11498,7 +11498,7 @@ components: attachment_type: type: string example: RESUME - enum: *ref_119 + enum: *ref_123 nullable: true description: The type of the file remote_created_at: @@ -11520,7 +11520,7 @@ components: description: The UUID of the candidate field_mappings: type: object - example: *ref_120 + example: *ref_124 additionalProperties: true nullable: true description: >- @@ -11597,32 +11597,38 @@ components: nullable: true description: The last interaction date with the candidate attachments: - example: &ref_121 + type: array + items: &ref_125 + oneOf: + - type: string + - $ref: '#/components/schemas/UnifiedAtsAttachmentOutput' + example: &ref_126 - 801f9ede-c698-4e66-a7fc-48d19eebaa4f nullable: true description: The attachments UUIDs of the candidate - type: array - items: - type: string applications: - example: &ref_122 + type: array + items: &ref_127 + oneOf: + - type: string + - $ref: '#/components/schemas/UnifiedAtsApplicationOutput' + example: &ref_128 - 801f9ede-c698-4e66-a7fc-48d19eebaa4f nullable: true description: The applications UUIDs of the candidate - type: array - items: - type: string tags: - example: &ref_123 + type: array + items: &ref_129 + oneOf: + - type: string + - $ref: '#/components/schemas/UnifiedAtsTagOutput' + example: &ref_130 - tag_1 - tag_2 nullable: true description: The tags of the candidate - type: array - items: - type: string urls: - example: &ref_124 + example: &ref_131 - url: mywebsite.com url_type: WEBSITE nullable: true @@ -11633,7 +11639,7 @@ components: items: $ref: '#/components/schemas/Url' phone_numbers: - example: &ref_125 + example: &ref_132 - phone_number: '+33660688899' phone_type: WORK nullable: true @@ -11642,7 +11648,7 @@ components: items: $ref: '#/components/schemas/Phone' email_addresses: - example: &ref_126 + example: &ref_133 - email_address: joedoe@gmail.com email_address_type: WORK nullable: true @@ -11652,7 +11658,7 @@ components: $ref: '#/components/schemas/Email' field_mappings: type: object - example: &ref_127 + example: &ref_134 fav_dish: broccoli fav_color: red additionalProperties: true @@ -11747,28 +11753,25 @@ components: nullable: true description: The last interaction date with the candidate attachments: - example: *ref_121 + type: array + items: *ref_125 + example: *ref_126 nullable: true description: The attachments UUIDs of the candidate - type: array - items: - type: string applications: - example: *ref_122 + type: array + items: *ref_127 + example: *ref_128 nullable: true description: The applications UUIDs of the candidate - type: array - items: - type: string tags: - example: *ref_123 + type: array + items: *ref_129 + example: *ref_130 nullable: true description: The tags of the candidate - type: array - items: - type: string urls: - example: *ref_124 + example: *ref_131 nullable: true description: >- The urls of the candidate, possible values for Url type are WEBSITE, @@ -11777,14 +11780,14 @@ components: items: $ref: '#/components/schemas/Url' phone_numbers: - example: *ref_125 + example: *ref_132 nullable: true description: The phone numbers of the candidate type: array items: $ref: '#/components/schemas/Phone' email_addresses: - example: *ref_126 + example: *ref_133 nullable: true description: The email addresses of the candidate type: array @@ -11792,7 +11795,7 @@ components: $ref: '#/components/schemas/Email' field_mappings: type: object - example: *ref_127 + example: *ref_134 additionalProperties: true nullable: true description: >- @@ -11852,7 +11855,7 @@ components: properties: status: type: string - enum: &ref_128 + enum: &ref_135 - SCHEDULED - AWAITING_FEEDBACK - COMPLETED @@ -11875,7 +11878,7 @@ components: nullable: true description: The UUID of the organizer interviewers: - example: &ref_129 + example: &ref_136 - 801f9ede-c698-4e66-a7fc-48d19eebaa4f nullable: true description: The UUIDs of the interviewers @@ -11913,7 +11916,7 @@ components: description: The remote modification date of the interview field_mappings: type: object - example: &ref_130 + example: &ref_137 fav_dish: broccoli fav_color: red additionalProperties: true @@ -11956,7 +11959,7 @@ components: properties: status: type: string - enum: *ref_128 + enum: *ref_135 example: SCHEDULED nullable: true description: The status of the interview @@ -11976,7 +11979,7 @@ components: nullable: true description: The UUID of the organizer interviewers: - example: *ref_129 + example: *ref_136 nullable: true description: The UUIDs of the interviewers type: array @@ -12013,7 +12016,7 @@ components: description: The remote modification date of the interview field_mappings: type: object - example: *ref_130 + example: *ref_137 additionalProperties: true nullable: true description: >- @@ -12897,7 +12900,7 @@ components: nullable: true field_mappings: type: object - example: &ref_131 + example: &ref_138 fav_dish: broccoli fav_color: red description: >- @@ -12983,7 +12986,7 @@ components: nullable: true field_mappings: type: object - example: *ref_131 + example: *ref_138 description: >- The custom field mappings of the object between the remote 3rd party & Panora @@ -13041,7 +13044,7 @@ components: description: The UUID of the permission tied to the folder field_mappings: type: object - example: &ref_132 + example: &ref_139 fav_dish: broccoli fav_color: red additionalProperties: true @@ -13132,7 +13135,7 @@ components: description: The UUID of the permission tied to the folder field_mappings: type: object - example: *ref_132 + example: *ref_139 additionalProperties: true nullable: true description: >- @@ -13156,12 +13159,14 @@ components: nullable: true description: The name of the group users: + type: array + items: + oneOf: + - type: string + - $ref: '#/components/schemas/UnifiedFilestorageUserOutput' example: - 801f9ede-c698-4e66-a7fc-48d19eebaa4f description: Uuids of users of the group - type: array - items: - type: string remote_was_deleted: type: boolean example: false @@ -13306,7 +13311,7 @@ components: field_mappings: type: object nullable: true - example: &ref_133 + example: &ref_140 fav_dish: broccoli fav_color: red description: >- @@ -13378,7 +13383,7 @@ components: field_mappings: type: object nullable: true - example: *ref_133 + example: *ref_140 description: >- The custom field mappings of the attachment between the remote 3rd party & Panora diff --git a/packages/shared/src/authUrl.ts b/packages/shared/src/authUrl.ts index cf3b479a9..9d336c3d8 100644 --- a/packages/shared/src/authUrl.ts +++ b/packages/shared/src/authUrl.ts @@ -24,7 +24,7 @@ export const constructAuthUrl = async ({ projectId, linkedUserId, providerName, // console.log('State : ', JSON.stringify({ projectId, linkedUserId, providerName, vertical, returnUrl })); // console.log('encodedRedirect URL : ', encodedRedirectUrl); // const vertical = findConnectorCategory(providerName); - if (vertical == null) { + if (vertical == null) { throw new ReferenceError('vertical is null'); }