@nextera.one/axis-server-sdk 2.1.9 → 2.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/dist/index.d.mts +7 -6
- package/dist/index.d.ts +7 -6
- package/dist/index.js +34 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +32 -20
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -324,6 +324,25 @@ var init_handler_decorator = __esm({
|
|
|
324
324
|
}
|
|
325
325
|
});
|
|
326
326
|
|
|
327
|
+
// src/decorators/intent-body.decorator.ts
|
|
328
|
+
var intent_body_decorator_exports = {};
|
|
329
|
+
__export(intent_body_decorator_exports, {
|
|
330
|
+
INTENT_BODY_KEY: () => INTENT_BODY_KEY,
|
|
331
|
+
IntentBody: () => IntentBody
|
|
332
|
+
});
|
|
333
|
+
import "reflect-metadata";
|
|
334
|
+
function IntentBody(decoder) {
|
|
335
|
+
return (target, propertyKey) => {
|
|
336
|
+
Reflect.defineMetadata(INTENT_BODY_KEY, decoder, target, propertyKey);
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
var INTENT_BODY_KEY;
|
|
340
|
+
var init_intent_body_decorator = __esm({
|
|
341
|
+
"src/decorators/intent-body.decorator.ts"() {
|
|
342
|
+
INTENT_BODY_KEY = "axis:intent:body";
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
|
|
327
346
|
// src/decorators/intent.decorator.ts
|
|
328
347
|
var intent_decorator_exports = {};
|
|
329
348
|
__export(intent_decorator_exports, {
|
|
@@ -336,6 +355,14 @@ function Intent(action, options) {
|
|
|
336
355
|
return (target, propertyKey) => {
|
|
337
356
|
const metadata = { intent: action, ...options };
|
|
338
357
|
Reflect.defineMetadata(INTENT_METADATA_KEY, metadata, target, propertyKey);
|
|
358
|
+
if (options?.decoder) {
|
|
359
|
+
Reflect.defineMetadata(
|
|
360
|
+
INTENT_BODY_KEY,
|
|
361
|
+
options.decoder,
|
|
362
|
+
target,
|
|
363
|
+
propertyKey
|
|
364
|
+
);
|
|
365
|
+
}
|
|
339
366
|
if (options?.sensitivity) {
|
|
340
367
|
Reflect.defineMetadata(
|
|
341
368
|
SENSITIVITY_METADATA_KEY,
|
|
@@ -364,31 +391,13 @@ function Intent(action, options) {
|
|
|
364
391
|
var INTENT_METADATA_KEY, INTENT_ROUTES_KEY;
|
|
365
392
|
var init_intent_decorator = __esm({
|
|
366
393
|
"src/decorators/intent.decorator.ts"() {
|
|
394
|
+
init_intent_body_decorator();
|
|
367
395
|
init_intent_policy_decorator();
|
|
368
396
|
INTENT_METADATA_KEY = "axis:intent";
|
|
369
397
|
INTENT_ROUTES_KEY = "axis:intent_routes";
|
|
370
398
|
}
|
|
371
399
|
});
|
|
372
400
|
|
|
373
|
-
// src/decorators/intent-body.decorator.ts
|
|
374
|
-
var intent_body_decorator_exports = {};
|
|
375
|
-
__export(intent_body_decorator_exports, {
|
|
376
|
-
INTENT_BODY_KEY: () => INTENT_BODY_KEY,
|
|
377
|
-
IntentBody: () => IntentBody
|
|
378
|
-
});
|
|
379
|
-
import "reflect-metadata";
|
|
380
|
-
function IntentBody(decoder) {
|
|
381
|
-
return (target, propertyKey) => {
|
|
382
|
-
Reflect.defineMetadata(INTENT_BODY_KEY, decoder, target, propertyKey);
|
|
383
|
-
};
|
|
384
|
-
}
|
|
385
|
-
var INTENT_BODY_KEY;
|
|
386
|
-
var init_intent_body_decorator = __esm({
|
|
387
|
-
"src/decorators/intent-body.decorator.ts"() {
|
|
388
|
-
INTENT_BODY_KEY = "axis:intent:body";
|
|
389
|
-
}
|
|
390
|
-
});
|
|
391
|
-
|
|
392
401
|
// src/decorators/intent-sensors.decorator.ts
|
|
393
402
|
var intent_sensors_decorator_exports = {};
|
|
394
403
|
__export(intent_sensors_decorator_exports, {
|
|
@@ -677,7 +686,8 @@ var require_dto_schema_util = __commonJS({
|
|
|
677
686
|
for (const m of fieldMetas) {
|
|
678
687
|
tagMap.set(m.tag, { property: m.property, kind: m.options.kind });
|
|
679
688
|
}
|
|
680
|
-
const
|
|
689
|
+
const dtoClass = dto;
|
|
690
|
+
const afterDecode = typeof dtoClass.afterDecode === "function" ? dtoClass.afterDecode.bind(dtoClass) : void 0;
|
|
681
691
|
return (bodyBytes) => {
|
|
682
692
|
const tlvMap2 = (0, tlv_1.decodeTLVs)(new Uint8Array(bodyBytes));
|
|
683
693
|
const result = {};
|
|
@@ -728,6 +738,8 @@ var AxisTlvDto;
|
|
|
728
738
|
var init_axis_tlv_dto = __esm({
|
|
729
739
|
"src/base/axis-tlv.dto.ts"() {
|
|
730
740
|
AxisTlvDto = class {
|
|
741
|
+
static afterDecode(_dto) {
|
|
742
|
+
}
|
|
731
743
|
};
|
|
732
744
|
}
|
|
733
745
|
});
|