From f1d03c78127dad1d9821be2b23573a4762af385c Mon Sep 17 00:00:00 2001 From: Denis Date: Thu, 14 Nov 2024 17:11:28 +0300 Subject: [PATCH 1/2] =?UTF-8?q?=D0=BE=D0=BF=D0=B8=D1=81=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- v2/swagger.yaml | 687 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 686 insertions(+), 1 deletion(-) diff --git a/v2/swagger.yaml b/v2/swagger.yaml index 2541b71..143c6b6 100644 --- a/v2/swagger.yaml +++ b/v2/swagger.yaml @@ -57,6 +57,8 @@ tags: description: Methods for working with user wallet. - name: shop description: Methods for working with corporate shop. Требуется право доступа shop-usage "Магазин". + - name: workflow + description: Methods for working with workflow. paths: /mobile/bind/{id}/{token}: @@ -949,7 +951,615 @@ paths: description: Unauthorized request 500: description: Server Error + /api/v2/workflow/catalog: + get: + tags: + - workflow + summary: Каталог процессов + description: | + Возвращает список категорий, процессов и связанных данных. + security: + - SessionAuth: [] + parameters: + - name: q + in: query + required: false + schema: + type: string + example: Журнал + - name: id + in: query + required: false + schema: + type: string + example: ffc0a17d-3d7a-4b4c-80ea-14093130973a + responses: + '200': + description: Успешный ответ + content: + application/json: + schema: + type: object + properties: + categories: + type: array + items: + $ref: '#/components/schemas/WorkflowCategory' + category: + type: object + properties: + id: + type: string + example: ffc0a17d-3d7a-4b4c-80ea-14093130973a + name: + type: string + example: 2313 + title: + type: string + example: 2313 + description: + type: string + example: "" + content_style_id: + type: integer + example: 1 + tags: + type: array + items: + type: string + breadcrumbs: + type: array + items: + type: object + properties: + label: + type: string + example: 2313 + id: + type: string + example: ffc0a17d-3d7a-4b4c-80ea-14093130973a + hash_id: + type: string + example: eeb76a8070 + slug: + type: string + example: 2313 + q: + type: string + example: Журнал + workflows: + type: array + items: + type: object + properties: + id: + type: string + example: 2bce2ae5-581b-417b-a8b0-95beb4beaa9c + name: + type: string + example: Журнал отсутствий + description: + type: string + example: "" + imageUrl: + type: string + example: https://denis.hrbox.io/file/resize/300x300/346339f5-f03c-44de-8a90-d1eb8da39c0a.png + url: + type: string + example: https://denis.hrbox.io/workflow/ticket/create?wfId=2bce2ae5-581b-417b-a8b0-95beb4beaa9c + status_id: + type: integer + example: 1 + tags: + type: array + items: + type: string + userGroupsVisible: + type: array + items: + type: object + properties: + id: + type: string + example: 591dd0ac-bfef-4687-b42f-d3fc353f461e + name: + type: string + example: Сотрудники + description: + type: string + example: "" + iconUrl: + type: string + example: https://denis.hrbox.io/img/fa-users.jpg + conditionsReadable: + type: string + example: (Статус регистрации из списка [Активный, Приглашенный])... + feedbackTotal: + type: object + properties: + count: + type: integer + example: 1 + score: + type: integer + example: 2 + brief: + type: string + example: "" + /api/v2/workflow/start/{processId}: + get: + tags: + - workflow + summary: | + Получение информации о форме подачи заявки. + security: + - SessionAuth: [] + parameters: + - name: processId + in: path + required: true + schema: + type: string + example: 9557cc57-bd21-4297-8007-ee25812afb07 + responses: + '200': + description: Успешный ответ + content: + application/json: + schema: + type: object + properties: + id: + type: string + example: bf047c9c-df0c-448c-8984-c292318b9cd4 + name: + type: string + example: Заявка на обучение + brief: + type: string + example: "" + description: + type: object + properties: + time: + type: integer + example: 1720625446725 + blocks: + type: array + items: + type: object + properties: + id: + type: string + example: XIP-pciYFP + data: + type: object + properties: + text: + type: string + example: "Нажимая на кнопку «Подать заявку», вы даёте разрешение на обработку персональных данных." + type: + type: string + example: paragraph + version: + type: string + example: 2.29.0 + imageUrl: + type: string + example: https://denis.hrbox.io/file/resize/300x300/346339f5-f03c-44de-8a90-d1eb8da39c0a.png + isChiefRequired: + type: boolean + example: false + isAllowCategoryChange: + type: boolean + example: false + categories: + type: object + additionalProperties: + type: string + fields: + type: array + items: + $ref: '#/components/schemas/WorkflowField' + post: + tags: + - workflow + summary: | + Создание заявки процесса. + security: + - SessionAuth: [] + parameters: + - name: processId + in: path + required: true + schema: + type: string + example: bf047c9c-df0c-448c-8984-c292318b9cd4 + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + categoryId: + type: string + example: 3fa418df-edc3-4a95-8850-ffebece59f04 + fieldValues: + type: object + additionalProperties: + type: string + responses: + '201': + description: Заявка успешно создана + content: + application/json: + schema: + type: object + properties: + id: + type: string + example: bf047c9c-df0c-448c-8984-c292318b9cd4 + message: + type: string + example: "Заявка успешно создана" + /api/v2/workflow-ticket/: + get: + tags: + - workflow + summary: Получение списка заявок + security: + - SessionAuth: [] + - ApiKeyAuth: [] + description: | + Возвращает список заявок по указанным фильтрам. + Данный метод поддерживает два типа авторизации: сессии и API-ключи. + + **1. Авторизация с использованием сессии:** + Для выполнения запросов с использованием сессии необходимо передавать следующие заголовки: + - `x-hrbox-tenant-id: {tenantId}` + - `x-hrbox-device-id: {deviceId}` + - `x-hrbox-session-id: {sessionId}` + - `x-hrbox-session-code: {sessionSecret}` + - `x-hrbox-embed: true` + + **2. Авторизация с использованием API-ключа:** + Все запросы должны быть авторизованы с помощью API-ключа, передавая следующие заголовки: + - `Content-Type: application/json` + - `X-Hrbox-Client-Id: {идентификатор ключа}` + - `X-Hrbox-Client-Secret: {секретный ключ}` + parameters: + - name: wf_workflow_id + in: query + required: false + schema: + type: string + description: ID процесса (workflow), по которому фильтруются заявки. + example: "2e05753d-459e-4a92-8265-aef15356872c" + - name: wf_ticket_stage_id + in: query + required: false + schema: + type: string + description: ID стадии (stage), по которой фильтруются заявки. + example: "3fc2b631-6fa7-4bf7-8651-3faacb4c71a5" + - name: wf_status_id + in: query + required: false + schema: + type: integer + description: Статус заявки (например, 1 - "В процессе"). + example: 1 + - name: per-page + in: query + required: false + schema: + type: integer + default: 10 + description: Количество записей на странице. + example: 5 + - name: page + in: query + required: false + schema: + type: integer + default: 1 + description: Номер страницы для пагинации. + example: 2 + + responses: + '200': + description: Успешный ответ + content: + application/json: + schema: + type: object + properties: + data: + type: array + description: Список заявок. + items: + type: object + properties: + id: + type: string + description: Уникальный идентификатор заявки. + example: "111e8a0c-bcf2-4fe4-8cd3-e8138670f277" + wf_workflow_id: + type: string + description: ID процесса. + example: "2e05753d-459e-4a92-8265-aef15356872c" + wf_ticket_stage_id: + type: string + description: ID текущей стадии заявки. + example: "b2b73536-f76a-4b7a-9413-7553a688af25" + wf_status_id: + type: integer + description: Статус заявки. + example: 1 + user_id: + type: string + description: ID пользователя, создавшего заявку. + example: "998bb3a1-92f3-4d01-b6ae-6c9d44d987d0" + created_at: + type: string + format: date-time + description: Дата и время создания заявки. + example: "2023-09-16 08:00:28" + updated_at: + type: string + format: date-time + description: Дата и время последнего обновления заявки. + example: "2023-09-16 08:00:29" + solved_at: + type: string + format: date-time + nullable: true + description: Дата и время решения заявки (если применимо). + example: null + url: + type: string + description: Ссылка на детальную информацию о заявке. + example: "https://example.hrbox.io/workflow/ticket/view?id=111e8a0c-bcf2-4fe4-8cd3-e8138670f277" + wfStatus: + type: string + description: Человеко-читаемый статус заявки. + example: "В процессе" + wfWorkflow: + type: object + description: Информация о связанном процессе. + properties: + id: + type: string + description: ID процесса. + example: "2e05753d-459e-4a92-8265-aef15356872c" + name: + type: string + description: Название процесса. + example: "Отпуск 1C" + is_hidden: + type: boolean + description: Признак скрытого процесса. + example: false + user: + type: object + description: Информация о пользователе, создавшем заявку. + properties: + id: + type: string + description: ID пользователя. + example: "998bb3a1-92f3-4d01-b6ae-6c9d44d987d0" + name: + type: string + description: Имя пользователя. + example: "Piu Cro" + faceUrl: + type: string + description: URL изображения профиля пользователя. + example: "https://example.hrbox.io/file/resize/300x300/346339f5-f03c-44de-8a90-d1eb8da39c0a.png" + _links: + type: object + description: Навигационные ссылки для пагинации. + properties: + self: + type: string + description: Текущая страница. + example: "https://example.hrbox.io/api/v2/workflow-ticket?..." + first: + type: string + description: Первая страница. + example: "https://example.hrbox.io/api/v2/workflow-ticket?..." + last: + type: string + description: Последняя страница. + example: "https://example.hrbox.io/api/v2/workflow-ticket?..." + _meta: + type: object + description: Метаданные пагинации. + properties: + totalCount: + type: integer + description: Общее количество записей. + example: 16 + pageCount: + type: integer + description: Общее количество страниц. + example: 4 + currentPage: + type: integer + description: Текущая страница. + example: 2 + perPage: + type: integer + description: Количество записей на странице. + example: 5 + /api/v2/workflow-ticket/view: + get: + tags: + - workflow + summary: Получение детальной информации по заявке + security: + - SessionAuth: [] + - ApiKeyAuth: [] + description: | + Возвращает детальную информацию о конкретной заявке, включая связанные данные о процессе, этапах и связанных пользователях. + + Данный метод поддерживает два типа авторизации: сессии и API-ключи. + + **1. Авторизация с использованием сессии:** + Для выполнения запросов с использованием сессии необходимо передавать следующие заголовки: + - `x-hrbox-tenant-id: {tenantId}` + - `x-hrbox-device-id: {deviceId}` + - `x-hrbox-session-id: {sessionId}` + - `x-hrbox-session-code: {sessionSecret}` + - `x-hrbox-embed: true` + + **2. Авторизация с использованием API-ключа:** + Все запросы должны быть авторизованы с помощью API-ключа, передавая следующие заголовки: + - `Content-Type: application/json` + - `X-Hrbox-Client-Id: {идентификатор ключа}` + - `X-Hrbox-Client-Secret: {секретный ключ}` + parameters: + - name: id + in: query + required: true + schema: + type: string + description: Уникальный идентификатор заявки. + example: "0b6a186a-95b8-4c89-8e69-6b49f12d1474" + responses: + '200': + description: Успешный ответ + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: Уникальный идентификатор заявки. + example: "0b6a186a-95b8-4c89-8e69-6b49f12d1474" + wf_workflow_id: + type: string + description: ID процесса, к которому относится заявка. + example: "2e05753d-459e-4a92-8265-aef15356872c" + wf_ticket_stage_id: + type: string + description: Текущая стадия заявки. + example: "76be1943-6b4d-41f5-9807-02e9797454d5" + wf_category_id: + type: string + description: ID категории, если указана. + nullable: true + example: null + wf_status_id: + type: integer + description: Текущий статус заявки. + example: 1 + user_id: + type: string + description: ID пользователя, создавшего заявку. + example: "36da46a6-e575-41f9-9972-a7a497e0326c" + created_at: + type: string + format: date-time + description: Дата и время создания заявки. + example: "2023-10-25 18:23:07" + updated_at: + type: string + format: date-time + description: Дата и время последнего обновления заявки. + example: "2023-10-25 18:23:07" + wfStatus: + type: string + description: Человеко-читаемый статус заявки. + example: "В процессе" + wfWorkflow: + type: object + description: Информация о процессе. + properties: + id: + type: string + description: ID процесса. + example: "2e05753d-459e-4a92-8265-aef15356872c" + name: + type: string + description: Название процесса. + example: "Отпуск 1C" + brief: + type: string + description: Краткое описание процесса. + example: "Подача заявки на отпуск" + is_hidden: + type: boolean + description: Признак того, что процесс скрыт. + example: false + wfTicketStages: + type: array + description: Список стадий заявки. + items: + type: object + properties: + id: + type: string + description: ID стадии. + example: "d8d47802-4ada-4a3b-bc73-d103a1385fa8" + name: + type: string + description: Название стадии. + example: "Подача заявки" + fields: + type: array + description: Поля, связанные с текущей стадией. + items: + type: object + properties: + id: + type: string + description: ID поля. + example: "vacation_type_id" + name: + type: string + description: Название поля. + example: "Тип отпуска" + type: + type: string + description: Тип поля. + example: "select" + values: + type: array + description: Возможные значения для выбора. + items: + type: string + example: ["Ежегодный оплачиваемый", "Другой"] + required: + type: boolean + description: Признак обязательного заполнения. + example: true + defaultValue: + type: string + description: Значение по умолчанию. + nullable: true + example: null + responsible: + type: array + description: Ответственные за стадию пользователи. + items: + type: object + properties: + id: + type: string + description: ID пользователя. + example: "36da46a6-e575-41f9-9972-a7a497e0326c" + name: + type: string + description: Имя пользователя. + example: "Винокуров Сергей Борисович" + faceUrl: + type: string + description: Ссылка на аватар пользователя. + example: "https://example.hrbox.io/file/resize/300x300/346339f5-f03c-44de-8a90-d1eb8da39c0a.png" /dashboard: get: tags: @@ -3445,6 +4055,17 @@ paths: description: Server Error. components: + securitySchemes: + SessionAuth: + type: apiKey + in: header + name: x-hrbox-session-id + description: "Авторизация с использованием сессии. Требуемые заголовки: x-hrbox-tenant-id, x-hrbox-device-id, x-hrbox-session-id, x-hrbox-session-code, x-hrbox-embed." + ApiKeyAuth: + type: apiKey + in: header + name: X-Hrbox-Client-Id + description: "Авторизация с использованием API-ключа. Требуемые заголовки: Content-Type, X-Hrbox-Client-Id, X-Hrbox-Client-Secret." schemas: _meta: type: object @@ -3515,6 +4136,67 @@ components: properties: href: type: string + WorkflowCategory: + type: object + properties: + id: + type: string + example: 5a0c5bb0-200a-4310-a273-ff7f6dc82491 + name: + type: string + example: Тест + brief: + type: string + nullable: true + example: null + imageUrl: + type: string + example: http://hr.lh/img/noarticle.png + Workflow: + type: object + properties: + id: + type: string + example: e0a0c30f-2da0-450b-9522-5a4d81f222f0 + name: + type: string + example: Новый процесс + brief: + type: string + example: "" + imageUrl: + type: string + example: http://hr.lh/img/nophoto.png + feedbackTotalScore: + type: number + example: 0 + feedbackTotalCount: + type: number + example: 0 + WorkflowField: + type: object + properties: + id: + type: string + example: f1e2972e-4655-4f93-bb54-733df3ddbc83 + type: + type: string + example: text + name: + type: string + example: Текст + required: + type: boolean + example: true + values: + type: array + items: + type: string + nullable: true + defaultValue: + type: string + nullable: true + example: null arrayOfIds: type: object @@ -6969,4 +7651,7 @@ components: required: true schema: type: integer - example: 2024 \ No newline at end of file + example: 2024 +security: + - SessionAuth: [] + - ApiKeyAuth: [] \ No newline at end of file From 2853f2e5c80b3a0dbfd0ce63b1ca188c8a109a4b Mon Sep 17 00:00:00 2001 From: Denis Date: Thu, 21 Nov 2024 11:34:54 +0300 Subject: [PATCH 2/2] =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- v2/swagger.yaml | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/v2/swagger.yaml b/v2/swagger.yaml index 143c6b6..87b38ea 100644 --- a/v2/swagger.yaml +++ b/v2/swagger.yaml @@ -1218,14 +1218,13 @@ paths: **1. Авторизация с использованием сессии:** Для выполнения запросов с использованием сессии необходимо передавать следующие заголовки: - - `x-hrbox-tenant-id: {tenantId}` - - `x-hrbox-device-id: {deviceId}` - `x-hrbox-session-id: {sessionId}` - - `x-hrbox-session-code: {sessionSecret}` - - `x-hrbox-embed: true` + - `x-hrbox-session-code: {sessionSecret}` + + Получить их можно через метод /mobile/auth **2. Авторизация с использованием API-ключа:** - Все запросы должны быть авторизованы с помощью API-ключа, передавая следующие заголовки: + Все запросы должны быть авторизованы с помощью API-ключа, передачей следующих заголовков: - `Content-Type: application/json` - `X-Hrbox-Client-Id: {идентификатор ключа}` - `X-Hrbox-Client-Secret: {секретный ключ}` @@ -1403,20 +1402,19 @@ paths: - SessionAuth: [] - ApiKeyAuth: [] description: | - Возвращает детальную информацию о конкретной заявке, включая связанные данные о процессе, этапах и связанных пользователях. - - Данный метод поддерживает два типа авторизации: сессии и API-ключи. + Возвращает список заявок по указанным фильтрам. + Данный метод поддерживает два типа авторизации: сессии и API-ключи. + **1. Авторизация с использованием сессии:** Для выполнения запросов с использованием сессии необходимо передавать следующие заголовки: - - `x-hrbox-tenant-id: {tenantId}` - - `x-hrbox-device-id: {deviceId}` - `x-hrbox-session-id: {sessionId}` - - `x-hrbox-session-code: {sessionSecret}` - - `x-hrbox-embed: true` + - `x-hrbox-session-code: {sessionSecret}` + + Получить их можно через метод /mobile/auth **2. Авторизация с использованием API-ключа:** - Все запросы должны быть авторизованы с помощью API-ключа, передавая следующие заголовки: + Все запросы должны быть авторизованы с помощью API-ключа, передачей следующих заголовков: - `Content-Type: application/json` - `X-Hrbox-Client-Id: {идентификатор ключа}` - `X-Hrbox-Client-Secret: {секретный ключ}`