chore: Workflow execution JS-SDK (#8851)

This commit is contained in:
Oli Juhl
2024-08-29 13:22:43 +02:00
committed by GitHub
parent e396c01260
commit 00bd9271e3
19 changed files with 192 additions and 178 deletions
+3
View File
@@ -37,6 +37,7 @@ import { TaxRate } from "./tax-rate"
import { TaxRegion } from "./tax-region"
import { Upload } from "./upload"
import { User } from "./user"
import { WorkflowExecution } from "./workflow-execution"
export class Admin {
public invite: Invite
@@ -75,6 +76,7 @@ export class Admin {
public refundReason: RefundReason
public paymentCollection: PaymentCollection
public apiKey: ApiKey
public workflowExecution: WorkflowExecution
public reservation: Reservation
public customerGroup: CustomerGroup
@@ -115,6 +117,7 @@ export class Admin {
this.exchange = new Exchange(client)
this.paymentCollection = new PaymentCollection(client)
this.apiKey = new ApiKey(client)
this.workflowExecution = new WorkflowExecution(client)
this.reservation = new Reservation(client)
this.customerGroup = new CustomerGroup(client)
}
@@ -0,0 +1,32 @@
import { HttpTypes } from "@medusajs/types"
import { Client } from "../client"
import { ClientHeaders } from "../types"
export class WorkflowExecution {
private client: Client
constructor(client: Client) {
this.client = client
}
async list(
queryParams?: HttpTypes.AdminGetWorkflowExecutionsParams,
headers?: ClientHeaders
) {
return await this.client.fetch<HttpTypes.AdminWorkflowExecutionListResponse>(
`/admin/workflows-executions`,
{
query: queryParams,
headers,
}
)
}
async retrieve(id: string, headers?: ClientHeaders) {
return await this.client.fetch<HttpTypes.AdminWorkflowExecutionResponse>(
`/admin/workflows-executions/${id}`,
{
headers,
}
)
}
}