apiskill 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MCP.md +12 -0
- package/README.ja.md +108 -0
- package/README.ko.md +108 -0
- package/README.md +119 -0
- package/README.zh.md +119 -0
- package/dist/assets/index-DH0wsJCI.js +299 -0
- package/dist/assets/index-vocUDpcf.css +1 -0
- package/dist/index.html +13 -0
- package/docs/cli.ja.md +90 -0
- package/docs/cli.ko.md +90 -0
- package/docs/cli.md +117 -0
- package/docs/cli.zh.md +117 -0
- package/docs/mcp.ja.md +79 -0
- package/docs/mcp.ko.md +79 -0
- package/docs/mcp.md +79 -0
- package/docs/mcp.zh.md +79 -0
- package/docs/web.ja.md +44 -0
- package/docs/web.ko.md +44 -0
- package/docs/web.md +57 -0
- package/docs/web.zh.md +57 -0
- package/index.html +12 -0
- package/mcp-config.example.json +13 -0
- package/package.json +44 -0
- package/scripts/apiskill-cli.mjs +372 -0
- package/scripts/lib/apiskill-core.mjs +520 -0
- package/scripts/lib/mock-server.mjs +262 -0
- package/scripts/lib/openapi-importer.mjs +169 -0
- package/scripts/lib/openapi-store.mjs +542 -0
- package/scripts/mcp-server.mjs +408 -0
- package/skills/apiskill/SKILL.md +71 -0
- package/skills/apiskill/agents/openai.yaml +4 -0
- package/src/AddApiDialog.tsx +590 -0
- package/src/App.tsx +2570 -0
- package/src/DocumentVersionManager.tsx +264 -0
- package/src/main.tsx +10 -0
- package/src/manualApiConfig.ts +401 -0
- package/src/styles.css +2101 -0
- package/src/swagger.ts +664 -0
- package/src/types.ts +115 -0
- package/tsconfig.json +21 -0
- package/vite.config.ts +1380 -0
package/src/types.ts
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
export type HttpMethod = 'get' | 'post' | 'put' | 'delete' | 'patch' | 'options' | 'head';
|
|
2
|
+
|
|
3
|
+
export type SwaggerSchema = {
|
|
4
|
+
$ref?: string;
|
|
5
|
+
type?: string;
|
|
6
|
+
format?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
default?: unknown;
|
|
9
|
+
enum?: unknown[];
|
|
10
|
+
required?: string[];
|
|
11
|
+
properties?: Record<string, SwaggerSchema>;
|
|
12
|
+
items?: SwaggerSchema;
|
|
13
|
+
allOf?: SwaggerSchema[];
|
|
14
|
+
anyOf?: SwaggerSchema[];
|
|
15
|
+
oneOf?: SwaggerSchema[];
|
|
16
|
+
additionalProperties?: boolean | SwaggerSchema;
|
|
17
|
+
nullable?: boolean;
|
|
18
|
+
minimum?: number;
|
|
19
|
+
maximum?: number;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type SwaggerParameter = {
|
|
23
|
+
name: string;
|
|
24
|
+
in: 'query' | 'header' | 'path' | 'cookie' | 'body' | 'formData';
|
|
25
|
+
description?: string;
|
|
26
|
+
required?: boolean;
|
|
27
|
+
schema?: SwaggerSchema;
|
|
28
|
+
type?: string;
|
|
29
|
+
format?: string;
|
|
30
|
+
default?: unknown;
|
|
31
|
+
enum?: unknown[];
|
|
32
|
+
items?: SwaggerSchema;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type SwaggerMedia = {
|
|
36
|
+
schema?: SwaggerSchema;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export type SwaggerOperation = {
|
|
40
|
+
tags?: string[];
|
|
41
|
+
summary?: string;
|
|
42
|
+
description?: string;
|
|
43
|
+
operationId?: string;
|
|
44
|
+
consumes?: string[];
|
|
45
|
+
produces?: string[];
|
|
46
|
+
parameters?: SwaggerParameter[];
|
|
47
|
+
requestBody?: {
|
|
48
|
+
required?: boolean;
|
|
49
|
+
content?: Record<string, SwaggerMedia>;
|
|
50
|
+
};
|
|
51
|
+
responses?: Record<
|
|
52
|
+
string,
|
|
53
|
+
{
|
|
54
|
+
description?: string;
|
|
55
|
+
content?: Record<string, SwaggerMedia>;
|
|
56
|
+
schema?: SwaggerSchema;
|
|
57
|
+
responseSchema?: SwaggerSchema;
|
|
58
|
+
}
|
|
59
|
+
>;
|
|
60
|
+
'x-apiskill-links'?: EndpointAssociationLinks;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export type EndpointAssociatedLink = {
|
|
64
|
+
sourceType?: 'local' | 'online' | 'curl';
|
|
65
|
+
title?: string;
|
|
66
|
+
url?: string;
|
|
67
|
+
curl?: string;
|
|
68
|
+
authType?: 'none' | 'browser' | 'bearer' | 'header';
|
|
69
|
+
token?: string;
|
|
70
|
+
headerName?: string;
|
|
71
|
+
note?: string;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export type EndpointAssociationLinks = {
|
|
75
|
+
prototype?: EndpointAssociatedLink;
|
|
76
|
+
ui?: EndpointAssociatedLink;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export type SwaggerDocument = {
|
|
80
|
+
openapi?: string;
|
|
81
|
+
swagger?: string;
|
|
82
|
+
info?: {
|
|
83
|
+
title?: string;
|
|
84
|
+
version?: string;
|
|
85
|
+
description?: string;
|
|
86
|
+
};
|
|
87
|
+
paths?: Record<string, Partial<Record<HttpMethod, SwaggerOperation>>>;
|
|
88
|
+
components?: {
|
|
89
|
+
schemas?: Record<string, SwaggerSchema>;
|
|
90
|
+
};
|
|
91
|
+
definitions?: Record<string, SwaggerSchema>;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export type Endpoint = {
|
|
95
|
+
id: string;
|
|
96
|
+
path: string;
|
|
97
|
+
method: HttpMethod;
|
|
98
|
+
operation: SwaggerOperation;
|
|
99
|
+
tags: string[];
|
|
100
|
+
summary: string;
|
|
101
|
+
hasBody: boolean;
|
|
102
|
+
searchable: string;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export type FieldRow = {
|
|
106
|
+
name: string;
|
|
107
|
+
path: string;
|
|
108
|
+
location?: string;
|
|
109
|
+
required: boolean;
|
|
110
|
+
type: string;
|
|
111
|
+
description: string;
|
|
112
|
+
defaultValue: string;
|
|
113
|
+
enumValue: string;
|
|
114
|
+
depth: number;
|
|
115
|
+
};
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"lib": ["DOM", "DOM.Iterable", "ES2022"],
|
|
6
|
+
"allowJs": false,
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"esModuleInterop": true,
|
|
9
|
+
"allowSyntheticDefaultImports": true,
|
|
10
|
+
"strict": true,
|
|
11
|
+
"forceConsistentCasingInFileNames": true,
|
|
12
|
+
"module": "ESNext",
|
|
13
|
+
"moduleResolution": "Node",
|
|
14
|
+
"resolveJsonModule": true,
|
|
15
|
+
"isolatedModules": true,
|
|
16
|
+
"noEmit": true,
|
|
17
|
+
"jsx": "react-jsx"
|
|
18
|
+
},
|
|
19
|
+
"include": ["src"],
|
|
20
|
+
"references": []
|
|
21
|
+
}
|