@nextera.one/axis-server-sdk 2.3.22 → 2.3.23
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-CjHt1HEv.d.ts → index-BOTVLcqR.d.ts} +37 -29
- package/dist/{index-OpaG6R6E.d.mts → index-dMZDesmq.d.mts} +37 -29
- package/dist/index.d.mts +20 -4
- package/dist/index.d.ts +20 -4
- package/dist/index.js +70 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +69 -2
- 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 +69 -3
- package/dist/sensors/index.js.map +1 -1
- package/dist/sensors/index.mjs +68 -2
- package/dist/sensors/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/sensors/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { o as AccessProfileResolverSensor, a4 as BodyBudgetSensor, a7 as CapabilityEnforcementSensor, ac as ChunkHashSensor, af as EntropySensor, ah as ExecutionTimeoutSensor, aj as FrameBudgetSensor, ak as FrameHeaderSanitySensor, al as HeaderTLVLimitSensor, ap as IntentAllowlistSensor, as as IntentRegistrySensor, au as LawArticlePresenceMode, av as LawArticlePresenceSensor, aw as LawArticlePresenceSensorOptions, ax as LawEvaluationSensor, aD as ProofPresenceSensor, aE as ProtocolStrictSensor, aG as ReceiptPolicySensor, aL as RiskGateSensor, aM as RiskGateSensorOptions, aO as RiskSignalCollector, aQ as SchemaValidationSensor, aU as StreamScopeSensor, aV as TLVParseSensor, aY as TickAuthCapsuleRef, aZ as TickAuthSensor, a_ as TickAuthSensorOptions, a$ as TickAuthVerifier,
|
|
1
|
+
export { o as AccessProfileResolverSensor, a4 as BodyBudgetSensor, a7 as CapabilityEnforcementSensor, ac as ChunkHashSensor, af as EntropySensor, ah as ExecutionTimeoutSensor, aj as FrameBudgetSensor, ak as FrameHeaderSanitySensor, al as HeaderTLVLimitSensor, ap as IntentAllowlistSensor, as as IntentRegistrySensor, au as LawArticlePresenceMode, av as LawArticlePresenceSensor, aw as LawArticlePresenceSensorOptions, ax as LawEvaluationSensor, aD as ProofPresenceSensor, aE as ProtocolStrictSensor, aG as ReceiptPolicySensor, aL as RiskGateSensor, aM as RiskGateSensorOptions, aO as RiskSignalCollector, aQ as SchemaValidationSensor, aU as StreamScopeSensor, aV as TLVParseSensor, aY as TickAuthCapsuleRef, aZ as TickAuthSensor, a_ as TickAuthSensorOptions, a$ as TickAuthVerifier, bc as TpsSensor, bd as TpsSensorOptions, be as VarintHardeningSensor } from '../index-dMZDesmq.mjs';
|
|
2
2
|
import '../axis-sensor-BLUemDiZ.mjs';
|
|
3
3
|
import 'zod';
|
|
4
4
|
import '@nextera.one/axis-protocol';
|
package/dist/sensors/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { o as AccessProfileResolverSensor, a4 as BodyBudgetSensor, a7 as CapabilityEnforcementSensor, ac as ChunkHashSensor, af as EntropySensor, ah as ExecutionTimeoutSensor, aj as FrameBudgetSensor, ak as FrameHeaderSanitySensor, al as HeaderTLVLimitSensor, ap as IntentAllowlistSensor, as as IntentRegistrySensor, au as LawArticlePresenceMode, av as LawArticlePresenceSensor, aw as LawArticlePresenceSensorOptions, ax as LawEvaluationSensor, aD as ProofPresenceSensor, aE as ProtocolStrictSensor, aG as ReceiptPolicySensor, aL as RiskGateSensor, aM as RiskGateSensorOptions, aO as RiskSignalCollector, aQ as SchemaValidationSensor, aU as StreamScopeSensor, aV as TLVParseSensor, aY as TickAuthCapsuleRef, aZ as TickAuthSensor, a_ as TickAuthSensorOptions, a$ as TickAuthVerifier,
|
|
1
|
+
export { o as AccessProfileResolverSensor, a4 as BodyBudgetSensor, a7 as CapabilityEnforcementSensor, ac as ChunkHashSensor, af as EntropySensor, ah as ExecutionTimeoutSensor, aj as FrameBudgetSensor, ak as FrameHeaderSanitySensor, al as HeaderTLVLimitSensor, ap as IntentAllowlistSensor, as as IntentRegistrySensor, au as LawArticlePresenceMode, av as LawArticlePresenceSensor, aw as LawArticlePresenceSensorOptions, ax as LawEvaluationSensor, aD as ProofPresenceSensor, aE as ProtocolStrictSensor, aG as ReceiptPolicySensor, aL as RiskGateSensor, aM as RiskGateSensorOptions, aO as RiskSignalCollector, aQ as SchemaValidationSensor, aU as StreamScopeSensor, aV as TLVParseSensor, aY as TickAuthCapsuleRef, aZ as TickAuthSensor, a_ as TickAuthSensorOptions, a$ as TickAuthVerifier, bc as TpsSensor, bd as TpsSensorOptions, be as VarintHardeningSensor } from '../index-BOTVLcqR.js';
|
|
2
2
|
import '../axis-sensor-BLUemDiZ.js';
|
|
3
3
|
import 'zod';
|
|
4
4
|
import '@nextera.one/axis-protocol';
|
package/dist/sensors/index.js
CHANGED
|
@@ -902,7 +902,8 @@ var require_dto_schema_util = __commonJS({
|
|
|
902
902
|
required: m.options.required,
|
|
903
903
|
maxLen: m.options.maxLen,
|
|
904
904
|
max: m.options.max,
|
|
905
|
-
scope: m.options.scope
|
|
905
|
+
scope: m.options.scope,
|
|
906
|
+
encode: m.options.encode
|
|
906
907
|
};
|
|
907
908
|
});
|
|
908
909
|
const validatorMetas = Reflect.getMetadata(tlv_field_decorator_1.TLV_VALIDATORS_KEY, dto) || [];
|
|
@@ -8915,9 +8916,11 @@ var init_axis_observation = __esm({
|
|
|
8915
8916
|
});
|
|
8916
8917
|
|
|
8917
8918
|
// src/security/axis-sensor-chain.service.ts
|
|
8918
|
-
var AxisSensorChainService;
|
|
8919
|
+
var import_reflect_metadata13, AxisSensorChainService;
|
|
8919
8920
|
var init_axis_sensor_chain_service = __esm({
|
|
8920
8921
|
"src/security/axis-sensor-chain.service.ts"() {
|
|
8922
|
+
import_reflect_metadata13 = require("reflect-metadata");
|
|
8923
|
+
init_sensor_decorator();
|
|
8921
8924
|
init_axis_sensor();
|
|
8922
8925
|
init_axis_observation();
|
|
8923
8926
|
AxisSensorChainService = class {
|
|
@@ -8960,6 +8963,9 @@ var init_axis_sensor_chain_service = __esm({
|
|
|
8960
8963
|
async evaluateSensors(sensors, input, baseDecision) {
|
|
8961
8964
|
const relevantSensors = [];
|
|
8962
8965
|
for (const sensor of sensors) {
|
|
8966
|
+
if (!this.matchesProofKind(sensor, input)) {
|
|
8967
|
+
continue;
|
|
8968
|
+
}
|
|
8963
8969
|
if (!sensor.supports) {
|
|
8964
8970
|
relevantSensors.push(sensor);
|
|
8965
8971
|
continue;
|
|
@@ -9059,6 +9065,28 @@ var init_axis_sensor_chain_service = __esm({
|
|
|
9059
9065
|
} : void 0
|
|
9060
9066
|
};
|
|
9061
9067
|
}
|
|
9068
|
+
matchesProofKind(sensor, input) {
|
|
9069
|
+
const meta = Reflect.getMetadata(
|
|
9070
|
+
SENSOR_METADATA_KEY,
|
|
9071
|
+
sensor.constructor
|
|
9072
|
+
);
|
|
9073
|
+
if (!meta || meta === true) return true;
|
|
9074
|
+
const currentProofKinds = this.normalizeProofKinds(
|
|
9075
|
+
input.metadata?.proofKind ?? input.requiredProof
|
|
9076
|
+
);
|
|
9077
|
+
const excludedProofKinds = this.normalizeProofKinds(meta.excludeProofKind);
|
|
9078
|
+
if (excludedProofKinds.length > 0 && currentProofKinds.some((kind) => excludedProofKinds.includes(kind))) {
|
|
9079
|
+
return false;
|
|
9080
|
+
}
|
|
9081
|
+
const requiredProofKinds = this.normalizeProofKinds(meta.proofKind);
|
|
9082
|
+
if (requiredProofKinds.length === 0) return true;
|
|
9083
|
+
return currentProofKinds.some((kind) => requiredProofKinds.includes(kind));
|
|
9084
|
+
}
|
|
9085
|
+
normalizeProofKinds(value) {
|
|
9086
|
+
if (value === void 0 || value === null) return [];
|
|
9087
|
+
const items = Array.isArray(value) ? value : [value];
|
|
9088
|
+
return items.map((item) => String(item).trim().toUpperCase()).filter(Boolean);
|
|
9089
|
+
}
|
|
9062
9090
|
};
|
|
9063
9091
|
}
|
|
9064
9092
|
});
|
|
@@ -9432,10 +9460,11 @@ var init_timeline_store = __esm({
|
|
|
9432
9460
|
});
|
|
9433
9461
|
|
|
9434
9462
|
// src/utils/axis-tlv-codec.ts
|
|
9435
|
-
function encodeAxisTlvDto(dtoClass, data) {
|
|
9463
|
+
function encodeAxisTlvDto(dtoClass, data, context = {}) {
|
|
9436
9464
|
const schema = (0, import_dto_schema2.extractDtoSchema)(dtoClass);
|
|
9437
9465
|
const items = schema.fields.flatMap((field) => {
|
|
9438
9466
|
const value = data[field.name];
|
|
9467
|
+
if (!shouldEncodeField(field, value, data, context)) return [];
|
|
9439
9468
|
if (value === void 0 || value === null) {
|
|
9440
9469
|
if (field.required) {
|
|
9441
9470
|
throw new Error(`Missing required TLV response field: ${field.name}`);
|
|
@@ -9446,6 +9475,42 @@ function encodeAxisTlvDto(dtoClass, data) {
|
|
|
9446
9475
|
});
|
|
9447
9476
|
return buildTLVs(items);
|
|
9448
9477
|
}
|
|
9478
|
+
function projectAxisTlvDto(dtoClass, data, context = {}) {
|
|
9479
|
+
const schema = (0, import_dto_schema2.extractDtoSchema)(dtoClass);
|
|
9480
|
+
const result = {};
|
|
9481
|
+
for (const field of schema.fields) {
|
|
9482
|
+
const value = data[field.name];
|
|
9483
|
+
if (!shouldEncodeField(field, value, data, context)) continue;
|
|
9484
|
+
if (value === void 0 || value === null) continue;
|
|
9485
|
+
result[field.name] = value;
|
|
9486
|
+
}
|
|
9487
|
+
return result;
|
|
9488
|
+
}
|
|
9489
|
+
function shouldEncodeField(field, value, data, context) {
|
|
9490
|
+
const rule = field.encode;
|
|
9491
|
+
if (rule === void 0) return true;
|
|
9492
|
+
if (rule === false) return false;
|
|
9493
|
+
if (rule.onlyRoles?.length && !hasAnyRole(context, rule.onlyRoles)) {
|
|
9494
|
+
return false;
|
|
9495
|
+
}
|
|
9496
|
+
if (rule.exceptRoles?.length && hasAnyRole(context, rule.exceptRoles)) {
|
|
9497
|
+
return false;
|
|
9498
|
+
}
|
|
9499
|
+
if (rule.policy) {
|
|
9500
|
+
const policy = context.policies?.[rule.policy];
|
|
9501
|
+
if (!policy) {
|
|
9502
|
+
throw new Error(`Missing TLV encode policy: ${rule.policy}`);
|
|
9503
|
+
}
|
|
9504
|
+
if (!policy({ field, value, data, context })) {
|
|
9505
|
+
return false;
|
|
9506
|
+
}
|
|
9507
|
+
}
|
|
9508
|
+
return true;
|
|
9509
|
+
}
|
|
9510
|
+
function hasAnyRole(context, expectedRoles) {
|
|
9511
|
+
const actualRoles = context.roles ?? [];
|
|
9512
|
+
return expectedRoles.some((role) => actualRoles.includes(role));
|
|
9513
|
+
}
|
|
9449
9514
|
function encodeField(field, value) {
|
|
9450
9515
|
switch (field.kind) {
|
|
9451
9516
|
case "utf8":
|
|
@@ -11192,6 +11257,7 @@ __export(index_exports, {
|
|
|
11192
11257
|
parseScope: () => parseScope,
|
|
11193
11258
|
parseStreamEntries: () => parseStreamEntries,
|
|
11194
11259
|
projectAt: () => projectAt,
|
|
11260
|
+
projectAxisTlvDto: () => projectAxisTlvDto,
|
|
11195
11261
|
queryFabric: () => queryFabric,
|
|
11196
11262
|
recordOccurrence: () => recordOccurrence,
|
|
11197
11263
|
recordSensor: () => recordSensor,
|