2022-05-03 15:26:32 +05:30
|
|
|
package dao
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
|
2025-03-20 21:01:41 +05:30
|
|
|
"github.com/SigNoz/signoz/pkg/query-service/model"
|
|
|
|
|
"github.com/SigNoz/signoz/pkg/types"
|
2025-04-26 15:50:02 +05:30
|
|
|
"github.com/SigNoz/signoz/pkg/types/authtypes"
|
2022-05-03 15:26:32 +05:30
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type ModelDao interface {
|
|
|
|
|
Queries
|
|
|
|
|
Mutations
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Queries interface {
|
2025-03-06 15:39:45 +05:30
|
|
|
GetInviteFromEmail(ctx context.Context, email string) (*types.Invite, *model.ApiError)
|
|
|
|
|
GetInviteFromToken(ctx context.Context, token string) (*types.Invite, *model.ApiError)
|
|
|
|
|
GetInvites(ctx context.Context, orgID string) ([]types.Invite, *model.ApiError)
|
2022-05-03 15:26:32 +05:30
|
|
|
|
2025-03-06 15:39:45 +05:30
|
|
|
GetUser(ctx context.Context, id string) (*types.GettableUser, *model.ApiError)
|
|
|
|
|
GetUserByEmail(ctx context.Context, email string) (*types.GettableUser, *model.ApiError)
|
|
|
|
|
GetUsers(ctx context.Context) ([]types.GettableUser, *model.ApiError)
|
|
|
|
|
GetUsersWithOpts(ctx context.Context, limit int) ([]types.GettableUser, *model.ApiError)
|
2022-05-03 15:26:32 +05:30
|
|
|
|
2025-03-06 15:39:45 +05:30
|
|
|
GetResetPasswordEntry(ctx context.Context, token string) (*types.ResetPasswordRequest, *model.ApiError)
|
|
|
|
|
GetUsersByOrg(ctx context.Context, orgId string) ([]types.GettableUser, *model.ApiError)
|
2025-04-26 15:50:02 +05:30
|
|
|
GetUsersByRole(ctx context.Context, role authtypes.Role) ([]types.GettableUser, *model.ApiError)
|
2023-07-26 12:27:46 +05:30
|
|
|
|
2025-03-06 15:39:45 +05:30
|
|
|
GetApdexSettings(ctx context.Context, orgID string, services []string) ([]types.ApdexSettings, *model.ApiError)
|
2023-09-12 12:53:46 +05:30
|
|
|
|
|
|
|
|
PrecheckLogin(ctx context.Context, email, sourceUrl string) (*model.PrecheckResponse, model.BaseApiError)
|
2022-05-03 15:26:32 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Mutations interface {
|
2025-03-06 15:39:45 +05:30
|
|
|
CreateInviteEntry(ctx context.Context, req *types.Invite) *model.ApiError
|
|
|
|
|
DeleteInvitation(ctx context.Context, orgID string, email string) *model.ApiError
|
2022-05-03 15:26:32 +05:30
|
|
|
|
2025-03-06 15:39:45 +05:30
|
|
|
CreateUser(ctx context.Context, user *types.User, isFirstUser bool) (*types.User, *model.ApiError)
|
|
|
|
|
EditUser(ctx context.Context, update *types.User) (*types.User, *model.ApiError)
|
2022-05-03 15:26:32 +05:30
|
|
|
DeleteUser(ctx context.Context, id string) *model.ApiError
|
|
|
|
|
|
2025-03-06 15:39:45 +05:30
|
|
|
CreateResetPasswordEntry(ctx context.Context, req *types.ResetPasswordRequest) *model.ApiError
|
2022-05-03 15:26:32 +05:30
|
|
|
DeleteResetPasswordEntry(ctx context.Context, token string) *model.ApiError
|
|
|
|
|
|
|
|
|
|
UpdateUserPassword(ctx context.Context, hash, userId string) *model.ApiError
|
2025-04-26 15:50:02 +05:30
|
|
|
UpdateUserRole(ctx context.Context, userId string, role authtypes.Role) *model.ApiError
|
2023-07-26 12:27:46 +05:30
|
|
|
|
2025-03-06 15:39:45 +05:30
|
|
|
SetApdexSettings(ctx context.Context, orgID string, set *types.ApdexSettings) *model.ApiError
|
2022-05-03 15:26:32 +05:30
|
|
|
}
|