summaryrefslogtreecommitdiff
path: root/packages/backend/src/services/chart/charts/ap-request.ts
blob: e9e42ade7f61425b995bfbdef0b2618090b1a97e (plain)
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
import Chart, { KVs } from '../core.js';
import { name, schema } from './entities/ap-request.js';

/**
 * Chart about ActivityPub requests
 */
// eslint-disable-next-line import/no-default-export
export default class ApRequestChart extends Chart<typeof schema> {
	constructor() {
		super(name, schema);
	}

	protected async tickMajor(): Promise<Partial<KVs<typeof schema>>> {
		return {};
	}

	protected async tickMinor(): Promise<Partial<KVs<typeof schema>>> {
		return {};
	}

	public async deliverSucc(): Promise<void> {
		await this.commit({
			'deliverSucceeded': 1,
		});
	}

	public async deliverFail(): Promise<void> {
		await this.commit({
			'deliverFailed': 1,
		});
	}

	public async inbox(): Promise<void> {
		await this.commit({
			'inboxReceived': 1,
		});
	}
}