Skip to content
Closed
Show file tree
Hide file tree
Changes from 5 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
708 changes: 708 additions & 0 deletions api/doc/openapi.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions api/internal/features/extension/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ func (s *ExtensionService) ForkExtension(extensionID string, yamlOverride string
fork.ExtensionType = ext.ExtensionType
fork.Version = ext.Version
fork.IsVerified = false
fork.Featured = false
fork.YAMLContent = yamlOverride
fork.ParsedContent = ext.ParsedContent
fork.ContentHash = ext.ContentHash
Expand Down
5 changes: 3 additions & 2 deletions api/internal/features/extension/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,12 @@ func (s *ExtensionStorage) ListExtensions(params types.ExtensionListParams) (*ty
})
}

// Always sort featured extensions first, then apply user's sort preference
sortColumn := string(params.SortBy)
if params.SortDir == types.SortDirectionDesc {
query = query.Order(sortColumn + " DESC")
query = query.Order("featured DESC").Order(sortColumn + " DESC")
} else {
query = query.Order(sortColumn + " ASC")
query = query.Order("featured DESC").Order(sortColumn + " ASC")
}

var total int
Expand Down
1 change: 1 addition & 0 deletions api/internal/features/extension/tools/list_extensions.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ func convertToMCPExtension(ext shared_types.Extension) MCPExtension {
ExtensionType: ext.ExtensionType,
Version: ext.Version,
IsVerified: ext.IsVerified,
Featured: ext.Featured,
YAMLContent: ext.YAMLContent,
ParsedContent: ext.ParsedContent,
ContentHash: ext.ContentHash,
Expand Down
1 change: 1 addition & 0 deletions api/internal/features/extension/tools/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type MCPExtension struct {
ExtensionType shared_types.ExtensionType `json:"extension_type"`
Version string `json:"version"`
IsVerified bool `json:"is_verified"`
Featured bool `json:"featured"`
YAMLContent string `json:"yaml_content"`
ParsedContent string `json:"parsed_content"`
ContentHash string `json:"content_hash"`
Expand Down
1 change: 1 addition & 0 deletions api/internal/types/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ type Extension struct {
ExtensionType ExtensionType `json:"extension_type" bun:"extension_type,notnull"`
Version string `json:"version" bun:"version"`
IsVerified bool `json:"is_verified" bun:"is_verified,notnull,default:false"`
Featured bool `json:"featured" bun:"featured,notnull,default:false"`
YAMLContent string `json:"yaml_content" bun:"yaml_content,notnull"`
ParsedContent string `json:"parsed_content" bun:"parsed_content,notnull,type:jsonb"`
ContentHash string `json:"content_hash" bun:"content_hash,notnull"`
Expand Down
5 changes: 5 additions & 0 deletions api/migrations/extensions/043_add_featured_column_down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
DROP INDEX IF EXISTS idx_extensions_featured;

ALTER TABLE extensions
DROP COLUMN IF EXISTS featured;

5 changes: 5 additions & 0 deletions api/migrations/extensions/043_add_featured_column_up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ALTER TABLE extensions
ADD COLUMN IF NOT EXISTS featured BOOLEAN NOT NULL DEFAULT false;

CREATE INDEX IF NOT EXISTS idx_extensions_featured ON extensions(featured);
Comment thread
zhravan marked this conversation as resolved.

1 change: 1 addition & 0 deletions view/redux/types/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export interface Extension {
extension_type: ExtensionType;
version: string;
is_verified: boolean;
featured: boolean;
yaml_content: string;
parsed_content: string;
content_hash: string;
Expand Down
Loading