Files
uptimesebi/internal/store/querier.go
T
Sebastian UnterschützandClaude Opus 5.5 ee09c497de feat(store): add roles, role assignments, api tokens and invitations
Built-in roles are seeded with fixed ids and are read-only for every org.
Existing non-owner members receive the Viewer role.

Refs #6, #7, #8, #9

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
2026-11-22 00:49:35 +01:00

79 lines
4.5 KiB
Go

// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.31.1
package store
import (
"context"
"github.com/google/uuid"
)
type Querier interface {
APITokenOrg(ctx context.Context, hash []byte) (uuid.UUID, error)
AddMembership(ctx context.Context, arg AddMembershipParams) error
AnyUserExists(ctx context.Context) (bool, error)
CountRoleAssignments(ctx context.Context, roleID uuid.UUID) (int64, error)
CountUnusedRecoveryCodes(ctx context.Context, userID uuid.UUID) (int64, error)
CreateAPIToken(ctx context.Context, arg CreateAPITokenParams) (ApiToken, error)
CreateAssignment(ctx context.Context, arg CreateAssignmentParams) (RoleAssignment, error)
CreateIdentity(ctx context.Context, arg CreateIdentityParams) error
CreateInvitation(ctx context.Context, arg CreateInvitationParams) (Invitation, error)
CreateOrg(ctx context.Context, arg CreateOrgParams) (Org, error)
CreateRole(ctx context.Context, arg CreateRoleParams) (Role, error)
CreateSSOProvider(ctx context.Context, arg CreateSSOProviderParams) (SsoProvider, error)
CreateUser(ctx context.Context, arg CreateUserParams) (User, error)
DeleteAPIToken(ctx context.Context, id uuid.UUID) (int64, error)
DeleteAssignment(ctx context.Context, id uuid.UUID) (int64, error)
DeleteInvitation(ctx context.Context, id uuid.UUID) (int64, error)
DeleteOrg(ctx context.Context, id uuid.UUID) (int64, error)
DeleteRecoveryCodes(ctx context.Context, userID uuid.UUID) error
DeleteRole(ctx context.Context, id uuid.UUID) (int64, error)
DeleteSSOProvider(ctx context.Context, id uuid.UUID) (int64, error)
DeleteUser(ctx context.Context, id uuid.UUID) (int64, error)
DisableTOTP(ctx context.Context, id uuid.UUID) error
EnableTOTP(ctx context.Context, arg EnableTOTPParams) error
GetAPIToken(ctx context.Context, id uuid.UUID) (ApiToken, error)
GetAPITokenByHash(ctx context.Context, tokenHash []byte) (ApiToken, error)
GetAssignment(ctx context.Context, id uuid.UUID) (RoleAssignment, error)
GetIdentity(ctx context.Context, arg GetIdentityParams) (UserIdentity, error)
GetInvitation(ctx context.Context, id uuid.UUID) (Invitation, error)
GetInvitationByHash(ctx context.Context, tokenHash []byte) (GetInvitationByHashRow, error)
GetMembership(ctx context.Context, arg GetMembershipParams) (Membership, error)
GetOrg(ctx context.Context, id uuid.UUID) (Org, error)
GetOrgBySlug(ctx context.Context, slug string) (Org, error)
GetRole(ctx context.Context, id uuid.UUID) (Role, error)
GetSSOProvider(ctx context.Context, id uuid.UUID) (SsoProvider, error)
GetUser(ctx context.Context, id uuid.UUID) (User, error)
GetUserByEmail(ctx context.Context, email string) (User, error)
InsertRecoveryCodes(ctx context.Context, arg []InsertRecoveryCodesParams) (int64, error)
InvitationOrg(ctx context.Context, hash []byte) (uuid.UUID, error)
IsMember(ctx context.Context, arg IsMemberParams) (bool, error)
ListAPITokens(ctx context.Context, arg ListAPITokensParams) ([]ListAPITokensRow, error)
ListAssignments(ctx context.Context, orgID uuid.UUID) ([]ListAssignmentsRow, error)
ListEnabledSSOProviders(ctx context.Context) ([]ListEnabledSSOProvidersRow, error)
ListOrgMembers(ctx context.Context, orgID uuid.UUID) ([]ListOrgMembersRow, error)
ListOrgs(ctx context.Context) ([]Org, error)
ListPendingInvitations(ctx context.Context) ([]ListPendingInvitationsRow, error)
ListRoles(ctx context.Context) ([]Role, error)
ListSSOProviders(ctx context.Context) ([]SsoProvider, error)
ListUserIdentitiesInOrg(ctx context.Context, userID uuid.UUID) ([]ListUserIdentitiesInOrgRow, error)
ListUserOrgs(ctx context.Context, userID uuid.UUID) ([]ListUserOrgsRow, error)
MarkInvitationAccepted(ctx context.Context, id uuid.UUID) (int64, error)
// Every role a member holds, with the scope it applies to.
MemberGrants(ctx context.Context, arg MemberGrantsParams) ([]MemberGrantsRow, error)
OrgIDBySlug(ctx context.Context, slug string) (uuid.UUID, error)
RemoveMembership(ctx context.Context, arg RemoveMembershipParams) (int64, error)
SetPasswordHash(ctx context.Context, arg SetPasswordHashParams) error
SetUserLocale(ctx context.Context, arg SetUserLocaleParams) error
TouchAPIToken(ctx context.Context, id uuid.UUID) error
TouchIdentity(ctx context.Context, arg TouchIdentityParams) error
UpdateOrgPolicy(ctx context.Context, arg UpdateOrgPolicyParams) (Org, error)
UpdateRole(ctx context.Context, arg UpdateRoleParams) (Role, error)
UpdateSSOProvider(ctx context.Context, arg UpdateSSOProviderParams) (SsoProvider, error)
UseRecoveryCode(ctx context.Context, arg UseRecoveryCodeParams) (int64, error)
}
var _ Querier = (*Queries)(nil)