@didit-protocol/mcp-server 5.1.53 → 5.1.62
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 +14 -4
- package/dist/accept.d.ts +54 -0
- package/dist/accept.d.ts.map +1 -0
- package/dist/accept.js +98 -0
- package/dist/accept.js.map +1 -0
- package/dist/audit-log.d.ts.map +1 -1
- package/dist/audit-log.js +22 -6
- package/dist/audit-log.js.map +1 -1
- package/dist/auth/refusal-log.d.ts +62 -0
- package/dist/auth/refusal-log.d.ts.map +1 -0
- package/dist/auth/refusal-log.js +131 -0
- package/dist/auth/refusal-log.js.map +1 -0
- package/dist/chatgpt-app.d.ts +1 -0
- package/dist/chatgpt-app.d.ts.map +1 -1
- package/dist/chatgpt-app.js +4 -0
- package/dist/chatgpt-app.js.map +1 -1
- package/dist/config.d.ts +17 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +62 -9
- package/dist/config.js.map +1 -1
- package/dist/connect-page.d.ts +10 -0
- package/dist/connect-page.d.ts.map +1 -0
- package/dist/connect-page.js +8 -0
- package/dist/connect-page.js.map +1 -0
- package/dist/connection-timeouts.d.ts +30 -0
- package/dist/connection-timeouts.d.ts.map +1 -0
- package/dist/connection-timeouts.js +52 -0
- package/dist/connection-timeouts.js.map +1 -0
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +95 -7
- package/dist/http.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +209 -3242
- package/dist/index.js.map +1 -1
- package/dist/paging.d.ts +3 -0
- package/dist/paging.d.ts.map +1 -1
- package/dist/paging.js +4 -1
- package/dist/paging.js.map +1 -1
- package/dist/permissions.d.ts.map +1 -1
- package/dist/permissions.js +3 -153
- package/dist/permissions.js.map +1 -1
- package/dist/release-version.d.ts +45 -0
- package/dist/release-version.d.ts.map +1 -0
- package/dist/release-version.js +90 -0
- package/dist/release-version.js.map +1 -0
- package/dist/schema/feature-config-schema.json +43 -4
- package/dist/security.d.ts.map +1 -1
- package/dist/security.js +41 -2
- package/dist/security.js.map +1 -1
- package/dist/tools/billing.d.ts +2 -0
- package/dist/tools/billing.d.ts.map +1 -1
- package/dist/tools/billing.js +124 -1
- package/dist/tools/billing.js.map +1 -1
- package/dist/tools/blocklist.d.ts +2 -0
- package/dist/tools/blocklist.d.ts.map +1 -1
- package/dist/tools/blocklist.js +94 -0
- package/dist/tools/blocklist.js.map +1 -1
- package/dist/tools/businesses.d.ts +2 -0
- package/dist/tools/businesses.d.ts.map +1 -1
- package/dist/tools/businesses.js +129 -0
- package/dist/tools/businesses.js.map +1 -1
- package/dist/tools/cases.d.ts +2 -0
- package/dist/tools/cases.d.ts.map +1 -1
- package/dist/tools/cases.js +131 -0
- package/dist/tools/cases.js.map +1 -1
- package/dist/tools/customization.d.ts +2 -0
- package/dist/tools/customization.d.ts.map +1 -1
- package/dist/tools/customization.js +43 -0
- package/dist/tools/customization.js.map +1 -1
- package/dist/tools/feature-config.d.ts +45 -0
- package/dist/tools/feature-config.d.ts.map +1 -1
- package/dist/tools/feature-config.js +100 -9
- package/dist/tools/feature-config.js.map +1 -1
- package/dist/tools/lists.d.ts +2 -0
- package/dist/tools/lists.d.ts.map +1 -1
- package/dist/tools/lists.js +193 -0
- package/dist/tools/lists.js.map +1 -1
- package/dist/tools/members.d.ts +2 -0
- package/dist/tools/members.d.ts.map +1 -1
- package/dist/tools/members.js +141 -0
- package/dist/tools/members.js.map +1 -1
- package/dist/tools/observability.d.ts +2 -0
- package/dist/tools/observability.d.ts.map +1 -1
- package/dist/tools/observability.js +77 -0
- package/dist/tools/observability.js.map +1 -1
- package/dist/tools/questionnaires.d.ts +2 -0
- package/dist/tools/questionnaires.d.ts.map +1 -1
- package/dist/tools/questionnaires.js +171 -0
- package/dist/tools/questionnaires.js.map +1 -1
- package/dist/tools/registered.d.ts +5 -0
- package/dist/tools/registered.d.ts.map +1 -0
- package/dist/tools/registered.js +30 -0
- package/dist/tools/registered.js.map +1 -0
- package/dist/tools/registry.d.ts +47 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +40 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/tools/reports.d.ts +2 -0
- package/dist/tools/reports.d.ts.map +1 -1
- package/dist/tools/reports.js +65 -0
- package/dist/tools/reports.js.map +1 -1
- package/dist/tools/search.d.ts +2 -0
- package/dist/tools/search.d.ts.map +1 -1
- package/dist/tools/search.js +133 -3
- package/dist/tools/search.js.map +1 -1
- package/dist/tools/sessions.d.ts +3 -0
- package/dist/tools/sessions.d.ts.map +1 -1
- package/dist/tools/sessions.js +715 -8
- package/dist/tools/sessions.js.map +1 -1
- package/dist/tools/settings.d.ts +19 -0
- package/dist/tools/settings.d.ts.map +1 -1
- package/dist/tools/settings.js +93 -5
- package/dist/tools/settings.js.map +1 -1
- package/dist/tools/shared-schema.d.ts +27 -0
- package/dist/tools/shared-schema.d.ts.map +1 -0
- package/dist/tools/shared-schema.js +68 -0
- package/dist/tools/shared-schema.js.map +1 -0
- package/dist/tools/standalone.d.ts +6 -0
- package/dist/tools/standalone.d.ts.map +1 -1
- package/dist/tools/standalone.js +366 -0
- package/dist/tools/standalone.js.map +1 -1
- package/dist/tools/transactions.d.ts +3 -0
- package/dist/tools/transactions.d.ts.map +1 -1
- package/dist/tools/transactions.js +512 -0
- package/dist/tools/transactions.js.map +1 -1
- package/dist/tools/users.d.ts +2 -0
- package/dist/tools/users.d.ts.map +1 -1
- package/dist/tools/users.js +137 -0
- package/dist/tools/users.js.map +1 -1
- package/dist/tools/webhooks.d.ts +2 -0
- package/dist/tools/webhooks.d.ts.map +1 -1
- package/dist/tools/webhooks.js +98 -0
- package/dist/tools/webhooks.js.map +1 -1
- package/dist/tools/workflow-graph.d.ts +1 -0
- package/dist/tools/workflow-graph.d.ts.map +1 -1
- package/dist/tools/workflow-graph.js +107 -39
- package/dist/tools/workflow-graph.js.map +1 -1
- package/dist/tools/workflows.d.ts +3 -0
- package/dist/tools/workflows.d.ts.map +1 -0
- package/dist/tools/workflows.js +440 -0
- package/dist/tools/workflows.js.map +1 -0
- package/package.json +1 -1
package/dist/tools/sessions.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LIST_COUNT_CAP = void 0;
|
|
3
|
+
exports.SESSION_IMPORT_TOOLS = exports.SESSION_TOOLS = exports.LIST_COUNT_CAP = void 0;
|
|
4
4
|
exports.createSession = createSession;
|
|
5
5
|
exports.listSessions = listSessions;
|
|
6
6
|
exports.getSessionDecision = getSessionDecision;
|
|
@@ -31,6 +31,12 @@ exports.getImportTemplate = getImportTemplate;
|
|
|
31
31
|
exports.getImport = getImport;
|
|
32
32
|
exports.getImportErrors = getImportErrors;
|
|
33
33
|
const config_1 = require("../config");
|
|
34
|
+
const paging_1 = require("../paging");
|
|
35
|
+
const shared_schema_1 = require("./shared-schema");
|
|
36
|
+
const search_1 = require("./search");
|
|
37
|
+
// session-explain imports getSessionDecision from here: each side uses the other only inside a call.
|
|
38
|
+
const session_explain_1 = require("./session-explain");
|
|
39
|
+
const orgapp_1 = require("../orgapp");
|
|
34
40
|
const session_pdf_download_1 = require("../session-pdf-download");
|
|
35
41
|
const signature_download_1 = require("../signature-download");
|
|
36
42
|
const security_1 = require("../security");
|
|
@@ -40,13 +46,59 @@ const compliance_1 = require("./compliance");
|
|
|
40
46
|
// resources. Per-session detail ops (decision, update-*, generate-pdf) are FLAT /session/{id}/...
|
|
41
47
|
// — the console calls them flat with the user Bearer, so they are left unchanged.
|
|
42
48
|
const sid = (id) => (0, security_1.pathSegment)(id, "session_id");
|
|
49
|
+
/**
|
|
50
|
+
* The application a person's call acts in, as the header the flat `/session/` route reads.
|
|
51
|
+
*
|
|
52
|
+
* For a person's token that route takes the application from `X-Didit-Application-Id`, and only when
|
|
53
|
+
* the header is absent derives it from the workflow (sdv `IsValidUserOrgClient`). Without the header,
|
|
54
|
+
* a call that NAMED its application and a workflow the API cannot find (an id that does not exist, or
|
|
55
|
+
* a workflow's name where its id belongs) was answered "Name the application in the
|
|
56
|
+
* X-Didit-Application-Id header" with a hint about roles: a header a model cannot set, for a call
|
|
57
|
+
* that had named the application. And a workflow of ANOTHER application created the session there,
|
|
58
|
+
* with nothing in the answer saying so. Staging, 12 November 2026.
|
|
59
|
+
*
|
|
60
|
+
* With the header the API works in the application the call names, and answers about the workflow.
|
|
61
|
+
* A call that names no application sends none, and the API derives it from the workflow as before.
|
|
62
|
+
* An API key is its application and sends no such header.
|
|
63
|
+
*/
|
|
64
|
+
function namedApplicationHeaders() {
|
|
65
|
+
const context = config_1.requestContext.getStore();
|
|
66
|
+
if (!context?.accessToken || context.apiKey || !context.applicationId)
|
|
67
|
+
return undefined;
|
|
68
|
+
return { ...(0, config_1.getHeaders)(), "X-Didit-Application-Id": context.applicationId };
|
|
69
|
+
}
|
|
43
70
|
async function createSession(data) {
|
|
44
71
|
const json = { ...data };
|
|
45
72
|
// portrait_image may be a URL the backend fetches — SSRF-guard it (base64 left untouched).
|
|
46
73
|
if (typeof json.portrait_image === "string" && /^https?:\/\//i.test(json.portrait_image)) {
|
|
47
74
|
json.portrait_image = (0, security_1.assertSafeWebhookUrl)(json.portrait_image, "portrait_image");
|
|
48
75
|
}
|
|
49
|
-
|
|
76
|
+
const headers = namedApplicationHeaders();
|
|
77
|
+
try {
|
|
78
|
+
return await (0, config_1.apiRequest)("/session/", { method: "POST", json, headers });
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
throw headers ? error : applicationNotDerived(error, json.workflow_id);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* A call that named no application leaves the API to derive it from the workflow. When it cannot
|
|
86
|
+
* (no workflow with that id that the person can use, or a name where the id belongs) the API asks
|
|
87
|
+
* for the `X-Didit-Application-Id` header, which is not something a caller of this tool can send.
|
|
88
|
+
* Say what the caller can do: the workflow reference is what failed.
|
|
89
|
+
*/
|
|
90
|
+
function applicationNotDerived(error, workflowId) {
|
|
91
|
+
if (!(error instanceof security_1.DiditError) || error.shape.status !== 403 || !/X-Didit-Application-Id/.test(error.shape.message))
|
|
92
|
+
return error;
|
|
93
|
+
const named = typeof workflowId === "string" && workflowId.trim() !== "";
|
|
94
|
+
return new security_1.DiditError({
|
|
95
|
+
code: "bad_request",
|
|
96
|
+
field: "workflow_id",
|
|
97
|
+
message: named
|
|
98
|
+
? "No workflow you can use has this workflow_id, so the application to create the session in could not be worked out from it."
|
|
99
|
+
: "workflow_id is required: it also tells which application the session is created in.",
|
|
100
|
+
hint: "Pass the id of a workflow, not its name: didit_workflow_list returns the ids. To say which application to work in, pass application_id as well (didit_context_get lists the applications).",
|
|
101
|
+
});
|
|
50
102
|
}
|
|
51
103
|
/**
|
|
52
104
|
* The list's `count` stops at 100 (the backend's bounded COUNT): 100 means "100 or more". Asked
|
|
@@ -304,6 +356,26 @@ async function shareSession(sessionId, data) {
|
|
|
304
356
|
async function importSharedSession(data) {
|
|
305
357
|
return (0, config_1.apiRequest)("/session/import-shared/", { method: "POST", json: data });
|
|
306
358
|
}
|
|
359
|
+
/**
|
|
360
|
+
* The scope of a person's call to a session import route, as the headers that route reads.
|
|
361
|
+
*
|
|
362
|
+
* The import routes are flat (`/session/imports/...`). For a person's token the API takes the
|
|
363
|
+
* organization from `X-Didit-Organization-Id` and the application from `X-Didit-Application-Id`,
|
|
364
|
+
* and refuses the call when it cannot tell them (organization_required, application_required):
|
|
365
|
+
* every import call people made in production on 12 November 2026 was refused that way. Resolved
|
|
366
|
+
* like any scoped call, so a person with several applications who names none is told which ones
|
|
367
|
+
* they have. An API key is its application and sends neither.
|
|
368
|
+
*/
|
|
369
|
+
function importScopeHeaders() {
|
|
370
|
+
const context = config_1.requestContext.getStore();
|
|
371
|
+
if (!context?.accessToken || context.apiKey)
|
|
372
|
+
return undefined;
|
|
373
|
+
return {
|
|
374
|
+
...(0, config_1.getHeaders)(),
|
|
375
|
+
"X-Didit-Organization-Id": (0, security_1.pathSegment)((0, config_1.resolveOrganizationId)(), "organization_id"),
|
|
376
|
+
"X-Didit-Application-Id": (0, security_1.pathSegment)((0, config_1.resolveApplicationId)(), "application_id"),
|
|
377
|
+
};
|
|
378
|
+
}
|
|
307
379
|
async function createImport(data) {
|
|
308
380
|
const json = { ...data };
|
|
309
381
|
// The backend FETCHES source_file_url — SSRF-guard it before forwarding.
|
|
@@ -311,7 +383,7 @@ async function createImport(data) {
|
|
|
311
383
|
json.source_file_url = (0, security_1.assertSafeWebhookUrl)(json.source_file_url, "source_file_url");
|
|
312
384
|
}
|
|
313
385
|
assertProviderCredentials(json);
|
|
314
|
-
return withoutCredentials(await (0, config_1.apiRequest)("/session/imports/", { method: "POST", json }));
|
|
386
|
+
return withoutCredentials(await (0, config_1.apiRequest)("/session/imports/", { method: "POST", json, headers: importScopeHeaders() }));
|
|
315
387
|
}
|
|
316
388
|
/**
|
|
317
389
|
* A provider migration carries the customer's read-only key for the OTHER provider. It goes to Didit
|
|
@@ -345,11 +417,11 @@ function withoutCredentials(body) {
|
|
|
345
417
|
return body;
|
|
346
418
|
}
|
|
347
419
|
async function listImportProviders() {
|
|
348
|
-
return (0, config_1.apiRequest)("/session/imports/providers/");
|
|
420
|
+
return (0, config_1.apiRequest)("/session/imports/providers/", { headers: importScopeHeaders() });
|
|
349
421
|
}
|
|
350
422
|
async function checkImportProvider(data) {
|
|
351
423
|
assertProviderCredentials(data);
|
|
352
|
-
return withoutCredentials(await (0, config_1.apiRequest)("/session/imports/providers/check/", { method: "POST", json: data }));
|
|
424
|
+
return withoutCredentials(await (0, config_1.apiRequest)("/session/imports/providers/check/", { method: "POST", json: data, headers: importScopeHeaders() }));
|
|
353
425
|
}
|
|
354
426
|
const IMPORT_ACTIONS = ["start", "pause", "resume", "cancel", "retry"];
|
|
355
427
|
async function manageImport(importId, action, data = {}) {
|
|
@@ -366,15 +438,650 @@ async function manageImport(importId, action, data = {}) {
|
|
|
366
438
|
return withoutCredentials(await (0, config_1.apiRequest)(`/session/imports/${(0, security_1.pathSegment)(importId, "import_id")}/${(0, security_1.pathSegment)(action, "action")}/`, {
|
|
367
439
|
method: "POST",
|
|
368
440
|
json: body ?? {},
|
|
441
|
+
headers: importScopeHeaders(),
|
|
369
442
|
}));
|
|
370
443
|
}
|
|
371
444
|
async function getImportTemplate() {
|
|
372
|
-
return (0, config_1.apiRequest)("/session/imports/template/");
|
|
445
|
+
return (0, config_1.apiRequest)("/session/imports/template/", { headers: importScopeHeaders() });
|
|
373
446
|
}
|
|
374
447
|
async function getImport(importId) {
|
|
375
|
-
return (0, config_1.apiRequest)(`/session/imports/${(0, security_1.pathSegment)(importId, "import_id")}
|
|
448
|
+
return (0, config_1.apiRequest)(`/session/imports/${(0, security_1.pathSegment)(importId, "import_id")}/`, { headers: importScopeHeaders() });
|
|
376
449
|
}
|
|
377
450
|
async function getImportErrors(importId) {
|
|
378
|
-
return (0, config_1.apiRequest)(`/session/imports/${(0, security_1.pathSegment)(importId, "import_id")}/errors
|
|
451
|
+
return (0, config_1.apiRequest)(`/session/imports/${(0, security_1.pathSegment)(importId, "import_id")}/errors/`, { headers: importScopeHeaders() });
|
|
379
452
|
}
|
|
453
|
+
// The interface languages a session can be created in.
|
|
454
|
+
const LANGUAGE_CODES = [
|
|
455
|
+
"en", "ar", "bg", "bn", "bs", "ca", "cnr", "cs", "da", "de", "el", "es", "et",
|
|
456
|
+
"fa", "fi", "fr", "he", "hi", "hr", "hu", "hy", "id", "it", "ja", "ka", "kk",
|
|
457
|
+
"ko", "ky", "lt", "lv", "mk", "mn", "ms", "nl", "no", "pl", "pt-BR", "pt",
|
|
458
|
+
"ro", "ru", "sk", "sl", "so", "sq", "sr", "sv", "th", "tr", "uk", "uz",
|
|
459
|
+
"vi", "zh-CN", "zh-TW", "zh",
|
|
460
|
+
];
|
|
461
|
+
// ── The session tools (tools/registry.ts) ──────────────────────────────────
|
|
462
|
+
// Each tool declares here what index.ts and permissions.ts used to keep in their name-keyed tables.
|
|
463
|
+
// The definitions are listed where these tools always were, so the tool list does not change.
|
|
464
|
+
exports.SESSION_TOOLS = [
|
|
465
|
+
{
|
|
466
|
+
def: {
|
|
467
|
+
name: "didit_session_create",
|
|
468
|
+
description: "Create a verification session. Requires workflow_id (created in the Console Workflows page) — the workflow defines which steps run and whether the session is KYC or KYB. Returns session_id, url, and session_token.",
|
|
469
|
+
inputSchema: {
|
|
470
|
+
type: "object",
|
|
471
|
+
properties: {
|
|
472
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
473
|
+
workflow_id: { type: "string", description: "REQUIRED. The STABLE workflow_id (`workflow_id` of didit_workflow_search/list) of the workflow that defines the verification steps; runs its live version. A version uuid pins that one version and ignores later publishes. Selects KYC vs KYB implicitly." },
|
|
474
|
+
vendor_data: { type: "string", description: "Your unique identifier for the user (e.g. user ID). Used to group sessions into a user/business." },
|
|
475
|
+
callback: { type: "string", description: "URL to redirect the user to after verification" },
|
|
476
|
+
callback_method: { type: "string", enum: ["initiator", "completer", "both"], description: "Which device/flow the callback applies to" },
|
|
477
|
+
language: { type: "string", enum: LANGUAGE_CODES, description: "Pre-set the verification UI language (ISO code)" },
|
|
478
|
+
sandbox_scenario: { type: "string", description: "SANDBOX ONLY (an application whose mode is 'sandbox' — see didit_context_get): predefine the outcome instead of running real providers, so the session is never billed. Slugs are 'approve', 'decline_*' (e.g. decline_aml_hit, decline_document_expired, decline_kyb_registry_mismatch) and 'review_*' (e.g. review_aml_possible_match). Ignored by a live application, where every session IS billed." },
|
|
479
|
+
metadata: { type: "object", description: "Arbitrary JSON stored on the session and echoed in webhooks" },
|
|
480
|
+
contact_details: { type: "object", description: "Pre-fill contact info (e.g. email, phone) for the session" },
|
|
481
|
+
expected_details: { type: "object", description: "Expected values to validate against (e.g. expected country, IP)" },
|
|
482
|
+
portrait_image: { type: "string", description: "Base64 or URL reference portrait for Biometric Authentication / Face-Match-first workflows. Optional when the vendor_data user already has a stored face (approved liveness face, ePassport photo, document portrait, or enrolled profile face) - the stored face is reused automatically; 400 if neither is available" },
|
|
483
|
+
},
|
|
484
|
+
required: ["workflow_id"],
|
|
485
|
+
},
|
|
486
|
+
},
|
|
487
|
+
access: "write",
|
|
488
|
+
permission: null, // POST /session/ → session.py:152 — permission classes only, no decorator
|
|
489
|
+
run: (args) => createSession(args),
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
def: {
|
|
493
|
+
name: "didit_session_list",
|
|
494
|
+
description: `List verification sessions for ONE app. If you have multiple apps (or pass no scope) this automatically spans every app, newest first - but didit_session_search is the canonical cross-app tool and what to reach for to answer "my last N sessions". status accepts session-level values: ${shared_schema_1.SESSION_STATUSES}. HOW MANY: \`count\` stops at 100 (100 means "100 or more"); when it does, the result adds \`total_count\` (the exact number, from the console's own tab counts) or \`count_is_lower_bound: true\`. Answer "how many" from total_count, never report 100 as the number; limit:1 is enough to count.`,
|
|
495
|
+
inputSchema: {
|
|
496
|
+
type: "object",
|
|
497
|
+
properties: {
|
|
498
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
499
|
+
status: { type: "string", description: `Filter by session status (${shared_schema_1.SESSION_STATUSES}). Several statuses separated by commas match any of them, e.g. "Not Started,In Progress".` },
|
|
500
|
+
session_kind: { type: "string", enum: ["user", "business", "all"], description: "KYC (user), KYB (business), or all" },
|
|
501
|
+
vendor_data: { type: "string", description: "Filter by vendor_data" },
|
|
502
|
+
workflow_id: { type: "string", description: "Filter by workflow UUID" },
|
|
503
|
+
search: { type: "string", description: "Free-text search" },
|
|
504
|
+
date_from: { type: "string", description: "ISO date lower bound" },
|
|
505
|
+
date_to: { type: "string", description: "ISO date upper bound" },
|
|
506
|
+
limit: { type: "string", description: "Page size (LimitOffset pagination)" },
|
|
507
|
+
offset: { type: "string", description: "Pagination offset" },
|
|
508
|
+
},
|
|
509
|
+
},
|
|
510
|
+
},
|
|
511
|
+
// With no application named, it lists the sessions of every application of the organization.
|
|
512
|
+
access: "read",
|
|
513
|
+
permission: "list:sessions", // GET …/sessions/ → application.py:123
|
|
514
|
+
spanAllApplications: (args) => (0, search_1.searchSessions)(args),
|
|
515
|
+
run: (args) => listSessions(args),
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
def: {
|
|
519
|
+
name: "didit_session_get_decision",
|
|
520
|
+
description: "Get the full verification decision and all extracted data for a session.",
|
|
521
|
+
inputSchema: {
|
|
522
|
+
type: "object",
|
|
523
|
+
properties: {
|
|
524
|
+
session_id: { type: "string", description: "Session UUID" },
|
|
525
|
+
},
|
|
526
|
+
required: ["session_id"],
|
|
527
|
+
},
|
|
528
|
+
},
|
|
529
|
+
access: "read",
|
|
530
|
+
permission: "read:sessions", // GET /session/{id}/decision/ → session.py:536
|
|
531
|
+
run: (args) => getSessionDecision(args.session_id),
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
def: {
|
|
535
|
+
name: "didit_session_get_location_evidence",
|
|
536
|
+
description: "Precise Location (GEOLOCATION) evidence of ONE session, per Location node: `config` (what judged it, every action resolved through the preset), `result` (the decision's verdict), EVERY attempt incl. retired ones (`retired:true`), `reference_points` (device, IP, address; `area_reading` is the earlier attempt a carried area verdict stands on), `distances`, `areas` (inside / blocked / undetermined area ids, `nearest_allowed_km`, `allowed_result`), `anonymizers` (vpn, proxy, tor, spoofing, emulator; null = cannot tell) and `history`: the same person's earlier checks (same vendor_data) that LOCATION_CONSECUTIVE_MISMATCHES and travel tolerance are judged from. The decision keeps only the accepted attempt: use this for 'which attempt was outside', 'why consecutive mismatches' or 'why was the distance excused'. Holds precise coordinates: quote only what the question needs. `nodes: []` means no Location attempt was recorded; a 404 'Precise Location is not available.' means the feature is off on this deployment.",
|
|
537
|
+
inputSchema: {
|
|
538
|
+
type: "object",
|
|
539
|
+
properties: {
|
|
540
|
+
session_id: { type: "string", description: "Session UUID" },
|
|
541
|
+
},
|
|
542
|
+
required: ["session_id"],
|
|
543
|
+
},
|
|
544
|
+
},
|
|
545
|
+
access: "read",
|
|
546
|
+
permission: "read:sessions", // GET /geolocation/sessions/{id}/evidence/ → geolocation/views/console.py:53
|
|
547
|
+
run: (args) => getSessionLocationEvidence(args.session_id),
|
|
548
|
+
},
|
|
549
|
+
{
|
|
550
|
+
def: {
|
|
551
|
+
name: "didit_session_simulate",
|
|
552
|
+
description: "SANDBOX ONLY: finish a session of a sandbox application (mode 'sandbox' in didit_context_get) with the " +
|
|
553
|
+
"outcome you pick, without anyone going through the verification flow, then read it with " +
|
|
554
|
+
"didit_session_get_decision and its webhooks with didit_session_webhooks. Never billed. Pass new_status " +
|
|
555
|
+
"('Approved', 'Declined', 'In Review', 'Expired', 'Abandoned'), a scenario slug ('approve', 'decline_aml_hit', " +
|
|
556
|
+
"'decline_document_expired', 'review_aml_possible_match', ...) or a risk. A live session answers not found.",
|
|
557
|
+
inputSchema: {
|
|
558
|
+
type: "object",
|
|
559
|
+
properties: {
|
|
560
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
561
|
+
session_id: { type: "string", description: "REQUIRED. A session of a sandbox application." },
|
|
562
|
+
new_status: { type: "string", enum: ["Approved", "Declined", "In Review", "Expired", "Abandoned"] },
|
|
563
|
+
scenario: { type: "string", description: "Sandbox scenario slug whose outcome to reproduce." },
|
|
564
|
+
risk: { type: "string", description: "A risk case to add as a warning." },
|
|
565
|
+
comment: { type: "string", description: "Note on the activity entry." },
|
|
566
|
+
send_webhooks: { type: "boolean", description: "Send the webhooks a real status change sends (default true)." },
|
|
567
|
+
},
|
|
568
|
+
required: ["session_id"],
|
|
569
|
+
},
|
|
570
|
+
},
|
|
571
|
+
access: "write",
|
|
572
|
+
permission: "write:sessions", // POST /session/{id}/simulate/ → sandbox simulate (sandbox sessions only)
|
|
573
|
+
run: ({ session_id, ...data }) => simulateSandboxSession(session_id, data),
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
def: {
|
|
577
|
+
name: "didit_session_update_status",
|
|
578
|
+
description: "Overwrite a session's decision by approving, declining, or requesting resubmission; optionally send a notification email that cannot be recalled. Before calling, obtain explicit user confirmation of the session, new decision, and any email recipient. For resubmission, pass new_status='Resubmitted' and nodes_to_resubmit; already-approved steps are kept.",
|
|
579
|
+
inputSchema: {
|
|
580
|
+
type: "object",
|
|
581
|
+
properties: {
|
|
582
|
+
session_id: { type: "string" },
|
|
583
|
+
new_status: { type: "string", enum: ["Approved", "Declined", "Resubmitted"], description: "New decision status" },
|
|
584
|
+
comment: { type: "string", description: "Reviewer note stored on the audit trail" },
|
|
585
|
+
nodes_to_resubmit: { type: "array", items: { type: "string" }, description: "Node IDs the user must redo (only for Resubmitted)" },
|
|
586
|
+
send_email: { type: "boolean", description: "Send a notification email that cannot be recalled. Set true only after explicit user confirmation of the notification and recipient." },
|
|
587
|
+
email_address: { type: "string", description: "Override the notification recipient; confirm this address with the user before sending." },
|
|
588
|
+
email_language: { type: "string", description: "Language for the notification email" },
|
|
589
|
+
},
|
|
590
|
+
required: ["session_id", "new_status"],
|
|
591
|
+
},
|
|
592
|
+
},
|
|
593
|
+
// A consequential decision (approve, decline), and it can reach outside the workspace.
|
|
594
|
+
access: "destructive",
|
|
595
|
+
openWorld: true,
|
|
596
|
+
permission: "write:sessions", // PATCH /session/{id}/update-status/ → session.py:1033
|
|
597
|
+
run: ({ session_id, ...data }) => updateSessionStatus(session_id, data),
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
def: {
|
|
601
|
+
name: "didit_session_update_data",
|
|
602
|
+
description: "Correct the KYC data extracted from the ID document on a session (reviewer override). Only send the fields you want to change.",
|
|
603
|
+
inputSchema: {
|
|
604
|
+
type: "object",
|
|
605
|
+
properties: {
|
|
606
|
+
session_id: { type: "string" },
|
|
607
|
+
document_type: { type: "string", enum: shared_schema_1.DOCUMENT_TYPES },
|
|
608
|
+
document_subtype: { type: "string" },
|
|
609
|
+
document_number: { type: "string" },
|
|
610
|
+
personal_number: { type: "string" },
|
|
611
|
+
date_of_birth: { type: "string", description: "YYYY-MM-DD" },
|
|
612
|
+
date_of_issue: { type: "string", description: "YYYY-MM-DD" },
|
|
613
|
+
expiration_date: { type: "string", description: "YYYY-MM-DD" },
|
|
614
|
+
issuing_state: { type: "string", description: "ISO 3166-1 alpha-3 issuing country" },
|
|
615
|
+
first_name: { type: "string" },
|
|
616
|
+
last_name: { type: "string" },
|
|
617
|
+
gender: { type: "string", enum: ["M", "F", "U"] },
|
|
618
|
+
address: { type: "string" },
|
|
619
|
+
place_of_birth: { type: "string" },
|
|
620
|
+
nationality: { type: "string" },
|
|
621
|
+
marital_status: { type: "string", enum: ["SINGLE", "MARRIED", "DIVORCED", "WIDOWED", "UNKNOWN"] },
|
|
622
|
+
extra_fields: { type: "object", description: "Document-specific extra fields" },
|
|
623
|
+
parsed_address: { type: "object", description: "Structured address override" },
|
|
624
|
+
},
|
|
625
|
+
required: ["session_id"],
|
|
626
|
+
},
|
|
627
|
+
},
|
|
628
|
+
access: "write",
|
|
629
|
+
permission: "write:sessions", // PATCH /session/{id}/update-data/ → session.py:1238
|
|
630
|
+
run: ({ session_id, ...data }) => updateSessionData(session_id, data),
|
|
631
|
+
},
|
|
632
|
+
{
|
|
633
|
+
def: {
|
|
634
|
+
name: "didit_session_update_poa_data",
|
|
635
|
+
description: "Correct the Proof of Address data extracted from the POA document on a session (reviewer override). Only send the fields you want to change.",
|
|
636
|
+
inputSchema: {
|
|
637
|
+
type: "object",
|
|
638
|
+
properties: {
|
|
639
|
+
session_id: { type: "string" },
|
|
640
|
+
issuing_state: { type: "string", description: "ISO 3166-1 alpha-3 issuing country" },
|
|
641
|
+
document_type: { type: "string", enum: ["UTILITY_BILL", "BANK_STATEMENT", "GOVERNMENT_ISSUED_DOCUMENT", "OTHER_POA_DOCUMENT", "UNKNOWN"] },
|
|
642
|
+
document_language: { type: "string" },
|
|
643
|
+
issuer: { type: "string" },
|
|
644
|
+
issue_date: { type: "string", description: "YYYY-MM-DD" },
|
|
645
|
+
poa_address: { type: "string" },
|
|
646
|
+
name_on_document: { type: "string" },
|
|
647
|
+
extra_fields: { type: "object" },
|
|
648
|
+
poa_parsed_address: { type: "object", description: "Structured address override" },
|
|
649
|
+
},
|
|
650
|
+
required: ["session_id"],
|
|
651
|
+
},
|
|
652
|
+
},
|
|
653
|
+
access: "write",
|
|
654
|
+
permission: "write:sessions", // PATCH /session/{id}/update-poa-data/ → session.py:1461
|
|
655
|
+
run: ({ session_id, ...data }) => updateSessionPoaData(session_id, data),
|
|
656
|
+
},
|
|
657
|
+
{
|
|
658
|
+
def: {
|
|
659
|
+
name: "didit_session_delete",
|
|
660
|
+
description: "Permanently and irreversibly delete a single verification session (KYC or KYB) - its verification data and stored media. Blocklist entries, issued share tokens, already-queued webhook deliveries, consumed credits, and the parent user/business are not affected. Requires confirm:true - only pass it after the user has explicitly confirmed this exact deletion.",
|
|
661
|
+
inputSchema: {
|
|
662
|
+
type: "object",
|
|
663
|
+
properties: {
|
|
664
|
+
session_id: { type: "string" },
|
|
665
|
+
confirm: { type: "boolean", description: "REQUIRED. Must be true - deletion is permanent and irreversible. Only set after explicit user confirmation of this exact action." },
|
|
666
|
+
},
|
|
667
|
+
required: ["session_id", "confirm"],
|
|
668
|
+
},
|
|
669
|
+
},
|
|
670
|
+
access: "destructive",
|
|
671
|
+
permission: "delete:sessions", // DELETE /session/{id}/delete/ → session.py:1406
|
|
672
|
+
run: (args) => deleteSession(args.session_id, args.confirm),
|
|
673
|
+
},
|
|
674
|
+
{
|
|
675
|
+
def: {
|
|
676
|
+
name: "didit_session_batch_delete",
|
|
677
|
+
description: "Permanently and irreversibly delete multiple KYC sessions by session number, or EVERY KYC session in the application with delete_all:true (KYB sessions are never touched; delete those individually). Requires confirm:true - only pass it after the user has explicitly confirmed this exact deletion.",
|
|
678
|
+
inputSchema: {
|
|
679
|
+
type: "object",
|
|
680
|
+
properties: {
|
|
681
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
682
|
+
session_numbers: {
|
|
683
|
+
type: "array",
|
|
684
|
+
items: { type: "number" },
|
|
685
|
+
description: "Array of session numbers to delete",
|
|
686
|
+
},
|
|
687
|
+
delete_all: { type: "boolean", description: "Set true to delete ALL sessions (ignores session_numbers)" },
|
|
688
|
+
confirm: { type: "boolean", description: "REQUIRED. Must be true - deletion is permanent and irreversible. Only set after explicit user confirmation of this exact action." },
|
|
689
|
+
},
|
|
690
|
+
required: ["confirm"],
|
|
691
|
+
},
|
|
692
|
+
},
|
|
693
|
+
access: "destructive",
|
|
694
|
+
permission: "delete:sessions", // DELETE …/sessions/delete/ → application.py:529
|
|
695
|
+
run: (args) => batchDeleteSessions(args.session_numbers, args.delete_all, args.confirm),
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
def: {
|
|
699
|
+
name: "didit_session_generate_pdf",
|
|
700
|
+
description: "Return download_url, expires_at and expires_in (300 seconds) for the original Didit session PDF. Fetch the URL to save the PDF; no Authorization header is needed. Treat the URL as sensitive. Requires configured MCP HTTP PDF downloads.",
|
|
701
|
+
inputSchema: {
|
|
702
|
+
type: "object",
|
|
703
|
+
properties: {
|
|
704
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
705
|
+
session_id: { type: "string" },
|
|
706
|
+
},
|
|
707
|
+
required: ["session_id"],
|
|
708
|
+
},
|
|
709
|
+
},
|
|
710
|
+
// Its name reads like a read, but its handler creates a server-side artifact or job.
|
|
711
|
+
access: "write",
|
|
712
|
+
permission: "read:sessions", // GET /session/{id}/generate-pdf/ → pdf.py:86
|
|
713
|
+
run: (args) => generateSessionPdf(args.session_id),
|
|
714
|
+
},
|
|
715
|
+
{
|
|
716
|
+
def: {
|
|
717
|
+
name: "didit_session_get_signature_evidence",
|
|
718
|
+
description: "Return download_url, content_type, expires_at and expires_in (300 seconds) for a signer's evidence PDF of an E-signature step: level and format, " +
|
|
719
|
+
"signer, IP address, each document with its original SHA-256 and field values and the SHA-256 of every signed file, plus, for an Advanced (AES) " +
|
|
720
|
+
"signature, the verified identity session, the code confirmation, the certificate and the timestamp. Pass the evidence_file path's signer as " +
|
|
721
|
+
"signature_id; a Business Verification step with several signers needs it, otherwise the route picks one. Fetch the URL to save the PDF; no " +
|
|
722
|
+
"Authorization header is needed. Treat the URL as sensitive. Requires configured MCP HTTP downloads (see the README).",
|
|
723
|
+
inputSchema: {
|
|
724
|
+
type: "object",
|
|
725
|
+
properties: {
|
|
726
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
727
|
+
session_id: { type: "string", description: "REQUIRED. The User Verification (KYC) or Business Verification (KYB) session." },
|
|
728
|
+
node_id: { type: "string", description: "REQUIRED. The E-signature step: node_id of the item in the decision's signatures[]." },
|
|
729
|
+
signature_id: { type: "string", description: "id of the signer's item in signatures[]. Required to pick a signer on a Business Verification step with several." },
|
|
730
|
+
},
|
|
731
|
+
required: ["session_id", "node_id"],
|
|
732
|
+
},
|
|
733
|
+
},
|
|
734
|
+
// Its name reads like a read, but its handler creates a server-side artifact or job.
|
|
735
|
+
access: "write",
|
|
736
|
+
permission: "read:sessions", // GET /session/{id}/signatures/{node}/evidence/ → signatures/downloads.py:78
|
|
737
|
+
run: (args) => getSignatureEvidence(args.session_id, args.node_id, args.signature_id),
|
|
738
|
+
},
|
|
739
|
+
{
|
|
740
|
+
def: {
|
|
741
|
+
name: "didit_session_get_signed_document",
|
|
742
|
+
description: "Return download_url, content_type, expires_at and expires_in (300 seconds) for the signed PDF of one document of an E-signature step: the document the " +
|
|
743
|
+
"signer was shown with their field values stamped and the evidence page (unless signature_evidence_page is off). An Advanced (AES) PDF also carries the " +
|
|
744
|
+
"PAdES signature with its timestamp; a Simple PDF has no digital signature, seal or timestamp. Didit checks the file against sha256_signed first (409 on a " +
|
|
745
|
+
"mismatch, nothing returned). Use the id of the document in signatures[].documents[]. Treat the URL as sensitive. Requires configured MCP HTTP downloads.",
|
|
746
|
+
inputSchema: {
|
|
747
|
+
type: "object",
|
|
748
|
+
properties: {
|
|
749
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
750
|
+
session_id: { type: "string", description: "REQUIRED. The User Verification (KYC) or Business Verification (KYB) session." },
|
|
751
|
+
node_id: { type: "string", description: "REQUIRED. The E-signature step: node_id of the item in the decision's signatures[]." },
|
|
752
|
+
document_id: { type: "string", description: "REQUIRED. id of the document in signatures[].documents[]." },
|
|
753
|
+
},
|
|
754
|
+
required: ["session_id", "node_id", "document_id"],
|
|
755
|
+
},
|
|
756
|
+
},
|
|
757
|
+
// Its name reads like a read, but its handler creates a server-side artifact or job.
|
|
758
|
+
access: "write",
|
|
759
|
+
permission: "read:sessions", // GET …/signatures/{node}/documents/{doc}/file/ → same view
|
|
760
|
+
run: (args) => getSignedDocument(args.session_id, args.node_id, args.document_id),
|
|
761
|
+
},
|
|
762
|
+
{
|
|
763
|
+
def: {
|
|
764
|
+
name: "didit_session_get_signature_field_image",
|
|
765
|
+
description: "Return download_url, content_type (image/png), expires_at and expires_in (300 seconds) for the signature or initials a signer applied to a field. " +
|
|
766
|
+
"Use the field id from the image_url of signatures[].documents[].fields[]. Treat the URL as sensitive. Requires configured MCP HTTP downloads.",
|
|
767
|
+
inputSchema: {
|
|
768
|
+
type: "object",
|
|
769
|
+
properties: {
|
|
770
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
771
|
+
session_id: { type: "string", description: "REQUIRED. The User Verification (KYC) or Business Verification (KYB) session." },
|
|
772
|
+
node_id: { type: "string", description: "REQUIRED. The E-signature step: node_id of the item in the decision's signatures[]." },
|
|
773
|
+
field_id: { type: "string", description: "REQUIRED. The field on this signer's copy, as in the field's image_url." },
|
|
774
|
+
},
|
|
775
|
+
required: ["session_id", "node_id", "field_id"],
|
|
776
|
+
},
|
|
777
|
+
},
|
|
778
|
+
// Its name reads like a read, but its handler creates a server-side artifact or job.
|
|
779
|
+
access: "write",
|
|
780
|
+
permission: "read:sessions", // GET …/signatures/{node}/fields/{field}/image/ → same view
|
|
781
|
+
run: (args) => getSignatureFieldImage(args.session_id, args.node_id, args.field_id),
|
|
782
|
+
},
|
|
783
|
+
{
|
|
784
|
+
def: {
|
|
785
|
+
name: "didit_session_validate_signatures",
|
|
786
|
+
description: "Re-check the signed documents of an E-signature step and save the result in each signer's validation. Didit re-reads every signed PDF, checks its " +
|
|
787
|
+
"SHA-256 and, for an Advanced (AES) signature, validates the PAdES signature, the certificate, the revocation data and the timestamp (a Simple signature " +
|
|
788
|
+
"has no digital signature, so only file integrity is checked). Nothing is signed again. Without signature_id every signer of the step is checked and the " +
|
|
789
|
+
"call fails with 409 if any has not signed; 400 means a stored signed PDF no longer matches its recorded SHA-256. Returns the checked signers.",
|
|
790
|
+
inputSchema: {
|
|
791
|
+
type: "object",
|
|
792
|
+
properties: {
|
|
793
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
794
|
+
session_id: { type: "string", description: "REQUIRED. The User Verification (KYC) or Business Verification (KYB) session." },
|
|
795
|
+
node_id: { type: "string", description: "REQUIRED. The E-signature step: node_id of the item in the decision's signatures[]." },
|
|
796
|
+
signature_id: { type: "string", description: "id of one signer's item in signatures[]; omit to check every signer of the step." },
|
|
797
|
+
},
|
|
798
|
+
required: ["session_id", "node_id"],
|
|
799
|
+
},
|
|
800
|
+
},
|
|
801
|
+
// Its name reads like a read, but its handler creates a server-side artifact or job.
|
|
802
|
+
access: "write",
|
|
803
|
+
permission: "write:sessions", // POST …/signatures/{node}/validate/ → signatures/downloads.py:99
|
|
804
|
+
run: (args) => validateSignatures(args.session_id, args.node_id, args.signature_id),
|
|
805
|
+
},
|
|
806
|
+
{
|
|
807
|
+
def: {
|
|
808
|
+
name: "didit_session_list_reviews",
|
|
809
|
+
description: "List the review history and activity log for a session, newest first. One page: 50 entries unless `limit` says otherwise, with `count` as the total and `offset` to read the ones after.",
|
|
810
|
+
inputSchema: {
|
|
811
|
+
type: "object",
|
|
812
|
+
properties: {
|
|
813
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
814
|
+
session_id: { type: "string" },
|
|
815
|
+
...paging_1.PAGE_PROPS,
|
|
816
|
+
},
|
|
817
|
+
required: ["session_id"],
|
|
818
|
+
},
|
|
819
|
+
},
|
|
820
|
+
access: "read",
|
|
821
|
+
permission: "read:sessions", // GET …/sessions/{id}/reviews/ → activity.py:77
|
|
822
|
+
run: (args) => listSessionReviews(args.session_id, (0, paging_1.pageParams)(args)),
|
|
823
|
+
},
|
|
824
|
+
{
|
|
825
|
+
def: {
|
|
826
|
+
name: "didit_session_add_review",
|
|
827
|
+
description: "Add a review note to a session's audit trail, optionally changing its status.",
|
|
828
|
+
inputSchema: {
|
|
829
|
+
type: "object",
|
|
830
|
+
properties: {
|
|
831
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
832
|
+
session_id: { type: "string" },
|
|
833
|
+
comment: { type: "string", description: "Review comment or note" },
|
|
834
|
+
new_status: {
|
|
835
|
+
type: "string",
|
|
836
|
+
enum: ["Not Started", "In Progress", "Approved", "Declined", "In Review", "Expired", "Abandoned", "Kyc Expired", "Resubmitted", "Awaiting User"],
|
|
837
|
+
description: "Optional new session status to record with the note",
|
|
838
|
+
},
|
|
839
|
+
},
|
|
840
|
+
required: ["session_id"],
|
|
841
|
+
},
|
|
842
|
+
},
|
|
843
|
+
access: "write",
|
|
844
|
+
permission: "write:sessions", // POST …/sessions/{id}/reviews/ → activity.py:97
|
|
845
|
+
run: ({ session_id, ...data }) => addSessionReview(session_id, data),
|
|
846
|
+
},
|
|
847
|
+
{
|
|
848
|
+
def: {
|
|
849
|
+
name: "didit_session_share",
|
|
850
|
+
description: "Share a verified session with a trusted partner for reusable KYC (B2B session sharing).",
|
|
851
|
+
inputSchema: {
|
|
852
|
+
type: "object",
|
|
853
|
+
properties: {
|
|
854
|
+
session_id: { type: "string" },
|
|
855
|
+
partner_client_id: { type: "string", description: "The partner application's client_id" },
|
|
856
|
+
},
|
|
857
|
+
required: ["session_id", "partner_client_id"],
|
|
858
|
+
},
|
|
859
|
+
},
|
|
860
|
+
// Shares verification data with a partner.
|
|
861
|
+
access: "write",
|
|
862
|
+
openWorld: true,
|
|
863
|
+
permission: "write:sessions", // POST /session/{id}/share/ → shared_session.py:44
|
|
864
|
+
run: (args) => shareSession(args.session_id, args),
|
|
865
|
+
},
|
|
866
|
+
{
|
|
867
|
+
def: {
|
|
868
|
+
name: "didit_session_explain_decision",
|
|
869
|
+
description: "WHY a verification session ended Approved / Declined / In Review, as a deterministic trace read from the record: the feature that decided it (strictest wins), each warning that had an effect with its raw value, every triggered status rule (field, operator, configured vs actual value), the human override if a reviewer changed the automatic verdict, and for each cause the workflow config key that governs it (`lever`, with its CURRENT value read from the workflow graph; only keys that exist in the feature-config contract; null means it is not a workflow setting). `workflow.graph_read:false` means the graph could not be read, so no current values. Use this for every 'why was it declined / in review / approved', 'it should have been X' and 'how do I make these go to X' question INSTEAD of reading the whole decision — it never returns images, extracted fields or PII. `informational` lists warnings that changed nothing. `unexplained:true` means a decided session (Declined / In Review) whose record shows no effective cause (e.g. minimized age-assurance logs): say so, never invent one. `lifecycle_status:true` (Expired, Abandoned, Not Started, In Progress, Resub Requested…) means nothing decided it — the status is the whole explanation.",
|
|
870
|
+
inputSchema: {
|
|
871
|
+
type: "object",
|
|
872
|
+
properties: {
|
|
873
|
+
session_id: { type: "string", description: "REQUIRED. The session uuid (from the page's session-id param, didit_session_search or the user)" },
|
|
874
|
+
},
|
|
875
|
+
required: ["session_id"],
|
|
876
|
+
},
|
|
877
|
+
},
|
|
878
|
+
// Folds a session's decision payload and its workflow graph into the outcome trace.
|
|
879
|
+
access: "read",
|
|
880
|
+
permission: "read:sessions", // GET /session/{id}/decision/ folded into its trace
|
|
881
|
+
run: (args) => (0, session_explain_1.explainSessionDecision)(args.session_id),
|
|
882
|
+
},
|
|
883
|
+
{
|
|
884
|
+
def: {
|
|
885
|
+
name: "didit_session_webhooks",
|
|
886
|
+
description: "Delivery log of the webhooks Didit sent for ONE session (last 30 days): destination URL, HTTP response status, timing, signing headers (X-Signature/X-Timestamp) and a capped copy of the payload. The way to check an integration end to end: create a session on a SANDBOX application with sandbox_scenario 'approve' (unbilled, fires status.updated immediately), then call this with wait_seconds so the call waits for the delivery instead of you polling. A 2xx response_status means the customer's endpoint received it; 401/403 usually means their signature check (must be HMAC-SHA256 hex of the RAW body); an empty list after the wait means the endpoint never got the event (not public, or the destination is disabled).",
|
|
887
|
+
inputSchema: {
|
|
888
|
+
type: "object",
|
|
889
|
+
properties: {
|
|
890
|
+
session_id: { type: "string", description: "REQUIRED. The session whose deliveries to read" },
|
|
891
|
+
wait_seconds: { type: "integer", minimum: 0, maximum: 60, description: "Keep polling up to this many seconds until at least one delivery exists (0 = read once). Use 30-45 right after creating a sandbox session." },
|
|
892
|
+
},
|
|
893
|
+
required: ["session_id"],
|
|
894
|
+
},
|
|
895
|
+
},
|
|
896
|
+
// The per-session webhook delivery log (its only verb-like token is "webhooks").
|
|
897
|
+
access: "read",
|
|
898
|
+
permission: "read:sessions", // GET /session/{id}/webhooks/ → webhooks.py:38
|
|
899
|
+
run: (args) => listSessionWebhooks(args.session_id, Number(args.wait_seconds ?? 0)),
|
|
900
|
+
},
|
|
901
|
+
{
|
|
902
|
+
def: {
|
|
903
|
+
name: "didit_session_webhook_resend",
|
|
904
|
+
description: "Resend one recorded webhook delivery of a session to the configured endpoint (the session page's own Resend). Use after the customer fixed their endpoint so they do not need a new session; returns the new delivery with its response_status.",
|
|
905
|
+
inputSchema: {
|
|
906
|
+
type: "object",
|
|
907
|
+
properties: {
|
|
908
|
+
session_id: { type: "string", description: "REQUIRED" },
|
|
909
|
+
webhook_id: { type: "string", description: "REQUIRED. The delivery's uuid from didit_session_webhooks" },
|
|
910
|
+
},
|
|
911
|
+
required: ["session_id", "webhook_id"],
|
|
912
|
+
},
|
|
913
|
+
},
|
|
914
|
+
// Its name reads like a read, but its handler creates a server-side artifact or job.
|
|
915
|
+
access: "write",
|
|
916
|
+
permission: "create:sessions", // POST /session/{id}/webhook/{uuid}/resend → webhooks.py:109
|
|
917
|
+
run: (args) => resendSessionWebhook(args.session_id, args.webhook_id),
|
|
918
|
+
},
|
|
919
|
+
{
|
|
920
|
+
def: {
|
|
921
|
+
name: "didit_session_import_shared",
|
|
922
|
+
description: "Import a shared verification session from a partner (Reusable KYC).",
|
|
923
|
+
inputSchema: {
|
|
924
|
+
type: "object",
|
|
925
|
+
properties: {
|
|
926
|
+
share_token: { type: "string", description: "Token received from the sharing partner" },
|
|
927
|
+
},
|
|
928
|
+
required: ["share_token"],
|
|
929
|
+
},
|
|
930
|
+
},
|
|
931
|
+
access: "write",
|
|
932
|
+
permission: null, // POST /session/import-shared/ → shared_session.py:78 — no decorator
|
|
933
|
+
run: (args) => importSharedSession(args),
|
|
934
|
+
},
|
|
935
|
+
];
|
|
936
|
+
// ── The session import tools (tools/registry.ts) ──────────────────────────────────
|
|
937
|
+
// Each tool declares here what index.ts and permissions.ts used to keep in their name-keyed tables.
|
|
938
|
+
// The definitions are listed where these tools always were, so the tool list does not change.
|
|
939
|
+
exports.SESSION_IMPORT_TOOLS = [
|
|
940
|
+
{
|
|
941
|
+
def: {
|
|
942
|
+
name: "didit_session_create_import",
|
|
943
|
+
description: "Create a bulk import job: a hosted CSV/NDJSON file (source_file_url) of historical verifications, or (source=provider) a migration from another " +
|
|
944
|
+
"identity verification provider. File imports use Didit's canonical schema; label a record's source with the optional per-row `provider` column in the " +
|
|
945
|
+
"file. A provider migration reads Sumsub, Onfido, Persona and ComplyCube with the customer's READ-ONLY key (`credentials`, named as that provider's " +
|
|
946
|
+
"credential_fields from didit_session_list_import_providers); Veriff, iDenfy and MetaMap are read by the record IDs in source_file_url, and the others import " +
|
|
947
|
+
"an export file. The key is secret: ask the user for a read-only key, never log or repeat it, and never reuse it. Didit encrypts it, never returns it and " +
|
|
948
|
+
"erases it when the import ends. Prefer dry_run:true first: it counts what would import and writes nothing, ends READY, and didit_session_manage_import " +
|
|
949
|
+
"action=start then imports for real. Record IDs are namespaced by provider, so re-runs and moving between a file and a provider migration never import a " +
|
|
950
|
+
"record twice. An application runs at most 4 active import jobs at once (a fifth answers 429); a job a deploy interrupted resumes by itself. Imports must be " +
|
|
951
|
+
"enabled for the organization by Didit and are refused on a sandbox application (403).",
|
|
952
|
+
inputSchema: {
|
|
953
|
+
type: "object",
|
|
954
|
+
properties: {
|
|
955
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
956
|
+
source_file_url: { type: "string", description: "Publicly fetchable HTTPS URL of the CSV/NDJSON file (or, for providers read by record IDs, of the ID list) to import." },
|
|
957
|
+
import_type: { type: "string", enum: ["user_verification", "business_verification", "status_rules", "transactions"], description: "What the rows represent (default user_verification)" },
|
|
958
|
+
source_format: { type: "string", enum: ["csv", "ndjson"], description: "File format (default: inferred from the URL)" },
|
|
959
|
+
workflow_id: { type: "string", description: "Workflow to associate imported sessions with" },
|
|
960
|
+
source: { type: "string", enum: ["file", "provider"], description: "provider makes this a migration from another provider. Omit for a file import." },
|
|
961
|
+
provider: { type: "string", description: "Migration source id from didit_session_list_import_providers (for example sumsub, onfido, persona). Required when source is provider." },
|
|
962
|
+
credentials: {
|
|
963
|
+
type: "object",
|
|
964
|
+
additionalProperties: { type: "string" },
|
|
965
|
+
description: "SECRET. The provider's read-only key, with the field names its credential_fields list. Never echo it back to the user or into logs.",
|
|
966
|
+
},
|
|
967
|
+
options: { type: "object", description: "Provider options, for example { region } (Onfido: eu, us, ca)." },
|
|
968
|
+
status_mapping: {
|
|
969
|
+
type: "object",
|
|
970
|
+
additionalProperties: { type: "string", enum: ["Approved", "Declined", "In Review", "Expired", "Not Finished", "Abandoned"] },
|
|
971
|
+
description: "Edits to the provider's default status mapping: source status to Didit status. Not Finished and Abandoned are skipped and counted, never imported.",
|
|
972
|
+
},
|
|
973
|
+
dry_run: { type: "boolean", description: "Count what a provider migration would import and write nothing; the job ends READY and is started with didit_session_manage_import." },
|
|
974
|
+
face_templates: { type: "boolean", description: "Build face templates from imported selfies and search them against the application's faces and blocklist (flags for review only). Requires lawful_basis_confirmed." },
|
|
975
|
+
lawful_basis_confirmed: { type: "boolean", description: "Confirms the customer has a lawful basis to share these selfies with Didit as processor. Only set it after the user states so." },
|
|
976
|
+
},
|
|
977
|
+
required: ["source_file_url"],
|
|
978
|
+
},
|
|
979
|
+
},
|
|
980
|
+
access: "write",
|
|
981
|
+
permission: null, // POST /session/imports/ → imports.py:77 — no decorator
|
|
982
|
+
run: (args) => createImport(args),
|
|
983
|
+
},
|
|
984
|
+
{
|
|
985
|
+
def: {
|
|
986
|
+
name: "didit_session_list_import_providers",
|
|
987
|
+
description: "List the 15 providers verifications can be migrated from: what each needs to connect (credential_fields, regions), whether its API can list records, the permissions its read-only key needs and its default status mapping.",
|
|
988
|
+
inputSchema: { type: "object", properties: { ...orgapp_1.ORG_APP_PROPS } },
|
|
989
|
+
},
|
|
990
|
+
access: "read",
|
|
991
|
+
permission: null, // GET /session/imports/providers/ → import_jobs.py:99 — no decorator
|
|
992
|
+
run: () => listImportProviders(),
|
|
993
|
+
},
|
|
994
|
+
{
|
|
995
|
+
def: {
|
|
996
|
+
name: "didit_session_check_import_provider",
|
|
997
|
+
description: "Read a provider with the customer's read-only key before creating a migration. Nothing is stored. For providers read by record IDs, pass record_ids " +
|
|
998
|
+
"(the first record ID of the export). The key is secret: never log or repeat it.",
|
|
999
|
+
inputSchema: {
|
|
1000
|
+
type: "object",
|
|
1001
|
+
properties: {
|
|
1002
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1003
|
+
provider: { type: "string", description: "REQUIRED. Provider id from didit_session_list_import_providers." },
|
|
1004
|
+
credentials: { type: "object", additionalProperties: { type: "string" }, description: "REQUIRED. SECRET. The provider's read-only key, named as its credential_fields." },
|
|
1005
|
+
options: { type: "object", description: "Provider options, for example { region }." },
|
|
1006
|
+
record_ids: { type: "array", items: { type: "string" }, description: "For providers read by record IDs: the first record ID of the export." },
|
|
1007
|
+
},
|
|
1008
|
+
required: ["provider", "credentials"],
|
|
1009
|
+
},
|
|
1010
|
+
},
|
|
1011
|
+
// Reads the provider the sessions come from, with the customer's key; nothing is stored.
|
|
1012
|
+
access: "write",
|
|
1013
|
+
openWorld: true,
|
|
1014
|
+
permission: null, // POST /session/imports/providers/check/ → import_jobs.py:120 — no decorator
|
|
1015
|
+
run: (args) => checkImportProvider(args),
|
|
1016
|
+
},
|
|
1017
|
+
{
|
|
1018
|
+
def: {
|
|
1019
|
+
name: "didit_session_manage_import",
|
|
1020
|
+
description: "Act on an import job: start (a dry run that ended READY imports for real, with the status_mapping, face_templates and lawful_basis_confirmed sent now), " +
|
|
1021
|
+
"pause, resume, cancel (what was imported stays; the uploaded file and the key are erased) or retry (runs an ended migration again as a NEW job with a new key " +
|
|
1022
|
+
"in credentials, since the old one was erased; everything already in Didit is skipped).",
|
|
1023
|
+
inputSchema: {
|
|
1024
|
+
type: "object",
|
|
1025
|
+
properties: {
|
|
1026
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1027
|
+
import_id: { type: "string", description: "REQUIRED. Import job ID." },
|
|
1028
|
+
action: { type: "string", enum: ["start", "pause", "resume", "cancel", "retry"], description: "REQUIRED." },
|
|
1029
|
+
data: {
|
|
1030
|
+
type: "object",
|
|
1031
|
+
description: "start: { status_mapping, face_templates, lawful_basis_confirmed }. retry: { credentials } (SECRET, never echo it). Other actions take none.",
|
|
1032
|
+
},
|
|
1033
|
+
},
|
|
1034
|
+
required: ["import_id", "action"],
|
|
1035
|
+
},
|
|
1036
|
+
},
|
|
1037
|
+
// Its name reads like a read, but it starts, pauses, resumes, cancels or retries an import.
|
|
1038
|
+
access: "write",
|
|
1039
|
+
permission: null, // POST /session/imports/{id}/{start|pause|resume|cancel|retry}/ → import_jobs.py — no decorator
|
|
1040
|
+
run: (args) => manageImport(args.import_id, args.action, args.data),
|
|
1041
|
+
},
|
|
1042
|
+
{
|
|
1043
|
+
def: {
|
|
1044
|
+
name: "didit_session_get_import_template",
|
|
1045
|
+
description: "Download the canonical import template (column headers and format) used by didit_session_create_import.",
|
|
1046
|
+
inputSchema: { type: "object", properties: { ...orgapp_1.ORG_APP_PROPS } },
|
|
1047
|
+
},
|
|
1048
|
+
access: "read",
|
|
1049
|
+
permission: null, // GET /session/imports/template/ → imports.py:197 — no decorator
|
|
1050
|
+
run: () => getImportTemplate(),
|
|
1051
|
+
},
|
|
1052
|
+
{
|
|
1053
|
+
def: {
|
|
1054
|
+
name: "didit_session_get_import",
|
|
1055
|
+
description: "Get the status and summary of a bulk import job.",
|
|
1056
|
+
inputSchema: {
|
|
1057
|
+
type: "object",
|
|
1058
|
+
properties: {
|
|
1059
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1060
|
+
import_id: { type: "string", description: "Import job ID returned by didit_session_create_import" },
|
|
1061
|
+
},
|
|
1062
|
+
required: ["import_id"],
|
|
1063
|
+
},
|
|
1064
|
+
},
|
|
1065
|
+
access: "read",
|
|
1066
|
+
permission: null, // GET /session/imports/{id}/ → imports.py:170 — no decorator
|
|
1067
|
+
run: (args) => getImport(args.import_id),
|
|
1068
|
+
},
|
|
1069
|
+
{
|
|
1070
|
+
def: {
|
|
1071
|
+
name: "didit_session_get_import_errors",
|
|
1072
|
+
description: "List per-row errors for a bulk import job (rows that failed validation or processing).",
|
|
1073
|
+
inputSchema: {
|
|
1074
|
+
type: "object",
|
|
1075
|
+
properties: {
|
|
1076
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1077
|
+
import_id: { type: "string", description: "Import job ID" },
|
|
1078
|
+
},
|
|
1079
|
+
required: ["import_id"],
|
|
1080
|
+
},
|
|
1081
|
+
},
|
|
1082
|
+
access: "read",
|
|
1083
|
+
permission: null, // GET /session/imports/{id}/errors/ → imports.py:182 — no decorator
|
|
1084
|
+
run: (args) => getImportErrors(args.import_id),
|
|
1085
|
+
},
|
|
1086
|
+
];
|
|
380
1087
|
//# sourceMappingURL=sessions.js.map
|