@atbash/sdk 0.13.0-dev.0 → 0.13.2-dev.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/browser.d.mts +7 -2
- package/dist/browser.mjs +8 -7
- package/dist/browser.mjs.map +1 -1
- package/dist/index.d.mts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +25 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -19
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -649,8 +649,13 @@ declare class Atbash {
|
|
|
649
649
|
private riskEngineRecords;
|
|
650
650
|
/**
|
|
651
651
|
* BRID for an org — one round-trip to the map, honoring the client's chain
|
|
652
|
-
* cache.
|
|
653
|
-
*
|
|
652
|
+
* cache. A "brand-new org" (nothing anywhere names its chain) is not an
|
|
653
|
+
* error — `resolveChainForOrg` returns the client default for that case and
|
|
654
|
+
* this helper returns its BRID. A transport failure or non-200 from
|
|
655
|
+
* `/api/org-network` IS an error and propagates: the caller cannot fall
|
|
656
|
+
* back to the default chain on outage, because with multi-chain live that
|
|
657
|
+
* silently reads from the wrong chain. Matches the Python binding's
|
|
658
|
+
* `_brid_for_org` semantics.
|
|
654
659
|
*/
|
|
655
660
|
private bridForOrg;
|
|
656
661
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -649,8 +649,13 @@ declare class Atbash {
|
|
|
649
649
|
private riskEngineRecords;
|
|
650
650
|
/**
|
|
651
651
|
* BRID for an org — one round-trip to the map, honoring the client's chain
|
|
652
|
-
* cache.
|
|
653
|
-
*
|
|
652
|
+
* cache. A "brand-new org" (nothing anywhere names its chain) is not an
|
|
653
|
+
* error — `resolveChainForOrg` returns the client default for that case and
|
|
654
|
+
* this helper returns its BRID. A transport failure or non-200 from
|
|
655
|
+
* `/api/org-network` IS an error and propagates: the caller cannot fall
|
|
656
|
+
* back to the default chain on outage, because with multi-chain live that
|
|
657
|
+
* silently reads from the wrong chain. Matches the Python binding's
|
|
658
|
+
* `_brid_for_org` semantics.
|
|
654
659
|
*/
|
|
655
660
|
private bridForOrg;
|
|
656
661
|
/**
|
package/dist/index.js
CHANGED
|
@@ -4430,15 +4430,16 @@ var Atbash = class _Atbash {
|
|
|
4430
4430
|
}
|
|
4431
4431
|
/**
|
|
4432
4432
|
* BRID for an org — one round-trip to the map, honoring the client's chain
|
|
4433
|
-
* cache.
|
|
4434
|
-
*
|
|
4433
|
+
* cache. A "brand-new org" (nothing anywhere names its chain) is not an
|
|
4434
|
+
* error — `resolveChainForOrg` returns the client default for that case and
|
|
4435
|
+
* this helper returns its BRID. A transport failure or non-200 from
|
|
4436
|
+
* `/api/org-network` IS an error and propagates: the caller cannot fall
|
|
4437
|
+
* back to the default chain on outage, because with multi-chain live that
|
|
4438
|
+
* silently reads from the wrong chain. Matches the Python binding's
|
|
4439
|
+
* `_brid_for_org` semantics.
|
|
4435
4440
|
*/
|
|
4436
4441
|
async bridForOrg(orgName) {
|
|
4437
|
-
|
|
4438
|
-
return (await this.resolveChainForOrg(orgName)).blockchainRid;
|
|
4439
|
-
} catch {
|
|
4440
|
-
return void 0;
|
|
4441
|
-
}
|
|
4442
|
+
return (await this.resolveChainForOrg(orgName)).blockchainRid;
|
|
4442
4443
|
}
|
|
4443
4444
|
/**
|
|
4444
4445
|
* BRID for the client's configured default org, if it has one.
|
|
@@ -4732,21 +4733,26 @@ async function scanMemory(entry, auth, opts) {
|
|
|
4732
4733
|
}
|
|
4733
4734
|
const KNOWN_ACTIONS = ["allow", "block", "hold_for_user_confirm"];
|
|
4734
4735
|
const action = result.actionType.trim().toLowerCase();
|
|
4735
|
-
if (result.verdict !== "No verdict" && !KNOWN_ACTIONS.includes(action)) {
|
|
4736
|
+
if (result.verdict !== "No verdict" && action !== "" && !KNOWN_ACTIONS.includes(action)) {
|
|
4736
4737
|
throw new Error(
|
|
4737
|
-
`memory scan: unrecognized action_type from judge (${result.actionType
|
|
4738
|
+
`memory scan: unrecognized action_type from judge (${result.actionType})`
|
|
4738
4739
|
);
|
|
4739
4740
|
}
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
result.
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
verdict =
|
|
4741
|
+
let verdict;
|
|
4742
|
+
if (action === "") {
|
|
4743
|
+
verdict = result.verdict === "BLOCK" ? "red" : result.verdict === "HOLD" ? "yellow" : "green";
|
|
4744
|
+
} else {
|
|
4745
|
+
const mapped = native.mapVerdict(
|
|
4746
|
+
action,
|
|
4747
|
+
result.confidence,
|
|
4748
|
+
threshold
|
|
4749
|
+
);
|
|
4750
|
+
verdict = mapped;
|
|
4751
|
+
if (result.verdict === "BLOCK") {
|
|
4752
|
+
verdict = "red";
|
|
4753
|
+
} else if (result.verdict === "HOLD" && mapped === "green") {
|
|
4754
|
+
verdict = "yellow";
|
|
4755
|
+
}
|
|
4750
4756
|
}
|
|
4751
4757
|
const parsed = native.parseScoreFromReason(result.reason);
|
|
4752
4758
|
const score = result.score ?? parsed.score ?? native.defaultScoreForVerdict(verdict);
|