feat(server,web) Semantic import path validation (#7076)

* add library validation api

* chore: open api

* show warning i UI

* add flex row

* fix e2e

* tests

* fix tests

* enforce path validation

* enforce validation on refresh

* return 400 on bad import path

* add limits to import paths

* set response code to 200

* fix e2e

* fix lint

* fix test

* restore e2e folder

* fix import

* use startsWith

* icon color

* notify user of failed validation

* add parent div to validation

* add docs to the import validation

* improve library troubleshooting docs

* fix button alignment

---------

Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
Jonathan Jogenfors
2024-02-20 16:53:12 +01:00
committed by GitHub
parent e7a875eadd
commit b3c7bebbd4
32 changed files with 1472 additions and 75 deletions

View File

@@ -3618,6 +3618,58 @@
]
}
},
"/library/{id}/validate": {
"post": {
"operationId": "validate",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"format": "uuid",
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ValidateLibraryDto"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ValidateLibraryResponseDto"
}
}
},
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"tags": [
"Library"
]
}
},
"/oauth/authorize": {
"post": {
"operationId": "startOAuth",
@@ -10406,6 +10458,52 @@
],
"type": "object"
},
"ValidateLibraryDto": {
"properties": {
"exclusionPatterns": {
"items": {
"type": "string"
},
"type": "array"
},
"importPaths": {
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"ValidateLibraryImportPathResponseDto": {
"properties": {
"importPath": {
"type": "string"
},
"isValid": {
"default": false,
"type": "boolean"
},
"message": {
"type": "string"
}
},
"required": [
"importPath"
],
"type": "object"
},
"ValidateLibraryResponseDto": {
"properties": {
"importPaths": {
"items": {
"$ref": "#/components/schemas/ValidateLibraryImportPathResponseDto"
},
"type": "array"
}
},
"type": "object"
},
"VideoCodec": {
"enum": [
"h264",