@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,211 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.MIN_QUOTED_TITLE_LENGTH = void 0;
7
+ const AIChatTypes_1 = require("./AIChatTypes");
8
+ const CodeTask_1 = require("./CodeTask");
9
+ const ObjectID_1 = __importDefault(require("../ObjectID"));
10
+ /*
11
+ * The shortest title, in characters, a pull request is held to quote
12
+ * (CarriedRecords.quotedFromLists): a shorter one ("Outage") is a word or
13
+ * two a pull request writes for reasons of its own.
14
+ */
15
+ exports.MIN_QUOTED_TITLE_LENGTH = 8;
16
+ // The list widgets of a chat, and the kind of record each one's rows are.
17
+ const LIST_WIDGET_KINDS = [
18
+ { type: AIChatTypes_1.AIChatWidgetType.IncidentList, kind: "incident" },
19
+ { type: AIChatTypes_1.AIChatWidgetType.AlertList, kind: "alert" },
20
+ ];
21
+ class CarriedRecords {
22
+ static none() {
23
+ return { incidentIds: [], alertIds: [] };
24
+ }
25
+ static isNone(records) {
26
+ return records.incidentIds.length === 0 && records.alertIds.length === 0;
27
+ }
28
+ // An id as the lists keep it: a UUID in lower case, or null.
29
+ static readId(value) {
30
+ const text = value instanceof ObjectID_1.default
31
+ ? value.toString()
32
+ : typeof value === "string"
33
+ ? value
34
+ : "";
35
+ const id = text.trim().toLowerCase();
36
+ return ObjectID_1.default.isValidUUID(id) ? id : null;
37
+ }
38
+ // The records named, each once, any that is no id left out.
39
+ static of(data) {
40
+ return {
41
+ incidentIds: CarriedRecords.readIds(data.incidentIds),
42
+ alertIds: CarriedRecords.readIds(data.alertIds),
43
+ };
44
+ }
45
+ /*
46
+ * What a turn's request carries: every incident and alert its context
47
+ * names (taskContext.request.context). Read from the context as stored,
48
+ * whatever else the request holds, so a request that could not be asked
49
+ * again still says what it carried.
50
+ */
51
+ static ofTaskContext(taskContext) {
52
+ var _a;
53
+ const context = taskContext && typeof taskContext === "object"
54
+ ? (_a = taskContext.request) === null || _a === void 0 ? void 0 : _a.context
55
+ : undefined;
56
+ if (!Array.isArray(context)) {
57
+ return CarriedRecords.none();
58
+ }
59
+ const incidentIds = [];
60
+ const alertIds = [];
61
+ for (const item of context) {
62
+ if (!item || typeof item !== "object") {
63
+ continue;
64
+ }
65
+ const type = item.type;
66
+ const recordId = item.recordId;
67
+ if (type === CodeTask_1.CodeTaskContextType.Incident) {
68
+ incidentIds.push(recordId);
69
+ }
70
+ else if (type === CodeTask_1.CodeTaskContextType.Alert) {
71
+ alertIds.push(recordId);
72
+ }
73
+ }
74
+ return CarriedRecords.of({
75
+ incidentIds: incidentIds,
76
+ alertIds: alertIds,
77
+ });
78
+ }
79
+ // What a row's keys list.
80
+ static ofRow(row) {
81
+ return CarriedRecords.of({
82
+ incidentIds: Array.isArray(row === null || row === void 0 ? void 0 : row.carriedIncidentIds)
83
+ ? row.carriedIncidentIds
84
+ : [],
85
+ alertIds: Array.isArray(row === null || row === void 0 ? void 0 : row.carriedAlertIds) ? row.carriedAlertIds : [],
86
+ });
87
+ }
88
+ /*
89
+ * What a chat opened one by one (#9242): every incident and alert a
90
+ * citation names on its own - a tool that read that one record (its
91
+ * details, its timeline) or acted on it (a note, a new state), cited by
92
+ * the record's page (IncidentView, AlertView) with its id - from a result
93
+ * that found it. A list's citation names no one record, and a result
94
+ * that found nothing (no rows: no such record, or not one the person may
95
+ * read) read nothing of one.
96
+ */
97
+ static openedByCitations(citations) {
98
+ var _a, _b, _c;
99
+ const incidentIds = [];
100
+ const alertIds = [];
101
+ for (const citation of Array.isArray(citations) ? citations : []) {
102
+ if (!citation ||
103
+ typeof citation !== "object" ||
104
+ !(Number(citation.rowCount) > 0)) {
105
+ continue;
106
+ }
107
+ const params = ((_a = citation.target) === null || _a === void 0 ? void 0 : _a.params) && typeof citation.target.params === "object"
108
+ ? citation.target.params
109
+ : {};
110
+ if (((_b = citation.target) === null || _b === void 0 ? void 0 : _b.type) === AIChatTypes_1.AIChatCitationTargetType.IncidentView) {
111
+ incidentIds.push(params["incidentId"]);
112
+ }
113
+ else if (((_c = citation.target) === null || _c === void 0 ? void 0 : _c.type) === AIChatTypes_1.AIChatCitationTargetType.AlertView) {
114
+ alertIds.push(params["alertId"]);
115
+ }
116
+ }
117
+ return CarriedRecords.of({ incidentIds, alertIds });
118
+ }
119
+ /*
120
+ * What a pull request quotes of the records a list showed a chat (#9242):
121
+ * every incident and alert a list of the chat held (an IncidentList or
122
+ * AlertList widget: a list of incidents or alerts, a search of them) whose
123
+ * title `text` - the pull request's title and description - contains,
124
+ * whatever its case and its runs of white space, a title at least
125
+ * MIN_QUOTED_TITLE_LENGTH characters long. The other rows a list showed
126
+ * are not carried: they were in front of the model, not in the pull
127
+ * request, and a list of fifty would tie the pull request to all fifty.
128
+ */
129
+ static quotedFromLists(data) {
130
+ var _a, _b;
131
+ const text = CarriedRecords.normalizeForQuote(data.text);
132
+ const incidentIds = [];
133
+ const alertIds = [];
134
+ if (!text) {
135
+ return CarriedRecords.none();
136
+ }
137
+ for (const widget of Array.isArray(data.widgets) ? data.widgets : []) {
138
+ const kind = (_a = LIST_WIDGET_KINDS.find((each) => {
139
+ return Boolean(widget) && widget.type === each.type;
140
+ })) === null || _a === void 0 ? void 0 : _a.kind;
141
+ const items = (_b = widget === null || widget === void 0 ? void 0 : widget.data) === null || _b === void 0 ? void 0 : _b.items;
142
+ if (!kind || !Array.isArray(items)) {
143
+ continue;
144
+ }
145
+ for (const item of items) {
146
+ if (!item || typeof item !== "object" || Array.isArray(item)) {
147
+ continue;
148
+ }
149
+ const title = CarriedRecords.normalizeForQuote(item["title"]);
150
+ if (Array.from(title).length < exports.MIN_QUOTED_TITLE_LENGTH ||
151
+ !text.includes(title)) {
152
+ continue;
153
+ }
154
+ (kind === "incident" ? incidentIds : alertIds).push(item["id"]);
155
+ }
156
+ }
157
+ return CarriedRecords.of({ incidentIds, alertIds });
158
+ }
159
+ // Every record any of them carries, each once, in the order first named.
160
+ static merge(...records) {
161
+ const incidentIds = [];
162
+ const alertIds = [];
163
+ for (const each of records) {
164
+ if (!each) {
165
+ continue;
166
+ }
167
+ incidentIds.push(...each.incidentIds);
168
+ alertIds.push(...each.alertIds);
169
+ }
170
+ return CarriedRecords.of({ incidentIds, alertIds });
171
+ }
172
+ // Those of `records` that `already` does not carry.
173
+ static without(records, already) {
174
+ return {
175
+ incidentIds: records.incidentIds.filter((id) => {
176
+ return !already.incidentIds.includes(id);
177
+ }),
178
+ alertIds: records.alertIds.filter((id) => {
179
+ return !already.alertIds.includes(id);
180
+ }),
181
+ };
182
+ }
183
+ /*
184
+ * Writes them onto a row's keys: a key carrying none is left out, so the
185
+ * row holds null there and costs its readers nothing.
186
+ */
187
+ static writeTo(row, records) {
188
+ row.carriedIncidentIds =
189
+ records.incidentIds.length > 0 ? [...records.incidentIds] : undefined;
190
+ row.carriedAlertIds =
191
+ records.alertIds.length > 0 ? [...records.alertIds] : undefined;
192
+ }
193
+ // Text as a quote is looked for in it: lower case, each run of white space one space.
194
+ static normalizeForQuote(value) {
195
+ if (typeof value !== "string") {
196
+ return "";
197
+ }
198
+ return value.toLowerCase().split(/\s+/).filter(Boolean).join(" ");
199
+ }
200
+ static readIds(values) {
201
+ const ids = [];
202
+ for (const value of values || []) {
203
+ const id = CarriedRecords.readId(value);
204
+ if (id && !ids.includes(id)) {
205
+ ids.push(id);
206
+ }
207
+ }
208
+ return ids;
209
+ }
210
+ }
211
+ exports.default = CarriedRecords;
@@ -0,0 +1,3 @@
1
+ import commonJsModule from "./CarriedRecords.js";
2
+ export default commonJsModule.default;
3
+ export const MIN_QUOTED_TITLE_LENGTH = commonJsModule.MIN_QUOTED_TITLE_LENGTH;
@@ -0,0 +1,6 @@
1
+ export declare const SET_PASSWORD_LINK_EXPIRY_DAYS: number;
2
+ export declare const SET_PASSWORD_PAGE_ROUTE: string;
3
+ export declare const RESET_PASSWORD_PAGE_ROUTE: string;
4
+ export declare const SET_PASSWORD_LINK_HAS_PASSWORD_MESSAGE: string;
5
+ export declare const SET_PASSWORD_LINK_CANNOT_BE_EMAILED_MESSAGE: string;
6
+ export declare const PASSWORD_RESET_LINK_CANNOT_BE_EMAILED_MESSAGE: string;
@@ -0,0 +1,6 @@
1
+ export declare const SET_PASSWORD_LINK_EXPIRY_DAYS: number;
2
+ export declare const SET_PASSWORD_PAGE_ROUTE: string;
3
+ export declare const RESET_PASSWORD_PAGE_ROUTE: string;
4
+ export declare const SET_PASSWORD_LINK_HAS_PASSWORD_MESSAGE: string;
5
+ export declare const SET_PASSWORD_LINK_CANNOT_BE_EMAILED_MESSAGE: string;
6
+ export declare const PASSWORD_RESET_LINK_CANNOT_BE_EMAILED_MESSAGE: string;
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ /*
3
+ * A LINK TO SET THE FIRST PASSWORD OF AN ACCOUNT SOMEBODY ELSE CREATED (#9139).
4
+ *
5
+ * A master admin who creates a user in the Admin Dashboard (Users > Create
6
+ * User) does not have to make up a password and pass it on: OneUptime emails
7
+ * the new user a link to choose their own. It is the password reset link
8
+ * with another page and other words, and nothing else:
9
+ *
10
+ * - the same token: a random UUID from the CSPRNG, stored only as its hash
11
+ * in User.resetPasswordToken, so a new reset or set-password link
12
+ * replaces it, a new email address or password ends it, and it works once
13
+ * (UserService.sendPasswordResetLink);
14
+ * - redeemed by the same endpoint, POST /identity/reset-password, which
15
+ * holds it to the one password rule (Types/Password), clears it and marks
16
+ * the address verified - there is no second way to set a password;
17
+ * - a token route (Common/UI/Utils/SensitiveUrlToken): the token leaves the
18
+ * address bar before anything else on the page reads it.
19
+ *
20
+ * What differs is what the account has: an account with no password yet gets
21
+ * this link - "set your password", for SET_PASSWORD_LINK_EXPIRY_DAYS, since a
22
+ * new person may not open their mail the same day - and an account with one
23
+ * gets the reset link, for a day. The server decides, from the account, never
24
+ * from the caller.
25
+ *
26
+ * Pure, with no Node or browser APIs: the server, the Accounts page and the
27
+ * Admin Dashboard read the same numbers.
28
+ */
29
+ Object.defineProperty(exports, "__esModule", { value: true });
30
+ exports.PASSWORD_RESET_LINK_CANNOT_BE_EMAILED_MESSAGE = exports.SET_PASSWORD_LINK_CANNOT_BE_EMAILED_MESSAGE = exports.SET_PASSWORD_LINK_HAS_PASSWORD_MESSAGE = exports.RESET_PASSWORD_PAGE_ROUTE = exports.SET_PASSWORD_PAGE_ROUTE = exports.SET_PASSWORD_LINK_EXPIRY_DAYS = void 0;
31
+ // How long a set-password link works.
32
+ exports.SET_PASSWORD_LINK_EXPIRY_DAYS = 7;
33
+ // The Accounts page each link opens: /accounts/<route>/<token>.
34
+ exports.SET_PASSWORD_PAGE_ROUTE = "/set-password";
35
+ exports.RESET_PASSWORD_PAGE_ROUTE = "/reset-password";
36
+ /*
37
+ * What a master admin is told when they ask for a set-password link to copy
38
+ * for an account that has a password already: handing them a link to set it
39
+ * would be a way round "Password Changed" for an account that is in use.
40
+ */
41
+ exports.SET_PASSWORD_LINK_HAS_PASSWORD_MESSAGE = "This user already has a password, so there is no set-password link to copy. Send them a password reset link from their Authentication page instead.";
42
+ /*
43
+ * What a master admin is told when the server cannot send email at all, so
44
+ * the link is not even made: what did not happen, then what to do.
45
+ */
46
+ exports.SET_PASSWORD_LINK_CANNOT_BE_EMAILED_MESSAGE = "This server cannot send email yet. Set up email under Settings > Emails.";
47
+ exports.PASSWORD_RESET_LINK_CANNOT_BE_EMAILED_MESSAGE = "This server cannot send email yet, so no password reset link was emailed. Set up email under Settings > Emails, or set their password yourself.";
@@ -0,0 +1,7 @@
1
+ import commonJsModule from "./SetPasswordLink.js";
2
+ export const PASSWORD_RESET_LINK_CANNOT_BE_EMAILED_MESSAGE = commonJsModule.PASSWORD_RESET_LINK_CANNOT_BE_EMAILED_MESSAGE;
3
+ export const RESET_PASSWORD_PAGE_ROUTE = commonJsModule.RESET_PASSWORD_PAGE_ROUTE;
4
+ export const SET_PASSWORD_LINK_CANNOT_BE_EMAILED_MESSAGE = commonJsModule.SET_PASSWORD_LINK_CANNOT_BE_EMAILED_MESSAGE;
5
+ export const SET_PASSWORD_LINK_EXPIRY_DAYS = commonJsModule.SET_PASSWORD_LINK_EXPIRY_DAYS;
6
+ export const SET_PASSWORD_LINK_HAS_PASSWORD_MESSAGE = commonJsModule.SET_PASSWORD_LINK_HAS_PASSWORD_MESSAGE;
7
+ export const SET_PASSWORD_PAGE_ROUTE = commonJsModule.SET_PASSWORD_PAGE_ROUTE;
@@ -134,6 +134,6 @@ class DatabaseCommonInteractionPropsUtil {
134
134
  ];
