@resolveio/server-lib 22.2.5 → 22.2.7
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/managers/customer-notification-content.manager.d.ts +55 -0
- package/managers/customer-notification-content.manager.js +158 -0
- package/managers/customer-notification-content.manager.js.map +1 -0
- package/managers/diagnostic-manager-bootstrap.d.ts +9 -0
- package/managers/diagnostic-manager-bootstrap.js +260 -0
- package/managers/diagnostic-manager-bootstrap.js.map +1 -0
- package/managers/error-auto-fix.manager.d.ts +143 -0
- package/managers/error-auto-fix.manager.js +2934 -0
- package/managers/error-auto-fix.manager.js.map +1 -0
- package/managers/slow-query-verifier.manager.d.ts +114 -0
- package/managers/slow-query-verifier.manager.js +3358 -0
- package/managers/slow-query-verifier.manager.js.map +1 -0
- package/managers/slow-query.manager.d.ts +28 -0
- package/managers/slow-query.manager.js +468 -0
- package/managers/slow-query.manager.js.map +1 -0
- package/methods/customer-notifications.js +77 -9
- package/methods/customer-notifications.js.map +1 -1
- package/package.json +3 -1
- package/public_api.d.ts +7 -0
- package/public_api.js +7 -0
- package/public_api.js.map +1 -1
- package/types/error-report.d.ts +25 -0
- package/types/error-report.js +4 -0
- package/types/error-report.js.map +1 -0
- package/types/slow-query-report.d.ts +27 -0
- package/types/slow-query-report.js +6 -0
- package/types/slow-query-report.js.map +1 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { ErrorReportAttachment, ErrorReportPayload } from '../types/error-report';
|
|
2
|
+
type ErrorAutoFixLogModel = Record<string, any>;
|
|
3
|
+
export interface ErrorAutoFixManagerDependencies {
|
|
4
|
+
Clients?: any;
|
|
5
|
+
ErrorAutoFixLogs: any;
|
|
6
|
+
AICoderApps?: any;
|
|
7
|
+
AIDashboardJobs?: any;
|
|
8
|
+
}
|
|
9
|
+
export declare function registerErrorAutoFixManagerDependencies(dependencies: ErrorAutoFixManagerDependencies): void;
|
|
10
|
+
interface ErrorEmail {
|
|
11
|
+
key: string;
|
|
12
|
+
subject: string;
|
|
13
|
+
body: string;
|
|
14
|
+
from?: string;
|
|
15
|
+
messageId?: string;
|
|
16
|
+
hash?: string;
|
|
17
|
+
rawHash?: string;
|
|
18
|
+
issueHash?: string;
|
|
19
|
+
logId?: string;
|
|
20
|
+
raw: string;
|
|
21
|
+
fromAddress?: string;
|
|
22
|
+
id_client?: string;
|
|
23
|
+
client_name?: string;
|
|
24
|
+
source_type?: 'app' | 'infrastructure' | 'noise';
|
|
25
|
+
classification_reason?: string;
|
|
26
|
+
openai_environment?: string;
|
|
27
|
+
sourceApp?: string;
|
|
28
|
+
sourceEnvironment?: string;
|
|
29
|
+
severity?: string;
|
|
30
|
+
reportedBy?: string;
|
|
31
|
+
reportMetadata?: Record<string, any>;
|
|
32
|
+
reportContext?: Record<string, any>;
|
|
33
|
+
attachments?: ErrorReportAttachment[];
|
|
34
|
+
reportedAt?: Date;
|
|
35
|
+
}
|
|
36
|
+
interface AutoFixResult {
|
|
37
|
+
status: 'skipped' | 'failed' | 'success' | 'in_progress';
|
|
38
|
+
email: ErrorEmail;
|
|
39
|
+
error?: string;
|
|
40
|
+
branchName?: string;
|
|
41
|
+
prUrl?: string;
|
|
42
|
+
log?: ErrorAutoFixLogModel;
|
|
43
|
+
reason?: string;
|
|
44
|
+
summary?: string;
|
|
45
|
+
notes?: string;
|
|
46
|
+
}
|
|
47
|
+
interface ErrorReportIngestResult {
|
|
48
|
+
status: 'queued' | 'skipped' | 'duplicate' | 'ignored' | 'success' | 'failed' | 'in_progress';
|
|
49
|
+
reason?: string;
|
|
50
|
+
log?: ErrorAutoFixLogModel;
|
|
51
|
+
}
|
|
52
|
+
export interface DevErrorReportOptions {
|
|
53
|
+
subject: string;
|
|
54
|
+
body?: string;
|
|
55
|
+
sourceApp?: string;
|
|
56
|
+
environment?: string;
|
|
57
|
+
severity?: string;
|
|
58
|
+
fingerprint?: string;
|
|
59
|
+
idempotencyKey?: string;
|
|
60
|
+
metadata?: Record<string, any>;
|
|
61
|
+
clientId?: string;
|
|
62
|
+
clientName?: string;
|
|
63
|
+
clientSlug?: string;
|
|
64
|
+
}
|
|
65
|
+
export declare class ErrorAutoFixManager {
|
|
66
|
+
private config;
|
|
67
|
+
private _serverConfig;
|
|
68
|
+
private readonly githubApiBase;
|
|
69
|
+
private readonly dashboardMonitors;
|
|
70
|
+
private ready;
|
|
71
|
+
constructor(serverConfig: any, dependencies?: Partial<ErrorAutoFixManagerDependencies>);
|
|
72
|
+
isReady(): boolean;
|
|
73
|
+
validateIngestKey(candidate?: string): boolean;
|
|
74
|
+
private debugLog;
|
|
75
|
+
private resolveConfig;
|
|
76
|
+
private extractEmailAddress;
|
|
77
|
+
private escapeRegex;
|
|
78
|
+
private resolveClientForEnvironment;
|
|
79
|
+
private extractHostFromUrl;
|
|
80
|
+
private resolveClientForReport;
|
|
81
|
+
private determineOpenAIEnvironment;
|
|
82
|
+
private resolveEnvironmentForTask;
|
|
83
|
+
private buildEmailFromReport;
|
|
84
|
+
private classifyEmail;
|
|
85
|
+
private generateRawEmailHash;
|
|
86
|
+
private generateIssueHash;
|
|
87
|
+
private normalizeTextForHash;
|
|
88
|
+
private normalizeBodyForHash;
|
|
89
|
+
private parseRepoTarget;
|
|
90
|
+
private buildWorkBranch;
|
|
91
|
+
private normalizeEmailText;
|
|
92
|
+
private buildContextMarkdown;
|
|
93
|
+
private buildOpenAIComment;
|
|
94
|
+
private formatGithubError;
|
|
95
|
+
private buildGithubAuthHeader;
|
|
96
|
+
private githubRequest;
|
|
97
|
+
private resolveBaseBranch;
|
|
98
|
+
private getBranchSha;
|
|
99
|
+
private ensureBranch;
|
|
100
|
+
private upsertContextFile;
|
|
101
|
+
private findOpenPullRequest;
|
|
102
|
+
private createPullRequest;
|
|
103
|
+
private commentOnPullRequest;
|
|
104
|
+
private reserveLog;
|
|
105
|
+
private markDuplicate;
|
|
106
|
+
private updateLog;
|
|
107
|
+
private getEscalationRecipients;
|
|
108
|
+
private sendEscalationNotice;
|
|
109
|
+
private collectLibraryIssueSignalText;
|
|
110
|
+
private evaluateLibraryIssueGate;
|
|
111
|
+
private sendLibraryIssueNotice;
|
|
112
|
+
private blockLibraryOwnedIssue;
|
|
113
|
+
private shouldNotifySkip;
|
|
114
|
+
private isGeneratedAICoderClient;
|
|
115
|
+
private buildAICoderWorkflowSummary;
|
|
116
|
+
private buildResolveIOProjectWorkflowDetails;
|
|
117
|
+
private buildLocalInternalUserCriteria;
|
|
118
|
+
private buildLocalAdminUserCriteria;
|
|
119
|
+
private resolveLocalNotificationUserIds;
|
|
120
|
+
private notifyCustomerWorkflowStatus;
|
|
121
|
+
private delay;
|
|
122
|
+
reportDevError(options: DevErrorReportOptions): Promise<void>;
|
|
123
|
+
ingestErrorReport(report: ErrorReportPayload): Promise<ErrorReportIngestResult>;
|
|
124
|
+
runLog(logId: string): Promise<AutoFixResult>;
|
|
125
|
+
private buildEmailFromLog;
|
|
126
|
+
private processEmail;
|
|
127
|
+
private shouldFallbackDashboardMethod;
|
|
128
|
+
private createDashboardJob;
|
|
129
|
+
private waitForDashboardJobStop;
|
|
130
|
+
private isDashboardJobRunning;
|
|
131
|
+
private resolveAutoFixApp;
|
|
132
|
+
private buildDashboardAutoFixTitle;
|
|
133
|
+
private buildDashboardAutoFixDescription;
|
|
134
|
+
private evaluateDashboardPublishOutcome;
|
|
135
|
+
private queueDashboardMonitor;
|
|
136
|
+
private monitorDashboardAutoFixJob;
|
|
137
|
+
private dispatchDashboardWorkflow;
|
|
138
|
+
private dispatchGithubWorkflow;
|
|
139
|
+
private notify;
|
|
140
|
+
}
|
|
141
|
+
export declare function ensureErrorAutoFixManager(serverConfig?: any): ErrorAutoFixManager | null;
|
|
142
|
+
export declare function reportDevError(options: DevErrorReportOptions): Promise<void>;
|
|
143
|
+
export {};
|