feat(api): add hidden folders management endpoints to v2 API
Implements three new endpoints for managing repository hidden folders:
- GET /repos/{owner}/{repo}/hidden-folders - list all hidden folders
- PUT /repos/{owner}/{repo}/hidden-folders - add a hidden folder
- DELETE /repos/{owner}/{repo}/hidden-folders - remove a hidden folder
All write operations require repository admin permissions.
This commit is contained in:
20
modules/structs/repo_hidden_folder.go
Normal file
20
modules/structs/repo_hidden_folder.go
Normal file
@@ -0,0 +1,20 @@
|
||||
// Copyright 2026 MarketAlly. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package structs
|
||||
|
||||
// HiddenFolderV2 represents a hidden folder in a repository.
|
||||
type HiddenFolderV2 struct {
|
||||
Path string `json:"path"`
|
||||
CreatedAt int64 `json:"created_at"`
|
||||
}
|
||||
|
||||
// HiddenFolderListV2 is the response for listing hidden folders.
|
||||
type HiddenFolderListV2 struct {
|
||||
Folders []*HiddenFolderV2 `json:"folders"`
|
||||
}
|
||||
|
||||
// HiddenFolderOptionV2 is the request body for adding or removing a hidden folder.
|
||||
type HiddenFolderOptionV2 struct {
|
||||
Path string `json:"path" binding:"Required"`
|
||||
}
|
||||
Reference in New Issue
Block a user