@vorim/sdk 4.4.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 +26 -0
- package/dist/{_commerce-core-B800cza0.d.cts → _commerce-core-QF7IKCKQ.d.cts} +1 -1
- package/dist/{_commerce-core-Bv_2hfKP.d.ts → _commerce-core-jih7k4hQ.d.ts} +1 -1
- package/dist/index.cjs +253 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +219 -3
- package/dist/index.d.ts +219 -3
- package/dist/index.js +252 -3
- package/dist/index.js.map +1 -1
- package/dist/integrations/amazon.d.cts +2 -2
- package/dist/integrations/amazon.d.ts +2 -2
- package/dist/integrations/anthropic.d.cts +1 -1
- package/dist/integrations/anthropic.d.ts +1 -1
- package/dist/integrations/ap2.d.cts +1 -1
- package/dist/integrations/ap2.d.ts +1 -1
- package/dist/integrations/aws-iam.d.cts +1 -1
- package/dist/integrations/aws-iam.d.ts +1 -1
- package/dist/integrations/bank-rails.d.cts +1 -1
- package/dist/integrations/bank-rails.d.ts +1 -1
- package/dist/integrations/circle.d.cts +1 -1
- package/dist/integrations/circle.d.ts +1 -1
- package/dist/integrations/cloudflare.d.cts +1 -1
- package/dist/integrations/cloudflare.d.ts +1 -1
- package/dist/integrations/coinbase-cdp.d.cts +1 -1
- package/dist/integrations/coinbase-cdp.d.ts +1 -1
- package/dist/integrations/commerce-agents.d.cts +1 -1
- package/dist/integrations/commerce-agents.d.ts +1 -1
- package/dist/integrations/crewai.d.cts +1 -1
- package/dist/integrations/crewai.d.ts +1 -1
- package/dist/integrations/delivery.d.cts +2 -2
- package/dist/integrations/delivery.d.ts +2 -2
- package/dist/integrations/ebay.d.cts +2 -2
- package/dist/integrations/ebay.d.ts +2 -2
- package/dist/integrations/entra.d.cts +1 -1
- package/dist/integrations/entra.d.ts +1 -1
- package/dist/integrations/etsy.d.cts +2 -2
- package/dist/integrations/etsy.d.ts +2 -2
- package/dist/integrations/eu-providers.d.cts +1 -1
- package/dist/integrations/eu-providers.d.ts +1 -1
- package/dist/integrations/fhir.d.cts +1 -1
- package/dist/integrations/fhir.d.ts +1 -1
- package/dist/integrations/google-merchant.d.cts +2 -2
- package/dist/integrations/google-merchant.d.ts +2 -2
- package/dist/integrations/grok.d.cts +1 -1
- package/dist/integrations/grok.d.ts +1 -1
- package/dist/integrations/guidewire.d.cts +1 -1
- package/dist/integrations/guidewire.d.ts +1 -1
- package/dist/integrations/hermes.d.cts +1 -1
- package/dist/integrations/hermes.d.ts +1 -1
- package/dist/integrations/jira.d.cts +1 -1
- package/dist/integrations/jira.d.ts +1 -1
- package/dist/integrations/langchain.d.cts +1 -1
- package/dist/integrations/langchain.d.ts +1 -1
- package/dist/integrations/langgraph.d.cts +1 -1
- package/dist/integrations/langgraph.d.ts +1 -1
- package/dist/integrations/legal.d.cts +1 -1
- package/dist/integrations/legal.d.ts +1 -1
- package/dist/integrations/life-sciences.d.cts +1 -1
- package/dist/integrations/life-sciences.d.ts +1 -1
- package/dist/integrations/linear.d.cts +1 -1
- package/dist/integrations/linear.d.ts +1 -1
- package/dist/integrations/lithic.d.cts +1 -1
- package/dist/integrations/lithic.d.ts +1 -1
- package/dist/integrations/llamaindex.d.cts +1 -1
- package/dist/integrations/llamaindex.d.ts +1 -1
- package/dist/integrations/marqeta.d.cts +1 -1
- package/dist/integrations/marqeta.d.ts +1 -1
- package/dist/integrations/meta.d.cts +2 -2
- package/dist/integrations/meta.d.ts +2 -2
- package/dist/integrations/mistral.d.cts +1 -1
- package/dist/integrations/mistral.d.ts +1 -1
- package/dist/integrations/modern-treasury.d.cts +1 -1
- package/dist/integrations/modern-treasury.d.ts +1 -1
- package/dist/integrations/muse.d.cts +1 -1
- package/dist/integrations/muse.d.ts +1 -1
- package/dist/integrations/nekuda.d.cts +1 -1
- package/dist/integrations/nekuda.d.ts +1 -1
- package/dist/integrations/okta.d.cts +1 -1
- package/dist/integrations/okta.d.ts +1 -1
- package/dist/integrations/openai.d.cts +1 -1
- package/dist/integrations/openai.d.ts +1 -1
- package/dist/integrations/openrouter.d.cts +1 -1
- package/dist/integrations/openrouter.d.ts +1 -1
- package/dist/integrations/paypal-agent.d.cts +1 -1
- package/dist/integrations/paypal-agent.d.ts +1 -1
- package/dist/integrations/perplexity.d.cts +1 -1
- package/dist/integrations/perplexity.d.ts +1 -1
- package/dist/integrations/plaid.d.cts +1 -1
- package/dist/integrations/plaid.d.ts +1 -1
- package/dist/integrations/ramp.d.cts +1 -1
- package/dist/integrations/ramp.d.ts +1 -1
- package/dist/integrations/shopify.d.cts +1 -1
- package/dist/integrations/shopify.d.ts +1 -1
- package/dist/integrations/siem.d.cts +1 -1
- package/dist/integrations/siem.d.ts +1 -1
- package/dist/integrations/skyfire.d.cts +1 -1
- package/dist/integrations/skyfire.d.ts +1 -1
- package/dist/integrations/social-ads.d.cts +2 -2
- package/dist/integrations/social-ads.d.ts +2 -2
- package/dist/integrations/stripe-acp.d.cts +1 -1
- package/dist/integrations/stripe-acp.d.ts +1 -1
- package/dist/integrations/stripe-issuing.d.cts +1 -1
- package/dist/integrations/stripe-issuing.d.ts +1 -1
- package/dist/integrations/tiktok-shop.d.cts +2 -2
- package/dist/integrations/tiktok-shop.d.ts +2 -2
- package/dist/integrations/truanon.d.cts +1 -1
- package/dist/integrations/truanon.d.ts +1 -1
- package/dist/integrations/typesafe.d.cts +1 -1
- package/dist/integrations/typesafe.d.ts +1 -1
- package/dist/integrations/ucp.d.cts +1 -1
- package/dist/integrations/ucp.d.ts +1 -1
- package/dist/integrations/vercel-ai.d.cts +1 -1
- package/dist/integrations/vercel-ai.d.ts +1 -1
- package/dist/integrations/walmart.d.cts +2 -2
- package/dist/integrations/walmart.d.ts +2 -2
- package/dist/integrations/x402.d.cts +1 -1
- package/dist/integrations/x402.d.ts +1 -1
- package/dist/{types-BI7fk5gL.d.cts → types-3hhqtL0W.d.cts} +98 -1
- package/dist/{types-BI7fk5gL.d.ts → types-3hhqtL0W.d.ts} +98 -1
- package/package.json +1 -1
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));
|
|
@@ -1497,7 +1497,9 @@ var VorimSDK = class _VorimSDK {
|
|
|
1497
1497
|
trace_id: input.traceId,
|
|
1498
1498
|
span_id: input.spanId,
|
|
1499
1499
|
traceparent: input.traceparent,
|
|
1500
|
-
intent_id: input.intentId
|
|
1500
|
+
intent_id: input.intentId,
|
|
1501
|
+
case_ref: input.caseRef,
|
|
1502
|
+
mandate_id: input.mandateId
|
|
1501
1503
|
};
|
|
1502
1504
|
let raw;
|
|
1503
1505
|
try {
|
|
@@ -2033,7 +2035,11 @@ var VorimSDK = class _VorimSDK {
|
|
|
2033
2035
|
workflow_id: input.workflowId,
|
|
2034
2036
|
...signed,
|
|
2035
2037
|
expected_outcome: input.expectedOutcome,
|
|
2036
|
-
review_at: input.reviewAt
|
|
2038
|
+
review_at: input.reviewAt,
|
|
2039
|
+
case_ref: input.caseRef,
|
|
2040
|
+
product: input.product,
|
|
2041
|
+
vulnerable_customer: input.vulnerableCustomer,
|
|
2042
|
+
vulnerability_drivers: input.vulnerabilityDrivers
|
|
2037
2043
|
});
|
|
2038
2044
|
}
|
|
2039
2045
|
/**
|
|
@@ -2057,6 +2063,245 @@ var VorimSDK = class _VorimSDK {
|
|
|
2057
2063
|
const s = q.toString();
|
|
2058
2064
|
return this.get(`/intents/ledger${s ? `?${s}` : ""}`);
|
|
2059
2065
|
}
|
|
2066
|
+
// ─── Customer mandates ──────────────────────────────────────────────────
|
|
2067
|
+
/**
|
|
2068
|
+
* Create a pending customer mandate. Returns `signing_input`: the exact text
|
|
2069
|
+
* the customer's device must sign (ES256 raw r||s or DER, base64url) before
|
|
2070
|
+
* `activateMandate`. The private key stays on the customer's device.
|
|
2071
|
+
*
|
|
2072
|
+
* @example
|
|
2073
|
+
* const { mandate, signing_input } = await vorim.createMandate({
|
|
2074
|
+
* agentId, customerRef: 'cust_7731', alg: 'ES256', publicKeyJwk: phoneJwk,
|
|
2075
|
+
* terms: { actionTypes: ['initiate_payment'], maxAmount: 5000, currency: 'GBP', maxTotal: 20000 },
|
|
2076
|
+
* expiresAt: new Date(Date.now() + 30 * 86400e3).toISOString(),
|
|
2077
|
+
* });
|
|
2078
|
+
* // ... the customer's app signs signing_input ...
|
|
2079
|
+
* await vorim.activateMandate(mandate.mandate_id, signatureFromPhone);
|
|
2080
|
+
* await vorim.beforeAction({ agentId, actionType: 'initiate_payment', payload: { amount: 4000, currency: 'GBP' }, mandateId: mandate.mandate_id });
|
|
2081
|
+
*/
|
|
2082
|
+
async createMandate(input) {
|
|
2083
|
+
const t = input.terms;
|
|
2084
|
+
return this.post("/mandates", {
|
|
2085
|
+
agent_id: input.agentId,
|
|
2086
|
+
customer_ref: input.customerRef,
|
|
2087
|
+
alg: input.alg,
|
|
2088
|
+
public_key_jwk: input.publicKeyJwk,
|
|
2089
|
+
terms: {
|
|
2090
|
+
action_types: t.actionTypes,
|
|
2091
|
+
targets: t.targets,
|
|
2092
|
+
max_amount: t.maxAmount,
|
|
2093
|
+
currency: t.currency,
|
|
2094
|
+
max_total: t.maxTotal,
|
|
2095
|
+
max_uses: t.maxUses,
|
|
2096
|
+
read_only: t.readOnly,
|
|
2097
|
+
amount_field: t.amountField
|
|
2098
|
+
},
|
|
2099
|
+
expires_at: input.expiresAt,
|
|
2100
|
+
key_attestation: !input.keyAttestation ? void 0 : input.keyAttestation.format === "android-key" ? { format: "android-key", certificate_chain: input.keyAttestation.certificateChain, challenge: input.keyAttestation.challenge } : {
|
|
2101
|
+
format: "apple-app-attest",
|
|
2102
|
+
attestation_object: input.keyAttestation.attestationObject,
|
|
2103
|
+
key_id: input.keyAttestation.keyId,
|
|
2104
|
+
app_id: input.keyAttestation.appId,
|
|
2105
|
+
environment: input.keyAttestation.environment,
|
|
2106
|
+
challenge: input.keyAttestation.challenge
|
|
2107
|
+
},
|
|
2108
|
+
webauthn: input.webauthn ? { rp_id: input.webauthn.rpId, origin: input.webauthn.origin } : void 0
|
|
2109
|
+
});
|
|
2110
|
+
}
|
|
2111
|
+
/**
|
|
2112
|
+
* The mandate as an AP2 (Agent Payments Protocol v0.2) open Payment Mandate:
|
|
2113
|
+
* an SD-JWT signed by Vorim, `vct: "mandate.payment.open.1"`, with the
|
|
2114
|
+
* limits as AP2 constraints. `not_expressed_in_ap2` lists anything AP2
|
|
2115
|
+
* cannot carry.
|
|
2116
|
+
*/
|
|
2117
|
+
async exportMandateAp2(mandateId) {
|
|
2118
|
+
return this.get(`/mandates/${encodeURIComponent(mandateId)}/ap2`);
|
|
2119
|
+
}
|
|
2120
|
+
/**
|
|
2121
|
+
* Import an AP2 open Payment Mandate (SD-JWT, disclosures applied) as a
|
|
2122
|
+
* pending Vorim mandate. The issuer signature must verify against
|
|
2123
|
+
* `issuerJwk`; constraints Vorim cannot enforce are refused. The
|
|
2124
|
+
* customer's key (`cnf.jwk`) still signs `signing_input` to activate it.
|
|
2125
|
+
*/
|
|
2126
|
+
async importAp2Mandate(input) {
|
|
2127
|
+
return this.post("/mandates/import-ap2", { sd_jwt: input.sdJwt, issuer_jwk: input.issuerJwk, agent_id: input.agentId, customer_ref: input.customerRef, action_types: input.actionTypes });
|
|
2128
|
+
}
|
|
2129
|
+
/** A one-time challenge (10 minutes) for a hardware key attestation on `createMandate`. */
|
|
2130
|
+
async getAttestationChallenge() {
|
|
2131
|
+
return this.post("/mandates/attestation-challenge", {});
|
|
2132
|
+
}
|
|
2133
|
+
/** Activate a mandate with the customer's signature over its `signing_input`. Returns the countersigned record. */
|
|
2134
|
+
async activateMandate(mandateId, signature) {
|
|
2135
|
+
return this.post(`/mandates/${encodeURIComponent(mandateId)}/activate`, { signature });
|
|
2136
|
+
}
|
|
2137
|
+
/** The firm revokes a mandate; every later action under it is refused. */
|
|
2138
|
+
async revokeMandate(mandateId, reason) {
|
|
2139
|
+
return this.post(`/mandates/${encodeURIComponent(mandateId)}/revoke`, { reason });
|
|
2140
|
+
}
|
|
2141
|
+
async getMandate(mandateId) {
|
|
2142
|
+
return this.get(`/mandates/${encodeURIComponent(mandateId)}`);
|
|
2143
|
+
}
|
|
2144
|
+
async listMandates(params = {}) {
|
|
2145
|
+
const q = new URLSearchParams();
|
|
2146
|
+
if (params.agentId) q.set("agent_id", params.agentId);
|
|
2147
|
+
if (params.customerRef) q.set("customer_ref", params.customerRef);
|
|
2148
|
+
if (params.limit) q.set("limit", String(params.limit));
|
|
2149
|
+
const s = q.toString();
|
|
2150
|
+
return this.get(`/mandates${s ? `?${s}` : ""}`);
|
|
2151
|
+
}
|
|
2152
|
+
/** The countersigned record, every decision taken under the mandate, and a verification result. */
|
|
2153
|
+
async getMandateEvidence(mandateId) {
|
|
2154
|
+
return this.get(`/mandates/${encodeURIComponent(mandateId)}/evidence`);
|
|
2155
|
+
}
|
|
2156
|
+
/**
|
|
2157
|
+
* The customer withdraws a mandate with their own key; no Vorim account
|
|
2158
|
+
* is involved. Sign `mandateWithdrawalLine(mandateId, signedAt)` on the
|
|
2159
|
+
* device (signedAt within 5 minutes of now) and pass the signature here.
|
|
2160
|
+
*/
|
|
2161
|
+
async withdrawMandate(mandateId, signedAt, signature) {
|
|
2162
|
+
return this.post(`/mandates/${encodeURIComponent(mandateId)}/withdraw`, { signed_at: signedAt, signature });
|
|
2163
|
+
}
|
|
2164
|
+
// ─── Evidence ───────────────────────────────────────────────────────────
|
|
2165
|
+
/** Case references seen in the last `days` (default 90). */
|
|
2166
|
+
async listCases(params = {}) {
|
|
2167
|
+
return this.get(`/evidence/cases${params.days ? `?days=${encodeURIComponent(String(params.days))}` : ""}`);
|
|
2168
|
+
}
|
|
2169
|
+
/** A platform-signed case pack for one case reference: decisions, approvals, intents, outcomes, mandates. */
|
|
2170
|
+
async getCasePack(caseRef) {
|
|
2171
|
+
return this.get(`/evidence/cases/${encodeURIComponent(caseRef)}/pack`);
|
|
2172
|
+
}
|
|
2173
|
+
/**
|
|
2174
|
+
* Keep a case pack, stamped by an RFC 3161 Time Stamping Authority unless
|
|
2175
|
+
* `timestamp: false`. If the TSA cannot be reached the pack is still kept
|
|
2176
|
+
* and `timestamp.ok` is false with the error.
|
|
2177
|
+
*/
|
|
2178
|
+
async storeCasePack(caseRef, input = {}) {
|
|
2179
|
+
return this.post(`/evidence/cases/${encodeURIComponent(caseRef)}/packs`, input);
|
|
2180
|
+
}
|
|
2181
|
+
async listStoredCasePacks(caseRef) {
|
|
2182
|
+
return this.get(`/evidence/cases/${encodeURIComponent(caseRef)}/packs`);
|
|
2183
|
+
}
|
|
2184
|
+
/** A kept case pack with its timestamp token and the openssl command to verify it. */
|
|
2185
|
+
async getStoredCasePack(id) {
|
|
2186
|
+
return this.get(`/evidence/case-pack/${encodeURIComponent(id)}`);
|
|
2187
|
+
}
|
|
2188
|
+
/**
|
|
2189
|
+
* Record what later happened to an action: `complaint`, `chargeback`,
|
|
2190
|
+
* `fraud_confirmed`, `refund_reversed` or `no_issue`. The savings report
|
|
2191
|
+
* uses these to show which bad outcomes a shadow rule would have caught.
|
|
2192
|
+
*/
|
|
2193
|
+
async recordActionOutcome(input) {
|
|
2194
|
+
return this.post("/evidence/outcomes", { decision_id: input.decisionId, kind: input.kind, amount: input.amount, currency: input.currency, occurred_at: input.occurredAt, note: input.note });
|
|
2195
|
+
}
|
|
2196
|
+
/** What rules did and shadow rules would have done, costed at your own review assumptions. */
|
|
2197
|
+
async getSavingsReport(params = {}) {
|
|
2198
|
+
const q = new URLSearchParams();
|
|
2199
|
+
if (params.days) q.set("days", String(params.days));
|
|
2200
|
+
if (params.reviewMinutes) q.set("review_minutes", String(params.reviewMinutes));
|
|
2201
|
+
if (params.hourlyCost !== void 0) q.set("hourly_cost", String(params.hourlyCost));
|
|
2202
|
+
if (params.currency) q.set("currency", params.currency);
|
|
2203
|
+
if (params.agentId) q.set("agent_id", params.agentId);
|
|
2204
|
+
return this.get(`/evidence/savings?${q.toString()}`);
|
|
2205
|
+
}
|
|
2206
|
+
/** Consumer Duty outcomes by product, vulnerability and FG21/1 driver. */
|
|
2207
|
+
async getConsumerDutyReport(params = {}) {
|
|
2208
|
+
return this.get(`/evidence/consumer-duty${params.days ? `?days=${encodeURIComponent(String(params.days))}` : ""}`);
|
|
2209
|
+
}
|
|
2210
|
+
/** Record what a good (and poor) outcome looks like for a product. */
|
|
2211
|
+
async setOutcomeDefinition(input) {
|
|
2212
|
+
return this.put("/evidence/outcome-definitions", input);
|
|
2213
|
+
}
|
|
2214
|
+
/**
|
|
2215
|
+
* Run a sign-off pack for one agent: scenarios through the real gate in
|
|
2216
|
+
* shadow, answers to the risk committee's questions, signed and stored.
|
|
2217
|
+
*/
|
|
2218
|
+
async runSignoff(agentId, input = {}) {
|
|
2219
|
+
return this.post(`/evidence/signoffs/${encodeURIComponent(agentId)}`, input);
|
|
2220
|
+
}
|
|
2221
|
+
async listSignoffs(agentId) {
|
|
2222
|
+
return this.get(`/evidence/signoffs/${encodeURIComponent(agentId)}`);
|
|
2223
|
+
}
|
|
2224
|
+
async getSignoff(id) {
|
|
2225
|
+
return this.get(`/evidence/signoff/${encodeURIComponent(id)}`);
|
|
2226
|
+
}
|
|
2227
|
+
/** What changed between a sign-off pack and the one before it (or `againstId`): verdict, settings, scenarios, answers, permissions. */
|
|
2228
|
+
async getSignoffDiff(id, againstId) {
|
|
2229
|
+
return this.get(`/evidence/signoff/${encodeURIComponent(id)}/diff${againstId ? `?against=${encodeURIComponent(againstId)}` : ""}`);
|
|
2230
|
+
}
|
|
2231
|
+
/**
|
|
2232
|
+
* For a bank's API edge: is this request signed by the agent, is the agent
|
|
2233
|
+
* still allowed to act, and is it inside a mandate for this customer?
|
|
2234
|
+
* Returns a platform-sealed verdict to keep.
|
|
2235
|
+
*/
|
|
2236
|
+
async gatewayCheck(input) {
|
|
2237
|
+
return this.post("/gateway/check", {
|
|
2238
|
+
request: input.request,
|
|
2239
|
+
mandate_id: input.mandateId,
|
|
2240
|
+
customer_ref: input.customerRef,
|
|
2241
|
+
action_type: input.actionType,
|
|
2242
|
+
amount: input.amount,
|
|
2243
|
+
currency: input.currency,
|
|
2244
|
+
max_age_seconds: input.maxAgeSeconds
|
|
2245
|
+
});
|
|
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
|
+
}
|
|
2301
|
+
/** Check any sealed Vorim document (case pack, sign-off, gateway verdict, mandate record). Public endpoint. */
|
|
2302
|
+
async verifyEvidence(doc) {
|
|
2303
|
+
return this.post("/evidence/verify", { payload: doc.payload, hash: doc.hash, signature: doc.signature });
|
|
2304
|
+
}
|
|
2060
2305
|
/** Close an intent when the job ends. Further actions under it are off intent. */
|
|
2061
2306
|
async completeIntent(intentId, status = "completed", outcome) {
|
|
2062
2307
|
return this.post(`/intents/${encodeURIComponent(intentId)}/complete`, { status, outcome });
|
|
@@ -2471,6 +2716,9 @@ async function deviceLogin(opts) {
|
|
|
2471
2716
|
wait = intervalMs;
|
|
2472
2717
|
}
|
|
2473
2718
|
}
|
|
2719
|
+
function mandateWithdrawalLine(mandateId, signedAt) {
|
|
2720
|
+
return `vorim-mandate-withdraw|v1|${mandateId}|${signedAt}`;
|
|
2721
|
+
}
|
|
2474
2722
|
export {
|
|
2475
2723
|
CANONICAL_TOOL_CATALOGUE_VERSION,
|
|
2476
2724
|
HMAC_SHA256_PREFIX,
|
|
@@ -2498,6 +2746,7 @@ export {
|
|
|
2498
2746
|
isDigest,
|
|
2499
2747
|
isKeyedCommitment,
|
|
2500
2748
|
jcsCanonicalise,
|
|
2749
|
+
mandateWithdrawalLine,
|
|
2501
2750
|
portableReceiptCanonicalBytes,
|
|
2502
2751
|
prepareReplayContext,
|
|
2503
2752
|
signHttpRequest,
|