Some small tweaks for plugins

This commit is contained in:
Gregory Schier
2025-05-11 06:36:50 -07:00
parent 94d4227bc1
commit 84b8d130dc
7 changed files with 29 additions and 15 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "@yaakapp/api", "name": "@yaakapp/api",
"version": "0.5.0", "version": "0.5.3",
"main": "lib/index.js", "main": "lib/index.js",
"typings": "./lib/index.d.ts", "typings": "./lib/index.d.ts",
"files": [ "files": [

View File

@@ -1,6 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type Environment = { model: "environment", id: string, workspaceId: string, environmentId: string | null, createdAt: string, updatedAt: string, name: string, variables: Array<EnvironmentVariable>, }; export type Environment = { model: "environment", id: string, workspaceId: string, createdAt: string, updatedAt: string, name: string, public: boolean, base: boolean, variables: Array<EnvironmentVariable>, };
export type EnvironmentVariable = { enabled?: boolean, name: string, value: string, id?: string, }; export type EnvironmentVariable = { enabled?: boolean, name: string, value: string, id?: string, };

View File

@@ -3,3 +3,7 @@ export type * from './themes';
export * from './bindings/gen_models'; export * from './bindings/gen_models';
export * from './bindings/gen_events'; export * from './bindings/gen_events';
// Some extras for utility
export type { PartialImportResources } from './plugins/ImporterPlugin';

View File

@@ -34,7 +34,7 @@ export interface Context {
openUrl( openUrl(
args: OpenWindowRequest & { args: OpenWindowRequest & {
onNavigate?: (args: { url: string }) => void; onNavigate?: (args: { url: string }) => void;
onClose: () => void; onClose?: () => void;
}, },
): Promise<{ close: () => void }>; ): Promise<{ close: () => void }>;
}; };

View File

@@ -1,6 +1,6 @@
import type { Context } from './Context'; import type { Context } from './Context';
export type FilterPluginResponse = { filtered: string }; type FilterPluginResponse = { filtered: string };
export type FilterPlugin = { export type FilterPlugin = {
name: string; name: string;

View File

@@ -1,15 +1,21 @@
import { Environment, Folder, GrpcRequest, HttpRequest, Workspace } from '../bindings/gen_models'; import { ImportResources } from '../bindings/gen_events';
import type { AtLeast } from '../helpers'; import { AtLeast } from '../helpers';
import type { Context } from './Context'; import type { Context } from './Context';
type ImportPluginResponse = null | { type RootFields = 'name' | 'id' | 'model';
resources: { type CommonFields = RootFields | 'workspaceId';
workspaces: AtLeast<Workspace, 'name' | 'id' | 'model'>[];
environments: AtLeast<Environment, 'name' | 'id' | 'model' | 'workspaceId'>[]; export type PartialImportResources = {
folders: AtLeast<Folder, 'name' | 'id' | 'model' | 'workspaceId'>[]; workspaces: Array<AtLeast<ImportResources['workspaces'][0], RootFields>>;
httpRequests: AtLeast<HttpRequest, 'name' | 'id' | 'model' | 'workspaceId'>[]; environments: Array<AtLeast<ImportResources['environments'][0], CommonFields>>;
grpcRequests: AtLeast<GrpcRequest, 'name' | 'id' | 'model' | 'workspaceId'>[]; folders: Array<AtLeast<ImportResources['folders'][0], CommonFields>>;
}; httpRequests: Array<AtLeast<ImportResources['httpRequests'][0], CommonFields>>;
grpcRequests: Array<AtLeast<ImportResources['grpcRequests'][0], CommonFields>>;
websocketRequests: Array<AtLeast<ImportResources['websocketRequests'][0], CommonFields>>;
};
export type ImportPluginResponse = null | {
resources: PartialImportResources;
}; };
export type ImporterPlugin = { export type ImporterPlugin = {

View File

@@ -258,7 +258,11 @@ const EnvironmentEditor = function ({
)} )}
</Heading> </Heading>
{activeEnvironment.public && promptToEncrypt && ( {activeEnvironment.public && promptToEncrypt && (
<DismissibleBanner id={activeEnvironment.id} color="notice" className="mr-3"> <DismissibleBanner
id={`warn-unencrypted-${activeEnvironment.id}`}
color="notice"
className="mr-3"
>
This environment is sharable. Ensure variable values are encrypted to avoid accidental This environment is sharable. Ensure variable values are encrypted to avoid accidental
leaking of secrets during directory sync or data export. leaking of secrets during directory sync or data export.
</DismissibleBanner> </DismissibleBanner>