@yaakapp/api 0.3.3 → 0.4.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/lib/bindings/{events.d.ts → gen_events.d.ts} +224 -22
- package/lib/bindings/gen_events.js +2 -0
- package/lib/bindings/gen_models.js +3 -0
- package/lib/bindings/serde_json/JsonValue.js +3 -0
- package/lib/helpers.d.ts +1 -0
- package/lib/helpers.js +2 -0
- package/lib/index.d.ts +4 -4
- package/lib/index.js +18 -0
- package/lib/plugins/AuthenticationPlugin.d.ts +13 -4
- package/lib/plugins/AuthenticationPlugin.js +2 -0
- package/lib/plugins/Context.d.ts +21 -7
- package/lib/plugins/Context.js +2 -0
- package/lib/plugins/FilterPlugin.d.ts +1 -1
- package/lib/plugins/FilterPlugin.js +2 -0
- package/lib/plugins/HttpRequestActionPlugin.d.ts +2 -2
- package/lib/plugins/HttpRequestActionPlugin.js +2 -0
- package/lib/plugins/ImporterPlugin.d.ts +8 -8
- package/lib/plugins/ImporterPlugin.js +2 -0
- package/lib/plugins/TemplateFunctionPlugin.d.ts +2 -2
- package/lib/plugins/TemplateFunctionPlugin.js +2 -0
- package/lib/plugins/ThemePlugin.d.ts +3 -3
- package/lib/plugins/ThemePlugin.js +2 -0
- package/lib/plugins/index.d.ts +7 -7
- package/lib/plugins/index.js +2 -0
- package/lib/themes/Theme.d.ts +39 -0
- package/lib/themes/index.d.ts +1 -1
- package/lib/themes/index.js +2 -0
- package/package.json +1 -1
- /package/lib/bindings/{models.d.ts → gen_models.d.ts} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
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 { Workspace } from "./
|
|
7
|
+
import type { Workspace } from "./gen_models.js";
|
|
8
8
|
export type BootRequest = {
|
|
9
9
|
dir: string;
|
|
10
10
|
watch: boolean;
|
|
@@ -13,9 +13,21 @@ export type BootResponse = {
|
|
|
13
13
|
name: string;
|
|
14
14
|
version: string;
|
|
15
15
|
};
|
|
16
|
+
export type CallHttpAuthenticationActionArgs = {
|
|
17
|
+
contextId: string;
|
|
18
|
+
values: {
|
|
19
|
+
[key in string]?: JsonPrimitive;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export type CallHttpAuthenticationActionRequest = {
|
|
23
|
+
index: number;
|
|
24
|
+
pluginRefId: string;
|
|
25
|
+
args: CallHttpAuthenticationActionArgs;
|
|
26
|
+
};
|
|
16
27
|
export type CallHttpAuthenticationRequest = {
|
|
17
|
-
|
|
18
|
-
|
|
28
|
+
contextId: string;
|
|
29
|
+
values: {
|
|
30
|
+
[key in string]?: JsonPrimitive;
|
|
19
31
|
};
|
|
20
32
|
method: string;
|
|
21
33
|
url: string;
|
|
@@ -32,7 +44,7 @@ export type CallHttpRequestActionArgs = {
|
|
|
32
44
|
httpRequest: HttpRequest;
|
|
33
45
|
};
|
|
34
46
|
export type CallHttpRequestActionRequest = {
|
|
35
|
-
|
|
47
|
+
index: number;
|
|
36
48
|
pluginRefId: string;
|
|
37
49
|
args: CallHttpRequestActionArgs;
|
|
38
50
|
};
|
|
@@ -49,12 +61,32 @@ export type CallTemplateFunctionRequest = {
|
|
|
49
61
|
export type CallTemplateFunctionResponse = {
|
|
50
62
|
value: string | null;
|
|
51
63
|
};
|
|
52
|
-
export type
|
|
64
|
+
export type CloseWindowRequest = {
|
|
65
|
+
label: string;
|
|
66
|
+
};
|
|
67
|
+
export type Color = "primary" | "secondary" | "info" | "success" | "notice" | "warning" | "danger";
|
|
68
|
+
export type CompletionOptionType = "constant" | "variable";
|
|
69
|
+
export type Content = {
|
|
70
|
+
"type": "text";
|
|
71
|
+
content: string;
|
|
72
|
+
} | {
|
|
73
|
+
"type": "markdown";
|
|
74
|
+
content: string;
|
|
75
|
+
};
|
|
53
76
|
export type CopyTextRequest = {
|
|
54
77
|
text: string;
|
|
55
78
|
};
|
|
79
|
+
export type DeleteKeyValueRequest = {
|
|
80
|
+
key: string;
|
|
81
|
+
};
|
|
82
|
+
export type DeleteKeyValueResponse = {
|
|
83
|
+
deleted: boolean;
|
|
84
|
+
};
|
|
56
85
|
export type EditorLanguage = "text" | "javascript" | "json" | "html" | "xml" | "graphql" | "markdown";
|
|
57
86
|
export type EmptyPayload = {};
|
|
87
|
+
export type ErrorResponse = {
|
|
88
|
+
error: string;
|
|
89
|
+
};
|
|
58
90
|
export type ExportHttpRequestRequest = {
|
|
59
91
|
httpRequest: HttpRequest;
|
|
60
92
|
};
|
|
@@ -94,9 +126,33 @@ export type FormInput = {
|
|
|
94
126
|
"type": "file";
|
|
95
127
|
} & FormInputFile | {
|
|
96
128
|
"type": "http_request";
|
|
97
|
-
} & FormInputHttpRequest
|
|
129
|
+
} & FormInputHttpRequest | {
|
|
130
|
+
"type": "accordion";
|
|
131
|
+
} & FormInputAccordion | {
|
|
132
|
+
"type": "banner";
|
|
133
|
+
} & FormInputBanner | {
|
|
134
|
+
"type": "markdown";
|
|
135
|
+
} & FormInputMarkdown;
|
|
136
|
+
export type FormInputAccordion = {
|
|
137
|
+
label: string;
|
|
138
|
+
inputs?: Array<FormInput>;
|
|
139
|
+
hidden?: boolean;
|
|
140
|
+
};
|
|
141
|
+
export type FormInputBanner = {
|
|
142
|
+
inputs?: Array<FormInput>;
|
|
143
|
+
hidden?: boolean;
|
|
144
|
+
color?: Color;
|
|
145
|
+
};
|
|
98
146
|
export type FormInputBase = {
|
|
147
|
+
/**
|
|
148
|
+
* The name of the input. The value will be stored at this object attribute in the resulting data
|
|
149
|
+
*/
|
|
99
150
|
name: string;
|
|
151
|
+
/**
|
|
152
|
+
* Whether this input is visible for the given configuration. Use this to
|
|
153
|
+
* make branching forms.
|
|
154
|
+
*/
|
|
155
|
+
hidden?: boolean;
|
|
100
156
|
/**
|
|
101
157
|
* Whether the user must fill in the argument
|
|
102
158
|
*/
|
|
@@ -113,9 +169,18 @@ export type FormInputBase = {
|
|
|
113
169
|
* The default value
|
|
114
170
|
*/
|
|
115
171
|
defaultValue?: string;
|
|
172
|
+
disabled?: boolean;
|
|
116
173
|
};
|
|
117
174
|
export type FormInputCheckbox = {
|
|
175
|
+
/**
|
|
176
|
+
* The name of the input. The value will be stored at this object attribute in the resulting data
|
|
177
|
+
*/
|
|
118
178
|
name: string;
|
|
179
|
+
/**
|
|
180
|
+
* Whether this input is visible for the given configuration. Use this to
|
|
181
|
+
* make branching forms.
|
|
182
|
+
*/
|
|
183
|
+
hidden?: boolean;
|
|
119
184
|
/**
|
|
120
185
|
* Whether the user must fill in the argument
|
|
121
186
|
*/
|
|
@@ -132,6 +197,7 @@ export type FormInputCheckbox = {
|
|
|
132
197
|
* The default value
|
|
133
198
|
*/
|
|
134
199
|
defaultValue?: string;
|
|
200
|
+
disabled?: boolean;
|
|
135
201
|
};
|
|
136
202
|
export type FormInputEditor = {
|
|
137
203
|
/**
|
|
@@ -146,7 +212,17 @@ export type FormInputEditor = {
|
|
|
146
212
|
* Language for syntax highlighting
|
|
147
213
|
*/
|
|
148
214
|
language?: EditorLanguage;
|
|
215
|
+
readOnly?: boolean;
|
|
216
|
+
completionOptions?: Array<GenericCompletionOption>;
|
|
217
|
+
/**
|
|
218
|
+
* The name of the input. The value will be stored at this object attribute in the resulting data
|
|
219
|
+
*/
|
|
149
220
|
name: string;
|
|
221
|
+
/**
|
|
222
|
+
* Whether this input is visible for the given configuration. Use this to
|
|
223
|
+
* make branching forms.
|
|
224
|
+
*/
|
|
225
|
+
hidden?: boolean;
|
|
150
226
|
/**
|
|
151
227
|
* Whether the user must fill in the argument
|
|
152
228
|
*/
|
|
@@ -163,6 +239,7 @@ export type FormInputEditor = {
|
|
|
163
239
|
* The default value
|
|
164
240
|
*/
|
|
165
241
|
defaultValue?: string;
|
|
242
|
+
disabled?: boolean;
|
|
166
243
|
};
|
|
167
244
|
export type FormInputFile = {
|
|
168
245
|
/**
|
|
@@ -176,7 +253,15 @@ export type FormInputFile = {
|
|
|
176
253
|
directory?: boolean;
|
|
177
254
|
defaultPath?: string;
|
|
178
255
|
filters?: Array<FileFilter>;
|
|
256
|
+
/**
|
|
257
|
+
* The name of the input. The value will be stored at this object attribute in the resulting data
|
|
258
|
+
*/
|
|
179
259
|
name: string;
|
|
260
|
+
/**
|
|
261
|
+
* Whether this input is visible for the given configuration. Use this to
|
|
262
|
+
* make branching forms.
|
|
263
|
+
*/
|
|
264
|
+
hidden?: boolean;
|
|
180
265
|
/**
|
|
181
266
|
* Whether the user must fill in the argument
|
|
182
267
|
*/
|
|
@@ -193,9 +278,18 @@ export type FormInputFile = {
|
|
|
193
278
|
* The default value
|
|
194
279
|
*/
|
|
195
280
|
defaultValue?: string;
|
|
281
|
+
disabled?: boolean;
|
|
196
282
|
};
|
|
197
283
|
export type FormInputHttpRequest = {
|
|
284
|
+
/**
|
|
285
|
+
* The name of the input. The value will be stored at this object attribute in the resulting data
|
|
286
|
+
*/
|
|
198
287
|
name: string;
|
|
288
|
+
/**
|
|
289
|
+
* Whether this input is visible for the given configuration. Use this to
|
|
290
|
+
* make branching forms.
|
|
291
|
+
*/
|
|
292
|
+
hidden?: boolean;
|
|
199
293
|
/**
|
|
200
294
|
* Whether the user must fill in the argument
|
|
201
295
|
*/
|
|
@@ -212,13 +306,26 @@ export type FormInputHttpRequest = {
|
|
|
212
306
|
* The default value
|
|
213
307
|
*/
|
|
214
308
|
defaultValue?: string;
|
|
309
|
+
disabled?: boolean;
|
|
310
|
+
};
|
|
311
|
+
export type FormInputMarkdown = {
|
|
312
|
+
content: string;
|
|
313
|
+
hidden?: boolean;
|
|
215
314
|
};
|
|
216
315
|
export type FormInputSelect = {
|
|
217
316
|
/**
|
|
218
317
|
* The options that will be available in the select input
|
|
219
318
|
*/
|
|
220
319
|
options: Array<FormInputSelectOption>;
|
|
320
|
+
/**
|
|
321
|
+
* The name of the input. The value will be stored at this object attribute in the resulting data
|
|
322
|
+
*/
|
|
221
323
|
name: string;
|
|
324
|
+
/**
|
|
325
|
+
* Whether this input is visible for the given configuration. Use this to
|
|
326
|
+
* make branching forms.
|
|
327
|
+
*/
|
|
328
|
+
hidden?: boolean;
|
|
222
329
|
/**
|
|
223
330
|
* Whether the user must fill in the argument
|
|
224
331
|
*/
|
|
@@ -235,9 +342,10 @@ export type FormInputSelect = {
|
|
|
235
342
|
* The default value
|
|
236
343
|
*/
|
|
237
344
|
defaultValue?: string;
|
|
345
|
+
disabled?: boolean;
|
|
238
346
|
};
|
|
239
347
|
export type FormInputSelectOption = {
|
|
240
|
-
|
|
348
|
+
label: string;
|
|
241
349
|
value: string;
|
|
242
350
|
};
|
|
243
351
|
export type FormInputText = {
|
|
@@ -249,7 +357,20 @@ export type FormInputText = {
|
|
|
249
357
|
* Placeholder for the text input
|
|
250
358
|
*/
|
|
251
359
|
password?: boolean;
|
|
360
|
+
/**
|
|
361
|
+
* Whether to allow newlines in the input, like a <textarea/>
|
|
362
|
+
*/
|
|
363
|
+
multiLine?: boolean;
|
|
364
|
+
completionOptions?: Array<GenericCompletionOption>;
|
|
365
|
+
/**
|
|
366
|
+
* The name of the input. The value will be stored at this object attribute in the resulting data
|
|
367
|
+
*/
|
|
252
368
|
name: string;
|
|
369
|
+
/**
|
|
370
|
+
* Whether this input is visible for the given configuration. Use this to
|
|
371
|
+
* make branching forms.
|
|
372
|
+
*/
|
|
373
|
+
hidden?: boolean;
|
|
253
374
|
/**
|
|
254
375
|
* Whether the user must fill in the argument
|
|
255
376
|
*/
|
|
@@ -266,12 +387,30 @@ export type FormInputText = {
|
|
|
266
387
|
* The default value
|
|
267
388
|
*/
|
|
268
389
|
defaultValue?: string;
|
|
390
|
+
disabled?: boolean;
|
|
269
391
|
};
|
|
270
|
-
export type
|
|
392
|
+
export type GenericCompletionOption = {
|
|
393
|
+
label: string;
|
|
394
|
+
detail?: string;
|
|
395
|
+
info?: string;
|
|
396
|
+
type?: CompletionOptionType;
|
|
397
|
+
boost?: number;
|
|
398
|
+
};
|
|
399
|
+
export type GetHttpAuthenticationConfigRequest = {
|
|
400
|
+
contextId: string;
|
|
401
|
+
values: {
|
|
402
|
+
[key in string]?: JsonPrimitive;
|
|
403
|
+
};
|
|
404
|
+
};
|
|
405
|
+
export type GetHttpAuthenticationConfigResponse = {
|
|
406
|
+
args: Array<FormInput>;
|
|
407
|
+
pluginRefId: string;
|
|
408
|
+
actions?: Array<HttpAuthenticationAction>;
|
|
409
|
+
};
|
|
410
|
+
export type GetHttpAuthenticationSummaryResponse = {
|
|
271
411
|
name: string;
|
|
272
412
|
label: string;
|
|
273
413
|
shortLabel: string;
|
|
274
|
-
config: Array<FormInput>;
|
|
275
414
|
};
|
|
276
415
|
export type GetHttpRequestActionsRequest = Record<string, never>;
|
|
277
416
|
export type GetHttpRequestActionsResponse = {
|
|
@@ -284,20 +423,29 @@ export type GetHttpRequestByIdRequest = {
|
|
|
284
423
|
export type GetHttpRequestByIdResponse = {
|
|
285
424
|
httpRequest: HttpRequest | null;
|
|
286
425
|
};
|
|
426
|
+
export type GetKeyValueRequest = {
|
|
427
|
+
key: string;
|
|
428
|
+
};
|
|
429
|
+
export type GetKeyValueResponse = {
|
|
430
|
+
value?: string;
|
|
431
|
+
};
|
|
287
432
|
export type GetTemplateFunctionsResponse = {
|
|
288
433
|
functions: Array<TemplateFunction>;
|
|
289
434
|
pluginRefId: string;
|
|
290
435
|
};
|
|
436
|
+
export type HttpAuthenticationAction = {
|
|
437
|
+
label: string;
|
|
438
|
+
icon?: Icon;
|
|
439
|
+
};
|
|
291
440
|
export type HttpHeader = {
|
|
292
441
|
name: string;
|
|
293
442
|
value: string;
|
|
294
443
|
};
|
|
295
444
|
export type HttpRequestAction = {
|
|
296
|
-
key: string;
|
|
297
445
|
label: string;
|
|
298
446
|
icon?: Icon;
|
|
299
447
|
};
|
|
300
|
-
export type Icon = "copy" | "info" | "
|
|
448
|
+
export type Icon = "alert_triangle" | "check" | "check_circle" | "chevron_down" | "copy" | "info" | "pin" | "search" | "trash" | "_unknown";
|
|
301
449
|
export type ImportRequest = {
|
|
302
450
|
content: string;
|
|
303
451
|
};
|
|
@@ -316,8 +464,8 @@ export type InternalEvent = {
|
|
|
316
464
|
pluginRefId: string;
|
|
317
465
|
pluginName: string;
|
|
318
466
|
replyId: string | null;
|
|
319
|
-
payload: InternalEventPayload;
|
|
320
467
|
windowContext: WindowContext;
|
|
468
|
+
payload: InternalEventPayload;
|
|
321
469
|
};
|
|
322
470
|
export type InternalEventPayload = {
|
|
323
471
|
"type": "boot_request";
|
|
@@ -362,26 +510,56 @@ export type InternalEventPayload = {
|
|
|
362
510
|
} & CallTemplateFunctionRequest | {
|
|
363
511
|
"type": "call_template_function_response";
|
|
364
512
|
} & CallTemplateFunctionResponse | {
|
|
365
|
-
"type": "
|
|
513
|
+
"type": "get_http_authentication_summary_request";
|
|
366
514
|
} & EmptyPayload | {
|
|
367
|
-
"type": "
|
|
368
|
-
} &
|
|
515
|
+
"type": "get_http_authentication_summary_response";
|
|
516
|
+
} & GetHttpAuthenticationSummaryResponse | {
|
|
517
|
+
"type": "get_http_authentication_config_request";
|
|
518
|
+
} & GetHttpAuthenticationConfigRequest | {
|
|
519
|
+
"type": "get_http_authentication_config_response";
|
|
520
|
+
} & GetHttpAuthenticationConfigResponse | {
|
|
369
521
|
"type": "call_http_authentication_request";
|
|
370
522
|
} & CallHttpAuthenticationRequest | {
|
|
371
523
|
"type": "call_http_authentication_response";
|
|
372
524
|
} & CallHttpAuthenticationResponse | {
|
|
525
|
+
"type": "call_http_authentication_action_request";
|
|
526
|
+
} & CallHttpAuthenticationActionRequest | {
|
|
527
|
+
"type": "call_http_authentication_action_response";
|
|
528
|
+
} & EmptyPayload | {
|
|
373
529
|
"type": "copy_text_request";
|
|
374
530
|
} & CopyTextRequest | {
|
|
531
|
+
"type": "copy_text_response";
|
|
532
|
+
} & EmptyPayload | {
|
|
375
533
|
"type": "render_http_request_request";
|
|
376
534
|
} & RenderHttpRequestRequest | {
|
|
377
535
|
"type": "render_http_request_response";
|
|
378
536
|
} & RenderHttpRequestResponse | {
|
|
537
|
+
"type": "get_key_value_request";
|
|
538
|
+
} & GetKeyValueRequest | {
|
|
539
|
+
"type": "get_key_value_response";
|
|
540
|
+
} & GetKeyValueResponse | {
|
|
541
|
+
"type": "set_key_value_request";
|
|
542
|
+
} & SetKeyValueRequest | {
|
|
543
|
+
"type": "set_key_value_response";
|
|
544
|
+
} & SetKeyValueResponse | {
|
|
545
|
+
"type": "delete_key_value_request";
|
|
546
|
+
} & DeleteKeyValueRequest | {
|
|
547
|
+
"type": "delete_key_value_response";
|
|
548
|
+
} & DeleteKeyValueResponse | {
|
|
549
|
+
"type": "open_window_request";
|
|
550
|
+
} & OpenWindowRequest | {
|
|
551
|
+
"type": "window_navigate_event";
|
|
552
|
+
} & WindowNavigateEvent | {
|
|
553
|
+
"type": "close_window_request";
|
|
554
|
+
} & CloseWindowRequest | {
|
|
379
555
|
"type": "template_render_request";
|
|
380
556
|
} & TemplateRenderRequest | {
|
|
381
557
|
"type": "template_render_response";
|
|
382
558
|
} & TemplateRenderResponse | {
|
|
383
559
|
"type": "show_toast_request";
|
|
384
560
|
} & ShowToastRequest | {
|
|
561
|
+
"type": "show_toast_response";
|
|
562
|
+
} & EmptyPayload | {
|
|
385
563
|
"type": "prompt_text_request";
|
|
386
564
|
} & PromptTextRequest | {
|
|
387
565
|
"type": "prompt_text_response";
|
|
@@ -395,7 +573,19 @@ export type InternalEventPayload = {
|
|
|
395
573
|
"type": "find_http_responses_response";
|
|
396
574
|
} & FindHttpResponsesResponse | {
|
|
397
575
|
"type": "empty_response";
|
|
398
|
-
} & EmptyPayload
|
|
576
|
+
} & EmptyPayload | {
|
|
577
|
+
"type": "error_response";
|
|
578
|
+
} & ErrorResponse;
|
|
579
|
+
export type JsonPrimitive = string | number | boolean | null;
|
|
580
|
+
export type OpenWindowRequest = {
|
|
581
|
+
url: string;
|
|
582
|
+
/**
|
|
583
|
+
* Label for the window. If not provided, a random one will be generated.
|
|
584
|
+
*/
|
|
585
|
+
label: string;
|
|
586
|
+
title?: string;
|
|
587
|
+
size?: WindowSize;
|
|
588
|
+
};
|
|
399
589
|
export type PromptTextRequest = {
|
|
400
590
|
id: string;
|
|
401
591
|
title: string;
|
|
@@ -428,11 +618,16 @@ export type RenderHttpRequestResponse = {
|
|
|
428
618
|
};
|
|
429
619
|
export type RenderPurpose = "send" | "preview";
|
|
430
620
|
export type SendHttpRequestRequest = {
|
|
431
|
-
httpRequest: HttpRequest
|
|
621
|
+
httpRequest: Partial<HttpRequest>;
|
|
432
622
|
};
|
|
433
623
|
export type SendHttpRequestResponse = {
|
|
434
624
|
httpResponse: HttpResponse;
|
|
435
625
|
};
|
|
626
|
+
export type SetKeyValueRequest = {
|
|
627
|
+
key: string;
|
|
628
|
+
value: string;
|
|
629
|
+
};
|
|
630
|
+
export type SetKeyValueResponse = {};
|
|
436
631
|
export type ShowToastRequest = {
|
|
437
632
|
message: string;
|
|
438
633
|
color?: Color;
|
|
@@ -461,3 +656,10 @@ export type WindowContext = {
|
|
|
461
656
|
"type": "label";
|
|
462
657
|
label: string;
|
|
463
658
|
};
|
|
659
|
+
export type WindowNavigateEvent = {
|
|
660
|
+
url: string;
|
|
661
|
+
};
|
|
662
|
+
export type WindowSize = {
|
|
663
|
+
width: number;
|
|
664
|
+
height: number;
|
|
665
|
+
};
|
package/lib/helpers.d.ts
CHANGED
package/lib/helpers.js
ADDED
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type * from './plugins
|
|
2
|
-
export type * from './themes
|
|
3
|
-
export * from './bindings/
|
|
4
|
-
export * from './bindings/
|
|
1
|
+
export type * from './plugins';
|
|
2
|
+
export type * from './themes';
|
|
3
|
+
export * from './bindings/gen_models';
|
|
4
|
+
export * from './bindings/gen_events';
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./bindings/gen_models"), exports);
|
|
18
|
+
__exportStar(require("./bindings/gen_events"), exports);
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
import { CallHttpAuthenticationRequest, CallHttpAuthenticationResponse,
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { CallHttpAuthenticationActionArgs, CallHttpAuthenticationRequest, CallHttpAuthenticationResponse, FormInput, GetHttpAuthenticationConfigRequest, GetHttpAuthenticationSummaryResponse, HttpAuthenticationAction } from '../bindings/gen_events';
|
|
2
|
+
import { MaybePromise } from '../helpers';
|
|
3
|
+
import { Context } from './Context';
|
|
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,5 +1,5 @@
|
|
|
1
|
-
import type { CallHttpRequestActionArgs, HttpRequestAction } from
|
|
2
|
-
import type { Context } from
|
|
1
|
+
import type { CallHttpRequestActionArgs, HttpRequestAction } from '../bindings/gen_events';
|
|
2
|
+
import type { Context } from './Context';
|
|
3
3
|
export type HttpRequestActionPlugin = HttpRequestAction & {
|
|
4
4
|
onSelect(ctx: Context, args: CallHttpRequestActionArgs): Promise<void> | void;
|
|
5
5
|
};
|
|
@@ -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,5 +1,5 @@
|
|
|
1
|
-
import { CallTemplateFunctionArgs, TemplateFunction } from "../bindings/
|
|
2
|
-
import { Context } from "./Context
|
|
1
|
+
import { CallTemplateFunctionArgs, TemplateFunction } from "../bindings/gen_events";
|
|
2
|
+
import { Context } from "./Context";
|
|
3
3
|
export type TemplateFunctionPlugin = TemplateFunction & {
|
|
4
4
|
onRender(ctx: Context, args: CallTemplateFunctionArgs): Promise<string | null>;
|
|
5
5
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Context } from "./Context
|
|
1
|
+
import { Index } from "../themes";
|
|
2
|
+
import { Context } from "./Context";
|
|
3
3
|
export type ThemePlugin = {
|
|
4
4
|
name: string;
|
|
5
5
|
description?: string;
|
|
6
|
-
getTheme(ctx: Context, fileContents: string): Promise<
|
|
6
|
+
getTheme(ctx: Context, fileContents: string): Promise<Index>;
|
|
7
7
|
};
|
package/lib/plugins/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { AuthenticationPlugin } from './AuthenticationPlugin
|
|
2
|
-
import type { FilterPlugin } from './FilterPlugin
|
|
3
|
-
import type { HttpRequestActionPlugin } from './HttpRequestActionPlugin
|
|
4
|
-
import type { ImporterPlugin } from './ImporterPlugin
|
|
5
|
-
import type { TemplateFunctionPlugin } from './TemplateFunctionPlugin
|
|
6
|
-
import type { ThemePlugin } from './ThemePlugin
|
|
7
|
-
export type { Context } from './Context
|
|
1
|
+
import { AuthenticationPlugin } from './AuthenticationPlugin';
|
|
2
|
+
import type { FilterPlugin } from './FilterPlugin';
|
|
3
|
+
import type { HttpRequestActionPlugin } from './HttpRequestActionPlugin';
|
|
4
|
+
import type { ImporterPlugin } from './ImporterPlugin';
|
|
5
|
+
import type { TemplateFunctionPlugin } from './TemplateFunctionPlugin';
|
|
6
|
+
import type { ThemePlugin } from './ThemePlugin';
|
|
7
|
+
export type { Context } from './Context';
|
|
8
8
|
/**
|
|
9
9
|
* The global structure of a Yaak plugin
|
|
10
10
|
*/
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export type Colors = {
|
|
2
|
+
surface: string;
|
|
3
|
+
surfaceHighlight?: string;
|
|
4
|
+
surfaceActive?: string;
|
|
5
|
+
text: string;
|
|
6
|
+
textSubtle?: string;
|
|
7
|
+
textSubtlest?: string;
|
|
8
|
+
border?: string;
|
|
9
|
+
borderSubtle?: string;
|
|
10
|
+
borderFocus?: string;
|
|
11
|
+
shadow?: string;
|
|
12
|
+
backdrop?: string;
|
|
13
|
+
selection?: string;
|
|
14
|
+
primary?: string;
|
|
15
|
+
secondary?: string;
|
|
16
|
+
info?: string;
|
|
17
|
+
success?: string;
|
|
18
|
+
notice?: string;
|
|
19
|
+
warning?: string;
|
|
20
|
+
danger?: string;
|
|
21
|
+
};
|
|
22
|
+
export type Theme = Colors & {
|
|
23
|
+
id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
components?: Partial<{
|
|
26
|
+
dialog: Partial<Colors>;
|
|
27
|
+
menu: Partial<Colors>;
|
|
28
|
+
toast: Partial<Colors>;
|
|
29
|
+
sidebar: Partial<Colors>;
|
|
30
|
+
responsePane: Partial<Colors>;
|
|
31
|
+
appHeader: Partial<Colors>;
|
|
32
|
+
button: Partial<Colors>;
|
|
33
|
+
banner: Partial<Colors>;
|
|
34
|
+
placeholder: Partial<Colors>;
|
|
35
|
+
urlBar: Partial<Colors>;
|
|
36
|
+
editor: Partial<Colors>;
|
|
37
|
+
input: Partial<Colors>;
|
|
38
|
+
}>;
|
|
39
|
+
};
|
package/lib/themes/index.d.ts
CHANGED
package/package.json
CHANGED
|
File without changes
|