Skip to content

Commit 20012a1

Browse files
committed
SDK regeneration
1 parent aa0064a commit 20012a1

File tree

253 files changed

+6374
-26
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

253 files changed

+6374
-26
lines changed

reference.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,82 @@
11
# Reference
22

3+
<details><summary><code>client.<a href="/src/Client.ts">delete</a>({ ...params }) -> void</code></summary>
4+
<dl>
5+
<dd>
6+
7+
#### 📝 Description
8+
9+
<dl>
10+
<dd>
11+
12+
<dl>
13+
<dd>
14+
15+
Deletes resources of specific types, such as provider-account, cluster, workspace, or application.
16+
17+
</dd>
18+
</dl>
19+
</dd>
20+
</dl>
21+
22+
#### 🔌 Usage
23+
24+
<dl>
25+
<dd>
26+
27+
<dl>
28+
<dd>
29+
30+
```typescript
31+
await client.delete({
32+
manifest: {
33+
type: "ml-repo",
34+
name: "name",
35+
storage_integration_fqn: "storage_integration_fqn",
36+
collaborators: [
37+
{
38+
subject: "subject",
39+
role_id: "role_id",
40+
},
41+
],
42+
},
43+
});
44+
```
45+
46+
</dd>
47+
</dl>
48+
</dd>
49+
</dl>
50+
51+
#### ⚙️ Parameters
52+
53+
<dl>
54+
<dd>
55+
56+
<dl>
57+
<dd>
58+
59+
**request:** `TrueFoundry.TrueFoundryDeleteRequest`
60+
61+
</dd>
62+
</dl>
63+
64+
<dl>
65+
<dd>
66+
67+
**requestOptions:** `TrueFoundryClient.RequestOptions`
68+
69+
</dd>
70+
</dl>
71+
</dd>
72+
</dl>
73+
74+
</dd>
75+
</dl>
76+
</details>
77+
78+
##
79+
380
## Internal
481

582
<details><summary><code>client.internal.<a href="/src/api/resources/internal/client/Client.ts">getIdFromFqn</a>(type, { ...params }) -> Record<string, unknown></code></summary>

src/Client.ts

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
*/
44

