/
internal_pings.ts
39 lines (34 loc) · 1.3 KB
/
internal_pings.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import { DELETION_REQUEST_PING_NAME, EVENTS_PING_NAME } from "./constants.js";
import { InternalPingType as PingType} from "./pings/ping_type.js";
/**
* Glean-provided pings, all enabled by default.
*
* Pings initialized here should be defined in `./pings.yaml`
* and manually translated into JS code.
*/
class CorePings {
// This ping is intended to communicate to the Data Pipeline
// that the user wishes to have their reported Telemetry data deleted.
// As such it attempts to send itself at the moment the user opts out of data collection.
readonly deletionRequest: PingType;
// The events ping's purpose is to transport event metric information.
readonly events: PingType;
constructor() {
this.deletionRequest = new PingType({
name: DELETION_REQUEST_PING_NAME,
includeClientId: true,
sendIfEmpty: true,
reasonCodes: ["at_init", "set_upload_enabled"],
});
this.events = new PingType({
name: EVENTS_PING_NAME,
includeClientId: true,
sendIfEmpty: false,
reasonCodes: ["startup", "max_capacity"]
});
}
}
export default CorePings;