@telemetryos/root-sdk 1.1.0 → 1.2.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 +7 -0
- package/dist/applications.d.ts +19 -9
- package/dist/index.cjs +1 -1
- package/dist/index.js +84 -79
- package/package.json +1 -1
package/CHANGELOG.md
ADDED
package/dist/applications.d.ts
CHANGED
|
@@ -10,6 +10,10 @@ export type Application = {
|
|
|
10
10
|
export type GetUrlResult = {
|
|
11
11
|
url: string;
|
|
12
12
|
};
|
|
13
|
+
export type SetDependenciesResult = {
|
|
14
|
+
ready: string[];
|
|
15
|
+
unavailable: string[];
|
|
16
|
+
};
|
|
13
17
|
export declare class Applications {
|
|
14
18
|
_client: Client;
|
|
15
19
|
constructor(client: Client);
|
|
@@ -39,17 +43,23 @@ export declare class Applications {
|
|
|
39
43
|
*/
|
|
40
44
|
getByName(name: string): Promise<Application | null>;
|
|
41
45
|
/**
|
|
42
|
-
*
|
|
46
|
+
* Sets the dependencies for the current application.
|
|
47
|
+
*
|
|
48
|
+
* This method allows an application to declare which other applications it depends on.
|
|
49
|
+
* The player will download and prepare these dependencies before they can be loaded.
|
|
43
50
|
*
|
|
44
|
-
* This method
|
|
45
|
-
*
|
|
46
|
-
* understand its context and communicate with the platform.
|
|
51
|
+
* IMPORTANT: This method must be called and awaited before loading any sub-applications
|
|
52
|
+
* in iframes. Only applications that return as 'ready' should be loaded.
|
|
47
53
|
*
|
|
48
|
-
*
|
|
54
|
+
* @param applicationSpecifiers An array of application specifiers that this application depends on
|
|
55
|
+
* @returns A promise that resolves with arrays of ready and unavailable application specifiers
|
|
49
56
|
*
|
|
50
|
-
* @
|
|
51
|
-
*
|
|
52
|
-
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```typescript
|
|
59
|
+
* const result = await client.applications.setDependencies(['app1-hash', 'app2-hash'])
|
|
60
|
+
* // result.ready: ['app1-hash'] - these can be loaded in iframes
|
|
61
|
+
* // result.unavailable: ['app2-hash'] - these failed to load
|
|
62
|
+
* ```
|
|
53
63
|
*/
|
|
54
|
-
|
|
64
|
+
setDependencies(applicationSpecifiers: string[]): Promise<SetDependenciesResult>;
|
|
55
65
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./index-JDXm3DEz.cjs"),k="1.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./index-JDXm3DEz.cjs"),k="1.2.0",E={version:k};class I{constructor(e){this._client=e}async getCurrent(){return(await this._client.request("user.getCurrentAccount",{})).account}}class M{constructor(e){this._client=e}async getAllByMountPoint(e){return(await this._client.request("applications.getByMountPoint",{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})}}function A(o,e=console.error){o().catch(e)}class ${constructor(e){this._client=e}async getColorScheme(){return(await this._client.request("environment.getColorScheme",{})).colorScheme}subscribeColorScheme(e){A(async()=>{this._client.on("environment.colorSchemeChanged",e),e(await this.getColorScheme())})}unsubscribeColorScheme(e){this._client.off("environment.colorSchemeChanged",e)}}class q{constructor(e){this._client=e}async queryFolders(e){return(await this._client.request("media.queryMediaFolders",{query:e})).folders}async getFoldersByTag(e){return(await this._client.request("media.getMediaFoldersByTag",{tagName:e})).folders}async getFolderById(e){return(await this._client.request("media.getMediaFolderById",{id:e})).folder}async getMediaContentByFolderId(e){return(await this._client.request("media.getMediaContentByFolderId",{folderId:e})).folders}async getMediaContentById(e){return(await this._client.request("media.getMediaContentById",{id:e})).content}}class H{constructor(e){this._client=e}get application(){return new b("application","",this._client)}get instance(){return new b("instance",this._client._applicationId,this._client)}get device(){return new b("device",this._client._applicationId,this._client)}shared(e){return new b("shared",e,this._client)}}class b{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 P{constructor(e){this._client=e}async getCurrent(){return await this._client.request("user.getCurrentUser",{})}}const T=v.z.object({name:v.z.string(),data:v.z.any()});class F{constructor(e){if(e._client._applicationId!=="rootSettingsNavigation")throw new Error("RootSettingsNavigation can only be used in the rootSettingsNavigation mount point");this._store=e}async setRootSettingsNavigation(e){const t=this._store.shared("root-settings-navigation"),s=await t.get("navigation"),r=this._store._client._applicationId;s[r]={applicationId:r,entries:e.entries},t.set("navigation",s)}async getRootSettingsNavigation(){const t=await this._store.shared("root-settings-navigation").get("navigation"),s=this._store._client._applicationId;return t[s]}async getAllRootSettingsNavigation(){return this._store.shared("root-settings-navigation").get("navigation")}}const f=1e3*30;class C{constructor(e){this._applicationName=e,this._applicationInstance="",this._applicationSpecifier="",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 P(this)}get store(){return new H(this)}get applications(){return new M(this)}get media(){return new q(this)}get rootSettingsNavigation(){return new F(this.store)}get applicationName(){return this._applicationName}get applicationSpecifier(){return this._applicationSpecifier}get applicationInstance(){return this._applicationInstance}bind(){var e;const t=new URL(window.location.href),s=t.searchParams;this._applicationInstance=(e=s.get("telemetryApplicationId"))!==null&&e!==void 0?e:"";const r=s.get("applicationSpecifier");if(r)this._applicationSpecifier=r;else{const i=t.hostname.split(".");this._applicationSpecifier=i[0]||""}if(!this._applicationSpecifier||this._applicationSpecifier.length!==40)throw new Error(`Invalid applicationSpecifier: expected 40-character hash, got "${this._applicationSpecifier}"`);if(!this._applicationInstance)throw new Error("Missing telemetryApplicationId query parameter");this._windowMessageHandler=i=>{if(i.source===window)return;for(let c=0;c<window.frames.length;c+=1)window.frames[c].postMessage(i.data,"*");const l=T.safeParse(i.data);if(!l.success)return;const u=l.data,a=this._onHandlers.get(u.name),h=this._onceHandlers.get(u.name);if(a)for(const c of a)c(u.data);if(h){for(const c of h)c(u.data);this._onceHandlers.delete(u.name)}},window.addEventListener("message",this._windowMessageHandler)}unbind(){this._windowMessageHandler&&window.removeEventListener("message",this._windowMessageHandler)}send(e,t){const s={telemetrySdkVersion:_,applicationName:this._applicationName,applicationSpecifier:this._applicationSpecifier,applicationInstance:this._applicationInstance,name:e,data:t};window.parent.postMessage(s,"*")}request(e,t){const s=y(),r={telemetrySdkVersion:_,applicationName:this._applicationName,applicationSpecifier:this._applicationSpecifier,applicationInstance:this._applicationInstance,name:e,data:t,responseName:s};window.parent.postMessage(r,"*");let i=!1,l;const u=new Promise((h,c)=>{const d=new Error(`${e} message request with response name of ${s} timed out after ${f}`);setTimeout(()=>{i=!0,this.off(s,l),c(d)},f)}),a=new Promise(h=>{l=c=>{i||h(c)},this.once(s,h)});return Promise.race([u,a])}async subscribe(e,t,s){let r,i;typeof t=="function"?i=t:(r=t,i=s);const l=y(),u=y();let a=this._subscriptionNamesBySubjectName.get(e);a||(a=[],this._subscriptionNamesBySubjectName.set(e,a)),a.push(l),this._subscriptionNamesByHandler.set(i,l),this.on(l,i);const h={telemetrySdkVersion:_,applicationName:this._applicationName,applicationSpecifier:this._applicationSpecifier,applicationInstance:this._applicationInstance,name:e,data:r,responseName:u,subscriptionName:l};window.parent.postMessage(h,"*");let c=!1,d;const S=new Promise((w,g)=>{const m=new Error(`${e} subscribe request with subscription name of ${l} and response name of ${u} timed out after ${f}`);setTimeout(()=>{c=!0,this.off(u,d),g(m)},f)}),N=new Promise(w=>{d=g=>{c||w(g)},this.on(u,w)});return Promise.race([S,N])}async unsubscribe(e,t,s){let r,i;typeof t=="function"?i=t:(r=t,i=s);const l=y();let u=[];if(i){const a=this._subscriptionNamesByHandler.get(i);if(!a)return{success:!1};u=[a],this._subscriptionNamesByHandler.delete(i)}else if(!this._subscriptionNamesBySubjectName.get(e))return{success:!1};for await(const a of u){this.off(a,i);const h={telemetrySdkVersion:_,applicationInstance:this._applicationInstance,applicationName:this._applicationName,applicationSpecifier:this._applicationSpecifier,name:e,data:r,responseName:l,unsubscribeName:a};window.parent.postMessage(h,"*");let c=!1,d;const S=new Promise((g,m)=>{const B=new Error(`${e} unsubscribe request with unsubscribe name of ${a} and response name of ${l} timed out after ${f}`);setTimeout(()=>{c=!0,this.off(l,d),m(B)},f)}),N=new Promise(g=>{d=m=>{c||g(m)},this.once(l,g)});if(!(await Promise.race([S,N])).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 i=0;i<s.length;i+=1)t&&s[i]!==t||(s.splice(i,1),i-=1);s.length===0&&this._onHandlers.delete(e)}if(r){for(let i=0;i<r.length;i+=1)t&&r[i]!==t||(r.splice(i,1),i-=1);r.length===0&&this._onceHandlers.delete(e)}}}}function y(){return Math.random().toString(36).slice(2,9)}const _=E.version;let n=null;function R(){return n}function j(o){n=new C(o),n.bind()}function U(){n==null||n.unbind(),n=null}function z(...o){return p(n),n.on(...o)}function D(...o){return p(n),n.once(...o)}function L(...o){return p(n),n.off(...o)}function V(...o){return p(n),n.send(...o)}function x(...o){return p(n),n.request(...o)}function K(...o){return p(n),n.subscribe(...o)}function G(...o){return p(n),n.unsubscribe(...o)}function J(){return p(n),n.store}function O(){return p(n),n.applications}function Q(){return p(n),n.media}function W(){return p(n),n.accounts}function X(){return p(n),n.users}function Y(){return p(n),n.rootSettingsNavigation}function p(o){if(!o)throw new Error("SDK is not configured")}exports.Accounts=I;exports.Applications=M;exports.Client=C;exports.Environment=$;exports.Media=q;exports.Store=H;exports.Users=P;exports.accounts=W;exports.applications=O;exports.configure=j;exports.destroy=U;exports.globalClient=R;exports.media=Q;exports.off=L;exports.on=z;exports.once=D;exports.request=x;exports.rootSettingsNavigation=Y;exports.send=V;exports.store=J;exports.subscribe=K;exports.telemetrySdkVersion=_;exports.unsubscribe=G;exports.users=X;
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z as v } from "./index-B98VDFRY.js";
|
|
2
|
-
const M = "1.
|
|
2
|
+
const M = "1.2.0", H = {
|
|
3
3
|
version: M
|
|
4
4
|
};
|
|
5
5
|
class q {
|
|
@@ -56,27 +56,32 @@ class P {
|
|
|
56
56
|
})).application;
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
|
-
*
|
|
59
|
+
* Sets the dependencies for the current application.
|
|
60
60
|
*
|
|
61
|
-
* This method
|
|
62
|
-
*
|
|
63
|
-
* understand its context and communicate with the platform.
|
|
61
|
+
* This method allows an application to declare which other applications it depends on.
|
|
62
|
+
* The player will download and prepare these dependencies before they can be loaded.
|
|
64
63
|
*
|
|
65
|
-
*
|
|
64
|
+
* IMPORTANT: This method must be called and awaited before loading any sub-applications
|
|
65
|
+
* in iframes. Only applications that return as 'ready' should be loaded.
|
|
66
66
|
*
|
|
67
|
-
* @param
|
|
68
|
-
* @
|
|
69
|
-
*
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
67
|
+
* @param applicationSpecifiers An array of application specifiers that this application depends on
|
|
68
|
+
* @returns A promise that resolves with arrays of ready and unavailable application specifiers
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```typescript
|
|
72
|
+
* const result = await client.applications.setDependencies(['app1-hash', 'app2-hash'])
|
|
73
|
+
* // result.ready: ['app1-hash'] - these can be loaded in iframes
|
|
74
|
+
* // result.unavailable: ['app2-hash'] - these failed to load
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
async setDependencies(e) {
|
|
78
|
+
return await this._client.request("applications.setDependencies", {
|
|
79
|
+
applicationSpecifiers: e
|
|
80
|
+
});
|
|
76
81
|
}
|
|
77
82
|
}
|
|
78
|
-
function B(
|
|
79
|
-
|
|
83
|
+
function B(o, e = console.error) {
|
|
84
|
+
o().catch(e);
|
|
80
85
|
}
|
|
81
86
|
class R {
|
|
82
87
|
constructor(e) {
|
|
@@ -360,9 +365,9 @@ class A {
|
|
|
360
365
|
* @returns A promise that resolves when the navigation has been registered
|
|
361
366
|
*/
|
|
362
367
|
async setRootSettingsNavigation(e) {
|
|
363
|
-
const t = this._store.shared("root-settings-navigation"), s = await t.get("navigation"),
|
|
364
|
-
s[
|
|
365
|
-
applicationId:
|
|
368
|
+
const t = this._store.shared("root-settings-navigation"), s = await t.get("navigation"), r = this._store._client._applicationId;
|
|
369
|
+
s[r] = {
|
|
370
|
+
applicationId: r,
|
|
366
371
|
entries: e.entries
|
|
367
372
|
}, t.set("navigation", s);
|
|
368
373
|
}
|
|
@@ -391,7 +396,7 @@ class A {
|
|
|
391
396
|
return this._store.shared("root-settings-navigation").get("navigation");
|
|
392
397
|
}
|
|
393
398
|
}
|
|
394
|
-
const
|
|
399
|
+
const g = 1e3 * 30;
|
|
395
400
|
class T {
|
|
396
401
|
/**
|
|
397
402
|
* Creates a new Client instance for communicating with the TelemetryOS platform.
|
|
@@ -523,9 +528,9 @@ class T {
|
|
|
523
528
|
var e;
|
|
524
529
|
const t = new URL(window.location.href), s = t.searchParams;
|
|
525
530
|
this._applicationInstance = (e = s.get("telemetryApplicationId")) !== null && e !== void 0 ? e : "";
|
|
526
|
-
const
|
|
527
|
-
if (
|
|
528
|
-
this._applicationSpecifier =
|
|
531
|
+
const r = s.get("applicationSpecifier");
|
|
532
|
+
if (r)
|
|
533
|
+
this._applicationSpecifier = r;
|
|
529
534
|
else {
|
|
530
535
|
const i = t.hostname.split(".");
|
|
531
536
|
this._applicationSpecifier = i[0] || "";
|
|
@@ -611,7 +616,7 @@ class T {
|
|
|
611
616
|
* @throws {Error} If the request times out
|
|
612
617
|
*/
|
|
613
618
|
request(e, t) {
|
|
614
|
-
const s = b(),
|
|
619
|
+
const s = b(), r = {
|
|
615
620
|
telemetrySdkVersion: y,
|
|
616
621
|
applicationName: this._applicationName,
|
|
617
622
|
applicationSpecifier: this._applicationSpecifier,
|
|
@@ -620,13 +625,13 @@ class T {
|
|
|
620
625
|
data: t,
|
|
621
626
|
responseName: s
|
|
622
627
|
};
|
|
623
|
-
window.parent.postMessage(
|
|
628
|
+
window.parent.postMessage(r, "*");
|
|
624
629
|
let i = !1, l;
|
|
625
630
|
const u = new Promise((h, c) => {
|
|
626
|
-
const d = new Error(`${e} message request with response name of ${s} timed out after ${
|
|
631
|
+
const d = new Error(`${e} message request with response name of ${s} timed out after ${g}`);
|
|
627
632
|
setTimeout(() => {
|
|
628
633
|
i = !0, this.off(s, l), c(d);
|
|
629
|
-
},
|
|
634
|
+
}, g);
|
|
630
635
|
}), a = new Promise((h) => {
|
|
631
636
|
l = (c) => {
|
|
632
637
|
i || h(c);
|
|
@@ -635,8 +640,8 @@ class T {
|
|
|
635
640
|
return Promise.race([u, a]);
|
|
636
641
|
}
|
|
637
642
|
async subscribe(e, t, s) {
|
|
638
|
-
let
|
|
639
|
-
typeof t == "function" ? i = t : (
|
|
643
|
+
let r, i;
|
|
644
|
+
typeof t == "function" ? i = t : (r = t, i = s);
|
|
640
645
|
const l = b(), u = b();
|
|
641
646
|
let a = this._subscriptionNamesBySubjectName.get(e);
|
|
642
647
|
a || (a = [], this._subscriptionNamesBySubjectName.set(e, a)), a.push(l), this._subscriptionNamesByHandler.set(i, l), this.on(l, i);
|
|
@@ -646,27 +651,27 @@ class T {
|
|
|
646
651
|
applicationSpecifier: this._applicationSpecifier,
|
|
647
652
|
applicationInstance: this._applicationInstance,
|
|
648
653
|
name: e,
|
|
649
|
-
data:
|
|
654
|
+
data: r,
|
|
650
655
|
responseName: u,
|
|
651
656
|
subscriptionName: l
|
|
652
657
|
};
|
|
653
658
|
window.parent.postMessage(h, "*");
|
|
654
659
|
let c = !1, d;
|
|
655
|
-
const S = new Promise((_,
|
|
656
|
-
const m = new Error(`${e} subscribe request with subscription name of ${l} and response name of ${u} timed out after ${
|
|
660
|
+
const S = new Promise((_, f) => {
|
|
661
|
+
const m = new Error(`${e} subscribe request with subscription name of ${l} and response name of ${u} timed out after ${g}`);
|
|
657
662
|
setTimeout(() => {
|
|
658
|
-
c = !0, this.off(u, d),
|
|
659
|
-
},
|
|
663
|
+
c = !0, this.off(u, d), f(m);
|
|
664
|
+
}, g);
|
|
660
665
|
}), N = new Promise((_) => {
|
|
661
|
-
d = (
|
|
662
|
-
c || _(
|
|
666
|
+
d = (f) => {
|
|
667
|
+
c || _(f);
|
|
663
668
|
}, this.on(u, _);
|
|
664
669
|
});
|
|
665
670
|
return Promise.race([S, N]);
|
|
666
671
|
}
|
|
667
672
|
async unsubscribe(e, t, s) {
|
|
668
|
-
let
|
|
669
|
-
typeof t == "function" ? i = t : (
|
|
673
|
+
let r, i;
|
|
674
|
+
typeof t == "function" ? i = t : (r = t, i = s);
|
|
670
675
|
const l = b();
|
|
671
676
|
let u = [];
|
|
672
677
|
if (i) {
|
|
@@ -684,21 +689,21 @@ class T {
|
|
|
684
689
|
applicationName: this._applicationName,
|
|
685
690
|
applicationSpecifier: this._applicationSpecifier,
|
|
686
691
|
name: e,
|
|
687
|
-
data:
|
|
692
|
+
data: r,
|
|
688
693
|
responseName: l,
|
|
689
694
|
unsubscribeName: a
|
|
690
695
|
};
|
|
691
696
|
window.parent.postMessage(h, "*");
|
|
692
697
|
let c = !1, d;
|
|
693
|
-
const S = new Promise((
|
|
694
|
-
const I = new Error(`${e} unsubscribe request with unsubscribe name of ${a} and response name of ${l} timed out after ${
|
|
698
|
+
const S = new Promise((f, m) => {
|
|
699
|
+
const I = new Error(`${e} unsubscribe request with unsubscribe name of ${a} and response name of ${l} timed out after ${g}`);
|
|
695
700
|
setTimeout(() => {
|
|
696
701
|
c = !0, this.off(l, d), m(I);
|
|
697
|
-
},
|
|
698
|
-
}), N = new Promise((
|
|
702
|
+
}, g);
|
|
703
|
+
}), N = new Promise((f) => {
|
|
699
704
|
d = (m) => {
|
|
700
|
-
c ||
|
|
701
|
-
}, this.once(l,
|
|
705
|
+
c || f(m);
|
|
706
|
+
}, this.once(l, f);
|
|
702
707
|
});
|
|
703
708
|
if (!(await Promise.race([S, N])).success)
|
|
704
709
|
return { success: !1 };
|
|
@@ -724,8 +729,8 @@ class T {
|
|
|
724
729
|
*/
|
|
725
730
|
on(e, t) {
|
|
726
731
|
var s;
|
|
727
|
-
const
|
|
728
|
-
|
|
732
|
+
const r = (s = this._onHandlers.get(e)) !== null && s !== void 0 ? s : [];
|
|
733
|
+
r.length === 0 && this._onHandlers.set(e, r), r.push(t);
|
|
729
734
|
}
|
|
730
735
|
/**
|
|
731
736
|
* Registers a one-time handler for a specific message type.
|
|
@@ -743,8 +748,8 @@ class T {
|
|
|
743
748
|
*/
|
|
744
749
|
once(e, t) {
|
|
745
750
|
var s;
|
|
746
|
-
const
|
|
747
|
-
|
|
751
|
+
const r = (s = this._onceHandlers.get(e)) !== null && s !== void 0 ? s : [];
|
|
752
|
+
r.length === 0 && this._onceHandlers.set(e, r), r.push(t);
|
|
748
753
|
}
|
|
749
754
|
/**
|
|
750
755
|
* Removes previously registered message handlers.
|
|
@@ -762,17 +767,17 @@ class T {
|
|
|
762
767
|
* all handlers for this message type will be removed.
|
|
763
768
|
*/
|
|
764
769
|
off(e, t) {
|
|
765
|
-
const s = this._onHandlers.get(e),
|
|
766
|
-
if (!(!s && !
|
|
770
|
+
const s = this._onHandlers.get(e), r = this._onceHandlers.get(e);
|
|
771
|
+
if (!(!s && !r)) {
|
|
767
772
|
if (s) {
|
|
768
773
|
for (let i = 0; i < s.length; i += 1)
|
|
769
774
|
t && s[i] !== t || (s.splice(i, 1), i -= 1);
|
|
770
775
|
s.length === 0 && this._onHandlers.delete(e);
|
|
771
776
|
}
|
|
772
|
-
if (
|
|
773
|
-
for (let i = 0; i <
|
|
774
|
-
t &&
|
|
775
|
-
|
|
777
|
+
if (r) {
|
|
778
|
+
for (let i = 0; i < r.length; i += 1)
|
|
779
|
+
t && r[i] !== t || (r.splice(i, 1), i -= 1);
|
|
780
|
+
r.length === 0 && this._onceHandlers.delete(e);
|
|
776
781
|
}
|
|
777
782
|
}
|
|
778
783
|
}
|
|
@@ -785,32 +790,32 @@ let n = null;
|
|
|
785
790
|
function j() {
|
|
786
791
|
return n;
|
|
787
792
|
}
|
|
788
|
-
function
|
|
789
|
-
n = new T(
|
|
793
|
+
function D(o) {
|
|
794
|
+
n = new T(o), n.bind();
|
|
790
795
|
}
|
|
791
796
|
function L() {
|
|
792
797
|
n == null || n.unbind(), n = null;
|
|
793
798
|
}
|
|
794
|
-
function
|
|
795
|
-
return p(n), n.on(...
|
|
799
|
+
function U(...o) {
|
|
800
|
+
return p(n), n.on(...o);
|
|
796
801
|
}
|
|
797
|
-
function
|
|
798
|
-
return p(n), n.once(...
|
|
802
|
+
function x(...o) {
|
|
803
|
+
return p(n), n.once(...o);
|
|
799
804
|
}
|
|
800
|
-
function
|
|
801
|
-
return p(n), n.off(...
|
|
805
|
+
function V(...o) {
|
|
806
|
+
return p(n), n.off(...o);
|
|
802
807
|
}
|
|
803
|
-
function
|
|
804
|
-
return p(n), n.send(...
|
|
808
|
+
function z(...o) {
|
|
809
|
+
return p(n), n.send(...o);
|
|
805
810
|
}
|
|
806
|
-
function K(...
|
|
807
|
-
return p(n), n.request(...
|
|
811
|
+
function K(...o) {
|
|
812
|
+
return p(n), n.request(...o);
|
|
808
813
|
}
|
|
809
|
-
function G(...
|
|
810
|
-
return p(n), n.subscribe(...
|
|
814
|
+
function G(...o) {
|
|
815
|
+
return p(n), n.subscribe(...o);
|
|
811
816
|
}
|
|
812
|
-
function J(...
|
|
813
|
-
return p(n), n.unsubscribe(...
|
|
817
|
+
function J(...o) {
|
|
818
|
+
return p(n), n.unsubscribe(...o);
|
|
814
819
|
}
|
|
815
820
|
function Q() {
|
|
816
821
|
return p(n), n.store;
|
|
@@ -830,8 +835,8 @@ function Z() {
|
|
|
830
835
|
function O() {
|
|
831
836
|
return p(n), n.rootSettingsNavigation;
|
|
832
837
|
}
|
|
833
|
-
function p(
|
|
834
|
-
if (!
|
|
838
|
+
function p(o) {
|
|
839
|
+
if (!o)
|
|
835
840
|
throw new Error("SDK is not configured");
|
|
836
841
|
}
|
|
837
842
|
export {
|
|
@@ -844,16 +849,16 @@ export {
|
|
|
844
849
|
E as Users,
|
|
845
850
|
Y as accounts,
|
|
846
851
|
W as applications,
|
|
847
|
-
|
|
852
|
+
D as configure,
|
|
848
853
|
L as destroy,
|
|
849
854
|
j as globalClient,
|
|
850
855
|
X as media,
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
856
|
+
V as off,
|
|
857
|
+
U as on,
|
|
858
|
+
x as once,
|
|
854
859
|
K as request,
|
|
855
860
|
O as rootSettingsNavigation,
|
|
856
|
-
|
|
861
|
+
z as send,
|
|
857
862
|
Q as store,
|
|
858
863
|
G as subscribe,
|
|
859
864
|
y as telemetrySdkVersion,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telemetryos/root-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.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",
|