local-risk-alert-feed 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/adapters/index.js +8 -0
- package/dist/cjs/adapters/index.js.map +1 -0
- package/dist/cjs/adapters/lambda.js +143 -0
- package/dist/cjs/adapters/lambda.js.map +1 -0
- package/dist/cjs/adapters/vercel.js +119 -0
- package/dist/cjs/adapters/vercel.js.map +1 -0
- package/dist/cjs/core/alert-aggregator.js +207 -0
- package/dist/cjs/core/alert-aggregator.js.map +1 -0
- package/dist/cjs/core/alert-feed.js +236 -0
- package/dist/cjs/core/alert-feed.js.map +1 -0
- package/dist/cjs/core/index.js +22 -0
- package/dist/cjs/core/index.js.map +1 -0
- package/dist/cjs/core/plugin-registry.js +193 -0
- package/dist/cjs/core/plugin-registry.js.map +1 -0
- package/dist/cjs/core/plugin-resolver.js +121 -0
- package/dist/cjs/core/plugin-resolver.js.map +1 -0
- package/dist/cjs/core/time-range.js +67 -0
- package/dist/cjs/core/time-range.js.map +1 -0
- package/dist/cjs/errors/fetch-error.js +71 -0
- package/dist/cjs/errors/fetch-error.js.map +1 -0
- package/dist/cjs/errors/index.js +15 -0
- package/dist/cjs/errors/index.js.map +1 -0
- package/dist/cjs/errors/plugin-error.js +80 -0
- package/dist/cjs/errors/plugin-error.js.map +1 -0
- package/dist/cjs/errors/validation-error.js +49 -0
- package/dist/cjs/errors/validation-error.js.map +1 -0
- package/dist/cjs/geo/distance.js +94 -0
- package/dist/cjs/geo/distance.js.map +1 -0
- package/dist/cjs/geo/index.js +18 -0
- package/dist/cjs/geo/index.js.map +1 -0
- package/dist/cjs/geo/point-in-radius.js +86 -0
- package/dist/cjs/geo/point-in-radius.js.map +1 -0
- package/dist/cjs/index.js +90 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/plugins/air-quality/airnow.plugin.js +343 -0
- package/dist/cjs/plugins/air-quality/airnow.plugin.js.map +1 -0
- package/dist/cjs/plugins/air-quality/index.js +6 -0
- package/dist/cjs/plugins/air-quality/index.js.map +1 -0
- package/dist/cjs/plugins/base-plugin.js +213 -0
- package/dist/cjs/plugins/base-plugin.js.map +1 -0
- package/dist/cjs/plugins/events/index.js +6 -0
- package/dist/cjs/plugins/events/index.js.map +1 -0
- package/dist/cjs/plugins/events/phoenix-events.plugin.js +382 -0
- package/dist/cjs/plugins/events/phoenix-events.plugin.js.map +1 -0
- package/dist/cjs/plugins/fire-emt/index.js +6 -0
- package/dist/cjs/plugins/fire-emt/index.js.map +1 -0
- package/dist/cjs/plugins/fire-emt/phoenix-fire.plugin.js +262 -0
- package/dist/cjs/plugins/fire-emt/phoenix-fire.plugin.js.map +1 -0
- package/dist/cjs/plugins/index.js +28 -0
- package/dist/cjs/plugins/index.js.map +1 -0
- package/dist/cjs/plugins/police-blotter/index.js +6 -0
- package/dist/cjs/plugins/police-blotter/index.js.map +1 -0
- package/dist/cjs/plugins/police-blotter/phoenix-police.plugin.js +198 -0
- package/dist/cjs/plugins/police-blotter/phoenix-police.plugin.js.map +1 -0
- package/dist/cjs/plugins/pulsepoint/index.js +6 -0
- package/dist/cjs/plugins/pulsepoint/index.js.map +1 -0
- package/dist/cjs/plugins/pulsepoint/pulsepoint.plugin.js +275 -0
- package/dist/cjs/plugins/pulsepoint/pulsepoint.plugin.js.map +1 -0
- package/dist/cjs/plugins/traffic/arizona-traffic.plugin.js +391 -0
- package/dist/cjs/plugins/traffic/arizona-traffic.plugin.js.map +1 -0
- package/dist/cjs/plugins/traffic/index.js +6 -0
- package/dist/cjs/plugins/traffic/index.js.map +1 -0
- package/dist/cjs/plugins/weather/index.js +6 -0
- package/dist/cjs/plugins/weather/index.js.map +1 -0
- package/dist/cjs/plugins/weather/nws-weather.plugin.js +180 -0
- package/dist/cjs/plugins/weather/nws-weather.plugin.js.map +1 -0
- package/dist/cjs/schemas/alert.schema.js +93 -0
- package/dist/cjs/schemas/alert.schema.js.map +1 -0
- package/dist/cjs/schemas/index.js +24 -0
- package/dist/cjs/schemas/index.js.map +1 -0
- package/dist/cjs/schemas/query.schema.js +76 -0
- package/dist/cjs/schemas/query.schema.js.map +1 -0
- package/dist/cjs/types/alert.js +35 -0
- package/dist/cjs/types/alert.js.map +1 -0
- package/dist/cjs/types/config.js +13 -0
- package/dist/cjs/types/config.js.map +1 -0
- package/dist/cjs/types/geo.js +3 -0
- package/dist/cjs/types/geo.js.map +1 -0
- package/dist/cjs/types/index.js +16 -0
- package/dist/cjs/types/index.js.map +1 -0
- package/dist/cjs/types/plugin.js +3 -0
- package/dist/cjs/types/plugin.js.map +1 -0
- package/dist/cjs/types/query.js +28 -0
- package/dist/cjs/types/query.js.map +1 -0
- package/dist/cjs/utils/cache.js +188 -0
- package/dist/cjs/utils/cache.js.map +1 -0
- package/dist/cjs/utils/csv.js +189 -0
- package/dist/cjs/utils/csv.js.map +1 -0
- package/dist/cjs/utils/date.js +153 -0
- package/dist/cjs/utils/date.js.map +1 -0
- package/dist/cjs/utils/index.js +28 -0
- package/dist/cjs/utils/index.js.map +1 -0
- package/dist/cjs/utils/retry.js +109 -0
- package/dist/cjs/utils/retry.js.map +1 -0
- package/dist/esm/adapters/index.js +3 -0
- package/dist/esm/adapters/index.js.map +1 -0
- package/dist/esm/adapters/lambda.js +140 -0
- package/dist/esm/adapters/lambda.js.map +1 -0
- package/dist/esm/adapters/vercel.js +116 -0
- package/dist/esm/adapters/vercel.js.map +1 -0
- package/dist/esm/core/alert-aggregator.js +203 -0
- package/dist/esm/core/alert-aggregator.js.map +1 -0
- package/dist/esm/core/alert-feed.js +232 -0
- package/dist/esm/core/alert-feed.js.map +1 -0
- package/dist/esm/core/index.js +6 -0
- package/dist/esm/core/index.js.map +1 -0
- package/dist/esm/core/plugin-registry.js +189 -0
- package/dist/esm/core/plugin-registry.js.map +1 -0
- package/dist/esm/core/plugin-resolver.js +117 -0
- package/dist/esm/core/plugin-resolver.js.map +1 -0
- package/dist/esm/core/time-range.js +57 -0
- package/dist/esm/core/time-range.js.map +1 -0
- package/dist/esm/errors/fetch-error.js +67 -0
- package/dist/esm/errors/fetch-error.js.map +1 -0
- package/dist/esm/errors/index.js +4 -0
- package/dist/esm/errors/index.js.map +1 -0
- package/dist/esm/errors/plugin-error.js +71 -0
- package/dist/esm/errors/plugin-error.js.map +1 -0
- package/dist/esm/errors/validation-error.js +45 -0
- package/dist/esm/errors/validation-error.js.map +1 -0
- package/dist/esm/geo/distance.js +85 -0
- package/dist/esm/geo/distance.js.map +1 -0
- package/dist/esm/geo/index.js +3 -0
- package/dist/esm/geo/index.js.map +1 -0
- package/dist/esm/geo/point-in-radius.js +79 -0
- package/dist/esm/geo/point-in-radius.js.map +1 -0
- package/dist/esm/index.js +30 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/plugins/air-quality/airnow.plugin.js +339 -0
- package/dist/esm/plugins/air-quality/airnow.plugin.js.map +1 -0
- package/dist/esm/plugins/air-quality/index.js +2 -0
- package/dist/esm/plugins/air-quality/index.js.map +1 -0
- package/dist/esm/plugins/base-plugin.js +209 -0
- package/dist/esm/plugins/base-plugin.js.map +1 -0
- package/dist/esm/plugins/events/index.js +2 -0
- package/dist/esm/plugins/events/index.js.map +1 -0
- package/dist/esm/plugins/events/phoenix-events.plugin.js +378 -0
- package/dist/esm/plugins/events/phoenix-events.plugin.js.map +1 -0
- package/dist/esm/plugins/fire-emt/index.js +2 -0
- package/dist/esm/plugins/fire-emt/index.js.map +1 -0
- package/dist/esm/plugins/fire-emt/phoenix-fire.plugin.js +258 -0
- package/dist/esm/plugins/fire-emt/phoenix-fire.plugin.js.map +1 -0
- package/dist/esm/plugins/index.js +17 -0
- package/dist/esm/plugins/index.js.map +1 -0
- package/dist/esm/plugins/police-blotter/index.js +2 -0
- package/dist/esm/plugins/police-blotter/index.js.map +1 -0
- package/dist/esm/plugins/police-blotter/phoenix-police.plugin.js +194 -0
- package/dist/esm/plugins/police-blotter/phoenix-police.plugin.js.map +1 -0
- package/dist/esm/plugins/pulsepoint/index.js +2 -0
- package/dist/esm/plugins/pulsepoint/index.js.map +1 -0
- package/dist/esm/plugins/pulsepoint/pulsepoint.plugin.js +271 -0
- package/dist/esm/plugins/pulsepoint/pulsepoint.plugin.js.map +1 -0
- package/dist/esm/plugins/traffic/arizona-traffic.plugin.js +387 -0
- package/dist/esm/plugins/traffic/arizona-traffic.plugin.js.map +1 -0
- package/dist/esm/plugins/traffic/index.js +2 -0
- package/dist/esm/plugins/traffic/index.js.map +1 -0
- package/dist/esm/plugins/weather/index.js +2 -0
- package/dist/esm/plugins/weather/index.js.map +1 -0
- package/dist/esm/plugins/weather/nws-weather.plugin.js +176 -0
- package/dist/esm/plugins/weather/nws-weather.plugin.js.map +1 -0
- package/dist/esm/schemas/alert.schema.js +90 -0
- package/dist/esm/schemas/alert.schema.js.map +1 -0
- package/dist/esm/schemas/index.js +5 -0
- package/dist/esm/schemas/index.js.map +1 -0
- package/dist/esm/schemas/query.schema.js +72 -0
- package/dist/esm/schemas/query.schema.js.map +1 -0
- package/dist/esm/types/alert.js +32 -0
- package/dist/esm/types/alert.js.map +1 -0
- package/dist/esm/types/config.js +10 -0
- package/dist/esm/types/config.js.map +1 -0
- package/dist/esm/types/geo.js +2 -0
- package/dist/esm/types/geo.js.map +1 -0
- package/dist/esm/types/index.js +4 -0
- package/dist/esm/types/index.js.map +1 -0
- package/dist/esm/types/plugin.js +2 -0
- package/dist/esm/types/plugin.js.map +1 -0
- package/dist/esm/types/query.js +25 -0
- package/dist/esm/types/query.js.map +1 -0
- package/dist/esm/utils/cache.js +181 -0
- package/dist/esm/utils/cache.js.map +1 -0
- package/dist/esm/utils/csv.js +185 -0
- package/dist/esm/utils/csv.js.map +1 -0
- package/dist/esm/utils/date.js +142 -0
- package/dist/esm/utils/date.js.map +1 -0
- package/dist/esm/utils/index.js +5 -0
- package/dist/esm/utils/index.js.map +1 -0
- package/dist/esm/utils/retry.js +102 -0
- package/dist/esm/utils/retry.js.map +1 -0
- package/dist/types/adapters/index.d.ts +5 -0
- package/dist/types/adapters/index.d.ts.map +1 -0
- package/dist/types/adapters/lambda.d.ts +37 -0
- package/dist/types/adapters/lambda.d.ts.map +1 -0
- package/dist/types/adapters/vercel.d.ts +54 -0
- package/dist/types/adapters/vercel.d.ts.map +1 -0
- package/dist/types/core/alert-aggregator.d.ts +81 -0
- package/dist/types/core/alert-aggregator.d.ts.map +1 -0
- package/dist/types/core/alert-feed.d.ts +80 -0
- package/dist/types/core/alert-feed.d.ts.map +1 -0
- package/dist/types/core/index.d.ts +8 -0
- package/dist/types/core/index.d.ts.map +1 -0
- package/dist/types/core/plugin-registry.d.ts +91 -0
- package/dist/types/core/plugin-registry.d.ts.map +1 -0
- package/dist/types/core/plugin-resolver.d.ts +78 -0
- package/dist/types/core/plugin-resolver.d.ts.map +1 -0
- package/dist/types/core/time-range.d.ts +40 -0
- package/dist/types/core/time-range.d.ts.map +1 -0
- package/dist/types/errors/fetch-error.d.ts +46 -0
- package/dist/types/errors/fetch-error.d.ts.map +1 -0
- package/dist/types/errors/index.d.ts +5 -0
- package/dist/types/errors/index.d.ts.map +1 -0
- package/dist/types/errors/plugin-error.d.ts +42 -0
- package/dist/types/errors/plugin-error.d.ts.map +1 -0
- package/dist/types/errors/validation-error.d.ts +34 -0
- package/dist/types/errors/validation-error.d.ts.map +1 -0
- package/dist/types/geo/distance.d.ts +50 -0
- package/dist/types/geo/distance.d.ts.map +1 -0
- package/dist/types/geo/index.d.ts +3 -0
- package/dist/types/geo/index.d.ts.map +1 -0
- package/dist/types/geo/point-in-radius.d.ts +44 -0
- package/dist/types/geo/point-in-radius.d.ts.map +1 -0
- package/dist/types/index.d.ts +32 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/plugins/air-quality/airnow.plugin.d.ts +84 -0
- package/dist/types/plugins/air-quality/airnow.plugin.d.ts.map +1 -0
- package/dist/types/plugins/air-quality/index.d.ts +3 -0
- package/dist/types/plugins/air-quality/index.d.ts.map +1 -0
- package/dist/types/plugins/base-plugin.d.ts +99 -0
- package/dist/types/plugins/base-plugin.d.ts.map +1 -0
- package/dist/types/plugins/events/index.d.ts +3 -0
- package/dist/types/plugins/events/index.d.ts.map +1 -0
- package/dist/types/plugins/events/phoenix-events.plugin.d.ts +71 -0
- package/dist/types/plugins/events/phoenix-events.plugin.d.ts.map +1 -0
- package/dist/types/plugins/fire-emt/index.d.ts +3 -0
- package/dist/types/plugins/fire-emt/index.d.ts.map +1 -0
- package/dist/types/plugins/fire-emt/phoenix-fire.plugin.d.ts +47 -0
- package/dist/types/plugins/fire-emt/phoenix-fire.plugin.d.ts.map +1 -0
- package/dist/types/plugins/index.d.ts +17 -0
- package/dist/types/plugins/index.d.ts.map +1 -0
- package/dist/types/plugins/police-blotter/index.d.ts +3 -0
- package/dist/types/plugins/police-blotter/index.d.ts.map +1 -0
- package/dist/types/plugins/police-blotter/phoenix-police.plugin.d.ts +49 -0
- package/dist/types/plugins/police-blotter/phoenix-police.plugin.d.ts.map +1 -0
- package/dist/types/plugins/pulsepoint/index.d.ts +3 -0
- package/dist/types/plugins/pulsepoint/index.d.ts.map +1 -0
- package/dist/types/plugins/pulsepoint/pulsepoint.plugin.d.ts +61 -0
- package/dist/types/plugins/pulsepoint/pulsepoint.plugin.d.ts.map +1 -0
- package/dist/types/plugins/traffic/arizona-traffic.plugin.d.ts +83 -0
- package/dist/types/plugins/traffic/arizona-traffic.plugin.d.ts.map +1 -0
- package/dist/types/plugins/traffic/index.d.ts +3 -0
- package/dist/types/plugins/traffic/index.d.ts.map +1 -0
- package/dist/types/plugins/weather/index.d.ts +3 -0
- package/dist/types/plugins/weather/index.d.ts.map +1 -0
- package/dist/types/plugins/weather/nws-weather.plugin.d.ts +50 -0
- package/dist/types/plugins/weather/nws-weather.plugin.d.ts.map +1 -0
- package/dist/types/schemas/alert.schema.d.ts +266 -0
- package/dist/types/schemas/alert.schema.d.ts.map +1 -0
- package/dist/types/schemas/index.d.ts +5 -0
- package/dist/types/schemas/index.d.ts.map +1 -0
- package/dist/types/schemas/query.schema.d.ts +150 -0
- package/dist/types/schemas/query.schema.d.ts.map +1 -0
- package/dist/types/types/alert.d.ts +96 -0
- package/dist/types/types/alert.d.ts.map +1 -0
- package/dist/types/types/config.d.ts +63 -0
- package/dist/types/types/config.d.ts.map +1 -0
- package/dist/types/types/geo.d.ts +33 -0
- package/dist/types/types/geo.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +9 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/types/types/plugin.d.ts +125 -0
- package/dist/types/types/plugin.d.ts.map +1 -0
- package/dist/types/types/query.d.ts +86 -0
- package/dist/types/types/query.d.ts.map +1 -0
- package/dist/types/utils/cache.d.ts +112 -0
- package/dist/types/utils/cache.d.ts.map +1 -0
- package/dist/types/utils/csv.d.ts +38 -0
- package/dist/types/utils/csv.d.ts.map +1 -0
- package/dist/types/utils/date.d.ts +47 -0
- package/dist/types/utils/date.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +7 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/types/utils/retry.d.ts +51 -0
- package/dist/types/utils/retry.d.ts.map +1 -0
- package/package.json +115 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { PluginMetadata, PluginFetchOptions, PluginFetchResult } from '../../types';
|
|
2
|
+
import { BasePlugin, BasePluginConfig } from '../base-plugin';
|
|
3
|
+
/**
|
|
4
|
+
* Pulsepoint plugin configuration.
|
|
5
|
+
*/
|
|
6
|
+
export interface PulsepointPluginConfig extends BasePluginConfig {
|
|
7
|
+
/**
|
|
8
|
+
* Pulsepoint agency IDs to monitor.
|
|
9
|
+
* For Phoenix area:
|
|
10
|
+
* - FPHX (Phoenix Fire)
|
|
11
|
+
* - FMES (Mesa Fire)
|
|
12
|
+
* - FTEM (Tempe Fire)
|
|
13
|
+
* - FGLN (Glendale Fire)
|
|
14
|
+
* - FSCOT (Scottsdale Fire)
|
|
15
|
+
*/
|
|
16
|
+
agencyIds?: string[];
|
|
17
|
+
/** Include recently closed incidents. Default: false */
|
|
18
|
+
includeRecent?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Plugin that fetches real-time fire and EMS incidents from Pulsepoint.
|
|
22
|
+
*
|
|
23
|
+
* Pulsepoint provides real-time incident data from participating fire departments.
|
|
24
|
+
*
|
|
25
|
+
* @see https://www.pulsepoint.org
|
|
26
|
+
*/
|
|
27
|
+
export declare class PulsepointPlugin extends BasePlugin {
|
|
28
|
+
readonly metadata: PluginMetadata;
|
|
29
|
+
private pulsepointConfig;
|
|
30
|
+
constructor(config?: PulsepointPluginConfig);
|
|
31
|
+
fetchAlerts(options: PluginFetchOptions): Promise<PluginFetchResult>;
|
|
32
|
+
/**
|
|
33
|
+
* Fetch incidents from all configured agencies.
|
|
34
|
+
*/
|
|
35
|
+
private fetchAllAgencies;
|
|
36
|
+
/**
|
|
37
|
+
* Fetch incidents from a single Pulsepoint agency.
|
|
38
|
+
*/
|
|
39
|
+
private fetchAgencyIncidents;
|
|
40
|
+
/**
|
|
41
|
+
* Transform a Pulsepoint incident to our Alert format.
|
|
42
|
+
*/
|
|
43
|
+
private transformIncident;
|
|
44
|
+
/**
|
|
45
|
+
* Map incident type to category and risk level.
|
|
46
|
+
*/
|
|
47
|
+
private mapIncidentType;
|
|
48
|
+
/**
|
|
49
|
+
* Format incident type for display.
|
|
50
|
+
*/
|
|
51
|
+
private formatIncidentType;
|
|
52
|
+
/**
|
|
53
|
+
* Build description from incident data.
|
|
54
|
+
*/
|
|
55
|
+
private buildDescription;
|
|
56
|
+
/**
|
|
57
|
+
* Calculate distance between two points in meters.
|
|
58
|
+
*/
|
|
59
|
+
private calculateDistance;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=pulsepoint.plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pulsepoint.plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/pulsepoint/pulsepoint.plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,EAA4B,MAAM,aAAa,CAAC;AACnH,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAkC9D;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB;IAC9D;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,wDAAwD;IACxD,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAwED;;;;;;GAMG;AACH,qBAAa,gBAAiB,SAAQ,UAAU;IAC9C,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAc/B;IAEF,OAAO,CAAC,gBAAgB,CAAyB;gBAErC,MAAM,CAAC,EAAE,sBAAsB;IASrC,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAyC1E;;OAEG;YACW,gBAAgB;IAkB9B;;OAEG;YACW,oBAAoB;IAmBlC;;OAEG;IACH,OAAO,CAAC,iBAAiB;IA0CzB;;OAEG;IACH,OAAO,CAAC,eAAe;IA0BvB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAQ1B;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAuBxB;;OAEG;IACH,OAAO,CAAC,iBAAiB;CAc1B"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { PluginMetadata, PluginFetchOptions, PluginFetchResult } from '../../types';
|
|
2
|
+
import { BasePlugin, BasePluginConfig } from '../base-plugin';
|
|
3
|
+
/**
|
|
4
|
+
* Arizona Traffic plugin configuration.
|
|
5
|
+
*/
|
|
6
|
+
export interface ArizonaTrafficPluginConfig extends BasePluginConfig {
|
|
7
|
+
/** Include road construction events. Default: true */
|
|
8
|
+
includeConstruction?: boolean;
|
|
9
|
+
/** Include closures only (filter out minor events). Default: false */
|
|
10
|
+
closuresOnly?: boolean;
|
|
11
|
+
/** Minimum delay in minutes to include. Default: 0 */
|
|
12
|
+
minDelayMinutes?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Plugin that fetches traffic incident data for Arizona.
|
|
16
|
+
*
|
|
17
|
+
* Uses ADOT (Arizona DOT) data feeds for traffic incidents,
|
|
18
|
+
* road closures, construction, and congestion information.
|
|
19
|
+
*
|
|
20
|
+
* @see https://az511.gov
|
|
21
|
+
*/
|
|
22
|
+
export declare class ArizonaTrafficPlugin extends BasePlugin {
|
|
23
|
+
readonly metadata: PluginMetadata;
|
|
24
|
+
private trafficConfig;
|
|
25
|
+
constructor(config?: ArizonaTrafficPluginConfig);
|
|
26
|
+
fetchAlerts(options: PluginFetchOptions): Promise<PluginFetchResult>;
|
|
27
|
+
/**
|
|
28
|
+
* Fetch traffic events from ADOT sources.
|
|
29
|
+
*/
|
|
30
|
+
private fetchTrafficEvents;
|
|
31
|
+
/**
|
|
32
|
+
* Build URL for traffic incidents.
|
|
33
|
+
* Note: Location filtering is done client-side after fetching all Arizona data.
|
|
34
|
+
*/
|
|
35
|
+
private buildIncidentsUrl;
|
|
36
|
+
/**
|
|
37
|
+
* Build URL for construction events.
|
|
38
|
+
* Note: Location filtering is done client-side after fetching all Arizona data.
|
|
39
|
+
*/
|
|
40
|
+
private buildConstructionUrl;
|
|
41
|
+
/**
|
|
42
|
+
* Build URL for road closures.
|
|
43
|
+
* Note: Location filtering is done client-side after fetching all Arizona data.
|
|
44
|
+
*/
|
|
45
|
+
private buildClosuresUrl;
|
|
46
|
+
/**
|
|
47
|
+
* Fetch from a specific source and normalize the data.
|
|
48
|
+
*/
|
|
49
|
+
private fetchFromSource;
|
|
50
|
+
/**
|
|
51
|
+
* Normalize a GeoJSON feature to our traffic event structure.
|
|
52
|
+
*/
|
|
53
|
+
private normalizeFeature;
|
|
54
|
+
/**
|
|
55
|
+
* Transform a traffic event to our Alert format.
|
|
56
|
+
*/
|
|
57
|
+
private transformEvent;
|
|
58
|
+
/**
|
|
59
|
+
* Map event type to risk level.
|
|
60
|
+
*/
|
|
61
|
+
private mapEventTypeToRisk;
|
|
62
|
+
/**
|
|
63
|
+
* Build title from event data.
|
|
64
|
+
*/
|
|
65
|
+
private buildTitle;
|
|
66
|
+
/**
|
|
67
|
+
* Format event type for display.
|
|
68
|
+
*/
|
|
69
|
+
private formatEventType;
|
|
70
|
+
/**
|
|
71
|
+
* Build description from event data.
|
|
72
|
+
*/
|
|
73
|
+
private buildDescription;
|
|
74
|
+
/**
|
|
75
|
+
* Build address from event data.
|
|
76
|
+
*/
|
|
77
|
+
private buildAddress;
|
|
78
|
+
/**
|
|
79
|
+
* Calculate distance between two points in meters.
|
|
80
|
+
*/
|
|
81
|
+
private calculateDistance;
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=arizona-traffic.plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arizona-traffic.plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/traffic/arizona-traffic.plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,EAAa,MAAM,aAAa,CAAC;AACpG,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AA2C9D;;GAEG;AACH,MAAM,WAAW,0BAA2B,SAAQ,gBAAgB;IAClE,sDAAsD;IACtD,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,sEAAsE;IACtE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,sDAAsD;IACtD,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAiDD;;;;;;;GAOG;AACH,qBAAa,oBAAqB,SAAQ,UAAU;IAClD,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAc/B;IAEF,OAAO,CAAC,aAAa,CAA6B;gBAEtC,MAAM,CAAC,EAAE,0BAA0B;IAUzC,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAwB1E;;OAEG;YACW,kBAAkB;IAmEhC;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAMzB;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAI5B;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAIxB;;OAEG;YACW,eAAe;IAkB7B;;OAEG;IACH,OAAO,CAAC,gBAAgB;IA8CxB;;OAEG;IACH,OAAO,CAAC,cAAc;IAmCtB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IA+B1B;;OAEG;IACH,OAAO,CAAC,UAAU;IAwBlB;;OAEG;IACH,OAAO,CAAC,eAAe;IASvB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAuBxB;;OAEG;IACH,OAAO,CAAC,YAAY;IAkBpB;;OAEG;IACH,OAAO,CAAC,iBAAiB;CAc1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/traffic/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,YAAY,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/weather/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,YAAY,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { PluginMetadata, PluginFetchOptions, PluginFetchResult } from '../../types';
|
|
2
|
+
import { BasePlugin, BasePluginConfig } from '../base-plugin';
|
|
3
|
+
/**
|
|
4
|
+
* NWS Weather plugin configuration.
|
|
5
|
+
*/
|
|
6
|
+
export interface NWSWeatherPluginConfig extends BasePluginConfig {
|
|
7
|
+
/** Only include actual alerts (not tests/exercises). Default: true */
|
|
8
|
+
actualOnly?: boolean;
|
|
9
|
+
/** Filter by alert status. Default: ['Actual'] */
|
|
10
|
+
status?: ('Actual' | 'Exercise' | 'System' | 'Test' | 'Draft')[];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Plugin that fetches weather alerts from the National Weather Service API.
|
|
14
|
+
*
|
|
15
|
+
* This is a global plugin that covers all US locations.
|
|
16
|
+
* The NWS API is free and requires no API key.
|
|
17
|
+
*
|
|
18
|
+
* @see https://www.weather.gov/documentation/services-web-api
|
|
19
|
+
*/
|
|
20
|
+
export declare class NWSWeatherPlugin extends BasePlugin {
|
|
21
|
+
readonly metadata: PluginMetadata;
|
|
22
|
+
private nwsConfig;
|
|
23
|
+
constructor(config?: NWSWeatherPluginConfig);
|
|
24
|
+
fetchAlerts(options: PluginFetchOptions): Promise<PluginFetchResult>;
|
|
25
|
+
/**
|
|
26
|
+
* Transform NWS alert features to our Alert format.
|
|
27
|
+
*/
|
|
28
|
+
private transformAlerts;
|
|
29
|
+
/**
|
|
30
|
+
* Check if an alert should be included based on config.
|
|
31
|
+
*/
|
|
32
|
+
private shouldIncludeAlert;
|
|
33
|
+
/**
|
|
34
|
+
* Transform a single NWS alert to our format.
|
|
35
|
+
*/
|
|
36
|
+
private transformAlert;
|
|
37
|
+
/**
|
|
38
|
+
* Extract location from feature geometry.
|
|
39
|
+
*/
|
|
40
|
+
private extractLocation;
|
|
41
|
+
/**
|
|
42
|
+
* Map NWS severity to our risk level.
|
|
43
|
+
*/
|
|
44
|
+
private mapSeverityToRiskLevel;
|
|
45
|
+
/**
|
|
46
|
+
* Build a description from NWS properties.
|
|
47
|
+
*/
|
|
48
|
+
private buildDescription;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=nws-weather.plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nws-weather.plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/weather/nws-weather.plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,EAAa,MAAM,aAAa,CAAC;AACpG,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAmD9D;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB;IAC9D,sEAAsE;IACtE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kDAAkD;IAClD,MAAM,CAAC,EAAE,CAAC,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC,EAAE,CAAC;CAClE;AAED;;;;;;;GAOG;AACH,qBAAa,gBAAiB,SAAQ,UAAU;IAC9C,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAY/B;IAEF,OAAO,CAAC,SAAS,CAAyB;gBAE9B,MAAM,CAAC,EAAE,sBAAsB;IASrC,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IA8B1E;;OAEG;IACH,OAAO,CAAC,eAAe;IASvB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAc1B;;OAEG;IACH,OAAO,CAAC,cAAc;IA+CtB;;OAEG;IACH,OAAO,CAAC,eAAe;IAmCvB;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAW9B;;OAEG;IACH,OAAO,CAAC,gBAAgB;CAazB"}
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Schema for geographic point coordinates.
|
|
4
|
+
*/
|
|
5
|
+
export declare const GeoPointSchema: z.ZodObject<{
|
|
6
|
+
latitude: z.ZodNumber;
|
|
7
|
+
longitude: z.ZodNumber;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
latitude: number;
|
|
10
|
+
longitude: number;
|
|
11
|
+
}, {
|
|
12
|
+
latitude: number;
|
|
13
|
+
longitude: number;
|
|
14
|
+
}>;
|
|
15
|
+
/**
|
|
16
|
+
* Schema for alert location.
|
|
17
|
+
*/
|
|
18
|
+
export declare const AlertLocationSchema: z.ZodObject<{
|
|
19
|
+
point: z.ZodObject<{
|
|
20
|
+
latitude: z.ZodNumber;
|
|
21
|
+
longitude: z.ZodNumber;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
latitude: number;
|
|
24
|
+
longitude: number;
|
|
25
|
+
}, {
|
|
26
|
+
latitude: number;
|
|
27
|
+
longitude: number;
|
|
28
|
+
}>;
|
|
29
|
+
radiusMeters: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
address: z.ZodOptional<z.ZodString>;
|
|
31
|
+
city: z.ZodOptional<z.ZodString>;
|
|
32
|
+
state: z.ZodOptional<z.ZodString>;
|
|
33
|
+
zipCode: z.ZodOptional<z.ZodString>;
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
point: {
|
|
36
|
+
latitude: number;
|
|
37
|
+
longitude: number;
|
|
38
|
+
};
|
|
39
|
+
radiusMeters?: number | undefined;
|
|
40
|
+
address?: string | undefined;
|
|
41
|
+
city?: string | undefined;
|
|
42
|
+
state?: string | undefined;
|
|
43
|
+
zipCode?: string | undefined;
|
|
44
|
+
}, {
|
|
45
|
+
point: {
|
|
46
|
+
latitude: number;
|
|
47
|
+
longitude: number;
|
|
48
|
+
};
|
|
49
|
+
radiusMeters?: number | undefined;
|
|
50
|
+
address?: string | undefined;
|
|
51
|
+
city?: string | undefined;
|
|
52
|
+
state?: string | undefined;
|
|
53
|
+
zipCode?: string | undefined;
|
|
54
|
+
}>;
|
|
55
|
+
/**
|
|
56
|
+
* Schema for risk levels.
|
|
57
|
+
*/
|
|
58
|
+
export declare const RiskLevelSchema: z.ZodEnum<["low", "moderate", "high", "severe", "extreme"]>;
|
|
59
|
+
/**
|
|
60
|
+
* Schema for alert priority (1-5, where 1 is highest).
|
|
61
|
+
*/
|
|
62
|
+
export declare const AlertPrioritySchema: z.ZodUnion<[z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>]>;
|
|
63
|
+
/**
|
|
64
|
+
* Schema for alert categories.
|
|
65
|
+
*/
|
|
66
|
+
export declare const AlertCategorySchema: z.ZodEnum<["crime", "fire", "medical", "weather", "traffic", "event", "civil-unrest", "other"]>;
|
|
67
|
+
/**
|
|
68
|
+
* Schema for temporal types.
|
|
69
|
+
*/
|
|
70
|
+
export declare const AlertTemporalTypeSchema: z.ZodEnum<["historical", "scheduled", "real-time"]>;
|
|
71
|
+
/**
|
|
72
|
+
* Schema for alert source types.
|
|
73
|
+
*/
|
|
74
|
+
export declare const AlertSourceTypeSchema: z.ZodEnum<["police", "fire", "weather", "events", "other"]>;
|
|
75
|
+
/**
|
|
76
|
+
* Schema for alert timestamps.
|
|
77
|
+
*/
|
|
78
|
+
export declare const AlertTimestampsSchema: z.ZodObject<{
|
|
79
|
+
issued: z.ZodString;
|
|
80
|
+
eventStart: z.ZodOptional<z.ZodString>;
|
|
81
|
+
eventEnd: z.ZodOptional<z.ZodString>;
|
|
82
|
+
expires: z.ZodOptional<z.ZodString>;
|
|
83
|
+
}, "strip", z.ZodTypeAny, {
|
|
84
|
+
issued: string;
|
|
85
|
+
eventStart?: string | undefined;
|
|
86
|
+
eventEnd?: string | undefined;
|
|
87
|
+
expires?: string | undefined;
|
|
88
|
+
}, {
|
|
89
|
+
issued: string;
|
|
90
|
+
eventStart?: string | undefined;
|
|
91
|
+
eventEnd?: string | undefined;
|
|
92
|
+
expires?: string | undefined;
|
|
93
|
+
}>;
|
|
94
|
+
/**
|
|
95
|
+
* Schema for alert source.
|
|
96
|
+
*/
|
|
97
|
+
export declare const AlertSourceSchema: z.ZodObject<{
|
|
98
|
+
pluginId: z.ZodString;
|
|
99
|
+
name: z.ZodString;
|
|
100
|
+
externalId: z.ZodOptional<z.ZodString>;
|
|
101
|
+
type: z.ZodEnum<["police", "fire", "weather", "events", "other"]>;
|
|
102
|
+
}, "strip", z.ZodTypeAny, {
|
|
103
|
+
type: "fire" | "weather" | "other" | "police" | "events";
|
|
104
|
+
pluginId: string;
|
|
105
|
+
name: string;
|
|
106
|
+
externalId?: string | undefined;
|
|
107
|
+
}, {
|
|
108
|
+
type: "fire" | "weather" | "other" | "police" | "events";
|
|
109
|
+
pluginId: string;
|
|
110
|
+
name: string;
|
|
111
|
+
externalId?: string | undefined;
|
|
112
|
+
}>;
|
|
113
|
+
/**
|
|
114
|
+
* Schema for a complete alert.
|
|
115
|
+
*/
|
|
116
|
+
export declare const AlertSchema: z.ZodObject<{
|
|
117
|
+
id: z.ZodString;
|
|
118
|
+
title: z.ZodString;
|
|
119
|
+
description: z.ZodString;
|
|
120
|
+
riskLevel: z.ZodEnum<["low", "moderate", "high", "severe", "extreme"]>;
|
|
121
|
+
priority: z.ZodUnion<[z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>]>;
|
|
122
|
+
category: z.ZodEnum<["crime", "fire", "medical", "weather", "traffic", "event", "civil-unrest", "other"]>;
|
|
123
|
+
temporalType: z.ZodEnum<["historical", "scheduled", "real-time"]>;
|
|
124
|
+
location: z.ZodObject<{
|
|
125
|
+
point: z.ZodObject<{
|
|
126
|
+
latitude: z.ZodNumber;
|
|
127
|
+
longitude: z.ZodNumber;
|
|
128
|
+
}, "strip", z.ZodTypeAny, {
|
|
129
|
+
latitude: number;
|
|
130
|
+
longitude: number;
|
|
131
|
+
}, {
|
|
132
|
+
latitude: number;
|
|
133
|
+
longitude: number;
|
|
134
|
+
}>;
|
|
135
|
+
radiusMeters: z.ZodOptional<z.ZodNumber>;
|
|
136
|
+
address: z.ZodOptional<z.ZodString>;
|
|
137
|
+
city: z.ZodOptional<z.ZodString>;
|
|
138
|
+
state: z.ZodOptional<z.ZodString>;
|
|
139
|
+
zipCode: z.ZodOptional<z.ZodString>;
|
|
140
|
+
}, "strip", z.ZodTypeAny, {
|
|
141
|
+
point: {
|
|
142
|
+
latitude: number;
|
|
143
|
+
longitude: number;
|
|
144
|
+
};
|
|
145
|
+
radiusMeters?: number | undefined;
|
|
146
|
+
address?: string | undefined;
|
|
147
|
+
city?: string | undefined;
|
|
148
|
+
state?: string | undefined;
|
|
149
|
+
zipCode?: string | undefined;
|
|
150
|
+
}, {
|
|
151
|
+
point: {
|
|
152
|
+
latitude: number;
|
|
153
|
+
longitude: number;
|
|
154
|
+
};
|
|
155
|
+
radiusMeters?: number | undefined;
|
|
156
|
+
address?: string | undefined;
|
|
157
|
+
city?: string | undefined;
|
|
158
|
+
state?: string | undefined;
|
|
159
|
+
zipCode?: string | undefined;
|
|
160
|
+
}>;
|
|
161
|
+
timestamps: z.ZodObject<{
|
|
162
|
+
issued: z.ZodString;
|
|
163
|
+
eventStart: z.ZodOptional<z.ZodString>;
|
|
164
|
+
eventEnd: z.ZodOptional<z.ZodString>;
|
|
165
|
+
expires: z.ZodOptional<z.ZodString>;
|
|
166
|
+
}, "strip", z.ZodTypeAny, {
|
|
167
|
+
issued: string;
|
|
168
|
+
eventStart?: string | undefined;
|
|
169
|
+
eventEnd?: string | undefined;
|
|
170
|
+
expires?: string | undefined;
|
|
171
|
+
}, {
|
|
172
|
+
issued: string;
|
|
173
|
+
eventStart?: string | undefined;
|
|
174
|
+
eventEnd?: string | undefined;
|
|
175
|
+
expires?: string | undefined;
|
|
176
|
+
}>;
|
|
177
|
+
source: z.ZodObject<{
|
|
178
|
+
pluginId: z.ZodString;
|
|
179
|
+
name: z.ZodString;
|
|
180
|
+
externalId: z.ZodOptional<z.ZodString>;
|
|
181
|
+
type: z.ZodEnum<["police", "fire", "weather", "events", "other"]>;
|
|
182
|
+
}, "strip", z.ZodTypeAny, {
|
|
183
|
+
type: "fire" | "weather" | "other" | "police" | "events";
|
|
184
|
+
pluginId: string;
|
|
185
|
+
name: string;
|
|
186
|
+
externalId?: string | undefined;
|
|
187
|
+
}, {
|
|
188
|
+
type: "fire" | "weather" | "other" | "police" | "events";
|
|
189
|
+
pluginId: string;
|
|
190
|
+
name: string;
|
|
191
|
+
externalId?: string | undefined;
|
|
192
|
+
}>;
|
|
193
|
+
url: z.ZodOptional<z.ZodString>;
|
|
194
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
195
|
+
}, "strip", z.ZodTypeAny, {
|
|
196
|
+
location: {
|
|
197
|
+
point: {
|
|
198
|
+
latitude: number;
|
|
199
|
+
longitude: number;
|
|
200
|
+
};
|
|
201
|
+
radiusMeters?: number | undefined;
|
|
202
|
+
address?: string | undefined;
|
|
203
|
+
city?: string | undefined;
|
|
204
|
+
state?: string | undefined;
|
|
205
|
+
zipCode?: string | undefined;
|
|
206
|
+
};
|
|
207
|
+
id: string;
|
|
208
|
+
title: string;
|
|
209
|
+
description: string;
|
|
210
|
+
riskLevel: "low" | "moderate" | "high" | "severe" | "extreme";
|
|
211
|
+
priority: 1 | 2 | 3 | 4 | 5;
|
|
212
|
+
category: "crime" | "fire" | "medical" | "weather" | "traffic" | "event" | "civil-unrest" | "other";
|
|
213
|
+
temporalType: "historical" | "scheduled" | "real-time";
|
|
214
|
+
timestamps: {
|
|
215
|
+
issued: string;
|
|
216
|
+
eventStart?: string | undefined;
|
|
217
|
+
eventEnd?: string | undefined;
|
|
218
|
+
expires?: string | undefined;
|
|
219
|
+
};
|
|
220
|
+
source: {
|
|
221
|
+
type: "fire" | "weather" | "other" | "police" | "events";
|
|
222
|
+
pluginId: string;
|
|
223
|
+
name: string;
|
|
224
|
+
externalId?: string | undefined;
|
|
225
|
+
};
|
|
226
|
+
url?: string | undefined;
|
|
227
|
+
metadata?: Record<string, unknown> | undefined;
|
|
228
|
+
}, {
|
|
229
|
+
location: {
|
|
230
|
+
point: {
|
|
231
|
+
latitude: number;
|
|
232
|
+
longitude: number;
|
|
233
|
+
};
|
|
234
|
+
radiusMeters?: number | undefined;
|
|
235
|
+
address?: string | undefined;
|
|
236
|
+
city?: string | undefined;
|
|
237
|
+
state?: string | undefined;
|
|
238
|
+
zipCode?: string | undefined;
|
|
239
|
+
};
|
|
240
|
+
id: string;
|
|
241
|
+
title: string;
|
|
242
|
+
description: string;
|
|
243
|
+
riskLevel: "low" | "moderate" | "high" | "severe" | "extreme";
|
|
244
|
+
priority: 1 | 2 | 3 | 4 | 5;
|
|
245
|
+
category: "crime" | "fire" | "medical" | "weather" | "traffic" | "event" | "civil-unrest" | "other";
|
|
246
|
+
temporalType: "historical" | "scheduled" | "real-time";
|
|
247
|
+
timestamps: {
|
|
248
|
+
issued: string;
|
|
249
|
+
eventStart?: string | undefined;
|
|
250
|
+
eventEnd?: string | undefined;
|
|
251
|
+
expires?: string | undefined;
|
|
252
|
+
};
|
|
253
|
+
source: {
|
|
254
|
+
type: "fire" | "weather" | "other" | "police" | "events";
|
|
255
|
+
pluginId: string;
|
|
256
|
+
name: string;
|
|
257
|
+
externalId?: string | undefined;
|
|
258
|
+
};
|
|
259
|
+
url?: string | undefined;
|
|
260
|
+
metadata?: Record<string, unknown> | undefined;
|
|
261
|
+
}>;
|
|
262
|
+
/**
|
|
263
|
+
* Type inferred from the AlertSchema.
|
|
264
|
+
*/
|
|
265
|
+
export type AlertSchemaType = z.infer<typeof AlertSchema>;
|
|
266
|
+
//# sourceMappingURL=alert.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert.schema.d.ts","sourceRoot":"","sources":["../../../src/schemas/alert.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;EAGzB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAO9B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe,6DAA2D,CAAC;AAExF;;GAEG;AACH,eAAO,MAAM,mBAAmB,mGAM9B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,mBAAmB,iGAS9B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,uBAAuB,qDAAmD,CAAC;AAExF;;GAEG;AACH,eAAO,MAAM,qBAAqB,6DAA2D,CAAC;AAE9F;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;EAKhC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;EAK5B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAatB,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { GeoPointSchema, AlertLocationSchema, RiskLevelSchema, AlertPrioritySchema, AlertCategorySchema, AlertTemporalTypeSchema, AlertSourceTypeSchema, AlertTimestampsSchema, AlertSourceSchema, AlertSchema, } from './alert.schema';
|
|
2
|
+
export type { AlertSchemaType } from './alert.schema';
|
|
3
|
+
export { TimeRangePresetSchema, TimeRangeSchema, TimeRangeInputSchema, AlertQuerySchema, AlertQueryRequestSchema, transformRequestToQuery, } from './query.schema';
|
|
4
|
+
export type { AlertQuerySchemaType } from './query.schema';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schemas/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,EACvB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,WAAW,GACZ,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGtD,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EACpB,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Schema for time range presets.
|
|
4
|
+
*/
|
|
5
|
+
export declare const TimeRangePresetSchema: z.ZodEnum<["past-24h", "past-7d", "past-30d", "next-4h", "next-12h", "next-24h", "next-7d"]>;
|
|
6
|
+
/**
|
|
7
|
+
* Schema for explicit time range.
|
|
8
|
+
*/
|
|
9
|
+
export declare const TimeRangeSchema: z.ZodObject<{
|
|
10
|
+
start: z.ZodString;
|
|
11
|
+
end: z.ZodString;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
start: string;
|
|
14
|
+
end: string;
|
|
15
|
+
}, {
|
|
16
|
+
start: string;
|
|
17
|
+
end: string;
|
|
18
|
+
}>;
|
|
19
|
+
/**
|
|
20
|
+
* Schema for time range input (preset or explicit).
|
|
21
|
+
*/
|
|
22
|
+
export declare const TimeRangeInputSchema: z.ZodUnion<[z.ZodEnum<["past-24h", "past-7d", "past-30d", "next-4h", "next-12h", "next-24h", "next-7d"]>, z.ZodObject<{
|
|
23
|
+
start: z.ZodString;
|
|
24
|
+
end: z.ZodString;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
start: string;
|
|
27
|
+
end: string;
|
|
28
|
+
}, {
|
|
29
|
+
start: string;
|
|
30
|
+
end: string;
|
|
31
|
+
}>]>;
|
|
32
|
+
/**
|
|
33
|
+
* Schema for alert query parameters.
|
|
34
|
+
*/
|
|
35
|
+
export declare const AlertQuerySchema: z.ZodObject<{
|
|
36
|
+
location: z.ZodObject<{
|
|
37
|
+
latitude: z.ZodNumber;
|
|
38
|
+
longitude: z.ZodNumber;
|
|
39
|
+
}, "strip", z.ZodTypeAny, {
|
|
40
|
+
latitude: number;
|
|
41
|
+
longitude: number;
|
|
42
|
+
}, {
|
|
43
|
+
latitude: number;
|
|
44
|
+
longitude: number;
|
|
45
|
+
}>;
|
|
46
|
+
radiusMeters: z.ZodDefault<z.ZodNumber>;
|
|
47
|
+
timeRange: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["past-24h", "past-7d", "past-30d", "next-4h", "next-12h", "next-24h", "next-7d"]>, z.ZodObject<{
|
|
48
|
+
start: z.ZodString;
|
|
49
|
+
end: z.ZodString;
|
|
50
|
+
}, "strip", z.ZodTypeAny, {
|
|
51
|
+
start: string;
|
|
52
|
+
end: string;
|
|
53
|
+
}, {
|
|
54
|
+
start: string;
|
|
55
|
+
end: string;
|
|
56
|
+
}>]>>;
|
|
57
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
58
|
+
minRiskLevel: z.ZodOptional<z.ZodEnum<["low", "moderate", "high", "severe", "extreme"]>>;
|
|
59
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodEnum<["crime", "fire", "medical", "weather", "traffic", "event", "civil-unrest", "other"]>, "many">>;
|
|
60
|
+
temporalTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<["historical", "scheduled", "real-time"]>, "many">>;
|
|
61
|
+
includePluginResults: z.ZodDefault<z.ZodBoolean>;
|
|
62
|
+
}, "strip", z.ZodTypeAny, {
|
|
63
|
+
location: {
|
|
64
|
+
latitude: number;
|
|
65
|
+
longitude: number;
|
|
66
|
+
};
|
|
67
|
+
radiusMeters: number;
|
|
68
|
+
limit: number;
|
|
69
|
+
includePluginResults: boolean;
|
|
70
|
+
categories?: ("crime" | "fire" | "medical" | "weather" | "traffic" | "event" | "civil-unrest" | "other")[] | undefined;
|
|
71
|
+
temporalTypes?: ("historical" | "scheduled" | "real-time")[] | undefined;
|
|
72
|
+
minRiskLevel?: "low" | "moderate" | "high" | "severe" | "extreme" | undefined;
|
|
73
|
+
timeRange?: "past-24h" | "past-7d" | "past-30d" | "next-4h" | "next-12h" | "next-24h" | "next-7d" | {
|
|
74
|
+
start: string;
|
|
75
|
+
end: string;
|
|
76
|
+
} | undefined;
|
|
77
|
+
}, {
|
|
78
|
+
location: {
|
|
79
|
+
latitude: number;
|
|
80
|
+
longitude: number;
|
|
81
|
+
};
|
|
82
|
+
categories?: ("crime" | "fire" | "medical" | "weather" | "traffic" | "event" | "civil-unrest" | "other")[] | undefined;
|
|
83
|
+
temporalTypes?: ("historical" | "scheduled" | "real-time")[] | undefined;
|
|
84
|
+
minRiskLevel?: "low" | "moderate" | "high" | "severe" | "extreme" | undefined;
|
|
85
|
+
timeRange?: "past-24h" | "past-7d" | "past-30d" | "next-4h" | "next-12h" | "next-24h" | "next-7d" | {
|
|
86
|
+
start: string;
|
|
87
|
+
end: string;
|
|
88
|
+
} | undefined;
|
|
89
|
+
radiusMeters?: number | undefined;
|
|
90
|
+
limit?: number | undefined;
|
|
91
|
+
includePluginResults?: boolean | undefined;
|
|
92
|
+
}>;
|
|
93
|
+
/**
|
|
94
|
+
* Type inferred from the AlertQuerySchema.
|
|
95
|
+
*/
|
|
96
|
+
export type AlertQuerySchemaType = z.infer<typeof AlertQuerySchema>;
|
|
97
|
+
/**
|
|
98
|
+
* Schema for validating incoming API request body.
|
|
99
|
+
*/
|
|
100
|
+
export declare const AlertQueryRequestSchema: z.ZodObject<{
|
|
101
|
+
latitude: z.ZodNumber;
|
|
102
|
+
longitude: z.ZodNumber;
|
|
103
|
+
radiusMeters: z.ZodOptional<z.ZodNumber>;
|
|
104
|
+
timeRange: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["past-24h", "past-7d", "past-30d", "next-4h", "next-12h", "next-24h", "next-7d"]>, z.ZodObject<{
|
|
105
|
+
start: z.ZodString;
|
|
106
|
+
end: z.ZodString;
|
|
107
|
+
}, "strip", z.ZodTypeAny, {
|
|
108
|
+
start: string;
|
|
109
|
+
end: string;
|
|
110
|
+
}, {
|
|
111
|
+
start: string;
|
|
112
|
+
end: string;
|
|
113
|
+
}>]>>;
|
|
114
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
115
|
+
minRiskLevel: z.ZodOptional<z.ZodEnum<["low", "moderate", "high", "severe", "extreme"]>>;
|
|
116
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodEnum<["crime", "fire", "medical", "weather", "traffic", "event", "civil-unrest", "other"]>, "many">>;
|
|
117
|
+
temporalTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<["historical", "scheduled", "real-time"]>, "many">>;
|
|
118
|
+
includePluginResults: z.ZodOptional<z.ZodBoolean>;
|
|
119
|
+
}, "strip", z.ZodTypeAny, {
|
|
120
|
+
latitude: number;
|
|
121
|
+
longitude: number;
|
|
122
|
+
categories?: ("crime" | "fire" | "medical" | "weather" | "traffic" | "event" | "civil-unrest" | "other")[] | undefined;
|
|
123
|
+
temporalTypes?: ("historical" | "scheduled" | "real-time")[] | undefined;
|
|
124
|
+
minRiskLevel?: "low" | "moderate" | "high" | "severe" | "extreme" | undefined;
|
|
125
|
+
timeRange?: "past-24h" | "past-7d" | "past-30d" | "next-4h" | "next-12h" | "next-24h" | "next-7d" | {
|
|
126
|
+
start: string;
|
|
127
|
+
end: string;
|
|
128
|
+
} | undefined;
|
|
129
|
+
radiusMeters?: number | undefined;
|
|
130
|
+
limit?: number | undefined;
|
|
131
|
+
includePluginResults?: boolean | undefined;
|
|
132
|
+
}, {
|
|
133
|
+
latitude: number;
|
|
134
|
+
longitude: number;
|
|
135
|
+
categories?: ("crime" | "fire" | "medical" | "weather" | "traffic" | "event" | "civil-unrest" | "other")[] | undefined;
|
|
136
|
+
temporalTypes?: ("historical" | "scheduled" | "real-time")[] | undefined;
|
|
137
|
+
minRiskLevel?: "low" | "moderate" | "high" | "severe" | "extreme" | undefined;
|
|
138
|
+
timeRange?: "past-24h" | "past-7d" | "past-30d" | "next-4h" | "next-12h" | "next-24h" | "next-7d" | {
|
|
139
|
+
start: string;
|
|
140
|
+
end: string;
|
|
141
|
+
} | undefined;
|
|
142
|
+
radiusMeters?: number | undefined;
|
|
143
|
+
limit?: number | undefined;
|
|
144
|
+
includePluginResults?: boolean | undefined;
|
|
145
|
+
}>;
|
|
146
|
+
/**
|
|
147
|
+
* Transform a request body into an AlertQuery.
|
|
148
|
+
*/
|
|
149
|
+
export declare function transformRequestToQuery(data: z.infer<typeof AlertQueryRequestSchema>): z.infer<typeof AlertQuerySchema>;
|
|
150
|
+
//# sourceMappingURL=query.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.schema.d.ts","sourceRoot":"","sources":["../../../src/schemas/query.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB;;GAEG;AACH,eAAO,MAAM,qBAAqB,8FAQhC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;EAG1B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;IAAoD,CAAC;AAEtF;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAS3B,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUlC,CAAC;AAEH;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,GAC5C,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAclC"}
|