@nextera.one/axis-server-sdk 0.7.0 → 0.8.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/README.md +2 -1
- package/dist/index.d.mts +5 -7
- package/dist/index.d.ts +5 -7
- package/dist/index.js +0 -47
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +0 -45
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1944,49 +1944,6 @@ var INTENT_REQUIREMENTS = {
|
|
|
1944
1944
|
"admin.*": ["admin"]
|
|
1945
1945
|
};
|
|
1946
1946
|
|
|
1947
|
-
// src/core/frame-validator.ts
|
|
1948
|
-
function validateFrameShape(frame) {
|
|
1949
|
-
if (!frame || typeof frame !== "object") {
|
|
1950
|
-
return false;
|
|
1951
|
-
}
|
|
1952
|
-
if (frame.v !== 1) {
|
|
1953
|
-
return false;
|
|
1954
|
-
}
|
|
1955
|
-
const requiredStrings = ["pid", "nonce", "actorId", "opcode"];
|
|
1956
|
-
for (const key of requiredStrings) {
|
|
1957
|
-
if (typeof frame[key] !== "string" || frame[key].length < 6) {
|
|
1958
|
-
return false;
|
|
1959
|
-
}
|
|
1960
|
-
}
|
|
1961
|
-
if (typeof frame.ts !== "number" || !Number.isFinite(frame.ts)) {
|
|
1962
|
-
return false;
|
|
1963
|
-
}
|
|
1964
|
-
if (frame.aud !== void 0 && (typeof frame.aud !== "string" || frame.aud.length === 0)) {
|
|
1965
|
-
return false;
|
|
1966
|
-
}
|
|
1967
|
-
if (!frame.sig || typeof frame.sig !== "object") {
|
|
1968
|
-
return false;
|
|
1969
|
-
}
|
|
1970
|
-
if (frame.sig.alg !== "EdDSA") {
|
|
1971
|
-
return false;
|
|
1972
|
-
}
|
|
1973
|
-
if (typeof frame.sig.kid !== "string" || frame.sig.kid.length < 8) {
|
|
1974
|
-
return false;
|
|
1975
|
-
}
|
|
1976
|
-
if (typeof frame.sig.value !== "string" || frame.sig.value.length < 32) {
|
|
1977
|
-
return false;
|
|
1978
|
-
}
|
|
1979
|
-
if (typeof frame.body !== "object" || frame.body === null) {
|
|
1980
|
-
return false;
|
|
1981
|
-
}
|
|
1982
|
-
return true;
|
|
1983
|
-
}
|
|
1984
|
-
function isTimestampValid(ts, skewSeconds = 120) {
|
|
1985
|
-
const now = Math.floor(Date.now() / 1e3);
|
|
1986
|
-
const diff = Math.abs(now - ts);
|
|
1987
|
-
return diff <= skewSeconds;
|
|
1988
|
-
}
|
|
1989
|
-
|
|
1990
1947
|
// src/core/opcodes.ts
|
|
1991
1948
|
var AXIS_OPCODES = /* @__PURE__ */ new Set([
|
|
1992
1949
|
"CAPSULE.ISSUE",
|
|
@@ -2230,7 +2187,6 @@ export {
|
|
|
2230
2187
|
hasScope,
|
|
2231
2188
|
isAdminOpcode,
|
|
2232
2189
|
isKnownOpcode,
|
|
2233
|
-
isTimestampValid,
|
|
2234
2190
|
nonce16,
|
|
2235
2191
|
normalizeSensorDecision,
|
|
2236
2192
|
packPasskeyLoginOptionsReq,
|
|
@@ -2249,7 +2205,6 @@ export {
|
|
|
2249
2205
|
unpackPasskeyLoginVerifyReq,
|
|
2250
2206
|
unpackPasskeyRegisterOptionsReq,
|
|
2251
2207
|
utf8,
|
|
2252
|
-
validateFrameShape,
|
|
2253
2208
|
varintLength,
|
|
2254
2209
|
varintU,
|
|
2255
2210
|
verifyFrameSignature
|