@yaakapp/api 0.3.4 → 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} +217 -20
- 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.d.ts → gen_models.d.ts} +0 -0
- /package/lib/bindings/{models.js → gen_models.js} +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,10 +61,27 @@ 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 = {};
|
|
58
87
|
export type ErrorResponse = {
|
|
@@ -97,9 +126,33 @@ export type FormInput = {
|
|
|
97
126
|
"type": "file";
|
|
98
127
|
} & FormInputFile | {
|
|
99
128
|
"type": "http_request";
|
|
100
|
-
} & 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
|
+
};
|
|
101
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
|
+
*/
|
|
102
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;
|
|
103
156
|
/**
|
|
104
157
|
* Whether the user must fill in the argument
|
|
105
158
|
*/
|
|
@@ -116,9 +169,18 @@ export type FormInputBase = {
|
|
|
116
169
|
* The default value
|
|
117
170
|
*/
|
|
118
171
|
defaultValue?: string;
|
|
172
|
+
disabled?: boolean;
|
|
119
173
|
};
|
|
120
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
|
+
*/
|
|
121
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;
|
|
122
184
|
/**
|
|
123
185
|
* Whether the user must fill in the argument
|
|
124
186
|
*/
|
|
@@ -135,6 +197,7 @@ export type FormInputCheckbox = {
|
|
|
135
197
|
* The default value
|
|
136
198
|
*/
|
|
137
199
|
defaultValue?: string;
|
|
200
|
+
disabled?: boolean;
|
|
138
201
|
};
|
|
139
202
|
export type FormInputEditor = {
|
|
140
203
|
/**
|
|
@@ -149,7 +212,17 @@ export type FormInputEditor = {
|
|
|
149
212
|
* Language for syntax highlighting
|
|
150
213
|
*/
|
|
151
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
|
+
*/
|
|
152
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;
|
|
153
226
|
/**
|
|
154
227
|
* Whether the user must fill in the argument
|
|
155
228
|
*/
|
|
@@ -166,6 +239,7 @@ export type FormInputEditor = {
|
|
|
166
239
|
* The default value
|
|
167
240
|
*/
|
|
168
241
|
defaultValue?: string;
|
|
242
|
+
disabled?: boolean;
|
|
169
243
|
};
|
|
170
244
|
export type FormInputFile = {
|
|
171
245
|
/**
|
|
@@ -179,7 +253,15 @@ export type FormInputFile = {
|
|
|
179
253
|
directory?: boolean;
|
|
180
254
|
defaultPath?: string;
|
|
181
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
|
+
*/
|
|
182
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;
|
|
183
265
|
/**
|
|
184
266
|
* Whether the user must fill in the argument
|
|
185
267
|
*/
|
|
@@ -196,9 +278,18 @@ export type FormInputFile = {
|
|
|
196
278
|
* The default value
|
|
197
279
|
*/
|
|
198
280
|
defaultValue?: string;
|
|
281
|
+
disabled?: boolean;
|
|
199
282
|
};
|
|
200
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
|
+
*/
|
|
201
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;
|
|
202
293
|
/**
|
|
203
294
|
* Whether the user must fill in the argument
|
|
204
295
|
*/
|
|
@@ -215,13 +306,26 @@ export type FormInputHttpRequest = {
|
|
|
215
306
|
* The default value
|
|
216
307
|
*/
|
|
217
308
|
defaultValue?: string;
|
|
309
|
+
disabled?: boolean;
|
|
310
|
+
};
|
|
311
|
+
export type FormInputMarkdown = {
|
|
312
|
+
content: string;
|
|
313
|
+
hidden?: boolean;
|
|
218
314
|
};
|
|
219
315
|
export type FormInputSelect = {
|
|
220
316
|
/**
|
|
221
317
|
* The options that will be available in the select input
|
|
222
318
|
*/
|
|
223
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
|
+
*/
|
|
224
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;
|
|
225
329
|
/**
|
|
226
330
|
* Whether the user must fill in the argument
|
|
227
331
|
*/
|
|
@@ -238,9 +342,10 @@ export type FormInputSelect = {
|
|
|
238
342
|
* The default value
|
|
239
343
|
*/
|
|
240
344
|
defaultValue?: string;
|
|
345
|
+
disabled?: boolean;
|
|
241
346
|
};
|
|
242
347
|
export type FormInputSelectOption = {
|
|
243
|
-
|
|
348
|
+
label: string;
|
|
244
349
|
value: string;
|
|
245
350
|
};
|
|
246
351
|
export type FormInputText = {
|
|
@@ -252,7 +357,20 @@ export type FormInputText = {
|
|
|
252
357
|
* Placeholder for the text input
|
|
253
358
|
*/
|
|
254
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
|
+
*/
|
|
255
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;
|
|
256
374
|
/**
|
|
257
375
|
* Whether the user must fill in the argument
|
|
258
376
|
*/
|
|
@@ -269,12 +387,30 @@ export type FormInputText = {
|
|
|
269
387
|
* The default value
|
|
270
388
|
*/
|
|
271
389
|
defaultValue?: string;
|
|
390
|
+
disabled?: boolean;
|
|
391
|
+
};
|
|
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
|
+
};
|
|
272
404
|
};
|
|
273
|
-
export type
|
|
405
|
+
export type GetHttpAuthenticationConfigResponse = {
|
|
406
|
+
args: Array<FormInput>;
|
|
407
|
+
pluginRefId: string;
|
|
408
|
+
actions?: Array<HttpAuthenticationAction>;
|
|
409
|
+
};
|
|
410
|
+
export type GetHttpAuthenticationSummaryResponse = {
|
|
274
411
|
name: string;
|
|
275
412
|
label: string;
|
|
276
413
|
shortLabel: string;
|
|
277
|
-
config: Array<FormInput>;
|
|
278
414
|
};
|
|
279
415
|
export type GetHttpRequestActionsRequest = Record<string, never>;
|
|
280
416
|
export type GetHttpRequestActionsResponse = {
|
|
@@ -287,20 +423,29 @@ export type GetHttpRequestByIdRequest = {
|
|
|
287
423
|
export type GetHttpRequestByIdResponse = {
|
|
288
424
|
httpRequest: HttpRequest | null;
|
|
289
425
|
};
|
|
426
|
+
export type GetKeyValueRequest = {
|
|
427
|
+
key: string;
|
|
428
|
+
};
|
|
429
|
+
export type GetKeyValueResponse = {
|
|
430
|
+
value?: string;
|
|
431
|
+
};
|
|
290
432
|
export type GetTemplateFunctionsResponse = {
|
|
291
433
|
functions: Array<TemplateFunction>;
|
|
292
434
|
pluginRefId: string;
|
|
293
435
|
};
|
|
436
|
+
export type HttpAuthenticationAction = {
|
|
437
|
+
label: string;
|
|
438
|
+
icon?: Icon;
|
|
439
|
+
};
|
|
294
440
|
export type HttpHeader = {
|
|
295
441
|
name: string;
|
|
296
442
|
value: string;
|
|
297
443
|
};
|
|
298
444
|
export type HttpRequestAction = {
|
|
299
|
-
key: string;
|
|
300
445
|
label: string;
|
|
301
446
|
icon?: Icon;
|
|
302
447
|
};
|
|
303
|
-
export type Icon = "copy" | "info" | "
|
|
448
|
+
export type Icon = "alert_triangle" | "check" | "check_circle" | "chevron_down" | "copy" | "info" | "pin" | "search" | "trash" | "_unknown";
|
|
304
449
|
export type ImportRequest = {
|
|
305
450
|
content: string;
|
|
306
451
|
};
|
|
@@ -365,26 +510,56 @@ export type InternalEventPayload = {
|
|
|
365
510
|
} & CallTemplateFunctionRequest | {
|
|
366
511
|
"type": "call_template_function_response";
|
|
367
512
|
} & CallTemplateFunctionResponse | {
|
|
368
|
-
"type": "
|
|
513
|
+
"type": "get_http_authentication_summary_request";
|
|
369
514
|
} & EmptyPayload | {
|
|
370
|
-
"type": "
|
|
371
|
-
} &
|
|
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 | {
|
|
372
521
|
"type": "call_http_authentication_request";
|
|
373
522
|
} & CallHttpAuthenticationRequest | {
|
|
374
523
|
"type": "call_http_authentication_response";
|
|
375
524
|
} & CallHttpAuthenticationResponse | {
|
|
525
|
+
"type": "call_http_authentication_action_request";
|
|
526
|
+
} & CallHttpAuthenticationActionRequest | {
|
|
527
|
+
"type": "call_http_authentication_action_response";
|
|
528
|
+
} & EmptyPayload | {
|
|
376
529
|
"type": "copy_text_request";
|
|
377
530
|
} & CopyTextRequest | {
|
|
531
|
+
"type": "copy_text_response";
|
|
532
|
+
} & EmptyPayload | {
|
|
378
533
|
"type": "render_http_request_request";
|
|
379
534
|
} & RenderHttpRequestRequest | {
|
|
380
535
|
"type": "render_http_request_response";
|
|
381
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 | {
|
|
382
555
|
"type": "template_render_request";
|
|
383
556
|
} & TemplateRenderRequest | {
|
|
384
557
|
"type": "template_render_response";
|
|
385
558
|
} & TemplateRenderResponse | {
|
|
386
559
|
"type": "show_toast_request";
|
|
387
560
|
} & ShowToastRequest | {
|
|
561
|
+
"type": "show_toast_response";
|
|
562
|
+
} & EmptyPayload | {
|
|
388
563
|
"type": "prompt_text_request";
|
|
389
564
|
} & PromptTextRequest | {
|
|
390
565
|
"type": "prompt_text_response";
|
|
@@ -401,6 +576,16 @@ export type InternalEventPayload = {
|
|
|
401
576
|
} & EmptyPayload | {
|
|
402
577
|
"type": "error_response";
|
|
403
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
|
+
};
|
|
404
589
|
export type PromptTextRequest = {
|
|
405
590
|
id: string;
|
|
406
591
|
title: string;
|
|
@@ -433,11 +618,16 @@ export type RenderHttpRequestResponse = {
|
|
|
433
618
|
};
|
|
434
619
|
export type RenderPurpose = "send" | "preview";
|
|
435
620
|
export type SendHttpRequestRequest = {
|
|
436
|
-
httpRequest: HttpRequest
|
|
621
|
+
httpRequest: Partial<HttpRequest>;
|
|
437
622
|
};
|
|
438
623
|
export type SendHttpRequestResponse = {
|
|
439
624
|
httpResponse: HttpResponse;
|
|
440
625
|
};
|
|
626
|
+
export type SetKeyValueRequest = {
|
|
627
|
+
key: string;
|
|
628
|
+
value: string;
|
|
629
|
+
};
|
|
630
|
+
export type SetKeyValueResponse = {};
|
|
441
631
|
export type ShowToastRequest = {
|
|
442
632
|
message: string;
|
|
443
633
|
color?: Color;
|
|
@@ -466,3 +656,10 @@ export type WindowContext = {
|
|
|
466
656
|
"type": "label";
|
|
467
657
|
label: string;
|
|
468
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/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
|
|
File without changes
|