@draftt-io/draftt-mcp 1.0.1

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.
Files changed (66) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +117 -0
  3. package/dist/api/client.d.ts +20 -0
  4. package/dist/api/client.js +93 -0
  5. package/dist/api/client.js.map +1 -0
  6. package/dist/api/drafttClient.d.ts +20 -0
  7. package/dist/api/drafttClient.js +90 -0
  8. package/dist/api/drafttClient.js.map +1 -0
  9. package/dist/api/responseFormatter.d.ts +13 -0
  10. package/dist/api/responseFormatter.js +21 -0
  11. package/dist/api/responseFormatter.js.map +1 -0
  12. package/dist/drafttClient.d.ts +17 -0
  13. package/dist/drafttClient.js +187 -0
  14. package/dist/drafttClient.js.map +1 -0
  15. package/dist/handlers/componentHandler.d.ts +18 -0
  16. package/dist/handlers/componentHandler.js +46 -0
  17. package/dist/handlers/componentHandler.js.map +1 -0
  18. package/dist/handlers/drafttHandler.d.ts +12 -0
  19. package/dist/handlers/drafttHandler.js +31 -0
  20. package/dist/handlers/drafttHandler.js.map +1 -0
  21. package/dist/handlers/policyHandler.d.ts +31 -0
  22. package/dist/handlers/policyHandler.js +85 -0
  23. package/dist/handlers/policyHandler.js.map +1 -0
  24. package/dist/helpers/constants.d.ts +31 -0
  25. package/dist/helpers/constants.js +37 -0
  26. package/dist/helpers/constants.js.map +1 -0
  27. package/dist/index.d.ts +2 -0
  28. package/dist/index.js +121 -0
  29. package/dist/index.js.map +1 -0
  30. package/dist/interfaces/component.d.ts +60 -0
  31. package/dist/interfaces/component.js +3 -0
  32. package/dist/interfaces/component.js.map +1 -0
  33. package/dist/interfaces/draftt.d.ts +3 -0
  34. package/dist/interfaces/draftt.js +3 -0
  35. package/dist/interfaces/draftt.js.map +1 -0
  36. package/dist/interfaces/policy.d.ts +21 -0
  37. package/dist/interfaces/policy.js +3 -0
  38. package/dist/interfaces/policy.js.map +1 -0
  39. package/dist/models/component.d.ts +60 -0
  40. package/dist/models/component.js +3 -0
  41. package/dist/models/component.js.map +1 -0
  42. package/dist/models/draftt.d.ts +3 -0
  43. package/dist/models/draftt.js +3 -0
  44. package/dist/models/draftt.js.map +1 -0
  45. package/dist/models/policy.d.ts +21 -0
  46. package/dist/models/policy.js +3 -0
  47. package/dist/models/policy.js.map +1 -0
  48. package/dist/schemas/componentSchema.d.ts +278 -0
  49. package/dist/schemas/componentSchema.js +87 -0
  50. package/dist/schemas/componentSchema.js.map +1 -0
  51. package/dist/schemas/drafttSchema.d.ts +4 -0
  52. package/dist/schemas/drafttSchema.js +8 -0
  53. package/dist/schemas/drafttSchema.js.map +1 -0
  54. package/dist/schemas/policySchema.d.ts +100 -0
  55. package/dist/schemas/policySchema.js +33 -0
  56. package/dist/schemas/policySchema.js.map +1 -0
  57. package/dist/tools.d.ts +6 -0
  58. package/dist/tools.js +277 -0
  59. package/dist/tools.js.map +1 -0
  60. package/dist/utils/constants.d.ts +31 -0
  61. package/dist/utils/constants.js +37 -0
  62. package/dist/utils/constants.js.map +1 -0
  63. package/dist/utils/logger.d.ts +3 -0
  64. package/dist/utils/logger.js +52 -0
  65. package/dist/utils/logger.js.map +1 -0
  66. package/package.json +52 -0
