@oneuptime/common 15.0.0 → 16.0.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/Models/DatabaseModels/AIAgent.js +2 -0
- package/Models/DatabaseModels/AIAgentTaskPullRequest.d.mts +2 -0
- package/Models/DatabaseModels/AIAgentTaskPullRequest.d.ts +2 -0
- package/Models/DatabaseModels/AIAgentTaskPullRequest.js +62 -0
- package/Models/DatabaseModels/AIRun.d.mts +2 -0
- package/Models/DatabaseModels/AIRun.d.ts +2 -0
- package/Models/DatabaseModels/AIRun.js +63 -0
- package/Models/DatabaseModels/CustomNotificationChannel.js +17 -9
- package/Models/DatabaseModels/DataProduct.js +3 -2
- package/Models/DatabaseModels/GlobalConfig.js +1 -1
- package/Models/DatabaseModels/IoTDeviceCredential.js +3 -1
- package/Models/DatabaseModels/Monitor.d.mts +4 -0
- package/Models/DatabaseModels/Monitor.d.ts +4 -0
- package/Models/DatabaseModels/Monitor.js +108 -5
- package/Models/DatabaseModels/NetworkDevice.js +43 -17
- package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js +38 -15
- package/Models/DatabaseModels/NetworkSnmpCredentialProfile.js +4 -4
- package/Models/DatabaseModels/OpenStackProjectNotice.js +29 -10
- package/Models/DatabaseModels/Probe.js +2 -0
- package/Models/DatabaseModels/ProjectSCIM.d.mts +2 -1
- package/Models/DatabaseModels/ProjectSCIM.d.ts +2 -1
- package/Models/DatabaseModels/ProjectSCIM.js +21 -9
- package/Models/DatabaseModels/Runbook.js +3 -2
- package/Models/DatabaseModels/Runner.js +2 -0
- package/Models/DatabaseModels/StatusPage.js +3 -2
- package/Models/DatabaseModels/StatusPageSCIM.d.mts +2 -1
- package/Models/DatabaseModels/StatusPageSCIM.d.ts +2 -1
- package/Models/DatabaseModels/StatusPageSCIM.js +17 -8
- package/Models/DatabaseModels/StatusPageSubscriber.js +35 -15
- package/Models/DatabaseModels/TelemetryIngestionKey.d.mts +2 -0
- package/Models/DatabaseModels/TelemetryIngestionKey.d.ts +2 -0
- package/Models/DatabaseModels/TelemetryIngestionKey.js +36 -1
- package/Models/DatabaseModels/UserWebhook.js +25 -17
- package/Models/DatabaseModels/WebhookLog.js +12 -2
- package/Models/DatabaseModels/Workflow.d.mts +3 -0
- package/Models/DatabaseModels/Workflow.d.ts +3 -0
- package/Models/DatabaseModels/Workflow.js +70 -1
- package/Server/Services/DatabaseService.d.mts +21 -1
- package/Server/Services/DatabaseService.d.ts +21 -1
- package/Types/AI/AIActionWords.js +1 -1
- package/Types/AI/CarriedRecords.d.mts +35 -0
- package/Types/AI/CarriedRecords.d.ts +35 -0
- package/Types/AI/CarriedRecords.js +211 -0
- package/Types/AI/CarriedRecords.mjs +3 -0
- package/Types/Accounts/SetPasswordLink.d.mts +6 -0
- package/Types/Accounts/SetPasswordLink.d.ts +6 -0
- package/Types/Accounts/SetPasswordLink.js +47 -0
- package/Types/Accounts/SetPasswordLink.mjs +7 -0
- package/Types/BaseDatabase/DatabaseCommonInteractionPropsUtil.js +1 -1
- package/Types/CodeRepository/ProductionReview.d.mts +5 -0
- package/Types/CodeRepository/ProductionReview.d.ts +5 -0
- package/Types/CodeRepository/ProductionReview.js +108 -0
- package/Types/Database/DatabaseProperty.d.mts +1 -0
- package/Types/Database/DatabaseProperty.d.ts +1 -0
- package/Types/Database/DatabaseProperty.js +27 -0
- package/Types/Database/EncryptedValue.d.mts +2 -0
- package/Types/Database/EncryptedValue.d.ts +2 -0
- package/Types/Database/EncryptedValue.js +27 -0
- package/Types/Database/EncryptedValue.mjs +3 -0
- package/Types/Database/TableColumn.d.mts +3 -0
- package/Types/Database/TableColumn.d.ts +3 -0
- package/Types/Docs/GlossaryTerm.d.mts +1 -0
- package/Types/Docs/GlossaryTerm.d.ts +1 -0
- package/Types/Docs/GlossaryTerm.js +2 -0
- package/Types/Email/EmailSendFailure.d.mts +20 -0
- package/Types/Email/EmailSendFailure.d.ts +20 -0
- package/Types/Email/EmailSendFailure.js +244 -0
- package/Types/Email/EmailSendFailure.mjs +3 -0
- package/Types/Email/EmailTemplateType.d.mts +1 -0
- package/Types/Email/EmailTemplateType.d.ts +1 -0
- package/Types/Email/EmailTemplateType.js +5 -0
- package/Types/Runner/RunnerCodeFixCapability.d.mts +3 -1
- package/Types/Runner/RunnerCodeFixCapability.d.ts +3 -1
- package/Types/Runner/RunnerCodeFixCapability.js +19 -1
- package/Types/Runner/RunnerCodeFixCapability.mjs +1 -0
- package/Types/SSO/SessionsWithoutSso.js +2 -2
- package/Types/ServerSending/ServerSendingStatus.d.mts +23 -2
- package/Types/ServerSending/ServerSendingStatus.d.ts +23 -2
- package/Types/ServerSending/ServerSendingStatus.js +208 -10
- package/Types/ServerSending/ServerSendingStatus.mjs +3 -0
- package/Types/ServerSetup/ServerSetupChecklist.js +5 -0
- package/Types/StatusPage/StatusPageMagicLink.js +1 -1
- package/Types/StatusPage/StatusPageSignInMessages.d.mts +3 -0
- package/Types/StatusPage/StatusPageSignInMessages.d.ts +3 -0
- package/Types/StatusPage/StatusPageSignInMessages.js +16 -0
- package/Types/StatusPage/StatusPageSignInMessages.mjs +4 -0
- package/Types/StatusPage/StatusPageSingleSignOnProtocol.d.mts +12 -0
- package/Types/StatusPage/StatusPageSingleSignOnProtocol.d.ts +12 -0
- package/Types/StatusPage/StatusPageSingleSignOnProtocol.js +63 -0
- package/Types/StatusPage/StatusPageSingleSignOnProtocol.mjs +8 -0
- package/Types/StatusPage/StatusPageSubscriberChannel.d.mts +18 -0
- package/Types/StatusPage/StatusPageSubscriberChannel.d.ts +18 -0
- package/Types/StatusPage/StatusPageSubscriberChannel.js +91 -0
- package/Types/StatusPage/StatusPageSubscriberChannel.mjs +10 -0
- package/Types/Workspace/ConnectCallback.d.mts +2 -1
- package/Types/Workspace/ConnectCallback.d.ts +2 -1
- package/Types/Workspace/ConnectCallback.js +8 -0
- package/Utils/AiRemediation/DeclaredCodeChange.d.mts +4 -1
- package/Utils/AiRemediation/DeclaredCodeChange.d.ts +4 -1
- package/Utils/AiRemediation/DeclaredCodeChange.js +6 -0
- package/Utils/Dashboard/MonitorListWidgetFormat.js +1 -1
- package/Utils/Incident/PostmortemActionItemCodeTask.d.mts +2 -0
- package/Utils/Incident/PostmortemActionItemCodeTask.d.ts +2 -0
- package/Utils/Incident/PostmortemActionItemCodeTask.js +22 -5
- package/Utils/Incident/PostmortemActionItemCodeTask.mjs +1 -0
- package/Utils/LookupTable.d.mts +1 -0
- package/Utils/LookupTable.d.ts +1 -0
- package/Utils/LookupTable.js +19 -0
- package/Utils/LookupTable.mjs +1 -0
- package/Utils/Monitor/MonitorFirstCheckOverdue.js +5 -5
- package/Utils/Monitor/MonitorOverviewFamily.d.mts +2 -10
- package/Utils/Monitor/MonitorOverviewFamily.d.ts +2 -10
- package/Utils/Monitor/MonitorOverviewFamily.js +19 -99
- package/Utils/Monitor/MonitorOverviewPresentationUtil.d.mts +1 -1
- package/Utils/Monitor/MonitorOverviewPresentationUtil.d.ts +1 -1
- package/Utils/Monitor/MonitorOverviewPresentationUtil.js +6 -6
- package/Utils/Monitor/MonitorRowStatus.js +2 -2
- package/Utils/Monitor/MonitorTypeFamily.d.mts +14 -0
- package/Utils/Monitor/MonitorTypeFamily.d.ts +14 -0
- package/Utils/Monitor/MonitorTypeFamily.js +105 -0
- package/Utils/Monitor/MonitorTypeFamily.mjs +3 -0
- package/Utils/Monitor/StoredCheckEvidence.d.mts +10 -0
- package/Utils/Monitor/StoredCheckEvidence.d.ts +10 -0
- package/Utils/Monitor/StoredCheckEvidence.js +53 -0
- package/Utils/Monitor/StoredCheckEvidence.mjs +5 -0
- package/Utils/NetworkDiscovery/SnmpScanConfigUtil.js +11 -4
- package/Utils/Project/ProjectBilling.d.mts +1 -0
- package/Utils/Project/ProjectBilling.d.ts +1 -0
- package/Utils/Project/ProjectBilling.js +9 -1
- package/Utils/Project/ProjectBilling.mjs +1 -0
- package/Utils/StatusPage/HistoryWindow.d.mts +3 -0
- package/Utils/StatusPage/HistoryWindow.d.ts +3 -0
- package/Utils/StatusPage/HistoryWindow.js +24 -0
- package/Utils/StatusPage/HistoryWindow.mjs +4 -0
- package/Utils/Suggestions/CodeFixSuggestion.d.mts +2 -1
- package/Utils/Suggestions/CodeFixSuggestion.d.ts +2 -1
- package/Utils/Suggestions/CodeFixSuggestion.js +9 -0
- package/Utils/Suggestions/InvestigationCodeFixSuggestion.d.mts +1 -0
- package/Utils/Suggestions/InvestigationCodeFixSuggestion.d.ts +1 -0
- package/Utils/Suggestions/InvestigationCodeFixSuggestion.js +24 -3
- package/Utils/Suggestions/InvestigationCodeFixSuggestion.mjs +1 -0
- package/Utils/Suggestions/ProfileFixSuggestion.d.mts +1 -0
- package/Utils/Suggestions/ProfileFixSuggestion.d.ts +1 -0
- package/Utils/Suggestions/ProfileFixSuggestion.js +16 -4
- package/Utils/Suggestions/TelemetryAiFixSuggestion.d.mts +2 -0
- package/Utils/Suggestions/TelemetryAiFixSuggestion.d.ts +2 -0
- package/Utils/Suggestions/TelemetryAiFixSuggestion.js +17 -5
- package/Utils/Suggestions/TelemetryAiFixSuggestion.mjs +1 -0
- package/Utils/Suggestions/TracePerformanceFixSuggestion.js +16 -7
- package/Utils/WebhookAddressMask.d.mts +9 -0
- package/Utils/WebhookAddressMask.d.ts +9 -0
- package/Utils/WebhookAddressMask.js +66 -0
- package/Utils/WebhookAddressMask.mjs +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EmailSendFailureScope = void 0;
|
|
4
|
+
const ServerSendingStatus_1 = require("../ServerSending/ServerSendingStatus");
|
|
5
|
+
/*
|
|
6
|
+
* WHOSE PROBLEM IS A FAILED EMAIL? (#9217)
|
|
7
|
+
*
|
|
8
|
+
* A mail server or provider that refuses an email says why, and the why
|
|
9
|
+
* decides who must act:
|
|
10
|
+
*
|
|
11
|
+
* - the recipient (or this one message): the address does not exist, its
|
|
12
|
+
* mailbox is full, the provider will not send to it (an Amazon SES
|
|
13
|
+
* sandbox that has not verified it, a Postmark inactive recipient, a
|
|
14
|
+
* Mailgun sandbox's authorized recipients), the message is too large.
|
|
15
|
+
* Every other email still goes out. It belongs on that email's log row,
|
|
16
|
+
* the record that sent it and the recipient - never in a banner that
|
|
17
|
+
* tells every admin the server's email is broken;
|
|
18
|
+
* - the server: the settings or the way to the mail service do not work -
|
|
19
|
+
* the password is refused, the host is not reached, TLS fails, the
|
|
20
|
+
* sender's address or domain is not verified, the account is suspended
|
|
21
|
+
* or out of its daily quota. No email goes out until someone fixes it,
|
|
22
|
+
* so the server's admins are told (ServerSendingStatus);
|
|
23
|
+
* - throttled: the mail service asked to slow down. That is the server's
|
|
24
|
+
* only while it lasts (SERVER_SEND_THROTTLE_SUSTAINED_MS).
|
|
25
|
+
*
|
|
26
|
+
* Read from what the sender knows: the error's text, and for SMTP the
|
|
27
|
+
* code nodemailer gives (EAUTH, ECONNECTION ...), the reply code and the
|
|
28
|
+
* command the server refused. An Amazon SES "Email address is not
|
|
29
|
+
* verified" names the identities that failed, which can be the sender or
|
|
30
|
+
* the recipient: it is the server's only when the sender is among them.
|
|
31
|
+
* Anything not known to be one recipient's is the server's, as every
|
|
32
|
+
* failure was before.
|
|
33
|
+
*
|
|
34
|
+
* Pure, with no Node or browser APIs.
|
|
35
|
+
*/
|
|
36
|
+
// Whose problem it is, as ServerSendingStatus keeps it.
|
|
37
|
+
exports.EmailSendFailureScope = ServerSendingStatus_1.ServerSendingFailureScope;
|
|
38
|
+
// nodemailer's codes for a connection, a login or TLS that failed.
|
|
39
|
+
const SERVER_ERROR_CODES = [
|
|
40
|
+
"EAUTH",
|
|
41
|
+
"ENOAUTH",
|
|
42
|
+
"EOAUTH2",
|
|
43
|
+
"ECONNECTION",
|
|
44
|
+
"ECONNREFUSED",
|
|
45
|
+
"ECONNRESET",
|
|
46
|
+
"ETIMEDOUT",
|
|
47
|
+
"ESOCKET",
|
|
48
|
+
"EDNS",
|
|
49
|
+
"ENOTFOUND",
|
|
50
|
+
"EAI_AGAIN",
|
|
51
|
+
"ETLS",
|
|
52
|
+
"EPROXY",
|
|
53
|
+
"EHOSTUNREACH",
|
|
54
|
+
"ENETUNREACH",
|
|
55
|
+
];
|
|
56
|
+
/*
|
|
57
|
+
* The sender, its domain, relaying or the account: no email goes out. Read
|
|
58
|
+
* before what a recipient's refusal says, since "550 5.7.1 Sender address
|
|
59
|
+
* rejected" is a 550 too.
|
|
60
|
+
*/
|
|
61
|
+
const SENDER_PATTERNS = [
|
|
62
|
+
/sender[^.]*\b(?:rejected|refused|denied|not (?:allowed|authori[sz]ed|permitted|verified|owned))/i,
|
|
63
|
+
/\bfrom\b[^.]*\b(?:address|domain|email)\b[^.]*\b(?:not (?:a )?(?:verified|valid|allowed|permitted|authori[sz]ed)|does not match|is not a sender signature|rejected)/i,
|
|
64
|
+
/not a (?:verified )?sender signature|verified sender identity|sender identity/i,
|
|
65
|
+
/\bdomain\b[^.]*\bnot (?:verified|found|registered)|verify (?:a|your) domain/i,
|
|
66
|
+
/mail from domain|MailFromDomainNotVerified/i,
|
|
67
|
+
/relay(?:ing)? (?:access )?(?:denied|not permitted)|unable to relay|not permitted to relay/i,
|
|
68
|
+
/SendAsDenied|not allowed to send as|5\.7\.60\b/i,
|
|
69
|
+
/5\.7\.26\b|unauthenticated email|\bdmarc\b|\bspf\b|\bdkim\b/i,
|
|
70
|
+
/suspended|sending (?:is )?paused|SendingPaused|account (?:is )?(?:disabled|blocked|inactive|under review)/i,
|
|
71
|
+
/5\.7\.1\b[^.]*unusual rate/i,
|
|
72
|
+
];
|
|
73
|
+
// A login, a key or the way to the mail service: no email goes out.
|
|
74
|
+
const SERVER_PATTERNS = [
|
|
75
|
+
/\b535\b/,
|
|
76
|
+
/\b534\b/,
|
|
77
|
+
/\b530\b[\s-]+5\.7\.0/,
|
|
78
|
+
/5\.7\.(?:8|9|14|57|139)\b/,
|
|
79
|
+
/authenticat(?:e|ion|ed)\b[^.]*\b(?:fail|unsuccessful|invalid|required|rejected|refused|denied)/i,
|
|
80
|
+
/\b(?:not authenticated|unauthenticated)\b/i,
|
|
81
|
+
/invalid login|username and password not accepted|bad credentials|invalid credentials/i,
|
|
82
|
+
/\b(?:invalid|unknown|unrecognized|revoked|expired|missing)\b[^.]*\b(?:api key|api token|server token|access key|token|credentials?)\b/i,
|
|
83
|
+
/\b(?:api key|api token|server token|access key)\b[^.]*\b(?:invalid|not valid|not recognized|revoked|expired|missing)\b/i,
|
|
84
|
+
/\b(?:unauthorized|forbidden)\b/i,
|
|
85
|
+
/\bHTTP 40[13]\b/,
|
|
86
|
+
/IAM role|ses:SendEmail|signature/i,
|
|
87
|
+
/ECONNREFUSED|ECONNRESET|ETIMEDOUT|ENOTFOUND|EAI_AGAIN|EHOSTUNREACH|ENETUNREACH/,
|
|
88
|
+
/connection (?:refused|closed|reset|lost|timed? ?out)|timed? ?out|timeout/i,
|
|
89
|
+
/unexpected socket close|socket hang up|getaddrinfo|greeting never received/i,
|
|
90
|
+
/\b(?:tls|ssl)\b|certificate|wrong version number|self[- ]signed/i,
|
|
91
|
+
];
|
|
92
|
+
const DAILY_QUOTA = /daily (?:user )?(?:message |sending )?(?:quota|limit)|sending quota|quota exceeded|sending limit exceeded|5\.4\.5\b/i;
|
|
93
|
+
// The mail service asked to slow down: the server's only while it lasts.
|
|
94
|
+
const THROTTLE_PATTERNS = [
|
|
95
|
+
/throttl/i,
|
|
96
|
+
/maximum sending rate/i,
|
|
97
|
+
/rate limit|rate-limit|ratelimit/i,
|
|
98
|
+
/too many (?:requests|messages|connections|concurrent)/i,
|
|
99
|
+
/\bHTTP 429\b|\b429\b[^.]*too many/i,
|
|
100
|
+
/4\.7\.28\b/,
|
|
101
|
+
/try again later/i,
|
|
102
|
+
];
|
|
103
|
+
// One recipient, or this one message: every other email still goes out.
|
|
104
|
+
const RECIPIENT_PATTERNS = [
|
|
105
|
+
/\b5\.1\.(?:1|2|3|6|10)\b/,
|
|
106
|
+
/\b4\.1\.1\b/,
|
|
107
|
+
/\b5\.2\.[12]\b/,
|
|
108
|
+
/\b5\.3\.4\b/,
|
|
109
|
+
/mailbox (?:unavailable|not found|does not exist|is full|full|disabled|inactive)|no mailbox/i,
|
|
110
|
+
/user unknown|unknown user|no such (?:user|recipient|address|mailbox)/i,
|
|
111
|
+
/recipient[^.]*\b(?:rejected|refused|not found|unknown|invalid|is not valid|does not exist|not verified|blocked|suppressed|inactive|unavailable|denied)/i,
|
|
112
|
+
/RecipientNotFound|InactiveRecipient|inactive (?:recipient|address)|marked as inactive/i,
|
|
113
|
+
/(?:mailbox|user|address|account|recipient)\b[^.]*\b(?:does not exist|doesn't exist)/i,
|
|
114
|
+
/(?:mailbox|inbox|recipient|user|you tried to reach)[^.]*over (?:its |the )?quota/i,
|
|
115
|
+
/address rejected|invalid recipient|undeliverable/i,
|
|
116
|
+
/suppression list|is suppressed/i,
|
|
117
|
+
/invalid '?to'? (?:address|field|parameter)|'to' parameter|to parameter is not a valid|is not a valid (?:email )?address/i,
|
|
118
|
+
/authorized recipients/i,
|
|
119
|
+
/message (?:size|too large|is too (?:large|big))|exceeds (?:the )?(?:maximum )?(?:message )?size/i,
|
|
120
|
+
/greylist/i,
|
|
121
|
+
/\b4\.2\.1\b|receiving mail at a rate/i,
|
|
122
|
+
];
|
|
123
|
+
// Amazon SES: "Email address is not verified. The following identities ..."
|
|
124
|
+
const UNVERIFIED_IDENTITY = /(?:email )?address is not verified|identit(?:y|ies)[^.]*(?:not verified|failed the check)/i;
|
|
125
|
+
const EMAIL_ADDRESS = /[^\s,;:<>()"'[\]]+@[^\s,;:<>()"'[\]]+/g;
|
|
126
|
+
const normalize = (address) => {
|
|
127
|
+
return (address || "").trim().toLowerCase().replace(/\.+$/, "");
|
|
128
|
+
};
|
|
129
|
+
const matchesAny = (text, patterns) => {
|
|
130
|
+
return patterns.some((pattern) => {
|
|
131
|
+
return pattern.test(text);
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
class EmailSendFailure {
|
|
135
|
+
/*
|
|
136
|
+
* The identities an Amazon SES "Email address is not verified" names
|
|
137
|
+
* ("The following identities failed the check in region US-EAST-1:
|
|
138
|
+
* a@example.com, b@example.com"), lower-cased; empty when it names none.
|
|
139
|
+
*/
|
|
140
|
+
static getUnverifiedIdentities(message) {
|
|
141
|
+
const match = message.match(/failed the check in region\s+[^:]*:\s*([^\n]*)/i);
|
|
142
|
+
if (!match || !match[1]) {
|
|
143
|
+
return [];
|
|
144
|
+
}
|
|
145
|
+
return (match[1].match(EMAIL_ADDRESS) || []).map((address) => {
|
|
146
|
+
return normalize(address);
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
// Whether the error says an identity is not verified (Amazon SES).
|
|
150
|
+
static isUnverifiedIdentity(message) {
|
|
151
|
+
return UNVERIFIED_IDENTITY.test(message);
|
|
152
|
+
}
|
|
153
|
+
static classify(facts) {
|
|
154
|
+
const message = facts.message || "";
|
|
155
|
+
const code = (facts.code || "").toUpperCase();
|
|
156
|
+
const command = (facts.command || "").toUpperCase();
|
|
157
|
+
const fromEmail = normalize(facts.fromEmail);
|
|
158
|
+
const toEmail = normalize(facts.toEmail);
|
|
159
|
+
// The connection, the login or TLS: nothing gets as far as a recipient.
|
|
160
|
+
if (SERVER_ERROR_CODES.includes(code)) {
|
|
161
|
+
return exports.EmailSendFailureScope.Server;
|
|
162
|
+
}
|
|
163
|
+
/*
|
|
164
|
+
* Amazon SES names the identities it has not verified: the sender's is
|
|
165
|
+
* the server's to fix, a sandbox recipient's only that recipient's.
|
|
166
|
+
*/
|
|
167
|
+
if (EmailSendFailure.isUnverifiedIdentity(message)) {
|
|
168
|
+
const identities = EmailSendFailure.getUnverifiedIdentities(message);
|
|
169
|
+
if (identities.length === 0) {
|
|
170
|
+
return exports.EmailSendFailureScope.Server;
|
|
171
|
+
}
|
|
172
|
+
if (fromEmail) {
|
|
173
|
+
return identities.includes(fromEmail)
|
|
174
|
+
? exports.EmailSendFailureScope.Server
|
|
175
|
+
: exports.EmailSendFailureScope.Recipient;
|
|
176
|
+
}
|
|
177
|
+
return toEmail &&
|
|
178
|
+
identities.every((identity) => {
|
|
179
|
+
return identity === toEmail;
|
|
180
|
+
})
|
|
181
|
+
? exports.EmailSendFailureScope.Recipient
|
|
182
|
+
: exports.EmailSendFailureScope.Server;
|
|
183
|
+
}
|
|
184
|
+
// A daily quota lasts the day: the account's, never a slow-down.
|
|
185
|
+
if (DAILY_QUOTA.test(message)) {
|
|
186
|
+
return exports.EmailSendFailureScope.Server;
|
|
187
|
+
}
|
|
188
|
+
if (matchesAny(message, THROTTLE_PATTERNS)) {
|
|
189
|
+
return exports.EmailSendFailureScope.Throttled;
|
|
190
|
+
}
|
|
191
|
+
// The sender, its domain or the account: every email from it fails.
|
|
192
|
+
if (matchesAny(message, SENDER_PATTERNS)) {
|
|
193
|
+
return exports.EmailSendFailureScope.Server;
|
|
194
|
+
}
|
|
195
|
+
// An address the server refused at RCPT TO is that recipient's.
|
|
196
|
+
if (code === "EENVELOPE" ||
|
|
197
|
+
(command.startsWith("RCPT") &&
|
|
198
|
+
(facts.responseCode === undefined ||
|
|
199
|
+
(facts.responseCode >= 450 && facts.responseCode < 600)))) {
|
|
200
|
+
// Unless it asks for a login first, which no recipient can give.
|
|
201
|
+
return matchesAny(message, SERVER_PATTERNS) &&
|
|
202
|
+
!matchesAny(message, RECIPIENT_PATTERNS)
|
|
203
|
+
? exports.EmailSendFailureScope.Server
|
|
204
|
+
: exports.EmailSendFailureScope.Recipient;
|
|
205
|
+
}
|
|
206
|
+
if (matchesAny(message, RECIPIENT_PATTERNS)) {
|
|
207
|
+
return exports.EmailSendFailureScope.Recipient;
|
|
208
|
+
}
|
|
209
|
+
// A login, a key, the connection - or nothing known: the server's.
|
|
210
|
+
return exports.EmailSendFailureScope.Server;
|
|
211
|
+
}
|
|
212
|
+
/*
|
|
213
|
+
* The facts of an error thrown by a send: its message, and what
|
|
214
|
+
* nodemailer adds to an SMTP error.
|
|
215
|
+
*/
|
|
216
|
+
static readError(err, addresses) {
|
|
217
|
+
const error = err && typeof err === "object" ? err : {};
|
|
218
|
+
const message = typeof error["message"] === "string"
|
|
219
|
+
? error["message"]
|
|
220
|
+
: typeof err === "string"
|
|
221
|
+
? err
|
|
222
|
+
: "";
|
|
223
|
+
const response = typeof error["response"] === "string"
|
|
224
|
+
? error["response"]
|
|
225
|
+
: "";
|
|
226
|
+
return {
|
|
227
|
+
message: response && !message.includes(response)
|
|
228
|
+
? `${message} ${response}`.trim()
|
|
229
|
+
: message,
|
|
230
|
+
code: typeof error["code"] === "string"
|
|
231
|
+
? error["code"]
|
|
232
|
+
: undefined,
|
|
233
|
+
responseCode: typeof error["responseCode"] === "number"
|
|
234
|
+
? error["responseCode"]
|
|
235
|
+
: undefined,
|
|
236
|
+
command: typeof error["command"] === "string"
|
|
237
|
+
? error["command"]
|
|
238
|
+
: undefined,
|
|
239
|
+
fromEmail: addresses.fromEmail,
|
|
240
|
+
toEmail: addresses.toEmail,
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
exports.default = EmailSendFailure;
|
|
@@ -4,6 +4,11 @@ var EmailTemplateType;
|
|
|
4
4
|
(function (EmailTemplateType) {
|
|
5
5
|
EmailTemplateType["BlankTemplate"] = "BlankTemplate.hbs";
|
|
6
6
|
EmailTemplateType["ForgotPassword"] = "ForgotPassword.hbs";
|
|
7
|
+
/*
|
|
8
|
+
* The first password of an account a master admin created: a link to set
|
|
9
|
+
* it (Types/Accounts/SetPasswordLink).
|
|
10
|
+
*/
|
|
11
|
+
EmailTemplateType["SetPassword"] = "SetPassword.hbs";
|
|
7
12
|
// An account's sign-in link (Types/Accounts/MagicLink).
|
|
8
13
|
EmailTemplateType["MagicLink"] = "MagicLink.hbs";
|
|
9
14
|
EmailTemplateType["ProbeOffline"] = "ProbeOffline.hbs";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
declare enum RunnerCodeFixCapability {
|
|
2
|
-
ServerOpensPullRequests = "serverOpensPullRequests"
|
|
2
|
+
ServerOpensPullRequests = "serverOpensPullRequests",
|
|
3
|
+
KeepsPrivateRecordsOutOfPullRequests = "keepsPrivateRecordsOutOfPullRequests"
|
|
3
4
|
}
|
|
5
|
+
export declare const SUBJECT_IS_PRIVATE_FIELD: string;
|
|
4
6
|
export declare const RUNNER_CODE_FIX_CAPABILITIES_FIELD: string;
|
|
5
7
|
export declare const SERVER_OPENS_PULL_REQUEST_FIELD: string;
|
|
6
8
|
export declare const MAX_RUNNER_CODE_FIX_CAPABILITIES: number;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
declare enum RunnerCodeFixCapability {
|
|
2
|
-
ServerOpensPullRequests = "serverOpensPullRequests"
|
|
2
|
+
ServerOpensPullRequests = "serverOpensPullRequests",
|
|
3
|
+
KeepsPrivateRecordsOutOfPullRequests = "keepsPrivateRecordsOutOfPullRequests"
|
|
3
4
|
}
|
|
5
|
+
export declare const SUBJECT_IS_PRIVATE_FIELD: string;
|
|
4
6
|
export declare const RUNNER_CODE_FIX_CAPABILITIES_FIELD: string;
|
|
5
7
|
export declare const SERVER_OPENS_PULL_REQUEST_FIELD: string;
|
|
6
8
|
export declare const MAX_RUNNER_CODE_FIX_CAPABILITIES: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RunnerCodeFixCapabilityUtil = exports.MAX_RUNNER_CODE_FIX_CAPABILITY_LENGTH = exports.MAX_RUNNER_CODE_FIX_CAPABILITIES = exports.SERVER_OPENS_PULL_REQUEST_FIELD = exports.RUNNER_CODE_FIX_CAPABILITIES_FIELD = void 0;
|
|
3
|
+
exports.RunnerCodeFixCapabilityUtil = exports.MAX_RUNNER_CODE_FIX_CAPABILITY_LENGTH = exports.MAX_RUNNER_CODE_FIX_CAPABILITIES = exports.SERVER_OPENS_PULL_REQUEST_FIELD = exports.RUNNER_CODE_FIX_CAPABILITIES_FIELD = exports.SUBJECT_IS_PRIVATE_FIELD = void 0;
|
|
4
4
|
/*
|
|
5
5
|
* WHAT A RUNNER BUILD CAN DO IN A CODE FIX.
|
|
6
6
|
*
|
|
@@ -37,7 +37,25 @@ var RunnerCodeFixCapability;
|
|
|
37
37
|
* did, with a token that can.
|
|
38
38
|
*/
|
|
39
39
|
RunnerCodeFixCapability["ServerOpensPullRequests"] = "serverOpensPullRequests";
|
|
40
|
+
/*
|
|
41
|
+
* The Runner keeps a private incident or alert out of what it writes on
|
|
42
|
+
* the code host (#9165). For a fix about one - the task details say
|
|
43
|
+
* subjectIsPrivate - its pull request's title, description and commit
|
|
44
|
+
* message name neither the record nor quote the investigation's analysis,
|
|
45
|
+
* and its code agent is asked to describe the code change alone: the
|
|
46
|
+
* repository's readers are not the record's. A Runner older than this
|
|
47
|
+
* writes the record's title and the analysis into them, so it is never
|
|
48
|
+
* handed such a fix's details (/ai-agent-data/get-instrumentation-task-
|
|
49
|
+
* details refuses it, saying to update the Runner).
|
|
50
|
+
*/
|
|
51
|
+
RunnerCodeFixCapability["KeepsPrivateRecordsOutOfPullRequests"] = "keepsPrivateRecordsOutOfPullRequests";
|
|
40
52
|
})(RunnerCodeFixCapability || (RunnerCodeFixCapability = {}));
|
|
53
|
+
/*
|
|
54
|
+
* The field of a subject fix's task details (an incident's or alert's) that
|
|
55
|
+
* says the record is private, for a Runner that keeps it out of the pull
|
|
56
|
+
* request (KeepsPrivateRecordsOutOfPullRequests).
|
|
57
|
+
*/
|
|
58
|
+
exports.SUBJECT_IS_PRIVATE_FIELD = "subjectIsPrivate";
|
|
41
59
|
// The request body field a Runner declares its code-fix capabilities in.
|
|
42
60
|
exports.RUNNER_CODE_FIX_CAPABILITIES_FIELD = "codeFixCapabilities";
|
|
43
61
|
/*
|
|
@@ -5,3 +5,4 @@ export const MAX_RUNNER_CODE_FIX_CAPABILITY_LENGTH = commonJsModule.MAX_RUNNER_C
|
|
|
5
5
|
export const RUNNER_CODE_FIX_CAPABILITIES_FIELD = commonJsModule.RUNNER_CODE_FIX_CAPABILITIES_FIELD;
|
|
6
6
|
export const RunnerCodeFixCapabilityUtil = commonJsModule.RunnerCodeFixCapabilityUtil;
|
|
7
7
|
export const SERVER_OPENS_PULL_REQUEST_FIELD = commonJsModule.SERVER_OPENS_PULL_REQUEST_FIELD;
|
|
8
|
+
export const SUBJECT_IS_PRIVATE_FIELD = commonJsModule.SUBJECT_IS_PRIVATE_FIELD;
|
|
@@ -4,7 +4,7 @@ exports.readSessionsWithoutSsoAnswer = exports.SIGN_OUT_WITHOUT_SSO_NEEDS_SSO_RE
|
|
|
4
4
|
/*
|
|
5
5
|
* PEOPLE SIGNED IN WITHOUT SSO, WHILE THE WHOLE SERVER REQUIRES IT (#6116).
|
|
6
6
|
*
|
|
7
|
-
* Turning on Require SSO
|
|
7
|
+
* Turning on Require SSO to Sign In (Admin Dashboard > Settings > Single
|
|
8
8
|
* Sign-On) keeps everyone but master admins out of every project until they
|
|
9
9
|
* sign in with SSO, but it ends nobody's session: whoever signed in with a
|
|
10
10
|
* password, a passkey or Sign in with Microsoft before stays signed in to
|
|
@@ -22,7 +22,7 @@ exports.readSessionsWithoutSsoAnswer = exports.SIGN_OUT_WITHOUT_SSO_NEEDS_SSO_RE
|
|
|
22
22
|
*/
|
|
23
23
|
exports.SESSIONS_WITHOUT_SSO_ROUTE = "/global-config/sessions-without-sso";
|
|
24
24
|
exports.END_SESSIONS_WITHOUT_SSO_ROUTE = "/global-config/sessions-without-sso/end";
|
|
25
|
-
exports.SIGN_OUT_WITHOUT_SSO_NEEDS_SSO_REQUIRED_MESSAGE = "Single sign-on is not required, so people signed in with a password would sign in again with it at once. Turn on Require SSO
|
|
25
|
+
exports.SIGN_OUT_WITHOUT_SSO_NEEDS_SSO_REQUIRED_MESSAGE = "Single sign-on is not required, so people signed in with a password would sign in again with it at once. Turn on Require SSO to Sign In first.";
|
|
26
26
|
const readCount = (value) => {
|
|
27
27
|
return typeof value === "number" && Number.isInteger(value) && value >= 0
|
|
28
28
|
? value
|
|
@@ -10,12 +10,25 @@ export declare enum ServerSendingState {
|
|
|
10
10
|
Working = "working",
|
|
11
11
|
Failing = "failing"
|
|
12
12
|
}
|
|
13
|
+
export declare enum ServerSendingFailureScope {
|
|
14
|
+
Server = "server",
|
|
15
|
+
Recipient = "recipient",
|
|
16
|
+
Throttled = "throttled"
|
|
17
|
+
}
|
|
18
|
+
export interface ServerSendingRecipientRefusal {
|
|
19
|
+
recipient: string;
|
|
20
|
+
reason: string;
|
|
21
|
+
at: string;
|
|
22
|
+
}
|
|
13
23
|
export declare const SERVER_SENDING_CHANNELS: ReadonlyArray<ServerSendingChannel>;
|
|
14
24
|
export interface ServerSendingHealthEntry {
|
|
15
25
|
lastSucceededAt: string | null;
|
|
16
26
|
lastFailedAt: string | null;
|
|
17
27
|
failingSince: string | null;
|
|
18
28
|
lastFailure: string | null;
|
|
29
|
+
failureScope?: ServerSendingFailureScope | undefined;
|
|
30
|
+
throttledSince?: string | undefined;
|
|
31
|
+
recipientRefusals?: Array<ServerSendingRecipientRefusal> | undefined;
|
|
19
32
|
settingsFingerprint?: string | undefined;
|
|
20
33
|
}
|
|
21
34
|
export type ServerSendingHealth = Partial<Record<ServerSendingChannel, ServerSendingHealthEntry>>;
|
|
@@ -31,6 +44,7 @@ export interface ServerChannelStatus {
|
|
|
31
44
|
failingSince: string | null;
|
|
32
45
|
lastFailure: string | null;
|
|
33
46
|
setUpProblem: string | null;
|
|
47
|
+
recipientRefusals?: Array<ServerSendingRecipientRefusal> | undefined;
|
|
34
48
|
}
|
|
35
49
|
export interface ServerGlobalProbesStatus {
|
|
36
50
|
total: number;
|
|
@@ -42,6 +56,8 @@ export interface ServerSendingStatusAnswer {
|
|
|
42
56
|
}
|
|
43
57
|
export declare const SERVER_SENDING_HEALTH_REWRITE_INTERVAL_MS: number;
|
|
44
58
|
export declare const MAX_SERVER_SENDING_FAILURE_LENGTH: number;
|
|
59
|
+
export declare const SERVER_SENDING_THROTTLE_SUSTAINED_MS: number;
|
|
60
|
+
export declare const MAX_SERVER_SENDING_RECIPIENT_REFUSALS: number;
|
|
45
61
|
export default class ServerSendingStatusUtil {
|
|
46
62
|
static readEntry(value: unknown): ServerSendingHealthEntry;
|
|
47
63
|
static readHealth(value: unknown): ServerSendingHealth;
|
|
@@ -64,10 +80,15 @@ export default class ServerSendingStatusUtil {
|
|
|
64
80
|
static needsAttention(status: {
|
|
65
81
|
state: ServerSendingState;
|
|
66
82
|
}): boolean;
|
|
67
|
-
static withSucceeded(entry: ServerSendingHealthEntry, now: Date): ServerSendingHealthEntry;
|
|
83
|
+
static withSucceeded(entry: ServerSendingHealthEntry, now: Date, recipient?: string | undefined): ServerSendingHealthEntry;
|
|
68
84
|
static withFailed(entry: ServerSendingHealthEntry, reason: string, now: Date): ServerSendingHealthEntry;
|
|
69
|
-
static
|
|
85
|
+
static withThrottled(entry: ServerSendingHealthEntry, reason: string, now: Date): ServerSendingHealthEntry;
|
|
86
|
+
static withRecipientRefused(entry: ServerSendingHealthEntry, recipient: string, reason: string, now: Date): ServerSendingHealthEntry;
|
|
87
|
+
static shouldWriteSucceeded(entry: ServerSendingHealthEntry, now: Date, recipient?: string | undefined): boolean;
|
|
70
88
|
static shouldWriteFailed(entry: ServerSendingHealthEntry, reason: string, now: Date): boolean;
|
|
89
|
+
static shouldWriteThrottled(entry: ServerSendingHealthEntry, now: Date): boolean;
|
|
90
|
+
static shouldWriteRecipientRefused(entry: ServerSendingHealthEntry, recipient: string, reason: string, now: Date): boolean;
|
|
91
|
+
static isFailureScope(value: unknown): value is ServerSendingFailureScope;
|
|
71
92
|
static isChannel(value: unknown): value is ServerSendingChannel;
|
|
72
93
|
static isState(value: unknown): value is ServerSendingState;
|
|
73
94
|
static parseAnswer(value: unknown): ServerSendingStatusAnswer | null;
|
|
@@ -10,12 +10,25 @@ export declare enum ServerSendingState {
|
|
|
10
10
|
Working = "working",
|
|
11
11
|
Failing = "failing"
|
|
12
12
|
}
|
|
13
|
+
export declare enum ServerSendingFailureScope {
|
|
14
|
+
Server = "server",
|
|
15
|
+
Recipient = "recipient",
|
|
16
|
+
Throttled = "throttled"
|
|
17
|
+
}
|
|
18
|
+
export interface ServerSendingRecipientRefusal {
|
|
19
|
+
recipient: string;
|
|
20
|
+
reason: string;
|
|
21
|
+
at: string;
|
|
22
|
+
}
|
|
13
23
|
export declare const SERVER_SENDING_CHANNELS: ReadonlyArray<ServerSendingChannel>;
|
|
14
24
|
export interface ServerSendingHealthEntry {
|
|
15
25
|
lastSucceededAt: string | null;
|
|
16
26
|
lastFailedAt: string | null;
|
|
17
27
|
failingSince: string | null;
|
|
18
28
|
lastFailure: string | null;
|
|
29
|
+
failureScope?: ServerSendingFailureScope | undefined;
|
|
30
|
+
throttledSince?: string | undefined;
|
|
31
|
+
recipientRefusals?: Array<ServerSendingRecipientRefusal> | undefined;
|
|
19
32
|
settingsFingerprint?: string | undefined;
|
|
20
33
|
}
|
|
21
34
|
export type ServerSendingHealth = Partial<Record<ServerSendingChannel, ServerSendingHealthEntry>>;
|
|
@@ -31,6 +44,7 @@ export interface ServerChannelStatus {
|
|
|
31
44
|
failingSince: string | null;
|
|
32
45
|
lastFailure: string | null;
|
|
33
46
|
setUpProblem: string | null;
|
|
47
|
+
recipientRefusals?: Array<ServerSendingRecipientRefusal> | undefined;
|
|
34
48
|
}
|
|
35
49
|
export interface ServerGlobalProbesStatus {
|
|
36
50
|
total: number;
|
|
@@ -42,6 +56,8 @@ export interface ServerSendingStatusAnswer {
|
|
|
42
56
|
}
|
|
43
57
|
export declare const SERVER_SENDING_HEALTH_REWRITE_INTERVAL_MS: number;
|
|
44
58
|
export declare const MAX_SERVER_SENDING_FAILURE_LENGTH: number;
|
|
59
|
+
export declare const SERVER_SENDING_THROTTLE_SUSTAINED_MS: number;
|
|
60
|
+
export declare const MAX_SERVER_SENDING_RECIPIENT_REFUSALS: number;
|
|
45
61
|
export default class ServerSendingStatusUtil {
|
|
46
62
|
static readEntry(value: unknown): ServerSendingHealthEntry;
|
|
47
63
|
static readHealth(value: unknown): ServerSendingHealth;
|
|
@@ -64,10 +80,15 @@ export default class ServerSendingStatusUtil {
|
|
|
64
80
|
static needsAttention(status: {
|
|
65
81
|
state: ServerSendingState;
|
|
66
82
|
}): boolean;
|
|
67
|
-
static withSucceeded(entry: ServerSendingHealthEntry, now: Date): ServerSendingHealthEntry;
|
|
83
|
+
static withSucceeded(entry: ServerSendingHealthEntry, now: Date, recipient?: string | undefined): ServerSendingHealthEntry;
|
|
68
84
|
static withFailed(entry: ServerSendingHealthEntry, reason: string, now: Date): ServerSendingHealthEntry;
|
|
69
|
-
static
|
|
85
|
+
static withThrottled(entry: ServerSendingHealthEntry, reason: string, now: Date): ServerSendingHealthEntry;
|
|
86
|
+
static withRecipientRefused(entry: ServerSendingHealthEntry, recipient: string, reason: string, now: Date): ServerSendingHealthEntry;
|
|
87
|
+
static shouldWriteSucceeded(entry: ServerSendingHealthEntry, now: Date, recipient?: string | undefined): boolean;
|
|
70
88
|
static shouldWriteFailed(entry: ServerSendingHealthEntry, reason: string, now: Date): boolean;
|
|
89
|
+
static shouldWriteThrottled(entry: ServerSendingHealthEntry, now: Date): boolean;
|
|
90
|
+
static shouldWriteRecipientRefused(entry: ServerSendingHealthEntry, recipient: string, reason: string, now: Date): boolean;
|
|
91
|
+
static isFailureScope(value: unknown): value is ServerSendingFailureScope;
|
|
71
92
|
static isChannel(value: unknown): value is ServerSendingChannel;
|
|
72
93
|
static isState(value: unknown): value is ServerSendingState;
|
|
73
94
|
static parseAnswer(value: unknown): ServerSendingStatusAnswer | null;
|