@nice2dev/ui-tools 1.0.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.
- package/README.md +36 -0
- package/dist/access-control.d.ts +726 -0
- package/dist/access-control.d.ts.map +1 -0
- package/dist/accessibility-i18n.d.ts +1017 -0
- package/dist/accessibility-i18n.d.ts.map +1 -0
- package/dist/ai-assistant.d.ts +263 -0
- package/dist/ai-assistant.d.ts.map +1 -0
- package/dist/ai-playgrounds.d.ts +842 -0
- package/dist/ai-playgrounds.d.ts.map +1 -0
- package/dist/alerting-incidents.d.ts +558 -0
- package/dist/alerting-incidents.d.ts.map +1 -0
- package/dist/api-designer.d.ts +1568 -0
- package/dist/api-designer.d.ts.map +1 -0
- package/dist/api-testing.d.ts +1146 -0
- package/dist/api-testing.d.ts.map +1 -0
- package/dist/apm-profiling.d.ts +656 -0
- package/dist/apm-profiling.d.ts.map +1 -0
- package/dist/artifacts.d.ts +421 -0
- package/dist/artifacts.d.ts.map +1 -0
- package/dist/audit-compliance.d.ts +752 -0
- package/dist/audit-compliance.d.ts.map +1 -0
- package/dist/certificates.d.ts +256 -0
- package/dist/certificates.d.ts.map +1 -0
- package/dist/chart-builder.d.ts +1404 -0
- package/dist/chart-builder.d.ts.map +1 -0
- package/dist/cloud-instances.d.ts +169 -0
- package/dist/cloud-instances.d.ts.map +1 -0
- package/dist/config-management.d.ts +350 -0
- package/dist/config-management.d.ts.map +1 -0
- package/dist/containers.d.ts +256 -0
- package/dist/containers.d.ts.map +1 -0
- package/dist/dashboard-designer.d.ts +1238 -0
- package/dist/dashboard-designer.d.ts.map +1 -0
- package/dist/data-management.d.ts +496 -0
- package/dist/data-management.d.ts.map +1 -0
- package/dist/data-pipeline.d.ts +1105 -0
- package/dist/data-pipeline.d.ts.map +1 -0
- package/dist/data-warehouse.d.ts +1097 -0
- package/dist/data-warehouse.d.ts.map +1 -0
- package/dist/dataset-management.d.ts +782 -0
- package/dist/dataset-management.d.ts.map +1 -0
- package/dist/db-adapters.d.ts +704 -0
- package/dist/db-adapters.d.ts.map +1 -0
- package/dist/db-admin.d.ts +699 -0
- package/dist/db-admin.d.ts.map +1 -0
- package/dist/db-designer.d.ts +366 -0
- package/dist/db-designer.d.ts.map +1 -0
- package/dist/debugger.d.ts +356 -0
- package/dist/debugger.d.ts.map +1 -0
- package/dist/device-management.d.ts +871 -0
- package/dist/device-management.d.ts.map +1 -0
- package/dist/distributed-tracing.d.ts +427 -0
- package/dist/distributed-tracing.d.ts.map +1 -0
- package/dist/dns-management.d.ts +215 -0
- package/dist/dns-management.d.ts.map +1 -0
- package/dist/download-manager.d.ts +271 -0
- package/dist/download-manager.d.ts.map +1 -0
- package/dist/download-torrent.d.ts +1062 -0
- package/dist/download-torrent.d.ts.map +1 -0
- package/dist/edge-computing.d.ts +720 -0
- package/dist/edge-computing.d.ts.map +1 -0
- package/dist/education.d.ts +1135 -0
- package/dist/education.d.ts.map +1 -0
- package/dist/email-template.d.ts +1141 -0
- package/dist/email-template.d.ts.map +1 -0
- package/dist/erp-enterprise.d.ts +1270 -0
- package/dist/erp-enterprise.d.ts.map +1 -0
- package/dist/form-builder.d.ts +1117 -0
- package/dist/form-builder.d.ts.map +1 -0
- package/dist/game-engine-advanced.d.ts +1049 -0
- package/dist/game-engine-advanced.d.ts.map +1 -0
- package/dist/git.d.ts +415 -0
- package/dist/git.d.ts.map +1 -0
- package/dist/hardware-integration.d.ts +966 -0
- package/dist/hardware-integration.d.ts.map +1 -0
- package/dist/iac.d.ts +318 -0
- package/dist/iac.d.ts.map +1 -0
- package/dist/icon-tools.d.ts +1023 -0
- package/dist/icon-tools.d.ts.map +1 -0
- package/dist/ide.d.ts +322 -0
- package/dist/ide.d.ts.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +176 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +1887 -0
- package/dist/index.mjs.map +1 -0
- package/dist/integration-platform.d.ts +857 -0
- package/dist/integration-platform.d.ts.map +1 -0
- package/dist/kubernetes.d.ts +278 -0
- package/dist/kubernetes.d.ts.map +1 -0
- package/dist/life-management.d.ts +1132 -0
- package/dist/life-management.d.ts.map +1 -0
- package/dist/log-management.d.ts +473 -0
- package/dist/log-management.d.ts.map +1 -0
- package/dist/mathematics.d.ts +870 -0
- package/dist/mathematics.d.ts.map +1 -0
- package/dist/message-queue.d.ts +1006 -0
- package/dist/message-queue.d.ts.map +1 -0
- package/dist/metrics-dashboard.d.ts +596 -0
- package/dist/metrics-dashboard.d.ts.map +1 -0
- package/dist/mobile-components.d.ts +766 -0
- package/dist/mobile-components.d.ts.map +1 -0
- package/dist/model-deployment.d.ts +787 -0
- package/dist/model-deployment.d.ts.map +1 -0
- package/dist/model-registry.d.ts +740 -0
- package/dist/model-registry.d.ts.map +1 -0
- package/dist/model-training.d.ts +706 -0
- package/dist/model-training.d.ts.map +1 -0
- package/dist/network-config.d.ts +334 -0
- package/dist/network-config.d.ts.map +1 -0
- package/dist/network-monitoring.d.ts +291 -0
- package/dist/network-monitoring.d.ts.map +1 -0
- package/dist/pdf-tools.d.ts +1003 -0
- package/dist/pdf-tools.d.ts.map +1 -0
- package/dist/pipelines.d.ts +250 -0
- package/dist/pipelines.d.ts.map +1 -0
- package/dist/remote-desktop.d.ts +207 -0
- package/dist/remote-desktop.d.ts.map +1 -0
- package/dist/report-designer.d.ts +1153 -0
- package/dist/report-designer.d.ts.map +1 -0
- package/dist/scada-industrial.d.ts +848 -0
- package/dist/scada-industrial.d.ts.map +1 -0
- package/dist/scientific-research.d.ts +1149 -0
- package/dist/scientific-research.d.ts.map +1 -0
- package/dist/secret-management.d.ts +617 -0
- package/dist/secret-management.d.ts.map +1 -0
- package/dist/security-scanning.d.ts +714 -0
- package/dist/security-scanning.d.ts.map +1 -0
- package/dist/self-service-analytics.d.ts +1208 -0
- package/dist/self-service-analytics.d.ts.map +1 -0
- package/dist/sensor-dashboard.d.ts +845 -0
- package/dist/sensor-dashboard.d.ts.map +1 -0
- package/dist/server-management.d.ts +331 -0
- package/dist/server-management.d.ts.map +1 -0
- package/dist/smart-home.d.ts +861 -0
- package/dist/smart-home.d.ts.map +1 -0
- package/dist/spreadsheet.d.ts +1043 -0
- package/dist/spreadsheet.d.ts.map +1 -0
- package/dist/sql-editor.d.ts +402 -0
- package/dist/sql-editor.d.ts.map +1 -0
- package/dist/terminal.d.ts +245 -0
- package/dist/terminal.d.ts.map +1 -0
- package/dist/testing-qa.d.ts +1013 -0
- package/dist/testing-qa.d.ts.map +1 -0
- package/dist/torrent-client.d.ts +298 -0
- package/dist/torrent-client.d.ts.map +1 -0
- package/dist/traceless.d.ts +759 -0
- package/dist/traceless.d.ts.map +1 -0
- package/dist/virtual-machines.d.ts +199 -0
- package/dist/virtual-machines.d.ts.map +1 -0
- package/dist/visual-scripting.d.ts +381 -0
- package/dist/visual-scripting.d.ts.map +1 -0
- package/dist/word-processor.d.ts +1124 -0
- package/dist/word-processor.d.ts.map +1 -0
- package/dist/workspace.d.ts +333 -0
- package/dist/workspace.d.ts.map +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,1146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file api-testing.ts
|
|
3
|
+
* @module @nice2dev/ui-tools
|
|
4
|
+
* @description PRO-13.2 — API Testing
|
|
5
|
+
*
|
|
6
|
+
* Types for API testing tools: HTTP client, request builder, collections,
|
|
7
|
+
* environments, test automation, WebSocket, gRPC, GraphQL playground.
|
|
8
|
+
*/
|
|
9
|
+
/** HTTP method type */
|
|
10
|
+
export type APITestHttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS' | 'TRACE' | 'CONNECT';
|
|
11
|
+
/** Request body type */
|
|
12
|
+
export type RequestBodyType = 'none' | 'form-data' | 'x-www-form-urlencoded' | 'raw' | 'binary' | 'graphql';
|
|
13
|
+
/** Raw body format */
|
|
14
|
+
export type RawBodyFormat = 'json' | 'xml' | 'text' | 'html' | 'javascript';
|
|
15
|
+
/** Authentication type */
|
|
16
|
+
export type APIAuthType = 'none' | 'basic' | 'bearer' | 'api-key' | 'oauth2' | 'aws-signature' | 'digest' | 'ntlm' | 'hawk' | 'custom';
|
|
17
|
+
/** API workspace */
|
|
18
|
+
export interface APIWorkspace {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
type: 'personal' | 'team' | 'public';
|
|
23
|
+
collections: APICollection[];
|
|
24
|
+
environments: APIEnvironment[];
|
|
25
|
+
globals?: APIEnvironment;
|
|
26
|
+
createdAt: Date;
|
|
27
|
+
updatedAt: Date;
|
|
28
|
+
owner?: string;
|
|
29
|
+
members?: WorkspaceMember[];
|
|
30
|
+
}
|
|
31
|
+
/** Workspace member */
|
|
32
|
+
export interface WorkspaceMember {
|
|
33
|
+
userId: string;
|
|
34
|
+
email: string;
|
|
35
|
+
role: 'viewer' | 'editor' | 'admin';
|
|
36
|
+
joinedAt: Date;
|
|
37
|
+
}
|
|
38
|
+
/** API collection */
|
|
39
|
+
export interface APICollection {
|
|
40
|
+
id: string;
|
|
41
|
+
name: string;
|
|
42
|
+
description?: string;
|
|
43
|
+
version?: string;
|
|
44
|
+
schema?: string;
|
|
45
|
+
items: (APIFolder | APIRequest)[];
|
|
46
|
+
auth?: APIAuthentication;
|
|
47
|
+
variables?: APIVariable[];
|
|
48
|
+
preRequestScript?: string;
|
|
49
|
+
testScript?: string;
|
|
50
|
+
events?: CollectionEvent[];
|
|
51
|
+
createdAt: Date;
|
|
52
|
+
updatedAt: Date;
|
|
53
|
+
}
|
|
54
|
+
/** Collection folder */
|
|
55
|
+
export interface APIFolder {
|
|
56
|
+
type: 'folder';
|
|
57
|
+
id: string;
|
|
58
|
+
name: string;
|
|
59
|
+
description?: string;
|
|
60
|
+
items: (APIFolder | APIRequest)[];
|
|
61
|
+
auth?: APIAuthentication;
|
|
62
|
+
preRequestScript?: string;
|
|
63
|
+
testScript?: string;
|
|
64
|
+
}
|
|
65
|
+
/** API request */
|
|
66
|
+
export interface APIRequest {
|
|
67
|
+
type: 'request';
|
|
68
|
+
id: string;
|
|
69
|
+
name: string;
|
|
70
|
+
description?: string;
|
|
71
|
+
url: RequestURL;
|
|
72
|
+
method: APITestHttpMethod;
|
|
73
|
+
headers: RequestHeader[];
|
|
74
|
+
auth?: APIAuthentication;
|
|
75
|
+
body?: RequestBody;
|
|
76
|
+
settings?: RequestSettings;
|
|
77
|
+
preRequestScript?: string;
|
|
78
|
+
testScript?: string;
|
|
79
|
+
tags?: string[];
|
|
80
|
+
createdAt?: Date;
|
|
81
|
+
updatedAt?: Date;
|
|
82
|
+
}
|
|
83
|
+
/** Request URL */
|
|
84
|
+
export interface RequestURL {
|
|
85
|
+
raw: string;
|
|
86
|
+
protocol?: string;
|
|
87
|
+
host?: string[];
|
|
88
|
+
port?: string;
|
|
89
|
+
path?: string[];
|
|
90
|
+
query?: RequestQueryParam[];
|
|
91
|
+
hash?: string;
|
|
92
|
+
variable?: URLVariable[];
|
|
93
|
+
}
|
|
94
|
+
/** Query parameter */
|
|
95
|
+
export interface RequestQueryParam {
|
|
96
|
+
key: string;
|
|
97
|
+
value: string;
|
|
98
|
+
description?: string;
|
|
99
|
+
disabled?: boolean;
|
|
100
|
+
}
|
|
101
|
+
/** URL variable (path parameter) */
|
|
102
|
+
export interface URLVariable {
|
|
103
|
+
key: string;
|
|
104
|
+
value: string;
|
|
105
|
+
description?: string;
|
|
106
|
+
}
|
|
107
|
+
/** Request header */
|
|
108
|
+
export interface RequestHeader {
|
|
109
|
+
key: string;
|
|
110
|
+
value: string;
|
|
111
|
+
description?: string;
|
|
112
|
+
disabled?: boolean;
|
|
113
|
+
type?: string;
|
|
114
|
+
}
|
|
115
|
+
/** Request body */
|
|
116
|
+
export interface RequestBody {
|
|
117
|
+
mode: RequestBodyType;
|
|
118
|
+
raw?: string;
|
|
119
|
+
formdata?: FormDataItem[];
|
|
120
|
+
urlencoded?: URLEncodedItem[];
|
|
121
|
+
file?: FileItem;
|
|
122
|
+
graphql?: GraphQLBody;
|
|
123
|
+
options?: BodyOptions;
|
|
124
|
+
}
|
|
125
|
+
/** Form data item */
|
|
126
|
+
export interface FormDataItem {
|
|
127
|
+
key: string;
|
|
128
|
+
value?: string;
|
|
129
|
+
type: 'text' | 'file';
|
|
130
|
+
src?: string | string[];
|
|
131
|
+
description?: string;
|
|
132
|
+
contentType?: string;
|
|
133
|
+
disabled?: boolean;
|
|
134
|
+
}
|
|
135
|
+
/** URL encoded item */
|
|
136
|
+
export interface URLEncodedItem {
|
|
137
|
+
key: string;
|
|
138
|
+
value: string;
|
|
139
|
+
description?: string;
|
|
140
|
+
disabled?: boolean;
|
|
141
|
+
}
|
|
142
|
+
/** File item */
|
|
143
|
+
export interface FileItem {
|
|
144
|
+
src: string;
|
|
145
|
+
content?: ArrayBuffer;
|
|
146
|
+
}
|
|
147
|
+
/** GraphQL body */
|
|
148
|
+
export interface GraphQLBody {
|
|
149
|
+
query: string;
|
|
150
|
+
variables?: string;
|
|
151
|
+
operationName?: string;
|
|
152
|
+
}
|
|
153
|
+
/** Body options */
|
|
154
|
+
export interface BodyOptions {
|
|
155
|
+
raw?: {
|
|
156
|
+
language: RawBodyFormat;
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
/** Request settings */
|
|
160
|
+
export interface RequestSettings {
|
|
161
|
+
followRedirects?: boolean;
|
|
162
|
+
maxRedirects?: number;
|
|
163
|
+
timeout?: number;
|
|
164
|
+
strictSSL?: boolean;
|
|
165
|
+
proxy?: ProxySettings;
|
|
166
|
+
certificate?: CertificateSettings;
|
|
167
|
+
encoding?: string;
|
|
168
|
+
}
|
|
169
|
+
/** Proxy settings */
|
|
170
|
+
export interface ProxySettings {
|
|
171
|
+
enabled: boolean;
|
|
172
|
+
host?: string;
|
|
173
|
+
port?: number;
|
|
174
|
+
auth?: {
|
|
175
|
+
username: string;
|
|
176
|
+
password: string;
|
|
177
|
+
};
|
|
178
|
+
bypass?: string[];
|
|
179
|
+
}
|
|
180
|
+
/** Certificate settings */
|
|
181
|
+
export interface CertificateSettings {
|
|
182
|
+
pfx?: {
|
|
183
|
+
src: string;
|
|
184
|
+
};
|
|
185
|
+
cert?: {
|
|
186
|
+
src: string;
|
|
187
|
+
};
|
|
188
|
+
key?: {
|
|
189
|
+
src: string;
|
|
190
|
+
};
|
|
191
|
+
passphrase?: string;
|
|
192
|
+
}
|
|
193
|
+
/** API authentication */
|
|
194
|
+
export interface APIAuthentication {
|
|
195
|
+
type: APIAuthType;
|
|
196
|
+
basic?: BasicAuth;
|
|
197
|
+
bearer?: BearerAuth;
|
|
198
|
+
apiKey?: APIKeyAuth;
|
|
199
|
+
oauth2?: OAuth2Auth;
|
|
200
|
+
awsSignature?: AWSSignatureAuth;
|
|
201
|
+
digest?: DigestAuth;
|
|
202
|
+
ntlm?: NTLMAuth;
|
|
203
|
+
hawk?: HawkAuth;
|
|
204
|
+
custom?: CustomAuth;
|
|
205
|
+
}
|
|
206
|
+
/** Basic authentication */
|
|
207
|
+
export interface BasicAuth {
|
|
208
|
+
username: string;
|
|
209
|
+
password: string;
|
|
210
|
+
}
|
|
211
|
+
/** Bearer token authentication */
|
|
212
|
+
export interface BearerAuth {
|
|
213
|
+
token: string;
|
|
214
|
+
prefix?: string;
|
|
215
|
+
}
|
|
216
|
+
/** API key authentication */
|
|
217
|
+
export interface APIKeyAuth {
|
|
218
|
+
key: string;
|
|
219
|
+
value: string;
|
|
220
|
+
in: 'header' | 'query';
|
|
221
|
+
}
|
|
222
|
+
/** OAuth2 authentication */
|
|
223
|
+
export interface OAuth2Auth {
|
|
224
|
+
grantType: 'authorization_code' | 'client_credentials' | 'password' | 'implicit' | 'refresh_token';
|
|
225
|
+
accessTokenUrl?: string;
|
|
226
|
+
authorizationUrl?: string;
|
|
227
|
+
clientId?: string;
|
|
228
|
+
clientSecret?: string;
|
|
229
|
+
scope?: string;
|
|
230
|
+
state?: string;
|
|
231
|
+
redirectUri?: string;
|
|
232
|
+
username?: string;
|
|
233
|
+
password?: string;
|
|
234
|
+
refreshToken?: string;
|
|
235
|
+
accessToken?: string;
|
|
236
|
+
tokenName?: string;
|
|
237
|
+
headerPrefix?: string;
|
|
238
|
+
addTokenTo?: 'header' | 'query';
|
|
239
|
+
challengeAlgorithm?: 'S256' | 'plain';
|
|
240
|
+
usePkce?: boolean;
|
|
241
|
+
}
|
|
242
|
+
/** AWS signature authentication */
|
|
243
|
+
export interface AWSSignatureAuth {
|
|
244
|
+
accessKey: string;
|
|
245
|
+
secretKey: string;
|
|
246
|
+
region: string;
|
|
247
|
+
service: string;
|
|
248
|
+
sessionToken?: string;
|
|
249
|
+
}
|
|
250
|
+
/** Digest authentication */
|
|
251
|
+
export interface DigestAuth {
|
|
252
|
+
username: string;
|
|
253
|
+
password: string;
|
|
254
|
+
realm?: string;
|
|
255
|
+
nonce?: string;
|
|
256
|
+
nonceCount?: string;
|
|
257
|
+
algorithm?: 'MD5' | 'MD5-sess' | 'SHA-256' | 'SHA-256-sess' | 'SHA-512-256' | 'SHA-512-256-sess';
|
|
258
|
+
qop?: 'auth' | 'auth-int';
|
|
259
|
+
opaque?: string;
|
|
260
|
+
clientNonce?: string;
|
|
261
|
+
}
|
|
262
|
+
/** NTLM authentication */
|
|
263
|
+
export interface NTLMAuth {
|
|
264
|
+
username: string;
|
|
265
|
+
password: string;
|
|
266
|
+
domain?: string;
|
|
267
|
+
workstation?: string;
|
|
268
|
+
}
|
|
269
|
+
/** Hawk authentication */
|
|
270
|
+
export interface HawkAuth {
|
|
271
|
+
authId: string;
|
|
272
|
+
authKey: string;
|
|
273
|
+
algorithm: 'sha256' | 'sha1';
|
|
274
|
+
user?: string;
|
|
275
|
+
nonce?: string;
|
|
276
|
+
ext?: string;
|
|
277
|
+
app?: string;
|
|
278
|
+
dlg?: string;
|
|
279
|
+
timestamp?: string;
|
|
280
|
+
}
|
|
281
|
+
/** Custom authentication */
|
|
282
|
+
export interface CustomAuth {
|
|
283
|
+
headers?: Record<string, string>;
|
|
284
|
+
query?: Record<string, string>;
|
|
285
|
+
}
|
|
286
|
+
/** Collection event */
|
|
287
|
+
export interface CollectionEvent {
|
|
288
|
+
listen: 'prerequest' | 'test';
|
|
289
|
+
script: EventScript;
|
|
290
|
+
}
|
|
291
|
+
/** Event script */
|
|
292
|
+
export interface EventScript {
|
|
293
|
+
id?: string;
|
|
294
|
+
type: 'text/javascript';
|
|
295
|
+
exec: string[];
|
|
296
|
+
}
|
|
297
|
+
/** API environment */
|
|
298
|
+
export interface APIEnvironment {
|
|
299
|
+
id: string;
|
|
300
|
+
name: string;
|
|
301
|
+
values: APIVariable[];
|
|
302
|
+
createdAt?: Date;
|
|
303
|
+
updatedAt?: Date;
|
|
304
|
+
}
|
|
305
|
+
/** API variable */
|
|
306
|
+
export interface APIVariable {
|
|
307
|
+
key: string;
|
|
308
|
+
value: string;
|
|
309
|
+
type?: 'default' | 'secret' | 'any';
|
|
310
|
+
description?: string;
|
|
311
|
+
enabled?: boolean;
|
|
312
|
+
sessionValue?: string;
|
|
313
|
+
}
|
|
314
|
+
/** Variable scope */
|
|
315
|
+
export type VariableScope = 'collection' | 'environment' | 'global' | 'local' | 'data';
|
|
316
|
+
/** Variable resolution */
|
|
317
|
+
export interface VariableResolution {
|
|
318
|
+
original: string;
|
|
319
|
+
resolved: string;
|
|
320
|
+
variables: ResolvedVariable[];
|
|
321
|
+
errors?: VariableError[];
|
|
322
|
+
}
|
|
323
|
+
/** Resolved variable */
|
|
324
|
+
export interface ResolvedVariable {
|
|
325
|
+
name: string;
|
|
326
|
+
value: string;
|
|
327
|
+
scope: VariableScope;
|
|
328
|
+
}
|
|
329
|
+
/** Variable error */
|
|
330
|
+
export interface VariableError {
|
|
331
|
+
name: string;
|
|
332
|
+
message: string;
|
|
333
|
+
}
|
|
334
|
+
/** API response */
|
|
335
|
+
export interface APIResponse {
|
|
336
|
+
id: string;
|
|
337
|
+
requestId: string;
|
|
338
|
+
status: number;
|
|
339
|
+
statusText: string;
|
|
340
|
+
headers: ResponseHeader[];
|
|
341
|
+
cookies: ResponseCookie[];
|
|
342
|
+
body: ResponseBody;
|
|
343
|
+
timing: ResponseTiming;
|
|
344
|
+
size: ResponseSize;
|
|
345
|
+
originalRequest: APIRequest;
|
|
346
|
+
timestamp: Date;
|
|
347
|
+
}
|
|
348
|
+
/** Response header */
|
|
349
|
+
export interface ResponseHeader {
|
|
350
|
+
key: string;
|
|
351
|
+
value: string;
|
|
352
|
+
}
|
|
353
|
+
/** Response cookie */
|
|
354
|
+
export interface ResponseCookie {
|
|
355
|
+
name: string;
|
|
356
|
+
value: string;
|
|
357
|
+
domain?: string;
|
|
358
|
+
path?: string;
|
|
359
|
+
expires?: Date;
|
|
360
|
+
httpOnly?: boolean;
|
|
361
|
+
secure?: boolean;
|
|
362
|
+
sameSite?: 'Strict' | 'Lax' | 'None';
|
|
363
|
+
}
|
|
364
|
+
/** Response body */
|
|
365
|
+
export interface ResponseBody {
|
|
366
|
+
raw: string;
|
|
367
|
+
size: number;
|
|
368
|
+
contentType?: string;
|
|
369
|
+
encoding?: string;
|
|
370
|
+
parsed?: unknown;
|
|
371
|
+
truncated?: boolean;
|
|
372
|
+
}
|
|
373
|
+
/** Response timing */
|
|
374
|
+
export interface ResponseTiming {
|
|
375
|
+
total: number;
|
|
376
|
+
dns?: number;
|
|
377
|
+
tcp?: number;
|
|
378
|
+
tls?: number;
|
|
379
|
+
firstByte?: number;
|
|
380
|
+
download?: number;
|
|
381
|
+
blocked?: number;
|
|
382
|
+
}
|
|
383
|
+
/** Response size */
|
|
384
|
+
export interface ResponseSize {
|
|
385
|
+
total: number;
|
|
386
|
+
headers: number;
|
|
387
|
+
body: number;
|
|
388
|
+
}
|
|
389
|
+
/** Request history item */
|
|
390
|
+
export interface RequestHistoryItem {
|
|
391
|
+
id: string;
|
|
392
|
+
request: APIRequest;
|
|
393
|
+
response?: APIResponse;
|
|
394
|
+
timestamp: Date;
|
|
395
|
+
duration?: number;
|
|
396
|
+
success: boolean;
|
|
397
|
+
environmentId?: string;
|
|
398
|
+
}
|
|
399
|
+
/** Script context */
|
|
400
|
+
export interface ScriptContext {
|
|
401
|
+
/** Request object */
|
|
402
|
+
request: ScriptRequest;
|
|
403
|
+
/** Response object (test scripts only) */
|
|
404
|
+
response?: ScriptResponse;
|
|
405
|
+
/** Variables */
|
|
406
|
+
variables: ScriptVariables;
|
|
407
|
+
/** Environment */
|
|
408
|
+
environment: ScriptEnvironment;
|
|
409
|
+
/** Globals */
|
|
410
|
+
globals: ScriptGlobals;
|
|
411
|
+
/** Collection variables */
|
|
412
|
+
collectionVariables: ScriptCollectionVariables;
|
|
413
|
+
/** Iteration data */
|
|
414
|
+
iterationData: ScriptIterationData;
|
|
415
|
+
/** Console */
|
|
416
|
+
console: ScriptConsole;
|
|
417
|
+
/** Test functions (test scripts only) */
|
|
418
|
+
pm?: PostmanSandbox;
|
|
419
|
+
}
|
|
420
|
+
/** Script request */
|
|
421
|
+
export interface ScriptRequest {
|
|
422
|
+
url: string;
|
|
423
|
+
method: string;
|
|
424
|
+
headers: Record<string, string>;
|
|
425
|
+
body?: string;
|
|
426
|
+
addHeader(key: string, value: string): void;
|
|
427
|
+
removeHeader(key: string): void;
|
|
428
|
+
}
|
|
429
|
+
/** Script response */
|
|
430
|
+
export interface ScriptResponse {
|
|
431
|
+
code: number;
|
|
432
|
+
status: string;
|
|
433
|
+
headers: Record<string, string>;
|
|
434
|
+
body: string;
|
|
435
|
+
json(): unknown;
|
|
436
|
+
text(): string;
|
|
437
|
+
responseTime: number;
|
|
438
|
+
responseSize: number;
|
|
439
|
+
}
|
|
440
|
+
/** Script variables interface */
|
|
441
|
+
export interface ScriptVariables {
|
|
442
|
+
get(key: string): string | undefined;
|
|
443
|
+
set(key: string, value: string): void;
|
|
444
|
+
has(key: string): boolean;
|
|
445
|
+
clear(): void;
|
|
446
|
+
toObject(): Record<string, string>;
|
|
447
|
+
}
|
|
448
|
+
/** Script environment */
|
|
449
|
+
export interface ScriptEnvironment extends ScriptVariables {
|
|
450
|
+
}
|
|
451
|
+
/** Script globals */
|
|
452
|
+
export interface ScriptGlobals extends ScriptVariables {
|
|
453
|
+
}
|
|
454
|
+
/** Script collection variables */
|
|
455
|
+
export interface ScriptCollectionVariables extends ScriptVariables {
|
|
456
|
+
}
|
|
457
|
+
/** Script iteration data */
|
|
458
|
+
export interface ScriptIterationData {
|
|
459
|
+
get(key: string): unknown;
|
|
460
|
+
toObject(): Record<string, unknown>;
|
|
461
|
+
}
|
|
462
|
+
/** Script console */
|
|
463
|
+
export interface ScriptConsole {
|
|
464
|
+
log(...args: unknown[]): void;
|
|
465
|
+
info(...args: unknown[]): void;
|
|
466
|
+
warn(...args: unknown[]): void;
|
|
467
|
+
error(...args: unknown[]): void;
|
|
468
|
+
clear(): void;
|
|
469
|
+
}
|
|
470
|
+
/** Postman sandbox API */
|
|
471
|
+
export interface PostmanSandbox {
|
|
472
|
+
test: TestFunction;
|
|
473
|
+
expect: ChaiExpect;
|
|
474
|
+
response: ScriptResponse;
|
|
475
|
+
request: ScriptRequest;
|
|
476
|
+
environment: ScriptEnvironment;
|
|
477
|
+
globals: ScriptGlobals;
|
|
478
|
+
collectionVariables: ScriptCollectionVariables;
|
|
479
|
+
variables: ScriptVariables;
|
|
480
|
+
iterationData: ScriptIterationData;
|
|
481
|
+
cookies: CookieJar;
|
|
482
|
+
info: RequestInfo;
|
|
483
|
+
sendRequest(request: string | APIRequest, callback: (error: Error | null, response: ScriptResponse) => void): void;
|
|
484
|
+
visualizer: Visualizer;
|
|
485
|
+
}
|
|
486
|
+
/** Test function */
|
|
487
|
+
export interface TestFunction {
|
|
488
|
+
(name: string, fn: () => void): void;
|
|
489
|
+
skip(name: string, fn: () => void): void;
|
|
490
|
+
}
|
|
491
|
+
/** Chai expect (simplified) */
|
|
492
|
+
export interface ChaiExpect {
|
|
493
|
+
(value: unknown): ChaiAssertion;
|
|
494
|
+
}
|
|
495
|
+
/** Chai assertion (simplified) */
|
|
496
|
+
export interface ChaiAssertion {
|
|
497
|
+
to: ChaiAssertion;
|
|
498
|
+
be: ChaiAssertion;
|
|
499
|
+
been: ChaiAssertion;
|
|
500
|
+
have: ChaiAssertion;
|
|
501
|
+
not: ChaiAssertion;
|
|
502
|
+
equal(value: unknown): ChaiAssertion;
|
|
503
|
+
eql(value: unknown): ChaiAssertion;
|
|
504
|
+
include(value: unknown): ChaiAssertion;
|
|
505
|
+
property(name: string, value?: unknown): ChaiAssertion;
|
|
506
|
+
lengthOf(length: number): ChaiAssertion;
|
|
507
|
+
above(value: number): ChaiAssertion;
|
|
508
|
+
below(value: number): ChaiAssertion;
|
|
509
|
+
a(type: string): ChaiAssertion;
|
|
510
|
+
an(type: string): ChaiAssertion;
|
|
511
|
+
ok: ChaiAssertion;
|
|
512
|
+
true: ChaiAssertion;
|
|
513
|
+
false: ChaiAssertion;
|
|
514
|
+
null: ChaiAssertion;
|
|
515
|
+
undefined: ChaiAssertion;
|
|
516
|
+
empty: ChaiAssertion;
|
|
517
|
+
oneOf(list: unknown[]): ChaiAssertion;
|
|
518
|
+
status(code: number): ChaiAssertion;
|
|
519
|
+
header(name: string, value?: string): ChaiAssertion;
|
|
520
|
+
jsonBody(path?: string): ChaiAssertion;
|
|
521
|
+
}
|
|
522
|
+
/** Cookie jar */
|
|
523
|
+
export interface CookieJar {
|
|
524
|
+
get(url: string, name: string): string | undefined;
|
|
525
|
+
getAll(url: string): ResponseCookie[];
|
|
526
|
+
set(url: string, name: string, value: string, options?: CookieOptions): void;
|
|
527
|
+
clear(url: string): void;
|
|
528
|
+
}
|
|
529
|
+
/** Cookie options */
|
|
530
|
+
export interface CookieOptions {
|
|
531
|
+
domain?: string;
|
|
532
|
+
path?: string;
|
|
533
|
+
expires?: Date;
|
|
534
|
+
maxAge?: number;
|
|
535
|
+
httpOnly?: boolean;
|
|
536
|
+
secure?: boolean;
|
|
537
|
+
sameSite?: 'Strict' | 'Lax' | 'None';
|
|
538
|
+
}
|
|
539
|
+
/** Request info */
|
|
540
|
+
export interface RequestInfo {
|
|
541
|
+
eventName: string;
|
|
542
|
+
iteration: number;
|
|
543
|
+
iterationCount: number;
|
|
544
|
+
requestName: string;
|
|
545
|
+
requestId: string;
|
|
546
|
+
}
|
|
547
|
+
/** Visualizer */
|
|
548
|
+
export interface Visualizer {
|
|
549
|
+
set(template: string, data?: unknown): void;
|
|
550
|
+
clear(): void;
|
|
551
|
+
}
|
|
552
|
+
/** Script execution result */
|
|
553
|
+
export interface ScriptExecutionResult {
|
|
554
|
+
success: boolean;
|
|
555
|
+
duration: number;
|
|
556
|
+
console: ConsoleOutput[];
|
|
557
|
+
tests?: TestResult[];
|
|
558
|
+
visualizer?: string;
|
|
559
|
+
error?: ScriptError;
|
|
560
|
+
variableChanges?: VariableChange[];
|
|
561
|
+
}
|
|
562
|
+
/** Console output */
|
|
563
|
+
export interface ConsoleOutput {
|
|
564
|
+
level: 'log' | 'info' | 'warn' | 'error';
|
|
565
|
+
message: string;
|
|
566
|
+
timestamp: Date;
|
|
567
|
+
}
|
|
568
|
+
/** Test result */
|
|
569
|
+
export interface TestResult {
|
|
570
|
+
name: string;
|
|
571
|
+
passed: boolean;
|
|
572
|
+
error?: string;
|
|
573
|
+
duration?: number;
|
|
574
|
+
skipped?: boolean;
|
|
575
|
+
}
|
|
576
|
+
/** Script error */
|
|
577
|
+
export interface ScriptError {
|
|
578
|
+
name: string;
|
|
579
|
+
message: string;
|
|
580
|
+
stack?: string;
|
|
581
|
+
line?: number;
|
|
582
|
+
column?: number;
|
|
583
|
+
}
|
|
584
|
+
/** Variable change */
|
|
585
|
+
export interface VariableChange {
|
|
586
|
+
scope: VariableScope;
|
|
587
|
+
key: string;
|
|
588
|
+
oldValue?: string;
|
|
589
|
+
newValue?: string;
|
|
590
|
+
action: 'set' | 'unset';
|
|
591
|
+
}
|
|
592
|
+
/** Schema validation config */
|
|
593
|
+
export interface SchemaValidationConfig {
|
|
594
|
+
/** JSON Schema */
|
|
595
|
+
schema?: object;
|
|
596
|
+
/** OpenAPI spec reference */
|
|
597
|
+
openApiSpec?: string;
|
|
598
|
+
/** Schema path in spec */
|
|
599
|
+
schemaPath?: string;
|
|
600
|
+
/** Strict mode */
|
|
601
|
+
strict?: boolean;
|
|
602
|
+
/** Allow additional properties */
|
|
603
|
+
allowAdditional?: boolean;
|
|
604
|
+
}
|
|
605
|
+
/** Validation result */
|
|
606
|
+
export interface ValidationResult {
|
|
607
|
+
valid: boolean;
|
|
608
|
+
errors: ValidationError[];
|
|
609
|
+
warnings?: ValidationWarning[];
|
|
610
|
+
}
|
|
611
|
+
/** Validation error */
|
|
612
|
+
export interface ValidationError {
|
|
613
|
+
path: string;
|
|
614
|
+
message: string;
|
|
615
|
+
keyword?: string;
|
|
616
|
+
params?: Record<string, unknown>;
|
|
617
|
+
schemaPath?: string;
|
|
618
|
+
}
|
|
619
|
+
/** Validation warning */
|
|
620
|
+
export interface ValidationWarning {
|
|
621
|
+
path: string;
|
|
622
|
+
message: string;
|
|
623
|
+
}
|
|
624
|
+
/** Test suite */
|
|
625
|
+
export interface TestSuite {
|
|
626
|
+
id: string;
|
|
627
|
+
name: string;
|
|
628
|
+
description?: string;
|
|
629
|
+
collectionId: string;
|
|
630
|
+
environmentId?: string;
|
|
631
|
+
dataFile?: string;
|
|
632
|
+
iterations?: number;
|
|
633
|
+
delay?: number;
|
|
634
|
+
timeout?: number;
|
|
635
|
+
bail?: boolean;
|
|
636
|
+
ignoreRedirects?: boolean;
|
|
637
|
+
insecure?: boolean;
|
|
638
|
+
folder?: string;
|
|
639
|
+
reporters?: TestReporter[];
|
|
640
|
+
createdAt: Date;
|
|
641
|
+
updatedAt: Date;
|
|
642
|
+
}
|
|
643
|
+
/** Test reporter */
|
|
644
|
+
export interface TestReporter {
|
|
645
|
+
name: 'cli' | 'json' | 'junit' | 'html' | 'custom';
|
|
646
|
+
options?: Record<string, unknown>;
|
|
647
|
+
}
|
|
648
|
+
/** Test run */
|
|
649
|
+
export interface TestRun {
|
|
650
|
+
id: string;
|
|
651
|
+
suiteId: string;
|
|
652
|
+
status: 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
653
|
+
startTime: Date;
|
|
654
|
+
endTime?: Date;
|
|
655
|
+
totalRequests: number;
|
|
656
|
+
completedRequests: number;
|
|
657
|
+
passedTests: number;
|
|
658
|
+
failedTests: number;
|
|
659
|
+
skippedTests: number;
|
|
660
|
+
totalAssertions: number;
|
|
661
|
+
passedAssertions: number;
|
|
662
|
+
failedAssertions: number;
|
|
663
|
+
iterations: TestIteration[];
|
|
664
|
+
summary?: TestRunSummary;
|
|
665
|
+
error?: string;
|
|
666
|
+
}
|
|
667
|
+
/** Test iteration */
|
|
668
|
+
export interface TestIteration {
|
|
669
|
+
index: number;
|
|
670
|
+
requests: TestRequestResult[];
|
|
671
|
+
data?: Record<string, unknown>;
|
|
672
|
+
}
|
|
673
|
+
/** Test request result */
|
|
674
|
+
export interface TestRequestResult {
|
|
675
|
+
requestId: string;
|
|
676
|
+
requestName: string;
|
|
677
|
+
url: string;
|
|
678
|
+
method: string;
|
|
679
|
+
status?: number;
|
|
680
|
+
responseTime?: number;
|
|
681
|
+
responseSize?: number;
|
|
682
|
+
tests: TestResult[];
|
|
683
|
+
assertions: AssertionResult[];
|
|
684
|
+
preRequestScript?: ScriptExecutionResult;
|
|
685
|
+
testScript?: ScriptExecutionResult;
|
|
686
|
+
error?: string;
|
|
687
|
+
skipped?: boolean;
|
|
688
|
+
}
|
|
689
|
+
/** Assertion result */
|
|
690
|
+
export interface AssertionResult {
|
|
691
|
+
name: string;
|
|
692
|
+
passed: boolean;
|
|
693
|
+
message?: string;
|
|
694
|
+
actual?: unknown;
|
|
695
|
+
expected?: unknown;
|
|
696
|
+
}
|
|
697
|
+
/** Test run summary */
|
|
698
|
+
export interface TestRunSummary {
|
|
699
|
+
duration: number;
|
|
700
|
+
requests: {
|
|
701
|
+
total: number;
|
|
702
|
+
pending: number;
|
|
703
|
+
passed: number;
|
|
704
|
+
failed: number;
|
|
705
|
+
};
|
|
706
|
+
tests: {
|
|
707
|
+
total: number;
|
|
708
|
+
passed: number;
|
|
709
|
+
failed: number;
|
|
710
|
+
skipped: number;
|
|
711
|
+
};
|
|
712
|
+
assertions: {
|
|
713
|
+
total: number;
|
|
714
|
+
passed: number;
|
|
715
|
+
failed: number;
|
|
716
|
+
};
|
|
717
|
+
dataUsed?: boolean;
|
|
718
|
+
iterationsCompleted: number;
|
|
719
|
+
iterationsTotal: number;
|
|
720
|
+
}
|
|
721
|
+
/** Load test configuration */
|
|
722
|
+
export interface LoadTestConfig {
|
|
723
|
+
id: string;
|
|
724
|
+
name: string;
|
|
725
|
+
description?: string;
|
|
726
|
+
collectionId: string;
|
|
727
|
+
environmentId?: string;
|
|
728
|
+
scenario: LoadTestScenario;
|
|
729
|
+
thresholds?: LoadTestThreshold[];
|
|
730
|
+
tags?: Record<string, string>;
|
|
731
|
+
}
|
|
732
|
+
/** Load test scenario */
|
|
733
|
+
export interface LoadTestScenario {
|
|
734
|
+
type: 'constant' | 'ramp-up' | 'stages' | 'per-vu-iterations';
|
|
735
|
+
vus?: number;
|
|
736
|
+
duration?: string;
|
|
737
|
+
iterations?: number;
|
|
738
|
+
stages?: LoadTestStage[];
|
|
739
|
+
maxVus?: number;
|
|
740
|
+
startVus?: number;
|
|
741
|
+
gracefulStop?: string;
|
|
742
|
+
}
|
|
743
|
+
/** Load test stage */
|
|
744
|
+
export interface LoadTestStage {
|
|
745
|
+
duration: string;
|
|
746
|
+
target: number;
|
|
747
|
+
}
|
|
748
|
+
/** Load test threshold */
|
|
749
|
+
export interface LoadTestThreshold {
|
|
750
|
+
metric: string;
|
|
751
|
+
condition: string;
|
|
752
|
+
abortOnFail?: boolean;
|
|
753
|
+
}
|
|
754
|
+
/** Load test result */
|
|
755
|
+
export interface LoadTestResult {
|
|
756
|
+
id: string;
|
|
757
|
+
configId: string;
|
|
758
|
+
status: 'pending' | 'running' | 'completed' | 'failed' | 'aborted';
|
|
759
|
+
startTime: Date;
|
|
760
|
+
endTime?: Date;
|
|
761
|
+
metrics: LoadTestMetrics;
|
|
762
|
+
thresholdResults: ThresholdResult[];
|
|
763
|
+
checks: LoadTestCheck[];
|
|
764
|
+
errors: LoadTestError[];
|
|
765
|
+
summary?: LoadTestSummary;
|
|
766
|
+
}
|
|
767
|
+
/** Load test metrics */
|
|
768
|
+
export interface LoadTestMetrics {
|
|
769
|
+
http_reqs: MetricData;
|
|
770
|
+
http_req_duration: MetricData;
|
|
771
|
+
http_req_waiting: MetricData;
|
|
772
|
+
http_req_connecting: MetricData;
|
|
773
|
+
http_req_tls_handshaking: MetricData;
|
|
774
|
+
http_req_sending: MetricData;
|
|
775
|
+
http_req_receiving: MetricData;
|
|
776
|
+
http_req_blocked: MetricData;
|
|
777
|
+
http_req_failed: MetricData;
|
|
778
|
+
vus: MetricData;
|
|
779
|
+
vus_max: MetricData;
|
|
780
|
+
iterations: MetricData;
|
|
781
|
+
iteration_duration: MetricData;
|
|
782
|
+
data_received: MetricData;
|
|
783
|
+
data_sent: MetricData;
|
|
784
|
+
[key: string]: MetricData;
|
|
785
|
+
}
|
|
786
|
+
/** Metric data */
|
|
787
|
+
export interface MetricData {
|
|
788
|
+
type: 'counter' | 'gauge' | 'rate' | 'trend';
|
|
789
|
+
contains?: 'time' | 'data' | 'default';
|
|
790
|
+
values: MetricValues;
|
|
791
|
+
}
|
|
792
|
+
/** Metric values */
|
|
793
|
+
export interface MetricValues {
|
|
794
|
+
count?: number;
|
|
795
|
+
rate?: number;
|
|
796
|
+
value?: number;
|
|
797
|
+
avg?: number;
|
|
798
|
+
min?: number;
|
|
799
|
+
max?: number;
|
|
800
|
+
med?: number;
|
|
801
|
+
'p(90)'?: number;
|
|
802
|
+
'p(95)'?: number;
|
|
803
|
+
'p(99)'?: number;
|
|
804
|
+
}
|
|
805
|
+
/** Threshold result */
|
|
806
|
+
export interface ThresholdResult {
|
|
807
|
+
metric: string;
|
|
808
|
+
condition: string;
|
|
809
|
+
passed: boolean;
|
|
810
|
+
value: number;
|
|
811
|
+
}
|
|
812
|
+
/** Load test check */
|
|
813
|
+
export interface LoadTestCheck {
|
|
814
|
+
name: string;
|
|
815
|
+
passes: number;
|
|
816
|
+
fails: number;
|
|
817
|
+
}
|
|
818
|
+
/** Load test error */
|
|
819
|
+
export interface LoadTestError {
|
|
820
|
+
name: string;
|
|
821
|
+
count: number;
|
|
822
|
+
}
|
|
823
|
+
/** Load test summary */
|
|
824
|
+
export interface LoadTestSummary {
|
|
825
|
+
totalRequests: number;
|
|
826
|
+
requestsPerSecond: number;
|
|
827
|
+
failRate: number;
|
|
828
|
+
avgDuration: number;
|
|
829
|
+
p95Duration: number;
|
|
830
|
+
p99Duration: number;
|
|
831
|
+
dataReceived: number;
|
|
832
|
+
dataSent: number;
|
|
833
|
+
peakVus: number;
|
|
834
|
+
}
|
|
835
|
+
/** Mock response config */
|
|
836
|
+
export interface MockResponseConfig {
|
|
837
|
+
id: string;
|
|
838
|
+
name: string;
|
|
839
|
+
requestId?: string;
|
|
840
|
+
url: string;
|
|
841
|
+
method: APITestHttpMethod;
|
|
842
|
+
isActive: boolean;
|
|
843
|
+
priority?: number;
|
|
844
|
+
response: MockedResponse;
|
|
845
|
+
conditions?: MockCondition[];
|
|
846
|
+
delay?: number;
|
|
847
|
+
delayVariation?: number;
|
|
848
|
+
}
|
|
849
|
+
/** Mocked response */
|
|
850
|
+
export interface MockedResponse {
|
|
851
|
+
statusCode: number;
|
|
852
|
+
statusMessage?: string;
|
|
853
|
+
headers: Record<string, string>;
|
|
854
|
+
body: string | object;
|
|
855
|
+
bodyMode?: 'raw' | 'file' | 'dynamic';
|
|
856
|
+
filePath?: string;
|
|
857
|
+
dynamicScript?: string;
|
|
858
|
+
}
|
|
859
|
+
/** Mock condition */
|
|
860
|
+
export interface MockCondition {
|
|
861
|
+
type: 'header' | 'query' | 'body' | 'path';
|
|
862
|
+
key?: string;
|
|
863
|
+
operator: 'equals' | 'contains' | 'matches' | 'exists' | 'not-exists';
|
|
864
|
+
value?: string;
|
|
865
|
+
}
|
|
866
|
+
/** Mock server */
|
|
867
|
+
export interface MockServer {
|
|
868
|
+
id: string;
|
|
869
|
+
name: string;
|
|
870
|
+
collectionId: string;
|
|
871
|
+
url: string;
|
|
872
|
+
isRunning: boolean;
|
|
873
|
+
port?: number;
|
|
874
|
+
mocks: MockResponseConfig[];
|
|
875
|
+
logs: MockServerLog[];
|
|
876
|
+
createdAt: Date;
|
|
877
|
+
}
|
|
878
|
+
/** Mock server log */
|
|
879
|
+
export interface MockServerLog {
|
|
880
|
+
id: string;
|
|
881
|
+
timestamp: Date;
|
|
882
|
+
method: string;
|
|
883
|
+
path: string;
|
|
884
|
+
matched: boolean;
|
|
885
|
+
mockId?: string;
|
|
886
|
+
requestHeaders: Record<string, string>;
|
|
887
|
+
requestBody?: string;
|
|
888
|
+
responseStatus: number;
|
|
889
|
+
responseTime: number;
|
|
890
|
+
}
|
|
891
|
+
/** Import format */
|
|
892
|
+
export type ImportFormat = 'postman-v2.1' | 'postman-v2.0' | 'openapi-3.0' | 'openapi-3.1' | 'swagger-2.0' | 'insomnia-v4' | 'har' | 'curl' | 'raw';
|
|
893
|
+
/** Import result */
|
|
894
|
+
export interface ImportResult {
|
|
895
|
+
success: boolean;
|
|
896
|
+
format: ImportFormat;
|
|
897
|
+
collection?: APICollection;
|
|
898
|
+
environment?: APIEnvironment;
|
|
899
|
+
errors?: ImportError[];
|
|
900
|
+
warnings?: ImportWarning[];
|
|
901
|
+
}
|
|
902
|
+
/** Import error */
|
|
903
|
+
export interface ImportError {
|
|
904
|
+
message: string;
|
|
905
|
+
path?: string;
|
|
906
|
+
}
|
|
907
|
+
/** Import warning */
|
|
908
|
+
export interface ImportWarning {
|
|
909
|
+
message: string;
|
|
910
|
+
path?: string;
|
|
911
|
+
}
|
|
912
|
+
/** Export options */
|
|
913
|
+
export interface ExportOptions {
|
|
914
|
+
format: ImportFormat;
|
|
915
|
+
includeEnvironment?: boolean;
|
|
916
|
+
includeHistory?: boolean;
|
|
917
|
+
prettyPrint?: boolean;
|
|
918
|
+
}
|
|
919
|
+
/** WebSocket connection */
|
|
920
|
+
export interface WebSocketConnection {
|
|
921
|
+
id: string;
|
|
922
|
+
name: string;
|
|
923
|
+
url: string;
|
|
924
|
+
status: 'disconnected' | 'connecting' | 'connected' | 'error';
|
|
925
|
+
protocols?: string[];
|
|
926
|
+
headers?: Record<string, string>;
|
|
927
|
+
auth?: APIAuthentication;
|
|
928
|
+
autoReconnect?: boolean;
|
|
929
|
+
reconnectAttempts?: number;
|
|
930
|
+
reconnectInterval?: number;
|
|
931
|
+
messages: WebSocketMessage[];
|
|
932
|
+
createdAt: Date;
|
|
933
|
+
connectedAt?: Date;
|
|
934
|
+
}
|
|
935
|
+
/** WebSocket message */
|
|
936
|
+
export interface WebSocketMessage {
|
|
937
|
+
id: string;
|
|
938
|
+
direction: 'sent' | 'received';
|
|
939
|
+
type: 'text' | 'binary' | 'ping' | 'pong';
|
|
940
|
+
data: string | ArrayBuffer;
|
|
941
|
+
timestamp: Date;
|
|
942
|
+
size: number;
|
|
943
|
+
}
|
|
944
|
+
/** WebSocket saved message */
|
|
945
|
+
export interface WebSocketSavedMessage {
|
|
946
|
+
id: string;
|
|
947
|
+
name: string;
|
|
948
|
+
type: 'text' | 'binary';
|
|
949
|
+
data: string;
|
|
950
|
+
description?: string;
|
|
951
|
+
}
|
|
952
|
+
/** gRPC connection */
|
|
953
|
+
export interface GRPCConnection {
|
|
954
|
+
id: string;
|
|
955
|
+
name: string;
|
|
956
|
+
serverUrl: string;
|
|
957
|
+
protoFiles: ProtoFile[];
|
|
958
|
+
status: 'disconnected' | 'connected' | 'error';
|
|
959
|
+
tls?: GRPCTLSConfig;
|
|
960
|
+
auth?: GRPCAuth;
|
|
961
|
+
metadata?: Record<string, string>;
|
|
962
|
+
services: GRPCService[];
|
|
963
|
+
}
|
|
964
|
+
/** Proto file */
|
|
965
|
+
export interface ProtoFile {
|
|
966
|
+
id: string;
|
|
967
|
+
name: string;
|
|
968
|
+
content: string;
|
|
969
|
+
path?: string;
|
|
970
|
+
}
|
|
971
|
+
/** gRPC TLS config */
|
|
972
|
+
export interface GRPCTLSConfig {
|
|
973
|
+
enabled: boolean;
|
|
974
|
+
insecure?: boolean;
|
|
975
|
+
rootCert?: string;
|
|
976
|
+
clientCert?: string;
|
|
977
|
+
clientKey?: string;
|
|
978
|
+
serverName?: string;
|
|
979
|
+
}
|
|
980
|
+
/** gRPC authentication */
|
|
981
|
+
export interface GRPCAuth {
|
|
982
|
+
type: 'none' | 'basic' | 'bearer' | 'google-oauth' | 'insecure';
|
|
983
|
+
token?: string;
|
|
984
|
+
username?: string;
|
|
985
|
+
password?: string;
|
|
986
|
+
}
|
|
987
|
+
/** gRPC service */
|
|
988
|
+
export interface GRPCService {
|
|
989
|
+
name: string;
|
|
990
|
+
fullName: string;
|
|
991
|
+
methods: GRPCMethod[];
|
|
992
|
+
}
|
|
993
|
+
/** gRPC method */
|
|
994
|
+
export interface GRPCMethod {
|
|
995
|
+
name: string;
|
|
996
|
+
fullName: string;
|
|
997
|
+
requestType: string;
|
|
998
|
+
responseType: string;
|
|
999
|
+
clientStreaming: boolean;
|
|
1000
|
+
serverStreaming: boolean;
|
|
1001
|
+
requestSchema?: object;
|
|
1002
|
+
responseSchema?: object;
|
|
1003
|
+
}
|
|
1004
|
+
/** gRPC request */
|
|
1005
|
+
export interface GRPCRequest {
|
|
1006
|
+
id: string;
|
|
1007
|
+
connectionId: string;
|
|
1008
|
+
service: string;
|
|
1009
|
+
method: string;
|
|
1010
|
+
message: object;
|
|
1011
|
+
metadata?: Record<string, string>;
|
|
1012
|
+
deadline?: number;
|
|
1013
|
+
}
|
|
1014
|
+
/** gRPC response */
|
|
1015
|
+
export interface GRPCResponse {
|
|
1016
|
+
id: string;
|
|
1017
|
+
requestId: string;
|
|
1018
|
+
status: GRPCStatus;
|
|
1019
|
+
messages: object[];
|
|
1020
|
+
metadata?: Record<string, string>;
|
|
1021
|
+
trailers?: Record<string, string>;
|
|
1022
|
+
duration: number;
|
|
1023
|
+
error?: GRPCError;
|
|
1024
|
+
}
|
|
1025
|
+
/** gRPC status */
|
|
1026
|
+
export interface GRPCStatus {
|
|
1027
|
+
code: number;
|
|
1028
|
+
details: string;
|
|
1029
|
+
}
|
|
1030
|
+
/** gRPC error */
|
|
1031
|
+
export interface GRPCError {
|
|
1032
|
+
code: number;
|
|
1033
|
+
message: string;
|
|
1034
|
+
details?: unknown[];
|
|
1035
|
+
}
|
|
1036
|
+
/** GraphQL playground config */
|
|
1037
|
+
export interface GraphQLPlaygroundConfig {
|
|
1038
|
+
id: string;
|
|
1039
|
+
name: string;
|
|
1040
|
+
endpoint: string;
|
|
1041
|
+
headers?: Record<string, string>;
|
|
1042
|
+
auth?: APIAuthentication;
|
|
1043
|
+
introspection?: boolean;
|
|
1044
|
+
subscriptionEndpoint?: string;
|
|
1045
|
+
schema?: string;
|
|
1046
|
+
tabs: GraphQLTab[];
|
|
1047
|
+
settings?: GraphQLPlaygroundSettings;
|
|
1048
|
+
}
|
|
1049
|
+
/** GraphQL tab */
|
|
1050
|
+
export interface GraphQLTab {
|
|
1051
|
+
id: string;
|
|
1052
|
+
name: string;
|
|
1053
|
+
query: string;
|
|
1054
|
+
variables?: string;
|
|
1055
|
+
headers?: Record<string, string>;
|
|
1056
|
+
operationName?: string;
|
|
1057
|
+
responses: GraphQLResponse[];
|
|
1058
|
+
}
|
|
1059
|
+
/** GraphQL response */
|
|
1060
|
+
export interface GraphQLResponse {
|
|
1061
|
+
id: string;
|
|
1062
|
+
timestamp: Date;
|
|
1063
|
+
data?: unknown;
|
|
1064
|
+
errors?: GraphQLError[];
|
|
1065
|
+
extensions?: unknown;
|
|
1066
|
+
duration: number;
|
|
1067
|
+
}
|
|
1068
|
+
/** GraphQL error */
|
|
1069
|
+
export interface GraphQLError {
|
|
1070
|
+
message: string;
|
|
1071
|
+
locations?: Array<{
|
|
1072
|
+
line: number;
|
|
1073
|
+
column: number;
|
|
1074
|
+
}>;
|
|
1075
|
+
path?: Array<string | number>;
|
|
1076
|
+
extensions?: unknown;
|
|
1077
|
+
}
|
|
1078
|
+
/** GraphQL playground settings */
|
|
1079
|
+
export interface GraphQLPlaygroundSettings {
|
|
1080
|
+
theme?: 'light' | 'dark';
|
|
1081
|
+
'editor.theme'?: string;
|
|
1082
|
+
'editor.fontFamily'?: string;
|
|
1083
|
+
'editor.fontSize'?: number;
|
|
1084
|
+
'editor.reuseHeaders'?: boolean;
|
|
1085
|
+
'tracing.hideTracingResponse'?: boolean;
|
|
1086
|
+
'queryPlan.hideQueryPlanResponse'?: boolean;
|
|
1087
|
+
'schema.polling.enable'?: boolean;
|
|
1088
|
+
'schema.polling.interval'?: number;
|
|
1089
|
+
}
|
|
1090
|
+
/** GraphQL subscription */
|
|
1091
|
+
export interface GraphQLSubscription {
|
|
1092
|
+
id: string;
|
|
1093
|
+
tabId: string;
|
|
1094
|
+
query: string;
|
|
1095
|
+
variables?: object;
|
|
1096
|
+
status: 'connecting' | 'connected' | 'error' | 'closed';
|
|
1097
|
+
messages: GraphQLSubscriptionMessage[];
|
|
1098
|
+
startTime: Date;
|
|
1099
|
+
error?: string;
|
|
1100
|
+
}
|
|
1101
|
+
/** GraphQL subscription message */
|
|
1102
|
+
export interface GraphQLSubscriptionMessage {
|
|
1103
|
+
id: string;
|
|
1104
|
+
timestamp: Date;
|
|
1105
|
+
type: 'data' | 'error' | 'complete';
|
|
1106
|
+
payload?: unknown;
|
|
1107
|
+
}
|
|
1108
|
+
/** API client configuration */
|
|
1109
|
+
export interface APIClientConfig {
|
|
1110
|
+
/** Theme */
|
|
1111
|
+
theme?: 'light' | 'dark' | 'system';
|
|
1112
|
+
/** Request timeout (ms) */
|
|
1113
|
+
timeout?: number;
|
|
1114
|
+
/** Follow redirects */
|
|
1115
|
+
followRedirects?: boolean;
|
|
1116
|
+
/** Max redirects */
|
|
1117
|
+
maxRedirects?: number;
|
|
1118
|
+
/** Verify SSL */
|
|
1119
|
+
verifySSL?: boolean;
|
|
1120
|
+
/** Proxy settings */
|
|
1121
|
+
proxy?: ProxySettings;
|
|
1122
|
+
/** Default headers */
|
|
1123
|
+
defaultHeaders?: Record<string, string>;
|
|
1124
|
+
/** Auto-save history */
|
|
1125
|
+
saveHistory?: boolean;
|
|
1126
|
+
/** Max history items */
|
|
1127
|
+
maxHistoryItems?: number;
|
|
1128
|
+
/** Pretty print responses */
|
|
1129
|
+
prettyPrint?: boolean;
|
|
1130
|
+
/** Syntax highlighting */
|
|
1131
|
+
syntaxHighlight?: boolean;
|
|
1132
|
+
/** Editor settings */
|
|
1133
|
+
editor?: EditorSettings;
|
|
1134
|
+
/** Keyboard shortcuts */
|
|
1135
|
+
shortcuts?: Record<string, string>;
|
|
1136
|
+
}
|
|
1137
|
+
/** Editor settings */
|
|
1138
|
+
export interface EditorSettings {
|
|
1139
|
+
fontFamily?: string;
|
|
1140
|
+
fontSize?: number;
|
|
1141
|
+
tabSize?: number;
|
|
1142
|
+
wordWrap?: boolean;
|
|
1143
|
+
minimap?: boolean;
|
|
1144
|
+
lineNumbers?: boolean;
|
|
1145
|
+
}
|
|
1146
|
+
//# sourceMappingURL=api-testing.d.ts.map
|