From bb46030677f6c172406f0642807a31ddfa250e30 Mon Sep 17 00:00:00 2001 From: tamaina Date: Mon, 5 Jun 2023 06:05:36 +0000 Subject: [PATCH] =?UTF-8?q?chartsSchemas=E3=82=AA=E3=83=96=E3=82=B8?= =?UTF-8?q?=E3=82=A7=E3=82=AF=E3=83=88=E3=81=AB=E9=9B=86=E7=B4=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/charts/entities/active-users.ts | 6 +- .../core/chart/charts/entities/ap-request.ts | 6 +- .../src/core/chart/charts/entities/drive.ts | 6 +- .../core/chart/charts/entities/federation.ts | 6 +- .../core/chart/charts/entities/instance.ts | 6 +- .../src/core/chart/charts/entities/notes.ts | 6 +- .../chart/charts/entities/per-user-drive.ts | 6 +- .../charts/entities/per-user-following.ts | 6 +- .../chart/charts/entities/per-user-notes.ts | 6 +- .../core/chart/charts/entities/per-user-pv.ts | 6 +- .../charts/entities/per-user-reactions.ts | 6 +- .../chart/charts/entities/test-grouped.ts | 6 +- .../charts/entities/test-intersection.ts | 6 +- .../core/chart/charts/entities/test-unique.ts | 6 +- .../src/core/chart/charts/entities/test.ts | 6 +- .../src/core/chart/charts/entities/users.ts | 6 +- packages/misskey-js/src/endpoints.ts | 5 +- packages/misskey-js/src/schemas/charts.ts | 141 ++++++++++++++++++ .../src/schemas/charts/active-users.ts | 13 -- .../src/schemas/charts/ap-request.ts | 7 - .../misskey-js/src/schemas/charts/drive.ts | 12 -- .../src/schemas/charts/federation.ts | 12 -- .../misskey-js/src/schemas/charts/instance.ts | 28 ---- .../misskey-js/src/schemas/charts/notes.ts | 18 --- .../src/schemas/charts/per-user-drive.ts | 10 -- .../src/schemas/charts/per-user-following.ts | 16 -- .../src/schemas/charts/per-user-notes.ts | 11 -- .../src/schemas/charts/per-user-pv.ts | 8 - .../src/schemas/charts/per-user-reactions.ts | 6 - .../src/schemas/charts/test-grouped.ts | 7 - .../src/schemas/charts/test-intersection.ts | 7 - .../src/schemas/charts/test-unique.ts | 5 - .../misskey-js/src/schemas/charts/test.ts | 7 - .../misskey-js/src/schemas/charts/users.ts | 10 -- 34 files changed, 191 insertions(+), 228 deletions(-) create mode 100644 packages/misskey-js/src/schemas/charts.ts delete mode 100644 packages/misskey-js/src/schemas/charts/active-users.ts delete mode 100644 packages/misskey-js/src/schemas/charts/ap-request.ts delete mode 100644 packages/misskey-js/src/schemas/charts/drive.ts delete mode 100644 packages/misskey-js/src/schemas/charts/federation.ts delete mode 100644 packages/misskey-js/src/schemas/charts/instance.ts delete mode 100644 packages/misskey-js/src/schemas/charts/notes.ts delete mode 100644 packages/misskey-js/src/schemas/charts/per-user-drive.ts delete mode 100644 packages/misskey-js/src/schemas/charts/per-user-following.ts delete mode 100644 packages/misskey-js/src/schemas/charts/per-user-notes.ts delete mode 100644 packages/misskey-js/src/schemas/charts/per-user-pv.ts delete mode 100644 packages/misskey-js/src/schemas/charts/per-user-reactions.ts delete mode 100644 packages/misskey-js/src/schemas/charts/test-grouped.ts delete mode 100644 packages/misskey-js/src/schemas/charts/test-intersection.ts delete mode 100644 packages/misskey-js/src/schemas/charts/test-unique.ts delete mode 100644 packages/misskey-js/src/schemas/charts/test.ts delete mode 100644 packages/misskey-js/src/schemas/charts/users.ts diff --git a/packages/backend/src/core/chart/charts/entities/active-users.ts b/packages/backend/src/core/chart/charts/entities/active-users.ts index 1c630f209..356654b74 100644 --- a/packages/backend/src/core/chart/charts/entities/active-users.ts +++ b/packages/backend/src/core/chart/charts/entities/active-users.ts @@ -1,7 +1,7 @@ import Chart from '../../core.js'; -import * as _ from 'misskey-js/built/schemas/charts/active-users.js'; -export const name = _.name; -export const schema = _.schema; +import { chartsSchemas } from 'misskey-js/built/schemas/charts.js'; +export const name = 'activeUsers' as const; +export const schema = chartsSchemas[name]; export const entity = Chart.schemaToEntity(name, schema); diff --git a/packages/backend/src/core/chart/charts/entities/ap-request.ts b/packages/backend/src/core/chart/charts/entities/ap-request.ts index 1e9259235..53f5a90e9 100644 --- a/packages/backend/src/core/chart/charts/entities/ap-request.ts +++ b/packages/backend/src/core/chart/charts/entities/ap-request.ts @@ -1,7 +1,7 @@ import Chart from '../../core.js'; -import * as _ from 'misskey-js/built/schemas/charts/ap-request.js'; -export const name = _.name; -export const schema = _.schema; +import { chartsSchemas } from 'misskey-js/built/schemas/charts.js'; +export const name = 'apRequest' as const; +export const schema = chartsSchemas[name]; export const entity = Chart.schemaToEntity(name, schema); diff --git a/packages/backend/src/core/chart/charts/entities/drive.ts b/packages/backend/src/core/chart/charts/entities/drive.ts index 2050dba14..e22c63d0b 100644 --- a/packages/backend/src/core/chart/charts/entities/drive.ts +++ b/packages/backend/src/core/chart/charts/entities/drive.ts @@ -1,7 +1,7 @@ import Chart from '../../core.js'; -import * as _ from 'misskey-js/built/schemas/charts/drive.js'; -export const name = _.name; -export const schema = _.schema; +import { chartsSchemas } from 'misskey-js/built/schemas/charts.js'; +export const name = 'drive' as const; +export const schema = chartsSchemas[name]; export const entity = Chart.schemaToEntity(name, schema); diff --git a/packages/backend/src/core/chart/charts/entities/federation.ts b/packages/backend/src/core/chart/charts/entities/federation.ts index ec7180482..8c2eb082d 100644 --- a/packages/backend/src/core/chart/charts/entities/federation.ts +++ b/packages/backend/src/core/chart/charts/entities/federation.ts @@ -1,7 +1,7 @@ import Chart from '../../core.js'; -import * as _ from 'misskey-js/built/schemas/charts/federation.js'; -export const name = _.name; -export const schema = _.schema; +import { chartsSchemas } from 'misskey-js/built/schemas/charts.js'; +export const name = 'federation' as const; +export const schema = chartsSchemas[name]; export const entity = Chart.schemaToEntity(name, schema); diff --git a/packages/backend/src/core/chart/charts/entities/instance.ts b/packages/backend/src/core/chart/charts/entities/instance.ts index 32d47dc67..614e483bc 100644 --- a/packages/backend/src/core/chart/charts/entities/instance.ts +++ b/packages/backend/src/core/chart/charts/entities/instance.ts @@ -1,7 +1,7 @@ import Chart from '../../core.js'; -import * as _ from 'misskey-js/built/schemas/charts/instance.js'; -export const name = _.name; -export const schema = _.schema; +import { chartsSchemas } from 'misskey-js/built/schemas/charts.js'; +export const name = 'instance' as const; +export const schema = chartsSchemas[name]; export const entity = Chart.schemaToEntity(name, schema, true); diff --git a/packages/backend/src/core/chart/charts/entities/notes.ts b/packages/backend/src/core/chart/charts/entities/notes.ts index 1dc1daeee..66f828d4e 100644 --- a/packages/backend/src/core/chart/charts/entities/notes.ts +++ b/packages/backend/src/core/chart/charts/entities/notes.ts @@ -1,7 +1,7 @@ import Chart from '../../core.js'; -import * as _ from 'misskey-js/built/schemas/charts/notes.js'; -export const name = _.name; -export const schema = _.schema; +import { chartsSchemas } from 'misskey-js/built/schemas/charts.js'; +export const name = 'notes' as const; +export const schema = chartsSchemas[name]; export const entity = Chart.schemaToEntity(name, schema); diff --git a/packages/backend/src/core/chart/charts/entities/per-user-drive.ts b/packages/backend/src/core/chart/charts/entities/per-user-drive.ts index 735d83291..8dd35fa59 100644 --- a/packages/backend/src/core/chart/charts/entities/per-user-drive.ts +++ b/packages/backend/src/core/chart/charts/entities/per-user-drive.ts @@ -1,7 +1,7 @@ import Chart from '../../core.js'; -import * as _ from 'misskey-js/built/schemas/charts/per-user-drive.js'; -export const name = _.name; -export const schema = _.schema; +import { chartsSchemas } from 'misskey-js/built/schemas/charts.js'; +export const name = 'perUserDrive' as const; +export const schema = chartsSchemas[name]; export const entity = Chart.schemaToEntity(name, schema, true); diff --git a/packages/backend/src/core/chart/charts/entities/per-user-following.ts b/packages/backend/src/core/chart/charts/entities/per-user-following.ts index accedb56b..b88e679a1 100644 --- a/packages/backend/src/core/chart/charts/entities/per-user-following.ts +++ b/packages/backend/src/core/chart/charts/entities/per-user-following.ts @@ -1,7 +1,7 @@ import Chart from '../../core.js'; -import * as _ from 'misskey-js/built/schemas/charts/per-user-following.js'; -export const name = _.name; -export const schema = _.schema; +import { chartsSchemas } from 'misskey-js/built/schemas/charts.js'; +export const name = 'perUserFollowing' as const; +export const schema = chartsSchemas[name]; export const entity = Chart.schemaToEntity(name, schema, true); diff --git a/packages/backend/src/core/chart/charts/entities/per-user-notes.ts b/packages/backend/src/core/chart/charts/entities/per-user-notes.ts index 23057fb92..cdd9f25d3 100644 --- a/packages/backend/src/core/chart/charts/entities/per-user-notes.ts +++ b/packages/backend/src/core/chart/charts/entities/per-user-notes.ts @@ -1,7 +1,7 @@ import Chart from '../../core.js'; -import * as _ from 'misskey-js/built/schemas/charts/per-user-notes.js'; -export const name = _.name; -export const schema = _.schema; +import { chartsSchemas } from 'misskey-js/built/schemas/charts.js'; +export const name = 'perUserNotes' as const; +export const schema = chartsSchemas[name]; export const entity = Chart.schemaToEntity(name, schema, true); diff --git a/packages/backend/src/core/chart/charts/entities/per-user-pv.ts b/packages/backend/src/core/chart/charts/entities/per-user-pv.ts index 2d8717c81..10ae0ae07 100644 --- a/packages/backend/src/core/chart/charts/entities/per-user-pv.ts +++ b/packages/backend/src/core/chart/charts/entities/per-user-pv.ts @@ -1,7 +1,7 @@ import Chart from '../../core.js'; -import * as _ from 'misskey-js/built/schemas/charts/per-user-pv.js'; -export const name = _.name; -export const schema = _.schema; +import { chartsSchemas } from 'misskey-js/built/schemas/charts.js'; +export const name = 'perUserPv' as const; +export const schema = chartsSchemas[name]; export const entity = Chart.schemaToEntity(name, schema, true); diff --git a/packages/backend/src/core/chart/charts/entities/per-user-reactions.ts b/packages/backend/src/core/chart/charts/entities/per-user-reactions.ts index 5f1f50993..d100b0d1a 100644 --- a/packages/backend/src/core/chart/charts/entities/per-user-reactions.ts +++ b/packages/backend/src/core/chart/charts/entities/per-user-reactions.ts @@ -1,7 +1,7 @@ import Chart from '../../core.js'; -import * as _ from 'misskey-js/built/schemas/charts/per-user-reactions.js'; -export const name = _.name; -export const schema = _.schema; +import { chartsSchemas } from 'misskey-js/built/schemas/charts.js'; +export const name = 'perUserReactions' as const; +export const schema = chartsSchemas[name]; export const entity = Chart.schemaToEntity(name, schema, true); diff --git a/packages/backend/src/core/chart/charts/entities/test-grouped.ts b/packages/backend/src/core/chart/charts/entities/test-grouped.ts index 059047d1a..216098375 100644 --- a/packages/backend/src/core/chart/charts/entities/test-grouped.ts +++ b/packages/backend/src/core/chart/charts/entities/test-grouped.ts @@ -1,7 +1,7 @@ import Chart from '../../core.js'; -import * as _ from 'misskey-js/built/schemas/charts/test-grouped.js'; -export const name = _.name; -export const schema = _.schema; +import { chartsSchemas } from 'misskey-js/built/schemas/charts.js'; +export const name = 'testGrouped'; +export const schema = chartsSchemas[name]; export const entity = Chart.schemaToEntity(name, schema, true); diff --git a/packages/backend/src/core/chart/charts/entities/test-intersection.ts b/packages/backend/src/core/chart/charts/entities/test-intersection.ts index c9b0756c4..21f0f3bcd 100644 --- a/packages/backend/src/core/chart/charts/entities/test-intersection.ts +++ b/packages/backend/src/core/chart/charts/entities/test-intersection.ts @@ -1,7 +1,7 @@ import Chart from '../../core.js'; -import * as _ from 'misskey-js/built/schemas/charts/test-intersection.js'; -export const name = _.name; -export const schema = _.schema; +import { chartsSchemas } from 'misskey-js/built/schemas/charts.js'; +export const name = 'testIntersection'; +export const schema = chartsSchemas[name]; export const entity = Chart.schemaToEntity(name, schema); diff --git a/packages/backend/src/core/chart/charts/entities/test-unique.ts b/packages/backend/src/core/chart/charts/entities/test-unique.ts index 26c838c15..8e702183b 100644 --- a/packages/backend/src/core/chart/charts/entities/test-unique.ts +++ b/packages/backend/src/core/chart/charts/entities/test-unique.ts @@ -1,7 +1,7 @@ import Chart from '../../core.js'; -import * as _ from 'misskey-js/built/schemas/charts/test-unique.js'; -export const name = _.name; -export const schema = _.schema; +import { chartsSchemas } from 'misskey-js/built/schemas/charts.js'; +export const name = 'testUnique'; +export const schema = chartsSchemas[name]; export const entity = Chart.schemaToEntity(name, schema); diff --git a/packages/backend/src/core/chart/charts/entities/test.ts b/packages/backend/src/core/chart/charts/entities/test.ts index 9731796b3..48bdfa584 100644 --- a/packages/backend/src/core/chart/charts/entities/test.ts +++ b/packages/backend/src/core/chart/charts/entities/test.ts @@ -1,7 +1,7 @@ import Chart from '../../core.js'; -import * as _ from 'misskey-js/built/schemas/charts/test.js'; -export const name = _.name; -export const schema = _.schema; +import { chartsSchemas } from 'misskey-js/built/schemas/charts.js'; +export const name = 'test'; +export const schema = chartsSchemas[name]; export const entity = Chart.schemaToEntity(name, schema); diff --git a/packages/backend/src/core/chart/charts/entities/users.ts b/packages/backend/src/core/chart/charts/entities/users.ts index 1c8e66482..6c0cd3ae7 100644 --- a/packages/backend/src/core/chart/charts/entities/users.ts +++ b/packages/backend/src/core/chart/charts/entities/users.ts @@ -1,7 +1,7 @@ import Chart from '../../core.js'; -import * as _ from 'misskey-js/built/schemas/charts/users.js'; -export const name = _.name; -export const schema = _.schema; +import { chartsSchemas } from 'misskey-js/built/schemas/charts.js'; +export const name = 'users'; +export const schema = chartsSchemas[name]; export const entity = Chart.schemaToEntity(name, schema); diff --git a/packages/misskey-js/src/endpoints.ts b/packages/misskey-js/src/endpoints.ts index 219bff64f..59a93549c 100644 --- a/packages/misskey-js/src/endpoints.ts +++ b/packages/misskey-js/src/endpoints.ts @@ -3,8 +3,7 @@ import { IEndpointMeta } from './endpoints.types'; import { localUsernameSchema, passwordSchema } from './schemas/user'; import ms from 'ms'; import { getJsonSchema } from './schemas'; -import * as perUserDriveChartSchema from './schemas/charts/per-user-drive'; -import * as driveChartSchema from './schemas/charts/drive'; +import { chartsSchemas } from './schemas/charts.js'; export const endpoints = { //#region admin @@ -3006,7 +3005,7 @@ export const endpoints = { }, required: ['span', 'userId'], }, - res: getJsonSchema(perUserDriveChartSchema.schema) satisfies JSONSchema7, + res: getJsonSchema(chartsSchemas.perUserDrive) satisfies JSONSchema7, }], }, //#endregion diff --git a/packages/misskey-js/src/schemas/charts.ts b/packages/misskey-js/src/schemas/charts.ts new file mode 100644 index 000000000..2e4e2aa51 --- /dev/null +++ b/packages/misskey-js/src/schemas/charts.ts @@ -0,0 +1,141 @@ +import { ChartSchema } from "../schemas"; + +export const chartsSchemas = { + 'activeUsers': { + 'readWrite': { intersection: ['read', 'write'] }, + 'read': { uniqueIncrement: true }, + 'write': { uniqueIncrement: true }, + 'registeredWithinWeek': { uniqueIncrement: true }, + 'registeredWithinMonth': { uniqueIncrement: true }, + 'registeredWithinYear': { uniqueIncrement: true }, + 'registeredOutsideWeek': { uniqueIncrement: true }, + 'registeredOutsideMonth': { uniqueIncrement: true }, + 'registeredOutsideYear': { uniqueIncrement: true }, + }, + 'apRequest': { + 'deliverFailed': { }, + 'deliverSucceeded': { }, + 'inboxReceived': { }, + }, + 'drive': { + 'local.incCount': {}, + 'local.incSize': {}, // in kilobyte + 'local.decCount': {}, + 'local.decSize': {}, // in kilobyte + 'remote.incCount': {}, + 'remote.incSize': {}, // in kilobyte + 'remote.decCount': {}, + 'remote.decSize': {}, // in kilobyte + }, + 'federation': { + 'deliveredInstances': { uniqueIncrement: true, range: 'small' }, + 'inboxInstances': { uniqueIncrement: true, range: 'small' }, + 'stalled': { uniqueIncrement: true, range: 'small' }, + 'sub': { accumulate: true, range: 'small' }, + 'pub': { accumulate: true, range: 'small' }, + 'pubsub': { accumulate: true, range: 'small' }, + 'subActive': { accumulate: true, range: 'small' }, + 'pubActive': { accumulate: true, range: 'small' }, + }, + 'instance': { + 'requests.failed': { range: 'small' }, + 'requests.succeeded': { range: 'small' }, + 'requests.received': { range: 'small' }, + 'notes.total': { accumulate: true }, + 'notes.inc': {}, + 'notes.dec': {}, + 'notes.diffs.normal': {}, + 'notes.diffs.reply': {}, + 'notes.diffs.renote': {}, + 'notes.diffs.withFile': {}, + 'users.total': { accumulate: true }, + 'users.inc': { range: 'small' }, + 'users.dec': { range: 'small' }, + 'following.total': { accumulate: true }, + 'following.inc': { range: 'small' }, + 'following.dec': { range: 'small' }, + 'followers.total': { accumulate: true }, + 'followers.inc': { range: 'small' }, + 'followers.dec': { range: 'small' }, + 'drive.totalFiles': { accumulate: true }, + 'drive.incFiles': {}, + 'drive.decFiles': {}, + 'drive.incUsage': {}, // in kilobyte + 'drive.decUsage': {}, // in kilobyte + }, + 'notes': { + 'totalCount': { accumulate: true }, + 'totalSize': { accumulate: true }, // in kilobyte + 'incCount': { range: 'small' }, + 'incSize': {}, // in kilobyte + 'decCount': { range: 'small' }, + 'decSize': {}, // in kilobyte + }, + 'perUserDrive': { + 'totalCount': { accumulate: true }, + 'totalSize': { accumulate: true }, // in kilobyte + 'incCount': { range: 'small' }, + 'incSize': {}, // in kilobyte + 'decCount': { range: 'small' }, + 'decSize': {}, // in kilobyte + }, + 'perUserFollowing': { + 'local.followings.total': { accumulate: true }, + 'local.followings.inc': { range: 'small' }, + 'local.followings.dec': { range: 'small' }, + 'local.followers.total': { accumulate: true }, + 'local.followers.inc': { range: 'small' }, + 'local.followers.dec': { range: 'small' }, + 'remote.followings.total': { accumulate: true }, + 'remote.followings.inc': { range: 'small' }, + 'remote.followings.dec': { range: 'small' }, + 'remote.followers.total': { accumulate: true }, + 'remote.followers.inc': { range: 'small' }, + 'remote.followers.dec': { range: 'small' }, + }, + 'perUserNotes': { + 'total': { accumulate: true }, + 'inc': { range: 'small' }, + 'dec': { range: 'small' }, + 'diffs.normal': { range: 'small' }, + 'diffs.reply': { range: 'small' }, + 'diffs.renote': { range: 'small' }, + 'diffs.withFile': { range: 'small' }, + }, + 'perUserPv': { + 'upv.user': { uniqueIncrement: true, range: 'small' }, + 'pv.user': { range: 'small' }, + 'upv.visitor': { uniqueIncrement: true, range: 'small' }, + 'pv.visitor': { range: 'small' }, + }, + 'perUserReactions': { + 'local.count': { range: 'small' }, + 'remote.count': { range: 'small' }, + }, + 'testGrouped': { + 'foo.total': { accumulate: true }, + 'foo.inc': {}, + 'foo.dec': {}, + }, + 'testIntersection': { + 'a': { uniqueIncrement: true }, + 'b': { uniqueIncrement: true }, + 'aAndB': { intersection: ['a', 'b'] }, + }, + 'testUnique': { + 'foo': { uniqueIncrement: true }, + }, + 'test': { + 'foo.total': { accumulate: true }, + 'foo.inc': {}, + 'foo.dec': {}, + }, + 'users': { + 'local.total': { accumulate: true }, + 'local.inc': { range: 'small' }, + 'local.dec': { range: 'small' }, + 'remote.total': { accumulate: true }, + 'remote.inc': { range: 'small' }, + 'remote.dec': { range: 'small' }, + }, +} as const satisfies Record; diff --git a/packages/misskey-js/src/schemas/charts/active-users.ts b/packages/misskey-js/src/schemas/charts/active-users.ts deleted file mode 100644 index b4c0df5ce..000000000 --- a/packages/misskey-js/src/schemas/charts/active-users.ts +++ /dev/null @@ -1,13 +0,0 @@ -export const name = 'activeUsers'; - -export const schema = { - 'readWrite': { intersection: ['read', 'write'] }, - 'read': { uniqueIncrement: true }, - 'write': { uniqueIncrement: true }, - 'registeredWithinWeek': { uniqueIncrement: true }, - 'registeredWithinMonth': { uniqueIncrement: true }, - 'registeredWithinYear': { uniqueIncrement: true }, - 'registeredOutsideWeek': { uniqueIncrement: true }, - 'registeredOutsideMonth': { uniqueIncrement: true }, - 'registeredOutsideYear': { uniqueIncrement: true }, -} as const; diff --git a/packages/misskey-js/src/schemas/charts/ap-request.ts b/packages/misskey-js/src/schemas/charts/ap-request.ts deleted file mode 100644 index 77e81b9b5..000000000 --- a/packages/misskey-js/src/schemas/charts/ap-request.ts +++ /dev/null @@ -1,7 +0,0 @@ -export const name = 'apRequest'; - -export const schema = { - 'deliverFailed': { }, - 'deliverSucceeded': { }, - 'inboxReceived': { }, -} as const; diff --git a/packages/misskey-js/src/schemas/charts/drive.ts b/packages/misskey-js/src/schemas/charts/drive.ts deleted file mode 100644 index ade3fae7d..000000000 --- a/packages/misskey-js/src/schemas/charts/drive.ts +++ /dev/null @@ -1,12 +0,0 @@ -export const name = 'drive'; - -export const schema = { - 'local.incCount': {}, - 'local.incSize': {}, // in kilobyte - 'local.decCount': {}, - 'local.decSize': {}, // in kilobyte - 'remote.incCount': {}, - 'remote.incSize': {}, // in kilobyte - 'remote.decCount': {}, - 'remote.decSize': {}, // in kilobyte -} as const; diff --git a/packages/misskey-js/src/schemas/charts/federation.ts b/packages/misskey-js/src/schemas/charts/federation.ts deleted file mode 100644 index bd720b41b..000000000 --- a/packages/misskey-js/src/schemas/charts/federation.ts +++ /dev/null @@ -1,12 +0,0 @@ -export const name = 'federation'; - -export const schema = { - 'deliveredInstances': { uniqueIncrement: true, range: 'small' }, - 'inboxInstances': { uniqueIncrement: true, range: 'small' }, - 'stalled': { uniqueIncrement: true, range: 'small' }, - 'sub': { accumulate: true, range: 'small' }, - 'pub': { accumulate: true, range: 'small' }, - 'pubsub': { accumulate: true, range: 'small' }, - 'subActive': { accumulate: true, range: 'small' }, - 'pubActive': { accumulate: true, range: 'small' }, -} as const; diff --git a/packages/misskey-js/src/schemas/charts/instance.ts b/packages/misskey-js/src/schemas/charts/instance.ts deleted file mode 100644 index 06c3dda0e..000000000 --- a/packages/misskey-js/src/schemas/charts/instance.ts +++ /dev/null @@ -1,28 +0,0 @@ -export const name = 'instance'; - -export const schema = { - 'requests.failed': { range: 'small' }, - 'requests.succeeded': { range: 'small' }, - 'requests.received': { range: 'small' }, - 'notes.total': { accumulate: true }, - 'notes.inc': {}, - 'notes.dec': {}, - 'notes.diffs.normal': {}, - 'notes.diffs.reply': {}, - 'notes.diffs.renote': {}, - 'notes.diffs.withFile': {}, - 'users.total': { accumulate: true }, - 'users.inc': { range: 'small' }, - 'users.dec': { range: 'small' }, - 'following.total': { accumulate: true }, - 'following.inc': { range: 'small' }, - 'following.dec': { range: 'small' }, - 'followers.total': { accumulate: true }, - 'followers.inc': { range: 'small' }, - 'followers.dec': { range: 'small' }, - 'drive.totalFiles': { accumulate: true }, - 'drive.incFiles': {}, - 'drive.decFiles': {}, - 'drive.incUsage': {}, // in kilobyte - 'drive.decUsage': {}, // in kilobyte -} as const; diff --git a/packages/misskey-js/src/schemas/charts/notes.ts b/packages/misskey-js/src/schemas/charts/notes.ts deleted file mode 100644 index 3df1d1224..000000000 --- a/packages/misskey-js/src/schemas/charts/notes.ts +++ /dev/null @@ -1,18 +0,0 @@ -export const name = 'notes'; - -export const schema = { - 'local.total': { accumulate: true }, - 'local.inc': {}, - 'local.dec': {}, - 'local.diffs.normal': {}, - 'local.diffs.reply': {}, - 'local.diffs.renote': {}, - 'local.diffs.withFile': {}, - 'remote.total': { accumulate: true }, - 'remote.inc': {}, - 'remote.dec': {}, - 'remote.diffs.normal': {}, - 'remote.diffs.reply': {}, - 'remote.diffs.renote': {}, - 'remote.diffs.withFile': {}, -} as const; diff --git a/packages/misskey-js/src/schemas/charts/per-user-drive.ts b/packages/misskey-js/src/schemas/charts/per-user-drive.ts deleted file mode 100644 index ea2c67c1f..000000000 --- a/packages/misskey-js/src/schemas/charts/per-user-drive.ts +++ /dev/null @@ -1,10 +0,0 @@ -export const name = 'perUserDrive'; - -export const schema = { - 'totalCount': { accumulate: true }, - 'totalSize': { accumulate: true }, // in kilobyte - 'incCount': { range: 'small' }, - 'incSize': {}, // in kilobyte - 'decCount': { range: 'small' }, - 'decSize': {}, // in kilobyte -} as const; diff --git a/packages/misskey-js/src/schemas/charts/per-user-following.ts b/packages/misskey-js/src/schemas/charts/per-user-following.ts deleted file mode 100644 index 56d80c43f..000000000 --- a/packages/misskey-js/src/schemas/charts/per-user-following.ts +++ /dev/null @@ -1,16 +0,0 @@ -export const name = 'perUserFollowing'; - -export const schema = { - 'local.followings.total': { accumulate: true }, - 'local.followings.inc': { range: 'small' }, - 'local.followings.dec': { range: 'small' }, - 'local.followers.total': { accumulate: true }, - 'local.followers.inc': { range: 'small' }, - 'local.followers.dec': { range: 'small' }, - 'remote.followings.total': { accumulate: true }, - 'remote.followings.inc': { range: 'small' }, - 'remote.followings.dec': { range: 'small' }, - 'remote.followers.total': { accumulate: true }, - 'remote.followers.inc': { range: 'small' }, - 'remote.followers.dec': { range: 'small' }, -} as const; diff --git a/packages/misskey-js/src/schemas/charts/per-user-notes.ts b/packages/misskey-js/src/schemas/charts/per-user-notes.ts deleted file mode 100644 index cd51b7081..000000000 --- a/packages/misskey-js/src/schemas/charts/per-user-notes.ts +++ /dev/null @@ -1,11 +0,0 @@ -export const name = 'perUserNotes'; - -export const schema = { - 'total': { accumulate: true }, - 'inc': { range: 'small' }, - 'dec': { range: 'small' }, - 'diffs.normal': { range: 'small' }, - 'diffs.reply': { range: 'small' }, - 'diffs.renote': { range: 'small' }, - 'diffs.withFile': { range: 'small' }, -} as const; diff --git a/packages/misskey-js/src/schemas/charts/per-user-pv.ts b/packages/misskey-js/src/schemas/charts/per-user-pv.ts deleted file mode 100644 index 929307d4f..000000000 --- a/packages/misskey-js/src/schemas/charts/per-user-pv.ts +++ /dev/null @@ -1,8 +0,0 @@ -export const name = 'perUserPv'; - -export const schema = { - 'upv.user': { uniqueIncrement: true, range: 'small' }, - 'pv.user': { range: 'small' }, - 'upv.visitor': { uniqueIncrement: true, range: 'small' }, - 'pv.visitor': { range: 'small' }, -} as const; diff --git a/packages/misskey-js/src/schemas/charts/per-user-reactions.ts b/packages/misskey-js/src/schemas/charts/per-user-reactions.ts deleted file mode 100644 index a8b9c8923..000000000 --- a/packages/misskey-js/src/schemas/charts/per-user-reactions.ts +++ /dev/null @@ -1,6 +0,0 @@ -export const name = 'perUserReaction'; - -export const schema = { - 'local.count': { range: 'small' }, - 'remote.count': { range: 'small' }, -} as const; diff --git a/packages/misskey-js/src/schemas/charts/test-grouped.ts b/packages/misskey-js/src/schemas/charts/test-grouped.ts deleted file mode 100644 index 659a728af..000000000 --- a/packages/misskey-js/src/schemas/charts/test-grouped.ts +++ /dev/null @@ -1,7 +0,0 @@ -export const name = 'testGrouped'; - -export const schema = { - 'foo.total': { accumulate: true }, - 'foo.inc': {}, - 'foo.dec': {}, -} as const; diff --git a/packages/misskey-js/src/schemas/charts/test-intersection.ts b/packages/misskey-js/src/schemas/charts/test-intersection.ts deleted file mode 100644 index 2eb34d0dd..000000000 --- a/packages/misskey-js/src/schemas/charts/test-intersection.ts +++ /dev/null @@ -1,7 +0,0 @@ -export const name = 'testIntersection'; - -export const schema = { - 'a': { uniqueIncrement: true }, - 'b': { uniqueIncrement: true }, - 'aAndB': { intersection: ['a', 'b'] }, -} as const; diff --git a/packages/misskey-js/src/schemas/charts/test-unique.ts b/packages/misskey-js/src/schemas/charts/test-unique.ts deleted file mode 100644 index 7c90413ca..000000000 --- a/packages/misskey-js/src/schemas/charts/test-unique.ts +++ /dev/null @@ -1,5 +0,0 @@ -export const name = 'testUnique'; - -export const schema = { - 'foo': { uniqueIncrement: true }, -} as const; diff --git a/packages/misskey-js/src/schemas/charts/test.ts b/packages/misskey-js/src/schemas/charts/test.ts deleted file mode 100644 index 5e196108e..000000000 --- a/packages/misskey-js/src/schemas/charts/test.ts +++ /dev/null @@ -1,7 +0,0 @@ -export const name = 'test'; - -export const schema = { - 'foo.total': { accumulate: true }, - 'foo.inc': {}, - 'foo.dec': {}, -} as const; diff --git a/packages/misskey-js/src/schemas/charts/users.ts b/packages/misskey-js/src/schemas/charts/users.ts deleted file mode 100644 index f96462c35..000000000 --- a/packages/misskey-js/src/schemas/charts/users.ts +++ /dev/null @@ -1,10 +0,0 @@ -export const name = 'users'; - -export const schema = { - 'local.total': { accumulate: true }, - 'local.inc': { range: 'small' }, - 'local.dec': { range: 'small' }, - 'remote.total': { accumulate: true }, - 'remote.inc': { range: 'small' }, - 'remote.dec': { range: 'small' }, -} as const;