@caido/sdk-frontend 0.46.1-beta.5 → 0.46.1-beta.7
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
|
@@ -20170,6 +20170,19 @@ export type WorkflowFullFragment = {
|
|
|
20170
20170
|
global: boolean;
|
|
20171
20171
|
readOnly: boolean;
|
|
20172
20172
|
};
|
|
20173
|
+
export type WorkflowEdgeFullFragment = {
|
|
20174
|
+
cursor: string;
|
|
20175
|
+
node: {
|
|
20176
|
+
__typename: "Workflow";
|
|
20177
|
+
definition: Record<string, unknown>;
|
|
20178
|
+
id: string;
|
|
20179
|
+
kind: WorkflowKind;
|
|
20180
|
+
name: string;
|
|
20181
|
+
enabled: boolean;
|
|
20182
|
+
global: boolean;
|
|
20183
|
+
readOnly: boolean;
|
|
20184
|
+
};
|
|
20185
|
+
};
|
|
20173
20186
|
export type WorkflowNodeDefinitionFullFragment = {
|
|
20174
20187
|
__typename: "WorkflowNodeDefinition";
|
|
20175
20188
|
raw: Record<string, unknown>;
|
|
@@ -20700,6 +20713,7 @@ export declare const UpstreamProxySocksFullFragmentDoc = "\n fragment upstrea
|
|
|
20700
20713
|
export declare const UserProfileFullFragmentDoc = "\n fragment userProfileFull on UserProfile {\n __typename\n identity {\n __typename\n name\n email\n }\n subscription {\n __typename\n entitlements {\n __typename\n name\n }\n plan {\n __typename\n name\n }\n }\n}\n ";
|
|
20701
20714
|
export declare const UserSettingsFullFragmentDoc = "\n fragment userSettingsFull on UserSettings {\n __typename\n data\n migrations\n}\n ";
|
|
20702
20715
|
export declare const WorkflowFullFragmentDoc = "\n fragment workflowFull on Workflow {\n ...workflowMeta\n definition\n}\n ";
|
|
20716
|
+
export declare const WorkflowEdgeFullFragmentDoc = "\n fragment workflowEdgeFull on WorkflowEdge {\n cursor\n node {\n ...workflowFull\n }\n}\n ";
|
|
20703
20717
|
export declare const WorkflowNodeDefinitionFullFragmentDoc = "\n fragment workflowNodeDefinitionFull on WorkflowNodeDefinition {\n __typename\n raw\n}\n ";
|
|
20704
20718
|
export declare const WorkflowTaskMetaFragmentDoc = "\n fragment workflowTaskMeta on WorkflowTask {\n ...taskMeta\n workflow {\n ...workflowMeta\n }\n}\n ";
|
|
20705
20719
|
export declare const AssistantSessionsDocument = "\n query assistantSessions {\n assistantSessions {\n ...assistantSessionMeta\n }\n}\n \n fragment assistantSessionMeta on AssistantSession {\n __typename\n id\n modelId\n name\n updatedAt\n createdAt\n}\n ";
|
|
@@ -20974,9 +20988,9 @@ export declare const UserProfileDocument = "\n query userProfile {\n viewer
|
|
|
20974
20988
|
export declare const UserSettingsDocument = "\n query userSettings {\n viewer {\n id\n settings {\n ...userSettingsFull\n }\n }\n}\n \n fragment userSettingsFull on UserSettings {\n __typename\n data\n migrations\n}\n ";
|
|
20975
20989
|
export declare const WorkflowDocument = "\n query workflow($id: ID!) {\n workflow(id: $id) {\n ...workflowFull\n }\n}\n \n fragment workflowFull on Workflow {\n ...workflowMeta\n definition\n}\n \n\n fragment workflowMeta on Workflow {\n __typename\n id\n kind\n name\n enabled\n global\n readOnly\n}\n ";
|
|
20976
20990
|
export declare const WorkflowsStateDocument = "\n query workflowsState {\n workflows {\n ...workflowFull\n }\n workflowNodeDefinitions {\n ...workflowNodeDefinitionFull\n }\n}\n \n fragment workflowFull on Workflow {\n ...workflowMeta\n definition\n}\n \n\n fragment workflowMeta on Workflow {\n __typename\n id\n kind\n name\n enabled\n global\n readOnly\n}\n \n\n fragment workflowNodeDefinitionFull on WorkflowNodeDefinition {\n __typename\n raw\n}\n ";
|
|
20977
|
-
export declare const CreatedWorkflowDocument = "\n subscription createdWorkflow {\n createdWorkflow {\n workflowEdge {\n
|
|
20991
|
+
export declare const CreatedWorkflowDocument = "\n subscription createdWorkflow {\n createdWorkflow {\n workflowEdge {\n ...workflowEdgeFull\n }\n }\n}\n \n fragment workflowEdgeFull on WorkflowEdge {\n cursor\n node {\n ...workflowFull\n }\n}\n \n\n fragment workflowFull on Workflow {\n ...workflowMeta\n definition\n}\n \n\n fragment workflowMeta on Workflow {\n __typename\n id\n kind\n name\n enabled\n global\n readOnly\n}\n ";
|
|
20978
20992
|
export declare const DeletedWorkflowDocument = "\n subscription deletedWorkflow {\n deletedWorkflow {\n deletedWorkflowId\n }\n}\n ";
|
|
20979
|
-
export declare const UpdatedWorkflowDocument = "\n subscription updatedWorkflow {\n updatedWorkflow {\n workflowEdge {\n
|
|
20993
|
+
export declare const UpdatedWorkflowDocument = "\n subscription updatedWorkflow {\n updatedWorkflow {\n workflowEdge {\n ...workflowEdgeFull\n }\n }\n}\n \n fragment workflowEdgeFull on WorkflowEdge {\n cursor\n node {\n ...workflowFull\n }\n}\n \n\n fragment workflowFull on Workflow {\n ...workflowMeta\n definition\n}\n \n\n fragment workflowMeta on Workflow {\n __typename\n id\n kind\n name\n enabled\n global\n readOnly\n}\n ";
|
|
20980
20994
|
export declare const CreateWorkflowDocument = "\n mutation createWorkflow($input: CreateWorkflowInput!) {\n createWorkflow(input: $input) {\n error {\n ... on WorkflowUserError {\n ...workflowUserErrorFull\n }\n ... on OtherUserError {\n ...otherUserErrorFull\n }\n }\n workflow {\n ...workflowFull\n }\n }\n}\n \n fragment workflowUserErrorFull on WorkflowUserError {\n ...userErrorFull\n node\n message\n reason\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 workflowFull on Workflow {\n ...workflowMeta\n definition\n}\n \n\n fragment workflowMeta on Workflow {\n __typename\n id\n kind\n name\n enabled\n global\n readOnly\n}\n ";
|
|
20981
20995
|
export declare const DeleteWorkflowDocument = "\n mutation deleteWorkflow($id: ID!) {\n deleteWorkflow(id: $id) {\n deletedId\n error {\n ... on UnknownIdUserError {\n ...unknownIdUserErrorFull\n }\n ... on ReadOnlyUserError {\n ...readOnlyUserErrorFull\n }\n ... on OtherUserError {\n ...otherUserErrorFull\n }\n }\n }\n}\n \n fragment unknownIdUserErrorFull on UnknownIdUserError {\n ...userErrorFull\n id\n}\n \n\n fragment userErrorFull on UserError {\n __typename\n code\n}\n \n\n fragment readOnlyUserErrorFull on ReadOnlyUserError {\n ...userErrorFull\n}\n \n\n fragment otherUserErrorFull on OtherUserError {\n ...userErrorFull\n}\n ";
|
|
20982
20996
|
export declare const ToggleWorkflowDocument = "\n mutation toggleWorkflow($id: ID!, $enabled: Boolean!) {\n toggleWorkflow(id: $id, enabled: $enabled) {\n error {\n ... on UnknownIdUserError {\n ...unknownIdUserErrorFull\n }\n ... on OtherUserError {\n ...otherUserErrorFull\n }\n }\n workflow {\n ...workflowFull\n }\n }\n}\n \n fragment unknownIdUserErrorFull on UnknownIdUserError {\n ...userErrorFull\n id\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 workflowFull on Workflow {\n ...workflowMeta\n definition\n}\n \n\n fragment workflowMeta on Workflow {\n __typename\n id\n kind\n name\n enabled\n global\n readOnly\n}\n ";
|
package/src/types/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ import type { SitemapSDK } from "./sitemap";
|
|
|
22
22
|
import type { StorageSDK } from "./storage";
|
|
23
23
|
import type { UISDK } from "./ui";
|
|
24
24
|
import type { WindowSDK } from "./window";
|
|
25
|
+
import type { WorkflowSDK } from "./workflows";
|
|
25
26
|
export type { CommandContext } from "./commands";
|
|
26
27
|
export type { MenuItem } from "./menu";
|
|
27
28
|
export type { ReplayTab, ReplaySession, ReplayCollection } from "./replay";
|
|
@@ -31,6 +32,8 @@ export type { HTTPQL, ID } from "./utils";
|
|
|
31
32
|
export type { MatchReplaceRule, MatchReplaceCollection, MatchReplaceSection, MatchReplaceSectionRequestBody, MatchReplaceSectionRequestFirstLine, MatchReplaceSectionRequestHeader, MatchReplaceSectionRequestMethod, MatchReplaceSectionRequestPath, MatchReplaceSectionRequestQuery, MatchReplaceSectionResponseBody, MatchReplaceSectionResponseFirstLine, MatchReplaceSectionResponseHeader, MatchReplaceSectionResponseStatusCode, MatchReplaceOperationStatusCode, MatchReplaceOperationStatusCodeUpdate, MatchReplaceOperationQuery, MatchReplaceOperationQueryRaw, MatchReplaceOperationQueryAdd, MatchReplaceOperationQueryRemove, MatchReplaceOperationQueryUpdate, MatchReplaceOperationPath, MatchReplaceOperationPathRaw, MatchReplaceOperationMethod, MatchReplaceOperationMethodUpdate, MatchReplaceOperationHeader, MatchReplaceOperationHeaderRaw, MatchReplaceOperationHeaderAdd, MatchReplaceOperationHeaderRemove, MatchReplaceOperationHeaderUpdate, MatchReplaceOperationBody, MatchReplaceOperationBodyRaw, MatchReplaceOperationFirstLine, MatchReplaceOperationFirstLineRaw, MatchReplaceReplacer, MatchReplaceReplacerTerm, MatchReplaceReplacerWorkflow, MatchReplaceMatcherName, MatchReplaceMatcherRaw, MatchReplaceMatcherRawFull, MatchReplaceMatcherRawRegex, MatchReplaceMatcherRawValue, } from "./matchReplace";
|
|
32
33
|
export type { Scope } from "./scopes";
|
|
33
34
|
export type { EnvironmentVariable } from "./environment";
|
|
35
|
+
export type { Workflow, WorkflowKind, OnCreatedWorkflowCallback, OnUpdatedWorkflowCallback, OnDeletedWorkflowCallback, } from "./workflows";
|
|
36
|
+
export type { ListenerHandle } from "./utils";
|
|
34
37
|
/**
|
|
35
38
|
* Utilities for frontend plugins.
|
|
36
39
|
* @category SDK
|
|
@@ -132,4 +135,8 @@ export type API<T extends BackendEndpoints = Record<string, never>, E extends Ba
|
|
|
132
135
|
* Utilities to interact with the runtime.
|
|
133
136
|
*/
|
|
134
137
|
runtime: RuntimeSDK;
|
|
138
|
+
/**
|
|
139
|
+
* Utilities to interact with workflows.
|
|
140
|
+
*/
|
|
141
|
+
workflows: WorkflowSDK;
|
|
135
142
|
};
|
package/src/types/utils.d.ts
CHANGED
|
@@ -34,4 +34,13 @@ export type JSONCompatible<T> = unknown extends T ? never : {
|
|
|
34
34
|
[P in keyof T]: T[P] extends JSONValue ? T[P] : T[P] extends NotAssignableToJson ? never : JSONCompatible<T[P]>;
|
|
35
35
|
};
|
|
36
36
|
export type PromisifiedReturnType<T extends (...args: unknown[]) => unknown> = ReturnType<T> extends Promise<infer U> ? Promise<U> : Promise<ReturnType<T>>;
|
|
37
|
+
/**
|
|
38
|
+
* A handle for a listener.
|
|
39
|
+
*/
|
|
40
|
+
export type ListenerHandle = {
|
|
41
|
+
/**
|
|
42
|
+
* Stop the listener.
|
|
43
|
+
*/
|
|
44
|
+
stop: () => void;
|
|
45
|
+
};
|
|
37
46
|
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type ID, type ListenerHandle } from "./utils";
|
|
2
|
+
/**
|
|
3
|
+
* Utilities to interact with workflows.
|
|
4
|
+
* @category Workflows
|
|
5
|
+
*/
|
|
6
|
+
export type WorkflowSDK = {
|
|
7
|
+
/**
|
|
8
|
+
* Get all workflows.
|
|
9
|
+
* @returns All workflows.
|
|
10
|
+
*/
|
|
11
|
+
getWorkflows: () => Workflow[];
|
|
12
|
+
/**
|
|
13
|
+
* Register a callback to be called when a workflow is created.
|
|
14
|
+
* @param callback The callback to be called.
|
|
15
|
+
*/
|
|
16
|
+
onCreatedWorkflow: (callback: OnCreatedWorkflowCallback) => ListenerHandle;
|
|
17
|
+
/**
|
|
18
|
+
* Register a callback to be called when a workflow is updated.
|
|
19
|
+
* @param callback The callback to be called.
|
|
20
|
+
*/
|
|
21
|
+
onUpdatedWorkflow: (callback: OnUpdatedWorkflowCallback) => ListenerHandle;
|
|
22
|
+
/**
|
|
23
|
+
* Register a callback to be called when a workflow is deleted.
|
|
24
|
+
* @param callback The callback to be called.
|
|
25
|
+
*/
|
|
26
|
+
onDeletedWorkflow: (callback: OnDeletedWorkflowCallback) => ListenerHandle;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* A workflow
|
|
30
|
+
* @category Workflows
|
|
31
|
+
*/
|
|
32
|
+
export type Workflow = {
|
|
33
|
+
id: string;
|
|
34
|
+
name: string;
|
|
35
|
+
description: string;
|
|
36
|
+
kind: WorkflowKind;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* The kind of workflow.
|
|
40
|
+
* @category Workflows
|
|
41
|
+
*/
|
|
42
|
+
export type WorkflowKind = "Convert" | "Active" | "Passive";
|
|
43
|
+
export type OnCreatedWorkflowCallback = (event: {
|
|
44
|
+
workflow: Workflow;
|
|
45
|
+
}) => void;
|
|
46
|
+
export type OnUpdatedWorkflowCallback = (event: {
|
|
47
|
+
workflow: Workflow;
|
|
48
|
+
}) => void;
|
|
49
|
+
export type OnDeletedWorkflowCallback = (event: {
|
|
50
|
+
id: ID;
|
|
51
|
+
}) => void;
|