package/dist/index.js ADDED
@@ -0,0 +1,121 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
8
+ const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
9
+ const minimist_1 = __importDefault(require("minimist"));
10
+ const drafttClient_1 = require("./api/drafttClient");
11
+ const componentHandler_1 = require("./handlers/componentHandler");
12
+ const policyHandler_1 = require("./handlers/policyHandler");
13
+ const drafttHandler_1 = require("./handlers/drafttHandler");
14
+ const logger_1 = require("./utils/logger");
15
+ const componentSchema_1 = require("./schemas/componentSchema");
16
+ const policySchema_1 = require("./schemas/policySchema");
17
+ const drafttSchema_1 = require("./schemas/drafttSchema");
18
+ async function main() {
19
+ const argv = (0, minimist_1.default)(process.argv.slice(2));
20
+ const accessKey = argv["access-key"] || process.env.DRAFTT_ACCESS_KEY;
21
+ const debug = argv["debug"] || false;
22
+ // Set up logging
23
+ const logger = (0, logger_1.setupLogger)(debug);
24
+ logger.info("Starting Draftt MCP Server...");
25
+ if (!accessKey) {
26
+ logger.error("Missing access-key");
27
+ throw new Error("Missing access-key. Please provide one via --access-key or DRAFTT_ACCESS_KEY environment variable");
28
+ }
29
+ // Create API client
30
+ const drafttClient = new drafttClient_1.DrafttClient(logger, accessKey);
31
+ // Create handlers
32
+ const componentHandler = new componentHandler_1.ComponentHandler(drafttClient);
33
+ const policyHandler = new policyHandler_1.PolicyHandler(drafttClient);
34
+ const drafttHandler = new drafttHandler_1.DrafttHandler(drafttClient);
35
+ // Create MCP server
36
+ const server = new mcp_js_1.McpServer({
37
+ name: "Draftt MCP Server",
38
+ version: "1.0.0",
39
+ });
40
+ // Register tools
41
+ server.tool("draftt_component_search", "Search for components in Draftt", componentSchema_1.componentSearchSchema, async (args) => {
42
+ const result = await componentHandler.search(args);
43
+ return {
44
+ content: result.content.map(item => ({
45
+ type: "text",
46
+ text: item.text
47
+ }))
48
+ };
49
+ });
50
+ server.tool("draftt_component_get", "Get a detailed information about a component in Draftt", componentSchema_1.componentGetSchema, async (args) => {
51
+ const result = await componentHandler.get(args);
52
+ return {
53
+ content: result.content.map(item => ({
54
+ type: "text",
55
+ text: item.text
56
+ }))
57
+ };
58
+ });
59
+ server.tool("draftt_policy_search", "Search for policies in Draftt", policySchema_1.policySearchSchema, async (args) => {
60
+ const result = await policyHandler.search(args);
61
+ return {
62
+ content: result.content.map(item => ({
63
+ type: "text",
64
+ text: item.text
65
+ }))
66
+ };
67
+ });
68
+ server.tool("draftt_policy_get", "Get a detailed information about a policy in Draftt", policySchema_1.policyGetSchema, async (args) => {
69
+ const result = await policyHandler.get(args);
70
+ return {
71
+ content: result.content.map(item => ({
72
+ type: "text",
73
+ text: item.text
74
+ }))
75
+ };
76
+ });
77
+ server.tool("draftt_component_policy_search", "Search for components policies in Draftt", componentSchema_1.policyComponentSearchSchema, async (args) => {
78
+ const result = await policyHandler.componentSearch(args);
79
+ return {
80
+ content: result.content.map(item => ({
81
+ type: "text",
82
+ text: item.text
83
+ }))
84
+ };
85
+ });
86
+ server.tool("draftt_component_policy_get", "Get a specific information about a component policy in Draftt", componentSchema_1.policyComponentGetSchema, async (args) => {
87
+ const result = await policyHandler.componentGet(args);
88
+ return {
89
+ content: result.content.map(item => ({
90
+ type: "text",
91
+ text: item.text
92
+ }))
93
+ };
94
+ });
95
+ server.tool("draftt_get", "Get a draftt (k8s upgrade guide) for a k8s component", drafttSchema_1.drafttGetSchema, async (args) => {
96
+ const result = await drafttHandler.get(args);
97
+ return {
98
+ content: result.content.map(item => ({
99
+ type: "text",
100
+ text: item.text
101
+ }))
102
+ };
103
+ });
104
+ // Connect to transport
105
+ const transport = new stdio_js_1.StdioServerTransport();
106
+ logger.info("Connecting server to transport...");
107
+ try {
108
+ await server.connect(transport);
109
+ logger.info("Server connected to transport");
110
+ }
111
+ catch (error) {
112
+ logger.error("Error connecting to transport:", error);
113
+ process.exit(1);
114
+ }
115
+ }
116
+ main().catch((error) => {
117
+ const logger = (0, logger_1.getLogger)();
118
+ logger.error("Fatal error in main():", error);
119
+ process.exit(1);
120
+ });
121
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AACA,oEAAoE;AACpE,wEAAiF;AACjF,wDAAgC;AAEhC,qDAAkD;AAClD,kEAA+D;AAC/D,4DAAyD;AACzD,4DAAyD;AACzD,2CAAwD;AAExD,+DAA6I;AAC7I,yDAA6E;AAC7E,yDAAyD;AAGzD,KAAK,UAAU,IAAI;IACf,MA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,+BAAoB,EAAE,CAAC;IAC7C,MAAM,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC;IAEjD,IAAI,CAAC;QACD,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAChC,MAAM,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;IACjD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,MAAM,CAAC,KAAK,CAAC,gCAAgC,EAAE,KAAK,CAAC,CAAC;QACtD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;AACL,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACnB,MAAM,MAAM,GAAG,IAAA,kBAAS,GAAE,CAAC;IAC3B,MAAM,CAAC,KAAK,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;IAC9C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,60 @@
1
+ import { SortParams, DateRangeFilter, TagFilter, ComponentType, Technology, Region, SortDirection } from "../helpers/constants";
2
+ export interface ComponentSearchArgs {
3
+ integrationId?: string;
4
+ uniqueIdentifier?: string;
5
+ region?: Region[];
6
+ technology?: Technology[];
7
+ type?: ComponentType[];
8
+ version?: string;
9
+ tags?: TagFilter[];
10
+ createdAt?: DateRangeFilter;
11
+ updatedAt?: DateRangeFilter;
12
+ sort?: SortParams;
13
+ nextToken?: string;
14
+ pageSize?: number;
15
+ }
16
+ export interface ComponentGetArgs {
17
+ componentId: string;
18
+ }
19
+ export interface PolicyComponentSortParams {
20
+ componentId?: SortDirection;
21
+ integrationId?: SortDirection;
22
+ name?: SortDirection;
23
+ technology?: SortDirection;
24
+ type?: SortDirection;
25
+ urgency?: SortDirection;
26
+ priority?: SortDirection;
27
+ isCompliant?: SortDirection;
28
+ requiredVersion?: SortDirection;
29
+ desiredVersion?: SortDirection;
30
+ recommendedVersion?: SortDirection;
31
+ dueDate?: SortDirection;
32
+ tags?: SortDirection;
33
+ createdAt?: SortDirection;
34
+ updatedAt?: SortDirection;
35
+ }
36
+ export interface PolicyComponentSearchArgs {
37
+ policyId: string;
38
+ componentId?: number;
39
+ integrationId?: number;
40
+ name?: string;
41
+ technology?: Technology[];
42
+ type?: ComponentType[];
43
+ urgency?: number;
44
+ priority?: number;
45
+ isCompliant?: boolean;
46
+ requiredVersion?: string;
47
+ desiredVersion?: string;
48
+ recommendedVersion?: string;
49
+ dueDate?: DateRangeFilter;
50
+ tags?: TagFilter[];
51
+ createdAt?: DateRangeFilter;
52
+ updatedAt?: DateRangeFilter;
53
+ sort?: PolicyComponentSortParams;
54
+ nextToken?: string;
55
+ pageSize?: number;
56
+ }
57
+ export interface PolicyComponentGetArgs {
58
+ policyId: string;
59
+ componentId: string;
60
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.js","sourceRoot":"","sources":["../../src/interfaces/component.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ export interface DrafttGetArgs {
2
+ componentId: string;
3
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=draftt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draftt.js","sourceRoot":"","sources":["../../src/interfaces/draftt.ts"],"names":[],"mappings":""}
@@ -0,0 +1,21 @@
1
+ import { DateRangeFilter, SortDirection, SortParams } from "../helpers/constants";
2
+ export interface PolicySortParams extends SortParams {
3
+ name?: SortDirection;
4
+ description?: SortDirection;
5
+ createdAt?: SortDirection;
6
+ updatedAt?: SortDirection;
7
+ }
8
+ export interface PolicySearchArgs {
9
+ filter?: {
10
+ name?: string;
11
+ description?: string;
12
+ createdAt?: DateRangeFilter;
13
+ updatedAt?: DateRangeFilter;
14
+ };
15
+ sort?: PolicySortParams;
16
+ nextToken?: string;
17
+ pageSize?: number;
18
+ }
19
+ export interface PolicyGetArgs {
20
+ policyId: string;
21
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=policy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"policy.js","sourceRoot":"","sources":["../../src/interfaces/policy.ts"],"names":[],"mappings":""}
@@ -0,0 +1,60 @@
1
+ import { SortParams, DateRangeFilter, TagFilter, ComponentType, Technology, Region, SortDirection } from "../utils/constants";
2
+ export interface ComponentSearchArgs {
3
+ integrationId?: string;
4
+ uniqueIdentifier?: string;
5
+ region?: Region[];
6
+ technology?: Technology[];
7
+ type?: ComponentType[];
8
+ version?: string;
9
+ tags?: TagFilter[];
10
+ createdAt?: DateRangeFilter;
11
+ updatedAt?: DateRangeFilter;
12
+ sort?: SortParams;
13
+ nextToken?: string;
14
+ pageSize?: number;
15
+ }
16
+ export interface ComponentGetArgs {
17
+ componentId: string;
18
+ }
19
+ export interface PolicyComponentSortParams {
20
+ componentId?: SortDirection;
21
+ integrationId?: SortDirection;
22
+ name?: SortDirection;
23
+ technology?: SortDirection;
24
+ type?: SortDirection;
25
+ urgency?: SortDirection;
26
+ priority?: SortDirection;
27
+ isCompliant?: SortDirection;
28
+ requiredVersion?: SortDirection;
29
+ desiredVersion?: SortDirection;
30
+ recommendedVersion?: SortDirection;
31
+ dueDate?: SortDirection;
32
+ tags?: SortDirection;
33
+ createdAt?: SortDirection;
34
+ updatedAt?: SortDirection;
35
+ }
36
+ export interface PolicyComponentSearchArgs {
37
+ policyId: string;
38
+ componentId?: number;
39
+ integrationId?: number;
40
+ name?: string;
41
+ technology?: Technology[];
42
+ type?: ComponentType[];
43
+ urgency?: number;
44
+ priority?: number;
45
+ isCompliant?: boolean;
46
+ requiredVersion?: string;
47
+ desiredVersion?: string;
48
+ recommendedVersion?: string;
49
+ dueDate?: DateRangeFilter;
50
+ tags?: TagFilter[];
51
+ createdAt?: DateRangeFilter;
52
+ updatedAt?: DateRangeFilter;
53
+ sort?: PolicyComponentSortParams;
54
+ nextToken?: string;
55
+ pageSize?: number;
56
+ }
57
+ export interface PolicyComponentGetArgs {
58
+ policyId: string;
59
+ componentId: string;
60
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.js","sourceRoot":"","sources":["../../src/models/component.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ export interface DrafttGetArgs {
2
+ componentId: string;
3
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=draftt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draftt.js","sourceRoot":"","sources":["../../src/models/draftt.ts"],"names":[],"mappings":""}
@@ -0,0 +1,21 @@
1
+ import { DateRangeFilter, SortDirection, SortParams } from "../utils/constants";
2
+ export interface PolicySortParams extends SortParams {
3
+ name?: SortDirection;
4
+ description?: SortDirection;
5
+ createdAt?: SortDirection;
6
+ updatedAt?: SortDirection;
7
+ }
8
+ export interface PolicySearchArgs {
9
+ filter?: {
10
+ name?: string;
11
+ description?: string;
12
+ createdAt?: DateRangeFilter;
13
+ updatedAt?: DateRangeFilter;
14
+ };
15
+ sort?: PolicySortParams;
16
+ nextToken?: string;
17
+ pageSize?: number;
18
+ }
19
+ export interface PolicyGetArgs {
20
+ policyId: string;
21
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=policy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"policy.js","sourceRoot":"","sources":["../../src/models/policy.ts"],"names":[],"mappings":""}
@@ -0,0 +1,278 @@
1
+ import { z } from "zod";
2
+ export declare const componentSearchSchema: {
3
+ integrationId: z.ZodOptional<z.ZodString>;
4
+ uniqueIdentifier: z.ZodOptional<z.ZodString>;
5
+ region: z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
6
+ technology: z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
7
+ type: z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
8
+ version: z.ZodOptional<z.ZodString>;
9
+ tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
10
+ key: z.ZodString;
11
+ value: z.ZodString;
12
+ }, "strip", z.ZodTypeAny, {
13
+ key: string;
14
+ value: string;
15
+ }, {
16
+ key: string;
17
+ value: string;
18
+ }>, "many">>;
19
+ createdAt: z.ZodOptional<z.ZodObject<{
20
+ eq: z.ZodOptional<z.ZodOptional<z.ZodString>>;
21
+ gt: z.ZodOptional<z.ZodOptional<z.ZodString>>;
22
+ gte: z.ZodOptional<z.ZodOptional<z.ZodString>>;
23
+ lt: z.ZodOptional<z.ZodOptional<z.ZodString>>;
24
+ lte: z.ZodOptional<z.ZodOptional<z.ZodString>>;
25
+ }, "strip", z.ZodTypeAny, {
26
+ eq?: string | undefined;
27
+ gt?: string | undefined;
28
+ gte?: string | undefined;
29
+ lt?: string | undefined;
30
+ lte?: string | undefined;
31
+ }, {
32
+ eq?: string | undefined;
33
+ gt?: string | undefined;
34
+ gte?: string | undefined;
35
+ lt?: string | undefined;
36
+ lte?: string | undefined;
37
+ }>>;
38
+ updatedAt: z.ZodOptional<z.ZodObject<{
39
+ eq: z.ZodOptional<z.ZodOptional<z.ZodString>>;
40
+ gt: z.ZodOptional<z.ZodOptional<z.ZodString>>;
41
+ gte: z.ZodOptional<z.ZodOptional<z.ZodString>>;
42
+ lt: z.ZodOptional<z.ZodOptional<z.ZodString>>;
43
+ lte: z.ZodOptional<z.ZodOptional<z.ZodString>>;
44
+ }, "strip", z.ZodTypeAny, {
45
+ eq?: string | undefined;
46
+ gt?: string | undefined;
47
+ gte?: string | undefined;
48
+ lt?: string | undefined;
49
+ lte?: string | undefined;
50
+ }, {
51
+ eq?: string | undefined;
52
+ gt?: string | undefined;
53
+ gte?: string | undefined;
54
+ lt?: string | undefined;
55
+ lte?: string | undefined;
56
+ }>>;
57
+ sort: z.ZodOptional<z.ZodObject<{
58
+ integrationId: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
59
+ uniqueIdentifier: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
60
+ region: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
61
+ technology: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
62
+ type: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
63
+ version: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
64
+ tags: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
65
+ createdAt: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
66
+ updatedAt: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
67
+ }, "strip", z.ZodTypeAny, {
68
+ type?: "asc" | "desc" | undefined;
69
+ integrationId?: "asc" | "desc" | undefined;
70
+ uniqueIdentifier?: "asc" | "desc" | undefined;
71
+ region?: "asc" | "desc" | undefined;
72
+ technology?: "asc" | "desc" | undefined;
73
+ version?: "asc" | "desc" | undefined;
74
+ tags?: "asc" | "desc" | undefined;
75
+ createdAt?: "asc" | "desc" | undefined;
76
+ updatedAt?: "asc" | "desc" | undefined;
77
+ }, {
78
+ type?: "asc" | "desc" | undefined;
79
+ integrationId?: "asc" | "desc" | undefined;
80
+ uniqueIdentifier?: "asc" | "desc" | undefined;
81
+ region?: "asc" | "desc" | undefined;
82
+ technology?: "asc" | "desc" | undefined;
83
+ version?: "asc" | "desc" | undefined;
84
+ tags?: "asc" | "desc" | undefined;
85
+ createdAt?: "asc" | "desc" | undefined;
86
+ updatedAt?: "asc" | "desc" | undefined;
87
+ }>>;
88
+ nextToken: z.ZodOptional<z.ZodString>;
89
+ pageSize: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
90
+ };
91
+ export declare const componentGetSchema: {
92
+ componentId: z.ZodString;
93
+ };
94
+ export declare const policyComponentSortSchema: z.ZodObject<{
95
+ componentId: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
96
+ integrationId: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
97
+ name: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
98
+ technology: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
99
+ type: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
100
+ urgency: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
101
+ priority: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
102
+ isCompliant: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
103
+ requiredVersion: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
104
+ desiredVersion: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
105
+ recommendedVersion: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
106
+ dueDate: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
107
+ tags: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
108
+ createdAt: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
109
+ updatedAt: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
110
+ }, "strip", z.ZodTypeAny, {
111
+ name?: "asc" | "desc" | undefined;
112
+ type?: "asc" | "desc" | undefined;
113
+ integrationId?: "asc" | "desc" | undefined;
114
+ technology?: "asc" | "desc" | undefined;
115
+ tags?: "asc" | "desc" | undefined;
116
+ createdAt?: "asc" | "desc" | undefined;
117
+ updatedAt?: "asc" | "desc" | undefined;
118
+ componentId?: "asc" | "desc" | undefined;
119
+ urgency?: "asc" | "desc" | undefined;
120
+ priority?: "asc" | "desc" | undefined;
121
+ isCompliant?: "asc" | "desc" | undefined;
122
+ requiredVersion?: "asc" | "desc" | undefined;
123
+ desiredVersion?: "asc" | "desc" | undefined;
124
+ recommendedVersion?: "asc" | "desc" | undefined;
125
+ dueDate?: "asc" | "desc" | undefined;
126
+ }, {
127
+ name?: "asc" | "desc" | undefined;
128
+ type?: "asc" | "desc" | undefined;
129
+ integrationId?: "asc" | "desc" | undefined;
130
+ technology?: "asc" | "desc" | undefined;
131
+ tags?: "asc" | "desc" | undefined;
132
+ createdAt?: "asc" | "desc" | undefined;
133
+ updatedAt?: "asc" | "desc" | undefined;
134
+ componentId?: "asc" | "desc" | undefined;
135
+ urgency?: "asc" | "desc" | undefined;
136
+ priority?: "asc" | "desc" | undefined;
137
+ isCompliant?: "asc" | "desc" | undefined;
138
+ requiredVersion?: "asc" | "desc" | undefined;
139
+ desiredVersion?: "asc" | "desc" | undefined;
140
+ recommendedVersion?: "asc" | "desc" | undefined;
141
+ dueDate?: "asc" | "desc" | undefined;
142
+ }>;
143
+ export declare const policyComponentSearchSchema: {
144
+ policyId: z.ZodString;
145
+ componentId: z.ZodOptional<z.ZodNumber>;
146
+ integrationId: z.ZodOptional<z.ZodNumber>;
147
+ name: z.ZodOptional<z.ZodString>;
148
+ technology: z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
149
+ type: z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
150
+ urgency: z.ZodOptional<z.ZodNumber>;
151
+ priority: z.ZodOptional<z.ZodNumber>;
152
+ isCompliant: z.ZodOptional<z.ZodBoolean>;
153
+ requiredVersion: z.ZodOptional<z.ZodString>;
154
+ desiredVersion: z.ZodOptional<z.ZodString>;
155
+ recommendedVersion: z.ZodOptional<z.ZodString>;
156
+ dueDate: z.ZodOptional<z.ZodObject<{
157
+ eq: z.ZodOptional<z.ZodOptional<z.ZodString>>;
158
+ gt: z.ZodOptional<z.ZodOptional<z.ZodString>>;
159
+ gte: z.ZodOptional<z.ZodOptional<z.ZodString>>;
160
+ lt: z.ZodOptional<z.ZodOptional<z.ZodString>>;
161
+ lte: z.ZodOptional<z.ZodOptional<z.ZodString>>;
162
+ }, "strip", z.ZodTypeAny, {
163
+ eq?: string | undefined;
164
+ gt?: string | undefined;
165
+ gte?: string | undefined;
166
+ lt?: string | undefined;
167
+ lte?: string | undefined;
168
+ }, {
169
+ eq?: string | undefined;
170
+ gt?: string | undefined;
171
+ gte?: string | undefined;
172
+ lt?: string | undefined;
173
+ lte?: string | undefined;
174
+ }>>;
175
+ tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
176
+ key: z.ZodString;
177
+ value: z.ZodString;
178
+ }, "strip", z.ZodTypeAny, {
179
+ key: string;
180
+ value: string;
181
+ }, {
182
+ key: string;
183
+ value: string;
184
+ }>, "many">>;
185
+ createdAt: z.ZodOptional<z.ZodObject<{
186
+ eq: z.ZodOptional<z.ZodOptional<z.ZodString>>;
187
+ gt: z.ZodOptional<z.ZodOptional<z.ZodString>>;
188
+ gte: z.ZodOptional<z.ZodOptional<z.ZodString>>;
189
+ lt: z.ZodOptional<z.ZodOptional<z.ZodString>>;
190
+ lte: z.ZodOptional<z.ZodOptional<z.ZodString>>;
191
+ }, "strip", z.ZodTypeAny, {
192
+ eq?: string | undefined;
193
+ gt?: string | undefined;
194
+ gte?: string | undefined;
195
+ lt?: string | undefined;
196
+ lte?: string | undefined;
197
+ }, {
198
+ eq?: string | undefined;
199
+ gt?: string | undefined;
200
+ gte?: string | undefined;
201
+ lt?: string | undefined;
202
+ lte?: string | undefined;
203
+ }>>;
204
+ updatedAt: z.ZodOptional<z.ZodObject<{
205
+ eq: z.ZodOptional<z.ZodOptional<z.ZodString>>;
206
+ gt: z.ZodOptional<z.ZodOptional<z.ZodString>>;
207
+ gte: z.ZodOptional<z.ZodOptional<z.ZodString>>;
208
+ lt: z.ZodOptional<z.ZodOptional<z.ZodString>>;
209
+ lte: z.ZodOptional<z.ZodOptional<z.ZodString>>;
210
+ }, "strip", z.ZodTypeAny, {
211
+ eq?: string | undefined;
212
+ gt?: string | undefined;
213
+ gte?: string | undefined;
214
+ lt?: string | undefined;
215
+ lte?: string | undefined;
216
+ }, {
217
+ eq?: string | undefined;
218
+ gt?: string | undefined;
219
+ gte?: string | undefined;
220
+ lt?: string | undefined;
221
+ lte?: string | undefined;
222
+ }>>;
223
+ sort: z.ZodOptional<z.ZodObject<{
224
+ componentId: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
225
+ integrationId: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
226
+ name: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
227
+ technology: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
228
+ type: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
229
+ urgency: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
230
+ priority: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
231
+ isCompliant: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
232
+ requiredVersion: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
233
+ desiredVersion: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
234
+ recommendedVersion: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
235
+ dueDate: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
236
+ tags: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
237
+ createdAt: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
238
+ updatedAt: z.ZodOptional<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
239
+ }, "strip", z.ZodTypeAny, {
240
+ name?: "asc" | "desc" | undefined;
241
+ type?: "asc" | "desc" | undefined;
242
+ integrationId?: "asc" | "desc" | undefined;
243
+ technology?: "asc" | "desc" | undefined;
244
+ tags?: "asc" | "desc" | undefined;
245
+ createdAt?: "asc" | "desc" | undefined;
246
+ updatedAt?: "asc" | "desc" | undefined;
247
+ componentId?: "asc" | "desc" | undefined;
248
+ urgency?: "asc" | "desc" | undefined;
249
+ priority?: "asc" | "desc" | undefined;
250
+ isCompliant?: "asc" | "desc" | undefined;
251
+ requiredVersion?: "asc" | "desc" | undefined;
252
+ desiredVersion?: "asc" | "desc" | undefined;
253
+ recommendedVersion?: "asc" | "desc" | undefined;
254
+ dueDate?: "asc" | "desc" | undefined;
255
+ }, {
256
+ name?: "asc" | "desc" | undefined;
257
+ type?: "asc" | "desc" | undefined;
258
+ integrationId?: "asc" | "desc" | undefined;
259
+ technology?: "asc" | "desc" | undefined;
260
+ tags?: "asc" | "desc" | undefined;
261
+ createdAt?: "asc" | "desc" | undefined;
262
+ updatedAt?: "asc" | "desc" | undefined;
263
+ componentId?: "asc" | "desc" | undefined;
264
+ urgency?: "asc" | "desc" | undefined;
265
+ priority?: "asc" | "desc" | undefined;
266
+ isCompliant?: "asc" | "desc" | undefined;
267
+ requiredVersion?: "asc" | "desc" | undefined;
268
+ desiredVersion?: "asc" | "desc" | undefined;
269
+ recommendedVersion?: "asc" | "desc" | undefined;
270
+ dueDate?: "asc" | "desc" | undefined;
271
+ }>>;
272
+ nextToken: z.ZodOptional<z.ZodString>;
273
+ pageSize: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
274
+ };
275
+ export declare const policyComponentGetSchema: {
276
+ policyId: z.ZodString;
277
+ componentId: z.ZodString;
278
+ };