@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.
@@ -1,10 +1,10 @@
1
- import type { Environment } from "./models.js";
2
- import type { Folder } from "./models.js";
3
- import type { GrpcRequest } from "./models.js";
4
- import type { HttpRequest } from "./models.js";
5
- import type { HttpResponse } from "./models.js";
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 "./models.js";
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
- config: {
18
- [key in string]?: JsonValue;
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
- key: string;
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 Color = "custom" | "default" | "primary" | "secondary" | "info" | "success" | "notice" | "warning" | "danger";
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
- name: string;
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 GetHttpAuthenticationResponse = {
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" | "check_circle" | "alert_triangle" | "_unknown";
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": "get_http_authentication_request";
513
+ "type": "get_http_authentication_summary_request";
366
514
  } & EmptyPayload | {
367
- "type": "get_http_authentication_response";
368
- } & GetHttpAuthenticationResponse | {
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
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
package/lib/helpers.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export type AtLeast<T, K extends keyof T> = Partial<T> & Pick<T, K>;
2
+ export type MaybePromise<T> = Promise<T> | T;
package/lib/helpers.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/lib/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export type * from './plugins/index.ts';
2
- export type * from './themes/index.ts';
3
- export * from './bindings/models.ts';
4
- export * from './bindings/events.ts';
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, GetHttpAuthenticationResponse } from "../bindings/events.ts";
2
- import { Context } from "./Context.ts";
3
- export type AuthenticationPlugin = Omit<GetHttpAuthenticationResponse, "pluginName"> & {
4
- onApply(ctx: Context, args: CallHttpAuthenticationRequest): Promise<CallHttpAuthenticationResponse> | CallHttpAuthenticationResponse;
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 {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,4 @@
1
- import type { FindHttpResponsesRequest, FindHttpResponsesResponse, GetHttpRequestByIdRequest, GetHttpRequestByIdResponse, PromptTextRequest, PromptTextResponse, RenderHttpRequestRequest, RenderHttpRequestResponse, SendHttpRequestRequest, SendHttpRequestResponse, ShowToastRequest, TemplateRenderRequest, TemplateRenderResponse } from "../bindings/events.ts";
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["value"]>;
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["httpResponse"]>;
14
- getById(args: GetHttpRequestByIdRequest): Promise<GetHttpRequestByIdResponse["httpRequest"]>;
15
- render(args: RenderHttpRequestRequest): Promise<RenderHttpRequestResponse["httpRequest"]>;
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["httpResponses"]>;
32
+ find(args: FindHttpResponsesRequest): Promise<FindHttpResponsesResponse['httpResponses']>;
19
33
  };
20
34
  templates: {
21
- render(args: TemplateRenderRequest): Promise<TemplateRenderResponse["data"]>;
35
+ render(args: TemplateRenderRequest): Promise<TemplateRenderResponse['data']>;
22
36
  };
23
37
  }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,4 @@
1
- import type { Context } from './Context.ts';
1
+ import type { Context } from './Context';
2
2
  export type FilterPluginResponse = {
3
3
  filtered: string;
4
4
  };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +1,5 @@
1
- import type { CallHttpRequestActionArgs, HttpRequestAction } from "../bindings/events.ts";
2
- import type { Context } from "./Context.ts";
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
  };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,13 +1,13 @@
1
- import { Environment, Folder, GrpcRequest, HttpRequest, Workspace } from "../bindings/models.ts";
2
- import type { AtLeast } from "../helpers.ts";
3
- import type { Context } from "./Context.ts";
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, "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">[];
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 = {
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +1,5 @@
1
- import { CallTemplateFunctionArgs, TemplateFunction } from "../bindings/events.ts";
2
- import { Context } from "./Context.ts";
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
  };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,7 @@
1
- import { Theme } from "../themes/index.ts";
2
- import { Context } from "./Context.ts";
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<Theme>;
6
+ getTheme(ctx: Context, fileContents: string): Promise<Index>;
7
7
  };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,10 +1,10 @@
1
- import { AuthenticationPlugin } from './AuthenticationPlugin.ts';
2
- import type { FilterPlugin } from './FilterPlugin.ts';
3
- import type { HttpRequestActionPlugin } from './HttpRequestActionPlugin.ts';
4
- import type { ImporterPlugin } from './ImporterPlugin.ts';
5
- import type { TemplateFunctionPlugin } from './TemplateFunctionPlugin.ts';
6
- import type { ThemePlugin } from './ThemePlugin.ts';
7
- export type { Context } from './Context.ts';
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,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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
+ };
@@ -19,7 +19,7 @@ export type Colors = {
19
19
  warning?: string;
20
20
  danger?: string;
21
21
  };
22
- export type Theme = Colors & {
22
+ export type Index = Colors & {
23
23
  id: string;
24
24
  name: string;
25
25
  components?: Partial<{
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yaakapp/api",
3
- "version": "0.3.3",
3
+ "version": "0.4.0",
4
4
  "main": "lib/index.js",
5
5
  "typings": "./lib/index.d.ts",
6
6
  "files": [
File without changes