2022-05-03 15:26:32 +05:30
|
|
|
package dao
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
|
2022-10-06 20:13:30 +05:30
|
|
|
"go.signoz.io/signoz/pkg/query-service/model"
|
2025-02-18 11:08:09 +05:30
|
|
|
"go.signoz.io/signoz/pkg/types"
|
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
|
|
|
GetGroup(ctx context.Context, id string) (*types.Group, *model.ApiError)
|
2025-02-18 11:08:09 +05:30
|
|
|
GetGroupByName(ctx context.Context, name string) (*types.Group, *model.ApiError)
|
2025-03-06 15:39:45 +05:30
|
|
|
GetGroups(ctx context.Context) ([]types.Group, *model.ApiError)
|
2022-05-03 15:26:32 +05:30
|
|
|
|
2025-03-06 15:39:45 +05:30
|
|
|
GetOrgs(ctx context.Context) ([]types.Organization, *model.ApiError)
|
|
|
|
|
GetOrgByName(ctx context.Context, name string) (*types.Organization, *model.ApiError)
|
|
|
|
|
GetOrg(ctx context.Context, id string) (*types.Organization, *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)
|
|
|
|
|
GetUsersByGroup(ctx context.Context, groupId string) ([]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
|
|
|
|
2023-10-09 21:06:01 +05:30
|
|
|
GetIngestionKeys(ctx context.Context) ([]model.IngestionKey, *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-02-18 11:08:09 +05:30
|
|
|
CreateGroup(ctx context.Context, group *types.Group) (*types.Group, *model.ApiError)
|
2022-05-03 15:26:32 +05:30
|
|
|
DeleteGroup(ctx context.Context, id string) *model.ApiError
|
|
|
|
|
|
2025-03-06 15:39:45 +05:30
|
|
|
CreateOrg(ctx context.Context, org *types.Organization) (*types.Organization, *model.ApiError)
|
|
|
|
|
EditOrg(ctx context.Context, org *types.Organization) *model.ApiError
|
2022-05-03 15:26:32 +05:30
|
|
|
DeleteOrg(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
|
|
|
|
|
UpdateUserGroup(ctx context.Context, userId, groupId string) *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
|
2023-10-09 21:06:01 +05:30
|
|
|
|
|
|
|
|
InsertIngestionKey(ctx context.Context, ingestionKey *model.IngestionKey) *model.ApiError
|
2022-05-03 15:26:32 +05:30
|
|
|
}
|