@nextera.one/axis-server-sdk 2.3.14 → 2.3.16

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.
@@ -450,6 +450,13 @@ var init_capsule_policy_decorator = __esm({
450
450
 
451
451
  // src/decorators/intent-policy.decorator.ts
452
452
  import "reflect-metadata";
453
+ function normalizeRequiredProof(proofs) {
454
+ if (proofs === void 0) return void 0;
455
+ const normalized = Array.from(
456
+ new Set(Array.isArray(proofs) ? proofs : [proofs])
457
+ );
458
+ return normalized.length > 0 ? normalized : void 0;
459
+ }
453
460
  function appendRequiredProof(target, propertyKey, proof) {
454
461
  const existing = propertyKey !== void 0 ? Reflect.getMetadata(
455
462
  REQUIRED_PROOF_METADATA_KEY,
@@ -698,7 +705,12 @@ function toIntentSensorBinding(input) {
698
705
  }
699
706
  function Intent(action, options) {
700
707
  return (target, propertyKey) => {
701
- const metadata = { intent: action, ...options };
708
+ const requiredProof = normalizeRequiredProof(options?.requiredProof);
709
+ const metadata = {
710
+ intent: action,
711
+ ...options,
712
+ ...requiredProof ? { requiredProof } : {}
713
+ };
702
714
  Reflect.defineMetadata(INTENT_METADATA_KEY, metadata, target, propertyKey);
703
715
  if (options?.decoder) {
704
716
  Reflect.defineMetadata(
@@ -716,6 +728,14 @@ function Intent(action, options) {
716
728
  propertyKey
717
729
  );
718
730
  }
731
+ if (requiredProof) {
732
+ Reflect.defineMetadata(
733
+ REQUIRED_PROOF_METADATA_KEY,
734
+ requiredProof,
735
+ target,
736
+ propertyKey
737
+ );
738
+ }
719
739
  const routes = Reflect.getMetadata(INTENT_ROUTES_KEY, target.constructor) || [];
720
740
  routes.push({
721
741
  action,
@@ -724,6 +744,7 @@ function Intent(action, options) {
724
744
  frame: options?.frame,
725
745
  kind: options?.kind,
726
746
  sensitivity: options?.sensitivity,
747
+ requiredProof,
727
748
  chain: options?.chain,
728
749
  bodyProfile: options?.bodyProfile,
729
750
  tlv: options?.tlv,
@@ -2803,6 +2824,15 @@ var init_intent_router = __esm({
2803
2824
  const resolved = this.resolveIntentAlias(intent);
2804
2825
  return this.handlers.has(resolved) || isBuiltinIntent(resolved);
2805
2826
  }
2827
+ /**
2828
+ * True only when the application registered a concrete handler.
2829
+ * Unlike `has()`, this intentionally ignores SDK built-in fallbacks so
2830
+ * discovery layers can override simple built-ins such as `system.ping`.
2831
+ */
2832
+ hasRegisteredHandler(intent) {
2833
+ const resolved = this.resolveIntentAlias(intent);
2834
+ return this.handlers.has(resolved);
2835
+ }
2806
2836
  getRegisteredIntents() {
2807
2837
  return [...BUILTIN_INTENTS, ...this.handlers.keys()];
2808
2838
  }
@@ -3202,9 +3232,11 @@ var init_intent_router = __esm({
3202
3232
  if (contract) {
3203
3233
  this.intentContracts.set(intent, contract);
3204
3234
  }
3235
+ const inlineRequiredProof = normalizeRequiredProof(meta?.requiredProof);
3205
3236
  const proofPolicy = resolveIntentProofPolicy(proto, methodName);
3206
- if (proofPolicy.requiredProof.length > 0) {
3207
- this.intentRequiredProof.set(intent, proofPolicy.requiredProof);
3237
+ const requiredProof = inlineRequiredProof ?? proofPolicy.requiredProof;
3238
+ if (requiredProof.length > 0) {
3239
+ this.intentRequiredProof.set(intent, requiredProof);
3208
3240
  }
3209
3241
  const rateLimit = Reflect.getMetadata(
3210
3242
  AXIS_RATE_LIMIT_KEY,