Skip to content

Commit

Permalink
chore(1-3267): add orval schemas for the new API endpoint (#9164)
Browse files Browse the repository at this point in the history
Adds Orval schemas for the new API enpdoint to display monthly/daily
traffic data usage.
  • Loading branch information
thomasheartman authored Jan 29, 2025
1 parent b62c1d6 commit d0fa929
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 0 deletions.
6 changes: 6 additions & 0 deletions frontend/src/openapi/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1260,6 +1260,12 @@ export * from './tokenUserSchema';
export * from './trafficUsageApiDataSchema';
export * from './trafficUsageApiDataSchemaDaysItem';
export * from './trafficUsageApiDataSchemaDaysItemTrafficTypesItem';
export * from './trafficUsageDataSegmentedCombinedSchema';
export * from './trafficUsageDataSegmentedCombinedSchemaApiDataItem';
export * from './trafficUsageDataSegmentedCombinedSchemaApiDataItemDataPointsItem';
export * from './trafficUsageDataSegmentedCombinedSchemaApiDataItemDataPointsItemTrafficTypesItem';
export * from './trafficUsageDataSegmentedCombinedSchemaDateRange';
export * from './trafficUsageDataSegmentedCombinedSchemaGrouping';
export * from './trafficUsageDataSegmentedSchema';
export * from './uiConfigSchema';
export * from './uiConfigSchemaAuthenticationType';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
import type { TrafficUsageDataSegmentedCombinedSchemaApiDataItem } from './trafficUsageDataSegmentedCombinedSchemaApiDataItem';
import type { TrafficUsageDataSegmentedCombinedSchemaDateRange } from './trafficUsageDataSegmentedCombinedSchemaDateRange';
import type { TrafficUsageDataSegmentedCombinedSchemaGrouping } from './trafficUsageDataSegmentedCombinedSchemaGrouping';

/**
* Contains the recorded data usage for each API path, segmented by day/month and type of traffic
*/
export interface TrafficUsageDataSegmentedCombinedSchema {
/** Contains the recorded daily/monthly data usage for each API path */
apiData: TrafficUsageDataSegmentedCombinedSchemaApiDataItem[];
/** The date range there is data for. The range is inclusive and goes from the start of the `from` date to the end of the `to` date */
dateRange: TrafficUsageDataSegmentedCombinedSchemaDateRange;
/** Whether the data is aggregated by month or by day. */
grouping: TrafficUsageDataSegmentedCombinedSchemaGrouping;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
import type { TrafficUsageDataSegmentedCombinedSchemaApiDataItemDataPointsItem } from './trafficUsageDataSegmentedCombinedSchemaApiDataItemDataPointsItem';

export type TrafficUsageDataSegmentedCombinedSchemaApiDataItem = {
/** The API path */
apiPath: string;
/** The recorded data points for the API path */
dataPoints: TrafficUsageDataSegmentedCombinedSchemaApiDataItemDataPointsItem[];
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
import type { TrafficUsageDataSegmentedCombinedSchemaApiDataItemDataPointsItemTrafficTypesItem } from './trafficUsageDataSegmentedCombinedSchemaApiDataItemDataPointsItemTrafficTypesItem';

export type TrafficUsageDataSegmentedCombinedSchemaApiDataItemDataPointsItem = {
/**
* The date of the data point. Formatted as a full date (e.g. 2023-04-01) if the data is aggregated by day or as a month (e.g. 2023-04) if the data is aggregated by month.
* @pattern ^\d{4}-\d{2}(-\d{2})?$
*/
period: string;
/** The recorded traffic types for the data point */
trafficTypes: TrafficUsageDataSegmentedCombinedSchemaApiDataItemDataPointsItemTrafficTypesItem[];
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/

export type TrafficUsageDataSegmentedCombinedSchemaApiDataItemDataPointsItemTrafficTypesItem =
{
/**
* The number of requests
* @minimum 0
*/
count: number;
/** The type of traffic */
group: string;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/

/**
* The date range there is data for. The range is inclusive and goes from the start of the `from` date to the end of the `to` date
*/
export type TrafficUsageDataSegmentedCombinedSchemaDateRange = {
/** The start of the dateRange */
from: string;
/** The end of the dateRange */
to: string;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/

/**
* Whether the data is aggregated by month or by day.
*/
export type TrafficUsageDataSegmentedCombinedSchemaGrouping =
(typeof TrafficUsageDataSegmentedCombinedSchemaGrouping)[keyof typeof TrafficUsageDataSegmentedCombinedSchemaGrouping];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const TrafficUsageDataSegmentedCombinedSchemaGrouping = {
monthly: 'monthly',
daily: 'daily',
} as const;

0 comments on commit d0fa929

Please sign in to comment.