@nextera.one/axis-server-sdk 2.3.13 → 2.3.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{index-B0HcQRif.d.ts → index-Dd-WVBj9.d.ts} +1 -0
- package/dist/{index-C5NXMEth.d.mts → index-ogUOoBI-.d.mts} +1 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +27 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +27 -10
- package/dist/index.mjs.map +1 -1
- package/dist/sensors/index.d.mts +1 -1
- package/dist/sensors/index.d.ts +1 -1
- package/dist/sensors/index.js +27 -10
- package/dist/sensors/index.js.map +1 -1
- package/dist/sensors/index.mjs +27 -10
- package/dist/sensors/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2659,6 +2659,15 @@ var init_intent_router = __esm({
|
|
|
2659
2659
|
const resolved = this.resolveIntentAlias(intent);
|
|
2660
2660
|
return this.handlers.has(resolved) || isBuiltinIntent(resolved);
|
|
2661
2661
|
}
|
|
2662
|
+
/**
|
|
2663
|
+
* True only when the application registered a concrete handler.
|
|
2664
|
+
* Unlike `has()`, this intentionally ignores SDK built-in fallbacks so
|
|
2665
|
+
* discovery layers can override simple built-ins such as `system.ping`.
|
|
2666
|
+
*/
|
|
2667
|
+
hasRegisteredHandler(intent) {
|
|
2668
|
+
const resolved = this.resolveIntentAlias(intent);
|
|
2669
|
+
return this.handlers.has(resolved);
|
|
2670
|
+
}
|
|
2662
2671
|
getRegisteredIntents() {
|
|
2663
2672
|
return [...BUILTIN_INTENTS, ...this.handlers.keys()];
|
|
2664
2673
|
}
|
|
@@ -2778,9 +2787,14 @@ var init_intent_router = __esm({
|
|
|
2778
2787
|
* Routes a decoded AXIS frame to the appropriate handler.
|
|
2779
2788
|
*
|
|
2780
2789
|
* **Precedence:**
|
|
2781
|
-
* 1.
|
|
2782
|
-
* 2.
|
|
2783
|
-
* 3.
|
|
2790
|
+
* 1. SDK meta-intents (`CHAIN.EXEC`, `INTENT.EXEC`)
|
|
2791
|
+
* 2. Dynamically registered handlers from modules
|
|
2792
|
+
* 3. Simple SDK built-in fallback (`system.ping`, `public.ping`, `system.time`, `system.echo`)
|
|
2793
|
+
*
|
|
2794
|
+
* Registered app handlers intentionally win over simple built-ins. This lets
|
|
2795
|
+
* applications attach sensors, rate limits, and custom responses to intents
|
|
2796
|
+
* like `system.ping` while keeping a default fallback for apps that do not
|
|
2797
|
+
* register their own handler.
|
|
2784
2798
|
*
|
|
2785
2799
|
* @param {AxisFrame} frame - The validated and decoded binary frame
|
|
2786
2800
|
* @returns {Promise<AxisEffect>} The resulting effect of the execution
|
|
@@ -2834,6 +2848,16 @@ var init_intent_router = __esm({
|
|
|
2834
2848
|
* This keeps route() focused on observer/error lifecycle concerns.
|
|
2835
2849
|
*/
|
|
2836
2850
|
async routeResolvedIntent(intent, frame) {
|
|
2851
|
+
if (isChainExecIntent(intent)) {
|
|
2852
|
+
const chainRequest = this.parseChainRequestBody(frame.body);
|
|
2853
|
+
return this.executeChainRequest(frame, chainRequest);
|
|
2854
|
+
}
|
|
2855
|
+
if (isIntentExecIntent(intent)) {
|
|
2856
|
+
return this.routeIntentExec(frame);
|
|
2857
|
+
}
|
|
2858
|
+
if (this.handlers.has(intent)) {
|
|
2859
|
+
return this.routeRegisteredIntent(intent, frame);
|
|
2860
|
+
}
|
|
2837
2861
|
const builtinEffect = routeSystemBuiltinIntent(
|
|
2838
2862
|
intent,
|
|
2839
2863
|
frame.body,
|
|
@@ -2845,13 +2869,6 @@ var init_intent_router = __esm({
|
|
|
2845
2869
|
}
|
|
2846
2870
|
return builtinEffect;
|
|
2847
2871
|
}
|
|
2848
|
-
if (isChainExecIntent(intent)) {
|
|
2849
|
-
const chainRequest = this.parseChainRequestBody(frame.body);
|
|
2850
|
-
return this.executeChainRequest(frame, chainRequest);
|
|
2851
|
-
}
|
|
2852
|
-
if (isIntentExecIntent(intent)) {
|
|
2853
|
-
return this.routeIntentExec(frame);
|
|
2854
|
-
}
|
|
2855
2872
|
return this.routeRegisteredIntent(intent, frame);
|
|
2856
2873
|
}
|
|
2857
2874
|
/**
|