@yaakapp/api 0.5.0 → 0.5.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.
@@ -466,7 +466,7 @@ export type InternalEvent = {
466
466
  pluginRefId: string;
467
467
  pluginName: string;
468
468
  replyId: string | null;
469
- windowContext: WindowContext;
469
+ windowContext: PluginWindowContext;
470
470
  payload: InternalEventPayload;
471
471
  };
472
472
  export type InternalEventPayload = {
@@ -591,6 +591,13 @@ export type OpenWindowRequest = {
591
591
  size?: WindowSize;
592
592
  dataDirKey?: string;
593
593
  };
594
+ export type PluginWindowContext = {
595
+ "type": "none";
596
+ } | {
597
+ "type": "label";
598
+ label: string;
599
+ workspace_id: string | null;
600
+ };
594
601
  export type PromptTextRequest = {
595
602
  id: string;
596
603
  title: string;
@@ -646,8 +653,12 @@ export type TemplateFunction = {
646
653
  * tags when changing the `name` property
647
654
  */
648
655
  aliases?: Array<string>;
649
- args: Array<FormInput>;
656
+ args: Array<TemplateFunctionArg>;
650
657
  };
658
+ /**
659
+ * Similar to FormInput, but contains
660
+ */
661
+ export type TemplateFunctionArg = FormInput;
651
662
  export type TemplateRenderRequest = {
652
663
  data: JsonValue;
653
664
  purpose: RenderPurpose;
@@ -655,12 +666,6 @@ export type TemplateRenderRequest = {
655
666
  export type TemplateRenderResponse = {
656
667
  data: JsonValue;
657
668
  };
658
- export type WindowContext = {
659
- "type": "none";
660
- } | {
661
- "type": "label";
662
- label: string;
663
- };
664
669
  export type WindowNavigateEvent = {
665
670
  url: string;
666
671
  };
@@ -2,10 +2,11 @@ export type Environment = {
2
2
  model: "environment";
3
3
  id: string;
4
4
  workspaceId: string;
5
- environmentId: string | null;
6
5
  createdAt: string;
7
6
  updatedAt: string;
8
7
  name: string;
8
+ public: boolean;
9
+ base: boolean;
9
10
  variables: Array<EnvironmentVariable>;
10
11
  };
11
12
  export type EnvironmentVariable = {
@@ -129,6 +130,7 @@ export type Workspace = {
129
130
  updatedAt: string;
130
131
  name: string;
131
132
  description: string;
133
+ encryptionKeyChallenge: string | null;
132
134
  settingValidateCertificates: boolean;
133
135
  settingFollowRedirects: boolean;
134
136
  settingRequestTimeout: number;
@@ -1,3 +1,3 @@
1
- export type JsonValue = number | string | Array<JsonValue> | {
1
+ export type JsonValue = number | string | boolean | Array<JsonValue> | {
2
2
  [key in string]?: JsonValue;
3
- };
3
+ } | null;
package/lib/index.d.ts CHANGED
@@ -2,3 +2,4 @@ export type * from './plugins';
2
2
  export type * from './themes';
3
3
  export * from './bindings/gen_models';
4
4
  export * from './bindings/gen_events';
5
+ export type { PartialImportResources } from './plugins/ImporterPlugin';
@@ -19,7 +19,7 @@ export interface Context {
19
19
  onNavigate?: (args: {
20
20
  url: string;
21
21
  }) => void;
22
- onClose: () => void;
22
+ onClose?: () => void;
23
23
  }): Promise<{
24
24
  close: () => void;
25
25
  }>;
@@ -1,5 +1,5 @@
1
1
  import type { Context } from './Context';
2
- export type FilterPluginResponse = {
2
+ type FilterPluginResponse = {
3
3
  filtered: string;
4
4
  };
5
5
  export type FilterPlugin = {
@@ -11,3 +11,4 @@ export type FilterPlugin = {
11
11
  mimeType: string;
12
12
  }): Promise<FilterPluginResponse> | FilterPluginResponse;
13
13
  };
14
+ export {};
@@ -1,14 +1,18 @@
1
- import { Environment, Folder, GrpcRequest, HttpRequest, Workspace } from '../bindings/gen_models';
2
- import type { AtLeast } from '../helpers';
1
+ import { ImportResources } from '../bindings/gen_events';
2
+ import { AtLeast } from '../helpers';
3
3
  import type { Context } from './Context';
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
- };
4
+ type RootFields = 'name' | 'id' | 'model';
5
+ type CommonFields = RootFields | 'workspaceId';
6
+ export type PartialImportResources = {
7
+ workspaces: Array<AtLeast<ImportResources['workspaces'][0], RootFields>>;
8
+ environments: Array<AtLeast<ImportResources['environments'][0], CommonFields>>;
9
+ folders: Array<AtLeast<ImportResources['folders'][0], CommonFields>>;
10
+ httpRequests: Array<AtLeast<ImportResources['httpRequests'][0], CommonFields>>;
11
+ grpcRequests: Array<AtLeast<ImportResources['grpcRequests'][0], CommonFields>>;
12
+ websocketRequests: Array<AtLeast<ImportResources['websocketRequests'][0], CommonFields>>;
13
+ };
14
+ export type ImportPluginResponse = null | {
15
+ resources: PartialImportResources;
12
16
  };
13
17
  export type ImporterPlugin = {
14
18
  name: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yaakapp/api",
3
- "version": "0.5.0",
3
+ "version": "0.5.3",
4
4
  "main": "lib/index.js",
5
5
  "typings": "./lib/index.d.ts",
6
6
  "files": [
@@ -20,8 +20,6 @@
20
20
  "@types/node": "^22.5.4"
21
21
  },
22
22
  "devDependencies": {
23
- "cpy-cli": "^5.0.0",
24
- "npm-run-all": "^4.1.5",
25
- "typescript": "^5.6.2"
23
+ "cpy-cli": "^5.0.0"
26
24
  }
27
25
  }