|
| 1 | +/** |
| 2 | + * GitHub App installation account info |
| 3 | + */ |
| 4 | +export interface GitHubInstallationAccount { |
| 5 | + /** |
| 6 | + * GitHub account ID |
| 7 | + */ |
| 8 | + id: number; |
| 9 | + /** |
| 10 | + * GitHub account login (username or org name) |
| 11 | + */ |
| 12 | + login: string; |
| 13 | + /** |
| 14 | + * Account type |
| 15 | + */ |
| 16 | + type: 'User' | 'Organization'; |
| 17 | +} |
| 18 | +/** |
| 19 | + * Delegate user for agent operations (e.g. Copilot assignment). |
| 20 | + * Points to a Hawk user who has an active GitHub authorization. |
| 21 | + */ |
| 22 | +export interface GitHubInstallationDelegatedUser { |
| 23 | + /** |
| 24 | + * Hawk user ID of the delegate |
| 25 | + */ |
| 26 | + hawkUserId: string; |
| 27 | + /** |
| 28 | + * GitHub user ID of the delegate |
| 29 | + */ |
| 30 | + githubUserId: number; |
| 31 | + /** |
| 32 | + * GitHub login of the delegate |
| 33 | + */ |
| 34 | + githubLogin: string; |
| 35 | + /** |
| 36 | + * Delegate status: |
| 37 | + * - 'active': delegate has a valid GitHub authorization |
| 38 | + * - 'missing': no workspace member has a GitHub authorization |
| 39 | + * - 'revoked': delegate's GitHub authorization was revoked |
| 40 | + */ |
| 41 | + status: 'active' | 'missing' | 'revoked'; |
| 42 | +} |
| 43 | +/** |
| 44 | + * GitHub App installation record stored at workspace level. |
| 45 | + * |
| 46 | + * GitHub issues installationId per organization/account, not per repository. |
| 47 | + * One workspace can have multiple installations |
| 48 | + * (e.g. client's GitHub org + personal account). |
| 49 | + */ |
| 50 | +export interface GitHubInstallation { |
| 51 | + /** |
| 52 | + * GitHub App installation ID |
| 53 | + */ |
| 54 | + installationId: number; |
| 55 | + /** |
| 56 | + * GitHub account where the App is installed |
| 57 | + */ |
| 58 | + account: GitHubInstallationAccount; |
| 59 | + /** |
| 60 | + * Hawk user ID of who connected this installation (for audit) |
| 61 | + */ |
| 62 | + connectedByHawkUserId: string; |
| 63 | + /** |
| 64 | + * Date when installation was connected |
| 65 | + */ |
| 66 | + connectedAt: Date; |
| 67 | + /** |
| 68 | + * Date when installation record was last updated |
| 69 | + */ |
| 70 | + updatedAt: Date; |
| 71 | + /** |
| 72 | + * Delegate user for agent actions in Worker |
| 73 | + */ |
| 74 | + delegatedUser: GitHubInstallationDelegatedUser; |
| 75 | +} |
| 76 | +/** |
| 77 | + * GitHub integration data stored at workspace level |
| 78 | + */ |
| 79 | +export interface WorkspaceGitHubIntegration { |
| 80 | + /** |
| 81 | + * List of GitHub App installations for this workspace |
| 82 | + */ |
| 83 | + installations: GitHubInstallation[]; |
| 84 | +} |
| 85 | +/** |
| 86 | + * All integrations stored at workspace level |
| 87 | + */ |
| 88 | +export interface WorkspaceIntegrations { |
| 89 | + /** |
| 90 | + * GitHub integration (installations, etc.) |
| 91 | + */ |
| 92 | + github?: WorkspaceGitHubIntegration; |
| 93 | +} |
0 commit comments