@transcend-io/mcp-server-dsr 0.3.5 → 0.3.7
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 +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/{graphql-CBzVUuzR.mjs → graphql-CSrIBjNn.mjs} +46 -46
- package/dist/graphql-CSrIBjNn.mjs.map +1 -0
- package/dist/index.d.mts +4 -4
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -2
- package/package.json +2 -2
- package/dist/graphql-CBzVUuzR.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -79,7 +79,7 @@ See [CONTRIBUTING.md](../../../CONTRIBUTING.md#mcp-servers) for workspace layout
|
|
|
79
79
|
- `dsr_list` — List data subject requests
|
|
80
80
|
- `dsr_get_details` — Get request details
|
|
81
81
|
- `dsr_submit` — Submit a new DSR
|
|
82
|
-
- `
|
|
82
|
+
- `dsr_submit_on_behalf` — Submit a DSR as an admin on behalf of a data subject
|
|
83
83
|
- `dsr_cancel` — Cancel a request
|
|
84
84
|
- `dsr_respond_access` — Respond to an access request
|
|
85
85
|
- `dsr_respond_erasure` — Respond to an erasure request
|
package/dist/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { n as getDSRTools, t as DSRMixin } from "./graphql-
|
|
2
|
+
import { n as getDSRTools, t as DSRMixin } from "./graphql-CSrIBjNn.mjs";
|
|
3
3
|
import { TranscendRestClient, createMCPServer } from "@transcend-io/mcp-server-base";
|
|
4
4
|
//#region src/cli.ts
|
|
5
5
|
createMCPServer({
|
|
@@ -6,7 +6,7 @@ function createDsrAnalyzeTool(clients) {
|
|
|
6
6
|
const graphql = clients.graphql;
|
|
7
7
|
return defineTool({
|
|
8
8
|
name: "dsr_analyze",
|
|
9
|
-
description: "
|
|
9
|
+
description: "Summarize the 100 most recent DSRs: counts by type and status, completion rate, and a configurable recent-days window (default 30). For full-fleet analytics, page through dsr_list and aggregate yourself.",
|
|
10
10
|
category: "DSR Automation",
|
|
11
11
|
readOnly: true,
|
|
12
12
|
annotations: {
|
|
@@ -114,47 +114,6 @@ function createDsrDownloadKeysTool(clients) {
|
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
116
|
//#endregion
|
|
117
|
-
//#region src/tools/dsr_employee_submit.ts
|
|
118
|
-
const employeeSubmitDsrSchema = z.object({
|
|
119
|
-
type: z.nativeEnum(RequestAction).describe("Type of DSR request"),
|
|
120
|
-
email: z.string().describe("Email address of the data subject"),
|
|
121
|
-
subjectType: z.string().describe("Type of data subject (e.g., customer, employee). Required by the Transcend API."),
|
|
122
|
-
coreIdentifier: z.string().optional().describe("Core identifier for the data subject (optional)"),
|
|
123
|
-
locale: z.string().optional().describe("Locale for communications (e.g., en-US)"),
|
|
124
|
-
isSilent: z.boolean().optional().describe("Whether to suppress email notifications")
|
|
125
|
-
});
|
|
126
|
-
function createDsrEmployeeSubmitTool(clients) {
|
|
127
|
-
const graphql = clients.graphql;
|
|
128
|
-
return defineTool({
|
|
129
|
-
name: "dsr_employee_submit",
|
|
130
|
-
description: "Submit a Data Subject Request as an employee on behalf of a data subject. Requires subjectType to be specified.",
|
|
131
|
-
category: "DSR Automation",
|
|
132
|
-
readOnly: false,
|
|
133
|
-
confirmationHint: "Creates a new data subject request (employee)",
|
|
134
|
-
annotations: {
|
|
135
|
-
readOnlyHint: false,
|
|
136
|
-
destructiveHint: false,
|
|
137
|
-
idempotentHint: false
|
|
138
|
-
},
|
|
139
|
-
zodSchema: employeeSubmitDsrSchema,
|
|
140
|
-
handler: async ({ type, email, subjectType, coreIdentifier, locale, isSilent }) => {
|
|
141
|
-
const result = await graphql.employeeMakeDataSubjectRequest({
|
|
142
|
-
type,
|
|
143
|
-
email,
|
|
144
|
-
subjectType,
|
|
145
|
-
coreIdentifier,
|
|
146
|
-
locale,
|
|
147
|
-
isSilent
|
|
148
|
-
});
|
|
149
|
-
return createToolResult(true, {
|
|
150
|
-
request: result.request,
|
|
151
|
-
clientMutationId: result.clientMutationId,
|
|
152
|
-
message: `Employee DSR of type ${type} submitted successfully`
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
//#endregion
|
|
158
117
|
//#region src/tools/dsr_enrich_identifiers.ts
|
|
159
118
|
const enrichIdentifiersSchema = z.object({
|
|
160
119
|
request_id: z.string().describe("ID of the DSR to enrich"),
|
|
@@ -358,7 +317,7 @@ function createDsrSubmitTool(clients) {
|
|
|
358
317
|
const { rest } = clients;
|
|
359
318
|
return defineTool({
|
|
360
319
|
name: "dsr_submit",
|
|
361
|
-
description: "Submit a
|
|
320
|
+
description: "Submit a Data Subject Request as the data subject (public DSR API; e.g. Privacy Center flow). Supports ACCESS, ERASURE, RECTIFICATION, etc. coreIdentifier defaults to email. Use dsr_submit_on_behalf when an admin is filing on behalf of a data subject.",
|
|
362
321
|
category: "DSR Automation",
|
|
363
322
|
readOnly: false,
|
|
364
323
|
confirmationHint: "Creates a new data subject request",
|
|
@@ -385,6 +344,47 @@ function createDsrSubmitTool(clients) {
|
|
|
385
344
|
});
|
|
386
345
|
}
|
|
387
346
|
//#endregion
|
|
347
|
+
//#region src/tools/dsr_submit_on_behalf.ts
|
|
348
|
+
const submitDsrOnBehalfSchema = z.object({
|
|
349
|
+
type: z.nativeEnum(RequestAction).describe("Type of DSR request"),
|
|
350
|
+
email: z.string().describe("Email address of the data subject"),
|
|
351
|
+
subjectType: z.string().describe("Type of data subject (e.g., customer, employee). Required by the Transcend API."),
|
|
352
|
+
coreIdentifier: z.string().optional().describe("Core identifier for the data subject (optional)"),
|
|
353
|
+
locale: z.string().optional().describe("Locale for communications (e.g., en-US)"),
|
|
354
|
+
isSilent: z.boolean().optional().describe("Whether to suppress email notifications")
|
|
355
|
+
});
|
|
356
|
+
function createDsrSubmitOnBehalfTool(clients) {
|
|
357
|
+
const graphql = clients.graphql;
|
|
358
|
+
return defineTool({
|
|
359
|
+
name: "dsr_submit_on_behalf",
|
|
360
|
+
description: "Submit a Data Subject Request as an admin on behalf of a data subject (admin-dashboard flow). Use dsr_submit when the data subject is submitting their own.",
|
|
361
|
+
category: "DSR Automation",
|
|
362
|
+
readOnly: false,
|
|
363
|
+
confirmationHint: "Creates a new data subject request on behalf of a data subject",
|
|
364
|
+
annotations: {
|
|
365
|
+
readOnlyHint: false,
|
|
366
|
+
destructiveHint: false,
|
|
367
|
+
idempotentHint: false
|
|
368
|
+
},
|
|
369
|
+
zodSchema: submitDsrOnBehalfSchema,
|
|
370
|
+
handler: async ({ type, email, subjectType, coreIdentifier, locale, isSilent }) => {
|
|
371
|
+
const result = await graphql.employeeMakeDataSubjectRequest({
|
|
372
|
+
type,
|
|
373
|
+
email,
|
|
374
|
+
subjectType,
|
|
375
|
+
coreIdentifier,
|
|
376
|
+
locale,
|
|
377
|
+
isSilent
|
|
378
|
+
});
|
|
379
|
+
return createToolResult(true, {
|
|
380
|
+
request: result.request,
|
|
381
|
+
clientMutationId: result.clientMutationId,
|
|
382
|
+
message: `DSR of type ${type} submitted on behalf of data subject`
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
//#endregion
|
|
388
388
|
//#region src/tools/index.ts
|
|
389
389
|
function getDSRTools(clients) {
|
|
390
390
|
return [
|
|
@@ -398,7 +398,7 @@ function getDSRTools(clients) {
|
|
|
398
398
|
createDsrRespondAccessTool(clients),
|
|
399
399
|
createDsrRespondErasureTool(clients),
|
|
400
400
|
createDsrCancelTool(clients),
|
|
401
|
-
|
|
401
|
+
createDsrSubmitOnBehalfTool(clients),
|
|
402
402
|
createDsrAnalyzeTool(clients)
|
|
403
403
|
];
|
|
404
404
|
}
|
|
@@ -479,6 +479,6 @@ var DSRMixin = class extends TranscendGraphQLBase {
|
|
|
479
479
|
}
|
|
480
480
|
};
|
|
481
481
|
//#endregion
|
|
482
|
-
export {
|
|
482
|
+
export { respondErasureSchema as a, listIdentifiersSchema as c, downloadKeysSchema as d, cancelDsrSchema as f, submitDsrSchema as i, getDetailsSchema as l, getDSRTools as n, respondAccessSchema as o, analyzeDsrSchema as p, submitDsrOnBehalfSchema as r, pollStatusSchema as s, DSRMixin as t, enrichIdentifiersSchema as u };
|
|
483
483
|
|
|
484
|
-
//# sourceMappingURL=graphql-
|
|
484
|
+
//# sourceMappingURL=graphql-CSrIBjNn.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql-CSrIBjNn.mjs","names":[],"sources":["../src/tools/dsr_analyze.ts","../src/tools/dsr_cancel.ts","../src/tools/dsr_download_keys.ts","../src/tools/dsr_enrich_identifiers.ts","../src/tools/dsr_get_details.ts","../src/tools/dsr_list.ts","../src/tools/dsr_list_identifiers.ts","../src/tools/dsr_poll_status.ts","../src/tools/dsr_respond_access.ts","../src/tools/dsr_respond_erasure.ts","../src/tools/dsr_submit.ts","../src/tools/dsr_submit_on_behalf.ts","../src/tools/index.ts","../src/graphql.ts"],"sourcesContent":["import {\n createToolResult,\n defineTool,\n groupBy,\n type ToolClients,\n z,\n} from '@transcend-io/mcp-server-base';\n\nimport type { DSRMixin } from '../graphql.js';\n\nexport const analyzeDsrSchema = z.object({\n days: z.coerce\n .number()\n .optional()\n .describe(\n 'Filter analysis to requests within N days (default: 30). Only analyzes from the 100 most recent requests.',\n ),\n});\nexport type AnalyzeDsrInput = z.infer<typeof analyzeDsrSchema>;\n\nexport function createDsrAnalyzeTool(clients: ToolClients) {\n const graphql = clients.graphql as DSRMixin;\n\n return defineTool({\n name: 'dsr_analyze',\n description:\n 'Summarize the 100 most recent DSRs: counts by type and status, completion rate, and a configurable recent-days window (default 30). For full-fleet analytics, page through dsr_list and aggregate yourself.',\n category: 'DSR Automation',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: analyzeDsrSchema,\n handler: async ({ days }) => {\n const result = await graphql.listRequests({ first: 100 });\n const requests = result.nodes;\n const periodDays = days ?? 30;\n const cutoffDate = new Date(Date.now() - periodDays * 24 * 60 * 60 * 1000);\n\n const recentRequests = requests.filter((r) => new Date(r.createdAt) > cutoffDate);\n const completedRequests = requests.filter((r) => r.status === 'COMPLETED');\n const pendingRequests = requests.filter((r) =>\n [\n 'REQUEST_MADE',\n 'ENRICHING',\n 'ON_HOLD',\n 'WAITING',\n 'COMPILING',\n 'APPROVING',\n 'DELAYED',\n 'SECONDARY',\n 'SECONDARY_APPROVING',\n ].includes(r.status),\n );\n\n return createToolResult(true, {\n summary: {\n analyzedRequests: requests.length,\n totalRequestsInSystem: result.totalCount,\n recentRequests: recentRequests.length,\n completedRequests: completedRequests.length,\n pendingRequests: pendingRequests.length,\n completionRate:\n requests.length > 0\n ? Math.round((completedRequests.length / requests.length) * 100)\n : 0,\n },\n breakdown: {\n byType: groupBy(requests, 'type'),\n byStatus: groupBy(requests, 'status'),\n recentByType: groupBy(recentRequests, 'type'),\n recentByStatus: groupBy(recentRequests, 'status'),\n },\n period: {\n days: periodDays,\n startDate: cutoffDate.toISOString(),\n endDate: new Date().toISOString(),\n },\n limitation:\n (result.totalCount || 0) > 100\n ? `This analysis is based on the 100 most recent requests out of ${result.totalCount} total. For complete analysis, use dsr_list with pagination to fetch all requests.`\n : undefined,\n });\n },\n });\n}\n","import { createToolResult, defineTool, type ToolClients, z } from '@transcend-io/mcp-server-base';\n\nimport type { DSRMixin } from '../graphql.js';\n\nexport const cancelDsrSchema = z.object({\n request_id: z.string().describe('ID of the DSR to cancel'),\n reason: z.string().optional().describe('Reason for cancellation (optional)'),\n});\nexport type CancelDsrInput = z.infer<typeof cancelDsrSchema>;\n\nexport function createDsrCancelTool(clients: ToolClients) {\n const graphql = clients.graphql as DSRMixin;\n\n return defineTool({\n name: 'dsr_cancel',\n description: 'Cancel a Data Subject Request',\n category: 'DSR Automation',\n readOnly: false,\n confirmationHint: 'Cancels the specified request permanently',\n annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },\n zodSchema: cancelDsrSchema,\n handler: async ({ request_id, reason }) => {\n const input: { requestId: string; template?: string; subject?: string } = {\n requestId: request_id,\n };\n if (reason) {\n input.subject = reason;\n }\n const result = await graphql.cancelRequest(input);\n return createToolResult(true, {\n request: result.request,\n message: 'DSR canceled successfully',\n });\n },\n });\n}\n","import { createToolResult, defineTool, type ToolClients, z } from '@transcend-io/mcp-server-base';\n\nexport const downloadKeysSchema = z.object({\n request_id: z.string().describe('ID of the completed DSR'),\n});\nexport type DownloadKeysInput = z.infer<typeof downloadKeysSchema>;\n\nexport function createDsrDownloadKeysTool(clients: ToolClients) {\n const { rest } = clients;\n\n return defineTool({\n name: 'dsr_download_keys',\n description:\n 'Get download keys for a completed Data Subject Request. These keys can be used to download the DSR results.',\n category: 'DSR Automation',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: downloadKeysSchema,\n handler: async ({ request_id }) => {\n const keys = await rest.getDSRDownloadKeys(request_id);\n return createToolResult(true, {\n downloadKeys: keys,\n count: keys.length,\n });\n },\n });\n}\n","import { createToolResult, defineTool, type ToolClients, z } from '@transcend-io/mcp-server-base';\n\nexport const enrichIdentifiersSchema = z.object({\n request_id: z.string().describe('ID of the DSR to enrich'),\n identifiers: z\n .record(z.string(), z.string())\n .describe('Key-value pairs of identifier names and values to add'),\n});\nexport type EnrichIdentifiersInput = z.infer<typeof enrichIdentifiersSchema>;\n\nexport function createDsrEnrichIdentifiersTool(clients: ToolClients) {\n const { rest } = clients;\n\n return defineTool({\n name: 'dsr_enrich_identifiers',\n description:\n 'Enrich a Data Subject Request with additional identifiers during preflight processing',\n category: 'DSR Automation',\n readOnly: false,\n confirmationHint: 'Adds identifiers to the DSR during preflight',\n annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },\n zodSchema: enrichIdentifiersSchema,\n handler: async ({ request_id, identifiers }) => {\n const result = await rest.enrichIdentifiers({\n requestId: request_id,\n identifiers,\n });\n return createToolResult(true, {\n ...result,\n message: 'Identifiers enriched successfully',\n });\n },\n });\n}\n","import { createToolResult, defineTool, type ToolClients, z } from '@transcend-io/mcp-server-base';\n\nimport type { DSRMixin } from '../graphql.js';\n\nexport const getDetailsSchema = z.object({\n request_id: z.string().describe('ID of the DSR to retrieve'),\n});\nexport type GetDetailsInput = z.infer<typeof getDetailsSchema>;\n\nexport function createDsrGetDetailsTool(clients: ToolClients) {\n const graphql = clients.graphql as DSRMixin;\n\n return defineTool({\n name: 'dsr_get_details',\n description: 'Get detailed information about a specific Data Subject Request',\n category: 'DSR Automation',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: getDetailsSchema,\n handler: async ({ request_id }) => {\n const result = await graphql.getRequest(request_id);\n return createToolResult(true, result);\n },\n });\n}\n","import {\n createListResult,\n defineTool,\n PaginationSchema,\n type ToolClients,\n} from '@transcend-io/mcp-server-base';\n\nimport type { DSRMixin } from '../graphql.js';\n\nexport function createDsrListTool(clients: ToolClients) {\n const graphql = clients.graphql as DSRMixin;\n\n return defineTool({\n name: 'dsr_list',\n description:\n 'List all Data Subject Requests. Use cursor pagination to retrieve all results (max 100 per page). Note: Server-side date filtering is not available - filter results client-side if needed.',\n category: 'DSR Automation',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: PaginationSchema,\n handler: async ({ limit, cursor }) => {\n const result = await graphql.listRequests({\n first: limit,\n after: cursor,\n });\n\n return createListResult(result.nodes, {\n totalCount: result.totalCount,\n hasNextPage: result.pageInfo?.hasNextPage,\n cursor: result.pageInfo?.endCursor,\n paginationNote: result.pageInfo?.hasNextPage\n ? 'More results available. Pass the cursor value to fetch the next page.'\n : 'No more results.',\n });\n },\n });\n}\n","import {\n createListResult,\n defineTool,\n PaginationSchema,\n type ToolClients,\n z,\n} from '@transcend-io/mcp-server-base';\n\nexport const listIdentifiersSchema = z\n .object({\n request_id: z.string().describe('ID of the DSR'),\n })\n .merge(PaginationSchema);\nexport type ListIdentifiersInput = z.infer<typeof listIdentifiersSchema>;\n\nexport function createDsrListIdentifiersTool(clients: ToolClients) {\n const { rest } = clients;\n\n return defineTool({\n name: 'dsr_list_identifiers',\n description: 'List all identifiers attached to a Data Subject Request',\n category: 'DSR Automation',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: listIdentifiersSchema,\n handler: async ({ request_id }) => {\n const identifiers = await rest.listRequestIdentifiers(request_id);\n return createListResult(identifiers);\n },\n });\n}\n","import { createToolResult, defineTool, type ToolClients, z } from '@transcend-io/mcp-server-base';\n\nexport const pollStatusSchema = z.object({\n request_id: z.string().describe('ID of the DSR to check'),\n});\nexport type PollStatusInput = z.infer<typeof pollStatusSchema>;\n\nexport function createDsrPollStatusTool(clients: ToolClients) {\n const { rest } = clients;\n\n return defineTool({\n name: 'dsr_poll_status',\n description: 'Poll the current status of a Data Subject Request',\n category: 'DSR Automation',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: pollStatusSchema,\n handler: async ({ request_id }) => {\n const result = await rest.getDSRStatus(request_id);\n return createToolResult(true, result);\n },\n });\n}\n","import { createToolResult, defineTool, type ToolClients, z } from '@transcend-io/mcp-server-base';\n\nexport const respondAccessSchema = z.object({\n request_id: z.string().describe('ID of the DSR'),\n data_silo_id: z.string().describe('ID of the data silo responding'),\n profiles: z\n .array(z.record(z.string(), z.unknown()))\n .optional()\n .describe('Array of profile data objects to return'),\n});\nexport type RespondAccessInput = z.infer<typeof respondAccessSchema>;\n\nexport function createDsrRespondAccessTool(clients: ToolClients) {\n const { rest } = clients;\n\n return defineTool({\n name: 'dsr_respond_access',\n description: 'Respond to an ACCESS request by uploading user data',\n category: 'DSR Automation',\n readOnly: false,\n confirmationHint: 'Uploads access response data for the DSR',\n annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },\n zodSchema: respondAccessSchema,\n handler: async ({ request_id, data_silo_id, profiles }) => {\n const result = await rest.respondToAccess({\n requestId: request_id,\n dataSiloId: data_silo_id,\n profiles: profiles as Record<string, unknown>[] | undefined,\n });\n return createToolResult(true, {\n ...result,\n message: 'Access response submitted successfully',\n });\n },\n });\n}\n","import { createToolResult, defineTool, type ToolClients, z } from '@transcend-io/mcp-server-base';\n\nexport const respondErasureSchema = z.object({\n request_id: z.string().describe('ID of the DSR'),\n data_silo_id: z.string().describe('ID of the data silo that completed erasure'),\n profile_ids: z\n .array(z.string())\n .optional()\n .describe('IDs of profiles that were erased (optional)'),\n});\nexport type RespondErasureInput = z.infer<typeof respondErasureSchema>;\n\nexport function createDsrRespondErasureTool(clients: ToolClients) {\n const { rest } = clients;\n\n return defineTool({\n name: 'dsr_respond_erasure',\n description: 'Confirm that data erasure has been completed for a data silo',\n category: 'DSR Automation',\n readOnly: false,\n confirmationHint: 'Confirms erasure completion for the data silo',\n annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },\n zodSchema: respondErasureSchema,\n handler: async ({ request_id, data_silo_id, profile_ids }) => {\n const result = await rest.confirmErasure({\n requestId: request_id,\n dataSiloId: data_silo_id,\n profileIds: profile_ids,\n });\n return createToolResult(true, {\n ...result,\n message: 'Erasure confirmation submitted successfully',\n });\n },\n });\n}\n","import { createToolResult, defineTool, type ToolClients, z } from '@transcend-io/mcp-server-base';\nimport { RequestAction } from '@transcend-io/privacy-types';\n\nexport const submitDsrSchema = z.object({\n type: z.nativeEnum(RequestAction).describe('Type of DSR request'),\n email: z.string().describe('Email address of the data subject'),\n subjectType: z\n .string()\n .describe(\n 'Type of data subject (e.g., customer, employee, prospect). Required by the Transcend API.',\n ),\n coreIdentifier: z\n .string()\n .optional()\n .describe('Core identifier for the data subject (defaults to email if not provided)'),\n name: z.string().optional().describe('Name of the data subject (optional)'),\n locale: z.string().optional().describe('Locale for communications (e.g., en-US)'),\n isSilent: z.boolean().optional().describe('Whether to suppress email notifications'),\n});\nexport type SubmitDsrInput = z.infer<typeof submitDsrSchema>;\n\nexport function createDsrSubmitTool(clients: ToolClients) {\n const { rest } = clients;\n\n return defineTool({\n name: 'dsr_submit',\n description:\n 'Submit a Data Subject Request as the data subject (public DSR API; e.g. Privacy Center flow). Supports ACCESS, ERASURE, RECTIFICATION, etc. coreIdentifier defaults to email. Use dsr_submit_on_behalf when an admin is filing on behalf of a data subject.',\n category: 'DSR Automation',\n readOnly: false,\n confirmationHint: 'Creates a new data subject request',\n annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },\n zodSchema: submitDsrSchema,\n handler: async ({ type, email, subjectType, coreIdentifier, name, locale, isSilent }) => {\n const result = await rest.submitDSR({\n type,\n email,\n subjectType,\n coreIdentifier,\n name,\n locale,\n isSilent,\n });\n return createToolResult(true, {\n request: result,\n message: `DSR of type ${type} submitted successfully`,\n });\n },\n });\n}\n","import { createToolResult, defineTool, type ToolClients, z } from '@transcend-io/mcp-server-base';\nimport { RequestAction } from '@transcend-io/privacy-types';\n\nimport type { DSRMixin } from '../graphql.js';\n\nexport const submitDsrOnBehalfSchema = z.object({\n type: z.nativeEnum(RequestAction).describe('Type of DSR request'),\n email: z.string().describe('Email address of the data subject'),\n subjectType: z\n .string()\n .describe('Type of data subject (e.g., customer, employee). Required by the Transcend API.'),\n coreIdentifier: z.string().optional().describe('Core identifier for the data subject (optional)'),\n locale: z.string().optional().describe('Locale for communications (e.g., en-US)'),\n isSilent: z.boolean().optional().describe('Whether to suppress email notifications'),\n});\nexport type SubmitDsrOnBehalfInput = z.infer<typeof submitDsrOnBehalfSchema>;\n\nexport function createDsrSubmitOnBehalfTool(clients: ToolClients) {\n const graphql = clients.graphql as DSRMixin;\n\n return defineTool({\n name: 'dsr_submit_on_behalf',\n description:\n 'Submit a Data Subject Request as an admin on behalf of a data subject (admin-dashboard flow). Use dsr_submit when the data subject is submitting their own.',\n category: 'DSR Automation',\n readOnly: false,\n confirmationHint: 'Creates a new data subject request on behalf of a data subject',\n annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },\n zodSchema: submitDsrOnBehalfSchema,\n handler: async ({ type, email, subjectType, coreIdentifier, locale, isSilent }) => {\n const result = await graphql.employeeMakeDataSubjectRequest({\n type,\n email,\n subjectType,\n coreIdentifier,\n locale,\n isSilent,\n });\n return createToolResult(true, {\n request: result.request,\n clientMutationId: result.clientMutationId,\n message: `DSR of type ${type} submitted on behalf of data subject`,\n });\n },\n });\n}\n","import type { ToolDefinition, ToolClients } from '@transcend-io/mcp-server-base';\n\nimport { createDsrAnalyzeTool } from './dsr_analyze.js';\nimport { createDsrCancelTool } from './dsr_cancel.js';\nimport { createDsrDownloadKeysTool } from './dsr_download_keys.js';\nimport { createDsrEnrichIdentifiersTool } from './dsr_enrich_identifiers.js';\nimport { createDsrGetDetailsTool } from './dsr_get_details.js';\nimport { createDsrListTool } from './dsr_list.js';\nimport { createDsrListIdentifiersTool } from './dsr_list_identifiers.js';\nimport { createDsrPollStatusTool } from './dsr_poll_status.js';\nimport { createDsrRespondAccessTool } from './dsr_respond_access.js';\nimport { createDsrRespondErasureTool } from './dsr_respond_erasure.js';\nimport { createDsrSubmitTool } from './dsr_submit.js';\nimport { createDsrSubmitOnBehalfTool } from './dsr_submit_on_behalf.js';\n\nexport function getDSRTools(clients: ToolClients): ToolDefinition[] {\n return [\n createDsrSubmitTool(clients),\n createDsrPollStatusTool(clients),\n createDsrListTool(clients),\n createDsrGetDetailsTool(clients),\n createDsrDownloadKeysTool(clients),\n createDsrListIdentifiersTool(clients),\n createDsrEnrichIdentifiersTool(clients),\n createDsrRespondAccessTool(clients),\n createDsrRespondErasureTool(clients),\n createDsrCancelTool(clients),\n createDsrSubmitOnBehalfTool(clients),\n createDsrAnalyzeTool(clients),\n ];\n}\n","import {\n TranscendGraphQLBase,\n type ListOptions,\n type PaginatedResponse,\n type Request,\n type RequestDetails,\n type RequestType,\n} from '@transcend-io/mcp-server-base';\n\nexport class DSRMixin extends TranscendGraphQLBase {\n async listRequests(options?: ListOptions): Promise<PaginatedResponse<Request>> {\n const query = `\n query ListRequests($first: Int, $after: String) {\n requests(first: $first, after: $after) {\n nodes {\n id\n type\n status\n createdAt\n updatedAt\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n totalCount\n }\n }\n `;\n const data = await this.makeRequest<{ requests: PaginatedResponse<Request> }>(query, {\n first: Math.min(options?.first || 50, 100),\n after: options?.after,\n });\n return data.requests;\n }\n\n async getRequest(id: string): Promise<RequestDetails> {\n const query = `\n query GetRequest($id: ID!) {\n request(id: $id) {\n id\n type\n status\n createdAt\n updatedAt\n daysRemaining\n link\n locale\n isSilent\n }\n }\n `;\n const data = await this.makeRequest<{ request: RequestDetails }>(query, { id });\n return data.request;\n }\n\n async employeeMakeDataSubjectRequest(input: {\n type: RequestType;\n email: string;\n coreIdentifier?: string;\n locale?: string;\n isSilent?: boolean;\n subjectType: string;\n attributes?: Record<string, unknown>;\n clientMutationId?: string;\n }): Promise<{ request: Request; clientMutationId?: string }> {\n const mutation = `\n mutation EmployeeMakeDataSubjectRequest($input: EmployeeRequestInput!) {\n employeeMakeDataSubjectRequest(input: $input) {\n clientMutationId\n request {\n id\n type\n status\n createdAt\n updatedAt\n }\n }\n }\n `;\n const data = await this.makeRequest<{\n employeeMakeDataSubjectRequest: { request: Request; clientMutationId?: string };\n }>(mutation, { input });\n return data.employeeMakeDataSubjectRequest;\n }\n\n async cancelRequest(input: {\n requestId: string;\n template?: string;\n subject?: string;\n }): Promise<{ request: Request; clientMutationId?: string }> {\n const mutation = `\n mutation CancelRequest($input: CommunicationInput!) {\n cancelRequest(input: $input) {\n clientMutationId\n request {\n id\n type\n status\n createdAt\n updatedAt\n }\n }\n }\n `;\n const data = await this.makeRequest<{\n cancelRequest: { request: Request; clientMutationId?: string };\n }>(mutation, { input });\n return data.cancelRequest;\n }\n}\n"],"mappings":";;;AAUA,MAAa,mBAAmB,EAAE,OAAO,EACvC,MAAM,EAAE,OACL,QAAQ,CACR,UAAU,CACV,SACC,4GACD,EACJ,CAAC;AAGF,SAAgB,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BAAkB,QAAQ;EAC1B,wBAAwB,QAAQ;EAChC,0BAA0B,QAAQ;EAClC,6BAA6B,QAAQ;EACrC,+BAA+B,QAAQ;EACvC,2BAA2B,QAAQ;EACnC,4BAA4B,QAAQ;EACpC,oBAAoB,QAAQ;EAC5B,4BAA4B,QAAQ;EACpC,qBAAqB,QAAQ;EAC9B;;;;ACpBH,IAAa,WAAb,cAA8B,qBAAqB;CACjD,MAAM,aAAa,SAA4D;AAuB7E,UAJa,MAAM,KAAK,YAlBV;;;;;;;;;;;;;;;;;OAkBuE;GACnF,OAAO,KAAK,IAAI,SAAS,SAAS,IAAI,IAAI;GAC1C,OAAO,SAAS;GACjB,CAAC,EACU;;CAGd,MAAM,WAAW,IAAqC;AAiBpD,UADa,MAAM,KAAK,YAfV;;;;;;;;;;;;;;OAe0D,EAAE,IAAI,CAAC,EACnE;;CAGd,MAAM,+BAA+B,OASwB;AAkB3D,UAHa,MAAM,KAAK,YAdP;;;;;;;;;;;;;OAgBJ,EAAE,OAAO,CAAC,EACX;;CAGd,MAAM,cAAc,OAIyC;AAkB3D,UAHa,MAAM,KAAK,YAdP;;;;;;;;;;;;;OAgBJ,EAAE,OAAO,CAAC,EACX"}
|
package/dist/index.d.mts
CHANGED
|
@@ -62,8 +62,8 @@ declare const submitDsrSchema: z.ZodObject<{
|
|
|
62
62
|
}, z.core.$strip>;
|
|
63
63
|
type SubmitDsrInput = z.infer<typeof submitDsrSchema>;
|
|
64
64
|
//#endregion
|
|
65
|
-
//#region src/tools/
|
|
66
|
-
declare const
|
|
65
|
+
//#region src/tools/dsr_submit_on_behalf.d.ts
|
|
66
|
+
declare const submitDsrOnBehalfSchema: z.ZodObject<{
|
|
67
67
|
type: z.ZodEnum<{
|
|
68
68
|
Access: "ACCESS";
|
|
69
69
|
Erasure: "ERASURE";
|
|
@@ -91,7 +91,7 @@ declare const employeeSubmitDsrSchema: z.ZodObject<{
|
|
|
91
91
|
locale: z.ZodOptional<z.ZodString>;
|
|
92
92
|
isSilent: z.ZodOptional<z.ZodBoolean>;
|
|
93
93
|
}, z.core.$strip>;
|
|
94
|
-
type
|
|
94
|
+
type SubmitDsrOnBehalfInput = z.infer<typeof submitDsrOnBehalfSchema>;
|
|
95
95
|
//#endregion
|
|
96
96
|
//#region src/tools/dsr_cancel.d.ts
|
|
97
97
|
declare const cancelDsrSchema: z.ZodObject<{
|
|
@@ -155,5 +155,5 @@ declare const analyzeDsrSchema: z.ZodObject<{
|
|
|
155
155
|
}, z.core.$strip>;
|
|
156
156
|
type AnalyzeDsrInput = z.infer<typeof analyzeDsrSchema>;
|
|
157
157
|
//#endregion
|
|
158
|
-
export { type AnalyzeDsrInput, type CancelDsrInput, DSRMixin, type DownloadKeysInput, type
|
|
158
|
+
export { type AnalyzeDsrInput, type CancelDsrInput, DSRMixin, type DownloadKeysInput, type EnrichIdentifiersInput, type GetDetailsInput, type ListIdentifiersInput, type PollStatusInput, type RespondAccessInput, type RespondErasureInput, type SubmitDsrInput, type SubmitDsrOnBehalfInput, analyzeDsrSchema, cancelDsrSchema, downloadKeysSchema, enrichIdentifiersSchema, getDSRTools, getDetailsSchema, listIdentifiersSchema, pollStatusSchema, respondAccessSchema, respondErasureSchema, submitDsrOnBehalfSchema, submitDsrSchema };
|
|
159
159
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/tools/index.ts","../src/graphql.ts","../src/tools/dsr_submit.ts","../src/tools/
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/tools/index.ts","../src/graphql.ts","../src/tools/dsr_submit.ts","../src/tools/dsr_submit_on_behalf.ts","../src/tools/dsr_cancel.ts","../src/tools/dsr_download_keys.ts","../src/tools/dsr_get_details.ts","../src/tools/dsr_poll_status.ts","../src/tools/dsr_enrich_identifiers.ts","../src/tools/dsr_respond_access.ts","../src/tools/dsr_respond_erasure.ts","../src/tools/d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AAA,EAAuB,CAAA,CAAA,SAAA;;;;KAMxB,sBAAA,GAAyB,CAAA,CAAE,KAAA,QAAa,uBAAA;;;cCNvC,mBAAA,EAAmB,CAAA,CAAA,SAAA;;;;;KAQpB,kBAAA,GAAqB,CAAA,CAAE,KAAA,QAAa,mBAAA;;;cCRnC,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;;;KAQrB,mBAAA,GAAsB,CAAA,CAAE,KAAA,QAAa,oBAAA;;;cCFpC,qBAAA,EAAqB,CAAA,CAAA,SAAA;;;;;KAKtB,oBAAA,GAAuB,CAAA,CAAE,KAAA,QAAa,qBAAA;;;cCHrC,gBAAA,EAAgB,CAAA,CAAA,SAAA;;;KAQjB,eAAA,GAAkB,CAAA,CAAE,KAAA,QAAa,gBAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { DSRMixin, analyzeDsrSchema, cancelDsrSchema, downloadKeysSchema,
|
|
1
|
+
import { a as respondErasureSchema, c as listIdentifiersSchema, d as downloadKeysSchema, f as cancelDsrSchema, i as submitDsrSchema, l as getDetailsSchema, n as getDSRTools, o as respondAccessSchema, p as analyzeDsrSchema, r as submitDsrOnBehalfSchema, s as pollStatusSchema, t as DSRMixin, u as enrichIdentifiersSchema } from "./graphql-CSrIBjNn.mjs";
|
|
2
|
+
export { DSRMixin, analyzeDsrSchema, cancelDsrSchema, downloadKeysSchema, enrichIdentifiersSchema, getDSRTools, getDetailsSchema, listIdentifiersSchema, pollStatusSchema, respondAccessSchema, respondErasureSchema, submitDsrOnBehalfSchema, submitDsrSchema };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@transcend-io/mcp-server-dsr",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7",
|
|
4
4
|
"description": "Transcend MCP Server — DSR Automation tools.",
|
|
5
5
|
"homepage": "https://github.com/transcend-io/tools/tree/main/packages/mcp/mcp-server-dsr",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
34
34
|
"zod": "^4.3.6",
|
|
35
|
-
"@transcend-io/mcp-server-base": "0.4.
|
|
35
|
+
"@transcend-io/mcp-server-base": "0.4.2",
|
|
36
36
|
"@transcend-io/privacy-types": "5.1.6"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-CBzVUuzR.mjs","names":[],"sources":["../src/tools/dsr_analyze.ts","../src/tools/dsr_cancel.ts","../src/tools/dsr_download_keys.ts","../src/tools/dsr_employee_submit.ts","../src/tools/dsr_enrich_identifiers.ts","../src/tools/dsr_get_details.ts","../src/tools/dsr_list.ts","../src/tools/dsr_list_identifiers.ts","../src/tools/dsr_poll_status.ts","../src/tools/dsr_respond_access.ts","../src/tools/dsr_respond_erasure.ts","../src/tools/dsr_submit.ts","../src/tools/index.ts","../src/graphql.ts"],"sourcesContent":["import {\n createToolResult,\n defineTool,\n groupBy,\n type ToolClients,\n z,\n} from '@transcend-io/mcp-server-base';\n\nimport type { DSRMixin } from '../graphql.js';\n\nexport const analyzeDsrSchema = z.object({\n days: z.coerce\n .number()\n .optional()\n .describe(\n 'Filter analysis to requests within N days (default: 30). Only analyzes from the 100 most recent requests.',\n ),\n});\nexport type AnalyzeDsrInput = z.infer<typeof analyzeDsrSchema>;\n\nexport function createDsrAnalyzeTool(clients: ToolClients) {\n const graphql = clients.graphql as DSRMixin;\n\n return defineTool({\n name: 'dsr_analyze',\n description:\n 'Analyze DSR metrics from most recent 100 requests. Note: For complete analysis of all requests, use dsr_list with pagination to fetch all data first.',\n category: 'DSR Automation',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: analyzeDsrSchema,\n handler: async ({ days }) => {\n const result = await graphql.listRequests({ first: 100 });\n const requests = result.nodes;\n const periodDays = days ?? 30;\n const cutoffDate = new Date(Date.now() - periodDays * 24 * 60 * 60 * 1000);\n\n const recentRequests = requests.filter((r) => new Date(r.createdAt) > cutoffDate);\n const completedRequests = requests.filter((r) => r.status === 'COMPLETED');\n const pendingRequests = requests.filter((r) =>\n [\n 'REQUEST_MADE',\n 'ENRICHING',\n 'ON_HOLD',\n 'WAITING',\n 'COMPILING',\n 'APPROVING',\n 'DELAYED',\n 'SECONDARY',\n 'SECONDARY_APPROVING',\n ].includes(r.status),\n );\n\n return createToolResult(true, {\n summary: {\n analyzedRequests: requests.length,\n totalRequestsInSystem: result.totalCount,\n recentRequests: recentRequests.length,\n completedRequests: completedRequests.length,\n pendingRequests: pendingRequests.length,\n completionRate:\n requests.length > 0\n ? Math.round((completedRequests.length / requests.length) * 100)\n : 0,\n },\n breakdown: {\n byType: groupBy(requests, 'type'),\n byStatus: groupBy(requests, 'status'),\n recentByType: groupBy(recentRequests, 'type'),\n recentByStatus: groupBy(recentRequests, 'status'),\n },\n period: {\n days: periodDays,\n startDate: cutoffDate.toISOString(),\n endDate: new Date().toISOString(),\n },\n limitation:\n (result.totalCount || 0) > 100\n ? `This analysis is based on the 100 most recent requests out of ${result.totalCount} total. For complete analysis, use dsr_list with pagination to fetch all requests.`\n : undefined,\n });\n },\n });\n}\n","import { createToolResult, defineTool, type ToolClients, z } from '@transcend-io/mcp-server-base';\n\nimport type { DSRMixin } from '../graphql.js';\n\nexport const cancelDsrSchema = z.object({\n request_id: z.string().describe('ID of the DSR to cancel'),\n reason: z.string().optional().describe('Reason for cancellation (optional)'),\n});\nexport type CancelDsrInput = z.infer<typeof cancelDsrSchema>;\n\nexport function createDsrCancelTool(clients: ToolClients) {\n const graphql = clients.graphql as DSRMixin;\n\n return defineTool({\n name: 'dsr_cancel',\n description: 'Cancel a Data Subject Request',\n category: 'DSR Automation',\n readOnly: false,\n confirmationHint: 'Cancels the specified request permanently',\n annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },\n zodSchema: cancelDsrSchema,\n handler: async ({ request_id, reason }) => {\n const input: { requestId: string; template?: string; subject?: string } = {\n requestId: request_id,\n };\n if (reason) {\n input.subject = reason;\n }\n const result = await graphql.cancelRequest(input);\n return createToolResult(true, {\n request: result.request,\n message: 'DSR canceled successfully',\n });\n },\n });\n}\n","import { createToolResult, defineTool, type ToolClients, z } from '@transcend-io/mcp-server-base';\n\nexport const downloadKeysSchema = z.object({\n request_id: z.string().describe('ID of the completed DSR'),\n});\nexport type DownloadKeysInput = z.infer<typeof downloadKeysSchema>;\n\nexport function createDsrDownloadKeysTool(clients: ToolClients) {\n const { rest } = clients;\n\n return defineTool({\n name: 'dsr_download_keys',\n description:\n 'Get download keys for a completed Data Subject Request. These keys can be used to download the DSR results.',\n category: 'DSR Automation',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: downloadKeysSchema,\n handler: async ({ request_id }) => {\n const keys = await rest.getDSRDownloadKeys(request_id);\n return createToolResult(true, {\n downloadKeys: keys,\n count: keys.length,\n });\n },\n });\n}\n","import { createToolResult, defineTool, type ToolClients, z } from '@transcend-io/mcp-server-base';\nimport { RequestAction } from '@transcend-io/privacy-types';\n\nimport type { DSRMixin } from '../graphql.js';\n\nexport const employeeSubmitDsrSchema = z.object({\n type: z.nativeEnum(RequestAction).describe('Type of DSR request'),\n email: z.string().describe('Email address of the data subject'),\n subjectType: z\n .string()\n .describe('Type of data subject (e.g., customer, employee). Required by the Transcend API.'),\n coreIdentifier: z.string().optional().describe('Core identifier for the data subject (optional)'),\n locale: z.string().optional().describe('Locale for communications (e.g., en-US)'),\n isSilent: z.boolean().optional().describe('Whether to suppress email notifications'),\n});\nexport type EmployeeSubmitDsrInput = z.infer<typeof employeeSubmitDsrSchema>;\n\nexport function createDsrEmployeeSubmitTool(clients: ToolClients) {\n const graphql = clients.graphql as DSRMixin;\n\n return defineTool({\n name: 'dsr_employee_submit',\n description:\n 'Submit a Data Subject Request as an employee on behalf of a data subject. Requires subjectType to be specified.',\n category: 'DSR Automation',\n readOnly: false,\n confirmationHint: 'Creates a new data subject request (employee)',\n annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },\n zodSchema: employeeSubmitDsrSchema,\n handler: async ({ type, email, subjectType, coreIdentifier, locale, isSilent }) => {\n const result = await graphql.employeeMakeDataSubjectRequest({\n type,\n email,\n subjectType,\n coreIdentifier,\n locale,\n isSilent,\n });\n return createToolResult(true, {\n request: result.request,\n clientMutationId: result.clientMutationId,\n message: `Employee DSR of type ${type} submitted successfully`,\n });\n },\n });\n}\n","import { createToolResult, defineTool, type ToolClients, z } from '@transcend-io/mcp-server-base';\n\nexport const enrichIdentifiersSchema = z.object({\n request_id: z.string().describe('ID of the DSR to enrich'),\n identifiers: z\n .record(z.string(), z.string())\n .describe('Key-value pairs of identifier names and values to add'),\n});\nexport type EnrichIdentifiersInput = z.infer<typeof enrichIdentifiersSchema>;\n\nexport function createDsrEnrichIdentifiersTool(clients: ToolClients) {\n const { rest } = clients;\n\n return defineTool({\n name: 'dsr_enrich_identifiers',\n description:\n 'Enrich a Data Subject Request with additional identifiers during preflight processing',\n category: 'DSR Automation',\n readOnly: false,\n confirmationHint: 'Adds identifiers to the DSR during preflight',\n annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },\n zodSchema: enrichIdentifiersSchema,\n handler: async ({ request_id, identifiers }) => {\n const result = await rest.enrichIdentifiers({\n requestId: request_id,\n identifiers,\n });\n return createToolResult(true, {\n ...result,\n message: 'Identifiers enriched successfully',\n });\n },\n });\n}\n","import { createToolResult, defineTool, type ToolClients, z } from '@transcend-io/mcp-server-base';\n\nimport type { DSRMixin } from '../graphql.js';\n\nexport const getDetailsSchema = z.object({\n request_id: z.string().describe('ID of the DSR to retrieve'),\n});\nexport type GetDetailsInput = z.infer<typeof getDetailsSchema>;\n\nexport function createDsrGetDetailsTool(clients: ToolClients) {\n const graphql = clients.graphql as DSRMixin;\n\n return defineTool({\n name: 'dsr_get_details',\n description: 'Get detailed information about a specific Data Subject Request',\n category: 'DSR Automation',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: getDetailsSchema,\n handler: async ({ request_id }) => {\n const result = await graphql.getRequest(request_id);\n return createToolResult(true, result);\n },\n });\n}\n","import {\n createListResult,\n defineTool,\n PaginationSchema,\n type ToolClients,\n} from '@transcend-io/mcp-server-base';\n\nimport type { DSRMixin } from '../graphql.js';\n\nexport function createDsrListTool(clients: ToolClients) {\n const graphql = clients.graphql as DSRMixin;\n\n return defineTool({\n name: 'dsr_list',\n description:\n 'List all Data Subject Requests. Use cursor pagination to retrieve all results (max 100 per page). Note: Server-side date filtering is not available - filter results client-side if needed.',\n category: 'DSR Automation',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: PaginationSchema,\n handler: async ({ limit, cursor }) => {\n const result = await graphql.listRequests({\n first: limit,\n after: cursor,\n });\n\n return createListResult(result.nodes, {\n totalCount: result.totalCount,\n hasNextPage: result.pageInfo?.hasNextPage,\n cursor: result.pageInfo?.endCursor,\n paginationNote: result.pageInfo?.hasNextPage\n ? 'More results available. Pass the cursor value to fetch the next page.'\n : 'No more results.',\n });\n },\n });\n}\n","import {\n createListResult,\n defineTool,\n PaginationSchema,\n type ToolClients,\n z,\n} from '@transcend-io/mcp-server-base';\n\nexport const listIdentifiersSchema = z\n .object({\n request_id: z.string().describe('ID of the DSR'),\n })\n .merge(PaginationSchema);\nexport type ListIdentifiersInput = z.infer<typeof listIdentifiersSchema>;\n\nexport function createDsrListIdentifiersTool(clients: ToolClients) {\n const { rest } = clients;\n\n return defineTool({\n name: 'dsr_list_identifiers',\n description: 'List all identifiers attached to a Data Subject Request',\n category: 'DSR Automation',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: listIdentifiersSchema,\n handler: async ({ request_id }) => {\n const identifiers = await rest.listRequestIdentifiers(request_id);\n return createListResult(identifiers);\n },\n });\n}\n","import { createToolResult, defineTool, type ToolClients, z } from '@transcend-io/mcp-server-base';\n\nexport const pollStatusSchema = z.object({\n request_id: z.string().describe('ID of the DSR to check'),\n});\nexport type PollStatusInput = z.infer<typeof pollStatusSchema>;\n\nexport function createDsrPollStatusTool(clients: ToolClients) {\n const { rest } = clients;\n\n return defineTool({\n name: 'dsr_poll_status',\n description: 'Poll the current status of a Data Subject Request',\n category: 'DSR Automation',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: pollStatusSchema,\n handler: async ({ request_id }) => {\n const result = await rest.getDSRStatus(request_id);\n return createToolResult(true, result);\n },\n });\n}\n","import { createToolResult, defineTool, type ToolClients, z } from '@transcend-io/mcp-server-base';\n\nexport const respondAccessSchema = z.object({\n request_id: z.string().describe('ID of the DSR'),\n data_silo_id: z.string().describe('ID of the data silo responding'),\n profiles: z\n .array(z.record(z.string(), z.unknown()))\n .optional()\n .describe('Array of profile data objects to return'),\n});\nexport type RespondAccessInput = z.infer<typeof respondAccessSchema>;\n\nexport function createDsrRespondAccessTool(clients: ToolClients) {\n const { rest } = clients;\n\n return defineTool({\n name: 'dsr_respond_access',\n description: 'Respond to an ACCESS request by uploading user data',\n category: 'DSR Automation',\n readOnly: false,\n confirmationHint: 'Uploads access response data for the DSR',\n annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },\n zodSchema: respondAccessSchema,\n handler: async ({ request_id, data_silo_id, profiles }) => {\n const result = await rest.respondToAccess({\n requestId: request_id,\n dataSiloId: data_silo_id,\n profiles: profiles as Record<string, unknown>[] | undefined,\n });\n return createToolResult(true, {\n ...result,\n message: 'Access response submitted successfully',\n });\n },\n });\n}\n","import { createToolResult, defineTool, type ToolClients, z } from '@transcend-io/mcp-server-base';\n\nexport const respondErasureSchema = z.object({\n request_id: z.string().describe('ID of the DSR'),\n data_silo_id: z.string().describe('ID of the data silo that completed erasure'),\n profile_ids: z\n .array(z.string())\n .optional()\n .describe('IDs of profiles that were erased (optional)'),\n});\nexport type RespondErasureInput = z.infer<typeof respondErasureSchema>;\n\nexport function createDsrRespondErasureTool(clients: ToolClients) {\n const { rest } = clients;\n\n return defineTool({\n name: 'dsr_respond_erasure',\n description: 'Confirm that data erasure has been completed for a data silo',\n category: 'DSR Automation',\n readOnly: false,\n confirmationHint: 'Confirms erasure completion for the data silo',\n annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },\n zodSchema: respondErasureSchema,\n handler: async ({ request_id, data_silo_id, profile_ids }) => {\n const result = await rest.confirmErasure({\n requestId: request_id,\n dataSiloId: data_silo_id,\n profileIds: profile_ids,\n });\n return createToolResult(true, {\n ...result,\n message: 'Erasure confirmation submitted successfully',\n });\n },\n });\n}\n","import { createToolResult, defineTool, type ToolClients, z } from '@transcend-io/mcp-server-base';\nimport { RequestAction } from '@transcend-io/privacy-types';\n\nexport const submitDsrSchema = z.object({\n type: z.nativeEnum(RequestAction).describe('Type of DSR request'),\n email: z.string().describe('Email address of the data subject'),\n subjectType: z\n .string()\n .describe(\n 'Type of data subject (e.g., customer, employee, prospect). Required by the Transcend API.',\n ),\n coreIdentifier: z\n .string()\n .optional()\n .describe('Core identifier for the data subject (defaults to email if not provided)'),\n name: z.string().optional().describe('Name of the data subject (optional)'),\n locale: z.string().optional().describe('Locale for communications (e.g., en-US)'),\n isSilent: z.boolean().optional().describe('Whether to suppress email notifications'),\n});\nexport type SubmitDsrInput = z.infer<typeof submitDsrSchema>;\n\nexport function createDsrSubmitTool(clients: ToolClients) {\n const { rest } = clients;\n\n return defineTool({\n name: 'dsr_submit',\n description:\n 'Submit a new Data Subject Request (DSR). Supports ACCESS, ERASURE, RECTIFICATION, and other request types. The coreIdentifier defaults to the email if not provided.',\n category: 'DSR Automation',\n readOnly: false,\n confirmationHint: 'Creates a new data subject request',\n annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },\n zodSchema: submitDsrSchema,\n handler: async ({ type, email, subjectType, coreIdentifier, name, locale, isSilent }) => {\n const result = await rest.submitDSR({\n type,\n email,\n subjectType,\n coreIdentifier,\n name,\n locale,\n isSilent,\n });\n return createToolResult(true, {\n request: result,\n message: `DSR of type ${type} submitted successfully`,\n });\n },\n });\n}\n","import type { ToolDefinition, ToolClients } from '@transcend-io/mcp-server-base';\n\nimport { createDsrAnalyzeTool } from './dsr_analyze.js';\nimport { createDsrCancelTool } from './dsr_cancel.js';\nimport { createDsrDownloadKeysTool } from './dsr_download_keys.js';\nimport { createDsrEmployeeSubmitTool } from './dsr_employee_submit.js';\nimport { createDsrEnrichIdentifiersTool } from './dsr_enrich_identifiers.js';\nimport { createDsrGetDetailsTool } from './dsr_get_details.js';\nimport { createDsrListTool } from './dsr_list.js';\nimport { createDsrListIdentifiersTool } from './dsr_list_identifiers.js';\nimport { createDsrPollStatusTool } from './dsr_poll_status.js';\nimport { createDsrRespondAccessTool } from './dsr_respond_access.js';\nimport { createDsrRespondErasureTool } from './dsr_respond_erasure.js';\nimport { createDsrSubmitTool } from './dsr_submit.js';\n\nexport function getDSRTools(clients: ToolClients): ToolDefinition[] {\n return [\n createDsrSubmitTool(clients),\n createDsrPollStatusTool(clients),\n createDsrListTool(clients),\n createDsrGetDetailsTool(clients),\n createDsrDownloadKeysTool(clients),\n createDsrListIdentifiersTool(clients),\n createDsrEnrichIdentifiersTool(clients),\n createDsrRespondAccessTool(clients),\n createDsrRespondErasureTool(clients),\n createDsrCancelTool(clients),\n createDsrEmployeeSubmitTool(clients),\n createDsrAnalyzeTool(clients),\n ];\n}\n","import {\n TranscendGraphQLBase,\n type ListOptions,\n type PaginatedResponse,\n type Request,\n type RequestDetails,\n type RequestType,\n} from '@transcend-io/mcp-server-base';\n\nexport class DSRMixin extends TranscendGraphQLBase {\n async listRequests(options?: ListOptions): Promise<PaginatedResponse<Request>> {\n const query = `\n query ListRequests($first: Int, $after: String) {\n requests(first: $first, after: $after) {\n nodes {\n id\n type\n status\n createdAt\n updatedAt\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n totalCount\n }\n }\n `;\n const data = await this.makeRequest<{ requests: PaginatedResponse<Request> }>(query, {\n first: Math.min(options?.first || 50, 100),\n after: options?.after,\n });\n return data.requests;\n }\n\n async getRequest(id: string): Promise<RequestDetails> {\n const query = `\n query GetRequest($id: ID!) {\n request(id: $id) {\n id\n type\n status\n createdAt\n updatedAt\n daysRemaining\n link\n locale\n isSilent\n }\n }\n `;\n const data = await this.makeRequest<{ request: RequestDetails }>(query, { id });\n return data.request;\n }\n\n async employeeMakeDataSubjectRequest(input: {\n type: RequestType;\n email: string;\n coreIdentifier?: string;\n locale?: string;\n isSilent?: boolean;\n subjectType: string;\n attributes?: Record<string, unknown>;\n clientMutationId?: string;\n }): Promise<{ request: Request; clientMutationId?: string }> {\n const mutation = `\n mutation EmployeeMakeDataSubjectRequest($input: EmployeeRequestInput!) {\n employeeMakeDataSubjectRequest(input: $input) {\n clientMutationId\n request {\n id\n type\n status\n createdAt\n updatedAt\n }\n }\n }\n `;\n const data = await this.makeRequest<{\n employeeMakeDataSubjectRequest: { request: Request; clientMutationId?: string };\n }>(mutation, { input });\n return data.employeeMakeDataSubjectRequest;\n }\n\n async cancelRequest(input: {\n requestId: string;\n template?: string;\n subject?: string;\n }): Promise<{ request: Request; clientMutationId?: string }> {\n const mutation = `\n mutation CancelRequest($input: CommunicationInput!) {\n cancelRequest(input: $input) {\n clientMutationId\n request {\n id\n type\n status\n createdAt\n updatedAt\n }\n }\n }\n `;\n const data = await this.makeRequest<{\n cancelRequest: { request: Request; clientMutationId?: string };\n }>(mutation, { input });\n return data.cancelRequest;\n }\n}\n"],"mappings":";;;AAUA,MAAa,mBAAmB,EAAE,OAAO,EACvC,MAAM,EAAE,OACL,QAAQ,CACR,UAAU,CACV,SACC,4GACD,EACJ,CAAC;AAGF,SAAgB,qBAAqB,SAAsB;CACzD,MAAM,UAAU,QAAQ;AAExB,QAAO,WAAW;E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