mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-22 08:38:13 +02:00
feat: add examples to create workflow and use sdk
This commit is contained in:
parent
16587fd7e1
commit
f041e6030d
18 changed files with 1038 additions and 7 deletions
4
sdk/typescript/package-lock.json
generated
4
sdk/typescript/package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@dograh/sdk",
|
||||
"version": "0.1.1",
|
||||
"version": "0.1.3",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@dograh/sdk",
|
||||
"version": "0.1.1",
|
||||
"version": "0.1.3",
|
||||
"license": "BSD-2-Clause",
|
||||
"devDependencies": {
|
||||
"openapi-typescript": "^7.13.0",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@dograh/sdk",
|
||||
"version": "0.1.2",
|
||||
"version": "0.1.3",
|
||||
"description": "Typed builder for Dograh voice-AI workflows",
|
||||
"license": "BSD-2-Clause",
|
||||
"author": "Zansat Technologies Private Limited",
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
// `_generated_models` (openapi-typescript output, --root-types).
|
||||
|
||||
import type {
|
||||
CreateWorkflowRequest,
|
||||
CredentialResponse,
|
||||
DocumentListResponseSchema,
|
||||
InitiateCallRequest,
|
||||
|
|
@ -26,6 +27,11 @@ export abstract class _GeneratedClient {
|
|||
opts?: { json?: unknown; params?: Record<string, unknown> },
|
||||
): Promise<T>;
|
||||
|
||||
/** Create a new workflow from a workflow definition. */
|
||||
async createWorkflow(opts: { body: CreateWorkflowRequest }): Promise<WorkflowResponse> {
|
||||
return this.request<WorkflowResponse>("POST", "/workflow/create/definition", { json: opts.body });
|
||||
}
|
||||
|
||||
/** Fetch a single node spec by name. */
|
||||
async getNodeType(name: string): Promise<NodeSpec> {
|
||||
return this.request<NodeSpec>("GET", `/node-types/${name}`);
|
||||
|
|
|
|||
|
|
@ -25,6 +25,30 @@ export interface paths {
|
|||
patch?: never;
|
||||
trace?: never;
|
||||
};
|
||||
"/api/v1/workflow/create/definition": {
|
||||
parameters: {
|
||||
query?: never;
|
||||
header?: never;
|
||||
path?: never;
|
||||
cookie?: never;
|
||||
};
|
||||
get?: never;
|
||||
put?: never;
|
||||
/**
|
||||
* Create Workflow
|
||||
* @description Create a new workflow from the client
|
||||
*
|
||||
* Args:
|
||||
* request: The create workflow request
|
||||
* user: The user to create the workflow for
|
||||
*/
|
||||
post: operations["create_workflow_api_v1_workflow_create_definition_post"];
|
||||
delete?: never;
|
||||
options?: never;
|
||||
head?: never;
|
||||
patch?: never;
|
||||
trace?: never;
|
||||
};
|
||||
"/api/v1/workflow/fetch": {
|
||||
parameters: {
|
||||
query?: never;
|
||||
|
|
@ -246,6 +270,15 @@ export interface components {
|
|||
*/
|
||||
disposition_codes: string[];
|
||||
};
|
||||
/** CreateWorkflowRequest */
|
||||
CreateWorkflowRequest: {
|
||||
/** Name */
|
||||
name: string;
|
||||
/** Workflow Definition */
|
||||
workflow_definition: {
|
||||
[key: string]: unknown;
|
||||
};
|
||||
};
|
||||
/**
|
||||
* CreatedByResponse
|
||||
* @description Response schema for the user who created a tool.
|
||||
|
|
@ -714,6 +747,7 @@ export interface components {
|
|||
pathItems: never;
|
||||
}
|
||||
export type CallDispositionCodes = components['schemas']['CallDispositionCodes'];
|
||||
export type CreateWorkflowRequest = components['schemas']['CreateWorkflowRequest'];
|
||||
export type CreatedByResponse = components['schemas']['CreatedByResponse'];
|
||||
export type CredentialResponse = components['schemas']['CredentialResponse'];
|
||||
export type DisplayOptions = components['schemas']['DisplayOptions'];
|
||||
|
|
@ -781,6 +815,49 @@ export interface operations {
|
|||
};
|
||||
};
|
||||
};
|
||||
create_workflow_api_v1_workflow_create_definition_post: {
|
||||
parameters: {
|
||||
query?: never;
|
||||
header?: {
|
||||
authorization?: string | null;
|
||||
"X-API-Key"?: string | null;
|
||||
};
|
||||
path?: never;
|
||||
cookie?: never;
|
||||
};
|
||||
requestBody: {
|
||||
content: {
|
||||
"application/json": components["schemas"]["CreateWorkflowRequest"];
|
||||
};
|
||||
};
|
||||
responses: {
|
||||
/** @description Successful Response */
|
||||
200: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": components["schemas"]["WorkflowResponse"];
|
||||
};
|
||||
};
|
||||
/** @description Not found */
|
||||
404: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content?: never;
|
||||
};
|
||||
/** @description Validation Error */
|
||||
422: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": components["schemas"]["HTTPValidationError"];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
get_workflows_api_v1_workflow_fetch_get: {
|
||||
parameters: {
|
||||
query?: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue