MCPcopy Create free account
hub / github.com/holaboss-ai/holaOS / makeWorkspacesMethods

Function makeWorkspacesMethods

sdk/runtime-client/src/methods/workspaces.ts:81–147  ·  view source on GitHub ↗
(request: RequestFn)

Source from the content-addressed store, hash-verified

79};
80
81export function makeWorkspacesMethods(request: RequestFn): WorkspacesMethods {
82 return {
83 list({ includeDeleted = false, limit = 100, offset = 0 } = {}) {
84 return request<WorkspaceListResponse>({
85 method: "GET",
86 path: "/api/v1/workspaces",
87 params: {
88 include_deleted: includeDeleted,
89 limit,
90 offset,
91 },
92 });
93 },
94
95 get(workspaceId) {
96 return request<WorkspaceResponse>({
97 method: "GET",
98 path: `/api/v1/workspaces/${encodeURIComponent(workspaceId)}`,
99 });
100 },
101
102 create(payload) {
103 return request<WorkspaceResponse>({
104 method: "POST",
105 path: "/api/v1/workspaces",
106 payload,
107 });
108 },
109
110 update(workspaceId, payload) {
111 return request<WorkspaceResponse>({
112 method: "PATCH",
113 path: `/api/v1/workspaces/${encodeURIComponent(workspaceId)}`,
114 payload,
115 });
116 },
117
118 delete(workspaceId, options = {}) {
119 const req = {
120 method: "DELETE" as const,
121 path: `/api/v1/workspaces/${encodeURIComponent(workspaceId)}`,
122 ...(options.keepFiles !== undefined
123 ? { params: { keep_files: options.keepFiles } }
124 : {}),
125 };
126 return request<WorkspaceResponse>(req);
127 },
128
129 activate(workspaceId) {
130 return request<WorkspaceResponse>({
131 method: "POST",
132 path: `/api/v1/workspaces/${encodeURIComponent(workspaceId)}/activate`,
133 payload: {},
134 });
135 },
136
137 ensureAppsRunning(workspaceId) {
138 return request<Record<string, unknown>>({

Callers 1

createRuntimeClientFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected