@telemetryos/root-sdk 1.12.0 → 1.13.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 CHANGED
@@ -1,5 +1,26 @@
1
1
  # @telemetryos/root-sdk
2
2
 
3
+ ## 1.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - ### New Features
8
+ - **Web mount point support** — Applications can now define a third UI surface (`/web`) alongside Render and Settings, enabling web-portal-style interfaces with full navigation control via a postMessage bridge.
9
+ - **`playlist.getDuration()`** — New async method returns the playlist-configured page duration in seconds.
10
+ - **Custom logo support** — Projects can specify a `logoPath` in `telemetry.config.json` for branding in the dev host.
11
+ - **`tos claude-code` command** — New CLI command to apply or update Claude Code skills and settings in existing projects.
12
+ - **Web project template** — New `vite-react-typescript-web` template scaffolds a project with all three mount points pre-configured.
13
+
14
+ ### Bug Fixes
15
+ - Fixed SDK client not properly validating bridge message responses.
16
+ - Fixed canvas not resizing when the sidebar toggles or window resizes after a manual drag-resize.
17
+ - Fixed `isLoading` usage and `useEffect` dependency arrays in Claude Code skill examples.
18
+ - Fixed stale active tab when the tabs array changes in the dev host.
19
+
20
+ ### Infrastructure
21
+ - Renamed `generate-application` to `create-project`; extracted shared template utilities.
22
+ - Added unit tests for Navigation, Currency, and Weather classes.
23
+
3
24
  ## 1.12.0
4
25
 
5
26
  ### Minor Changes
package/README.md CHANGED
@@ -301,6 +301,64 @@ const blob = await response.blob();
301
301
  const imageUrl = URL.createObjectURL(blob);
