@tzurp/openapi-skills 1.2.9 → 1.2.10

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 (79) hide show
  1. package/README.md +63 -16
  2. package/dist/cli.min.js +51 -0
  3. package/package.json +60 -64
  4. package/bin/openapi-skills +0 -4
  5. package/dist/cli.d.ts +0 -37
  6. package/dist/cli.js +0 -1646
  7. package/dist/cli.js.map +0 -1
  8. package/dist/client-schema-builder.d.ts +0 -35
  9. package/dist/client-schema-builder.js +0 -268
  10. package/dist/client-schema-builder.js.map +0 -1
  11. package/dist/helper/base64url-json.d.ts +0 -3
  12. package/dist/helper/base64url-json.js +0 -28
  13. package/dist/helper/base64url-json.js.map +0 -1
  14. package/dist/helper/dotNotation.d.ts +0 -3
  15. package/dist/helper/dotNotation.js +0 -34
  16. package/dist/helper/dotNotation.js.map +0 -1
  17. package/dist/helper/endpoint-filter.d.ts +0 -16
  18. package/dist/helper/endpoint-filter.js +0 -165
  19. package/dist/helper/endpoint-filter.js.map +0 -1
  20. package/dist/helper/endpoint-utils.d.ts +0 -2
  21. package/dist/helper/endpoint-utils.js +0 -10
  22. package/dist/helper/endpoint-utils.js.map +0 -1
  23. package/dist/helper/error-codes.d.ts +0 -27
  24. package/dist/helper/error-codes.js +0 -116
  25. package/dist/helper/error-codes.js.map +0 -1
  26. package/dist/helper/error-formatter.d.ts +0 -46
  27. package/dist/helper/error-formatter.js +0 -72
  28. package/dist/helper/error-formatter.js.map +0 -1
  29. package/dist/helper/get-operation-filter.d.ts +0 -17
  30. package/dist/helper/get-operation-filter.js +0 -26
  31. package/dist/helper/get-operation-filter.js.map +0 -1
  32. package/dist/helper/graphql.d.ts +0 -40
  33. package/dist/helper/graphql.js +0 -967
  34. package/dist/helper/graphql.js.map +0 -1
  35. package/dist/helper/http-client.d.ts +0 -28
  36. package/dist/helper/http-client.js +0 -90
  37. package/dist/helper/http-client.js.map +0 -1
  38. package/dist/helper/json-updater.d.ts +0 -17
  39. package/dist/helper/json-updater.js +0 -195
  40. package/dist/helper/json-updater.js.map +0 -1
  41. package/dist/helper/logger.d.ts +0 -13
  42. package/dist/helper/logger.js +0 -56
  43. package/dist/helper/logger.js.map +0 -1
  44. package/dist/helper/output-size.d.ts +0 -5
  45. package/dist/helper/output-size.js +0 -7
  46. package/dist/helper/output-size.js.map +0 -1
  47. package/dist/helper/parameter-schema.d.ts +0 -14
  48. package/dist/helper/parameter-schema.js +0 -36
  49. package/dist/helper/parameter-schema.js.map +0 -1
  50. package/dist/helper/paths.d.ts +0 -11
  51. package/dist/helper/paths.js +0 -47
  52. package/dist/helper/paths.js.map +0 -1
  53. package/dist/helper/prompt-delete.d.ts +0 -1
  54. package/dist/helper/prompt-delete.js +0 -13
  55. package/dist/helper/prompt-delete.js.map +0 -1
  56. package/dist/helper/request-artifacts.d.ts +0 -14
  57. package/dist/helper/request-artifacts.js +0 -60
  58. package/dist/helper/request-artifacts.js.map +0 -1
  59. package/dist/helper/request-preparation.d.ts +0 -23
  60. package/dist/helper/request-preparation.js +0 -85
  61. package/dist/helper/request-preparation.js.map +0 -1
  62. package/dist/helper/sanitizer.d.ts +0 -1
  63. package/dist/helper/sanitizer.js +0 -17
  64. package/dist/helper/sanitizer.js.map +0 -1
  65. package/dist/helper/update-check.d.ts +0 -1
  66. package/dist/helper/update-check.js +0 -36
  67. package/dist/helper/update-check.js.map +0 -1
  68. package/dist/index.d.ts +0 -50
  69. package/dist/index.js +0 -163
  70. package/dist/index.js.map +0 -1
  71. package/dist/install-skill.d.ts +0 -5
  72. package/dist/install-skill.js +0 -139
  73. package/dist/install-skill.js.map +0 -1
  74. package/dist/parser.d.ts +0 -12
  75. package/dist/parser.js +0 -393
  76. package/dist/parser.js.map +0 -1
  77. package/dist/validate-response.d.ts +0 -47
  78. package/dist/validate-response.js +0 -1017
  79. package/dist/validate-response.js.map +0 -1
