@markstiles/sitecore-search-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/AUTHENTICATION.md +337 -0
- package/LICENSE +21 -0
- package/README.md +606 -0
- package/dist/client/base-client.d.ts +34 -0
- package/dist/client/base-client.d.ts.map +1 -0
- package/dist/client/base-client.js +117 -0
- package/dist/client/base-client.js.map +1 -0
- package/dist/client/events-client.d.ts +77 -0
- package/dist/client/events-client.d.ts.map +1 -0
- package/dist/client/events-client.js +32 -0
- package/dist/client/events-client.js.map +1 -0
- package/dist/client/ingestion-client.d.ts +76 -0
- package/dist/client/ingestion-client.d.ts.map +1 -0
- package/dist/client/ingestion-client.js +73 -0
- package/dist/client/ingestion-client.js.map +1 -0
- package/dist/client/search-client.d.ts +97 -0
- package/dist/client/search-client.d.ts.map +1 -0
- package/dist/client/search-client.js +18 -0
- package/dist/client/search-client.js.map +1 -0
- package/dist/config.d.ts +99 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +75 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +312 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/events/track-event.d.ts +394 -0
- package/dist/tools/events/track-event.d.ts.map +1 -0
- package/dist/tools/events/track-event.js +80 -0
- package/dist/tools/events/track-event.js.map +1 -0
- package/dist/tools/events/validate-event.d.ts +94 -0
- package/dist/tools/events/validate-event.d.ts.map +1 -0
- package/dist/tools/events/validate-event.js +51 -0
- package/dist/tools/events/validate-event.js.map +1 -0
- package/dist/tools/ingestion/check-status.d.ts +50 -0
- package/dist/tools/ingestion/check-status.d.ts.map +1 -0
- package/dist/tools/ingestion/check-status.js +27 -0
- package/dist/tools/ingestion/check-status.js.map +1 -0
- package/dist/tools/ingestion/create-document.d.ts +50 -0
- package/dist/tools/ingestion/create-document.d.ts.map +1 -0
- package/dist/tools/ingestion/create-document.js +27 -0
- package/dist/tools/ingestion/create-document.js.map +1 -0
- package/dist/tools/ingestion/delete-document.d.ts +50 -0
- package/dist/tools/ingestion/delete-document.d.ts.map +1 -0
- package/dist/tools/ingestion/delete-document.js +27 -0
- package/dist/tools/ingestion/delete-document.js.map +1 -0
- package/dist/tools/ingestion/ingest-from-source.d.ts +234 -0
- package/dist/tools/ingestion/ingest-from-source.d.ts.map +1 -0
- package/dist/tools/ingestion/ingest-from-source.js +48 -0
- package/dist/tools/ingestion/ingest-from-source.js.map +1 -0
- package/dist/tools/ingestion/update-document.d.ts +62 -0
- package/dist/tools/ingestion/update-document.d.ts.map +1 -0
- package/dist/tools/ingestion/update-document.js +34 -0
- package/dist/tools/ingestion/update-document.js.map +1 -0
- package/dist/tools/search/ai-search.d.ts +132 -0
- package/dist/tools/search/ai-search.d.ts.map +1 -0
- package/dist/tools/search/ai-search.js +65 -0
- package/dist/tools/search/ai-search.js.map +1 -0
- package/dist/tools/search/basic-search.d.ts +98 -0
- package/dist/tools/search/basic-search.d.ts.map +1 -0
- package/dist/tools/search/basic-search.js +51 -0
- package/dist/tools/search/basic-search.js.map +1 -0
- package/dist/tools/search/faceted-search.d.ts +114 -0
- package/dist/tools/search/faceted-search.d.ts.map +1 -0
- package/dist/tools/search/faceted-search.js +52 -0
- package/dist/tools/search/faceted-search.js.map +1 -0
- package/dist/tools/search/recommendations.d.ts +62 -0
- package/dist/tools/search/recommendations.d.ts.map +1 -0
- package/dist/tools/search/recommendations.js +50 -0
- package/dist/tools/search/recommendations.js.map +1 -0
- package/dist/utils/auth-manager.d.ts +60 -0
- package/dist/utils/auth-manager.d.ts.map +1 -0
- package/dist/utils/auth-manager.js +184 -0
- package/dist/utils/auth-manager.js.map +1 -0
- package/dist/utils/errors.d.ts +18 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +58 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/logger.d.ts +12 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +50 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/schema.d.ts +6 -0
- package/dist/utils/schema.d.ts.map +1 -0
- package/dist/utils/schema.js +14 -0
- package/dist/utils/schema.js.map +1 -0
- package/package.json +58 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { IngestionClient } from '../../client/ingestion-client.js';
|
|
3
|
+
/**
|
|
4
|
+
* Schema for checking ingestion status
|
|
5
|
+
*/
|
|
6
|
+
export declare const CheckStatusSchema: z.ZodObject<{
|
|
7
|
+
domain: z.ZodString;
|
|
8
|
+
source: z.ZodString;
|
|
9
|
+
entity: z.ZodString;
|
|
10
|
+
incrementalUpdateId: z.ZodString;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
entity: string;
|
|
13
|
+
domain: string;
|
|
14
|
+
source: string;
|
|
15
|
+
incrementalUpdateId: string;
|
|
16
|
+
}, {
|
|
17
|
+
entity: string;
|
|
18
|
+
domain: string;
|
|
19
|
+
source: string;
|
|
20
|
+
incrementalUpdateId: string;
|
|
21
|
+
}>;
|
|
22
|
+
export type CheckStatusInput = z.infer<typeof CheckStatusSchema>;
|
|
23
|
+
/**
|
|
24
|
+
* Check status of an ingestion operation
|
|
25
|
+
*/
|
|
26
|
+
export declare function checkIngestionStatus(client: IngestionClient, input: unknown): Promise<import("../../client/ingestion-client.js").StatusResponse>;
|
|
27
|
+
/**
|
|
28
|
+
* MCP Tool Definition for checking ingestion status
|
|
29
|
+
*/
|
|
30
|
+
export declare const checkStatusTool: {
|
|
31
|
+
name: string;
|
|
32
|
+
description: string;
|
|
33
|
+
inputSchema: z.ZodObject<{
|
|
34
|
+
domain: z.ZodString;
|
|
35
|
+
source: z.ZodString;
|
|
36
|
+
entity: z.ZodString;
|
|
37
|
+
incrementalUpdateId: z.ZodString;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
entity: string;
|
|
40
|
+
domain: string;
|
|
41
|
+
source: string;
|
|
42
|
+
incrementalUpdateId: string;
|
|
43
|
+
}, {
|
|
44
|
+
entity: string;
|
|
45
|
+
domain: string;
|
|
46
|
+
source: string;
|
|
47
|
+
incrementalUpdateId: string;
|
|
48
|
+
}>;
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=check-status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-status.d.ts","sourceRoot":"","sources":["../../../src/tools/ingestion/check-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAGnE;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;EAK5B,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAEjE;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,OAAO,sEASf;AAED;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;CAI3B,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { validateInput } from '../../utils/errors.js';
|
|
3
|
+
/**
|
|
4
|
+
* Schema for checking ingestion status
|
|
5
|
+
*/
|
|
6
|
+
export const CheckStatusSchema = z.object({
|
|
7
|
+
domain: z.string().describe('Domain ID'),
|
|
8
|
+
source: z.string().describe('Source identifier'),
|
|
9
|
+
entity: z.string().describe('Entity type'),
|
|
10
|
+
incrementalUpdateId: z.string().describe('Incremental update ID returned from ingestion operation'),
|
|
11
|
+
});
|
|
12
|
+
/**
|
|
13
|
+
* Check status of an ingestion operation
|
|
14
|
+
*/
|
|
15
|
+
export async function checkIngestionStatus(client, input) {
|
|
16
|
+
const params = validateInput(CheckStatusSchema, input);
|
|
17
|
+
return client.getStatus(params.domain, params.source, params.entity, params.incrementalUpdateId);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* MCP Tool Definition for checking ingestion status
|
|
21
|
+
*/
|
|
22
|
+
export const checkStatusTool = {
|
|
23
|
+
name: 'sitecore_check_ingestion_status',
|
|
24
|
+
description: 'Check the status of an asynchronous ingestion operation using the incremental update ID.',
|
|
25
|
+
inputSchema: CheckStatusSchema,
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=check-status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-status.js","sourceRoot":"","sources":["../../../src/tools/ingestion/check-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC;IACxC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;IAChD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC;IAC1C,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yDAAyD,CAAC;CACpG,CAAC,CAAC;AAIH;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,MAAuB,EACvB,KAAc;IAEd,MAAM,MAAM,GAAG,aAAa,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;IACvD,OAAO,MAAM,CAAC,SAAS,CACrB,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,mBAAmB,CAC3B,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,iCAAiC;IACvC,WAAW,EAAE,0FAA0F;IACvG,WAAW,EAAE,iBAAiB;CAC/B,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { IngestionClient } from '../../client/ingestion-client.js';
|
|
3
|
+
/**
|
|
4
|
+
* Schema for creating a document
|
|
5
|
+
*/
|
|
6
|
+
export declare const CreateDocumentSchema: z.ZodObject<{
|
|
7
|
+
domain: z.ZodString;
|
|
8
|
+
source: z.ZodString;
|
|
9
|
+
entity: z.ZodString;
|
|
10
|
+
document: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
document: Record<string, unknown>;
|
|
13
|
+
entity: string;
|
|
14
|
+
domain: string;
|
|
15
|
+
source: string;
|
|
16
|
+
}, {
|
|
17
|
+
document: Record<string, unknown>;
|
|
18
|
+
entity: string;
|
|
19
|
+
domain: string;
|
|
20
|
+
source: string;
|
|
21
|
+
}>;
|
|
22
|
+
export type CreateDocumentInput = z.infer<typeof CreateDocumentSchema>;
|
|
23
|
+
/**
|
|
24
|
+
* Create a new document in the index
|
|
25
|
+
*/
|
|
26
|
+
export declare function createDocument(client: IngestionClient, input: unknown): Promise<import("../../client/ingestion-client.js").IngestionResponse>;
|
|
27
|
+
/**
|
|
28
|
+
* MCP Tool Definition for creating documents
|
|
29
|
+
*/
|
|
30
|
+
export declare const createDocumentTool: {
|
|
31
|
+
name: string;
|
|
32
|
+
description: string;
|
|
33
|
+
inputSchema: z.ZodObject<{
|
|
34
|
+
domain: z.ZodString;
|
|
35
|
+
source: z.ZodString;
|
|
36
|
+
entity: z.ZodString;
|
|
37
|
+
document: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
document: Record<string, unknown>;
|
|
40
|
+
entity: string;
|
|
41
|
+
domain: string;
|
|
42
|
+
source: string;
|
|
43
|
+
}, {
|
|
44
|
+
document: Record<string, unknown>;
|
|
45
|
+
entity: string;
|
|
46
|
+
domain: string;
|
|
47
|
+
source: string;
|
|
48
|
+
}>;
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=create-document.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-document.d.ts","sourceRoot":"","sources":["../../../src/tools/ingestion/create-document.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAmB,MAAM,kCAAkC,CAAC;AAGpF;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;EAK/B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAEvE;;GAEG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,OAAO,yEASf;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;CAI9B,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { validateInput } from '../../utils/errors.js';
|
|
3
|
+
/**
|
|
4
|
+
* Schema for creating a document
|
|
5
|
+
*/
|
|
6
|
+
export const CreateDocumentSchema = z.object({
|
|
7
|
+
domain: z.string().describe('Domain ID'),
|
|
8
|
+
source: z.string().describe('Source identifier'),
|
|
9
|
+
entity: z.string().describe('Entity type (e.g., content, product)'),
|
|
10
|
+
document: z.record(z.unknown()).describe('Document data as key-value pairs'),
|
|
11
|
+
});
|
|
12
|
+
/**
|
|
13
|
+
* Create a new document in the index
|
|
14
|
+
*/
|
|
15
|
+
export async function createDocument(client, input) {
|
|
16
|
+
const params = validateInput(CreateDocumentSchema, input);
|
|
17
|
+
return client.createDocument(params.domain, params.source, params.entity, params.document);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* MCP Tool Definition for creating documents
|
|
21
|
+
*/
|
|
22
|
+
export const createDocumentTool = {
|
|
23
|
+
name: 'sitecore_create_document',
|
|
24
|
+
description: 'Create a new document in the Sitecore Search index. Provide domain, source, entity type, and document data.',
|
|
25
|
+
inputSchema: CreateDocumentSchema,
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=create-document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-document.js","sourceRoot":"","sources":["../../../src/tools/ingestion/create-document.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC;IACxC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;IAChD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sCAAsC,CAAC;IACnE,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,kCAAkC,CAAC;CAC7E,CAAC,CAAC;AAIH;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAAuB,EACvB,KAAc;IAEd,MAAM,MAAM,GAAG,aAAa,CAAC,oBAAoB,EAAE,KAAK,CAAC,CAAC;IAC1D,OAAO,MAAM,CAAC,cAAc,CAC1B,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,QAA2B,CACnC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,0BAA0B;IAChC,WAAW,EAAE,6GAA6G;IAC1H,WAAW,EAAE,oBAAoB;CAClC,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { IngestionClient } from '../../client/ingestion-client.js';
|
|
3
|
+
/**
|
|
4
|
+
* Schema for deleting a document
|
|
5
|
+
*/
|
|
6
|
+
export declare const DeleteDocumentSchema: z.ZodObject<{
|
|
7
|
+
domain: z.ZodString;
|
|
8
|
+
source: z.ZodString;
|
|
9
|
+
entity: z.ZodString;
|
|
10
|
+
documentId: z.ZodString;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
entity: string;
|
|
13
|
+
domain: string;
|
|
14
|
+
source: string;
|
|
15
|
+
documentId: string;
|
|
16
|
+
}, {
|
|
17
|
+
entity: string;
|
|
18
|
+
domain: string;
|
|
19
|
+
source: string;
|
|
20
|
+
documentId: string;
|
|
21
|
+
}>;
|
|
22
|
+
export type DeleteDocumentInput = z.infer<typeof DeleteDocumentSchema>;
|
|
23
|
+
/**
|
|
24
|
+
* Delete a document from the index
|
|
25
|
+
*/
|
|
26
|
+
export declare function deleteDocument(client: IngestionClient, input: unknown): Promise<import("../../client/ingestion-client.js").IngestionResponse>;
|
|
27
|
+
/**
|
|
28
|
+
* MCP Tool Definition for deleting documents
|
|
29
|
+
*/
|
|
30
|
+
export declare const deleteDocumentTool: {
|
|
31
|
+
name: string;
|
|
32
|
+
description: string;
|
|
33
|
+
inputSchema: z.ZodObject<{
|
|
34
|
+
domain: z.ZodString;
|
|
35
|
+
source: z.ZodString;
|
|
36
|
+
entity: z.ZodString;
|
|
37
|
+
documentId: z.ZodString;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
entity: string;
|
|
40
|
+
domain: string;
|
|
41
|
+
source: string;
|
|
42
|
+
documentId: string;
|
|
43
|
+
}, {
|
|
44
|
+
entity: string;
|
|
45
|
+
domain: string;
|
|
46
|
+
source: string;
|
|
47
|
+
documentId: string;
|
|
48
|
+
}>;
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=delete-document.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-document.d.ts","sourceRoot":"","sources":["../../../src/tools/ingestion/delete-document.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAGnE;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;EAK/B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAEvE;;GAEG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,OAAO,yEASf;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;CAI9B,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { validateInput } from '../../utils/errors.js';
|
|
3
|
+
/**
|
|
4
|
+
* Schema for deleting a document
|
|
5
|
+
*/
|
|
6
|
+
export const DeleteDocumentSchema = z.object({
|
|
7
|
+
domain: z.string().describe('Domain ID'),
|
|
8
|
+
source: z.string().describe('Source identifier'),
|
|
9
|
+
entity: z.string().describe('Entity type'),
|
|
10
|
+
documentId: z.string().describe('Document ID to delete'),
|
|
11
|
+
});
|
|
12
|
+
/**
|
|
13
|
+
* Delete a document from the index
|
|
14
|
+
*/
|
|
15
|
+
export async function deleteDocument(client, input) {
|
|
16
|
+
const params = validateInput(DeleteDocumentSchema, input);
|
|
17
|
+
return client.deleteDocument(params.domain, params.source, params.entity, params.documentId);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* MCP Tool Definition for deleting documents
|
|
21
|
+
*/
|
|
22
|
+
export const deleteDocumentTool = {
|
|
23
|
+
name: 'sitecore_delete_document',
|
|
24
|
+
description: 'Delete a document from the Sitecore Search index by its ID.',
|
|
25
|
+
inputSchema: DeleteDocumentSchema,
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=delete-document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-document.js","sourceRoot":"","sources":["../../../src/tools/ingestion/delete-document.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC;IACxC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;IAChD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC;IAC1C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;CACzD,CAAC,CAAC;AAIH;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAAuB,EACvB,KAAc;IAEd,MAAM,MAAM,GAAG,aAAa,CAAC,oBAAoB,EAAE,KAAK,CAAC,CAAC;IAC1D,OAAO,MAAM,CAAC,cAAc,CAC1B,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,UAAU,CAClB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,0BAA0B;IAChC,WAAW,EAAE,6DAA6D;IAC1E,WAAW,EAAE,oBAAoB;CAClC,CAAC"}
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { IngestionClient } from '../../client/ingestion-client.js';
|
|
3
|
+
/**
|
|
4
|
+
* Schema for ingesting from file or URL
|
|
5
|
+
*/
|
|
6
|
+
export declare const IngestFromSourceSchema: z.ZodObject<{
|
|
7
|
+
domain: z.ZodString;
|
|
8
|
+
source: z.ZodString;
|
|
9
|
+
entity: z.ZodString;
|
|
10
|
+
documentId: z.ZodString;
|
|
11
|
+
sourceType: z.ZodEnum<["file", "url"]>;
|
|
12
|
+
sourceUrl: z.ZodString;
|
|
13
|
+
extractors: z.ZodOptional<z.ZodObject<{
|
|
14
|
+
xpath: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
15
|
+
name: z.ZodString;
|
|
16
|
+
expression: z.ZodString;
|
|
17
|
+
}, "strip", z.ZodTypeAny, {
|
|
18
|
+
name: string;
|
|
19
|
+
expression: string;
|
|
20
|
+
}, {
|
|
21
|
+
name: string;
|
|
22
|
+
expression: string;
|
|
23
|
+
}>, "many">>;
|
|
24
|
+
javascript: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
25
|
+
name: z.ZodString;
|
|
26
|
+
expression: z.ZodString;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
name: string;
|
|
29
|
+
expression: string;
|
|
30
|
+
}, {
|
|
31
|
+
name: string;
|
|
32
|
+
expression: string;
|
|
33
|
+
}>, "many">>;
|
|
34
|
+
css: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
35
|
+
name: z.ZodString;
|
|
36
|
+
selector: z.ZodString;
|
|
37
|
+
}, "strip", z.ZodTypeAny, {
|
|
38
|
+
name: string;
|
|
39
|
+
selector: string;
|
|
40
|
+
}, {
|
|
41
|
+
name: string;
|
|
42
|
+
selector: string;
|
|
43
|
+
}>, "many">>;
|
|
44
|
+
}, "strip", z.ZodTypeAny, {
|
|
45
|
+
xpath?: {
|
|
46
|
+
name: string;
|
|
47
|
+
expression: string;
|
|
48
|
+
}[] | undefined;
|
|
49
|
+
javascript?: {
|
|
50
|
+
name: string;
|
|
51
|
+
expression: string;
|
|
52
|
+
}[] | undefined;
|
|
53
|
+
css?: {
|
|
54
|
+
name: string;
|
|
55
|
+
selector: string;
|
|
56
|
+
}[] | undefined;
|
|
57
|
+
}, {
|
|
58
|
+
xpath?: {
|
|
59
|
+
name: string;
|
|
60
|
+
expression: string;
|
|
61
|
+
}[] | undefined;
|
|
62
|
+
javascript?: {
|
|
63
|
+
name: string;
|
|
64
|
+
expression: string;
|
|
65
|
+
}[] | undefined;
|
|
66
|
+
css?: {
|
|
67
|
+
name: string;
|
|
68
|
+
selector: string;
|
|
69
|
+
}[] | undefined;
|
|
70
|
+
}>>;
|
|
71
|
+
}, "strip", z.ZodTypeAny, {
|
|
72
|
+
entity: string;
|
|
73
|
+
domain: string;
|
|
74
|
+
source: string;
|
|
75
|
+
documentId: string;
|
|
76
|
+
sourceType: "url" | "file";
|
|
77
|
+
sourceUrl: string;
|
|
78
|
+
extractors?: {
|
|
79
|
+
xpath?: {
|
|
80
|
+
name: string;
|
|
81
|
+
expression: string;
|
|
82
|
+
}[] | undefined;
|
|
83
|
+
javascript?: {
|
|
84
|
+
name: string;
|
|
85
|
+
expression: string;
|
|
86
|
+
}[] | undefined;
|
|
87
|
+
css?: {
|
|
88
|
+
name: string;
|
|
89
|
+
selector: string;
|
|
90
|
+
}[] | undefined;
|
|
91
|
+
} | undefined;
|
|
92
|
+
}, {
|
|
93
|
+
entity: string;
|
|
94
|
+
domain: string;
|
|
95
|
+
source: string;
|
|
96
|
+
documentId: string;
|
|
97
|
+
sourceType: "url" | "file";
|
|
98
|
+
sourceUrl: string;
|
|
99
|
+
extractors?: {
|
|
100
|
+
xpath?: {
|
|
101
|
+
name: string;
|
|
102
|
+
expression: string;
|
|
103
|
+
}[] | undefined;
|
|
104
|
+
javascript?: {
|
|
105
|
+
name: string;
|
|
106
|
+
expression: string;
|
|
107
|
+
}[] | undefined;
|
|
108
|
+
css?: {
|
|
109
|
+
name: string;
|
|
110
|
+
selector: string;
|
|
111
|
+
}[] | undefined;
|
|
112
|
+
} | undefined;
|
|
113
|
+
}>;
|
|
114
|
+
export type IngestFromSourceInput = z.infer<typeof IngestFromSourceSchema>;
|
|
115
|
+
/**
|
|
116
|
+
* Ingest document from file or URL
|
|
117
|
+
*/
|
|
118
|
+
export declare function ingestFromSource(client: IngestionClient, input: unknown): Promise<import("../../client/ingestion-client.js").IngestionResponse>;
|
|
119
|
+
/**
|
|
120
|
+
* MCP Tool Definition for ingesting from external sources
|
|
121
|
+
*/
|
|
122
|
+
export declare const ingestFromSourceTool: {
|
|
123
|
+
name: string;
|
|
124
|
+
description: string;
|
|
125
|
+
inputSchema: z.ZodObject<{
|
|
126
|
+
domain: z.ZodString;
|
|
127
|
+
source: z.ZodString;
|
|
128
|
+
entity: z.ZodString;
|
|
129
|
+
documentId: z.ZodString;
|
|
130
|
+
sourceType: z.ZodEnum<["file", "url"]>;
|
|
131
|
+
sourceUrl: z.ZodString;
|
|
132
|
+
extractors: z.ZodOptional<z.ZodObject<{
|
|
133
|
+
xpath: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
134
|
+
name: z.ZodString;
|
|
135
|
+
expression: z.ZodString;
|
|
136
|
+
}, "strip", z.ZodTypeAny, {
|
|
137
|
+
name: string;
|
|
138
|
+
expression: string;
|
|
139
|
+
}, {
|
|
140
|
+
name: string;
|
|
141
|
+
expression: string;
|
|
142
|
+
}>, "many">>;
|
|
143
|
+
javascript: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
144
|
+
name: z.ZodString;
|
|
145
|
+
expression: z.ZodString;
|
|
146
|
+
}, "strip", z.ZodTypeAny, {
|
|
147
|
+
name: string;
|
|
148
|
+
expression: string;
|
|
149
|
+
}, {
|
|
150
|
+
name: string;
|
|
151
|
+
expression: string;
|
|
152
|
+
}>, "many">>;
|
|
153
|
+
css: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
154
|
+
name: z.ZodString;
|
|
155
|
+
selector: z.ZodString;
|
|
156
|
+
}, "strip", z.ZodTypeAny, {
|
|
157
|
+
name: string;
|
|
158
|
+
selector: string;
|
|
159
|
+
}, {
|
|
160
|
+
name: string;
|
|
161
|
+
selector: string;
|
|
162
|
+
}>, "many">>;
|
|
163
|
+
}, "strip", z.ZodTypeAny, {
|
|
164
|
+
xpath?: {
|
|
165
|
+
name: string;
|
|
166
|
+
expression: string;
|
|
167
|
+
}[] | undefined;
|
|
168
|
+
javascript?: {
|
|
169
|
+
name: string;
|
|
170
|
+
expression: string;
|
|
171
|
+
}[] | undefined;
|
|
172
|
+
css?: {
|
|
173
|
+
name: string;
|
|
174
|
+
selector: string;
|
|
175
|
+
}[] | undefined;
|
|
176
|
+
}, {
|
|
177
|
+
xpath?: {
|
|
178
|
+
name: string;
|
|
179
|
+
expression: string;
|
|
180
|
+
}[] | undefined;
|
|
181
|
+
javascript?: {
|
|
182
|
+
name: string;
|
|
183
|
+
expression: string;
|
|
184
|
+
}[] | undefined;
|
|
185
|
+
css?: {
|
|
186
|
+
name: string;
|
|
187
|
+
selector: string;
|
|
188
|
+
}[] | undefined;
|
|
189
|
+
}>>;
|
|
190
|
+
}, "strip", z.ZodTypeAny, {
|
|
191
|
+
entity: string;
|
|
192
|
+
domain: string;
|
|
193
|
+
source: string;
|
|
194
|
+
documentId: string;
|
|
195
|
+
sourceType: "url" | "file";
|
|
196
|
+
sourceUrl: string;
|
|
197
|
+
extractors?: {
|
|
198
|
+
xpath?: {
|
|
199
|
+
name: string;
|
|
200
|
+
expression: string;
|
|
201
|
+
}[] | undefined;
|
|
202
|
+
javascript?: {
|
|
203
|
+
name: string;
|
|
204
|
+
expression: string;
|
|
205
|
+
}[] | undefined;
|
|
206
|
+
css?: {
|
|
207
|
+
name: string;
|
|
208
|
+
selector: string;
|
|
209
|
+
}[] | undefined;
|
|
210
|
+
} | undefined;
|
|
211
|
+
}, {
|
|
212
|
+
entity: string;
|
|
213
|
+
domain: string;
|
|
214
|
+
source: string;
|
|
215
|
+
documentId: string;
|
|
216
|
+
sourceType: "url" | "file";
|
|
217
|
+
sourceUrl: string;
|
|
218
|
+
extractors?: {
|
|
219
|
+
xpath?: {
|
|
220
|
+
name: string;
|
|
221
|
+
expression: string;
|
|
222
|
+
}[] | undefined;
|
|
223
|
+
javascript?: {
|
|
224
|
+
name: string;
|
|
225
|
+
expression: string;
|
|
226
|
+
}[] | undefined;
|
|
227
|
+
css?: {
|
|
228
|
+
name: string;
|
|
229
|
+
selector: string;
|
|
230
|
+
}[] | undefined;
|
|
231
|
+
} | undefined;
|
|
232
|
+
}>;
|
|
233
|
+
};
|
|
234
|
+
//# sourceMappingURL=ingest-from-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ingest-from-source.d.ts","sourceRoot":"","sources":["../../../src/tools/ingestion/ingest-from-source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAsB,MAAM,kCAAkC,CAAC;AAGvF;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqBjC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE3E;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,OAAO,yEAuBf;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIhC,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { validateInput } from '../../utils/errors.js';
|
|
3
|
+
/**
|
|
4
|
+
* Schema for ingesting from file or URL
|
|
5
|
+
*/
|
|
6
|
+
export const IngestFromSourceSchema = z.object({
|
|
7
|
+
domain: z.string().describe('Domain ID'),
|
|
8
|
+
source: z.string().describe('Source identifier'),
|
|
9
|
+
entity: z.string().describe('Entity type'),
|
|
10
|
+
documentId: z.string().describe('Document ID for the ingested content'),
|
|
11
|
+
sourceType: z.enum(['file', 'url']).describe('Type of source: file or url'),
|
|
12
|
+
sourceUrl: z.string().url().describe('URL to the file or web page to ingest'),
|
|
13
|
+
extractors: z.object({
|
|
14
|
+
xpath: z.array(z.object({
|
|
15
|
+
name: z.string(),
|
|
16
|
+
expression: z.string(),
|
|
17
|
+
})).optional().describe('XPath extractors for parsing content'),
|
|
18
|
+
javascript: z.array(z.object({
|
|
19
|
+
name: z.string(),
|
|
20
|
+
expression: z.string(),
|
|
21
|
+
})).optional().describe('JavaScript extractors for parsing content'),
|
|
22
|
+
css: z.array(z.object({
|
|
23
|
+
name: z.string(),
|
|
24
|
+
selector: z.string(),
|
|
25
|
+
})).optional().describe('CSS selector extractors for parsing content'),
|
|
26
|
+
}).optional().describe('Content extractors for parsing the source'),
|
|
27
|
+
});
|
|
28
|
+
/**
|
|
29
|
+
* Ingest document from file or URL
|
|
30
|
+
*/
|
|
31
|
+
export async function ingestFromSource(client, input) {
|
|
32
|
+
const params = validateInput(IngestFromSourceSchema, input);
|
|
33
|
+
if (params.sourceType === 'file') {
|
|
34
|
+
return client.createDocumentFromFile(params.domain, params.source, params.entity, params.documentId, params.sourceUrl, params.extractors);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
return client.createDocumentFromUrl(params.domain, params.source, params.entity, params.documentId, params.sourceUrl, params.extractors);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* MCP Tool Definition for ingesting from external sources
|
|
42
|
+
*/
|
|
43
|
+
export const ingestFromSourceTool = {
|
|
44
|
+
name: 'sitecore_ingest_from_source',
|
|
45
|
+
description: 'Ingest a document from an external file or URL. Supports XPath, JavaScript, and CSS extractors for parsing content.',
|
|
46
|
+
inputSchema: IngestFromSourceSchema,
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=ingest-from-source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ingest-from-source.js","sourceRoot":"","sources":["../../../src/tools/ingestion/ingest-from-source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC;IACxC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;IAChD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC;IAC1C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sCAAsC,CAAC;IACvE,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,6BAA6B,CAAC;IAC3E,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;IAC7E,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC;QACnB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;YACtB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;YAChB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;SACvB,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sCAAsC,CAAC;QAC/D,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;YAC3B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;YAChB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;SACvB,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;QACpE,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;YACpB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;YAChB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;SACrB,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6CAA6C,CAAC;KACvE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;CACpE,CAAC,CAAC;AAIH;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,MAAuB,EACvB,KAAc;IAEd,MAAM,MAAM,GAAG,aAAa,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;IAE5D,IAAI,MAAM,CAAC,UAAU,KAAK,MAAM,EAAE,CAAC;QACjC,OAAO,MAAM,CAAC,sBAAsB,CAClC,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,UAAU,EACjB,MAAM,CAAC,SAAS,EAChB,MAAM,CAAC,UAAgC,CACxC,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO,MAAM,CAAC,qBAAqB,CACjC,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,UAAU,EACjB,MAAM,CAAC,SAAS,EAChB,MAAM,CAAC,UAAgC,CACxC,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,IAAI,EAAE,6BAA6B;IACnC,WAAW,EAAE,qHAAqH;IAClI,WAAW,EAAE,sBAAsB;CACpC,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { IngestionClient } from '../../client/ingestion-client.js';
|
|
3
|
+
/**
|
|
4
|
+
* Schema for updating a document
|
|
5
|
+
*/
|
|
6
|
+
export declare const UpdateDocumentSchema: z.ZodObject<{
|
|
7
|
+
domain: z.ZodString;
|
|
8
|
+
source: z.ZodString;
|
|
9
|
+
entity: z.ZodString;
|
|
10
|
+
documentId: z.ZodString;
|
|
11
|
+
document: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
12
|
+
partial: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
partial: boolean;
|
|
15
|
+
document: Record<string, unknown>;
|
|
16
|
+
entity: string;
|
|
17
|
+
domain: string;
|
|
18
|
+
source: string;
|
|
19
|
+
documentId: string;
|
|
20
|
+
}, {
|
|
21
|
+
document: Record<string, unknown>;
|
|
22
|
+
entity: string;
|
|
23
|
+
domain: string;
|
|
24
|
+
source: string;
|
|
25
|
+
documentId: string;
|
|
26
|
+
partial?: boolean | undefined;
|
|
27
|
+
}>;
|
|
28
|
+
export type UpdateDocumentInput = z.infer<typeof UpdateDocumentSchema>;
|
|
29
|
+
/**
|
|
30
|
+
* Update an existing document
|
|
31
|
+
*/
|
|
32
|
+
export declare function updateDocument(client: IngestionClient, input: unknown): Promise<import("../../client/ingestion-client.js").IngestionResponse>;
|
|
33
|
+
/**
|
|
34
|
+
* MCP Tool Definition for updating documents
|
|
35
|
+
*/
|
|
36
|
+
export declare const updateDocumentTool: {
|
|
37
|
+
name: string;
|
|
38
|
+
description: string;
|
|
39
|
+
inputSchema: z.ZodObject<{
|
|
40
|
+
domain: z.ZodString;
|
|
41
|
+
source: z.ZodString;
|
|
42
|
+
entity: z.ZodString;
|
|
43
|
+
documentId: z.ZodString;
|
|
44
|
+
document: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
45
|
+
partial: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
46
|
+
}, "strip", z.ZodTypeAny, {
|
|
47
|
+
partial: boolean;
|
|
48
|
+
document: Record<string, unknown>;
|
|
49
|
+
entity: string;
|
|
50
|
+
domain: string;
|
|
51
|
+
source: string;
|
|
52
|
+
documentId: string;
|
|
53
|
+
}, {
|
|
54
|
+
document: Record<string, unknown>;
|
|
55
|
+
entity: string;
|
|
56
|
+
domain: string;
|
|
57
|
+
source: string;
|
|
58
|
+
documentId: string;
|
|
59
|
+
partial?: boolean | undefined;
|
|
60
|
+
}>;
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=update-document.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-document.d.ts","sourceRoot":"","sources":["../../../src/tools/ingestion/update-document.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAmB,MAAM,kCAAkC,CAAC;AAGpF;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;EAO/B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAEvE;;GAEG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,OAAO,yEAqBf;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;CAI9B,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { validateInput } from '../../utils/errors.js';
|
|
3
|
+
/**
|
|
4
|
+
* Schema for updating a document
|
|
5
|
+
*/
|
|
6
|
+
export const UpdateDocumentSchema = z.object({
|
|
7
|
+
domain: z.string().describe('Domain ID'),
|
|
8
|
+
source: z.string().describe('Source identifier'),
|
|
9
|
+
entity: z.string().describe('Entity type'),
|
|
10
|
+
documentId: z.string().describe('Document ID to update'),
|
|
11
|
+
document: z.record(z.unknown()).describe('Complete document data (full replacement)'),
|
|
12
|
+
partial: z.boolean().optional().default(false).describe('If true, performs partial update (PATCH); if false, performs full replacement (PUT)'),
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* Update an existing document
|
|
16
|
+
*/
|
|
17
|
+
export async function updateDocument(client, input) {
|
|
18
|
+
const params = validateInput(UpdateDocumentSchema, input);
|
|
19
|
+
if (params.partial) {
|
|
20
|
+
return client.patchDocument(params.domain, params.source, params.entity, params.documentId, params.document);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
return client.updateDocument(params.domain, params.source, params.entity, params.documentId, params.document);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* MCP Tool Definition for updating documents
|
|
28
|
+
*/
|
|
29
|
+
export const updateDocumentTool = {
|
|
30
|
+
name: 'sitecore_update_document',
|
|
31
|
+
description: 'Update an existing document in the Sitecore Search index. Use partial=true for partial updates or partial=false for full replacement.',
|
|
32
|
+
inputSchema: UpdateDocumentSchema,
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=update-document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-document.js","sourceRoot":"","sources":["../../../src/tools/ingestion/update-document.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC;IACxC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;IAChD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC;IAC1C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;IACxD,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,2CAA2C,CAAC;IACrF,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,qFAAqF,CAAC;CAC/I,CAAC,CAAC;AAIH;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAAuB,EACvB,KAAc;IAEd,MAAM,MAAM,GAAG,aAAa,CAAC,oBAAoB,EAAE,KAAK,CAAC,CAAC;IAE1D,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,OAAO,MAAM,CAAC,aAAa,CACzB,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,UAAU,EACjB,MAAM,CAAC,QAAoC,CAC5C,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO,MAAM,CAAC,cAAc,CAC1B,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,UAAU,EACjB,MAAM,CAAC,QAA2B,CACnC,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,0BAA0B;IAChC,WAAW,EAAE,uIAAuI;IACpJ,WAAW,EAAE,oBAAoB;CAClC,CAAC"}
|