@oneuptime/common 12.0.20 → 12.0.22
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/AnalyticsModels/ChangeEvent.ts +331 -0
- package/Models/AnalyticsModels/Index.ts +2 -0
- package/Models/DatabaseModels/Index.ts +2 -0
- package/Models/DatabaseModels/UserTwoFactorBackupCode.ts +262 -0
- package/Server/API/UserTwoFactorBackupCodeAPI.ts +258 -0
- package/Server/EnvironmentConfig.ts +1 -8
- package/Server/Infrastructure/Postgres/SchemaMigrations/1789000000000-AddUserSlackAndMicrosoftTeams.ts +42 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1789100000000-AddUserTwoFactorBackupCode.ts +63 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +2 -2
- package/Server/Services/ChangeEventService.ts +11 -0
- package/Server/Services/EnterpriseLicenseService.ts +3 -3
- package/Server/Services/Index.ts +4 -0
- package/Server/Services/UserService.ts +42 -0
- package/Server/Services/UserTwoFactorBackupCodeService.ts +355 -0
- package/Server/Utils/Attribution.ts +11 -11
- package/Server/Utils/Marketing/MarketingEventWebhook.ts +4 -5
- package/Server/Utils/Telemetry/ChangeEventRow.ts +228 -0
- package/Server/Utils/TwoFactorBackupCode.ts +266 -0
- package/Server/Views/Partials/AnalyticsConsent.ejs +3 -95
- package/Tests/App/Dashboard/DashboardChartWidgetZoom.test.tsx +64 -0
- package/Tests/App/Dashboard/EventOverlayHook.test.tsx +249 -0
- package/Tests/App/Dashboard/InvestigationArtifacts.test.tsx +315 -0
- package/Tests/App/Dashboard/InvestigationDrawer.test.tsx +258 -0
- package/Tests/App/Dashboard/MetricChartsCompare.test.tsx +171 -0
- package/Tests/App/Dashboard/MetricViewCompare.test.tsx +233 -0
- package/Tests/Server/API/UserAuthenticationAPI.test.ts +16 -3
- package/Tests/Server/API/UserTwoFactorAuthAdminAPI.test.ts +18 -2
- package/Tests/Server/API/UserTwoFactorBackupCodeAPI.test.ts +1390 -0
- package/Tests/Server/Infrastructure/Postgres/AddUserSlackAndMicrosoftTeamsMigration.test.ts +236 -0
- package/Tests/Server/Services/UserAuthenticationService.test.ts +23 -1
- package/Tests/Server/Services/UserTwoFactorAuthAdmin.test.ts +21 -0
- package/Tests/Server/Services/UserTwoFactorBackupCodeAdminSurface.test.ts +919 -0
- package/Tests/Server/Services/UserTwoFactorBackupCodeService.test.ts +862 -0
- package/Tests/Server/Utils/AI/SRE/Insights/Detectors/ExceptionIdentity.test.ts +224 -0
- package/Tests/Server/Utils/Attribution.test.ts +4 -5
- package/Tests/Server/Utils/Marketing/MarketingEventUtil.test.ts +2 -2
- package/Tests/Server/Utils/Monitor/MonitorCriteriaExpectationBuilder.test.ts +300 -0
- package/Tests/Server/Utils/TwoFactorBackupCode.test.ts +475 -0
- package/Tests/UI/Components/Charts/ChartGhostSeries.test.tsx +103 -0
- package/Tests/UI/Components/Charts/TooltipEntries.test.ts +44 -8
- package/Tests/Utils/Telemetry/CrossSignalScope.test.ts +13 -2
- package/Types/AnalyticsDatabase/AnalyticsTableName.ts +7 -0
- package/Types/Email/EmailTemplateType.ts +2 -0
- package/Types/Marketing/Attribution.ts +9 -15
- package/Types/Marketing/MarketingEvent.ts +10 -46
- package/Types/UserAuthenticationStatus.ts +16 -0
- package/UI/Components/Charts/Area/AreaChart.tsx +15 -0
- package/UI/Components/Charts/ChartGroup/ChartGroup.tsx +16 -1
- package/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.tsx +189 -93
- package/UI/Components/Charts/ChartLibrary/BarChart/BarChart.tsx +6 -1
- package/UI/Components/Charts/ChartLibrary/LineChart/LineChart.tsx +213 -114
- package/UI/Components/Charts/ChartLibrary/Utils/TooltipEntries.ts +42 -27
- package/UI/Components/Charts/Line/LineChart.tsx +15 -0
- package/Utils/Metrics/MetricExplorerUrl.ts +119 -5
- package/Utils/Telemetry/CrossSignalScope.ts +19 -10
- package/build/dist/Models/AnalyticsModels/ChangeEvent.js +298 -0
- package/build/dist/Models/AnalyticsModels/ChangeEvent.js.map +1 -0
- package/build/dist/Models/AnalyticsModels/Index.js +2 -0
- package/build/dist/Models/AnalyticsModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Index.js +2 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserTwoFactorBackupCode.js +277 -0
- package/build/dist/Models/DatabaseModels/UserTwoFactorBackupCode.js.map +1 -0
- package/build/dist/Server/API/UserTwoFactorBackupCodeAPI.js +201 -0
- package/build/dist/Server/API/UserTwoFactorBackupCodeAPI.js.map +1 -0
- package/build/dist/Server/EnvironmentConfig.js +1 -7
- package/build/dist/Server/EnvironmentConfig.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789000000000-AddUserSlackAndMicrosoftTeams.js +39 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789000000000-AddUserSlackAndMicrosoftTeams.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789100000000-AddUserTwoFactorBackupCode.js +46 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789100000000-AddUserTwoFactorBackupCode.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +2 -2
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Services/ChangeEventService.js +9 -0
- package/build/dist/Server/Services/ChangeEventService.js.map +1 -0
- package/build/dist/Server/Services/EnterpriseLicenseService.js +3 -3
- package/build/dist/Server/Services/Index.js +4 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/UserService.js +39 -0
- package/build/dist/Server/Services/UserService.js.map +1 -1
- package/build/dist/Server/Services/UserTwoFactorBackupCodeService.js +327 -0
- package/build/dist/Server/Services/UserTwoFactorBackupCodeService.js.map +1 -0
- package/build/dist/Server/Utils/Attribution.js +6 -6
- package/build/dist/Server/Utils/Marketing/MarketingEventWebhook.js +4 -5
- package/build/dist/Server/Utils/Marketing/MarketingEventWebhook.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/ChangeEventRow.js +150 -0
- package/build/dist/Server/Utils/Telemetry/ChangeEventRow.js.map +1 -0
- package/build/dist/Server/Utils/TwoFactorBackupCode.js +269 -0
- package/build/dist/Server/Utils/TwoFactorBackupCode.js.map +1 -0
- package/build/dist/Types/AnalyticsDatabase/AnalyticsTableName.js +7 -0
- package/build/dist/Types/AnalyticsDatabase/AnalyticsTableName.js.map +1 -1
- package/build/dist/Types/Email/EmailTemplateType.js +2 -0
- package/build/dist/Types/Email/EmailTemplateType.js.map +1 -1
- package/build/dist/Types/Marketing/Attribution.js +9 -15
- package/build/dist/Types/Marketing/Attribution.js.map +1 -1
- package/build/dist/Types/Marketing/MarketingEvent.js +2 -33
- package/build/dist/Types/Marketing/MarketingEvent.js.map +1 -1
- package/build/dist/UI/Components/Charts/Area/AreaChart.js +1 -1
- package/build/dist/UI/Components/Charts/Area/AreaChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js +9 -1
- package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js +92 -38
- package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js +8 -8
- package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js +95 -37
- package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/Utils/TooltipEntries.js +39 -24
- package/build/dist/UI/Components/Charts/ChartLibrary/Utils/TooltipEntries.js.map +1 -1
- package/build/dist/UI/Components/Charts/Line/LineChart.js +1 -1
- package/build/dist/UI/Components/Charts/Line/LineChart.js.map +1 -1
- package/build/dist/Utils/Metrics/MetricExplorerUrl.js +81 -0
- package/build/dist/Utils/Metrics/MetricExplorerUrl.js.map +1 -1
- package/build/dist/Utils/Telemetry/CrossSignalScope.js +14 -8
- package/build/dist/Utils/Telemetry/CrossSignalScope.js.map +1 -1
- package/package.json +1 -1
- package/Server/Infrastructure/Postgres/SchemaMigrations/1788900000000-RedactStoredMonitorIngestSecrets.ts +0 -117
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1788900000000-RedactStoredMonitorIngestSecrets.js +0 -106
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1788900000000-RedactStoredMonitorIngestSecrets.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChangeEventRow.js","sourceRoot":"","sources":["../../../../../Server/Utils/Telemetry/ChangeEventRow.ts"],"names":[],"mappings":"AACA,OAAO,aAAa,MAAM,qBAAqB,CAAC;AAChD,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAQ/C;;;;GAIG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAW,GAAG,CAAC;AACxD,MAAM,CAAC,MAAM,uCAAuC,GAAW,EAAE,CAAC;AAElE,mEAAmE;AACnE,MAAM,CAAC,MAAM,6BAA6B,GAAW,GAAG,CAAC;AACzD,MAAM,CAAC,MAAM,6BAA6B,GAAW,GAAG,CAAC;AACzD,MAAM,CAAC,MAAM,mCAAmC,GAAW,IAAI,CAAC;AAChE,MAAM,CAAC,MAAM,4BAA4B,GAAW,EAAE,CAAC;AACvD,MAAM,CAAC,MAAM,2BAA2B,GAAW,EAAE,CAAC;AAEtD,MAAM,CAAC,MAAM,yBAAyB,GAAW,YAAY,CAAC;AAE9D;;;;GAIG;AACH,MAAM,CAAC,MAAM,sCAAsC,GAAW,GAAG,CAAC;AAWlE,SAAS,cAAc,CAAC,KAAc;IACpC,IAAI,OAAO,KAAK,K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AC,KAAK,EACnB,WAAW,EAAE,MAAM,CAAC,WAAW,EAC/B,UAAU,EACV,aAAa,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,IAAI,EAAE,EAC7C,aAAa,EAAE,aAAa,CAAC,oBAAoB,CAAC,aAAa,CAAC,GAC5C,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { EncryptionSecret } from "../EnvironmentConfig";
|
|
11
|
+
import CaptureSpan from "./Telemetry/CaptureSpan";
|
|
12
|
+
import crypto from "crypto";
|
|
13
|
+
/*
|
|
14
|
+
* Single-use recovery codes for an account whose second factor is gone --
|
|
15
|
+
* the phone that held the authenticator app, or the security key that is now
|
|
16
|
+
* in a taxi somewhere.
|
|
17
|
+
*
|
|
18
|
+
* WHY THIS IS SERVER-ONLY
|
|
19
|
+
*
|
|
20
|
+
* Nothing in this file falls back to Math.random. Common/Utils/UUID does, on
|
|
21
|
+
* purpose, because it is bundled into the dashboard and has to keep producing
|
|
22
|
+
* well-formed ids in a browser with no Web Crypto -- which is exactly why
|
|
23
|
+
* ObjectID.generate() must never mint a code here. A backup code is a
|
|
24
|
+
* password-equivalent credential; if the platform cannot produce secure
|
|
25
|
+
* randomness, generation must throw rather than quietly emit something
|
|
26
|
+
* predictable. Common/Server/Utils/VerificationCode.ts makes the same call for
|
|
27
|
+
* the same reason.
|
|
28
|
+
*
|
|
29
|
+
* THE CODE SPACE
|
|
30
|
+
*
|
|
31
|
+
* Ten characters drawn uniformly from a 32 symbol alphabet is 2^50 codes, and
|
|
32
|
+
* a user holds ten of them at once -- so a blind guess lands with probability
|
|
33
|
+
* ~10/2^50, about one in 10^14. That is far beyond anything the rate limiter
|
|
34
|
+
* needs to defend, which matters because it settles the design question a TOTP
|
|
35
|
+
* code cannot settle: the six digit space is small enough that the limiter IS
|
|
36
|
+
* the control, whereas here the code itself is.
|
|
37
|
+
*
|
|
38
|
+
* THE HASH
|
|
39
|
+
*
|
|
40
|
+
* Codes are stored as HMAC-SHA256 keyed by the instance's EncryptionSecret,
|
|
41
|
+
* never in the clear, and the fast keyed-digest lane is the RIGHT one here
|
|
42
|
+
* rather than scrypt. scrypt exists to make guessing a low-entropy,
|
|
43
|
+
* human-chosen secret expensive; a code minted above has no low-entropy
|
|
44
|
+
* structure to guess, so the cost would buy nothing and would be paid on every
|
|
45
|
+
* verification. Keying with the EncryptionSecret is what a bare SHA-256 would
|
|
46
|
+
* miss: it lives in configuration rather than in Postgres, so a database dump
|
|
47
|
+
* on its own cannot be run through a dictionary of every possible code.
|
|
48
|
+
*
|
|
49
|
+
* The digest is deterministic given (userId, code), which is deliberate and is
|
|
50
|
+
* what makes single-use consumption a single conditional UPDATE rather than a
|
|
51
|
+
* read of every one of the user's rows followed by a comparison of each. A
|
|
52
|
+
* per-row salt would forfeit that for no gain -- see the note on domain
|
|
53
|
+
* separation below for the property it would have been bought for, which the
|
|
54
|
+
* userId already provides.
|
|
55
|
+
*/
|
|
56
|
+
/**
|
|
57
|
+
* Crockford's Base32 alphabet: the digits and the uppercase letters, minus
|
|
58
|
+
* I, L, O and U.
|
|
59
|
+
*
|
|
60
|
+
* These codes get read off a screen and typed back in months later, possibly
|
|
61
|
+
* from a piece of paper in a drawer, so the alphabet is chosen for the eye
|
|
62
|
+
* rather than for density. I/1, L/1 and O/0 are the pairs people transcribe
|
|
63
|
+
* wrongly; U is dropped by Crockford so that no code can spell an obscenity
|
|
64
|
+
* at a user who did nothing to deserve one.
|
|
65
|
+
*
|
|
66
|
+
* Exactly 32 symbols, so each character carries a clean five bits and the
|
|
67
|
+
* entropy arithmetic in the header comment is exact rather than approximate.
|
|
68
|
+
*/
|
|
69
|
+
export const BackupCodeAlphabet = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
70
|
+
/** Characters per code. Ten symbols over a 32 symbol alphabet is 2^50. */
|
|
71
|
+
export const BackupCodeLength = 10;
|
|
72
|
+
/**
|
|
73
|
+
* How many codes a user is issued at once.
|
|
74
|
+
*
|
|
75
|
+
* Ten is enough that losing a phone does not become an emergency after the
|
|
76
|
+
* second sign-in, and small enough that the printed list is one short block a
|
|
77
|
+
* person will actually keep.
|
|
78
|
+
*/
|
|
79
|
+
export const BackupCodeSetSize = 10;
|
|
80
|
+
/** Characters per group in the displayed form, e.g. `AB3D5-9XZQ2`. */
|
|
81
|
+
const DISPLAY_GROUP_LENGTH = 5;
|
|
82
|
+
/*
|
|
83
|
+
* Prefixed into every digest so a stored hash is bound to the scheme that
|
|
84
|
+
* produced it. If the construction below ever has to change, old rows keep
|
|
85
|
+
* verifying under the version they were written with instead of silently
|
|
86
|
+
* failing to match and locking a user out of their own recovery codes.
|
|
87
|
+
*/
|
|
88
|
+
const HASH_SCHEME_VERSION = "v1";
|
|
89
|
+
/*
|
|
90
|
+
* Characters a person plausibly types in place of a symbol that is not in the
|
|
91
|
+
* alphabet. Applied before the strip below, so `O` becomes `0` rather than
|
|
92
|
+
* being deleted -- deleting it would shorten the code and guarantee a
|
|
93
|
+
* mismatch, which is the confusing failure this map exists to avoid.
|
|
94
|
+
*/
|
|
95
|
+
const AMBIGUOUS_CHARACTER_MAP = {
|
|
96
|
+
I: "1",
|
|
97
|
+
L: "1",
|
|
98
|
+
O: "0",
|
|
99
|
+
};
|
|
100
|
+
export default class TwoFactorBackupCode {
|
|
101
|
+
/**
|
|
102
|
+
* One code, drawn uniformly from the alphabet above.
|
|
103
|
+
*
|
|
104
|
+
* `crypto.randomInt` per character rather than `randomBytes(n) % 32`. The
|
|
105
|
+
* modulo version happens to be uniform for this alphabet only because 32
|
|
106
|
+
* divides 256, and it stops being uniform the moment somebody edits the
|
|
107
|
+
* alphabet -- silently, with no test that would notice. `randomInt` rejects
|
|
108
|
+
* out-of-range draws internally for whatever bound it is given, so the
|
|
109
|
+
* uniformity does not depend on a coincidence nobody wrote down.
|
|
110
|
+
*/
|
|
111
|
+
static generateCode() {
|
|
112
|
+
let code = "";
|
|
113
|
+
for (let index = 0; index < BackupCodeLength; index++) {
|
|
114
|
+
code += BackupCodeAlphabet.charAt(crypto.randomInt(0, BackupCodeAlphabet.length));
|
|
115
|
+
}
|
|
116
|
+
return code;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* A full set of distinct codes.
|
|
120
|
+
*
|
|
121
|
+
* Duplicates are not a security problem -- at 2^50 the birthday odds across
|
|
122
|
+
* ten draws are around 4e-14 -- but a duplicate WOULD be a correctness
|
|
123
|
+
* problem downstream: two rows sharing a digest means consuming one leaves a
|
|
124
|
+
* second, identical, still-valid code behind, so a "single-use" code would
|
|
125
|
+
* work twice. Cheaper to rule out here than to reason about there.
|
|
126
|
+
*/
|
|
127
|
+
static generateCodeSet(count = BackupCodeSetSize) {
|
|
128
|
+
const codes = new Set();
|
|
129
|
+
while (codes.size < count) {
|
|
130
|
+
codes.add(TwoFactorBackupCode.generateCode());
|
|
131
|
+
}
|
|
132
|
+
return Array.from(codes);
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* The form shown to the user: one hyphen in the middle, for the same reason
|
|
136
|
+
* the alphabet drops ambiguous letters -- a ten character run is hard to
|
|
137
|
+
* read back without losing your place.
|
|
138
|
+
*
|
|
139
|
+
* Purely cosmetic. `normalizeCode` strips the hyphen straight back out, so
|
|
140
|
+
* a user may type the code with it, without it, or with the spaces their
|
|
141
|
+
* password manager pasted in.
|
|
142
|
+
*/
|
|
143
|
+
static formatForDisplay(code) {
|
|
144
|
+
const groups = [];
|
|
145
|
+
for (let index = 0; index < code.length; index += DISPLAY_GROUP_LENGTH) {
|
|
146
|
+
groups.push(code.substring(index, index + DISPLAY_GROUP_LENGTH));
|
|
147
|
+
}
|
|
148
|
+
return groups.join("-");
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Reduce whatever the user typed to the canonical form the digest is
|
|
152
|
+
* computed over.
|
|
153
|
+
*
|
|
154
|
+
* Everything here is about not rejecting somebody who supplied exactly the
|
|
155
|
+
* right secret material: the display hyphen, the spaces a clipboard adds,
|
|
156
|
+
* lowercase from a phone keyboard, and the three transcription confusions
|
|
157
|
+
* the alphabet was chosen to make survivable. Anything still outside the
|
|
158
|
+
* alphabet after that is dropped rather than rejected -- this is a
|
|
159
|
+
* canonicaliser, not a validator; the digest comparison is what decides
|
|
160
|
+
* whether a code is real.
|
|
161
|
+
*
|
|
162
|
+
* @param rawCode - The code exactly as submitted.
|
|
163
|
+
* @returns The code reduced to alphabet symbols, uppercase.
|
|
164
|
+
*/
|
|
165
|
+
static normalizeCode(rawCode) {
|
|
166
|
+
/*
|
|
167
|
+
* The code arrives straight off a JSON body, so it is only a string
|
|
168
|
+
* because the client chose to send one. A number or an object here must
|
|
169
|
+
* fail verification, not throw out of `.toUpperCase` and surface as a 500.
|
|
170
|
+
*/
|
|
171
|
+
if (typeof rawCode !== "string" || !rawCode) {
|
|
172
|
+
return "";
|
|
173
|
+
}
|
|
174
|
+
let normalized = "";
|
|
175
|
+
for (const character of rawCode.toUpperCase()) {
|
|
176
|
+
const mapped = AMBIGUOUS_CHARACTER_MAP[character] || character;
|
|
177
|
+
if (BackupCodeAlphabet.includes(mapped)) {
|
|
178
|
+
normalized += mapped;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return normalized;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* The digest stored for one of `userId`'s codes.
|
|
185
|
+
*
|
|
186
|
+
* Domain separated by the owning user, which is what stops one precomputed
|
|
187
|
+
* table from inverting every account's codes at once and stops two users who
|
|
188
|
+
* happen to be issued the same code from being visibly linked by a matching
|
|
189
|
+
* row. The user id is known at verification time -- the password has already
|
|
190
|
+
* been accepted by then -- so binding to it costs nothing.
|
|
191
|
+
*
|
|
192
|
+
* Both parts are LENGTH-PREFIXED into the message rather than merely
|
|
193
|
+
* concatenated, so no pair of (userId, code) values can be rearranged into
|
|
194
|
+
* the same byte string as another pair. Concatenation alone is a real
|
|
195
|
+
* ambiguity, not a theoretical one: without prefixes, ("ab", "cd") and
|
|
196
|
+
* ("abc", "d") hash identically.
|
|
197
|
+
*/
|
|
198
|
+
static hashCode(data) {
|
|
199
|
+
const message = [
|
|
200
|
+
HASH_SCHEME_VERSION,
|
|
201
|
+
data.userId.toString(),
|
|
202
|
+
TwoFactorBackupCode.normalizeCode(data.code),
|
|
203
|
+
]
|
|
204
|
+
.map((part) => {
|
|
205
|
+
return `${part.length}:${part}`;
|
|
206
|
+
})
|
|
207
|
+
.join("");
|
|
208
|
+
return crypto
|
|
209
|
+
.createHmac("sha256", EncryptionSecret.toString())
|
|
210
|
+
.update(message)
|
|
211
|
+
.digest("hex");
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Compare two digests without leaking, through timing, how many leading
|
|
215
|
+
* characters matched.
|
|
216
|
+
*
|
|
217
|
+
* The consume path compares digests in Postgres rather than here, so this is
|
|
218
|
+
* for callers that already hold both -- but it exists so that nobody writing
|
|
219
|
+
* one reaches for `===` and hands an attacker a way to recover a stored hash
|
|
220
|
+
* one character at a time.
|
|
221
|
+
*
|
|
222
|
+
* Lengths are compared first because `crypto.timingSafeEqual` THROWS on a
|
|
223
|
+
* length mismatch. Digests here are always 64 hex characters, so an early
|
|
224
|
+
* exit only happens on malformed input, where the length is not the secret.
|
|
225
|
+
*/
|
|
226
|
+
static isHashEqual(a, b) {
|
|
227
|
+
if (!a || !b || a.length !== b.length) {
|
|
228
|
+
return false;
|
|
229
|
+
}
|
|
230
|
+
return crypto.timingSafeEqual(Buffer.from(a, "utf8"), Buffer.from(b, "utf8"));
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
__decorate([
|
|
234
|
+
CaptureSpan(),
|
|
235
|
+
__metadata("design:type", Function),
|
|
236
|
+
__metadata("design:paramtypes", []),
|
|
237
|
+
__metadata("design:returntype", String)
|
|
238
|
+
], TwoFactorBackupCode, "generateCode", null);
|
|
239
|
+
__decorate([
|
|
240
|
+
CaptureSpan(),
|
|
241
|
+
__metadata("design:type", Function),
|
|
242
|
+
__metadata("design:paramtypes", [Number]),
|
|
243
|
+
__metadata("design:returntype", Array)
|
|
244
|
+
], TwoFactorBackupCode, "generateCodeSet", null);
|
|
245
|
+
__decorate([
|
|
246
|
+
CaptureSpan(),
|
|
247
|
+
__metadata("design:type", Function),
|
|
248
|
+
__metadata("design:paramtypes", [String]),
|
|
249
|
+
__metadata("design:returntype", String)
|
|
250
|
+
], TwoFactorBackupCode, "formatForDisplay", null);
|
|
251
|
+
__decorate([
|
|
252
|
+
CaptureSpan(),
|
|
253
|
+
__metadata("design:type", Function),
|
|
254
|
+
__metadata("design:paramtypes", [String]),
|
|
255
|
+
__metadata("design:returntype", String)
|
|
256
|
+
], TwoFactorBackupCode, "normalizeCode", null);
|
|
257
|
+
__decorate([
|
|
258
|
+
CaptureSpan(),
|
|
259
|
+
__metadata("design:type", Function),
|
|
260
|
+
__metadata("design:paramtypes", [Object]),
|
|
261
|
+
__metadata("design:returntype", String)
|
|
262
|
+
], TwoFactorBackupCode, "hashCode", null);
|
|
263
|
+
__decorate([
|
|
264
|
+
CaptureSpan(),
|
|
265
|
+
__metadata("design:type", Function),
|
|
266
|
+
__metadata("design:paramtypes", [String, String]),
|
|
267
|
+
__metadata("design:returntype", Boolean)
|
|
268
|
+
], TwoFactorBackupCode, "isHashEqual", null);
|
|
269
|
+
//# sourceMappingURL=TwoFactorBackupCode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TwoFactorBackupCode.js","sourceRoot":"","sources":["../../../../Server/Utils/TwoFactorBackupCode.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,WAAW,MAAM,yBAAyB,CAAC;AAClD,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAW,kCAAkC,CAAC;AAE7E,0EAA0E;AAC1E,MAAM,CAAC,MAAM,gBAAgB,GAAW,EAAE,CAAC;AAE3C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAW,EAAE,CAAC;AAE5C,sEAAsE;AACtE,MAAM,oBAAoB,GAAW,CAAC,CAAC;AAEvC;;;;;GAKG;AACH,MAAM,mBAAmB,GAAW,IAAI,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,uBAAuB,GAA2B;IACtD,CAAC,EAAE,GAAG;IACN,CAAC,EAAE,GAAG;IACN,CAAC,EAAE,GAAG;CACP,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,mBAAmB;IACtC;;;;;;;;;OASG;IAEW,AAAP,MAAM,CAAC,YAAY;QACxB,IAAI,IAAI,GAAW,EAAE,CAAC;QAEtB,KAAK,IAAI,KAAK,GAAW,CAAC,EAAE,KAAK,GAAG,gBAAgB,EAAE,KAAK,EAAE,EAAE,CAAC;YAC9D,IAAI,IAAI,kBAAkB,CAAC,MAAM,CAC/B,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAC/C,CAAC;QACJ,CAAC;QAED,O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idecar for arbitrary-field filtering.
|
|
9
9
|
*/
|
|
10
10
|
AnalyticsTableName["SecurityEvent"] = "SecurityEventItemV1";
|
|
11
|
+
/*
|
|
12
|
+
* Deploy/config-change markers posted by CI/CD, rendered as dashed
|
|
13
|
+
* vertical lines on metric charts. Peer of LogItemV3 in layout (tenant
|
|
14
|
+
* projectId, per-row retentionDate TTL, attributes Map + keys sidecar)
|
|
15
|
+
* but tiny in volume.
|
|
16
|
+
*/
|
|
17
|
+
AnalyticsTableName["ChangeEvent"] = "ChangeEventV1";
|
|
11
18
|
AnalyticsTableName["Metric"] = "MetricItemV3";
|
|
12
19
|
AnalyticsTableName["ExceptionInstance"] = "ExceptionItemV3";
|
|
13
20
|
AnalyticsTableName["Span"] = "SpanItemV3";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnalyticsTableName.js","sourceRoot":"","sources":["../../../../Types/AnalyticsDatabase/AnalyticsTableName.ts"],"names":[],"mappings":"AAAA,IAAK,
|
|
1
|
+
{"version":3,"file":"AnalyticsTableName.js","sourceRoot":"","sources":["../../../../Types/AnalyticsDatabase/AnalyticsTableName.ts"],"names":[],"mappings":"AAAA,IAAK,kBAoFJ;AApFD,WAAK,kBAAkB;IACrB,uCAAiB,CAAA;IACjB;;;;;OAKG;IACH,2DAAqC,CAAA;IACrC;;;;;OAKG;IACH,mDAA6B,CAAA;IAC7B,6CAAuB,CAAA;IACvB,2DAAqC,CAAA;IACrC,yCAAmB,CAAA;IACnB,iDAA2B,CAAA;IAC3B,mDAA6B,CAAA;IAC7B,+CAAyB,CAAA;IACzB,2DAAqC,CAAA;IACrC,6CAAuB,CAAA;IACvB,6EAAuD,CAAA;IACvD;;;;;OAKG;IACH,6DAAuC,CAAA;IACvC;;;;OAIG;IACH,6EAAuD,CAAA;IACvD;;;;;;OAMG;IACH,+EAAyD,CAAA;IACzD,qFAA+D,CAAA;IAC/D,mFAA6D,CAAA;IAC7D,mEAA6C,CAAA;IAC7C;;;;;;OAMG;IACH,6DAAuC,CAAA;IACvC,2DAAqC,CAAA;IACrC,yDAAmC,CAAA;IACnC;;;;;;;OAOG;IACH,+CAAyB,CAAA;IACzB;;;;;;;;;;;;;OAaG;IACH,iDAA2B,CAAA;IAC3B,2DAAqC,CAAA;AACvC,CAAC,EApFI,kBAAkB,KAAlB,kBAAkB,QAoFtB;AAED,eAAe,kBAAkB,CAAC"}
|
|
@@ -11,6 +11,8 @@ var EmailTemplateType;
|
|
|
11
11
|
EmailTemplateType["ConfirmStatusPageSubscription"] = "ConfirmStatusPageSubscription.hbs";
|
|
12
12
|
EmailTemplateType["EmailVerified"] = "EmailVerified.hbs";
|
|
13
13
|
EmailTemplateType["PasswordChanged"] = "PasswordChanged.hbs";
|
|
14
|
+
EmailTemplateType["TwoFactorBackupCodeUsed"] = "TwoFactorBackupCodeUsed.hbs";
|
|
15
|
+
EmailTemplateType["TwoFactorBackupCodesRegenerated"] = "TwoFactorBackupCodesRegenerated.hbs";
|
|
14
16
|
EmailTemplateType["ProbeOwnerAdded"] = "ProbeOwnerAdded.hbs";
|
|
15
17
|
EmailTemplateType["InviteMember"] = "InviteMember.hbs";
|
|
16
18
|
EmailTemplateType["EmailChanged"] = "EmailChanged.hbs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmailTemplateType.js","sourceRoot":"","sources":["../../../../Types/Email/EmailTemplateType.ts"],"names":[],"mappings":"AAAA,IAAK,
|
|
1
|
+
{"version":3,"file":"EmailTemplateType.js","sourceRoot":"","sources":["../../../../Types/Email/EmailTemplateType.ts"],"names":[],"mappings":"AAAA,IAAK,iBAkGJ;AAlGD,WAAK,iBAAiB;IACpB,wDAAmC,CAAA;IACnC,0DAAqC,CAAA;IACrC,sDAAiC,CAAA;IACjC,kEAA6C,CAAA;IAC7C,sEAAiD,CAAA;IACjD,oFAA+D,CAAA;IAC/D,wFAAmE,CAAA;IACnE,gEAA2C,CAAA;IAC3C,wFAAmE,CAAA;IACnE,wDAAmC,CAAA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CAAA;IACnC,8DAAyC,CAAA;IACzC,oEAA+C,CAAA;IAC/C,8DAAyC,CAAA;IACzC,4EAAuD,CAAA;IACvD,kFAA6D,CAAA;IAE7D,4EAAuD,CAAA;IACvD,oFAA+D,CAAA;IAC/D,oFAA+D,CAAA;IAC/D,0EAAqD,CAAA;IACrD,8FAAyE,CAAA;IAEzE,kFAA6D,CAAA;IAC7D,4CAAuB,CAAA;IAEvB,gFAA2D,CAAA;IAC3D,kEAA6C,CAAA;IAC7C,wEAAmD,CAAA;IAEnD,8FAAyE,CAAA;IACzE,4FAAuE,CAAA;AACzE,CAAC,EAlGI,iBAAiB,KAAjB,iBAAiB,QAkGrB;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -3,19 +3,14 @@
|
|
|
3
3
|
* writes it.
|
|
4
4
|
*
|
|
5
5
|
* Attribution starts in the browser (Home/Views/head-basic.ejs stores it in
|
|
6
|
-
* localStorage) and reaches the server through
|
|
6
|
+
* localStorage) and reaches the server through the signup form
|
|
7
|
+
* (App/FeatureSet/Accounts/src/Pages/Register.tsx), which posts it onto the
|
|
8
|
+
* User record.
|
|
7
9
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* /enterprise/demo, /support, /enterprise/self-hosted — goes through it.
|
|
13
|
-
*
|
|
14
|
-
* Both doors are reachable by an unauthenticated caller, so both must whitelist
|
|
15
|
-
* and length-bound what they accept. Keeping the key lists here rather than in
|
|
16
|
-
* each door means a key added for the browser cannot be silently dropped by one
|
|
17
|
-
* of the readers — which is exactly what happened to UTM parameters on the Cal
|
|
18
|
-
* path, where the webhook parsed click IDs the embed never sent.
|
|
10
|
+
* That door is reachable by an unauthenticated caller, so it must whitelist and
|
|
11
|
+
* length-bound what it accepts. Keeping the key lists here rather than in the
|
|
12
|
+
* door itself means a key added for the browser cannot be silently dropped on
|
|
13
|
+
* arrival.
|
|
19
14
|
*/
|
|
20
15
|
// Ad-platform click identifiers, in the spelling each platform uses on the URL.
|
|
21
16
|
export const AdClickIdKeys = [
|
|
@@ -29,9 +24,8 @@ export const AdClickIdKeys = [
|
|
|
29
24
|
"rdt_cid",
|
|
30
25
|
];
|
|
31
26
|
/*
|
|
32
|
-
* UTM parameters travel as snake_case on a URL and
|
|
33
|
-
*
|
|
34
|
-
* Both spellings are accepted on the way in — Cal booking questions and hand
|
|
27
|
+
* UTM parameters travel as snake_case on a URL and as camelCase once they are
|
|
28
|
+
* columns on User/Project. Both spellings are accepted on the way in — hand
|
|
35
29
|
* written links produce either — and only the camelCase form is stored.
|
|
36
30
|
*/
|
|
37
31
|
export const UtmWireKeyToPropertyKey = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Attribution.js","sourceRoot":"","sources":["../../../../Types/Marketing/Attribution.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"Attribution.js","sourceRoot":"","sources":["../../../../Types/Marketing/Attribution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,gFAAgF;AAChF,MAAM,CAAC,MAAM,aAAa,GAAkB;IAC1C,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,WAAW;IACX,QAAQ;IACR,SAAS;CACV,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAA2B;IAC7D,UAAU,EAAE,WAAW;IACvB,UAAU,EAAE,WAAW;IACvB,YAAY,EAAE,aAAa;IAC3B,QAAQ,EAAE,SAAS;IACnB,WAAW,EAAE,YAAY;CAC1B,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAkB,MAAM,CAAC,MAAM,CACzD,uBAAuB,CACxB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAW,QAAQ,CAAC;AAElD;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAkB;IACjD,GAAG,eAAe;IAClB,YAAY;IACZ,UAAU;IACV,WAAW;CACZ,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAW,GAAG,CAAC"}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*
|
|
12
12
|
* - DEDUPLICATION. `eventId` is stable for a given real-world occurrence, so
|
|
13
13
|
* a redelivery carries the id the first attempt did. Retries are expected
|
|
14
|
-
* (the queue retries
|
|
14
|
+
* (the delivery queue retries), so a receiver that keys on
|
|
15
15
|
* anything else will double-count.
|
|
16
16
|
* - ORDERING. Events are delivered per-occurrence with no sequence number.
|
|
17
17
|
* A signup and a plan change seconds apart may arrive either way round;
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
export var MarketingEventType;
|
|
26
26
|
(function (MarketingEventType) {
|
|
27
27
|
MarketingEventType["SignUp"] = "sign_up";
|
|
28
|
-
MarketingEventType["MeetingBooked"] = "meeting_booked";
|
|
29
28
|
/*
|
|
30
29
|
* A project's first paid subscription, created together with the project.
|
|
31
30
|
*
|
|
@@ -44,39 +43,9 @@ export var MarketingEventType;
|
|
|
44
43
|
* whose email is typed in by a human rather than captured from a session —
|
|
45
44
|
* which is exactly what makes it joinable: set EnterpriseLicense.email to
|
|
46
45
|
* the address the customer booked with and this event shares an identity
|
|
47
|
-
* with
|
|
46
|
+
* with whatever else that address has done, months earlier.
|
|
48
47
|
*/
|
|
49
48
|
MarketingEventType["EnterpriseLicenseIssued"] = "enterprise_license_issued";
|
|
50
49
|
})(MarketingEventType || (MarketingEventType = {}));
|
|
51
|
-
/*
|
|
52
|
-
* Which conversation a booked meeting actually is.
|
|
53
|
-
*
|
|
54
|
-
* All three Cal embeds book the same event type (oneuptimehq/demo), so without
|
|
55
|
-
* this the webhook cannot tell a free user's support call from a net-new
|
|
56
|
-
* enterprise demo — they arrive as one undifferentiated `meeting_booked`, and
|
|
57
|
-
* anything bidding on or reporting against that count values them identically.
|
|
58
|
-
*
|
|
59
|
-
* The browser event has carried this since the embeds were instrumented; the
|
|
60
|
-
* webhook did not, which meant the authoritative record was the one that could
|
|
61
|
-
* not make the distinction.
|
|
62
|
-
*
|
|
63
|
-
* `Unknown` is a real state, not a failure: a booking made through a Cal link
|
|
64
|
-
* that was not one of the instrumented embeds genuinely has no kind, and is
|
|
65
|
-
* still a booking worth emitting.
|
|
66
|
-
*/
|
|
67
|
-
export var MeetingBookingKind;
|
|
68
|
-
(function (MeetingBookingKind) {
|
|
69
|
-
MeetingBookingKind["EnterpriseDemo"] = "enterprise_demo";
|
|
70
|
-
MeetingBookingKind["SupportCall"] = "support_call";
|
|
71
|
-
MeetingBookingKind["ArchitectureAssessment"] = "architecture_assessment";
|
|
72
|
-
MeetingBookingKind["Unknown"] = "unknown";
|
|
73
|
-
})(MeetingBookingKind || (MeetingBookingKind = {}));
|
|
74
|
-
/*
|
|
75
|
-
* The Cal booking-metadata key the embeds write and the webhook reads. Shared
|
|
76
|
-
* so a rename cannot land on one side only - the failure mode there is silent,
|
|
77
|
-
* because a booking with no recognised kind still succeeds.
|
|
78
|
-
*/
|
|
79
|
-
export const BOOKING_KIND_METADATA_KEY = "ou_booking_kind";
|
|
80
|
-
export const MeetingBookingKinds = Object.values(MeetingBookingKind);
|
|
81
50
|
export const MARKETING_EVENT_SCHEMA_VERSION = 1;
|
|
82
51
|
//# sourceMappingURL=MarketingEvent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarketingEvent.js","sourceRoot":"","sources":["../../../../Types/Marketing/MarketingEvent.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"MarketingEvent.js","sourceRoot":"","sources":["../../../../Types/Marketing/MarketingEvent.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAN,IAAY,kBAuBX;AAvBD,WAAY,kBAAkB;IAC5B,wCAAkB,CAAA;IAClB;;;;;;;OAOG;IACH,kEAA4C,CAAA;IAC5C,oEAA8C,CAAA;IAC9C,wEAAkD,CAAA;IAClD;;;;;;;;OAQG;IACH,2EAAqD,CAAA;AACvD,CAAC,EAvBW,kBAAkB,KAAlB,kBAAkB,QAuB7B;AAED,MAAM,CAAC,MAAM,8BAA8B,GAAW,CAAC,CAAC"}
|
|
@@ -108,7 +108,7 @@ const AreaChartElement = (props) => {
|
|
|
108
108
|
? formattedTimeReferenceLines
|
|
109
109
|
: undefined, formattedReferenceRegions: formattedReferenceRegions.length > 0
|
|
110
110
|
? formattedReferenceRegions
|
|
111
|
-
: undefined, formattedExemplarPoints: formattedExemplars.length > 0 ? formattedExemplars : undefined, onExemplarClick: props.onExemplarClick, onTimeRangeSelect: props.onTimeRangeSelect, anomalyBandLowerKey: bandLower, anomalyBandUpperKey: bandUpper })),
|
|
111
|
+
: undefined, formattedExemplarPoints: formattedExemplars.length > 0 ? formattedExemplars : undefined, onExemplarClick: props.onExemplarClick, onTimeRangeSelect: props.onTimeRangeSelect, onBucketClick: props.onBucketClick, ghostCategories: props.ghostSeriesNames, anomalyBandLowerKey: bandLower, anomalyBandUpperKey: bandUpper })),
|
|
112
112
|
hasNoData && React.createElement(NoDataMessage, null)));
|
|
113
113
|
};
|
|
114
114
|
export default AreaChartElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AreaChart.js","sourceRoot":"","sources":["../../../../../../UI/Components/Charts/Area/AreaChart.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAKhE,OAAO,KAAK,EAAE,EAGZ,SAAS,EACT,OAAO,GACR,MAAM,OAAO,CAAC;AAIf,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAuB,EACrB,2BAA2B,GAC5B,MAAM,sCAAsC,CAAC;AAI9C,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,kBAAkB,MAAM,yBAAyB,CAAC;AAKzD,OAAO,SAAS,M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zB,2BAA2B,CAAC,MAAM,GAAG,CAAC;gBACpC,CAAC,CAAC,2BAA2B;gBAC7B,CAAC,CAAC,SAAS,EAEf,yBAAyB,EACvB,yBAAyB,CAAC,MAAM,GAAG,CAAC;gBAClC,CAAC,CAAC,yBAAyB;gBAC3B,CAAC,CAAC,SAAS,EAEf,uBAAuB,EACrB,kBAAkB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,SAAS,EAEhE,eAAe,EAAE,KAAK,CAAC,eAAe,EACtC,iBAAiB,EAAE,KAAK,CAAC,iBAAiB,EAC1C,aAAa,EAAE,KAAK,CAAC,aAAa,EAClC,eAAe,EAAE,KAAK,CAAC,gBAAgB,EACvC,mBAAmB,EAAE,SAAS,EAC9B,mBAAmB,EAAE,SAAS,IAC9B;QACD,SAAS,IAAI,oBAAC,aAAa,OAAG,CAC3B,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -14,7 +14,15 @@ export var ChartType;
|
|
|
14
14
|
ChartType["AREA"] = "area";
|
|
15
15
|
})(ChartType || (ChartType = {}));
|
|
16
16
|
const ChartGroup = (props) => {
|
|
17
|
-
|
|
17
|
+
/*
|
|
18
|
+
* Stable per-mount fallback: a plain const regenerated the id on every
|
|
19
|
+
* render, which forced recharts to tear down and re-subscribe its sync
|
|
20
|
+
* listeners on each parent re-render (auto-refresh ticks included).
|
|
21
|
+
*/
|
|
22
|
+
const [fallbackSyncId] = useState(() => {
|
|
23
|
+
return Text.generateRandomText(10);
|
|
24
|
+
});
|
|
25
|
+
const syncId = props.syncId || fallbackSyncId;
|
|
18
26
|
const [metricInfoModalChart, setMetricInfoModalChart] = useState(null);
|
|
19
27
|
const getChartContent = (chart, index) => {
|
|
20
28
|
/*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartGroup.js","sourceRoot":"","sources":["../../../../../../UI/Components/Charts/ChartGroup/ChartGroup.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