@yaakapp/api 0.3.3 → 0.3.4

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.
@@ -55,6 +55,9 @@ export type CopyTextRequest = {
55
55
  };
56
56
  export type EditorLanguage = "text" | "javascript" | "json" | "html" | "xml" | "graphql" | "markdown";
57
57
  export type EmptyPayload = {};
58
+ export type ErrorResponse = {
59
+ error: string;
60
+ };
58
61
  export type ExportHttpRequestRequest = {
59
62
  httpRequest: HttpRequest;
60
63
  };
@@ -316,8 +319,8 @@ export type InternalEvent = {
316
319
  pluginRefId: string;
317
320
  pluginName: string;
318
321
  replyId: string | null;
319
- payload: InternalEventPayload;
320
322
  windowContext: WindowContext;
323
+ payload: InternalEventPayload;
321
324
  };
322
325
  export type InternalEventPayload = {
323
326
  "type": "boot_request";
@@ -395,7 +398,9 @@ export type InternalEventPayload = {
395
398
  "type": "find_http_responses_response";
396
399
  } & FindHttpResponsesResponse | {
397
400
  "type": "empty_response";
398
- } & EmptyPayload;
401
+ } & EmptyPayload | {
402
+ "type": "error_response";
403
+ } & ErrorResponse;
399
404
  export type PromptTextRequest = {
400
405
  id: string;
401
406
  title: string;
@@ -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.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/models';
4
+ export * from './bindings/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/models"), exports);
18
+ __exportStar(require("./bindings/events"), exports);
@@ -1,5 +1,5 @@
1
- import { CallHttpAuthenticationRequest, CallHttpAuthenticationResponse, GetHttpAuthenticationResponse } from "../bindings/events.ts";
2
- import { Context } from "./Context.ts";
3
- export type AuthenticationPlugin = Omit<GetHttpAuthenticationResponse, "pluginName"> & {
1
+ import { CallHttpAuthenticationRequest, CallHttpAuthenticationResponse, GetHttpAuthenticationResponse } from '../bindings/events';
2
+ import { Context } from './Context';
3
+ export type AuthenticationPlugin = Omit<GetHttpAuthenticationResponse, 'pluginName'> & {
4
4
  onApply(ctx: Context, args: CallHttpAuthenticationRequest): Promise<CallHttpAuthenticationResponse> | CallHttpAuthenticationResponse;
5
5
  };
@@ -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 });
@@ -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/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,6 +1,6 @@
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/models";
2
+ import type { AtLeast } from "../helpers";
3
+ import type { Context } from "./Context";
4
4
  type ImportPluginResponse = null | {
5
5
  resources: {
6
6
  workspaces: AtLeast<Workspace, "name" | "id" | "model">[];
@@ -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/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.3.4",
4
4
  "main": "lib/index.js",
5
5
  "typings": "./lib/index.d.ts",
6
6
  "files": [