@nextera.one/axis-server-sdk 2.1.3 → 2.1.5
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 +1834 -1804
- package/dist/index.d.ts +1834 -1804
- package/dist/index.js +268 -126
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +254 -112
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -133,6 +133,163 @@ var init_capsule_policy_decorator = __esm({
|
|
|
133
133
|
}
|
|
134
134
|
});
|
|
135
135
|
|
|
136
|
+
// src/decorators/intent-policy.decorator.ts
|
|
137
|
+
var intent_policy_decorator_exports = {};
|
|
138
|
+
__export(intent_policy_decorator_exports, {
|
|
139
|
+
AXIS_ANONYMOUS_KEY: () => AXIS_ANONYMOUS_KEY,
|
|
140
|
+
AXIS_PUBLIC_KEY: () => AXIS_PUBLIC_KEY,
|
|
141
|
+
AXIS_RATE_LIMIT_KEY: () => AXIS_RATE_LIMIT_KEY,
|
|
142
|
+
AxisAnonymous: () => AxisAnonymous,
|
|
143
|
+
AxisPublic: () => AxisPublic,
|
|
144
|
+
AxisRateLimit: () => AxisRateLimit,
|
|
145
|
+
CONTRACT_METADATA_KEY: () => CONTRACT_METADATA_KEY,
|
|
146
|
+
Capsule: () => Capsule,
|
|
147
|
+
Contract: () => Contract,
|
|
148
|
+
REQUIRED_PROOF_METADATA_KEY: () => REQUIRED_PROOF_METADATA_KEY,
|
|
149
|
+
RequiredProof: () => RequiredProof,
|
|
150
|
+
SENSITIVITY_METADATA_KEY: () => SENSITIVITY_METADATA_KEY,
|
|
151
|
+
Sensitivity: () => Sensitivity,
|
|
152
|
+
Witness: () => Witness
|
|
153
|
+
});
|
|
154
|
+
function Sensitivity(level) {
|
|
155
|
+
return ((target, propertyKey) => {
|
|
156
|
+
if (propertyKey !== void 0) {
|
|
157
|
+
Reflect.defineMetadata(
|
|
158
|
+
SENSITIVITY_METADATA_KEY,
|
|
159
|
+
level,
|
|
160
|
+
target,
|
|
161
|
+
propertyKey
|
|
162
|
+
);
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
Reflect.defineMetadata(SENSITIVITY_METADATA_KEY, level, target);
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
function Contract(options) {
|
|
169
|
+
return ((target, propertyKey) => {
|
|
170
|
+
if (propertyKey !== void 0) {
|
|
171
|
+
Reflect.defineMetadata(
|
|
172
|
+
CONTRACT_METADATA_KEY,
|
|
173
|
+
options,
|
|
174
|
+
target,
|
|
175
|
+
propertyKey
|
|
176
|
+
);
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
Reflect.defineMetadata(CONTRACT_METADATA_KEY, options, target);
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
function RequiredProof(proofs) {
|
|
183
|
+
return ((target, propertyKey) => {
|
|
184
|
+
if (propertyKey !== void 0) {
|
|
185
|
+
Reflect.defineMetadata(
|
|
186
|
+
REQUIRED_PROOF_METADATA_KEY,
|
|
187
|
+
proofs,
|
|
188
|
+
target,
|
|
189
|
+
propertyKey
|
|
190
|
+
);
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
Reflect.defineMetadata(
|
|
194
|
+
REQUIRED_PROOF_METADATA_KEY,
|
|
195
|
+
proofs,
|
|
196
|
+
target
|
|
197
|
+
);
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
function Capsule() {
|
|
201
|
+
return ((target, propertyKey) => {
|
|
202
|
+
const existing = propertyKey !== void 0 ? Reflect.getMetadata(
|
|
203
|
+
REQUIRED_PROOF_METADATA_KEY,
|
|
204
|
+
target,
|
|
205
|
+
propertyKey
|
|
206
|
+
) ?? [] : Reflect.getMetadata(
|
|
207
|
+
REQUIRED_PROOF_METADATA_KEY,
|
|
208
|
+
target
|
|
209
|
+
) ?? [];
|
|
210
|
+
const merged = existing.includes("CAPSULE") ? existing : [...existing, "CAPSULE"];
|
|
211
|
+
if (propertyKey !== void 0) {
|
|
212
|
+
Reflect.defineMetadata(
|
|
213
|
+
REQUIRED_PROOF_METADATA_KEY,
|
|
214
|
+
merged,
|
|
215
|
+
target,
|
|
216
|
+
propertyKey
|
|
217
|
+
);
|
|
218
|
+
} else {
|
|
219
|
+
Reflect.defineMetadata(
|
|
220
|
+
REQUIRED_PROOF_METADATA_KEY,
|
|
221
|
+
merged,
|
|
222
|
+
target
|
|
223
|
+
);
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
function Witness() {
|
|
228
|
+
return ((target, propertyKey) => {
|
|
229
|
+
const existing = propertyKey !== void 0 ? Reflect.getMetadata(
|
|
230
|
+
REQUIRED_PROOF_METADATA_KEY,
|
|
231
|
+
target,
|
|
232
|
+
propertyKey
|
|
233
|
+
) ?? [] : Reflect.getMetadata(
|
|
234
|
+
REQUIRED_PROOF_METADATA_KEY,
|
|
235
|
+
target
|
|
236
|
+
) ?? [];
|
|
237
|
+
const merged = existing.includes("WITNESS") ? existing : [...existing, "WITNESS"];
|
|
238
|
+
if (propertyKey !== void 0) {
|
|
239
|
+
Reflect.defineMetadata(
|
|
240
|
+
REQUIRED_PROOF_METADATA_KEY,
|
|
241
|
+
merged,
|
|
242
|
+
target,
|
|
243
|
+
propertyKey
|
|
244
|
+
);
|
|
245
|
+
} else {
|
|
246
|
+
Reflect.defineMetadata(
|
|
247
|
+
REQUIRED_PROOF_METADATA_KEY,
|
|
248
|
+
merged,
|
|
249
|
+
target
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
function AxisPublic() {
|
|
255
|
+
return (target, propertyKey, descriptor) => {
|
|
256
|
+
if (descriptor) {
|
|
257
|
+
Reflect.defineMetadata(AXIS_PUBLIC_KEY, true, target, propertyKey);
|
|
258
|
+
return descriptor;
|
|
259
|
+
}
|
|
260
|
+
Reflect.defineMetadata(AXIS_PUBLIC_KEY, true, target);
|
|
261
|
+
return target;
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
function AxisAnonymous() {
|
|
265
|
+
return (target, propertyKey, descriptor) => {
|
|
266
|
+
if (descriptor) {
|
|
267
|
+
Reflect.defineMetadata(AXIS_ANONYMOUS_KEY, true, target, propertyKey);
|
|
268
|
+
return descriptor;
|
|
269
|
+
}
|
|
270
|
+
Reflect.defineMetadata(AXIS_ANONYMOUS_KEY, true, target);
|
|
271
|
+
return target;
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
function AxisRateLimit(config) {
|
|
275
|
+
return (target, propertyKey, descriptor) => {
|
|
276
|
+
Reflect.defineMetadata(AXIS_RATE_LIMIT_KEY, config, target, propertyKey);
|
|
277
|
+
return descriptor;
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
var import_reflect_metadata3, SENSITIVITY_METADATA_KEY, CONTRACT_METADATA_KEY, REQUIRED_PROOF_METADATA_KEY, AXIS_PUBLIC_KEY, AXIS_ANONYMOUS_KEY, AXIS_RATE_LIMIT_KEY;
|
|
281
|
+
var init_intent_policy_decorator = __esm({
|
|
282
|
+
"src/decorators/intent-policy.decorator.ts"() {
|
|
283
|
+
import_reflect_metadata3 = require("reflect-metadata");
|
|
284
|
+
SENSITIVITY_METADATA_KEY = "axis:sensitivity";
|
|
285
|
+
CONTRACT_METADATA_KEY = "axis:contract";
|
|
286
|
+
REQUIRED_PROOF_METADATA_KEY = "axis:required_proof";
|
|
287
|
+
AXIS_PUBLIC_KEY = "axis:public";
|
|
288
|
+
AXIS_ANONYMOUS_KEY = "axis:anonymous";
|
|
289
|
+
AXIS_RATE_LIMIT_KEY = "axis:rateLimit";
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
|
|
136
293
|
// src/decorators/handler.decorator.ts
|
|
137
294
|
var handler_decorator_exports = {};
|
|
138
295
|
__export(handler_decorator_exports, {
|
|
@@ -183,10 +340,10 @@ function Intent(action, options) {
|
|
|
183
340
|
Reflect.defineMetadata(INTENT_ROUTES_KEY, routes, target.constructor);
|
|
184
341
|
};
|
|
185
342
|
}
|
|
186
|
-
var
|
|
343
|
+
var import_reflect_metadata4, INTENT_METADATA_KEY, INTENT_ROUTES_KEY;
|
|
187
344
|
var init_intent_decorator = __esm({
|
|
188
345
|
"src/decorators/intent.decorator.ts"() {
|
|
189
|
-
|
|
346
|
+
import_reflect_metadata4 = require("reflect-metadata");
|
|
190
347
|
INTENT_METADATA_KEY = "axis:intent";
|
|
191
348
|
INTENT_ROUTES_KEY = "axis:intent_routes";
|
|
192
349
|
}
|
|
@@ -203,10 +360,10 @@ function IntentBody(decoder) {
|
|
|
203
360
|
Reflect.defineMetadata(INTENT_BODY_KEY, decoder, target, propertyKey);
|
|
204
361
|
};
|
|
205
362
|
}
|
|
206
|
-
var
|
|
363
|
+
var import_reflect_metadata5, INTENT_BODY_KEY;
|
|
207
364
|
var init_intent_body_decorator = __esm({
|
|
208
365
|
"src/decorators/intent-body.decorator.ts"() {
|
|
209
|
-
|
|
366
|
+
import_reflect_metadata5 = require("reflect-metadata");
|
|
210
367
|
INTENT_BODY_KEY = "axis:intent:body";
|
|
211
368
|
}
|
|
212
369
|
});
|
|
@@ -222,10 +379,10 @@ function IntentSensors(sensors) {
|
|
|
222
379
|
Reflect.defineMetadata(INTENT_SENSORS_KEY, sensors, target, propertyKey);
|
|
223
380
|
};
|
|
224
381
|
}
|
|
225
|
-
var
|
|
382
|
+
var import_reflect_metadata6, INTENT_SENSORS_KEY;
|
|
226
383
|
var init_intent_sensors_decorator = __esm({
|
|
227
384
|
"src/decorators/intent-sensors.decorator.ts"() {
|
|
228
|
-
|
|
385
|
+
import_reflect_metadata6 = require("reflect-metadata");
|
|
229
386
|
INTENT_SENSORS_KEY = "axis:intent:sensors";
|
|
230
387
|
}
|
|
231
388
|
});
|
|
@@ -287,10 +444,10 @@ function Observer(input) {
|
|
|
287
444
|
(0, import_common2.Injectable)()(target);
|
|
288
445
|
});
|
|
289
446
|
}
|
|
290
|
-
var
|
|
447
|
+
var import_reflect_metadata7, import_common2, OBSERVER_METADATA_KEY, OBSERVER_BINDINGS_KEY;
|
|
291
448
|
var init_observer_decorator = __esm({
|
|
292
449
|
"src/decorators/observer.decorator.ts"() {
|
|
293
|
-
|
|
450
|
+
import_reflect_metadata7 = require("reflect-metadata");
|
|
294
451
|
import_common2 = require("@nestjs/common");
|
|
295
452
|
OBSERVER_METADATA_KEY = "axis:observer";
|
|
296
453
|
OBSERVER_BINDINGS_KEY = "axis:observer:bindings";
|
|
@@ -308,10 +465,10 @@ function HandlerSensors(sensors) {
|
|
|
308
465
|
Reflect.defineMetadata(HANDLER_SENSORS_KEY, sensors, target);
|
|
309
466
|
};
|
|
310
467
|
}
|
|
311
|
-
var
|
|
468
|
+
var import_reflect_metadata8, HANDLER_SENSORS_KEY;
|
|
312
469
|
var init_handler_sensors_decorator = __esm({
|
|
313
470
|
"src/decorators/handler-sensors.decorator.ts"() {
|
|
314
|
-
|
|
471
|
+
import_reflect_metadata8 = require("reflect-metadata");
|
|
315
472
|
HANDLER_SENSORS_KEY = "axis:handler:sensors";
|
|
316
473
|
}
|
|
317
474
|
});
|
|
@@ -398,10 +555,10 @@ function TlvRange(min, max, message) {
|
|
|
398
555
|
return null;
|
|
399
556
|
});
|
|
400
557
|
}
|
|
401
|
-
var
|
|
558
|
+
var import_reflect_metadata9, TLV_FIELDS_KEY, TLV_VALIDATORS_KEY;
|
|
402
559
|
var init_tlv_field_decorator = __esm({
|
|
403
560
|
"src/decorators/tlv-field.decorator.ts"() {
|
|
404
|
-
|
|
561
|
+
import_reflect_metadata9 = require("reflect-metadata");
|
|
405
562
|
TLV_FIELDS_KEY = "axis:tlv:fields";
|
|
406
563
|
TLV_VALIDATORS_KEY = "axis:tlv:validators";
|
|
407
564
|
}
|
|
@@ -574,10 +731,10 @@ function AxisPartialType(BaseDto) {
|
|
|
574
731
|
});
|
|
575
732
|
return PartialDto;
|
|
576
733
|
}
|
|
577
|
-
var
|
|
734
|
+
var import_reflect_metadata10;
|
|
578
735
|
var init_axis_partial_type = __esm({
|
|
579
736
|
"src/base/axis-partial-type.ts"() {
|
|
580
|
-
|
|
737
|
+
import_reflect_metadata10 = require("reflect-metadata");
|
|
581
738
|
init_tlv_field_decorator();
|
|
582
739
|
}
|
|
583
740
|
});
|
|
@@ -1937,6 +2094,7 @@ var require_intent_router = __commonJS({
|
|
|
1937
2094
|
var handler_sensors_decorator_1 = (init_handler_sensors_decorator(), __toCommonJS(handler_sensors_decorator_exports));
|
|
1938
2095
|
var handler_decorator_1 = (init_handler_decorator(), __toCommonJS(handler_decorator_exports));
|
|
1939
2096
|
var intent_body_decorator_1 = (init_intent_body_decorator(), __toCommonJS(intent_body_decorator_exports));
|
|
2097
|
+
var intent_policy_decorator_1 = (init_intent_policy_decorator(), __toCommonJS(intent_policy_decorator_exports));
|
|
1940
2098
|
var intent_sensors_decorator_1 = (init_intent_sensors_decorator(), __toCommonJS(intent_sensors_decorator_exports));
|
|
1941
2099
|
var intent_decorator_1 = (init_intent_decorator(), __toCommonJS(intent_decorator_exports));
|
|
1942
2100
|
var observer_decorator_1 = (init_observer_decorator(), __toCommonJS(observer_decorator_exports));
|
|
@@ -1998,6 +2156,12 @@ var require_intent_router = __commonJS({
|
|
|
1998
2156
|
this.intentChains = /* @__PURE__ */ new Map();
|
|
1999
2157
|
this.intentObservers = /* @__PURE__ */ new Map();
|
|
2000
2158
|
this.intentCapsulePolicies = /* @__PURE__ */ new Map();
|
|
2159
|
+
this.intentSensitivity = /* @__PURE__ */ new Map();
|
|
2160
|
+
this.intentContracts = /* @__PURE__ */ new Map();
|
|
2161
|
+
this.intentRequiredProof = /* @__PURE__ */ new Map();
|
|
2162
|
+
this.publicIntents = /* @__PURE__ */ new Set();
|
|
2163
|
+
this.anonymousIntents = /* @__PURE__ */ new Set();
|
|
2164
|
+
this.intentRateLimits = /* @__PURE__ */ new Map();
|
|
2001
2165
|
this.cceHandlers = /* @__PURE__ */ new Map();
|
|
2002
2166
|
this.ccePipelineConfig = null;
|
|
2003
2167
|
}
|
|
@@ -2253,6 +2417,56 @@ var require_intent_router = __commonJS({
|
|
|
2253
2417
|
this.intentChains.set(intent, chainConfig);
|
|
2254
2418
|
}
|
|
2255
2419
|
}
|
|
2420
|
+
const methodSensitivity = Reflect.getMetadata(intent_policy_decorator_1.SENSITIVITY_METADATA_KEY, proto, methodName);
|
|
2421
|
+
const classSensitivity = Reflect.getMetadata(intent_policy_decorator_1.SENSITIVITY_METADATA_KEY, proto.constructor);
|
|
2422
|
+
const sensitivity = methodSensitivity ?? classSensitivity;
|
|
2423
|
+
if (sensitivity) {
|
|
2424
|
+
this.intentSensitivity.set(intent, sensitivity);
|
|
2425
|
+
}
|
|
2426
|
+
const methodContract = Reflect.getMetadata(intent_policy_decorator_1.CONTRACT_METADATA_KEY, proto, methodName);
|
|
2427
|
+
const classContract = Reflect.getMetadata(intent_policy_decorator_1.CONTRACT_METADATA_KEY, proto.constructor);
|
|
2428
|
+
const contract = methodContract ?? classContract;
|
|
2429
|
+
if (contract) {
|
|
2430
|
+
this.intentContracts.set(intent, contract);
|
|
2431
|
+
}
|
|
2432
|
+
const methodProof = Reflect.getMetadata(intent_policy_decorator_1.REQUIRED_PROOF_METADATA_KEY, proto, methodName);
|
|
2433
|
+
const classProof = Reflect.getMetadata(intent_policy_decorator_1.REQUIRED_PROOF_METADATA_KEY, proto.constructor);
|
|
2434
|
+
const requiredProof = methodProof ?? classProof;
|
|
2435
|
+
if (requiredProof && requiredProof.length > 0) {
|
|
2436
|
+
this.intentRequiredProof.set(intent, requiredProof);
|
|
2437
|
+
}
|
|
2438
|
+
const isPublicMethod = Reflect.getMetadata(intent_policy_decorator_1.AXIS_PUBLIC_KEY, proto, methodName);
|
|
2439
|
+
const isPublicClass = Reflect.getMetadata(intent_policy_decorator_1.AXIS_PUBLIC_KEY, proto.constructor);
|
|
2440
|
+
if (isPublicMethod || isPublicClass) {
|
|
2441
|
+
this.publicIntents.add(intent);
|
|
2442
|
+
}
|
|
2443
|
+
const isAnonMethod = Reflect.getMetadata(intent_policy_decorator_1.AXIS_ANONYMOUS_KEY, proto, methodName);
|
|
2444
|
+
const isAnonClass = Reflect.getMetadata(intent_policy_decorator_1.AXIS_ANONYMOUS_KEY, proto.constructor);
|
|
2445
|
+
if (isAnonMethod || isAnonClass) {
|
|
2446
|
+
this.anonymousIntents.add(intent);
|
|
2447
|
+
}
|
|
2448
|
+
const rateLimit = Reflect.getMetadata(intent_policy_decorator_1.AXIS_RATE_LIMIT_KEY, proto, methodName);
|
|
2449
|
+
if (rateLimit) {
|
|
2450
|
+
this.intentRateLimits.set(intent, rateLimit);
|
|
2451
|
+
}
|
|
2452
|
+
}
|
|
2453
|
+
getSensitivity(intent) {
|
|
2454
|
+
return this.intentSensitivity.get(intent);
|
|
2455
|
+
}
|
|
2456
|
+
getContract(intent) {
|
|
2457
|
+
return this.intentContracts.get(intent);
|
|
2458
|
+
}
|
|
2459
|
+
getRequiredProof(intent) {
|
|
2460
|
+
return this.intentRequiredProof.get(intent);
|
|
2461
|
+
}
|
|
2462
|
+
isPublic(intent) {
|
|
2463
|
+
return this.publicIntents.has(intent);
|
|
2464
|
+
}
|
|
2465
|
+
isAnonymous(intent) {
|
|
2466
|
+
return this.anonymousIntents.has(intent);
|
|
2467
|
+
}
|
|
2468
|
+
getRateLimit(intent) {
|
|
2469
|
+
return this.intentRateLimits.get(intent);
|
|
2256
2470
|
}
|
|
2257
2471
|
async emitIntentObservers(bindings, context) {
|
|
2258
2472
|
if (!this.observerDispatcher || bindings.length === 0)
|
|
@@ -2453,7 +2667,11 @@ var require_intent_router = __commonJS({
|
|
|
2453
2667
|
envelope: (0, axis_protocol_1.decodeChainEnvelope)(bytes2)
|
|
2454
2668
|
};
|
|
2455
2669
|
} catch (envelopeError) {
|
|
2456
|
-
const reason = [
|
|
2670
|
+
const reason = [
|
|
2671
|
+
jsonError?.message,
|
|
2672
|
+
requestError.message,
|
|
2673
|
+
envelopeError.message
|
|
2674
|
+
].filter(Boolean).join(" | ");
|
|
2457
2675
|
throw new Error(`CHAIN.EXEC decode failed: ${reason}`);
|
|
2458
2676
|
}
|
|
2459
2677
|
}
|
|
@@ -7069,120 +7287,15 @@ var init_crypto = __esm({
|
|
|
7069
7287
|
}
|
|
7070
7288
|
});
|
|
7071
7289
|
|
|
7072
|
-
// src/decorators/intent-policy.decorator.ts
|
|
7073
|
-
function Sensitivity(level) {
|
|
7074
|
-
return ((target, propertyKey) => {
|
|
7075
|
-
if (propertyKey !== void 0) {
|
|
7076
|
-
Reflect.defineMetadata(
|
|
7077
|
-
SENSITIVITY_METADATA_KEY,
|
|
7078
|
-
level,
|
|
7079
|
-
target,
|
|
7080
|
-
propertyKey
|
|
7081
|
-
);
|
|
7082
|
-
return;
|
|
7083
|
-
}
|
|
7084
|
-
Reflect.defineMetadata(SENSITIVITY_METADATA_KEY, level, target);
|
|
7085
|
-
});
|
|
7086
|
-
}
|
|
7087
|
-
function Contract(options) {
|
|
7088
|
-
return ((target, propertyKey) => {
|
|
7089
|
-
if (propertyKey !== void 0) {
|
|
7090
|
-
Reflect.defineMetadata(
|
|
7091
|
-
CONTRACT_METADATA_KEY,
|
|
7092
|
-
options,
|
|
7093
|
-
target,
|
|
7094
|
-
propertyKey
|
|
7095
|
-
);
|
|
7096
|
-
return;
|
|
7097
|
-
}
|
|
7098
|
-
Reflect.defineMetadata(CONTRACT_METADATA_KEY, options, target);
|
|
7099
|
-
});
|
|
7100
|
-
}
|
|
7101
|
-
function RequiredProof(proofs) {
|
|
7102
|
-
return ((target, propertyKey) => {
|
|
7103
|
-
if (propertyKey !== void 0) {
|
|
7104
|
-
Reflect.defineMetadata(
|
|
7105
|
-
REQUIRED_PROOF_METADATA_KEY,
|
|
7106
|
-
proofs,
|
|
7107
|
-
target,
|
|
7108
|
-
propertyKey
|
|
7109
|
-
);
|
|
7110
|
-
return;
|
|
7111
|
-
}
|
|
7112
|
-
Reflect.defineMetadata(
|
|
7113
|
-
REQUIRED_PROOF_METADATA_KEY,
|
|
7114
|
-
proofs,
|
|
7115
|
-
target
|
|
7116
|
-
);
|
|
7117
|
-
});
|
|
7118
|
-
}
|
|
7119
|
-
function Capsule() {
|
|
7120
|
-
return ((target, propertyKey) => {
|
|
7121
|
-
const existing = propertyKey !== void 0 ? Reflect.getMetadata(
|
|
7122
|
-
REQUIRED_PROOF_METADATA_KEY,
|
|
7123
|
-
target,
|
|
7124
|
-
propertyKey
|
|
7125
|
-
) ?? [] : Reflect.getMetadata(
|
|
7126
|
-
REQUIRED_PROOF_METADATA_KEY,
|
|
7127
|
-
target
|
|
7128
|
-
) ?? [];
|
|
7129
|
-
const merged = existing.includes("CAPSULE") ? existing : [...existing, "CAPSULE"];
|
|
7130
|
-
if (propertyKey !== void 0) {
|
|
7131
|
-
Reflect.defineMetadata(
|
|
7132
|
-
REQUIRED_PROOF_METADATA_KEY,
|
|
7133
|
-
merged,
|
|
7134
|
-
target,
|
|
7135
|
-
propertyKey
|
|
7136
|
-
);
|
|
7137
|
-
} else {
|
|
7138
|
-
Reflect.defineMetadata(
|
|
7139
|
-
REQUIRED_PROOF_METADATA_KEY,
|
|
7140
|
-
merged,
|
|
7141
|
-
target
|
|
7142
|
-
);
|
|
7143
|
-
}
|
|
7144
|
-
});
|
|
7145
|
-
}
|
|
7146
|
-
function Witness() {
|
|
7147
|
-
return ((target, propertyKey) => {
|
|
7148
|
-
const existing = propertyKey !== void 0 ? Reflect.getMetadata(
|
|
7149
|
-
REQUIRED_PROOF_METADATA_KEY,
|
|
7150
|
-
target,
|
|
7151
|
-
propertyKey
|
|
7152
|
-
) ?? [] : Reflect.getMetadata(
|
|
7153
|
-
REQUIRED_PROOF_METADATA_KEY,
|
|
7154
|
-
target
|
|
7155
|
-
) ?? [];
|
|
7156
|
-
const merged = existing.includes("WITNESS") ? existing : [...existing, "WITNESS"];
|
|
7157
|
-
if (propertyKey !== void 0) {
|
|
7158
|
-
Reflect.defineMetadata(
|
|
7159
|
-
REQUIRED_PROOF_METADATA_KEY,
|
|
7160
|
-
merged,
|
|
7161
|
-
target,
|
|
7162
|
-
propertyKey
|
|
7163
|
-
);
|
|
7164
|
-
} else {
|
|
7165
|
-
Reflect.defineMetadata(
|
|
7166
|
-
REQUIRED_PROOF_METADATA_KEY,
|
|
7167
|
-
merged,
|
|
7168
|
-
target
|
|
7169
|
-
);
|
|
7170
|
-
}
|
|
7171
|
-
});
|
|
7172
|
-
}
|
|
7173
|
-
var import_reflect_metadata10, SENSITIVITY_METADATA_KEY, CONTRACT_METADATA_KEY, REQUIRED_PROOF_METADATA_KEY;
|
|
7174
|
-
var init_intent_policy_decorator = __esm({
|
|
7175
|
-
"src/decorators/intent-policy.decorator.ts"() {
|
|
7176
|
-
import_reflect_metadata10 = require("reflect-metadata");
|
|
7177
|
-
SENSITIVITY_METADATA_KEY = "axis:sensitivity";
|
|
7178
|
-
CONTRACT_METADATA_KEY = "axis:contract";
|
|
7179
|
-
REQUIRED_PROOF_METADATA_KEY = "axis:required_proof";
|
|
7180
|
-
}
|
|
7181
|
-
});
|
|
7182
|
-
|
|
7183
7290
|
// src/decorators/index.ts
|
|
7184
7291
|
var decorators_exports = {};
|
|
7185
7292
|
__export(decorators_exports, {
|
|
7293
|
+
AXIS_ANONYMOUS_KEY: () => AXIS_ANONYMOUS_KEY,
|
|
7294
|
+
AXIS_PUBLIC_KEY: () => AXIS_PUBLIC_KEY,
|
|
7295
|
+
AXIS_RATE_LIMIT_KEY: () => AXIS_RATE_LIMIT_KEY,
|
|
7296
|
+
AxisAnonymous: () => AxisAnonymous,
|
|
7297
|
+
AxisPublic: () => AxisPublic,
|
|
7298
|
+
AxisRateLimit: () => AxisRateLimit,
|
|
7186
7299
|
CAPSULE_POLICY_METADATA_KEY: () => CAPSULE_POLICY_METADATA_KEY,
|
|
7187
7300
|
CHAIN_METADATA_KEY: () => CHAIN_METADATA_KEY,
|
|
7188
7301
|
CONTRACT_METADATA_KEY: () => CONTRACT_METADATA_KEY,
|
|
@@ -9324,14 +9437,18 @@ var index_exports = {};
|
|
|
9324
9437
|
__export(index_exports, {
|
|
9325
9438
|
ATS1_HDR: () => ATS1_HDR,
|
|
9326
9439
|
ATS1_SCHEMA: () => ATS1_SCHEMA,
|
|
9440
|
+
AXIS_ANONYMOUS_KEY: () => AXIS_ANONYMOUS_KEY,
|
|
9327
9441
|
AXIS_EXECUTION_CONTEXT_KEY: () => AXIS_EXECUTION_CONTEXT_KEY,
|
|
9328
9442
|
AXIS_MAGIC: () => import_axis_protocol2.AXIS_MAGIC,
|
|
9329
9443
|
AXIS_OPCODES: () => AXIS_OPCODES,
|
|
9444
|
+
AXIS_PUBLIC_KEY: () => AXIS_PUBLIC_KEY,
|
|
9445
|
+
AXIS_RATE_LIMIT_KEY: () => AXIS_RATE_LIMIT_KEY,
|
|
9330
9446
|
AXIS_UPLOAD_FILE_STORE: () => AXIS_UPLOAD_FILE_STORE,
|
|
9331
9447
|
AXIS_UPLOAD_RECEIPT_SIGNER: () => AXIS_UPLOAD_RECEIPT_SIGNER,
|
|
9332
9448
|
AXIS_UPLOAD_SESSION_STORE: () => AXIS_UPLOAD_SESSION_STORE,
|
|
9333
9449
|
AXIS_VERSION: () => import_axis_protocol2.AXIS_VERSION,
|
|
9334
9450
|
Ats1Codec: () => ats1_exports,
|
|
9451
|
+
AxisAnonymous: () => AxisAnonymous,
|
|
9335
9452
|
AxisChainExecutor: () => import_axis_chain.AxisChainExecutor,
|
|
9336
9453
|
AxisContext: () => import_axis_request.AxisContext,
|
|
9337
9454
|
AxisDemoPubkey: () => import_axis_request.AxisDemoPubkey,
|
|
@@ -9345,6 +9462,8 @@ __export(index_exports, {
|
|
|
9345
9462
|
AxisMediaTypes: () => AxisMediaTypes,
|
|
9346
9463
|
AxisPacketTags: () => T,
|
|
9347
9464
|
AxisPartialType: () => AxisPartialType,
|
|
9465
|
+
AxisPublic: () => AxisPublic,
|
|
9466
|
+
AxisRateLimit: () => AxisRateLimit,
|
|
9348
9467
|
AxisRaw: () => import_axis_request.AxisRaw,
|
|
9349
9468
|
AxisResponseDto: () => import_axis_response.AxisResponseDto,
|
|
9350
9469
|
AxisSensorChainService: () => import_axis_sensor_chain.AxisSensorChainService,
|
|
@@ -9356,9 +9475,12 @@ __export(index_exports, {
|
|
|
9356
9475
|
CCE_ERROR: () => CCE_ERROR,
|
|
9357
9476
|
CCE_PROTOCOL_VERSION: () => CCE_PROTOCOL_VERSION,
|
|
9358
9477
|
CHAIN_METADATA_KEY: () => CHAIN_METADATA_KEY,
|
|
9478
|
+
CONTRACT_METADATA_KEY: () => CONTRACT_METADATA_KEY,
|
|
9479
|
+
Capsule: () => Capsule,
|
|
9359
9480
|
CapsulePolicy: () => CapsulePolicy,
|
|
9360
9481
|
CceError: () => CceError,
|
|
9361
9482
|
Chain: () => Chain,
|
|
9483
|
+
Contract: () => Contract,
|
|
9362
9484
|
ContractViolationError: () => ContractViolationError,
|
|
9363
9485
|
DEFAULT_CONTRACTS: () => DEFAULT_CONTRACTS,
|
|
9364
9486
|
DEFAULT_TIMEOUT: () => DEFAULT_TIMEOUT,
|
|
@@ -9419,18 +9541,22 @@ __export(index_exports, {
|
|
|
9419
9541
|
PROOF_NONE: () => import_axis_protocol2.PROOF_NONE,
|
|
9420
9542
|
PROOF_WITNESS: () => import_axis_protocol2.PROOF_WITNESS,
|
|
9421
9543
|
ProofType: () => import_axis_protocol2.ProofType,
|
|
9544
|
+
REQUIRED_PROOF_METADATA_KEY: () => REQUIRED_PROOF_METADATA_KEY,
|
|
9422
9545
|
RESPONSE_TAG_CREATED_AT: () => import_axis_response.RESPONSE_TAG_CREATED_AT,
|
|
9423
9546
|
RESPONSE_TAG_CREATED_BY: () => import_axis_response.RESPONSE_TAG_CREATED_BY,
|
|
9424
9547
|
RESPONSE_TAG_ID: () => import_axis_response.RESPONSE_TAG_ID,
|
|
9425
9548
|
RESPONSE_TAG_UPDATED_AT: () => import_axis_response.RESPONSE_TAG_UPDATED_AT,
|
|
9426
9549
|
RESPONSE_TAG_UPDATED_BY: () => import_axis_response.RESPONSE_TAG_UPDATED_BY,
|
|
9550
|
+
RequiredProof: () => RequiredProof,
|
|
9427
9551
|
ResponseObserver: () => ResponseObserver,
|
|
9428
9552
|
RiskDecision: () => RiskDecision,
|
|
9553
|
+
SENSITIVITY_METADATA_KEY: () => SENSITIVITY_METADATA_KEY,
|
|
9429
9554
|
SENSOR_METADATA_KEY: () => SENSOR_METADATA_KEY,
|
|
9430
9555
|
Schema2002_PasskeyLoginOptionsRes: () => Schema2002_PasskeyLoginOptionsRes,
|
|
9431
9556
|
Schema2011_PasskeyLoginVerifyReq: () => Schema2011_PasskeyLoginVerifyReq,
|
|
9432
9557
|
Schema2012_PasskeyLoginVerifyRes: () => Schema2012_PasskeyLoginVerifyRes,
|
|
9433
9558
|
Schema2021_PasskeyRegisterOptionsReq: () => Schema2021_PasskeyRegisterOptionsReq,
|
|
9559
|
+
Sensitivity: () => Sensitivity,
|
|
9434
9560
|
Sensor: () => Sensor,
|
|
9435
9561
|
SensorDecisions: () => SensorDecisions,
|
|
9436
9562
|
SensorDiscoveryService: () => import_sensor_discovery.SensorDiscoveryService,
|
|
@@ -9478,6 +9604,7 @@ __export(index_exports, {
|
|
|
9478
9604
|
TlvRange: () => TlvRange,
|
|
9479
9605
|
TlvUtf8Pattern: () => TlvUtf8Pattern,
|
|
9480
9606
|
TlvValidate: () => TlvValidate,
|
|
9607
|
+
Witness: () => Witness,
|
|
9481
9608
|
axis1SigningBytes: () => axis1SigningBytes,
|
|
9482
9609
|
b64urlDecode: () => b64urlDecode,
|
|
9483
9610
|
b64urlDecodeString: () => b64urlDecodeString,
|
|
@@ -9576,6 +9703,7 @@ var init_index = __esm({
|
|
|
9576
9703
|
"src/index.ts"() {
|
|
9577
9704
|
init_chain_decorator();
|
|
9578
9705
|
init_capsule_policy_decorator();
|
|
9706
|
+
init_intent_policy_decorator();
|
|
9579
9707
|
init_handler_decorator();
|
|
9580
9708
|
init_intent_decorator();
|
|
9581
9709
|
init_intent_body_decorator();
|
|
@@ -9657,14 +9785,18 @@ init_index();
|
|
|
9657
9785
|
0 && (module.exports = {
|
|
9658
9786
|
ATS1_HDR,
|
|
9659
9787
|
ATS1_SCHEMA,
|
|
9788
|
+
AXIS_ANONYMOUS_KEY,
|
|
9660
9789
|
AXIS_EXECUTION_CONTEXT_KEY,
|
|
9661
9790
|
AXIS_MAGIC,
|
|
9662
9791
|
AXIS_OPCODES,
|
|
9792
|
+
AXIS_PUBLIC_KEY,
|
|
9793
|
+
AXIS_RATE_LIMIT_KEY,
|
|
9663
9794
|
AXIS_UPLOAD_FILE_STORE,
|
|
9664
9795
|
AXIS_UPLOAD_RECEIPT_SIGNER,
|
|
9665
9796
|
AXIS_UPLOAD_SESSION_STORE,
|
|
9666
9797
|
AXIS_VERSION,
|
|
9667
9798
|
Ats1Codec,
|
|
9799
|
+
AxisAnonymous,
|
|
9668
9800
|
AxisChainExecutor,
|
|
9669
9801
|
AxisContext,
|
|
9670
9802
|
AxisDemoPubkey,
|
|
@@ -9678,6 +9810,8 @@ init_index();
|
|
|
9678
9810
|
AxisMediaTypes,
|
|
9679
9811
|
AxisPacketTags,
|
|
9680
9812
|
AxisPartialType,
|
|
9813
|
+
AxisPublic,
|
|
9814
|
+
AxisRateLimit,
|
|
9681
9815
|
AxisRaw,
|
|
9682
9816
|
AxisResponseDto,
|
|
9683
9817
|
AxisSensorChainService,
|
|
@@ -9689,9 +9823,12 @@ init_index();
|
|
|
9689
9823
|
CCE_ERROR,
|
|
9690
9824
|
CCE_PROTOCOL_VERSION,
|
|
9691
9825
|
CHAIN_METADATA_KEY,
|
|
9826
|
+
CONTRACT_METADATA_KEY,
|
|
9827
|
+
Capsule,
|
|
9692
9828
|
CapsulePolicy,
|
|
9693
9829
|
CceError,
|
|
9694
9830
|
Chain,
|
|
9831
|
+
Contract,
|
|
9695
9832
|
ContractViolationError,
|
|
9696
9833
|
DEFAULT_CONTRACTS,
|
|
9697
9834
|
DEFAULT_TIMEOUT,
|
|
@@ -9752,18 +9889,22 @@ init_index();
|
|
|
9752
9889
|
PROOF_NONE,
|
|
9753
9890
|
PROOF_WITNESS,
|
|
9754
9891
|
ProofType,
|
|
9892
|
+
REQUIRED_PROOF_METADATA_KEY,
|
|
9755
9893
|
RESPONSE_TAG_CREATED_AT,
|
|
9756
9894
|
RESPONSE_TAG_CREATED_BY,
|
|
9757
9895
|
RESPONSE_TAG_ID,
|
|
9758
9896
|
RESPONSE_TAG_UPDATED_AT,
|
|
9759
9897
|
RESPONSE_TAG_UPDATED_BY,
|
|
9898
|
+
RequiredProof,
|
|
9760
9899
|
ResponseObserver,
|
|
9761
9900
|
RiskDecision,
|
|
9901
|
+
SENSITIVITY_METADATA_KEY,
|
|
9762
9902
|
SENSOR_METADATA_KEY,
|
|
9763
9903
|
Schema2002_PasskeyLoginOptionsRes,
|
|
9764
9904
|
Schema2011_PasskeyLoginVerifyReq,
|
|
9765
9905
|
Schema2012_PasskeyLoginVerifyRes,
|
|
9766
9906
|
Schema2021_PasskeyRegisterOptionsReq,
|
|
9907
|
+
Sensitivity,
|
|
9767
9908
|
Sensor,
|
|
9768
9909
|
SensorDecisions,
|
|
9769
9910
|
SensorDiscoveryService,
|
|
@@ -9811,6 +9952,7 @@ init_index();
|
|
|
9811
9952
|
TlvRange,
|
|
9812
9953
|
TlvUtf8Pattern,
|
|
9813
9954
|
TlvValidate,
|
|
9955
|
+
Witness,
|
|
9814
9956
|
axis1SigningBytes,
|
|
9815
9957
|
b64urlDecode,
|
|
9816
9958
|
b64urlDecodeString,
|