@vorim/sdk 4.5.0 → 4.6.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/CHANGELOG.md +13 -0
- package/dist/index.cjs +55 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +68 -0
- package/dist/index.d.ts +68 -0
- package/dist/index.js +55 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1219,6 +1219,74 @@ declare class VorimSDK {
|
|
|
1219
1219
|
* Returns a platform-sealed verdict to keep.
|
|
1220
1220
|
*/
|
|
1221
1221
|
gatewayCheck(input: GatewayCheckInput): Promise<any>;
|
|
1222
|
+
/**
|
|
1223
|
+
* AI incidents and near misses (4.6): kill-switch stops, tripwires that
|
|
1224
|
+
* refused, and sign-off packs that got worse, each with Vorim's suggested
|
|
1225
|
+
* classification and the firm's own assessment where recorded.
|
|
1226
|
+
*/
|
|
1227
|
+
listIncidents(params?: {
|
|
1228
|
+
days?: number;
|
|
1229
|
+
}): Promise<any[]>;
|
|
1230
|
+
/** One signed incident record, laid out as the FCA's PS26/2 standard template (`payload.ps26_2`). */
|
|
1231
|
+
getIncident(ref: string): Promise<any>;
|
|
1232
|
+
/**
|
|
1233
|
+
* Record the firm's assessment of an incident. `causeType` must be one of
|
|
1234
|
+
* the PS26/2 template's cause types; closing it stamps the resolution time.
|
|
1235
|
+
* Whether it is reportable is the firm's decision.
|
|
1236
|
+
*/
|
|
1237
|
+
updateIncident(ref: string, input: {
|
|
1238
|
+
status?: 'open' | 'resolved' | 'closed';
|
|
1239
|
+
classification?: 'incident' | 'near_miss' | 'not_an_incident' | null;
|
|
1240
|
+
reportable?: boolean | null;
|
|
1241
|
+
triggers?: Array<'consumer_harm' | 'market_integrity' | 'safety_soundness'>;
|
|
1242
|
+
incidentType?: 'disruption' | 'data_loss' | 'none' | null;
|
|
1243
|
+
severity?: 'low' | 'medium' | 'high' | null;
|
|
1244
|
+
title?: string | null;
|
|
1245
|
+
description?: string | null;
|
|
1246
|
+
actionsPlanned?: string | null;
|
|
1247
|
+
actionsTaken?: string | null;
|
|
1248
|
+
resolvedAt?: string | null;
|
|
1249
|
+
causeType?: string | null;
|
|
1250
|
+
origin?: 'internal' | 'external' | 'third_party' | 'unknown' | 'other' | null;
|
|
1251
|
+
thirdPartyName?: string | null;
|
|
1252
|
+
}): Promise<any>;
|
|
1253
|
+
/** A signed statement of delegated authority for one agent: identity, authority, accountability, execution, and the gaps a reviewer will ask about. */
|
|
1254
|
+
getAuthorityStatement(agentId: string): Promise<any>;
|
|
1255
|
+
/**
|
|
1256
|
+
* Import a Mastercard Verifiable Intent autonomous mandate (L1 issuer
|
|
1257
|
+
* credential + L2 customer mandate, payment side) as a pending Vorim
|
|
1258
|
+
* mandate. The customer key in L1 still signs `signing_input` to activate it.
|
|
1259
|
+
* Limits Vorim cannot enforce are refused by name (422).
|
|
1260
|
+
*/
|
|
1261
|
+
importVerifiableIntent(input: {
|
|
1262
|
+
l1: string;
|
|
1263
|
+
l2: string;
|
|
1264
|
+
issuerJwk: Record<string, unknown>;
|
|
1265
|
+
agentId: string;
|
|
1266
|
+
customerRef: string;
|
|
1267
|
+
actionTypes?: string[];
|
|
1268
|
+
expectedAud?: string;
|
|
1269
|
+
}): Promise<any>;
|
|
1270
|
+
/**
|
|
1271
|
+
* Verify a Visa Trusted Agent Protocol message signature on a request your
|
|
1272
|
+
* site received: the signature over "@authority" and "@path", the 8-minute
|
|
1273
|
+
* window, the tag (`agent-browser-auth` or `agent-payer-auth`) and a nonce
|
|
1274
|
+
* used once. Keys come from the key directory configured on the server, or
|
|
1275
|
+
* pass `keys`. Needs an API key with runtime:decide.
|
|
1276
|
+
*/
|
|
1277
|
+
verifyTap(input: {
|
|
1278
|
+
url: string;
|
|
1279
|
+
headers: Record<string, string>;
|
|
1280
|
+
keys?: Record<string, unknown>[];
|
|
1281
|
+
requireTag?: 'agent-browser-auth' | 'agent-payer-auth';
|
|
1282
|
+
}): Promise<{
|
|
1283
|
+
ok: boolean;
|
|
1284
|
+
reasons: string[];
|
|
1285
|
+
tag: string | null;
|
|
1286
|
+
keyid: string | null;
|
|
1287
|
+
alg: string | null;
|
|
1288
|
+
nonce: string | null;
|
|
1289
|
+
}>;
|
|
1222
1290
|
/** Check any sealed Vorim document (case pack, sign-off, gateway verdict, mandate record). Public endpoint. */
|
|
1223
1291
|
verifyEvidence(doc: {
|
|
1224
1292
|
payload: unknown;
|
package/dist/index.d.ts
CHANGED
|
@@ -1219,6 +1219,74 @@ declare class VorimSDK {
|
|
|
1219
1219
|
* Returns a platform-sealed verdict to keep.
|
|
1220
1220
|
*/
|
|
1221
1221
|
gatewayCheck(input: GatewayCheckInput): Promise<any>;
|
|
1222
|
+
/**
|
|
1223
|
+
* AI incidents and near misses (4.6): kill-switch stops, tripwires that
|
|
1224
|
+
* refused, and sign-off packs that got worse, each with Vorim's suggested
|
|
1225
|
+
* classification and the firm's own assessment where recorded.
|
|
1226
|
+
*/
|
|
1227
|
+
listIncidents(params?: {
|
|
1228
|
+
days?: number;
|
|
1229
|
+
}): Promise<any[]>;
|
|
1230
|
+
/** One signed incident record, laid out as the FCA's PS26/2 standard template (`payload.ps26_2`). */
|
|
1231
|
+
getIncident(ref: string): Promise<any>;
|
|
1232
|
+
/**
|
|
1233
|
+
* Record the firm's assessment of an incident. `causeType` must be one of
|
|
1234
|
+
* the PS26/2 template's cause types; closing it stamps the resolution time.
|
|
1235
|
+
* Whether it is reportable is the firm's decision.
|
|
1236
|
+
*/
|
|
1237
|
+
updateIncident(ref: string, input: {
|
|
1238
|
+
status?: 'open' | 'resolved' | 'closed';
|
|
1239
|
+
classification?: 'incident' | 'near_miss' | 'not_an_incident' | null;
|
|
1240
|
+
reportable?: boolean | null;
|
|
1241
|
+
triggers?: Array<'consumer_harm' | 'market_integrity' | 'safety_soundness'>;
|
|
1242
|
+
incidentType?: 'disruption' | 'data_loss' | 'none' | null;
|
|
1243
|
+
severity?: 'low' | 'medium' | 'high' | null;
|
|
1244
|
+
title?: string | null;
|
|
1245
|
+
description?: string | null;
|
|
1246
|
+
actionsPlanned?: string | null;
|
|
1247
|
+
actionsTaken?: string | null;
|
|
1248
|
+
resolvedAt?: string | null;
|
|
1249
|
+
causeType?: string | null;
|
|
1250
|
+
origin?: 'internal' | 'external' | 'third_party' | 'unknown' | 'other' | null;
|
|
1251
|
+
thirdPartyName?: string | null;
|
|
1252
|
+
}): Promise<any>;
|
|
1253
|
+
/** A signed statement of delegated authority for one agent: identity, authority, accountability, execution, and the gaps a reviewer will ask about. */
|
|
1254
|
+
getAuthorityStatement(agentId: string): Promise<any>;
|
|
1255
|
+
/**
|
|
1256
|
+
* Import a Mastercard Verifiable Intent autonomous mandate (L1 issuer
|
|
1257
|
+
* credential + L2 customer mandate, payment side) as a pending Vorim
|
|
1258
|
+
* mandate. The customer key in L1 still signs `signing_input` to activate it.
|
|
1259
|
+
* Limits Vorim cannot enforce are refused by name (422).
|
|
1260
|
+
*/
|
|
1261
|
+
importVerifiableIntent(input: {
|
|
1262
|
+
l1: string;
|
|
1263
|
+
l2: string;
|
|
1264
|
+
issuerJwk: Record<string, unknown>;
|
|
1265
|
+
agentId: string;
|
|
1266
|
+
customerRef: string;
|
|
1267
|
+
actionTypes?: string[];
|
|
1268
|
+
expectedAud?: string;
|
|
1269
|
+
}): Promise<any>;
|
|
1270
|
+
/**
|
|
1271
|
+
* Verify a Visa Trusted Agent Protocol message signature on a request your
|
|
1272
|
+
* site received: the signature over "@authority" and "@path", the 8-minute
|
|
1273
|
+
* window, the tag (`agent-browser-auth` or `agent-payer-auth`) and a nonce
|
|
1274
|
+
* used once. Keys come from the key directory configured on the server, or
|
|
1275
|
+
* pass `keys`. Needs an API key with runtime:decide.
|
|
1276
|
+
*/
|
|
1277
|
+
verifyTap(input: {
|
|
1278
|
+
url: string;
|
|
1279
|
+
headers: Record<string, string>;
|
|
1280
|
+
keys?: Record<string, unknown>[];
|
|
1281
|
+
requireTag?: 'agent-browser-auth' | 'agent-payer-auth';
|
|
1282
|
+
}): Promise<{
|
|
1283
|
+
ok: boolean;
|
|
1284
|
+
reasons: string[];
|
|
1285
|
+
tag: string | null;
|
|
1286
|
+
keyid: string | null;
|
|
1287
|
+
alg: string | null;
|
|
1288
|
+
nonce: string | null;
|
|
1289
|
+
}>;
|
|
1222
1290
|
/** Check any sealed Vorim document (case pack, sign-off, gateway verdict, mandate record). Public endpoint. */
|
|
1223
1291
|
verifyEvidence(doc: {
|
|
1224
1292
|
payload: unknown;
|
package/dist/index.js
CHANGED
|
@@ -875,7 +875,7 @@ function canonicalIntent(value) {
|
|
|
875
875
|
const keys = Object.keys(obj).filter((k) => obj[k] !== void 0).sort();
|
|
876
876
|
return `{${keys.map((k) => `${JSON.stringify(k)}:${canonicalIntent(obj[k])}`).join(",")}}`;
|
|
877
877
|
}
|
|
878
|
-
var SDK_VERSION = true ? "4.
|
|
878
|
+
var SDK_VERSION = true ? "4.6.0" : "0.0.0";
|
|
879
879
|
var USER_AGENT = `vorim-sdk/${SDK_VERSION}`;
|
|
880
880
|
function sleep(ms) {
|
|
881
881
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
@@ -2244,6 +2244,60 @@ var VorimSDK = class _VorimSDK {
|
|
|
2244
2244
|
max_age_seconds: input.maxAgeSeconds
|
|
2245
2245
|
});
|
|
2246
2246
|
}
|
|
2247
|
+
/**
|
|
2248
|
+
* AI incidents and near misses (4.6): kill-switch stops, tripwires that
|
|
2249
|
+
* refused, and sign-off packs that got worse, each with Vorim's suggested
|
|
2250
|
+
* classification and the firm's own assessment where recorded.
|
|
2251
|
+
*/
|
|
2252
|
+
async listIncidents(params = {}) {
|
|
2253
|
+
return this.get(`/evidence/incidents${params.days ? `?days=${encodeURIComponent(String(params.days))}` : ""}`);
|
|
2254
|
+
}
|
|
2255
|
+
/** One signed incident record, laid out as the FCA's PS26/2 standard template (`payload.ps26_2`). */
|
|
2256
|
+
async getIncident(ref) {
|
|
2257
|
+
return this.get(`/evidence/incidents/${encodeURIComponent(ref)}`);
|
|
2258
|
+
}
|
|
2259
|
+
/**
|
|
2260
|
+
* Record the firm's assessment of an incident. `causeType` must be one of
|
|
2261
|
+
* the PS26/2 template's cause types; closing it stamps the resolution time.
|
|
2262
|
+
* Whether it is reportable is the firm's decision.
|
|
2263
|
+
*/
|
|
2264
|
+
async updateIncident(ref, input) {
|
|
2265
|
+
const map = { incidentType: "incident_type", actionsPlanned: "actions_planned", actionsTaken: "actions_taken", resolvedAt: "resolved_at", causeType: "cause_type", thirdPartyName: "third_party_name" };
|
|
2266
|
+
const body = {};
|
|
2267
|
+
for (const [k, v] of Object.entries(input)) if (v !== void 0) body[map[k] ?? k] = v;
|
|
2268
|
+
return this.patch(`/evidence/incidents/${encodeURIComponent(ref)}`, body);
|
|
2269
|
+
}
|
|
2270
|
+
/** A signed statement of delegated authority for one agent: identity, authority, accountability, execution, and the gaps a reviewer will ask about. */
|
|
2271
|
+
async getAuthorityStatement(agentId) {
|
|
2272
|
+
return this.get(`/evidence/authority/${encodeURIComponent(agentId)}`);
|
|
2273
|
+
}
|
|
2274
|
+
/**
|
|
2275
|
+
* Import a Mastercard Verifiable Intent autonomous mandate (L1 issuer
|
|
2276
|
+
* credential + L2 customer mandate, payment side) as a pending Vorim
|
|
2277
|
+
* mandate. The customer key in L1 still signs `signing_input` to activate it.
|
|
2278
|
+
* Limits Vorim cannot enforce are refused by name (422).
|
|
2279
|
+
*/
|
|
2280
|
+
async importVerifiableIntent(input) {
|
|
2281
|
+
return this.post("/mandates/import-verifiable-intent", {
|
|
2282
|
+
l1: input.l1,
|
|
2283
|
+
l2: input.l2,
|
|
2284
|
+
issuer_jwk: input.issuerJwk,
|
|
2285
|
+
agent_id: input.agentId,
|
|
2286
|
+
customer_ref: input.customerRef,
|
|
2287
|
+
action_types: input.actionTypes,
|
|
2288
|
+
expected_aud: input.expectedAud
|
|
2289
|
+
});
|
|
2290
|
+
}
|
|
2291
|
+
/**
|
|
2292
|
+
* Verify a Visa Trusted Agent Protocol message signature on a request your
|
|
2293
|
+
* site received: the signature over "@authority" and "@path", the 8-minute
|
|
2294
|
+
* window, the tag (`agent-browser-auth` or `agent-payer-auth`) and a nonce
|
|
2295
|
+
* used once. Keys come from the key directory configured on the server, or
|
|
2296
|
+
* pass `keys`. Needs an API key with runtime:decide.
|
|
2297
|
+
*/
|
|
2298
|
+
async verifyTap(input) {
|
|
2299
|
+
return this.post("/gateway/tap/verify", { url: input.url, headers: input.headers, keys: input.keys, require_tag: input.requireTag });
|
|
2300
|
+
}
|
|
2247
2301
|
/** Check any sealed Vorim document (case pack, sign-off, gateway verdict, mandate record). Public endpoint. */
|
|
2248
2302
|
async verifyEvidence(doc) {
|
|
2249
2303
|
return this.post("/evidence/verify", { payload: doc.payload, hash: doc.hash, signature: doc.signature });
|