135
135
  }
136
136
  }
137
- DatabaseCommonInteractionPropsUtil.AUTHENTICATION_REQUIRED_MESSAGE = "Authentication required. Please log in to access this resource.";
137
+ DatabaseCommonInteractionPropsUtil.AUTHENTICATION_REQUIRED_MESSAGE = "Authentication required. Please sign in to access this resource.";
138
138
  DatabaseCommonInteractionPropsUtil.READ_ONLY_CREDENTIAL_MESSAGE = "This MCP client was connected with read-only access, so it cannot make changes. Connect it again and allow read and write access.";
139
139
  exports.default = DatabaseCommonInteractionPropsUtil;
@@ -169,6 +169,7 @@ export interface ProductionReviewDataImpactJSON {
169
169
  }
170
170
  export interface ProductionReviewPointJSON {
171
171
  text: string;
172
+ incidentIds?: Array<string> | undefined;
172
173
  }
173
174
  export interface ProductionReviewPullRequestJSON {
174
175
  number: number;
@@ -253,6 +254,10 @@ export declare class ProductionReviewUtil {
253
254
  }): ProductionReviewPosting.Review | ProductionReviewPosting.Link;
254
255
  static hasSignal(report: Pick<ProductionReviewReport, "exceptions" | "operations" | "hotFunctions" | "incidents" | "suspectDeploys" | "dataImpact">): boolean;
