@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.
Files changed (154) hide show
  1. package/Models/DatabaseModels/AIAgent.js +2 -0
  2. package/Models/DatabaseModels/AIAgentTaskPullRequest.d.mts +2 -0
  3. package/Models/DatabaseModels/AIAgentTaskPullRequest.d.ts +2 -0
  4. package/Models/DatabaseModels/AIAgentTaskPullRequest.js +62 -0
  5. package/Models/DatabaseModels/AIRun.d.mts +2 -0
  6. package/Models/DatabaseModels/AIRun.d.ts +2 -0
  7. package/Models/DatabaseModels/AIRun.js +63 -0
  8. package/Models/DatabaseModels/CustomNotificationChannel.js +17 -9
  9. package/Models/DatabaseModels/DataProduct.js +3 -2
  10. package/Models/DatabaseModels/GlobalConfig.js +1 -1
  11. package/Models/DatabaseModels/IoTDeviceCredential.js +3 -1
  12. package/Models/DatabaseModels/Monitor.d.mts +4 -0
  13. package/Models/DatabaseModels/Monitor.d.ts +4 -0
  14. package/Models/DatabaseModels/Monitor.js +108 -5
  15. package/Models/DatabaseModels/NetworkDevice.js +43 -17
  16. package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js +38 -15
  17. package/Models/DatabaseModels/NetworkSnmpCredentialProfile.js +4 -4
  18. package/Models/DatabaseModels/OpenStackProjectNotice.js +29 -10
  19. package/Models/DatabaseModels/Probe.js +2 -0
  20. package/Models/DatabaseModels/ProjectSCIM.d.mts +2 -1
  21. package/Models/DatabaseModels/ProjectSCIM.d.ts +2 -1
  22. package/Models/DatabaseModels/ProjectSCIM.js +21 -9
  23. package/Models/DatabaseModels/Runbook.js +3 -2
  24. package/Models/DatabaseModels/Runner.js +2 -0
  25. package/Models/DatabaseModels/StatusPage.js +3 -2
  26. package/Models/DatabaseModels/StatusPageSCIM.d.mts +2 -1
  27. package/Models/DatabaseModels/StatusPageSCIM.d.ts +2 -1
  28. package/Models/DatabaseModels/StatusPageSCIM.js +17 -8
  29. package/Models/DatabaseModels/StatusPageSubscriber.js +35 -15
  30. package/Models/DatabaseModels/TelemetryIngestionKey.d.mts +2 -0
  31. package/Models/DatabaseModels/TelemetryIngestionKey.d.ts +2 -0
  32. package/Models/DatabaseModels/TelemetryIngestionKey.js +36 -1
  33. package/Models/DatabaseModels/UserWebhook.js +25 -17
  34. package/Models/DatabaseModels/WebhookLog.js +12 -2
  35. package/Models/DatabaseModels/Workflow.d.mts +3 -0
  36. package/Models/DatabaseModels/Workflow.d.ts +3 -0
  37. package/Models/DatabaseModels/Workflow.js +70 -1
  38. package/Server/Services/DatabaseService.d.mts +21 -1
  39. package/Server/Services/DatabaseService.d.ts +21 -1
  40. package/Types/AI/AIActionWords.js +1 -1
  41. package/Types/AI/CarriedRecords.d.mts +35 -0
  42. package/Types/AI/CarriedRecords.d.ts +35 -0
  43. package/Types/AI/CarriedRecords.js +211 -0
  44. package/Types/AI/CarriedRecords.mjs +3 -0
  45. package/Types/Accounts/SetPasswordLink.d.mts +6 -0
  46. package/Types/Accounts/SetPasswordLink.d.ts +6 -0
  47. package/Types/Accounts/SetPasswordLink.js +47 -0
  48. package/Types/Accounts/SetPasswordLink.mjs +7 -0
  49. package/Types/BaseDatabase/DatabaseCommonInteractionPropsUtil.js +1 -1
  50. package/Types/CodeRepository/ProductionReview.d.mts +5 -0
  51. package/Types/CodeRepository/ProductionReview.d.ts +5 -0
  52. package/Types/CodeRepository/ProductionReview.js +108 -0
  53. package/Types/Database/DatabaseProperty.d.mts +1 -0
  54. package/Types/Database/DatabaseProperty.d.ts +1 -0
  55. package/Types/Database/DatabaseProperty.js +27 -0
  56. package/Types/Database/EncryptedValue.d.mts +2 -0
  57. package/Types/Database/EncryptedValue.d.ts +2 -0
  58. package/Types/Database/EncryptedValue.js +27 -0
  59. package/Types/Database/EncryptedValue.mjs +3 -0
  60. package/Types/Database/TableColumn.d.mts +3 -0
  61. package/Types/Database/TableColumn.d.ts +3 -0
  62. package/Types/Docs/GlossaryTerm.d.mts +1 -0
  63. package/Types/Docs/GlossaryTerm.d.ts +1 -0
  64. package/Types/Docs/GlossaryTerm.js +2 -0
  65. package/Types/Email/EmailSendFailure.d.mts +20 -0
  66. package/Types/Email/EmailSendFailure.d.ts +20 -0
  67. package/Types/Email/EmailSendFailure.js +244 -0
  68. package/Types/Email/EmailSendFailure.mjs +3 -0
  69. package/Types/Email/EmailTemplateType.d.mts +1 -0
  70. package/Types/Email/EmailTemplateType.d.ts +1 -0
  71. package/Types/Email/EmailTemplateType.js +5 -0
  72. package/Types/Runner/RunnerCodeFixCapability.d.mts +3 -1
  73. package/Types/Runner/RunnerCodeFixCapability.d.ts +3 -1
  74. package/Types/Runner/RunnerCodeFixCapability.js +19 -1
  75. package/Types/Runner/RunnerCodeFixCapability.mjs +1 -0
  76. package/Types/SSO/SessionsWithoutSso.js +2 -2
  77. package/Types/ServerSending/ServerSendingStatus.d.mts +23 -2
  78. package/Types/ServerSending/ServerSendingStatus.d.ts +23 -2
  79. package/Types/ServerSending/ServerSendingStatus.js +208 -10
  80. package/Types/ServerSending/ServerSendingStatus.mjs +3 -0
  81. package/Types/ServerSetup/ServerSetupChecklist.js +5 -0
  82. package/Types/StatusPage/StatusPageMagicLink.js +1 -1
  83. package/Types/StatusPage/StatusPageSignInMessages.d.mts +3 -0
  84. package/Types/StatusPage/StatusPageSignInMessages.d.ts +3 -0
  85. package/Types/StatusPage/StatusPageSignInMessages.js +16 -0
  86. package/Types/StatusPage/StatusPageSignInMessages.mjs +4 -0
  87. package/Types/StatusPage/StatusPageSingleSignOnProtocol.d.mts +12 -0
  88. package/Types/StatusPage/StatusPageSingleSignOnProtocol.d.ts +12 -0
  89. package/Types/StatusPage/StatusPageSingleSignOnProtocol.js +63 -0
  90. package/Types/StatusPage/StatusPageSingleSignOnProtocol.mjs +8 -0
  91. package/Types/StatusPage/StatusPageSubscriberChannel.d.mts +18 -0
  92. package/Types/StatusPage/StatusPageSubscriberChannel.d.ts +18 -0
  93. package/Types/StatusPage/StatusPageSubscriberChannel.js +91 -0
  94. package/Types/StatusPage/StatusPageSubscriberChannel.mjs +10 -0
  95. package/Types/Workspace/ConnectCallback.d.mts +2 -1
  96. package/Types/Workspace/ConnectCallback.d.ts +2 -1
  97. package/Types/Workspace/ConnectCallback.js +8 -0
  98. package/Utils/AiRemediation/DeclaredCodeChange.d.mts +4 -1
  99. package/Utils/AiRemediation/DeclaredCodeChange.d.ts +4 -1
  100. package/Utils/AiRemediation/DeclaredCodeChange.js +6 -0
  101. package/Utils/Dashboard/MonitorListWidgetFormat.js +1 -1
  102. package/Utils/Incident/PostmortemActionItemCodeTask.d.mts +2 -0
  103. package/Utils/Incident/PostmortemActionItemCodeTask.d.ts +2 -0
  104. package/Utils/Incident/PostmortemActionItemCodeTask.js +22 -5
  105. package/Utils/Incident/PostmortemActionItemCodeTask.mjs +1 -0
  106. package/Utils/LookupTable.d.mts +1 -0
  107. package/Utils/LookupTable.d.ts +1 -0
  108. package/Utils/LookupTable.js +19 -0
  109. package/Utils/LookupTable.mjs +1 -0
  110. package/Utils/Monitor/MonitorFirstCheckOverdue.js +5 -5
  111. package/Utils/Monitor/MonitorOverviewFamily.d.mts +2 -10
  112. package/Utils/Monitor/MonitorOverviewFamily.d.ts +2 -10
  113. package/Utils/Monitor/MonitorOverviewFamily.js +19 -99
  114. package/Utils/Monitor/MonitorOverviewPresentationUtil.d.mts +1 -1
  115. package/Utils/Monitor/MonitorOverviewPresentationUtil.d.ts +1 -1
  116. package/Utils/Monitor/MonitorOverviewPresentationUtil.js +6 -6
  117. package/Utils/Monitor/MonitorRowStatus.js +2 -2
  118. package/Utils/Monitor/MonitorTypeFamily.d.mts +14 -0
  119. package/Utils/Monitor/MonitorTypeFamily.d.ts +14 -0
  120. package/Utils/Monitor/MonitorTypeFamily.js +105 -0
  121. package/Utils/Monitor/MonitorTypeFamily.mjs +3 -0
  122. package/Utils/Monitor/StoredCheckEvidence.d.mts +10 -0
  123. package/Utils/Monitor/StoredCheckEvidence.d.ts +10 -0
  124. package/Utils/Monitor/StoredCheckEvidence.js +53 -0
  125. package/Utils/Monitor/StoredCheckEvidence.mjs +5 -0
  126. package/Utils/NetworkDiscovery/SnmpScanConfigUtil.js +11 -4
  127. package/Utils/Project/ProjectBilling.d.mts +1 -0
  128. package/Utils/Project/ProjectBilling.d.ts +1 -0
  129. package/Utils/Project/ProjectBilling.js +9 -1
  130. package/Utils/Project/ProjectBilling.mjs +1 -0
  131. package/Utils/StatusPage/HistoryWindow.d.mts +3 -0
  132. package/Utils/StatusPage/HistoryWindow.d.ts +3 -0
  133. package/Utils/StatusPage/HistoryWindow.js +24 -0
  134. package/Utils/StatusPage/HistoryWindow.mjs +4 -0
  135. package/Utils/Suggestions/CodeFixSuggestion.d.mts +2 -1
  136. package/Utils/Suggestions/CodeFixSuggestion.d.ts +2 -1
  137. package/Utils/Suggestions/CodeFixSuggestion.js +9 -0
  138. package/Utils/Suggestions/InvestigationCodeFixSuggestion.d.mts +1 -0
  139. package/Utils/Suggestions/InvestigationCodeFixSuggestion.d.ts +1 -0
  140. package/Utils/Suggestions/InvestigationCodeFixSuggestion.js +24 -3
  141. package/Utils/Suggestions/InvestigationCodeFixSuggestion.mjs +1 -0
  142. package/Utils/Suggestions/ProfileFixSuggestion.d.mts +1 -0
  143. package/Utils/Suggestions/ProfileFixSuggestion.d.ts +1 -0
  144. package/Utils/Suggestions/ProfileFixSuggestion.js +16 -4
  145. package/Utils/Suggestions/TelemetryAiFixSuggestion.d.mts +2 -0
  146. package/Utils/Suggestions/TelemetryAiFixSuggestion.d.ts +2 -0
  147. package/Utils/Suggestions/TelemetryAiFixSuggestion.js +17 -5
  148. package/Utils/Suggestions/TelemetryAiFixSuggestion.mjs +1 -0
  149. package/Utils/Suggestions/TracePerformanceFixSuggestion.js +16 -7
  150. package/Utils/WebhookAddressMask.d.mts +9 -0
  151. package/Utils/WebhookAddressMask.d.ts +9 -0
  152. package/Utils/WebhookAddressMask.js +66 -0
  153. package/Utils/WebhookAddressMask.mjs +2 -0
  154. 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;
