@yaakapp/api 0.3.2 → 0.3.3

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.
@@ -1,10 +1,10 @@
1
- import type { Environment } from "./models";
2
- import type { Folder } from "./models";
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 } from "./models.js";
2
+ import type { Folder } from "./models.js";
3
+ import type { GrpcRequest } from "./models.js";
4
+ import type { HttpRequest } from "./models.js";
5
+ import type { HttpResponse } from "./models.js";
6
+ import type { JsonValue } from "./serde_json/JsonValue.js";
7
+ import type { Workspace } from "./models.js";
8
8
  export type BootRequest = {
9
9
  dir: string;
10
10
  watch: boolean;
@@ -12,7 +12,6 @@ export type BootRequest = {
12
12
  export type BootResponse = {
13
13
  name: string;
14
14
  version: string;
15
- capabilities: Array<string>;
16
15
  };
17
16
  export type CallHttpAuthenticationRequest = {
18
17
  config: {
@@ -315,6 +314,7 @@ export type ImportResponse = {
315
314
  export type InternalEvent = {
316
315
  id: string;
317
316
  pluginRefId: string;
317
+ pluginName: string;
318
318
  replyId: string | null;
319
319
  payload: InternalEventPayload;
320
320
  windowContext: WindowContext;
package/lib/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export type * from './plugins';
2
- export type * from './themes';
3
- export * from './bindings/models';
4
- export * from './bindings/events';
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,5 +1,5 @@
1
- import { CallHttpAuthenticationRequest, CallHttpAuthenticationResponse, GetHttpAuthenticationResponse } from '..';
2
- import type { Context } from './Context';
3
- export type AuthenticationPlugin = Omit<GetHttpAuthenticationResponse, 'pluginName'> & {
1
+ import { CallHttpAuthenticationRequest, CallHttpAuthenticationResponse, GetHttpAuthenticationResponse } from "../bindings/events.ts";
2
+ import { Context } from "./Context.ts";
3
+ export type AuthenticationPlugin = Omit<GetHttpAuthenticationResponse, "pluginName"> & {
4
4
  onApply(ctx: Context, args: CallHttpAuthenticationRequest): Promise<CallHttpAuthenticationResponse> | CallHttpAuthenticationResponse;
5
5
  };
@@ -1,23 +1,23 @@
1
- import type { FindHttpResponsesRequest, FindHttpResponsesResponse, GetHttpRequestByIdRequest, GetHttpRequestByIdResponse, PromptTextRequest, PromptTextResponse, RenderHttpRequestRequest, RenderHttpRequestResponse, SendHttpRequestRequest, SendHttpRequestResponse, ShowToastRequest, TemplateRenderRequest, TemplateRenderResponse } from '..';
2
- export type Context = {
1
+ import type { FindHttpResponsesRequest, FindHttpResponsesResponse, GetHttpRequestByIdRequest, GetHttpRequestByIdResponse, PromptTextRequest, PromptTextResponse, RenderHttpRequestRequest, RenderHttpRequestResponse, SendHttpRequestRequest, SendHttpRequestResponse, ShowToastRequest, TemplateRenderRequest, TemplateRenderResponse } from "../bindings/events.ts";
2
+ export interface Context {
3
3
  clipboard: {
4
- copyText(text: string): void;
4
+ copyText(text: string): Promise<void>;
5
5
  };
6
6
  toast: {
7
- show(args: ShowToastRequest): void;
7
+ show(args: ShowToastRequest): Promise<void>;
8
8
  };
9
9
  prompt: {
10
- text(args: PromptTextRequest): Promise<PromptTextResponse['value']>;
10
+ text(args: PromptTextRequest): Promise<PromptTextResponse["value"]>;
11
11
  };
12
12
  httpRequest: {
13
- send(args: SendHttpRequestRequest): Promise<SendHttpRequestResponse['httpResponse']>;
14
- getById(args: GetHttpRequestByIdRequest): Promise<GetHttpRequestByIdResponse['httpRequest']>;
15
- render(args: RenderHttpRequestRequest): Promise<RenderHttpRequestResponse['httpRequest']>;
13
+ send(args: SendHttpRequestRequest): Promise<SendHttpRequestResponse["httpResponse"]>;
14
+ getById(args: GetHttpRequestByIdRequest): Promise<GetHttpRequestByIdResponse["httpRequest"]>;
15
+ render(args: RenderHttpRequestRequest): Promise<RenderHttpRequestResponse["httpRequest"]>;
16
16
  };
17
17
  httpResponse: {
18
- find(args: FindHttpResponsesRequest): Promise<FindHttpResponsesResponse['httpResponses']>;
18
+ find(args: FindHttpResponsesRequest): Promise<FindHttpResponsesResponse["httpResponses"]>;
19
19
  };
20
20
  templates: {
21
- render(args: TemplateRenderRequest): Promise<TemplateRenderResponse['data']>;
21
+ render(args: TemplateRenderRequest): Promise<TemplateRenderResponse["data"]>;
22
22
  };
23
- };
23
+ }
@@ -1,13 +1,13 @@
1
- import type { Context } from './Context';
2
- export type FilterPluginResponse = string[];
1
+ import type { Context } from './Context.ts';
2
+ export type FilterPluginResponse = {
3
+ filtered: string;
4
+ };
3
5
  export type FilterPlugin = {
4
6
  name: string;
5
7
  description?: string;
6
- canFilter(ctx: Context, args: {
7
- mimeType: string;
8
- }): Promise<boolean>;
9
8
  onFilter(ctx: Context, args: {
10
9
  payload: string;
10
+ filter: string;
11
11
  mimeType: string;
12
- }): Promise<FilterPluginResponse>;
12
+ }): Promise<FilterPluginResponse> | FilterPluginResponse;
13
13
  };
@@ -1,5 +1,5 @@
1
- import type { CallHttpRequestActionArgs, HttpRequestAction } from '..';
2
- import type { Context } from './Context';
1
+ import type { CallHttpRequestActionArgs, HttpRequestAction } from "../bindings/events.ts";
2
+ import type { Context } from "./Context.ts";
3
3
  export type HttpRequestActionPlugin = HttpRequestAction & {
4
4
  onSelect(ctx: Context, args: CallHttpRequestActionArgs): Promise<void> | void;
5
5
  };
@@ -1,12 +1,14 @@
1
- import type { Environment, Folder, GrpcRequest, HttpRequest, Workspace } from '..';
2
- import type { AtLeast } from '../helpers';
3
- import type { Context } from './Context';
4
- export type ImportPluginResponse = null | {
5
- workspaces: AtLeast<Workspace, 'name' | 'id' | 'model'>[];
6
- environments: AtLeast<Environment, 'name' | 'id' | 'model' | 'workspaceId'>[];
7
- folders: AtLeast<Folder, 'name' | 'id' | 'model' | 'workspaceId'>[];
8
- httpRequests: AtLeast<HttpRequest, 'name' | 'id' | 'model' | 'workspaceId'>[];
9
- grpcRequests: AtLeast<GrpcRequest, 'name' | 'id' | 'model' | 'workspaceId'>[];
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";
4
+ type ImportPluginResponse = null | {
5
+ resources: {
6
+ workspaces: AtLeast<Workspace, "name" | "id" | "model">[];
7
+ environments: AtLeast<Environment, "name" | "id" | "model" | "workspaceId">[];
8
+ folders: AtLeast<Folder, "name" | "id" | "model" | "workspaceId">[];
9
+ httpRequests: AtLeast<HttpRequest, "name" | "id" | "model" | "workspaceId">[];
10
+ grpcRequests: AtLeast<GrpcRequest, "name" | "id" | "model" | "workspaceId">[];
11
+ };
10
12
  };
11
13
  export type ImporterPlugin = {
12
14
  name: string;
@@ -15,3 +17,4 @@ export type ImporterPlugin = {
15
17
  text: string;
16
18
  }): Promise<ImportPluginResponse>;
17
19
  };
20
+ export {};
@@ -1,5 +1,5 @@
1
- import type { CallTemplateFunctionArgs, TemplateFunction } from '..';
2
- import type { Context } from './Context';
1
+ import { CallTemplateFunctionArgs, TemplateFunction } from "../bindings/events.ts";
2
+ import { Context } from "./Context.ts";
3
3
  export type TemplateFunctionPlugin = TemplateFunction & {
4
4
  onRender(ctx: Context, args: CallTemplateFunctionArgs): Promise<string | null>;
5
5
  };
@@ -1,5 +1,5 @@
1
- import type { Theme } from '../themes';
2
- import type { Context } from './Context';
1
+ import { Theme } from "../themes/index.ts";
2
+ import { Context } from "./Context.ts";
3
3
  export type ThemePlugin = {
4
4
  name: string;
5
5
  description?: string;
@@ -1,10 +1,10 @@
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';
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';
8
8
  /**
9
9
  * The global structure of a Yaak plugin
10
10
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yaakapp/api",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "main": "lib/index.js",
5
5
  "typings": "./lib/index.d.ts",
6
6
  "files": [
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +0,0 @@
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,3 +0,0 @@
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 DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
package/lib/index.js DELETED
@@ -1,18 +0,0 @@
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,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });