@nextera.one/axis-server-sdk 2.3.15 → 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,
@@ -3211,9 +3232,11 @@ var init_intent_router = __esm({
3211
3232
  if (contract) {
3212
3233
  this.intentContracts.set(intent, contract);
3213
3234
  }
3235
+ const inlineRequiredProof = normalizeRequiredProof(meta?.requiredProof);
3214
3236
  const proofPolicy = resolveIntentProofPolicy(proto, methodName);
3215
- if (proofPolicy.requiredProof.length > 0) {
3216
- this.intentRequiredProof.set(intent, proofPolicy.requiredProof);
3237
+ const requiredProof = inlineRequiredProof ?? proofPolicy.requiredProof;
3238
+ if (requiredProof.length > 0) {
3239
+ this.intentRequiredProof.set(intent, requiredProof);
3217
3240
  }
3218
3241
  const rateLimit = Reflect.getMetadata(
3219
3242
  AXIS_RATE_LIMIT_KEY,