Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (s *ProjectService) FindProjectByPublicID(ctx context.Context, publicID str
}

// FindProjects retrieves a list of projects based on a filter and pagination.
func (s *ProjectService) FindProjects(ctx context.Context, filter ProjectFilter, pagination *query.Pagination) ([]*Project, error) {
func (s *ProjectService) Find(ctx context.Context, filter ProjectFilter, pagination *query.Pagination) ([]*Project, error) {
return s.repo.FindByFilter(ctx, filter, pagination)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ package openai
type ObjectKey string

const (
OrganizationAdminApiKey ObjectKey = "organization.admin_api_key"
ObjectKeyAdminApiKey ObjectKey = "organization.admin_api_key"
ObjectKeyProject ObjectKey = "organization.project"
)

type OwnerType string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"menlo.ai/jan-api-gateway/app/interfaces/http/routes/v1/mcp"
mcp_impl "menlo.ai/jan-api-gateway/app/interfaces/http/routes/v1/mcp/mcp_impl"
"menlo.ai/jan-api-gateway/app/interfaces/http/routes/v1/organization"
"menlo.ai/jan-api-gateway/app/interfaces/http/routes/v1/organization/projects"
)

var RouteProvider = wire.NewSet(
Expand All @@ -23,6 +24,7 @@ var RouteProvider = wire.NewSet(
janV1Auth.NewAuthRoute,
janV1.NewV1Route,
jan.NewJanRoute,
projects.NewProjectsRoute,
organization.NewAdminApiKeyAPI,
organization.NewOrganizationRoute,
mcp_impl.NewSerperMCP,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ func domainToOrganizationAdminAPIKeyResponse(entity *apikey.ApiKey) Organization
lastUsedAt = ptr.ToInt64(entity.LastUsedAt.Unix())
}
return OrganizationAdminAPIKeyResponse{
Object: string(openai.OrganizationAdminApiKey),
Object: string(openai.ObjectKeyAdminApiKey),
ID: entity.PublicID,
Name: entity.Description,
RedactedValue: entity.PlaintextHint,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,23 @@ package organization

import (
"github.com/gin-gonic/gin"
"menlo.ai/jan-api-gateway/app/interfaces/http/routes/v1/organization/projects"
)

type OrganizationRoute struct {
adminApiKeyAPI *AdminApiKeyAPI
projectsRoute *projects.ProjectsRoute
}

func NewOrganizationRoute(adminApiKeyAPI *AdminApiKeyAPI) *OrganizationRoute {
func NewOrganizationRoute(adminApiKeyAPI *AdminApiKeyAPI, projectsRoute *projects.ProjectsRoute) *OrganizationRoute {
return &OrganizationRoute{
adminApiKeyAPI,
projectsRoute,
}
}

func (organizationRoute *OrganizationRoute) RegisterRouter(router gin.IRouter) {
organizationRouter := router.Group("/organization")
organizationRoute.adminApiKeyAPI.RegisterRouter(organizationRouter)
organizationRoute.projectsRoute.RegisterRouter(organizationRouter)
}
Loading
Loading