@@ -1,139 +0,0 @@
1
- import * as fs from "node:fs/promises";
2
- import path from "path";
3
- import readline from "readline";
4
- import { fileURLToPath } from "url";
5
- import { logger } from "./helper/logger.js";
6
- const moduleDir = path.dirname(fileURLToPath(import.meta.url));
7
- function renderBoolean(value) {
8
- return value ? "Yes" : "No";
9
- }
10
- function renderDescription(description) {
11
- return Array.isArray(description) ? description.join("\n") : description;
12
- }
13
- function renderCommandSection(agentMeta) {
14
- const argumentsMarkdown = agentMeta.arguments.length > 0
15
- ? agentMeta.arguments.map(argument => {
16
- const parts = [argument.type, argument.required ? "required" : "optional"];
17
- if (argument.positional)
18
- parts.push("positional");
19
- if (argument.flag)
20
- parts.push("flag");
21
- const description = argument.description ? `: ${argument.description}` : "";
22
- const flagPrefix = argument.flag ? "--" : "";
23
- const name = argument.positional ? argument.name : `${flagPrefix}${argument.name}`;
24
- return `- \`${name}\` (${parts.join(", ")})${description}`;
25
- }).join("\n")
26
- : "- None";
27
- const examplesMarkdown = agentMeta.examples.length > 0
28
- ? agentMeta.examples.map(example => `- \`\`\`bash\n${example}\n\`\`\``).join("\n")
29
- : "- None";
30
- const filesWrittenMarkdown = agentMeta.filesWritten.length > 0
31
- ? agentMeta.filesWritten.map(file => `\`${file}\``).join(", ")
32
- : "None";
33
- return [
34
- `### ${agentMeta.name}`,
35
- "",
36
- `**Category:** ${agentMeta.category}`,
37
- "",
38
- `**Usage:**`,
39
- "```bash",
40
- agentMeta.usage,
41
- "```",
42
- "",
43
- `**Description:** ${renderDescription(agentMeta.description)}`,
44
- "",
45
- `**Arguments:**`,
46
- argumentsMarkdown,
47
- "",
48
- `**Examples:**`,
49
- examplesMarkdown,
50
- "",
51
- `**Returns:** ${agentMeta.returns.type} - ${agentMeta.returns.description}`,
52
- "",
53
- `**Side Effects:** Writes Files: ${renderBoolean(agentMeta.sideEffects.writesFiles)}, Reads Files: ${renderBoolean(agentMeta.sideEffects.readsFiles)}, Network: ${renderBoolean(agentMeta.sideEffects.network)}`,
54
- "",
55
- `**Constraints:** Destructive: ${renderBoolean(agentMeta.constraints.destructive)}, Idempotent: ${renderBoolean(agentMeta.constraints.idempotent)}, Requires Parsed API: ${renderBoolean(agentMeta.constraints.requiresParsedApi)}`,
56
- "",
57
- `**Files Written:** ${filesWrittenMarkdown}`,
58
- ].join("\n");
59
- }
60
- async function getCommandReferenceMarkdown() {
61
- const { program } = await import("./cli.js");
62
- const commands = program.commands;
63
- const agentCommands = commands
64
- .filter((command) => Boolean(command.agentMeta))
65
- .filter(command => command.agentMeta.name !== "help" && command.agentMeta.name !== "install");
66
- return agentCommands.map(command => renderCommandSection(command.agentMeta)).join("\n\n");
67
- }
68
- export async function promptInstallLocation(rootDir, defaultPath) {
69
- const menu = [
70
- { label: `~/.claude/skills/openapi-skills`, value: path.join(rootDir, ".claude", "skills", "openapi-skills") },
71
- { label: `~/.cursor/skills/openapi-skills`, value: path.join(rootDir, ".cursor", "skills", "openapi-skills") },
72
- { label: `~/.agents/skills/openapi-skills`, value: path.join(rootDir, ".agents", "skills", "openapi-skills") },
73
- { label: `~/.github/skills/openapi-skills`, value: path.join(rootDir, ".github", "skills", "openapi-skills") },
74
- { label: "Other (enter a custom path)", value: "__custom__" }
75
- ];
76
- function ask(question) {
77
- const rl = readline.createInterface({ input: process.stdin, output: process.stderr });
78
- return new Promise(resolve => rl.question(question, ans => { rl.close(); resolve(ans); }));
79
- }
80
- logger.info("Select install location:");
81
- menu.forEach((item, idx) => {
82
- logger.info(` ${idx + 1}) ${item.label}`);
83
- });
84
- let choice;
85
- while (true) {
86
- choice = await ask(`Enter number (1-${menu.length}): `);
87
- const idx = parseInt(choice, 10) - 1;
88
- if (!isNaN(idx) && idx >= 0 && idx < menu.length && menu[idx]) {
89
- if (menu[idx].value === "__custom__") {
90
- const customPath = await ask(`Enter custom install path [${defaultPath}]: `);
91
- return customPath.trim() || defaultPath;
92
- }
93
- return menu[idx].value;
94
- }
95
- logger.warn(`Invalid selection. Please enter a number between 1 and ${menu.length}.`);
96
- }
97
- }
98
- async function copySkillTemplate(templateName, outputPath, transform) {
99
- const templatePath = path.join(moduleDir, "../skill-templates", templateName);
100
- try {
101
- const contents = await fs.readFile(templatePath, "utf8");
102
- const renderedContents = transform ? await transform(contents) : contents;
103
- await fs.mkdir(path.dirname(outputPath), { recursive: true });
104
- await fs.writeFile(outputPath, renderedContents, "utf8");
105
- }
106
- catch (error) {
107
- const errorMessage = error instanceof Error ? error.message : String(error);
108
- throw new Error(`Failed to copy skill template "${templateName}" from "${templatePath}" to "${outputPath}": ${errorMessage}`, { cause: error instanceof Error ? error : undefined });
109
- }
110
- }
111
- export async function installSkillBundle(srcDir, destDir) {
112
- await fs.mkdir(destDir, { recursive: true });
113
- const referencesDest = path.join(destDir, "references");
114
- await fs.mkdir(referencesDest, { recursive: true });
115
- const files = [
116
- { templateName: "SKILL.md", outputPath: path.join(destDir, "SKILL.md") },
117
- { templateName: "write-client-code.md", outputPath: path.join(referencesDest, "write-client-code.md") },
118
- { templateName: "create-endpoint-test.md", outputPath: path.join(referencesDest, "create-endpoint-test.md") },
119
- { templateName: "http-client.md", outputPath: path.join(referencesDest, "http-client.md") }
120
- ];
121
- for (const file of files) {
122
- if (file.templateName === "SKILL.md") {
123
- await copySkillTemplate(file.templateName, file.outputPath, async (contents) => {
124
- const commandReference = await getCommandReferenceMarkdown();
125
- if (!contents.includes("<command-list-here>")) {
126
- throw new Error("SKILL.md template is missing <command-list-here>.");
127
- }
128
- return contents.replace("<command-list-here>", commandReference);
129
- });
130
- continue;
131
- }
132
- await copySkillTemplate(file.templateName, file.outputPath);
133
- }
134
- return {
135
- destDir,
136
- files: files.map(file => file.outputPath)
137
- };
138
- }
139
- //# sourceMappingURL=install-skill.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"install-skill.js","sourceRoot":"","sources":["../src/install-skill.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,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I,CAAC,UAAU,EAAE,KAAK,EAAC,QAAQ,EAAC,EAAE;gBACzE,MAAM,gBAAgB,GAAG,MAAM,2BAA2B,EAAE,CAAC;gBAC7D,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EAAE,CAAC;oBAC5C,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;gBACzE,CAAC;gBACD,OAAO,QAAQ,CAAC,OAAO,CAAC,qBAAqB,EAAE,gBAAgB,CAAC,CAAC;YACrE,CAAC,CAAC,CAAC;YACH,SAAS;QACb,CAAC;QAED,MAAM,iBAAiB,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAChE,CAAC;IAED,OAAO;QACH,OAAO;QACP,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC;KAC5C,CAAC;AACN,CAAC"}
package/dist/parser.d.ts DELETED
@@ -1,12 +0,0 @@
1
- interface ParseOpenAPIOptions {
2
- dereference?: boolean;
3
- progress?: boolean;
4
- rename?: string | undefined;
5
- }
6
- export declare function getApiName(openapiSource: string): string;
7
- export declare function dereferenceEndpointLater(endpointSchema: Record<string, unknown>, bundledComponents: Record<string, unknown>): Promise<Record<string, unknown>>;
8
- export declare function ensureEndpointSchemaFile(apiName: string, operationId: string, sanitizedOperationId: string, force?: boolean): Promise<Record<string, unknown>>;
9
- declare function parseOpenAPI(openapiSource: string, baseUrl: string, options?: ParseOpenAPIOptions): Promise<string>;
10
- export declare function parseSchemaSource(openapiSource: string, baseUrl: string, options?: ParseOpenAPIOptions): Promise<string>;
11
- export declare function validateSchema(schemaSource: string): Promise<void>;
12
- export default parseOpenAPI;
package/dist/parser.js DELETED
@@ -1,393 +0,0 @@
1
- import SwaggerParser from "@apidevtools/swagger-parser";
2
- import $RefParser from "@apidevtools/json-schema-ref-parser";
3
- import fs from "fs-extra";
4
- import path from "path";
5
- import { extractGraphQLEndpoints, findGraphQLEndpoint, isGraphQL, loadSourceText } from "./helper/graphql.js";
6
- import { updateConfig } from "./index.js";
7
- import { getApiDir, getBundledPath, getComponentsPath, getEndpointsPath, getSchemaPath, getSchemasDir } from "./helper/paths.js";
8
- import { isInteractive, logger } from "./helper/logger.js";
9
- import { sanitizeOperationPath } from "./helper/sanitizer.js";
10
- export function getApiName(openapiSource) {
11
- let base;
12
- try {
13
- const url = new URL(openapiSource);
14
- base = path.basename(url.pathname, path.extname(url.pathname));
15
- }
16
- catch {
17
- base = path.basename(openapiSource, path.extname(openapiSource));
18
- }
19
- return sanitizeOperationPath(base || "api");
20
- }
21
- function isCircularReferenceError(error) {
22
- if (error instanceof Error) {
23
- return /circular/i.test(error.message) || /circular/i.test(error.name);
24
- }
25
- if (typeof error === "object" && error !== null) {
26
- const message = String(error.message ?? "");
27
- const name = String(error.name ?? "");
28
- return /circular/i.test(message) || /circular/i.test(name);
29
- }
30
- return false;
31
- }
32
- function removeCycles(obj, seen = new WeakSet()) {
33
- if (obj && typeof obj === "object") {
34
- if (seen.has(obj)) {
35
- return undefined;
36
- }
37
- seen.add(obj);
38
- if (Array.isArray(obj)) {
39
- const cleanedArray = obj.map(item => removeCycles(item, seen));
40
- seen.delete(obj);
41
- return cleanedArray;
42
- }
43
- const cleanedObject = {};
44
- for (const [key, value] of Object.entries(obj)) {
45
- const cleanedValue = removeCycles(value, seen);
46
- if (cleanedValue !== undefined) {
47
- cleanedObject[key] = cleanedValue;
48
- }
49
- }
50
- seen.delete(obj);
51
- return cleanedObject;
52
- }
53
- return obj;
54
- }
55
- async function readGraphQLBundledSource(apiName) {
56
- const bundledPath = getBundledPath(apiName);
57
- const bundled = await fs.readJson(bundledPath);
58
- const sourceText = typeof bundled?.source === "string"
59
- ? bundled.source
60
- : typeof bundled?.sourceText === "string"
61
- ? bundled.sourceText
62
- : undefined;
63
- if (!sourceText) {
64
- throw new Error(`GraphQL source not found for API '${apiName}'. Run generate first.`);
65
- }
66
- return sourceText;
67
- }
68
- async function ensureGraphQLEndpointSchemaFile(apiName, operationId, sanitizedOperationId, force = false) {
69
- const schemaPath = getSchemaPath(apiName, sanitizedOperationId);
70
- if (!force && await fs.pathExists(schemaPath)) {
71
- return fs.readJson(schemaPath);
72
- }
73
- const endpoints = await fs.readJson(getEndpointsPath(apiName));
74
- const endpoint = Array.isArray(endpoints)
75
- ? endpoints.find((entry) => entry.operationId === operationId || entry.name === operationId || entry.sanitizedOperationId === sanitizedOperationId)
76
- : undefined;
77
- if (!endpoint) {
78
- throw new Error(`Endpoint '${operationId}' not found in GraphQL endpoint list.`);
79
- }
80
- const rootType = typeof endpoint.rootType === "string"
81
- ? endpoint.rootType
82
- : typeof endpoint.method === "string"
83
- ? endpoint.method
84
- : undefined;
85
- if (!rootType || (rootType !== "query" && rootType !== "mutation" && rootType !== "subscription")) {
86
- throw new Error(`Invalid GraphQL endpoint metadata for '${operationId}'.`);
87
- }
88
- const sourceText = await readGraphQLBundledSource(apiName);
89
- const schema = await findGraphQLEndpoint(sourceText, rootType, operationId);
90
- await fs.ensureDir(path.dirname(schemaPath));
91
- await fs.writeJson(schemaPath, schema, { spaces: 2 });
92
- return schema;
93
- }
94
- function findEndpointInPaths(pathsObject, operationId) {
95
- for (const [pathKey, methods] of Object.entries(pathsObject)) {
96
- for (const [method, operation] of Object.entries(methods)) {
97
- if (operation && typeof operation === "object" && "operationId" in operation) {
98
- const typedOperation = operation;
99
- if (typedOperation.operationId === operationId) {
100
- return {
101
- pathKey,
102
- method,
103
- operation: typedOperation,
104
- };
105
- }
106
- }
107
- }
108
- }
109
- return undefined;
110
- }
111
- export async function dereferenceEndpointLater(endpointSchema, bundledComponents) {
112
- const operationId = typeof endpointSchema.operationId === "string" ? endpointSchema.operationId : "unknown-operation";
113
- const method = typeof endpointSchema.method === "string" ? endpointSchema.method.toUpperCase() : "GET";
114
- const endpointPath = typeof endpointSchema.path === "string" ? endpointSchema.path : "unknown-path";
115
- const shouldShowProgress = isInteractive;
116
- if (shouldShowProgress) {
117
- logger.progressLine(`Dereferencing endpoint ${operationId} (${method} ${endpointPath})...`);
118
- }
119
- const sourceDocument = {
120
- openapi: "3.0.0",
121
- paths: {
122
- "/temp": {
123
- get: endpointSchema,
124
- },
125
- },
126
- definitions: bundledComponents,
127
- components: bundledComponents,
128
- };
129
- const dereferenced = await $RefParser.dereference(sourceDocument, {
130
- mutateInputSchema: false,
131
- dereference: { circular: "ignore" },
132
- });
133
- const cleaned = removeCycles(dereferenced);
134
- const tempPath = cleaned.paths;
135
- const tempOperation = tempPath && typeof tempPath === "object" ? tempPath["/temp"] : undefined;
136
- const tempGet = tempOperation && typeof tempOperation === "object" ? tempOperation.get : undefined;
137
- if (tempGet && typeof tempGet === "object") {
138
- if (shouldShowProgress) {
139
- logger.progressLine(`Endpoint ${operationId} (${method} ${endpointPath}) dereference complete.`);
140
- }
141
- return tempGet;
142
- }
143
- if (shouldShowProgress) {
144
- logger.progressLine(`Endpoint ${operationId} (${method} ${endpointPath}) dereference complete.`);
145
- }
146
- return cleaned;
147
- }
148
- export async function ensureEndpointSchemaFile(apiName, operationId, sanitizedOperationId, force = false) {
149
- const schemaPath = getSchemaPath(apiName, sanitizedOperationId);
150
- if (!force && await fs.pathExists(schemaPath)) {
151
- return fs.readJson(schemaPath);
152
- }
153
- const bundledPath = getBundledPath(apiName);
154
- const componentsPath = getComponentsPath(apiName);
155
- const bundled = await fs.readJson(bundledPath);
156
- if (bundled && typeof bundled === "object" && bundled.schemaType === "graphql") {
157
- return await ensureGraphQLEndpointSchemaFile(apiName, operationId, sanitizedOperationId, force);
158
- }
159
- if (!bundled || typeof bundled !== "object" || !("paths" in bundled)) {
160
- throw new Error(`Bundled OpenAPI document not found for API '${apiName}'. Run generate first.`);
161
- }
162
- let bundledComponents = {};
163
- const bundledComponentsValue = bundled.components;
164
- const bundledDefinitionsValue = bundled.definitions;
165
- if (bundledComponentsValue && typeof bundledComponentsValue === "object" && !Array.isArray(bundledComponentsValue)) {
166
- bundledComponents = bundledComponentsValue;
167
- }
168
- else if (bundledDefinitionsValue && typeof bundledDefinitionsValue === "object" && !Array.isArray(bundledDefinitionsValue)) {
169
- bundledComponents = bundledDefinitionsValue;
170
- }
171
- else if (await fs.pathExists(componentsPath)) {
172
- bundledComponents = (await fs.readJson(componentsPath));
173
- }
174
- const match = findEndpointInPaths(bundled.paths, operationId);
175
- if (!match) {
176
- throw new Error(`Endpoint '${operationId}' not found in bundled OpenAPI document.`);
177
- }
178
- const endpointSchema = {
179
- operationId,
180
- method: match.method,
181
- path: match.pathKey,
182
- ...match.operation,
183
- };
184
- const dereferencedSchema = await dereferenceEndpointLater(endpointSchema, bundledComponents);
185
- await fs.ensureDir(path.dirname(schemaPath));
186
- await fs.writeJson(schemaPath, dereferencedSchema, { spaces: 2 });
187
- return dereferencedSchema;
188
- }
189
- async function loadOpenAPIDocument(openapiSource, dereference) {
190
- if (!dereference) {
191
- return SwaggerParser.bundle(openapiSource);
192
- }
193
- try {
194
- return await SwaggerParser.dereference(openapiSource, {
195
- dereference: { circular: false },
196
- });
197
- }
198
- catch (error) {
199
- if (isCircularReferenceError(error)) {
200
- throw new Error("The --dereference flag cannot be used because this OpenAPI spec contains circular references. Try running without --dereference.");
201
- }
202
- throw error;
203
- }
204
- }
205
- function detectOpenApiVersion(doc) {
206
- if (typeof doc.swagger === "string" && doc.swagger.startsWith("2.")) {
207
- return "2";
208
- }
209
- if (typeof doc.openapi === "string" && doc.openapi.startsWith("3.")) {
210
- return "3";
211
- }
212
- return "2";
213
- }
214
- async function parseOpenAPI(openapiSource, baseUrl, options = {}) {
215
- let apiName = "";
216
- let version = "unknown";
217
- let api;
218
- const showProgressSignal = options.progress !== false && isInteractive;
219
- try {
220
- if (showProgressSignal) {
221
- logger.progressLine(`Loading OpenAPI document from ${openapiSource}...`);
222
- }
223
- api = await loadOpenAPIDocument(openapiSource, options.dereference === true);
224
- if (showProgressSignal) {
225
- logger.progressLine("OpenAPI document load complete.");
226
- }
227
- }
228
- catch (error) {
229
- logger.error(`Error during parsing OpenAPI schema: ${error instanceof Error ? error.message : String(error)}`);
230
- throw error;
231
- }
232
- if (typeof api !== "object" || !api.paths) {
233
- throw new Error("Invalid OpenAPI schema: Missing 'paths'");
234
- }
235
- try {
236
- version = detectOpenApiVersion(api);
237
- apiName = options.rename || getApiName(openapiSource);
238
- const apiDir = getApiDir(apiName);
239
- await fs.remove(apiDir);
240
- const schemasDir = getSchemasDir(apiName);
241
- await fs.ensureDir(schemasDir);
242
- const bundledPath = getBundledPath(apiName);
243
- await fs.writeJson(bundledPath, api, { spaces: 2 });
244
- if (!options.dereference) {
245
- const componentsPath = getComponentsPath(apiName);
246
- await fs.writeJson(componentsPath, api?.components ?? {}, { spaces: 2 });
247
- }
248
- const endpoints = [];
249
- let totalEndpoints = 0;
250
- let processed = 0;
251
- const shouldShowProgress = options.progress !== false && isInteractive;
252
- for (const [pathKey, methods] of Object.entries(api.paths)) {
253
- for (const [method, operation] of Object.entries(methods)) {
254
- if (operation && typeof operation === "object" && "operationId" in operation) {
255
- const typedOperation = operation;
256
- if (typedOperation.operationId) {
257
- totalEndpoints += 1;
258
- }
259
- }
260
- }
261
- }
262
- for (const [pathKey, methods] of Object.entries(api.paths)) {
263
- for (const [method, operation] of Object.entries(methods)) {
264
- if (operation && typeof operation === "object" && "operationId" in operation) {
265
- const typedOperation = operation;
266
- if (typedOperation.operationId) {
267
- const endpointSummary = {
268
- operationId: typedOperation.operationId,
269
- sanitizedOperationId: sanitizeOperationPath(typedOperation.operationId),
270
- method,
271
- path: pathKey,
272
- };
273
- if (Array.isArray(typedOperation.tags)) {
274
- const tags = typedOperation.tags
275
- .map(tag => typeof tag === "string" ? tag.trim() : "")
276
- .filter((tag) => tag.length > 0);
277
- if (tags.length > 0) {
278
- endpointSummary.tags = tags;
279
- }
280
- }
281
- if (typedOperation.summary !== undefined) {
282
- endpointSummary.summary = typedOperation.summary;
283
- }
284
- if (typedOperation.description !== undefined) {
285
- endpointSummary.description = typedOperation.description;
286
- }
287
- endpoints.push(endpointSummary);
288
- processed += 1;
289
- if (shouldShowProgress) {
290
- logger.progress(`\rProcessed ${processed}/${totalEndpoints}`);
291
- }
292
- }
293
- }
294
- }
295
- }
296
- if (shouldShowProgress && totalEndpoints > 0) {
297
- logger.progressLine("");
298
- }
299
- try {
300
- const endpointsPath = path.join(apiDir, "endpoints.json");
301
- await fs.writeJson(endpointsPath, endpoints, { spaces: 2 });
302
- }
303
- catch (error) {
304
- logger.error(`Error writing endpoints.json: ${error instanceof Error ? error.message : String(error)}`);
305
- throw error;
306
- }
307
- try {
308
- await updateConfig(apiName, { baseUrl, openapiSource, schemaType: "openapi", version });
309
- const baseUrlText = baseUrl ? "with baseUrl" : "without baseUrl";
310
- logger.info(`Schema '${apiName}' added to config.json ${baseUrlText} and openapiSource recorded.`);
311
- }
312
- catch (error) {
313
- logger.error(`Error updating config.json: ${error instanceof Error ? error.message : String(error)}`);
314
- throw error;
315
- }
316
- }
317
- catch (error) {
318
- logger.error(`Error during OpenAPI schema processing: ${error instanceof Error ? error.message : String(error)}`);
319
- throw error;
320
- }
321
- return apiName;
322
- }
323
- async function parseGraphQL(graphqlSource, baseUrl, options = {}, sourceText) {
324
- let apiName = "";
325
- const showProgressSignal = options.progress !== false && isInteractive;
326
- const loadedSourceText = sourceText ?? await loadSourceText(graphqlSource);
327
- if (!isGraphQL(loadedSourceText)) {
328
- throw new Error("Invalid GraphQL schema: missing GraphQL schema markers or builder pattern.");
329
- }
330
- if (showProgressSignal) {
331
- logger.progressLine(`Loading GraphQL schema from ${graphqlSource}...`);
332
- }
333
- apiName = options.rename || getApiName(graphqlSource);
334
- const apiDir = getApiDir(apiName);
335
- await fs.remove(apiDir);
336
- const schemasDir = getSchemasDir(apiName);
337
- await fs.ensureDir(schemasDir);
338
- const endpoints = await extractGraphQLEndpoints(loadedSourceText, graphqlSource);
339
- if (endpoints.length === 0) {
340
- throw new Error("Invalid GraphQL schema: no query, mutation, or subscription fields were found.");
341
- }
342
- const bundledPath = getBundledPath(apiName);
343
- await fs.writeJson(bundledPath, { schemaType: "graphql", source: loadedSourceText }, { spaces: 2 });
344
- const endpointSummaries = endpoints.map(endpoint => ({
345
- name: endpoint.name,
346
- sanitizedOperationId: endpoint.sanitizedOperationId,
347
- rootType: endpoint.rootType,
348
- summary: endpoint.summary,
349
- description: endpoint.description,
350
- }));
351
- for (const endpoint of endpoints) {
352
- const schemaPath = getSchemaPath(apiName, endpoint.sanitizedOperationId);
353
- await fs.ensureDir(path.dirname(schemaPath));
354
- await fs.writeJson(schemaPath, endpoint, { spaces: 2 });
355
- }
356
- await fs.writeJson(path.join(apiDir, "endpoints.json"), endpointSummaries, { spaces: 2 });
357
- try {
358
- await updateConfig(apiName, { baseUrl, openapiSource: graphqlSource, schemaType: "graphql", version: "graphql" });
359
- const baseUrlText = baseUrl ? "with baseUrl" : "without baseUrl";
360
- logger.info(`Schema '${apiName}' added to config.json ${baseUrlText} and GraphQL source recorded.`);
361
- }
362
- catch (error) {
363
- logger.error(`Error updating config.json: ${error instanceof Error ? error.message : String(error)}`);
364
- throw error;
365
- }
366
- if (showProgressSignal) {
367
- logger.progressLine("GraphQL schema load complete.");
368
- }
369
- return apiName;
370
- }
371
- export async function parseSchemaSource(openapiSource, baseUrl, options = {}) {
372
- const sourceText = await loadSourceText(openapiSource).catch(() => undefined);
373
- if (sourceText && isGraphQL(sourceText)) {
374
- return await parseGraphQL(openapiSource, baseUrl, options, sourceText);
375
- }
376
- return await parseOpenAPI(openapiSource, baseUrl, options);
377
- }
378
- export async function validateSchema(schemaSource) {
379
- try {
380
- const sourceText = await loadSourceText(schemaSource).catch(() => undefined);
381
- if (sourceText && isGraphQL(sourceText)) {
382
- await extractGraphQLEndpoints(sourceText, schemaSource);
383
- return;
384
- }
385
- await SwaggerParser.validate(schemaSource);
386
- return;
387
- }
388
- catch (error) {
389
- throw new Error(error instanceof Error ? error.message : String(error));
390
- }
391
- }
392
- export default parseOpenAPI;
393
- //# sourceMappingUR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AC7D,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,YAAoB;IACvD,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,MAAM,cAAc,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QAC7E,IAAI,UAAU,IAAI,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC;YACxC,MAAM,uBAAuB,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;YACxD,OAAO;QACT,CAAC;QACD,MAAM,aAAa,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;QAC3C,OAAO;IACT,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAC1E,CAAC;AACH,CAAC;AAED,eAAe,YAAY,CAAC"}
@@ -1,47 +0,0 @@
1
- import { type Updates } from "./helper/json-updater.js";
2
- type RequestJson = {
3
- parameters?: Array<{
4
- name: string;
5
- in: "path" | "query" | "header";
6
- value: unknown;
7
- }> | null;
8
- requestBody?: unknown;
9
- query?: string;
10
- variables?: Record<string, unknown>;
11
- };
12
- type RequestBodyTransport = {
13
- kind: "json";
14
- body: unknown;
15
- headers: Record<string, string>;
16
- } | {
17
- kind: "multipart";
18
- body: FormData;
19
- headers: Record<string, string>;
20
- } | {
21
- kind: "binary";
22
- body: Buffer;
23
- headers: Record<string, string>;
24
- };
25
- type MakeRequestResult = {
26
- request: any;
27
- response: any;
28
- warnings?: string[];
29
- };
30
- export declare function buildRequestBodyTransport(operationSchema: any, requestJsonOrBody: unknown): Promise<RequestBodyTransport>;
31
- export declare function getSchemaType(apiName: string): Promise<"openapi" | "graphql">;
32
- export declare function collectRequestUpdateTypeWarnings(requestJson: RequestJson, requestJsonUpdates: Updates): string[];
33
- export declare function ensureResponseSchema(apiName: string, operationId: string): Promise<any>;
34
- export declare function makeRequest(apiName: string, operationId: string, force?: boolean, cliHeaders?: Record<string, string>, requestJsonUpdates?: Updates, requestJsonWarnings?: string[]): Promise<MakeRequestResult>;
35
- export declare function validateResponse(apiName: string, operationId: string, force?: boolean, cliHeaders?: Record<string, string>, requestJsonUpdates?: Updates, requestJsonWarnings?: string[]): Promise<{
36
- valid: boolean;
37
- errors?: string[];
38
- warnings?: string[];
39
- }>;
40
- export declare function prepareRequestTemplate(apiName: string, sanitizedOperationId: string, force?: boolean): Promise<{
41
- requestJsonPath: string;
42
- responseJsonPath: string;
43
- requestJson: RequestJson;
44
- }>;
45
- export declare function getDeterministicRequestBody(operation: any): any;
46
- export declare function getDeterministicResponseBody(operation: any): any;
47
- export {};