update api report for cost-insight types

Signed-off-by: Andrew Thauer <athauer@wealthsimple.com>
This commit is contained in:
Andrew Thauer
2022-06-30 09:38:41 -04:00
parent 3e032a5de2
commit e6db276347
16 changed files with 147 additions and 128 deletions
+1 -35
View File
@@ -3,8 +3,6 @@
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
// Warning: (ae-missing-release-tag) "ChangeStatistic" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export interface ChangeStatistic {
// (undocumented)
@@ -13,8 +11,6 @@ export interface ChangeStatistic {
ratio?: number;
}
// Warning: (ae-missing-release-tag) "ChartData" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export type ChartData = {
date: number;
@@ -23,8 +19,6 @@ export type ChartData = {
[key: string]: number;
};
// Warning: (ae-missing-release-tag) "Cost" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export interface Cost {
// (undocumented)
@@ -39,8 +33,6 @@ export interface Cost {
trendline?: Trendline;
}
// Warning: (ae-missing-release-tag) "Currency" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export interface Currency {
// (undocumented)
@@ -55,16 +47,12 @@ export interface Currency {
unit: string;
}
// Warning: (ae-missing-release-tag) "DateAggregation" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export type DateAggregation = {
date: string;
amount: number;
};
// Warning: (ae-missing-release-tag) "Duration" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public
export enum Duration {
// (undocumented)
@@ -77,9 +65,7 @@ export enum Duration {
P90D = 'P90D',
}
// Warning: (ae-missing-release-tag) "Entity" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
// @public
export interface Entity {
// (undocumented)
aggregation: [number, number];
@@ -91,20 +77,14 @@ export interface Entity {
id: Maybe<string>;
}
// Warning: (ae-missing-release-tag) "Group" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export type Group = {
id: string;
};
// Warning: (ae-missing-release-tag) "Maybe" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export type Maybe<T> = T | null;
// Warning: (ae-missing-release-tag) "Metric" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export type Metric = {
kind: string;
@@ -112,8 +92,6 @@ export type Metric = {
default: boolean;
};
// Warning: (ae-missing-release-tag) "MetricData" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export interface MetricData {
// (undocumented)
@@ -126,8 +104,6 @@ export interface MetricData {
id: string;
}
// Warning: (ae-missing-release-tag) "PageFilters" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export interface PageFilters {
// (undocumented)
@@ -140,8 +116,6 @@ export interface PageFilters {
project: Maybe<string>;
}
// Warning: (ae-missing-release-tag) "Product" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export interface Product {
// (undocumented)
@@ -150,13 +124,9 @@ export interface Product {
name: string;
}
// Warning: (ae-missing-release-tag) "ProductFilters" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export type ProductFilters = Array<ProductPeriod>;
// Warning: (ae-missing-release-tag) "ProductPeriod" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export interface ProductPeriod {
// (undocumented)
@@ -165,8 +135,6 @@ export interface ProductPeriod {
productType: string;
}
// Warning: (ae-missing-release-tag) "Project" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export interface Project {
// (undocumented)
@@ -175,8 +143,6 @@ export interface Project {
name?: string;
}
// Warning: (ae-missing-release-tag) "Trendline" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export type Trendline = {
slope: number;
@@ -14,6 +14,9 @@
* limitations under the License.
*/
/**
* @public
*/
export interface ChangeStatistic {
// The ratio of change from one duration to another, expressed as: (newSum - oldSum) / oldSum
// If a ratio cannot be calculated - such as when a new or old sum is zero,
@@ -14,6 +14,9 @@
* limitations under the License.
*/
/**
* @public
*/
export type ChartData = {
date: number;
trend: number;
@@ -18,6 +18,9 @@ import { DateAggregation } from './DateAggregation';
import { ChangeStatistic } from './ChangeStatistic';
import { Trendline } from './Trendline';
/**
* @public
*/
export interface Cost {
id: string;
aggregation: DateAggregation[];
@@ -14,6 +14,9 @@
* limitations under the License.
*/
/**
* @public
*/
export interface Currency {
kind: string | null;
label: string;
@@ -14,6 +14,9 @@
* limitations under the License.
*/
/**
* @public
*/
export type DateAggregation = {
date: string; // YYYY-MM-DD
amount: number;
@@ -19,6 +19,7 @@
* 'last completed quarter', and P30D/P90D to be '[month|quarter] relative to today'. So if
* it's September 15, P3M represents costs for Q2 and P30D represents August 16 -
* September 15.
* @public
*/
export enum Duration {
P7D = 'P7D',
@@ -17,102 +17,108 @@
import { ChangeStatistic } from './ChangeStatistic';
import { Maybe } from './Maybe';
/**
*
* An entity is a tree-like structure that represents any unique
* product or service that generates cost over a fixed period of time.
* An entity could be atomic or composite. An atomic entity is indivisible
* and cannot be broken into sub-entities.
*
* A composite entity is divided into sub-entities that account for portions
* of the total cost **over the same time period**. The root entity is
* expected to only have _one_ Record consisting of the sub-entities to display
* in the product panel (keyed by the entity type, such as "service" for
* compute entities).
*
* The root sub-entities may have multiple breakdowns - for example, a
* breakdown of an entity cost by SKU vs deployment environment. The sum
* aggregated cost of each keyed breakdown should equal the sub-entity's cost.
*
* Entities with null ids are considered "unlabeled" - costs without attribution.
* If an entity is a composite, it may only have one (1) null child but may have any number of
* null grandchildren.
*
* @public
*
* @example
* Here's an example composite entity:
* ```
* const compositeEntity = {
* id: 'product',
* aggregation: [0, 200],
* change: {
* ratio: 2000,
* amount: 200
* },
* entities: {
* service: [
* {
* id: 'service-a',
* aggregation: [0, 100],
* change: {
* ratio: 100,
* amount: 100
* },
* entities: {}
* },
* {
* id: 'service-b',
* aggregation: [0, 100],
* change: {
* ratio: 100,
* amount: 100
* },
* entities: {
* SKU: [
* {
* id: 'service-b-sku-a',
* aggregation: [0, 25],
* change: {
* ratio: 25,
* amount: 25
* },
* entities: {}
* },
* {
* id: null, // Unlabeled cost for service-b
* aggregation: [0, 75],
* change: {
* ratio: 75,
* amount: 75
* },
* entities: {}
* },
* ],
* deployment: [
* {
* id: 'service-b-env-a',
* aggregation: [0, 50],
* change: {
* ratio: 50,
* amount: 50
* },
* entities: {}
* },
* {
* id: 'service-b-env-b',
* aggregation: [0, 50],
* change: {
* ratio: 50,
* amount: 50
* },
* entities: {}
* },
* ]
* }
* },
* ]
* }
* }
* ```
*/
export interface Entity {
id: Maybe<string>;
aggregation: [number, number];
entities: Record<string, Entity[]>;
change: ChangeStatistic;
}
/*
An entity is a tree-like structure that represents any unique
product or service that generates cost over a fixed period of time.
An entity could be atomic or composite. An atomic entity is indivisible
and cannot be broken into sub-entities.
A composite entity is divided into sub-entities that account for portions
of the total cost **over the same time period**. The root entity is
expected to only have _one_ Record consisting of the sub-entities to display
in the product panel (keyed by the entity type, such as "service" for
compute entities).
The root sub-entities may have multiple breakdowns - for example, a
breakdown of an entity cost by SKU vs deployment environment. The sum
aggregated cost of each keyed breakdown should equal the sub-entity's cost.
Entities with null ids are considered "unlabeled" - costs without attribution.
If an entity is a composite, it may only have one (1) null child but may have any number of
null grandchildren.
{
id: 'product',
aggregation: [0, 200],
change: {
ratio: 2000,
amount: 200
},
entities: {
service: [
{
id: 'service-a',
aggregation: [0, 100],
change: {
ratio: 100,
amount: 100
},
entities: {}
},
{
id: 'service-b',
aggregation: [0, 100],
change: {
ratio: 100,
amount: 100
},
entities: {
SKU: [
{
id: 'service-b-sku-a',
aggregation: [0, 25],
change: {
ratio: 25,
amount: 25
},
entities: {}
},
{
id: null, // Unlabeled cost for service-b
aggregation: [0, 75],
change: {
ratio: 75,
amount: 75
},
entities: {}
},
],
deployment: [
{
id: 'service-b-env-a',
aggregation: [0, 50],
change: {
ratio: 50,
amount: 50
},
entities: {}
},
{
id: 'service-b-env-b',
aggregation: [0, 50],
change: {
ratio: 50,
amount: 50
},
entities: {}
},
]
}
},
]
}
}
*/
@@ -17,6 +17,9 @@
import { Maybe } from './Maybe';
import { Duration } from './Duration';
/**
* @public
*/
export interface PageFilters {
group: Maybe<string>;
project: Maybe<string>;
@@ -24,8 +27,14 @@ export interface PageFilters {
metric: string | null;
}
/**
* @public
*/
export type ProductFilters = Array<ProductPeriod>;
/**
* @public
*/
export interface ProductPeriod {
duration: Duration;
productType: string;
@@ -14,6 +14,9 @@
* limitations under the License.
*/
/**
* @public
*/
export type Group = {
id: string;
};
@@ -14,4 +14,7 @@
* limitations under the License.
*/
/**
* @public
*/
export type Maybe<T> = T | null;
@@ -14,6 +14,9 @@
* limitations under the License.
*/
/**
* @public
*/
export type Metric = {
kind: string;
name: string;
@@ -17,6 +17,9 @@
import { DateAggregation } from './DateAggregation';
import { ChangeStatistic } from './ChangeStatistic';
/**
* @public
*/
export interface MetricData {
id: string;
format: 'number' | 'currency';
@@ -14,6 +14,9 @@
* limitations under the License.
*/
/**
* @public
*/
export interface Product {
kind: string;
name: string;
@@ -14,6 +14,9 @@
* limitations under the License.
*/
/**
* @public
*/
export interface Project {
id: string;
name?: string;
@@ -13,6 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @public
*/
export type Trendline = {
slope: number;
intercept: number;