@telemetryos/sdk 1.8.2 → 1.9.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/CHANGELOG.md +22 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +180 -113
- package/dist/react.cjs +8 -7
- package/dist/react.js +264 -260
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -314,7 +314,7 @@ var p;
|
|
|
314
314
|
(function(n) {
|
|
315
315
|
n.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, n.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
316
316
|
})(p || (p = {}));
|
|
317
|
-
let
|
|
317
|
+
let I = class {
|
|
318
318
|
constructor(e, t, s, a) {
|
|
319
319
|
this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = a;
|
|
320
320
|
}
|
|
@@ -494,7 +494,7 @@ let v = class {
|
|
|
494
494
|
};
|
|
495
495
|
}
|
|
496
496
|
optional() {
|
|
497
|
-
return
|
|
497
|
+
return E.create(this, this._def);
|
|
498
498
|
}
|
|
499
499
|
nullable() {
|
|
500
500
|
return V.create(this, this._def);
|
|
@@ -1466,7 +1466,7 @@ Ze.create = (n) => new Ze({
|
|
|
1466
1466
|
typeName: m.ZodUnknown,
|
|
1467
1467
|
...y(n)
|
|
1468
1468
|
});
|
|
1469
|
-
let
|
|
1469
|
+
let $ = class extends v {
|
|
1470
1470
|
_parse(e) {
|
|
1471
1471
|
const t = this._getOrReturnCtx(e);
|
|
1472
1472
|
return u(t, {
|
|
@@ -1476,7 +1476,7 @@ let E = class extends v {
|
|
|
1476
1476
|
}), g;
|
|
1477
1477
|
}
|
|
1478
1478
|
};
|
|
1479
|
-
|
|
1479
|
+
$.create = (n) => new $({
|
|
1480
1480
|
typeName: m.ZodNever,
|
|
1481
1481
|
...y(n)
|
|
1482
1482
|
});
|
|
@@ -1533,8 +1533,8 @@ let q = class Y extends v {
|
|
|
1533
1533
|
exact: !1,
|
|
1534
1534
|
message: a.maxLength.message
|
|
1535
1535
|
}), s.dirty()), t.common.async)
|
|
1536
|
-
return Promise.all([...t.data].map((r, o) => a.type._parseAsync(new
|
|
1537
|
-
const i = [...t.data].map((r, o) => a.type._parseSync(new
|
|
1536
|
+
return Promise.all([...t.data].map((r, o) => a.type._parseAsync(new I(t, r, t.path, o)))).then((r) => N.mergeArray(s, r));
|
|
1537
|
+
const i = [...t.data].map((r, o) => a.type._parseSync(new I(t, r, t.path, o)));
|
|
1538
1538
|
return N.mergeArray(s, i);
|
|
1539
1539
|
}
|
|
1540
1540
|
get element() {
|
|
@@ -1575,7 +1575,7 @@ function M(n) {
|
|
|
1575
1575
|
const e = {};
|
|
1576
1576
|
for (const t in n.shape) {
|
|
1577
1577
|
const s = n.shape[t];
|
|
1578
|
-
e[t] =
|
|
1578
|
+
e[t] = E.create(M(s));
|
|
1579
1579
|
}
|
|
1580
1580
|
return new T({
|
|
1581
1581
|
...n._def,
|
|
@@ -1584,7 +1584,7 @@ function M(n) {
|
|
|
1584
1584
|
} else return n instanceof q ? new q({
|
|
1585
1585
|
...n._def,
|
|
1586
1586
|
type: M(n.element)
|
|
1587
|
-
}) : n instanceof
|
|
1587
|
+
}) : n instanceof E ? E.create(M(n.unwrap())) : n instanceof V ? V.create(M(n.unwrap())) : n instanceof R ? R.create(n.items.map((e) => M(e))) : n;
|
|
1588
1588
|
}
|
|
1589
1589
|
let T = class S extends v {
|
|
1590
1590
|
constructor() {
|
|
@@ -1606,7 +1606,7 @@ let T = class S extends v {
|
|
|
1606
1606
|
}), g;
|
|
1607
1607
|
}
|
|
1608
1608
|
const { status: t, ctx: s } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), r = [];
|
|
1609
|
-
if (!(this._def.catchall instanceof
|
|
1609
|
+
if (!(this._def.catchall instanceof $ && this._def.unknownKeys === "strip"))
|
|
1610
1610
|
for (const c in s.data)
|
|
1611
1611
|
i.includes(c) || r.push(c);
|
|
1612
1612
|
const o = [];
|
|
@@ -1614,11 +1614,11 @@ let T = class S extends v {
|
|
|
1614
1614
|
const h = a[c], _ = s.data[c];
|
|
1615
1615
|
o.push({
|
|
1616
1616
|
key: { status: "valid", value: c },
|
|
1617
|
-
value: h._parse(new
|
|
1617
|
+
value: h._parse(new I(s, _, s.path, c)),
|
|
1618
1618
|
alwaysSet: c in s.data
|
|
1619
1619
|
});
|
|
1620
1620
|
}
|
|
1621
|
-
if (this._def.catchall instanceof
|
|
1621
|
+
if (this._def.catchall instanceof $) {
|
|
1622
1622
|
const c = this._def.unknownKeys;
|
|
1623
1623
|
if (c === "passthrough")
|
|
1624
1624
|
for (const h of r)
|
|
@@ -1639,7 +1639,7 @@ let T = class S extends v {
|
|
|
1639
1639
|
o.push({
|
|
1640
1640
|
key: { status: "valid", value: h },
|
|
1641
1641
|
value: c._parse(
|
|
1642
|
-
new
|
|
1642
|
+
new I(s, _, s.path, h)
|
|
1643
1643
|
//, ctx.child(key), value, getParsedType(value)
|
|
1644
1644
|
),
|
|
1645
1645
|
alwaysSet: h in s.data
|
|
@@ -1840,7 +1840,7 @@ let T = class S extends v {
|
|
|
1840
1840
|
t[s] = this.shape[s];
|
|
1841
1841
|
else {
|
|
1842
1842
|
let a = this.shape[s];
|
|
1843
|
-
for (; a instanceof
|
|
1843
|
+
for (; a instanceof E; )
|
|
1844
1844
|
a = a._def.innerType;
|
|
1845
1845
|
t[s] = a;
|
|
1846
1846
|
}
|
|
@@ -1856,21 +1856,21 @@ let T = class S extends v {
|
|
|
1856
1856
|
T.create = (n, e) => new T({
|
|
1857
1857
|
shape: () => n,
|
|
1858
1858
|
unknownKeys: "strip",
|
|
1859
|
-
catchall:
|
|
1859
|
+
catchall: $.create(),
|
|
1860
1860
|
typeName: m.ZodObject,
|
|
1861
1861
|
...y(e)
|
|
1862
1862
|
});
|
|
1863
1863
|
T.strictCreate = (n, e) => new T({
|
|
1864
1864
|
shape: () => n,
|
|
1865
1865
|
unknownKeys: "strict",
|
|
1866
|
-
catchall:
|
|
1866
|
+
catchall: $.create(),
|
|
1867
1867
|
typeName: m.ZodObject,
|
|
1868
1868
|
...y(e)
|
|
1869
1869
|
});
|
|
1870
1870
|
T.lazycreate = (n, e) => new T({
|
|
1871
1871
|
shape: n,
|
|
1872
1872
|
unknownKeys: "strip",
|
|
1873
|
-
catchall:
|
|
1873
|
+
catchall: $.create(),
|
|
1874
1874
|
typeName: m.ZodObject,
|
|
1875
1875
|
...y(e)
|
|
1876
1876
|
});
|
|
@@ -2037,7 +2037,7 @@ class R extends v {
|
|
|
2037
2037
|
}), t.dirty());
|
|
2038
2038
|
const a = [...s.data].map((i, r) => {
|
|
2039
2039
|
const o = this._def.items[r] || this._def.rest;
|
|
2040
|
-
return o ? o._parse(new
|
|
2040
|
+
return o ? o._parse(new I(s, i, s.path, r)) : null;
|
|
2041
2041
|
}).filter((i) => !!i);
|
|
2042
2042
|
return s.common.async ? Promise.all(a).then((i) => N.mergeArray(t, i)) : N.mergeArray(t, a);
|
|
2043
2043
|
}
|
|
@@ -2077,8 +2077,8 @@ class Ae extends v {
|
|
|
2077
2077
|
received: s.parsedType
|
|
2078
2078
|
}), g;
|
|
2079
2079
|
const a = this._def.keyType, i = this._def.valueType, r = [...s.data.entries()].map(([o, c], h) => ({
|
|
2080
|
-
key: a._parse(new
|
|
2081
|
-
value: i._parse(new
|
|
2080
|
+
key: a._parse(new I(s, o, s.path, [h, "key"])),
|
|
2081
|
+
value: i._parse(new I(s, c, s.path, [h, "value"]))
|
|
2082
2082
|
}));
|
|
2083
2083
|
if (s.common.async) {
|
|
2084
2084
|
const o = /* @__PURE__ */ new Map();
|
|
@@ -2144,7 +2144,7 @@ class H extends v {
|
|
|
2144
2144
|
}
|
|
2145
2145
|
return { status: t.value, value: h };
|
|
2146
2146
|
}
|
|
2147
|
-
const o = [...s.data.values()].map((c, h) => i._parse(new
|
|
2147
|
+
const o = [...s.data.values()].map((c, h) => i._parse(new I(s, c, s.path, h)));
|
|
2148
2148
|
return s.common.async ? Promise.all(o).then((c) => r(c)) : r(o);
|
|
2149
2149
|
}
|
|
2150
2150
|
min(e, t) {
|
|
@@ -2173,7 +2173,7 @@ H.create = (n, e) => new H({
|
|
|
2173
2173
|
typeName: m.ZodSet,
|
|
2174
2174
|
...y(e)
|
|
2175
2175
|
});
|
|
2176
|
-
class
|
|
2176
|
+
class Ee extends v {
|
|
2177
2177
|
get schema() {
|
|
2178
2178
|
return this._def.getter();
|
|
2179
2179
|
}
|
|
@@ -2182,7 +2182,7 @@ class Ie extends v {
|
|
|
2182
2182
|
return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
|
|
2183
2183
|
}
|
|
2184
2184
|
}
|
|
2185
|
-
|
|
2185
|
+
Ee.create = (n, e) => new Ee({
|
|
2186
2186
|
getter: n,
|
|
2187
2187
|
typeName: m.ZodLazy,
|
|
2188
2188
|
...y(e)
|
|
@@ -2270,7 +2270,7 @@ let me = class le extends v {
|
|
|
2270
2270
|
}
|
|
2271
2271
|
};
|
|
2272
2272
|
me.create = Me;
|
|
2273
|
-
class
|
|
2273
|
+
class Ie extends v {
|
|
2274
2274
|
_parse(e) {
|
|
2275
2275
|
const t = b.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
|
|
2276
2276
|
if (s.parsedType !== l.string && s.parsedType !== l.number) {
|
|
@@ -2295,7 +2295,7 @@ class $e extends v {
|
|
|
2295
2295
|
return this._def.values;
|
|
2296
2296
|
}
|
|
2297
2297
|
}
|
|
2298
|
-
|
|
2298
|
+
Ie.create = (n, e) => new Ie({
|
|
2299
2299
|
values: n,
|
|
2300
2300
|
typeName: m.ZodNativeEnum,
|
|
2301
2301
|
...y(e)
|
|
@@ -2324,7 +2324,7 @@ te.create = (n, e) => new te({
|
|
|
2324
2324
|
typeName: m.ZodPromise,
|
|
2325
2325
|
...y(e)
|
|
2326
2326
|
});
|
|
2327
|
-
|
|
2327
|
+
class D extends v {
|
|
2328
2328
|
innerType() {
|
|
2329
2329
|
return this._def.schema;
|
|
2330
2330
|
}
|
|
@@ -2403,7 +2403,7 @@ let D = class extends v {
|
|
|
2403
2403
|
})) : g);
|
|
2404
2404
|
b.assertNever(a);
|
|
2405
2405
|
}
|
|
2406
|
-
}
|
|
2406
|
+
}
|
|
2407
2407
|
D.create = (n, e, t) => new D({
|
|
2408
2408
|
schema: n,
|
|
2409
2409
|
typeName: m.ZodEffects,
|
|
@@ -2416,7 +2416,7 @@ D.createWithPreprocess = (n, e, t) => new D({
|
|
|
2416
2416
|
typeName: m.ZodEffects,
|
|
2417
2417
|
...y(t)
|
|
2418
2418
|
});
|
|
2419
|
-
let
|
|
2419
|
+
let E = class extends v {
|
|
2420
2420
|
_parse(e) {
|
|
2421
2421
|
return this._getType(e) === l.undefined ? x(void 0) : this._def.innerType._parse(e);
|
|
2422
2422
|
}
|
|
@@ -2424,7 +2424,7 @@ let I = class extends v {
|
|
|
2424
2424
|
return this._def.innerType;
|
|
2425
2425
|
}
|
|
2426
2426
|
};
|
|
2427
|
-
|
|
2427
|
+
E.create = (n, e) => new E({
|
|
2428
2428
|
innerType: n,
|
|
2429
2429
|
typeName: m.ZodOptional,
|
|
2430
2430
|
...y(e)
|
|
@@ -2505,7 +2505,7 @@ pe.create = (n, e) => new pe({
|
|
|
2505
2505
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
2506
2506
|
...y(e)
|
|
2507
2507
|
});
|
|
2508
|
-
class
|
|
2508
|
+
class $e extends v {
|
|
2509
2509
|
_parse(e) {
|
|
2510
2510
|
if (this._getType(e) !== l.nan) {
|
|
2511
2511
|
const t = this._getOrReturnCtx(e);
|
|
@@ -2518,7 +2518,7 @@ class Ee extends v {
|
|
|
2518
2518
|
return { status: "valid", value: e.data };
|
|
2519
2519
|
}
|
|
2520
2520
|
}
|
|
2521
|
-
|
|
2521
|
+
$e.create = (n) => new $e({
|
|
2522
2522
|
typeName: m.ZodNaN,
|
|
2523
2523
|
...y(n)
|
|
2524
2524
|
});
|
|
@@ -2594,7 +2594,7 @@ var m;
|
|
|
2594
2594
|
n.ZodString = "ZodString", n.ZodNumber = "ZodNumber", n.ZodNaN = "ZodNaN", n.ZodBigInt = "ZodBigInt", n.ZodBoolean = "ZodBoolean", n.ZodDate = "ZodDate", n.ZodSymbol = "ZodSymbol", n.ZodUndefined = "ZodUndefined", n.ZodNull = "ZodNull", n.ZodAny = "ZodAny", n.ZodUnknown = "ZodUnknown", n.ZodNever = "ZodNever", n.ZodVoid = "ZodVoid", n.ZodArray = "ZodArray", n.ZodObject = "ZodObject", n.ZodUnion = "ZodUnion", n.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", n.ZodIntersection = "ZodIntersection", n.ZodTuple = "ZodTuple", n.ZodRecord = "ZodRecord", n.ZodMap = "ZodMap", n.ZodSet = "ZodSet", n.ZodFunction = "ZodFunction", n.ZodLazy = "ZodLazy", n.ZodLiteral = "ZodLiteral", n.ZodEnum = "ZodEnum", n.ZodEffects = "ZodEffects", n.ZodNativeEnum = "ZodNativeEnum", n.ZodOptional = "ZodOptional", n.ZodNullable = "ZodNullable", n.ZodDefault = "ZodDefault", n.ZodCatch = "ZodCatch", n.ZodPromise = "ZodPromise", n.ZodBranded = "ZodBranded", n.ZodPipeline = "ZodPipeline", n.ZodReadonly = "ZodReadonly";
|
|
2595
2595
|
})(m || (m = {}));
|
|
2596
2596
|
const lt = A.create, ht = ce.create;
|
|
2597
|
-
|
|
2597
|
+
$.create;
|
|
2598
2598
|
q.create;
|
|
2599
2599
|
const pt = T.create;
|
|
2600
2600
|
Q.create;
|
|
@@ -2603,9 +2603,9 @@ R.create;
|
|
|
2603
2603
|
const ft = ue.create;
|
|
2604
2604
|
me.create;
|
|
2605
2605
|
te.create;
|
|
2606
|
-
|
|
2606
|
+
E.create;
|
|
2607
2607
|
V.create;
|
|
2608
|
-
const mt = "1.
|
|
2608
|
+
const mt = "1.9.0", _t = {
|
|
2609
2609
|
version: mt
|
|
2610
2610
|
};
|
|
2611
2611
|
class gt {
|
|
@@ -3041,75 +3041,142 @@ class Nt {
|
|
|
3041
3041
|
this._client = e;
|
|
3042
3042
|
}
|
|
3043
3043
|
/**
|
|
3044
|
-
*
|
|
3044
|
+
* Searches for cities by name or country
|
|
3045
3045
|
*
|
|
3046
|
-
* @param params -
|
|
3047
|
-
* @returns A promise that resolves to
|
|
3048
|
-
* @throws {Error} If the request fails
|
|
3046
|
+
* @param params - Search parameters including optional country code and search query
|
|
3047
|
+
* @returns A promise that resolves to an array of matching cities
|
|
3048
|
+
* @throws {Error} If the request fails
|
|
3049
3049
|
*
|
|
3050
3050
|
* @example
|
|
3051
3051
|
* ```typescript
|
|
3052
|
-
* //
|
|
3053
|
-
* const
|
|
3052
|
+
* // Search for cities named "New York"
|
|
3053
|
+
* const cities = await weather.getCities({ search: 'New York' })
|
|
3054
3054
|
*
|
|
3055
|
-
* //
|
|
3056
|
-
* const
|
|
3055
|
+
* // Search for cities in the United States
|
|
3056
|
+
* const cities = await weather.getCities({ countryCode: 'US' })
|
|
3057
3057
|
*
|
|
3058
|
-
* // Get
|
|
3059
|
-
* const
|
|
3058
|
+
* // Get a cityId for use in other methods
|
|
3059
|
+
* const cities = await weather.getCities({ search: 'London' })
|
|
3060
|
+
* const cityId = cities[0].cityId
|
|
3061
|
+
* ```
|
|
3062
|
+
*/
|
|
3063
|
+
async getCities(e) {
|
|
3064
|
+
const t = await this._client.request("weather.getCities", e);
|
|
3065
|
+
if (!t.success)
|
|
3066
|
+
throw new Error(t.error || "Failed to fetch cities");
|
|
3067
|
+
return t.data || [];
|
|
3068
|
+
}
|
|
3069
|
+
/**
|
|
3070
|
+
* Retrieves current weather conditions for a specified city
|
|
3071
|
+
*
|
|
3072
|
+
* @param params - Weather request parameters including cityId and optional language
|
|
3073
|
+
* @returns A promise that resolves to the current weather conditions with dual units (C/F, kph/mph, etc.)
|
|
3074
|
+
* @throws {Error} If the request fails or cityId is invalid
|
|
3075
|
+
*
|
|
3076
|
+
* @example
|
|
3077
|
+
* ```typescript
|
|
3078
|
+
* // Get current conditions for a city
|
|
3079
|
+
* const conditions = await weather.getConditions({ cityId: 12345 })
|
|
3080
|
+
*
|
|
3081
|
+
* // With localized language
|
|
3082
|
+
* const conditions = await weather.getConditions({
|
|
3083
|
+
* cityId: 12345,
|
|
3084
|
+
* language: 'es'
|
|
3085
|
+
* })
|
|
3086
|
+
*
|
|
3087
|
+
* // Access both units
|
|
3088
|
+
* console.log(`${conditions.temperatureC}°C / ${conditions.temperatureF}°F`)
|
|
3089
|
+
* console.log(`${conditions.windSpeedKph} kph / ${conditions.windSpeedMph} mph`)
|
|
3060
3090
|
* ```
|
|
3061
3091
|
*/
|
|
3062
3092
|
async getConditions(e) {
|
|
3063
3093
|
const t = await this._client.request("weather.getConditions", e);
|
|
3064
|
-
if (!t.success
|
|
3094
|
+
if (!t.success)
|
|
3065
3095
|
throw new Error(t.error || "Failed to fetch weather conditions");
|
|
3066
|
-
return t
|
|
3096
|
+
return t;
|
|
3067
3097
|
}
|
|
3068
3098
|
/**
|
|
3069
|
-
* Retrieves daily weather forecast for a specified
|
|
3099
|
+
* Retrieves daily weather forecast for a specified city
|
|
3070
3100
|
*
|
|
3071
|
-
* @param params - Forecast request parameters including
|
|
3072
|
-
* @returns A promise that resolves to
|
|
3073
|
-
* @throws {Error} If the request fails or
|
|
3101
|
+
* @param params - Forecast request parameters including cityId, optional language and days
|
|
3102
|
+
* @returns A promise that resolves to daily forecast data with location information
|
|
3103
|
+
* @throws {Error} If the request fails or cityId is invalid
|
|
3074
3104
|
*
|
|
3075
3105
|
* @example
|
|
3076
3106
|
* ```typescript
|
|
3077
3107
|
* // Get 5-day forecast
|
|
3078
|
-
* const forecast = await weather.getDailyForecast({
|
|
3079
|
-
*
|
|
3080
|
-
*
|
|
3081
|
-
*
|
|
3108
|
+
* const forecast = await weather.getDailyForecast({ cityId: 12345 })
|
|
3109
|
+
*
|
|
3110
|
+
* // Get 10-day forecast
|
|
3111
|
+
* const forecast = await weather.getDailyForecast({ cityId: 12345, days: 10 })
|
|
3112
|
+
*
|
|
3113
|
+
* // Access forecast data
|
|
3114
|
+
* forecast.data.forEach(day => {
|
|
3115
|
+
* console.log(`${day.forecastDate}: ${day.weatherDescription}`)
|
|
3116
|
+
* console.log(`High: ${day.maxTemperatureC}°C, Low: ${day.minTemperatureC}°C`)
|
|
3082
3117
|
* })
|
|
3083
3118
|
* ```
|
|
3084
3119
|
*/
|
|
3085
3120
|
async getDailyForecast(e) {
|
|
3086
3121
|
const t = await this._client.request("weather.getDailyForecast", e);
|
|
3087
|
-
if (!t.success
|
|
3122
|
+
if (!t.success)
|
|
3088
3123
|
throw new Error(t.error || "Failed to fetch daily forecast");
|
|
3089
|
-
return t
|
|
3124
|
+
return t;
|
|
3090
3125
|
}
|
|
3091
3126
|
/**
|
|
3092
|
-
* Retrieves hourly weather forecast for a specified
|
|
3127
|
+
* Retrieves hourly weather forecast for a specified city
|
|
3093
3128
|
*
|
|
3094
|
-
* @param params - Forecast request parameters including
|
|
3095
|
-
* @returns A promise that resolves to
|
|
3096
|
-
* @throws {Error} If the request fails or
|
|
3129
|
+
* @param params - Forecast request parameters including cityId, optional language and hours
|
|
3130
|
+
* @returns A promise that resolves to hourly forecast data with location information
|
|
3131
|
+
* @throws {Error} If the request fails or cityId is invalid
|
|
3097
3132
|
*
|
|
3098
3133
|
* @example
|
|
3099
3134
|
* ```typescript
|
|
3100
3135
|
* // Get 24-hour forecast
|
|
3101
|
-
* const forecast = await weather.getHourlyForecast({
|
|
3102
|
-
*
|
|
3103
|
-
*
|
|
3104
|
-
*
|
|
3136
|
+
* const forecast = await weather.getHourlyForecast({ cityId: 12345, hours: 24 })
|
|
3137
|
+
*
|
|
3138
|
+
* // Get 48-hour forecast
|
|
3139
|
+
* const forecast = await weather.getHourlyForecast({ cityId: 12345, hours: 48 })
|
|
3140
|
+
*
|
|
3141
|
+
* // Access forecast data
|
|
3142
|
+
* forecast.data.forEach(hour => {
|
|
3143
|
+
* console.log(`${hour.forecastTimeLocal}: ${hour.weatherDescription}`)
|
|
3144
|
+
* console.log(`Temp: ${hour.temperatureC}°C`)
|
|
3105
3145
|
* })
|
|
3106
3146
|
* ```
|
|
3107
3147
|
*/
|
|
3108
3148
|
async getHourlyForecast(e) {
|
|
3109
3149
|
const t = await this._client.request("weather.getHourlyForecast", e);
|
|
3110
|
-
if (!t.success
|
|
3150
|
+
if (!t.success)
|
|
3111
3151
|
throw new Error(t.error || "Failed to fetch hourly forecast");
|
|
3112
|
-
return t
|
|
3152
|
+
return t;
|
|
3153
|
+
}
|
|
3154
|
+
/**
|
|
3155
|
+
* Retrieves weather alerts and warnings for a specified city
|
|
3156
|
+
*
|
|
3157
|
+
* @param params - Alert request parameters including cityId and optional language
|
|
3158
|
+
* @returns A promise that resolves to weather alerts with location information
|
|
3159
|
+
* @throws {Error} If the request fails or cityId is invalid
|
|
3160
|
+
*
|
|
3161
|
+
* @example
|
|
3162
|
+
* ```typescript
|
|
3163
|
+
* // Get weather alerts for a city
|
|
3164
|
+
* const alerts = await weather.getAlerts({ cityId: 12345 })
|
|
3165
|
+
*
|
|
3166
|
+
* // Check if there are any active alerts
|
|
3167
|
+
* if (alerts.alerts.length > 0) {
|
|
3168
|
+
* alerts.alerts.forEach(alert => {
|
|
3169
|
+
* console.log(`${alert.severity}: ${alert.title}`)
|
|
3170
|
+
* console.log(alert.description)
|
|
3171
|
+
* })
|
|
3172
|
+
* }
|
|
3173
|
+
* ```
|
|
3174
|
+
*/
|
|
3175
|
+
async getAlerts(e) {
|
|
3176
|
+
const t = await this._client.request("weather.getAlerts", e);
|
|
3177
|
+
if (!t.success)
|
|
3178
|
+
throw new Error(t.error || "Failed to fetch weather alerts");
|
|
3179
|
+
return t;
|
|
3113
3180
|
}
|
|
3114
3181
|
}
|
|
3115
3182
|
class Ct {
|
|
@@ -3746,7 +3813,7 @@ class At {
|
|
|
3746
3813
|
return !0;
|
|
3747
3814
|
}
|
|
3748
3815
|
}
|
|
3749
|
-
class
|
|
3816
|
+
class Et {
|
|
3750
3817
|
constructor(e) {
|
|
3751
3818
|
this._client = e;
|
|
3752
3819
|
}
|
|
@@ -3802,79 +3869,79 @@ class It {
|
|
|
3802
3869
|
return !0;
|
|
3803
3870
|
}
|
|
3804
3871
|
}
|
|
3805
|
-
class
|
|
3872
|
+
class It extends Ot {
|
|
3806
3873
|
get playlist() {
|
|
3807
|
-
return new
|
|
3874
|
+
return new Et(this);
|
|
3808
3875
|
}
|
|
3809
3876
|
get overrides() {
|
|
3810
3877
|
return new At(this);
|
|
3811
3878
|
}
|
|
3812
3879
|
}
|
|
3813
3880
|
let f = null;
|
|
3814
|
-
function
|
|
3881
|
+
function Vt() {
|
|
3815
3882
|
return f;
|
|
3816
3883
|
}
|
|
3817
|
-
function
|
|
3818
|
-
f = new
|
|
3884
|
+
function zt(n) {
|
|
3885
|
+
f = new It(n), f.bind();
|
|
3819
3886
|
}
|
|
3820
|
-
function
|
|
3887
|
+
function Bt() {
|
|
3821
3888
|
f == null || f.unbind(), f = null;
|
|
3822
3889
|
}
|
|
3823
|
-
function
|
|
3890
|
+
function Ut(...n) {
|
|
3824
3891
|
return k(f), f.on(...n);
|
|
3825
3892
|
}
|
|
3826
|
-
function
|
|
3893
|
+
function Ht(...n) {
|
|
3827
3894
|
return k(f), f.once(...n);
|
|
3828
3895
|
}
|
|
3829
|
-
function
|
|
3896
|
+
function Kt(...n) {
|
|
3830
3897
|
return k(f), f.off(...n);
|
|
3831
3898
|
}
|
|
3832
|
-
function
|
|
3899
|
+
function Wt(...n) {
|
|
3833
3900
|
return k(f), f.send(...n);
|
|
3834
3901
|
}
|
|
3835
|
-
function
|
|
3902
|
+
function Jt(...n) {
|
|
3836
3903
|
return k(f), f.request(...n);
|
|
3837
3904
|
}
|
|
3838
|
-
function
|
|
3905
|
+
function Gt(...n) {
|
|
3839
3906
|
return k(f), f.subscribe(...n);
|
|
3840
3907
|
}
|
|
3841
|
-
function
|
|
3908
|
+
function Yt(...n) {
|
|
3842
3909
|
return k(f), f.unsubscribe(...n);
|
|
3843
3910
|
}
|
|
3844
|
-
function
|
|
3911
|
+
function Xt() {
|
|
3845
3912
|
return k(f), f.store;
|
|
3846
3913
|
}
|
|
3847
|
-
function
|
|
3914
|
+
function Qt() {
|
|
3848
3915
|
return k(f), f.applications;
|
|
3849
3916
|
}
|
|
3850
|
-
function
|
|
3917
|
+
function es() {
|
|
3851
3918
|
return k(f), f.media;
|
|
3852
3919
|
}
|
|
3853
|
-
function
|
|
3920
|
+
function ts() {
|
|
3854
3921
|
return k(f), f.accounts;
|
|
3855
3922
|
}
|
|
3856
|
-
function
|
|
3923
|
+
function ss() {
|
|
3857
3924
|
return k(f), f.users;
|
|
3858
3925
|
}
|
|
3859
|
-
function
|
|
3926
|
+
function as() {
|
|
3860
3927
|
return k(f), f.devices;
|
|
3861
3928
|
}
|
|
3862
|
-
function
|
|
3929
|
+
function ns() {
|
|
3863
3930
|
return k(f), f.proxy;
|
|
3864
3931
|
}
|
|
3865
|
-
function
|
|
3932
|
+
function rs() {
|
|
3866
3933
|
return k(f), f.weather;
|
|
3867
3934
|
}
|
|
3868
|
-
function
|
|
3935
|
+
function is() {
|
|
3869
3936
|
return k(f), f.currency;
|
|
3870
3937
|
}
|
|
3871
|
-
function
|
|
3938
|
+
function os() {
|
|
3872
3939
|
return k(f), f.environment;
|
|
3873
3940
|
}
|
|
3874
|
-
function
|
|
3941
|
+
function cs() {
|
|
3875
3942
|
return k(f), f.playlist;
|
|
3876
3943
|
}
|
|
3877
|
-
function
|
|
3944
|
+
function ds() {
|
|
3878
3945
|
return k(f), f.overrides;
|
|
3879
3946
|
}
|
|
3880
3947
|
function k(n) {
|
|
@@ -3893,27 +3960,27 @@ export {
|
|
|
3893
3960
|
K as StoreSlice,
|
|
3894
3961
|
St as Users,
|
|
3895
3962
|
Nt as Weather,
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3963
|
+
ts as accounts,
|
|
3964
|
+
Qt as applications,
|
|
3965
|
+
zt as configure,
|
|
3966
|
+
is as currency,
|
|
3967
|
+
Bt as destroy,
|
|
3968
|
+
as as devices,
|
|
3969
|
+
os as environment,
|
|
3970
|
+
Vt as globalClient,
|
|
3971
|
+
es as media,
|
|
3972
|
+
Kt as off,
|
|
3973
|
+
Ut as on,
|
|
3974
|
+
Ht as once,
|
|
3975
|
+
ds as overrides,
|
|
3976
|
+
cs as playlist,
|
|
3977
|
+
ns as proxy,
|
|
3978
|
+
Jt as request,
|
|
3979
|
+
Wt as send,
|
|
3980
|
+
Xt as store,
|
|
3981
|
+
Gt as subscribe,
|
|
3915
3982
|
G as telemetrySdkVersion,
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3983
|
+
Yt as unsubscribe,
|
|
3984
|
+
ss as users,
|
|
3985
|
+
rs as weather
|
|
3919
3986
|
};
|