| | | 1 | | namespace Anichron.API.Infrastructure; |
| | | 2 | | |
| | | 3 | | internal static class ApiPaths |
| | | 4 | | { |
| | | 5 | | internal const string Root = "/api"; |
| | | 6 | | internal const string Base = $"{Root}/v1"; |
| | | 7 | | internal const string Healthz = $"{Base}/healthz"; |
| | | 8 | | |
| | 307 | 9 | | internal static bool IsApi(PathString path) => path.StartsWithSegments(Root); |
| | | 10 | | |
| | | 11 | | internal static class Auth |
| | | 12 | | { |
| | | 13 | | internal const string Group = "auth"; |
| | | 14 | | internal const string Register = "/register"; |
| | | 15 | | internal const string Login = "/login"; |
| | | 16 | | internal const string LoginMobile = "/login/mobile"; |
| | | 17 | | internal const string Refresh = "/refresh"; |
| | | 18 | | internal const string Logout = "/logout"; |
| | | 19 | | internal const string PasswordResetRequest = "/password-reset/request"; |
| | | 20 | | internal const string PasswordResetConfirm = "/password-reset/confirm"; |
| | | 21 | | } |
| | | 22 | | |
| | | 23 | | internal static class Users |
| | | 24 | | { |
| | | 25 | | internal const string Group = "users"; |
| | | 26 | | internal const string Me = "/me"; |
| | | 27 | | internal const string ChangePassword = $"{Me}/password"; |
| | | 28 | | internal const string StorageConfigs = "storage-configs"; |
| | | 29 | | |
| | | 30 | | internal const string ById = "{userId:guid}"; |
| | | 31 | | internal const string PasswordReset = "{userId:guid}/password-reset"; |
| | | 32 | | internal const string UserStorageConfigs = $"{{userId:guid}}/{StorageConfigs}"; |
| | | 33 | | internal const string UserStorageConfigById = $"{{userId:guid}}/{StorageConfigs}/{{configId:guid}}"; |
| | | 34 | | |
| | | 35 | | internal static string UserLocation(Guid userId) |
| | 1 | 36 | | => $"{Base}/{Group}/{userId}"; |
| | | 37 | | |
| | | 38 | | internal static string StorageConfigLocation(Guid userId, Guid configId) |
| | 1 | 39 | | => $"{Base}/{Group}/{userId}/{StorageConfigs}/{configId}"; |
| | | 40 | | } |
| | | 41 | | |
| | | 42 | | internal static class Assets |
| | | 43 | | { |
| | | 44 | | internal const string Group = "assets"; |
| | | 45 | | internal const string Interaction = "{assetId:guid}/interaction"; |
| | | 46 | | internal const string Hidden = "hidden"; |
| | | 47 | | } |
| | | 48 | | |
| | | 49 | | internal static class Proxies |
| | | 50 | | { |
| | | 51 | | internal const string Group = "proxies"; |
| | | 52 | | internal const string Proxy = "{assetId:guid}/{type}"; |
| | | 53 | | |
| | | 54 | | internal static string ProxyUrl(Guid assetId, string type, string contentHash) |
| | 27 | 55 | | => $"{Group}/{assetId}/{type}?v={contentHash}"; |
| | | 56 | | } |
| | | 57 | | |
| | | 58 | | internal static class WorkItems |
| | | 59 | | { |
| | | 60 | | internal const string Group = "admin/work-items"; |
| | | 61 | | internal const string ById = "{workItemId:guid}"; |
| | | 62 | | internal const string Events = "events"; |
| | | 63 | | internal const string Cancel = $"{ById}/cancel"; |
| | | 64 | | |
| | | 65 | | internal static string ItemLocation(Guid workItemId) |
| | 3 | 66 | | => $"{Base}/{Group}/{workItemId}"; |
| | | 67 | | } |
| | | 68 | | |
| | | 69 | | internal static class ProxySweeps |
| | | 70 | | { |
| | | 71 | | internal const string Group = "admin/proxy-sweeps"; |
| | | 72 | | internal const string Orphans = "{sweepId:guid}/orphans"; |
| | | 73 | | internal const string Deletions = "{sweepId:guid}/deletions"; |
| | | 74 | | } |
| | | 75 | | |
| | | 76 | | internal static class Bursts |
| | | 77 | | { |
| | | 78 | | internal const string Group = "bursts"; |
| | | 79 | | internal const string Members = "{burstId:guid}/assets"; |
| | | 80 | | } |
| | | 81 | | |
| | | 82 | | internal static class Flashbacks |
| | | 83 | | { |
| | | 84 | | internal const string Group = "flashbacks"; |
| | | 85 | | internal const string OnThisDay = "/on-this-day"; |
| | | 86 | | } |
| | | 87 | | } |