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,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FetchError = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Error thrown when an HTTP fetch operation fails.
|
|
6
|
+
*/
|
|
7
|
+
class FetchError extends Error {
|
|
8
|
+
code = 'FETCH_ERROR';
|
|
9
|
+
url;
|
|
10
|
+
statusCode;
|
|
11
|
+
statusText;
|
|
12
|
+
cause;
|
|
13
|
+
constructor(message, url, options) {
|
|
14
|
+
super(message);
|
|
15
|
+
this.name = 'FetchError';
|
|
16
|
+
this.url = url;
|
|
17
|
+
this.statusCode = options?.statusCode;
|
|
18
|
+
this.statusText = options?.statusText;
|
|
19
|
+
this.cause = options?.cause;
|
|
20
|
+
Object.setPrototypeOf(this, FetchError.prototype);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Create a FetchError from a failed Response object.
|
|
24
|
+
*/
|
|
25
|
+
static fromResponse(url, response) {
|
|
26
|
+
return new FetchError(`HTTP ${response.status}: ${response.statusText}`, url, {
|
|
27
|
+
statusCode: response.status,
|
|
28
|
+
statusText: response.statusText,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Create a FetchError from a network error.
|
|
33
|
+
*/
|
|
34
|
+
static fromNetworkError(url, error) {
|
|
35
|
+
return new FetchError(`Network error: ${error.message}`, url, {
|
|
36
|
+
cause: error,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Check if this is a client error (4xx status code).
|
|
41
|
+
*/
|
|
42
|
+
isClientError() {
|
|
43
|
+
return this.statusCode !== undefined && this.statusCode >= 400 && this.statusCode < 500;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Check if this is a server error (5xx status code).
|
|
47
|
+
*/
|
|
48
|
+
isServerError() {
|
|
49
|
+
return this.statusCode !== undefined && this.statusCode >= 500;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Check if this error is retryable (network error or 5xx status).
|
|
53
|
+
*/
|
|
54
|
+
isRetryable() {
|
|
55
|
+
return this.statusCode === undefined || this.isServerError() || this.statusCode === 429;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Convert to a plain object for serialization.
|
|
59
|
+
*/
|
|
60
|
+
toJSON() {
|
|
61
|
+
return {
|
|
62
|
+
code: this.code,
|
|
63
|
+
message: this.message,
|
|
64
|
+
url: this.url,
|
|
65
|
+
statusCode: this.statusCode,
|
|
66
|
+
statusText: this.statusText,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.FetchError = FetchError;
|
|
71
|
+
//# sourceMappingURL=fetch-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3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C1F,CAAC;IAED;;OAEG;IACH,aAAa;QACX,OAAO,IAAI,CAAC,UAAU,KAAK,SAAS,IAAI,IAAI,CAAC,UAAU,IAAI,GAAG,CAAC;IACjE,CAAC;IAED;;OAEG;IACH,WAAW;QACT,OAAO,IAAI,CAAC,UAAU,KAAK,SAAS,IAAI,IAAI,CAAC,aAAa,EAAE,IAAI,IAAI,CAAC,UAAU,KAAK,GAAG,CAAC;IAC1F,CAAC;IAED;;OAEG;IACH,MAAM;QAOJ,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,UAAU,EAAE,IAAI,CAAC,UAAU;SAC5B,CAAC;IACJ,CAAC;CACF;AAnFD,gCAmFC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FetchError = exports.ValidationError = exports.PluginNotFoundError = exports.DuplicatePluginError = exports.PluginTimeoutError = exports.PluginFetchError = exports.PluginInitializationError = exports.PluginError = void 0;
|
|
4
|
+
var plugin_error_1 = require("./plugin-error");
|
|
5
|
+
Object.defineProperty(exports, "PluginError", { enumerable: true, get: function () { return plugin_error_1.PluginError; } });
|
|
6
|
+
Object.defineProperty(exports, "PluginInitializationError", { enumerable: true, get: function () { return plugin_error_1.PluginInitializationError; } });
|
|
7
|
+
Object.defineProperty(exports, "PluginFetchError", { enumerable: true, get: function () { return plugin_error_1.PluginFetchError; } });
|
|
8
|
+
Object.defineProperty(exports, "PluginTimeoutError", { enumerable: true, get: function () { return plugin_error_1.PluginTimeoutError; } });
|
|
9
|
+
Object.defineProperty(exports, "DuplicatePluginError", { enumerable: true, get: function () { return plugin_error_1.DuplicatePluginError; } });
|
|
10
|
+
Object.defineProperty(exports, "PluginNotFoundError", { enumerable: true, get: function () { return plugin_error_1.PluginNotFoundError; } });
|
|
11
|
+
var validation_error_1 = require("./validation-error");
|
|
12
|
+
Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return validation_error_1.ValidationError; } });
|
|
13
|
+
var fetch_error_1 = require("./fetch-error");
|
|
14
|
+
Object.defineProperty(exports, "FetchError", { enumerable: true, get: function () { return fetch_error_1.FetchError; } });
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/errors/index.ts"],"names":[],"mappings":";;;AAAA,+CAOwB;AANtB,2GAAA,WAAW,OAAA;AACX,yHAAA,yBAAyB,OAAA;AACzB,gHAAA,gBAAgB,OAAA;AAChB,kHAAA,kBAAkB,OAAA;AAClB,oHAAA,oBAAoB,OAAA;AACpB,mHAAA,mBAAmB,OAAA;AAGrB,uDAAqD;AAA5C,mHAAA,eAAe,OAAA;AAGxB,6CAA2C;AAAlC,yGAAA,UAAU,OAAA"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PluginNotFoundError = exports.DuplicatePluginError = exports.PluginTimeoutError = exports.PluginFetchError = exports.PluginInitializationError = exports.PluginError = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Base error class for plugin-related errors.
|
|
6
|
+
*/
|
|
7
|
+
class PluginError extends Error {
|
|
8
|
+
pluginId;
|
|
9
|
+
code;
|
|
10
|
+
constructor(message, pluginId, code = 'PLUGIN_ERROR') {
|
|
11
|
+
super(message);
|
|
12
|
+
this.name = 'PluginError';
|
|
13
|
+
this.pluginId = pluginId;
|
|
14
|
+
this.code = code;
|
|
15
|
+
Object.setPrototypeOf(this, PluginError.prototype);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.PluginError = PluginError;
|
|
19
|
+
/**
|
|
20
|
+
* Error thrown when a plugin fails to initialize.
|
|
21
|
+
*/
|
|
22
|
+
class PluginInitializationError extends PluginError {
|
|
23
|
+
cause;
|
|
24
|
+
constructor(pluginId, message, cause) {
|
|
25
|
+
super(`Plugin "${pluginId}" failed to initialize: ${message}`, pluginId, 'PLUGIN_INIT_ERROR');
|
|
26
|
+
this.name = 'PluginInitializationError';
|
|
27
|
+
this.cause = cause;
|
|
28
|
+
Object.setPrototypeOf(this, PluginInitializationError.prototype);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.PluginInitializationError = PluginInitializationError;
|
|
32
|
+
/**
|
|
33
|
+
* Error thrown when a plugin fetch operation fails.
|
|
34
|
+
*/
|
|
35
|
+
class PluginFetchError extends PluginError {
|
|
36
|
+
cause;
|
|
37
|
+
constructor(pluginId, message, cause) {
|
|
38
|
+
super(`Plugin "${pluginId}" fetch failed: ${message}`, pluginId, 'PLUGIN_FETCH_ERROR');
|
|
39
|
+
this.name = 'PluginFetchError';
|
|
40
|
+
this.cause = cause;
|
|
41
|
+
Object.setPrototypeOf(this, PluginFetchError.prototype);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.PluginFetchError = PluginFetchError;
|
|
45
|
+
/**
|
|
46
|
+
* Error thrown when a plugin operation times out.
|
|
47
|
+
*/
|
|
48
|
+
class PluginTimeoutError extends PluginError {
|
|
49
|
+
timeoutMs;
|
|
50
|
+
constructor(pluginId, timeoutMs) {
|
|
51
|
+
super(`Plugin "${pluginId}" timed out after ${timeoutMs}ms`, pluginId, 'PLUGIN_TIMEOUT_ERROR');
|
|
52
|
+
this.name = 'PluginTimeoutError';
|
|
53
|
+
this.timeoutMs = timeoutMs;
|
|
54
|
+
Object.setPrototypeOf(this, PluginTimeoutError.prototype);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.PluginTimeoutError = PluginTimeoutError;
|
|
58
|
+
/**
|
|
59
|
+
* Error thrown when trying to register a plugin with a duplicate ID.
|
|
60
|
+
*/
|
|
61
|
+
class DuplicatePluginError extends PluginError {
|
|
62
|
+
constructor(pluginId) {
|
|
63
|
+
super(`Plugin with ID "${pluginId}" is already registered`, pluginId, 'DUPLICATE_PLUGIN_ERROR');
|
|
64
|
+
this.name = 'DuplicatePluginError';
|
|
65
|
+
Object.setPrototypeOf(this, DuplicatePluginError.prototype);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.DuplicatePluginError = DuplicatePluginError;
|
|
69
|
+
/**
|
|
70
|
+
* Error thrown when a referenced plugin is not found.
|
|
71
|
+
*/
|
|
72
|
+
class PluginNotFoundError extends PluginError {
|
|
73
|
+
constructor(pluginId) {
|
|
74
|
+
super(`Plugin with ID "${pluginId}" not found`, pluginId, 'PLUGIN_NOT_FOUND_ERROR');
|
|
75
|
+
this.name = 'PluginNotFoundError';
|
|
76
|
+
Object.setPrototypeOf(this, PluginNotFoundError.prototype);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.PluginNotFoundError = PluginNotFoundError;
|
|
80
|
+
//# sourceMappingURL=plugin-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-error.js","sourceRoot":"","sources":["../../../src/errors/plugin-error.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,MAAa,WAAY,SAAQ,KAAK;IAC3B,QAAQ,CAAS;IACjB,IAAI,CAAS;IAEtB,YAAY,OAAe,EAAE,QAAgB,EAAE,IAAI,GAAG,cAAc;QAClE,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;QAC1B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACrD,CAAC;CACF;AAXD,kCAWC;AAED;;GAEG;AACH,MAAa,yBAA0B,SAAQ,WAAW;IAC/C,KAAK,CAAS;IA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AC,CAAC;QAChG,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;QACnC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,oBAAoB,CAAC,SAAS,CAAC,CAAC;IAC9D,CAAC;CACF;AAND,oDAMC;AAED;;GAEG;AACH,MAAa,mBAAoB,SAAQ,WAAW;IAClD,YAAY,QAAgB;QAC1B,KAAK,CAAC,mBAAmB,QAAQ,aAAa,EAAE,QAAQ,EAAE,wBAAwB,CAAC,CAAC;QACpF,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;QAClC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;IAC7D,CAAC;CACF;AAND,kDAMC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ValidationError = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Error thrown when input validation fails.
|
|
6
|
+
*/
|
|
7
|
+
class ValidationError extends Error {
|
|
8
|
+
code = 'VALIDATION_ERROR';
|
|
9
|
+
issues;
|
|
10
|
+
constructor(message, issues) {
|
|
11
|
+
super(message);
|
|
12
|
+
this.name = 'ValidationError';
|
|
13
|
+
this.issues = issues;
|
|
14
|
+
Object.setPrototypeOf(this, ValidationError.prototype);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Create a ValidationError from a Zod error.
|
|
18
|
+
*/
|
|
19
|
+
static fromZodError(error) {
|
|
20
|
+
const issues = error.issues.map((issue) => ({
|
|
21
|
+
path: issue.path.join('.'),
|
|
22
|
+
message: issue.message,
|
|
23
|
+
code: issue.code,
|
|
24
|
+
}));
|
|
25
|
+
const paths = issues.map((i) => i.path || 'value').join(', ');
|
|
26
|
+
const message = `Validation failed for: ${paths}`;
|
|
27
|
+
return new ValidationError(message, issues);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Get a formatted string representation of all issues.
|
|
31
|
+
*/
|
|
32
|
+
getFormattedIssues() {
|
|
33
|
+
return this.issues
|
|
34
|
+
.map((issue) => ` - ${issue.path || 'value'}: ${issue.message}`)
|
|
35
|
+
.join('\n');
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Convert to a plain object for serialization.
|
|
39
|
+
*/
|
|
40
|
+
toJSON() {
|
|
41
|
+
return {
|
|
42
|
+
code: this.code,
|
|
43
|
+
message: this.message,
|
|
44
|
+
issues: this.issues,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.ValidationError = ValidationError;
|
|
49
|
+
//# sourceMappingURL=validation-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation-error.js","sourceRoot":"","sources":["../../../src/errors/validation-error.ts"],"names":[],"mappings":";;;AAWA;;GAEG;AACH,MAAa,eAAgB,SAAQ,KAAK;IAC/B,IAAI,GAAG,kBAAkB,CAAC;IAC1B,MAAM,CAAoB;IAEnC,YAAY,OAAe,EAAE,MAAyB;QACpD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IACzD,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,YAAY,CAAC,KAAe;QACjC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAe,EAAE,EAAE,CAAC,CAAC;YACpD,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;YAC1B,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,IAAI,EAAE,KAAK,CAAC,IAAI;SACjB,CAAC,CAAC,CAAC;QAEJ,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9D,MAAM,OAAO,GAAG,0BAA0B,KAAK,EAAE,CAAC;QAElD,OAAO,IAAI,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC9C,CAAC;IAED;;OAEG;IACH,kBAAkB;QAChB,OAAO,IAAI,CAAC,MAAM;aACf,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,KAAK,CAAC,IAAI,IAAI,OAAO,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC;aAChE,IAAI,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;IAED;;OAEG;IACH,MAAM;QACJ,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC;IACJ,CAAC;CACF;AA9CD,0CA8CC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EARTH_RADIUS_METERS = void 0;
|
|
4
|
+
exports.toRadians = toRadians;
|
|
5
|
+
exports.toDegrees = toDegrees;
|
|
6
|
+
exports.haversineDistance = haversineDistance;
|
|
7
|
+
exports.calculateDistance = calculateDistance;
|
|
8
|
+
exports.calculateBearing = calculateBearing;
|
|
9
|
+
exports.destinationPoint = destinationPoint;
|
|
10
|
+
/**
|
|
11
|
+
* Earth's radius in meters (mean radius).
|
|
12
|
+
*/
|
|
13
|
+
exports.EARTH_RADIUS_METERS = 6_371_008.8;
|
|
14
|
+
/**
|
|
15
|
+
* Convert degrees to radians.
|
|
16
|
+
*/
|
|
17
|
+
function toRadians(degrees) {
|
|
18
|
+
return degrees * (Math.PI / 180);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Convert radians to degrees.
|
|
22
|
+
*/
|
|
23
|
+
function toDegrees(radians) {
|
|
24
|
+
return radians * (180 / Math.PI);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Calculate the Haversine distance between two geographic points.
|
|
28
|
+
*
|
|
29
|
+
* The Haversine formula calculates the great-circle distance between two points
|
|
30
|
+
* on a sphere given their latitudes and longitudes.
|
|
31
|
+
*
|
|
32
|
+
* @param point1 - First geographic point
|
|
33
|
+
* @param point2 - Second geographic point
|
|
34
|
+
* @returns Distance in meters
|
|
35
|
+
*/
|
|
36
|
+
function haversineDistance(point1, point2) {
|
|
37
|
+
const lat1 = toRadians(point1.latitude);
|
|
38
|
+
const lat2 = toRadians(point2.latitude);
|
|
39
|
+
const deltaLat = toRadians(point2.latitude - point1.latitude);
|
|
40
|
+
const deltaLon = toRadians(point2.longitude - point1.longitude);
|
|
41
|
+
const a = Math.sin(deltaLat / 2) * Math.sin(deltaLat / 2) +
|
|
42
|
+
Math.cos(lat1) * Math.cos(lat2) * Math.sin(deltaLon / 2) * Math.sin(deltaLon / 2);
|
|
43
|
+
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
|
44
|
+
return exports.EARTH_RADIUS_METERS * c;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Calculate distance between two points (alias for haversineDistance).
|
|
48
|
+
*
|
|
49
|
+
* @param point1 - First geographic point
|
|
50
|
+
* @param point2 - Second geographic point
|
|
51
|
+
* @returns Distance in meters
|
|
52
|
+
*/
|
|
53
|
+
function calculateDistance(point1, point2) {
|
|
54
|
+
return haversineDistance(point1, point2);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Calculate the bearing (direction) from one point to another.
|
|
58
|
+
*
|
|
59
|
+
* @param from - Starting point
|
|
60
|
+
* @param to - Ending point
|
|
61
|
+
* @returns Bearing in degrees (0-360, where 0 is north)
|
|
62
|
+
*/
|
|
63
|
+
function calculateBearing(from, to) {
|
|
64
|
+
const lat1 = toRadians(from.latitude);
|
|
65
|
+
const lat2 = toRadians(to.latitude);
|
|
66
|
+
const deltaLon = toRadians(to.longitude - from.longitude);
|
|
67
|
+
const y = Math.sin(deltaLon) * Math.cos(lat2);
|
|
68
|
+
const x = Math.cos(lat1) * Math.sin(lat2) - Math.sin(lat1) * Math.cos(lat2) * Math.cos(deltaLon);
|
|
69
|
+
const bearing = toDegrees(Math.atan2(y, x));
|
|
70
|
+
return (bearing + 360) % 360;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Calculate a destination point given a start point, bearing, and distance.
|
|
74
|
+
*
|
|
75
|
+
* @param start - Starting point
|
|
76
|
+
* @param bearingDegrees - Bearing in degrees (0-360)
|
|
77
|
+
* @param distanceMeters - Distance in meters
|
|
78
|
+
* @returns Destination point
|
|
79
|
+
*/
|
|
80
|
+
function destinationPoint(start, bearingDegrees, distanceMeters) {
|
|
81
|
+
const lat1 = toRadians(start.latitude);
|
|
82
|
+
const lon1 = toRadians(start.longitude);
|
|
83
|
+
const bearing = toRadians(bearingDegrees);
|
|
84
|
+
const angularDistance = distanceMeters / exports.EARTH_RADIUS_METERS;
|
|
85
|
+
const lat2 = Math.asin(Math.sin(lat1) * Math.cos(angularDistance) +
|
|
86
|
+
Math.cos(lat1) * Math.sin(angularDistance) * Math.cos(bearing));
|
|
87
|
+
const lon2 = lon1 +
|
|
88
|
+
Math.atan2(Math.sin(bearing) * Math.sin(angularDistance) * Math.cos(lat1), Math.cos(angularDistance) - Math.sin(lat1) * Math.sin(lat2));
|
|
89
|
+
return {
|
|
90
|
+
latitude: toDegrees(lat2),
|
|
91
|
+
longitude: toDegrees(lon2),
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=distance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"distance.js","sourceRoot":"","sources":["../../../src/geo/distance.ts"],"names":[],"mappings":";;;AAUA,8BAEC;AAKD,8BAEC;AAYD,8CAaC;A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C,cAAc,CAAC,CAAC;IAC1C,MAAM,eAAe,GAAG,cAAc,GAAG,2BAAmB,CAAC;IAE7D,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CACpB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC;QACxC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CACjE,CAAC;IAEF,MAAM,IAAI,GACR,IAAI;QACJ,IAAI,CAAC,KAAK,CACR,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAC9D,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAC5D,CAAC;IAEJ,OAAO;QACL,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC;QACzB,SAAS,EAAE,SAAS,CAAC,IAAI,CAAC;KAC3B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getBoundingBoxForRadius = exports.doCirclesOverlap = exports.isPointInBoundingBox = exports.isPointInCircle = exports.isPointInRadius = exports.destinationPoint = exports.calculateBearing = exports.calculateDistance = exports.haversineDistance = exports.toDegrees = exports.toRadians = exports.EARTH_RADIUS_METERS = void 0;
|
|
4
|
+
var distance_1 = require("./distance");
|
|
5
|
+
Object.defineProperty(exports, "EARTH_RADIUS_METERS", { enumerable: true, get: function () { return distance_1.EARTH_RADIUS_METERS; } });
|
|
6
|
+
Object.defineProperty(exports, "toRadians", { enumerable: true, get: function () { return distance_1.toRadians; } });
|
|
7
|
+
Object.defineProperty(exports, "toDegrees", { enumerable: true, get: function () { return distance_1.toDegrees; } });
|
|
8
|
+
Object.defineProperty(exports, "haversineDistance", { enumerable: true, get: function () { return distance_1.haversineDistance; } });
|
|
9
|
+
Object.defineProperty(exports, "calculateDistance", { enumerable: true, get: function () { return distance_1.calculateDistance; } });
|
|
10
|
+
Object.defineProperty(exports, "calculateBearing", { enumerable: true, get: function () { return distance_1.calculateBearing; } });
|
|
11
|
+
Object.defineProperty(exports, "destinationPoint", { enumerable: true, get: function () { return distance_1.destinationPoint; } });
|
|
12
|
+
var point_in_radius_1 = require("./point-in-radius");
|
|
13
|
+
Object.defineProperty(exports, "isPointInRadius", { enumerable: true, get: function () { return point_in_radius_1.isPointInRadius; } });
|
|
14
|
+
Object.defineProperty(exports, "isPointInCircle", { enumerable: true, get: function () { return point_in_radius_1.isPointInCircle; } });
|
|
15
|
+
Object.defineProperty(exports, "isPointInBoundingBox", { enumerable: true, get: function () { return point_in_radius_1.isPointInBoundingBox; } });
|
|
16
|
+
Object.defineProperty(exports, "doCirclesOverlap", { enumerable: true, get: function () { return point_in_radius_1.doCirclesOverlap; } });
|
|
17
|
+
Object.defineProperty(exports, "getBoundingBoxForRadius", { enumerable: true, get: function () { return point_in_radius_1.getBoundingBoxForRadius; } });
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/geo/index.ts"],"names":[],"mappings":";;;AAAA,uCAQoB;AAPlB,+GAAA,mBAAmB,OAAA;AACnB,qGAAA,SAAS,OAAA;AACT,qGAAA,SAAS,OAAA;AACT,6GAAA,iBAAiB,OAAA;AACjB,6GAAA,iBAAiB,OAAA;AACjB,4GAAA,gBAAgB,OAAA;AAChB,4GAAA,gBAAgB,OAAA;AAGlB,qDAM2B;AALzB,kHAAA,eAAe,OAAA;AACf,kHAAA,eAAe,OAAA;AACf,uHAAA,oBAAoB,OAAA;AACpB,mHAAA,gBAAgB,OAAA;AAChB,0HAAA,uBAAuB,OAAA"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isPointInRadius = isPointInRadius;
|
|
4
|
+
exports.isPointInCircle = isPointInCircle;
|
|
5
|
+
exports.isPointInBoundingBox = isPointInBoundingBox;
|
|
6
|
+
exports.doCirclesOverlap = doCirclesOverlap;
|
|
7
|
+
exports.getBoundingBoxForRadius = getBoundingBoxForRadius;
|
|
8
|
+
const distance_1 = require("./distance");
|
|
9
|
+
/**
|
|
10
|
+
* Check if a point is within a given radius of a center point.
|
|
11
|
+
*
|
|
12
|
+
* @param point - The point to check
|
|
13
|
+
* @param center - The center point
|
|
14
|
+
* @param radiusMeters - The radius in meters
|
|
15
|
+
* @returns true if the point is within the radius
|
|
16
|
+
*/
|
|
17
|
+
function isPointInRadius(point, center, radiusMeters) {
|
|
18
|
+
const distance = (0, distance_1.haversineDistance)(point, center);
|
|
19
|
+
return distance <= radiusMeters;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Check if a point is within a GeoCircle.
|
|
23
|
+
*
|
|
24
|
+
* @param point - The point to check
|
|
25
|
+
* @param circle - The circle definition
|
|
26
|
+
* @returns true if the point is within the circle
|
|
27
|
+
*/
|
|
28
|
+
function isPointInCircle(point, circle) {
|
|
29
|
+
return isPointInRadius(point, circle.center, circle.radiusMeters);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Check if a point is within a bounding box.
|
|
33
|
+
*
|
|
34
|
+
* @param point - The point to check
|
|
35
|
+
* @param box - The bounding box
|
|
36
|
+
* @returns true if the point is within the bounding box
|
|
37
|
+
*/
|
|
38
|
+
function isPointInBoundingBox(point, box) {
|
|
39
|
+
const { southwest, northeast } = box;
|
|
40
|
+
// Handle the case where the bounding box crosses the antimeridian
|
|
41
|
+
if (southwest.longitude > northeast.longitude) {
|
|
42
|
+
// Box crosses antimeridian
|
|
43
|
+
return (point.latitude >= southwest.latitude &&
|
|
44
|
+
point.latitude <= northeast.latitude &&
|
|
45
|
+
(point.longitude >= southwest.longitude || point.longitude <= northeast.longitude));
|
|
46
|
+
}
|
|
47
|
+
return (point.latitude >= southwest.latitude &&
|
|
48
|
+
point.latitude <= northeast.latitude &&
|
|
49
|
+
point.longitude >= southwest.longitude &&
|
|
50
|
+
point.longitude <= northeast.longitude);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Check if two circles overlap.
|
|
54
|
+
*
|
|
55
|
+
* @param circle1 - First circle
|
|
56
|
+
* @param circle2 - Second circle
|
|
57
|
+
* @returns true if the circles overlap
|
|
58
|
+
*/
|
|
59
|
+
function doCirclesOverlap(circle1, circle2) {
|
|
60
|
+
const distance = (0, distance_1.haversineDistance)(circle1.center, circle2.center);
|
|
61
|
+
return distance <= circle1.radiusMeters + circle2.radiusMeters;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Calculate a bounding box that contains a circle.
|
|
65
|
+
* This is useful for quick filtering before doing precise distance calculations.
|
|
66
|
+
*
|
|
67
|
+
* @param center - Center point of the circle
|
|
68
|
+
* @param radiusMeters - Radius in meters
|
|
69
|
+
* @returns A bounding box that contains the circle
|
|
70
|
+
*/
|
|
71
|
+
function getBoundingBoxForRadius(center, radiusMeters) {
|
|
72
|
+
// Approximate degrees per meter at the given latitude
|
|
73
|
+
const latDelta = radiusMeters / 111_320; // ~111.32km per degree latitude
|
|
74
|
+
const lonDelta = radiusMeters / (111_320 * Math.cos((center.latitude * Math.PI) / 180));
|
|
75
|
+
return {
|
|
76
|
+
southwest: {
|
|
77
|
+
latitude: Math.max(-90, center.latitude - latDelta),
|
|
78
|
+
longitude: center.longitude - lonDelta,
|
|
79
|
+
},
|
|
80
|
+
northeast: {
|
|
81
|
+
latitude: Math.min(90, center.latitude + latDelta),
|
|
82
|
+
longitude: center.longitude + lonDelta,
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=point-in-radius.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"point-in-radius.js","sourceRoot":"","sources":["../../../src/geo/point-in-radius.ts"],"names":[],"mappings":";;AAWA,0CAGC;AASD,0CAEC;AASD,oDAmBC;AASD,4CAGC;AAUD,0DAeC;AAzFD,yCAA+C;AAE/C;;;;;;;GAOG;AACH,SAAgB,eAAe,CAAC,KAAe,EAAE,MAAgB,EAAE,YAAoB;IACrF,MAAM,QAAQ,GAAG,IAAA,4BAAiB,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAClD,OAAO,QAAQ,IAAI,YAAY,CAAC;AAClC,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,eAAe,CAAC,KAAe,EAAE,MAAiB;IAChE,OAAO,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;AACpE,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,oBAAoB,CAAC,KAAe,EAAE,GAAmB;IACvE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,GAAG,CAAC;IAErC,kEAAkE;IAClE,IAAI,SAAS,CAAC,SAAS,GAAG,SAAS,CAAC,SAAS,EAAE,CAAC;QAC9C,2BAA2B;QAC3B,OAAO,CACL,KAAK,CAAC,QAAQ,IAAI,SAAS,CAAC,QAAQ;YACpC,KAAK,CAAC,QAAQ,IAAI,SAAS,CAAC,QAAQ;YACpC,CAAC,KAAK,CAAC,SAAS,IAAI,SAAS,CAAC,SAAS,IAAI,KAAK,CAAC,SAAS,IAAI,SAAS,CAAC,SAAS,CAAC,CACnF,CAAC;IACJ,CAAC;IAED,OAAO,CACL,KAAK,CAAC,QAAQ,IAAI,SAAS,CAAC,QAAQ;QACpC,KAAK,CAAC,QAAQ,IAAI,SAAS,CAAC,QAAQ;QACpC,KAAK,CAAC,SAAS,IAAI,SAAS,CAAC,SAAS;QACtC,KAAK,CAAC,SAAS,IAAI,SAAS,CAAC,SAAS,CACvC,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,gBAAgB,CAAC,OAAkB,EAAE,OAAkB;IACrE,MAAM,QAAQ,GAAG,IAAA,4BAAiB,EAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACnE,OAAO,QAAQ,IAAI,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;AACjE,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,uBAAuB,CAAC,MAAgB,EAAE,YAAoB;IAC5E,sDAAsD;IACtD,MAAM,QAAQ,GAAG,YAAY,GAAG,OAAO,CAAC,CAAC,gCAAgC;IACzE,MAAM,QAAQ,GAAG,YAAY,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;IAExF,OAAO;QACL,SAAS,EAAE;YACT,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;YACnD,SAAS,EAAE,MAAM,CAAC,SAAS,GAAG,QAAQ;SACvC;QACD,SAAS,EAAE;YACT,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;YAClD,SAAS,EAAE,MAAM,CAAC,SAAS,GAAG,QAAQ;SACvC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PhoenixFirePlugin = exports.PhoenixPolicePlugin = exports.NWSWeatherPlugin = exports.BasePlugin = exports.TimeoutError = exports.sleep = exports.withTimeout = exports.withRetry = exports.generateCacheKey = exports.DynamoDBCacheProvider = exports.VercelKVCacheProvider = exports.InMemoryCacheProvider = exports.getBoundingBoxForRadius = exports.doCirclesOverlap = exports.isPointInBoundingBox = exports.isPointInCircle = exports.isPointInRadius = exports.destinationPoint = exports.calculateBearing = exports.calculateDistance = exports.haversineDistance = exports.FetchError = exports.ValidationError = exports.PluginNotFoundError = exports.DuplicatePluginError = exports.PluginTimeoutError = exports.PluginFetchError = exports.PluginInitializationError = exports.PluginError = exports.transformRequestToQuery = exports.TimeRangeSchema = exports.GeoPointSchema = exports.AlertQueryRequestSchema = exports.AlertQuerySchema = exports.AlertSchema = exports.DEFAULT_CONFIG = exports.MAX_QUERY_LIMIT = exports.DEFAULT_QUERY_LIMIT = exports.DEFAULT_QUERY_RADIUS_METERS = exports.TIME_RANGE_PRESETS = exports.ALERT_TEMPORAL_TYPES = exports.ALERT_CATEGORIES = exports.RISK_LEVELS = exports.RISK_LEVEL_VALUES = exports.normalizeTimeRange = exports.resolveTimeRange = exports.AlertAggregator = exports.PluginResolver = exports.PluginRegistry = exports.AlertFeed = void 0;
|
|
4
|
+
exports.toCSV = exports.parseCSV = exports.AirNowPlugin = exports.ArizonaTrafficPlugin = exports.PhoenixEventsPlugin = exports.PulsepointPlugin = void 0;
|
|
5
|
+
// Main AlertFeed class
|
|
6
|
+
var core_1 = require("./core");
|
|
7
|
+
Object.defineProperty(exports, "AlertFeed", { enumerable: true, get: function () { return core_1.AlertFeed; } });
|
|
8
|
+
// Core components
|
|
9
|
+
var core_2 = require("./core");
|
|
10
|
+
Object.defineProperty(exports, "PluginRegistry", { enumerable: true, get: function () { return core_2.PluginRegistry; } });
|
|
11
|
+
Object.defineProperty(exports, "PluginResolver", { enumerable: true, get: function () { return core_2.PluginResolver; } });
|
|
12
|
+
Object.defineProperty(exports, "AlertAggregator", { enumerable: true, get: function () { return core_2.AlertAggregator; } });
|
|
13
|
+
var core_3 = require("./core");
|
|
14
|
+
Object.defineProperty(exports, "resolveTimeRange", { enumerable: true, get: function () { return core_3.resolveTimeRange; } });
|
|
15
|
+
Object.defineProperty(exports, "normalizeTimeRange", { enumerable: true, get: function () { return core_3.normalizeTimeRange; } });
|
|
16
|
+
// Type constants
|
|
17
|
+
var types_1 = require("./types");
|
|
18
|
+
Object.defineProperty(exports, "RISK_LEVEL_VALUES", { enumerable: true, get: function () { return types_1.RISK_LEVEL_VALUES; } });
|
|
19
|
+
Object.defineProperty(exports, "RISK_LEVELS", { enumerable: true, get: function () { return types_1.RISK_LEVELS; } });
|
|
20
|
+
Object.defineProperty(exports, "ALERT_CATEGORIES", { enumerable: true, get: function () { return types_1.ALERT_CATEGORIES; } });
|
|
21
|
+
Object.defineProperty(exports, "ALERT_TEMPORAL_TYPES", { enumerable: true, get: function () { return types_1.ALERT_TEMPORAL_TYPES; } });
|
|
22
|
+
Object.defineProperty(exports, "TIME_RANGE_PRESETS", { enumerable: true, get: function () { return types_1.TIME_RANGE_PRESETS; } });
|
|
23
|
+
Object.defineProperty(exports, "DEFAULT_QUERY_RADIUS_METERS", { enumerable: true, get: function () { return types_1.DEFAULT_QUERY_RADIUS_METERS; } });
|
|
24
|
+
Object.defineProperty(exports, "DEFAULT_QUERY_LIMIT", { enumerable: true, get: function () { return types_1.DEFAULT_QUERY_LIMIT; } });
|
|
25
|
+
Object.defineProperty(exports, "MAX_QUERY_LIMIT", { enumerable: true, get: function () { return types_1.MAX_QUERY_LIMIT; } });
|
|
26
|
+
Object.defineProperty(exports, "DEFAULT_CONFIG", { enumerable: true, get: function () { return types_1.DEFAULT_CONFIG; } });
|
|
27
|
+
// Schemas
|
|
28
|
+
var schemas_1 = require("./schemas");
|
|
29
|
+
Object.defineProperty(exports, "AlertSchema", { enumerable: true, get: function () { return schemas_1.AlertSchema; } });
|
|
30
|
+
Object.defineProperty(exports, "AlertQuerySchema", { enumerable: true, get: function () { return schemas_1.AlertQuerySchema; } });
|
|
31
|
+
Object.defineProperty(exports, "AlertQueryRequestSchema", { enumerable: true, get: function () { return schemas_1.AlertQueryRequestSchema; } });
|
|
32
|
+
Object.defineProperty(exports, "GeoPointSchema", { enumerable: true, get: function () { return schemas_1.GeoPointSchema; } });
|
|
33
|
+
Object.defineProperty(exports, "TimeRangeSchema", { enumerable: true, get: function () { return schemas_1.TimeRangeSchema; } });
|
|
34
|
+
Object.defineProperty(exports, "transformRequestToQuery", { enumerable: true, get: function () { return schemas_1.transformRequestToQuery; } });
|
|
35
|
+
// Errors
|
|
36
|
+
var errors_1 = require("./errors");
|
|
37
|
+
Object.defineProperty(exports, "PluginError", { enumerable: true, get: function () { return errors_1.PluginError; } });
|
|
38
|
+
Object.defineProperty(exports, "PluginInitializationError", { enumerable: true, get: function () { return errors_1.PluginInitializationError; } });
|
|
39
|
+
Object.defineProperty(exports, "PluginFetchError", { enumerable: true, get: function () { return errors_1.PluginFetchError; } });
|
|
40
|
+
Object.defineProperty(exports, "PluginTimeoutError", { enumerable: true, get: function () { return errors_1.PluginTimeoutError; } });
|
|
41
|
+
Object.defineProperty(exports, "DuplicatePluginError", { enumerable: true, get: function () { return errors_1.DuplicatePluginError; } });
|
|
42
|
+
Object.defineProperty(exports, "PluginNotFoundError", { enumerable: true, get: function () { return errors_1.PluginNotFoundError; } });
|
|
43
|
+
Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return errors_1.ValidationError; } });
|
|
44
|
+
Object.defineProperty(exports, "FetchError", { enumerable: true, get: function () { return errors_1.FetchError; } });
|
|
45
|
+
// Geo utilities
|
|
46
|
+
var geo_1 = require("./geo");
|
|
47
|
+
Object.defineProperty(exports, "haversineDistance", { enumerable: true, get: function () { return geo_1.haversineDistance; } });
|
|
48
|
+
Object.defineProperty(exports, "calculateDistance", { enumerable: true, get: function () { return geo_1.calculateDistance; } });
|
|
49
|
+
Object.defineProperty(exports, "calculateBearing", { enumerable: true, get: function () { return geo_1.calculateBearing; } });
|
|
50
|
+
Object.defineProperty(exports, "destinationPoint", { enumerable: true, get: function () { return geo_1.destinationPoint; } });
|
|
51
|
+
Object.defineProperty(exports, "isPointInRadius", { enumerable: true, get: function () { return geo_1.isPointInRadius; } });
|
|
52
|
+
Object.defineProperty(exports, "isPointInCircle", { enumerable: true, get: function () { return geo_1.isPointInCircle; } });
|
|
53
|
+
Object.defineProperty(exports, "isPointInBoundingBox", { enumerable: true, get: function () { return geo_1.isPointInBoundingBox; } });
|
|
54
|
+
Object.defineProperty(exports, "doCirclesOverlap", { enumerable: true, get: function () { return geo_1.doCirclesOverlap; } });
|
|
55
|
+
Object.defineProperty(exports, "getBoundingBoxForRadius", { enumerable: true, get: function () { return geo_1.getBoundingBoxForRadius; } });
|
|
56
|
+
// Cache providers
|
|
57
|
+
var utils_1 = require("./utils");
|
|
58
|
+
Object.defineProperty(exports, "InMemoryCacheProvider", { enumerable: true, get: function () { return utils_1.InMemoryCacheProvider; } });
|
|
59
|
+
Object.defineProperty(exports, "VercelKVCacheProvider", { enumerable: true, get: function () { return utils_1.VercelKVCacheProvider; } });
|
|
60
|
+
Object.defineProperty(exports, "DynamoDBCacheProvider", { enumerable: true, get: function () { return utils_1.DynamoDBCacheProvider; } });
|
|
61
|
+
Object.defineProperty(exports, "generateCacheKey", { enumerable: true, get: function () { return utils_1.generateCacheKey; } });
|
|
62
|
+
// Utility functions
|
|
63
|
+
var utils_2 = require("./utils");
|
|
64
|
+
Object.defineProperty(exports, "withRetry", { enumerable: true, get: function () { return utils_2.withRetry; } });
|
|
65
|
+
Object.defineProperty(exports, "withTimeout", { enumerable: true, get: function () { return utils_2.withTimeout; } });
|
|
66
|
+
Object.defineProperty(exports, "sleep", { enumerable: true, get: function () { return utils_2.sleep; } });
|
|
67
|
+
Object.defineProperty(exports, "TimeoutError", { enumerable: true, get: function () { return utils_2.TimeoutError; } });
|
|
68
|
+
// Base plugin for building custom plugins
|
|
69
|
+
var plugins_1 = require("./plugins");
|
|
70
|
+
Object.defineProperty(exports, "BasePlugin", { enumerable: true, get: function () { return plugins_1.BasePlugin; } });
|
|
71
|
+
// Built-in plugins
|
|
72
|
+
var weather_1 = require("./plugins/weather");
|
|
73
|
+
Object.defineProperty(exports, "NWSWeatherPlugin", { enumerable: true, get: function () { return weather_1.NWSWeatherPlugin; } });
|
|
74
|
+
var police_blotter_1 = require("./plugins/police-blotter");
|
|
75
|
+
Object.defineProperty(exports, "PhoenixPolicePlugin", { enumerable: true, get: function () { return police_blotter_1.PhoenixPolicePlugin; } });
|
|
76
|
+
var fire_emt_1 = require("./plugins/fire-emt");
|
|
77
|
+
Object.defineProperty(exports, "PhoenixFirePlugin", { enumerable: true, get: function () { return fire_emt_1.PhoenixFirePlugin; } });
|
|
78
|
+
var pulsepoint_1 = require("./plugins/pulsepoint");
|
|
79
|
+
Object.defineProperty(exports, "PulsepointPlugin", { enumerable: true, get: function () { return pulsepoint_1.PulsepointPlugin; } });
|
|
80
|
+
var events_1 = require("./plugins/events");
|
|
81
|
+
Object.defineProperty(exports, "PhoenixEventsPlugin", { enumerable: true, get: function () { return events_1.PhoenixEventsPlugin; } });
|
|
82
|
+
var traffic_1 = require("./plugins/traffic");
|
|
83
|
+
Object.defineProperty(exports, "ArizonaTrafficPlugin", { enumerable: true, get: function () { return traffic_1.ArizonaTrafficPlugin; } });
|
|
84
|
+
var air_quality_1 = require("./plugins/air-quality");
|
|
85
|
+
Object.defineProperty(exports, "AirNowPlugin", { enumerable: true, get: function () { return air_quality_1.AirNowPlugin; } });
|
|
86
|
+
// CSV utilities (for custom plugins that need CSV parsing)
|
|
87
|
+
var utils_3 = require("./utils");
|
|
88
|
+
Object.defineProperty(exports, "parseCSV", { enumerable: true, get: function () { return utils_3.parseCSV; } });
|
|
89
|
+
Object.defineProperty(exports, "toCSV", { enumerable: true, get: function () { return utils_3.toCSV; } });
|
|
90
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,uBAAuB;AACvB,+BAAmC;AA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