@yaakapp/api 0.2.17 → 0.2.19
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 +83 -88
- package/lib/plugins/Context.d.ts +1 -1
- package/lib/plugins/FilterPlugin.d.ts +1 -1
- package/lib/plugins/HttpRequestActionPlugin.d.ts +2 -2
- package/lib/plugins/ImporterPlugin.d.ts +5 -4
- package/lib/plugins/TemplateFunctionPlugin.d.ts +2 -2
- package/lib/plugins/ThemePlugin.d.ts +2 -2
- package/lib/plugins/index.d.ts +5 -5
- package/package.json +3 -3
package/lib/bindings/events.d.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import type { Environment } from
|
|
2
|
-
import type {
|
|
3
|
-
import type { GrpcRequest } from "./models";
|
|
4
|
-
import type { HttpRequest } from "./models";
|
|
5
|
-
import type { HttpResponse } from "./models";
|
|
6
|
-
import type { JsonValue } from "./serde_json/JsonValue";
|
|
7
|
-
import type { Workspace } from "./models";
|
|
1
|
+
import type { Environment, Folder, GrpcRequest, HttpRequest, HttpResponse, Workspace } from './models';
|
|
2
|
+
import type { JsonValue } from './serde_json/JsonValue';
|
|
8
3
|
export type BootRequest = {
|
|
9
4
|
dir: string;
|
|
10
5
|
watch: boolean;
|
|
@@ -35,7 +30,7 @@ export type CallTemplateFunctionRequest = {
|
|
|
35
30
|
export type CallTemplateFunctionResponse = {
|
|
36
31
|
value: string | null;
|
|
37
32
|
};
|
|
38
|
-
export type Color =
|
|
33
|
+
export type Color = 'custom' | 'default' | 'primary' | 'secondary' | 'info' | 'success' | 'notice' | 'warning' | 'danger';
|
|
39
34
|
export type CopyTextRequest = {
|
|
40
35
|
text: string;
|
|
41
36
|
};
|
|
@@ -79,7 +74,7 @@ export type HttpRequestAction = {
|
|
|
79
74
|
label: string;
|
|
80
75
|
icon?: Icon;
|
|
81
76
|
};
|
|
82
|
-
export type Icon =
|
|
77
|
+
export type Icon = 'copy' | 'info' | 'check_circle' | 'alert_triangle' | '_unknown';
|
|
83
78
|
export type ImportRequest = {
|
|
84
79
|
content: string;
|
|
85
80
|
};
|
|
@@ -100,74 +95,74 @@ export type InternalEvent = {
|
|
|
100
95
|
payload: InternalEventPayload;
|
|
101
96
|
windowContext: WindowContext;
|
|
102
97
|
};
|
|
103
|
-
export type InternalEventPayload = {
|
|
104
|
-
|
|
105
|
-
} & BootRequest | {
|
|
106
|
-
|
|
107
|
-
} & BootResponse | {
|
|
108
|
-
|
|
98
|
+
export type InternalEventPayload = ({
|
|
99
|
+
type: 'boot_request';
|
|
100
|
+
} & BootRequest) | ({
|
|
101
|
+
type: 'boot_response';
|
|
102
|
+
} & BootResponse) | {
|
|
103
|
+
type: 'reload_request';
|
|
109
104
|
} | {
|
|
110
|
-
|
|
105
|
+
type: 'reload_response';
|
|
111
106
|
} | {
|
|
112
|
-
|
|
107
|
+
type: 'terminate_request';
|
|
113
108
|
} | {
|
|
114
|
-
|
|
115
|
-
} | {
|
|
116
|
-
|
|
117
|
-
} & ImportRequest | {
|
|
118
|
-
|
|
119
|
-
} & ImportResponse | {
|
|
120
|
-
|
|
121
|
-
} & FilterRequest | {
|
|
122
|
-
|
|
123
|
-
} & FilterResponse | {
|
|
124
|
-
|
|
125
|
-
} & ExportHttpRequestRequest | {
|
|
126
|
-
|
|
127
|
-
} & ExportHttpRequestResponse | {
|
|
128
|
-
|
|
129
|
-
} & SendHttpRequestRequest | {
|
|
130
|
-
|
|
131
|
-
} & SendHttpRequestResponse | {
|
|
132
|
-
|
|
133
|
-
} & GetHttpRequestActionsRequest | {
|
|
134
|
-
|
|
135
|
-
} & GetHttpRequestActionsResponse | {
|
|
136
|
-
|
|
137
|
-
} & CallHttpRequestActionRequest | {
|
|
138
|
-
|
|
139
|
-
} | {
|
|
140
|
-
|
|
141
|
-
} & GetTemplateFunctionsResponse | {
|
|
142
|
-
|
|
143
|
-
} & CallTemplateFunctionRequest | {
|
|
144
|
-
|
|
145
|
-
} & CallTemplateFunctionResponse | {
|
|
146
|
-
|
|
147
|
-
} & CopyTextRequest | {
|
|
148
|
-
|
|
149
|
-
} & RenderHttpRequestRequest | {
|
|
150
|
-
|
|
151
|
-
} & RenderHttpRequestResponse | {
|
|
152
|
-
|
|
153
|
-
} & TemplateRenderRequest | {
|
|
154
|
-
|
|
155
|
-
} & TemplateRenderResponse | {
|
|
156
|
-
|
|
157
|
-
} & ShowToastRequest | {
|
|
158
|
-
|
|
159
|
-
} & PromptTextRequest | {
|
|
160
|
-
|
|
161
|
-
} & PromptTextResponse | {
|
|
162
|
-
|
|
163
|
-
} & GetHttpRequestByIdRequest | {
|
|
164
|
-
|
|
165
|
-
} & GetHttpRequestByIdResponse | {
|
|
166
|
-
|
|
167
|
-
} & FindHttpResponsesRequest | {
|
|
168
|
-
|
|
169
|
-
} & FindHttpResponsesResponse | {
|
|
170
|
-
|
|
109
|
+
type: 'terminate_response';
|
|
110
|
+
} | ({
|
|
111
|
+
type: 'import_request';
|
|
112
|
+
} & ImportRequest) | ({
|
|
113
|
+
type: 'import_response';
|
|
114
|
+
} & ImportResponse) | ({
|
|
115
|
+
type: 'filter_request';
|
|
116
|
+
} & FilterRequest) | ({
|
|
117
|
+
type: 'filter_response';
|
|
118
|
+
} & FilterResponse) | ({
|
|
119
|
+
type: 'export_http_request_request';
|
|
120
|
+
} & ExportHttpRequestRequest) | ({
|
|
121
|
+
type: 'export_http_request_response';
|
|
122
|
+
} & ExportHttpRequestResponse) | ({
|
|
123
|
+
type: 'send_http_request_request';
|
|
124
|
+
} & SendHttpRequestRequest) | ({
|
|
125
|
+
type: 'send_http_request_response';
|
|
126
|
+
} & SendHttpRequestResponse) | ({
|
|
127
|
+
type: 'get_http_request_actions_request';
|
|
128
|
+
} & GetHttpRequestActionsRequest) | ({
|
|
129
|
+
type: 'get_http_request_actions_response';
|
|
130
|
+
} & GetHttpRequestActionsResponse) | ({
|
|
131
|
+
type: 'call_http_request_action_request';
|
|
132
|
+
} & CallHttpRequestActionRequest) | {
|
|
133
|
+
type: 'get_template_functions_request';
|
|
134
|
+
} | ({
|
|
135
|
+
type: 'get_template_functions_response';
|
|
136
|
+
} & GetTemplateFunctionsResponse) | ({
|
|
137
|
+
type: 'call_template_function_request';
|
|
138
|
+
} & CallTemplateFunctionRequest) | ({
|
|
139
|
+
type: 'call_template_function_response';
|
|
140
|
+
} & CallTemplateFunctionResponse) | ({
|
|
141
|
+
type: 'copy_text_request';
|
|
142
|
+
} & CopyTextRequest) | ({
|
|
143
|
+
type: 'render_http_request_request';
|
|
144
|
+
} & RenderHttpRequestRequest) | ({
|
|
145
|
+
type: 'render_http_request_response';
|
|
146
|
+
} & RenderHttpRequestResponse) | ({
|
|
147
|
+
type: 'template_render_request';
|
|
148
|
+
} & TemplateRenderRequest) | ({
|
|
149
|
+
type: 'template_render_response';
|
|
150
|
+
} & TemplateRenderResponse) | ({
|
|
151
|
+
type: 'show_toast_request';
|
|
152
|
+
} & ShowToastRequest) | ({
|
|
153
|
+
type: 'prompt_text_request';
|
|
154
|
+
} & PromptTextRequest) | ({
|
|
155
|
+
type: 'prompt_text_response';
|
|
156
|
+
} & PromptTextResponse) | ({
|
|
157
|
+
type: 'get_http_request_by_id_request';
|
|
158
|
+
} & GetHttpRequestByIdRequest) | ({
|
|
159
|
+
type: 'get_http_request_by_id_response';
|
|
160
|
+
} & GetHttpRequestByIdResponse) | ({
|
|
161
|
+
type: 'find_http_responses_request';
|
|
162
|
+
} & FindHttpResponsesRequest) | ({
|
|
163
|
+
type: 'find_http_responses_response';
|
|
164
|
+
} & FindHttpResponsesResponse) | {
|
|
165
|
+
type: 'empty_response';
|
|
171
166
|
};
|
|
172
167
|
export type OpenFileFilter = {
|
|
173
168
|
name: string;
|
|
@@ -206,7 +201,7 @@ export type RenderHttpRequestRequest = {
|
|
|
206
201
|
export type RenderHttpRequestResponse = {
|
|
207
202
|
httpRequest: HttpRequest;
|
|
208
203
|
};
|
|
209
|
-
export type RenderPurpose =
|
|
204
|
+
export type RenderPurpose = 'send' | 'preview';
|
|
210
205
|
export type SendHttpRequestRequest = {
|
|
211
206
|
httpRequest: HttpRequest;
|
|
212
207
|
};
|
|
@@ -228,17 +223,17 @@ export type TemplateFunction = {
|
|
|
228
223
|
aliases?: Array<string>;
|
|
229
224
|
args: Array<TemplateFunctionArg>;
|
|
230
225
|
};
|
|
231
|
-
export type TemplateFunctionArg = {
|
|
232
|
-
|
|
233
|
-
} & TemplateFunctionTextArg | {
|
|
234
|
-
|
|
235
|
-
} & TemplateFunctionSelectArg | {
|
|
236
|
-
|
|
237
|
-
} & TemplateFunctionCheckboxArg | {
|
|
238
|
-
|
|
239
|
-
} & TemplateFunctionHttpRequestArg | {
|
|
240
|
-
|
|
241
|
-
} & TemplateFunctionFileArg;
|
|
226
|
+
export type TemplateFunctionArg = ({
|
|
227
|
+
type: 'text';
|
|
228
|
+
} & TemplateFunctionTextArg) | ({
|
|
229
|
+
type: 'select';
|
|
230
|
+
} & TemplateFunctionSelectArg) | ({
|
|
231
|
+
type: 'checkbox';
|
|
232
|
+
} & TemplateFunctionCheckboxArg) | ({
|
|
233
|
+
type: 'http_request';
|
|
234
|
+
} & TemplateFunctionHttpRequestArg) | ({
|
|
235
|
+
type: 'file';
|
|
236
|
+
} & TemplateFunctionFileArg);
|
|
242
237
|
export type TemplateFunctionBaseArg = {
|
|
243
238
|
/**
|
|
244
239
|
* The name of the argument. Should be `camelCase` format
|
|
@@ -378,8 +373,8 @@ export type TemplateRenderResponse = {
|
|
|
378
373
|
data: JsonValue;
|
|
379
374
|
};
|
|
380
375
|
export type WindowContext = {
|
|
381
|
-
|
|
376
|
+
type: 'none';
|
|
382
377
|
} | {
|
|
383
|
-
|
|
378
|
+
type: 'label';
|
|
384
379
|
label: string;
|
|
385
380
|
};
|
package/lib/plugins/Context.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FindHttpResponsesRequest, FindHttpResponsesResponse, GetHttpRequestByIdRequest, GetHttpRequestByIdResponse, PromptTextRequest, PromptTextResponse, RenderHttpRequestRequest, RenderHttpRequestResponse, SendHttpRequestRequest, SendHttpRequestResponse, ShowToastRequest, TemplateRenderRequest, TemplateRenderResponse } from '..';
|
|
1
|
+
import type { FindHttpResponsesRequest, FindHttpResponsesResponse, GetHttpRequestByIdRequest, GetHttpRequestByIdResponse, PromptTextRequest, PromptTextResponse, RenderHttpRequestRequest, RenderHttpRequestResponse, SendHttpRequestRequest, SendHttpRequestResponse, ShowToastRequest, TemplateRenderRequest, TemplateRenderResponse } from '..';
|
|
2
2
|
export type Context = {
|
|
3
3
|
clipboard: {
|
|
4
4
|
copyText(text: string): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CallHttpRequestActionArgs, HttpRequestAction } from '..';
|
|
2
|
-
import { Context } from './Context';
|
|
1
|
+
import type { CallHttpRequestActionArgs, HttpRequestAction } from '..';
|
|
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,11 +1,12 @@
|
|
|
1
|
-
import { Environment, Folder, HttpRequest, Workspace } from '..';
|
|
2
|
-
import { AtLeast } from '../helpers';
|
|
3
|
-
import { Context } from './Context';
|
|
1
|
+
import type { Environment, Folder, GrpcRequest, HttpRequest, Workspace } from '..';
|
|
2
|
+
import type { AtLeast } from '../helpers';
|
|
3
|
+
import type { Context } from './Context';
|
|
4
4
|
export type ImportPluginResponse = null | {
|
|
5
5
|
workspaces: AtLeast<Workspace, 'name' | 'id' | 'model'>[];
|
|
6
6
|
environments: AtLeast<Environment, 'name' | 'id' | 'model' | 'workspaceId'>[];
|
|
7
|
-
httpRequests: AtLeast<HttpRequest, 'name' | 'id' | 'model' | 'workspaceId'>[];
|
|
8
7
|
folders: AtLeast<Folder, 'name' | 'id' | 'model' | 'workspaceId'>[];
|
|
8
|
+
httpRequests: AtLeast<HttpRequest, 'name' | 'id' | 'model' | 'workspaceId'>[];
|
|
9
|
+
grpcRequests: AtLeast<GrpcRequest, 'name' | 'id' | 'model' | 'workspaceId'>[];
|
|
9
10
|
};
|
|
10
11
|
export type ImporterPlugin = {
|
|
11
12
|
name: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CallTemplateFunctionArgs, TemplateFunction } from '..';
|
|
2
|
-
import { Context } from './Context';
|
|
1
|
+
import type { CallTemplateFunctionArgs, TemplateFunction } from '..';
|
|
2
|
+
import type { Context } from './Context';
|
|
3
3
|
export type TemplateFunctionPlugin = TemplateFunction & {
|
|
4
4
|
onRender(ctx: Context, args: CallTemplateFunctionArgs): Promise<string | null>;
|
|
5
5
|
};
|
package/lib/plugins/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { FilterPlugin } from './FilterPlugin';
|
|
2
|
-
import { HttpRequestActionPlugin } from './HttpRequestActionPlugin';
|
|
3
|
-
import { ImporterPlugin } from './ImporterPlugin';
|
|
4
|
-
import { TemplateFunctionPlugin } from './TemplateFunctionPlugin';
|
|
5
|
-
import { ThemePlugin } from './ThemePlugin';
|
|
1
|
+
import type { FilterPlugin } from './FilterPlugin';
|
|
2
|
+
import type { HttpRequestActionPlugin } from './HttpRequestActionPlugin';
|
|
3
|
+
import type { ImporterPlugin } from './ImporterPlugin';
|
|
4
|
+
import type { TemplateFunctionPlugin } from './TemplateFunctionPlugin';
|
|
5
|
+
import type { ThemePlugin } from './ThemePlugin';
|
|
6
6
|
export type { Context } from './Context';
|
|
7
7
|
/**
|
|
8
8
|
* The global structure of a Yaak plugin
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yaakapp/api",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.19",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"typings": "./lib/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"build": "run-s build:copy-types build:tsc",
|
|
12
12
|
"build:tsc": "tsc",
|
|
13
13
|
"build:copy-types": "run-p build:copy-types:*",
|
|
14
|
-
"build:copy-types:root": "cpy --flat
|
|
15
|
-
"build:copy-types:next": "cpy --flat
|
|
14
|
+
"build:copy-types:root": "cpy --flat ../../src-tauri/yaak-plugin-runtime/bindings/*.ts ./src/bindings",
|
|
15
|
+
"build:copy-types:next": "cpy --flat ../../src-tauri/yaak-plugin-runtime/bindings/serde_json/*.ts ./src/bindings/serde_json",
|
|
16
16
|
"prepublishOnly": "npm run build"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|