255
256
  static getNotableIncidents(incidents: ProductionReviewIncidentsJSON): Array<ProductionReviewIncidentJSON>;
257
+ static keepReadableIncidents(report: ProductionReviewReport, isReadable: (incidentId: string) => boolean): ProductionReviewReport;
258
+ static getIncidentIds(report: ProductionReviewReport | null | undefined): Array<string>;
259
+ private static restsOnAny;
260
+ private static isWordCharacter;
256
261
  static summarize(report: ProductionReviewReport): ProductionReviewSummaryJSON;
257
262
  static shortSha(sha: string | null | undefined): string;
258
263
  static readPullRequestNumber(raw: unknown): number | null;
@@ -169,6 +169,7 @@ export interface ProductionReviewDataImpactJSON {
169
169
  }
170
170
  export interface ProductionReviewPointJSON {
171
171
  text: string;
172
+ incidentIds?: Array<string> | undefined;
172
173
  }
173
174
  export interface ProductionReviewPullRequestJSON {
174
175
  number: number;
@@ -253,6 +254,10 @@ export declare class ProductionReviewUtil {
253
254
  }): ProductionReviewPosting.Review | ProductionReviewPosting.Link;
254
255
  static hasSignal(report: Pick<ProductionReviewReport, "exceptions" | "operations" | "hotFunctions" | "incidents" | "suspectDeploys" | "dataImpact">): boolean;
