@nextera.one/axis-server-sdk 2.2.2 → 2.2.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/dist/{index-B2G6cbRL.d.mts → index-C4ApiXHX.d.mts} +38 -25
- package/dist/{index-DbSxdR0f.d.ts → index-QGwgvVDY.d.ts} +38 -25
- package/dist/index.d.mts +9 -23
- package/dist/index.d.ts +9 -23
- package/dist/index.js +163 -196
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +159 -198
- 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 +161 -190
- package/dist/sensors/index.js.map +1 -1
- package/dist/sensors/index.mjs +157 -186
- package/dist/sensors/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -267,17 +267,76 @@ var init_intent_policy_decorator = __esm({
|
|
|
267
267
|
}
|
|
268
268
|
});
|
|
269
269
|
|
|
270
|
-
// src/decorators/handler.decorator.ts
|
|
271
|
-
function
|
|
270
|
+
// src/decorators/handler-sensors.decorator.ts
|
|
271
|
+
function HandlerSensors(sensors) {
|
|
272
272
|
return (target) => {
|
|
273
|
-
Reflect.defineMetadata(
|
|
273
|
+
Reflect.defineMetadata(HANDLER_SENSORS_KEY, sensors, target);
|
|
274
274
|
};
|
|
275
275
|
}
|
|
276
|
-
var import_reflect_metadata4,
|
|
277
|
-
var
|
|
278
|
-
"src/decorators/handler.decorator.ts"() {
|
|
276
|
+
var import_reflect_metadata4, HANDLER_SENSORS_KEY;
|
|
277
|
+
var init_handler_sensors_decorator = __esm({
|
|
278
|
+
"src/decorators/handler-sensors.decorator.ts"() {
|
|
279
279
|
import_reflect_metadata4 = require("reflect-metadata");
|
|
280
|
-
|
|
280
|
+
HANDLER_SENSORS_KEY = "axis:handler:sensors";
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
// src/decorators/observer.decorator.ts
|
|
285
|
+
function isBindingOptions(value) {
|
|
286
|
+
return !!value && typeof value === "object" && "use" in value;
|
|
287
|
+
}
|
|
288
|
+
function isDefinitionOptions(value) {
|
|
289
|
+
return !!value && typeof value === "object" && !Array.isArray(value) && !isBindingOptions(value);
|
|
290
|
+
}
|
|
291
|
+
function toObserverBinding(input) {
|
|
292
|
+
if (!input) return null;
|
|
293
|
+
if (isBindingOptions(input)) {
|
|
294
|
+
const refs = Array.isArray(input.use) ? input.use : [input.use];
|
|
295
|
+
return { refs, tags: input.tags, events: input.events };
|
|
296
|
+
}
|
|
297
|
+
if (Array.isArray(input)) {
|
|
298
|
+
return { refs: input };
|
|
299
|
+
}
|
|
300
|
+
if (typeof input === "function" || typeof input === "string") {
|
|
301
|
+
return { refs: [input] };
|
|
302
|
+
}
|
|
303
|
+
return null;
|
|
304
|
+
}
|
|
305
|
+
function Observer(input) {
|
|
306
|
+
return ((target, propertyKey) => {
|
|
307
|
+
const binding = toObserverBinding(input);
|
|
308
|
+
if (binding) {
|
|
309
|
+
if (propertyKey !== void 0) {
|
|
310
|
+
const existing2 = Reflect.getMetadata(OBSERVER_BINDINGS_KEY, target, propertyKey) || [];
|
|
311
|
+
existing2.push(binding);
|
|
312
|
+
Reflect.defineMetadata(
|
|
313
|
+
OBSERVER_BINDINGS_KEY,
|
|
314
|
+
existing2,
|
|
315
|
+
target,
|
|
316
|
+
propertyKey
|
|
317
|
+
);
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
320
|
+
const existing = Reflect.getMetadata(OBSERVER_BINDINGS_KEY, target) || [];
|
|
321
|
+
existing.push(binding);
|
|
322
|
+
Reflect.defineMetadata(OBSERVER_BINDINGS_KEY, existing, target);
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
if (propertyKey !== void 0) {
|
|
326
|
+
throw new Error(
|
|
327
|
+
"@Observer method usage must reference one or more observer classes or names"
|
|
328
|
+
);
|
|
329
|
+
}
|
|
330
|
+
const definition = isDefinitionOptions(input) ? input : {};
|
|
331
|
+
Reflect.defineMetadata(OBSERVER_METADATA_KEY, definition, target);
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
var import_reflect_metadata5, OBSERVER_METADATA_KEY, OBSERVER_BINDINGS_KEY;
|
|
335
|
+
var init_observer_decorator = __esm({
|
|
336
|
+
"src/decorators/observer.decorator.ts"() {
|
|
337
|
+
import_reflect_metadata5 = require("reflect-metadata");
|
|
338
|
+
OBSERVER_METADATA_KEY = "axis:observer";
|
|
339
|
+
OBSERVER_BINDINGS_KEY = "axis:observer:bindings";
|
|
281
340
|
}
|
|
282
341
|
});
|
|
283
342
|
|
|
@@ -287,15 +346,30 @@ function IntentBody(decoder) {
|
|
|
287
346
|
Reflect.defineMetadata(INTENT_BODY_KEY, decoder, target, propertyKey);
|
|
288
347
|
};
|
|
289
348
|
}
|
|
290
|
-
var
|
|
349
|
+
var import_reflect_metadata6, INTENT_BODY_KEY;
|
|
291
350
|
var init_intent_body_decorator = __esm({
|
|
292
351
|
"src/decorators/intent-body.decorator.ts"() {
|
|
293
|
-
|
|
352
|
+
import_reflect_metadata6 = require("reflect-metadata");
|
|
294
353
|
INTENT_BODY_KEY = "axis:intent:body";
|
|
295
354
|
}
|
|
296
355
|
});
|
|
297
356
|
|
|
298
357
|
// src/decorators/intent.decorator.ts
|
|
358
|
+
function isIntentSensorBindingOptions(value) {
|
|
359
|
+
return !!value && typeof value === "object" && !Array.isArray(value) && "use" in value;
|
|
360
|
+
}
|
|
361
|
+
function toIntentSensorBinding(input) {
|
|
362
|
+
if (isIntentSensorBindingOptions(input)) {
|
|
363
|
+
return {
|
|
364
|
+
ref: input.use,
|
|
365
|
+
when: input.when || "before"
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
return {
|
|
369
|
+
ref: input,
|
|
370
|
+
when: "before"
|
|
371
|
+
};
|
|
372
|
+
}
|
|
299
373
|
function Intent(action, options) {
|
|
300
374
|
return (target, propertyKey) => {
|
|
301
375
|
const metadata = { intent: action, ...options };
|
|
@@ -333,10 +407,10 @@ function Intent(action, options) {
|
|
|
333
407
|
Reflect.defineMetadata(INTENT_ROUTES_KEY, routes, target.constructor);
|
|
334
408
|
};
|
|
335
409
|
}
|
|
336
|
-
var
|
|
410
|
+
var import_reflect_metadata7, INTENT_METADATA_KEY, INTENT_ROUTES_KEY;
|
|
337
411
|
var init_intent_decorator = __esm({
|
|
338
412
|
"src/decorators/intent.decorator.ts"() {
|
|
339
|
-
|
|
413
|
+
import_reflect_metadata7 = require("reflect-metadata");
|
|
340
414
|
init_intent_body_decorator();
|
|
341
415
|
init_intent_policy_decorator();
|
|
342
416
|
INTENT_METADATA_KEY = "axis:intent";
|
|
@@ -344,90 +418,62 @@ var init_intent_decorator = __esm({
|
|
|
344
418
|
}
|
|
345
419
|
});
|
|
346
420
|
|
|
347
|
-
// src/decorators/
|
|
348
|
-
function
|
|
349
|
-
return (target
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
if (isBindingOptions(input)) {
|
|
371
|
-
const refs = Array.isArray(input.use) ? input.use : [input.use];
|
|
372
|
-
return { refs, tags: input.tags, events: input.events };
|
|
373
|
-
}
|
|
374
|
-
if (Array.isArray(input)) {
|
|
375
|
-
return { refs: input };
|
|
376
|
-
}
|
|
377
|
-
if (typeof input === "function" || typeof input === "string") {
|
|
378
|
-
return { refs: [input] };
|
|
379
|
-
}
|
|
380
|
-
return null;
|
|
381
|
-
}
|
|
382
|
-
function Observer(input) {
|
|
383
|
-
return ((target, propertyKey) => {
|
|
384
|
-
const binding = toBinding(input);
|
|
385
|
-
if (binding) {
|
|
386
|
-
if (propertyKey !== void 0) {
|
|
387
|
-
const existing2 = Reflect.getMetadata(OBSERVER_BINDINGS_KEY, target, propertyKey) || [];
|
|
388
|
-
existing2.push(binding);
|
|
389
|
-
Reflect.defineMetadata(
|
|
390
|
-
OBSERVER_BINDINGS_KEY,
|
|
391
|
-
existing2,
|
|
392
|
-
target,
|
|
393
|
-
propertyKey
|
|
394
|
-
);
|
|
395
|
-
return;
|
|
396
|
-
}
|
|
397
|
-
const existing = Reflect.getMetadata(OBSERVER_BINDINGS_KEY, target) || [];
|
|
398
|
-
existing.push(binding);
|
|
399
|
-
Reflect.defineMetadata(OBSERVER_BINDINGS_KEY, existing, target);
|
|
400
|
-
return;
|
|
421
|
+
// src/decorators/handler.decorator.ts
|
|
422
|
+
function Handler(intentOrOptions, options) {
|
|
423
|
+
return (target) => {
|
|
424
|
+
const intent = typeof intentOrOptions === "string" ? intentOrOptions : void 0;
|
|
425
|
+
const handlerOptions = typeof intentOrOptions === "string" ? options : intentOrOptions;
|
|
426
|
+
const sensorBindings = Array.isArray(handlerOptions?.is) ? handlerOptions.is.map(
|
|
427
|
+
(input) => toIntentSensorBinding(input)
|
|
428
|
+
) : [];
|
|
429
|
+
const observerBindings = Array.isArray(
|
|
430
|
+
handlerOptions?.observe
|
|
431
|
+
) ? handlerOptions.observe.map((input) => toObserverBinding(input)).filter((binding) => !!binding) : [];
|
|
432
|
+
Reflect.defineMetadata(
|
|
433
|
+
HANDLER_METADATA_KEY,
|
|
434
|
+
{ intent, ...handlerOptions || {} },
|
|
435
|
+
target
|
|
436
|
+
);
|
|
437
|
+
if (sensorBindings.length > 0) {
|
|
438
|
+
const existing = Reflect.getMetadata(HANDLER_SENSORS_KEY, target) || [];
|
|
439
|
+
Reflect.defineMetadata(
|
|
440
|
+
HANDLER_SENSORS_KEY,
|
|
441
|
+
[...existing, ...sensorBindings],
|
|
442
|
+
target
|
|
443
|
+
);
|
|
401
444
|
}
|
|
402
|
-
if (
|
|
403
|
-
|
|
404
|
-
|
|
445
|
+
if (observerBindings.length > 0) {
|
|
446
|
+
const existing = Reflect.getMetadata(OBSERVER_BINDINGS_KEY, target) || [];
|
|
447
|
+
Reflect.defineMetadata(
|
|
448
|
+
OBSERVER_BINDINGS_KEY,
|
|
449
|
+
[...existing, ...observerBindings],
|
|
450
|
+
target
|
|
405
451
|
);
|
|
406
452
|
}
|
|
407
|
-
|
|
408
|
-
Reflect.defineMetadata(OBSERVER_METADATA_KEY, definition, target);
|
|
409
|
-
});
|
|
453
|
+
};
|
|
410
454
|
}
|
|
411
|
-
var import_reflect_metadata8,
|
|
412
|
-
var
|
|
413
|
-
"src/decorators/
|
|
455
|
+
var import_reflect_metadata8, HANDLER_METADATA_KEY;
|
|
456
|
+
var init_handler_decorator = __esm({
|
|
457
|
+
"src/decorators/handler.decorator.ts"() {
|
|
414
458
|
import_reflect_metadata8 = require("reflect-metadata");
|
|
415
|
-
|
|
416
|
-
|
|
459
|
+
init_handler_sensors_decorator();
|
|
460
|
+
init_observer_decorator();
|
|
461
|
+
init_intent_decorator();
|
|
462
|
+
HANDLER_METADATA_KEY = "axis:handler";
|
|
417
463
|
}
|
|
418
464
|
});
|
|
419
465
|
|
|
420
|
-
// src/decorators/
|
|
421
|
-
function
|
|
422
|
-
return (target) => {
|
|
423
|
-
Reflect.defineMetadata(
|
|
466
|
+
// src/decorators/intent-sensors.decorator.ts
|
|
467
|
+
function IntentSensors(sensors) {
|
|
468
|
+
return (target, propertyKey) => {
|
|
469
|
+
Reflect.defineMetadata(INTENT_SENSORS_KEY, sensors, target, propertyKey);
|
|
424
470
|
};
|
|
425
471
|
}
|
|
426
|
-
var import_reflect_metadata9,
|
|
427
|
-
var
|
|
428
|
-
"src/decorators/
|
|
472
|
+
var import_reflect_metadata9, INTENT_SENSORS_KEY;
|
|
473
|
+
var init_intent_sensors_decorator = __esm({
|
|
474
|
+
"src/decorators/intent-sensors.decorator.ts"() {
|
|
429
475
|
import_reflect_metadata9 = require("reflect-metadata");
|
|
430
|
-
|
|
476
|
+
INTENT_SENSORS_KEY = "axis:intent:sensors";
|
|
431
477
|
}
|
|
432
478
|
});
|
|
433
479
|
|
|
@@ -450,92 +496,6 @@ var init_sensor_decorator = __esm({
|
|
|
450
496
|
}
|
|
451
497
|
});
|
|
452
498
|
|
|
453
|
-
// src/decorators/priority-order.decorator.ts
|
|
454
|
-
var require_priority_order_decorator = __commonJS({
|
|
455
|
-
"src/decorators/priority-order.decorator.ts"(exports2) {
|
|
456
|
-
"use strict";
|
|
457
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
458
|
-
exports2.priorityOrder = exports2.PRIORITY_ORDER_METADATA_KEY = void 0;
|
|
459
|
-
exports2.getPriorityOrder = getPriorityOrder2;
|
|
460
|
-
exports2.comparePriorityOrder = comparePriorityOrder2;
|
|
461
|
-
exports2.getPriorityOrderedTargets = getPriorityOrderedTargets2;
|
|
462
|
-
exports2.PriorityOrder = PriorityOrder2;
|
|
463
|
-
require("reflect-metadata");
|
|
464
|
-
exports2.PRIORITY_ORDER_METADATA_KEY = "axis:priority-order";
|
|
465
|
-
var PRIORITY_ORDER_WEIGHT = {
|
|
466
|
-
HIGH: 0,
|
|
467
|
-
MEDIUM: 1,
|
|
468
|
-
LOW: 2
|
|
469
|
-
};
|
|
470
|
-
var priorityOrderRegistry = /* @__PURE__ */ new Set();
|
|
471
|
-
function normalizePriority(priority) {
|
|
472
|
-
const normalized = String(priority).toUpperCase();
|
|
473
|
-
if (normalized === "HIGH" || normalized === "MEDIUM" || normalized === "LOW") {
|
|
474
|
-
return normalized;
|
|
475
|
-
}
|
|
476
|
-
throw new Error(`@PriorityOrder() received invalid priority "${String(priority)}"`);
|
|
477
|
-
}
|
|
478
|
-
function normalizeOrder(order) {
|
|
479
|
-
if (typeof order !== "number" || !Number.isInteger(order) || !Number.isFinite(order) || order < 0) {
|
|
480
|
-
throw new Error(`@PriorityOrder() requires a non-negative integer order, received "${String(order)}"`);
|
|
481
|
-
}
|
|
482
|
-
return order;
|
|
483
|
-
}
|
|
484
|
-
function isPriorityOrderOptions(value) {
|
|
485
|
-
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
486
|
-
}
|
|
487
|
-
function resolvePriorityOrder(priorityOrOptions, order = 0) {
|
|
488
|
-
if (isPriorityOrderOptions(priorityOrOptions)) {
|
|
489
|
-
return {
|
|
490
|
-
priority: normalizePriority(priorityOrOptions.priority ?? "MEDIUM"),
|
|
491
|
-
order: normalizeOrder(priorityOrOptions.order ?? 0)
|
|
492
|
-
};
|
|
493
|
-
}
|
|
494
|
-
return {
|
|
495
|
-
priority: normalizePriority(priorityOrOptions ?? "MEDIUM"),
|
|
496
|
-
order: normalizeOrder(order)
|
|
497
|
-
};
|
|
498
|
-
}
|
|
499
|
-
function getPriorityOrder2(target) {
|
|
500
|
-
return Reflect.getMetadata(exports2.PRIORITY_ORDER_METADATA_KEY, target) ?? null;
|
|
501
|
-
}
|
|
502
|
-
function comparePriorityOrder2(left, right) {
|
|
503
|
-
const priorityDelta = PRIORITY_ORDER_WEIGHT[left.priority] - PRIORITY_ORDER_WEIGHT[right.priority];
|
|
504
|
-
if (priorityDelta !== 0) {
|
|
505
|
-
return priorityDelta;
|
|
506
|
-
}
|
|
507
|
-
return left.order - right.order;
|
|
508
|
-
}
|
|
509
|
-
function getPriorityOrderedTargets2(targets) {
|
|
510
|
-
const pool = targets ? Array.from(targets) : Array.from(priorityOrderRegistry);
|
|
511
|
-
return pool.sort((left, right) => {
|
|
512
|
-
const leftMeta = getPriorityOrder2(left);
|
|
513
|
-
const rightMeta = getPriorityOrder2(right);
|
|
514
|
-
if (!leftMeta && !rightMeta) {
|
|
515
|
-
return (left.name || "").localeCompare(right.name || "");
|
|
516
|
-
}
|
|
517
|
-
if (!leftMeta)
|
|
518
|
-
return 1;
|
|
519
|
-
if (!rightMeta)
|
|
520
|
-
return -1;
|
|
521
|
-
const ordered = comparePriorityOrder2(leftMeta, rightMeta);
|
|
522
|
-
if (ordered !== 0) {
|
|
523
|
-
return ordered;
|
|
524
|
-
}
|
|
525
|
-
return (left.name || "").localeCompare(right.name || "");
|
|
526
|
-
});
|
|
527
|
-
}
|
|
528
|
-
function PriorityOrder2(priorityOrOptions, order = 0) {
|
|
529
|
-
const definition = resolvePriorityOrder(priorityOrOptions, order);
|
|
530
|
-
return (target) => {
|
|
531
|
-
Reflect.defineMetadata(exports2.PRIORITY_ORDER_METADATA_KEY, definition, target);
|
|
532
|
-
priorityOrderRegistry.add(target);
|
|
533
|
-
};
|
|
534
|
-
}
|
|
535
|
-
exports2.priorityOrder = PriorityOrder2;
|
|
536
|
-
}
|
|
537
|
-
});
|
|
538
|
-
|
|
539
499
|
// src/decorators/tlv-field.decorator.ts
|
|
540
500
|
var require_tlv_field_decorator = __commonJS({
|
|
541
501
|
"src/decorators/tlv-field.decorator.ts"(exports2) {
|
|
@@ -2340,15 +2300,19 @@ function observerRefKey(ref) {
|
|
|
2340
2300
|
function sensorRefKey(ref) {
|
|
2341
2301
|
return typeof ref === "string" ? ref : ref.name;
|
|
2342
2302
|
}
|
|
2343
|
-
function
|
|
2303
|
+
function sensorBindingKey(binding) {
|
|
2304
|
+
return `${binding.when}:${sensorRefKey(binding.ref)}`;
|
|
2305
|
+
}
|
|
2306
|
+
function mergeIntentSensorBindings(...sensorGroups) {
|
|
2344
2307
|
const merged = /* @__PURE__ */ new Map();
|
|
2345
2308
|
for (const group of sensorGroups) {
|
|
2346
2309
|
if (!Array.isArray(group)) continue;
|
|
2347
|
-
for (const
|
|
2348
|
-
const
|
|
2310
|
+
for (const input of group) {
|
|
2311
|
+
const binding = toIntentSensorBinding(input);
|
|
2312
|
+
const key = sensorBindingKey(binding);
|
|
2349
2313
|
const existing = merged.get(key);
|
|
2350
|
-
if (!existing || typeof existing === "string" && typeof ref !== "string") {
|
|
2351
|
-
merged.set(key,
|
|
2314
|
+
if (!existing || typeof existing.ref === "string" && typeof binding.ref !== "string") {
|
|
2315
|
+
merged.set(key, binding);
|
|
2352
2316
|
}
|
|
2353
2317
|
}
|
|
2354
2318
|
}
|
|
@@ -2652,9 +2616,9 @@ var init_intent_router = __esm({
|
|
|
2652
2616
|
if (!handler) {
|
|
2653
2617
|
throw new Error(`Intent not found: ${intent}`);
|
|
2654
2618
|
}
|
|
2655
|
-
const
|
|
2656
|
-
if (
|
|
2657
|
-
await this.runIntentSensors(
|
|
2619
|
+
const sensorBindings = this.intentSensors.get(intent);
|
|
2620
|
+
if (sensorBindings && sensorBindings.length > 0) {
|
|
2621
|
+
await this.runIntentSensors(sensorBindings, intent, frame, "before");
|
|
2658
2622
|
}
|
|
2659
2623
|
const decoder = this.intentDecoders.get(intent);
|
|
2660
2624
|
let decodedBody = frame.body;
|
|
@@ -2696,6 +2660,12 @@ var init_intent_router = __esm({
|
|
|
2696
2660
|
);
|
|
2697
2661
|
}
|
|
2698
2662
|
}
|
|
2663
|
+
if (sensorBindings && sensorBindings.length > 0) {
|
|
2664
|
+
await this.runIntentSensors(sensorBindings, intent, frame, "after", {
|
|
2665
|
+
decodedBody,
|
|
2666
|
+
effect
|
|
2667
|
+
});
|
|
2668
|
+
}
|
|
2699
2669
|
}
|
|
2700
2670
|
await this.emitIntentObservers(observerBindings, {
|
|
2701
2671
|
event: "intent.completed",
|
|
@@ -2739,7 +2709,7 @@ var init_intent_router = __esm({
|
|
|
2739
2709
|
methodName
|
|
2740
2710
|
);
|
|
2741
2711
|
const meta = Reflect.getMetadata(INTENT_METADATA_KEY, proto, methodName);
|
|
2742
|
-
const combined =
|
|
2712
|
+
const combined = mergeIntentSensorBindings(
|
|
2743
2713
|
handlerSensors,
|
|
2744
2714
|
Array.isArray(intentSensors) ? intentSensors : void 0,
|
|
2745
2715
|
Array.isArray(meta?.is) ? meta.is : void 0
|
|
@@ -2881,8 +2851,10 @@ var init_intent_router = __esm({
|
|
|
2881
2851
|
if (!this.observerDispatcher || bindings.length === 0) return;
|
|
2882
2852
|
await this.observerDispatcher.dispatch(bindings, context);
|
|
2883
2853
|
}
|
|
2884
|
-
async runIntentSensors(
|
|
2885
|
-
for (const
|
|
2854
|
+
async runIntentSensors(sensorBindings, intent, frame, stage, extras) {
|
|
2855
|
+
for (const binding of sensorBindings) {
|
|
2856
|
+
if (binding.when !== stage && binding.when !== "both") continue;
|
|
2857
|
+
const sensorRef = binding.ref;
|
|
2886
2858
|
const sensor = this.resolveIntentSensor(sensorRef);
|
|
2887
2859
|
const sensorName = sensorRefKey(sensorRef);
|
|
2888
2860
|
if (!sensor) {
|
|
@@ -2899,9 +2871,12 @@ var init_intent_router = __esm({
|
|
|
2899
2871
|
frameBody: frame.body,
|
|
2900
2872
|
metadata: {
|
|
2901
2873
|
phase: "intent",
|
|
2874
|
+
stage,
|
|
2902
2875
|
intent,
|
|
2903
2876
|
schema: this.getSchema(intent),
|
|
2904
|
-
validators: this.getValidators(intent)
|
|
2877
|
+
validators: this.getValidators(intent),
|
|
2878
|
+
decodedBody: extras?.decodedBody,
|
|
2879
|
+
effect: extras?.effect
|
|
2905
2880
|
}
|
|
2906
2881
|
};
|
|
2907
2882
|
if (sensor.supports && !sensor.supports(sensorInput)) continue;
|
|
@@ -12565,7 +12540,6 @@ __export(index_exports, {
|
|
|
12565
12540
|
ObserverDispatcherService: () => ObserverDispatcherService,
|
|
12566
12541
|
ObserverRegistry: () => ObserverRegistry,
|
|
12567
12542
|
PRE_DECODE_BOUNDARY: () => PRE_DECODE_BOUNDARY,
|
|
12568
|
-
PRIORITY_ORDER_METADATA_KEY: () => import_priority_order.PRIORITY_ORDER_METADATA_KEY,
|
|
12569
12543
|
PROOF_CAPABILITIES: () => PROOF_CAPABILITIES,
|
|
12570
12544
|
PROOF_CAPSULE: () => import_axis_protocol2.PROOF_CAPSULE,
|
|
12571
12545
|
PROOF_JWT: () => import_axis_protocol2.PROOF_JWT,
|
|
@@ -12573,7 +12547,6 @@ __export(index_exports, {
|
|
|
12573
12547
|
PROOF_MTLS: () => import_axis_protocol2.PROOF_MTLS,
|
|
12574
12548
|
PROOF_NONE: () => import_axis_protocol2.PROOF_NONE,
|
|
12575
12549
|
PROOF_WITNESS: () => import_axis_protocol2.PROOF_WITNESS,
|
|
12576
|
-
PriorityOrder: () => import_priority_order.PriorityOrder,
|
|
12577
12550
|
ProofType: () => import_axis_protocol2.ProofType,
|
|
12578
12551
|
ProofVerificationService: () => ProofVerificationService,
|
|
12579
12552
|
REQUIRED_PROOF_METADATA_KEY: () => REQUIRED_PROOF_METADATA_KEY,
|
|
@@ -12665,7 +12638,6 @@ __export(index_exports, {
|
|
|
12665
12638
|
canonicalizeObservation: () => canonicalizeObservation,
|
|
12666
12639
|
canonicalizeWrit: () => canonicalizeWrit,
|
|
12667
12640
|
classifyIntent: () => classifyIntent,
|
|
12668
|
-
comparePriorityOrder: () => import_priority_order.comparePriorityOrder,
|
|
12669
12641
|
computeReceiptHash: () => computeReceiptHash,
|
|
12670
12642
|
computeSignaturePayload: () => computeSignaturePayload,
|
|
12671
12643
|
createFabric: () => createFabric,
|
|
@@ -12710,8 +12682,6 @@ __export(index_exports, {
|
|
|
12710
12682
|
getGrantStatus: () => getGrantStatus,
|
|
12711
12683
|
getIrreversibleKnots: () => getIrreversibleKnots,
|
|
12712
12684
|
getPresenceStatus: () => getPresenceStatus,
|
|
12713
|
-
getPriorityOrder: () => import_priority_order.getPriorityOrder,
|
|
12714
|
-
getPriorityOrderedTargets: () => import_priority_order.getPriorityOrderedTargets,
|
|
12715
12685
|
getSignTarget: () => import_axis_protocol5.getSignTarget,
|
|
12716
12686
|
grantCoversAction: () => grantCoversAction,
|
|
12717
12687
|
hasScope: () => hasScope,
|
|
@@ -12736,7 +12706,6 @@ __export(index_exports, {
|
|
|
12736
12706
|
parseAutoClaimEntries: () => parseAutoClaimEntries,
|
|
12737
12707
|
parseScope: () => parseScope,
|
|
12738
12708
|
parseStreamEntries: () => parseStreamEntries,
|
|
12739
|
-
priorityOrder: () => import_priority_order.priorityOrder,
|
|
12740
12709
|
projectAt: () => projectAt,
|
|
12741
12710
|
queryFabric: () => queryFabric,
|
|
12742
12711
|
recordOccurrence: () => recordOccurrence,
|
|
@@ -12753,6 +12722,8 @@ __export(index_exports, {
|
|
|
12753
12722
|
startStage: () => startStage,
|
|
12754
12723
|
tieKnot: () => tieKnot,
|
|
12755
12724
|
tlv: () => tlv,
|
|
12725
|
+
toIntentSensorBinding: () => toIntentSensorBinding,
|
|
12726
|
+
toObserverBinding: () => toObserverBinding,
|
|
12756
12727
|
u64be: () => u64be,
|
|
12757
12728
|
unpackPasskeyLoginOptionsReq: () => unpackPasskeyLoginOptionsReq,
|
|
12758
12729
|
unpackPasskeyLoginVerifyReq: () => unpackPasskeyLoginVerifyReq,
|
|
@@ -12774,7 +12745,7 @@ __export(index_exports, {
|
|
|
12774
12745
|
withAxisExecutionContext: () => withAxisExecutionContext
|
|
12775
12746
|
});
|
|
12776
12747
|
module.exports = __toCommonJS(index_exports);
|
|
12777
|
-
var
|
|
12748
|
+
var import_tlv_field2, import_dto_schema2, import_axis_id, import_axis_response;
|
|
12778
12749
|
var init_index = __esm({
|
|
12779
12750
|
"src/index.ts"() {
|
|
12780
12751
|
init_chain_decorator();
|
|
@@ -12785,9 +12756,9 @@ var init_index = __esm({
|
|
|
12785
12756
|
init_intent_body_decorator();
|
|
12786
12757
|
init_intent_sensors_decorator();
|
|
12787
12758
|
init_observer_decorator();
|
|
12759
|
+
init_observer_decorator();
|
|
12788
12760
|
init_handler_sensors_decorator();
|
|
12789
12761
|
init_sensor_decorator();
|
|
12790
|
-
import_priority_order = __toESM(require_priority_order_decorator());
|
|
12791
12762
|
import_tlv_field2 = __toESM(require_tlv_field_decorator());
|
|
12792
12763
|
import_dto_schema2 = __toESM(require_dto_schema_util());
|
|
12793
12764
|
init_axis_tlv_dto();
|
|
@@ -12955,7 +12926,6 @@ init_index();
|
|
|
12955
12926
|
ObserverDispatcherService,
|
|
12956
12927
|
ObserverRegistry,
|
|
12957
12928
|
PRE_DECODE_BOUNDARY,
|
|
12958
|
-
PRIORITY_ORDER_METADATA_KEY,
|
|
12959
12929
|
PROOF_CAPABILITIES,
|
|
12960
12930
|
PROOF_CAPSULE,
|
|
12961
12931
|
PROOF_JWT,
|
|
@@ -12963,7 +12933,6 @@ init_index();
|
|
|
12963
12933
|
PROOF_MTLS,
|
|
12964
12934
|
PROOF_NONE,
|
|
12965
12935
|
PROOF_WITNESS,
|
|
12966
|
-
PriorityOrder,
|
|
12967
12936
|
ProofType,
|
|
12968
12937
|
ProofVerificationService,
|
|
12969
12938
|
REQUIRED_PROOF_METADATA_KEY,
|
|
@@ -13055,7 +13024,6 @@ init_index();
|
|
|
13055
13024
|
canonicalizeObservation,
|
|
13056
13025
|
canonicalizeWrit,
|
|
13057
13026
|
classifyIntent,
|
|
13058
|
-
comparePriorityOrder,
|
|
13059
13027
|
computeReceiptHash,
|
|
13060
13028
|
computeSignaturePayload,
|
|
13061
13029
|
createFabric,
|
|
@@ -13100,8 +13068,6 @@ init_index();
|
|
|
13100
13068
|
getGrantStatus,
|
|
13101
13069
|
getIrreversibleKnots,
|
|
13102
13070
|
getPresenceStatus,
|
|
13103
|
-
getPriorityOrder,
|
|
13104
|
-
getPriorityOrderedTargets,
|
|
13105
13071
|
getSignTarget,
|
|
13106
13072
|
grantCoversAction,
|
|
13107
13073
|
hasScope,
|
|
@@ -13126,7 +13092,6 @@ init_index();
|
|
|
13126
13092
|
parseAutoClaimEntries,
|
|
13127
13093
|
parseScope,
|
|
13128
13094
|
parseStreamEntries,
|
|
13129
|
-
priorityOrder,
|
|
13130
13095
|
projectAt,
|
|
13131
13096
|
queryFabric,
|
|
13132
13097
|
recordOccurrence,
|
|
@@ -13143,6 +13108,8 @@ init_index();
|
|
|
13143
13108
|
startStage,
|
|
13144
13109
|
tieKnot,
|
|
13145
13110
|
tlv,
|
|
13111
|
+
toIntentSensorBinding,
|
|
13112
|
+
toObserverBinding,
|
|
13146
13113
|
u64be,
|
|
13147
13114
|
unpackPasskeyLoginOptionsReq,
|
|
13148
13115
|
unpackPasskeyLoginVerifyReq,
|