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/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
+ }