@@ -0,0 +1,3 @@
1
+ import commonJsModule from "./EmailSendFailure.js";
2
+ export default commonJsModule.default;
3
+ export const EmailSendFailureScope = commonJsModule.EmailSendFailureScope;
@@ -1,6 +1,7 @@
1
1
  declare enum EmailTemplateType {
2
2
  BlankTemplate = "BlankTemplate.hbs",
3
3
  ForgotPassword = "ForgotPassword.hbs",
4
+ SetPassword = "SetPassword.hbs",
4
5
  MagicLink = "MagicLink.hbs",
5
6
  ProbeOffline = "ProbeOffline.hbs",
6
7
  SignupWelcomeEmail = "SignupWelcomeEmail.hbs",
@@ -1,6 +1,7 @@
1
1
  declare enum EmailTemplateType {
2
2
  BlankTemplate = "BlankTemplate.hbs",
3
3
  ForgotPassword = "ForgotPassword.hbs",
4
+ SetPassword = "SetPassword.hbs",
4
5
  MagicLink = "MagicLink.hbs",
5
6
  ProbeOffline = "ProbeOffline.hbs",
6
7
  SignupWelcomeEmail = "SignupWelcomeEmail.hbs",
@@ -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 for Login (Admin Dashboard > Settings > Single
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 for Login first.";
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 shouldWriteSucceeded(entry: ServerSendingHealthEntry, now: Date): boolean;
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 shouldWriteSucceeded(entry: ServerSendingHealthEntry, now: Date): boolean;
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;