diff --git a/packages/aris-data-source-weatherkit/src/data-source.test.ts b/packages/aris-data-source-weatherkit/src/data-source.test.ts index fb452cb..e791f11 100644 --- a/packages/aris-data-source-weatherkit/src/data-source.test.ts +++ b/packages/aris-data-source-weatherkit/src/data-source.test.ts @@ -39,7 +39,7 @@ describe("WeatherKitDataSource", () => { credentials: mockCredentials, }) - expect(dataSource.type).toBe(WeatherFeedItemType.current) + expect(dataSource.type).toBe(WeatherFeedItemType.Current) }) test("throws error if neither client nor credentials provided", () => { @@ -130,9 +130,9 @@ describe("query() with mocked client", () => { const items = await dataSource.query(context) expect(items.length).toBeGreaterThan(0) - expect(items.some((i) => i.type === WeatherFeedItemType.current)).toBe(true) - expect(items.some((i) => i.type === WeatherFeedItemType.hourly)).toBe(true) - expect(items.some((i) => i.type === WeatherFeedItemType.daily)).toBe(true) + expect(items.some((i) => i.type === WeatherFeedItemType.Current)).toBe(true) + expect(items.some((i) => i.type === WeatherFeedItemType.Hourly)).toBe(true) + expect(items.some((i) => i.type === WeatherFeedItemType.Daily)).toBe(true) }) test("applies hourly and daily limits", async () => { @@ -145,8 +145,8 @@ describe("query() with mocked client", () => { const items = await dataSource.query(context) - const hourlyItems = items.filter((i) => i.type === WeatherFeedItemType.hourly) - const dailyItems = items.filter((i) => i.type === WeatherFeedItemType.daily) + const hourlyItems = items.filter((i) => i.type === WeatherFeedItemType.Hourly) + const dailyItems = items.filter((i) => i.type === WeatherFeedItemType.Daily) expect(hourlyItems.length).toBe(3) expect(dailyItems.length).toBe(2) @@ -176,8 +176,8 @@ describe("query() with mocked client", () => { units: Units.imperial, }) - const metricCurrent = metricItems.find((i) => i.type === WeatherFeedItemType.current) - const imperialCurrent = imperialItems.find((i) => i.type === WeatherFeedItemType.current) + const metricCurrent = metricItems.find((i) => i.type === WeatherFeedItemType.Current) + const imperialCurrent = imperialItems.find((i) => i.type === WeatherFeedItemType.Current) expect(metricCurrent).toBeDefined() expect(imperialCurrent).toBeDefined() @@ -203,7 +203,7 @@ describe("query() with mocked client", () => { expect(item.signals!.timeRelevance).toBeDefined() } - const currentItem = items.find((i) => i.type === WeatherFeedItemType.current) + const currentItem = items.find((i) => i.type === WeatherFeedItemType.Current) expect(currentItem).toBeDefined() expect(currentItem!.signals!.urgency).toBeGreaterThanOrEqual(0.5) }) diff --git a/packages/aris-data-source-weatherkit/src/data-source.ts b/packages/aris-data-source-weatherkit/src/data-source.ts index a6a16b4..dce1c91 100644 --- a/packages/aris-data-source-weatherkit/src/data-source.ts +++ b/packages/aris-data-source-weatherkit/src/data-source.ts @@ -44,7 +44,7 @@ export class WeatherKitDataSource implements DataSource {} @@ -49,7 +49,7 @@ export type HourlyWeatherData = { } export interface HourlyWeatherFeedItem extends FeedItem< - typeof WeatherFeedItemType.hourly, + typeof WeatherFeedItemType.Hourly, HourlyWeatherData > {} @@ -68,7 +68,7 @@ export type DailyWeatherData = { } export interface DailyWeatherFeedItem extends FeedItem< - typeof WeatherFeedItemType.daily, + typeof WeatherFeedItemType.Daily, DailyWeatherData > {} @@ -86,7 +86,7 @@ export type WeatherAlertData = { } export interface WeatherAlertFeedItem extends FeedItem< - typeof WeatherFeedItemType.alert, + typeof WeatherFeedItemType.Alert, WeatherAlertData > {} diff --git a/packages/aris-source-google-calendar/src/feed-items.ts b/packages/aris-source-google-calendar/src/feed-items.ts index 5c89875..f040717 100644 --- a/packages/aris-source-google-calendar/src/feed-items.ts +++ b/packages/aris-source-google-calendar/src/feed-items.ts @@ -3,19 +3,19 @@ import type { FeedItem } from "@aris/core" import type { CalendarEventData } from "./types" export const CalendarFeedItemType = { - event: "calendar-event", - allDay: "calendar-all-day", + Event: "calendar-event", + AllDay: "calendar-all-day", } as const export type CalendarFeedItemType = (typeof CalendarFeedItemType)[keyof typeof CalendarFeedItemType] export interface CalendarEventFeedItem extends FeedItem< - typeof CalendarFeedItemType.event, + typeof CalendarFeedItemType.Event, CalendarEventData > {} export interface CalendarAllDayFeedItem extends FeedItem< - typeof CalendarFeedItemType.allDay, + typeof CalendarFeedItemType.AllDay, CalendarEventData > {} diff --git a/packages/aris-source-google-calendar/src/google-calendar-source.test.ts b/packages/aris-source-google-calendar/src/google-calendar-source.test.ts index 9aa6652..904e795 100644 --- a/packages/aris-source-google-calendar/src/google-calendar-source.test.ts +++ b/packages/aris-source-google-calendar/src/google-calendar-source.test.ts @@ -69,7 +69,7 @@ describe("GoogleCalendarSource", () => { const source = new GoogleCalendarSource({ client: defaultMockClient() }) const items = await source.fetchItems(createContext()) - const timedItems = items.filter((i) => i.type === CalendarFeedItemType.event) + const timedItems = items.filter((i) => i.type === CalendarFeedItemType.Event) expect(timedItems.length).toBe(4) }) @@ -77,7 +77,7 @@ describe("GoogleCalendarSource", () => { const source = new GoogleCalendarSource({ client: defaultMockClient() }) const items = await source.fetchItems(createContext()) - const allDayItems = items.filter((i) => i.type === CalendarFeedItemType.allDay) + const allDayItems = items.filter((i) => i.type === CalendarFeedItemType.AllDay) expect(allDayItems.length).toBe(1) }) diff --git a/packages/aris-source-google-calendar/src/google-calendar-source.ts b/packages/aris-source-google-calendar/src/google-calendar-source.ts index d77fe29..678818e 100644 --- a/packages/aris-source-google-calendar/src/google-calendar-source.ts +++ b/packages/aris-source-google-calendar/src/google-calendar-source.ts @@ -209,7 +209,7 @@ function createFeedItem( nowMs: number, lookaheadMs: number, ): CalendarFeedItem { - const itemType = event.isAllDay ? CalendarFeedItemType.allDay : CalendarFeedItemType.event + const itemType = event.isAllDay ? CalendarFeedItemType.AllDay : CalendarFeedItemType.Event return { id: `calendar-${event.calendarId}-${event.eventId}`, diff --git a/packages/aris-source-weatherkit/src/feed-items.ts b/packages/aris-source-weatherkit/src/feed-items.ts index 0005846..b118642 100644 --- a/packages/aris-source-weatherkit/src/feed-items.ts +++ b/packages/aris-source-weatherkit/src/feed-items.ts @@ -3,10 +3,10 @@ import type { FeedItem } from "@aris/core" import type { Certainty, ConditionCode, PrecipitationType, Severity, Urgency } from "./weatherkit" export const WeatherFeedItemType = { - current: "weather-current", - hourly: "weather-hourly", - daily: "weather-daily", - alert: "weather-alert", + Current: "weather-current", + Hourly: "weather-hourly", + Daily: "weather-daily", + Alert: "weather-alert", } as const export type WeatherFeedItemType = (typeof WeatherFeedItemType)[keyof typeof WeatherFeedItemType] @@ -28,7 +28,7 @@ export type CurrentWeatherData = { } export interface CurrentWeatherFeedItem extends FeedItem< - typeof WeatherFeedItemType.current, + typeof WeatherFeedItemType.Current, CurrentWeatherData > {} @@ -49,7 +49,7 @@ export type HourlyWeatherData = { } export interface HourlyWeatherFeedItem extends FeedItem< - typeof WeatherFeedItemType.hourly, + typeof WeatherFeedItemType.Hourly, HourlyWeatherData > {} @@ -68,7 +68,7 @@ export type DailyWeatherData = { } export interface DailyWeatherFeedItem extends FeedItem< - typeof WeatherFeedItemType.daily, + typeof WeatherFeedItemType.Daily, DailyWeatherData > {} @@ -86,7 +86,7 @@ export type WeatherAlertData = { } export interface WeatherAlertFeedItem extends FeedItem< - typeof WeatherFeedItemType.alert, + typeof WeatherFeedItemType.Alert, WeatherAlertData > {} diff --git a/packages/aris-source-weatherkit/src/weather-source.test.ts b/packages/aris-source-weatherkit/src/weather-source.test.ts index f7f51f1..18749c2 100644 --- a/packages/aris-source-weatherkit/src/weather-source.test.ts +++ b/packages/aris-source-weatherkit/src/weather-source.test.ts @@ -110,9 +110,9 @@ describe("WeatherSource", () => { const items = await source.fetchItems(context) expect(items.length).toBeGreaterThan(0) - expect(items.some((i) => i.type === WeatherFeedItemType.current)).toBe(true) - expect(items.some((i) => i.type === WeatherFeedItemType.hourly)).toBe(true) - expect(items.some((i) => i.type === WeatherFeedItemType.daily)).toBe(true) + expect(items.some((i) => i.type === WeatherFeedItemType.Current)).toBe(true) + expect(items.some((i) => i.type === WeatherFeedItemType.Hourly)).toBe(true) + expect(items.some((i) => i.type === WeatherFeedItemType.Daily)).toBe(true) }) test("applies hourly and daily limits", async () => { @@ -125,8 +125,8 @@ describe("WeatherSource", () => { const items = await source.fetchItems(context) - const hourlyItems = items.filter((i) => i.type === WeatherFeedItemType.hourly) - const dailyItems = items.filter((i) => i.type === WeatherFeedItemType.daily) + const hourlyItems = items.filter((i) => i.type === WeatherFeedItemType.Hourly) + const dailyItems = items.filter((i) => i.type === WeatherFeedItemType.Daily) expect(hourlyItems.length).toBe(3) expect(dailyItems.length).toBe(2) @@ -158,7 +158,7 @@ describe("WeatherSource", () => { expect(item.signals!.timeRelevance).toBeDefined() } - const currentItem = items.find((i) => i.type === WeatherFeedItemType.current) + const currentItem = items.find((i) => i.type === WeatherFeedItemType.Current) expect(currentItem).toBeDefined() expect(currentItem!.signals!.urgency).toBeGreaterThanOrEqual(0.5) }) diff --git a/packages/aris-source-weatherkit/src/weather-source.ts b/packages/aris-source-weatherkit/src/weather-source.ts index a8862db..9247fcd 100644 --- a/packages/aris-source-weatherkit/src/weather-source.ts +++ b/packages/aris-source-weatherkit/src/weather-source.ts @@ -291,7 +291,7 @@ function createCurrentWeatherFeedItem( return { id: `weather-current-${timestamp.getTime()}`, - type: WeatherFeedItemType.current, + type: WeatherFeedItemType.Current, timestamp, data: { conditionCode: current.conditionCode, @@ -325,7 +325,7 @@ function createHourlyWeatherFeedItem( return { id: `weather-hourly-${timestamp.getTime()}-${index}`, - type: WeatherFeedItemType.hourly, + type: WeatherFeedItemType.Hourly, timestamp, data: { forecastTime: new Date(hourly.forecastStart), @@ -359,7 +359,7 @@ function createDailyWeatherFeedItem( return { id: `weather-daily-${timestamp.getTime()}-${index}`, - type: WeatherFeedItemType.daily, + type: WeatherFeedItemType.Daily, timestamp, data: { forecastDate: new Date(daily.forecastStart), @@ -386,7 +386,7 @@ function createWeatherAlertFeedItem(alert: WeatherAlert, timestamp: Date): Weath return { id: `weather-alert-${alert.id}`, - type: WeatherFeedItemType.alert, + type: WeatherFeedItemType.Alert, timestamp, data: { alertId: alert.id,