| 1 | package personapi |
| 2 | |
| 3 | import ( |
| 4 | "amadan.net/oficina/equipo/internal/equipo/kernel" |
| 5 | "amadan.net/oficina/equipo/internal/equipo/library" |
| 6 | "amadan.net/oficina/equipo/internal/equipo/planning" |
| 7 | "amadan.net/oficina/equipo/internal/equipo/setup" |
| 8 | "amadan.net/oficina/equipo/internal/runnerproto" |
| 9 | "amadan.net/oficina/equipo/internal/taskplan" |
| 10 | "context" |
| 11 | "gorm.io/gorm" |
| 12 | ) |
| 13 | |
| 14 | type Native struct { |
| 15 | LookupMember func(context.Context, string) (kernel.Member, error) |
| 16 | SettingsUpdate func(context.Context, kernel.Actor, int64, ProjectSettingsInput, kernel.Mutation, bool) (Result, error) |
| 17 | NativeOperations |
| 18 | Devices func() *DeviceStore |
| 19 | ReadTeam func(context.Context, kernel.Actor, func(*gorm.DB, kernel.Team) error) error |
| 20 | Owner func(*gorm.DB, kernel.Actor) error |
| 21 | Copy func(string) string |
| 22 | Invalid, Forbidden, NotFound, Conflict, Unavailable error |
| 23 | } |
| 24 | type NativeOperations interface { |
| 25 | BeginPersonDevice(context.Context, string, string, string) (PersonDeviceChallenge, error) |
| 26 | ApprovePersonDevice(context.Context, kernel.Actor, string, string, kernel.Mutation) error |
| 27 | ExchangePersonDevice(context.Context, PersonDeviceProof) (PersonCredential, error) |
| 28 | RevokePersonDevice(context.Context, kernel.Actor, string, kernel.Mutation) error |
| 29 | SetMember(context.Context, kernel.Actor, string, kernel.Role, bool, int64) error |
| 30 | SaveBudgets(context.Context, kernel.Actor, kernel.BudgetConfig) error |
| 31 | RememberTeam(context.Context, kernel.Actor, setup.TeamLink, kernel.Mutation) (setup.TeamLink, error) |
| 32 | ForgetTeam(context.Context, kernel.Actor, string, kernel.Mutation) error |
| 33 | TeamLinks(context.Context, kernel.Actor) ([]setup.TeamLink, error) |
| 34 | SaveAccount(context.Context, kernel.Actor, kernel.Account) (kernel.Account, error) |
| 35 | SaveProject(context.Context, kernel.Actor, kernel.Project, []kernel.DecisionOwner, string) (kernel.Project, error) |
| 36 | SetProjectApproval(context.Context, kernel.Actor, int64, planning.ApprovalMode, kernel.Mutation) error |
| 37 | SetApprovalOverride(context.Context, kernel.Actor, int64, *planning.ApprovalMode, kernel.Mutation) error |
| 38 | SetPlaybookDefault(context.Context, kernel.Actor, int64, taskplan.Kind, string, kernel.Mutation) error |
| 39 | CreateSpecialist(context.Context, kernel.Actor, library.SpecialistInput, kernel.Mutation) (library.Specialist, error) |
| 40 | UpdateSpecialist(context.Context, kernel.Actor, library.SpecialistInput, kernel.Mutation) (library.Specialist, error) |
| 41 | DeleteSpecialist(context.Context, kernel.Actor, string, kernel.Mutation) error |
| 42 | Specialist(context.Context, kernel.Actor, string) (library.Specialist, error) |
| 43 | ListSpecialists(context.Context, kernel.Actor) ([]library.Specialist, error) |
| 44 | SpecialistTemplates(context.Context, kernel.Actor) ([]library.Template, error) |
| 45 | SpecialistTemplateDiff(context.Context, kernel.Actor, string, library.TemplateRef) (library.TemplateDiff, error) |
| 46 | ApplySpecialistTemplate(context.Context, kernel.Actor, string, library.TemplateDiff, []string, kernel.Mutation) (library.Specialist, error) |
| 47 | InstallSpecialistTemplate(context.Context, kernel.Actor, library.TemplateRef, kernel.Mutation) (library.Specialist, error) |
| 48 | Playbooks(context.Context, kernel.Actor) ([]library.Playbook, error) |
| 49 | Playbook(context.Context, kernel.Actor, string) (library.Playbook, error) |
| 50 | SavePlaybook(context.Context, kernel.Actor, library.PlaybookInput, kernel.Mutation) (library.Playbook, error) |
| 51 | DeletePlaybook(context.Context, kernel.Actor, string, kernel.Mutation) error |
| 52 | InstallPlaybookTemplate(context.Context, kernel.Actor, library.TemplateRef, kernel.Mutation) (library.Playbook, error) |
| 53 | PlaybookTemplateDiff(context.Context, kernel.Actor, string, library.TemplateRef) (library.TemplateDiff, error) |
| 54 | ApplyPlaybookTemplate(context.Context, kernel.Actor, string, library.TemplateDiff, []string, kernel.Mutation) (library.Playbook, error) |
| 55 | RenameConnection(context.Context, kernel.Actor, string, string, kernel.Mutation) error |
| 56 | RevokeConnection(context.Context, kernel.Actor, string, kernel.Mutation) error |
| 57 | Connections(context.Context, kernel.Actor) ([]planning.Connection, error) |
| 58 | SaveConnectionChoice(context.Context, kernel.Actor, planning.ConnectionChoice) error |
| 59 | ConfirmPlanSelection(context.Context, kernel.Actor, string, string, string, string, kernel.Mutation) (runnerproto.Selection, error) |
| 60 | ApproveEnrolment(context.Context, kernel.Actor, string) error |
| 61 | RevokeRunner(context.Context, kernel.Actor, string, int64) error |
| 62 | Onboarding(context.Context, kernel.Actor) (setup.OnboardingState, error) |
| 63 | StartOnboardingTask(context.Context, kernel.Actor, int64, kernel.Mutation) (taskplan.Plan, error) |
| 64 | ChooseOnboardingProvider(context.Context, kernel.Actor, string, kernel.Mutation) (setup.OnboardingState, error) |
| 65 | AdvanceOnboarding(context.Context, kernel.Actor, string, kernel.Mutation) (setup.OnboardingState, error) |
| 66 | RequestAccountSetup(context.Context, kernel.Actor, string, string, string, kernel.Mutation) (runnerproto.AccountSetup, error) |
| 67 | AccountSetup(context.Context, kernel.Actor, string) (runnerproto.AccountSetup, error) |
| 68 | CancelAccountSetup(context.Context, kernel.Actor, string, kernel.Mutation) error |
| 69 | CreateInvitation(context.Context, kernel.Actor, string, kernel.Role, kernel.Mutation) (setup.Invitation, error) |
| 70 | AcceptInvitation(context.Context, kernel.Actor, string, string, kernel.Mutation) (kernel.Member, error) |
| 71 | RevokeInvitation(context.Context, kernel.Actor, string, kernel.Mutation) error |
| 72 | InvitationSummary(context.Context, kernel.Actor, string) (setup.Invitation, error) |
| 73 | } |
| 74 | |