55
import * as core from "./core";
6+
import * as TrueFoundry from "./api/index";
7+
import urlJoin from "url-join";
8+
import * as errors from "./errors/index";
69
import { Internal } from "./api/resources/internal/client/Client";
710
import { Users } from "./api/resources/users/client/Client";
811
import { Teams } from "./api/resources/teams/client/Client";
@@ -202,4 +205,182 @@ export class TrueFoundryClient {
202205
public get tracingProjects(): TracingProjects {
203206
return (this._tracingProjects ??= new TracingProjects(this._options));
204207
}
208+
209+
/**
210+
* Applies a given manifest to create or update resources of specific types, such as provider-account, cluster, workspace, or ml-repo.
211+
*
212+
* @param {TrueFoundry.TrueFoundryApplyRequest} request
213+
* @param {TrueFoundryClient.RequestOptions} requestOptions - Request-specific configuration.
214+
*
215+
* @example
216+
* await client.apply({
217+
* manifest: {
218+
* type: "ml-repo",
219+
* name: "name",
220+
* storage_integration_fqn: "storage_integration_fqn",
221+
* collaborators: [{
222+
* subject: "subject",
223+
* role_id: "role_id"
224+
* }]
225+
* }
226+
* })
227+
*/
228+
public apply(
229+
request: TrueFoundry.TrueFoundryApplyRequest,
230+
requestOptions?: TrueFoundryClient.RequestOptions,
231+
): core.HttpResponsePromise<TrueFoundry.TrueFoundryApplyResponse> {
232+
return core.HttpResponsePromise.fromPromise(this.__apply(request, requestOptions));
233+
}
234+
235+
private async __apply(
236+
request: TrueFoundry.TrueFoundryApplyRequest,
237+
requestOptions?: TrueFoundryClient.RequestOptions,
238+
): Promise<core.WithRawResponse<TrueFoundry.TrueFoundryApplyResponse>> {
239+
const _response = await (this._options.fetcher ?? core.fetcher)({
240+
url: urlJoin(
241+
(await core.Supplier.get(this._options.baseUrl)) ??
242+
(await core.Supplier.get(this._options.environment)),
243+
"api/svc/v1/apply",
244+
),
245+
method: "PUT",
246+
headers: {
247+
Authorization: await this._getAuthorizationHeader(),
248+
"X-Fern-Language": "JavaScript",
249+
"X-Fern-SDK-Name": "truefoundry-sdk",
250+
"X-Fern-SDK-Version": "0.0.0",
251+
"User-Agent": "truefoundry-sdk/0.0.0",
252+
"X-Fern-Runtime": core.RUNTIME.type,
253+
"X-Fern-Runtime-Version": core.RUNTIME.version,
254+
...requestOptions?.headers,
255+
},
256+
contentType: "application/json",
257+
requestType: "json",
258+
body: request,
259+
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
260+
maxRetries: requestOptions?.maxRetries,
261+
abortSignal: requestOptions?.abortSignal,
262+
});
263+
if (_response.ok) {
264+
return { data: _response.body as TrueFoundry.TrueFoundryApplyResponse, rawResponse: _response.rawResponse };
265+
}
266+
267+
if (_response.error.reason === "status-code") {
268+
throw new errors.TrueFoundryError({
269+
statusCode: _response.error.statusCode,
270+
body: _response.error.body,
271+
rawResponse: _response.rawResponse,
272+
});
273+
}
274+
275+
switch (_response.error.reason) {
276+
case "non-json":
277+
throw new errors.TrueFoundryError({
278+
statusCode: _response.error.statusCode,
279+
body: _response.error.rawBody,
280+
rawResponse: _response.rawResponse,
281+
});
282+
case "timeout":
283+
throw new errors.TrueFoundryTimeoutError("Timeout exceeded when calling PUT /api/svc/v1/apply.");
284+
case "unknown":
285+
throw new errors.TrueFoundryError({
286+
message: _response.error.errorMessage,
287+
rawResponse: _response.rawResponse,
288+
});
289+
}
290+
}
291+
292+
/**
293+
* Deletes resources of specific types, such as provider-account, cluster, workspace, or application.
294+
*
295+
* @param {TrueFoundry.TrueFoundryDeleteRequest} request
296+
* @param {TrueFoundryClient.RequestOptions} requestOptions - Request-specific configuration.
297+
*
298+
* @example
299+
* await client.delete({
300+
* manifest: {
301+
* type: "ml-repo",
302+
* name: "name",
303+
* storage_integration_fqn: "storage_integration_fqn",
304+
* collaborators: [{
305+
* subject: "subject",
306+
* role_id: "role_id"
307+
* }]
308+
* }
309+
* })
310+
*/
311+
public delete(
312+
request: TrueFoundry.TrueFoundryDeleteRequest,
313+
requestOptions?: TrueFoundryClient.RequestOptions,
314+
): core.HttpResponsePromise<void> {
315+
return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions));
316+
}
317+
318+
private async __delete(
319+
request: TrueFoundry.TrueFoundryDeleteRequest,
320+
requestOptions?: TrueFoundryClient.RequestOptions,
321+
): Promise<core.WithRawResponse<void>> {
322+
const _response = await (this._options.fetcher ?? core.fetcher)({
323+
url: urlJoin(
324+
(await core.Supplier.get(this._options.baseUrl)) ??
325+
(await core.Supplier.get(this._options.environment)),
326+
"api/svc/v1/delete",
327+
),
328+
method: "POST",
329+
headers: {
330+
Authorization: await this._getAuthorizationHeader(),
331+
"X-Fern-Language": "JavaScript",
332+
"X-Fern-SDK-Name": "truefoundry-sdk",
333+
"X-Fern-SDK-Version": "0.0.0",
334+
"User-Agent": "truefoundry-sdk/0.0.0",
335+
"X-Fern-Runtime": core.RUNTIME.type,
336+
"X-Fern-Runtime-Version": core.RUNTIME.version,
337+
...requestOptions?.headers,
338+
},
339+
contentType: "application/json",
340+
requestType: "json",
341+
body: request,
342+
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
343+
maxRetries: requestOptions?.maxRetries,
344+
abortSignal: requestOptions?.abortSignal,
345+
});
346+
if (_response.ok) {
347+
return { data: undefined, rawResponse: _response.rawResponse };
348+
}
349+
350+
if (_response.error.reason === "status-code") {
351+
throw new errors.TrueFoundryError({
352+
statusCode: _response.error.statusCode,
353+
body: _response.error.body,
354+
rawResponse: _response.rawResponse,
355+
});
356+
}
357+
358+
switch (_response.error.reason) {
359+
case "non-json":
360+
throw new errors.TrueFoundryError({
361+
statusCode: _response.error.statusCode,
362+
body: _response.error.rawBody,
363+
rawResponse: _response.rawResponse,
364+
});
365+
case "timeout":
366+
throw new errors.TrueFoundryTimeoutError("Timeout exceeded when calling POST /api/svc/v1/delete.");
367+
case "unknown":
368+
throw new errors.TrueFoundryError({
369+
message: _response.error.errorMessage,
370+
rawResponse: _response.rawResponse,
371+
});
372+
}
373+
}
374+
375+
protected async _getAuthorizationHeader(): Promise<string> {
376+
const bearer = (await core.Supplier.get(this._options.apiKey)) ?? process?.env["TFY_API_KEY"];
377+
if (bearer == null) {
378+
throw new errors.TrueFoundryError({
379+
message:
380+
"Please specify a bearer by either passing it in to the constructor or initializing a TFY_API_KEY environment variable",
381+
});
382+
}
383+
384+
return `Bearer ${bearer}`;
385+
}
205386
}

