@transcend-io/mcp-server-dsr 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +94 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +17 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/graphql-635nWRZj.mjs +484 -0
- package/dist/graphql-635nWRZj.mjs.map +1 -0
- package/dist/index.d.mts +159 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +2 -0
- package/package.json +56 -0
package/README.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# @transcend-io/mcp-server-dsr
|
|
2
|
+
|
|
3
|
+
> **Alpha** — this package is under active development and has not yet been published to npm. APIs may change without notice.
|
|
4
|
+
|
|
5
|
+
Transcend MCP Server for data subject requests (DSR). Provides tools for submitting, tracking, and responding to privacy requests such as access, erasure, and opt-out.
|
|
6
|
+
|
|
7
|
+
Requires **Node.js ≥ 22.12** (see `engines` in `package.json`).
|
|
8
|
+
|
|
9
|
+
For local runs from this repository, copy [`secret.env.example`](../../../secret.env.example) to **`secret.env`** at the repo root (gitignored) and set your API key (see **Run from the monorepo**).
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
When the package is available on npm, install the CLI globally:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install -g @transcend-io/mcp-server-dsr
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Until then, run from a checkout of this repository (see **Run from the monorepo** below).
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# With TRANSCEND_API_KEY in the environment; from the monorepo use secret.env (see Run from the monorepo)
|
|
25
|
+
TRANSCEND_API_KEY=your-api-key transcend-mcp-dsr
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The process speaks MCP over **stdio** and is meant to be launched by an MCP client (for example Cursor or Claude Desktop), not used as an interactive shell.
|
|
29
|
+
|
|
30
|
+
### MCP client configuration
|
|
31
|
+
|
|
32
|
+
`npx` runs the package’s `transcend-mcp-dsr` binary (see `bin` in `package.json`).
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"mcpServers": {
|
|
37
|
+
"transcend-dsr": {
|
|
38
|
+
"command": "npx",
|
|
39
|
+
"args": ["-y", "@transcend-io/mcp-server-dsr"],
|
|
40
|
+
"env": {
|
|
41
|
+
"TRANSCEND_API_KEY": "your-api-key"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
When developing in this repository, reuse the same variable names from root **`secret.env`** in the `env` block, or use your client’s env-file support if it has one.
|
|
49
|
+
|
|
50
|
+
### Run from the monorepo
|
|
51
|
+
|
|
52
|
+
1. **Credentials** — From the repository root, copy [`secret.env.example`](../../../secret.env.example) to **`secret.env`** and set `TRANSCEND_API_KEY` (and optional URL overrides).
|
|
53
|
+
|
|
54
|
+
2. **Build and run** — `node ./dist/cli.mjs` matches the `transcend-mcp-dsr` `bin` (use `node` because `pnpm exec transcend-mcp-dsr` may not resolve this package’s own binary in a pnpm workspace):
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# from the repository root
|
|
58
|
+
pnpm exec turbo run build --filter="@transcend-io/mcp-server-dsr..."
|
|
59
|
+
set -a && source ./secret.env && set +a
|
|
60
|
+
pnpm -F @transcend-io/mcp-server-dsr exec node ./dist/cli.mjs
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**Alternative:** `./scripts/mcp-run.sh ./packages/mcp/mcp-server-dsr/dist/cli.mjs` (sources `secret.env` when present; run after build).
|
|
64
|
+
|
|
65
|
+
See [CONTRIBUTING.md](../../../CONTRIBUTING.md#mcp-servers) for workspace layout and `pnpm --filter` workflows.
|
|
66
|
+
|
|
67
|
+
### Environment variables
|
|
68
|
+
|
|
69
|
+
| Variable | Required | Default | Description |
|
|
70
|
+
| ----------------------- | -------- | ------------------------------------------ | ----------------- |
|
|
71
|
+
| `TRANSCEND_API_KEY` | Yes | — | Transcend API key |
|
|
72
|
+
| `TRANSCEND_API_URL` | No | `https://multi-tenant.sombra.transcend.io` | Sombra API URL |
|
|
73
|
+
| `TRANSCEND_GRAPHQL_URL` | No | `https://api.transcend.io` | GraphQL API URL |
|
|
74
|
+
|
|
75
|
+
**Monorepo:** keep these in root **`secret.env`** (from [`secret.env.example`](../../../secret.env.example)); see **Run from the monorepo**.
|
|
76
|
+
|
|
77
|
+
## Tools
|
|
78
|
+
|
|
79
|
+
- `dsr_list` — List data subject requests
|
|
80
|
+
- `dsr_get_details` — Get request details
|
|
81
|
+
- `dsr_submit` — Submit a new DSR
|
|
82
|
+
- `dsr_employee_submit` — Submit an employee DSR
|
|
83
|
+
- `dsr_cancel` — Cancel a request
|
|
84
|
+
- `dsr_respond_access` — Respond to an access request
|
|
85
|
+
- `dsr_respond_erasure` — Respond to an erasure request
|
|
86
|
+
- `dsr_poll_status` — Poll request status
|
|
87
|
+
- `dsr_analyze` — Analyze DSR data
|
|
88
|
+
- `dsr_download_keys` — Download encryption keys
|
|
89
|
+
- `dsr_enrich_identifiers` — Enrich request identifiers
|
|
90
|
+
- `dsr_list_identifiers` — List identifier types
|
|
91
|
+
|
|
92
|
+
## Related packages
|
|
93
|
+
|
|
94
|
+
Also available as part of the unified [`@transcend-io/mcp-server`](../mcp-server/README.md) which includes all domains. See the [root README](../../../README.md#mcp-servers) for the full list.
|
package/dist/cli.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/cli.mjs
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { n as getDSRTools, t as DSRMixin } from "./graphql-635nWRZj.mjs";
|
|
3
|
+
import { TranscendRestClient, createMCPServer } from "@transcend-io/mcp-server-core";
|
|
4
|
+
//#region src/cli.ts
|
|
5
|
+
createMCPServer({
|
|
6
|
+
name: "transcend-mcp-dsr",
|
|
7
|
+
version: "1.0.0",
|
|
8
|
+
getTools: getDSRTools,
|
|
9
|
+
createClients: (auth, sombraUrl, graphqlUrl) => ({
|
|
10
|
+
rest: new TranscendRestClient(auth, sombraUrl),
|
|
11
|
+
graphql: new DSRMixin(auth, graphqlUrl)
|
|
12
|
+
})
|
|
13
|
+
});
|
|
14
|
+
//#endregion
|
|
15
|
+
export {};
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=cli.mjs.map
|
package/dist/cli.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.mjs","names":[],"sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { createMCPServer, TranscendRestClient } from '@transcend-io/mcp-server-core';\n\nimport { DSRMixin } from './graphql.js';\nimport { getDSRTools } from './tools/index.js';\n\ncreateMCPServer({\n name: 'transcend-mcp-dsr',\n version: '1.0.0',\n getTools: getDSRTools,\n createClients: (auth, sombraUrl, graphqlUrl) => ({\n rest: new TranscendRestClient(auth, sombraUrl),\n graphql: new DSRMixin(auth, graphqlUrl),\n }),\n});\n"],"mappings":";;;;AAMA,gBAAgB;CACd,MAAM;CACN,SAAS;CACT,UAAU;CACV,gBAAgB,MAAM,WAAW,gBAAgB;EAC/C,MAAM,IAAI,oBAAoB,MAAM,UAAU;EAC9C,SAAS,IAAI,SAAS,MAAM,WAAW;EACxC;CACF,CAAC"}
|
|
@@ -0,0 +1,484 @@
|
|
|
1
|
+
import { PaginationSchema, TranscendGraphQLBase, createListResult, createToolResult, defineTool, groupBy, z } from "@transcend-io/mcp-server-core";
|
|
2
|
+
import { RequestAction } from "@transcend-io/privacy-types";
|
|
3
|
+
//#region src/tools/dsr_analyze.ts
|
|
4
|
+
const analyzeDsrSchema = z.object({ days: z.coerce.number().optional().describe("Filter analysis to requests within N days (default: 30). Only analyzes from the 100 most recent requests.") });
|
|
5
|
+
function createDsrAnalyzeTool(clients) {
|
|
6
|
+
const graphql = clients.graphql;
|
|
7
|
+
return defineTool({
|
|
8
|
+
name: "dsr_analyze",
|
|
9
|
+
description: "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.",
|
|
10
|
+
category: "DSR Automation",
|
|
11
|
+
readOnly: true,
|
|
12
|
+
annotations: {
|
|
13
|
+
readOnlyHint: true,
|
|
14
|
+
destructiveHint: false,
|
|
15
|
+
idempotentHint: true
|
|
16
|
+
},
|
|
17
|
+
zodSchema: analyzeDsrSchema,
|
|
18
|
+
handler: async ({ days }) => {
|
|
19
|
+
const result = await graphql.listRequests({ first: 100 });
|
|
20
|
+
const requests = result.nodes;
|
|
21
|
+
const periodDays = days ?? 30;
|
|
22
|
+
const cutoffDate = /* @__PURE__ */ new Date(Date.now() - periodDays * 24 * 60 * 60 * 1e3);
|
|
23
|
+
const recentRequests = requests.filter((r) => new Date(r.createdAt) > cutoffDate);
|
|
24
|
+
const completedRequests = requests.filter((r) => r.status === "COMPLETED");
|
|
25
|
+
const pendingRequests = requests.filter((r) => [
|
|
26
|
+
"REQUEST_MADE",
|
|
27
|
+
"ENRICHING",
|
|
28
|
+
"ON_HOLD",
|
|
29
|
+
"WAITING",
|
|
30
|
+
"COMPILING",
|
|
31
|
+
"APPROVING",
|
|
32
|
+
"DELAYED",
|
|
33
|
+
"SECONDARY",
|
|
34
|
+
"SECONDARY_APPROVING"
|
|
35
|
+
].includes(r.status));
|
|
36
|
+
return createToolResult(true, {
|
|
37
|
+
summary: {
|
|
38
|
+
analyzedRequests: requests.length,
|
|
39
|
+
totalRequestsInSystem: result.totalCount,
|
|
40
|
+
recentRequests: recentRequests.length,
|
|
41
|
+
completedRequests: completedRequests.length,
|
|
42
|
+
pendingRequests: pendingRequests.length,
|
|
43
|
+
completionRate: requests.length > 0 ? Math.round(completedRequests.length / requests.length * 100) : 0
|
|
44
|
+
},
|
|
45
|
+
breakdown: {
|
|
46
|
+
byType: groupBy(requests, "type"),
|
|
47
|
+
byStatus: groupBy(requests, "status"),
|
|
48
|
+
recentByType: groupBy(recentRequests, "type"),
|
|
49
|
+
recentByStatus: groupBy(recentRequests, "status")
|
|
50
|
+
},
|
|
51
|
+
period: {
|
|
52
|
+
days: periodDays,
|
|
53
|
+
startDate: cutoffDate.toISOString(),
|
|
54
|
+
endDate: (/* @__PURE__ */ new Date()).toISOString()
|
|
55
|
+
},
|
|
56
|
+
limitation: (result.totalCount || 0) > 100 ? `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.` : void 0
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region src/tools/dsr_cancel.ts
|
|
63
|
+
const cancelDsrSchema = z.object({
|
|
64
|
+
request_id: z.string().describe("ID of the DSR to cancel"),
|
|
65
|
+
reason: z.string().optional().describe("Reason for cancellation (optional)")
|
|
66
|
+
});
|
|
67
|
+
function createDsrCancelTool(clients) {
|
|
68
|
+
const graphql = clients.graphql;
|
|
69
|
+
return defineTool({
|
|
70
|
+
name: "dsr_cancel",
|
|
71
|
+
description: "Cancel a Data Subject Request",
|
|
72
|
+
category: "DSR Automation",
|
|
73
|
+
readOnly: false,
|
|
74
|
+
confirmationHint: "Cancels the specified request permanently",
|
|
75
|
+
annotations: {
|
|
76
|
+
readOnlyHint: false,
|
|
77
|
+
destructiveHint: true,
|
|
78
|
+
idempotentHint: false
|
|
79
|
+
},
|
|
80
|
+
zodSchema: cancelDsrSchema,
|
|
81
|
+
handler: async ({ request_id, reason }) => {
|
|
82
|
+
const input = { requestId: request_id };
|
|
83
|
+
if (reason) input.subject = reason;
|
|
84
|
+
return createToolResult(true, {
|
|
85
|
+
request: (await graphql.cancelRequest(input)).request,
|
|
86
|
+
message: "DSR canceled successfully"
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region src/tools/dsr_download_keys.ts
|
|
93
|
+
const downloadKeysSchema = z.object({ request_id: z.string().describe("ID of the completed DSR") });
|
|
94
|
+
function createDsrDownloadKeysTool(clients) {
|
|
95
|
+
const { rest } = clients;
|
|
96
|
+
return defineTool({
|
|
97
|
+
name: "dsr_download_keys",
|
|
98
|
+
description: "Get download keys for a completed Data Subject Request. These keys can be used to download the DSR results.",
|
|
99
|
+
category: "DSR Automation",
|
|
100
|
+
readOnly: true,
|
|
101
|
+
annotations: {
|
|
102
|
+
readOnlyHint: true,
|
|
103
|
+
destructiveHint: false,
|
|
104
|
+
idempotentHint: true
|
|
105
|
+
},
|
|
106
|
+
zodSchema: downloadKeysSchema,
|
|
107
|
+
handler: async ({ request_id }) => {
|
|
108
|
+
const keys = await rest.getDSRDownloadKeys(request_id);
|
|
109
|
+
return createToolResult(true, {
|
|
110
|
+
downloadKeys: keys,
|
|
111
|
+
count: keys.length
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
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
|
+
//#region src/tools/dsr_enrich_identifiers.ts
|
|
159
|
+
const enrichIdentifiersSchema = z.object({
|
|
160
|
+
request_id: z.string().describe("ID of the DSR to enrich"),
|
|
161
|
+
identifiers: z.record(z.string(), z.string()).describe("Key-value pairs of identifier names and values to add")
|
|
162
|
+
});
|
|
163
|
+
function createDsrEnrichIdentifiersTool(clients) {
|
|
164
|
+
const { rest } = clients;
|
|
165
|
+
return defineTool({
|
|
166
|
+
name: "dsr_enrich_identifiers",
|
|
167
|
+
description: "Enrich a Data Subject Request with additional identifiers during preflight processing",
|
|
168
|
+
category: "DSR Automation",
|
|
169
|
+
readOnly: false,
|
|
170
|
+
confirmationHint: "Adds identifiers to the DSR during preflight",
|
|
171
|
+
annotations: {
|
|
172
|
+
readOnlyHint: false,
|
|
173
|
+
destructiveHint: false,
|
|
174
|
+
idempotentHint: false
|
|
175
|
+
},
|
|
176
|
+
zodSchema: enrichIdentifiersSchema,
|
|
177
|
+
handler: async ({ request_id, identifiers }) => {
|
|
178
|
+
return createToolResult(true, {
|
|
179
|
+
...await rest.enrichIdentifiers({
|
|
180
|
+
requestId: request_id,
|
|
181
|
+
identifiers
|
|
182
|
+
}),
|
|
183
|
+
message: "Identifiers enriched successfully"
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
//#endregion
|
|
189
|
+
//#region src/tools/dsr_get_details.ts
|
|
190
|
+
const getDetailsSchema = z.object({ request_id: z.string().describe("ID of the DSR to retrieve") });
|
|
191
|
+
function createDsrGetDetailsTool(clients) {
|
|
192
|
+
const graphql = clients.graphql;
|
|
193
|
+
return defineTool({
|
|
194
|
+
name: "dsr_get_details",
|
|
195
|
+
description: "Get detailed information about a specific Data Subject Request",
|
|
196
|
+
category: "DSR Automation",
|
|
197
|
+
readOnly: true,
|
|
198
|
+
annotations: {
|
|
199
|
+
readOnlyHint: true,
|
|
200
|
+
destructiveHint: false,
|
|
201
|
+
idempotentHint: true
|
|
202
|
+
},
|
|
203
|
+
zodSchema: getDetailsSchema,
|
|
204
|
+
handler: async ({ request_id }) => {
|
|
205
|
+
return createToolResult(true, await graphql.getRequest(request_id));
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
//#endregion
|
|
210
|
+
//#region src/tools/dsr_list.ts
|
|
211
|
+
function createDsrListTool(clients) {
|
|
212
|
+
const graphql = clients.graphql;
|
|
213
|
+
return defineTool({
|
|
214
|
+
name: "dsr_list",
|
|
215
|
+
description: "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.",
|
|
216
|
+
category: "DSR Automation",
|
|
217
|
+
readOnly: true,
|
|
218
|
+
annotations: {
|
|
219
|
+
readOnlyHint: true,
|
|
220
|
+
destructiveHint: false,
|
|
221
|
+
idempotentHint: true
|
|
222
|
+
},
|
|
223
|
+
zodSchema: PaginationSchema,
|
|
224
|
+
handler: async ({ limit, cursor }) => {
|
|
225
|
+
const result = await graphql.listRequests({
|
|
226
|
+
first: limit,
|
|
227
|
+
after: cursor
|
|
228
|
+
});
|
|
229
|
+
return createListResult(result.nodes, {
|
|
230
|
+
totalCount: result.totalCount,
|
|
231
|
+
hasNextPage: result.pageInfo?.hasNextPage,
|
|
232
|
+
cursor: result.pageInfo?.endCursor,
|
|
233
|
+
paginationNote: result.pageInfo?.hasNextPage ? "More results available. Pass the cursor value to fetch the next page." : "No more results."
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
//#endregion
|
|
239
|
+
//#region src/tools/dsr_list_identifiers.ts
|
|
240
|
+
const listIdentifiersSchema = z.object({ request_id: z.string().describe("ID of the DSR") }).merge(PaginationSchema);
|
|
241
|
+
function createDsrListIdentifiersTool(clients) {
|
|
242
|
+
const { rest } = clients;
|
|
243
|
+
return defineTool({
|
|
244
|
+
name: "dsr_list_identifiers",
|
|
245
|
+
description: "List all identifiers attached to a Data Subject Request",
|
|
246
|
+
category: "DSR Automation",
|
|
247
|
+
readOnly: true,
|
|
248
|
+
annotations: {
|
|
249
|
+
readOnlyHint: true,
|
|
250
|
+
destructiveHint: false,
|
|
251
|
+
idempotentHint: true
|
|
252
|
+
},
|
|
253
|
+
zodSchema: listIdentifiersSchema,
|
|
254
|
+
handler: async ({ request_id }) => {
|
|
255
|
+
return createListResult(await rest.listRequestIdentifiers(request_id));
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
//#endregion
|
|
260
|
+
//#region src/tools/dsr_poll_status.ts
|
|
261
|
+
const pollStatusSchema = z.object({ request_id: z.string().describe("ID of the DSR to check") });
|
|
262
|
+
function createDsrPollStatusTool(clients) {
|
|
263
|
+
const { rest } = clients;
|
|
264
|
+
return defineTool({
|
|
265
|
+
name: "dsr_poll_status",
|
|
266
|
+
description: "Poll the current status of a Data Subject Request",
|
|
267
|
+
category: "DSR Automation",
|
|
268
|
+
readOnly: true,
|
|
269
|
+
annotations: {
|
|
270
|
+
readOnlyHint: true,
|
|
271
|
+
destructiveHint: false,
|
|
272
|
+
idempotentHint: true
|
|
273
|
+
},
|
|
274
|
+
zodSchema: pollStatusSchema,
|
|
275
|
+
handler: async ({ request_id }) => {
|
|
276
|
+
return createToolResult(true, await rest.getDSRStatus(request_id));
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
//#endregion
|
|
281
|
+
//#region src/tools/dsr_respond_access.ts
|
|
282
|
+
const respondAccessSchema = z.object({
|
|
283
|
+
request_id: z.string().describe("ID of the DSR"),
|
|
284
|
+
data_silo_id: z.string().describe("ID of the data silo responding"),
|
|
285
|
+
profiles: z.array(z.record(z.string(), z.unknown())).optional().describe("Array of profile data objects to return")
|
|
286
|
+
});
|
|
287
|
+
function createDsrRespondAccessTool(clients) {
|
|
288
|
+
const { rest } = clients;
|
|
289
|
+
return defineTool({
|
|
290
|
+
name: "dsr_respond_access",
|
|
291
|
+
description: "Respond to an ACCESS request by uploading user data",
|
|
292
|
+
category: "DSR Automation",
|
|
293
|
+
readOnly: false,
|
|
294
|
+
confirmationHint: "Uploads access response data for the DSR",
|
|
295
|
+
annotations: {
|
|
296
|
+
readOnlyHint: false,
|
|
297
|
+
destructiveHint: false,
|
|
298
|
+
idempotentHint: false
|
|
299
|
+
},
|
|
300
|
+
zodSchema: respondAccessSchema,
|
|
301
|
+
handler: async ({ request_id, data_silo_id, profiles }) => {
|
|
302
|
+
return createToolResult(true, {
|
|
303
|
+
...await rest.respondToAccess({
|
|
304
|
+
requestId: request_id,
|
|
305
|
+
dataSiloId: data_silo_id,
|
|
306
|
+
profiles
|
|
307
|
+
}),
|
|
308
|
+
message: "Access response submitted successfully"
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
//#endregion
|
|
314
|
+
//#region src/tools/dsr_respond_erasure.ts
|
|
315
|
+
const respondErasureSchema = z.object({
|
|
316
|
+
request_id: z.string().describe("ID of the DSR"),
|
|
317
|
+
data_silo_id: z.string().describe("ID of the data silo that completed erasure"),
|
|
318
|
+
profile_ids: z.array(z.string()).optional().describe("IDs of profiles that were erased (optional)")
|
|
319
|
+
});
|
|
320
|
+
function createDsrRespondErasureTool(clients) {
|
|
321
|
+
const { rest } = clients;
|
|
322
|
+
return defineTool({
|
|
323
|
+
name: "dsr_respond_erasure",
|
|
324
|
+
description: "Confirm that data erasure has been completed for a data silo",
|
|
325
|
+
category: "DSR Automation",
|
|
326
|
+
readOnly: false,
|
|
327
|
+
confirmationHint: "Confirms erasure completion for the data silo",
|
|
328
|
+
annotations: {
|
|
329
|
+
readOnlyHint: false,
|
|
330
|
+
destructiveHint: false,
|
|
331
|
+
idempotentHint: true
|
|
332
|
+
},
|
|
333
|
+
zodSchema: respondErasureSchema,
|
|
334
|
+
handler: async ({ request_id, data_silo_id, profile_ids }) => {
|
|
335
|
+
return createToolResult(true, {
|
|
336
|
+
...await rest.confirmErasure({
|
|
337
|
+
requestId: request_id,
|
|
338
|
+
dataSiloId: data_silo_id,
|
|
339
|
+
profileIds: profile_ids
|
|
340
|
+
}),
|
|
341
|
+
message: "Erasure confirmation submitted successfully"
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
//#endregion
|
|
347
|
+
//#region src/tools/dsr_submit.ts
|
|
348
|
+
const submitDsrSchema = 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, prospect). Required by the Transcend API."),
|
|
352
|
+
coreIdentifier: z.string().optional().describe("Core identifier for the data subject (defaults to email if not provided)"),
|
|
353
|
+
name: z.string().optional().describe("Name of the data subject (optional)"),
|
|
354
|
+
locale: z.string().optional().describe("Locale for communications (e.g., en-US)"),
|
|
355
|
+
isSilent: z.boolean().optional().describe("Whether to suppress email notifications")
|
|
356
|
+
});
|
|
357
|
+
function createDsrSubmitTool(clients) {
|
|
358
|
+
const { rest } = clients;
|
|
359
|
+
return defineTool({
|
|
360
|
+
name: "dsr_submit",
|
|
361
|
+
description: "Submit a new Data Subject Request (DSR). Supports ACCESS, ERASURE, RECTIFICATION, and other request types. The coreIdentifier defaults to the email if not provided.",
|
|
362
|
+
category: "DSR Automation",
|
|
363
|
+
readOnly: false,
|
|
364
|
+
confirmationHint: "Creates a new data subject request",
|
|
365
|
+
annotations: {
|
|
366
|
+
readOnlyHint: false,
|
|
367
|
+
destructiveHint: false,
|
|
368
|
+
idempotentHint: false
|
|
369
|
+
},
|
|
370
|
+
zodSchema: submitDsrSchema,
|
|
371
|
+
handler: async ({ type, email, subjectType, coreIdentifier, name, locale, isSilent }) => {
|
|
372
|
+
return createToolResult(true, {
|
|
373
|
+
request: await rest.submitDSR({
|
|
374
|
+
type,
|
|
375
|
+
email,
|
|
376
|
+
subjectType,
|
|
377
|
+
coreIdentifier,
|
|
378
|
+
name,
|
|
379
|
+
locale,
|
|
380
|
+
isSilent
|
|
381
|
+
}),
|
|
382
|
+
message: `DSR of type ${type} submitted successfully`
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
//#endregion
|
|
388
|
+
//#region src/tools/index.ts
|
|
389
|
+
function getDSRTools(clients) {
|
|
390
|
+
return [
|
|
391
|
+
createDsrSubmitTool(clients),
|
|
392
|
+
createDsrPollStatusTool(clients),
|
|
393
|
+
createDsrListTool(clients),
|
|
394
|
+
createDsrGetDetailsTool(clients),
|
|
395
|
+
createDsrDownloadKeysTool(clients),
|
|
396
|
+
createDsrListIdentifiersTool(clients),
|
|
397
|
+
createDsrEnrichIdentifiersTool(clients),
|
|
398
|
+
createDsrRespondAccessTool(clients),
|
|
399
|
+
createDsrRespondErasureTool(clients),
|
|
400
|
+
createDsrCancelTool(clients),
|
|
401
|
+
createDsrEmployeeSubmitTool(clients),
|
|
402
|
+
createDsrAnalyzeTool(clients)
|
|
403
|
+
];
|
|
404
|
+
}
|
|
405
|
+
//#endregion
|
|
406
|
+
//#region src/graphql.ts
|
|
407
|
+
var DSRMixin = class extends TranscendGraphQLBase {
|
|
408
|
+
async listRequests(options) {
|
|
409
|
+
return (await this.makeRequest(`
|
|
410
|
+
query ListRequests($first: Int, $after: String) {
|
|
411
|
+
requests(first: $first, after: $after) {
|
|
412
|
+
nodes {
|
|
413
|
+
id
|
|
414
|
+
type
|
|
415
|
+
status
|
|
416
|
+
createdAt
|
|
417
|
+
updatedAt
|
|
418
|
+
}
|
|
419
|
+
pageInfo {
|
|
420
|
+
hasNextPage
|
|
421
|
+
endCursor
|
|
422
|
+
}
|
|
423
|
+
totalCount
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
`, {
|
|
427
|
+
first: Math.min(options?.first || 50, 100),
|
|
428
|
+
after: options?.after
|
|
429
|
+
})).requests;
|
|
430
|
+
}
|
|
431
|
+
async getRequest(id) {
|
|
432
|
+
return (await this.makeRequest(`
|
|
433
|
+
query GetRequest($id: ID!) {
|
|
434
|
+
request(id: $id) {
|
|
435
|
+
id
|
|
436
|
+
type
|
|
437
|
+
status
|
|
438
|
+
createdAt
|
|
439
|
+
updatedAt
|
|
440
|
+
daysRemaining
|
|
441
|
+
link
|
|
442
|
+
locale
|
|
443
|
+
isSilent
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
`, { id })).request;
|
|
447
|
+
}
|
|
448
|
+
async employeeMakeDataSubjectRequest(input) {
|
|
449
|
+
return (await this.makeRequest(`
|
|
450
|
+
mutation EmployeeMakeDataSubjectRequest($input: EmployeeRequestInput!) {
|
|
451
|
+
employeeMakeDataSubjectRequest(input: $input) {
|
|
452
|
+
clientMutationId
|
|
453
|
+
request {
|
|
454
|
+
id
|
|
455
|
+
type
|
|
456
|
+
status
|
|
457
|
+
createdAt
|
|
458
|
+
updatedAt
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
`, { input })).employeeMakeDataSubjectRequest;
|
|
463
|
+
}
|
|
464
|
+
async cancelRequest(input) {
|
|
465
|
+
return (await this.makeRequest(`
|
|
466
|
+
mutation CancelRequest($input: CommunicationInput!) {
|
|
467
|
+
cancelRequest(input: $input) {
|
|
468
|
+
clientMutationId
|
|
469
|
+
request {
|
|
470
|
+
id
|
|
471
|
+
type
|
|
472
|
+
status
|
|
473
|
+
createdAt
|
|
474
|
+
updatedAt
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
`, { input })).cancelRequest;
|
|
479
|
+
}
|
|
480
|
+
};
|
|
481
|
+
//#endregion
|
|
482
|
+
export { respondAccessSchema as a, getDetailsSchema as c, downloadKeysSchema as d, cancelDsrSchema as f, respondErasureSchema as i, enrichIdentifiersSchema as l, getDSRTools as n, pollStatusSchema as o, analyzeDsrSchema as p, submitDsrSchema as r, listIdentifiersSchema as s, DSRMixin as t, employeeSubmitDsrSchema as u };
|
|
483
|
+
|
|
484
|
+
//# sourceMappingURL=graphql-635nWRZj.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql-635nWRZj.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-core';\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-core';\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-core';\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-core';\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-core';\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-core';\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-core';\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-core';\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-core';\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-core';\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-core';\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-core';\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-core';\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-core';\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;EAChB,MAAM;EACN,aACE;EACF,UAAU;EACV,UAAU;EACV,aAAa;GAAE,cAAc;GAAM,iBAAiB;GAAO,gBAAgB;GAAM;EACjF,WAAW;EACX,SAAS,OAAO,EAAE,WAAW;GAC3B,MAAM,SAAS,MAAM,QAAQ,aAAa,EAAE,OAAO,KAAK,CAAC;GACzD,MAAM,WAAW,OAAO;GACxB,MAAM,aAAa,QAAQ;GAC3B,MAAM,6BAAa,IAAI,KAAK,KAAK,KAAK,GAAG,aAAa,KAAK,KAAK,KAAK,IAAK;GAE1E,MAAM,iBAAiB,SAAS,QAAQ,MAAM,IAAI,KAAK,EAAE,UAAU,GAAG,WAAW;GACjF,MAAM,oBAAoB,SAAS,QAAQ,MAAM,EAAE,WAAW,YAAY;GAC1E,MAAM,kBAAkB,SAAS,QAAQ,MACvC;IACE;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACD,CAAC,SAAS,EAAE,OAAO,CACrB;AAED,UAAO,iBAAiB,MAAM;IAC5B,SAAS;KACP,kBAAkB,SAAS;KAC3B,uBAAuB,OAAO;KAC9B,gBAAgB,eAAe;KAC/B,mBAAmB,kBAAkB;KACrC,iBAAiB,gBAAgB;KACjC,gBACE,SAAS,SAAS,IACd,KAAK,MAAO,kBAAkB,SAAS,SAAS,SAAU,IAAI,GAC9D;KACP;IACD,WAAW;KACT,QAAQ,QAAQ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AAW;EACX,SAAS,OAAO,EAAE,MAAM,OAAO,aAAa,gBAAgB,MAAM,QAAQ,eAAe;AAUvF,UAAO,iBAAiB,MAAM;IAC5B,SAVa,MAAM,KAAK,UAAU;KAClC;KACA;KACA;KACA;KACA;KACA;KACA;KACD,CAAC;IAGA,SAAS,eAAe,KAAK;IAC9B,CAAC;;EAEL,CAAC;;;;ACjCJ,SAAgB,YAAY,SAAwC;AAClE,QAAO;EACL,oBAAoB,QAAQ;EAC5B,wBAAwB,QAAQ;EAChC,kBAAkB,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
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { ListOptions, PaginatedResponse, Request, RequestDetails, RequestType, ToolClients, ToolDefinition, TranscendGraphQLBase, z } from "@transcend-io/mcp-server-core";
|
|
2
|
+
|
|
3
|
+
//#region src/tools/index.d.ts
|
|
4
|
+
declare function getDSRTools(clients: ToolClients): ToolDefinition[];
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region src/graphql.d.ts
|
|
7
|
+
declare class DSRMixin extends TranscendGraphQLBase {
|
|
8
|
+
listRequests(options?: ListOptions): Promise<PaginatedResponse<Request>>;
|
|
9
|
+
getRequest(id: string): Promise<RequestDetails>;
|
|
10
|
+
employeeMakeDataSubjectRequest(input: {
|
|
11
|
+
type: RequestType;
|
|
12
|
+
email: string;
|
|
13
|
+
coreIdentifier?: string;
|
|
14
|
+
locale?: string;
|
|
15
|
+
isSilent?: boolean;
|
|
16
|
+
subjectType: string;
|
|
17
|
+
attributes?: Record<string, unknown>;
|
|
18
|
+
clientMutationId?: string;
|
|
19
|
+
}): Promise<{
|
|
20
|
+
request: Request;
|
|
21
|
+
clientMutationId?: string;
|
|
22
|
+
}>;
|
|
23
|
+
cancelRequest(input: {
|
|
24
|
+
requestId: string;
|
|
25
|
+
template?: string;
|
|
26
|
+
subject?: string;
|
|
27
|
+
}): Promise<{
|
|
28
|
+
request: Request;
|
|
29
|
+
clientMutationId?: string;
|
|
30
|
+
}>;
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/tools/dsr_submit.d.ts
|
|
34
|
+
declare const submitDsrSchema: z.ZodObject<{
|
|
35
|
+
type: z.ZodEnum<{
|
|
36
|
+
Access: "ACCESS";
|
|
37
|
+
Erasure: "ERASURE";
|
|
38
|
+
Rectification: "RECTIFICATION";
|
|
39
|
+
Restriction: "RESTRICTION";
|
|
40
|
+
BusinessPurpose: "BUSINESS_PURPOSE";
|
|
41
|
+
PlaceOnLegalHold: "PLACE_ON_LEGAL_HOLD";
|
|
42
|
+
RemoveFromLegalHold: "REMOVE_FROM_LEGAL_HOLD";
|
|
43
|
+
AutomatedDecisionMakingOptIn: "AUTOMATED_DECISION_MAKING_OPT_IN";
|
|
44
|
+
UseOfSensitiveInformationOptIn: "USE_OF_SENSITIVE_INFORMATION_OPT_IN";
|
|
45
|
+
SaleOptIn: "SALE_OPT_IN";
|
|
46
|
+
TrackingOptIn: "TRACKING_OPT_IN";
|
|
47
|
+
ContactOptIn: "CONTACT_OPT_IN";
|
|
48
|
+
CustomOptIn: "CUSTOM_OPT_IN";
|
|
49
|
+
AutomatedDecisionMakingOptOut: "AUTOMATED_DECISION_MAKING_OPT_OUT";
|
|
50
|
+
UseOfSensitiveInformationOptOut: "USE_OF_SENSITIVE_INFORMATION_OPT_OUT";
|
|
51
|
+
ContactOptOut: "CONTACT_OPT_OUT";
|
|
52
|
+
SaleOptOut: "SALE_OPT_OUT";
|
|
53
|
+
TrackingOptOut: "TRACKING_OPT_OUT";
|
|
54
|
+
CustomOptOut: "CUSTOM_OPT_OUT";
|
|
55
|
+
}>;
|
|
56
|
+
email: z.ZodString;
|
|
57
|
+
subjectType: z.ZodString;
|
|
58
|
+
coreIdentifier: z.ZodOptional<z.ZodString>;
|
|
59
|
+
name: z.ZodOptional<z.ZodString>;
|
|
60
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
61
|
+
isSilent: z.ZodOptional<z.ZodBoolean>;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
type SubmitDsrInput = z.infer<typeof submitDsrSchema>;
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region src/tools/dsr_employee_submit.d.ts
|
|
66
|
+
declare const employeeSubmitDsrSchema: z.ZodObject<{
|
|
67
|
+
type: z.ZodEnum<{
|
|
68
|
+
Access: "ACCESS";
|
|
69
|
+
Erasure: "ERASURE";
|
|
70
|
+
Rectification: "RECTIFICATION";
|
|
71
|
+
Restriction: "RESTRICTION";
|
|
72
|
+
BusinessPurpose: "BUSINESS_PURPOSE";
|
|
73
|
+
PlaceOnLegalHold: "PLACE_ON_LEGAL_HOLD";
|
|
74
|
+
RemoveFromLegalHold: "REMOVE_FROM_LEGAL_HOLD";
|
|
75
|
+
AutomatedDecisionMakingOptIn: "AUTOMATED_DECISION_MAKING_OPT_IN";
|
|
76
|
+
UseOfSensitiveInformationOptIn: "USE_OF_SENSITIVE_INFORMATION_OPT_IN";
|
|
77
|
+
SaleOptIn: "SALE_OPT_IN";
|
|
78
|
+
TrackingOptIn: "TRACKING_OPT_IN";
|
|
79
|
+
ContactOptIn: "CONTACT_OPT_IN";
|
|
80
|
+
CustomOptIn: "CUSTOM_OPT_IN";
|
|
81
|
+
AutomatedDecisionMakingOptOut: "AUTOMATED_DECISION_MAKING_OPT_OUT";
|
|
82
|
+
UseOfSensitiveInformationOptOut: "USE_OF_SENSITIVE_INFORMATION_OPT_OUT";
|
|
83
|
+
ContactOptOut: "CONTACT_OPT_OUT";
|
|
84
|
+
SaleOptOut: "SALE_OPT_OUT";
|
|
85
|
+
TrackingOptOut: "TRACKING_OPT_OUT";
|
|
86
|
+
CustomOptOut: "CUSTOM_OPT_OUT";
|
|
87
|
+
}>;
|
|
88
|
+
email: z.ZodString;
|
|
89
|
+
subjectType: z.ZodString;
|
|
90
|
+
coreIdentifier: z.ZodOptional<z.ZodString>;
|
|
91
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
92
|
+
isSilent: z.ZodOptional<z.ZodBoolean>;
|
|
93
|
+
}, z.core.$strip>;
|
|
94
|
+
type EmployeeSubmitDsrInput = z.infer<typeof employeeSubmitDsrSchema>;
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/tools/dsr_cancel.d.ts
|
|
97
|
+
declare const cancelDsrSchema: z.ZodObject<{
|
|
98
|
+
request_id: z.ZodString;
|
|
99
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
100
|
+
}, z.core.$strip>;
|
|
101
|
+
type CancelDsrInput = z.infer<typeof cancelDsrSchema>;
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region src/tools/dsr_download_keys.d.ts
|
|
104
|
+
declare const downloadKeysSchema: z.ZodObject<{
|
|
105
|
+
request_id: z.ZodString;
|
|
106
|
+
}, z.core.$strip>;
|
|
107
|
+
type DownloadKeysInput = z.infer<typeof downloadKeysSchema>;
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region src/tools/dsr_get_details.d.ts
|
|
110
|
+
declare const getDetailsSchema: z.ZodObject<{
|
|
111
|
+
request_id: z.ZodString;
|
|
112
|
+
}, z.core.$strip>;
|
|
113
|
+
type GetDetailsInput = z.infer<typeof getDetailsSchema>;
|
|
114
|
+
//#endregion
|
|
115
|
+
//#region src/tools/dsr_poll_status.d.ts
|
|
116
|
+
declare const pollStatusSchema: z.ZodObject<{
|
|
117
|
+
request_id: z.ZodString;
|
|
118
|
+
}, z.core.$strip>;
|
|
119
|
+
type PollStatusInput = z.infer<typeof pollStatusSchema>;
|
|
120
|
+
//#endregion
|
|
121
|
+
//#region src/tools/dsr_enrich_identifiers.d.ts
|
|
122
|
+
declare const enrichIdentifiersSchema: z.ZodObject<{
|
|
123
|
+
request_id: z.ZodString;
|
|
124
|
+
identifiers: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
125
|
+
}, z.core.$strip>;
|
|
126
|
+
type EnrichIdentifiersInput = z.infer<typeof enrichIdentifiersSchema>;
|
|
127
|
+
//#endregion
|
|
128
|
+
//#region src/tools/dsr_respond_access.d.ts
|
|
129
|
+
declare const respondAccessSchema: z.ZodObject<{
|
|
130
|
+
request_id: z.ZodString;
|
|
131
|
+
data_silo_id: z.ZodString;
|
|
132
|
+
profiles: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
133
|
+
}, z.core.$strip>;
|
|
134
|
+
type RespondAccessInput = z.infer<typeof respondAccessSchema>;
|
|
135
|
+
//#endregion
|
|
136
|
+
//#region src/tools/dsr_respond_erasure.d.ts
|
|
137
|
+
declare const respondErasureSchema: z.ZodObject<{
|
|
138
|
+
request_id: z.ZodString;
|
|
139
|
+
data_silo_id: z.ZodString;
|
|
140
|
+
profile_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
141
|
+
}, z.core.$strip>;
|
|
142
|
+
type RespondErasureInput = z.infer<typeof respondErasureSchema>;
|
|
143
|
+
//#endregion
|
|
144
|
+
//#region src/tools/dsr_list_identifiers.d.ts
|
|
145
|
+
declare const listIdentifiersSchema: z.ZodObject<{
|
|
146
|
+
request_id: z.ZodString;
|
|
147
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
148
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
149
|
+
}, z.core.$strip>;
|
|
150
|
+
type ListIdentifiersInput = z.infer<typeof listIdentifiersSchema>;
|
|
151
|
+
//#endregion
|
|
152
|
+
//#region src/tools/dsr_analyze.d.ts
|
|
153
|
+
declare const analyzeDsrSchema: z.ZodObject<{
|
|
154
|
+
days: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
155
|
+
}, z.core.$strip>;
|
|
156
|
+
type AnalyzeDsrInput = z.infer<typeof analyzeDsrSchema>;
|
|
157
|
+
//#endregion
|
|
158
|
+
export { type AnalyzeDsrInput, type CancelDsrInput, DSRMixin, type DownloadKeysInput, type EmployeeSubmitDsrInput, type EnrichIdentifiersInput, type GetDetailsInput, type ListIdentifiersInput, type PollStatusInput, type RespondAccessInput, type RespondErasureInput, type SubmitDsrInput, analyzeDsrSchema, cancelDsrSchema, downloadKeysSchema, employeeSubmitDsrSchema, enrichIdentifiersSchema, getDSRTools, getDetailsSchema, listIdentifiersSchema, pollStatusSchema, respondAccessSchema, respondErasureSchema, submitDsrSchema };
|
|
159
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/tools/index.ts","../src/graphql.ts","../src/tools/dsr_submit.ts","../src/tools/dsr_employee_submit.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.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;cCHhC,uBAAA,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
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as respondAccessSchema, c as getDetailsSchema, d as downloadKeysSchema, f as cancelDsrSchema, i as respondErasureSchema, l as enrichIdentifiersSchema, n as getDSRTools, o as pollStatusSchema, p as analyzeDsrSchema, r as submitDsrSchema, s as listIdentifiersSchema, t as DSRMixin, u as employeeSubmitDsrSchema } from "./graphql-635nWRZj.mjs";
|
|
2
|
+
export { DSRMixin, analyzeDsrSchema, cancelDsrSchema, downloadKeysSchema, employeeSubmitDsrSchema, enrichIdentifiersSchema, getDSRTools, getDetailsSchema, listIdentifiersSchema, pollStatusSchema, respondAccessSchema, respondErasureSchema, submitDsrSchema };
|
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@transcend-io/mcp-server-dsr",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Transcend MCP Server — DSR Automation tools.",
|
|
5
|
+
"homepage": "https://github.com/transcend-io/tools/tree/main/packages/mcp/mcp-server-dsr",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"author": "Transcend Inc.",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/transcend-io/tools.git",
|
|
11
|
+
"directory": "packages/mcp/mcp-server-dsr"
|
|
12
|
+
},
|
|
13
|
+
"bin": {
|
|
14
|
+
"transcend-mcp-dsr": "./dist/cli.mjs"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"type": "module",
|
|
20
|
+
"sideEffects": false,
|
|
21
|
+
"types": "./dist/index.d.mts",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"@transcend-io/source": "./src/index.ts",
|
|
25
|
+
"types": "./dist/index.d.mts",
|
|
26
|
+
"default": "./dist/index.mjs"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsdown",
|
|
34
|
+
"test": "vitest run",
|
|
35
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
36
|
+
"check:exports": "attw --pack . --ignore-rules cjs-resolves-to-esm",
|
|
37
|
+
"check:publint": "publint --level warning --strict --pack pnpm"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@modelcontextprotocol/sdk": "catalog:",
|
|
41
|
+
"@transcend-io/mcp-server-core": "workspace:*",
|
|
42
|
+
"@transcend-io/privacy-types": "workspace:*",
|
|
43
|
+
"zod": "catalog:"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@arethetypeswrong/cli": "catalog:",
|
|
47
|
+
"@types/node": "catalog:",
|
|
48
|
+
"publint": "catalog:",
|
|
49
|
+
"tsdown": "catalog:",
|
|
50
|
+
"typescript": "catalog:",
|
|
51
|
+
"vitest": "catalog:"
|
|
52
|
+
},
|
|
53
|
+
"engines": {
|
|
54
|
+
"node": ">=22.12.0"
|
|
55
|
+
}
|
|
56
|
+
}
|