@telemetryos/root-sdk 1.7.2 → 1.7.4

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,17 @@
1
1
  # @telemetryos/root-sdk
2
2
 
3
+ ## 1.7.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix broken tos init project
8
+
9
+ ## 1.7.3
10
+
11
+ ### Patch Changes
12
+
13
+ - Added scale slider to default package and supporting features in SDK, CLI
14
+
3
15
  ## 1.7.2
4
16
 
5
17
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("./types-mYnxD5LM.cjs"),j="1.7.2",D={version:j};class P{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})}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}}class C{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 A{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}}class B{constructor(e){this._client=e}async fetch(e,t){var s;let o;typeof e=="string"?o=e:e instanceof URL?o=e.toString():(o=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 r={};t!=null&&t.headers&&(t.headers instanceof Headers?t.headers.forEach((u,p)=>{r[p]=u}):Array.isArray(t.headers)?t.headers.forEach(([u,p])=>{r[u]=p}):r=t.headers);const n=await this._client.request("proxy.fetch",{url:o,method:(t==null?void 0:t.method)||"GET",headers:r,body:(s=t==null?void 0:t.body)!==null&&s!==void 0?s:null});if(!n.success)throw new TypeError(n.errorMessage,{cause:n.errorCause?Error(n.errorCause):void 0});const l=new Headers(n.headers),c={status:n.status,statusText:n.statusText,headers:l};let d=null;if(n.body!==null&&n.body!==void 0)if(n.bodyType==="binary"){const u=atob(n.body),p=new Uint8Array(u.length);for(let f=0;f<u.length;f++)p[f]=u.charCodeAt(f);d=p}else n.bodyType==="text"?d=n.body:n.bodyType==="json"&&(d=JSON.stringify(n.body));return new Response(d,c)}}class k{constructor(e){this._client=e}get application(){return new y("application","",this._client)}get instance(){return new y("instance",this._client.applicationInstance,this._client)}get device(){return new y("device",this._client.applicationInstance,this._client)}shared(e){return new y("shared",e,this._client)}}class y{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 F{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 getConditions(e){const t=await this._client.request("weather.getConditions",e);if(!t.success||!t.conditions)throw new Error(t.error||"Failed to fetch weather conditions");return t.conditions}async getDailyForecast(e){const t=await this._client.request("weather.getDailyForecast",e);if(!t.success||!t.forecast)throw new Error(t.error||"Failed to fetch daily forecast");return t.forecast}async getHourlyForecast(e){const t=await this._client.request("weather.getHourlyForecast",e);if(!t.success||!t.forecast)throw new Error(t.error||"Failed to fetch hourly forecast");return t.forecast}}function I(a){return{...a,type:"client"}}const U=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"),o=(t=await s.get("navigation"))!==null&&t!==void 0?t:{},r=this._store._client._applicationSpecifier;o[r]={applicationSpecifier:r,entries:e.entries},s.set("navigation",o)}async getRootSettingsNavigation(){var e;const s=(e=await this._store.shared("root-settings-navigation").get("navigation"))!==null&&e!==void 0?e:{},o=this._store._client._applicationSpecifier;return s[o]}async getAllRootSettingsNavigation(){var e;return(e=await this._store.shared("root-settings-navigation").get("navigation"))!==null&&e!==void 0?e:{}}}const m=1e3*30,E=typeof window>"u"&&typeof self<"u",b=E?self:window;function w(a){E?self.postMessage(a):b.parent.postMessage(a,"*")}class x{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 P(this)}get users(){return new F(this)}get store(){return new k(this)}get applications(){return new M(this)}get media(){return new A(this)}get proxy(){return new B(this)}get devices(){return new T(this)}get rootSettingsNavigation(){return new L(this.store)}get weather(){return new $(this)}get environment(){return new C(this)}get applicationName(){return this._applicationName}get applicationSpecifier(){return this._applicationSpecifier}get applicationInstance(){return this._applicationInstance}bind(){var e,t,s;const o=new URL(b.location.href),r=o.searchParams;if(this._applicationInstance=(e=r.get("applicationInstance"))!==null&&e!==void 0?e:"",!this._applicationInstance)throw new Error("Missing applicationInstance query parameter");if(this._applicationSpecifier=(t=r.get("applicationSpecifier"))!==null&&t!==void 0?t:"",!this._applicationSpecifier){const n=o.hostname.split(".");this._applicationSpecifier=(s=n[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=n=>{if(n.source===b||!n.data||!("type"in n.data)||n.data.type!=="client"&&n.data.type!=="bridge")return;let l;if(n.data.type==="client"){const c=this._messageInterceptors.get(n.data.name);if(!c){w(n.data);return}l={...c(n.data.data),type:"bridge"}}if(!l){const c=U.safeParse(n.data);if(!c.success)return;l=c.data;const d=this._onHandlers.get(l.name),u=this._onceHandlers.get(l.name);if(d)for(const p of d)p(l.data);if(u){for(const p of u)p(l.data);this._onceHandlers.delete(l.name)}}if(!E)for(let c=0;c<window.frames.length;c+=1)window.frames[c].postMessage(l,"*")},b.addEventListener("message",this._windowMessageHandler)}unbind(){this._windowMessageHandler&&b.removeEventListener("message",this._windowMessageHandler)}send(e,t){const s=I({telemetrySdkVersion:v,applicationName:this._applicationName,applicationSpecifier:this._applicationSpecifier,applicationInstance:this._applicationInstance,name:e,data:t});w(s)}request(e,t){const s=H(),o=I({telemetrySdkVersion:v,applicationName:this._applicationName,applicationSpecifier:this._applicationSpecifier,applicationInstance:this._applicationInstance,name:e,data:t,responseName:s});w(o);let r=!1,n;const l=new Promise((d,u)=>{const p=new Error(`${e} message request with response name of ${s} timed out after ${m}`);setTimeout(()=>{r=!0,this.off(s,n),u(p)},m)}),c=new Promise(d=>{n=u=>{r||d(u)},this.once(s,d)});return Promise.race([l,c])}async subscribe(e,t,s){let o,r;typeof t=="function"?r=t:(o=t,r=s);const n=H(),l=H();let c=this._subscriptionNamesBySubjectName.get(e);c||(c=[],this._subscriptionNamesBySubjectName.set(e,c)),c.push(n),this._subscriptionNamesByHandler.set(r,n),this.on(n,r);const d=I({telemetrySdkVersion:v,applicationName:this._applicationName,applicationSpecifier:this._applicationSpecifier,applicationInstance:this._applicationInstance,name:e,data:o,responseName:l,subscriptionName:n});w(d);let u=!1,p;const f=new Promise((S,g)=>{const _=new Error(`${e} subscribe request with subscription name of ${n} and response name of ${l} timed out after ${m}`);setTimeout(()=>{u=!0,this.off(l,p),g(_)},m)}),q=new Promise(S=>{p=g=>{u||S(g)},this.on(l,S)});return Promise.race([f,q])}async unsubscribe(e,t,s){let o,r;typeof t=="function"?r=t:(o=t,r=s);const n=H();let l=[];if(r){const c=this._subscriptionNamesByHandler.get(r);if(!c)return{success:!1};l=[c],this._subscriptionNamesByHandler.delete(r)}else if(!this._subscriptionNamesBySubjectName.get(e))return{success:!1};for await(const c of l){this.off(c,r);const d=I({telemetrySdkVersion:v,applicationInstance:this._applicationInstance,applicationName:this._applicationName,applicationSpecifier:this._applicationSpecifier,name:e,data:o,responseName:n,unsubscribeName:c});w(d);let u=!1,p;const f=new Promise((g,_)=>{const R=new Error(`${e} unsubscribe request with unsubscribe name of ${c} and response name of ${n} timed out after ${m}`);setTimeout(()=>{u=!0,this.off(n,p),_(R)},m)}),q=new Promise(g=>{p=_=>{u||g(_)},this.once(n,g)});if(!(await Promise.race([f,q])).success)return{success:!1}}return{success:!0}}on(e,t){var s;const o=(s=this._onHandlers.get(e))!==null&&s!==void 0?s:[];o.length===0&&this._onHandlers.set(e,o),o.push(t)}once(e,t){var s;const o=(s=this._onceHandlers.get(e))!==null&&s!==void 0?s:[];o.length===0&&this._onceHandlers.set(e,o),o.push(t)}off(e,t){const s=this._onHandlers.get(e),o=this._onceHandlers.get(e);if(!(!s&&!o)){if(s){for(let r=0;r<s.length;r+=1)t&&s[r]!==t||(s.splice(r,1),r-=1);s.length===0&&this._onHandlers.delete(e)}if(o){for(let r=0;r<o.length;r+=1)t&&o[r]!==t||(o.splice(r,1),r-=1);o.length===0&&this._onceHandlers.delete(e)}}}}function H(){return Math.random().toString(36).slice(2,9)}const v=D.version;let i=null;function V(){return i}function W(a){i=new x(a),i.bind()}function O(){i==null||i.unbind(),i=null}function G(...a){return h(i),i.on(...a)}function J(...a){return h(i),i.once(...a)}function K(...a){return h(i),i.off(...a)}function z(...a){return h(i),i.send(...a)}function Q(...a){return h(i),i.request(...a)}function X(...a){return h(i),i.subscribe(...a)}function Y(...a){return h(i),i.unsubscribe(...a)}function Z(){return h(i),i.store}function ee(){return h(i),i.applications}function te(){return h(i),i.media}function se(){return h(i),i.accounts}function ne(){return h(i),i.users}function ie(){return h(i),i.devices}function re(){return h(i),i.proxy}function oe(){return h(i),i.rootSettingsNavigation}function ae(){return h(i),i.weather}function ce(){return h(i),i.environment}function h(a){if(!a)throw new Error("SDK is not configured")}exports.Accounts=P;exports.Applications=M;exports.Client=x;exports.Devices=T;exports.Environment=C;exports.Media=A;exports.Proxy=B;exports.Store=k;exports.StoreSlice=y;exports.Users=F;exports.Weather=$;exports.accounts=se;exports.applications=ee;exports.configure=W;exports.destroy=O;exports.devices=ie;exports.environment=ce;exports.globalClient=V;exports.media=te;exports.off=K;exports.on=G;exports.once=J;exports.proxy=re;exports.request=Q;exports.rootSettingsNavigation=oe;exports.send=z;exports.store=Z;exports.subscribe=X;exports.telemetrySdkVersion=v;exports.unsubscribe=Y;exports.users=ne;exports.weather=ae;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("./types-mYnxD5LM.cjs"),j="1.7.4",D={version:j};class P{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})}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}}class C{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 A{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}}class B{constructor(e){this._client=e}async fetch(e,t){var s;let o;typeof e=="string"?o=e:e instanceof URL?o=e.toString():(o=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 r={};t!=null&&t.headers&&(t.headers instanceof Headers?t.headers.forEach((u,p)=>{r[p]=u}):Array.isArray(t.headers)?t.headers.forEach(([u,p])=>{r[u]=p}):r=t.headers);const n=await this._client.request("proxy.fetch",{url:o,method:(t==null?void 0:t.method)||"GET",headers:r,body:(s=t==null?void 0:t.body)!==null&&s!==void 0?s:null});if(!n.success)throw new TypeError(n.errorMessage,{cause:n.errorCause?Error(n.errorCause):void 0});const l=new Headers(n.headers),c={status:n.status,statusText:n.statusText,headers:l};let d=null;if(n.body!==null&&n.body!==void 0)if(n.bodyType==="binary"){const u=atob(n.body),p=new Uint8Array(u.length);for(let f=0;f<u.length;f++)p[f]=u.charCodeAt(f);d=p}else n.bodyType==="text"?d=n.body:n.bodyType==="json"&&(d=JSON.stringify(n.body));return new Response(d,c)}}class k{constructor(e){this._client=e}get application(){return new y("application","",this._client)}get instance(){return new y("instance",this._client.applicationInstance,this._client)}get device(){return new y("device",this._client.applicationInstance,this._client)}shared(e){return new y("shared",e,this._client)}}class y{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 F{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 getConditions(e){const t=await this._client.request("weather.getConditions",e);if(!t.success||!t.conditions)throw new Error(t.error||"Failed to fetch weather conditions");return t.conditions}async getDailyForecast(e){const t=await this._client.request("weather.getDailyForecast",e);if(!t.success||!t.forecast)throw new Error(t.error||"Failed to fetch daily forecast");return t.forecast}async getHourlyForecast(e){const t=await this._client.request("weather.getHourlyForecast",e);if(!t.success||!t.forecast)throw new Error(t.error||"Failed to fetch hourly forecast");return t.forecast}}function I(a){return{...a,type:"client"}}const U=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"),o=(t=await s.get("navigation"))!==null&&t!==void 0?t:{},r=this._store._client._applicationSpecifier;o[r]={applicationSpecifier:r,entries:e.entries},s.set("navigation",o)}async getRootSettingsNavigation(){var e;const s=(e=await this._store.shared("root-settings-navigation").get("navigation"))!==null&&e!==void 0?e:{},o=this._store._client._applicationSpecifier;return s[o]}async getAllRootSettingsNavigation(){var e;return(e=await this._store.shared("root-settings-navigation").get("navigation"))!==null&&e!==void 0?e:{}}}const m=1e3*30,E=typeof window>"u"&&typeof self<"u",b=E?self:window;function w(a){E?self.postMessage(a):b.parent.postMessage(a,"*")}class x{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 P(this)}get users(){return new F(this)}get store(){return new k(this)}get applications(){return new M(this)}get media(){return new A(this)}get proxy(){return new B(this)}get devices(){return new T(this)}get rootSettingsNavigation(){return new L(this.store)}get weather(){return new $(this)}get environment(){return new C(this)}get applicationName(){return this._applicationName}get applicationSpecifier(){return this._applicationSpecifier}get applicationInstance(){return this._applicationInstance}bind(){var e,t,s;const o=new URL(b.location.href),r=o.searchParams;if(this._applicationInstance=(e=r.get("applicationInstance"))!==null&&e!==void 0?e:"",!this._applicationInstance)throw new Error("Missing applicationInstance query parameter");if(this._applicationSpecifier=(t=r.get("applicationSpecifier"))!==null&&t!==void 0?t:"",!this._applicationSpecifier){const n=o.hostname.split(".");this._applicationSpecifier=(s=n[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=n=>{if(n.source===b||!n.data||!("type"in n.data)||n.data.type!=="client"&&n.data.type!=="bridge")return;let l;if(n.data.type==="client"){const c=this._messageInterceptors.get(n.data.name);if(!c){w(n.data);return}l={...c(n.data.data),type:"bridge"}}if(!l){const c=U.safeParse(n.data);if(!c.success)return;l=c.data;const d=this._onHandlers.get(l.name),u=this._onceHandlers.get(l.name);if(d)for(const p of d)p(l.data);if(u){for(const p of u)p(l.data);this._onceHandlers.delete(l.name)}}if(!E)for(let c=0;c<window.frames.length;c+=1)window.frames[c].postMessage(l,"*")},b.addEventListener("message",this._windowMessageHandler)}unbind(){this._windowMessageHandler&&b.removeEventListener("message",this._windowMessageHandler)}send(e,t){const s=I({telemetrySdkVersion:v,applicationName:this._applicationName,applicationSpecifier:this._applicationSpecifier,applicationInstance:this._applicationInstance,name:e,data:t});w(s)}request(e,t){const s=H(),o=I({telemetrySdkVersion:v,applicationName:this._applicationName,applicationSpecifier:this._applicationSpecifier,applicationInstance:this._applicationInstance,name:e,data:t,responseName:s});w(o);let r=!1,n;const l=new Promise((d,u)=>{const p=new Error(`${e} message request with response name of ${s} timed out after ${m}`);setTimeout(()=>{r=!0,this.off(s,n),u(p)},m)}),c=new Promise(d=>{n=u=>{r||d(u)},this.once(s,d)});return Promise.race([l,c])}async subscribe(e,t,s){let o,r;typeof t=="function"?r=t:(o=t,r=s);const n=H(),l=H();let c=this._subscriptionNamesBySubjectName.get(e);c||(c=[],this._subscriptionNamesBySubjectName.set(e,c)),c.push(n),this._subscriptionNamesByHandler.set(r,n),this.on(n,r);const d=I({telemetrySdkVersion:v,applicationName:this._applicationName,applicationSpecifier:this._applicationSpecifier,applicationInstance:this._applicationInstance,name:e,data:o,responseName:l,subscriptionName:n});w(d);let u=!1,p;const f=new Promise((S,g)=>{const _=new Error(`${e} subscribe request with subscription name of ${n} and response name of ${l} timed out after ${m}`);setTimeout(()=>{u=!0,this.off(l,p),g(_)},m)}),q=new Promise(S=>{p=g=>{u||S(g)},this.on(l,S)});return Promise.race([f,q])}async unsubscribe(e,t,s){let o,r;typeof t=="function"?r=t:(o=t,r=s);const n=H();let l=[];if(r){const c=this._subscriptionNamesByHandler.get(r);if(!c)return{success:!1};l=[c],this._subscriptionNamesByHandler.delete(r)}else if(!this._subscriptionNamesBySubjectName.get(e))return{success:!1};for await(const c of l){this.off(c,r);const d=I({telemetrySdkVersion:v,applicationInstance:this._applicationInstance,applicationName:this._applicationName,applicationSpecifier:this._applicationSpecifier,name:e,data:o,responseName:n,unsubscribeName:c});w(d);let u=!1,p;const f=new Promise((g,_)=>{const R=new Error(`${e} unsubscribe request with unsubscribe name of ${c} and response name of ${n} timed out after ${m}`);setTimeout(()=>{u=!0,this.off(n,p),_(R)},m)}),q=new Promise(g=>{p=_=>{u||g(_)},this.once(n,g)});if(!(await Promise.race([f,q])).success)return{success:!1}}return{success:!0}}on(e,t){var s;const o=(s=this._onHandlers.get(e))!==null&&s!==void 0?s:[];o.length===0&&this._onHandlers.set(e,o),o.push(t)}once(e,t){var s;const o=(s=this._onceHandlers.get(e))!==null&&s!==void 0?s:[];o.length===0&&this._onceHandlers.set(e,o),o.push(t)}off(e,t){const s=this._onHandlers.get(e),o=this._onceHandlers.get(e);if(!(!s&&!o)){if(s){for(let r=0;r<s.length;r+=1)t&&s[r]!==t||(s.splice(r,1),r-=1);s.length===0&&this._onHandlers.delete(e)}if(o){for(let r=0;r<o.length;r+=1)t&&o[r]!==t||(o.splice(r,1),r-=1);o.length===0&&this._onceHandlers.delete(e)}}}}function H(){return Math.random().toString(36).slice(2,9)}const v=D.version;let i=null;function V(){return i}function W(a){i=new x(a),i.bind()}function O(){i==null||i.unbind(),i=null}function G(...a){return h(i),i.on(...a)}function J(...a){return h(i),i.once(...a)}function K(...a){return h(i),i.off(...a)}function z(...a){return h(i),i.send(...a)}function Q(...a){return h(i),i.request(...a)}function X(...a){return h(i),i.subscribe(...a)}function Y(...a){return h(i),i.unsubscribe(...a)}function Z(){return h(i),i.store}function ee(){return h(i),i.applications}function te(){return h(i),i.media}function se(){return h(i),i.accounts}function ne(){return h(i),i.users}function ie(){return h(i),i.devices}function re(){return h(i),i.proxy}function oe(){return h(i),i.rootSettingsNavigation}function ae(){return h(i),i.weather}function ce(){return h(i),i.environment}function h(a){if(!a)throw new Error("SDK is not configured")}exports.Accounts=P;exports.Applications=M;exports.Client=x;exports.Devices=T;exports.Environment=C;exports.Media=A;exports.Proxy=B;exports.Store=k;exports.StoreSlice=y;exports.Users=F;exports.Weather=$;exports.accounts=se;exports.applications=ee;exports.configure=W;exports.destroy=O;exports.devices=ie;exports.environment=ce;exports.globalClient=V;exports.media=te;exports.off=K;exports.on=G;exports.once=J;exports.proxy=re;exports.request=Q;exports.rootSettingsNavigation=oe;exports.send=z;exports.store=Z;exports.subscribe=X;exports.telemetrySdkVersion=v;exports.unsubscribe=Y;exports.users=ne;exports.weather=ae;
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { o as P, a as M, s as T, l as C } from "./types-CCzf8sMT.js";
2
- const B = "1.7.2", A = {
2
+ const B = "1.7.4", A = {
3
3
  version: B
4
4
  };
5
5
  class k {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telemetryos/root-sdk",
3
- "version": "1.7.2",
3
+ "version": "1.7.4",
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",