@yaakapp/api 0.1.3 → 0.1.5

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.
Files changed (38) hide show
  1. package/lib/gen/CallHttpRequestActionArgs.d.ts +4 -0
  2. package/lib/gen/CallHttpRequestActionArgs.js +2 -0
  3. package/lib/gen/CallHttpRequestActionRequest.d.ts +6 -0
  4. package/lib/gen/CallHttpRequestActionRequest.js +2 -0
  5. package/lib/gen/Cookie.d.ts +8 -0
  6. package/lib/gen/Cookie.js +2 -0
  7. package/lib/gen/CookieDomain.d.ts +5 -0
  8. package/lib/gen/CookieDomain.js +3 -0
  9. package/lib/gen/CookieExpires.d.ts +3 -0
  10. package/lib/gen/CookieExpires.js +3 -0
  11. package/lib/gen/CookieJar.d.ts +10 -0
  12. package/lib/gen/CookieJar.js +2 -0
  13. package/lib/gen/CopyTextRequest.d.ts +3 -0
  14. package/lib/gen/CopyTextRequest.js +3 -0
  15. package/lib/gen/GetHttpRequestActionsRequest.d.ts +3 -0
  16. package/lib/gen/GetHttpRequestActionsRequest.js +3 -0
  17. package/lib/gen/GetHttpRequestActionsResponse.d.ts +5 -0
  18. package/lib/gen/GetHttpRequestActionsResponse.js +2 -0
  19. package/lib/gen/GetHttpRequestByIdRequest.d.ts +3 -0
  20. package/lib/gen/GetHttpRequestByIdRequest.js +3 -0
  21. package/lib/gen/GetHttpRequestByIdResponse.d.ts +4 -0
  22. package/lib/gen/GetHttpRequestByIdResponse.js +2 -0
  23. package/lib/gen/HttpRequestAction.d.ts +4 -0
  24. package/lib/gen/HttpRequestAction.js +3 -0
  25. package/lib/gen/InternalEventPayload.d.ts +23 -0
  26. package/lib/gen/Model.d.ts +3 -1
  27. package/lib/gen/SendHttpRequestRequest.d.ts +4 -0
  28. package/lib/gen/SendHttpRequestRequest.js +2 -0
  29. package/lib/gen/SendHttpRequestResponse.d.ts +4 -0
  30. package/lib/gen/SendHttpRequestResponse.js +2 -0
  31. package/lib/gen/Settings.d.ts +16 -0
  32. package/lib/gen/Settings.js +3 -0
  33. package/lib/index.d.ts +15 -0
  34. package/lib/index.js +16 -0
  35. package/lib/plugins/context.d.ts +8 -6
  36. package/lib/plugins/httpRequestAction.d.ts +4 -7
  37. package/lib/plugins/index.d.ts +5 -5
  38. package/package.json +1 -1
