From e30ef54a6a202c6c684025c7e1b9de98445c4f18 Mon Sep 17 00:00:00 2001 From: Filip Michalski Date: Wed, 13 Nov 2024 19:28:27 +0100 Subject: [PATCH] Update openApi definition --- .../ui/api/ProcessesResourcesSpec.scala | 4 +- docs-internal/api/nu-designer-openapi.yaml | 487 ++++++++++++++++++ 2 files changed, 490 insertions(+), 1 deletion(-) diff --git a/designer/server/src/test/scala/pl/touk/nussknacker/ui/api/ProcessesResourcesSpec.scala b/designer/server/src/test/scala/pl/touk/nussknacker/ui/api/ProcessesResourcesSpec.scala index 9a3bc3c9388..c4e15c004ef 100644 --- a/designer/server/src/test/scala/pl/touk/nussknacker/ui/api/ProcessesResourcesSpec.scala +++ b/designer/server/src/test/scala/pl/touk/nussknacker/ui/api/ProcessesResourcesSpec.scala @@ -52,6 +52,7 @@ import pl.touk.nussknacker.ui.config.scenariotoolbar.ToolbarPanelTypeConfig.{ CreatorPanel, ProcessActionsPanel, SearchPanel, + StickyNotesPanel, TipsPanel } import pl.touk.nussknacker.ui.process.ProcessService.{CreateScenarioCommand, UpdateScenarioCommand} @@ -1225,7 +1226,8 @@ class ProcessesResourcesSpec List( ToolbarPanel(SearchPanel, None, None, None), ToolbarPanel(TipsPanel, None, None, None), - ToolbarPanel(CreatorPanel, None, None, None) + ToolbarPanel(CreatorPanel, None, None, None), + ToolbarPanel(StickyNotesPanel, None, None, None) ), List(), List( diff --git a/docs-internal/api/nu-designer-openapi.yaml b/docs-internal/api/nu-designer-openapi.yaml index 215692d8583..d683db7b012 100644 --- a/docs-internal/api/nu-designer-openapi.yaml +++ b/docs-internal/api/nu-designer-openapi.yaml @@ -2527,6 +2527,394 @@ paths: security: - {} - httpAuth: [] + /api/processes/{scenarioName}/stickyNotes: + get: + tags: + - StickyNotes + summary: Returns sticky nodes for given scenario with version + operationId: getApiProcessesScenarionameStickynotes + parameters: + - name: Nu-Impersonate-User-Identity + in: header + required: false + schema: + type: + - string + - 'null' + - name: scenarioName + in: path + required: true + schema: + type: string + - name: scenarioVersionId + in: query + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/StickyNote' + examples: + Example: + summary: List of valid sticky notes returned for scenario + value: + - noteId: 1 + content: "##Title \nNote1" + layoutData: + x: 20 + y: 30 + color: '#99aa20' + dimensions: + width: 300 + height: 200 + editedBy: Marco + editedAt: '1970-01-21T00:35:36.602Z' + - noteId: 2 + content: "##Title \nNote1" + layoutData: + x: 20 + y: 30 + color: '#99aa20' + dimensions: + width: 300 + height: 200 + editedBy: Marco + editedAt: '1970-01-21T00:35:36.602Z' + '400': + description: 'Invalid value for: header Nu-Impersonate-User-Identity, Invalid + value for: query parameter scenarioVersionId' + content: + text/plain: + schema: + type: string + '401': + description: '' + content: + text/plain: + schema: + type: string + examples: + CannotAuthenticateUser: + value: The supplied authentication is invalid + ImpersonatedUserNotExistsError: + value: No impersonated user data found for provided identity + '403': + description: '' + content: + text/plain: + schema: + type: string + examples: + InsufficientPermission: + value: The supplied authentication is not authorized to access this + resource + ImpersonationMissingPermission: + value: The supplied authentication is not authorized to impersonate + '404': + description: '' + content: + text/plain: + schema: + type: string + examples: + Example: + summary: No scenario {scenarioName} found + value: No scenario s1 found + '501': + description: Impersonation is not supported for defined authentication mechanism + content: + text/plain: + schema: + type: string + examples: + Example: + summary: Cannot authenticate impersonated user as impersonation + is not supported by the authentication mechanism + value: Provided authentication method does not support impersonation + security: + - {} + - httpAuth: [] + put: + tags: + - StickyNotes + summary: Creates new sticky note with given content + operationId: putApiProcessesScenarionameStickynotes + parameters: + - name: Nu-Impersonate-User-Identity + in: header + required: false + schema: + type: + - string + - 'null' + - name: scenarioName + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StickyNoteAddRequest' + example: + scenarioVersionId: 1 + content: '' + layoutData: + x: 12 + y: 33 + color: '#441022' + dimensions: + width: 300 + height: 200 + required: true + responses: + '200': + description: '' + content: + application/json: + schema: + type: string + format: uuid + '400': + description: 'Invalid value for: header Nu-Impersonate-User-Identity, Invalid + value for: body' + content: + text/plain: + schema: + type: string + '401': + description: '' + content: + text/plain: + schema: + type: string + examples: + CannotAuthenticateUser: + value: The supplied authentication is invalid + ImpersonatedUserNotExistsError: + value: No impersonated user data found for provided identity + '403': + description: '' + content: + text/plain: + schema: + type: string + examples: + InsufficientPermission: + value: The supplied authentication is not authorized to access this + resource + ImpersonationMissingPermission: + value: The supplied authentication is not authorized to impersonate + '404': + description: '' + content: + text/plain: + schema: + type: string + examples: + Example: + summary: No scenario {scenarioName} found + value: No scenario s1 found + '501': + description: Impersonation is not supported for defined authentication mechanism + content: + text/plain: + schema: + type: string + examples: + Example: + summary: Cannot authenticate impersonated user as impersonation + is not supported by the authentication mechanism + value: Provided authentication method does not support impersonation + security: + - {} + - httpAuth: [] + post: + tags: + - StickyNotes + summary: Updates sticky note with new values + operationId: postApiProcessesScenarionameStickynotes + parameters: + - name: Nu-Impersonate-User-Identity + in: header + required: false + schema: + type: + - string + - 'null' + - name: scenarioName + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StickyNoteUpdateRequest' + example: + noteId: 1 + scenarioVersionId: 1 + content: '' + layoutData: + x: 12 + y: 33 + color: '#441022' + dimensions: + width: 300 + height: 200 + required: true + responses: + '200': + description: '' + '400': + description: 'Invalid value for: header Nu-Impersonate-User-Identity, Invalid + value for: body' + content: + text/plain: + schema: + type: string + '401': + description: '' + content: + text/plain: + schema: + type: string + examples: + CannotAuthenticateUser: + value: The supplied authentication is invalid + ImpersonatedUserNotExistsError: + value: No impersonated user data found for provided identity + '403': + description: '' + content: + text/plain: + schema: + type: string + examples: + InsufficientPermission: + value: The supplied authentication is not authorized to access this + resource + ImpersonationMissingPermission: + value: The supplied authentication is not authorized to impersonate + '404': + description: '' + content: + text/plain: + schema: + anyOf: + - type: string + - type: string + examples: + Example: + summary: 'No sticky note with id: 3 was found' + value: 'No sticky note with id: StickyNoteId(3) was found' + '501': + description: Impersonation is not supported for defined authentication mechanism + content: + text/plain: + schema: + type: string + examples: + Example: + summary: Cannot authenticate impersonated user as impersonation + is not supported by the authentication mechanism + value: Provided authentication method does not support impersonation + security: + - {} + - httpAuth: [] + /api/processes/{scenarioName}/stickyNotes/{noteId}: + delete: + tags: + - StickyNotes + summary: Deletes stickyNote by given noteId + operationId: deleteApiProcessesScenarionameStickynotesNoteid + parameters: + - name: Nu-Impersonate-User-Identity + in: header + required: false + schema: + type: + - string + - 'null' + - name: scenarioName + in: path + required: true + schema: + type: string + - name: noteId + in: path + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: '' + '400': + description: 'Invalid value for: header Nu-Impersonate-User-Identity, Invalid + value for: path parameter noteId' + content: + text/plain: + schema: + type: string + '401': + description: '' + content: + text/plain: + schema: + type: string + examples: + CannotAuthenticateUser: + value: The supplied authentication is invalid + ImpersonatedUserNotExistsError: + value: No impersonated user data found for provided identity + '403': + description: '' + content: + text/plain: + schema: + type: string + examples: + InsufficientPermission: + value: The supplied authentication is not authorized to access this + resource + ImpersonationMissingPermission: + value: The supplied authentication is not authorized to impersonate + '404': + description: '' + content: + text/plain: + schema: + anyOf: + - type: string + - type: string + examples: + Example: + summary: No scenario {scenarioName} found + value: No scenario s1 found + '501': + description: Impersonation is not supported for defined authentication mechanism + content: + text/plain: + schema: + type: string + examples: + Example: + summary: Cannot authenticate impersonated user as impersonation + is not supported by the authentication mechanism + value: Provided authentication method does not support impersonation + security: + - {} + - httpAuth: [] /api/scenarioTesting/{scenarioName}/adhoc/validate: post: tags: @@ -5098,6 +5486,19 @@ components: properties: dictId: type: string + Dimensions: + title: Dimensions + type: object + required: + - width + - height + properties: + width: + type: integer + format: int64 + height: + type: integer + format: int64 DisplayableUser: title: DisplayableUser type: object @@ -6775,6 +7176,92 @@ components: type: string enum: - ERROR + StickyNote: + title: StickyNote + type: object + required: + - noteId + - content + - layoutData + - color + - dimensions + - editedBy + - editedAt + properties: + noteId: + type: integer + format: int64 + content: + type: string + layoutData: + $ref: '#/components/schemas/LayoutData' + color: + type: string + dimensions: + $ref: '#/components/schemas/Dimensions' + targetEdge: + type: + - string + - 'null' + editedBy: + type: string + editedAt: + type: string + format: date-time + StickyNoteAddRequest: + title: StickyNoteAddRequest + type: object + required: + - scenarioVersionId + - content + - layoutData + - color + - dimensions + properties: + scenarioVersionId: + type: integer + format: int64 + content: + type: string + layoutData: + $ref: '#/components/schemas/LayoutData' + color: + type: string + dimensions: + $ref: '#/components/schemas/Dimensions' + targetEdge: + type: + - string + - 'null' + StickyNoteUpdateRequest: + title: StickyNoteUpdateRequest + type: object + required: + - noteId + - scenarioVersionId + - content + - layoutData + - color + - dimensions + properties: + noteId: + type: integer + format: int64 + scenarioVersionId: + type: integer + format: int64 + content: + type: string + layoutData: + $ref: '#/components/schemas/LayoutData' + color: + type: string + dimensions: + $ref: '#/components/schemas/Dimensions' + targetEdge: + type: + - string + - 'null' StringParameterEditor: title: StringParameterEditor type: object