Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/@aws-cdk/service-spec-types/src/types/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ export interface NullType {
readonly type: 'null';
}

/**
*
* T is the entity type for compound objects.
*
* For example: TypeDefinition, EventTypeDefinition.
*/
export interface GenericDefinitionReference<T extends Entity> {
readonly type: 'ref';
readonly reference: Reference<T>;
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/service-spec-types/src/types/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { promises as fs } from 'fs';
import { gunzipSync } from 'zlib';
import { Database, entityCollection, fieldIndex, stringCmp } from '@cdklabs/tskb';
import { IsAugmentedResource, ResourceAugmentation } from './augmentations';
import { HasEvent, Event, EventUsesType, EventTypeDefinition } from './event';
import { ResourceHasEvent, Event, EventUsesType, EventTypeDefinition } from './event';
import {
DimensionSet,
Metric,
Expand Down Expand Up @@ -63,7 +63,7 @@ export function emptyDatabase() {
serviceHasMetric: r.relationship<ServiceHasMetric>('service', 'metric'),
resourceHasDimensionSet: r.relationship<ResourceHasDimensionSet>('resource', 'dimensionSet'),
serviceHasDimensionSet: r.relationship<ServiceHasDimensionSet>('service', 'dimensionSet'),
hasEvent: r.relationship<HasEvent>('resource', 'event'),
resourceHasEvent: r.relationship<ResourceHasEvent>('resource', 'event'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can't rename this, pretty sure this is going to break consumers. Do an alias if you must and deprecate the old name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a new type no one using it yet, so we're fine

eventUsesType: r.relationship<EventUsesType>('event', 'eventTypeDefinition'),
}),
);
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/service-spec-types/src/types/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export interface Event extends Entity {
*/
readonly resourcesField: Array<ResourceField>;
/**
* rootProperty has the reference for the root proprety for this event
* rootProperty has the reference for the root property for this event
*/
readonly rootProperty: Reference<EventTypeDefinition>;
}
Expand All @@ -44,7 +44,7 @@ export interface ResourceField {
fieldName?: string;
}

export type HasEvent = Relationship<Resource, Event>;
export type ResourceHasEvent = Relationship<Resource, Event>;

export type EventProperties = Record<string, EventProperty>;
export interface EventProperty {
Expand Down
Loading