chore: Workflow execution JS-SDK (#8851)

This commit is contained in:
Oli Juhl
2024-08-29 11:22:43 +00:00
committed by GitHub
parent e396c01260
commit 00bd9271e3
19 changed files with 192 additions and 178 deletions
@@ -2,7 +2,6 @@ import Medusa from "@medusajs/js-sdk"
import { campaigns } from "./campaigns"
import { categories } from "./categories"
import { promotions } from "./promotions"
import { workflowExecutions } from "./workflow-executions"
export const backendUrl = __BACKEND_URL__ ?? "http://localhost:9000"
@@ -10,7 +9,6 @@ export const client = {
campaigns: campaigns,
categories: categories,
promotions: promotions,
workflowExecutions: workflowExecutions,
}
export const sdk = new Medusa({
@@ -1,27 +0,0 @@
import {
WorkflowExecutionListRes,
WorkflowExecutionRes,
} from "../../types/api-responses"
import { getRequest } from "./common"
async function retrieveWorkflowExecution(
id: string,
query?: Record<string, any>
) {
return getRequest<WorkflowExecutionRes>(
`/admin/workflows-executions/${id}`,
query
)
}
async function listWorkflowExecutionss(query?: Record<string, any>) {
return getRequest<WorkflowExecutionListRes>(
`/admin/workflows-executions`,
query
)
}
export const workflowExecutions = {
retrieve: retrieveWorkflowExecution,
list: listWorkflowExecutionss,
}