echoapi-converter 0.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.
package/README.md ADDED
@@ -0,0 +1,2 @@
1
+ # apipost-converter
2
+ Apipost8 格式转换,包含swagger ,apipost格式, posman格式
@@ -0,0 +1,239 @@
1
+ import { ApipostObj } from '@/types/index';
2
+
3
+ declare class ApipostToSwagger {
4
+ apiToSwaggerOrigin: Partial<ApipostObj>;
5
+ apiToSwaggerResult: any;
6
+ apiToSwaggerVersion: '2.0' | '3.0';
7
+ constructor();
8
+ private handleProject;
9
+ private handleModels;
10
+ private handleEnvs;
11
+ private formatRequestItem;
12
+ private formatData;
13
+ private array2NamePathObj;
14
+ private array2TreeExport;
15
+ private handleApis;
16
+ apiToswagger(apipostObj: ApipostObj, version: '2.0' | '3.0'): {
17
+ status: "error" | "success";
18
+ message: string;
19
+ data: any;
20
+ };
21
+ }
22
+
23
+ declare class SwaggerToApipost {
24
+ version: string;
25
+ project: any;
26
+ basePath: string;
27
+ apis: any[];
28
+ folders: any;
29
+ folderNames: any;
30
+ baseParams: any;
31
+ env: any[];
32
+ options: {
33
+ basePath: boolean;
34
+ host: boolean;
35
+ };
36
+ dataModel: any[];
37
+ config: {
38
+ host: string;
39
+ base_path: string;
40
+ };
41
+ constructor();
42
+ private getBeautifulRaw;
43
+ private handleGlobalTags;
44
+ private handleModelApiAndFolder2;
45
+ private handleModelApiAndFolder;
46
+ private handleModelData;
47
+ private handleModelData2;
48
+ private validate;
49
+ private handleInfo;
50
+ private setBasePath;
51
+ private createNewFolder;
52
+ private handleServers;
53
+ private handlePathV3;
54
+ private handlePathsV3;
55
+ private handleTags;
56
+ private handlePath;
57
+ private handlePaths;
58
+ convert(json: any, options?: {
59
+ basePath: boolean;
60
+ host: boolean;
61
+ } | null): Promise<{
62
+ status: "error" | "success";
63
+ message: string;
64
+ data: any;
65
+ }>;
66
+ private clear;
67
+ }
68
+
69
+ declare class ApidocToApipost {
70
+ apis: any;
71
+ project: any;
72
+ foldersMap: any;
73
+ constructor();
74
+ private clear;
75
+ private initProject;
76
+ private completionParameter;
77
+ private completionApiRequest;
78
+ private completionSchema;
79
+ private completionApiResponse;
80
+ private initApis;
81
+ convert(json: any, project_id: string): {
82
+ status: "error" | "success";
83
+ message: string;
84
+ data: any;
85
+ };
86
+ }
87
+
88
+ declare class ApifoxToApipost {
89
+ version: string;
90
+ project: any;
91
+ apis: any[];
92
+ models: any[];
93
+ global: any;
94
+ samples: any[];
95
+ serversMap: any;
96
+ modelMap: any;
97
+ foldersMap: any;
98
+ constructor();
99
+ private validate;
100
+ private clear;
101
+ private initProject;
102
+ private completionParameter;
103
+ private completionVarList;
104
+ private completionServerList;
105
+ private completionEnv;
106
+ private completionServers;
107
+ private completionCustomRules;
108
+ private initGlobal;
109
+ private recursionSchema;
110
+ private completionModels;
111
+ private initModels;
112
+ private completionApiRequestTasks;
113
+ private completionApiRequestAuth;
114
+ private completionApiRequestParameter;
115
+ private completionApiRequestBody;
116
+ private completionApiRequest;
117
+ private completionApiFolder;
118
+ private completionApiTargetMark;
119
+ private completionApiResponse;
120
+ private completionApiTarget;
121
+ private completionApiSample;
122
+ private completionApis;
123
+ private initApis;
124
+ private completionDocs;
125
+ private initDoc;
126
+ private completionTcpClient;
127
+ private completionTcpMethodRequest;
128
+ private completionTcpMethod;
129
+ private completionTcp;
130
+ private initTcp;
131
+ convert(json: any, project_id: string): {
132
+ status: "error" | "success";
133
+ message: string;
134
+ data: any;
135
+ };
136
+ }
137
+
138
+ declare class ApipostToPostman {
139
+ item: any;
140
+ info: any;
141
+ constructor();
142
+ private initInfo;
143
+ private completionTarget;
144
+ private completionEvent;
145
+ private completionFolder;
146
+ private completionItem;
147
+ private initItem;
148
+ private clear;
149
+ convert(json: any): {
150
+ status: "error" | "success";
151
+ message: string;
152
+ data: any;
153
+ };
154
+ }
155
+
156
+ declare class HarToApipost {
157
+ apis: any;
158
+ project: any;
159
+ constructor();
160
+ private clear;
161
+ private initProject;
162
+ private completionApiRequestParameter;
163
+ private completionApiRequest;
164
+ private completionApiResponse;
165
+ private completionApis;
166
+ private initApis;
167
+ convert(json: any, project_id: string): {
168
+ status: "error" | "success";
169
+ message: string;
170
+ data: any;
171
+ };
172
+ }
173
+
174
+ declare class InsomniaToApipost {
175
+ apis: any;
176
+ project: any;
177
+ envs: any;
178
+ foldersMap: any;
179
+ constructor();
180
+ private clear;
181
+ private initProject;
182
+ private completionParameter;
183
+ private completionApiRequestBody;
184
+ private completionApiRequest;
185
+ private completionWsRequest;
186
+ private completionWsTarget;
187
+ private completionApiTarget;
188
+ private completionApis;
189
+ private initApis;
190
+ private initFolders;
191
+ convert(json: any, project_id: string): {
192
+ status: "error" | "success";
193
+ message: string;
194
+ data: any;
195
+ };
196
+ }
197
+
198
+ declare class PostmanToApipost {
199
+ apis: any;
200
+ project: any;
201
+ constructor();
202
+ private clear;
203
+ private completionApiRequestAuth;
204
+ private completionApiRequestParameter;
205
+ private completionApiRequestBody;
206
+ private completionApiRequest;
207
+ private completionApiFolder;
208
+ private completionApiTarget;
209
+ private completionApis;
210
+ private initApis;
211
+ private initProject;
212
+ convert(json: any, project_id: string): {
213
+ status: "error" | "success";
214
+ message: string;
215
+ data: any;
216
+ };
217
+ }
218
+
219
+ declare class YapiToApipost {
220
+ apis: any;
221
+ project: any;
222
+ constructor();
223
+ private clear;
224
+ private initProject;
225
+ private completionApiFolder;
226
+ private completionApiRequestParameter;
227
+ private completionApiRequest;
228
+ private completionApiResponse;
229
+ private completionApiTarget;
230
+ private completionApis;
231
+ private initApis;
232
+ convert(json: any, project_id: string): {
233
+ status: "error" | "success";
234
+ message: string;
235
+ data: any;
236
+ };
237
+ }
238
+
239
+ export { ApipostToSwagger as ApiToSwagger, ApidocToApipost, ApifoxToApipost, ApipostToPostman, HarToApipost, InsomniaToApipost, PostmanToApipost, SwaggerToApipost, YapiToApipost };