@@ -0,0 +1,4 @@
1
+ import type { HttpRequest } from "./HttpRequest";
2
+ export type CallHttpRequestActionArgs = {
3
+ httpRequest: HttpRequest;
4
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ import type { CallHttpRequestActionArgs } from "./CallHttpRequestActionArgs";
2
+ export type CallHttpRequestActionRequest = {
3
+ key: string;
4
+ pluginRefId: string;
5
+ args: CallHttpRequestActionArgs;
6
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ import type { CookieDomain } from "./CookieDomain";
2
+ import type { CookieExpires } from "./CookieExpires";
3
+ export type Cookie = {
4
+ raw_cookie: string;
5
+ domain: CookieDomain;
6
+ expires: CookieExpires;
7
+ path: [string, boolean];
8
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ export type CookieDomain = {
2
+ "HostOnly": string;
3
+ } | {
4
+ "Suffix": string;
5
+ } | "NotPresent" | "Empty";
@@ -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
+ export type CookieExpires = {
2
+ "AtUtc": string;
3
+ } | "SessionEnd";
@@ -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,10 @@
1
+ import type { Cookie } from "./Cookie";
2
+ export type CookieJar = {
3
+ id: string;
4
+ model: "cookie_jar";
5
+ createdAt: string;
6
+ updatedAt: string;
7
+ workspaceId: string;
8
+ name: string;
9
+ cookies: Array<Cookie>;
10
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ export type CopyTextRequest = {
2
+ text: string;
3
+ };
@@ -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
+ export type GetHttpRequestActionsRequest = {
2
+ nothing: boolean;
3
+ };
@@ -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,5 @@
1
+ import type { HttpRequestAction } from "./HttpRequestAction";
2
+ export type GetHttpRequestActionsResponse = {
3
+ actions: Array<HttpRequestAction>;
4
+ pluginRefId: string;
5
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ export type GetHttpRequestByIdRequest = {
2
+ id: string;
3
+ };
@@ -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,4 @@
1
+ import type { HttpRequest } from "./HttpRequest";
2
+ export type GetHttpRequestByIdResponse = {
3
+ httpRequest: HttpRequest | null;
4
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ export type HttpRequestAction = {
2
+ key: string;
3
+ label: string;
4
+ };
@@ -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 });
@@ -1,12 +1,19 @@
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 { SendHttpRequestRequest } from "./SendHttpRequestRequest";
16
+ import type { SendHttpRequestResponse } from "./SendHttpRequestResponse";
10
17
  export type InternalEventPayload = {
11
18
  "type": "boot_request";
12
19
  } & BootRequest | {
@@ -24,5 +31,21 @@ export type InternalEventPayload = {
24
31
  } & ExportHttpRequestRequest | {
25
32
  "type": "export_http_request_response";
26
33
  } & ExportHttpRequestResponse | {
34
+ "type": "send_http_request_request";
35
+ } & SendHttpRequestRequest | {
36
+ "type": "send_http_request_response";
37
+ } & SendHttpRequestResponse | {
38
+ "type": "get_http_request_actions_request";
39
+ } | {
40
+ "type": "get_http_request_actions_response";
41
+ } & GetHttpRequestActionsResponse | {
42
+ "type": "call_http_request_action_request";
43
+ } & CallHttpRequestActionRequest | {
44
+ "type": "copy_text_request";
45
+ } & CopyTextRequest | {
46
+ "type": "get_http_request_by_id_request";
47
+ } & GetHttpRequestByIdRequest | {
48
+ "type": "get_http_request_by_id_response";
49
+ } & GetHttpRequestByIdResponse | {
27
50
  "type": "empty_response";
28
51
  } & EmptyResponse;
@@ -1,3 +1,4 @@
1
+ import type { CookieJar } from "./CookieJar";
1
2
  import type { Environment } from "./Environment";
2
3
  import type { Folder } from "./Folder";
3
4
  import type { GrpcConnection } from "./GrpcConnection";
@@ -6,5 +7,6 @@ import type { GrpcRequest } from "./GrpcRequest";
6
7
  import type { HttpRequest } from "./HttpRequest";
7
8
  import type { HttpResponse } from "./HttpResponse";
8
9
  import type { KeyValue } from "./KeyValue";
10
+ import type { Settings } from "./Settings";
9
11
  import type { Workspace } from "./Workspace";
10
- export type Model = Environment | Folder | GrpcConnection | GrpcEvent | GrpcRequest | HttpRequest | HttpResponse | KeyValue | Workspace;
12
+ export type Model = Environment | Folder | GrpcConnection | GrpcEvent | GrpcRequest | HttpRequest | HttpResponse | KeyValue | Workspace | CookieJar | Settings;
@@ -0,0 +1,4 @@
1
+ import type { HttpRequest } from "./HttpRequest";
2
+ export type SendHttpRequestRequest = {
3
+ httpRequest: HttpRequest;
4
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ import type { HttpResponse } from "./HttpResponse";
2
+ export type SendHttpRequestResponse = {
3
+ httpResponse: HttpResponse;
4
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,16 @@
1
+ export type Settings = {
2
+ id: string;
3
+ model: "settings";
4
+ createdAt: string;
5
+ updatedAt: string;
6
+ theme: string;
7
+ appearance: string;
8
+ themeDark: string;
9
+ themeLight: string;
10
+ updateChannel: string;
11
+ interfaceFontSize: number;
12
+ interfaceScale: number;
13
+ editorFontSize: number;
14
+ editorSoftWrap: boolean;
15
+ openWorkspaceNewWindow: boolean | null;
16
+ };
@@ -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/index.d.ts CHANGED
@@ -2,6 +2,12 @@ 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';
7
+ export * from './gen/Cookie';
8
+ export * from './gen/CookieDomain';
9
+ export * from './gen/CookieExpires';
10
+ export * from './gen/CookieJar';
5
11
  export * from './gen/EmptyResponse';
6
12
  export * from './gen/Environment';
7
13
  export * from './gen/EnvironmentVariable';
@@ -10,11 +16,16 @@ export * from './gen/ExportHttpRequestResponse';
10
16
  export * from './gen/FilterRequest';
11
17
  export * from './gen/FilterResponse';
12
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';
13
23
  export * from './gen/GrpcConnection';
14
24
  export * from './gen/GrpcEvent';
15
25
  export * from './gen/GrpcMetadataEntry';
16
26
  export * from './gen/GrpcRequest';
17
27
  export * from './gen/HttpRequest';
28
+ export * from './gen/HttpRequestAction';
18
29
  export * from './gen/HttpRequestHeader';
19
30
  export * from './gen/HttpResponse';
20
31
  export * from './gen/HttpResponseHeader';
@@ -26,4 +37,8 @@ export * from './gen/InternalEvent';
26
37
  export * from './gen/InternalEventPayload';
27
38
  export * from './gen/KeyValue';
28
39
  export * from './gen/Model';
40
+ export * from './gen/SendHttpRequestRequest';
41
+ export * from './gen/SendHttpRequestResponse';
42
+ export * from './gen/SendHttpRequestResponse';
43
+ export * from './gen/Settings';
29
44
  export * from './gen/Workspace';
package/lib/index.js CHANGED
@@ -14,8 +14,15 @@ 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);
22
+ __exportStar(require("./gen/Cookie"), exports);
23
+ __exportStar(require("./gen/CookieDomain"), exports);
24
+ __exportStar(require("./gen/CookieExpires"), exports);
25
+ __exportStar(require("./gen/CookieJar"), exports);
19
26
  __exportStar(require("./gen/EmptyResponse"), exports);
20
27
  __exportStar(require("./gen/Environment"), exports);
21
28
  __exportStar(require("./gen/EnvironmentVariable"), exports);
@@ -24,11 +31,16 @@ __exportStar(require("./gen/ExportHttpRequestResponse"), exports);
24
31
  __exportStar(require("./gen/FilterRequest"), exports);
25
32
  __exportStar(require("./gen/FilterResponse"), exports);
26
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);
27
38
  __exportStar(require("./gen/GrpcConnection"), exports);
28
39
  __exportStar(require("./gen/GrpcEvent"), exports);
29
40
  __exportStar(require("./gen/GrpcMetadataEntry"), exports);
30
41
  __exportStar(require("./gen/GrpcRequest"), exports);
31
42
  __exportStar(require("./gen/HttpRequest"), exports);
43
+ __exportStar(require("./gen/HttpRequestAction"), exports);
32
44
  __exportStar(require("./gen/HttpRequestHeader"), exports);
33
45
  __exportStar(require("./gen/HttpResponse"), exports);
34
46
  __exportStar(require("./gen/HttpResponseHeader"), exports);
@@ -40,4 +52,8 @@ __exportStar(require("./gen/InternalEvent"), exports);
40
52
  __exportStar(require("./gen/InternalEventPayload"), exports);
41
53
  __exportStar(require("./gen/KeyValue"), exports);
42
54
  __exportStar(require("./gen/Model"), exports);
55
+ __exportStar(require("./gen/SendHttpRequestRequest"), exports);
56
+ __exportStar(require("./gen/SendHttpRequestResponse"), exports);
57
+ __exportStar(require("./gen/SendHttpRequestResponse"), exports);
58
+ __exportStar(require("./gen/Settings"), exports);
43
59
  __exportStar(require("./gen/Workspace"), exports);
@@ -1,11 +1,13 @@
1
- import { HttpRequest } from '../gen/HttpRequest';
2
- import { HttpResponse } from '../gen/HttpResponse';
1
+ import { GetHttpRequestByIdRequest } from '../gen/GetHttpRequestByIdRequest';
2
+ import { GetHttpRequestByIdResponse } from '../gen/GetHttpRequestByIdResponse';
3
+ import { SendHttpRequestRequest } from '../gen/SendHttpRequestRequest';
4
+ import { SendHttpRequestResponse } from '../gen/SendHttpRequestResponse';
3
5
  export type YaakContext = {
4
- metadata: {
5
- getVersion(): Promise<string>;
6
+ clipboard: {
7
+ copyText(text: string): void;
6
8
  };
7
9
  httpRequest: {
8
- send(id: string): Promise<HttpResponse>;
9
- getById(id: string): Promise<HttpRequest | null>;
10
+ send(args: SendHttpRequestRequest): Promise<SendHttpRequestResponse['httpResponse']>;
11
+ getById(args: GetHttpRequestByIdRequest): Promise<GetHttpRequestByIdResponse['httpRequest']>;
10
12
  };
11
13
  };
@@ -1,9 +1,6 @@
1
- import { HttpRequest } from '../gen/HttpRequest';
1
+ import { CallHttpRequestActionArgs } from '../gen/CallHttpRequestActionArgs';
2
+ import { HttpRequestAction } from '../gen/HttpRequestAction';
2
3
  import { YaakContext } from './context';
3
- export type HttpRequestActionPlugin = {
4
- key: string;
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
  };
@@ -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?: OneOrMany<ImporterPlugin>;
11
- theme?: OneOrMany<ThemePlugin>;
12
- filter?: OneOrMany<FilterPlugin>;
13
- httpRequestAction?: OneOrMany<HttpRequestActionPlugin>;
10
+ importer?: ImporterPlugin;
11
+ theme?: ThemePlugin;
12
+ filter?: FilterPlugin;
13
+ httpRequestActions?: HttpRequestActionPlugin[];
14
14
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yaakapp/api",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "main": "lib/index.js",
5
5
  "typings": "./lib/index.d.ts",
6
6
  "files": [