archicore 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +530 -0
- package/dist/analyzers/dead-code.d.ts +95 -0
- package/dist/analyzers/dead-code.js +327 -0
- package/dist/analyzers/duplication.d.ts +90 -0
- package/dist/analyzers/duplication.js +344 -0
- package/dist/analyzers/security.d.ts +79 -0
- package/dist/analyzers/security.js +484 -0
- package/dist/architecture/index.d.ts +35 -0
- package/dist/architecture/index.js +249 -0
- package/dist/cli/commands/analyzers.d.ts +6 -0
- package/dist/cli/commands/analyzers.js +431 -0
- package/dist/cli/commands/export.d.ts +6 -0
- package/dist/cli/commands/export.js +78 -0
- package/dist/cli/commands/index.d.ts +8 -0
- package/dist/cli/commands/index.js +8 -0
- package/dist/cli/commands/init.d.ts +26 -0
- package/dist/cli/commands/init.js +140 -0
- package/dist/cli/commands/interactive.d.ts +7 -0
- package/dist/cli/commands/interactive.js +522 -0
- package/dist/cli/commands/projects.d.ts +6 -0
- package/dist/cli/commands/projects.js +249 -0
- package/dist/cli/index.d.ts +7 -0
- package/dist/cli/index.js +7 -0
- package/dist/cli/ui/box.d.ts +17 -0
- package/dist/cli/ui/box.js +62 -0
- package/dist/cli/ui/colors.d.ts +49 -0
- package/dist/cli/ui/colors.js +86 -0
- package/dist/cli/ui/index.d.ts +9 -0
- package/dist/cli/ui/index.js +9 -0
- package/dist/cli/ui/prompt.d.ts +34 -0
- package/dist/cli/ui/prompt.js +122 -0
- package/dist/cli/ui/spinner.d.ts +29 -0
- package/dist/cli/ui/spinner.js +80 -0
- package/dist/cli/ui/table.d.ts +33 -0
- package/dist/cli/ui/table.js +84 -0
- package/dist/cli/utils/config.d.ts +23 -0
- package/dist/cli/utils/config.js +73 -0
- package/dist/cli/utils/index.d.ts +6 -0
- package/dist/cli/utils/index.js +6 -0
- package/dist/cli/utils/session.d.ts +27 -0
- package/dist/cli/utils/session.js +117 -0
- package/dist/cli.d.ts +8 -0
- package/dist/cli.js +295 -0
- package/dist/code-index/ast-parser.d.ts +16 -0
- package/dist/code-index/ast-parser.js +330 -0
- package/dist/code-index/dependency-graph.d.ts +16 -0
- package/dist/code-index/dependency-graph.js +161 -0
- package/dist/code-index/index.d.ts +44 -0
- package/dist/code-index/index.js +124 -0
- package/dist/code-index/symbol-extractor.d.ts +13 -0
- package/dist/code-index/symbol-extractor.js +150 -0
- package/dist/export/index.d.ts +92 -0
- package/dist/export/index.js +676 -0
- package/dist/github/github-service.d.ts +146 -0
- package/dist/github/github-service.js +609 -0
- package/dist/impact-engine/index.d.ts +25 -0
- package/dist/impact-engine/index.js +284 -0
- package/dist/index.d.ts +60 -0
- package/dist/index.js +149 -0
- package/dist/metrics/index.d.ts +136 -0
- package/dist/metrics/index.js +525 -0
- package/dist/orchestrator/deepseek-optimizer.d.ts +67 -0
- package/dist/orchestrator/deepseek-optimizer.js +320 -0
- package/dist/orchestrator/index.d.ts +34 -0
- package/dist/orchestrator/index.js +305 -0
- package/dist/pr-guardian/index.d.ts +143 -0
- package/dist/pr-guardian/index.js +553 -0
- package/dist/refactoring/index.d.ts +108 -0
- package/dist/refactoring/index.js +580 -0
- package/dist/rules-engine/index.d.ts +129 -0
- package/dist/rules-engine/index.js +482 -0
- package/dist/semantic-memory/embedding-service.d.ts +24 -0
- package/dist/semantic-memory/embedding-service.js +120 -0
- package/dist/semantic-memory/index.d.ts +45 -0
- package/dist/semantic-memory/index.js +206 -0
- package/dist/semantic-memory/vector-store.d.ts +27 -0
- package/dist/semantic-memory/vector-store.js +166 -0
- package/dist/server/index.d.ts +28 -0
- package/dist/server/index.js +141 -0
- package/dist/server/middleware/api-auth.d.ts +43 -0
- package/dist/server/middleware/api-auth.js +256 -0
- package/dist/server/routes/admin.d.ts +5 -0
- package/dist/server/routes/admin.js +123 -0
- package/dist/server/routes/api.d.ts +7 -0
- package/dist/server/routes/api.js +362 -0
- package/dist/server/routes/auth.d.ts +16 -0
- package/dist/server/routes/auth.js +191 -0
- package/dist/server/routes/developer.d.ts +8 -0
- package/dist/server/routes/developer.js +439 -0
- package/dist/server/routes/github.d.ts +7 -0
- package/dist/server/routes/github.js +495 -0
- package/dist/server/routes/upload.d.ts +7 -0
- package/dist/server/routes/upload.js +196 -0
- package/dist/server/services/api-key-service.d.ts +81 -0
- package/dist/server/services/api-key-service.js +281 -0
- package/dist/server/services/auth-service.d.ts +40 -0
- package/dist/server/services/auth-service.js +315 -0
- package/dist/server/services/project-service.d.ts +123 -0
- package/dist/server/services/project-service.js +533 -0
- package/dist/server/services/token-service.d.ts +107 -0
- package/dist/server/services/token-service.js +416 -0
- package/dist/server/services/upload-service.d.ts +93 -0
- package/dist/server/services/upload-service.js +464 -0
- package/dist/types/api.d.ts +188 -0
- package/dist/types/api.js +86 -0
- package/dist/types/github.d.ts +335 -0
- package/dist/types/github.js +5 -0
- package/dist/types/index.d.ts +265 -0
- package/dist/types/index.js +32 -0
- package/dist/types/user.d.ts +69 -0
- package/dist/types/user.js +42 -0
- package/dist/utils/file-utils.d.ts +20 -0
- package/dist/utils/file-utils.js +163 -0
- package/dist/utils/logger.d.ts +17 -0
- package/dist/utils/logger.js +41 -0
- package/dist/watcher/index.d.ts +125 -0
- package/dist/watcher/index.js +397 -0
- package/package.json +71 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitHub Service for ArchiCore
|
|
3
|
+
*
|
|
4
|
+
* Handles OAuth, API calls, webhooks, and repository management
|
|
5
|
+
*/
|
|
6
|
+
import { GitHubUser, GitHubRepository, GitHubBranch, GitHubPullRequest, GitHubConnection, ConnectedRepository, GitHubTokenResponse } from '../types/github.js';
|
|
7
|
+
export declare class GitHubService {
|
|
8
|
+
private dataDir;
|
|
9
|
+
private connections;
|
|
10
|
+
private repositories;
|
|
11
|
+
private initialized;
|
|
12
|
+
private clientId;
|
|
13
|
+
private clientSecret;
|
|
14
|
+
private redirectUri;
|
|
15
|
+
private webhookBaseUrl;
|
|
16
|
+
constructor(dataDir?: string);
|
|
17
|
+
private ensureInitialized;
|
|
18
|
+
private saveConnections;
|
|
19
|
+
private saveRepositories;
|
|
20
|
+
private encrypt;
|
|
21
|
+
private decrypt;
|
|
22
|
+
/**
|
|
23
|
+
* Generate OAuth authorization URL
|
|
24
|
+
*/
|
|
25
|
+
getAuthorizationUrl(state: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* Exchange authorization code for access token
|
|
28
|
+
*/
|
|
29
|
+
exchangeCodeForToken(code: string): Promise<GitHubTokenResponse>;
|
|
30
|
+
/**
|
|
31
|
+
* Get authenticated GitHub user
|
|
32
|
+
*/
|
|
33
|
+
getGitHubUser(accessToken: string): Promise<GitHubUser>;
|
|
34
|
+
/**
|
|
35
|
+
* Save GitHub connection for user
|
|
36
|
+
*/
|
|
37
|
+
saveConnection(userId: string, tokenResponse: GitHubTokenResponse, githubUser: GitHubUser): Promise<GitHubConnection>;
|
|
38
|
+
/**
|
|
39
|
+
* Get connection for user
|
|
40
|
+
*/
|
|
41
|
+
getConnection(userId: string): Promise<GitHubConnection | null>;
|
|
42
|
+
/**
|
|
43
|
+
* Get decrypted access token
|
|
44
|
+
*/
|
|
45
|
+
getAccessToken(userId: string): Promise<string | null>;
|
|
46
|
+
/**
|
|
47
|
+
* Disconnect GitHub
|
|
48
|
+
*/
|
|
49
|
+
disconnect(userId: string): Promise<boolean>;
|
|
50
|
+
/**
|
|
51
|
+
* List user's GitHub repositories
|
|
52
|
+
*/
|
|
53
|
+
listUserRepositories(userId: string): Promise<GitHubRepository[]>;
|
|
54
|
+
/**
|
|
55
|
+
* Get repository details
|
|
56
|
+
*/
|
|
57
|
+
getRepository(userId: string, fullName: string): Promise<GitHubRepository>;
|
|
58
|
+
/**
|
|
59
|
+
* List repository branches
|
|
60
|
+
*/
|
|
61
|
+
listBranches(userId: string, fullName: string): Promise<GitHubBranch[]>;
|
|
62
|
+
/**
|
|
63
|
+
* Connect repository to ArchiCore
|
|
64
|
+
*/
|
|
65
|
+
connectRepository(userId: string, githubRepoId: number, options?: {
|
|
66
|
+
autoAnalyze?: boolean;
|
|
67
|
+
analyzePRs?: boolean;
|
|
68
|
+
projectId?: string;
|
|
69
|
+
}): Promise<ConnectedRepository>;
|
|
70
|
+
/**
|
|
71
|
+
* Disconnect repository
|
|
72
|
+
*/
|
|
73
|
+
disconnectRepository(userId: string, repoId: string): Promise<boolean>;
|
|
74
|
+
/**
|
|
75
|
+
* Get connected repositories for user
|
|
76
|
+
*/
|
|
77
|
+
getConnectedRepositories(userId: string): Promise<ConnectedRepository[]>;
|
|
78
|
+
/**
|
|
79
|
+
* Get connected repository by ID
|
|
80
|
+
*/
|
|
81
|
+
getConnectedRepository(repoId: string): Promise<ConnectedRepository | null>;
|
|
82
|
+
/**
|
|
83
|
+
* Create webhook on repository
|
|
84
|
+
*/
|
|
85
|
+
private createWebhook;
|
|
86
|
+
/**
|
|
87
|
+
* Delete webhook from repository
|
|
88
|
+
*/
|
|
89
|
+
private deleteWebhook;
|
|
90
|
+
/**
|
|
91
|
+
* Verify webhook signature
|
|
92
|
+
*/
|
|
93
|
+
verifyWebhookSignature(payload: string, signature: string, secret: string): boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Find repository by webhook payload
|
|
96
|
+
*/
|
|
97
|
+
findRepositoryByWebhook(fullName: string): Promise<ConnectedRepository | null>;
|
|
98
|
+
/**
|
|
99
|
+
* Get pull request details
|
|
100
|
+
*/
|
|
101
|
+
getPullRequest(userId: string, fullName: string, prNumber: number): Promise<GitHubPullRequest>;
|
|
102
|
+
/**
|
|
103
|
+
* Get pull request files
|
|
104
|
+
*/
|
|
105
|
+
getPullRequestFiles(userId: string, fullName: string, prNumber: number): Promise<Array<{
|
|
106
|
+
filename: string;
|
|
107
|
+
status: string;
|
|
108
|
+
additions: number;
|
|
109
|
+
deletions: number;
|
|
110
|
+
patch?: string;
|
|
111
|
+
}>>;
|
|
112
|
+
/**
|
|
113
|
+
* Post comment on pull request
|
|
114
|
+
*/
|
|
115
|
+
postPRComment(userId: string, fullName: string, prNumber: number, body: string): Promise<{
|
|
116
|
+
id: number;
|
|
117
|
+
html_url: string;
|
|
118
|
+
}>;
|
|
119
|
+
/**
|
|
120
|
+
* Create PR review
|
|
121
|
+
*/
|
|
122
|
+
createPRReview(userId: string, fullName: string, prNumber: number, body: string, event: 'APPROVE' | 'REQUEST_CHANGES' | 'COMMENT'): Promise<{
|
|
123
|
+
id: number;
|
|
124
|
+
}>;
|
|
125
|
+
/**
|
|
126
|
+
* Get file content from repository
|
|
127
|
+
*/
|
|
128
|
+
getFileContent(userId: string, fullName: string, path: string, ref?: string): Promise<string>;
|
|
129
|
+
/**
|
|
130
|
+
* Download repository as zip
|
|
131
|
+
*/
|
|
132
|
+
downloadRepository(userId: string, fullName: string, ref?: string): Promise<Buffer>;
|
|
133
|
+
/**
|
|
134
|
+
* Check if GitHub is configured
|
|
135
|
+
*/
|
|
136
|
+
isConfigured(): boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Update repository status
|
|
139
|
+
*/
|
|
140
|
+
updateRepositoryStatus(repoId: string, status: 'active' | 'syncing' | 'error' | 'disconnected', error?: string): Promise<void>;
|
|
141
|
+
/**
|
|
142
|
+
* Update last analyzed timestamp
|
|
143
|
+
*/
|
|
144
|
+
updateLastAnalyzed(repoId: string): Promise<void>;
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=github-service.d.ts.map
|