@yaakapp/api 0.3.4 → 0.4.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/lib/bindings/{events.d.ts → gen_events.d.ts} +219 -20
- package/lib/bindings/{models.d.ts → gen_models.d.ts} +17 -0
- package/lib/helpers.d.ts +1 -0
- package/lib/index.d.ts +2 -2
- package/lib/index.js +2 -2
- package/lib/plugins/AuthenticationPlugin.d.ts +12 -3
- package/lib/plugins/Context.d.ts +21 -7
- package/lib/plugins/HttpRequestActionPlugin.d.ts +1 -1
- package/lib/plugins/ImporterPlugin.d.ts +8 -8
- package/lib/plugins/TemplateFunctionPlugin.d.ts +1 -1
- package/package.json +1 -1
- /package/lib/bindings/{events.js → gen_events.js} +0 -0
- /package/lib/bindings/{models.js → gen_models.js} +0 -0
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { Environment } from "./
|
|
2
|
-
import type { Folder } from "./
|
|
3
|
-
import type { GrpcRequest } from "./
|
|
4
|
-
import type { HttpRequest } from "./
|
|
5
|
-
import type { HttpResponse } from "./
|
|
1
|
+
import type { Environment } from "./gen_models.js";
|
|
2
|
+
import type { Folder } from "./gen_models.js";
|
|
3
|
+
import type { GrpcRequest } from "./gen_models.js";
|
|
4
|
+
import type { HttpRequest } from "./gen_models.js";
|
|
5
|
+
import type { HttpResponse } from "./gen_models.js";
|
|
6
6
|
import type { JsonValue } from "./serde_json/JsonValue.js";
|
|
7
|
-
import type {
|
|
7
|
+
import type { WebsocketRequest } from "./gen_models.js";
|
|
8
|
+
import type { Workspace } from "./gen_models.js";
|
|
8
9
|
export type BootRequest = {
|
|
9
10
|
dir: string;
|
|
10
11
|
watch: boolean;
|
|
@@ -13,9 +14,21 @@ export type BootResponse = {
|
|
|
13
14
|
name: string;
|
|
14
15
|
version: string;
|
|
15
16
|
};
|
|
17
|
+
export type CallHttpAuthenticationActionArgs = {
|
|
18
|
+
contextId: string;
|
|
19
|
+
values: {
|
|
20
|
+
[key in string]?: JsonPrimitive;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export type CallHttpAuthenticationActionRequest = {
|
|
24
|
+
index: number;
|
|
25
|
+
pluginRefId: string;
|
|
26
|
+
args: CallHttpAuthenticationActionArgs;
|
|
27
|
+
};
|
|
16
28
|
export type CallHttpAuthenticationRequest = {
|
|
17
|
-
|
|
18
|
-
|
|
29
|
+
contextId: string;
|
|
30
|
+
values: {
|
|
31
|
+
[key in string]?: JsonPrimitive;
|
|
19
32
|
};
|
|
20
33
|
method: string;
|
|
21
34
|
url: string;
|
|
@@ -32,7 +45,7 @@ export type CallHttpRequestActionArgs = {
|
|
|
32
45
|
httpRequest: HttpRequest;
|
|
33
46
|
};
|
|
34
47
|
export type CallHttpRequestActionRequest = {
|
|
35
|
-
|
|
48
|
+
index: number;
|
|
36
49
|
pluginRefId: string;
|
|
37
50
|
args: CallHttpRequestActionArgs;
|
|
38
51
|
};
|
|
@@ -49,10 +62,27 @@ export type CallTemplateFunctionRequest = {
|
|
|
49
62
|
export type CallTemplateFunctionResponse = {
|
|
50
63
|
value: string | null;
|
|
51
64
|
};
|
|
52
|
-
export type
|
|
65
|
+
export type CloseWindowRequest = {
|
|
66
|
+
label: string;
|
|
67
|
+
};
|
|
68
|
+
export type Color = "primary" | "secondary" | "info" | "success" | "notice" | "warning" | "danger";
|
|
69
|
+
export type CompletionOptionType = "constant" | "variable";
|
|
70
|
+
export type Content = {
|
|
71
|
+
"type": "text";
|
|
72
|
+
content: string;
|
|
73
|
+
} | {
|
|
74
|
+
"type": "markdown";
|
|
75
|
+
content: string;
|
|
76
|
+
};
|
|
53
77
|
export type CopyTextRequest = {
|
|
54
78
|
text: string;
|
|
55
79
|
};
|
|
80
|
+
export type DeleteKeyValueRequest = {
|
|
81
|
+
key: string;
|
|
82
|
+
};
|
|
83
|
+
export type DeleteKeyValueResponse = {
|
|
84
|
+
deleted: boolean;
|
|
85
|
+
};
|
|
56
86
|
export type EditorLanguage = "text" | "javascript" | "json" | "html" | "xml" | "graphql" | "markdown";
|
|
57
87
|
export type EmptyPayload = {};
|
|
58
88
|
export type ErrorResponse = {
|
|
@@ -97,9 +127,33 @@ export type FormInput = {
|
|
|
97
127
|
"type": "file";
|
|
98
128
|
} & FormInputFile | {
|
|
99
129
|
"type": "http_request";
|
|
100
|
-
} & FormInputHttpRequest
|
|
130
|
+
} & FormInputHttpRequest | {
|
|
131
|
+
"type": "accordion";
|
|
132
|
+
} & FormInputAccordion | {
|
|
133
|
+
"type": "banner";
|
|
134
|
+
} & FormInputBanner | {
|
|
135
|
+
"type": "markdown";
|
|
136
|
+
} & FormInputMarkdown;
|
|
137
|
+
export type FormInputAccordion = {
|
|
138
|
+
label: string;
|
|
139
|
+
inputs?: Array<FormInput>;
|
|
140
|
+
hidden?: boolean;
|
|
141
|
+
};
|
|
142
|
+
export type FormInputBanner = {
|
|
143
|
+
inputs?: Array<FormInput>;
|
|
144
|
+
hidden?: boolean;
|
|
145
|
+
color?: Color;
|
|
146
|
+
};
|
|
101
147
|
export type FormInputBase = {
|
|
148
|
+
/**
|
|
149
|
+
* The name of the input. The value will be stored at this object attribute in the resulting data
|
|
150
|
+
*/
|
|
102
151
|
name: string;
|
|
152
|
+
/**
|
|
153
|
+
* Whether this input is visible for the given configuration. Use this to
|
|
154
|
+
* make branching forms.
|
|
155
|
+
*/
|
|
156
|
+
hidden?: boolean;
|
|
103
157
|
/**
|
|
104
158
|
* Whether the user must fill in the argument
|
|
105
159
|
*/
|
|
@@ -116,9 +170,18 @@ export type FormInputBase = {
|
|
|
116
170
|
* The default value
|
|
117
171
|
*/
|
|
118
172
|
defaultValue?: string;
|
|
173
|
+
disabled?: boolean;
|
|
119
174
|
};
|
|
120
175
|
export type FormInputCheckbox = {
|
|
176
|
+
/**
|
|
177
|
+
* The name of the input. The value will be stored at this object attribute in the resulting data
|
|
178
|
+
*/
|
|
121
179
|
name: string;
|
|
180
|
+
/**
|
|
181
|
+
* Whether this input is visible for the given configuration. Use this to
|
|
182
|
+
* make branching forms.
|
|
183
|
+
*/
|
|
184
|
+
hidden?: boolean;
|
|
122
185
|
/**
|
|
123
186
|
* Whether the user must fill in the argument
|
|
124
187
|
*/
|
|
@@ -135,6 +198,7 @@ export type FormInputCheckbox = {
|
|
|
135
198
|
* The default value
|
|
136
199
|
*/
|
|
137
200
|
defaultValue?: string;
|
|
201
|
+
disabled?: boolean;
|
|
138
202
|
};
|
|
139
203
|
export type FormInputEditor = {
|
|
140
204
|
/**
|
|
@@ -149,7 +213,17 @@ export type FormInputEditor = {
|
|
|
149
213
|
* Language for syntax highlighting
|
|
150
214
|
*/
|
|
151
215
|
language?: EditorLanguage;
|
|
216
|
+
readOnly?: boolean;
|
|
217
|
+
completionOptions?: Array<GenericCompletionOption>;
|
|
218
|
+
/**
|
|
219
|
+
* The name of the input. The value will be stored at this object attribute in the resulting data
|
|
220
|
+
*/
|
|
152
221
|
name: string;
|
|
222
|
+
/**
|
|
223
|
+
* Whether this input is visible for the given configuration. Use this to
|
|
224
|
+
* make branching forms.
|
|
225
|
+
*/
|
|
226
|
+
hidden?: boolean;
|
|
153
227
|
/**
|
|
154
228
|
* Whether the user must fill in the argument
|
|
155
229
|
*/
|
|
@@ -166,6 +240,7 @@ export type FormInputEditor = {
|
|
|
166
240
|
* The default value
|
|
167
241
|
*/
|
|
168
242
|
defaultValue?: string;
|
|
243
|
+
disabled?: boolean;
|
|
169
244
|
};
|
|
170
245
|
export type FormInputFile = {
|
|
171
246
|
/**
|
|
@@ -179,7 +254,15 @@ export type FormInputFile = {
|
|
|
179
254
|
directory?: boolean;
|
|
180
255
|
defaultPath?: string;
|
|
181
256
|
filters?: Array<FileFilter>;
|
|
257
|
+
/**
|
|
258
|
+
* The name of the input. The value will be stored at this object attribute in the resulting data
|
|
259
|
+
*/
|
|
182
260
|
name: string;
|
|
261
|
+
/**
|
|
262
|
+
* Whether this input is visible for the given configuration. Use this to
|
|
263
|
+
* make branching forms.
|
|
264
|
+
*/
|
|
265
|
+
hidden?: boolean;
|
|
183
266
|
/**
|
|
184
267
|
* Whether the user must fill in the argument
|
|
185
268
|
*/
|
|
@@ -196,9 +279,18 @@ export type FormInputFile = {
|
|
|
196
279
|
* The default value
|
|
197
280
|
*/
|
|
198
281
|
defaultValue?: string;
|
|
282
|
+
disabled?: boolean;
|
|
199
283
|
};
|
|
200
284
|
export type FormInputHttpRequest = {
|
|
285
|
+
/**
|
|
286
|
+
* The name of the input. The value will be stored at this object attribute in the resulting data
|
|
287
|
+
*/
|
|
201
288
|
name: string;
|
|
289
|
+
/**
|
|
290
|
+
* Whether this input is visible for the given configuration. Use this to
|
|
291
|
+
* make branching forms.
|
|
292
|
+
*/
|
|
293
|
+
hidden?: boolean;
|
|
202
294
|
/**
|
|
203
295
|
* Whether the user must fill in the argument
|
|
204
296
|
*/
|
|
@@ -215,13 +307,26 @@ export type FormInputHttpRequest = {
|
|
|
215
307
|
* The default value
|
|
216
308
|
*/
|
|
217
309
|
defaultValue?: string;
|
|
310
|
+
disabled?: boolean;
|
|
311
|
+
};
|
|
312
|
+
export type FormInputMarkdown = {
|
|
313
|
+
content: string;
|
|
314
|
+
hidden?: boolean;
|
|
218
315
|
};
|
|
219
316
|
export type FormInputSelect = {
|
|
220
317
|
/**
|
|
221
318
|
* The options that will be available in the select input
|
|
222
319
|
*/
|
|
223
320
|
options: Array<FormInputSelectOption>;
|
|
321
|
+
/**
|
|
322
|
+
* The name of the input. The value will be stored at this object attribute in the resulting data
|
|
323
|
+
*/
|
|
224
324
|
name: string;
|
|
325
|
+
/**
|
|
326
|
+
* Whether this input is visible for the given configuration. Use this to
|
|
327
|
+
* make branching forms.
|
|
328
|
+
*/
|
|
329
|
+
hidden?: boolean;
|
|
225
330
|
/**
|
|
226
331
|
* Whether the user must fill in the argument
|
|
227
332
|
*/
|
|
@@ -238,9 +343,10 @@ export type FormInputSelect = {
|
|
|
238
343
|
* The default value
|
|
239
344
|
*/
|
|
240
345
|
defaultValue?: string;
|
|
346
|
+
disabled?: boolean;
|
|
241
347
|
};
|
|
242
348
|
export type FormInputSelectOption = {
|
|
243
|
-
|
|
349
|
+
label: string;
|
|
244
350
|
value: string;
|
|
245
351
|
};
|
|
246
352
|
export type FormInputText = {
|
|
@@ -252,7 +358,20 @@ export type FormInputText = {
|
|
|
252
358
|
* Placeholder for the text input
|
|
253
359
|
*/
|
|
254
360
|
password?: boolean;
|
|
361
|
+
/**
|
|
362
|
+
* Whether to allow newlines in the input, like a <textarea/>
|
|
363
|
+
*/
|
|
364
|
+
multiLine?: boolean;
|
|
365
|
+
completionOptions?: Array<GenericCompletionOption>;
|
|
366
|
+
/**
|
|
367
|
+
* The name of the input. The value will be stored at this object attribute in the resulting data
|
|
368
|
+
*/
|
|
255
369
|
name: string;
|
|
370
|
+
/**
|
|
371
|
+
* Whether this input is visible for the given configuration. Use this to
|
|
372
|
+
* make branching forms.
|
|
373
|
+
*/
|
|
374
|
+
hidden?: boolean;
|
|
256
375
|
/**
|
|
257
376
|
* Whether the user must fill in the argument
|
|
258
377
|
*/
|
|
@@ -269,12 +388,30 @@ export type FormInputText = {
|
|
|
269
388
|
* The default value
|
|
270
389
|
*/
|
|
271
390
|
defaultValue?: string;
|
|
391
|
+
disabled?: boolean;
|
|
392
|
+
};
|
|
393
|
+
export type GenericCompletionOption = {
|
|
394
|
+
label: string;
|
|
395
|
+
detail?: string;
|
|
396
|
+
info?: string;
|
|
397
|
+
type?: CompletionOptionType;
|
|
398
|
+
boost?: number;
|
|
399
|
+
};
|
|
400
|
+
export type GetHttpAuthenticationConfigRequest = {
|
|
401
|
+
contextId: string;
|
|
402
|
+
values: {
|
|
403
|
+
[key in string]?: JsonPrimitive;
|
|
404
|
+
};
|
|
272
405
|
};
|
|
273
|
-
export type
|
|
406
|
+
export type GetHttpAuthenticationConfigResponse = {
|
|
407
|
+
args: Array<FormInput>;
|
|
408
|
+
pluginRefId: string;
|
|
409
|
+
actions?: Array<HttpAuthenticationAction>;
|
|
410
|
+
};
|
|
411
|
+
export type GetHttpAuthenticationSummaryResponse = {
|
|
274
412
|
name: string;
|
|
275
413
|
label: string;
|
|
276
414
|
shortLabel: string;
|
|
277
|
-
config: Array<FormInput>;
|
|
278
415
|
};
|
|
279
416
|
export type GetHttpRequestActionsRequest = Record<string, never>;
|
|
280
417
|
export type GetHttpRequestActionsResponse = {
|
|
@@ -287,20 +424,29 @@ export type GetHttpRequestByIdRequest = {
|
|
|
287
424
|
export type GetHttpRequestByIdResponse = {
|
|
288
425
|
httpRequest: HttpRequest | null;
|
|
289
426
|
};
|
|
427
|
+
export type GetKeyValueRequest = {
|
|
428
|
+
key: string;
|
|
429
|
+
};
|
|
430
|
+
export type GetKeyValueResponse = {
|
|
431
|
+
value?: string;
|
|
432
|
+
};
|
|
290
433
|
export type GetTemplateFunctionsResponse = {
|
|
291
434
|
functions: Array<TemplateFunction>;
|
|
292
435
|
pluginRefId: string;
|
|
293
436
|
};
|
|
437
|
+
export type HttpAuthenticationAction = {
|
|
438
|
+
label: string;
|
|
439
|
+
icon?: Icon;
|
|
440
|
+
};
|
|
294
441
|
export type HttpHeader = {
|
|
295
442
|
name: string;
|
|
296
443
|
value: string;
|
|
297
444
|
};
|
|
298
445
|
export type HttpRequestAction = {
|
|
299
|
-
key: string;
|
|
300
446
|
label: string;
|
|
301
447
|
icon?: Icon;
|
|
302
448
|
};
|
|
303
|
-
export type Icon = "copy" | "info" | "
|
|
449
|
+
export type Icon = "alert_triangle" | "check" | "check_circle" | "chevron_down" | "copy" | "info" | "pin" | "search" | "trash" | "_unknown";
|
|
304
450
|
export type ImportRequest = {
|
|
305
451
|
content: string;
|
|
306
452
|
};
|
|
@@ -310,6 +456,7 @@ export type ImportResources = {
|
|
|
310
456
|
folders: Array<Folder>;
|
|
311
457
|
httpRequests: Array<HttpRequest>;
|
|
312
458
|
grpcRequests: Array<GrpcRequest>;
|
|
459
|
+
websocketRequests: Array<WebsocketRequest>;
|
|
313
460
|
};
|
|
314
461
|
export type ImportResponse = {
|
|
315
462
|
resources: ImportResources;
|
|
@@ -365,26 +512,56 @@ export type InternalEventPayload = {
|
|
|
365
512
|
} & CallTemplateFunctionRequest | {
|
|
366
513
|
"type": "call_template_function_response";
|
|
367
514
|
} & CallTemplateFunctionResponse | {
|
|
368
|
-
"type": "
|
|
515
|
+
"type": "get_http_authentication_summary_request";
|
|
369
516
|
} & EmptyPayload | {
|
|
370
|
-
"type": "
|
|
371
|
-
} &
|
|
517
|
+
"type": "get_http_authentication_summary_response";
|
|
518
|
+
} & GetHttpAuthenticationSummaryResponse | {
|
|
519
|
+
"type": "get_http_authentication_config_request";
|
|
520
|
+
} & GetHttpAuthenticationConfigRequest | {
|
|
521
|
+
"type": "get_http_authentication_config_response";
|
|
522
|
+
} & GetHttpAuthenticationConfigResponse | {
|
|
372
523
|
"type": "call_http_authentication_request";
|
|
373
524
|
} & CallHttpAuthenticationRequest | {
|
|
374
525
|
"type": "call_http_authentication_response";
|
|
375
526
|
} & CallHttpAuthenticationResponse | {
|
|
527
|
+
"type": "call_http_authentication_action_request";
|
|
528
|
+
} & CallHttpAuthenticationActionRequest | {
|
|
529
|
+
"type": "call_http_authentication_action_response";
|
|
530
|
+
} & EmptyPayload | {
|
|
376
531
|
"type": "copy_text_request";
|
|
377
532
|
} & CopyTextRequest | {
|
|
533
|
+
"type": "copy_text_response";
|
|
534
|
+
} & EmptyPayload | {
|
|
378
535
|
"type": "render_http_request_request";
|
|
379
536
|
} & RenderHttpRequestRequest | {
|
|
380
537
|
"type": "render_http_request_response";
|
|
381
538
|
} & RenderHttpRequestResponse | {
|
|
539
|
+
"type": "get_key_value_request";
|
|
540
|
+
} & GetKeyValueRequest | {
|
|
541
|
+
"type": "get_key_value_response";
|
|
542
|
+
} & GetKeyValueResponse | {
|
|
543
|
+
"type": "set_key_value_request";
|
|
544
|
+
} & SetKeyValueRequest | {
|
|
545
|
+
"type": "set_key_value_response";
|
|
546
|
+
} & SetKeyValueResponse | {
|
|
547
|
+
"type": "delete_key_value_request";
|
|
548
|
+
} & DeleteKeyValueRequest | {
|
|
549
|
+
"type": "delete_key_value_response";
|
|
550
|
+
} & DeleteKeyValueResponse | {
|
|
551
|
+
"type": "open_window_request";
|
|
552
|
+
} & OpenWindowRequest | {
|
|
553
|
+
"type": "window_navigate_event";
|
|
554
|
+
} & WindowNavigateEvent | {
|
|
555
|
+
"type": "close_window_request";
|
|
556
|
+
} & CloseWindowRequest | {
|
|
382
557
|
"type": "template_render_request";
|
|
383
558
|
} & TemplateRenderRequest | {
|
|
384
559
|
"type": "template_render_response";
|
|
385
560
|
} & TemplateRenderResponse | {
|
|
386
561
|
"type": "show_toast_request";
|
|
387
562
|
} & ShowToastRequest | {
|
|
563
|
+
"type": "show_toast_response";
|
|
564
|
+
} & EmptyPayload | {
|
|
388
565
|
"type": "prompt_text_request";
|
|
389
566
|
} & PromptTextRequest | {
|
|
390
567
|
"type": "prompt_text_response";
|
|
@@ -401,6 +578,16 @@ export type InternalEventPayload = {
|
|
|
401
578
|
} & EmptyPayload | {
|
|
402
579
|
"type": "error_response";
|
|
403
580
|
} & ErrorResponse;
|
|
581
|
+
export type JsonPrimitive = string | number | boolean | null;
|
|
582
|
+
export type OpenWindowRequest = {
|
|
583
|
+
url: string;
|
|
584
|
+
/**
|
|
585
|
+
* Label for the window. If not provided, a random one will be generated.
|
|
586
|
+
*/
|
|
587
|
+
label: string;
|
|
588
|
+
title?: string;
|
|
589
|
+
size?: WindowSize;
|
|
590
|
+
};
|
|
404
591
|
export type PromptTextRequest = {
|
|
405
592
|
id: string;
|
|
406
593
|
title: string;
|
|
@@ -433,11 +620,16 @@ export type RenderHttpRequestResponse = {
|
|
|
433
620
|
};
|
|
434
621
|
export type RenderPurpose = "send" | "preview";
|
|
435
622
|
export type SendHttpRequestRequest = {
|
|
436
|
-
httpRequest: HttpRequest
|
|
623
|
+
httpRequest: Partial<HttpRequest>;
|
|
437
624
|
};
|
|
438
625
|
export type SendHttpRequestResponse = {
|
|
439
626
|
httpResponse: HttpResponse;
|
|
440
627
|
};
|
|
628
|
+
export type SetKeyValueRequest = {
|
|
629
|
+
key: string;
|
|
630
|
+
value: string;
|
|
631
|
+
};
|
|
632
|
+
export type SetKeyValueResponse = {};
|
|
441
633
|
export type ShowToastRequest = {
|
|
442
634
|
message: string;
|
|
443
635
|
color?: Color;
|
|
@@ -466,3 +658,10 @@ export type WindowContext = {
|
|
|
466
658
|
"type": "label";
|
|
467
659
|
label: string;
|
|
468
660
|
};
|
|
661
|
+
export type WindowNavigateEvent = {
|
|
662
|
+
url: string;
|
|
663
|
+
};
|
|
664
|
+
export type WindowSize = {
|
|
665
|
+
width: number;
|
|
666
|
+
height: number;
|
|
667
|
+
};
|
|
@@ -105,6 +105,23 @@ export type HttpUrlParameter = {
|
|
|
105
105
|
value: string;
|
|
106
106
|
id?: string;
|
|
107
107
|
};
|
|
108
|
+
export type WebsocketRequest = {
|
|
109
|
+
model: "websocket_request";
|
|
110
|
+
id: string;
|
|
111
|
+
createdAt: string;
|
|
112
|
+
updatedAt: string;
|
|
113
|
+
workspaceId: string;
|
|
114
|
+
folderId: string | null;
|
|
115
|
+
authentication: Record<string, any>;
|
|
116
|
+
authenticationType: string | null;
|
|
117
|
+
description: string;
|
|
118
|
+
headers: Array<HttpRequestHeader>;
|
|
119
|
+
message: string;
|
|
120
|
+
name: string;
|
|
121
|
+
sortPriority: number;
|
|
122
|
+
url: string;
|
|
123
|
+
urlParameters: Array<HttpUrlParameter>;
|
|
124
|
+
};
|
|
108
125
|
export type Workspace = {
|
|
109
126
|
model: "workspace";
|
|
110
127
|
id: string;
|
package/lib/helpers.d.ts
CHANGED
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -14,5 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./bindings/
|
|
18
|
-
__exportStar(require("./bindings/
|
|
17
|
+
__exportStar(require("./bindings/gen_models"), exports);
|
|
18
|
+
__exportStar(require("./bindings/gen_events"), exports);
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
import { CallHttpAuthenticationRequest, CallHttpAuthenticationResponse,
|
|
1
|
+
import { CallHttpAuthenticationActionArgs, CallHttpAuthenticationRequest, CallHttpAuthenticationResponse, FormInput, GetHttpAuthenticationConfigRequest, GetHttpAuthenticationSummaryResponse, HttpAuthenticationAction } from '../bindings/gen_events';
|
|
2
|
+
import { MaybePromise } from '../helpers';
|
|
2
3
|
import { Context } from './Context';
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
type DynamicFormInput = FormInput & {
|
|
5
|
+
dynamic(ctx: Context, args: GetHttpAuthenticationConfigRequest): MaybePromise<Partial<FormInput> | undefined | null>;
|
|
5
6
|
};
|
|
7
|
+
export type AuthenticationPlugin = GetHttpAuthenticationSummaryResponse & {
|
|
8
|
+
args: (FormInput | DynamicFormInput)[];
|
|
9
|
+
onApply(ctx: Context, args: CallHttpAuthenticationRequest): MaybePromise<CallHttpAuthenticationResponse>;
|
|
10
|
+
actions?: (HttpAuthenticationAction & {
|
|
11
|
+
onSelect(ctx: Context, args: CallHttpAuthenticationActionArgs): Promise<void> | void;
|
|
12
|
+
})[];
|
|
13
|
+
};
|
|
14
|
+
export {};
|
package/lib/plugins/Context.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FindHttpResponsesRequest, FindHttpResponsesResponse, GetHttpRequestByIdRequest, GetHttpRequestByIdResponse, PromptTextRequest, PromptTextResponse, RenderHttpRequestRequest, RenderHttpRequestResponse, SendHttpRequestRequest, SendHttpRequestResponse, ShowToastRequest, TemplateRenderRequest, TemplateRenderResponse } from
|
|
1
|
+
import type { FindHttpResponsesRequest, FindHttpResponsesResponse, GetHttpRequestByIdRequest, GetHttpRequestByIdResponse, OpenWindowRequest, PromptTextRequest, PromptTextResponse, RenderHttpRequestRequest, RenderHttpRequestResponse, SendHttpRequestRequest, SendHttpRequestResponse, ShowToastRequest, TemplateRenderRequest, TemplateRenderResponse } from '../bindings/gen_events.ts';
|
|
2
2
|
export interface Context {
|
|
3
3
|
clipboard: {
|
|
4
4
|
copyText(text: string): Promise<void>;
|
|
@@ -7,17 +7,31 @@ export interface Context {
|
|
|
7
7
|
show(args: ShowToastRequest): Promise<void>;
|
|
8
8
|
};
|
|
9
9
|
prompt: {
|
|
10
|
-
text(args: PromptTextRequest): Promise<PromptTextResponse[
|
|
10
|
+
text(args: PromptTextRequest): Promise<PromptTextResponse['value']>;
|
|
11
|
+
};
|
|
12
|
+
store: {
|
|
13
|
+
set<T>(key: string, value: T): Promise<void>;
|
|
14
|
+
get<T>(key: string): Promise<T | undefined>;
|
|
15
|
+
delete(key: string): Promise<boolean>;
|
|
16
|
+
};
|
|
17
|
+
window: {
|
|
18
|
+
openUrl(args: OpenWindowRequest & {
|
|
19
|
+
onNavigate?: (args: {
|
|
20
|
+
url: string;
|
|
21
|
+
}) => void;
|
|
22
|
+
}): Promise<{
|
|
23
|
+
close: () => void;
|
|
24
|
+
}>;
|
|
11
25
|
};
|
|
12
26
|
httpRequest: {
|
|
13
|
-
send(args: SendHttpRequestRequest): Promise<SendHttpRequestResponse[
|
|
14
|
-
getById(args: GetHttpRequestByIdRequest): Promise<GetHttpRequestByIdResponse[
|
|
15
|
-
render(args: RenderHttpRequestRequest): Promise<RenderHttpRequestResponse[
|
|
27
|
+
send(args: SendHttpRequestRequest): Promise<SendHttpRequestResponse['httpResponse']>;
|
|
28
|
+
getById(args: GetHttpRequestByIdRequest): Promise<GetHttpRequestByIdResponse['httpRequest']>;
|
|
29
|
+
render(args: RenderHttpRequestRequest): Promise<RenderHttpRequestResponse['httpRequest']>;
|
|
16
30
|
};
|
|
17
31
|
httpResponse: {
|
|
18
|
-
find(args: FindHttpResponsesRequest): Promise<FindHttpResponsesResponse[
|
|
32
|
+
find(args: FindHttpResponsesRequest): Promise<FindHttpResponsesResponse['httpResponses']>;
|
|
19
33
|
};
|
|
20
34
|
templates: {
|
|
21
|
-
render(args: TemplateRenderRequest): Promise<TemplateRenderResponse[
|
|
35
|
+
render(args: TemplateRenderRequest): Promise<TemplateRenderResponse['data']>;
|
|
22
36
|
};
|
|
23
37
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CallHttpRequestActionArgs, HttpRequestAction } from '../bindings/
|
|
1
|
+
import type { CallHttpRequestActionArgs, HttpRequestAction } from '../bindings/gen_events';
|
|
2
2
|
import type { Context } from './Context';
|
|
3
3
|
export type HttpRequestActionPlugin = HttpRequestAction & {
|
|
4
4
|
onSelect(ctx: Context, args: CallHttpRequestActionArgs): Promise<void> | void;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Environment, Folder, GrpcRequest, HttpRequest, Workspace } from
|
|
2
|
-
import type { AtLeast } from
|
|
3
|
-
import type { Context } from
|
|
1
|
+
import { Environment, Folder, GrpcRequest, HttpRequest, Workspace } from '../bindings/gen_models';
|
|
2
|
+
import type { AtLeast } from '../helpers';
|
|
3
|
+
import type { Context } from './Context';
|
|
4
4
|
type ImportPluginResponse = null | {
|
|
5
5
|
resources: {
|
|
6
|
-
workspaces: AtLeast<Workspace,
|
|
7
|
-
environments: AtLeast<Environment,
|
|
8
|
-
folders: AtLeast<Folder,
|
|
9
|
-
httpRequests: AtLeast<HttpRequest,
|
|
10
|
-
grpcRequests: AtLeast<GrpcRequest,
|
|
6
|
+
workspaces: AtLeast<Workspace, 'name' | 'id' | 'model'>[];
|
|
7
|
+
environments: AtLeast<Environment, 'name' | 'id' | 'model' | 'workspaceId'>[];
|
|
8
|
+
folders: AtLeast<Folder, 'name' | 'id' | 'model' | 'workspaceId'>[];
|
|
9
|
+
httpRequests: AtLeast<HttpRequest, 'name' | 'id' | 'model' | 'workspaceId'>[];
|
|
10
|
+
grpcRequests: AtLeast<GrpcRequest, 'name' | 'id' | 'model' | 'workspaceId'>[];
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
13
|
export type ImporterPlugin = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CallTemplateFunctionArgs, TemplateFunction } from "../bindings/
|
|
1
|
+
import { CallTemplateFunctionArgs, TemplateFunction } from "../bindings/gen_events";
|
|
2
2
|
import { Context } from "./Context";
|
|
3
3
|
export type TemplateFunctionPlugin = TemplateFunction & {
|
|
4
4
|
onRender(ctx: Context, args: CallTemplateFunctionArgs): Promise<string | null>;
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|