255
256
  static getNotableIncidents(incidents: ProductionReviewIncidentsJSON): Array<ProductionReviewIncidentJSON>;
257
+ static keepReadableIncidents(report: ProductionReviewReport, isReadable: (incidentId: string) => boolean): ProductionReviewReport;
258
+ static getIncidentIds(report: ProductionReviewReport | null | undefined): Array<string>;
259
+ private static restsOnAny;
260
+ private static isWordCharacter;
256
261
  static summarize(report: ProductionReviewReport): ProductionReviewSummaryJSON;
257
262
  static shortSha(sha: string | null | undefined): string;
258
263
  static readPullRequestNumber(raw: unknown): number | null;
@@ -176,6 +176,8 @@ exports.PULL_REQUEST_NUMBER_MARKS = [
176
176
  ];
177
177
  // The hidden line every production review comment starts with.
178
178
  exports.PRODUCTION_REVIEW_COMMENT_MARKER = "<!-- oneuptime-production-review -->";
179
+ // One character of a word or a number, in any script: a letter, a digit, "_".
180
+ const WORD_CHARACTER = new RegExp("[\\p{L}\\p{N}_]", "u");
179
181
  class ProductionReviewUtil {
180
182
  // A stored choice, read: unset or unknown is the default.
181
183
  static readContent(value) {
@@ -227,6 +229,112 @@ class ProductionReviewUtil {
227
229
  return incident.isOpen || Boolean(incident.mentions);
228
230
  });
229
231
  }