302
302
  ```
303
303
 
304
+ ### Weather API
305
+
306
+ Access weather data including current conditions, forecasts, and alerts. Weather data is sourced from WeatherBit and uses city IDs for location lookup.
307
+
308
+ ```javascript
309
+ import { weather } from '@telemetryos/root-sdk';
310
+
311
+ // Search for cities to get a cityId
312
+ const cities = await weather().getCities({ search: 'New York', countryCode: 'US' });
313
+ const cityId = cities[0].cityId;
314
+
315
+ // Get current weather conditions
316
+ const conditions = await weather().getConditions({ cityId });
317
+ console.log(`${conditions.temperatureC}°C / ${conditions.temperatureF}°F`);
318
+ console.log(`Wind: ${conditions.windSpeedKph} kph`);
319
+ console.log(`Humidity: ${conditions.humidity}%`);
320
+
321
+ // Get daily forecast (up to 16 days)
322
+ const daily = await weather().getDailyForecast({ cityId, days: 7 });
323
+ daily.data.forEach(day => {
324
+ console.log(`${day.forecastDate}: ${day.weatherDescription}`);
325
+ console.log(`High: ${day.maxTemperatureC}°C, Low: ${day.minTemperatureC}°C`);
326
+ });
327
+
328
+ // Get hourly forecast (up to 120 hours)
329
+ const hourly = await weather().getHourlyForecast({ cityId, hours: 24 });
330
+ hourly.data.forEach(hour => {
331
+ console.log(`${hour.forecastTimeLocal}: ${hour.temperatureC}°C`);
332
+ });
333
+
334
+ // Get weather alerts
335
+ const alerts = await weather().getAlerts({ cityId });
336
+ alerts.alerts.forEach(alert => {
337
+ console.log(`${alert.severity}: ${alert.title}`);
338
+ });
339
+ ```
340
+
341
+ All weather responses include dual units (Celsius/Fahrenheit, kph/mph, mb/inHg, km/mi) so you can display data in the user's preferred format. An optional `language` parameter is available on all methods for localized weather descriptions.
342
+
343
+ ### Currency API
344
+
345
+ Access currency exchange rates and symbols:
346
+
347
+ ```javascript
348
+ import { currency } from '@telemetryos/root-sdk';
349
+
350
+ // Get all available currency symbols
351
+ const symbols = await currency().getSymbols();
352
+ // { "USD": "United States Dollar", "EUR": "Euro", ... }
353
+
354
+ // Get exchange rates for a base currency
355
+ const rates = await currency().getRates({
356
+ base: 'USD',
357
+ symbols: 'EUR,GBP,JPY'
358
+ });
359
+ // { "EUR": 0.92, "GBP": 0.79, "JPY": 149.50 }
360
+ ```
361
+
304
362
  ## Communication Patterns
305
363
 
306
364
  The SDK uses a request-response pattern for most operations. All requests have a 30-second timeout by default to prevent hanging promises:
package/dist/client.d.ts CHANGED
@@ -10,6 +10,7 @@ import { Weather } from './weather.js';
10
10
  import { Currency } from './currency.js';
11
11
  import { Environment } from './environment.js';
12
12
  import { Mqtt } from './mqtt.js';
13
+ import { Navigation } from './navigation.js';
13
14
  import { BridgeMessage } from './bridge.js';
14
15
  /**
15
16
  * The maximum time in milliseconds to wait for a response to a request call.
@@ -78,6 +79,7 @@ export declare class Client {
78
79
  _applicationName: string;
79
80
  _applicationInstance: string;
80
81
  _applicationSpecifier: string;
82
+ _navigation: Navigation;
81
83
  _messageInterceptors: Map<string, MessageInterceptor>;
82
84
  _onHandlers: Map<string, MessageHandler<any>[]>;
83
85
  _onceHandlers: Map<string, MessageHandler<any>[]>;
@@ -0,0 +1 @@
1
+ export {};
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("./types-mYnxD5LM.cjs"),Q="1.12.0",U={version:Q};class T{constructor(e){this._client=e}async getCurrent(){const e=await this._client.request("accounts.getCurrent",{});if(!e.success)throw new Error("Failed to fetch current account");return e.account}}class M{constructor(e){this._client=e}async getAllByMountPoint(e){return(await this._client.request("applications.getAllByMountPoint",{mountPoint:e})).applications}async getByName(e){return(await this._client.request("applications.getByName",{name:e})).application}async setDependencies(e){return await this._client.request("applications.setDependencies",{applicationSpecifiers:e},{timeout:0})}bind(e,t){if(this._client._messageInterceptors.has(e))throw new Error(`Interceptor already bound for message ${e}`);this._client._messageInterceptors.set(e,t)}}class H{constructor(e){this._client=e}async getInformation(){const e=await this._client.request("devices.getInformation",{});if(!e.success)throw new Error("Failed to get device information");return e.deviceInformation}async getCapabilities(){const e=await this._client.request("devices.getCapabilities",{});if(!e.success)throw new Error("Failed to get device capabilities");return e.capabilities}}class P{constructor(e){this._client=e}async getColorScheme(){return(await this._client.request("environment.getColorScheme",{})).colorScheme}async subscribeColorScheme(e){return(await this._client.subscribe("environment.subscribeColorScheme",{},e)).success}async unsubscribeColorScheme(e){return(await this._client.unsubscribe("environment.unsubscribeColorScheme",{},e)).success}}class F{constructor(e){this._client=e}async getAllFolders(){return(await this._client.request("mediaFolders.getAll",{})).folders}async getAllByFolderId(e){return(await this._client.request("media.getAllByFolderId",{folderId:e})).contents}async getAllByTag(e){return(await this._client.request("media.getAllByTag",{tagName:e})).contents}async getById(e){return(await this._client.request("media.getById",{id:e})).content}async openPicker(e){return(await this._client.request("media.openPicker",{accept:e==null?void 0:e.accept,currentValue:e==null?void 0:e.currentValue})).selection}}class k{constructor(e){this._client=e}async fetch(e,t){var s;let r;typeof e=="string"?r=e:e instanceof URL?r=e.toString():(r=e.url,t||(t={method:e.method,headers:e.headers,body:e.body,credentials:e.credentials,cache:e.cache,redirect:e.redirect,referrer:e.referrer,integrity:e.integrity}));let n={};t!=null&&t.headers&&(t.headers instanceof Headers?t.headers.forEach((h,l)=>{n[l]=h}):Array.isArray(t.headers)?t.headers.forEach(([h,l])=>{n[h]=l}):n=t.headers);const o=await this._client.request("proxy.fetch",{url:r,method:(t==null?void 0:t.method)||"GET",headers:n,body:(s=t==null?void 0:t.body)!==null&&s!==void 0?s:null});if(!o.success)throw new TypeError(o.errorMessage,{cause:o.errorCause?Error(o.errorCause):void 0});const u=new Headers(o.headers),a={status:o.status,statusText:o.statusText,headers:u};let p=null;if(o.body!==null&&o.body!==void 0)if(o.bodyType==="binary"){const h=atob(o.body),l=new Uint8Array(h.length);for(let f=0;f<h.length;f++)l[f]=h.charCodeAt(f);p=l}else o.bodyType==="text"?p=o.body:o.bodyType==="json"&&(p=JSON.stringify(o.body));return new Response(p,a)}}class A{constructor(e){this._client=e}get application(){return new v("application","",this._client)}get instance(){return new v("instance",this._client.applicationInstance,this._client)}get device(){return new v("device",this._client.applicationInstance,this._client)}shared(e){return new v("shared",e,this._client)}}class v{constructor(e,t,s){this._kind=e,this._namespace=t,this._client=s}async set(e,t){return(await this._client.request("store.set",{kind:this._kind,namespace:this._namespace,key:e,value:t})).success}async get(e){return(await this._client.request("store.get",{kind:this._kind,namespace:this._namespace,key:e})).value}async subscribe(e,t){return(await this._client.subscribe("store.subscribe",{kind:this._kind,namespace:this._namespace,key:e},t)).success}async unsubscribe(e,t){return(await this._client.unsubscribe("store.unsubscribe",{kind:this._kind,namespace:this._namespace,key:e},t)).success}async delete(e){return(await this._client.request("store.delete",{kind:this._kind,namespace:this._namespace,key:e})).success}}class B{constructor(e){this._client=e}async getCurrent(){const e=await this._client.request("users.getCurrent",{});if(!e.success)throw new Error("Failed to fetch current user");return e.user}}class ${constructor(e){this._client=e}async getCities(e){const t=await this._client.request("weather.getCities",e);if(!t.success)throw new Error(t.error||"Failed to fetch cities");return t.data||[]}async getConditions(e){const t=await this._client.request("weather.getConditions",e);if(!t.success)throw new Error(t.error||"Failed to fetch weather conditions");return t}async getDailyForecast(e){const t=await this._client.request("weather.getDailyForecast",e);if(!t.success)throw new Error(t.error||"Failed to fetch daily forecast");return t}async getHourlyForecast(e){const t=await this._client.request("weather.getHourlyForecast",e);if(!t.success)throw new Error(t.error||"Failed to fetch hourly forecast");return t}async getAlerts(e){const t=await this._client.request("weather.getAlerts",e);if(!t.success)throw new Error(t.error||"Failed to fetch weather alerts");return t}}class R{constructor(e){this._client=e}async getSymbols(){const e=await this._client.request("currency.getSymbols",{});if(!e.success||!e.symbols)throw new Error("Failed to fetch currency symbols");return e.symbols}async getRates(e){var t,s,r;const n=await this._client.request("currency.getRates",e);if(!n.success||!n.rates)throw((t=n.error)===null||t===void 0?void 0:t.code)===201?new Error(`Invalid base currency '${e.base}'`):((s=n.error)===null||s===void 0?void 0:s.code)===202?new Error(`Invalid target currency symbol '${e.symbols}'`):new Error(((r=n.error)===null||r===void 0?void 0:r.message)||"Failed to fetch currency rates");return n.rates}}class x{constructor(e){this._client=e}async discover(){const e=await this._client.request("mqtt.discover",{});if(!e.success)throw new Error("Failed to discover MQTT brokers");return e.brokers}async connect(e,t){const s=await this._client.request("mqtt.connect",{brokerUrl:e,...t});if(!s.success)throw new Error("Failed to connect to MQTT broker");return s.clientId}async disconnect(e){if(!(await this._client.request("mqtt.disconnect",{clientId:e})).success)throw new Error("Failed to disconnect from MQTT broker")}async publish(e,t,s,r){if(!(await this._client.request("mqtt.publish",{clientId:e,topic:t,payload:s,...r})).success)throw new Error("Failed to publish MQTT message")}async subscribe(e,t,s,r){return(await this._client.subscribe("mqtt.subscribe",{clientId:e,topic:t,...r},s)).success}async unsubscribe(e,t,s){return(await this._client.unsubscribe("mqtt.unsubscribe",{clientId:e,topic:t},s)).success}async getConnectionStatus(e){const t=await this._client.request("mqtt.getConnectionStatus",{clientId:e});if(!t.success)throw new Error("Failed to get MQTT connection status");return t.status}async subscribeConnectionStatus(e,t){return(await this._client.subscribe("mqtt.subscribeConnectionStatus",{clientId:e},t)).success}async unsubscribeConnectionStatus(e,t){return(await this._client.unsubscribe("mqtt.unsubscribeConnectionStatus",{clientId:e},t)).success}}function E(c){return{...c,type:"client"}}const V=N.objectType({type:N.literalType("bridge"),name:N.stringType(),data:N.anyType()});class L{constructor(e){if(e._client._applicationSpecifier!=="rootSettingsNavigation")throw new Error("RootSettingsNavigation can only be used in the rootSettingsNavigation mount point");this._store=e}async setRootSettingsNavigation(e){var t;const s=this._store.shared("root-settings-navigation"),r=(t=await s.get("navigation"))!==null&&t!==void 0?t:{},n=this._store._client._applicationSpecifier;r[n]={applicationSpecifier:n,entries:e.entries},s.set("navigation",r)}async getRootSettingsNavigation(){var e;const s=(e=await this._store.shared("root-settings-navigation").get("navigation"))!==null&&e!==void 0?e:{},r=this._store._client._applicationSpecifier;return s[r]}async getAllRootSettingsNavigation(){var e;return(e=await this._store.shared("root-settings-navigation").get("navigation"))!==null&&e!==void 0?e:{}}}const b=1e3*30,C=typeof window>"u"&&typeof self<"u",S=C?self:window;function y(c){C?self.postMessage(c):S.parent.postMessage(c,"*")}class j{constructor(e){this._applicationName=e,this._applicationInstance="",this._applicationSpecifier="",this._messageInterceptors=new Map,this._onHandlers=new Map,this._onceHandlers=new Map,this._subscriptionNamesByHandler=new Map,this._subscriptionNamesBySubjectName=new Map}get accounts(){return new T(this)}get users(){return new B(this)}get store(){return new A(this)}get applications(){return new M(this)}get media(){return new F(this)}get proxy(){return new k(this)}get devices(){return new H(this)}get rootSettingsNavigation(){return new L(this.store)}get weather(){return new $(this)}get currency(){return new R(this)}get environment(){return new P(this)}get mqtt(){return new x(this)}get applicationName(){return this._applicationName}get applicationSpecifier(){return this._applicationSpecifier}get applicationInstance(){return this._applicationInstance}bind(){var e,t,s;const r=new URL(S.location.href),n=r.searchParams;if(this._applicationInstance=(e=n.get("applicationInstance"))!==null&&e!==void 0?e:"",!this._applicationInstance)throw new Error("Missing applicationInstance query parameter");if(this._applicationSpecifier=(t=n.get("applicationSpecifier"))!==null&&t!==void 0?t:"",!this._applicationSpecifier){const o=r.hostname.split(".");this._applicationSpecifier=(s=o[0])!==null&&s!==void 0?s:""}if(!this._applicationSpecifier||this._applicationSpecifier.length!==40)throw new Error(`Invalid applicationSpecifier: expected 40-character hash, got "${this._applicationSpecifier}"`);this._windowMessageHandler=o=>{if(o.source===S||!o.data||typeof o.data!="object"||!("type"in o.data)||o.data.type!=="client"&&o.data.type!=="bridge")return;let u;if(o.data.type==="client"){const a=this._messageInterceptors.get(o.data.name);if(!a){y(o.data);return}u={...a(o.data.data),type:"bridge"}}if(!u){const a=V.safeParse(o.data);if(!a.success)return;u=a.data;const p=this._onHandlers.get(u.name),h=this._onceHandlers.get(u.name);if(p)for(const l of p)l(u.data);if(h){for(const l of h)l(u.data);this._onceHandlers.delete(u.name)}}if(!C)for(let a=0;a<window.frames.length;a+=1)window.frames[a].postMessage(u,"*")},S.addEventListener("message",this._windowMessageHandler)}unbind(){this._windowMessageHandler&&S.removeEventListener("message",this._windowMessageHandler)}send(e,t){const s=E({telemetrySdkVersion:q,applicationName:this._applicationName,applicationSpecifier:this._applicationSpecifier,applicationInstance:this._applicationInstance,name:e,data:t});y(s)}request(e,t,s){var r;const n=I(),o=E({telemetrySdkVersion:q,applicationName:this._applicationName,applicationSpecifier:this._applicationSpecifier,applicationInstance:this._applicationInstance,name:e,data:t,responseName:n});y(o);const u=(r=s==null?void 0:s.timeout)!==null&&r!==void 0?r:b;let a=!1,p;const h=new Promise(f=>{p=g=>{a||f(g)},this.once(n,p)});if(u===0)return h;const l=new Promise((f,g)=>{const w=new Error(`${e} message request with response name of ${n} timed out after ${u}`);setTimeout(()=>{a=!0,this.off(n,p),g(w)},u)});return Promise.race([l,h])}async subscribe(e,t,s){let r,n;typeof t=="function"?n=t:(r=t,n=s);const o=I(),u=I();let a=this._subscriptionNamesBySubjectName.get(e);a||(a=[],this._subscriptionNamesBySubjectName.set(e,a)),a.push(o),this._subscriptionNamesByHandler.set(n,o),this.on(o,n);const p=E({telemetrySdkVersion:q,applicationName:this._applicationName,applicationSpecifier:this._applicationSpecifier,applicationInstance:this._applicationInstance,name:e,data:r,responseName:u,subscriptionName:o});y(p);let h=!1,l;const f=new Promise((w,m)=>{const _=new Error(`${e} subscribe request with subscription name of ${o} and response name of ${u} timed out after ${b}`);setTimeout(()=>{h=!0,this.off(u,l),m(_)},b)}),g=new Promise(w=>{l=m=>{h||w(m)},this.once(u,l)});return Promise.race([f,g])}async unsubscribe(e,t,s){let r,n;typeof t=="function"?n=t:(r=t,n=s);const o=I();let u=[];if(n){const a=this._subscriptionNamesByHandler.get(n);if(!a)return{success:!1};u=[a],this._subscriptionNamesByHandler.delete(n)}else if(!this._subscriptionNamesBySubjectName.get(e))return{success:!1};for await(const a of u){this.off(a,n);const p=E({telemetrySdkVersion:q,applicationInstance:this._applicationInstance,applicationName:this._applicationName,applicationSpecifier:this._applicationSpecifier,name:e,data:r,responseName:o,unsubscribeName:a});y(p);let h=!1,l;const f=new Promise((m,_)=>{const D=new Error(`${e} unsubscribe request with unsubscribe name of ${a} and response name of ${o} timed out after ${b}`);setTimeout(()=>{h=!0,this.off(o,l),_(D)},b)}),g=new Promise(m=>{l=_=>{h||m(_)},this.once(o,l)});if(!(await Promise.race([f,g])).success)return{success:!1}}return{success:!0}}on(e,t){var s;const r=(s=this._onHandlers.get(e))!==null&&s!==void 0?s:[];r.length===0&&this._onHandlers.set(e,r),r.push(t)}once(e,t){var s;const r=(s=this._onceHandlers.get(e))!==null&&s!==void 0?s:[];r.length===0&&this._onceHandlers.set(e,r),r.push(t)}off(e,t){const s=this._onHandlers.get(e),r=this._onceHandlers.get(e);if(!(!s&&!r)){if(s){for(let n=0;n<s.length;n+=1)t&&s[n]!==t||(s.splice(n,1),n-=1);s.length===0&&this._onHandlers.delete(e)}if(r){for(let n=0;n<r.length;n+=1)t&&r[n]!==t||(r.splice(n,1),n-=1);r.length===0&&this._onceHandlers.delete(e)}}}}function I(){return Math.random().toString(36).slice(2,9)}const q=U.version;let i=null;function W(){return i}function O(c){i=new j(c),i.bind()}function G(){i==null||i.unbind(),i=null}function J(...c){return d(i),i.on(...c)}function K(...c){return d(i),i.once(...c)}function z(...c){return d(i),i.off(...c)}function X(...c){return d(i),i.send(...c)}function Y(...c){return d(i),i.request(...c)}function Z(...c){return d(i),i.subscribe(...c)}function ee(...c){return d(i),i.unsubscribe(...c)}function te(){return d(i),i.store}function se(){return d(i),i.applications}function ne(){return d(i),i.media}function re(){return d(i),i.accounts}function ie(){return d(i),i.users}function oe(){return d(i),i.devices}function ce(){return d(i),i.proxy}function ae(){return d(i),i.rootSettingsNavigation}function ue(){return d(i),i.weather}function le(){return d(i),i.currency}function he(){return d(i),i.environment}function de(){return d(i),i.mqtt}function d(c){if(!c)throw new Error("SDK is not configured")}exports.Accounts=T;exports.Applications=M;exports.Client=j;exports.Currency=R;exports.Devices=H;exports.Environment=P;exports.Media=F;exports.Mqtt=x;exports.Proxy=k;exports.Store=A;exports.StoreSlice=v;exports.Users=B;exports.Weather=$;exports.accounts=re;exports.applications=se;exports.configure=O;exports.currency=le;exports.destroy=G;exports.devices=oe;exports.environment=he;exports.globalClient=W;exports.media=ne;exports.mqtt=de;exports.off=z;exports.on=J;exports.once=K;exports.proxy=ce;exports.request=Y;exports.rootSettingsNavigation=ae;exports.send=X;exports.store=te;exports.subscribe=Z;exports.telemetrySdkVersion=q;exports.unsubscribe=ee;exports.users=ie;exports.weather=ue;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("./types-mYnxD5LM.cjs"),Q="1.13.0",U={version:Q};class I{constructor(e){this._client=e}async getCurrent(){const e=await this._client.request("accounts.getCurrent",{});if(!e.success)throw new Error("Failed to fetch current account");return e.account}}class P{constructor(e){this._client=e}async getAllByMountPoint(e){return(await this._client.request("applications.getAllByMountPoint",{mountPoint:e})).applications}async getByName(e){return(await this._client.request("applications.getByName",{name:e})).application}async setDependencies(e){return await this._client.request("applications.setDependencies",{applicationSpecifiers:e},{timeout:0})}bind(e,t){if(this._client._messageInterceptors.has(e))throw new Error(`Interceptor already bound for message ${e}`);this._client._messageInterceptors.set(e,t)}}class T{constructor(e){this._client=e}async getInformation(){const e=await this._client.request("devices.getInformation",{});if(!e.success)throw new Error("Failed to get device information");return e.deviceInformation}async getCapabilities(){const e=await this._client.request("devices.getCapabilities",{});if(!e.success)throw new Error("Failed to get device capabilities");return e.capabilities}}class M{constructor(e){this._client=e}async getColorScheme(){return(await this._client.request("environment.getColorScheme",{})).colorScheme}async subscribeColorScheme(e){return(await this._client.subscribe("environment.subscribeColorScheme",{},e)).success}async unsubscribeColorScheme(e){return(await this._client.unsubscribe("environment.unsubscribeColorScheme",{},e)).success}}class k{constructor(e){this._client=e}async getAllFolders(){return(await this._client.request("mediaFolders.getAll",{})).folders}async getAllByFolderId(e){return(await this._client.request("media.getAllByFolderId",{folderId:e})).contents}async getAllByTag(e){return(await this._client.request("media.getAllByTag",{tagName:e})).contents}async getById(e){return(await this._client.request("media.getById",{id:e})).content}async openPicker(e){return(await this._client.request("media.openPicker",{accept:e==null?void 0:e.accept,currentValue:e==null?void 0:e.currentValue})).selection}}class F{constructor(e){this._client=e}async fetch(e,t){var s;let i;typeof e=="string"?i=e:e instanceof URL?i=e.toString():(i=e.url,t||(t={method:e.method,headers:e.headers,body:e.body,credentials:e.credentials,cache:e.cache,redirect:e.redirect,referrer:e.referrer,integrity:e.integrity}));let n={};t!=null&&t.headers&&(t.headers instanceof Headers?t.headers.forEach((h,u)=>{n[u]=h}):Array.isArray(t.headers)?t.headers.forEach(([h,u])=>{n[h]=u}):n=t.headers);const a=await this._client.request("proxy.fetch",{url:i,method:(t==null?void 0:t.method)||"GET",headers:n,body:(s=t==null?void 0:t.body)!==null&&s!==void 0?s:null});if(!a.success)throw new TypeError(a.errorMessage,{cause:a.errorCause?Error(a.errorCause):void 0});const l=new Headers(a.headers),c={status:a.status,statusText:a.statusText,headers:l};let p=null;if(a.body!==null&&a.body!==void 0)if(a.bodyType==="binary"){const h=atob(a.body),u=new Uint8Array(h.length);for(let f=0;f<h.length;f++)u[f]=h.charCodeAt(f);p=u}else a.bodyType==="text"?p=a.body:a.bodyType==="json"&&(p=JSON.stringify(a.body));return new Response(p,c)}}class A{constructor(e){this._client=e}get application(){return new v("application","",this._client)}get instance(){return new v("instance",this._client.applicationInstance,this._client)}get device(){return new v("device",this._client.applicationInstance,this._client)}shared(e){return new v("shared",e,this._client)}}class v{constructor(e,t,s){this._kind=e,this._namespace=t,this._client=s}async set(e,t){return(await this._client.request("store.set",{kind:this._kind,namespace:this._namespace,key:e,value:t})).success}async get(e){return(await this._client.request("store.get",{kind:this._kind,namespace:this._namespace,key:e})).value}async subscribe(e,t){return(await this._client.subscribe("store.subscribe",{kind:this._kind,namespace:this._namespace,key:e},t)).success}async unsubscribe(e,t){return(await this._client.unsubscribe("store.unsubscribe",{kind:this._kind,namespace:this._namespace,key:e},t)).success}async delete(e){return(await this._client.request("store.delete",{kind:this._kind,namespace:this._namespace,key:e})).success}}class R{constructor(e){this._client=e}async getCurrent(){const e=await this._client.request("users.getCurrent",{});if(!e.success)throw new Error("Failed to fetch current user");return e.user}}class B{constructor(e){this._client=e}async getCities(e){const t=await this._client.request("weather.getCities",e);if(!t.success)throw new Error(t.error||"Failed to fetch cities");return t.data||[]}async getConditions(e){const t=await this._client.request("weather.getConditions",e);if(!t.success)throw new Error(t.error||"Failed to fetch weather conditions");return t}async getDailyForecast(e){const t=await this._client.request("weather.getDailyForecast",e);if(!t.success)throw new Error(t.error||"Failed to fetch daily forecast");return t}async getHourlyForecast(e){const t=await this._client.request("weather.getHourlyForecast",e);if(!t.success)throw new Error(t.error||"Failed to fetch hourly forecast");return t}async getAlerts(e){const t=await this._client.request("weather.getAlerts",e);if(!t.success)throw new Error(t.error||"Failed to fetch weather alerts");return t}}class ${constructor(e){this._client=e}async getSymbols(){const e=await this._client.request("currency.getSymbols",{});if(!e.success||!e.symbols)throw new Error("Failed to fetch currency symbols");return e.symbols}async getRates(e){var t,s,i;const n=await this._client.request("currency.getRates",e);if(!n.success||!n.rates)throw((t=n.error)===null||t===void 0?void 0:t.code)===201?new Error(`Invalid base currency '${e.base}'`):((s=n.error)===null||s===void 0?void 0:s.code)===202?new Error(`Invalid target currency symbol '${e.symbols}'`):new Error(((i=n.error)===null||i===void 0?void 0:i.message)||"Failed to fetch currency rates");return n.rates}}class x{constructor(e){this._client=e}async discover(){const e=await this._client.request("mqtt.discover",{});if(!e.success)throw new Error("Failed to discover MQTT brokers");return e.brokers}async connect(e,t){const s=await this._client.request("mqtt.connect",{brokerUrl:e,...t});if(!s.success)throw new Error("Failed to connect to MQTT broker");return s.clientId}async disconnect(e){if(!(await this._client.request("mqtt.disconnect",{clientId:e})).success)throw new Error("Failed to disconnect from MQTT broker")}async publish(e,t,s,i){if(!(await this._client.request("mqtt.publish",{clientId:e,topic:t,payload:s,...i})).success)throw new Error("Failed to publish MQTT message")}async subscribe(e,t,s,i){return(await this._client.subscribe("mqtt.subscribe",{clientId:e,topic:t,...i},s)).success}async unsubscribe(e,t,s){return(await this._client.unsubscribe("mqtt.unsubscribe",{clientId:e,topic:t},s)).success}async getConnectionStatus(e){const t=await this._client.request("mqtt.getConnectionStatus",{clientId:e});if(!t.success)throw new Error("Failed to get MQTT connection status");return t.status}async subscribeConnectionStatus(e,t){return(await this._client.subscribe("mqtt.subscribeConnectionStatus",{clientId:e},t)).success}async unsubscribeConnectionStatus(e,t){return(await this._client.unsubscribe("mqtt.unsubscribeConnectionStatus",{clientId:e},t)).success}}class L{constructor(e){this._originalPushState=null,this._originalReplaceState=null,this._popstateHandler=null,this._backHandler=null,this._forwardHandler=null,this._client=e}bind(){typeof window>"u"||this._originalPushState||(this._originalPushState=history.pushState.bind(history),history.pushState=(...e)=>{this._originalPushState(...e),this._sendLocationChanged()},this._originalReplaceState=history.replaceState.bind(history),history.replaceState=(...e)=>{this._originalReplaceState(...e),this._sendLocationChanged()},this._popstateHandler=()=>this._sendLocationChanged(),window.addEventListener("popstate",this._popstateHandler),this._backHandler=()=>history.back(),this._forwardHandler=()=>history.forward(),this._client.on("navigation.back",this._backHandler),this._client.on("navigation.forward",this._forwardHandler),this._sendLocationChanged())}unbind(){typeof window>"u"||(this._originalPushState&&(history.pushState=this._originalPushState,this._originalPushState=null),this._originalReplaceState&&(history.replaceState=this._originalReplaceState,this._originalReplaceState=null),this._popstateHandler&&(window.removeEventListener("popstate",this._popstateHandler),this._popstateHandler=null),this._backHandler&&(this._client.off("navigation.back",this._backHandler),this._backHandler=null),this._forwardHandler&&(this._client.off("navigation.forward",this._forwardHandler),this._forwardHandler=null))}_sendLocationChanged(){this._client.send("navigation.locationChanged",{pathname:window.location.pathname})}}function H(o){return{...o,type:"client"}}const V=N.objectType({type:N.literalType("bridge"),name:N.stringType(),data:N.anyType()});class W{constructor(e){if(e._client._applicationSpecifier!=="rootSettingsNavigation")throw new Error("RootSettingsNavigation can only be used in the rootSettingsNavigation mount point");this._store=e}async setRootSettingsNavigation(e){var t;const s=this._store.shared("root-settings-navigation"),i=(t=await s.get("navigation"))!==null&&t!==void 0?t:{},n=this._store._client._applicationSpecifier;i[n]={applicationSpecifier:n,entries:e.entries},s.set("navigation",i)}async getRootSettingsNavigation(){var e;const s=(e=await this._store.shared("root-settings-navigation").get("navigation"))!==null&&e!==void 0?e:{},i=this._store._client._applicationSpecifier;return s[i]}async getAllRootSettingsNavigation(){var e;return(e=await this._store.shared("root-settings-navigation").get("navigation"))!==null&&e!==void 0?e:{}}}const m=1e3*30,C=typeof window>"u"&&typeof self<"u",S=C?self:window;function y(o){C?self.postMessage(o):S.parent.postMessage(o,"*")}class j{constructor(e){this._applicationName=e,this._applicationInstance="",this._applicationSpecifier="",this._navigation=new L(this),this._messageInterceptors=new Map,this._onHandlers=new Map,this._onceHandlers=new Map,this._subscriptionNamesByHandler=new Map,this._subscriptionNamesBySubjectName=new Map}get accounts(){return new I(this)}get users(){return new R(this)}get store(){return new A(this)}get applications(){return new P(this)}get media(){return new k(this)}get proxy(){return new F(this)}get devices(){return new T(this)}get rootSettingsNavigation(){return new W(this.store)}get weather(){return new B(this)}get currency(){return new $(this)}get environment(){return new M(this)}get mqtt(){return new x(this)}get applicationName(){return this._applicationName}get applicationSpecifier(){return this._applicationSpecifier}get applicationInstance(){return this._applicationInstance}bind(){var e,t,s;const i=new URL(S.location.href),n=i.searchParams;if(this._applicationInstance=(e=n.get("applicationInstance"))!==null&&e!==void 0?e:"",!this._applicationInstance)throw new Error("Missing applicationInstance query parameter");if(this._applicationSpecifier=(t=n.get("applicationSpecifier"))!==null&&t!==void 0?t:"",!this._applicationSpecifier){const a=i.hostname.split(".");this._applicationSpecifier=(s=a[0])!==null&&s!==void 0?s:""}if(!this._applicationSpecifier||this._applicationSpecifier.length!==40)throw new Error(`Invalid applicationSpecifier: expected 40-character hash, got "${this._applicationSpecifier}"`);this._windowMessageHandler=a=>{if(a.source===S||!a.data||typeof a.data!="object"||!("type"in a.data)||a.data.type!=="client"&&a.data.type!=="bridge")return;let l;if(a.data.type==="client"){const c=this._messageInterceptors.get(a.data.name);if(!c){y(a.data);return}l={...c(a.data.data),type:"bridge",...a.data.responseName?{name:a.data.responseName}:{}}}if(!l){const c=V.safeParse(a.data);if(!c.success)return;l=c.data;const p=this._onHandlers.get(l.name),h=this._onceHandlers.get(l.name);if(p)for(const u of p)u(l.data);if(h){for(const u of h)u(l.data);this._onceHandlers.delete(l.name)}}if(!C)for(let c=0;c<window.frames.length;c+=1)window.frames[c].postMessage(l,"*")},S.addEventListener("message",this._windowMessageHandler),this._navigation.bind()}unbind(){this._windowMessageHandler&&(this._navigation.unbind(),S.removeEventListener("message",this._windowMessageHandler))}send(e,t){const s=H({telemetrySdkVersion:q,applicationName:this._applicationName,applicationSpecifier:this._applicationSpecifier,applicationInstance:this._applicationInstance,name:e,data:t});y(s)}request(e,t,s){var i;const n=E(),a=H({telemetrySdkVersion:q,applicationName:this._applicationName,applicationSpecifier:this._applicationSpecifier,applicationInstance:this._applicationInstance,name:e,data:t,responseName:n});y(a);const l=(i=s==null?void 0:s.timeout)!==null&&i!==void 0?i:m;let c=!1,p;const h=new Promise(f=>{p=g=>{c||f(g)},this.once(n,p)});if(l===0)return h;const u=new Promise((f,g)=>{const w=new Error(`${e} message request with response name of ${n} timed out after ${l}`);setTimeout(()=>{c=!0,this.off(n,p),g(w)},l)});return Promise.race([u,h])}async subscribe(e,t,s){let i,n;typeof t=="function"?n=t:(i=t,n=s);const a=E(),l=E();let c=this._subscriptionNamesBySubjectName.get(e);c||(c=[],this._subscriptionNamesBySubjectName.set(e,c)),c.push(a),this._subscriptionNamesByHandler.set(n,a),this.on(a,n);const p=H({telemetrySdkVersion:q,applicationName:this._applicationName,applicationSpecifier:this._applicationSpecifier,applicationInstance:this._applicationInstance,name:e,data:i,responseName:l,subscriptionName:a});y(p);let h=!1,u;const f=new Promise((w,_)=>{const b=new Error(`${e} subscribe request with subscription name of ${a} and response name of ${l} timed out after ${m}`);setTimeout(()=>{h=!0,this.off(l,u),_(b)},m)}),g=new Promise(w=>{u=_=>{h||w(_)},this.once(l,u)});return Promise.race([f,g])}async unsubscribe(e,t,s){let i,n;typeof t=="function"?n=t:(i=t,n=s);const a=E();let l=[];if(n){const c=this._subscriptionNamesByHandler.get(n);if(!c)return{success:!1};l=[c],this._subscriptionNamesByHandler.delete(n)}else if(!this._subscriptionNamesBySubjectName.get(e))return{success:!1};for await(const c of l){this.off(c,n);const p=H({telemetrySdkVersion:q,applicationInstance:this._applicationInstance,applicationName:this._applicationName,applicationSpecifier:this._applicationSpecifier,name:e,data:i,responseName:a,unsubscribeName:c});y(p);let h=!1,u;const f=new Promise((_,b)=>{const D=new Error(`${e} unsubscribe request with unsubscribe name of ${c} and response name of ${a} timed out after ${m}`);setTimeout(()=>{h=!0,this.off(a,u),b(D)},m)}),g=new Promise(_=>{u=b=>{h||_(b)},this.once(a,u)});if(!(await Promise.race([f,g])).success)return{success:!1}}return{success:!0}}on(e,t){var s;const i=(s=this._onHandlers.get(e))!==null&&s!==void 0?s:[];i.length===0&&this._onHandlers.set(e,i),i.push(t)}once(e,t){var s;const i=(s=this._onceHandlers.get(e))!==null&&s!==void 0?s:[];i.length===0&&this._onceHandlers.set(e,i),i.push(t)}off(e,t){const s=this._onHandlers.get(e),i=this._onceHandlers.get(e);if(!(!s&&!i)){if(s){for(let n=0;n<s.length;n+=1)t&&s[n]!==t||(s.splice(n,1),n-=1);s.length===0&&this._onHandlers.delete(e)}if(i){for(let n=0;n<i.length;n+=1)t&&i[n]!==t||(i.splice(n,1),n-=1);i.length===0&&this._onceHandlers.delete(e)}}}}function E(){return Math.random().toString(36).slice(2,9)}const q=U.version;let r=null;function O(){return r}function G(o){r=new j(o),r.bind()}function J(){r==null||r.unbind(),r=null}function K(...o){return d(r),r.on(...o)}function z(...o){return d(r),r.once(...o)}function X(...o){return d(r),r.off(...o)}function Y(...o){return d(r),r.send(...o)}function Z(...o){return d(r),r.request(...o)}function ee(...o){return d(r),r.subscribe(...o)}function te(...o){return d(r),r.unsubscribe(...o)}function se(){return d(r),r.store}function ne(){return d(r),r.applications}function ie(){return d(r),r.media}function re(){return d(r),r.accounts}function ae(){return d(r),r.users}function oe(){return d(r),r.devices}function ce(){return d(r),r.proxy}function le(){return d(r),r.rootSettingsNavigation}function ue(){return d(r),r.weather}function he(){return d(r),r.currency}function de(){return d(r),r.environment}function pe(){return d(r),r.mqtt}function d(o){if(!o)throw new Error("SDK is not configured")}exports.Accounts=I;exports.Applications=P;exports.Client=j;exports.Currency=$;exports.Devices=T;exports.Environment=M;exports.Media=k;exports.Mqtt=x;exports.Navigation=L;exports.Proxy=F;exports.Store=A;exports.StoreSlice=v;exports.Users=R;exports.Weather=B;exports.accounts=re;exports.applications=ne;exports.configure=G;exports.currency=he;exports.destroy=J;exports.devices=oe;exports.environment=de;exports.globalClient=O;exports.media=ie;exports.mqtt=pe;exports.off=X;exports.on=K;exports.once=z;exports.proxy=ce;exports.request=Z;exports.rootSettingsNavigation=le;exports.send=Y;exports.store=se;exports.subscribe=ee;exports.telemetrySdkVersion=q;exports.unsubscribe=te;exports.users=ae;exports.weather=ue;
package/dist/index.d.ts CHANGED
@@ -12,6 +12,7 @@ export type { CitiesSearchParams, DailyForecast, DailyForecastData, DailyForecas
12
12
  export { Currency } from './currency.js';
13
13
  export type { CurrencySymbols, CurrencyRates, CurrencyRatesParams } from './currency.js';
14
14
  export { Mqtt } from './mqtt.js';
15
+ export { Navigation } from './navigation.js';
15
16
  export type { MqttBrokerInfo, MqttConnectOptions, MqttPublishOptions, MqttSubscribeOptions, MqttConnectionStatus, MqttMessage, } from './mqtt.js';
16
17
  import { Client } from './client.js';
17
18
  export { Client, type SubscriptionResult, type MessageHandler } from './client.js';
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { o as C, a as H, s as M, l as P } from "./types-CCzf8sMT.js";
2
- const F = "1.12.0", k = {
3
- version: F
1
+ import { o as C, a as P, s as T, l as k } from "./types-CCzf8sMT.js";
2
+ const M = "1.13.0", F = {
3
+ version: M
4
4
  };
5
5
  class A {
6
6
  constructor(e) {
@@ -21,7 +21,7 @@ class A {
21
21
  return e.account;
22
22
  }
23
23
  }
24
- class B {
24
+ class R {
25
25
  constructor(e) {
26
26
  this._client = e;
27
27
  }
@@ -116,7 +116,7 @@ class B {
116
116
  this._client._messageInterceptors.set(e, t);
117
117
  }
118
118
  }
119
- class $ {
119
+ class B {
120
120
  constructor(e) {
121
121
  this._client = e;
122
122
  }
@@ -160,7 +160,7 @@ class $ {
160
160
  return e.capabilities;
161
161
  }
162
162
  }
163
- class R {
163
+ class $ {
164
164
  constructor(e) {
165
165
  this._client = e;
166
166
  }
@@ -174,7 +174,7 @@ class R {
174
174
  return (await this._client.unsubscribe("environment.unsubscribeColorScheme", {}, e)).success;
175
175
  }
176
176
  }
177
- class x {
177
+ class L {
178
178
  constructor(e) {
179
179
  this._client = e;
180
180
  }
@@ -233,14 +233,14 @@ class x {
233
233
  })).selection;
234
234
  }
235
235
  }
236
- class j {
236
+ class x {
237
237
  constructor(e) {
238
238
  this._client = e;
239
239
  }
240
240
  async fetch(e, t) {
241
241
  var s;
242
- let r;
243
- typeof e == "string" ? r = e : e instanceof URL ? r = e.toString() : (r = e.url, t || (t = {
242
+ let i;
243
+ typeof e == "string" ? i = e : e instanceof URL ? i = e.toString() : (i = e.url, t || (t = {
244
244
  method: e.method,
245
245
  headers: e.headers,
246
246
  body: e.body,
@@ -251,38 +251,38 @@ class j {
251
251
  integrity: e.integrity
252
252
  }));
253
253
  let n = {};
254
- t != null && t.headers && (t.headers instanceof Headers ? t.headers.forEach((h, l) => {
255
- n[l] = h;
256
- }) : Array.isArray(t.headers) ? t.headers.forEach(([h, l]) => {
257
- n[h] = l;
254
+ t != null && t.headers && (t.headers instanceof Headers ? t.headers.forEach((h, u) => {
255
+ n[u] = h;
256
+ }) : Array.isArray(t.headers) ? t.headers.forEach(([h, u]) => {
257
+ n[h] = u;
258
258
  }) : n = t.headers);
259
- const o = await this._client.request("proxy.fetch", {
260
- url: r,
259
+ const a = await this._client.request("proxy.fetch", {
260
+ url: i,
261
261
  method: (t == null ? void 0 : t.method) || "GET",
262
262
  headers: n,
263
263
  body: (s = t == null ? void 0 : t.body) !== null && s !== void 0 ? s : null
264
264
  });
265
- if (!o.success)
266
- throw new TypeError(o.errorMessage, {
267
- cause: o.errorCause ? Error(o.errorCause) : void 0
265
+ if (!a.success)
266
+ throw new TypeError(a.errorMessage, {
267
+ cause: a.errorCause ? Error(a.errorCause) : void 0
268
268
  });
269
- const u = new Headers(o.headers), a = {
270
- status: o.status,
271
- statusText: o.statusText,
272
- headers: u
269
+ const l = new Headers(a.headers), c = {
270
+ status: a.status,
271
+ statusText: a.statusText,
272
+ headers: l
273
273
  };
274
274
  let p = null;
275
- if (o.body !== null && o.body !== void 0)
276
- if (o.bodyType === "binary") {
277
- const h = atob(o.body), l = new Uint8Array(h.length);
275
+ if (a.body !== null && a.body !== void 0)
276
+ if (a.bodyType === "binary") {
277
+ const h = atob(a.body), u = new Uint8Array(h.length);
278
278
  for (let f = 0; f < h.length; f++)
279
- l[f] = h.charCodeAt(f);
280
- p = l;
281
- } else o.bodyType === "text" ? p = o.body : o.bodyType === "json" && (p = JSON.stringify(o.body));
282
- return new Response(p, a);
279
+ u[f] = h.charCodeAt(f);
280
+ p = u;
281
+ } else a.bodyType === "text" ? p = a.body : a.bodyType === "json" && (p = JSON.stringify(a.body));
282
+ return new Response(p, c);
283
283
  }
284
284
  }
285
- class D {
285
+ class j {
286
286
  constructor(e) {
287
287
  this._client = e;
288
288
  }
@@ -438,7 +438,7 @@ class S {
438
438
  })).success;
439
439
  }
440
440
  }
441
- class Q {
441
+ class D {
442
442
  constructor(e) {
443
443
  this._client = e;
444
444
  }
@@ -461,7 +461,7 @@ class Q {
461
461
  return e.user;
462
462
  }
463
463
  }
464
- class L {
464
+ class Q {
465
465
  constructor(e) {
466
466
  this._client = e;
467
467
  }
@@ -644,10 +644,10 @@ class U {
644
644
  * ```
