@mybe/contensa-mcp 1.0.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 +765 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +35 -0
- package/dist/cli.js.map +1 -0
- package/dist/client.d.ts +150 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +480 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +9 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +173 -0
- package/dist/server.js.map +1 -0
- package/dist/tools.d.ts +409 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +626 -0
- package/dist/tools.js.map +1 -0
- package/dist/types.d.ts +136 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +39 -0
package/dist/server.js
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
// MCP Server for Contensa CMS
|
|
2
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
3
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
5
|
+
import { ContensaClient } from "./client.js";
|
|
6
|
+
import { toolDefinitions, toolHandlers } from "./tools.js";
|
|
7
|
+
export class ContensaMCPServer {
|
|
8
|
+
server;
|
|
9
|
+
client;
|
|
10
|
+
constructor(config) {
|
|
11
|
+
this.client = new ContensaClient(config);
|
|
12
|
+
this.server = new Server({
|
|
13
|
+
name: "contensa-cms",
|
|
14
|
+
version: "1.0.0",
|
|
15
|
+
}, {
|
|
16
|
+
capabilities: {
|
|
17
|
+
tools: {},
|
|
18
|
+
resources: {},
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
this.setupHandlers();
|
|
22
|
+
}
|
|
23
|
+
setupHandlers() {
|
|
24
|
+
// List available tools
|
|
25
|
+
this.server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
26
|
+
return {
|
|
27
|
+
tools: toolDefinitions.map((tool) => ({
|
|
28
|
+
name: tool.name,
|
|
29
|
+
description: tool.description,
|
|
30
|
+
inputSchema: {
|
|
31
|
+
type: "object",
|
|
32
|
+
properties: Object.fromEntries(Object.entries(tool.inputSchema.shape).map(([key, value]) => {
|
|
33
|
+
const zodType = value;
|
|
34
|
+
const typeName = zodType._def.typeName;
|
|
35
|
+
let type = "string";
|
|
36
|
+
let enumValues;
|
|
37
|
+
if (typeName === "ZodNumber") {
|
|
38
|
+
type = "number";
|
|
39
|
+
}
|
|
40
|
+
else if (typeName === "ZodBoolean") {
|
|
41
|
+
type = "boolean";
|
|
42
|
+
}
|
|
43
|
+
else if (typeName === "ZodArray") {
|
|
44
|
+
type = "array";
|
|
45
|
+
}
|
|
46
|
+
else if (typeName === "ZodRecord") {
|
|
47
|
+
type = "object";
|
|
48
|
+
}
|
|
49
|
+
else if (typeName === "ZodEnum") {
|
|
50
|
+
type = "string";
|
|
51
|
+
enumValues = zodType._def.values;
|
|
52
|
+
}
|
|
53
|
+
return [
|
|
54
|
+
key,
|
|
55
|
+
{
|
|
56
|
+
type,
|
|
57
|
+
description: zodType._def.description,
|
|
58
|
+
...(enumValues ? { enum: enumValues } : {}),
|
|
59
|
+
},
|
|
60
|
+
];
|
|
61
|
+
})),
|
|
62
|
+
required: Object.entries(tool.inputSchema.shape)
|
|
63
|
+
.filter(([, value]) => {
|
|
64
|
+
const zodType = value;
|
|
65
|
+
return typeof zodType.isOptional !== "function" || !zodType.isOptional();
|
|
66
|
+
})
|
|
67
|
+
.map(([key]) => key),
|
|
68
|
+
},
|
|
69
|
+
})),
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
// Handle tool calls
|
|
73
|
+
this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
74
|
+
const { name, arguments: args } = request.params;
|
|
75
|
+
const handler = toolHandlers[name];
|
|
76
|
+
if (!handler) {
|
|
77
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
78
|
+
}
|
|
79
|
+
try {
|
|
80
|
+
const result = await handler(this.client, args || {});
|
|
81
|
+
return {
|
|
82
|
+
content: [
|
|
83
|
+
{
|
|
84
|
+
type: "text",
|
|
85
|
+
text: JSON.stringify(result, null, 2),
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
const errorMessage = error instanceof Error ? error.message : "Unknown error";
|
|
92
|
+
return {
|
|
93
|
+
content: [
|
|
94
|
+
{
|
|
95
|
+
type: "text",
|
|
96
|
+
text: JSON.stringify({ error: errorMessage }, null, 2),
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
isError: true,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
// List available resources (for browsing content)
|
|
104
|
+
this.server.setRequestHandler(ListResourcesRequestSchema, async () => {
|
|
105
|
+
const projectId = this.client.getProjectId();
|
|
106
|
+
if (!projectId) {
|
|
107
|
+
return { resources: [] };
|
|
108
|
+
}
|
|
109
|
+
try {
|
|
110
|
+
const contentTypes = await this.client.getContentTypes(projectId);
|
|
111
|
+
return {
|
|
112
|
+
resources: contentTypes.map((ct) => ({
|
|
113
|
+
uri: `contensa://content-type/${ct.id}`,
|
|
114
|
+
name: ct.name,
|
|
115
|
+
description: ct.description || `Content type: ${ct.name}`,
|
|
116
|
+
mimeType: "application/json",
|
|
117
|
+
})),
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
return { resources: [] };
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
// Read resource content
|
|
125
|
+
this.server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
|
|
126
|
+
const { uri } = request.params;
|
|
127
|
+
// Parse URI: contensa://content-type/{id} or contensa://entry/{id}
|
|
128
|
+
const match = uri.match(/^contensa:\/\/(content-type|entry)\/(.+)$/);
|
|
129
|
+
if (!match) {
|
|
130
|
+
throw new Error(`Invalid resource URI: ${uri}`);
|
|
131
|
+
}
|
|
132
|
+
const [, resourceType, id] = match;
|
|
133
|
+
try {
|
|
134
|
+
if (resourceType === "content-type") {
|
|
135
|
+
const contentType = await this.client.getContentType(id);
|
|
136
|
+
const fields = await this.client.getFields(id);
|
|
137
|
+
return {
|
|
138
|
+
contents: [
|
|
139
|
+
{
|
|
140
|
+
uri,
|
|
141
|
+
mimeType: "application/json",
|
|
142
|
+
text: JSON.stringify({ ...contentType, fields }, null, 2),
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
else if (resourceType === "entry") {
|
|
148
|
+
const entry = await this.client.getContentEntry(id);
|
|
149
|
+
return {
|
|
150
|
+
contents: [
|
|
151
|
+
{
|
|
152
|
+
uri,
|
|
153
|
+
mimeType: "application/json",
|
|
154
|
+
text: JSON.stringify(entry, null, 2),
|
|
155
|
+
},
|
|
156
|
+
],
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
throw new Error(`Unknown resource type: ${resourceType}`);
|
|
160
|
+
}
|
|
161
|
+
catch (error) {
|
|
162
|
+
const errorMessage = error instanceof Error ? error.message : "Unknown error";
|
|
163
|
+
throw new Error(`Failed to read resource: ${errorMessage}`);
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
async start() {
|
|
168
|
+
const transport = new StdioServerTransport();
|
|
169
|
+
await this.server.connect(transport);
|
|
170
|
+
console.error("Contensa MCP Server started");
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"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CACF"}
|
package/dist/tools.d.ts
ADDED
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { ContensaClient } from "./client.js";
|
|
3
|
+
export declare const schemas: {
|
|
4
|
+
listProjects: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
5
|
+
getProject: z.ZodObject<{
|
|
6
|
+
projectId: z.ZodString;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
projectId: string;
|
|
9
|
+
}, {
|
|
10
|
+
projectId: string;
|
|
11
|
+
}>;
|
|
12
|
+
setActiveProject: z.ZodObject<{
|
|
13
|
+
projectId: z.ZodString;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
projectId: string;
|
|
16
|
+
}, {
|
|
17
|
+
projectId: string;
|
|
18
|
+
}>;
|
|
19
|
+
setActiveEnvironment: z.ZodObject<{
|
|
20
|
+
environmentId: z.ZodString;
|
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
|
22
|
+
environmentId: string;
|
|
23
|
+
}, {
|
|
24
|
+
environmentId: string;
|
|
25
|
+
}>;
|
|
26
|
+
listContentTypes: z.ZodObject<{
|
|
27
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
28
|
+
}, "strip", z.ZodTypeAny, {
|
|
29
|
+
projectId?: string | undefined;
|
|
30
|
+
}, {
|
|
31
|
+
projectId?: string | undefined;
|
|
32
|
+
}>;
|
|
33
|
+
getContentType: z.ZodObject<{
|
|
34
|
+
contentTypeId: z.ZodString;
|
|
35
|
+
}, "strip", z.ZodTypeAny, {
|
|
36
|
+
contentTypeId: string;
|
|
37
|
+
}, {
|
|
38
|
+
contentTypeId: string;
|
|
39
|
+
}>;
|
|
40
|
+
createContentType: z.ZodObject<{
|
|
41
|
+
name: z.ZodString;
|
|
42
|
+
description: z.ZodOptional<z.ZodString>;
|
|
43
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
44
|
+
}, "strip", z.ZodTypeAny, {
|
|
45
|
+
name: string;
|
|
46
|
+
projectId?: string | undefined;
|
|
47
|
+
description?: string | undefined;
|
|
48
|
+
}, {
|
|
49
|
+
name: string;
|
|
50
|
+
projectId?: string | undefined;
|
|
51
|
+
description?: string | undefined;
|
|
52
|
+
}>;
|
|
53
|
+
updateContentType: z.ZodObject<{
|
|
54
|
+
contentTypeId: z.ZodString;
|
|
55
|
+
name: z.ZodOptional<z.ZodString>;
|
|
56
|
+
description: z.ZodOptional<z.ZodString>;
|
|
57
|
+
}, "strip", z.ZodTypeAny, {
|
|
58
|
+
contentTypeId: string;
|
|
59
|
+
name?: string | undefined;
|
|
60
|
+
description?: string | undefined;
|
|
61
|
+
}, {
|
|
62
|
+
contentTypeId: string;
|
|
63
|
+
name?: string | undefined;
|
|
64
|
+
description?: string | undefined;
|
|
65
|
+
}>;
|
|
66
|
+
deleteContentType: z.ZodObject<{
|
|
67
|
+
contentTypeId: z.ZodString;
|
|
68
|
+
}, "strip", z.ZodTypeAny, {
|
|
69
|
+
contentTypeId: string;
|
|
70
|
+
}, {
|
|
71
|
+
contentTypeId: string;
|
|
72
|
+
}>;
|
|
73
|
+
listFields: z.ZodObject<{
|
|
74
|
+
contentTypeId: z.ZodString;
|
|
75
|
+
}, "strip", z.ZodTypeAny, {
|
|
76
|
+
contentTypeId: string;
|
|
77
|
+
}, {
|
|
78
|
+
contentTypeId: string;
|
|
79
|
+
}>;
|
|
80
|
+
createField: z.ZodObject<{
|
|
81
|
+
contentTypeId: z.ZodString;
|
|
82
|
+
name: z.ZodString;
|
|
83
|
+
kind: z.ZodEnum<["short-text", "long-text", "number", "date", "boolean", "media", "list", "reference", "references-many"]>;
|
|
84
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
85
|
+
targetContentTypeId: z.ZodOptional<z.ZodString>;
|
|
86
|
+
}, "strip", z.ZodTypeAny, {
|
|
87
|
+
contentTypeId: string;
|
|
88
|
+
name: string;
|
|
89
|
+
kind: "number" | "boolean" | "short-text" | "long-text" | "date" | "media" | "list" | "reference" | "references-many";
|
|
90
|
+
required?: boolean | undefined;
|
|
91
|
+
targetContentTypeId?: string | undefined;
|
|
92
|
+
}, {
|
|
93
|
+
contentTypeId: string;
|
|
94
|
+
name: string;
|
|
95
|
+
kind: "number" | "boolean" | "short-text" | "long-text" | "date" | "media" | "list" | "reference" | "references-many";
|
|
96
|
+
required?: boolean | undefined;
|
|
97
|
+
targetContentTypeId?: string | undefined;
|
|
98
|
+
}>;
|
|
99
|
+
updateField: z.ZodObject<{
|
|
100
|
+
fieldId: z.ZodString;
|
|
101
|
+
name: z.ZodOptional<z.ZodString>;
|
|
102
|
+
kind: z.ZodOptional<z.ZodEnum<["short-text", "long-text", "number", "date", "boolean", "media", "list", "reference", "references-many"]>>;
|
|
103
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
104
|
+
}, "strip", z.ZodTypeAny, {
|
|
105
|
+
fieldId: string;
|
|
106
|
+
name?: string | undefined;
|
|
107
|
+
kind?: "number" | "boolean" | "short-text" | "long-text" | "date" | "media" | "list" | "reference" | "references-many" | undefined;
|
|
108
|
+
required?: boolean | undefined;
|
|
109
|
+
}, {
|
|
110
|
+
fieldId: string;
|
|
111
|
+
name?: string | undefined;
|
|
112
|
+
kind?: "number" | "boolean" | "short-text" | "long-text" | "date" | "media" | "list" | "reference" | "references-many" | undefined;
|
|
113
|
+
required?: boolean | undefined;
|
|
114
|
+
}>;
|
|
115
|
+
deleteField: z.ZodObject<{
|
|
116
|
+
fieldId: z.ZodString;
|
|
117
|
+
}, "strip", z.ZodTypeAny, {
|
|
118
|
+
fieldId: string;
|
|
119
|
+
}, {
|
|
120
|
+
fieldId: string;
|
|
121
|
+
}>;
|
|
122
|
+
listContentEntries: z.ZodObject<{
|
|
123
|
+
contentTypeId: z.ZodString;
|
|
124
|
+
status: z.ZodOptional<z.ZodEnum<["draft", "published", "archived"]>>;
|
|
125
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
126
|
+
}, "strip", z.ZodTypeAny, {
|
|
127
|
+
contentTypeId: string;
|
|
128
|
+
status?: "draft" | "published" | "archived" | undefined;
|
|
129
|
+
limit?: number | undefined;
|
|
130
|
+
}, {
|
|
131
|
+
contentTypeId: string;
|
|
132
|
+
status?: "draft" | "published" | "archived" | undefined;
|
|
133
|
+
limit?: number | undefined;
|
|
134
|
+
}>;
|
|
135
|
+
getContentEntry: z.ZodObject<{
|
|
136
|
+
entryId: z.ZodString;
|
|
137
|
+
}, "strip", z.ZodTypeAny, {
|
|
138
|
+
entryId: string;
|
|
139
|
+
}, {
|
|
140
|
+
entryId: string;
|
|
141
|
+
}>;
|
|
142
|
+
createContentEntry: z.ZodObject<{
|
|
143
|
+
contentTypeId: z.ZodString;
|
|
144
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
145
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
146
|
+
status: z.ZodOptional<z.ZodEnum<["draft", "published"]>>;
|
|
147
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
148
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
149
|
+
}, "strip", z.ZodTypeAny, {
|
|
150
|
+
contentTypeId: string;
|
|
151
|
+
data: Record<string, unknown>;
|
|
152
|
+
status?: "draft" | "published" | undefined;
|
|
153
|
+
projectId?: string | undefined;
|
|
154
|
+
userId?: string | undefined;
|
|
155
|
+
locale?: string | undefined;
|
|
156
|
+
}, {
|
|
157
|
+
contentTypeId: string;
|
|
158
|
+
data: Record<string, unknown>;
|
|
159
|
+
status?: "draft" | "published" | undefined;
|
|
160
|
+
projectId?: string | undefined;
|
|
161
|
+
userId?: string | undefined;
|
|
162
|
+
locale?: string | undefined;
|
|
163
|
+
}>;
|
|
164
|
+
updateContentEntry: z.ZodObject<{
|
|
165
|
+
entryId: z.ZodString;
|
|
166
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
167
|
+
status: z.ZodOptional<z.ZodEnum<["draft", "published", "archived"]>>;
|
|
168
|
+
}, "strip", z.ZodTypeAny, {
|
|
169
|
+
entryId: string;
|
|
170
|
+
status?: "draft" | "published" | "archived" | undefined;
|
|
171
|
+
data?: Record<string, unknown> | undefined;
|
|
172
|
+
}, {
|
|
173
|
+
entryId: string;
|
|
174
|
+
status?: "draft" | "published" | "archived" | undefined;
|
|
175
|
+
data?: Record<string, unknown> | undefined;
|
|
176
|
+
}>;
|
|
177
|
+
deleteContentEntry: z.ZodObject<{
|
|
178
|
+
entryId: z.ZodString;
|
|
179
|
+
}, "strip", z.ZodTypeAny, {
|
|
180
|
+
entryId: string;
|
|
181
|
+
}, {
|
|
182
|
+
entryId: string;
|
|
183
|
+
}>;
|
|
184
|
+
publishContentEntry: z.ZodObject<{
|
|
185
|
+
entryId: z.ZodString;
|
|
186
|
+
}, "strip", z.ZodTypeAny, {
|
|
187
|
+
entryId: string;
|
|
188
|
+
}, {
|
|
189
|
+
entryId: string;
|
|
190
|
+
}>;
|
|
191
|
+
unpublishContentEntry: z.ZodObject<{
|
|
192
|
+
entryId: z.ZodString;
|
|
193
|
+
}, "strip", z.ZodTypeAny, {
|
|
194
|
+
entryId: string;
|
|
195
|
+
}, {
|
|
196
|
+
entryId: string;
|
|
197
|
+
}>;
|
|
198
|
+
listMediaAssets: z.ZodObject<{
|
|
199
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
200
|
+
}, "strip", z.ZodTypeAny, {
|
|
201
|
+
projectId?: string | undefined;
|
|
202
|
+
}, {
|
|
203
|
+
projectId?: string | undefined;
|
|
204
|
+
}>;
|
|
205
|
+
getMediaAsset: z.ZodObject<{
|
|
206
|
+
assetId: z.ZodString;
|
|
207
|
+
}, "strip", z.ZodTypeAny, {
|
|
208
|
+
assetId: string;
|
|
209
|
+
}, {
|
|
210
|
+
assetId: string;
|
|
211
|
+
}>;
|
|
212
|
+
deleteMediaAsset: z.ZodObject<{
|
|
213
|
+
assetId: z.ZodString;
|
|
214
|
+
}, "strip", z.ZodTypeAny, {
|
|
215
|
+
assetId: string;
|
|
216
|
+
}, {
|
|
217
|
+
assetId: string;
|
|
218
|
+
}>;
|
|
219
|
+
suggestFields: z.ZodObject<{
|
|
220
|
+
contentTypeName: z.ZodString;
|
|
221
|
+
existingFields: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
222
|
+
apiName: z.ZodString;
|
|
223
|
+
kind: z.ZodString;
|
|
224
|
+
}, "strip", z.ZodTypeAny, {
|
|
225
|
+
kind: string;
|
|
226
|
+
apiName: string;
|
|
227
|
+
}, {
|
|
228
|
+
kind: string;
|
|
229
|
+
apiName: string;
|
|
230
|
+
}>, "many">>;
|
|
231
|
+
}, "strip", z.ZodTypeAny, {
|
|
232
|
+
contentTypeName: string;
|
|
233
|
+
existingFields?: {
|
|
234
|
+
kind: string;
|
|
235
|
+
apiName: string;
|
|
236
|
+
}[] | undefined;
|
|
237
|
+
}, {
|
|
238
|
+
contentTypeName: string;
|
|
239
|
+
existingFields?: {
|
|
240
|
+
kind: string;
|
|
241
|
+
apiName: string;
|
|
242
|
+
}[] | undefined;
|
|
243
|
+
}>;
|
|
244
|
+
generateSchema: z.ZodObject<{
|
|
245
|
+
description: z.ZodString;
|
|
246
|
+
}, "strip", z.ZodTypeAny, {
|
|
247
|
+
description: string;
|
|
248
|
+
}, {
|
|
249
|
+
description: string;
|
|
250
|
+
}>;
|
|
251
|
+
listEnvironments: z.ZodObject<{
|
|
252
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
253
|
+
}, "strip", z.ZodTypeAny, {
|
|
254
|
+
projectId?: string | undefined;
|
|
255
|
+
}, {
|
|
256
|
+
projectId?: string | undefined;
|
|
257
|
+
}>;
|
|
258
|
+
getEnvironment: z.ZodObject<{
|
|
259
|
+
environmentId: z.ZodString;
|
|
260
|
+
}, "strip", z.ZodTypeAny, {
|
|
261
|
+
environmentId: string;
|
|
262
|
+
}, {
|
|
263
|
+
environmentId: string;
|
|
264
|
+
}>;
|
|
265
|
+
createEnvironment: z.ZodObject<{
|
|
266
|
+
name: z.ZodString;
|
|
267
|
+
slug: z.ZodString;
|
|
268
|
+
description: z.ZodOptional<z.ZodString>;
|
|
269
|
+
sourceEnvironmentId: z.ZodOptional<z.ZodString>;
|
|
270
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
271
|
+
}, "strip", z.ZodTypeAny, {
|
|
272
|
+
name: string;
|
|
273
|
+
slug: string;
|
|
274
|
+
projectId?: string | undefined;
|
|
275
|
+
description?: string | undefined;
|
|
276
|
+
sourceEnvironmentId?: string | undefined;
|
|
277
|
+
}, {
|
|
278
|
+
name: string;
|
|
279
|
+
slug: string;
|
|
280
|
+
projectId?: string | undefined;
|
|
281
|
+
description?: string | undefined;
|
|
282
|
+
sourceEnvironmentId?: string | undefined;
|
|
283
|
+
}>;
|
|
284
|
+
updateEnvironment: z.ZodObject<{
|
|
285
|
+
environmentId: z.ZodString;
|
|
286
|
+
name: z.ZodOptional<z.ZodString>;
|
|
287
|
+
description: z.ZodOptional<z.ZodString>;
|
|
288
|
+
status: z.ZodOptional<z.ZodEnum<["active", "inactive"]>>;
|
|
289
|
+
}, "strip", z.ZodTypeAny, {
|
|
290
|
+
environmentId: string;
|
|
291
|
+
status?: "active" | "inactive" | undefined;
|
|
292
|
+
name?: string | undefined;
|
|
293
|
+
description?: string | undefined;
|
|
294
|
+
}, {
|
|
295
|
+
environmentId: string;
|
|
296
|
+
status?: "active" | "inactive" | undefined;
|
|
297
|
+
name?: string | undefined;
|
|
298
|
+
description?: string | undefined;
|
|
299
|
+
}>;
|
|
300
|
+
deleteEnvironment: z.ZodObject<{
|
|
301
|
+
environmentId: z.ZodString;
|
|
302
|
+
}, "strip", z.ZodTypeAny, {
|
|
303
|
+
environmentId: string;
|
|
304
|
+
}, {
|
|
305
|
+
environmentId: string;
|
|
306
|
+
}>;
|
|
307
|
+
mergeEnvironment: z.ZodObject<{
|
|
308
|
+
targetEnvironmentId: z.ZodString;
|
|
309
|
+
sourceEnvironmentId: z.ZodString;
|
|
310
|
+
dryRun: z.ZodOptional<z.ZodBoolean>;
|
|
311
|
+
defaultStrategy: z.ZodOptional<z.ZodEnum<["replace", "skip", "merge", "create-new"]>>;
|
|
312
|
+
contentTypeResolutions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
313
|
+
contentTypeId: z.ZodString;
|
|
314
|
+
strategy: z.ZodEnum<["replace", "skip", "merge", "create-new"]>;
|
|
315
|
+
}, "strip", z.ZodTypeAny, {
|
|
316
|
+
contentTypeId: string;
|
|
317
|
+
strategy: "replace" | "skip" | "merge" | "create-new";
|
|
318
|
+
}, {
|
|
319
|
+
contentTypeId: string;
|
|
320
|
+
strategy: "replace" | "skip" | "merge" | "create-new";
|
|
321
|
+
}>, "many">>;
|
|
322
|
+
entryResolutions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
323
|
+
entryId: z.ZodString;
|
|
324
|
+
fieldName: z.ZodString;
|
|
325
|
+
strategy: z.ZodEnum<["replace", "skip", "merge", "create-new"]>;
|
|
326
|
+
}, "strip", z.ZodTypeAny, {
|
|
327
|
+
entryId: string;
|
|
328
|
+
strategy: "replace" | "skip" | "merge" | "create-new";
|
|
329
|
+
fieldName: string;
|
|
330
|
+
}, {
|
|
331
|
+
entryId: string;
|
|
332
|
+
strategy: "replace" | "skip" | "merge" | "create-new";
|
|
333
|
+
fieldName: string;
|
|
334
|
+
}>, "many">>;
|
|
335
|
+
requireMasterApproval: z.ZodOptional<z.ZodBoolean>;
|
|
336
|
+
}, "strip", z.ZodTypeAny, {
|
|
337
|
+
sourceEnvironmentId: string;
|
|
338
|
+
targetEnvironmentId: string;
|
|
339
|
+
dryRun?: boolean | undefined;
|
|
340
|
+
defaultStrategy?: "replace" | "skip" | "merge" | "create-new" | undefined;
|
|
341
|
+
contentTypeResolutions?: {
|
|
342
|
+
contentTypeId: string;
|
|
343
|
+
strategy: "replace" | "skip" | "merge" | "create-new";
|
|
344
|
+
}[] | undefined;
|
|
345
|
+
entryResolutions?: {
|
|
346
|
+
entryId: string;
|
|
347
|
+
strategy: "replace" | "skip" | "merge" | "create-new";
|
|
348
|
+
fieldName: string;
|
|
349
|
+
}[] | undefined;
|
|
350
|
+
requireMasterApproval?: boolean | undefined;
|
|
351
|
+
}, {
|
|
352
|
+
sourceEnvironmentId: string;
|
|
353
|
+
targetEnvironmentId: string;
|
|
354
|
+
dryRun?: boolean | undefined;
|
|
355
|
+
defaultStrategy?: "replace" | "skip" | "merge" | "create-new" | undefined;
|
|
356
|
+
contentTypeResolutions?: {
|
|
357
|
+
contentTypeId: string;
|
|
358
|
+
strategy: "replace" | "skip" | "merge" | "create-new";
|
|
359
|
+
}[] | undefined;
|
|
360
|
+
entryResolutions?: {
|
|
361
|
+
entryId: string;
|
|
362
|
+
strategy: "replace" | "skip" | "merge" | "create-new";
|
|
363
|
+
fieldName: string;
|
|
364
|
+
}[] | undefined;
|
|
365
|
+
requireMasterApproval?: boolean | undefined;
|
|
366
|
+
}>;
|
|
367
|
+
syncEnvironment: z.ZodObject<{
|
|
368
|
+
targetEnvironmentId: z.ZodString;
|
|
369
|
+
sourceEnvironmentId: z.ZodString;
|
|
370
|
+
}, "strip", z.ZodTypeAny, {
|
|
371
|
+
sourceEnvironmentId: string;
|
|
372
|
+
targetEnvironmentId: string;
|
|
373
|
+
}, {
|
|
374
|
+
sourceEnvironmentId: string;
|
|
375
|
+
targetEnvironmentId: string;
|
|
376
|
+
}>;
|
|
377
|
+
getSupportedLocales: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
378
|
+
listLocaleVariants: z.ZodObject<{
|
|
379
|
+
entryId: z.ZodString;
|
|
380
|
+
}, "strip", z.ZodTypeAny, {
|
|
381
|
+
entryId: string;
|
|
382
|
+
}, {
|
|
383
|
+
entryId: string;
|
|
384
|
+
}>;
|
|
385
|
+
createLocaleVariant: z.ZodObject<{
|
|
386
|
+
entryId: z.ZodString;
|
|
387
|
+
locale: z.ZodString;
|
|
388
|
+
translateContent: z.ZodBoolean;
|
|
389
|
+
translateReferences: z.ZodBoolean;
|
|
390
|
+
}, "strip", z.ZodTypeAny, {
|
|
391
|
+
entryId: string;
|
|
392
|
+
locale: string;
|
|
393
|
+
translateContent: boolean;
|
|
394
|
+
translateReferences: boolean;
|
|
395
|
+
}, {
|
|
396
|
+
entryId: string;
|
|
397
|
+
locale: string;
|
|
398
|
+
translateContent: boolean;
|
|
399
|
+
translateReferences: boolean;
|
|
400
|
+
}>;
|
|
401
|
+
};
|
|
402
|
+
export declare const toolDefinitions: {
|
|
403
|
+
name: string;
|
|
404
|
+
description: string;
|
|
405
|
+
inputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
406
|
+
}[];
|
|
407
|
+
export type ToolHandler = (client: ContensaClient, args: Record<string, unknown>) => Promise<unknown>;
|
|
408
|
+
export declare const toolHandlers: Record<string, ToolHandler>;
|
|
409
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGlD,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyLnB,CAAC;AAGF,eAAO,MAAM,eAAe;;;;GA+L3B,CAAC;AAGF,MAAM,MAAM,WAAW,GAAG,CACxB,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC1B,OAAO,CAAC,OAAO,CAAC,CAAC;AAGtB,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CA0TpD,CAAC"}
|