232
+ /*
233
+ * A REVIEW AS ITS READER MAY READ IT (#9241).
234
+ *
235
+ * A review is worked out once, and kept on its task's outcome: an
236
+ * incident on it was no private one then (ProductionReviewFindings reads
237
+ * none), but it can be made private - or deleted - afterwards, and the
238
+ * review is read from what was kept. So whoever reads a review reads only
239
+ * the incidents they may read now (`isReadable`, by id; the server asks
240
+ * the incidents themselves as the reader, ProductionReviewReadFilter):
241
+ *
242
+ * - every other incident leaves the list, with its label, severity,
243
+ * state, the changed code its root cause names and its link;
244
+ * - the counts drop by the ones that left: in all, and open;
245
+ * - a point of OneUptime AI's read that rests on one of them goes too:
246
+ * it names the incident, and what its root cause says. A point kept
247
+ * before the incidents it rests on were recorded goes when its text
248
+ * names a hidden incident's label.
249
+ *
250
+ * The comment on the pull request is left as it was posted: it was the
251
+ * code host's, written while the incident was not private. The same
252
+ * report when nothing is hidden; a copy otherwise.
253
+ */
254
+ static keepReadableIncidents(report, isReadable) {
255
+ var _a;
256
+ const items = Array.isArray((_a = report.incidents) === null || _a === void 0 ? void 0 : _a.items)
257
+ ? report.incidents.items
258
+ : [];
259
+ const hidden = items.filter((incident) => {
260
+ return !isReadable((incident.incidentId || "").toString().toLowerCase());
261
+ });
262
+ if (hidden.length === 0) {
263
+ return report;
264
+ }
265
+ const hiddenIds = new Set(hidden.map((incident) => {
266
+ return (incident.incidentId || "").toString().toLowerCase();
267
+ }));
268
+ const hiddenOpen = hidden.filter((incident) => {
269
+ return incident.isOpen;
270
+ }).length;
271
+ const points = (report.points || []).filter((point) => {
272
+ return !ProductionReviewUtil.restsOnAny(point, hidden, hiddenIds);
273
+ });
274
+ return {
275
+ ...report,
276
+ incidents: {
277
+ total: Math.max(0, (report.incidents.total || 0) - hidden.length),
278
+ open: Math.max(0, (report.incidents.open || 0) - hiddenOpen),
279
+ items: items.filter((incident) => {
280
+ return !hiddenIds.has((incident.incidentId || "").toString().toLowerCase());
281
+ }),
282
+ },
283
+ points,
284
+ };
285
+ }
286
+ // The ids of the incidents a review lists, lower-cased, each once.
287
+ static getIncidentIds(report) {
288
+ var _a;
289
+ const ids = [];
290
+ for (const incident of Array.isArray((_a = report === null || report === void 0 ? void 0 : report.incidents) === null || _a === void 0 ? void 0 : _a.items)
291
+ ? report.incidents.items
292
+ : []) {
293
+ const id = ((incident === null || incident === void 0 ? void 0 : incident.incidentId) || "").toString().toLowerCase();
294
+ if (id && !ids.includes(id)) {
295
+ ids.push(id);
296
+ }
297
+ }
298
+ return ids;
299
+ }
300
+ /*
301
+ * Whether a point rests on one of `hidden`: by the incidents it records,
302
+ * or - a point kept before they were recorded - by its text naming one's
303
+ * label as a whole word ("INC-45", "#45", never "#450"). A label without
304
+ * a digit ("Incident") names no one incident.
305
+ */
306
+ static restsOnAny(point, hidden, hiddenIds) {
307
+ if (Array.isArray(point.incidentIds)) {
308
+ return point.incidentIds.some((id) => {
309
+ return hiddenIds.has((id || "").toString().toLowerCase());
310
+ });
311
+ }
312
+ const text = (point.text || "").toLowerCase();
313
+ return hidden.some((incident) => {
314
+ const label = (incident.label || "").trim().toLowerCase();
315
+ if (!label ||
316
+ !Array.from(label).some((character) => {
317
+ return character >= "0" && character <= "9";
318
+ })) {
319
+ return false;
320
+ }
321
+ let from = text.indexOf(label);
322
+ while (from !== -1) {
323
+ const before = from > 0 ? text.charAt(from - 1) : "";
324
+ const after = text.charAt(from + label.length);
325
+ if (!ProductionReviewUtil.isWordCharacter(before) &&
326
+ !ProductionReviewUtil.isWordCharacter(after)) {
327
+ return true;
328
+ }
329
+ from = text.indexOf(label, from + 1);
330
+ }
331
+ return false;
332
+ });
333
+ }
334
+ // A letter or a digit of any script, or "_": part of a word, or a number.
335
+ static isWordCharacter(character) {
336
+ return character !== "" && WORD_CHARACTER.test(character);
337
+ }
230
338
  static summarize(report) {
231
339
  return {
232
340
  hasSignal: ProductionReviewUtil.hasSignal(report),
@@ -9,4 +9,5 @@ export default class DatabaseProperty extends SerializableObject {
9
9
  protected static _fromDatabase(value: string | number | JSONObject | JSONArray): DatabaseProperty | Array<DatabaseProperty> | null;
10
10
  protected static _toDatabase(value: DatabaseProperty | FindOperator<DatabaseProperty>): string | number | JSONObject | JSONArray | null;
11
11
  static getDatabaseTransformer(): ValueTransformer;
12
+ static getEncryptedDatabaseTransformer(): ValueTransformer;
12
13
  }
@@ -9,4 +9,5 @@ export default class DatabaseProperty extends SerializableObject {
9
9
  protected static _fromDatabase(value: string | number | JSONObject | JSONArray): DatabaseProperty | Array<DatabaseProperty> | null;
10
10
  protected static _toDatabase(value: DatabaseProperty | FindOperator<DatabaseProperty>): string | number | JSONObject | JSONArray | null;
11
11
  static getDatabaseTransformer(): ValueTransformer;
12
+ static getEncryptedDatabaseTransformer(): ValueTransformer;
12
13
  }
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const NotImplementedException_1 = __importDefault(require("../Exception/NotImplementedException"));
7
7
  const SerializableObject_1 = __importDefault(require("../SerializableObject"));
8
+ const EncryptedValue_1 = require("./EncryptedValue");
8
9
  const typeorm_1 = require("typeorm");
9
10
  class DatabaseProperty extends SerializableObject_1.default {
10
11
  constructor() {
@@ -98,5 +99,31 @@ class DatabaseProperty extends SerializableObject_1.default {
98
99
  },
99
100
  };
100
101
  }
102
+ /*
103
+ * The transformer of a column of this type kept encrypted at rest
104
+ * (TableColumn `encrypted: true`): a status page subscriber's Slack
105
+ * webhook, say, whose address is its credential.
106
+ *
107
+ * DatabaseService encrypts the text getDatabaseTransformer() writes for
108
+ * the value, and decrypts the stored text before that transformer reads it
109
+ * (DatabaseService.encrypt and decryptColumns). So what reaches this
110
+ * transformer is a ciphertext, handed on untouched both ways: read as a
111
+ * URL, it would be refused on its way in and taken for a broken address on
112
+ * its way out. Anything else goes through the type's own transformer, as
113
+ * on a column that is not encrypted: a value written before the column was
114
+ * encrypted reads as the value it is, and a query's operator is
115
+ * transformed as ever.
116
+ */
117
+ static getEncryptedDatabaseTransformer() {
118
+ const transformer = this.getDatabaseTransformer();
119
+ return {
120
+ to: (value) => {
121
+ return (0, EncryptedValue_1.isEncryptedValue)(value) ? value : transformer.to(value);
122
+ },
123
+ from: (value) => {
124
+ return (0, EncryptedValue_1.isEncryptedValue)(value) ? value : transformer.from(value);
125
+ },
126
+ };
127
+ }
101
128
  }
102
129
  exports.default = DatabaseProperty;
@@ -0,0 +1,2 @@
1
+ export declare const ENCRYPTED_VALUE_PREFIX: string;
2
+ export declare function isEncryptedValue(value: unknown): value is string;
@@ -0,0 +1,2 @@
1
+ export declare const ENCRYPTED_VALUE_PREFIX: string;
2
+ export declare function isEncryptedValue(value: unknown): value is string;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ENCRYPTED_VALUE_PREFIX = void 0;
4
+ exports.isEncryptedValue = isEncryptedValue;
5
+ /*
6
+ * HOW A VALUE KEPT ENCRYPTED AT REST BEGINS.
7
+ *
8
+ * DatabaseService keeps a column marked `encrypted: true` encrypted at rest
9
+ * (Server/Utils/Encryption): every value it stores there is CryptoJS's
10
+ * salted AES, base64, which begins with OpenSSL's "Salted__" header written
11
+ * in base64 - this prefix. Nothing else a column holds starts with it: a
12
+ * webhook address starts with its scheme, a community string or a token is
13
+ * never base64 of that header. So a stored value that does not start with
14
+ * it was written before its column was encrypted, and is read as it is
15
+ * until its data migration encrypts it (EncryptColumnInPlace).
16
+ *
17
+ * In Types, not beside the cipher, because a column's own TypeORM
18
+ * transformer has to tell a ciphertext apart too: a URL column hands one on
19
+ * untouched (DatabaseProperty.getEncryptedDatabaseTransformer), where
20
+ * parsing it as a URL would refuse it on its way in and read it as a broken
21
+ * address on its way out.
22
+ */
23
+ exports.ENCRYPTED_VALUE_PREFIX = "U2FsdGVkX1";
24
+ // Whether `value` is a ciphertext DatabaseService stored.
25
+ function isEncryptedValue(value) {
26
+ return typeof value === "string" && value.startsWith(exports.ENCRYPTED_VALUE_PREFIX);
27
+ }
@@ -0,0 +1,3 @@
1
+ import commonJsModule from "./EncryptedValue.js";
2
+ export const ENCRYPTED_VALUE_PREFIX = commonJsModule.ENCRYPTED_VALUE_PREFIX;
3
+ export const isEncryptedValue = commonJsModule.isEncryptedValue;
@@ -16,8 +16,11 @@ export interface TableColumnMetadata {
16
16
  hashed?: boolean;
17
17
  hashSaltColumn?: string;
18
18
  encrypted?: boolean;
19
+ encryptedFields?: Array<string>;
19
20
  secret?: boolean;
20
21
  shownOnce?: boolean;
22
+ presentedKey?: boolean;
23
+ lookupHashColumn?: string;
21
24
  manyToOneRelationColumn?: string;
22
25
  type: TableColumnType;
23
26
  canReadOnRelationQuery?: boolean;
@@ -16,8 +16,11 @@ export interface TableColumnMetadata {
16
16
  hashed?: boolean;
17
17
  hashSaltColumn?: string;
18
18
  encrypted?: boolean;
19
+ encryptedFields?: Array<string>;
19
20
  secret?: boolean;
20
21
  shownOnce?: boolean;
22
+ presentedKey?: boolean;
23
+ lookupHashColumn?: string;
21
24
  manyToOneRelationColumn?: string;
22
25
  type: TableColumnType;
23
26
  canReadOnRelationQuery?: boolean;
@@ -46,6 +46,7 @@ declare enum GlossaryTerm {
46
46
  Logs = "logs",
47
47
  Metrics = "metrics",
48
48
  Traces = "traces",
49
+ Span = "span",
49
50
  Profiles = "profiles",
50
51
  AILLM = "ai-llm",
51
52
  DataObservability = "data-observability",
@@ -46,6 +46,7 @@ declare enum GlossaryTerm {
46
46
  Logs = "logs",
47
47
  Metrics = "metrics",
48
48
  Traces = "traces",
49
+ Span = "span",
49
50
  Profiles = "profiles",
50
51
  AILLM = "ai-llm",
51
52
  DataObservability = "data-observability",
@@ -77,6 +77,8 @@ var GlossaryTerm;
77
77
  GlossaryTerm["Logs"] = "logs";
78
78
  GlossaryTerm["Metrics"] = "metrics";
79
79
  GlossaryTerm["Traces"] = "traces";
80
+ // One step of a trace: about 180 Traces strings say it (#9133).
81
+ GlossaryTerm["Span"] = "span";
80
82
  GlossaryTerm["Profiles"] = "profiles";
81
83
  GlossaryTerm["AILLM"] = "ai-llm";
82
84
  GlossaryTerm["DataObservability"] = "data-observability";
@@ -0,0 +1,20 @@
1
+ import { ServerSendingFailureScope } from "../ServerSending/ServerSendingStatus.mjs";
2
+ export declare const EmailSendFailureScope: typeof ServerSendingFailureScope;
3
+ export type EmailSendFailureScope = ServerSendingFailureScope;
4
+ export interface EmailSendFailureFacts {
5
+ message: string;
6
+ code?: string | undefined;
7
+ responseCode?: number | undefined;
8
+ command?: string | undefined;
9
+ fromEmail?: string | undefined;
10
+ toEmail?: string | undefined;
11
+ }
12
+ export default class EmailSendFailure {
13
+ static getUnverifiedIdentities(message: string): Array<string>;
14
+ static isUnverifiedIdentity(message: string): boolean;
15
+ static classify(facts: EmailSendFailureFacts): EmailSendFailureScope;
16
+ static readError(err: unknown, addresses: {
17
+ fromEmail?: string | undefined;
18
+ toEmail?: string | undefined;
19
+ }): EmailSendFailureFacts;
20
+ }
@@ -0,0 +1,20 @@
1
+ import { ServerSendingFailureScope } from "../ServerSending/ServerSendingStatus";
2
+ export declare const EmailSendFailureScope: typeof ServerSendingFailureScope;
3
+ export type EmailSendFailureScope = ServerSendingFailureScope;
4
+ export interface EmailSendFailureFacts {
5
+ message: string;
6
+ code?: string | undefined;
7
+ responseCode?: number | undefined;
8
+ command?: string | undefined;
9
+ fromEmail?: string | undefined;
10
+ toEmail?: string | undefined;
11
+ }
12
+ export default class EmailSendFailure {
13
+ static getUnverifiedIdentities(message: string): Array<string>;
14
+ static isUnverifiedIdentity(message: string): boolean;
15
+ static classify(facts: EmailSendFailureFacts): EmailSendFailureScope;
16
+ static readError(err: unknown, addresses: {
17
+ fromEmail?: string | undefined;
18
+ toEmail?: string | undefined;
19
+ }): EmailSendFailureFacts;
20
+ }