@agent-os-sdk/client 0.1.0
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/README.md +71 -0
- package/dist/client/AgentOsClient.d.ts +161 -0
- package/dist/client/AgentOsClient.d.ts.map +1 -0
- package/dist/client/AgentOsClient.js +217 -0
- package/dist/client/helpers.d.ts +63 -0
- package/dist/client/helpers.d.ts.map +1 -0
- package/dist/client/helpers.js +55 -0
- package/dist/client/raw.d.ts +138 -0
- package/dist/client/raw.d.ts.map +1 -0
- package/dist/client/raw.js +97 -0
- package/dist/generated/index.d.ts +2 -0
- package/dist/generated/index.d.ts.map +1 -0
- package/dist/generated/index.js +1 -0
- package/dist/generated/openapi.d.ts +6810 -0
- package/dist/generated/openapi.d.ts.map +1 -0
- package/dist/generated/openapi.js +5 -0
- package/dist/index.d.ts +72 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +86 -0
- package/dist/modules/a2a.d.ts +48 -0
- package/dist/modules/a2a.d.ts.map +1 -0
- package/dist/modules/a2a.js +37 -0
- package/dist/modules/agents.d.ts +137 -0
- package/dist/modules/agents.d.ts.map +1 -0
- package/dist/modules/agents.js +154 -0
- package/dist/modules/audit.d.ts +55 -0
- package/dist/modules/audit.d.ts.map +1 -0
- package/dist/modules/audit.js +38 -0
- package/dist/modules/builder.d.ts +65 -0
- package/dist/modules/builder.d.ts.map +1 -0
- package/dist/modules/builder.js +119 -0
- package/dist/modules/checkpoints.d.ts +53 -0
- package/dist/modules/checkpoints.d.ts.map +1 -0
- package/dist/modules/checkpoints.js +39 -0
- package/dist/modules/credentials.d.ts +89 -0
- package/dist/modules/credentials.d.ts.map +1 -0
- package/dist/modules/credentials.js +79 -0
- package/dist/modules/crons.d.ts +72 -0
- package/dist/modules/crons.d.ts.map +1 -0
- package/dist/modules/crons.js +66 -0
- package/dist/modules/dlq.d.ts +60 -0
- package/dist/modules/dlq.d.ts.map +1 -0
- package/dist/modules/dlq.js +56 -0
- package/dist/modules/evaluation.d.ts +119 -0
- package/dist/modules/evaluation.d.ts.map +1 -0
- package/dist/modules/evaluation.js +96 -0
- package/dist/modules/files.d.ts +68 -0
- package/dist/modules/files.d.ts.map +1 -0
- package/dist/modules/files.js +66 -0
- package/dist/modules/graphs.d.ts +51 -0
- package/dist/modules/graphs.d.ts.map +1 -0
- package/dist/modules/graphs.js +29 -0
- package/dist/modules/info.d.ts +27 -0
- package/dist/modules/info.d.ts.map +1 -0
- package/dist/modules/info.js +27 -0
- package/dist/modules/knowledge.d.ts +91 -0
- package/dist/modules/knowledge.d.ts.map +1 -0
- package/dist/modules/knowledge.js +80 -0
- package/dist/modules/mcp.d.ts +39 -0
- package/dist/modules/mcp.d.ts.map +1 -0
- package/dist/modules/mcp.js +38 -0
- package/dist/modules/me.d.ts +27 -0
- package/dist/modules/me.d.ts.map +1 -0
- package/dist/modules/me.js +19 -0
- package/dist/modules/members.d.ts +77 -0
- package/dist/modules/members.d.ts.map +1 -0
- package/dist/modules/members.js +77 -0
- package/dist/modules/metrics.d.ts +16 -0
- package/dist/modules/metrics.d.ts.map +1 -0
- package/dist/modules/metrics.js +24 -0
- package/dist/modules/playground.d.ts +42 -0
- package/dist/modules/playground.d.ts.map +1 -0
- package/dist/modules/playground.js +48 -0
- package/dist/modules/prompts.d.ts +87 -0
- package/dist/modules/prompts.d.ts.map +1 -0
- package/dist/modules/prompts.js +87 -0
- package/dist/modules/runs.d.ts +181 -0
- package/dist/modules/runs.d.ts.map +1 -0
- package/dist/modules/runs.js +187 -0
- package/dist/modules/store.d.ts +37 -0
- package/dist/modules/store.d.ts.map +1 -0
- package/dist/modules/store.js +48 -0
- package/dist/modules/tenants.d.ts +42 -0
- package/dist/modules/tenants.d.ts.map +1 -0
- package/dist/modules/tenants.js +45 -0
- package/dist/modules/threads.d.ts +181 -0
- package/dist/modules/threads.d.ts.map +1 -0
- package/dist/modules/threads.js +178 -0
- package/dist/modules/tools.d.ts +44 -0
- package/dist/modules/tools.d.ts.map +1 -0
- package/dist/modules/tools.js +39 -0
- package/dist/modules/traces.d.ts +79 -0
- package/dist/modules/traces.d.ts.map +1 -0
- package/dist/modules/traces.js +56 -0
- package/dist/modules/triggers.d.ts +71 -0
- package/dist/modules/triggers.d.ts.map +1 -0
- package/dist/modules/triggers.js +67 -0
- package/dist/modules/usage.d.ts +26 -0
- package/dist/modules/usage.d.ts.map +1 -0
- package/dist/modules/usage.js +19 -0
- package/dist/modules/vectorStores.d.ts +97 -0
- package/dist/modules/vectorStores.d.ts.map +1 -0
- package/dist/modules/vectorStores.js +87 -0
- package/dist/modules/workspaces.d.ts +52 -0
- package/dist/modules/workspaces.d.ts.map +1 -0
- package/dist/modules/workspaces.js +59 -0
- package/dist/sse/client.d.ts +62 -0
- package/dist/sse/client.d.ts.map +1 -0
- package/dist/sse/client.js +66 -0
- package/package.json +50 -0
- package/src/client/AgentOsClient.ts +269 -0
- package/src/client/helpers.ts +98 -0
- package/src/client/raw.ts +241 -0
- package/src/generated/index.ts +2 -0
- package/src/generated/openapi.ts +6810 -0
- package/src/generated/swagger.json +8549 -0
- package/src/index.ts +161 -0
- package/src/modules/a2a.ts +64 -0
- package/src/modules/agents.ts +229 -0
- package/src/modules/audit.ts +74 -0
- package/src/modules/builder.ts +166 -0
- package/src/modules/checkpoints.ts +78 -0
- package/src/modules/credentials.ts +144 -0
- package/src/modules/crons.ts +114 -0
- package/src/modules/dlq.ts +93 -0
- package/src/modules/evaluation.ts +189 -0
- package/src/modules/files.ts +112 -0
- package/src/modules/graphs.ts +50 -0
- package/src/modules/info.ts +35 -0
- package/src/modules/knowledge.ts +147 -0
- package/src/modules/mcp.ts +59 -0
- package/src/modules/me.ts +32 -0
- package/src/modules/members.ts +117 -0
- package/src/modules/metrics.ts +27 -0
- package/src/modules/playground.ts +68 -0
- package/src/modules/prompts.ts +147 -0
- package/src/modules/runs.ts +277 -0
- package/src/modules/store.ts +65 -0
- package/src/modules/tenants.ts +67 -0
- package/src/modules/threads.ts +287 -0
- package/src/modules/tools.ts +65 -0
- package/src/modules/traces.ts +117 -0
- package/src/modules/triggers.ts +113 -0
- package/src/modules/usage.ts +32 -0
- package/src/modules/vectorStores.ts +160 -0
- package/src/modules/workspaces.ts +89 -0
- package/src/sse/client.ts +100 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent OS SDK - Raw HTTP Client
|
|
3
|
+
*
|
|
4
|
+
* Fully typed HTTP client using openapi-fetch with generated OpenAPI types.
|
|
5
|
+
* All types are automatically inferred from the backend Swagger specification.
|
|
6
|
+
*/
|
|
7
|
+
import { type Client } from "openapi-fetch";
|
|
8
|
+
import type { paths, components } from "../generated/openapi.js";
|
|
9
|
+
export type { paths, components };
|
|
10
|
+
export type ClientOptions = {
|
|
11
|
+
baseUrl: string;
|
|
12
|
+
headers?: Record<string, string>;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Standard API response wrapper.
|
|
16
|
+
* This matches the pattern used by openapi-fetch.
|
|
17
|
+
*/
|
|
18
|
+
export interface APIResponse<T> {
|
|
19
|
+
data?: T;
|
|
20
|
+
error?: {
|
|
21
|
+
code: string;
|
|
22
|
+
message: string;
|
|
23
|
+
details?: unknown;
|
|
24
|
+
};
|
|
25
|
+
response: Response;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Typed API client using openapi-fetch.
|
|
29
|
+
* All paths and responses are fully typed from OpenAPI spec.
|
|
30
|
+
*/
|
|
31
|
+
export type TypedClient = Client<paths>;
|
|
32
|
+
/**
|
|
33
|
+
* Creates a typed HTTP client with openapi-fetch.
|
|
34
|
+
* This provides full type inference for all API endpoints.
|
|
35
|
+
*/
|
|
36
|
+
export declare function createTypedClient(options: ClientOptions): TypedClient;
|
|
37
|
+
/**
|
|
38
|
+
* Legacy raw client interface (for backward compatibility).
|
|
39
|
+
* Wraps openapi-fetch to provide the old interface while maintaining types.
|
|
40
|
+
*/
|
|
41
|
+
export declare function createRawClient(options: ClientOptions): {
|
|
42
|
+
GET: <T>(path: string, opts?: Parameters<(<T_1>(method: string, path: string, opts?: {
|
|
43
|
+
params?: {
|
|
44
|
+
path?: Record<string, string>;
|
|
45
|
+
query?: Record<string, unknown>;
|
|
46
|
+
};
|
|
47
|
+
body?: unknown;
|
|
48
|
+
headers?: Record<string, string>;
|
|
49
|
+
}) => Promise<APIResponse<T_1>>)>[2]) => Promise<APIResponse<T>>;
|
|
50
|
+
POST: <T>(path: string, opts?: Parameters<(<T_1>(method: string, path: string, opts?: {
|
|
51
|
+
params?: {
|
|
52
|
+
path?: Record<string, string>;
|
|
53
|
+
query?: Record<string, unknown>;
|
|
54
|
+
};
|
|
55
|
+
body?: unknown;
|
|
56
|
+
headers?: Record<string, string>;
|
|
57
|
+
}) => Promise<APIResponse<T_1>>)>[2]) => Promise<APIResponse<T>>;
|
|
58
|
+
PUT: <T>(path: string, opts?: Parameters<(<T_1>(method: string, path: string, opts?: {
|
|
59
|
+
params?: {
|
|
60
|
+
path?: Record<string, string>;
|
|
61
|
+
query?: Record<string, unknown>;
|
|
62
|
+
};
|
|
63
|
+
body?: unknown;
|
|
64
|
+
headers?: Record<string, string>;
|
|
65
|
+
}) => Promise<APIResponse<T_1>>)>[2]) => Promise<APIResponse<T>>;
|
|
66
|
+
PATCH: <T>(path: string, opts?: Parameters<(<T_1>(method: string, path: string, opts?: {
|
|
67
|
+
params?: {
|
|
68
|
+
path?: Record<string, string>;
|
|
69
|
+
query?: Record<string, unknown>;
|
|
70
|
+
};
|
|
71
|
+
body?: unknown;
|
|
72
|
+
headers?: Record<string, string>;
|
|
73
|
+
}) => Promise<APIResponse<T_1>>)>[2]) => Promise<APIResponse<T>>;
|
|
74
|
+
DELETE: <T>(path: string, opts?: Parameters<(<T_1>(method: string, path: string, opts?: {
|
|
75
|
+
params?: {
|
|
76
|
+
path?: Record<string, string>;
|
|
77
|
+
query?: Record<string, unknown>;
|
|
78
|
+
};
|
|
79
|
+
body?: unknown;
|
|
80
|
+
headers?: Record<string, string>;
|
|
81
|
+
}) => Promise<APIResponse<T_1>>)>[2]) => Promise<APIResponse<T>>;
|
|
82
|
+
};
|
|
83
|
+
export type RawClient = ReturnType<typeof createRawClient>;
|
|
84
|
+
export type Agent = components["schemas"]["AgentBundleAgent"];
|
|
85
|
+
export type CreateAgentRequest = components["schemas"]["CreateAgentRequest"];
|
|
86
|
+
export type UpdateAgentRequest = components["schemas"]["UpdateAgentRequest"];
|
|
87
|
+
export type AgentBundle = components["schemas"]["AgentBundle"];
|
|
88
|
+
export type AgentVersion = components["schemas"]["AgentBundleVersion"];
|
|
89
|
+
export type CreateAgentVersionRequest = components["schemas"]["CreateAgentVersionRequest"];
|
|
90
|
+
export type RunResponse = components["schemas"]["RunResponse"];
|
|
91
|
+
export type RunDetailResponse = components["schemas"]["RunDetailResponse"];
|
|
92
|
+
export type CreateRunRequest = components["schemas"]["CreateRunRequest"];
|
|
93
|
+
export type WaitRunRequest = components["schemas"]["WaitRunRequest"];
|
|
94
|
+
export type WaitRunResponse = components["schemas"]["WaitRunResponse"];
|
|
95
|
+
export type BatchRunRequest = components["schemas"]["BatchRunRequest"];
|
|
96
|
+
export type BatchRunResponse = components["schemas"]["BatchRunResponse"];
|
|
97
|
+
export type ReplayRequest = components["schemas"]["ReplayRequest"];
|
|
98
|
+
export type CancelRequest = components["schemas"]["CancelRequest"];
|
|
99
|
+
export type CancelRunResponse = components["schemas"]["CancelRunResponse"];
|
|
100
|
+
export type ThreadRequest = components["schemas"]["ThreadRequest"];
|
|
101
|
+
export type ThreadSearchRequest = components["schemas"]["ThreadSearchRequest"];
|
|
102
|
+
export type ThreadCopyRequest = components["schemas"]["ThreadCopyRequest"];
|
|
103
|
+
export type ThreadPruneRequest = components["schemas"]["ThreadPruneRequest"];
|
|
104
|
+
export type AddMessageRequest = components["schemas"]["AddMessageRequest"];
|
|
105
|
+
export type CheckpointDetail = components["schemas"]["CheckpointDetail"];
|
|
106
|
+
export type CheckpointNode = components["schemas"]["CheckpointNode"];
|
|
107
|
+
export type CheckpointListResponse = components["schemas"]["CheckpointListResponse"];
|
|
108
|
+
export type CheckpointIndexResponse = components["schemas"]["CheckpointIndexResponse"];
|
|
109
|
+
export type CreateCheckpointRequest = components["schemas"]["CreateCheckpointRequest"];
|
|
110
|
+
export type CreateCredentialRequest = components["schemas"]["CreateCredentialRequest"];
|
|
111
|
+
export type UpdateCredentialRequest = components["schemas"]["UpdateCredentialRequest"];
|
|
112
|
+
export type CreateDatasetRequest = components["schemas"]["CreateDatasetRequest"];
|
|
113
|
+
export type CreateExperimentRequest = components["schemas"]["CreateExperimentRequest"];
|
|
114
|
+
export type ExampleData = components["schemas"]["ExampleData"];
|
|
115
|
+
export type AddExamplesRequest = components["schemas"]["AddExamplesRequest"];
|
|
116
|
+
export type VectorStoreResponse = components["schemas"]["VectorStoreResponse"];
|
|
117
|
+
export type VectorQueryRequest = components["schemas"]["VectorQueryRequest"];
|
|
118
|
+
export type VectorQueryResponse = components["schemas"]["VectorQueryResponse"];
|
|
119
|
+
export type VectorSearchResult = components["schemas"]["VectorSearchResult"];
|
|
120
|
+
export type VectorStoreFileResponse = components["schemas"]["VectorStoreFileResponse"];
|
|
121
|
+
export type CreateCronJobRequest = components["schemas"]["CreateCronJobRequest"];
|
|
122
|
+
export type UpdateCronJobRequest = components["schemas"]["UpdateCronJobRequest"];
|
|
123
|
+
export type InviteMemberRequest = components["schemas"]["InviteMemberRequest"];
|
|
124
|
+
export type UpdateMemberRequest = components["schemas"]["UpdateMemberRequest"];
|
|
125
|
+
export type UpdateTenantRequest = components["schemas"]["UpdateTenantRequest"];
|
|
126
|
+
export type UpdateWorkspaceRequest = components["schemas"]["UpdateWorkspaceRequest"];
|
|
127
|
+
export type CreatePromptRequest = components["schemas"]["CreatePromptRequest"];
|
|
128
|
+
export type CreatePromptVersionRequest = components["schemas"]["CreatePromptVersionRequest"];
|
|
129
|
+
export type CreatePresignedUploadRequest = components["schemas"]["CreatePresignedUploadRequest"];
|
|
130
|
+
export type PresignedUploadResponse = components["schemas"]["PresignedUploadResponse"];
|
|
131
|
+
export type ConfirmUploadRequest = components["schemas"]["ConfirmUploadRequest"];
|
|
132
|
+
export type SpanData = components["schemas"]["SpanData"];
|
|
133
|
+
export type BatchIngestRequest = components["schemas"]["BatchIngestRequest"];
|
|
134
|
+
export type AddFeedbackRequest = components["schemas"]["AddFeedbackRequest"];
|
|
135
|
+
export type UpdateTriggerRequest = components["schemas"]["UpdateTriggerRequest"];
|
|
136
|
+
export type StoreValueRequest = components["schemas"]["StoreValueRequest"];
|
|
137
|
+
export type ProblemDetails = components["schemas"]["ProblemDetails"];
|
|
138
|
+
//# sourceMappingURL=raw.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"raw.d.ts","sourceRoot":"","sources":["../../src/client/raw.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAqB,EAAE,KAAK,MAAM,EAAqB,MAAM,eAAe,CAAC;AAC7E,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAGjE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AAElC,MAAM,MAAM,aAAa,GAAG;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACpC,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC;IAC1B,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,KAAK,CAAC,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,OAAO,CAAC;KACrB,CAAC;IACF,QAAQ,EAAE,QAAQ,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AAExC;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO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MAAM,oBAAoB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,sBAAsB,CAAC,CAAC;AAGjF,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,CAAC;AACzD,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,oBAAoB,CAAC,CAAC;AAC7E,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,oBAAoB,CAAC,CAAC;AAG7E,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,sBAAsB,CAAC,CAAC;AAGjF,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,mBAAmB,CAAC,CAAC;AAG3E,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent OS SDK - Raw HTTP Client
|
|
3
|
+
*
|
|
4
|
+
* Fully typed HTTP client using openapi-fetch with generated OpenAPI types.
|
|
5
|
+
* All types are automatically inferred from the backend Swagger specification.
|
|
6
|
+
*/
|
|
7
|
+
import createClient, {} from "openapi-fetch";
|
|
8
|
+
/**
|
|
9
|
+
* Creates a typed HTTP client with openapi-fetch.
|
|
10
|
+
* This provides full type inference for all API endpoints.
|
|
11
|
+
*/
|
|
12
|
+
export function createTypedClient(options) {
|
|
13
|
+
return createClient({
|
|
14
|
+
baseUrl: options.baseUrl,
|
|
15
|
+
headers: options.headers,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Legacy raw client interface (for backward compatibility).
|
|
20
|
+
* Wraps openapi-fetch to provide the old interface while maintaining types.
|
|
21
|
+
*/
|
|
22
|
+
export function createRawClient(options) {
|
|
23
|
+
const { baseUrl, headers: defaultHeaders = {} } = options;
|
|
24
|
+
async function request(method, path, opts) {
|
|
25
|
+
// Replace path params
|
|
26
|
+
let url = path;
|
|
27
|
+
if (opts?.params?.path) {
|
|
28
|
+
for (const [key, value] of Object.entries(opts.params.path)) {
|
|
29
|
+
url = url.replace(`{${key}}`, encodeURIComponent(value));
|
|
30
|
+
// Also handle {id} pattern common in our API
|
|
31
|
+
url = url.replace(`{id}`, encodeURIComponent(value));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
// Build query string
|
|
35
|
+
if (opts?.params?.query) {
|
|
36
|
+
const query = new URLSearchParams();
|
|
37
|
+
for (const [key, value] of Object.entries(opts.params.query)) {
|
|
38
|
+
if (value !== undefined && value !== null) {
|
|
39
|
+
query.append(key, String(value));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const queryStr = query.toString();
|
|
43
|
+
if (queryStr) {
|
|
44
|
+
url += `?${queryStr}`;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const fullUrl = `${baseUrl}${url}`;
|
|
48
|
+
const headers = {
|
|
49
|
+
...defaultHeaders,
|
|
50
|
+
...opts?.headers,
|
|
51
|
+
};
|
|
52
|
+
if (opts?.body) {
|
|
53
|
+
headers["Content-Type"] = "application/json";
|
|
54
|
+
}
|
|
55
|
+
const response = await fetch(fullUrl, {
|
|
56
|
+
method,
|
|
57
|
+
headers,
|
|
58
|
+
body: opts?.body ? JSON.stringify(opts.body) : undefined,
|
|
59
|
+
});
|
|
60
|
+
if (!response.ok) {
|
|
61
|
+
let error;
|
|
62
|
+
try {
|
|
63
|
+
const json = await response.json();
|
|
64
|
+
error = {
|
|
65
|
+
code: json.code || `HTTP_${response.status}`,
|
|
66
|
+
message: json.message || response.statusText,
|
|
67
|
+
details: json.details,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
error = {
|
|
72
|
+
code: `HTTP_${response.status}`,
|
|
73
|
+
message: response.statusText,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
return { error, response };
|
|
77
|
+
}
|
|
78
|
+
// Handle no-content responses
|
|
79
|
+
if (response.status === 204) {
|
|
80
|
+
return { data: undefined, response };
|
|
81
|
+
}
|
|
82
|
+
try {
|
|
83
|
+
const data = await response.json();
|
|
84
|
+
return { data: data, response };
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
return { data: undefined, response };
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
GET: (path, opts) => request("GET", path, opts),
|
|
92
|
+
POST: (path, opts) => request("POST", path, opts),
|
|
93
|
+
PUT: (path, opts) => request("PUT", path, opts),
|
|
94
|
+
PATCH: (path, opts) => request("PATCH", path, opts),
|
|
95
|
+
DELETE: (path, opts) => request("DELETE", path, opts),
|
|
96
|
+
};
|
|
97
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/generated/index.ts"],"names":[],"mappings":"AACA,mBAAmB,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|