645
645
  */
646
646
  async getRates(e) {
647
- var t, s, r;
647
+ var t, s, i;
648
648
  const n = await this._client.request("currency.getRates", e);
649
649
  if (!n.success || !n.rates)
650
- throw ((t = n.error) === null || t === void 0 ? void 0 : t.code) === 201 ? new Error(`Invalid base currency '${e.base}'`) : ((s = n.error) === null || s === void 0 ? void 0 : s.code) === 202 ? new Error(`Invalid target currency symbol '${e.symbols}'`) : new Error(((r = n.error) === null || r === void 0 ? void 0 : r.message) || "Failed to fetch currency rates");
650
+ throw ((t = n.error) === null || t === void 0 ? void 0 : t.code) === 201 ? new Error(`Invalid base currency '${e.base}'`) : ((s = n.error) === null || s === void 0 ? void 0 : s.code) === 202 ? new Error(`Invalid target currency symbol '${e.symbols}'`) : new Error(((i = n.error) === null || i === void 0 ? void 0 : i.message) || "Failed to fetch currency rates");
651
651
  return n.rates;
652
652
  }
653
653
  }
@@ -674,20 +674,20 @@ class V {
674
674
  if (!(await this._client.request("mqtt.disconnect", { clientId: e })).success)
675
675
  throw new Error("Failed to disconnect from MQTT broker");
676
676
  }
