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

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.mjs CHANGED
@@ -141,10 +141,7 @@ function appendRequiredProof(target, propertyKey, proof) {
141
141
  REQUIRED_PROOF_METADATA_KEY,
142
142
  target,
143
143
  propertyKey
144
- ) ?? [] : Reflect.getMetadata(
145
- REQUIRED_PROOF_METADATA_KEY,
146
- target
147
- ) ?? [];
144
+ ) ?? [] : Reflect.getMetadata(REQUIRED_PROOF_METADATA_KEY, target) ?? [];
148
145
  const merged = existing.includes(proof) ? existing : [...existing, proof];
149
146
  if (propertyKey !== void 0) {
150
147
  Reflect.defineMetadata(
@@ -222,6 +219,21 @@ function Axis() {
222
219
  Reflect.defineMetadata(AXIS_META_KEY, { entry: true }, target);
223
220
  };
224
221
  }
222
+ function AxisStream(options = {}) {
223
+ return (target) => {
224
+ Reflect.defineMetadata(
225
+ AXIS_STREAM_META_KEY,
226
+ {
227
+ entry: true,
228
+ transport: "stream",
229
+ role: "entry",
230
+ path: options.path,
231
+ protocol: options.protocol
232
+ },
233
+ target
234
+ );
235
+ };
236
+ }
225
237
  function AxisPublic() {
226
238
  return (target, propertyKey, descriptor) => {
227
239
  if (propertyKey !== void 0) {
@@ -264,10 +276,11 @@ function AxisRateLimit(config) {
264
276
  return descriptor;
265
277
  };
266
278
  }
267
- var AXIS_META_KEY, SENSITIVITY_METADATA_KEY, CONTRACT_METADATA_KEY, REQUIRED_PROOF_METADATA_KEY, AXIS_PUBLIC_KEY, AXIS_ANONYMOUS_KEY, AXIS_AUTHORIZED_KEY, AXIS_RATE_LIMIT_KEY;
279
+ var AXIS_META_KEY, AXIS_STREAM_META_KEY, SENSITIVITY_METADATA_KEY, CONTRACT_METADATA_KEY, REQUIRED_PROOF_METADATA_KEY, AXIS_PUBLIC_KEY, AXIS_ANONYMOUS_KEY, AXIS_AUTHORIZED_KEY, AXIS_RATE_LIMIT_KEY;
268
280
  var init_intent_policy_decorator = __esm({
269
281
  "src/decorators/intent-policy.decorator.ts"() {
270
282
  AXIS_META_KEY = "axis:axis";
283
+ AXIS_STREAM_META_KEY = "axis:stream";
271
284
  SENSITIVITY_METADATA_KEY = "axis:sensitivity";
272
285
  CONTRACT_METADATA_KEY = "axis:contract";
273
286
  REQUIRED_PROOF_METADATA_KEY = "axis:required_proof";
@@ -2530,7 +2543,10 @@ var intent_router_exports = {};
2530
2543
  __export(intent_router_exports, {
2531
2544
  IntentRouter: () => IntentRouter
2532
2545
  });
2533
- import { decodeChainEnvelope, decodeChainRequest } from "@nextera.one/axis-protocol";
2546
+ import {
2547
+ decodeChainEnvelope,
2548
+ decodeChainRequest
2549
+ } from "@nextera.one/axis-protocol";
2534
2550
  function observerRefKey(ref) {
2535
2551
  return typeof ref === "string" ? ref : ref.name;
2536
2552
  }
@@ -2722,7 +2738,9 @@ var init_intent_router = __esm({
2722
2738
  */
2723
2739
  register(intent, handler) {
2724
2740
  if (this.handlers.has(intent)) {
2725
- this.logger.warn(`Intent ${intent} is already registered; replacing handler`);
2741
+ this.logger.warn(
2742
+ `Intent ${intent} is already registered; replacing handler`
2743
+ );
2726
2744
  }
2727
2745
  this.handlers.set(intent, handler);
2728
2746
  if (typeof handler === "function" && handler.name) {
@@ -2993,7 +3011,9 @@ var init_intent_router = __esm({
2993
3011
  body: bodyRes
2994
3012
  };
2995
3013
  }
2996
- throw new Error(`Handler for ${intent} does not implement handle or execute`);
3014
+ throw new Error(
3015
+ `Handler for ${intent} does not implement handle or execute`
3016
+ );
2997
3017
  }
2998
3018
  logIntent(intent, start, ok, error) {
2999
3019
  const diff = process.hrtime(start);
@@ -3701,6 +3721,7 @@ var init_intent_router = __esm({
3701
3721
  intent: meta.intent,
3702
3722
  version: 1,
3703
3723
  bodyProfile: meta.bodyProfile || "TLV_MAP",
3724
+ dtoName: meta.dto.name || void 0,
3704
3725
  fields: extracted.fields.map((f) => ({
3705
3726
  name: f.name,
3706
3727
  tlv: f.tag,
@@ -13112,6 +13133,7 @@ __export(index_exports, {
13112
13133
  AXIS_OPCODES: () => AXIS_OPCODES,
13113
13134
  AXIS_PUBLIC_KEY: () => AXIS_PUBLIC_KEY,
13114
13135
  AXIS_RATE_LIMIT_KEY: () => AXIS_RATE_LIMIT_KEY,
13136
+ AXIS_STREAM_META_KEY: () => AXIS_STREAM_META_KEY,
13115
13137
  AXIS_UPLOAD_FILE_STORE: () => AXIS_UPLOAD_FILE_STORE,
13116
13138
  AXIS_UPLOAD_RECEIPT_SIGNER: () => AXIS_UPLOAD_RECEIPT_SIGNER,
13117
13139
  AXIS_UPLOAD_SESSION_STORE: () => AXIS_UPLOAD_SESSION_STORE,
@@ -13131,6 +13153,7 @@ __export(index_exports, {
13131
13153
  AxisRateLimit: () => AxisRateLimit,
13132
13154
  AxisResponseDto: () => import_axis_response.AxisResponseDto,
13133
13155
  AxisSensorChainService: () => AxisSensorChainService,
13156
+ AxisStream: () => AxisStream,
13134
13157
  AxisTlvDto: () => AxisTlvDto,
13135
13158
  BAND: () => BAND,
13136
13159
  BodyProfile: () => BodyProfile2,
@@ -13515,6 +13538,7 @@ export {
13515
13538
  AXIS_OPCODES,
13516
13539
  AXIS_PUBLIC_KEY,
13517
13540
  AXIS_RATE_LIMIT_KEY,
13541
+ AXIS_STREAM_META_KEY,
13518
13542
  AXIS_UPLOAD_FILE_STORE,
13519
13543
  AXIS_UPLOAD_RECEIPT_SIGNER,
13520
13544
  AXIS_UPLOAD_SESSION_STORE,
@@ -13534,6 +13558,7 @@ export {
13534
13558
  AxisRateLimit,
13535
13559
  export_AxisResponseDto as AxisResponseDto,
13536
13560
  AxisSensorChainService,
13561
+ AxisStream,
13537
13562
  AxisTlvDto,
13538
13563
  BAND,
13539
13564
  BodyProfile2 as BodyProfile,