1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-21 13:47:39 +02:00
unleash.unleash/src/lib/openapi/spec/bulk-metrics-schema.ts
Christopher Kolstad 53354224fc
chore: Bump biome and configure husky (#6589)
Upgrades biome to 1.6.1, and updates husky pre-commit hook.

Most changes here are making type imports explicit.
2024-03-18 13:58:05 +01:00

38 lines
1.3 KiB
TypeScript

import type { FromSchema } from 'json-schema-to-ts';
import { bulkRegistrationSchema } from './bulk-registration-schema';
import { dateSchema } from './date-schema';
import { clientMetricsEnvSchema } from './client-metrics-env-schema';
export const bulkMetricsSchema = {
$id: '#/components/schemas/bulkMetricsSchema',
type: 'object',
required: ['applications', 'metrics'],
description:
'A batch of metrics accumulated by Edge (or other compatible applications). Includes both application registrations as well usage metrics from clients',
properties: {
applications: {
description: 'A list of applications registered by an Unleash SDK',
type: 'array',
items: {
$ref: '#/components/schemas/bulkRegistrationSchema',
},
},
metrics: {
description:
'a list of client usage metrics registered by downstream providers. (Typically Unleash Edge)',
type: 'array',
items: {
$ref: '#/components/schemas/clientMetricsEnvSchema',
},
},
},
components: {
schemas: {
bulkRegistrationSchema,
dateSchema,
clientMetricsEnvSchema,
},
},
} as const;
export type BulkMetricsSchema = FromSchema<typeof bulkMetricsSchema>;