Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .cursorrules
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Shiori Test Commands

# Run the entire test suite
make unittest

# Run SQLite database tests only
go test -timeout 10s -count=1 -tags test_sqlite_only ./internal/database
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
e2e-report.html

# Dist files
dist/
/dist

# macOS trash files
.DS_Store
Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,12 @@ clean:
## Runs server for local development
.PHONY: run-server
run-server: generate
GIN_MODE=$(GIN_MODE) SHIORI_DEVELOPMENT=$(SHIORI_DEVELOPMENT) SHIORI_DIR=$(SHIORI_DIR) SHIORI_HTTP_SECRET_KEY=shiori SHIORI_HTTP_SERVE_SWAGGER=true go run main.go server --log-level debug
GIN_MODE=$(GIN_MODE) SHIORI_DEVELOPMENT=$(SHIORI_DEVELOPMENT) go run main.go server --log-level debug

## Runs server for local development with v2 web UI
.PHONY: run-server-v2
run-server-v2: generate
GIN_MODE=$(GIN_MODE) SHIORI_DEVELOPMENT=$(SHIORI_DEVELOPMENT) SHIORI_HTTP_SERVE_WEB_UI_V2=true go run main.go server --log-level debug

## Generate swagger docs
.PHONY: swagger
Expand Down
130 changes: 130 additions & 0 deletions docs/swagger/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,119 @@ const docTemplate = `{
}
}
},
"/api/v1/bookmarks/{id}/tags": {
"get": {
"produces": [
"application/json"
],
"tags": [
"Auth"
],
"summary": "Get tags for a bookmark.",
"parameters": [
{
"type": "integer",
"description": "Bookmark ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/model.TagDTO"
}
}
},
"403": {
"description": "Token not provided/invalid"
},
"404": {
"description": "Bookmark not found"
}
}
},
"post": {
"produces": [
"application/json"
],
"tags": [
"Auth"
],
"summary": "Add a tag to a bookmark.",
"parameters": [
{
"type": "integer",
"description": "Bookmark ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Add Tag Payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/api_v1.bookmarkTagPayload"
}
}
],
"responses": {
"200": {
"description": "OK"
},
"403": {
"description": "Token not provided/invalid"
},
"404": {
"description": "Bookmark or tag not found"
}
}
},
"delete": {
"produces": [
"application/json"
],
"tags": [
"Auth"
],
"summary": "Remove a tag from a bookmark.",
"parameters": [
{
"type": "integer",
"description": "Bookmark ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Remove Tag Payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/api_v1.bookmarkTagPayload"
}
}
],
"responses": {
"200": {
"description": "OK"
},
"403": {
"description": "Token not provided/invalid"
},
"404": {
"description": "Bookmark not found"
}
}
}
},
"/api/v1/system/info": {
"get": {
"description": "Get general system information like Shiori version, database, and OS",
Expand Down Expand Up @@ -429,6 +542,12 @@ const docTemplate = `{
"description": "Filter tags by bookmark ID",
"name": "bookmark_id",
"in": "query"
},
{
"type": "string",
"description": "Search tags by name",
"name": "search",
"in": "query"
}
],
"responses": {
Expand Down Expand Up @@ -612,6 +731,17 @@ const docTemplate = `{
}
},
"definitions": {
"api_v1.bookmarkTagPayload": {
"type": "object",
"required": [
"tag_id"
],
"properties": {
"tag_id": {
"type": "integer"
}
}
},
"api_v1.bulkUpdateBookmarkTagsPayload": {
"type": "object",
"required": [
Expand Down
130 changes: 130 additions & 0 deletions docs/swagger/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,119 @@
}
}
},
"/api/v1/bookmarks/{id}/tags": {
"get": {
"produces": [
"application/json"
],
"tags": [
"Auth"
],
"summary": "Get tags for a bookmark.",
"parameters": [
{
"type": "integer",
"description": "Bookmark ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/model.TagDTO"
}
}
},
"403": {
"description": "Token not provided/invalid"
},
"404": {
"description": "Bookmark not found"
}
}
},
"post": {
"produces": [
"application/json"
],
"tags": [
"Auth"
],
"summary": "Add a tag to a bookmark.",
"parameters": [
{
"type": "integer",
"description": "Bookmark ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Add Tag Payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/api_v1.bookmarkTagPayload"
}
}
],
"responses": {
"200": {
"description": "OK"
},
"403": {
"description": "Token not provided/invalid"
},
"404": {
"description": "Bookmark or tag not found"
}
}
},
"delete": {
"produces": [
"application/json"
],
"tags": [
"Auth"
],
"summary": "Remove a tag from a bookmark.",
"parameters": [
{
"type": "integer",
"description": "Bookmark ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Remove Tag Payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/api_v1.bookmarkTagPayload"
}
}
],
"responses": {
"200": {
"description": "OK"
},
"403": {
"description": "Token not provided/invalid"
},
"404": {
"description": "Bookmark not found"
}
}
}
},
"/api/v1/system/info": {
"get": {
"description": "Get general system information like Shiori version, database, and OS",
Expand Down Expand Up @@ -418,6 +531,12 @@
"description": "Filter tags by bookmark ID",
"name": "bookmark_id",
"in": "query"
},
{
"type": "string",
"description": "Search tags by name",
"name": "search",
"in": "query"
}
],
"responses": {
Expand Down Expand Up @@ -601,6 +720,17 @@
}
},
"definitions": {
"api_v1.bookmarkTagPayload": {
"type": "object",
"required": [
"tag_id"
],
"properties": {
"tag_id": {
"type": "integer"
}
}
},
"api_v1.bulkUpdateBookmarkTagsPayload": {
"type": "object",
"required": [
Expand Down
Loading
Loading