@yaakapp/api 0.2.9 → 0.2.11

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.
@@ -3,9 +3,11 @@ import type { Folder } from "./models";
3
3
  import type { GrpcRequest } from "./models";
4
4
  import type { HttpRequest } from "./models";
5
5
  import type { HttpResponse } from "./models";
6
+ import type { JsonValue } from "./serde_json/JsonValue";
6
7
  import type { Workspace } from "./models";
7
8
  export type BootRequest = {
8
9
  dir: string;
10
+ watch: boolean;
9
11
  };
10
12
  export type BootResponse = {
11
13
  name: string;
@@ -22,7 +24,6 @@ export type CallHttpRequestActionRequest = {
22
24
  };
23
25
  export type CallTemplateFunctionArgs = {
24
26
  purpose: RenderPurpose;
25
- renderId: string;
26
27
  values: {
27
28
  [key in string]?: string;
28
29
  };
@@ -97,6 +98,7 @@ export type InternalEvent = {
97
98
  pluginRefId: string;
98
99
  replyId: string | null;
99
100
  payload: InternalEventPayload;
101
+ windowContext: WindowContext;
100
102
  };
101
103
  export type InternalEventPayload = {
102
104
  "type": "boot_request";
@@ -143,10 +145,10 @@ export type InternalEventPayload = {
143
145
  } & CallTemplateFunctionResponse | {
144
146
  "type": "copy_text_request";
145
147
  } & CopyTextRequest | {
146
- "type": "render_http_request_request";
147
- } & RenderHttpRequestRequest | {
148
- "type": "render_http_request_response";
149
- } & RenderHttpRequestResponse | {
148
+ "type": "template_render_request";
149
+ } & TemplateRenderRequest | {
150
+ "type": "template_render_response";
151
+ } & TemplateRenderResponse | {
150
152
  "type": "show_toast_request";
151
153
  } & ShowToastRequest | {
152
154
  "type": "get_http_request_by_id_request";
@@ -180,6 +182,7 @@ export type ShowToastRequest = {
180
182
  };
181
183
  export type TemplateFunction = {
182
184
  name: string;
185
+ aliases?: Array<string> | null;
183
186
  args: Array<TemplateFunctionArg>;
184
187
  };
185
188
  export type TemplateFunctionArg = {
@@ -227,3 +230,16 @@ export type TemplateFunctionTextArg = {
227
230
  label?: string | null;
228
231
  defaultValue?: string | null;
229
232
  };
233
+ export type TemplateRenderRequest = {
234
+ data: JsonValue;
235
+ purpose: RenderPurpose;
236
+ };
237
+ export type TemplateRenderResponse = {
238
+ data: JsonValue;
239
+ };
240
+ export type WindowContext = {
241
+ "type": "none";
242
+ } | {
243
+ "type": "label";
244
+ label: string;
245
+ };
@@ -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
+ export type JsonValue = number | string | Array<JsonValue> | {
2
+ [key in string]?: JsonValue;
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 });
package/lib/helpers.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
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/models"), exports);
18
+ __exportStar(require("./bindings/events"), exports);
@@ -1,3 +1,4 @@
1
+ import { TemplateRenderRequest, TemplateRenderResponse } from '@yaakapp-internal/plugin';
1
2
  import { FindHttpResponsesRequest, FindHttpResponsesResponse, GetHttpRequestByIdRequest, GetHttpRequestByIdResponse, RenderHttpRequestRequest, RenderHttpRequestResponse, SendHttpRequestRequest, SendHttpRequestResponse, ShowToastRequest } from '..';
2
3
  export type Context = {
3
4
  clipboard: {
@@ -14,4 +15,7 @@ export type Context = {
14
15
  httpResponse: {
15
16
  find(args: FindHttpResponsesRequest): Promise<FindHttpResponsesResponse['httpResponses']>;
16
17
  };
18
+ templates: {
19
+ render(args: TemplateRenderRequest): Promise<TemplateRenderResponse['data']>;
20
+ };
17
21
  };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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.2.9",
3
+ "version": "0.2.11",
4
4
  "main": "lib/index.js",
5
5
  "typings": "./lib/index.d.ts",
6
6
  "files": [
@@ -9,7 +9,9 @@
9
9
  "scripts": {
10
10
  "build": "run-s build:copy-types build:tsc",
11
11
  "build:tsc": "tsc",
12
- "build:copy-types": "cpy --flat ../src-tauri/yaak_plugin_runtime/bindings/*.ts ./src/bindings/",
12
+ "build:copy-types": "run-p build:copy-types:*",
13
+ "build:copy-types:root": "cpy --flat ../src-tauri/yaak_plugin_runtime/bindings/*.ts ./src/bindings",
14
+ "build:copy-types:next": "cpy --flat ../src-tauri/yaak_plugin_runtime/bindings/serde_json/*.ts ./src/bindings/serde_json",
13
15
  "prepublishOnly": "npm run build"
14
16
  },
15
17
  "dependencies": {