@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.
- package/lib/bindings/events.d.ts +7 -2
- package/lib/bindings/events.js +2 -0
- package/lib/bindings/models.js +3 -0
- package/lib/bindings/serde_json/JsonValue.js +3 -0
- package/lib/helpers.js +2 -0
- package/lib/index.d.ts +4 -4
- package/lib/index.js +18 -0
- package/lib/plugins/AuthenticationPlugin.d.ts +3 -3
- package/lib/plugins/AuthenticationPlugin.js +2 -0
- package/lib/plugins/Context.js +2 -0
- package/lib/plugins/FilterPlugin.d.ts +1 -1
- package/lib/plugins/FilterPlugin.js +2 -0
- package/lib/plugins/HttpRequestActionPlugin.d.ts +2 -2
- package/lib/plugins/HttpRequestActionPlugin.js +2 -0
- package/lib/plugins/ImporterPlugin.d.ts +3 -3
- package/lib/plugins/ImporterPlugin.js +2 -0
- package/lib/plugins/TemplateFunctionPlugin.d.ts +2 -2
- package/lib/plugins/TemplateFunctionPlugin.js +2 -0
- package/lib/plugins/ThemePlugin.d.ts +3 -3
- package/lib/plugins/ThemePlugin.js +2 -0
- package/lib/plugins/index.d.ts +7 -7
- package/lib/plugins/index.js +2 -0
- package/lib/themes/Theme.d.ts +39 -0
- package/lib/themes/index.d.ts +1 -1
- package/lib/themes/index.js +2 -0
- package/package.json +1 -1
package/lib/bindings/events.d.ts
CHANGED
|
@@ -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;
|
package/lib/helpers.js
ADDED
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';
|
|
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
|
|
2
|
-
import { Context } from
|
|
3
|
-
export type AuthenticationPlugin = Omit<GetHttpAuthenticationResponse,
|
|
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
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CallHttpRequestActionArgs, HttpRequestAction } from
|
|
2
|
-
import type { Context } from
|
|
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
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Environment, Folder, GrpcRequest, HttpRequest, Workspace } from "../bindings/models
|
|
2
|
-
import type { AtLeast } from "../helpers
|
|
3
|
-
import type { Context } from "./Context
|
|
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">[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CallTemplateFunctionArgs, TemplateFunction } from "../bindings/events
|
|
2
|
-
import { Context } from "./Context
|
|
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
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Context } from "./Context
|
|
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<
|
|
6
|
+
getTheme(ctx: Context, fileContents: string): Promise<Index>;
|
|
7
7
|
};
|
package/lib/plugins/index.d.ts
CHANGED
|
@@ -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';
|
|
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,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
|
+
};
|
package/lib/themes/index.d.ts
CHANGED