src/api/client/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./requests";
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* This file was auto-generated by Fern from our API Definition.
3+
*/
4+
5+
import * as TrueFoundry from "../../index";
6+
7+
/**
8+
* @example
9+
* {
10+
* manifest: {
11+
* type: "ml-repo",
12+
* name: "name",
13+
* storage_integration_fqn: "storage_integration_fqn",
14+
* collaborators: [{
15+
* subject: "subject",
16+
* role_id: "role_id"
17+
* }]
18+
* }
19+
* }
20+
*/
21+
export interface TrueFoundryApplyRequest {
22+
/** manifest of the resource to be created or updated */
23+
manifest: TrueFoundry.TrueFoundryApplyRequestManifest;
24+
/** Dry run the apply operation without actually applying */
25+
dryRun?: boolean;
26+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* This file was auto-generated by Fern from our API Definition.
3+
*/
4+
5+
import * as TrueFoundry from "../../index";
6+
7+
/**
8+
* @example
9+
* {
10+
* manifest: {
11+
* type: "ml-repo",
12+
* name: "name",
13+
* storage_integration_fqn: "storage_integration_fqn",
14+
* collaborators: [{
15+
* subject: "subject",
16+
* role_id: "role_id"
17+
* }]
18+
* }
19+
* }
20+
*/
21+
export interface TrueFoundryDeleteRequest {
22+
/** manifest of the resource to be deleted */
23+
manifest: TrueFoundry.TrueFoundryDeleteRequestManifest;
24+
}

src/api/client/requests/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export { type TrueFoundryApplyRequest } from "./TrueFoundryApplyRequest";
2+
export { type TrueFoundryDeleteRequest } from "./TrueFoundryDeleteRequest";

src/api/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export * from "./resources";
22
export * from "./types";
33
export * from "./errors";
4+
export * from "./client";

src/api/types/AddonComponentName.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ export type AddonComponentName =
2828
| "GRAFANA"
2929
| "TRUEFOUNDRY"
3030
| "TFY_PROMETHEUS_CONFIG"
31-
| "SPARK_OPERATOR";
31+
| "SPARK_OPERATOR"
32+
| "TFY_LOGS";
3233
export const AddonComponentName = {
3334
Argocd: "ARGOCD",
3435
ArgoRollout: "ARGO_ROLLOUT",
@@ -56,4 +57,5 @@ export const AddonComponentName = {
5657
Truefoundry: "TRUEFOUNDRY",
5758
TfyPrometheusConfig: "TFY_PROMETHEUS_CONFIG",
5859
SparkOperator: "SPARK_OPERATOR",
60+
TfyLogs: "TFY_LOGS",
5961
} as const;

src/api/types/AgentApp.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import * as TrueFoundry from "../index";
77
export interface AgentApp {
88
type?: "agent-app";
99
/** Tools available to the Agent app */
10-
tools: TrueFoundry.AgentOpenApiToolWithFqn[];
10+
tools: TrueFoundry.AgentOpenApiToolManifestWithFqn[];
1111
/** Agents available to the Agent app */
12-
agents: TrueFoundry.AgentWithFqn[];
12+
agents: TrueFoundry.AgentManifestWithFqn[];
1313
/** Root Agent for the app. This will be the first agent invoked */
1414
root_agent: string;
1515
}

src/api/types/AgentWithFqn.ts renamed to src/api/types/AgentManifestWithFqn.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* This file was auto-generated by Fern from our API Definition.
33
*/
44

5-
export interface AgentWithFqn {
5+
export interface AgentManifestWithFqn {
66
/** Name of the entity */
77
name?: string;
88
description?: string;

0 commit comments

Comments
 (0)