677
- async publish(e, t, s, r) {
677
+ async publish(e, t, s, i) {
678
678
  if (!(await this._client.request("mqtt.publish", {
679
679
  clientId: e,
680
680
  topic: t,
681
681
  payload: s,
682
- ...r
682
+ ...i
683
683
  })).success)
684
684
  throw new Error("Failed to publish MQTT message");
685
685
  }
686
- async subscribe(e, t, s, r) {
686
+ async subscribe(e, t, s, i) {
687
687
  return (await this._client.subscribe("mqtt.subscribe", {
688
688
  clientId: e,
689
689
  topic: t,
690
- ...r
690
+ ...i
691
691
  }, s)).success;
692
692
  }
693
693
  async unsubscribe(e, t, s) {
@@ -715,15 +715,35 @@ class V {
715
715
  }, t)).success;
716
716
  }
717
717
  }
718
- function q(c) {
719
- return { ...c, type: "client" };
718
+ class W {
719
+ constructor(e) {
720
+ this._originalPushState = null, this._originalReplaceState = null, this._popstateHandler = null, this._backHandler = null, this._forwardHandler = null, this._client = e;
721
+ }
722
+ bind() {
723
+ typeof window > "u" || this._originalPushState || (this._originalPushState = history.pushState.bind(history), history.pushState = (...e) => {
724
+ this._originalPushState(...e), this._sendLocationChanged();
725
+ }, this._originalReplaceState = history.replaceState.bind(history), history.replaceState = (...e) => {
726
+ this._originalReplaceState(...e), this._sendLocationChanged();
727
+ }, this._popstateHandler = () => this._sendLocationChanged(), window.addEventListener("popstate", this._popstateHandler), this._backHandler = () => history.back(), this._forwardHandler = () => history.forward(), this._client.on("navigation.back", this._backHandler), this._client.on("navigation.forward", this._forwardHandler), this._sendLocationChanged());
728
+ }
729
+ unbind() {
730
+ typeof window > "u" || (this._originalPushState && (history.pushState = this._originalPushState, this._originalPushState = null), this._originalReplaceState && (history.replaceState = this._originalReplaceState, this._originalReplaceState = null), this._popstateHandler && (window.removeEventListener("popstate", this._popstateHandler), this._popstateHandler = null), this._backHandler && (this._client.off("navigation.back", this._backHandler), this._backHandler = null), this._forwardHandler && (this._client.off("navigation.forward", this._forwardHandler), this._forwardHandler = null));
731
+ }
732
+ _sendLocationChanged() {
733
+ this._client.send("navigation.locationChanged", {
734
+ pathname: window.location.pathname
735
+ });
736
+ }
737
+ }
738
+ function q(o) {
739
+ return { ...o, type: "client" };
720
740
  }
721
- const W = C({
722
- type: P("bridge"),
723
- name: M(),
724
- data: H()
741
+ const G = C({
742
+ type: k("bridge"),
743
+ name: T(),
744
+ data: P()
725
745
  });
726
- class G {
746
+ class J {
727
747
  /**
728
748
  * Creates a new RootSettingsNavigation API instance.
729
749
  *
@@ -747,11 +767,11 @@ class G {
747
767
  */
748
768
  async setRootSettingsNavigation(e) {
749
769
  var t;
750
- const s = this._store.shared("root-settings-navigation"), r = (t = await s.get("navigation")) !== null && t !== void 0 ? t : {}, n = this._store._client._applicationSpecifier;
751
- r[n] = {
770
+ const s = this._store.shared("root-settings-navigation"), i = (t = await s.get("navigation")) !== null && t !== void 0 ? t : {}, n = this._store._client._applicationSpecifier;
771
+ i[n] = {
752
772
  applicationSpecifier: n,
753
773
  entries: e.entries
754
- }, s.set("navigation", r);
774
+ }, s.set("navigation", i);
755
775
  }
756
776
  /**
757
777
  * Retrieves the current navigation entries for this root application.
@@ -763,8 +783,8 @@ class G {
763
783
  */
764
784
  async getRootSettingsNavigation() {
765
785
  var e;
766
- const s = (e = await this._store.shared("root-settings-navigation").get("navigation")) !== null && e !== void 0 ? e : {}, r = this._store._client._applicationSpecifier;
767
- return s[r];
786
+ const s = (e = await this._store.shared("root-settings-navigation").get("navigation")) !== null && e !== void 0 ? e : {}, i = this._store._client._applicationSpecifier;
787
+ return s[i];
768
788
  }
769
789
  /**
770
790
  * Retrieves the navigation entries for all root applications.
@@ -780,11 +800,11 @@ class G {
780
800
  return (e = await this._store.shared("root-settings-navigation").get("navigation")) !== null && e !== void 0 ? e : {};
781
801
  }
782
802
  }
783
- const b = 1e3 * 30, I = typeof window > "u" && typeof self < "u", v = I ? self : window;
784
- function y(c) {
785
- I ? self.postMessage(c) : v.parent.postMessage(c, "*");
803
+ const b = 1e3 * 30, E = typeof window > "u" && typeof self < "u", v = E ? self : window;
804
+ function y(o) {
805
+ E ? self.postMessage(o) : v.parent.postMessage(o, "*");
786
806
  }
787
- class J {
807
+ class K {
788
808
  /**
789
809
  * Creates a new Client instance for communicating with the TelemetryOS platform.
790
810
  *
@@ -796,7 +816,7 @@ class J {
796
816
  * in your application's telemetry.config.json file
797
817
  */
798
818
  constructor(e) {
799
- this._applicationName = e, this._applicationInstance = "", this._applicationSpecifier = "", this._messageInterceptors = /* @__PURE__ */ new Map(), this._onHandlers = /* @__PURE__ */ new Map(), this._onceHandlers = /* @__PURE__ */ new Map(), this._subscriptionNamesByHandler = /* @__PURE__ */ new Map(), this._subscriptionNamesBySubjectName = /* @__PURE__ */ new Map();
819
+ this._applicationName = e, this._applicationInstance = "", this._applicationSpecifier = "", this._navigation = new W(this), this._messageInterceptors = /* @__PURE__ */ new Map(), this._onHandlers = /* @__PURE__ */ new Map(), this._onceHandlers = /* @__PURE__ */ new Map(), this._subscriptionNamesByHandler = /* @__PURE__ */ new Map(), this._subscriptionNamesBySubjectName = /* @__PURE__ */ new Map();
800
820
  }
801
821
  /**
802
822
  * Provides access to the accounts API for retrieving TelemetryOS account information.
@@ -824,7 +844,7 @@ class J {
824
844
  * @returns A Users instance bound to this client
825
845
  */
826
846
  get users() {
827
- return new Q(this);
847
+ return new D(this);
828
848
  }
829
849
  /**
830
850
  * Provides access to the store API for data persistence with multiple storage scopes.
@@ -838,7 +858,7 @@ class J {
838
858
  * @returns A Store instance bound to this client
839
859
  */
840
860
  get store() {
841
- return new D(this);
861
+ return new j(this);
842
862
  }
843
863
  /**
844
864
  * Provides access to the applications API for discovering other TelemetryOS applications.
@@ -852,7 +872,7 @@ class J {
852
872
  * @returns An Applications instance bound to this client
853
873
  */
854
874
  get applications() {
855
- return new B(this);
875
+ return new R(this);
856
876
  }
857
877
  /**
858
878
  * Provides access to the media API for working with content hosted on the TelemetryOS platform.
@@ -867,7 +887,7 @@ class J {
867
887
  * @returns A Media instance bound to this client
868
888
  */
869
889
  get media() {
870
- return new x(this);
890
+ return new L(this);
871
891
  }
872
892
  /**
873
893
  * Provides access to the proxy API for fetching third-party content through the TelemetryOS API.
@@ -881,7 +901,7 @@ class J {
881
901
  * @returns A Proxy instance bound to this client
882
902
  */
883
903
  get proxy() {
884
- return new j(this);
904
+ return new x(this);
885
905
  }
886
906
  /**
887
907
  * Provides access to the devices API for interacting with the current device.
@@ -896,7 +916,7 @@ class J {
896
916
  * @returns A Devices instance bound to this client
897
917
  */
898
918
  get devices() {
899
- return new $(this);
919
+ return new B(this);
900
920
  }
901
921
  /**
902
922
  * Provides access to the root settings navigation API for TelemetryOS administration UI integration.
@@ -914,7 +934,7 @@ class J {
914
934
  * @throws {Error} If used by an application not mounted at the 'rootSettingsNavigation' mount point
915
935
  */
916
936
  get rootSettingsNavigation() {
917
- return new G(this.store);
937
+ return new J(this.store);
918
938
  }
919
939
  /**
920
940
  * Provides access to the weather API for retrieving weather data.
@@ -928,7 +948,7 @@ class J {
928
948
  * @returns A Weather instance bound to this client
929
949
  */
930
950
  get weather() {
931
- return new L(this);
951
+ return new Q(this);
932
952
  }
933
953
  /**
934
954
  * Provides access to the currency API for retrieving currency exchange rates.
@@ -956,7 +976,7 @@ class J {
956
976
  * @returns An Environment instance bound to this client
957
977
  */
958
978
  get environment() {
959
- return new R(this);
979
+ return new $(this);
960
980
  }
961
981
  get mqtt() {
962
982
  return new V(this);
@@ -987,46 +1007,50 @@ class J {
987
1007
  */
988
1008
  bind() {
989
1009
  var e, t, s;
990
- const r = new URL(v.location.href), n = r.searchParams;
1010
+ const i = new URL(v.location.href), n = i.searchParams;
991
1011
  if (this._applicationInstance = (e = n.get("applicationInstance")) !== null && e !== void 0 ? e : "", !this._applicationInstance)
992
1012
  throw new Error("Missing applicationInstance query parameter");
993
1013
  if (this._applicationSpecifier = (t = n.get("applicationSpecifier")) !== null && t !== void 0 ? t : "", !this._applicationSpecifier) {
994
- const o = r.hostname.split(".");
995
- this._applicationSpecifier = (s = o[0]) !== null && s !== void 0 ? s : "";
1014
+ const a = i.hostname.split(".");
1015
+ this._applicationSpecifier = (s = a[0]) !== null && s !== void 0 ? s : "";
996
1016
  }
997
1017
  if (!this._applicationSpecifier || this._applicationSpecifier.length !== 40)
998
1018
  throw new Error(`Invalid applicationSpecifier: expected 40-character hash, got "${this._applicationSpecifier}"`);
999
- this._windowMessageHandler = (o) => {
1000
- if (o.source === v || !o.data || typeof o.data != "object" || !("type" in o.data) || o.data.type !== "client" && o.data.type !== "bridge")
1019
+ this._windowMessageHandler = (a) => {
1020
+ if (a.source === v || !a.data || typeof a.data != "object" || !("type" in a.data) || a.data.type !== "client" && a.data.type !== "bridge")
1001
1021
  return;
1002
- let u;
1003
- if (o.data.type === "client") {
1004
- const a = this._messageInterceptors.get(o.data.name);
1005
- if (!a) {
1006
- y(o.data);
1022
+ let l;
1023
+ if (a.data.type === "client") {
1024
+ const c = this._messageInterceptors.get(a.data.name);
1025
+ if (!c) {
1026
+ y(a.data);
1007
1027
  return;
1008
1028
  }
1009
- u = { ...a(o.data.data), type: "bridge" };
1029
+ l = {
1030
+ ...c(a.data.data),
1031
+ type: "bridge",
1032
+ ...a.data.responseName ? { name: a.data.responseName } : {}
1033
+ };
1010
1034
  }
1011
- if (!u) {
1012
- const a = W.safeParse(o.data);
1013
- if (!a.success)
1035
+ if (!l) {
1036
+ const c = G.safeParse(a.data);
1037
+ if (!c.success)
1014
1038
  return;
1015
- u = a.data;
1016
- const p = this._onHandlers.get(u.name), h = this._onceHandlers.get(u.name);
1039
+ l = c.data;
1040
+ const p = this._onHandlers.get(l.name), h = this._onceHandlers.get(l.name);
1017
1041
  if (p)
1018
- for (const l of p)
1019
- l(u.data);
1042
+ for (const u of p)
1043
+ u(l.data);
1020
1044
  if (h) {
1021
- for (const l of h)
1022
- l(u.data);
1023
- this._onceHandlers.delete(u.name);
1045
+ for (const u of h)
1046
+ u(l.data);
1047
+ this._onceHandlers.delete(l.name);
1024
1048
  }
1025
1049
  }
1026
- if (!I)
1027
- for (let a = 0; a < window.frames.length; a += 1)
1028
- window.frames[a].postMessage(u, "*");
1029
- }, v.addEventListener("message", this._windowMessageHandler);
1050
+ if (!E)
1051
+ for (let c = 0; c < window.frames.length; c += 1)
1052
+ window.frames[c].postMessage(l, "*");
1053
+ }, v.addEventListener("message", this._windowMessageHandler), this._navigation.bind();
1030
1054
  }
1031
1055
  /**
1032
1056
  * Removes the message event listener and cleans up resources.
@@ -1042,7 +1066,7 @@ class J {
1042
1066
  * of managing their own Client instances.
1043
1067
  */
1044
1068
  unbind() {
1045
- this._windowMessageHandler && v.removeEventListener("message", this._windowMessageHandler);
1069
+ this._windowMessageHandler && (this._navigation.unbind(), v.removeEventListener("message", this._windowMessageHandler));
1046
1070
  }
1047
1071
  /**
1048
1072
  * Sends a one-way message to the TelemetryOS platform.
@@ -1059,7 +1083,7 @@ class J {
1059
1083
  */
1060
1084
  send(e, t) {
1061
1085
  const s = q({
1062
- telemetrySdkVersion: E,
1086
+ telemetrySdkVersion: H,
1063
1087
  applicationName: this._applicationName,
1064
1088
  applicationSpecifier: this._applicationSpecifier,
1065
1089
  applicationInstance: this._applicationInstance,
@@ -1088,9 +1112,9 @@ class J {
1088
1112
  * @throws {Error} If the request times out
1089
1113
  */
1090
1114
  request(e, t, s) {
1091
- var r;
1092
- const n = N(), o = q({
1093
- telemetrySdkVersion: E,
1115
+ var i;
1116
+ const n = N(), a = q({
1117
+ telemetrySdkVersion: H,
1094
1118
  applicationName: this._applicationName,
1095
1119
  applicationSpecifier: this._applicationSpecifier,
1096
1120
  applicationInstance: this._applicationInstance,
@@ -1098,91 +1122,91 @@ class J {
1098
1122
  data: t,
1099
1123
  responseName: n
1100
1124
  });
1101
- y(o);
1102
- const u = (r = s == null ? void 0 : s.timeout) !== null && r !== void 0 ? r : b;
1103
- let a = !1, p;
1125
+ y(a);
1126
+ const l = (i = s == null ? void 0 : s.timeout) !== null && i !== void 0 ? i : b;
1127
+ let c = !1, p;
1104
1128
  const h = new Promise((f) => {
1105
- p = (g) => {
1106
- a || f(g);
1129
+ p = (_) => {
1130
+ c || f(_);
1107
1131
  }, this.once(n, p);
1108
1132
  });
1109
- if (u === 0)
1133
+ if (l === 0)
1110
1134
  return h;
1111
- const l = new Promise((f, g) => {
1112
- const m = new Error(`${e} message request with response name of ${n} timed out after ${u}`);
1135
+ const u = new Promise((f, _) => {
1136
+ const w = new Error(`${e} message request with response name of ${n} timed out after ${l}`);
1113
1137
  setTimeout(() => {
1114
- a = !0, this.off(n, p), g(m);
1115
- }, u);
1138
+ c = !0, this.off(n, p), _(w);
1139
+ }, l);
1116
1140
  });
1117
- return Promise.race([l, h]);
1141
+ return Promise.race([u, h]);
1118
1142
  }
1119
1143
  async subscribe(e, t, s) {
1120
- let r, n;
1121
- typeof t == "function" ? n = t : (r = t, n = s);
1122
- const o = N(), u = N();
1123
- let a = this._subscriptionNamesBySubjectName.get(e);
1124
- a || (a = [], this._subscriptionNamesBySubjectName.set(e, a)), a.push(o), this._subscriptionNamesByHandler.set(n, o), this.on(o, n);
1144
+ let i, n;
1145
+ typeof t == "function" ? n = t : (i = t, n = s);
1146
+ const a = N(), l = N();
1147
+ let c = this._subscriptionNamesBySubjectName.get(e);
1148
+ c || (c = [], this._subscriptionNamesBySubjectName.set(e, c)), c.push(a), this._subscriptionNamesByHandler.set(n, a), this.on(a, n);
1125
1149
  const p = q({
1126
- telemetrySdkVersion: E,
1150
+ telemetrySdkVersion: H,
1127
1151
  applicationName: this._applicationName,
1128
1152
  applicationSpecifier: this._applicationSpecifier,
1129
1153
  applicationInstance: this._applicationInstance,
1130
1154
  name: e,
1131
- data: r,
1132
- responseName: u,
1133
- subscriptionName: o
1155
+ data: i,
1156
+ responseName: l,
1157
+ subscriptionName: a
1134
1158
  });
1135
1159
  y(p);
1136
- let h = !1, l;
1137
- const f = new Promise((m, w) => {
1138
- const _ = new Error(`${e} subscribe request with subscription name of ${o} and response name of ${u} timed out after ${b}`);
1160
+ let h = !1, u;
1161
+ const f = new Promise((w, g) => {
1162
+ const m = new Error(`${e} subscribe request with subscription name of ${a} and response name of ${l} timed out after ${b}`);
1139
1163
  setTimeout(() => {
1140
- h = !0, this.off(u, l), w(_);
1164
+ h = !0, this.off(l, u), g(m);
1141
1165
  }, b);
1142
- }), g = new Promise((m) => {
1143
- l = (w) => {
1144
- h || m(w);
1145
- }, this.once(u, l);
1166
+ }), _ = new Promise((w) => {
1167
+ u = (g) => {
1168
+ h || w(g);
1169
+ }, this.once(l, u);
1146
1170
  });
1147
- return Promise.race([f, g]);
1171
+ return Promise.race([f, _]);
1148
1172
  }
1149
1173
  async unsubscribe(e, t, s) {
1150
- let r, n;
1151
- typeof t == "function" ? n = t : (r = t, n = s);
1152
- const o = N();
1153
- let u = [];
1174
+ let i, n;
1175
+ typeof t == "function" ? n = t : (i = t, n = s);
1176
+ const a = N();
1177
+ let l = [];
1154
1178
  if (n) {
1155
- const a = this._subscriptionNamesByHandler.get(n);
1156
- if (!a)
1179
+ const c = this._subscriptionNamesByHandler.get(n);
1180
+ if (!c)
1157
1181
  return { success: !1 };
1158
- u = [a], this._subscriptionNamesByHandler.delete(n);
1182
+ l = [c], this._subscriptionNamesByHandler.delete(n);
1159
1183
  } else if (!this._subscriptionNamesBySubjectName.get(e))
1160
1184
  return { success: !1 };
1161
- for await (const a of u) {
1162
- this.off(a, n);
1185
+ for await (const c of l) {
1186
+ this.off(c, n);
1163
1187
  const p = q({
1164
- telemetrySdkVersion: E,
1188
+ telemetrySdkVersion: H,
1165
1189
  applicationInstance: this._applicationInstance,
1166
1190
  applicationName: this._applicationName,
1167
1191
  applicationSpecifier: this._applicationSpecifier,
1168
1192
  name: e,
1169
- data: r,
1170
- responseName: o,
1171
- unsubscribeName: a
1193
+ data: i,
1194
+ responseName: a,
1195
+ unsubscribeName: c
1172
1196
  });
1173
1197
  y(p);
1174
- let h = !1, l;
1175
- const f = new Promise((w, _) => {
1176
- const T = new Error(`${e} unsubscribe request with unsubscribe name of ${a} and response name of ${o} timed out after ${b}`);
1198
+ let h = !1, u;
1199
+ const f = new Promise((g, m) => {
1200
+ const I = new Error(`${e} unsubscribe request with unsubscribe name of ${c} and response name of ${a} timed out after ${b}`);
1177
1201
  setTimeout(() => {
1178
- h = !0, this.off(o, l), _(T);
1202
+ h = !0, this.off(a, u), m(I);
1179
1203
  }, b);
1180
- }), g = new Promise((w) => {
1181
- l = (_) => {
1182
- h || w(_);
1183
- }, this.once(o, l);
1204
+ }), _ = new Promise((g) => {
1205
+ u = (m) => {
1206
+ h || g(m);
1207
+ }, this.once(a, u);
1184
1208
  });
1185
- if (!(await Promise.race([f, g])).success)
1209
+ if (!(await Promise.race([f, _])).success)
1186
1210
  return { success: !1 };
1187
1211
  }
1188
1212
  return { success: !0 };
@@ -1206,8 +1230,8 @@ class J {
1206
1230
  */
1207
1231
  on(e, t) {
1208
1232
  var s;
1209
- const r = (s = this._onHandlers.get(e)) !== null && s !== void 0 ? s : [];
1210
- r.length === 0 && this._onHandlers.set(e, r), r.push(t);
1233
+ const i = (s = this._onHandlers.get(e)) !== null && s !== void 0 ? s : [];
1234
+ i.length === 0 && this._onHandlers.set(e, i), i.push(t);
1211
1235
  }
1212
1236
  /**
1213
1237
  * Registers a one-time handler for a specific message type.
@@ -1225,8 +1249,8 @@ class J {
1225
1249
  */
1226
1250
  once(e, t) {
1227
1251
  var s;
1228
- const r = (s = this._onceHandlers.get(e)) !== null && s !== void 0 ? s : [];
1229
- r.length === 0 && this._onceHandlers.set(e, r), r.push(t);
1252
+ const i = (s = this._onceHandlers.get(e)) !== null && s !== void 0 ? s : [];
1253
+ i.length === 0 && this._onceHandlers.set(e, i), i.push(t);
1230
1254
  }
1231
1255
  /**
1232
1256
  * Removes previously registered message handlers.
@@ -1244,17 +1268,17 @@ class J {
1244
1268
  * all handlers for this message type will be removed.
1245
1269
  */
1246
1270
  off(e, t) {
1247
- const s = this._onHandlers.get(e), r = this._onceHandlers.get(e);
1248
- if (!(!s && !r)) {
1271
+ const s = this._onHandlers.get(e), i = this._onceHandlers.get(e);
1272
+ if (!(!s && !i)) {
1249
1273
  if (s) {
1250
1274
  for (let n = 0; n < s.length; n += 1)
1251
1275
  t && s[n] !== t || (s.splice(n, 1), n -= 1);
1252
1276
  s.length === 0 && this._onHandlers.delete(e);
1253
1277
  }
1254
- if (r) {
1255
- for (let n = 0; n < r.length; n += 1)
1256
- t && r[n] !== t || (r.splice(n, 1), n -= 1);
1257
- r.length === 0 && this._onceHandlers.delete(e);
1278
+ if (i) {
1279
+ for (let n = 0; n < i.length; n += 1)
1280
+ t && i[n] !== t || (i.splice(n, 1), n -= 1);
1281
+ i.length === 0 && this._onceHandlers.delete(e);
1258
1282
  }
1259
1283
  }
1260
1284
  }
@@ -1262,113 +1286,114 @@ class J {
1262
1286
  function N() {
1263
1287
  return Math.random().toString(36).slice(2, 9);
1264
1288
  }
1265
- const E = k.version;
1266
- let i = null;
1267
- function O() {
1268
- return i;
1289
+ const H = F.version;
1290
+ let r = null;
1291
+ function z() {
1292
+ return r;
1269
1293
  }
1270
- function z(c) {
1271
- i = new J(c), i.bind();
1294
+ function X(o) {
1295
+ r = new K(o), r.bind();
1272
1296
  }
1273
- function X() {
1274
- i == null || i.unbind(), i = null;
1297
+ function Y() {
1298
+ r == null || r.unbind(), r = null;
1275
1299
  }
1276
- function Y(...c) {
1277
- return d(i), i.on(...c);
1300
+ function Z(...o) {
1301
+ return d(r), r.on(...o);
1278
1302
  }
1279
- function Z(...c) {
1280
- return d(i), i.once(...c);
1303
+ function ee(...o) {
1304
+ return d(r), r.once(...o);
1281
1305
  }
1282
- function ee(...c) {
1283
- return d(i), i.off(...c);
1306
+ function te(...o) {
1307
+ return d(r), r.off(...o);
1284
1308
  }
1285
- function te(...c) {
1286
- return d(i), i.send(...c);
1309
+ function se(...o) {
1310
+ return d(r), r.send(...o);
1287
1311
  }
1288
- function se(...c) {
1289
- return d(i), i.request(...c);
1312
+ function ne(...o) {
1313
+ return d(r), r.request(...o);
1290
1314
  }
1291
- function ne(...c) {
1292
- return d(i), i.subscribe(...c);
1315
+ function ie(...o) {
1316
+ return d(r), r.subscribe(...o);
1293
1317
  }
1294
- function re(...c) {
1295
- return d(i), i.unsubscribe(...c);
1318
+ function re(...o) {
1319
+ return d(r), r.unsubscribe(...o);
1296
1320
  }
1297
- function ie() {
1298
- return d(i), i.store;
1321
+ function ae() {
1322
+ return d(r), r.store;
1299
1323
  }
1300
1324
  function oe() {
1301
- return d(i), i.applications;
1325
+ return d(r), r.applications;
1302
1326
  }
1303
1327
  function ce() {
1304
- return d(i), i.media;
1328
+ return d(r), r.media;
1305
1329
  }
1306
- function ae() {
1307
- return d(i), i.accounts;
1330
+ function le() {
1331
+ return d(r), r.accounts;
1308
1332
  }
1309
1333
  function ue() {
1310
- return d(i), i.users;
1311
- }
1312
- function le() {
1313
- return d(i), i.devices;
1334
+ return d(r), r.users;
1314
1335
  }
1315
1336
  function he() {
1316
- return d(i), i.proxy;
1337
+ return d(r), r.devices;
1317
1338
  }
1318
1339
  function de() {
1319
- return d(i), i.rootSettingsNavigation;
1340
+ return d(r), r.proxy;
1320
1341
  }
1321
1342
  function pe() {
1322
- return d(i), i.weather;
1343
+ return d(r), r.rootSettingsNavigation;
1323
1344
  }
1324
1345
  function fe() {
1325
- return d(i), i.currency;
1346
+ return d(r), r.weather;
1347
+ }
1348
+ function _e() {
1349
+ return d(r), r.currency;
1326
1350
  }
1327
1351
  function ge() {
1328
- return d(i), i.environment;
1352
+ return d(r), r.environment;
1329
1353
  }
1330
1354
  function we() {
1331
- return d(i), i.mqtt;
1355
+ return d(r), r.mqtt;
1332
1356
  }
1333
- function d(c) {
1334
- if (!c)
1357
+ function d(o) {
1358
+ if (!o)
1335
1359
  throw new Error("SDK is not configured");
1336
1360
  }
1337
1361
  export {
1338
1362
  A as Accounts,
1339
- B as Applications,
1340
- J as Client,
1363
+ R as Applications,
1364
+ K as Client,
1341
1365
  U as Currency,
1342
- $ as Devices,
1343
- R as Environment,
1344
- x as Media,
1366
+ B as Devices,
1367
+ $ as Environment,
1368
+ L as Media,
1345
1369
  V as Mqtt,
1346
- j as Proxy,
1347
- D as Store,
1370
+ W as Navigation,
1371
+ x as Proxy,
1372
+ j as Store,
1348
1373
  S as StoreSlice,
1349
- Q as Users,
1350
- L as Weather,
1351
- ae as accounts,
1374
+ D as Users,
1375
+ Q as Weather,
1376
+ le as accounts,
1352
1377
  oe as applications,
1353
- z as configure,
1354
- fe as currency,
1355
- X as destroy,
1356
- le as devices,
1378
+ X as configure,
1379
+ _e as currency,
1380
+ Y as destroy,
1381
+ he as devices,
1357
1382
  ge as environment,
1358
- O as globalClient,
1383
+ z as globalClient,
1359
1384
  ce as media,
1360
1385
  we as mqtt,
1361
- ee as off,
1362
- Y as on,
1363
- Z as once,
1364
- he as proxy,
1365
- se as request,
1366
- de as rootSettingsNavigation,
1367
- te as send,
1368
- ie as store,
1369
- ne as subscribe,
1370
- E as telemetrySdkVersion,
1386
+ te as off,
1387
+ Z as on,
1388
+ ee as once,
1389
+ de as proxy,
1390
+ ne as request,
1391
+ pe as rootSettingsNavigation,
1392
+ se as send,
1393
+ ae as store,
1394
+ ie as subscribe,
1395
+ H as telemetrySdkVersion,
1371
1396
  re as unsubscribe,
1372
1397
  ue as users,
1373
- pe as weather
1398
+ fe as weather
1374
1399
  };
@@ -0,0 +1,13 @@
1
+ import { Client } from './client.js';
2
+ export declare class Navigation {
3
+ private _client;
4
+ private _originalPushState;
5
+ private _originalReplaceState;
6
+ private _popstateHandler;
7
+ private _backHandler;
8
+ private _forwardHandler;
9
+ constructor(client: Client);
10
+ bind(): void;
11
+ unbind(): void;
12
+ private _sendLocationChanged;
13
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telemetryos/root-sdk",
3
- "version": "1.12.0",
3
+ "version": "1.13.0",
4
4
  "description": "The official TelemetryOS root application sdk package. Provides types and apis for building root TelemetryOS applications.",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",