@yaakapp/api 0.1.4 → 0.1.6
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/gen/CallHttpRequestActionArgs.d.ts +4 -0
- package/lib/gen/CallHttpRequestActionArgs.js +2 -0
- package/lib/gen/CallHttpRequestActionRequest.d.ts +6 -0
- package/lib/gen/CallHttpRequestActionRequest.js +2 -0
- package/lib/gen/CopyTextRequest.d.ts +3 -0
- package/lib/gen/CopyTextRequest.js +3 -0
- package/lib/gen/GetHttpRequestActionsRequest.d.ts +3 -0
- package/lib/gen/GetHttpRequestActionsRequest.js +3 -0
- package/lib/gen/GetHttpRequestActionsResponse.d.ts +5 -0
- package/lib/gen/GetHttpRequestActionsResponse.js +2 -0
- package/lib/gen/GetHttpRequestByIdRequest.d.ts +3 -0
- package/lib/gen/GetHttpRequestByIdRequest.js +3 -0
- package/lib/gen/GetHttpRequestByIdResponse.d.ts +4 -0
- package/lib/gen/GetHttpRequestByIdResponse.js +2 -0
- package/lib/gen/HttpRequestAction.d.ts +5 -0
- package/lib/gen/HttpRequestAction.js +3 -0
- package/lib/gen/InternalEventPayload.d.ts +32 -0
- package/lib/gen/RenderHttpRequestRequest.d.ts +4 -0
- package/lib/gen/RenderHttpRequestRequest.js +2 -0
- package/lib/gen/RenderHttpRequestResponse.d.ts +4 -0
- package/lib/gen/RenderHttpRequestResponse.js +2 -0
- package/lib/gen/SendHttpRequestRequest.d.ts +4 -0
- package/lib/gen/SendHttpRequestRequest.js +2 -0
- package/lib/gen/SendHttpRequestResponse.d.ts +4 -0
- package/lib/gen/SendHttpRequestResponse.js +2 -0
- package/lib/gen/ShowToastRequest.d.ts +5 -0
- package/lib/gen/ShowToastRequest.js +2 -0
- package/lib/gen/ToastVariant.d.ts +1 -0
- package/lib/gen/ToastVariant.js +3 -0
- package/lib/index.d.ts +14 -0
- package/lib/index.js +15 -0
- package/lib/plugins/context.d.ts +15 -6
- package/lib/plugins/httpRequestAction.d.ts +4 -7
- package/lib/plugins/index.d.ts +5 -5
- package/package.json +1 -1
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import type { BootRequest } from "./BootRequest";
|
|
2
2
|
import type { BootResponse } from "./BootResponse";
|
|
3
|
+
import type { CallHttpRequestActionRequest } from "./CallHttpRequestActionRequest";
|
|
4
|
+
import type { CopyTextRequest } from "./CopyTextRequest";
|
|
3
5
|
import type { EmptyResponse } from "./EmptyResponse";
|
|
4
6
|
import type { ExportHttpRequestRequest } from "./ExportHttpRequestRequest";
|
|
5
7
|
import type { ExportHttpRequestResponse } from "./ExportHttpRequestResponse";
|
|
6
8
|
import type { FilterRequest } from "./FilterRequest";
|
|
7
9
|
import type { FilterResponse } from "./FilterResponse";
|
|
10
|
+
import type { GetHttpRequestActionsResponse } from "./GetHttpRequestActionsResponse";
|
|
11
|
+
import type { GetHttpRequestByIdRequest } from "./GetHttpRequestByIdRequest";
|
|
12
|
+
import type { GetHttpRequestByIdResponse } from "./GetHttpRequestByIdResponse";
|
|
8
13
|
import type { ImportRequest } from "./ImportRequest";
|
|
9
14
|
import type { ImportResponse } from "./ImportResponse";
|
|
15
|
+
import type { RenderHttpRequestRequest } from "./RenderHttpRequestRequest";
|
|
16
|
+
import type { RenderHttpRequestResponse } from "./RenderHttpRequestResponse";
|
|
17
|
+
import type { SendHttpRequestRequest } from "./SendHttpRequestRequest";
|
|
18
|
+
import type { SendHttpRequestResponse } from "./SendHttpRequestResponse";
|
|
19
|
+
import type { ShowToastRequest } from "./ShowToastRequest";
|
|
10
20
|
export type InternalEventPayload = {
|
|
11
21
|
"type": "boot_request";
|
|
12
22
|
} & BootRequest | {
|
|
@@ -24,5 +34,27 @@ export type InternalEventPayload = {
|
|
|
24
34
|
} & ExportHttpRequestRequest | {
|
|
25
35
|
"type": "export_http_request_response";
|
|
26
36
|
} & ExportHttpRequestResponse | {
|
|
37
|
+
"type": "send_http_request_request";
|
|
38
|
+
} & SendHttpRequestRequest | {
|
|
39
|
+
"type": "send_http_request_response";
|
|
40
|
+
} & SendHttpRequestResponse | {
|
|
41
|
+
"type": "get_http_request_actions_request";
|
|
42
|
+
} | {
|
|
43
|
+
"type": "get_http_request_actions_response";
|
|
44
|
+
} & GetHttpRequestActionsResponse | {
|
|
45
|
+
"type": "call_http_request_action_request";
|
|
46
|
+
} & CallHttpRequestActionRequest | {
|
|
47
|
+
"type": "copy_text_request";
|
|
48
|
+
} & CopyTextRequest | {
|
|
49
|
+
"type": "render_http_request_request";
|
|
50
|
+
} & RenderHttpRequestRequest | {
|
|
51
|
+
"type": "render_http_request_response";
|
|
52
|
+
} & RenderHttpRequestResponse | {
|
|
53
|
+
"type": "show_toast_request";
|
|
54
|
+
} & ShowToastRequest | {
|
|
55
|
+
"type": "get_http_request_by_id_request";
|
|
56
|
+
} & GetHttpRequestByIdRequest | {
|
|
57
|
+
"type": "get_http_request_by_id_response";
|
|
58
|
+
} & GetHttpRequestByIdResponse | {
|
|
27
59
|
"type": "empty_response";
|
|
28
60
|
} & EmptyResponse;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ToastVariant = "custom" | "copied" | "success" | "info" | "warning" | "error";
|
package/lib/index.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ export type * from './plugins';
|
|
|
2
2
|
export type * from './themes';
|
|
3
3
|
export * from './gen/BootRequest';
|
|
4
4
|
export * from './gen/BootResponse';
|
|
5
|
+
export * from './gen/CallHttpRequestActionRequest';
|
|
6
|
+
export * from './gen/CallHttpRequestActionArgs';
|
|
5
7
|
export * from './gen/Cookie';
|
|
6
8
|
export * from './gen/CookieDomain';
|
|
7
9
|
export * from './gen/CookieExpires';
|
|
@@ -14,11 +16,16 @@ export * from './gen/ExportHttpRequestResponse';
|
|
|
14
16
|
export * from './gen/FilterRequest';
|
|
15
17
|
export * from './gen/FilterResponse';
|
|
16
18
|
export * from './gen/Folder';
|
|
19
|
+
export * from './gen/GetHttpRequestActionsResponse';
|
|
20
|
+
export * from './gen/GetHttpRequestByIdRequest';
|
|
21
|
+
export * from './gen/CopyTextRequest';
|
|
22
|
+
export * from './gen/GetHttpRequestByIdResponse';
|
|
17
23
|
export * from './gen/GrpcConnection';
|
|
18
24
|
export * from './gen/GrpcEvent';
|
|
19
25
|
export * from './gen/GrpcMetadataEntry';
|
|
20
26
|
export * from './gen/GrpcRequest';
|
|
21
27
|
export * from './gen/HttpRequest';
|
|
28
|
+
export * from './gen/HttpRequestAction';
|
|
22
29
|
export * from './gen/HttpRequestHeader';
|
|
23
30
|
export * from './gen/HttpResponse';
|
|
24
31
|
export * from './gen/HttpResponseHeader';
|
|
@@ -30,5 +37,12 @@ export * from './gen/InternalEvent';
|
|
|
30
37
|
export * from './gen/InternalEventPayload';
|
|
31
38
|
export * from './gen/KeyValue';
|
|
32
39
|
export * from './gen/Model';
|
|
40
|
+
export * from './gen/SendHttpRequestRequest';
|
|
41
|
+
export * from './gen/ToastVariant';
|
|
42
|
+
export * from './gen/ShowToastRequest';
|
|
43
|
+
export * from './gen/RenderHttpRequestRequest';
|
|
44
|
+
export * from './gen/RenderHttpRequestResponse';
|
|
45
|
+
export * from './gen/SendHttpRequestResponse';
|
|
46
|
+
export * from './gen/SendHttpRequestResponse';
|
|
33
47
|
export * from './gen/Settings';
|
|
34
48
|
export * from './gen/Workspace';
|
package/lib/index.js
CHANGED
|
@@ -14,8 +14,11 @@ 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
|
+
// TODO: The next ts-rs release includes the ability to put everything in 1 file!
|
|
17
18
|
__exportStar(require("./gen/BootRequest"), exports);
|
|
18
19
|
__exportStar(require("./gen/BootResponse"), exports);
|
|
20
|
+
__exportStar(require("./gen/CallHttpRequestActionRequest"), exports);
|
|
21
|
+
__exportStar(require("./gen/CallHttpRequestActionArgs"), exports);
|
|
19
22
|
__exportStar(require("./gen/Cookie"), exports);
|
|
20
23
|
__exportStar(require("./gen/CookieDomain"), exports);
|
|
21
24
|
__exportStar(require("./gen/CookieExpires"), exports);
|
|
@@ -28,11 +31,16 @@ __exportStar(require("./gen/ExportHttpRequestResponse"), exports);
|
|
|
28
31
|
__exportStar(require("./gen/FilterRequest"), exports);
|
|
29
32
|
__exportStar(require("./gen/FilterResponse"), exports);
|
|
30
33
|
__exportStar(require("./gen/Folder"), exports);
|
|
34
|
+
__exportStar(require("./gen/GetHttpRequestActionsResponse"), exports);
|
|
35
|
+
__exportStar(require("./gen/GetHttpRequestByIdRequest"), exports);
|
|
36
|
+
__exportStar(require("./gen/CopyTextRequest"), exports);
|
|
37
|
+
__exportStar(require("./gen/GetHttpRequestByIdResponse"), exports);
|
|
31
38
|
__exportStar(require("./gen/GrpcConnection"), exports);
|
|
32
39
|
__exportStar(require("./gen/GrpcEvent"), exports);
|
|
33
40
|
__exportStar(require("./gen/GrpcMetadataEntry"), exports);
|
|
34
41
|
__exportStar(require("./gen/GrpcRequest"), exports);
|
|
35
42
|
__exportStar(require("./gen/HttpRequest"), exports);
|
|
43
|
+
__exportStar(require("./gen/HttpRequestAction"), exports);
|
|
36
44
|
__exportStar(require("./gen/HttpRequestHeader"), exports);
|
|
37
45
|
__exportStar(require("./gen/HttpResponse"), exports);
|
|
38
46
|
__exportStar(require("./gen/HttpResponseHeader"), exports);
|
|
@@ -44,5 +52,12 @@ __exportStar(require("./gen/InternalEvent"), exports);
|
|
|
44
52
|
__exportStar(require("./gen/InternalEventPayload"), exports);
|
|
45
53
|
__exportStar(require("./gen/KeyValue"), exports);
|
|
46
54
|
__exportStar(require("./gen/Model"), exports);
|
|
55
|
+
__exportStar(require("./gen/SendHttpRequestRequest"), exports);
|
|
56
|
+
__exportStar(require("./gen/ToastVariant"), exports);
|
|
57
|
+
__exportStar(require("./gen/ShowToastRequest"), exports);
|
|
58
|
+
__exportStar(require("./gen/RenderHttpRequestRequest"), exports);
|
|
59
|
+
__exportStar(require("./gen/RenderHttpRequestResponse"), exports);
|
|
60
|
+
__exportStar(require("./gen/SendHttpRequestResponse"), exports);
|
|
61
|
+
__exportStar(require("./gen/SendHttpRequestResponse"), exports);
|
|
47
62
|
__exportStar(require("./gen/Settings"), exports);
|
|
48
63
|
__exportStar(require("./gen/Workspace"), exports);
|
package/lib/plugins/context.d.ts
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { GetHttpRequestByIdRequest } from '../gen/GetHttpRequestByIdRequest';
|
|
2
|
+
import { GetHttpRequestByIdResponse } from '../gen/GetHttpRequestByIdResponse';
|
|
3
|
+
import { RenderHttpRequestRequest } from '../gen/RenderHttpRequestRequest';
|
|
4
|
+
import { RenderHttpRequestResponse } from '../gen/RenderHttpRequestResponse';
|
|
5
|
+
import { SendHttpRequestRequest } from '../gen/SendHttpRequestRequest';
|
|
6
|
+
import { SendHttpRequestResponse } from '../gen/SendHttpRequestResponse';
|
|
7
|
+
import { ShowToastRequest } from '../gen/ShowToastRequest';
|
|
3
8
|
export type YaakContext = {
|
|
4
|
-
|
|
5
|
-
|
|
9
|
+
clipboard: {
|
|
10
|
+
copyText(text: string): void;
|
|
11
|
+
};
|
|
12
|
+
toast: {
|
|
13
|
+
show(args: ShowToastRequest): void;
|
|
6
14
|
};
|
|
7
15
|
httpRequest: {
|
|
8
|
-
send(
|
|
9
|
-
getById(
|
|
16
|
+
send(args: SendHttpRequestRequest): Promise<SendHttpRequestResponse['httpResponse']>;
|
|
17
|
+
getById(args: GetHttpRequestByIdRequest): Promise<GetHttpRequestByIdResponse['httpRequest']>;
|
|
18
|
+
render(args: RenderHttpRequestRequest): Promise<RenderHttpRequestResponse['httpRequest']>;
|
|
10
19
|
};
|
|
11
20
|
};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CallHttpRequestActionArgs } from '../gen/CallHttpRequestActionArgs';
|
|
2
|
+
import { HttpRequestAction } from '../gen/HttpRequestAction';
|
|
2
3
|
import { YaakContext } from './context';
|
|
3
|
-
export type HttpRequestActionPlugin = {
|
|
4
|
-
|
|
5
|
-
label: string;
|
|
6
|
-
onSelect(ctx: YaakContext, args: {
|
|
7
|
-
httpRequest: HttpRequest;
|
|
8
|
-
}): void;
|
|
4
|
+
export type HttpRequestActionPlugin = HttpRequestAction & {
|
|
5
|
+
onSelect(ctx: YaakContext, args: CallHttpRequestActionArgs): Promise<void> | void;
|
|
9
6
|
};
|
package/lib/plugins/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { OneOrMany } from '../helpers';
|
|
2
1
|
import { FilterPlugin } from './filter';
|
|
3
2
|
import { HttpRequestActionPlugin } from './httpRequestAction';
|
|
4
3
|
import { ImporterPlugin } from './import';
|
|
5
4
|
import { ThemePlugin } from './theme';
|
|
5
|
+
export { YaakContext } from './context';
|
|
6
6
|
/**
|
|
7
7
|
* The global structure of a Yaak plugin
|
|
8
8
|
*/
|
|
9
9
|
export type YaakPlugin = {
|
|
10
|
-
importer?:
|
|
11
|
-
theme?:
|
|
12
|
-
filter?:
|
|
13
|
-
|
|
10
|
+
importer?: ImporterPlugin;
|
|
11
|
+
theme?: ThemePlugin;
|
|
12
|
+
filter?: FilterPlugin;
|
|
13
|
+
httpRequestActions?: HttpRequestActionPlugin[];
|
|
14
14
|
};
|