@caido/sdk-frontend 0.51.2-beta.6 → 0.51.2-beta.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caido/sdk-frontend",
3
- "version": "0.51.2-beta.6",
3
+ "version": "0.51.2-beta.8",
4
4
  "description": "Typing for the Caido Frontend SDK",
5
5
  "author": "Caido Labs Inc. <dev@caido.io>",
6
6
  "license": "MIT",
@@ -11,6 +11,7 @@
11
11
  "src/*"
12
12
  ],
13
13
  "peerDependencies": {
14
+ "@ai-sdk/provider": "^2.0.0",
14
15
  "@codemirror/view": "^6.0.0",
15
16
  "@codemirror/state": "^6.0.0",
16
17
  "vue": "^3.0.0"
@@ -730,7 +730,7 @@ export type CreateAutomateSessionInput = {
730
730
  export type CreateAutomateSessionPayload = {
731
731
  session?: Maybe<AutomateSession>;
732
732
  };
733
- export type CreateBackupError = CloudUserError | OtherUserError | PermissionDeniedUserError | TaskInProgressUserError;
733
+ export type CreateBackupError = OtherUserError | TaskInProgressUserError;
734
734
  export type CreateBackupPayload = {
735
735
  error?: Maybe<CreateBackupError>;
736
736
  task?: Maybe<BackupTask>;
@@ -1015,6 +1015,8 @@ export type CreatedWorkflowPayload = {
1015
1015
  export type CurrentProject = {
1016
1016
  config: ProjectConfig;
1017
1017
  project: Project;
1018
+ /** Defines if the selected project is read-only */
1019
+ readOnly: Scalars["Boolean"]["output"];
1018
1020
  };
1019
1021
  export type DnsIpResolver = {
1020
1022
  ip: Scalars["String"]["output"];
@@ -2394,6 +2396,7 @@ export type Project = {
2394
2396
  id: Scalars["ID"]["output"];
2395
2397
  name: Scalars["String"]["output"];
2396
2398
  path: Scalars["String"]["output"];
2399
+ /** Defines if the project would be read-only if selected by the caller */
2397
2400
  readOnly: Scalars["Boolean"]["output"];
2398
2401
  size: Scalars["Int"]["output"];
2399
2402
  status: ProjectStatus;
@@ -7069,16 +7072,8 @@ export type CreateBackupMutation = {
7069
7072
  };
7070
7073
  } | undefined | null;
7071
7074
  error?: {
7072
- __typename: "CloudUserError";
7073
- code: string;
7074
- cloudReason: CloudErrorReason;
7075
- } | {
7076
7075
  __typename: "OtherUserError";
7077
7076
  code: string;
7078
- } | {
7079
- __typename: "PermissionDeniedUserError";
7080
- code: string;
7081
- permissionDeniedReason: PermissionDeniedErrorReason;
7082
7077
  } | {
7083
7078
  __typename: "TaskInProgressUserError";
7084
7079
  taskId: string;
@@ -22554,7 +22549,7 @@ export declare const BackupsDocument = "\n query backups {\n backups {\n
22554
22549
  export declare const BackupUriDocument = "\n query backupUri($id: ID!) {\n backup(id: $id) {\n downloadUri\n }\n}\n ";
22555
22550
  export declare const BackupTasksDocument = "\n query backupTasks {\n backupTasks {\n ...backupTaskMeta\n }\n}\n \n fragment backupTaskMeta on BackupTask {\n __typename\n id\n backup {\n ...backupMeta\n }\n}\n \n\n fragment backupMeta on Backup {\n __typename\n id\n name\n path\n size\n status\n createdAt\n updatedAt\n project {\n id\n }\n}\n ";
22556
22551
  export declare const RestoreBackupTasksDocument = "\n query restoreBackupTasks {\n restoreBackupTasks {\n ...restoreBackupTaskMeta\n }\n}\n \n fragment restoreBackupTaskMeta on RestoreBackupTask {\n __typename\n id\n backup {\n ...backupMeta\n }\n project {\n ...projectFull\n }\n}\n \n\n fragment backupMeta on Backup {\n __typename\n id\n name\n path\n size\n status\n createdAt\n updatedAt\n project {\n id\n }\n}\n \n\n fragment projectFull on Project {\n __typename\n id\n name\n path\n version\n status\n temporary\n size\n createdAt\n updatedAt\n readOnly\n backups {\n id\n }\n}\n ";
22557
- export declare const CreateBackupDocument = "\n mutation createBackup($id: ID!) {\n createBackup(projectId: $id) {\n task {\n ...backupTaskMeta\n }\n error {\n ... on OtherUserError {\n ...otherUserErrorFull\n }\n ... on TaskInProgressUserError {\n ...taskInProgressUserErrorFull\n }\n ... on PermissionDeniedUserError {\n ...permissionDeniedUserErrorFull\n }\n ... on CloudUserError {\n ...cloudUserErrorFull\n }\n }\n }\n}\n \n fragment backupTaskMeta on BackupTask {\n __typename\n id\n backup {\n ...backupMeta\n }\n}\n \n\n fragment backupMeta on Backup {\n __typename\n id\n name\n path\n size\n status\n createdAt\n updatedAt\n project {\n id\n }\n}\n \n\n fragment otherUserErrorFull on OtherUserError {\n ...userErrorFull\n}\n \n\n fragment userErrorFull on UserError {\n __typename\n code\n}\n \n\n fragment taskInProgressUserErrorFull on TaskInProgressUserError {\n ...userErrorFull\n taskId\n}\n \n\n fragment permissionDeniedUserErrorFull on PermissionDeniedUserError {\n ...userErrorFull\n permissionDeniedReason: reason\n}\n \n\n fragment cloudUserErrorFull on CloudUserError {\n ...userErrorFull\n cloudReason: reason\n}\n ";
22552
+ export declare const CreateBackupDocument = "\n mutation createBackup($id: ID!) {\n createBackup(projectId: $id) {\n task {\n ...backupTaskMeta\n }\n error {\n ... on OtherUserError {\n ...otherUserErrorFull\n }\n ... on TaskInProgressUserError {\n ...taskInProgressUserErrorFull\n }\n }\n }\n}\n \n fragment backupTaskMeta on BackupTask {\n __typename\n id\n backup {\n ...backupMeta\n }\n}\n \n\n fragment backupMeta on Backup {\n __typename\n id\n name\n path\n size\n status\n createdAt\n updatedAt\n project {\n id\n }\n}\n \n\n fragment otherUserErrorFull on OtherUserError {\n ...userErrorFull\n}\n \n\n fragment userErrorFull on UserError {\n __typename\n code\n}\n \n\n fragment taskInProgressUserErrorFull on TaskInProgressUserError {\n ...userErrorFull\n taskId\n}\n ";
22558
22553
  export declare const DeleteBackupDocument = "\n mutation deleteBackup($id: ID!) {\n deleteBackup(id: $id) {\n deletedId\n error {\n ... on OtherUserError {\n ...otherUserErrorFull\n }\n ... on TaskInProgressUserError {\n ...taskInProgressUserErrorFull\n }\n }\n }\n}\n \n fragment otherUserErrorFull on OtherUserError {\n ...userErrorFull\n}\n \n\n fragment userErrorFull on UserError {\n __typename\n code\n}\n \n\n fragment taskInProgressUserErrorFull on TaskInProgressUserError {\n ...userErrorFull\n taskId\n}\n ";
22559
22554
  export declare const RenameBackupDocument = "\n mutation renameBackup($id: ID!, $name: String!) {\n renameBackup(id: $id, name: $name) {\n backup {\n ...backupMeta\n }\n }\n}\n \n fragment backupMeta on Backup {\n __typename\n id\n name\n path\n size\n status\n createdAt\n updatedAt\n project {\n id\n }\n}\n ";
22560
22555
  export declare const RestoreBackupFromFileDocument = "\n mutation restoreBackupFromFile($name: String!, $file: Upload!) {\n restoreBackup(input: {name: $name, source: {file: $file}}) {\n error {\n ... on NameTakenUserError {\n ...nameTakenUserErrorFull\n }\n ... on OtherUserError {\n ...otherUserErrorFull\n }\n ... on PermissionDeniedUserError {\n ...permissionDeniedUserErrorFull\n }\n }\n task {\n ...restoreBackupTaskMeta\n }\n }\n}\n \n fragment nameTakenUserErrorFull on NameTakenUserError {\n ...userErrorFull\n name\n}\n \n\n fragment userErrorFull on UserError {\n __typename\n code\n}\n \n\n fragment otherUserErrorFull on OtherUserError {\n ...userErrorFull\n}\n \n\n fragment permissionDeniedUserErrorFull on PermissionDeniedUserError {\n ...userErrorFull\n permissionDeniedReason: reason\n}\n \n\n fragment restoreBackupTaskMeta on RestoreBackupTask {\n __typename\n id\n backup {\n ...backupMeta\n }\n project {\n ...projectFull\n }\n}\n \n\n fragment backupMeta on Backup {\n __typename\n id\n name\n path\n size\n status\n createdAt\n updatedAt\n project {\n id\n }\n}\n \n\n fragment projectFull on Project {\n __typename\n id\n name\n path\n version\n status\n temporary\n size\n createdAt\n updatedAt\n readOnly\n backups {\n id\n }\n}\n ";
@@ -14,4 +14,5 @@ export type { Scope } from "./types/scopes";
14
14
  export type { EnvironmentVariable } from "./types/environment";
15
15
  export type { Workflow, WorkflowKind, OnCreatedWorkflowCallback, OnUpdatedWorkflowCallback, OnDeletedWorkflowCallback, } from "./types/workflows";
16
16
  export type { ListenerHandle } from "./types/utils";
17
+ export type { AIProvider } from "./types/ai";
17
18
  export type { API } from "./sdks";
@@ -0,0 +1,12 @@
1
+ import type { AIProvider } from "../types/ai";
2
+ /**
3
+ * Utilities to interact with AI.
4
+ * @category AI
5
+ */
6
+ export type AiSDK = {
7
+ /**
8
+ * Creates a new AI provider instance that can be used with the [ai](https://ai-sdk.dev/) library.
9
+ * @returns A provider instance compatible with the [ai](https://ai-sdk.dev/) library.
10
+ */
11
+ createProvider: () => AIProvider;
12
+ };
@@ -1,5 +1,6 @@
1
1
  import type { Sdk as GraphqlSDK } from "../__generated__/graphql-sdk";
2
2
  import { type BackendEndpoints, type BackendEvents } from "../types/backend";
3
+ import type { AiSDK } from "./ai";
3
4
  import type { AssetsSDK } from "./assets";
4
5
  import type { AutomateSDK } from "./automate";
5
6
  import type { BackendSDK } from "./backend";
@@ -43,6 +44,10 @@ export type API<T extends BackendEndpoints = Record<string, never>, E extends Ba
43
44
  * Utilities to create UI components.
44
45
  */
45
46
  ui: UISDK;
47
+ /**
48
+ * Utilities to interact with AI.
49
+ */
50
+ ai: AiSDK;
46
51
  /**
47
52
  * Utilities to interact with scopes
48
53
  */
@@ -0,0 +1,6 @@
1
+ import { type LanguageModelV2, type ProviderV2 } from "@ai-sdk/provider";
2
+ /**
3
+ * Official AI Provider to be used by the [ai](https://ai-sdk.dev/) library.
4
+ * @category AI
5
+ */
6
+ export type AIProvider = ProviderV2 & ((modelId: string) => LanguageModelV2);